diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 59a1be47b7f9..14fbe661266e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -2,13 +2,14 @@ # NOTE: Order is important; the last matching pattern takes the most precedence -# Primary repo maintainers +# Cosmos SDK Codeowners -* @cosmos/sdk-core-dev +# Core team as default owners -# CODEOWNERS for docs configuration +* @cosmos/sdk-core-dev -/docs/docusaurus.config.js @julienrbrt @tac0turtle -/docs/sidebars.js @julienrbrt @tac0turtle -/docs/pre.sh @julienrbrt @tac0turtle -/docs/post.sh @julienrbrt @tac0turtle +# Components + +# docs configuration + +/docs/ @cosmos/sdk-core-dev diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml new file mode 100644 index 000000000000..e33d7aafc035 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -0,0 +1,49 @@ +name: 🐛 Bug report +description: Create a report to help us squash bugs! +title: "[Bug]: " +labels: ["T:Bug"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! + Before smashing the submit button please review the template. + + - type: checkboxes + attributes: + label: Is there an existing issue for this? + description: Please search existing issues to avoid creating duplicates. + options: + - label: I have searched the existing issues + required: true + + - type: markdown + attributes: + value: | + IMPORTANT: Prior to opening a bug report, check if it affects one of the core modules + and if its eligible for a bug bounty on `SECURITY.md`. Bugs that are not submitted + through the appropriate channels won't receive any bounty. + - type: textarea + id: what-happened + attributes: + label: What happened? + description: Also tell us, what did you expect to happen? + placeholder: Tell us what you see! + value: "A bug happened!" + validations: + required: true + - type: input + attributes: + label: Cosmos SDK Version + description: If applicable, specify the version you're using + placeholder: 0.46, 0.47, main, etc. + validations: + required: true + - type: textarea + id: reproduce + attributes: + label: How to reproduce? + description: If applicable could you describe how we could reproduce the bug + placeholder: Tell us what how to reproduce the bug! + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/documentation.yml b/.github/ISSUE_TEMPLATE/documentation.yml new file mode 100644 index 000000000000..5e1c3423bb7e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/documentation.yml @@ -0,0 +1,18 @@ +name: Documentation Request +description: Create an issue for missing or incorrect documentation +title: "[Documentation]: " +labels: ["T:Docs"] +body: + - type: markdown + attributes: + value: | + ✰ Thanks for opening an issue! ✰ + Tell us where what you would like to see get added to the documentation or if there is an error in the documentation? + + - type: textarea + id: what-happened + attributes: + label: Summary + placeholder: Description of what you would like to see + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/epics.yml b/.github/ISSUE_TEMPLATE/epics.yml new file mode 100644 index 000000000000..a8fb18378812 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/epics.yml @@ -0,0 +1,43 @@ + +name: Epic +description: Create an epic/user +title: "[Epic]: " +labels: ["T:Epic"] +body: + - type: markdown + attributes: + value: | + Thanks for opening this issue, this template is meant for long lived work scopes, if this is what you're looking for please continue + + - type: textarea + id: summary + attributes: + label: Summary + description: | + What are the user needs? + How could this solution fix the user facing problem? + placeholder: Short, concise description of the proposed feature/changes to the repository + validations: + required: true + - type: textarea + id: problem + attributes: + label: Problem Definition + description: | + Why do we need this feature? + What problems may be addressed by introducing this feature? + What benefits does the SDK stand to gain by including this feature? + Are there any disadvantages of including this feature? + placeholder: Description of the issue being faced + validations: + required: true + - type: textarea + id: work + attributes: + label: Work Breakdown + description: | + Break the work into many bullet points that will later be turned into issues that can be assigned to developers to work on + This work may been to be broken up into phases of work in order to better organize when and how things get done. + placeholder: Description of the steps needed to deliver this feature + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml new file mode 100644 index 000000000000..b3d3fc479f5a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -0,0 +1,41 @@ +name: Feature Request +description: Create a proposal to request a feature +title: "[Feature]: " +labels: ["T:feature-request"] +body: + - type: markdown + attributes: + value: | + ✰ Thanks for opening an issue! ✰ + - type: textarea + id: summary + attributes: + label: Summary + description: | + What are the user needs? + How could this solution fix the user facing problem? + placeholder: Short, concise description of the proposed feature/changes to the repository + validations: + required: true + - type: textarea + id: problem + attributes: + label: Problem Definition + description: | + If applicable please answer the below questions + Why do we need this feature? + What problems may be addressed by introducing this feature? + What benefits does the SDK stand to gain by including this feature? + Are there any disadvantages of including this feature? + placeholder: Description of the issue being faced + validations: + required: false + - type: textarea + id: proposal + attributes: + label: Proposed Feature + description: | + Description of the proposed features or changes to an existing feature to meet your needs + placeholder: Description of the proposed feature(s) + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/module-readiness-checklist.md b/.github/ISSUE_TEMPLATE/module-readiness-checklist.md index 4e6bebed90c2..7892e356bcf6 100644 --- a/.github/ISSUE_TEMPLATE/module-readiness-checklist.md +++ b/.github/ISSUE_TEMPLATE/module-readiness-checklist.md @@ -16,7 +16,7 @@ The module **should not** be included in any Release Candidate tag until it has - [ ] API audit (at least 1 person) (@assignee) - [ ] Are Msg and Query methods and types well-named and organized? - - [ ] Is everything well documented (inline godoc as well as the spec [README.md](https://github.com/cosmos/cosmos-sdk/blob/main/docs/spec/SPEC-SPEC.md) in module directory) + - [ ] Is everything well documented (inline godoc as well as the spec [README.md](https://github.com/cosmos/cosmos-sdk/blob/main/docs/spec/README.md) in module directory) - [ ] State machine audit (at least 2 people) (@assignee1, @assignee2) - [ ] Read through MsgServer code and verify correctness upon visual inspection - [ ] Ensure all state machine code which could be confusing is properly commented diff --git a/.github/ISSUE_TEMPLATE/qa.md b/.github/ISSUE_TEMPLATE/qa.md new file mode 100644 index 000000000000..953ee48032ee --- /dev/null +++ b/.github/ISSUE_TEMPLATE/qa.md @@ -0,0 +1,87 @@ + + +## Summary + + + +## Major Changes + + + +## Gotchas + + + +## QA Breakdown + +* Audit + * [ ] Audit BaseApp + * [ ] Audit Types + * [ ] Audit x/auth + * [ ] Audit x/authz + * [ ] Audit x/bank + * [ ] Audit x/circuit + * [ ] Audit x/consensus + * [ ] Audit x/distribution + * [ ] Audit x/evidence + * [ ] Audit x/epochs + * [ ] Audit x/feegrant + * [ ] Audit x/genutil + * [ ] Audit x/gov + * [ ] Audit x/group + * [ ] Audit x/mint + * [ ] Audit x/nft + * [ ] Audit x/protocolpool + * [ ] Audit x/slashing + * [ ] Audit x/staking + * [ ] Audit x/tx + * [ ] Audit x/upgrade + * [ ] Audit client + * [ ] Audit server + * [ ] Audit store + * [ ] Audit runtime + * [ ] Audit simapp +* [ ] Release alpha +* [ ] Cosmos-SDK testnet +* [ ] Public testnet (IBC, WASM, SDK) +* [ ] Upgrade a chain with data from vX +* Release documentation + * [ ] Audit UPGRADING.md + * [ ] Update all codeblock to the appropriate version number + + +### Audit checklist + +* please copy to a markdown to follow while you walk through the code +* 2 people should be assigned to each section + +* [ ] API audit + * spec audit: check if the spec is complete. + * Are Msg and Query methods and types well-named and organized? + * Is everything well documented (inline godoc as well as package [`README.md`](https://docs.cosmos.network/main/spec/SPEC_MODULE#common-layout) in module directory) + * check the proto definition - make sure everything is in accordance to ADR-30 (at least 1 person, TODO assignee) + * Check new fields and endpoints have the `Since: cosmos-sdk X` comment +* [ ] Completeness audit, fully implemented with tests + * [ ] Genesis import and export of all state + * [ ] Query services + * [ ] CLI methods + * [ ] All necessary migration scripts are present (if this is an upgrade of existing module) +* [ ] State machine audit + * [ ] Read through MsgServer code and verify correctness upon visual inspection + * [ ] Ensure all state machine code which could be confusing is properly commented + * [ ] Make sure state machine logic matches Msg method documentation + * [ ] Ensure that all state machine edge cases are covered with tests and that test coverage is sufficient (at least 90% coverage on module code) + * [ ] Assess potential threats for each method including spam attacks and ensure that threats have been addressed sufficiently. This should be done by writing up threat assessment for each method. Specifically we should be paying attention to: + * [ ] algorithmic complexity and places this could be exploited (ex. nested `for` loops) + * [ ] charging gas complex computation (ex. `for` loops) + * [ ] storage is safe (we don't pollute the state). + * [ ] Assess potential risks of any new third party dependencies and decide whether a dependency audit is needed + * [ ] Check correctness of simulation implementation if any +* [ ] Audit Changelog against commit log, ensuring all breaking changes, bug fixes, and improvements are properly documented. + +If any changes are needed, please make them against main and backport them to release/vX.X.x diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index ef76a1033ad3..eaa49fdbefe5 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,11 +1,4 @@ - - -## Description +# Description Closes: #XXXX @@ -14,37 +7,43 @@ are the most critical to review. --> --- -### Author Checklist +## Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... -* [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title -* [ ] added `!` to the type prefix if API or client breaking change +* [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title, you can find examples of the prefixes below: + +* [ ] confirmed `!` in the type prefix if API or client breaking change * [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#pr-targeting)) * [ ] provided a link to the relevant issue or specification -* [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/main/docs/docs/building-modules) +* [ ] reviewed "Files changed" and left comments if necessary * [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#testing) * [ ] added a changelog entry to `CHANGELOG.md` -* [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) -* [ ] updated the relevant documentation or specification -* [ ] reviewed "Files changed" and left comments if necessary +* [ ] updated the relevant documentation or specification, including comments for [documenting Go code](https://blog.golang.org/godoc) * [ ] confirmed all CI checks have passed -### Reviewers Checklist +## Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* +Please see [Pull Request Reviewer section in the contributing guide](../CONTRIBUTING.md#reviewer) for more information on how to review a pull request. + I have... * [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title -* [ ] confirmed `!` in the type prefix if API or client breaking change -* [ ] confirmed all author checklist items have been addressed -* [ ] reviewed state machine logic -* [ ] reviewed API design and naming -* [ ] reviewed documentation is accurate -* [ ] reviewed tests and test coverage -* [ ] manually tested (if applicable) +* [ ] confirmed all author checklist items have been addressed +* [ ] reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage diff --git a/.github/codeql/config.yml b/.github/codeql/config.yml new file mode 100644 index 000000000000..795efa6cfb8f --- /dev/null +++ b/.github/codeql/config.yml @@ -0,0 +1,11 @@ +packs: + - crypto-com/cosmos-sdk-codeql +queries: + - uses: security-and-quality + - uses: security-experimental + - uses: security-extended +paths-ignore: + - api + - '**/*_test.go' + - '**/*.pulsar.go' + - '**/*.pb.gp' diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 5cafca7c3b88..0c72d9f4e757 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,14 +9,6 @@ updates: interval: daily time: "01:00" - - package-ecosystem: npm - directory: "/docs" - schedule: - interval: weekly - # DevRel should review docs updates - assignees: - - "julienrbrt" - - package-ecosystem: gomod directory: "/" schedule: @@ -51,15 +43,6 @@ updates: labels: - "A:automerge" - dependencies - - package-ecosystem: gomod - directory: "/orm" - schedule: - interval: weekly - day: wednesday - time: "01:25" - labels: - - "A:automerge" - - dependencies - package-ecosystem: gomod directory: "/core" schedule: @@ -106,29 +89,29 @@ updates: - "A:automerge" - dependencies - package-ecosystem: gomod - directory: "/x/tx" + directory: "/schema" schedule: interval: weekly - day: thursday - time: "01:55" + day: wednesday + time: "01:53" labels: - "A:automerge" - dependencies - package-ecosystem: gomod - directory: "/tools/cosmovisor" + directory: "/x/tx" schedule: interval: weekly - day: friday - time: "02:00" + day: thursday + time: "01:55" labels: - "A:automerge" - dependencies - package-ecosystem: gomod - directory: "/tools/rosetta" + directory: "/tools/cosmovisor" schedule: interval: weekly - day: monday - time: "02:05" + day: friday + time: "02:00" labels: - "A:automerge" - dependencies @@ -141,15 +124,6 @@ updates: labels: - "A:automerge" - dependencies - - package-ecosystem: gomod - directory: "/tools/hubl" - schedule: - interval: weekly - day: thursday - time: "02:15" - labels: - - "A:automerge" - - dependencies - package-ecosystem: gomod directory: "/collections" schedule: @@ -223,6 +197,42 @@ updates: labels: - "A:automerge" - dependencies + - package-ecosystem: gomod + directory: "/x/protocolpool" + schedule: + interval: weekly + day: wednesday + time: "03:00" + labels: + - "A:automerge" + - dependencies + - package-ecosystem: gomod + directory: "/x/auth" + schedule: + interval: weekly + day: wednesday + time: "03:10" + labels: + - "A:automerge" + - dependencies + - package-ecosystem: gomod + directory: "/x/epochs" + schedule: + interval: weekly + day: wednesday + time: "03:15" + labels: + - "A:automerge" + - dependencies + - package-ecosystem: gomod + directory: "/tools/benchmark" + schedule: + interval: weekly + day: wednesday + time: "03:25" + labels: + - "A:automerge" + - dependencies # Dependencies should be up to date on release branch - package-ecosystem: gomod @@ -242,3 +252,35 @@ updates: dependency-type: "all" - dependency-name: "cosmossdk.io/*" dependency-type: "all" + - dependency-name: "github.com/cometbft/*" + dependency-type: "all" + ignore: + - dependency-name: "github.com/cometbft/cometbft" + # cometbft 0.37 is not semver, but we want to only update "patch" versions for 0.37.x + update-types: + ["version-update:semver-major", "version-update:semver-minor"] + + - package-ecosystem: gomod + directory: "/" + target-branch: "release/v0.50.x" + schedule: + interval: daily + time: "03:00" + labels: + - "A:automerge" + - dependencies + - "testing-required" + allow: + - dependency-name: "github.com/cosmos/cosmos-sdk/*" + dependency-type: "all" + - dependency-name: "github.com/cosmos/*" + dependency-type: "all" + - dependency-name: "cosmossdk.io/*" + dependency-type: "all" + - dependency-name: "github.com/cometbft/*" + dependency-type: "all" + ignore: + - dependency-name: "github.com/cometbft/cometbft" + # cometbft 0.38 is not semver, but we want to only update "patch" versions for 0.38.x + update-types: + ["version-update:semver-major", "version-update:semver-minor"] diff --git a/.github/pr_labeler.yml b/.github/pr_labeler.yml index f196ff46d060..f7a935b30e72 100644 --- a/.github/pr_labeler.yml +++ b/.github/pr_labeler.yml @@ -1,11 +1,38 @@ +"C:CLI": + - client/**/* + - x/*/client/**/* +"C:Confix": + - tools/confix/**/* +"C:Cosmovisor": + - tools/cosmovisor/**/* +"C:Keys": + - client/keys/**/* +"C:Simulations": + - types/simulation/**/* + - x/simulation/**/* + - x/*/simulation/**/* + - simsx/**/* + - tools/benchmark/**/* +"C:Store": + - store/**/* +"C:collections": + - collections/**/* +"C:core/testing": + - core/testing/**/* +"C:log": + - log/* +"C:schema": + - schema/**/* "C:x/auth": - x/auth/**/* "C:x/authz": - x/authz/**/* "C:x/bank": - x/bank/**/* -"C:x/crisis": - - x/crisis/**/* +"C:x/circuit": + - x/circuit/**/* +"C:x/consensus": + - x/consensus/**/* "C:x/distribution": - x/distribution/**/* "C:x/evidence": @@ -22,56 +49,29 @@ - x/mint/**/* "C:x/nft": - x/nft/**/* -"C:x/params": - - x/params/**/* -"C:Simulations": - - x/simulation/**/* - - x/*/simulation/**/* +"C:x/protocolpool": + - x/protocolpool/**/* "C:x/slashing": - x/slashing/**/* "C:x/staking": - x/staking/**/* -"C:x/upgrade": - - x/upgrade/**/* -"C:x/consensus": - - x/consensus/**/* -"C:x/circuit": - - x/circuit/**/* "C:x/tx": - x/tx/**/* -"C:collections": - - collections/**/* -"C:Cosmovisor": - - tools/cosmovisor/**/* -"C:Rosetta": - - contrib/rosetta/**/* - - tools/rosetta/**/* -"C:Confix": - - tools/confix/**/* -"C:Hubl": - - tools/hubl/**/* -"C:Keys": - - client/keys/**/* +"C:x/upgrade": + - x/upgrade/**/* +"C:x/epochs": + - x/epochs/**/* +"C:x/validate": + - x/validate/**/* +"Type: ADR": + - docs/architecture/**/* "Type: Build": - Makefile - Dockerfile - docker-compose.yml - scripts/* "Type: CI": - - .github/**/*.yml + - .github/** - buf.yaml - .mergify.yml - .golangci.yml -"C:CLI": - - client/**/* - - x/*/client/**/* -"Type: ADR": - - docs/architecture/**/* -"C:container": - - container/**/* -"C:Store": - - store/**/* -"C:orm": - - orm/**/* -"C:log": - - log/* diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 60e734bb7560..a5df99c0bd51 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,4 @@ name: Build SimApp -# This workflow is run on pushes to main & every Pull Requests where a .go, .mod, .sum have been changed on: pull_request: merge_group: @@ -16,48 +15,40 @@ concurrency: jobs: build: - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 strategy: matrix: - go-arch: ["amd64", "arm", "arm64"] + go-arch: ["amd64", "arm64"] # drop 32 bit support for now (and maybe forever) steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.23" check-latest: true - - uses: technote-space/get-diff-action@v6.1.2 - id: git_diff - with: - PATTERNS: | - **/*.go - go.mod - go.sum - **/go.mod - **/go.sum - **/Makefile - Makefile + - name: install aarch64-gcc + if: matrix.go-arch == 'arm64' + run: sudo apt-get install gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu ################### #### Build App #### ################### - name: Build - if: env.GIT_DIFF run: GOARCH=${{ matrix.go-arch }} make build - - name: Build Legacy - if: env.GIT_DIFF - run: GOARCH=${{ matrix.go-arch }} COSMOS_BUILD_OPTIONS=legacy make build + - name: Build with legacy app.go + run: GOARCH=${{ matrix.go-arch }} COSMOS_BUILD_OPTIONS="legacy" make build + # TODO re-add with comet v1 + #- name: Build with BLS12381 + # if: matrix.go-arch == 'amd64' + # run: GOARCH=${{ matrix.go-arch }} COSMOS_BUILD_OPTIONS="bls12381" make build + - name: Build with Secp_cgo + if: matrix.go-arch == 'amd64' + run: GOARCH=${{ matrix.go-arch }} COSMOS_BUILD_OPTIONS="secp" make build + - name: Build with legacy app.go and Secp_cgo + if: matrix.go-arch == 'amd64' + run: GOARCH=${{ matrix.go-arch }} COSMOS_BUILD_OPTIONS="legacy,secp" make build ################### ## Build Tooling ## ################### - name: Build Cosmovisor - if: env.GIT_DIFF run: GOARCH=${{ matrix.go-arch }} make cosmovisor - - name: Build Rosetta - if: env.GIT_DIFF - run: GOARCH=${{ matrix.go-arch }} make rosetta - name: Build Confix - if: env.GIT_DIFF run: GOARCH=${{ matrix.go-arch }} make confix - - name: Build Hubl - if: env.GIT_DIFF - run: GOARCH=${{ matrix.go-arch }} make hubl diff --git a/.github/workflows/changelog-reminder.yml b/.github/workflows/changelog-reminder.yml index 8e04a4a2a06b..6534722004e0 100644 --- a/.github/workflows/changelog-reminder.yml +++ b/.github/workflows/changelog-reminder.yml @@ -9,11 +9,11 @@ permissions: jobs: remind: name: Changelog Reminder - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 # Skip draft PRs and PRs starting with: revert, test, chore, ci, docs, style, build, refactor if: "!github.event.pull_request.draft && !contains(github.event.pull_request.title, 'revert') && !contains(github.event.pull_request.title, 'test') && !contains(github.event.pull_request.title, 'chore') && !contains(github.event.pull_request.title, 'ci') && !contains(github.event.pull_request.title, 'docs') && !contains(github.event.pull_request.title, 'style') && !contains(github.event.pull_request.title, 'build') && !contains(github.event.pull_request.title, 'refactor')" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: mskelton/changelog-reminder-action@v3 with: message: "@${{ github.actor }} your pull request is missing a changelog!" diff --git a/.github/workflows/clean-action-artifacts.yml b/.github/workflows/clean-action-artifacts.yml index b84b15d4bbd3..87204b07f387 100644 --- a/.github/workflows/clean-action-artifacts.yml +++ b/.github/workflows/clean-action-artifacts.yml @@ -7,7 +7,7 @@ on: jobs: remove-old-artifacts: - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 timeout-minutes: 30 steps: diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 4c008d3ac016..3115d082cfa9 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -11,10 +11,14 @@ on: paths: - "**.go" +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: analyze: name: Analyze - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 permissions: actions: read contents: read @@ -22,27 +26,22 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.23" check-latest: true # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: "go" - queries: +security-and-quality,github/codeql/go/ql/src/experimental/InconsistentCode/DeferInLoop.ql@main,github/codeql/go/ql/src/experimental/Unsafe/WrongUsageOfUnsafe.ql@main,github/codeql/go/ql/src/experimental/CWE-369/DivideByZero.ql@main - packs: +crypto-com/cosmos-sdk-codeql - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main + config-file: ./.github/codeql/config.yml # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@v3 # ℹī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -56,4 +55,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/consensuswarn.yml b/.github/workflows/consensuswarn.yml index c2944e342cca..9929d33b5c13 100644 --- a/.github/workflows/consensuswarn.yml +++ b/.github/workflows/consensuswarn.yml @@ -11,9 +11,9 @@ jobs: main: permissions: pull-requests: write # For reading the PR and posting comment - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: orijtech/consensuswarn@main with: roots: "github.com/cosmos/cosmos-sdk/baseapp.BaseApp.PrepareProposal,github.com/cosmos/cosmos-sdk/baseapp.BaseApp.ProcessProposal,github.com/cosmos/cosmos-sdk/baseapp.BaseApp.FinalizeBlock,github.com/cosmos/cosmos-sdk/baseapp.BaseApp.Commit,github.com/cosmos/cosmos-sdk/baseapp.BaseApp.VerifyVoteExtension" diff --git a/.github/workflows/dependabot-update-all.yml b/.github/workflows/dependabot-update-all.yml index 5f6342a76fd5..1b11841ebb58 100644 --- a/.github/workflows/dependabot-update-all.yml +++ b/.github/workflows/dependabot-update-all.yml @@ -2,22 +2,31 @@ name: Dependabot Update All Go Modules on: pull_request permissions: + contents: write pull-requests: write +env: + PR_TITLE: ${{ github.event.pull_request.title }} + jobs: update-all: - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 if: ${{ github.actor == 'dependabot[bot]' }} steps: - - uses: actions/checkout@v3 + - name: Generate Token + uses: actions/create-github-app-token@21cfef2b496dd8ef5b904c159339626a10ad380e # v1 + id: app-token + with: + app-id: "${{ secrets.APP_ID }}" + private-key: "${{ secrets.APP_PRIVATE_KEY }}" + - uses: actions/checkout@v4 with: repository: ${{ github.event.pull_request.head.repo.full_name }} ref: ${{ github.event.pull_request.head.ref }} - # Secret to be added in the repo under Settings > Secrets > Dependabot - token: ${{ secrets.PRBOT_PAT }} - - uses: actions/setup-go@v4 + token: "${{ steps.app-token.outputs.token }}" + - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.23" check-latest: true - name: Extract updated dependency id: deps @@ -25,8 +34,8 @@ jobs: # Extract the dependency name from the PR title # Example: "build(deps): Bump github.com/cosmos/cosmos-sdk from 0.46.0 to 0.47.0" # Extracts "github.com/cosmos/cosmos-sdk" and "0.47.0" - echo "::set-output name=name::$(echo "${{ github.event.pull_request.title }}" | cut -d ' ' -f 3)" - echo "::set-output name=version::$(echo "${{ github.event.pull_request.title }}" | cut -d ' ' -f 7)" + echo "name=$(echo "$PR_TITLE" | cut -d ' ' -f 3)" >> $GITHUB_OUTPUT + echo "version=$(echo "$PR_TITLE" | cut -d ' ' -f 7)" >> $GITHUB_OUTPUT - name: Update all Go modules run: | ./scripts/go-update-dep-all.sh ${{ format('{0}@v{1}', steps.deps.outputs.name, steps.deps.outputs.version) }} @@ -34,5 +43,5 @@ jobs: - name: Commit changes uses: EndBug/add-and-commit@v9 with: - default_author: github_actions + default_author: user_info message: "${{ github.event.pull_request.title }} for all modules" diff --git a/.github/workflows/dependencies-review.yml b/.github/workflows/dependencies-review.yml index 931424adca4f..caf7f29938ee 100644 --- a/.github/workflows/dependencies-review.yml +++ b/.github/workflows/dependencies-review.yml @@ -5,24 +5,49 @@ on: permissions: contents: read + pull-requests: write # Allow commenting on PRs jobs: dependency-review: - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 steps: - name: "Checkout Repository" - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.23" check-latest: true - name: "Dependency Review" - uses: actions/dependency-review-action@v3 + uses: actions/dependency-review-action@v4 with: - base-ref: ${{ github.event.pull_request.base.sha || 'main' }} + base-ref: ${{ github.event.pull_request.base.sha || 'release/v0.53.x' }} head-ref: ${{ github.event.pull_request.head.sha || github.ref }} - fail-on-severity: moderate # otherwise we fail on ourselves due to https://github.com/advisories/GHSA-qfc5-6r3j-jj22 + fail-on-severity: high - name: "Dependency audit" run: ./scripts/dep-assert.sh - name: "Go vulnerability check" - run: make vulncheck + id: govuln + run: | + make vulncheck 2>&1 | tee govulncheck-output.txt || true + echo "govulncheck_output<> $GITHUB_ENV + cat govulncheck-output.txt >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + continue-on-error: true + - name: Debug govulncheck Output + run: cat govulncheck-output.txt || echo "govulncheck-output.txt is empty!" + - name: Add comment to PR + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + github.rest.issues.createComment({ + owner: context.repo.owner, + issue_number: context.issue.number, + repo: context.repo.repo, + body: ` + ⚠ī¸ **govulncheck found vulnerabilities:** + + + >${{ env.govulncheck_output }} + ` + }) \ No newline at end of file diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml deleted file mode 100644 index 703d55004bd5..000000000000 --- a/.github/workflows/deploy-docs.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Deploy docs -# This job builds and deploys documenation to github pages. -# It runs on every push to main with a change in the docs folder. -on: - workflow_dispatch: - push: - branches: - - main - - "release/**" - paths: - - "docs/**" - - "x/**/*.md" - - .github/workflows/deploy-docs.yml - -permissions: - contents: read - -jobs: - build-and-deploy: - permissions: - contents: write # for JamesIves/github-pages-deploy-action to push changes in repo - runs-on: ubuntu-latest - steps: - - name: Checkout 🛎ī¸ - uses: actions/checkout@v3 - with: - persist-credentials: false - fetch-depth: 0 - path: "." - - - name: Setup Node.js 🔧 - uses: actions/setup-node@v3 - with: - node-version: "16.x" - - # npm install npm should be removed when https://github.com/npm/cli/issues/4942 is fixed - - name: Build 🔧 - run: | - npm install -g npm@8.5.5 - make build-docs - - - name: Deploy 🚀 - uses: JamesIves/github-pages-deploy-action@v4.4.2 - with: - branch: gh-pages - folder: ~/output - single-commit: true diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index f52c6a831f2b..bcbac136e8ee 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -9,8 +9,9 @@ on: branches: - main tags: - - "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10 - - "v[0-9]+.[0-9]+.[0-9]+-rc*" # Push events to matching v*, i.e. v1.0-rc1, v20.15.10-rc5 + - "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0.0, v20.15.10 + - "v[0-9]+.[0-9]+.[0-9]+-rc.*" # Push events to matching v*, i.e. v1.0.0-rc.1, v20.15.10-rc.5 + - "v[0-9]+.[0-9]+.[0-9]+-beta.*" # Push events to matching v*, i.e. v1.0.0-beta.1, v20.15.10-beta.5 workflow_dispatch: inputs: tags: @@ -21,6 +22,7 @@ on: permissions: contents: read packages: write + sid-token: write env: # Use docker.io for Docker Hub if empty @@ -30,15 +32,15 @@ env: jobs: build: - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Extract Docker metadata id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | @@ -49,19 +51,23 @@ jobs: latest=false - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Log into registry ${{ env.REGISTRY }} if: ${{ github.event_name != 'pull_request' }} - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Setup Depot + uses: depot/setup-action@v1 + - name: Publish to GitHub Packages - uses: docker/build-push-action@v4 + uses: depot/build-push-action@v1 with: + project: gnm1jqptpw platforms: linux/amd64,linux/arm64 push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} diff --git a/.github/workflows/issue_labeler.yml b/.github/workflows/issue_labeler.yml index bdc4da2e4352..653824cfa411 100644 --- a/.github/workflows/issue_labeler.yml +++ b/.github/workflows/issue_labeler.yml @@ -5,9 +5,9 @@ on: jobs: triage: - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 steps: - - uses: github/issue-labeler@v3.1 + - uses: github/issue-labeler@v3.4 if: join(github.event.issue.labels) == '' with: repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/issues.yml b/.github/workflows/issues.yml index d8dd4586334b..4b296dc8a175 100644 --- a/.github/workflows/issues.yml +++ b/.github/workflows/issues.yml @@ -9,10 +9,10 @@ on: jobs: add-to-project: name: Add issue to project - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 steps: - - uses: actions/add-to-project@v0.5.0 + - uses: actions/add-to-project@v1.0.2 with: project-url: https://github.com/orgs/cosmos/projects/26 +# add all issues opened to the issue board for triage and assignment github-token: ${{ secrets.PERSONAL_TOKEN }} - labeled: T:Sprint,needs-triage diff --git a/.github/workflows/lint-pr.yml b/.github/workflows/lint-pr.yml index 7fc1f5ae949f..5dbeb7ec778f 100644 --- a/.github/workflows/lint-pr.yml +++ b/.github/workflows/lint-pr.yml @@ -15,9 +15,9 @@ jobs: permissions: pull-requests: read # for amannn/action-semantic-pull-request to analyze PRs statuses: write # for amannn/action-semantic-pull-request to mark status of analyzed PR - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 steps: - - uses: amannn/action-semantic-pull-request@v5.2.0 + - uses: amannn/action-semantic-pull-request@v5.5.3 id: lint_pr_title env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index c035bdb2937e..02778d2a9d88 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,26 +8,40 @@ on: merge_group: permissions: contents: read + jobs: golangci: name: golangci-lint - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.23" check-latest: true - uses: technote-space/get-diff-action@v6.1.2 id: git_diff with: PATTERNS: | - **/*.go - go.mod - go.sum - **/go.mod - **/go.sum - - name: run linting + **/*.mk + Makefile + **/Makefile + .golangci.yml + - name: run linting (long) if: env.GIT_DIFF + id: lint_long + run: | + make lint-changes + - uses: technote-space/get-diff-action@v6.1.2 + if: steps.lint_long.outcome == 'skipped' + with: + PATTERNS: | + **/*.go + *.go + - name: run linting (short) + if: steps.lint_long.outcome == 'skipped' && env.GIT_DIFF run: | - make lint + make lint-changes + env: + GIT_DIFF: ${{ env.GIT_DIFF }} + LINT_DIFF: 1 diff --git a/.github/workflows/md-link-checker.yml b/.github/workflows/md-link-checker.yml index 23749b51c0a0..226ce34c693d 100644 --- a/.github/workflows/md-link-checker.yml +++ b/.github/workflows/md-link-checker.yml @@ -1,12 +1,31 @@ name: Check Markdown links on: - schedule: - - cron: '* */24 * * *' + pull_request: + paths: + - "docs/**" jobs: markdown-link-check: - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 steps: - - uses: actions/checkout@v3 - - uses: gaurav-nelson/github-action-markdown-link-check@1.0.15 + - uses: actions/checkout@v4 + - run: cd docs && sh ./pre.sh + - uses: gaurav-nelson/github-action-markdown-link-check@1.0.16 with: folder-path: "docs" + - run: cd docs && sh ./post.sh + sims-notify-failure: + permissions: + contents: none + runs-on: depot-ubuntu-22.04-4 + if: ${{ failure() }} + steps: + - name: Notify Slack on failure + uses: rtCamp/action-slack-notify@v2.3.2 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + SLACK_CHANNEL: sdk-sims + SLACK_USERNAME: Broken Links + SLACK_ICON_EMOJI: ":skull:" + SLACK_COLOR: danger + SLACK_MESSAGE: Links are broken in docs + SLACK_FOOTER: "" diff --git a/.github/workflows/pr-go-mod-tidy-mocks.yml b/.github/workflows/pr-go-mod-tidy-mocks.yml new file mode 100644 index 000000000000..ad45ca9da15d --- /dev/null +++ b/.github/workflows/pr-go-mod-tidy-mocks.yml @@ -0,0 +1,52 @@ +name: "Checks dependencies and mocks generation" +on: + merge_group: + pull_request: + push: + branches: + - main + +concurrency: + group: ci-${{ github.ref }}-pr-go-mod-tidy-mocks + cancel-in-progress: true + +jobs: + go-mod-tidy: + name: Check go mod tidy + runs-on: depot-ubuntu-22.04-4 + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.23" + check-latest: true + - name: Run go mod tidy + run: ./scripts/go-mod-tidy-all.sh + - name: Check for diffs + run: | + git diff --exit-code || { + echo "Please run './scripts/go-mod-tidy-all.sh' and commit the changes"; + exit 1; + } + + generate-mocks: + name: Check up to date mocks + runs-on: depot-ubuntu-22.04-4 + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.23" + check-latest: true + - name: Generate mocks + run: make mocks + - name: Check for diffs + run: | + git diff --exit-code || { + echo "Please run 'make mocks' and commit the changes"; + exit 1; + } diff --git a/.github/workflows/pr-reviews.yml b/.github/workflows/pr-reviews.yml deleted file mode 100644 index 4ed750ee1a4c..000000000000 --- a/.github/workflows/pr-reviews.yml +++ /dev/null @@ -1,26 +0,0 @@ -# Request review on PRs without changing our codeowners file (which is stricter than review team) -name: Request review on PRs - -on: - pull_request_target: - types: - - opened - - reopened - - ready_for_review - branches: - - "main" - - "release/**" - -jobs: - request: - permissions: - pull-requests: write - name: Request reviews on opened PRs - runs-on: ubuntu-latest - steps: - - name: Create PR review request - if: ${{ !github.event.pull_request.draft }} - run: gh pr edit $PR_URL --add-reviewer @cosmos/sdk-core-review - env: - GH_TOKEN: ${{ secrets.PRBOT_PAT }} - PR_URL: ${{ github.event.pull_request.html_url }} diff --git a/.github/workflows/pr_labeler.yml b/.github/workflows/pr_labeler.yml index 885d8b47dbf6..187d9d6e1c42 100644 --- a/.github/workflows/pr_labeler.yml +++ b/.github/workflows/pr_labeler.yml @@ -8,11 +8,11 @@ permissions: jobs: labeler: permissions: - contents: read # for actions/labeler to determine modified files - pull-requests: write # for actions/labeler to add labels to PRs - runs-on: ubuntu-latest + contents: read # for actions/labeler to determine modified files + pull-requests: write # for actions/labeler to add labels to PRs + runs-on: depot-ubuntu-22.04-4 steps: - - uses: actions/labeler@main + - uses: actions/labeler@v4 # v5 is broken, ref https://github.com/actions/labeler/issues/712. Do not bump. with: configuration-path: .github/pr_labeler.yml repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/proto-docker.yml b/.github/workflows/proto-docker.yml index c4e0e5cd1af4..947b07342196 100644 --- a/.github/workflows/proto-docker.yml +++ b/.github/workflows/proto-docker.yml @@ -26,23 +26,25 @@ concurrency: jobs: build: - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 permissions: contents: read packages: write + id-token: write + steps: # set VERSION to new version when making changes, when merged to main the image will automatically be pushed - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@57396166ad8aefe6098280995947635806a0e6ea + uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} # modify value when deploying a new version @@ -50,16 +52,20 @@ jobs: type=semver,pattern={{version}},value=${{ inputs.tags }} - name: Login to GitHub Container Registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 if: ${{ github.event_name != 'pull_request' }} with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Setup Depot + uses: depot/setup-action@v1 + - name: Publish to GHCR - uses: docker/build-push-action@v4 + uses: depot/build-push-action@v1 with: + project: gnm1jqptpw context: ./contrib/devtools platforms: linux/amd64,linux/arm64 push: ${{ github.event_name != 'pull_request' }} diff --git a/.github/workflows/proto-registry.yml b/.github/workflows/proto-registry.yml index d754573e5a6e..11cf908dd9b8 100644 --- a/.github/workflows/proto-registry.yml +++ b/.github/workflows/proto-registry.yml @@ -1,20 +1,23 @@ -name: Buf-Push +# name: Buf Push # Protobuf runs buf (https://buf.build/) push updated proto files to https://buf.build/cosmos/cosmos-sdk # This workflow is only run when a .proto file has been changed -on: - push: - branches: - - main - paths: - - "proto/**" +# on: +# push: +# tags: +# - "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10 +# - "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+" # Push events to matching v*-rc*, i.e. v1.0-rc1, v20.15.10-rc2 +# - "v[0-9]+.[0-9]+.[0-9]+-beta[0-9]+" # Push events to matching v*-beta*, i.e. v1.0-beta1, v20.15.10-beta2 +# - "v[0-9]+.[0-9]+.[0-9]+-alpha[0-9]+" # Push events to matching v*-alpha*, i.e. v1.0-alpha1, v20.15.10-alpha2 +# paths: +# - "proto/**" -jobs: - push: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: bufbuild/buf-setup-action@v1.21.0 - - uses: bufbuild/buf-push-action@v1 - with: - input: "proto" - buf_token: ${{ secrets.BUF_TOKEN }} +# jobs: +# root: +# runs-on: depot-ubuntu-22.04-4 +# name: "Push to buf.build/cosmos/cosmos-sdk" +# steps: +# - uses: actions/checkout@v4 +# - uses: bufbuild/buf-setup-action@v1.29.0 +# - run: buf push proto --tag ${{ github.ref_type == 'tag' && github.ref_name || github.sha }} # https://github.com/bufbuild/buf-push-action/issues/20 + +## TODO at each module tag to their own buf repository diff --git a/.github/workflows/proto.yml b/.github/workflows/proto.yml index 1c997e8a6595..4a2fe382ce27 100644 --- a/.github/workflows/proto.yml +++ b/.github/workflows/proto.yml @@ -11,20 +11,20 @@ permissions: jobs: lint: - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 timeout-minutes: 5 steps: - - uses: actions/checkout@v3 - - uses: bufbuild/buf-setup-action@v1.21.0 + - uses: actions/checkout@v4 + - uses: bufbuild/buf-setup-action@v1.38.0 - uses: bufbuild/buf-lint-action@v1 with: input: "proto" break-check: - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 steps: - - uses: actions/checkout@v3 - - uses: bufbuild/buf-setup-action@v1.21.0 + - uses: actions/checkout@v4 + - uses: bufbuild/buf-setup-action@v1.38.0 - uses: bufbuild/buf-breaking-action@v1 with: input: "proto" diff --git a/.github/workflows/release-confix.yml b/.github/workflows/release-confix.yml index 9cf6a9ae548d..998c3814f7c0 100644 --- a/.github/workflows/release-confix.yml +++ b/.github/workflows/release-confix.yml @@ -11,12 +11,12 @@ jobs: goreleaser: permissions: contents: write # for goreleaser/goreleaser-action to create a GitHub release - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.23" check-latest: true # get 'v*.*.*' part from 'confix/v*.*.*' and save to $GITHUB_ENV - name: Set env diff --git a/.github/workflows/release-cosmovisor.yml b/.github/workflows/release-cosmovisor.yml index ba55871311d9..1d9f14b7ded1 100644 --- a/.github/workflows/release-cosmovisor.yml +++ b/.github/workflows/release-cosmovisor.yml @@ -11,12 +11,12 @@ jobs: goreleaser: permissions: contents: write # for goreleaser/goreleaser-action to create a GitHub release - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.23" check-latest: true # get 'v*.*.*' part from 'cosmovisor/v*.*.*' and save to $GITHUB_ENV - name: Set env diff --git a/.github/workflows/release-rosetta.yml b/.github/workflows/release-simd.yml similarity index 63% rename from .github/workflows/release-rosetta.yml rename to .github/workflows/release-simd.yml index 002976f3324e..a70e8fe4f6cd 100644 --- a/.github/workflows/release-rosetta.yml +++ b/.github/workflows/release-simd.yml @@ -1,9 +1,9 @@ -name: Release Rosetta +name: Release Simd on: push: tags: - - "tools/rosetta/v*.*.*" + - "simd/v*.*.*" permissions: contents: read @@ -11,17 +11,17 @@ jobs: goreleaser: permissions: contents: write # for goreleaser/goreleaser-action to create a GitHub release - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.23" check-latest: true - # get 'v*.*.*' part from 'rosetta/v*.*.*' and save to $GITHUB_ENV + # get 'v*.*.*' part from 'simd/v*.*.*' and save to $GITHUB_ENV - name: Set env - run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/rosetta/}" >> $GITHUB_ENV - # remove the possible pre-existing same tag for cosmos-sdk related tags instead of rosetta tags + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/simd/}" >> $GITHUB_ENV + # remove the possible pre-existing same tag for cosmos-sdk related tags instead of simd tags # Because goreleaser enforces semantic versioning and will error on non compliant tags.(https://goreleaser.com/limitations/semver/) - name: Tag without prefix locally to avoid error in goreleaser run: |- @@ -32,8 +32,8 @@ jobs: with: # stick to version v0.179.0(https://github.com/cosmos/cosmos-sdk/issues/11125) version: v0.179.0 - args: release --rm-dist --skip-validate --release-notes ./RELEASE_NOTES.md - workdir: tools/rosetta + args: release --rm-dist --skip-validate + workdir: simapp env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GORELEASER_CURRENT_TAG: rosetta/${{ env.RELEASE_VERSION }} + GORELEASER_CURRENT_TAG: simd/${{ env.RELEASE_VERSION }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 10619caa7043..b5700ce0c99e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,30 +14,30 @@ jobs: release: permissions: contents: write # for goreleaser/goreleaser-action to create a GitHub release - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.23" check-latest: true - name: Unshallow run: git fetch --prune --unshallow - name: Create release uses: goreleaser/goreleaser-action@v3 with: - args: release --rm-dist --release-notes ./RELEASE_NOTES.md + args: release --clean --release-notes ./RELEASE_NOTES.md env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} release-success: needs: release if: ${{ success() }} - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 steps: - name: Notify Slack on success - uses: rtCamp/action-slack-notify@v2.2.0 + uses: rtCamp/action-slack-notify@v2.3.2 env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} SLACK_CHANNEL: cosmos-tech diff --git a/.github/workflows/sims-045.yml b/.github/workflows/sims-045.yml index f1638c67f6ff..e837bd3d0f5c 100644 --- a/.github/workflows/sims-045.yml +++ b/.github/workflows/sims-045.yml @@ -21,7 +21,7 @@ jobs: ref: "release/v0.45.x" - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.23" check-latest: true - run: make build @@ -33,7 +33,7 @@ jobs: steps: - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.23" check-latest: true - name: Install runsim run: go install github.com/cosmos/tools/cmd/runsim@v1.0.0 @@ -51,7 +51,7 @@ jobs: ref: "release/v0.45.x" - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.23" check-latest: true - uses: actions/cache@v3 with: @@ -70,7 +70,7 @@ jobs: ref: "release/v0.45.x" - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.23" check-latest: true - uses: actions/cache@v3 with: @@ -90,7 +90,7 @@ jobs: ref: "release/v0.45.x" - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.23" check-latest: true - uses: actions/cache@v3 with: diff --git a/.github/workflows/sims-046.yml b/.github/workflows/sims-046.yml index cbc0fead882d..515a76997fe9 100644 --- a/.github/workflows/sims-046.yml +++ b/.github/workflows/sims-046.yml @@ -21,7 +21,7 @@ jobs: ref: "release/v0.46.x" - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.23" check-latest: true - run: make build @@ -33,7 +33,7 @@ jobs: steps: - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.23" check-latest: true - name: Install runsim run: go install github.com/cosmos/tools/cmd/runsim@v1.0.0 @@ -52,7 +52,7 @@ jobs: ref: "release/v0.46.x" - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.23" check-latest: true - uses: actions/cache@v3 with: @@ -71,7 +71,7 @@ jobs: ref: "release/v0.46.x" - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.23" check-latest: true - uses: actions/cache@v3 with: @@ -90,7 +90,7 @@ jobs: ref: "release/v0.46.x" - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.23" check-latest: true - uses: actions/cache@v3 with: diff --git a/.github/workflows/sims-047.yml b/.github/workflows/sims-047.yml index cc19982df934..a438c4ac08c6 100644 --- a/.github/workflows/sims-047.yml +++ b/.github/workflows/sims-047.yml @@ -21,7 +21,7 @@ jobs: ref: "release/v0.47.x" - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.23" check-latest: true - run: make build @@ -33,7 +33,7 @@ jobs: steps: - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.23" check-latest: true - name: Install runsim run: go install github.com/cosmos/tools/cmd/runsim@v1.0.0 @@ -52,7 +52,7 @@ jobs: ref: "release/v0.47.x" - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.23" check-latest: true - uses: actions/cache@v3 with: @@ -71,7 +71,7 @@ jobs: ref: "release/v0.47.x" - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.23" check-latest: true - uses: actions/cache@v3 with: @@ -90,7 +90,7 @@ jobs: ref: "release/v0.47.x" - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.23" check-latest: true - uses: actions/cache@v3 with: diff --git a/.github/workflows/sims-050.yml b/.github/workflows/sims-050.yml new file mode 100644 index 000000000000..fe80f92baae2 --- /dev/null +++ b/.github/workflows/sims-050.yml @@ -0,0 +1,145 @@ +name: Sims release/0.50.x +# Sims workflow runs multiple types of simulations (nondeterminism, import-export, after-import, multi-seed-short) +# This workflow will run on all Pull Requests, if a .go, .mod or .sum file have been changed +on: + schedule: + - cron: "0 0,12 * * *" + release: + types: [published] + +concurrency: + group: ci-${{ github.ref }}-sims-050 + cancel-in-progress: true + +jobs: + build: + runs-on: depot-ubuntu-22.04-4 + if: "!contains(github.event.head_commit.message, 'skip-sims')" + steps: + - uses: actions/checkout@v4 + with: + ref: "release/v0.50.x" + - uses: actions/setup-go@v5 + with: + go-version: "1.23" + check-latest: true + - run: make build + + install-runsim: + permissions: + contents: none + runs-on: depot-ubuntu-22.04-4 + needs: build + steps: + - uses: actions/setup-go@v5 + with: + go-version: "1.23" + check-latest: true + - name: Install runsim + run: go install github.com/cosmos/tools/cmd/runsim@v1.0.0 + - uses: actions/cache@v4 + with: + path: ~/go/bin + key: ${{ runner.os }}-go-runsim-binary + + test-sim-import-export: + runs-on: depot-ubuntu-22.04-4 + needs: [build, install-runsim] + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + with: + ref: "release/v0.50.x" + - uses: actions/setup-go@v5 + with: + go-version: "1.23" + check-latest: true + - uses: actions/cache@v4 + with: + path: ~/go/bin + key: ${{ runner.os }}-go-runsim-binary + - name: test-sim-import-export + run: | + make test-sim-import-export + + test-sim-after-import: + runs-on: depot-ubuntu-22.04-4 + needs: [build, install-runsim] + steps: + - uses: actions/checkout@v4 + with: + ref: "release/v0.50.x" + - uses: actions/setup-go@v5 + with: + go-version: "1.23" + check-latest: true + - uses: actions/cache@v4 + with: + path: ~/go/bin + key: ${{ runner.os }}-go-runsim-binary + - name: test-sim-after-import + run: | + make test-sim-after-import + + test-sim-multi-seed-short: + runs-on: depot-ubuntu-22.04-4 + needs: [build, install-runsim] + steps: + - uses: actions/checkout@v4 + with: + ref: "release/v0.50.x" + - uses: actions/setup-go@v5 + with: + go-version: "1.23" + check-latest: true + - uses: actions/cache@v4 + with: + path: ~/go/bin + key: ${{ runner.os }}-go-runsim-binary + - name: test-sim-multi-seed-short + run: | + make test-sim-multi-seed-short + + sims-notify-success: + needs: + [test-sim-multi-seed-short, test-sim-after-import, test-sim-import-export] + runs-on: depot-ubuntu-22.04-4 + if: ${{ success() }} + steps: + - uses: actions/checkout@v4 + - name: Get previous workflow status + uses: ./.github/actions/last-workflow-status + id: last_status + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Notify Slack on success + if: ${{ steps.last_status.outputs.last_status == 'failure' }} + uses: rtCamp/action-slack-notify@v2.3.2 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + SLACK_CHANNEL: sdk-sims + SLACK_USERNAME: Sim Tests release/0.50.x + SLACK_ICON_EMOJI: ":white_check_mark:" + SLACK_COLOR: good + SLACK_MESSAGE: 0.50.x Sims are passing + SLACK_FOOTER: "" + + sims-notify-failure: + permissions: + contents: none + needs: + [test-sim-multi-seed-short, test-sim-after-import, test-sim-import-export] + runs-on: depot-ubuntu-22.04-4 + if: ${{ failure() }} + steps: + - name: Notify Slack on failure + uses: rtCamp/action-slack-notify@v2.3.2 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + SLACK_CHANNEL: sdk-sims + SLACK_USERNAME: Sim Tests release/0.50.x + SLACK_ICON_EMOJI: ":skull:" + SLACK_COLOR: danger + SLACK_MESSAGE: 0.50.x Sims are failing + SLACK_FOOTER: "" diff --git a/.github/workflows/sims-053.yml b/.github/workflows/sims-053.yml new file mode 100644 index 000000000000..412b5f3f911e --- /dev/null +++ b/.github/workflows/sims-053.yml @@ -0,0 +1,146 @@ +name: Sims release/0.53.x +# Sims workflow runs multiple types of simulations (nondeterminism, import-export, after-import, multi-seed-short) +# This workflow will run on all Pull Requests, if a .go, .mod or .sum file have been changed +on: + schedule: + - cron: "0 0,12 * * *" + release: + types: [published] + +concurrency: + group: ci-${{ github.ref }}-sims-053 + cancel-in-progress: true + +jobs: + build: + permissions: + contents: read # for actions/checkout to fetch code + runs-on: depot-ubuntu-22.04-16 + if: "!contains(github.event.head_commit.message, 'skip-sims')" + steps: + - uses: actions/checkout@v4 + with: + ref: "release/v0.53.x" + - uses: actions/setup-go@v5 + with: + go-version: "1.23" + check-latest: true + - run: make build + + test-sim-import-export: + runs-on: depot-ubuntu-22.04-16 + needs: [build] + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + with: + ref: "release/v0.53.x" + - uses: actions/setup-go@v5 + with: + go-version: "1.23" + check-latest: true + - name: test-sim-import-export + run: | + make test-sim-import-export + + test-sim-after-import: + runs-on: depot-ubuntu-22.04-16 + needs: [build] + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + with: + ref: "release/v0.53.x" + - uses: actions/setup-go@v5 + with: + go-version: "1.23" + check-latest: true + - name: test-sim-after-import + run: | + make test-sim-after-import + + test-sim-deterministic: + runs-on: depot-ubuntu-22.04-16 + needs: [build] + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + with: + ref: "release/v0.53.x" + - uses: actions/setup-go@v5 + with: + go-version: "1.23" + check-latest: true + - name: test-sim-nondeterminism + run: | + make test-sim-nondeterminism + + test-sim-multi-seed-short: + runs-on: depot-ubuntu-22.04-16 + needs: [build] + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + with: + ref: "release/v0.53.x" + - uses: actions/setup-go@v5 + with: + go-version: "1.23" + check-latest: true + - name: test-sim-multi-seed-short + run: | + make test-sim-multi-seed-short + + sims-notify-success: + needs: + [ + test-sim-multi-seed-short, + test-sim-after-import, + test-sim-import-export, + test-sim-deterministic, + ] + runs-on: depot-ubuntu-22.04-16 + if: ${{ success() }} + steps: + - uses: actions/checkout@v4 + - name: Get previous workflow status + uses: ./.github/actions/last-workflow-status + id: last_status + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Notify Slack on success + if: ${{ steps.last_status.outputs.last_status == 'failure' }} + uses: rtCamp/action-slack-notify@v2.3.2 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + SLACK_CHANNEL: sdk-sims + SLACK_USERNAME: Sim Tests release/0.53.x + SLACK_ICON_EMOJI: ":white_check_mark:" + SLACK_COLOR: good + SLACK_MESSAGE: 0.53.x Sims are passing + SLACK_FOOTER: "" + + sims-notify-failure: + permissions: + contents: none + needs: + [ + test-sim-multi-seed-short, + test-sim-after-import, + test-sim-import-export, + test-sim-deterministic, + ] + runs-on: depot-ubuntu-22.04-16 + if: ${{ failure() }} + steps: + - name: Notify Slack on failure + uses: rtCamp/action-slack-notify@v2.3.2 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + SLACK_CHANNEL: sdk-sims + SLACK_USERNAME: Sim Tests release/0.53.x + SLACK_ICON_EMOJI: ":skull:" + SLACK_COLOR: danger + SLACK_MESSAGE: 0.53.x Sims are failing + SLACK_FOOTER: "" diff --git a/.github/workflows/sims-nightly.yml b/.github/workflows/sims-nightly.yml index 0a88662da665..ec4b106b5f32 100644 --- a/.github/workflows/sims-nightly.yml +++ b/.github/workflows/sims-nightly.yml @@ -15,45 +15,27 @@ concurrency: cancel-in-progress: true jobs: - install-runsim: - permissions: - contents: none - runs-on: ubuntu-latest - steps: - - uses: actions/setup-go@v4 - with: - go-version: "1.20" - check-latest: true - - name: Install runsim - run: go install github.com/cosmos/tools/cmd/runsim@v1.0.0 - - uses: actions/cache@v3 - with: - path: ~/go/bin - key: ${{ runner.os }}-go-runsim-binary - test-sim-multi-seed-long: - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.23" check-latest: true - - uses: actions/cache@v3 - with: - path: ~/go/bin - key: ${{ runner.os }}-go-runsim-binary - name: test-sim-multi-seed-long + env: + GOMEMLIMIT: 14GiB # reserve 2 GiB as buffer for GC to avoid OOM run: | make test-sim-multi-seed-long sims-notify-success: needs: [test-sim-multi-seed-long] - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 if: ${{ success() }} steps: - name: Check out repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Get previous workflow status uses: ./.github/actions/last-workflow-status id: last_status @@ -62,7 +44,7 @@ jobs: - name: Notify Slack on success if: ${{ steps.last_status.outputs.last_status == 'failure' }} - uses: rtCamp/action-slack-notify@v2.2.0 + uses: rtCamp/action-slack-notify@v2.3.2 env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} SLACK_CHANNEL: sdk-sims @@ -76,11 +58,11 @@ jobs: permissions: contents: none needs: [test-sim-multi-seed-long] - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 if: ${{ failure() }} steps: - name: Notify Slack on failure - uses: rtCamp/action-slack-notify@v2.2.0 + uses: rtCamp/action-slack-notify@v2.3.2 env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} SLACK_CHANNEL: sdk-sims diff --git a/.github/workflows/sims.yml b/.github/workflows/sims.yml index 1c4bb1cb3a3c..59dc62b0c6b3 100644 --- a/.github/workflows/sims.yml +++ b/.github/workflows/sims.yml @@ -15,83 +15,85 @@ jobs: build: permissions: contents: read # for actions/checkout to fetch code - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-16 if: "!contains(github.event.head_commit.message, 'skip-sims')" steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.23" check-latest: true - run: make build - - name: Install runsim - run: go install github.com/cosmos/tools/cmd/runsim@v1.0.0 - - uses: actions/cache@v3 - with: - path: ~/go/bin - key: ${{ runner.os }}-go-runsim-binary test-sim-import-export: - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-16 needs: [build] timeout-minutes: 60 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.23" check-latest: true - - uses: actions/cache@v3 - with: - path: ~/go/bin - key: ${{ runner.os }}-go-runsim-binary - name: test-sim-import-export run: | make test-sim-import-export test-sim-after-import: - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-16 needs: [build] + timeout-minutes: 60 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.23" check-latest: true - - uses: actions/cache@v3 - with: - path: ~/go/bin - key: ${{ runner.os }}-go-runsim-binary - name: test-sim-after-import run: | make test-sim-after-import - test-sim-multi-seed-short: - runs-on: ubuntu-latest + test-sim-deterministic: + runs-on: depot-ubuntu-22.04-16 needs: [build] timeout-minutes: 60 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.23" check-latest: true - - uses: actions/cache@v3 + - name: test-sim-nondeterminism + run: | + make test-sim-nondeterminism + + test-sim-multi-seed-short: + runs-on: depot-ubuntu-22.04-16 + needs: [build] + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - path: ~/go/bin - key: ${{ runner.os }}-go-runsim-binary + go-version: "1.23" + check-latest: true - name: test-sim-multi-seed-short run: | make test-sim-multi-seed-short sims-notify-success: needs: - [test-sim-multi-seed-short, test-sim-after-import, test-sim-import-export] - runs-on: ubuntu-latest + [ + test-sim-multi-seed-short, + test-sim-after-import, + test-sim-import-export, + test-sim-deterministic, + ] + runs-on: depot-ubuntu-22.04-16 if: ${{ success() }} steps: - name: Check out repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Get previous workflow status uses: ./.github/actions/last-workflow-status id: last_status @@ -100,7 +102,7 @@ jobs: - name: Notify Slack on success if: ${{ steps.last_status.outputs.last_status == 'failure' }} - uses: rtCamp/action-slack-notify@v2.2.0 + uses: rtCamp/action-slack-notify@v2.3.2 env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} SLACK_CHANNEL: sdk-sims @@ -114,12 +116,17 @@ jobs: permissions: contents: none needs: - [test-sim-multi-seed-short, test-sim-after-import, test-sim-import-export] - runs-on: ubuntu-latest + [ + test-sim-multi-seed-short, + test-sim-after-import, + test-sim-import-export, + test-sim-deterministic, + ] + runs-on: depot-ubuntu-22.04-16 if: ${{ failure() }} steps: - name: Notify Slack on failure - uses: rtCamp/action-slack-notify@v2.2.0 + uses: rtCamp/action-slack-notify@v2.3.2 env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} SLACK_CHANNEL: sdk-sims diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 20630a137610..4874a3d593c2 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -11,9 +11,9 @@ jobs: permissions: issues: write # for actions/stale to close stale issues pull-requests: write # for actions/stale to close stale PRs - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 steps: - - uses: actions/stale@v8 + - uses: actions/stale@v9 with: repo-token: ${{ secrets.GITHUB_TOKEN }} stale-pr-message: "This pull request has been automatically marked as stale because it has not had diff --git a/.github/workflows/staticmajor.yml b/.github/workflows/staticmajor.yml deleted file mode 100644 index b3ce4397db25..000000000000 --- a/.github/workflows/staticmajor.yml +++ /dev/null @@ -1,23 +0,0 @@ -# Staticmajor: Static analyzer to catch leaking resources & other bad code patterns -name: Detect leaking resources and bad code patterns -on: - push: - branches: - - main - pull_request: - workflow_dispatch: - -jobs: - run_staticmajor: - runs-on: ubuntu-latest - steps: - - name: Check out repository code - uses: actions/checkout@v3 - - name: Staticmajor action - id: staticmajor - uses: orijtech/staticmajor-action@main - with: - packages: ./... - resleak: true - structslop: false - tests: false diff --git a/.github/workflows/systemtests.yml b/.github/workflows/systemtests.yml new file mode 100644 index 000000000000..a50be01ecffa --- /dev/null +++ b/.github/workflows/systemtests.yml @@ -0,0 +1,63 @@ +name: System Tests +on: + pull_request: + merge_group: + push: + branches: + - main + - release/v0.53.x + +permissions: + contents: read + +concurrency: + group: ci-${{ github.ref }}-system-tests + cancel-in-progress: true + +jobs: + setup: + runs-on: depot-ubuntu-22.04-4 + outputs: + git_diff: ${{ steps.git_diff.outputs.diff }} + steps: + - uses: actions/checkout@v4 + with: + fetch-tags: true + - uses: actions/setup-go@v5 + with: + go-version: "1.23" + check-latest: true + cache: true + cache-dependency-path: | + ./go.sum + - uses: technote-space/get-diff-action@v6.1.2 + id: git_diff + with: + PATTERNS: | + **/*.go + go.mod + go.sum + **/go.mod + **/go.sum + **/Makefile + Makefile + + test-system: + needs: setup + if: needs.setup.outputs.git_diff + runs-on: depot-ubuntu-22.04-4 + steps: + - uses: actions/checkout@v4 + - name: Run system tests + run: | + make test-system + + test-system-legacy: + needs: setup + if: needs.setup.outputs.git_diff + runs-on: depot-ubuntu-22.04-4 + steps: + - uses: actions/checkout@v4 + - name: Run legacy system tests + run: | + COSMOS_BUILD_OPTIONS=legacy make test-system diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 92b0dc9b1d79..7fd49c0ae22c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,7 +7,8 @@ on: - main permissions: - contents: read + contents: write + pull-requests: write concurrency: group: ci-${{ github.ref }}-tests @@ -15,46 +16,46 @@ concurrency: jobs: split-test-files: - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.23" check-latest: true - name: Create a file with all core Cosmos SDK pkgs run: go list ./... > pkgs.txt - name: Split pkgs into 4 files run: split -d -n l/4 pkgs.txt pkgs.txt.part. - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: "${{ github.sha }}-00" path: ./pkgs.txt.part.00 - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: "${{ github.sha }}-01" path: ./pkgs.txt.part.01 - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: "${{ github.sha }}-02" path: ./pkgs.txt.part.02 - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: "${{ github.sha }}-03" path: ./pkgs.txt.part.03 tests: - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 needs: split-test-files strategy: fail-fast: false matrix: part: ["00", "01", "02", "03"] steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.23" check-latest: true cache: true cache-dependency-path: go.sum @@ -69,26 +70,26 @@ jobs: **/go.sum **/Makefile Makefile - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: "${{ github.sha }}-${{ matrix.part }}" - name: test & coverage report creation if: env.GIT_DIFF run: | cat pkgs.txt.part.${{ matrix.part }} | xargs go test -mod=readonly -race -timeout 30m -coverprofile=${{ matrix.part }}profile.out -covermode=atomic -tags='ledger test_ledger_mock' - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: env.GIT_DIFF with: name: "${{ github.sha }}-${{ matrix.part }}-coverage" path: ./${{ matrix.part }}profile.out test-integration: - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.23" check-latest: true cache: true cache-dependency-path: go.sum @@ -107,7 +108,7 @@ jobs: if: env.GIT_DIFF run: | make test-integration-cov - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: env.GIT_DIFF with: name: "${{ github.sha }}-integration-coverage" @@ -119,7 +120,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.21" check-latest: true cache: true cache-dependency-path: go.sum @@ -138,17 +139,17 @@ jobs: if: env.GIT_DIFF run: | make test-e2e-cov - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: env.GIT_DIFF with: name: "${{ github.sha }}-e2e-coverage" path: ./tests/e2e-profile.out repo-analysis: - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 needs: [tests, test-integration, test-e2e] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: technote-space/get-diff-action@v6.1.2 id: git_diff with: @@ -158,76 +159,39 @@ jobs: go.sum **/go.mod **/go.sum - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 if: env.GIT_DIFF with: name: "${{ github.sha }}-00-coverage" - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 if: env.GIT_DIFF with: name: "${{ github.sha }}-01-coverage" - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 if: env.GIT_DIFF with: name: "${{ github.sha }}-02-coverage" - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 if: env.GIT_DIFF with: name: "${{ github.sha }}-03-coverage" - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 if: env.GIT_DIFF with: name: "${{ github.sha }}-integration-coverage" - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 if: env.GIT_DIFF with: name: "${{ github.sha }}-e2e-coverage" continue-on-error: true - - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft }} - uses: SonarSource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - - liveness-test: - runs-on: ubuntu-latest - timeout-minutes: 15 - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 - with: - go-version: "1.20" - check-latest: true - cache: true - cache-dependency-path: go.sum - - uses: technote-space/get-diff-action@v6.1.2 - id: git_diff - with: - PATTERNS: | - **/*.go - go.mod - go.sum - **/go.mod - **/go.sum - **/Makefile - Makefile - - name: start localnet - if: env.GIT_DIFF - run: | - make clean localnet-start - - name: test liveness - if: env.GIT_DIFF - run: | - ./contrib/localnet_liveness.sh 100 5 50 localhost test-sim-nondeterminism: - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.23" check-latest: true cache: true cache-dependency-path: go.sum @@ -255,12 +219,12 @@ jobs: # They run when there is a diff in their respective directories. test-clientv2: - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.23" check-latest: true cache: true cache-dependency-path: client/v2/go.sum @@ -275,23 +239,15 @@ jobs: if: env.GIT_DIFF run: | cd client/v2 - go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} - uses: SonarSource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - with: - projectBaseDir: client/v2/ + go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock' ./... test-core: - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.23" check-latest: true cache: true cache-dependency-path: core/go.sum @@ -306,24 +262,16 @@ jobs: if: env.GIT_DIFF run: | cd core - go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} - uses: SonarSource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - with: - projectBaseDir: core/ + go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock' ./... test-depinject: - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.20" - check-latest: true + go-version: "1.22" + check-latest: false cache: true cache-dependency-path: depinject/go.sum - uses: technote-space/get-diff-action@v6.1.2 @@ -337,21 +285,15 @@ jobs: if: env.GIT_DIFF run: | cd depinject - go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} - uses: SonarSource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock' ./... test-errors: - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.22" check-latest: true cache: true cache-dependency-path: errors/go.sum @@ -366,23 +308,15 @@ jobs: if: env.GIT_DIFF run: | cd errors - go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} - uses: SonarSource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - with: - projectBaseDir: errors/ + go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock' ./... test-math: - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.22" check-latest: true cache: true cache-dependency-path: math/go.sum @@ -397,95 +331,37 @@ jobs: if: env.GIT_DIFF run: | cd math - go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} - uses: SonarSource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - with: - projectBaseDir: math/ - - test-simapp: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 - with: - go-version: "1.20" - check-latest: true - cache: true - cache-dependency-path: simapp/go.sum - - uses: technote-space/get-diff-action@v6.1.2 - id: git_diff - with: - PATTERNS: | - **/*.go - simapp/go.mod - simapp/go.sum - - name: tests simapp - if: env.GIT_DIFF - run: | - cd simapp - go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - - name: tests simapp v1 - if: env.GIT_DIFF - run: | - cd simapp - go test -mod=readonly -timeout 30m -tags='app_v1 norace ledger test_ledger_mock rocksdb_build' ./... - - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} - uses: SonarSource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - with: - projectBaseDir: simapp/ + go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock' ./... - test-rosetta: - runs-on: ubuntu-latest - timeout-minutes: 30 + test-schema: + runs-on: depot-ubuntu-22.04-4 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.20" - check-latest: true + go-version: "1.12" cache: true - cache-dependency-path: tools/rosetta/go.sum + cache-dependency-path: schema/go.sum - uses: technote-space/get-diff-action@v6.1.2 id: git_diff with: PATTERNS: | - contrib/rosetta/* - tools/rosetta/**/*.go - tools/rosetta/go.mod - tools/rosetta/go.sum - tools/rosetta/Makefile - Makefile + schema/**/*.go + schema/go.mod + schema/go.sum - name: tests if: env.GIT_DIFF run: | - make test-rosetta - cd tools/rosetta - go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} - uses: SonarSource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - with: - projectBaseDir: tools/rosetta/ + cd schema + go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock' ./... test-collections: - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.23" check-latest: true cache: true cache-dependency-path: collections/go.sum @@ -500,54 +376,15 @@ jobs: if: env.GIT_DIFF run: | cd collections - go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} - uses: SonarSource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - with: - projectBaseDir: collections/ - - test-orm: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 - with: - go-version: "1.20" - check-latest: true - cache: true - cache-dependency-path: orm/go.sum - - uses: technote-space/get-diff-action@v6.1.2 - id: git_diff - with: - PATTERNS: | - orm/**/*.go - orm/go.mod - orm/go.sum - - name: tests - if: env.GIT_DIFF - run: | - cd orm - go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} - uses: SonarSource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - with: - projectBaseDir: orm/ + go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock' ./... test-cosmovisor: - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.23" check-latest: true cache: true cache-dependency-path: tools/cosmovisor/go.sum @@ -562,23 +399,15 @@ jobs: if: env.GIT_DIFF run: | cd tools/cosmovisor - go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} - uses: SonarSource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - with: - projectBaseDir: tools/cosmovisor/ + go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock' ./... test-confix: - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.23" check-latest: true cache: true cache-dependency-path: tools/confix/go.sum @@ -593,54 +422,15 @@ jobs: if: env.GIT_DIFF run: | cd tools/confix - go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} - uses: SonarSource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - with: - projectBaseDir: tools/confix/ - - test-hubl: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 - with: - go-version: "1.20" - check-latest: true - cache: true - cache-dependency-path: tools/hubl/go.sum - - uses: technote-space/get-diff-action@v6.1.2 - id: git_diff - with: - PATTERNS: | - tools/hubl/**/*.go - tools/hubl/go.mod - tools/hubl/go.sum - - name: tests - if: env.GIT_DIFF - run: | - cd tools/hubl - go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} - uses: SonarSource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - with: - projectBaseDir: tools/hubl/ + go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock' ./... test-store: - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.23" check-latest: true cache: true cache-dependency-path: store/go.sum @@ -655,23 +445,15 @@ jobs: if: env.GIT_DIFF run: | cd store - go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} - uses: SonarSource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - with: - projectBaseDir: store/ + go test -ldflags "-r /usr/local/lib" -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock' ./... test-log: - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.21" check-latest: true cache: true cache-dependency-path: log/go.sum @@ -686,15 +468,7 @@ jobs: if: env.GIT_DIFF run: | cd log - go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} - uses: SonarSource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - with: - projectBaseDir: log/ + go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock' ./... ############################# ### Cosmos SDK x/{module} ### @@ -704,12 +478,12 @@ jobs: # They run when there is a diff in their respective directories. test-x-tx: - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.23" check-latest: true cache: true cache-dependency-path: x/tx/go.sum @@ -724,23 +498,15 @@ jobs: if: env.GIT_DIFF run: | cd x/tx - go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} - uses: SonarSource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - with: - projectBaseDir: x/tx/ + go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock' ./... test-x-nft: - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.23" check-latest: true cache: true cache-dependency-path: x/nft/go.sum @@ -755,23 +521,15 @@ jobs: if: env.GIT_DIFF run: | cd x/nft - go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} - uses: SonarSource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - with: - projectBaseDir: x/nft/ + go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock' ./... test-x-circuit: - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.23" check-latest: true cache: true cache-dependency-path: x/circuit/go.sum @@ -786,23 +544,15 @@ jobs: if: env.GIT_DIFF run: | cd x/circuit - go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} - uses: SonarSource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - with: - projectBaseDir: x/circuit/ + go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock' ./... test-x-feegrant: - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.23" check-latest: true cache: true cache-dependency-path: x/feegrant/go.sum @@ -817,23 +567,15 @@ jobs: if: env.GIT_DIFF run: | cd x/feegrant - go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} - uses: SonarSource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - with: - projectBaseDir: x/feegrant/ + go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock' ./... test-x-evidence: - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.23" check-latest: true cache: true cache-dependency-path: x/evidence/go.sum @@ -848,22 +590,15 @@ jobs: if: env.GIT_DIFF run: | cd x/evidence - go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} - uses: SonarSource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - with: - projectBaseDir: x/evidence/ + go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock' ./... + test-x-upgrade: - runs-on: ubuntu-latest + runs-on: depot-ubuntu-22.04-4 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.23" check-latest: true cache: true cache-dependency-path: x/upgrade/go.sum @@ -878,12 +613,27 @@ jobs: if: env.GIT_DIFF run: | cd x/upgrade - go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} - uses: SonarSource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - with: - projectBaseDir: x/upgrade/ + go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock' ./... + + test-tools-benchmark: + runs-on: depot-ubuntu-22.04-4 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: "1.23.2" + check-latest: true + cache: true + cache-dependency-path: tools/benchmark/go.sum + - uses: technote-space/get-diff-action@v6.1.2 + id: git_diff + with: + PATTERNS: | + tools/benchmark/**/*.go + tools/benchmark/go.mod + tools/benchmark/go.sum + - name: tests + if: env.GIT_DIFF + run: | + cd tools/benchmark + go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace' ./... diff --git a/.golangci.yml b/.golangci.yml index 7d7fca0fd8f1..29c3e352b6ab 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,18 +1,20 @@ run: tests: true - timeout: 10m - sort-results: true + timeout: 15m allow-parallel-runners: true - exclude-dir: testutil/testdata - skip-files: - - server/grpc/gogoreflection/fix_registration.go + build-tags: + - e2e + - ledger + - test_ledger_mock linters: disable-all: true enable: - - depguard - dogsled - - exportloopref + - errcheck + - errorlint + - copyloopvar + - gci - goconst - gocritic - gofumpt @@ -23,98 +25,99 @@ linters: - misspell - nakedret - nolintlint - - staticcheck - revive + - staticcheck - stylecheck + - thelper - typecheck - unconvert - unused issues: + exclude-dirs: + - testutil/testdata + exclude-files: + - server/grpc/gogoreflection/fix_registration.go + - "fix_registration.go" + - ".*\\.pb\\.go$" + - ".*\\.pb\\.gw\\.go$" + - ".*\\.pulsar\\.go$" + - crypto/keys/secp256k1/internal/* + - types/coin_regex.go exclude-rules: - - text: "Use of weak random number generator" - linters: - - gosec - - text: "ST1003:" + - text: "ST1003:" # We are fine with our current naming linters: - stylecheck # FIXME: Disabled until golangci-lint updates stylecheck with this fix: # https://github.com/dominikh/go-tools/issues/389 - - text: "ST1016:" + - text: "ST1016:" # Ok with inconsistent receiver names linters: - stylecheck - - path: "migrations" + - path: "migrations" # migraitions always use deprecated code text: "SA1019:" linters: - staticcheck - text: "SA1019: codec.NewAminoCodec is deprecated" # TODO remove once migration path is set out linters: - staticcheck + - text: "SA1019: legacybech32.MustMarshalPubKey" # TODO remove once ready to remove from the sdk + linters: + - staticcheck + - text: "SA1019: legacybech32.MarshalPubKey" # TODO remove once ready to remove from the sdk + linters: + - staticcheck + - text: "SA1019: legacybech32.UnmarshalPubKey" # TODO remove once ready to remove from the sdk + linters: + - staticcheck + - text: "SA1019: params.SendEnabled is deprecated" # TODO remove once ready to remove from the sdk + linters: + - staticcheck + - text: "G115: integer overflow conversion" # We are doing this everywhere. + linters: + - gosec - text: "leading space" linters: - nolintlint - max-issues-per-linter: 10000 max-same-issues: 10000 linters-settings: + gci: + custom-order: true + sections: + - standard # Standard section: captures all standard packages. + - default # Default section: contains all imports that could not be matched to another section type. + - prefix(cosmossdk.io) + - prefix(github.com/cosmos/cosmos-sdk) + revive: + rules: + - name: redefines-builtin-id + disabled: true + gosec: - # To select a subset of rules to run. # Available rules: https://github.com/securego/gosec#available-rules - # Default: [] - means include all rules - includes: - # - G101 # Look for hard coded credentials - - G102 # Bind to all interfaces - - G103 # Audit the use of unsafe block - - G104 # Audit errors not checked - - G106 # Audit the use of ssh.InsecureIgnoreHostKey - - G107 # Url provided to HTTP request as taint input - - G108 # Profiling endpoint automatically exposed on /debug/pprof - - G109 # Potential Integer overflow made by strconv.Atoi result conversion to int16/32 - - G110 # Potential DoS vulnerability via decompression bomb - - G111 # Potential directory traversal - - G112 # Potential slowloris attack - - G113 # Usage of Rat.SetString in math/big with an overflow (CVE-2022-23772) - - G114 # Use of net/http serve function that has no support for setting timeouts - - G201 # SQL query construction using format string - - G202 # SQL query construction using string concatenation - - G203 # Use of unescaped data in HTML templates - - G204 # Audit use of command execution - - G301 # Poor file permissions used when creating a directory - - G302 # Poor file permissions used with chmod - - G303 # Creating tempfile using a predictable path - - G304 # File path provided as taint input - - G305 # File traversal when extracting zip/tar archive - - G306 # Poor file permissions used when writing to a new file - - G307 # Deferring a method which returns an error - - G401 # Detect the usage of DES, RC4, MD5 or SHA1 - - G402 # Look for bad TLS connection settings - - G403 # Ensure minimum RSA key length of 2048 bits - - G404 # Insecure random number source (rand) - - G501 # Import blocklist: crypto/md5 - - G502 # Import blocklist: crypto/des - - G503 # Import blocklist: crypto/rc4 - - G504 # Import blocklist: net/http/cgi - - G505 # Import blocklist: crypto/sha1 - - G601 # Implicit memory aliasing of items from a range statement + excludes: + - G101 # Potential hardcoded credentials + - G107 # Potential HTTP request made with variable url + - G404 # Use of weak random number generator (math/rand instead of crypto/rand) + exclude-generated: true + confidence: medium misspell: locale: US gofumpt: extra-rules: true dogsled: - max-blank-identifiers: 5 - maligned: - suggest-new: true + max-blank-identifiers: 6 nolintlint: allow-unused: false - allow-leading-space: true require-explanation: true require-specific: false gosimple: checks: ["all"] - gocritic: disabled-checks: - regexpMust - appendAssign - ifElseChain + unused: + local-variables-are-used: false \ No newline at end of file diff --git a/.goreleaser.yml b/.goreleaser.yml index 3cfcce33acde..69e368660846 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -24,4 +24,4 @@ snapshot: name_template: SNAPSHOT-{{ .Commit }} changelog: - skip: false + disable: false diff --git a/.mergify.yml b/.mergify.yml index 23eb45476a4b..730198d89828 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -1,21 +1,25 @@ queue_rules: - name: default - conditions: + queue_conditions: + - "#approved-reviews-by>1" + - base=main + - label=A:automerge + merge_conditions: - "#approved-reviews-by>1" + commit_message_template: | + {{ title }} (#{{ number }}) + {{ body }} + merge_method: squash pull_request_rules: - - name: automerge to main with label automerge and branch protection passing + - name: backport patches to v0.53.x branch conditions: - - "#approved-reviews-by>1" - base=main - - label=A:automerge + - label=backport/v0.53.x actions: - queue: - name: default - method: squash - commit_message_template: | - {{ title }} (#{{ number }}) - {{ body }} + backport: + branches: + - release/v0.53.x - name: backport patches to v0.50.x branch conditions: - base=main @@ -48,3 +52,7 @@ pull_request_rules: backport: branches: - release/v0.45.x + - name: automerge to main with label automerge and branch protection passing + conditions: [] + actions: + queue: \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index b4be0b093e01..db2af029b829 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,2306 +40,585 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Features -* [#15970](https://github.com/cosmos/cosmos-sdk/pull/15970) Enable SIGN_MODE_TEXTUAL. -* (types) [#15958](https://github.com/cosmos/cosmos-sdk/pull/15958) Add `module.NewBasicManagerFromManager` for creating a basic module manager from a module manager. -* (runtime) [#15818](https://github.com/cosmos/cosmos-sdk/pull/15818) Provide logger through `depinject` instead of appBuilder. -* (client) [#15597](https://github.com/cosmos/cosmos-sdk/pull/15597) Add status endpoint for clients. -* (testutil/integration) [#15556](https://github.com/cosmos/cosmos-sdk/pull/15556) Introduce `testutil/integration` package for module integration testing. -* (types) [#15735](https://github.com/cosmos/cosmos-sdk/pull/15735) Make `ValidateBasic() error` method of `Msg` interface optional. Modules should validate messages directly in their message handlers ([RFC 001](https://docs.cosmos.network/main/rfc/rfc-001-tx-validation)). -* (x/genutil) [#15679](https://github.com/cosmos/cosmos-sdk/pull/15679) Allow applications to specify a custom genesis migration function for the `genesis migrate` command. -* (client) [#15458](https://github.com/cosmos/cosmos-sdk/pull/15458) Add a `CmdContext` field to client.Context initialized to cobra command's context. -* (core) [#15133](https://github.com/cosmos/cosmos-sdk/pull/15133) Implement RegisterServices in the module manager. -* (x/gov) [#14373](https://github.com/cosmos/cosmos-sdk/pull/14373) Add new proto field `constitution` of type `string` to gov module genesis state, which allows chain builders to lay a strong foundation by specifying purpose. -* (x/genutil) [#15301](https://github.com/cosmos/cosmos-sdk/pull/15031) Add application genesis. The genesis is now entirely managed by the application and passed to CometBFT at note instantiation. Functions that were taking a `cmttypes.GenesisDoc{}` now takes a `genutiltypes.AppGenesis{}`. -* (cli) [#14659](https://github.com/cosmos/cosmos-sdk/pull/14659) Added ability to query blocks by events with queries directly passed to Tendermint, which will allow for full query operator support, e.g. `>`. -* (x/gov) [#14720](https://github.com/cosmos/cosmos-sdk/pull/14720) Upstream expedited proposals from Osmosis. -* (x/auth) [#14650](https://github.com/cosmos/cosmos-sdk/pull/14650) Add Textual SignModeHandler. It is however **NOT** enabled by default, and should only be used for **TESTING** purposes until `SIGN_MODE_TEXTUAL` is fully released. -* (x/crisis) [#14588](https://github.com/cosmos/cosmos-sdk/pull/14588) Use CacheContext() in AssertInvariants() -* (client) [#14342](https://github.com/cosmos/cosmos-sdk/pull/14342) Add ` config` command is now a sub-command, for setting, getting and migrating Cosmos SDK configuration files. -* (query) [#14468](https://github.com/cosmos/cosmos-sdk/pull/14468) Implement pagination for collections. -* (x/distribution) [#14322](https://github.com/cosmos/cosmos-sdk/pull/14322) Introduce a new gRPC message handler, `DepositValidatorRewardsPool`, that allows explicit funding of a validator's reward pool. -* [#13473](https://github.com/cosmos/cosmos-sdk/pull/13473) ADR-038: Go plugin system proposal -* (mempool) [#14484](https://github.com/cosmos/cosmos-sdk/pull/14484) Add priority nonce mempool option for transaction replacement. -* (x/bank) [#14894](https://github.com/cosmos/cosmos-sdk/pull/14894) Return a human readable denomination for IBC vouchers when querying bank balances. Added a `ResolveDenom` parameter to `types.QueryAllBalancesRequest` and `--resolve-denom` flag to `GetBalancesCmd()`. -* (runtime) [#15547](https://github.com/cosmos/cosmos-sdk/pull/15547) Allow runtime to pass event core api service to modules -* (telemetry) [#15657](https://github.com/cosmos/cosmos-sdk/pull/15657) Emit more data (go version, sdk version, upgrade height) in prom metrics -* (types/module) [#15829](https://github.com/cosmos/cosmos-sdk/pull/15829) Add new endblocker interface to handle valset updates. -* (core) [#14860](https://github.com/cosmos/cosmos-sdk/pull/14860) Add `Precommit` and `PrepareCheckState` AppModule callbacks. -* (tx) [#15992](https://github.com/cosmos/cosmos-sdk/pull/15992) Add `WithExtensionOptions` in tx Factory to allow `SetExtensionOptions` with given extension options. -* (types/simulation) [#16074](https://github.com/cosmos/cosmos-sdk/pull/16074) Add generic SimulationStoreDecoder for modules using collections. -* (cli) [#16209](https://github.com/cosmos/cosmos-sdk/pull/16209) Make `StartCmd` more customizable. -* (types) [#16257](https://github.com/cosmos/cosmos-sdk/pull/16257) Allow setting the base denom in the denom registry. -* (x/group) [#16191](https://github.com/cosmos/cosmos-sdk/pull/16191) Add EventProposalPruned event to group module whenever a proposal is pruned. -* (genutil) [#16046](https://github.com/cosmos/cosmos-sdk/pull/16046) Add "module-name" flag to genutil add-genesis-account to enable intializing module accounts at genesis. - -### Improvements - -* (server) [#16395](https://github.com/cosmos/cosmos-sdk/pull/16395) Do not override some Comet config is purposely set differently in `InterceptConfigsPreRunHandler`. -* (types) [#16076](https://github.com/cosmos/cosmos-sdk/pull/16076) Optimize `ChainAnteDecorators`/`ChainPostDecorators` to instantiate the functions once instead of on every invocation of the returned `AnteHandler`/`PostHandler`. -* (client) [#16075](https://github.com/cosmos/cosmos-sdk/pull/16075) Partly revert [#15953](https://github.com/cosmos/cosmos-sdk/issues/15953) and `factory.Prepare` does nothing in offline mode. -* (server) [#16071](https://github.com/cosmos/cosmos-sdk/pull/16071) When `mempool.max-txs` is set to a negative value, use a no-op mempool (effectively disable the app mempool). -* (simapp) [#15958](https://github.com/cosmos/cosmos-sdk/pull/15958) Refactor SimApp for removing the global basic manager. -* (gov) [#15979](https://github.com/cosmos/cosmos-sdk/pull/15979) Improve gov error message when failing to convert v1 proposal to v1beta1. -* (crypto) [#3129](https://github.com/cosmos/cosmos-sdk/pull/3129) New armor and keyring key derivation uses aead and encryption uses chacha20poly -* (x/slashing) [#15580](https://github.com/cosmos/cosmos-sdk/pull/15580) Refactor the validator's missed block signing window to be a chunked bitmap instead of a "logical" bitmap, significantly reducing the storage footprint. -* (x/gov) [#15554](https://github.com/cosmos/cosmos-sdk/pull/15554) Add proposal result log in `active_proposal` event. When a proposal passes but fails to execute, the proposal result is logged in the `active_proposal` event. -* (mempool) [#15328](https://github.com/cosmos/cosmos-sdk/pull/15328) Improve the `PriorityNonceMempool` - * Support generic transaction prioritization, instead of `ctx.Priority()` - * Improve construction through the use of a single `PriorityNonceMempoolConfig` instead of option functions -* (x/authz) [#15164](https://github.com/cosmos/cosmos-sdk/pull/15164) Add `MsgCancelUnbondingDelegation` to staking authorization -* (server) [#15358](https://github.com/cosmos/cosmos-sdk/pull/15358) Add `server.InterceptConfigsAndCreateContext` as alternative to `server.InterceptConfigsPreRunHandler` which does not set the server context and the default SDK logger. -* [#15011](https://github.com/cosmos/cosmos-sdk/pull/15011) Introduce `cosmossdk.io/log` package to provide a consistent logging interface through the SDK. CometBFT logger is now replaced by `cosmossdk.io/log.Logger`. -* (x/auth) [#14758](https://github.com/cosmos/cosmos-sdk/pull/14758) Allow transaction event queries to directly passed to Tendermint, which will allow for full query operator support, e.g. `>`. -* (server) [#15041](https://github.com/cosmos/cosmos-sdk/pull/15041) Remove unnecessary sleeps from gRPC and API server initiation. The servers will start and accept requests as soon as they're ready. -* (x/staking) [#14864](https://github.com/cosmos/cosmos-sdk/pull/14864) `create-validator` CLI command now takes a json file as an arg instead of having a bunch of required flags to it. -* (cli) [#14659](https://github.com/cosmos/cosmos-sdk/pull/14659) Added ability to query blocks by either height/hash ` q block --type=height|hash `. -* (store) [#14410](https://github.com/cosmos/cosmos-sdk/pull/14410) `rootmulti.Store.loadVersion` has validation to check if all the module stores' height is correct, it will error if any module store has incorrect height. -* (x/evidence) [#14757](https://github.com/cosmos/cosmos-sdk/pull/14757) Evidence messages do not need to implement a `.Type()` anymore. -* (x/auth/tx) [#14751](https://github.com/cosmos/cosmos-sdk/pull/14751) Remove `.Type()` and `Route()` methods from all msgs and `legacytx.LegacyMsg` interface. -* [#14529](https://github.com/cosmos/cosmos-sdk/pull/14529) Add new property `BondDenom` to `SimulationState` struct. -* (module) [#14415](https://github.com/cosmos/cosmos-sdk/pull/14415) Loosen assertions in SetOrderBeginBlockers() and SetOrderEndBlockers() -* (context)[#14384](https://github.com/cosmos/cosmos-sdk/pull/14384) Refactor(context): Pass EventManager to the context as an interface. -* (types) [#14354](https://github.com/cosmos/cosmos-sdk/pull/14354) Improve performance on Context.KVStore and Context.TransientStore by 40%. -* (crypto/keyring) [#14151](https://github.com/cosmos/cosmos-sdk/pull/14151) Move keys presentation from `crypto/keyring` to `client/keys` -* (signing) [#14087](https://github.com/cosmos/cosmos-sdk/pull/14087) Add SignModeHandlerWithContext interface with a new `GetSignBytesWithContext` to get the sign bytes using `context.Context` as an argument to access state. -* (server) [#14062](https://github.com/cosmos/cosmos-sdk/pull/14062) Remove rosetta from server start. -* (baseapp) [#14417](https://github.com/cosmos/cosmos-sdk/pull/14417) `SetStreamingService` accepts appOptions, AppCodec and Storekeys needed to set streamers. - * Store pacakge no longer has a dependency on baseapp. -* (store) [#14438](https://github.com/cosmos/cosmos-sdk/pull/14438) Pass logger from baseapp to store. -* (store) [#14439](https://github.com/cosmos/cosmos-sdk/pull/14439) Remove global metric gatherer from store. - * By default store has a no op metric gatherer, the application developer must set another metric gatherer or us the provided one in `store/metrics`. -* [#14406](https://github.com/cosmos/cosmos-sdk/issues/14406) Migrate usage of types/store.go to store/types/.. -* (x/staking) [#14590](https://github.com/cosmos/cosmos-sdk/pull/14590) Return undelegate amount in MsgUndelegateResponse. -* (baseapp) [#15023](https://github.com/cosmos/cosmos-sdk/pull/15023) & [#15213](https://github.com/cosmos/cosmos-sdk/pull/15213) Add `MessageRouter` interface to baseapp and pass it to authz, gov and groups instead of concrete type. -* (x/consensus) [#15553](https://github.com/cosmos/cosmos-sdk/pull/15553) Migrate consensus module to use collections -* (store/cachekv) [#15767](https://github.com/cosmos/cosmos-sdk/pull/15767) Reduce peak RAM usage during and after InitGenesis -* (x/bank) [#15764](https://github.com/cosmos/cosmos-sdk/pull/15764) Speedup x/bank InitGenesis -* (x/auth) [#15867](https://github.com/cosmos/cosmos-sdk/pull/15867) Support better logging for signature verification failure. -* (types/query) [#16041](https://github.com/cosmos/cosmos-sdk/pull/16041) change pagination max limit to a variable in order to be modifed by application devs -* (server) [#16061](https://github.com/cosmos/cosmos-sdk/pull/16061) Add Comet bootstrap command. -* (x/staking) [#16068](https://github.com/cosmos/cosmos-sdk/pull/16068) Update simulation to allow non-EOA accounts to stake. -* (store) [#16067](https://github.com/cosmos/cosmos-sdk/pull/16067) Add local snapshots management commands. -* (server) [#16142](https://github.com/cosmos/cosmos-sdk/pull/16142) Remove JSON Indentation from the GRPC to REST gateway's responses. (Saving bandwidth) -* (baseapp) [#16193](https://github.com/cosmos/cosmos-sdk/pull/16193) Add `Close` method to `BaseApp` for custom app to cleanup resource in graceful shutdown. -* (server) [#16238](https://github.com/cosmos/cosmos-sdk/pull/16238) Don't setup p2p node keys if starting a node in GRPC only mode. - -### State Machine Breaking - -* (x/group,x/gov) [#16235](https://github.com/cosmos/cosmos-sdk/pull/16235) A group and gov proposal is rejected if the proposal metadata title and summary do not match the proposal title and summary. -* (x/staking) [#15701](https://github.com/cosmos/cosmos-sdk/pull/15701) The `HistoricalInfoKey` has been updated to use a binary format. -* (x/slashing) [#15580](https://github.com/cosmos/cosmos-sdk/pull/15580) The validator slashing window now stores "chunked" bitmap entries for each validator's signing window instead of a single boolean entry per signing window index. -* (x/feegrant) [#14294](https://github.com/cosmos/cosmos-sdk/pull/14294) Moved the logic of rejecting duplicate grant from `msg_server` to `keeper` method. -* (x/staking) [#14590](https://github.com/cosmos/cosmos-sdk/pull/14590) `MsgUndelegateResponse` now includes undelegated amount. `x/staking` module's `keeper.Undelegate` now returns 3 values (completionTime,undelegateAmount,error) instead of 2. -* (x/staking) (#15731) (https://github.com/cosmos/cosmos-sdk/pull/15731) Introducing a new index to retrieve the delegations by validator efficiently. -* (baseapp) [#15930](https://github.com/cosmos/cosmos-sdk/pull/15930) change vote info provided by prepare and process proposal to the one in the block - -### API Breaking Changes - -* (baseapp) [#15568](https://github.com/cosmos/cosmos-sdk/pull/15568) `SetIAVLLazyLoading` is removed from baseapp. -* (x/slashing) [#16246](https://github.com/cosmos/cosmos-sdk/issues/16246) `NewKeeper` now takes a `KVStoreService` instead of a `StoreKey`, and methods in the `Keeper` now take a `context.Context` instead of a `sdk.Context` and return an `error`. `GetValidatorSigningInfo` now returns an error instead of a `found bool`, the error can be `nil` (found), `ErrNoSigningInfoFound` (not found) and any other error. -* (module) [#16227](https://github.com/cosmos/cosmos-sdk/issues/16227) `manager.RunMigrations()` now take a `context.Context` instead of a `sdk.Context`. -* (x/mint) [#16179](https://github.com/cosmos/cosmos-sdk/issues/16179) `NewKeeper` now takes a `KVStoreService` instead of a `StoreKey`, and methods in the `Keeper` now take a `context.Context` instead of a `sdk.Context` and return an `error`. -* (x/crisis) [#16216](https://github.com/cosmos/cosmos-sdk/issues/16216) `NewKeeper` now takes a `KVStoreService` instead of a `StoreKey`, methods in the `Keeper` now take a `context.Context` instead of a `sdk.Context` and return an `error` instead of panicking. -* (x/gov) [#15988](https://github.com/cosmos/cosmos-sdk/issues/15988) `NewKeeper` now takes a `KVStoreService` instead of a `StoreKey`, methods in the `Keeper` now take a `context.Context` instead of a `sdk.Context` and return an `error` (instead of panicking or returning a `found bool`). Iterators callback functions now return an error instead of a `bool`. -* (x/auth) [#15985](https://github.com/cosmos/cosmos-sdk/pull/15985) The `AccountKeeper` does not expose the `QueryServer` and `MsgServer` APIs anymore. -* (x/authz) [#15962](https://github.com/cosmos/cosmos-sdk/issues/15962) `NewKeeper` now takes a `KVStoreService` instead of a `StoreKey`, methods in the `Keeper` now take a `context.Context` instead of a `sdk.Context`. The `Authorization` interface's `Accept` method now takes a `context.Context` instead of a `sdk.Context`. -* (x/distribution) [#15948](https://github.com/cosmos/cosmos-sdk/issues/15948) `NewKeeper` now takes a `KVStoreService` instead of a `StoreKey` and methods in the `Keeper` now take a `context.Context` instead of a `sdk.Context`. Keeper methods also now return an `error`. -* (x/bank) [#15891](https://github.com/cosmos/cosmos-sdk/issues/15891) `NewKeeper` now takes a `KVStoreService` instead of a `StoreKey` and methods in the `Keeper` now take a `context.Context` instead of a `sdk.Context`. Also `FundAccount` and `FundModuleAccount` from the `testutil` package accept a `context.Context` instead of a `sdk.Context`, and it's position was moved to the first place. -* (x/bank) [#15818](https://github.com/cosmos/cosmos-sdk/issues/15818) `BaseViewKeeper`'s `Logger` method now doesn't require a context. `NewBaseKeeper`, `NewBaseSendKeeper` and `NewBaseViewKeeper` now also require a `log.Logger` to be passed in. -* (client) [#15597](https://github.com/cosmos/cosmos-sdk/pull/15597) `RegisterNodeService` now requires a config parameter. -* (x/*all*) [#15648](https://github.com/cosmos/cosmos-sdk/issues/15648) Make `SetParams` consistent across all modules and validate the params at the message handling instead of `SetParams` method. -* (x/genutil) [#15679](https://github.com/cosmos/cosmos-sdk/pull/15679) `MigrateGenesisCmd` now takes a `MigrationMap` instead of having the SDK genesis migration hardcoded. -* (client) [#15673](https://github.com/cosmos/cosmos-sdk/pull/15673) Move `client/keys.OutputFormatJSON` and `client/keys.OutputFormatText` to `client/flags` package. -* (x/nft) [#15588](https://github.com/cosmos/cosmos-sdk/pull/15588) `NewKeeper` now takes a `KVStoreService` instead of a `StoreKey` and methods in the `Keeper` now take a `context.Context` instead of a `sdk.Context`. -* (x/auth) [#15520](https://github.com/cosmos/cosmos-sdk/pull/15520) `NewAccountKeeper` now takes a `KVStoreService` instead of a `StoreKey` and methods in the `Keeper` now take a `context.Context` instead of a `sdk.Context`. -* (x/consensus) [#15517](https://github.com/cosmos/cosmos-sdk/pull/15517) `NewKeeper` now takes a `KVStoreService` instead of a `StoreKey`. -* (x/bank) [#15477](https://github.com/cosmos/cosmos-sdk/pull/15477) `banktypes.NewMsgMultiSend` and `keeper.InputOutputCoins` only accept one input. -* (mempool) [#15328](https://github.com/cosmos/cosmos-sdk/pull/15328) The `PriorityNonceMempool` is now generic over type `C comparable` and takes a single `PriorityNonceMempoolConfig[C]` argument. See `DefaultPriorityNonceMempoolConfig` for how to construct the configuration and a `TxPriority` type. -* (server) [#15358](https://github.com/cosmos/cosmos-sdk/pull/15358) Remove `server.ErrorCode` that was not used anywhere. -* [#15211](https://github.com/cosmos/cosmos-sdk/pull/15211) Remove usage of `github.com/cometbft/cometbft/libs/bytes.HexBytes` in favor of `[]byte` thorough the SDK. -* [#15011](https://github.com/cosmos/cosmos-sdk/pull/15011) All functions that were taking a CometBFT logger, now take `cosmossdk.io/log.Logger` instead. -* (x/auth) [#14758](https://github.com/cosmos/cosmos-sdk/pull/14758) Refactor transaction searching: - * Refactor `QueryTxsByEvents` to accept a `query` of type `string` instead of `events` of type `[]string` - * Pass `prove=false` to Tendermint's `TxSearch` RPC method - * Refactor CLI methods to accept `--query` flag instead of `--events` -* (server) [#15041](https://github.com/cosmos/cosmos-sdk/pull/15041) Refactor how gRPC and API servers are started to remove unnecessary sleeps: - * Remove `ServerStartTime` constant. - * Rename `WaitForQuitSignals` to `ListenForQuitSignals`. Note, this function is no longer blocking. Thus the caller is expected to provide a `context.CancelFunc` which indicates that when a signal is caught, that any spawned processes can gracefully exit. - * `api.Server#Start` now accepts a `context.Context`. The caller is responsible for ensuring that the context is canceled such that the API server can gracefully exit. The caller does not need to stop the server. - * To start the gRPC server you must first create the server via `NewGRPCServer`, after which you can start the gRPC server via `StartGRPCServer` which accepts a `context.Context`. The caller is responsible for ensuring that the context is canceled such that the gRPC server can gracefully exit. The caller does not need to stop the server. -* (types) [#15067](https://github.com/cosmos/cosmos-sdk/pull/15067) Remove deprecated alias from `types/errors`. Use `cosmossdk.io/errors` instead. -* (testutil) [#14991](https://github.com/cosmos/cosmos-sdk/pull/14991) The `testutil/testdata_pulsar` package has moved to `testutil/testdata/testpb`. -* (simapp) [#14977](https://github.com/cosmos/cosmos-sdk/pull/14977) Move simulation helpers functions (`AppStateFn` and `AppStateRandomizedFn`) to `testutil/sims`. These takes an extra genesisState argument which is the default state of the app. -* (x/gov) [#14720](https://github.com/cosmos/cosmos-sdk/pull/14720) Add an expedited field in the gov v1 proposal and `MsgNewMsgProposal`. -* [#14847](https://github.com/cosmos/cosmos-sdk/pull/14847) App and ModuleManager methods `InitGenesis`, `ExportGenesis`, `BeginBlock` and `EndBlock` now also return an error. -* (x/upgrade) [#14764](https://github.com/cosmos/cosmos-sdk/pull/14764) The `x/upgrade` module is extracted to have a separate go.mod file which allows it to be a standalone module. -* (store) [#14746](https://github.com/cosmos/cosmos-sdk/pull/14746) Extract Store in its own go.mod and rename the package to `cosmossdk.io/store`. -* (simulation) [#14751](https://github.com/cosmos/cosmos-sdk/pull/14751) Remove the `MsgType` field from `simulation.OperationInput` struct. -* (crypto/keyring) [#13734](https://github.com/cosmos/cosmos-sdk/pull/13834) The keyring's `Sign` method now takes a new `signMode` argument. It is only used if the signing key is a Ledger hardware device. You can set it to 0 in all other cases. -* (x/evidence) [14724](https://github.com/cosmos/cosmos-sdk/pull/14724) Extract Evidence in its own go.mod and rename the package to `cosmossdk.io/x/evidence`. -* (x/nft) [#14725](https://github.com/cosmos/cosmos-sdk/pull/14725) Extract NFT in its own go.mod and rename the package to `cosmossdk.io/x/nft`. -* (tx) [#14634](https://github.com/cosmos/cosmos-sdk/pull/14634) Move the `tx` go module to `x/tx`. -* (snapshots) [#14597](https://github.com/cosmos/cosmos-sdk/pull/14597) Move `snapshots` to `store/snapshots`, rename and bump proto package to v1. -* (crypto/keyring) [#14151](https://github.com/cosmos/cosmos-sdk/pull/14151) Move keys presentation from `crypto/keyring` to `client/keys` -* (modules) [#13850](https://github.com/cosmos/cosmos-sdk/pull/13850) and [#14046](https://github.com/cosmos/cosmos-sdk/pull/14046) Remove gogoproto stringer annotations. This removes the custom `String()` methods on all types that were using the annotations. -* (x/auth) [#13850](https://github.com/cosmos/cosmos-sdk/pull/13850/) Remove `MarshalYAML` methods from module (`x/...`) types. -* (store) [#11825](https://github.com/cosmos/cosmos-sdk/pull/11825) Make extension snapshotter interface safer to use, renamed the util function `WriteExtensionItem` to `WriteExtensionPayload`. -* (signing) [#13701](https://github.com/cosmos/cosmos-sdk/pull/) Add `context.Context` as an argument `x/auth/signing.VerifySignature`. -* (snapshots) [14048](https://github.com/cosmos/cosmos-sdk/pull/14048) Move the Snapshot package to the store package. This is done in an effort group all storage related logic under one package. -* (baseapp) [#14050](https://github.com/cosmos/cosmos-sdk/pull/14050) Refactor `ABCIListener` interface to accept Go contexts. -* (store/streaming)[#14603](https://github.com/cosmos/cosmos-sdk/pull/14603) `StoreDecoderRegistry` moved from store to `types/simulations` this breaks the `AppModuleSimulation` interface. -* (x/staking) [#14590](https://github.com/cosmos/cosmos-sdk/pull/14590) `MsgUndelegateResponse` now includes undelegated amount. `x/staking` module's `keeper.Undelegate` now returns 3 values (completionTime,undelegateAmount,error) instead of 2. -* (x/feegrant) [#14649](https://github.com/cosmos/cosmos-sdk/pull/14649) Extract Feegrant in its own go.mod and rename the package to `cosmossdk.io/x/feegrant`. -* (x/bank) [#14894](https://github.com/cosmos/cosmos-sdk/pull/14894) Allow a human readable denomination for coins when querying bank balances. Added a `ResolveDenom` parameter to `types.QueryAllBalancesRequest`. -* (crypto) [#15070](https://github.com/cosmos/cosmos-sdk/pull/15070) `GenerateFromPassword` and `Cost` from `bcrypt.go` now take a `uint32` instead of a `int` type. -* (x/capability) [#15344](https://github.com/cosmos/cosmos-sdk/pull/15344) Capability module was removed and is now housed in [IBC-GO](https://github.com/cosmos/ibc-go). -* [#15299](https://github.com/cosmos/cosmos-sdk/pull/15299) Remove `StdTx` transaction and signing APIs. No SDK version has actually supported `StdTx` since before Stargate. -* (codec) [#15600](https://github.com/cosmos/cosmos-sdk/pull/15600) [#15873](https://github.com/cosmos/cosmos-sdk/pull/15873) add support for getting signers to `codec.Codec` and `InterfaceRegistry`: - * `Codec` has new methods `InterfaceRegistry`, `GetMsgAnySigners`, `GetMsgV1Signers`, and `GetMsgV2Signers` as well as unexported methods. All implementations of `Codec` by other users must now embed an official implementation from the `codec` package. - * `InterfaceRegistry` is has unexported methods and implements `protodesc.Resolver` plus the `RangeFiles` and `SigningContext` methods. All implementations of `InterfaceRegistry` by other users must now embed the official implementation. - * `AminoCodec` is marked as deprecated and no longer implements `Codec. -* (x/crisis) [#15852](https://github.com/cosmos/cosmos-sdk/pull/15852) Crisis keeper now takes a instance of the address codec to be able to decode user addresses -* (x/slashing) [#15875](https://github.com/cosmos/cosmos-sdk/pull/15875) `x/slashing.NewAppModule` now requires an `InterfaceRegistry` parameter. -* (client) [#15822](https://github.com/cosmos/cosmos-sdk/pull/15822) The return type of the interface method `TxConfig.SignModeHandler` has been changed to `x/tx/signing.HandlerMap`. -* (x/auth) [#15822](https://github.com/cosmos/cosmos-sdk/pull/15822) The type of struct field `ante.HandlerOptions.SignModeHandler` has been changed to `x/tx/signing.HandlerMap`. - * The signature of `NewSigVerificationDecorator` has been changed to accept a `x/tx/signing.HandlerMap`. - * The signature of `VerifySignature` has been changed to accept a `x/tx/signing.HandlerMap` and other structs from `x/tx` as arguments. - * The signature of `NewTxConfigWithTextual` has been deprecated and its signature changed to accept a `SignModeOptions`. -* (x/bank) [#15567](https://github.com/cosmos/cosmos-sdk/pull/15567) `GenesisBalance.GetAddress` now returns a string instead of `sdk.AccAddress` - * `MsgSendExec` test helper function now takes a address.Codec -* (x/genutil) [#15567](https://github.com/cosmos/cosmos-sdk/pull/15567) `CollectGenTxsCmd` & `GenTxCmd` takes a address.Codec to be able to decode addresses -* (x/genutil) [#15999](https://github.com/cosmos/cosmos-sdk/pull/15999) Genutil now takes the `GenesisTxHanlder` interface instead of deliverTx. The interface is implemented on baseapp -* (types/math) [#16040](https://github.com/cosmos/cosmos-sdk/pull/16040) Remove unused aliases in math.go -* (x/gov) [#16106](https://github.com/cosmos/cosmos-sdk/pull/16106) Remove gRPC query methods from Keeper -* (x/gov) [#16118](https://github.com/cosmos/cosmos-sdk/pull/16118/) Use collections for constituion and params state management. -* (x/gov) [#16127](https://github.com/cosmos/cosmos-sdk/pull/16127) Use collections for deposit state management: - * The following methods are removed from the gov keeper: `GetDeposit`, `GetAllDeposits`, `IterateAllDeposits`. - * The following functions are removed from the gov types: `DepositKey`, `DepositsKey`. -* (x/gov) [#16164](https://github.com/cosmos/cosmos-sdk/pull/16164) Use collections for vote state management: - * Removed: types `VoteKey`, `VoteKeys` - * Removed: keeper `IterateVotes`, `IterateAllVotes`, `GetVotes`, `GetVote`, `SetVote` -* (x/gov) [#16171](https://github.com/cosmos/cosmos-sdk/pull/16171) Use collections for proposal state management (part 1): - * Removed: keeper: `GetProposal`, `UnmarshalProposal`, `MarshalProposal`, `IterateProposal`, `GetProposal`, `GetProposalFiltered`, `GetProposals`, `GetProposalID`, `SetProposalID` - * Remove: errors unused errors -* (sims) [#16155](https://github.com/cosmos/cosmos-sdk/pull/16155) - * `simulation.NewOperationMsg` now marshals the operation msg as proto bytes instead of legacy amino JSON bytes. - * `simulation.NewOperationMsg` is now 2-arity instead of 3-arity with the obsolete argument `codec.ProtoCodec` removed. - * The field `OperationMsg.Msg` is now of type `[]byte` instead of `json.RawMessage`. -* (cli) [#16209](https://github.com/cosmos/cosmos-sdk/pull/16209) Add API `StartCmdWithOptions` to create customized start command. -* (x/auth) [#16016](https://github.com/cosmos/cosmos-sdk/pull/16016) Use collections for accounts state management: - * removed: keeper `HasAccountByID`, `AccountAddressByID`, `SetParams -* (x/distribution) [#16211](https://github.com/cosmos/cosmos-sdk/pull/16211) Use collections for params state management. -* [#15284](https://github.com/cosmos/cosmos-sdk/pull/15284) - * `sdk.Msg.GetSigners` was deprecated and is no longer supported. Use the `cosmos.msg.v1.signer` protobuf annotation instead. - * `sdk.Tx` now requires a new method `GetMsgsV2()`. - * `types/tx.Tx` no longer implements `sdk.Tx`. - * `TxConfig` has a new method `SigningContext() *signing.Context`. - * `AccountKeeper` now has an `AddressCodec() address.Codec` method and the expected `AccountKeeper` for `x/auth/ante` expects this method. - * `SigVerifiableTx.GetSigners()` now returns `([][]byte, error)` instead of `[]sdk.AccAddress`. -* (x/authx) [#15284](https://github.com/cosmos/cosmos-sdk/pull/15284) `NewKeeper` now requires `codec.Codec`. -* (x/gov) [#15284](https://github.com/cosmos/cosmos-sdk/pull/15284) `NewKeeper` now requires `codec.Codec`. -* (x/distribution) [#16302](https://github.com/cosmos/cosmos-sdk/pull/16302) Use collections for FeePool state management. - * removed: keeper `GetFeePool`, `SetFeePool`, `GetFeePoolCommunityCoins` - -* (x/gov) [#16268](https://github.com/cosmos/cosmos-sdk/pull/16268) Use collections for proposal state management (part 2): - * this finalizes the gov collections migration - * Removed: keeper `InsertActiveProposalsQueue`, `RemoveActiveProposalsQueue`, `InsertInactiveProposalsQueue`, `RemoveInactiveProposalsQueue`, `IterateInactiveProposalsQueue`, `IterateActiveProposalsQueue`, `ActiveProposalsQueueIterator`, `InactiveProposalsQueueIterator` - * Remove: types all the key related functions -* (x/crisis) [#16328](https://github.com/cosmos/cosmos-sdk/pull/16328) Use collections for state management: - * Removed: keeper `GetConstantFee`, `SetConstantFee` -* (x/mint) [#16329](https://github.com/cosmos/cosmos-sdk/pull/16329) Use collections for state management: - * Removed: keeper `GetParams`, `SetParams`, `GetMinter`, `SetMinter`. -* (x/*all*) [#16052](https://github.com/cosmos/cosmos-sdk/pull/16062) `GetSignBytes` implementations on messages and global legacy amino codec definitions have been removed from all modules. -* (sims) [#16052](https://github.com/cosmos/cosmos-sdk/pull/16062) `GetOrGenerate` no longer requires a codec argument is now 4-arity instead of 5-arity. -* (baseapp) [#16342](https://github.com/cosmos/cosmos-sdk/pull/16342) NewContext was renamed to NewContextLegacy. The replacement (NewContext) now does not take a header, instead you should set the header via `WithHeaderInfo` or `WithBlockHeight`. Note that `WithBlockHeight` will soon be depreacted and its recommneded to use `WithHeaderInfo` -* (x/auth) [#16112](https://github.com/cosmos/cosmos-sdk/issues/16112) `helpers.AddGenesisAccount` has been moved to `x/genutil` to remove the cyclic dependency between `x/auth` and `x/genutil`. - -### Client Breaking Changes - -* (x/staking) [#15701](https://github.com/cosmos/cosmos-sdk/pull/15701) `HistoricalInfoKey` now has a binary format. -* (grpc-web) [#14652](https://github.com/cosmos/cosmos-sdk/pull/14652) Use same port for gRPC-Web and the API server. -* (abci) [#15845](https://github.com/cosmos/cosmos-sdk/pull/15845) Add `msg_index` to all event attributes to associate events and messages -* (abci) [#15845](https://github.com/cosmos/cosmos-sdk/pull/15845) Remove duplicating events in `logs` - -### CLI Breaking Changes - -* (cli) [#15826](https://github.com/cosmos/cosmos-sdk/pull/15826) Remove ` q account` command. Use ` q auth account` instead. -* (x/staking) [#14864](https://github.com/cosmos/cosmos-sdk/pull/14864) `create-validator` CLI command now takes a json file as an arg instead of having a bunch of required flags to it. -* (cli) [#14659](https://github.com/cosmos/cosmos-sdk/pull/14659) ` q block ` is removed as it just output json. The new command allows either height/hash and is ` q block --type=height|hash `. -* (x/gov) [#14880](https://github.com/cosmos/cosmos-sdk/pull/14880) Remove ` tx gov submit-legacy-proposal cancel-software-upgrade` and `software-upgrade` commands. These commands are now in the `x/upgrade` module and using gov v1. Use `tx upgrade software-upgrade` instead. -* (grpc-web) [#14652](https://github.com/cosmos/cosmos-sdk/pull/14652) Remove `grpc-web.address` flag. -* (client) [#14342](https://github.com/cosmos/cosmos-sdk/pull/14342) ` config` command is now a sub-command. Use ` config --help` to learn more. -* (cli) [#15299](https://github.com/cosmos/cosmos-sdk/pull/15299) Remove `--amino` flag from `sign` and `multi-sign` commands. Amino `StdTx` has been deprecated for a while. Amino JSON signing still works as expected. - -### Bug Fixes - -* (cli) [#16312](https://github.com/cosmos/cosmos-sdk/pull/16312) Allow any addresses in `client.ValidatePromptAddress`. -* (baseapp) [#16259](https://github.com/cosmos/cosmos-sdk/pull/16259) Ensure the `Context` block height is correct after `InitChain` and prior to the second block. -* (x/staking) [#16043](https://github.com/cosmos/cosmos-sdk/pull/16043) Call `AfterUnbondingInitiated` hook for new unbonding entries only and fix `UnbondingDelegation` entries handling -* (types) [#16010](https://github.com/cosmos/cosmos-sdk/pull/16010) Let `module.CoreAppModuleBasicAdaptor` fallback to legacy genesis handling. -* (x/group) [#16017](https://github.com/cosmos/cosmos-sdk/pull/16017) Correctly apply account number in group v2 migration. -* (types) [#15691](https://github.com/cosmos/cosmos-sdk/pull/15691) Make `Coin.Validate()` check that `.Amount` is not nil. -* (x/auth) [#15059](https://github.com/cosmos/cosmos-sdk/pull/15059) `ante.CountSubKeys` returns 0 when passing a nil `Pubkey`. -* (x/capability) [#15030](https://github.com/cosmos/cosmos-sdk/pull/15030) Prevent `x/capability` from consuming `GasMeter` gas during `InitMemStore` -* (types/coin) [#14739](https://github.com/cosmos/cosmos-sdk/pull/14739) Deprecate the method `Coin.IsEqual` in favour of `Coin.Equal`. The difference between the two methods is that the first one results in a panic when denoms are not equal. This panic lead to unexpected behavior -* (x/crypto) [#15258](https://github.com/cosmos/cosmos-sdk/pull/15258) Write keyhash file with permissions 0600 instead of 0555. -* (cli) [#16138](https://github.com/cosmos/cosmos-sdk/pull/16138) Fix snapshot commands panic if snapshot don't exists. -* (types) [#16145](https://github.com/cosmos/cosmos-sdk/pull/16145) Rename interface `ExtensionOptionI` back to `TxExtensionOptionI` to avoid breaking change. -* (x/gov) [#16230](https://github.com/cosmos/cosmos-sdk/pull/16231) Fix: rawlog JSON formatting of proposal_vote option field - -### Deprecated - -* (x/staking) [#14567](https://github.com/cosmos/cosmos-sdk/pull/14567) The `delegator_address` field of `MsgCreateValidator` has been deprecated. - The validator address bytes and delegator address bytes refer to the same account while creating validator (defer only in bech32 notation). - -## [v0.47.2](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.47.2) - 2023-04-27 - -### Improvements - -* (x/evidence) [#15908](https://github.com/cosmos/cosmos-sdk/pull/15908) Update the equivocation handler to work with ICS by removing a pubkey check that was performing a no-op for consumer chains. -* (x/slashing) [#15908](https://github.com/cosmos/cosmos-sdk/pull/15908) Remove the validators' pubkey check in the signature handler in order to work with ICS. -* (deps) [#15957](https://github.com/cosmos/cosmos-sdk/pull/15957) Bump CometBFT to [v0.37.1](https://github.com/cometbft/cometbft/blob/v0.37.1/CHANGELOG.md#v0371). -* (store) [#15683](https://github.com/cosmos/cosmos-sdk/pull/15683) `rootmulti.Store.CacheMultiStoreWithVersion` now can handle loading archival states that don't persist any of the module stores the current state has. -* [#15448](https://github.com/cosmos/cosmos-sdk/pull/15448) Automatically populate the block timestamp for historical queries. In contexts where the block timestamp is needed for previous states, the timestamp will now be set. Note, when querying against a node it must be re-synced in order to be able to automatically populate the block timestamp. Otherwise, the block timestamp will be populated for heights going forward once upgraded. -* [#14019](https://github.com/cosmos/cosmos-sdk/issues/14019) Remove the interface casting to allow other implementations of a `CommitMultiStore`. -* (simtestutil) [#15903](https://github.com/cosmos/cosmos-sdk/pull/15903) Add `AppStateFnWithExtendedCbs` with moduleStateCb callback function to allow access moduleState. - -### Bug Fixes - -* (baseapp) [#15789](https://github.com/cosmos/cosmos-sdk/pull/15789) Ensure `PrepareProposal` and `ProcessProposal` respect `InitialHeight` set by CometBFT when set to a value greater than 1. -* (types) [#15433](https://github.com/cosmos/cosmos-sdk/pull/15433) Allow disabling of account address caches (for printing bech32 account addresses). -* (client/keys) [#15876](https://github.com/cosmos/cosmos-sdk/pull/15876) Fix the JSON output ` keys list --output json` when there are no keys. - -## [v0.47.1](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.47.1) - 2023-03-23 - -### Features - -* (x/bank) [#15265](https://github.com/cosmos/cosmos-sdk/pull/15265) Update keeper interface to include `GetAllDenomMetaData`. -* (x/groups) [#14879](https://github.com/cosmos/cosmos-sdk/pull/14879) Add `Query/Groups` query to get all the groups. -* (x/gov,cli) [#14718](https://github.com/cosmos/cosmos-sdk/pull/14718) Added `AddGovPropFlagsToCmd` and `ReadGovPropFlags` functions. -* (cli) [#14655](https://github.com/cosmos/cosmos-sdk/pull/14655) Add a new command to list supported algos. -* (x/genutil,cli) [#15147](https://github.com/cosmos/cosmos-sdk/pull/15147) Add `--initial-height` flag to cli init cmd to provide `genesis.json` with user-defined initial block height. - -### Improvements - -* (x/distribution) [#15462](https://github.com/cosmos/cosmos-sdk/pull/15462) Add delegator address to the event for withdrawing delegation rewards. -* [#14609](https://github.com/cosmos/cosmos-sdk/pull/14609) Add `RetryForBlocks` method to use in tests that require waiting for a transaction to be included in a block. - -### Bug Fixes - -* (baseapp) [#15487](https://github.com/cosmos/cosmos-sdk/pull/15487) Reset state before calling PrepareProposal and ProcessProposal. -* (cli) [#15123](https://github.com/cosmos/cosmos-sdk/pull/15123) Fix the CLI `offline` mode behavior to be really offline. The API of `clienttx.NewFactoryCLI` is updated to return an error. - -### Deprecated - -* (x/genutil) [#15316](https://github.com/cosmos/cosmos-sdk/pull/15316) Remove requirement on node & IP being included in a gentx. - -## [v0.47.0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.47.0) - 2023-03-14 - -### Features - -* (x/gov) [#15151](https://github.com/cosmos/cosmos-sdk/pull/15151) Add `burn_vote_quorum`, `burn_proposal_deposit_prevote` and `burn_vote_veto` params to allow applications to decide if they would like to burn deposits -* (client) [#14509](https://github.com/cosmos/cosmos-sdk/pull/#14509) Added `AddKeyringFlags` function. -* (x/bank) [#14045](https://github.com/cosmos/cosmos-sdk/pull/14045) Add CLI command `spendable-balances`, which also accepts the flag `--denom`. -* (x/slashing, x/staking) [#14363](https://github.com/cosmos/cosmos-sdk/pull/14363) Add the infraction a validator commited type as an argument to a `SlashWithInfractionReason` keeper method. -* (client) [#14051](https://github.com/cosmos/cosmos-sdk/pull/14051) Add `--grpc` client option. -* (x/genutil) [#14149](https://github.com/cosmos/cosmos-sdk/pull/14149) Add `genutilcli.GenesisCoreCommand` command, which contains all genesis-related sub-commands. -* (x/evidence) [#13740](https://github.com/cosmos/cosmos-sdk/pull/13740) Add new proto field `hash` of type `string` to `QueryEvidenceRequest` which helps to decode the hash properly while using query API. -* (core) [#13306](https://github.com/cosmos/cosmos-sdk/pull/13306) Add a `FormatCoins` function to in `core/coins` to format sdk Coins following the Value Renderers spec. -* (math) [#13306](https://github.com/cosmos/cosmos-sdk/pull/13306) Add `FormatInt` and `FormatDec` functiosn in `math` to format integers and decimals following the Value Renderers spec. -* (x/staking) [#13122](https://github.com/cosmos/cosmos-sdk/pull/13122) Add `UnbondingCanComplete` and `PutUnbondingOnHold` to `x/staking` module. -* [#13437](https://github.com/cosmos/cosmos-sdk/pull/13437) Add new flag `--modules-to-export` in `simd export` command to export only selected modules. -* [#13298](https://github.com/cosmos/cosmos-sdk/pull/13298) Add `AddGenesisAccount` helper func in x/auth module which helps adding accounts to genesis state. -* (x/authz) [#12648](https://github.com/cosmos/cosmos-sdk/pull/12648) Add an allow list, an optional list of addresses allowed to receive bank assets via authz MsgSend grant. -* (sdk.Coins) [#12627](https://github.com/cosmos/cosmos-sdk/pull/12627) Make a Denoms method on sdk.Coins. -* (testutil) [#12973](https://github.com/cosmos/cosmos-sdk/pull/12973) Add generic `testutil.RandSliceElem` function which selects a random element from the list. -* (client) [#12936](https://github.com/cosmos/cosmos-sdk/pull/12936) Add capability to preprocess transactions before broadcasting from a higher level chain. -* (cli) [#13064](https://github.com/cosmos/cosmos-sdk/pull/13064) Add `debug prefixes` to list supported HRP prefixes via . -* (ledger) [#12935](https://github.com/cosmos/cosmos-sdk/pull/12935) Generalize Ledger integration to allow for different apps or keytypes that use SECP256k1. -* (x/bank) [#11981](https://github.com/cosmos/cosmos-sdk/pull/11981) Create the `SetSendEnabled` endpoint for managing the bank's SendEnabled settings. -* (x/auth) [#13210](https://github.com/cosmos/cosmos-sdk/pull/13210) Add `Query/AccountInfo` endpoint for simplified access to basic account info. -* (x/consensus) [#12905](https://github.com/cosmos/cosmos-sdk/pull/12905) Create a new `x/consensus` module that is now responsible for maintaining Tendermint consensus parameters instead of `x/param`. Legacy types remain in order to facilitate parameter migration from the deprecated `x/params`. App developers should ensure that they execute `baseapp.MigrateParams` during their chain upgrade. These legacy types will be removed in a future release. -* (client/tx) [#13670](https://github.com/cosmos/cosmos-sdk/pull/13670) Add validation in `BuildUnsignedTx` to prevent simple inclusion of valid mnemonics - -### Improvements - -* [#14995](https://github.com/cosmos/cosmos-sdk/pull/14995) Allow unknown fields in `ParseTypedEvent`. -* (store) [#14931](https://github.com/cosmos/cosmos-sdk/pull/14931) Exclude in-memory KVStores, i.e. `StoreTypeMemory`, from CommitInfo commitments. -* (cli) [#14919](https://github.com/cosmos/cosmos-sdk/pull/14919) Fix never assigned error when write validators. -* (x/group) [#14923](https://github.com/cosmos/cosmos-sdk/pull/14923) Fix error while using pagination in `x/group` from CLI. -* (types/coin) [#14715](https://github.com/cosmos/cosmos-sdk/pull/14715) `sdk.Coins.Add` now returns an empty set of coins `sdk.Coins{}` if both coins set are empty. - * This is a behavior change, as previously `sdk.Coins.Add` would return `nil` in this case. -* (reflection) [#14838](https://github.com/cosmos/cosmos-sdk/pull/14838) We now require that all proto files' import path (i.e. the OS path) matches their fully-qualified package name. For example, proto files with package name `cosmos.my.pkg.v1` should live in the folder `cosmos/my/pkg/v1/*.proto` relatively to the protoc import root folder (usually the root `proto/` folder). -* (baseapp) [#14505](https://github.com/cosmos/cosmos-sdk/pull/14505) PrepareProposal and ProcessProposal now use deliverState for the first block in order to access changes made in InitChain. -* (x/group) [#14527](https://github.com/cosmos/cosmos-sdk/pull/14527) Fix wrong address set in `EventUpdateGroupPolicy`. -* (cli) [#14509](https://github.com/cosmos/cosmos-sdk/pull/14509) Added missing options to keyring-backend flag usage. -* (server) [#14441](https://github.com/cosmos/cosmos-sdk/pull/14441) Fix `--log_format` flag not working. -* (ante) [#14448](https://github.com/cosmos/cosmos-sdk/pull/14448) Return anteEvents when postHandler fail. -* (baseapp) [#13983](https://github.com/cosmos/cosmos-sdk/pull/13983) Don't emit duplicate ante-handler events when a post-handler is defined. -* (x/staking) [#14064](https://github.com/cosmos/cosmos-sdk/pull/14064) Set all fields in `redelegation.String()`. -* (x/upgrade) [#13936](https://github.com/cosmos/cosmos-sdk/pull/13936) Make downgrade verification work again. -* (x/group) [#13742](https://github.com/cosmos/cosmos-sdk/pull/13742) Fix `validate-genesis` when group policy accounts exist. -* (store) [#13516](https://github.com/cosmos/cosmos-sdk/pull/13516) Fix state listener that was observing writes at wrong time. -* (simstestutil) [#15305](https://github.com/cosmos/cosmos-sdk/pull/15305) Add `AppStateFnWithExtendedCb` with callback function to extend rawState. -* (simapp) [#14977](https://github.com/cosmos/cosmos-sdk/pull/14977) Move simulation helpers functions (`AppStateFn` and `AppStateRandomizedFn`) to `testutil/sims`. These takes an extra genesisState argument which is the default state of the app. -* (cli) [#14953](https://github.com/cosmos/cosmos-sdk/pull/14953) Enable profiling block replay during abci handshake with `--cpu-profile`. -* (store) [#14410](https://github.com/cosmos/cosmos-sdk/pull/14410) `rootmulti.Store.loadVersion` has validation to check if all the module stores' height is correct, it will error if any module store has incorrect height. -* (store) [#14189](https://github.com/cosmos/cosmos-sdk/pull/14189) Add config `iavl-lazy-loading` to enable lazy loading of iavl store, to improve start up time of archive nodes, add method `SetLazyLoading` to `CommitMultiStore` interface. -* (deps) [#14830](https://github.com/cosmos/cosmos-sdk/pull/14830) Bump to IAVL `v0.19.5-rc.1`. -* (tools) [#14793](https://github.com/cosmos/cosmos-sdk/pull/14793) Dockerfile optimization. -* (x/gov) [#13010](https://github.com/cosmos/cosmos-sdk/pull/13010) Partial cherry-pick of this issue for adding proposer migration. -* [#14691](https://github.com/cosmos/cosmos-sdk/pull/14691) Change behavior of `sdk.StringifyEvents` to not flatten events attributes by events type. - * This change only affects ABCI message logs, and not the events field. -* [#14692](https://github.com/cosmos/cosmos-sdk/pull/14692) Improve RPC queries error message when app is at height 0. -* [#14017](https://github.com/cosmos/cosmos-sdk/pull/14017) Simplify ADR-028 and `address.Module`. - * This updates the [ADR-028](https://docs.cosmos.network/main/architecture/adr-028-public-key-addresses) and enhance the `address.Module` API to support module addresses and sub-module addresses in a backward compatible way. -* (snapshots) [#14608](https://github.com/cosmos/cosmos-sdk/pull/14608/) Deprecate unused structs `SnapshotKVItem` and `SnapshotSchema`. -* [#15243](https://github.com/cosmos/cosmos-sdk/pull/15243) `LatestBlockResponse` & `BlockByHeightResponse` types' field `sdk_block` was incorrectly cast `proposer_address` bytes to validator operator address, now to consensus address -* (x/group, x/gov) [#14483](https://github.com/cosmos/cosmos-sdk/pull/14483) Add support for `[]string` and `[]int` in `draft-proposal` prompt. -* (protobuf) [#14476](https://github.com/cosmos/cosmos-sdk/pull/14476) Clean up protobuf annotations `{accepts,implements}_interface`. -* (x/gov, x/group) [#14472](https://github.com/cosmos/cosmos-sdk/pull/14472) The recommended metadata format for x/gov and x/group proposals now uses an array of strings (instead of a single string) for the `authors` field. -* (crypto) [#14460](https://github.com/cosmos/cosmos-sdk/pull/14460) Check the signature returned by a ledger device against the public key in the keyring. -* [#14356](https://github.com/cosmos/cosmos-sdk/pull/14356) Add `events.GetAttributes` and `event.GetAttribute` methods to simplify the retrieval of an attribute from event(s). -* (types) [#14332](https://github.com/cosmos/cosmos-sdk/issues/14332) Reduce state export time by 50%. -* (types) [#14163](https://github.com/cosmos/cosmos-sdk/pull/14163) Refactor `(coins Coins) Validate()` to avoid unnecessary map. -* [#13881](https://github.com/cosmos/cosmos-sdk/pull/13881) Optimize iteration on nested cached KV stores and other operations in general. -* (x/gov) [#14347](https://github.com/cosmos/cosmos-sdk/pull/14347) Support `v1.Proposal` message in `v1beta1.Proposal.Content`. -* [#13882](https://github.com/cosmos/cosmos-sdk/pull/13882) Add tx `encode` and `decode` endpoints to amino tx service. - > Note: These endpoints encodes and decodes only amino txs. -* (config) [#13894](https://github.com/cosmos/cosmos-sdk/pull/13894) Support state streaming configuration in `app.toml` template and default configuration. -* (x/nft) [#13836](https://github.com/cosmos/cosmos-sdk/pull/13836) Remove the validation for `classID` and `nftID` from the NFT module. -* [#13789](https://github.com/cosmos/cosmos-sdk/pull/13789) Add tx `encode` and `decode` endpoints to tx service. - > Note: These endpoints will only encode and decode proto messages, Amino encoding and decoding is not supported. -* [#13619](https://github.com/cosmos/cosmos-sdk/pull/13619) Add new function called LogDeferred to report errors in defers. Use the function in x/bank files. -* (deps) [#13397](https://github.com/cosmos/cosmos-sdk/pull/13397) Bump Go version minimum requirement to `1.19`. -* [#13070](https://github.com/cosmos/cosmos-sdk/pull/13070) Migrate from `gogo/protobuf` to `cosmos/gogoproto`. -* [#12995](https://github.com/cosmos/cosmos-sdk/pull/12995) Add `FormatTime` and `ParseTimeString` methods. -* [#12952](https://github.com/cosmos/cosmos-sdk/pull/12952) Replace keyring module to Cosmos fork. -* [#12352](https://github.com/cosmos/cosmos-sdk/pull/12352) Move the `RegisterSwaggerAPI` logic into a separate helper function in the server package. -* [#12876](https://github.com/cosmos/cosmos-sdk/pull/12876) Remove proposer-based rewards. -* [#12846](https://github.com/cosmos/cosmos-sdk/pull/12846) Remove `RandomizedParams` from the `AppModuleSimulation` interface which is no longer needed. -* (ci) [#12854](https://github.com/cosmos/cosmos-sdk/pull/12854) Use ghcr.io to host the proto builder image. Update proto builder image to go 1.19 -* (x/bank) [#12706](https://github.com/cosmos/cosmos-sdk/pull/12706) Added the `chain-id` flag to the `AddTxFlagsToCmd` API. There is no longer a need to explicitly register this flag on commands whens `AddTxFlagsToCmd` is already called. -* [#12717](https://github.com/cosmos/cosmos-sdk/pull/12717) Use injected encoding params in simapp. -* [#12634](https://github.com/cosmos/cosmos-sdk/pull/12634) Move `sdk.Dec` to math package. -* [#12187](https://github.com/cosmos/cosmos-sdk/pull/12187) Add batch operation for x/nft module. -* [#12455](https://github.com/cosmos/cosmos-sdk/pull/12455) Show attempts count in error for signing. -* [#13101](https://github.com/cosmos/cosmos-sdk/pull/13101) Remove weights from `simapp/params` and `testutil/sims`. They are now in their respective modules. -* [#12398](https://github.com/cosmos/cosmos-sdk/issues/12398) Refactor all `x` modules to unit-test via mocks and decouple `simapp`. -* [#13144](https://github.com/cosmos/cosmos-sdk/pull/13144) Add validator distribution info grpc gateway get endpoint. -* [#13168](https://github.com/cosmos/cosmos-sdk/pull/13168) Migrate tendermintdev/proto-builder to ghcr.io. New image `ghcr.io/cosmos/proto-builder:0.8` -* [#13178](https://github.com/cosmos/cosmos-sdk/pull/13178) Add `cosmos.msg.v1.service` protobuf annotation to allow tooling to distinguish between Msg and Query services via reflection. -* [#13236](https://github.com/cosmos/cosmos-sdk/pull/13236) Integrate Filter Logging -* [#13528](https://github.com/cosmos/cosmos-sdk/pull/13528) Update `ValidateMemoDecorator` to only check memo against `MaxMemoCharacters` param when a memo is present. -* [#13651](https://github.com/cosmos/cosmos-sdk/pull/13651) Update `server/config/config.GetConfig` function. -* [#13781](https://github.com/cosmos/cosmos-sdk/pull/13781) Remove `client/keys.KeysCdc`. -* [#13802](https://github.com/cosmos/cosmos-sdk/pull/13802) Add --output-document flag to the export CLI command to allow writing genesis state to a file. -* [#13794](https://github.com/cosmos/cosmos-sdk/pull/13794) `types/module.Manager` now supports the -`cosmossdk.io/core/appmodule.AppModule` API via the new `NewManagerFromMap` constructor. -* [#14175](https://github.com/cosmos/cosmos-sdk/pull/14175) Add `server.DefaultBaseappOptions(appopts)` function to reduce boiler plate in root.go. - -### State Machine Breaking - -* (baseapp, x/auth/posthandler) [#13940](https://github.com/cosmos/cosmos-sdk/pull/13940) Update `PostHandler` to receive the `runTx` success boolean. -* (store) [#14378](https://github.com/cosmos/cosmos-sdk/pull/14378) The `CacheKV` store is thread-safe again, which includes improved iteration and deletion logic. Iteration is on a strictly isolated view now, which is breaking from previous behavior. -* (x/bank) [#14538](https://github.com/cosmos/cosmos-sdk/pull/14538) Validate denom in bank balances GRPC queries. -* (x/group) [#14465](https://github.com/cosmos/cosmos-sdk/pull/14465) Add title and summary to proposal struct. -* (x/gov) [#14390](https://github.com/cosmos/cosmos-sdk/pull/14390) Add title, proposer and summary to proposal struct. -* (x/group) [#14071](https://github.com/cosmos/cosmos-sdk/pull/14071) Don't re-tally proposal after voting period end if they have been marked as ACCEPTED or REJECTED. -* (x/group) [#13742](https://github.com/cosmos/cosmos-sdk/pull/13742) Migrate group policy account from module accounts to base account. -* (x/auth)[#13780](https://github.com/cosmos/cosmos-sdk/pull/13780) `id` (type of int64) in `AccountAddressByID` grpc query is now deprecated, update to account-id(type of uint64) to use `AccountAddressByID`. -* (codec) [#13307](https://github.com/cosmos/cosmos-sdk/pull/13307) Register all modules' `Msg`s with group's ModuleCdc so that Amino sign bytes are correctly generated.* (x/gov) -* (codec) [#13196](https://github.com/cosmos/cosmos-sdk/pull/13196) Register all modules' `Msg`s with gov's ModuleCdc so that Amino sign bytes are correctly generated. -* (group) [#13592](https://github.com/cosmos/cosmos-sdk/pull/13592) Fix group types registration with Amino. -* (x/distribution) [#12852](https://github.com/cosmos/cosmos-sdk/pull/12852) Deprecate `CommunityPoolSpendProposal`. Please execute a `MsgCommunityPoolSpend` message via the new v1 `x/gov` module instead. This message can be used to directly fund the `x/gov` module account. -* (x/bank) [#12610](https://github.com/cosmos/cosmos-sdk/pull/12610) `MsgMultiSend` now allows only a single input. -* (x/bank) [#12630](https://github.com/cosmos/cosmos-sdk/pull/12630) Migrate `x/bank` to self-managed parameters and deprecate its usage of `x/params`. -* (x/auth) [#12475](https://github.com/cosmos/cosmos-sdk/pull/12475) Migrate `x/auth` to self-managed parameters and deprecate its usage of `x/params`. -* (x/slashing) [#12399](https://github.com/cosmos/cosmos-sdk/pull/12399) Migrate `x/slashing` to self-managed parameters and deprecate its usage of `x/params`. -* (x/mint) [#12363](https://github.com/cosmos/cosmos-sdk/pull/12363) Migrate `x/mint` to self-managed parameters and deprecate it's usage of `x/params`. -* (x/distribution) [#12434](https://github.com/cosmos/cosmos-sdk/pull/12434) Migrate `x/distribution` to self-managed parameters and deprecate it's usage of `x/params`. -* (x/crisis) [#12445](https://github.com/cosmos/cosmos-sdk/pull/12445) Migrate `x/crisis` to self-managed parameters and deprecate it's usage of `x/params`. -* (x/gov) [#12631](https://github.com/cosmos/cosmos-sdk/pull/12631) Migrate `x/gov` to self-managed parameters and deprecate it's usage of `x/params`. -* (x/staking) [#12409](https://github.com/cosmos/cosmos-sdk/pull/12409) Migrate `x/staking` to self-managed parameters and deprecate it's usage of `x/params`. -* (x/bank) [#11859](https://github.com/cosmos/cosmos-sdk/pull/11859) Move the SendEnabled information out of the Params and into the state store directly. -* (x/gov) [#12771](https://github.com/cosmos/cosmos-sdk/pull/12771) Initial deposit requirement for proposals at submission time. -* (x/staking) [#12967](https://github.com/cosmos/cosmos-sdk/pull/12967) `unbond` now creates only one unbonding delegation entry when multiple unbondings exist at a single height (e.g. through multiple messages in a transaction). -* (x/auth/vesting) [#13502](https://github.com/cosmos/cosmos-sdk/pull/13502) Add Amino Msg registration for `MsgCreatePeriodicVestingAccount`. - -### API Breaking Changes - -* Migrate to CometBFT. Follow the migration instructions in the [upgrade guide](./UPGRADING.md#migration-to-cometbft-part-1). -* (simulation) [#14728](https://github.com/cosmos/cosmos-sdk/pull/14728) Rename the `ParamChanges` field to `LegacyParamChange` and `Contents` to `LegacyProposalContents` in `simulation.SimulationState`. Additionally it adds a `ProposalMsgs` field to `simulation.SimulationState`. -* (x/gov) [#14782](https://github.com/cosmos/cosmos-sdk/pull/14782) Move the `metadata` argument in `govv1.NewProposal` alongside `title` and `summary`. -* (x/upgrade) [#14216](https://github.com/cosmos/cosmos-sdk/pull/14216) Change upgrade keeper receiver to upgrade keeper pointers. -* (x/auth) [#13780](https://github.com/cosmos/cosmos-sdk/pull/13780) Querying with `id` (type of int64) in `AccountAddressByID` grpc query now throws error, use account-id(type of uint64) instead. -* (store) [#13516](https://github.com/cosmos/cosmos-sdk/pull/13516) Update State Streaming APIs: - * Add method `ListenCommit` to `ABCIListener` - * Move `ListeningEnabled` and `AddListener` methods to `CommitMultiStore` - * Remove `CacheWrapWithListeners` from `CacheWrap` and `CacheWrapper` interfaces - * Remove listening APIs from the caching layer (it should only listen to the `rootmulti.Store`) - * Add three new options to file streaming service constructor. - * Modify `ABCIListener` such that any error from any method will always halt the app via `panic` -* (x/auth) [#13877](https://github.com/cosmos/cosmos-sdk/pull/13877) Rename `AccountKeeper`'s `GetNextAccountNumber` to `NextAccountNumber`. -* (x/evidence) [#13740](https://github.com/cosmos/cosmos-sdk/pull/13740) The `NewQueryEvidenceRequest` function now takes `hash` as a HEX encoded `string`. -* (server) [#13485](https://github.com/cosmos/cosmos-sdk/pull/13485) The `Application` service now requires the `RegisterNodeService` method to be implemented. -* [#13437](https://github.com/cosmos/cosmos-sdk/pull/13437) Add a list of modules to export argument in `ExportAppStateAndValidators`. -* (simapp) [#13402](https://github.com/cosmos/cosmos-sdk/pull/13402) Move simulation flags to `x/simulation/client/cli`. -* (simapp) [#13402](https://github.com/cosmos/cosmos-sdk/pull/13402) Move simulation helpers functions (`SetupSimulation`, `SimulationOperations`, `CheckExportSimulation`, `PrintStats`, `GetSimulationLog`) to `testutil/sims`. -* (simapp) [#13402](https://github.com/cosmos/cosmos-sdk/pull/13402) Move `testutil/rest` package to `testutil`. -* (types) [#13380](https://github.com/cosmos/cosmos-sdk/pull/13380) Remove deprecated `sdk.NewLevelDB`. -* (simapp) [#13378](https://github.com/cosmos/cosmos-sdk/pull/13378) Move `simapp.App` to `runtime.AppI`. -* (tx) [#12659](https://github.com/cosmos/cosmos-sdk/pull/12659) Remove broadcast mode `block`. -* (simapp) [#12747](https://github.com/cosmos/cosmos-sdk/pull/12747) Remove `simapp.MakeTestEncodingConfig`. Please use `moduletestutil.MakeTestEncodingConfig` (`types/module/testutil`) in tests instead. -* (x/bank) [#12648](https://github.com/cosmos/cosmos-sdk/pull/12648) `NewSendAuthorization` takes a new argument of an optional list of addresses allowed to receive bank assests via authz MsgSend grant. You can pass `nil` for the same behavior as before, i.e. any recipient is allowed. -* (x/bank) [#12593](https://github.com/cosmos/cosmos-sdk/pull/12593) Add `SpendableCoin` method to `BaseViewKeeper` -* (x/slashing) [#12581](https://github.com/cosmos/cosmos-sdk/pull/12581) Remove `x/slashing` legacy querier. -* (types) [#12355](https://github.com/cosmos/cosmos-sdk/pull/12355) Remove the compile-time `types.DBbackend` variable. Removes usage of the same in server/util.go -* (x/gov) [#12368](https://github.com/cosmos/cosmos-sdk/pull/12369) Gov keeper is now passed by reference instead of copy to make post-construction mutation of Hooks and Proposal Handlers possible at a framework level. -* (simapp) [#12270](https://github.com/cosmos/cosmos-sdk/pull/12270) Remove `invCheckPeriod uint` attribute from `SimApp` struct as per migration of `x/crisis` to app wiring -* (simapp) [#12334](https://github.com/cosmos/cosmos-sdk/pull/12334) Move `simapp.ConvertAddrsToValAddrs` and `simapp.CreateTestPubKeys ` to respectively `simtestutil.ConvertAddrsToValAddrs` and `simtestutil.CreateTestPubKeys` (`testutil/sims`) -* (simapp) [#12312](https://github.com/cosmos/cosmos-sdk/pull/12312) Move `simapp.EmptyAppOptions` to `simtestutil.EmptyAppOptions` (`testutil/sims`) -* (simapp) [#12312](https://github.com/cosmos/cosmos-sdk/pull/12312) Remove `skipUpgradeHeights map[int64]bool` and `homePath string` from `NewSimApp` constructor as per migration of `x/upgrade` to app-wiring. -* (testutil) [#12278](https://github.com/cosmos/cosmos-sdk/pull/12278) Move all functions from `simapp/helpers` to `testutil/sims` -* (testutil) [#12233](https://github.com/cosmos/cosmos-sdk/pull/12233) Move `simapp.TestAddr` to `simtestutil.TestAddr` (`testutil/sims`) -* (x/staking) [#12102](https://github.com/cosmos/cosmos-sdk/pull/12102) Staking keeper now is passed by reference instead of copy. Keeper's SetHooks no longer returns keeper. It updates the keeper in place instead. -* (linting) [#12141](https://github.com/cosmos/cosmos-sdk/pull/12141) Fix usability related linting for database. This means removing the infix Prefix from `prefix.NewPrefixWriter` and such so that it is `prefix.NewWriter` and making `db.DBConnection` and such into `db.Connection` -* (x/distribution) [#12434](https://github.com/cosmos/cosmos-sdk/pull/12434) `x/distribution` module `SetParams` keeper method definition is now updated to return `error`. -* (x/staking) [#12409](https://github.com/cosmos/cosmos-sdk/pull/12409) `x/staking` module `SetParams` keeper method definition is now updated to return `error`. -* (x/crisis) [#12445](https://github.com/cosmos/cosmos-sdk/pull/12445) `x/crisis` module `SetConstantFee` keeper method definition is now updated to return `error`. -* (x/gov) [#12631](https://github.com/cosmos/cosmos-sdk/pull/12631) `x/gov` module refactored to use `Params` as single struct instead of `DepositParams`, `TallyParams` & `VotingParams`. -* (x/gov) [#12631](https://github.com/cosmos/cosmos-sdk/pull/12631) Migrate `x/gov` to self-managed parameters and deprecate it's usage of `x/params`. -* (x/bank) [#12630](https://github.com/cosmos/cosmos-sdk/pull/12630) `x/bank` module `SetParams` keeper method definition is now updated to return `error`. -* (x/bank) [#11859](https://github.com/cosmos/cosmos-sdk/pull/11859) Move the SendEnabled information out of the Params and into the state store directly. - The information can now be accessed using the BankKeeper. - Setting can be done using MsgSetSendEnabled as a governance proposal. - A SendEnabled query has been added to both GRPC and CLI. -* (appModule) Remove `Route`, `QuerierRoute` and `LegacyQuerierHandler` from AppModule Interface. -* (x/modules) Remove all LegacyQueries and related code from modules -* (store) [#11825](https://github.com/cosmos/cosmos-sdk/pull/11825) Make extension snapshotter interface safer to use, renamed the util function `WriteExtensionItem` to `WriteExtensionPayload`. -* (x/genutil)[#12956](https://github.com/cosmos/cosmos-sdk/pull/12956) `genutil.AppModuleBasic` has a new attribute: genesis transaction validation function. The existing validation logic is implemented in `genutiltypes.DefaultMessageValidator`. Use `genutil.NewAppModuleBasic` to create a new genutil Module Basic. -* (codec) [#12964](https://github.com/cosmos/cosmos-sdk/pull/12964) `ProtoCodec.MarshalInterface` now returns an error when serializing unregistered types and a subsequent `ProtoCodec.UnmarshalInterface` would fail. -* (x/staking) [#12973](https://github.com/cosmos/cosmos-sdk/pull/12973) Removed `stakingkeeper.RandomValidator`. Use `testutil.RandSliceElem(r, sk.GetAllValidators(ctx))` instead. -* (x/gov) [#13160](https://github.com/cosmos/cosmos-sdk/pull/13160) Remove custom marshaling of proposl and voteoption. -* (types) [#13430](https://github.com/cosmos/cosmos-sdk/pull/13430) Remove unused code `ResponseCheckTx` and `ResponseDeliverTx` -* (store) [#13529](https://github.com/cosmos/cosmos-sdk/pull/13529) Add method `LatestVersion` to `MultiStore` interface, add method `SetQueryMultiStore` to baesapp to support alternative `MultiStore` implementation for query service. -* (pruning) [#13609](https://github.com/cosmos/cosmos-sdk/pull/13609) Move pruning package to be under store package -* [#13794](https://github.com/cosmos/cosmos-sdk/pull/13794) Most methods on `types/module.AppModule` have been moved to -extension interfaces. `module.Manager.Modules` is now of type `map[string]interface{}` to support in parallel the new -`cosmossdk.io/core/appmodule.AppModule` API. - -### CLI Breaking Changes - -* (genesis) [#14149](https://github.com/cosmos/cosmos-sdk/pull/14149) Add `simd genesis` command, which contains all genesis-related sub-commands. -* (x/genutil) [#13535](https://github.com/cosmos/cosmos-sdk/pull/13535) Replace in `simd init`, the `--staking-bond-denom` flag with `--default-denom` which is used for all default denomination in the genesis, instead of only staking. - -### Bug Fixes - -* (x/auth/vesting) [#15373](https://github.com/cosmos/cosmos-sdk/pull/15373) Add extra checks when creating a periodic vesting account. -* (x/auth) [#13838](https://github.com/cosmos/cosmos-sdk/pull/13838) Fix calling `String()` and `MarshalYAML` panics when pubkey is set on a `BaseAccount``. -* (x/evidence) [#13740](https://github.com/cosmos/cosmos-sdk/pull/13740) Fix evidence query API to decode the hash properly. -* (bank) [#13691](https://github.com/cosmos/cosmos-sdk/issues/13691) Fix unhandled error for vesting account transfers, when total vesting amount exceeds total balance. -* [#13553](https://github.com/cosmos/cosmos-sdk/pull/13553) Ensure all parameter validation for decimal types handles nil decimal values. -* [#13145](https://github.com/cosmos/cosmos-sdk/pull/13145) Fix panic when calling `String()` to a Record struct type. -* [#13116](https://github.com/cosmos/cosmos-sdk/pull/13116) Fix a dead-lock in the `Group-TotalWeight` `x/group` invariant. -* (types) [#12154](https://github.com/cosmos/cosmos-sdk/pull/12154) Add `baseAccountGetter` to avoid invalid account error when create vesting account. -* (x/staking) [#12303](https://github.com/cosmos/cosmos-sdk/pull/12303) Use bytes instead of string comparison in delete validator queue -* (store/rootmulti) [#12487](https://github.com/cosmos/cosmos-sdk/pull/12487) Fix non-deterministic map iteration. -* (sdk/dec_coins) [#12903](https://github.com/cosmos/cosmos-sdk/pull/12903) Fix nil `DecCoin` creation when converting `Coins` to `DecCoins` -* (store) [#12945](https://github.com/cosmos/cosmos-sdk/pull/12945) Fix nil end semantics in store/cachekv/iterator when iterating a dirty cache. -* (x/gov) [#13051](https://github.com/cosmos/cosmos-sdk/pull/13051) In SubmitPropsal, when a legacy msg fails it's handler call, wrap the error as ErrInvalidProposalContent (instead of ErrNoProposalHandlerExists). -* (snapshot) [#13400](https://github.com/cosmos/cosmos-sdk/pull/13400) Fix snapshot checksum issue in golang 1.19. -* (server) [#13778](https://github.com/cosmos/cosmos-sdk/pull/13778) Set Cosmos SDK default endpoints to localhost to avoid unknown exposure of endpoints. -* (x/auth) [#13877](https://github.com/cosmos/cosmos-sdk/pull/13877) Handle missing account numbers during `InitGenesis`. -* (x/gov) [#13918](https://github.com/cosmos/cosmos-sdk/pull/13918) Propagate message errors when executing a proposal. - -### Deprecated - -* (x/evidence) [#13740](https://github.com/cosmos/cosmos-sdk/pull/13740) The `evidence_hash` field of `QueryEvidenceRequest` has been deprecated and now contains a new field `hash` with type `string`. -* (x/bank) [#11859](https://github.com/cosmos/cosmos-sdk/pull/11859) The Params.SendEnabled field is deprecated and unusable. - The information can now be accessed using the BankKeeper. - Setting can be done using MsgSetSendEnabled as a governance proposal. - A SendEnabled query has been added to both GRPC and CLI. - -## [v0.46.12](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.12) - 2023-04-04 - -### Features - -* (x/groups) [#14879](https://github.com/cosmos/cosmos-sdk/pull/14879) Add `Query/Groups` query to get all the groups. - -### Improvements - -* (simapp) [#15305](https://github.com/cosmos/cosmos-sdk/pull/15305) Add `AppStateFnWithExtendedCb` with callback function to extend rawState and `AppStateRandomizedFnWithState` with extra genesisState argument which is the genesis state of the app. -* (x/distribution) [#15462](https://github.com/cosmos/cosmos-sdk/pull/15462) Add delegator address to the event for withdrawing delegation rewards. -* [#14019](https://github.com/cosmos/cosmos-sdk/issues/14019) Remove the interface casting to allow other implementations of a `CommitMultiStore`. - -## [v0.46.11](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.11) - 2023-03-03 - -### Improvements - -* (deps) Migrate to [CometBFT](https://github.com/cometbft/cometbft). Follow the instructions in the [release notes](./RELEASE_NOTES.md). -* (store) [#15152](https://github.com/cosmos/cosmos-sdk/pull/15152) Remove unmaintained and experimental `store/v2alpha1`. -* (store) [#14410](https://github.com/cosmos/cosmos-sdk/pull/14410) `rootmulti.Store.loadVersion` has validation to check if all the module stores' height is correct, it will error if any module store has incorrect height. - -### Bug Fixes - -* [#15243](https://github.com/cosmos/cosmos-sdk/pull/15243) `LatestBlockResponse` & `BlockByHeightResponse` types' field `sdk_block` was incorrectly cast `proposer_address` bytes to validator operator address, now to consensus address. - -## [v0.46.10](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.10) - 2023-02-16 - -### Improvements - -* (cli) [#14953](https://github.com/cosmos/cosmos-sdk/pull/14953) Enable profiling block replay during abci handshake with `--cpu-profile`. - -## [v0.46.9](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.9) - 2023-02-07 - -### Improvements - -* (store/cache) [#13881](https://github.com/cosmos/cosmos-sdk/pull/13881) Optimize iteration on nested cached KV stores and other operations in general. -* (deps) [#14846](https://github.com/cosmos/cosmos-sdk/pull/14846) Bump btcd. -* (deps) Bump Tendermint version to [v0.34.26](https://github.com/informalsystems/tendermint/releases/tag/v0.34.26). -* (store/cache) [#14189](https://github.com/cosmos/cosmos-sdk/pull/14189) Add config `iavl-lazy-loading` to enable lazy loading of iavl store, to improve start up time of archive nodes, add method `SetLazyLoading` to `CommitMultiStore` interface. - * A new field has been added to the app.toml. This alllows nodes with larger databases to startup quicker - - ```toml - # IAVLLazyLoading enable/disable the lazy loading of iavl store. - # Default is false. - iavl-lazy-loading = "" - ``` - -### Bug Fixes - -* (cli) [#14919](https://github.com/cosmos/cosmos-sdk/pull/#14919) Fix never assigned error when write validators. -* (store) [#14798](https://github.com/cosmos/cosmos-sdk/pull/14798) Copy btree to avoid the problem of modify while iteration. -* (cli) [#14799](https://github.com/cosmos/cosmos-sdk/pull/14799) Fix Evidence CLI query flag parsing (backport #13458) - -## [v0.46.8](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.8) - 2023-01-23 - -### Improvements - -* (store/cache) [#13881](https://github.com/cosmos/cosmos-sdk/pull/13881) Optimize iteration on nested cached KV stores and other operations in general. -* (x/gov) [#14347](https://github.com/cosmos/cosmos-sdk/pull/14347) Support `v1.Proposal` message in `v1beta1.Proposal.Content`. -* (deps) Use Informal System fork of Tendermint version to [v0.34.24](https://github.com/informalsystems/tendermint/releases/tag/v0.34.24). - -### Bug Fixes - -* (x/group) [#14526](https://github.com/cosmos/cosmos-sdk/pull/14526) Fix wrong address set in `EventUpdateGroupPolicy`. -* (ante) [#14448](https://github.com/cosmos/cosmos-sdk/pull/14448) Return anteEvents when postHandler fail. - -### API Breaking Changes - -* (x/gov) [#14422](https://github.com/cosmos/cosmos-sdk/pull/14422) Remove `Migrate_V046_6_To_V046_7` function which shouldn't be used for chains which already migrated to 0.46. - -## [v0.46.7](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.7) - 2022-12-13 - -### Features - -* (client) [#14051](https://github.com/cosmos/cosmos-sdk/pull/14051) Add `--grpc` client option. - -### Improvements - -* (deps) Bump Tendermint version to [v0.34.24](https://github.com/tendermint/tendermint/releases/tag/v0.34.24). -* [#13651](https://github.com/cosmos/cosmos-sdk/pull/13651) Update `server/config/config.GetConfig` function. -* [#14175](https://github.com/cosmos/cosmos-sdk/pull/14175) Add `server.DefaultBaseappOptions(appopts)` function to reduce boiler plate in root.go. - -### State Machine Breaking - -* (x/gov) [#14214](https://github.com/cosmos/cosmos-sdk/pull/14214) Fix gov v0.46 migration to v1 votes. - * Also provide a helper function `govv046.Migrate_V0466_To_V0467` for migrating a chain already on v0.46 with versions <=v0.46.6 to the latest v0.46.7 correct state. -* (x/group) [#14071](https://github.com/cosmos/cosmos-sdk/pull/14071) Don't re-tally proposal after voting period end if they have been marked as ACCEPTED or REJECTED. - -### API Breaking Changes - -* (store) [#13516](https://github.com/cosmos/cosmos-sdk/pull/13516) Update State Streaming APIs: - * Add method `ListenCommit` to `ABCIListener` - * Move `ListeningEnabled` and `AddListener` methods to `CommitMultiStore` - * Remove `CacheWrapWithListeners` from `CacheWrap` and `CacheWrapper` interfaces - * Remove listening APIs from the caching layer (it should only listen to the `rootmulti.Store`) - * Add three new options to file streaming service constructor. - * Modify `ABCIListener` such that any error from any method will always halt the app via `panic` -* (store) [#13529](https://github.com/cosmos/cosmos-sdk/pull/13529) Add method `LatestVersion` to `MultiStore` interface, add method `SetQueryMultiStore` to baesapp to support alternative `MultiStore` implementation for query service. - -### Bug Fixes - -* (baseapp) [#13983](https://github.com/cosmos/cosmos-sdk/pull/13983) Don't emit duplicate ante-handler events when a post-handler is defined. -* (baseapp) [#14049](https://github.com/cosmos/cosmos-sdk/pull/14049) Fix state sync when interval is zero. -* (store) [#13516](https://github.com/cosmos/cosmos-sdk/pull/13516) Fix state listener that was observing writes at wrong time. - -## [v0.46.6](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.6) - 2022-11-18 - -### Improvements - -* (config) [#13894](https://github.com/cosmos/cosmos-sdk/pull/13894) Support state streaming configuration in `app.toml` template and default configuration. - -### Bug Fixes - -* (x/gov) [#13918](https://github.com/cosmos/cosmos-sdk/pull/13918) Fix propagation of message errors when executing a proposal. - -## [v0.46.5](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.5) - 2022-11-17 - -### Features - -* (x/bank) [#13891](https://github.com/cosmos/cosmos-sdk/pull/13891) Provide a helper function `Migrate_V0464_To_V0465` for migrating a chain **already on v0.46 with versions <=v0.46.4** to the latest v0.46.5 correct state. - -### Improvements - -* [#13826](https://github.com/cosmos/cosmos-sdk/pull/13826) Support custom `GasConfig` configuration for applications. -* (deps) Bump Tendermint version to [v0.34.23](https://github.com/tendermint/tendermint/releases/tag/v0.34.23). - -### State Machine Breaking - -* (x/group) [#13876](https://github.com/cosmos/cosmos-sdk/pull/13876) Fix group MinExecutionPeriod that is checked on execution now, instead of voting period end. - -### API Breaking Changes - -* (x/group) [#13876](https://github.com/cosmos/cosmos-sdk/pull/13876) Add `GetMinExecutionPeriod` method on DecisionPolicy interface. - -### Bug Fixes - -* (x/group) [#13869](https://github.com/cosmos/cosmos-sdk/pull/13869) Group members weight must be positive and a finite number. -* (x/bank) [#13821](https://github.com/cosmos/cosmos-sdk/pull/13821) Fix bank store migration of coin metadata. -* (x/group) [#13808](https://github.com/cosmos/cosmos-sdk/pull/13808) Fix propagation of message events to the current context in `EndBlocker`. -* (x/gov) [#13728](https://github.com/cosmos/cosmos-sdk/pull/13728) Fix propagation of message events to the current context in `EndBlocker`. -* (store) [#13803](https://github.com/cosmos/cosmos-sdk/pull/13803) Add an error log if IAVL set operation failed. -* [#13861](https://github.com/cosmos/cosmos-sdk/pull/13861) Allow `_` characters in tx event queries, i.e. `GetTxsEvent`. - -## [v0.46.4](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.4) - 2022-11-01 - -### Features - -* (x/auth) [#13612](https://github.com/cosmos/cosmos-sdk/pull/13612) Add `Query/ModuleAccountByName` endpoint for accessing the module account info by module name. - -### Improvements - -* (deps) Bump IAVL version to [v0.19.4](https://github.com/cosmos/iavl/releases/tag/v0.19.4). - -### Bug Fixes - -* (x/auth/tx) [#12474](https://github.com/cosmos/cosmos-sdk/pull/12474) Remove condition in GetTxsEvent that disallowed multiple equal signs, which would break event queries with base64 strings (i.e. query by signature). -* (store) [#13530](https://github.com/cosmos/cosmos-sdk/pull/13530) Fix app-hash mismatch if upgrade migration commit is interrupted. - -### CLI Breaking Changes - -* [#13656](https://github.com/cosmos/cosmos-sdk/pull/13659) Rename `server.FlagIAVLFastNode` to `server.FlagDisableIAVLFastNode` for clarity. - -### API Breaking Changes - -* (context) [#13063](https://github.com/cosmos/cosmos-sdk/pull/13063) Update `Context#CacheContext` to automatically emit all events on the parent context's `EventManager`. - -## [v0.46.3](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.3) - 2022-10-20 - -ATTENTION: - -This is a security release for the [Dragonberry security advisory](https://forum.cosmos.network/t/ibc-security-advisory-dragonberry/7702). - -All users should upgrade immediately. - -Users *must* add a replace directive in their go.mod for the new `ics23` package in the SDK: - -```go -replace github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 -``` - -### Features - -* [#13435](https://github.com/cosmos/cosmos-sdk/pull/13435) Extend error context when a simulation fails. -* (grpc) [#13485](https://github.com/cosmos/cosmos-sdk/pull/13485) Implement a new gRPC query, `/cosmos/base/node/v1beta1/config`, which provides operator configuration. -* (cli) [#13147](https://github.com/cosmos/cosmos-sdk/pull/13147) Add the `--append` flag to the `sign-batch` CLI cmd to combine the messages and sign those txs which are created with `--generate-only`. -* (cli) [#13454](https://github.com/cosmos/cosmos-sdk/pull/13454) `sign-batch` CLI can now read multiple transaction files. - -### Improvements - -* [#13586](https://github.com/cosmos/cosmos-sdk/pull/13586) Bump Tendermint to `v0.34.22`. -* (auth) [#13460](https://github.com/cosmos/cosmos-sdk/pull/13460) The `q auth address-by-id` CLI command has been renamed to `q auth address-by-acc-num` to be more explicit. However, the old `address-by-id` version is still kept as an alias, for backwards compatibility. -* [#13433](https://github.com/cosmos/cosmos-sdk/pull/13433) Remove dead code in cacheMergeIterator `Domain()`. - -### Bug Fixes - -* Implement dragonberry security patch. - * For applying the patch please refer to the [RELEASE NOTES](./RELEASE_NOTES.md) -* (store) [#13459](https://github.com/cosmos/cosmos-sdk/pull/13459) Don't let state listener observe the uncommitted writes. -* [#12548](https://github.com/cosmos/cosmos-sdk/pull/12548) Prevent signing from wrong key while using multisig. - -### API Breaking Changes - -* (server) [#13485](https://github.com/cosmos/cosmos-sdk/pull/13485) The `Application` service now requires the `RegisterNodeService` method to be implemented. - -## [v0.46.2](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.2) - 2022-10-03 - -### API Breaking Changes - -* (cli) [#13089](https://github.com/cosmos/cosmos-sdk/pull/13089) Fix rollback command don't actually delete multistore versions, added method `RollbackToVersion` to interface `CommitMultiStore` and added method `CommitMultiStore` to `Application` interface. -* (cli) [#13089](https://github.com/cosmos/cosmos-sdk/pull/13089) `NewRollbackCmd` now takes an `appCreator types.AppCreator`. - -### Features - -* (cli) [#13207](https://github.com/cosmos/cosmos-sdk/pull/13207) Reduce user's password prompts when calling keyring `List()` function. -* (cli) [#13353](https://github.com/cosmos/cosmos-sdk/pull/13353) Add `tx group draft-proposal` command for generating group proposal JSONs (skeleton). -* (cli) [#13304](https://github.com/cosmos/cosmos-sdk/pull/13304) Add `tx gov draft-proposal` command for generating proposal JSONs (skeleton). -* (x/authz) [#13047](https://github.com/cosmos/cosmos-sdk/pull/13047) Add a GetAuthorization function to the keeper. -* (cli) [#12742](https://github.com/cosmos/cosmos-sdk/pull/12742) Add the `prune` CLI cmd to manually prune app store history versions based on the pruning options. - -### Improvements - -* [#13323](https://github.com/cosmos/cosmos-sdk/pull/13323) Ensure `withdraw_rewards` rewards are emitted from all actions that result in rewards being withdrawn. -* [#13233](https://github.com/cosmos/cosmos-sdk/pull/13233) Add `--append` to `add-genesis-account` sub-command to append new tokens after an account is already created. -* (x/group) [#13214](https://github.com/cosmos/cosmos-sdk/pull/13214) Add `withdraw-proposal` command to group module's CLI transaction commands. -* (x/auth) [#13048](https://github.com/cosmos/cosmos-sdk/pull/13048) Add handling of AccountNumberStoreKeyPrefix to the simulation decoder. -* (simapp) [#13107](https://github.com/cosmos/cosmos-sdk/pull/13107) Call `SetIAVLCacheSize` with the configured value in simapp. -* [#13301](https://github.com/cosmos/cosmos-sdk/pull/13301) Keep the balance query endpoint compatible with legacy blocks -* [#13321](https://github.com/cosmos/cosmos-sdk/pull/13321) Add flag to disable fast node migration and usage. - -### Bug Fixes - -* (types) [#13265](https://github.com/cosmos/cosmos-sdk/pull/13265) Correctly coalesce coins even with repeated denominations & simplify logic. -* (x/auth) [#13200](https://github.com/cosmos/cosmos-sdk/pull/13200) Fix wrong sequences in `sign-batch`. -* (export) [#13029](https://github.com/cosmos/cosmos-sdk/pull/13029) Fix exporting the blockParams regression. -* [#13046](https://github.com/cosmos/cosmos-sdk/pull/13046) Fix missing return statement in BaseApp.Query. -* (store) [#13336](https://github.com/cosmos/cosmos-sdk/pull/13334) Call streaming listeners for deliver tx event, it was removed accidentally. -* (grpc) [#13417](https://github.com/cosmos/cosmos-sdk/pull/13417) fix grpc query panic that could crash the node (backport #13352). -* (grpc) [#13418](https://github.com/cosmos/cosmos-sdk/pull/13418) Add close for grpc only mode. - -## [v0.46.1](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.1) - 2022-08-24 - -### Improvements - -* [#12953](https://github.com/cosmos/cosmos-sdk/pull/12953) Change the default priority mechanism to be based on gas price. -* [#12981](https://github.com/cosmos/cosmos-sdk/pull/12981) Return proper error when parsing telemetry configuration. -* [#12969](https://github.com/cosmos/cosmos-sdk/pull/12969) Bump Tendermint to `v0.34.21` and IAVL to `v0.19.1`. -* [#12885](https://github.com/cosmos/cosmos-sdk/pull/12885) Amortize cost of processing cache KV store. -* (events) [#12850](https://github.com/cosmos/cosmos-sdk/pull/12850) Add a new `fee_payer` attribute to the `tx` event that is emitted from the `DeductFeeDecorator` AnteHandler decorator. -* (x/params) [#12615](https://github.com/cosmos/cosmos-sdk/pull/12615) Add `GetParamSetIfExists` function to params `Subspace` to prevent panics on breaking changes. -* (x/bank) [#12674](https://github.com/cosmos/cosmos-sdk/pull/12674) Add convenience function `CreatePrefixedAccountStoreKey()` to construct key to access account's balance for a given denom. -* [#12877](https://github.com/cosmos/cosmos-sdk/pull/12877) Bumped cosmossdk.io/math to v1.0.0-beta.3 -* [#12693](https://github.com/cosmos/cosmos-sdk/pull/12693) Make sure the order of each node is consistent when emitting proto events. - -### Bug Fixes - -* (x/group) [#12888](https://github.com/cosmos/cosmos-sdk/pull/12888) Fix event propagation to the current context of `x/group` message execution `[]sdk.Result`. -* (x/upgrade) [#12906](https://github.com/cosmos/cosmos-sdk/pull/12906) Fix upgrade failure by moving downgrade verification logic after store migration. - -## [v0.46.0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.0) - 2022-07-26 - -### Features - -* (types) [#11985](https://github.com/cosmos/cosmos-sdk/pull/11985) Add a `Priority` field on `sdk.Context`, which represents the CheckTx priority field. It is only used during CheckTx. -* (gRPC) [#11889](https://github.com/cosmos/cosmos-sdk/pull/11889) Support custom read and write gRPC options in `app.toml`. See `max-recv-msg-size` and `max-send-msg-size` respectively. -* (cli) [#11738](https://github.com/cosmos/cosmos-sdk/pull/11738) Add `tx auth multi-sign` as alias of `tx auth multisign` for consistency with `multi-send`. -* (cli) [#11738](https://github.com/cosmos/cosmos-sdk/pull/11738) Add `tx bank multi-send` command for bulk send of coins to multiple accounts. -* (grpc) [#11642](https://github.com/cosmos/cosmos-sdk/pull/11642) Implement `ABCIQuery` in the Tendermint gRPC service, which proxies ABCI `Query` requests directly to the application. -* (x/upgrade) [#11551](https://github.com/cosmos/cosmos-sdk/pull/11551) Update `ScheduleUpgrade` for chains to schedule an automated upgrade on `BeginBlock` without having to go though governance. -* (tx) [#11533](https://github.com/cosmos/cosmos-sdk/pull/11533) Register [`EIP191`](https://eips.ethereum.org/EIPS/eip-191) as an available `SignMode` for chains to use. -* (x/genutil) [#11500](https://github.com/cosmos/cosmos-sdk/pull/11500) Fix GenTx validation and adjust error messages -* [#11430](https://github.com/cosmos/cosmos-sdk/pull/11430) Introduce a new `grpc-only` flag, such that when enabled, will start the node in a query-only mode. Note, gRPC MUST be enabled with this flag. -* (x/bank) [#11417](https://github.com/cosmos/cosmos-sdk/pull/11417) Introduce a new `SpendableBalances` gRPC query that retrieves an account's total (paginated) spendable balances. -* [#11441](https://github.com/cosmos/cosmos-sdk/pull/11441) Added a new method, `IsLTE`, for `types.Coin`. This method is used to check if a `types.Coin` is less than or equal to another `types.Coin`. -* (x/upgrade) [#11116](https://github.com/cosmos/cosmos-sdk/pull/11116) `MsgSoftwareUpgrade` and `MsgCancelUpgrade` have been added to support v1beta2 msgs-based gov proposals. -* [#10977](https://github.com/cosmos/cosmos-sdk/pull/10977) Now every cosmos message protobuf definition must be extended with a `cosmos.msg.v1.signer` option to signal the signer fields in a language agnostic way. -* [#10710](https://github.com/cosmos/cosmos-sdk/pull/10710) Chain-id shouldn't be required for creating a transaction with both --generate-only and --offline flags. -* [#10703](https://github.com/cosmos/cosmos-sdk/pull/10703) Create a new grantee account, if the grantee of an authorization does not exist. -* [#10592](https://github.com/cosmos/cosmos-sdk/pull/10592) Add a `DecApproxEq` function that checks to see if `|d1 - d2| < tol` for some Dec `d1, d2, tol`. -* [#9933](https://github.com/cosmos/cosmos-sdk/pull/9933) Introduces the notion of a Cosmos "Scalar" type, which would just be simple aliases that give human-understandable meaning to the underlying type, both in Go code and in Proto definitions. -* [#9884](https://github.com/cosmos/cosmos-sdk/pull/9884) Provide a new gRPC query handler, `/cosmos/params/v1beta1/subspaces`, that allows the ability to query for all registered subspaces and their respective keys. -* [#9776](https://github.com/cosmos/cosmos-sdk/pull/9776) Add flag `staking-bond-denom` to specify the staking bond denomination value when initializing a new chain. -* [#9533](https://github.com/cosmos/cosmos-sdk/pull/9533) Added a new gRPC method, `DenomOwners`, in `x/bank` to query for all account holders of a specific denomination. -* (bank) [#9618](https://github.com/cosmos/cosmos-sdk/pull/9618) Update bank.Metadata: add URI and URIHash attributes. -* (store) [#8664](https://github.com/cosmos/cosmos-sdk/pull/8664) Implementation of ADR-038 file StreamingService -* [#9837](https://github.com/cosmos/cosmos-sdk/issues/9837) `--generate-only` flag can be used with a keyname from the keyring. -* [#10326](https://github.com/cosmos/cosmos-sdk/pull/10326) `x/authz` add all grants by granter query. -* [#10944](https://github.com/cosmos/cosmos-sdk/pull/10944) `x/authz` add all grants by grantee query -* [#10348](https://github.com/cosmos/cosmos-sdk/pull/10348) Add `fee.{payer,granter}` and `tip` fields to StdSignDoc for signing tipped transactions. -* [#10208](https://github.com/cosmos/cosmos-sdk/pull/10208) Add `TipsTxMiddleware` for transferring tips. -* [#10379](https://github.com/cosmos/cosmos-sdk/pull/10379) Add validation to `x/upgrade` CLI `software-upgrade` command `--plan-info` value. -* [#10507](https://github.com/cosmos/cosmos-sdk/pull/10507) Add antehandler for tx priority. -* [#10311](https://github.com/cosmos/cosmos-sdk/pull/10311) Adds cli to use tips transactions. It adds an `--aux` flag to all CLI tx commands to generate the aux signer data (with optional tip), and a new `tx aux-to-fee` subcommand to let the fee payer gather aux signer data and broadcast the tx -* [#11019](https://github.com/cosmos/cosmos-sdk/pull/11019) Add `MsgCreatePermanentLockedAccount` and CLI method for creating permanent locked account -* [#10947](https://github.com/cosmos/cosmos-sdk/pull/10947) Add `AllowancesByGranter` query to the feegrant module -* [#10407](https://github.com/cosmos/cosmos-sdk/pull/10407) Add validation to `x/upgrade` module's `BeginBlock` to check accidental binary downgrades -* (gov) [#11036](https://github.com/cosmos/cosmos-sdk/pull/11036) Add in-place migrations for 0.43->0.46. Add a `migrate v0.46` CLI command for v0.43->0.46 JSON genesis migration. -* [#11006](https://github.com/cosmos/cosmos-sdk/pull/11006) Add `debug pubkey-raw` command to allow inspecting of pubkeys in legacy bech32 format -* (x/authz) [#10714](https://github.com/cosmos/cosmos-sdk/pull/10714) Add support for pruning expired authorizations -* [#11179](https://github.com/cosmos/cosmos-sdk/pull/11179) Add state rollback command. -* [#11234](https://github.com/cosmos/cosmos-sdk/pull/11234) Add `GRPCClient` field to Client Context. If `GRPCClient` field is set to nil, the `Invoke` method would use ABCI query, otherwise use gprc. -* (authz)[#11060](https://github.com/cosmos/cosmos-sdk/pull/11060) Support grant with no expire time. -* (rosetta) [#11590](https://github.com/cosmos/cosmos-sdk/pull/11590) Add fee suggestion for rosetta and enable offline mode. Also force set events about Fees to Success to pass reconciliation test. -* (types) [#11959](https://github.com/cosmos/cosmos-sdk/pull/11959) Added `sdk.Coins.Find` helper method to find a coin by denom. -* (upgrade) [#12603](https://github.com/cosmos/cosmos-sdk/pull/12603) feat: Move AppModule.BeginBlock and AppModule.EndBlock to extension interfaces -* (telemetry) [#12405](https://github.com/cosmos/cosmos-sdk/pull/12405) Add *query* calls metric to telemetry. -* (query) [#12253](https://github.com/cosmos/cosmos-sdk/pull/12253) Add `GenericFilteredPaginate` to the `query` package to improve UX. - -### API Breaking Changes - -* (x/auth/ante) [#11985](https://github.com/cosmos/cosmos-sdk/pull/11985) The `MempoolFeeDecorator` has been removed. Instead, the `DeductFeeDecorator` takes a new argument of type `TxFeeChecker`, to define custom fee models. If `nil` is passed to this `TxFeeChecker` argument, then it will default to `checkTxFeeWithValidatorMinGasPrices`, which is the exact same behavior as the old `MempoolFeeDecorator` (i.e. checking fees against validator's own min gas price). -* (x/auth/ante) [#11985](https://github.com/cosmos/cosmos-sdk/pull/11985) The `ExtensionOptionsDecorator` takes an argument of type `ExtensionOptionChecker`. For backwards-compatibility, you can pass `nil`, which defaults to the old behavior of rejecting all tx extensions. -* (crypto/keyring) [#11932](https://github.com/cosmos/cosmos-sdk/pull/11932) Remove `Unsafe*` interfaces from keyring package. Please use interface casting if you wish to access those unsafe functions. -* (types) [#11881](https://github.com/cosmos/cosmos-sdk/issues/11881) Rename `AccAddressFromHex` to `AccAddressFromHexUnsafe`. -* (types) [#11788](https://github.com/cosmos/cosmos-sdk/pull/11788) The `Int` and `Uint` types have been moved to their own dedicated module, `math`. Aliases are kept in the SDK's root `types` package, however, it is encouraged to utilize the new `math` module. As a result, the `Int#ToDec` API has been removed. -* (grpc) [#11642](https://github.com/cosmos/cosmos-sdk/pull/11642) The `RegisterTendermintService` method in the `tmservice` package now requires a `abciQueryFn` query function parameter. -* [#11496](https://github.com/cosmos/cosmos-sdk/pull/11496) Refactor abstractions for snapshot and pruning; snapshot intervals eventually pruned; unit tests. -* (types) [#11689](https://github.com/cosmos/cosmos-sdk/pull/11689) Make `Coins#Sub` and `Coins#SafeSub` consistent with `Coins#Add`. -* (store)[#11152](https://github.com/cosmos/cosmos-sdk/pull/11152) Remove `keep-every` from pruning options. -* [#10950](https://github.com/cosmos/cosmos-sdk/pull/10950) Add `envPrefix` parameter to `cmd.Execute`. -* (x/mint) [#10441](https://github.com/cosmos/cosmos-sdk/pull/10441) The `NewAppModule` function now accepts an inflation calculation function as an argument. -* [#9695](https://github.com/cosmos/cosmos-sdk/pull/9695) Migrate keys from `Info` (serialized as amino) -> `Record` (serialized as proto) - * Add new `codec.Codec` argument in: - * `keyring.NewInMemory` - * `keyring.New` - * Rename: - * `SavePubKey` to `SaveOfflineKey`. - * `NewMultiInfo`, `NewLedgerInfo` to `NewLegacyMultiInfo`, `newLegacyLedgerInfo` respectively. Move them into `legacy_info.go`. - * `NewOfflineInfo` to `newLegacyOfflineInfo` and move it to `migration_test.go`. - * Return: - _`keyring.Record, error` in `SaveOfflineKey`, `SaveLedgerKey`, `SaveMultiSig`, `Key` and `KeyByAddress`. - _`keyring.Record` instead of `Info` in `NewMnemonic` and `List`. - * Remove `algo` argument from : - * `SaveOfflineKey` - * Take `keyring.Record` instead of `Info` as first argument in: - * `MkConsKeyOutput` - * `MkValKeyOutput` - * `MkAccKeyOutput` -* [#10022](https://github.com/cosmos/cosmos-sdk/pull/10022) `AuthKeeper` interface in `x/auth` now includes a function `HasAccount`. -* [#9759](https://github.com/cosmos/cosmos-sdk/pull/9759) `NewAccountKeeeper` in `x/auth` now takes an additional `bech32Prefix` argument that represents `sdk.Bech32MainPrefix`. -* [#9628](https://github.com/cosmos/cosmos-sdk/pull/9628) Rename `x/{mod}/legacy` to `x/{mod}/migrations`. -* [#9571](https://github.com/cosmos/cosmos-sdk/pull/9571) Implemented error handling for staking hooks, which now return an error on failure. -* [#9427](https://github.com/cosmos/cosmos-sdk/pull/9427) Move simapp `FundAccount` and `FundModuleAccount` to `x/bank/testutil` -* (client/tx) [#9421](https://github.com/cosmos/cosmos-sdk/pull/9421/) `BuildUnsignedTx`, `BuildSimTx`, `PrintUnsignedStdTx` functions are moved to - the Tx Factory as methods. -* (client/keys) [#9601](https://github.com/cosmos/cosmos-sdk/pull/9601) Added `keys rename` CLI command and `Keyring.Rename` interface method to rename a key in the keyring. -* (x/slashing) [#9458](https://github.com/cosmos/cosmos-sdk/pull/9458) Coins burned from slashing is now returned from Slash function and included in Slash event. -* [#9246](https://github.com/cosmos/cosmos-sdk/pull/9246) The `New` method for the network package now returns an error. -* [#9519](https://github.com/cosmos/cosmos-sdk/pull/9519) `DeleteDeposits` renamed to `DeleteAndBurnDeposits`, `RefundDeposits` renamed to `RefundAndDeleteDeposits` -* (codec) [#9521](https://github.com/cosmos/cosmos-sdk/pull/9521) Removed deprecated `clientCtx.JSONCodec` from `client.Context`. -* (codec) [#9521](https://github.com/cosmos/cosmos-sdk/pull/9521) Rename `EncodingConfig.Marshaler` to `Codec`. -* [#9594](https://github.com/cosmos/cosmos-sdk/pull/9594) `RESTHandlerFn` argument is removed from the `gov/NewProposalHandler`. -* [#9594](https://github.com/cosmos/cosmos-sdk/pull/9594) `types/rest` package moved to `testutil/rest`. -* [#9432](https://github.com/cosmos/cosmos-sdk/pull/9432) `ConsensusParamsKeyTable` moved from `params/keeper` to `params/types` -* [#9576](https://github.com/cosmos/cosmos-sdk/pull/9576) Add debug error message to `sdkerrors.QueryResult` when enabled -* [#9650](https://github.com/cosmos/cosmos-sdk/pull/9650) Removed deprecated message handler implementation from the SDK modules. -* [#10248](https://github.com/cosmos/cosmos-sdk/pull/10248) Remove unused `KeyPowerReduction` variable from x/staking types. -* (x/bank) [#9832](https://github.com/cosmos/cosmos-sdk/pull/9832) `AddressFromBalancesStore` renamed to `AddressAndDenomFromBalancesStore`. -* (tests) [#9938](https://github.com/cosmos/cosmos-sdk/pull/9938) `simapp.Setup` accepts additional `testing.T` argument. -* (baseapp) [#11979](https://github.com/cosmos/cosmos-sdk/pull/11979) Rename baseapp simulation helper methods `baseapp.{Check,Deliver}` to `baseapp.Sim{Check,Deliver}`. -* (x/gov) [#10373](https://github.com/cosmos/cosmos-sdk/pull/10373) Removed gov `keeper.{MustMarshal, MustUnmarshal}`. -* [#10348](https://github.com/cosmos/cosmos-sdk/pull/10348) StdSignBytes takes a new argument of type `*tx.Tip` for signing over tips using LEGACY_AMINO_JSON. -* [#10208](https://github.com/cosmos/cosmos-sdk/pull/10208) The `x/auth/signing.Tx` interface now also includes a new `GetTip() *tx.Tip` method for verifying tipped transactions. The `x/auth/types` expected BankKeeper interface now expects the `SendCoins` method too. -* [#10612](https://github.com/cosmos/cosmos-sdk/pull/10612) `baseapp.NewBaseApp` constructor function doesn't take the `sdk.TxDecoder` anymore. This logic has been moved into the TxDecoderMiddleware. -* [#10692](https://github.com/cosmos/cosmos-sdk/pull/10612) `SignerData` takes 2 new fields, `Address` and `PubKey`, which need to get populated when using SIGN_MODE_DIRECT_AUX. -* [#10748](https://github.com/cosmos/cosmos-sdk/pull/10748) Move legacy `x/gov` api to `v1beta1` directory. -* [#10816](https://github.com/cosmos/cosmos-sdk/pull/10816) Reuse blocked addresses from the bank module. No need to pass them to distribution. -* [#10852](https://github.com/cosmos/cosmos-sdk/pull/10852) Move `x/gov/types` to `x/gov/types/v1beta2`. -* [#10922](https://github.com/cosmos/cosmos-sdk/pull/10922), [/#10957](https://github.com/cosmos/cosmos-sdk/pull/10957) Move key `server.Generate*` functions to testutil and support custom mnemonics in in-process testing network. Moved `TestMnemonic` from `testutil` package to `testdata`. -* (x/bank) [#10771](https://github.com/cosmos/cosmos-sdk/pull/10771) Add safety check on bank module perms to allow module-specific mint restrictions (e.g. only minting a certain denom). -* (x/bank) [#10771](https://github.com/cosmos/cosmos-sdk/pull/10771) Add `bank.BaseKeeper.WithMintCoinsRestriction` function to restrict use of bank `MintCoins` usage. -* [#10868](https://github.com/cosmos/cosmos-sdk/pull/10868), [#10989](https://github.com/cosmos/cosmos-sdk/pull/10989) The Gov keeper accepts now 2 more mandatory arguments, the ServiceMsgRouter and a maximum proposal metadata length. -* [#10868](https://github.com/cosmos/cosmos-sdk/pull/10868), [#10989](https://github.com/cosmos/cosmos-sdk/pull/10989), [#11093](https://github.com/cosmos/cosmos-sdk/pull/11093) The Gov keeper accepts now 2 more mandatory arguments, the ServiceMsgRouter and a gov Config including the max metadata length. -* [#11124](https://github.com/cosmos/cosmos-sdk/pull/11124) Add `GetAllVersions` to application store -* (x/authz) [#10447](https://github.com/cosmos/cosmos-sdk/pull/10447) authz `NewGrant` takes a new argument: block time, to correctly validate expire time. -* [#10961](https://github.com/cosmos/cosmos-sdk/pull/10961) Support third-party modules to add extension snapshots to state-sync. -* [#11274](https://github.com/cosmos/cosmos-sdk/pull/11274) `types/errors.New` now is an alias for `types/errors.Register` and should only be used in initialization code. -* (authz)[#11060](https://github.com/cosmos/cosmos-sdk/pull/11060) `authz.NewMsgGrant` `expiration` is now a pointer. When `nil` is used then no expiration will be set (grant won't expire). -* (x/distribution)[#11457](https://github.com/cosmos/cosmos-sdk/pull/11457) Add amount field to `distr.MsgWithdrawDelegatorRewardResponse` and `distr.MsgWithdrawValidatorCommissionResponse`. -* [#11334](https://github.com/cosmos/cosmos-sdk/pull/11334) Move `x/gov/types/v1beta2` to `x/gov/types/v1`. -* (x/auth/middleware) [#11413](https://github.com/cosmos/cosmos-sdk/pull/11413) Refactor tx middleware to be extensible on tx fee logic. Merged `MempoolFeeMiddleware` and `TxPriorityMiddleware` functionalities into `DeductFeeMiddleware`, make the logic extensible using the `TxFeeChecker` option, the current fee logic is preserved by the default `checkTxFeeWithValidatorMinGasPrices` implementation. Change `RejectExtensionOptionsMiddleware` to `NewExtensionOptionsMiddleware` which is extensible with the `ExtensionOptionChecker` option. Unpack the tx extension options `Any`s to interface `TxExtensionOptionI`. -* (migrations) [#11556](https://github.com/cosmos/cosmos-sdk/pull/11556#issuecomment-1091385011) Remove migration code from 0.42 and below. To use previous migrations, checkout previous versions of the cosmos-sdk. - -### Client Breaking Changes - -* [#11797](https://github.com/cosmos/cosmos-sdk/pull/11797) Remove all RegisterRESTRoutes (previously deprecated) -* [#11089](https://github.com/cosmos/cosmos-sdk/pull/11089) interacting with the node through `grpc.Dial` requires clients to pass a codec refer to [doc](docs/docs/run-node/02-interact-node.md). -* [#9594](https://github.com/cosmos/cosmos-sdk/pull/9594) Remove legacy REST API. Please see the [REST Endpoints Migration guide](https://docs.cosmos.network/v0.45/migrations/rest.html) to migrate to the new REST endpoints. -* [#9995](https://github.com/cosmos/cosmos-sdk/pull/9995) Increased gas cost for creating proposals. -* [#11029](https://github.com/cosmos/cosmos-sdk/pull/11029) The deprecated Vote Option field is removed in gov v1beta2 and nil in v1beta1. Use Options instead. -* [#11013](https://github.com/cosmos/cosmos-sdk/pull/11013) The `tx gov submit-proposal` command has changed syntax to support the new Msg-based gov proposals. To access the old CLI command, please use `tx gov submit-legacy-proposal`. -* [#11170](https://github.com/cosmos/cosmos-sdk/issues/11170) Fixes issue related to grpc-gateway of supply by ibc-denom. - -### CLI Breaking Changes - -* (cli) [#11818](https://github.com/cosmos/cosmos-sdk/pull/11818) CLI transactions preview now respect the chosen `--output` flag format (json or text). -* [#9695](https://github.com/cosmos/cosmos-sdk/pull/9695) ` keys migrate` CLI command now takes no arguments. -* [#9246](https://github.com/cosmos/cosmos-sdk/pull/9246) Removed the CLI flag `--setup-config-only` from the `testnet` command and added the subcommand `init-files`. -* [#9780](https://github.com/cosmos/cosmos-sdk/pull/9780) Use sigs.k8s.io for yaml, which might lead to minor YAML output changes -* [#10625](https://github.com/cosmos/cosmos-sdk/pull/10625) Rename `--fee-account` CLI flag to `--fee-granter` -* [#10684](https://github.com/cosmos/cosmos-sdk/pull/10684) Rename `edit-validator` command's `--moniker` flag to `--new-moniker` -* (authz)[#11060](https://github.com/cosmos/cosmos-sdk/pull/11060) Changed the default value of the `--expiration` `tx grant` CLI Flag: was now + 1year, update: null (no expire date). - -### Improvements - -* (types) [#12201](https://github.com/cosmos/cosmos-sdk/pull/12201) Add `MustAccAddressFromBech32` util function -* [#11696](https://github.com/cosmos/cosmos-sdk/pull/11696) Rename `helpers.GenTx` to `GenSignedMockTx` to avoid confusion with genutil's `GenTxCmd`. -* (x/auth/vesting) [#11652](https://github.com/cosmos/cosmos-sdk/pull/11652) Add util functions for `Period(s)` -* [#11630](https://github.com/cosmos/cosmos-sdk/pull/11630) Add SafeSub method to sdk.Coin. -* [#11511](https://github.com/cosmos/cosmos-sdk/pull/11511) Add api server flags to start command. -* [#11484](https://github.com/cosmos/cosmos-sdk/pull/11484) Implement getter for keyring backend option. -* [#11449](https://github.com/cosmos/cosmos-sdk/pull/11449) Improved error messages when node isn't synced. -* [#11349](https://github.com/cosmos/cosmos-sdk/pull/11349) Add `RegisterAminoMsg` function that checks that a msg name is <40 chars (else this would break ledger nano signing) then registers the concrete msg type with amino, it should be used for registering `sdk.Msg`s with amino instead of `cdc.RegisterConcrete`. -* [#11089](https://github.com/cosmos/cosmos-sdk/pull/11089]) Now cosmos-sdk consumers can upgrade gRPC to its newest versions. -* [#10439](https://github.com/cosmos/cosmos-sdk/pull/10439) Check error for `RegisterQueryHandlerClient` in all modules `RegisterGRPCGatewayRoutes`. -* [#9780](https://github.com/cosmos/cosmos-sdk/pull/9780) Remove gogoproto `moretags` YAML annotations and add `sigs.k8s.io/yaml` for YAML marshalling. -* (x/bank) [#10134](https://github.com/cosmos/cosmos-sdk/pull/10134) Add `HasDenomMetadata` function to bank `Keeper` to check if a client coin denom metadata exists in state. -* (x/bank) [#10022](https://github.com/cosmos/cosmos-sdk/pull/10022) `BankKeeper.SendCoins` now takes less execution time. -* (deps) [#9987](https://github.com/cosmos/cosmos-sdk/pull/9987) Bump Go version minimum requirement to `1.17` -* (cli) [#9856](https://github.com/cosmos/cosmos-sdk/pull/9856) Overwrite `--sequence` and `--account-number` flags with default flag values when used with `offline=false` in `sign-batch` command. -* (rosetta) [#10001](https://github.com/cosmos/cosmos-sdk/issues/10001) Add documentation for rosetta-cli dockerfile and rename folder for the rosetta-ci dockerfile -* [#9699](https://github.com/cosmos/cosmos-sdk/pull/9699) Add `:`, `.`, `-`, and `_` as allowed characters in the default denom regular expression. -* (genesis) [#9697](https://github.com/cosmos/cosmos-sdk/pull/9697) Ensure `InitGenesis` returns with non-empty validator set. -* [#10468](https://github.com/cosmos/cosmos-sdk/pull/10468) Allow futureOps to queue additional operations in simulations -* [#10625](https://github.com/cosmos/cosmos-sdk/pull/10625) Add `--fee-payer` CLI flag -* (cli) [#10683](https://github.com/cosmos/cosmos-sdk/pull/10683) In CLI, allow 1 SIGN_MODE_DIRECT signer in transactions with multiple signers. -* (deps) [#10706](https://github.com/cosmos/cosmos-sdk/issues/10706) Bump rosetta-sdk-go to v0.7.2 and rosetta-cli to v0.7.3 -* (types/errors) [#10779](https://github.com/cosmos/cosmos-sdk/pull/10779) Move most functionality in `types/errors` to a standalone `errors` go module, except the `RootCodespace` errors and ABCI response helpers. All functions and types that used to live in `types/errors` are now aliased so this is not a breaking change. -* (gov) [#10854](https://github.com/cosmos/cosmos-sdk/pull/10854) v1beta2's vote doesn't include the deprecate `option VoteOption` anymore. Instead, it only uses `WeightedVoteOption`. -* (types) [#11004](https://github.com/cosmos/cosmos-sdk/pull/11004) Added mutable versions of many of the sdk.Dec types operations. This improves performance when used by avoiding reallocating a new bigint for each operation. -* (x/auth) [#10880](https://github.com/cosmos/cosmos-sdk/pull/10880) Added a new query to the tx query service that returns a block with transactions fully decoded. -* (types) [#11200](https://github.com/cosmos/cosmos-sdk/pull/11200) Added `Min()` and `Max()` operations on sdk.Coins. -* (gov) [#11287](https://github.com/cosmos/cosmos-sdk/pull/11287) Fix error message when no flags are provided while executing `submit-legacy-proposal` transaction. -* (x/auth) [#11482](https://github.com/cosmos/cosmos-sdk/pull/11482) Improve panic message when attempting to register a method handler for a message that does not implement sdk.Msg -* (x/staking) [#11596](https://github.com/cosmos/cosmos-sdk/pull/11596) Add (re)delegation getters -* (errors) [#11960](https://github.com/cosmos/cosmos-sdk/pull/11960) Removed 'redacted' error message from defaultErrEncoder -* (ante) [#12013](https://github.com/cosmos/cosmos-sdk/pull/12013) Index ante events for failed tx. -* [#12668](https://github.com/cosmos/cosmos-sdk/pull/12668) Add `authz_msg_index` event attribute to message events emitted when executing via `MsgExec` through `x/authz`. -* [#12626](https://github.com/cosmos/cosmos-sdk/pull/12626) Upgrade IAVL to v0.19.0 with fast index and error propagation. NOTE: first start will take a while to propagate into new model. -* [#12576](https://github.com/cosmos/cosmos-sdk/pull/12576) Remove dependency on cosmos/keyring and upgrade to 99designs/keyring v1.2.1 -* [#12590](https://github.com/cosmos/cosmos-sdk/pull/12590) Allow zero gas in simulation mode. -* [#12453](https://github.com/cosmos/cosmos-sdk/pull/12453) Add `NewInMemoryWithKeyring` function which allows the creation of in memory `keystore` instances with a specified set of existing items. -* [#11390](https://github.com/cosmos/cosmos-sdk/pull/11390) `LatestBlockResponse` & `BlockByHeightResponse` types' `Block` filed has been deprecated and they now contains new field `sdk_block` with `proposer_address` as `string` -* [#12089](https://github.com/cosmos/cosmos-sdk/pull/12089) Mark the `TipDecorator` as beta, don't include it in simapp by default. -* [#12153](https://github.com/cosmos/cosmos-sdk/pull/12153) Add a new `NewSimulationManagerFromAppModules` constructor, to simplify simulation wiring. - -### Bug Fixes - -* [#11969](https://github.com/cosmos/cosmos-sdk/pull/11969) Fix the panic error in `x/upgrade` when `AppVersion` is not set. -* (tests) [#11940](https://github.com/cosmos/cosmos-sdk/pull/11940) Fix some client tests in the `x/gov` module -* [#11772](https://github.com/cosmos/cosmos-sdk/pull/11772) Limit types.Dec length to avoid overflow. -* [#11724](https://github.com/cosmos/cosmos-sdk/pull/11724) Fix data race issues with api.Server -* [#11693](https://github.com/cosmos/cosmos-sdk/pull/11693) Add validation for gentx cmd. -* [#11645](https://github.com/cosmos/cosmos-sdk/pull/11645) Fix `--home` flag ignored when running help. -* [#11558](https://github.com/cosmos/cosmos-sdk/pull/11558) Fix `--dry-run` not working when using tx command. -* [#11354](https://github.com/cosmos/cosmos-sdk/pull/11355) Added missing pagination flag for `bank q total` query. -* [#11197](https://github.com/cosmos/cosmos-sdk/pull/11197) Signing with multisig now works with multisig address which is not in the keyring. -* (makefile) [#11285](https://github.com/cosmos/cosmos-sdk/pull/11285) Fix lint-fix make target. -* (client) [#11283](https://github.com/cosmos/cosmos-sdk/issues/11283) Support multiple keys for tx simulation and setting automatic gas for txs. -* (store) [#11177](https://github.com/cosmos/cosmos-sdk/pull/11177) Update the prune `everything` strategy to store the last two heights. -* [#10844](https://github.com/cosmos/cosmos-sdk/pull/10844) Automatic recovering non-consistent keyring storage during public key import. -* (store) [#11117](https://github.com/cosmos/cosmos-sdk/pull/11117) Fix data race in store trace component -* (cli) [#11065](https://github.com/cosmos/cosmos-sdk/pull/11065) Ensure the `tendermint-validator-set` query command respects the `-o` output flag. -* (grpc) [#10985](https://github.com/cosmos/cosmos-sdk/pull/10992) The `/cosmos/tx/v1beta1/txs/{hash}` endpoint returns a 404 when a tx does not exist. -* (rosetta) [#10340](https://github.com/cosmos/cosmos-sdk/pull/10340) Use `GenesisChunked(ctx)` instead `Genesis(ctx)` to get genesis block height -* [#9651](https://github.com/cosmos/cosmos-sdk/pull/9651) Change inconsistent limit of `0` to `MaxUint64` on InfiniteGasMeter and add GasRemaining func to GasMeter. -* [#9639](https://github.com/cosmos/cosmos-sdk/pull/9639) Check store keys length before accessing them by making sure that `key` is of length `m+1` (for `key[n:m]`) -* (types) [#9627](https://github.com/cosmos/cosmos-sdk/pull/9627) Fix nil pointer panic on `NewBigIntFromInt` -* (x/genutil) [#9574](https://github.com/cosmos/cosmos-sdk/pull/9575) Actually use the `gentx` client tx flags (like `--keyring-dir`) -* (x/distribution) [#9599](https://github.com/cosmos/cosmos-sdk/pull/9599) Withdraw rewards event now includes a value attribute even if there are 0 rewards (due to situations like 100% commission). -* (x/genutil) [#9638](https://github.com/cosmos/cosmos-sdk/pull/9638) Added missing validator key save when recovering from mnemonic -* [#9762](https://github.com/cosmos/cosmos-sdk/pull/9762) The init command uses the chain-id from the client config if --chain-id is not provided -* [#9980](https://github.com/cosmos/cosmos-sdk/pull/9980) Returning the error when the invalid argument is passed to bank query total supply cli. -* (server) [#10016](https://github.com/cosmos/cosmos-sdk/issues/10016) Fix marshaling of index-events into server config file. -* [#10184](https://github.com/cosmos/cosmos-sdk/pull/10184) Fixed CLI tx commands to no longer explicitly require the chain-id flag as this value can come from a user config. -* (x/upgrade) [#10189](https://github.com/cosmos/cosmos-sdk/issues/10189) Removed potential sources of non-determinism in upgrades -* [#10258](https://github.com/cosmos/cosmos-sdk/issues/10258) Fixes issue related to segmentation fault on mac m1 arm64 -* [#10466](https://github.com/cosmos/cosmos-sdk/issues/10466) Fixes error with simulation tests when genesis start time is randomly created after the year 2262 -* [#10394](https://github.com/cosmos/cosmos-sdk/issues/10394) Fixes issue related to grpc-gateway of account balance by - ibc-denom. -* [#10842](https://github.com/cosmos/cosmos-sdk/pull/10842) Fix error when `--generate-only`, `--max-msgs` fags set while executing `WithdrawAllRewards` command. -* [#10897](https://github.com/cosmos/cosmos-sdk/pull/10897) Fix: set a non-zero value on gas overflow. -* [#9790](https://github.com/cosmos/cosmos-sdk/pull/10687) Fix behavior of `DecCoins.MulDecTruncate`. -* [#10990](https://github.com/cosmos/cosmos-sdk/pull/10990) Fixes missing `iavl-cache-size` config parsing in `GetConfig` method. -* (x/authz) [#10447](https://github.com/cosmos/cosmos-sdk/pull/10447) Fix authz `NewGrant` expiration check. -* (x/authz) [#10633](https://github.com/cosmos/cosmos-sdk/pull/10633) Fixed authorization not found error when executing message. -* [#11222](https://github.com/cosmos/cosmos-sdk/pull/11222) reject query with block height in the future -* [#11229](https://github.com/cosmos/cosmos-sdk/pull/11229) Handled the error message of `transaction encountered error` from tendermint. -* (x/authz) [#11252](https://github.com/cosmos/cosmos-sdk/pull/11252) Allow insufficient funds error for authz simulation -* (cli) [#11313](https://github.com/cosmos/cosmos-sdk/pull/11313) Fixes `--gas auto` when executing CLI transactions in `--generate-only` mode -* (cli) [#11337](https://github.com/cosmos/cosmos-sdk/pull/11337) Fixes `show-adress` cli cmd -* (crypto) [#11298](https://github.com/cosmos/cosmos-sdk/pull/11298) Fix cgo secp signature verification and update libscep256k1 library. -* (x/authz) [#11512](https://github.com/cosmos/cosmos-sdk/pull/11512) Fix response of a panic to error, when subtracting balances. -* (rosetta) [#11590](https://github.com/cosmos/cosmos-sdk/pull/11590) `/block` returns an error with nil pointer when a request has both of index and hash and increase timeout for huge genesis. -* (x/feegrant) [#11813](https://github.com/cosmos/cosmos-sdk/pull/11813) Fix pagination total count in `AllowancesByGranter` query. -* (simapp) [#11855](https://github.com/cosmos/cosmos-sdk/pull/11855) Use `sdkmath.Int` instead of `int64` for `SimulationState.InitialStake`. -* (x/capability) [#11737](https://github.com/cosmos/cosmos-sdk/pull/11737) Use a fixed length encoding of `Capability` pointer for `FwdCapabilityKey` -* [#11983](https://github.com/cosmos/cosmos-sdk/pull/11983) (x/feegrant, x/authz) rename grants query commands to `grants-by-grantee`, `grants-by-granter` cmds. -* (testutil/sims) [#12374](https://github.com/cosmos/cosmos-sdk/pull/12374) fix the non-determinstic behavior in simulations caused by `GenSignedMockTx` and check empty coins slice before it is used to create `banktype.MsgSend`. -* [#12448](https://github.com/cosmos/cosmos-sdk/pull/12448) Start telemetry independently from the API server. -* [#12509](https://github.com/cosmos/cosmos-sdk/pull/12509) Fix `Register{Tx,Tendermint}Service` not being called, resulting in some endpoints like the Simulate endpoint not working. -* [#12416](https://github.com/cosmos/cosmos-sdk/pull/12416) Prevent zero gas transactions in the `DeductFeeDecorator` AnteHandler decorator. -* (x/mint) [#12384](https://github.com/cosmos/cosmos-sdk/pull/12384) Ensure `GoalBonded` must be positive when performing `x/mint` parameter validation. -* (x/auth) [#12261](https://github.com/cosmos/cosmos-sdk/pull/12261) Deprecate pagination in GetTxsEventRequest/Response in favor of page and limit to align with tendermint `SignClient.TxSearch` -* (vesting) [#12190](https://github.com/cosmos/cosmos-sdk/pull/12190) Replace https://github.com/cosmos/cosmos-sdk/pull/12190 to use `NewBaseAccountWithAddress` in all vesting account message handlers. -* (linting) [#12132](https://github.com/cosmos/cosmos-sdk/pull/12132) Change sdk.Int to math.Int -* (cli) [#12127](https://github.com/cosmos/cosmos-sdk/pull/12127) Fix the CLI not always taking into account `--fee-payer` and `--fee-granter` flags. -* (migrations) [#12028](https://github.com/cosmos/cosmos-sdk/pull/12028) Fix v0.45->v0.46 in-place store migrations. -* (baseapp) [#12089](https://github.com/cosmos/cosmos-sdk/pull/12089) Include antehandler and runMsgs events in SimulateTx. -* (cli) [#12095](https://github.com/cosmos/cosmos-sdk/pull/12095) Fix running a tx with --dry-run returns an error -* (x/auth) [#12108](https://github.com/cosmos/cosmos-sdk/pull/12108) Fix GetBlockWithTxs error when querying block with 0 tx -* (genutil) [#12140](https://github.com/cosmos/cosmos-sdk/pull/12140) Fix staking's genesis JSON migrate in the `simd migrate v0.46` CLI command. -* (types) [#12154](https://github.com/cosmos/cosmos-sdk/pull/12154) Add `baseAccountGetter` to avoid invalid account error when create vesting account. -* (x/crisis) [#12208](https://github.com/cosmos/cosmos-sdk/pull/12208) Fix progress index of crisis invariant assertion logs. -* (types) [#12229](https://github.com/cosmos/cosmos-sdk/pull/12229) Increase sdk.Dec maxApproxRootIterations to 300 - -### State Machine Breaking - -* (x/gov) [#13576](https://github.com/cosmos/cosmos-sdk/pull/13576) Proposals in voting period are tracked in a separate store. -* (baseapp) [#11985](https://github.com/cosmos/cosmos-sdk/pull/11985) Add a `postHandler` to baseapp. This `postHandler` is like antehandler, but is run *after* the `runMsgs` execution. It is in the same store branch that `runMsgs`, meaning that both `runMsgs` and `postHandler` -* (x/gov) [#11998](https://github.com/cosmos/cosmos-sdk/pull/11998) Tweak the `x/gov` `ModuleAccountInvariant` invariant to ensure deposits are `<=` total module account balance instead of strictly equal. -* (x/upgrade) [#11800](https://github.com/cosmos/cosmos-sdk/pull/11800) Fix `GetLastCompleteUpgrade` to properly return the latest upgrade. -* [#10564](https://github.com/cosmos/cosmos-sdk/pull/10564) Fix bug when updating allowance inside AllowedMsgAllowance -* (x/auth)[#9596](https://github.com/cosmos/cosmos-sdk/pull/9596) Enable creating periodic vesting accounts with a transactions instead of requiring them to be created in genesis. -* (x/bank) [#9611](https://github.com/cosmos/cosmos-sdk/pull/9611) Introduce a new index to act as a reverse index between a denomination and address allowing to query for token holders of a specific denomination. `DenomOwners` is updated to use the new reverse index. -* (x/bank) [#9832](https://github.com/cosmos/cosmos-sdk/pull/9832) Account balance is stored as `sdk.Int` rather than `sdk.Coin`. -* (x/bank) [#9890](https://github.com/cosmos/cosmos-sdk/pull/9890) Remove duplicate denom from denom metadata key. -* (x/upgrade) [#10189](https://github.com/cosmos/cosmos-sdk/issues/10189) Removed potential sources of non-determinism in upgrades -* [#10422](https://github.com/cosmos/cosmos-sdk/pull/10422) and [#10529](https://github.com/cosmos/cosmos-sdk/pull/10529) Add `MinCommissionRate` param to `x/staking` module. -* (x/gov) [#10763](https://github.com/cosmos/cosmos-sdk/pull/10763) modify the fields in `TallyParams` to use `string` instead of `bytes` -* [#10770](https://github.com/cosmos/cosmos-sdk/pull/10770) revert tx when block gas limit exceeded -* (x/gov) [#10868](https://github.com/cosmos/cosmos-sdk/pull/10868) Bump gov to v1. Both v1beta1 and v1beta2 queries and Msgs are accepted. -* [#11011](https://github.com/cosmos/cosmos-sdk/pull/11011) Remove burning of deposits when qourum is not reached on a governance proposal and when the deposit is not fully met. -* [#11019](https://github.com/cosmos/cosmos-sdk/pull/11019) Add `MsgCreatePermanentLockedAccount` and CLI method for creating permanent locked account -* (x/staking) [#10885] (https://github.com/cosmos/cosmos-sdk/pull/10885) Add new `CancelUnbondingDelegation` - transaction to `x/staking` module. Delegators can now cancel unbonding delegation entry and delegate back to validator. -* (x/feegrant) [#10830](https://github.com/cosmos/cosmos-sdk/pull/10830) Expired allowances will be pruned from state. -* (x/authz,x/feegrant) [#11214](https://github.com/cosmos/cosmos-sdk/pull/11214) Fix Amino JSON encoding of authz and feegrant Msgs to be consistent with other modules. -* (authz)[#11060](https://github.com/cosmos/cosmos-sdk/pull/11060) Support grant with no expire time. - -### Deprecated - -* (x/upgrade) [#9906](https://github.com/cosmos/cosmos-sdk/pull/9906) Deprecate `UpgradeConsensusState` gRPC query since this functionality is only used for IBC, which now has its own [IBC replacement](https://github.com/cosmos/ibc-go/blob/2c880a22e9f9cc75f62b527ca94aa75ce1106001/proto/ibc/core/client/v1/query.proto#L54) -* (types) [#10948](https://github.com/cosmos/cosmos-sdk/issues/10948) Deprecate the types.DBBackend variable and types.NewLevelDB function. They are replaced by a new entry in `app.toml`: `app-db-backend` and `tendermint/tm-db`s `NewDB` function. If `app-db-backend` is defined, then it is used. Otherwise, if `types.DBBackend` is defined, it is used (until removed: [#11241](https://github.com/cosmos/cosmos-sdk/issues/11241)). Otherwise, Tendermint config's `db-backend` is used. - -## [v0.45.16](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.16) - 2023-05-11 - -### Security Bug Fixes - -* (x/feegrant) [#16097](https://github.com/cosmos/cosmos-sdk/pull/16097) Fix infinite feegrant allowance bug. - -## [v0.45.15](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.15) - 2023-03-22 - -### Improvements - -* (deps) Migrate to [CometBFT](https://github.com/cometbft/cometbft). Follow the instructions in the [release notes](./RELEASE_NOTES.md). -* (deps) [#15127](https://github.com/cosmos/cosmos-sdk/pull/15127) Bump btcd. -* (store) [#14410](https://github.com/cosmos/cosmos-sdk/pull/14410) `rootmulti.Store.loadVersion` has validation to check if all the module stores' height is correct, it will error if any module store has incorrect height. - -## [v0.45.14](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.14) - 2023-02-16 - -### Features - -* [#14583](https://github.com/cosmos/cosmos-sdk/pull/14583) Add support for Core API. - -## v0.45.13 - 2023-02-08 - -### Improvements - -* (deps) Bump Tendermint version to [v0.34.26](https://github.com/informalsystems/tendermint/releases/tag/v0.34.26). - -### Bug Fixes - -* (store) [#14798](https://github.com/cosmos/cosmos-sdk/pull/14798) Copy btree to avoid the problem of modify while iteration. - -## v0.45.12 - 2023-01-23 - -### Improvements - -* [#13881](https://github.com/cosmos/cosmos-sdk/pull/13881) Optimize iteration on nested cached KV stores and other operations in general. -* (store) [#11646](https://github.com/cosmos/cosmos-sdk/pull/11646) Add store name in tracekv-emitted store traces -* (deps) Bump Tendermint version to [v0.34.24](https://github.com/tendermint/tendermint/releases/tag/v0.34.24) and use Informal Systems fork. - -### API Breaking Changes - -* (store) [#13516](https://github.com/cosmos/cosmos-sdk/pull/13516) Update State Streaming APIs: - * Add method `ListenCommit` to `ABCIListener` - * Move `ListeningEnabled` and `AddListener` methods to `CommitMultiStore` - * Remove `CacheWrapWithListeners` from `CacheWrap` and `CacheWrapper` interfaces - * Remove listening APIs from the caching layer (it should only listen to the `rootmulti.Store`) - * Add three new options to file streaming service constructor. - * Modify `ABCIListener` such that any error from any method will always halt the app via `panic` - -### Bug Fixes - -* (store) [#12945](https://github.com/cosmos/cosmos-sdk/pull/12945) Fix nil end semantics in store/cachekv/iterator when iterating a dirty cache. -* (store) [#13516](https://github.com/cosmos/cosmos-sdk/pull/13516) Fix state listener that was observing writes at wrong time. - -## v0.45.11 - 2022-11-09 - -### Improvements - -* [#13896](https://github.com/cosmos/cosmos-sdk/pull/13896) Queries on pruned height returns error instead of empty values. -* (deps) Bump Tendermint version to [v0.34.23](https://github.com/tendermint/tendermint/releases/tag/v0.34.23). -* (deps) Bump IAVL version to [v0.19.4](https://github.com/cosmos/iavl/releases/tag/v0.19.4). - -### Bug Fixes - -* [#13673](https://github.com/cosmos/cosmos-sdk/pull/13673) Fix `--dry-run` flag not working when using tx command. - -### CLI Breaking Changes - -* [#13656](https://github.com/cosmos/cosmos-sdk/pull/13660) Rename `server.FlagIAVLFastNode` to `server.FlagDisableIAVLFastNode` for clarity. - -### API Breaking Changes - -* [#13673](https://github.com/cosmos/cosmos-sdk/pull/13673) The `GetFromFields` function now takes `Context` as an argument and removes `genOnly`. - -## [v0.45.10](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.10) - 2022-10-24 - -### Features - -* (grpc) [#13485](https://github.com/cosmos/cosmos-sdk/pull/13485) Implement a new gRPC query, `/cosmos/base/node/v1beta1/config`, which provides operator configuration. Applications that wish to expose operator minimum gas prices via gRPC should have their application implement the `ApplicationQueryService` interface (see `SimApp#RegisterNodeService` as an example). -* [#13557](https://github.com/cosmos/cosmos-sdk/pull/#13557) - Add `GenSignedMockTx`. This can be used as workaround for #12437 revertion. `v0.46+` contains as well a `GenSignedMockTx` that behaves the same way. -* (x/auth) [#13612](https://github.com/cosmos/cosmos-sdk/pull/13612) Add `Query/ModuleAccountByName` endpoint for accessing the module account info by module name. - -### Improvements - -* [#13585](https://github.com/cosmos/cosmos-sdk/pull/13585) Bump Tendermint to `v0.34.22`. - -### Bug Fixes - -* [#13588](https://github.com/cosmos/cosmos-sdk/pull/13588) Fix regression in distrubtion.WithdrawDelegationRewards when rewards are zero. -* [#13564](https://github.com/cosmos/cosmos-sdk/pull/13564) - Fix `make proto-gen`. -* (server) [#13610](https://github.com/cosmos/cosmos-sdk/pull/13610) Read the pruning-keep-every field again. - -## [v0.45.9](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.9) - 2022-10-14 - -ATTENTION: - -This is a security release for the [Dragonberry security advisory](https://forum.cosmos.network/t/ibc-security-advisory-dragonberry/7702). - -All users should upgrade immediately. - -Users *must* add a replace directive in their go.mod for the new `ics23` package in the SDK: - -```go -replace github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 -``` - -### Features - -* [#13435](https://github.com/cosmos/cosmos-sdk/pull/13435) Extend error context when a simulation fails. - -### Improvements - -* [#13369](https://github.com/cosmos/cosmos-sdk/pull/13369) Improve UX for `keyring.List` by returning all retrieved keys. -* [#13323](https://github.com/cosmos/cosmos-sdk/pull/13323) Ensure `withdraw_rewards` rewards are emitted from all actions that result in rewards being withdrawn. -* [#13321](https://github.com/cosmos/cosmos-sdk/pull/13321) Add flag to disable fast node migration and usage. -* (store) [#13326](https://github.com/cosmos/cosmos-sdk/pull/13326) Implementation of ADR-038 file StreamingService, backport #8664. -* (store) [#13540](https://github.com/cosmos/cosmos-sdk/pull/13540) Default fastnode migration to false to prevent suprises. Operators must enable it, unless they have it enabled already. - -### API Breaking Changes - -* (cli) [#13089](https://github.com/cosmos/cosmos-sdk/pull/13089) Fix rollback command don't actually delete multistore versions, added method `RollbackToVersion` to interface `CommitMultiStore` and added method `CommitMultiStore` to `Application` interface. - -### Bug Fixes - -* Implement dragonberry security patch. - * For applying the patch please refer to the [RELEASE NOTES](./RELEASE_NOTES.md) -* (store) [#13459](https://github.com/cosmos/cosmos-sdk/pull/13459) Don't let state listener observe the uncommitted writes. - -### Notes - -Reverted #12437 due to API breaking changes. - -## [v0.45.8](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.8) - 2022-08-25 - -### Improvements - -* [#12981](https://github.com/cosmos/cosmos-sdk/pull/12981) Return proper error when parsing telemetry configuration. -* [#12885](https://github.com/cosmos/cosmos-sdk/pull/12885) Amortize cost of processing cache KV store. -* [#12970](https://github.com/cosmos/cosmos-sdk/pull/12970) Bump Tendermint to `v0.34.21` and IAVL to `v0.19.1`. -* [#12693](https://github.com/cosmos/cosmos-sdk/pull/12693) Make sure the order of each node is consistent when emitting proto events. - -### Bug Fixes - -* [#13046](https://github.com/cosmos/cosmos-sdk/pull/13046) Fix missing return statement in BaseApp.Query. - -## [v0.45.7](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.7) - 2022-08-04 - -### Features - -* (upgrade) [#12603](https://github.com/cosmos/cosmos-sdk/pull/12603) feat: Move AppModule.BeginBlock and AppModule.EndBlock to extension interfaces - -### Improvements - -* (events) [#12850](https://github.com/cosmos/cosmos-sdk/pull/12850) Add a new `fee_payer` attribute to the `tx` event that is emitted from the `DeductFeeDecorator` AnteHandler decorator. -* (x/params) [#12724](https://github.com/cosmos/cosmos-sdk/pull/12724) Add `GetParamSetIfExists` function to params `Subspace` to prevent panics on breaking changes. -* [#12668](https://github.com/cosmos/cosmos-sdk/pull/12668) Add `authz_msg_index` event attribute to message events emitted when executing via `MsgExec` through `x/authz`. -* [#12697](https://github.com/cosmos/cosmos-sdk/pull/12697) Upgrade IAVL to v0.19.0 with fast index and error propagation. NOTE: first start will take a while to propagate into new model. - * Note: after upgrading to this version it may take up to 15 minutes to migrate from 0.17 to 0.19. This time is used to create the fast cache introduced into IAVL for performance -* [#12784](https://github.com/cosmos/cosmos-sdk/pull/12784) Upgrade Tendermint to 0.34.20. -* (x/bank) [#12674](https://github.com/cosmos/cosmos-sdk/pull/12674) Add convenience function `CreatePrefixedAccountStoreKey()` to construct key to access account's balance for a given denom. - -### Bug Fixes - -* (x/mint) [#12384](https://github.com/cosmos/cosmos-sdk/pull/12384) Ensure `GoalBonded` must be positive when performing `x/mint` parameter validation. -* (simapp) [#12437](https://github.com/cosmos/cosmos-sdk/pull/12437) fix the non-determinstic behavior in simulations caused by `GenTx` and check -empty coins slice before it is used to create `banktype.MsgSend`. -* (x/capability) [12818](https://github.com/cosmos/cosmos-sdk/pull/12818) Use fixed length hex for pointer at FwdCapabilityKey. - -## [v0.45.6](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.6) - 2022-06-28 - -### Improvements - -* (simapp) [#12314](https://github.com/cosmos/cosmos-sdk/pull/12314) Increase `DefaultGenTxGas` from `1000000` to `10000000` -* [#12371](https://github.com/cosmos/cosmos-sdk/pull/12371) Update min required Golang version to 1.18. - -### Bug Fixes - -* [#12317](https://github.com/cosmos/cosmos-sdk/pull/12317) Rename `edit-validator` command's `--moniker` flag to `--new-moniker` -* (x/upgrade) [#12264](https://github.com/cosmos/cosmos-sdk/pull/12264) Fix `GetLastCompleteUpgrade` to properly return the latest upgrade. -* (x/crisis) [#12208](https://github.com/cosmos/cosmos-sdk/pull/12208) Fix progress index of crisis invariant assertion logs. - -### Features - -* (query) [#12253](https://github.com/cosmos/cosmos-sdk/pull/12253) Add `GenericFilteredPaginate` to the `query` package to improve UX. - -## [v0.45.5](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.5) - 2022-06-09 - -### Improvements - -* (x/feegrant) [#11813](https://github.com/cosmos/cosmos-sdk/pull/11813) Fix pagination total count in `AllowancesByGranter` query. -* (errors) [#12002](https://github.com/cosmos/cosmos-sdk/pull/12002) Removed 'redacted' error message from defaultErrEncoder. -* (ante) [#12017](https://github.com/cosmos/cosmos-sdk/pull/12017) Index ante events for failed tx (backport #12013). -* [#12153](https://github.com/cosmos/cosmos-sdk/pull/12153) Add a new `NewSimulationManagerFromAppModules` constructor, to simplify simulation wiring. - -### Bug Fixes - -* [#11796](https://github.com/cosmos/cosmos-sdk/pull/11796) Handle EOF error case in `readLineFromBuf`, which allows successful reading of passphrases from STDIN. -* [#11772](https://github.com/cosmos/cosmos-sdk/pull/11772) Limit types.Dec length to avoid overflow. -* [#10947](https://github.com/cosmos/cosmos-sdk/pull/10947) Add `AllowancesByGranter` query to the feegrant module -* [#9639](https://github.com/cosmos/cosmos-sdk/pull/9639) Check store keys length before accessing them by making sure that `key` is of length `m+1` (for `key[n:m]`) -* [#11983](https://github.com/cosmos/cosmos-sdk/pull/11983) (x/feegrant, x/authz) rename grants query commands to `grants-by-grantee`, `grants-by-granter` cmds. - -## Improvements - -* [#11886](https://github.com/cosmos/cosmos-sdk/pull/11886) Improve error messages - -## [v0.45.4](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.4) - 2022-04-25 - -### Bug Fixes - -* [#11624](https://github.com/cosmos/cosmos-sdk/pull/11624) Handle the error returned from `NewNode` in the `server` package. -* [#11724](https://github.com/cosmos/cosmos-sdk/pull/11724) Fix data race issues with `api.Server`. - -### Improvements - -* (types) [#12201](https://github.com/cosmos/cosmos-sdk/pull/12201) Add `MustAccAddressFromBech32` util function -* [#11693](https://github.com/cosmos/cosmos-sdk/pull/11693) Add validation for gentx cmd. -* [#11686](https://github.com/cosmos/cosmos-sdk/pull/11686) Update the min required Golang version to `1.17`. -* (x/auth/vesting) [#11652](https://github.com/cosmos/cosmos-sdk/pull/11652) Add util functions for `Period(s)` - -## [v0.45.3](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.3) - 2022-04-12 - -### Improvements - -* [#11562](https://github.com/cosmos/cosmos-sdk/pull/11562) Updated Tendermint to v0.34.19; `unsafe-reset-all` command has been moved to the `tendermint` sub-command. - -### Features - -* (x/upgrade) [#11551](https://github.com/cosmos/cosmos-sdk/pull/11551) Update `ScheduleUpgrade` for chains to schedule an automated upgrade on `BeginBlock` without having to go though governance. - -## [v0.45.2](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.2) - 2022-04-05 - -### Features - -* (tx) [#11533](https://github.com/cosmos/cosmos-sdk/pull/11533) Register [`EIP191`](https://eips.ethereum.org/EIPS/eip-191) as an available `SignMode` for chains to use. -* [#11430](https://github.com/cosmos/cosmos-sdk/pull/11430) Introduce a new `grpc-only` flag, such that when enabled, will start the node in a query-only mode. Note, gRPC MUST be enabled with this flag. -* (x/bank) [#11417](https://github.com/cosmos/cosmos-sdk/pull/11417) Introduce a new `SpendableBalances` gRPC query that retrieves an account's total (paginated) spendable balances. -* (x/bank) [#10771](https://github.com/cosmos/cosmos-sdk/pull/10771) Add safety check on bank module perms to allow module-specific mint restrictions (e.g. only minting a certain denom). -* (x/bank) [#10771](https://github.com/cosmos/cosmos-sdk/pull/10771) Add `bank.BankKeeper.WithMintCoinsRestriction` function to restrict use of bank `MintCoins` usage. This function is not on the bank `Keeper` interface, so it's not API-breaking, but only additive on the keeper implementation. -* [#10944](https://github.com/cosmos/cosmos-sdk/pull/10944) `x/authz` add all grants by grantee query -* [#11124](https://github.com/cosmos/cosmos-sdk/pull/11124) Add `GetAllVersions` to application store -* (x/auth) [#10880](https://github.com/cosmos/cosmos-sdk/pull/10880) Added a new query to the tx query service that returns a block with transactions fully decoded. -* [#11314](https://github.com/cosmos/cosmos-sdk/pull/11314) Add state rollback command. - -### Bug Fixes - -* [#11354](https://github.com/cosmos/cosmos-sdk/pull/11355) Added missing pagination flag for `bank q total` query. -* [#11197](https://github.com/cosmos/cosmos-sdk/pull/11197) Signing with multisig now works with multisig address which is not in the keyring. -* (client) [#11283](https://github.com/cosmos/cosmos-sdk/issues/11283) Support multiple keys for tx simulation and setting automatic gas for txs. -* (store) [#11177](https://github.com/cosmos/cosmos-sdk/pull/11177) Update the prune `everything` strategy to store the last two heights. -* (store) [#11117](https://github.com/cosmos/cosmos-sdk/pull/11117) Fix data race in store trace component -* (x/authz) [#11252](https://github.com/cosmos/cosmos-sdk/pull/11252) Allow insufficient funds error for authz simulation -* (crypto) [#11298](https://github.com/cosmos/cosmos-sdk/pull/11298) Fix cgo secp signature verification and update libscep256k1 library. -* (crypto) [#12122](https://github.com/cosmos/cosmos-sdk/pull/12122) Fix keyring migration issue. - -### Improvements - -* [#9576](https://github.com/cosmos/cosmos-sdk/pull/9576) Add debug error message to query result when enabled -* (types) [#11200](https://github.com/cosmos/cosmos-sdk/pull/11200) Added `Min()` and `Max()` operations on sdk.Coins. -* [#11267](https://github.com/cosmos/cosmos-sdk/pull/11267) Add hooks to allow app modules to add things to state-sync (backport #10961). - -## [v0.45.1](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.1) - 2022-02-03 - -### Bug Fixes - -* (grpc) [#10985](https://github.com/cosmos/cosmos-sdk/pull/10992) The `/cosmos/tx/v1beta1/txs/{hash}` endpoint returns a 404 when a tx does not exist. -* [#10990](https://github.com/cosmos/cosmos-sdk/pull/10990) Fixes missing `iavl-cache-size` config parsing in `GetConfig` method. -* [#11222](https://github.com/cosmos/cosmos-sdk/pull/11222) reject query with block height in the future - -### Improvements - -* [#10407](https://github.com/cosmos/cosmos-sdk/pull/10407) Added validation to `x/upgrade` module's `BeginBlock` to check accidental binary downgrades -* [#10768](https://github.com/cosmos/cosmos-sdk/pull/10768) Extra logging in in-place store migrations. - -## [v0.45.0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.0) - 2022-01-18 - -### State Machine Breaking - -* [#10833](https://github.com/cosmos/cosmos-sdk/pull/10833) fix reported tx gas used when block gas limit exceeded. -* (auth) [#10536](https://github.com/cosmos/cosmos-sdk/pull/10536]) Enable `SetSequence` for `ModuleAccount`. -* (store) [#10218](https://github.com/cosmos/cosmos-sdk/pull/10218) Charge gas even when there are no entries while seeking. -* (store) [#10247](https://github.com/cosmos/cosmos-sdk/pull/10247) Charge gas for the key length in gas meter. -* (x/gov) [#10740](https://github.com/cosmos/cosmos-sdk/pull/10740) Increase maximum proposal description size from 5k characters to 10k characters. -* [#10814](https://github.com/cosmos/cosmos-sdk/pull/10814) revert tx when block gas limit exceeded. - -### API Breaking Changes - -* [#10561](https://github.com/cosmos/cosmos-sdk/pull/10561) The `CommitMultiStore` interface contains a new `SetIAVLCacheSize` method -* [#10922](https://github.com/cosmos/cosmos-sdk/pull/10922), [/#10956](https://github.com/cosmos/cosmos-sdk/pull/10956) Deprecate key `server.Generate*` functions and move them to `testutil` and support custom mnemonics in in-process testing network. Moved `TestMnemonic` from `testutil` package to `testdata`. -* [#11049](https://github.com/cosmos/cosmos-sdk/pull/11049) Add custom tendermint config variables into root command. Allows App developers to set config.toml variables. - -### Features - -* [#10614](https://github.com/cosmos/cosmos-sdk/pull/10614) Support in-place migration ordering - -### Improvements - -* [#10486](https://github.com/cosmos/cosmos-sdk/pull/10486) store/cachekv's `Store.Write` conservatively - looks up keys, but also uses the [map clearing idiom](https://bencher.orijtech.com/perfclinic/mapclearing/) - to reduce the RAM usage, CPU time usage, and garbage collection pressure from clearing maps, - instead of allocating new maps. -* (module) [#10711](https://github.com/cosmos/cosmos-sdk/pull/10711) Panic at startup if the app developer forgot to add modules in the `SetOrder{BeginBlocker, EndBlocker, InitGenesis, ExportGenesis}` functions. This means that all modules, even those who have empty implementations for those methods, need to be added to `SetOrder*`. -* (types) [#10076](https://github.com/cosmos/cosmos-sdk/pull/10076) Significantly speedup and lower allocations for `Coins.String()`. -* (auth) [#10022](https://github.com/cosmos/cosmos-sdk/pull/10022) `AuthKeeper` interface in `x/auth` now includes a function `HasAccount`. -* [#10393](https://github.com/cosmos/cosmos-sdk/pull/10393) Add `HasSupply` method to bank keeper to ensure that input denom actually exists on chain. - -### Bug Fixes - -* (std/codec) [/#10595](https://github.com/cosmos/cosmos-sdk/pull/10595) Add evidence to std/codec to be able to decode evidence in client interactions. -* (types) [#9627](https://github.com/cosmos/cosmos-sdk/pull/9627) Fix nil pointer panic on `NewBigIntFromInt`. -* [#10725](https://github.com/cosmos/cosmos-sdk/pull/10725) populate `ctx.ConsensusParams` for begin/end blockers. -* [#9829](https://github.com/cosmos/cosmos-sdk/pull/9829) Fixed Coin denom sorting not being checked during `Balance.Validate` check. Refactored the Validation logic to use `Coins.Validate` for `Balance.Coins` -* [#10061](https://github.com/cosmos/cosmos-sdk/pull/10061) and [#10515](https://github.com/cosmos/cosmos-sdk/pull/10515) Ensure that `LegacyAminoPubKey` struct correctly unmarshals from JSON - -## [v0.44.8](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.44.8) - 2022-04-12 - -### Improvements - -* [#11563](https://github.com/cosmos/cosmos-sdk/pull/11563) Updated Tendermint to v0.34.19; `unsafe-reset-all` command has been moved to the `tendermint` sub-command. - -## [v0.44.7](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.44.7) - 2022-04-04 - -### Features - -* (x/bank) [#10771](https://github.com/cosmos/cosmos-sdk/pull/10771) Add safety check on bank module perms to allow module-specific mint restrictions (e.g. only minting a certain denom). -* (x/bank) [#10771](https://github.com/cosmos/cosmos-sdk/pull/10771) Add `bank.BankKeeper.WithMintCoinsRestriction` function to restrict use of bank `MintCoins` usage. This function is not on the bank `Keeper` interface, so it's not API-breaking, but only additive on the keeper implementation. - -### Bug Fixes - -* [#11354](https://github.com/cosmos/cosmos-sdk/pull/11355) Added missing pagination flag for `bank q total` query. -* (store) [#11177](https://github.com/cosmos/cosmos-sdk/pull/11177) Update the prune `everything` strategy to store the last two heights. -* (store) [#11117](https://github.com/cosmos/cosmos-sdk/pull/11117) Fix data race in store trace component -* (x/authz) [#11252](https://github.com/cosmos/cosmos-sdk/pull/11252) Allow insufficient funds error for authz simulation - -### Improvements - -* [#9576](https://github.com/cosmos/cosmos-sdk/pull/9576) Add debug error message to query result when enabled - -## [v0.44.6](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.44.6) - 2022-02-02 - -### Features - -* [#11124](https://github.com/cosmos/cosmos-sdk/pull/11124) Add `GetAllVersions` to application store - -### Bug Fixes - -* (grpc) [#10985](https://github.com/cosmos/cosmos-sdk/pull/10992) The `/cosmos/tx/v1beta1/txs/{hash}` endpoint returns a 404 when a tx does not exist. -* (std/codec) [/#10595](https://github.com/cosmos/cosmos-sdk/pull/10595) Add evidence to std/codec to be able to decode evidence in client interactions. -* [#10725](https://github.com/cosmos/cosmos-sdk/pull/10725) populate `ctx.ConsensusParams` for begin/end blockers. -* [#10061](https://github.com/cosmos/cosmos-sdk/pull/10061) and [#10515](https://github.com/cosmos/cosmos-sdk/pull/10515) Ensure that `LegacyAminoPubKey` struct correctly unmarshals from JSON - -### Improvements - -* [#10823](https://github.com/cosmos/cosmos-sdk/pull/10823) updated ambiguous cli description for creating feegrant. - -## [v0.44.5-patch](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.44.5-patch) - 2021-10-14 - -ATTENTION: - -This is a security release for the [Dragonberry security advisory](https://forum.cosmos.network/t/ibc-security-advisory-dragonberry/7702). - -All users should upgrade immediately. - -Users *must* add a replace directive in their go.mod for the new `ics23` package in the SDK: - -```go -replace github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 -``` - -## [v0.44.5](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.44.5) - 2021-12-02 - -### Improvements - -* (baseapp) [#10631](https://github.com/cosmos/cosmos-sdk/pull/10631) Emit ante events even for the failed txs. -* (store) [#10741](https://github.com/cosmos/cosmos-sdk/pull/10741) Significantly speedup iterator creation after delete heavy workloads. Significantly improves IBC migration times. - -### Bug Fixes - -* [#10648](https://github.com/cosmos/cosmos-sdk/pull/10648) Upgrade IAVL to 0.17.3 to solve race condition bug in IAVL. - -## [v0.44.4](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.44.4) - 2021-11-25 +* (baseapp) [#20291](https://github.com/cosmos/cosmos-sdk/pull/20291) Simulate nested messages. +* (types) [#23919](https://github.com/cosmos/cosmos-sdk/pull/23919) Add MustValAddressFromBech32 function. +* (all) [23708](https://github.com/cosmos/cosmos-sdk/pull/23708) Add unordered transaction support. + * Adds a `--timeout-timestamp` flag that allows users to specify a block time at which the unordered transactions should expire from the mempool. +* (x/epochs) [#23815](https://github.com/cosmos/cosmos-sdk/pull/23815) Upstream `x/epochs` from Osmosis +* (client) [#23811](https://github.com/cosmos/cosmos-sdk/pull/23811) Add auto cli for node service. +* (genutil) [#24018](https://github.com/cosmos/cosmos-sdk/pull/24018) Allow manually setting the consensus key type in genesis ### Improvements -* (types) [#10630](https://github.com/cosmos/cosmos-sdk/pull/10630) Add an `Events` field to the `TxResponse` type that captures *all* events emitted by a transaction, unlike `Logs` which only contains events emitted during message execution. -* (x/upgrade) [#10532](https://github.com/cosmos/cosmos-sdk/pull/10532) Add `keeper.DumpUpgradeInfoWithInfoToDisk` to include `Plan.Info` in the upgrade-info file. -* (store) [#10544](https://github.com/cosmos/cosmos-sdk/pull/10544) Use the new IAVL iterator structure which significantly improves iterator performance. +* (crypto/ledger) [#24036](https://github.com/cosmos/cosmos-sdk/pull/24036) Improve error message when deriving paths using index > 100 +* (gRPC) [#23844](https://github.com/cosmos/cosmos-sdk/pull/23844) Add debug log prints for each gRPC request. ### Bug Fixes -* [#10827](https://github.com/cosmos/cosmos-sdk/pull/10827) Create query `Context` with requested block height -* [#10414](https://github.com/cosmos/cosmos-sdk/pull/10414) Use `sdk.GetConfig().GetFullBIP44Path()` instead `sdk.FullFundraiserPath` to generate key -* (bank) [#10394](https://github.com/cosmos/cosmos-sdk/pull/10394) Fix: query account balance by ibc denom. -* [\10608](https://github.com/cosmos/cosmos-sdk/pull/10608) Change the order of module migration by pushing x/auth to the end. Auth module depends on other modules and should be run last. We have updated the documentation to provide more details how to change module migration order. This is technically a breaking change, but only impacts updates between the upgrades with version change, hence migrating from the previous patch release doesn't cause new migration and doesn't break the state. -* [#10674](https://github.com/cosmos/cosmos-sdk/pull/10674) Fix issue with `Error.Wrap` and `Error.Wrapf` usage with `errors.Is`. +* (client/keys) [#24041](https://github.com/cosmos/cosmos-sdk/pull/24041) `keys delete` won't terminate when a key is not found, but will log the error. +* (baseapp) [#24027](https://github.com/cosmos/cosmos-sdk/pull/24027) Ensure that `BaseApp.Init` checks that the commit multistore is set to protect against nil dereferences. +* (x/group) [GHSA-47ww-ff84-4jrg](https://github.com/cosmos/cosmos-sdk/security/advisories/GHSA-47ww-ff84-4jrg) Fix x/group can halt when erroring in EndBlocker +* (x/distribution) [#23934](https://github.com/cosmos/cosmos-sdk/pull/23934) Fix vulnerability in `incrementReferenceCount` in distribution. +* (baseapp) [#23879](https://github.com/cosmos/cosmos-sdk/pull/23879) Ensure finalize block response is not empty in the defer check of FinalizeBlock to avoid panic by nil pointer. +* (query) [#23883](https://github.com/cosmos/cosmos-sdk/pull/23883) Fix NPE in query pagination. +* (client) [#23860](https://github.com/cosmos/cosmos-sdk/pull/23860) Add missing `unordered` field for legacy amino signing of tx body. +* (x/bank) [#23836](https://github.com/cosmos/cosmos-sdk/pull/23836) Fix `DenomMetadata` rpc allow value with slashes. +* (query) [87d3a43](https://github.com/cosmos/cosmos-sdk/commit/87d3a432af95f4cf96aa02351ed5fcc51cca6e7b) Fix collection filtered pagination. +* (sims) [#23952](https://github.com/cosmos/cosmos-sdk/pull/23952) Use liveness matrix for validator sign status in sims -## [v0.44.3](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.44.3) - 2021-10-21 - -### Improvements - -* [#10768](https://github.com/cosmos/cosmos-sdk/pull/10768) Added extra logging for tracking in-place store migrations -* [#10262](https://github.com/cosmos/cosmos-sdk/pull/10262) Remove unnecessary logging in `x/feegrant` simulation. -* [#10327](https://github.com/cosmos/cosmos-sdk/pull/10327) Add null guard for possible nil `Amount` in tx fee `Coins` -* [#10339](https://github.com/cosmos/cosmos-sdk/pull/10339) Improve performance of `removeZeroCoins` by only allocating memory when necessary -* [#10045](https://github.com/cosmos/cosmos-sdk/pull/10045) Revert [#8549](https://github.com/cosmos/cosmos-sdk/pull/8549). Do not route grpc queries through Tendermint. -* (deps) [#10375](https://github.com/cosmos/cosmos-sdk/pull/10375) Bump Tendermint to [v0.34.14](https://github.com/tendermint/tendermint/releases/tag/v0.34.14). -* [#10024](https://github.com/cosmos/cosmos-sdk/pull/10024) `store/cachekv` performance improvement by reduced growth factor for iterator ranging by using binary searches to find dirty items when unsorted key count >= 1024. +## [v0.50.12](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.12) - 2025-02-20 ### Bug Fixes -* (client) [#10226](https://github.com/cosmos/cosmos-sdk/pull/10226) Fix --home flag parsing. -* (rosetta) [#10340](https://github.com/cosmos/cosmos-sdk/pull/10340) Use `GenesisChunked(ctx)` instead `Genesis(ctx)` to get genesis block height +* [GHSA-x5vx-95h7-rv4p](https://github.com/cosmos/cosmos-sdk/security/advisories/GHSA-x5vx-95h7-rv4p) Fix Group module can halt chain when handling a malicious proposal. -## [v0.44.2](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.44.2) - 2021-10-12 +## [v0.50.11](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.11) - 2024-12-16 -Security Release. No breaking changes related to 0.44.x. +### Features -## [v0.44.1](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.44.1) - 2021-09-29 +* (crypto/keyring) [#21653](https://github.com/cosmos/cosmos-sdk/pull/21653) New Linux-only backend that adds Linux kernel's `keyctl` support. ### Improvements -* (store) [#10040](https://github.com/cosmos/cosmos-sdk/pull/10040) Bump IAVL to v0.17.1 which includes performance improvements on a batch load. -* (types) [#10021](https://github.com/cosmos/cosmos-sdk/pull/10021) Speedup coins.AmountOf(), by removing many intermittent regex calls. -* [#10077](https://github.com/cosmos/cosmos-sdk/pull/10077) Remove telemetry on `GasKV` and `CacheKV` store Get/Set operations, significantly improving their performance. -* (store) [#10026](https://github.com/cosmos/cosmos-sdk/pull/10026) Improve CacheKVStore datastructures / algorithms, to no longer take O(N^2) time when interleaving iterators and insertions. +* (server) [#21941](https://github.com/cosmos/cosmos-sdk/pull/21941) Regenerate addrbook.json for in place testnet. ### Bug Fixes -* [#9969](https://github.com/cosmos/cosmos-sdk/pull/9969) fix: use keyring in config for add-genesis-account cmd. -* (x/genutil) [#10104](https://github.com/cosmos/cosmos-sdk/pull/10104) Ensure the `init` command reads the `--home` flag value correctly. -* (x/feegrant) [#10049](https://github.com/cosmos/cosmos-sdk/issues/10049) Fixed the error message when `period` or `period-limit` flag is not set on a feegrant grant transaction. +* Fix [ABS-0043/ABS-0044](https://github.com/cosmos/cosmos-sdk/security/advisories/GHSA-8wcc-m6j2-qxvm) Limit recursion depth for unknown field detection and unpack any +* (server) [#22564](https://github.com/cosmos/cosmos-sdk/pull/22564) Fix fallback genesis path in server +* (x/group) [#22425](https://github.com/cosmos/cosmos-sdk/pull/22425) Proper address rendering in error +* (sims) [#21906](https://github.com/cosmos/cosmos-sdk/pull/21906) Skip sims test when running dry on validators +* (cli) [#21919](https://github.com/cosmos/cosmos-sdk/pull/21919) Query address-by-acc-num by account_id instead of id. +* (x/group) [#22229](https://github.com/cosmos/cosmos-sdk/pull/22229) Accept `1` and `try` in CLI for group proposal exec. -### Client Breaking Changes - -* [#9879](https://github.com/cosmos/cosmos-sdk/pull/9879) Modify ABCI Queries to use `abci.QueryRequest` Height field if it is non-zero, otherwise continue using context height. - -## [v0.44.0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.44.0) - 2021-09-01 +## [v0.50.10](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.10) - 2024-09-20 ### Features -* [#9860](https://github.com/cosmos/cosmos-sdk/pull/9860) Emit transaction fee in ante handler fee decorator. The event type is `tx` and the attribute is `fee`. +* (cli) [#20779](https://github.com/cosmos/cosmos-sdk/pull/20779) Added `module-hash-by-height` command to query and retrieve module hashes at a specified blockchain height, enhancing debugging capabilities. +* (cli) [#21372](https://github.com/cosmos/cosmos-sdk/pull/21372) Added a `bulk-add-genesis-account` genesis command to add many genesis accounts at once. +* (types/collections) [#21724](https://github.com/cosmos/cosmos-sdk/pull/21724) Added `LegacyDec` collection value. ### Improvements -* (deps) [#9956](https://github.com/cosmos/cosmos-sdk/pull/9956) Bump Tendermint to [v0.34.12](https://github.com/tendermint/tendermint/releases/tag/v0.34.12). - -### Deprecated - -* (x/upgrade) [#9906](https://github.com/cosmos/cosmos-sdk/pull/9906) Deprecate `UpgradeConsensusState` gRPC query since this functionality is only used for IBC, which now has its own [IBC replacement](https://github.com/cosmos/ibc-go/blob/2c880a22e9f9cc75f62b527ca94aa75ce1106001/proto/ibc/core/client/v1/query.proto#L54) +* (x/bank) [#21460](https://github.com/cosmos/cosmos-sdk/pull/21460) Added `Sender` attribute in `MsgMultiSend` event. +* (genutil) [#21701](https://github.com/cosmos/cosmos-sdk/pull/21701) Improved error messages for genesis validation. +* (testutil/integration) [#21816](https://github.com/cosmos/cosmos-sdk/pull/21816) Allow to pass baseapp options in `NewIntegrationApp`. ### Bug Fixes -* [#9965](https://github.com/cosmos/cosmos-sdk/pull/9965) Fixed `simd version` command output to report the right release tag. -* (x/upgrade) [#10189](https://github.com/cosmos/cosmos-sdk/issues/10189) Removed potential sources of non-determinism in upgrades. - -### Client Breaking Changes - -* [#10041](https://github.com/cosmos/cosmos-sdk/pull/10041) Remove broadcast & encode legacy REST endpoints. Please see the [REST Endpoints Migration guide](https://docs.cosmos.network/v0.45/migrations/rest.html) to migrate to the new REST endpoints. +* (runtime) [#21769](https://github.com/cosmos/cosmos-sdk/pull/21769) Fix baseapp options ordering to avoid overwriting options set by modules. +* (x/consensus) [#21493](https://github.com/cosmos/cosmos-sdk/pull/21493) Fix regression that prevented to upgrade to > v0.50.7 without consensus version params. +* (baseapp) [#21256](https://github.com/cosmos/cosmos-sdk/pull/21256) Halt height will not commit the block indicated, meaning that if halt-height is set to 10, only blocks until 9 (included) will be committed. This is to go back to the original behavior before a change was introduced in v0.50.0. +* (baseapp) [#21444](https://github.com/cosmos/cosmos-sdk/pull/21444) Follow-up, Return PreBlocker events in FinalizeBlockResponse. +* (baseapp) [#21413](https://github.com/cosmos/cosmos-sdk/pull/21413) Fix data race in sdk mempool. -## [v0.43.0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.43.0) - 2021-08-10 +## [v0.50.9](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.9) - 2024-08-07 -### Features +## Bug Fixes -* [#6711](https://github.com/cosmos/cosmos-sdk/pull/6711) Make integration test suites reusable by apps, tests are exported in each module's `client/testutil` package. -* [#8077](https://github.com/cosmos/cosmos-sdk/pull/8077) Added support for grpc-web, enabling browsers to communicate with a chain's gRPC server -* [#8965](https://github.com/cosmos/cosmos-sdk/pull/8965) cosmos reflection now provides more information on the application such as: deliverable msgs, sdk.Config info etc (still in alpha stage). -* [#8520](https://github.com/cosmos/cosmos-sdk/pull/8520) Add support for permanently locked vesting accounts. -* [#8559](https://github.com/cosmos/cosmos-sdk/pull/8559) Added Protobuf compatible secp256r1 ECDSA signatures. -* [#8786](https://github.com/cosmos/cosmos-sdk/pull/8786) Enabled secp256r1 in x/auth. -* (rosetta) [#8729](https://github.com/cosmos/cosmos-sdk/pull/8729) Data API fully supports balance tracking. Construction API can now construct any message supported by the application. -* [#8754](https://github.com/cosmos/cosmos-sdk/pull/8875) Added support for reverse iteration to pagination. -* (types) [#9079](https://github.com/cosmos/cosmos-sdk/issues/9079) Add `AddAmount`/`SubAmount` methods to `sdk.Coin`. -* [#9088](https://github.com/cosmos/cosmos-sdk/pull/9088) Added implementation to ADR-28 Derived Addresses. -* [#9133](https://github.com/cosmos/cosmos-sdk/pull/9133) Added hooks for governance actions. -* (x/staking) [#9214](https://github.com/cosmos/cosmos-sdk/pull/9214) Added `new_shares` attribute inside `EventTypeDelegate` event. -* [#9382](https://github.com/cosmos/cosmos-sdk/pull/9382) feat: add Dec.Float64() function. -* [#9457](https://github.com/cosmos/cosmos-sdk/pull/9457) Add amino support for x/authz and x/feegrant Msgs. -* [#9498](https://github.com/cosmos/cosmos-sdk/pull/9498) Added `Codec: codec.Codec` attribute to `client/Context` structure. -* [#9540](https://github.com/cosmos/cosmos-sdk/pull/9540) Add output flag for query txs command. -* (errors) [#8845](https://github.com/cosmos/cosmos-sdk/pull/8845) Add `Error.Wrap` handy method -* [#8518](https://github.com/cosmos/cosmos-sdk/pull/8518) Help users of multisig wallets debug signature issues. -* [#9573](https://github.com/cosmos/cosmos-sdk/pull/9573) ADR 040 implementation: New DB interface -* [#9952](https://github.com/cosmos/cosmos-sdk/pull/9952) ADR 040: Implement in-memory DB backend -* [#9848](https://github.com/cosmos/cosmos-sdk/pull/9848) ADR-040: Implement BadgerDB backend -* [#9851](https://github.com/cosmos/cosmos-sdk/pull/9851) ADR-040: Implement RocksDB backend -* [#10308](https://github.com/cosmos/cosmos-sdk/pull/10308) ADR-040: Implement DBConnection.Revert -* [#9892](https://github.com/cosmos/cosmos-sdk/pull/9892) ADR-040: KV Store with decoupled storage and state commitment +* (baseapp) [#21159](https://github.com/cosmos/cosmos-sdk/pull/21159) Return PreBlocker events in FinalizeBlockResponse. +* [#20939](https://github.com/cosmos/cosmos-sdk/pull/20939) Fix collection reverse iterator to include `pagination.key` in the result. +* (client/grpc) [#20969](https://github.com/cosmos/cosmos-sdk/pull/20969) Fix `node.NewQueryServer` method not setting `cfg`. +* (testutil/integration) [#21006](https://github.com/cosmos/cosmos-sdk/pull/21006) Fix `NewIntegrationApp` method not writing default genesis to state. +* (runtime) [#21080](https://github.com/cosmos/cosmos-sdk/pull/21080) Fix `app.yaml` / `app.json` incompatibility with `depinject v1.0.0`. -### Client Breaking Changes +## [v0.50.8](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.8) - 2024-07-15 -* [#8363](https://github.com/cosmos/cosmos-sdk/pull/8363) Addresses no longer have a fixed 20-byte length. From the SDK modules' point of view, any 1-255 bytes-long byte array is a valid address. -* (crypto/ed25519) [#8690] Adopt zip1215 ed2559 verification rules. -* [#8849](https://github.com/cosmos/cosmos-sdk/pull/8849) Upgrade module no longer supports time based upgrades. -* [#7477](https://github.com/cosmos/cosmos-sdk/pull/7477) Changed Bech32 Public Key serialization in the client facing functionality (CLI, MsgServer, QueryServer): - * updated the keyring display structure (it uses protobuf JSON serialization) - the output is more verbose. - * Renamed `MarshalAny` and `UnmarshalAny` to `MarshalInterface` and `UnmarshalInterface` respectively. These functions must take an interface as parameter (not a concrete type nor `Any` object). Underneath they use `Any` wrapping for correct protobuf serialization. - * CLI: removed `--text` flag from `show-node-id` command; the text format for public keys is not used any more - instead we use ProtoJSON. -* (store) [#8790](https://github.com/cosmos/cosmos-sdk/pull/8790) Reduce gas costs by 10x for transient store operations. -* [#9139](https://github.com/cosmos/cosmos-sdk/pull/9139) Querying events: - * via `ServiceMsg` TypeURLs (e.g. `message.action='/cosmos.bank.v1beta1.Msg/Send'`) does not work anymore, - * via legacy `msg.Type()` (e.g. `message.action='send'`) is being deprecated, new `Msg`s won't emit these events. - * Please use concrete `Msg` TypeURLs instead (e.g. `message.action='/cosmos.bank.v1beta1.MsgSend'`). -* [#9859](https://github.com/cosmos/cosmos-sdk/pull/9859) The `default` pruning strategy now keeps the last 362880 blocks instead of 100. 362880 equates to roughly enough blocks to cover the entire unbonding period assuming a 21 day unbonding period and 5s block time. -* [#9785](https://github.com/cosmos/cosmos-sdk/issues/9785) Missing coin denomination in logs +## Features -### API Breaking Changes +* (client) [#20690](https://github.com/cosmos/cosmos-sdk/pull/20690) Import mnemonic from file -* (keyring) [#8662](https://github.com/cosmos/cosmos-sdk/pull/8662) `NewMnemonic` now receives an additional `passphrase` argument to secure the key generated by the bip39 mnemonic. -* (x/bank) [#8473](https://github.com/cosmos/cosmos-sdk/pull/8473) Bank keeper does not expose unsafe balance changing methods such as `SetBalance`, `SetSupply` etc. -* (x/staking) [#8473](https://github.com/cosmos/cosmos-sdk/pull/8473) On genesis init, if non bonded pool and bonded pool balance, coming from the bank module, does not match what is saved in the staking state, the initialization will panic. -* (x/gov) [#8473](https://github.com/cosmos/cosmos-sdk/pull/8473) On genesis init, if the gov module account balance, coming from bank module state, does not match the one in gov module state, the initialization will panic. -* (x/distribution) [#8473](https://github.com/cosmos/cosmos-sdk/pull/8473) On genesis init, if the distribution module account balance, coming from bank module state, does not match the one in distribution module state, the initialization will panic. -* (client/keys) [#8500](https://github.com/cosmos/cosmos-sdk/pull/8500) `InfoImporter` interface is removed from legacy keybase. -* (x/staking) [#8505](https://github.com/cosmos/cosmos-sdk/pull/8505) `sdk.PowerReduction` has been renamed to `sdk.DefaultPowerReduction`, and most staking functions relying on power reduction take a new function argument, instead of relying on that global variable. -* [#8629](https://github.com/cosmos/cosmos-sdk/pull/8629) Deprecated `SetFullFundraiserPath` from `Config` in favor of `SetPurpose` and `SetCoinType`. -* (x/upgrade) [#8673](https://github.com/cosmos/cosmos-sdk/pull/8673) Remove IBC logic from x/upgrade. Deprecates IBC fields in an Upgrade Plan, an error will be thrown if they are set. IBC upgrade logic moved to 02-client and an IBC UpgradeProposal is added. -* (x/bank) [#8517](https://github.com/cosmos/cosmos-sdk/pull/8517) `SupplyI` interface and `Supply` are removed and uses `sdk.Coins` for supply tracking -* (x/upgrade) [#8743](https://github.com/cosmos/cosmos-sdk/pull/8743) `UpgradeHandler` includes a new argument `VersionMap` which helps facilitate in-place migrations. -* (x/auth) [#8129](https://github.com/cosmos/cosmos-sdk/pull/8828) Updated `SigVerifiableTx.GetPubKeys` method signature to return error. -* (x/upgrade) [\7487](https://github.com/cosmos/cosmos-sdk/pull/8897) Upgrade `Keeper` takes new argument `ProtocolVersionSetter` which implements setting a protocol version on baseapp. -* (baseapp) [\7487](https://github.com/cosmos/cosmos-sdk/pull/8897) BaseApp's fields appVersion and version were swapped to match Tendermint's fields. -* [#8682](https://github.com/cosmos/cosmos-sdk/pull/8682) `ante.NewAnteHandler` updated to receive all positional params as `ante.HandlerOptions` struct. If required fields aren't set, throws error accordingly. -* (x/staking/types) [#7447](https://github.com/cosmos/cosmos-sdk/issues/7447) Remove bech32 PubKey support: - * `ValidatorI` interface update: `GetConsPubKey` renamed to `TmConsPubKey` (this is to clarify the return type: consensus public key must be a tendermint key); `TmConsPubKey`, `GetConsAddr` methods return error. - * `Validator` updated according to the `ValidatorI` changes described above. - * `ToTmValidator` function: added `error` to return values. - * `Validator.ConsensusPubkey` type changed from `string` to `codectypes.Any`. - * `MsgCreateValidator.Pubkey` type changed from `string` to `codectypes.Any`. -* (client) [#8926](https://github.com/cosmos/cosmos-sdk/pull/8926) `client/tx.PrepareFactory` has been converted to a private function, as it's only used internally. -* (auth/tx) [#8926](https://github.com/cosmos/cosmos-sdk/pull/8926) The `ProtoTxProvider` interface used as a workaround for transaction simulation has been removed. -* (x/bank) [#8798](https://github.com/cosmos/cosmos-sdk/pull/8798) `GetTotalSupply` is removed in favour of `GetPaginatedTotalSupply` -* (keyring) [#8739](https://github.com/cosmos/cosmos-sdk/pull/8739) Rename InfoImporter -> LegacyInfoImporter. -* (x/bank/types) [#9061](https://github.com/cosmos/cosmos-sdk/pull/9061) `AddressFromBalancesStore` now returns an error for invalid key instead of panic. -* (x/auth) [#9144](https://github.com/cosmos/cosmos-sdk/pull/9144) The `NewTxTimeoutHeightDecorator` antehandler has been converted from a struct to a function. -* (codec) [#9226](https://github.com/cosmos/cosmos-sdk/pull/9226) Rename codec interfaces and methods, to follow a general Go interfaces: - * `codec.Marshaler` → `codec.Codec` (this defines objects which serialize other objects) - * `codec.BinaryMarshaler` → `codec.BinaryCodec` - * `codec.JSONMarshaler` → `codec.JSONCodec` - * Removed `BinaryBare` suffix from `BinaryCodec` methods (`MarshalBinaryBare`, `UnmarshalBinaryBare`, ...) - * Removed `Binary` infix from `BinaryCodec` methods (`MarshalBinaryLengthPrefixed`, `UnmarshalBinaryLengthPrefixed`, ...) -* [#9139](https://github.com/cosmos/cosmos-sdk/pull/9139) `ServiceMsg` TypeURLs (e.g. `/cosmos.bank.v1beta1.Msg/Send`) have been removed, as they don't comply to the Probobuf `Any` spec. Please use `Msg` type TypeURLs (e.g. `/cosmos.bank.v1beta1.MsgSend`). This has multiple consequences: - * The `sdk.ServiceMsg` struct has been removed. - * `sdk.Msg` now only contains `ValidateBasic` and `GetSigners` methods. The remaining methods `GetSignBytes`, `Route` and `Type` are moved to `legacytx.LegacyMsg`. - * The `RegisterCustomTypeURL` function and the `cosmos.base.v1beta1.ServiceMsg` interface have been removed from the interface registry. -* (codec) [#9251](https://github.com/cosmos/cosmos-sdk/pull/9251) Rename `clientCtx.JSONMarshaler` to `clientCtx.JSONCodec` as per #9226. -* (x/bank) [#9271](https://github.com/cosmos/cosmos-sdk/pull/9271) SendEnabledCoin(s) renamed to IsSendEnabledCoin(s) to better reflect its functionality. -* (x/bank) [#9550](https://github.com/cosmos/cosmos-sdk/pull/9550) `server.InterceptConfigsPreRunHandler` now takes 2 additional arguments: customAppConfigTemplate and customAppConfig. If you don't need to customize these, simply put `""` and `nil`. -* [#8245](https://github.com/cosmos/cosmos-sdk/pull/8245) Removed `simapp.MakeCodecs` and use `simapp.MakeTestEncodingConfig` instead. -* (x/capability) [#9836](https://github.com/cosmos/cosmos-sdk/pull/9836) Removed `InitializeAndSeal(ctx sdk.Context)` and replaced with `Seal()`. App must add x/capability module to the begin blockers which will assure that the x/capability keeper is properly initialized. The x/capability begin blocker must be run before any other module which uses x/capability. +## Improvements -### State Machine Breaking +* (x/authz,x/feegrant) [#20590](https://github.com/cosmos/cosmos-sdk/pull/20590) Provide updated keeper in depinject for authz and feegrant modules. +* [#20631](https://github.com/cosmos/cosmos-sdk/pull/20631) Fix json parsing in the wait-tx command. +* (x/auth) [#20438](https://github.com/cosmos/cosmos-sdk/pull/20438) Add `--skip-signature-verification` flag to multisign command to allow nested multisigs. -* (x/{bank,distrib,gov,slashing,staking}) [#8363](https://github.com/cosmos/cosmos-sdk/issues/8363) Store keys have been modified to allow for variable-length addresses. -* (x/evidence) [#8502](https://github.com/cosmos/cosmos-sdk/pull/8502) `HandleEquivocationEvidence` persists the evidence to state. -* (x/gov) [#7733](https://github.com/cosmos/cosmos-sdk/pull/7733) ADR 037 Implementation: Governance Split Votes, use `MsgWeightedVote` to send a split vote. Sending a regular `MsgVote` will convert the underlying vote option into a weighted vote with weight 1. -* (x/bank) [#8656](https://github.com/cosmos/cosmos-sdk/pull/8656) balance and supply are now correctly tracked via `coin_spent`, `coin_received`, `coinbase` and `burn` events. -* (x/bank) [#8517](https://github.com/cosmos/cosmos-sdk/pull/8517) Supply is now stored and tracked as `sdk.Coins` -* (x/bank) [#9051](https://github.com/cosmos/cosmos-sdk/pull/9051) Supply value is stored as `sdk.Int` rather than `string`. +## Bug Fixes -### CLI Breaking Changes +* (simulation) [#17911](https://github.com/cosmos/cosmos-sdk/pull/17911) Fix all problems with executing command `make test-sim-custom-genesis-fast` for simulation test. +* (simulation) [#18196](https://github.com/cosmos/cosmos-sdk/pull/18196) Fix the problem of `validator set is empty after InitGenesis` in simulation test. -* [#8880](https://github.com/cosmos/cosmos-sdk/pull/8880) The CLI `simd migrate v0.40 ...` command has been renamed to `simd migrate v0.42`. -* [#8628](https://github.com/cosmos/cosmos-sdk/issues/8628) Commands no longer print outputs using `stderr` by default -* [#9134](https://github.com/cosmos/cosmos-sdk/pull/9134) Renamed the CLI flag `--memo` to `--note`. -* [#9291](https://github.com/cosmos/cosmos-sdk/pull/9291) Migration scripts prior to v0.38 have been removed from the CLI `migrate` command. The oldest supported migration is v0.39->v0.42. -* [#9371](https://github.com/cosmos/cosmos-sdk/pull/9371) Non-zero default fees/Server will error if there's an empty value for min-gas-price in app.toml -* [#9827](https://github.com/cosmos/cosmos-sdk/pull/9827) Ensure input parity of validator public key input between `tx staking create-validator` and `gentx`. -* [#9621](https://github.com/cosmos/cosmos-sdk/pull/9621) Rollback [#9371](https://github.com/cosmos/cosmos-sdk/pull/9371) and log warning if there's an empty value for min-gas-price in app.toml +## [v0.50.7](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.7) - 2024-06-04 ### Improvements -* (store) [#8012](https://github.com/cosmos/cosmos-sdk/pull/8012) Implementation of ADR-038 WriteListener and listen.KVStore -* (x/bank) [#8614](https://github.com/cosmos/cosmos-sdk/issues/8614) Add `Name` and `Symbol` fields to denom metadata -* (x/auth) [#8522](https://github.com/cosmos/cosmos-sdk/pull/8522) Allow to query all stored accounts -* (crypto/types) [#8600](https://github.com/cosmos/cosmos-sdk/pull/8600) `CompactBitArray`: optimize the `NumTrueBitsBefore` method and add an `Equal` method. -* (x/upgrade) [#8743](https://github.com/cosmos/cosmos-sdk/pull/8743) Add tracking module versions as per ADR-041 -* (types) [#8962](https://github.com/cosmos/cosmos-sdk/issues/8962) Add `Abs()` method to `sdk.Int`. -* (x/bank) [#8950](https://github.com/cosmos/cosmos-sdk/pull/8950) Improve efficiency on supply updates. -* (store) [#8811](https://github.com/cosmos/cosmos-sdk/pull/8811) store/cachekv: use typed `types/kv.List` instead of `container/list.List`. The change brings time spent on the time assertion cummulatively to 580ms down from 6.88s. -* (keyring) [#8826](https://github.com/cosmos/cosmos-sdk/pull/8826) add trust to macOS Keychain for calling apps by default, avoiding repeating keychain popups that appears when dealing with keyring (key add, list, ...) operations. -* (makefile) [#7933](https://github.com/cosmos/cosmos-sdk/issues/7933) Use Docker to generate swagger files. -* (crypto/types) [#9196](https://github.com/cosmos/cosmos-sdk/pull/9196) Fix negative index accesses in CompactUnmarshal,GetIndex,SetIndex -* (makefile) [#9192](https://github.com/cosmos/cosmos-sdk/pull/9192) Reuse proto containers in proto related jobs. -* [#9205](https://github.com/cosmos/cosmos-sdk/pull/9205) Improve readability in `abci` handleQueryP2P -* [#9231](https://github.com/cosmos/cosmos-sdk/pull/9231) Remove redundant staking errors. -* [#9314](https://github.com/cosmos/cosmos-sdk/pull/9314) Update Rosetta SDK to upstream's latest release. -* (gRPC-Web) [#9493](https://github.com/cosmos/cosmos-sdk/pull/9493) Add `EnableUnsafeCORS` flag to grpc-web config. -* (x/params) [#9481](https://github.com/cosmos/cosmos-sdk/issues/9481) Speedup simulator for parameter change proposals. -* (x/staking) [#9423](https://github.com/cosmos/cosmos-sdk/pull/9423) Staking delegations now returns empty list instead of rpc error when no records found. -* (x/auth) [#9553](https://github.com/cosmos/cosmos-sdk/pull/9553) The `--multisig` flag now accepts both a name and address. -* [#8549](https://github.com/cosmos/cosmos-sdk/pull/8549) Make gRPC requests go through tendermint Query -* [#8093](https://github.com/cosmos/cosmos-sdk/pull/8093) Limit usage of context.background. -* [#8460](https://github.com/cosmos/cosmos-sdk/pull/8460) Ensure b.ReportAllocs() in all the benchmarks -* [#8461](https://github.com/cosmos/cosmos-sdk/pull/8461) Fix upgrade tx commands not showing up in CLI +* (debug) [#20328](https://github.com/cosmos/cosmos-sdk/pull/20328) Add consensus address for debug cmd. +* (runtime) [#20264](https://github.com/cosmos/cosmos-sdk/pull/20264) Expose grpc query router via depinject. +* (x/consensus) [#20381](https://github.com/cosmos/cosmos-sdk/pull/20381) Use Comet utility for consensus module consensus param updates. +* (client) [#20356](https://github.com/cosmos/cosmos-sdk/pull/20356) Overwrite client context when available in `SetCmdClientContext`. ### Bug Fixes -* (gRPC) [#8945](https://github.com/cosmos/cosmos-sdk/pull/8945) gRPC reflection now works correctly. -* (keyring) [#8635](https://github.com/cosmos/cosmos-sdk/issues/8635) Remove hardcoded default passphrase value on `NewMnemonic` -* (x/bank) [#8434](https://github.com/cosmos/cosmos-sdk/pull/8434) Fix legacy REST API `GET /bank/total` and `GET /bank/total/{denom}` in swagger -* (x/slashing) [#8427](https://github.com/cosmos/cosmos-sdk/pull/8427) Fix query signing infos command -* (x/bank/types) [#9112](https://github.com/cosmos/cosmos-sdk/pull/9112) fix AddressFromBalancesStore address length overflow -* (x/bank) [#9229](https://github.com/cosmos/cosmos-sdk/pull/9229) Now zero coin balances cannot be added to balances & supply stores. If any denom becomes zero corresponding key gets deleted from store. State migration: [#9664](https://github.com/cosmos/cosmos-sdk/pull/9664). -* [#9363](https://github.com/cosmos/cosmos-sdk/pull/9363) Check store key uniqueness in app wiring. -* [#9460](https://github.com/cosmos/cosmos-sdk/pull/9460) Fix lint error in `MigratePrefixAddress`. -* [#9480](https://github.com/cosmos/cosmos-sdk/pull/9480) Fix added keys when using `--dry-run`. -* (types) [#9511](https://github.com/cosmos/cosmos-sdk/pull/9511) Change `maxBitLen` of `sdk.Int` and `sdk.Dec` to handle max ERC20 value. -* [#9454](https://github.com/cosmos/cosmos-sdk/pull/9454) Fix testnet command with --node-dir-prefix accepts `-` and change `node-dir-prefix token` to `testtoken`. -* (keyring) [#9562](https://github.com/cosmos/cosmos-sdk/pull/9563) fix keyring kwallet backend when using with empty wallet. -* (keyring) [#9583](https://github.com/cosmos/cosmos-sdk/pull/9583) Fix correct population of legacy `Vote.Option` field for votes with 1 VoteOption of weight 1. -* (x/distinction) [#8918](https://github.com/cosmos/cosmos-sdk/pull/8918) Fix module's parameters validation. -* (x/gov/types) [#8586](https://github.com/cosmos/cosmos-sdk/pull/8586) Fix bug caused by NewProposal that unnecessarily creates a Proposal object that’s discarded on any error. -* [#8580](https://github.com/cosmos/cosmos-sdk/pull/8580) Use more cheaper method from the math/big package that provides a way to trivially check if a value is zero with .BitLen() == 0 -* [#8567](https://github.com/cosmos/cosmos-sdk/pull/8567) Fix bug by introducing pagination to GetValidatorSetByHeight response -* (x/bank) [#8531](https://github.com/cosmos/cosmos-sdk/pull/8531) Fix bug caused by ignoring errors returned by Balance.GetAddress() -* (server) [#8399](https://github.com/cosmos/cosmos-sdk/pull/8399) fix gRPC-web flag default value -* [#8282](https://github.com/cosmos/cosmos-sdk/pull/8282) fix zero time checks -* (cli) [#9593](https://github.com/cosmos/cosmos-sdk/pull/9593) Check if chain-id is blank before verifying signatures in multisign and error. -* [#9720](https://github.com/cosmos/cosmos-sdk/pull/9720) Feegrant grant cli granter now accepts key name as well as address in general and accepts only address in --generate-only mode -* [#9793](https://github.com/cosmos/cosmos-sdk/pull/9793) Fixed ECDSA/secp256r1 transaction malleability. -* (server) [#9704](https://github.com/cosmos/cosmos-sdk/pull/9704) Start GRPCWebServer in goroutine, avoid blocking other services from starting. -* (bank) [#9687](https://github.com/cosmos/cosmos-sdk/issues/9687) fixes [#9159](https://github.com/cosmos/cosmos-sdk/issues/9159). Added migration to prune balances with zero coins. +* (baseapp) [#20346](https://github.com/cosmos/cosmos-sdk/pull/20346) Correctly assign `execModeSimulate` to context for `simulateTx`. +* (baseapp) [#20144](https://github.com/cosmos/cosmos-sdk/pull/20144) Remove txs from mempool when AnteHandler fails in recheck. +* (baseapp) [#20107](https://github.com/cosmos/cosmos-sdk/pull/20107) Avoid header height overwrite block height. +* (cli) [#20020](https://github.com/cosmos/cosmos-sdk/pull/20020) Make bootstrap-state command support both new and legacy genesis format. +* (testutil/sims) [#20151](https://github.com/cosmos/cosmos-sdk/pull/20151) Set all signatures and don't overwrite the previous one in `GenSignedMockTx`. -### Deprecated +## [v0.50.6](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.6) - 2024-04-22 -* (grpc) [#8926](https://github.com/cosmos/cosmos-sdk/pull/8926) The `tx` field in `SimulateRequest` has been deprecated, prefer to pass `tx_bytes` instead. -* (sdk types) [#9498](https://github.com/cosmos/cosmos-sdk/pull/9498) `clientContext.JSONCodec` will be removed in the next version. use `clientContext.Codec` instead. +### Features -## [v0.42.10](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.10) - 2021-09-28 +* (types) [#19759](https://github.com/cosmos/cosmos-sdk/pull/19759) Align SignerExtractionAdapter in PriorityNonceMempool Remove. +* (client) [#19870](https://github.com/cosmos/cosmos-sdk/pull/19870) Add new query command `wait-tx`. Alias `event-query-tx-for` to `wait-tx` for backward compatibility. ### Improvements -* (store) [#10026](https://github.com/cosmos/cosmos-sdk/pull/10026) Improve CacheKVStore datastructures / algorithms, to no longer take O(N^2) time when interleaving iterators and insertions. -* (store) [#10040](https://github.com/cosmos/cosmos-sdk/pull/10040) Bump IAVL to v0.17.1 which includes performance improvements on a batch load. -* [#10211](https://github.com/cosmos/cosmos-sdk/pull/10211) Backport of the mechanism to reject redundant IBC transactions from [ibc-go \#235](https://github.com/cosmos/ibc-go/pull/235). - -### Bug Fixes - -* [#9969](https://github.com/cosmos/cosmos-sdk/pull/9969) fix: use keyring in config for add-genesis-account cmd. - -### Client Breaking Changes - -* [#9879](https://github.com/cosmos/cosmos-sdk/pull/9879) Modify ABCI Queries to use `abci.QueryRequest` Height field if it is non-zero, otherwise continue using context height. - -### API Breaking Changes - -* [#10077](https://github.com/cosmos/cosmos-sdk/pull/10077) Remove telemetry on `GasKV` and `CacheKV` store Get/Set operations, significantly improving their performance. - -## [v0.42.9](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.9) - 2021-08-04 - -### Bug Fixes - -* [#9835](https://github.com/cosmos/cosmos-sdk/pull/9835) Moved capability initialization logic to BeginBlocker to fix nondeterminsim issue mentioned in [#9800](https://github.com/cosmos/cosmos-sdk/issues/9800). Applications must now include the capability module in their BeginBlocker order before any module that uses capabilities gets run. -* [#9201](https://github.com/cosmos/cosmos-sdk/pull/9201) Fixed ` init --recover` flag. - -### API Breaking Changes +* (telemetry) [#19903](https://github.com/cosmos/cosmos-sdk/pull/19903) Conditionally emit metrics based on enablement. + * **Introduction of `Now` Function**: Added a new function called `Now` to the telemetry package. It returns the current system time if telemetry is enabled, or a zero time if telemetry is not enabled. + * **Atomic Global Variable**: Implemented an atomic global variable to manage the state of telemetry's enablement. This ensures thread safety for the telemetry state. + * **Conditional Telemetry Emission**: All telemetry functions have been updated to emit metrics only when telemetry is enabled. They perform a check with `isTelemetryEnabled()` and return early if telemetry is disabled, minimizing unnecessary operations and overhead. +* (deps) [#19810](https://github.com/cosmos/cosmos-sdk/pull/19810) Upgrade prometheus version and fix API breaking change due to prometheus bump. +* (deps) [#19810](https://github.com/cosmos/cosmos-sdk/pull/19810) Bump `cosmossdk.io/store` to v1.1.0. +* (server) [#19884](https://github.com/cosmos/cosmos-sdk/pull/19884) Add start customizability to start command options. +* (x/gov) [#19853](https://github.com/cosmos/cosmos-sdk/pull/19853) Emit `depositor` in `EventTypeProposalDeposit`. +* (x/gov) [#19844](https://github.com/cosmos/cosmos-sdk/pull/19844) Emit the proposer of governance proposals. +* (baseapp) [#19616](https://github.com/cosmos/cosmos-sdk/pull/19616) Don't share gas meter in tx execution. -* [#9835](https://github.com/cosmos/cosmos-sdk/pull/9835) The `InitializeAndSeal` API has not changed, however it no longer initializes the in-memory state. `InitMemStore` has been introduced to serve this function, which will be called either in `InitChain` or `BeginBlock` (whichever is first after app start). Nodes may run this version on a network running 0.42.x, however, they must update their app.go files to include the capability module in their begin blockers. +## Bug Fixes -### Client Breaking Changes - -* [#9781](https://github.com/cosmos/cosmos-sdk/pull/9781) Improve`withdraw-all-rewards` UX when broadcast mode `async` or `async` is used. +* (x/authz) [#20114](https://github.com/cosmos/cosmos-sdk/pull/20114) Follow up of [GHSA-4j93-fm92-rp4m](https://github.com/cosmos/cosmos-sdk/security/advisories/GHSA-4j93-fm92-rp4m) for `x/authz`. +* (crypto) [#19691](https://github.com/cosmos/cosmos-sdk/pull/19745) Fix tx sign doesn't throw an error when incorrect Ledger is used. +* (baseapp) [#19970](https://github.com/cosmos/cosmos-sdk/pull/19970) Fix default config values to use no-op mempool as default. +* (crypto) [#20027](https://github.com/cosmos/cosmos-sdk/pull/20027) secp256r1 keys now implement gogoproto's customtype interface. +* (x/bank) [#20028](https://github.com/cosmos/cosmos-sdk/pull/20028) Align query with multi denoms for send-enabled. -## [v0.42.8](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.8) - 2021-07-30 +## [v0.50.5](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.5) - 2024-03-12 ### Features -* [#9750](https://github.com/cosmos/cosmos-sdk/pull/9750) Emit events for tx signature and sequence, so clients can now query txs by signature (`tx.signature=''`) or by address and sequence combo (`tx.acc_seq='/'`). +* (baseapp) [#19626](https://github.com/cosmos/cosmos-sdk/pull/19626) Add `DisableBlockGasMeter` option to `BaseApp`, which removes the block gas meter during transaction execution. ### Improvements -* (cli) [#9717](https://github.com/cosmos/cosmos-sdk/pull/9717) Added CLI flag `--output json/text` to `tx` cli commands. +* (x/distribution) [#19707](https://github.com/cosmos/cosmos-sdk/pull/19707) Add autocli config for `DelegationTotalRewards` for CLI consistency with `q rewards` commands in previous versions. +* (x/auth) [#19651](https://github.com/cosmos/cosmos-sdk/pull/19651) Allow empty public keys in `GetSignBytesAdapter`. ### Bug Fixes -* [#9766](https://github.com/cosmos/cosmos-sdk/pull/9766) Fix hardcoded ledger signing algorithm on `keys add` command. - -## [v0.42.7](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.7) - 2021-07-09 - -### Improvements - -* (baseapp) [#9578](https://github.com/cosmos/cosmos-sdk/pull/9578) Return `Baseapp`'s `trace` value for logging error stack traces. +* (x/gov) [#19725](https://github.com/cosmos/cosmos-sdk/pull/19725) Fetch a failed proposal tally from proposal.FinalTallyResult in the gprc query. +* (types) [#19709](https://github.com/cosmos/cosmos-sdk/pull/19709) Fix skip staking genesis export when using `CoreAppModuleAdaptor` / `CoreAppModuleBasicAdaptor` for it. +* (x/auth) [#19549](https://github.com/cosmos/cosmos-sdk/pull/19549) Accept custom get signers when injecting `x/auth/tx`. +* (x/staking) Fix a possible bypass of delegator slashing: [GHSA-86h5-xcpx-cfqc](https://github.com/cosmos/cosmos-sdk/security/advisories/GHSA-86h5-xcpx-cfqc) +* (baseapp) Fix a bug in `baseapp.ValidateVoteExtensions` helper ([GHSA-95rx-m9m5-m94v](https://github.com/cosmos/cosmos-sdk/security/advisories/GHSA-95rx-m9m5-m94v)). The helper has been fixed and for avoiding API breaking changes `currentHeight` and `chainID` arguments are ignored. Those arguments are removed from the helper in v0.51+. -### Bug Fixes +## [v0.50.4](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.4) - 2024-02-19 -* (x/ibc) [#9640](https://github.com/cosmos/cosmos-sdk/pull/9640) Fix IBC Transfer Ack Success event as it was initially emitting opposite value. -* [#9645](https://github.com/cosmos/cosmos-sdk/pull/9645) Use correct Prometheus format for metric labels. -* [#9299](https://github.com/cosmos/cosmos-sdk/pull/9299) Fix `[appd] keys parse cosmos1...` freezing. -* (keyring) [#9563](https://github.com/cosmos/cosmos-sdk/pull/9563) fix keyring kwallet backend when using with empty wallet. -* (x/capability) [#9392](https://github.com/cosmos/cosmos-sdk/pull/9392) initialization fix, which fixes the consensus error when using statesync. +### Features -## [v0.42.6](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.6) - 2021-06-18 +* (server) [#19280](https://github.com/cosmos/cosmos-sdk/pull/19280) Adds in-place testnet CLI command. ### Improvements -* [#9428](https://github.com/cosmos/cosmos-sdk/pull/9428) Optimize bank InitGenesis. Added `k.initBalances`. -* [#9429](https://github.com/cosmos/cosmos-sdk/pull/9429) Add `cosmos_sdk_version` to node_info -* [#9541](https://github.com/cosmos/cosmos-sdk/pull/9541) Bump tendermint dependency to v0.34.11. +* (client) [#19393](https://github.com/cosmos/cosmos-sdk/pull/19393/) Add `ReadDefaultValuesFromDefaultClientConfig` to populate the default values from the default client config in client.Context without creating a app folder. ### Bug Fixes -* [#9385](https://github.com/cosmos/cosmos-sdk/pull/9385) Fix IBC `query ibc client header` cli command. Support historical queries for query header/node-state commands. -* [#9401](https://github.com/cosmos/cosmos-sdk/pull/9401) Fixes incorrect export of IBC identifier sequences. Previously, the next identifier sequence for clients/connections/channels was not set during genesis export. This resulted in the next identifiers being generated on the new chain to reuse old identifiers (the sequences began again from 0). -* [#9408](https://github.com/cosmos/cosmos-sdk/pull/9408) Update simapp to use correct default broadcast mode. -* [#9513](https://github.com/cosmos/cosmos-sdk/pull/9513) Fixes testnet CLI command. Testnet now updates the supply in genesis. Previously, when using add-genesis-account and testnet together, inconsistent genesis files would be produced, as only add-genesis-account was updating the supply. -* (x/gov) [#8813](https://github.com/cosmos/cosmos-sdk/pull/8813) fix `GET /cosmos/gov/v1beta1/proposals/{proposal_id}/deposits` to include initial deposit +* (x/auth/vesting) [GHSA-4j93-fm92-rp4m](#bug-fixes) Add `BlockedAddr` check in `CreatePeriodicVestingAccount`. +* (baseapp) [#19338](https://github.com/cosmos/cosmos-sdk/pull/19338) Set HeaderInfo in context when calling `setState`. +* (baseapp): [#19200](https://github.com/cosmos/cosmos-sdk/pull/19200) Ensure that sdk side ve math matches cometbft. +* [#19106](https://github.com/cosmos/cosmos-sdk/pull/19106) Allow empty public keys when setting signatures. Public keys aren't needed for every transaction. +* (baseapp) [#19198](https://github.com/cosmos/cosmos-sdk/pull/19198) Remove usage of pointers in logs in all optimistic execution goroutines. +* (baseapp) [#19177](https://github.com/cosmos/cosmos-sdk/pull/19177) Fix baseapp `DefaultProposalHandler` same-sender non-sequential sequence. +* (crypto) [#19371](https://github.com/cosmos/cosmos-sdk/pull/19371) Avoid CLI redundant log in stdout, log to stderr instead. -### Features - -* [#9383](https://github.com/cosmos/cosmos-sdk/pull/9383) New CLI command `query ibc-transfer escrow-address ` to get the escrow address for a channel; can be used to then query balance of escrowed tokens -* (baseapp, types) [#9390](https://github.com/cosmos/cosmos-sdk/pull/9390) Add current block header hash to `Context` -* (store) [#9403](https://github.com/cosmos/cosmos-sdk/pull/9403) Add `RefundGas` function to `GasMeter` interface - -## [v0.42.5](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.5) - 2021-05-18 - -### Bug Fixes - -* [#9514](https://github.com/cosmos/cosmos-sdk/issues/9514) Fix panic when retrieving the `BlockGasMeter` on `(Re)CheckTx` mode. -* [#9235](https://github.com/cosmos/cosmos-sdk/pull/9235) CreateMembershipProof/CreateNonMembershipProof now returns an error - if input key is empty, or input data contains empty key. -* [#9108](https://github.com/cosmos/cosmos-sdk/pull/9108) Fixed the bug with querying multisig account, which is not showing threshold and public_keys. -* [#9345](https://github.com/cosmos/cosmos-sdk/pull/9345) Fix ARM support. -* [#9040](https://github.com/cosmos/cosmos-sdk/pull/9040) Fix ENV variables binding to CLI flags for client config. +## [v0.50.3](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.3) - 2024-01-15 ### Features -* [#8953](https://github.com/cosmos/cosmos-sdk/pull/8953) Add the `config` CLI subcommand back to the SDK, which saves client-side configuration in a `client.toml` file. - -## [v0.42.4](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.4) - 2021-04-08 - -### Client Breaking Changes - -* [#9026](https://github.com/cosmos/cosmos-sdk/pull/9026) By default, the `tx sign` and `tx sign-batch` CLI commands use SIGN_MODE_DIRECT to sign transactions for local pubkeys. For multisigs and ledger keys, the default LEGACY_AMINO_JSON is used. - -### Bug Fixes - -* (gRPC) [#9015](https://github.com/cosmos/cosmos-sdk/pull/9015) Fix invalid status code when accessing gRPC endpoints. -* [#9026](https://github.com/cosmos/cosmos-sdk/pull/9026) Fixed the bug that caused the `gentx` command to fail for Ledger keys. - -### Improvements - -* [#9081](https://github.com/cosmos/cosmos-sdk/pull/9081) Upgrade Tendermint to v0.34.9 that includes a security issue fix for Tendermint light clients. - -## [v0.42.3](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.3) - 2021-03-24 - -This release fixes a security vulnerability identified in x/bank. - -## [v0.42.2](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.2) - 2021-03-19 +* (types) [#18991](https://github.com/cosmos/cosmos-sdk/pull/18991) Add SignerExtractionAdapter to PriorityNonceMempool/Config and provide Default implementation matching existing behavior. +* (gRPC) [#19043](https://github.com/cosmos/cosmos-sdk/pull/19043) Add `halt_height` to the gRPC `/cosmos/base/node/v1beta1/config` request. ### Improvements -* (grpc) [#8815](https://github.com/cosmos/cosmos-sdk/pull/8815) Add orderBy parameter to `TxsByEvents` endpoint. -* (cli) [#8826](https://github.com/cosmos/cosmos-sdk/pull/8826) Add trust to macOS Keychain for caller app by default. -* (store) [#8811](https://github.com/cosmos/cosmos-sdk/pull/8811) store/cachekv: use typed types/kv.List instead of container/list.List +* (x/bank) [#18956](https://github.com/cosmos/cosmos-sdk/pull/18956) Introduced a new `DenomOwnersByQuery` query method for `DenomOwners`, which accepts the denom value as a query string parameter, resolving issues with denoms containing slashes. +* (x/gov) [#18707](https://github.com/cosmos/cosmos-sdk/pull/18707) Improve genesis validation. +* (x/auth/tx) [#18772](https://github.com/cosmos/cosmos-sdk/pull/18772) Remove misleading gas wanted from tx simulation failure log. +* (client/tx) [#18852](https://github.com/cosmos/cosmos-sdk/pull/18852) Add `WithFromName` to tx factory. +* (types) [#18888](https://github.com/cosmos/cosmos-sdk/pull/18888) Speedup DecCoin.Sort() if len(coins) <= 1 +* (types) [#18875](https://github.com/cosmos/cosmos-sdk/pull/18875) Speedup coins.Sort() if len(coins) <= 1 +* (baseapp) [#18915](https://github.com/cosmos/cosmos-sdk/pull/18915) Add a new `ExecModeVerifyVoteExtension` exec mode and ensure it's populated in the `Context` during `VerifyVoteExtension` execution. +* (testutil) [#18930](https://github.com/cosmos/cosmos-sdk/pull/18930) Add NodeURI for clientCtx. ### Bug Fixes -* (crypto) [#8841](https://github.com/cosmos/cosmos-sdk/pull/8841) Fix legacy multisig amino marshaling, allowing migrations to work between v0.39 and v0.40+. -* (cli tx) [\8873](https://github.com/cosmos/cosmos-sdk/pull/8873) add missing `--output-document` option to `app tx multisign-batch`. - -## [v0.42.1](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.1) - 2021-03-10 - -This release fixes security vulnerability identified in the simapp. - -## [v0.42.0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.0) - 2021-03-08 - -**IMPORTANT**: This release contains an important security fix for all non Cosmos Hub chains running Stargate version of the Cosmos SDK (>0.40). Non-hub chains should not be using any version of the SDK in the v0.40.x or v0.41.x release series. See [#8461](https://github.com/cosmos/cosmos-sdk/pull/8461) for more details. - -### Improvements - -* (x/ibc) [#8624](https://github.com/cosmos/cosmos-sdk/pull/8624) Emit full header in IBC UpdateClient message. -* (x/crisis) [#8621](https://github.com/cosmos/cosmos-sdk/issues/8621) crisis invariants names now print to loggers. - -### Bug fixes - -* (x/evidence) [#8461](https://github.com/cosmos/cosmos-sdk/pull/8461) Fix bech32 prefix in evidence validator address conversion -* (x/gov) [#8806](https://github.com/cosmos/cosmos-sdk/issues/8806) Fix q gov proposals command's mishandling of the --status parameter's values. +* (baseapp) [#19058](https://github.com/cosmos/cosmos-sdk/pull/19058) Fix baseapp posthandler branch would fail if the `runMsgs` had returned an error. +* (baseapp) [#18609](https://github.com/cosmos/cosmos-sdk/issues/18609) Fixed accounting in the block gas meter after module's beginBlock and before DeliverTx, ensuring transaction processing always starts with the expected zeroed out block gas meter. +* (baseapp) [#18895](https://github.com/cosmos/cosmos-sdk/pull/18895) Fix de-duplicating vote extensions during validation in ValidateVoteExtensions. -## [v0.41.4](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.41.3) - 2021-03-02 - -**IMPORTANT**: Due to a bug in the v0.41.x series with how evidence handles validator consensus addresses #8461, SDK based chains that are not using the default bech32 prefix (cosmos, aka all chains except for t -he Cosmos Hub) should not use this release or any release in the v0.41.x series. Please see #8668 for tracking & timeline for the v0.42.0 release, which will include a fix for this issue. +## [v0.50.2](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.2) - 2023-12-11 ### Features -* [#7787](https://github.com/cosmos/cosmos-sdk/pull/7787) Add multisign-batch command. - -### Bug fixes - -* [#8730](https://github.com/cosmos/cosmos-sdk/pull/8730) Allow REST endpoint to query txs with multisig addresses. -* [#8680](https://github.com/cosmos/cosmos-sdk/issues/8680) Fix missing timestamp in GetTxsEvent response [#8732](https://github.com/cosmos/cosmos-sdk/pull/8732). -* [#8681](https://github.com/cosmos/cosmos-sdk/issues/8681) Fix missing error message when calling GetTxsEvent [#8732](https://github.com/cosmos/cosmos-sdk/pull/8732) -* (server) [#8641](https://github.com/cosmos/cosmos-sdk/pull/8641) Fix Tendermint and application configuration reading from file -* (client/keys) [#8639](https://github.com/cosmos/cosmos-sdk/pull/8639) Fix keys migrate for mulitisig, offline, and ledger keys. The migrate command now takes a positional old_home_dir argument. +* (debug) [#18219](https://github.com/cosmos/cosmos-sdk/pull/18219) Add debug commands for application codec types. +* (client/keys) [#17639](https://github.com/cosmos/cosmos-sdk/pull/17639) Allows using and saving public keys encoded as base64. +* (server) [#17094](https://github.com/cosmos/cosmos-sdk/pull/17094) Add a `shutdown-grace` flag for waiting a given time before exit. ### Improvements -* (store/cachekv), (x/bank/types) [#8719](https://github.com/cosmos/cosmos-sdk/pull/8719) algorithmically fix pathologically slow code -* [#8701](https://github.com/cosmos/cosmos-sdk/pull/8701) Upgrade tendermint v0.34.8. -* [#8714](https://github.com/cosmos/cosmos-sdk/pull/8714) Allow accounts to have a balance of 0 at genesis. - -## [v0.41.3](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.41.3) - 2021-02-18 +* (telemetry) [#18646] (https://github.com/cosmos/cosmos-sdk/pull/18646) Enable statsd and dogstatsd telemetry sinks. +* (server) [#18478](https://github.com/cosmos/cosmos-sdk/pull/18478) Add command flag to disable colored logs. +* (x/gov) [#18025](https://github.com/cosmos/cosmos-sdk/pull/18025) Improve ` q gov proposer` by querying directly a proposal instead of tx events. It is an alias of `q gov proposal` as the proposer is a field of the proposal. +* (version) [#18063](https://github.com/cosmos/cosmos-sdk/pull/18063) Allow to define extra info to be displayed in ` version --long` command. +* (codec/unknownproto)[#18541](https://github.com/cosmos/cosmos-sdk/pull/18541) Remove the use of "protoc-gen-gogo/descriptor" in favour of using the official protobuf descriptorpb types inside unknownproto. ### Bug Fixes -* [#8617](https://github.com/cosmos/cosmos-sdk/pull/8617) Fix build failures caused by a small API breakage introduced in tendermint v0.34.7. +* (x/auth) [#18564](https://github.com/cosmos/cosmos-sdk/pull/18564) Fix total fees calculation when batch signing. +* (server) [#18537](https://github.com/cosmos/cosmos-sdk/pull/18537) Fix panic when defining minimum gas config as `100stake;100uatom`. Use a `,` delimiter instead of `;`. Fixes the server config getter to use the correct delimiter. +* [#18531](https://github.com/cosmos/cosmos-sdk/pull/18531) Baseapp's `GetConsensusParams` returns an empty struct instead of panicking if no params are found. +* (client/tx) [#18472](https://github.com/cosmos/cosmos-sdk/pull/18472) Utilizes the correct Pubkey when simulating a transaction. +* (baseapp) [#18486](https://github.com/cosmos/cosmos-sdk/pull/18486) Fixed FinalizeBlock calls not being passed to ABCIListeners. +* (baseapp) [#18627](https://github.com/cosmos/cosmos-sdk/pull/18627) Post handlers are run on non successful transaction executions too. +* (baseapp) [#18654](https://github.com/cosmos/cosmos-sdk/pull/18654) Fixes an issue in which `gogoproto.Merge` does not work with gogoproto messages with custom types. -## [v0.41.2](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.41.2) - 2021-02-18 +## [v0.50.1](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.1) - 2023-11-07 -### Improvements - -* Bump tendermint dependency to v0.34.7. - -## [v0.41.1](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.41.1) - 2021-02-17 - -### Bug Fixes - -* (grpc) [#8549](https://github.com/cosmos/cosmos-sdk/pull/8549) Make gRPC requests go through ABCI and disallow concurrency. -* (x/staking) [#8546](https://github.com/cosmos/cosmos-sdk/pull/8546) Fix caching bug where concurrent calls to GetValidator could cause a node to crash -* (server) [#8481](https://github.com/cosmos/cosmos-sdk/pull/8481) Don't create files when running `{appd} tendermint show-*` subcommands. -* (client/keys) [#8436](https://github.com/cosmos/cosmos-sdk/pull/8436) Fix keybase->keyring keys migration. -* (crypto/hd) [#8607](https://github.com/cosmos/cosmos-sdk/pull/8607) Make DerivePrivateKeyForPath error and not panic on trailing slashes. - -### Improvements +> v0.50.0 has been retracted due to a mistake in tagging the release. Please use v0.50.1 instead. -* (x/ibc) [#8458](https://github.com/cosmos/cosmos-sdk/pull/8458) Add `packet_connection` attribute to ibc events to enable relayer filtering -* [#8396](https://github.com/cosmos/cosmos-sdk/pull/8396) Add support for ARM platform -* (x/bank) [#8479](https://github.com/cosmos/cosmos-sdk/pull/8479) Aditional client denom metadata validation for `base` and `display` denoms. -* (codec/types) [#8605](https://github.com/cosmos/cosmos-sdk/pull/8605) Avoid unnecessary allocations for NewAnyWithCustomTypeURL on error. +### Features -## [v0.41.0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.41.0) - 2021-01-26 +* (baseapp) [#18071](https://github.com/cosmos/cosmos-sdk/pull/18071) Add hybrid handlers to `MsgServiceRouter`. +* (server) [#18162](https://github.com/cosmos/cosmos-sdk/pull/18162) Start gRPC & API server in standalone mode. +* (baseapp & types) [#17712](https://github.com/cosmos/cosmos-sdk/pull/17712) Introduce `PreBlock`, which runs before begin blocker other modules, and allows to modify consensus parameters, and the changes are visible to the following state machine logics. Additionally it can be used for vote extensions. +* (genutil) [#17571](https://github.com/cosmos/cosmos-sdk/pull/17571) Allow creation of `AppGenesis` without a file lookup. +* (codec) [#17042](https://github.com/cosmos/cosmos-sdk/pull/17042) Add `CollValueV2` which supports encoding of protov2 messages in collections. +* (x/gov) [#16976](https://github.com/cosmos/cosmos-sdk/pull/16976) Add `failed_reason` field to `Proposal` under `x/gov` to indicate the reason for a failed proposal. Referenced from [#238](https://github.com/bnb-chain/greenfield-cosmos-sdk/pull/238) under `bnb-chain/greenfield-cosmos-sdk`. +* (baseapp) [#16898](https://github.com/cosmos/cosmos-sdk/pull/16898) Add `preFinalizeBlockHook` to allow vote extensions persistence. +* (cli) [#16887](https://github.com/cosmos/cosmos-sdk/pull/16887) Add two new CLI commands: ` tx simulate` for simulating a transaction; ` query block-results` for querying CometBFT RPC for block results. +* (x/bank) [#16852](https://github.com/cosmos/cosmos-sdk/pull/16852) Add `DenomMetadataByQueryString` query in bank module to support metadata query by query string. +* (baseapp) [#16581](https://github.com/cosmos/cosmos-sdk/pull/16581) Implement Optimistic Execution as an experimental feature (not enabled by default). +* (types) [#16257](https://github.com/cosmos/cosmos-sdk/pull/16257) Allow setting the base denom in the denom registry. +* (baseapp) [#16239](https://github.com/cosmos/cosmos-sdk/pull/16239) Add Gas Limits to allow node operators to resource bound queries. +* (cli) [#16209](https://github.com/cosmos/cosmos-sdk/pull/16209) Make `StartCmd` more customizable. +* (types/simulation) [#16074](https://github.com/cosmos/cosmos-sdk/pull/16074) Add generic SimulationStoreDecoder for modules using collections. +* (genutil) [#16046](https://github.com/cosmos/cosmos-sdk/pull/16046) Add "module-name" flag to genutil `add-genesis-account` to enable intializing module accounts at genesis.* [#15970](https://github.com/cosmos/cosmos-sdk/pull/15970) Enable SIGN_MODE_TEXTUAL. +* (types) [#15958](https://github.com/cosmos/cosmos-sdk/pull/15958) Add `module.NewBasicManagerFromManager` for creating a basic module manager from a module manager. +* (types/module) [#15829](https://github.com/cosmos/cosmos-sdk/pull/15829) Add new endblocker interface to handle valset updates. +* (runtime) [#15818](https://github.com/cosmos/cosmos-sdk/pull/15818) Provide logger through `depinject` instead of appBuilder. +* (types) [#15735](https://github.com/cosmos/cosmos-sdk/pull/15735) Make `ValidateBasic() error` method of `Msg` interface optional. Modules should validate messages directly in their message handlers ([RFC 001](https://docs.cosmos.network/main/rfc/rfc-001-tx-validation)). +* (x/genutil) [#15679](https://github.com/cosmos/cosmos-sdk/pull/15679) Allow applications to specify a custom genesis migration function for the `genesis migrate` command. +* (telemetry) [#15657](https://github.com/cosmos/cosmos-sdk/pull/15657) Emit more data (go version, sdk version, upgrade height) in prom metrics. +* (client) [#15597](https://github.com/cosmos/cosmos-sdk/pull/15597) Add status endpoint for clients. +* (testutil/integration) [#15556](https://github.com/cosmos/cosmos-sdk/pull/15556) Introduce `testutil/integration` package for module integration testing. +* (runtime) [#15547](https://github.com/cosmos/cosmos-sdk/pull/15547) Allow runtime to pass event core api service to modules. +* (client) [#15458](https://github.com/cosmos/cosmos-sdk/pull/15458) Add a `CmdContext` field to client.Context initialized to cobra command's context. +* (x/genutil) [#15301](https://github.com/cosmos/cosmos-sdk/pull/15031) Add application genesis. The genesis is now entirely managed by the application and passed to CometBFT at note instantiation. Functions that were taking a `cmttypes.GenesisDoc{}` now takes a `genutiltypes.AppGenesis{}`. +* (core) [#15133](https://github.com/cosmos/cosmos-sdk/pull/15133) Implement RegisterServices in the module manager. +* (x/bank) [#14894](https://github.com/cosmos/cosmos-sdk/pull/14894) Return a human readable denomination for IBC vouchers when querying bank balances. Added a `ResolveDenom` parameter to `types.QueryAllBalancesRequest` and `--resolve-denom` flag to `GetBalancesCmd()`. +* (core) [#14860](https://github.com/cosmos/cosmos-sdk/pull/14860) Add `Precommit` and `PrepareCheckState` AppModule callbacks. +* (x/gov) [#14720](https://github.com/cosmos/cosmos-sdk/pull/14720) Upstream expedited proposals from Osmosis. +* (cli) [#14659](https://github.com/cosmos/cosmos-sdk/pull/14659) Added ability to query blocks by events with queries directly passed to Tendermint, which will allow for full query operator support, e.g. `>`. +* (x/auth) [#14650](https://github.com/cosmos/cosmos-sdk/pull/14650) Add Textual SignModeHandler. Enable `SIGN_MODE_TEXTUAL` by following the [UPGRADING.md](./UPGRADING.md) instructions. +* (x/crisis) [#14588](https://github.com/cosmos/cosmos-sdk/pull/14588) Use CacheContext() in AssertInvariants(). +* (mempool) [#14484](https://github.com/cosmos/cosmos-sdk/pull/14484) Add priority nonce mempool option for transaction replacement. +* (query) [#14468](https://github.com/cosmos/cosmos-sdk/pull/14468) Implement pagination for collections. +* (x/gov) [#14373](https://github.com/cosmos/cosmos-sdk/pull/14373) Add new proto field `constitution` of type `string` to gov module genesis state, which allows chain builders to lay a strong foundation by specifying purpose. +* (client) [#14342](https://github.com/cosmos/cosmos-sdk/pull/14342) Add ` config` command is now a sub-command, for setting, getting and migrating Cosmos SDK configuration files. +* (x/distribution) [#14322](https://github.com/cosmos/cosmos-sdk/pull/14322) Introduce a new gRPC message handler, `DepositValidatorRewardsPool`, that allows explicit funding of a validator's reward pool. +* (x/bank) [#14224](https://github.com/cosmos/cosmos-sdk/pull/14224) Allow injection of restrictions on transfers using `AppendSendRestriction` or `PrependSendRestriction`. + +### Improvements + +* (x/gov) [#18189](https://github.com/cosmos/cosmos-sdk/pull/18189) Limit the accepted deposit coins for a proposal to the minimum proposal deposit denoms. +* (x/staking) [#18049](https://github.com/cosmos/cosmos-sdk/pull/18049) Return early if Slash encounters zero tokens to burn. +* (x/staking) [#18035](https://github.com/cosmos/cosmos-sdk/pull/18035) Hoisted out of the redelegation loop, the non-changing validator and delegator addresses parsing. +* (keyring) [#17913](https://github.com/cosmos/cosmos-sdk/pull/17913) Add `NewAutoCLIKeyring` for creating an AutoCLI keyring from a SDK keyring. +* (x/consensus) [#18041](https://github.com/cosmos/cosmos-sdk/pull/18041) Let `ToProtoConsensusParams()` return an error. +* (x/gov) [#17780](https://github.com/cosmos/cosmos-sdk/pull/17780) Recover panics and turn them into errors when executing x/gov proposals. +* (baseapp) [#17667](https://github.com/cosmos/cosmos-sdk/pull/17667) Close databases opened by SDK in `baseApp.Close()`. +* (types/module) [#17554](https://github.com/cosmos/cosmos-sdk/pull/17554) Introduce `HasABCIGenesis` which is implemented by a module only when a validatorset update needs to be returned. +* (cli) [#17389](https://github.com/cosmos/cosmos-sdk/pull/17389) gRPC CometBFT commands have been added under ` q consensus comet`. CometBFT commands placement in the SDK has been simplified. See the exhaustive list below. + * `client/rpc.StatusCommand()` is now at `server.StatusCommand()` +* (testutil) [#17216](https://github.com/cosmos/cosmos-sdk/issues/17216) Add `DefaultContextWithKeys` to `testutil` package. +* (cli) [#17187](https://github.com/cosmos/cosmos-sdk/pull/17187) Do not use `ctx.PrintObjectLegacy` in commands anymore. + * ` q gov proposer [proposal-id]` now returns a proposal id as int instead of string. +* (x/staking) [#17164](https://github.com/cosmos/cosmos-sdk/pull/17164) Add `BondedTokensAndPubKeyByConsAddr` to the keeper to enable vote extension verification. +* (x/group, x/gov) [#17109](https://github.com/cosmos/cosmos-sdk/pull/17109) Let proposal summary be 40x longer than metadata limit. +* (version) [#17096](https://github.com/cosmos/cosmos-sdk/pull/17096) Improve `getSDKVersion()` to handle module replacements. +* (types) [#16890](https://github.com/cosmos/cosmos-sdk/pull/16890) Remove `GetTxCmd() *cobra.Command` and `GetQueryCmd() *cobra.Command` from `module.AppModuleBasic` interface. +* (x/authz) [#16869](https://github.com/cosmos/cosmos-sdk/pull/16869) Improve error message when grant not found. +* (all) [#16497](https://github.com/cosmos/cosmos-sdk/pull/16497) Removed all exported vestiges of `sdk.MustSortJSON` and `sdk.SortJSON`. +* (server) [#16238](https://github.com/cosmos/cosmos-sdk/pull/16238) Don't setup p2p node keys if starting a node in GRPC only mode. +* (cli) [#16206](https://github.com/cosmos/cosmos-sdk/pull/16206) Make ABCI handshake profileable. +* (types) [#16076](https://github.com/cosmos/cosmos-sdk/pull/16076) Optimize `ChainAnteDecorators`/`ChainPostDecorators` to instantiate the functions once instead of on every invocation of the returned `AnteHandler`/`PostHandler`. +* (server) [#16071](https://github.com/cosmos/cosmos-sdk/pull/16071) When `mempool.max-txs` is set to a negative value, use a no-op mempool (effectively disable the app mempool). +* (types/query) [#16041](https://github.com/cosmos/cosmos-sdk/pull/16041) Change pagination max limit to a variable in order to be modifed by application devs. +* (simapp) [#15958](https://github.com/cosmos/cosmos-sdk/pull/15958) Refactor SimApp for removing the global basic manager. +* (all modules) [#15901](https://github.com/cosmos/cosmos-sdk/issues/15901) All core Cosmos SDK modules query commands have migrated to [AutoCLI](https://docs.cosmos.network/main/core/autocli), ensuring parity between gRPC and CLI queries. +* (x/auth) [#15867](https://github.com/cosmos/cosmos-sdk/pull/15867) Support better logging for signature verification failure. +* (store/cachekv) [#15767](https://github.com/cosmos/cosmos-sdk/pull/15767) Reduce peak RAM usage during and after `InitGenesis`. +* (x/bank) [#15764](https://github.com/cosmos/cosmos-sdk/pull/15764) Speedup x/bank `InitGenesis`. +* (x/slashing) [#15580](https://github.com/cosmos/cosmos-sdk/pull/15580) Refactor the validator's missed block signing window to be a chunked bitmap instead of a "logical" bitmap, significantly reducing the storage footprint. +* (x/gov) [#15554](https://github.com/cosmos/cosmos-sdk/pull/15554) Add proposal result log in `active_proposal` event. When a proposal passes but fails to execute, the proposal result is logged in the `active_proposal` event. +* (x/consensus) [#15553](https://github.com/cosmos/cosmos-sdk/pull/15553) Migrate consensus module to use collections. +* (server) [#15358](https://github.com/cosmos/cosmos-sdk/pull/15358) Add `server.InterceptConfigsAndCreateContext` as alternative to `server.InterceptConfigsPreRunHandler` which does not set the server context and the default SDK logger. +* (mempool) [#15328](https://github.com/cosmos/cosmos-sdk/pull/15328) Improve the `PriorityNonceMempool`: + * Support generic transaction prioritization, instead of `ctx.Priority()` + * Improve construction through the use of a single `PriorityNonceMempoolConfig` instead of option functions +* (x/authz) [#15164](https://github.com/cosmos/cosmos-sdk/pull/15164) Add `MsgCancelUnbondingDelegation` to staking authorization. +* (server) [#15041](https://github.com/cosmos/cosmos-sdk/pull/15041) Remove unnecessary sleeps from gRPC and API server initiation. The servers will start and accept requests as soon as they're ready. +* (baseapp) [#15023](https://github.com/cosmos/cosmos-sdk/pull/15023) & [#15213](https://github.com/cosmos/cosmos-sdk/pull/15213) Add `MessageRouter` interface to baseapp and pass it to authz, gov and groups instead of concrete type. +* [#15011](https://github.com/cosmos/cosmos-sdk/pull/15011) Introduce `cosmossdk.io/log` package to provide a consistent logging interface through the SDK. CometBFT logger is now replaced by `cosmossdk.io/log.Logger`. +* (x/staking) [#14864](https://github.com/cosmos/cosmos-sdk/pull/14864) ` tx staking create-validator` CLI command now takes a json file as an arg instead of using required flags. +* (x/auth) [#14758](https://github.com/cosmos/cosmos-sdk/pull/14758) Allow transaction event queries to directly passed to Tendermint, which will allow for full query operator support, e.g. `>`. +* (x/evidence) [#14757](https://github.com/cosmos/cosmos-sdk/pull/14757) Evidence messages do not need to implement a `.Type()` anymore. +* (x/auth/tx) [#14751](https://github.com/cosmos/cosmos-sdk/pull/14751) Remove `.Type()` and `Route()` methods from all msgs and `legacytx.LegacyMsg` interface. +* (cli) [#14659](https://github.com/cosmos/cosmos-sdk/pull/14659) Added ability to query blocks by either height/hash ` q block --type=height|hash `. +* (x/staking) [#14590](https://github.com/cosmos/cosmos-sdk/pull/14590) Return undelegate amount in MsgUndelegateResponse. +* [#14529](https://github.com/cosmos/cosmos-sdk/pull/14529) Add new property `BondDenom` to `SimulationState` struct. +* (store) [#14439](https://github.com/cosmos/cosmos-sdk/pull/14439) Remove global metric gatherer from store. + * By default store has a no op metric gatherer, the application developer must set another metric gatherer or us the provided one in `store/metrics`. +* (store) [#14438](https://github.com/cosmos/cosmos-sdk/pull/14438) Pass logger from baseapp to store. +* (baseapp) [#14417](https://github.com/cosmos/cosmos-sdk/pull/14417) The store package no longer has a dependency on baseapp. +* (module) [#14415](https://github.com/cosmos/cosmos-sdk/pull/14415) Loosen assertions in SetOrderBeginBlockers() and SetOrderEndBlockers(). +* (store) [#14410](https://github.com/cosmos/cosmos-sdk/pull/14410) `rootmulti.Store.loadVersion` has validation to check if all the module stores' height is correct, it will error if any module store has incorrect height. +* [#14406](https://github.com/cosmos/cosmos-sdk/issues/14406) Migrate usage of `types/store.go` to `store/types/..`. +* (context)[#14384](https://github.com/cosmos/cosmos-sdk/pull/14384) Refactor(context): Pass EventManager to the context as an interface. +* (types) [#14354](https://github.com/cosmos/cosmos-sdk/pull/14354) Improve performance on Context.KVStore and Context.TransientStore by 40%. +* (crypto/keyring) [#14151](https://github.com/cosmos/cosmos-sdk/pull/14151) Move keys presentation from `crypto/keyring` to `client/keys` +* (signing) [#14087](https://github.com/cosmos/cosmos-sdk/pull/14087) Add SignModeHandlerWithContext interface with a new `GetSignBytesWithContext` to get the sign bytes using `context.Context` as an argument to access state. +* (server) [#14062](https://github.com/cosmos/cosmos-sdk/pull/14062) Remove rosetta from server start. +* (crypto) [#3129](https://github.com/cosmos/cosmos-sdk/pull/3129) New armor and keyring key derivation uses aead and encryption uses chacha20poly. ### State Machine Breaking -* (x/ibc) [#8266](https://github.com/cosmos/cosmos-sdk/issues/8266) Add amino JSON support for IBC MsgTransfer in order to support Ledger text signing transfer transactions. -* (x/ibc) [#8404](https://github.com/cosmos/cosmos-sdk/pull/8404) Reorder IBC `ChanOpenAck` and `ChanOpenConfirm` handler execution to perform core handler first, followed by application callbacks. - -### Bug Fixes - -* (simapp) [#8418](https://github.com/cosmos/cosmos-sdk/pull/8418) Add balance coin to supply when adding a new genesis account -* (x/bank) [#8417](https://github.com/cosmos/cosmos-sdk/pull/8417) Validate balances and coin denom metadata on genesis - -## [v0.40.1](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.40.1) - 2021-01-19 - -### Improvements - -* (x/bank) [#8302](https://github.com/cosmos/cosmos-sdk/issues/8302) Add gRPC and CLI queries for client denomination metadata. -* (tendermint) Bump Tendermint version to [v0.34.3](https://github.com/tendermint/tendermint/releases/tag/v0.34.3). - -### Bug Fixes - -* [#8085](https://github.com/cosmos/cosmos-sdk/pull/8058) fix zero time checks -* [#8280](https://github.com/cosmos/cosmos-sdk/pull/8280) fix GET /upgrade/current query -* (x/auth) [#8287](https://github.com/cosmos/cosmos-sdk/pull/8287) Fix `tx sign --signature-only` to return correct sequence value in signature. -* (build) [\8300](https://github.com/cosmos/cosmos-sdk/pull/8300), [\8301](https://github.com/cosmos/cosmos-sdk/pull/8301) Fix reproducible builds -* (types/errors) [#8355](https://github.com/cosmos/cosmos-sdk/pull/8355) Fix errorWrap `Is` method. -* (x/ibc) [#8341](https://github.com/cosmos/cosmos-sdk/pull/8341) Fix query latest consensus state. -* (proto) [#8350](https://github.com/cosmos/cosmos-sdk/pull/8350), [#8361](https://github.com/cosmos/cosmos-sdk/pull/8361) Update gogo proto deps with v1.3.2 security fixes -* (x/ibc) [#8359](https://github.com/cosmos/cosmos-sdk/pull/8359) Add missing UnpackInterfaces functions to IBC Query Responses. Fixes 'cannot unpack Any' error for IBC types. -* (x/bank) [#8317](https://github.com/cosmos/cosmos-sdk/pull/8317) Fix panic when querying for a not found client denomination metadata. - -## [v0.40.0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.40.0) - 2021-01-08 - -v0.40.0, known as the Stargate release of the Cosmos SDK, is one of the largest releases -of the Cosmos SDK since launch. Please read through this changelog and [release notes](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/RELEASE_NOTES.md) to make -sure you are aware of any relevant breaking changes. - -### Client Breaking Changes - -* **CLI** - * (client/keys) [#5889](https://github.com/cosmos/cosmos-sdk/pull/5889) remove `keys update` command. - * (x/auth) [#5844](https://github.com/cosmos/cosmos-sdk/pull/5844) `tx sign` command now returns an error when signing is attempted with offline/multisig keys. - * (x/auth) [#6108](https://github.com/cosmos/cosmos-sdk/pull/6108) `tx sign` command's `--validate-signatures` flag is migrated into a `tx validate-signatures` standalone command. - * (x/auth) [#7788](https://github.com/cosmos/cosmos-sdk/pull/7788) Remove `tx auth` subcommands, all auth subcommands exist as `tx ` - * (x/genutil) [#6651](https://github.com/cosmos/cosmos-sdk/pull/6651) The `gentx` command has been improved. No longer are `--from` and `--name` flags required. Instead, a single argument, `name`, is required which refers to the key pair in the Keyring. In addition, an optional - `--moniker` flag can be provided to override the moniker found in `config.toml`. - * (x/upgrade) [#7697](https://github.com/cosmos/cosmos-sdk/pull/7697) Rename flag name "--time" to "--upgrade-time", "--info" to "--upgrade-info", to keep it consistent with help message. -* **REST / Queriers** - * (api) [#6426](https://github.com/cosmos/cosmos-sdk/pull/6426) The ability to start an out-of-process API REST server has now been removed. Instead, the API server is now started in-process along with the application and Tendermint. Configuration options have been added to `app.toml` to enable/disable the API server along with additional HTTP server options. - * (client) [#7246](https://github.com/cosmos/cosmos-sdk/pull/7246) The rest server endpoint `/swagger-ui/` is replaced by `/swagger/`, and contains swagger documentation for gRPC Gateway routes in addition to legacy REST routes. Swagger API is exposed only if set in `app.toml`. - * (x/auth) [#5702](https://github.com/cosmos/cosmos-sdk/pull/5702) The `x/auth` querier route has changed from `"acc"` to `"auth"`. - * (x/bank) [#5572](https://github.com/cosmos/cosmos-sdk/pull/5572) The `/bank/balances/{address}` endpoint now returns all account balances or a single balance by denom when the `denom` query parameter is present. - * (x/evidence) [#5952](https://github.com/cosmos/cosmos-sdk/pull/5952) Remove CLI and REST handlers for querying `x/evidence` parameters. - * (x/gov) [#6295](https://github.com/cosmos/cosmos-sdk/pull/6295) Fix typo in querying governance params. -* **General** - * (baseapp) [#6384](https://github.com/cosmos/cosmos-sdk/pull/6384) The `Result.Data` is now a Protocol Buffer encoded binary blob of type `TxData`. The `TxData` contains `Data` which contains a list of Protocol Buffer encoded message data and the corresponding message type. - * (client) [#5783](https://github.com/cosmos/cosmos-sdk/issues/5783) Unify all coins representations on JSON client requests for governance proposals. - * (crypto) [#7419](https://github.com/cosmos/cosmos-sdk/pull/7419) The SDK doesn't use Tendermint's `crypto.PubKey` - interface anymore, and uses instead it's own `PubKey` interface, defined in `crypto/types`. Replace all instances of - `crypto.PubKey` by `cryptotypes.Pubkey`. - * (store/rootmulti) [#6390](https://github.com/cosmos/cosmos-sdk/pull/6390) Proofs of empty stores are no longer supported. - * (store/types) [#5730](https://github.com/cosmos/cosmos-sdk/pull/5730) store.types.Cp() is removed in favour of types.CopyBytes(). - * (x/auth) [#6054](https://github.com/cosmos/cosmos-sdk/pull/6054) Remove custom JSON marshaling for base accounts as multsigs cannot be bech32 decoded. - * (x/auth/vesting) [#6859](https://github.com/cosmos/cosmos-sdk/pull/6859) Custom JSON marshaling of vesting accounts was removed. Vesting accounts are now marshaled using their default proto or amino JSON representation. - * (x/bank) [#5785](https://github.com/cosmos/cosmos-sdk/issues/5785) In x/bank errors, JSON strings coerced to valid UTF-8 bytes at JSON marshalling time - are now replaced by human-readable expressions. This change can potentially break compatibility with all those client side tools - that parse log messages. - * (x/evidence) [#7538](https://github.com/cosmos/cosmos-sdk/pull/7538) The ABCI's `Result.Data` field for - `MsgSubmitEvidence` responses does not contain the raw evidence's hash, but the protobuf encoded - `MsgSubmitEvidenceResponse` struct. - * (x/gov) [#7533](https://github.com/cosmos/cosmos-sdk/pull/7533) The ABCI's `Result.Data` field for - `MsgSubmitProposal` responses does not contain a raw binary encoding of the `proposalID`, but the protobuf encoded - `MsgSubmitSubmitProposalResponse` struct. - * (x/gov) [#6859](https://github.com/cosmos/cosmos-sdk/pull/6859) `ProposalStatus` and `VoteOption` are now JSON serialized using its protobuf name, so expect names like `PROPOSAL_STATUS_DEPOSIT_PERIOD` as opposed to `DepositPeriod`. - * (x/staking) [#7499](https://github.com/cosmos/cosmos-sdk/pull/7499) `BondStatus` is now a protobuf `enum` instead - of an `int32`, and JSON serialized using its protobuf name, so expect names like `BOND_STATUS_UNBONDING` as opposed - to `Unbonding`. - * (x/staking) [#7556](https://github.com/cosmos/cosmos-sdk/pull/7556) The ABCI's `Result.Data` field for - `MsgBeginRedelegate` and `MsgUndelegate` responses does not contain custom binary marshaled `completionTime`, but the - protobuf encoded `MsgBeginRedelegateResponse` and `MsgUndelegateResponse` structs respectively +* (x/gov) [#18146](https://github.com/cosmos/cosmos-sdk/pull/18146) Add denom check to reject denoms outside of those listed in `MinDeposit`. A new `MinDepositRatio` param is added (with a default value of `0.001`) and now deposits are required to be at least `MinDepositRatio*MinDeposit` to be accepted. +* (x/group,x/gov) [#16235](https://github.com/cosmos/cosmos-sdk/pull/16235) A group and gov proposal is rejected if the proposal metadata title and summary do not match the proposal title and summary. +* (baseapp) [#15930](https://github.com/cosmos/cosmos-sdk/pull/15930) change vote info provided by prepare and process proposal to the one in the block. +* (x/staking) [#15731](https://github.com/cosmos/cosmos-sdk/pull/15731) Introducing a new index to retrieve the delegations by validator efficiently. +* (x/staking) [#15701](https://github.com/cosmos/cosmos-sdk/pull/15701) The `HistoricalInfoKey` has been updated to use a binary format. +* (x/slashing) [#15580](https://github.com/cosmos/cosmos-sdk/pull/15580) The validator slashing window now stores "chunked" bitmap entries for each validator's signing window instead of a single boolean entry per signing window index. +* (x/staking) [#14590](https://github.com/cosmos/cosmos-sdk/pull/14590) `MsgUndelegateResponse` now includes undelegated amount. `x/staking` module's `keeper.Undelegate` now returns 3 values (completionTime,undelegateAmount,error) instead of 2. +* (x/feegrant) [#14294](https://github.com/cosmos/cosmos-sdk/pull/14294) Moved the logic of rejecting duplicate grant from `msg_server` to `keeper` method. ### API Breaking Changes -* **Baseapp / Client** - * (AppModule) [#7518](https://github.com/cosmos/cosmos-sdk/pull/7518) [#7584](https://github.com/cosmos/cosmos-sdk/pull/7584) Rename `AppModule.RegisterQueryServices` to `AppModule.RegisterServices`, as this method now registers multiple services (the gRPC query service and the protobuf Msg service). A `Configurator` struct is used to hold the different services. - * (baseapp) [#5865](https://github.com/cosmos/cosmos-sdk/pull/5865) The `SimulationResponse` returned from tx simulation is now JSON encoded instead of Amino binary. - * (client) [#6290](https://github.com/cosmos/cosmos-sdk/pull/6290) `CLIContext` is renamed to `Context`. `Context` and all related methods have been moved from package context to client. - * (client) [#6525](https://github.com/cosmos/cosmos-sdk/pull/6525) Removed support for `indent` in JSON responses. Clients should consider piping to an external tool such as `jq`. - * (client) [#8107](https://github.com/cosmos/cosmos-sdk/pull/8107) Renamed `PrintOutput` and `PrintOutputLegacy` - methods of the `context.Client` object to `PrintProto` and `PrintObjectLegacy`. - * (client/flags) [#6632](https://github.com/cosmos/cosmos-sdk/pull/6632) Remove NewCompletionCmd(), the function is now available in tendermint. - * (client/input) [#5904](https://github.com/cosmos/cosmos-sdk/pull/5904) Removal of unnecessary `GetCheckPassword`, `PrintPrefixed` functions. - * (client/keys) [#5889](https://github.com/cosmos/cosmos-sdk/pull/5889) Rename `NewKeyBaseFromDir()` -> `NewLegacyKeyBaseFromDir()`. - * (client/keys) [#5820](https://github.com/cosmos/cosmos-sdk/pull/5820/) Removed method CloseDB from Keybase interface. - * (client/rpc) [#6290](https://github.com/cosmos/cosmos-sdk/pull/6290) `client` package and subdirs reorganization. - * (client/lcd) [#6290](https://github.com/cosmos/cosmos-sdk/pull/6290) `CliCtx` of struct `RestServer` in package client/lcd has been renamed to `ClientCtx`. - * (codec) [#6330](https://github.com/cosmos/cosmos-sdk/pull/6330) `codec.RegisterCrypto` has been moved to the `crypto/codec` package and the global `codec.Cdc` Amino instance has been deprecated and moved to the `codec/legacy_global` package. - * (codec) [#8080](https://github.com/cosmos/cosmos-sdk/pull/8080) Updated the `codec.Marshaler` interface - * Moved `MarshalAny` and `UnmarshalAny` helper functions to `codec.Marshaler` and renamed to `MarshalInterface` and - `UnmarshalInterface` respectively. These functions must take interface as a parameter (not a concrete type nor `Any` - object). Underneath they use `Any` wrapping for correct protobuf serialization. - * (crypto) [#6780](https://github.com/cosmos/cosmos-sdk/issues/6780) Move ledger code to its own package. - * (crypto/types/multisig) [#6373](https://github.com/cosmos/cosmos-sdk/pull/6373) `multisig.Multisignature` has been renamed to `AminoMultisignature` - * (codec) `*codec.LegacyAmino` is now a wrapper around Amino which provides backwards compatibility with protobuf `Any`. ALL legacy code should use `*codec.LegacyAmino` instead of `*amino.Codec` directly - * (crypto) [#5880](https://github.com/cosmos/cosmos-sdk/pull/5880) Merge `crypto/keys/mintkey` into `crypto`. - * (crypto/hd) [#5904](https://github.com/cosmos/cosmos-sdk/pull/5904) `crypto/keys/hd` moved to `crypto/hd`. - * (crypto/keyring): - _ [#5866](https://github.com/cosmos/cosmos-sdk/pull/5866) Rename `crypto/keys/` to `crypto/keyring/`. - _ [#5904](https://github.com/cosmos/cosmos-sdk/pull/5904) `Keybase` -> `Keyring` interfaces migration. `LegacyKeybase` interface is added in order - to guarantee limited backward compatibility with the old Keybase interface for the sole purpose of migrating keys across the new keyring backends. `NewLegacy` - constructor is provided [#5889](https://github.com/cosmos/cosmos-sdk/pull/5889) to allow for smooth migration of keys from the legacy LevelDB based implementation - to new keyring backends. Plus, the package and the new keyring no longer depends on the sdk.Config singleton. Please consult the [package documentation](https://github.com/cosmos/cosmos-sdk/tree/master/crypto/keyring/doc.go) for more - information on how to implement the new `Keyring` interface. \* [#5858](https://github.com/cosmos/cosmos-sdk/pull/5858) Make Keyring store keys by name and address's hexbytes representation. - * (export) [#5952](https://github.com/cosmos/cosmos-sdk/pull/5952) `AppExporter` now returns ABCI consensus parameters to be included in marshaled exported state. These parameters must be returned from the application via the `BaseApp`. - * (simapp) Deprecating and renaming `MakeEncodingConfig` to `MakeTestEncodingConfig` (both in `simapp` and `simapp/params` packages). - * (store) [#5803](https://github.com/cosmos/cosmos-sdk/pull/5803) The `store.CommitMultiStore` interface now includes the new `snapshots.Snapshotter` interface as well. - * (types) [#5579](https://github.com/cosmos/cosmos-sdk/pull/5579) The `keepRecent` field has been removed from the `PruningOptions` type. - The `PruningOptions` type now only includes fields `KeepEvery` and `SnapshotEvery`, where `KeepEvery` - determines which committed heights are flushed to disk and `SnapshotEvery` determines which of these - heights are kept after pruning. The `IsValid` method should be called whenever using these options. Methods - `SnapshotVersion` and `FlushVersion` accept a version arugment and determine if the version should be - flushed to disk or kept as a snapshot. Note, `KeepRecent` is automatically inferred from the options - and provided directly the IAVL store. - * (types) [#5533](https://github.com/cosmos/cosmos-sdk/pull/5533) Refactored `AppModuleBasic` and `AppModuleGenesis` - to now accept a `codec.JSONMarshaler` for modular serialization of genesis state. - * (types/rest) [#5779](https://github.com/cosmos/cosmos-sdk/pull/5779) Drop unused Parse{Int64OrReturnBadRequest,QueryParamBool}() functions. -* **Modules** - * (modules) [#7243](https://github.com/cosmos/cosmos-sdk/pull/7243) Rename `RegisterCodec` to `RegisterLegacyAminoCodec` and `codec.New()` is now renamed to `codec.NewLegacyAmino()` - * (modules) [#6564](https://github.com/cosmos/cosmos-sdk/pull/6564) Constant `DefaultParamspace` is removed from all modules, use ModuleName instead. - * (modules) [#5989](https://github.com/cosmos/cosmos-sdk/pull/5989) `AppModuleBasic.GetTxCmd` now takes a single `CLIContext` parameter. - * (modules) [#5664](https://github.com/cosmos/cosmos-sdk/pull/5664) Remove amino `Codec` from simulation `StoreDecoder`, which now returns a function closure in order to unmarshal the key-value pairs. - * (modules) [#5555](https://github.com/cosmos/cosmos-sdk/pull/5555) Move `x/auth/client/utils/` types and functions to `x/auth/client/`. - * (modules) [#5572](https://github.com/cosmos/cosmos-sdk/pull/5572) Move account balance logic and APIs from `x/auth` to `x/bank`. - * (modules) [#6326](https://github.com/cosmos/cosmos-sdk/pull/6326) `AppModuleBasic.GetQueryCmd` now takes a single `client.Context` parameter. - * (modules) [#6336](https://github.com/cosmos/cosmos-sdk/pull/6336) `AppModuleBasic.RegisterQueryService` method was added to support gRPC queries, and `QuerierRoute` and `NewQuerierHandler` were deprecated. - * (modules) [#6311](https://github.com/cosmos/cosmos-sdk/issues/6311) Remove `alias.go` usage - * (modules) [#6447](https://github.com/cosmos/cosmos-sdk/issues/6447) Rename `blacklistedAddrs` to `blockedAddrs`. - * (modules) [#6834](https://github.com/cosmos/cosmos-sdk/issues/6834) Add `RegisterInterfaces` method to `AppModuleBasic` to support registration of protobuf interface types. - * (modules) [#6734](https://github.com/cosmos/cosmos-sdk/issues/6834) Add `TxEncodingConfig` parameter to `AppModuleBasic.ValidateGenesis` command to support JSON tx decoding in `genutil`. - * (modules) [#7764](https://github.com/cosmos/cosmos-sdk/pull/7764) Added module initialization options: - * `server/types.AppExporter` requires extra argument: `AppOptions`. - * `server.AddCommands` requires extra argument: `addStartFlags types.ModuleInitFlags` - * `x/crisis.NewAppModule` has a new attribute: `skipGenesisInvariants`. [PR](https://github.com/cosmos/cosmos-sdk/pull/7764) - * (types) [#6327](https://github.com/cosmos/cosmos-sdk/pull/6327) `sdk.Msg` now inherits `proto.Message`, as a result all `sdk.Msg` types now use pointer semantics. - * (types) [#7032](https://github.com/cosmos/cosmos-sdk/pull/7032) All types ending with `ID` (e.g. `ProposalID`) now end with `Id` (e.g. `ProposalId`), to match default Protobuf generated format. Also see [#7033](https://github.com/cosmos/cosmos-sdk/pull/7033) for more details. - * (x/auth) [#6029](https://github.com/cosmos/cosmos-sdk/pull/6029) Module accounts have been moved from `x/supply` to `x/auth`. - * (x/auth) [#6443](https://github.com/cosmos/cosmos-sdk/issues/6443) Move `FeeTx` and `TxWithMemo` interfaces from `x/auth/ante` to `types`. - * (x/auth) [#7006](https://github.com/cosmos/cosmos-sdk/pull/7006) All `AccountRetriever` methods now take `client.Context` as a parameter instead of as a struct member. - * (x/auth) [#6270](https://github.com/cosmos/cosmos-sdk/pull/6270) The passphrase argument has been removed from the signature of the following functions and methods: `BuildAndSign`, ` MakeSignature`, ` SignStdTx`, `TxBuilder.BuildAndSign`, `TxBuilder.Sign`, `TxBuilder.SignStdTx` - * (x/auth) [#6428](https://github.com/cosmos/cosmos-sdk/issues/6428): - * `NewAnteHandler` and `NewSigVerificationDecorator` both now take a `SignModeHandler` parameter. - * `SignatureVerificationGasConsumer` now has the signature: `func(meter sdk.GasMeter, sig signing.SignatureV2, params types.Params) error`. - * The `SigVerifiableTx` interface now has a `GetSignaturesV2() ([]signing.SignatureV2, error)` method and no longer has the `GetSignBytes` method. - * (x/auth/tx) [#8106](https://github.com/cosmos/cosmos-sdk/pull/8106) change related to missing append functionality in - client transaction signing - * added `overwriteSig` argument to `x/auth/client.SignTx` and `client/tx.Sign` functions. - * removed `x/auth/tx.go:wrapper.GetSignatures`. The `wrapper` provides `TxBuilder` functionality, and it's a private - structure. That function was not used at all and it's not exposed through the `TxBuilder` interface. - * (x/bank) [#7327](https://github.com/cosmos/cosmos-sdk/pull/7327) AddCoins and SubtractCoins no longer return a resultingValue and will only return an error. - * (x/capability) [#7918](https://github.com/cosmos/cosmos-sdk/pull/7918) Add x/capability safety checks: - * All outward facing APIs will now check that capability is not nil and name is not empty before performing any state-machine changes - * `SetIndex` has been renamed to `InitializeIndex` - * (x/evidence) [#7251](https://github.com/cosmos/cosmos-sdk/pull/7251) New evidence types and light client evidence handling. The module function names changed. - * (x/evidence) [#5952](https://github.com/cosmos/cosmos-sdk/pull/5952) Remove APIs for getting and setting `x/evidence` parameters. `BaseApp` now uses a `ParamStore` to manage Tendermint consensus parameters which is managed via the `x/params` `Substore` type. - * (x/gov) [#6147](https://github.com/cosmos/cosmos-sdk/pull/6147) The `Content` field on `Proposal` and `MsgSubmitProposal` - is now `Any` in concordance with [ADR 019](docs/architecture/adr-019-protobuf-state-encoding.md) and `GetContent` should now - be used to retrieve the actual proposal `Content`. Also the `NewMsgSubmitProposal` constructor now may return an `error` - * (x/ibc) [#6374](https://github.com/cosmos/cosmos-sdk/pull/6374) `VerifyMembership` and `VerifyNonMembership` now take a `specs []string` argument to specify the proof format used for verification. Most SDK chains can simply use `commitmenttypes.GetSDKSpecs()` for this argument. - * (x/params) [#5619](https://github.com/cosmos/cosmos-sdk/pull/5619) The `x/params` keeper now accepts a `codec.Marshaller` instead of - a reference to an amino codec. Amino is still used for JSON serialization. - * (x/staking) [#6451](https://github.com/cosmos/cosmos-sdk/pull/6451) `DefaultParamspace` and `ParamKeyTable` in staking module are moved from keeper to types to enforce consistency. - * (x/staking) [#7419](https://github.com/cosmos/cosmos-sdk/pull/7419) The `TmConsPubKey` method on ValidatorI has been - removed and replaced instead by `ConsPubKey` (which returns a SDK `cryptotypes.PubKey`) and `TmConsPublicKey` (which - returns a Tendermint proto PublicKey). - * (x/staking/types) [#7447](https://github.com/cosmos/cosmos-sdk/issues/7447) Remove bech32 PubKey support: - * `ValidatorI` interface update. `GetConsPubKey` renamed to `TmConsPubKey` (consensus public key must be a tendermint key). `TmConsPubKey`, `GetConsAddr` methods return error. - * `Validator` update. Methods changed in `ValidatorI` (as described above) and `ToTmValidator` return error. - * `Validator.ConsensusPubkey` type changed from `string` to `codectypes.Any`. - * `MsgCreateValidator.Pubkey` type changed from `string` to `codectypes.Any`. - * (x/supply) [#6010](https://github.com/cosmos/cosmos-sdk/pull/6010) All `x/supply` types and APIs have been moved to `x/bank`. - * [#6409](https://github.com/cosmos/cosmos-sdk/pull/6409) Rename all IsEmpty methods to Empty across the codebase and enforce consistency. - * [#6231](https://github.com/cosmos/cosmos-sdk/pull/6231) Simplify `AppModule` interface, `Route` and `NewHandler` methods become only `Route` - and returns a new `Route` type. - * (x/slashing) [#6212](https://github.com/cosmos/cosmos-sdk/pull/6212) Remove `Get*` prefixes from key construction functions - * (server) [#6079](https://github.com/cosmos/cosmos-sdk/pull/6079) Remove `UpgradeOldPrivValFile` (deprecated in Tendermint Core v0.28). - * [#5719](https://github.com/cosmos/cosmos-sdk/pull/5719) Bump Go requirement to 1.14+ +* (x/auth) [#17787](https://github.com/cosmos/cosmos-sdk/pull/17787) Remove Tip functionality. +* (types) `module.EndBlockAppModule` has been replaced by Core API `appmodule.HasEndBlocker` or `module.HasABCIEndBlock` when needing validator updates. +* (types) `module.BeginBlockAppModule` has been replaced by Core API `appmodule.HasBeginBlocker`. +* (types) [#17358](https://github.com/cosmos/cosmos-sdk/pull/17358) Remove deprecated `sdk.Handler`, use `baseapp.MsgServiceHandler` instead. +* (client) [#17197](https://github.com/cosmos/cosmos-sdk/pull/17197) `keys.Commands` does not take a home directory anymore. It is inferred from the root command. +* (x/staking) [#17157](https://github.com/cosmos/cosmos-sdk/pull/17157) `GetValidatorsByPowerIndexKey` and `ValidateBasic` for historical info takes a validator address codec in order to be able to decode/encode addresses. + * `GetOperator()` now returns the address as it is represented in state, by default this is an encoded address + * `GetConsAddr() ([]byte, error)` returns `[]byte` instead of sdk.ConsAddres. + * `FromABCIEvidence` & `GetConsensusAddress(consAc address.Codec)` now take a consensus address codec to be able to decode the incoming address. + * (x/distribution) `Delegate` & `SlashValidator` helper function added the mock staking keeper as a parameter passed to the function +* (x/staking) [#17098](https://github.com/cosmos/cosmos-sdk/pull/17098) `NewMsgCreateValidator`, `NewValidator`, `NewMsgCancelUnbondingDelegation`, `NewMsgUndelegate`, `NewMsgBeginRedelegate`, `NewMsgDelegate` and `NewMsgEditValidator` takes a string instead of `sdk.ValAddress` or `sdk.AccAddress`: + * `NewRedelegation` and `NewUnbondingDelegation` takes a validatorAddressCodec and a delegatorAddressCodec in order to decode the addresses. + * `NewRedelegationResponse` takes a string instead of `sdk.ValAddress` or `sdk.AccAddress`. + * `NewMsgCreateValidator.Validate()` takes an address codec in order to decode the address. + * `BuildCreateValidatorMsg` takes a ValidatorAddressCodec in order to decode addresses. +* (x/slashing) [#17098](https://github.com/cosmos/cosmos-sdk/pull/17098) `NewMsgUnjail` takes a string instead of `sdk.ValAddress` +* (x/genutil) [#17098](https://github.com/cosmos/cosmos-sdk/pull/17098) `GenAppStateFromConfig`, AddGenesisAccountCmd and `GenTxCmd` takes an addresscodec to decode addresses. +* (x/distribution) [#17098](https://github.com/cosmos/cosmos-sdk/pull/17098) `NewMsgDepositValidatorRewardsPool`, `NewMsgFundCommunityPool`, `NewMsgWithdrawValidatorCommission` and `NewMsgWithdrawDelegatorReward` takes a string instead of `sdk.ValAddress` or `sdk.AccAddress`. +* (x/staking) [#16959](https://github.com/cosmos/cosmos-sdk/pull/16959) Add validator and consensus address codec as staking keeper arguments. +* (x/staking) [#16958](https://github.com/cosmos/cosmos-sdk/pull/16958) DelegationI interface `GetDelegatorAddr` & `GetValidatorAddr` have been migrated to return string instead of sdk.AccAddress and sdk.ValAddress respectively. stakingtypes.NewDelegation takes a string instead of sdk.AccAddress and sdk.ValAddress. +* (testutil) [#16899](https://github.com/cosmos/cosmos-sdk/pull/16899) The *cli testutil* `QueryBalancesExec` has been removed. Use the gRPC or REST query instead. +* (x/staking) [#16795](https://github.com/cosmos/cosmos-sdk/pull/16795) `DelegationToDelegationResponse`, `DelegationsToDelegationResponses`, `RedelegationsToRedelegationResponses` are no longer exported. +* (x/auth/vesting) [#16741](https://github.com/cosmos/cosmos-sdk/pull/16741) Vesting account constructor now return an error with the result of their validate function. +* (x/auth) [#16650](https://github.com/cosmos/cosmos-sdk/pull/16650) The *cli testutil* `QueryAccountExec` has been removed. Use the gRPC or REST query instead. +* (x/auth) [#16621](https://github.com/cosmos/cosmos-sdk/pull/16621) Pass address codec to auth new keeper constructor. +* (x/auth) [#16423](https://github.com/cosmos/cosmos-sdk/pull/16423) `helpers.AddGenesisAccount` has been moved to `x/genutil` to remove the cyclic dependency between `x/auth` and `x/genutil`. +* (baseapp) [#16342](https://github.com/cosmos/cosmos-sdk/pull/16342) NewContext was renamed to NewContextLegacy. The replacement (NewContext) now does not take a header, instead you should set the header via `WithHeaderInfo` or `WithBlockHeight`. Note that `WithBlockHeight` will soon be depreacted and its recommneded to use `WithHeaderInfo`. +* (x/mint) [#16329](https://github.com/cosmos/cosmos-sdk/pull/16329) Use collections for state management: + * Removed: keeper `GetParams`, `SetParams`, `GetMinter`, `SetMinter`. +* (x/crisis) [#16328](https://github.com/cosmos/cosmos-sdk/pull/16328) Use collections for state management: + * Removed: keeper `GetConstantFee`, `SetConstantFee` +* (x/staking) [#16324](https://github.com/cosmos/cosmos-sdk/pull/16324) `NewKeeper` now takes a `KVStoreService` instead of a `StoreKey`, and methods in the `Keeper` now take a `context.Context` instead of a `sdk.Context` and return an `error`. Notable changes: + * `Validator` method now returns `types.ErrNoValidatorFound` instead of `nil` when not found. +* (x/distribution) [#16302](https://github.com/cosmos/cosmos-sdk/pull/16302) Use collections for FeePool state management. + * Removed: keeper `GetFeePool`, `SetFeePool`, `GetFeePoolCommunityCoins` +* (types) [#16272](https://github.com/cosmos/cosmos-sdk/pull/16272) `FeeGranter` in the `FeeTx` interface returns `[]byte` instead of `string`. +* (x/gov) [#16268](https://github.com/cosmos/cosmos-sdk/pull/16268) Use collections for proposal state management (part 2): + * this finalizes the gov collections migration + * Removed: types all the key related functions + * Removed: keeper `InsertActiveProposalsQueue`, `RemoveActiveProposalsQueue`, `InsertInactiveProposalsQueue`, `RemoveInactiveProposalsQueue`, `IterateInactiveProposalsQueue`, `IterateActiveProposalsQueue`, `ActiveProposalsQueueIterator`, `InactiveProposalsQueueIterator` +* (x/slashing) [#16246](https://github.com/cosmos/cosmos-sdk/issues/16246) `NewKeeper` now takes a `KVStoreService` instead of a `StoreKey`, and methods in the `Keeper` now take a `context.Context` instead of a `sdk.Context` and return an `error`. `GetValidatorSigningInfo` now returns an error instead of a `found bool`, the error can be `nil` (found), `ErrNoSigningInfoFound` (not found) and any other error. +* (module) [#16227](https://github.com/cosmos/cosmos-sdk/issues/16227) `manager.RunMigrations()` now take a `context.Context` instead of a `sdk.Context`. +* (x/crisis) [#16216](https://github.com/cosmos/cosmos-sdk/issues/16216) `NewKeeper` now takes a `KVStoreService` instead of a `StoreKey`, methods in the `Keeper` now take a `context.Context` instead of a `sdk.Context` and return an `error` instead of panicking. +* (x/distribution) [#16211](https://github.com/cosmos/cosmos-sdk/pull/16211) Use collections for params state management. +* (cli) [#16209](https://github.com/cosmos/cosmos-sdk/pull/16209) Add API `StartCmdWithOptions` to create customized start command. +* (x/mint) [#16179](https://github.com/cosmos/cosmos-sdk/issues/16179) `NewKeeper` now takes a `KVStoreService` instead of a `StoreKey`, and methods in the `Keeper` now take a `context.Context` instead of a `sdk.Context` and return an `error`. +* (x/gov) [#16171](https://github.com/cosmos/cosmos-sdk/pull/16171) Use collections for proposal state management (part 1): + * Removed: keeper: `GetProposal`, `UnmarshalProposal`, `MarshalProposal`, `IterateProposal`, `GetProposal`, `GetProposalFiltered`, `GetProposals`, `GetProposalID`, `SetProposalID` + * Removed: errors unused errors +* (x/gov) [#16164](https://github.com/cosmos/cosmos-sdk/pull/16164) Use collections for vote state management: + * Removed: types `VoteKey`, `VoteKeys` + * Removed: keeper `IterateVotes`, `IterateAllVotes`, `GetVotes`, `GetVote`, `SetVote` +* (sims) [#16155](https://github.com/cosmos/cosmos-sdk/pull/16155) + * `simulation.NewOperationMsg` now marshals the operation msg as proto bytes instead of legacy amino JSON bytes. + * `simulation.NewOperationMsg` is now 2-arity instead of 3-arity with the obsolete argument `codec.ProtoCodec` removed. + * The field `OperationMsg.Msg` is now of type `[]byte` instead of `json.RawMessage`. +* (x/gov) [#16127](https://github.com/cosmos/cosmos-sdk/pull/16127) Use collections for deposit state management: + * The following methods are removed from the gov keeper: `GetDeposit`, `GetAllDeposits`, `IterateAllDeposits`. + * The following functions are removed from the gov types: `DepositKey`, `DepositsKey`. +* (x/gov) [#16118](https://github.com/cosmos/cosmos-sdk/pull/16118/) Use collections for constituion and params state management. +* (x/gov) [#16106](https://github.com/cosmos/cosmos-sdk/pull/16106) Remove gRPC query methods from gov keeper. +* (x/*all*) [#16052](https://github.com/cosmos/cosmos-sdk/pull/16062) `GetSignBytes` implementations on messages and global legacy amino codec definitions have been removed from all modules. +* (sims) [#16052](https://github.com/cosmos/cosmos-sdk/pull/16062) `GetOrGenerate` no longer requires a codec argument is now 4-arity instead of 5-arity. +* (types/math) [#16040](https://github.com/cosmos/cosmos-sdk/pull/16798) Remove aliases in `types/math.go` (part 2). +* (types/math) [#16040](https://github.com/cosmos/cosmos-sdk/pull/16040) Remove aliases in `types/math.go` (part 1). +* (x/auth) [#16016](https://github.com/cosmos/cosmos-sdk/pull/16016) Use collections for accounts state management: + * removed: keeper `HasAccountByID`, `AccountAddressByID`, `SetParams +* (x/genutil) [#15999](https://github.com/cosmos/cosmos-sdk/pull/15999) Genutil now takes the `GenesisTxHanlder` interface instead of deliverTx. The interface is implemented on baseapp +* (x/gov) [#15988](https://github.com/cosmos/cosmos-sdk/issues/15988) `NewKeeper` now takes a `KVStoreService` instead of a `StoreKey`, methods in the `Keeper` now take a `context.Context` instead of a `sdk.Context` and return an `error` (instead of panicking or returning a `found bool`). Iterators callback functions now return an error instead of a `bool`. +* (x/auth) [#15985](https://github.com/cosmos/cosmos-sdk/pull/15985) The `AccountKeeper` does not expose the `QueryServer` and `MsgServer` APIs anymore. +* (x/authz) [#15962](https://github.com/cosmos/cosmos-sdk/issues/15962) `NewKeeper` now takes a `KVStoreService` instead of a `StoreKey`, methods in the `Keeper` now take a `context.Context` instead of a `sdk.Context`. The `Authorization` interface's `Accept` method now takes a `context.Context` instead of a `sdk.Context`. +* (x/distribution) [#15948](https://github.com/cosmos/cosmos-sdk/issues/15948) `NewKeeper` now takes a `KVStoreService` instead of a `StoreKey` and methods in the `Keeper` now take a `context.Context` instead of a `sdk.Context`. Keeper methods also now return an `error`. +* (x/bank) [#15891](https://github.com/cosmos/cosmos-sdk/issues/15891) `NewKeeper` now takes a `KVStoreService` instead of a `StoreKey` and methods in the `Keeper` now take a `context.Context` instead of a `sdk.Context`. Also `FundAccount` and `FundModuleAccount` from the `testutil` package accept a `context.Context` instead of a `sdk.Context`, and it's position was moved to the first place. +* (x/slashing) [#15875](https://github.com/cosmos/cosmos-sdk/pull/15875) `x/slashing.NewAppModule` now requires an `InterfaceRegistry` parameter. +* (x/crisis) [#15852](https://github.com/cosmos/cosmos-sdk/pull/15852) Crisis keeper now takes a instance of the address codec to be able to decode user addresses +* (x/auth) [#15822](https://github.com/cosmos/cosmos-sdk/pull/15822) The type of struct field `ante.HandlerOptions.SignModeHandler` has been changed to `x/tx/signing.HandlerMap`. +* (client) [#15822](https://github.com/cosmos/cosmos-sdk/pull/15822) The return type of the interface method `TxConfig.SignModeHandler` has been changed to `x/tx/signing.HandlerMap`. + * The signature of `VerifySignature` has been changed to accept a `x/tx/signing.HandlerMap` and other structs from `x/tx` as arguments. + * The signature of `NewTxConfigWithTextual` has been deprecated and its signature changed to accept a `SignModeOptions`. + * The signature of `NewSigVerificationDecorator` has been changed to accept a `x/tx/signing.HandlerMap`. +* (x/bank) [#15818](https://github.com/cosmos/cosmos-sdk/issues/15818) `BaseViewKeeper`'s `Logger` method now doesn't require a context. `NewBaseKeeper`, `NewBaseSendKeeper` and `NewBaseViewKeeper` now also require a `log.Logger` to be passed in. +* (x/genutil) [#15679](https://github.com/cosmos/cosmos-sdk/pull/15679) `MigrateGenesisCmd` now takes a `MigrationMap` instead of having the SDK genesis migration hardcoded. +* (client) [#15673](https://github.com/cosmos/cosmos-sdk/pull/15673) Move `client/keys.OutputFormatJSON` and `client/keys.OutputFormatText` to `client/flags` package. +* (x/*all*) [#15648](https://github.com/cosmos/cosmos-sdk/issues/15648) Make `SetParams` consistent across all modules and validate the params at the message handling instead of `SetParams` method. +* (codec) [#15600](https://github.com/cosmos/cosmos-sdk/pull/15600) [#15873](https://github.com/cosmos/cosmos-sdk/pull/15873) add support for getting signers to `codec.Codec` and `InterfaceRegistry`: + * `InterfaceRegistry` is has unexported methods and implements `protodesc.Resolver` plus the `RangeFiles` and `SigningContext` methods. All implementations of `InterfaceRegistry` by other users must now embed the official implementation. + * `Codec` has new methods `InterfaceRegistry`, `GetMsgAnySigners`, `GetMsgV1Signers`, and `GetMsgV2Signers` as well as unexported methods. All implementations of `Codec` by other users must now embed an official implementation from the `codec` package. + * `AminoCodec` is marked as deprecated and no longer implements `Codec. +* (client) [#15597](https://github.com/cosmos/cosmos-sdk/pull/15597) `RegisterNodeService` now requires a config parameter. +* (x/nft) [#15588](https://github.com/cosmos/cosmos-sdk/pull/15588) `NewKeeper` now takes a `KVStoreService` instead of a `StoreKey` and methods in the `Keeper` now take a `context.Context` instead of a `sdk.Context`. +* (baseapp) [#15568](https://github.com/cosmos/cosmos-sdk/pull/15568) `SetIAVLLazyLoading` is removed from baseapp. +* (x/genutil) [#15567](https://github.com/cosmos/cosmos-sdk/pull/15567) `CollectGenTxsCmd` & `GenTxCmd` takes a address.Codec to be able to decode addresses. +* (x/bank) [#15567](https://github.com/cosmos/cosmos-sdk/pull/15567) `GenesisBalance.GetAddress` now returns a string instead of `sdk.AccAddress` + * `MsgSendExec` test helper function now takes a address.Codec +* (x/auth) [#15520](https://github.com/cosmos/cosmos-sdk/pull/15520) `NewAccountKeeper` now takes a `KVStoreService` instead of a `StoreKey` and methods in the `Keeper` now take a `context.Context` instead of a `sdk.Context`. +* (baseapp) [#15519](https://github.com/cosmos/cosmos-sdk/pull/15519/files) `runTxMode`s were renamed to `execMode`. `ModeDeliver` as changed to `ModeFinalize` and a new `ModeVoteExtension` was added for vote extensions. +* (baseapp) [#15519](https://github.com/cosmos/cosmos-sdk/pull/15519/files) Writing of state to the multistore was moved to `FinalizeBlock`. `Commit` still handles the committing values to disk. +* (baseapp) [#15519](https://github.com/cosmos/cosmos-sdk/pull/15519/files) Calls to BeginBlock and EndBlock have been replaced with core api beginblock & endblock. +* (baseapp) [#15519](https://github.com/cosmos/cosmos-sdk/pull/15519/files) BeginBlock and EndBlock are now internal to baseapp. For testing, user must call `FinalizeBlock`. BeginBlock and EndBlock calls are internal to Baseapp. +* (baseapp) [#15519](https://github.com/cosmos/cosmos-sdk/pull/15519/files) All calls to ABCI methods now accept a pointer of the abci request and response types +* (x/consensus) [#15517](https://github.com/cosmos/cosmos-sdk/pull/15517) `NewKeeper` now takes a `KVStoreService` instead of a `StoreKey`. +* (x/bank) [#15477](https://github.com/cosmos/cosmos-sdk/pull/15477) `banktypes.NewMsgMultiSend` and `keeper.InputOutputCoins` only accept one input. +* (server) [#15358](https://github.com/cosmos/cosmos-sdk/pull/15358) Remove `server.ErrorCode` that was not used anywhere. +* (x/capability) [#15344](https://github.com/cosmos/cosmos-sdk/pull/15344) Capability module was removed and is now housed in [IBC-GO](https://github.com/cosmos/ibc-go). +* (mempool) [#15328](https://github.com/cosmos/cosmos-sdk/pull/15328) The `PriorityNonceMempool` is now generic over type `C comparable` and takes a single `PriorityNonceMempoolConfig[C]` argument. See `DefaultPriorityNonceMempoolConfig` for how to construct the configuration and a `TxPriority` type. +* [#15299](https://github.com/cosmos/cosmos-sdk/pull/15299) Remove `StdTx` transaction and signing APIs. No SDK version has actually supported `StdTx` since before Stargate. +* [#15284](https://github.com/cosmos/cosmos-sdk/pull/15284) +* (x/gov) [#15284](https://github.com/cosmos/cosmos-sdk/pull/15284) `NewKeeper` now requires `codec.Codec`. +* (x/authx) [#15284](https://github.com/cosmos/cosmos-sdk/pull/15284) `NewKeeper` now requires `codec.Codec`. + * `types/tx.Tx` no longer implements `sdk.Tx`. + * `sdk.Tx` now requires a new method `GetMsgsV2()`. + * `sdk.Msg.GetSigners` was deprecated and is no longer supported. Use the `cosmos.msg.v1.signer` protobuf annotation instead. + * `TxConfig` has a new method `SigningContext() *signing.Context`. + * `SigVerifiableTx.GetSigners()` now returns `([][]byte, error)` instead of `[]sdk.AccAddress`. + * `AccountKeeper` now has an `AddressCodec() address.Codec` method and the expected `AccountKeeper` for `x/auth/ante` expects this method. +* [#15211](https://github.com/cosmos/cosmos-sdk/pull/15211) Remove usage of `github.com/cometbft/cometbft/libs/bytes.HexBytes` in favor of `[]byte` thorough the SDK. +* (crypto) [#15070](https://github.com/cosmos/cosmos-sdk/pull/15070) `GenerateFromPassword` and `Cost` from `bcrypt.go` now take a `uint32` instead of a `int` type. +* (types) [#15067](https://github.com/cosmos/cosmos-sdk/pull/15067) Remove deprecated alias from `types/errors`. Use `cosmossdk.io/errors` instead. +* (server) [#15041](https://github.com/cosmos/cosmos-sdk/pull/15041) Refactor how gRPC and API servers are started to remove unnecessary sleeps: + * `api.Server#Start` now accepts a `context.Context`. The caller is responsible for ensuring that the context is canceled such that the API server can gracefully exit. The caller does not need to stop the server. + * To start the gRPC server you must first create the server via `NewGRPCServer`, after which you can start the gRPC server via `StartGRPCServer` which accepts a `context.Context`. The caller is responsible for ensuring that the context is canceled such that the gRPC server can gracefully exit. The caller does not need to stop the server. + * Rename `WaitForQuitSignals` to `ListenForQuitSignals`. Note, this function is no longer blocking. Thus the caller is expected to provide a `context.CancelFunc` which indicates that when a signal is caught, that any spawned processes can gracefully exit. + * Remove `ServerStartTime` constant. +* [#15011](https://github.com/cosmos/cosmos-sdk/pull/15011) All functions that were taking a CometBFT logger, now take `cosmossdk.io/log.Logger` instead. +* (simapp) [#14977](https://github.com/cosmos/cosmos-sdk/pull/14977) Move simulation helpers functions (`AppStateFn` and `AppStateRandomizedFn`) to `testutil/sims`. These takes an extra genesisState argument which is the default state of the app. +* (x/bank) [#14894](https://github.com/cosmos/cosmos-sdk/pull/14894) Allow a human readable denomination for coins when querying bank balances. Added a `ResolveDenom` parameter to `types.QueryAllBalancesRequest`. +* [#14847](https://github.com/cosmos/cosmos-sdk/pull/14847) App and ModuleManager methods `InitGenesis`, `ExportGenesis`, `BeginBlock` and `EndBlock` now also return an error. +* (x/upgrade) [#14764](https://github.com/cosmos/cosmos-sdk/pull/14764) The `x/upgrade` module is extracted to have a separate go.mod file which allows it to be a standalone module. +* (x/auth) [#14758](https://github.com/cosmos/cosmos-sdk/pull/14758) Refactor transaction searching: + * Refactor `QueryTxsByEvents` to accept a `query` of type `string` instead of `events` of type `[]string` + * Refactor CLI methods to accept `--query` flag instead of `--events` + * Pass `prove=false` to Tendermint's `TxSearch` RPC method +* (simulation) [#14751](https://github.com/cosmos/cosmos-sdk/pull/14751) Remove the `MsgType` field from `simulation.OperationInput` struct. +* (store) [#14746](https://github.com/cosmos/cosmos-sdk/pull/14746) Extract Store in its own go.mod and rename the package to `cosmossdk.io/store`. +* (x/nft) [#14725](https://github.com/cosmos/cosmos-sdk/pull/14725) Extract NFT in its own go.mod and rename the package to `cosmossdk.io/x/nft`. +* (x/gov) [#14720](https://github.com/cosmos/cosmos-sdk/pull/14720) Add an expedited field in the gov v1 proposal and `MsgNewMsgProposal`. +* (x/feegrant) [#14649](https://github.com/cosmos/cosmos-sdk/pull/14649) Extract Feegrant in its own go.mod and rename the package to `cosmossdk.io/x/feegrant`. +* (tx) [#14634](https://github.com/cosmos/cosmos-sdk/pull/14634) Move the `tx` go module to `x/tx`. +* (store/streaming)[#14603](https://github.com/cosmos/cosmos-sdk/pull/14603) `StoreDecoderRegistry` moved from store to `types/simulations` this breaks the `AppModuleSimulation` interface. +* (snapshots) [#14597](https://github.com/cosmos/cosmos-sdk/pull/14597) Move `snapshots` to `store/snapshots`, rename and bump proto package to v1. +* (x/staking) [#14590](https://github.com/cosmos/cosmos-sdk/pull/14590) `MsgUndelegateResponse` now includes undelegated amount. `x/staking` module's `keeper.Undelegate` now returns 3 values (completionTime,undelegateAmount,error) instead of 2. +* (crypto/keyring) [#14151](https://github.com/cosmos/cosmos-sdk/pull/14151) Move keys presentation from `crypto/keyring` to `client/keys` +* (baseapp) [#14050](https://github.com/cosmos/cosmos-sdk/pull/14050) Refactor `ABCIListener` interface to accept Go contexts. +* (x/auth) [#13850](https://github.com/cosmos/cosmos-sdk/pull/13850/) Remove `MarshalYAML` methods from module (`x/...`) types. +* (modules) [#13850](https://github.com/cosmos/cosmos-sdk/pull/13850) and [#14046](https://github.com/cosmos/cosmos-sdk/pull/14046) Remove gogoproto stringer annotations. This removes the custom `String()` methods on all types that were using the annotations. +* (x/evidence) [14724](https://github.com/cosmos/cosmos-sdk/pull/14724) Extract Evidence in its own go.mod and rename the package to `cosmossdk.io/x/evidence`. +* (crypto/keyring) [#13734](https://github.com/cosmos/cosmos-sdk/pull/13834) The keyring's `Sign` method now takes a new `signMode` argument. It is only used if the signing key is a Ledger hardware device. You can set it to 0 in all other cases. +* (snapshots) [14048](https://github.com/cosmos/cosmos-sdk/pull/14048) Move the Snapshot package to the store package. This is done in an effort group all storage related logic under one package. +* (signing) [#13701](https://github.com/cosmos/cosmos-sdk/pull/) Add `context.Context` as an argument `x/auth/signing.VerifySignature`. +* (store) [#11825](https://github.com/cosmos/cosmos-sdk/pull/11825) Make extension snapshotter interface safer to use, renamed the util function `WriteExtensionItem` to `WriteExtensionPayload`. -### State Machine Breaking +### Client Breaking Changes -* **General** - - * (client) [#7268](https://github.com/cosmos/cosmos-sdk/pull/7268) / [#7147](https://github.com/cosmos/cosmos-sdk/pull/7147) Introduce new protobuf based PubKeys, and migrate PubKey in BaseAccount to use this new protobuf based PubKey format - -* **Modules** - * (modules) [#5572](https://github.com/cosmos/cosmos-sdk/pull/5572) Separate balance from accounts per ADR 004. - _ Account balances are now persisted and retrieved via the `x/bank` module. - _ Vesting account interface has been modified to account for changes. - _ Callers to `NewBaseVestingAccount` are responsible for verifying account balance in relation to - the original vesting amount. - _ The `SendKeeper` and `ViewKeeper` interfaces in `x/bank` have been modified to account for changes. - * (x/auth) [#5533](https://github.com/cosmos/cosmos-sdk/pull/5533) Migrate the `x/auth` module to use Protocol Buffers for state - serialization instead of Amino. - _ The `BaseAccount.PubKey` field is now represented as a Bech32 string instead of a `crypto.Pubkey`. - _ `NewBaseAccountWithAddress` now returns a reference to a `BaseAccount`. - _ The `x/auth` module now accepts a `Codec` interface which extends the `codec.Marshaler` interface by - requiring a concrete codec to know how to serialize accounts. - _ The `AccountRetriever` type now accepts a `Codec` in its constructor in order to know how to - serialize accounts. - * (x/bank) [#6518](https://github.com/cosmos/cosmos-sdk/pull/6518) Support for global and per-denomination send enabled flags. - * Existing send_enabled global flag has been moved into a Params structure as `default_send_enabled`. - * An array of: `{denom: string, enabled: bool}` is added to bank Params to support per-denomination override of global default value. - * (x/distribution) [#5610](https://github.com/cosmos/cosmos-sdk/pull/5610) Migrate the `x/distribution` module to use Protocol Buffers for state - serialization instead of Amino. The exact codec used is `codec.HybridCodec` which utilizes Protobuf for binary encoding and Amino - for JSON encoding. - _ `ValidatorHistoricalRewards.ReferenceCount` is now of types `uint32` instead of `uint16`. - _ `ValidatorSlashEvents` is now a struct with `slashevents`. - _ `ValidatorOutstandingRewards` is now a struct with `rewards`. - _ `ValidatorAccumulatedCommission` is now a struct with `commission`. \* The `Keeper` constructor now takes a `codec.Marshaler` instead of a concrete Amino codec. This exact type - provided is specified by `ModuleCdc`. - * (x/evidence) [#5634](https://github.com/cosmos/cosmos-sdk/pull/5634) Migrate the `x/evidence` module to use Protocol Buffers for state - serialization instead of Amino. - _ The `internal` sub-package has been removed in order to expose the types proto file. - _ The module now accepts a `Codec` interface which extends the `codec.Marshaler` interface by - requiring a concrete codec to know how to serialize `Evidence` types. \* The `MsgSubmitEvidence` message has been removed in favor of `MsgSubmitEvidenceBase`. The application-level - codec must now define the concrete `MsgSubmitEvidence` type which must implement the module's `MsgSubmitEvidence` - interface. - * (x/evidence) [#5952](https://github.com/cosmos/cosmos-sdk/pull/5952) Remove parameters from `x/evidence` genesis and module state. The `x/evidence` module now solely uses Tendermint consensus parameters to determine of evidence is valid or not. - * (x/gov) [#5737](https://github.com/cosmos/cosmos-sdk/pull/5737) Migrate the `x/gov` module to use Protocol - Buffers for state serialization instead of Amino. - _ `MsgSubmitProposal` will be removed in favor of the application-level proto-defined `MsgSubmitProposal` which - implements the `MsgSubmitProposalI` interface. Applications should extend the `NewMsgSubmitProposalBase` type - to define their own concrete `MsgSubmitProposal` types. - _ The module now accepts a `Codec` interface which extends the `codec.Marshaler` interface by - requiring a concrete codec to know how to serialize `Proposal` types. - * (x/mint) [#5634](https://github.com/cosmos/cosmos-sdk/pull/5634) Migrate the `x/mint` module to use Protocol Buffers for state - serialization instead of Amino. \* The `internal` sub-package has been removed in order to expose the types proto file. - * (x/slashing) [#5627](https://github.com/cosmos/cosmos-sdk/pull/5627) Migrate the `x/slashing` module to use Protocol Buffers for state - serialization instead of Amino. The exact codec used is `codec.HybridCodec` which utilizes Protobuf for binary encoding and Amino - for JSON encoding. \* The `Keeper` constructor now takes a `codec.Marshaler` instead of a concrete Amino codec. This exact type - provided is specified by `ModuleCdc`. - * (x/staking) [#6844](https://github.com/cosmos/cosmos-sdk/pull/6844) Validators are now inserted into the unbonding queue based on their unbonding time and height. The relevant keeper APIs are modified to reflect these changes by now also requiring a height. - * (x/staking) [#6061](https://github.com/cosmos/cosmos-sdk/pull/6061) Allow a validator to immediately unjail when no signing info is present due to - falling below their minimum self-delegation and never having been bonded. The validator may immediately unjail once they've met their minimum self-delegation. - * (x/staking) [#5600](https://github.com/cosmos/cosmos-sdk/pull/5600) Migrate the `x/staking` module to use Protocol Buffers for state - serialization instead of Amino. The exact codec used is `codec.HybridCodec` which utilizes Protobuf for binary encoding and Amino - for JSON encoding. - _ `BondStatus` is now of type `int32` instead of `byte`. - _ Types of `int16` in the `Params` type are now of type `int32`. - _ Every reference of `crypto.Pubkey` in context of a `Validator` is now of type string. `GetPubKeyFromBech32` must be used to get the `crypto.Pubkey`. - _ The `Keeper` constructor now takes a `codec.Marshaler` instead of a concrete Amino codec. This exact type - provided is specified by `ModuleCdc`. - * (x/staking) [#7979](https://github.com/cosmos/cosmos-sdk/pull/7979) keeper pubkey storage serialization migration - from bech32 to protobuf. - * (x/supply) [#6010](https://github.com/cosmos/cosmos-sdk/pull/6010) Removed the `x/supply` module by merging the existing types and APIs into the `x/bank` module. - * (x/supply) [#5533](https://github.com/cosmos/cosmos-sdk/pull/5533) Migrate the `x/supply` module to use Protocol Buffers for state - serialization instead of Amino. - _ The `internal` sub-package has been removed in order to expose the types proto file. - _ The `x/supply` module now accepts a `Codec` interface which extends the `codec.Marshaler` interface by - requiring a concrete codec to know how to serialize `SupplyI` types. \* The `SupplyI` interface has been modified to no longer return `SupplyI` on methods. Instead the - concrete type's receiver should modify the type. - * (x/upgrade) [#5659](https://github.com/cosmos/cosmos-sdk/pull/5659) Migrate the `x/upgrade` module to use Protocol - Buffers for state serialization instead of Amino. - _ The `internal` sub-package has been removed in order to expose the types proto file. - _ The `x/upgrade` module now accepts a `codec.Marshaler` interface. +* (x/gov) [#17910](https://github.com/cosmos/cosmos-sdk/pull/17910) Remove telemetry for counting votes and proposals. It was incorrectly counting votes. Use alternatives, such as state streaming. +* (abci) [#15845](https://github.com/cosmos/cosmos-sdk/pull/15845) Remove duplicating events in `logs`. +* (abci) [#15845](https://github.com/cosmos/cosmos-sdk/pull/15845) Add `msg_index` to all event attributes to associate events and messages. +* (x/staking) [#15701](https://github.com/cosmos/cosmos-sdk/pull/15701) `HistoricalInfoKey` now has a binary format. +* (store/streaming) [#15519](https://github.com/cosmos/cosmos-sdk/pull/15519/files) State Streaming removed emitting of beginblock, endblock and delivertx in favour of emitting FinalizeBlock. +* (baseapp) [#15519](https://github.com/cosmos/cosmos-sdk/pull/15519/files) BeginBlock & EndBlock events have begin or endblock in the events in order to identify which stage they are emitted from since they are returned to comet as FinalizeBlock events. +* (grpc-web) [#14652](https://github.com/cosmos/cosmos-sdk/pull/14652) Use same port for gRPC-Web and the API server. -### Features +### CLI Breaking Changes -* **Baseapp / Client / REST** - * (x/auth) [#6213](https://github.com/cosmos/cosmos-sdk/issues/6213) Introduce new protobuf based path for transaction signing, see [ADR020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md) for more details - * (x/auth) [#6350](https://github.com/cosmos/cosmos-sdk/pull/6350) New sign-batch command to sign StdTx batch files. - * (baseapp) [#5803](https://github.com/cosmos/cosmos-sdk/pull/5803) Added support for taking state snapshots at regular height intervals, via options `snapshot-interval` and `snapshot-keep-recent`. - * (baseapp) [#7519](https://github.com/cosmos/cosmos-sdk/pull/7519) Add `ServiceMsgRouter` to BaseApp to handle routing of protobuf service `Msg`s. The two new types defined in ADR 031, `sdk.ServiceMsg` and `sdk.MsgRequest` are introduced with this router. - * (client) [#5921](https://github.com/cosmos/cosmos-sdk/issues/5921) Introduce new gRPC and gRPC Gateway based APIs for querying app & module data. See [ADR021](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-021-protobuf-query-encoding.md) for more details - * (cli) [#7485](https://github.com/cosmos/cosmos-sdk/pull/7485) Introduce a new optional `--keyring-dir` flag that allows clients to specify a Keyring directory if it does not reside in the directory specified by `--home`. - * (cli) [#7221](https://github.com/cosmos/cosmos-sdk/pull/7221) Add the option of emitting amino encoded json from the CLI - * (codec) [#7519](https://github.com/cosmos/cosmos-sdk/pull/7519) `InterfaceRegistry` now inherits `jsonpb.AnyResolver`, and has a `RegisterCustomTypeURL` method to support ADR 031 packing of `Any`s. `AnyResolver` is now a required parameter to `RejectUnknownFields`. - * (coin) [#6755](https://github.com/cosmos/cosmos-sdk/pull/6755) Add custom regex validation for `Coin` denom by overwriting `CoinDenomRegex` when using `/types/coin.go`. - * (config) [#7265](https://github.com/cosmos/cosmos-sdk/pull/7265) Support Tendermint block pruning through a new `min-retain-blocks` configuration that can be set in either `app.toml` or via the CLI. This parameter is used in conjunction with other criteria to determine the height at which Tendermint should prune blocks. - * (events) [#7121](https://github.com/cosmos/cosmos-sdk/pull/7121) The application now derives what events are indexed by Tendermint via the `index-events` configuration in `app.toml`, which is a list of events taking the form `{eventType}.{attributeKey}`. - * (tx) [#6089](https://github.com/cosmos/cosmos-sdk/pull/6089) Transactions can now have a `TimeoutHeight` set which allows the transaction to be rejected if it's committed at a height greater than the timeout. - * (rest) [#6167](https://github.com/cosmos/cosmos-sdk/pull/6167) Support `max-body-bytes` CLI flag for the REST service. - * (genesis) [#7089](https://github.com/cosmos/cosmos-sdk/pull/7089) The `export` command now adds a `initial_height` field in the exported JSON. Baseapp's `CommitMultiStore` now also has a `SetInitialVersion` setter, so it can set the initial store version inside `InitChain` and start a new chain from a given height. -* **General** - * (crypto/multisig) [#6241](https://github.com/cosmos/cosmos-sdk/pull/6241) Add Multisig type directly to the repo. Previously this was in tendermint. - * (codec/types) [#8106](https://github.com/cosmos/cosmos-sdk/pull/8106) Adding `NewAnyWithCustomTypeURL` to correctly - marshal Messages in TxBuilder. - * (tests) [#6489](https://github.com/cosmos/cosmos-sdk/pull/6489) Introduce package `testutil`, new in-process testing network framework for use in integration and unit tests. - * (tx) Add new auth/tx gRPC & gRPC-Gateway endpoints for basic querying & broadcasting support - * [#7842](https://github.com/cosmos/cosmos-sdk/pull/7842) Add TxsByEvent gRPC endpoint - * [#7852](https://github.com/cosmos/cosmos-sdk/pull/7852) Add tx broadcast gRPC endpoint - * (tx) [#7688](https://github.com/cosmos/cosmos-sdk/pull/7688) Add a new Tx gRPC service with methods `Simulate` and `GetTx` (by hash). - * (store) [#5803](https://github.com/cosmos/cosmos-sdk/pull/5803) Added `rootmulti.Store` methods for taking and restoring snapshots, based on `iavl.Store` export/import. - * (store) [#6324](https://github.com/cosmos/cosmos-sdk/pull/6324) IAVL store query proofs now return CommitmentOp which wraps an ics23 CommitmentProof - * (store) [#6390](https://github.com/cosmos/cosmos-sdk/pull/6390) `RootMulti` store query proofs now return `CommitmentOp` which wraps `CommitmentProofs` - * `store.Query` now only returns chained `ics23.CommitmentProof` wrapped in `merkle.Proof` - * `ProofRuntime` only decodes and verifies `ics23.CommitmentProof` -* **Modules** - * (modules) [#5921](https://github.com/cosmos/cosmos-sdk/issues/5921) Introduction of Query gRPC service definitions along with REST annotations for gRPC Gateway for each module - * (modules) [#7540](https://github.com/cosmos/cosmos-sdk/issues/7540) Protobuf service definitions can now be used for - packing `Msg`s in transactions as defined in [ADR 031](./docs/architecture/adr-031-msg-service.md). All modules now - define a `Msg` protobuf service. - * (x/auth/vesting) [#7209](https://github.com/cosmos/cosmos-sdk/pull/7209) Create new `MsgCreateVestingAccount` message type along with CLI handler that allows for the creation of delayed and continuous vesting types. - * (x/capability) [#5828](https://github.com/cosmos/cosmos-sdk/pull/5828) Capability module integration as outlined in [ADR 3 - Dynamic Capability Store](https://github.com/cosmos/tree/master/docs/architecture/adr-003-dynamic-capability-store.md). - * (x/crisis) `x/crisis` has a new function: `AddModuleInitFlags`, which will register optional crisis module flags for the start command. - * (x/ibc) [#5277](https://github.com/cosmos/cosmos-sdk/pull/5277) `x/ibc` changes from IBC alpha. For more details check the [`x/ibc/core/spec`](https://github.com/cosmos/cosmos-sdk/tree/master/x/ibc/core/spec) directory, or the ICS specs below: - * [ICS 002 - Client Semantics](https://github.com/cosmos/ics/tree/master/spec/ics-002-client-semantics) subpackage - * [ICS 003 - Connection Semantics](https://github.com/cosmos/ics/blob/master/spec/ics-003-connection-semantics) subpackage - * [ICS 004 - Channel and Packet Semantics](https://github.com/cosmos/ics/blob/master/spec/ics-004-channel-and-packet-semantics) subpackage - * [ICS 005 - Port Allocation](https://github.com/cosmos/ics/blob/master/spec/ics-005-port-allocation) subpackage - * [ICS 006 - Solo Machine Client](https://github.com/cosmos/ics/tree/master/spec/ics-006-solo-machine-client) subpackage - * [ICS 007 - Tendermint Client](https://github.com/cosmos/ics/blob/master/spec/ics-007-tendermint-client) subpackage - * [ICS 009 - Loopback Client](https://github.com/cosmos/ics/tree/master/spec/ics-009-loopback-client) subpackage - * [ICS 020 - Fungible Token Transfer](https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer) subpackage - * [ICS 023 - Vector Commitments](https://github.com/cosmos/ics/tree/master/spec/ics-023-vector-commitments) subpackage - * [ICS 024 - Host State Machine Requirements](https://github.com/cosmos/ics/tree/master/spec/ics-024-host-requirements) subpackage - * (x/ibc) [#6374](https://github.com/cosmos/cosmos-sdk/pull/6374) ICS-23 Verify functions will now accept and verify ics23 CommitmentProofs exclusively - * (x/params) [#6005](https://github.com/cosmos/cosmos-sdk/pull/6005) Add new CLI command for querying raw x/params parameters by subspace and key. +* (all) The migration of modules to [AutoCLI](https://docs.cosmos.network/main/core/autocli) led to no changes in UX but a [small change in CLI outputs](https://github.com/cosmos/cosmos-sdk/issues/16651) where results can be nested. +* (all) Query pagination flags have been renamed with the migration to AutoCLI: + * `--reverse` -> `--page-reverse` + * `--offset` -> `--page-offset` + * `--limit` -> `--page-limit` + * `--count-total` -> `--page-count-total` +* (cli) [#17184](https://github.com/cosmos/cosmos-sdk/pull/17184) All json keys returned by the `status` command are now snake case instead of pascal case. +* (server) [#17177](https://github.com/cosmos/cosmos-sdk/pull/17177) Remove `iavl-lazy-loading` configuration. +* (x/gov) [#16987](https://github.com/cosmos/cosmos-sdk/pull/16987) In ` query gov proposals` the proposal status flag have renamed from `--status` to `--proposal-status`. Additionally, that flags now uses the ENUM values: `PROPOSAL_STATUS_DEPOSIT_PERIOD`, `PROPOSAL_STATUS_VOTING_PERIOD`, `PROPOSAL_STATUS_PASSED`, `PROPOSAL_STATUS_REJECTED`, `PROPOSAL_STATUS_FAILED`. +* (x/bank) [#16899](https://github.com/cosmos/cosmos-sdk/pull/16899) With the migration to AutoCLI some bank commands have been split in two: + * Use `total-supply` (or `total`) for querying the total supply and `total-supply-of` for querying the supply of a specific denom. + * Use `denoms-metadata` for querying all denom metadata and `denom-metadata` for querying a specific denom metadata. +* (rosetta) [#16276](https://github.com/cosmos/cosmos-sdk/issues/16276) Rosetta migration to standalone repo. +* (cli) [#15826](https://github.com/cosmos/cosmos-sdk/pull/15826) Remove ` q account` command. Use ` q auth account` instead. +* (cli) [#15299](https://github.com/cosmos/cosmos-sdk/pull/15299) Remove `--amino` flag from `sign` and `multi-sign` commands. Amino `StdTx` has been deprecated for a while. Amino JSON signing still works as expected. +* (x/gov) [#14880](https://github.com/cosmos/cosmos-sdk/pull/14880) Remove ` tx gov submit-legacy-proposal cancel-software-upgrade` and `software-upgrade` commands. These commands are now in the `x/upgrade` module and using gov v1. Use `tx upgrade software-upgrade` instead. +* (x/staking) [#14864](https://github.com/cosmos/cosmos-sdk/pull/14864) ` tx staking create-validator` CLI command now takes a json file as an arg instead of using required flags. +* (cli) [#14659](https://github.com/cosmos/cosmos-sdk/pull/14659) ` q block ` is removed as it just output json. The new command allows either height/hash and is ` q block --type=height|hash `. +* (grpc-web) [#14652](https://github.com/cosmos/cosmos-sdk/pull/14652) Remove `grpc-web.address` flag. +* (client) [#14342](https://github.com/cosmos/cosmos-sdk/pull/14342) ` config` command is now a sub-command using Confix. Use ` config --help` to learn more. + +### Bug Fixes + +* (server) [#18254](https://github.com/cosmos/cosmos-sdk/pull/18254) Don't hardcode gRPC address to localhost. +* (x/gov) [#18173](https://github.com/cosmos/cosmos-sdk/pull/18173) Gov hooks now return an error and are *blocking* when they fail. Expect for `AfterProposalFailedMinDeposit` and `AfterProposalVotingPeriodEnded` which log the error and continue. +* (x/gov) [#17873](https://github.com/cosmos/cosmos-sdk/pull/17873) Fail any inactive and active proposals that cannot be decoded. +* (x/slashing) [#18016](https://github.com/cosmos/cosmos-sdk/pull/18016) Fixed builder function for missed blocks key (`validatorMissedBlockBitArrayPrefixKey`) in slashing/migration/v4. +* (x/bank) [#18107](https://github.com/cosmos/cosmos-sdk/pull/18107) Add missing keypair of SendEnabled to restore legacy param set before migration. +* (baseapp) [#17769](https://github.com/cosmos/cosmos-sdk/pull/17769) Ensure we respect block size constraints in the `DefaultProposalHandler`'s `PrepareProposal` handler when a nil or no-op mempool is used. We provide a `TxSelector` type to assist in making transaction selection generalized. We also fix a comparison bug in tx selection when `req.maxTxBytes` is reached. +* (mempool) [#17668](https://github.com/cosmos/cosmos-sdk/pull/17668) Fix `PriorityNonceIterator.Next()` nil pointer ref for min priority at the end of iteration. +* (config) [#17649](https://github.com/cosmos/cosmos-sdk/pull/17649) Fix `mempool.max-txs` configuration is invalid in `app.config`. +* (baseapp) [#17518](https://github.com/cosmos/cosmos-sdk/pull/17518) Utilizing voting power from vote extensions (CometBFT) instead of the current bonded tokens (x/staking) to determine if a set of vote extensions are valid. +* (baseapp) [#17251](https://github.com/cosmos/cosmos-sdk/pull/17251) VerifyVoteExtensions and ExtendVote initialize their own contexts/states, allowing VerifyVoteExtensions being called without ExtendVote. +* (x/distribution) [#17236](https://github.com/cosmos/cosmos-sdk/pull/17236) Using "validateCommunityTax" in "Params.ValidateBasic", preventing panic when field "CommunityTax" is nil. +* (x/bank) [#17170](https://github.com/cosmos/cosmos-sdk/pull/17170) Avoid empty spendable error message on send coins. +* (x/group) [#17146](https://github.com/cosmos/cosmos-sdk/pull/17146) Rename x/group legacy ORM package's error codespace from "orm" to "legacy_orm", preventing collisions with ORM's error codespace "orm". +* (types/query) [#16905](https://github.com/cosmos/cosmos-sdk/pull/16905) Collections Pagination now applies proper count when filtering results. +* (x/bank) [#16841](https://github.com/cosmos/cosmos-sdk/pull/16841) Correctly process legacy `DenomAddressIndex` values. +* (x/auth/vesting) [#16733](https://github.com/cosmos/cosmos-sdk/pull/16733) Panic on overflowing and negative EndTimes when creating a PeriodicVestingAccount. +* (x/consensus) [#16713](https://github.com/cosmos/cosmos-sdk/pull/16713) Add missing ABCI param in `MsgUpdateParams`. +* (baseapp) [#16700](https://github.com/cosmos/cosmos-sdk/pull/16700) Fix consensus failure in returning no response to malformed transactions. +* [#16639](https://github.com/cosmos/cosmos-sdk/pull/16639) Make sure we don't execute blocks beyond the halt height. +* (baseapp) [#16613](https://github.com/cosmos/cosmos-sdk/pull/16613) Ensure each message in a transaction has a registered handler, otherwise `CheckTx` will fail. +* (baseapp) [#16596](https://github.com/cosmos/cosmos-sdk/pull/16596) Return error during `ExtendVote` and `VerifyVoteExtension` if the request height is earlier than `VoteExtensionsEnableHeight`. +* (baseapp) [#16259](https://github.com/cosmos/cosmos-sdk/pull/16259) Ensure the `Context` block height is correct after `InitChain` and prior to the second block. +* (x/gov) [#16231](https://github.com/cosmos/cosmos-sdk/pull/16231) Fix Rawlog JSON formatting of proposal_vote option field.* (cli) [#16138](https://github.com/cosmos/cosmos-sdk/pull/16138) Fix snapshot commands panic if snapshot don't exists. +* (x/staking) [#16043](https://github.com/cosmos/cosmos-sdk/pull/16043) Call `AfterUnbondingInitiated` hook for new unbonding entries only and fix `UnbondingDelegation` entries handling. This is a behavior change compared to Cosmos SDK v0.47.x, now the hook is called only for new unbonding entries. +* (types) [#16010](https://github.com/cosmos/cosmos-sdk/pull/16010) Let `module.CoreAppModuleBasicAdaptor` fallback to legacy genesis handling. +* (types) [#15691](https://github.com/cosmos/cosmos-sdk/pull/15691) Make `Coin.Validate()` check that `.Amount` is not nil. +* (x/crypto) [#15258](https://github.com/cosmos/cosmos-sdk/pull/15258) Write keyhash file with permissions 0600 instead of 0555. +* (x/auth) [#15059](https://github.com/cosmos/cosmos-sdk/pull/15059) `ante.CountSubKeys` returns 0 when passing a nil `Pubkey`. +* (x/capability) [#15030](https://github.com/cosmos/cosmos-sdk/pull/15030) Prevent `x/capability` from consuming `GasMeter` gas during `InitMemStore` +* (types/coin) [#14739](https://github.com/cosmos/cosmos-sdk/pull/14739) Deprecate the method `Coin.IsEqual` in favour of `Coin.Equal`. The difference between the two methods is that the first one results in a panic when denoms are not equal. This panic lead to unexpected behavior. -### Bug Fixes +### Deprecated -* **Baseapp / Client / REST** - * (client) [#5964](https://github.com/cosmos/cosmos-sdk/issues/5964) `--trust-node` is now false by default - for real. Users must ensure it is set to true if they don't want to enable the verifier. - * (client) [#6402](https://github.com/cosmos/cosmos-sdk/issues/6402) Fix `keys add` `--algo` flag which only worked for Tendermint's `secp256k1` default key signing algorithm. - * (client) [#7699](https://github.com/cosmos/cosmos-sdk/pull/7699) Fix panic in context when setting invalid nodeURI. `WithNodeURI` does not set the `Client` in the context. - * (export) [#6510](https://github.com/cosmos/cosmos-sdk/pull/6510/) Field TimeIotaMs now is included in genesis file while exporting. - * (rest) [#5906](https://github.com/cosmos/cosmos-sdk/pull/5906) Fix an issue that make some REST calls panic when sending invalid or incomplete requests. - * (crypto) [#7966](https://github.com/cosmos/cosmos-sdk/issues/7966) `Bip44Params` `String()` function now correctly - returns the absolute HD path by adding the `m/` prefix. - * (crypto/keyring) [#5844](https://github.com/cosmos/cosmos-sdk/pull/5844) `Keyring.Sign()` methods no longer decode amino signatures when method receivers - are offline/multisig keys. - * (store) [#7415](https://github.com/cosmos/cosmos-sdk/pull/7415) Allow new stores to be registered during on-chain upgrades. -* **Modules** - _ (modules) [#5569](https://github.com/cosmos/cosmos-sdk/issues/5569) `InitGenesis`, for the relevant modules, now ensures module accounts exist. - _ (x/auth) [#5892](https://github.com/cosmos/cosmos-sdk/pull/5892) Add `RegisterKeyTypeCodec` to register new - types (eg. keys) to the `auth` module internal amino codec. - _ (x/bank) [#6536](https://github.com/cosmos/cosmos-sdk/pull/6536) Fix bug in `WriteGeneratedTxResponse` function used by multiple - REST endpoints. Now it writes a Tx in StdTx format. - _ (x/genutil) [#5938](https://github.com/cosmos/cosmos-sdk/pull/5938) Fix `InitializeNodeValidatorFiles` error handling. - _ (x/gentx) [#8183](https://github.com/cosmos/cosmos-sdk/pull/8183) change gentx cmd amount to arg from flag - _ (x/gov) [#7641](https://github.com/cosmos/cosmos-sdk/pull/7641) Fix tally calculation precision error. - _ (x/staking) [#6529](https://github.com/cosmos/cosmos-sdk/pull/6529) Export validator addresses (previously was empty). - _ (x/staking) [#5949](https://github.com/cosmos/cosmos-sdk/pull/5949) Skip staking `HistoricalInfoKey` in simulations as headers are not exported. \* (x/staking) [#6061](https://github.com/cosmos/cosmos-sdk/pull/6061) Allow a validator to immediately unjail when no signing info is present due to - falling below their minimum self-delegation and never having been bonded. The validator may immediately unjail once they've met their minimum self-delegation. -* **General** - * (types) [#7038](https://github.com/cosmos/cosmos-sdk/issues/7038) Fix infinite looping of `ApproxRoot` by including a hard-coded maximum iterations limit of 100. - * (types) [#7084](https://github.com/cosmos/cosmos-sdk/pull/7084) Fix panic when calling `BigInt()` on an uninitialized `Int`. - * (simulation) [#7129](https://github.com/cosmos/cosmos-sdk/issues/7129) Fix support for custom `Account` and key types on auth's simulation. +* (types) [#16980](https://github.com/cosmos/cosmos-sdk/pull/16980) Deprecate `IntProto` and `DecProto`. Instead, `math.Int` and `math.LegacyDec` should be used respectively. Both types support `Marshal` and `Unmarshal` for binary serialization. +* (x/staking) [#14567](https://github.com/cosmos/cosmos-sdk/pull/14567) The `delegator_address` field of `MsgCreateValidator` has been deprecated. + The validator address bytes and delegator address bytes refer to the same account while creating validator (defer only in bech32 notation). -### Improvements +## Previous Versions -* **Baseapp / Client / REST** - * (baseapp) [#6186](https://github.com/cosmos/cosmos-sdk/issues/6186) Support emitting events during `AnteHandler` execution. - * (baseapp) [#6053](https://github.com/cosmos/cosmos-sdk/pull/6053) Customizable panic recovery handling added for `app.runTx()` method (as proposed in the [ADR 22](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-022-custom-panic-handling.md)). Adds ability for developers to register custom panic handlers extending standard ones. - * (client) [#5810](https://github.com/cosmos/cosmos-sdk/pull/5810) Added a new `--offline` flag that allows commands to be executed without an - internet connection. Previously, `--generate-only` served this purpose in addition to only allowing txs to be generated. Now, `--generate-only` solely - allows txs to be generated without being broadcasted and disallows Keybase use and `--offline` allows the use of Keybase but does not allow any - functionality that requires an online connection. - * (cli) [#7764](https://github.com/cosmos/cosmos-sdk/pull/7764) Update x/banking and x/crisis InitChain to improve node startup time - * (client) [#5856](https://github.com/cosmos/cosmos-sdk/pull/5856) Added the possibility to set `--offline` flag with config command. - * (client) [#5895](https://github.com/cosmos/cosmos-sdk/issues/5895) show config options in the config command's help screen. - * (client/keys) [#8043](https://github.com/cosmos/cosmos-sdk/pull/8043) Add support for export of unarmored private key - * (client/tx) [#7801](https://github.com/cosmos/cosmos-sdk/pull/7801) Update sign-batch multisig to work online - * (x/genutil) [#8099](https://github.com/cosmos/cosmos-sdk/pull/8099) `init` now supports a `--recover` flag to recover - the private validator key from a given mnemonic -* **Modules** - * (x/auth) [#5702](https://github.com/cosmos/cosmos-sdk/pull/5702) Add parameter querying support for `x/auth`. - * (x/auth/ante) [#6040](https://github.com/cosmos/cosmos-sdk/pull/6040) `AccountKeeper` interface used for `NewAnteHandler` and handler's decorators to add support of using custom `AccountKeeper` implementations. - * (x/evidence) [#5952](https://github.com/cosmos/cosmos-sdk/pull/5952) Tendermint Consensus parameters can now be changed via parameter change proposals through `x/gov`. - * (x/evidence) [#5961](https://github.com/cosmos/cosmos-sdk/issues/5961) Add `StoreDecoder` simulation for evidence module. - * (x/ibc) [#5948](https://github.com/cosmos/cosmos-sdk/issues/5948) Add `InitGenesis` and `ExportGenesis` functions for `ibc` module. - * (x/ibc-transfer) [#6871](https://github.com/cosmos/cosmos-sdk/pull/6871) Implement [ADR 001 - Coin Source Tracing](./docs/architecture/adr-001-coin-source-tracing.md). - * (x/staking) [#6059](https://github.com/cosmos/cosmos-sdk/pull/6059) Updated `HistoricalEntries` parameter default to 100. - * (x/staking) [#5584](https://github.com/cosmos/cosmos-sdk/pull/5584) Add util function `ToTmValidator` that converts a `staking.Validator` type to `*tmtypes.Validator`. - * (x/staking) [#6163](https://github.com/cosmos/cosmos-sdk/pull/6163) CLI and REST call to unbonding delegations and delegations now accept - pagination. - * (x/staking) [#8178](https://github.com/cosmos/cosmos-sdk/pull/8178) Update default historical header number for stargate -* **General** - * (crypto) [#7987](https://github.com/cosmos/cosmos-sdk/pull/7987) Fix the inconsistency of CryptoCdc, only use - `codec/legacy.Cdc`. - * (logging) [#8072](https://github.com/cosmos/cosmos-sdk/pull/8072) Refactor logging: - _ Use [zerolog](https://github.com/rs/zerolog) over Tendermint's go-kit logging wrapper. - _ Introduce Tendermint's `--log_format=plain|json` flag. Using format `json` allows for emitting structured JSON - logs which can be consumed by an external logging facility (e.g. Loggly). Both formats log to STDERR. \* The existing `--log_level` flag and it's default value now solely relates to the global logging - level (e.g. `info`, `debug`, etc...) instead of `:`. - * (rest) [#7649](https://github.com/cosmos/cosmos-sdk/pull/7649) Return an unsigned tx in legacy GET /tx endpoint when signature conversion fails - * (simulation) [#6002](https://github.com/cosmos/cosmos-sdk/pull/6002) Add randomized consensus params into simulation. - * (store) [#6481](https://github.com/cosmos/cosmos-sdk/pull/6481) Move `SimpleProofsFromMap` from Tendermint into the SDK. - * (store) [#6719](https://github.com/cosmos/cosmos-sdk/6754) Add validity checks to stores for nil and empty keys. - * (SDK) Updated dependencies - * Updated iavl dependency to v0.15.3 - * Update tendermint to v0.34.1 - * (types) [#7027](https://github.com/cosmos/cosmos-sdk/pull/7027) `Coin(s)` and `DecCoin(s)` updates: - * Bump denomination max length to 128 - * Allow uppercase letters and numbers in denominations to support [ADR 001](./docs/architecture/adr-001-coin-source-tracing.md) - * Added `Validate` function that returns a descriptive error - * (types) [#5581](https://github.com/cosmos/cosmos-sdk/pull/5581) Add convenience functions {,Must}Bech32ifyAddressBytes. - * (types/module) [#5724](https://github.com/cosmos/cosmos-sdk/issues/5724) The `types/module` package does no longer depend on `x/simulation`. - * (types) [#5585](https://github.com/cosmos/cosmos-sdk/pull/5585) IBC additions: - * `Coin` denomination max lenght has been increased to 32. - * Added `CapabilityKey` alias for `StoreKey` to match IBC spec. - * (types/rest) [#5900](https://github.com/cosmos/cosmos-sdk/pull/5900) Add Check\*Error function family to spare developers from replicating tons of boilerplate code. - * (types) [#6128](https://github.com/cosmos/cosmos-sdk/pull/6137) Add `String()` method to `GasMeter`. - * (types) [#6195](https://github.com/cosmos/cosmos-sdk/pull/6195) Add codespace to broadcast(sync/async) response. - * (types) [#6897](https://github.com/cosmos/cosmos-sdk/issues/6897) Add KV type from tendermint to `types` directory. - * (version) [#7848](https://github.com/cosmos/cosmos-sdk/pull/7848) [#7941](https://github.com/cosmos/cosmos-sdk/pull/7941) - `version --long` output now shows the list of build dependencies and replaced build dependencies. - -## Previous Releases - -[CHANGELOG of previous versions](https://github.com/cosmos/cosmos-sdk/blob/c17c3caab86a1426a1eef4541e8203f5f54a1a54/CHANGELOG.md#v0391---2020-08-11) (pre Stargate). +[CHANGELOG of previous versions](https://github.com/cosmos/cosmos-sdk/blob/main/CHANGELOG.md#v0470---2023-03-14). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b84bc6e302f5..d62d45049032 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -184,26 +184,14 @@ get away with telling people they can just `go get` our software. Since some dependencies are not under our control, a third party may break our build, in which case we can fall back on `go mod tidy -v`. -### `go.work` - -The Cosmos SDK is a multi-module repo, for this reason, the use of a `go.work` file is handy. -We provide a [`go.work.example`](./go.work.example) that contains all the modules used in the SDK. -Do note that contributions modifying multiple Go modules should be submitted as separate PRs, this allows us to tag the changes and avoid `replace`s. -For consistency between our CI and the local tests, `GOWORK=off` is set in the `Makefile`. This means that the `go.work` file is not used when using `make test` or any other `make` command. - ### `go.mod` When extracting a package to its own go modules, some extra steps are required, for keeping our CI checks and Dev UX: * Add a CHANGELOG.md / README.md under the new package folder * Add the package in [`labeler.yml`](./.github/labeler.yml) -* Add the package in [`go.work.example`](./go.work.example) * Add weekly dependabot checks (see [dependabot.yml](./.github/dependabot.yml)) * Add tests to github workflow [test.yml](.github/workflows/test.yml) (under submodules) -* Configure SonarCloud - * Add `sonar-projects.properties` (see math [sonar-projects.properties](./math/sonar-projects.properties) for example) - * Add a GitHub Workflow entry for running the scans (see [test.yml](.github/workflows/test.yml)) - * Ask the team to add the project to SonarCloud * (optional) Configure a `cosmossdk.io` vanity url by submitting a PR to [cosmos/vanity](https://github.com/cosmos/vanity). ## Protobuf diff --git a/Dockerfile b/Dockerfile index 2af186b6ecc5..2091f965fb1c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ # # This image is pushed to the GHCR as https://ghcr.io/cosmos/simapp -FROM golang:1.20-alpine AS build-env +FROM golang:1.23-alpine AS build-env # Install minimum necessary dependencies ENV PACKAGES curl make git libc-dev bash gcc linux-headers eudev-dev @@ -48,5 +48,8 @@ CMD ["simd"] STOPSIGNAL SIGTERM WORKDIR /root +# Install minimum necessary dependencies +RUN apk add --no-cache curl make bash jq sed + # Copy over binaries from the build-env COPY --from=build-env /go/src/github.com/cosmos/cosmos-sdk/build/simd /usr/bin/simd diff --git a/Makefile b/Makefile index cbbbcebbe7dc..9660988fc980 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,16 @@ PACKAGES_NOSIMULATION=$(shell go list ./... | grep -v '/simulation') PACKAGES_SIMTEST=$(shell go list ./... | grep '/simulation') -export VERSION := $(shell echo $(shell git describe --tags --always --match "v*") | sed 's/^v//') + +# Ensure all tags are fetched +VERSION_RAW := $(shell git fetch --tags --force >/dev/null 2>&1; git describe --tags --always --match "v*") +VERSION := $(shell echo $(VERSION_RAW) | sed -E 's/^v?([0-9]+\.[0-9]+\.[0-9]+.*)/\1/') + +# Fallback if the version is just a commit hash (not semver-like) +ifeq ($(findstring -,$(VERSION)),) # No "-" means it's just a hash + VERSION := 0.0.0-$(VERSION_RAW) +endif +export VERSION export CMTVERSION := $(shell go list -m github.com/cometbft/cometbft | sed 's:.* ::') export COMMIT := $(shell git log -1 --format='%H') LEDGER_ENABLED ?= true @@ -53,7 +62,6 @@ comma := , build_tags_comma_sep := $(subst $(whitespace),$(comma),$(build_tags)) # process linker flags - ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=sim \ -X github.com/cosmos/cosmos-sdk/version.AppName=simd \ -X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \ @@ -126,20 +134,18 @@ $(BUILDDIR)/: cosmovisor: $(MAKE) -C tools/cosmovisor cosmovisor -rosetta: - $(MAKE) -C tools/rosetta rosetta - confix: $(MAKE) -C tools/confix confix hubl: $(MAKE) -C tools/hubl hubl -.PHONY: build build-linux-amd64 build-linux-arm64 cosmovisor rosetta confix +.PHONY: build build-linux-amd64 build-linux-arm64 cosmovisor confix +#? mocks: Generate mock file mocks: $(MOCKS_DIR) - @go install github.com/golang/mock/mockgen@v1.6.0 + @go install go.uber.org/mock/mockgen@v0.5.0 sh ./scripts/mockgen.sh .PHONY: mocks @@ -230,7 +236,7 @@ $(CHECK_TEST_TARGETS): EXTRA_ARGS=-run=none $(CHECK_TEST_TARGETS): run-tests ARGS += -tags "$(test_tags)" -SUB_MODULES = $(shell find . -type f -name 'go.mod' -print0 | xargs -0 -n1 dirname | sort) +SUB_MODULES = $(shell find . -type f -name 'go.mod' -print0 | xargs -0 -n1 dirname | sort | grep -v './tests/systemtests') CURRENT_DIR = $(shell pwd) run-tests: ifneq (,$(shell which tparse 2>/dev/null)) @@ -280,9 +286,9 @@ test-sim-nondeterminism-streaming: test-sim-custom-genesis-fast: @echo "Running custom genesis simulation..." - @echo "By default, ${HOME}/.gaiad/config/genesis.json will be used." - @cd ${CURRENT_DIR}/simapp && go test -mod=readonly -run TestFullAppSimulation -Genesis=${HOME}/.gaiad/config/genesis.json \ - -Enabled=true -NumBlocks=100 -BlockSize=200 -Commit=true -Seed=99 -Period=5 -v -timeout 24h + @echo "By default, ${HOME}/.simapp/config/genesis.json will be used." + @cd ${CURRENT_DIR}/simapp && go test -mod=readonly -run TestFullAppSimulation -Genesis=${HOME}/.simapp/config/genesis.json \ + -Enabled=true -NumBlocks=100 -BlockSize=200 -Commit=true -Seed=99 -Period=5 -SigverifyTx=false -v -timeout 24h test-sim-import-export: runsim @echo "Running application import/export simulation. This may take several minutes..." @@ -294,8 +300,8 @@ test-sim-after-import: runsim test-sim-custom-genesis-multi-seed: runsim @echo "Running multi-seed custom genesis simulation..." - @echo "By default, ${HOME}/.gaiad/config/genesis.json will be used." - @cd ${CURRENT_DIR}/simapp && $(BINDIR)/runsim -Genesis=${HOME}/.gaiad/config/genesis.json -SimAppPkg=. -ExitOnFail 400 5 TestFullAppSimulation + @echo "By default, ${HOME}/.simapp/config/genesis.json will be used." + @cd ${CURRENT_DIR}/simapp && $(BINDIR)/runsim -Genesis=${HOME}/.simapp/config/genesis.json -SigverifyTx=false -SimAppPkg=. -ExitOnFail 400 5 TestFullAppSimulation test-sim-multi-seed-long: runsim @echo "Running long multi-seed application simulation. This may take awhile!" @@ -366,11 +372,6 @@ test-sim-profile-streaming: .PHONY: test-sim-profile test-sim-benchmark -test-rosetta: - docker build -t rosetta-ci:latest -f contrib/rosetta/rosetta-ci/Dockerfile . - docker-compose -f contrib/rosetta/docker-compose.yaml up --abort-on-container-exit --exit-code-from test_rosetta --build -.PHONY: test-rosetta - benchmark: @go test -mod=readonly -bench=. $(PACKAGES_NOSIMULATION) .PHONY: benchmark @@ -379,17 +380,25 @@ benchmark: ### Linting ### ############################################################################### -golangci_lint_cmd=golangci-lint -golangci_version=v1.51.2 +golangci_version=v1.64.7 + +lint-install: + @echo "--> Installing golangci-lint $(golangci_version)" + @go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(golangci_version) lint: @echo "--> Running linter" - @go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(golangci_version) + $(MAKE) lint-install @./scripts/go-lint-all.bash --timeout=15m +lint-changes: + @echo "--> Running linter" + $(MAKE) lint-install + @./scripts/go-lint-changes.bash --timeout=15m + lint-fix: @echo "--> Running linter" - @go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(golangci_version) + $(MAKE) lint-install @./scripts/go-lint-all.bash --fix .PHONY: lint lint-fix @@ -398,7 +407,7 @@ lint-fix: ### Protobuf ### ############################################################################### -protoVer=0.13.2 +protoVer=0.16.0 protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer) protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) @@ -421,7 +430,7 @@ proto-lint: proto-check-breaking: @$(protoImage) buf breaking --against $(HTTPS_GIT)#branch=main -CMT_URL = https://raw.githubusercontent.com/cometbft/cometbft/v0.38.0-alpha.2/proto/tendermint +CMT_URL = https://raw.githubusercontent.com/cometbft/cometbft/v0.38.0/proto/tendermint CMT_CRYPTO_TYPES = proto/tendermint/crypto CMT_ABCI_TYPES = proto/tendermint/abci @@ -471,11 +480,11 @@ localnet-build-dlv: localnet-build-nodes: $(DOCKER) run --rm -v $(CURDIR)/.testnets:/data cosmossdk/simd \ - testnet init-files --v 4 -o /data --starting-ip-address 192.168.10.2 --keyring-backend=test - docker-compose up -d + testnet init-files --validator-count 4 -o /data --starting-ip-address 192.168.10.2 --keyring-backend=test + docker compose up -d localnet-stop: - docker-compose down + docker compose down # localnet-start will run a 4-node testnet locally. The nodes are # based off the docker images in: ./contrib/images/simd-env @@ -487,14 +496,43 @@ localnet-debug: localnet-stop localnet-build-dlv localnet-build-nodes .PHONY: localnet-start localnet-stop localnet-debug localnet-build-env localnet-build-dlv localnet-build-nodes -############################################################################### -### rosetta ### -############################################################################### -# builds rosetta test data dir -rosetta-data: - -docker container rm data_dir_build - docker build -t rosetta-ci:latest -f contrib/rosetta/rosetta-ci/Dockerfile . - docker run --name data_dir_build -t rosetta-ci:latest sh /rosetta/data.sh - docker cp data_dir_build:/tmp/data.tar.gz "$(CURDIR)/contrib/rosetta/rosetta-ci/data.tar.gz" - docker container rm data_dir_build -.PHONY: rosetta-data +test-system: build-v50 build + mkdir -p ./tests/systemtests/binaries/ + cp $(BUILDDIR)/simd ./tests/systemtests/binaries/ + mkdir -p ./tests/systemtests/binaries/v0.50 + mv $(BUILDDIR)/simdv50 ./tests/systemtests/binaries/v0.50/simd + $(MAKE) -C tests/systemtests test +.PHONY: test-system + +# build-v50 checks out the v0.50.x branch, builds the binary, and renames it to simdv50. +build-v50: + @echo "Starting v50 build process..." + git_status=$$(git status --porcelain) && \ + has_changes=false && \ + if [ -n "$$git_status" ]; then \ + echo "Stashing uncommitted changes..." && \ + git stash push -m "Temporary stash for v50 build" && \ + has_changes=true; \ + else \ + echo "No changes to stash"; \ + fi && \ + echo "Saving current reference..." && \ + CURRENT_REF=$$(git symbolic-ref --short HEAD 2>/dev/null || git rev-parse HEAD) && \ + echo "Checking out release branch..." && \ + git checkout release/v0.50.x && \ + echo "Building v50 binary..." && \ + make build && \ + mv build/simd build/simdv50 && \ + echo "Returning to original branch..." && \ + if [ "$$CURRENT_REF" = "HEAD" ]; then \ + git checkout $$(git rev-parse HEAD); \ + else \ + git checkout $$CURRENT_REF; \ + fi && \ + if [ "$$has_changes" = "true" ]; then \ + echo "Reapplying stashed changes..." && \ + git stash pop || echo "Warning: Could not pop stash, your changes may be in the stash list"; \ + else \ + echo "No changes to reapply"; \ + fi +.PHONY: build-v50 \ No newline at end of file diff --git a/README.md b/README.md index 3f1b4f5842c9..ecc0de92e876 100644 --- a/README.md +++ b/README.md @@ -14,12 +14,6 @@ Go report card - - Code Coverage - - - SonarCloud Analysis -
@@ -36,7 +30,7 @@ The Cosmos SDK is a framework for building blockchain applications. [CometBFT (B **WARNING**: The Cosmos SDK has mostly stabilized, but we are still making some breaking changes. -**Note**: Requires [Go 1.20+](https://go.dev/dl) +**Note**: We advise to always use the latest maintained [Go](https://go.dev/dl) version for building Cosmos SDK applications. ## Quick Start @@ -46,6 +40,11 @@ If you want to get started quickly and learn how to build on top of Cosmos SDK, For more information, see the [Cosmos SDK Documentation](https://docs.cosmos.network). +## Modules + +The Cosmos SDK maintains a set of modules that can be included in your blockchain application. For more information +on modules, see our [introduction doc](./x/README.md). + ## Contributing See [CONTRIBUTING.md](./CONTRIBUTING.md) for details on how to contribute and participate in our [dev calls](./CONTRIBUTING.md#teams-dev-calls). diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md new file mode 100644 index 000000000000..7f45285b4abc --- /dev/null +++ b/RELEASE_NOTES.md @@ -0,0 +1,16 @@ +# Cosmos SDK v0.50.12 Release Notes + +đŸ’Ŧ [**Release Discussion**](https://github.com/orgs/cosmos/discussions/58) + +## 🚀 Highlights + +This patch release fixes [GHSA-x5vx-95h7-rv4p](https://github.com/cosmos/cosmos-sdk/security/advisories/GHSA-x5vx-95h7-rv4p). +It resolves a `x/group` module issue that can halt chain when handling a malicious proposal. +Only users of the `x/group` module are affected by this issue. + +We recommended to upgrade to this patch release as soon as possible. +When upgrading from <= v0.50.11, please use a chain upgrade to ensure that 2/3 of the validator power upgrade to v0.50.12. + +## 📝 Changelog + +Check out the [changelog](https://github.com/cosmos/cosmos-sdk/blob/v0.50.12/CHANGELOG.md) for an exhaustive list of changes, or [compare changes](https://github.com/cosmos/cosmos-sdk/compare/v0.50.11...v0.50.12) from the last release. diff --git a/RELEASE_PROCESS.md b/RELEASE_PROCESS.md index 2d7920408610..44ae30a180d2 100644 --- a/RELEASE_PROCESS.md +++ b/RELEASE_PROCESS.md @@ -215,3 +215,34 @@ Currently residing Stable Release Managers: * @tac0turtle - Marko Baricevic * @julienrbrt - Julien Robert + +## Cosmos SDK Modules + +The Cosmos SDK repository is a mono-repo where its Go modules have a different release process and cadence than the Cosmos SDK itself. +There are two types of modules: + +1. Modules that import the Cosmos SDK and depend on a specific version of it. + * Modules to be imported in an app (e.g `x/` modules). + * Modules that are not imported into an app and are a standalone module (e.g. `cosmovisor`). +2. Modules that do not depend on the Cosmos SDK. + +The same changelog procedure applies to all modules in the Cosmos SDK repository, and must be up-to-date with the latest changes before tagging a module version. +Note: The Cosmos SDK team is in an active process of limiting Go modules that depend on the Cosmos SDK. + +### Modules that depend on the Cosmos SDK + +The Cosmos SDK team should strive to release modules that depend on the Cosmos SDK at the same time or soon after a major version Cosmos SDK itself. +Those modules can be considered as part of the Cosmos SDK, but features and improvements are released at a different cadence. + +* When a module is supposed to be used in an app (e.g `x/` modules), due to the dependency on the SDK, tagging a new version of a module must be done from a Cosmos SDK release branch. A compability matrix must be provided in the `README.md` of that module with the corresponding versions. +* Modules that import the SDK but do not need to be imported in an app (`e.g. cosmovisor`) must be released from the `main` branch and follow the process defined below. + +### Modules that do not depend on the Cosmos SDK + +Modules that do not depend on the Cosmos SDK can be released at any time from the `main` branch of the Cosmos SDK repository. + +#### Branches For Go Modules + +Branches that go modules are released from: + +* Store v1 is released from `release/v0.50.x` branch. diff --git a/UPGRADING.md b/UPGRADING.md index 07711026ad39..ee8e91ae7a24 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -3,651 +3,207 @@ This guide provides instructions for upgrading to specific versions of Cosmos SDK. Note, always read the **SimApp** section for more information on application wiring updates. -## [Unreleased] - -### Migration to CometBFT (Part 2) - -The Cosmos SDK has migrated in its previous versions, to CometBFT. -Some functions have been renamed to reflect the naming change. - -Following an exhaustive list: - -* `client.TendermintRPC` -> `client.CometRPC` -* `clitestutil.MockTendermintRPC` -> `clitestutil.MockCometRPC` -* `clitestutilgenutil.CreateDefaultTendermintConfig` -> `clitestutilgenutil.CreateDefaultCometConfig` -* Package `client/grpc/tmservice` -> `client/grpc/cmtservice` - -Additionally, the commands and flags mentioning `tendermint` have been renamed to `comet`. -However, these commands and flags is still supported for backward compatibility. - -For backward compatibility, the `**/tendermint/**` gRPC services are still supported. - -Additionally, the SDK is starting its abstraction from CometBFT Go types thorought the codebase: - -* The usage of CometBFT have been replaced to use the Cosmos SDK logger interface (`cosmossdk.io/log.Logger`). -* The usage of `github.com/cometbft/cometbft/libs/bytes.HexByte` have been replaced by `[]byte`. - -### Configuration - -A new tool have been created for migrating configuration of the SDK. Use the following command to migrate your configuration: - -```bash -simd config migrate v0.50 +## [v0.53.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.53.0) + +### BaseApp + +#### Nested Messages Simulation + +Now it is possible to simulate the nested messages of a message, providing developers with a powerful tool for +testing and predicting the behavior of complex transactions. This feature allows for a more comprehensive +evaluation of gas consumption, state changes, and potential errors that may occur when executing nested +messages. However, it's important to note that while the simulation can provide valuable insights, it does not +guarantee the correct execution of the nested messages in the future. Factors such as changes in the +blockchain state or updates to the protocol could potentially affect the actual execution of these nested +messages when the transaction is finally processed on the network. + +For example, consider a governance proposal that includes nested messages to update multiple protocol +parameters. At the time of simulation, the blockchain state may be suitable for executing all these nested +messages successfully. However, by the time the actual governance proposal is executed (which could be days or +weeks later), the blockchain state might have changed significantly. As a result, while the simulation showed +a successful execution, the actual governance proposal might fail when it's finally processed. + +By default, when simulating transactions, the gas cost of nested messages is not calculated. This means that +only the gas cost of the top-level message is considered. However, this behavior can be customized using the +`SetIncludeNestedMsgsGas` option when building the BaseApp. By providing a list of message types to this option, +you can specify which messages should have their nested message gas costs included in the simulation. This +allows for more accurate gas estimation for transactions involving specific message types that contain nested +messages, while maintaining the default behavior for other message types. + +Here is an example on how `SetIncludeNestedMsgsGas` option could be set to calculate the gas of a gov proposal +nested messages: +```go +baseAppOptions = append(baseAppOptions, baseapp.SetIncludeNestedMsgsGas([]sdk.Message{&gov.MsgSubmitProposal{}})) +// ... +app.App = appBuilder.Build(db, traceStore, baseAppOptions...) ``` -More information about [confix](https://docs.cosmos.network/main/tooling/confix). - -#### Events - -The log section of abci.TxResult is not populated in the case of successful msg(s) execution. Instead a new attribute is added to all messages indicating the `msg_index` which identifies which events and attributes relate the same transaction - -#### gRPC-Web - -gRPC-Web is now listening to the same address as the gRPC Gateway API server (default: `localhost:1317`). -The possibility to listen to a different address has been removed, as well as its settings. -Use `confix` to clean-up your `app.toml`. A nginx (or alike) reverse-proxy can be set to keep the previous behavior. - -#### Database Support - -ClevelDB, BoltDB and BadgerDB are not supported anymore. To migrate from a unsupported database to a supported database please use the database migration tool. - -### Protobuf - -With the deprecation of the amino JSON codec defined in [cosmos/gogoproto](https://github.com/cosmos/gogoproto) in favor of the protoreflect powered x/tx/aminojson codec, module developers are encouraged verify that their messages have the correct protobuf annotations to deterministically produce identical output from both codecs. - -For core SDK types equivalence is asserted by generative testing of [SignableTypes](https://github.com/cosmos/cosmos-sdk/blob/76f0d101530ed78befc95506ab473c771d0d8a8c/tests/integration/rapidgen/rapidgen.go#L106) in [TestAminoJSON_Equivalence](https://github.com/cosmos/cosmos-sdk/blob/76f0d101530ed78befc95506ab473c771d0d8a8c/tests/integration/aminojson/aminojson_test.go#L90). - -TODO: summarize proto annotation requirements. - -#### Stringer - -The `gogoproto.goproto_stringer = false` annotation has been removed from most proto files. This means that the `String()` method is being generated for types that previously had this annotation. The generated `String()` method uses `proto.CompactTextString` for _stringifying_ structs. -[Verify](https://github.com/cosmos/cosmos-sdk/pull/13850#issuecomment-1328889651) the usage of the modified `String()` methods and double-check that they are not used in state-machine code. - ### SimApp - - -#### Module Assertions +In this section we describe the changes made in Cosmos SDK' SimApp. +**These changes are directly applicable to your application wiring.** +Please read this section first, but for an exhaustive list of changes, refer to the [CHANGELOG](./simapp/CHANGELOG.md). -Previously, all modules were required to be set in `OrderBeginBlockers`, `OrderEndBlockers` and `OrderInitGenesis / OrderExportGenesis` in `app.go` / `app_config.go`. -This is no longer the case, the assertion has been loosened to only require modules implementing, respectively, the `module.BeginBlockAppModule`, `module.EndBlockAppModule` and `module.HasGenesis` interfaces. +#### Client (`root.go`) -#### Modules Keepers +The `client` package has been refactored to make use of the address codecs (address, validator address, consensus address, etc.) +and address bech32 prefixes (address and validator address). +This is part of the work of abstracting the SDK from the global bech32 config. -The following modules `NewKeeper` function now take a `KVStoreService` instead of a `StoreKey`: - -* `x/auth` -* `x/authz` -* `x/bank` -* `x/consensus` -* `x/crisis` -* `x/distribution` -* `x/evidence` -* `x/feegrant` -* `x/gov` -* `x/mint` -* `x/nft` -* `x/slashing` -* `x/upgrade` - -Users manually wiring their chain need to use the `runtime.NewKVStoreService` method to create a `KVStoreService` from a `StoreKey`: +This means the address codecs and prefixes must be provided in the `client.Context` in the application client (usually `root.go`). ```diff -app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper( - appCodec, -- keys[consensusparamtypes.StoreKey] -+ runtime.NewKVStoreService(keys[consensusparamtypes.StoreKey]), - authtypes.NewModuleAddress(govtypes.ModuleName).String(), -) +clientCtx = clientCtx. ++ WithAddressCodec(addressCodec). ++ WithValidatorAddressCodec(validatorAddressCodec). ++ WithConsensusAddressCodec(consensusAddressCodec). ++ WithAddressPrefix("cosmos"). ++ WithValidatorPrefix("cosmosvaloper") ``` -The following modules' `Keeper` methods now take in a `context.Context` instead of `sdk.Context`. Any module that has an interfaces for them (like "expected keepers") will need to update and re-generate mocks if needed: - -* `x/authz` -* `x/bank` -* `x/mint` -* `x/crisis` -* `x/distribution` -* `x/evidence` -* `x/gov` -* `x/slashing` -* `x/upgrade` - -**Users using depinject do not need any changes, this is automatically done for them.** +**When using `depinject` / `app v2`, the client codecs can be provided directly from application config.** -#### Logger +Refer to SimApp `root_v2.go` and `root.go` for an example with an app v2 and a legacy app. -The following modules `NewKeeper` function now take a `log.Logger`: - -* `x/bank` - -`depinject` users must now supply the logger through the main `depinject.Supply` function instead of passing it to `appBuilder.Build`. +Additionally, a simplification of the start command leads to the following change: ```diff -appConfig = depinject.Configs( - AppConfig, - depinject.Supply( - // supply the application options - appOpts, -+ logger, - ... -``` - -```diff -- app.App = appBuilder.Build(logger, db, traceStore, baseAppOptions...) -+ app.App = appBuilder.Build(db, traceStore, baseAppOptions...) -``` - -User manually wiring their chain need to add the logger argument when creating the keeper. - -#### Module Basics - -Previously, the `ModuleBasics` was a global variable that was used to register all modules's `AppModuleBasic` implementation. -The global variable has been removed and the basic module manager can be now created from the module manager. - -This is automatically done for depinject users, however for supplying different app module implementation, pass them via `depinject.Supply` in the main `AppConfig` (`app_config.go`): - -```go -depinject.Supply( - // supply custom module basics - map[string]module.AppModuleBasic{ - genutiltypes.ModuleName: genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator), - govtypes.ModuleName: gov.NewAppModuleBasic( - []govclient.ProposalHandler{ - paramsclient.ProposalHandler, - }, - ), - }, - ) -``` - -Users manually wiring their chain need to use the new `module.NewBasicManagerFromManager` function, after the module manager creation, and pass a `map[string]module.AppModuleBasic` as argument for optionally overridding some module's `AppModuleBasic`. - -### Packages - -#### Store - -References to `types/store.go` which contained aliases for store types have been remapped to point to appropriate store/types, hence the `types/store.go` file is no longer needed and has been removed. - -##### Extract Store to a standalone module - -The `store` module is extracted to have a separate go.mod file which allows it be a standalone module. -All the store imports are now renamed to use `cosmossdk.io/store` instead of `github.com/cosmos/cosmos-sdk/store` across the SDK. - -#### Client - -The return type of the interface method `TxConfig.SignModeHandler()` has been changed from `x/auth/signing.SignModeHandler` to `x/tx/signing.HandlerMap`. This change is transparent to most users as the `TxConfig` interface is typically implemented by private `x/auth/tx.config` struct (as returned by `auth.NewTxConfig`) which has been updated to return the new type. If users have implemented their own `TxConfig` interface, they will need to update their implementation to return the new type. - -### Modules - -#### `**all**` - -[RFC 001](https://docs.cosmos.network/main/rfc/rfc-001-tx-validation) has defined a simplification of the message validation process for modules. -The `sdk.Msg` interface has been updated to not require the implementation of the `ValidateBasic` method. -It is now recommended to validate message directly in the message server. When the validation is performed in the message server, the `ValidateBasic` method on a message is no longer required and can be removed. - -Messages no longer need to implement the `LegacyMsg` interface and implementations of `GetSignBytes` can be deleted. Because of this change, global legacy Amino codec definitions and their registration in `init()` can safely be removed as well. - -#### `x/auth` - -For ante handler construction via `ante.NewAnteHandler`, the field `ante.HandlerOptions.SignModeHandler` has been updated to `x/tx/signing/HandlerMap` from `x/auth/signing/SignModeHandler`. Callers typically fetch this value from `client.TxConfig.SignModeHandler()` (which is also changed) so this change should be transparent to most users. - -#### `x/capability` - -Capability was moved to [IBC-GO](https://github.com/cosmos/ibc-go). IBC V8 will contain the necessary changes to incorporate the new module location - -#### `x/gov` - -##### Expedited Proposals - -The `gov` v1 module has been updated to support the ability to expedite governance proposals. When a proposal is expedited, the voting period will be shortened to `ExpeditedVotingPeriod` parameter. An expedited proposal must have an higher voting threshold than a classic proposal, that threshold is defined with the `ExpeditedThreshold` parameter. - -##### Cancelling Proposals - -The `gov` module has been updated to support the ability to cancel governance proposals. When a proposal is canceled, all the deposits of the proposal are either burnt or sent to `ProposalCancelDest` address. The deposits burn rate will be determined by a new parameter called `ProposalCancelRatio` parameter. - -```text - 1. deposits * proposal_cancel_ratio will be burned or sent to `ProposalCancelDest` address , if `ProposalCancelDest` is empty then deposits will be burned. - 2. deposits * (1 - proposal_cancel_ratio) will be sent to depositors. -``` - -By default, the new `ProposalCancelRatio` parameter is set to 0.5 during migration and `ProposalCancelDest` is set to empty string (i.e. burnt). - -#### `x/evidence` - -##### Extract evidence to a standalone module - -The `x/evidence` module is extracted to have a separate go.mod file which allows it be a standalone module. -All the evidence imports are now renamed to use `cosmossdk.io/x/evidence` instead of `github.com/cosmos/cosmos-sdk/x/evidence` across the SDK. - -#### `x/nft` - -##### Extract nft to a standalone module - -The `x/nft` module is extracted to have a separate go.mod file which allows it to be a standalone module. - -#### x/feegrant - -##### Extract feegrant to a standalone module - -The `x/feegrant` module is extracted to have a separate go.mod file which allows it to be a standalone module. -All the feegrant imports are now renamed to use `cosmossdk.io/x/feegrant` instead of `github.com/cosmos/cosmos-sdk/x/feegrant` across the SDK. - -#### `x/upgrade` - -##### Extract upgrade to a standalone module - -The `x/upgrade` module is extracted to have a separate go.mod file which allows it to be a standalone module. -All the upgrade imports are now renamed to use `cosmossdk.io/x/upgrade` instead of `github.com/cosmos/cosmos-sdk/x/upgrade` across the SDK. - -## [v0.47.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.47.0) - -### Migration to CometBFT (Part 1) - -The Cosmos SDK has migrated to CometBFT, as its default consensus engine. -CometBFT is an implementation of the Tendermint consensus algorithm, and the successor of Tendermint Core. -Due to the import changes, this is a breaking change. Chains need to remove **entirely** their imports of Tendermint Core in their codebase, from direct and indirects imports in their `go.mod`. - -* Replace `github.com/tendermint/tendermint` by `github.com/cometbft/cometbft` -* Replace `github.com/tendermint/tm-db` by `github.com/cometbft/cometbft-db` -* Verify `github.com/tendermint/tendermint` is not an indirect or direct dependency -* Run `make proto-gen` - -Other than that, the migration should be seamless. -On the SDK side, clean-up of variables, functions to reflect the new name will only happen from v0.50 (part 2). - -Note: It is possible that these steps must first be performed by your dependencies before you can perform them on your own codebase. - -### Simulation - -Remove `RandomizedParams` from `AppModuleSimulation` interface. Previously, it used to generate random parameter changes during simulations, however, it does so through ParamChangeProposal which is now legacy. Since all modules were migrated, we can now safely remove this from `AppModuleSimulation` interface. - -Moreover, to support the `MsgUpdateParams` governance proposals for each modules, `AppModuleSimulation` now defines a `AppModule.ProposalMsgs` method in addition to `AppModule.ProposalContents`. That method defines the messages that can be used to submit a proposal and that should be tested in simulation. - -When a module has no proposal messages or proposal content to be tested by simulation, the `AppModule.ProposalMsgs` and `AppModule.ProposalContents` methods can be deleted. - -### gRPC - -A new gRPC service, `proto/cosmos/base/node/v1beta1/query.proto`, has been introduced -which exposes various operator configuration. App developers should be sure to -register the service with the gRPC-gateway service via -`nodeservice.RegisterGRPCGatewayRoutes` in their application construction, which -is typically found in `RegisterAPIRoutes`. - -### AppModule Interface - -Support for the `AppModule` `Querier`, `Route` and `LegacyQuerier` methods has been entirely removed from the `AppModule` -interface. This removes and fully deprecates all legacy queriers. All modules no longer support the REST API previously -known as the LCD, and the `sdk.Msg#Route` method won't be used anymore. - -Most other existing `AppModule` methods have been moved to extension interfaces in preparation for the migration -to the `cosmossdk.io/core/appmodule` API in the next release. Most `AppModule` implementations should not be broken -by this change. - -### SimApp - -The `simapp` package **should not be imported in your own app**. Instead, you should import the `runtime.AppI` interface, that defines an `App`, and use the [`simtestutil` package](https://pkg.go.dev/github.com/cosmos/cosmos-sdk/testutil/sims) for application testing. - -#### App Wiring - -SimApp's `app_v2.go` is using [App Wiring](https://docs.cosmos.network/main/building-apps/app-go-v2), the dependency injection framework of the Cosmos SDK. -This means that modules are injected directly into SimApp thanks to a [configuration file](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/app_config.go). -The previous behavior, without the dependency injection framework, is still present in [`app.go`](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/app.go) and is not going anywhere. - -If you are using a `app.go` without dependency injection, add the following lines to your `app.go` in order to provide newer gRPC services: - -```go -autocliv1.RegisterQueryServer(app.GRPCQueryRouter(), runtimeservices.NewAutoCLIQueryService(app.ModuleManager.Modules)) - -reflectionSvc, err := runtimeservices.NewReflectionService() -if err != nil { - panic(err) -} -reflectionv1.RegisterReflectionServiceServer(app.GRPCQueryRouter(), reflectionSvc) +- server.AddCommands(rootCmd, newApp, func(startCmd *cobra.Command) {}) ++ server.AddCommands(rootCmd, newApp, server.StartCmdOptions[servertypes.Application]{}) ``` -#### Constructor +#### Server (`app.go`) -The constructor, `NewSimApp` has been simplified: +##### Module Manager -* `NewSimApp` does not take encoding parameters (`encodingConfig`) as input, instead the encoding parameters are injected (when using app wiring), or directly created in the constructor. Instead, we can instantiate `SimApp` for getting the encoding configuration. -* `NewSimApp` now uses `AppOptions` for getting the home path (`homePath`) and the invariant checks period (`invCheckPeriod`). These were unnecessary given as arguments as they were already present in the `AppOptions`. +The basic module manager has been deleted. It was not necessary anymore and was simplified to use the `module.Manager` directly. +It can be removed from your `app.go`. -#### Encoding +For depinject users, it isn't necessary anymore to supply a `map[string]module.AppModuleBasic` for customizing the app module basic instantiation. +The custom parameters (such as genutil message validator or gov proposal handler, or evidence handler) can directly be supplied. +When requiring a module manager in `root.go`, inject `*module.Manager` using `depinject.Inject`. -`simapp.MakeTestEncodingConfig()` was deprecated and has been removed. Instead you can use the `TestEncodingConfig` from the `types/module/testutil` package. -This means you can replace your usage of `simapp.MakeTestEncodingConfig` in tests to `moduletestutil.MakeTestEncodingConfig`, which takes a series of relevant `AppModuleBasic` as input (the module being tested and any potential dependencies). - -#### Export - -`ExportAppStateAndValidators` takes an extra argument, `modulesToExport`, which is a list of module names to export. -That argument should be passed to the module maanager `ExportGenesisFromModules` method. - -#### Replaces - -The `GoLevelDB` version must pinned to `v1.0.1-0.20210819022825-2ae1ddf74ef7` in the application, following versions might cause unexpected behavior. -This can be done adding `replace github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7` to the `go.mod` file. - -* [issue #14949 on cosmos-sdk](https://github.com/cosmos/cosmos-sdk/issues/14949) -* [issue #25413 on go-ethereum](https://github.com/ethereum/go-ethereum/pull/25413) - -### Protobuf - -The SDK has migrated from `gogo/protobuf` (which is currently unmaintained), to our own maintained fork, [`cosmos/gogoproto`](https://github.com/cosmos/gogoproto). - -This means you should replace all imports of `github.com/gogo/protobuf` to `github.com/cosmos/gogoproto`. -This allows you to remove the replace directive `replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1` from your `go.mod` file. - -Please use the `ghcr.io/cosmos/proto-builder` image (version >= `0.11.5`) for generating protobuf files. - -See which buf commit for `cosmos/cosmos-sdk` to pin in your `buf.yaml` file [here](./proto/README.md). - -#### Gogoproto Import Paths - -The SDK made a [patch fix](https://github.com/cosmos/gogoproto/pull/32) on its gogoproto repository to require that each proto file's package name matches its OS import path (relatively to a protobuf root import path, usually the root `proto/` folder, set by the `protoc -I` flag). - -For example, assuming you put all your proto files in subfolders inside your root `proto/` folder, then a proto file with package name `myapp.mymodule.v1` should be found in the `proto/myapp/mymodule/v1/` folder. If it is in another folder, the proto generation command will throw an error. - -If you are using a custom folder structure for your proto files, please reorganize them so that their OS path matches their proto package name. - -This is to allow the proto FileDescriptSets to be correctly registered, and this standardized OS import paths allows [Hubl](https://github.com/cosmos/cosmos-sdk/tree/main/tools/hubl) to reflectively talk to any chain. - -#### `{accepts,implements}_interface` proto annotations - -The SDK is normalizing the strings inside the Protobuf `accepts_interface` and `implements_interface` annotations. We require them to be fully-scoped names. They will soon be used by code generators like Pulsar and Telescope to match which messages can or cannot be packed inside `Any`s. - -Here are the following replacements that you need to perform on your proto files: +For non depinject users, simply call `RegisterLegacyAminoCodec` and `RegisterInterfaces` on the module manager: ```diff -- "Content" -+ "cosmos.gov.v1beta1.Content" -- "Authorization" -+ "cosmos.authz.v1beta1.Authorization" -- "sdk.Msg" -+ "cosmos.base.v1beta1.Msg" -- "AccountI" -+ "cosmos.auth.v1beta1.AccountI" -- "ModuleAccountI" -+ "cosmos.auth.v1beta1.ModuleAccountI" -- "FeeAllowanceI" -+ "cosmos.feegrant.v1beta1.FeeAllowanceI" -``` - -Please also check that in your own app's proto files that there are no single-word names for those two proto annotations. If so, then replace them with fully-qualified names, even though those names don't actually resolve to an actual protobuf entity. - -For more information, see the [encoding guide](./docs/docs/core/05-encoding.md). - -### Transactions - -#### Broadcast Mode - -Broadcast mode `block` was deprecated and has been removed. Please use `sync` mode -instead. When upgrading your tests from `block` to `sync` and checking for a -transaction code, you need to query the transaction first (with its hash) to get -the correct code. - -### Modules - -#### `**all**` - -`EventTypeMessage` events, with `sdk.AttributeKeyModule` and `sdk.AttributeKeySender` are now emitted directly at message excecution (in `baseapp`). -This means that the following boilerplate should be removed from all your custom modules: - -```go -ctx.EventManager().EmitEvent( - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeySender, `signer/sender`), - ), -) -``` - -The module name is assumed by `baseapp` to be the second element of the message route: `"cosmos.bank.v1beta1.MsgSend" -> "bank"`. -In case a module does not follow the standard message path, (e.g. IBC), it is advised to keep emitting the module name event. -`Baseapp` only emits that event if the module has not already done so. - -#### `x/params` - -The `params` module was deprecated since v0.46. The Cosmos SDK has migrated away from `x/params` for its own modules. -Cosmos SDK modules now store their parameters directly in its repective modules. -The `params` module will be removed in `v0.50`, as mentioned [in v0.46 release](https://github.com/cosmos/cosmos-sdk/blob/v0.46.1/UPGRADING.md#xparams). It is strongly encouraged to migrate away from `x/params` before `v0.50`. - -When performing a chain migration, the params table must be initizalied manually. This was done in the modules keepers in previous versions. -Have a look at `simapp.RegisterUpgradeHandlers()` for an example. - -#### `x/crisis` - -With the migrations of all modules away from `x/params`, the crisis module now has a store. -The store must be created during a chain upgrade to v0.47.x. - -```go -storetypes.StoreUpgrades{ - Added: []string{ - crisistypes.ModuleName, - }, -} -``` - -#### `x/gov` - -##### Minimum Proposal Deposit At Time of Submission - -The `gov` module has been updated to support a minimum proposal deposit at submission time. It is determined by a new -parameter called `MinInitialDepositRatio`. When multiplied by the existing `MinDeposit` parameter, it produces -the necessary proportion of coins needed at the proposal submission time. The motivation for this change is to prevent proposal spamming. - -By default, the new `MinInitialDepositRatio` parameter is set to zero during migration. The value of zero signifies that this -feature is disabled. If chains wish to utilize the minimum proposal deposits at time of submission, the migration logic needs to be -modified to set the new parameter to the desired value. - -##### New `Proposal.Proposer` field - -The `Proposal` proto has been updated with proposer field. For proposal state migraton developers can call `v4.AddProposerAddressToProposal` in their upgrade handler to update all existing proposal and make them compatible and **this migration is optional**. - -```go -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - v4 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v4" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" -) - -func (app SimApp) RegisterUpgradeHandlers() { - app.UpgradeKeeper.SetUpgradeHandler(UpgradeName, - func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { - // this migration is optional - // add proposal ids with proposers which are active (deposit or voting period) - proposals := make(map[uint64]string) - proposals[1] = "cosmos1luyncewxk4lm24k6gqy8y5dxkj0klr4tu0lmnj" ... - v4.AddProposerAddressToProposal(ctx, sdk.NewKVStoreKey(v4.ModuleName), app.appCodec, proposals) - return app.ModuleManager.RunMigrations(ctx, app.Configurator(), fromVM) - }) -} - +-app.BasicModuleManager = module.NewBasicManagerFromManager(...) +-app.BasicModuleManager.RegisterLegacyAminoCodec(legacyAmino) +-app.BasicModuleManager.RegisterInterfaces(interfaceRegistry) ++app.ModuleManager.RegisterLegacyAminoCodec(legacyAmino) ++app.ModuleManager.RegisterInterfaces(interfaceRegistry) ``` -#### `x/consensus` - -Introducing a new `x/consensus` module to handle managing Tendermint consensus -parameters. For migration it is required to call a specific migration to migrate -existing parameters from the deprecated `x/params` to `x/consensus` module. App -developers should ensure to call `baseapp.MigrateParams` in their upgrade handler. - -Example: - -```go -func (app SimApp) RegisterUpgradeHandlers() { - ----> baseAppLegacySS := app.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramstypes.ConsensusParamsKeyTable()) <---- - - app.UpgradeKeeper.SetUpgradeHandler( - UpgradeName, - func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { - // Migrate Tendermint consensus parameters from x/params module to a - // dedicated x/consensus module. - ----> baseapp.MigrateParams(ctx, baseAppLegacySS, &app.ConsensusParamsKeeper) <---- +Additionally, thanks to the genesis simplification, as explained in [the genesis interface update](#genesis-interface), the module manager `InitGenesis` and `ExportGenesis` methods do not require the codec anymore. - // ... +##### GRPC-WEB - return app.ModuleManager.RunMigrations(ctx, app.Configurator(), fromVM) - }, - ) +Grpc-web embedded client has been removed from the server. If you would like to use grpc-web, you can use the [envoy proxy](https://www.envoyproxy.io/docs/envoy/latest/start/start). - // ... -} -``` +##### AnteHandlers -The `x/params` module should still be imported in your app.go in order to handle this migration. +The `GasConsumptionDecorator` and `IncreaseSequenceDecorator` have been merged with the SigVerificationDecorator, so you'll +need to remove them both from your app.go code, they will yield to unresolvable symbols when compiling. -Because the `x/consensus` module is a new module, its store must be added while upgrading to v0.47.x: +#### Unordered Transactions -```go -storetypes.StoreUpgrades{ - Added: []string{ - consensustypes.ModuleName, - }, -} -``` +The Cosmos SDK now supports unordered transactions. This means that transactions +can be executed in any order and doesn't require the client to deal with or manage +nonces. This also means the order of execution is not guaranteed. -##### `app.go` changes - -When using an `app.go` without App Wiring, the following changes are required: +Unordered transactions are automatically enabled when using `depinject` / app di, simply supply the `servertypes.AppOptions` in `app.go`: ```diff -- bApp.SetParamStore(app.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramstypes.ConsensusParamsKeyTable())) -+ app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper(appCodec, keys[consensusparamstypes.StoreKey], authtypes.NewModuleAddress(govtypes.ModuleName).String()) -+ bApp.SetParamStore(&app.ConsensusParamsKeeper) -``` - -When using App Wiring, the paramater store is automatically set for you. - -#### `x/nft` - -The SDK does not validate anymore the `classID` and `nftID` of an NFT, for extra flexibility in your NFT implementation. -This means chain developers need to validate the `classID` and `nftID` of an NFT. - -### Ledger - -Ledger support has been generalized to enable use of different apps and keytypes that use `secp256k1`. The Ledger interface remains the same, but it can now be provided through the Keyring `Options`, allowing higher-level chains to connect to different Ledger apps or use custom implementations. In addition, higher-level chains can provide custom key implementations around the Ledger public key, to enable greater flexibility with address generation and signing. - -This is not a breaking change, as all values will default to use the standard Cosmos app implementation unless specified otherwise. - -## [v0.46.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.0) - -### Go API Changes - -The `replace google.golang.org/grpc` directive can be removed from the `go.mod`, it is no more required to block the version. - -A few packages that were deprecated in the previous version are now removed. - -For instance, the REST API, deprecated in v0.45, is now removed. If you have not migrated yet, please follow the [instructions](https://docs.cosmos.network/v0.45/migrations/rest.html). - -To improve clarity of the API, some renaming and improvements has been done: - -| Package | Previous | Current | -| --------- | ---------------------------------- | ------------------------------------ | -| `simapp` | `encodingConfig.Marshaler` | `encodingConfig.Codec` | -| `simapp` | `FundAccount`, `FundModuleAccount` | Functions moved to `x/bank/testutil` | -| `types` | `AccAddressFromHex` | `AccAddressFromHexUnsafe` | -| `x/auth` | `MempoolFeeDecorator` | Use `DeductFeeDecorator` instead | -| `x/bank` | `AddressFromBalancesStore` | `AddressAndDenomFromBalancesStore` | -| `x/gov` | `keeper.DeleteDeposits` | `keeper.DeleteAndBurnDeposits` | -| `x/gov` | `keeper.RefundDeposits` | `keeper.RefundAndDeleteDeposits` | -| `x/{mod}` | package `legacy` | package `migrations` | - -For the exhaustive list of API renaming, please refer to the [CHANGELOG](https://github.com/cosmos/cosmos-sdk/blob/main/CHANGELOG.md). - -#### new packages - -Additionally, new packages have been introduced in order to further split the codebase. Aliases are available for a new API breaking migration, but it is encouraged to migrate to this new packages: - -* `errors` should replace `types/errors` when registering errors or wrapping SDK errors. -* `math` contains the `Int` or `Uint` types that are used in the SDK. -* `x/nft` an NFT base module. -* `x/group` a group module allowing to create DAOs, multisig and policies. Greatly composes with `x/authz`. - -#### `x/authz` - -* `authz.NewMsgGrant` `expiration` is now a pointer. When `nil` is used, then no expiration will be set (grant won't expire). -* `authz.NewGrant` takes a new argument: block time, to correctly validate expire time. - -### Keyring - -The keyring has been refactored in v0.46. - -* The `Unsafe*` interfaces have been removed from the keyring package. Please use interface casting if you wish to access those unsafe functions. -* The keys' implementation has been refactored to be serialized as proto. -* `keyring.NewInMemory` and `keyring.New` takes now a `codec.Codec`. -* Take `keyring.Record` instead of `Info` as first argument in: - * `MkConsKeyOutput` - * `MkValKeyOutput` - * `MkAccKeyOutput` -* Rename: - * `SavePubKey` to `SaveOfflineKey` and remove the `algo` argument. - * `NewMultiInfo`, `NewLedgerInfo` to `NewLegacyMultiInfo`, `newLegacyLedgerInfo` respectively. - * `NewOfflineInfo` to `newLegacyOfflineInfo` and move it to `migration_test.go`. - -### PostHandler - -A `postHandler` is like an `antehandler`, but is run _after_ the `runMsgs` execution. It is in the same store branch that `runMsgs`, meaning that both `runMsgs` and `postHandler`. This allows to run a custom logic after the execution of the messages. - -### IAVL - -v0.19.0 IAVL introduces a new "fast" index. This index represents the latest state of the -IAVL laid out in a format that preserves data locality by key. As a result, it allows for faster queries and iterations -since data can now be read in lexicographical order that is frequent for Cosmos-SDK chains. - -The first time the chain is started after the upgrade, the aforementioned index is created. The creation process -might take time and depends on the size of the latest state of the chain. For example, Osmosis takes around 15 minutes to rebuild the index. - -While the index is being created, node operators can observe the following in the logs: -"Upgrading IAVL storage for faster queries + execution on the live state. This may take a while". The store -key is appended to the message. The message is printed for every module that has a non-transient store. -As a result, it gives a good indication of the progress of the upgrade. - -There is also downgrade and re-upgrade protection. If a node operator chooses to downgrade to IAVL pre-fast index, and then upgrade again, the index is rebuilt from scratch. This implementation detail should not be relevant in most cases. It was added as a safeguard against operator -mistakes. - -### Modules - -#### `x/params` - -* The `x/params` module has been depreacted in favour of each module housing and providing way to modify their parameters. Each module that has parameters that are changable during runtime have an authority, the authority can be a module or user account. The Cosmos SDK team recommends migrating modules away from using the param module. An example of how this could look like can be found [here](https://github.com/cosmos/cosmos-sdk/pull/12363). -* The Param module will be maintained until April 18, 2023. At this point the module will reach end of life and be removed from the Cosmos SDK. - -#### `x/gov` - -The `gov` module has been greatly improved. The previous API has been moved to `v1beta1` while the new implementation is called `v1`. - -In order to submit a proposal with `submit-proposal` you now need to pass a `proposal.json` file. -You can still use the old way by using `submit-legacy-proposal`. This is not recommended. -More information can be found in the gov module [client documentation](https://docs.cosmos.network/v0.46/modules/gov/07_client.html). - -#### `x/staking` - -The `staking module` added a new message type to cancel unbonding delegations. Users that have unbonded by accident or wish to cancel a undelegation can now specify the amount and valdiator they would like to cancel the unbond from - -### Protobuf - -The `third_party/proto` folder that existed in [previous version](https://github.com/cosmos/cosmos-sdk/tree/v0.45.3/third_party/proto) now does not contains directly the [proto files](https://github.com/cosmos/cosmos-sdk/tree/release/v0.46.x/third_party/proto). - -Instead, the SDK uses [`buf`](https://buf.build). Clients should have their own [`buf.yaml`](https://docs.buf.build/configuration/v1/buf-yaml) with `buf.build/cosmos/cosmos-sdk` as dependency, in order to avoid having to copy paste these files. - -The protos can as well be downloaded using `buf export buf.build/cosmos/cosmos-sdk:8cb30a2c4de74dc9bd8d260b1e75e176 --output `. - -Cosmos message protobufs should be extended with `cosmos.msg.v1.signer`: - -```protobuf -message MsgSetWithdrawAddress { - option (cosmos.msg.v1.signer) = "delegator_address"; ++ - - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string withdraw_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} + depinject.Supply( ++ // supply the application options ++ appOpts, + // supply the logger + logger, + ) ``` -When clients interract with a node they are required to set a codec in in the grpc.Dial. More information can be found in this [doc](https://docs.cosmos.network/v0.46/run-node/interact-node.html#programmatically-via-go). +
+Step-by-step Wiring +If you are still using the legacy wiring, you must enable unordered transactions manually: + +* Update the `App` constructor to create, load, and save the unordered transaction + manager. + + ```go + func NewApp(...) *App { + // ... + + // create, start, and load the unordered tx manager + utxDataDir := filepath.Join(cast.ToString(appOpts.Get(flags.FlagHome)), "data") + app.UnorderedTxManager = unorderedtx.NewManager(utxDataDir) + app.UnorderedTxManager.Start() + + if err := app.UnorderedTxManager.OnInit(); err != nil { + panic(fmt.Errorf("failed to initialize unordered tx manager: %w", err)) + } + } + ``` + +* Add the decorator to the existing AnteHandler chain, which should be as early + as possible. + + ```go + anteDecorators := []sdk.AnteDecorator{ + ante.NewSetUpContextDecorator(), + // ... + ante.NewUnorderedTxDecorator(unorderedtx.DefaultMaxTimeoutDuration, options.TxManager, options.Environment), + // ... + } + + return sdk.ChainAnteDecorators(anteDecorators...), nil + ``` + +* If the App has a SnapshotManager defined, you must also register the extension + for the TxManager. + + ```go + if manager := app.SnapshotManager(); manager != nil { + err := manager.RegisterExtensions(unorderedtx.NewSnapshotter(app.UnorderedTxManager)) + if err != nil { + panic(fmt.Errorf("failed to register snapshot extension: %s", err)) + } + } + ``` + +* Create or update the App's `Preblocker()` method to call the unordered tx + manager's `OnNewBlock()` method. + + ```go + ... + app.SetPreblocker(app.PreBlocker) + ... + + func (app *SimApp) PreBlocker(ctx sdk.Context, req *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error) { + app.UnorderedTxManager.OnNewBlock(ctx.BlockTime()) + return app.ModuleManager.PreBlock(ctx, req) + } + ``` + +* Create or update the App's `Close()` method to close the unordered tx manager. + Note, this is critical as it ensures the manager's state is written to file + such that when the node restarts, it can recover the state to provide replay + protection. + + ```go + func (app *App) Close() error { + // ... + + // close the unordered tx manager + if e := app.UnorderedTxManager.Close(); e != nil { + err = errors.Join(err, e) + } + + return err + } + ``` + +
+ +To submit an unordered transaction, the client must set the `unordered` flag to +`true` and ensure a reasonable `timeout_height` is set. The `timeout_height` is +used as a TTL for the transaction and is used to provide replay protection. See +[ADR-070](https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-070-unordered-transactions.md) for more details. diff --git a/api/cosmos/app/runtime/v1alpha1/module.pulsar.go b/api/cosmos/app/runtime/v1alpha1/module.pulsar.go index d29da340c176..62f92a4061a8 100644 --- a/api/cosmos/app/runtime/v1alpha1/module.pulsar.go +++ b/api/cosmos/app/runtime/v1alpha1/module.pulsar.go @@ -248,6 +248,52 @@ func (x *_Module_6_list) IsValid() bool { return x.list != nil } +var _ protoreflect.List = (*_Module_11_list)(nil) + +type _Module_11_list struct { + list *[]string +} + +func (x *_Module_11_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Module_11_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Module_11_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Module_11_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Module_11_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Module at list field SkipStoreKeys as it is not of Message kind")) +} + +func (x *_Module_11_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Module_11_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Module_11_list) IsValid() bool { + return x.list != nil +} + var _ protoreflect.List = (*_Module_7_list)(nil) type _Module_7_list struct { @@ -386,6 +432,52 @@ func (x *_Module_9_list) IsValid() bool { return x.list != nil } +var _ protoreflect.List = (*_Module_10_list)(nil) + +type _Module_10_list struct { + list *[]string +} + +func (x *_Module_10_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Module_10_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Module_10_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Module_10_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Module_10_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Module at list field PreBlockers as it is not of Message kind")) +} + +func (x *_Module_10_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Module_10_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Module_10_list) IsValid() bool { + return x.list != nil +} + var ( md_Module protoreflect.MessageDescriptor fd_Module_app_name protoreflect.FieldDescriptor @@ -394,9 +486,11 @@ var ( fd_Module_init_genesis protoreflect.FieldDescriptor fd_Module_export_genesis protoreflect.FieldDescriptor fd_Module_override_store_keys protoreflect.FieldDescriptor + fd_Module_skip_store_keys protoreflect.FieldDescriptor fd_Module_order_migrations protoreflect.FieldDescriptor fd_Module_precommiters protoreflect.FieldDescriptor fd_Module_prepare_check_staters protoreflect.FieldDescriptor + fd_Module_pre_blockers protoreflect.FieldDescriptor ) func init() { @@ -408,9 +502,11 @@ func init() { fd_Module_init_genesis = md_Module.Fields().ByName("init_genesis") fd_Module_export_genesis = md_Module.Fields().ByName("export_genesis") fd_Module_override_store_keys = md_Module.Fields().ByName("override_store_keys") + fd_Module_skip_store_keys = md_Module.Fields().ByName("skip_store_keys") fd_Module_order_migrations = md_Module.Fields().ByName("order_migrations") fd_Module_precommiters = md_Module.Fields().ByName("precommiters") fd_Module_prepare_check_staters = md_Module.Fields().ByName("prepare_check_staters") + fd_Module_pre_blockers = md_Module.Fields().ByName("pre_blockers") } var _ protoreflect.Message = (*fastReflection_Module)(nil) @@ -514,6 +610,12 @@ func (x *fastReflection_Module) Range(f func(protoreflect.FieldDescriptor, proto return } } + if len(x.SkipStoreKeys) != 0 { + value := protoreflect.ValueOfList(&_Module_11_list{list: &x.SkipStoreKeys}) + if !f(fd_Module_skip_store_keys, value) { + return + } + } if len(x.OrderMigrations) != 0 { value := protoreflect.ValueOfList(&_Module_7_list{list: &x.OrderMigrations}) if !f(fd_Module_order_migrations, value) { @@ -532,6 +634,12 @@ func (x *fastReflection_Module) Range(f func(protoreflect.FieldDescriptor, proto return } } + if len(x.PreBlockers) != 0 { + value := protoreflect.ValueOfList(&_Module_10_list{list: &x.PreBlockers}) + if !f(fd_Module_pre_blockers, value) { + return + } + } } // Has reports whether a field is populated. @@ -559,12 +667,16 @@ func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool { return len(x.ExportGenesis) != 0 case "cosmos.app.runtime.v1alpha1.Module.override_store_keys": return len(x.OverrideStoreKeys) != 0 + case "cosmos.app.runtime.v1alpha1.Module.skip_store_keys": + return len(x.SkipStoreKeys) != 0 case "cosmos.app.runtime.v1alpha1.Module.order_migrations": return len(x.OrderMigrations) != 0 case "cosmos.app.runtime.v1alpha1.Module.precommiters": return len(x.Precommiters) != 0 case "cosmos.app.runtime.v1alpha1.Module.prepare_check_staters": return len(x.PrepareCheckStaters) != 0 + case "cosmos.app.runtime.v1alpha1.Module.pre_blockers": + return len(x.PreBlockers) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.app.runtime.v1alpha1.Module")) @@ -593,12 +705,16 @@ func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) { x.ExportGenesis = nil case "cosmos.app.runtime.v1alpha1.Module.override_store_keys": x.OverrideStoreKeys = nil + case "cosmos.app.runtime.v1alpha1.Module.skip_store_keys": + x.SkipStoreKeys = nil case "cosmos.app.runtime.v1alpha1.Module.order_migrations": x.OrderMigrations = nil case "cosmos.app.runtime.v1alpha1.Module.precommiters": x.Precommiters = nil case "cosmos.app.runtime.v1alpha1.Module.prepare_check_staters": x.PrepareCheckStaters = nil + case "cosmos.app.runtime.v1alpha1.Module.pre_blockers": + x.PreBlockers = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.app.runtime.v1alpha1.Module")) @@ -648,6 +764,12 @@ func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) pro } listValue := &_Module_6_list{list: &x.OverrideStoreKeys} return protoreflect.ValueOfList(listValue) + case "cosmos.app.runtime.v1alpha1.Module.skip_store_keys": + if len(x.SkipStoreKeys) == 0 { + return protoreflect.ValueOfList(&_Module_11_list{}) + } + listValue := &_Module_11_list{list: &x.SkipStoreKeys} + return protoreflect.ValueOfList(listValue) case "cosmos.app.runtime.v1alpha1.Module.order_migrations": if len(x.OrderMigrations) == 0 { return protoreflect.ValueOfList(&_Module_7_list{}) @@ -666,6 +788,12 @@ func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) pro } listValue := &_Module_9_list{list: &x.PrepareCheckStaters} return protoreflect.ValueOfList(listValue) + case "cosmos.app.runtime.v1alpha1.Module.pre_blockers": + if len(x.PreBlockers) == 0 { + return protoreflect.ValueOfList(&_Module_10_list{}) + } + listValue := &_Module_10_list{list: &x.PreBlockers} + return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.app.runtime.v1alpha1.Module")) @@ -708,6 +836,10 @@ func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value proto lv := value.List() clv := lv.(*_Module_6_list) x.OverrideStoreKeys = *clv.list + case "cosmos.app.runtime.v1alpha1.Module.skip_store_keys": + lv := value.List() + clv := lv.(*_Module_11_list) + x.SkipStoreKeys = *clv.list case "cosmos.app.runtime.v1alpha1.Module.order_migrations": lv := value.List() clv := lv.(*_Module_7_list) @@ -720,6 +852,10 @@ func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value proto lv := value.List() clv := lv.(*_Module_9_list) x.PrepareCheckStaters = *clv.list + case "cosmos.app.runtime.v1alpha1.Module.pre_blockers": + lv := value.List() + clv := lv.(*_Module_10_list) + x.PreBlockers = *clv.list default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.app.runtime.v1alpha1.Module")) @@ -770,6 +906,12 @@ func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protore } value := &_Module_6_list{list: &x.OverrideStoreKeys} return protoreflect.ValueOfList(value) + case "cosmos.app.runtime.v1alpha1.Module.skip_store_keys": + if x.SkipStoreKeys == nil { + x.SkipStoreKeys = []string{} + } + value := &_Module_11_list{list: &x.SkipStoreKeys} + return protoreflect.ValueOfList(value) case "cosmos.app.runtime.v1alpha1.Module.order_migrations": if x.OrderMigrations == nil { x.OrderMigrations = []string{} @@ -788,6 +930,12 @@ func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protore } value := &_Module_9_list{list: &x.PrepareCheckStaters} return protoreflect.ValueOfList(value) + case "cosmos.app.runtime.v1alpha1.Module.pre_blockers": + if x.PreBlockers == nil { + x.PreBlockers = []string{} + } + value := &_Module_10_list{list: &x.PreBlockers} + return protoreflect.ValueOfList(value) case "cosmos.app.runtime.v1alpha1.Module.app_name": panic(fmt.Errorf("field app_name of message cosmos.app.runtime.v1alpha1.Module is not mutable")) default: @@ -820,6 +968,9 @@ func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protor case "cosmos.app.runtime.v1alpha1.Module.override_store_keys": list := []*StoreKeyConfig{} return protoreflect.ValueOfList(&_Module_6_list{list: &list}) + case "cosmos.app.runtime.v1alpha1.Module.skip_store_keys": + list := []string{} + return protoreflect.ValueOfList(&_Module_11_list{list: &list}) case "cosmos.app.runtime.v1alpha1.Module.order_migrations": list := []string{} return protoreflect.ValueOfList(&_Module_7_list{list: &list}) @@ -829,6 +980,9 @@ func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protor case "cosmos.app.runtime.v1alpha1.Module.prepare_check_staters": list := []string{} return protoreflect.ValueOfList(&_Module_9_list{list: &list}) + case "cosmos.app.runtime.v1alpha1.Module.pre_blockers": + list := []string{} + return protoreflect.ValueOfList(&_Module_10_list{list: &list}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.app.runtime.v1alpha1.Module")) @@ -932,6 +1086,12 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { n += 1 + l + runtime.Sov(uint64(l)) } } + if len(x.SkipStoreKeys) > 0 { + for _, s := range x.SkipStoreKeys { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } if len(x.OrderMigrations) > 0 { for _, s := range x.OrderMigrations { l = len(s) @@ -950,6 +1110,12 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { n += 1 + l + runtime.Sov(uint64(l)) } } + if len(x.PreBlockers) > 0 { + for _, s := range x.PreBlockers { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -979,6 +1145,24 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.SkipStoreKeys) > 0 { + for iNdEx := len(x.SkipStoreKeys) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.SkipStoreKeys[iNdEx]) + copy(dAtA[i:], x.SkipStoreKeys[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SkipStoreKeys[iNdEx]))) + i-- + dAtA[i] = 0x5a + } + } + if len(x.PreBlockers) > 0 { + for iNdEx := len(x.PreBlockers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.PreBlockers[iNdEx]) + copy(dAtA[i:], x.PreBlockers[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PreBlockers[iNdEx]))) + i-- + dAtA[i] = 0x52 + } + } if len(x.PrepareCheckStaters) > 0 { for iNdEx := len(x.PrepareCheckStaters) - 1; iNdEx >= 0; iNdEx-- { i -= len(x.PrepareCheckStaters[iNdEx]) @@ -1308,6 +1492,38 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex + case 11: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SkipStoreKeys", 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.SkipStoreKeys = append(x.SkipStoreKeys, 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 OrderMigrations", wireType) @@ -1404,6 +1620,38 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { } x.PrepareCheckStaters = append(x.PrepareCheckStaters, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex + case 10: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PreBlockers", 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.PreBlockers = append(x.PreBlockers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1963,9 +2211,13 @@ type Module struct { // override_store_keys is an optional list of overrides for the module store keys // to be used in keeper construction. OverrideStoreKeys []*StoreKeyConfig `protobuf:"bytes,6,rep,name=override_store_keys,json=overrideStoreKeys,proto3" json:"override_store_keys,omitempty"` + // skip_store_keys is an optional list of store keys to skip when constructing the + // module's keeper. This is useful when a module does not have a store key. + // NOTE: the provided environment variable will have a fake store service. + SkipStoreKeys []string `protobuf:"bytes,11,rep,name=skip_store_keys,json=skipStoreKeys,proto3" json:"skip_store_keys,omitempty"` // order_migrations defines the order in which module migrations are performed. // If this is left empty, it uses the default migration order. - // https://pkg.go.dev/github.com/cosmos/cosmos-sdk@v0.47.0-alpha2/types/module#DefaultMigrationsOrder + // https://pkg.go.dev/github.com/cosmos/cosmos-sdk/types/module#DefaultMigrationsOrder OrderMigrations []string `protobuf:"bytes,7,rep,name=order_migrations,json=orderMigrations,proto3" json:"order_migrations,omitempty"` // precommiters specifies the module names of the precommiters // to call in the order in which they should be called. If this is left empty @@ -1975,6 +2227,10 @@ type Module struct { // to call in the order in which they should be called. If this is left empty // no preparecheckstate function will be registered. PrepareCheckStaters []string `protobuf:"bytes,9,rep,name=prepare_check_staters,json=prepareCheckStaters,proto3" json:"prepare_check_staters,omitempty"` + // pre_blockers specifies the module names of pre blockers + // to call in the order in which they should be called. If this is left empty + // no pre blocker will be registered. + PreBlockers []string `protobuf:"bytes,10,rep,name=pre_blockers,json=preBlockers,proto3" json:"pre_blockers,omitempty"` } func (x *Module) Reset() { @@ -2039,6 +2295,13 @@ func (x *Module) GetOverrideStoreKeys() []*StoreKeyConfig { return nil } +func (x *Module) GetSkipStoreKeys() []string { + if x != nil { + return x.SkipStoreKeys + } + return nil +} + func (x *Module) GetOrderMigrations() []string { if x != nil { return x.OrderMigrations @@ -2060,6 +2323,13 @@ func (x *Module) GetPrepareCheckStaters() []string { return nil } +func (x *Module) GetPreBlockers() []string { + if x != nil { + return x.PreBlockers + } + return nil +} + // StoreKeyConfig may be supplied to override the default module store key, which // is the module name. type StoreKeyConfig struct { @@ -2116,7 +2386,7 @@ var file_cosmos_app_runtime_v1alpha1_module_proto_rawDesc = []byte{ 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 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, 0xdc, 0x03, 0x0a, 0x06, 0x4d, 0x6f, + 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa7, 0x04, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x72, @@ -2134,41 +2404,45 @@ var file_cosmos_app_runtime_v1alpha1_module_proto_rawDesc = []byte{ 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x4b, 0x65, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x11, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x4b, 0x65, 0x79, 0x73, - 0x12, 0x29, 0x0a, 0x10, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x6f, 0x72, 0x64, 0x65, - 0x72, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x70, - 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x0c, 0x70, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x73, 0x12, - 0x32, 0x0a, 0x15, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, - 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x72, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x09, 0x52, 0x13, - 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x72, 0x73, 0x3a, 0x43, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x3d, 0x0a, 0x24, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, - 0x65, 0x12, 0x15, 0x0a, 0x13, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x70, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x22, 0x53, 0x0a, 0x0e, 0x53, 0x74, 0x6f, 0x72, - 0x65, 0x4b, 0x65, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0c, 0x6b, - 0x76, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x6b, 0x76, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x4b, 0x65, 0x79, 0x42, 0xfb, 0x01, - 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x70, - 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x3c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x72, 0x75, - 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x72, - 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, - 0x03, 0x43, 0x41, 0x52, 0xaa, 0x02, 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, - 0x70, 0x2e, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0xca, 0x02, 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x70, 0x5c, - 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0xe2, 0x02, 0x27, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x70, 0x5c, 0x52, 0x75, - 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1e, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x70, 0x70, 0x3a, 0x3a, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, - 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x12, 0x26, 0x0a, 0x0f, 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x6b, + 0x65, 0x79, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x6b, 0x69, 0x70, 0x53, + 0x74, 0x6f, 0x72, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x6f, 0x72, 0x64, 0x65, + 0x72, 0x5f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x0f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x70, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x65, 0x72, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x72, 0x65, 0x63, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x73, 0x12, 0x32, 0x0a, 0x15, 0x70, 0x72, 0x65, 0x70, 0x61, + 0x72, 0x65, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x72, 0x73, + 0x18, 0x09, 0x20, 0x03, 0x28, 0x09, 0x52, 0x13, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x65, 0x72, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x70, + 0x72, 0x65, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x0b, 0x70, 0x72, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x3a, 0x43, + 0xba, 0xc0, 0x96, 0xda, 0x01, 0x3d, 0x0a, 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x15, 0x0a, 0x13, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x22, 0x53, 0x0a, 0x0e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x4b, 0x65, 0x79, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0c, 0x6b, 0x76, 0x5f, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6b, 0x76, + 0x53, 0x74, 0x6f, 0x72, 0x65, 0x4b, 0x65, 0x79, 0x42, 0xfb, 0x01, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x75, 0x6e, 0x74, + 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0b, 0x4d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, + 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, + 0x65, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, 0x52, 0xaa, + 0x02, 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x52, 0x75, 0x6e, + 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x1b, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x70, 0x5c, 0x52, 0x75, 0x6e, 0x74, 0x69, + 0x6d, 0x65, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x70, 0x5c, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, + 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, + 0x41, 0x70, 0x70, 0x3a, 0x3a, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x3a, 0x3a, 0x56, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/app/v1alpha1/query.pulsar.go b/api/cosmos/app/v1alpha1/query.pulsar.go index 7de26bd84a94..12bb5b93a7a1 100644 --- a/api/cosmos/app/v1alpha1/query.pulsar.go +++ b/api/cosmos/app/v1alpha1/query.pulsar.go @@ -843,7 +843,7 @@ func (*QueryConfigRequest) Descriptor() ([]byte, []int) { return file_cosmos_app_v1alpha1_query_proto_rawDescGZIP(), []int{0} } -// QueryConfigRequest is the Query/Config response type. +// QueryConfigResponse is the Query/Config response type. type QueryConfigResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -894,27 +894,27 @@ var file_cosmos_app_v1alpha1_query_proto_rawDesc = []byte{ 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x32, 0x66, 0x0a, 0x05, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x12, 0x5d, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x27, 0x2e, + 0x69, 0x67, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x32, 0x69, 0x0a, 0x05, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x12, 0x60, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x42, 0xc5, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0a, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x3b, 0x61, 0x70, 0x70, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, - 0x03, 0x43, 0x41, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, - 0x70, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x70, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x70, 0x5c, 0x56, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x70, 0x70, - 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x22, 0x03, 0x88, 0x02, 0x01, 0x42, 0xc5, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x30, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x61, 0x70, 0x70, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x13, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x70, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x70, + 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, + 0x41, 0x70, 0x70, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/app/v1alpha1/query_grpc.pb.go b/api/cosmos/app/v1alpha1/query_grpc.pb.go index c8d56e6cbe6e..3be51029fdb0 100644 --- a/api/cosmos/app/v1alpha1/query_grpc.pb.go +++ b/api/cosmos/app/v1alpha1/query_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/app/v1alpha1/query.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Query_Config_FullMethodName = "/cosmos.app.v1alpha1.Query/Config" @@ -25,7 +25,10 @@ const ( // QueryClient is the client API for Query service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Query is the app module query service. type QueryClient interface { + // Deprecated: Do not use. // Config returns the current app config. Config(ctx context.Context, in *QueryConfigRequest, opts ...grpc.CallOption) (*QueryConfigResponse, error) } @@ -38,9 +41,11 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { return &queryClient{cc} } +// Deprecated: Do not use. func (c *queryClient) Config(ctx context.Context, in *QueryConfigRequest, opts ...grpc.CallOption) (*QueryConfigResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryConfigResponse) - err := c.cc.Invoke(ctx, Query_Config_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Config_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -49,21 +54,28 @@ func (c *queryClient) Config(ctx context.Context, in *QueryConfigRequest, opts . // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer -// for forward compatibility +// for forward compatibility. +// +// Query is the app module query service. type QueryServer interface { + // Deprecated: Do not use. // Config returns the current app config. Config(context.Context, *QueryConfigRequest) (*QueryConfigResponse, error) mustEmbedUnimplementedQueryServer() } -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} +// UnimplementedQueryServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedQueryServer struct{} func (UnimplementedQueryServer) Config(context.Context, *QueryConfigRequest) (*QueryConfigResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Config not implemented") } func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} +func (UnimplementedQueryServer) testEmbeddedByValue() {} // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to QueryServer will @@ -73,6 +85,13 @@ type UnsafeQueryServer interface { } func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + // If the following call pancis, it indicates UnimplementedQueryServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Query_ServiceDesc, srv) } diff --git a/api/cosmos/auth/v1beta1/query_grpc.pb.go b/api/cosmos/auth/v1beta1/query_grpc.pb.go index baa828a34e1d..c2faec752a9e 100644 --- a/api/cosmos/auth/v1beta1/query_grpc.pb.go +++ b/api/cosmos/auth/v1beta1/query_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/auth/v1beta1/query.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Query_Accounts_FullMethodName = "/cosmos.auth.v1beta1.Query/Accounts" @@ -34,6 +34,8 @@ const ( // QueryClient is the client API for Query service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Query defines the gRPC querier service. type QueryClient interface { // Accounts returns all the existing accounts. // @@ -83,8 +85,9 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { } func (c *queryClient) Accounts(ctx context.Context, in *QueryAccountsRequest, opts ...grpc.CallOption) (*QueryAccountsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryAccountsResponse) - err := c.cc.Invoke(ctx, Query_Accounts_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Accounts_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -92,8 +95,9 @@ func (c *queryClient) Accounts(ctx context.Context, in *QueryAccountsRequest, op } func (c *queryClient) Account(ctx context.Context, in *QueryAccountRequest, opts ...grpc.CallOption) (*QueryAccountResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryAccountResponse) - err := c.cc.Invoke(ctx, Query_Account_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Account_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -101,8 +105,9 @@ func (c *queryClient) Account(ctx context.Context, in *QueryAccountRequest, opts } func (c *queryClient) AccountAddressByID(ctx context.Context, in *QueryAccountAddressByIDRequest, opts ...grpc.CallOption) (*QueryAccountAddressByIDResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryAccountAddressByIDResponse) - err := c.cc.Invoke(ctx, Query_AccountAddressByID_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_AccountAddressByID_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -110,8 +115,9 @@ func (c *queryClient) AccountAddressByID(ctx context.Context, in *QueryAccountAd } func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -119,8 +125,9 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . } func (c *queryClient) ModuleAccounts(ctx context.Context, in *QueryModuleAccountsRequest, opts ...grpc.CallOption) (*QueryModuleAccountsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryModuleAccountsResponse) - err := c.cc.Invoke(ctx, Query_ModuleAccounts_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_ModuleAccounts_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -128,8 +135,9 @@ func (c *queryClient) ModuleAccounts(ctx context.Context, in *QueryModuleAccount } func (c *queryClient) ModuleAccountByName(ctx context.Context, in *QueryModuleAccountByNameRequest, opts ...grpc.CallOption) (*QueryModuleAccountByNameResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryModuleAccountByNameResponse) - err := c.cc.Invoke(ctx, Query_ModuleAccountByName_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_ModuleAccountByName_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -137,8 +145,9 @@ func (c *queryClient) ModuleAccountByName(ctx context.Context, in *QueryModuleAc } func (c *queryClient) Bech32Prefix(ctx context.Context, in *Bech32PrefixRequest, opts ...grpc.CallOption) (*Bech32PrefixResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Bech32PrefixResponse) - err := c.cc.Invoke(ctx, Query_Bech32Prefix_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Bech32Prefix_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -146,8 +155,9 @@ func (c *queryClient) Bech32Prefix(ctx context.Context, in *Bech32PrefixRequest, } func (c *queryClient) AddressBytesToString(ctx context.Context, in *AddressBytesToStringRequest, opts ...grpc.CallOption) (*AddressBytesToStringResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(AddressBytesToStringResponse) - err := c.cc.Invoke(ctx, Query_AddressBytesToString_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_AddressBytesToString_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -155,8 +165,9 @@ func (c *queryClient) AddressBytesToString(ctx context.Context, in *AddressBytes } func (c *queryClient) AddressStringToBytes(ctx context.Context, in *AddressStringToBytesRequest, opts ...grpc.CallOption) (*AddressStringToBytesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(AddressStringToBytesResponse) - err := c.cc.Invoke(ctx, Query_AddressStringToBytes_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_AddressStringToBytes_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -164,8 +175,9 @@ func (c *queryClient) AddressStringToBytes(ctx context.Context, in *AddressStrin } func (c *queryClient) AccountInfo(ctx context.Context, in *QueryAccountInfoRequest, opts ...grpc.CallOption) (*QueryAccountInfoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryAccountInfoResponse) - err := c.cc.Invoke(ctx, Query_AccountInfo_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_AccountInfo_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -174,7 +186,9 @@ func (c *queryClient) AccountInfo(ctx context.Context, in *QueryAccountInfoReque // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer -// for forward compatibility +// for forward compatibility. +// +// Query defines the gRPC querier service. type QueryServer interface { // Accounts returns all the existing accounts. // @@ -216,9 +230,12 @@ type QueryServer interface { mustEmbedUnimplementedQueryServer() } -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} +// UnimplementedQueryServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedQueryServer struct{} func (UnimplementedQueryServer) Accounts(context.Context, *QueryAccountsRequest) (*QueryAccountsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Accounts not implemented") @@ -251,6 +268,7 @@ func (UnimplementedQueryServer) AccountInfo(context.Context, *QueryAccountInfoRe return nil, status.Errorf(codes.Unimplemented, "method AccountInfo not implemented") } func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} +func (UnimplementedQueryServer) testEmbeddedByValue() {} // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to QueryServer will @@ -260,6 +278,13 @@ type UnsafeQueryServer interface { } func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + // If the following call pancis, it indicates UnimplementedQueryServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Query_ServiceDesc, srv) } diff --git a/api/cosmos/auth/v1beta1/tx_grpc.pb.go b/api/cosmos/auth/v1beta1/tx_grpc.pb.go index f6330fcec421..78bed0f21d7e 100644 --- a/api/cosmos/auth/v1beta1/tx_grpc.pb.go +++ b/api/cosmos/auth/v1beta1/tx_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/auth/v1beta1/tx.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Msg_UpdateParams_FullMethodName = "/cosmos.auth.v1beta1.Msg/UpdateParams" @@ -25,6 +25,8 @@ const ( // MsgClient is the client API for Msg service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Msg defines the x/auth Msg service. type MsgClient interface { // UpdateParams defines a (governance) operation for updating the x/auth module // parameters. The authority defaults to the x/gov module account. @@ -42,8 +44,9 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { } func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -52,7 +55,9 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer -// for forward compatibility +// for forward compatibility. +// +// Msg defines the x/auth Msg service. type MsgServer interface { // UpdateParams defines a (governance) operation for updating the x/auth module // parameters. The authority defaults to the x/gov module account. @@ -62,14 +67,18 @@ type MsgServer interface { mustEmbedUnimplementedMsgServer() } -// UnimplementedMsgServer must be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} +// UnimplementedMsgServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedMsgServer struct{} func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} +func (UnimplementedMsgServer) testEmbeddedByValue() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to MsgServer will @@ -79,6 +88,13 @@ type UnsafeMsgServer interface { } func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + // If the following call pancis, it indicates UnimplementedMsgServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Msg_ServiceDesc, srv) } diff --git a/api/cosmos/authz/v1beta1/authz.pulsar.go b/api/cosmos/authz/v1beta1/authz.pulsar.go index 90983b2ebe9f..e4e17e9fa9fa 100644 --- a/api/cosmos/authz/v1beta1/authz.pulsar.go +++ b/api/cosmos/authz/v1beta1/authz.pulsar.go @@ -2327,19 +2327,19 @@ var file_cosmos_authz_v1beta1_authz_proto_rawDesc = []byte{ 0x51, 0x75, 0x65, 0x75, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x22, 0x0a, 0x0d, 0x6d, 0x73, 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x6d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x55, 0x72, 0x6c, 0x73, 0x42, 0xd0, 0x01, - 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, - 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0a, 0x41, 0x75, 0x74, 0x68, - 0x7a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, - 0x61, 0x75, 0x74, 0x68, 0x7a, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, - 0x41, 0x58, 0xaa, 0x02, 0x14, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x75, 0x74, 0x68, - 0x7a, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x14, 0x43, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x5c, 0x41, 0x75, 0x74, 0x68, 0x7a, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0xe2, 0x02, 0x20, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x75, 0x74, 0x68, 0x7a, 0x5c, - 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x75, - 0x74, 0x68, 0x7a, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xc8, 0xe1, 0x1e, 0x00, + 0xc8, 0xe1, 0x1e, 0x00, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0a, + 0x41, 0x75, 0x74, 0x68, 0x7a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2f, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x3b, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0xa2, 0x02, 0x03, 0x43, 0x41, 0x58, 0xaa, 0x02, 0x14, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x41, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x14, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x75, 0x74, 0x68, 0x7a, 0x5c, 0x56, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x20, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x75, + 0x74, 0x68, 0x7a, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x3a, 0x3a, 0x41, 0x75, 0x74, 0x68, 0x7a, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } diff --git a/api/cosmos/authz/v1beta1/query.pulsar.go b/api/cosmos/authz/v1beta1/query.pulsar.go index 0f776d3cde17..221c7841860a 100644 --- a/api/cosmos/authz/v1beta1/query.pulsar.go +++ b/api/cosmos/authz/v1beta1/query.pulsar.go @@ -3573,7 +3573,7 @@ func (x *QueryGranterGrantsResponse) GetPagination() *v1beta1.PageResponse { return nil } -// QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. +// QueryGranteeGrantsRequest is the request type for the Query/GranteeGrants RPC method. type QueryGranteeGrantsRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/api/cosmos/authz/v1beta1/query_grpc.pb.go b/api/cosmos/authz/v1beta1/query_grpc.pb.go index a5dd69802e72..7381775ebfba 100644 --- a/api/cosmos/authz/v1beta1/query_grpc.pb.go +++ b/api/cosmos/authz/v1beta1/query_grpc.pb.go @@ -2,7 +2,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/authz/v1beta1/query.proto @@ -17,8 +17,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Query_Grants_FullMethodName = "/cosmos.authz.v1beta1.Query/Grants" @@ -29,6 +29,8 @@ const ( // QueryClient is the client API for Query service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Query defines the gRPC querier service. type QueryClient interface { // Returns list of `Authorization`, granted to the grantee by the granter. Grants(ctx context.Context, in *QueryGrantsRequest, opts ...grpc.CallOption) (*QueryGrantsResponse, error) @@ -51,8 +53,9 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { } func (c *queryClient) Grants(ctx context.Context, in *QueryGrantsRequest, opts ...grpc.CallOption) (*QueryGrantsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryGrantsResponse) - err := c.cc.Invoke(ctx, Query_Grants_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Grants_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -60,8 +63,9 @@ func (c *queryClient) Grants(ctx context.Context, in *QueryGrantsRequest, opts . } func (c *queryClient) GranterGrants(ctx context.Context, in *QueryGranterGrantsRequest, opts ...grpc.CallOption) (*QueryGranterGrantsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryGranterGrantsResponse) - err := c.cc.Invoke(ctx, Query_GranterGrants_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_GranterGrants_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -69,8 +73,9 @@ func (c *queryClient) GranterGrants(ctx context.Context, in *QueryGranterGrantsR } func (c *queryClient) GranteeGrants(ctx context.Context, in *QueryGranteeGrantsRequest, opts ...grpc.CallOption) (*QueryGranteeGrantsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryGranteeGrantsResponse) - err := c.cc.Invoke(ctx, Query_GranteeGrants_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_GranteeGrants_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -79,7 +84,9 @@ func (c *queryClient) GranteeGrants(ctx context.Context, in *QueryGranteeGrantsR // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer -// for forward compatibility +// for forward compatibility. +// +// Query defines the gRPC querier service. type QueryServer interface { // Returns list of `Authorization`, granted to the grantee by the granter. Grants(context.Context, *QueryGrantsRequest) (*QueryGrantsResponse, error) @@ -94,9 +101,12 @@ type QueryServer interface { mustEmbedUnimplementedQueryServer() } -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} +// UnimplementedQueryServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedQueryServer struct{} func (UnimplementedQueryServer) Grants(context.Context, *QueryGrantsRequest) (*QueryGrantsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Grants not implemented") @@ -108,6 +118,7 @@ func (UnimplementedQueryServer) GranteeGrants(context.Context, *QueryGranteeGran return nil, status.Errorf(codes.Unimplemented, "method GranteeGrants not implemented") } func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} +func (UnimplementedQueryServer) testEmbeddedByValue() {} // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to QueryServer will @@ -117,6 +128,13 @@ type UnsafeQueryServer interface { } func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + // If the following call pancis, it indicates UnimplementedQueryServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Query_ServiceDesc, srv) } diff --git a/api/cosmos/authz/v1beta1/tx.pulsar.go b/api/cosmos/authz/v1beta1/tx.pulsar.go index d2773d136383..7b57aeaf0729 100644 --- a/api/cosmos/authz/v1beta1/tx.pulsar.go +++ b/api/cosmos/authz/v1beta1/tx.pulsar.go @@ -580,72 +580,24 @@ func (x *fastReflection_MsgGrant) ProtoMethods() *protoiface.Methods { } } -var _ protoreflect.List = (*_MsgExecResponse_1_list)(nil) - -type _MsgExecResponse_1_list struct { - list *[][]byte -} - -func (x *_MsgExecResponse_1_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_MsgExecResponse_1_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfBytes((*x.list)[i]) -} - -func (x *_MsgExecResponse_1_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Bytes() - concreteValue := valueUnwrapped - (*x.list)[i] = concreteValue -} - -func (x *_MsgExecResponse_1_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Bytes() - concreteValue := valueUnwrapped - *x.list = append(*x.list, concreteValue) -} - -func (x *_MsgExecResponse_1_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message MsgExecResponse at list field Results as it is not of Message kind")) -} - -func (x *_MsgExecResponse_1_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} - -func (x *_MsgExecResponse_1_list) NewElement() protoreflect.Value { - var v []byte - return protoreflect.ValueOfBytes(v) -} - -func (x *_MsgExecResponse_1_list) IsValid() bool { - return x.list != nil -} - var ( - md_MsgExecResponse protoreflect.MessageDescriptor - fd_MsgExecResponse_results protoreflect.FieldDescriptor + md_MsgGrantResponse protoreflect.MessageDescriptor ) func init() { file_cosmos_authz_v1beta1_tx_proto_init() - md_MsgExecResponse = File_cosmos_authz_v1beta1_tx_proto.Messages().ByName("MsgExecResponse") - fd_MsgExecResponse_results = md_MsgExecResponse.Fields().ByName("results") + md_MsgGrantResponse = File_cosmos_authz_v1beta1_tx_proto.Messages().ByName("MsgGrantResponse") } -var _ protoreflect.Message = (*fastReflection_MsgExecResponse)(nil) +var _ protoreflect.Message = (*fastReflection_MsgGrantResponse)(nil) -type fastReflection_MsgExecResponse MsgExecResponse +type fastReflection_MsgGrantResponse MsgGrantResponse -func (x *MsgExecResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgExecResponse)(x) +func (x *MsgGrantResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgGrantResponse)(x) } -func (x *MsgExecResponse) slowProtoReflect() protoreflect.Message { +func (x *MsgGrantResponse) slowProtoReflect() protoreflect.Message { mi := &file_cosmos_authz_v1beta1_tx_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -657,43 +609,43 @@ func (x *MsgExecResponse) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_MsgExecResponse_messageType fastReflection_MsgExecResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgExecResponse_messageType{} +var _fastReflection_MsgGrantResponse_messageType fastReflection_MsgGrantResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgGrantResponse_messageType{} -type fastReflection_MsgExecResponse_messageType struct{} +type fastReflection_MsgGrantResponse_messageType struct{} -func (x fastReflection_MsgExecResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgExecResponse)(nil) +func (x fastReflection_MsgGrantResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgGrantResponse)(nil) } -func (x fastReflection_MsgExecResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgExecResponse) +func (x fastReflection_MsgGrantResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgGrantResponse) } -func (x fastReflection_MsgExecResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgExecResponse +func (x fastReflection_MsgGrantResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgGrantResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_MsgExecResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgExecResponse +func (x *fastReflection_MsgGrantResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgGrantResponse } // 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_MsgExecResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgExecResponse_messageType +func (x *fastReflection_MsgGrantResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgGrantResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgExecResponse) New() protoreflect.Message { - return new(fastReflection_MsgExecResponse) +func (x *fastReflection_MsgGrantResponse) New() protoreflect.Message { + return new(fastReflection_MsgGrantResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgExecResponse) Interface() protoreflect.ProtoMessage { - return (*MsgExecResponse)(x) +func (x *fastReflection_MsgGrantResponse) Interface() protoreflect.ProtoMessage { + return (*MsgGrantResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -701,13 +653,7 @@ func (x *fastReflection_MsgExecResponse) 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_MsgExecResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.Results) != 0 { - value := protoreflect.ValueOfList(&_MsgExecResponse_1_list{list: &x.Results}) - if !f(fd_MsgExecResponse_results, value) { - return - } - } +func (x *fastReflection_MsgGrantResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { } // Has reports whether a field is populated. @@ -721,15 +667,13 @@ func (x *fastReflection_MsgExecResponse) 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_MsgExecResponse) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MsgGrantResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.authz.v1beta1.MsgExecResponse.results": - return len(x.Results) != 0 default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.MsgExecResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.MsgGrantResponse")) } - panic(fmt.Errorf("message cosmos.authz.v1beta1.MsgExecResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.authz.v1beta1.MsgGrantResponse does not contain field %s", fd.FullName())) } } @@ -739,15 +683,13 @@ func (x *fastReflection_MsgExecResponse) Has(fd protoreflect.FieldDescriptor) bo // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgExecResponse) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MsgGrantResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.authz.v1beta1.MsgExecResponse.results": - x.Results = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.MsgExecResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.MsgGrantResponse")) } - panic(fmt.Errorf("message cosmos.authz.v1beta1.MsgExecResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.authz.v1beta1.MsgGrantResponse does not contain field %s", fd.FullName())) } } @@ -757,19 +699,13 @@ func (x *fastReflection_MsgExecResponse) 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_MsgExecResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgGrantResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cosmos.authz.v1beta1.MsgExecResponse.results": - if len(x.Results) == 0 { - return protoreflect.ValueOfList(&_MsgExecResponse_1_list{}) - } - listValue := &_MsgExecResponse_1_list{list: &x.Results} - return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.MsgExecResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.MsgGrantResponse")) } - panic(fmt.Errorf("message cosmos.authz.v1beta1.MsgExecResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.authz.v1beta1.MsgGrantResponse does not contain field %s", descriptor.FullName())) } } @@ -783,17 +719,13 @@ func (x *fastReflection_MsgExecResponse) Get(descriptor protoreflect.FieldDescri // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgExecResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MsgGrantResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cosmos.authz.v1beta1.MsgExecResponse.results": - lv := value.List() - clv := lv.(*_MsgExecResponse_1_list) - x.Results = *clv.list default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.MsgExecResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.MsgGrantResponse")) } - panic(fmt.Errorf("message cosmos.authz.v1beta1.MsgExecResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.authz.v1beta1.MsgGrantResponse does not contain field %s", fd.FullName())) } } @@ -807,45 +739,36 @@ func (x *fastReflection_MsgExecResponse) 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_MsgExecResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgGrantResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.authz.v1beta1.MsgExecResponse.results": - if x.Results == nil { - x.Results = [][]byte{} - } - value := &_MsgExecResponse_1_list{list: &x.Results} - return protoreflect.ValueOfList(value) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.MsgExecResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.MsgGrantResponse")) } - panic(fmt.Errorf("message cosmos.authz.v1beta1.MsgExecResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.authz.v1beta1.MsgGrantResponse 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_MsgExecResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgGrantResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.authz.v1beta1.MsgExecResponse.results": - list := [][]byte{} - return protoreflect.ValueOfList(&_MsgExecResponse_1_list{list: &list}) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.MsgExecResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.MsgGrantResponse")) } - panic(fmt.Errorf("message cosmos.authz.v1beta1.MsgExecResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.authz.v1beta1.MsgGrantResponse 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_MsgExecResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MsgGrantResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.authz.v1beta1.MsgExecResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.authz.v1beta1.MsgGrantResponse", d.FullName())) } panic("unreachable") } @@ -853,7 +776,7 @@ func (x *fastReflection_MsgExecResponse) 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_MsgExecResponse) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MsgGrantResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -864,7 +787,7 @@ func (x *fastReflection_MsgExecResponse) 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_MsgExecResponse) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MsgGrantResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -876,7 +799,7 @@ func (x *fastReflection_MsgExecResponse) 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_MsgExecResponse) IsValid() bool { +func (x *fastReflection_MsgGrantResponse) IsValid() bool { return x != nil } @@ -886,9 +809,9 @@ func (x *fastReflection_MsgExecResponse) 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_MsgExecResponse) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MsgGrantResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgExecResponse) + x := input.Message.Interface().(*MsgGrantResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -900,12 +823,6 @@ func (x *fastReflection_MsgExecResponse) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - if len(x.Results) > 0 { - for _, b := range x.Results { - l = len(b) - n += 1 + l + runtime.Sov(uint64(l)) - } - } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -916,7 +833,7 @@ func (x *fastReflection_MsgExecResponse) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgExecResponse) + x := input.Message.Interface().(*MsgGrantResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -935,15 +852,6 @@ func (x *fastReflection_MsgExecResponse) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Results) > 0 { - for iNdEx := len(x.Results) - 1; iNdEx >= 0; iNdEx-- { - i -= len(x.Results[iNdEx]) - copy(dAtA[i:], x.Results[iNdEx]) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Results[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) } else { @@ -955,7 +863,7 @@ func (x *fastReflection_MsgExecResponse) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgExecResponse) + x := input.Message.Interface().(*MsgGrantResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -987,44 +895,12 @@ func (x *fastReflection_MsgExecResponse) 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: MsgExecResponse: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgGrantResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgExecResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgGrantResponse: 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 Results", 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.Results = append(x.Results, make([]byte, postIndex-iNdEx)) - copy(x.Results[len(x.Results)-1], dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1602,40 +1478,88 @@ func (x *fastReflection_MsgExec) ProtoMethods() *protoiface.Methods { } } - 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, - } + 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 = (*_MsgExecResponse_1_list)(nil) + +type _MsgExecResponse_1_list struct { + list *[][]byte +} + +func (x *_MsgExecResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgExecResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfBytes((*x.list)[i]) +} + +func (x *_MsgExecResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Bytes() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_MsgExecResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Bytes() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgExecResponse_1_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message MsgExecResponse at list field Results as it is not of Message kind")) +} + +func (x *_MsgExecResponse_1_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_MsgExecResponse_1_list) NewElement() protoreflect.Value { + var v []byte + return protoreflect.ValueOfBytes(v) +} + +func (x *_MsgExecResponse_1_list) IsValid() bool { + return x.list != nil } var ( - md_MsgGrantResponse protoreflect.MessageDescriptor + md_MsgExecResponse protoreflect.MessageDescriptor + fd_MsgExecResponse_results protoreflect.FieldDescriptor ) func init() { file_cosmos_authz_v1beta1_tx_proto_init() - md_MsgGrantResponse = File_cosmos_authz_v1beta1_tx_proto.Messages().ByName("MsgGrantResponse") + md_MsgExecResponse = File_cosmos_authz_v1beta1_tx_proto.Messages().ByName("MsgExecResponse") + fd_MsgExecResponse_results = md_MsgExecResponse.Fields().ByName("results") } -var _ protoreflect.Message = (*fastReflection_MsgGrantResponse)(nil) +var _ protoreflect.Message = (*fastReflection_MsgExecResponse)(nil) -type fastReflection_MsgGrantResponse MsgGrantResponse +type fastReflection_MsgExecResponse MsgExecResponse -func (x *MsgGrantResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgGrantResponse)(x) +func (x *MsgExecResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgExecResponse)(x) } -func (x *MsgGrantResponse) slowProtoReflect() protoreflect.Message { +func (x *MsgExecResponse) slowProtoReflect() protoreflect.Message { mi := &file_cosmos_authz_v1beta1_tx_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1647,43 +1571,43 @@ func (x *MsgGrantResponse) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_MsgGrantResponse_messageType fastReflection_MsgGrantResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgGrantResponse_messageType{} +var _fastReflection_MsgExecResponse_messageType fastReflection_MsgExecResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgExecResponse_messageType{} -type fastReflection_MsgGrantResponse_messageType struct{} +type fastReflection_MsgExecResponse_messageType struct{} -func (x fastReflection_MsgGrantResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgGrantResponse)(nil) +func (x fastReflection_MsgExecResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgExecResponse)(nil) } -func (x fastReflection_MsgGrantResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgGrantResponse) +func (x fastReflection_MsgExecResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgExecResponse) } -func (x fastReflection_MsgGrantResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgGrantResponse +func (x fastReflection_MsgExecResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgExecResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_MsgGrantResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgGrantResponse +func (x *fastReflection_MsgExecResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgExecResponse } // 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_MsgGrantResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgGrantResponse_messageType +func (x *fastReflection_MsgExecResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgExecResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgGrantResponse) New() protoreflect.Message { - return new(fastReflection_MsgGrantResponse) +func (x *fastReflection_MsgExecResponse) New() protoreflect.Message { + return new(fastReflection_MsgExecResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgGrantResponse) Interface() protoreflect.ProtoMessage { - return (*MsgGrantResponse)(x) +func (x *fastReflection_MsgExecResponse) Interface() protoreflect.ProtoMessage { + return (*MsgExecResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -1691,7 +1615,13 @@ func (x *fastReflection_MsgGrantResponse) 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_MsgGrantResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_MsgExecResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Results) != 0 { + value := protoreflect.ValueOfList(&_MsgExecResponse_1_list{list: &x.Results}) + if !f(fd_MsgExecResponse_results, value) { + return + } + } } // Has reports whether a field is populated. @@ -1705,13 +1635,15 @@ func (x *fastReflection_MsgGrantResponse) Range(f func(protoreflect.FieldDescrip // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgGrantResponse) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MsgExecResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { + case "cosmos.authz.v1beta1.MsgExecResponse.results": + return len(x.Results) != 0 default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.MsgGrantResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.MsgExecResponse")) } - panic(fmt.Errorf("message cosmos.authz.v1beta1.MsgGrantResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.authz.v1beta1.MsgExecResponse does not contain field %s", fd.FullName())) } } @@ -1721,13 +1653,15 @@ func (x *fastReflection_MsgGrantResponse) Has(fd protoreflect.FieldDescriptor) b // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgGrantResponse) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MsgExecResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { + case "cosmos.authz.v1beta1.MsgExecResponse.results": + x.Results = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.MsgGrantResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.MsgExecResponse")) } - panic(fmt.Errorf("message cosmos.authz.v1beta1.MsgGrantResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.authz.v1beta1.MsgExecResponse does not contain field %s", fd.FullName())) } } @@ -1737,13 +1671,19 @@ func (x *fastReflection_MsgGrantResponse) 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_MsgGrantResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgExecResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { + case "cosmos.authz.v1beta1.MsgExecResponse.results": + if len(x.Results) == 0 { + return protoreflect.ValueOfList(&_MsgExecResponse_1_list{}) + } + listValue := &_MsgExecResponse_1_list{list: &x.Results} + return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.MsgGrantResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.MsgExecResponse")) } - panic(fmt.Errorf("message cosmos.authz.v1beta1.MsgGrantResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.authz.v1beta1.MsgExecResponse does not contain field %s", descriptor.FullName())) } } @@ -1757,13 +1697,17 @@ func (x *fastReflection_MsgGrantResponse) Get(descriptor protoreflect.FieldDescr // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgGrantResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MsgExecResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { + case "cosmos.authz.v1beta1.MsgExecResponse.results": + lv := value.List() + clv := lv.(*_MsgExecResponse_1_list) + x.Results = *clv.list default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.MsgGrantResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.MsgExecResponse")) } - panic(fmt.Errorf("message cosmos.authz.v1beta1.MsgGrantResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.authz.v1beta1.MsgExecResponse does not contain field %s", fd.FullName())) } } @@ -1777,36 +1721,45 @@ func (x *fastReflection_MsgGrantResponse) Set(fd protoreflect.FieldDescriptor, v // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgGrantResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgExecResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "cosmos.authz.v1beta1.MsgExecResponse.results": + if x.Results == nil { + x.Results = [][]byte{} + } + value := &_MsgExecResponse_1_list{list: &x.Results} + return protoreflect.ValueOfList(value) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.MsgGrantResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.MsgExecResponse")) } - panic(fmt.Errorf("message cosmos.authz.v1beta1.MsgGrantResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.authz.v1beta1.MsgExecResponse 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_MsgGrantResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgExecResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "cosmos.authz.v1beta1.MsgExecResponse.results": + list := [][]byte{} + return protoreflect.ValueOfList(&_MsgExecResponse_1_list{list: &list}) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.MsgGrantResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.MsgExecResponse")) } - panic(fmt.Errorf("message cosmos.authz.v1beta1.MsgGrantResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.authz.v1beta1.MsgExecResponse 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_MsgGrantResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MsgExecResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.authz.v1beta1.MsgGrantResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.authz.v1beta1.MsgExecResponse", d.FullName())) } panic("unreachable") } @@ -1814,7 +1767,7 @@ func (x *fastReflection_MsgGrantResponse) WhichOneof(d protoreflect.OneofDescrip // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_MsgGrantResponse) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MsgExecResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -1825,7 +1778,7 @@ func (x *fastReflection_MsgGrantResponse) 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_MsgGrantResponse) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MsgExecResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -1837,7 +1790,7 @@ func (x *fastReflection_MsgGrantResponse) SetUnknown(fields protoreflect.RawFiel // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_MsgGrantResponse) IsValid() bool { +func (x *fastReflection_MsgExecResponse) IsValid() bool { return x != nil } @@ -1847,9 +1800,9 @@ func (x *fastReflection_MsgGrantResponse) 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_MsgGrantResponse) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MsgExecResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgGrantResponse) + x := input.Message.Interface().(*MsgExecResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1861,6 +1814,12 @@ func (x *fastReflection_MsgGrantResponse) ProtoMethods() *protoiface.Methods { var n int var l int _ = l + if len(x.Results) > 0 { + for _, b := range x.Results { + l = len(b) + n += 1 + l + runtime.Sov(uint64(l)) + } + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1871,7 +1830,7 @@ func (x *fastReflection_MsgGrantResponse) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgGrantResponse) + x := input.Message.Interface().(*MsgExecResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1890,6 +1849,15 @@ func (x *fastReflection_MsgGrantResponse) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.Results) > 0 { + for iNdEx := len(x.Results) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.Results[iNdEx]) + copy(dAtA[i:], x.Results[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Results[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) } else { @@ -1901,7 +1869,7 @@ func (x *fastReflection_MsgGrantResponse) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgGrantResponse) + x := input.Message.Interface().(*MsgExecResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1933,12 +1901,44 @@ func (x *fastReflection_MsgGrantResponse) 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: MsgGrantResponse: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgExecResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgGrantResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgExecResponse: 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 Results", 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.Results = append(x.Results, make([]byte, postIndex-iNdEx)) + copy(x.Results[len(x.Results)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -2946,17 +2946,15 @@ func (x *MsgGrant) GetGrant() *Grant { return nil } -// MsgExecResponse defines the Msg/MsgExecResponse response type. -type MsgExecResponse struct { +// MsgGrantResponse defines the Msg/MsgGrant response type. +type MsgGrantResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - Results [][]byte `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` } -func (x *MsgExecResponse) Reset() { - *x = MsgExecResponse{} +func (x *MsgGrantResponse) Reset() { + *x = MsgGrantResponse{} if protoimpl.UnsafeEnabled { mi := &file_cosmos_authz_v1beta1_tx_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2964,24 +2962,17 @@ func (x *MsgExecResponse) Reset() { } } -func (x *MsgExecResponse) String() string { +func (x *MsgGrantResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgExecResponse) ProtoMessage() {} +func (*MsgGrantResponse) ProtoMessage() {} -// Deprecated: Use MsgExecResponse.ProtoReflect.Descriptor instead. -func (*MsgExecResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use MsgGrantResponse.ProtoReflect.Descriptor instead. +func (*MsgGrantResponse) Descriptor() ([]byte, []int) { return file_cosmos_authz_v1beta1_tx_proto_rawDescGZIP(), []int{1} } -func (x *MsgExecResponse) GetResults() [][]byte { - if x != nil { - return x.Results - } - return nil -} - // MsgExec attempts to execute the provided messages using // authorizations granted to the grantee. Each message should have only // one signer corresponding to the granter of the authorization. @@ -3031,15 +3022,17 @@ func (x *MsgExec) GetMsgs() []*anypb.Any { return nil } -// MsgGrantResponse defines the Msg/MsgGrant response type. -type MsgGrantResponse struct { +// MsgExecResponse defines the Msg/MsgExecResponse response type. +type MsgExecResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + Results [][]byte `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` } -func (x *MsgGrantResponse) Reset() { - *x = MsgGrantResponse{} +func (x *MsgExecResponse) Reset() { + *x = MsgExecResponse{} if protoimpl.UnsafeEnabled { mi := &file_cosmos_authz_v1beta1_tx_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -3047,17 +3040,24 @@ func (x *MsgGrantResponse) Reset() { } } -func (x *MsgGrantResponse) String() string { +func (x *MsgExecResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgGrantResponse) ProtoMessage() {} +func (*MsgExecResponse) ProtoMessage() {} -// Deprecated: Use MsgGrantResponse.ProtoReflect.Descriptor instead. -func (*MsgGrantResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use MsgExecResponse.ProtoReflect.Descriptor instead. +func (*MsgExecResponse) Descriptor() ([]byte, []int) { return file_cosmos_authz_v1beta1_tx_proto_rawDescGZIP(), []int{3} } +func (x *MsgExecResponse) GetResults() [][]byte { + if x != nil { + return x.Results + } + return nil +} + // MsgRevoke revokes any authorization with the provided sdk.Msg type on the // granter's account with that has been granted to the grantee. type MsgRevoke struct { @@ -3167,22 +3167,22 @@ var file_cosmos_authz_v1beta1_tx_proto_rawDesc = []byte{ 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x05, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x3a, 0x24, 0x82, 0xe7, 0xb0, 0x2a, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x72, 0x8a, 0xe7, 0xb0, 0x2a, 0x13, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, - 0x4d, 0x73, 0x67, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x22, 0x2b, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x45, + 0x4d, 0x73, 0x67, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x22, 0x12, 0x0a, 0x10, 0x4d, 0x73, 0x67, 0x47, + 0x72, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xa9, 0x01, 0x0a, + 0x07, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x12, 0x32, 0x0a, 0x07, 0x67, 0x72, 0x61, 0x6e, + 0x74, 0x65, 0x65, 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, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x65, 0x12, 0x45, 0x0a, 0x04, + 0x6d, 0x73, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, + 0x42, 0x1b, 0xca, 0xb4, 0x2d, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, + 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x04, 0x6d, + 0x73, 0x67, 0x73, 0x3a, 0x23, 0x82, 0xe7, 0xb0, 0x2a, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, + 0x65, 0x8a, 0xe7, 0xb0, 0x2a, 0x12, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, + 0x2f, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x22, 0x2b, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x07, 0x72, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0xa9, 0x01, 0x0a, 0x07, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, - 0x63, 0x12, 0x32, 0x0a, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x65, 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, 0x07, 0x67, 0x72, - 0x61, 0x6e, 0x74, 0x65, 0x65, 0x12, 0x45, 0x0a, 0x04, 0x6d, 0x73, 0x67, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x1b, 0xca, 0xb4, 0x2d, 0x17, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x04, 0x6d, 0x73, 0x67, 0x73, 0x3a, 0x23, 0x82, 0xe7, - 0xb0, 0x2a, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x65, 0x8a, 0xe7, 0xb0, 0x2a, 0x12, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, - 0x63, 0x22, 0x12, 0x0a, 0x10, 0x4d, 0x73, 0x67, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xbc, 0x01, 0x0a, 0x09, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x76, + 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0xbc, 0x01, 0x0a, 0x09, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x12, 0x32, 0x0a, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 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, 0x07, @@ -3211,20 +3211,20 @@ var file_cosmos_authz_v1beta1_tx_proto_rawDesc = []byte{ 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x1a, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xcd, 0x01, 0x0a, 0x18, - 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, - 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, - 0x68, 0x7a, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x61, 0x75, 0x74, 0x68, 0x7a, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, 0x58, 0xaa, 0x02, 0x14, - 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x56, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x14, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x75, - 0x74, 0x68, 0x7a, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x20, 0x43, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x75, 0x74, 0x68, 0x7a, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x75, 0x74, 0x68, 0x7a, 0x3a, 0x3a, - 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xc8, 0xe1, 0x1e, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xcd, 0x01, 0xc8, 0xe1, + 0x1e, 0x00, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, + 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2f, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x61, + 0x75, 0x74, 0x68, 0x7a, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, + 0x58, 0xaa, 0x02, 0x14, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x7a, + 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x14, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x5c, 0x41, 0x75, 0x74, 0x68, 0x7a, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, + 0x02, 0x20, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x75, 0x74, 0x68, 0x7a, 0x5c, 0x56, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x75, 0x74, + 0x68, 0x7a, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } @@ -3243,9 +3243,9 @@ func file_cosmos_authz_v1beta1_tx_proto_rawDescGZIP() []byte { var file_cosmos_authz_v1beta1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_cosmos_authz_v1beta1_tx_proto_goTypes = []interface{}{ (*MsgGrant)(nil), // 0: cosmos.authz.v1beta1.MsgGrant - (*MsgExecResponse)(nil), // 1: cosmos.authz.v1beta1.MsgExecResponse + (*MsgGrantResponse)(nil), // 1: cosmos.authz.v1beta1.MsgGrantResponse (*MsgExec)(nil), // 2: cosmos.authz.v1beta1.MsgExec - (*MsgGrantResponse)(nil), // 3: cosmos.authz.v1beta1.MsgGrantResponse + (*MsgExecResponse)(nil), // 3: cosmos.authz.v1beta1.MsgExecResponse (*MsgRevoke)(nil), // 4: cosmos.authz.v1beta1.MsgRevoke (*MsgRevokeResponse)(nil), // 5: cosmos.authz.v1beta1.MsgRevokeResponse (*Grant)(nil), // 6: cosmos.authz.v1beta1.Grant @@ -3257,8 +3257,8 @@ var file_cosmos_authz_v1beta1_tx_proto_depIdxs = []int32{ 0, // 2: cosmos.authz.v1beta1.Msg.Grant:input_type -> cosmos.authz.v1beta1.MsgGrant 2, // 3: cosmos.authz.v1beta1.Msg.Exec:input_type -> cosmos.authz.v1beta1.MsgExec 4, // 4: cosmos.authz.v1beta1.Msg.Revoke:input_type -> cosmos.authz.v1beta1.MsgRevoke - 3, // 5: cosmos.authz.v1beta1.Msg.Grant:output_type -> cosmos.authz.v1beta1.MsgGrantResponse - 1, // 6: cosmos.authz.v1beta1.Msg.Exec:output_type -> cosmos.authz.v1beta1.MsgExecResponse + 1, // 5: cosmos.authz.v1beta1.Msg.Grant:output_type -> cosmos.authz.v1beta1.MsgGrantResponse + 3, // 6: cosmos.authz.v1beta1.Msg.Exec:output_type -> cosmos.authz.v1beta1.MsgExecResponse 5, // 7: cosmos.authz.v1beta1.Msg.Revoke:output_type -> cosmos.authz.v1beta1.MsgRevokeResponse 5, // [5:8] is the sub-list for method output_type 2, // [2:5] is the sub-list for method input_type @@ -3287,7 +3287,7 @@ func file_cosmos_authz_v1beta1_tx_proto_init() { } } file_cosmos_authz_v1beta1_tx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgExecResponse); i { + switch v := v.(*MsgGrantResponse); i { case 0: return &v.state case 1: @@ -3311,7 +3311,7 @@ func file_cosmos_authz_v1beta1_tx_proto_init() { } } file_cosmos_authz_v1beta1_tx_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgGrantResponse); i { + switch v := v.(*MsgExecResponse); i { case 0: return &v.state case 1: diff --git a/api/cosmos/authz/v1beta1/tx_grpc.pb.go b/api/cosmos/authz/v1beta1/tx_grpc.pb.go index 2dcbc3ed90f6..a369004af7b5 100644 --- a/api/cosmos/authz/v1beta1/tx_grpc.pb.go +++ b/api/cosmos/authz/v1beta1/tx_grpc.pb.go @@ -2,7 +2,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/authz/v1beta1/tx.proto @@ -17,8 +17,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Msg_Grant_FullMethodName = "/cosmos.authz.v1beta1.Msg/Grant" @@ -29,6 +29,8 @@ const ( // MsgClient is the client API for Msg service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Msg defines the authz Msg service. type MsgClient interface { // Grant grants the provided authorization to the grantee on the granter's // account with the provided expiration time. If there is already a grant @@ -53,8 +55,9 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { } func (c *msgClient) Grant(ctx context.Context, in *MsgGrant, opts ...grpc.CallOption) (*MsgGrantResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgGrantResponse) - err := c.cc.Invoke(ctx, Msg_Grant_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_Grant_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -62,8 +65,9 @@ func (c *msgClient) Grant(ctx context.Context, in *MsgGrant, opts ...grpc.CallOp } func (c *msgClient) Exec(ctx context.Context, in *MsgExec, opts ...grpc.CallOption) (*MsgExecResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgExecResponse) - err := c.cc.Invoke(ctx, Msg_Exec_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_Exec_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -71,8 +75,9 @@ func (c *msgClient) Exec(ctx context.Context, in *MsgExec, opts ...grpc.CallOpti } func (c *msgClient) Revoke(ctx context.Context, in *MsgRevoke, opts ...grpc.CallOption) (*MsgRevokeResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgRevokeResponse) - err := c.cc.Invoke(ctx, Msg_Revoke_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_Revoke_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -81,7 +86,9 @@ func (c *msgClient) Revoke(ctx context.Context, in *MsgRevoke, opts ...grpc.Call // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer -// for forward compatibility +// for forward compatibility. +// +// Msg defines the authz Msg service. type MsgServer interface { // Grant grants the provided authorization to the grantee on the granter's // account with the provided expiration time. If there is already a grant @@ -98,9 +105,12 @@ type MsgServer interface { mustEmbedUnimplementedMsgServer() } -// UnimplementedMsgServer must be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} +// UnimplementedMsgServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedMsgServer struct{} func (UnimplementedMsgServer) Grant(context.Context, *MsgGrant) (*MsgGrantResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Grant not implemented") @@ -112,6 +122,7 @@ func (UnimplementedMsgServer) Revoke(context.Context, *MsgRevoke) (*MsgRevokeRes return nil, status.Errorf(codes.Unimplemented, "method Revoke not implemented") } func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} +func (UnimplementedMsgServer) testEmbeddedByValue() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to MsgServer will @@ -121,6 +132,13 @@ type UnsafeMsgServer interface { } func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + // If the following call pancis, it indicates UnimplementedMsgServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Msg_ServiceDesc, srv) } diff --git a/api/cosmos/autocli/v1/options.pulsar.go b/api/cosmos/autocli/v1/options.pulsar.go index a97a51701f77..bee3f403bfce 100644 --- a/api/cosmos/autocli/v1/options.pulsar.go +++ b/api/cosmos/autocli/v1/options.pulsar.go @@ -3,6 +3,7 @@ package autocliv1 import ( fmt "fmt" + _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" @@ -669,10 +670,12 @@ func (x *_ServiceCommandDescriptor_3_map) IsValid() bool { } var ( - md_ServiceCommandDescriptor protoreflect.MessageDescriptor - fd_ServiceCommandDescriptor_service protoreflect.FieldDescriptor - fd_ServiceCommandDescriptor_rpc_command_options protoreflect.FieldDescriptor - fd_ServiceCommandDescriptor_sub_commands protoreflect.FieldDescriptor + md_ServiceCommandDescriptor protoreflect.MessageDescriptor + fd_ServiceCommandDescriptor_service protoreflect.FieldDescriptor + fd_ServiceCommandDescriptor_rpc_command_options protoreflect.FieldDescriptor + fd_ServiceCommandDescriptor_sub_commands protoreflect.FieldDescriptor + fd_ServiceCommandDescriptor_enhance_custom_command protoreflect.FieldDescriptor + fd_ServiceCommandDescriptor_short protoreflect.FieldDescriptor ) func init() { @@ -681,6 +684,8 @@ func init() { fd_ServiceCommandDescriptor_service = md_ServiceCommandDescriptor.Fields().ByName("service") fd_ServiceCommandDescriptor_rpc_command_options = md_ServiceCommandDescriptor.Fields().ByName("rpc_command_options") fd_ServiceCommandDescriptor_sub_commands = md_ServiceCommandDescriptor.Fields().ByName("sub_commands") + fd_ServiceCommandDescriptor_enhance_custom_command = md_ServiceCommandDescriptor.Fields().ByName("enhance_custom_command") + fd_ServiceCommandDescriptor_short = md_ServiceCommandDescriptor.Fields().ByName("short") } var _ protoreflect.Message = (*fastReflection_ServiceCommandDescriptor)(nil) @@ -766,6 +771,18 @@ func (x *fastReflection_ServiceCommandDescriptor) Range(f func(protoreflect.Fiel return } } + if x.EnhanceCustomCommand != false { + value := protoreflect.ValueOfBool(x.EnhanceCustomCommand) + if !f(fd_ServiceCommandDescriptor_enhance_custom_command, value) { + return + } + } + if x.Short != "" { + value := protoreflect.ValueOfString(x.Short) + if !f(fd_ServiceCommandDescriptor_short, value) { + return + } + } } // Has reports whether a field is populated. @@ -787,6 +804,10 @@ func (x *fastReflection_ServiceCommandDescriptor) Has(fd protoreflect.FieldDescr return len(x.RpcCommandOptions) != 0 case "cosmos.autocli.v1.ServiceCommandDescriptor.sub_commands": return len(x.SubCommands) != 0 + case "cosmos.autocli.v1.ServiceCommandDescriptor.enhance_custom_command": + return x.EnhanceCustomCommand != false + case "cosmos.autocli.v1.ServiceCommandDescriptor.short": + return x.Short != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.autocli.v1.ServiceCommandDescriptor")) @@ -809,6 +830,10 @@ func (x *fastReflection_ServiceCommandDescriptor) Clear(fd protoreflect.FieldDes x.RpcCommandOptions = nil case "cosmos.autocli.v1.ServiceCommandDescriptor.sub_commands": x.SubCommands = nil + case "cosmos.autocli.v1.ServiceCommandDescriptor.enhance_custom_command": + x.EnhanceCustomCommand = false + case "cosmos.autocli.v1.ServiceCommandDescriptor.short": + x.Short = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.autocli.v1.ServiceCommandDescriptor")) @@ -840,6 +865,12 @@ func (x *fastReflection_ServiceCommandDescriptor) Get(descriptor protoreflect.Fi } mapValue := &_ServiceCommandDescriptor_3_map{m: &x.SubCommands} return protoreflect.ValueOfMap(mapValue) + case "cosmos.autocli.v1.ServiceCommandDescriptor.enhance_custom_command": + value := x.EnhanceCustomCommand + return protoreflect.ValueOfBool(value) + case "cosmos.autocli.v1.ServiceCommandDescriptor.short": + value := x.Short + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.autocli.v1.ServiceCommandDescriptor")) @@ -870,6 +901,10 @@ func (x *fastReflection_ServiceCommandDescriptor) Set(fd protoreflect.FieldDescr mv := value.Map() cmv := mv.(*_ServiceCommandDescriptor_3_map) x.SubCommands = *cmv.m + case "cosmos.autocli.v1.ServiceCommandDescriptor.enhance_custom_command": + x.EnhanceCustomCommand = value.Bool() + case "cosmos.autocli.v1.ServiceCommandDescriptor.short": + x.Short = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.autocli.v1.ServiceCommandDescriptor")) @@ -904,6 +939,10 @@ func (x *fastReflection_ServiceCommandDescriptor) Mutable(fd protoreflect.FieldD return protoreflect.ValueOfMap(value) case "cosmos.autocli.v1.ServiceCommandDescriptor.service": panic(fmt.Errorf("field service of message cosmos.autocli.v1.ServiceCommandDescriptor is not mutable")) + case "cosmos.autocli.v1.ServiceCommandDescriptor.enhance_custom_command": + panic(fmt.Errorf("field enhance_custom_command of message cosmos.autocli.v1.ServiceCommandDescriptor is not mutable")) + case "cosmos.autocli.v1.ServiceCommandDescriptor.short": + panic(fmt.Errorf("field short of message cosmos.autocli.v1.ServiceCommandDescriptor is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.autocli.v1.ServiceCommandDescriptor")) @@ -925,6 +964,10 @@ func (x *fastReflection_ServiceCommandDescriptor) NewField(fd protoreflect.Field case "cosmos.autocli.v1.ServiceCommandDescriptor.sub_commands": m := make(map[string]*ServiceCommandDescriptor) return protoreflect.ValueOfMap(&_ServiceCommandDescriptor_3_map{m: &m}) + case "cosmos.autocli.v1.ServiceCommandDescriptor.enhance_custom_command": + return protoreflect.ValueOfBool(false) + case "cosmos.autocli.v1.ServiceCommandDescriptor.short": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.autocli.v1.ServiceCommandDescriptor")) @@ -1030,6 +1073,13 @@ func (x *fastReflection_ServiceCommandDescriptor) ProtoMethods() *protoiface.Met } } } + if x.EnhanceCustomCommand { + n += 2 + } + l = len(x.Short) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1059,6 +1109,23 @@ func (x *fastReflection_ServiceCommandDescriptor) ProtoMethods() *protoiface.Met i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.Short) > 0 { + i -= len(x.Short) + copy(dAtA[i:], x.Short) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Short))) + i-- + dAtA[i] = 0x2a + } + if x.EnhanceCustomCommand { + i-- + if x.EnhanceCustomCommand { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } if len(x.SubCommands) > 0 { MaRsHaLmAp := func(k string, v *ServiceCommandDescriptor) (protoiface.MarshalOutput, error) { baseI := i @@ -1376,6 +1443,58 @@ func (x *fastReflection_ServiceCommandDescriptor) ProtoMethods() *protoiface.Met } x.SubCommands[mapkey] = mapvalue iNdEx = postIndex + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EnhanceCustomCommand", 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.EnhanceCustomCommand = 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 Short", 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.Short = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1658,6 +1777,7 @@ var ( fd_RpcCommandOptions_flag_options protoreflect.FieldDescriptor fd_RpcCommandOptions_positional_args protoreflect.FieldDescriptor fd_RpcCommandOptions_skip protoreflect.FieldDescriptor + fd_RpcCommandOptions_gov_proposal protoreflect.FieldDescriptor ) func init() { @@ -1675,6 +1795,7 @@ func init() { fd_RpcCommandOptions_flag_options = md_RpcCommandOptions.Fields().ByName("flag_options") fd_RpcCommandOptions_positional_args = md_RpcCommandOptions.Fields().ByName("positional_args") fd_RpcCommandOptions_skip = md_RpcCommandOptions.Fields().ByName("skip") + fd_RpcCommandOptions_gov_proposal = md_RpcCommandOptions.Fields().ByName("gov_proposal") } var _ protoreflect.Message = (*fastReflection_RpcCommandOptions)(nil) @@ -1814,6 +1935,12 @@ func (x *fastReflection_RpcCommandOptions) Range(f func(protoreflect.FieldDescri return } } + if x.GovProposal != false { + value := protoreflect.ValueOfBool(x.GovProposal) + if !f(fd_RpcCommandOptions_gov_proposal, value) { + return + } + } } // Has reports whether a field is populated. @@ -1853,6 +1980,8 @@ func (x *fastReflection_RpcCommandOptions) Has(fd protoreflect.FieldDescriptor) return len(x.PositionalArgs) != 0 case "cosmos.autocli.v1.RpcCommandOptions.skip": return x.Skip != false + case "cosmos.autocli.v1.RpcCommandOptions.gov_proposal": + return x.GovProposal != false default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.autocli.v1.RpcCommandOptions")) @@ -1893,6 +2022,8 @@ func (x *fastReflection_RpcCommandOptions) Clear(fd protoreflect.FieldDescriptor x.PositionalArgs = nil case "cosmos.autocli.v1.RpcCommandOptions.skip": x.Skip = false + case "cosmos.autocli.v1.RpcCommandOptions.gov_proposal": + x.GovProposal = false default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.autocli.v1.RpcCommandOptions")) @@ -1957,6 +2088,9 @@ func (x *fastReflection_RpcCommandOptions) Get(descriptor protoreflect.FieldDesc case "cosmos.autocli.v1.RpcCommandOptions.skip": value := x.Skip return protoreflect.ValueOfBool(value) + case "cosmos.autocli.v1.RpcCommandOptions.gov_proposal": + value := x.GovProposal + return protoreflect.ValueOfBool(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.autocli.v1.RpcCommandOptions")) @@ -2009,6 +2143,8 @@ func (x *fastReflection_RpcCommandOptions) Set(fd protoreflect.FieldDescriptor, x.PositionalArgs = *clv.list case "cosmos.autocli.v1.RpcCommandOptions.skip": x.Skip = value.Bool() + case "cosmos.autocli.v1.RpcCommandOptions.gov_proposal": + x.GovProposal = value.Bool() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.autocli.v1.RpcCommandOptions")) @@ -2069,6 +2205,8 @@ func (x *fastReflection_RpcCommandOptions) Mutable(fd protoreflect.FieldDescript panic(fmt.Errorf("field version of message cosmos.autocli.v1.RpcCommandOptions is not mutable")) case "cosmos.autocli.v1.RpcCommandOptions.skip": panic(fmt.Errorf("field skip of message cosmos.autocli.v1.RpcCommandOptions is not mutable")) + case "cosmos.autocli.v1.RpcCommandOptions.gov_proposal": + panic(fmt.Errorf("field gov_proposal of message cosmos.autocli.v1.RpcCommandOptions is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.autocli.v1.RpcCommandOptions")) @@ -2110,6 +2248,8 @@ func (x *fastReflection_RpcCommandOptions) NewField(fd protoreflect.FieldDescrip return protoreflect.ValueOfList(&_RpcCommandOptions_11_list{list: &list}) case "cosmos.autocli.v1.RpcCommandOptions.skip": return protoreflect.ValueOfBool(false) + case "cosmos.autocli.v1.RpcCommandOptions.gov_proposal": + return protoreflect.ValueOfBool(false) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.autocli.v1.RpcCommandOptions")) @@ -2254,6 +2394,9 @@ func (x *fastReflection_RpcCommandOptions) ProtoMethods() *protoiface.Methods { if x.Skip { n += 2 } + if x.GovProposal { + n += 2 + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -2283,6 +2426,16 @@ func (x *fastReflection_RpcCommandOptions) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.GovProposal { + i-- + if x.GovProposal { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x68 + } if x.Skip { i-- if x.Skip { @@ -2946,6 +3099,26 @@ func (x *fastReflection_RpcCommandOptions) ProtoMethods() *protoiface.Methods { } } x.Skip = bool(v != 0) + case 13: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GovProposal", 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.GovProposal = bool(v != 0) default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -3779,6 +3952,7 @@ var ( md_PositionalArgDescriptor protoreflect.MessageDescriptor fd_PositionalArgDescriptor_proto_field protoreflect.FieldDescriptor fd_PositionalArgDescriptor_varargs protoreflect.FieldDescriptor + fd_PositionalArgDescriptor_optional protoreflect.FieldDescriptor ) func init() { @@ -3786,6 +3960,7 @@ func init() { md_PositionalArgDescriptor = File_cosmos_autocli_v1_options_proto.Messages().ByName("PositionalArgDescriptor") fd_PositionalArgDescriptor_proto_field = md_PositionalArgDescriptor.Fields().ByName("proto_field") fd_PositionalArgDescriptor_varargs = md_PositionalArgDescriptor.Fields().ByName("varargs") + fd_PositionalArgDescriptor_optional = md_PositionalArgDescriptor.Fields().ByName("optional") } var _ protoreflect.Message = (*fastReflection_PositionalArgDescriptor)(nil) @@ -3865,6 +4040,12 @@ func (x *fastReflection_PositionalArgDescriptor) Range(f func(protoreflect.Field return } } + if x.Optional != false { + value := protoreflect.ValueOfBool(x.Optional) + if !f(fd_PositionalArgDescriptor_optional, value) { + return + } + } } // Has reports whether a field is populated. @@ -3884,6 +4065,8 @@ func (x *fastReflection_PositionalArgDescriptor) Has(fd protoreflect.FieldDescri return x.ProtoField != "" case "cosmos.autocli.v1.PositionalArgDescriptor.varargs": return x.Varargs != false + case "cosmos.autocli.v1.PositionalArgDescriptor.optional": + return x.Optional != false default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.autocli.v1.PositionalArgDescriptor")) @@ -3904,6 +4087,8 @@ func (x *fastReflection_PositionalArgDescriptor) Clear(fd protoreflect.FieldDesc x.ProtoField = "" case "cosmos.autocli.v1.PositionalArgDescriptor.varargs": x.Varargs = false + case "cosmos.autocli.v1.PositionalArgDescriptor.optional": + x.Optional = false default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.autocli.v1.PositionalArgDescriptor")) @@ -3926,6 +4111,9 @@ func (x *fastReflection_PositionalArgDescriptor) Get(descriptor protoreflect.Fie case "cosmos.autocli.v1.PositionalArgDescriptor.varargs": value := x.Varargs return protoreflect.ValueOfBool(value) + case "cosmos.autocli.v1.PositionalArgDescriptor.optional": + value := x.Optional + return protoreflect.ValueOfBool(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.autocli.v1.PositionalArgDescriptor")) @@ -3950,6 +4138,8 @@ func (x *fastReflection_PositionalArgDescriptor) Set(fd protoreflect.FieldDescri x.ProtoField = value.Interface().(string) case "cosmos.autocli.v1.PositionalArgDescriptor.varargs": x.Varargs = value.Bool() + case "cosmos.autocli.v1.PositionalArgDescriptor.optional": + x.Optional = value.Bool() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.autocli.v1.PositionalArgDescriptor")) @@ -3974,6 +4164,8 @@ func (x *fastReflection_PositionalArgDescriptor) Mutable(fd protoreflect.FieldDe panic(fmt.Errorf("field proto_field of message cosmos.autocli.v1.PositionalArgDescriptor is not mutable")) case "cosmos.autocli.v1.PositionalArgDescriptor.varargs": panic(fmt.Errorf("field varargs of message cosmos.autocli.v1.PositionalArgDescriptor is not mutable")) + case "cosmos.autocli.v1.PositionalArgDescriptor.optional": + panic(fmt.Errorf("field optional of message cosmos.autocli.v1.PositionalArgDescriptor is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.autocli.v1.PositionalArgDescriptor")) @@ -3991,6 +4183,8 @@ func (x *fastReflection_PositionalArgDescriptor) NewField(fd protoreflect.FieldD return protoreflect.ValueOfString("") case "cosmos.autocli.v1.PositionalArgDescriptor.varargs": return protoreflect.ValueOfBool(false) + case "cosmos.autocli.v1.PositionalArgDescriptor.optional": + return protoreflect.ValueOfBool(false) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.autocli.v1.PositionalArgDescriptor")) @@ -4067,6 +4261,9 @@ func (x *fastReflection_PositionalArgDescriptor) ProtoMethods() *protoiface.Meth if x.Varargs { n += 2 } + if x.Optional { + n += 2 + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -4096,6 +4293,16 @@ func (x *fastReflection_PositionalArgDescriptor) ProtoMethods() *protoiface.Meth i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.Optional { + i-- + if x.Optional { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } if x.Varargs { i-- if x.Varargs { @@ -4214,6 +4421,26 @@ func (x *fastReflection_PositionalArgDescriptor) ProtoMethods() *protoiface.Meth } } x.Varargs = bool(v != 0) + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Optional", 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.Optional = bool(v != 0) default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -4326,6 +4553,12 @@ type ServiceCommandDescriptor struct { // different protobuf services. The map key is used as the name of the // sub-command. SubCommands map[string]*ServiceCommandDescriptor `protobuf:"bytes,3,rep,name=sub_commands,json=subCommands,proto3" json:"sub_commands,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // enhance_custom_commands specifies whether to skip the service when generating commands, if a custom command already + // exists, or enhance the existing command. If set to true, the custom command will be enhanced with the services from + // gRPC. otherwise when a custom command exists, no commands will be generated for the service. + EnhanceCustomCommand bool `protobuf:"varint,4,opt,name=enhance_custom_command,json=enhanceCustomCommand,proto3" json:"enhance_custom_command,omitempty"` + // short is an optional parameter used to override the short description of the auto generated command. + Short string `protobuf:"bytes,5,opt,name=short,proto3" json:"short,omitempty"` } func (x *ServiceCommandDescriptor) Reset() { @@ -4369,6 +4602,20 @@ func (x *ServiceCommandDescriptor) GetSubCommands() map[string]*ServiceCommandDe return nil } +func (x *ServiceCommandDescriptor) GetEnhanceCustomCommand() bool { + if x != nil { + return x.EnhanceCustomCommand + } + return false +} + +func (x *ServiceCommandDescriptor) GetShort() string { + if x != nil { + return x.Short + } + return "" +} + // RpcCommandOptions specifies options for commands generated from protobuf // rpc methods. type RpcCommandOptions struct { @@ -4411,6 +4658,11 @@ type RpcCommandOptions struct { PositionalArgs []*PositionalArgDescriptor `protobuf:"bytes,11,rep,name=positional_args,json=positionalArgs,proto3" json:"positional_args,omitempty"` // skip specifies whether to skip this rpc method when generating commands. Skip bool `protobuf:"varint,12,opt,name=skip,proto3" json:"skip,omitempty"` + // gov_proposal specifies whether autocli should generate a gov proposal transaction for this rpc method. + // Normally autocli generates a transaction containing the message and broadcast it. + // However, when true, autocli generates a proposal transaction containing the message and broadcast it. + // This option is ineffective for query commands. + GovProposal bool `protobuf:"varint,13,opt,name=gov_proposal,json=govProposal,proto3" json:"gov_proposal,omitempty"` } func (x *RpcCommandOptions) Reset() { @@ -4517,6 +4769,13 @@ func (x *RpcCommandOptions) GetSkip() bool { return false } +func (x *RpcCommandOptions) GetGovProposal() bool { + if x != nil { + return x.GovProposal + } + return false +} + // FlagOptions are options for flags generated from rpc request fields. // By default, all request fields are configured as flags based on the // kebab-case name of the field. Fields can be turned into positional arguments @@ -4622,8 +4881,11 @@ type PositionalArgDescriptor struct { ProtoField string `protobuf:"bytes,1,opt,name=proto_field,json=protoField,proto3" json:"proto_field,omitempty"` // varargs makes a positional parameter a varargs parameter. This can only be // applied to last positional parameter and the proto_field must a repeated - // field. + // field. Note: It is mutually exclusive with optional. Varargs bool `protobuf:"varint,2,opt,name=varargs,proto3" json:"varargs,omitempty"` + // optional makes the last positional parameter optional. + // Note: It is mutually exclusive with varargs. + Optional bool `protobuf:"varint,3,opt,name=optional,proto3" json:"optional,omitempty"` } func (x *PositionalArgDescriptor) Reset() { @@ -4660,110 +4922,129 @@ func (x *PositionalArgDescriptor) GetVarargs() bool { return false } +func (x *PositionalArgDescriptor) GetOptional() bool { + if x != nil { + return x.Optional + } + return false +} + var File_cosmos_autocli_v1_options_proto protoreflect.FileDescriptor var file_cosmos_autocli_v1_options_proto_rawDesc = []byte{ 0x0a, 0x1f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x6c, - 0x69, 0x2e, 0x76, 0x31, 0x22, 0x8f, 0x01, 0x0a, 0x0d, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3b, 0x0a, 0x02, 0x74, 0x78, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x6f, - 0x63, 0x6c, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, - 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, - 0x02, 0x74, 0x78, 0x12, 0x41, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x6f, - 0x63, 0x6c, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, - 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, - 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0xd8, 0x02, 0x0a, 0x18, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x54, 0x0a, - 0x13, 0x72, 0x70, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x5f, 0x6f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x73, + 0x69, 0x2e, 0x76, 0x31, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x8f, 0x01, 0x0a, 0x0d, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x12, 0x3b, 0x0a, 0x02, 0x74, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x2e, 0x76, + 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, + 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x02, 0x74, 0x78, 0x12, 0x41, + 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x2e, 0x76, + 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, + 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x22, 0xa4, 0x03, 0x0a, 0x18, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6d, + 0x6d, 0x61, 0x6e, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x18, + 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x54, 0x0a, 0x13, 0x72, 0x70, 0x63, 0x5f, + 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x70, 0x63, 0x43, 0x6f, 0x6d, + 0x6d, 0x61, 0x6e, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x11, 0x72, 0x70, 0x63, + 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x5f, + 0x0a, 0x0c, 0x73, 0x75, 0x62, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, + 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, + 0x72, 0x2e, 0x53, 0x75, 0x62, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x0b, 0x73, 0x75, 0x62, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x12, + 0x34, 0x0a, 0x16, 0x65, 0x6e, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, + 0x6d, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x14, 0x65, 0x6e, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x6f, + 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x1a, 0x6b, 0x0a, 0x10, 0x53, + 0x75, 0x62, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 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, 0x41, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x6c, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6d, 0x6d, + 0x61, 0x6e, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xdc, 0x04, 0x0a, 0x11, 0x52, 0x70, 0x63, + 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1d, + 0x0a, 0x0a, 0x72, 0x70, 0x63, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x72, 0x70, 0x63, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x10, 0x0a, + 0x03, 0x75, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x73, 0x65, 0x12, + 0x12, 0x0a, 0x04, 0x6c, 0x6f, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, + 0x6f, 0x6e, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x78, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x65, 0x78, 0x61, 0x6d, + 0x70, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x06, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x05, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x75, 0x67, + 0x67, 0x65, 0x73, 0x74, 0x5f, 0x66, 0x6f, 0x72, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, + 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x46, 0x6f, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, + 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x58, 0x0a, 0x0c, 0x66, 0x6c, 0x61, 0x67, 0x5f, 0x6f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x70, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x52, 0x11, 0x72, 0x70, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x12, 0x5f, 0x0a, 0x0c, 0x73, 0x75, 0x62, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, - 0x6e, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x44, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x53, 0x75, 0x62, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, - 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x73, 0x75, 0x62, 0x43, 0x6f, 0x6d, 0x6d, - 0x61, 0x6e, 0x64, 0x73, 0x1a, 0x6b, 0x0a, 0x10, 0x53, 0x75, 0x62, 0x43, 0x6f, 0x6d, 0x6d, 0x61, - 0x6e, 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, 0x41, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x44, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x22, 0x9c, 0x04, 0x0a, 0x11, 0x52, 0x70, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x70, 0x63, 0x5f, 0x6d, - 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x70, 0x63, - 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x73, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x6f, 0x6e, 0x67, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x6f, 0x6e, 0x67, 0x12, 0x14, 0x0a, 0x05, - 0x73, 0x68, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x68, 0x6f, - 0x72, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, - 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x61, 0x6c, 0x69, - 0x61, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x5f, 0x66, 0x6f, - 0x72, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, - 0x46, 0x6f, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, - 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, - 0x74, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x09, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x58, 0x0a, - 0x0c, 0x66, 0x6c, 0x61, 0x67, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0a, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, - 0x6f, 0x63, 0x6c, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x70, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x61, - 0x6e, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x46, 0x6c, 0x61, 0x67, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x66, 0x6c, 0x61, 0x67, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x53, 0x0a, 0x0f, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x61, 0x72, 0x67, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x6c, - 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x41, - 0x72, 0x67, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x0e, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x41, 0x72, 0x67, 0x73, 0x12, 0x12, 0x0a, 0x04, - 0x73, 0x6b, 0x69, 0x70, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x73, 0x6b, 0x69, 0x70, - 0x1a, 0x5e, 0x0a, 0x10, 0x46, 0x6c, 0x61, 0x67, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 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, 0x34, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x6c, 0x61, 0x67, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, - 0x22, 0xe5, 0x01, 0x0a, 0x0b, 0x46, 0x6c, 0x61, 0x67, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x68, 0x61, 0x6e, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x68, 0x61, - 0x6e, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x65, 0x66, 0x61, - 0x75, 0x6c, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1e, 0x0a, - 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x31, 0x0a, - 0x14, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x68, 0x61, 0x6e, 0x64, 0x5f, 0x64, 0x65, 0x70, 0x72, 0x65, - 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x73, 0x68, 0x6f, - 0x72, 0x74, 0x68, 0x61, 0x6e, 0x64, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, - 0x12, 0x16, 0x0a, 0x06, 0x68, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x06, 0x68, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x22, 0x54, 0x0a, 0x17, 0x50, 0x6f, 0x73, 0x69, + 0x2e, 0x46, 0x6c, 0x61, 0x67, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x0b, 0x66, 0x6c, 0x61, 0x67, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x53, + 0x0a, 0x0f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x61, 0x72, 0x67, + 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x41, 0x72, 0x67, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x6f, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x66, 0x69, 0x65, - 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x46, - 0x69, 0x65, 0x6c, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x61, 0x72, 0x61, 0x72, 0x67, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x76, 0x61, 0x72, 0x61, 0x72, 0x67, 0x73, 0x42, 0xb9, - 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, - 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x75, 0x74, - 0x6f, 0x63, 0x6c, 0x69, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, 0x58, 0xaa, 0x02, 0x11, 0x43, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x2e, 0x56, 0x31, - 0xca, 0x02, 0x11, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x75, 0x74, 0x6f, 0x63, 0x6c, - 0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x75, - 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, - 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x74, 0x6f, 0x72, 0x52, 0x0e, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x41, + 0x72, 0x67, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6b, 0x69, 0x70, 0x18, 0x0c, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x04, 0x73, 0x6b, 0x69, 0x70, 0x12, 0x3e, 0x0a, 0x0c, 0x67, 0x6f, 0x76, 0x5f, 0x70, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x42, 0x1b, 0xda, + 0xb4, 0x2d, 0x17, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x32, 0x20, 0x76, 0x32, 0x2e, + 0x30, 0x2e, 0x30, 0x2d, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x32, 0x52, 0x0b, 0x67, 0x6f, 0x76, 0x50, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x1a, 0x5e, 0x0a, 0x10, 0x46, 0x6c, 0x61, 0x67, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 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, 0x34, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x46, 0x6c, 0x61, 0x67, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xe5, 0x01, 0x0a, 0x0b, 0x46, 0x6c, 0x61, 0x67, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, + 0x68, 0x6f, 0x72, 0x74, 0x68, 0x61, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x73, 0x68, 0x6f, 0x72, 0x74, 0x68, 0x61, 0x6e, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x73, 0x61, + 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x12, + 0x23, 0x0a, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, + 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, + 0x61, 0x74, 0x65, 0x64, 0x12, 0x31, 0x0a, 0x14, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x68, 0x61, 0x6e, + 0x64, 0x5f, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x13, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x68, 0x61, 0x6e, 0x64, 0x44, 0x65, 0x70, + 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x69, 0x64, 0x64, 0x65, + 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x68, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x22, + 0x70, 0x0a, 0x17, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x41, 0x72, 0x67, + 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, + 0x61, 0x72, 0x61, 0x72, 0x67, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x76, 0x61, + 0x72, 0x61, 0x72, 0x67, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, + 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, + 0x6c, 0x42, 0xb9, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2c, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x2f, 0x76, 0x31, 0x3b, + 0x61, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, 0x58, 0xaa, + 0x02, 0x11, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69, + 0x2e, 0x56, 0x31, 0xca, 0x02, 0x11, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x75, 0x74, + 0x6f, 0x63, 0x6c, 0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x5c, 0x41, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x3a, 0x3a, 0x41, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/autocli/v1/query_grpc.pb.go b/api/cosmos/autocli/v1/query_grpc.pb.go index 4f827bd10f80..04545e8d3617 100644 --- a/api/cosmos/autocli/v1/query_grpc.pb.go +++ b/api/cosmos/autocli/v1/query_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/autocli/v1/query.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Query_AppOptions_FullMethodName = "/cosmos.autocli.v1.Query/AppOptions" @@ -25,6 +25,9 @@ const ( // QueryClient is the client API for Query service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// RemoteInfoService provides clients with the information they need +// to build dynamically CLI clients for remote chains. type QueryClient interface { // AppOptions returns the autocli options for all of the modules in an app. AppOptions(ctx context.Context, in *AppOptionsRequest, opts ...grpc.CallOption) (*AppOptionsResponse, error) @@ -39,8 +42,9 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { } func (c *queryClient) AppOptions(ctx context.Context, in *AppOptionsRequest, opts ...grpc.CallOption) (*AppOptionsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(AppOptionsResponse) - err := c.cc.Invoke(ctx, Query_AppOptions_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_AppOptions_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -49,21 +53,28 @@ func (c *queryClient) AppOptions(ctx context.Context, in *AppOptionsRequest, opt // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer -// for forward compatibility +// for forward compatibility. +// +// RemoteInfoService provides clients with the information they need +// to build dynamically CLI clients for remote chains. type QueryServer interface { // AppOptions returns the autocli options for all of the modules in an app. AppOptions(context.Context, *AppOptionsRequest) (*AppOptionsResponse, error) mustEmbedUnimplementedQueryServer() } -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} +// UnimplementedQueryServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedQueryServer struct{} func (UnimplementedQueryServer) AppOptions(context.Context, *AppOptionsRequest) (*AppOptionsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AppOptions not implemented") } func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} +func (UnimplementedQueryServer) testEmbeddedByValue() {} // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to QueryServer will @@ -73,6 +84,13 @@ type UnsafeQueryServer interface { } func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + // If the following call pancis, it indicates UnimplementedQueryServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Query_ServiceDesc, srv) } diff --git a/api/cosmos/bank/module/v1/module.pulsar.go b/api/cosmos/bank/module/v1/module.pulsar.go index 64e252a4af23..89966594fde7 100644 --- a/api/cosmos/bank/module/v1/module.pulsar.go +++ b/api/cosmos/bank/module/v1/module.pulsar.go @@ -59,10 +59,57 @@ func (x *_Module_1_list) IsValid() bool { return x.list != nil } +var _ protoreflect.List = (*_Module_3_list)(nil) + +type _Module_3_list struct { + list *[]string +} + +func (x *_Module_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Module_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Module_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Module_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Module_3_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Module at list field RestrictionsOrder as it is not of Message kind")) +} + +func (x *_Module_3_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Module_3_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Module_3_list) IsValid() bool { + return x.list != nil +} + var ( md_Module protoreflect.MessageDescriptor fd_Module_blocked_module_accounts_override protoreflect.FieldDescriptor fd_Module_authority protoreflect.FieldDescriptor + fd_Module_restrictions_order protoreflect.FieldDescriptor ) func init() { @@ -70,6 +117,7 @@ func init() { md_Module = File_cosmos_bank_module_v1_module_proto.Messages().ByName("Module") fd_Module_blocked_module_accounts_override = md_Module.Fields().ByName("blocked_module_accounts_override") fd_Module_authority = md_Module.Fields().ByName("authority") + fd_Module_restrictions_order = md_Module.Fields().ByName("restrictions_order") } var _ protoreflect.Message = (*fastReflection_Module)(nil) @@ -149,6 +197,12 @@ func (x *fastReflection_Module) Range(f func(protoreflect.FieldDescriptor, proto return } } + if len(x.RestrictionsOrder) != 0 { + value := protoreflect.ValueOfList(&_Module_3_list{list: &x.RestrictionsOrder}) + if !f(fd_Module_restrictions_order, value) { + return + } + } } // Has reports whether a field is populated. @@ -168,6 +222,8 @@ func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool { return len(x.BlockedModuleAccountsOverride) != 0 case "cosmos.bank.module.v1.Module.authority": return x.Authority != "" + case "cosmos.bank.module.v1.Module.restrictions_order": + return len(x.RestrictionsOrder) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.module.v1.Module")) @@ -188,6 +244,8 @@ func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) { x.BlockedModuleAccountsOverride = nil case "cosmos.bank.module.v1.Module.authority": x.Authority = "" + case "cosmos.bank.module.v1.Module.restrictions_order": + x.RestrictionsOrder = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.module.v1.Module")) @@ -213,6 +271,12 @@ func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) pro case "cosmos.bank.module.v1.Module.authority": value := x.Authority return protoreflect.ValueOfString(value) + case "cosmos.bank.module.v1.Module.restrictions_order": + if len(x.RestrictionsOrder) == 0 { + return protoreflect.ValueOfList(&_Module_3_list{}) + } + listValue := &_Module_3_list{list: &x.RestrictionsOrder} + return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.module.v1.Module")) @@ -239,6 +303,10 @@ func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value proto x.BlockedModuleAccountsOverride = *clv.list case "cosmos.bank.module.v1.Module.authority": x.Authority = value.Interface().(string) + case "cosmos.bank.module.v1.Module.restrictions_order": + lv := value.List() + clv := lv.(*_Module_3_list) + x.RestrictionsOrder = *clv.list default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.module.v1.Module")) @@ -265,6 +333,12 @@ func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protore } value := &_Module_1_list{list: &x.BlockedModuleAccountsOverride} return protoreflect.ValueOfList(value) + case "cosmos.bank.module.v1.Module.restrictions_order": + if x.RestrictionsOrder == nil { + x.RestrictionsOrder = []string{} + } + value := &_Module_3_list{list: &x.RestrictionsOrder} + return protoreflect.ValueOfList(value) case "cosmos.bank.module.v1.Module.authority": panic(fmt.Errorf("field authority of message cosmos.bank.module.v1.Module is not mutable")) default: @@ -285,6 +359,9 @@ func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protor return protoreflect.ValueOfList(&_Module_1_list{list: &list}) case "cosmos.bank.module.v1.Module.authority": return protoreflect.ValueOfString("") + case "cosmos.bank.module.v1.Module.restrictions_order": + list := []string{} + return protoreflect.ValueOfList(&_Module_3_list{list: &list}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.module.v1.Module")) @@ -364,6 +441,12 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } + if len(x.RestrictionsOrder) > 0 { + for _, s := range x.RestrictionsOrder { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -393,6 +476,15 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.RestrictionsOrder) > 0 { + for iNdEx := len(x.RestrictionsOrder) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.RestrictionsOrder[iNdEx]) + copy(dAtA[i:], x.RestrictionsOrder[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.RestrictionsOrder[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } if len(x.Authority) > 0 { i -= len(x.Authority) copy(dAtA[i:], x.Authority) @@ -522,6 +614,38 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { } x.Authority = 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 RestrictionsOrder", 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.RestrictionsOrder = append(x.RestrictionsOrder, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -576,12 +700,17 @@ type Module struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // blocked_module_accounts configures exceptional module accounts which should be blocked from receiving funds. - // If left empty it defaults to the list of account names supplied in the auth module configuration as + // blocked_module_accounts_override configures exceptional module accounts which should be blocked from receiving + // funds. If left empty it defaults to the list of account names supplied in the auth module configuration as // module_account_permissions BlockedModuleAccountsOverride []string `protobuf:"bytes,1,rep,name=blocked_module_accounts_override,json=blockedModuleAccountsOverride,proto3" json:"blocked_module_accounts_override,omitempty"` // authority defines the custom module authority. If not set, defaults to the governance module. Authority string `protobuf:"bytes,2,opt,name=authority,proto3" json:"authority,omitempty"` + // restrictions_order specifies the order of send restrictions and should be + // a list of module names which provide a send restriction instance. If no + // order is provided, then restrictions will be applied in alphabetical order + // of module names. + RestrictionsOrder []string `protobuf:"bytes,3,rep,name=restrictions_order,json=restrictionsOrder,proto3" json:"restrictions_order,omitempty"` } func (x *Module) Reset() { @@ -618,6 +747,13 @@ func (x *Module) GetAuthority() string { return "" } +func (x *Module) GetRestrictionsOrder() []string { + if x != nil { + return x.RestrictionsOrder + } + return nil +} + var File_cosmos_bank_module_v1_module_proto protoreflect.FileDescriptor var file_cosmos_bank_module_v1_module_proto_rawDesc = []byte{ @@ -626,31 +762,34 @@ var file_cosmos_bank_module_v1_module_proto_rawDesc = []byte{ 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 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, 0x9c, 0x01, + 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xcb, 0x01, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x47, 0x0a, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x1d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, - 0x2b, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x25, 0x0a, 0x23, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x42, 0xd0, 0x01, 0x0a, - 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, - 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, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, - 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x4d, - 0xaa, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x6e, 0x6b, 0x2e, 0x4d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, - 0xe2, 0x02, 0x21, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 0x5c, 0x4d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x42, - 0x61, 0x6e, 0x6b, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, + 0x2d, 0x0a, 0x12, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, + 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x11, 0x72, 0x65, 0x73, + 0x74, 0x72, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x3a, 0x2b, + 0xba, 0xc0, 0x96, 0xda, 0x01, 0x25, 0x0a, 0x23, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x42, 0xd0, 0x01, 0x0a, 0x19, + 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 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, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, + 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x4d, 0xaa, + 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x6e, 0x6b, 0x2e, 0x4d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x5c, 0x42, 0x61, 0x6e, 0x6b, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, + 0x02, 0x21, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 0x5c, 0x4d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x42, 0x61, + 0x6e, 0x6b, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/bank/v1beta1/bank.pulsar.go b/api/cosmos/bank/v1beta1/bank.pulsar.go index 8e3a54902656..0960da6ebc66 100644 --- a/api/cosmos/bank/v1beta1/bank.pulsar.go +++ b/api/cosmos/bank/v1beta1/bank.pulsar.go @@ -4654,9 +4654,9 @@ var file_cosmos_bank_v1beta1_bank_proto_rawDesc = []byte{ 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x3a, - 0x29, 0x18, 0x01, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0xca, 0xb4, 0x2d, 0x1b, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x49, 0x22, 0x57, 0x0a, 0x09, 0x44, 0x65, + 0x29, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0xca, 0xb4, 0x2d, 0x1b, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x49, 0x18, 0x01, 0x22, 0x57, 0x0a, 0x09, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, diff --git a/api/cosmos/bank/v1beta1/query.pulsar.go b/api/cosmos/bank/v1beta1/query.pulsar.go index 0442d8bc49c0..5c7174dee2a6 100644 --- a/api/cosmos/bank/v1beta1/query.pulsar.go +++ b/api/cosmos/bank/v1beta1/query.pulsar.go @@ -8572,6 +8572,861 @@ func (x *fastReflection_QueryDenomMetadataResponse) ProtoMethods() *protoiface.M } } +var ( + md_QueryDenomMetadataByQueryStringRequest protoreflect.MessageDescriptor + fd_QueryDenomMetadataByQueryStringRequest_denom protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_bank_v1beta1_query_proto_init() + md_QueryDenomMetadataByQueryStringRequest = File_cosmos_bank_v1beta1_query_proto.Messages().ByName("QueryDenomMetadataByQueryStringRequest") + fd_QueryDenomMetadataByQueryStringRequest_denom = md_QueryDenomMetadataByQueryStringRequest.Fields().ByName("denom") +} + +var _ protoreflect.Message = (*fastReflection_QueryDenomMetadataByQueryStringRequest)(nil) + +type fastReflection_QueryDenomMetadataByQueryStringRequest QueryDenomMetadataByQueryStringRequest + +func (x *QueryDenomMetadataByQueryStringRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryDenomMetadataByQueryStringRequest)(x) +} + +func (x *QueryDenomMetadataByQueryStringRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_bank_v1beta1_query_proto_msgTypes[18] + 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_QueryDenomMetadataByQueryStringRequest_messageType fastReflection_QueryDenomMetadataByQueryStringRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryDenomMetadataByQueryStringRequest_messageType{} + +type fastReflection_QueryDenomMetadataByQueryStringRequest_messageType struct{} + +func (x fastReflection_QueryDenomMetadataByQueryStringRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryDenomMetadataByQueryStringRequest)(nil) +} +func (x fastReflection_QueryDenomMetadataByQueryStringRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryDenomMetadataByQueryStringRequest) +} +func (x fastReflection_QueryDenomMetadataByQueryStringRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryDenomMetadataByQueryStringRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryDenomMetadataByQueryStringRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryDenomMetadataByQueryStringRequest +} + +// 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_QueryDenomMetadataByQueryStringRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryDenomMetadataByQueryStringRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryDenomMetadataByQueryStringRequest) New() protoreflect.Message { + return new(fastReflection_QueryDenomMetadataByQueryStringRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryDenomMetadataByQueryStringRequest) Interface() protoreflect.ProtoMessage { + return (*QueryDenomMetadataByQueryStringRequest)(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_QueryDenomMetadataByQueryStringRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Denom != "" { + value := protoreflect.ValueOfString(x.Denom) + if !f(fd_QueryDenomMetadataByQueryStringRequest_denom, 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_QueryDenomMetadataByQueryStringRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest.denom": + return x.Denom != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest 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_QueryDenomMetadataByQueryStringRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest.denom": + x.Denom = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest 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_QueryDenomMetadataByQueryStringRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest.denom": + value := x.Denom + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest 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_QueryDenomMetadataByQueryStringRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest.denom": + x.Denom = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest 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_QueryDenomMetadataByQueryStringRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest.denom": + panic(fmt.Errorf("field denom of message cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest 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_QueryDenomMetadataByQueryStringRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest.denom": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest 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_QueryDenomMetadataByQueryStringRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest", 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_QueryDenomMetadataByQueryStringRequest) 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_QueryDenomMetadataByQueryStringRequest) 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_QueryDenomMetadataByQueryStringRequest) 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_QueryDenomMetadataByQueryStringRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryDenomMetadataByQueryStringRequest) + 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.Denom) + 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().(*QueryDenomMetadataByQueryStringRequest) + 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.Denom) > 0 { + i -= len(x.Denom) + copy(dAtA[i:], x.Denom) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Denom))) + 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().(*QueryDenomMetadataByQueryStringRequest) + 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: QueryDenomMetadataByQueryStringRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryDenomMetadataByQueryStringRequest: 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 Denom", 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.Denom = 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_QueryDenomMetadataByQueryStringResponse protoreflect.MessageDescriptor + fd_QueryDenomMetadataByQueryStringResponse_metadata protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_bank_v1beta1_query_proto_init() + md_QueryDenomMetadataByQueryStringResponse = File_cosmos_bank_v1beta1_query_proto.Messages().ByName("QueryDenomMetadataByQueryStringResponse") + fd_QueryDenomMetadataByQueryStringResponse_metadata = md_QueryDenomMetadataByQueryStringResponse.Fields().ByName("metadata") +} + +var _ protoreflect.Message = (*fastReflection_QueryDenomMetadataByQueryStringResponse)(nil) + +type fastReflection_QueryDenomMetadataByQueryStringResponse QueryDenomMetadataByQueryStringResponse + +func (x *QueryDenomMetadataByQueryStringResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryDenomMetadataByQueryStringResponse)(x) +} + +func (x *QueryDenomMetadataByQueryStringResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_bank_v1beta1_query_proto_msgTypes[19] + 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_QueryDenomMetadataByQueryStringResponse_messageType fastReflection_QueryDenomMetadataByQueryStringResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryDenomMetadataByQueryStringResponse_messageType{} + +type fastReflection_QueryDenomMetadataByQueryStringResponse_messageType struct{} + +func (x fastReflection_QueryDenomMetadataByQueryStringResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryDenomMetadataByQueryStringResponse)(nil) +} +func (x fastReflection_QueryDenomMetadataByQueryStringResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryDenomMetadataByQueryStringResponse) +} +func (x fastReflection_QueryDenomMetadataByQueryStringResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryDenomMetadataByQueryStringResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryDenomMetadataByQueryStringResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryDenomMetadataByQueryStringResponse +} + +// 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_QueryDenomMetadataByQueryStringResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryDenomMetadataByQueryStringResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryDenomMetadataByQueryStringResponse) New() protoreflect.Message { + return new(fastReflection_QueryDenomMetadataByQueryStringResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryDenomMetadataByQueryStringResponse) Interface() protoreflect.ProtoMessage { + return (*QueryDenomMetadataByQueryStringResponse)(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_QueryDenomMetadataByQueryStringResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Metadata != nil { + value := protoreflect.ValueOfMessage(x.Metadata.ProtoReflect()) + if !f(fd_QueryDenomMetadataByQueryStringResponse_metadata, 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_QueryDenomMetadataByQueryStringResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse.metadata": + return x.Metadata != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse 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_QueryDenomMetadataByQueryStringResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse.metadata": + x.Metadata = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse 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_QueryDenomMetadataByQueryStringResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse.metadata": + value := x.Metadata + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse 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_QueryDenomMetadataByQueryStringResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse.metadata": + x.Metadata = value.Message().Interface().(*Metadata) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse 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_QueryDenomMetadataByQueryStringResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse.metadata": + if x.Metadata == nil { + x.Metadata = new(Metadata) + } + return protoreflect.ValueOfMessage(x.Metadata.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse 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_QueryDenomMetadataByQueryStringResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse.metadata": + m := new(Metadata) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse 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_QueryDenomMetadataByQueryStringResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse", 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_QueryDenomMetadataByQueryStringResponse) 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_QueryDenomMetadataByQueryStringResponse) 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_QueryDenomMetadataByQueryStringResponse) 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_QueryDenomMetadataByQueryStringResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryDenomMetadataByQueryStringResponse) + 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.Metadata != nil { + l = options.Size(x.Metadata) + 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().(*QueryDenomMetadataByQueryStringResponse) + 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.Metadata != nil { + encoded, err := options.Marshal(x.Metadata) + 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().(*QueryDenomMetadataByQueryStringResponse) + 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: QueryDenomMetadataByQueryStringResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryDenomMetadataByQueryStringResponse: 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 = &Metadata{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Metadata); 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_QueryDenomOwnersRequest protoreflect.MessageDescriptor fd_QueryDenomOwnersRequest_denom protoreflect.FieldDescriptor @@ -8580,21 +9435,1070 @@ var ( func init() { file_cosmos_bank_v1beta1_query_proto_init() - md_QueryDenomOwnersRequest = File_cosmos_bank_v1beta1_query_proto.Messages().ByName("QueryDenomOwnersRequest") - fd_QueryDenomOwnersRequest_denom = md_QueryDenomOwnersRequest.Fields().ByName("denom") - fd_QueryDenomOwnersRequest_pagination = md_QueryDenomOwnersRequest.Fields().ByName("pagination") + md_QueryDenomOwnersRequest = File_cosmos_bank_v1beta1_query_proto.Messages().ByName("QueryDenomOwnersRequest") + fd_QueryDenomOwnersRequest_denom = md_QueryDenomOwnersRequest.Fields().ByName("denom") + fd_QueryDenomOwnersRequest_pagination = md_QueryDenomOwnersRequest.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryDenomOwnersRequest)(nil) + +type fastReflection_QueryDenomOwnersRequest QueryDenomOwnersRequest + +func (x *QueryDenomOwnersRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryDenomOwnersRequest)(x) +} + +func (x *QueryDenomOwnersRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_bank_v1beta1_query_proto_msgTypes[20] + 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_QueryDenomOwnersRequest_messageType fastReflection_QueryDenomOwnersRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryDenomOwnersRequest_messageType{} + +type fastReflection_QueryDenomOwnersRequest_messageType struct{} + +func (x fastReflection_QueryDenomOwnersRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryDenomOwnersRequest)(nil) +} +func (x fastReflection_QueryDenomOwnersRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryDenomOwnersRequest) +} +func (x fastReflection_QueryDenomOwnersRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryDenomOwnersRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryDenomOwnersRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryDenomOwnersRequest +} + +// 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_QueryDenomOwnersRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryDenomOwnersRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryDenomOwnersRequest) New() protoreflect.Message { + return new(fastReflection_QueryDenomOwnersRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryDenomOwnersRequest) Interface() protoreflect.ProtoMessage { + return (*QueryDenomOwnersRequest)(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_QueryDenomOwnersRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Denom != "" { + value := protoreflect.ValueOfString(x.Denom) + if !f(fd_QueryDenomOwnersRequest_denom, value) { + return + } + } + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryDenomOwnersRequest_pagination, 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_QueryDenomOwnersRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.bank.v1beta1.QueryDenomOwnersRequest.denom": + return x.Denom != "" + case "cosmos.bank.v1beta1.QueryDenomOwnersRequest.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomOwnersRequest")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomOwnersRequest 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_QueryDenomOwnersRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.bank.v1beta1.QueryDenomOwnersRequest.denom": + x.Denom = "" + case "cosmos.bank.v1beta1.QueryDenomOwnersRequest.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomOwnersRequest")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomOwnersRequest 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_QueryDenomOwnersRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.bank.v1beta1.QueryDenomOwnersRequest.denom": + value := x.Denom + return protoreflect.ValueOfString(value) + case "cosmos.bank.v1beta1.QueryDenomOwnersRequest.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomOwnersRequest")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomOwnersRequest 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_QueryDenomOwnersRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.bank.v1beta1.QueryDenomOwnersRequest.denom": + x.Denom = value.Interface().(string) + case "cosmos.bank.v1beta1.QueryDenomOwnersRequest.pagination": + x.Pagination = value.Message().Interface().(*v1beta11.PageRequest) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomOwnersRequest")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomOwnersRequest 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_QueryDenomOwnersRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.bank.v1beta1.QueryDenomOwnersRequest.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta11.PageRequest) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + case "cosmos.bank.v1beta1.QueryDenomOwnersRequest.denom": + panic(fmt.Errorf("field denom of message cosmos.bank.v1beta1.QueryDenomOwnersRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomOwnersRequest")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomOwnersRequest 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_QueryDenomOwnersRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.bank.v1beta1.QueryDenomOwnersRequest.denom": + return protoreflect.ValueOfString("") + case "cosmos.bank.v1beta1.QueryDenomOwnersRequest.pagination": + m := new(v1beta11.PageRequest) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomOwnersRequest")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomOwnersRequest 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_QueryDenomOwnersRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.bank.v1beta1.QueryDenomOwnersRequest", 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_QueryDenomOwnersRequest) 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_QueryDenomOwnersRequest) 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_QueryDenomOwnersRequest) 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_QueryDenomOwnersRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryDenomOwnersRequest) + 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.Denom) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Pagination != nil { + l = options.Size(x.Pagination) + 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().(*QueryDenomOwnersRequest) + 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.Pagination != nil { + encoded, err := options.Marshal(x.Pagination) + 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.Denom) > 0 { + i -= len(x.Denom) + copy(dAtA[i:], x.Denom) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Denom))) + 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().(*QueryDenomOwnersRequest) + 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: QueryDenomOwnersRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryDenomOwnersRequest: 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 Denom", 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.Denom = 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 Pagination", 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.Pagination == nil { + x.Pagination = &v1beta11.PageRequest{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); 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_DenomOwner protoreflect.MessageDescriptor + fd_DenomOwner_address protoreflect.FieldDescriptor + fd_DenomOwner_balance protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_bank_v1beta1_query_proto_init() + md_DenomOwner = File_cosmos_bank_v1beta1_query_proto.Messages().ByName("DenomOwner") + fd_DenomOwner_address = md_DenomOwner.Fields().ByName("address") + fd_DenomOwner_balance = md_DenomOwner.Fields().ByName("balance") +} + +var _ protoreflect.Message = (*fastReflection_DenomOwner)(nil) + +type fastReflection_DenomOwner DenomOwner + +func (x *DenomOwner) ProtoReflect() protoreflect.Message { + return (*fastReflection_DenomOwner)(x) +} + +func (x *DenomOwner) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_bank_v1beta1_query_proto_msgTypes[21] + 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_DenomOwner_messageType fastReflection_DenomOwner_messageType +var _ protoreflect.MessageType = fastReflection_DenomOwner_messageType{} + +type fastReflection_DenomOwner_messageType struct{} + +func (x fastReflection_DenomOwner_messageType) Zero() protoreflect.Message { + return (*fastReflection_DenomOwner)(nil) +} +func (x fastReflection_DenomOwner_messageType) New() protoreflect.Message { + return new(fastReflection_DenomOwner) +} +func (x fastReflection_DenomOwner_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_DenomOwner +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_DenomOwner) Descriptor() protoreflect.MessageDescriptor { + return md_DenomOwner +} + +// 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_DenomOwner) Type() protoreflect.MessageType { + return _fastReflection_DenomOwner_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_DenomOwner) New() protoreflect.Message { + return new(fastReflection_DenomOwner) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_DenomOwner) Interface() protoreflect.ProtoMessage { + return (*DenomOwner)(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_DenomOwner) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_DenomOwner_address, value) { + return + } + } + if x.Balance != nil { + value := protoreflect.ValueOfMessage(x.Balance.ProtoReflect()) + if !f(fd_DenomOwner_balance, 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_DenomOwner) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.bank.v1beta1.DenomOwner.address": + return x.Address != "" + case "cosmos.bank.v1beta1.DenomOwner.balance": + return x.Balance != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.DenomOwner")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.DenomOwner 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_DenomOwner) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.bank.v1beta1.DenomOwner.address": + x.Address = "" + case "cosmos.bank.v1beta1.DenomOwner.balance": + x.Balance = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.DenomOwner")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.DenomOwner 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_DenomOwner) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.bank.v1beta1.DenomOwner.address": + value := x.Address + return protoreflect.ValueOfString(value) + case "cosmos.bank.v1beta1.DenomOwner.balance": + value := x.Balance + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.DenomOwner")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.DenomOwner 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_DenomOwner) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.bank.v1beta1.DenomOwner.address": + x.Address = value.Interface().(string) + case "cosmos.bank.v1beta1.DenomOwner.balance": + x.Balance = value.Message().Interface().(*v1beta1.Coin) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.DenomOwner")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.DenomOwner 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_DenomOwner) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.bank.v1beta1.DenomOwner.balance": + if x.Balance == nil { + x.Balance = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.Balance.ProtoReflect()) + case "cosmos.bank.v1beta1.DenomOwner.address": + panic(fmt.Errorf("field address of message cosmos.bank.v1beta1.DenomOwner is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.DenomOwner")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.DenomOwner 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_DenomOwner) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.bank.v1beta1.DenomOwner.address": + return protoreflect.ValueOfString("") + case "cosmos.bank.v1beta1.DenomOwner.balance": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.DenomOwner")) + } + panic(fmt.Errorf("message cosmos.bank.v1beta1.DenomOwner 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_DenomOwner) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.bank.v1beta1.DenomOwner", 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_DenomOwner) 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_DenomOwner) 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_DenomOwner) 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_DenomOwner) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*DenomOwner) + 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.Address) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Balance != nil { + l = options.Size(x.Balance) + 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().(*DenomOwner) + 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.Balance != nil { + encoded, err := options.Marshal(x.Balance) + 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.Address) > 0 { + i -= len(x.Address) + copy(dAtA[i:], x.Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + 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().(*DenomOwner) + 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: DenomOwner: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DenomOwner: 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 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 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Balance", 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.Balance == nil { + x.Balance = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Balance); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_QueryDenomOwnersResponse_1_list)(nil) + +type _QueryDenomOwnersResponse_1_list struct { + list *[]*DenomOwner +} + +func (x *_QueryDenomOwnersResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryDenomOwnersResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryDenomOwnersResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*DenomOwner) + (*x.list)[i] = concreteValue +} + +func (x *_QueryDenomOwnersResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*DenomOwner) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryDenomOwnersResponse_1_list) AppendMutable() protoreflect.Value { + v := new(DenomOwner) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryDenomOwnersResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryDenomOwnersResponse_1_list) NewElement() protoreflect.Value { + v := new(DenomOwner) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryDenomOwnersResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryDenomOwnersResponse protoreflect.MessageDescriptor + fd_QueryDenomOwnersResponse_denom_owners protoreflect.FieldDescriptor + fd_QueryDenomOwnersResponse_pagination protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_bank_v1beta1_query_proto_init() + md_QueryDenomOwnersResponse = File_cosmos_bank_v1beta1_query_proto.Messages().ByName("QueryDenomOwnersResponse") + fd_QueryDenomOwnersResponse_denom_owners = md_QueryDenomOwnersResponse.Fields().ByName("denom_owners") + fd_QueryDenomOwnersResponse_pagination = md_QueryDenomOwnersResponse.Fields().ByName("pagination") } -var _ protoreflect.Message = (*fastReflection_QueryDenomOwnersRequest)(nil) +var _ protoreflect.Message = (*fastReflection_QueryDenomOwnersResponse)(nil) -type fastReflection_QueryDenomOwnersRequest QueryDenomOwnersRequest +type fastReflection_QueryDenomOwnersResponse QueryDenomOwnersResponse -func (x *QueryDenomOwnersRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryDenomOwnersRequest)(x) +func (x *QueryDenomOwnersResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryDenomOwnersResponse)(x) } -func (x *QueryDenomOwnersRequest) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_bank_v1beta1_query_proto_msgTypes[18] +func (x *QueryDenomOwnersResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_bank_v1beta1_query_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8605,43 +10509,43 @@ func (x *QueryDenomOwnersRequest) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_QueryDenomOwnersRequest_messageType fastReflection_QueryDenomOwnersRequest_messageType -var _ protoreflect.MessageType = fastReflection_QueryDenomOwnersRequest_messageType{} +var _fastReflection_QueryDenomOwnersResponse_messageType fastReflection_QueryDenomOwnersResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryDenomOwnersResponse_messageType{} -type fastReflection_QueryDenomOwnersRequest_messageType struct{} +type fastReflection_QueryDenomOwnersResponse_messageType struct{} -func (x fastReflection_QueryDenomOwnersRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryDenomOwnersRequest)(nil) +func (x fastReflection_QueryDenomOwnersResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryDenomOwnersResponse)(nil) } -func (x fastReflection_QueryDenomOwnersRequest_messageType) New() protoreflect.Message { - return new(fastReflection_QueryDenomOwnersRequest) +func (x fastReflection_QueryDenomOwnersResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryDenomOwnersResponse) } -func (x fastReflection_QueryDenomOwnersRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryDenomOwnersRequest +func (x fastReflection_QueryDenomOwnersResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryDenomOwnersResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_QueryDenomOwnersRequest) Descriptor() protoreflect.MessageDescriptor { - return md_QueryDenomOwnersRequest +func (x *fastReflection_QueryDenomOwnersResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryDenomOwnersResponse } // 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_QueryDenomOwnersRequest) Type() protoreflect.MessageType { - return _fastReflection_QueryDenomOwnersRequest_messageType +func (x *fastReflection_QueryDenomOwnersResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryDenomOwnersResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryDenomOwnersRequest) New() protoreflect.Message { - return new(fastReflection_QueryDenomOwnersRequest) +func (x *fastReflection_QueryDenomOwnersResponse) New() protoreflect.Message { + return new(fastReflection_QueryDenomOwnersResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryDenomOwnersRequest) Interface() protoreflect.ProtoMessage { - return (*QueryDenomOwnersRequest)(x) +func (x *fastReflection_QueryDenomOwnersResponse) Interface() protoreflect.ProtoMessage { + return (*QueryDenomOwnersResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -8649,16 +10553,16 @@ func (x *fastReflection_QueryDenomOwnersRequest) 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_QueryDenomOwnersRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Denom != "" { - value := protoreflect.ValueOfString(x.Denom) - if !f(fd_QueryDenomOwnersRequest_denom, value) { +func (x *fastReflection_QueryDenomOwnersResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.DenomOwners) != 0 { + value := protoreflect.ValueOfList(&_QueryDenomOwnersResponse_1_list{list: &x.DenomOwners}) + if !f(fd_QueryDenomOwnersResponse_denom_owners, value) { return } } if x.Pagination != nil { value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) - if !f(fd_QueryDenomOwnersRequest_pagination, value) { + if !f(fd_QueryDenomOwnersResponse_pagination, value) { return } } @@ -8675,17 +10579,17 @@ func (x *fastReflection_QueryDenomOwnersRequest) 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_QueryDenomOwnersRequest) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_QueryDenomOwnersResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.bank.v1beta1.QueryDenomOwnersRequest.denom": - return x.Denom != "" - case "cosmos.bank.v1beta1.QueryDenomOwnersRequest.pagination": + case "cosmos.bank.v1beta1.QueryDenomOwnersResponse.denom_owners": + return len(x.DenomOwners) != 0 + case "cosmos.bank.v1beta1.QueryDenomOwnersResponse.pagination": return x.Pagination != nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomOwnersRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomOwnersResponse")) } - panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomOwnersRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomOwnersResponse does not contain field %s", fd.FullName())) } } @@ -8695,17 +10599,17 @@ func (x *fastReflection_QueryDenomOwnersRequest) Has(fd protoreflect.FieldDescri // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryDenomOwnersRequest) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_QueryDenomOwnersResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.bank.v1beta1.QueryDenomOwnersRequest.denom": - x.Denom = "" - case "cosmos.bank.v1beta1.QueryDenomOwnersRequest.pagination": + case "cosmos.bank.v1beta1.QueryDenomOwnersResponse.denom_owners": + x.DenomOwners = nil + case "cosmos.bank.v1beta1.QueryDenomOwnersResponse.pagination": x.Pagination = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomOwnersRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomOwnersResponse")) } - panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomOwnersRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomOwnersResponse does not contain field %s", fd.FullName())) } } @@ -8715,19 +10619,22 @@ func (x *fastReflection_QueryDenomOwnersRequest) 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_QueryDenomOwnersRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryDenomOwnersResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cosmos.bank.v1beta1.QueryDenomOwnersRequest.denom": - value := x.Denom - return protoreflect.ValueOfString(value) - case "cosmos.bank.v1beta1.QueryDenomOwnersRequest.pagination": + case "cosmos.bank.v1beta1.QueryDenomOwnersResponse.denom_owners": + if len(x.DenomOwners) == 0 { + return protoreflect.ValueOfList(&_QueryDenomOwnersResponse_1_list{}) + } + listValue := &_QueryDenomOwnersResponse_1_list{list: &x.DenomOwners} + return protoreflect.ValueOfList(listValue) + case "cosmos.bank.v1beta1.QueryDenomOwnersResponse.pagination": value := x.Pagination return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomOwnersRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomOwnersResponse")) } - panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomOwnersRequest does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomOwnersResponse does not contain field %s", descriptor.FullName())) } } @@ -8741,17 +10648,19 @@ func (x *fastReflection_QueryDenomOwnersRequest) Get(descriptor protoreflect.Fie // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryDenomOwnersRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_QueryDenomOwnersResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cosmos.bank.v1beta1.QueryDenomOwnersRequest.denom": - x.Denom = value.Interface().(string) - case "cosmos.bank.v1beta1.QueryDenomOwnersRequest.pagination": - x.Pagination = value.Message().Interface().(*v1beta11.PageRequest) + case "cosmos.bank.v1beta1.QueryDenomOwnersResponse.denom_owners": + lv := value.List() + clv := lv.(*_QueryDenomOwnersResponse_1_list) + x.DenomOwners = *clv.list + case "cosmos.bank.v1beta1.QueryDenomOwnersResponse.pagination": + x.Pagination = value.Message().Interface().(*v1beta11.PageResponse) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomOwnersRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomOwnersResponse")) } - panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomOwnersRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomOwnersResponse does not contain field %s", fd.FullName())) } } @@ -8765,48 +10674,53 @@ func (x *fastReflection_QueryDenomOwnersRequest) 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_QueryDenomOwnersRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryDenomOwnersResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.bank.v1beta1.QueryDenomOwnersRequest.pagination": + case "cosmos.bank.v1beta1.QueryDenomOwnersResponse.denom_owners": + if x.DenomOwners == nil { + x.DenomOwners = []*DenomOwner{} + } + value := &_QueryDenomOwnersResponse_1_list{list: &x.DenomOwners} + return protoreflect.ValueOfList(value) + case "cosmos.bank.v1beta1.QueryDenomOwnersResponse.pagination": if x.Pagination == nil { - x.Pagination = new(v1beta11.PageRequest) + x.Pagination = new(v1beta11.PageResponse) } return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) - case "cosmos.bank.v1beta1.QueryDenomOwnersRequest.denom": - panic(fmt.Errorf("field denom of message cosmos.bank.v1beta1.QueryDenomOwnersRequest is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomOwnersRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomOwnersResponse")) } - panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomOwnersRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomOwnersResponse 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_QueryDenomOwnersRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryDenomOwnersResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.bank.v1beta1.QueryDenomOwnersRequest.denom": - return protoreflect.ValueOfString("") - case "cosmos.bank.v1beta1.QueryDenomOwnersRequest.pagination": - m := new(v1beta11.PageRequest) + case "cosmos.bank.v1beta1.QueryDenomOwnersResponse.denom_owners": + list := []*DenomOwner{} + return protoreflect.ValueOfList(&_QueryDenomOwnersResponse_1_list{list: &list}) + case "cosmos.bank.v1beta1.QueryDenomOwnersResponse.pagination": + m := new(v1beta11.PageResponse) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomOwnersRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomOwnersResponse")) } - panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomOwnersRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomOwnersResponse 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_QueryDenomOwnersRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_QueryDenomOwnersResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.bank.v1beta1.QueryDenomOwnersRequest", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.bank.v1beta1.QueryDenomOwnersResponse", d.FullName())) } panic("unreachable") } @@ -8814,7 +10728,7 @@ func (x *fastReflection_QueryDenomOwnersRequest) 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_QueryDenomOwnersRequest) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_QueryDenomOwnersResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -8825,7 +10739,7 @@ func (x *fastReflection_QueryDenomOwnersRequest) 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_QueryDenomOwnersRequest) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_QueryDenomOwnersResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -8837,7 +10751,7 @@ func (x *fastReflection_QueryDenomOwnersRequest) 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_QueryDenomOwnersRequest) IsValid() bool { +func (x *fastReflection_QueryDenomOwnersResponse) IsValid() bool { return x != nil } @@ -8847,9 +10761,9 @@ func (x *fastReflection_QueryDenomOwnersRequest) 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_QueryDenomOwnersRequest) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_QueryDenomOwnersResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryDenomOwnersRequest) + x := input.Message.Interface().(*QueryDenomOwnersResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -8861,9 +10775,11 @@ func (x *fastReflection_QueryDenomOwnersRequest) ProtoMethods() *protoiface.Meth var n int var l int _ = l - l = len(x.Denom) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) + if len(x.DenomOwners) > 0 { + for _, e := range x.DenomOwners { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } } if x.Pagination != nil { l = options.Size(x.Pagination) @@ -8879,7 +10795,7 @@ func (x *fastReflection_QueryDenomOwnersRequest) ProtoMethods() *protoiface.Meth } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryDenomOwnersRequest) + x := input.Message.Interface().(*QueryDenomOwnersResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -8912,12 +10828,21 @@ func (x *fastReflection_QueryDenomOwnersRequest) ProtoMethods() *protoiface.Meth i-- dAtA[i] = 0x12 } - if len(x.Denom) > 0 { - i -= len(x.Denom) - copy(dAtA[i:], x.Denom) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Denom))) - i-- - dAtA[i] = 0xa + if len(x.DenomOwners) > 0 { + for iNdEx := len(x.DenomOwners) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.DenomOwners[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) @@ -8930,7 +10855,7 @@ func (x *fastReflection_QueryDenomOwnersRequest) ProtoMethods() *protoiface.Meth }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryDenomOwnersRequest) + x := input.Message.Interface().(*QueryDenomOwnersResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -8962,17 +10887,17 @@ func (x *fastReflection_QueryDenomOwnersRequest) 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: QueryDenomOwnersRequest: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryDenomOwnersResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryDenomOwnersRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryDenomOwnersResponse: 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 Denom", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DenomOwners", 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 @@ -8982,23 +10907,25 @@ func (x *fastReflection_QueryDenomOwnersRequest) ProtoMethods() *protoiface.Meth } 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.Denom = string(dAtA[iNdEx:postIndex]) + x.DenomOwners = append(x.DenomOwners, &DenomOwner{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.DenomOwners[len(x.DenomOwners)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } iNdEx = postIndex case 2: if wireType != 2 { @@ -9030,7 +10957,7 @@ func (x *fastReflection_QueryDenomOwnersRequest) ProtoMethods() *protoiface.Meth return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } if x.Pagination == nil { - x.Pagination = &v1beta11.PageRequest{} + x.Pagination = &v1beta11.PageResponse{} } if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err @@ -9072,28 +10999,28 @@ func (x *fastReflection_QueryDenomOwnersRequest) ProtoMethods() *protoiface.Meth } var ( - md_DenomOwner protoreflect.MessageDescriptor - fd_DenomOwner_address protoreflect.FieldDescriptor - fd_DenomOwner_balance protoreflect.FieldDescriptor + md_QueryDenomOwnersByQueryRequest protoreflect.MessageDescriptor + fd_QueryDenomOwnersByQueryRequest_denom protoreflect.FieldDescriptor + fd_QueryDenomOwnersByQueryRequest_pagination protoreflect.FieldDescriptor ) func init() { file_cosmos_bank_v1beta1_query_proto_init() - md_DenomOwner = File_cosmos_bank_v1beta1_query_proto.Messages().ByName("DenomOwner") - fd_DenomOwner_address = md_DenomOwner.Fields().ByName("address") - fd_DenomOwner_balance = md_DenomOwner.Fields().ByName("balance") + md_QueryDenomOwnersByQueryRequest = File_cosmos_bank_v1beta1_query_proto.Messages().ByName("QueryDenomOwnersByQueryRequest") + fd_QueryDenomOwnersByQueryRequest_denom = md_QueryDenomOwnersByQueryRequest.Fields().ByName("denom") + fd_QueryDenomOwnersByQueryRequest_pagination = md_QueryDenomOwnersByQueryRequest.Fields().ByName("pagination") } -var _ protoreflect.Message = (*fastReflection_DenomOwner)(nil) +var _ protoreflect.Message = (*fastReflection_QueryDenomOwnersByQueryRequest)(nil) -type fastReflection_DenomOwner DenomOwner +type fastReflection_QueryDenomOwnersByQueryRequest QueryDenomOwnersByQueryRequest -func (x *DenomOwner) ProtoReflect() protoreflect.Message { - return (*fastReflection_DenomOwner)(x) +func (x *QueryDenomOwnersByQueryRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryDenomOwnersByQueryRequest)(x) } -func (x *DenomOwner) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_bank_v1beta1_query_proto_msgTypes[19] +func (x *QueryDenomOwnersByQueryRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_bank_v1beta1_query_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9104,43 +11031,43 @@ func (x *DenomOwner) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_DenomOwner_messageType fastReflection_DenomOwner_messageType -var _ protoreflect.MessageType = fastReflection_DenomOwner_messageType{} +var _fastReflection_QueryDenomOwnersByQueryRequest_messageType fastReflection_QueryDenomOwnersByQueryRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryDenomOwnersByQueryRequest_messageType{} -type fastReflection_DenomOwner_messageType struct{} +type fastReflection_QueryDenomOwnersByQueryRequest_messageType struct{} -func (x fastReflection_DenomOwner_messageType) Zero() protoreflect.Message { - return (*fastReflection_DenomOwner)(nil) +func (x fastReflection_QueryDenomOwnersByQueryRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryDenomOwnersByQueryRequest)(nil) } -func (x fastReflection_DenomOwner_messageType) New() protoreflect.Message { - return new(fastReflection_DenomOwner) +func (x fastReflection_QueryDenomOwnersByQueryRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryDenomOwnersByQueryRequest) } -func (x fastReflection_DenomOwner_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_DenomOwner +func (x fastReflection_QueryDenomOwnersByQueryRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryDenomOwnersByQueryRequest } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_DenomOwner) Descriptor() protoreflect.MessageDescriptor { - return md_DenomOwner +func (x *fastReflection_QueryDenomOwnersByQueryRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryDenomOwnersByQueryRequest } // 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_DenomOwner) Type() protoreflect.MessageType { - return _fastReflection_DenomOwner_messageType +func (x *fastReflection_QueryDenomOwnersByQueryRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryDenomOwnersByQueryRequest_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_DenomOwner) New() protoreflect.Message { - return new(fastReflection_DenomOwner) +func (x *fastReflection_QueryDenomOwnersByQueryRequest) New() protoreflect.Message { + return new(fastReflection_QueryDenomOwnersByQueryRequest) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_DenomOwner) Interface() protoreflect.ProtoMessage { - return (*DenomOwner)(x) +func (x *fastReflection_QueryDenomOwnersByQueryRequest) Interface() protoreflect.ProtoMessage { + return (*QueryDenomOwnersByQueryRequest)(x) } // Range iterates over every populated field in an undefined order, @@ -9148,16 +11075,16 @@ func (x *fastReflection_DenomOwner) 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_DenomOwner) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Address != "" { - value := protoreflect.ValueOfString(x.Address) - if !f(fd_DenomOwner_address, value) { +func (x *fastReflection_QueryDenomOwnersByQueryRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Denom != "" { + value := protoreflect.ValueOfString(x.Denom) + if !f(fd_QueryDenomOwnersByQueryRequest_denom, value) { return } } - if x.Balance != nil { - value := protoreflect.ValueOfMessage(x.Balance.ProtoReflect()) - if !f(fd_DenomOwner_balance, value) { + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryDenomOwnersByQueryRequest_pagination, value) { return } } @@ -9174,17 +11101,17 @@ func (x *fastReflection_DenomOwner) 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_DenomOwner) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_QueryDenomOwnersByQueryRequest) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.bank.v1beta1.DenomOwner.address": - return x.Address != "" - case "cosmos.bank.v1beta1.DenomOwner.balance": - return x.Balance != nil + case "cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest.denom": + return x.Denom != "" + case "cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest.pagination": + return x.Pagination != nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.DenomOwner")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest")) } - panic(fmt.Errorf("message cosmos.bank.v1beta1.DenomOwner does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest does not contain field %s", fd.FullName())) } } @@ -9194,17 +11121,17 @@ func (x *fastReflection_DenomOwner) Has(fd protoreflect.FieldDescriptor) bool { // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_DenomOwner) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_QueryDenomOwnersByQueryRequest) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.bank.v1beta1.DenomOwner.address": - x.Address = "" - case "cosmos.bank.v1beta1.DenomOwner.balance": - x.Balance = nil + case "cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest.denom": + x.Denom = "" + case "cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest.pagination": + x.Pagination = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.DenomOwner")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest")) } - panic(fmt.Errorf("message cosmos.bank.v1beta1.DenomOwner does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest does not contain field %s", fd.FullName())) } } @@ -9214,19 +11141,19 @@ func (x *fastReflection_DenomOwner) 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_DenomOwner) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryDenomOwnersByQueryRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cosmos.bank.v1beta1.DenomOwner.address": - value := x.Address + case "cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest.denom": + value := x.Denom return protoreflect.ValueOfString(value) - case "cosmos.bank.v1beta1.DenomOwner.balance": - value := x.Balance + case "cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest.pagination": + value := x.Pagination return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.DenomOwner")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest")) } - panic(fmt.Errorf("message cosmos.bank.v1beta1.DenomOwner does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest does not contain field %s", descriptor.FullName())) } } @@ -9240,17 +11167,17 @@ func (x *fastReflection_DenomOwner) Get(descriptor protoreflect.FieldDescriptor) // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_DenomOwner) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_QueryDenomOwnersByQueryRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cosmos.bank.v1beta1.DenomOwner.address": - x.Address = value.Interface().(string) - case "cosmos.bank.v1beta1.DenomOwner.balance": - x.Balance = value.Message().Interface().(*v1beta1.Coin) + case "cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest.denom": + x.Denom = value.Interface().(string) + case "cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest.pagination": + x.Pagination = value.Message().Interface().(*v1beta11.PageRequest) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.DenomOwner")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest")) } - panic(fmt.Errorf("message cosmos.bank.v1beta1.DenomOwner does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest does not contain field %s", fd.FullName())) } } @@ -9264,48 +11191,48 @@ func (x *fastReflection_DenomOwner) 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_DenomOwner) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryDenomOwnersByQueryRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.bank.v1beta1.DenomOwner.balance": - if x.Balance == nil { - x.Balance = new(v1beta1.Coin) + case "cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta11.PageRequest) } - return protoreflect.ValueOfMessage(x.Balance.ProtoReflect()) - case "cosmos.bank.v1beta1.DenomOwner.address": - panic(fmt.Errorf("field address of message cosmos.bank.v1beta1.DenomOwner is not mutable")) + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + case "cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest.denom": + panic(fmt.Errorf("field denom of message cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.DenomOwner")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest")) } - panic(fmt.Errorf("message cosmos.bank.v1beta1.DenomOwner does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest 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_DenomOwner) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryDenomOwnersByQueryRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.bank.v1beta1.DenomOwner.address": + case "cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest.denom": return protoreflect.ValueOfString("") - case "cosmos.bank.v1beta1.DenomOwner.balance": - m := new(v1beta1.Coin) + case "cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest.pagination": + m := new(v1beta11.PageRequest) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.DenomOwner")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest")) } - panic(fmt.Errorf("message cosmos.bank.v1beta1.DenomOwner does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest 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_DenomOwner) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_QueryDenomOwnersByQueryRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.bank.v1beta1.DenomOwner", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest", d.FullName())) } panic("unreachable") } @@ -9313,7 +11240,7 @@ func (x *fastReflection_DenomOwner) 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_DenomOwner) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_QueryDenomOwnersByQueryRequest) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -9324,7 +11251,7 @@ func (x *fastReflection_DenomOwner) 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_DenomOwner) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_QueryDenomOwnersByQueryRequest) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -9336,7 +11263,7 @@ func (x *fastReflection_DenomOwner) 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_DenomOwner) IsValid() bool { +func (x *fastReflection_QueryDenomOwnersByQueryRequest) IsValid() bool { return x != nil } @@ -9346,9 +11273,9 @@ func (x *fastReflection_DenomOwner) 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_DenomOwner) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_QueryDenomOwnersByQueryRequest) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*DenomOwner) + x := input.Message.Interface().(*QueryDenomOwnersByQueryRequest) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -9360,12 +11287,12 @@ func (x *fastReflection_DenomOwner) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.Address) + l = len(x.Denom) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if x.Balance != nil { - l = options.Size(x.Balance) + if x.Pagination != nil { + l = options.Size(x.Pagination) n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { @@ -9378,7 +11305,7 @@ func (x *fastReflection_DenomOwner) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*DenomOwner) + x := input.Message.Interface().(*QueryDenomOwnersByQueryRequest) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -9397,8 +11324,8 @@ func (x *fastReflection_DenomOwner) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.Balance != nil { - encoded, err := options.Marshal(x.Balance) + if x.Pagination != nil { + encoded, err := options.Marshal(x.Pagination) if err != nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -9411,10 +11338,10 @@ func (x *fastReflection_DenomOwner) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x12 } - if len(x.Address) > 0 { - i -= len(x.Address) - copy(dAtA[i:], x.Address) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + if len(x.Denom) > 0 { + i -= len(x.Denom) + copy(dAtA[i:], x.Denom) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Denom))) i-- dAtA[i] = 0xa } @@ -9429,7 +11356,7 @@ func (x *fastReflection_DenomOwner) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*DenomOwner) + x := input.Message.Interface().(*QueryDenomOwnersByQueryRequest) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -9461,15 +11388,15 @@ func (x *fastReflection_DenomOwner) 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: DenomOwner: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryDenomOwnersByQueryRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DenomOwner: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryDenomOwnersByQueryRequest: 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 Address", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -9497,11 +11424,11 @@ func (x *fastReflection_DenomOwner) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Address = string(dAtA[iNdEx:postIndex]) + x.Denom = 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 Balance", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -9528,10 +11455,10 @@ func (x *fastReflection_DenomOwner) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - if x.Balance == nil { - x.Balance = &v1beta1.Coin{} + if x.Pagination == nil { + x.Pagination = &v1beta11.PageRequest{} } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Balance); err != nil { + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex @@ -9570,80 +11497,80 @@ func (x *fastReflection_DenomOwner) ProtoMethods() *protoiface.Methods { } } -var _ protoreflect.List = (*_QueryDenomOwnersResponse_1_list)(nil) +var _ protoreflect.List = (*_QueryDenomOwnersByQueryResponse_1_list)(nil) -type _QueryDenomOwnersResponse_1_list struct { +type _QueryDenomOwnersByQueryResponse_1_list struct { list *[]*DenomOwner } -func (x *_QueryDenomOwnersResponse_1_list) Len() int { +func (x *_QueryDenomOwnersByQueryResponse_1_list) Len() int { if x.list == nil { return 0 } return len(*x.list) } -func (x *_QueryDenomOwnersResponse_1_list) Get(i int) protoreflect.Value { +func (x *_QueryDenomOwnersByQueryResponse_1_list) Get(i int) protoreflect.Value { return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) } -func (x *_QueryDenomOwnersResponse_1_list) Set(i int, value protoreflect.Value) { +func (x *_QueryDenomOwnersByQueryResponse_1_list) Set(i int, value protoreflect.Value) { valueUnwrapped := value.Message() concreteValue := valueUnwrapped.Interface().(*DenomOwner) (*x.list)[i] = concreteValue } -func (x *_QueryDenomOwnersResponse_1_list) Append(value protoreflect.Value) { +func (x *_QueryDenomOwnersByQueryResponse_1_list) Append(value protoreflect.Value) { valueUnwrapped := value.Message() concreteValue := valueUnwrapped.Interface().(*DenomOwner) *x.list = append(*x.list, concreteValue) } -func (x *_QueryDenomOwnersResponse_1_list) AppendMutable() protoreflect.Value { +func (x *_QueryDenomOwnersByQueryResponse_1_list) AppendMutable() protoreflect.Value { v := new(DenomOwner) *x.list = append(*x.list, v) return protoreflect.ValueOfMessage(v.ProtoReflect()) } -func (x *_QueryDenomOwnersResponse_1_list) Truncate(n int) { +func (x *_QueryDenomOwnersByQueryResponse_1_list) Truncate(n int) { for i := n; i < len(*x.list); i++ { (*x.list)[i] = nil } *x.list = (*x.list)[:n] } -func (x *_QueryDenomOwnersResponse_1_list) NewElement() protoreflect.Value { +func (x *_QueryDenomOwnersByQueryResponse_1_list) NewElement() protoreflect.Value { v := new(DenomOwner) return protoreflect.ValueOfMessage(v.ProtoReflect()) } -func (x *_QueryDenomOwnersResponse_1_list) IsValid() bool { +func (x *_QueryDenomOwnersByQueryResponse_1_list) IsValid() bool { return x.list != nil } var ( - md_QueryDenomOwnersResponse protoreflect.MessageDescriptor - fd_QueryDenomOwnersResponse_denom_owners protoreflect.FieldDescriptor - fd_QueryDenomOwnersResponse_pagination protoreflect.FieldDescriptor + md_QueryDenomOwnersByQueryResponse protoreflect.MessageDescriptor + fd_QueryDenomOwnersByQueryResponse_denom_owners protoreflect.FieldDescriptor + fd_QueryDenomOwnersByQueryResponse_pagination protoreflect.FieldDescriptor ) func init() { file_cosmos_bank_v1beta1_query_proto_init() - md_QueryDenomOwnersResponse = File_cosmos_bank_v1beta1_query_proto.Messages().ByName("QueryDenomOwnersResponse") - fd_QueryDenomOwnersResponse_denom_owners = md_QueryDenomOwnersResponse.Fields().ByName("denom_owners") - fd_QueryDenomOwnersResponse_pagination = md_QueryDenomOwnersResponse.Fields().ByName("pagination") + md_QueryDenomOwnersByQueryResponse = File_cosmos_bank_v1beta1_query_proto.Messages().ByName("QueryDenomOwnersByQueryResponse") + fd_QueryDenomOwnersByQueryResponse_denom_owners = md_QueryDenomOwnersByQueryResponse.Fields().ByName("denom_owners") + fd_QueryDenomOwnersByQueryResponse_pagination = md_QueryDenomOwnersByQueryResponse.Fields().ByName("pagination") } -var _ protoreflect.Message = (*fastReflection_QueryDenomOwnersResponse)(nil) +var _ protoreflect.Message = (*fastReflection_QueryDenomOwnersByQueryResponse)(nil) -type fastReflection_QueryDenomOwnersResponse QueryDenomOwnersResponse +type fastReflection_QueryDenomOwnersByQueryResponse QueryDenomOwnersByQueryResponse -func (x *QueryDenomOwnersResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryDenomOwnersResponse)(x) +func (x *QueryDenomOwnersByQueryResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryDenomOwnersByQueryResponse)(x) } -func (x *QueryDenomOwnersResponse) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_bank_v1beta1_query_proto_msgTypes[20] +func (x *QueryDenomOwnersByQueryResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_bank_v1beta1_query_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9654,43 +11581,43 @@ func (x *QueryDenomOwnersResponse) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_QueryDenomOwnersResponse_messageType fastReflection_QueryDenomOwnersResponse_messageType -var _ protoreflect.MessageType = fastReflection_QueryDenomOwnersResponse_messageType{} +var _fastReflection_QueryDenomOwnersByQueryResponse_messageType fastReflection_QueryDenomOwnersByQueryResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryDenomOwnersByQueryResponse_messageType{} -type fastReflection_QueryDenomOwnersResponse_messageType struct{} +type fastReflection_QueryDenomOwnersByQueryResponse_messageType struct{} -func (x fastReflection_QueryDenomOwnersResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryDenomOwnersResponse)(nil) +func (x fastReflection_QueryDenomOwnersByQueryResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryDenomOwnersByQueryResponse)(nil) } -func (x fastReflection_QueryDenomOwnersResponse_messageType) New() protoreflect.Message { - return new(fastReflection_QueryDenomOwnersResponse) +func (x fastReflection_QueryDenomOwnersByQueryResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryDenomOwnersByQueryResponse) } -func (x fastReflection_QueryDenomOwnersResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryDenomOwnersResponse +func (x fastReflection_QueryDenomOwnersByQueryResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryDenomOwnersByQueryResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_QueryDenomOwnersResponse) Descriptor() protoreflect.MessageDescriptor { - return md_QueryDenomOwnersResponse +func (x *fastReflection_QueryDenomOwnersByQueryResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryDenomOwnersByQueryResponse } // 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_QueryDenomOwnersResponse) Type() protoreflect.MessageType { - return _fastReflection_QueryDenomOwnersResponse_messageType +func (x *fastReflection_QueryDenomOwnersByQueryResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryDenomOwnersByQueryResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryDenomOwnersResponse) New() protoreflect.Message { - return new(fastReflection_QueryDenomOwnersResponse) +func (x *fastReflection_QueryDenomOwnersByQueryResponse) New() protoreflect.Message { + return new(fastReflection_QueryDenomOwnersByQueryResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryDenomOwnersResponse) Interface() protoreflect.ProtoMessage { - return (*QueryDenomOwnersResponse)(x) +func (x *fastReflection_QueryDenomOwnersByQueryResponse) Interface() protoreflect.ProtoMessage { + return (*QueryDenomOwnersByQueryResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -9698,16 +11625,16 @@ func (x *fastReflection_QueryDenomOwnersResponse) Interface() protoreflect.Proto // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_QueryDenomOwnersResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_QueryDenomOwnersByQueryResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if len(x.DenomOwners) != 0 { - value := protoreflect.ValueOfList(&_QueryDenomOwnersResponse_1_list{list: &x.DenomOwners}) - if !f(fd_QueryDenomOwnersResponse_denom_owners, value) { + value := protoreflect.ValueOfList(&_QueryDenomOwnersByQueryResponse_1_list{list: &x.DenomOwners}) + if !f(fd_QueryDenomOwnersByQueryResponse_denom_owners, value) { return } } if x.Pagination != nil { value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) - if !f(fd_QueryDenomOwnersResponse_pagination, value) { + if !f(fd_QueryDenomOwnersByQueryResponse_pagination, value) { return } } @@ -9724,17 +11651,17 @@ func (x *fastReflection_QueryDenomOwnersResponse) Range(f func(protoreflect.Fiel // 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_QueryDenomOwnersResponse) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_QueryDenomOwnersByQueryResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.bank.v1beta1.QueryDenomOwnersResponse.denom_owners": + case "cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse.denom_owners": return len(x.DenomOwners) != 0 - case "cosmos.bank.v1beta1.QueryDenomOwnersResponse.pagination": + case "cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse.pagination": return x.Pagination != nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomOwnersResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse")) } - panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomOwnersResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse does not contain field %s", fd.FullName())) } } @@ -9744,17 +11671,17 @@ func (x *fastReflection_QueryDenomOwnersResponse) Has(fd protoreflect.FieldDescr // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryDenomOwnersResponse) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_QueryDenomOwnersByQueryResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.bank.v1beta1.QueryDenomOwnersResponse.denom_owners": + case "cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse.denom_owners": x.DenomOwners = nil - case "cosmos.bank.v1beta1.QueryDenomOwnersResponse.pagination": + case "cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse.pagination": x.Pagination = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomOwnersResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse")) } - panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomOwnersResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse does not contain field %s", fd.FullName())) } } @@ -9764,22 +11691,22 @@ func (x *fastReflection_QueryDenomOwnersResponse) Clear(fd protoreflect.FieldDes // 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_QueryDenomOwnersResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryDenomOwnersByQueryResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cosmos.bank.v1beta1.QueryDenomOwnersResponse.denom_owners": + case "cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse.denom_owners": if len(x.DenomOwners) == 0 { - return protoreflect.ValueOfList(&_QueryDenomOwnersResponse_1_list{}) + return protoreflect.ValueOfList(&_QueryDenomOwnersByQueryResponse_1_list{}) } - listValue := &_QueryDenomOwnersResponse_1_list{list: &x.DenomOwners} + listValue := &_QueryDenomOwnersByQueryResponse_1_list{list: &x.DenomOwners} return protoreflect.ValueOfList(listValue) - case "cosmos.bank.v1beta1.QueryDenomOwnersResponse.pagination": + case "cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse.pagination": value := x.Pagination return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomOwnersResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse")) } - panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomOwnersResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse does not contain field %s", descriptor.FullName())) } } @@ -9793,19 +11720,19 @@ func (x *fastReflection_QueryDenomOwnersResponse) Get(descriptor protoreflect.Fi // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryDenomOwnersResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_QueryDenomOwnersByQueryResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cosmos.bank.v1beta1.QueryDenomOwnersResponse.denom_owners": + case "cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse.denom_owners": lv := value.List() - clv := lv.(*_QueryDenomOwnersResponse_1_list) + clv := lv.(*_QueryDenomOwnersByQueryResponse_1_list) x.DenomOwners = *clv.list - case "cosmos.bank.v1beta1.QueryDenomOwnersResponse.pagination": + case "cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse.pagination": x.Pagination = value.Message().Interface().(*v1beta11.PageResponse) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomOwnersResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse")) } - panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomOwnersResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse does not contain field %s", fd.FullName())) } } @@ -9819,53 +11746,53 @@ func (x *fastReflection_QueryDenomOwnersResponse) Set(fd protoreflect.FieldDescr // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryDenomOwnersResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryDenomOwnersByQueryResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.bank.v1beta1.QueryDenomOwnersResponse.denom_owners": + case "cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse.denom_owners": if x.DenomOwners == nil { x.DenomOwners = []*DenomOwner{} } - value := &_QueryDenomOwnersResponse_1_list{list: &x.DenomOwners} + value := &_QueryDenomOwnersByQueryResponse_1_list{list: &x.DenomOwners} return protoreflect.ValueOfList(value) - case "cosmos.bank.v1beta1.QueryDenomOwnersResponse.pagination": + case "cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse.pagination": if x.Pagination == nil { x.Pagination = new(v1beta11.PageResponse) } return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomOwnersResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse")) } - panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomOwnersResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse 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_QueryDenomOwnersResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryDenomOwnersByQueryResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.bank.v1beta1.QueryDenomOwnersResponse.denom_owners": + case "cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse.denom_owners": list := []*DenomOwner{} - return protoreflect.ValueOfList(&_QueryDenomOwnersResponse_1_list{list: &list}) - case "cosmos.bank.v1beta1.QueryDenomOwnersResponse.pagination": + return protoreflect.ValueOfList(&_QueryDenomOwnersByQueryResponse_1_list{list: &list}) + case "cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse.pagination": m := new(v1beta11.PageResponse) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomOwnersResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse")) } - panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomOwnersResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse 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_QueryDenomOwnersResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_QueryDenomOwnersByQueryResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.bank.v1beta1.QueryDenomOwnersResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse", d.FullName())) } panic("unreachable") } @@ -9873,7 +11800,7 @@ func (x *fastReflection_QueryDenomOwnersResponse) WhichOneof(d protoreflect.Oneo // 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_QueryDenomOwnersResponse) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_QueryDenomOwnersByQueryResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -9884,7 +11811,7 @@ func (x *fastReflection_QueryDenomOwnersResponse) GetUnknown() protoreflect.RawF // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryDenomOwnersResponse) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_QueryDenomOwnersByQueryResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -9896,7 +11823,7 @@ func (x *fastReflection_QueryDenomOwnersResponse) 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_QueryDenomOwnersResponse) IsValid() bool { +func (x *fastReflection_QueryDenomOwnersByQueryResponse) IsValid() bool { return x != nil } @@ -9906,9 +11833,9 @@ func (x *fastReflection_QueryDenomOwnersResponse) 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_QueryDenomOwnersResponse) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_QueryDenomOwnersByQueryResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryDenomOwnersResponse) + x := input.Message.Interface().(*QueryDenomOwnersByQueryResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -9940,7 +11867,7 @@ func (x *fastReflection_QueryDenomOwnersResponse) ProtoMethods() *protoiface.Met } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryDenomOwnersResponse) + x := input.Message.Interface().(*QueryDenomOwnersByQueryResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -10000,7 +11927,7 @@ func (x *fastReflection_QueryDenomOwnersResponse) ProtoMethods() *protoiface.Met }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryDenomOwnersResponse) + x := input.Message.Interface().(*QueryDenomOwnersByQueryResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -10032,10 +11959,10 @@ func (x *fastReflection_QueryDenomOwnersResponse) 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: QueryDenomOwnersResponse: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryDenomOwnersByQueryResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryDenomOwnersResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryDenomOwnersByQueryResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -10211,7 +12138,7 @@ func (x *QuerySendEnabledRequest) ProtoReflect() protoreflect.Message { } func (x *QuerySendEnabledRequest) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_bank_v1beta1_query_proto_msgTypes[21] + mi := &file_cosmos_bank_v1beta1_query_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10777,7 +12704,7 @@ func (x *QuerySendEnabledResponse) ProtoReflect() protoreflect.Message { } func (x *QuerySendEnabledResponse) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_bank_v1beta1_query_proto_msgTypes[22] + mi := &file_cosmos_bank_v1beta1_query_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -11862,6 +13789,7 @@ type QueryParamsResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // params provides the parameters of the bank module. Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` } @@ -12051,6 +13979,82 @@ func (x *QueryDenomMetadataResponse) GetMetadata() *Metadata { return nil } +// QueryDenomMetadataByQueryStringRequest is the request type for the Query/DenomMetadata RPC method. +// Identical with QueryDenomMetadataRequest but receives denom as query string. +type QueryDenomMetadataByQueryStringRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // denom is the coin denom to query the metadata for. + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` +} + +func (x *QueryDenomMetadataByQueryStringRequest) Reset() { + *x = QueryDenomMetadataByQueryStringRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_bank_v1beta1_query_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryDenomMetadataByQueryStringRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryDenomMetadataByQueryStringRequest) ProtoMessage() {} + +// Deprecated: Use QueryDenomMetadataByQueryStringRequest.ProtoReflect.Descriptor instead. +func (*QueryDenomMetadataByQueryStringRequest) Descriptor() ([]byte, []int) { + return file_cosmos_bank_v1beta1_query_proto_rawDescGZIP(), []int{18} +} + +func (x *QueryDenomMetadataByQueryStringRequest) GetDenom() string { + if x != nil { + return x.Denom + } + return "" +} + +// QueryDenomMetadataByQueryStringResponse is the response type for the Query/DenomMetadata RPC +// method. Identical with QueryDenomMetadataResponse but receives denom as query string in request. +type QueryDenomMetadataByQueryStringResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // metadata describes and provides all the client information for the requested token. + Metadata *Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (x *QueryDenomMetadataByQueryStringResponse) Reset() { + *x = QueryDenomMetadataByQueryStringResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_bank_v1beta1_query_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryDenomMetadataByQueryStringResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryDenomMetadataByQueryStringResponse) ProtoMessage() {} + +// Deprecated: Use QueryDenomMetadataByQueryStringResponse.ProtoReflect.Descriptor instead. +func (*QueryDenomMetadataByQueryStringResponse) Descriptor() ([]byte, []int) { + return file_cosmos_bank_v1beta1_query_proto_rawDescGZIP(), []int{19} +} + +func (x *QueryDenomMetadataByQueryStringResponse) GetMetadata() *Metadata { + if x != nil { + return x.Metadata + } + return nil +} + // QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, // which queries for a paginated set of all account holders of a particular // denomination. @@ -12068,7 +14072,7 @@ type QueryDenomOwnersRequest struct { func (x *QueryDenomOwnersRequest) Reset() { *x = QueryDenomOwnersRequest{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_bank_v1beta1_query_proto_msgTypes[18] + mi := &file_cosmos_bank_v1beta1_query_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12082,7 +14086,7 @@ func (*QueryDenomOwnersRequest) ProtoMessage() {} // Deprecated: Use QueryDenomOwnersRequest.ProtoReflect.Descriptor instead. func (*QueryDenomOwnersRequest) Descriptor() ([]byte, []int) { - return file_cosmos_bank_v1beta1_query_proto_rawDescGZIP(), []int{18} + return file_cosmos_bank_v1beta1_query_proto_rawDescGZIP(), []int{20} } func (x *QueryDenomOwnersRequest) GetDenom() string { @@ -12118,7 +14122,7 @@ type DenomOwner struct { func (x *DenomOwner) Reset() { *x = DenomOwner{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_bank_v1beta1_query_proto_msgTypes[19] + mi := &file_cosmos_bank_v1beta1_query_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12132,7 +14136,7 @@ func (*DenomOwner) ProtoMessage() {} // Deprecated: Use DenomOwner.ProtoReflect.Descriptor instead. func (*DenomOwner) Descriptor() ([]byte, []int) { - return file_cosmos_bank_v1beta1_query_proto_rawDescGZIP(), []int{19} + return file_cosmos_bank_v1beta1_query_proto_rawDescGZIP(), []int{21} } func (x *DenomOwner) GetAddress() string { @@ -12165,7 +14169,7 @@ type QueryDenomOwnersResponse struct { func (x *QueryDenomOwnersResponse) Reset() { *x = QueryDenomOwnersResponse{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_bank_v1beta1_query_proto_msgTypes[20] + mi := &file_cosmos_bank_v1beta1_query_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12179,7 +14183,7 @@ func (*QueryDenomOwnersResponse) ProtoMessage() {} // Deprecated: Use QueryDenomOwnersResponse.ProtoReflect.Descriptor instead. func (*QueryDenomOwnersResponse) Descriptor() ([]byte, []int) { - return file_cosmos_bank_v1beta1_query_proto_rawDescGZIP(), []int{20} + return file_cosmos_bank_v1beta1_query_proto_rawDescGZIP(), []int{22} } func (x *QueryDenomOwnersResponse) GetDenomOwners() []*DenomOwner { @@ -12196,6 +14200,103 @@ func (x *QueryDenomOwnersResponse) GetPagination() *v1beta11.PageResponse { return nil } +// QueryDenomOwnersByQueryRequest defines the request type for the DenomOwnersByQuery RPC query, +// which queries for a paginated set of all account holders of a particular +// denomination. +// +// Since: cosmos-sdk 0.50.3 +type QueryDenomOwnersByQueryRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // denom defines the coin denomination to query all account holders for. + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + // pagination defines an optional pagination for the request. + Pagination *v1beta11.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryDenomOwnersByQueryRequest) Reset() { + *x = QueryDenomOwnersByQueryRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_bank_v1beta1_query_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryDenomOwnersByQueryRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryDenomOwnersByQueryRequest) ProtoMessage() {} + +// Deprecated: Use QueryDenomOwnersByQueryRequest.ProtoReflect.Descriptor instead. +func (*QueryDenomOwnersByQueryRequest) Descriptor() ([]byte, []int) { + return file_cosmos_bank_v1beta1_query_proto_rawDescGZIP(), []int{23} +} + +func (x *QueryDenomOwnersByQueryRequest) GetDenom() string { + if x != nil { + return x.Denom + } + return "" +} + +func (x *QueryDenomOwnersByQueryRequest) GetPagination() *v1beta11.PageRequest { + if x != nil { + return x.Pagination + } + return nil +} + +// QueryDenomOwnersByQueryResponse defines the RPC response of a DenomOwnersByQuery RPC query. +// +// Since: cosmos-sdk 0.50.3 +type QueryDenomOwnersByQueryResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DenomOwners []*DenomOwner `protobuf:"bytes,1,rep,name=denom_owners,json=denomOwners,proto3" json:"denom_owners,omitempty"` + // pagination defines the pagination in the response. + Pagination *v1beta11.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryDenomOwnersByQueryResponse) Reset() { + *x = QueryDenomOwnersByQueryResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_bank_v1beta1_query_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryDenomOwnersByQueryResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryDenomOwnersByQueryResponse) ProtoMessage() {} + +// Deprecated: Use QueryDenomOwnersByQueryResponse.ProtoReflect.Descriptor instead. +func (*QueryDenomOwnersByQueryResponse) Descriptor() ([]byte, []int) { + return file_cosmos_bank_v1beta1_query_proto_rawDescGZIP(), []int{24} +} + +func (x *QueryDenomOwnersByQueryResponse) GetDenomOwners() []*DenomOwner { + if x != nil { + return x.DenomOwners + } + return nil +} + +func (x *QueryDenomOwnersByQueryResponse) GetPagination() *v1beta11.PageResponse { + if x != nil { + return x.Pagination + } + return nil +} + // QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries. // // Since: cosmos-sdk 0.47 @@ -12214,7 +14315,7 @@ type QuerySendEnabledRequest struct { func (x *QuerySendEnabledRequest) Reset() { *x = QuerySendEnabledRequest{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_bank_v1beta1_query_proto_msgTypes[21] + mi := &file_cosmos_bank_v1beta1_query_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12228,7 +14329,7 @@ func (*QuerySendEnabledRequest) ProtoMessage() {} // Deprecated: Use QuerySendEnabledRequest.ProtoReflect.Descriptor instead. func (*QuerySendEnabledRequest) Descriptor() ([]byte, []int) { - return file_cosmos_bank_v1beta1_query_proto_rawDescGZIP(), []int{21} + return file_cosmos_bank_v1beta1_query_proto_rawDescGZIP(), []int{25} } func (x *QuerySendEnabledRequest) GetDenoms() []string { @@ -12262,7 +14363,7 @@ type QuerySendEnabledResponse struct { func (x *QuerySendEnabledResponse) Reset() { *x = QuerySendEnabledResponse{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_bank_v1beta1_query_proto_msgTypes[22] + mi := &file_cosmos_bank_v1beta1_query_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12276,7 +14377,7 @@ func (*QuerySendEnabledResponse) ProtoMessage() {} // Deprecated: Use QuerySendEnabledResponse.ProtoReflect.Descriptor instead. func (*QuerySendEnabledResponse) Descriptor() ([]byte, []int) { - return file_cosmos_bank_v1beta1_query_proto_rawDescGZIP(), []int{22} + return file_cosmos_bank_v1beta1_query_proto_rawDescGZIP(), []int{26} } func (x *QuerySendEnabledResponse) GetSendEnabled() []*SendEnabled { @@ -12453,158 +14554,214 @@ var file_cosmos_bank_v1beta1_query_proto_rawDesc = []byte{ 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, - 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x77, - 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4f, 0x77, 0x6e, 0x65, - 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, - 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, - 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, - 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, - 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x80, 0x01, 0x0a, 0x0a, 0x44, 0x65, 0x6e, 0x6f, - 0x6d, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 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, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3e, 0x0a, 0x07, 0x62, 0x61, - 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, - 0x01, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x22, 0xa7, 0x01, 0x0a, 0x18, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0c, 0x64, 0x65, 0x6e, 0x6f, 0x6d, - 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x52, 0x0b, - 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, - 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, - 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x79, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x6e, - 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x16, 0x0a, 0x06, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x06, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x63, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, - 0xa8, 0x01, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0c, - 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x52, 0x0b, 0x73, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x64, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x63, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, - 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, - 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0xb2, 0x0e, 0x0a, 0x05, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x12, 0x9d, 0x01, 0x0a, 0x07, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, - 0x12, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, 0x6c, 0x61, - 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x32, 0x12, 0x30, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, - 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, - 0x73, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x2f, 0x62, 0x79, 0x5f, 0x64, - 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0xa0, 0x01, 0x0a, 0x0b, 0x41, 0x6c, 0x6c, 0x42, 0x61, 0x6c, 0x61, - 0x6e, 0x63, 0x65, 0x73, 0x12, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, - 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x41, 0x6c, 0x6c, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, - 0x6c, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x34, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, - 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, 0xbc, 0x01, 0x0a, 0x11, 0x53, 0x70, 0x65, 0x6e, - 0x64, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x32, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x61, 0x62, - 0x6c, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x33, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x70, 0x65, - 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3e, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x33, 0x12, 0x31, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, - 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x73, 0x70, 0x65, 0x6e, 0x64, 0x61, - 0x62, 0x6c, 0x65, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, 0xd7, 0x01, 0x0a, 0x17, 0x53, 0x70, 0x65, 0x6e, 0x64, - 0x61, 0x62, 0x6c, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x42, 0x79, 0x44, 0x65, 0x6e, - 0x6f, 0x6d, 0x12, 0x38, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x70, - 0x65, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x42, 0x79, - 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x63, + 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x3e, + 0x0a, 0x26, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x42, 0x79, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, + 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x22, 0x6f, + 0x0a, 0x27, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x42, 0x79, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x08, 0x6d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, + 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, + 0x77, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4f, 0x77, 0x6e, + 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, + 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, + 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, + 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x80, 0x01, 0x0a, 0x0a, 0x44, 0x65, 0x6e, + 0x6f, 0x6d, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 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, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3e, 0x0a, 0x07, 0x62, + 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, + 0x2a, 0x01, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x22, 0xa7, 0x01, 0x0a, 0x18, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0c, 0x64, 0x65, 0x6e, 0x6f, + 0x6d, 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x52, + 0x0b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x12, 0x47, 0x0a, 0x0a, + 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x7e, 0x0a, 0x1e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, + 0x6e, 0x6f, 0x6d, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x42, 0x79, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x46, 0x0a, + 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, + 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xae, 0x01, 0x0a, 0x1f, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, + 0x65, 0x6e, 0x6f, 0x6d, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x42, 0x79, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0c, 0x64, 0x65, 0x6e, + 0x6f, 0x6d, 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4f, 0x77, 0x6e, 0x65, 0x72, + 0x52, 0x0b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x12, 0x47, 0x0a, + 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, + 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, + 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x79, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, + 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x06, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, + 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x63, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x22, 0xa8, 0x01, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x6e, 0x64, 0x45, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, + 0x0a, 0x0c, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, + 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x45, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x0b, 0x73, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x63, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0xd0, 0x11, 0x0a, + 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x9d, 0x01, 0x0a, 0x07, 0x42, 0x61, 0x6c, 0x61, 0x6e, + 0x63, 0x65, 0x12, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, + 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x61, 0x62, 0x6c, - 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x42, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x47, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x3c, 0x12, 0x3a, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, - 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x73, 0x70, 0x65, 0x6e, 0x64, - 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x2f, 0x62, 0x79, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, - 0x12, 0x94, 0x01, 0x0a, 0x0b, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, - 0x12, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x6f, 0x74, 0x61, - 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, + 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x32, 0x12, 0x30, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, + 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x62, 0x61, 0x6c, 0x61, 0x6e, + 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x2f, 0x62, 0x79, + 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0xa0, 0x01, 0x0a, 0x0b, 0x41, 0x6c, 0x6c, 0x42, 0x61, + 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, + 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x41, 0x6c, 0x6c, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x34, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, + 0x12, 0x27, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, + 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, 0xbc, 0x01, 0x0a, 0x11, 0x53, 0x70, + 0x65, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, + 0x32, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x70, 0x65, 0x6e, 0x64, + 0x61, 0x62, 0x6c, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, + 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, + 0x70, 0x65, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3e, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x33, 0x12, 0x31, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, + 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x73, 0x70, 0x65, 0x6e, + 0x64, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x7b, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, 0xd7, 0x01, 0x0a, 0x17, 0x53, 0x70, 0x65, + 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x42, 0x79, 0x44, + 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x38, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, + 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x53, 0x70, 0x65, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, + 0x42, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, - 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x88, - 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x63, 0x6f, 0x73, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x61, + 0x62, 0x6c, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x42, 0x79, 0x44, 0x65, 0x6e, 0x6f, + 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x47, 0x88, 0xe7, 0xb0, 0x2a, 0x01, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3c, 0x12, 0x3a, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, + 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x73, 0x70, 0x65, + 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, + 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x2f, 0x62, 0x79, 0x5f, 0x64, 0x65, 0x6e, + 0x6f, 0x6d, 0x12, 0x94, 0x01, 0x0a, 0x0b, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x75, 0x70, 0x70, + 0x6c, 0x79, 0x12, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x6f, + 0x74, 0x61, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x2d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x6f, 0x74, 0x61, + 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x28, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x94, 0x01, 0x0a, 0x08, 0x53, 0x75, + 0x70, 0x70, 0x6c, 0x79, 0x4f, 0x66, 0x12, 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x4f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x75, 0x70, + 0x70, 0x6c, 0x79, 0x4f, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x88, + 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x94, 0x01, 0x0a, 0x08, 0x53, 0x75, 0x70, 0x70, - 0x6c, 0x79, 0x4f, 0x66, 0x12, 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, + 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x2f, 0x62, 0x79, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, + 0x12, 0x85, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x27, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x4f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x75, 0x70, 0x70, 0x6c, - 0x79, 0x4f, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x88, 0xe7, 0xb0, - 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x73, - 0x75, 0x70, 0x70, 0x6c, 0x79, 0x2f, 0x62, 0x79, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x85, - 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x88, 0xe7, - 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x63, 0x6f, 0x73, 0x6d, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, + 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0xa6, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x6e, + 0x6f, 0x6d, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, + 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x12, 0xae, 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, + 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, + 0x65, 0x6e, 0x6f, 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, + 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, + 0x65, 0x6e, 0x6f, 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3c, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x31, 0x12, 0x2f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x5f, 0x6d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x3d, 0x2a, + 0x2a, 0x7d, 0x12, 0xda, 0x01, 0x0a, 0x1a, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x42, 0x79, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x12, 0x3b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, + 0x6f, 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x79, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3c, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x79, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x41, 0x88, 0xe7, + 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x36, 0x12, 0x34, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0xab, 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x6e, 0x6f, 0x6d, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x39, 0x88, 0xe7, 0xb0, 0x2a, 0x01, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, - 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x64, 0x65, 0x6e, - 0x6f, 0x6d, 0x73, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x7b, 0x64, 0x65, - 0x6e, 0x6f, 0x6d, 0x7d, 0x12, 0xa6, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x88, 0xe7, 0xb0, 0x2a, - 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x64, 0x65, - 0x6e, 0x6f, 0x6d, 0x73, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0xa2, 0x01, - 0x0a, 0x0b, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x12, 0x2c, 0x2e, + 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, + 0x62, 0x79, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, + 0xa5, 0x01, 0x0a, 0x0b, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x12, + 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, + 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4f, 0x77, - 0x6e, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4f, 0x77, 0x6e, 0x65, - 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x88, 0xe7, 0xb0, 0x2a, - 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x12, 0x29, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x64, 0x65, - 0x6e, 0x6f, 0x6d, 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, - 0x6d, 0x7d, 0x12, 0x9a, 0x01, 0x0a, 0x0b, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, + 0x6e, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x39, 0x88, 0xe7, + 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, + 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x64, 0x65, + 0x6e, 0x6f, 0x6d, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0xb8, 0x01, 0x0a, 0x12, 0x44, 0x65, 0x6e, 0x6f, + 0x6d, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x42, 0x79, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x33, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4f, + 0x77, 0x6e, 0x65, 0x72, 0x73, 0x42, 0x79, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, + 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, + 0x65, 0x6e, 0x6f, 0x6d, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x42, 0x79, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x37, 0x88, 0xe7, 0xb0, 0x2a, 0x01, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2c, 0x12, 0x2a, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, + 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x64, 0x65, 0x6e, + 0x6f, 0x6d, 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x5f, 0x62, 0x79, 0x5f, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x12, 0x9a, 0x01, 0x0a, 0x0b, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, @@ -12641,90 +14798,102 @@ func file_cosmos_bank_v1beta1_query_proto_rawDescGZIP() []byte { return file_cosmos_bank_v1beta1_query_proto_rawDescData } -var file_cosmos_bank_v1beta1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 23) +var file_cosmos_bank_v1beta1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 27) var file_cosmos_bank_v1beta1_query_proto_goTypes = []interface{}{ - (*QueryBalanceRequest)(nil), // 0: cosmos.bank.v1beta1.QueryBalanceRequest - (*QueryBalanceResponse)(nil), // 1: cosmos.bank.v1beta1.QueryBalanceResponse - (*QueryAllBalancesRequest)(nil), // 2: cosmos.bank.v1beta1.QueryAllBalancesRequest - (*QueryAllBalancesResponse)(nil), // 3: cosmos.bank.v1beta1.QueryAllBalancesResponse - (*QuerySpendableBalancesRequest)(nil), // 4: cosmos.bank.v1beta1.QuerySpendableBalancesRequest - (*QuerySpendableBalancesResponse)(nil), // 5: cosmos.bank.v1beta1.QuerySpendableBalancesResponse - (*QuerySpendableBalanceByDenomRequest)(nil), // 6: cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest - (*QuerySpendableBalanceByDenomResponse)(nil), // 7: cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse - (*QueryTotalSupplyRequest)(nil), // 8: cosmos.bank.v1beta1.QueryTotalSupplyRequest - (*QueryTotalSupplyResponse)(nil), // 9: cosmos.bank.v1beta1.QueryTotalSupplyResponse - (*QuerySupplyOfRequest)(nil), // 10: cosmos.bank.v1beta1.QuerySupplyOfRequest - (*QuerySupplyOfResponse)(nil), // 11: cosmos.bank.v1beta1.QuerySupplyOfResponse - (*QueryParamsRequest)(nil), // 12: cosmos.bank.v1beta1.QueryParamsRequest - (*QueryParamsResponse)(nil), // 13: cosmos.bank.v1beta1.QueryParamsResponse - (*QueryDenomsMetadataRequest)(nil), // 14: cosmos.bank.v1beta1.QueryDenomsMetadataRequest - (*QueryDenomsMetadataResponse)(nil), // 15: cosmos.bank.v1beta1.QueryDenomsMetadataResponse - (*QueryDenomMetadataRequest)(nil), // 16: cosmos.bank.v1beta1.QueryDenomMetadataRequest - (*QueryDenomMetadataResponse)(nil), // 17: cosmos.bank.v1beta1.QueryDenomMetadataResponse - (*QueryDenomOwnersRequest)(nil), // 18: cosmos.bank.v1beta1.QueryDenomOwnersRequest - (*DenomOwner)(nil), // 19: cosmos.bank.v1beta1.DenomOwner - (*QueryDenomOwnersResponse)(nil), // 20: cosmos.bank.v1beta1.QueryDenomOwnersResponse - (*QuerySendEnabledRequest)(nil), // 21: cosmos.bank.v1beta1.QuerySendEnabledRequest - (*QuerySendEnabledResponse)(nil), // 22: cosmos.bank.v1beta1.QuerySendEnabledResponse - (*v1beta1.Coin)(nil), // 23: cosmos.base.v1beta1.Coin - (*v1beta11.PageRequest)(nil), // 24: cosmos.base.query.v1beta1.PageRequest - (*v1beta11.PageResponse)(nil), // 25: cosmos.base.query.v1beta1.PageResponse - (*Params)(nil), // 26: cosmos.bank.v1beta1.Params - (*Metadata)(nil), // 27: cosmos.bank.v1beta1.Metadata - (*SendEnabled)(nil), // 28: cosmos.bank.v1beta1.SendEnabled + (*QueryBalanceRequest)(nil), // 0: cosmos.bank.v1beta1.QueryBalanceRequest + (*QueryBalanceResponse)(nil), // 1: cosmos.bank.v1beta1.QueryBalanceResponse + (*QueryAllBalancesRequest)(nil), // 2: cosmos.bank.v1beta1.QueryAllBalancesRequest + (*QueryAllBalancesResponse)(nil), // 3: cosmos.bank.v1beta1.QueryAllBalancesResponse + (*QuerySpendableBalancesRequest)(nil), // 4: cosmos.bank.v1beta1.QuerySpendableBalancesRequest + (*QuerySpendableBalancesResponse)(nil), // 5: cosmos.bank.v1beta1.QuerySpendableBalancesResponse + (*QuerySpendableBalanceByDenomRequest)(nil), // 6: cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest + (*QuerySpendableBalanceByDenomResponse)(nil), // 7: cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse + (*QueryTotalSupplyRequest)(nil), // 8: cosmos.bank.v1beta1.QueryTotalSupplyRequest + (*QueryTotalSupplyResponse)(nil), // 9: cosmos.bank.v1beta1.QueryTotalSupplyResponse + (*QuerySupplyOfRequest)(nil), // 10: cosmos.bank.v1beta1.QuerySupplyOfRequest + (*QuerySupplyOfResponse)(nil), // 11: cosmos.bank.v1beta1.QuerySupplyOfResponse + (*QueryParamsRequest)(nil), // 12: cosmos.bank.v1beta1.QueryParamsRequest + (*QueryParamsResponse)(nil), // 13: cosmos.bank.v1beta1.QueryParamsResponse + (*QueryDenomsMetadataRequest)(nil), // 14: cosmos.bank.v1beta1.QueryDenomsMetadataRequest + (*QueryDenomsMetadataResponse)(nil), // 15: cosmos.bank.v1beta1.QueryDenomsMetadataResponse + (*QueryDenomMetadataRequest)(nil), // 16: cosmos.bank.v1beta1.QueryDenomMetadataRequest + (*QueryDenomMetadataResponse)(nil), // 17: cosmos.bank.v1beta1.QueryDenomMetadataResponse + (*QueryDenomMetadataByQueryStringRequest)(nil), // 18: cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest + (*QueryDenomMetadataByQueryStringResponse)(nil), // 19: cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse + (*QueryDenomOwnersRequest)(nil), // 20: cosmos.bank.v1beta1.QueryDenomOwnersRequest + (*DenomOwner)(nil), // 21: cosmos.bank.v1beta1.DenomOwner + (*QueryDenomOwnersResponse)(nil), // 22: cosmos.bank.v1beta1.QueryDenomOwnersResponse + (*QueryDenomOwnersByQueryRequest)(nil), // 23: cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest + (*QueryDenomOwnersByQueryResponse)(nil), // 24: cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse + (*QuerySendEnabledRequest)(nil), // 25: cosmos.bank.v1beta1.QuerySendEnabledRequest + (*QuerySendEnabledResponse)(nil), // 26: cosmos.bank.v1beta1.QuerySendEnabledResponse + (*v1beta1.Coin)(nil), // 27: cosmos.base.v1beta1.Coin + (*v1beta11.PageRequest)(nil), // 28: cosmos.base.query.v1beta1.PageRequest + (*v1beta11.PageResponse)(nil), // 29: cosmos.base.query.v1beta1.PageResponse + (*Params)(nil), // 30: cosmos.bank.v1beta1.Params + (*Metadata)(nil), // 31: cosmos.bank.v1beta1.Metadata + (*SendEnabled)(nil), // 32: cosmos.bank.v1beta1.SendEnabled } var file_cosmos_bank_v1beta1_query_proto_depIdxs = []int32{ - 23, // 0: cosmos.bank.v1beta1.QueryBalanceResponse.balance:type_name -> cosmos.base.v1beta1.Coin - 24, // 1: cosmos.bank.v1beta1.QueryAllBalancesRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 23, // 2: cosmos.bank.v1beta1.QueryAllBalancesResponse.balances:type_name -> cosmos.base.v1beta1.Coin - 25, // 3: cosmos.bank.v1beta1.QueryAllBalancesResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 24, // 4: cosmos.bank.v1beta1.QuerySpendableBalancesRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 23, // 5: cosmos.bank.v1beta1.QuerySpendableBalancesResponse.balances:type_name -> cosmos.base.v1beta1.Coin - 25, // 6: cosmos.bank.v1beta1.QuerySpendableBalancesResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 23, // 7: cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse.balance:type_name -> cosmos.base.v1beta1.Coin - 24, // 8: cosmos.bank.v1beta1.QueryTotalSupplyRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 23, // 9: cosmos.bank.v1beta1.QueryTotalSupplyResponse.supply:type_name -> cosmos.base.v1beta1.Coin - 25, // 10: cosmos.bank.v1beta1.QueryTotalSupplyResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 23, // 11: cosmos.bank.v1beta1.QuerySupplyOfResponse.amount:type_name -> cosmos.base.v1beta1.Coin - 26, // 12: cosmos.bank.v1beta1.QueryParamsResponse.params:type_name -> cosmos.bank.v1beta1.Params - 24, // 13: cosmos.bank.v1beta1.QueryDenomsMetadataRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 27, // 14: cosmos.bank.v1beta1.QueryDenomsMetadataResponse.metadatas:type_name -> cosmos.bank.v1beta1.Metadata - 25, // 15: cosmos.bank.v1beta1.QueryDenomsMetadataResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 27, // 16: cosmos.bank.v1beta1.QueryDenomMetadataResponse.metadata:type_name -> cosmos.bank.v1beta1.Metadata - 24, // 17: cosmos.bank.v1beta1.QueryDenomOwnersRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 23, // 18: cosmos.bank.v1beta1.DenomOwner.balance:type_name -> cosmos.base.v1beta1.Coin - 19, // 19: cosmos.bank.v1beta1.QueryDenomOwnersResponse.denom_owners:type_name -> cosmos.bank.v1beta1.DenomOwner - 25, // 20: cosmos.bank.v1beta1.QueryDenomOwnersResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 24, // 21: cosmos.bank.v1beta1.QuerySendEnabledRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 28, // 22: cosmos.bank.v1beta1.QuerySendEnabledResponse.send_enabled:type_name -> cosmos.bank.v1beta1.SendEnabled - 25, // 23: cosmos.bank.v1beta1.QuerySendEnabledResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 0, // 24: cosmos.bank.v1beta1.Query.Balance:input_type -> cosmos.bank.v1beta1.QueryBalanceRequest - 2, // 25: cosmos.bank.v1beta1.Query.AllBalances:input_type -> cosmos.bank.v1beta1.QueryAllBalancesRequest - 4, // 26: cosmos.bank.v1beta1.Query.SpendableBalances:input_type -> cosmos.bank.v1beta1.QuerySpendableBalancesRequest - 6, // 27: cosmos.bank.v1beta1.Query.SpendableBalanceByDenom:input_type -> cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest - 8, // 28: cosmos.bank.v1beta1.Query.TotalSupply:input_type -> cosmos.bank.v1beta1.QueryTotalSupplyRequest - 10, // 29: cosmos.bank.v1beta1.Query.SupplyOf:input_type -> cosmos.bank.v1beta1.QuerySupplyOfRequest - 12, // 30: cosmos.bank.v1beta1.Query.Params:input_type -> cosmos.bank.v1beta1.QueryParamsRequest - 16, // 31: cosmos.bank.v1beta1.Query.DenomMetadata:input_type -> cosmos.bank.v1beta1.QueryDenomMetadataRequest - 14, // 32: cosmos.bank.v1beta1.Query.DenomsMetadata:input_type -> cosmos.bank.v1beta1.QueryDenomsMetadataRequest - 18, // 33: cosmos.bank.v1beta1.Query.DenomOwners:input_type -> cosmos.bank.v1beta1.QueryDenomOwnersRequest - 21, // 34: cosmos.bank.v1beta1.Query.SendEnabled:input_type -> cosmos.bank.v1beta1.QuerySendEnabledRequest - 1, // 35: cosmos.bank.v1beta1.Query.Balance:output_type -> cosmos.bank.v1beta1.QueryBalanceResponse - 3, // 36: cosmos.bank.v1beta1.Query.AllBalances:output_type -> cosmos.bank.v1beta1.QueryAllBalancesResponse - 5, // 37: cosmos.bank.v1beta1.Query.SpendableBalances:output_type -> cosmos.bank.v1beta1.QuerySpendableBalancesResponse - 7, // 38: cosmos.bank.v1beta1.Query.SpendableBalanceByDenom:output_type -> cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse - 9, // 39: cosmos.bank.v1beta1.Query.TotalSupply:output_type -> cosmos.bank.v1beta1.QueryTotalSupplyResponse - 11, // 40: cosmos.bank.v1beta1.Query.SupplyOf:output_type -> cosmos.bank.v1beta1.QuerySupplyOfResponse - 13, // 41: cosmos.bank.v1beta1.Query.Params:output_type -> cosmos.bank.v1beta1.QueryParamsResponse - 17, // 42: cosmos.bank.v1beta1.Query.DenomMetadata:output_type -> cosmos.bank.v1beta1.QueryDenomMetadataResponse - 15, // 43: cosmos.bank.v1beta1.Query.DenomsMetadata:output_type -> cosmos.bank.v1beta1.QueryDenomsMetadataResponse - 20, // 44: cosmos.bank.v1beta1.Query.DenomOwners:output_type -> cosmos.bank.v1beta1.QueryDenomOwnersResponse - 22, // 45: cosmos.bank.v1beta1.Query.SendEnabled:output_type -> cosmos.bank.v1beta1.QuerySendEnabledResponse - 35, // [35:46] is the sub-list for method output_type - 24, // [24:35] is the sub-list for method input_type - 24, // [24:24] is the sub-list for extension type_name - 24, // [24:24] is the sub-list for extension extendee - 0, // [0:24] is the sub-list for field type_name + 27, // 0: cosmos.bank.v1beta1.QueryBalanceResponse.balance:type_name -> cosmos.base.v1beta1.Coin + 28, // 1: cosmos.bank.v1beta1.QueryAllBalancesRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 27, // 2: cosmos.bank.v1beta1.QueryAllBalancesResponse.balances:type_name -> cosmos.base.v1beta1.Coin + 29, // 3: cosmos.bank.v1beta1.QueryAllBalancesResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 28, // 4: cosmos.bank.v1beta1.QuerySpendableBalancesRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 27, // 5: cosmos.bank.v1beta1.QuerySpendableBalancesResponse.balances:type_name -> cosmos.base.v1beta1.Coin + 29, // 6: cosmos.bank.v1beta1.QuerySpendableBalancesResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 27, // 7: cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse.balance:type_name -> cosmos.base.v1beta1.Coin + 28, // 8: cosmos.bank.v1beta1.QueryTotalSupplyRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 27, // 9: cosmos.bank.v1beta1.QueryTotalSupplyResponse.supply:type_name -> cosmos.base.v1beta1.Coin + 29, // 10: cosmos.bank.v1beta1.QueryTotalSupplyResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 27, // 11: cosmos.bank.v1beta1.QuerySupplyOfResponse.amount:type_name -> cosmos.base.v1beta1.Coin + 30, // 12: cosmos.bank.v1beta1.QueryParamsResponse.params:type_name -> cosmos.bank.v1beta1.Params + 28, // 13: cosmos.bank.v1beta1.QueryDenomsMetadataRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 31, // 14: cosmos.bank.v1beta1.QueryDenomsMetadataResponse.metadatas:type_name -> cosmos.bank.v1beta1.Metadata + 29, // 15: cosmos.bank.v1beta1.QueryDenomsMetadataResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 31, // 16: cosmos.bank.v1beta1.QueryDenomMetadataResponse.metadata:type_name -> cosmos.bank.v1beta1.Metadata + 31, // 17: cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse.metadata:type_name -> cosmos.bank.v1beta1.Metadata + 28, // 18: cosmos.bank.v1beta1.QueryDenomOwnersRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 27, // 19: cosmos.bank.v1beta1.DenomOwner.balance:type_name -> cosmos.base.v1beta1.Coin + 21, // 20: cosmos.bank.v1beta1.QueryDenomOwnersResponse.denom_owners:type_name -> cosmos.bank.v1beta1.DenomOwner + 29, // 21: cosmos.bank.v1beta1.QueryDenomOwnersResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 28, // 22: cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 21, // 23: cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse.denom_owners:type_name -> cosmos.bank.v1beta1.DenomOwner + 29, // 24: cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 28, // 25: cosmos.bank.v1beta1.QuerySendEnabledRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 32, // 26: cosmos.bank.v1beta1.QuerySendEnabledResponse.send_enabled:type_name -> cosmos.bank.v1beta1.SendEnabled + 29, // 27: cosmos.bank.v1beta1.QuerySendEnabledResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 0, // 28: cosmos.bank.v1beta1.Query.Balance:input_type -> cosmos.bank.v1beta1.QueryBalanceRequest + 2, // 29: cosmos.bank.v1beta1.Query.AllBalances:input_type -> cosmos.bank.v1beta1.QueryAllBalancesRequest + 4, // 30: cosmos.bank.v1beta1.Query.SpendableBalances:input_type -> cosmos.bank.v1beta1.QuerySpendableBalancesRequest + 6, // 31: cosmos.bank.v1beta1.Query.SpendableBalanceByDenom:input_type -> cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest + 8, // 32: cosmos.bank.v1beta1.Query.TotalSupply:input_type -> cosmos.bank.v1beta1.QueryTotalSupplyRequest + 10, // 33: cosmos.bank.v1beta1.Query.SupplyOf:input_type -> cosmos.bank.v1beta1.QuerySupplyOfRequest + 12, // 34: cosmos.bank.v1beta1.Query.Params:input_type -> cosmos.bank.v1beta1.QueryParamsRequest + 14, // 35: cosmos.bank.v1beta1.Query.DenomsMetadata:input_type -> cosmos.bank.v1beta1.QueryDenomsMetadataRequest + 16, // 36: cosmos.bank.v1beta1.Query.DenomMetadata:input_type -> cosmos.bank.v1beta1.QueryDenomMetadataRequest + 18, // 37: cosmos.bank.v1beta1.Query.DenomMetadataByQueryString:input_type -> cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest + 20, // 38: cosmos.bank.v1beta1.Query.DenomOwners:input_type -> cosmos.bank.v1beta1.QueryDenomOwnersRequest + 23, // 39: cosmos.bank.v1beta1.Query.DenomOwnersByQuery:input_type -> cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest + 25, // 40: cosmos.bank.v1beta1.Query.SendEnabled:input_type -> cosmos.bank.v1beta1.QuerySendEnabledRequest + 1, // 41: cosmos.bank.v1beta1.Query.Balance:output_type -> cosmos.bank.v1beta1.QueryBalanceResponse + 3, // 42: cosmos.bank.v1beta1.Query.AllBalances:output_type -> cosmos.bank.v1beta1.QueryAllBalancesResponse + 5, // 43: cosmos.bank.v1beta1.Query.SpendableBalances:output_type -> cosmos.bank.v1beta1.QuerySpendableBalancesResponse + 7, // 44: cosmos.bank.v1beta1.Query.SpendableBalanceByDenom:output_type -> cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse + 9, // 45: cosmos.bank.v1beta1.Query.TotalSupply:output_type -> cosmos.bank.v1beta1.QueryTotalSupplyResponse + 11, // 46: cosmos.bank.v1beta1.Query.SupplyOf:output_type -> cosmos.bank.v1beta1.QuerySupplyOfResponse + 13, // 47: cosmos.bank.v1beta1.Query.Params:output_type -> cosmos.bank.v1beta1.QueryParamsResponse + 15, // 48: cosmos.bank.v1beta1.Query.DenomsMetadata:output_type -> cosmos.bank.v1beta1.QueryDenomsMetadataResponse + 17, // 49: cosmos.bank.v1beta1.Query.DenomMetadata:output_type -> cosmos.bank.v1beta1.QueryDenomMetadataResponse + 19, // 50: cosmos.bank.v1beta1.Query.DenomMetadataByQueryString:output_type -> cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse + 22, // 51: cosmos.bank.v1beta1.Query.DenomOwners:output_type -> cosmos.bank.v1beta1.QueryDenomOwnersResponse + 24, // 52: cosmos.bank.v1beta1.Query.DenomOwnersByQuery:output_type -> cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse + 26, // 53: cosmos.bank.v1beta1.Query.SendEnabled:output_type -> cosmos.bank.v1beta1.QuerySendEnabledResponse + 41, // [41:54] is the sub-list for method output_type + 28, // [28:41] is the sub-list for method input_type + 28, // [28:28] is the sub-list for extension type_name + 28, // [28:28] is the sub-list for extension extendee + 0, // [0:28] is the sub-list for field type_name } func init() { file_cosmos_bank_v1beta1_query_proto_init() } @@ -12951,7 +15120,7 @@ func file_cosmos_bank_v1beta1_query_proto_init() { } } file_cosmos_bank_v1beta1_query_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryDenomOwnersRequest); i { + switch v := v.(*QueryDenomMetadataByQueryStringRequest); i { case 0: return &v.state case 1: @@ -12963,7 +15132,7 @@ func file_cosmos_bank_v1beta1_query_proto_init() { } } file_cosmos_bank_v1beta1_query_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DenomOwner); i { + switch v := v.(*QueryDenomMetadataByQueryStringResponse); i { case 0: return &v.state case 1: @@ -12975,7 +15144,7 @@ func file_cosmos_bank_v1beta1_query_proto_init() { } } file_cosmos_bank_v1beta1_query_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryDenomOwnersResponse); i { + switch v := v.(*QueryDenomOwnersRequest); i { case 0: return &v.state case 1: @@ -12987,7 +15156,7 @@ func file_cosmos_bank_v1beta1_query_proto_init() { } } file_cosmos_bank_v1beta1_query_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QuerySendEnabledRequest); i { + switch v := v.(*DenomOwner); i { case 0: return &v.state case 1: @@ -12999,6 +15168,54 @@ func file_cosmos_bank_v1beta1_query_proto_init() { } } file_cosmos_bank_v1beta1_query_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryDenomOwnersResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_bank_v1beta1_query_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryDenomOwnersByQueryRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_bank_v1beta1_query_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryDenomOwnersByQueryResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_bank_v1beta1_query_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QuerySendEnabledRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_bank_v1beta1_query_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QuerySendEnabledResponse); i { case 0: return &v.state @@ -13017,7 +15234,7 @@ func file_cosmos_bank_v1beta1_query_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_bank_v1beta1_query_proto_rawDesc, NumEnums: 0, - NumMessages: 23, + NumMessages: 27, NumExtensions: 0, NumServices: 1, }, diff --git a/api/cosmos/bank/v1beta1/query_grpc.pb.go b/api/cosmos/bank/v1beta1/query_grpc.pb.go index b2ed57bcf205..ff179718f9f4 100644 --- a/api/cosmos/bank/v1beta1/query_grpc.pb.go +++ b/api/cosmos/bank/v1beta1/query_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/bank/v1beta1/query.proto @@ -15,26 +15,30 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( - Query_Balance_FullMethodName = "/cosmos.bank.v1beta1.Query/Balance" - Query_AllBalances_FullMethodName = "/cosmos.bank.v1beta1.Query/AllBalances" - Query_SpendableBalances_FullMethodName = "/cosmos.bank.v1beta1.Query/SpendableBalances" - Query_SpendableBalanceByDenom_FullMethodName = "/cosmos.bank.v1beta1.Query/SpendableBalanceByDenom" - Query_TotalSupply_FullMethodName = "/cosmos.bank.v1beta1.Query/TotalSupply" - Query_SupplyOf_FullMethodName = "/cosmos.bank.v1beta1.Query/SupplyOf" - Query_Params_FullMethodName = "/cosmos.bank.v1beta1.Query/Params" - Query_DenomMetadata_FullMethodName = "/cosmos.bank.v1beta1.Query/DenomMetadata" - Query_DenomsMetadata_FullMethodName = "/cosmos.bank.v1beta1.Query/DenomsMetadata" - Query_DenomOwners_FullMethodName = "/cosmos.bank.v1beta1.Query/DenomOwners" - Query_SendEnabled_FullMethodName = "/cosmos.bank.v1beta1.Query/SendEnabled" + Query_Balance_FullMethodName = "/cosmos.bank.v1beta1.Query/Balance" + Query_AllBalances_FullMethodName = "/cosmos.bank.v1beta1.Query/AllBalances" + Query_SpendableBalances_FullMethodName = "/cosmos.bank.v1beta1.Query/SpendableBalances" + Query_SpendableBalanceByDenom_FullMethodName = "/cosmos.bank.v1beta1.Query/SpendableBalanceByDenom" + Query_TotalSupply_FullMethodName = "/cosmos.bank.v1beta1.Query/TotalSupply" + Query_SupplyOf_FullMethodName = "/cosmos.bank.v1beta1.Query/SupplyOf" + Query_Params_FullMethodName = "/cosmos.bank.v1beta1.Query/Params" + Query_DenomsMetadata_FullMethodName = "/cosmos.bank.v1beta1.Query/DenomsMetadata" + Query_DenomMetadata_FullMethodName = "/cosmos.bank.v1beta1.Query/DenomMetadata" + Query_DenomMetadataByQueryString_FullMethodName = "/cosmos.bank.v1beta1.Query/DenomMetadataByQueryString" + Query_DenomOwners_FullMethodName = "/cosmos.bank.v1beta1.Query/DenomOwners" + Query_DenomOwnersByQuery_FullMethodName = "/cosmos.bank.v1beta1.Query/DenomOwnersByQuery" + Query_SendEnabled_FullMethodName = "/cosmos.bank.v1beta1.Query/SendEnabled" ) // QueryClient is the client API for Query service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Query defines the gRPC querier service. type QueryClient interface { // Balance queries the balance of a single coin for a single account. Balance(ctx context.Context, in *QueryBalanceRequest, opts ...grpc.CallOption) (*QueryBalanceResponse, error) @@ -71,11 +75,13 @@ type QueryClient interface { SupplyOf(ctx context.Context, in *QuerySupplyOfRequest, opts ...grpc.CallOption) (*QuerySupplyOfResponse, error) // Params queries the parameters of x/bank module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // DenomsMetadata queries the client metadata of a given coin denomination. - DenomMetadata(ctx context.Context, in *QueryDenomMetadataRequest, opts ...grpc.CallOption) (*QueryDenomMetadataResponse, error) // DenomsMetadata queries the client metadata for all registered coin // denominations. DenomsMetadata(ctx context.Context, in *QueryDenomsMetadataRequest, opts ...grpc.CallOption) (*QueryDenomsMetadataResponse, error) + // DenomMetadata queries the client metadata of a given coin denomination. + DenomMetadata(ctx context.Context, in *QueryDenomMetadataRequest, opts ...grpc.CallOption) (*QueryDenomMetadataResponse, error) + // DenomMetadataByQueryString queries the client metadata of a given coin denomination. + DenomMetadataByQueryString(ctx context.Context, in *QueryDenomMetadataByQueryStringRequest, opts ...grpc.CallOption) (*QueryDenomMetadataByQueryStringResponse, error) // DenomOwners queries for all account addresses that own a particular token // denomination. // @@ -84,6 +90,11 @@ type QueryClient interface { // // Since: cosmos-sdk 0.46 DenomOwners(ctx context.Context, in *QueryDenomOwnersRequest, opts ...grpc.CallOption) (*QueryDenomOwnersResponse, error) + // DenomOwnersByQuery queries for all account addresses that own a particular token + // denomination. + // + // Since: cosmos-sdk 0.50.3 + DenomOwnersByQuery(ctx context.Context, in *QueryDenomOwnersByQueryRequest, opts ...grpc.CallOption) (*QueryDenomOwnersByQueryResponse, error) // SendEnabled queries for SendEnabled entries. // // This query only returns denominations that have specific SendEnabled settings. @@ -103,8 +114,9 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { } func (c *queryClient) Balance(ctx context.Context, in *QueryBalanceRequest, opts ...grpc.CallOption) (*QueryBalanceResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryBalanceResponse) - err := c.cc.Invoke(ctx, Query_Balance_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Balance_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -112,8 +124,9 @@ func (c *queryClient) Balance(ctx context.Context, in *QueryBalanceRequest, opts } func (c *queryClient) AllBalances(ctx context.Context, in *QueryAllBalancesRequest, opts ...grpc.CallOption) (*QueryAllBalancesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryAllBalancesResponse) - err := c.cc.Invoke(ctx, Query_AllBalances_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_AllBalances_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -121,8 +134,9 @@ func (c *queryClient) AllBalances(ctx context.Context, in *QueryAllBalancesReque } func (c *queryClient) SpendableBalances(ctx context.Context, in *QuerySpendableBalancesRequest, opts ...grpc.CallOption) (*QuerySpendableBalancesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QuerySpendableBalancesResponse) - err := c.cc.Invoke(ctx, Query_SpendableBalances_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_SpendableBalances_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -130,8 +144,9 @@ func (c *queryClient) SpendableBalances(ctx context.Context, in *QuerySpendableB } func (c *queryClient) SpendableBalanceByDenom(ctx context.Context, in *QuerySpendableBalanceByDenomRequest, opts ...grpc.CallOption) (*QuerySpendableBalanceByDenomResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QuerySpendableBalanceByDenomResponse) - err := c.cc.Invoke(ctx, Query_SpendableBalanceByDenom_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_SpendableBalanceByDenom_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -139,8 +154,9 @@ func (c *queryClient) SpendableBalanceByDenom(ctx context.Context, in *QuerySpen } func (c *queryClient) TotalSupply(ctx context.Context, in *QueryTotalSupplyRequest, opts ...grpc.CallOption) (*QueryTotalSupplyResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryTotalSupplyResponse) - err := c.cc.Invoke(ctx, Query_TotalSupply_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_TotalSupply_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -148,8 +164,9 @@ func (c *queryClient) TotalSupply(ctx context.Context, in *QueryTotalSupplyReque } func (c *queryClient) SupplyOf(ctx context.Context, in *QuerySupplyOfRequest, opts ...grpc.CallOption) (*QuerySupplyOfResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QuerySupplyOfResponse) - err := c.cc.Invoke(ctx, Query_SupplyOf_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_SupplyOf_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -157,8 +174,19 @@ func (c *queryClient) SupplyOf(ctx context.Context, in *QuerySupplyOfRequest, op } func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) DenomsMetadata(ctx context.Context, in *QueryDenomsMetadataRequest, opts ...grpc.CallOption) (*QueryDenomsMetadataResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryDenomsMetadataResponse) + err := c.cc.Invoke(ctx, Query_DenomsMetadata_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -166,17 +194,19 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . } func (c *queryClient) DenomMetadata(ctx context.Context, in *QueryDenomMetadataRequest, opts ...grpc.CallOption) (*QueryDenomMetadataResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryDenomMetadataResponse) - err := c.cc.Invoke(ctx, Query_DenomMetadata_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_DenomMetadata_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *queryClient) DenomsMetadata(ctx context.Context, in *QueryDenomsMetadataRequest, opts ...grpc.CallOption) (*QueryDenomsMetadataResponse, error) { - out := new(QueryDenomsMetadataResponse) - err := c.cc.Invoke(ctx, Query_DenomsMetadata_FullMethodName, in, out, opts...) +func (c *queryClient) DenomMetadataByQueryString(ctx context.Context, in *QueryDenomMetadataByQueryStringRequest, opts ...grpc.CallOption) (*QueryDenomMetadataByQueryStringResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryDenomMetadataByQueryStringResponse) + err := c.cc.Invoke(ctx, Query_DenomMetadataByQueryString_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -184,8 +214,19 @@ func (c *queryClient) DenomsMetadata(ctx context.Context, in *QueryDenomsMetadat } func (c *queryClient) DenomOwners(ctx context.Context, in *QueryDenomOwnersRequest, opts ...grpc.CallOption) (*QueryDenomOwnersResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryDenomOwnersResponse) - err := c.cc.Invoke(ctx, Query_DenomOwners_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_DenomOwners_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) DenomOwnersByQuery(ctx context.Context, in *QueryDenomOwnersByQueryRequest, opts ...grpc.CallOption) (*QueryDenomOwnersByQueryResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryDenomOwnersByQueryResponse) + err := c.cc.Invoke(ctx, Query_DenomOwnersByQuery_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -193,8 +234,9 @@ func (c *queryClient) DenomOwners(ctx context.Context, in *QueryDenomOwnersReque } func (c *queryClient) SendEnabled(ctx context.Context, in *QuerySendEnabledRequest, opts ...grpc.CallOption) (*QuerySendEnabledResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QuerySendEnabledResponse) - err := c.cc.Invoke(ctx, Query_SendEnabled_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_SendEnabled_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -203,7 +245,9 @@ func (c *queryClient) SendEnabled(ctx context.Context, in *QuerySendEnabledReque // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer -// for forward compatibility +// for forward compatibility. +// +// Query defines the gRPC querier service. type QueryServer interface { // Balance queries the balance of a single coin for a single account. Balance(context.Context, *QueryBalanceRequest) (*QueryBalanceResponse, error) @@ -240,11 +284,13 @@ type QueryServer interface { SupplyOf(context.Context, *QuerySupplyOfRequest) (*QuerySupplyOfResponse, error) // Params queries the parameters of x/bank module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // DenomsMetadata queries the client metadata of a given coin denomination. - DenomMetadata(context.Context, *QueryDenomMetadataRequest) (*QueryDenomMetadataResponse, error) // DenomsMetadata queries the client metadata for all registered coin // denominations. DenomsMetadata(context.Context, *QueryDenomsMetadataRequest) (*QueryDenomsMetadataResponse, error) + // DenomMetadata queries the client metadata of a given coin denomination. + DenomMetadata(context.Context, *QueryDenomMetadataRequest) (*QueryDenomMetadataResponse, error) + // DenomMetadataByQueryString queries the client metadata of a given coin denomination. + DenomMetadataByQueryString(context.Context, *QueryDenomMetadataByQueryStringRequest) (*QueryDenomMetadataByQueryStringResponse, error) // DenomOwners queries for all account addresses that own a particular token // denomination. // @@ -253,6 +299,11 @@ type QueryServer interface { // // Since: cosmos-sdk 0.46 DenomOwners(context.Context, *QueryDenomOwnersRequest) (*QueryDenomOwnersResponse, error) + // DenomOwnersByQuery queries for all account addresses that own a particular token + // denomination. + // + // Since: cosmos-sdk 0.50.3 + DenomOwnersByQuery(context.Context, *QueryDenomOwnersByQueryRequest) (*QueryDenomOwnersByQueryResponse, error) // SendEnabled queries for SendEnabled entries. // // This query only returns denominations that have specific SendEnabled settings. @@ -264,9 +315,12 @@ type QueryServer interface { mustEmbedUnimplementedQueryServer() } -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} +// UnimplementedQueryServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedQueryServer struct{} func (UnimplementedQueryServer) Balance(context.Context, *QueryBalanceRequest) (*QueryBalanceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Balance not implemented") @@ -289,19 +343,26 @@ func (UnimplementedQueryServer) SupplyOf(context.Context, *QuerySupplyOfRequest) func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } +func (UnimplementedQueryServer) DenomsMetadata(context.Context, *QueryDenomsMetadataRequest) (*QueryDenomsMetadataResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DenomsMetadata not implemented") +} func (UnimplementedQueryServer) DenomMetadata(context.Context, *QueryDenomMetadataRequest) (*QueryDenomMetadataResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DenomMetadata not implemented") } -func (UnimplementedQueryServer) DenomsMetadata(context.Context, *QueryDenomsMetadataRequest) (*QueryDenomsMetadataResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DenomsMetadata not implemented") +func (UnimplementedQueryServer) DenomMetadataByQueryString(context.Context, *QueryDenomMetadataByQueryStringRequest) (*QueryDenomMetadataByQueryStringResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DenomMetadataByQueryString not implemented") } func (UnimplementedQueryServer) DenomOwners(context.Context, *QueryDenomOwnersRequest) (*QueryDenomOwnersResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DenomOwners not implemented") } +func (UnimplementedQueryServer) DenomOwnersByQuery(context.Context, *QueryDenomOwnersByQueryRequest) (*QueryDenomOwnersByQueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DenomOwnersByQuery not implemented") +} func (UnimplementedQueryServer) SendEnabled(context.Context, *QuerySendEnabledRequest) (*QuerySendEnabledResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SendEnabled not implemented") } func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} +func (UnimplementedQueryServer) testEmbeddedByValue() {} // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to QueryServer will @@ -311,6 +372,13 @@ type UnsafeQueryServer interface { } func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + // If the following call pancis, it indicates UnimplementedQueryServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Query_ServiceDesc, srv) } @@ -440,6 +508,24 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } +func _Query_DenomsMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDenomsMetadataRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).DenomsMetadata(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_DenomsMetadata_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).DenomsMetadata(ctx, req.(*QueryDenomsMetadataRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_DenomMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryDenomMetadataRequest) if err := dec(in); err != nil { @@ -458,20 +544,20 @@ func _Query_DenomMetadata_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } -func _Query_DenomsMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDenomsMetadataRequest) +func _Query_DenomMetadataByQueryString_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDenomMetadataByQueryStringRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).DenomsMetadata(ctx, in) + return srv.(QueryServer).DenomMetadataByQueryString(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Query_DenomsMetadata_FullMethodName, + FullMethod: Query_DenomMetadataByQueryString_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).DenomsMetadata(ctx, req.(*QueryDenomsMetadataRequest)) + return srv.(QueryServer).DenomMetadataByQueryString(ctx, req.(*QueryDenomMetadataByQueryStringRequest)) } return interceptor(ctx, in, info, handler) } @@ -494,6 +580,24 @@ func _Query_DenomOwners_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } +func _Query_DenomOwnersByQuery_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDenomOwnersByQueryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).DenomOwnersByQuery(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_DenomOwnersByQuery_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).DenomOwnersByQuery(ctx, req.(*QueryDenomOwnersByQueryRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_SendEnabled_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QuerySendEnabledRequest) if err := dec(in); err != nil { @@ -547,18 +651,26 @@ var Query_ServiceDesc = grpc.ServiceDesc{ MethodName: "Params", Handler: _Query_Params_Handler, }, + { + MethodName: "DenomsMetadata", + Handler: _Query_DenomsMetadata_Handler, + }, { MethodName: "DenomMetadata", Handler: _Query_DenomMetadata_Handler, }, { - MethodName: "DenomsMetadata", - Handler: _Query_DenomsMetadata_Handler, + MethodName: "DenomMetadataByQueryString", + Handler: _Query_DenomMetadataByQueryString_Handler, }, { MethodName: "DenomOwners", Handler: _Query_DenomOwners_Handler, }, + { + MethodName: "DenomOwnersByQuery", + Handler: _Query_DenomOwnersByQuery_Handler, + }, { MethodName: "SendEnabled", Handler: _Query_SendEnabled_Handler, diff --git a/api/cosmos/bank/v1beta1/tx.pulsar.go b/api/cosmos/bank/v1beta1/tx.pulsar.go index 952e29e2d0ea..64c6508750b6 100644 --- a/api/cosmos/bank/v1beta1/tx.pulsar.go +++ b/api/cosmos/bank/v1beta1/tx.pulsar.go @@ -4133,6 +4133,7 @@ type MsgSetSendEnabled struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // authority is the address that controls the module. Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` // send_enabled is the list of entries to add or update. SendEnabled []*SendEnabled `protobuf:"bytes,2,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled,omitempty"` diff --git a/api/cosmos/bank/v1beta1/tx_grpc.pb.go b/api/cosmos/bank/v1beta1/tx_grpc.pb.go index 7cdb833695c7..d2696f047754 100644 --- a/api/cosmos/bank/v1beta1/tx_grpc.pb.go +++ b/api/cosmos/bank/v1beta1/tx_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/bank/v1beta1/tx.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Msg_Send_FullMethodName = "/cosmos.bank.v1beta1.Msg/Send" @@ -28,6 +28,8 @@ const ( // MsgClient is the client API for Msg service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Msg defines the bank Msg service. type MsgClient interface { // Send defines a method for sending coins from one account to another account. Send(ctx context.Context, in *MsgSend, opts ...grpc.CallOption) (*MsgSendResponse, error) @@ -56,8 +58,9 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { } func (c *msgClient) Send(ctx context.Context, in *MsgSend, opts ...grpc.CallOption) (*MsgSendResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgSendResponse) - err := c.cc.Invoke(ctx, Msg_Send_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_Send_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -65,8 +68,9 @@ func (c *msgClient) Send(ctx context.Context, in *MsgSend, opts ...grpc.CallOpti } func (c *msgClient) MultiSend(ctx context.Context, in *MsgMultiSend, opts ...grpc.CallOption) (*MsgMultiSendResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgMultiSendResponse) - err := c.cc.Invoke(ctx, Msg_MultiSend_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_MultiSend_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -74,8 +78,9 @@ func (c *msgClient) MultiSend(ctx context.Context, in *MsgMultiSend, opts ...grp } func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -83,8 +88,9 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts } func (c *msgClient) SetSendEnabled(ctx context.Context, in *MsgSetSendEnabled, opts ...grpc.CallOption) (*MsgSetSendEnabledResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgSetSendEnabledResponse) - err := c.cc.Invoke(ctx, Msg_SetSendEnabled_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_SetSendEnabled_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -93,7 +99,9 @@ func (c *msgClient) SetSendEnabled(ctx context.Context, in *MsgSetSendEnabled, o // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer -// for forward compatibility +// for forward compatibility. +// +// Msg defines the bank Msg service. type MsgServer interface { // Send defines a method for sending coins from one account to another account. Send(context.Context, *MsgSend) (*MsgSendResponse, error) @@ -114,9 +122,12 @@ type MsgServer interface { mustEmbedUnimplementedMsgServer() } -// UnimplementedMsgServer must be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} +// UnimplementedMsgServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedMsgServer struct{} func (UnimplementedMsgServer) Send(context.Context, *MsgSend) (*MsgSendResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Send not implemented") @@ -131,6 +142,7 @@ func (UnimplementedMsgServer) SetSendEnabled(context.Context, *MsgSetSendEnabled return nil, status.Errorf(codes.Unimplemented, "method SetSendEnabled not implemented") } func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} +func (UnimplementedMsgServer) testEmbeddedByValue() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to MsgServer will @@ -140,6 +152,13 @@ type UnsafeMsgServer interface { } func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + // If the following call pancis, it indicates UnimplementedMsgServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Msg_ServiceDesc, srv) } diff --git a/api/cosmos/base/abci/v1beta1/abci.pulsar.go b/api/cosmos/base/abci/v1beta1/abci.pulsar.go index 9b5ea1a430a8..b9cf4e338e9a 100644 --- a/api/cosmos/base/abci/v1beta1/abci.pulsar.go +++ b/api/cosmos/base/abci/v1beta1/abci.pulsar.go @@ -8095,7 +8095,7 @@ var file_cosmos_base_abci_v1beta1_abci_proto_rawDesc = []byte{ 0x44, 0x61, 0x74, 0x61, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x73, 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, - 0x61, 0x74, 0x61, 0x3a, 0x06, 0x18, 0x01, 0x80, 0xdc, 0x20, 0x01, 0x22, 0x87, 0x01, 0x0a, 0x09, + 0x61, 0x74, 0x61, 0x3a, 0x06, 0x80, 0xdc, 0x20, 0x01, 0x18, 0x01, 0x22, 0x87, 0x01, 0x0a, 0x09, 0x54, 0x78, 0x4d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x12, 0x39, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, @@ -8132,21 +8132,21 @@ var file_cosmos_base_abci_v1beta1_abci_proto_rawDesc = []byte{ 0x6b, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x06, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x3a, 0x04, 0x80, 0xdc, 0x20, 0x01, 0x42, - 0xe7, 0x01, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, - 0x61, 0x73, 0x65, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x42, 0x09, 0x41, 0x62, 0x63, 0x69, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x61, 0x62, 0x63, 0x69, - 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x61, 0x62, 0x63, 0x69, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x41, 0xaa, 0x02, 0x18, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x2e, 0x41, 0x62, 0x63, 0x69, 0x2e, 0x56, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, - 0x61, 0x73, 0x65, 0x5c, 0x41, 0x62, 0x63, 0x69, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0xe2, 0x02, 0x24, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x73, 0x65, 0x5c, 0x41, - 0x62, 0x63, 0x69, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x3a, 0x3a, 0x42, 0x61, 0x73, 0x65, 0x3a, 0x3a, 0x41, 0x62, 0x63, 0x69, 0x3a, 0x3a, 0x56, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0xd8, 0xe1, 0x1e, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0xe7, 0x01, 0xd8, 0xe1, 0x1e, 0x00, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x42, 0x09, 0x41, 0x62, 0x63, 0x69, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x35, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, + 0x61, 0x62, 0x63, 0x69, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x61, 0x62, 0x63, + 0x69, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x41, 0xaa, 0x02, + 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x2e, 0x41, 0x62, 0x63, + 0x69, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x73, 0x65, 0x5c, 0x41, 0x62, 0x63, 0x69, 0x5c, 0x56, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x24, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, + 0x73, 0x65, 0x5c, 0x41, 0x62, 0x63, 0x69, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1b, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x42, 0x61, 0x73, 0x65, 0x3a, 0x3a, 0x41, 0x62, 0x63, 0x69, + 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } diff --git a/api/cosmos/base/node/v1beta1/query.pulsar.go b/api/cosmos/base/node/v1beta1/query.pulsar.go index ff8148beebbb..f79e565e180b 100644 --- a/api/cosmos/base/node/v1beta1/query.pulsar.go +++ b/api/cosmos/base/node/v1beta1/query.pulsar.go @@ -376,6 +376,7 @@ var ( fd_ConfigResponse_minimum_gas_price protoreflect.FieldDescriptor fd_ConfigResponse_pruning_keep_recent protoreflect.FieldDescriptor fd_ConfigResponse_pruning_interval protoreflect.FieldDescriptor + fd_ConfigResponse_halt_height protoreflect.FieldDescriptor ) func init() { @@ -384,6 +385,7 @@ func init() { fd_ConfigResponse_minimum_gas_price = md_ConfigResponse.Fields().ByName("minimum_gas_price") fd_ConfigResponse_pruning_keep_recent = md_ConfigResponse.Fields().ByName("pruning_keep_recent") fd_ConfigResponse_pruning_interval = md_ConfigResponse.Fields().ByName("pruning_interval") + fd_ConfigResponse_halt_height = md_ConfigResponse.Fields().ByName("halt_height") } var _ protoreflect.Message = (*fastReflection_ConfigResponse)(nil) @@ -469,6 +471,12 @@ func (x *fastReflection_ConfigResponse) Range(f func(protoreflect.FieldDescripto return } } + if x.HaltHeight != uint64(0) { + value := protoreflect.ValueOfUint64(x.HaltHeight) + if !f(fd_ConfigResponse_halt_height, value) { + return + } + } } // Has reports whether a field is populated. @@ -490,6 +498,8 @@ func (x *fastReflection_ConfigResponse) Has(fd protoreflect.FieldDescriptor) boo return x.PruningKeepRecent != "" case "cosmos.base.node.v1beta1.ConfigResponse.pruning_interval": return x.PruningInterval != "" + case "cosmos.base.node.v1beta1.ConfigResponse.halt_height": + return x.HaltHeight != uint64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v1beta1.ConfigResponse")) @@ -512,6 +522,8 @@ func (x *fastReflection_ConfigResponse) Clear(fd protoreflect.FieldDescriptor) { x.PruningKeepRecent = "" case "cosmos.base.node.v1beta1.ConfigResponse.pruning_interval": x.PruningInterval = "" + case "cosmos.base.node.v1beta1.ConfigResponse.halt_height": + x.HaltHeight = uint64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v1beta1.ConfigResponse")) @@ -537,6 +549,9 @@ func (x *fastReflection_ConfigResponse) Get(descriptor protoreflect.FieldDescrip case "cosmos.base.node.v1beta1.ConfigResponse.pruning_interval": value := x.PruningInterval return protoreflect.ValueOfString(value) + case "cosmos.base.node.v1beta1.ConfigResponse.halt_height": + value := x.HaltHeight + return protoreflect.ValueOfUint64(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v1beta1.ConfigResponse")) @@ -563,6 +578,8 @@ func (x *fastReflection_ConfigResponse) Set(fd protoreflect.FieldDescriptor, val x.PruningKeepRecent = value.Interface().(string) case "cosmos.base.node.v1beta1.ConfigResponse.pruning_interval": x.PruningInterval = value.Interface().(string) + case "cosmos.base.node.v1beta1.ConfigResponse.halt_height": + x.HaltHeight = value.Uint() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v1beta1.ConfigResponse")) @@ -589,6 +606,8 @@ func (x *fastReflection_ConfigResponse) Mutable(fd protoreflect.FieldDescriptor) panic(fmt.Errorf("field pruning_keep_recent of message cosmos.base.node.v1beta1.ConfigResponse is not mutable")) case "cosmos.base.node.v1beta1.ConfigResponse.pruning_interval": panic(fmt.Errorf("field pruning_interval of message cosmos.base.node.v1beta1.ConfigResponse is not mutable")) + case "cosmos.base.node.v1beta1.ConfigResponse.halt_height": + panic(fmt.Errorf("field halt_height of message cosmos.base.node.v1beta1.ConfigResponse is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v1beta1.ConfigResponse")) @@ -608,6 +627,8 @@ func (x *fastReflection_ConfigResponse) NewField(fd protoreflect.FieldDescriptor return protoreflect.ValueOfString("") case "cosmos.base.node.v1beta1.ConfigResponse.pruning_interval": return protoreflect.ValueOfString("") + case "cosmos.base.node.v1beta1.ConfigResponse.halt_height": + return protoreflect.ValueOfUint64(uint64(0)) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v1beta1.ConfigResponse")) @@ -689,6 +710,9 @@ func (x *fastReflection_ConfigResponse) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } + if x.HaltHeight != 0 { + n += 1 + runtime.Sov(uint64(x.HaltHeight)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -718,6 +742,11 @@ func (x *fastReflection_ConfigResponse) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.HaltHeight != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.HaltHeight)) + i-- + dAtA[i] = 0x20 + } if len(x.PruningInterval) > 0 { i -= len(x.PruningInterval) copy(dAtA[i:], x.PruningInterval) @@ -884,6 +913,25 @@ func (x *fastReflection_ConfigResponse) ProtoMethods() *protoiface.Methods { } x.PruningInterval = 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 HaltHeight", wireType) + } + x.HaltHeight = 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.HaltHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1984,10 +2032,10 @@ type ConfigResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - MinimumGasPrice string `protobuf:"bytes,1,opt,name=minimum_gas_price,json=minimumGasPrice,proto3" json:"minimum_gas_price,omitempty"` - // pruning settings + MinimumGasPrice string `protobuf:"bytes,1,opt,name=minimum_gas_price,json=minimumGasPrice,proto3" json:"minimum_gas_price,omitempty"` PruningKeepRecent string `protobuf:"bytes,2,opt,name=pruning_keep_recent,json=pruningKeepRecent,proto3" json:"pruning_keep_recent,omitempty"` PruningInterval string `protobuf:"bytes,3,opt,name=pruning_interval,json=pruningInterval,proto3" json:"pruning_interval,omitempty"` + HaltHeight uint64 `protobuf:"varint,4,opt,name=halt_height,json=haltHeight,proto3" json:"halt_height,omitempty"` } func (x *ConfigResponse) Reset() { @@ -2031,6 +2079,13 @@ func (x *ConfigResponse) GetPruningInterval() string { return "" } +func (x *ConfigResponse) GetHaltHeight() uint64 { + if x != nil { + return x.HaltHeight + } + return 0 +} + // StateRequest defines the request structure for the status of a node. type StatusRequest struct { state protoimpl.MessageState @@ -2139,7 +2194,7 @@ var file_cosmos_base_node_v1beta1_query_proto_rawDesc = []byte{ 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 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, 0x0f, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x97, 0x01, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xb8, 0x01, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x47, 0x61, 0x73, @@ -2149,54 +2204,56 @@ var file_cosmos_base_node_v1beta1_query_proto_rawDesc = []byte{ 0x65, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, - 0x22, 0x0f, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x22, 0xde, 0x01, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x15, 0x65, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, - 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x13, 0x65, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x53, 0x74, 0x6f, - 0x72, 0x65, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, - 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, - 0x12, 0x3e, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, - 0x04, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x12, 0x19, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x07, 0x61, 0x70, 0x70, 0x48, 0x61, 0x73, 0x68, 0x12, 0x25, 0x0a, 0x0e, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x48, 0x61, - 0x73, 0x68, 0x32, 0x99, 0x02, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x85, - 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, - 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, - 0x73, 0x65, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x85, 0x01, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, - 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x73, + 0x12, 0x1f, 0x0a, 0x0b, 0x68, 0x61, 0x6c, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x68, 0x61, 0x6c, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, + 0x74, 0x22, 0x0f, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x22, 0xde, 0x01, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x15, 0x65, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, + 0x74, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x13, 0x65, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x53, 0x74, + 0x6f, 0x72, 0x65, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, + 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, + 0x74, 0x12, 0x3e, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x42, 0x04, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x70, 0x70, 0x48, 0x61, 0x73, 0x68, 0x12, 0x25, 0x0a, 0x0e, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x48, + 0x61, 0x73, 0x68, 0x32, 0x99, 0x02, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, + 0x85, 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0xe4, - 0x01, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, - 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, - 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, + 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, + 0x61, 0x73, 0x65, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x85, 0x01, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, + 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x6e, 0x6f, 0x64, 0x65, - 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x6e, 0x6f, 0x64, 0x65, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x4e, 0xaa, 0x02, 0x18, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x56, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, - 0x61, 0x73, 0x65, 0x5c, 0x4e, 0x6f, 0x64, 0x65, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0xe2, 0x02, 0x24, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x73, 0x65, 0x5c, 0x4e, - 0x6f, 0x64, 0x65, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x3a, 0x3a, 0x42, 0x61, 0x73, 0x65, 0x3a, 0x3a, 0x4e, 0x6f, 0x64, 0x65, 0x3a, 0x3a, 0x56, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, + 0xe4, 0x01, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, + 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x6e, 0x6f, 0x64, + 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x6e, 0x6f, 0x64, 0x65, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x4e, 0xaa, 0x02, 0x18, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x56, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, + 0x42, 0x61, 0x73, 0x65, 0x5c, 0x4e, 0x6f, 0x64, 0x65, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0xe2, 0x02, 0x24, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x73, 0x65, 0x5c, + 0x4e, 0x6f, 0x64, 0x65, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x3a, 0x3a, 0x42, 0x61, 0x73, 0x65, 0x3a, 0x3a, 0x4e, 0x6f, 0x64, 0x65, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/base/node/v1beta1/query_grpc.pb.go b/api/cosmos/base/node/v1beta1/query_grpc.pb.go index cc79672ab921..4247658d3c30 100644 --- a/api/cosmos/base/node/v1beta1/query_grpc.pb.go +++ b/api/cosmos/base/node/v1beta1/query_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/base/node/v1beta1/query.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Service_Config_FullMethodName = "/cosmos.base.node.v1beta1.Service/Config" @@ -26,6 +26,8 @@ const ( // ServiceClient is the client API for Service service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Service defines the gRPC querier service for node related queries. type ServiceClient interface { // Config queries for the operator configuration. Config(ctx context.Context, in *ConfigRequest, opts ...grpc.CallOption) (*ConfigResponse, error) @@ -42,8 +44,9 @@ func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient { } func (c *serviceClient) Config(ctx context.Context, in *ConfigRequest, opts ...grpc.CallOption) (*ConfigResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ConfigResponse) - err := c.cc.Invoke(ctx, Service_Config_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Service_Config_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -51,8 +54,9 @@ func (c *serviceClient) Config(ctx context.Context, in *ConfigRequest, opts ...g } func (c *serviceClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(StatusResponse) - err := c.cc.Invoke(ctx, Service_Status_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Service_Status_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -61,7 +65,9 @@ func (c *serviceClient) Status(ctx context.Context, in *StatusRequest, opts ...g // ServiceServer is the server API for Service service. // All implementations must embed UnimplementedServiceServer -// for forward compatibility +// for forward compatibility. +// +// Service defines the gRPC querier service for node related queries. type ServiceServer interface { // Config queries for the operator configuration. Config(context.Context, *ConfigRequest) (*ConfigResponse, error) @@ -70,9 +76,12 @@ type ServiceServer interface { mustEmbedUnimplementedServiceServer() } -// UnimplementedServiceServer must be embedded to have forward compatible implementations. -type UnimplementedServiceServer struct { -} +// UnimplementedServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedServiceServer struct{} func (UnimplementedServiceServer) Config(context.Context, *ConfigRequest) (*ConfigResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Config not implemented") @@ -81,6 +90,7 @@ func (UnimplementedServiceServer) Status(context.Context, *StatusRequest) (*Stat return nil, status.Errorf(codes.Unimplemented, "method Status not implemented") } func (UnimplementedServiceServer) mustEmbedUnimplementedServiceServer() {} +func (UnimplementedServiceServer) testEmbeddedByValue() {} // UnsafeServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to ServiceServer will @@ -90,6 +100,13 @@ type UnsafeServiceServer interface { } func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer) { + // If the following call pancis, it indicates UnimplementedServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Service_ServiceDesc, srv) } diff --git a/api/cosmos/base/reflection/v1beta1/reflection_grpc.pb.go b/api/cosmos/base/reflection/v1beta1/reflection_grpc.pb.go index 76040a8a0579..044618d70c11 100644 --- a/api/cosmos/base/reflection/v1beta1/reflection_grpc.pb.go +++ b/api/cosmos/base/reflection/v1beta1/reflection_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/base/reflection/v1beta1/reflection.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( ReflectionService_ListAllInterfaces_FullMethodName = "/cosmos.base.reflection.v1beta1.ReflectionService/ListAllInterfaces" @@ -26,6 +26,8 @@ const ( // ReflectionServiceClient is the client API for ReflectionService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// ReflectionService defines a service for interface reflection. type ReflectionServiceClient interface { // ListAllInterfaces lists all the interfaces registered in the interface // registry. @@ -44,8 +46,9 @@ func NewReflectionServiceClient(cc grpc.ClientConnInterface) ReflectionServiceCl } func (c *reflectionServiceClient) ListAllInterfaces(ctx context.Context, in *ListAllInterfacesRequest, opts ...grpc.CallOption) (*ListAllInterfacesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ListAllInterfacesResponse) - err := c.cc.Invoke(ctx, ReflectionService_ListAllInterfaces_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ReflectionService_ListAllInterfaces_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -53,8 +56,9 @@ func (c *reflectionServiceClient) ListAllInterfaces(ctx context.Context, in *Lis } func (c *reflectionServiceClient) ListImplementations(ctx context.Context, in *ListImplementationsRequest, opts ...grpc.CallOption) (*ListImplementationsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ListImplementationsResponse) - err := c.cc.Invoke(ctx, ReflectionService_ListImplementations_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ReflectionService_ListImplementations_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -63,7 +67,9 @@ func (c *reflectionServiceClient) ListImplementations(ctx context.Context, in *L // ReflectionServiceServer is the server API for ReflectionService service. // All implementations must embed UnimplementedReflectionServiceServer -// for forward compatibility +// for forward compatibility. +// +// ReflectionService defines a service for interface reflection. type ReflectionServiceServer interface { // ListAllInterfaces lists all the interfaces registered in the interface // registry. @@ -74,9 +80,12 @@ type ReflectionServiceServer interface { mustEmbedUnimplementedReflectionServiceServer() } -// UnimplementedReflectionServiceServer must be embedded to have forward compatible implementations. -type UnimplementedReflectionServiceServer struct { -} +// UnimplementedReflectionServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedReflectionServiceServer struct{} func (UnimplementedReflectionServiceServer) ListAllInterfaces(context.Context, *ListAllInterfacesRequest) (*ListAllInterfacesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListAllInterfaces not implemented") @@ -85,6 +94,7 @@ func (UnimplementedReflectionServiceServer) ListImplementations(context.Context, return nil, status.Errorf(codes.Unimplemented, "method ListImplementations not implemented") } func (UnimplementedReflectionServiceServer) mustEmbedUnimplementedReflectionServiceServer() {} +func (UnimplementedReflectionServiceServer) testEmbeddedByValue() {} // UnsafeReflectionServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to ReflectionServiceServer will @@ -94,6 +104,13 @@ type UnsafeReflectionServiceServer interface { } func RegisterReflectionServiceServer(s grpc.ServiceRegistrar, srv ReflectionServiceServer) { + // If the following call pancis, it indicates UnimplementedReflectionServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&ReflectionService_ServiceDesc, srv) } diff --git a/api/cosmos/base/reflection/v2alpha1/reflection_grpc.pb.go b/api/cosmos/base/reflection/v2alpha1/reflection_grpc.pb.go index 2977cc277125..a9e1b0e45045 100644 --- a/api/cosmos/base/reflection/v2alpha1/reflection_grpc.pb.go +++ b/api/cosmos/base/reflection/v2alpha1/reflection_grpc.pb.go @@ -2,7 +2,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/base/reflection/v2alpha1/reflection.proto @@ -17,8 +17,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( ReflectionService_GetAuthnDescriptor_FullMethodName = "/cosmos.base.reflection.v2alpha1.ReflectionService/GetAuthnDescriptor" @@ -32,6 +32,8 @@ const ( // ReflectionServiceClient is the client API for ReflectionService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// ReflectionService defines a service for application reflection. type ReflectionServiceClient interface { // GetAuthnDescriptor returns information on how to authenticate transactions in the application // NOTE: this RPC is still experimental and might be subject to breaking changes or removal in @@ -58,8 +60,9 @@ func NewReflectionServiceClient(cc grpc.ClientConnInterface) ReflectionServiceCl } func (c *reflectionServiceClient) GetAuthnDescriptor(ctx context.Context, in *GetAuthnDescriptorRequest, opts ...grpc.CallOption) (*GetAuthnDescriptorResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetAuthnDescriptorResponse) - err := c.cc.Invoke(ctx, ReflectionService_GetAuthnDescriptor_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ReflectionService_GetAuthnDescriptor_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -67,8 +70,9 @@ func (c *reflectionServiceClient) GetAuthnDescriptor(ctx context.Context, in *Ge } func (c *reflectionServiceClient) GetChainDescriptor(ctx context.Context, in *GetChainDescriptorRequest, opts ...grpc.CallOption) (*GetChainDescriptorResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetChainDescriptorResponse) - err := c.cc.Invoke(ctx, ReflectionService_GetChainDescriptor_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ReflectionService_GetChainDescriptor_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -76,8 +80,9 @@ func (c *reflectionServiceClient) GetChainDescriptor(ctx context.Context, in *Ge } func (c *reflectionServiceClient) GetCodecDescriptor(ctx context.Context, in *GetCodecDescriptorRequest, opts ...grpc.CallOption) (*GetCodecDescriptorResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetCodecDescriptorResponse) - err := c.cc.Invoke(ctx, ReflectionService_GetCodecDescriptor_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ReflectionService_GetCodecDescriptor_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -85,8 +90,9 @@ func (c *reflectionServiceClient) GetCodecDescriptor(ctx context.Context, in *Ge } func (c *reflectionServiceClient) GetConfigurationDescriptor(ctx context.Context, in *GetConfigurationDescriptorRequest, opts ...grpc.CallOption) (*GetConfigurationDescriptorResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetConfigurationDescriptorResponse) - err := c.cc.Invoke(ctx, ReflectionService_GetConfigurationDescriptor_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ReflectionService_GetConfigurationDescriptor_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -94,8 +100,9 @@ func (c *reflectionServiceClient) GetConfigurationDescriptor(ctx context.Context } func (c *reflectionServiceClient) GetQueryServicesDescriptor(ctx context.Context, in *GetQueryServicesDescriptorRequest, opts ...grpc.CallOption) (*GetQueryServicesDescriptorResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetQueryServicesDescriptorResponse) - err := c.cc.Invoke(ctx, ReflectionService_GetQueryServicesDescriptor_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ReflectionService_GetQueryServicesDescriptor_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -103,8 +110,9 @@ func (c *reflectionServiceClient) GetQueryServicesDescriptor(ctx context.Context } func (c *reflectionServiceClient) GetTxDescriptor(ctx context.Context, in *GetTxDescriptorRequest, opts ...grpc.CallOption) (*GetTxDescriptorResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetTxDescriptorResponse) - err := c.cc.Invoke(ctx, ReflectionService_GetTxDescriptor_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ReflectionService_GetTxDescriptor_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -113,7 +121,9 @@ func (c *reflectionServiceClient) GetTxDescriptor(ctx context.Context, in *GetTx // ReflectionServiceServer is the server API for ReflectionService service. // All implementations must embed UnimplementedReflectionServiceServer -// for forward compatibility +// for forward compatibility. +// +// ReflectionService defines a service for application reflection. type ReflectionServiceServer interface { // GetAuthnDescriptor returns information on how to authenticate transactions in the application // NOTE: this RPC is still experimental and might be subject to breaking changes or removal in @@ -132,9 +142,12 @@ type ReflectionServiceServer interface { mustEmbedUnimplementedReflectionServiceServer() } -// UnimplementedReflectionServiceServer must be embedded to have forward compatible implementations. -type UnimplementedReflectionServiceServer struct { -} +// UnimplementedReflectionServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedReflectionServiceServer struct{} func (UnimplementedReflectionServiceServer) GetAuthnDescriptor(context.Context, *GetAuthnDescriptorRequest) (*GetAuthnDescriptorResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetAuthnDescriptor not implemented") @@ -155,6 +168,7 @@ func (UnimplementedReflectionServiceServer) GetTxDescriptor(context.Context, *Ge return nil, status.Errorf(codes.Unimplemented, "method GetTxDescriptor not implemented") } func (UnimplementedReflectionServiceServer) mustEmbedUnimplementedReflectionServiceServer() {} +func (UnimplementedReflectionServiceServer) testEmbeddedByValue() {} // UnsafeReflectionServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to ReflectionServiceServer will @@ -164,6 +178,13 @@ type UnsafeReflectionServiceServer interface { } func RegisterReflectionServiceServer(s grpc.ServiceRegistrar, srv ReflectionServiceServer) { + // If the following call pancis, it indicates UnimplementedReflectionServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&ReflectionService_ServiceDesc, srv) } diff --git a/api/cosmos/base/tendermint/v1beta1/query_grpc.pb.go b/api/cosmos/base/tendermint/v1beta1/query_grpc.pb.go index 37c7b1d64862..956816d27550 100644 --- a/api/cosmos/base/tendermint/v1beta1/query_grpc.pb.go +++ b/api/cosmos/base/tendermint/v1beta1/query_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/base/tendermint/v1beta1/query.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Service_GetNodeInfo_FullMethodName = "/cosmos.base.tendermint.v1beta1.Service/GetNodeInfo" @@ -31,6 +31,8 @@ const ( // ServiceClient is the client API for Service service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Service defines the gRPC querier service for tendermint queries. type ServiceClient interface { // GetNodeInfo queries the current node info. GetNodeInfo(ctx context.Context, in *GetNodeInfoRequest, opts ...grpc.CallOption) (*GetNodeInfoResponse, error) @@ -61,8 +63,9 @@ func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient { } func (c *serviceClient) GetNodeInfo(ctx context.Context, in *GetNodeInfoRequest, opts ...grpc.CallOption) (*GetNodeInfoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetNodeInfoResponse) - err := c.cc.Invoke(ctx, Service_GetNodeInfo_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Service_GetNodeInfo_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -70,8 +73,9 @@ func (c *serviceClient) GetNodeInfo(ctx context.Context, in *GetNodeInfoRequest, } func (c *serviceClient) GetSyncing(ctx context.Context, in *GetSyncingRequest, opts ...grpc.CallOption) (*GetSyncingResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetSyncingResponse) - err := c.cc.Invoke(ctx, Service_GetSyncing_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Service_GetSyncing_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -79,8 +83,9 @@ func (c *serviceClient) GetSyncing(ctx context.Context, in *GetSyncingRequest, o } func (c *serviceClient) GetLatestBlock(ctx context.Context, in *GetLatestBlockRequest, opts ...grpc.CallOption) (*GetLatestBlockResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetLatestBlockResponse) - err := c.cc.Invoke(ctx, Service_GetLatestBlock_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Service_GetLatestBlock_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -88,8 +93,9 @@ func (c *serviceClient) GetLatestBlock(ctx context.Context, in *GetLatestBlockRe } func (c *serviceClient) GetBlockByHeight(ctx context.Context, in *GetBlockByHeightRequest, opts ...grpc.CallOption) (*GetBlockByHeightResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetBlockByHeightResponse) - err := c.cc.Invoke(ctx, Service_GetBlockByHeight_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Service_GetBlockByHeight_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -97,8 +103,9 @@ func (c *serviceClient) GetBlockByHeight(ctx context.Context, in *GetBlockByHeig } func (c *serviceClient) GetLatestValidatorSet(ctx context.Context, in *GetLatestValidatorSetRequest, opts ...grpc.CallOption) (*GetLatestValidatorSetResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetLatestValidatorSetResponse) - err := c.cc.Invoke(ctx, Service_GetLatestValidatorSet_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Service_GetLatestValidatorSet_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -106,8 +113,9 @@ func (c *serviceClient) GetLatestValidatorSet(ctx context.Context, in *GetLatest } func (c *serviceClient) GetValidatorSetByHeight(ctx context.Context, in *GetValidatorSetByHeightRequest, opts ...grpc.CallOption) (*GetValidatorSetByHeightResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetValidatorSetByHeightResponse) - err := c.cc.Invoke(ctx, Service_GetValidatorSetByHeight_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Service_GetValidatorSetByHeight_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -115,8 +123,9 @@ func (c *serviceClient) GetValidatorSetByHeight(ctx context.Context, in *GetVali } func (c *serviceClient) ABCIQuery(ctx context.Context, in *ABCIQueryRequest, opts ...grpc.CallOption) (*ABCIQueryResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ABCIQueryResponse) - err := c.cc.Invoke(ctx, Service_ABCIQuery_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Service_ABCIQuery_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -125,7 +134,9 @@ func (c *serviceClient) ABCIQuery(ctx context.Context, in *ABCIQueryRequest, opt // ServiceServer is the server API for Service service. // All implementations must embed UnimplementedServiceServer -// for forward compatibility +// for forward compatibility. +// +// Service defines the gRPC querier service for tendermint queries. type ServiceServer interface { // GetNodeInfo queries the current node info. GetNodeInfo(context.Context, *GetNodeInfoRequest) (*GetNodeInfoResponse, error) @@ -148,9 +159,12 @@ type ServiceServer interface { mustEmbedUnimplementedServiceServer() } -// UnimplementedServiceServer must be embedded to have forward compatible implementations. -type UnimplementedServiceServer struct { -} +// UnimplementedServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedServiceServer struct{} func (UnimplementedServiceServer) GetNodeInfo(context.Context, *GetNodeInfoRequest) (*GetNodeInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetNodeInfo not implemented") @@ -174,6 +188,7 @@ func (UnimplementedServiceServer) ABCIQuery(context.Context, *ABCIQueryRequest) return nil, status.Errorf(codes.Unimplemented, "method ABCIQuery not implemented") } func (UnimplementedServiceServer) mustEmbedUnimplementedServiceServer() {} +func (UnimplementedServiceServer) testEmbeddedByValue() {} // UnsafeServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to ServiceServer will @@ -183,6 +198,13 @@ type UnsafeServiceServer interface { } func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer) { + // If the following call pancis, it indicates UnimplementedServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Service_ServiceDesc, srv) } diff --git a/api/cosmos/base/v1beta1/coin.pulsar.go b/api/cosmos/base/v1beta1/coin.pulsar.go index 26b79e11737d..3ca203c3013e 100644 --- a/api/cosmos/base/v1beta1/coin.pulsar.go +++ b/api/cosmos/base/v1beta1/coin.pulsar.go @@ -1931,6 +1931,7 @@ func (x *DecCoin) GetAmount() string { } // IntProto defines a Protobuf wrapper around an Int object. +// Deprecated: Prefer to use math.Int directly. It supports binary Marshal and Unmarshal. type IntProto struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1967,6 +1968,7 @@ func (x *IntProto) GetInt() string { } // DecProto defines a Protobuf wrapper around a Dec object. +// Deprecated: Prefer to use math.LegacyDec directly. It supports binary Marshal and Unmarshal. type DecProto struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2012,39 +2014,44 @@ var file_cosmos_base_v1beta1_coin_proto_rawDesc = []byte{ 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, - 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5a, 0x0a, 0x04, 0x43, 0x6f, 0x69, + 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6c, 0x0a, 0x04, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x36, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, - 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1e, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, - 0x03, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, - 0x6e, 0x74, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, - 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0x58, 0x0a, 0x07, 0x44, 0x65, 0x63, 0x43, 0x6f, 0x69, 0x6e, - 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x31, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x19, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x03, - 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, - 0x63, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, - 0x37, 0x0a, 0x08, 0x49, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x2b, 0x0a, 0x03, 0x69, - 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x19, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, - 0x1f, 0x03, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x49, 0x6e, 0x74, 0x52, 0x03, 0x69, 0x6e, 0x74, 0x22, 0x37, 0x0a, 0x08, 0x44, 0x65, 0x63, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x2b, 0x0a, 0x03, 0x64, 0x65, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x19, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x03, 0x44, 0x65, 0x63, 0xd2, 0xb4, - 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x03, 0x64, 0x65, - 0x63, 0x42, 0xcc, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x09, 0x43, - 0x6f, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x3b, 0x62, 0x61, 0x73, 0x65, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, - 0x42, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x73, 0x65, - 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x5c, 0x42, 0x61, 0x73, 0x65, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, - 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x73, 0x65, 0x5c, 0x56, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0xea, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x42, 0x61, 0x73, 0x65, 0x3a, - 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xd8, 0xe1, 0x1e, 0x00, 0x80, 0xe2, 0x1e, 0x00, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x48, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, + 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, + 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x49, 0x6e, 0x74, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, + 0x74, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0x70, 0x0a, 0x07, 0x44, 0x65, 0x63, 0x43, 0x6f, + 0x69, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x49, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, + 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, + 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, + 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x06, 0x61, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0x49, 0x0a, 0x08, 0x49, 0x6e, 0x74, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x3d, 0x0a, 0x03, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, + 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, + 0x03, 0x69, 0x6e, 0x74, 0x22, 0x4f, 0x0a, 0x08, 0x44, 0x65, 0x63, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x43, 0x0a, 0x03, 0x64, 0x65, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, + 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, + 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, + 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, + 0x52, 0x03, 0x64, 0x65, 0x63, 0x42, 0xcc, 0x01, 0xd8, 0xe1, 0x1e, 0x00, 0x80, 0xe2, 0x1e, 0x00, + 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, + 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x09, 0x43, 0x6f, 0x69, 0x6e, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, + 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, + 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x62, 0x61, 0x73, + 0x65, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x58, 0xaa, 0x02, + 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x2e, 0x56, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, + 0x73, 0x65, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x73, 0x65, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x42, 0x61, 0x73, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/circuit/v1/query_grpc.pb.go b/api/cosmos/circuit/v1/query_grpc.pb.go index 6218b68d8bd1..84fc70dcba40 100644 --- a/api/cosmos/circuit/v1/query_grpc.pb.go +++ b/api/cosmos/circuit/v1/query_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/circuit/v1/query.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Query_Account_FullMethodName = "/cosmos.circuit.v1.Query/Account" @@ -27,6 +27,8 @@ const ( // QueryClient is the client API for Query service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Query defines the circuit gRPC querier service. type QueryClient interface { // Account returns account permissions. Account(ctx context.Context, in *QueryAccountRequest, opts ...grpc.CallOption) (*AccountResponse, error) @@ -45,8 +47,9 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { } func (c *queryClient) Account(ctx context.Context, in *QueryAccountRequest, opts ...grpc.CallOption) (*AccountResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(AccountResponse) - err := c.cc.Invoke(ctx, Query_Account_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Account_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -54,8 +57,9 @@ func (c *queryClient) Account(ctx context.Context, in *QueryAccountRequest, opts } func (c *queryClient) Accounts(ctx context.Context, in *QueryAccountsRequest, opts ...grpc.CallOption) (*AccountsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(AccountsResponse) - err := c.cc.Invoke(ctx, Query_Accounts_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Accounts_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -63,8 +67,9 @@ func (c *queryClient) Accounts(ctx context.Context, in *QueryAccountsRequest, op } func (c *queryClient) DisabledList(ctx context.Context, in *QueryDisabledListRequest, opts ...grpc.CallOption) (*DisabledListResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(DisabledListResponse) - err := c.cc.Invoke(ctx, Query_DisabledList_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_DisabledList_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -73,7 +78,9 @@ func (c *queryClient) DisabledList(ctx context.Context, in *QueryDisabledListReq // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer -// for forward compatibility +// for forward compatibility. +// +// Query defines the circuit gRPC querier service. type QueryServer interface { // Account returns account permissions. Account(context.Context, *QueryAccountRequest) (*AccountResponse, error) @@ -84,9 +91,12 @@ type QueryServer interface { mustEmbedUnimplementedQueryServer() } -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} +// UnimplementedQueryServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedQueryServer struct{} func (UnimplementedQueryServer) Account(context.Context, *QueryAccountRequest) (*AccountResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Account not implemented") @@ -98,6 +108,7 @@ func (UnimplementedQueryServer) DisabledList(context.Context, *QueryDisabledList return nil, status.Errorf(codes.Unimplemented, "method DisabledList not implemented") } func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} +func (UnimplementedQueryServer) testEmbeddedByValue() {} // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to QueryServer will @@ -107,6 +118,13 @@ type UnsafeQueryServer interface { } func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + // If the following call pancis, it indicates UnimplementedQueryServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Query_ServiceDesc, srv) } diff --git a/api/cosmos/circuit/v1/tx.pulsar.go b/api/cosmos/circuit/v1/tx.pulsar.go index ca2f3e5012e4..a6a43bb1e716 100644 --- a/api/cosmos/circuit/v1/tx.pulsar.go +++ b/api/cosmos/circuit/v1/tx.pulsar.go @@ -2965,7 +2965,7 @@ func (x *MsgAuthorizeCircuitBreaker) GetPermissions() *Permissions { return nil } -// MsgAuthorizeCircuitBreaker defines the Msg/AuthorizeCircuitBreaker response type. +// MsgAuthorizeCircuitBreakerResponse defines the Msg/AuthorizeCircuitBreaker response type. type MsgAuthorizeCircuitBreakerResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3051,7 +3051,7 @@ func (x *MsgTripCircuitBreaker) GetMsgTypeUrls() []string { return nil } -// MsgTripCircuitBreaker defines the Msg/TripCircuitBreaker response type. +// MsgTripCircuitBreakerResponse defines the Msg/TripCircuitBreaker response type. type MsgTripCircuitBreakerResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/api/cosmos/circuit/v1/tx_grpc.pb.go b/api/cosmos/circuit/v1/tx_grpc.pb.go index 0103451c0245..86958a2178f6 100644 --- a/api/cosmos/circuit/v1/tx_grpc.pb.go +++ b/api/cosmos/circuit/v1/tx_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/circuit/v1/tx.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Msg_AuthorizeCircuitBreaker_FullMethodName = "/cosmos.circuit.v1.Msg/AuthorizeCircuitBreaker" @@ -27,6 +27,8 @@ const ( // MsgClient is the client API for Msg service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Msg defines the circuit Msg service. type MsgClient interface { // AuthorizeCircuitBreaker allows a super-admin to grant (or revoke) another // account's circuit breaker permissions. @@ -47,8 +49,9 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { } func (c *msgClient) AuthorizeCircuitBreaker(ctx context.Context, in *MsgAuthorizeCircuitBreaker, opts ...grpc.CallOption) (*MsgAuthorizeCircuitBreakerResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgAuthorizeCircuitBreakerResponse) - err := c.cc.Invoke(ctx, Msg_AuthorizeCircuitBreaker_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_AuthorizeCircuitBreaker_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -56,8 +59,9 @@ func (c *msgClient) AuthorizeCircuitBreaker(ctx context.Context, in *MsgAuthoriz } func (c *msgClient) TripCircuitBreaker(ctx context.Context, in *MsgTripCircuitBreaker, opts ...grpc.CallOption) (*MsgTripCircuitBreakerResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgTripCircuitBreakerResponse) - err := c.cc.Invoke(ctx, Msg_TripCircuitBreaker_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_TripCircuitBreaker_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -65,8 +69,9 @@ func (c *msgClient) TripCircuitBreaker(ctx context.Context, in *MsgTripCircuitBr } func (c *msgClient) ResetCircuitBreaker(ctx context.Context, in *MsgResetCircuitBreaker, opts ...grpc.CallOption) (*MsgResetCircuitBreakerResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgResetCircuitBreakerResponse) - err := c.cc.Invoke(ctx, Msg_ResetCircuitBreaker_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_ResetCircuitBreaker_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -75,7 +80,9 @@ func (c *msgClient) ResetCircuitBreaker(ctx context.Context, in *MsgResetCircuit // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer -// for forward compatibility +// for forward compatibility. +// +// Msg defines the circuit Msg service. type MsgServer interface { // AuthorizeCircuitBreaker allows a super-admin to grant (or revoke) another // account's circuit breaker permissions. @@ -88,9 +95,12 @@ type MsgServer interface { mustEmbedUnimplementedMsgServer() } -// UnimplementedMsgServer must be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} +// UnimplementedMsgServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedMsgServer struct{} func (UnimplementedMsgServer) AuthorizeCircuitBreaker(context.Context, *MsgAuthorizeCircuitBreaker) (*MsgAuthorizeCircuitBreakerResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AuthorizeCircuitBreaker not implemented") @@ -102,6 +112,7 @@ func (UnimplementedMsgServer) ResetCircuitBreaker(context.Context, *MsgResetCirc return nil, status.Errorf(codes.Unimplemented, "method ResetCircuitBreaker not implemented") } func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} +func (UnimplementedMsgServer) testEmbeddedByValue() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to MsgServer will @@ -111,6 +122,13 @@ type UnsafeMsgServer interface { } func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + // If the following call pancis, it indicates UnimplementedMsgServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Msg_ServiceDesc, srv) } diff --git a/api/cosmos/consensus/v1/query_grpc.pb.go b/api/cosmos/consensus/v1/query_grpc.pb.go index add845baa4a5..8f1498104bba 100644 --- a/api/cosmos/consensus/v1/query_grpc.pb.go +++ b/api/cosmos/consensus/v1/query_grpc.pb.go @@ -2,7 +2,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/consensus/v1/query.proto @@ -17,8 +17,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Query_Params_FullMethodName = "/cosmos.consensus.v1.Query/Params" @@ -27,8 +27,10 @@ const ( // QueryClient is the client API for Query service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Query defines the gRPC querier service. type QueryClient interface { - // Params queries the parameters of x/consensus_param module. + // Params queries the parameters of x/consensus module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) } @@ -41,8 +43,9 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { } func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -51,21 +54,27 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer -// for forward compatibility +// for forward compatibility. +// +// Query defines the gRPC querier service. type QueryServer interface { - // Params queries the parameters of x/consensus_param module. + // Params queries the parameters of x/consensus module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) mustEmbedUnimplementedQueryServer() } -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} +// UnimplementedQueryServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedQueryServer struct{} func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} +func (UnimplementedQueryServer) testEmbeddedByValue() {} // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to QueryServer will @@ -75,6 +84,13 @@ type UnsafeQueryServer interface { } func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + // If the following call pancis, it indicates UnimplementedQueryServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Query_ServiceDesc, srv) } diff --git a/api/cosmos/consensus/v1/tx.pulsar.go b/api/cosmos/consensus/v1/tx.pulsar.go index ec2ba1c0bf52..c355aa8f271e 100644 --- a/api/cosmos/consensus/v1/tx.pulsar.go +++ b/api/cosmos/consensus/v1/tx.pulsar.go @@ -22,6 +22,7 @@ var ( fd_MsgUpdateParams_block protoreflect.FieldDescriptor fd_MsgUpdateParams_evidence protoreflect.FieldDescriptor fd_MsgUpdateParams_validator protoreflect.FieldDescriptor + fd_MsgUpdateParams_abci protoreflect.FieldDescriptor ) func init() { @@ -31,6 +32,7 @@ func init() { fd_MsgUpdateParams_block = md_MsgUpdateParams.Fields().ByName("block") fd_MsgUpdateParams_evidence = md_MsgUpdateParams.Fields().ByName("evidence") fd_MsgUpdateParams_validator = md_MsgUpdateParams.Fields().ByName("validator") + fd_MsgUpdateParams_abci = md_MsgUpdateParams.Fields().ByName("abci") } var _ protoreflect.Message = (*fastReflection_MsgUpdateParams)(nil) @@ -122,6 +124,12 @@ func (x *fastReflection_MsgUpdateParams) Range(f func(protoreflect.FieldDescript return } } + if x.Abci != nil { + value := protoreflect.ValueOfMessage(x.Abci.ProtoReflect()) + if !f(fd_MsgUpdateParams_abci, value) { + return + } + } } // Has reports whether a field is populated. @@ -145,6 +153,8 @@ func (x *fastReflection_MsgUpdateParams) Has(fd protoreflect.FieldDescriptor) bo return x.Evidence != nil case "cosmos.consensus.v1.MsgUpdateParams.validator": return x.Validator != nil + case "cosmos.consensus.v1.MsgUpdateParams.abci": + return x.Abci != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgUpdateParams")) @@ -169,6 +179,8 @@ func (x *fastReflection_MsgUpdateParams) Clear(fd protoreflect.FieldDescriptor) x.Evidence = nil case "cosmos.consensus.v1.MsgUpdateParams.validator": x.Validator = nil + case "cosmos.consensus.v1.MsgUpdateParams.abci": + x.Abci = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgUpdateParams")) @@ -197,6 +209,9 @@ func (x *fastReflection_MsgUpdateParams) Get(descriptor protoreflect.FieldDescri case "cosmos.consensus.v1.MsgUpdateParams.validator": value := x.Validator return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.consensus.v1.MsgUpdateParams.abci": + value := x.Abci + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgUpdateParams")) @@ -225,6 +240,8 @@ func (x *fastReflection_MsgUpdateParams) Set(fd protoreflect.FieldDescriptor, va x.Evidence = value.Message().Interface().(*types.EvidenceParams) case "cosmos.consensus.v1.MsgUpdateParams.validator": x.Validator = value.Message().Interface().(*types.ValidatorParams) + case "cosmos.consensus.v1.MsgUpdateParams.abci": + x.Abci = value.Message().Interface().(*types.ABCIParams) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgUpdateParams")) @@ -260,6 +277,11 @@ func (x *fastReflection_MsgUpdateParams) Mutable(fd protoreflect.FieldDescriptor x.Validator = new(types.ValidatorParams) } return protoreflect.ValueOfMessage(x.Validator.ProtoReflect()) + case "cosmos.consensus.v1.MsgUpdateParams.abci": + if x.Abci == nil { + x.Abci = new(types.ABCIParams) + } + return protoreflect.ValueOfMessage(x.Abci.ProtoReflect()) case "cosmos.consensus.v1.MsgUpdateParams.authority": panic(fmt.Errorf("field authority of message cosmos.consensus.v1.MsgUpdateParams is not mutable")) default: @@ -286,6 +308,9 @@ func (x *fastReflection_MsgUpdateParams) NewField(fd protoreflect.FieldDescripto case "cosmos.consensus.v1.MsgUpdateParams.validator": m := new(types.ValidatorParams) return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.consensus.v1.MsgUpdateParams.abci": + m := new(types.ABCIParams) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgUpdateParams")) @@ -371,6 +396,10 @@ func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { l = options.Size(x.Validator) n += 1 + l + runtime.Sov(uint64(l)) } + if x.Abci != nil { + l = options.Size(x.Abci) + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -400,6 +429,20 @@ func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.Abci != nil { + encoded, err := options.Marshal(x.Abci) + 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.Validator != nil { encoded, err := options.Marshal(x.Validator) if err != nil { @@ -638,6 +681,42 @@ func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Abci", 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.Abci == nil { + x.Abci = &types.ABCIParams{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Abci); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1060,6 +1139,8 @@ type MsgUpdateParams struct { Block *types.BlockParams `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` Evidence *types.EvidenceParams `protobuf:"bytes,3,opt,name=evidence,proto3" json:"evidence,omitempty"` Validator *types.ValidatorParams `protobuf:"bytes,4,opt,name=validator,proto3" json:"validator,omitempty"` + // Since: cosmos-sdk 0.50 + Abci *types.ABCIParams `protobuf:"bytes,5,opt,name=abci,proto3" json:"abci,omitempty"` } func (x *MsgUpdateParams) Reset() { @@ -1110,6 +1191,13 @@ func (x *MsgUpdateParams) GetValidator() *types.ValidatorParams { return nil } +func (x *MsgUpdateParams) GetAbci() *types.ABCIParams { + if x != nil { + return x.Abci + } + return nil +} + // MsgUpdateParamsResponse defines the response structure for executing a // MsgUpdateParams message. type MsgUpdateParamsResponse struct { @@ -1150,7 +1238,7 @@ var file_cosmos_consensus_v1_tx_proto_rawDesc = []byte{ 0x6f, 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, 0x1d, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb8, 0x02, 0x0a, 0x0f, 0x4d, 0x73, + 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xea, 0x02, 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, @@ -1166,32 +1254,35 @@ var file_cosmos_consensus_v1_tx_proto_rawDesc = []byte{ 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x09, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x3a, 0x39, 0x82, 0xe7, 0xb0, 0x2a, 0x09, - 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x26, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, - 0x6e, 0x73, 0x75, 0x73, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, - 0x70, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x62, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2c, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, - 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, - 0x01, 0x42, 0xc2, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, - 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x63, - 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x58, - 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, - 0x73, 0x75, 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, - 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1f, 0x43, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5c, - 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x30, 0x0a, 0x04, 0x61, 0x62, 0x63, + 0x69, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, + 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x41, 0x42, 0x43, 0x49, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x04, 0x61, 0x62, 0x63, 0x69, 0x3a, 0x39, 0x82, 0xe7, 0xb0, + 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x26, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, 0x63, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x32, 0x70, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x62, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, + 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2c, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, + 0xb0, 0x2a, 0x01, 0x42, 0xc2, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x42, + 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2f, 0x76, 0x31, + 0x3b, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, + 0x43, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5c, 0x56, 0x31, 0xe2, 0x02, + 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, + 0x73, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x6f, 0x6e, 0x73, 0x65, + 0x6e, 0x73, 0x75, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1213,18 +1304,20 @@ var file_cosmos_consensus_v1_tx_proto_goTypes = []interface{}{ (*types.BlockParams)(nil), // 2: tendermint.types.BlockParams (*types.EvidenceParams)(nil), // 3: tendermint.types.EvidenceParams (*types.ValidatorParams)(nil), // 4: tendermint.types.ValidatorParams + (*types.ABCIParams)(nil), // 5: tendermint.types.ABCIParams } var file_cosmos_consensus_v1_tx_proto_depIdxs = []int32{ 2, // 0: cosmos.consensus.v1.MsgUpdateParams.block:type_name -> tendermint.types.BlockParams 3, // 1: cosmos.consensus.v1.MsgUpdateParams.evidence:type_name -> tendermint.types.EvidenceParams 4, // 2: cosmos.consensus.v1.MsgUpdateParams.validator:type_name -> tendermint.types.ValidatorParams - 0, // 3: cosmos.consensus.v1.Msg.UpdateParams:input_type -> cosmos.consensus.v1.MsgUpdateParams - 1, // 4: cosmos.consensus.v1.Msg.UpdateParams:output_type -> cosmos.consensus.v1.MsgUpdateParamsResponse - 4, // [4:5] is the sub-list for method output_type - 3, // [3:4] 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 + 5, // 3: cosmos.consensus.v1.MsgUpdateParams.abci:type_name -> tendermint.types.ABCIParams + 0, // 4: cosmos.consensus.v1.Msg.UpdateParams:input_type -> cosmos.consensus.v1.MsgUpdateParams + 1, // 5: cosmos.consensus.v1.Msg.UpdateParams:output_type -> cosmos.consensus.v1.MsgUpdateParamsResponse + 5, // [5:6] is the sub-list for method output_type + 4, // [4:5] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_cosmos_consensus_v1_tx_proto_init() } diff --git a/api/cosmos/consensus/v1/tx_grpc.pb.go b/api/cosmos/consensus/v1/tx_grpc.pb.go index c7429525bc96..01bf686d5f4b 100644 --- a/api/cosmos/consensus/v1/tx_grpc.pb.go +++ b/api/cosmos/consensus/v1/tx_grpc.pb.go @@ -2,7 +2,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/consensus/v1/tx.proto @@ -17,8 +17,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Msg_UpdateParams_FullMethodName = "/cosmos.consensus.v1.Msg/UpdateParams" @@ -27,8 +27,10 @@ const ( // MsgClient is the client API for Msg service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Msg defines the consensus Msg service. type MsgClient interface { - // UpdateParams defines a governance operation for updating the x/consensus_param module parameters. + // UpdateParams defines a governance operation for updating the x/consensus module parameters. // The authority is defined in the keeper. // // Since: cosmos-sdk 0.47 @@ -44,8 +46,9 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { } func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -54,9 +57,11 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer -// for forward compatibility +// for forward compatibility. +// +// Msg defines the consensus Msg service. type MsgServer interface { - // UpdateParams defines a governance operation for updating the x/consensus_param module parameters. + // UpdateParams defines a governance operation for updating the x/consensus module parameters. // The authority is defined in the keeper. // // Since: cosmos-sdk 0.47 @@ -64,14 +69,18 @@ type MsgServer interface { mustEmbedUnimplementedMsgServer() } -// UnimplementedMsgServer must be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} +// UnimplementedMsgServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedMsgServer struct{} func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} +func (UnimplementedMsgServer) testEmbeddedByValue() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to MsgServer will @@ -81,6 +90,13 @@ type UnsafeMsgServer interface { } func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + // If the following call pancis, it indicates UnimplementedMsgServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Msg_ServiceDesc, srv) } diff --git a/api/cosmos/counter/module/v1/module.pulsar.go b/api/cosmos/counter/module/v1/module.pulsar.go new file mode 100644 index 000000000000..f6200b859cbd --- /dev/null +++ b/api/cosmos/counter/module/v1/module.pulsar.go @@ -0,0 +1,580 @@ +// 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 + fd_Module_authority protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_counter_module_v1_module_proto_init() + md_Module = File_cosmos_counter_module_v1_module_proto.Messages().ByName("Module") + fd_Module_authority = md_Module.Fields().ByName("authority") +} + +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_cosmos_counter_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) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_Module_authority, 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_Module) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.counter.module.v1.Module.authority": + return x.Authority != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.counter.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() { + case "cosmos.counter.module.v1.Module.authority": + x.Authority = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.counter.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() { + case "cosmos.counter.module.v1.Module.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.counter.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() { + case "cosmos.counter.module.v1.Module.authority": + x.Authority = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.counter.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() { + case "cosmos.counter.module.v1.Module.authority": + panic(fmt.Errorf("field authority of message cosmos.counter.module.v1.Module is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.counter.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() { + case "cosmos.counter.module.v1.Module.authority": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.counter.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 cosmos.counter.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 + l = len(x.Authority) + 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().(*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 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().(*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 { + 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 + 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: cosmos/counter/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 config object of the counter module. +type Module struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority defines the custom module authority. If not set, defaults to the governance module. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` +} + +func (x *Module) Reset() { + *x = Module{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_counter_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_cosmos_counter_module_v1_module_proto_rawDescGZIP(), []int{0} +} + +func (x *Module) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +var File_cosmos_counter_module_v1_module_proto protoreflect.FileDescriptor + +var file_cosmos_counter_module_v1_module_proto_rawDesc = []byte{ + 0x0a, 0x25, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, + 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x18, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 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, 0x5f, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x1c, 0x0a, + 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x37, 0xba, 0xc0, 0x96, + 0xda, 0x01, 0x31, 0x0a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, + 0x6b, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x75, 0x74, 0x69, 0x6c, 0x2f, 0x78, 0x2f, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x65, 0x72, 0x42, 0xe2, 0x01, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 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, 0x32, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, + 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x65, 0x72, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x4d, 0xaa, 0x02, + 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x2e, + 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x24, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x65, 0x72, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1b, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3a, 0x3a, 0x4d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_cosmos_counter_module_v1_module_proto_rawDescOnce sync.Once + file_cosmos_counter_module_v1_module_proto_rawDescData = file_cosmos_counter_module_v1_module_proto_rawDesc +) + +func file_cosmos_counter_module_v1_module_proto_rawDescGZIP() []byte { + file_cosmos_counter_module_v1_module_proto_rawDescOnce.Do(func() { + file_cosmos_counter_module_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_counter_module_v1_module_proto_rawDescData) + }) + return file_cosmos_counter_module_v1_module_proto_rawDescData +} + +var file_cosmos_counter_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cosmos_counter_module_v1_module_proto_goTypes = []interface{}{ + (*Module)(nil), // 0: cosmos.counter.module.v1.Module +} +var file_cosmos_counter_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_cosmos_counter_module_v1_module_proto_init() } +func file_cosmos_counter_module_v1_module_proto_init() { + if File_cosmos_counter_module_v1_module_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cosmos_counter_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_cosmos_counter_module_v1_module_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cosmos_counter_module_v1_module_proto_goTypes, + DependencyIndexes: file_cosmos_counter_module_v1_module_proto_depIdxs, + MessageInfos: file_cosmos_counter_module_v1_module_proto_msgTypes, + }.Build() + File_cosmos_counter_module_v1_module_proto = out.File + file_cosmos_counter_module_v1_module_proto_rawDesc = nil + file_cosmos_counter_module_v1_module_proto_goTypes = nil + file_cosmos_counter_module_v1_module_proto_depIdxs = nil +} diff --git a/api/cosmos/counter/v1/query.pulsar.go b/api/cosmos/counter/v1/query.pulsar.go new file mode 100644 index 000000000000..945f11547d65 --- /dev/null +++ b/api/cosmos/counter/v1/query.pulsar.go @@ -0,0 +1,959 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package counterv1 + +import ( + 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_QueryGetCountRequest protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_counter_v1_query_proto_init() + md_QueryGetCountRequest = File_cosmos_counter_v1_query_proto.Messages().ByName("QueryGetCountRequest") +} + +var _ protoreflect.Message = (*fastReflection_QueryGetCountRequest)(nil) + +type fastReflection_QueryGetCountRequest QueryGetCountRequest + +func (x *QueryGetCountRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryGetCountRequest)(x) +} + +func (x *QueryGetCountRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_counter_v1_query_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryGetCountRequest_messageType fastReflection_QueryGetCountRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryGetCountRequest_messageType{} + +type fastReflection_QueryGetCountRequest_messageType struct{} + +func (x fastReflection_QueryGetCountRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryGetCountRequest)(nil) +} +func (x fastReflection_QueryGetCountRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryGetCountRequest) +} +func (x fastReflection_QueryGetCountRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetCountRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryGetCountRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetCountRequest +} + +// 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_QueryGetCountRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryGetCountRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryGetCountRequest) New() protoreflect.Message { + return new(fastReflection_QueryGetCountRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryGetCountRequest) Interface() protoreflect.ProtoMessage { + return (*QueryGetCountRequest)(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_QueryGetCountRequest) 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_QueryGetCountRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.v1.QueryGetCountRequest")) + } + panic(fmt.Errorf("message cosmos.counter.v1.QueryGetCountRequest 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_QueryGetCountRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.v1.QueryGetCountRequest")) + } + panic(fmt.Errorf("message cosmos.counter.v1.QueryGetCountRequest 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_QueryGetCountRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.v1.QueryGetCountRequest")) + } + panic(fmt.Errorf("message cosmos.counter.v1.QueryGetCountRequest 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_QueryGetCountRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.v1.QueryGetCountRequest")) + } + panic(fmt.Errorf("message cosmos.counter.v1.QueryGetCountRequest 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_QueryGetCountRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.v1.QueryGetCountRequest")) + } + panic(fmt.Errorf("message cosmos.counter.v1.QueryGetCountRequest 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_QueryGetCountRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.v1.QueryGetCountRequest")) + } + panic(fmt.Errorf("message cosmos.counter.v1.QueryGetCountRequest 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_QueryGetCountRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.counter.v1.QueryGetCountRequest", 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_QueryGetCountRequest) 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_QueryGetCountRequest) 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_QueryGetCountRequest) 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_QueryGetCountRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryGetCountRequest) + 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().(*QueryGetCountRequest) + 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().(*QueryGetCountRequest) + 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: QueryGetCountRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetCountRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryGetCountResponse protoreflect.MessageDescriptor + fd_QueryGetCountResponse_total_count protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_counter_v1_query_proto_init() + md_QueryGetCountResponse = File_cosmos_counter_v1_query_proto.Messages().ByName("QueryGetCountResponse") + fd_QueryGetCountResponse_total_count = md_QueryGetCountResponse.Fields().ByName("total_count") +} + +var _ protoreflect.Message = (*fastReflection_QueryGetCountResponse)(nil) + +type fastReflection_QueryGetCountResponse QueryGetCountResponse + +func (x *QueryGetCountResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryGetCountResponse)(x) +} + +func (x *QueryGetCountResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_counter_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_QueryGetCountResponse_messageType fastReflection_QueryGetCountResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryGetCountResponse_messageType{} + +type fastReflection_QueryGetCountResponse_messageType struct{} + +func (x fastReflection_QueryGetCountResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryGetCountResponse)(nil) +} +func (x fastReflection_QueryGetCountResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryGetCountResponse) +} +func (x fastReflection_QueryGetCountResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetCountResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryGetCountResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetCountResponse +} + +// 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_QueryGetCountResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryGetCountResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryGetCountResponse) New() protoreflect.Message { + return new(fastReflection_QueryGetCountResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryGetCountResponse) Interface() protoreflect.ProtoMessage { + return (*QueryGetCountResponse)(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_QueryGetCountResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.TotalCount != int64(0) { + value := protoreflect.ValueOfInt64(x.TotalCount) + if !f(fd_QueryGetCountResponse_total_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_QueryGetCountResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.counter.v1.QueryGetCountResponse.total_count": + return x.TotalCount != int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.v1.QueryGetCountResponse")) + } + panic(fmt.Errorf("message cosmos.counter.v1.QueryGetCountResponse 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_QueryGetCountResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.counter.v1.QueryGetCountResponse.total_count": + x.TotalCount = int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.v1.QueryGetCountResponse")) + } + panic(fmt.Errorf("message cosmos.counter.v1.QueryGetCountResponse 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_QueryGetCountResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.counter.v1.QueryGetCountResponse.total_count": + value := x.TotalCount + return protoreflect.ValueOfInt64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.v1.QueryGetCountResponse")) + } + panic(fmt.Errorf("message cosmos.counter.v1.QueryGetCountResponse 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_QueryGetCountResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.counter.v1.QueryGetCountResponse.total_count": + x.TotalCount = value.Int() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.v1.QueryGetCountResponse")) + } + panic(fmt.Errorf("message cosmos.counter.v1.QueryGetCountResponse 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_QueryGetCountResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.counter.v1.QueryGetCountResponse.total_count": + panic(fmt.Errorf("field total_count of message cosmos.counter.v1.QueryGetCountResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.v1.QueryGetCountResponse")) + } + panic(fmt.Errorf("message cosmos.counter.v1.QueryGetCountResponse 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_QueryGetCountResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.counter.v1.QueryGetCountResponse.total_count": + return protoreflect.ValueOfInt64(int64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.v1.QueryGetCountResponse")) + } + panic(fmt.Errorf("message cosmos.counter.v1.QueryGetCountResponse 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_QueryGetCountResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.counter.v1.QueryGetCountResponse", 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_QueryGetCountResponse) 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_QueryGetCountResponse) 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_QueryGetCountResponse) 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_QueryGetCountResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryGetCountResponse) + 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.TotalCount != 0 { + n += 1 + runtime.Sov(uint64(x.TotalCount)) + } + 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().(*QueryGetCountResponse) + 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.TotalCount != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.TotalCount)) + 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().(*QueryGetCountResponse) + 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: QueryGetCountResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetCountResponse: 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 TotalCount", wireType) + } + x.TotalCount = 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.TotalCount |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cosmos/counter/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) +) + +// QueryGetCountRequest defines the request type for querying x/mock count. +type QueryGetCountRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryGetCountRequest) Reset() { + *x = QueryGetCountRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_counter_v1_query_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryGetCountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryGetCountRequest) ProtoMessage() {} + +// Deprecated: Use QueryGetCountRequest.ProtoReflect.Descriptor instead. +func (*QueryGetCountRequest) Descriptor() ([]byte, []int) { + return file_cosmos_counter_v1_query_proto_rawDescGZIP(), []int{0} +} + +// QueryGetCountResponse defines the response type for querying x/mock count. +type QueryGetCountResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TotalCount int64 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` +} + +func (x *QueryGetCountResponse) Reset() { + *x = QueryGetCountResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_counter_v1_query_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryGetCountResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryGetCountResponse) ProtoMessage() {} + +// Deprecated: Use QueryGetCountResponse.ProtoReflect.Descriptor instead. +func (*QueryGetCountResponse) Descriptor() ([]byte, []int) { + return file_cosmos_counter_v1_query_proto_rawDescGZIP(), []int{1} +} + +func (x *QueryGetCountResponse) GetTotalCount() int64 { + if x != nil { + return x.TotalCount + } + return 0 +} + +var File_cosmos_counter_v1_query_proto protoreflect.FileDescriptor + +var file_cosmos_counter_v1_query_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, + 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x11, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x2e, + 0x76, 0x31, 0x22, 0x16, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x38, 0x0a, 0x15, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x32, 0x66, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x5d, 0x0a, + 0x08, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xb7, 0x01, 0x0a, + 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, + 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, + 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x58, 0xaa, 0x02, 0x11, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x11, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x5c, 0x56, 0x31, + 0xe2, 0x02, 0x1d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, + 0x72, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x65, 0x72, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cosmos_counter_v1_query_proto_rawDescOnce sync.Once + file_cosmos_counter_v1_query_proto_rawDescData = file_cosmos_counter_v1_query_proto_rawDesc +) + +func file_cosmos_counter_v1_query_proto_rawDescGZIP() []byte { + file_cosmos_counter_v1_query_proto_rawDescOnce.Do(func() { + file_cosmos_counter_v1_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_counter_v1_query_proto_rawDescData) + }) + return file_cosmos_counter_v1_query_proto_rawDescData +} + +var file_cosmos_counter_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_cosmos_counter_v1_query_proto_goTypes = []interface{}{ + (*QueryGetCountRequest)(nil), // 0: cosmos.counter.v1.QueryGetCountRequest + (*QueryGetCountResponse)(nil), // 1: cosmos.counter.v1.QueryGetCountResponse +} +var file_cosmos_counter_v1_query_proto_depIdxs = []int32{ + 0, // 0: cosmos.counter.v1.Query.GetCount:input_type -> cosmos.counter.v1.QueryGetCountRequest + 1, // 1: cosmos.counter.v1.Query.GetCount:output_type -> cosmos.counter.v1.QueryGetCountResponse + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] 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_cosmos_counter_v1_query_proto_init() } +func file_cosmos_counter_v1_query_proto_init() { + if File_cosmos_counter_v1_query_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cosmos_counter_v1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryGetCountRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_counter_v1_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryGetCountResponse); 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_cosmos_counter_v1_query_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_cosmos_counter_v1_query_proto_goTypes, + DependencyIndexes: file_cosmos_counter_v1_query_proto_depIdxs, + MessageInfos: file_cosmos_counter_v1_query_proto_msgTypes, + }.Build() + File_cosmos_counter_v1_query_proto = out.File + file_cosmos_counter_v1_query_proto_rawDesc = nil + file_cosmos_counter_v1_query_proto_goTypes = nil + file_cosmos_counter_v1_query_proto_depIdxs = nil +} diff --git a/api/cosmos/counter/v1/query_grpc.pb.go b/api/cosmos/counter/v1/query_grpc.pb.go new file mode 100644 index 000000000000..831cea046dcf --- /dev/null +++ b/api/cosmos/counter/v1/query_grpc.pb.go @@ -0,0 +1,127 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc (unknown) +// source: cosmos/counter/v1/query.proto + +package counterv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Query_GetCount_FullMethodName = "/cosmos.counter.v1.Query/GetCount" +) + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Query defines the gRPC querier service. +type QueryClient interface { + // GetCount queries the parameters of x/Counter module. + GetCount(ctx context.Context, in *QueryGetCountRequest, opts ...grpc.CallOption) (*QueryGetCountResponse, error) +} + +type queryClient struct { + cc grpc.ClientConnInterface +} + +func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) GetCount(ctx context.Context, in *QueryGetCountRequest, opts ...grpc.CallOption) (*QueryGetCountResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryGetCountResponse) + err := c.cc.Invoke(ctx, Query_GetCount_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +// All implementations must embed UnimplementedQueryServer +// for forward compatibility. +// +// Query defines the gRPC querier service. +type QueryServer interface { + // GetCount queries the parameters of x/Counter module. + GetCount(context.Context, *QueryGetCountRequest) (*QueryGetCountResponse, error) + mustEmbedUnimplementedQueryServer() +} + +// UnimplementedQueryServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedQueryServer struct{} + +func (UnimplementedQueryServer) GetCount(context.Context, *QueryGetCountRequest) (*QueryGetCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetCount not implemented") +} +func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} +func (UnimplementedQueryServer) testEmbeddedByValue() {} + +// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to QueryServer will +// result in compilation errors. +type UnsafeQueryServer interface { + mustEmbedUnimplementedQueryServer() +} + +func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + // If the following call pancis, it indicates UnimplementedQueryServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&Query_ServiceDesc, srv) +} + +func _Query_GetCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetCountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).GetCount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_GetCount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).GetCount(ctx, req.(*QueryGetCountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Query_ServiceDesc is the grpc.ServiceDesc for Query service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Query_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.counter.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetCount", + Handler: _Query_GetCount_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/counter/v1/query.proto", +} diff --git a/api/cosmos/counter/v1/tx.pulsar.go b/api/cosmos/counter/v1/tx.pulsar.go new file mode 100644 index 000000000000..8ca3213e0e73 --- /dev/null +++ b/api/cosmos/counter/v1/tx.pulsar.go @@ -0,0 +1,1106 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package counterv1 + +import ( + _ "cosmossdk.io/api/amino" + _ "cosmossdk.io/api/cosmos/msg/v1" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + 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_MsgIncreaseCounter protoreflect.MessageDescriptor + fd_MsgIncreaseCounter_signer protoreflect.FieldDescriptor + fd_MsgIncreaseCounter_count protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_counter_v1_tx_proto_init() + md_MsgIncreaseCounter = File_cosmos_counter_v1_tx_proto.Messages().ByName("MsgIncreaseCounter") + fd_MsgIncreaseCounter_signer = md_MsgIncreaseCounter.Fields().ByName("signer") + fd_MsgIncreaseCounter_count = md_MsgIncreaseCounter.Fields().ByName("count") +} + +var _ protoreflect.Message = (*fastReflection_MsgIncreaseCounter)(nil) + +type fastReflection_MsgIncreaseCounter MsgIncreaseCounter + +func (x *MsgIncreaseCounter) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgIncreaseCounter)(x) +} + +func (x *MsgIncreaseCounter) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_counter_v1_tx_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgIncreaseCounter_messageType fastReflection_MsgIncreaseCounter_messageType +var _ protoreflect.MessageType = fastReflection_MsgIncreaseCounter_messageType{} + +type fastReflection_MsgIncreaseCounter_messageType struct{} + +func (x fastReflection_MsgIncreaseCounter_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgIncreaseCounter)(nil) +} +func (x fastReflection_MsgIncreaseCounter_messageType) New() protoreflect.Message { + return new(fastReflection_MsgIncreaseCounter) +} +func (x fastReflection_MsgIncreaseCounter_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgIncreaseCounter +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgIncreaseCounter) Descriptor() protoreflect.MessageDescriptor { + return md_MsgIncreaseCounter +} + +// 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_MsgIncreaseCounter) Type() protoreflect.MessageType { + return _fastReflection_MsgIncreaseCounter_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgIncreaseCounter) New() protoreflect.Message { + return new(fastReflection_MsgIncreaseCounter) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgIncreaseCounter) Interface() protoreflect.ProtoMessage { + return (*MsgIncreaseCounter)(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_MsgIncreaseCounter) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Signer != "" { + value := protoreflect.ValueOfString(x.Signer) + if !f(fd_MsgIncreaseCounter_signer, value) { + return + } + } + if x.Count != int64(0) { + value := protoreflect.ValueOfInt64(x.Count) + if !f(fd_MsgIncreaseCounter_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_MsgIncreaseCounter) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.counter.v1.MsgIncreaseCounter.signer": + return x.Signer != "" + case "cosmos.counter.v1.MsgIncreaseCounter.count": + return x.Count != int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.v1.MsgIncreaseCounter")) + } + panic(fmt.Errorf("message cosmos.counter.v1.MsgIncreaseCounter 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_MsgIncreaseCounter) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.counter.v1.MsgIncreaseCounter.signer": + x.Signer = "" + case "cosmos.counter.v1.MsgIncreaseCounter.count": + x.Count = int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.v1.MsgIncreaseCounter")) + } + panic(fmt.Errorf("message cosmos.counter.v1.MsgIncreaseCounter 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_MsgIncreaseCounter) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.counter.v1.MsgIncreaseCounter.signer": + value := x.Signer + return protoreflect.ValueOfString(value) + case "cosmos.counter.v1.MsgIncreaseCounter.count": + value := x.Count + return protoreflect.ValueOfInt64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.v1.MsgIncreaseCounter")) + } + panic(fmt.Errorf("message cosmos.counter.v1.MsgIncreaseCounter 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_MsgIncreaseCounter) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.counter.v1.MsgIncreaseCounter.signer": + x.Signer = value.Interface().(string) + case "cosmos.counter.v1.MsgIncreaseCounter.count": + x.Count = value.Int() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.v1.MsgIncreaseCounter")) + } + panic(fmt.Errorf("message cosmos.counter.v1.MsgIncreaseCounter 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_MsgIncreaseCounter) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.counter.v1.MsgIncreaseCounter.signer": + panic(fmt.Errorf("field signer of message cosmos.counter.v1.MsgIncreaseCounter is not mutable")) + case "cosmos.counter.v1.MsgIncreaseCounter.count": + panic(fmt.Errorf("field count of message cosmos.counter.v1.MsgIncreaseCounter is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.v1.MsgIncreaseCounter")) + } + panic(fmt.Errorf("message cosmos.counter.v1.MsgIncreaseCounter 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_MsgIncreaseCounter) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.counter.v1.MsgIncreaseCounter.signer": + return protoreflect.ValueOfString("") + case "cosmos.counter.v1.MsgIncreaseCounter.count": + return protoreflect.ValueOfInt64(int64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.v1.MsgIncreaseCounter")) + } + panic(fmt.Errorf("message cosmos.counter.v1.MsgIncreaseCounter 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_MsgIncreaseCounter) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.counter.v1.MsgIncreaseCounter", 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_MsgIncreaseCounter) 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_MsgIncreaseCounter) 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_MsgIncreaseCounter) 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_MsgIncreaseCounter) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgIncreaseCounter) + 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.Signer) + 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().(*MsgIncreaseCounter) + 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] = 0x10 + } + if len(x.Signer) > 0 { + i -= len(x.Signer) + copy(dAtA[i:], x.Signer) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Signer))) + 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().(*MsgIncreaseCounter) + 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: MsgIncreaseCounter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgIncreaseCounter: 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 Signer", 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.Signer = 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 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 |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgIncreaseCountResponse protoreflect.MessageDescriptor + fd_MsgIncreaseCountResponse_new_count protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_counter_v1_tx_proto_init() + md_MsgIncreaseCountResponse = File_cosmos_counter_v1_tx_proto.Messages().ByName("MsgIncreaseCountResponse") + fd_MsgIncreaseCountResponse_new_count = md_MsgIncreaseCountResponse.Fields().ByName("new_count") +} + +var _ protoreflect.Message = (*fastReflection_MsgIncreaseCountResponse)(nil) + +type fastReflection_MsgIncreaseCountResponse MsgIncreaseCountResponse + +func (x *MsgIncreaseCountResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgIncreaseCountResponse)(x) +} + +func (x *MsgIncreaseCountResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_counter_v1_tx_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgIncreaseCountResponse_messageType fastReflection_MsgIncreaseCountResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgIncreaseCountResponse_messageType{} + +type fastReflection_MsgIncreaseCountResponse_messageType struct{} + +func (x fastReflection_MsgIncreaseCountResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgIncreaseCountResponse)(nil) +} +func (x fastReflection_MsgIncreaseCountResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgIncreaseCountResponse) +} +func (x fastReflection_MsgIncreaseCountResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgIncreaseCountResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgIncreaseCountResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgIncreaseCountResponse +} + +// 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_MsgIncreaseCountResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgIncreaseCountResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgIncreaseCountResponse) New() protoreflect.Message { + return new(fastReflection_MsgIncreaseCountResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgIncreaseCountResponse) Interface() protoreflect.ProtoMessage { + return (*MsgIncreaseCountResponse)(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_MsgIncreaseCountResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.NewCount != int64(0) { + value := protoreflect.ValueOfInt64(x.NewCount) + if !f(fd_MsgIncreaseCountResponse_new_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_MsgIncreaseCountResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.counter.v1.MsgIncreaseCountResponse.new_count": + return x.NewCount != int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.v1.MsgIncreaseCountResponse")) + } + panic(fmt.Errorf("message cosmos.counter.v1.MsgIncreaseCountResponse 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_MsgIncreaseCountResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.counter.v1.MsgIncreaseCountResponse.new_count": + x.NewCount = int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.v1.MsgIncreaseCountResponse")) + } + panic(fmt.Errorf("message cosmos.counter.v1.MsgIncreaseCountResponse 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_MsgIncreaseCountResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.counter.v1.MsgIncreaseCountResponse.new_count": + value := x.NewCount + return protoreflect.ValueOfInt64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.v1.MsgIncreaseCountResponse")) + } + panic(fmt.Errorf("message cosmos.counter.v1.MsgIncreaseCountResponse 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_MsgIncreaseCountResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.counter.v1.MsgIncreaseCountResponse.new_count": + x.NewCount = value.Int() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.v1.MsgIncreaseCountResponse")) + } + panic(fmt.Errorf("message cosmos.counter.v1.MsgIncreaseCountResponse 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_MsgIncreaseCountResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.counter.v1.MsgIncreaseCountResponse.new_count": + panic(fmt.Errorf("field new_count of message cosmos.counter.v1.MsgIncreaseCountResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.v1.MsgIncreaseCountResponse")) + } + panic(fmt.Errorf("message cosmos.counter.v1.MsgIncreaseCountResponse 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_MsgIncreaseCountResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.counter.v1.MsgIncreaseCountResponse.new_count": + return protoreflect.ValueOfInt64(int64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.v1.MsgIncreaseCountResponse")) + } + panic(fmt.Errorf("message cosmos.counter.v1.MsgIncreaseCountResponse 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_MsgIncreaseCountResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.counter.v1.MsgIncreaseCountResponse", 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_MsgIncreaseCountResponse) 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_MsgIncreaseCountResponse) 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_MsgIncreaseCountResponse) 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_MsgIncreaseCountResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgIncreaseCountResponse) + 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.NewCount != 0 { + n += 1 + runtime.Sov(uint64(x.NewCount)) + } + 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().(*MsgIncreaseCountResponse) + 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.NewCount != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.NewCount)) + 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().(*MsgIncreaseCountResponse) + 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: MsgIncreaseCountResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgIncreaseCountResponse: 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 NewCount", wireType) + } + x.NewCount = 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.NewCount |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cosmos/counter/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) +) + +// MsgIncreaseCounter defines a count Msg service counter. +type MsgIncreaseCounter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // signer is the address that controls the module (defaults to x/gov unless overwritten). + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` + // count is the number of times to increment the counter. + Count int64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *MsgIncreaseCounter) Reset() { + *x = MsgIncreaseCounter{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_counter_v1_tx_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgIncreaseCounter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgIncreaseCounter) ProtoMessage() {} + +// Deprecated: Use MsgIncreaseCounter.ProtoReflect.Descriptor instead. +func (*MsgIncreaseCounter) Descriptor() ([]byte, []int) { + return file_cosmos_counter_v1_tx_proto_rawDescGZIP(), []int{0} +} + +func (x *MsgIncreaseCounter) GetSigner() string { + if x != nil { + return x.Signer + } + return "" +} + +func (x *MsgIncreaseCounter) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +// MsgIncreaseCountResponse is the Msg/Counter response type. +type MsgIncreaseCountResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // new_count is the number of times the counter was incremented. + NewCount int64 `protobuf:"varint,1,opt,name=new_count,json=newCount,proto3" json:"new_count,omitempty"` +} + +func (x *MsgIncreaseCountResponse) Reset() { + *x = MsgIncreaseCountResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_counter_v1_tx_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgIncreaseCountResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgIncreaseCountResponse) ProtoMessage() {} + +// Deprecated: Use MsgIncreaseCountResponse.ProtoReflect.Descriptor instead. +func (*MsgIncreaseCountResponse) Descriptor() ([]byte, []int) { + return file_cosmos_counter_v1_tx_proto_rawDescGZIP(), []int{1} +} + +func (x *MsgIncreaseCountResponse) GetNewCount() int64 { + if x != nil { + return x.NewCount + } + return 0 +} + +var File_cosmos_counter_v1_tx_proto protoreflect.FileDescriptor + +var file_cosmos_counter_v1_tx_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, + 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 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, 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, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x89, 0x01, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x49, 0x6e, + 0x63, 0x72, 0x65, 0x61, 0x73, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x30, 0x0a, + 0x06, 0x73, 0x69, 0x67, 0x6e, 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, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, + 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x2b, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x69, 0x67, 0x6e, + 0x65, 0x72, 0x8a, 0xe7, 0xb0, 0x2a, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, + 0x6b, 0x2f, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x65, 0x72, 0x22, 0x37, 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x61, 0x73, + 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, + 0x0a, 0x09, 0x6e, 0x65, 0x77, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x08, 0x6e, 0x65, 0x77, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x32, 0x71, 0x0a, 0x03, 0x4d, + 0x73, 0x67, 0x12, 0x63, 0x0a, 0x0d, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x61, 0x73, 0x65, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x12, 0x25, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x49, 0x6e, 0x63, 0x72, 0x65, + 0x61, 0x73, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x1a, 0x2b, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, + 0x73, 0x67, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x61, 0x73, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xb4, + 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x2c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, + 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x76, + 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x58, 0xaa, 0x02, 0x11, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x11, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x5c, 0x56, 0x31, 0xe2, + 0x02, 0x1d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, + 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, + 0x72, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cosmos_counter_v1_tx_proto_rawDescOnce sync.Once + file_cosmos_counter_v1_tx_proto_rawDescData = file_cosmos_counter_v1_tx_proto_rawDesc +) + +func file_cosmos_counter_v1_tx_proto_rawDescGZIP() []byte { + file_cosmos_counter_v1_tx_proto_rawDescOnce.Do(func() { + file_cosmos_counter_v1_tx_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_counter_v1_tx_proto_rawDescData) + }) + return file_cosmos_counter_v1_tx_proto_rawDescData +} + +var file_cosmos_counter_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_cosmos_counter_v1_tx_proto_goTypes = []interface{}{ + (*MsgIncreaseCounter)(nil), // 0: cosmos.counter.v1.MsgIncreaseCounter + (*MsgIncreaseCountResponse)(nil), // 1: cosmos.counter.v1.MsgIncreaseCountResponse +} +var file_cosmos_counter_v1_tx_proto_depIdxs = []int32{ + 0, // 0: cosmos.counter.v1.Msg.IncreaseCount:input_type -> cosmos.counter.v1.MsgIncreaseCounter + 1, // 1: cosmos.counter.v1.Msg.IncreaseCount:output_type -> cosmos.counter.v1.MsgIncreaseCountResponse + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] 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_cosmos_counter_v1_tx_proto_init() } +func file_cosmos_counter_v1_tx_proto_init() { + if File_cosmos_counter_v1_tx_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cosmos_counter_v1_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgIncreaseCounter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_counter_v1_tx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgIncreaseCountResponse); 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_cosmos_counter_v1_tx_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_cosmos_counter_v1_tx_proto_goTypes, + DependencyIndexes: file_cosmos_counter_v1_tx_proto_depIdxs, + MessageInfos: file_cosmos_counter_v1_tx_proto_msgTypes, + }.Build() + File_cosmos_counter_v1_tx_proto = out.File + file_cosmos_counter_v1_tx_proto_rawDesc = nil + file_cosmos_counter_v1_tx_proto_goTypes = nil + file_cosmos_counter_v1_tx_proto_depIdxs = nil +} diff --git a/api/cosmos/counter/v1/tx_grpc.pb.go b/api/cosmos/counter/v1/tx_grpc.pb.go new file mode 100644 index 000000000000..ee71c2d46adb --- /dev/null +++ b/api/cosmos/counter/v1/tx_grpc.pb.go @@ -0,0 +1,127 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc (unknown) +// source: cosmos/counter/v1/tx.proto + +package counterv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Msg_IncreaseCount_FullMethodName = "/cosmos.counter.v1.Msg/IncreaseCount" +) + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Msg defines the counter Msg service. +type MsgClient interface { + // IncreaseCount increments the counter by the specified amount. + IncreaseCount(ctx context.Context, in *MsgIncreaseCounter, opts ...grpc.CallOption) (*MsgIncreaseCountResponse, error) +} + +type msgClient struct { + cc grpc.ClientConnInterface +} + +func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) IncreaseCount(ctx context.Context, in *MsgIncreaseCounter, opts ...grpc.CallOption) (*MsgIncreaseCountResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgIncreaseCountResponse) + err := c.cc.Invoke(ctx, Msg_IncreaseCount_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +// All implementations must embed UnimplementedMsgServer +// for forward compatibility. +// +// Msg defines the counter Msg service. +type MsgServer interface { + // IncreaseCount increments the counter by the specified amount. + IncreaseCount(context.Context, *MsgIncreaseCounter) (*MsgIncreaseCountResponse, error) + mustEmbedUnimplementedMsgServer() +} + +// UnimplementedMsgServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedMsgServer struct{} + +func (UnimplementedMsgServer) IncreaseCount(context.Context, *MsgIncreaseCounter) (*MsgIncreaseCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method IncreaseCount not implemented") +} +func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} +func (UnimplementedMsgServer) testEmbeddedByValue() {} + +// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MsgServer will +// result in compilation errors. +type UnsafeMsgServer interface { + mustEmbedUnimplementedMsgServer() +} + +func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + // If the following call pancis, it indicates UnimplementedMsgServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&Msg_ServiceDesc, srv) +} + +func _Msg_IncreaseCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgIncreaseCounter) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).IncreaseCount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_IncreaseCount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).IncreaseCount(ctx, req.(*MsgIncreaseCounter)) + } + return interceptor(ctx, in, info, handler) +} + +// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Msg_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.counter.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "IncreaseCount", + Handler: _Msg_IncreaseCount_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/counter/v1/tx.proto", +} diff --git a/api/cosmos/crisis/v1beta1/tx_grpc.pb.go b/api/cosmos/crisis/v1beta1/tx_grpc.pb.go index 069a41944d0b..15483e4bb773 100644 --- a/api/cosmos/crisis/v1beta1/tx_grpc.pb.go +++ b/api/cosmos/crisis/v1beta1/tx_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/crisis/v1beta1/tx.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Msg_VerifyInvariant_FullMethodName = "/cosmos.crisis.v1beta1.Msg/VerifyInvariant" @@ -26,6 +26,8 @@ const ( // MsgClient is the client API for Msg service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Msg defines the bank Msg service. type MsgClient interface { // VerifyInvariant defines a method to verify a particular invariant. VerifyInvariant(ctx context.Context, in *MsgVerifyInvariant, opts ...grpc.CallOption) (*MsgVerifyInvariantResponse, error) @@ -45,8 +47,9 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { } func (c *msgClient) VerifyInvariant(ctx context.Context, in *MsgVerifyInvariant, opts ...grpc.CallOption) (*MsgVerifyInvariantResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgVerifyInvariantResponse) - err := c.cc.Invoke(ctx, Msg_VerifyInvariant_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_VerifyInvariant_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -54,8 +57,9 @@ func (c *msgClient) VerifyInvariant(ctx context.Context, in *MsgVerifyInvariant, } func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -64,7 +68,9 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer -// for forward compatibility +// for forward compatibility. +// +// Msg defines the bank Msg service. type MsgServer interface { // VerifyInvariant defines a method to verify a particular invariant. VerifyInvariant(context.Context, *MsgVerifyInvariant) (*MsgVerifyInvariantResponse, error) @@ -76,9 +82,12 @@ type MsgServer interface { mustEmbedUnimplementedMsgServer() } -// UnimplementedMsgServer must be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} +// UnimplementedMsgServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedMsgServer struct{} func (UnimplementedMsgServer) VerifyInvariant(context.Context, *MsgVerifyInvariant) (*MsgVerifyInvariantResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method VerifyInvariant not implemented") @@ -87,6 +96,7 @@ func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (* return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} +func (UnimplementedMsgServer) testEmbeddedByValue() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to MsgServer will @@ -96,6 +106,13 @@ type UnsafeMsgServer interface { } func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + // If the following call pancis, it indicates UnimplementedMsgServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Msg_ServiceDesc, srv) } diff --git a/api/cosmos/crypto/hd/v1/hd.pulsar.go b/api/cosmos/crypto/hd/v1/hd.pulsar.go index 2ddd2b875dc0..fdeef2e144cc 100644 --- a/api/cosmos/crypto/hd/v1/hd.pulsar.go +++ b/api/cosmos/crypto/hd/v1/hd.pulsar.go @@ -726,19 +726,19 @@ var file_cosmos_crypto_hd_v1_hd_proto_rawDesc = []byte{ 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x3a, 0x23, 0x98, 0xa0, 0x1f, 0x00, 0x8a, 0xe7, 0xb0, 0x2a, 0x1a, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2f, 0x6b, 0x65, 0x79, 0x73, 0x2f, 0x68, 0x64, 0x2f, 0x42, 0x49, 0x50, 0x34, 0x34, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, - 0xc0, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, - 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x68, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x48, 0x64, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x29, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, - 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, - 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2f, 0x68, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x68, 0x64, 0x76, - 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x48, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x48, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, - 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5c, 0x48, 0x64, - 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x72, 0x79, - 0x70, 0x74, 0x6f, 0x5c, 0x48, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, - 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x3a, 0x3a, 0x48, 0x64, 0x3a, 0x3a, 0x56, 0x31, 0xc8, 0xe1, - 0x1e, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0xc0, 0x01, 0xc8, 0xe1, 0x1e, 0x00, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x68, 0x64, 0x2e, 0x76, 0x31, 0x42, + 0x07, 0x48, 0x64, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x29, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2f, 0x68, 0x64, 0x2f, 0x76, 0x31, + 0x3b, 0x68, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x48, 0xaa, 0x02, 0x13, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x48, 0x64, 0x2e, 0x56, + 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x72, 0x79, 0x70, 0x74, + 0x6f, 0x5c, 0x48, 0x64, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x5c, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5c, 0x48, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x3a, 0x3a, 0x48, 0x64, 0x3a, 0x3a, + 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/crypto/keyring/v1/record.pulsar.go b/api/cosmos/crypto/keyring/v1/record.pulsar.go index 8c04e58545f4..2be7a9adfd8b 100644 --- a/api/cosmos/crypto/keyring/v1/record.pulsar.go +++ b/api/cosmos/crypto/keyring/v1/record.pulsar.go @@ -2833,21 +2833,21 @@ var file_cosmos_crypto_keyring_v1_record_proto_rawDesc = []byte{ 0x42, 0x49, 0x50, 0x34, 0x34, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x1a, 0x07, 0x0a, 0x05, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x1a, 0x09, 0x0a, 0x07, 0x4f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x42, 0xeb, 0x01, - 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x72, 0x79, - 0x70, 0x74, 0x6f, 0x2e, 0x6b, 0x65, 0x79, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x42, 0x0b, - 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x33, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2f, 0x6b, 0x65, - 0x79, 0x72, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x3b, 0x6b, 0x65, 0x79, 0x72, 0x69, 0x6e, 0x67, - 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x4b, 0xaa, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x4b, 0x65, 0x79, 0x72, 0x69, 0x6e, 0x67, - 0x2e, 0x56, 0x31, 0xca, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x72, 0x79, - 0x70, 0x74, 0x6f, 0x5c, 0x4b, 0x65, 0x79, 0x72, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0xe2, 0x02, - 0x24, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5c, 0x4b, - 0x65, 0x79, 0x72, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, - 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x3a, 0x3a, 0x4b, 0x65, 0x79, 0x72, 0x69, 0x6e, 0x67, 0x3a, - 0x3a, 0x56, 0x31, 0xc8, 0xe1, 0x1e, 0x00, 0x98, 0xe3, 0x1e, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0xc8, 0xe1, 0x1e, 0x00, 0x98, 0xe3, 0x1e, 0x00, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x6b, 0x65, 0x79, 0x72, + 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x33, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, + 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, + 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2f, 0x6b, 0x65, 0x79, 0x72, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, + 0x3b, 0x6b, 0x65, 0x79, 0x72, 0x69, 0x6e, 0x67, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x4b, + 0xaa, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, + 0x2e, 0x4b, 0x65, 0x79, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x18, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5c, 0x4b, 0x65, 0x79, 0x72, + 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x24, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, + 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5c, 0x4b, 0x65, 0x79, 0x72, 0x69, 0x6e, 0x67, 0x5c, 0x56, + 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1b, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x3a, 0x3a, + 0x4b, 0x65, 0x79, 0x72, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } diff --git a/api/cosmos/crypto/secp256r1/keys.pulsar.go b/api/cosmos/crypto/secp256r1/keys.pulsar.go index 02f122b0a878..b57f4307fa47 100644 --- a/api/cosmos/crypto/secp256r1/keys.pulsar.go +++ b/api/cosmos/crypto/secp256r1/keys.pulsar.go @@ -960,21 +960,21 @@ var file_cosmos_crypto_secp256r1_keys_proto_rawDesc = []byte{ 0x65, 0x63, 0x64, 0x73, 0x61, 0x50, 0x4b, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x2e, 0x0a, 0x07, 0x50, 0x72, 0x69, 0x76, 0x4b, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0b, 0xda, 0xde, 0x1f, 0x07, 0x65, 0x63, 0x64, - 0x73, 0x61, 0x53, 0x4b, 0x52, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x42, 0xdc, 0x01, 0x0a, - 0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x72, 0x79, 0x70, - 0x74, 0x6f, 0x2e, 0x73, 0x65, 0x63, 0x70, 0x32, 0x35, 0x36, 0x72, 0x31, 0x42, 0x09, 0x4b, 0x65, - 0x79, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x28, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2f, 0x73, 0x65, 0x63, 0x70, 0x32, 0x35, - 0x36, 0x72, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x53, 0xaa, 0x02, 0x17, 0x43, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x53, 0x65, 0x63, 0x70, 0x32, 0x35, - 0x36, 0x72, 0x31, 0xca, 0x02, 0x17, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x72, 0x79, - 0x70, 0x74, 0x6f, 0x5c, 0x53, 0x65, 0x63, 0x70, 0x32, 0x35, 0x36, 0x72, 0x31, 0xe2, 0x02, 0x23, - 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5c, 0x53, 0x65, - 0x63, 0x70, 0x32, 0x35, 0x36, 0x72, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x19, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x72, - 0x79, 0x70, 0x74, 0x6f, 0x3a, 0x3a, 0x53, 0x65, 0x63, 0x70, 0x32, 0x35, 0x36, 0x72, 0x31, 0xc8, - 0xe1, 0x1e, 0x00, 0xd8, 0xe1, 0x1e, 0x00, 0xc8, 0xe3, 0x1e, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x73, 0x61, 0x53, 0x4b, 0x52, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x42, 0xdc, 0x01, 0xc8, + 0xe1, 0x1e, 0x00, 0xd8, 0xe1, 0x1e, 0x00, 0xc8, 0xe3, 0x1e, 0x01, 0x0a, 0x1b, 0x63, 0x6f, 0x6d, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x73, + 0x65, 0x63, 0x70, 0x32, 0x35, 0x36, 0x72, 0x31, 0x42, 0x09, 0x4b, 0x65, 0x79, 0x73, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x28, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, + 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, + 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2f, 0x73, 0x65, 0x63, 0x70, 0x32, 0x35, 0x36, 0x72, 0x31, 0xa2, + 0x02, 0x03, 0x43, 0x43, 0x53, 0xaa, 0x02, 0x17, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x43, + 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x53, 0x65, 0x63, 0x70, 0x32, 0x35, 0x36, 0x72, 0x31, 0xca, + 0x02, 0x17, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5c, + 0x53, 0x65, 0x63, 0x70, 0x32, 0x35, 0x36, 0x72, 0x31, 0xe2, 0x02, 0x23, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x5c, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5c, 0x53, 0x65, 0x63, 0x70, 0x32, 0x35, + 0x36, 0x72, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x19, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, + 0x3a, 0x3a, 0x53, 0x65, 0x63, 0x70, 0x32, 0x35, 0x36, 0x72, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } diff --git a/api/cosmos/distribution/v1beta1/distribution.pulsar.go b/api/cosmos/distribution/v1beta1/distribution.pulsar.go index b28523058ae7..cac130aaf3a9 100644 --- a/api/cosmos/distribution/v1beta1/distribution.pulsar.go +++ b/api/cosmos/distribution/v1beta1/distribution.pulsar.go @@ -7214,181 +7214,178 @@ var file_cosmos_distribution_v1beta1_distribution_proto_rawDesc = []byte{ 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, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0xbb, 0x03, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x66, 0x0a, 0x0d, + 0x6f, 0x22, 0x9a, 0x03, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x5b, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x5f, 0x74, 0x61, 0x78, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x41, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, - 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, - 0x79, 0x54, 0x61, 0x78, 0x12, 0x75, 0x0a, 0x14, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x70, 0x72, 0x6f, - 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x43, 0x18, 0x01, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, - 0x65, 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x12, 0x62, 0x61, 0x73, 0x65, 0x50, 0x72, 0x6f, - 0x70, 0x6f, 0x73, 0x65, 0x72, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x77, 0x0a, 0x15, 0x62, - 0x6f, 0x6e, 0x75, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x72, 0x65, - 0x77, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x43, 0x18, 0x01, 0xc8, 0xde, - 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, - 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, - 0x13, 0x62, 0x6f, 0x6e, 0x75, 0x73, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x52, 0x65, - 0x77, 0x61, 0x72, 0x64, 0x12, 0x32, 0x0a, 0x15, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, - 0x5f, 0x61, 0x64, 0x64, 0x72, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x13, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x41, 0x64, 0x64, - 0x72, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3a, 0x25, 0x8a, 0xe7, 0xb0, 0x2a, 0x20, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, 0x64, 0x69, 0x73, 0x74, - 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, - 0xd6, 0x01, 0x0a, 0x1a, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x48, 0x69, 0x73, - 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x12, 0x8e, - 0x01, 0x0a, 0x17, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x72, 0x65, - 0x77, 0x61, 0x72, 0x64, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x63, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x38, - 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x43, 0x6f, - 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x15, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, - 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x12, - 0x27, 0x0a, 0x0f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x5f, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0e, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, - 0x6e, 0x63, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xa3, 0x01, 0x0a, 0x17, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x77, - 0x61, 0x72, 0x64, 0x73, 0x12, 0x70, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, - 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x63, 0x43, - 0x6f, 0x69, 0x6e, 0x42, 0x38, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x2b, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x44, 0x65, 0x63, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x07, 0x72, - 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x22, 0x98, - 0x01, 0x0a, 0x1e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x63, 0x63, 0x75, - 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x12, 0x76, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, - 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x63, 0x43, - 0x6f, 0x69, 0x6e, 0x42, 0x38, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x2b, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x44, 0x65, 0x63, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x63, - 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x8f, 0x01, 0x0a, 0x1b, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x4f, 0x75, 0x74, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x69, - 0x6e, 0x67, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x12, 0x70, 0x0a, 0x07, 0x72, 0x65, 0x77, - 0x61, 0x72, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x44, 0x65, 0x63, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x38, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, - 0x1f, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, - 0x2a, 0x01, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x22, 0x9a, 0x01, 0x0a, 0x13, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x58, - 0x0a, 0x08, 0x66, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x3c, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x63, - 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x08, - 0x66, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x89, 0x01, 0x0a, 0x14, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x73, 0x12, 0x71, 0x0a, 0x16, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x73, - 0x6c, 0x61, 0x73, 0x68, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x14, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x73, 0x22, 0x88, 0x01, 0x0a, 0x07, 0x46, 0x65, 0x65, 0x50, 0x6f, 0x6f, 0x6c, - 0x12, 0x7d, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x5f, 0x70, 0x6f, - 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, - 0x65, 0x63, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x38, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x2b, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, - 0x52, 0x0d, 0x63, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x22, - 0x97, 0x02, 0x0a, 0x1a, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, - 0x6c, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x14, - 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, - 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, - 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, - 0x69, 0x65, 0x6e, 0x74, 0x12, 0x79, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, - 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, - 0x46, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, - 0x73, 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, - 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, - 0x28, 0x18, 0x01, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0xca, 0xb4, 0x2d, 0x1a, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0xdf, 0x01, 0x0a, 0x15, 0x44, 0x65, - 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x49, - 0x6e, 0x66, 0x6f, 0x12, 0x27, 0x0a, 0x0f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, - 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x70, 0x72, - 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x57, 0x0a, 0x05, - 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x41, 0xc8, 0xde, 0x1f, - 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, - 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x05, - 0x73, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x44, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x2c, 0xea, 0xde, 0x1f, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0xa2, 0xe7, 0xb0, 0x2a, 0x0f, 0x63, - 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0xa8, 0xe7, - 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0xe1, 0x01, 0x0a, 0x19, - 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, - 0x74, 0x6f, 0x72, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x4e, 0x0a, 0x11, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x6e, 0x0a, 0x06, 0x72, 0x65, 0x77, - 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x01, 0x28, 0x09, 0x42, 0x36, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, + 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0c, 0x63, 0x6f, 0x6d, + 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x54, 0x61, 0x78, 0x12, 0x6a, 0x0a, 0x14, 0x62, 0x61, 0x73, + 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x38, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, + 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, + 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x18, + 0x01, 0x52, 0x12, 0x62, 0x61, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x6c, 0x0a, 0x15, 0x62, 0x6f, 0x6e, 0x75, 0x73, 0x5f, 0x70, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x38, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, + 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x18, 0x01, 0x52, 0x13, + 0x62, 0x6f, 0x6e, 0x75, 0x73, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x52, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x12, 0x32, 0x0a, 0x15, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x5f, + 0x61, 0x64, 0x64, 0x72, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x13, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x41, 0x64, 0x64, 0x72, + 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3a, 0x25, 0x8a, 0xe7, 0xb0, 0x2a, 0x20, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, 0x64, 0x69, 0x73, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xd6, + 0x01, 0x0a, 0x1a, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x48, 0x69, 0x73, 0x74, + 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x12, 0x8e, 0x01, + 0x0a, 0x17, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x63, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x38, 0xc8, + 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, + 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x43, 0x6f, 0x69, + 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x15, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, + 0x69, 0x76, 0x65, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x12, 0x27, + 0x0a, 0x0f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0e, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, + 0x63, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xa3, 0x01, 0x0a, 0x17, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x73, 0x12, 0x70, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, + 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x63, 0x43, 0x6f, + 0x69, 0x6e, 0x42, 0x38, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x2b, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, + 0x65, 0x63, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x07, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x22, 0x98, 0x01, + 0x0a, 0x1e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x63, 0x63, 0x75, 0x6d, + 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x12, 0x76, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, + 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x63, 0x43, 0x6f, + 0x69, 0x6e, 0x42, 0x38, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x2b, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, + 0x65, 0x63, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x63, 0x6f, + 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x8f, 0x01, 0x0a, 0x1b, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x4f, 0x75, 0x74, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x69, 0x6e, + 0x67, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x12, 0x70, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x63, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x38, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, - 0x01, 0x52, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x22, - 0xd3, 0x01, 0x0a, 0x25, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, - 0x6c, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x57, 0x69, - 0x74, 0x68, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, - 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, - 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, - 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x3a, 0x22, 0x88, 0xa0, 0x1f, 0x00, 0xca, 0xb4, 0x2d, 0x1a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x42, 0x88, 0x02, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x11, 0x44, 0x69, 0x73, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x40, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, - 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x64, 0x69, 0x73, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0xa2, 0x02, 0x03, 0x43, 0x44, 0x58, 0xaa, 0x02, 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x44, 0x69, - 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0xe2, 0x02, 0x27, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x44, 0x69, 0x73, 0x74, - 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1d, 0x43, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x69, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa8, 0xe2, 0x1e, 0x01, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x01, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x22, 0x8f, 0x01, 0x0a, 0x13, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, + 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x4d, 0x0a, + 0x08, 0x66, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, + 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, + 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, + 0x65, 0x63, 0x52, 0x08, 0x66, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x89, 0x01, 0x0a, + 0x14, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x71, 0x0a, 0x16, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x5f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, + 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x6c, 0x61, + 0x73, 0x68, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, + 0x2a, 0x01, 0x52, 0x14, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x6c, 0x61, + 0x73, 0x68, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x88, 0x01, 0x0a, 0x07, 0x46, 0x65, 0x65, + 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x7d, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, + 0x79, 0x5f, 0x70, 0x6f, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x44, 0x65, 0x63, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x38, 0xc8, 0xde, 0x1f, 0x00, + 0xaa, 0xdf, 0x1f, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, + 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0xa8, + 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0d, 0x63, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, + 0x6f, 0x6f, 0x6c, 0x22, 0x97, 0x02, 0x0a, 0x1a, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, + 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, + 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, + 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x79, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, + 0x6f, 0x69, 0x6e, 0x42, 0x46, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, + 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x3a, 0x28, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0xca, 0xb4, 0x2d, + 0x1a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x22, 0xd4, 0x01, + 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x72, 0x74, + 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x27, 0x0a, 0x0f, 0x70, 0x72, 0x65, 0x76, 0x69, + 0x6f, 0x75, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x0e, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, + 0x12, 0x4c, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x36, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, + 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, + 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, + 0x65, 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x44, + 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x2c, + 0xea, 0xde, 0x1f, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x69, + 0x67, 0x68, 0x74, 0xa2, 0xe7, 0xb0, 0x2a, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x68, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x22, 0xe1, 0x01, 0x0a, 0x19, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x12, 0x4e, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, + 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x12, 0x6e, 0x0a, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x63, 0x43, 0x6f, 0x69, 0x6e, + 0x42, 0x38, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x63, + 0x43, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x22, 0xd3, 0x01, 0x0a, 0x25, 0x43, 0x6f, 0x6d, + 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x50, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x57, 0x69, 0x74, 0x68, 0x44, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, + 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, + 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x3a, 0x22, 0x88, 0xa0, 0x1f, 0x00, + 0xca, 0xb4, 0x2d, 0x1a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x42, 0x88, + 0x02, 0xa8, 0xe2, 0x1e, 0x01, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x11, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x40, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, + 0x43, 0x44, 0x58, 0xaa, 0x02, 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x69, 0x73, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0xca, 0x02, 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x44, 0x69, 0x73, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, + 0x02, 0x27, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1d, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x3a, 0x3a, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( diff --git a/api/cosmos/distribution/v1beta1/genesis.pulsar.go b/api/cosmos/distribution/v1beta1/genesis.pulsar.go index 39c24aa18ce8..0bcc34615b16 100644 --- a/api/cosmos/distribution/v1beta1/genesis.pulsar.go +++ b/api/cosmos/distribution/v1beta1/genesis.pulsar.go @@ -5994,24 +5994,24 @@ var file_cosmos_distribution_v1beta1_genesis_proto_rawDesc = []byte{ 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x14, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x73, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x42, 0x83, 0x02, 0x0a, - 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, - 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x40, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x64, - 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x44, 0x58, 0xaa, 0x02, 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, - 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x44, 0x69, - 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x1d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, - 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa8, 0xe2, - 0x1e, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x73, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x42, 0x83, 0x02, 0xa8, + 0xe2, 0x1e, 0x01, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x40, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, + 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x64, 0x69, + 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x3b, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x44, 0x58, 0xaa, 0x02, 0x1b, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x5c, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x5c, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x1d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x44, 0x69, 0x73, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/distribution/v1beta1/query_grpc.pb.go b/api/cosmos/distribution/v1beta1/query_grpc.pb.go index 2634afa08db7..7b4d9569bea9 100644 --- a/api/cosmos/distribution/v1beta1/query_grpc.pb.go +++ b/api/cosmos/distribution/v1beta1/query_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/distribution/v1beta1/query.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Query_Params_FullMethodName = "/cosmos.distribution.v1beta1.Query/Params" @@ -34,6 +34,8 @@ const ( // QueryClient is the client API for Query service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Query defines the gRPC querier service for distribution module. type QueryClient interface { // Params queries params of the distribution module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) @@ -67,8 +69,9 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { } func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -76,8 +79,9 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . } func (c *queryClient) ValidatorDistributionInfo(ctx context.Context, in *QueryValidatorDistributionInfoRequest, opts ...grpc.CallOption) (*QueryValidatorDistributionInfoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryValidatorDistributionInfoResponse) - err := c.cc.Invoke(ctx, Query_ValidatorDistributionInfo_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_ValidatorDistributionInfo_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -85,8 +89,9 @@ func (c *queryClient) ValidatorDistributionInfo(ctx context.Context, in *QueryVa } func (c *queryClient) ValidatorOutstandingRewards(ctx context.Context, in *QueryValidatorOutstandingRewardsRequest, opts ...grpc.CallOption) (*QueryValidatorOutstandingRewardsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryValidatorOutstandingRewardsResponse) - err := c.cc.Invoke(ctx, Query_ValidatorOutstandingRewards_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_ValidatorOutstandingRewards_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -94,8 +99,9 @@ func (c *queryClient) ValidatorOutstandingRewards(ctx context.Context, in *Query } func (c *queryClient) ValidatorCommission(ctx context.Context, in *QueryValidatorCommissionRequest, opts ...grpc.CallOption) (*QueryValidatorCommissionResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryValidatorCommissionResponse) - err := c.cc.Invoke(ctx, Query_ValidatorCommission_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_ValidatorCommission_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -103,8 +109,9 @@ func (c *queryClient) ValidatorCommission(ctx context.Context, in *QueryValidato } func (c *queryClient) ValidatorSlashes(ctx context.Context, in *QueryValidatorSlashesRequest, opts ...grpc.CallOption) (*QueryValidatorSlashesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryValidatorSlashesResponse) - err := c.cc.Invoke(ctx, Query_ValidatorSlashes_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_ValidatorSlashes_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -112,8 +119,9 @@ func (c *queryClient) ValidatorSlashes(ctx context.Context, in *QueryValidatorSl } func (c *queryClient) DelegationRewards(ctx context.Context, in *QueryDelegationRewardsRequest, opts ...grpc.CallOption) (*QueryDelegationRewardsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryDelegationRewardsResponse) - err := c.cc.Invoke(ctx, Query_DelegationRewards_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_DelegationRewards_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -121,8 +129,9 @@ func (c *queryClient) DelegationRewards(ctx context.Context, in *QueryDelegation } func (c *queryClient) DelegationTotalRewards(ctx context.Context, in *QueryDelegationTotalRewardsRequest, opts ...grpc.CallOption) (*QueryDelegationTotalRewardsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryDelegationTotalRewardsResponse) - err := c.cc.Invoke(ctx, Query_DelegationTotalRewards_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_DelegationTotalRewards_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -130,8 +139,9 @@ func (c *queryClient) DelegationTotalRewards(ctx context.Context, in *QueryDeleg } func (c *queryClient) DelegatorValidators(ctx context.Context, in *QueryDelegatorValidatorsRequest, opts ...grpc.CallOption) (*QueryDelegatorValidatorsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryDelegatorValidatorsResponse) - err := c.cc.Invoke(ctx, Query_DelegatorValidators_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_DelegatorValidators_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -139,8 +149,9 @@ func (c *queryClient) DelegatorValidators(ctx context.Context, in *QueryDelegato } func (c *queryClient) DelegatorWithdrawAddress(ctx context.Context, in *QueryDelegatorWithdrawAddressRequest, opts ...grpc.CallOption) (*QueryDelegatorWithdrawAddressResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryDelegatorWithdrawAddressResponse) - err := c.cc.Invoke(ctx, Query_DelegatorWithdrawAddress_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_DelegatorWithdrawAddress_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -148,8 +159,9 @@ func (c *queryClient) DelegatorWithdrawAddress(ctx context.Context, in *QueryDel } func (c *queryClient) CommunityPool(ctx context.Context, in *QueryCommunityPoolRequest, opts ...grpc.CallOption) (*QueryCommunityPoolResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryCommunityPoolResponse) - err := c.cc.Invoke(ctx, Query_CommunityPool_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_CommunityPool_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -158,7 +170,9 @@ func (c *queryClient) CommunityPool(ctx context.Context, in *QueryCommunityPoolR // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer -// for forward compatibility +// for forward compatibility. +// +// Query defines the gRPC querier service for distribution module. type QueryServer interface { // Params queries params of the distribution module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) @@ -184,9 +198,12 @@ type QueryServer interface { mustEmbedUnimplementedQueryServer() } -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} +// UnimplementedQueryServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedQueryServer struct{} func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") @@ -219,6 +236,7 @@ func (UnimplementedQueryServer) CommunityPool(context.Context, *QueryCommunityPo return nil, status.Errorf(codes.Unimplemented, "method CommunityPool not implemented") } func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} +func (UnimplementedQueryServer) testEmbeddedByValue() {} // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to QueryServer will @@ -228,6 +246,13 @@ type UnsafeQueryServer interface { } func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + // If the following call pancis, it indicates UnimplementedQueryServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Query_ServiceDesc, srv) } diff --git a/api/cosmos/distribution/v1beta1/tx.pulsar.go b/api/cosmos/distribution/v1beta1/tx.pulsar.go index a6a38d365afc..f22406a98646 100644 --- a/api/cosmos/distribution/v1beta1/tx.pulsar.go +++ b/api/cosmos/distribution/v1beta1/tx.pulsar.go @@ -7267,22 +7267,22 @@ var file_cosmos_distribution_v1beta1_tx_proto_rawDesc = []byte{ 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xfe, - 0x01, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, - 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x40, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x64, 0x69, 0x73, 0x74, - 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, - 0x02, 0x03, 0x43, 0x44, 0x58, 0xaa, 0x02, 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, - 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x44, 0x69, 0x73, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0xe2, 0x02, 0x27, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x44, 0x69, 0x73, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, - 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1d, 0x43, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa8, 0xe2, 0x1e, 0x01, 0x62, + 0x01, 0xa8, 0xe2, 0x1e, 0x01, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x40, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x64, 0x69, 0x73, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, + 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x44, 0x58, 0xaa, 0x02, 0x1b, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x5c, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x44, + 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x1d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } diff --git a/api/cosmos/distribution/v1beta1/tx_grpc.pb.go b/api/cosmos/distribution/v1beta1/tx_grpc.pb.go index a11aa3e53d58..b531c57a0c59 100644 --- a/api/cosmos/distribution/v1beta1/tx_grpc.pb.go +++ b/api/cosmos/distribution/v1beta1/tx_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/distribution/v1beta1/tx.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Msg_SetWithdrawAddress_FullMethodName = "/cosmos.distribution.v1beta1.Msg/SetWithdrawAddress" @@ -31,6 +31,8 @@ const ( // MsgClient is the client API for Msg service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Msg defines the distribution Msg service. type MsgClient interface { // SetWithdrawAddress defines a method to change the withdraw address // for a delegator (or validator self-delegation). @@ -72,8 +74,9 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { } func (c *msgClient) SetWithdrawAddress(ctx context.Context, in *MsgSetWithdrawAddress, opts ...grpc.CallOption) (*MsgSetWithdrawAddressResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgSetWithdrawAddressResponse) - err := c.cc.Invoke(ctx, Msg_SetWithdrawAddress_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_SetWithdrawAddress_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -81,8 +84,9 @@ func (c *msgClient) SetWithdrawAddress(ctx context.Context, in *MsgSetWithdrawAd } func (c *msgClient) WithdrawDelegatorReward(ctx context.Context, in *MsgWithdrawDelegatorReward, opts ...grpc.CallOption) (*MsgWithdrawDelegatorRewardResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgWithdrawDelegatorRewardResponse) - err := c.cc.Invoke(ctx, Msg_WithdrawDelegatorReward_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_WithdrawDelegatorReward_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -90,8 +94,9 @@ func (c *msgClient) WithdrawDelegatorReward(ctx context.Context, in *MsgWithdraw } func (c *msgClient) WithdrawValidatorCommission(ctx context.Context, in *MsgWithdrawValidatorCommission, opts ...grpc.CallOption) (*MsgWithdrawValidatorCommissionResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgWithdrawValidatorCommissionResponse) - err := c.cc.Invoke(ctx, Msg_WithdrawValidatorCommission_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_WithdrawValidatorCommission_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -99,8 +104,9 @@ func (c *msgClient) WithdrawValidatorCommission(ctx context.Context, in *MsgWith } func (c *msgClient) FundCommunityPool(ctx context.Context, in *MsgFundCommunityPool, opts ...grpc.CallOption) (*MsgFundCommunityPoolResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgFundCommunityPoolResponse) - err := c.cc.Invoke(ctx, Msg_FundCommunityPool_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_FundCommunityPool_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -108,8 +114,9 @@ func (c *msgClient) FundCommunityPool(ctx context.Context, in *MsgFundCommunityP } func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -117,8 +124,9 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts } func (c *msgClient) CommunityPoolSpend(ctx context.Context, in *MsgCommunityPoolSpend, opts ...grpc.CallOption) (*MsgCommunityPoolSpendResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgCommunityPoolSpendResponse) - err := c.cc.Invoke(ctx, Msg_CommunityPoolSpend_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_CommunityPoolSpend_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -126,8 +134,9 @@ func (c *msgClient) CommunityPoolSpend(ctx context.Context, in *MsgCommunityPool } func (c *msgClient) DepositValidatorRewardsPool(ctx context.Context, in *MsgDepositValidatorRewardsPool, opts ...grpc.CallOption) (*MsgDepositValidatorRewardsPoolResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgDepositValidatorRewardsPoolResponse) - err := c.cc.Invoke(ctx, Msg_DepositValidatorRewardsPool_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_DepositValidatorRewardsPool_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -136,7 +145,9 @@ func (c *msgClient) DepositValidatorRewardsPool(ctx context.Context, in *MsgDepo // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer -// for forward compatibility +// for forward compatibility. +// +// Msg defines the distribution Msg service. type MsgServer interface { // SetWithdrawAddress defines a method to change the withdraw address // for a delegator (or validator self-delegation). @@ -170,9 +181,12 @@ type MsgServer interface { mustEmbedUnimplementedMsgServer() } -// UnimplementedMsgServer must be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} +// UnimplementedMsgServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedMsgServer struct{} func (UnimplementedMsgServer) SetWithdrawAddress(context.Context, *MsgSetWithdrawAddress) (*MsgSetWithdrawAddressResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SetWithdrawAddress not implemented") @@ -196,6 +210,7 @@ func (UnimplementedMsgServer) DepositValidatorRewardsPool(context.Context, *MsgD return nil, status.Errorf(codes.Unimplemented, "method DepositValidatorRewardsPool not implemented") } func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} +func (UnimplementedMsgServer) testEmbeddedByValue() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to MsgServer will @@ -205,6 +220,13 @@ type UnsafeMsgServer interface { } func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + // If the following call pancis, it indicates UnimplementedMsgServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Msg_ServiceDesc, srv) } diff --git a/api/cosmos/orm/module/v1alpha1/module.pulsar.go b/api/cosmos/epochs/module/v1/module.pulsar.go similarity index 70% rename from api/cosmos/orm/module/v1alpha1/module.pulsar.go rename to api/cosmos/epochs/module/v1/module.pulsar.go index f8c716935beb..8f3ee884713b 100644 --- a/api/cosmos/orm/module/v1alpha1/module.pulsar.go +++ b/api/cosmos/epochs/module/v1/module.pulsar.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package modulev1alpha1 +package modulev1 import ( _ "cosmossdk.io/api/cosmos/app/v1alpha1" @@ -18,8 +18,8 @@ var ( ) func init() { - file_cosmos_orm_module_v1alpha1_module_proto_init() - md_Module = File_cosmos_orm_module_v1alpha1_module_proto.Messages().ByName("Module") + file_cosmos_epochs_module_v1_module_proto_init() + md_Module = File_cosmos_epochs_module_v1_module_proto.Messages().ByName("Module") } var _ protoreflect.Message = (*fastReflection_Module)(nil) @@ -31,7 +31,7 @@ func (x *Module) ProtoReflect() protoreflect.Message { } func (x *Module) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_orm_module_v1alpha1_module_proto_msgTypes[0] + mi := &file_cosmos_epochs_module_v1_module_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -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: cosmos.orm.module.v1alpha1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.module.v1.Module")) } - panic(fmt.Errorf("message cosmos.orm.module.v1alpha1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.epochs.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: cosmos.orm.module.v1alpha1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.module.v1.Module")) } - panic(fmt.Errorf("message cosmos.orm.module.v1alpha1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.epochs.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: cosmos.orm.module.v1alpha1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.module.v1.Module")) } - panic(fmt.Errorf("message cosmos.orm.module.v1alpha1.Module does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.epochs.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: cosmos.orm.module.v1alpha1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.module.v1.Module")) } - panic(fmt.Errorf("message cosmos.orm.module.v1alpha1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.epochs.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: cosmos.orm.module.v1alpha1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.module.v1.Module")) } - panic(fmt.Errorf("message cosmos.orm.module.v1alpha1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.epochs.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: cosmos.orm.module.v1alpha1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.module.v1.Module")) } - panic(fmt.Errorf("message cosmos.orm.module.v1alpha1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.epochs.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 cosmos.orm.module.v1alpha1.Module", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.epochs.module.v1.Module", d.FullName())) } panic("unreachable") } @@ -369,11 +369,13 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { } } +// Since: cosmos-sdk 0.53 + // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 // protoc (unknown) -// source: cosmos/orm/module/v1alpha1/module.proto +// source: cosmos/epochs/module/v1/module.proto const ( // Verify that this generated code is sufficiently up-to-date. @@ -382,9 +384,7 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// Module defines the ORM module which adds providers to the app container for -// ORM ModuleDB's and in the future will automatically register query -// services for modules that use the ORM. +// Module is the config object of the epochs module. type Module struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -394,7 +394,7 @@ type Module struct { func (x *Module) Reset() { *x = Module{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_orm_module_v1alpha1_module_proto_msgTypes[0] + mi := &file_cosmos_epochs_module_v1_module_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -408,56 +408,56 @@ func (*Module) ProtoMessage() {} // Deprecated: Use Module.ProtoReflect.Descriptor instead. func (*Module) Descriptor() ([]byte, []int) { - return file_cosmos_orm_module_v1alpha1_module_proto_rawDescGZIP(), []int{0} + return file_cosmos_epochs_module_v1_module_proto_rawDescGZIP(), []int{0} } -var File_cosmos_orm_module_v1alpha1_module_proto protoreflect.FileDescriptor - -var file_cosmos_orm_module_v1alpha1_module_proto_rawDesc = []byte{ - 0x0a, 0x27, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6f, 0x72, 0x6d, 0x2f, 0x6d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x6f, 0x72, 0x6d, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 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, 0x22, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x3a, 0x18, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x12, 0x0a, 0x10, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6f, 0x72, 0x6d, 0x42, 0xf4, 0x01, 0x0a, 0x1e, - 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6f, 0x72, 0x6d, 0x2e, 0x6d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0b, - 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6f, 0x72, 0x6d, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x4f, 0x4d, 0xaa, - 0x02, 0x1a, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x4f, 0x72, 0x6d, 0x2e, 0x4d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x1a, 0x43, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x4f, 0x72, 0x6d, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x26, 0x43, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x5c, 0x4f, 0x72, 0x6d, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x1d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x4f, 0x72, 0x6d, - 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +var File_cosmos_epochs_module_v1_module_proto protoreflect.FileDescriptor + +var file_cosmos_epochs_module_v1_module_proto_rawDesc = []byte{ + 0x0a, 0x24, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2f, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, + 0x70, 0x6f, 0x63, 0x68, 0x73, 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, 0x37, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x2d, 0xba, 0xc0, 0x96, + 0xda, 0x01, 0x27, 0x0a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, + 0x6b, 0x2f, 0x78, 0x2f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x42, 0xdc, 0x01, 0x0a, 0x1b, 0x63, + 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, + 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, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, + 0x45, 0x4d, 0xaa, 0x02, 0x17, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, + 0x68, 0x73, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x17, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x5c, 0x4d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x23, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, + 0x45, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1a, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x3a, 0x3a, 0x4d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( - file_cosmos_orm_module_v1alpha1_module_proto_rawDescOnce sync.Once - file_cosmos_orm_module_v1alpha1_module_proto_rawDescData = file_cosmos_orm_module_v1alpha1_module_proto_rawDesc + file_cosmos_epochs_module_v1_module_proto_rawDescOnce sync.Once + file_cosmos_epochs_module_v1_module_proto_rawDescData = file_cosmos_epochs_module_v1_module_proto_rawDesc ) -func file_cosmos_orm_module_v1alpha1_module_proto_rawDescGZIP() []byte { - file_cosmos_orm_module_v1alpha1_module_proto_rawDescOnce.Do(func() { - file_cosmos_orm_module_v1alpha1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_orm_module_v1alpha1_module_proto_rawDescData) +func file_cosmos_epochs_module_v1_module_proto_rawDescGZIP() []byte { + file_cosmos_epochs_module_v1_module_proto_rawDescOnce.Do(func() { + file_cosmos_epochs_module_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_epochs_module_v1_module_proto_rawDescData) }) - return file_cosmos_orm_module_v1alpha1_module_proto_rawDescData + return file_cosmos_epochs_module_v1_module_proto_rawDescData } -var file_cosmos_orm_module_v1alpha1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_cosmos_orm_module_v1alpha1_module_proto_goTypes = []interface{}{ - (*Module)(nil), // 0: cosmos.orm.module.v1alpha1.Module +var file_cosmos_epochs_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cosmos_epochs_module_v1_module_proto_goTypes = []interface{}{ + (*Module)(nil), // 0: cosmos.epochs.module.v1.Module } -var file_cosmos_orm_module_v1alpha1_module_proto_depIdxs = []int32{ +var file_cosmos_epochs_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 @@ -465,13 +465,13 @@ var file_cosmos_orm_module_v1alpha1_module_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for field type_name } -func init() { file_cosmos_orm_module_v1alpha1_module_proto_init() } -func file_cosmos_orm_module_v1alpha1_module_proto_init() { - if File_cosmos_orm_module_v1alpha1_module_proto != nil { +func init() { file_cosmos_epochs_module_v1_module_proto_init() } +func file_cosmos_epochs_module_v1_module_proto_init() { + if File_cosmos_epochs_module_v1_module_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_cosmos_orm_module_v1alpha1_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_cosmos_epochs_module_v1_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Module); i { case 0: return &v.state @@ -488,18 +488,18 @@ func file_cosmos_orm_module_v1alpha1_module_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_cosmos_orm_module_v1alpha1_module_proto_rawDesc, + RawDescriptor: file_cosmos_epochs_module_v1_module_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_cosmos_orm_module_v1alpha1_module_proto_goTypes, - DependencyIndexes: file_cosmos_orm_module_v1alpha1_module_proto_depIdxs, - MessageInfos: file_cosmos_orm_module_v1alpha1_module_proto_msgTypes, + GoTypes: file_cosmos_epochs_module_v1_module_proto_goTypes, + DependencyIndexes: file_cosmos_epochs_module_v1_module_proto_depIdxs, + MessageInfos: file_cosmos_epochs_module_v1_module_proto_msgTypes, }.Build() - File_cosmos_orm_module_v1alpha1_module_proto = out.File - file_cosmos_orm_module_v1alpha1_module_proto_rawDesc = nil - file_cosmos_orm_module_v1alpha1_module_proto_goTypes = nil - file_cosmos_orm_module_v1alpha1_module_proto_depIdxs = nil + File_cosmos_epochs_module_v1_module_proto = out.File + file_cosmos_epochs_module_v1_module_proto_rawDesc = nil + file_cosmos_epochs_module_v1_module_proto_goTypes = nil + file_cosmos_epochs_module_v1_module_proto_depIdxs = nil } diff --git a/api/cosmos/epochs/v1beta1/events.pulsar.go b/api/cosmos/epochs/v1beta1/events.pulsar.go new file mode 100644 index 000000000000..fd0676c364ea --- /dev/null +++ b/api/cosmos/epochs/v1beta1/events.pulsar.go @@ -0,0 +1,1072 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package epochsv1beta1 + +import ( + 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_EventEpochEnd protoreflect.MessageDescriptor + fd_EventEpochEnd_epoch_number protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_epochs_v1beta1_events_proto_init() + md_EventEpochEnd = File_cosmos_epochs_v1beta1_events_proto.Messages().ByName("EventEpochEnd") + fd_EventEpochEnd_epoch_number = md_EventEpochEnd.Fields().ByName("epoch_number") +} + +var _ protoreflect.Message = (*fastReflection_EventEpochEnd)(nil) + +type fastReflection_EventEpochEnd EventEpochEnd + +func (x *EventEpochEnd) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventEpochEnd)(x) +} + +func (x *EventEpochEnd) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_epochs_v1beta1_events_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_EventEpochEnd_messageType fastReflection_EventEpochEnd_messageType +var _ protoreflect.MessageType = fastReflection_EventEpochEnd_messageType{} + +type fastReflection_EventEpochEnd_messageType struct{} + +func (x fastReflection_EventEpochEnd_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventEpochEnd)(nil) +} +func (x fastReflection_EventEpochEnd_messageType) New() protoreflect.Message { + return new(fastReflection_EventEpochEnd) +} +func (x fastReflection_EventEpochEnd_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventEpochEnd +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventEpochEnd) Descriptor() protoreflect.MessageDescriptor { + return md_EventEpochEnd +} + +// 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_EventEpochEnd) Type() protoreflect.MessageType { + return _fastReflection_EventEpochEnd_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventEpochEnd) New() protoreflect.Message { + return new(fastReflection_EventEpochEnd) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventEpochEnd) Interface() protoreflect.ProtoMessage { + return (*EventEpochEnd)(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_EventEpochEnd) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.EpochNumber != int64(0) { + value := protoreflect.ValueOfInt64(x.EpochNumber) + if !f(fd_EventEpochEnd_epoch_number, 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_EventEpochEnd) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.EventEpochEnd.epoch_number": + return x.EpochNumber != int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.EventEpochEnd")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.EventEpochEnd 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_EventEpochEnd) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.EventEpochEnd.epoch_number": + x.EpochNumber = int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.EventEpochEnd")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.EventEpochEnd 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_EventEpochEnd) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.epochs.v1beta1.EventEpochEnd.epoch_number": + value := x.EpochNumber + return protoreflect.ValueOfInt64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.EventEpochEnd")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.EventEpochEnd 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_EventEpochEnd) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.EventEpochEnd.epoch_number": + x.EpochNumber = value.Int() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.EventEpochEnd")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.EventEpochEnd 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_EventEpochEnd) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.EventEpochEnd.epoch_number": + panic(fmt.Errorf("field epoch_number of message cosmos.epochs.v1beta1.EventEpochEnd is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.EventEpochEnd")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.EventEpochEnd 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_EventEpochEnd) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.EventEpochEnd.epoch_number": + return protoreflect.ValueOfInt64(int64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.EventEpochEnd")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.EventEpochEnd 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_EventEpochEnd) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.epochs.v1beta1.EventEpochEnd", 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_EventEpochEnd) 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_EventEpochEnd) 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_EventEpochEnd) 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_EventEpochEnd) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventEpochEnd) + 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.EpochNumber != 0 { + n += 1 + runtime.Sov(uint64(x.EpochNumber)) + } + 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().(*EventEpochEnd) + 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.EpochNumber != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.EpochNumber)) + 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().(*EventEpochEnd) + 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: EventEpochEnd: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventEpochEnd: 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 EpochNumber", wireType) + } + x.EpochNumber = 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.EpochNumber |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_EventEpochStart protoreflect.MessageDescriptor + fd_EventEpochStart_epoch_number protoreflect.FieldDescriptor + fd_EventEpochStart_epoch_start_time protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_epochs_v1beta1_events_proto_init() + md_EventEpochStart = File_cosmos_epochs_v1beta1_events_proto.Messages().ByName("EventEpochStart") + fd_EventEpochStart_epoch_number = md_EventEpochStart.Fields().ByName("epoch_number") + fd_EventEpochStart_epoch_start_time = md_EventEpochStart.Fields().ByName("epoch_start_time") +} + +var _ protoreflect.Message = (*fastReflection_EventEpochStart)(nil) + +type fastReflection_EventEpochStart EventEpochStart + +func (x *EventEpochStart) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventEpochStart)(x) +} + +func (x *EventEpochStart) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_epochs_v1beta1_events_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_EventEpochStart_messageType fastReflection_EventEpochStart_messageType +var _ protoreflect.MessageType = fastReflection_EventEpochStart_messageType{} + +type fastReflection_EventEpochStart_messageType struct{} + +func (x fastReflection_EventEpochStart_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventEpochStart)(nil) +} +func (x fastReflection_EventEpochStart_messageType) New() protoreflect.Message { + return new(fastReflection_EventEpochStart) +} +func (x fastReflection_EventEpochStart_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventEpochStart +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventEpochStart) Descriptor() protoreflect.MessageDescriptor { + return md_EventEpochStart +} + +// 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_EventEpochStart) Type() protoreflect.MessageType { + return _fastReflection_EventEpochStart_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventEpochStart) New() protoreflect.Message { + return new(fastReflection_EventEpochStart) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventEpochStart) Interface() protoreflect.ProtoMessage { + return (*EventEpochStart)(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_EventEpochStart) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.EpochNumber != int64(0) { + value := protoreflect.ValueOfInt64(x.EpochNumber) + if !f(fd_EventEpochStart_epoch_number, value) { + return + } + } + if x.EpochStartTime != int64(0) { + value := protoreflect.ValueOfInt64(x.EpochStartTime) + if !f(fd_EventEpochStart_epoch_start_time, 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_EventEpochStart) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.EventEpochStart.epoch_number": + return x.EpochNumber != int64(0) + case "cosmos.epochs.v1beta1.EventEpochStart.epoch_start_time": + return x.EpochStartTime != int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.EventEpochStart")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.EventEpochStart 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_EventEpochStart) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.EventEpochStart.epoch_number": + x.EpochNumber = int64(0) + case "cosmos.epochs.v1beta1.EventEpochStart.epoch_start_time": + x.EpochStartTime = int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.EventEpochStart")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.EventEpochStart 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_EventEpochStart) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.epochs.v1beta1.EventEpochStart.epoch_number": + value := x.EpochNumber + return protoreflect.ValueOfInt64(value) + case "cosmos.epochs.v1beta1.EventEpochStart.epoch_start_time": + value := x.EpochStartTime + return protoreflect.ValueOfInt64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.EventEpochStart")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.EventEpochStart 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_EventEpochStart) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.EventEpochStart.epoch_number": + x.EpochNumber = value.Int() + case "cosmos.epochs.v1beta1.EventEpochStart.epoch_start_time": + x.EpochStartTime = value.Int() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.EventEpochStart")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.EventEpochStart 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_EventEpochStart) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.EventEpochStart.epoch_number": + panic(fmt.Errorf("field epoch_number of message cosmos.epochs.v1beta1.EventEpochStart is not mutable")) + case "cosmos.epochs.v1beta1.EventEpochStart.epoch_start_time": + panic(fmt.Errorf("field epoch_start_time of message cosmos.epochs.v1beta1.EventEpochStart is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.EventEpochStart")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.EventEpochStart 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_EventEpochStart) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.EventEpochStart.epoch_number": + return protoreflect.ValueOfInt64(int64(0)) + case "cosmos.epochs.v1beta1.EventEpochStart.epoch_start_time": + return protoreflect.ValueOfInt64(int64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.EventEpochStart")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.EventEpochStart 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_EventEpochStart) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.epochs.v1beta1.EventEpochStart", 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_EventEpochStart) 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_EventEpochStart) 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_EventEpochStart) 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_EventEpochStart) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventEpochStart) + 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.EpochNumber != 0 { + n += 1 + runtime.Sov(uint64(x.EpochNumber)) + } + if x.EpochStartTime != 0 { + n += 1 + runtime.Sov(uint64(x.EpochStartTime)) + } + 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().(*EventEpochStart) + 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.EpochStartTime != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.EpochStartTime)) + i-- + dAtA[i] = 0x10 + } + if x.EpochNumber != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.EpochNumber)) + 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().(*EventEpochStart) + 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: EventEpochStart: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventEpochStart: 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 EpochNumber", wireType) + } + x.EpochNumber = 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.EpochNumber |= int64(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 EpochStartTime", wireType) + } + x.EpochStartTime = 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.EpochStartTime |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Since: cosmos-sdk 0.53 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cosmos/epochs/v1beta1/events.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) +) + +// EventEpochEnd is an event emitted when an epoch end. +type EventEpochEnd struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + EpochNumber int64 `protobuf:"varint,1,opt,name=epoch_number,json=epochNumber,proto3" json:"epoch_number,omitempty"` +} + +func (x *EventEpochEnd) Reset() { + *x = EventEpochEnd{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_epochs_v1beta1_events_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventEpochEnd) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventEpochEnd) ProtoMessage() {} + +// Deprecated: Use EventEpochEnd.ProtoReflect.Descriptor instead. +func (*EventEpochEnd) Descriptor() ([]byte, []int) { + return file_cosmos_epochs_v1beta1_events_proto_rawDescGZIP(), []int{0} +} + +func (x *EventEpochEnd) GetEpochNumber() int64 { + if x != nil { + return x.EpochNumber + } + return 0 +} + +// EventEpochStart is an event emitted when an epoch start. +type EventEpochStart struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + EpochNumber int64 `protobuf:"varint,1,opt,name=epoch_number,json=epochNumber,proto3" json:"epoch_number,omitempty"` + EpochStartTime int64 `protobuf:"varint,2,opt,name=epoch_start_time,json=epochStartTime,proto3" json:"epoch_start_time,omitempty"` +} + +func (x *EventEpochStart) Reset() { + *x = EventEpochStart{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_epochs_v1beta1_events_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventEpochStart) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventEpochStart) ProtoMessage() {} + +// Deprecated: Use EventEpochStart.ProtoReflect.Descriptor instead. +func (*EventEpochStart) Descriptor() ([]byte, []int) { + return file_cosmos_epochs_v1beta1_events_proto_rawDescGZIP(), []int{1} +} + +func (x *EventEpochStart) GetEpochNumber() int64 { + if x != nil { + return x.EpochNumber + } + return 0 +} + +func (x *EventEpochStart) GetEpochStartTime() int64 { + if x != nil { + return x.EpochStartTime + } + return 0 +} + +var File_cosmos_epochs_v1beta1_events_proto protoreflect.FileDescriptor + +var file_cosmos_epochs_v1beta1_events_proto_rawDesc = []byte{ + 0x0a, 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2f, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x70, 0x6f, + 0x63, 0x68, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x22, 0x32, 0x0a, 0x0d, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x45, 0x6e, 0x64, 0x12, 0x21, 0x0a, 0x0c, + 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x0b, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, + 0x5e, 0x0a, 0x0f, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x53, 0x74, 0x61, + 0x72, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x6e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x4e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x28, 0x0a, 0x10, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x73, + 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x0e, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x42, + 0xd4, 0x01, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, + 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0b, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2f, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x3b, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x45, 0x58, 0xaa, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0xca, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x73, + 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x21, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x5c, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x17, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cosmos_epochs_v1beta1_events_proto_rawDescOnce sync.Once + file_cosmos_epochs_v1beta1_events_proto_rawDescData = file_cosmos_epochs_v1beta1_events_proto_rawDesc +) + +func file_cosmos_epochs_v1beta1_events_proto_rawDescGZIP() []byte { + file_cosmos_epochs_v1beta1_events_proto_rawDescOnce.Do(func() { + file_cosmos_epochs_v1beta1_events_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_epochs_v1beta1_events_proto_rawDescData) + }) + return file_cosmos_epochs_v1beta1_events_proto_rawDescData +} + +var file_cosmos_epochs_v1beta1_events_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_cosmos_epochs_v1beta1_events_proto_goTypes = []interface{}{ + (*EventEpochEnd)(nil), // 0: cosmos.epochs.v1beta1.EventEpochEnd + (*EventEpochStart)(nil), // 1: cosmos.epochs.v1beta1.EventEpochStart +} +var file_cosmos_epochs_v1beta1_events_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_cosmos_epochs_v1beta1_events_proto_init() } +func file_cosmos_epochs_v1beta1_events_proto_init() { + if File_cosmos_epochs_v1beta1_events_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cosmos_epochs_v1beta1_events_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventEpochEnd); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_epochs_v1beta1_events_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventEpochStart); 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_cosmos_epochs_v1beta1_events_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cosmos_epochs_v1beta1_events_proto_goTypes, + DependencyIndexes: file_cosmos_epochs_v1beta1_events_proto_depIdxs, + MessageInfos: file_cosmos_epochs_v1beta1_events_proto_msgTypes, + }.Build() + File_cosmos_epochs_v1beta1_events_proto = out.File + file_cosmos_epochs_v1beta1_events_proto_rawDesc = nil + file_cosmos_epochs_v1beta1_events_proto_goTypes = nil + file_cosmos_epochs_v1beta1_events_proto_depIdxs = nil +} diff --git a/api/cosmos/epochs/v1beta1/genesis.pulsar.go b/api/cosmos/epochs/v1beta1/genesis.pulsar.go new file mode 100644 index 000000000000..fbb7da70d6bf --- /dev/null +++ b/api/cosmos/epochs/v1beta1/genesis.pulsar.go @@ -0,0 +1,1630 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package epochsv1beta1 + +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" + durationpb "google.golang.org/protobuf/types/known/durationpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_EpochInfo protoreflect.MessageDescriptor + fd_EpochInfo_identifier protoreflect.FieldDescriptor + fd_EpochInfo_start_time protoreflect.FieldDescriptor + fd_EpochInfo_duration protoreflect.FieldDescriptor + fd_EpochInfo_current_epoch protoreflect.FieldDescriptor + fd_EpochInfo_current_epoch_start_time protoreflect.FieldDescriptor + fd_EpochInfo_epoch_counting_started protoreflect.FieldDescriptor + fd_EpochInfo_current_epoch_start_height protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_epochs_v1beta1_genesis_proto_init() + md_EpochInfo = File_cosmos_epochs_v1beta1_genesis_proto.Messages().ByName("EpochInfo") + fd_EpochInfo_identifier = md_EpochInfo.Fields().ByName("identifier") + fd_EpochInfo_start_time = md_EpochInfo.Fields().ByName("start_time") + fd_EpochInfo_duration = md_EpochInfo.Fields().ByName("duration") + fd_EpochInfo_current_epoch = md_EpochInfo.Fields().ByName("current_epoch") + fd_EpochInfo_current_epoch_start_time = md_EpochInfo.Fields().ByName("current_epoch_start_time") + fd_EpochInfo_epoch_counting_started = md_EpochInfo.Fields().ByName("epoch_counting_started") + fd_EpochInfo_current_epoch_start_height = md_EpochInfo.Fields().ByName("current_epoch_start_height") +} + +var _ protoreflect.Message = (*fastReflection_EpochInfo)(nil) + +type fastReflection_EpochInfo EpochInfo + +func (x *EpochInfo) ProtoReflect() protoreflect.Message { + return (*fastReflection_EpochInfo)(x) +} + +func (x *EpochInfo) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_epochs_v1beta1_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_EpochInfo_messageType fastReflection_EpochInfo_messageType +var _ protoreflect.MessageType = fastReflection_EpochInfo_messageType{} + +type fastReflection_EpochInfo_messageType struct{} + +func (x fastReflection_EpochInfo_messageType) Zero() protoreflect.Message { + return (*fastReflection_EpochInfo)(nil) +} +func (x fastReflection_EpochInfo_messageType) New() protoreflect.Message { + return new(fastReflection_EpochInfo) +} +func (x fastReflection_EpochInfo_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EpochInfo +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EpochInfo) Descriptor() protoreflect.MessageDescriptor { + return md_EpochInfo +} + +// 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_EpochInfo) Type() protoreflect.MessageType { + return _fastReflection_EpochInfo_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EpochInfo) New() protoreflect.Message { + return new(fastReflection_EpochInfo) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EpochInfo) Interface() protoreflect.ProtoMessage { + return (*EpochInfo)(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_EpochInfo) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Identifier != "" { + value := protoreflect.ValueOfString(x.Identifier) + if !f(fd_EpochInfo_identifier, value) { + return + } + } + if x.StartTime != nil { + value := protoreflect.ValueOfMessage(x.StartTime.ProtoReflect()) + if !f(fd_EpochInfo_start_time, value) { + return + } + } + if x.Duration != nil { + value := protoreflect.ValueOfMessage(x.Duration.ProtoReflect()) + if !f(fd_EpochInfo_duration, value) { + return + } + } + if x.CurrentEpoch != int64(0) { + value := protoreflect.ValueOfInt64(x.CurrentEpoch) + if !f(fd_EpochInfo_current_epoch, value) { + return + } + } + if x.CurrentEpochStartTime != nil { + value := protoreflect.ValueOfMessage(x.CurrentEpochStartTime.ProtoReflect()) + if !f(fd_EpochInfo_current_epoch_start_time, value) { + return + } + } + if x.EpochCountingStarted != false { + value := protoreflect.ValueOfBool(x.EpochCountingStarted) + if !f(fd_EpochInfo_epoch_counting_started, value) { + return + } + } + if x.CurrentEpochStartHeight != int64(0) { + value := protoreflect.ValueOfInt64(x.CurrentEpochStartHeight) + if !f(fd_EpochInfo_current_epoch_start_height, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_EpochInfo) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.EpochInfo.identifier": + return x.Identifier != "" + case "cosmos.epochs.v1beta1.EpochInfo.start_time": + return x.StartTime != nil + case "cosmos.epochs.v1beta1.EpochInfo.duration": + return x.Duration != nil + case "cosmos.epochs.v1beta1.EpochInfo.current_epoch": + return x.CurrentEpoch != int64(0) + case "cosmos.epochs.v1beta1.EpochInfo.current_epoch_start_time": + return x.CurrentEpochStartTime != nil + case "cosmos.epochs.v1beta1.EpochInfo.epoch_counting_started": + return x.EpochCountingStarted != false + case "cosmos.epochs.v1beta1.EpochInfo.current_epoch_start_height": + return x.CurrentEpochStartHeight != int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.EpochInfo")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.EpochInfo 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_EpochInfo) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.EpochInfo.identifier": + x.Identifier = "" + case "cosmos.epochs.v1beta1.EpochInfo.start_time": + x.StartTime = nil + case "cosmos.epochs.v1beta1.EpochInfo.duration": + x.Duration = nil + case "cosmos.epochs.v1beta1.EpochInfo.current_epoch": + x.CurrentEpoch = int64(0) + case "cosmos.epochs.v1beta1.EpochInfo.current_epoch_start_time": + x.CurrentEpochStartTime = nil + case "cosmos.epochs.v1beta1.EpochInfo.epoch_counting_started": + x.EpochCountingStarted = false + case "cosmos.epochs.v1beta1.EpochInfo.current_epoch_start_height": + x.CurrentEpochStartHeight = int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.EpochInfo")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.EpochInfo 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_EpochInfo) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.epochs.v1beta1.EpochInfo.identifier": + value := x.Identifier + return protoreflect.ValueOfString(value) + case "cosmos.epochs.v1beta1.EpochInfo.start_time": + value := x.StartTime + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.epochs.v1beta1.EpochInfo.duration": + value := x.Duration + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.epochs.v1beta1.EpochInfo.current_epoch": + value := x.CurrentEpoch + return protoreflect.ValueOfInt64(value) + case "cosmos.epochs.v1beta1.EpochInfo.current_epoch_start_time": + value := x.CurrentEpochStartTime + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.epochs.v1beta1.EpochInfo.epoch_counting_started": + value := x.EpochCountingStarted + return protoreflect.ValueOfBool(value) + case "cosmos.epochs.v1beta1.EpochInfo.current_epoch_start_height": + value := x.CurrentEpochStartHeight + return protoreflect.ValueOfInt64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.EpochInfo")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.EpochInfo 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_EpochInfo) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.EpochInfo.identifier": + x.Identifier = value.Interface().(string) + case "cosmos.epochs.v1beta1.EpochInfo.start_time": + x.StartTime = value.Message().Interface().(*timestamppb.Timestamp) + case "cosmos.epochs.v1beta1.EpochInfo.duration": + x.Duration = value.Message().Interface().(*durationpb.Duration) + case "cosmos.epochs.v1beta1.EpochInfo.current_epoch": + x.CurrentEpoch = value.Int() + case "cosmos.epochs.v1beta1.EpochInfo.current_epoch_start_time": + x.CurrentEpochStartTime = value.Message().Interface().(*timestamppb.Timestamp) + case "cosmos.epochs.v1beta1.EpochInfo.epoch_counting_started": + x.EpochCountingStarted = value.Bool() + case "cosmos.epochs.v1beta1.EpochInfo.current_epoch_start_height": + x.CurrentEpochStartHeight = value.Int() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.EpochInfo")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.EpochInfo 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_EpochInfo) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.EpochInfo.start_time": + if x.StartTime == nil { + x.StartTime = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.StartTime.ProtoReflect()) + case "cosmos.epochs.v1beta1.EpochInfo.duration": + if x.Duration == nil { + x.Duration = new(durationpb.Duration) + } + return protoreflect.ValueOfMessage(x.Duration.ProtoReflect()) + case "cosmos.epochs.v1beta1.EpochInfo.current_epoch_start_time": + if x.CurrentEpochStartTime == nil { + x.CurrentEpochStartTime = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.CurrentEpochStartTime.ProtoReflect()) + case "cosmos.epochs.v1beta1.EpochInfo.identifier": + panic(fmt.Errorf("field identifier of message cosmos.epochs.v1beta1.EpochInfo is not mutable")) + case "cosmos.epochs.v1beta1.EpochInfo.current_epoch": + panic(fmt.Errorf("field current_epoch of message cosmos.epochs.v1beta1.EpochInfo is not mutable")) + case "cosmos.epochs.v1beta1.EpochInfo.epoch_counting_started": + panic(fmt.Errorf("field epoch_counting_started of message cosmos.epochs.v1beta1.EpochInfo is not mutable")) + case "cosmos.epochs.v1beta1.EpochInfo.current_epoch_start_height": + panic(fmt.Errorf("field current_epoch_start_height of message cosmos.epochs.v1beta1.EpochInfo is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.EpochInfo")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.EpochInfo 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_EpochInfo) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.EpochInfo.identifier": + return protoreflect.ValueOfString("") + case "cosmos.epochs.v1beta1.EpochInfo.start_time": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.epochs.v1beta1.EpochInfo.duration": + m := new(durationpb.Duration) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.epochs.v1beta1.EpochInfo.current_epoch": + return protoreflect.ValueOfInt64(int64(0)) + case "cosmos.epochs.v1beta1.EpochInfo.current_epoch_start_time": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.epochs.v1beta1.EpochInfo.epoch_counting_started": + return protoreflect.ValueOfBool(false) + case "cosmos.epochs.v1beta1.EpochInfo.current_epoch_start_height": + return protoreflect.ValueOfInt64(int64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.EpochInfo")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.EpochInfo 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_EpochInfo) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.epochs.v1beta1.EpochInfo", 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_EpochInfo) 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_EpochInfo) 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_EpochInfo) 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_EpochInfo) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EpochInfo) + 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.Identifier) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.StartTime != nil { + l = options.Size(x.StartTime) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Duration != nil { + l = options.Size(x.Duration) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.CurrentEpoch != 0 { + n += 1 + runtime.Sov(uint64(x.CurrentEpoch)) + } + if x.CurrentEpochStartTime != nil { + l = options.Size(x.CurrentEpochStartTime) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.EpochCountingStarted { + n += 2 + } + if x.CurrentEpochStartHeight != 0 { + n += 1 + runtime.Sov(uint64(x.CurrentEpochStartHeight)) + } + 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().(*EpochInfo) + 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.CurrentEpochStartHeight != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.CurrentEpochStartHeight)) + i-- + dAtA[i] = 0x40 + } + if x.EpochCountingStarted { + i-- + if x.EpochCountingStarted { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if x.CurrentEpochStartTime != nil { + encoded, err := options.Marshal(x.CurrentEpochStartTime) + 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.CurrentEpoch != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.CurrentEpoch)) + i-- + dAtA[i] = 0x20 + } + if x.Duration != nil { + encoded, err := options.Marshal(x.Duration) + 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 x.StartTime != nil { + encoded, err := options.Marshal(x.StartTime) + 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.Identifier) > 0 { + i -= len(x.Identifier) + copy(dAtA[i:], x.Identifier) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Identifier))) + 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().(*EpochInfo) + 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: EpochInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EpochInfo: 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 Identifier", 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.Identifier = 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 StartTime", 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.StartTime == nil { + x.StartTime = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.StartTime); 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 Duration", 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.Duration == nil { + x.Duration = &durationpb.Duration{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Duration); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CurrentEpoch", wireType) + } + x.CurrentEpoch = 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.CurrentEpoch |= int64(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 CurrentEpochStartTime", 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.CurrentEpochStartTime == nil { + x.CurrentEpochStartTime = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.CurrentEpochStartTime); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EpochCountingStarted", 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.EpochCountingStarted = bool(v != 0) + case 8: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CurrentEpochStartHeight", wireType) + } + x.CurrentEpochStartHeight = 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.CurrentEpochStartHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_GenesisState_1_list)(nil) + +type _GenesisState_1_list struct { + list *[]*EpochInfo +} + +func (x *_GenesisState_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_GenesisState_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_GenesisState_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*EpochInfo) + (*x.list)[i] = concreteValue +} + +func (x *_GenesisState_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*EpochInfo) + *x.list = append(*x.list, concreteValue) +} + +func (x *_GenesisState_1_list) AppendMutable() protoreflect.Value { + v := new(EpochInfo) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_GenesisState_1_list) NewElement() protoreflect.Value { + v := new(EpochInfo) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_GenesisState protoreflect.MessageDescriptor + fd_GenesisState_epochs protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_epochs_v1beta1_genesis_proto_init() + md_GenesisState = File_cosmos_epochs_v1beta1_genesis_proto.Messages().ByName("GenesisState") + fd_GenesisState_epochs = md_GenesisState.Fields().ByName("epochs") +} + +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_cosmos_epochs_v1beta1_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_GenesisState_messageType fastReflection_GenesisState_messageType +var _ protoreflect.MessageType = fastReflection_GenesisState_messageType{} + +type fastReflection_GenesisState_messageType struct{} + +func (x fastReflection_GenesisState_messageType) Zero() protoreflect.Message { + return (*fastReflection_GenesisState)(nil) +} +func (x fastReflection_GenesisState_messageType) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} +func (x fastReflection_GenesisState_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_GenesisState) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_GenesisState) Type() protoreflect.MessageType { + return _fastReflection_GenesisState_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_GenesisState) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_GenesisState) Interface() protoreflect.ProtoMessage { + return (*GenesisState)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Epochs) != 0 { + value := protoreflect.ValueOfList(&_GenesisState_1_list{list: &x.Epochs}) + if !f(fd_GenesisState_epochs, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.GenesisState.epochs": + return len(x.Epochs) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.GenesisState")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.GenesisState.epochs": + x.Epochs = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.GenesisState")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.epochs.v1beta1.GenesisState.epochs": + if len(x.Epochs) == 0 { + return protoreflect.ValueOfList(&_GenesisState_1_list{}) + } + listValue := &_GenesisState_1_list{list: &x.Epochs} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.GenesisState")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.GenesisState does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.GenesisState.epochs": + lv := value.List() + clv := lv.(*_GenesisState_1_list) + x.Epochs = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.GenesisState")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.GenesisState.epochs": + if x.Epochs == nil { + x.Epochs = []*EpochInfo{} + } + value := &_GenesisState_1_list{list: &x.Epochs} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.GenesisState")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.GenesisState.epochs": + list := []*EpochInfo{} + return protoreflect.ValueOfList(&_GenesisState_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.GenesisState")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.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 cosmos.epochs.v1beta1.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 len(x.Epochs) > 0 { + for _, e := range x.Epochs { + 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().(*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 len(x.Epochs) > 0 { + for iNdEx := len(x.Epochs) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Epochs[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Epochs", 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.Epochs = append(x.Epochs, &EpochInfo{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Epochs[len(x.Epochs)-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, + } +} + +// Since: cosmos-sdk 0.53 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cosmos/epochs/v1beta1/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) +) + +// EpochInfo is a struct that describes the data going into +// a timer defined by the x/epochs module. +type EpochInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // identifier is a unique reference to this particular timer. + Identifier string `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"` + // start_time is the time at which the timer first ever ticks. + // If start_time is in the future, the epoch will not begin until the start + // time. + StartTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` + // duration is the time in between epoch ticks. + // In order for intended behavior to be met, duration should + // be greater than the chains expected block time. + // Duration must be non-zero. + Duration *durationpb.Duration `protobuf:"bytes,3,opt,name=duration,proto3" json:"duration,omitempty"` + // current_epoch is the current epoch number, or in other words, + // how many times has the timer 'ticked'. + // The first tick (current_epoch=1) is defined as + // the first block whose blocktime is greater than the EpochInfo start_time. + CurrentEpoch int64 `protobuf:"varint,4,opt,name=current_epoch,json=currentEpoch,proto3" json:"current_epoch,omitempty"` + // current_epoch_start_time describes the start time of the current timer + // interval. The interval is (current_epoch_start_time, + // current_epoch_start_time + duration] When the timer ticks, this is set to + // current_epoch_start_time = last_epoch_start_time + duration only one timer + // tick for a given identifier can occur per block. + // + // NOTE! The current_epoch_start_time may diverge significantly from the + // wall-clock time the epoch began at. Wall-clock time of epoch start may be + // >> current_epoch_start_time. Suppose current_epoch_start_time = 10, + // duration = 5. Suppose the chain goes offline at t=14, and comes back online + // at t=30, and produces blocks at every successive time. (t=31, 32, etc.) + // * The t=30 block will start the epoch for (10, 15] + // * The t=31 block will start the epoch for (15, 20] + // * The t=32 block will start the epoch for (20, 25] + // * The t=33 block will start the epoch for (25, 30] + // * The t=34 block will start the epoch for (30, 35] + // * The **t=36** block will start the epoch for (35, 40] + CurrentEpochStartTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=current_epoch_start_time,json=currentEpochStartTime,proto3" json:"current_epoch_start_time,omitempty"` + // epoch_counting_started is a boolean, that indicates whether this + // epoch timer has began yet. + EpochCountingStarted bool `protobuf:"varint,6,opt,name=epoch_counting_started,json=epochCountingStarted,proto3" json:"epoch_counting_started,omitempty"` + // current_epoch_start_height is the block height at which the current epoch + // started. (The block height at which the timer last ticked) + CurrentEpochStartHeight int64 `protobuf:"varint,8,opt,name=current_epoch_start_height,json=currentEpochStartHeight,proto3" json:"current_epoch_start_height,omitempty"` +} + +func (x *EpochInfo) Reset() { + *x = EpochInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_epochs_v1beta1_genesis_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EpochInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EpochInfo) ProtoMessage() {} + +// Deprecated: Use EpochInfo.ProtoReflect.Descriptor instead. +func (*EpochInfo) Descriptor() ([]byte, []int) { + return file_cosmos_epochs_v1beta1_genesis_proto_rawDescGZIP(), []int{0} +} + +func (x *EpochInfo) GetIdentifier() string { + if x != nil { + return x.Identifier + } + return "" +} + +func (x *EpochInfo) GetStartTime() *timestamppb.Timestamp { + if x != nil { + return x.StartTime + } + return nil +} + +func (x *EpochInfo) GetDuration() *durationpb.Duration { + if x != nil { + return x.Duration + } + return nil +} + +func (x *EpochInfo) GetCurrentEpoch() int64 { + if x != nil { + return x.CurrentEpoch + } + return 0 +} + +func (x *EpochInfo) GetCurrentEpochStartTime() *timestamppb.Timestamp { + if x != nil { + return x.CurrentEpochStartTime + } + return nil +} + +func (x *EpochInfo) GetEpochCountingStarted() bool { + if x != nil { + return x.EpochCountingStarted + } + return false +} + +func (x *EpochInfo) GetCurrentEpochStartHeight() int64 { + if x != nil { + return x.CurrentEpochStartHeight + } + return 0 +} + +// GenesisState defines the epochs module's genesis state. +type GenesisState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Epochs []*EpochInfo `protobuf:"bytes,1,rep,name=epochs,proto3" json:"epochs,omitempty"` +} + +func (x *GenesisState) Reset() { + *x = GenesisState{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_epochs_v1beta1_genesis_proto_msgTypes[1] + 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_cosmos_epochs_v1beta1_genesis_proto_rawDescGZIP(), []int{1} +} + +func (x *GenesisState) GetEpochs() []*EpochInfo { + if x != nil { + return x.Epochs + } + return nil +} + +var File_cosmos_epochs_v1beta1_genesis_proto protoreflect.FileDescriptor + +var file_cosmos_epochs_v1beta1_genesis_proto_rawDesc = []byte{ + 0x0a, 0x23, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2f, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x70, + 0x6f, 0x63, 0x68, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x14, 0x67, 0x6f, + 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0xc4, 0x03, 0x0a, 0x09, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x49, 0x6e, 0x66, + 0x6f, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, + 0x72, 0x12, 0x43, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x09, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x55, 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x42, 0x1e, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x12, 0x64, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x98, + 0xdf, 0x1f, 0x01, 0x52, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, + 0x0d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, + 0x63, 0x68, 0x12, 0x5d, 0x0a, 0x18, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, + 0x6f, 0x63, 0x68, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x15, 0x63, 0x75, 0x72, 0x72, + 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, + 0x65, 0x12, 0x34, 0x0a, 0x16, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x14, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, + 0x53, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x12, 0x3b, 0x0a, 0x1a, 0x63, 0x75, 0x72, 0x72, 0x65, + 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x68, + 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x17, 0x63, 0x75, 0x72, + 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x53, 0x74, 0x61, 0x72, 0x74, 0x48, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x4a, 0x04, 0x08, 0x07, 0x10, 0x08, 0x22, 0x4e, 0x0a, 0x0c, 0x47, 0x65, + 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x3e, 0x0a, 0x06, 0x65, 0x70, + 0x6f, 0x63, 0x68, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x04, 0xc8, 0xde, + 0x1f, 0x00, 0x52, 0x06, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x42, 0xd5, 0x01, 0x0a, 0x19, 0x63, + 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, + 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x3b, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, + 0x03, 0x43, 0x45, 0x58, 0xaa, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x45, 0x70, + 0x6f, 0x63, 0x68, 0x73, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x15, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x5c, 0x56, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x21, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x45, 0x70, + 0x6f, 0x63, 0x68, 0x73, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x17, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x3a, 0x3a, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cosmos_epochs_v1beta1_genesis_proto_rawDescOnce sync.Once + file_cosmos_epochs_v1beta1_genesis_proto_rawDescData = file_cosmos_epochs_v1beta1_genesis_proto_rawDesc +) + +func file_cosmos_epochs_v1beta1_genesis_proto_rawDescGZIP() []byte { + file_cosmos_epochs_v1beta1_genesis_proto_rawDescOnce.Do(func() { + file_cosmos_epochs_v1beta1_genesis_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_epochs_v1beta1_genesis_proto_rawDescData) + }) + return file_cosmos_epochs_v1beta1_genesis_proto_rawDescData +} + +var file_cosmos_epochs_v1beta1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_cosmos_epochs_v1beta1_genesis_proto_goTypes = []interface{}{ + (*EpochInfo)(nil), // 0: cosmos.epochs.v1beta1.EpochInfo + (*GenesisState)(nil), // 1: cosmos.epochs.v1beta1.GenesisState + (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp + (*durationpb.Duration)(nil), // 3: google.protobuf.Duration +} +var file_cosmos_epochs_v1beta1_genesis_proto_depIdxs = []int32{ + 2, // 0: cosmos.epochs.v1beta1.EpochInfo.start_time:type_name -> google.protobuf.Timestamp + 3, // 1: cosmos.epochs.v1beta1.EpochInfo.duration:type_name -> google.protobuf.Duration + 2, // 2: cosmos.epochs.v1beta1.EpochInfo.current_epoch_start_time:type_name -> google.protobuf.Timestamp + 0, // 3: cosmos.epochs.v1beta1.GenesisState.epochs:type_name -> cosmos.epochs.v1beta1.EpochInfo + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_cosmos_epochs_v1beta1_genesis_proto_init() } +func file_cosmos_epochs_v1beta1_genesis_proto_init() { + if File_cosmos_epochs_v1beta1_genesis_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cosmos_epochs_v1beta1_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EpochInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_epochs_v1beta1_genesis_proto_msgTypes[1].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_cosmos_epochs_v1beta1_genesis_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cosmos_epochs_v1beta1_genesis_proto_goTypes, + DependencyIndexes: file_cosmos_epochs_v1beta1_genesis_proto_depIdxs, + MessageInfos: file_cosmos_epochs_v1beta1_genesis_proto_msgTypes, + }.Build() + File_cosmos_epochs_v1beta1_genesis_proto = out.File + file_cosmos_epochs_v1beta1_genesis_proto_rawDesc = nil + file_cosmos_epochs_v1beta1_genesis_proto_goTypes = nil + file_cosmos_epochs_v1beta1_genesis_proto_depIdxs = nil +} diff --git a/api/cosmos/epochs/v1beta1/query.pulsar.go b/api/cosmos/epochs/v1beta1/query.pulsar.go new file mode 100644 index 000000000000..52bb74d9553c --- /dev/null +++ b/api/cosmos/epochs/v1beta1/query.pulsar.go @@ -0,0 +1,2016 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package epochsv1beta1 + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_QueryEpochInfosRequest protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_epochs_v1beta1_query_proto_init() + md_QueryEpochInfosRequest = File_cosmos_epochs_v1beta1_query_proto.Messages().ByName("QueryEpochInfosRequest") +} + +var _ protoreflect.Message = (*fastReflection_QueryEpochInfosRequest)(nil) + +type fastReflection_QueryEpochInfosRequest QueryEpochInfosRequest + +func (x *QueryEpochInfosRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryEpochInfosRequest)(x) +} + +func (x *QueryEpochInfosRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_epochs_v1beta1_query_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryEpochInfosRequest_messageType fastReflection_QueryEpochInfosRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryEpochInfosRequest_messageType{} + +type fastReflection_QueryEpochInfosRequest_messageType struct{} + +func (x fastReflection_QueryEpochInfosRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryEpochInfosRequest)(nil) +} +func (x fastReflection_QueryEpochInfosRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryEpochInfosRequest) +} +func (x fastReflection_QueryEpochInfosRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryEpochInfosRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryEpochInfosRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryEpochInfosRequest +} + +// 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_QueryEpochInfosRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryEpochInfosRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryEpochInfosRequest) New() protoreflect.Message { + return new(fastReflection_QueryEpochInfosRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryEpochInfosRequest) Interface() protoreflect.ProtoMessage { + return (*QueryEpochInfosRequest)(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_QueryEpochInfosRequest) 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_QueryEpochInfosRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryEpochInfosRequest")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryEpochInfosRequest 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_QueryEpochInfosRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryEpochInfosRequest")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryEpochInfosRequest 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_QueryEpochInfosRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryEpochInfosRequest")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryEpochInfosRequest 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_QueryEpochInfosRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryEpochInfosRequest")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryEpochInfosRequest 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_QueryEpochInfosRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryEpochInfosRequest")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryEpochInfosRequest 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_QueryEpochInfosRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryEpochInfosRequest")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryEpochInfosRequest 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_QueryEpochInfosRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.epochs.v1beta1.QueryEpochInfosRequest", 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_QueryEpochInfosRequest) 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_QueryEpochInfosRequest) 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_QueryEpochInfosRequest) 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_QueryEpochInfosRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryEpochInfosRequest) + 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().(*QueryEpochInfosRequest) + 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().(*QueryEpochInfosRequest) + 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: QueryEpochInfosRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryEpochInfosRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_QueryEpochInfosResponse_1_list)(nil) + +type _QueryEpochInfosResponse_1_list struct { + list *[]*EpochInfo +} + +func (x *_QueryEpochInfosResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryEpochInfosResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryEpochInfosResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*EpochInfo) + (*x.list)[i] = concreteValue +} + +func (x *_QueryEpochInfosResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*EpochInfo) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryEpochInfosResponse_1_list) AppendMutable() protoreflect.Value { + v := new(EpochInfo) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryEpochInfosResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryEpochInfosResponse_1_list) NewElement() protoreflect.Value { + v := new(EpochInfo) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryEpochInfosResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryEpochInfosResponse protoreflect.MessageDescriptor + fd_QueryEpochInfosResponse_epochs protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_epochs_v1beta1_query_proto_init() + md_QueryEpochInfosResponse = File_cosmos_epochs_v1beta1_query_proto.Messages().ByName("QueryEpochInfosResponse") + fd_QueryEpochInfosResponse_epochs = md_QueryEpochInfosResponse.Fields().ByName("epochs") +} + +var _ protoreflect.Message = (*fastReflection_QueryEpochInfosResponse)(nil) + +type fastReflection_QueryEpochInfosResponse QueryEpochInfosResponse + +func (x *QueryEpochInfosResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryEpochInfosResponse)(x) +} + +func (x *QueryEpochInfosResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_epochs_v1beta1_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_QueryEpochInfosResponse_messageType fastReflection_QueryEpochInfosResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryEpochInfosResponse_messageType{} + +type fastReflection_QueryEpochInfosResponse_messageType struct{} + +func (x fastReflection_QueryEpochInfosResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryEpochInfosResponse)(nil) +} +func (x fastReflection_QueryEpochInfosResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryEpochInfosResponse) +} +func (x fastReflection_QueryEpochInfosResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryEpochInfosResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryEpochInfosResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryEpochInfosResponse +} + +// 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_QueryEpochInfosResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryEpochInfosResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryEpochInfosResponse) New() protoreflect.Message { + return new(fastReflection_QueryEpochInfosResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryEpochInfosResponse) Interface() protoreflect.ProtoMessage { + return (*QueryEpochInfosResponse)(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_QueryEpochInfosResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Epochs) != 0 { + value := protoreflect.ValueOfList(&_QueryEpochInfosResponse_1_list{list: &x.Epochs}) + if !f(fd_QueryEpochInfosResponse_epochs, 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_QueryEpochInfosResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.QueryEpochInfosResponse.epochs": + return len(x.Epochs) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryEpochInfosResponse")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryEpochInfosResponse 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_QueryEpochInfosResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.QueryEpochInfosResponse.epochs": + x.Epochs = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryEpochInfosResponse")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryEpochInfosResponse 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_QueryEpochInfosResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.epochs.v1beta1.QueryEpochInfosResponse.epochs": + if len(x.Epochs) == 0 { + return protoreflect.ValueOfList(&_QueryEpochInfosResponse_1_list{}) + } + listValue := &_QueryEpochInfosResponse_1_list{list: &x.Epochs} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryEpochInfosResponse")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryEpochInfosResponse 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_QueryEpochInfosResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.QueryEpochInfosResponse.epochs": + lv := value.List() + clv := lv.(*_QueryEpochInfosResponse_1_list) + x.Epochs = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryEpochInfosResponse")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryEpochInfosResponse 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_QueryEpochInfosResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.QueryEpochInfosResponse.epochs": + if x.Epochs == nil { + x.Epochs = []*EpochInfo{} + } + value := &_QueryEpochInfosResponse_1_list{list: &x.Epochs} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryEpochInfosResponse")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryEpochInfosResponse 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_QueryEpochInfosResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.QueryEpochInfosResponse.epochs": + list := []*EpochInfo{} + return protoreflect.ValueOfList(&_QueryEpochInfosResponse_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryEpochInfosResponse")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryEpochInfosResponse 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_QueryEpochInfosResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.epochs.v1beta1.QueryEpochInfosResponse", 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_QueryEpochInfosResponse) 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_QueryEpochInfosResponse) 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_QueryEpochInfosResponse) 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_QueryEpochInfosResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryEpochInfosResponse) + 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.Epochs) > 0 { + for _, e := range x.Epochs { + 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().(*QueryEpochInfosResponse) + 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.Epochs) > 0 { + for iNdEx := len(x.Epochs) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Epochs[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryEpochInfosResponse) + 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: QueryEpochInfosResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryEpochInfosResponse: 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 Epochs", 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.Epochs = append(x.Epochs, &EpochInfo{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Epochs[len(x.Epochs)-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_QueryCurrentEpochRequest protoreflect.MessageDescriptor + fd_QueryCurrentEpochRequest_identifier protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_epochs_v1beta1_query_proto_init() + md_QueryCurrentEpochRequest = File_cosmos_epochs_v1beta1_query_proto.Messages().ByName("QueryCurrentEpochRequest") + fd_QueryCurrentEpochRequest_identifier = md_QueryCurrentEpochRequest.Fields().ByName("identifier") +} + +var _ protoreflect.Message = (*fastReflection_QueryCurrentEpochRequest)(nil) + +type fastReflection_QueryCurrentEpochRequest QueryCurrentEpochRequest + +func (x *QueryCurrentEpochRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryCurrentEpochRequest)(x) +} + +func (x *QueryCurrentEpochRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_epochs_v1beta1_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_QueryCurrentEpochRequest_messageType fastReflection_QueryCurrentEpochRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryCurrentEpochRequest_messageType{} + +type fastReflection_QueryCurrentEpochRequest_messageType struct{} + +func (x fastReflection_QueryCurrentEpochRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryCurrentEpochRequest)(nil) +} +func (x fastReflection_QueryCurrentEpochRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryCurrentEpochRequest) +} +func (x fastReflection_QueryCurrentEpochRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryCurrentEpochRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryCurrentEpochRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryCurrentEpochRequest +} + +// 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_QueryCurrentEpochRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryCurrentEpochRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryCurrentEpochRequest) New() protoreflect.Message { + return new(fastReflection_QueryCurrentEpochRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryCurrentEpochRequest) Interface() protoreflect.ProtoMessage { + return (*QueryCurrentEpochRequest)(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_QueryCurrentEpochRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Identifier != "" { + value := protoreflect.ValueOfString(x.Identifier) + if !f(fd_QueryCurrentEpochRequest_identifier, 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_QueryCurrentEpochRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.QueryCurrentEpochRequest.identifier": + return x.Identifier != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryCurrentEpochRequest")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryCurrentEpochRequest 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_QueryCurrentEpochRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.QueryCurrentEpochRequest.identifier": + x.Identifier = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryCurrentEpochRequest")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryCurrentEpochRequest 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_QueryCurrentEpochRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.epochs.v1beta1.QueryCurrentEpochRequest.identifier": + value := x.Identifier + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryCurrentEpochRequest")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryCurrentEpochRequest 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_QueryCurrentEpochRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.QueryCurrentEpochRequest.identifier": + x.Identifier = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryCurrentEpochRequest")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryCurrentEpochRequest 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_QueryCurrentEpochRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.QueryCurrentEpochRequest.identifier": + panic(fmt.Errorf("field identifier of message cosmos.epochs.v1beta1.QueryCurrentEpochRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryCurrentEpochRequest")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryCurrentEpochRequest 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_QueryCurrentEpochRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.QueryCurrentEpochRequest.identifier": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryCurrentEpochRequest")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryCurrentEpochRequest 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_QueryCurrentEpochRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.epochs.v1beta1.QueryCurrentEpochRequest", 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_QueryCurrentEpochRequest) 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_QueryCurrentEpochRequest) 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_QueryCurrentEpochRequest) 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_QueryCurrentEpochRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryCurrentEpochRequest) + 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.Identifier) + 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().(*QueryCurrentEpochRequest) + 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.Identifier) > 0 { + i -= len(x.Identifier) + copy(dAtA[i:], x.Identifier) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Identifier))) + 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().(*QueryCurrentEpochRequest) + 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: QueryCurrentEpochRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryCurrentEpochRequest: 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 Identifier", 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.Identifier = 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_QueryCurrentEpochResponse protoreflect.MessageDescriptor + fd_QueryCurrentEpochResponse_current_epoch protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_epochs_v1beta1_query_proto_init() + md_QueryCurrentEpochResponse = File_cosmos_epochs_v1beta1_query_proto.Messages().ByName("QueryCurrentEpochResponse") + fd_QueryCurrentEpochResponse_current_epoch = md_QueryCurrentEpochResponse.Fields().ByName("current_epoch") +} + +var _ protoreflect.Message = (*fastReflection_QueryCurrentEpochResponse)(nil) + +type fastReflection_QueryCurrentEpochResponse QueryCurrentEpochResponse + +func (x *QueryCurrentEpochResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryCurrentEpochResponse)(x) +} + +func (x *QueryCurrentEpochResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_epochs_v1beta1_query_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryCurrentEpochResponse_messageType fastReflection_QueryCurrentEpochResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryCurrentEpochResponse_messageType{} + +type fastReflection_QueryCurrentEpochResponse_messageType struct{} + +func (x fastReflection_QueryCurrentEpochResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryCurrentEpochResponse)(nil) +} +func (x fastReflection_QueryCurrentEpochResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryCurrentEpochResponse) +} +func (x fastReflection_QueryCurrentEpochResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryCurrentEpochResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryCurrentEpochResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryCurrentEpochResponse +} + +// 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_QueryCurrentEpochResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryCurrentEpochResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryCurrentEpochResponse) New() protoreflect.Message { + return new(fastReflection_QueryCurrentEpochResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryCurrentEpochResponse) Interface() protoreflect.ProtoMessage { + return (*QueryCurrentEpochResponse)(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_QueryCurrentEpochResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.CurrentEpoch != int64(0) { + value := protoreflect.ValueOfInt64(x.CurrentEpoch) + if !f(fd_QueryCurrentEpochResponse_current_epoch, 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_QueryCurrentEpochResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.QueryCurrentEpochResponse.current_epoch": + return x.CurrentEpoch != int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryCurrentEpochResponse")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryCurrentEpochResponse 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_QueryCurrentEpochResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.QueryCurrentEpochResponse.current_epoch": + x.CurrentEpoch = int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryCurrentEpochResponse")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryCurrentEpochResponse 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_QueryCurrentEpochResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.epochs.v1beta1.QueryCurrentEpochResponse.current_epoch": + value := x.CurrentEpoch + return protoreflect.ValueOfInt64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryCurrentEpochResponse")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryCurrentEpochResponse 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_QueryCurrentEpochResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.QueryCurrentEpochResponse.current_epoch": + x.CurrentEpoch = value.Int() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryCurrentEpochResponse")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryCurrentEpochResponse 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_QueryCurrentEpochResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.QueryCurrentEpochResponse.current_epoch": + panic(fmt.Errorf("field current_epoch of message cosmos.epochs.v1beta1.QueryCurrentEpochResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryCurrentEpochResponse")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryCurrentEpochResponse 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_QueryCurrentEpochResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.QueryCurrentEpochResponse.current_epoch": + return protoreflect.ValueOfInt64(int64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryCurrentEpochResponse")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryCurrentEpochResponse 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_QueryCurrentEpochResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.epochs.v1beta1.QueryCurrentEpochResponse", 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_QueryCurrentEpochResponse) 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_QueryCurrentEpochResponse) 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_QueryCurrentEpochResponse) 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_QueryCurrentEpochResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryCurrentEpochResponse) + 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.CurrentEpoch != 0 { + n += 1 + runtime.Sov(uint64(x.CurrentEpoch)) + } + 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().(*QueryCurrentEpochResponse) + 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.CurrentEpoch != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.CurrentEpoch)) + 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().(*QueryCurrentEpochResponse) + 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: QueryCurrentEpochResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryCurrentEpochResponse: 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 CurrentEpoch", wireType) + } + x.CurrentEpoch = 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.CurrentEpoch |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Since: cosmos-sdk 0.53 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cosmos/epochs/v1beta1/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) +) + +// QueryEpochInfosRequest defines the gRPC request structure for +// querying all epoch info. +type QueryEpochInfosRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryEpochInfosRequest) Reset() { + *x = QueryEpochInfosRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_epochs_v1beta1_query_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryEpochInfosRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryEpochInfosRequest) ProtoMessage() {} + +// Deprecated: Use QueryEpochInfosRequest.ProtoReflect.Descriptor instead. +func (*QueryEpochInfosRequest) Descriptor() ([]byte, []int) { + return file_cosmos_epochs_v1beta1_query_proto_rawDescGZIP(), []int{0} +} + +// QueryEpochInfosRequest defines the gRPC response structure for +// querying all epoch info. +type QueryEpochInfosResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Epochs []*EpochInfo `protobuf:"bytes,1,rep,name=epochs,proto3" json:"epochs,omitempty"` +} + +func (x *QueryEpochInfosResponse) Reset() { + *x = QueryEpochInfosResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_epochs_v1beta1_query_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryEpochInfosResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryEpochInfosResponse) ProtoMessage() {} + +// Deprecated: Use QueryEpochInfosResponse.ProtoReflect.Descriptor instead. +func (*QueryEpochInfosResponse) Descriptor() ([]byte, []int) { + return file_cosmos_epochs_v1beta1_query_proto_rawDescGZIP(), []int{1} +} + +func (x *QueryEpochInfosResponse) GetEpochs() []*EpochInfo { + if x != nil { + return x.Epochs + } + return nil +} + +// QueryCurrentEpochRequest defines the gRPC request structure for +// querying an epoch by its identifier. +type QueryCurrentEpochRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Identifier string `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"` +} + +func (x *QueryCurrentEpochRequest) Reset() { + *x = QueryCurrentEpochRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_epochs_v1beta1_query_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryCurrentEpochRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryCurrentEpochRequest) ProtoMessage() {} + +// Deprecated: Use QueryCurrentEpochRequest.ProtoReflect.Descriptor instead. +func (*QueryCurrentEpochRequest) Descriptor() ([]byte, []int) { + return file_cosmos_epochs_v1beta1_query_proto_rawDescGZIP(), []int{2} +} + +func (x *QueryCurrentEpochRequest) GetIdentifier() string { + if x != nil { + return x.Identifier + } + return "" +} + +// QueryCurrentEpochResponse defines the gRPC response structure for +// querying an epoch by its identifier. +type QueryCurrentEpochResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CurrentEpoch int64 `protobuf:"varint,1,opt,name=current_epoch,json=currentEpoch,proto3" json:"current_epoch,omitempty"` +} + +func (x *QueryCurrentEpochResponse) Reset() { + *x = QueryCurrentEpochResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_epochs_v1beta1_query_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryCurrentEpochResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryCurrentEpochResponse) ProtoMessage() {} + +// Deprecated: Use QueryCurrentEpochResponse.ProtoReflect.Descriptor instead. +func (*QueryCurrentEpochResponse) Descriptor() ([]byte, []int) { + return file_cosmos_epochs_v1beta1_query_proto_rawDescGZIP(), []int{3} +} + +func (x *QueryCurrentEpochResponse) GetCurrentEpoch() int64 { + if x != nil { + return x.CurrentEpoch + } + return 0 +} + +var File_cosmos_epochs_v1beta1_query_proto protoreflect.FileDescriptor + +var file_cosmos_epochs_v1beta1_query_proto_rawDesc = []byte{ + 0x0a, 0x21, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2f, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x70, 0x6f, 0x63, + 0x68, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 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, 0x1a, 0x23, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2f, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0x18, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x70, 0x6f, 0x63, + 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x59, 0x0a, + 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x06, 0x65, 0x70, 0x6f, 0x63, + 0x68, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, + 0x52, 0x06, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x22, 0x3a, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x66, 0x69, 0x65, 0x72, 0x22, 0x40, 0x0a, 0x19, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x75, 0x72, + 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, + 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, + 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x32, 0xbe, 0x02, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x12, 0x92, 0x01, 0x0a, 0x0a, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x12, + 0x2d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x70, 0x6f, + 0x63, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x70, 0x6f, 0x63, + 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, + 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x65, + 0x70, 0x6f, 0x63, 0x68, 0x73, 0x12, 0x9f, 0x01, 0x0a, 0x0c, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, + 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x2f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, + 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x26, 0x12, 0x24, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x70, 0x6f, 0x63, 0x68, + 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, + 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x42, 0xd3, 0x01, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, + 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x70, 0x6f, + 0x63, 0x68, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x65, 0x70, 0x6f, 0x63, + 0x68, 0x73, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x45, 0x58, 0xaa, + 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2e, + 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x5c, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, + 0x02, 0x21, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x5c, + 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x17, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x45, 0x70, + 0x6f, 0x63, 0x68, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cosmos_epochs_v1beta1_query_proto_rawDescOnce sync.Once + file_cosmos_epochs_v1beta1_query_proto_rawDescData = file_cosmos_epochs_v1beta1_query_proto_rawDesc +) + +func file_cosmos_epochs_v1beta1_query_proto_rawDescGZIP() []byte { + file_cosmos_epochs_v1beta1_query_proto_rawDescOnce.Do(func() { + file_cosmos_epochs_v1beta1_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_epochs_v1beta1_query_proto_rawDescData) + }) + return file_cosmos_epochs_v1beta1_query_proto_rawDescData +} + +var file_cosmos_epochs_v1beta1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_cosmos_epochs_v1beta1_query_proto_goTypes = []interface{}{ + (*QueryEpochInfosRequest)(nil), // 0: cosmos.epochs.v1beta1.QueryEpochInfosRequest + (*QueryEpochInfosResponse)(nil), // 1: cosmos.epochs.v1beta1.QueryEpochInfosResponse + (*QueryCurrentEpochRequest)(nil), // 2: cosmos.epochs.v1beta1.QueryCurrentEpochRequest + (*QueryCurrentEpochResponse)(nil), // 3: cosmos.epochs.v1beta1.QueryCurrentEpochResponse + (*EpochInfo)(nil), // 4: cosmos.epochs.v1beta1.EpochInfo +} +var file_cosmos_epochs_v1beta1_query_proto_depIdxs = []int32{ + 4, // 0: cosmos.epochs.v1beta1.QueryEpochInfosResponse.epochs:type_name -> cosmos.epochs.v1beta1.EpochInfo + 0, // 1: cosmos.epochs.v1beta1.Query.EpochInfos:input_type -> cosmos.epochs.v1beta1.QueryEpochInfosRequest + 2, // 2: cosmos.epochs.v1beta1.Query.CurrentEpoch:input_type -> cosmos.epochs.v1beta1.QueryCurrentEpochRequest + 1, // 3: cosmos.epochs.v1beta1.Query.EpochInfos:output_type -> cosmos.epochs.v1beta1.QueryEpochInfosResponse + 3, // 4: cosmos.epochs.v1beta1.Query.CurrentEpoch:output_type -> cosmos.epochs.v1beta1.QueryCurrentEpochResponse + 3, // [3:5] is the sub-list for method output_type + 1, // [1:3] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_cosmos_epochs_v1beta1_query_proto_init() } +func file_cosmos_epochs_v1beta1_query_proto_init() { + if File_cosmos_epochs_v1beta1_query_proto != nil { + return + } + file_cosmos_epochs_v1beta1_genesis_proto_init() + if !protoimpl.UnsafeEnabled { + file_cosmos_epochs_v1beta1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryEpochInfosRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_epochs_v1beta1_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryEpochInfosResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_epochs_v1beta1_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryCurrentEpochRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_epochs_v1beta1_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryCurrentEpochResponse); 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_cosmos_epochs_v1beta1_query_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_cosmos_epochs_v1beta1_query_proto_goTypes, + DependencyIndexes: file_cosmos_epochs_v1beta1_query_proto_depIdxs, + MessageInfos: file_cosmos_epochs_v1beta1_query_proto_msgTypes, + }.Build() + File_cosmos_epochs_v1beta1_query_proto = out.File + file_cosmos_epochs_v1beta1_query_proto_rawDesc = nil + file_cosmos_epochs_v1beta1_query_proto_goTypes = nil + file_cosmos_epochs_v1beta1_query_proto_depIdxs = nil +} diff --git a/api/cosmos/epochs/v1beta1/query_grpc.pb.go b/api/cosmos/epochs/v1beta1/query_grpc.pb.go new file mode 100644 index 000000000000..bc4dd21a512a --- /dev/null +++ b/api/cosmos/epochs/v1beta1/query_grpc.pb.go @@ -0,0 +1,169 @@ +// Since: cosmos-sdk 0.53 + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc (unknown) +// source: cosmos/epochs/v1beta1/query.proto + +package epochsv1beta1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Query_EpochInfos_FullMethodName = "/cosmos.epochs.v1beta1.Query/EpochInfos" + Query_CurrentEpoch_FullMethodName = "/cosmos.epochs.v1beta1.Query/CurrentEpoch" +) + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Query defines the gRPC querier service. +type QueryClient interface { + // EpochInfos provide running epochInfos + EpochInfos(ctx context.Context, in *QueryEpochInfosRequest, opts ...grpc.CallOption) (*QueryEpochInfosResponse, error) + // CurrentEpoch provide current epoch of specified identifier + CurrentEpoch(ctx context.Context, in *QueryCurrentEpochRequest, opts ...grpc.CallOption) (*QueryCurrentEpochResponse, error) +} + +type queryClient struct { + cc grpc.ClientConnInterface +} + +func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) EpochInfos(ctx context.Context, in *QueryEpochInfosRequest, opts ...grpc.CallOption) (*QueryEpochInfosResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryEpochInfosResponse) + err := c.cc.Invoke(ctx, Query_EpochInfos_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) CurrentEpoch(ctx context.Context, in *QueryCurrentEpochRequest, opts ...grpc.CallOption) (*QueryCurrentEpochResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryCurrentEpochResponse) + err := c.cc.Invoke(ctx, Query_CurrentEpoch_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +// All implementations must embed UnimplementedQueryServer +// for forward compatibility. +// +// Query defines the gRPC querier service. +type QueryServer interface { + // EpochInfos provide running epochInfos + EpochInfos(context.Context, *QueryEpochInfosRequest) (*QueryEpochInfosResponse, error) + // CurrentEpoch provide current epoch of specified identifier + CurrentEpoch(context.Context, *QueryCurrentEpochRequest) (*QueryCurrentEpochResponse, error) + mustEmbedUnimplementedQueryServer() +} + +// UnimplementedQueryServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedQueryServer struct{} + +func (UnimplementedQueryServer) EpochInfos(context.Context, *QueryEpochInfosRequest) (*QueryEpochInfosResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EpochInfos not implemented") +} +func (UnimplementedQueryServer) CurrentEpoch(context.Context, *QueryCurrentEpochRequest) (*QueryCurrentEpochResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CurrentEpoch not implemented") +} +func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} +func (UnimplementedQueryServer) testEmbeddedByValue() {} + +// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to QueryServer will +// result in compilation errors. +type UnsafeQueryServer interface { + mustEmbedUnimplementedQueryServer() +} + +func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + // If the following call pancis, it indicates UnimplementedQueryServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&Query_ServiceDesc, srv) +} + +func _Query_EpochInfos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryEpochInfosRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).EpochInfos(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_EpochInfos_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).EpochInfos(ctx, req.(*QueryEpochInfosRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_CurrentEpoch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryCurrentEpochRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).CurrentEpoch(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_CurrentEpoch_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).CurrentEpoch(ctx, req.(*QueryCurrentEpochRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Query_ServiceDesc is the grpc.ServiceDesc for Query service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Query_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.epochs.v1beta1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "EpochInfos", + Handler: _Query_EpochInfos_Handler, + }, + { + MethodName: "CurrentEpoch", + Handler: _Query_CurrentEpoch_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/epochs/v1beta1/query.proto", +} diff --git a/api/cosmos/evidence/v1beta1/evidence.pulsar.go b/api/cosmos/evidence/v1beta1/evidence.pulsar.go index 4f526190ba8c..cd5519367d81 100644 --- a/api/cosmos/evidence/v1beta1/evidence.pulsar.go +++ b/api/cosmos/evidence/v1beta1/evidence.pulsar.go @@ -717,21 +717,21 @@ var file_cosmos_evidence_v1beta1_evidence_proto_rawDesc = []byte{ 0x6e, 0x73, 0x75, 0x73, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x24, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x8a, 0xe7, 0xb0, 0x2a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x45, 0x71, 0x75, 0x69, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x42, 0xe8, 0x01, 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x65, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x42, 0x0d, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x38, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x69, 0x64, - 0x65, 0x6e, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x65, 0x76, 0x69, - 0x64, 0x65, 0x6e, 0x63, 0x65, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, - 0x45, 0x58, 0xaa, 0x02, 0x17, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x45, 0x76, 0x69, 0x64, - 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x17, 0x43, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x5c, 0x56, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x23, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, - 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x19, 0x43, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x3a, - 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa8, 0xe2, 0x1e, 0x01, 0x62, 0x06, 0x70, 0x72, + 0x6e, 0x42, 0xe8, 0x01, 0xa8, 0xe2, 0x1e, 0x01, 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0d, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x38, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, + 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, + 0x65, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x3b, 0x65, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0xa2, 0x02, 0x03, 0x43, 0x45, 0x58, 0xaa, 0x02, 0x17, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0xca, 0x02, 0x17, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, + 0x63, 0x65, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x23, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x5c, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x5c, 0x56, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x19, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x45, 0x76, 0x69, 0x64, 0x65, + 0x6e, 0x63, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } diff --git a/api/cosmos/evidence/v1beta1/query_grpc.pb.go b/api/cosmos/evidence/v1beta1/query_grpc.pb.go index 1cdc5322636e..2fa484ef59f4 100644 --- a/api/cosmos/evidence/v1beta1/query_grpc.pb.go +++ b/api/cosmos/evidence/v1beta1/query_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/evidence/v1beta1/query.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Query_Evidence_FullMethodName = "/cosmos.evidence.v1beta1.Query/Evidence" @@ -26,6 +26,8 @@ const ( // QueryClient is the client API for Query service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Query defines the gRPC querier service. type QueryClient interface { // Evidence queries evidence based on evidence hash. Evidence(ctx context.Context, in *QueryEvidenceRequest, opts ...grpc.CallOption) (*QueryEvidenceResponse, error) @@ -42,8 +44,9 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { } func (c *queryClient) Evidence(ctx context.Context, in *QueryEvidenceRequest, opts ...grpc.CallOption) (*QueryEvidenceResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryEvidenceResponse) - err := c.cc.Invoke(ctx, Query_Evidence_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Evidence_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -51,8 +54,9 @@ func (c *queryClient) Evidence(ctx context.Context, in *QueryEvidenceRequest, op } func (c *queryClient) AllEvidence(ctx context.Context, in *QueryAllEvidenceRequest, opts ...grpc.CallOption) (*QueryAllEvidenceResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryAllEvidenceResponse) - err := c.cc.Invoke(ctx, Query_AllEvidence_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_AllEvidence_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -61,7 +65,9 @@ func (c *queryClient) AllEvidence(ctx context.Context, in *QueryAllEvidenceReque // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer -// for forward compatibility +// for forward compatibility. +// +// Query defines the gRPC querier service. type QueryServer interface { // Evidence queries evidence based on evidence hash. Evidence(context.Context, *QueryEvidenceRequest) (*QueryEvidenceResponse, error) @@ -70,9 +76,12 @@ type QueryServer interface { mustEmbedUnimplementedQueryServer() } -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} +// UnimplementedQueryServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedQueryServer struct{} func (UnimplementedQueryServer) Evidence(context.Context, *QueryEvidenceRequest) (*QueryEvidenceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Evidence not implemented") @@ -81,6 +90,7 @@ func (UnimplementedQueryServer) AllEvidence(context.Context, *QueryAllEvidenceRe return nil, status.Errorf(codes.Unimplemented, "method AllEvidence not implemented") } func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} +func (UnimplementedQueryServer) testEmbeddedByValue() {} // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to QueryServer will @@ -90,6 +100,13 @@ type UnsafeQueryServer interface { } func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + // If the following call pancis, it indicates UnimplementedQueryServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Query_ServiceDesc, srv) } diff --git a/api/cosmos/evidence/v1beta1/tx.pulsar.go b/api/cosmos/evidence/v1beta1/tx.pulsar.go index b015b577268e..e86b10e99ffa 100644 --- a/api/cosmos/evidence/v1beta1/tx.pulsar.go +++ b/api/cosmos/evidence/v1beta1/tx.pulsar.go @@ -1074,21 +1074,21 @@ var file_cosmos_evidence_v1beta1_tx_proto_rawDesc = []byte{ 0x73, 0x2e, 0x65, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, - 0xb0, 0x2a, 0x01, 0x42, 0xe2, 0x01, 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x38, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, - 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x65, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, - 0x65, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x45, 0x58, 0xaa, 0x02, - 0x17, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, - 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x17, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x5c, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0xe2, 0x02, 0x23, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x45, 0x76, 0x69, 0x64, - 0x65, 0x6e, 0x63, 0x65, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x19, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x3a, 0x3a, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0xa8, 0xe2, 0x1e, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0xb0, 0x2a, 0x01, 0x42, 0xe2, 0x01, 0xa8, 0xe2, 0x1e, 0x01, 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x38, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x69, 0x64, + 0x65, 0x6e, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x65, 0x76, 0x69, + 0x64, 0x65, 0x6e, 0x63, 0x65, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, + 0x45, 0x58, 0xaa, 0x02, 0x17, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x45, 0x76, 0x69, 0x64, + 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x17, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x5c, 0x56, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x23, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, + 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x19, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x3a, + 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/evidence/v1beta1/tx_grpc.pb.go b/api/cosmos/evidence/v1beta1/tx_grpc.pb.go index c9335210707f..e26d58ffb12b 100644 --- a/api/cosmos/evidence/v1beta1/tx_grpc.pb.go +++ b/api/cosmos/evidence/v1beta1/tx_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/evidence/v1beta1/tx.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Msg_SubmitEvidence_FullMethodName = "/cosmos.evidence.v1beta1.Msg/SubmitEvidence" @@ -25,6 +25,8 @@ const ( // MsgClient is the client API for Msg service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Msg defines the evidence Msg service. type MsgClient interface { // SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or // counterfactual signing. @@ -40,8 +42,9 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { } func (c *msgClient) SubmitEvidence(ctx context.Context, in *MsgSubmitEvidence, opts ...grpc.CallOption) (*MsgSubmitEvidenceResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgSubmitEvidenceResponse) - err := c.cc.Invoke(ctx, Msg_SubmitEvidence_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_SubmitEvidence_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -50,7 +53,9 @@ func (c *msgClient) SubmitEvidence(ctx context.Context, in *MsgSubmitEvidence, o // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer -// for forward compatibility +// for forward compatibility. +// +// Msg defines the evidence Msg service. type MsgServer interface { // SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or // counterfactual signing. @@ -58,14 +63,18 @@ type MsgServer interface { mustEmbedUnimplementedMsgServer() } -// UnimplementedMsgServer must be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} +// UnimplementedMsgServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedMsgServer struct{} func (UnimplementedMsgServer) SubmitEvidence(context.Context, *MsgSubmitEvidence) (*MsgSubmitEvidenceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SubmitEvidence not implemented") } func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} +func (UnimplementedMsgServer) testEmbeddedByValue() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to MsgServer will @@ -75,6 +84,13 @@ type UnsafeMsgServer interface { } func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + // If the following call pancis, it indicates UnimplementedMsgServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Msg_ServiceDesc, srv) } diff --git a/api/cosmos/feegrant/v1beta1/query_grpc.pb.go b/api/cosmos/feegrant/v1beta1/query_grpc.pb.go index c323c42841ce..e95e3fd63454 100644 --- a/api/cosmos/feegrant/v1beta1/query_grpc.pb.go +++ b/api/cosmos/feegrant/v1beta1/query_grpc.pb.go @@ -2,7 +2,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/feegrant/v1beta1/query.proto @@ -17,8 +17,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Query_Allowance_FullMethodName = "/cosmos.feegrant.v1beta1.Query/Allowance" @@ -29,10 +29,12 @@ const ( // QueryClient is the client API for Query service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Query defines the gRPC querier service. type QueryClient interface { - // Allowance returns fee granted to the grantee by the granter. + // Allowance returns granted allwance to the grantee by the granter. Allowance(ctx context.Context, in *QueryAllowanceRequest, opts ...grpc.CallOption) (*QueryAllowanceResponse, error) - // Allowances returns all the grants for address. + // Allowances returns all the grants for the given grantee address. Allowances(ctx context.Context, in *QueryAllowancesRequest, opts ...grpc.CallOption) (*QueryAllowancesResponse, error) // AllowancesByGranter returns all the grants given by an address // @@ -49,8 +51,9 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { } func (c *queryClient) Allowance(ctx context.Context, in *QueryAllowanceRequest, opts ...grpc.CallOption) (*QueryAllowanceResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryAllowanceResponse) - err := c.cc.Invoke(ctx, Query_Allowance_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Allowance_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -58,8 +61,9 @@ func (c *queryClient) Allowance(ctx context.Context, in *QueryAllowanceRequest, } func (c *queryClient) Allowances(ctx context.Context, in *QueryAllowancesRequest, opts ...grpc.CallOption) (*QueryAllowancesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryAllowancesResponse) - err := c.cc.Invoke(ctx, Query_Allowances_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Allowances_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -67,8 +71,9 @@ func (c *queryClient) Allowances(ctx context.Context, in *QueryAllowancesRequest } func (c *queryClient) AllowancesByGranter(ctx context.Context, in *QueryAllowancesByGranterRequest, opts ...grpc.CallOption) (*QueryAllowancesByGranterResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryAllowancesByGranterResponse) - err := c.cc.Invoke(ctx, Query_AllowancesByGranter_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_AllowancesByGranter_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -77,11 +82,13 @@ func (c *queryClient) AllowancesByGranter(ctx context.Context, in *QueryAllowanc // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer -// for forward compatibility +// for forward compatibility. +// +// Query defines the gRPC querier service. type QueryServer interface { - // Allowance returns fee granted to the grantee by the granter. + // Allowance returns granted allwance to the grantee by the granter. Allowance(context.Context, *QueryAllowanceRequest) (*QueryAllowanceResponse, error) - // Allowances returns all the grants for address. + // Allowances returns all the grants for the given grantee address. Allowances(context.Context, *QueryAllowancesRequest) (*QueryAllowancesResponse, error) // AllowancesByGranter returns all the grants given by an address // @@ -90,9 +97,12 @@ type QueryServer interface { mustEmbedUnimplementedQueryServer() } -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} +// UnimplementedQueryServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedQueryServer struct{} func (UnimplementedQueryServer) Allowance(context.Context, *QueryAllowanceRequest) (*QueryAllowanceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Allowance not implemented") @@ -104,6 +114,7 @@ func (UnimplementedQueryServer) AllowancesByGranter(context.Context, *QueryAllow return nil, status.Errorf(codes.Unimplemented, "method AllowancesByGranter not implemented") } func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} +func (UnimplementedQueryServer) testEmbeddedByValue() {} // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to QueryServer will @@ -113,6 +124,13 @@ type UnsafeQueryServer interface { } func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + // If the following call pancis, it indicates UnimplementedQueryServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Query_ServiceDesc, srv) } diff --git a/api/cosmos/feegrant/v1beta1/tx.pulsar.go b/api/cosmos/feegrant/v1beta1/tx.pulsar.go index 07dbc09fafe6..70056e9cbde3 100644 --- a/api/cosmos/feegrant/v1beta1/tx.pulsar.go +++ b/api/cosmos/feegrant/v1beta1/tx.pulsar.go @@ -1775,6 +1775,782 @@ func (x *fastReflection_MsgRevokeAllowanceResponse) ProtoMethods() *protoiface.M } } +var ( + md_MsgPruneAllowances protoreflect.MessageDescriptor + fd_MsgPruneAllowances_pruner protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_feegrant_v1beta1_tx_proto_init() + md_MsgPruneAllowances = File_cosmos_feegrant_v1beta1_tx_proto.Messages().ByName("MsgPruneAllowances") + fd_MsgPruneAllowances_pruner = md_MsgPruneAllowances.Fields().ByName("pruner") +} + +var _ protoreflect.Message = (*fastReflection_MsgPruneAllowances)(nil) + +type fastReflection_MsgPruneAllowances MsgPruneAllowances + +func (x *MsgPruneAllowances) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgPruneAllowances)(x) +} + +func (x *MsgPruneAllowances) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_feegrant_v1beta1_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_MsgPruneAllowances_messageType fastReflection_MsgPruneAllowances_messageType +var _ protoreflect.MessageType = fastReflection_MsgPruneAllowances_messageType{} + +type fastReflection_MsgPruneAllowances_messageType struct{} + +func (x fastReflection_MsgPruneAllowances_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgPruneAllowances)(nil) +} +func (x fastReflection_MsgPruneAllowances_messageType) New() protoreflect.Message { + return new(fastReflection_MsgPruneAllowances) +} +func (x fastReflection_MsgPruneAllowances_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgPruneAllowances +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgPruneAllowances) Descriptor() protoreflect.MessageDescriptor { + return md_MsgPruneAllowances +} + +// 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_MsgPruneAllowances) Type() protoreflect.MessageType { + return _fastReflection_MsgPruneAllowances_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgPruneAllowances) New() protoreflect.Message { + return new(fastReflection_MsgPruneAllowances) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgPruneAllowances) Interface() protoreflect.ProtoMessage { + return (*MsgPruneAllowances)(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_MsgPruneAllowances) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Pruner != "" { + value := protoreflect.ValueOfString(x.Pruner) + if !f(fd_MsgPruneAllowances_pruner, 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_MsgPruneAllowances) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.feegrant.v1beta1.MsgPruneAllowances.pruner": + return x.Pruner != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.feegrant.v1beta1.MsgPruneAllowances")) + } + panic(fmt.Errorf("message cosmos.feegrant.v1beta1.MsgPruneAllowances 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_MsgPruneAllowances) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.feegrant.v1beta1.MsgPruneAllowances.pruner": + x.Pruner = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.feegrant.v1beta1.MsgPruneAllowances")) + } + panic(fmt.Errorf("message cosmos.feegrant.v1beta1.MsgPruneAllowances 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_MsgPruneAllowances) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.feegrant.v1beta1.MsgPruneAllowances.pruner": + value := x.Pruner + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.feegrant.v1beta1.MsgPruneAllowances")) + } + panic(fmt.Errorf("message cosmos.feegrant.v1beta1.MsgPruneAllowances 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_MsgPruneAllowances) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.feegrant.v1beta1.MsgPruneAllowances.pruner": + x.Pruner = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.feegrant.v1beta1.MsgPruneAllowances")) + } + panic(fmt.Errorf("message cosmos.feegrant.v1beta1.MsgPruneAllowances 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_MsgPruneAllowances) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.feegrant.v1beta1.MsgPruneAllowances.pruner": + panic(fmt.Errorf("field pruner of message cosmos.feegrant.v1beta1.MsgPruneAllowances is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.feegrant.v1beta1.MsgPruneAllowances")) + } + panic(fmt.Errorf("message cosmos.feegrant.v1beta1.MsgPruneAllowances 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_MsgPruneAllowances) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.feegrant.v1beta1.MsgPruneAllowances.pruner": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.feegrant.v1beta1.MsgPruneAllowances")) + } + panic(fmt.Errorf("message cosmos.feegrant.v1beta1.MsgPruneAllowances 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_MsgPruneAllowances) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.feegrant.v1beta1.MsgPruneAllowances", 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_MsgPruneAllowances) 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_MsgPruneAllowances) 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_MsgPruneAllowances) 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_MsgPruneAllowances) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgPruneAllowances) + 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.Pruner) + 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().(*MsgPruneAllowances) + 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.Pruner) > 0 { + i -= len(x.Pruner) + copy(dAtA[i:], x.Pruner) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Pruner))) + 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().(*MsgPruneAllowances) + 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: MsgPruneAllowances: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgPruneAllowances: 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 Pruner", 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.Pruner = 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_MsgPruneAllowancesResponse protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_feegrant_v1beta1_tx_proto_init() + md_MsgPruneAllowancesResponse = File_cosmos_feegrant_v1beta1_tx_proto.Messages().ByName("MsgPruneAllowancesResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgPruneAllowancesResponse)(nil) + +type fastReflection_MsgPruneAllowancesResponse MsgPruneAllowancesResponse + +func (x *MsgPruneAllowancesResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgPruneAllowancesResponse)(x) +} + +func (x *MsgPruneAllowancesResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_feegrant_v1beta1_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_MsgPruneAllowancesResponse_messageType fastReflection_MsgPruneAllowancesResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgPruneAllowancesResponse_messageType{} + +type fastReflection_MsgPruneAllowancesResponse_messageType struct{} + +func (x fastReflection_MsgPruneAllowancesResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgPruneAllowancesResponse)(nil) +} +func (x fastReflection_MsgPruneAllowancesResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgPruneAllowancesResponse) +} +func (x fastReflection_MsgPruneAllowancesResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgPruneAllowancesResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgPruneAllowancesResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgPruneAllowancesResponse +} + +// 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_MsgPruneAllowancesResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgPruneAllowancesResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgPruneAllowancesResponse) New() protoreflect.Message { + return new(fastReflection_MsgPruneAllowancesResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgPruneAllowancesResponse) Interface() protoreflect.ProtoMessage { + return (*MsgPruneAllowancesResponse)(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_MsgPruneAllowancesResponse) 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_MsgPruneAllowancesResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.feegrant.v1beta1.MsgPruneAllowancesResponse")) + } + panic(fmt.Errorf("message cosmos.feegrant.v1beta1.MsgPruneAllowancesResponse 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_MsgPruneAllowancesResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.feegrant.v1beta1.MsgPruneAllowancesResponse")) + } + panic(fmt.Errorf("message cosmos.feegrant.v1beta1.MsgPruneAllowancesResponse 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_MsgPruneAllowancesResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.feegrant.v1beta1.MsgPruneAllowancesResponse")) + } + panic(fmt.Errorf("message cosmos.feegrant.v1beta1.MsgPruneAllowancesResponse 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_MsgPruneAllowancesResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.feegrant.v1beta1.MsgPruneAllowancesResponse")) + } + panic(fmt.Errorf("message cosmos.feegrant.v1beta1.MsgPruneAllowancesResponse 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_MsgPruneAllowancesResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.feegrant.v1beta1.MsgPruneAllowancesResponse")) + } + panic(fmt.Errorf("message cosmos.feegrant.v1beta1.MsgPruneAllowancesResponse 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_MsgPruneAllowancesResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.feegrant.v1beta1.MsgPruneAllowancesResponse")) + } + panic(fmt.Errorf("message cosmos.feegrant.v1beta1.MsgPruneAllowancesResponse 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_MsgPruneAllowancesResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.feegrant.v1beta1.MsgPruneAllowancesResponse", 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_MsgPruneAllowancesResponse) 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_MsgPruneAllowancesResponse) 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_MsgPruneAllowancesResponse) 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_MsgPruneAllowancesResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgPruneAllowancesResponse) + 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().(*MsgPruneAllowancesResponse) + 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().(*MsgPruneAllowancesResponse) + 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: MsgPruneAllowancesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgPruneAllowancesResponse: 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, + } +} + // Since: cosmos-sdk 0.43 // Code generated by protoc-gen-go. DO NOT EDIT. @@ -1946,6 +2722,74 @@ func (*MsgRevokeAllowanceResponse) Descriptor() ([]byte, []int) { return file_cosmos_feegrant_v1beta1_tx_proto_rawDescGZIP(), []int{3} } +// MsgPruneAllowances prunes expired fee allowances. +// +// Since cosmos-sdk 0.50 +type MsgPruneAllowances struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // pruner is the address of the user pruning expired allowances. + Pruner string `protobuf:"bytes,1,opt,name=pruner,proto3" json:"pruner,omitempty"` +} + +func (x *MsgPruneAllowances) Reset() { + *x = MsgPruneAllowances{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_feegrant_v1beta1_tx_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgPruneAllowances) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgPruneAllowances) ProtoMessage() {} + +// Deprecated: Use MsgPruneAllowances.ProtoReflect.Descriptor instead. +func (*MsgPruneAllowances) Descriptor() ([]byte, []int) { + return file_cosmos_feegrant_v1beta1_tx_proto_rawDescGZIP(), []int{4} +} + +func (x *MsgPruneAllowances) GetPruner() string { + if x != nil { + return x.Pruner + } + return "" +} + +// MsgPruneAllowancesResponse defines the Msg/PruneAllowancesResponse response type. +// +// Since cosmos-sdk 0.50 +type MsgPruneAllowancesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgPruneAllowancesResponse) Reset() { + *x = MsgPruneAllowancesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_feegrant_v1beta1_tx_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgPruneAllowancesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgPruneAllowancesResponse) ProtoMessage() {} + +// Deprecated: Use MsgPruneAllowancesResponse.ProtoReflect.Descriptor instead. +func (*MsgPruneAllowancesResponse) Descriptor() ([]byte, []int) { + return file_cosmos_feegrant_v1beta1_tx_proto_rawDescGZIP(), []int{5} +} + var File_cosmos_feegrant_v1beta1_tx_proto protoreflect.FileDescriptor var file_cosmos_feegrant_v1beta1_tx_proto_rawDesc = []byte{ @@ -1990,37 +2834,51 @@ var file_cosmos_feegrant_v1beta1_tx_proto_rawDesc = []byte{ 0x64, 0x6b, 0x2f, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x22, 0x1c, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x32, 0xf3, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x70, 0x0a, 0x0e, 0x47, - 0x72, 0x61, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x2a, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x66, 0x65, 0x65, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x47, 0x72, 0x61, 0x6e, 0x74, - 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x1a, 0x32, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x66, 0x65, 0x65, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x6f, - 0x77, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x73, 0x0a, - 0x0f, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, - 0x12, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x66, 0x65, 0x65, 0x67, 0x72, 0x61, + 0x6e, 0x73, 0x65, 0x22, 0x53, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x50, 0x72, 0x75, 0x6e, 0x65, 0x41, + 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x30, 0x0a, 0x06, 0x70, 0x72, 0x75, + 0x6e, 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, 0x06, 0x70, 0x72, 0x75, 0x6e, 0x65, 0x72, 0x3a, 0x0b, 0x82, 0xe7, 0xb0, + 0x2a, 0x06, 0x70, 0x72, 0x75, 0x6e, 0x65, 0x72, 0x22, 0x1c, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x50, + 0x72, 0x75, 0x6e, 0x65, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xe8, 0x02, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x70, + 0x0a, 0x0e, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, + 0x12, 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x66, 0x65, 0x65, 0x67, 0x72, 0x61, + 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x47, 0x72, + 0x61, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x1a, 0x32, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x66, 0x65, 0x65, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x41, + 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x73, 0x0a, 0x0f, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x61, + 0x6e, 0x63, 0x65, 0x12, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x66, 0x65, 0x65, + 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, + 0x67, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, + 0x1a, 0x33, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x66, 0x65, 0x65, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, - 0x76, 0x6f, 0x6b, 0x65, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x1a, 0x33, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x66, 0x65, 0x65, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x76, 0x6f, 0x6b, - 0x65, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xde, 0x01, 0x0a, 0x1b, 0x63, 0x6f, - 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x66, 0x65, 0x65, 0x67, 0x72, 0x61, 0x6e, - 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x38, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, - 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x66, 0x65, - 0x65, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x66, - 0x65, 0x65, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, - 0x03, 0x43, 0x46, 0x58, 0xaa, 0x02, 0x17, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x46, 0x65, - 0x65, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, - 0x17, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x46, 0x65, 0x65, 0x67, 0x72, 0x61, 0x6e, 0x74, - 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x23, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x5c, 0x46, 0x65, 0x65, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x19, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x46, 0x65, 0x65, 0x67, 0x72, 0x61, 0x6e, - 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x76, 0x6f, 0x6b, 0x65, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x73, 0x0a, 0x0f, 0x50, 0x72, 0x75, 0x6e, 0x65, 0x41, 0x6c, + 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x66, 0x65, 0x65, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x50, 0x72, 0x75, 0x6e, 0x65, 0x41, 0x6c, 0x6c, 0x6f, 0x77, + 0x61, 0x6e, 0x63, 0x65, 0x73, 0x1a, 0x33, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x66, + 0x65, 0x65, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x4d, 0x73, 0x67, 0x50, 0x72, 0x75, 0x6e, 0x65, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, + 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, + 0x01, 0x42, 0xde, 0x01, 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x66, 0x65, 0x65, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x38, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x66, 0x65, 0x65, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2f, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x66, 0x65, 0x65, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x46, 0x58, 0xaa, 0x02, 0x17, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x46, 0x65, 0x65, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e, 0x56, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x17, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, + 0x46, 0x65, 0x65, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0xe2, 0x02, 0x23, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x46, 0x65, 0x65, 0x67, 0x72, 0x61, + 0x6e, 0x74, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x19, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, + 0x3a, 0x46, 0x65, 0x65, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2035,22 +2893,26 @@ func file_cosmos_feegrant_v1beta1_tx_proto_rawDescGZIP() []byte { return file_cosmos_feegrant_v1beta1_tx_proto_rawDescData } -var file_cosmos_feegrant_v1beta1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_cosmos_feegrant_v1beta1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_cosmos_feegrant_v1beta1_tx_proto_goTypes = []interface{}{ (*MsgGrantAllowance)(nil), // 0: cosmos.feegrant.v1beta1.MsgGrantAllowance (*MsgGrantAllowanceResponse)(nil), // 1: cosmos.feegrant.v1beta1.MsgGrantAllowanceResponse (*MsgRevokeAllowance)(nil), // 2: cosmos.feegrant.v1beta1.MsgRevokeAllowance (*MsgRevokeAllowanceResponse)(nil), // 3: cosmos.feegrant.v1beta1.MsgRevokeAllowanceResponse - (*anypb.Any)(nil), // 4: google.protobuf.Any + (*MsgPruneAllowances)(nil), // 4: cosmos.feegrant.v1beta1.MsgPruneAllowances + (*MsgPruneAllowancesResponse)(nil), // 5: cosmos.feegrant.v1beta1.MsgPruneAllowancesResponse + (*anypb.Any)(nil), // 6: google.protobuf.Any } var file_cosmos_feegrant_v1beta1_tx_proto_depIdxs = []int32{ - 4, // 0: cosmos.feegrant.v1beta1.MsgGrantAllowance.allowance:type_name -> google.protobuf.Any + 6, // 0: cosmos.feegrant.v1beta1.MsgGrantAllowance.allowance:type_name -> google.protobuf.Any 0, // 1: cosmos.feegrant.v1beta1.Msg.GrantAllowance:input_type -> cosmos.feegrant.v1beta1.MsgGrantAllowance 2, // 2: cosmos.feegrant.v1beta1.Msg.RevokeAllowance:input_type -> cosmos.feegrant.v1beta1.MsgRevokeAllowance - 1, // 3: cosmos.feegrant.v1beta1.Msg.GrantAllowance:output_type -> cosmos.feegrant.v1beta1.MsgGrantAllowanceResponse - 3, // 4: cosmos.feegrant.v1beta1.Msg.RevokeAllowance:output_type -> cosmos.feegrant.v1beta1.MsgRevokeAllowanceResponse - 3, // [3:5] is the sub-list for method output_type - 1, // [1:3] is the sub-list for method input_type + 4, // 3: cosmos.feegrant.v1beta1.Msg.PruneAllowances:input_type -> cosmos.feegrant.v1beta1.MsgPruneAllowances + 1, // 4: cosmos.feegrant.v1beta1.Msg.GrantAllowance:output_type -> cosmos.feegrant.v1beta1.MsgGrantAllowanceResponse + 3, // 5: cosmos.feegrant.v1beta1.Msg.RevokeAllowance:output_type -> cosmos.feegrant.v1beta1.MsgRevokeAllowanceResponse + 5, // 6: cosmos.feegrant.v1beta1.Msg.PruneAllowances:output_type -> cosmos.feegrant.v1beta1.MsgPruneAllowancesResponse + 4, // [4:7] is the sub-list for method output_type + 1, // [1:4] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name 1, // [1:1] is the sub-list for extension extendee 0, // [0:1] is the sub-list for field type_name @@ -2110,6 +2972,30 @@ func file_cosmos_feegrant_v1beta1_tx_proto_init() { return nil } } + file_cosmos_feegrant_v1beta1_tx_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgPruneAllowances); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_feegrant_v1beta1_tx_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgPruneAllowancesResponse); 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{ @@ -2117,7 +3003,7 @@ func file_cosmos_feegrant_v1beta1_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_feegrant_v1beta1_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 6, NumExtensions: 0, NumServices: 1, }, diff --git a/api/cosmos/feegrant/v1beta1/tx_grpc.pb.go b/api/cosmos/feegrant/v1beta1/tx_grpc.pb.go index 47ddb7a8329b..d6e4b093b053 100644 --- a/api/cosmos/feegrant/v1beta1/tx_grpc.pb.go +++ b/api/cosmos/feegrant/v1beta1/tx_grpc.pb.go @@ -2,7 +2,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/feegrant/v1beta1/tx.proto @@ -17,17 +17,20 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Msg_GrantAllowance_FullMethodName = "/cosmos.feegrant.v1beta1.Msg/GrantAllowance" Msg_RevokeAllowance_FullMethodName = "/cosmos.feegrant.v1beta1.Msg/RevokeAllowance" + Msg_PruneAllowances_FullMethodName = "/cosmos.feegrant.v1beta1.Msg/PruneAllowances" ) // MsgClient is the client API for Msg service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Msg defines the feegrant msg service. type MsgClient interface { // GrantAllowance grants fee allowance to the grantee on the granter's // account with the provided expiration time. @@ -35,6 +38,10 @@ type MsgClient interface { // RevokeAllowance revokes any fee allowance of granter's account that // has been granted to the grantee. RevokeAllowance(ctx context.Context, in *MsgRevokeAllowance, opts ...grpc.CallOption) (*MsgRevokeAllowanceResponse, error) + // PruneAllowances prunes expired fee allowances, currently up to 75 at a time. + // + // Since cosmos-sdk 0.50 + PruneAllowances(ctx context.Context, in *MsgPruneAllowances, opts ...grpc.CallOption) (*MsgPruneAllowancesResponse, error) } type msgClient struct { @@ -46,8 +53,9 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { } func (c *msgClient) GrantAllowance(ctx context.Context, in *MsgGrantAllowance, opts ...grpc.CallOption) (*MsgGrantAllowanceResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgGrantAllowanceResponse) - err := c.cc.Invoke(ctx, Msg_GrantAllowance_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_GrantAllowance_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -55,8 +63,19 @@ func (c *msgClient) GrantAllowance(ctx context.Context, in *MsgGrantAllowance, o } func (c *msgClient) RevokeAllowance(ctx context.Context, in *MsgRevokeAllowance, opts ...grpc.CallOption) (*MsgRevokeAllowanceResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgRevokeAllowanceResponse) - err := c.cc.Invoke(ctx, Msg_RevokeAllowance_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_RevokeAllowance_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) PruneAllowances(ctx context.Context, in *MsgPruneAllowances, opts ...grpc.CallOption) (*MsgPruneAllowancesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgPruneAllowancesResponse) + err := c.cc.Invoke(ctx, Msg_PruneAllowances_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -65,7 +84,9 @@ func (c *msgClient) RevokeAllowance(ctx context.Context, in *MsgRevokeAllowance, // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer -// for forward compatibility +// for forward compatibility. +// +// Msg defines the feegrant msg service. type MsgServer interface { // GrantAllowance grants fee allowance to the grantee on the granter's // account with the provided expiration time. @@ -73,12 +94,19 @@ type MsgServer interface { // RevokeAllowance revokes any fee allowance of granter's account that // has been granted to the grantee. RevokeAllowance(context.Context, *MsgRevokeAllowance) (*MsgRevokeAllowanceResponse, error) + // PruneAllowances prunes expired fee allowances, currently up to 75 at a time. + // + // Since cosmos-sdk 0.50 + PruneAllowances(context.Context, *MsgPruneAllowances) (*MsgPruneAllowancesResponse, error) mustEmbedUnimplementedMsgServer() } -// UnimplementedMsgServer must be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} +// UnimplementedMsgServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedMsgServer struct{} func (UnimplementedMsgServer) GrantAllowance(context.Context, *MsgGrantAllowance) (*MsgGrantAllowanceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GrantAllowance not implemented") @@ -86,7 +114,11 @@ func (UnimplementedMsgServer) GrantAllowance(context.Context, *MsgGrantAllowance func (UnimplementedMsgServer) RevokeAllowance(context.Context, *MsgRevokeAllowance) (*MsgRevokeAllowanceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RevokeAllowance not implemented") } +func (UnimplementedMsgServer) PruneAllowances(context.Context, *MsgPruneAllowances) (*MsgPruneAllowancesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PruneAllowances not implemented") +} func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} +func (UnimplementedMsgServer) testEmbeddedByValue() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to MsgServer will @@ -96,6 +128,13 @@ type UnsafeMsgServer interface { } func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + // If the following call pancis, it indicates UnimplementedMsgServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Msg_ServiceDesc, srv) } @@ -135,6 +174,24 @@ func _Msg_RevokeAllowance_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +func _Msg_PruneAllowances_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgPruneAllowances) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).PruneAllowances(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_PruneAllowances_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).PruneAllowances(ctx, req.(*MsgPruneAllowances)) + } + return interceptor(ctx, in, info, handler) +} + // Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -150,6 +207,10 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ MethodName: "RevokeAllowance", Handler: _Msg_RevokeAllowance_Handler, }, + { + MethodName: "PruneAllowances", + Handler: _Msg_PruneAllowances_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/feegrant/v1beta1/tx.proto", diff --git a/api/cosmos/gov/v1/gov.pulsar.go b/api/cosmos/gov/v1/gov.pulsar.go index 840096573832..1200fbc1e4aa 100644 --- a/api/cosmos/gov/v1/gov.pulsar.go +++ b/api/cosmos/gov/v1/gov.pulsar.go @@ -1211,6 +1211,7 @@ var ( fd_Proposal_summary protoreflect.FieldDescriptor fd_Proposal_proposer protoreflect.FieldDescriptor fd_Proposal_expedited protoreflect.FieldDescriptor + fd_Proposal_failed_reason protoreflect.FieldDescriptor ) func init() { @@ -1230,6 +1231,7 @@ func init() { fd_Proposal_summary = md_Proposal.Fields().ByName("summary") fd_Proposal_proposer = md_Proposal.Fields().ByName("proposer") fd_Proposal_expedited = md_Proposal.Fields().ByName("expedited") + fd_Proposal_failed_reason = md_Proposal.Fields().ByName("failed_reason") } var _ protoreflect.Message = (*fastReflection_Proposal)(nil) @@ -1381,6 +1383,12 @@ func (x *fastReflection_Proposal) Range(f func(protoreflect.FieldDescriptor, pro return } } + if x.FailedReason != "" { + value := protoreflect.ValueOfString(x.FailedReason) + if !f(fd_Proposal_failed_reason, value) { + return + } + } } // Has reports whether a field is populated. @@ -1424,6 +1432,8 @@ func (x *fastReflection_Proposal) Has(fd protoreflect.FieldDescriptor) bool { return x.Proposer != "" case "cosmos.gov.v1.Proposal.expedited": return x.Expedited != false + case "cosmos.gov.v1.Proposal.failed_reason": + return x.FailedReason != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Proposal")) @@ -1468,6 +1478,8 @@ func (x *fastReflection_Proposal) Clear(fd protoreflect.FieldDescriptor) { x.Proposer = "" case "cosmos.gov.v1.Proposal.expedited": x.Expedited = false + case "cosmos.gov.v1.Proposal.failed_reason": + x.FailedReason = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Proposal")) @@ -1532,6 +1544,9 @@ func (x *fastReflection_Proposal) Get(descriptor protoreflect.FieldDescriptor) p case "cosmos.gov.v1.Proposal.expedited": value := x.Expedited return protoreflect.ValueOfBool(value) + case "cosmos.gov.v1.Proposal.failed_reason": + value := x.FailedReason + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Proposal")) @@ -1584,6 +1599,8 @@ func (x *fastReflection_Proposal) Set(fd protoreflect.FieldDescriptor, value pro x.Proposer = value.Interface().(string) case "cosmos.gov.v1.Proposal.expedited": x.Expedited = value.Bool() + case "cosmos.gov.v1.Proposal.failed_reason": + x.FailedReason = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Proposal")) @@ -1655,6 +1672,8 @@ func (x *fastReflection_Proposal) Mutable(fd protoreflect.FieldDescriptor) proto panic(fmt.Errorf("field proposer of message cosmos.gov.v1.Proposal is not mutable")) case "cosmos.gov.v1.Proposal.expedited": panic(fmt.Errorf("field expedited of message cosmos.gov.v1.Proposal is not mutable")) + case "cosmos.gov.v1.Proposal.failed_reason": + panic(fmt.Errorf("field failed_reason of message cosmos.gov.v1.Proposal is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Proposal")) @@ -1703,6 +1722,8 @@ func (x *fastReflection_Proposal) NewField(fd protoreflect.FieldDescriptor) prot return protoreflect.ValueOfString("") case "cosmos.gov.v1.Proposal.expedited": return protoreflect.ValueOfBool(false) + case "cosmos.gov.v1.Proposal.failed_reason": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Proposal")) @@ -1829,6 +1850,10 @@ func (x *fastReflection_Proposal) ProtoMethods() *protoiface.Methods { if x.Expedited { n += 2 } + l = len(x.FailedReason) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1858,6 +1883,13 @@ func (x *fastReflection_Proposal) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.FailedReason) > 0 { + i -= len(x.FailedReason) + copy(dAtA[i:], x.FailedReason) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.FailedReason))) + i-- + dAtA[i] = 0x7a + } if x.Expedited { i-- if x.Expedited { @@ -2491,6 +2523,38 @@ func (x *fastReflection_Proposal) ProtoMethods() *protoiface.Methods { } } x.Expedited = bool(v != 0) + case 15: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field FailedReason", 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.FailedReason = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -5483,6 +5547,7 @@ var ( fd_Params_burn_vote_quorum protoreflect.FieldDescriptor fd_Params_burn_proposal_deposit_prevote protoreflect.FieldDescriptor fd_Params_burn_vote_veto protoreflect.FieldDescriptor + fd_Params_min_deposit_ratio protoreflect.FieldDescriptor ) func init() { @@ -5503,6 +5568,7 @@ func init() { fd_Params_burn_vote_quorum = md_Params.Fields().ByName("burn_vote_quorum") fd_Params_burn_proposal_deposit_prevote = md_Params.Fields().ByName("burn_proposal_deposit_prevote") fd_Params_burn_vote_veto = md_Params.Fields().ByName("burn_vote_veto") + fd_Params_min_deposit_ratio = md_Params.Fields().ByName("min_deposit_ratio") } var _ protoreflect.Message = (*fastReflection_Params)(nil) @@ -5660,6 +5726,12 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto return } } + if x.MinDepositRatio != "" { + value := protoreflect.ValueOfString(x.MinDepositRatio) + if !f(fd_Params_min_deposit_ratio, value) { + return + } + } } // Has reports whether a field is populated. @@ -5705,6 +5777,8 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { return x.BurnProposalDepositPrevote != false case "cosmos.gov.v1.Params.burn_vote_veto": return x.BurnVoteVeto != false + case "cosmos.gov.v1.Params.min_deposit_ratio": + return x.MinDepositRatio != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) @@ -5751,6 +5825,8 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { x.BurnProposalDepositPrevote = false case "cosmos.gov.v1.Params.burn_vote_veto": x.BurnVoteVeto = false + case "cosmos.gov.v1.Params.min_deposit_ratio": + x.MinDepositRatio = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) @@ -5818,6 +5894,9 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro case "cosmos.gov.v1.Params.burn_vote_veto": value := x.BurnVoteVeto return protoreflect.ValueOfBool(value) + case "cosmos.gov.v1.Params.min_deposit_ratio": + value := x.MinDepositRatio + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) @@ -5872,6 +5951,8 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto x.BurnProposalDepositPrevote = value.Bool() case "cosmos.gov.v1.Params.burn_vote_veto": x.BurnVoteVeto = value.Bool() + case "cosmos.gov.v1.Params.min_deposit_ratio": + x.MinDepositRatio = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) @@ -5939,6 +6020,8 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore panic(fmt.Errorf("field burn_proposal_deposit_prevote of message cosmos.gov.v1.Params is not mutable")) case "cosmos.gov.v1.Params.burn_vote_veto": panic(fmt.Errorf("field burn_vote_veto of message cosmos.gov.v1.Params is not mutable")) + case "cosmos.gov.v1.Params.min_deposit_ratio": + panic(fmt.Errorf("field min_deposit_ratio of message cosmos.gov.v1.Params is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) @@ -5987,6 +6070,8 @@ func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protor return protoreflect.ValueOfBool(false) case "cosmos.gov.v1.Params.burn_vote_veto": return protoreflect.ValueOfBool(false) + case "cosmos.gov.v1.Params.min_deposit_ratio": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) @@ -6117,6 +6202,10 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { if x.BurnVoteVeto { n += 2 } + l = len(x.MinDepositRatio) + if l > 0 { + n += 2 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -6146,6 +6235,15 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.MinDepositRatio) > 0 { + i -= len(x.MinDepositRatio) + copy(dAtA[i:], x.MinDepositRatio) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MinDepositRatio))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } if x.BurnVoteVeto { i-- if x.BurnVoteVeto { @@ -6808,6 +6906,38 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { } } x.BurnVoteVeto = bool(v != 0) + case 16: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MinDepositRatio", 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.MinDepositRatio = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -7118,7 +7248,8 @@ type Proposal struct { // voting_end_time is the end time of voting on a proposal. VotingEndTime *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=voting_end_time,json=votingEndTime,proto3" json:"voting_end_time,omitempty"` // metadata is any arbitrary metadata attached to the proposal. - // the recommended format of the metadata is to be found here: https://docs.cosmos.network/v0.47/modules/gov#proposal-3 + // the recommended format of the metadata is to be found here: + // https://docs.cosmos.network/v0.47/modules/gov#proposal-3 Metadata string `protobuf:"bytes,10,opt,name=metadata,proto3" json:"metadata,omitempty"` // title is the title of the proposal // @@ -7136,6 +7267,10 @@ type Proposal struct { // // Since: cosmos-sdk 0.50 Expedited bool `protobuf:"varint,14,opt,name=expedited,proto3" json:"expedited,omitempty"` + // failed_reason defines the reason why the proposal failed + // + // Since: cosmos-sdk 0.50 + FailedReason string `protobuf:"bytes,15,opt,name=failed_reason,json=failedReason,proto3" json:"failed_reason,omitempty"` } func (x *Proposal) Reset() { @@ -7256,6 +7391,13 @@ func (x *Proposal) GetExpedited() bool { return false } +func (x *Proposal) GetFailedReason() string { + if x != nil { + return x.FailedReason + } + return "" +} + // TallyResult defines a standard tally for a governance proposal. type TallyResult struct { state protoimpl.MessageState @@ -7333,7 +7475,7 @@ type Vote struct { Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` // options is the weighted vote options. Options []*WeightedVoteOption `protobuf:"bytes,4,rep,name=options,proto3" json:"options,omitempty"` - // metadata is any arbitrary metadata to attached to the vote. + // metadata is any arbitrary metadata attached to the vote. // the recommended format of the metadata is to be found here: https://docs.cosmos.network/v0.47/modules/gov#vote-5 Metadata string `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata,omitempty"` } @@ -7583,6 +7725,12 @@ type Params struct { BurnProposalDepositPrevote bool `protobuf:"varint,14,opt,name=burn_proposal_deposit_prevote,json=burnProposalDepositPrevote,proto3" json:"burn_proposal_deposit_prevote,omitempty"` // burn deposits if quorum with vote type no_veto is met BurnVoteVeto bool `protobuf:"varint,15,opt,name=burn_vote_veto,json=burnVoteVeto,proto3" json:"burn_vote_veto,omitempty"` + // The ratio representing the proportion of the deposit value minimum that must be met when making a deposit. + // Default value: 0.01. Meaning that for a chain with a min_deposit of 100stake, a deposit of 1stake would be + // required. + // + // Since: cosmos-sdk 0.50 + MinDepositRatio string `protobuf:"bytes,16,opt,name=min_deposit_ratio,json=minDepositRatio,proto3" json:"min_deposit_ratio,omitempty"` } func (x *Params) Reset() { @@ -7710,6 +7858,13 @@ func (x *Params) GetBurnVoteVeto() bool { return false } +func (x *Params) GetMinDepositRatio() string { + if x != nil { + return x.MinDepositRatio + } + return "" +} + var File_cosmos_gov_v1_gov_proto protoreflect.FileDescriptor var file_cosmos_gov_v1_gov_proto_rawDesc = []byte{ @@ -7744,7 +7899,7 @@ var file_cosmos_gov_v1_gov_proto_rawDesc = []byte{ 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, - 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xdf, 0x05, 0x0a, + 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x84, 0x06, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x30, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, @@ -7790,156 +7945,162 @@ var file_cosmos_gov_v1_gov_proto_rawDesc = []byte{ 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x18, 0x0e, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x09, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x22, 0xd7, - 0x01, 0x0a, 0x0b, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2b, - 0x0a, 0x09, 0x79, 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, - 0x74, 0x52, 0x08, 0x79, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x33, 0x0a, 0x0d, 0x61, - 0x62, 0x73, 0x74, 0x61, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, - 0x6e, 0x74, 0x52, 0x0c, 0x61, 0x62, 0x73, 0x74, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, - 0x12, 0x29, 0x0a, 0x08, 0x6e, 0x6f, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, - 0x6e, 0x74, 0x52, 0x07, 0x6e, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3b, 0x0a, 0x12, 0x6e, - 0x6f, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0f, 0x6e, 0x6f, 0x57, 0x69, 0x74, 0x68, 0x56, - 0x65, 0x74, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xb6, 0x01, 0x0a, 0x04, 0x56, 0x6f, 0x74, - 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, - 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x6f, 0x74, 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, 0x05, 0x76, 0x6f, 0x74, - 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, - 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x56, 0x6f, 0x74, 0x65, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, - 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x4a, 0x04, 0x08, 0x03, 0x10, - 0x04, 0x22, 0xdd, 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x12, 0x59, 0x0a, 0x0b, 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, - 0x6f, 0x69, 0x6e, 0x42, 0x1d, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x15, 0x6d, 0x69, 0x6e, - 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, - 0x74, 0x79, 0x52, 0x0a, 0x6d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x6d, - 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x70, 0x65, - 0x72, 0x69, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x24, 0xea, 0xde, 0x1f, 0x1c, 0x6d, 0x61, 0x78, 0x5f, 0x64, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x2c, 0x6f, 0x6d, - 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x10, 0x6d, 0x61, 0x78, - 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x3a, 0x02, 0x18, - 0x01, 0x22, 0x58, 0x0a, 0x0c, 0x56, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x12, 0x44, 0x0a, 0x0d, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, 0x69, - 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x0c, 0x76, 0x6f, 0x74, 0x69, 0x6e, - 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x9e, 0x01, 0x0a, 0x0b, - 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x26, 0x0a, 0x06, 0x71, - 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, - 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x06, 0x71, 0x75, 0x6f, - 0x72, 0x75, 0x6d, 0x12, 0x2c, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, - 0x64, 0x12, 0x35, 0x0a, 0x0e, 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, - 0x6f, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0d, 0x76, 0x65, 0x74, 0x6f, 0x54, - 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x3a, 0x02, 0x18, 0x01, 0x22, 0xd3, 0x07, 0x0a, - 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x45, 0x0a, 0x0b, 0x6d, 0x69, 0x6e, 0x5f, 0x64, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, - 0x2a, 0x01, 0x52, 0x0a, 0x6d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x4d, - 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x70, 0x65, - 0x72, 0x69, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x10, 0x6d, 0x61, 0x78, - 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x44, 0x0a, - 0x0d, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, - 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x0c, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, - 0x69, 0x6f, 0x64, 0x12, 0x26, 0x0a, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x44, 0x65, 0x63, 0x52, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x12, 0x2c, 0x0a, 0x09, 0x74, - 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, - 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x09, - 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x35, 0x0a, 0x0e, 0x76, 0x65, 0x74, - 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, - 0x63, 0x52, 0x0d, 0x76, 0x65, 0x74, 0x6f, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, - 0x12, 0x49, 0x0a, 0x19, 0x6d, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, - 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x09, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x12, 0x23, + 0x0a, 0x0d, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, + 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x61, + 0x73, 0x6f, 0x6e, 0x22, 0xd7, 0x01, 0x0a, 0x0b, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x12, 0x2b, 0x0a, 0x09, 0x79, 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x08, 0x79, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x33, 0x0a, 0x0d, 0x61, 0x62, 0x73, 0x74, 0x61, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0c, 0x61, 0x62, 0x73, 0x74, 0x61, 0x69, 0x6e, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x29, 0x0a, 0x08, 0x6e, 0x6f, 0x5f, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x07, 0x6e, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x3b, 0x0a, 0x12, 0x6e, 0x6f, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x76, 0x65, 0x74, 0x6f, + 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, + 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0f, 0x6e, 0x6f, + 0x57, 0x69, 0x74, 0x68, 0x56, 0x65, 0x74, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xb6, 0x01, + 0x0a, 0x04, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x6f, 0x74, 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, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, + 0x64, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x22, 0xdd, 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x59, 0x0a, 0x0b, 0x6d, 0x69, 0x6e, 0x5f, + 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x1d, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, + 0x1f, 0x15, 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x2c, 0x6f, 0x6d, + 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x0a, 0x6d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x12, 0x6d, 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x24, 0xea, 0xde, 0x1f, 0x1c, + 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x69, + 0x6f, 0x64, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x98, 0xdf, 0x1f, 0x01, + 0x52, 0x10, 0x6d, 0x61, 0x78, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x65, 0x72, 0x69, + 0x6f, 0x64, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x58, 0x0a, 0x0c, 0x56, 0x6f, 0x74, 0x69, 0x6e, 0x67, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x44, 0x0a, 0x0d, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, + 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x0c, + 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x3a, 0x02, 0x18, 0x01, + 0x22, 0x9e, 0x01, 0x0a, 0x0b, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x26, 0x0a, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, + 0x52, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x12, 0x2c, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, + 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, + 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x09, 0x74, 0x68, 0x72, + 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x35, 0x0a, 0x0e, 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x74, + 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, + 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0d, + 0x76, 0x65, 0x74, 0x6f, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x3a, 0x02, 0x18, + 0x01, 0x22, 0x8f, 0x08, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x45, 0x0a, 0x0b, + 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, + 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x6d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x12, 0x4d, 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, + 0x52, 0x10, 0x6d, 0x61, 0x78, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x65, 0x72, 0x69, + 0x6f, 0x64, 0x12, 0x44, 0x0a, 0x0d, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, + 0x69, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x0c, 0x76, 0x6f, 0x74, 0x69, + 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x26, 0x0a, 0x06, 0x71, 0x75, 0x6f, 0x72, + 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, + 0x12, 0x2c, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x44, 0x65, 0x63, 0x52, 0x16, 0x6d, 0x69, 0x6e, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x44, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x12, 0x42, 0x0a, 0x15, 0x70, - 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x5f, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x13, 0x70, 0x72, 0x6f, 0x70, - 0x6f, 0x73, 0x61, 0x6c, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x12, - 0x4a, 0x0a, 0x14, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x63, 0x61, 0x6e, 0x63, - 0x65, 0x6c, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x18, 0x09, 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, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, - 0x6c, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x44, 0x65, 0x73, 0x74, 0x12, 0x57, 0x0a, 0x17, 0x65, - 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, - 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, - 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x15, 0x65, - 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x56, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x65, - 0x72, 0x69, 0x6f, 0x64, 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, - 0x64, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, - 0x63, 0x52, 0x12, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x54, 0x68, 0x72, 0x65, - 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x58, 0x0a, 0x15, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, - 0x65, 0x64, 0x5f, 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x18, 0x0c, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, - 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, - 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x13, 0x65, 0x78, 0x70, 0x65, - 0x64, 0x69, 0x74, 0x65, 0x64, 0x4d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, - 0x28, 0x0a, 0x10, 0x62, 0x75, 0x72, 0x6e, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x5f, 0x71, 0x75, 0x6f, - 0x72, 0x75, 0x6d, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x62, 0x75, 0x72, 0x6e, 0x56, - 0x6f, 0x74, 0x65, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x12, 0x41, 0x0a, 0x1d, 0x62, 0x75, 0x72, - 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x6f, 0x74, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x1a, 0x62, 0x75, 0x72, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x44, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x72, 0x65, 0x76, 0x6f, 0x74, 0x65, 0x12, 0x24, 0x0a, 0x0e, - 0x62, 0x75, 0x72, 0x6e, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x5f, 0x76, 0x65, 0x74, 0x6f, 0x18, 0x0f, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x62, 0x75, 0x72, 0x6e, 0x56, 0x6f, 0x74, 0x65, 0x56, 0x65, - 0x74, 0x6f, 0x2a, 0x89, 0x01, 0x0a, 0x0a, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x1b, 0x0a, 0x17, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, - 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, - 0x0a, 0x0f, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x59, 0x45, - 0x53, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, - 0x4f, 0x4e, 0x5f, 0x41, 0x42, 0x53, 0x54, 0x41, 0x49, 0x4e, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, - 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, 0x10, 0x03, - 0x12, 0x1c, 0x0a, 0x18, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, - 0x4e, 0x4f, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x56, 0x45, 0x54, 0x4f, 0x10, 0x04, 0x2a, 0xce, - 0x01, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x1f, 0x0a, 0x1b, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, - 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, - 0x10, 0x00, 0x12, 0x22, 0x0a, 0x1e, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, - 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x44, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x5f, 0x50, 0x45, - 0x52, 0x49, 0x4f, 0x44, 0x10, 0x01, 0x12, 0x21, 0x0a, 0x1d, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, - 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x56, 0x4f, 0x54, 0x49, 0x4e, 0x47, - 0x5f, 0x50, 0x45, 0x52, 0x49, 0x4f, 0x44, 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x4f, - 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x41, 0x53, - 0x53, 0x45, 0x44, 0x10, 0x03, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, - 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x45, - 0x44, 0x10, 0x04, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, - 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x05, 0x42, - 0x99, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, - 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x42, 0x08, 0x47, 0x6f, 0x76, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x24, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, - 0x31, 0x3b, 0x67, 0x6f, 0x76, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x47, 0x58, 0xaa, 0x02, 0x0d, - 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x47, 0x6f, 0x76, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, - 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, - 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, - 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x43, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x44, 0x65, 0x63, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x35, + 0x0a, 0x0e, 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0d, 0x76, 0x65, 0x74, 0x6f, 0x54, 0x68, 0x72, 0x65, + 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x49, 0x0a, 0x19, 0x6d, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x69, + 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x16, 0x6d, 0x69, 0x6e, 0x49, 0x6e, 0x69, + 0x74, 0x69, 0x61, 0x6c, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x61, 0x74, 0x69, 0x6f, + 0x12, 0x42, 0x0a, 0x15, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x63, 0x61, 0x6e, + 0x63, 0x65, 0x6c, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, + 0x13, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, + 0x61, 0x74, 0x69, 0x6f, 0x12, 0x4a, 0x0a, 0x14, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, + 0x5f, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x18, 0x09, 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, 0x12, 0x70, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x44, 0x65, 0x73, 0x74, + 0x12, 0x57, 0x0a, 0x17, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x76, 0x6f, + 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x98, 0xdf, + 0x1f, 0x01, 0x52, 0x15, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x56, 0x6f, 0x74, + 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x78, 0x70, + 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, + 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x12, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, + 0x64, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x58, 0x0a, 0x15, 0x65, 0x78, + 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, + 0x13, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x4d, 0x69, 0x6e, 0x44, 0x65, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x12, 0x28, 0x0a, 0x10, 0x62, 0x75, 0x72, 0x6e, 0x5f, 0x76, 0x6f, 0x74, + 0x65, 0x5f, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, + 0x62, 0x75, 0x72, 0x6e, 0x56, 0x6f, 0x74, 0x65, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x12, 0x41, + 0x0a, 0x1d, 0x62, 0x75, 0x72, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, + 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x6f, 0x74, 0x65, 0x18, + 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1a, 0x62, 0x75, 0x72, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x61, 0x6c, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x72, 0x65, 0x76, 0x6f, 0x74, + 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x62, 0x75, 0x72, 0x6e, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x5f, 0x76, + 0x65, 0x74, 0x6f, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x62, 0x75, 0x72, 0x6e, 0x56, + 0x6f, 0x74, 0x65, 0x56, 0x65, 0x74, 0x6f, 0x12, 0x3a, 0x0a, 0x11, 0x6d, 0x69, 0x6e, 0x5f, 0x64, + 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x10, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, + 0x65, 0x63, 0x52, 0x0f, 0x6d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x61, + 0x74, 0x69, 0x6f, 0x2a, 0x89, 0x01, 0x0a, 0x0a, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x17, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, + 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, + 0x13, 0x0a, 0x0f, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x59, + 0x45, 0x53, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, + 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x42, 0x53, 0x54, 0x41, 0x49, 0x4e, 0x10, 0x02, 0x12, 0x12, 0x0a, + 0x0e, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, 0x10, + 0x03, 0x12, 0x1c, 0x0a, 0x18, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, + 0x5f, 0x4e, 0x4f, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x56, 0x45, 0x54, 0x4f, 0x10, 0x04, 0x2a, + 0xce, 0x01, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x1f, 0x0a, 0x1b, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, + 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, + 0x44, 0x10, 0x00, 0x12, 0x22, 0x0a, 0x1e, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, + 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x44, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x5f, 0x50, + 0x45, 0x52, 0x49, 0x4f, 0x44, 0x10, 0x01, 0x12, 0x21, 0x0a, 0x1d, 0x50, 0x52, 0x4f, 0x50, 0x4f, + 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x56, 0x4f, 0x54, 0x49, 0x4e, + 0x47, 0x5f, 0x50, 0x45, 0x52, 0x49, 0x4f, 0x44, 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, + 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x41, + 0x53, 0x53, 0x45, 0x44, 0x10, 0x03, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, + 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, + 0x45, 0x44, 0x10, 0x04, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, + 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x05, + 0x42, 0x99, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x42, 0x08, 0x47, 0x6f, 0x76, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x24, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, + 0x76, 0x31, 0x3b, 0x67, 0x6f, 0x76, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x47, 0x58, 0xaa, 0x02, + 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x47, 0x6f, 0x76, 0x2e, 0x56, 0x31, 0xca, 0x02, + 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0xe2, 0x02, + 0x19, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/gov/v1/query_grpc.pb.go b/api/cosmos/gov/v1/query_grpc.pb.go index 95e53b86a111..678fb04378da 100644 --- a/api/cosmos/gov/v1/query_grpc.pb.go +++ b/api/cosmos/gov/v1/query_grpc.pb.go @@ -2,7 +2,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/gov/v1/query.proto @@ -17,8 +17,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Query_Constitution_FullMethodName = "/cosmos.gov.v1.Query/Constitution" @@ -35,6 +35,8 @@ const ( // QueryClient is the client API for Query service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Query defines the gRPC querier service for gov module type QueryClient interface { // Constitution queries the chain's constitution. Constitution(ctx context.Context, in *QueryConstitutionRequest, opts ...grpc.CallOption) (*QueryConstitutionResponse, error) @@ -48,7 +50,7 @@ type QueryClient interface { Votes(ctx context.Context, in *QueryVotesRequest, opts ...grpc.CallOption) (*QueryVotesResponse, error) // Params queries all parameters of the gov module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // Deposit queries single deposit information based proposalID, depositAddr. + // Deposit queries single deposit information based on proposalID, depositAddr. Deposit(ctx context.Context, in *QueryDepositRequest, opts ...grpc.CallOption) (*QueryDepositResponse, error) // Deposits queries all deposits of a single proposal. Deposits(ctx context.Context, in *QueryDepositsRequest, opts ...grpc.CallOption) (*QueryDepositsResponse, error) @@ -65,8 +67,9 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { } func (c *queryClient) Constitution(ctx context.Context, in *QueryConstitutionRequest, opts ...grpc.CallOption) (*QueryConstitutionResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryConstitutionResponse) - err := c.cc.Invoke(ctx, Query_Constitution_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Constitution_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -74,8 +77,9 @@ func (c *queryClient) Constitution(ctx context.Context, in *QueryConstitutionReq } func (c *queryClient) Proposal(ctx context.Context, in *QueryProposalRequest, opts ...grpc.CallOption) (*QueryProposalResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryProposalResponse) - err := c.cc.Invoke(ctx, Query_Proposal_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Proposal_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -83,8 +87,9 @@ func (c *queryClient) Proposal(ctx context.Context, in *QueryProposalRequest, op } func (c *queryClient) Proposals(ctx context.Context, in *QueryProposalsRequest, opts ...grpc.CallOption) (*QueryProposalsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryProposalsResponse) - err := c.cc.Invoke(ctx, Query_Proposals_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Proposals_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -92,8 +97,9 @@ func (c *queryClient) Proposals(ctx context.Context, in *QueryProposalsRequest, } func (c *queryClient) Vote(ctx context.Context, in *QueryVoteRequest, opts ...grpc.CallOption) (*QueryVoteResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryVoteResponse) - err := c.cc.Invoke(ctx, Query_Vote_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Vote_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -101,8 +107,9 @@ func (c *queryClient) Vote(ctx context.Context, in *QueryVoteRequest, opts ...gr } func (c *queryClient) Votes(ctx context.Context, in *QueryVotesRequest, opts ...grpc.CallOption) (*QueryVotesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryVotesResponse) - err := c.cc.Invoke(ctx, Query_Votes_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Votes_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -110,8 +117,9 @@ func (c *queryClient) Votes(ctx context.Context, in *QueryVotesRequest, opts ... } func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -119,8 +127,9 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . } func (c *queryClient) Deposit(ctx context.Context, in *QueryDepositRequest, opts ...grpc.CallOption) (*QueryDepositResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryDepositResponse) - err := c.cc.Invoke(ctx, Query_Deposit_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Deposit_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -128,8 +137,9 @@ func (c *queryClient) Deposit(ctx context.Context, in *QueryDepositRequest, opts } func (c *queryClient) Deposits(ctx context.Context, in *QueryDepositsRequest, opts ...grpc.CallOption) (*QueryDepositsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryDepositsResponse) - err := c.cc.Invoke(ctx, Query_Deposits_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Deposits_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -137,8 +147,9 @@ func (c *queryClient) Deposits(ctx context.Context, in *QueryDepositsRequest, op } func (c *queryClient) TallyResult(ctx context.Context, in *QueryTallyResultRequest, opts ...grpc.CallOption) (*QueryTallyResultResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryTallyResultResponse) - err := c.cc.Invoke(ctx, Query_TallyResult_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_TallyResult_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -147,7 +158,9 @@ func (c *queryClient) TallyResult(ctx context.Context, in *QueryTallyResultReque // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer -// for forward compatibility +// for forward compatibility. +// +// Query defines the gRPC querier service for gov module type QueryServer interface { // Constitution queries the chain's constitution. Constitution(context.Context, *QueryConstitutionRequest) (*QueryConstitutionResponse, error) @@ -161,7 +174,7 @@ type QueryServer interface { Votes(context.Context, *QueryVotesRequest) (*QueryVotesResponse, error) // Params queries all parameters of the gov module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // Deposit queries single deposit information based proposalID, depositAddr. + // Deposit queries single deposit information based on proposalID, depositAddr. Deposit(context.Context, *QueryDepositRequest) (*QueryDepositResponse, error) // Deposits queries all deposits of a single proposal. Deposits(context.Context, *QueryDepositsRequest) (*QueryDepositsResponse, error) @@ -170,9 +183,12 @@ type QueryServer interface { mustEmbedUnimplementedQueryServer() } -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} +// UnimplementedQueryServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedQueryServer struct{} func (UnimplementedQueryServer) Constitution(context.Context, *QueryConstitutionRequest) (*QueryConstitutionResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Constitution not implemented") @@ -202,6 +218,7 @@ func (UnimplementedQueryServer) TallyResult(context.Context, *QueryTallyResultRe return nil, status.Errorf(codes.Unimplemented, "method TallyResult not implemented") } func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} +func (UnimplementedQueryServer) testEmbeddedByValue() {} // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to QueryServer will @@ -211,6 +228,13 @@ type UnsafeQueryServer interface { } func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + // If the following call pancis, it indicates UnimplementedQueryServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Query_ServiceDesc, srv) } diff --git a/api/cosmos/gov/v1/tx.pulsar.go b/api/cosmos/gov/v1/tx.pulsar.go index 89edabdeb450..1f4fd832f946 100644 --- a/api/cosmos/gov/v1/tx.pulsar.go +++ b/api/cosmos/gov/v1/tx.pulsar.go @@ -7036,7 +7036,7 @@ type MsgSubmitProposal struct { // // Since: cosmos-sdk 0.47 Summary string `protobuf:"bytes,6,opt,name=summary,proto3" json:"summary,omitempty"` - // expedided defines if the proposal is expedited or not + // expedited defines if the proposal is expedited or not // // Since: cosmos-sdk 0.50 Expedited bool `protobuf:"varint,7,opt,name=expedited,proto3" json:"expedited,omitempty"` @@ -7574,8 +7574,10 @@ type MsgCancelProposal struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // proposal_id defines the unique id of the proposal. ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` - Proposer string `protobuf:"bytes,2,opt,name=proposer,proto3" json:"proposer,omitempty"` + // proposer is the account address of the proposer. + Proposer string `protobuf:"bytes,2,opt,name=proposer,proto3" json:"proposer,omitempty"` } func (x *MsgCancelProposal) Reset() { @@ -7621,6 +7623,7 @@ type MsgCancelProposalResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // proposal_id defines the unique id of the proposal. ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` // canceled_time is the time when proposal is canceled. CanceledTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=canceled_time,json=canceledTime,proto3" json:"canceled_time,omitempty"` diff --git a/api/cosmos/gov/v1/tx_grpc.pb.go b/api/cosmos/gov/v1/tx_grpc.pb.go index 4f77b03d617b..49e2388df68a 100644 --- a/api/cosmos/gov/v1/tx_grpc.pb.go +++ b/api/cosmos/gov/v1/tx_grpc.pb.go @@ -2,7 +2,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/gov/v1/tx.proto @@ -17,8 +17,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Msg_SubmitProposal_FullMethodName = "/cosmos.gov.v1.Msg/SubmitProposal" @@ -33,6 +33,8 @@ const ( // MsgClient is the client API for Msg service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Msg defines the gov Msg service. type MsgClient interface { // SubmitProposal defines a method to create new proposal given the messages. SubmitProposal(ctx context.Context, in *MsgSubmitProposal, opts ...grpc.CallOption) (*MsgSubmitProposalResponse, error) @@ -65,8 +67,9 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { } func (c *msgClient) SubmitProposal(ctx context.Context, in *MsgSubmitProposal, opts ...grpc.CallOption) (*MsgSubmitProposalResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgSubmitProposalResponse) - err := c.cc.Invoke(ctx, Msg_SubmitProposal_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_SubmitProposal_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -74,8 +77,9 @@ func (c *msgClient) SubmitProposal(ctx context.Context, in *MsgSubmitProposal, o } func (c *msgClient) ExecLegacyContent(ctx context.Context, in *MsgExecLegacyContent, opts ...grpc.CallOption) (*MsgExecLegacyContentResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgExecLegacyContentResponse) - err := c.cc.Invoke(ctx, Msg_ExecLegacyContent_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_ExecLegacyContent_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -83,8 +87,9 @@ func (c *msgClient) ExecLegacyContent(ctx context.Context, in *MsgExecLegacyCont } func (c *msgClient) Vote(ctx context.Context, in *MsgVote, opts ...grpc.CallOption) (*MsgVoteResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgVoteResponse) - err := c.cc.Invoke(ctx, Msg_Vote_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_Vote_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -92,8 +97,9 @@ func (c *msgClient) Vote(ctx context.Context, in *MsgVote, opts ...grpc.CallOpti } func (c *msgClient) VoteWeighted(ctx context.Context, in *MsgVoteWeighted, opts ...grpc.CallOption) (*MsgVoteWeightedResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgVoteWeightedResponse) - err := c.cc.Invoke(ctx, Msg_VoteWeighted_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_VoteWeighted_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -101,8 +107,9 @@ func (c *msgClient) VoteWeighted(ctx context.Context, in *MsgVoteWeighted, opts } func (c *msgClient) Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.CallOption) (*MsgDepositResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgDepositResponse) - err := c.cc.Invoke(ctx, Msg_Deposit_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_Deposit_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -110,8 +117,9 @@ func (c *msgClient) Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.Ca } func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -119,8 +127,9 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts } func (c *msgClient) CancelProposal(ctx context.Context, in *MsgCancelProposal, opts ...grpc.CallOption) (*MsgCancelProposalResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgCancelProposalResponse) - err := c.cc.Invoke(ctx, Msg_CancelProposal_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_CancelProposal_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -129,7 +138,9 @@ func (c *msgClient) CancelProposal(ctx context.Context, in *MsgCancelProposal, o // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer -// for forward compatibility +// for forward compatibility. +// +// Msg defines the gov Msg service. type MsgServer interface { // SubmitProposal defines a method to create new proposal given the messages. SubmitProposal(context.Context, *MsgSubmitProposal) (*MsgSubmitProposalResponse, error) @@ -154,9 +165,12 @@ type MsgServer interface { mustEmbedUnimplementedMsgServer() } -// UnimplementedMsgServer must be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} +// UnimplementedMsgServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedMsgServer struct{} func (UnimplementedMsgServer) SubmitProposal(context.Context, *MsgSubmitProposal) (*MsgSubmitProposalResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SubmitProposal not implemented") @@ -180,6 +194,7 @@ func (UnimplementedMsgServer) CancelProposal(context.Context, *MsgCancelProposal return nil, status.Errorf(codes.Unimplemented, "method CancelProposal not implemented") } func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} +func (UnimplementedMsgServer) testEmbeddedByValue() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to MsgServer will @@ -189,6 +204,13 @@ type UnsafeMsgServer interface { } func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + // If the following call pancis, it indicates UnimplementedMsgServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Msg_ServiceDesc, srv) } diff --git a/api/cosmos/gov/v1beta1/genesis.pulsar.go b/api/cosmos/gov/v1beta1/genesis.pulsar.go index b66ffd18f9da..73e35955d303 100644 --- a/api/cosmos/gov/v1beta1/genesis.pulsar.go +++ b/api/cosmos/gov/v1beta1/genesis.pulsar.go @@ -1096,11 +1096,11 @@ type GenesisState struct { Votes []*Vote `protobuf:"bytes,3,rep,name=votes,proto3" json:"votes,omitempty"` // proposals defines all the proposals present at genesis. Proposals []*Proposal `protobuf:"bytes,4,rep,name=proposals,proto3" json:"proposals,omitempty"` - // params defines all the parameters of related to deposit. + // deposit_params defines all the parameters related to deposit. DepositParams *DepositParams `protobuf:"bytes,5,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params,omitempty"` - // params defines all the parameters of related to voting. + // voting_params defines all the parameters related to voting. VotingParams *VotingParams `protobuf:"bytes,6,opt,name=voting_params,json=votingParams,proto3" json:"voting_params,omitempty"` - // params defines all the parameters of related to tally. + // tally_params defines all the parameters related to tally. TallyParams *TallyParams `protobuf:"bytes,7,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params,omitempty"` } diff --git a/api/cosmos/gov/v1beta1/gov.pulsar.go b/api/cosmos/gov/v1beta1/gov.pulsar.go index 980e0000eb55..1a67e70a326a 100644 --- a/api/cosmos/gov/v1beta1/gov.pulsar.go +++ b/api/cosmos/gov/v1beta1/gov.pulsar.go @@ -6170,216 +6170,212 @@ var file_cosmos_gov_v1beta1_gov_proto_rawDesc = []byte{ 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, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0xa7, 0x01, 0x0a, 0x12, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x56, + 0x74, 0x6f, 0x22, 0x9c, 0x01, 0x0a, 0x12, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x36, 0x0a, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x59, 0x0a, 0x06, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x41, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, - 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, - 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x86, 0x01, 0x0a, - 0x0c, 0x54, 0x65, 0x78, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x14, 0x0a, - 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, - 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x3e, 0xe8, 0xa0, 0x1f, 0x01, 0xca, 0xb4, 0x2d, 0x1a, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x8a, 0xe7, 0xb0, 0x2a, 0x17, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x54, 0x65, 0x78, 0x74, 0x50, 0x72, 0x6f, - 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x22, 0xd6, 0x01, 0x0a, 0x07, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, - 0x49, 0x64, 0x12, 0x36, 0x0a, 0x09, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 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, - 0x09, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x12, 0x68, 0x0a, 0x06, 0x61, 0x6d, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x35, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, - 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0xd9, - 0x05, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x1f, 0x0a, 0x0b, 0x70, - 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x4e, 0x0a, 0x07, - 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, + 0x6e, 0x12, 0x4e, 0x0a, 0x06, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x36, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, + 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x44, 0x65, 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x77, 0x65, 0x69, 0x67, 0x68, + 0x74, 0x22, 0x86, 0x01, 0x0a, 0x0c, 0x54, 0x65, 0x78, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x3e, 0xe8, 0xa0, 0x1f, 0x01, + 0xca, 0xb4, 0x2d, 0x1a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x8a, 0xe7, + 0xb0, 0x2a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x54, 0x65, + 0x78, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x22, 0xd6, 0x01, 0x0a, 0x07, 0x44, + 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x09, 0x64, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x6f, 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, 0x09, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x12, + 0x68, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x35, 0xc8, 0xde, 0x1f, 0x00, + 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, + 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, + 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, + 0xa0, 0x1f, 0x00, 0x22, 0xd9, 0x05, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, + 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, + 0x64, 0x12, 0x4e, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x1e, 0xca, 0xb4, 0x2d, 0x1a, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x12, 0x3a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x58, 0x0a, + 0x12, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x5f, 0x74, 0x61, 0x6c, 0x6c, 0x79, 0x5f, 0x72, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, + 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, + 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x10, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x54, 0x61, 0x6c, 0x6c, + 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x4a, 0x0a, 0x0b, 0x73, 0x75, 0x62, 0x6d, 0x69, + 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x0d, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, + 0x1f, 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x54, + 0x69, 0x6d, 0x65, 0x12, 0x53, 0x0a, 0x10, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x65, + 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x41, 0x6e, 0x79, 0x42, 0x1e, 0xca, 0xb4, 0x2d, 0x1a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x3a, 0x0a, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x58, 0x0a, 0x12, 0x66, 0x69, 0x6e, 0x61, - 0x6c, 0x5f, 0x74, 0x61, 0x6c, 0x6c, 0x79, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, - 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x52, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, - 0x52, 0x10, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x12, 0x4a, 0x0a, 0x0b, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x5f, 0x74, 0x69, 0x6d, - 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x42, 0x0d, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, - 0x2a, 0x01, 0x52, 0x0a, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x53, - 0x0a, 0x10, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, - 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x42, 0x0d, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, - 0xb0, 0x2a, 0x01, 0x52, 0x0e, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x45, 0x6e, 0x64, 0x54, - 0x69, 0x6d, 0x65, 0x12, 0x75, 0x0a, 0x0d, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x64, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x35, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0c, 0x74, 0x6f, - 0x74, 0x61, 0x6c, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x55, 0x0a, 0x11, 0x76, 0x6f, - 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x42, 0x0d, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, - 0x52, 0x0f, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, - 0x65, 0x12, 0x51, 0x0a, 0x0f, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x65, 0x6e, 0x64, 0x5f, - 0x74, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x0d, 0xc8, 0xde, 0x1f, 0x00, 0x90, + 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0e, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x75, 0x0a, 0x0d, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x35, 0xc8, 0xde, 0x1f, 0x00, + 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, + 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, + 0x01, 0x52, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, + 0x55, 0x0a, 0x11, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x0d, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, - 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0d, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x64, - 0x54, 0x69, 0x6d, 0x65, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0xe9, 0x02, 0x0a, 0x0b, 0x54, - 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x4e, 0x0a, 0x03, 0x79, 0x65, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x3c, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, - 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x03, 0x79, 0x65, 0x73, 0x12, 0x56, 0x0a, 0x07, 0x61, 0x62, - 0x73, 0x74, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x3c, 0xc8, 0xde, 0x1f, - 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, - 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x07, 0x61, 0x62, 0x73, 0x74, 0x61, - 0x69, 0x6e, 0x12, 0x4c, 0x0a, 0x02, 0x6e, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x3c, - 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, - 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x02, 0x6e, 0x6f, - 0x12, 0x5e, 0x0a, 0x0c, 0x6e, 0x6f, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x76, 0x65, 0x74, 0x6f, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x3c, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0a, 0x6e, 0x6f, 0x57, 0x69, 0x74, 0x68, 0x56, 0x65, 0x74, 0x6f, - 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0xfa, 0x01, 0x0a, 0x04, 0x56, 0x6f, 0x74, 0x65, 0x12, - 0x33, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x04, 0x42, 0x12, 0xea, 0xde, 0x1f, 0x02, 0x69, 0x64, 0xa2, 0xe7, 0xb0, 0x2a, - 0x02, 0x69, 0x64, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, - 0x61, 0x6c, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x6f, 0x74, 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, 0x05, 0x76, - 0x6f, 0x74, 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, - 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x02, 0x18, 0x01, 0x52, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x4b, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x56, - 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, - 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x04, 0xe8, - 0xa0, 0x1f, 0x00, 0x22, 0x8a, 0x02, 0x0a, 0x0d, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x85, 0x01, 0x0a, 0x0b, 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x49, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x15, - 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x2c, 0x6f, 0x6d, 0x69, 0x74, - 0x65, 0x6d, 0x70, 0x74, 0x79, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, - 0x73, 0x52, 0x0a, 0x6d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x71, 0x0a, - 0x12, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x70, 0x65, 0x72, - 0x69, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x28, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x1c, 0x6d, 0x61, - 0x78, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, - 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x10, - 0x6d, 0x61, 0x78, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, - 0x22, 0x73, 0x0a, 0x0c, 0x56, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x12, 0x63, 0x0a, 0x0d, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x42, 0x23, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x17, 0x76, 0x6f, 0x74, 0x69, - 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, - 0x70, 0x74, 0x79, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x0c, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, - 0x65, 0x72, 0x69, 0x6f, 0x64, 0x22, 0xc1, 0x02, 0x0a, 0x0b, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x5a, 0x0a, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x42, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x44, 0x65, 0x63, 0xea, 0xde, 0x1f, 0x10, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x2c, - 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, - 0x6d, 0x12, 0x63, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x45, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x44, 0x65, 0x63, 0xea, 0xde, 0x1f, 0x13, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, - 0x64, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x09, 0x74, 0x68, 0x72, - 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x71, 0x0a, 0x0e, 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x74, - 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x4a, - 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xea, 0xde, - 0x1f, 0x18, 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, - 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x0d, 0x76, 0x65, 0x74, 0x6f, - 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x2a, 0xe6, 0x01, 0x0a, 0x0a, 0x56, 0x6f, - 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x17, 0x56, 0x4f, 0x54, 0x45, - 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, - 0x49, 0x45, 0x44, 0x10, 0x00, 0x1a, 0x0f, 0x8a, 0x9d, 0x20, 0x0b, 0x4f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x22, 0x0a, 0x0f, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, - 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x59, 0x45, 0x53, 0x10, 0x01, 0x1a, 0x0d, 0x8a, 0x9d, 0x20, - 0x09, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x59, 0x65, 0x73, 0x12, 0x2a, 0x0a, 0x13, 0x56, 0x4f, - 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x42, 0x53, 0x54, 0x41, 0x49, - 0x4e, 0x10, 0x02, 0x1a, 0x11, 0x8a, 0x9d, 0x20, 0x0d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x41, - 0x62, 0x73, 0x74, 0x61, 0x69, 0x6e, 0x12, 0x20, 0x0a, 0x0e, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, - 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, 0x10, 0x03, 0x1a, 0x0c, 0x8a, 0x9d, 0x20, 0x08, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x12, 0x32, 0x0a, 0x18, 0x56, 0x4f, 0x54, 0x45, - 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, - 0x56, 0x45, 0x54, 0x4f, 0x10, 0x04, 0x1a, 0x14, 0x8a, 0x9d, 0x20, 0x10, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x4e, 0x6f, 0x57, 0x69, 0x74, 0x68, 0x56, 0x65, 0x74, 0x6f, 0x1a, 0x04, 0x88, 0xa3, - 0x1e, 0x00, 0x2a, 0xcc, 0x02, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2e, 0x0a, 0x1b, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, - 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, - 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x1a, 0x0d, 0x8a, 0x9d, 0x20, 0x09, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x4e, 0x69, 0x6c, 0x12, 0x3b, 0x0a, 0x1e, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, - 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x44, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, - 0x5f, 0x50, 0x45, 0x52, 0x49, 0x4f, 0x44, 0x10, 0x01, 0x1a, 0x17, 0x8a, 0x9d, 0x20, 0x13, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x65, 0x72, 0x69, - 0x6f, 0x64, 0x12, 0x39, 0x0a, 0x1d, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, - 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x56, 0x4f, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x50, 0x45, 0x52, - 0x49, 0x4f, 0x44, 0x10, 0x02, 0x1a, 0x16, 0x8a, 0x9d, 0x20, 0x12, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x56, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x2c, 0x0a, - 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, - 0x5f, 0x50, 0x41, 0x53, 0x53, 0x45, 0x44, 0x10, 0x03, 0x1a, 0x10, 0x8a, 0x9d, 0x20, 0x0c, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x50, 0x61, 0x73, 0x73, 0x65, 0x64, 0x12, 0x30, 0x0a, 0x18, 0x50, - 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, - 0x45, 0x4a, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, 0x04, 0x1a, 0x12, 0x8a, 0x9d, 0x20, 0x0e, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, 0x2c, 0x0a, - 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, - 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x05, 0x1a, 0x10, 0x8a, 0x9d, 0x20, 0x0c, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x1a, 0x04, 0x88, 0xa3, 0x1e, - 0x00, 0x42, 0xc0, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x08, 0x47, 0x6f, - 0x76, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x67, 0x6f, - 0x76, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x47, 0x58, 0xaa, 0x02, - 0x12, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x47, 0x6f, 0x76, 0x2e, 0x56, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0xca, 0x02, 0x12, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, - 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, - 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x43, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0xc8, 0xe1, 0x1e, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0f, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, + 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x51, 0x0a, 0x0f, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, + 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x0d, 0xc8, 0xde, 0x1f, + 0x00, 0x90, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0d, 0x76, 0x6f, 0x74, 0x69, + 0x6e, 0x67, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, + 0xa5, 0x02, 0x0a, 0x0b, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, + 0x3d, 0x0a, 0x03, 0x79, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, + 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, + 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x03, 0x79, 0x65, 0x73, 0x12, 0x45, + 0x0a, 0x07, 0x61, 0x62, 0x73, 0x74, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, + 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, + 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x07, 0x61, 0x62, + 0x73, 0x74, 0x61, 0x69, 0x6e, 0x12, 0x3b, 0x0a, 0x02, 0x6e, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, + 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x02, + 0x6e, 0x6f, 0x12, 0x4d, 0x0a, 0x0c, 0x6e, 0x6f, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x76, 0x65, + 0x74, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, + 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, + 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0a, 0x6e, 0x6f, 0x57, 0x69, 0x74, 0x68, 0x56, 0x65, 0x74, + 0x6f, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0xfa, 0x01, 0x0a, 0x04, 0x56, 0x6f, 0x74, 0x65, + 0x12, 0x33, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x12, 0xea, 0xde, 0x1f, 0x02, 0x69, 0x64, 0xa2, 0xe7, 0xb0, + 0x2a, 0x02, 0x69, 0x64, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x6f, 0x74, 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, 0x05, + 0x76, 0x6f, 0x74, 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, + 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x02, 0x18, 0x01, 0x52, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x4b, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, + 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, + 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x04, + 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0x8a, 0x02, 0x0a, 0x0d, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x85, 0x01, 0x0a, 0x0b, 0x6d, 0x69, 0x6e, 0x5f, 0x64, + 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x49, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, + 0x15, 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x2c, 0x6f, 0x6d, 0x69, + 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, + 0x6e, 0x73, 0x52, 0x0a, 0x6d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x71, + 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x70, 0x65, + 0x72, 0x69, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x28, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x1c, 0x6d, + 0x61, 0x78, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, + 0x64, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x98, 0xdf, 0x1f, 0x01, 0x52, + 0x10, 0x6d, 0x61, 0x78, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x65, 0x72, 0x69, 0x6f, + 0x64, 0x22, 0x73, 0x0a, 0x0c, 0x56, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x12, 0x63, 0x0a, 0x0d, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, 0x69, + 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x42, 0x23, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x17, 0x76, 0x6f, 0x74, + 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, + 0x6d, 0x70, 0x74, 0x79, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x0c, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, + 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x22, 0xca, 0x02, 0x0a, 0x0b, 0x54, 0x61, 0x6c, 0x6c, 0x79, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x5d, 0x0a, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x45, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, + 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xea, 0xde, 0x1f, 0x10, 0x71, + 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0xd2, + 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x06, 0x71, + 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x12, 0x66, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, + 0x6c, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x48, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, + 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, + 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xea, 0xde, 0x1f, + 0x13, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, + 0x6d, 0x70, 0x74, 0x79, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, + 0x65, 0x63, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x74, 0x0a, + 0x0e, 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x4d, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, + 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xea, 0xde, 0x1f, 0x18, 0x76, 0x65, + 0x74, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x2c, 0x6f, 0x6d, 0x69, + 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0d, 0x76, 0x65, 0x74, 0x6f, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, + 0x6f, 0x6c, 0x64, 0x2a, 0xe6, 0x01, 0x0a, 0x0a, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x17, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, + 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x1a, + 0x0f, 0x8a, 0x9d, 0x20, 0x0b, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x12, 0x22, 0x0a, 0x0f, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, + 0x59, 0x45, 0x53, 0x10, 0x01, 0x1a, 0x0d, 0x8a, 0x9d, 0x20, 0x09, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x59, 0x65, 0x73, 0x12, 0x2a, 0x0a, 0x13, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, + 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x42, 0x53, 0x54, 0x41, 0x49, 0x4e, 0x10, 0x02, 0x1a, 0x11, 0x8a, + 0x9d, 0x20, 0x0d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x62, 0x73, 0x74, 0x61, 0x69, 0x6e, + 0x12, 0x20, 0x0a, 0x0e, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, + 0x4e, 0x4f, 0x10, 0x03, 0x1a, 0x0c, 0x8a, 0x9d, 0x20, 0x08, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x4e, 0x6f, 0x12, 0x32, 0x0a, 0x18, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, + 0x4e, 0x5f, 0x4e, 0x4f, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x56, 0x45, 0x54, 0x4f, 0x10, 0x04, + 0x1a, 0x14, 0x8a, 0x9d, 0x20, 0x10, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x57, 0x69, + 0x74, 0x68, 0x56, 0x65, 0x74, 0x6f, 0x1a, 0x04, 0x88, 0xa3, 0x1e, 0x00, 0x2a, 0xcc, 0x02, 0x0a, + 0x0e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x2e, 0x0a, 0x1b, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, + 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, + 0x1a, 0x0d, 0x8a, 0x9d, 0x20, 0x09, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4e, 0x69, 0x6c, 0x12, + 0x3b, 0x0a, 0x1e, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, + 0x55, 0x53, 0x5f, 0x44, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x5f, 0x50, 0x45, 0x52, 0x49, 0x4f, + 0x44, 0x10, 0x01, 0x1a, 0x17, 0x8a, 0x9d, 0x20, 0x13, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x44, + 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x39, 0x0a, 0x1d, + 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, + 0x56, 0x4f, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x50, 0x45, 0x52, 0x49, 0x4f, 0x44, 0x10, 0x02, 0x1a, + 0x16, 0x8a, 0x9d, 0x20, 0x12, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x56, 0x6f, 0x74, 0x69, 0x6e, + 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x2c, 0x0a, 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, + 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x41, 0x53, 0x53, 0x45, + 0x44, 0x10, 0x03, 0x1a, 0x10, 0x8a, 0x9d, 0x20, 0x0c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x50, + 0x61, 0x73, 0x73, 0x65, 0x64, 0x12, 0x30, 0x0a, 0x18, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, + 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x45, + 0x44, 0x10, 0x04, 0x1a, 0x12, 0x8a, 0x9d, 0x20, 0x0e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x65, 0x6a, 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, 0x2c, 0x0a, 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, + 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, + 0x44, 0x10, 0x05, 0x1a, 0x10, 0x8a, 0x9d, 0x20, 0x0c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x46, + 0x61, 0x69, 0x6c, 0x65, 0x64, 0x1a, 0x04, 0x88, 0xa3, 0x1e, 0x00, 0x42, 0xc0, 0x01, 0xc8, 0xe1, + 0x1e, 0x00, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, + 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x08, 0x47, 0x6f, 0x76, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, + 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, + 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x67, 0x6f, 0x76, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x47, 0x58, 0xaa, 0x02, 0x12, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x47, 0x6f, 0x76, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0xca, 0x02, 0x12, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, + 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/gov/v1beta1/query_grpc.pb.go b/api/cosmos/gov/v1beta1/query_grpc.pb.go index 807c4893cf6c..a9536beda7b6 100644 --- a/api/cosmos/gov/v1beta1/query_grpc.pb.go +++ b/api/cosmos/gov/v1beta1/query_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/gov/v1beta1/query.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Query_Proposal_FullMethodName = "/cosmos.gov.v1beta1.Query/Proposal" @@ -32,6 +32,8 @@ const ( // QueryClient is the client API for Query service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Query defines the gRPC querier service for gov module type QueryClient interface { // Proposal queries proposal details based on ProposalID. Proposal(ctx context.Context, in *QueryProposalRequest, opts ...grpc.CallOption) (*QueryProposalResponse, error) @@ -43,7 +45,7 @@ type QueryClient interface { Votes(ctx context.Context, in *QueryVotesRequest, opts ...grpc.CallOption) (*QueryVotesResponse, error) // Params queries all parameters of the gov module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // Deposit queries single deposit information based proposalID, depositAddr. + // Deposit queries single deposit information based on proposalID, depositor address. Deposit(ctx context.Context, in *QueryDepositRequest, opts ...grpc.CallOption) (*QueryDepositResponse, error) // Deposits queries all deposits of a single proposal. Deposits(ctx context.Context, in *QueryDepositsRequest, opts ...grpc.CallOption) (*QueryDepositsResponse, error) @@ -60,8 +62,9 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { } func (c *queryClient) Proposal(ctx context.Context, in *QueryProposalRequest, opts ...grpc.CallOption) (*QueryProposalResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryProposalResponse) - err := c.cc.Invoke(ctx, Query_Proposal_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Proposal_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -69,8 +72,9 @@ func (c *queryClient) Proposal(ctx context.Context, in *QueryProposalRequest, op } func (c *queryClient) Proposals(ctx context.Context, in *QueryProposalsRequest, opts ...grpc.CallOption) (*QueryProposalsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryProposalsResponse) - err := c.cc.Invoke(ctx, Query_Proposals_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Proposals_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -78,8 +82,9 @@ func (c *queryClient) Proposals(ctx context.Context, in *QueryProposalsRequest, } func (c *queryClient) Vote(ctx context.Context, in *QueryVoteRequest, opts ...grpc.CallOption) (*QueryVoteResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryVoteResponse) - err := c.cc.Invoke(ctx, Query_Vote_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Vote_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -87,8 +92,9 @@ func (c *queryClient) Vote(ctx context.Context, in *QueryVoteRequest, opts ...gr } func (c *queryClient) Votes(ctx context.Context, in *QueryVotesRequest, opts ...grpc.CallOption) (*QueryVotesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryVotesResponse) - err := c.cc.Invoke(ctx, Query_Votes_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Votes_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -96,8 +102,9 @@ func (c *queryClient) Votes(ctx context.Context, in *QueryVotesRequest, opts ... } func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -105,8 +112,9 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . } func (c *queryClient) Deposit(ctx context.Context, in *QueryDepositRequest, opts ...grpc.CallOption) (*QueryDepositResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryDepositResponse) - err := c.cc.Invoke(ctx, Query_Deposit_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Deposit_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -114,8 +122,9 @@ func (c *queryClient) Deposit(ctx context.Context, in *QueryDepositRequest, opts } func (c *queryClient) Deposits(ctx context.Context, in *QueryDepositsRequest, opts ...grpc.CallOption) (*QueryDepositsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryDepositsResponse) - err := c.cc.Invoke(ctx, Query_Deposits_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Deposits_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -123,8 +132,9 @@ func (c *queryClient) Deposits(ctx context.Context, in *QueryDepositsRequest, op } func (c *queryClient) TallyResult(ctx context.Context, in *QueryTallyResultRequest, opts ...grpc.CallOption) (*QueryTallyResultResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryTallyResultResponse) - err := c.cc.Invoke(ctx, Query_TallyResult_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_TallyResult_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -133,7 +143,9 @@ func (c *queryClient) TallyResult(ctx context.Context, in *QueryTallyResultReque // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer -// for forward compatibility +// for forward compatibility. +// +// Query defines the gRPC querier service for gov module type QueryServer interface { // Proposal queries proposal details based on ProposalID. Proposal(context.Context, *QueryProposalRequest) (*QueryProposalResponse, error) @@ -145,7 +157,7 @@ type QueryServer interface { Votes(context.Context, *QueryVotesRequest) (*QueryVotesResponse, error) // Params queries all parameters of the gov module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // Deposit queries single deposit information based proposalID, depositAddr. + // Deposit queries single deposit information based on proposalID, depositor address. Deposit(context.Context, *QueryDepositRequest) (*QueryDepositResponse, error) // Deposits queries all deposits of a single proposal. Deposits(context.Context, *QueryDepositsRequest) (*QueryDepositsResponse, error) @@ -154,9 +166,12 @@ type QueryServer interface { mustEmbedUnimplementedQueryServer() } -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} +// UnimplementedQueryServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedQueryServer struct{} func (UnimplementedQueryServer) Proposal(context.Context, *QueryProposalRequest) (*QueryProposalResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Proposal not implemented") @@ -183,6 +198,7 @@ func (UnimplementedQueryServer) TallyResult(context.Context, *QueryTallyResultRe return nil, status.Errorf(codes.Unimplemented, "method TallyResult not implemented") } func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} +func (UnimplementedQueryServer) testEmbeddedByValue() {} // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to QueryServer will @@ -192,6 +208,13 @@ type UnsafeQueryServer interface { } func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + // If the following call pancis, it indicates UnimplementedQueryServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Query_ServiceDesc, srv) } diff --git a/api/cosmos/gov/v1beta1/tx_grpc.pb.go b/api/cosmos/gov/v1beta1/tx_grpc.pb.go index 6d389258cad1..55e1d137b01a 100644 --- a/api/cosmos/gov/v1beta1/tx_grpc.pb.go +++ b/api/cosmos/gov/v1beta1/tx_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/gov/v1beta1/tx.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Msg_SubmitProposal_FullMethodName = "/cosmos.gov.v1beta1.Msg/SubmitProposal" @@ -28,6 +28,8 @@ const ( // MsgClient is the client API for Msg service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Msg defines the gov Msg service. type MsgClient interface { // SubmitProposal defines a method to create new proposal given a content. SubmitProposal(ctx context.Context, in *MsgSubmitProposal, opts ...grpc.CallOption) (*MsgSubmitProposalResponse, error) @@ -50,8 +52,9 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { } func (c *msgClient) SubmitProposal(ctx context.Context, in *MsgSubmitProposal, opts ...grpc.CallOption) (*MsgSubmitProposalResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgSubmitProposalResponse) - err := c.cc.Invoke(ctx, Msg_SubmitProposal_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_SubmitProposal_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -59,8 +62,9 @@ func (c *msgClient) SubmitProposal(ctx context.Context, in *MsgSubmitProposal, o } func (c *msgClient) Vote(ctx context.Context, in *MsgVote, opts ...grpc.CallOption) (*MsgVoteResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgVoteResponse) - err := c.cc.Invoke(ctx, Msg_Vote_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_Vote_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -68,8 +72,9 @@ func (c *msgClient) Vote(ctx context.Context, in *MsgVote, opts ...grpc.CallOpti } func (c *msgClient) VoteWeighted(ctx context.Context, in *MsgVoteWeighted, opts ...grpc.CallOption) (*MsgVoteWeightedResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgVoteWeightedResponse) - err := c.cc.Invoke(ctx, Msg_VoteWeighted_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_VoteWeighted_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -77,8 +82,9 @@ func (c *msgClient) VoteWeighted(ctx context.Context, in *MsgVoteWeighted, opts } func (c *msgClient) Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.CallOption) (*MsgDepositResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgDepositResponse) - err := c.cc.Invoke(ctx, Msg_Deposit_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_Deposit_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -87,7 +93,9 @@ func (c *msgClient) Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.Ca // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer -// for forward compatibility +// for forward compatibility. +// +// Msg defines the gov Msg service. type MsgServer interface { // SubmitProposal defines a method to create new proposal given a content. SubmitProposal(context.Context, *MsgSubmitProposal) (*MsgSubmitProposalResponse, error) @@ -102,9 +110,12 @@ type MsgServer interface { mustEmbedUnimplementedMsgServer() } -// UnimplementedMsgServer must be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} +// UnimplementedMsgServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedMsgServer struct{} func (UnimplementedMsgServer) SubmitProposal(context.Context, *MsgSubmitProposal) (*MsgSubmitProposalResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SubmitProposal not implemented") @@ -119,6 +130,7 @@ func (UnimplementedMsgServer) Deposit(context.Context, *MsgDeposit) (*MsgDeposit return nil, status.Errorf(codes.Unimplemented, "method Deposit not implemented") } func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} +func (UnimplementedMsgServer) testEmbeddedByValue() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to MsgServer will @@ -128,6 +140,13 @@ type UnsafeMsgServer interface { } func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + // If the following call pancis, it indicates UnimplementedMsgServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Msg_ServiceDesc, srv) } diff --git a/api/cosmos/group/v1/events.pulsar.go b/api/cosmos/group/v1/events.pulsar.go index deebbe181739..31aa8b6c7140 100644 --- a/api/cosmos/group/v1/events.pulsar.go +++ b/api/cosmos/group/v1/events.pulsar.go @@ -4388,6 +4388,474 @@ func (x *fastReflection_EventProposalPruned) ProtoMethods() *protoiface.Methods } } +var ( + md_EventTallyError protoreflect.MessageDescriptor + fd_EventTallyError_proposal_id protoreflect.FieldDescriptor + fd_EventTallyError_error_message protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_group_v1_events_proto_init() + md_EventTallyError = File_cosmos_group_v1_events_proto.Messages().ByName("EventTallyError") + fd_EventTallyError_proposal_id = md_EventTallyError.Fields().ByName("proposal_id") + fd_EventTallyError_error_message = md_EventTallyError.Fields().ByName("error_message") +} + +var _ protoreflect.Message = (*fastReflection_EventTallyError)(nil) + +type fastReflection_EventTallyError EventTallyError + +func (x *EventTallyError) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventTallyError)(x) +} + +func (x *EventTallyError) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_group_v1_events_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_EventTallyError_messageType fastReflection_EventTallyError_messageType +var _ protoreflect.MessageType = fastReflection_EventTallyError_messageType{} + +type fastReflection_EventTallyError_messageType struct{} + +func (x fastReflection_EventTallyError_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventTallyError)(nil) +} +func (x fastReflection_EventTallyError_messageType) New() protoreflect.Message { + return new(fastReflection_EventTallyError) +} +func (x fastReflection_EventTallyError_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventTallyError +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventTallyError) Descriptor() protoreflect.MessageDescriptor { + return md_EventTallyError +} + +// 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_EventTallyError) Type() protoreflect.MessageType { + return _fastReflection_EventTallyError_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventTallyError) New() protoreflect.Message { + return new(fastReflection_EventTallyError) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventTallyError) Interface() protoreflect.ProtoMessage { + return (*EventTallyError)(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_EventTallyError) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ProposalId != uint64(0) { + value := protoreflect.ValueOfUint64(x.ProposalId) + if !f(fd_EventTallyError_proposal_id, value) { + return + } + } + if x.ErrorMessage != "" { + value := protoreflect.ValueOfString(x.ErrorMessage) + if !f(fd_EventTallyError_error_message, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_EventTallyError) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.group.v1.EventTallyError.proposal_id": + return x.ProposalId != uint64(0) + case "cosmos.group.v1.EventTallyError.error_message": + return x.ErrorMessage != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1.EventTallyError")) + } + panic(fmt.Errorf("message cosmos.group.v1.EventTallyError 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_EventTallyError) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.group.v1.EventTallyError.proposal_id": + x.ProposalId = uint64(0) + case "cosmos.group.v1.EventTallyError.error_message": + x.ErrorMessage = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1.EventTallyError")) + } + panic(fmt.Errorf("message cosmos.group.v1.EventTallyError 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_EventTallyError) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.group.v1.EventTallyError.proposal_id": + value := x.ProposalId + return protoreflect.ValueOfUint64(value) + case "cosmos.group.v1.EventTallyError.error_message": + value := x.ErrorMessage + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1.EventTallyError")) + } + panic(fmt.Errorf("message cosmos.group.v1.EventTallyError 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_EventTallyError) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.group.v1.EventTallyError.proposal_id": + x.ProposalId = value.Uint() + case "cosmos.group.v1.EventTallyError.error_message": + x.ErrorMessage = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1.EventTallyError")) + } + panic(fmt.Errorf("message cosmos.group.v1.EventTallyError 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_EventTallyError) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.group.v1.EventTallyError.proposal_id": + panic(fmt.Errorf("field proposal_id of message cosmos.group.v1.EventTallyError is not mutable")) + case "cosmos.group.v1.EventTallyError.error_message": + panic(fmt.Errorf("field error_message of message cosmos.group.v1.EventTallyError is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1.EventTallyError")) + } + panic(fmt.Errorf("message cosmos.group.v1.EventTallyError 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_EventTallyError) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.group.v1.EventTallyError.proposal_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.group.v1.EventTallyError.error_message": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1.EventTallyError")) + } + panic(fmt.Errorf("message cosmos.group.v1.EventTallyError 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_EventTallyError) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.group.v1.EventTallyError", 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_EventTallyError) 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_EventTallyError) 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_EventTallyError) 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_EventTallyError) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventTallyError) + 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.ProposalId != 0 { + n += 1 + runtime.Sov(uint64(x.ProposalId)) + } + l = len(x.ErrorMessage) + 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().(*EventTallyError) + 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.ErrorMessage) > 0 { + i -= len(x.ErrorMessage) + copy(dAtA[i:], x.ErrorMessage) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ErrorMessage))) + i-- + dAtA[i] = 0x12 + } + if x.ProposalId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ProposalId)) + 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().(*EventTallyError) + 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: EventTallyError: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventTallyError: 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 ProposalId", wireType) + } + x.ProposalId = 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.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ErrorMessage", 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.ErrorMessage = 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, + } +} + // Since: cosmos-sdk 0.46 // Code generated by protoc-gen-go. DO NOT EDIT. @@ -4818,6 +5286,52 @@ func (x *EventProposalPruned) GetTallyResult() *TallyResult { return nil } +// EventTallyError is an event emitted when a proposal tally failed with an error. +type EventTallyError struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // proposal_id is the unique ID of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` + // error_message is the raw error output + ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` +} + +func (x *EventTallyError) Reset() { + *x = EventTallyError{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_group_v1_events_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventTallyError) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventTallyError) ProtoMessage() {} + +// Deprecated: Use EventTallyError.ProtoReflect.Descriptor instead. +func (*EventTallyError) Descriptor() ([]byte, []int) { + return file_cosmos_group_v1_events_proto_rawDescGZIP(), []int{10} +} + +func (x *EventTallyError) GetProposalId() uint64 { + if x != nil { + return x.ProposalId + } + return 0 +} + +func (x *EventTallyError) GetErrorMessage() string { + if x != nil { + return x.ErrorMessage + } + return "" +} + var File_cosmos_group_v1_events_proto protoreflect.FileDescriptor var file_cosmos_group_v1_events_proto_rawDesc = []byte{ @@ -4878,18 +5392,24 @@ var file_cosmos_group_v1_events_proto_rawDesc = []byte{ 0x6c, 0x79, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x0b, 0x74, - 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, 0xaa, 0x01, 0x0a, 0x13, 0x63, - 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, - 0x76, 0x31, 0x42, 0x0b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x28, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, - 0x2f, 0x76, 0x31, 0x3b, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x47, - 0x58, 0xaa, 0x02, 0x0f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, - 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, - 0x72, 0x6f, 0x75, 0x70, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x47, 0x72, - 0x6f, 0x75, 0x70, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x57, 0x0a, 0x0f, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x1f, 0x0a, + 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x23, + 0x0a, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x42, 0xaa, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x28, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2f, 0x76, 0x31, 0x3b, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x47, 0x58, 0xaa, 0x02, 0x0f, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x5c, 0x56, 0x31, 0xe2, 0x02, + 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x5c, 0x56, 0x31, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -4904,7 +5424,7 @@ func file_cosmos_group_v1_events_proto_rawDescGZIP() []byte { return file_cosmos_group_v1_events_proto_rawDescData } -var file_cosmos_group_v1_events_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_cosmos_group_v1_events_proto_msgTypes = make([]protoimpl.MessageInfo, 11) var file_cosmos_group_v1_events_proto_goTypes = []interface{}{ (*EventCreateGroup)(nil), // 0: cosmos.group.v1.EventCreateGroup (*EventUpdateGroup)(nil), // 1: cosmos.group.v1.EventUpdateGroup @@ -4916,14 +5436,15 @@ var file_cosmos_group_v1_events_proto_goTypes = []interface{}{ (*EventExec)(nil), // 7: cosmos.group.v1.EventExec (*EventLeaveGroup)(nil), // 8: cosmos.group.v1.EventLeaveGroup (*EventProposalPruned)(nil), // 9: cosmos.group.v1.EventProposalPruned - (ProposalExecutorResult)(0), // 10: cosmos.group.v1.ProposalExecutorResult - (ProposalStatus)(0), // 11: cosmos.group.v1.ProposalStatus - (*TallyResult)(nil), // 12: cosmos.group.v1.TallyResult + (*EventTallyError)(nil), // 10: cosmos.group.v1.EventTallyError + (ProposalExecutorResult)(0), // 11: cosmos.group.v1.ProposalExecutorResult + (ProposalStatus)(0), // 12: cosmos.group.v1.ProposalStatus + (*TallyResult)(nil), // 13: cosmos.group.v1.TallyResult } var file_cosmos_group_v1_events_proto_depIdxs = []int32{ - 10, // 0: cosmos.group.v1.EventExec.result:type_name -> cosmos.group.v1.ProposalExecutorResult - 11, // 1: cosmos.group.v1.EventProposalPruned.status:type_name -> cosmos.group.v1.ProposalStatus - 12, // 2: cosmos.group.v1.EventProposalPruned.tally_result:type_name -> cosmos.group.v1.TallyResult + 11, // 0: cosmos.group.v1.EventExec.result:type_name -> cosmos.group.v1.ProposalExecutorResult + 12, // 1: cosmos.group.v1.EventProposalPruned.status:type_name -> cosmos.group.v1.ProposalStatus + 13, // 2: cosmos.group.v1.EventProposalPruned.tally_result:type_name -> cosmos.group.v1.TallyResult 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 @@ -5058,6 +5579,18 @@ func file_cosmos_group_v1_events_proto_init() { return nil } } + file_cosmos_group_v1_events_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventTallyError); 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{ @@ -5065,7 +5598,7 @@ func file_cosmos_group_v1_events_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_group_v1_events_proto_rawDesc, NumEnums: 0, - NumMessages: 10, + NumMessages: 11, NumExtensions: 0, NumServices: 0, }, diff --git a/api/cosmos/group/v1/query_grpc.pb.go b/api/cosmos/group/v1/query_grpc.pb.go index fe6a3540d79c..ebd65542175e 100644 --- a/api/cosmos/group/v1/query_grpc.pb.go +++ b/api/cosmos/group/v1/query_grpc.pb.go @@ -2,7 +2,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/group/v1/query.proto @@ -17,8 +17,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Query_GroupInfo_FullMethodName = "/cosmos.group.v1.Query/GroupInfo" @@ -40,6 +40,8 @@ const ( // QueryClient is the client API for Query service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Query is the cosmos.group.v1 Query service. type QueryClient interface { // GroupInfo queries group info based on group id. GroupInfo(ctx context.Context, in *QueryGroupInfoRequest, opts ...grpc.CallOption) (*QueryGroupInfoResponse, error) @@ -86,8 +88,9 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { } func (c *queryClient) GroupInfo(ctx context.Context, in *QueryGroupInfoRequest, opts ...grpc.CallOption) (*QueryGroupInfoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryGroupInfoResponse) - err := c.cc.Invoke(ctx, Query_GroupInfo_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_GroupInfo_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -95,8 +98,9 @@ func (c *queryClient) GroupInfo(ctx context.Context, in *QueryGroupInfoRequest, } func (c *queryClient) GroupPolicyInfo(ctx context.Context, in *QueryGroupPolicyInfoRequest, opts ...grpc.CallOption) (*QueryGroupPolicyInfoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryGroupPolicyInfoResponse) - err := c.cc.Invoke(ctx, Query_GroupPolicyInfo_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_GroupPolicyInfo_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -104,8 +108,9 @@ func (c *queryClient) GroupPolicyInfo(ctx context.Context, in *QueryGroupPolicyI } func (c *queryClient) GroupMembers(ctx context.Context, in *QueryGroupMembersRequest, opts ...grpc.CallOption) (*QueryGroupMembersResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryGroupMembersResponse) - err := c.cc.Invoke(ctx, Query_GroupMembers_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_GroupMembers_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -113,8 +118,9 @@ func (c *queryClient) GroupMembers(ctx context.Context, in *QueryGroupMembersReq } func (c *queryClient) GroupsByAdmin(ctx context.Context, in *QueryGroupsByAdminRequest, opts ...grpc.CallOption) (*QueryGroupsByAdminResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryGroupsByAdminResponse) - err := c.cc.Invoke(ctx, Query_GroupsByAdmin_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_GroupsByAdmin_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -122,8 +128,9 @@ func (c *queryClient) GroupsByAdmin(ctx context.Context, in *QueryGroupsByAdminR } func (c *queryClient) GroupPoliciesByGroup(ctx context.Context, in *QueryGroupPoliciesByGroupRequest, opts ...grpc.CallOption) (*QueryGroupPoliciesByGroupResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryGroupPoliciesByGroupResponse) - err := c.cc.Invoke(ctx, Query_GroupPoliciesByGroup_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_GroupPoliciesByGroup_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -131,8 +138,9 @@ func (c *queryClient) GroupPoliciesByGroup(ctx context.Context, in *QueryGroupPo } func (c *queryClient) GroupPoliciesByAdmin(ctx context.Context, in *QueryGroupPoliciesByAdminRequest, opts ...grpc.CallOption) (*QueryGroupPoliciesByAdminResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryGroupPoliciesByAdminResponse) - err := c.cc.Invoke(ctx, Query_GroupPoliciesByAdmin_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_GroupPoliciesByAdmin_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -140,8 +148,9 @@ func (c *queryClient) GroupPoliciesByAdmin(ctx context.Context, in *QueryGroupPo } func (c *queryClient) Proposal(ctx context.Context, in *QueryProposalRequest, opts ...grpc.CallOption) (*QueryProposalResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryProposalResponse) - err := c.cc.Invoke(ctx, Query_Proposal_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Proposal_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -149,8 +158,9 @@ func (c *queryClient) Proposal(ctx context.Context, in *QueryProposalRequest, op } func (c *queryClient) ProposalsByGroupPolicy(ctx context.Context, in *QueryProposalsByGroupPolicyRequest, opts ...grpc.CallOption) (*QueryProposalsByGroupPolicyResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryProposalsByGroupPolicyResponse) - err := c.cc.Invoke(ctx, Query_ProposalsByGroupPolicy_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_ProposalsByGroupPolicy_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -158,8 +168,9 @@ func (c *queryClient) ProposalsByGroupPolicy(ctx context.Context, in *QueryPropo } func (c *queryClient) VoteByProposalVoter(ctx context.Context, in *QueryVoteByProposalVoterRequest, opts ...grpc.CallOption) (*QueryVoteByProposalVoterResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryVoteByProposalVoterResponse) - err := c.cc.Invoke(ctx, Query_VoteByProposalVoter_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_VoteByProposalVoter_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -167,8 +178,9 @@ func (c *queryClient) VoteByProposalVoter(ctx context.Context, in *QueryVoteByPr } func (c *queryClient) VotesByProposal(ctx context.Context, in *QueryVotesByProposalRequest, opts ...grpc.CallOption) (*QueryVotesByProposalResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryVotesByProposalResponse) - err := c.cc.Invoke(ctx, Query_VotesByProposal_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_VotesByProposal_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -176,8 +188,9 @@ func (c *queryClient) VotesByProposal(ctx context.Context, in *QueryVotesByPropo } func (c *queryClient) VotesByVoter(ctx context.Context, in *QueryVotesByVoterRequest, opts ...grpc.CallOption) (*QueryVotesByVoterResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryVotesByVoterResponse) - err := c.cc.Invoke(ctx, Query_VotesByVoter_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_VotesByVoter_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -185,8 +198,9 @@ func (c *queryClient) VotesByVoter(ctx context.Context, in *QueryVotesByVoterReq } func (c *queryClient) GroupsByMember(ctx context.Context, in *QueryGroupsByMemberRequest, opts ...grpc.CallOption) (*QueryGroupsByMemberResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryGroupsByMemberResponse) - err := c.cc.Invoke(ctx, Query_GroupsByMember_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_GroupsByMember_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -194,8 +208,9 @@ func (c *queryClient) GroupsByMember(ctx context.Context, in *QueryGroupsByMembe } func (c *queryClient) TallyResult(ctx context.Context, in *QueryTallyResultRequest, opts ...grpc.CallOption) (*QueryTallyResultResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryTallyResultResponse) - err := c.cc.Invoke(ctx, Query_TallyResult_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_TallyResult_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -203,8 +218,9 @@ func (c *queryClient) TallyResult(ctx context.Context, in *QueryTallyResultReque } func (c *queryClient) Groups(ctx context.Context, in *QueryGroupsRequest, opts ...grpc.CallOption) (*QueryGroupsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryGroupsResponse) - err := c.cc.Invoke(ctx, Query_Groups_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Groups_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -213,7 +229,9 @@ func (c *queryClient) Groups(ctx context.Context, in *QueryGroupsRequest, opts . // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer -// for forward compatibility +// for forward compatibility. +// +// Query is the cosmos.group.v1 Query service. type QueryServer interface { // GroupInfo queries group info based on group id. GroupInfo(context.Context, *QueryGroupInfoRequest) (*QueryGroupInfoResponse, error) @@ -252,9 +270,12 @@ type QueryServer interface { mustEmbedUnimplementedQueryServer() } -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} +// UnimplementedQueryServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedQueryServer struct{} func (UnimplementedQueryServer) GroupInfo(context.Context, *QueryGroupInfoRequest) (*QueryGroupInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GroupInfo not implemented") @@ -299,6 +320,7 @@ func (UnimplementedQueryServer) Groups(context.Context, *QueryGroupsRequest) (*Q return nil, status.Errorf(codes.Unimplemented, "method Groups not implemented") } func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} +func (UnimplementedQueryServer) testEmbeddedByValue() {} // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to QueryServer will @@ -308,6 +330,13 @@ type UnsafeQueryServer interface { } func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + // If the following call pancis, it indicates UnimplementedQueryServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Query_ServiceDesc, srv) } diff --git a/api/cosmos/group/v1/tx_grpc.pb.go b/api/cosmos/group/v1/tx_grpc.pb.go index 08904c762bb7..e0c6a2dc1f90 100644 --- a/api/cosmos/group/v1/tx_grpc.pb.go +++ b/api/cosmos/group/v1/tx_grpc.pb.go @@ -2,7 +2,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/group/v1/tx.proto @@ -17,8 +17,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Msg_CreateGroup_FullMethodName = "/cosmos.group.v1.Msg/CreateGroup" @@ -40,6 +40,8 @@ const ( // MsgClient is the client API for Msg service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Msg is the cosmos.group.v1 Msg service. type MsgClient interface { // CreateGroup creates a new group with an admin account address, a list of members and some optional metadata. CreateGroup(ctx context.Context, in *MsgCreateGroup, opts ...grpc.CallOption) (*MsgCreateGroupResponse, error) @@ -80,8 +82,9 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { } func (c *msgClient) CreateGroup(ctx context.Context, in *MsgCreateGroup, opts ...grpc.CallOption) (*MsgCreateGroupResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgCreateGroupResponse) - err := c.cc.Invoke(ctx, Msg_CreateGroup_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_CreateGroup_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -89,8 +92,9 @@ func (c *msgClient) CreateGroup(ctx context.Context, in *MsgCreateGroup, opts .. } func (c *msgClient) UpdateGroupMembers(ctx context.Context, in *MsgUpdateGroupMembers, opts ...grpc.CallOption) (*MsgUpdateGroupMembersResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgUpdateGroupMembersResponse) - err := c.cc.Invoke(ctx, Msg_UpdateGroupMembers_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_UpdateGroupMembers_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -98,8 +102,9 @@ func (c *msgClient) UpdateGroupMembers(ctx context.Context, in *MsgUpdateGroupMe } func (c *msgClient) UpdateGroupAdmin(ctx context.Context, in *MsgUpdateGroupAdmin, opts ...grpc.CallOption) (*MsgUpdateGroupAdminResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgUpdateGroupAdminResponse) - err := c.cc.Invoke(ctx, Msg_UpdateGroupAdmin_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_UpdateGroupAdmin_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -107,8 +112,9 @@ func (c *msgClient) UpdateGroupAdmin(ctx context.Context, in *MsgUpdateGroupAdmi } func (c *msgClient) UpdateGroupMetadata(ctx context.Context, in *MsgUpdateGroupMetadata, opts ...grpc.CallOption) (*MsgUpdateGroupMetadataResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgUpdateGroupMetadataResponse) - err := c.cc.Invoke(ctx, Msg_UpdateGroupMetadata_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_UpdateGroupMetadata_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -116,8 +122,9 @@ func (c *msgClient) UpdateGroupMetadata(ctx context.Context, in *MsgUpdateGroupM } func (c *msgClient) CreateGroupPolicy(ctx context.Context, in *MsgCreateGroupPolicy, opts ...grpc.CallOption) (*MsgCreateGroupPolicyResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgCreateGroupPolicyResponse) - err := c.cc.Invoke(ctx, Msg_CreateGroupPolicy_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_CreateGroupPolicy_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -125,8 +132,9 @@ func (c *msgClient) CreateGroupPolicy(ctx context.Context, in *MsgCreateGroupPol } func (c *msgClient) CreateGroupWithPolicy(ctx context.Context, in *MsgCreateGroupWithPolicy, opts ...grpc.CallOption) (*MsgCreateGroupWithPolicyResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgCreateGroupWithPolicyResponse) - err := c.cc.Invoke(ctx, Msg_CreateGroupWithPolicy_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_CreateGroupWithPolicy_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -134,8 +142,9 @@ func (c *msgClient) CreateGroupWithPolicy(ctx context.Context, in *MsgCreateGrou } func (c *msgClient) UpdateGroupPolicyAdmin(ctx context.Context, in *MsgUpdateGroupPolicyAdmin, opts ...grpc.CallOption) (*MsgUpdateGroupPolicyAdminResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgUpdateGroupPolicyAdminResponse) - err := c.cc.Invoke(ctx, Msg_UpdateGroupPolicyAdmin_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_UpdateGroupPolicyAdmin_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -143,8 +152,9 @@ func (c *msgClient) UpdateGroupPolicyAdmin(ctx context.Context, in *MsgUpdateGro } func (c *msgClient) UpdateGroupPolicyDecisionPolicy(ctx context.Context, in *MsgUpdateGroupPolicyDecisionPolicy, opts ...grpc.CallOption) (*MsgUpdateGroupPolicyDecisionPolicyResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgUpdateGroupPolicyDecisionPolicyResponse) - err := c.cc.Invoke(ctx, Msg_UpdateGroupPolicyDecisionPolicy_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_UpdateGroupPolicyDecisionPolicy_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -152,8 +162,9 @@ func (c *msgClient) UpdateGroupPolicyDecisionPolicy(ctx context.Context, in *Msg } func (c *msgClient) UpdateGroupPolicyMetadata(ctx context.Context, in *MsgUpdateGroupPolicyMetadata, opts ...grpc.CallOption) (*MsgUpdateGroupPolicyMetadataResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgUpdateGroupPolicyMetadataResponse) - err := c.cc.Invoke(ctx, Msg_UpdateGroupPolicyMetadata_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_UpdateGroupPolicyMetadata_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -161,8 +172,9 @@ func (c *msgClient) UpdateGroupPolicyMetadata(ctx context.Context, in *MsgUpdate } func (c *msgClient) SubmitProposal(ctx context.Context, in *MsgSubmitProposal, opts ...grpc.CallOption) (*MsgSubmitProposalResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgSubmitProposalResponse) - err := c.cc.Invoke(ctx, Msg_SubmitProposal_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_SubmitProposal_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -170,8 +182,9 @@ func (c *msgClient) SubmitProposal(ctx context.Context, in *MsgSubmitProposal, o } func (c *msgClient) WithdrawProposal(ctx context.Context, in *MsgWithdrawProposal, opts ...grpc.CallOption) (*MsgWithdrawProposalResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgWithdrawProposalResponse) - err := c.cc.Invoke(ctx, Msg_WithdrawProposal_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_WithdrawProposal_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -179,8 +192,9 @@ func (c *msgClient) WithdrawProposal(ctx context.Context, in *MsgWithdrawProposa } func (c *msgClient) Vote(ctx context.Context, in *MsgVote, opts ...grpc.CallOption) (*MsgVoteResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgVoteResponse) - err := c.cc.Invoke(ctx, Msg_Vote_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_Vote_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -188,8 +202,9 @@ func (c *msgClient) Vote(ctx context.Context, in *MsgVote, opts ...grpc.CallOpti } func (c *msgClient) Exec(ctx context.Context, in *MsgExec, opts ...grpc.CallOption) (*MsgExecResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgExecResponse) - err := c.cc.Invoke(ctx, Msg_Exec_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_Exec_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -197,8 +212,9 @@ func (c *msgClient) Exec(ctx context.Context, in *MsgExec, opts ...grpc.CallOpti } func (c *msgClient) LeaveGroup(ctx context.Context, in *MsgLeaveGroup, opts ...grpc.CallOption) (*MsgLeaveGroupResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgLeaveGroupResponse) - err := c.cc.Invoke(ctx, Msg_LeaveGroup_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_LeaveGroup_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -207,7 +223,9 @@ func (c *msgClient) LeaveGroup(ctx context.Context, in *MsgLeaveGroup, opts ...g // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer -// for forward compatibility +// for forward compatibility. +// +// Msg is the cosmos.group.v1 Msg service. type MsgServer interface { // CreateGroup creates a new group with an admin account address, a list of members and some optional metadata. CreateGroup(context.Context, *MsgCreateGroup) (*MsgCreateGroupResponse, error) @@ -240,9 +258,12 @@ type MsgServer interface { mustEmbedUnimplementedMsgServer() } -// UnimplementedMsgServer must be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} +// UnimplementedMsgServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedMsgServer struct{} func (UnimplementedMsgServer) CreateGroup(context.Context, *MsgCreateGroup) (*MsgCreateGroupResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateGroup not implemented") @@ -287,6 +308,7 @@ func (UnimplementedMsgServer) LeaveGroup(context.Context, *MsgLeaveGroup) (*MsgL return nil, status.Errorf(codes.Unimplemented, "method LeaveGroup not implemented") } func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} +func (UnimplementedMsgServer) testEmbeddedByValue() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to MsgServer will @@ -296,6 +318,13 @@ type UnsafeMsgServer interface { } func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + // If the following call pancis, it indicates UnimplementedMsgServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Msg_ServiceDesc, srv) } diff --git a/api/cosmos/mint/v1beta1/mint.pulsar.go b/api/cosmos/mint/v1beta1/mint.pulsar.go index 25e3dac62039..8007c79c9630 100644 --- a/api/cosmos/mint/v1beta1/mint.pulsar.go +++ b/api/cosmos/mint/v1beta1/mint.pulsar.go @@ -1374,67 +1374,63 @@ var file_cosmos_mint_v1beta1_mint_proto_rawDesc = []byte{ 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, - 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xcf, 0x01, 0x0a, 0x06, 0x4d, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x12, 0x5a, 0x0a, 0x09, 0x69, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x3c, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, - 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x09, 0x69, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x69, 0x0a, 0x11, 0x61, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x3c, 0xc8, 0xde, 0x1f, - 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, - 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x10, 0x61, 0x6e, 0x6e, 0x75, 0x61, - 0x6c, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x99, 0x04, 0x0a, 0x06, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x69, 0x6e, 0x74, 0x5f, 0x64, - 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x69, 0x6e, 0x74, - 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x75, 0x0a, 0x15, 0x69, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x41, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, - 0x65, 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x13, 0x69, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x66, 0x0a, 0x0d, - 0x69, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x78, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x41, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb9, 0x01, 0x0a, 0x06, 0x4d, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x12, 0x4f, 0x0a, 0x09, 0x69, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, + 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, + 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x09, 0x69, 0x6e, 0x66, 0x6c, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x5e, 0x0a, 0x11, 0x61, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x5f, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, + 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x44, 0x65, 0x63, 0x52, 0x10, 0x61, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x76, 0x69, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xed, 0x03, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x69, 0x6e, 0x74, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x69, 0x6e, 0x74, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, + 0x6a, 0x0a, 0x15, 0x69, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x74, + 0x65, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x36, + 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, + 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, - 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0c, 0x69, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x4d, 0x61, 0x78, 0x12, 0x66, 0x0a, 0x0d, 0x69, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x6d, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x41, 0xc8, 0xde, 0x1f, - 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, - 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0c, - 0x69, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x69, 0x6e, 0x12, 0x62, 0x0a, 0x0b, - 0x67, 0x6f, 0x61, 0x6c, 0x5f, 0x62, 0x6f, 0x6e, 0x64, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x41, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, - 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, - 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x67, 0x6f, 0x61, 0x6c, 0x42, 0x6f, 0x6e, 0x64, 0x65, 0x64, - 0x12, 0x26, 0x0a, 0x0f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x79, - 0x65, 0x61, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x73, 0x50, 0x65, 0x72, 0x59, 0x65, 0x61, 0x72, 0x3a, 0x1d, 0x8a, 0xe7, 0xb0, 0x2a, 0x18, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, 0x6d, 0x69, 0x6e, 0x74, - 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xc4, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x42, 0x09, 0x4d, 0x69, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x6d, 0x69, 0x6e, 0x74, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x4d, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x4d, 0x69, 0x6e, 0x74, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, - 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x4d, 0x69, 0x6e, 0x74, 0x5c, 0x56, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x4d, 0x69, - 0x6e, 0x74, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, - 0x3a, 0x4d, 0x69, 0x6e, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x13, 0x69, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x5b, 0x0a, 0x0d, 0x69, + 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x78, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x36, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, + 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0c, 0x69, 0x6e, 0x66, 0x6c, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x78, 0x12, 0x5b, 0x0a, 0x0d, 0x69, 0x6e, 0x66, 0x6c, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x36, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, + 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, + 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, + 0x65, 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0c, 0x69, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x4d, 0x69, 0x6e, 0x12, 0x57, 0x0a, 0x0b, 0x67, 0x6f, 0x61, 0x6c, 0x5f, 0x62, 0x6f, + 0x6e, 0x64, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x36, 0xc8, 0xde, 0x1f, 0x00, + 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, + 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, + 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, 0xe7, 0xb0, + 0x2a, 0x01, 0x52, 0x0a, 0x67, 0x6f, 0x61, 0x6c, 0x42, 0x6f, 0x6e, 0x64, 0x65, 0x64, 0x12, 0x26, + 0x0a, 0x0f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x79, 0x65, 0x61, + 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x50, + 0x65, 0x72, 0x59, 0x65, 0x61, 0x72, 0x3a, 0x1d, 0x8a, 0xe7, 0xb0, 0x2a, 0x18, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xc4, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x42, 0x09, 0x4d, 0x69, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x3b, 0x6d, 0x69, 0x6e, 0x74, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0xa2, 0x02, 0x03, 0x43, 0x4d, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x4d, 0x69, 0x6e, 0x74, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x13, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x4d, 0x69, 0x6e, 0x74, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x4d, 0x69, 0x6e, 0x74, + 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x4d, + 0x69, 0x6e, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/mint/v1beta1/query.pulsar.go b/api/cosmos/mint/v1beta1/query.pulsar.go index 6d58cbccadb4..4bb399d4a01d 100644 --- a/api/cosmos/mint/v1beta1/query.pulsar.go +++ b/api/cosmos/mint/v1beta1/query.pulsar.go @@ -4,6 +4,7 @@ package mintv1beta1 import ( _ "cosmossdk.io/api/amino" fmt "fmt" + _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -2582,74 +2583,76 @@ var file_cosmos_mint_v1beta1_query_proto_rawDesc = []byte{ 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 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, 0x22, 0x14, 0x0a, - 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x22, 0x55, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x06, 0x70, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x6f, 0x73, + 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x55, + 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6d, + 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x17, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x6e, + 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x6e, + 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, 0x0a, 0x09, 0x69, 0x6e, 0x66, 0x6c, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x36, 0xc8, 0xde, 0x1f, + 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, + 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, + 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, 0xe7, + 0xb0, 0x2a, 0x01, 0x52, 0x09, 0x69, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x1e, + 0x0a, 0x1c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x50, 0x72, 0x6f, + 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x84, + 0x01, 0x0a, 0x1d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x50, 0x72, + 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x63, 0x0a, 0x11, 0x61, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x36, 0xc8, 0xde, 0x1f, + 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, + 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, + 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, 0xe7, + 0xb0, 0x2a, 0x01, 0x52, 0x10, 0x61, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x76, 0x69, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x32, 0xc5, 0x03, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, + 0x80, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, - 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x17, 0x0a, 0x15, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x22, 0x6b, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6c, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, - 0x09, 0x69, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x33, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x63, - 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x09, 0x69, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x22, 0x1e, 0x0a, 0x1c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x50, - 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x22, 0x81, 0x01, 0x0a, 0x1d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, - 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x60, 0x0a, 0x11, 0x61, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, - 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x33, 0xc8, - 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, - 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, 0xe7, 0xb0, - 0x2a, 0x01, 0x52, 0x10, 0x61, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, - 0x69, 0x6f, 0x6e, 0x73, 0x32, 0xc5, 0x03, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x80, - 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6d, 0x69, 0x6e, + 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, + 0x69, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x8c, 0x01, 0x0a, 0x09, 0x49, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6c, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x20, 0x12, 0x1e, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x2f, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x69, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0xa9, 0x01, 0x0a, 0x10, 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x76, + 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x31, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x69, - 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x12, 0x8c, 0x01, 0x0a, 0x09, 0x49, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6c, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, - 0x12, 0x1e, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x69, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0xa9, 0x01, 0x0a, 0x10, 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x76, 0x69, - 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x31, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6d, - 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, - 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x69, - 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x61, 0x6e, 0x6e, 0x75, 0x61, - 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0xc5, 0x01, 0x0a, - 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x74, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, - 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, - 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x6d, 0x69, 0x6e, - 0x74, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x4d, 0x58, 0xaa, 0x02, - 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x4d, 0x69, 0x6e, 0x74, 0x2e, 0x56, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x4d, 0x69, - 0x6e, 0x74, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x5c, 0x4d, 0x69, 0x6e, 0x74, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x43, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x4d, 0x69, 0x6e, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6e, 0x6e, 0x75, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x76, 0x69, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, + 0x69, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x61, 0x6e, 0x6e, 0x75, + 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0xc5, 0x01, + 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6d, 0x69, 0x6e, + 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, + 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x6d, 0x69, + 0x6e, 0x74, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x4d, 0x58, 0xaa, + 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x4d, 0x69, 0x6e, 0x74, 0x2e, 0x56, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x4d, + 0x69, 0x6e, 0x74, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x4d, 0x69, 0x6e, 0x74, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x4d, 0x69, 0x6e, 0x74, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/mint/v1beta1/query_grpc.pb.go b/api/cosmos/mint/v1beta1/query_grpc.pb.go index 65fef7a8cd4c..106ea5dff955 100644 --- a/api/cosmos/mint/v1beta1/query_grpc.pb.go +++ b/api/cosmos/mint/v1beta1/query_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/mint/v1beta1/query.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Query_Params_FullMethodName = "/cosmos.mint.v1beta1.Query/Params" @@ -27,6 +27,8 @@ const ( // QueryClient is the client API for Query service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Query provides defines the gRPC querier service. type QueryClient interface { // Params returns the total set of minting parameters. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) @@ -45,8 +47,9 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { } func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -54,8 +57,9 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . } func (c *queryClient) Inflation(ctx context.Context, in *QueryInflationRequest, opts ...grpc.CallOption) (*QueryInflationResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryInflationResponse) - err := c.cc.Invoke(ctx, Query_Inflation_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Inflation_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -63,8 +67,9 @@ func (c *queryClient) Inflation(ctx context.Context, in *QueryInflationRequest, } func (c *queryClient) AnnualProvisions(ctx context.Context, in *QueryAnnualProvisionsRequest, opts ...grpc.CallOption) (*QueryAnnualProvisionsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryAnnualProvisionsResponse) - err := c.cc.Invoke(ctx, Query_AnnualProvisions_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_AnnualProvisions_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -73,7 +78,9 @@ func (c *queryClient) AnnualProvisions(ctx context.Context, in *QueryAnnualProvi // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer -// for forward compatibility +// for forward compatibility. +// +// Query provides defines the gRPC querier service. type QueryServer interface { // Params returns the total set of minting parameters. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) @@ -84,9 +91,12 @@ type QueryServer interface { mustEmbedUnimplementedQueryServer() } -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} +// UnimplementedQueryServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedQueryServer struct{} func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") @@ -98,6 +108,7 @@ func (UnimplementedQueryServer) AnnualProvisions(context.Context, *QueryAnnualPr return nil, status.Errorf(codes.Unimplemented, "method AnnualProvisions not implemented") } func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} +func (UnimplementedQueryServer) testEmbeddedByValue() {} // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to QueryServer will @@ -107,6 +118,13 @@ type UnsafeQueryServer interface { } func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + // If the following call pancis, it indicates UnimplementedQueryServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Query_ServiceDesc, srv) } diff --git a/api/cosmos/mint/v1beta1/tx_grpc.pb.go b/api/cosmos/mint/v1beta1/tx_grpc.pb.go index 62a94bc6e02c..15ee78e3154c 100644 --- a/api/cosmos/mint/v1beta1/tx_grpc.pb.go +++ b/api/cosmos/mint/v1beta1/tx_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/mint/v1beta1/tx.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Msg_UpdateParams_FullMethodName = "/cosmos.mint.v1beta1.Msg/UpdateParams" @@ -25,6 +25,8 @@ const ( // MsgClient is the client API for Msg service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Msg defines the x/mint Msg service. type MsgClient interface { // UpdateParams defines a governance operation for updating the x/mint module // parameters. The authority is defaults to the x/gov module account. @@ -42,8 +44,9 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { } func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -52,7 +55,9 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer -// for forward compatibility +// for forward compatibility. +// +// Msg defines the x/mint Msg service. type MsgServer interface { // UpdateParams defines a governance operation for updating the x/mint module // parameters. The authority is defaults to the x/gov module account. @@ -62,14 +67,18 @@ type MsgServer interface { mustEmbedUnimplementedMsgServer() } -// UnimplementedMsgServer must be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} +// UnimplementedMsgServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedMsgServer struct{} func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} +func (UnimplementedMsgServer) testEmbeddedByValue() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to MsgServer will @@ -79,6 +88,13 @@ type UnsafeMsgServer interface { } func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + // If the following call pancis, it indicates UnimplementedMsgServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Msg_ServiceDesc, srv) } diff --git a/api/cosmos/nft/v1beta1/query_grpc.pb.go b/api/cosmos/nft/v1beta1/query_grpc.pb.go index 216b998cf12d..304fa9446ef0 100644 --- a/api/cosmos/nft/v1beta1/query_grpc.pb.go +++ b/api/cosmos/nft/v1beta1/query_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/nft/v1beta1/query.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Query_Balance_FullMethodName = "/cosmos.nft.v1beta1.Query/Balance" @@ -31,6 +31,8 @@ const ( // QueryClient is the client API for Query service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Query defines the gRPC querier service. type QueryClient interface { // Balance queries the number of NFTs of a given class owned by the owner, same as balanceOf in ERC721 Balance(ctx context.Context, in *QueryBalanceRequest, opts ...grpc.CallOption) (*QueryBalanceResponse, error) @@ -58,8 +60,9 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { } func (c *queryClient) Balance(ctx context.Context, in *QueryBalanceRequest, opts ...grpc.CallOption) (*QueryBalanceResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryBalanceResponse) - err := c.cc.Invoke(ctx, Query_Balance_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Balance_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -67,8 +70,9 @@ func (c *queryClient) Balance(ctx context.Context, in *QueryBalanceRequest, opts } func (c *queryClient) Owner(ctx context.Context, in *QueryOwnerRequest, opts ...grpc.CallOption) (*QueryOwnerResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryOwnerResponse) - err := c.cc.Invoke(ctx, Query_Owner_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Owner_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -76,8 +80,9 @@ func (c *queryClient) Owner(ctx context.Context, in *QueryOwnerRequest, opts ... } func (c *queryClient) Supply(ctx context.Context, in *QuerySupplyRequest, opts ...grpc.CallOption) (*QuerySupplyResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QuerySupplyResponse) - err := c.cc.Invoke(ctx, Query_Supply_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Supply_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -85,8 +90,9 @@ func (c *queryClient) Supply(ctx context.Context, in *QuerySupplyRequest, opts . } func (c *queryClient) NFTs(ctx context.Context, in *QueryNFTsRequest, opts ...grpc.CallOption) (*QueryNFTsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryNFTsResponse) - err := c.cc.Invoke(ctx, Query_NFTs_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_NFTs_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -94,8 +100,9 @@ func (c *queryClient) NFTs(ctx context.Context, in *QueryNFTsRequest, opts ...gr } func (c *queryClient) NFT(ctx context.Context, in *QueryNFTRequest, opts ...grpc.CallOption) (*QueryNFTResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryNFTResponse) - err := c.cc.Invoke(ctx, Query_NFT_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_NFT_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -103,8 +110,9 @@ func (c *queryClient) NFT(ctx context.Context, in *QueryNFTRequest, opts ...grpc } func (c *queryClient) Class(ctx context.Context, in *QueryClassRequest, opts ...grpc.CallOption) (*QueryClassResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryClassResponse) - err := c.cc.Invoke(ctx, Query_Class_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Class_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -112,8 +120,9 @@ func (c *queryClient) Class(ctx context.Context, in *QueryClassRequest, opts ... } func (c *queryClient) Classes(ctx context.Context, in *QueryClassesRequest, opts ...grpc.CallOption) (*QueryClassesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryClassesResponse) - err := c.cc.Invoke(ctx, Query_Classes_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Classes_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -122,7 +131,9 @@ func (c *queryClient) Classes(ctx context.Context, in *QueryClassesRequest, opts // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer -// for forward compatibility +// for forward compatibility. +// +// Query defines the gRPC querier service. type QueryServer interface { // Balance queries the number of NFTs of a given class owned by the owner, same as balanceOf in ERC721 Balance(context.Context, *QueryBalanceRequest) (*QueryBalanceResponse, error) @@ -142,9 +153,12 @@ type QueryServer interface { mustEmbedUnimplementedQueryServer() } -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} +// UnimplementedQueryServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedQueryServer struct{} func (UnimplementedQueryServer) Balance(context.Context, *QueryBalanceRequest) (*QueryBalanceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Balance not implemented") @@ -168,6 +182,7 @@ func (UnimplementedQueryServer) Classes(context.Context, *QueryClassesRequest) ( return nil, status.Errorf(codes.Unimplemented, "method Classes not implemented") } func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} +func (UnimplementedQueryServer) testEmbeddedByValue() {} // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to QueryServer will @@ -177,6 +192,13 @@ type UnsafeQueryServer interface { } func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + // If the following call pancis, it indicates UnimplementedQueryServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Query_ServiceDesc, srv) } diff --git a/api/cosmos/nft/v1beta1/tx_grpc.pb.go b/api/cosmos/nft/v1beta1/tx_grpc.pb.go index 379ae24b37a8..f706ced24403 100644 --- a/api/cosmos/nft/v1beta1/tx_grpc.pb.go +++ b/api/cosmos/nft/v1beta1/tx_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/nft/v1beta1/tx.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Msg_Send_FullMethodName = "/cosmos.nft.v1beta1.Msg/Send" @@ -25,6 +25,8 @@ const ( // MsgClient is the client API for Msg service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Msg defines the nft Msg service. type MsgClient interface { // Send defines a method to send a nft from one account to another account. Send(ctx context.Context, in *MsgSend, opts ...grpc.CallOption) (*MsgSendResponse, error) @@ -39,8 +41,9 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { } func (c *msgClient) Send(ctx context.Context, in *MsgSend, opts ...grpc.CallOption) (*MsgSendResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgSendResponse) - err := c.cc.Invoke(ctx, Msg_Send_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_Send_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -49,21 +52,27 @@ func (c *msgClient) Send(ctx context.Context, in *MsgSend, opts ...grpc.CallOpti // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer -// for forward compatibility +// for forward compatibility. +// +// Msg defines the nft Msg service. type MsgServer interface { // Send defines a method to send a nft from one account to another account. Send(context.Context, *MsgSend) (*MsgSendResponse, error) mustEmbedUnimplementedMsgServer() } -// UnimplementedMsgServer must be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} +// UnimplementedMsgServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedMsgServer struct{} func (UnimplementedMsgServer) Send(context.Context, *MsgSend) (*MsgSendResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Send not implemented") } func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} +func (UnimplementedMsgServer) testEmbeddedByValue() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to MsgServer will @@ -73,6 +82,13 @@ type UnsafeMsgServer interface { } func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + // If the following call pancis, it indicates UnimplementedMsgServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Msg_ServiceDesc, srv) } diff --git a/api/cosmos/orm/query/v1alpha1/query.pulsar.go b/api/cosmos/orm/query/v1alpha1/query.pulsar.go deleted file mode 100644 index 1cd8e3dec149..000000000000 --- a/api/cosmos/orm/query/v1alpha1/query.pulsar.go +++ /dev/null @@ -1,5377 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package queryv1alpha1 - -import ( - v1beta1 "cosmossdk.io/api/cosmos/base/query/v1beta1" - 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" - anypb "google.golang.org/protobuf/types/known/anypb" - durationpb "google.golang.org/protobuf/types/known/durationpb" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - io "io" - reflect "reflect" - sync "sync" -) - -var _ protoreflect.List = (*_GetRequest_3_list)(nil) - -type _GetRequest_3_list struct { - list *[]*IndexValue -} - -func (x *_GetRequest_3_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_GetRequest_3_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_GetRequest_3_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*IndexValue) - (*x.list)[i] = concreteValue -} - -func (x *_GetRequest_3_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*IndexValue) - *x.list = append(*x.list, concreteValue) -} - -func (x *_GetRequest_3_list) AppendMutable() protoreflect.Value { - v := new(IndexValue) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_GetRequest_3_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_GetRequest_3_list) NewElement() protoreflect.Value { - v := new(IndexValue) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_GetRequest_3_list) IsValid() bool { - return x.list != nil -} - -var ( - md_GetRequest protoreflect.MessageDescriptor - fd_GetRequest_message_name protoreflect.FieldDescriptor - fd_GetRequest_index protoreflect.FieldDescriptor - fd_GetRequest_values protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_orm_query_v1alpha1_query_proto_init() - md_GetRequest = File_cosmos_orm_query_v1alpha1_query_proto.Messages().ByName("GetRequest") - fd_GetRequest_message_name = md_GetRequest.Fields().ByName("message_name") - fd_GetRequest_index = md_GetRequest.Fields().ByName("index") - fd_GetRequest_values = md_GetRequest.Fields().ByName("values") -} - -var _ protoreflect.Message = (*fastReflection_GetRequest)(nil) - -type fastReflection_GetRequest GetRequest - -func (x *GetRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_GetRequest)(x) -} - -func (x *GetRequest) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_orm_query_v1alpha1_query_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_GetRequest_messageType fastReflection_GetRequest_messageType -var _ protoreflect.MessageType = fastReflection_GetRequest_messageType{} - -type fastReflection_GetRequest_messageType struct{} - -func (x fastReflection_GetRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_GetRequest)(nil) -} -func (x fastReflection_GetRequest_messageType) New() protoreflect.Message { - return new(fastReflection_GetRequest) -} -func (x fastReflection_GetRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_GetRequest -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_GetRequest) Descriptor() protoreflect.MessageDescriptor { - return md_GetRequest -} - -// 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_GetRequest) Type() protoreflect.MessageType { - return _fastReflection_GetRequest_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_GetRequest) New() protoreflect.Message { - return new(fastReflection_GetRequest) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_GetRequest) Interface() protoreflect.ProtoMessage { - return (*GetRequest)(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_GetRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.MessageName != "" { - value := protoreflect.ValueOfString(x.MessageName) - if !f(fd_GetRequest_message_name, value) { - return - } - } - if x.Index != "" { - value := protoreflect.ValueOfString(x.Index) - if !f(fd_GetRequest_index, value) { - return - } - } - if len(x.Values) != 0 { - value := protoreflect.ValueOfList(&_GetRequest_3_list{list: &x.Values}) - if !f(fd_GetRequest_values, 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_GetRequest) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.orm.query.v1alpha1.GetRequest.message_name": - return x.MessageName != "" - case "cosmos.orm.query.v1alpha1.GetRequest.index": - return x.Index != "" - case "cosmos.orm.query.v1alpha1.GetRequest.values": - return len(x.Values) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.GetRequest")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.GetRequest 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_GetRequest) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.orm.query.v1alpha1.GetRequest.message_name": - x.MessageName = "" - case "cosmos.orm.query.v1alpha1.GetRequest.index": - x.Index = "" - case "cosmos.orm.query.v1alpha1.GetRequest.values": - x.Values = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.GetRequest")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.GetRequest 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_GetRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.orm.query.v1alpha1.GetRequest.message_name": - value := x.MessageName - return protoreflect.ValueOfString(value) - case "cosmos.orm.query.v1alpha1.GetRequest.index": - value := x.Index - return protoreflect.ValueOfString(value) - case "cosmos.orm.query.v1alpha1.GetRequest.values": - if len(x.Values) == 0 { - return protoreflect.ValueOfList(&_GetRequest_3_list{}) - } - listValue := &_GetRequest_3_list{list: &x.Values} - return protoreflect.ValueOfList(listValue) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.GetRequest")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.GetRequest 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_GetRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.orm.query.v1alpha1.GetRequest.message_name": - x.MessageName = value.Interface().(string) - case "cosmos.orm.query.v1alpha1.GetRequest.index": - x.Index = value.Interface().(string) - case "cosmos.orm.query.v1alpha1.GetRequest.values": - lv := value.List() - clv := lv.(*_GetRequest_3_list) - x.Values = *clv.list - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.GetRequest")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.GetRequest 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_GetRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.orm.query.v1alpha1.GetRequest.values": - if x.Values == nil { - x.Values = []*IndexValue{} - } - value := &_GetRequest_3_list{list: &x.Values} - return protoreflect.ValueOfList(value) - case "cosmos.orm.query.v1alpha1.GetRequest.message_name": - panic(fmt.Errorf("field message_name of message cosmos.orm.query.v1alpha1.GetRequest is not mutable")) - case "cosmos.orm.query.v1alpha1.GetRequest.index": - panic(fmt.Errorf("field index of message cosmos.orm.query.v1alpha1.GetRequest is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.GetRequest")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.GetRequest 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_GetRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.orm.query.v1alpha1.GetRequest.message_name": - return protoreflect.ValueOfString("") - case "cosmos.orm.query.v1alpha1.GetRequest.index": - return protoreflect.ValueOfString("") - case "cosmos.orm.query.v1alpha1.GetRequest.values": - list := []*IndexValue{} - return protoreflect.ValueOfList(&_GetRequest_3_list{list: &list}) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.GetRequest")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.GetRequest 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_GetRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.orm.query.v1alpha1.GetRequest", 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_GetRequest) 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_GetRequest) 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_GetRequest) 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_GetRequest) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*GetRequest) - 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.MessageName) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Index) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if len(x.Values) > 0 { - for _, e := range x.Values { - 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().(*GetRequest) - 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.Values) > 0 { - for iNdEx := len(x.Values) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.Values[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.Index) > 0 { - i -= len(x.Index) - copy(dAtA[i:], x.Index) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Index))) - i-- - dAtA[i] = 0x12 - } - if len(x.MessageName) > 0 { - i -= len(x.MessageName) - copy(dAtA[i:], x.MessageName) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MessageName))) - 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().(*GetRequest) - 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: GetRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GetRequest: 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 MessageName", 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.MessageName = 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 Index", 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.Index = 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 Values", 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.Values = append(x.Values, &IndexValue{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Values[len(x.Values)-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_GetResponse protoreflect.MessageDescriptor - fd_GetResponse_result protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_orm_query_v1alpha1_query_proto_init() - md_GetResponse = File_cosmos_orm_query_v1alpha1_query_proto.Messages().ByName("GetResponse") - fd_GetResponse_result = md_GetResponse.Fields().ByName("result") -} - -var _ protoreflect.Message = (*fastReflection_GetResponse)(nil) - -type fastReflection_GetResponse GetResponse - -func (x *GetResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_GetResponse)(x) -} - -func (x *GetResponse) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_orm_query_v1alpha1_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_GetResponse_messageType fastReflection_GetResponse_messageType -var _ protoreflect.MessageType = fastReflection_GetResponse_messageType{} - -type fastReflection_GetResponse_messageType struct{} - -func (x fastReflection_GetResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_GetResponse)(nil) -} -func (x fastReflection_GetResponse_messageType) New() protoreflect.Message { - return new(fastReflection_GetResponse) -} -func (x fastReflection_GetResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_GetResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_GetResponse) Descriptor() protoreflect.MessageDescriptor { - return md_GetResponse -} - -// 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_GetResponse) Type() protoreflect.MessageType { - return _fastReflection_GetResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_GetResponse) New() protoreflect.Message { - return new(fastReflection_GetResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_GetResponse) Interface() protoreflect.ProtoMessage { - return (*GetResponse)(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_GetResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Result != nil { - value := protoreflect.ValueOfMessage(x.Result.ProtoReflect()) - if !f(fd_GetResponse_result, 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_GetResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.orm.query.v1alpha1.GetResponse.result": - return x.Result != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.GetResponse")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.GetResponse 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_GetResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.orm.query.v1alpha1.GetResponse.result": - x.Result = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.GetResponse")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.GetResponse 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_GetResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.orm.query.v1alpha1.GetResponse.result": - value := x.Result - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.GetResponse")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.GetResponse 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_GetResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.orm.query.v1alpha1.GetResponse.result": - x.Result = value.Message().Interface().(*anypb.Any) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.GetResponse")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.GetResponse 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_GetResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.orm.query.v1alpha1.GetResponse.result": - if x.Result == nil { - x.Result = new(anypb.Any) - } - return protoreflect.ValueOfMessage(x.Result.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.GetResponse")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.GetResponse 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_GetResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.orm.query.v1alpha1.GetResponse.result": - m := new(anypb.Any) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.GetResponse")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.GetResponse 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_GetResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.orm.query.v1alpha1.GetResponse", 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_GetResponse) 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_GetResponse) 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_GetResponse) 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_GetResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*GetResponse) - 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.Result != nil { - l = options.Size(x.Result) - 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().(*GetResponse) - 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.Result != nil { - encoded, err := options.Marshal(x.Result) - 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().(*GetResponse) - 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: GetResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GetResponse: 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 Result", 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.Result == nil { - x.Result = &anypb.Any{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Result); 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_ListRequest protoreflect.MessageDescriptor - fd_ListRequest_message_name protoreflect.FieldDescriptor - fd_ListRequest_index protoreflect.FieldDescriptor - fd_ListRequest_prefix protoreflect.FieldDescriptor - fd_ListRequest_range protoreflect.FieldDescriptor - fd_ListRequest_pagination protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_orm_query_v1alpha1_query_proto_init() - md_ListRequest = File_cosmos_orm_query_v1alpha1_query_proto.Messages().ByName("ListRequest") - fd_ListRequest_message_name = md_ListRequest.Fields().ByName("message_name") - fd_ListRequest_index = md_ListRequest.Fields().ByName("index") - fd_ListRequest_prefix = md_ListRequest.Fields().ByName("prefix") - fd_ListRequest_range = md_ListRequest.Fields().ByName("range") - fd_ListRequest_pagination = md_ListRequest.Fields().ByName("pagination") -} - -var _ protoreflect.Message = (*fastReflection_ListRequest)(nil) - -type fastReflection_ListRequest ListRequest - -func (x *ListRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_ListRequest)(x) -} - -func (x *ListRequest) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_orm_query_v1alpha1_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_ListRequest_messageType fastReflection_ListRequest_messageType -var _ protoreflect.MessageType = fastReflection_ListRequest_messageType{} - -type fastReflection_ListRequest_messageType struct{} - -func (x fastReflection_ListRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_ListRequest)(nil) -} -func (x fastReflection_ListRequest_messageType) New() protoreflect.Message { - return new(fastReflection_ListRequest) -} -func (x fastReflection_ListRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_ListRequest -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_ListRequest) Descriptor() protoreflect.MessageDescriptor { - return md_ListRequest -} - -// 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_ListRequest) Type() protoreflect.MessageType { - return _fastReflection_ListRequest_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_ListRequest) New() protoreflect.Message { - return new(fastReflection_ListRequest) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_ListRequest) Interface() protoreflect.ProtoMessage { - return (*ListRequest)(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_ListRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.MessageName != "" { - value := protoreflect.ValueOfString(x.MessageName) - if !f(fd_ListRequest_message_name, value) { - return - } - } - if x.Index != "" { - value := protoreflect.ValueOfString(x.Index) - if !f(fd_ListRequest_index, value) { - return - } - } - if x.Query != nil { - switch o := x.Query.(type) { - case *ListRequest_Prefix_: - v := o.Prefix - value := protoreflect.ValueOfMessage(v.ProtoReflect()) - if !f(fd_ListRequest_prefix, value) { - return - } - case *ListRequest_Range_: - v := o.Range_ - value := protoreflect.ValueOfMessage(v.ProtoReflect()) - if !f(fd_ListRequest_range, value) { - return - } - } - } - if x.Pagination != nil { - value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) - if !f(fd_ListRequest_pagination, 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_ListRequest) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.orm.query.v1alpha1.ListRequest.message_name": - return x.MessageName != "" - case "cosmos.orm.query.v1alpha1.ListRequest.index": - return x.Index != "" - case "cosmos.orm.query.v1alpha1.ListRequest.prefix": - if x.Query == nil { - return false - } else if _, ok := x.Query.(*ListRequest_Prefix_); ok { - return true - } else { - return false - } - case "cosmos.orm.query.v1alpha1.ListRequest.range": - if x.Query == nil { - return false - } else if _, ok := x.Query.(*ListRequest_Range_); ok { - return true - } else { - return false - } - case "cosmos.orm.query.v1alpha1.ListRequest.pagination": - return x.Pagination != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.ListRequest")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.ListRequest 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_ListRequest) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.orm.query.v1alpha1.ListRequest.message_name": - x.MessageName = "" - case "cosmos.orm.query.v1alpha1.ListRequest.index": - x.Index = "" - case "cosmos.orm.query.v1alpha1.ListRequest.prefix": - x.Query = nil - case "cosmos.orm.query.v1alpha1.ListRequest.range": - x.Query = nil - case "cosmos.orm.query.v1alpha1.ListRequest.pagination": - x.Pagination = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.ListRequest")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.ListRequest 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_ListRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.orm.query.v1alpha1.ListRequest.message_name": - value := x.MessageName - return protoreflect.ValueOfString(value) - case "cosmos.orm.query.v1alpha1.ListRequest.index": - value := x.Index - return protoreflect.ValueOfString(value) - case "cosmos.orm.query.v1alpha1.ListRequest.prefix": - if x.Query == nil { - return protoreflect.ValueOfMessage((*ListRequest_Prefix)(nil).ProtoReflect()) - } else if v, ok := x.Query.(*ListRequest_Prefix_); ok { - return protoreflect.ValueOfMessage(v.Prefix.ProtoReflect()) - } else { - return protoreflect.ValueOfMessage((*ListRequest_Prefix)(nil).ProtoReflect()) - } - case "cosmos.orm.query.v1alpha1.ListRequest.range": - if x.Query == nil { - return protoreflect.ValueOfMessage((*ListRequest_Range)(nil).ProtoReflect()) - } else if v, ok := x.Query.(*ListRequest_Range_); ok { - return protoreflect.ValueOfMessage(v.Range_.ProtoReflect()) - } else { - return protoreflect.ValueOfMessage((*ListRequest_Range)(nil).ProtoReflect()) - } - case "cosmos.orm.query.v1alpha1.ListRequest.pagination": - value := x.Pagination - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.ListRequest")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.ListRequest 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_ListRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.orm.query.v1alpha1.ListRequest.message_name": - x.MessageName = value.Interface().(string) - case "cosmos.orm.query.v1alpha1.ListRequest.index": - x.Index = value.Interface().(string) - case "cosmos.orm.query.v1alpha1.ListRequest.prefix": - cv := value.Message().Interface().(*ListRequest_Prefix) - x.Query = &ListRequest_Prefix_{Prefix: cv} - case "cosmos.orm.query.v1alpha1.ListRequest.range": - cv := value.Message().Interface().(*ListRequest_Range) - x.Query = &ListRequest_Range_{Range_: cv} - case "cosmos.orm.query.v1alpha1.ListRequest.pagination": - x.Pagination = value.Message().Interface().(*v1beta1.PageRequest) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.ListRequest")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.ListRequest 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_ListRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.orm.query.v1alpha1.ListRequest.prefix": - if x.Query == nil { - value := &ListRequest_Prefix{} - oneofValue := &ListRequest_Prefix_{Prefix: value} - x.Query = oneofValue - return protoreflect.ValueOfMessage(value.ProtoReflect()) - } - switch m := x.Query.(type) { - case *ListRequest_Prefix_: - return protoreflect.ValueOfMessage(m.Prefix.ProtoReflect()) - default: - value := &ListRequest_Prefix{} - oneofValue := &ListRequest_Prefix_{Prefix: value} - x.Query = oneofValue - return protoreflect.ValueOfMessage(value.ProtoReflect()) - } - case "cosmos.orm.query.v1alpha1.ListRequest.range": - if x.Query == nil { - value := &ListRequest_Range{} - oneofValue := &ListRequest_Range_{Range_: value} - x.Query = oneofValue - return protoreflect.ValueOfMessage(value.ProtoReflect()) - } - switch m := x.Query.(type) { - case *ListRequest_Range_: - return protoreflect.ValueOfMessage(m.Range_.ProtoReflect()) - default: - value := &ListRequest_Range{} - oneofValue := &ListRequest_Range_{Range_: value} - x.Query = oneofValue - return protoreflect.ValueOfMessage(value.ProtoReflect()) - } - case "cosmos.orm.query.v1alpha1.ListRequest.pagination": - if x.Pagination == nil { - x.Pagination = new(v1beta1.PageRequest) - } - return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) - case "cosmos.orm.query.v1alpha1.ListRequest.message_name": - panic(fmt.Errorf("field message_name of message cosmos.orm.query.v1alpha1.ListRequest is not mutable")) - case "cosmos.orm.query.v1alpha1.ListRequest.index": - panic(fmt.Errorf("field index of message cosmos.orm.query.v1alpha1.ListRequest is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.ListRequest")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.ListRequest 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_ListRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.orm.query.v1alpha1.ListRequest.message_name": - return protoreflect.ValueOfString("") - case "cosmos.orm.query.v1alpha1.ListRequest.index": - return protoreflect.ValueOfString("") - case "cosmos.orm.query.v1alpha1.ListRequest.prefix": - value := &ListRequest_Prefix{} - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cosmos.orm.query.v1alpha1.ListRequest.range": - value := &ListRequest_Range{} - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cosmos.orm.query.v1alpha1.ListRequest.pagination": - m := new(v1beta1.PageRequest) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.ListRequest")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.ListRequest 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_ListRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - case "cosmos.orm.query.v1alpha1.ListRequest.query": - if x.Query == nil { - return nil - } - switch x.Query.(type) { - case *ListRequest_Prefix_: - return x.Descriptor().Fields().ByName("prefix") - case *ListRequest_Range_: - return x.Descriptor().Fields().ByName("range") - } - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.orm.query.v1alpha1.ListRequest", 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_ListRequest) 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_ListRequest) 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_ListRequest) 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_ListRequest) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*ListRequest) - 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.MessageName) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Index) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - switch x := x.Query.(type) { - case *ListRequest_Prefix_: - if x == nil { - break - } - l = options.Size(x.Prefix) - n += 1 + l + runtime.Sov(uint64(l)) - case *ListRequest_Range_: - if x == nil { - break - } - l = options.Size(x.Range_) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Pagination != nil { - l = options.Size(x.Pagination) - 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().(*ListRequest) - 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) - } - switch x := x.Query.(type) { - case *ListRequest_Prefix_: - encoded, err := options.Marshal(x.Prefix) - 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 - case *ListRequest_Range_: - encoded, err := options.Marshal(x.Range_) - 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.Pagination != nil { - encoded, err := options.Marshal(x.Pagination) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x2a - } - if len(x.Index) > 0 { - i -= len(x.Index) - copy(dAtA[i:], x.Index) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Index))) - i-- - dAtA[i] = 0x12 - } - if len(x.MessageName) > 0 { - i -= len(x.MessageName) - copy(dAtA[i:], x.MessageName) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MessageName))) - 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().(*ListRequest) - 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: ListRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ListRequest: 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 MessageName", 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.MessageName = 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 Index", 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.Index = 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 Prefix", 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 - } - v := &ListRequest_Prefix{} - if err := options.Unmarshal(dAtA[iNdEx:postIndex], v); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - x.Query = &ListRequest_Prefix_{v} - iNdEx = postIndex - case 4: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Range_", 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 - } - v := &ListRequest_Range{} - if err := options.Unmarshal(dAtA[iNdEx:postIndex], v); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - x.Query = &ListRequest_Range_{v} - iNdEx = postIndex - case 5: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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.Pagination == nil { - x.Pagination = &v1beta1.PageRequest{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var _ protoreflect.List = (*_ListRequest_Prefix_1_list)(nil) - -type _ListRequest_Prefix_1_list struct { - list *[]*IndexValue -} - -func (x *_ListRequest_Prefix_1_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_ListRequest_Prefix_1_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_ListRequest_Prefix_1_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*IndexValue) - (*x.list)[i] = concreteValue -} - -func (x *_ListRequest_Prefix_1_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*IndexValue) - *x.list = append(*x.list, concreteValue) -} - -func (x *_ListRequest_Prefix_1_list) AppendMutable() protoreflect.Value { - v := new(IndexValue) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_ListRequest_Prefix_1_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_ListRequest_Prefix_1_list) NewElement() protoreflect.Value { - v := new(IndexValue) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_ListRequest_Prefix_1_list) IsValid() bool { - return x.list != nil -} - -var ( - md_ListRequest_Prefix protoreflect.MessageDescriptor - fd_ListRequest_Prefix_values protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_orm_query_v1alpha1_query_proto_init() - md_ListRequest_Prefix = File_cosmos_orm_query_v1alpha1_query_proto.Messages().ByName("ListRequest").Messages().ByName("Prefix") - fd_ListRequest_Prefix_values = md_ListRequest_Prefix.Fields().ByName("values") -} - -var _ protoreflect.Message = (*fastReflection_ListRequest_Prefix)(nil) - -type fastReflection_ListRequest_Prefix ListRequest_Prefix - -func (x *ListRequest_Prefix) ProtoReflect() protoreflect.Message { - return (*fastReflection_ListRequest_Prefix)(x) -} - -func (x *ListRequest_Prefix) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_orm_query_v1alpha1_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_ListRequest_Prefix_messageType fastReflection_ListRequest_Prefix_messageType -var _ protoreflect.MessageType = fastReflection_ListRequest_Prefix_messageType{} - -type fastReflection_ListRequest_Prefix_messageType struct{} - -func (x fastReflection_ListRequest_Prefix_messageType) Zero() protoreflect.Message { - return (*fastReflection_ListRequest_Prefix)(nil) -} -func (x fastReflection_ListRequest_Prefix_messageType) New() protoreflect.Message { - return new(fastReflection_ListRequest_Prefix) -} -func (x fastReflection_ListRequest_Prefix_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_ListRequest_Prefix -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_ListRequest_Prefix) Descriptor() protoreflect.MessageDescriptor { - return md_ListRequest_Prefix -} - -// 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_ListRequest_Prefix) Type() protoreflect.MessageType { - return _fastReflection_ListRequest_Prefix_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_ListRequest_Prefix) New() protoreflect.Message { - return new(fastReflection_ListRequest_Prefix) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_ListRequest_Prefix) Interface() protoreflect.ProtoMessage { - return (*ListRequest_Prefix)(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_ListRequest_Prefix) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.Values) != 0 { - value := protoreflect.ValueOfList(&_ListRequest_Prefix_1_list{list: &x.Values}) - if !f(fd_ListRequest_Prefix_values, 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_ListRequest_Prefix) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.orm.query.v1alpha1.ListRequest.Prefix.values": - return len(x.Values) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.ListRequest.Prefix")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.ListRequest.Prefix 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_ListRequest_Prefix) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.orm.query.v1alpha1.ListRequest.Prefix.values": - x.Values = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.ListRequest.Prefix")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.ListRequest.Prefix 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_ListRequest_Prefix) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.orm.query.v1alpha1.ListRequest.Prefix.values": - if len(x.Values) == 0 { - return protoreflect.ValueOfList(&_ListRequest_Prefix_1_list{}) - } - listValue := &_ListRequest_Prefix_1_list{list: &x.Values} - return protoreflect.ValueOfList(listValue) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.ListRequest.Prefix")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.ListRequest.Prefix 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_ListRequest_Prefix) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.orm.query.v1alpha1.ListRequest.Prefix.values": - lv := value.List() - clv := lv.(*_ListRequest_Prefix_1_list) - x.Values = *clv.list - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.ListRequest.Prefix")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.ListRequest.Prefix 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_ListRequest_Prefix) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.orm.query.v1alpha1.ListRequest.Prefix.values": - if x.Values == nil { - x.Values = []*IndexValue{} - } - value := &_ListRequest_Prefix_1_list{list: &x.Values} - return protoreflect.ValueOfList(value) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.ListRequest.Prefix")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.ListRequest.Prefix 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_ListRequest_Prefix) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.orm.query.v1alpha1.ListRequest.Prefix.values": - list := []*IndexValue{} - return protoreflect.ValueOfList(&_ListRequest_Prefix_1_list{list: &list}) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.ListRequest.Prefix")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.ListRequest.Prefix 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_ListRequest_Prefix) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.orm.query.v1alpha1.ListRequest.Prefix", 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_ListRequest_Prefix) 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_ListRequest_Prefix) 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_ListRequest_Prefix) 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_ListRequest_Prefix) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*ListRequest_Prefix) - 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.Values) > 0 { - for _, e := range x.Values { - 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().(*ListRequest_Prefix) - 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.Values) > 0 { - for iNdEx := len(x.Values) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.Values[iNdEx]) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0xa - } - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*ListRequest_Prefix) - 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: ListRequest_Prefix: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ListRequest_Prefix: 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 Values", 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.Values = append(x.Values, &IndexValue{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Values[len(x.Values)-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.List = (*_ListRequest_Range_1_list)(nil) - -type _ListRequest_Range_1_list struct { - list *[]*IndexValue -} - -func (x *_ListRequest_Range_1_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_ListRequest_Range_1_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_ListRequest_Range_1_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*IndexValue) - (*x.list)[i] = concreteValue -} - -func (x *_ListRequest_Range_1_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*IndexValue) - *x.list = append(*x.list, concreteValue) -} - -func (x *_ListRequest_Range_1_list) AppendMutable() protoreflect.Value { - v := new(IndexValue) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_ListRequest_Range_1_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_ListRequest_Range_1_list) NewElement() protoreflect.Value { - v := new(IndexValue) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_ListRequest_Range_1_list) IsValid() bool { - return x.list != nil -} - -var _ protoreflect.List = (*_ListRequest_Range_2_list)(nil) - -type _ListRequest_Range_2_list struct { - list *[]*IndexValue -} - -func (x *_ListRequest_Range_2_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_ListRequest_Range_2_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_ListRequest_Range_2_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*IndexValue) - (*x.list)[i] = concreteValue -} - -func (x *_ListRequest_Range_2_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*IndexValue) - *x.list = append(*x.list, concreteValue) -} - -func (x *_ListRequest_Range_2_list) AppendMutable() protoreflect.Value { - v := new(IndexValue) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_ListRequest_Range_2_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_ListRequest_Range_2_list) NewElement() protoreflect.Value { - v := new(IndexValue) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_ListRequest_Range_2_list) IsValid() bool { - return x.list != nil -} - -var ( - md_ListRequest_Range protoreflect.MessageDescriptor - fd_ListRequest_Range_start protoreflect.FieldDescriptor - fd_ListRequest_Range_end protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_orm_query_v1alpha1_query_proto_init() - md_ListRequest_Range = File_cosmos_orm_query_v1alpha1_query_proto.Messages().ByName("ListRequest").Messages().ByName("Range") - fd_ListRequest_Range_start = md_ListRequest_Range.Fields().ByName("start") - fd_ListRequest_Range_end = md_ListRequest_Range.Fields().ByName("end") -} - -var _ protoreflect.Message = (*fastReflection_ListRequest_Range)(nil) - -type fastReflection_ListRequest_Range ListRequest_Range - -func (x *ListRequest_Range) ProtoReflect() protoreflect.Message { - return (*fastReflection_ListRequest_Range)(x) -} - -func (x *ListRequest_Range) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_orm_query_v1alpha1_query_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_ListRequest_Range_messageType fastReflection_ListRequest_Range_messageType -var _ protoreflect.MessageType = fastReflection_ListRequest_Range_messageType{} - -type fastReflection_ListRequest_Range_messageType struct{} - -func (x fastReflection_ListRequest_Range_messageType) Zero() protoreflect.Message { - return (*fastReflection_ListRequest_Range)(nil) -} -func (x fastReflection_ListRequest_Range_messageType) New() protoreflect.Message { - return new(fastReflection_ListRequest_Range) -} -func (x fastReflection_ListRequest_Range_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_ListRequest_Range -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_ListRequest_Range) Descriptor() protoreflect.MessageDescriptor { - return md_ListRequest_Range -} - -// 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_ListRequest_Range) Type() protoreflect.MessageType { - return _fastReflection_ListRequest_Range_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_ListRequest_Range) New() protoreflect.Message { - return new(fastReflection_ListRequest_Range) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_ListRequest_Range) Interface() protoreflect.ProtoMessage { - return (*ListRequest_Range)(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_ListRequest_Range) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.Start) != 0 { - value := protoreflect.ValueOfList(&_ListRequest_Range_1_list{list: &x.Start}) - if !f(fd_ListRequest_Range_start, value) { - return - } - } - if len(x.End) != 0 { - value := protoreflect.ValueOfList(&_ListRequest_Range_2_list{list: &x.End}) - if !f(fd_ListRequest_Range_end, 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_ListRequest_Range) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.orm.query.v1alpha1.ListRequest.Range.start": - return len(x.Start) != 0 - case "cosmos.orm.query.v1alpha1.ListRequest.Range.end": - return len(x.End) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.ListRequest.Range")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.ListRequest.Range 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_ListRequest_Range) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.orm.query.v1alpha1.ListRequest.Range.start": - x.Start = nil - case "cosmos.orm.query.v1alpha1.ListRequest.Range.end": - x.End = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.ListRequest.Range")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.ListRequest.Range 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_ListRequest_Range) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.orm.query.v1alpha1.ListRequest.Range.start": - if len(x.Start) == 0 { - return protoreflect.ValueOfList(&_ListRequest_Range_1_list{}) - } - listValue := &_ListRequest_Range_1_list{list: &x.Start} - return protoreflect.ValueOfList(listValue) - case "cosmos.orm.query.v1alpha1.ListRequest.Range.end": - if len(x.End) == 0 { - return protoreflect.ValueOfList(&_ListRequest_Range_2_list{}) - } - listValue := &_ListRequest_Range_2_list{list: &x.End} - return protoreflect.ValueOfList(listValue) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.ListRequest.Range")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.ListRequest.Range 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_ListRequest_Range) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.orm.query.v1alpha1.ListRequest.Range.start": - lv := value.List() - clv := lv.(*_ListRequest_Range_1_list) - x.Start = *clv.list - case "cosmos.orm.query.v1alpha1.ListRequest.Range.end": - lv := value.List() - clv := lv.(*_ListRequest_Range_2_list) - x.End = *clv.list - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.ListRequest.Range")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.ListRequest.Range 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_ListRequest_Range) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.orm.query.v1alpha1.ListRequest.Range.start": - if x.Start == nil { - x.Start = []*IndexValue{} - } - value := &_ListRequest_Range_1_list{list: &x.Start} - return protoreflect.ValueOfList(value) - case "cosmos.orm.query.v1alpha1.ListRequest.Range.end": - if x.End == nil { - x.End = []*IndexValue{} - } - value := &_ListRequest_Range_2_list{list: &x.End} - return protoreflect.ValueOfList(value) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.ListRequest.Range")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.ListRequest.Range 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_ListRequest_Range) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.orm.query.v1alpha1.ListRequest.Range.start": - list := []*IndexValue{} - return protoreflect.ValueOfList(&_ListRequest_Range_1_list{list: &list}) - case "cosmos.orm.query.v1alpha1.ListRequest.Range.end": - list := []*IndexValue{} - return protoreflect.ValueOfList(&_ListRequest_Range_2_list{list: &list}) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.ListRequest.Range")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.ListRequest.Range 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_ListRequest_Range) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.orm.query.v1alpha1.ListRequest.Range", 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_ListRequest_Range) 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_ListRequest_Range) 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_ListRequest_Range) 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_ListRequest_Range) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*ListRequest_Range) - 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.Start) > 0 { - for _, e := range x.Start { - l = options.Size(e) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - if len(x.End) > 0 { - for _, e := range x.End { - 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().(*ListRequest_Range) - 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.End) > 0 { - for iNdEx := len(x.End) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.End[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.Start) > 0 { - for iNdEx := len(x.Start) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.Start[iNdEx]) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0xa - } - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*ListRequest_Range) - 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: ListRequest_Range: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ListRequest_Range: 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 Start", 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.Start = append(x.Start, &IndexValue{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Start[len(x.Start)-1]); err != nil { - 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 End", 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.End = append(x.End, &IndexValue{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.End[len(x.End)-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.List = (*_ListResponse_1_list)(nil) - -type _ListResponse_1_list struct { - list *[]*anypb.Any -} - -func (x *_ListResponse_1_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_ListResponse_1_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_ListResponse_1_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*anypb.Any) - (*x.list)[i] = concreteValue -} - -func (x *_ListResponse_1_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*anypb.Any) - *x.list = append(*x.list, concreteValue) -} - -func (x *_ListResponse_1_list) AppendMutable() protoreflect.Value { - v := new(anypb.Any) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_ListResponse_1_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_ListResponse_1_list) NewElement() protoreflect.Value { - v := new(anypb.Any) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_ListResponse_1_list) IsValid() bool { - return x.list != nil -} - -var ( - md_ListResponse protoreflect.MessageDescriptor - fd_ListResponse_results protoreflect.FieldDescriptor - fd_ListResponse_pagination protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_orm_query_v1alpha1_query_proto_init() - md_ListResponse = File_cosmos_orm_query_v1alpha1_query_proto.Messages().ByName("ListResponse") - fd_ListResponse_results = md_ListResponse.Fields().ByName("results") - fd_ListResponse_pagination = md_ListResponse.Fields().ByName("pagination") -} - -var _ protoreflect.Message = (*fastReflection_ListResponse)(nil) - -type fastReflection_ListResponse ListResponse - -func (x *ListResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_ListResponse)(x) -} - -func (x *ListResponse) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_orm_query_v1alpha1_query_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_ListResponse_messageType fastReflection_ListResponse_messageType -var _ protoreflect.MessageType = fastReflection_ListResponse_messageType{} - -type fastReflection_ListResponse_messageType struct{} - -func (x fastReflection_ListResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_ListResponse)(nil) -} -func (x fastReflection_ListResponse_messageType) New() protoreflect.Message { - return new(fastReflection_ListResponse) -} -func (x fastReflection_ListResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_ListResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_ListResponse) Descriptor() protoreflect.MessageDescriptor { - return md_ListResponse -} - -// 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_ListResponse) Type() protoreflect.MessageType { - return _fastReflection_ListResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_ListResponse) New() protoreflect.Message { - return new(fastReflection_ListResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_ListResponse) Interface() protoreflect.ProtoMessage { - return (*ListResponse)(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_ListResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.Results) != 0 { - value := protoreflect.ValueOfList(&_ListResponse_1_list{list: &x.Results}) - if !f(fd_ListResponse_results, value) { - return - } - } - if x.Pagination != nil { - value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) - if !f(fd_ListResponse_pagination, 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_ListResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.orm.query.v1alpha1.ListResponse.results": - return len(x.Results) != 0 - case "cosmos.orm.query.v1alpha1.ListResponse.pagination": - return x.Pagination != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.ListResponse")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.ListResponse 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_ListResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.orm.query.v1alpha1.ListResponse.results": - x.Results = nil - case "cosmos.orm.query.v1alpha1.ListResponse.pagination": - x.Pagination = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.ListResponse")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.ListResponse 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_ListResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.orm.query.v1alpha1.ListResponse.results": - if len(x.Results) == 0 { - return protoreflect.ValueOfList(&_ListResponse_1_list{}) - } - listValue := &_ListResponse_1_list{list: &x.Results} - return protoreflect.ValueOfList(listValue) - case "cosmos.orm.query.v1alpha1.ListResponse.pagination": - value := x.Pagination - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.ListResponse")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.ListResponse 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_ListResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.orm.query.v1alpha1.ListResponse.results": - lv := value.List() - clv := lv.(*_ListResponse_1_list) - x.Results = *clv.list - case "cosmos.orm.query.v1alpha1.ListResponse.pagination": - x.Pagination = value.Message().Interface().(*v1beta1.PageResponse) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.ListResponse")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.ListResponse 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_ListResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.orm.query.v1alpha1.ListResponse.results": - if x.Results == nil { - x.Results = []*anypb.Any{} - } - value := &_ListResponse_1_list{list: &x.Results} - return protoreflect.ValueOfList(value) - case "cosmos.orm.query.v1alpha1.ListResponse.pagination": - if x.Pagination == nil { - x.Pagination = new(v1beta1.PageResponse) - } - return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.ListResponse")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.ListResponse 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_ListResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.orm.query.v1alpha1.ListResponse.results": - list := []*anypb.Any{} - return protoreflect.ValueOfList(&_ListResponse_1_list{list: &list}) - case "cosmos.orm.query.v1alpha1.ListResponse.pagination": - m := new(v1beta1.PageResponse) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.ListResponse")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.ListResponse 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_ListResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.orm.query.v1alpha1.ListResponse", 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_ListResponse) 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_ListResponse) 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_ListResponse) 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_ListResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*ListResponse) - 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.Results) > 0 { - for _, e := range x.Results { - l = options.Size(e) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - if x.Pagination != nil { - l = options.Size(x.Pagination) - 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().(*ListResponse) - 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.Pagination != nil { - encoded, err := options.Marshal(x.Pagination) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x2a - } - if len(x.Results) > 0 { - for iNdEx := len(x.Results) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.Results[iNdEx]) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0xa - } - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*ListResponse) - 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: ListResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ListResponse: 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 Results", 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.Results = append(x.Results, &anypb.Any{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Results[len(x.Results)-1]); 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 Pagination", 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.Pagination == nil { - x.Pagination = &v1beta1.PageResponse{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); 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_IndexValue protoreflect.MessageDescriptor - fd_IndexValue_uint protoreflect.FieldDescriptor - fd_IndexValue_int protoreflect.FieldDescriptor - fd_IndexValue_str protoreflect.FieldDescriptor - fd_IndexValue_bytes protoreflect.FieldDescriptor - fd_IndexValue_enum protoreflect.FieldDescriptor - fd_IndexValue_bool protoreflect.FieldDescriptor - fd_IndexValue_timestamp protoreflect.FieldDescriptor - fd_IndexValue_duration protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_orm_query_v1alpha1_query_proto_init() - md_IndexValue = File_cosmos_orm_query_v1alpha1_query_proto.Messages().ByName("IndexValue") - fd_IndexValue_uint = md_IndexValue.Fields().ByName("uint") - fd_IndexValue_int = md_IndexValue.Fields().ByName("int") - fd_IndexValue_str = md_IndexValue.Fields().ByName("str") - fd_IndexValue_bytes = md_IndexValue.Fields().ByName("bytes") - fd_IndexValue_enum = md_IndexValue.Fields().ByName("enum") - fd_IndexValue_bool = md_IndexValue.Fields().ByName("bool") - fd_IndexValue_timestamp = md_IndexValue.Fields().ByName("timestamp") - fd_IndexValue_duration = md_IndexValue.Fields().ByName("duration") -} - -var _ protoreflect.Message = (*fastReflection_IndexValue)(nil) - -type fastReflection_IndexValue IndexValue - -func (x *IndexValue) ProtoReflect() protoreflect.Message { - return (*fastReflection_IndexValue)(x) -} - -func (x *IndexValue) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_orm_query_v1alpha1_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_IndexValue_messageType fastReflection_IndexValue_messageType -var _ protoreflect.MessageType = fastReflection_IndexValue_messageType{} - -type fastReflection_IndexValue_messageType struct{} - -func (x fastReflection_IndexValue_messageType) Zero() protoreflect.Message { - return (*fastReflection_IndexValue)(nil) -} -func (x fastReflection_IndexValue_messageType) New() protoreflect.Message { - return new(fastReflection_IndexValue) -} -func (x fastReflection_IndexValue_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_IndexValue -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_IndexValue) Descriptor() protoreflect.MessageDescriptor { - return md_IndexValue -} - -// 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_IndexValue) Type() protoreflect.MessageType { - return _fastReflection_IndexValue_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_IndexValue) New() protoreflect.Message { - return new(fastReflection_IndexValue) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_IndexValue) Interface() protoreflect.ProtoMessage { - return (*IndexValue)(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_IndexValue) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Value != nil { - switch o := x.Value.(type) { - case *IndexValue_Uint: - v := o.Uint - value := protoreflect.ValueOfUint64(v) - if !f(fd_IndexValue_uint, value) { - return - } - case *IndexValue_Int: - v := o.Int - value := protoreflect.ValueOfInt64(v) - if !f(fd_IndexValue_int, value) { - return - } - case *IndexValue_Str: - v := o.Str - value := protoreflect.ValueOfString(v) - if !f(fd_IndexValue_str, value) { - return - } - case *IndexValue_Bytes: - v := o.Bytes - value := protoreflect.ValueOfBytes(v) - if !f(fd_IndexValue_bytes, value) { - return - } - case *IndexValue_Enum: - v := o.Enum - value := protoreflect.ValueOfString(v) - if !f(fd_IndexValue_enum, value) { - return - } - case *IndexValue_Bool: - v := o.Bool - value := protoreflect.ValueOfBool(v) - if !f(fd_IndexValue_bool, value) { - return - } - case *IndexValue_Timestamp: - v := o.Timestamp - value := protoreflect.ValueOfMessage(v.ProtoReflect()) - if !f(fd_IndexValue_timestamp, value) { - return - } - case *IndexValue_Duration: - v := o.Duration - value := protoreflect.ValueOfMessage(v.ProtoReflect()) - if !f(fd_IndexValue_duration, 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_IndexValue) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.orm.query.v1alpha1.IndexValue.uint": - if x.Value == nil { - return false - } else if _, ok := x.Value.(*IndexValue_Uint); ok { - return true - } else { - return false - } - case "cosmos.orm.query.v1alpha1.IndexValue.int": - if x.Value == nil { - return false - } else if _, ok := x.Value.(*IndexValue_Int); ok { - return true - } else { - return false - } - case "cosmos.orm.query.v1alpha1.IndexValue.str": - if x.Value == nil { - return false - } else if _, ok := x.Value.(*IndexValue_Str); ok { - return true - } else { - return false - } - case "cosmos.orm.query.v1alpha1.IndexValue.bytes": - if x.Value == nil { - return false - } else if _, ok := x.Value.(*IndexValue_Bytes); ok { - return true - } else { - return false - } - case "cosmos.orm.query.v1alpha1.IndexValue.enum": - if x.Value == nil { - return false - } else if _, ok := x.Value.(*IndexValue_Enum); ok { - return true - } else { - return false - } - case "cosmos.orm.query.v1alpha1.IndexValue.bool": - if x.Value == nil { - return false - } else if _, ok := x.Value.(*IndexValue_Bool); ok { - return true - } else { - return false - } - case "cosmos.orm.query.v1alpha1.IndexValue.timestamp": - if x.Value == nil { - return false - } else if _, ok := x.Value.(*IndexValue_Timestamp); ok { - return true - } else { - return false - } - case "cosmos.orm.query.v1alpha1.IndexValue.duration": - if x.Value == nil { - return false - } else if _, ok := x.Value.(*IndexValue_Duration); ok { - return true - } else { - return false - } - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.IndexValue")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.IndexValue 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_IndexValue) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.orm.query.v1alpha1.IndexValue.uint": - x.Value = nil - case "cosmos.orm.query.v1alpha1.IndexValue.int": - x.Value = nil - case "cosmos.orm.query.v1alpha1.IndexValue.str": - x.Value = nil - case "cosmos.orm.query.v1alpha1.IndexValue.bytes": - x.Value = nil - case "cosmos.orm.query.v1alpha1.IndexValue.enum": - x.Value = nil - case "cosmos.orm.query.v1alpha1.IndexValue.bool": - x.Value = nil - case "cosmos.orm.query.v1alpha1.IndexValue.timestamp": - x.Value = nil - case "cosmos.orm.query.v1alpha1.IndexValue.duration": - x.Value = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.IndexValue")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.IndexValue 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_IndexValue) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.orm.query.v1alpha1.IndexValue.uint": - if x.Value == nil { - return protoreflect.ValueOfUint64(uint64(0)) - } else if v, ok := x.Value.(*IndexValue_Uint); ok { - return protoreflect.ValueOfUint64(v.Uint) - } else { - return protoreflect.ValueOfUint64(uint64(0)) - } - case "cosmos.orm.query.v1alpha1.IndexValue.int": - if x.Value == nil { - return protoreflect.ValueOfInt64(int64(0)) - } else if v, ok := x.Value.(*IndexValue_Int); ok { - return protoreflect.ValueOfInt64(v.Int) - } else { - return protoreflect.ValueOfInt64(int64(0)) - } - case "cosmos.orm.query.v1alpha1.IndexValue.str": - if x.Value == nil { - return protoreflect.ValueOfString("") - } else if v, ok := x.Value.(*IndexValue_Str); ok { - return protoreflect.ValueOfString(v.Str) - } else { - return protoreflect.ValueOfString("") - } - case "cosmos.orm.query.v1alpha1.IndexValue.bytes": - if x.Value == nil { - return protoreflect.ValueOfBytes(nil) - } else if v, ok := x.Value.(*IndexValue_Bytes); ok { - return protoreflect.ValueOfBytes(v.Bytes) - } else { - return protoreflect.ValueOfBytes(nil) - } - case "cosmos.orm.query.v1alpha1.IndexValue.enum": - if x.Value == nil { - return protoreflect.ValueOfString("") - } else if v, ok := x.Value.(*IndexValue_Enum); ok { - return protoreflect.ValueOfString(v.Enum) - } else { - return protoreflect.ValueOfString("") - } - case "cosmos.orm.query.v1alpha1.IndexValue.bool": - if x.Value == nil { - return protoreflect.ValueOfBool(false) - } else if v, ok := x.Value.(*IndexValue_Bool); ok { - return protoreflect.ValueOfBool(v.Bool) - } else { - return protoreflect.ValueOfBool(false) - } - case "cosmos.orm.query.v1alpha1.IndexValue.timestamp": - if x.Value == nil { - return protoreflect.ValueOfMessage((*timestamppb.Timestamp)(nil).ProtoReflect()) - } else if v, ok := x.Value.(*IndexValue_Timestamp); ok { - return protoreflect.ValueOfMessage(v.Timestamp.ProtoReflect()) - } else { - return protoreflect.ValueOfMessage((*timestamppb.Timestamp)(nil).ProtoReflect()) - } - case "cosmos.orm.query.v1alpha1.IndexValue.duration": - if x.Value == nil { - return protoreflect.ValueOfMessage((*durationpb.Duration)(nil).ProtoReflect()) - } else if v, ok := x.Value.(*IndexValue_Duration); ok { - return protoreflect.ValueOfMessage(v.Duration.ProtoReflect()) - } else { - return protoreflect.ValueOfMessage((*durationpb.Duration)(nil).ProtoReflect()) - } - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.IndexValue")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.IndexValue 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_IndexValue) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.orm.query.v1alpha1.IndexValue.uint": - cv := value.Uint() - x.Value = &IndexValue_Uint{Uint: cv} - case "cosmos.orm.query.v1alpha1.IndexValue.int": - cv := value.Int() - x.Value = &IndexValue_Int{Int: cv} - case "cosmos.orm.query.v1alpha1.IndexValue.str": - cv := value.Interface().(string) - x.Value = &IndexValue_Str{Str: cv} - case "cosmos.orm.query.v1alpha1.IndexValue.bytes": - cv := value.Bytes() - x.Value = &IndexValue_Bytes{Bytes: cv} - case "cosmos.orm.query.v1alpha1.IndexValue.enum": - cv := value.Interface().(string) - x.Value = &IndexValue_Enum{Enum: cv} - case "cosmos.orm.query.v1alpha1.IndexValue.bool": - cv := value.Bool() - x.Value = &IndexValue_Bool{Bool: cv} - case "cosmos.orm.query.v1alpha1.IndexValue.timestamp": - cv := value.Message().Interface().(*timestamppb.Timestamp) - x.Value = &IndexValue_Timestamp{Timestamp: cv} - case "cosmos.orm.query.v1alpha1.IndexValue.duration": - cv := value.Message().Interface().(*durationpb.Duration) - x.Value = &IndexValue_Duration{Duration: cv} - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.IndexValue")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.IndexValue 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_IndexValue) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.orm.query.v1alpha1.IndexValue.timestamp": - if x.Value == nil { - value := ×tamppb.Timestamp{} - oneofValue := &IndexValue_Timestamp{Timestamp: value} - x.Value = oneofValue - return protoreflect.ValueOfMessage(value.ProtoReflect()) - } - switch m := x.Value.(type) { - case *IndexValue_Timestamp: - return protoreflect.ValueOfMessage(m.Timestamp.ProtoReflect()) - default: - value := ×tamppb.Timestamp{} - oneofValue := &IndexValue_Timestamp{Timestamp: value} - x.Value = oneofValue - return protoreflect.ValueOfMessage(value.ProtoReflect()) - } - case "cosmos.orm.query.v1alpha1.IndexValue.duration": - if x.Value == nil { - value := &durationpb.Duration{} - oneofValue := &IndexValue_Duration{Duration: value} - x.Value = oneofValue - return protoreflect.ValueOfMessage(value.ProtoReflect()) - } - switch m := x.Value.(type) { - case *IndexValue_Duration: - return protoreflect.ValueOfMessage(m.Duration.ProtoReflect()) - default: - value := &durationpb.Duration{} - oneofValue := &IndexValue_Duration{Duration: value} - x.Value = oneofValue - return protoreflect.ValueOfMessage(value.ProtoReflect()) - } - case "cosmos.orm.query.v1alpha1.IndexValue.uint": - panic(fmt.Errorf("field uint of message cosmos.orm.query.v1alpha1.IndexValue is not mutable")) - case "cosmos.orm.query.v1alpha1.IndexValue.int": - panic(fmt.Errorf("field int of message cosmos.orm.query.v1alpha1.IndexValue is not mutable")) - case "cosmos.orm.query.v1alpha1.IndexValue.str": - panic(fmt.Errorf("field str of message cosmos.orm.query.v1alpha1.IndexValue is not mutable")) - case "cosmos.orm.query.v1alpha1.IndexValue.bytes": - panic(fmt.Errorf("field bytes of message cosmos.orm.query.v1alpha1.IndexValue is not mutable")) - case "cosmos.orm.query.v1alpha1.IndexValue.enum": - panic(fmt.Errorf("field enum of message cosmos.orm.query.v1alpha1.IndexValue is not mutable")) - case "cosmos.orm.query.v1alpha1.IndexValue.bool": - panic(fmt.Errorf("field bool of message cosmos.orm.query.v1alpha1.IndexValue is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.IndexValue")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.IndexValue 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_IndexValue) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.orm.query.v1alpha1.IndexValue.uint": - return protoreflect.ValueOfUint64(uint64(0)) - case "cosmos.orm.query.v1alpha1.IndexValue.int": - return protoreflect.ValueOfInt64(int64(0)) - case "cosmos.orm.query.v1alpha1.IndexValue.str": - return protoreflect.ValueOfString("") - case "cosmos.orm.query.v1alpha1.IndexValue.bytes": - return protoreflect.ValueOfBytes(nil) - case "cosmos.orm.query.v1alpha1.IndexValue.enum": - return protoreflect.ValueOfString("") - case "cosmos.orm.query.v1alpha1.IndexValue.bool": - return protoreflect.ValueOfBool(false) - case "cosmos.orm.query.v1alpha1.IndexValue.timestamp": - value := ×tamppb.Timestamp{} - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cosmos.orm.query.v1alpha1.IndexValue.duration": - value := &durationpb.Duration{} - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.query.v1alpha1.IndexValue")) - } - panic(fmt.Errorf("message cosmos.orm.query.v1alpha1.IndexValue 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_IndexValue) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - case "cosmos.orm.query.v1alpha1.IndexValue.value": - if x.Value == nil { - return nil - } - switch x.Value.(type) { - case *IndexValue_Uint: - return x.Descriptor().Fields().ByName("uint") - case *IndexValue_Int: - return x.Descriptor().Fields().ByName("int") - case *IndexValue_Str: - return x.Descriptor().Fields().ByName("str") - case *IndexValue_Bytes: - return x.Descriptor().Fields().ByName("bytes") - case *IndexValue_Enum: - return x.Descriptor().Fields().ByName("enum") - case *IndexValue_Bool: - return x.Descriptor().Fields().ByName("bool") - case *IndexValue_Timestamp: - return x.Descriptor().Fields().ByName("timestamp") - case *IndexValue_Duration: - return x.Descriptor().Fields().ByName("duration") - } - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.orm.query.v1alpha1.IndexValue", 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_IndexValue) 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_IndexValue) 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_IndexValue) 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_IndexValue) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*IndexValue) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - switch x := x.Value.(type) { - case *IndexValue_Uint: - if x == nil { - break - } - n += 1 + runtime.Sov(uint64(x.Uint)) - case *IndexValue_Int: - if x == nil { - break - } - n += 1 + runtime.Sov(uint64(x.Int)) - case *IndexValue_Str: - if x == nil { - break - } - l = len(x.Str) - n += 1 + l + runtime.Sov(uint64(l)) - case *IndexValue_Bytes: - if x == nil { - break - } - l = len(x.Bytes) - n += 1 + l + runtime.Sov(uint64(l)) - case *IndexValue_Enum: - if x == nil { - break - } - l = len(x.Enum) - n += 1 + l + runtime.Sov(uint64(l)) - case *IndexValue_Bool: - if x == nil { - break - } - n += 2 - case *IndexValue_Timestamp: - if x == nil { - break - } - l = options.Size(x.Timestamp) - n += 1 + l + runtime.Sov(uint64(l)) - case *IndexValue_Duration: - if x == nil { - break - } - l = options.Size(x.Duration) - 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().(*IndexValue) - 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) - } - switch x := x.Value.(type) { - case *IndexValue_Uint: - i = runtime.EncodeVarint(dAtA, i, uint64(x.Uint)) - i-- - dAtA[i] = 0x8 - case *IndexValue_Int: - i = runtime.EncodeVarint(dAtA, i, uint64(x.Int)) - i-- - dAtA[i] = 0x10 - case *IndexValue_Str: - i -= len(x.Str) - copy(dAtA[i:], x.Str) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Str))) - i-- - dAtA[i] = 0x1a - case *IndexValue_Bytes: - i -= len(x.Bytes) - copy(dAtA[i:], x.Bytes) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Bytes))) - i-- - dAtA[i] = 0x22 - case *IndexValue_Enum: - i -= len(x.Enum) - copy(dAtA[i:], x.Enum) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Enum))) - i-- - dAtA[i] = 0x2a - case *IndexValue_Bool: - i-- - if x.Bool { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - case *IndexValue_Timestamp: - encoded, err := options.Marshal(x.Timestamp) - 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 - case *IndexValue_Duration: - encoded, err := options.Marshal(x.Duration) - 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] = 0x42 - } - 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().(*IndexValue) - 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: IndexValue: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: IndexValue: 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 Uint", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.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 |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.Value = &IndexValue_Uint{v} - case 2: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Int", wireType) - } - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.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 |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.Value = &IndexValue_Int{v} - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Str", 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 = &IndexValue_Str{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 Bytes", 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 - } - v := make([]byte, postIndex-iNdEx) - copy(v, dAtA[iNdEx:postIndex]) - x.Value = &IndexValue_Bytes{v} - iNdEx = postIndex - case 5: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Enum", 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 = &IndexValue_Enum{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 Bool", 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 - } - } - b := bool(v != 0) - x.Value = &IndexValue_Bool{b} - case 7: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Timestamp", 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 - } - v := ×tamppb.Timestamp{} - if err := options.Unmarshal(dAtA[iNdEx:postIndex], v); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - x.Value = &IndexValue_Timestamp{v} - iNdEx = postIndex - case 8: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Duration", 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 - } - v := &durationpb.Duration{} - if err := options.Unmarshal(dAtA[iNdEx:postIndex], v); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - x.Value = &IndexValue_Duration{v} - 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: cosmos/orm/query/v1alpha1/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) -) - -// GetRequest is the Query/Get request type. -type GetRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // message_name is the fully-qualified message name of the ORM table being queried. - MessageName string `protobuf:"bytes,1,opt,name=message_name,json=messageName,proto3" json:"message_name,omitempty"` - // index is the index fields expression used in orm definitions. If it - // is empty, the table's primary key is assumed. If it is non-empty, it must - // refer to an unique index. - Index string `protobuf:"bytes,2,opt,name=index,proto3" json:"index,omitempty"` - // values are the values of the fields corresponding to the requested index. - // There must be as many values provided as there are fields in the index and - // these values must correspond to the index field types. - Values []*IndexValue `protobuf:"bytes,3,rep,name=values,proto3" json:"values,omitempty"` -} - -func (x *GetRequest) Reset() { - *x = GetRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_orm_query_v1alpha1_query_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRequest) ProtoMessage() {} - -// Deprecated: Use GetRequest.ProtoReflect.Descriptor instead. -func (*GetRequest) Descriptor() ([]byte, []int) { - return file_cosmos_orm_query_v1alpha1_query_proto_rawDescGZIP(), []int{0} -} - -func (x *GetRequest) GetMessageName() string { - if x != nil { - return x.MessageName - } - return "" -} - -func (x *GetRequest) GetIndex() string { - if x != nil { - return x.Index - } - return "" -} - -func (x *GetRequest) GetValues() []*IndexValue { - if x != nil { - return x.Values - } - return nil -} - -// GetResponse is the Query/Get response type. -type GetResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // result is the result of the get query. If no value is found, the gRPC - // status code NOT_FOUND will be returned. - Result *anypb.Any `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"` -} - -func (x *GetResponse) Reset() { - *x = GetResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_orm_query_v1alpha1_query_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetResponse) ProtoMessage() {} - -// Deprecated: Use GetResponse.ProtoReflect.Descriptor instead. -func (*GetResponse) Descriptor() ([]byte, []int) { - return file_cosmos_orm_query_v1alpha1_query_proto_rawDescGZIP(), []int{1} -} - -func (x *GetResponse) GetResult() *anypb.Any { - if x != nil { - return x.Result - } - return nil -} - -// ListRequest is the Query/List request type. -type ListRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // message_name is the fully-qualified message name of the ORM table being queried. - MessageName string `protobuf:"bytes,1,opt,name=message_name,json=messageName,proto3" json:"message_name,omitempty"` - // index is the index fields expression used in orm definitions. If it - // is empty, the table's primary key is assumed. - Index string `protobuf:"bytes,2,opt,name=index,proto3" json:"index,omitempty"` - // query is the query expression corresponding to the provided index. If - // neither prefix nor range is specified, the query will list all the fields - // in the index. - // - // Types that are assignable to Query: - // - // *ListRequest_Prefix_ - // *ListRequest_Range_ - Query isListRequest_Query `protobuf_oneof:"query"` - // pagination is the pagination request. - Pagination *v1beta1.PageRequest `protobuf:"bytes,5,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *ListRequest) Reset() { - *x = ListRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_orm_query_v1alpha1_query_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRequest) ProtoMessage() {} - -// Deprecated: Use ListRequest.ProtoReflect.Descriptor instead. -func (*ListRequest) Descriptor() ([]byte, []int) { - return file_cosmos_orm_query_v1alpha1_query_proto_rawDescGZIP(), []int{2} -} - -func (x *ListRequest) GetMessageName() string { - if x != nil { - return x.MessageName - } - return "" -} - -func (x *ListRequest) GetIndex() string { - if x != nil { - return x.Index - } - return "" -} - -func (x *ListRequest) GetQuery() isListRequest_Query { - if x != nil { - return x.Query - } - return nil -} - -func (x *ListRequest) GetPrefix() *ListRequest_Prefix { - if x, ok := x.GetQuery().(*ListRequest_Prefix_); ok { - return x.Prefix - } - return nil -} - -func (x *ListRequest) GetRange_() *ListRequest_Range { - if x, ok := x.GetQuery().(*ListRequest_Range_); ok { - return x.Range_ - } - return nil -} - -func (x *ListRequest) GetPagination() *v1beta1.PageRequest { - if x != nil { - return x.Pagination - } - return nil -} - -type isListRequest_Query interface { - isListRequest_Query() -} - -type ListRequest_Prefix_ struct { - // prefix defines a prefix query. - Prefix *ListRequest_Prefix `protobuf:"bytes,3,opt,name=prefix,proto3,oneof"` -} - -type ListRequest_Range_ struct { - // range defines a range query. - Range_ *ListRequest_Range `protobuf:"bytes,4,opt,name=range,proto3,oneof"` -} - -func (*ListRequest_Prefix_) isListRequest_Query() {} - -func (*ListRequest_Range_) isListRequest_Query() {} - -// ListResponse is the Query/List response type. -type ListResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // results are the results of the query. - Results []*anypb.Any `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` - // pagination is the pagination response. - Pagination *v1beta1.PageResponse `protobuf:"bytes,5,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *ListResponse) Reset() { - *x = ListResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_orm_query_v1alpha1_query_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListResponse) ProtoMessage() {} - -// Deprecated: Use ListResponse.ProtoReflect.Descriptor instead. -func (*ListResponse) Descriptor() ([]byte, []int) { - return file_cosmos_orm_query_v1alpha1_query_proto_rawDescGZIP(), []int{3} -} - -func (x *ListResponse) GetResults() []*anypb.Any { - if x != nil { - return x.Results - } - return nil -} - -func (x *ListResponse) GetPagination() *v1beta1.PageResponse { - if x != nil { - return x.Pagination - } - return nil -} - -// IndexValue represents the value of a field in an ORM index expression. -type IndexValue struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // value specifies the index value - // - // Types that are assignable to Value: - // - // *IndexValue_Uint - // *IndexValue_Int - // *IndexValue_Str - // *IndexValue_Bytes - // *IndexValue_Enum - // *IndexValue_Bool - // *IndexValue_Timestamp - // *IndexValue_Duration - Value isIndexValue_Value `protobuf_oneof:"value"` -} - -func (x *IndexValue) Reset() { - *x = IndexValue{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_orm_query_v1alpha1_query_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *IndexValue) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*IndexValue) ProtoMessage() {} - -// Deprecated: Use IndexValue.ProtoReflect.Descriptor instead. -func (*IndexValue) Descriptor() ([]byte, []int) { - return file_cosmos_orm_query_v1alpha1_query_proto_rawDescGZIP(), []int{4} -} - -func (x *IndexValue) GetValue() isIndexValue_Value { - if x != nil { - return x.Value - } - return nil -} - -func (x *IndexValue) GetUint() uint64 { - if x, ok := x.GetValue().(*IndexValue_Uint); ok { - return x.Uint - } - return 0 -} - -func (x *IndexValue) GetInt() int64 { - if x, ok := x.GetValue().(*IndexValue_Int); ok { - return x.Int - } - return 0 -} - -func (x *IndexValue) GetStr() string { - if x, ok := x.GetValue().(*IndexValue_Str); ok { - return x.Str - } - return "" -} - -func (x *IndexValue) GetBytes() []byte { - if x, ok := x.GetValue().(*IndexValue_Bytes); ok { - return x.Bytes - } - return nil -} - -func (x *IndexValue) GetEnum() string { - if x, ok := x.GetValue().(*IndexValue_Enum); ok { - return x.Enum - } - return "" -} - -func (x *IndexValue) GetBool() bool { - if x, ok := x.GetValue().(*IndexValue_Bool); ok { - return x.Bool - } - return false -} - -func (x *IndexValue) GetTimestamp() *timestamppb.Timestamp { - if x, ok := x.GetValue().(*IndexValue_Timestamp); ok { - return x.Timestamp - } - return nil -} - -func (x *IndexValue) GetDuration() *durationpb.Duration { - if x, ok := x.GetValue().(*IndexValue_Duration); ok { - return x.Duration - } - return nil -} - -type isIndexValue_Value interface { - isIndexValue_Value() -} - -type IndexValue_Uint struct { - // uint specifies a value for an uint32, fixed32, uint64, or fixed64 - // index field. - Uint uint64 `protobuf:"varint,1,opt,name=uint,proto3,oneof"` -} - -type IndexValue_Int struct { - // int64 specifies a value for an int32, sfixed32, int64, or sfixed64 - // index field. - Int int64 `protobuf:"varint,2,opt,name=int,proto3,oneof"` -} - -type IndexValue_Str struct { - // str specifies a value for a string index field. - Str string `protobuf:"bytes,3,opt,name=str,proto3,oneof"` -} - -type IndexValue_Bytes struct { - // bytes specifies a value for a bytes index field. - Bytes []byte `protobuf:"bytes,4,opt,name=bytes,proto3,oneof"` -} - -type IndexValue_Enum struct { - // enum specifies a value for an enum index field. - Enum string `protobuf:"bytes,5,opt,name=enum,proto3,oneof"` -} - -type IndexValue_Bool struct { - // bool specifies a value for a bool index field. - Bool bool `protobuf:"varint,6,opt,name=bool,proto3,oneof"` -} - -type IndexValue_Timestamp struct { - // timestamp specifies a value for a timestamp index field. - Timestamp *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=timestamp,proto3,oneof"` -} - -type IndexValue_Duration struct { - // duration specifies a value for a duration index field. - Duration *durationpb.Duration `protobuf:"bytes,8,opt,name=duration,proto3,oneof"` -} - -func (*IndexValue_Uint) isIndexValue_Value() {} - -func (*IndexValue_Int) isIndexValue_Value() {} - -func (*IndexValue_Str) isIndexValue_Value() {} - -func (*IndexValue_Bytes) isIndexValue_Value() {} - -func (*IndexValue_Enum) isIndexValue_Value() {} - -func (*IndexValue_Bool) isIndexValue_Value() {} - -func (*IndexValue_Timestamp) isIndexValue_Value() {} - -func (*IndexValue_Duration) isIndexValue_Value() {} - -// Prefix specifies the arguments to a prefix query. -type ListRequest_Prefix struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // values specifies the index values for the prefix query. - // It is valid to special a partial prefix with fewer values than - // the number of fields in the index. - Values []*IndexValue `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` -} - -func (x *ListRequest_Prefix) Reset() { - *x = ListRequest_Prefix{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_orm_query_v1alpha1_query_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListRequest_Prefix) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRequest_Prefix) ProtoMessage() {} - -// Deprecated: Use ListRequest_Prefix.ProtoReflect.Descriptor instead. -func (*ListRequest_Prefix) Descriptor() ([]byte, []int) { - return file_cosmos_orm_query_v1alpha1_query_proto_rawDescGZIP(), []int{2, 0} -} - -func (x *ListRequest_Prefix) GetValues() []*IndexValue { - if x != nil { - return x.Values - } - return nil -} - -// Range specifies the arguments to a range query. -type ListRequest_Range struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // start specifies the starting index values for the range query. - // It is valid to provide fewer values than the number of fields in the - // index. - Start []*IndexValue `protobuf:"bytes,1,rep,name=start,proto3" json:"start,omitempty"` - // end specifies the inclusive ending index values for the range query. - // It is valid to provide fewer values than the number of fields in the - // index. - End []*IndexValue `protobuf:"bytes,2,rep,name=end,proto3" json:"end,omitempty"` -} - -func (x *ListRequest_Range) Reset() { - *x = ListRequest_Range{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_orm_query_v1alpha1_query_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListRequest_Range) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRequest_Range) ProtoMessage() {} - -// Deprecated: Use ListRequest_Range.ProtoReflect.Descriptor instead. -func (*ListRequest_Range) Descriptor() ([]byte, []int) { - return file_cosmos_orm_query_v1alpha1_query_proto_rawDescGZIP(), []int{2, 1} -} - -func (x *ListRequest_Range) GetStart() []*IndexValue { - if x != nil { - return x.Start - } - return nil -} - -func (x *ListRequest_Range) GetEnd() []*IndexValue { - if x != nil { - return x.End - } - return nil -} - -var File_cosmos_orm_query_v1alpha1_query_proto protoreflect.FileDescriptor - -var file_cosmos_orm_query_v1alpha1_query_proto_rawDesc = []byte{ - 0x0a, 0x25, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6f, 0x72, 0x6d, 0x2f, 0x71, 0x75, 0x65, - 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x6f, 0x72, 0x6d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2a, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x84, 0x01, 0x0a, 0x0a, 0x47, - 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, - 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6e, 0x64, - 0x65, 0x78, 0x12, 0x3d, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6f, 0x72, 0x6d, 0x2e, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x73, 0x22, 0x3b, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x2c, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0xee, - 0x03, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, - 0x0a, 0x0c, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4e, 0x61, 0x6d, - 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x47, 0x0a, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, - 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x6f, 0x72, 0x6d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, - 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x48, 0x00, 0x52, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, - 0x12, 0x44, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6f, 0x72, 0x6d, 0x2e, 0x71, 0x75, 0x65, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x48, 0x00, 0x52, - 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x47, - 0x0a, 0x06, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x3d, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x6f, 0x72, 0x6d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, - 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x1a, 0x7d, 0x0a, 0x05, 0x52, 0x61, 0x6e, 0x67, 0x65, - 0x12, 0x3b, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x25, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6f, 0x72, 0x6d, 0x2e, 0x71, 0x75, 0x65, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x37, 0x0a, - 0x03, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x6f, 0x72, 0x6d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x42, 0x07, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, - 0x87, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x2e, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, - 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, - 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, - 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x8c, 0x02, 0x0a, 0x0a, 0x49, 0x6e, - 0x64, 0x65, 0x78, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x14, 0x0a, 0x04, 0x75, 0x69, 0x6e, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x04, 0x75, 0x69, 0x6e, 0x74, 0x12, 0x12, - 0x0a, 0x03, 0x69, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x03, 0x69, - 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x03, 0x73, 0x74, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, - 0x00, 0x52, 0x03, 0x73, 0x74, 0x72, 0x12, 0x16, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x12, 0x14, - 0x0a, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, - 0x65, 0x6e, 0x75, 0x6d, 0x12, 0x14, 0x0a, 0x04, 0x62, 0x6f, 0x6f, 0x6c, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x08, 0x48, 0x00, 0x52, 0x04, 0x62, 0x6f, 0x6f, 0x6c, 0x12, 0x3a, 0x0a, 0x09, 0x74, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x00, 0x52, 0x09, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x37, 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, - 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x32, 0xb6, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x12, 0x54, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x25, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x6f, 0x72, 0x6d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6f, 0x72, 0x6d, 0x2e, 0x71, 0x75, - 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, - 0x12, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6f, 0x72, 0x6d, 0x2e, 0x71, 0x75, - 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x6f, 0x72, 0x6d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x42, 0xec, 0x01, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x6f, 0x72, 0x6d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x38, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6f, 0x72, 0x6d, 0x2f, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x71, 0x75, - 0x65, 0x72, 0x79, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x4f, - 0x51, 0xaa, 0x02, 0x19, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x4f, 0x72, 0x6d, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x19, - 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x4f, 0x72, 0x6d, 0x5c, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x25, 0x43, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x5c, 0x4f, 0x72, 0x6d, 0x5c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0xea, 0x02, 0x1c, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x4f, 0x72, 0x6d, 0x3a, - 0x3a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_cosmos_orm_query_v1alpha1_query_proto_rawDescOnce sync.Once - file_cosmos_orm_query_v1alpha1_query_proto_rawDescData = file_cosmos_orm_query_v1alpha1_query_proto_rawDesc -) - -func file_cosmos_orm_query_v1alpha1_query_proto_rawDescGZIP() []byte { - file_cosmos_orm_query_v1alpha1_query_proto_rawDescOnce.Do(func() { - file_cosmos_orm_query_v1alpha1_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_orm_query_v1alpha1_query_proto_rawDescData) - }) - return file_cosmos_orm_query_v1alpha1_query_proto_rawDescData -} - -var file_cosmos_orm_query_v1alpha1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_cosmos_orm_query_v1alpha1_query_proto_goTypes = []interface{}{ - (*GetRequest)(nil), // 0: cosmos.orm.query.v1alpha1.GetRequest - (*GetResponse)(nil), // 1: cosmos.orm.query.v1alpha1.GetResponse - (*ListRequest)(nil), // 2: cosmos.orm.query.v1alpha1.ListRequest - (*ListResponse)(nil), // 3: cosmos.orm.query.v1alpha1.ListResponse - (*IndexValue)(nil), // 4: cosmos.orm.query.v1alpha1.IndexValue - (*ListRequest_Prefix)(nil), // 5: cosmos.orm.query.v1alpha1.ListRequest.Prefix - (*ListRequest_Range)(nil), // 6: cosmos.orm.query.v1alpha1.ListRequest.Range - (*anypb.Any)(nil), // 7: google.protobuf.Any - (*v1beta1.PageRequest)(nil), // 8: cosmos.base.query.v1beta1.PageRequest - (*v1beta1.PageResponse)(nil), // 9: cosmos.base.query.v1beta1.PageResponse - (*timestamppb.Timestamp)(nil), // 10: google.protobuf.Timestamp - (*durationpb.Duration)(nil), // 11: google.protobuf.Duration -} -var file_cosmos_orm_query_v1alpha1_query_proto_depIdxs = []int32{ - 4, // 0: cosmos.orm.query.v1alpha1.GetRequest.values:type_name -> cosmos.orm.query.v1alpha1.IndexValue - 7, // 1: cosmos.orm.query.v1alpha1.GetResponse.result:type_name -> google.protobuf.Any - 5, // 2: cosmos.orm.query.v1alpha1.ListRequest.prefix:type_name -> cosmos.orm.query.v1alpha1.ListRequest.Prefix - 6, // 3: cosmos.orm.query.v1alpha1.ListRequest.range:type_name -> cosmos.orm.query.v1alpha1.ListRequest.Range - 8, // 4: cosmos.orm.query.v1alpha1.ListRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 7, // 5: cosmos.orm.query.v1alpha1.ListResponse.results:type_name -> google.protobuf.Any - 9, // 6: cosmos.orm.query.v1alpha1.ListResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 10, // 7: cosmos.orm.query.v1alpha1.IndexValue.timestamp:type_name -> google.protobuf.Timestamp - 11, // 8: cosmos.orm.query.v1alpha1.IndexValue.duration:type_name -> google.protobuf.Duration - 4, // 9: cosmos.orm.query.v1alpha1.ListRequest.Prefix.values:type_name -> cosmos.orm.query.v1alpha1.IndexValue - 4, // 10: cosmos.orm.query.v1alpha1.ListRequest.Range.start:type_name -> cosmos.orm.query.v1alpha1.IndexValue - 4, // 11: cosmos.orm.query.v1alpha1.ListRequest.Range.end:type_name -> cosmos.orm.query.v1alpha1.IndexValue - 0, // 12: cosmos.orm.query.v1alpha1.Query.Get:input_type -> cosmos.orm.query.v1alpha1.GetRequest - 2, // 13: cosmos.orm.query.v1alpha1.Query.List:input_type -> cosmos.orm.query.v1alpha1.ListRequest - 1, // 14: cosmos.orm.query.v1alpha1.Query.Get:output_type -> cosmos.orm.query.v1alpha1.GetResponse - 3, // 15: cosmos.orm.query.v1alpha1.Query.List:output_type -> cosmos.orm.query.v1alpha1.ListResponse - 14, // [14:16] is the sub-list for method output_type - 12, // [12:14] is the sub-list for method input_type - 12, // [12:12] is the sub-list for extension type_name - 12, // [12:12] is the sub-list for extension extendee - 0, // [0:12] is the sub-list for field type_name -} - -func init() { file_cosmos_orm_query_v1alpha1_query_proto_init() } -func file_cosmos_orm_query_v1alpha1_query_proto_init() { - if File_cosmos_orm_query_v1alpha1_query_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_cosmos_orm_query_v1alpha1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cosmos_orm_query_v1alpha1_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cosmos_orm_query_v1alpha1_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cosmos_orm_query_v1alpha1_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cosmos_orm_query_v1alpha1_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*IndexValue); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cosmos_orm_query_v1alpha1_query_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRequest_Prefix); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cosmos_orm_query_v1alpha1_query_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRequest_Range); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_cosmos_orm_query_v1alpha1_query_proto_msgTypes[2].OneofWrappers = []interface{}{ - (*ListRequest_Prefix_)(nil), - (*ListRequest_Range_)(nil), - } - file_cosmos_orm_query_v1alpha1_query_proto_msgTypes[4].OneofWrappers = []interface{}{ - (*IndexValue_Uint)(nil), - (*IndexValue_Int)(nil), - (*IndexValue_Str)(nil), - (*IndexValue_Bytes)(nil), - (*IndexValue_Enum)(nil), - (*IndexValue_Bool)(nil), - (*IndexValue_Timestamp)(nil), - (*IndexValue_Duration)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_cosmos_orm_query_v1alpha1_query_proto_rawDesc, - NumEnums: 0, - NumMessages: 7, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_cosmos_orm_query_v1alpha1_query_proto_goTypes, - DependencyIndexes: file_cosmos_orm_query_v1alpha1_query_proto_depIdxs, - MessageInfos: file_cosmos_orm_query_v1alpha1_query_proto_msgTypes, - }.Build() - File_cosmos_orm_query_v1alpha1_query_proto = out.File - file_cosmos_orm_query_v1alpha1_query_proto_rawDesc = nil - file_cosmos_orm_query_v1alpha1_query_proto_goTypes = nil - file_cosmos_orm_query_v1alpha1_query_proto_depIdxs = nil -} diff --git a/api/cosmos/orm/query/v1alpha1/query_grpc.pb.go b/api/cosmos/orm/query/v1alpha1/query_grpc.pb.go deleted file mode 100644 index e02ab1e98939..000000000000 --- a/api/cosmos/orm/query/v1alpha1/query_grpc.pb.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc (unknown) -// source: cosmos/orm/query/v1alpha1/query.proto - -package queryv1alpha1 - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - Query_Get_FullMethodName = "/cosmos.orm.query.v1alpha1.Query/Get" - Query_List_FullMethodName = "/cosmos.orm.query.v1alpha1.Query/List" -) - -// QueryClient is the client API for Query service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type QueryClient interface { - // Get queries an ORM table against an unique index. - Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) - // List queries an ORM table against an index. - List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) -} - -type queryClient struct { - cc grpc.ClientConnInterface -} - -func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) { - out := new(GetResponse) - err := c.cc.Invoke(ctx, Query_Get_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) { - out := new(ListResponse) - err := c.cc.Invoke(ctx, Query_List_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -// All implementations must embed UnimplementedQueryServer -// for forward compatibility -type QueryServer interface { - // Get queries an ORM table against an unique index. - Get(context.Context, *GetRequest) (*GetResponse, error) - // List queries an ORM table against an index. - List(context.Context, *ListRequest) (*ListResponse, error) - mustEmbedUnimplementedQueryServer() -} - -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (UnimplementedQueryServer) Get(context.Context, *GetRequest) (*GetResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") -} -func (UnimplementedQueryServer) List(context.Context, *ListRequest) (*ListResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method List not implemented") -} -func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} - -// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to QueryServer will -// result in compilation errors. -type UnsafeQueryServer interface { - mustEmbedUnimplementedQueryServer() -} - -func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { - s.RegisterService(&Query_ServiceDesc, srv) -} - -func _Query_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Get(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_Get_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Get(ctx, req.(*GetRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).List(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_List_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).List(ctx, req.(*ListRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Query_ServiceDesc is the grpc.ServiceDesc for Query service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Query_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.orm.query.v1alpha1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Get", - Handler: _Query_Get_Handler, - }, - { - MethodName: "List", - Handler: _Query_List_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/orm/query/v1alpha1/query.proto", -} diff --git a/api/cosmos/orm/v1/orm.pulsar.go b/api/cosmos/orm/v1/orm.pulsar.go deleted file mode 100644 index e746252fa4fc..000000000000 --- a/api/cosmos/orm/v1/orm.pulsar.go +++ /dev/null @@ -1,2489 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package ormv1 - -import ( - 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" - descriptorpb "google.golang.org/protobuf/types/descriptorpb" - io "io" - reflect "reflect" - sync "sync" -) - -var _ protoreflect.List = (*_TableDescriptor_2_list)(nil) - -type _TableDescriptor_2_list struct { - list *[]*SecondaryIndexDescriptor -} - -func (x *_TableDescriptor_2_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_TableDescriptor_2_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_TableDescriptor_2_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*SecondaryIndexDescriptor) - (*x.list)[i] = concreteValue -} - -func (x *_TableDescriptor_2_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*SecondaryIndexDescriptor) - *x.list = append(*x.list, concreteValue) -} - -func (x *_TableDescriptor_2_list) AppendMutable() protoreflect.Value { - v := new(SecondaryIndexDescriptor) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_TableDescriptor_2_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_TableDescriptor_2_list) NewElement() protoreflect.Value { - v := new(SecondaryIndexDescriptor) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_TableDescriptor_2_list) IsValid() bool { - return x.list != nil -} - -var ( - md_TableDescriptor protoreflect.MessageDescriptor - fd_TableDescriptor_primary_key protoreflect.FieldDescriptor - fd_TableDescriptor_index protoreflect.FieldDescriptor - fd_TableDescriptor_id protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_orm_v1_orm_proto_init() - md_TableDescriptor = File_cosmos_orm_v1_orm_proto.Messages().ByName("TableDescriptor") - fd_TableDescriptor_primary_key = md_TableDescriptor.Fields().ByName("primary_key") - fd_TableDescriptor_index = md_TableDescriptor.Fields().ByName("index") - fd_TableDescriptor_id = md_TableDescriptor.Fields().ByName("id") -} - -var _ protoreflect.Message = (*fastReflection_TableDescriptor)(nil) - -type fastReflection_TableDescriptor TableDescriptor - -func (x *TableDescriptor) ProtoReflect() protoreflect.Message { - return (*fastReflection_TableDescriptor)(x) -} - -func (x *TableDescriptor) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_orm_v1_orm_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_TableDescriptor_messageType fastReflection_TableDescriptor_messageType -var _ protoreflect.MessageType = fastReflection_TableDescriptor_messageType{} - -type fastReflection_TableDescriptor_messageType struct{} - -func (x fastReflection_TableDescriptor_messageType) Zero() protoreflect.Message { - return (*fastReflection_TableDescriptor)(nil) -} -func (x fastReflection_TableDescriptor_messageType) New() protoreflect.Message { - return new(fastReflection_TableDescriptor) -} -func (x fastReflection_TableDescriptor_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_TableDescriptor -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_TableDescriptor) Descriptor() protoreflect.MessageDescriptor { - return md_TableDescriptor -} - -// 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_TableDescriptor) Type() protoreflect.MessageType { - return _fastReflection_TableDescriptor_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_TableDescriptor) New() protoreflect.Message { - return new(fastReflection_TableDescriptor) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_TableDescriptor) Interface() protoreflect.ProtoMessage { - return (*TableDescriptor)(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_TableDescriptor) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.PrimaryKey != nil { - value := protoreflect.ValueOfMessage(x.PrimaryKey.ProtoReflect()) - if !f(fd_TableDescriptor_primary_key, value) { - return - } - } - if len(x.Index) != 0 { - value := protoreflect.ValueOfList(&_TableDescriptor_2_list{list: &x.Index}) - if !f(fd_TableDescriptor_index, value) { - return - } - } - if x.Id != uint32(0) { - value := protoreflect.ValueOfUint32(x.Id) - if !f(fd_TableDescriptor_id, 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_TableDescriptor) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.orm.v1.TableDescriptor.primary_key": - return x.PrimaryKey != nil - case "cosmos.orm.v1.TableDescriptor.index": - return len(x.Index) != 0 - case "cosmos.orm.v1.TableDescriptor.id": - return x.Id != uint32(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.v1.TableDescriptor")) - } - panic(fmt.Errorf("message cosmos.orm.v1.TableDescriptor 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_TableDescriptor) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.orm.v1.TableDescriptor.primary_key": - x.PrimaryKey = nil - case "cosmos.orm.v1.TableDescriptor.index": - x.Index = nil - case "cosmos.orm.v1.TableDescriptor.id": - x.Id = uint32(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.v1.TableDescriptor")) - } - panic(fmt.Errorf("message cosmos.orm.v1.TableDescriptor 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_TableDescriptor) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.orm.v1.TableDescriptor.primary_key": - value := x.PrimaryKey - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cosmos.orm.v1.TableDescriptor.index": - if len(x.Index) == 0 { - return protoreflect.ValueOfList(&_TableDescriptor_2_list{}) - } - listValue := &_TableDescriptor_2_list{list: &x.Index} - return protoreflect.ValueOfList(listValue) - case "cosmos.orm.v1.TableDescriptor.id": - value := x.Id - return protoreflect.ValueOfUint32(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.v1.TableDescriptor")) - } - panic(fmt.Errorf("message cosmos.orm.v1.TableDescriptor 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_TableDescriptor) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.orm.v1.TableDescriptor.primary_key": - x.PrimaryKey = value.Message().Interface().(*PrimaryKeyDescriptor) - case "cosmos.orm.v1.TableDescriptor.index": - lv := value.List() - clv := lv.(*_TableDescriptor_2_list) - x.Index = *clv.list - case "cosmos.orm.v1.TableDescriptor.id": - x.Id = uint32(value.Uint()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.v1.TableDescriptor")) - } - panic(fmt.Errorf("message cosmos.orm.v1.TableDescriptor 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_TableDescriptor) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.orm.v1.TableDescriptor.primary_key": - if x.PrimaryKey == nil { - x.PrimaryKey = new(PrimaryKeyDescriptor) - } - return protoreflect.ValueOfMessage(x.PrimaryKey.ProtoReflect()) - case "cosmos.orm.v1.TableDescriptor.index": - if x.Index == nil { - x.Index = []*SecondaryIndexDescriptor{} - } - value := &_TableDescriptor_2_list{list: &x.Index} - return protoreflect.ValueOfList(value) - case "cosmos.orm.v1.TableDescriptor.id": - panic(fmt.Errorf("field id of message cosmos.orm.v1.TableDescriptor is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.v1.TableDescriptor")) - } - panic(fmt.Errorf("message cosmos.orm.v1.TableDescriptor 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_TableDescriptor) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.orm.v1.TableDescriptor.primary_key": - m := new(PrimaryKeyDescriptor) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cosmos.orm.v1.TableDescriptor.index": - list := []*SecondaryIndexDescriptor{} - return protoreflect.ValueOfList(&_TableDescriptor_2_list{list: &list}) - case "cosmos.orm.v1.TableDescriptor.id": - return protoreflect.ValueOfUint32(uint32(0)) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.v1.TableDescriptor")) - } - panic(fmt.Errorf("message cosmos.orm.v1.TableDescriptor 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_TableDescriptor) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.orm.v1.TableDescriptor", 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_TableDescriptor) 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_TableDescriptor) 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_TableDescriptor) 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_TableDescriptor) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*TableDescriptor) - 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.PrimaryKey != nil { - l = options.Size(x.PrimaryKey) - n += 1 + l + runtime.Sov(uint64(l)) - } - if len(x.Index) > 0 { - for _, e := range x.Index { - l = options.Size(e) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - if x.Id != 0 { - n += 1 + runtime.Sov(uint64(x.Id)) - } - 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().(*TableDescriptor) - 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.Id != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Id)) - i-- - dAtA[i] = 0x18 - } - if len(x.Index) > 0 { - for iNdEx := len(x.Index) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.Index[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.PrimaryKey != nil { - encoded, err := options.Marshal(x.PrimaryKey) - 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().(*TableDescriptor) - 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: TableDescriptor: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: TableDescriptor: 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 PrimaryKey", 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.PrimaryKey == nil { - x.PrimaryKey = &PrimaryKeyDescriptor{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.PrimaryKey); err != nil { - 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 Index", 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.Index = append(x.Index, &SecondaryIndexDescriptor{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Index[len(x.Index)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - x.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - x.Id |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_PrimaryKeyDescriptor protoreflect.MessageDescriptor - fd_PrimaryKeyDescriptor_fields protoreflect.FieldDescriptor - fd_PrimaryKeyDescriptor_auto_increment protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_orm_v1_orm_proto_init() - md_PrimaryKeyDescriptor = File_cosmos_orm_v1_orm_proto.Messages().ByName("PrimaryKeyDescriptor") - fd_PrimaryKeyDescriptor_fields = md_PrimaryKeyDescriptor.Fields().ByName("fields") - fd_PrimaryKeyDescriptor_auto_increment = md_PrimaryKeyDescriptor.Fields().ByName("auto_increment") -} - -var _ protoreflect.Message = (*fastReflection_PrimaryKeyDescriptor)(nil) - -type fastReflection_PrimaryKeyDescriptor PrimaryKeyDescriptor - -func (x *PrimaryKeyDescriptor) ProtoReflect() protoreflect.Message { - return (*fastReflection_PrimaryKeyDescriptor)(x) -} - -func (x *PrimaryKeyDescriptor) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_orm_v1_orm_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_PrimaryKeyDescriptor_messageType fastReflection_PrimaryKeyDescriptor_messageType -var _ protoreflect.MessageType = fastReflection_PrimaryKeyDescriptor_messageType{} - -type fastReflection_PrimaryKeyDescriptor_messageType struct{} - -func (x fastReflection_PrimaryKeyDescriptor_messageType) Zero() protoreflect.Message { - return (*fastReflection_PrimaryKeyDescriptor)(nil) -} -func (x fastReflection_PrimaryKeyDescriptor_messageType) New() protoreflect.Message { - return new(fastReflection_PrimaryKeyDescriptor) -} -func (x fastReflection_PrimaryKeyDescriptor_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_PrimaryKeyDescriptor -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_PrimaryKeyDescriptor) Descriptor() protoreflect.MessageDescriptor { - return md_PrimaryKeyDescriptor -} - -// 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_PrimaryKeyDescriptor) Type() protoreflect.MessageType { - return _fastReflection_PrimaryKeyDescriptor_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_PrimaryKeyDescriptor) New() protoreflect.Message { - return new(fastReflection_PrimaryKeyDescriptor) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_PrimaryKeyDescriptor) Interface() protoreflect.ProtoMessage { - return (*PrimaryKeyDescriptor)(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_PrimaryKeyDescriptor) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Fields != "" { - value := protoreflect.ValueOfString(x.Fields) - if !f(fd_PrimaryKeyDescriptor_fields, value) { - return - } - } - if x.AutoIncrement != false { - value := protoreflect.ValueOfBool(x.AutoIncrement) - if !f(fd_PrimaryKeyDescriptor_auto_increment, 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_PrimaryKeyDescriptor) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.orm.v1.PrimaryKeyDescriptor.fields": - return x.Fields != "" - case "cosmos.orm.v1.PrimaryKeyDescriptor.auto_increment": - return x.AutoIncrement != false - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.v1.PrimaryKeyDescriptor")) - } - panic(fmt.Errorf("message cosmos.orm.v1.PrimaryKeyDescriptor 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_PrimaryKeyDescriptor) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.orm.v1.PrimaryKeyDescriptor.fields": - x.Fields = "" - case "cosmos.orm.v1.PrimaryKeyDescriptor.auto_increment": - x.AutoIncrement = false - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.v1.PrimaryKeyDescriptor")) - } - panic(fmt.Errorf("message cosmos.orm.v1.PrimaryKeyDescriptor 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_PrimaryKeyDescriptor) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.orm.v1.PrimaryKeyDescriptor.fields": - value := x.Fields - return protoreflect.ValueOfString(value) - case "cosmos.orm.v1.PrimaryKeyDescriptor.auto_increment": - value := x.AutoIncrement - return protoreflect.ValueOfBool(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.v1.PrimaryKeyDescriptor")) - } - panic(fmt.Errorf("message cosmos.orm.v1.PrimaryKeyDescriptor 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_PrimaryKeyDescriptor) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.orm.v1.PrimaryKeyDescriptor.fields": - x.Fields = value.Interface().(string) - case "cosmos.orm.v1.PrimaryKeyDescriptor.auto_increment": - x.AutoIncrement = value.Bool() - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.v1.PrimaryKeyDescriptor")) - } - panic(fmt.Errorf("message cosmos.orm.v1.PrimaryKeyDescriptor 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_PrimaryKeyDescriptor) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.orm.v1.PrimaryKeyDescriptor.fields": - panic(fmt.Errorf("field fields of message cosmos.orm.v1.PrimaryKeyDescriptor is not mutable")) - case "cosmos.orm.v1.PrimaryKeyDescriptor.auto_increment": - panic(fmt.Errorf("field auto_increment of message cosmos.orm.v1.PrimaryKeyDescriptor is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.v1.PrimaryKeyDescriptor")) - } - panic(fmt.Errorf("message cosmos.orm.v1.PrimaryKeyDescriptor 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_PrimaryKeyDescriptor) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.orm.v1.PrimaryKeyDescriptor.fields": - return protoreflect.ValueOfString("") - case "cosmos.orm.v1.PrimaryKeyDescriptor.auto_increment": - return protoreflect.ValueOfBool(false) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.v1.PrimaryKeyDescriptor")) - } - panic(fmt.Errorf("message cosmos.orm.v1.PrimaryKeyDescriptor 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_PrimaryKeyDescriptor) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.orm.v1.PrimaryKeyDescriptor", 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_PrimaryKeyDescriptor) 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_PrimaryKeyDescriptor) 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_PrimaryKeyDescriptor) 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_PrimaryKeyDescriptor) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*PrimaryKeyDescriptor) - 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.Fields) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.AutoIncrement { - 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().(*PrimaryKeyDescriptor) - 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.AutoIncrement { - i-- - if x.AutoIncrement { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if len(x.Fields) > 0 { - i -= len(x.Fields) - copy(dAtA[i:], x.Fields) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Fields))) - 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().(*PrimaryKeyDescriptor) - 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: PrimaryKeyDescriptor: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: PrimaryKeyDescriptor: 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 Fields", 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.Fields = 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 AutoIncrement", 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.AutoIncrement = 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_SecondaryIndexDescriptor protoreflect.MessageDescriptor - fd_SecondaryIndexDescriptor_fields protoreflect.FieldDescriptor - fd_SecondaryIndexDescriptor_id protoreflect.FieldDescriptor - fd_SecondaryIndexDescriptor_unique protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_orm_v1_orm_proto_init() - md_SecondaryIndexDescriptor = File_cosmos_orm_v1_orm_proto.Messages().ByName("SecondaryIndexDescriptor") - fd_SecondaryIndexDescriptor_fields = md_SecondaryIndexDescriptor.Fields().ByName("fields") - fd_SecondaryIndexDescriptor_id = md_SecondaryIndexDescriptor.Fields().ByName("id") - fd_SecondaryIndexDescriptor_unique = md_SecondaryIndexDescriptor.Fields().ByName("unique") -} - -var _ protoreflect.Message = (*fastReflection_SecondaryIndexDescriptor)(nil) - -type fastReflection_SecondaryIndexDescriptor SecondaryIndexDescriptor - -func (x *SecondaryIndexDescriptor) ProtoReflect() protoreflect.Message { - return (*fastReflection_SecondaryIndexDescriptor)(x) -} - -func (x *SecondaryIndexDescriptor) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_orm_v1_orm_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_SecondaryIndexDescriptor_messageType fastReflection_SecondaryIndexDescriptor_messageType -var _ protoreflect.MessageType = fastReflection_SecondaryIndexDescriptor_messageType{} - -type fastReflection_SecondaryIndexDescriptor_messageType struct{} - -func (x fastReflection_SecondaryIndexDescriptor_messageType) Zero() protoreflect.Message { - return (*fastReflection_SecondaryIndexDescriptor)(nil) -} -func (x fastReflection_SecondaryIndexDescriptor_messageType) New() protoreflect.Message { - return new(fastReflection_SecondaryIndexDescriptor) -} -func (x fastReflection_SecondaryIndexDescriptor_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_SecondaryIndexDescriptor -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_SecondaryIndexDescriptor) Descriptor() protoreflect.MessageDescriptor { - return md_SecondaryIndexDescriptor -} - -// 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_SecondaryIndexDescriptor) Type() protoreflect.MessageType { - return _fastReflection_SecondaryIndexDescriptor_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_SecondaryIndexDescriptor) New() protoreflect.Message { - return new(fastReflection_SecondaryIndexDescriptor) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_SecondaryIndexDescriptor) Interface() protoreflect.ProtoMessage { - return (*SecondaryIndexDescriptor)(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_SecondaryIndexDescriptor) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Fields != "" { - value := protoreflect.ValueOfString(x.Fields) - if !f(fd_SecondaryIndexDescriptor_fields, value) { - return - } - } - if x.Id != uint32(0) { - value := protoreflect.ValueOfUint32(x.Id) - if !f(fd_SecondaryIndexDescriptor_id, value) { - return - } - } - if x.Unique != false { - value := protoreflect.ValueOfBool(x.Unique) - if !f(fd_SecondaryIndexDescriptor_unique, 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_SecondaryIndexDescriptor) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.orm.v1.SecondaryIndexDescriptor.fields": - return x.Fields != "" - case "cosmos.orm.v1.SecondaryIndexDescriptor.id": - return x.Id != uint32(0) - case "cosmos.orm.v1.SecondaryIndexDescriptor.unique": - return x.Unique != false - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.v1.SecondaryIndexDescriptor")) - } - panic(fmt.Errorf("message cosmos.orm.v1.SecondaryIndexDescriptor 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_SecondaryIndexDescriptor) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.orm.v1.SecondaryIndexDescriptor.fields": - x.Fields = "" - case "cosmos.orm.v1.SecondaryIndexDescriptor.id": - x.Id = uint32(0) - case "cosmos.orm.v1.SecondaryIndexDescriptor.unique": - x.Unique = false - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.v1.SecondaryIndexDescriptor")) - } - panic(fmt.Errorf("message cosmos.orm.v1.SecondaryIndexDescriptor 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_SecondaryIndexDescriptor) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.orm.v1.SecondaryIndexDescriptor.fields": - value := x.Fields - return protoreflect.ValueOfString(value) - case "cosmos.orm.v1.SecondaryIndexDescriptor.id": - value := x.Id - return protoreflect.ValueOfUint32(value) - case "cosmos.orm.v1.SecondaryIndexDescriptor.unique": - value := x.Unique - return protoreflect.ValueOfBool(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.v1.SecondaryIndexDescriptor")) - } - panic(fmt.Errorf("message cosmos.orm.v1.SecondaryIndexDescriptor 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_SecondaryIndexDescriptor) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.orm.v1.SecondaryIndexDescriptor.fields": - x.Fields = value.Interface().(string) - case "cosmos.orm.v1.SecondaryIndexDescriptor.id": - x.Id = uint32(value.Uint()) - case "cosmos.orm.v1.SecondaryIndexDescriptor.unique": - x.Unique = value.Bool() - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.v1.SecondaryIndexDescriptor")) - } - panic(fmt.Errorf("message cosmos.orm.v1.SecondaryIndexDescriptor 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_SecondaryIndexDescriptor) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.orm.v1.SecondaryIndexDescriptor.fields": - panic(fmt.Errorf("field fields of message cosmos.orm.v1.SecondaryIndexDescriptor is not mutable")) - case "cosmos.orm.v1.SecondaryIndexDescriptor.id": - panic(fmt.Errorf("field id of message cosmos.orm.v1.SecondaryIndexDescriptor is not mutable")) - case "cosmos.orm.v1.SecondaryIndexDescriptor.unique": - panic(fmt.Errorf("field unique of message cosmos.orm.v1.SecondaryIndexDescriptor is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.v1.SecondaryIndexDescriptor")) - } - panic(fmt.Errorf("message cosmos.orm.v1.SecondaryIndexDescriptor 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_SecondaryIndexDescriptor) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.orm.v1.SecondaryIndexDescriptor.fields": - return protoreflect.ValueOfString("") - case "cosmos.orm.v1.SecondaryIndexDescriptor.id": - return protoreflect.ValueOfUint32(uint32(0)) - case "cosmos.orm.v1.SecondaryIndexDescriptor.unique": - return protoreflect.ValueOfBool(false) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.v1.SecondaryIndexDescriptor")) - } - panic(fmt.Errorf("message cosmos.orm.v1.SecondaryIndexDescriptor 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_SecondaryIndexDescriptor) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.orm.v1.SecondaryIndexDescriptor", 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_SecondaryIndexDescriptor) 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_SecondaryIndexDescriptor) 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_SecondaryIndexDescriptor) 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_SecondaryIndexDescriptor) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*SecondaryIndexDescriptor) - 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.Fields) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Id != 0 { - n += 1 + runtime.Sov(uint64(x.Id)) - } - if x.Unique { - 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().(*SecondaryIndexDescriptor) - 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.Unique { - i-- - if x.Unique { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if x.Id != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Id)) - i-- - dAtA[i] = 0x10 - } - if len(x.Fields) > 0 { - i -= len(x.Fields) - copy(dAtA[i:], x.Fields) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Fields))) - 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().(*SecondaryIndexDescriptor) - 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: SecondaryIndexDescriptor: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: SecondaryIndexDescriptor: 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 Fields", 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.Fields = 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 Id", wireType) - } - x.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - x.Id |= uint32(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 Unique", 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.Unique = 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_SingletonDescriptor protoreflect.MessageDescriptor - fd_SingletonDescriptor_id protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_orm_v1_orm_proto_init() - md_SingletonDescriptor = File_cosmos_orm_v1_orm_proto.Messages().ByName("SingletonDescriptor") - fd_SingletonDescriptor_id = md_SingletonDescriptor.Fields().ByName("id") -} - -var _ protoreflect.Message = (*fastReflection_SingletonDescriptor)(nil) - -type fastReflection_SingletonDescriptor SingletonDescriptor - -func (x *SingletonDescriptor) ProtoReflect() protoreflect.Message { - return (*fastReflection_SingletonDescriptor)(x) -} - -func (x *SingletonDescriptor) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_orm_v1_orm_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_SingletonDescriptor_messageType fastReflection_SingletonDescriptor_messageType -var _ protoreflect.MessageType = fastReflection_SingletonDescriptor_messageType{} - -type fastReflection_SingletonDescriptor_messageType struct{} - -func (x fastReflection_SingletonDescriptor_messageType) Zero() protoreflect.Message { - return (*fastReflection_SingletonDescriptor)(nil) -} -func (x fastReflection_SingletonDescriptor_messageType) New() protoreflect.Message { - return new(fastReflection_SingletonDescriptor) -} -func (x fastReflection_SingletonDescriptor_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_SingletonDescriptor -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_SingletonDescriptor) Descriptor() protoreflect.MessageDescriptor { - return md_SingletonDescriptor -} - -// 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_SingletonDescriptor) Type() protoreflect.MessageType { - return _fastReflection_SingletonDescriptor_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_SingletonDescriptor) New() protoreflect.Message { - return new(fastReflection_SingletonDescriptor) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_SingletonDescriptor) Interface() protoreflect.ProtoMessage { - return (*SingletonDescriptor)(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_SingletonDescriptor) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Id != uint32(0) { - value := protoreflect.ValueOfUint32(x.Id) - if !f(fd_SingletonDescriptor_id, 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_SingletonDescriptor) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.orm.v1.SingletonDescriptor.id": - return x.Id != uint32(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.v1.SingletonDescriptor")) - } - panic(fmt.Errorf("message cosmos.orm.v1.SingletonDescriptor 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_SingletonDescriptor) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.orm.v1.SingletonDescriptor.id": - x.Id = uint32(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.v1.SingletonDescriptor")) - } - panic(fmt.Errorf("message cosmos.orm.v1.SingletonDescriptor 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_SingletonDescriptor) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.orm.v1.SingletonDescriptor.id": - value := x.Id - return protoreflect.ValueOfUint32(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.v1.SingletonDescriptor")) - } - panic(fmt.Errorf("message cosmos.orm.v1.SingletonDescriptor 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_SingletonDescriptor) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.orm.v1.SingletonDescriptor.id": - x.Id = uint32(value.Uint()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.v1.SingletonDescriptor")) - } - panic(fmt.Errorf("message cosmos.orm.v1.SingletonDescriptor 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_SingletonDescriptor) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.orm.v1.SingletonDescriptor.id": - panic(fmt.Errorf("field id of message cosmos.orm.v1.SingletonDescriptor is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.v1.SingletonDescriptor")) - } - panic(fmt.Errorf("message cosmos.orm.v1.SingletonDescriptor 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_SingletonDescriptor) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.orm.v1.SingletonDescriptor.id": - return protoreflect.ValueOfUint32(uint32(0)) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.v1.SingletonDescriptor")) - } - panic(fmt.Errorf("message cosmos.orm.v1.SingletonDescriptor 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_SingletonDescriptor) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.orm.v1.SingletonDescriptor", 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_SingletonDescriptor) 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_SingletonDescriptor) 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_SingletonDescriptor) 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_SingletonDescriptor) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*SingletonDescriptor) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.Id != 0 { - n += 1 + runtime.Sov(uint64(x.Id)) - } - 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().(*SingletonDescriptor) - 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.Id != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Id)) - i-- - dAtA[i] = 0x8 - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*SingletonDescriptor) - 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: SingletonDescriptor: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: SingletonDescriptor: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - x.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - x.Id |= uint32(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, - } -} - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.0 -// protoc (unknown) -// source: cosmos/orm/v1/orm.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) -) - -// TableDescriptor describes an ORM table. -type TableDescriptor struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // primary_key defines the primary key for the table. - PrimaryKey *PrimaryKeyDescriptor `protobuf:"bytes,1,opt,name=primary_key,json=primaryKey,proto3" json:"primary_key,omitempty"` - // index defines one or more secondary indexes. - Index []*SecondaryIndexDescriptor `protobuf:"bytes,2,rep,name=index,proto3" json:"index,omitempty"` - // id is a non-zero integer ID that must be unique within the - // tables and singletons in this file. It may be deprecated in the future when this - // can be auto-generated. - Id uint32 `protobuf:"varint,3,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *TableDescriptor) Reset() { - *x = TableDescriptor{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_orm_v1_orm_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TableDescriptor) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TableDescriptor) ProtoMessage() {} - -// Deprecated: Use TableDescriptor.ProtoReflect.Descriptor instead. -func (*TableDescriptor) Descriptor() ([]byte, []int) { - return file_cosmos_orm_v1_orm_proto_rawDescGZIP(), []int{0} -} - -func (x *TableDescriptor) GetPrimaryKey() *PrimaryKeyDescriptor { - if x != nil { - return x.PrimaryKey - } - return nil -} - -func (x *TableDescriptor) GetIndex() []*SecondaryIndexDescriptor { - if x != nil { - return x.Index - } - return nil -} - -func (x *TableDescriptor) GetId() uint32 { - if x != nil { - return x.Id - } - return 0 -} - -// PrimaryKeyDescriptor describes a table primary key. -type PrimaryKeyDescriptor struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // fields is a comma-separated list of fields in the primary key. Spaces are - // not allowed. Supported field types, their encodings, and any applicable constraints - // are described below. - // - uint32 are encoded as 2,3,4 or 5 bytes using a compact encoding that - // is suitable for sorted iteration (not varint encoding). This type is - // well-suited for small integers. - // - uint64 are encoded as 2,4,6 or 9 bytes using a compact encoding that - // is suitable for sorted iteration (not varint encoding). This type is - // well-suited for small integers such as auto-incrementing sequences. - // - fixed32, fixed64 are encoded as big-endian fixed width bytes and support - // sorted iteration. These types are well-suited for encoding fixed with - // decimals as integers. - // - string's are encoded as raw bytes in terminal key segments and null-terminated - // in non-terminal segments. Null characters are thus forbidden in strings. - // string fields support sorted iteration. - // - bytes are encoded as raw bytes in terminal segments and length-prefixed - // with a 32-bit unsigned varint in non-terminal segments. - // - int32, sint32, int64, sint64, sfixed32, sfixed64 are encoded as fixed width bytes with - // an encoding that enables sorted iteration. - // - google.protobuf.Timestamp is encoded such that values with only seconds occupy 6 bytes, - // values including nanos occupy 9 bytes, and nil values occupy 1 byte. When iterating, nil - // values will always be ordered last. Seconds and nanos values must conform to the officially - // specified ranges of 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z and 0 to 999,999,999 respectively. - // - google.protobuf.Duration is encoded as 12 bytes using an encoding that enables sorted iteration. - // - enum fields are encoded using varint encoding and do not support sorted - // iteration. - // - bool fields are encoded as a single byte 0 or 1. - // - // All other fields types are unsupported in keys including repeated and - // oneof fields. - // - // Primary keys are prefixed by the varint encoded table id and the byte 0x0 - // plus any additional prefix specified by the schema. - Fields string `protobuf:"bytes,1,opt,name=fields,proto3" json:"fields,omitempty"` - // auto_increment specifies that the primary key is generated by an - // auto-incrementing integer. If this is set to true fields must only - // contain one field of that is of type uint64. - AutoIncrement bool `protobuf:"varint,2,opt,name=auto_increment,json=autoIncrement,proto3" json:"auto_increment,omitempty"` -} - -func (x *PrimaryKeyDescriptor) Reset() { - *x = PrimaryKeyDescriptor{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_orm_v1_orm_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PrimaryKeyDescriptor) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PrimaryKeyDescriptor) ProtoMessage() {} - -// Deprecated: Use PrimaryKeyDescriptor.ProtoReflect.Descriptor instead. -func (*PrimaryKeyDescriptor) Descriptor() ([]byte, []int) { - return file_cosmos_orm_v1_orm_proto_rawDescGZIP(), []int{1} -} - -func (x *PrimaryKeyDescriptor) GetFields() string { - if x != nil { - return x.Fields - } - return "" -} - -func (x *PrimaryKeyDescriptor) GetAutoIncrement() bool { - if x != nil { - return x.AutoIncrement - } - return false -} - -// PrimaryKeyDescriptor describes a table secondary index. -type SecondaryIndexDescriptor struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // fields is a comma-separated list of fields in the index. The supported - // field types are the same as those for PrimaryKeyDescriptor.fields. - // Index keys are prefixed by the varint encoded table id and the varint - // encoded index id plus any additional prefix specified by the schema. - // - // In addition the field segments, non-unique index keys are suffixed with - // any additional primary key fields not present in the index fields so that the - // primary key can be reconstructed. Unique indexes instead of being suffixed - // store the remaining primary key fields in the value.. - Fields string `protobuf:"bytes,1,opt,name=fields,proto3" json:"fields,omitempty"` - // id is a non-zero integer ID that must be unique within the indexes for this - // table and less than 32768. It may be deprecated in the future when this can - // be auto-generated. - Id uint32 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` - // unique specifies that this an unique index. - Unique bool `protobuf:"varint,3,opt,name=unique,proto3" json:"unique,omitempty"` -} - -func (x *SecondaryIndexDescriptor) Reset() { - *x = SecondaryIndexDescriptor{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_orm_v1_orm_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SecondaryIndexDescriptor) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SecondaryIndexDescriptor) ProtoMessage() {} - -// Deprecated: Use SecondaryIndexDescriptor.ProtoReflect.Descriptor instead. -func (*SecondaryIndexDescriptor) Descriptor() ([]byte, []int) { - return file_cosmos_orm_v1_orm_proto_rawDescGZIP(), []int{2} -} - -func (x *SecondaryIndexDescriptor) GetFields() string { - if x != nil { - return x.Fields - } - return "" -} - -func (x *SecondaryIndexDescriptor) GetId() uint32 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *SecondaryIndexDescriptor) GetUnique() bool { - if x != nil { - return x.Unique - } - return false -} - -// TableDescriptor describes an ORM singleton table which has at most one instance. -type SingletonDescriptor struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // id is a non-zero integer ID that must be unique within the - // tables and singletons in this file. It may be deprecated in the future when this - // can be auto-generated. - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *SingletonDescriptor) Reset() { - *x = SingletonDescriptor{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_orm_v1_orm_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SingletonDescriptor) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SingletonDescriptor) ProtoMessage() {} - -// Deprecated: Use SingletonDescriptor.ProtoReflect.Descriptor instead. -func (*SingletonDescriptor) Descriptor() ([]byte, []int) { - return file_cosmos_orm_v1_orm_proto_rawDescGZIP(), []int{3} -} - -func (x *SingletonDescriptor) GetId() uint32 { - if x != nil { - return x.Id - } - return 0 -} - -var file_cosmos_orm_v1_orm_proto_extTypes = []protoimpl.ExtensionInfo{ - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*TableDescriptor)(nil), - Field: 104503790, - Name: "cosmos.orm.v1.table", - Tag: "bytes,104503790,opt,name=table", - Filename: "cosmos/orm/v1/orm.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*SingletonDescriptor)(nil), - Field: 104503791, - Name: "cosmos.orm.v1.singleton", - Tag: "bytes,104503791,opt,name=singleton", - Filename: "cosmos/orm/v1/orm.proto", - }, -} - -// Extension fields to descriptorpb.MessageOptions. -var ( - // table specifies that this message will be used as an ORM table. It cannot - // be used together with the singleton option. - // - // optional cosmos.orm.v1.TableDescriptor table = 104503790; - E_Table = &file_cosmos_orm_v1_orm_proto_extTypes[0] - // singleton specifies that this message will be used as an ORM singleton. It cannot - // be used together with the table option. - // - // optional cosmos.orm.v1.SingletonDescriptor singleton = 104503791; - E_Singleton = &file_cosmos_orm_v1_orm_proto_extTypes[1] -) - -var File_cosmos_orm_v1_orm_proto protoreflect.FileDescriptor - -var file_cosmos_orm_v1_orm_proto_rawDesc = []byte{ - 0x0a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6f, 0x72, 0x6d, 0x2f, 0x76, 0x31, 0x2f, - 0x6f, 0x72, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x6f, 0x72, 0x6d, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa6, 0x01, 0x0a, 0x0f, 0x54, - 0x61, 0x62, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x44, - 0x0a, 0x0b, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6f, 0x72, 0x6d, - 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x4b, 0x65, 0x79, 0x44, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x0a, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, - 0x79, 0x4b, 0x65, 0x79, 0x12, 0x3d, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6f, 0x72, 0x6d, - 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x61, 0x72, 0x79, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x05, 0x69, 0x6e, - 0x64, 0x65, 0x78, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x02, 0x69, 0x64, 0x22, 0x55, 0x0a, 0x14, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x4b, 0x65, - 0x79, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x66, - 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x65, - 0x6c, 0x64, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x6f, 0x5f, 0x69, 0x6e, 0x63, 0x72, - 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x61, 0x75, 0x74, - 0x6f, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x5a, 0x0a, 0x18, 0x53, 0x65, - 0x63, 0x6f, 0x6e, 0x64, 0x61, 0x72, 0x79, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x44, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, - 0x0a, 0x06, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, - 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x22, 0x25, 0x0a, 0x13, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, - 0x74, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x3a, 0x58, 0x0a, - 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xee, 0xb3, 0xea, 0x31, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6f, 0x72, 0x6d, 0x2e, 0x76, 0x31, - 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, - 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x3a, 0x64, 0x0a, 0x09, 0x73, 0x69, 0x6e, 0x67, 0x6c, - 0x65, 0x74, 0x6f, 0x6e, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xef, 0xb3, 0xea, 0x31, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, - 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6f, 0x72, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x53, - 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x74, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x6f, 0x72, 0x52, 0x09, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x74, 0x6f, 0x6e, 0x42, 0x99, 0x01, - 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6f, 0x72, 0x6d, - 0x2e, 0x76, 0x31, 0x42, 0x08, 0x4f, 0x72, 0x6d, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x24, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6f, 0x72, 0x6d, 0x2f, 0x76, 0x31, 0x3b, - 0x6f, 0x72, 0x6d, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x4f, 0x58, 0xaa, 0x02, 0x0d, 0x43, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x4f, 0x72, 0x6d, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x43, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x4f, 0x72, 0x6d, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x43, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x4f, 0x72, 0x6d, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x3a, 0x3a, 0x4f, 0x72, 0x6d, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, -} - -var ( - file_cosmos_orm_v1_orm_proto_rawDescOnce sync.Once - file_cosmos_orm_v1_orm_proto_rawDescData = file_cosmos_orm_v1_orm_proto_rawDesc -) - -func file_cosmos_orm_v1_orm_proto_rawDescGZIP() []byte { - file_cosmos_orm_v1_orm_proto_rawDescOnce.Do(func() { - file_cosmos_orm_v1_orm_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_orm_v1_orm_proto_rawDescData) - }) - return file_cosmos_orm_v1_orm_proto_rawDescData -} - -var file_cosmos_orm_v1_orm_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_cosmos_orm_v1_orm_proto_goTypes = []interface{}{ - (*TableDescriptor)(nil), // 0: cosmos.orm.v1.TableDescriptor - (*PrimaryKeyDescriptor)(nil), // 1: cosmos.orm.v1.PrimaryKeyDescriptor - (*SecondaryIndexDescriptor)(nil), // 2: cosmos.orm.v1.SecondaryIndexDescriptor - (*SingletonDescriptor)(nil), // 3: cosmos.orm.v1.SingletonDescriptor - (*descriptorpb.MessageOptions)(nil), // 4: google.protobuf.MessageOptions -} -var file_cosmos_orm_v1_orm_proto_depIdxs = []int32{ - 1, // 0: cosmos.orm.v1.TableDescriptor.primary_key:type_name -> cosmos.orm.v1.PrimaryKeyDescriptor - 2, // 1: cosmos.orm.v1.TableDescriptor.index:type_name -> cosmos.orm.v1.SecondaryIndexDescriptor - 4, // 2: cosmos.orm.v1.table:extendee -> google.protobuf.MessageOptions - 4, // 3: cosmos.orm.v1.singleton:extendee -> google.protobuf.MessageOptions - 0, // 4: cosmos.orm.v1.table:type_name -> cosmos.orm.v1.TableDescriptor - 3, // 5: cosmos.orm.v1.singleton:type_name -> cosmos.orm.v1.SingletonDescriptor - 6, // [6:6] is the sub-list for method output_type - 6, // [6:6] is the sub-list for method input_type - 4, // [4:6] is the sub-list for extension type_name - 2, // [2:4] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_cosmos_orm_v1_orm_proto_init() } -func file_cosmos_orm_v1_orm_proto_init() { - if File_cosmos_orm_v1_orm_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_cosmos_orm_v1_orm_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TableDescriptor); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cosmos_orm_v1_orm_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PrimaryKeyDescriptor); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cosmos_orm_v1_orm_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SecondaryIndexDescriptor); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cosmos_orm_v1_orm_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SingletonDescriptor); 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_cosmos_orm_v1_orm_proto_rawDesc, - NumEnums: 0, - NumMessages: 4, - NumExtensions: 2, - NumServices: 0, - }, - GoTypes: file_cosmos_orm_v1_orm_proto_goTypes, - DependencyIndexes: file_cosmos_orm_v1_orm_proto_depIdxs, - MessageInfos: file_cosmos_orm_v1_orm_proto_msgTypes, - ExtensionInfos: file_cosmos_orm_v1_orm_proto_extTypes, - }.Build() - File_cosmos_orm_v1_orm_proto = out.File - file_cosmos_orm_v1_orm_proto_rawDesc = nil - file_cosmos_orm_v1_orm_proto_goTypes = nil - file_cosmos_orm_v1_orm_proto_depIdxs = nil -} diff --git a/api/cosmos/orm/v1alpha1/schema.pulsar.go b/api/cosmos/orm/v1alpha1/schema.pulsar.go deleted file mode 100644 index 039be750866b..000000000000 --- a/api/cosmos/orm/v1alpha1/schema.pulsar.go +++ /dev/null @@ -1,1431 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package ormv1alpha1 - -import ( - 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" - descriptorpb "google.golang.org/protobuf/types/descriptorpb" - io "io" - reflect "reflect" - sync "sync" -) - -var _ protoreflect.List = (*_ModuleSchemaDescriptor_1_list)(nil) - -type _ModuleSchemaDescriptor_1_list struct { - list *[]*ModuleSchemaDescriptor_FileEntry -} - -func (x *_ModuleSchemaDescriptor_1_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_ModuleSchemaDescriptor_1_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_ModuleSchemaDescriptor_1_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*ModuleSchemaDescriptor_FileEntry) - (*x.list)[i] = concreteValue -} - -func (x *_ModuleSchemaDescriptor_1_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*ModuleSchemaDescriptor_FileEntry) - *x.list = append(*x.list, concreteValue) -} - -func (x *_ModuleSchemaDescriptor_1_list) AppendMutable() protoreflect.Value { - v := new(ModuleSchemaDescriptor_FileEntry) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_ModuleSchemaDescriptor_1_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_ModuleSchemaDescriptor_1_list) NewElement() protoreflect.Value { - v := new(ModuleSchemaDescriptor_FileEntry) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_ModuleSchemaDescriptor_1_list) IsValid() bool { - return x.list != nil -} - -var ( - md_ModuleSchemaDescriptor protoreflect.MessageDescriptor - fd_ModuleSchemaDescriptor_schema_file protoreflect.FieldDescriptor - fd_ModuleSchemaDescriptor_prefix protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_orm_v1alpha1_schema_proto_init() - md_ModuleSchemaDescriptor = File_cosmos_orm_v1alpha1_schema_proto.Messages().ByName("ModuleSchemaDescriptor") - fd_ModuleSchemaDescriptor_schema_file = md_ModuleSchemaDescriptor.Fields().ByName("schema_file") - fd_ModuleSchemaDescriptor_prefix = md_ModuleSchemaDescriptor.Fields().ByName("prefix") -} - -var _ protoreflect.Message = (*fastReflection_ModuleSchemaDescriptor)(nil) - -type fastReflection_ModuleSchemaDescriptor ModuleSchemaDescriptor - -func (x *ModuleSchemaDescriptor) ProtoReflect() protoreflect.Message { - return (*fastReflection_ModuleSchemaDescriptor)(x) -} - -func (x *ModuleSchemaDescriptor) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_orm_v1alpha1_schema_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_ModuleSchemaDescriptor_messageType fastReflection_ModuleSchemaDescriptor_messageType -var _ protoreflect.MessageType = fastReflection_ModuleSchemaDescriptor_messageType{} - -type fastReflection_ModuleSchemaDescriptor_messageType struct{} - -func (x fastReflection_ModuleSchemaDescriptor_messageType) Zero() protoreflect.Message { - return (*fastReflection_ModuleSchemaDescriptor)(nil) -} -func (x fastReflection_ModuleSchemaDescriptor_messageType) New() protoreflect.Message { - return new(fastReflection_ModuleSchemaDescriptor) -} -func (x fastReflection_ModuleSchemaDescriptor_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_ModuleSchemaDescriptor -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_ModuleSchemaDescriptor) Descriptor() protoreflect.MessageDescriptor { - return md_ModuleSchemaDescriptor -} - -// 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_ModuleSchemaDescriptor) Type() protoreflect.MessageType { - return _fastReflection_ModuleSchemaDescriptor_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_ModuleSchemaDescriptor) New() protoreflect.Message { - return new(fastReflection_ModuleSchemaDescriptor) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_ModuleSchemaDescriptor) Interface() protoreflect.ProtoMessage { - return (*ModuleSchemaDescriptor)(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_ModuleSchemaDescriptor) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.SchemaFile) != 0 { - value := protoreflect.ValueOfList(&_ModuleSchemaDescriptor_1_list{list: &x.SchemaFile}) - if !f(fd_ModuleSchemaDescriptor_schema_file, value) { - return - } - } - if len(x.Prefix) != 0 { - value := protoreflect.ValueOfBytes(x.Prefix) - if !f(fd_ModuleSchemaDescriptor_prefix, 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_ModuleSchemaDescriptor) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.orm.v1alpha1.ModuleSchemaDescriptor.schema_file": - return len(x.SchemaFile) != 0 - case "cosmos.orm.v1alpha1.ModuleSchemaDescriptor.prefix": - return len(x.Prefix) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.v1alpha1.ModuleSchemaDescriptor")) - } - panic(fmt.Errorf("message cosmos.orm.v1alpha1.ModuleSchemaDescriptor 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_ModuleSchemaDescriptor) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.orm.v1alpha1.ModuleSchemaDescriptor.schema_file": - x.SchemaFile = nil - case "cosmos.orm.v1alpha1.ModuleSchemaDescriptor.prefix": - x.Prefix = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.v1alpha1.ModuleSchemaDescriptor")) - } - panic(fmt.Errorf("message cosmos.orm.v1alpha1.ModuleSchemaDescriptor 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_ModuleSchemaDescriptor) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.orm.v1alpha1.ModuleSchemaDescriptor.schema_file": - if len(x.SchemaFile) == 0 { - return protoreflect.ValueOfList(&_ModuleSchemaDescriptor_1_list{}) - } - listValue := &_ModuleSchemaDescriptor_1_list{list: &x.SchemaFile} - return protoreflect.ValueOfList(listValue) - case "cosmos.orm.v1alpha1.ModuleSchemaDescriptor.prefix": - value := x.Prefix - return protoreflect.ValueOfBytes(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.v1alpha1.ModuleSchemaDescriptor")) - } - panic(fmt.Errorf("message cosmos.orm.v1alpha1.ModuleSchemaDescriptor 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_ModuleSchemaDescriptor) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.orm.v1alpha1.ModuleSchemaDescriptor.schema_file": - lv := value.List() - clv := lv.(*_ModuleSchemaDescriptor_1_list) - x.SchemaFile = *clv.list - case "cosmos.orm.v1alpha1.ModuleSchemaDescriptor.prefix": - x.Prefix = value.Bytes() - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.v1alpha1.ModuleSchemaDescriptor")) - } - panic(fmt.Errorf("message cosmos.orm.v1alpha1.ModuleSchemaDescriptor 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_ModuleSchemaDescriptor) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.orm.v1alpha1.ModuleSchemaDescriptor.schema_file": - if x.SchemaFile == nil { - x.SchemaFile = []*ModuleSchemaDescriptor_FileEntry{} - } - value := &_ModuleSchemaDescriptor_1_list{list: &x.SchemaFile} - return protoreflect.ValueOfList(value) - case "cosmos.orm.v1alpha1.ModuleSchemaDescriptor.prefix": - panic(fmt.Errorf("field prefix of message cosmos.orm.v1alpha1.ModuleSchemaDescriptor is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.v1alpha1.ModuleSchemaDescriptor")) - } - panic(fmt.Errorf("message cosmos.orm.v1alpha1.ModuleSchemaDescriptor 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_ModuleSchemaDescriptor) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.orm.v1alpha1.ModuleSchemaDescriptor.schema_file": - list := []*ModuleSchemaDescriptor_FileEntry{} - return protoreflect.ValueOfList(&_ModuleSchemaDescriptor_1_list{list: &list}) - case "cosmos.orm.v1alpha1.ModuleSchemaDescriptor.prefix": - return protoreflect.ValueOfBytes(nil) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.v1alpha1.ModuleSchemaDescriptor")) - } - panic(fmt.Errorf("message cosmos.orm.v1alpha1.ModuleSchemaDescriptor 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_ModuleSchemaDescriptor) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.orm.v1alpha1.ModuleSchemaDescriptor", 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_ModuleSchemaDescriptor) 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_ModuleSchemaDescriptor) 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_ModuleSchemaDescriptor) 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_ModuleSchemaDescriptor) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*ModuleSchemaDescriptor) - 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.SchemaFile) > 0 { - for _, e := range x.SchemaFile { - l = options.Size(e) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - l = len(x.Prefix) - 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().(*ModuleSchemaDescriptor) - 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.Prefix) > 0 { - i -= len(x.Prefix) - copy(dAtA[i:], x.Prefix) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Prefix))) - i-- - dAtA[i] = 0x12 - } - if len(x.SchemaFile) > 0 { - for iNdEx := len(x.SchemaFile) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.SchemaFile[iNdEx]) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0xa - } - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*ModuleSchemaDescriptor) - 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: ModuleSchemaDescriptor: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ModuleSchemaDescriptor: 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 SchemaFile", 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.SchemaFile = append(x.SchemaFile, &ModuleSchemaDescriptor_FileEntry{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.SchemaFile[len(x.SchemaFile)-1]); err != nil { - 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 Prefix", 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.Prefix = append(x.Prefix[:0], dAtA[iNdEx:postIndex]...) - if x.Prefix == nil { - x.Prefix = []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 ( - md_ModuleSchemaDescriptor_FileEntry protoreflect.MessageDescriptor - fd_ModuleSchemaDescriptor_FileEntry_id protoreflect.FieldDescriptor - fd_ModuleSchemaDescriptor_FileEntry_proto_file_name protoreflect.FieldDescriptor - fd_ModuleSchemaDescriptor_FileEntry_storage_type protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_orm_v1alpha1_schema_proto_init() - md_ModuleSchemaDescriptor_FileEntry = File_cosmos_orm_v1alpha1_schema_proto.Messages().ByName("ModuleSchemaDescriptor").Messages().ByName("FileEntry") - fd_ModuleSchemaDescriptor_FileEntry_id = md_ModuleSchemaDescriptor_FileEntry.Fields().ByName("id") - fd_ModuleSchemaDescriptor_FileEntry_proto_file_name = md_ModuleSchemaDescriptor_FileEntry.Fields().ByName("proto_file_name") - fd_ModuleSchemaDescriptor_FileEntry_storage_type = md_ModuleSchemaDescriptor_FileEntry.Fields().ByName("storage_type") -} - -var _ protoreflect.Message = (*fastReflection_ModuleSchemaDescriptor_FileEntry)(nil) - -type fastReflection_ModuleSchemaDescriptor_FileEntry ModuleSchemaDescriptor_FileEntry - -func (x *ModuleSchemaDescriptor_FileEntry) ProtoReflect() protoreflect.Message { - return (*fastReflection_ModuleSchemaDescriptor_FileEntry)(x) -} - -func (x *ModuleSchemaDescriptor_FileEntry) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_orm_v1alpha1_schema_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_ModuleSchemaDescriptor_FileEntry_messageType fastReflection_ModuleSchemaDescriptor_FileEntry_messageType -var _ protoreflect.MessageType = fastReflection_ModuleSchemaDescriptor_FileEntry_messageType{} - -type fastReflection_ModuleSchemaDescriptor_FileEntry_messageType struct{} - -func (x fastReflection_ModuleSchemaDescriptor_FileEntry_messageType) Zero() protoreflect.Message { - return (*fastReflection_ModuleSchemaDescriptor_FileEntry)(nil) -} -func (x fastReflection_ModuleSchemaDescriptor_FileEntry_messageType) New() protoreflect.Message { - return new(fastReflection_ModuleSchemaDescriptor_FileEntry) -} -func (x fastReflection_ModuleSchemaDescriptor_FileEntry_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_ModuleSchemaDescriptor_FileEntry -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_ModuleSchemaDescriptor_FileEntry) Descriptor() protoreflect.MessageDescriptor { - return md_ModuleSchemaDescriptor_FileEntry -} - -// 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_ModuleSchemaDescriptor_FileEntry) Type() protoreflect.MessageType { - return _fastReflection_ModuleSchemaDescriptor_FileEntry_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_ModuleSchemaDescriptor_FileEntry) New() protoreflect.Message { - return new(fastReflection_ModuleSchemaDescriptor_FileEntry) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_ModuleSchemaDescriptor_FileEntry) Interface() protoreflect.ProtoMessage { - return (*ModuleSchemaDescriptor_FileEntry)(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_ModuleSchemaDescriptor_FileEntry) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Id != uint32(0) { - value := protoreflect.ValueOfUint32(x.Id) - if !f(fd_ModuleSchemaDescriptor_FileEntry_id, value) { - return - } - } - if x.ProtoFileName != "" { - value := protoreflect.ValueOfString(x.ProtoFileName) - if !f(fd_ModuleSchemaDescriptor_FileEntry_proto_file_name, value) { - return - } - } - if x.StorageType != 0 { - value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.StorageType)) - if !f(fd_ModuleSchemaDescriptor_FileEntry_storage_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_ModuleSchemaDescriptor_FileEntry) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry.id": - return x.Id != uint32(0) - case "cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry.proto_file_name": - return x.ProtoFileName != "" - case "cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry.storage_type": - return x.StorageType != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry")) - } - panic(fmt.Errorf("message cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry 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_ModuleSchemaDescriptor_FileEntry) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry.id": - x.Id = uint32(0) - case "cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry.proto_file_name": - x.ProtoFileName = "" - case "cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry.storage_type": - x.StorageType = 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry")) - } - panic(fmt.Errorf("message cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry 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_ModuleSchemaDescriptor_FileEntry) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry.id": - value := x.Id - return protoreflect.ValueOfUint32(value) - case "cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry.proto_file_name": - value := x.ProtoFileName - return protoreflect.ValueOfString(value) - case "cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry.storage_type": - value := x.StorageType - return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry")) - } - panic(fmt.Errorf("message cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry 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_ModuleSchemaDescriptor_FileEntry) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry.id": - x.Id = uint32(value.Uint()) - case "cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry.proto_file_name": - x.ProtoFileName = value.Interface().(string) - case "cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry.storage_type": - x.StorageType = (StorageType)(value.Enum()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry")) - } - panic(fmt.Errorf("message cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry 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_ModuleSchemaDescriptor_FileEntry) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry.id": - panic(fmt.Errorf("field id of message cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry is not mutable")) - case "cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry.proto_file_name": - panic(fmt.Errorf("field proto_file_name of message cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry is not mutable")) - case "cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry.storage_type": - panic(fmt.Errorf("field storage_type of message cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry")) - } - panic(fmt.Errorf("message cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry 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_ModuleSchemaDescriptor_FileEntry) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry.id": - return protoreflect.ValueOfUint32(uint32(0)) - case "cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry.proto_file_name": - return protoreflect.ValueOfString("") - case "cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry.storage_type": - return protoreflect.ValueOfEnum(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry")) - } - panic(fmt.Errorf("message cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry 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_ModuleSchemaDescriptor_FileEntry) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry", 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_ModuleSchemaDescriptor_FileEntry) 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_ModuleSchemaDescriptor_FileEntry) 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_ModuleSchemaDescriptor_FileEntry) 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_ModuleSchemaDescriptor_FileEntry) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*ModuleSchemaDescriptor_FileEntry) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.Id != 0 { - n += 1 + runtime.Sov(uint64(x.Id)) - } - l = len(x.ProtoFileName) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.StorageType != 0 { - n += 1 + runtime.Sov(uint64(x.StorageType)) - } - 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().(*ModuleSchemaDescriptor_FileEntry) - 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.StorageType != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.StorageType)) - i-- - dAtA[i] = 0x18 - } - if len(x.ProtoFileName) > 0 { - i -= len(x.ProtoFileName) - copy(dAtA[i:], x.ProtoFileName) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ProtoFileName))) - i-- - dAtA[i] = 0x12 - } - if x.Id != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Id)) - i-- - dAtA[i] = 0x8 - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*ModuleSchemaDescriptor_FileEntry) - 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: ModuleSchemaDescriptor_FileEntry: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ModuleSchemaDescriptor_FileEntry: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - x.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - x.Id |= uint32(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 ProtoFileName", 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.ProtoFileName = 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 StorageType", wireType) - } - x.StorageType = 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.StorageType |= StorageType(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, - } -} - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.0 -// protoc (unknown) -// source: cosmos/orm/v1alpha1/schema.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) -) - -// StorageType -type StorageType int32 - -const ( - // STORAGE_TYPE_DEFAULT_UNSPECIFIED indicates the persistent storage where all - // data is stored in the regular Merkle-tree backed KV-store. - StorageType_STORAGE_TYPE_DEFAULT_UNSPECIFIED StorageType = 0 - // STORAGE_TYPE_MEMORY indicates in-memory storage that will be - // reloaded every time an app restarts. Tables with this type of storage - // will by default be ignored when importing and exporting a module's - // state from JSON. - StorageType_STORAGE_TYPE_MEMORY StorageType = 1 - // STORAGE_TYPE_TRANSIENT indicates transient storage that is reset - // at the end of every block. Tables with this type of storage - // will by default be ignored when importing and exporting a module's - // state from JSON. - StorageType_STORAGE_TYPE_TRANSIENT StorageType = 2 -) - -// Enum value maps for StorageType. -var ( - StorageType_name = map[int32]string{ - 0: "STORAGE_TYPE_DEFAULT_UNSPECIFIED", - 1: "STORAGE_TYPE_MEMORY", - 2: "STORAGE_TYPE_TRANSIENT", - } - StorageType_value = map[string]int32{ - "STORAGE_TYPE_DEFAULT_UNSPECIFIED": 0, - "STORAGE_TYPE_MEMORY": 1, - "STORAGE_TYPE_TRANSIENT": 2, - } -) - -func (x StorageType) Enum() *StorageType { - p := new(StorageType) - *p = x - return p -} - -func (x StorageType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (StorageType) Descriptor() protoreflect.EnumDescriptor { - return file_cosmos_orm_v1alpha1_schema_proto_enumTypes[0].Descriptor() -} - -func (StorageType) Type() protoreflect.EnumType { - return &file_cosmos_orm_v1alpha1_schema_proto_enumTypes[0] -} - -func (x StorageType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use StorageType.Descriptor instead. -func (StorageType) EnumDescriptor() ([]byte, []int) { - return file_cosmos_orm_v1alpha1_schema_proto_rawDescGZIP(), []int{0} -} - -// ModuleSchemaDescriptor describe's a module's ORM schema. -type ModuleSchemaDescriptor struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SchemaFile []*ModuleSchemaDescriptor_FileEntry `protobuf:"bytes,1,rep,name=schema_file,json=schemaFile,proto3" json:"schema_file,omitempty"` - // prefix is an optional prefix that precedes all keys in this module's - // store. - Prefix []byte `protobuf:"bytes,2,opt,name=prefix,proto3" json:"prefix,omitempty"` -} - -func (x *ModuleSchemaDescriptor) Reset() { - *x = ModuleSchemaDescriptor{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_orm_v1alpha1_schema_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ModuleSchemaDescriptor) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ModuleSchemaDescriptor) ProtoMessage() {} - -// Deprecated: Use ModuleSchemaDescriptor.ProtoReflect.Descriptor instead. -func (*ModuleSchemaDescriptor) Descriptor() ([]byte, []int) { - return file_cosmos_orm_v1alpha1_schema_proto_rawDescGZIP(), []int{0} -} - -func (x *ModuleSchemaDescriptor) GetSchemaFile() []*ModuleSchemaDescriptor_FileEntry { - if x != nil { - return x.SchemaFile - } - return nil -} - -func (x *ModuleSchemaDescriptor) GetPrefix() []byte { - if x != nil { - return x.Prefix - } - return nil -} - -// FileEntry describes an ORM file used in a module. -type ModuleSchemaDescriptor_FileEntry struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // id is a prefix that will be varint encoded and prepended to all the - // table keys specified in the file's tables. - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - // proto_file_name is the name of a file .proto in that contains - // table definitions. The .proto file must be in a package that the - // module has referenced using cosmos.app.v1.ModuleDescriptor.use_package. - ProtoFileName string `protobuf:"bytes,2,opt,name=proto_file_name,json=protoFileName,proto3" json:"proto_file_name,omitempty"` - // storage_type optionally indicates the type of storage this file's - // tables should used. If it is left unspecified, the default KV-storage - // of the app will be used. - StorageType StorageType `protobuf:"varint,3,opt,name=storage_type,json=storageType,proto3,enum=cosmos.orm.v1alpha1.StorageType" json:"storage_type,omitempty"` -} - -func (x *ModuleSchemaDescriptor_FileEntry) Reset() { - *x = ModuleSchemaDescriptor_FileEntry{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_orm_v1alpha1_schema_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ModuleSchemaDescriptor_FileEntry) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ModuleSchemaDescriptor_FileEntry) ProtoMessage() {} - -// Deprecated: Use ModuleSchemaDescriptor_FileEntry.ProtoReflect.Descriptor instead. -func (*ModuleSchemaDescriptor_FileEntry) Descriptor() ([]byte, []int) { - return file_cosmos_orm_v1alpha1_schema_proto_rawDescGZIP(), []int{0, 0} -} - -func (x *ModuleSchemaDescriptor_FileEntry) GetId() uint32 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *ModuleSchemaDescriptor_FileEntry) GetProtoFileName() string { - if x != nil { - return x.ProtoFileName - } - return "" -} - -func (x *ModuleSchemaDescriptor_FileEntry) GetStorageType() StorageType { - if x != nil { - return x.StorageType - } - return StorageType_STORAGE_TYPE_DEFAULT_UNSPECIFIED -} - -var file_cosmos_orm_v1alpha1_schema_proto_extTypes = []protoimpl.ExtensionInfo{ - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*ModuleSchemaDescriptor)(nil), - Field: 104503792, - Name: "cosmos.orm.v1alpha1.module_schema", - Tag: "bytes,104503792,opt,name=module_schema", - Filename: "cosmos/orm/v1alpha1/schema.proto", - }, -} - -// Extension fields to descriptorpb.MessageOptions. -var ( - // module_schema is used to define the ORM schema for an app module. - // All module config messages that use module_schema must also declare - // themselves as app module config messages using the cosmos.app.v1.is_module - // option. - // - // optional cosmos.orm.v1alpha1.ModuleSchemaDescriptor module_schema = 104503792; - E_ModuleSchema = &file_cosmos_orm_v1alpha1_schema_proto_extTypes[0] -) - -var File_cosmos_orm_v1alpha1_schema_proto protoreflect.FileDescriptor - -var file_cosmos_orm_v1alpha1_schema_proto_rawDesc = []byte{ - 0x0a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6f, 0x72, 0x6d, 0x2f, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x13, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6f, 0x72, 0x6d, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x93, 0x02, 0x0a, 0x16, 0x4d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x6f, 0x72, 0x12, 0x56, 0x0a, 0x0b, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x66, - 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x6f, 0x72, 0x6d, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x52, 0x0a, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x70, 0x72, - 0x65, 0x66, 0x69, 0x78, 0x1a, 0x88, 0x01, 0x0a, 0x09, 0x46, 0x69, 0x6c, 0x65, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, - 0x69, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x66, 0x69, 0x6c, 0x65, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x46, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x43, 0x0a, 0x0c, 0x73, 0x74, - 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6f, 0x72, 0x6d, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x54, 0x79, - 0x70, 0x65, 0x52, 0x0b, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x2a, - 0x68, 0x0a, 0x0b, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x24, - 0x0a, 0x20, 0x53, 0x54, 0x4f, 0x52, 0x41, 0x47, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, - 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, - 0x45, 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x53, 0x54, 0x4f, 0x52, 0x41, 0x47, 0x45, 0x5f, - 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x4d, 0x4f, 0x52, 0x59, 0x10, 0x01, 0x12, 0x1a, 0x0a, - 0x16, 0x53, 0x54, 0x4f, 0x52, 0x41, 0x47, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x54, 0x52, - 0x41, 0x4e, 0x53, 0x49, 0x45, 0x4e, 0x54, 0x10, 0x02, 0x3a, 0x74, 0x0a, 0x0d, 0x6d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xf0, 0xb3, 0xea, 0x31, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6f, 0x72, - 0x6d, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, - 0x72, 0x52, 0x0c, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x42, - 0xc6, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6f, - 0x72, 0x6d, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0b, 0x53, 0x63, 0x68, - 0x65, 0x6d, 0x61, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x6f, 0x72, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x3b, 0x6f, 0x72, 0x6d, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, - 0x4f, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x4f, 0x72, 0x6d, 0x2e, - 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x5c, 0x4f, 0x72, 0x6d, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, - 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x4f, 0x72, 0x6d, 0x5c, 0x56, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0xea, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x4f, 0x72, 0x6d, 0x3a, 0x3a, - 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_cosmos_orm_v1alpha1_schema_proto_rawDescOnce sync.Once - file_cosmos_orm_v1alpha1_schema_proto_rawDescData = file_cosmos_orm_v1alpha1_schema_proto_rawDesc -) - -func file_cosmos_orm_v1alpha1_schema_proto_rawDescGZIP() []byte { - file_cosmos_orm_v1alpha1_schema_proto_rawDescOnce.Do(func() { - file_cosmos_orm_v1alpha1_schema_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_orm_v1alpha1_schema_proto_rawDescData) - }) - return file_cosmos_orm_v1alpha1_schema_proto_rawDescData -} - -var file_cosmos_orm_v1alpha1_schema_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_cosmos_orm_v1alpha1_schema_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_cosmos_orm_v1alpha1_schema_proto_goTypes = []interface{}{ - (StorageType)(0), // 0: cosmos.orm.v1alpha1.StorageType - (*ModuleSchemaDescriptor)(nil), // 1: cosmos.orm.v1alpha1.ModuleSchemaDescriptor - (*ModuleSchemaDescriptor_FileEntry)(nil), // 2: cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry - (*descriptorpb.MessageOptions)(nil), // 3: google.protobuf.MessageOptions -} -var file_cosmos_orm_v1alpha1_schema_proto_depIdxs = []int32{ - 2, // 0: cosmos.orm.v1alpha1.ModuleSchemaDescriptor.schema_file:type_name -> cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry - 0, // 1: cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry.storage_type:type_name -> cosmos.orm.v1alpha1.StorageType - 3, // 2: cosmos.orm.v1alpha1.module_schema:extendee -> google.protobuf.MessageOptions - 1, // 3: cosmos.orm.v1alpha1.module_schema:type_name -> cosmos.orm.v1alpha1.ModuleSchemaDescriptor - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 3, // [3:4] is the sub-list for extension type_name - 2, // [2:3] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_cosmos_orm_v1alpha1_schema_proto_init() } -func file_cosmos_orm_v1alpha1_schema_proto_init() { - if File_cosmos_orm_v1alpha1_schema_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_cosmos_orm_v1alpha1_schema_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ModuleSchemaDescriptor); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cosmos_orm_v1alpha1_schema_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ModuleSchemaDescriptor_FileEntry); 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_cosmos_orm_v1alpha1_schema_proto_rawDesc, - NumEnums: 1, - NumMessages: 2, - NumExtensions: 1, - NumServices: 0, - }, - GoTypes: file_cosmos_orm_v1alpha1_schema_proto_goTypes, - DependencyIndexes: file_cosmos_orm_v1alpha1_schema_proto_depIdxs, - EnumInfos: file_cosmos_orm_v1alpha1_schema_proto_enumTypes, - MessageInfos: file_cosmos_orm_v1alpha1_schema_proto_msgTypes, - ExtensionInfos: file_cosmos_orm_v1alpha1_schema_proto_extTypes, - }.Build() - File_cosmos_orm_v1alpha1_schema_proto = out.File - file_cosmos_orm_v1alpha1_schema_proto_rawDesc = nil - file_cosmos_orm_v1alpha1_schema_proto_goTypes = nil - file_cosmos_orm_v1alpha1_schema_proto_depIdxs = nil -} diff --git a/api/cosmos/params/v1beta1/params.pulsar.go b/api/cosmos/params/v1beta1/params.pulsar.go index c3ce9ddd1e42..d91dee991f64 100644 --- a/api/cosmos/params/v1beta1/params.pulsar.go +++ b/api/cosmos/params/v1beta1/params.pulsar.go @@ -1333,21 +1333,21 @@ var file_cosmos_params_v1beta1_params_proto_rawDesc = []byte{ 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x75, 0x62, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0xd8, 0x01, 0x0a, 0x19, 0x63, - 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, - 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, - 0x43, 0x50, 0x58, 0xaa, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x15, 0x43, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x5c, 0x56, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0xe2, 0x02, 0x21, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x17, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x3a, 0x3a, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0xa8, 0xe2, 0x1e, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0xd8, 0x01, 0xa8, 0xe2, 0x1e, + 0x01, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0b, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x3b, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0xa2, 0x02, 0x03, 0x43, 0x50, 0x58, 0xaa, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, + 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x5c, + 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x21, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x5c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x17, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/params/v1beta1/query_grpc.pb.go b/api/cosmos/params/v1beta1/query_grpc.pb.go index 5825a3b6cb46..802465ff2093 100644 --- a/api/cosmos/params/v1beta1/query_grpc.pb.go +++ b/api/cosmos/params/v1beta1/query_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/params/v1beta1/query.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Query_Params_FullMethodName = "/cosmos.params.v1beta1.Query/Params" @@ -26,6 +26,8 @@ const ( // QueryClient is the client API for Query service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Query defines the gRPC querier service. type QueryClient interface { // Params queries a specific parameter of a module, given its subspace and // key. @@ -45,8 +47,9 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { } func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -54,8 +57,9 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . } func (c *queryClient) Subspaces(ctx context.Context, in *QuerySubspacesRequest, opts ...grpc.CallOption) (*QuerySubspacesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QuerySubspacesResponse) - err := c.cc.Invoke(ctx, Query_Subspaces_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Subspaces_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -64,7 +68,9 @@ func (c *queryClient) Subspaces(ctx context.Context, in *QuerySubspacesRequest, // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer -// for forward compatibility +// for forward compatibility. +// +// Query defines the gRPC querier service. type QueryServer interface { // Params queries a specific parameter of a module, given its subspace and // key. @@ -76,9 +82,12 @@ type QueryServer interface { mustEmbedUnimplementedQueryServer() } -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} +// UnimplementedQueryServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedQueryServer struct{} func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") @@ -87,6 +96,7 @@ func (UnimplementedQueryServer) Subspaces(context.Context, *QuerySubspacesReques return nil, status.Errorf(codes.Unimplemented, "method Subspaces not implemented") } func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} +func (UnimplementedQueryServer) testEmbeddedByValue() {} // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to QueryServer will @@ -96,6 +106,13 @@ type UnsafeQueryServer interface { } func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + // If the following call pancis, it indicates UnimplementedQueryServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Query_ServiceDesc, srv) } diff --git a/api/cosmos/reflection/v1/reflection_grpc.pb.go b/api/cosmos/reflection/v1/reflection_grpc.pb.go index eddbc82a0e61..a559d048d3a0 100644 --- a/api/cosmos/reflection/v1/reflection_grpc.pb.go +++ b/api/cosmos/reflection/v1/reflection_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/reflection/v1/reflection.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( ReflectionService_FileDescriptors_FullMethodName = "/cosmos.reflection.v1.ReflectionService/FileDescriptors" @@ -25,6 +25,9 @@ const ( // ReflectionServiceClient is the client API for ReflectionService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Package cosmos.reflection.v1 provides support for inspecting protobuf +// file descriptors. type ReflectionServiceClient interface { // FileDescriptors queries all the file descriptors in the app in order // to enable easier generation of dynamic clients. @@ -40,8 +43,9 @@ func NewReflectionServiceClient(cc grpc.ClientConnInterface) ReflectionServiceCl } func (c *reflectionServiceClient) FileDescriptors(ctx context.Context, in *FileDescriptorsRequest, opts ...grpc.CallOption) (*FileDescriptorsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(FileDescriptorsResponse) - err := c.cc.Invoke(ctx, ReflectionService_FileDescriptors_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ReflectionService_FileDescriptors_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -50,7 +54,10 @@ func (c *reflectionServiceClient) FileDescriptors(ctx context.Context, in *FileD // ReflectionServiceServer is the server API for ReflectionService service. // All implementations must embed UnimplementedReflectionServiceServer -// for forward compatibility +// for forward compatibility. +// +// Package cosmos.reflection.v1 provides support for inspecting protobuf +// file descriptors. type ReflectionServiceServer interface { // FileDescriptors queries all the file descriptors in the app in order // to enable easier generation of dynamic clients. @@ -58,14 +65,18 @@ type ReflectionServiceServer interface { mustEmbedUnimplementedReflectionServiceServer() } -// UnimplementedReflectionServiceServer must be embedded to have forward compatible implementations. -type UnimplementedReflectionServiceServer struct { -} +// UnimplementedReflectionServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedReflectionServiceServer struct{} func (UnimplementedReflectionServiceServer) FileDescriptors(context.Context, *FileDescriptorsRequest) (*FileDescriptorsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method FileDescriptors not implemented") } func (UnimplementedReflectionServiceServer) mustEmbedUnimplementedReflectionServiceServer() {} +func (UnimplementedReflectionServiceServer) testEmbeddedByValue() {} // UnsafeReflectionServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to ReflectionServiceServer will @@ -75,6 +86,13 @@ type UnsafeReflectionServiceServer interface { } func RegisterReflectionServiceServer(s grpc.ServiceRegistrar, srv ReflectionServiceServer) { + // If the following call pancis, it indicates UnimplementedReflectionServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&ReflectionService_ServiceDesc, srv) } diff --git a/api/cosmos/slashing/v1beta1/query.pulsar.go b/api/cosmos/slashing/v1beta1/query.pulsar.go index b28562b40da5..8e8c60e51e36 100644 --- a/api/cosmos/slashing/v1beta1/query.pulsar.go +++ b/api/cosmos/slashing/v1beta1/query.pulsar.go @@ -2931,84 +2931,84 @@ var file_cosmos_slashing_v1beta1_query_proto_rawDesc = []byte{ 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x56, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x69, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x5f, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x3b, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x73, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 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, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x7e, 0x0a, - 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, - 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x62, 0x0a, 0x10, 0x76, 0x61, 0x6c, - 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x6c, 0x61, - 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x49, 0x6e, - 0x66, 0x6f, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0e, 0x76, - 0x61, 0x6c, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x62, 0x0a, - 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, - 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, - 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x22, 0xb2, 0x01, 0x0a, 0x19, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x69, 0x67, 0x6e, 0x69, - 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x4c, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x09, 0xc8, 0xde, - 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x47, 0x0a, - 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, - 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, - 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0xf2, 0x03, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x12, 0x8c, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2b, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x12, 0x1f, - 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, - 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, - 0xb1, 0x01, 0x0a, 0x0b, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x12, - 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, - 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, - 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, + 0x12, 0x44, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x73, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x7e, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, + 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x62, 0x0a, 0x10, 0x76, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, + 0x67, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x09, 0xc8, 0xde, 0x1f, + 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x53, 0x69, 0x67, 0x6e, 0x69, + 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x62, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, + 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, + 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xb2, 0x01, 0x0a, 0x19, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, + 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, + 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, + 0xf2, 0x03, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x8c, 0x01, 0x0a, 0x06, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x6c, + 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x37, 0x12, 0x35, 0x2f, 0x63, + 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x12, 0x1f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0xb1, 0x01, 0x0a, 0x0b, 0x53, 0x69, 0x67, + 0x6e, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, + 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x37, 0x12, 0x35, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, + 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, + 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x73, 0x2f, 0x7b, 0x63, + 0x6f, 0x6e, 0x73, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, 0xa5, 0x01, 0x0a, + 0x0c, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x12, 0x31, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x69, 0x67, + 0x6e, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x32, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, + 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x69, - 0x6e, 0x66, 0x6f, 0x73, 0x2f, 0x7b, 0x63, 0x6f, 0x6e, 0x73, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x7d, 0x12, 0xa5, 0x01, 0x0a, 0x0c, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x49, - 0x6e, 0x66, 0x6f, 0x73, 0x12, 0x31, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x6c, - 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x49, 0x6e, - 0x66, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x6c, 0x61, - 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x73, 0x69, - 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x73, 0x42, 0xe1, 0x01, 0x0a, 0x1b, - 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, - 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x38, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x3b, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x53, 0x58, 0xaa, 0x02, 0x17, 0x43, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0xca, 0x02, 0x17, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x6c, 0x61, - 0x73, 0x68, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x23, - 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x5c, - 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x19, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x6c, - 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x66, 0x6f, 0x73, 0x42, 0xe1, 0x01, 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x38, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x6c, 0x61, 0x73, + 0x68, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x73, 0x6c, 0x61, + 0x73, 0x68, 0x69, 0x6e, 0x67, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, + 0x53, 0x58, 0xaa, 0x02, 0x17, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x53, 0x6c, 0x61, 0x73, + 0x68, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x17, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x5c, 0x56, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x23, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, + 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x19, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x3a, + 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/slashing/v1beta1/query_grpc.pb.go b/api/cosmos/slashing/v1beta1/query_grpc.pb.go index 48ef4179e48a..f56abf9ee8f5 100644 --- a/api/cosmos/slashing/v1beta1/query_grpc.pb.go +++ b/api/cosmos/slashing/v1beta1/query_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/slashing/v1beta1/query.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Query_Params_FullMethodName = "/cosmos.slashing.v1beta1.Query/Params" @@ -27,6 +27,8 @@ const ( // QueryClient is the client API for Query service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Query provides defines the gRPC querier service type QueryClient interface { // Params queries the parameters of slashing module Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) @@ -45,8 +47,9 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { } func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -54,8 +57,9 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . } func (c *queryClient) SigningInfo(ctx context.Context, in *QuerySigningInfoRequest, opts ...grpc.CallOption) (*QuerySigningInfoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QuerySigningInfoResponse) - err := c.cc.Invoke(ctx, Query_SigningInfo_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_SigningInfo_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -63,8 +67,9 @@ func (c *queryClient) SigningInfo(ctx context.Context, in *QuerySigningInfoReque } func (c *queryClient) SigningInfos(ctx context.Context, in *QuerySigningInfosRequest, opts ...grpc.CallOption) (*QuerySigningInfosResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QuerySigningInfosResponse) - err := c.cc.Invoke(ctx, Query_SigningInfos_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_SigningInfos_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -73,7 +78,9 @@ func (c *queryClient) SigningInfos(ctx context.Context, in *QuerySigningInfosReq // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer -// for forward compatibility +// for forward compatibility. +// +// Query provides defines the gRPC querier service type QueryServer interface { // Params queries the parameters of slashing module Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) @@ -84,9 +91,12 @@ type QueryServer interface { mustEmbedUnimplementedQueryServer() } -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} +// UnimplementedQueryServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedQueryServer struct{} func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") @@ -98,6 +108,7 @@ func (UnimplementedQueryServer) SigningInfos(context.Context, *QuerySigningInfos return nil, status.Errorf(codes.Unimplemented, "method SigningInfos not implemented") } func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} +func (UnimplementedQueryServer) testEmbeddedByValue() {} // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to QueryServer will @@ -107,6 +118,13 @@ type UnsafeQueryServer interface { } func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + // If the following call pancis, it indicates UnimplementedQueryServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Query_ServiceDesc, srv) } diff --git a/api/cosmos/slashing/v1beta1/slashing.pulsar.go b/api/cosmos/slashing/v1beta1/slashing.pulsar.go index 2eb889010244..3b46c7a715cf 100644 --- a/api/cosmos/slashing/v1beta1/slashing.pulsar.go +++ b/api/cosmos/slashing/v1beta1/slashing.pulsar.go @@ -1598,59 +1598,55 @@ var file_cosmos_slashing_v1beta1_slashing_proto_rawDesc = []byte{ 0x12, 0x32, 0x0a, 0x15, 0x6d, 0x69, 0x73, 0x73, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x13, 0x6d, 0x69, 0x73, 0x73, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x43, 0x6f, 0x75, - 0x6e, 0x74, 0x65, 0x72, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0xc5, 0x04, 0x0a, 0x06, 0x50, + 0x6e, 0x74, 0x65, 0x72, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0x8d, 0x04, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x5f, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x73, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x12, 0x7b, 0x0a, 0x15, 0x6d, 0x69, 0x6e, 0x5f, 0x73, + 0x73, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x12, 0x69, 0x0a, 0x15, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x48, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x9a, 0xe7, 0xb0, 0x2a, 0x10, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x5f, 0x64, 0x65, 0x63, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, - 0x52, 0x12, 0x6d, 0x69, 0x6e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, 0x65, 0x72, 0x57, 0x69, - 0x6e, 0x64, 0x6f, 0x77, 0x12, 0x5e, 0x0a, 0x16, 0x64, 0x6f, 0x77, 0x6e, 0x74, 0x69, 0x6d, 0x65, - 0x5f, 0x6a, 0x61, 0x69, 0x6c, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, - 0x0d, 0xc8, 0xde, 0x1f, 0x00, 0x98, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x14, - 0x64, 0x6f, 0x77, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x4a, 0x61, 0x69, 0x6c, 0x44, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x85, 0x01, 0x0a, 0x1a, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x5f, 0x66, - 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x73, - 0x69, 0x67, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x48, 0xc8, 0xde, 0x1f, 0x00, 0xda, - 0xde, 0x1f, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x9a, 0xe7, 0xb0, 0x2a, 0x10, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x64, 0x65, 0x63, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0xa8, 0xe7, - 0xb0, 0x2a, 0x01, 0x52, 0x17, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x46, 0x72, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x12, 0x80, 0x01, 0x0a, - 0x17, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x5f, 0x66, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x64, 0x6f, 0x77, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x48, - 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x9a, 0xe7, - 0xb0, 0x2a, 0x10, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x64, 0x65, 0x63, 0x5f, 0x62, 0x79, - 0x74, 0x65, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x15, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x46, - 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x6f, 0x77, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x3a, - 0x21, 0x8a, 0xe7, 0xb0, 0x2a, 0x1c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, - 0x2f, 0x78, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2f, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x42, 0xe8, 0x01, 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x42, 0x0d, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x38, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, - 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x6c, 0x61, - 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x73, 0x6c, - 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, - 0x43, 0x53, 0x58, 0xaa, 0x02, 0x17, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x53, 0x6c, 0x61, - 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x17, - 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x5c, - 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x23, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x5c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x19, - 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, - 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa8, 0xe2, 0x1e, 0x01, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x36, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, + 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x12, + 0x6d, 0x69, 0x6e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, 0x65, 0x72, 0x57, 0x69, 0x6e, 0x64, + 0x6f, 0x77, 0x12, 0x5e, 0x0a, 0x16, 0x64, 0x6f, 0x77, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6a, + 0x61, 0x69, 0x6c, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0d, 0xc8, + 0xde, 0x1f, 0x00, 0x98, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x14, 0x64, 0x6f, + 0x77, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x4a, 0x61, 0x69, 0x6c, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x73, 0x0a, 0x1a, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x5f, 0x66, 0x72, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x69, 0x67, 0x6e, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x36, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, + 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x17, + 0x73, 0x6c, 0x61, 0x73, 0x68, 0x46, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x6f, 0x75, + 0x62, 0x6c, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x12, 0x6e, 0x0a, 0x17, 0x73, 0x6c, 0x61, 0x73, 0x68, + 0x5f, 0x66, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x6f, 0x77, 0x6e, 0x74, 0x69, + 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x36, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, + 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, + 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, + 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, + 0x52, 0x15, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x46, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, + 0x6f, 0x77, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x3a, 0x21, 0x8a, 0xe7, 0xb0, 0x2a, 0x1c, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, + 0x69, 0x6e, 0x67, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xe8, 0x01, 0xa8, 0xe2, 0x1e, + 0x01, 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x6c, + 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0d, + 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x38, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, + 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, + 0x6e, 0x67, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x53, 0x58, 0xaa, + 0x02, 0x17, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, + 0x67, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x17, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x5c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0xe2, 0x02, 0x23, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x6c, 0x61, + 0x73, 0x68, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x19, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/slashing/v1beta1/tx.pulsar.go b/api/cosmos/slashing/v1beta1/tx.pulsar.go index 1f5d40b80542..c289bddefff8 100644 --- a/api/cosmos/slashing/v1beta1/tx.pulsar.go +++ b/api/cosmos/slashing/v1beta1/tx.pulsar.go @@ -1857,21 +1857,21 @@ var file_cosmos_slashing_v1beta1_tx_proto_rawDesc = []byte{ 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, - 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xe2, 0x01, 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x38, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, - 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x73, 0x6c, 0x61, 0x73, 0x68, - 0x69, 0x6e, 0x67, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x53, 0x58, - 0xaa, 0x02, 0x17, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, - 0x6e, 0x67, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x17, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x23, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x6c, - 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x19, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa8, 0xe2, 0x1e, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xe2, 0x01, 0xa8, 0xe2, 0x1e, 0x01, 0x0a, 0x1b, 0x63, 0x6f, + 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, + 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x38, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, + 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x6c, + 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x73, + 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, + 0x03, 0x43, 0x53, 0x58, 0xaa, 0x02, 0x17, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x53, 0x6c, + 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, + 0x17, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, + 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x23, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x5c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x19, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, + 0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } diff --git a/api/cosmos/slashing/v1beta1/tx_grpc.pb.go b/api/cosmos/slashing/v1beta1/tx_grpc.pb.go index dbe16e7046ec..93cc67402153 100644 --- a/api/cosmos/slashing/v1beta1/tx_grpc.pb.go +++ b/api/cosmos/slashing/v1beta1/tx_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/slashing/v1beta1/tx.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Msg_Unjail_FullMethodName = "/cosmos.slashing.v1beta1.Msg/Unjail" @@ -26,6 +26,8 @@ const ( // MsgClient is the client API for Msg service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Msg defines the slashing Msg service. type MsgClient interface { // Unjail defines a method for unjailing a jailed validator, thus returning // them into the bonded validator set, so they can begin receiving provisions @@ -47,8 +49,9 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { } func (c *msgClient) Unjail(ctx context.Context, in *MsgUnjail, opts ...grpc.CallOption) (*MsgUnjailResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgUnjailResponse) - err := c.cc.Invoke(ctx, Msg_Unjail_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_Unjail_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -56,8 +59,9 @@ func (c *msgClient) Unjail(ctx context.Context, in *MsgUnjail, opts ...grpc.Call } func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -66,7 +70,9 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer -// for forward compatibility +// for forward compatibility. +// +// Msg defines the slashing Msg service. type MsgServer interface { // Unjail defines a method for unjailing a jailed validator, thus returning // them into the bonded validator set, so they can begin receiving provisions @@ -80,9 +86,12 @@ type MsgServer interface { mustEmbedUnimplementedMsgServer() } -// UnimplementedMsgServer must be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} +// UnimplementedMsgServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedMsgServer struct{} func (UnimplementedMsgServer) Unjail(context.Context, *MsgUnjail) (*MsgUnjailResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Unjail not implemented") @@ -91,6 +100,7 @@ func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (* return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} +func (UnimplementedMsgServer) testEmbeddedByValue() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to MsgServer will @@ -100,6 +110,13 @@ type UnsafeMsgServer interface { } func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + // If the following call pancis, it indicates UnimplementedMsgServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Msg_ServiceDesc, srv) } diff --git a/api/cosmos/staking/module/v1/module.pulsar.go b/api/cosmos/staking/module/v1/module.pulsar.go index dcb309d625ae..cf1f8206e072 100644 --- a/api/cosmos/staking/module/v1/module.pulsar.go +++ b/api/cosmos/staking/module/v1/module.pulsar.go @@ -60,9 +60,11 @@ func (x *_Module_1_list) IsValid() bool { } var ( - md_Module protoreflect.MessageDescriptor - fd_Module_hooks_order protoreflect.FieldDescriptor - fd_Module_authority protoreflect.FieldDescriptor + md_Module protoreflect.MessageDescriptor + fd_Module_hooks_order protoreflect.FieldDescriptor + fd_Module_authority protoreflect.FieldDescriptor + fd_Module_bech32_prefix_validator protoreflect.FieldDescriptor + fd_Module_bech32_prefix_consensus protoreflect.FieldDescriptor ) func init() { @@ -70,6 +72,8 @@ func init() { md_Module = File_cosmos_staking_module_v1_module_proto.Messages().ByName("Module") fd_Module_hooks_order = md_Module.Fields().ByName("hooks_order") fd_Module_authority = md_Module.Fields().ByName("authority") + fd_Module_bech32_prefix_validator = md_Module.Fields().ByName("bech32_prefix_validator") + fd_Module_bech32_prefix_consensus = md_Module.Fields().ByName("bech32_prefix_consensus") } var _ protoreflect.Message = (*fastReflection_Module)(nil) @@ -149,6 +153,18 @@ func (x *fastReflection_Module) Range(f func(protoreflect.FieldDescriptor, proto return } } + if x.Bech32PrefixValidator != "" { + value := protoreflect.ValueOfString(x.Bech32PrefixValidator) + if !f(fd_Module_bech32_prefix_validator, value) { + return + } + } + if x.Bech32PrefixConsensus != "" { + value := protoreflect.ValueOfString(x.Bech32PrefixConsensus) + if !f(fd_Module_bech32_prefix_consensus, value) { + return + } + } } // Has reports whether a field is populated. @@ -168,6 +184,10 @@ func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool { return len(x.HooksOrder) != 0 case "cosmos.staking.module.v1.Module.authority": return x.Authority != "" + case "cosmos.staking.module.v1.Module.bech32_prefix_validator": + return x.Bech32PrefixValidator != "" + case "cosmos.staking.module.v1.Module.bech32_prefix_consensus": + return x.Bech32PrefixConsensus != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.module.v1.Module")) @@ -188,6 +208,10 @@ func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) { x.HooksOrder = nil case "cosmos.staking.module.v1.Module.authority": x.Authority = "" + case "cosmos.staking.module.v1.Module.bech32_prefix_validator": + x.Bech32PrefixValidator = "" + case "cosmos.staking.module.v1.Module.bech32_prefix_consensus": + x.Bech32PrefixConsensus = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.module.v1.Module")) @@ -213,6 +237,12 @@ func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) pro case "cosmos.staking.module.v1.Module.authority": value := x.Authority return protoreflect.ValueOfString(value) + case "cosmos.staking.module.v1.Module.bech32_prefix_validator": + value := x.Bech32PrefixValidator + return protoreflect.ValueOfString(value) + case "cosmos.staking.module.v1.Module.bech32_prefix_consensus": + value := x.Bech32PrefixConsensus + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.module.v1.Module")) @@ -239,6 +269,10 @@ func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value proto x.HooksOrder = *clv.list case "cosmos.staking.module.v1.Module.authority": x.Authority = value.Interface().(string) + case "cosmos.staking.module.v1.Module.bech32_prefix_validator": + x.Bech32PrefixValidator = value.Interface().(string) + case "cosmos.staking.module.v1.Module.bech32_prefix_consensus": + x.Bech32PrefixConsensus = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.module.v1.Module")) @@ -267,6 +301,10 @@ func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protore return protoreflect.ValueOfList(value) case "cosmos.staking.module.v1.Module.authority": panic(fmt.Errorf("field authority of message cosmos.staking.module.v1.Module is not mutable")) + case "cosmos.staking.module.v1.Module.bech32_prefix_validator": + panic(fmt.Errorf("field bech32_prefix_validator of message cosmos.staking.module.v1.Module is not mutable")) + case "cosmos.staking.module.v1.Module.bech32_prefix_consensus": + panic(fmt.Errorf("field bech32_prefix_consensus of message cosmos.staking.module.v1.Module is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.module.v1.Module")) @@ -285,6 +323,10 @@ func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protor return protoreflect.ValueOfList(&_Module_1_list{list: &list}) case "cosmos.staking.module.v1.Module.authority": return protoreflect.ValueOfString("") + case "cosmos.staking.module.v1.Module.bech32_prefix_validator": + return protoreflect.ValueOfString("") + case "cosmos.staking.module.v1.Module.bech32_prefix_consensus": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.staking.module.v1.Module")) @@ -364,6 +406,14 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } + l = len(x.Bech32PrefixValidator) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Bech32PrefixConsensus) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -393,6 +443,20 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.Bech32PrefixConsensus) > 0 { + i -= len(x.Bech32PrefixConsensus) + copy(dAtA[i:], x.Bech32PrefixConsensus) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Bech32PrefixConsensus))) + i-- + dAtA[i] = 0x22 + } + if len(x.Bech32PrefixValidator) > 0 { + i -= len(x.Bech32PrefixValidator) + copy(dAtA[i:], x.Bech32PrefixValidator) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Bech32PrefixValidator))) + i-- + dAtA[i] = 0x1a + } if len(x.Authority) > 0 { i -= len(x.Authority) copy(dAtA[i:], x.Authority) @@ -522,6 +586,70 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { } x.Authority = 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 Bech32PrefixValidator", 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.Bech32PrefixValidator = 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 Bech32PrefixConsensus", 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.Bech32PrefixConsensus = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -582,6 +710,10 @@ type Module struct { HooksOrder []string `protobuf:"bytes,1,rep,name=hooks_order,json=hooksOrder,proto3" json:"hooks_order,omitempty"` // authority defines the custom module authority. If not set, defaults to the governance module. Authority string `protobuf:"bytes,2,opt,name=authority,proto3" json:"authority,omitempty"` + // bech32_prefix_validator is the bech32 validator prefix for the app. + Bech32PrefixValidator string `protobuf:"bytes,3,opt,name=bech32_prefix_validator,json=bech32PrefixValidator,proto3" json:"bech32_prefix_validator,omitempty"` + // bech32_prefix_consensus is the bech32 consensus node prefix for the app. + Bech32PrefixConsensus string `protobuf:"bytes,4,opt,name=bech32_prefix_consensus,json=bech32PrefixConsensus,proto3" json:"bech32_prefix_consensus,omitempty"` } func (x *Module) Reset() { @@ -618,6 +750,20 @@ func (x *Module) GetAuthority() string { return "" } +func (x *Module) GetBech32PrefixValidator() string { + if x != nil { + return x.Bech32PrefixValidator + } + return "" +} + +func (x *Module) GetBech32PrefixConsensus() string { + if x != nil { + return x.Bech32PrefixConsensus + } + return "" +} + var File_cosmos_staking_module_v1_module_proto protoreflect.FileDescriptor var file_cosmos_staking_module_v1_module_proto_rawDesc = []byte{ @@ -627,29 +773,36 @@ var file_cosmos_staking_module_v1_module_proto_rawDesc = []byte{ 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 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, 0x77, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x1f, 0x0a, - 0x0b, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x0a, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x1c, - 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x2e, 0xba, 0xc0, - 0x96, 0xda, 0x01, 0x28, 0x0a, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, - 0x64, 0x6b, 0x2f, 0x78, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x42, 0xe2, 0x01, 0x0a, - 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, - 0x69, 0x6e, 0x67, 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, 0x32, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x6d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, - 0xa2, 0x02, 0x03, 0x43, 0x53, 0x4d, 0xaa, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, - 0x31, 0xca, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x74, 0x61, 0x6b, 0x69, - 0x6e, 0x67, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x24, 0x43, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5c, 0x4d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x74, - 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, - 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x74, 0x6f, 0x22, 0xe7, 0x01, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x1f, + 0x0a, 0x0b, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x0a, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, + 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x36, 0x0a, + 0x17, 0x62, 0x65, 0x63, 0x68, 0x33, 0x32, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x5f, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x15, + 0x62, 0x65, 0x63, 0x68, 0x33, 0x32, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x36, 0x0a, 0x17, 0x62, 0x65, 0x63, 0x68, 0x33, 0x32, 0x5f, + 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x15, 0x62, 0x65, 0x63, 0x68, 0x33, 0x32, 0x50, 0x72, + 0x65, 0x66, 0x69, 0x78, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x3a, 0x2e, 0xba, + 0xc0, 0x96, 0xda, 0x01, 0x28, 0x0a, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, + 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x42, 0xe2, 0x01, + 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, + 0x6b, 0x69, 0x6e, 0x67, 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, 0x32, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x6d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, + 0x31, 0xa2, 0x02, 0x03, 0x43, 0x53, 0x4d, 0xaa, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, + 0x56, 0x31, 0xca, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x74, 0x61, 0x6b, + 0x69, 0x6e, 0x67, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x24, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5c, 0x4d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, + 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, + 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/staking/v1beta1/genesis.pulsar.go b/api/cosmos/staking/v1beta1/genesis.pulsar.go index 38efa2056c46..09c705bdb2e7 100644 --- a/api/cosmos/staking/v1beta1/genesis.pulsar.go +++ b/api/cosmos/staking/v1beta1/genesis.pulsar.go @@ -1763,7 +1763,8 @@ type GenesisState struct { UnbondingDelegations []*UnbondingDelegation `protobuf:"bytes,6,rep,name=unbonding_delegations,json=unbondingDelegations,proto3" json:"unbonding_delegations,omitempty"` // redelegations defines the redelegations active at genesis. Redelegations []*Redelegation `protobuf:"bytes,7,rep,name=redelegations,proto3" json:"redelegations,omitempty"` - Exported bool `protobuf:"varint,8,opt,name=exported,proto3" json:"exported,omitempty"` + // exported defines a bool to identify whether the chain dealing with exported or initialized genesis. + Exported bool `protobuf:"varint,8,opt,name=exported,proto3" json:"exported,omitempty"` } func (x *GenesisState) Reset() { @@ -1901,70 +1902,70 @@ var file_cosmos_staking_v1beta1_genesis_proto_rawDesc = []byte{ 0x6b, 0x69, 0x6e, 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, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, - 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9a, 0x05, 0x0a, 0x0c, 0x47, 0x65, 0x6e, + 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x97, 0x05, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x41, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, - 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x5d, 0x0a, 0x10, + 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x5a, 0x0a, 0x10, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x6f, 0x77, 0x65, 0x72, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x33, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0e, 0x6c, 0x61, 0x73, - 0x74, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x69, 0x0a, 0x15, 0x6c, - 0x61, 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x70, 0x6f, - 0x77, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x61, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, - 0x01, 0x52, 0x13, 0x6c, 0x61, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x50, 0x6f, 0x77, 0x65, 0x72, 0x73, 0x12, 0x4c, 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x09, 0xc8, - 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x73, 0x12, 0x4f, 0x0a, 0x0b, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09, 0xc8, - 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0b, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x6b, 0x0a, 0x15, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, - 0x6e, 0x67, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, - 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x6e, - 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x14, 0x75, 0x6e, - 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x12, 0x55, 0x0a, 0x0d, 0x72, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x52, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, - 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0d, 0x72, 0x65, 0x64, 0x65, - 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x70, - 0x6f, 0x72, 0x74, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x65, 0x78, 0x70, - 0x6f, 0x72, 0x74, 0x65, 0x64, 0x22, 0x68, 0x0a, 0x12, 0x4c, 0x61, 0x73, 0x74, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x07, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 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, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, - 0x14, 0x0a, 0x05, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, - 0x70, 0x6f, 0x77, 0x65, 0x72, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x42, - 0xdc, 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, - 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0c, - 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x53, 0x58, 0xaa, 0x02, 0x16, 0x43, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, - 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, - 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5c, - 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x74, - 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, + 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x49, 0x6e, 0x74, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0e, 0x6c, 0x61, 0x73, 0x74, 0x54, 0x6f, + 0x74, 0x61, 0x6c, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x69, 0x0a, 0x15, 0x6c, 0x61, 0x73, 0x74, + 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x70, 0x6f, 0x77, 0x65, 0x72, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x4c, 0x61, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x6f, + 0x77, 0x65, 0x72, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x13, + 0x6c, 0x61, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x6f, 0x77, + 0x65, 0x72, 0x73, 0x12, 0x4c, 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, + 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x73, 0x12, 0x4f, 0x0a, 0x0b, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, + 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0b, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x12, 0x6b, 0x0a, 0x15, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, + 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x6e, 0x62, 0x6f, 0x6e, + 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09, + 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x14, 0x75, 0x6e, 0x62, 0x6f, 0x6e, + 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x55, 0x0a, 0x0d, 0x72, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x52, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09, 0xc8, 0xde, + 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0d, 0x72, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, + 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, + 0x65, 0x64, 0x22, 0x68, 0x0a, 0x12, 0x4c, 0x61, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 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, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, + 0x70, 0x6f, 0x77, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, 0x6f, 0x77, + 0x65, 0x72, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x42, 0xdc, 0x01, 0x0a, + 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, + 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, + 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x3b, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x53, 0x58, 0xaa, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0xca, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x74, 0x61, 0x6b, + 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x22, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/staking/v1beta1/query.pulsar.go b/api/cosmos/staking/v1beta1/query.pulsar.go index b1905fe7e803..f0538f036791 100644 --- a/api/cosmos/staking/v1beta1/query.pulsar.go +++ b/api/cosmos/staking/v1beta1/query.pulsar.go @@ -14935,134 +14935,197 @@ var file_cosmos_staking_v1beta1_query_proto_rawDesc = []byte{ 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, - 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x58, 0x0a, 0x15, 0x51, 0x75, + 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x61, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x5f, 0x61, 0x64, 0x64, 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, 0x0d, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x41, 0x64, 0x64, 0x72, 0x22, 0x64, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, - 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, - 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, - 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x22, 0xab, 0x01, 0x0a, 0x20, 0x51, + 0x65, 0x73, 0x74, 0x12, 0x48, 0x0a, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, 0xb4, 0x2d, + 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0d, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x22, 0x64, 0x0a, + 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x09, 0xc8, + 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x22, 0xb4, 0x01, 0x0a, 0x20, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x48, 0x0a, 0x0e, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x52, 0x0d, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, + 0x64, 0x72, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, + 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xed, 0x01, 0x0a, 0x21, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x44, 0x65, 0x6c, + 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x7f, 0x0a, 0x14, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x20, 0xc8, 0xde, 0x1f, 0x00, + 0xaa, 0xdf, 0x1f, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x13, 0x64, 0x65, + 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, + 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, + 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xbd, 0x01, 0x0a, 0x29, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x6e, 0x62, + 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x48, 0x0a, 0x0e, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x52, 0x0d, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, + 0x64, 0x72, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, + 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xde, 0x01, 0x0a, 0x2a, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x6e, 0x62, + 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x67, 0x0a, 0x13, 0x75, 0x6e, 0x62, + 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x12, + 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, + 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xad, 0x01, 0x0a, 0x16, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x0e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, + 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 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, 0x0d, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, + 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x12, 0x48, 0x0a, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x52, 0x0d, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, + 0x72, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0x76, 0x0a, 0x17, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5b, 0x0a, 0x13, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, + 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, + 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, + 0x12, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0xb6, 0x01, 0x0a, 0x1f, 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x6e, 0x62, + 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x0e, 0x64, 0x65, 0x6c, 0x65, 0x67, + 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 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, 0x0d, 0x64, 0x65, 0x6c, 0x65, 0x67, + 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x12, 0x48, 0x0a, 0x0e, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x52, 0x0d, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, + 0x64, 0x72, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0x72, 0x0a, 0x20, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, + 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x4e, 0x0a, 0x06, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, + 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, + 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09, 0xc8, + 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, + 0x22, 0xb5, 0x01, 0x0a, 0x20, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, + 0x74, 0x6f, 0x72, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x0e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, + 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 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, 0x0d, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, + 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x08, + 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0xd6, 0x01, 0x0a, 0x21, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x44, 0x65, 0x6c, 0x65, 0x67, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x68, + 0x0a, 0x14, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, + 0xb0, 0x2a, 0x01, 0x52, 0x13, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, + 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x22, 0xbe, 0x01, 0x0a, 0x29, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, + 0x61, 0x74, 0x6f, 0x72, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x3f, 0x0a, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, + 0x3f, 0x0a, 0x0e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 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, 0x0d, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, + 0x67, 0x52, 0x0d, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, - 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xed, 0x01, 0x0a, 0x21, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x44, 0x65, 0x6c, 0x65, 0x67, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7f, - 0x0a, 0x14, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x20, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, - 0x1f, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x13, 0x64, 0x65, 0x6c, 0x65, - 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x12, - 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, - 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, - 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xb4, 0x01, 0x0a, 0x29, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x6e, 0x62, 0x6f, 0x6e, - 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 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, 0x0d, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, - 0xde, 0x01, 0x0a, 0x2a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x67, - 0x0a, 0x13, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, - 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, - 0xb0, 0x2a, 0x01, 0x52, 0x12, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x22, 0xa4, 0x01, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x0e, 0x64, - 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 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, 0x0d, 0x64, - 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x12, 0x3f, 0x0a, 0x0e, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 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, 0x0d, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x3a, 0x08, 0x88, - 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0x76, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x5b, 0x0a, 0x13, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x12, 0x64, 0x65, 0x6c, - 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0xad, 0x01, 0x0a, 0x1f, 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, - 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x0e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, - 0x5f, 0x61, 0x64, 0x64, 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, 0x0d, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, - 0x41, 0x64, 0x64, 0x72, 0x12, 0x3f, 0x0a, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x5f, 0x61, 0x64, 0x64, 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, 0x0d, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x41, 0x64, 0x64, 0x72, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, - 0x72, 0x0a, 0x20, 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, - 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x06, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, - 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x6e, 0x62, - 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x75, 0x6e, 0x62, - 0x6f, 0x6e, 0x64, 0x22, 0xb5, 0x01, 0x0a, 0x20, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6c, - 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x0e, 0x64, 0x65, 0x6c, 0x65, - 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 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, 0x0d, 0x64, 0x65, 0x6c, 0x65, - 0x67, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, - 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0xd6, 0x01, 0x0a, 0x21, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x44, 0x65, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, + 0x1f, 0x00, 0x22, 0xde, 0x01, 0x0a, 0x2a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6c, 0x65, + 0x67, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x68, 0x0a, 0x14, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x09, 0xc8, 0xde, 0x1f, - 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x13, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, - 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, - 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xbe, 0x01, 0x0a, 0x29, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, - 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, - 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x65, 0x12, 0x67, 0x0a, 0x13, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x72, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, + 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, + 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x12, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, + 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x22, 0xd0, 0x02, 0x0a, 0x19, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x64, + 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x3f, 0x0a, 0x0e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, + 0x64, 0x64, 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, 0x0d, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, + 0x64, 0x72, 0x12, 0x4f, 0x0a, 0x12, 0x73, 0x72, 0x63, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, + 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x52, 0x10, 0x73, 0x72, 0x63, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, + 0x64, 0x64, 0x72, 0x12, 0x4f, 0x0a, 0x12, 0x64, 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x52, 0x10, 0x64, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x41, 0x64, 0x64, 0x72, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x08, 0x88, 0xa0, + 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0xd5, 0x01, 0x0a, 0x1a, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x52, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6e, 0x0a, 0x16, 0x72, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, + 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, + 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x15, + 0x72, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xb4, + 0x01, 0x0a, 0x1f, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, + 0x72, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x0e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 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, @@ -15072,311 +15135,253 @@ var file_cosmos_staking_v1beta1_query_proto_rawDesc = []byte{ 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x08, 0x88, 0xa0, 0x1f, - 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0xde, 0x01, 0x0a, 0x2a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, - 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, - 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x67, 0x0a, 0x13, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, - 0x67, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, - 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x6e, 0x62, 0x6f, 0x6e, - 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09, - 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x12, 0x75, 0x6e, 0x62, 0x6f, 0x6e, - 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x12, 0x47, 0x0a, - 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, - 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, - 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xbe, 0x02, 0x0a, 0x19, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x52, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, + 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0xb9, 0x01, 0x0a, 0x20, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, + 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x0a, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, + 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x22, 0xb5, 0x01, 0x0a, 0x1e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, + 0x61, 0x74, 0x6f, 0x72, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x0e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 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, 0x0d, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, - 0x72, 0x41, 0x64, 0x64, 0x72, 0x12, 0x46, 0x0a, 0x12, 0x73, 0x72, 0x63, 0x5f, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 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, 0x10, 0x73, 0x72, 0x63, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x12, 0x46, 0x0a, - 0x12, 0x64, 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, - 0x64, 0x64, 0x72, 0x18, 0x03, 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, 0x10, 0x64, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x41, 0x64, 0x64, 0x72, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x08, 0x88, - 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0xd5, 0x01, 0x0a, 0x1a, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x52, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6e, 0x0a, 0x16, 0x72, 0x65, 0x64, 0x65, 0x6c, 0x65, - 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x52, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, - 0x15, 0x72, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, - 0xb4, 0x01, 0x0a, 0x1f, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, - 0x6f, 0x72, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x0e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, - 0x5f, 0x61, 0x64, 0x64, 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, 0x0d, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, - 0x41, 0x64, 0x64, 0x72, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x08, 0x88, 0xa0, - 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0xb9, 0x01, 0x0a, 0x20, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x0a, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x72, 0x41, 0x64, 0x64, 0x72, 0x12, 0x48, 0x0a, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, + 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x52, 0x0d, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x3a, + 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0x6d, 0x0a, 0x1f, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x09, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, - 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x22, 0xac, 0x01, 0x0a, 0x1e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6c, 0x65, - 0x67, 0x61, 0x74, 0x6f, 0x72, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x0e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, - 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 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, 0x0d, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, - 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x12, 0x3f, 0x0a, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 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, 0x0d, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, - 0x00, 0x22, 0x6d, 0x0a, 0x1f, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, - 0x74, 0x6f, 0x72, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, - 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x22, 0x34, 0x0a, 0x1a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, - 0x63, 0x61, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, - 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, - 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x59, 0x0a, 0x1b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, - 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x04, 0x68, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, - 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x48, 0x69, 0x73, - 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x68, 0x69, 0x73, - 0x74, 0x22, 0x12, 0x0a, 0x10, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x50, 0x0a, 0x11, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, - 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x04, 0x70, 0x6f, - 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x6f, 0x72, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x09, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x22, 0x34, 0x0a, 0x1a, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x59, + 0x0a, 0x1b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, + 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, + 0x04, 0x68, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x68, 0x69, 0x73, 0x74, 0x22, 0x12, 0x0a, 0x10, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x50, 0x0a, + 0x11, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x04, 0x70, 0x6f, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, + 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x6f, 0x6f, 0x6c, 0x42, 0x09, + 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x04, 0x70, 0x6f, 0x6f, 0x6c, 0x22, + 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x58, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x06, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, + 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x32, + 0xb0, 0x16, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x9e, 0x01, 0x0a, 0x0a, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x50, 0x6f, 0x6f, 0x6c, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, - 0x01, 0x52, 0x04, 0x70, 0x6f, 0x6f, 0x6c, 0x22, 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x58, 0x0a, - 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, - 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, - 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x32, 0xb0, 0x16, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x12, 0x9e, 0x01, 0x0a, 0x0a, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, - 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, - 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x2f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, - 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x2f, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x12, 0x22, - 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x73, 0x12, 0xac, 0x01, 0x0a, 0x09, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x12, 0x2d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, - 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x2e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x40, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x35, 0x12, 0x33, 0x2f, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, - 0x2f, 0x7b, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, - 0x7d, 0x12, 0xd9, 0x01, 0x0a, 0x14, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x44, - 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x38, 0x2e, 0x63, 0x6f, 0x73, + 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0x88, 0xe7, 0xb0, 0x2a, 0x01, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x12, 0x22, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, + 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0xac, 0x01, 0x0a, 0x09, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x2d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x40, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x35, 0x12, 0x33, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, + 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x7b, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x7d, 0x12, 0xd9, 0x01, 0x0a, 0x14, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x12, 0x38, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, + 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4c, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x41, 0x12, 0x3f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, + 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x7b, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x7d, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0xfe, 0x01, 0x0a, 0x1d, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, + 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x41, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x55, + 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x42, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, - 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x44, 0x65, 0x6c, 0x65, - 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x4c, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x41, 0x12, 0x3f, 0x2f, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, - 0x2f, 0x7b, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, - 0x7d, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0xfe, 0x01, - 0x0a, 0x1d, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x6e, 0x62, 0x6f, 0x6e, - 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, - 0x41, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, - 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x42, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, - 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, - 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x56, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x4b, 0x12, 0x49, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, + 0x6f, 0x72, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x56, + 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x4b, 0x12, 0x49, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, + 0x7b, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x7d, + 0x2f, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x67, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0xcc, 0x01, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x67, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, + 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, + 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5d, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x52, 0x12, 0x50, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x7b, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x7d, 0x2f, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, - 0x6e, 0x67, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0xcc, - 0x01, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x2e, + 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x7d, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, + 0x61, 0x64, 0x64, 0x72, 0x7d, 0x12, 0xfc, 0x01, 0x0a, 0x13, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, + 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6c, 0x65, - 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x6e, 0x62, 0x6f, + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, + 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x72, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x67, 0x12, 0x65, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x73, 0x2f, 0x7b, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, + 0x72, 0x7d, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, + 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x7d, 0x2f, + 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0xce, 0x01, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, + 0x6f, 0x72, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x38, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6c, 0x65, - 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5d, - 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x52, 0x12, 0x50, 0x2f, 0x63, 0x6f, + 0x67, 0x61, 0x74, 0x6f, 0x72, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x44, + 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x41, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x36, 0x12, + 0x34, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, + 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, + 0x61, 0x64, 0x64, 0x72, 0x7d, 0x12, 0xfe, 0x01, 0x0a, 0x1d, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, + 0x74, 0x6f, 0x72, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, + 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x41, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x55, + 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x42, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, + 0x6f, 0x72, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x56, + 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x4b, 0x12, 0x49, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, - 0x7b, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x7d, - 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x64, 0x65, - 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x7d, 0x12, 0xfc, 0x01, - 0x0a, 0x13, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, - 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, - 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, - 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x6e, 0x62, - 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x72, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x67, 0x12, 0x65, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, - 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x7b, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x7d, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x67, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, - 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x7d, 0x2f, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, - 0x67, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0xce, 0x01, 0x0a, - 0x14, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x38, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, - 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x44, 0x65, 0x6c, - 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x39, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, - 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x41, 0x88, 0xe7, 0xb0, 0x2a, - 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x36, 0x12, 0x34, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x64, 0x65, - 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x7d, 0x12, 0xfe, 0x01, - 0x0a, 0x1d, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x6e, 0x62, 0x6f, 0x6e, - 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, - 0x41, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, - 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, - 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x42, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, - 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, - 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x56, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x4b, 0x12, 0x49, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, - 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x64, 0x65, 0x6c, - 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x7b, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, - 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x7d, 0x2f, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, - 0x6e, 0x67, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0xc6, - 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x12, 0x31, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, - 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, - 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, - 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x52, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4e, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x43, 0x12, 0x41, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, - 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x64, 0x65, - 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x7b, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, - 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x7d, 0x2f, 0x72, 0x65, 0x64, 0x65, 0x6c, 0x65, - 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0xd5, 0x01, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, - 0x67, 0x61, 0x74, 0x6f, 0x72, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, - 0x37, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, - 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x65, 0x74, 0x61, 0x31, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, + 0x7b, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x7d, + 0x2f, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x67, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0xc6, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x64, 0x65, 0x6c, + 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x31, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x4b, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x40, 0x12, - 0x3e, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, - 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, - 0x6f, 0x72, 0x73, 0x2f, 0x7b, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, - 0x64, 0x64, 0x72, 0x7d, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, - 0xe3, 0x01, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x36, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, + 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x64, 0x65, 0x6c, 0x65, + 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x4e, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x43, 0x12, 0x41, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x73, + 0x2f, 0x7b, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, + 0x7d, 0x2f, 0x72, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0xd5, 0x01, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x37, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x38, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, + 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, + 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4b, 0x88, 0xe7, 0xb0, 0x2a, + 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x40, 0x12, 0x3e, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x7b, 0x64, 0x65, 0x6c, + 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x7d, 0x2f, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0xe3, 0x01, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, + 0x67, 0x61, 0x74, 0x6f, 0x72, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x36, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5c, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x51, 0x12, 0x4f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, - 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x64, 0x65, - 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x7b, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, - 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x7d, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x7b, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, - 0x61, 0x64, 0x64, 0x72, 0x7d, 0x12, 0xb8, 0x01, 0x0a, 0x0e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, - 0x69, 0x63, 0x61, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x32, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, - 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, 0x69, 0x73, 0x74, 0x6f, - 0x72, 0x69, 0x63, 0x61, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x3d, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x12, 0x30, - 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, - 0x61, 0x6c, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x7b, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x7d, - 0x12, 0x86, 0x01, 0x0a, 0x04, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, - 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, - 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x12, 0x1c, 0x2f, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x6f, 0x6f, 0x6c, 0x12, 0x8e, 0x01, 0x0a, 0x06, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x5c, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x51, 0x12, 0x4f, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x73, + 0x2f, 0x7b, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, + 0x7d, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x7b, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x7d, 0x12, 0xb8, 0x01, + 0x0a, 0x0e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x32, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, + 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, + 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, - 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2b, 0x88, - 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xda, 0x01, 0x0a, 0x1a, 0x63, - 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, - 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, - 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x3b, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, - 0x02, 0x03, 0x43, 0x53, 0x58, 0xaa, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x53, - 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, - 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5c, - 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x5c, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x18, 0x43, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x3a, 0x3a, - 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x72, 0x79, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, 0x88, 0xe7, 0xb0, 0x2a, 0x01, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x12, 0x30, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, + 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, + 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x2f, + 0x7b, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x7d, 0x12, 0x86, 0x01, 0x0a, 0x04, 0x50, 0x6f, 0x6f, + 0x6c, 0x12, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x1e, 0x12, 0x1c, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, + 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x6f, 0x6f, + 0x6c, 0x12, 0x8e, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2a, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2b, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x6b, + 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x42, 0xda, 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x36, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, + 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x53, 0x58, 0xaa, 0x02, 0x16, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x56, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, + 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, + 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, + 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, + 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/staking/v1beta1/query_grpc.pb.go b/api/cosmos/staking/v1beta1/query_grpc.pb.go index a015a80c6eb2..3ae9b2f5cfc3 100644 --- a/api/cosmos/staking/v1beta1/query_grpc.pb.go +++ b/api/cosmos/staking/v1beta1/query_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/staking/v1beta1/query.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Query_Validators_FullMethodName = "/cosmos.staking.v1beta1.Query/Validators" @@ -38,6 +38,8 @@ const ( // QueryClient is the client API for Query service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Query defines the gRPC querier service. type QueryClient interface { // Validators queries all validators that match the given status. // @@ -103,8 +105,9 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { } func (c *queryClient) Validators(ctx context.Context, in *QueryValidatorsRequest, opts ...grpc.CallOption) (*QueryValidatorsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryValidatorsResponse) - err := c.cc.Invoke(ctx, Query_Validators_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Validators_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -112,8 +115,9 @@ func (c *queryClient) Validators(ctx context.Context, in *QueryValidatorsRequest } func (c *queryClient) Validator(ctx context.Context, in *QueryValidatorRequest, opts ...grpc.CallOption) (*QueryValidatorResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryValidatorResponse) - err := c.cc.Invoke(ctx, Query_Validator_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Validator_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -121,8 +125,9 @@ func (c *queryClient) Validator(ctx context.Context, in *QueryValidatorRequest, } func (c *queryClient) ValidatorDelegations(ctx context.Context, in *QueryValidatorDelegationsRequest, opts ...grpc.CallOption) (*QueryValidatorDelegationsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryValidatorDelegationsResponse) - err := c.cc.Invoke(ctx, Query_ValidatorDelegations_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_ValidatorDelegations_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -130,8 +135,9 @@ func (c *queryClient) ValidatorDelegations(ctx context.Context, in *QueryValidat } func (c *queryClient) ValidatorUnbondingDelegations(ctx context.Context, in *QueryValidatorUnbondingDelegationsRequest, opts ...grpc.CallOption) (*QueryValidatorUnbondingDelegationsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryValidatorUnbondingDelegationsResponse) - err := c.cc.Invoke(ctx, Query_ValidatorUnbondingDelegations_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_ValidatorUnbondingDelegations_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -139,8 +145,9 @@ func (c *queryClient) ValidatorUnbondingDelegations(ctx context.Context, in *Que } func (c *queryClient) Delegation(ctx context.Context, in *QueryDelegationRequest, opts ...grpc.CallOption) (*QueryDelegationResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryDelegationResponse) - err := c.cc.Invoke(ctx, Query_Delegation_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Delegation_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -148,8 +155,9 @@ func (c *queryClient) Delegation(ctx context.Context, in *QueryDelegationRequest } func (c *queryClient) UnbondingDelegation(ctx context.Context, in *QueryUnbondingDelegationRequest, opts ...grpc.CallOption) (*QueryUnbondingDelegationResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryUnbondingDelegationResponse) - err := c.cc.Invoke(ctx, Query_UnbondingDelegation_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_UnbondingDelegation_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -157,8 +165,9 @@ func (c *queryClient) UnbondingDelegation(ctx context.Context, in *QueryUnbondin } func (c *queryClient) DelegatorDelegations(ctx context.Context, in *QueryDelegatorDelegationsRequest, opts ...grpc.CallOption) (*QueryDelegatorDelegationsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryDelegatorDelegationsResponse) - err := c.cc.Invoke(ctx, Query_DelegatorDelegations_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_DelegatorDelegations_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -166,8 +175,9 @@ func (c *queryClient) DelegatorDelegations(ctx context.Context, in *QueryDelegat } func (c *queryClient) DelegatorUnbondingDelegations(ctx context.Context, in *QueryDelegatorUnbondingDelegationsRequest, opts ...grpc.CallOption) (*QueryDelegatorUnbondingDelegationsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryDelegatorUnbondingDelegationsResponse) - err := c.cc.Invoke(ctx, Query_DelegatorUnbondingDelegations_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_DelegatorUnbondingDelegations_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -175,8 +185,9 @@ func (c *queryClient) DelegatorUnbondingDelegations(ctx context.Context, in *Que } func (c *queryClient) Redelegations(ctx context.Context, in *QueryRedelegationsRequest, opts ...grpc.CallOption) (*QueryRedelegationsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryRedelegationsResponse) - err := c.cc.Invoke(ctx, Query_Redelegations_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Redelegations_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -184,8 +195,9 @@ func (c *queryClient) Redelegations(ctx context.Context, in *QueryRedelegationsR } func (c *queryClient) DelegatorValidators(ctx context.Context, in *QueryDelegatorValidatorsRequest, opts ...grpc.CallOption) (*QueryDelegatorValidatorsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryDelegatorValidatorsResponse) - err := c.cc.Invoke(ctx, Query_DelegatorValidators_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_DelegatorValidators_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -193,8 +205,9 @@ func (c *queryClient) DelegatorValidators(ctx context.Context, in *QueryDelegato } func (c *queryClient) DelegatorValidator(ctx context.Context, in *QueryDelegatorValidatorRequest, opts ...grpc.CallOption) (*QueryDelegatorValidatorResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryDelegatorValidatorResponse) - err := c.cc.Invoke(ctx, Query_DelegatorValidator_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_DelegatorValidator_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -202,8 +215,9 @@ func (c *queryClient) DelegatorValidator(ctx context.Context, in *QueryDelegator } func (c *queryClient) HistoricalInfo(ctx context.Context, in *QueryHistoricalInfoRequest, opts ...grpc.CallOption) (*QueryHistoricalInfoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryHistoricalInfoResponse) - err := c.cc.Invoke(ctx, Query_HistoricalInfo_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_HistoricalInfo_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -211,8 +225,9 @@ func (c *queryClient) HistoricalInfo(ctx context.Context, in *QueryHistoricalInf } func (c *queryClient) Pool(ctx context.Context, in *QueryPoolRequest, opts ...grpc.CallOption) (*QueryPoolResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryPoolResponse) - err := c.cc.Invoke(ctx, Query_Pool_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Pool_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -220,8 +235,9 @@ func (c *queryClient) Pool(ctx context.Context, in *QueryPoolRequest, opts ...gr } func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -230,7 +246,9 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer -// for forward compatibility +// for forward compatibility. +// +// Query defines the gRPC querier service. type QueryServer interface { // Validators queries all validators that match the given status. // @@ -288,9 +306,12 @@ type QueryServer interface { mustEmbedUnimplementedQueryServer() } -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} +// UnimplementedQueryServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedQueryServer struct{} func (UnimplementedQueryServer) Validators(context.Context, *QueryValidatorsRequest) (*QueryValidatorsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Validators not implemented") @@ -335,6 +356,7 @@ func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*Q return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} +func (UnimplementedQueryServer) testEmbeddedByValue() {} // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to QueryServer will @@ -344,6 +366,13 @@ type UnsafeQueryServer interface { } func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + // If the following call pancis, it indicates UnimplementedQueryServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Query_ServiceDesc, srv) } diff --git a/api/cosmos/staking/v1beta1/staking.pulsar.go b/api/cosmos/staking/v1beta1/staking.pulsar.go index a86d038bb8ab..9ec8314f45ca 100644 --- a/api/cosmos/staking/v1beta1/staking.pulsar.go +++ b/api/cosmos/staking/v1beta1/staking.pulsar.go @@ -13395,9 +13395,9 @@ type Delegation struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // delegator_address is the bech32-encoded address of the delegator. + // delegator_address is the encoded address of the delegator. DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` - // validator_address is the bech32-encoded address of the validator. + // validator_address is the encoded address of the validator. ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` // shares define the delegation shares received. Shares string `protobuf:"bytes,3,opt,name=shares,proto3" json:"shares,omitempty"` @@ -13451,9 +13451,9 @@ type UnbondingDelegation struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // delegator_address is the bech32-encoded address of the delegator. + // delegator_address is the encoded address of the delegator. DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` - // validator_address is the bech32-encoded address of the validator. + // validator_address is the encoded address of the validator. ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` // entries are the unbonding delegation entries. Entries []*UnbondingDelegationEntry `protobuf:"bytes,3,rep,name=entries,proto3" json:"entries,omitempty"` // unbonding delegation entries @@ -14062,377 +14062,368 @@ var file_cosmos_staking_v1beta1_staking_proto_rawDesc = []byte{ 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x73, 0x65, 0x74, 0x22, - 0xb7, 0x02, 0x0a, 0x0f, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, - 0x74, 0x65, 0x73, 0x12, 0x55, 0x0a, 0x04, 0x72, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x41, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, - 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, - 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x04, 0x72, 0x61, 0x74, 0x65, 0x12, 0x5c, 0x0a, 0x08, 0x6d, 0x61, - 0x78, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x41, 0xc8, 0xde, - 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, - 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, - 0x07, 0x6d, 0x61, 0x78, 0x52, 0x61, 0x74, 0x65, 0x12, 0x69, 0x0a, 0x0f, 0x6d, 0x61, 0x78, 0x5f, - 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x41, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, - 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, - 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0d, 0x6d, 0x61, 0x78, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, - 0x61, 0x74, 0x65, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0xc1, 0x01, 0x0a, 0x0a, 0x43, 0x6f, - 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x61, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x6d, - 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, - 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x74, 0x65, 0x73, 0x42, 0x0d, 0xc8, 0xde, 0x1f, - 0x00, 0xd0, 0xde, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x6d, - 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x74, 0x65, 0x73, 0x12, 0x4a, 0x0a, 0x0b, 0x75, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x0d, 0xc8, 0xde, - 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0xa8, 0x01, - 0x0a, 0x0b, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 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, 0x1a, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x12, 0x29, 0x0a, - 0x10, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, - 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, - 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, - 0x69, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, - 0x6c, 0x73, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0xb7, 0x07, 0x0a, 0x09, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x43, 0x0a, 0x10, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 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, 0x0f, 0x6f, 0x70, 0x65, 0x72, - 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x59, 0x0a, 0x10, 0x63, - 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x18, 0xca, 0xb4, 0x2d, - 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x50, - 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, - 0x50, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x6a, 0x61, 0x69, 0x6c, 0x65, 0x64, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x6a, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x3a, - 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, - 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x42, 0x6f, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x54, 0x0a, 0x06, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x3c, 0xc8, 0xde, 0x1f, 0x00, - 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, - 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x06, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, - 0x12, 0x67, 0x0a, 0x10, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x73, 0x68, - 0x61, 0x72, 0x65, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x3c, 0xc8, 0xde, 0x1f, 0x00, - 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, - 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, - 0x74, 0x6f, 0x72, 0x53, 0x68, 0x61, 0x72, 0x65, 0x73, 0x12, 0x50, 0x0a, 0x0b, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, - 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0b, - 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x75, - 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, - 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x50, 0x0a, 0x0e, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, - 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x0d, 0xc8, 0xde, 0x1f, 0x00, - 0x90, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0d, 0x75, 0x6e, 0x62, 0x6f, 0x6e, - 0x64, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x4d, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, - 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x63, 0x6f, 0x6d, - 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x6c, 0x0a, 0x13, 0x6d, 0x69, 0x6e, 0x5f, 0x73, - 0x65, 0x6c, 0x66, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0b, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x3c, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, - 0x6e, 0x74, 0x52, 0x11, 0x6d, 0x69, 0x6e, 0x53, 0x65, 0x6c, 0x66, 0x44, 0x65, 0x6c, 0x65, 0x67, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3c, 0x0a, 0x1b, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, - 0x6e, 0x67, 0x5f, 0x6f, 0x6e, 0x5f, 0x68, 0x6f, 0x6c, 0x64, 0x5f, 0x72, 0x65, 0x66, 0x5f, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x17, 0x75, 0x6e, 0x62, 0x6f, - 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x4f, 0x6e, 0x48, 0x6f, 0x6c, 0x64, 0x52, 0x65, 0x66, 0x43, 0x6f, - 0x75, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, - 0x5f, 0x69, 0x64, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x04, 0x52, 0x0c, 0x75, 0x6e, 0x62, 0x6f, - 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x73, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, - 0x1f, 0x00, 0x22, 0x46, 0x0a, 0x0c, 0x56, 0x61, 0x6c, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x65, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, - 0x01, 0x20, 0x03, 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, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x22, 0xa0, 0x01, 0x0a, 0x06, 0x44, - 0x56, 0x50, 0x61, 0x69, 0x72, 0x12, 0x45, 0x0a, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, - 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 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, 0x10, 0x64, 0x65, 0x6c, 0x65, - 0x67, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x45, 0x0a, 0x11, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, + 0x96, 0x02, 0x0a, 0x0f, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, + 0x74, 0x65, 0x73, 0x12, 0x4a, 0x0a, 0x04, 0x72, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x36, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, + 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x44, 0x65, 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x04, 0x72, 0x61, 0x74, 0x65, 0x12, + 0x51, 0x0a, 0x08, 0x6d, 0x61, 0x78, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x36, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, + 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x44, 0x65, 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x52, 0x61, + 0x74, 0x65, 0x12, 0x5e, 0x0a, 0x0f, 0x6d, 0x61, 0x78, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x36, 0xc8, 0xde, 0x1f, + 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, + 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, + 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, 0xe7, + 0xb0, 0x2a, 0x01, 0x52, 0x0d, 0x6d, 0x61, 0x78, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x61, + 0x74, 0x65, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0xc1, 0x01, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, + 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x61, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x6d, 0x69, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x74, 0x65, 0x73, 0x42, 0x0d, 0xc8, 0xde, 0x1f, 0x00, + 0xd0, 0xde, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x74, 0x65, 0x73, 0x12, 0x4a, 0x0a, 0x0b, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x0d, 0xc8, 0xde, 0x1f, + 0x00, 0x90, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0xa8, 0x01, 0x0a, + 0x0b, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 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, 0x1a, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x12, 0x29, 0x0a, 0x10, + 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, + 0x6c, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, + 0x73, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0x8a, 0x07, 0x0a, 0x09, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x43, 0x0a, 0x10, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, + 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 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, 0x0f, 0x6f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x59, 0x0a, 0x10, 0x63, 0x6f, + 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x18, 0xca, 0xb4, 0x2d, 0x14, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x50, 0x75, + 0x62, 0x4b, 0x65, 0x79, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, + 0x75, 0x62, 0x6b, 0x65, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x6a, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x6a, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x3a, 0x0a, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x42, 0x6f, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x43, 0x0a, 0x06, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, + 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, + 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x06, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x5c, + 0x0a, 0x10, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x73, 0x68, 0x61, 0x72, + 0x65, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, + 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, + 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, + 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0f, 0x64, 0x65, 0x6c, + 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x68, 0x61, 0x72, 0x65, 0x73, 0x12, 0x50, 0x0a, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, + 0x01, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x29, + 0x0a, 0x10, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x68, 0x65, 0x69, 0x67, + 0x68, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, + 0x69, 0x6e, 0x67, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x50, 0x0a, 0x0e, 0x75, 0x6e, 0x62, + 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x0d, 0xc8, + 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0d, 0x75, 0x6e, + 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x4d, 0x0a, 0x0a, 0x63, + 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, + 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x5b, 0x0a, 0x13, 0x6d, 0x69, + 0x6e, 0x5f, 0x73, 0x65, 0x6c, 0x66, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, + 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, + 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x11, 0x6d, 0x69, 0x6e, 0x53, 0x65, 0x6c, 0x66, 0x44, 0x65, 0x6c, + 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3c, 0x0a, 0x1b, 0x75, 0x6e, 0x62, 0x6f, 0x6e, + 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x6f, 0x6e, 0x5f, 0x68, 0x6f, 0x6c, 0x64, 0x5f, 0x72, 0x65, 0x66, + 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x17, 0x75, 0x6e, + 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x4f, 0x6e, 0x48, 0x6f, 0x6c, 0x64, 0x52, 0x65, 0x66, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, + 0x6e, 0x67, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x04, 0x52, 0x0c, 0x75, 0x6e, + 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x73, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, + 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0x46, 0x0a, 0x0c, 0x56, 0x61, 0x6c, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x65, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x03, 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, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0x4a, 0x0a, - 0x07, 0x44, 0x56, 0x50, 0x61, 0x69, 0x72, 0x73, 0x12, 0x3f, 0x0a, 0x05, 0x70, 0x61, 0x69, 0x72, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x67, 0x52, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x22, 0xa9, 0x01, 0x0a, + 0x06, 0x44, 0x56, 0x50, 0x61, 0x69, 0x72, 0x12, 0x45, 0x0a, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x67, + 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 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, 0x10, 0x64, 0x65, + 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x4e, + 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x10, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x08, + 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0x4a, 0x0a, 0x07, 0x44, 0x56, 0x50, 0x61, + 0x69, 0x72, 0x73, 0x12, 0x3f, 0x0a, 0x05, 0x70, 0x61, 0x69, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, + 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x56, 0x50, 0x61, + 0x69, 0x72, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x05, 0x70, + 0x61, 0x69, 0x72, 0x73, 0x22, 0x8b, 0x02, 0x0a, 0x0a, 0x44, 0x56, 0x56, 0x54, 0x72, 0x69, 0x70, + 0x6c, 0x65, 0x74, 0x12, 0x45, 0x0a, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 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, 0x10, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, + 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x55, 0x0a, 0x15, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x73, 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x13, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x72, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x12, 0x55, 0x0a, 0x15, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x64, + 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x52, 0x13, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x44, 0x73, + 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, + 0x1f, 0x00, 0x22, 0x58, 0x0a, 0x0b, 0x44, 0x56, 0x56, 0x54, 0x72, 0x69, 0x70, 0x6c, 0x65, 0x74, + 0x73, 0x12, 0x49, 0x0a, 0x08, 0x74, 0x72, 0x69, 0x70, 0x6c, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, + 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x56, 0x56, + 0x54, 0x72, 0x69, 0x70, 0x6c, 0x65, 0x74, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, + 0x2a, 0x01, 0x52, 0x08, 0x74, 0x72, 0x69, 0x70, 0x6c, 0x65, 0x74, 0x73, 0x22, 0xf8, 0x01, 0x0a, + 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x45, 0x0a, 0x11, 0x64, + 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 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, 0x10, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x12, 0x4e, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, + 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x12, 0x49, 0x0a, 0x06, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, + 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x06, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, 0x3a, 0x08, 0x88, + 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0x8d, 0x02, 0x0a, 0x13, 0x55, 0x6e, 0x62, 0x6f, + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x45, 0x0a, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 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, 0x10, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x4e, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x55, 0x0a, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x44, 0x56, 0x50, 0x61, 0x69, 0x72, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, - 0x2a, 0x01, 0x52, 0x05, 0x70, 0x61, 0x69, 0x72, 0x73, 0x22, 0xf9, 0x01, 0x0a, 0x0a, 0x44, 0x56, - 0x56, 0x54, 0x72, 0x69, 0x70, 0x6c, 0x65, 0x74, 0x12, 0x45, 0x0a, 0x11, 0x64, 0x65, 0x6c, 0x65, + 0x2e, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, + 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x3a, 0x08, 0x88, + 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0x9b, 0x03, 0x0a, 0x18, 0x55, 0x6e, 0x62, 0x6f, + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x52, 0x0a, + 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x42, 0x0d, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, 0x2a, + 0x01, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, + 0x65, 0x12, 0x54, 0x0a, 0x0f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x62, 0x61, 0x6c, + 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, + 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, + 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, + 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x45, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, + 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, + 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, + 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x21, + 0x0a, 0x0c, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x49, + 0x64, 0x12, 0x3c, 0x0a, 0x1b, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x6f, + 0x6e, 0x5f, 0x68, 0x6f, 0x6c, 0x64, 0x5f, 0x72, 0x65, 0x66, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x17, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, + 0x67, 0x4f, 0x6e, 0x48, 0x6f, 0x6c, 0x64, 0x52, 0x65, 0x66, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x3a, + 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0x9f, 0x03, 0x0a, 0x11, 0x52, 0x65, 0x64, 0x65, 0x6c, 0x65, + 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x27, 0x0a, 0x0f, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x12, 0x52, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x0d, 0xc8, 0xde, 0x1f, 0x00, 0x90, + 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, + 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x54, 0x0a, 0x0f, 0x69, 0x6e, 0x69, 0x74, + 0x69, 0x61, 0x6c, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, + 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0e, + 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x50, + 0x0a, 0x0a, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, 0x5f, 0x64, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, + 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x09, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, 0x44, 0x73, 0x74, + 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x64, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, + 0x67, 0x49, 0x64, 0x12, 0x3c, 0x0a, 0x1b, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, + 0x5f, 0x6f, 0x6e, 0x5f, 0x68, 0x6f, 0x6c, 0x64, 0x5f, 0x72, 0x65, 0x66, 0x5f, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x17, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, + 0x69, 0x6e, 0x67, 0x4f, 0x6e, 0x48, 0x6f, 0x6c, 0x64, 0x52, 0x65, 0x66, 0x43, 0x6f, 0x75, 0x6e, + 0x74, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0xdd, 0x02, 0x0a, 0x0c, 0x52, 0x65, 0x64, 0x65, + 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x45, 0x0a, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 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, 0x10, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, - 0x4c, 0x0a, 0x15, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x73, 0x72, 0x63, - 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, - 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x55, 0x0a, 0x15, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x73, 0x72, 0x63, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, + 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x52, 0x13, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x72, 0x63, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x55, 0x0a, 0x15, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x5f, 0x64, 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x13, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x53, 0x72, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x4c, 0x0a, - 0x15, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x64, 0x73, 0x74, 0x5f, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 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, 0x13, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x44, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x08, 0x88, 0xa0, 0x1f, - 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0x58, 0x0a, 0x0b, 0x44, 0x56, 0x56, 0x54, 0x72, 0x69, 0x70, - 0x6c, 0x65, 0x74, 0x73, 0x12, 0x49, 0x0a, 0x08, 0x74, 0x72, 0x69, 0x70, 0x6c, 0x65, 0x74, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x44, 0x56, 0x56, 0x54, 0x72, 0x69, 0x70, 0x6c, 0x65, 0x74, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, - 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x08, 0x74, 0x72, 0x69, 0x70, 0x6c, 0x65, 0x74, 0x73, 0x22, - 0xfa, 0x01, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x45, - 0x0a, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 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, 0x10, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x45, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 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, 0x10, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x54, 0x0a, 0x06, - 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x3c, 0xc8, 0xde, - 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, - 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x06, 0x73, 0x68, 0x61, 0x72, - 0x65, 0x73, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0x84, 0x02, 0x0a, - 0x13, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x45, 0x0a, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, - 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 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, 0x10, 0x64, 0x65, 0x6c, 0x65, 0x67, - 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x45, 0x0a, 0x11, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 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, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x12, 0x55, 0x0a, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, - 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x6e, 0x62, - 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, - 0x52, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, - 0xa0, 0x1f, 0x00, 0x22, 0xbd, 0x03, 0x0a, 0x18, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, - 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x69, - 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x52, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, - 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x0d, - 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0e, 0x63, - 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x65, 0x0a, - 0x0f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x3c, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x42, 0x61, 0x6c, - 0x61, 0x6e, 0x63, 0x65, 0x12, 0x56, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x3c, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x49, 0x6e, 0x74, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x21, 0x0a, 0x0c, - 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x0b, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x12, - 0x3c, 0x0a, 0x1b, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x6f, 0x6e, 0x5f, - 0x68, 0x6f, 0x6c, 0x64, 0x5f, 0x72, 0x65, 0x66, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x17, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x4f, - 0x6e, 0x48, 0x6f, 0x6c, 0x64, 0x52, 0x65, 0x66, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x04, 0xe8, - 0xa0, 0x1f, 0x01, 0x22, 0xbb, 0x03, 0x0a, 0x11, 0x52, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x69, 0x67, - 0x68, 0x74, 0x12, 0x52, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x0d, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, - 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, - 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x65, 0x0a, 0x0f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, - 0x6c, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x3c, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0xd2, - 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0e, 0x69, - 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x5b, 0x0a, - 0x0a, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, 0x5f, 0x64, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x3c, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, - 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, - 0x09, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, 0x44, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x6e, - 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x0b, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x12, 0x3c, 0x0a, - 0x1b, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x6f, 0x6e, 0x5f, 0x68, 0x6f, - 0x6c, 0x64, 0x5f, 0x72, 0x65, 0x66, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x17, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x4f, 0x6e, 0x48, - 0x6f, 0x6c, 0x64, 0x52, 0x65, 0x66, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, - 0x01, 0x22, 0xcb, 0x02, 0x0a, 0x0c, 0x52, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x45, 0x0a, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 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, 0x10, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, - 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x4c, 0x0a, 0x15, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x73, 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 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, 0x13, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x72, 0x63, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x4c, 0x0a, 0x15, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x64, 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x18, 0x03, 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, 0x13, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x44, 0x73, 0x74, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x4e, 0x0a, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, - 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x52, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x07, 0x65, 0x6e, - 0x74, 0x72, 0x69, 0x65, 0x73, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, - 0xa7, 0x03, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x4f, 0x0a, 0x0e, 0x75, 0x6e, - 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0d, 0xc8, - 0xde, 0x1f, 0x00, 0x98, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0d, 0x75, 0x6e, - 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6d, - 0x61, 0x78, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x6d, 0x61, 0x78, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x61, 0x78, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, - 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x6d, 0x61, 0x78, 0x45, 0x6e, 0x74, 0x72, - 0x69, 0x65, 0x73, 0x12, 0x2d, 0x0a, 0x12, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, - 0x6c, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x11, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x69, - 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6f, 0x6e, 0x64, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x6f, 0x6e, 0x64, 0x44, 0x65, 0x6e, 0x6f, - 0x6d, 0x12, 0x8f, 0x01, 0x0a, 0x13, 0x6d, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x5f, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xf2, - 0xde, 0x1f, 0x1a, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6d, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x6d, - 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x22, 0xd2, 0xb4, 0x2d, - 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, - 0x52, 0x11, 0x6d, 0x69, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, - 0x61, 0x74, 0x65, 0x3a, 0x24, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x1b, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, - 0x6e, 0x67, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xa9, 0x01, 0x0a, 0x12, 0x44, 0x65, - 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x4d, 0x0a, 0x0a, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, - 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, - 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, - 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x3e, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, - 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x3a, - 0x04, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0xde, 0x01, 0x0a, 0x19, 0x52, 0x65, 0x64, 0x65, 0x6c, 0x65, - 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x63, 0x0a, 0x12, 0x72, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, - 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x11, 0x72, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x56, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, - 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x3c, 0xc8, 0xde, 0x1f, 0x00, 0xda, - 0xde, 0x1f, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, - 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0xc9, 0x01, 0x0a, 0x14, 0x52, 0x65, 0x64, 0x65, 0x6c, - 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x53, 0x0a, 0x0c, 0x72, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, - 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, - 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, - 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0c, 0x72, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x56, 0x0a, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, - 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, - 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, - 0xb0, 0x2a, 0x01, 0x52, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x3a, 0x04, 0xe8, 0xa0, - 0x1f, 0x00, 0x22, 0x8e, 0x02, 0x0a, 0x04, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x82, 0x01, 0x0a, 0x11, - 0x6e, 0x6f, 0x74, 0x5f, 0x62, 0x6f, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x56, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, - 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0xea, 0xde, 0x1f, 0x11, 0x6e, 0x6f, 0x74, 0x5f, 0x62, - 0x6f, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0xd2, 0xb4, 0x2d, 0x0a, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, - 0x0f, 0x6e, 0x6f, 0x74, 0x42, 0x6f, 0x6e, 0x64, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, - 0x12, 0x77, 0x0a, 0x0d, 0x62, 0x6f, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x52, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, - 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0xea, 0xde, 0x1f, 0x0d, 0x62, 0x6f, 0x6e, 0x64, 0x65, - 0x64, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0c, 0x62, 0x6f, 0x6e, - 0x64, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x3a, 0x08, 0xe8, 0xa0, 0x1f, 0x01, 0xf0, - 0xa0, 0x1f, 0x01, 0x22, 0x59, 0x0a, 0x10, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x12, 0x45, 0x0a, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, - 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, - 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x2a, 0xb6, - 0x01, 0x0a, 0x0a, 0x42, 0x6f, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2c, 0x0a, - 0x17, 0x42, 0x4f, 0x4e, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, - 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x1a, 0x0f, 0x8a, 0x9d, 0x20, 0x0b, - 0x55, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x14, 0x42, - 0x4f, 0x4e, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x42, 0x4f, 0x4e, - 0x44, 0x45, 0x44, 0x10, 0x01, 0x1a, 0x0c, 0x8a, 0x9d, 0x20, 0x08, 0x55, 0x6e, 0x62, 0x6f, 0x6e, - 0x64, 0x65, 0x64, 0x12, 0x28, 0x0a, 0x15, 0x42, 0x4f, 0x4e, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x54, - 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x42, 0x4f, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x1a, 0x0d, - 0x8a, 0x9d, 0x20, 0x09, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x22, 0x0a, - 0x12, 0x42, 0x4f, 0x4e, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x42, 0x4f, 0x4e, - 0x44, 0x45, 0x44, 0x10, 0x03, 0x1a, 0x0a, 0x8a, 0x9d, 0x20, 0x06, 0x42, 0x6f, 0x6e, 0x64, 0x65, - 0x64, 0x1a, 0x04, 0x88, 0xa3, 0x1e, 0x00, 0x2a, 0x5d, 0x0a, 0x0a, 0x49, 0x6e, 0x66, 0x72, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x16, 0x49, 0x4e, 0x46, 0x52, 0x41, 0x43, 0x54, - 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, - 0x00, 0x12, 0x1a, 0x0a, 0x16, 0x49, 0x4e, 0x46, 0x52, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, - 0x44, 0x4f, 0x55, 0x42, 0x4c, 0x45, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x10, 0x01, 0x12, 0x17, 0x0a, - 0x13, 0x49, 0x4e, 0x46, 0x52, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x44, 0x4f, 0x57, 0x4e, - 0x54, 0x49, 0x4d, 0x45, 0x10, 0x02, 0x42, 0xdc, 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x63, + 0x74, 0x6f, 0x72, 0x44, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x4e, 0x0a, + 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, + 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x3a, 0x08, 0x88, + 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0x9c, 0x03, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x4f, 0x0a, 0x0e, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0d, 0xc8, 0xde, 0x1f, 0x00, 0x98, 0xdf, 0x1f, 0x01, 0xa8, + 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0d, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x54, + 0x69, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6d, 0x61, 0x78, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x6d, 0x61, 0x78, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x61, + 0x78, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x0a, 0x6d, 0x61, 0x78, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x2d, 0x0a, 0x12, 0x68, + 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, + 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x11, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, + 0x63, 0x61, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6f, + 0x6e, 0x64, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x62, 0x6f, 0x6e, 0x64, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x84, 0x01, 0x0a, 0x13, 0x6d, 0x69, + 0x6e, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x74, + 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x54, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, + 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, + 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xf2, 0xde, 0x1f, 0x1a, + 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6d, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x22, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x11, 0x6d, + 0x69, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x74, 0x65, + 0x3a, 0x24, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xa9, 0x01, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x67, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, + 0x0a, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x67, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, + 0x52, 0x0a, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x07, + 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, + 0xb0, 0x2a, 0x01, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x3a, 0x04, 0xe8, 0xa0, + 0x1f, 0x00, 0x22, 0xcd, 0x01, 0x0a, 0x19, 0x52, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x63, 0x0a, 0x12, 0x72, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0c, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, - 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, - 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x73, - 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, - 0x43, 0x53, 0x58, 0xaa, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x53, 0x74, 0x61, - 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x16, 0x43, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, - 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x18, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, + 0x2a, 0x01, 0x52, 0x11, 0x72, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x45, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, + 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x49, 0x6e, 0x74, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x3a, 0x04, 0xe8, 0xa0, + 0x1f, 0x01, 0x22, 0xc9, 0x01, 0x0a, 0x14, 0x52, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x0c, 0x72, + 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x64, 0x65, 0x6c, + 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, + 0x2a, 0x01, 0x52, 0x0c, 0x72, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x56, 0x0a, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x31, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x64, 0x65, 0x6c, + 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, + 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0xeb, + 0x01, 0x0a, 0x04, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x71, 0x0a, 0x11, 0x6e, 0x6f, 0x74, 0x5f, 0x62, + 0x6f, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x45, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, + 0x74, 0xea, 0xde, 0x1f, 0x11, 0x6e, 0x6f, 0x74, 0x5f, 0x62, 0x6f, 0x6e, 0x64, 0x65, 0x64, 0x5f, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x49, 0x6e, 0x74, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0f, 0x6e, 0x6f, 0x74, 0x42, 0x6f, + 0x6e, 0x64, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x66, 0x0a, 0x0d, 0x62, 0x6f, + 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x41, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, + 0xea, 0xde, 0x1f, 0x0d, 0x62, 0x6f, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x73, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0xa8, + 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0c, 0x62, 0x6f, 0x6e, 0x64, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x73, 0x3a, 0x08, 0xe8, 0xa0, 0x1f, 0x01, 0xf0, 0xa0, 0x1f, 0x01, 0x22, 0x59, 0x0a, 0x10, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, + 0x12, 0x45, 0x0a, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x20, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, + 0x62, 0x63, 0x69, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x07, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x2a, 0xb6, 0x01, 0x0a, 0x0a, 0x42, 0x6f, 0x6e, 0x64, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2c, 0x0a, 0x17, 0x42, 0x4f, 0x4e, 0x44, 0x5f, 0x53, + 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, + 0x44, 0x10, 0x00, 0x1a, 0x0f, 0x8a, 0x9d, 0x20, 0x0b, 0x55, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x69, + 0x66, 0x69, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x14, 0x42, 0x4f, 0x4e, 0x44, 0x5f, 0x53, 0x54, 0x41, + 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x42, 0x4f, 0x4e, 0x44, 0x45, 0x44, 0x10, 0x01, 0x1a, 0x0c, + 0x8a, 0x9d, 0x20, 0x08, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x65, 0x64, 0x12, 0x28, 0x0a, 0x15, + 0x42, 0x4f, 0x4e, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x42, 0x4f, + 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x1a, 0x0d, 0x8a, 0x9d, 0x20, 0x09, 0x55, 0x6e, 0x62, + 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x22, 0x0a, 0x12, 0x42, 0x4f, 0x4e, 0x44, 0x5f, 0x53, + 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x42, 0x4f, 0x4e, 0x44, 0x45, 0x44, 0x10, 0x03, 0x1a, 0x0a, + 0x8a, 0x9d, 0x20, 0x06, 0x42, 0x6f, 0x6e, 0x64, 0x65, 0x64, 0x1a, 0x04, 0x88, 0xa3, 0x1e, 0x00, + 0x2a, 0x5d, 0x0a, 0x0a, 0x49, 0x6e, 0x66, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, + 0x0a, 0x16, 0x49, 0x4e, 0x46, 0x52, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, + 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1a, 0x0a, 0x16, 0x49, 0x4e, + 0x46, 0x52, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x44, 0x4f, 0x55, 0x42, 0x4c, 0x45, 0x5f, + 0x53, 0x49, 0x47, 0x4e, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x49, 0x4e, 0x46, 0x52, 0x41, 0x43, + 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x44, 0x4f, 0x57, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x10, 0x02, 0x42, + 0xdc, 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, + 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0c, + 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x53, 0x58, 0xaa, 0x02, 0x16, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, + 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, + 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5c, + 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x74, + 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/staking/v1beta1/tx.pulsar.go b/api/cosmos/staking/v1beta1/tx.pulsar.go index 39cb6d1aca38..37cae89fdee7 100644 --- a/api/cosmos/staking/v1beta1/tx.pulsar.go +++ b/api/cosmos/staking/v1beta1/tx.pulsar.go @@ -7793,7 +7793,7 @@ var file_cosmos_staking_v1beta1_tx_proto_rawDesc = []byte{ 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 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, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, - 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8c, 0x05, 0x0a, 0x12, 0x4d, 0x73, 0x67, + 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xfb, 0x04, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x50, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, @@ -7805,252 +7805,249 @@ var file_cosmos_staking_v1beta1_tx_proto_rawDesc = []byte{ 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x74, 0x65, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x71, 0x0a, 0x13, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x6c, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x60, 0x0a, 0x13, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x6c, 0x66, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x41, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x49, - 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, - 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x11, 0x6d, 0x69, 0x6e, 0x53, 0x65, 0x6c, 0x66, 0x44, 0x65, - 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x47, 0x0a, 0x11, 0x64, 0x65, 0x6c, 0x65, - 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x1a, 0x18, 0x01, 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, - 0x10, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x12, 0x4e, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, 0xb4, + 0x28, 0x09, 0x42, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, + 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0xa8, + 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x11, 0x6d, 0x69, 0x6e, 0x53, 0x65, 0x6c, 0x66, 0x44, 0x65, 0x6c, + 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x47, 0x0a, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x67, + 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x1a, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x52, 0x10, + 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x12, 0x4e, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, 0xb4, 0x2d, + 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x10, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x12, 0x46, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x18, 0xca, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, + 0x52, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x12, 0x3a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, + 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x40, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, + 0xb0, 0x2a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, + 0x73, 0x64, 0x6b, 0x2f, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x22, 0x1c, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xa5, 0x03, 0x0a, 0x10, 0x4d, 0x73, 0x67, 0x45, 0x64, 0x69, 0x74, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x50, 0x0a, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4e, 0x0a, 0x11, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x56, 0x0a, 0x0f, 0x63, + 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x2d, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, + 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x44, 0x65, 0x63, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, + 0x61, 0x74, 0x65, 0x12, 0x57, 0x0a, 0x13, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x6c, 0x66, 0x5f, + 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x27, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, + 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x11, 0x6d, 0x69, 0x6e, 0x53, 0x65, + 0x6c, 0x66, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x3e, 0x88, 0xa0, + 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, 0xb0, 0x2a, + 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x4d, 0x73, 0x67, 0x45, + 0x64, 0x69, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x22, 0x1a, 0x0a, 0x18, + 0x4d, 0x73, 0x67, 0x45, 0x64, 0x69, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x9d, 0x02, 0x0a, 0x0b, 0x4d, 0x73, 0x67, + 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x45, 0x0a, 0x11, 0x64, 0x65, 0x6c, 0x65, + 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 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, 0x10, 0x64, + 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, + 0x4e, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x10, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, + 0x3c, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, + 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x39, 0x88, + 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x11, 0x64, 0x65, 0x6c, 0x65, + 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, 0xb0, + 0x2a, 0x16, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x4d, 0x73, 0x67, + 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x22, 0x15, 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x44, + 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x89, 0x03, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x64, 0x65, + 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x45, 0x0a, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, + 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 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, 0x10, 0x64, 0x65, 0x6c, + 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x55, 0x0a, + 0x15, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x73, 0x72, 0x63, 0x5f, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, - 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x12, 0x46, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x18, 0xca, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, - 0x79, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x12, 0x3a, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, - 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x40, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, - 0xe7, 0xb0, 0x2a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x22, 0x1c, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xc1, 0x03, 0x0a, 0x10, 0x4d, 0x73, 0x67, 0x45, 0x64, 0x69, - 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x50, 0x0a, 0x0b, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4e, 0x0a, 0x11, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x61, 0x0a, 0x0f, - 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x38, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, - 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, - 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x74, 0x65, 0x12, - 0x68, 0x0a, 0x13, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x6c, 0x66, 0x5f, 0x64, 0x65, 0x6c, 0x65, - 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x38, 0xda, 0xde, - 0x1f, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x11, 0x6d, 0x69, 0x6e, 0x53, 0x65, 0x6c, 0x66, 0x44, - 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x3e, 0x88, 0xa0, 0x1f, 0x00, 0xe8, - 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x1b, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x4d, 0x73, 0x67, 0x45, 0x64, 0x69, 0x74, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x22, 0x1a, 0x0a, 0x18, 0x4d, 0x73, 0x67, - 0x45, 0x64, 0x69, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x9d, 0x02, 0x0a, 0x0b, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x6c, - 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x45, 0x0a, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, - 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 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, 0x10, 0x64, 0x65, 0x6c, 0x65, - 0x67, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x4e, 0x0a, 0x11, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3c, 0x0a, 0x06, - 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, - 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x39, 0x88, 0xa0, 0x1f, 0x00, - 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, - 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x16, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x6c, - 0x65, 0x67, 0x61, 0x74, 0x65, 0x22, 0x15, 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x6c, 0x65, - 0x67, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x89, 0x03, 0x0a, - 0x12, 0x4d, 0x73, 0x67, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, - 0x61, 0x74, 0x65, 0x12, 0x45, 0x0a, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, - 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 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, 0x10, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, - 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x55, 0x0a, 0x15, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x73, 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x13, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x72, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x12, 0x55, 0x0a, 0x15, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x64, - 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x13, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x72, 0x63, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x12, 0x55, 0x0a, 0x15, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x5f, 0x64, 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x13, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x44, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3c, 0x0a, 0x06, 0x61, + 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, + 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x40, 0x88, 0xa0, 0x1f, 0x00, 0xe8, + 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, + 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x1d, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x4d, 0x73, 0x67, 0x42, 0x65, 0x67, 0x69, + 0x6e, 0x52, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x22, 0x70, 0x0a, 0x1a, 0x4d, + 0x73, 0x67, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, + 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x0d, + 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0e, 0x63, + 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xa1, 0x02, + 0x0a, 0x0d, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, + 0x45, 0x0a, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 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, 0x10, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x4e, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3c, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, + 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, + 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x3b, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, + 0xb0, 0x2a, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x18, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, + 0x73, 0x64, 0x6b, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, + 0x65, 0x22, 0xa9, 0x01, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, 0x0f, 0x63, + 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x42, 0x0d, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, + 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, + 0x3c, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, + 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xe8, 0x02, + 0x0a, 0x1c, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x55, 0x6e, 0x62, 0x6f, 0x6e, + 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x45, + 0x0a, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 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, 0x10, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x4e, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x52, 0x13, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x44, 0x73, - 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3c, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, - 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, - 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x40, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, - 0x82, 0xe7, 0xb0, 0x2a, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x4d, 0x73, 0x67, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x52, 0x65, - 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x22, 0x70, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x42, - 0x65, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x0d, 0xc8, 0xde, 0x1f, - 0x00, 0x90, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x70, - 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xa1, 0x02, 0x0a, 0x0d, 0x4d, - 0x73, 0x67, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x45, 0x0a, 0x11, - 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, + 0x69, 0x6e, 0x67, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3c, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, + 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, + 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x4a, 0x88, 0xa0, + 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x67, + 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, 0xb0, 0x2a, + 0x27, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x4d, 0x73, 0x67, 0x43, + 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, + 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x26, 0x0a, 0x24, 0x4d, 0x73, 0x67, 0x43, + 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, + 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0xc5, 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, 0x10, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x12, 0x4e, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, - 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x12, 0x3c, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, - 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, - 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, - 0x74, 0x3a, 0x3b, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x11, - 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x18, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, - 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x22, 0xa9, - 0x01, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x70, - 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x0d, 0xc8, - 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0e, 0x63, 0x6f, - 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3c, 0x0a, 0x06, - 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, - 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xe8, 0x02, 0x0a, 0x1c, 0x4d, - 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, - 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x45, 0x0a, 0x11, 0x64, - 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 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, 0x10, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x12, 0x4e, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, - 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x12, 0x3c, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, - 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x69, - 0x67, 0x68, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x4a, 0x88, 0xa0, 0x1f, 0x00, 0xe8, - 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, - 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x27, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, - 0x65, 0x6c, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x26, 0x0a, 0x24, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, - 0x65, 0x6c, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xc5, 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, 0x41, 0x0a, 0x06, 0x70, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, - 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x37, 0x82, 0xe7, - 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, - 0x24, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, 0x73, 0x74, - 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x32, 0x9d, 0x06, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x71, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x2a, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x1a, 0x32, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6b, 0x0a, 0x0d, 0x45, - 0x64, 0x69, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x28, 0x2e, 0x63, + 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x41, 0x0a, 0x06, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x64, 0x69, 0x74, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x1a, 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x4d, 0x73, 0x67, 0x45, 0x64, 0x69, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x08, 0x44, 0x65, 0x6c, 0x65, - 0x67, 0x61, 0x74, 0x65, 0x12, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, - 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, - 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x1a, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x71, 0x0a, 0x0f, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x52, - 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, + 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, + 0x37, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, + 0xe7, 0xb0, 0x2a, 0x24, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x78, + 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x32, 0x9d, 0x06, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x71, 0x0a, 0x0f, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x2a, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x1a, 0x32, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6b, + 0x0a, 0x0d, 0x45, 0x64, 0x69, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, + 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x64, 0x69, 0x74, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x1a, 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x64, 0x65, 0x6c, - 0x65, 0x67, 0x61, 0x74, 0x65, 0x1a, 0x32, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, - 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, - 0x73, 0x67, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x62, 0x0a, 0x0a, 0x55, 0x6e, 0x64, - 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x25, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x64, 0x69, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x08, 0x44, + 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x1a, 0x2d, + 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x1a, 0x2b, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x71, 0x0a, 0x0f, 0x42, 0x65, 0x67, + 0x69, 0x6e, 0x52, 0x65, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x2a, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x52, 0x65, + 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x1a, 0x32, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x64, 0x65, 0x6c, 0x65, + 0x67, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x62, 0x0a, 0x0a, + 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x25, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, + 0x65, 0x1a, 0x2d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, + 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x8f, 0x01, 0x0a, 0x19, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x55, 0x6e, 0x62, 0x6f, 0x6e, + 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x34, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x64, 0x65, 0x6c, - 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x8f, 0x01, - 0x0a, 0x19, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, - 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x34, 0x2e, 0x63, 0x6f, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, + 0x6c, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x3c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, + 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, + 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, + 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x68, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, + 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x55, 0x6e, - 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x1a, 0x3c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, - 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x61, - 0x6e, 0x63, 0x65, 0x6c, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, - 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x68, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, - 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, - 0x42, 0xd7, 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, - 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x3b, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x53, 0x58, 0xaa, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0xca, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x74, 0x61, 0x6b, 0x69, - 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x22, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, - 0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, + 0xb0, 0x2a, 0x01, 0x42, 0xd7, 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x53, 0x58, 0xaa, 0x02, 0x16, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x74, + 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x22, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5c, 0x56, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x74, 0x61, + 0x6b, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/staking/v1beta1/tx_grpc.pb.go b/api/cosmos/staking/v1beta1/tx_grpc.pb.go index 84a8c06e8998..a177942078ca 100644 --- a/api/cosmos/staking/v1beta1/tx_grpc.pb.go +++ b/api/cosmos/staking/v1beta1/tx_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/staking/v1beta1/tx.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Msg_CreateValidator_FullMethodName = "/cosmos.staking.v1beta1.Msg/CreateValidator" @@ -31,6 +31,8 @@ const ( // MsgClient is the client API for Msg service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Msg defines the staking Msg service. type MsgClient interface { // CreateValidator defines a method for creating a new validator. CreateValidator(ctx context.Context, in *MsgCreateValidator, opts ...grpc.CallOption) (*MsgCreateValidatorResponse, error) @@ -65,8 +67,9 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { } func (c *msgClient) CreateValidator(ctx context.Context, in *MsgCreateValidator, opts ...grpc.CallOption) (*MsgCreateValidatorResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgCreateValidatorResponse) - err := c.cc.Invoke(ctx, Msg_CreateValidator_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_CreateValidator_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -74,8 +77,9 @@ func (c *msgClient) CreateValidator(ctx context.Context, in *MsgCreateValidator, } func (c *msgClient) EditValidator(ctx context.Context, in *MsgEditValidator, opts ...grpc.CallOption) (*MsgEditValidatorResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgEditValidatorResponse) - err := c.cc.Invoke(ctx, Msg_EditValidator_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_EditValidator_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -83,8 +87,9 @@ func (c *msgClient) EditValidator(ctx context.Context, in *MsgEditValidator, opt } func (c *msgClient) Delegate(ctx context.Context, in *MsgDelegate, opts ...grpc.CallOption) (*MsgDelegateResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgDelegateResponse) - err := c.cc.Invoke(ctx, Msg_Delegate_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_Delegate_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -92,8 +97,9 @@ func (c *msgClient) Delegate(ctx context.Context, in *MsgDelegate, opts ...grpc. } func (c *msgClient) BeginRedelegate(ctx context.Context, in *MsgBeginRedelegate, opts ...grpc.CallOption) (*MsgBeginRedelegateResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgBeginRedelegateResponse) - err := c.cc.Invoke(ctx, Msg_BeginRedelegate_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_BeginRedelegate_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -101,8 +107,9 @@ func (c *msgClient) BeginRedelegate(ctx context.Context, in *MsgBeginRedelegate, } func (c *msgClient) Undelegate(ctx context.Context, in *MsgUndelegate, opts ...grpc.CallOption) (*MsgUndelegateResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgUndelegateResponse) - err := c.cc.Invoke(ctx, Msg_Undelegate_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_Undelegate_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -110,8 +117,9 @@ func (c *msgClient) Undelegate(ctx context.Context, in *MsgUndelegate, opts ...g } func (c *msgClient) CancelUnbondingDelegation(ctx context.Context, in *MsgCancelUnbondingDelegation, opts ...grpc.CallOption) (*MsgCancelUnbondingDelegationResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgCancelUnbondingDelegationResponse) - err := c.cc.Invoke(ctx, Msg_CancelUnbondingDelegation_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_CancelUnbondingDelegation_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -119,8 +127,9 @@ func (c *msgClient) CancelUnbondingDelegation(ctx context.Context, in *MsgCancel } func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -129,7 +138,9 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer -// for forward compatibility +// for forward compatibility. +// +// Msg defines the staking Msg service. type MsgServer interface { // CreateValidator defines a method for creating a new validator. CreateValidator(context.Context, *MsgCreateValidator) (*MsgCreateValidatorResponse, error) @@ -156,9 +167,12 @@ type MsgServer interface { mustEmbedUnimplementedMsgServer() } -// UnimplementedMsgServer must be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} +// UnimplementedMsgServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedMsgServer struct{} func (UnimplementedMsgServer) CreateValidator(context.Context, *MsgCreateValidator) (*MsgCreateValidatorResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateValidator not implemented") @@ -182,6 +196,7 @@ func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (* return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} +func (UnimplementedMsgServer) testEmbeddedByValue() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to MsgServer will @@ -191,6 +206,13 @@ type UnsafeMsgServer interface { } func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + // If the following call pancis, it indicates UnimplementedMsgServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Msg_ServiceDesc, srv) } diff --git a/api/cosmos/store/streaming/abci/grpc_grpc.pb.go b/api/cosmos/store/streaming/abci/grpc_grpc.pb.go index 684b5f911ecd..b75d773bde3c 100644 --- a/api/cosmos/store/streaming/abci/grpc_grpc.pb.go +++ b/api/cosmos/store/streaming/abci/grpc_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/store/streaming/abci/grpc.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( ABCIListenerService_ListenFinalizeBlock_FullMethodName = "/cosmos.store.streaming.abci.ABCIListenerService/ListenFinalizeBlock" @@ -26,6 +26,8 @@ const ( // ABCIListenerServiceClient is the client API for ABCIListenerService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// ABCIListenerService is the service for the BaseApp ABCIListener interface type ABCIListenerServiceClient interface { // ListenFinalizeBlock is the corresponding endpoint for ABCIListener.ListenEndBlock ListenFinalizeBlock(ctx context.Context, in *ListenFinalizeBlockRequest, opts ...grpc.CallOption) (*ListenFinalizeBlockResponse, error) @@ -42,8 +44,9 @@ func NewABCIListenerServiceClient(cc grpc.ClientConnInterface) ABCIListenerServi } func (c *aBCIListenerServiceClient) ListenFinalizeBlock(ctx context.Context, in *ListenFinalizeBlockRequest, opts ...grpc.CallOption) (*ListenFinalizeBlockResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ListenFinalizeBlockResponse) - err := c.cc.Invoke(ctx, ABCIListenerService_ListenFinalizeBlock_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ABCIListenerService_ListenFinalizeBlock_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -51,8 +54,9 @@ func (c *aBCIListenerServiceClient) ListenFinalizeBlock(ctx context.Context, in } func (c *aBCIListenerServiceClient) ListenCommit(ctx context.Context, in *ListenCommitRequest, opts ...grpc.CallOption) (*ListenCommitResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ListenCommitResponse) - err := c.cc.Invoke(ctx, ABCIListenerService_ListenCommit_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ABCIListenerService_ListenCommit_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -61,7 +65,9 @@ func (c *aBCIListenerServiceClient) ListenCommit(ctx context.Context, in *Listen // ABCIListenerServiceServer is the server API for ABCIListenerService service. // All implementations must embed UnimplementedABCIListenerServiceServer -// for forward compatibility +// for forward compatibility. +// +// ABCIListenerService is the service for the BaseApp ABCIListener interface type ABCIListenerServiceServer interface { // ListenFinalizeBlock is the corresponding endpoint for ABCIListener.ListenEndBlock ListenFinalizeBlock(context.Context, *ListenFinalizeBlockRequest) (*ListenFinalizeBlockResponse, error) @@ -70,9 +76,12 @@ type ABCIListenerServiceServer interface { mustEmbedUnimplementedABCIListenerServiceServer() } -// UnimplementedABCIListenerServiceServer must be embedded to have forward compatible implementations. -type UnimplementedABCIListenerServiceServer struct { -} +// UnimplementedABCIListenerServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedABCIListenerServiceServer struct{} func (UnimplementedABCIListenerServiceServer) ListenFinalizeBlock(context.Context, *ListenFinalizeBlockRequest) (*ListenFinalizeBlockResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListenFinalizeBlock not implemented") @@ -81,6 +90,7 @@ func (UnimplementedABCIListenerServiceServer) ListenCommit(context.Context, *Lis return nil, status.Errorf(codes.Unimplemented, "method ListenCommit not implemented") } func (UnimplementedABCIListenerServiceServer) mustEmbedUnimplementedABCIListenerServiceServer() {} +func (UnimplementedABCIListenerServiceServer) testEmbeddedByValue() {} // UnsafeABCIListenerServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to ABCIListenerServiceServer will @@ -90,6 +100,13 @@ type UnsafeABCIListenerServiceServer interface { } func RegisterABCIListenerServiceServer(s grpc.ServiceRegistrar, srv ABCIListenerServiceServer) { + // If the following call pancis, it indicates UnimplementedABCIListenerServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&ABCIListenerService_ServiceDesc, srv) } diff --git a/api/cosmos/tx/signing/v1beta1/signing.pulsar.go b/api/cosmos/tx/signing/v1beta1/signing.pulsar.go index 0e6c12827053..831e47585df9 100644 --- a/api/cosmos/tx/signing/v1beta1/signing.pulsar.go +++ b/api/cosmos/tx/signing/v1beta1/signing.pulsar.go @@ -2723,14 +2723,13 @@ const ( SignMode_SIGN_MODE_DIRECT SignMode = 1 // SIGN_MODE_TEXTUAL is a future signing mode that will verify some // human-readable textual representation on top of the binary representation - // from SIGN_MODE_DIRECT. It is currently experimental, and should be used - // for testing purposes only, until Textual is fully released. Please follow - // the tracking issue https://github.com/cosmos/cosmos-sdk/issues/11970. + // from SIGN_MODE_DIRECT. + // + // Since: cosmos-sdk 0.50 SignMode_SIGN_MODE_TEXTUAL SignMode = 2 // SIGN_MODE_DIRECT_AUX specifies a signing mode which uses // SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not - // require signers signing over other signers' `signer_info`. It also allows - // for adding Tips in transactions. + // require signers signing over other signers' `signer_info`. // // Since: cosmos-sdk 0.46 SignMode_SIGN_MODE_DIRECT_AUX SignMode = 3 diff --git a/api/cosmos/tx/v1beta1/service_grpc.pb.go b/api/cosmos/tx/v1beta1/service_grpc.pb.go index 9b7cc0b033d9..475e363ea1b2 100644 --- a/api/cosmos/tx/v1beta1/service_grpc.pb.go +++ b/api/cosmos/tx/v1beta1/service_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/tx/v1beta1/service.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Service_Simulate_FullMethodName = "/cosmos.tx.v1beta1.Service/Simulate" @@ -33,6 +33,8 @@ const ( // ServiceClient is the client API for Service service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Service defines a gRPC service for interacting with transactions. type ServiceClient interface { // Simulate simulates executing a transaction for estimating gas usage. Simulate(ctx context.Context, in *SimulateRequest, opts ...grpc.CallOption) (*SimulateResponse, error) @@ -73,8 +75,9 @@ func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient { } func (c *serviceClient) Simulate(ctx context.Context, in *SimulateRequest, opts ...grpc.CallOption) (*SimulateResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(SimulateResponse) - err := c.cc.Invoke(ctx, Service_Simulate_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Service_Simulate_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -82,8 +85,9 @@ func (c *serviceClient) Simulate(ctx context.Context, in *SimulateRequest, opts } func (c *serviceClient) GetTx(ctx context.Context, in *GetTxRequest, opts ...grpc.CallOption) (*GetTxResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetTxResponse) - err := c.cc.Invoke(ctx, Service_GetTx_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Service_GetTx_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -91,8 +95,9 @@ func (c *serviceClient) GetTx(ctx context.Context, in *GetTxRequest, opts ...grp } func (c *serviceClient) BroadcastTx(ctx context.Context, in *BroadcastTxRequest, opts ...grpc.CallOption) (*BroadcastTxResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(BroadcastTxResponse) - err := c.cc.Invoke(ctx, Service_BroadcastTx_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Service_BroadcastTx_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -100,8 +105,9 @@ func (c *serviceClient) BroadcastTx(ctx context.Context, in *BroadcastTxRequest, } func (c *serviceClient) GetTxsEvent(ctx context.Context, in *GetTxsEventRequest, opts ...grpc.CallOption) (*GetTxsEventResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetTxsEventResponse) - err := c.cc.Invoke(ctx, Service_GetTxsEvent_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Service_GetTxsEvent_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -109,8 +115,9 @@ func (c *serviceClient) GetTxsEvent(ctx context.Context, in *GetTxsEventRequest, } func (c *serviceClient) GetBlockWithTxs(ctx context.Context, in *GetBlockWithTxsRequest, opts ...grpc.CallOption) (*GetBlockWithTxsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetBlockWithTxsResponse) - err := c.cc.Invoke(ctx, Service_GetBlockWithTxs_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Service_GetBlockWithTxs_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -118,8 +125,9 @@ func (c *serviceClient) GetBlockWithTxs(ctx context.Context, in *GetBlockWithTxs } func (c *serviceClient) TxDecode(ctx context.Context, in *TxDecodeRequest, opts ...grpc.CallOption) (*TxDecodeResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(TxDecodeResponse) - err := c.cc.Invoke(ctx, Service_TxDecode_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Service_TxDecode_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -127,8 +135,9 @@ func (c *serviceClient) TxDecode(ctx context.Context, in *TxDecodeRequest, opts } func (c *serviceClient) TxEncode(ctx context.Context, in *TxEncodeRequest, opts ...grpc.CallOption) (*TxEncodeResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(TxEncodeResponse) - err := c.cc.Invoke(ctx, Service_TxEncode_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Service_TxEncode_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -136,8 +145,9 @@ func (c *serviceClient) TxEncode(ctx context.Context, in *TxEncodeRequest, opts } func (c *serviceClient) TxEncodeAmino(ctx context.Context, in *TxEncodeAminoRequest, opts ...grpc.CallOption) (*TxEncodeAminoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(TxEncodeAminoResponse) - err := c.cc.Invoke(ctx, Service_TxEncodeAmino_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Service_TxEncodeAmino_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -145,8 +155,9 @@ func (c *serviceClient) TxEncodeAmino(ctx context.Context, in *TxEncodeAminoRequ } func (c *serviceClient) TxDecodeAmino(ctx context.Context, in *TxDecodeAminoRequest, opts ...grpc.CallOption) (*TxDecodeAminoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(TxDecodeAminoResponse) - err := c.cc.Invoke(ctx, Service_TxDecodeAmino_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Service_TxDecodeAmino_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -155,7 +166,9 @@ func (c *serviceClient) TxDecodeAmino(ctx context.Context, in *TxDecodeAminoRequ // ServiceServer is the server API for Service service. // All implementations must embed UnimplementedServiceServer -// for forward compatibility +// for forward compatibility. +// +// Service defines a gRPC service for interacting with transactions. type ServiceServer interface { // Simulate simulates executing a transaction for estimating gas usage. Simulate(context.Context, *SimulateRequest) (*SimulateResponse, error) @@ -188,9 +201,12 @@ type ServiceServer interface { mustEmbedUnimplementedServiceServer() } -// UnimplementedServiceServer must be embedded to have forward compatible implementations. -type UnimplementedServiceServer struct { -} +// UnimplementedServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedServiceServer struct{} func (UnimplementedServiceServer) Simulate(context.Context, *SimulateRequest) (*SimulateResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Simulate not implemented") @@ -220,6 +236,7 @@ func (UnimplementedServiceServer) TxDecodeAmino(context.Context, *TxDecodeAminoR return nil, status.Errorf(codes.Unimplemented, "method TxDecodeAmino not implemented") } func (UnimplementedServiceServer) mustEmbedUnimplementedServiceServer() {} +func (UnimplementedServiceServer) testEmbeddedByValue() {} // UnsafeServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to ServiceServer will @@ -229,6 +246,13 @@ type UnsafeServiceServer interface { } func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer) { + // If the following call pancis, it indicates UnimplementedServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Service_ServiceDesc, srv) } diff --git a/api/cosmos/tx/v1beta1/tx.pulsar.go b/api/cosmos/tx/v1beta1/tx.pulsar.go index e96c797a907f..510acc69662e 100644 --- a/api/cosmos/tx/v1beta1/tx.pulsar.go +++ b/api/cosmos/tx/v1beta1/tx.pulsar.go @@ -14,6 +14,7 @@ import ( protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" anypb "google.golang.org/protobuf/types/known/anypb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" io "io" reflect "reflect" sync "sync" @@ -2767,6 +2768,8 @@ var ( fd_TxBody_messages protoreflect.FieldDescriptor fd_TxBody_memo protoreflect.FieldDescriptor fd_TxBody_timeout_height protoreflect.FieldDescriptor + fd_TxBody_unordered protoreflect.FieldDescriptor + fd_TxBody_timeout_timestamp protoreflect.FieldDescriptor fd_TxBody_extension_options protoreflect.FieldDescriptor fd_TxBody_non_critical_extension_options protoreflect.FieldDescriptor ) @@ -2777,6 +2780,8 @@ func init() { fd_TxBody_messages = md_TxBody.Fields().ByName("messages") fd_TxBody_memo = md_TxBody.Fields().ByName("memo") fd_TxBody_timeout_height = md_TxBody.Fields().ByName("timeout_height") + fd_TxBody_unordered = md_TxBody.Fields().ByName("unordered") + fd_TxBody_timeout_timestamp = md_TxBody.Fields().ByName("timeout_timestamp") fd_TxBody_extension_options = md_TxBody.Fields().ByName("extension_options") fd_TxBody_non_critical_extension_options = md_TxBody.Fields().ByName("non_critical_extension_options") } @@ -2864,6 +2869,18 @@ func (x *fastReflection_TxBody) Range(f func(protoreflect.FieldDescriptor, proto return } } + if x.Unordered != false { + value := protoreflect.ValueOfBool(x.Unordered) + if !f(fd_TxBody_unordered, value) { + return + } + } + if x.TimeoutTimestamp != nil { + value := protoreflect.ValueOfMessage(x.TimeoutTimestamp.ProtoReflect()) + if !f(fd_TxBody_timeout_timestamp, value) { + return + } + } if len(x.ExtensionOptions) != 0 { value := protoreflect.ValueOfList(&_TxBody_1023_list{list: &x.ExtensionOptions}) if !f(fd_TxBody_extension_options, value) { @@ -2897,6 +2914,10 @@ func (x *fastReflection_TxBody) Has(fd protoreflect.FieldDescriptor) bool { return x.Memo != "" case "cosmos.tx.v1beta1.TxBody.timeout_height": return x.TimeoutHeight != uint64(0) + case "cosmos.tx.v1beta1.TxBody.unordered": + return x.Unordered != false + case "cosmos.tx.v1beta1.TxBody.timeout_timestamp": + return x.TimeoutTimestamp != nil case "cosmos.tx.v1beta1.TxBody.extension_options": return len(x.ExtensionOptions) != 0 case "cosmos.tx.v1beta1.TxBody.non_critical_extension_options": @@ -2923,6 +2944,10 @@ func (x *fastReflection_TxBody) Clear(fd protoreflect.FieldDescriptor) { x.Memo = "" case "cosmos.tx.v1beta1.TxBody.timeout_height": x.TimeoutHeight = uint64(0) + case "cosmos.tx.v1beta1.TxBody.unordered": + x.Unordered = false + case "cosmos.tx.v1beta1.TxBody.timeout_timestamp": + x.TimeoutTimestamp = nil case "cosmos.tx.v1beta1.TxBody.extension_options": x.ExtensionOptions = nil case "cosmos.tx.v1beta1.TxBody.non_critical_extension_options": @@ -2955,6 +2980,12 @@ func (x *fastReflection_TxBody) Get(descriptor protoreflect.FieldDescriptor) pro case "cosmos.tx.v1beta1.TxBody.timeout_height": value := x.TimeoutHeight return protoreflect.ValueOfUint64(value) + case "cosmos.tx.v1beta1.TxBody.unordered": + value := x.Unordered + return protoreflect.ValueOfBool(value) + case "cosmos.tx.v1beta1.TxBody.timeout_timestamp": + value := x.TimeoutTimestamp + return protoreflect.ValueOfMessage(value.ProtoReflect()) case "cosmos.tx.v1beta1.TxBody.extension_options": if len(x.ExtensionOptions) == 0 { return protoreflect.ValueOfList(&_TxBody_1023_list{}) @@ -2995,6 +3026,10 @@ func (x *fastReflection_TxBody) Set(fd protoreflect.FieldDescriptor, value proto x.Memo = value.Interface().(string) case "cosmos.tx.v1beta1.TxBody.timeout_height": x.TimeoutHeight = value.Uint() + case "cosmos.tx.v1beta1.TxBody.unordered": + x.Unordered = value.Bool() + case "cosmos.tx.v1beta1.TxBody.timeout_timestamp": + x.TimeoutTimestamp = value.Message().Interface().(*timestamppb.Timestamp) case "cosmos.tx.v1beta1.TxBody.extension_options": lv := value.List() clv := lv.(*_TxBody_1023_list) @@ -3029,6 +3064,11 @@ func (x *fastReflection_TxBody) Mutable(fd protoreflect.FieldDescriptor) protore } value := &_TxBody_1_list{list: &x.Messages} return protoreflect.ValueOfList(value) + case "cosmos.tx.v1beta1.TxBody.timeout_timestamp": + if x.TimeoutTimestamp == nil { + x.TimeoutTimestamp = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.TimeoutTimestamp.ProtoReflect()) case "cosmos.tx.v1beta1.TxBody.extension_options": if x.ExtensionOptions == nil { x.ExtensionOptions = []*anypb.Any{} @@ -3045,6 +3085,8 @@ func (x *fastReflection_TxBody) Mutable(fd protoreflect.FieldDescriptor) protore panic(fmt.Errorf("field memo of message cosmos.tx.v1beta1.TxBody is not mutable")) case "cosmos.tx.v1beta1.TxBody.timeout_height": panic(fmt.Errorf("field timeout_height of message cosmos.tx.v1beta1.TxBody is not mutable")) + case "cosmos.tx.v1beta1.TxBody.unordered": + panic(fmt.Errorf("field unordered of message cosmos.tx.v1beta1.TxBody is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.tx.v1beta1.TxBody")) @@ -3065,6 +3107,11 @@ func (x *fastReflection_TxBody) NewField(fd protoreflect.FieldDescriptor) protor return protoreflect.ValueOfString("") case "cosmos.tx.v1beta1.TxBody.timeout_height": return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.tx.v1beta1.TxBody.unordered": + return protoreflect.ValueOfBool(false) + case "cosmos.tx.v1beta1.TxBody.timeout_timestamp": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) case "cosmos.tx.v1beta1.TxBody.extension_options": list := []*anypb.Any{} return protoreflect.ValueOfList(&_TxBody_1023_list{list: &list}) @@ -3153,6 +3200,13 @@ func (x *fastReflection_TxBody) ProtoMethods() *protoiface.Methods { if x.TimeoutHeight != 0 { n += 1 + runtime.Sov(uint64(x.TimeoutHeight)) } + if x.Unordered { + n += 2 + } + if x.TimeoutTimestamp != nil { + l = options.Size(x.TimeoutTimestamp) + n += 1 + l + runtime.Sov(uint64(l)) + } if len(x.ExtensionOptions) > 0 { for _, e := range x.ExtensionOptions { l = options.Size(e) @@ -3230,6 +3284,30 @@ func (x *fastReflection_TxBody) ProtoMethods() *protoiface.Methods { dAtA[i] = 0xfa } } + if x.TimeoutTimestamp != nil { + encoded, err := options.Marshal(x.TimeoutTimestamp) + 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.Unordered { + i-- + if x.Unordered { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } if x.TimeoutHeight != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.TimeoutHeight)) i-- @@ -3392,6 +3470,62 @@ func (x *fastReflection_TxBody) ProtoMethods() *protoiface.Methods { break } } + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Unordered", 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.Unordered = 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 TimeoutTimestamp", 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.TimeoutTimestamp == nil { + x.TimeoutTimestamp = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.TimeoutTimestamp); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex case 1023: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExtensionOptions", wireType) @@ -8329,12 +8463,9 @@ type SignDocDirectAux struct { AccountNumber uint64 `protobuf:"varint,4,opt,name=account_number,json=accountNumber,proto3" json:"account_number,omitempty"` // sequence is the sequence number of the signing account. Sequence uint64 `protobuf:"varint,5,opt,name=sequence,proto3" json:"sequence,omitempty"` - // Tip is the optional tip used for transactions fees paid in another denom. - // It should be left empty if the signer is not the tipper for this - // transaction. + // tips have been depreacted and should not be used // - // This field is ignored if the chain didn't enable tips, i.e. didn't add the - // `TipDecorator` in its posthandler. + // Deprecated: Do not use. Tip *Tip `protobuf:"bytes,6,opt,name=tip,proto3" json:"tip,omitempty"` } @@ -8393,6 +8524,7 @@ func (x *SignDocDirectAux) GetSequence() uint64 { return 0 } +// Deprecated: Do not use. func (x *SignDocDirectAux) GetTip() *Tip { if x != nil { return x.Tip @@ -8416,11 +8548,33 @@ type TxBody struct { Messages []*anypb.Any `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` // memo is any arbitrary note/comment to be added to the transaction. // WARNING: in clients, any publicly exposed text should not be called memo, - // but should be called `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122). + // but should be called `note` instead (see + // https://github.com/cosmos/cosmos-sdk/issues/9122). Memo string `protobuf:"bytes,2,opt,name=memo,proto3" json:"memo,omitempty"` - // timeout is the block height after which this transaction will not - // be processed by the chain + // timeout_height is the block height after which this transaction will not + // be processed by the chain. TimeoutHeight uint64 `protobuf:"varint,3,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height,omitempty"` + // unordered, when set to true, indicates that the transaction signer(s) + // intend for the transaction to be evaluated and executed in an un-ordered + // fashion. Specifically, the account's nonce will NOT be checked or + // incremented, which allows for fire-and-forget as well as concurrent + // transaction execution. + // + // Note, when set to true, the existing 'timeout_timestamp' value must + // be set and will be used to correspond to a timestamp in which the transaction is deemed + // valid. + // + // Since: cosmos-sdk 0.53 + Unordered bool `protobuf:"varint,4,opt,name=unordered,proto3" json:"unordered,omitempty"` + // timeout_timestamp is the block time after which this transaction will not + // be processed by the chain. + // + // Note, if unordered=true this value MUST be set + // and will act as a short-lived TTL in which the transaction is deemed valid + // and kept in memory to prevent duplicates. + // + // Since: cosmos-sdk 0.53 + TimeoutTimestamp *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=timeout_timestamp,json=timeoutTimestamp,proto3" json:"timeout_timestamp,omitempty"` // extension_options are arbitrary options that can be added by chains // when the default options are not sufficient. If any of these are present // and can't be handled, the transaction will be rejected @@ -8472,6 +8626,20 @@ func (x *TxBody) GetTimeoutHeight() uint64 { return 0 } +func (x *TxBody) GetUnordered() bool { + if x != nil { + return x.Unordered + } + return false +} + +func (x *TxBody) GetTimeoutTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.TimeoutTimestamp + } + return nil +} + func (x *TxBody) GetExtensionOptions() []*anypb.Any { if x != nil { return x.ExtensionOptions @@ -8509,6 +8677,8 @@ type AuthInfo struct { // `TipDecorator` in its posthandler. // // Since: cosmos-sdk 0.46 + // + // Deprecated: Do not use. Tip *Tip `protobuf:"bytes,3,opt,name=tip,proto3" json:"tip,omitempty"` } @@ -8546,6 +8716,7 @@ func (x *AuthInfo) GetFee() *Fee { return nil } +// Deprecated: Do not use. func (x *AuthInfo) GetTip() *Tip { if x != nil { return x.Tip @@ -8702,13 +8873,15 @@ type Fee struct { // gas_limit is the maximum gas that can be used in transaction processing // before an out of gas error occurs GasLimit uint64 `protobuf:"varint,2,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty"` - // if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees. - // the payer must be a tx signer (and thus have signed this field in AuthInfo). - // setting this field does *not* change the ordering of required signers for the transaction. + // if unset, the first signer is responsible for paying the fees. If set, the + // specified account must pay the fees. the payer must be a tx signer (and + // thus have signed this field in AuthInfo). setting this field does *not* + // change the ordering of required signers for the transaction. Payer string `protobuf:"bytes,3,opt,name=payer,proto3" json:"payer,omitempty"` - // if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used - // to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does - // not support fee grants, this will fail + // if set, the fee payer (either the first signer or the value of the payer + // field) requests that a fee grant be used to pay fees instead of the fee + // payer's own balance. If an appropriate fee grant does not exist or the + // chain does not support fee grants, this will fail Granter string `protobuf:"bytes,4,opt,name=granter,proto3" json:"granter,omitempty"` } @@ -8763,6 +8936,8 @@ func (x *Fee) GetGranter() string { // Tip is the tip used for meta-transactions. // // Since: cosmos-sdk 0.46 +// +// Deprecated: Do not use. type Tip struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -8986,159 +9161,169 @@ var file_cosmos_tx_v1beta1_tx_proto_rawDesc = []byte{ 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8d, 0x01, 0x0a, 0x02, 0x54, 0x78, 0x12, 0x2d, 0x0a, - 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x54, 0x78, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x38, 0x0a, 0x09, - 0x61, 0x75, 0x74, 0x68, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x61, 0x75, - 0x74, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0a, 0x73, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0x6e, 0x0a, 0x05, 0x54, 0x78, 0x52, 0x61, 0x77, 0x12, - 0x1d, 0x0a, 0x0a, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x09, 0x62, 0x6f, 0x64, 0x79, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x26, - 0x0a, 0x0f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x62, 0x79, 0x74, 0x65, - 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x61, 0x75, 0x74, 0x68, 0x49, 0x6e, 0x66, - 0x6f, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0a, 0x73, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0x92, 0x01, 0x0a, 0x07, 0x53, 0x69, 0x67, 0x6e, 0x44, - 0x6f, 0x63, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x62, 0x6f, 0x64, 0x79, 0x42, 0x79, 0x74, 0x65, - 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x62, - 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x61, 0x75, 0x74, 0x68, - 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, - 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, - 0x69, 0x6e, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, - 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0xee, 0x01, 0x0a, 0x10, - 0x53, 0x69, 0x67, 0x6e, 0x44, 0x6f, 0x63, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x41, 0x75, 0x78, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8d, 0x01, 0x0a, 0x02, 0x54, 0x78, 0x12, 0x2d, + 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x54, 0x78, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x38, 0x0a, + 0x09, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x61, + 0x75, 0x74, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0a, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0x6e, 0x0a, 0x05, 0x54, 0x78, 0x52, 0x61, 0x77, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x62, 0x6f, 0x64, 0x79, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, - 0x33, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x4b, 0x65, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, - 0x25, 0x0a, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, - 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, - 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, - 0x63, 0x65, 0x12, 0x28, 0x0a, 0x03, 0x74, 0x69, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x16, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x54, 0x69, 0x70, 0x52, 0x03, 0x74, 0x69, 0x70, 0x22, 0x95, 0x02, 0x0a, - 0x06, 0x54, 0x78, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x30, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, - 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, - 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x25, 0x0a, - 0x0e, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x48, 0x65, - 0x69, 0x67, 0x68, 0x74, 0x12, 0x42, 0x0a, 0x11, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xff, 0x07, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x10, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x5a, 0x0a, 0x1e, 0x6e, 0x6f, 0x6e, 0x5f, - 0x63, 0x72, 0x69, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, - 0x6f, 0x6e, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xff, 0x0f, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x1b, 0x6e, 0x6f, 0x6e, 0x43, 0x72, 0x69, 0x74, - 0x69, 0x63, 0x61, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xa0, 0x01, 0x0a, 0x08, 0x41, 0x75, 0x74, 0x68, 0x49, 0x6e, 0x66, - 0x6f, 0x12, 0x40, 0x0a, 0x0c, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x66, 0x6f, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, - 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x49, 0x6e, - 0x66, 0x6f, 0x73, 0x12, 0x28, 0x0a, 0x03, 0x66, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x26, 0x0a, 0x0f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x62, 0x79, 0x74, + 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x61, 0x75, 0x74, 0x68, 0x49, 0x6e, + 0x66, 0x6f, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0a, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0x92, 0x01, 0x0a, 0x07, 0x53, 0x69, 0x67, 0x6e, + 0x44, 0x6f, 0x63, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x62, 0x79, 0x74, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x62, 0x6f, 0x64, 0x79, 0x42, 0x79, 0x74, + 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x5f, + 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x61, 0x75, 0x74, + 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0xf2, 0x01, 0x0a, + 0x10, 0x53, 0x69, 0x67, 0x6e, 0x44, 0x6f, 0x63, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x41, 0x75, + 0x78, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x62, 0x6f, 0x64, 0x79, 0x42, 0x79, 0x74, 0x65, 0x73, + 0x12, 0x33, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, + 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, + 0x6e, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, + 0x6e, 0x63, 0x65, 0x12, 0x2c, 0x0a, 0x03, 0x74, 0x69, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x46, 0x65, 0x65, 0x52, 0x03, 0x66, 0x65, 0x65, 0x12, 0x28, 0x0a, - 0x03, 0x74, 0x69, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, - 0x69, 0x70, 0x52, 0x03, 0x74, 0x69, 0x70, 0x22, 0x97, 0x01, 0x0a, 0x0a, 0x53, 0x69, 0x67, 0x6e, - 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x33, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, - 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x38, 0x0a, 0x09, 0x6d, - 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, - 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x6d, 0x6f, 0x64, - 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, - 0x65, 0x22, 0xe0, 0x02, 0x0a, 0x08, 0x4d, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x3c, - 0x0a, 0x06, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, - 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x53, 0x69, 0x6e, 0x67, - 0x6c, 0x65, 0x48, 0x00, 0x52, 0x06, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x12, 0x39, 0x0a, 0x05, - 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x4d, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x48, 0x00, - 0x52, 0x05, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x1a, 0x41, 0x0a, 0x06, 0x53, 0x69, 0x6e, 0x67, 0x6c, - 0x65, 0x12, 0x37, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x73, 0x69, 0x67, 0x6e, - 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, - 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x1a, 0x90, 0x01, 0x0a, 0x05, 0x4d, - 0x75, 0x6c, 0x74, 0x69, 0x12, 0x4b, 0x0a, 0x08, 0x62, 0x69, 0x74, 0x61, 0x72, 0x72, 0x61, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x73, 0x69, 0x67, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x42, - 0x69, 0x74, 0x41, 0x72, 0x72, 0x61, 0x79, 0x52, 0x08, 0x62, 0x69, 0x74, 0x61, 0x72, 0x72, 0x61, - 0x79, 0x12, 0x3a, 0x0a, 0x0a, 0x6d, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x69, 0x70, 0x42, 0x02, 0x18, 0x01, 0x52, 0x03, 0x74, 0x69, + 0x70, 0x22, 0x86, 0x03, 0x0a, 0x06, 0x54, 0x78, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x30, 0x0a, 0x08, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x12, + 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, + 0x6d, 0x6f, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x68, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x74, 0x69, 0x6d, 0x65, + 0x6f, 0x75, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x6e, 0x6f, + 0x72, 0x64, 0x65, 0x72, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x75, 0x6e, + 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x64, 0x12, 0x51, 0x0a, 0x11, 0x74, 0x69, 0x6d, 0x65, 0x6f, + 0x75, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x08, + 0xc8, 0xde, 0x1f, 0x01, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x10, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, + 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x42, 0x0a, 0x11, 0x65, 0x78, + 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0xff, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x10, 0x65, 0x78, + 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x5a, + 0x0a, 0x1e, 0x6e, 0x6f, 0x6e, 0x5f, 0x63, 0x72, 0x69, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x65, + 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0xff, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x1b, 0x6e, + 0x6f, 0x6e, 0x43, 0x72, 0x69, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xa4, 0x01, 0x0a, 0x08, 0x41, + 0x75, 0x74, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x40, 0x0a, 0x0c, 0x73, 0x69, 0x67, 0x6e, 0x65, + 0x72, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x73, 0x69, + 0x67, 0x6e, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x12, 0x28, 0x0a, 0x03, 0x66, 0x65, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x46, 0x65, 0x65, 0x52, 0x03, + 0x66, 0x65, 0x65, 0x12, 0x2c, 0x0a, 0x03, 0x74, 0x69, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x69, 0x70, 0x42, 0x02, 0x18, 0x01, 0x52, 0x03, 0x74, 0x69, + 0x70, 0x22, 0x97, 0x01, 0x0a, 0x0a, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x33, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x38, 0x0a, 0x09, 0x6d, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x6e, + 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x64, + 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x6d, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, + 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x22, 0xe0, 0x02, 0x0a, 0x08, + 0x4d, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x3c, 0x0a, 0x06, 0x73, 0x69, 0x6e, 0x67, + 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x64, + 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x06, + 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x12, 0x39, 0x0a, 0x05, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x49, 0x6e, - 0x66, 0x6f, 0x52, 0x09, 0x6d, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x42, 0x05, 0x0a, - 0x03, 0x73, 0x75, 0x6d, 0x22, 0x81, 0x02, 0x0a, 0x03, 0x46, 0x65, 0x65, 0x12, 0x79, 0x0a, 0x06, - 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x46, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, - 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65, - 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, - 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, - 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, - 0x69, 0x6d, 0x69, 0x74, 0x12, 0x2e, 0x0a, 0x05, 0x70, 0x61, 0x79, 0x65, 0x72, 0x18, 0x03, 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, 0x05, 0x70, - 0x61, 0x79, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x72, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x66, 0x6f, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x48, 0x00, 0x52, 0x05, 0x6d, 0x75, 0x6c, 0x74, + 0x69, 0x1a, 0x41, 0x0a, 0x06, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x12, 0x37, 0x0a, 0x04, 0x6d, + 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x04, + 0x6d, 0x6f, 0x64, 0x65, 0x1a, 0x90, 0x01, 0x0a, 0x05, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x12, 0x4b, + 0x0a, 0x08, 0x62, 0x69, 0x74, 0x61, 0x72, 0x72, 0x61, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x2f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, + 0x2e, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x73, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x42, 0x69, 0x74, 0x41, 0x72, 0x72, 0x61, + 0x79, 0x52, 0x08, 0x62, 0x69, 0x74, 0x61, 0x72, 0x72, 0x61, 0x79, 0x12, 0x3a, 0x0a, 0x0a, 0x6d, + 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x6d, 0x6f, + 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x42, 0x05, 0x0a, 0x03, 0x73, 0x75, 0x6d, 0x22, 0x81, + 0x02, 0x0a, 0x03, 0x46, 0x65, 0x65, 0x12, 0x79, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, + 0x6e, 0x42, 0x46, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, + 0x69, 0x6e, 0x73, 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, + 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x2e, + 0x0a, 0x05, 0x70, 0x61, 0x79, 0x65, 0x72, 0x18, 0x03, 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, 0x05, 0x70, 0x61, 0x79, 0x65, 0x72, 0x12, 0x32, + 0x0a, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x72, 0x18, 0x04, 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, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, + 0x65, 0x72, 0x22, 0xb6, 0x01, 0x0a, 0x03, 0x54, 0x69, 0x70, 0x12, 0x79, 0x0a, 0x06, 0x61, 0x6d, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x46, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, + 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, + 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x30, 0x0a, 0x06, 0x74, 0x69, 0x70, 0x70, 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, - 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x72, 0x22, 0xb2, 0x01, 0x0a, 0x03, 0x54, 0x69, 0x70, - 0x12, 0x79, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x46, 0xc8, 0xde, 0x1f, - 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, - 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x9a, 0xe7, 0xb0, - 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, - 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x30, 0x0a, 0x06, 0x74, - 0x69, 0x70, 0x70, 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, 0x06, 0x74, 0x69, 0x70, 0x70, 0x65, 0x72, 0x22, 0xce, 0x01, - 0x0a, 0x0d, 0x41, 0x75, 0x78, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, - 0x32, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 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, 0x07, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x12, 0x3e, 0x0a, 0x08, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x64, 0x6f, 0x63, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, - 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x44, 0x6f, - 0x63, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x41, 0x75, 0x78, 0x52, 0x07, 0x73, 0x69, 0x67, 0x6e, - 0x44, 0x6f, 0x63, 0x12, 0x37, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x73, 0x69, - 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x69, - 0x67, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, - 0x73, 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x73, 0x69, 0x67, 0x42, 0xb4, - 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x2c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, - 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x74, 0x78, 0x2f, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x74, 0x78, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0xa2, 0x02, 0x03, 0x43, 0x54, 0x58, 0xaa, 0x02, 0x11, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x54, 0x78, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x11, 0x43, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x54, 0x78, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, - 0x02, 0x1d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x54, 0x78, 0x5c, 0x56, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x54, 0x78, 0x3a, 0x3a, 0x56, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x06, 0x74, 0x69, 0x70, 0x70, 0x65, 0x72, 0x3a, 0x02, 0x18, 0x01, 0x22, 0xce, 0x01, 0x0a, 0x0d, + 0x41, 0x75, 0x78, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x32, 0x0a, + 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 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, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x12, 0x3e, 0x0a, 0x08, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x64, 0x6f, 0x63, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x44, 0x6f, 0x63, 0x44, + 0x69, 0x72, 0x65, 0x63, 0x74, 0x41, 0x75, 0x78, 0x52, 0x07, 0x73, 0x69, 0x67, 0x6e, 0x44, 0x6f, + 0x63, 0x12, 0x37, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x73, 0x69, 0x67, 0x6e, + 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, + 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x69, + 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x73, 0x69, 0x67, 0x42, 0xb4, 0x01, 0x0a, + 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x2c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x74, 0x78, 0x2f, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x74, 0x78, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, + 0x02, 0x03, 0x43, 0x54, 0x58, 0xaa, 0x02, 0x11, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x54, + 0x78, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x11, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x5c, 0x54, 0x78, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1d, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x54, 0x78, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x54, 0x78, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -9169,9 +9354,10 @@ var file_cosmos_tx_v1beta1_tx_proto_goTypes = []interface{}{ (*ModeInfo_Single)(nil), // 11: cosmos.tx.v1beta1.ModeInfo.Single (*ModeInfo_Multi)(nil), // 12: cosmos.tx.v1beta1.ModeInfo.Multi (*anypb.Any)(nil), // 13: google.protobuf.Any - (*v1beta12.Coin)(nil), // 14: cosmos.base.v1beta1.Coin - (v1beta1.SignMode)(0), // 15: cosmos.tx.signing.v1beta1.SignMode - (*v1beta11.CompactBitArray)(nil), // 16: cosmos.crypto.multisig.v1beta1.CompactBitArray + (*timestamppb.Timestamp)(nil), // 14: google.protobuf.Timestamp + (*v1beta12.Coin)(nil), // 15: cosmos.base.v1beta1.Coin + (v1beta1.SignMode)(0), // 16: cosmos.tx.signing.v1beta1.SignMode + (*v1beta11.CompactBitArray)(nil), // 17: cosmos.crypto.multisig.v1beta1.CompactBitArray } var file_cosmos_tx_v1beta1_tx_proto_depIdxs = []int32{ 4, // 0: cosmos.tx.v1beta1.Tx.body:type_name -> cosmos.tx.v1beta1.TxBody @@ -9179,27 +9365,28 @@ var file_cosmos_tx_v1beta1_tx_proto_depIdxs = []int32{ 13, // 2: cosmos.tx.v1beta1.SignDocDirectAux.public_key:type_name -> google.protobuf.Any 9, // 3: cosmos.tx.v1beta1.SignDocDirectAux.tip:type_name -> cosmos.tx.v1beta1.Tip 13, // 4: cosmos.tx.v1beta1.TxBody.messages:type_name -> google.protobuf.Any - 13, // 5: cosmos.tx.v1beta1.TxBody.extension_options:type_name -> google.protobuf.Any - 13, // 6: cosmos.tx.v1beta1.TxBody.non_critical_extension_options:type_name -> google.protobuf.Any - 6, // 7: cosmos.tx.v1beta1.AuthInfo.signer_infos:type_name -> cosmos.tx.v1beta1.SignerInfo - 8, // 8: cosmos.tx.v1beta1.AuthInfo.fee:type_name -> cosmos.tx.v1beta1.Fee - 9, // 9: cosmos.tx.v1beta1.AuthInfo.tip:type_name -> cosmos.tx.v1beta1.Tip - 13, // 10: cosmos.tx.v1beta1.SignerInfo.public_key:type_name -> google.protobuf.Any - 7, // 11: cosmos.tx.v1beta1.SignerInfo.mode_info:type_name -> cosmos.tx.v1beta1.ModeInfo - 11, // 12: cosmos.tx.v1beta1.ModeInfo.single:type_name -> cosmos.tx.v1beta1.ModeInfo.Single - 12, // 13: cosmos.tx.v1beta1.ModeInfo.multi:type_name -> cosmos.tx.v1beta1.ModeInfo.Multi - 14, // 14: cosmos.tx.v1beta1.Fee.amount:type_name -> cosmos.base.v1beta1.Coin - 14, // 15: cosmos.tx.v1beta1.Tip.amount:type_name -> cosmos.base.v1beta1.Coin - 3, // 16: cosmos.tx.v1beta1.AuxSignerData.sign_doc:type_name -> cosmos.tx.v1beta1.SignDocDirectAux - 15, // 17: cosmos.tx.v1beta1.AuxSignerData.mode:type_name -> cosmos.tx.signing.v1beta1.SignMode - 15, // 18: cosmos.tx.v1beta1.ModeInfo.Single.mode:type_name -> cosmos.tx.signing.v1beta1.SignMode - 16, // 19: cosmos.tx.v1beta1.ModeInfo.Multi.bitarray:type_name -> cosmos.crypto.multisig.v1beta1.CompactBitArray - 7, // 20: cosmos.tx.v1beta1.ModeInfo.Multi.mode_infos:type_name -> cosmos.tx.v1beta1.ModeInfo - 21, // [21:21] is the sub-list for method output_type - 21, // [21:21] is the sub-list for method input_type - 21, // [21:21] is the sub-list for extension type_name - 21, // [21:21] is the sub-list for extension extendee - 0, // [0:21] is the sub-list for field type_name + 14, // 5: cosmos.tx.v1beta1.TxBody.timeout_timestamp:type_name -> google.protobuf.Timestamp + 13, // 6: cosmos.tx.v1beta1.TxBody.extension_options:type_name -> google.protobuf.Any + 13, // 7: cosmos.tx.v1beta1.TxBody.non_critical_extension_options:type_name -> google.protobuf.Any + 6, // 8: cosmos.tx.v1beta1.AuthInfo.signer_infos:type_name -> cosmos.tx.v1beta1.SignerInfo + 8, // 9: cosmos.tx.v1beta1.AuthInfo.fee:type_name -> cosmos.tx.v1beta1.Fee + 9, // 10: cosmos.tx.v1beta1.AuthInfo.tip:type_name -> cosmos.tx.v1beta1.Tip + 13, // 11: cosmos.tx.v1beta1.SignerInfo.public_key:type_name -> google.protobuf.Any + 7, // 12: cosmos.tx.v1beta1.SignerInfo.mode_info:type_name -> cosmos.tx.v1beta1.ModeInfo + 11, // 13: cosmos.tx.v1beta1.ModeInfo.single:type_name -> cosmos.tx.v1beta1.ModeInfo.Single + 12, // 14: cosmos.tx.v1beta1.ModeInfo.multi:type_name -> cosmos.tx.v1beta1.ModeInfo.Multi + 15, // 15: cosmos.tx.v1beta1.Fee.amount:type_name -> cosmos.base.v1beta1.Coin + 15, // 16: cosmos.tx.v1beta1.Tip.amount:type_name -> cosmos.base.v1beta1.Coin + 3, // 17: cosmos.tx.v1beta1.AuxSignerData.sign_doc:type_name -> cosmos.tx.v1beta1.SignDocDirectAux + 16, // 18: cosmos.tx.v1beta1.AuxSignerData.mode:type_name -> cosmos.tx.signing.v1beta1.SignMode + 16, // 19: cosmos.tx.v1beta1.ModeInfo.Single.mode:type_name -> cosmos.tx.signing.v1beta1.SignMode + 17, // 20: cosmos.tx.v1beta1.ModeInfo.Multi.bitarray:type_name -> cosmos.crypto.multisig.v1beta1.CompactBitArray + 7, // 21: cosmos.tx.v1beta1.ModeInfo.Multi.mode_infos:type_name -> cosmos.tx.v1beta1.ModeInfo + 22, // [22:22] is the sub-list for method output_type + 22, // [22:22] is the sub-list for method input_type + 22, // [22:22] is the sub-list for extension type_name + 22, // [22:22] is the sub-list for extension extendee + 0, // [0:22] is the sub-list for field type_name } func init() { file_cosmos_tx_v1beta1_tx_proto_init() } diff --git a/api/cosmos/upgrade/v1beta1/query.pulsar.go b/api/cosmos/upgrade/v1beta1/query.pulsar.go index ec2d4738f74f..ad7e8d8fd23f 100644 --- a/api/cosmos/upgrade/v1beta1/query.pulsar.go +++ b/api/cosmos/upgrade/v1beta1/query.pulsar.go @@ -4610,11 +4610,11 @@ var file_cosmos_upgrade_v1beta1_query_proto_rawDesc = []byte{ 0x2e, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x49, 0x88, 0x02, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x40, 0x12, - 0x3e, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, - 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, - 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x73, 0x74, 0x61, 0x74, - 0x65, 0x2f, 0x7b, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x7d, 0x12, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x49, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x40, 0x12, 0x3e, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x2f, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x64, 0x5f, 0x63, + 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2f, 0x7b, + 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x7d, 0x88, 0x02, 0x01, 0x12, 0xaa, 0x01, 0x0a, 0x0e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x32, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, diff --git a/api/cosmos/upgrade/v1beta1/query_grpc.pb.go b/api/cosmos/upgrade/v1beta1/query_grpc.pb.go index d298ca4439f8..805efc34abca 100644 --- a/api/cosmos/upgrade/v1beta1/query_grpc.pb.go +++ b/api/cosmos/upgrade/v1beta1/query_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/upgrade/v1beta1/query.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Query_CurrentPlan_FullMethodName = "/cosmos.upgrade.v1beta1.Query/CurrentPlan" @@ -29,6 +29,8 @@ const ( // QueryClient is the client API for Query service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Query defines the gRPC upgrade querier service. type QueryClient interface { // CurrentPlan queries the current upgrade plan. CurrentPlan(ctx context.Context, in *QueryCurrentPlanRequest, opts ...grpc.CallOption) (*QueryCurrentPlanResponse, error) @@ -61,8 +63,9 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { } func (c *queryClient) CurrentPlan(ctx context.Context, in *QueryCurrentPlanRequest, opts ...grpc.CallOption) (*QueryCurrentPlanResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryCurrentPlanResponse) - err := c.cc.Invoke(ctx, Query_CurrentPlan_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_CurrentPlan_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -70,8 +73,9 @@ func (c *queryClient) CurrentPlan(ctx context.Context, in *QueryCurrentPlanReque } func (c *queryClient) AppliedPlan(ctx context.Context, in *QueryAppliedPlanRequest, opts ...grpc.CallOption) (*QueryAppliedPlanResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryAppliedPlanResponse) - err := c.cc.Invoke(ctx, Query_AppliedPlan_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_AppliedPlan_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -80,8 +84,9 @@ func (c *queryClient) AppliedPlan(ctx context.Context, in *QueryAppliedPlanReque // Deprecated: Do not use. func (c *queryClient) UpgradedConsensusState(ctx context.Context, in *QueryUpgradedConsensusStateRequest, opts ...grpc.CallOption) (*QueryUpgradedConsensusStateResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryUpgradedConsensusStateResponse) - err := c.cc.Invoke(ctx, Query_UpgradedConsensusState_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_UpgradedConsensusState_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -89,8 +94,9 @@ func (c *queryClient) UpgradedConsensusState(ctx context.Context, in *QueryUpgra } func (c *queryClient) ModuleVersions(ctx context.Context, in *QueryModuleVersionsRequest, opts ...grpc.CallOption) (*QueryModuleVersionsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryModuleVersionsResponse) - err := c.cc.Invoke(ctx, Query_ModuleVersions_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_ModuleVersions_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -98,8 +104,9 @@ func (c *queryClient) ModuleVersions(ctx context.Context, in *QueryModuleVersion } func (c *queryClient) Authority(ctx context.Context, in *QueryAuthorityRequest, opts ...grpc.CallOption) (*QueryAuthorityResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryAuthorityResponse) - err := c.cc.Invoke(ctx, Query_Authority_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Authority_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -108,7 +115,9 @@ func (c *queryClient) Authority(ctx context.Context, in *QueryAuthorityRequest, // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer -// for forward compatibility +// for forward compatibility. +// +// Query defines the gRPC upgrade querier service. type QueryServer interface { // CurrentPlan queries the current upgrade plan. CurrentPlan(context.Context, *QueryCurrentPlanRequest) (*QueryCurrentPlanResponse, error) @@ -133,9 +142,12 @@ type QueryServer interface { mustEmbedUnimplementedQueryServer() } -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} +// UnimplementedQueryServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedQueryServer struct{} func (UnimplementedQueryServer) CurrentPlan(context.Context, *QueryCurrentPlanRequest) (*QueryCurrentPlanResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CurrentPlan not implemented") @@ -153,6 +165,7 @@ func (UnimplementedQueryServer) Authority(context.Context, *QueryAuthorityReques return nil, status.Errorf(codes.Unimplemented, "method Authority not implemented") } func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} +func (UnimplementedQueryServer) testEmbeddedByValue() {} // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to QueryServer will @@ -162,6 +175,13 @@ type UnsafeQueryServer interface { } func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + // If the following call pancis, it indicates UnimplementedQueryServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Query_ServiceDesc, srv) } diff --git a/api/cosmos/upgrade/v1beta1/tx_grpc.pb.go b/api/cosmos/upgrade/v1beta1/tx_grpc.pb.go index aa9a2d2c4f9a..6721ca8f39d4 100644 --- a/api/cosmos/upgrade/v1beta1/tx_grpc.pb.go +++ b/api/cosmos/upgrade/v1beta1/tx_grpc.pb.go @@ -2,7 +2,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/upgrade/v1beta1/tx.proto @@ -17,8 +17,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Msg_SoftwareUpgrade_FullMethodName = "/cosmos.upgrade.v1beta1.Msg/SoftwareUpgrade" @@ -28,6 +28,8 @@ const ( // MsgClient is the client API for Msg service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Msg defines the upgrade Msg service. type MsgClient interface { // SoftwareUpgrade is a governance operation for initiating a software upgrade. // @@ -49,8 +51,9 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { } func (c *msgClient) SoftwareUpgrade(ctx context.Context, in *MsgSoftwareUpgrade, opts ...grpc.CallOption) (*MsgSoftwareUpgradeResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgSoftwareUpgradeResponse) - err := c.cc.Invoke(ctx, Msg_SoftwareUpgrade_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_SoftwareUpgrade_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -58,8 +61,9 @@ func (c *msgClient) SoftwareUpgrade(ctx context.Context, in *MsgSoftwareUpgrade, } func (c *msgClient) CancelUpgrade(ctx context.Context, in *MsgCancelUpgrade, opts ...grpc.CallOption) (*MsgCancelUpgradeResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgCancelUpgradeResponse) - err := c.cc.Invoke(ctx, Msg_CancelUpgrade_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_CancelUpgrade_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -68,7 +72,9 @@ func (c *msgClient) CancelUpgrade(ctx context.Context, in *MsgCancelUpgrade, opt // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer -// for forward compatibility +// for forward compatibility. +// +// Msg defines the upgrade Msg service. type MsgServer interface { // SoftwareUpgrade is a governance operation for initiating a software upgrade. // @@ -82,9 +88,12 @@ type MsgServer interface { mustEmbedUnimplementedMsgServer() } -// UnimplementedMsgServer must be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} +// UnimplementedMsgServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedMsgServer struct{} func (UnimplementedMsgServer) SoftwareUpgrade(context.Context, *MsgSoftwareUpgrade) (*MsgSoftwareUpgradeResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SoftwareUpgrade not implemented") @@ -93,6 +102,7 @@ func (UnimplementedMsgServer) CancelUpgrade(context.Context, *MsgCancelUpgrade) return nil, status.Errorf(codes.Unimplemented, "method CancelUpgrade not implemented") } func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} +func (UnimplementedMsgServer) testEmbeddedByValue() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to MsgServer will @@ -102,6 +112,13 @@ type UnsafeMsgServer interface { } func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + // If the following call pancis, it indicates UnimplementedMsgServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Msg_ServiceDesc, srv) } diff --git a/api/cosmos/upgrade/v1beta1/upgrade.pulsar.go b/api/cosmos/upgrade/v1beta1/upgrade.pulsar.go index 8bf12715914b..6bf12971b028 100644 --- a/api/cosmos/upgrade/v1beta1/upgrade.pulsar.go +++ b/api/cosmos/upgrade/v1beta1/upgrade.pulsar.go @@ -2503,8 +2503,8 @@ var file_cosmos_upgrade_v1beta1_upgrade_proto_rawDesc = []byte{ 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3f, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x0f, 0x18, 0x01, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, - 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x0f, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0xa8, + 0xe7, 0xb0, 0x2a, 0x01, 0x18, 0x01, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x4c, 0x0a, 0x15, 0x75, 0x70, 0x67, 0x72, @@ -2523,41 +2523,41 @@ var file_cosmos_upgrade_v1beta1_upgrade_proto_rawDesc = []byte{ 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x04, 0x70, 0x6c, 0x61, - 0x6e, 0x3a, 0x4b, 0x18, 0x01, 0xe8, 0xa0, 0x1f, 0x01, 0xca, 0xb4, 0x2d, 0x1a, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x8a, 0xe7, 0xb0, 0x2a, 0x22, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x53, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x55, - 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x22, 0xaa, + 0x6e, 0x3a, 0x4b, 0xe8, 0xa0, 0x1f, 0x01, 0xca, 0xb4, 0x2d, 0x1a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x8a, 0xe7, 0xb0, 0x2a, 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x53, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x55, 0x70, 0x67, + 0x72, 0x61, 0x64, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x18, 0x01, 0x22, 0xaa, 0x01, 0x0a, 0x1d, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x53, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x51, 0x18, 0x01, 0xe8, 0xa0, 0x1f, 0x01, - 0xca, 0xb4, 0x2d, 0x1a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x8a, 0xe7, - 0xb0, 0x2a, 0x28, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x43, 0x61, - 0x6e, 0x63, 0x65, 0x6c, 0x53, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x55, 0x70, 0x67, 0x72, - 0x61, 0x64, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x22, 0x43, 0x0a, 0x0d, 0x4d, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x51, 0xe8, 0xa0, 0x1f, 0x01, 0xca, 0xb4, + 0x2d, 0x1a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x8a, 0xe7, 0xb0, 0x2a, + 0x28, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x43, 0x61, 0x6e, 0x63, + 0x65, 0x6c, 0x53, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, + 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x18, 0x01, 0x22, 0x43, 0x0a, 0x0d, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, - 0x42, 0xe0, 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, - 0x0c, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x36, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, - 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x55, 0x58, 0xaa, 0x02, 0x16, - 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x2e, 0x56, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, - 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, - 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, - 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x55, - 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xc8, - 0xe1, 0x1e, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x42, 0xe0, 0x01, 0xc8, 0xe1, 0x1e, 0x00, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x42, 0x0c, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, + 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x75, 0x70, 0x67, + 0x72, 0x61, 0x64, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x75, 0x70, 0x67, + 0x72, 0x61, 0x64, 0x65, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x55, + 0x58, 0xaa, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x55, 0x70, 0x67, 0x72, 0x61, + 0x64, 0x65, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x16, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x5c, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x5c, 0x56, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0xe2, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x55, 0x70, 0x67, + 0x72, 0x61, 0x64, 0x65, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x3a, 0x3a, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/vesting/v1beta1/tx_grpc.pb.go b/api/cosmos/vesting/v1beta1/tx_grpc.pb.go index 13b9a67c5d37..11ec935981dc 100644 --- a/api/cosmos/vesting/v1beta1/tx_grpc.pb.go +++ b/api/cosmos/vesting/v1beta1/tx_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: cosmos/vesting/v1beta1/tx.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Msg_CreateVestingAccount_FullMethodName = "/cosmos.vesting.v1beta1.Msg/CreateVestingAccount" @@ -27,6 +27,8 @@ const ( // MsgClient is the client API for Msg service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Msg defines the bank Msg service. type MsgClient interface { // CreateVestingAccount defines a method that enables creating a vesting // account. @@ -52,8 +54,9 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { } func (c *msgClient) CreateVestingAccount(ctx context.Context, in *MsgCreateVestingAccount, opts ...grpc.CallOption) (*MsgCreateVestingAccountResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgCreateVestingAccountResponse) - err := c.cc.Invoke(ctx, Msg_CreateVestingAccount_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_CreateVestingAccount_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -61,8 +64,9 @@ func (c *msgClient) CreateVestingAccount(ctx context.Context, in *MsgCreateVesti } func (c *msgClient) CreatePermanentLockedAccount(ctx context.Context, in *MsgCreatePermanentLockedAccount, opts ...grpc.CallOption) (*MsgCreatePermanentLockedAccountResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgCreatePermanentLockedAccountResponse) - err := c.cc.Invoke(ctx, Msg_CreatePermanentLockedAccount_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_CreatePermanentLockedAccount_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -70,8 +74,9 @@ func (c *msgClient) CreatePermanentLockedAccount(ctx context.Context, in *MsgCre } func (c *msgClient) CreatePeriodicVestingAccount(ctx context.Context, in *MsgCreatePeriodicVestingAccount, opts ...grpc.CallOption) (*MsgCreatePeriodicVestingAccountResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgCreatePeriodicVestingAccountResponse) - err := c.cc.Invoke(ctx, Msg_CreatePeriodicVestingAccount_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_CreatePeriodicVestingAccount_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -80,7 +85,9 @@ func (c *msgClient) CreatePeriodicVestingAccount(ctx context.Context, in *MsgCre // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer -// for forward compatibility +// for forward compatibility. +// +// Msg defines the bank Msg service. type MsgServer interface { // CreateVestingAccount defines a method that enables creating a vesting // account. @@ -98,9 +105,12 @@ type MsgServer interface { mustEmbedUnimplementedMsgServer() } -// UnimplementedMsgServer must be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} +// UnimplementedMsgServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedMsgServer struct{} func (UnimplementedMsgServer) CreateVestingAccount(context.Context, *MsgCreateVestingAccount) (*MsgCreateVestingAccountResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateVestingAccount not implemented") @@ -112,6 +122,7 @@ func (UnimplementedMsgServer) CreatePeriodicVestingAccount(context.Context, *Msg return nil, status.Errorf(codes.Unimplemented, "method CreatePeriodicVestingAccount not implemented") } func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} +func (UnimplementedMsgServer) testEmbeddedByValue() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to MsgServer will @@ -121,6 +132,13 @@ type UnsafeMsgServer interface { } func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + // If the following call pancis, it indicates UnimplementedMsgServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Msg_ServiceDesc, srv) } diff --git a/api/go.mod b/api/go.mod index b54974c192bc..e6bef738105d 100644 --- a/api/go.mod +++ b/api/go.mod @@ -1,20 +1,19 @@ module cosmossdk.io/api -go 1.20 +go 1.23 require ( - github.com/cosmos/cosmos-proto v1.0.0-beta.3 - github.com/cosmos/gogoproto v1.4.10 - google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 - google.golang.org/grpc v1.55.0 - google.golang.org/protobuf v1.30.0 + github.com/cosmos/cosmos-proto v1.0.0-beta.5 + github.com/cosmos/gogoproto v1.7.0 + google.golang.org/genproto/googleapis/api v0.0.0-20250212204824-5a70512c5d8b + google.golang.org/grpc v1.71.0 + google.golang.org/protobuf v1.36.5 ) require ( - github.com/golang/protobuf v1.5.3 // indirect - github.com/google/go-cmp v0.5.9 // indirect - golang.org/x/exp v0.0.0-20230131160201-f062dba9d201 // indirect - golang.org/x/net v0.9.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/text v0.9.0 // indirect + github.com/google/go-cmp v0.7.0 // indirect + golang.org/x/net v0.35.0 // indirect + golang.org/x/sys v0.30.0 // indirect + golang.org/x/text v0.22.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250212204824-5a70512c5d8b // indirect ) diff --git a/api/go.sum b/api/go.sum index 7f18a8b3335a..1b66c0271511 100644 --- a/api/go.sum +++ b/api/go.sum @@ -1,27 +1,40 @@ -github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= -github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoKuI= -github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -golang.org/x/exp v0.0.0-20230131160201-f062dba9d201 h1:BEABXpNXLEz0WxtA+6CQIz2xkg80e+1zrhWyMcq8VzE= -golang.org/x/exp v0.0.0-20230131160201-f062dba9d201/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= -golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= -golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= -google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= +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/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= +go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= +go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY= +go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI= +go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ= +go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE= +go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A= +go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU= +go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk= +go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w= +go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k= +go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE= +golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= +golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= +golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= +golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= +golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= +google.golang.org/genproto/googleapis/api v0.0.0-20250212204824-5a70512c5d8b h1:i+d0RZa8Hs2L/MuaOQYI+krthcxdEbEM2N+Tf3kJ4zk= +google.golang.org/genproto/googleapis/api v0.0.0-20250212204824-5a70512c5d8b/go.mod h1:iYONQfRdizDB8JJBybql13nArx91jcUk7zCXEsOofM4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250212204824-5a70512c5d8b h1:FQtJ1MxbXoIIrZHZ33M+w5+dAP9o86rgpjoKr/ZmT7k= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250212204824-5a70512c5d8b/go.mod h1:8BS3B93F/U1juMFq9+EDk+qOT5CO1R9IzXxG3PTqiRk= +google.golang.org/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg= +google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec= +google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= +google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= diff --git a/api/tendermint/abci/types.pulsar.go b/api/tendermint/abci/types.pulsar.go index 8f6206311cb0..bfdc98d0bf7b 100644 --- a/api/tendermint/abci/types.pulsar.go +++ b/api/tendermint/abci/types.pulsar.go @@ -9577,10 +9577,113 @@ func (x *fastReflection_RequestProcessProposal) ProtoMethods() *protoiface.Metho } } +var _ protoreflect.List = (*_RequestExtendVote_4_list)(nil) + +type _RequestExtendVote_4_list struct { + list *[][]byte +} + +func (x *_RequestExtendVote_4_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_RequestExtendVote_4_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfBytes((*x.list)[i]) +} + +func (x *_RequestExtendVote_4_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Bytes() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_RequestExtendVote_4_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Bytes() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_RequestExtendVote_4_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message RequestExtendVote at list field Txs as it is not of Message kind")) +} + +func (x *_RequestExtendVote_4_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_RequestExtendVote_4_list) NewElement() protoreflect.Value { + var v []byte + return protoreflect.ValueOfBytes(v) +} + +func (x *_RequestExtendVote_4_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_RequestExtendVote_6_list)(nil) + +type _RequestExtendVote_6_list struct { + list *[]*Misbehavior +} + +func (x *_RequestExtendVote_6_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_RequestExtendVote_6_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_RequestExtendVote_6_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Misbehavior) + (*x.list)[i] = concreteValue +} + +func (x *_RequestExtendVote_6_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Misbehavior) + *x.list = append(*x.list, concreteValue) +} + +func (x *_RequestExtendVote_6_list) AppendMutable() protoreflect.Value { + v := new(Misbehavior) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_RequestExtendVote_6_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_RequestExtendVote_6_list) NewElement() protoreflect.Value { + v := new(Misbehavior) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_RequestExtendVote_6_list) IsValid() bool { + return x.list != nil +} + var ( - md_RequestExtendVote protoreflect.MessageDescriptor - fd_RequestExtendVote_hash protoreflect.FieldDescriptor - fd_RequestExtendVote_height protoreflect.FieldDescriptor + md_RequestExtendVote protoreflect.MessageDescriptor + fd_RequestExtendVote_hash protoreflect.FieldDescriptor + fd_RequestExtendVote_height protoreflect.FieldDescriptor + fd_RequestExtendVote_time protoreflect.FieldDescriptor + fd_RequestExtendVote_txs protoreflect.FieldDescriptor + fd_RequestExtendVote_proposed_last_commit protoreflect.FieldDescriptor + fd_RequestExtendVote_misbehavior protoreflect.FieldDescriptor + fd_RequestExtendVote_next_validators_hash protoreflect.FieldDescriptor + fd_RequestExtendVote_proposer_address protoreflect.FieldDescriptor ) func init() { @@ -9588,6 +9691,12 @@ func init() { md_RequestExtendVote = File_tendermint_abci_types_proto.Messages().ByName("RequestExtendVote") fd_RequestExtendVote_hash = md_RequestExtendVote.Fields().ByName("hash") fd_RequestExtendVote_height = md_RequestExtendVote.Fields().ByName("height") + fd_RequestExtendVote_time = md_RequestExtendVote.Fields().ByName("time") + fd_RequestExtendVote_txs = md_RequestExtendVote.Fields().ByName("txs") + fd_RequestExtendVote_proposed_last_commit = md_RequestExtendVote.Fields().ByName("proposed_last_commit") + fd_RequestExtendVote_misbehavior = md_RequestExtendVote.Fields().ByName("misbehavior") + fd_RequestExtendVote_next_validators_hash = md_RequestExtendVote.Fields().ByName("next_validators_hash") + fd_RequestExtendVote_proposer_address = md_RequestExtendVote.Fields().ByName("proposer_address") } var _ protoreflect.Message = (*fastReflection_RequestExtendVote)(nil) @@ -9667,6 +9776,42 @@ func (x *fastReflection_RequestExtendVote) Range(f func(protoreflect.FieldDescri return } } + if x.Time != nil { + value := protoreflect.ValueOfMessage(x.Time.ProtoReflect()) + if !f(fd_RequestExtendVote_time, value) { + return + } + } + if len(x.Txs) != 0 { + value := protoreflect.ValueOfList(&_RequestExtendVote_4_list{list: &x.Txs}) + if !f(fd_RequestExtendVote_txs, value) { + return + } + } + if x.ProposedLastCommit != nil { + value := protoreflect.ValueOfMessage(x.ProposedLastCommit.ProtoReflect()) + if !f(fd_RequestExtendVote_proposed_last_commit, value) { + return + } + } + if len(x.Misbehavior) != 0 { + value := protoreflect.ValueOfList(&_RequestExtendVote_6_list{list: &x.Misbehavior}) + if !f(fd_RequestExtendVote_misbehavior, value) { + return + } + } + if len(x.NextValidatorsHash) != 0 { + value := protoreflect.ValueOfBytes(x.NextValidatorsHash) + if !f(fd_RequestExtendVote_next_validators_hash, value) { + return + } + } + if len(x.ProposerAddress) != 0 { + value := protoreflect.ValueOfBytes(x.ProposerAddress) + if !f(fd_RequestExtendVote_proposer_address, value) { + return + } + } } // Has reports whether a field is populated. @@ -9686,6 +9831,18 @@ func (x *fastReflection_RequestExtendVote) Has(fd protoreflect.FieldDescriptor) return len(x.Hash) != 0 case "tendermint.abci.RequestExtendVote.height": return x.Height != int64(0) + case "tendermint.abci.RequestExtendVote.time": + return x.Time != nil + case "tendermint.abci.RequestExtendVote.txs": + return len(x.Txs) != 0 + case "tendermint.abci.RequestExtendVote.proposed_last_commit": + return x.ProposedLastCommit != nil + case "tendermint.abci.RequestExtendVote.misbehavior": + return len(x.Misbehavior) != 0 + case "tendermint.abci.RequestExtendVote.next_validators_hash": + return len(x.NextValidatorsHash) != 0 + case "tendermint.abci.RequestExtendVote.proposer_address": + return len(x.ProposerAddress) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: tendermint.abci.RequestExtendVote")) @@ -9706,6 +9863,18 @@ func (x *fastReflection_RequestExtendVote) Clear(fd protoreflect.FieldDescriptor x.Hash = nil case "tendermint.abci.RequestExtendVote.height": x.Height = int64(0) + case "tendermint.abci.RequestExtendVote.time": + x.Time = nil + case "tendermint.abci.RequestExtendVote.txs": + x.Txs = nil + case "tendermint.abci.RequestExtendVote.proposed_last_commit": + x.ProposedLastCommit = nil + case "tendermint.abci.RequestExtendVote.misbehavior": + x.Misbehavior = nil + case "tendermint.abci.RequestExtendVote.next_validators_hash": + x.NextValidatorsHash = nil + case "tendermint.abci.RequestExtendVote.proposer_address": + x.ProposerAddress = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: tendermint.abci.RequestExtendVote")) @@ -9728,6 +9897,30 @@ func (x *fastReflection_RequestExtendVote) Get(descriptor protoreflect.FieldDesc case "tendermint.abci.RequestExtendVote.height": value := x.Height return protoreflect.ValueOfInt64(value) + case "tendermint.abci.RequestExtendVote.time": + value := x.Time + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "tendermint.abci.RequestExtendVote.txs": + if len(x.Txs) == 0 { + return protoreflect.ValueOfList(&_RequestExtendVote_4_list{}) + } + listValue := &_RequestExtendVote_4_list{list: &x.Txs} + return protoreflect.ValueOfList(listValue) + case "tendermint.abci.RequestExtendVote.proposed_last_commit": + value := x.ProposedLastCommit + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "tendermint.abci.RequestExtendVote.misbehavior": + if len(x.Misbehavior) == 0 { + return protoreflect.ValueOfList(&_RequestExtendVote_6_list{}) + } + listValue := &_RequestExtendVote_6_list{list: &x.Misbehavior} + return protoreflect.ValueOfList(listValue) + case "tendermint.abci.RequestExtendVote.next_validators_hash": + value := x.NextValidatorsHash + return protoreflect.ValueOfBytes(value) + case "tendermint.abci.RequestExtendVote.proposer_address": + value := x.ProposerAddress + return protoreflect.ValueOfBytes(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: tendermint.abci.RequestExtendVote")) @@ -9752,6 +9945,22 @@ func (x *fastReflection_RequestExtendVote) Set(fd protoreflect.FieldDescriptor, x.Hash = value.Bytes() case "tendermint.abci.RequestExtendVote.height": x.Height = value.Int() + case "tendermint.abci.RequestExtendVote.time": + x.Time = value.Message().Interface().(*timestamppb.Timestamp) + case "tendermint.abci.RequestExtendVote.txs": + lv := value.List() + clv := lv.(*_RequestExtendVote_4_list) + x.Txs = *clv.list + case "tendermint.abci.RequestExtendVote.proposed_last_commit": + x.ProposedLastCommit = value.Message().Interface().(*CommitInfo) + case "tendermint.abci.RequestExtendVote.misbehavior": + lv := value.List() + clv := lv.(*_RequestExtendVote_6_list) + x.Misbehavior = *clv.list + case "tendermint.abci.RequestExtendVote.next_validators_hash": + x.NextValidatorsHash = value.Bytes() + case "tendermint.abci.RequestExtendVote.proposer_address": + x.ProposerAddress = value.Bytes() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: tendermint.abci.RequestExtendVote")) @@ -9772,10 +9981,36 @@ func (x *fastReflection_RequestExtendVote) Set(fd protoreflect.FieldDescriptor, // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_RequestExtendVote) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "tendermint.abci.RequestExtendVote.time": + if x.Time == nil { + x.Time = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.Time.ProtoReflect()) + case "tendermint.abci.RequestExtendVote.txs": + if x.Txs == nil { + x.Txs = [][]byte{} + } + value := &_RequestExtendVote_4_list{list: &x.Txs} + return protoreflect.ValueOfList(value) + case "tendermint.abci.RequestExtendVote.proposed_last_commit": + if x.ProposedLastCommit == nil { + x.ProposedLastCommit = new(CommitInfo) + } + return protoreflect.ValueOfMessage(x.ProposedLastCommit.ProtoReflect()) + case "tendermint.abci.RequestExtendVote.misbehavior": + if x.Misbehavior == nil { + x.Misbehavior = []*Misbehavior{} + } + value := &_RequestExtendVote_6_list{list: &x.Misbehavior} + return protoreflect.ValueOfList(value) case "tendermint.abci.RequestExtendVote.hash": panic(fmt.Errorf("field hash of message tendermint.abci.RequestExtendVote is not mutable")) case "tendermint.abci.RequestExtendVote.height": panic(fmt.Errorf("field height of message tendermint.abci.RequestExtendVote is not mutable")) + case "tendermint.abci.RequestExtendVote.next_validators_hash": + panic(fmt.Errorf("field next_validators_hash of message tendermint.abci.RequestExtendVote is not mutable")) + case "tendermint.abci.RequestExtendVote.proposer_address": + panic(fmt.Errorf("field proposer_address of message tendermint.abci.RequestExtendVote is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: tendermint.abci.RequestExtendVote")) @@ -9793,6 +10028,22 @@ func (x *fastReflection_RequestExtendVote) NewField(fd protoreflect.FieldDescrip return protoreflect.ValueOfBytes(nil) case "tendermint.abci.RequestExtendVote.height": return protoreflect.ValueOfInt64(int64(0)) + case "tendermint.abci.RequestExtendVote.time": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "tendermint.abci.RequestExtendVote.txs": + list := [][]byte{} + return protoreflect.ValueOfList(&_RequestExtendVote_4_list{list: &list}) + case "tendermint.abci.RequestExtendVote.proposed_last_commit": + m := new(CommitInfo) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "tendermint.abci.RequestExtendVote.misbehavior": + list := []*Misbehavior{} + return protoreflect.ValueOfList(&_RequestExtendVote_6_list{list: &list}) + case "tendermint.abci.RequestExtendVote.next_validators_hash": + return protoreflect.ValueOfBytes(nil) + case "tendermint.abci.RequestExtendVote.proposer_address": + return protoreflect.ValueOfBytes(nil) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: tendermint.abci.RequestExtendVote")) @@ -9869,6 +10120,34 @@ func (x *fastReflection_RequestExtendVote) ProtoMethods() *protoiface.Methods { if x.Height != 0 { n += 1 + runtime.Sov(uint64(x.Height)) } + if x.Time != nil { + l = options.Size(x.Time) + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Txs) > 0 { + for _, b := range x.Txs { + l = len(b) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.ProposedLastCommit != nil { + l = options.Size(x.ProposedLastCommit) + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Misbehavior) > 0 { + for _, e := range x.Misbehavior { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + l = len(x.NextValidatorsHash) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.ProposerAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -9898,6 +10177,73 @@ func (x *fastReflection_RequestExtendVote) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.ProposerAddress) > 0 { + i -= len(x.ProposerAddress) + copy(dAtA[i:], x.ProposerAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ProposerAddress))) + i-- + dAtA[i] = 0x42 + } + if len(x.NextValidatorsHash) > 0 { + i -= len(x.NextValidatorsHash) + copy(dAtA[i:], x.NextValidatorsHash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.NextValidatorsHash))) + i-- + dAtA[i] = 0x3a + } + if len(x.Misbehavior) > 0 { + for iNdEx := len(x.Misbehavior) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Misbehavior[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 x.ProposedLastCommit != nil { + encoded, err := options.Marshal(x.ProposedLastCommit) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x2a + } + if len(x.Txs) > 0 { + for iNdEx := len(x.Txs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.Txs[iNdEx]) + copy(dAtA[i:], x.Txs[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Txs[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if x.Time != nil { + encoded, err := options.Marshal(x.Time) + 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 x.Height != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.Height)) i-- @@ -9940,28 +10286,219 @@ func (x *fastReflection_RequestExtendVote) ProtoMethods() *protoiface.Methods { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow } - if iNdEx >= l { + 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: RequestExtendVote: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: RequestExtendVote: 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 Hash", 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.Hash = append(x.Hash[:0], dAtA[iNdEx:postIndex]...) + if x.Hash == nil { + x.Hash = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + x.Height = 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.Height |= 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 Time", 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.Time == nil { + x.Time = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Time); 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 Txs", 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 } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + x.Txs = append(x.Txs, make([]byte, postIndex-iNdEx)) + copy(x.Txs[len(x.Txs)-1], 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 ProposedLastCommit", wireType) } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: RequestExtendVote: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: RequestExtendVote: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + 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.ProposedLastCommit == nil { + x.ProposedLastCommit = &CommitInfo{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ProposedLastCommit); 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 Hash", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Misbehavior", 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.Misbehavior = append(x.Misbehavior, &Misbehavior{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Misbehavior[len(x.Misbehavior)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NextValidatorsHash", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -9988,16 +10525,16 @@ func (x *fastReflection_RequestExtendVote) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Hash = append(x.Hash[:0], dAtA[iNdEx:postIndex]...) - if x.Hash == nil { - x.Hash = []byte{} + x.NextValidatorsHash = append(x.NextValidatorsHash[:0], dAtA[iNdEx:postIndex]...) + if x.NextValidatorsHash == nil { + x.NextValidatorsHash = []byte{} } iNdEx = postIndex - case 2: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + case 8: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ProposerAddress", wireType) } - x.Height = 0 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -10007,11 +10544,26 @@ func (x *fastReflection_RequestExtendVote) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.Height |= int64(b&0x7F) << shift + 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.ProposerAddress = append(x.ProposerAddress[:0], dAtA[iNdEx:postIndex]...) + if x.ProposerAddress == nil { + x.ProposerAddress = []byte{} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -31455,10 +32007,18 @@ type RequestExtendVote struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // the hash of the block that this vote may be referring to + // the hash of the block that this vote may be referring to Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` // the height of the extended vote Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` + // info of the block that this vote may be referring to + Time *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=time,proto3" json:"time,omitempty"` + Txs [][]byte `protobuf:"bytes,4,rep,name=txs,proto3" json:"txs,omitempty"` + ProposedLastCommit *CommitInfo `protobuf:"bytes,5,opt,name=proposed_last_commit,json=proposedLastCommit,proto3" json:"proposed_last_commit,omitempty"` + Misbehavior []*Misbehavior `protobuf:"bytes,6,rep,name=misbehavior,proto3" json:"misbehavior,omitempty"` + NextValidatorsHash []byte `protobuf:"bytes,7,opt,name=next_validators_hash,json=nextValidatorsHash,proto3" json:"next_validators_hash,omitempty"` + // address of the public key of the original proposer of the block. + ProposerAddress []byte `protobuf:"bytes,8,opt,name=proposer_address,json=proposerAddress,proto3" json:"proposer_address,omitempty"` } func (x *RequestExtendVote) Reset() { @@ -31495,6 +32055,48 @@ func (x *RequestExtendVote) GetHeight() int64 { return 0 } +func (x *RequestExtendVote) GetTime() *timestamppb.Timestamp { + if x != nil { + return x.Time + } + return nil +} + +func (x *RequestExtendVote) GetTxs() [][]byte { + if x != nil { + return x.Txs + } + return nil +} + +func (x *RequestExtendVote) GetProposedLastCommit() *CommitInfo { + if x != nil { + return x.ProposedLastCommit + } + return nil +} + +func (x *RequestExtendVote) GetMisbehavior() []*Misbehavior { + if x != nil { + return x.Misbehavior + } + return nil +} + +func (x *RequestExtendVote) GetNextValidatorsHash() []byte { + if x != nil { + return x.NextValidatorsHash + } + return nil +} + +func (x *RequestExtendVote) GetProposerAddress() []byte { + if x != nil { + return x.ProposerAddress + } + return nil +} + // Verify the vote extension type RequestVerifyVoteExtension struct { state protoimpl.MessageState @@ -32681,7 +33283,8 @@ type ResponseFinalizeBlock struct { ValidatorUpdates []*ValidatorUpdate `protobuf:"bytes,3,rep,name=validator_updates,json=validatorUpdates,proto3" json:"validator_updates,omitempty"` // updates to the consensus params, if any. ConsensusParamUpdates *types.ConsensusParams `protobuf:"bytes,4,opt,name=consensus_param_updates,json=consensusParamUpdates,proto3" json:"consensus_param_updates,omitempty"` - // app_hash is the hash of the applications' state which is used to confirm that execution of the transactions was deterministic. It is up to the application to decide which algorithm to use. + // app_hash is the hash of the applications' state which is used to confirm that execution of the transactions was + // deterministic. It is up to the application to decide which algorithm to use. AppHash []byte `protobuf:"bytes,5,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` } @@ -32942,8 +33545,8 @@ type ExecTxResult struct { Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` // nondeterministic Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` // nondeterministic - GasWanted int64 `protobuf:"varint,5,opt,name=gas_wanted,json=gasWanted,proto3" json:"gas_wanted,omitempty"` - GasUsed int64 `protobuf:"varint,6,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` + GasWanted int64 `protobuf:"varint,5,opt,name=gas_wanted,proto3" json:"gas_wanted,omitempty"` + GasUsed int64 `protobuf:"varint,6,opt,name=gas_used,proto3" json:"gas_used,omitempty"` Events []*Event `protobuf:"bytes,7,rep,name=events,proto3" json:"events,omitempty"` // nondeterministic Codespace string `protobuf:"bytes,8,opt,name=codespace,proto3" json:"codespace,omitempty"` } @@ -33629,503 +34232,523 @@ var file_tendermint_abci_types_proto_rawDesc = []byte{ 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x48, 0x61, 0x73, 0x68, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x3f, 0x0a, 0x11, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x68, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x83, 0x03, 0x0a, 0x11, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, + 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x38, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x04, 0x74, 0x69, + 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x78, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0c, 0x52, + 0x03, 0x74, 0x78, 0x73, 0x12, 0x53, 0x0a, 0x14, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x64, + 0x5f, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, + 0x61, 0x62, 0x63, 0x69, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x42, + 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x64, 0x4c, + 0x61, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x44, 0x0a, 0x0b, 0x6d, 0x69, 0x73, + 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, + 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, + 0x2e, 0x4d, 0x69, 0x73, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x42, 0x04, 0xc8, 0xde, + 0x1f, 0x00, 0x52, 0x0b, 0x6d, 0x69, 0x73, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x12, + 0x30, 0x0a, 0x14, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x12, 0x6e, + 0x65, 0x78, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x48, 0x61, 0x73, + 0x68, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x70, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x9c, 0x01, 0x0a, + 0x1a, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x56, 0x6f, + 0x74, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, - 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x9c, 0x01, 0x0a, 0x1a, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x45, 0x78, 0x74, - 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x11, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, - 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, - 0x25, 0x0a, 0x0e, 0x76, 0x6f, 0x74, 0x65, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x76, 0x6f, 0x74, 0x65, 0x45, 0x78, 0x74, - 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x84, 0x03, 0x0a, 0x14, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, - 0x10, 0x0a, 0x03, 0x74, 0x78, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x03, 0x74, 0x78, - 0x73, 0x12, 0x51, 0x0a, 0x13, 0x64, 0x65, 0x63, 0x69, 0x64, 0x65, 0x64, 0x5f, 0x6c, 0x61, 0x73, - 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, + 0x2b, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, + 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x68, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x76, 0x6f, 0x74, 0x65, 0x5f, 0x65, 0x78, 0x74, + 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x76, 0x6f, + 0x74, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x84, 0x03, 0x0a, 0x14, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x78, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0c, 0x52, 0x03, 0x74, 0x78, 0x73, 0x12, 0x51, 0x0a, 0x13, 0x64, 0x65, 0x63, 0x69, 0x64, 0x65, + 0x64, 0x5f, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, + 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, + 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x11, 0x64, 0x65, 0x63, 0x69, 0x64, 0x65, 0x64, 0x4c, + 0x61, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x44, 0x0a, 0x0b, 0x6d, 0x69, 0x73, + 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, - 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x04, 0xc8, 0xde, 0x1f, - 0x00, 0x52, 0x11, 0x64, 0x65, 0x63, 0x69, 0x64, 0x65, 0x64, 0x4c, 0x61, 0x73, 0x74, 0x43, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x44, 0x0a, 0x0b, 0x6d, 0x69, 0x73, 0x62, 0x65, 0x68, 0x61, 0x76, - 0x69, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x74, 0x65, 0x6e, 0x64, - 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x4d, 0x69, 0x73, 0x62, - 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0b, 0x6d, - 0x69, 0x73, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, - 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x16, - 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, - 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x38, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, - 0x12, 0x30, 0x0a, 0x14, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x12, - 0x6e, 0x65, 0x78, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x48, 0x61, - 0x73, 0x68, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x70, 0x72, - 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x94, 0x0a, - 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x09, 0x65, 0x78, - 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, - 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x48, 0x00, 0x52, 0x09, 0x65, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x33, - 0x0a, 0x04, 0x65, 0x63, 0x68, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x74, - 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x45, 0x63, 0x68, 0x6f, 0x48, 0x00, 0x52, 0x04, 0x65, - 0x63, 0x68, 0x6f, 0x12, 0x36, 0x0a, 0x05, 0x66, 0x6c, 0x75, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, - 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x46, 0x6c, 0x75, - 0x73, 0x68, 0x48, 0x00, 0x52, 0x05, 0x66, 0x6c, 0x75, 0x73, 0x68, 0x12, 0x33, 0x0a, 0x04, 0x69, - 0x6e, 0x66, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x74, 0x65, 0x6e, 0x64, + 0x2e, 0x4d, 0x69, 0x73, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x42, 0x04, 0xc8, 0xde, + 0x1f, 0x00, 0x52, 0x0b, 0x6d, 0x69, 0x73, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x12, + 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, + 0x61, 0x73, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x38, 0x0a, 0x04, 0x74, + 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0x52, + 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x30, 0x0a, 0x14, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x12, 0x6e, 0x65, 0x78, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x73, 0x48, 0x61, 0x73, 0x68, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x22, 0x94, 0x0a, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x42, 0x0a, 0x09, 0x65, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, + 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x45, 0x78, 0x63, + 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x09, 0x65, 0x78, 0x63, 0x65, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x04, 0x65, 0x63, 0x68, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1d, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, + 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x45, 0x63, 0x68, 0x6f, + 0x48, 0x00, 0x52, 0x04, 0x65, 0x63, 0x68, 0x6f, 0x12, 0x36, 0x0a, 0x05, 0x66, 0x6c, 0x75, 0x73, + 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, + 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x48, 0x00, 0x52, 0x05, 0x66, 0x6c, 0x75, 0x73, 0x68, + 0x12, 0x33, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, + 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, + 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x48, 0x00, 0x52, + 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x43, 0x0a, 0x0a, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x48, 0x00, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, - 0x12, 0x43, 0x0a, 0x0a, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, - 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x49, - 0x6e, 0x69, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x48, 0x00, 0x52, 0x09, 0x69, 0x6e, 0x69, 0x74, - 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x36, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, - 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x48, 0x00, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x3d, 0x0a, - 0x08, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x74, 0x78, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x20, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, - 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, - 0x78, 0x48, 0x00, 0x52, 0x07, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x78, 0x12, 0x39, 0x0a, 0x06, - 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x74, - 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x48, 0x00, 0x52, - 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x4f, 0x0a, 0x0e, 0x6c, 0x69, 0x73, 0x74, 0x5f, - 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x26, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, - 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x6e, - 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x48, 0x00, 0x52, 0x0d, 0x6c, 0x69, 0x73, 0x74, 0x53, - 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x12, 0x4f, 0x0a, 0x0e, 0x6f, 0x66, 0x66, 0x65, - 0x72, 0x5f, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x26, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, - 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4f, 0x66, 0x66, 0x65, 0x72, - 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x48, 0x00, 0x52, 0x0d, 0x6f, 0x66, 0x66, 0x65, - 0x72, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x5c, 0x0a, 0x13, 0x6c, 0x6f, 0x61, - 0x64, 0x5f, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x5f, 0x63, 0x68, 0x75, 0x6e, 0x6b, - 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, - 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x4c, 0x6f, 0x61, 0x64, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x43, 0x68, 0x75, - 0x6e, 0x6b, 0x48, 0x00, 0x52, 0x11, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, - 0x6f, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x5f, 0x0a, 0x14, 0x61, 0x70, 0x70, 0x6c, 0x79, - 0x5f, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x5f, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x18, - 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, - 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x41, 0x70, 0x70, 0x6c, 0x79, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x43, 0x68, 0x75, - 0x6e, 0x6b, 0x48, 0x00, 0x52, 0x12, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x53, 0x6e, 0x61, 0x70, 0x73, - 0x68, 0x6f, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x55, 0x0a, 0x10, 0x70, 0x72, 0x65, 0x70, - 0x61, 0x72, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x18, 0x11, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, - 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x72, 0x65, - 0x70, 0x61, 0x72, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x48, 0x00, 0x52, 0x0f, - 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, - 0x55, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x6f, - 0x73, 0x61, 0x6c, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x74, 0x65, 0x6e, 0x64, + 0x6f, 0x6e, 0x73, 0x65, 0x49, 0x6e, 0x69, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x48, 0x00, 0x52, + 0x09, 0x69, 0x6e, 0x69, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x36, 0x0a, 0x05, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x50, 0x72, 0x6f, 0x70, 0x6f, - 0x73, 0x61, 0x6c, 0x48, 0x00, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x50, 0x72, - 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x46, 0x0a, 0x0b, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, - 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x74, 0x65, + 0x6f, 0x6e, 0x73, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, 0x00, 0x52, 0x05, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x12, 0x3d, 0x0a, 0x08, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x74, 0x78, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, + 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x54, 0x78, 0x48, 0x00, 0x52, 0x07, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x54, + 0x78, 0x12, 0x39, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1f, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, + 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x48, 0x00, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x4f, 0x0a, 0x0e, + 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x18, 0x0d, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, + 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4c, + 0x69, 0x73, 0x74, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x48, 0x00, 0x52, 0x0d, + 0x6c, 0x69, 0x73, 0x74, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x12, 0x4f, 0x0a, + 0x0e, 0x6f, 0x66, 0x66, 0x65, 0x72, 0x5f, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x18, + 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, + 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x4f, 0x66, 0x66, 0x65, 0x72, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x48, 0x00, 0x52, + 0x0d, 0x6f, 0x66, 0x66, 0x65, 0x72, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x5c, + 0x0a, 0x13, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x5f, + 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x56, 0x6f, 0x74, 0x65, - 0x48, 0x00, 0x52, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x62, - 0x0a, 0x15, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x5f, 0x65, 0x78, - 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, - 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x56, 0x6f, - 0x74, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x13, 0x76, - 0x65, 0x72, 0x69, 0x66, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, - 0x6f, 0x6e, 0x12, 0x4f, 0x0a, 0x0e, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x5f, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x74, 0x65, 0x6e, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4c, 0x6f, 0x61, 0x64, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, + 0x6f, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x48, 0x00, 0x52, 0x11, 0x6c, 0x6f, 0x61, 0x64, 0x53, + 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x5f, 0x0a, 0x14, + 0x61, 0x70, 0x70, 0x6c, 0x79, 0x5f, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x5f, 0x63, + 0x68, 0x75, 0x6e, 0x6b, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x48, 0x00, 0x52, 0x0d, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x4a, 0x04, 0x08, 0x05, - 0x10, 0x06, 0x4a, 0x04, 0x08, 0x08, 0x10, 0x09, 0x4a, 0x04, 0x08, 0x0a, 0x10, 0x0b, 0x4a, 0x04, - 0x08, 0x0b, 0x10, 0x0c, 0x22, 0x29, 0x0a, 0x11, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, - 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, - 0x28, 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x45, 0x63, 0x68, 0x6f, 0x12, - 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x0f, 0x0a, 0x0d, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x22, 0xb8, 0x01, 0x0a, 0x0c, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, - 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x70, 0x70, - 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, - 0x61, 0x70, 0x70, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x0a, 0x11, 0x6c, 0x61, - 0x73, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x2d, 0x0a, 0x13, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x61, 0x70, 0x70, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x10, 0x6c, 0x61, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x70, - 0x70, 0x48, 0x61, 0x73, 0x68, 0x22, 0xc4, 0x01, 0x0a, 0x11, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x49, 0x6e, 0x69, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x4c, 0x0a, 0x10, 0x63, - 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, - 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, - 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x46, 0x0a, 0x0a, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, - 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, - 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x73, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x70, 0x70, 0x48, 0x61, 0x73, 0x68, 0x22, 0xf7, 0x01, 0x0a, - 0x0d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x12, - 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, - 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6c, 0x6f, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6c, 0x6f, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, - 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x38, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, - 0x6f, 0x70, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x74, 0x65, 0x6e, 0x64, - 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x50, 0x72, - 0x6f, 0x6f, 0x66, 0x4f, 0x70, 0x73, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x4f, 0x70, 0x73, - 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x64, 0x65, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x64, - 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0xaa, 0x02, 0x0a, 0x0f, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x78, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, - 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, - 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x6c, 0x6f, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6c, 0x6f, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x1e, 0x0a, 0x0a, 0x67, 0x61, 0x73, 0x5f, - 0x77, 0x61, 0x6e, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x67, 0x61, - 0x73, 0x5f, 0x77, 0x61, 0x6e, 0x74, 0x65, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, - 0x75, 0x73, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x67, 0x61, 0x73, 0x5f, - 0x75, 0x73, 0x65, 0x64, 0x12, 0x48, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x07, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, - 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x18, 0xc8, 0xde, - 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x10, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2c, 0x6f, 0x6d, 0x69, - 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x1c, - 0x0a, 0x09, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4a, 0x04, 0x08, 0x09, - 0x10, 0x0c, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x52, 0x08, 0x70, 0x72, 0x69, 0x6f, - 0x72, 0x69, 0x74, 0x79, 0x52, 0x0d, 0x6d, 0x65, 0x6d, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x65, 0x72, - 0x72, 0x6f, 0x72, 0x22, 0x41, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x74, 0x61, 0x69, 0x6e, 0x5f, - 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x72, 0x65, - 0x74, 0x61, 0x69, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, - 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x22, 0x50, 0x0a, 0x15, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x12, - 0x37, 0x0a, 0x09, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, - 0x61, 0x62, 0x63, 0x69, 0x2e, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x09, 0x73, - 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x22, 0xbe, 0x01, 0x0a, 0x15, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4f, 0x66, 0x66, 0x65, 0x72, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, - 0x6f, 0x74, 0x12, 0x45, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x2d, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, - 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4f, 0x66, 0x66, - 0x65, 0x72, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x5e, 0x0a, 0x06, 0x52, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, - 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x43, 0x43, 0x45, 0x50, 0x54, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, - 0x41, 0x42, 0x4f, 0x52, 0x54, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x52, 0x45, 0x4a, 0x45, 0x43, - 0x54, 0x10, 0x03, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x46, 0x4f, - 0x52, 0x4d, 0x41, 0x54, 0x10, 0x04, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, - 0x5f, 0x53, 0x45, 0x4e, 0x44, 0x45, 0x52, 0x10, 0x05, 0x22, 0x31, 0x0a, 0x19, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4c, 0x6f, 0x61, 0x64, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, - 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x22, 0x98, 0x02, 0x0a, - 0x1a, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x53, 0x6e, - 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x4a, 0x0a, 0x06, 0x72, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x32, 0x2e, 0x74, 0x65, - 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x53, 0x6e, 0x61, 0x70, 0x73, - 0x68, 0x6f, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, - 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x66, 0x65, 0x74, - 0x63, 0x68, 0x5f, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0d, 0x52, - 0x0d, 0x72, 0x65, 0x66, 0x65, 0x74, 0x63, 0x68, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x12, 0x25, - 0x0a, 0x0e, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x73, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x65, - 0x6e, 0x64, 0x65, 0x72, 0x73, 0x22, 0x60, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, - 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, - 0x41, 0x43, 0x43, 0x45, 0x50, 0x54, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x42, 0x4f, 0x52, - 0x54, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x52, 0x45, 0x54, 0x52, 0x59, 0x10, 0x03, 0x12, 0x12, - 0x0a, 0x0e, 0x52, 0x45, 0x54, 0x52, 0x59, 0x5f, 0x53, 0x4e, 0x41, 0x50, 0x53, 0x48, 0x4f, 0x54, - 0x10, 0x04, 0x12, 0x13, 0x0a, 0x0f, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x53, 0x4e, 0x41, - 0x50, 0x53, 0x48, 0x4f, 0x54, 0x10, 0x05, 0x22, 0x2b, 0x0a, 0x17, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, - 0x61, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x78, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, - 0x03, 0x74, 0x78, 0x73, 0x22, 0xa1, 0x01, 0x0a, 0x17, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, - 0x12, 0x4f, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x37, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, - 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x63, 0x65, - 0x73, 0x73, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, - 0x73, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x22, 0x35, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, - 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x43, 0x43, 0x45, 0x50, 0x54, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, - 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x10, 0x02, 0x22, 0x3b, 0x0a, 0x12, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x25, - 0x0a, 0x0e, 0x76, 0x6f, 0x74, 0x65, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x76, 0x6f, 0x74, 0x65, 0x45, 0x78, 0x74, 0x65, - 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xa5, 0x01, 0x0a, 0x1b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x45, 0x78, 0x74, 0x65, - 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x51, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x39, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, + 0x6f, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x48, 0x00, 0x52, 0x12, 0x61, 0x70, 0x70, 0x6c, 0x79, + 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x55, 0x0a, + 0x10, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, + 0x6c, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, + 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, + 0x6c, 0x48, 0x00, 0x52, 0x0f, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x50, 0x72, 0x6f, 0x70, + 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x55, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x5f, + 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, + 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, + 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, + 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x48, 0x00, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x63, + 0x65, 0x73, 0x73, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x46, 0x0a, 0x0b, 0x65, + 0x78, 0x74, 0x65, 0x6e, 0x64, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x23, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, + 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, + 0x64, 0x56, 0x6f, 0x74, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x56, + 0x6f, 0x74, 0x65, 0x12, 0x62, 0x0a, 0x15, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x76, 0x6f, + 0x74, 0x65, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x14, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, + 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65, 0x72, + 0x69, 0x66, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, + 0x48, 0x00, 0x52, 0x13, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x45, 0x78, + 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x4f, 0x0a, 0x0e, 0x66, 0x69, 0x6e, 0x61, 0x6c, + 0x69, 0x7a, 0x65, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x26, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, + 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, + 0x7a, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x00, 0x52, 0x0d, 0x66, 0x69, 0x6e, 0x61, 0x6c, + 0x69, 0x7a, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x4a, 0x04, 0x08, 0x08, 0x10, 0x09, 0x4a, 0x04, 0x08, + 0x0a, 0x10, 0x0b, 0x4a, 0x04, 0x08, 0x0b, 0x10, 0x0c, 0x22, 0x29, 0x0a, 0x11, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, + 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x22, 0x28, 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x45, 0x63, 0x68, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x0f, + 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x22, + 0xb8, 0x01, 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x64, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1f, + 0x0a, 0x0b, 0x61, 0x70, 0x70, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x0a, 0x61, 0x70, 0x70, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, + 0x2a, 0x0a, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x6c, 0x61, 0x73, 0x74, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x2d, 0x0a, 0x13, 0x6c, + 0x61, 0x73, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x61, 0x70, 0x70, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x6c, 0x61, 0x73, 0x74, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x41, 0x70, 0x70, 0x48, 0x61, 0x73, 0x68, 0x22, 0xc4, 0x01, 0x0a, 0x11, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x49, 0x6e, 0x69, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, + 0x12, 0x4c, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x74, 0x65, 0x6e, + 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, + 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x0f, 0x63, + 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x46, + 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, + 0x61, 0x62, 0x63, 0x69, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x70, 0x70, 0x48, 0x61, 0x73, + 0x68, 0x22, 0xf7, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6c, 0x6f, 0x67, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6c, 0x6f, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x6e, 0x66, + 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, + 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x69, 0x6e, + 0x64, 0x65, 0x78, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x38, 0x0a, 0x09, 0x70, + 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x6f, 0x70, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, + 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x63, 0x72, 0x79, 0x70, + 0x74, 0x6f, 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x4f, 0x70, 0x73, 0x52, 0x08, 0x70, 0x72, 0x6f, + 0x6f, 0x66, 0x4f, 0x70, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, + 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1c, 0x0a, + 0x09, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0xaa, 0x02, 0x0a, 0x0f, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x78, 0x12, + 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, + 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x6c, 0x6f, 0x67, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6c, 0x6f, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x6e, 0x66, + 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x1e, 0x0a, + 0x0a, 0x67, 0x61, 0x73, 0x5f, 0x77, 0x61, 0x6e, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x0a, 0x67, 0x61, 0x73, 0x5f, 0x77, 0x61, 0x6e, 0x74, 0x65, 0x64, 0x12, 0x1a, 0x0a, + 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x12, 0x48, 0x0a, 0x06, 0x65, 0x76, 0x65, + 0x6e, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x74, 0x65, 0x6e, 0x64, + 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x42, 0x18, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x10, 0x65, 0x76, 0x65, 0x6e, 0x74, + 0x73, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x06, 0x65, 0x76, 0x65, + 0x6e, 0x74, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x4a, 0x04, 0x08, 0x09, 0x10, 0x0c, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x52, + 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x52, 0x0d, 0x6d, 0x65, 0x6d, 0x70, 0x6f, + 0x6f, 0x6c, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x41, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, + 0x74, 0x61, 0x69, 0x6e, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x0c, 0x72, 0x65, 0x74, 0x61, 0x69, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x4a, + 0x04, 0x08, 0x01, 0x10, 0x02, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x22, 0x50, 0x0a, 0x15, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x6e, 0x61, 0x70, 0x73, + 0x68, 0x6f, 0x74, 0x73, 0x12, 0x37, 0x0a, 0x09, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, + 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, + 0x6f, 0x74, 0x52, 0x09, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x22, 0xbe, 0x01, + 0x0a, 0x15, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4f, 0x66, 0x66, 0x65, 0x72, 0x53, + 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x45, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2d, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, + 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x4f, 0x66, 0x66, 0x65, 0x72, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x2e, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x5e, + 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, + 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x43, 0x43, 0x45, 0x50, 0x54, 0x10, + 0x01, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x42, 0x4f, 0x52, 0x54, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, + 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x10, 0x03, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x45, 0x4a, 0x45, + 0x43, 0x54, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x10, 0x04, 0x12, 0x11, 0x0a, 0x0d, 0x52, + 0x45, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x53, 0x45, 0x4e, 0x44, 0x45, 0x52, 0x10, 0x05, 0x22, 0x31, + 0x0a, 0x19, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4c, 0x6f, 0x61, 0x64, 0x53, 0x6e, + 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x63, + 0x68, 0x75, 0x6e, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x63, 0x68, 0x75, 0x6e, + 0x6b, 0x22, 0x98, 0x02, 0x0a, 0x1a, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x41, 0x70, + 0x70, 0x6c, 0x79, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, + 0x12, 0x4a, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x32, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, + 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x79, + 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x2e, 0x52, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x25, 0x0a, 0x0e, + 0x72, 0x65, 0x66, 0x65, 0x74, 0x63, 0x68, 0x5f, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0d, 0x52, 0x0d, 0x72, 0x65, 0x66, 0x65, 0x74, 0x63, 0x68, 0x43, 0x68, 0x75, + 0x6e, 0x6b, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x73, 0x65, + 0x6e, 0x64, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x6a, + 0x65, 0x63, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x73, 0x22, 0x60, 0x0a, 0x06, 0x52, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, + 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x43, 0x43, 0x45, 0x50, 0x54, 0x10, 0x01, 0x12, 0x09, 0x0a, + 0x05, 0x41, 0x42, 0x4f, 0x52, 0x54, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x52, 0x45, 0x54, 0x52, + 0x59, 0x10, 0x03, 0x12, 0x12, 0x0a, 0x0e, 0x52, 0x45, 0x54, 0x52, 0x59, 0x5f, 0x53, 0x4e, 0x41, + 0x50, 0x53, 0x48, 0x4f, 0x54, 0x10, 0x04, 0x12, 0x13, 0x0a, 0x0f, 0x52, 0x45, 0x4a, 0x45, 0x43, + 0x54, 0x5f, 0x53, 0x4e, 0x41, 0x50, 0x53, 0x48, 0x4f, 0x54, 0x10, 0x05, 0x22, 0x2b, 0x0a, 0x17, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x50, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x78, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0c, 0x52, 0x03, 0x74, 0x78, 0x73, 0x22, 0xa1, 0x01, 0x0a, 0x17, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x50, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x4f, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x37, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, - 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x33, 0x0a, 0x0c, 0x56, 0x65, 0x72, 0x69, - 0x66, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, + 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x2e, + 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x35, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x43, 0x43, 0x45, 0x50, 0x54, 0x10, - 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x10, 0x02, 0x22, 0xea, 0x02, - 0x0a, 0x15, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, - 0x7a, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x48, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, - 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, - 0x18, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x10, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2c, - 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, - 0x73, 0x12, 0x3c, 0x0a, 0x0a, 0x74, 0x78, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, - 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x54, 0x78, 0x52, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x52, 0x09, 0x74, 0x78, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, - 0x53, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x74, 0x65, 0x6e, - 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x04, 0xc8, 0xde, - 0x1f, 0x00, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x73, 0x12, 0x59, 0x0a, 0x17, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, - 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, - 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x15, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, - 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x12, - 0x19, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x07, 0x61, 0x70, 0x70, 0x48, 0x61, 0x73, 0x68, 0x22, 0x59, 0x0a, 0x0a, 0x43, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x6f, 0x75, 0x6e, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x35, - 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, + 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x10, 0x02, 0x22, 0x3b, 0x0a, + 0x12, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x56, + 0x6f, 0x74, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x76, 0x6f, 0x74, 0x65, 0x5f, 0x65, 0x78, 0x74, 0x65, + 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x76, 0x6f, 0x74, + 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xa5, 0x01, 0x0a, 0x1b, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x56, 0x6f, 0x74, + 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x51, 0x0a, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x39, 0x2e, 0x74, 0x65, 0x6e, + 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x45, + 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x33, 0x0a, + 0x0c, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, + 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x43, + 0x43, 0x45, 0x50, 0x54, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, + 0x10, 0x02, 0x22, 0xea, 0x02, 0x0a, 0x15, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x46, + 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x48, 0x0a, 0x06, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x74, + 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x42, 0x18, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x10, 0x65, 0x76, + 0x65, 0x6e, 0x74, 0x73, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x06, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x3c, 0x0a, 0x0a, 0x74, 0x78, 0x5f, 0x72, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x74, 0x65, 0x6e, + 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x45, 0x78, 0x65, + 0x63, 0x54, 0x78, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x09, 0x74, 0x78, 0x52, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x73, 0x12, 0x53, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x20, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, + 0x69, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x12, 0x59, 0x0a, 0x17, 0x63, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x5f, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x74, 0x65, 0x6e, + 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, + 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x15, 0x63, + 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x68, 0x61, 0x73, 0x68, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x70, 0x70, 0x48, 0x61, 0x73, 0x68, 0x22, + 0x59, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, + 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x72, 0x6f, + 0x75, 0x6e, 0x64, 0x12, 0x35, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, + 0x61, 0x62, 0x63, 0x69, 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x04, 0xc8, + 0xde, 0x1f, 0x00, 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x22, 0x69, 0x0a, 0x12, 0x45, 0x78, + 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x14, 0x0a, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x3d, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, + 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x56, 0x6f, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x05, - 0x76, 0x6f, 0x74, 0x65, 0x73, 0x22, 0x69, 0x0a, 0x12, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, - 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x72, - 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x72, 0x6f, 0x75, 0x6e, - 0x64, 0x12, 0x3d, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x21, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, - 0x63, 0x69, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x56, 0x6f, 0x74, 0x65, 0x49, - 0x6e, 0x66, 0x6f, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x73, - 0x22, 0x7a, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x5d, 0x0a, - 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x1f, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, - 0x62, 0x63, 0x69, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, - 0x74, 0x65, 0x42, 0x1c, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x14, 0x61, 0x74, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, - 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x22, 0x4e, 0x0a, 0x0e, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 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, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x22, 0xfe, 0x01, 0x0a, - 0x0c, 0x45, 0x78, 0x65, 0x63, 0x54, 0x78, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x12, 0x0a, - 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x64, - 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x6c, 0x6f, 0x67, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6c, 0x6f, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x1d, 0x0a, 0x0a, 0x67, - 0x61, 0x73, 0x5f, 0x77, 0x61, 0x6e, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x09, 0x67, 0x61, 0x73, 0x57, 0x61, 0x6e, 0x74, 0x65, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, - 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, 0x61, - 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x48, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, - 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, - 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x18, 0xc8, - 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x10, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2c, 0x6f, 0x6d, - 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, - 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0x85, 0x01, - 0x0a, 0x08, 0x54, 0x78, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, - 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, - 0x68, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x78, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x74, 0x78, 0x12, 0x3b, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, - 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x54, - 0x78, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x72, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x3b, 0x0a, 0x09, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, - 0x70, 0x6f, 0x77, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, 0x6f, 0x77, - 0x65, 0x72, 0x22, 0x64, 0x0a, 0x0f, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x3b, 0x0a, 0x07, 0x70, 0x75, 0x62, 0x5f, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, - 0x69, 0x6e, 0x74, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x4b, 0x65, 0x79, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x75, 0x62, 0x4b, - 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x05, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x22, 0x93, 0x01, 0x0a, 0x08, 0x56, 0x6f, 0x74, - 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x3e, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, - 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x41, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x69, - 0x64, 0x5f, 0x66, 0x6c, 0x61, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x74, - 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x44, 0x46, 0x6c, 0x61, 0x67, 0x52, 0x0b, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x49, 0x64, 0x46, 0x6c, 0x61, 0x67, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x22, 0xf3, - 0x01, 0x0a, 0x10, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x56, 0x6f, 0x74, 0x65, 0x49, - 0x6e, 0x66, 0x6f, 0x12, 0x3e, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, - 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x12, 0x25, 0x0a, 0x0e, 0x76, 0x6f, 0x74, 0x65, 0x5f, 0x65, 0x78, 0x74, 0x65, - 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x76, 0x6f, 0x74, - 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2f, 0x0a, 0x13, 0x65, 0x78, - 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x12, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, - 0x6f, 0x6e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x41, 0x0a, 0x0d, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x69, 0x64, 0x5f, 0x66, 0x6c, 0x61, 0x67, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x44, 0x46, 0x6c, 0x61, - 0x67, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x64, 0x46, 0x6c, 0x61, 0x67, 0x4a, 0x04, - 0x08, 0x02, 0x10, 0x03, 0x22, 0x83, 0x02, 0x0a, 0x0b, 0x4d, 0x69, 0x73, 0x62, 0x65, 0x68, 0x61, - 0x76, 0x69, 0x6f, 0x72, 0x12, 0x34, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, - 0x61, 0x62, 0x63, 0x69, 0x2e, 0x4d, 0x69, 0x73, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, - 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x3e, 0x0a, 0x09, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x76, 0x6f, 0x74, 0x65, 0x73, 0x22, 0x7a, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x12, + 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x12, 0x5d, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, + 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x41, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x42, 0x1c, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, + 0x14, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2c, 0x6f, 0x6d, 0x69, 0x74, + 0x65, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, + 0x73, 0x22, 0x4e, 0x0a, 0x0e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 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, 0x12, 0x14, 0x0a, 0x05, 0x69, + 0x6e, 0x64, 0x65, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x22, 0x80, 0x02, 0x0a, 0x0c, 0x45, 0x78, 0x65, 0x63, 0x54, 0x78, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x6c, 0x6f, + 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6c, 0x6f, 0x67, 0x12, 0x12, 0x0a, 0x04, + 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, + 0x12, 0x1e, 0x0a, 0x0a, 0x67, 0x61, 0x73, 0x5f, 0x77, 0x61, 0x6e, 0x74, 0x65, 0x64, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x67, 0x61, 0x73, 0x5f, 0x77, 0x61, 0x6e, 0x74, 0x65, 0x64, + 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x12, 0x48, 0x0a, 0x06, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x74, + 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x42, 0x18, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x10, 0x65, 0x76, + 0x65, 0x6e, 0x74, 0x73, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x06, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x64, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x22, 0x85, 0x01, 0x0a, 0x08, 0x54, 0x78, 0x52, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, + 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, + 0x0e, 0x0a, 0x02, 0x74, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x74, 0x78, 0x12, + 0x3b, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1d, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, + 0x69, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x54, 0x78, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, 0x04, + 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x3b, 0x0a, 0x09, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x05, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x22, 0x64, 0x0a, 0x0f, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x3b, 0x0a, 0x07, + 0x70, 0x75, 0x62, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, + 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, + 0x6f, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x42, 0x04, 0xc8, 0xde, 0x1f, + 0x00, 0x52, 0x06, 0x70, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x6f, 0x77, + 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x22, + 0x93, 0x01, 0x0a, 0x08, 0x56, 0x6f, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x3e, 0x0a, 0x09, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, + 0x69, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x04, 0xc8, 0xde, 0x1f, + 0x00, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x41, 0x0a, 0x0d, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x69, 0x64, 0x5f, 0x66, 0x6c, 0x61, 0x67, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x44, 0x46, 0x6c, + 0x61, 0x67, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x64, 0x46, 0x6c, 0x61, 0x67, 0x4a, + 0x04, 0x08, 0x02, 0x10, 0x03, 0x22, 0xf3, 0x01, 0x0a, 0x10, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, + 0x65, 0x64, 0x56, 0x6f, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x3e, 0x0a, 0x09, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, - 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, - 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, - 0x68, 0x74, 0x12, 0x38, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x08, 0xc8, 0xde, - 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x2c, 0x0a, 0x12, - 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x6f, 0x77, - 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x56, - 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x22, 0x82, 0x01, 0x0a, 0x08, 0x53, - 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, - 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, - 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x12, - 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, - 0x61, 0x73, 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2a, - 0x39, 0x0a, 0x0b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x78, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, - 0x0a, 0x03, 0x4e, 0x45, 0x57, 0x10, 0x00, 0x1a, 0x07, 0x8a, 0x9d, 0x20, 0x03, 0x4e, 0x65, 0x77, - 0x12, 0x18, 0x0a, 0x07, 0x52, 0x45, 0x43, 0x48, 0x45, 0x43, 0x4b, 0x10, 0x01, 0x1a, 0x0b, 0x8a, - 0x9d, 0x20, 0x07, 0x52, 0x65, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x2a, 0x4b, 0x0a, 0x0f, 0x4d, 0x69, - 0x73, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, - 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x44, 0x55, - 0x50, 0x4c, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, 0x56, 0x4f, 0x54, 0x45, 0x10, 0x01, 0x12, 0x17, - 0x0a, 0x13, 0x4c, 0x49, 0x47, 0x48, 0x54, 0x5f, 0x43, 0x4c, 0x49, 0x45, 0x4e, 0x54, 0x5f, 0x41, - 0x54, 0x54, 0x41, 0x43, 0x4b, 0x10, 0x02, 0x32, 0x9d, 0x0b, 0x0a, 0x04, 0x41, 0x42, 0x43, 0x49, - 0x12, 0x43, 0x0a, 0x04, 0x45, 0x63, 0x68, 0x6f, 0x12, 0x1c, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, - 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x45, 0x63, 0x68, 0x6f, 0x1a, 0x1d, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, - 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x45, 0x63, 0x68, 0x6f, 0x12, 0x46, 0x0a, 0x05, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x12, 0x1d, - 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, - 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x1a, 0x1e, 0x2e, - 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x12, 0x43, 0x0a, - 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1c, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, - 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, - 0x6e, 0x66, 0x6f, 0x1a, 0x1d, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, - 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x49, 0x6e, - 0x66, 0x6f, 0x12, 0x4c, 0x0a, 0x07, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x78, 0x12, 0x1f, 0x2e, + 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x25, 0x0a, 0x0e, 0x76, 0x6f, + 0x74, 0x65, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x0d, 0x76, 0x6f, 0x74, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x2f, 0x0a, 0x13, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x12, + 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x12, 0x41, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x69, 0x64, 0x5f, 0x66, + 0x6c, 0x61, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x74, 0x65, 0x6e, 0x64, + 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x49, 0x44, 0x46, 0x6c, 0x61, 0x67, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x49, + 0x64, 0x46, 0x6c, 0x61, 0x67, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x22, 0x83, 0x02, 0x0a, 0x0b, + 0x4d, 0x69, 0x73, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x12, 0x34, 0x0a, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x74, 0x65, 0x6e, 0x64, + 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x4d, 0x69, 0x73, 0x62, + 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x12, 0x3e, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, + 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x38, 0x0a, 0x04, 0x74, 0x69, 0x6d, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x04, 0x74, + 0x69, 0x6d, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x76, 0x6f, 0x74, + 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x10, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x77, 0x65, + 0x72, 0x22, 0x82, 0x01, 0x0a, 0x08, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x16, + 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, + 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x16, + 0x0a, 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, + 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x6d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2a, 0x39, 0x0a, 0x0b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, + 0x78, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x4e, 0x45, 0x57, 0x10, 0x00, 0x1a, 0x07, + 0x8a, 0x9d, 0x20, 0x03, 0x4e, 0x65, 0x77, 0x12, 0x18, 0x0a, 0x07, 0x52, 0x45, 0x43, 0x48, 0x45, + 0x43, 0x4b, 0x10, 0x01, 0x1a, 0x0b, 0x8a, 0x9d, 0x20, 0x07, 0x52, 0x65, 0x63, 0x68, 0x65, 0x63, + 0x6b, 0x2a, 0x4b, 0x0a, 0x0f, 0x4d, 0x69, 0x73, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, + 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x44, 0x55, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, 0x56, + 0x4f, 0x54, 0x45, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x4c, 0x49, 0x47, 0x48, 0x54, 0x5f, 0x43, + 0x4c, 0x49, 0x45, 0x4e, 0x54, 0x5f, 0x41, 0x54, 0x54, 0x41, 0x43, 0x4b, 0x10, 0x02, 0x32, 0x9d, + 0x0b, 0x0a, 0x04, 0x41, 0x42, 0x43, 0x49, 0x12, 0x43, 0x0a, 0x04, 0x45, 0x63, 0x68, 0x6f, 0x12, + 0x1c, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, + 0x69, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x45, 0x63, 0x68, 0x6f, 0x1a, 0x1d, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x78, 0x1a, 0x20, - 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, - 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x78, - 0x12, 0x46, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x1d, 0x2e, 0x74, 0x65, 0x6e, 0x64, - 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x51, 0x75, 0x65, 0x72, 0x79, 0x1a, 0x1e, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, - 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x49, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x12, 0x1e, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, - 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x1a, 0x1f, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, - 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x12, 0x52, 0x0a, 0x09, 0x49, 0x6e, 0x69, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, - 0x12, 0x21, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, - 0x63, 0x69, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x69, 0x74, 0x43, 0x68, - 0x61, 0x69, 0x6e, 0x1a, 0x22, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, - 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x49, 0x6e, - 0x69, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x5e, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x53, - 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x12, 0x25, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, - 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x1a, - 0x26, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, - 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x6e, - 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x12, 0x5e, 0x0a, 0x0d, 0x4f, 0x66, 0x66, 0x65, 0x72, - 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x25, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, - 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x4f, 0x66, 0x66, 0x65, 0x72, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x1a, - 0x26, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, - 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4f, 0x66, 0x66, 0x65, 0x72, 0x53, - 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x6a, 0x0a, 0x11, 0x4c, 0x6f, 0x61, 0x64, 0x53, - 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x29, 0x2e, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x45, 0x63, 0x68, 0x6f, 0x12, 0x46, 0x0a, 0x05, + 0x46, 0x6c, 0x75, 0x73, 0x68, 0x12, 0x1d, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, + 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x46, + 0x6c, 0x75, 0x73, 0x68, 0x1a, 0x1e, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, + 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x46, + 0x6c, 0x75, 0x73, 0x68, 0x12, 0x43, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1c, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4c, 0x6f, 0x61, 0x64, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, - 0x6f, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x1a, 0x2a, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, - 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x4c, 0x6f, 0x61, 0x64, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x43, 0x68, - 0x75, 0x6e, 0x6b, 0x12, 0x6d, 0x0a, 0x12, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x53, 0x6e, 0x61, 0x70, - 0x73, 0x68, 0x6f, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x2a, 0x2e, 0x74, 0x65, 0x6e, 0x64, - 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, - 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x1a, 0x2b, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x1d, 0x2e, 0x74, 0x65, 0x6e, + 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x4c, 0x0a, 0x07, 0x43, 0x68, 0x65, + 0x63, 0x6b, 0x54, 0x78, 0x12, 0x1f, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, + 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, 0x68, + 0x65, 0x63, 0x6b, 0x54, 0x78, 0x1a, 0x20, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x41, 0x70, 0x70, 0x6c, 0x79, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x43, 0x68, 0x75, - 0x6e, 0x6b, 0x12, 0x64, 0x0a, 0x0f, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x50, 0x72, 0x6f, - 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x27, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, - 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, - 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x1a, 0x28, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x78, 0x12, 0x46, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x12, 0x1d, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, + 0x63, 0x69, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x51, 0x75, 0x65, 0x72, 0x79, 0x1a, + 0x1e, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, + 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, + 0x49, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x1e, 0x2e, 0x74, 0x65, 0x6e, 0x64, + 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x1a, 0x1f, 0x2e, 0x74, 0x65, 0x6e, 0x64, + 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x52, 0x0a, 0x09, 0x49, 0x6e, + 0x69, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x21, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, + 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x49, 0x6e, 0x69, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x1a, 0x22, 0x2e, 0x74, 0x65, 0x6e, + 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x49, 0x6e, 0x69, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x5e, + 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x12, + 0x25, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, + 0x69, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x6e, 0x61, + 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x1a, 0x26, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, + 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x12, 0x5e, + 0x0a, 0x0d, 0x4f, 0x66, 0x66, 0x65, 0x72, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, + 0x25, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, + 0x69, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4f, 0x66, 0x66, 0x65, 0x72, 0x53, 0x6e, + 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x1a, 0x26, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, + 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x4f, 0x66, 0x66, 0x65, 0x72, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x6a, + 0x0a, 0x11, 0x4c, 0x6f, 0x61, 0x64, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x43, 0x68, + 0x75, 0x6e, 0x6b, 0x12, 0x29, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, + 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4c, 0x6f, 0x61, + 0x64, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x1a, 0x2a, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, - 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, - 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x64, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x63, - 0x65, 0x73, 0x73, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x27, 0x2e, 0x74, 0x65, - 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x50, 0x72, 0x6f, 0x70, - 0x6f, 0x73, 0x61, 0x6c, 0x1a, 0x28, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, - 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, - 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x55, - 0x0a, 0x0a, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x22, 0x2e, 0x74, + 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4c, 0x6f, 0x61, 0x64, 0x53, 0x6e, 0x61, + 0x70, 0x73, 0x68, 0x6f, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x6d, 0x0a, 0x12, 0x41, 0x70, + 0x70, 0x6c, 0x79, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, + 0x12, 0x2a, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, + 0x63, 0x69, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x53, + 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x1a, 0x2b, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x56, 0x6f, 0x74, 0x65, - 0x1a, 0x23, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, - 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, - 0x64, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x70, 0x0a, 0x13, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x56, - 0x6f, 0x74, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x2e, 0x74, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x53, 0x6e, 0x61, 0x70, + 0x73, 0x68, 0x6f, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x64, 0x0a, 0x0f, 0x50, 0x72, 0x65, + 0x70, 0x61, 0x72, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x27, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x56, 0x6f, 0x74, 0x65, - 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0x2c, 0x2e, 0x74, 0x65, 0x6e, 0x64, - 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x45, 0x78, - 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x5e, 0x0a, 0x0d, 0x46, 0x69, 0x6e, 0x61, 0x6c, - 0x69, 0x7a, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x25, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, - 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x1a, - 0x26, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, - 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, - 0x7a, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0xa0, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, - 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x42, - 0x0a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x20, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x61, 0x62, 0x63, 0x69, 0xa2, - 0x02, 0x03, 0x54, 0x41, 0x58, 0xaa, 0x02, 0x0f, 0x54, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, - 0x6e, 0x74, 0x2e, 0x41, 0x62, 0x63, 0x69, 0xca, 0x02, 0x0f, 0x54, 0x65, 0x6e, 0x64, 0x65, 0x72, - 0x6d, 0x69, 0x6e, 0x74, 0x5c, 0x41, 0x62, 0x63, 0x69, 0xe2, 0x02, 0x1b, 0x54, 0x65, 0x6e, 0x64, - 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x5c, 0x41, 0x62, 0x63, 0x69, 0x5c, 0x47, 0x50, 0x42, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x54, 0x65, 0x6e, 0x64, 0x65, 0x72, - 0x6d, 0x69, 0x6e, 0x74, 0x3a, 0x3a, 0x41, 0x62, 0x63, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x50, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x1a, 0x28, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, + 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, + 0x64, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x61, 0x6c, 0x12, 0x27, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, + 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x63, + 0x65, 0x73, 0x73, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x1a, 0x28, 0x2e, 0x74, 0x65, + 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x50, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x55, 0x0a, 0x0a, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x56, + 0x6f, 0x74, 0x65, 0x12, 0x22, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, + 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x45, 0x78, 0x74, + 0x65, 0x6e, 0x64, 0x56, 0x6f, 0x74, 0x65, 0x1a, 0x23, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, + 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x70, 0x0a, 0x13, + 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, + 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x56, 0x65, 0x72, + 0x69, 0x66, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, + 0x1a, 0x2c, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, + 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65, 0x72, 0x69, 0x66, + 0x79, 0x56, 0x6f, 0x74, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x5e, + 0x0a, 0x0d, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, + 0x25, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, + 0x69, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, + 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x1a, 0x26, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, + 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0xa0, + 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, + 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x42, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, + 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, + 0x74, 0x2f, 0x61, 0x62, 0x63, 0x69, 0xa2, 0x02, 0x03, 0x54, 0x41, 0x58, 0xaa, 0x02, 0x0f, 0x54, + 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x41, 0x62, 0x63, 0x69, 0xca, 0x02, + 0x0f, 0x54, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x5c, 0x41, 0x62, 0x63, 0x69, + 0xe2, 0x02, 0x1b, 0x54, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x5c, 0x41, 0x62, + 0x63, 0x69, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x10, 0x54, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x3a, 0x3a, 0x41, 0x62, 0x63, + 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -34230,89 +34853,92 @@ var file_tendermint_abci_types_proto_depIdxs = []int32{ 41, // 24: tendermint.abci.RequestProcessProposal.proposed_last_commit:type_name -> tendermint.abci.CommitInfo 51, // 25: tendermint.abci.RequestProcessProposal.misbehavior:type_name -> tendermint.abci.Misbehavior 53, // 26: tendermint.abci.RequestProcessProposal.time:type_name -> google.protobuf.Timestamp - 41, // 27: tendermint.abci.RequestFinalizeBlock.decided_last_commit:type_name -> tendermint.abci.CommitInfo - 51, // 28: tendermint.abci.RequestFinalizeBlock.misbehavior:type_name -> tendermint.abci.Misbehavior - 53, // 29: tendermint.abci.RequestFinalizeBlock.time:type_name -> google.protobuf.Timestamp - 24, // 30: tendermint.abci.Response.exception:type_name -> tendermint.abci.ResponseException - 25, // 31: tendermint.abci.Response.echo:type_name -> tendermint.abci.ResponseEcho - 26, // 32: tendermint.abci.Response.flush:type_name -> tendermint.abci.ResponseFlush - 27, // 33: tendermint.abci.Response.info:type_name -> tendermint.abci.ResponseInfo - 28, // 34: tendermint.abci.Response.init_chain:type_name -> tendermint.abci.ResponseInitChain - 29, // 35: tendermint.abci.Response.query:type_name -> tendermint.abci.ResponseQuery - 30, // 36: tendermint.abci.Response.check_tx:type_name -> tendermint.abci.ResponseCheckTx - 31, // 37: tendermint.abci.Response.commit:type_name -> tendermint.abci.ResponseCommit - 32, // 38: tendermint.abci.Response.list_snapshots:type_name -> tendermint.abci.ResponseListSnapshots - 33, // 39: tendermint.abci.Response.offer_snapshot:type_name -> tendermint.abci.ResponseOfferSnapshot - 34, // 40: tendermint.abci.Response.load_snapshot_chunk:type_name -> tendermint.abci.ResponseLoadSnapshotChunk - 35, // 41: tendermint.abci.Response.apply_snapshot_chunk:type_name -> tendermint.abci.ResponseApplySnapshotChunk - 36, // 42: tendermint.abci.Response.prepare_proposal:type_name -> tendermint.abci.ResponsePrepareProposal - 37, // 43: tendermint.abci.Response.process_proposal:type_name -> tendermint.abci.ResponseProcessProposal - 38, // 44: tendermint.abci.Response.extend_vote:type_name -> tendermint.abci.ResponseExtendVote - 39, // 45: tendermint.abci.Response.verify_vote_extension:type_name -> tendermint.abci.ResponseVerifyVoteExtension - 40, // 46: tendermint.abci.Response.finalize_block:type_name -> tendermint.abci.ResponseFinalizeBlock - 54, // 47: tendermint.abci.ResponseInitChain.consensus_params:type_name -> tendermint.types.ConsensusParams - 48, // 48: tendermint.abci.ResponseInitChain.validators:type_name -> tendermint.abci.ValidatorUpdate - 55, // 49: tendermint.abci.ResponseQuery.proof_ops:type_name -> tendermint.crypto.ProofOps - 43, // 50: tendermint.abci.ResponseCheckTx.events:type_name -> tendermint.abci.Event - 52, // 51: tendermint.abci.ResponseListSnapshots.snapshots:type_name -> tendermint.abci.Snapshot - 2, // 52: tendermint.abci.ResponseOfferSnapshot.result:type_name -> tendermint.abci.ResponseOfferSnapshot.Result - 3, // 53: tendermint.abci.ResponseApplySnapshotChunk.result:type_name -> tendermint.abci.ResponseApplySnapshotChunk.Result - 4, // 54: tendermint.abci.ResponseProcessProposal.status:type_name -> tendermint.abci.ResponseProcessProposal.ProposalStatus - 5, // 55: tendermint.abci.ResponseVerifyVoteExtension.status:type_name -> tendermint.abci.ResponseVerifyVoteExtension.VerifyStatus - 43, // 56: tendermint.abci.ResponseFinalizeBlock.events:type_name -> tendermint.abci.Event - 45, // 57: tendermint.abci.ResponseFinalizeBlock.tx_results:type_name -> tendermint.abci.ExecTxResult - 48, // 58: tendermint.abci.ResponseFinalizeBlock.validator_updates:type_name -> tendermint.abci.ValidatorUpdate - 54, // 59: tendermint.abci.ResponseFinalizeBlock.consensus_param_updates:type_name -> tendermint.types.ConsensusParams - 49, // 60: tendermint.abci.CommitInfo.votes:type_name -> tendermint.abci.VoteInfo - 50, // 61: tendermint.abci.ExtendedCommitInfo.votes:type_name -> tendermint.abci.ExtendedVoteInfo - 44, // 62: tendermint.abci.Event.attributes:type_name -> tendermint.abci.EventAttribute - 43, // 63: tendermint.abci.ExecTxResult.events:type_name -> tendermint.abci.Event - 45, // 64: tendermint.abci.TxResult.result:type_name -> tendermint.abci.ExecTxResult - 56, // 65: tendermint.abci.ValidatorUpdate.pub_key:type_name -> tendermint.crypto.PublicKey - 47, // 66: tendermint.abci.VoteInfo.validator:type_name -> tendermint.abci.Validator - 57, // 67: tendermint.abci.VoteInfo.block_id_flag:type_name -> tendermint.types.BlockIDFlag - 47, // 68: tendermint.abci.ExtendedVoteInfo.validator:type_name -> tendermint.abci.Validator - 57, // 69: tendermint.abci.ExtendedVoteInfo.block_id_flag:type_name -> tendermint.types.BlockIDFlag - 1, // 70: tendermint.abci.Misbehavior.type:type_name -> tendermint.abci.MisbehaviorType - 47, // 71: tendermint.abci.Misbehavior.validator:type_name -> tendermint.abci.Validator - 53, // 72: tendermint.abci.Misbehavior.time:type_name -> google.protobuf.Timestamp - 7, // 73: tendermint.abci.ABCI.Echo:input_type -> tendermint.abci.RequestEcho - 8, // 74: tendermint.abci.ABCI.Flush:input_type -> tendermint.abci.RequestFlush - 9, // 75: tendermint.abci.ABCI.Info:input_type -> tendermint.abci.RequestInfo - 12, // 76: tendermint.abci.ABCI.CheckTx:input_type -> tendermint.abci.RequestCheckTx - 11, // 77: tendermint.abci.ABCI.Query:input_type -> tendermint.abci.RequestQuery - 13, // 78: tendermint.abci.ABCI.Commit:input_type -> tendermint.abci.RequestCommit - 10, // 79: tendermint.abci.ABCI.InitChain:input_type -> tendermint.abci.RequestInitChain - 14, // 80: tendermint.abci.ABCI.ListSnapshots:input_type -> tendermint.abci.RequestListSnapshots - 15, // 81: tendermint.abci.ABCI.OfferSnapshot:input_type -> tendermint.abci.RequestOfferSnapshot - 16, // 82: tendermint.abci.ABCI.LoadSnapshotChunk:input_type -> tendermint.abci.RequestLoadSnapshotChunk - 17, // 83: tendermint.abci.ABCI.ApplySnapshotChunk:input_type -> tendermint.abci.RequestApplySnapshotChunk - 18, // 84: tendermint.abci.ABCI.PrepareProposal:input_type -> tendermint.abci.RequestPrepareProposal - 19, // 85: tendermint.abci.ABCI.ProcessProposal:input_type -> tendermint.abci.RequestProcessProposal - 20, // 86: tendermint.abci.ABCI.ExtendVote:input_type -> tendermint.abci.RequestExtendVote - 21, // 87: tendermint.abci.ABCI.VerifyVoteExtension:input_type -> tendermint.abci.RequestVerifyVoteExtension - 22, // 88: tendermint.abci.ABCI.FinalizeBlock:input_type -> tendermint.abci.RequestFinalizeBlock - 25, // 89: tendermint.abci.ABCI.Echo:output_type -> tendermint.abci.ResponseEcho - 26, // 90: tendermint.abci.ABCI.Flush:output_type -> tendermint.abci.ResponseFlush - 27, // 91: tendermint.abci.ABCI.Info:output_type -> tendermint.abci.ResponseInfo - 30, // 92: tendermint.abci.ABCI.CheckTx:output_type -> tendermint.abci.ResponseCheckTx - 29, // 93: tendermint.abci.ABCI.Query:output_type -> tendermint.abci.ResponseQuery - 31, // 94: tendermint.abci.ABCI.Commit:output_type -> tendermint.abci.ResponseCommit - 28, // 95: tendermint.abci.ABCI.InitChain:output_type -> tendermint.abci.ResponseInitChain - 32, // 96: tendermint.abci.ABCI.ListSnapshots:output_type -> tendermint.abci.ResponseListSnapshots - 33, // 97: tendermint.abci.ABCI.OfferSnapshot:output_type -> tendermint.abci.ResponseOfferSnapshot - 34, // 98: tendermint.abci.ABCI.LoadSnapshotChunk:output_type -> tendermint.abci.ResponseLoadSnapshotChunk - 35, // 99: tendermint.abci.ABCI.ApplySnapshotChunk:output_type -> tendermint.abci.ResponseApplySnapshotChunk - 36, // 100: tendermint.abci.ABCI.PrepareProposal:output_type -> tendermint.abci.ResponsePrepareProposal - 37, // 101: tendermint.abci.ABCI.ProcessProposal:output_type -> tendermint.abci.ResponseProcessProposal - 38, // 102: tendermint.abci.ABCI.ExtendVote:output_type -> tendermint.abci.ResponseExtendVote - 39, // 103: tendermint.abci.ABCI.VerifyVoteExtension:output_type -> tendermint.abci.ResponseVerifyVoteExtension - 40, // 104: tendermint.abci.ABCI.FinalizeBlock:output_type -> tendermint.abci.ResponseFinalizeBlock - 89, // [89:105] is the sub-list for method output_type - 73, // [73:89] is the sub-list for method input_type - 73, // [73:73] is the sub-list for extension type_name - 73, // [73:73] is the sub-list for extension extendee - 0, // [0:73] is the sub-list for field type_name + 53, // 27: tendermint.abci.RequestExtendVote.time:type_name -> google.protobuf.Timestamp + 41, // 28: tendermint.abci.RequestExtendVote.proposed_last_commit:type_name -> tendermint.abci.CommitInfo + 51, // 29: tendermint.abci.RequestExtendVote.misbehavior:type_name -> tendermint.abci.Misbehavior + 41, // 30: tendermint.abci.RequestFinalizeBlock.decided_last_commit:type_name -> tendermint.abci.CommitInfo + 51, // 31: tendermint.abci.RequestFinalizeBlock.misbehavior:type_name -> tendermint.abci.Misbehavior + 53, // 32: tendermint.abci.RequestFinalizeBlock.time:type_name -> google.protobuf.Timestamp + 24, // 33: tendermint.abci.Response.exception:type_name -> tendermint.abci.ResponseException + 25, // 34: tendermint.abci.Response.echo:type_name -> tendermint.abci.ResponseEcho + 26, // 35: tendermint.abci.Response.flush:type_name -> tendermint.abci.ResponseFlush + 27, // 36: tendermint.abci.Response.info:type_name -> tendermint.abci.ResponseInfo + 28, // 37: tendermint.abci.Response.init_chain:type_name -> tendermint.abci.ResponseInitChain + 29, // 38: tendermint.abci.Response.query:type_name -> tendermint.abci.ResponseQuery + 30, // 39: tendermint.abci.Response.check_tx:type_name -> tendermint.abci.ResponseCheckTx + 31, // 40: tendermint.abci.Response.commit:type_name -> tendermint.abci.ResponseCommit + 32, // 41: tendermint.abci.Response.list_snapshots:type_name -> tendermint.abci.ResponseListSnapshots + 33, // 42: tendermint.abci.Response.offer_snapshot:type_name -> tendermint.abci.ResponseOfferSnapshot + 34, // 43: tendermint.abci.Response.load_snapshot_chunk:type_name -> tendermint.abci.ResponseLoadSnapshotChunk + 35, // 44: tendermint.abci.Response.apply_snapshot_chunk:type_name -> tendermint.abci.ResponseApplySnapshotChunk + 36, // 45: tendermint.abci.Response.prepare_proposal:type_name -> tendermint.abci.ResponsePrepareProposal + 37, // 46: tendermint.abci.Response.process_proposal:type_name -> tendermint.abci.ResponseProcessProposal + 38, // 47: tendermint.abci.Response.extend_vote:type_name -> tendermint.abci.ResponseExtendVote + 39, // 48: tendermint.abci.Response.verify_vote_extension:type_name -> tendermint.abci.ResponseVerifyVoteExtension + 40, // 49: tendermint.abci.Response.finalize_block:type_name -> tendermint.abci.ResponseFinalizeBlock + 54, // 50: tendermint.abci.ResponseInitChain.consensus_params:type_name -> tendermint.types.ConsensusParams + 48, // 51: tendermint.abci.ResponseInitChain.validators:type_name -> tendermint.abci.ValidatorUpdate + 55, // 52: tendermint.abci.ResponseQuery.proof_ops:type_name -> tendermint.crypto.ProofOps + 43, // 53: tendermint.abci.ResponseCheckTx.events:type_name -> tendermint.abci.Event + 52, // 54: tendermint.abci.ResponseListSnapshots.snapshots:type_name -> tendermint.abci.Snapshot + 2, // 55: tendermint.abci.ResponseOfferSnapshot.result:type_name -> tendermint.abci.ResponseOfferSnapshot.Result + 3, // 56: tendermint.abci.ResponseApplySnapshotChunk.result:type_name -> tendermint.abci.ResponseApplySnapshotChunk.Result + 4, // 57: tendermint.abci.ResponseProcessProposal.status:type_name -> tendermint.abci.ResponseProcessProposal.ProposalStatus + 5, // 58: tendermint.abci.ResponseVerifyVoteExtension.status:type_name -> tendermint.abci.ResponseVerifyVoteExtension.VerifyStatus + 43, // 59: tendermint.abci.ResponseFinalizeBlock.events:type_name -> tendermint.abci.Event + 45, // 60: tendermint.abci.ResponseFinalizeBlock.tx_results:type_name -> tendermint.abci.ExecTxResult + 48, // 61: tendermint.abci.ResponseFinalizeBlock.validator_updates:type_name -> tendermint.abci.ValidatorUpdate + 54, // 62: tendermint.abci.ResponseFinalizeBlock.consensus_param_updates:type_name -> tendermint.types.ConsensusParams + 49, // 63: tendermint.abci.CommitInfo.votes:type_name -> tendermint.abci.VoteInfo + 50, // 64: tendermint.abci.ExtendedCommitInfo.votes:type_name -> tendermint.abci.ExtendedVoteInfo + 44, // 65: tendermint.abci.Event.attributes:type_name -> tendermint.abci.EventAttribute + 43, // 66: tendermint.abci.ExecTxResult.events:type_name -> tendermint.abci.Event + 45, // 67: tendermint.abci.TxResult.result:type_name -> tendermint.abci.ExecTxResult + 56, // 68: tendermint.abci.ValidatorUpdate.pub_key:type_name -> tendermint.crypto.PublicKey + 47, // 69: tendermint.abci.VoteInfo.validator:type_name -> tendermint.abci.Validator + 57, // 70: tendermint.abci.VoteInfo.block_id_flag:type_name -> tendermint.types.BlockIDFlag + 47, // 71: tendermint.abci.ExtendedVoteInfo.validator:type_name -> tendermint.abci.Validator + 57, // 72: tendermint.abci.ExtendedVoteInfo.block_id_flag:type_name -> tendermint.types.BlockIDFlag + 1, // 73: tendermint.abci.Misbehavior.type:type_name -> tendermint.abci.MisbehaviorType + 47, // 74: tendermint.abci.Misbehavior.validator:type_name -> tendermint.abci.Validator + 53, // 75: tendermint.abci.Misbehavior.time:type_name -> google.protobuf.Timestamp + 7, // 76: tendermint.abci.ABCI.Echo:input_type -> tendermint.abci.RequestEcho + 8, // 77: tendermint.abci.ABCI.Flush:input_type -> tendermint.abci.RequestFlush + 9, // 78: tendermint.abci.ABCI.Info:input_type -> tendermint.abci.RequestInfo + 12, // 79: tendermint.abci.ABCI.CheckTx:input_type -> tendermint.abci.RequestCheckTx + 11, // 80: tendermint.abci.ABCI.Query:input_type -> tendermint.abci.RequestQuery + 13, // 81: tendermint.abci.ABCI.Commit:input_type -> tendermint.abci.RequestCommit + 10, // 82: tendermint.abci.ABCI.InitChain:input_type -> tendermint.abci.RequestInitChain + 14, // 83: tendermint.abci.ABCI.ListSnapshots:input_type -> tendermint.abci.RequestListSnapshots + 15, // 84: tendermint.abci.ABCI.OfferSnapshot:input_type -> tendermint.abci.RequestOfferSnapshot + 16, // 85: tendermint.abci.ABCI.LoadSnapshotChunk:input_type -> tendermint.abci.RequestLoadSnapshotChunk + 17, // 86: tendermint.abci.ABCI.ApplySnapshotChunk:input_type -> tendermint.abci.RequestApplySnapshotChunk + 18, // 87: tendermint.abci.ABCI.PrepareProposal:input_type -> tendermint.abci.RequestPrepareProposal + 19, // 88: tendermint.abci.ABCI.ProcessProposal:input_type -> tendermint.abci.RequestProcessProposal + 20, // 89: tendermint.abci.ABCI.ExtendVote:input_type -> tendermint.abci.RequestExtendVote + 21, // 90: tendermint.abci.ABCI.VerifyVoteExtension:input_type -> tendermint.abci.RequestVerifyVoteExtension + 22, // 91: tendermint.abci.ABCI.FinalizeBlock:input_type -> tendermint.abci.RequestFinalizeBlock + 25, // 92: tendermint.abci.ABCI.Echo:output_type -> tendermint.abci.ResponseEcho + 26, // 93: tendermint.abci.ABCI.Flush:output_type -> tendermint.abci.ResponseFlush + 27, // 94: tendermint.abci.ABCI.Info:output_type -> tendermint.abci.ResponseInfo + 30, // 95: tendermint.abci.ABCI.CheckTx:output_type -> tendermint.abci.ResponseCheckTx + 29, // 96: tendermint.abci.ABCI.Query:output_type -> tendermint.abci.ResponseQuery + 31, // 97: tendermint.abci.ABCI.Commit:output_type -> tendermint.abci.ResponseCommit + 28, // 98: tendermint.abci.ABCI.InitChain:output_type -> tendermint.abci.ResponseInitChain + 32, // 99: tendermint.abci.ABCI.ListSnapshots:output_type -> tendermint.abci.ResponseListSnapshots + 33, // 100: tendermint.abci.ABCI.OfferSnapshot:output_type -> tendermint.abci.ResponseOfferSnapshot + 34, // 101: tendermint.abci.ABCI.LoadSnapshotChunk:output_type -> tendermint.abci.ResponseLoadSnapshotChunk + 35, // 102: tendermint.abci.ABCI.ApplySnapshotChunk:output_type -> tendermint.abci.ResponseApplySnapshotChunk + 36, // 103: tendermint.abci.ABCI.PrepareProposal:output_type -> tendermint.abci.ResponsePrepareProposal + 37, // 104: tendermint.abci.ABCI.ProcessProposal:output_type -> tendermint.abci.ResponseProcessProposal + 38, // 105: tendermint.abci.ABCI.ExtendVote:output_type -> tendermint.abci.ResponseExtendVote + 39, // 106: tendermint.abci.ABCI.VerifyVoteExtension:output_type -> tendermint.abci.ResponseVerifyVoteExtension + 40, // 107: tendermint.abci.ABCI.FinalizeBlock:output_type -> tendermint.abci.ResponseFinalizeBlock + 92, // [92:108] is the sub-list for method output_type + 76, // [76:92] is the sub-list for method input_type + 76, // [76:76] is the sub-list for extension type_name + 76, // [76:76] is the sub-list for extension extendee + 0, // [0:76] is the sub-list for field type_name } func init() { file_tendermint_abci_types_proto_init() } diff --git a/api/tendermint/abci/types_grpc.pb.go b/api/tendermint/abci/types_grpc.pb.go index 108925f47468..11bd3bd1af52 100644 --- a/api/tendermint/abci/types_grpc.pb.go +++ b/api/tendermint/abci/types_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: tendermint/abci/types.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( ABCI_Echo_FullMethodName = "/tendermint.abci.ABCI/Echo" @@ -68,8 +68,9 @@ func NewABCIClient(cc grpc.ClientConnInterface) ABCIClient { } func (c *aBCIClient) Echo(ctx context.Context, in *RequestEcho, opts ...grpc.CallOption) (*ResponseEcho, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ResponseEcho) - err := c.cc.Invoke(ctx, ABCI_Echo_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ABCI_Echo_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -77,8 +78,9 @@ func (c *aBCIClient) Echo(ctx context.Context, in *RequestEcho, opts ...grpc.Cal } func (c *aBCIClient) Flush(ctx context.Context, in *RequestFlush, opts ...grpc.CallOption) (*ResponseFlush, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ResponseFlush) - err := c.cc.Invoke(ctx, ABCI_Flush_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ABCI_Flush_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -86,8 +88,9 @@ func (c *aBCIClient) Flush(ctx context.Context, in *RequestFlush, opts ...grpc.C } func (c *aBCIClient) Info(ctx context.Context, in *RequestInfo, opts ...grpc.CallOption) (*ResponseInfo, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ResponseInfo) - err := c.cc.Invoke(ctx, ABCI_Info_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ABCI_Info_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -95,8 +98,9 @@ func (c *aBCIClient) Info(ctx context.Context, in *RequestInfo, opts ...grpc.Cal } func (c *aBCIClient) CheckTx(ctx context.Context, in *RequestCheckTx, opts ...grpc.CallOption) (*ResponseCheckTx, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ResponseCheckTx) - err := c.cc.Invoke(ctx, ABCI_CheckTx_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ABCI_CheckTx_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -104,8 +108,9 @@ func (c *aBCIClient) CheckTx(ctx context.Context, in *RequestCheckTx, opts ...gr } func (c *aBCIClient) Query(ctx context.Context, in *RequestQuery, opts ...grpc.CallOption) (*ResponseQuery, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ResponseQuery) - err := c.cc.Invoke(ctx, ABCI_Query_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ABCI_Query_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -113,8 +118,9 @@ func (c *aBCIClient) Query(ctx context.Context, in *RequestQuery, opts ...grpc.C } func (c *aBCIClient) Commit(ctx context.Context, in *RequestCommit, opts ...grpc.CallOption) (*ResponseCommit, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ResponseCommit) - err := c.cc.Invoke(ctx, ABCI_Commit_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ABCI_Commit_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -122,8 +128,9 @@ func (c *aBCIClient) Commit(ctx context.Context, in *RequestCommit, opts ...grpc } func (c *aBCIClient) InitChain(ctx context.Context, in *RequestInitChain, opts ...grpc.CallOption) (*ResponseInitChain, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ResponseInitChain) - err := c.cc.Invoke(ctx, ABCI_InitChain_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ABCI_InitChain_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -131,8 +138,9 @@ func (c *aBCIClient) InitChain(ctx context.Context, in *RequestInitChain, opts . } func (c *aBCIClient) ListSnapshots(ctx context.Context, in *RequestListSnapshots, opts ...grpc.CallOption) (*ResponseListSnapshots, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ResponseListSnapshots) - err := c.cc.Invoke(ctx, ABCI_ListSnapshots_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ABCI_ListSnapshots_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -140,8 +148,9 @@ func (c *aBCIClient) ListSnapshots(ctx context.Context, in *RequestListSnapshots } func (c *aBCIClient) OfferSnapshot(ctx context.Context, in *RequestOfferSnapshot, opts ...grpc.CallOption) (*ResponseOfferSnapshot, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ResponseOfferSnapshot) - err := c.cc.Invoke(ctx, ABCI_OfferSnapshot_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ABCI_OfferSnapshot_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -149,8 +158,9 @@ func (c *aBCIClient) OfferSnapshot(ctx context.Context, in *RequestOfferSnapshot } func (c *aBCIClient) LoadSnapshotChunk(ctx context.Context, in *RequestLoadSnapshotChunk, opts ...grpc.CallOption) (*ResponseLoadSnapshotChunk, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ResponseLoadSnapshotChunk) - err := c.cc.Invoke(ctx, ABCI_LoadSnapshotChunk_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ABCI_LoadSnapshotChunk_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -158,8 +168,9 @@ func (c *aBCIClient) LoadSnapshotChunk(ctx context.Context, in *RequestLoadSnaps } func (c *aBCIClient) ApplySnapshotChunk(ctx context.Context, in *RequestApplySnapshotChunk, opts ...grpc.CallOption) (*ResponseApplySnapshotChunk, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ResponseApplySnapshotChunk) - err := c.cc.Invoke(ctx, ABCI_ApplySnapshotChunk_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ABCI_ApplySnapshotChunk_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -167,8 +178,9 @@ func (c *aBCIClient) ApplySnapshotChunk(ctx context.Context, in *RequestApplySna } func (c *aBCIClient) PrepareProposal(ctx context.Context, in *RequestPrepareProposal, opts ...grpc.CallOption) (*ResponsePrepareProposal, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ResponsePrepareProposal) - err := c.cc.Invoke(ctx, ABCI_PrepareProposal_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ABCI_PrepareProposal_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -176,8 +188,9 @@ func (c *aBCIClient) PrepareProposal(ctx context.Context, in *RequestPrepareProp } func (c *aBCIClient) ProcessProposal(ctx context.Context, in *RequestProcessProposal, opts ...grpc.CallOption) (*ResponseProcessProposal, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ResponseProcessProposal) - err := c.cc.Invoke(ctx, ABCI_ProcessProposal_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ABCI_ProcessProposal_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -185,8 +198,9 @@ func (c *aBCIClient) ProcessProposal(ctx context.Context, in *RequestProcessProp } func (c *aBCIClient) ExtendVote(ctx context.Context, in *RequestExtendVote, opts ...grpc.CallOption) (*ResponseExtendVote, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ResponseExtendVote) - err := c.cc.Invoke(ctx, ABCI_ExtendVote_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ABCI_ExtendVote_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -194,8 +208,9 @@ func (c *aBCIClient) ExtendVote(ctx context.Context, in *RequestExtendVote, opts } func (c *aBCIClient) VerifyVoteExtension(ctx context.Context, in *RequestVerifyVoteExtension, opts ...grpc.CallOption) (*ResponseVerifyVoteExtension, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ResponseVerifyVoteExtension) - err := c.cc.Invoke(ctx, ABCI_VerifyVoteExtension_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ABCI_VerifyVoteExtension_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -203,8 +218,9 @@ func (c *aBCIClient) VerifyVoteExtension(ctx context.Context, in *RequestVerifyV } func (c *aBCIClient) FinalizeBlock(ctx context.Context, in *RequestFinalizeBlock, opts ...grpc.CallOption) (*ResponseFinalizeBlock, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ResponseFinalizeBlock) - err := c.cc.Invoke(ctx, ABCI_FinalizeBlock_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ABCI_FinalizeBlock_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -213,7 +229,7 @@ func (c *aBCIClient) FinalizeBlock(ctx context.Context, in *RequestFinalizeBlock // ABCIServer is the server API for ABCI service. // All implementations must embed UnimplementedABCIServer -// for forward compatibility +// for forward compatibility. type ABCIServer interface { Echo(context.Context, *RequestEcho) (*ResponseEcho, error) Flush(context.Context, *RequestFlush) (*ResponseFlush, error) @@ -234,9 +250,12 @@ type ABCIServer interface { mustEmbedUnimplementedABCIServer() } -// UnimplementedABCIServer must be embedded to have forward compatible implementations. -type UnimplementedABCIServer struct { -} +// UnimplementedABCIServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedABCIServer struct{} func (UnimplementedABCIServer) Echo(context.Context, *RequestEcho) (*ResponseEcho, error) { return nil, status.Errorf(codes.Unimplemented, "method Echo not implemented") @@ -287,6 +306,7 @@ func (UnimplementedABCIServer) FinalizeBlock(context.Context, *RequestFinalizeBl return nil, status.Errorf(codes.Unimplemented, "method FinalizeBlock not implemented") } func (UnimplementedABCIServer) mustEmbedUnimplementedABCIServer() {} +func (UnimplementedABCIServer) testEmbeddedByValue() {} // UnsafeABCIServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to ABCIServer will @@ -296,6 +316,13 @@ type UnsafeABCIServer interface { } func RegisterABCIServer(s grpc.ServiceRegistrar, srv ABCIServer) { + // If the following call pancis, it indicates UnimplementedABCIServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&ABCI_ServiceDesc, srv) } diff --git a/api/tendermint/types/params.pulsar.go b/api/tendermint/types/params.pulsar.go index 183bbd907b58..8045bb7863b3 100644 --- a/api/tendermint/types/params.pulsar.go +++ b/api/tendermint/types/params.pulsar.go @@ -3908,17 +3908,17 @@ var file_tendermint_types_params_proto_rawDesc = []byte{ 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x1a, 0x76, 0x6f, 0x74, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x42, 0xab, - 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, - 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x42, 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x21, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, - 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, - 0x69, 0x6e, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0xa2, 0x02, 0x03, 0x54, 0x54, 0x58, 0xaa, - 0x02, 0x10, 0x54, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x54, 0x79, 0x70, - 0x65, 0x73, 0xca, 0x02, 0x10, 0x54, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x5c, - 0x54, 0x79, 0x70, 0x65, 0x73, 0xe2, 0x02, 0x1c, 0x54, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, - 0x6e, 0x74, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x54, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, - 0x74, 0x3a, 0x3a, 0x54, 0x79, 0x70, 0x65, 0x73, 0xa8, 0xe2, 0x1e, 0x01, 0x62, 0x06, 0x70, 0x72, + 0x01, 0xa8, 0xe2, 0x1e, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, + 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x42, 0x0b, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x21, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x65, 0x6e, + 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0xa2, 0x02, 0x03, + 0x54, 0x54, 0x58, 0xaa, 0x02, 0x10, 0x54, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, + 0x2e, 0x54, 0x79, 0x70, 0x65, 0x73, 0xca, 0x02, 0x10, 0x54, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, + 0x69, 0x6e, 0x74, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0xe2, 0x02, 0x1c, 0x54, 0x65, 0x6e, 0x64, + 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x54, 0x65, 0x6e, 0x64, 0x65, + 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x3a, 0x3a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } diff --git a/baseapp/abci.go b/baseapp/abci.go index 6dc7d404fb7f..67ddc5ded286 100644 --- a/baseapp/abci.go +++ b/baseapp/abci.go @@ -2,18 +2,11 @@ package baseapp import ( "context" - "crypto/sha256" "fmt" - "os" "sort" "strings" - "syscall" "time" - errorsmod "cosmossdk.io/errors" - "cosmossdk.io/store/rootmulti" - snapshottypes "cosmossdk.io/store/snapshots/types" - storetypes "cosmossdk.io/store/types" "github.com/cockroachdb/errors" abci "github.com/cometbft/cometbft/abci/types" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" @@ -21,6 +14,12 @@ import ( "google.golang.org/grpc/codes" grpcstatus "google.golang.org/grpc/status" + coreheader "cosmossdk.io/core/header" + errorsmod "cosmossdk.io/errors" + "cosmossdk.io/store/rootmulti" + snapshottypes "cosmossdk.io/store/snapshots/types" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" @@ -45,13 +44,14 @@ func (app *BaseApp) InitChain(req *abci.RequestInitChain) (*abci.ResponseInitCha // On a new chain, we consider the init chain block height as 0, even though // req.InitialHeight is 1 by default. initHeader := cmtproto.Header{ChainID: req.ChainId, Time: req.Time} - app.initialHeight = req.InitialHeight - app.logger.Info("InitChain", "initialHeight", req.InitialHeight, "chainID", req.ChainId) // Set the initial height, which will be used to determine if we are proposing // or processing the first block or not. app.initialHeight = req.InitialHeight + if app.initialHeight == 0 { // If initial height is 0, set it to 1 + app.initialHeight = 1 + } // if req.InitialHeight is > 1, then we set the initial version on all stores if req.InitialHeight > 1 { @@ -69,7 +69,7 @@ func (app *BaseApp) InitChain(req *abci.RequestInitChain) (*abci.ResponseInitCha // done after the finalizeBlockState and context have been set as it's persisted // to state. if req.ConsensusParams != nil { - err := app.StoreConsensusParams(app.finalizeBlockState.ctx, *req.ConsensusParams) + err := app.StoreConsensusParams(app.finalizeBlockState.Context(), *req.ConsensusParams) if err != nil { return nil, err } @@ -81,8 +81,18 @@ func (app *BaseApp) InitChain(req *abci.RequestInitChain) (*abci.ResponseInitCha // handler, the block height is zero by default. However, after Commit is called // the height needs to reflect the true block height. initHeader.Height = req.InitialHeight - app.checkState.ctx = app.checkState.ctx.WithBlockHeader(initHeader) - app.finalizeBlockState.ctx = app.finalizeBlockState.ctx.WithBlockHeader(initHeader) + app.checkState.SetContext(app.checkState.Context().WithBlockHeader(initHeader). + WithHeaderInfo(coreheader.Info{ + ChainID: req.ChainId, + Height: req.InitialHeight, + Time: req.Time, + })) + app.finalizeBlockState.SetContext(app.finalizeBlockState.Context().WithBlockHeader(initHeader). + WithHeaderInfo(coreheader.Info{ + ChainID: req.ChainId, + Height: req.InitialHeight, + Time: req.Time, + })) }() if app.initChainer == nil { @@ -90,9 +100,9 @@ func (app *BaseApp) InitChain(req *abci.RequestInitChain) (*abci.ResponseInitCha } // add block gas meter for any genesis transactions (allow infinite gas) - app.finalizeBlockState.ctx = app.finalizeBlockState.ctx.WithBlockGasMeter(storetypes.NewInfiniteGasMeter()) + app.finalizeBlockState.SetContext(app.finalizeBlockState.Context().WithBlockGasMeter(storetypes.NewInfiniteGasMeter())) - res, err := app.initChainer(app.finalizeBlockState.ctx, req) + res, err := app.initChainer(app.finalizeBlockState.Context(), req) if err != nil { return nil, err } @@ -115,28 +125,16 @@ func (app *BaseApp) InitChain(req *abci.RequestInitChain) (*abci.ResponseInitCha } } - // In the case of a new chain, AppHash will be the hash of an empty string. - // During an upgrade, it'll be the hash of the last committed block. - var appHash []byte - if !app.LastCommitID().IsZero() { - appHash = app.LastCommitID().Hash - } else { - // $ echo -n '' | sha256sum - // e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - emptyHash := sha256.Sum256([]byte{}) - appHash = emptyHash[:] - } - // NOTE: We don't commit, but FinalizeBlock for block InitialHeight starts from // this FinalizeBlockState. return &abci.ResponseInitChain{ ConsensusParams: res.ConsensusParams, Validators: res.Validators, - AppHash: appHash, + AppHash: app.LastCommitID().Hash, }, nil } -func (app *BaseApp) Info(req *abci.RequestInfo) (*abci.ResponseInfo, error) { +func (app *BaseApp) Info(_ *abci.RequestInfo) (*abci.ResponseInfo, error) { lastCommitID := app.cms.LastCommitID() return &abci.ResponseInfo{ @@ -167,7 +165,7 @@ func (app *BaseApp) Query(_ context.Context, req *abci.RequestQuery) (resp *abci telemetry.IncrCounter(1, "query", "count") telemetry.IncrCounter(1, "query", req.Path) - defer telemetry.MeasureSince(time.Now(), req.Path) + defer telemetry.MeasureSince(telemetry.Now(), req.Path) if req.Path == QueryPathBroadcastTx { return sdkerrors.QueryResult(errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "can't route a broadcast tx message"), app.trace), nil @@ -285,6 +283,10 @@ func (app *BaseApp) OfferSnapshot(req *abci.RequestOfferSnapshot) (*abci.Respons return &abci.ResponseOfferSnapshot{Result: abci.ResponseOfferSnapshot_REJECT}, nil default: + // CometBFT errors are defined here: https://github.com/cometbft/cometbft/blob/main/statesync/syncer.go + // It may happen that in case of a CometBFT error, such as a timeout (which occurs after two minutes), + // the process is aborted. This is done intentionally because deleting the database programmatically + // can lead to more complicated situations. app.logger.Error( "failed to restore snapshot", "height", req.Snapshot.Height, @@ -389,6 +391,7 @@ func (app *BaseApp) PrepareProposal(req *abci.RequestPrepareProposal) (resp *abc Time: req.Time, ProposerAddress: req.ProposerAddress, NextValidatorsHash: req.NextValidatorsHash, + AppHash: app.LastCommitID().Hash, } app.setState(execModePrepareProposal, header) @@ -399,17 +402,22 @@ func (app *BaseApp) PrepareProposal(req *abci.RequestPrepareProposal) (resp *abc return nil, errors.New("PrepareProposal called with invalid height") } - app.prepareProposalState.ctx = app.getContextForProposal(app.prepareProposalState.ctx, req.Height). + app.prepareProposalState.SetContext(app.getContextForProposal(app.prepareProposalState.Context(), req.Height). WithVoteInfos(toVoteInfo(req.LocalLastCommit.Votes)). // this is a set of votes that are not finalized yet, wait for commit WithBlockHeight(req.Height). WithBlockTime(req.Time). WithProposer(req.ProposerAddress). WithExecMode(sdk.ExecModePrepareProposal). - WithCometInfo(prepareProposalInfo{req}) + WithCometInfo(prepareProposalInfo{req}). + WithHeaderInfo(coreheader.Info{ + ChainID: app.chainID, + Height: req.Height, + Time: req.Time, + })) - app.prepareProposalState.ctx = app.prepareProposalState.ctx. - WithConsensusParams(app.GetConsensusParams(app.prepareProposalState.ctx)). - WithBlockGasMeter(app.getBlockGasMeter(app.prepareProposalState.ctx)) + app.prepareProposalState.SetContext(app.prepareProposalState.Context(). + WithConsensusParams(app.GetConsensusParams(app.prepareProposalState.Context())). + WithBlockGasMeter(app.getBlockGasMeter(app.prepareProposalState.Context()))) defer func() { if err := recover(); err != nil { @@ -420,14 +428,14 @@ func (app *BaseApp) PrepareProposal(req *abci.RequestPrepareProposal) (resp *abc "panic", err, ) - resp = &abci.ResponsePrepareProposal{} + resp = &abci.ResponsePrepareProposal{Txs: req.Txs} } }() - resp, err = app.prepareProposal(app.prepareProposalState.ctx, req) + resp, err = app.prepareProposal(app.prepareProposalState.Context(), req) if err != nil { - app.logger.Error("failed to prepare proposal", "height", req.Height, "error", err) - return &abci.ResponsePrepareProposal{}, nil + app.logger.Error("failed to prepare proposal", "height", req.Height, "time", req.Time, "err", err) + return &abci.ResponsePrepareProposal{Txs: req.Txs}, nil } return resp, nil @@ -467,6 +475,7 @@ func (app *BaseApp) ProcessProposal(req *abci.RequestProcessProposal) (resp *abc Time: req.Time, ProposerAddress: req.ProposerAddress, NextValidatorsHash: req.NextValidatorsHash, + AppHash: app.LastCommitID().Hash, } app.setState(execModeProcessProposal, header) @@ -476,21 +485,28 @@ func (app *BaseApp) ProcessProposal(req *abci.RequestProcessProposal) (resp *abc // processed the first block, as we want to avoid overwriting the finalizeState // after state changes during InitChain. if req.Height > app.initialHeight { + // abort any running OE + app.optimisticExec.Abort() app.setState(execModeFinalize, header) } - app.processProposalState.ctx = app.getContextForProposal(app.processProposalState.ctx, req.Height). + app.processProposalState.SetContext(app.getContextForProposal(app.processProposalState.Context(), req.Height). WithVoteInfos(req.ProposedLastCommit.Votes). // this is a set of votes that are not finalized yet, wait for commit WithBlockHeight(req.Height). WithBlockTime(req.Time). WithHeaderHash(req.Hash). WithProposer(req.ProposerAddress). WithCometInfo(cometInfo{ProposerAddress: req.ProposerAddress, ValidatorsHash: req.NextValidatorsHash, Misbehavior: req.Misbehavior, LastCommit: req.ProposedLastCommit}). - WithExecMode(sdk.ExecModeProcessProposal) + WithExecMode(sdk.ExecModeProcessProposal). + WithHeaderInfo(coreheader.Info{ + ChainID: app.chainID, + Height: req.Height, + Time: req.Time, + })) - app.processProposalState.ctx = app.processProposalState.ctx. - WithConsensusParams(app.GetConsensusParams(app.processProposalState.ctx)). - WithBlockGasMeter(app.getBlockGasMeter(app.processProposalState.ctx)) + app.processProposalState.SetContext(app.processProposalState.Context(). + WithConsensusParams(app.GetConsensusParams(app.processProposalState.Context())). + WithBlockGasMeter(app.getBlockGasMeter(app.processProposalState.Context()))) defer func() { if err := recover(); err != nil { @@ -505,12 +521,25 @@ func (app *BaseApp) ProcessProposal(req *abci.RequestProcessProposal) (resp *abc } }() - resp, err = app.processProposal(app.processProposalState.ctx, req) + resp, err = app.processProposal(app.processProposalState.Context(), req) if err != nil { - app.logger.Error("failed to process proposal", "height", req.Height, "error", err) + app.logger.Error("failed to process proposal", "height", req.Height, "time", req.Time, "hash", fmt.Sprintf("%X", req.Hash), "err", err) return &abci.ResponseProcessProposal{Status: abci.ResponseProcessProposal_REJECT}, nil } + // Only execute optimistic execution if the proposal is accepted, OE is + // enabled and the block height is greater than the initial height. During + // the first block we'll be carrying state from InitChain, so it would be + // impossible for us to easily revert. + // After the first block has been processed, the next blocks will get executed + // optimistically, so that when the ABCI client calls `FinalizeBlock` the app + // can have a response ready. + if resp.Status == abci.ResponseProcessProposal_ACCEPT && + app.optimisticExec.Enabled() && + req.Height > app.initialHeight { + app.optimisticExec.Execute(req) + } + return resp, nil } @@ -526,8 +555,18 @@ func (app *BaseApp) ProcessProposal(req *abci.RequestProcessProposal) (resp *abc func (app *BaseApp) ExtendVote(_ context.Context, req *abci.RequestExtendVote) (resp *abci.ResponseExtendVote, err error) { // Always reset state given that ExtendVote and VerifyVoteExtension can timeout // and be called again in a subsequent round. - emptyHeader := cmtproto.Header{ChainID: app.chainID, Height: req.Height} - app.setState(execModeVoteExtension, emptyHeader) + var ctx sdk.Context + + // If we're extending the vote for the initial height, we need to use the + // finalizeBlockState context, otherwise we don't get the uncommitted data + // from InitChain. + if req.Height == app.initialHeight { + ctx, _ = app.finalizeBlockState.Context().CacheContext() + } else { + emptyHeader := cmtproto.Header{ChainID: app.chainID, Height: req.Height} + ms := app.cms.CacheMultiStore() + ctx = sdk.NewContext(ms, emptyHeader, false, app.logger).WithStreamingManager(app.streamingManager) + } if app.extendVote == nil { return nil, errors.New("application ExtendVote handler not set") @@ -535,17 +574,28 @@ func (app *BaseApp) ExtendVote(_ context.Context, req *abci.RequestExtendVote) ( // If vote extensions are not enabled, as a safety precaution, we return an // error. - cp := app.GetConsensusParams(app.voteExtensionState.ctx) - if cp.Abci != nil && cp.Abci.VoteExtensionsEnableHeight <= 0 { + cp := app.GetConsensusParams(ctx) + + // Note: In this case, we do want to extend vote if the height is equal or + // greater than VoteExtensionsEnableHeight. This defers from the check done + // in ValidateVoteExtensions and PrepareProposal in which we'll check for + // vote extensions on VoteExtensionsEnableHeight+1. + extsEnabled := cp.Abci != nil && req.Height >= cp.Abci.VoteExtensionsEnableHeight && cp.Abci.VoteExtensionsEnableHeight != 0 + if !extsEnabled { return nil, fmt.Errorf("vote extensions are not enabled; unexpected call to ExtendVote at height %d", req.Height) } - app.voteExtensionState.ctx = app.voteExtensionState.ctx. + ctx = ctx. WithConsensusParams(cp). WithBlockGasMeter(storetypes.NewInfiniteGasMeter()). WithBlockHeight(req.Height). WithHeaderHash(req.Hash). - WithExecMode(sdk.ExecModeVoteExtension) + WithExecMode(sdk.ExecModeVoteExtension). + WithHeaderInfo(coreheader.Info{ + ChainID: app.chainID, + Height: req.Height, + Hash: req.Hash, + }) // add a deferred recover handler in case extendVote panics defer func() { @@ -560,9 +610,9 @@ func (app *BaseApp) ExtendVote(_ context.Context, req *abci.RequestExtendVote) ( } }() - resp, err = app.extendVote(app.voteExtensionState.ctx, req) + resp, err = app.extendVote(ctx, req) if err != nil { - app.logger.Error("failed to extend vote", "height", req.Height, "error", err) + app.logger.Error("failed to extend vote", "height", req.Height, "hash", fmt.Sprintf("%X", req.Hash), "err", err) return &abci.ResponseExtendVote{VoteExtension: []byte{}}, nil } @@ -580,10 +630,27 @@ func (app *BaseApp) VerifyVoteExtension(req *abci.RequestVerifyVoteExtension) (r return nil, errors.New("application VerifyVoteExtension handler not set") } + var ctx sdk.Context + + // If we're verifying the vote for the initial height, we need to use the + // finalizeBlockState context, otherwise we don't get the uncommitted data + // from InitChain. + if req.Height == app.initialHeight { + ctx, _ = app.finalizeBlockState.Context().CacheContext() + } else { + emptyHeader := cmtproto.Header{ChainID: app.chainID, Height: req.Height} + ms := app.cms.CacheMultiStore() + ctx = sdk.NewContext(ms, emptyHeader, false, app.logger).WithStreamingManager(app.streamingManager) + } + // If vote extensions are not enabled, as a safety precaution, we return an // error. - cp := app.GetConsensusParams(app.voteExtensionState.ctx) - if cp.Abci != nil && cp.Abci.VoteExtensionsEnableHeight <= 0 { + cp := app.GetConsensusParams(ctx) + + // Note: we verify votes extensions on VoteExtensionsEnableHeight+1. Check + // comment in ExtendVote and ValidateVoteExtensions for more details. + extsEnabled := cp.Abci != nil && req.Height >= cp.Abci.VoteExtensionsEnableHeight && cp.Abci.VoteExtensionsEnableHeight != 0 + if !extsEnabled { return nil, fmt.Errorf("vote extensions are not enabled; unexpected call to VerifyVoteExtension at height %d", req.Height) } @@ -601,28 +668,38 @@ func (app *BaseApp) VerifyVoteExtension(req *abci.RequestVerifyVoteExtension) (r } }() - resp, err = app.verifyVoteExt(app.voteExtensionState.ctx, req) + ctx = ctx. + WithConsensusParams(cp). + WithBlockGasMeter(storetypes.NewInfiniteGasMeter()). + WithBlockHeight(req.Height). + WithHeaderHash(req.Hash). + WithExecMode(sdk.ExecModeVerifyVoteExtension). + WithHeaderInfo(coreheader.Info{ + ChainID: app.chainID, + Height: req.Height, + Hash: req.Hash, + }) + + resp, err = app.verifyVoteExt(ctx, req) if err != nil { - app.logger.Error("failed to verify vote extension", "height", req.Height, "error", err) + app.logger.Error("failed to verify vote extension", "height", req.Height, "err", err) return &abci.ResponseVerifyVoteExtension{Status: abci.ResponseVerifyVoteExtension_REJECT}, nil } return resp, err } -// FinalizeBlock will execute the block proposal provided by RequestFinalizeBlock. -// Specifically, it will execute an application's BeginBlock (if defined), followed -// by the transactions in the proposal, finally followed by the application's -// EndBlock (if defined). -// -// For each raw transaction, i.e. a byte slice, BaseApp will only execute it if -// it adheres to the sdk.Tx interface. Otherwise, the raw transaction will be -// skipped. This is to support compatibility with proposers injecting vote -// extensions into the proposal, which should not themselves be executed in cases -// where they adhere to the sdk.Tx interface. -func (app *BaseApp) FinalizeBlock(req *abci.RequestFinalizeBlock) (*abci.ResponseFinalizeBlock, error) { +// internalFinalizeBlock executes the block, called by the Optimistic +// Execution flow or by the FinalizeBlock ABCI method. The context received is +// only used to handle early cancellation, for anything related to state app.finalizeBlockState.Context() +// must be used. +func (app *BaseApp) internalFinalizeBlock(ctx context.Context, req *abci.RequestFinalizeBlock) (*abci.ResponseFinalizeBlock, error) { var events []abci.Event + if err := app.checkHalt(req.Height, req.Time); err != nil { + return nil, err + } + if err := app.validateFinalizeBlockHeight(req); err != nil { return nil, err } @@ -639,39 +716,74 @@ func (app *BaseApp) FinalizeBlock(req *abci.RequestFinalizeBlock) (*abci.Respons Time: req.Time, ProposerAddress: req.ProposerAddress, NextValidatorsHash: req.NextValidatorsHash, + AppHash: app.LastCommitID().Hash, } - // Initialize the FinalizeBlock state. If this is the first block, it should - // already be initialized in InitChain. Otherwise app.finalizeBlockState will be - // nil, since it is reset on Commit. + // finalizeBlockState should be set on InitChain or ProcessProposal. If it is + // nil, it means we are replaying this block and we need to set the state here + // given that during block replay ProcessProposal is not executed by CometBFT. if app.finalizeBlockState == nil { app.setState(execModeFinalize, header) - } else { - // In the first block, app.finalizeBlockState.ctx will already be initialized - // by InitChain. Context is now updated with Header information. - app.finalizeBlockState.ctx = app.finalizeBlockState.ctx. - WithBlockHeader(header). - WithBlockHeight(req.Height) } - gasMeter := app.getBlockGasMeter(app.finalizeBlockState.ctx) - - app.finalizeBlockState.ctx = app.finalizeBlockState.ctx. - WithBlockGasMeter(gasMeter). + // Context is now updated with Header information. + app.finalizeBlockState.SetContext(app.finalizeBlockState.Context(). + WithBlockHeader(header). WithHeaderHash(req.Hash). - WithConsensusParams(app.GetConsensusParams(app.finalizeBlockState.ctx)). + WithHeaderInfo(coreheader.Info{ + ChainID: app.chainID, + Height: req.Height, + Time: req.Time, + Hash: req.Hash, + AppHash: app.LastCommitID().Hash, + }). + WithConsensusParams(app.GetConsensusParams(app.finalizeBlockState.Context())). WithVoteInfos(req.DecidedLastCommit.Votes). - WithExecMode(sdk.ExecModeFinalize) + WithExecMode(sdk.ExecModeFinalize). + WithCometInfo(cometInfo{ + Misbehavior: req.Misbehavior, + ValidatorsHash: req.NextValidatorsHash, + ProposerAddress: req.ProposerAddress, + LastCommit: req.DecidedLastCommit, + })) + + // GasMeter must be set after we get a context with updated consensus params. + gasMeter := app.getBlockGasMeter(app.finalizeBlockState.Context()) + app.finalizeBlockState.SetContext(app.finalizeBlockState.Context().WithBlockGasMeter(gasMeter)) if app.checkState != nil { - app.checkState.ctx = app.checkState.ctx. + app.checkState.SetContext(app.checkState.Context(). WithBlockGasMeter(gasMeter). - WithHeaderHash(req.Hash) + WithHeaderHash(req.Hash)) + } + + preblockEvents, err := app.preBlock(req) + if err != nil { + return nil, err + } + + events = append(events, preblockEvents...) + + beginBlock, err := app.beginBlock(req) + if err != nil { + return nil, err + } + + // First check for an abort signal after beginBlock, as it's the first place + // we spend any significant amount of time. + select { + case <-ctx.Done(): + return nil, ctx.Err() + default: + // continue } - beginBlock := app.beginBlock(req) events = append(events, beginBlock.Events...) + // Reset the gas meter so that the AnteHandlers aren't required to + gasMeter = app.getBlockGasMeter(app.finalizeBlockState.Context()) + app.finalizeBlockState.SetContext(app.finalizeBlockState.Context().WithBlockGasMeter(gasMeter)) + // Iterate over all raw transactions in the proposal and attempt to execute // them, gathering the execution results. // @@ -679,32 +791,132 @@ func (app *BaseApp) FinalizeBlock(req *abci.RequestFinalizeBlock) (*abci.Respons // vote extensions, so skip those. txResults := make([]*abci.ExecTxResult, 0, len(req.Txs)) for _, rawTx := range req.Txs { + var response *abci.ExecTxResult + if _, err := app.txDecoder(rawTx); err == nil { - txResults = append(txResults, app.deliverTx(rawTx)) + response = app.deliverTx(rawTx) + } else { + // In the case where a transaction included in a block proposal is malformed, + // we still want to return a default response to comet. This is because comet + // expects a response for each transaction included in a block proposal. + response = sdkerrors.ResponseExecTxResultWithEvents( + sdkerrors.ErrTxDecode, + 0, + 0, + nil, + false, + ) } + + // check after every tx if we should abort + select { + case <-ctx.Done(): + return nil, ctx.Err() + default: + // continue + } + + txResults = append(txResults, response) } if app.finalizeBlockState.ms.TracingEnabled() { app.finalizeBlockState.ms = app.finalizeBlockState.ms.SetTracingContext(nil).(storetypes.CacheMultiStore) } - endBlock, err := app.endBlock(app.finalizeBlockState.ctx) + endBlock, err := app.endBlock(app.finalizeBlockState.Context()) if err != nil { return nil, err } + // check after endBlock if we should abort, to avoid propagating the result + select { + case <-ctx.Done(): + return nil, ctx.Err() + default: + // continue + } + events = append(events, endBlock.Events...) - cp := app.GetConsensusParams(app.finalizeBlockState.ctx) + cp := app.GetConsensusParams(app.finalizeBlockState.Context()) return &abci.ResponseFinalizeBlock{ Events: events, TxResults: txResults, ValidatorUpdates: endBlock.ValidatorUpdates, ConsensusParamUpdates: &cp, - AppHash: app.workingHash(), }, nil } +// FinalizeBlock will execute the block proposal provided by RequestFinalizeBlock. +// Specifically, it will execute an application's BeginBlock (if defined), followed +// by the transactions in the proposal, finally followed by the application's +// EndBlock (if defined). +// +// For each raw transaction, i.e. a byte slice, BaseApp will only execute it if +// it adheres to the sdk.Tx interface. Otherwise, the raw transaction will be +// skipped. This is to support compatibility with proposers injecting vote +// extensions into the proposal, which should not themselves be executed in cases +// where they adhere to the sdk.Tx interface. +func (app *BaseApp) FinalizeBlock(req *abci.RequestFinalizeBlock) (res *abci.ResponseFinalizeBlock, err error) { + defer func() { + if res == nil { + return + } + // call the streaming service hooks with the FinalizeBlock messages + for _, streamingListener := range app.streamingManager.ABCIListeners { + if err := streamingListener.ListenFinalizeBlock(app.finalizeBlockState.Context(), *req, *res); err != nil { + app.logger.Error("ListenFinalizeBlock listening hook failed", "height", req.Height, "err", err) + } + } + }() + + if app.optimisticExec.Initialized() { + // check if the hash we got is the same as the one we are executing + aborted := app.optimisticExec.AbortIfNeeded(req.Hash) + // Wait for the OE to finish, regardless of whether it was aborted or not + res, err = app.optimisticExec.WaitResult() + + // only return if we are not aborting + if !aborted { + if res != nil { + res.AppHash = app.workingHash() + } + + return res, err + } + + // if it was aborted, we need to reset the state + app.finalizeBlockState = nil + app.optimisticExec.Reset() + } + + // if no OE is running, just run the block (this is either a block replay or a OE that got aborted) + res, err = app.internalFinalizeBlock(context.Background(), req) + if res != nil { + res.AppHash = app.workingHash() + } + + return res, err +} + +// checkHalt checkes if height or time exceeds halt-height or halt-time respectively. +func (app *BaseApp) checkHalt(height int64, time time.Time) error { + var halt bool + switch { + case app.haltHeight > 0 && uint64(height) >= app.haltHeight: + halt = true + + case app.haltTime > 0 && time.Unix() >= int64(app.haltTime): + halt = true + } + + if halt { + return fmt.Errorf("halt per configuration height %d time %d", app.haltHeight, app.haltTime) + } + + return nil +} + // Commit implements the ABCI interface. It will commit all state that exists in // the deliver state's multi-store and includes the resulting commit ID in the // returned abci.ResponseCommit. Commit will set the check state based on the @@ -713,11 +925,11 @@ func (app *BaseApp) FinalizeBlock(req *abci.RequestFinalizeBlock) (*abci.Respons // against that height and gracefully halt if it matches the latest committed // height. func (app *BaseApp) Commit() (*abci.ResponseCommit, error) { - header := app.finalizeBlockState.ctx.BlockHeader() + header := app.finalizeBlockState.Context().BlockHeader() retainHeight := app.GetBlockRetentionHeight(header.Height) if app.precommiter != nil { - app.precommiter(app.finalizeBlockState.ctx) + app.precommiter(app.finalizeBlockState.Context()) } rms, ok := app.cms.(*rootmulti.Store) @@ -733,7 +945,7 @@ func (app *BaseApp) Commit() (*abci.ResponseCommit, error) { abciListeners := app.streamingManager.ABCIListeners if len(abciListeners) > 0 { - ctx := app.finalizeBlockState.ctx + ctx := app.finalizeBlockState.Context() blockHeight := ctx.BlockHeight() changeSet := app.cms.PopStateCache() @@ -753,27 +965,11 @@ func (app *BaseApp) Commit() (*abci.ResponseCommit, error) { app.finalizeBlockState = nil if app.prepareCheckStater != nil { - app.prepareCheckStater(app.checkState.ctx) + app.prepareCheckStater(app.checkState.Context()) } - var halt bool - switch { - case app.haltHeight > 0 && uint64(header.Height) >= app.haltHeight: - halt = true - - case app.haltTime > 0 && header.Time.Unix() >= int64(app.haltTime): - halt = true - } - - if halt { - // Halt the binary and allow CometBFT to receive the ResponseCommit - // response with the commit ID hash. This will allow the node to successfully - // restart and process blocks assuming the halt configuration has been - // reset or moved to a more distant value. - app.halt() - } - - go app.snapshotManager.SnapshotIfApplicable(header.Height) + // The SnapshotIfApplicable method will create the snapshot by starting the goroutine + app.snapshotManager.SnapshotIfApplicable(header.Height) return resp, nil } @@ -796,28 +992,6 @@ func (app *BaseApp) workingHash() []byte { return commitHash } -// halt attempts to gracefully shutdown the node via SIGINT and SIGTERM falling -// back on os.Exit if both fail. -func (app *BaseApp) halt() { - app.logger.Info("halting node per configuration", "height", app.haltHeight, "time", app.haltTime) - - p, err := os.FindProcess(os.Getpid()) - if err == nil { - // attempt cascading signals in case SIGINT fails (os dependent) - sigIntErr := p.Signal(syscall.SIGINT) - sigTermErr := p.Signal(syscall.SIGTERM) - - if sigIntErr == nil || sigTermErr == nil { - return - } - } - - // Resort to exiting immediately if the process could not be found or killed - // via SIGINT/SIGTERM signals. - app.logger.Info("failed to send SIGINT/SIGTERM; exiting...") - os.Exit(0) -} - func handleQueryApp(app *BaseApp, path []string, req *abci.RequestQuery) *abci.ResponseQuery { if len(path) >= 2 { switch path[1] { @@ -956,10 +1130,10 @@ func (app *BaseApp) FilterPeerByID(info string) *abci.ResponseQuery { // access any state changes made in InitChain. func (app *BaseApp) getContextForProposal(ctx sdk.Context, height int64) sdk.Context { if height == app.initialHeight { - ctx, _ = app.finalizeBlockState.ctx.CacheContext() + ctx, _ = app.finalizeBlockState.Context().CacheContext() // clear all context data set during InitChain to avoid inconsistent behavior - ctx = ctx.WithBlockHeader(cmtproto.Header{}) + ctx = ctx.WithBlockHeader(cmtproto.Header{}).WithHeaderInfo(coreheader.Info{}) return ctx } @@ -1063,8 +1237,11 @@ func (app *BaseApp) CreateQueryContext(height int64, prove bool) (sdk.Context, e } // branch the commit multi-store for safety - ctx := sdk.NewContext(cacheMS, app.checkState.ctx.BlockHeader(), true, app.logger). + header := app.checkState.Context().BlockHeader() + ctx := sdk.NewContext(cacheMS, header, true, app.logger). WithMinGasPrices(app.minGasPrices). + WithGasMeter(storetypes.NewGasMeter(app.queryGasLimit)). + WithBlockHeader(header). WithBlockHeight(height) if height != lastBlockHeight { @@ -1133,7 +1310,7 @@ func (app *BaseApp) GetBlockRetentionHeight(commitHeight int64) int64 { // evidence parameters instead of computing an estimated number of blocks based // on the unbonding period and block commitment time as the two should be // equivalent. - cp := app.GetConsensusParams(app.finalizeBlockState.ctx) + cp := app.GetConsensusParams(app.finalizeBlockState.Context()) if cp.Evidence != nil && cp.Evidence.MaxAgeNumBlocks > 0 { retentionHeight = commitHeight - cp.Evidence.MaxAgeNumBlocks } diff --git a/baseapp/abci_test.go b/baseapp/abci_test.go index 9d12ed1ac121..01959a24e78d 100644 --- a/baseapp/abci_test.go +++ b/baseapp/abci_test.go @@ -3,20 +3,33 @@ package baseapp_test import ( "bytes" "context" + "crypto/sha256" + "encoding/binary" + "encoding/hex" "errors" "fmt" + "math/rand" + "strconv" "strings" "testing" - - errorsmod "cosmossdk.io/errors" - "cosmossdk.io/log" + "time" abci "github.com/cometbft/cometbft/abci/types" + "github.com/cometbft/cometbft/crypto/secp256k1" + cmtprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" dbm "github.com/cosmos/cosmos-db" + protoio "github.com/cosmos/gogoproto/io" "github.com/cosmos/gogoproto/jsonpb" + "github.com/cosmos/gogoproto/proto" + gogotypes "github.com/cosmos/gogoproto/types" + any "github.com/cosmos/gogoproto/types/any" + "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" + errorsmod "cosmossdk.io/errors" + "cosmossdk.io/log" pruningtypes "cosmossdk.io/store/pruning/types" "cosmossdk.io/store/snapshots" snapshottypes "cosmossdk.io/store/snapshots/types" @@ -24,6 +37,9 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" baseapptestutil "github.com/cosmos/cosmos-sdk/baseapp/testutil" + "github.com/cosmos/cosmos-sdk/baseapp/testutil/mock" + "github.com/cosmos/cosmos-sdk/codec" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/cosmos/cosmos-sdk/testutil" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" @@ -32,6 +48,18 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/signing" ) +type mockABCIListener struct { + ListenCommitFn func(context.Context, abci.ResponseCommit, []*storetypes.StoreKVPair) error +} + +func (m mockABCIListener) ListenFinalizeBlock(_ context.Context, _ abci.RequestFinalizeBlock, _ abci.ResponseFinalizeBlock) error { + return nil +} + +func (m *mockABCIListener) ListenCommit(ctx context.Context, commit abci.ResponseCommit, pairs []*storetypes.StoreKVPair) error { + return m.ListenCommitFn(ctx, commit, pairs) +} + func TestABCI_Info(t *testing.T) { suite := NewBaseAppSuite(t) @@ -39,10 +67,12 @@ func TestABCI_Info(t *testing.T) { res, err := suite.baseApp.Info(&reqInfo) require.NoError(t, err) + emptyHash := sha256.Sum256([]byte{}) + appHash := emptyHash[:] require.Equal(t, "", res.Version) require.Equal(t, t.Name(), res.GetData()) require.Equal(t, int64(0), res.LastBlockHeight) - require.Equal(t, []uint8(nil), res.LastBlockAppHash) + require.Equal(t, appHash, res.LastBlockAppHash) require.Equal(t, suite.baseApp.AppVersion(), res.AppVersion) } @@ -50,12 +80,14 @@ func TestABCI_First_block_Height(t *testing.T) { suite := NewBaseAppSuite(t, baseapp.SetChainID("test-chain-id")) app := suite.baseApp - app.InitChain(&abci.RequestInitChain{ + _, err := app.InitChain(&abci.RequestInitChain{ ChainId: "test-chain-id", ConsensusParams: &cmtproto.ConsensusParams{Block: &cmtproto.BlockParams{MaxGas: 5000000}}, InitialHeight: 1, }) - app.Commit() + require.NoError(t, err) + _, err = app.Commit() + require.NoError(t, err) ctx := app.GetContextForCheckTx(nil) require.Equal(t, int64(1), ctx.BlockHeight()) @@ -84,8 +116,8 @@ func TestABCI_InitChain(t *testing.T) { Data: key, } + // initChain is nil and chain ID is wrong - errors _, err := app.InitChain(&abci.RequestInitChain{ChainId: "wrong-chain-id"}) - // initChain is nil and chain ID is wrong - panics require.Error(t, err) // initChain is nil - nothing happens @@ -109,11 +141,11 @@ func TestABCI_InitChain(t *testing.T) { // The AppHash returned by a new chain is the sha256 hash of "". // $ echo -n '' | sha256sum // e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - require.Equal( - t, - []byte{0xe3, 0xb0, 0xc4, 0x42, 0x98, 0xfc, 0x1c, 0x14, 0x9a, 0xfb, 0xf4, 0xc8, 0x99, 0x6f, 0xb9, 0x24, 0x27, 0xae, 0x41, 0xe4, 0x64, 0x9b, 0x93, 0x4c, 0xa4, 0x95, 0x99, 0x1b, 0x78, 0x52, 0xb8, 0x55}, - initChainRes.AppHash, - ) + emptyHash := sha256.Sum256([]byte{}) + appHash := emptyHash[:] + require.NoError(t, err) + + require.Equal(t, appHash, initChainRes.AppHash) // assert that chainID is set correctly in InitChain chainID := getFinalizeBlockStateCtx(app).ChainID() @@ -122,12 +154,15 @@ func TestABCI_InitChain(t *testing.T) { chainID = getCheckStateCtx(app).ChainID() require.Equal(t, "test-chain-id", chainID, "ChainID in checkState not set correctly in InitChain") - app.FinalizeBlock(&abci.RequestFinalizeBlock{ + _, err = app.FinalizeBlock(&abci.RequestFinalizeBlock{ Hash: initChainRes.AppHash, Height: 1, }) + require.NoError(t, err) + + _, err = app.Commit() + require.NoError(t, err) - app.Commit() resQ, err = app.Query(context.TODO(), &query) require.NoError(t, err) require.Equal(t, int64(1), app.LastBlockHeight()) @@ -147,8 +182,10 @@ func TestABCI_InitChain(t *testing.T) { require.Equal(t, value, resQ.Value) // commit and ensure we can still query - app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: app.LastBlockHeight() + 1}) - app.Commit() + _, err = app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: app.LastBlockHeight() + 1}) + require.NoError(t, err) + _, err = app.Commit() + require.NoError(t, err) resQ, err = app.Query(context.TODO(), &query) require.NoError(t, err) @@ -160,12 +197,14 @@ func TestABCI_InitChain_WithInitialHeight(t *testing.T) { db := dbm.NewMemDB() app := baseapp.NewBaseApp(name, log.NewTestLogger(t), db, nil) - app.InitChain( + _, err := app.InitChain( &abci.RequestInitChain{ InitialHeight: 3, }, ) - app.Commit() + require.NoError(t, err) + _, err = app.Commit() + require.NoError(t, err) require.Equal(t, int64(3), app.LastBlockHeight()) } @@ -175,21 +214,229 @@ func TestABCI_FinalizeBlock_WithInitialHeight(t *testing.T) { db := dbm.NewMemDB() app := baseapp.NewBaseApp(name, log.NewTestLogger(t), db, nil) - app.InitChain( + _, err := app.InitChain( &abci.RequestInitChain{ InitialHeight: 3, }, ) + require.NoError(t, err) - _, err := app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 4}) + _, err = app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 4}) require.Error(t, err, "invalid height: 4; expected: 3") - app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 3}) - app.Commit() + _, err = app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 3}) + require.NoError(t, err) + _, err = app.Commit() + require.NoError(t, err) require.Equal(t, int64(3), app.LastBlockHeight()) } +func TestABCI_FinalizeBlock_WithBeginAndEndBlocker(t *testing.T) { + name := t.Name() + db := dbm.NewMemDB() + app := baseapp.NewBaseApp(name, log.NewTestLogger(t), db, nil) + + app.SetBeginBlocker(func(ctx sdk.Context) (sdk.BeginBlock, error) { + return sdk.BeginBlock{ + Events: []abci.Event{ + { + Type: "sometype", + Attributes: []abci.EventAttribute{ + { + Key: "foo", + Value: "bar", + }, + }, + }, + }, + }, nil + }) + + app.SetEndBlocker(func(ctx sdk.Context) (sdk.EndBlock, error) { + return sdk.EndBlock{ + Events: []abci.Event{ + { + Type: "anothertype", + Attributes: []abci.EventAttribute{ + { + Key: "foo", + Value: "bar", + }, + }, + }, + }, + }, nil + }) + + _, err := app.InitChain( + &abci.RequestInitChain{ + InitialHeight: 1, + }, + ) + require.NoError(t, err) + + res, err := app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 1}) + require.NoError(t, err) + + require.Len(t, res.Events, 2) + + require.Equal(t, "sometype", res.Events[0].Type) + require.Equal(t, "foo", res.Events[0].Attributes[0].Key) + require.Equal(t, "bar", res.Events[0].Attributes[0].Value) + require.Equal(t, "mode", res.Events[0].Attributes[1].Key) + require.Equal(t, "BeginBlock", res.Events[0].Attributes[1].Value) + + require.Equal(t, "anothertype", res.Events[1].Type) + require.Equal(t, "foo", res.Events[1].Attributes[0].Key) + require.Equal(t, "bar", res.Events[1].Attributes[0].Value) + require.Equal(t, "mode", res.Events[1].Attributes[1].Key) + require.Equal(t, "EndBlock", res.Events[1].Attributes[1].Value) + + _, err = app.Commit() + require.NoError(t, err) + + require.Equal(t, int64(1), app.LastBlockHeight()) +} + +func TestABCI_ExtendVote(t *testing.T) { + name := t.Name() + db := dbm.NewMemDB() + app := baseapp.NewBaseApp(name, log.NewTestLogger(t), db, nil) + + app.SetExtendVoteHandler(func(ctx sdk.Context, req *abci.RequestExtendVote) (*abci.ResponseExtendVote, error) { + voteExt := "foo" + hex.EncodeToString(req.Hash) + strconv.FormatInt(req.Height, 10) + return &abci.ResponseExtendVote{VoteExtension: []byte(voteExt)}, nil + }) + + app.SetVerifyVoteExtensionHandler(func(ctx sdk.Context, req *abci.RequestVerifyVoteExtension) (*abci.ResponseVerifyVoteExtension, error) { + // do some kind of verification here + expectedVoteExt := "foo" + hex.EncodeToString(req.Hash) + strconv.FormatInt(req.Height, 10) + if !bytes.Equal(req.VoteExtension, []byte(expectedVoteExt)) { + return &abci.ResponseVerifyVoteExtension{Status: abci.ResponseVerifyVoteExtension_REJECT}, nil + } + + return &abci.ResponseVerifyVoteExtension{Status: abci.ResponseVerifyVoteExtension_ACCEPT}, nil + }) + + app.SetParamStore(¶mStore{db: dbm.NewMemDB()}) + _, err := app.InitChain( + &abci.RequestInitChain{ + InitialHeight: 1, + ConsensusParams: &cmtproto.ConsensusParams{ + Abci: &cmtproto.ABCIParams{ + VoteExtensionsEnableHeight: 200, + }, + }, + }, + ) + require.NoError(t, err) + + // Votes not enabled yet + _, err = app.ExtendVote(context.Background(), &abci.RequestExtendVote{Height: 123, Hash: []byte("thehash")}) + require.ErrorContains(t, err, "vote extensions are not enabled") + + // First vote on the first enabled height + res, err := app.ExtendVote(context.Background(), &abci.RequestExtendVote{Height: 200, Hash: []byte("thehash")}) + require.NoError(t, err) + require.Len(t, res.VoteExtension, 20) + + res, err = app.ExtendVote(context.Background(), &abci.RequestExtendVote{Height: 1000, Hash: []byte("thehash")}) + require.NoError(t, err) + require.Len(t, res.VoteExtension, 21) + + // Error during vote extension should return an empty vote extension and no error + app.SetExtendVoteHandler(func(ctx sdk.Context, req *abci.RequestExtendVote) (*abci.ResponseExtendVote, error) { + return nil, errors.New("some error") + }) + res, err = app.ExtendVote(context.Background(), &abci.RequestExtendVote{Height: 1000, Hash: []byte("thehash")}) + require.NoError(t, err) + require.Len(t, res.VoteExtension, 0) + + // Verify Vote Extensions + _, err = app.VerifyVoteExtension(&abci.RequestVerifyVoteExtension{Height: 123, VoteExtension: []byte("1234567")}) + require.ErrorContains(t, err, "vote extensions are not enabled") + + // First vote on the first enabled height + vres, err := app.VerifyVoteExtension(&abci.RequestVerifyVoteExtension{Height: 200, Hash: []byte("thehash"), VoteExtension: []byte("foo74686568617368200")}) + require.NoError(t, err) + require.Equal(t, abci.ResponseVerifyVoteExtension_ACCEPT, vres.Status) + + vres, err = app.VerifyVoteExtension(&abci.RequestVerifyVoteExtension{Height: 1000, Hash: []byte("thehash"), VoteExtension: []byte("foo746865686173681000")}) + require.NoError(t, err) + require.Equal(t, abci.ResponseVerifyVoteExtension_ACCEPT, vres.Status) + + // Reject because it's just some random bytes + vres, err = app.VerifyVoteExtension(&abci.RequestVerifyVoteExtension{Height: 201, Hash: []byte("thehash"), VoteExtension: []byte("12345678")}) + require.NoError(t, err) + require.Equal(t, abci.ResponseVerifyVoteExtension_REJECT, vres.Status) + + // Reject because the verification failed (no error) + app.SetVerifyVoteExtensionHandler(func(ctx sdk.Context, req *abci.RequestVerifyVoteExtension) (*abci.ResponseVerifyVoteExtension, error) { + return nil, errors.New("some error") + }) + vres, err = app.VerifyVoteExtension(&abci.RequestVerifyVoteExtension{Height: 201, Hash: []byte("thehash"), VoteExtension: []byte("12345678")}) + require.NoError(t, err) + require.Equal(t, abci.ResponseVerifyVoteExtension_REJECT, vres.Status) +} + +// TestABCI_OnlyVerifyVoteExtension makes sure we can call VerifyVoteExtension +// without having called ExtendVote before. +func TestABCI_OnlyVerifyVoteExtension(t *testing.T) { + name := t.Name() + db := dbm.NewMemDB() + app := baseapp.NewBaseApp(name, log.NewTestLogger(t), db, nil) + + app.SetVerifyVoteExtensionHandler(func(ctx sdk.Context, req *abci.RequestVerifyVoteExtension) (*abci.ResponseVerifyVoteExtension, error) { + // do some kind of verification here + expectedVoteExt := "foo" + hex.EncodeToString(req.Hash) + strconv.FormatInt(req.Height, 10) + if !bytes.Equal(req.VoteExtension, []byte(expectedVoteExt)) { + return &abci.ResponseVerifyVoteExtension{Status: abci.ResponseVerifyVoteExtension_REJECT}, nil + } + + return &abci.ResponseVerifyVoteExtension{Status: abci.ResponseVerifyVoteExtension_ACCEPT}, nil + }) + + app.SetParamStore(¶mStore{db: dbm.NewMemDB()}) + _, err := app.InitChain( + &abci.RequestInitChain{ + InitialHeight: 1, + ConsensusParams: &cmtproto.ConsensusParams{ + Abci: &cmtproto.ABCIParams{ + VoteExtensionsEnableHeight: 200, + }, + }, + }, + ) + require.NoError(t, err) + + // Verify Vote Extensions + _, err = app.VerifyVoteExtension(&abci.RequestVerifyVoteExtension{Height: 123, VoteExtension: []byte("1234567")}) + require.ErrorContains(t, err, "vote extensions are not enabled") + + // First vote on the first enabled height + vres, err := app.VerifyVoteExtension(&abci.RequestVerifyVoteExtension{Height: 200, Hash: []byte("thehash"), VoteExtension: []byte("foo74686568617368200")}) + require.NoError(t, err) + require.Equal(t, abci.ResponseVerifyVoteExtension_ACCEPT, vres.Status) + + vres, err = app.VerifyVoteExtension(&abci.RequestVerifyVoteExtension{Height: 1000, Hash: []byte("thehash"), VoteExtension: []byte("foo746865686173681000")}) + require.NoError(t, err) + require.Equal(t, abci.ResponseVerifyVoteExtension_ACCEPT, vres.Status) + + // Reject because it's just some random bytes + vres, err = app.VerifyVoteExtension(&abci.RequestVerifyVoteExtension{Height: 201, Hash: []byte("thehash"), VoteExtension: []byte("12345678")}) + require.NoError(t, err) + require.Equal(t, abci.ResponseVerifyVoteExtension_REJECT, vres.Status) + + // Reject because the verification failed (no error) + app.SetVerifyVoteExtensionHandler(func(ctx sdk.Context, req *abci.RequestVerifyVoteExtension) (*abci.ResponseVerifyVoteExtension, error) { + return nil, errors.New("some error") + }) + vres, err = app.VerifyVoteExtension(&abci.RequestVerifyVoteExtension{Height: 201, Hash: []byte("thehash"), VoteExtension: []byte("12345678")}) + require.NoError(t, err) + require.Equal(t, abci.ResponseVerifyVoteExtension_REJECT, vres.Status) +} + func TestABCI_GRPCQuery(t *testing.T) { grpcQueryOpt := func(bapp *baseapp.BaseApp) { testdata.RegisterQueryServer( @@ -200,9 +447,10 @@ func TestABCI_GRPCQuery(t *testing.T) { suite := NewBaseAppSuite(t, grpcQueryOpt) - suite.baseApp.InitChain(&abci.RequestInitChain{ + _, err := suite.baseApp.InitChain(&abci.RequestInitChain{ ConsensusParams: &cmtproto.ConsensusParams{}, }) + require.NoError(t, err) req := testdata.SayHelloRequest{Name: "foo"} reqBz, err := req.Marshal() @@ -216,8 +464,10 @@ func TestABCI_GRPCQuery(t *testing.T) { require.Equal(t, sdkerrors.ErrInvalidHeight.ABCICode(), resQuery.Code, resQuery) require.Contains(t, resQuery.Log, "TestABCI_GRPCQuery is not ready; please wait for first block") - suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: suite.baseApp.LastBlockHeight() + 1}) - suite.baseApp.Commit() + _, err = suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: suite.baseApp.LastBlockHeight() + 1}) + require.NoError(t, err) + _, err = suite.baseApp.Commit() + require.NoError(t, err) reqQuery := abci.RequestQuery{ Data: reqBz, @@ -278,9 +528,10 @@ func TestBaseApp_PrepareCheckState(t *testing.T) { app := baseapp.NewBaseApp(name, logger, db, nil) app.SetParamStore(¶mStore{db: dbm.NewMemDB()}) - app.InitChain(&abci.RequestInitChain{ + _, err := app.InitChain(&abci.RequestInitChain{ ConsensusParams: cp, }) + require.NoError(t, err) wasPrepareCheckStateCalled := false app.SetPrepareCheckStater(func(ctx sdk.Context) { @@ -288,7 +539,8 @@ func TestBaseApp_PrepareCheckState(t *testing.T) { }) app.Seal() - app.Commit() + _, err = app.Commit() + require.NoError(t, err) require.Equal(t, true, wasPrepareCheckStateCalled) } @@ -305,9 +557,10 @@ func TestBaseApp_Precommit(t *testing.T) { app := baseapp.NewBaseApp(name, logger, db, nil) app.SetParamStore(¶mStore{db: dbm.NewMemDB()}) - app.InitChain(&abci.RequestInitChain{ + _, err := app.InitChain(&abci.RequestInitChain{ ConsensusParams: cp, }) + require.NoError(t, err) wasPrecommiterCalled := false app.SetPrecommiter(func(ctx sdk.Context) { @@ -315,7 +568,8 @@ func TestBaseApp_Precommit(t *testing.T) { }) app.Seal() - app.Commit() + _, err = app.Commit() + require.NoError(t, err) require.Equal(t, true, wasPrecommiterCalled) } @@ -330,9 +584,10 @@ func TestABCI_CheckTx(t *testing.T) { baseapptestutil.RegisterCounterServer(suite.baseApp.MsgServiceRouter(), CounterServerImpl{t, capKey1, counterKey}) nTxs := int64(5) - suite.baseApp.InitChain(&abci.RequestInitChain{ + _, err := suite.baseApp.InitChain(&abci.RequestInitChain{ ConsensusParams: &cmtproto.ConsensusParams{}, }) + require.NoError(t, err) for i := int64(0); i < nTxs; i++ { tx := newTxCounter(t, suite.txConfig, i, 0) // no messages @@ -352,7 +607,7 @@ func TestABCI_CheckTx(t *testing.T) { require.Equal(t, nTxs, storedCounter) // if a block is committed, CheckTx state should be reset - _, err := suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{ + _, err = suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{ Height: 1, Hash: []byte("hash"), }) @@ -361,7 +616,8 @@ func TestABCI_CheckTx(t *testing.T) { require.NotNil(t, getCheckStateCtx(suite.baseApp).BlockGasMeter(), "block gas meter should have been set to checkState") require.NotEmpty(t, getCheckStateCtx(suite.baseApp).HeaderHash()) - suite.baseApp.Commit() + _, err = suite.baseApp.Commit() + require.NoError(t, err) checkStateStore = getCheckStateCtx(suite.baseApp).KVStore(capKey1) storedBytes := checkStateStore.Get(counterKey) @@ -373,9 +629,10 @@ func TestABCI_FinalizeBlock_DeliverTx(t *testing.T) { anteOpt := func(bapp *baseapp.BaseApp) { bapp.SetAnteHandler(anteHandlerTxTest(t, capKey1, anteKey)) } suite := NewBaseAppSuite(t, anteOpt) - suite.baseApp.InitChain(&abci.RequestInitChain{ + _, err := suite.baseApp.InitChain(&abci.RequestInitChain{ ConsensusParams: &cmtproto.ConsensusParams{}, }) + require.NoError(t, err) deliverKey := []byte("deliver-key") baseapptestutil.RegisterCounterServer(suite.baseApp.MsgServiceRouter(), CounterServerImpl{t, capKey1, deliverKey}) @@ -412,7 +669,8 @@ func TestABCI_FinalizeBlock_DeliverTx(t *testing.T) { require.Equal(t, sdk.MarkEventsToIndex(counterEvent(sdk.EventTypeMessage, counter).ToABCIEvents(), map[string]struct{}{})[0].Attributes[0], events[2].Attributes[0], "msg handler update counter event") } - suite.baseApp.Commit() + _, err = suite.baseApp.Commit() + require.NoError(t, err) } } @@ -421,9 +679,10 @@ func TestABCI_FinalizeBlock_MultiMsg(t *testing.T) { anteOpt := func(bapp *baseapp.BaseApp) { bapp.SetAnteHandler(anteHandlerTxTest(t, capKey1, anteKey)) } suite := NewBaseAppSuite(t, anteOpt) - suite.baseApp.InitChain(&abci.RequestInitChain{ + _, err := suite.baseApp.InitChain(&abci.RequestInitChain{ ConsensusParams: &cmtproto.ConsensusParams{}, }) + require.NoError(t, err) deliverKey := []byte("deliver-key") baseapptestutil.RegisterCounterServer(suite.baseApp.MsgServiceRouter(), CounterServerImpl{t, capKey1, deliverKey}) @@ -437,10 +696,11 @@ func TestABCI_FinalizeBlock_MultiMsg(t *testing.T) { txBytes, err := suite.txConfig.TxEncoder()(tx) require.NoError(t, err) - suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{ + _, err = suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{ Height: 1, Txs: [][]byte{txBytes}, }) + require.NoError(t, err) store := getFinalizeBlockStateCtx(suite.baseApp).KVStore(capKey1) @@ -489,6 +749,240 @@ func TestABCI_FinalizeBlock_MultiMsg(t *testing.T) { require.Equal(t, int64(2), msgCounter2) } +func anyMessage(t *testing.T, cdc codec.Codec, msg *baseapptestutil.MsgSend) *any.Any { + t.Helper() + b, err := cdc.Marshal(msg) + require.NoError(t, err) + return &any.Any{ + TypeUrl: sdk.MsgTypeURL(msg), + Value: b, + } +} + +func TestABCI_Query_SimulateNestedMessagesTx(t *testing.T) { + anteOpt := func(bapp *baseapp.BaseApp) { + bapp.SetAnteHandler(func(ctx sdk.Context, tx sdk.Tx, simulate bool) (newCtx sdk.Context, err error) { + newCtx = ctx.WithGasMeter(storetypes.NewGasMeter(uint64(15))) + return + }) + } + suite := NewBaseAppSuite(t, anteOpt) + + _, err := suite.baseApp.InitChain(&abci.InitChainRequest{ + ConsensusParams: &cmtproto.ConsensusParams{}, + }) + require.NoError(t, err) + + baseapptestutil.RegisterNestedMessagesServer(suite.baseApp.MsgServiceRouter(), NestedMessgesServerImpl{}) + baseapptestutil.RegisterSendServer(suite.baseApp.MsgServiceRouter(), SendServerImpl{}) + + _, _, addr := testdata.KeyTestPubAddr() + _, _, toAddr := testdata.KeyTestPubAddr() + tests := []struct { + name string + message sdk.Msg + wantErr bool + }{ + { + name: "ok nested message", + message: &baseapptestutil.MsgSend{ + From: addr.String(), + To: toAddr.String(), + Amount: "10000stake", + }, + }, + { + name: "different signers", + message: &baseapptestutil.MsgSend{ + From: toAddr.String(), + To: addr.String(), + Amount: "10000stake", + }, + wantErr: true, + }, + { + name: "empty from", + message: &baseapptestutil.MsgSend{ + From: "", + To: toAddr.String(), + Amount: "10000stake", + }, + wantErr: true, + }, + { + name: "empty to", + message: &baseapptestutil.MsgSend{ + From: addr.String(), + To: "", + Amount: "10000stake", + }, + wantErr: true, + }, + { + name: "negative amount", + message: &baseapptestutil.MsgSend{ + From: addr.String(), + To: toAddr.String(), + Amount: "-10000stake", + }, + wantErr: true, + }, + { + name: "with nested messages", + message: &baseapptestutil.MsgNestedMessages{ + Signer: addr.String(), + Messages: []*any.Any{ + anyMessage(t, suite.cdc, &baseapptestutil.MsgSend{ + From: addr.String(), + To: toAddr.String(), + Amount: "10000stake", + }), + }, + }, + }, + { + name: "with invalid nested messages", + message: &baseapptestutil.MsgNestedMessages{ + Signer: addr.String(), + Messages: []*any.Any{ + anyMessage(t, suite.cdc, &baseapptestutil.MsgSend{ + From: "", + To: toAddr.String(), + Amount: "10000stake", + }), + }, + }, + wantErr: true, + }, + { + name: "with different signer ", + message: &baseapptestutil.MsgNestedMessages{ + Signer: addr.String(), + Messages: []*any.Any{ + anyMessage(t, suite.cdc, &baseapptestutil.MsgSend{ + From: toAddr.String(), + To: addr.String(), + Amount: "10000stake", + }), + }, + }, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + nestedMessages := make([]*any.Any, 1) + b, err := suite.cdc.Marshal(tt.message) + require.NoError(t, err) + nestedMessages[0] = &any.Any{ + TypeUrl: sdk.MsgTypeURL(tt.message), + Value: b, + } + + msg := &baseapptestutil.MsgNestedMessages{ + Messages: nestedMessages, + Signer: addr.String(), + } + + builder := suite.txConfig.NewTxBuilder() + err = builder.SetMsgs(msg) + require.NoError(t, err) + setTxSignature(t, builder, 0) + tx := builder.GetTx() + + txBytes, err := suite.txConfig.TxEncoder()(tx) + require.Nil(t, err) + + _, result, err := suite.baseApp.Simulate(txBytes) + if tt.wantErr { + require.Error(t, err) + require.Nil(t, result) + } else { + require.NoError(t, err) + require.NotNil(t, result) + } + }) + } +} + +func TestABCI_Query_SimulateNestedMessagesGas(t *testing.T) { + anteOpt := func(bapp *baseapp.BaseApp) { + bapp.SetAnteHandler(func(ctx sdk.Context, tx sdk.Tx, simulate bool) (newCtx sdk.Context, err error) { + newCtx = ctx.WithGasMeter(storetypes.NewGasMeter(uint64(10))) + return + }) + } + + _, _, addr := testdata.KeyTestPubAddr() + _, _, toAddr := testdata.KeyTestPubAddr() + + tests := []struct { + name string + suite *BaseAppSuite + message sdk.Msg + consumedGas uint64 + }{ + { + name: "don't add gas", + suite: NewBaseAppSuite(t, anteOpt), + message: &baseapptestutil.MsgSend{ + From: addr.String(), + To: toAddr.String(), + Amount: "10000stake", + }, + consumedGas: 5, + }, + { + name: "add gas", + suite: NewBaseAppSuite(t, anteOpt, baseapp.SetIncludeNestedMsgsGas([]sdk.Msg{&baseapptestutil.MsgNestedMessages{}})), + message: &baseapptestutil.MsgSend{ + From: addr.String(), + To: toAddr.String(), + Amount: "10000stake", + }, + consumedGas: 10, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + _, err := tt.suite.baseApp.InitChain(&abci.InitChainRequest{ + ConsensusParams: &cmtproto.ConsensusParams{}, + }) + require.NoError(t, err) + + baseapptestutil.RegisterNestedMessagesServer(tt.suite.baseApp.MsgServiceRouter(), NestedMessgesServerImpl{}) + baseapptestutil.RegisterSendServer(tt.suite.baseApp.MsgServiceRouter(), SendServerImpl{}) + + nestedMessages := make([]*any.Any, 1) + b, err := tt.suite.cdc.Marshal(tt.message) + require.NoError(t, err) + nestedMessages[0] = &any.Any{ + TypeUrl: sdk.MsgTypeURL(tt.message), + Value: b, + } + + msg := &baseapptestutil.MsgNestedMessages{ + Messages: nestedMessages, + Signer: addr.String(), + } + + builder := tt.suite.txConfig.NewTxBuilder() + err = builder.SetMsgs(msg) + require.NoError(t, err) + setTxSignature(t, builder, 0) + tx := builder.GetTx() + + txBytes, err := tt.suite.txConfig.TxEncoder()(tx) + require.Nil(t, err) + + gas, result, err := tt.suite.baseApp.Simulate(txBytes) + require.NoError(t, err) + require.NotNil(t, result) + require.True(t, gas.GasUsed == tt.consumedGas) + }) + } +} + func TestABCI_Query_SimulateTx(t *testing.T) { gasConsumed := uint64(5) anteOpt := func(bapp *baseapp.BaseApp) { @@ -499,9 +993,10 @@ func TestABCI_Query_SimulateTx(t *testing.T) { } suite := NewBaseAppSuite(t, anteOpt) - suite.baseApp.InitChain(&abci.RequestInitChain{ + _, err := suite.baseApp.InitChain(&abci.RequestInitChain{ ConsensusParams: &cmtproto.ConsensusParams{}, }) + require.NoError(t, err) baseapptestutil.RegisterCounterServer(suite.baseApp.MsgServiceRouter(), CounterServerImplGasMeterOnly{gasConsumed}) @@ -543,8 +1038,10 @@ func TestABCI_Query_SimulateTx(t *testing.T) { require.Equal(t, result.Events, simRes.Result.Events) require.True(t, bytes.Equal(result.Data, simRes.Result.Data)) - suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: count}) - suite.baseApp.Commit() + _, err = suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: count}) + require.NoError(t, err) + _, err = suite.baseApp.Commit() + require.NoError(t, err) } } @@ -558,14 +1055,29 @@ func TestABCI_InvalidTransaction(t *testing.T) { suite := NewBaseAppSuite(t, anteOpt) baseapptestutil.RegisterCounterServer(suite.baseApp.MsgServiceRouter(), CounterServerImplGasMeterOnly{}) - suite.baseApp.InitChain(&abci.RequestInitChain{ + _, err := suite.baseApp.InitChain(&abci.RequestInitChain{ ConsensusParams: &cmtproto.ConsensusParams{}, }) + require.NoError(t, err) - suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{ + _, err = suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{ Height: 1, }) + require.NoError(t, err) + + // malformed transaction bytes + { + bz := []byte("example vote extension") + result, err := suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{ + Height: 1, + Txs: [][]byte{bz}, + }) + require.EqualValues(t, sdkerrors.ErrTxDecode.Codespace(), result.TxResults[0].Codespace, err) + require.EqualValues(t, sdkerrors.ErrTxDecode.ABCICode(), result.TxResults[0].Code, err) + require.EqualValues(t, 0, result.TxResults[0].GasUsed, err) + require.EqualValues(t, 0, result.TxResults[0].GasWanted, err) + } // transaction with no messages { emptyTx := suite.txConfig.NewTxBuilder().GetTx() @@ -689,15 +1201,18 @@ func TestABCI_TxGasLimits(t *testing.T) { suite := NewBaseAppSuite(t, anteOpt) baseapptestutil.RegisterCounterServer(suite.baseApp.MsgServiceRouter(), CounterServerImplGasMeterOnly{}) - suite.baseApp.InitChain(&abci.RequestInitChain{ + _, err := suite.baseApp.InitChain(&abci.RequestInitChain{ ConsensusParams: &cmtproto.ConsensusParams{}, }) + require.NoError(t, err) - suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{ + _, err = suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{ Height: 1, }) + require.NoError(t, err) - suite.baseApp.Commit() + _, err = suite.baseApp.Commit() + require.NoError(t, err) testCases := []struct { tx signing.Tx @@ -778,15 +1293,17 @@ func TestABCI_MaxBlockGasLimits(t *testing.T) { suite := NewBaseAppSuite(t, anteOpt) baseapptestutil.RegisterCounterServer(suite.baseApp.MsgServiceRouter(), CounterServerImplGasMeterOnly{}) - suite.baseApp.InitChain(&abci.RequestInitChain{ + _, err := suite.baseApp.InitChain(&abci.RequestInitChain{ ConsensusParams: &cmtproto.ConsensusParams{ Block: &cmtproto.BlockParams{ MaxGas: 100, }, }, }) + require.NoError(t, err) - suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 1}) + _, err = suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 1}) + require.NoError(t, err) testCases := []struct { tx signing.Tx @@ -811,7 +1328,8 @@ func TestABCI_MaxBlockGasLimits(t *testing.T) { tx := tc.tx // reset block gas - suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: suite.baseApp.LastBlockHeight() + 1}) + _, err = suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: suite.baseApp.LastBlockHeight() + 1}) + require.NoError(t, err) // execute the transaction multiple times for j := 0; j < tc.numDelivers; j++ { @@ -876,13 +1394,14 @@ func TestABCI_GasConsumptionBadTx(t *testing.T) { suite := NewBaseAppSuite(t, anteOpt) baseapptestutil.RegisterCounterServer(suite.baseApp.MsgServiceRouter(), CounterServerImplGasMeterOnly{}) - suite.baseApp.InitChain(&abci.RequestInitChain{ + _, err := suite.baseApp.InitChain(&abci.RequestInitChain{ ConsensusParams: &cmtproto.ConsensusParams{ Block: &cmtproto.BlockParams{ MaxGas: 9, }, }, }) + require.NoError(t, err) tx := newTxCounter(t, suite.txConfig, 5, 0) tx = setFailOnAnte(t, suite.txConfig, tx, true) @@ -914,9 +1433,10 @@ func TestABCI_Query(t *testing.T) { suite := NewBaseAppSuite(t, anteOpt) baseapptestutil.RegisterCounterServer(suite.baseApp.MsgServiceRouter(), CounterServerImplGasMeterOnly{}) - suite.baseApp.InitChain(&abci.RequestInitChain{ + _, err := suite.baseApp.InitChain(&abci.RequestInitChain{ ConsensusParams: &cmtproto.ConsensusParams{}, }) + require.NoError(t, err) // NOTE: "/store/key1" tells us KVStore // and the final "/key" says to use the data as the @@ -944,7 +1464,7 @@ func TestABCI_Query(t *testing.T) { bz, err := suite.txConfig.TxEncoder()(tx) require.NoError(t, err) - suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{ + _, err = suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{ Height: 1, Txs: [][]byte{bz}, }) @@ -955,7 +1475,8 @@ func TestABCI_Query(t *testing.T) { require.Equal(t, 0, len(res.Value)) // query returns correct value after Commit - suite.baseApp.Commit() + _, err = suite.baseApp.Commit() + require.NoError(t, err) res, err = suite.baseApp.Query(context.TODO(), &query) require.NoError(t, err) @@ -1057,13 +1578,14 @@ func TestABCI_GetBlockRetentionHeight(t *testing.T) { tc := tc tc.bapp.SetParamStore(¶mStore{db: dbm.NewMemDB()}) - tc.bapp.InitChain(&abci.RequestInitChain{ + _, err = tc.bapp.InitChain(&abci.RequestInitChain{ ConsensusParams: &cmtproto.ConsensusParams{ Evidence: &cmtproto.EvidenceParams{ MaxAgeNumBlocks: tc.maxAgeBlocks, }, }, }) + require.NoError(t, err) t.Run(name, func(t *testing.T) { require.Equal(t, tc.expected, tc.bapp.GetBlockRetentionHeight(tc.commitHeight)) @@ -1086,8 +1608,10 @@ func TestPrepareCheckStateCalledWithCheckState(t *testing.T) { wasPrepareCheckStateCalled = true }) - app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 1}) - app.Commit() + _, err := app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 1}) + require.NoError(t, err) + _, err = app.Commit() + require.NoError(t, err) require.Equal(t, true, wasPrepareCheckStateCalled) } @@ -1108,15 +1632,17 @@ func TestPrecommiterCalledWithDeliverState(t *testing.T) { wasPrecommiterCalled = true }) - app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 1}) - app.Commit() + _, err := app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 1}) + require.NoError(t, err) + _, err = app.Commit() + require.NoError(t, err) require.Equal(t, true, wasPrecommiterCalled) } func TestABCI_Proposal_HappyPath(t *testing.T) { anteKey := []byte("ante-key") - pool := mempool.NewSenderNonceMempool() + pool := mempool.NewSenderNonceMempool(mempool.SenderNonceMaxTxOpt(5000)) anteOpt := func(bapp *baseapp.BaseApp) { bapp.SetAnteHandler(anteHandlerTxTest(t, capKey1, anteKey)) } @@ -1125,9 +1651,10 @@ func TestABCI_Proposal_HappyPath(t *testing.T) { baseapptestutil.RegisterKeyValueServer(suite.baseApp.MsgServiceRouter(), MsgKeyValueImpl{}) baseapptestutil.RegisterCounterServer(suite.baseApp.MsgServiceRouter(), NoopCounterServerImpl{}) - suite.baseApp.InitChain(&abci.RequestInitChain{ + _, err := suite.baseApp.InitChain(&abci.RequestInitChain{ ConsensusParams: &cmtproto.ConsensusParams{}, }) + require.NoError(t, err) tx := newTxCounter(t, suite.txConfig, 0, 1) txBytes, err := suite.txConfig.TxEncoder()(tx) @@ -1169,13 +1696,14 @@ func TestABCI_Proposal_HappyPath(t *testing.T) { require.NoError(t, err) require.Equal(t, abci.ResponseProcessProposal_ACCEPT, resProcessProposal.Status) + // the same txs as in PrepareProposal res, err := suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{ Height: suite.baseApp.LastBlockHeight() + 1, - Txs: [][]byte{txBytes}, + Txs: reqProposalTxBytes[:], }) require.NoError(t, err) - require.Equal(t, 1, pool.CountTx()) + require.Equal(t, 0, pool.CountTx()) require.NotEmpty(t, res.TxResults[0].Events) require.True(t, res.TxResults[0].IsOK(), fmt.Sprintf("%v", res)) @@ -1202,10 +1730,11 @@ func TestABCI_Proposal_Read_State_PrepareProposal(t *testing.T) { suite := NewBaseAppSuite(t, setInitChainerOpt, prepareOpt) - suite.baseApp.InitChain(&abci.RequestInitChain{ + _, err := suite.baseApp.InitChain(&abci.RequestInitChain{ InitialHeight: 1, ConsensusParams: &cmtproto.ConsensusParams{}, }) + require.NoError(t, err) reqPrepareProposal := abci.RequestPrepareProposal{ MaxTxBytes: 1000, @@ -1224,23 +1753,85 @@ func TestABCI_Proposal_Read_State_PrepareProposal(t *testing.T) { resProcessProposal, err := suite.baseApp.ProcessProposal(&reqProcessProposal) require.NoError(t, err) require.Equal(t, abci.ResponseProcessProposal_ACCEPT, resProcessProposal.Status) +} + +func TestABCI_Proposals_WithVE(t *testing.T) { + someVoteExtension := []byte("some-vote-extension") + + setInitChainerOpt := func(bapp *baseapp.BaseApp) { + bapp.SetInitChainer(func(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error) { + return &abci.ResponseInitChain{}, nil + }) + } + + prepareOpt := func(bapp *baseapp.BaseApp) { + bapp.SetPrepareProposal(func(ctx sdk.Context, req *abci.RequestPrepareProposal) (*abci.ResponsePrepareProposal, error) { + // Inject the vote extension to the beginning of the proposal + txs := make([][]byte, len(req.Txs)+1) + txs[0] = someVoteExtension + copy(txs[1:], req.Txs) + + return &abci.ResponsePrepareProposal{Txs: txs}, nil + }) + + bapp.SetProcessProposal(func(ctx sdk.Context, req *abci.RequestProcessProposal) (*abci.ResponseProcessProposal, error) { + // Check that the vote extension is still there + require.Equal(t, someVoteExtension, req.Txs[0]) + return &abci.ResponseProcessProposal{Status: abci.ResponseProcessProposal_ACCEPT}, nil + }) + } + + suite := NewBaseAppSuite(t, setInitChainerOpt, prepareOpt) + + suite.baseApp.InitChain(&abci.RequestInitChain{ + InitialHeight: 1, + ConsensusParams: &cmtproto.ConsensusParams{}, + }) + + reqPrepareProposal := abci.RequestPrepareProposal{ + MaxTxBytes: 100000, + Height: 1, // this value can't be 0 + } + resPrepareProposal, err := suite.baseApp.PrepareProposal(&reqPrepareProposal) + require.NoError(t, err) + require.Equal(t, 1, len(resPrepareProposal.Txs)) + + reqProcessProposal := abci.RequestProcessProposal{ + Txs: resPrepareProposal.Txs, + Height: reqPrepareProposal.Height, + } + resProcessProposal, err := suite.baseApp.ProcessProposal(&reqProcessProposal) + require.NoError(t, err) + require.Equal(t, abci.ResponseProcessProposal_ACCEPT, resProcessProposal.Status) - // suite.baseApp.BeginBlock(abci.RequestBeginBlock{ - // Header: cmtproto.Header{Height: suite.baseApp.LastBlockHeight() + 1}, - // }) + // Run finalize block and ensure that the vote extension is still there and that + // the proposal is accepted + result, err := suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{ + Txs: resPrepareProposal.Txs, + Height: reqPrepareProposal.Height, + }) + require.NoError(t, err) + require.Equal(t, 1, len(result.TxResults)) + require.EqualValues(t, sdkerrors.ErrTxDecode.Codespace(), result.TxResults[0].Codespace, err) + require.EqualValues(t, sdkerrors.ErrTxDecode.ABCICode(), result.TxResults[0].Code, err) + require.EqualValues(t, 0, result.TxResults[0].GasUsed, err) + require.EqualValues(t, 0, result.TxResults[0].GasWanted, err) } func TestABCI_PrepareProposal_ReachedMaxBytes(t *testing.T) { anteKey := []byte("ante-key") - pool := mempool.NewSenderNonceMempool() + pool := mempool.NewSenderNonceMempool(mempool.SenderNonceMaxTxOpt(5000)) anteOpt := func(bapp *baseapp.BaseApp) { bapp.SetAnteHandler(anteHandlerTxTest(t, capKey1, anteKey)) } + suite := NewBaseAppSuite(t, anteOpt, baseapp.SetMempool(pool)) + baseapptestutil.RegisterCounterServer(suite.baseApp.MsgServiceRouter(), NoopCounterServerImpl{}) - suite.baseApp.InitChain(&abci.RequestInitChain{ + _, err := suite.baseApp.InitChain(&abci.RequestInitChain{ ConsensusParams: &cmtproto.ConsensusParams{}, }) + require.NoError(t, err) for i := 0; i < 100; i++ { tx2 := newTxCounter(t, suite.txConfig, int64(i), int64(i)) @@ -1259,18 +1850,21 @@ func TestABCI_PrepareProposal_ReachedMaxBytes(t *testing.T) { func TestABCI_PrepareProposal_BadEncoding(t *testing.T) { anteKey := []byte("ante-key") - pool := mempool.NewSenderNonceMempool() + pool := mempool.NewSenderNonceMempool(mempool.SenderNonceMaxTxOpt(5000)) anteOpt := func(bapp *baseapp.BaseApp) { bapp.SetAnteHandler(anteHandlerTxTest(t, capKey1, anteKey)) } + suite := NewBaseAppSuite(t, anteOpt, baseapp.SetMempool(pool)) + baseapptestutil.RegisterCounterServer(suite.baseApp.MsgServiceRouter(), NoopCounterServerImpl{}) - suite.baseApp.InitChain(&abci.RequestInitChain{ + _, err := suite.baseApp.InitChain(&abci.RequestInitChain{ ConsensusParams: &cmtproto.ConsensusParams{}, }) + require.NoError(t, err) tx := newTxCounter(t, suite.txConfig, 0, 0) - err := pool.Insert(sdk.Context{}, tx) + err = pool.Insert(sdk.Context{}, tx) require.NoError(t, err) reqPrepareProposal := abci.RequestPrepareProposal{ @@ -1282,17 +1876,98 @@ func TestABCI_PrepareProposal_BadEncoding(t *testing.T) { require.Equal(t, 1, len(resPrepareProposal.Txs)) } +func TestABCI_PrepareProposal_OverGasUnderBytes(t *testing.T) { + pool := mempool.NewSenderNonceMempool(mempool.SenderNonceMaxTxOpt(5000)) + suite := NewBaseAppSuite(t, baseapp.SetMempool(pool)) + baseapptestutil.RegisterCounterServer(suite.baseApp.MsgServiceRouter(), NoopCounterServerImpl{}) + + // set max block gas limit to 99, this will allow 9 txs of 10 gas each. + _, err := suite.baseApp.InitChain(&abci.RequestInitChain{ + ConsensusParams: &cmtproto.ConsensusParams{ + Block: &cmtproto.BlockParams{MaxGas: 99}, + }, + }) + + require.NoError(t, err) + // insert 100 txs, each with a gas limit of 10 + _, _, addr := testdata.KeyTestPubAddr() + for i := int64(0); i < 100; i++ { + msg := &baseapptestutil.MsgCounter{Counter: i, FailOnHandler: false, Signer: addr.String()} + msgs := []sdk.Msg{msg} + + builder := suite.txConfig.NewTxBuilder() + err = builder.SetMsgs(msgs...) + require.NoError(t, err) + builder.SetMemo("counter=" + strconv.FormatInt(i, 10) + "&failOnAnte=false") + builder.SetGasLimit(10) + setTxSignature(t, builder, uint64(i)) + + err := pool.Insert(sdk.Context{}, builder.GetTx()) + require.NoError(t, err) + } + + // ensure we only select transactions that fit within the block gas limit + res, err := suite.baseApp.PrepareProposal(&abci.RequestPrepareProposal{ + MaxTxBytes: 1_000_000, // large enough to ignore restriction + Height: 1, + }) + require.NoError(t, err) + + // Should include 9 transactions + require.Len(t, res.Txs, 9, "invalid number of transactions returned") +} + +func TestABCI_PrepareProposal_MaxGas(t *testing.T) { + pool := mempool.NewSenderNonceMempool(mempool.SenderNonceMaxTxOpt(5000)) + suite := NewBaseAppSuite(t, baseapp.SetMempool(pool)) + baseapptestutil.RegisterCounterServer(suite.baseApp.MsgServiceRouter(), NoopCounterServerImpl{}) + + // set max block gas limit to 100 + suite.baseApp.InitChain(&abci.RequestInitChain{ + ConsensusParams: &cmtproto.ConsensusParams{ + Block: &cmtproto.BlockParams{MaxGas: 100}, + }, + }) + + // insert 100 txs, each with a gas limit of 10 + _, _, addr := testdata.KeyTestPubAddr() + for i := int64(0); i < 100; i++ { + msg := &baseapptestutil.MsgCounter{Counter: i, FailOnHandler: false, Signer: addr.String()} + msgs := []sdk.Msg{msg} + + builder := suite.txConfig.NewTxBuilder() + builder.SetMsgs(msgs...) + builder.SetMemo("counter=" + strconv.FormatInt(i, 10) + "&failOnAnte=false") + builder.SetGasLimit(10) + setTxSignature(t, builder, uint64(i)) + + err := pool.Insert(sdk.Context{}, builder.GetTx()) + require.NoError(t, err) + } + + // ensure we only select transactions that fit within the block gas limit + res, err := suite.baseApp.PrepareProposal(&abci.RequestPrepareProposal{ + MaxTxBytes: 1_000_000, // large enough to ignore restriction + Height: 1, + }) + require.NoError(t, err) + require.Len(t, res.Txs, 10, "invalid number of transactions returned") +} + func TestABCI_PrepareProposal_Failures(t *testing.T) { anteKey := []byte("ante-key") - pool := mempool.NewSenderNonceMempool() + pool := mempool.NewSenderNonceMempool(mempool.SenderNonceMaxTxOpt(5000)) anteOpt := func(bapp *baseapp.BaseApp) { bapp.SetAnteHandler(anteHandlerTxTest(t, capKey1, anteKey)) } + suite := NewBaseAppSuite(t, anteOpt, baseapp.SetMempool(pool)) + baseapptestutil.RegisterCounterServer(suite.baseApp.MsgServiceRouter(), NoopCounterServerImpl{}) - suite.baseApp.InitChain(&abci.RequestInitChain{ + _, err := suite.baseApp.InitChain(&abci.RequestInitChain{ ConsensusParams: &cmtproto.ConsensusParams{}, }) + require.NoError(t, err) tx := newTxCounter(t, suite.txConfig, 0, 0) txBytes, err := suite.txConfig.TxEncoder()(tx) @@ -1330,9 +2005,10 @@ func TestABCI_PrepareProposal_PanicRecovery(t *testing.T) { } suite := NewBaseAppSuite(t, prepareOpt) - suite.baseApp.InitChain(&abci.RequestInitChain{ + _, err := suite.baseApp.InitChain(&abci.RequestInitChain{ ConsensusParams: &cmtproto.ConsensusParams{}, }) + require.NoError(t, err) req := abci.RequestPrepareProposal{ MaxTxBytes: 1000, @@ -1346,6 +2022,133 @@ func TestABCI_PrepareProposal_PanicRecovery(t *testing.T) { }) } +func TestABCI_PrepareProposal_VoteExtensions(t *testing.T) { + // set up mocks + ctrl := gomock.NewController(t) + valStore := mock.NewMockValidatorStore(ctrl) + privkey := secp256k1.GenPrivKey() + pubkey := privkey.PubKey() + addr := sdk.AccAddress(pubkey.Address()) + tmPk := cmtprotocrypto.PublicKey{ + Sum: &cmtprotocrypto.PublicKey_Secp256K1{ + Secp256K1: pubkey.Bytes(), + }, + } + + consAddr := sdk.ConsAddress(addr.String()) + valStore.EXPECT().GetPubKeyByConsAddr(gomock.Any(), consAddr.Bytes()).Return(tmPk, nil) + + // set up baseapp + prepareOpt := func(bapp *baseapp.BaseApp) { + bapp.SetPrepareProposal(func(ctx sdk.Context, req *abci.RequestPrepareProposal) (*abci.ResponsePrepareProposal, error) { + ctx = ctx.WithBlockHeight(req.Height).WithChainID(bapp.ChainID()) + _, info := extendedCommitToLastCommit(req.LocalLastCommit) + ctx = ctx.WithCometInfo(info) + err := baseapp.ValidateVoteExtensions(ctx, valStore, 0, "", req.LocalLastCommit) + if err != nil { + return nil, err + } + + cp := ctx.ConsensusParams() + extsEnabled := cp.Abci != nil && req.Height >= cp.Abci.VoteExtensionsEnableHeight && cp.Abci.VoteExtensionsEnableHeight != 0 + if extsEnabled { + req.Txs = append(req.Txs, []byte("some-tx-that-does-something-from-votes")) + } + return &abci.ResponsePrepareProposal{Txs: req.Txs}, nil + }) + } + + suite := NewBaseAppSuite(t, prepareOpt) + + _, err := suite.baseApp.InitChain(&abci.RequestInitChain{ + InitialHeight: 1, + ConsensusParams: &cmtproto.ConsensusParams{ + Abci: &cmtproto.ABCIParams{ + VoteExtensionsEnableHeight: 2, + }, + }, + }) + require.NoError(t, err) + + // first test without vote extensions, no new txs should be added + reqPrepareProposal := abci.RequestPrepareProposal{ + MaxTxBytes: 1000, + Height: 1, // this value can't be 0 + } + resPrepareProposal, err := suite.baseApp.PrepareProposal(&reqPrepareProposal) + require.NoError(t, err) + require.Equal(t, 0, len(resPrepareProposal.Txs)) + + // now we try with vote extensions, a new tx should show up + marshalDelimitedFn := func(msg proto.Message) ([]byte, error) { + var buf bytes.Buffer + if err := protoio.NewDelimitedWriter(&buf).WriteMsg(msg); err != nil { + return nil, err + } + + return buf.Bytes(), nil + } + + ext := []byte("something") + cve := cmtproto.CanonicalVoteExtension{ + Extension: ext, + Height: 2, // the vote extension was signed in the previous height + Round: int64(0), + ChainId: suite.baseApp.ChainID(), + } + + bz, err := marshalDelimitedFn(&cve) + require.NoError(t, err) + + extSig, err := privkey.Sign(bz) + require.NoError(t, err) + + reqPrepareProposal = abci.RequestPrepareProposal{ + MaxTxBytes: 1000, + Height: 3, // this value can't be 0 + LocalLastCommit: abci.ExtendedCommitInfo{ + Round: 0, + Votes: []abci.ExtendedVoteInfo{ + { + Validator: abci.Validator{ + Address: consAddr.Bytes(), + Power: 666, + }, + VoteExtension: ext, + ExtensionSignature: extSig, + BlockIdFlag: cmtproto.BlockIDFlagCommit, + }, + }, + }, + } + resPrepareProposal, err = suite.baseApp.PrepareProposal(&reqPrepareProposal) + require.NoError(t, err) + require.Equal(t, 1, len(resPrepareProposal.Txs)) + + // now vote extensions but our sole voter doesn't reach majority + reqPrepareProposal = abci.RequestPrepareProposal{ + MaxTxBytes: 1000, + Height: 3, // this value can't be 0 + LocalLastCommit: abci.ExtendedCommitInfo{ + Round: 0, + Votes: []abci.ExtendedVoteInfo{ + { + Validator: abci.Validator{ + Address: consAddr.Bytes(), + Power: 666, + }, + VoteExtension: ext, + ExtensionSignature: extSig, + BlockIdFlag: cmtproto.BlockIDFlagNil, // This will ignore the vote extension + }, + }, + }, + } + resPrepareProposal, err = suite.baseApp.PrepareProposal(&reqPrepareProposal) + require.NoError(t, err) + require.Equal(t, 0, len(resPrepareProposal.Txs)) +} + func TestABCI_ProcessProposal_PanicRecovery(t *testing.T) { processOpt := func(app *baseapp.BaseApp) { app.SetProcessProposal(func(ctx sdk.Context, rpp *abci.RequestProcessProposal) (*abci.ResponseProcessProposal, error) { @@ -1354,9 +2157,10 @@ func TestABCI_ProcessProposal_PanicRecovery(t *testing.T) { } suite := NewBaseAppSuite(t, processOpt) - suite.baseApp.InitChain(&abci.RequestInitChain{ + _, err := suite.baseApp.InitChain(&abci.RequestInitChain{ ConsensusParams: &cmtproto.ConsensusParams{}, }) + require.NoError(t, err) require.NotPanics(t, func() { res, err := suite.baseApp.ProcessProposal(&abci.RequestProcessProposal{Height: 1}) @@ -1392,9 +2196,10 @@ func TestABCI_Proposal_Reset_State_Between_Calls(t *testing.T) { suite := NewBaseAppSuite(t, prepareOpt, processOpt) - suite.baseApp.InitChain(&abci.RequestInitChain{ + _, err := suite.baseApp.InitChain(&abci.RequestInitChain{ ConsensusParams: &cmtproto.ConsensusParams{}, }) + require.NoError(t, err) reqPrepareProposal := abci.RequestPrepareProposal{ MaxTxBytes: 1000, @@ -1423,3 +2228,534 @@ func TestABCI_Proposal_Reset_State_Between_Calls(t *testing.T) { require.Equal(t, abci.ResponseProcessProposal_ACCEPT, resProcessProposal.Status) } } + +func TestABCI_HaltChain(t *testing.T) { + testCases := []struct { + name string + haltHeight uint64 + haltTime uint64 + blockHeight int64 + blockTime int64 + expHalt bool + }{ + {"default", 0, 0, 10, 0, false}, + {"halt-height-edge", 11, 0, 10, 0, false}, + {"halt-height-equal", 10, 0, 10, 0, true}, + {"halt-height", 10, 0, 10, 0, true}, + {"halt-time-edge", 0, 11, 1, 10, false}, + {"halt-time-equal", 0, 10, 1, 10, true}, + {"halt-time", 0, 10, 1, 11, true}, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + suite := NewBaseAppSuite(t, baseapp.SetHaltHeight(tc.haltHeight), baseapp.SetHaltTime(tc.haltTime)) + suite.baseApp.InitChain(&abci.RequestInitChain{ + ConsensusParams: &cmtproto.ConsensusParams{}, + InitialHeight: tc.blockHeight, + }) + + app := suite.baseApp + _, err := app.FinalizeBlock(&abci.RequestFinalizeBlock{ + Height: tc.blockHeight, + Time: time.Unix(tc.blockTime, 0), + }) + if !tc.expHalt { + require.NoError(t, err) + } else { + require.Error(t, err) + require.True(t, strings.HasPrefix(err.Error(), "halt per configuration")) + } + }) + } +} + +func TestBaseApp_PreBlocker(t *testing.T) { + db := dbm.NewMemDB() + name := t.Name() + logger := log.NewTestLogger(t) + + app := baseapp.NewBaseApp(name, logger, db, nil) + _, err := app.InitChain(&abci.RequestInitChain{}) + require.NoError(t, err) + + wasHookCalled := false + app.SetPreBlocker(func(ctx sdk.Context, req *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error) { + wasHookCalled = true + + ctx.EventManager().EmitEvent(sdk.NewEvent("preblockertest", sdk.NewAttribute("height", fmt.Sprintf("%d", req.Height)))) + return &sdk.ResponsePreBlock{ConsensusParamsChanged: false}, nil + }) + app.Seal() + + res, err := app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 1}) + require.NoError(t, err) + require.Equal(t, true, wasHookCalled) + require.Len(t, res.Events, 1) + require.Equal(t, "preblockertest", res.Events[0].Type) + + // Now try erroring + app = baseapp.NewBaseApp(name, logger, db, nil) + _, err = app.InitChain(&abci.RequestInitChain{}) + require.NoError(t, err) + + app.SetPreBlocker(func(_ sdk.Context, req *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error) { + return nil, errors.New("some error") + }) + app.Seal() + + _, err = app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 1}) + require.Error(t, err) +} + +// TestBaseApp_VoteExtensions tests vote extensions using a price as an example. +func TestBaseApp_VoteExtensions(t *testing.T) { + ctrl := gomock.NewController(t) + valStore := mock.NewMockValidatorStore(ctrl) + + // 10 good vote extensions, 2 bad ones from 12 total validators + numVals := 12 + privKeys := make([]secp256k1.PrivKey, numVals) + vals := make([]sdk.ConsAddress, numVals) + for i := 0; i < numVals; i++ { + privKey := secp256k1.GenPrivKey() + privKeys[i] = privKey + + pubKey := privKey.PubKey() + val := sdk.ConsAddress(pubKey.Bytes()) + vals[i] = val + + tmPk := cmtprotocrypto.PublicKey{ + Sum: &cmtprotocrypto.PublicKey_Secp256K1{ + Secp256K1: pubKey.Bytes(), + }, + } + valStore.EXPECT().GetPubKeyByConsAddr(gomock.Any(), val).Return(tmPk, nil) + } + + baseappOpts := func(app *baseapp.BaseApp) { + app.SetExtendVoteHandler(func(sdk.Context, *abci.RequestExtendVote) (*abci.ResponseExtendVote, error) { + // here we would have a process to get the price from an external source + price := 10000000 + rand.Int63n(1000000) + ve := make([]byte, 8) + binary.BigEndian.PutUint64(ve, uint64(price)) + return &abci.ResponseExtendVote{VoteExtension: ve}, nil + }) + + app.SetVerifyVoteExtensionHandler(func(_ sdk.Context, req *abci.RequestVerifyVoteExtension) (*abci.ResponseVerifyVoteExtension, error) { + vePrice := binary.BigEndian.Uint64(req.VoteExtension) + // here we would do some price validation, must not be 0 and not too high + if vePrice > 11000000 || vePrice == 0 { + // usually application should always return ACCEPT unless they really want to discard the entire vote + return &abci.ResponseVerifyVoteExtension{Status: abci.ResponseVerifyVoteExtension_REJECT}, nil + } + + return &abci.ResponseVerifyVoteExtension{Status: abci.ResponseVerifyVoteExtension_ACCEPT}, nil + }) + + app.SetPrepareProposal(func(ctx sdk.Context, req *abci.RequestPrepareProposal) (*abci.ResponsePrepareProposal, error) { + txs := [][]byte{} + ctx = ctx.WithBlockHeight(req.Height).WithChainID(app.ChainID()) + _, info := extendedCommitToLastCommit(req.LocalLastCommit) + ctx = ctx.WithCometInfo(info) + if err := baseapp.ValidateVoteExtensions(ctx, valStore, 0, "", req.LocalLastCommit); err != nil { + return nil, err + } + // add all VE as txs (in a real scenario we would need to check signatures too) + for _, v := range req.LocalLastCommit.Votes { + if len(v.VoteExtension) == 8 { + // pretend this is a way to check if the VE is valid + if binary.BigEndian.Uint64(v.VoteExtension) < 11000000 && binary.BigEndian.Uint64(v.VoteExtension) > 0 { + txs = append(txs, v.VoteExtension) + } + } + } + + return &abci.ResponsePrepareProposal{Txs: txs}, nil + }) + + app.SetProcessProposal(func(ctx sdk.Context, req *abci.RequestProcessProposal) (*abci.ResponseProcessProposal, error) { + // here we check if the proposal is valid, mainly if the vote extensions appended to the txs are valid + for _, v := range req.Txs { + // pretend this is a way to check if the tx is actually a VE + if len(v) == 8 { + // pretend this is a way to check if the VE is valid + if binary.BigEndian.Uint64(v) > 11000000 || binary.BigEndian.Uint64(v) == 0 { + return &abci.ResponseProcessProposal{Status: abci.ResponseProcessProposal_REJECT}, nil + } + } + } + + return &abci.ResponseProcessProposal{Status: abci.ResponseProcessProposal_ACCEPT}, nil + }) + + app.SetPreBlocker(func(ctx sdk.Context, req *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error) { + count := uint64(0) + pricesSum := uint64(0) + for _, v := range req.Txs { + // pretend this is a way to check if the tx is actually a VE + if len(v) == 8 { + count++ + pricesSum += binary.BigEndian.Uint64(v) + } + } + + if count > 0 { + // we process the average price and store it in the context to make it available for FinalizeBlock + avgPrice := pricesSum / count + buf := make([]byte, 8) + binary.BigEndian.PutUint64(buf, avgPrice) + ctx.KVStore(capKey1).Set([]byte("avgPrice"), buf) + } + + return &sdk.ResponsePreBlock{ + ConsensusParamsChanged: true, + }, nil + }) + } + + suite := NewBaseAppSuite(t, baseappOpts) + + _, err := suite.baseApp.InitChain(&abci.RequestInitChain{ + ConsensusParams: &cmtproto.ConsensusParams{ + Abci: &cmtproto.ABCIParams{ + VoteExtensionsEnableHeight: 1, + }, + }, + }) + require.NoError(t, err) + + allVEs := [][]byte{} + // simulate getting 10 vote extensions from 10 validators + for i := 0; i < 10; i++ { + ve, err := suite.baseApp.ExtendVote(context.TODO(), &abci.RequestExtendVote{Height: 1}) + require.NoError(t, err) + allVEs = append(allVEs, ve.VoteExtension) + } + + // add a couple of invalid vote extensions (in what regards to the check we are doing in VerifyVoteExtension/ProcessProposal) + // add a 0 price + ve := make([]byte, 8) + binary.BigEndian.PutUint64(ve, uint64(0)) + allVEs = append(allVEs, ve) + + // add a price too high + ve = make([]byte, 8) + binary.BigEndian.PutUint64(ve, uint64(13000000)) + allVEs = append(allVEs, ve) + + // verify all votes, only 10 should be accepted + successful := 0 + for _, v := range allVEs { + res, err := suite.baseApp.VerifyVoteExtension(&abci.RequestVerifyVoteExtension{ + Height: 1, + VoteExtension: v, + }) + require.NoError(t, err) + if res.Status == abci.ResponseVerifyVoteExtension_ACCEPT { + successful++ + } + } + require.Equal(t, 10, successful) + + extVotes := []abci.ExtendedVoteInfo{} + for _, val := range vals { + extVotes = append(extVotes, abci.ExtendedVoteInfo{ + VoteExtension: allVEs[0], + BlockIdFlag: cmtproto.BlockIDFlagCommit, + ExtensionSignature: []byte{}, + Validator: abci.Validator{ + Address: val.Bytes(), + Power: 666, + }, + }, + ) + } + + prepPropReq := &abci.RequestPrepareProposal{ + Height: 1, + LocalLastCommit: abci.ExtendedCommitInfo{ + Round: 0, + Votes: extVotes, + }, + } + + // add all VEs to the local last commit, which will make PrepareProposal fail + // because it's not expecting to receive vote extensions when height == VoteExtensionsEnableHeight + for _, ve := range allVEs { + prepPropReq.LocalLastCommit.Votes = append(prepPropReq.LocalLastCommit.Votes, abci.ExtendedVoteInfo{ + VoteExtension: ve, + BlockIdFlag: cmtproto.BlockIDFlagCommit, + ExtensionSignature: []byte{}, // doesn't matter, it's just to make the next PrepareProposal fail + }) + } + resp, err := suite.baseApp.PrepareProposal(prepPropReq) + require.Len(t, resp.Txs, 0) // this is actually a failure, but we don't want to halt the chain + require.NoError(t, err) // we don't error here + + prepPropReq.LocalLastCommit.Votes = []abci.ExtendedVoteInfo{} // reset votes + resp, err = suite.baseApp.PrepareProposal(prepPropReq) + require.NoError(t, err) + require.Len(t, resp.Txs, 0) + + procPropRes, err := suite.baseApp.ProcessProposal(&abci.RequestProcessProposal{Height: 1, Txs: resp.Txs}) + require.NoError(t, err) + require.Equal(t, abci.ResponseProcessProposal_ACCEPT, procPropRes.Status) + + _, err = suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 1, Txs: resp.Txs}) + require.NoError(t, err) + + // The average price will be nil during the first block, given that we don't have + // any vote extensions on block 1 in PrepareProposal + avgPrice := getFinalizeBlockStateCtx(suite.baseApp).KVStore(capKey1).Get([]byte("avgPrice")) + require.Nil(t, avgPrice) + _, err = suite.baseApp.Commit() + require.NoError(t, err) + + // Now onto the second block, this time we process vote extensions from the + // previous block (which we sign now) + for i, ve := range allVEs { + cve := cmtproto.CanonicalVoteExtension{ + Extension: ve, + Height: 1, + Round: int64(0), + ChainId: suite.baseApp.ChainID(), + } + + bz, err := marshalDelimitedFn(&cve) + require.NoError(t, err) + + privKey := privKeys[i] + extSig, err := privKey.Sign(bz) + require.NoError(t, err) + + prepPropReq.LocalLastCommit.Votes = append(prepPropReq.LocalLastCommit.Votes, abci.ExtendedVoteInfo{ + VoteExtension: ve, + BlockIdFlag: cmtproto.BlockIDFlagCommit, + ExtensionSignature: extSig, + Validator: abci.Validator{ + Address: vals[i].Bytes(), + Power: 666, + }, + }) + } + + prepPropReq.Height = 2 + resp, err = suite.baseApp.PrepareProposal(prepPropReq) + require.NoError(t, err) + require.Len(t, resp.Txs, 10) + + procPropRes, err = suite.baseApp.ProcessProposal(&abci.RequestProcessProposal{Height: 2, Txs: resp.Txs}) + require.NoError(t, err) + require.Equal(t, abci.ResponseProcessProposal_ACCEPT, procPropRes.Status) + + _, err = suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 2, Txs: resp.Txs}) + require.NoError(t, err) + + // Check if the average price was available in FinalizeBlock's context + avgPrice = getFinalizeBlockStateCtx(suite.baseApp).KVStore(capKey1).Get([]byte("avgPrice")) + require.NotNil(t, avgPrice) + require.GreaterOrEqual(t, binary.BigEndian.Uint64(avgPrice), uint64(10000000)) + require.Less(t, binary.BigEndian.Uint64(avgPrice), uint64(11000000)) + + _, err = suite.baseApp.Commit() + require.NoError(t, err) + + // check if avgPrice was committed + committedAvgPrice := suite.baseApp.NewContext(true).KVStore(capKey1).Get([]byte("avgPrice")) + require.Equal(t, avgPrice, committedAvgPrice) +} + +func TestABCI_PrepareProposal_Panic(t *testing.T) { + prepareOpt := func(bapp *baseapp.BaseApp) { + bapp.SetPrepareProposal(func(ctx sdk.Context, req *abci.RequestPrepareProposal) (*abci.ResponsePrepareProposal, error) { + if len(req.Txs) == 3 { + panic("i don't like number 3, panic") + } + // return empty if no panic + return &abci.ResponsePrepareProposal{}, nil + }) + } + + suite := NewBaseAppSuite(t, prepareOpt) + + _, err := suite.baseApp.InitChain(&abci.RequestInitChain{ + InitialHeight: 1, + ConsensusParams: &cmtproto.ConsensusParams{}, + }) + require.NoError(t, err) + + txs := [][]byte{{1}, {2}} + reqPrepareProposal := abci.RequestPrepareProposal{ + MaxTxBytes: 1000, + Height: 1, // this value can't be 0 + Txs: txs, + } + resPrepareProposal, err := suite.baseApp.PrepareProposal(&reqPrepareProposal) + require.NoError(t, err) + require.Equal(t, 0, len(resPrepareProposal.Txs)) + + // make it panic, and check if it returns 3 txs (because of panic recovery) + txs = [][]byte{{1}, {2}, {3}} + reqPrepareProposal.Txs = txs + resPrepareProposal, err = suite.baseApp.PrepareProposal(&reqPrepareProposal) + require.NoError(t, err) + require.Equal(t, 3, len(resPrepareProposal.Txs)) +} + +func TestOptimisticExecution(t *testing.T) { + suite := NewBaseAppSuite(t, baseapp.SetOptimisticExecution()) + + _, err := suite.baseApp.InitChain(&abci.RequestInitChain{ + ConsensusParams: &cmtproto.ConsensusParams{}, + }) + require.NoError(t, err) + + // run 50 blocks + for i := 0; i < 50; i++ { + tx := newTxCounter(t, suite.txConfig, 0, 1) + txBytes, err := suite.txConfig.TxEncoder()(tx) + require.NoError(t, err) + + reqProcProp := abci.RequestProcessProposal{ + Txs: [][]byte{txBytes}, + Height: suite.baseApp.LastBlockHeight() + 1, + Hash: []byte("some-hash" + strconv.FormatInt(suite.baseApp.LastBlockHeight()+1, 10)), + } + + respProcProp, err := suite.baseApp.ProcessProposal(&reqProcProp) + require.Equal(t, abci.ResponseProcessProposal_ACCEPT, respProcProp.Status) + require.NoError(t, err) + + reqFinalizeBlock := abci.RequestFinalizeBlock{ + Height: reqProcProp.Height, + Txs: reqProcProp.Txs, + Hash: reqProcProp.Hash, + } + + respFinalizeBlock, err := suite.baseApp.FinalizeBlock(&reqFinalizeBlock) + require.NoError(t, err) + require.Len(t, respFinalizeBlock.TxResults, 1) + + _, err = suite.baseApp.Commit() + require.NoError(t, err) + } + + require.Equal(t, int64(50), suite.baseApp.LastBlockHeight()) +} + +func TestABCI_Proposal_FailReCheckTx(t *testing.T) { + pool := mempool.NewPriorityMempool[int64](mempool.PriorityNonceMempoolConfig[int64]{ + TxPriority: mempool.NewDefaultTxPriority(), + MaxTx: 0, + SignerExtractor: mempool.NewDefaultSignerExtractionAdapter(), + }) + + anteOpt := func(bapp *baseapp.BaseApp) { + bapp.SetAnteHandler(func(ctx sdk.Context, tx sdk.Tx, simulate bool) (sdk.Context, error) { + // always fail on recheck, just to test the recheck logic + if ctx.IsReCheckTx() { + return ctx, errors.New("recheck failed in ante handler") + } + + return ctx, nil + }) + } + + suite := NewBaseAppSuite(t, anteOpt, baseapp.SetMempool(pool)) + baseapptestutil.RegisterKeyValueServer(suite.baseApp.MsgServiceRouter(), MsgKeyValueImpl{}) + baseapptestutil.RegisterCounterServer(suite.baseApp.MsgServiceRouter(), NoopCounterServerImpl{}) + + _, err := suite.baseApp.InitChain(&abci.RequestInitChain{ + ConsensusParams: &cmtproto.ConsensusParams{}, + }) + require.NoError(t, err) + + tx := newTxCounter(t, suite.txConfig, 0, 1) + txBytes, err := suite.txConfig.TxEncoder()(tx) + require.NoError(t, err) + + reqCheckTx := abci.RequestCheckTx{ + Tx: txBytes, + Type: abci.CheckTxType_New, + } + _, err = suite.baseApp.CheckTx(&reqCheckTx) + require.NoError(t, err) + + tx2 := newTxCounter(t, suite.txConfig, 1, 1) + + tx2Bytes, err := suite.txConfig.TxEncoder()(tx2) + require.NoError(t, err) + + err = pool.Insert(sdk.Context{}, tx2) + require.NoError(t, err) + + require.Equal(t, 2, pool.CountTx()) + + // call prepareProposal before calling recheck tx, just as a sanity check + reqPrepareProposal := abci.RequestPrepareProposal{ + MaxTxBytes: 1000, + Height: 1, + } + resPrepareProposal, err := suite.baseApp.PrepareProposal(&reqPrepareProposal) + require.NoError(t, err) + require.Equal(t, 2, len(resPrepareProposal.Txs)) + + // call recheck on the first tx, it MUST return an error + reqReCheckTx := abci.RequestCheckTx{ + Tx: txBytes, + Type: abci.CheckTxType_Recheck, + } + resp, err := suite.baseApp.CheckTx(&reqReCheckTx) + require.NoError(t, err) + require.True(t, resp.IsErr()) + require.Equal(t, "recheck failed in ante handler", resp.Log) + + // call prepareProposal again, should return only the second tx + resPrepareProposal, err = suite.baseApp.PrepareProposal(&reqPrepareProposal) + require.NoError(t, err) + require.Equal(t, 1, len(resPrepareProposal.Txs)) + require.Equal(t, tx2Bytes, resPrepareProposal.Txs[0]) + + // check the mempool, it should have only the second tx + require.Equal(t, 1, pool.CountTx()) + + reqProposalTxBytes := [][]byte{ + tx2Bytes, + } + reqProcessProposal := abci.RequestProcessProposal{ + Txs: reqProposalTxBytes, + Height: reqPrepareProposal.Height, + } + + resProcessProposal, err := suite.baseApp.ProcessProposal(&reqProcessProposal) + require.NoError(t, err) + require.Equal(t, abci.ResponseProcessProposal_ACCEPT, resProcessProposal.Status) + + // the same txs as in PrepareProposal + res, err := suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{ + Height: suite.baseApp.LastBlockHeight() + 1, + Txs: reqProposalTxBytes, + }) + require.NoError(t, err) + + require.Equal(t, 0, pool.CountTx()) + + require.NotEmpty(t, res.TxResults[0].Events) + require.True(t, res.TxResults[0].IsOK(), fmt.Sprintf("%v", res)) +} + +func TestFinalizeBlockDeferResponseHandle(t *testing.T) { + suite := NewBaseAppSuite(t, baseapp.SetHaltHeight(1)) + suite.baseApp.SetStreamingManager(storetypes.StreamingManager{ + ABCIListeners: []storetypes.ABCIListener{ + &mockABCIListener{}, + }, + }) + + res, err := suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{ + Height: 2, + }) + require.Empty(t, res) + require.NotEmpty(t, err) +} diff --git a/baseapp/abci_utils.go b/baseapp/abci_utils.go index 465dfa516416..649ad4230b35 100644 --- a/baseapp/abci_utils.go +++ b/baseapp/abci_utils.go @@ -2,61 +2,67 @@ package baseapp import ( "bytes" + "context" "fmt" + "slices" //nolint: gci // ignore this line for this linter - "cosmossdk.io/math" "github.com/cockroachdb/errors" abci "github.com/cometbft/cometbft/abci/types" - cmtcrypto "github.com/cometbft/cometbft/crypto" cryptoenc "github.com/cometbft/cometbft/crypto/encoding" cmtprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" protoio "github.com/cosmos/gogoproto/io" - "github.com/cosmos/gogoproto/proto" + "github.com/cosmos/gogoproto/proto" //nolint: gci // ignore this line for this linter + + "cosmossdk.io/core/comet" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/mempool" ) -// VoteExtensionThreshold defines the total voting power % that must be -// submitted in order for all vote extensions to be considered valid for a -// given height. -var VoteExtensionThreshold = math.LegacyNewDecWithPrec(667, 3) - type ( - // Validator defines the interface contract require for verifying vote extension - // signatures. Typically, this will be implemented by the x/staking module, - // which has knowledge of the CometBFT public key. - Validator interface { - CmtConsPublicKey() (cmtprotocrypto.PublicKey, error) - BondedTokens() math.Int - } - - // ValidatorStore defines the interface contract require for verifying vote + // ValidatorStore defines the interface contract required for verifying vote // extension signatures. Typically, this will be implemented by the x/staking // module, which has knowledge of the CometBFT public key. ValidatorStore interface { - GetValidatorByConsAddr(sdk.Context, cryptotypes.Address) (Validator, error) - TotalBondedTokens(ctx sdk.Context) math.Int + GetPubKeyByConsAddr(context.Context, sdk.ConsAddress) (cmtprotocrypto.PublicKey, error) + } + + // GasTx defines the contract that a transaction with a gas limit must implement. + GasTx interface { + GetGas() uint64 } ) // ValidateVoteExtensions defines a helper function for verifying vote extension // signatures that may be passed or manually injected into a block proposal from -// a proposer in ProcessProposal. It returns an error if any signature is invalid +// a proposer in PrepareProposal. It returns an error if any signature is invalid // or if unexpected vote extensions and/or signatures are found or less than 2/3 // power is received. +// NOTE: From v0.50.5 `currentHeight` and `chainID` arguments are ignored for fixing an issue. +// They will be removed from the function in v0.51+. func ValidateVoteExtensions( ctx sdk.Context, valStore ValidatorStore, - currentHeight int64, - chainID string, + _ int64, + _ string, extCommit abci.ExtendedCommitInfo, ) error { + // Get values from context cp := ctx.ConsensusParams() - extsEnabled := cp.Abci != nil && cp.Abci.VoteExtensionsEnableHeight > 0 + currentHeight := ctx.HeaderInfo().Height + chainID := ctx.HeaderInfo().ChainID + commitInfo := ctx.CometInfo().GetLastCommit() + // Check that both extCommit + commit are ordered in accordance with vp/address. + if err := validateExtendedCommitAgainstLastCommit(extCommit, commitInfo); err != nil { + return err + } + + // Start checking vote extensions only **after** the vote extensions enable + // height, because when `currentHeight == VoteExtensionsEnableHeight` + // PrepareProposal doesn't get any vote extensions in its request. + extsEnabled := cp.Abci != nil && currentHeight > cp.Abci.VoteExtensionsEnableHeight && cp.Abci.VoteExtensionsEnableHeight != 0 marshalDelimitedFn := func(msg proto.Message) ([]byte, error) { var buf bytes.Buffer if err := protoio.NewDelimitedWriter(&buf).WriteMsg(msg); err != nil { @@ -66,8 +72,22 @@ func ValidateVoteExtensions( return buf.Bytes(), nil } - var sumVP math.Int + var ( + // Total voting power of all vote extensions. + totalVP int64 + // Total voting power of all validators that submitted valid vote extensions. + sumVP int64 + ) + for _, vote := range extCommit.Votes { + totalVP += vote.Validator.Power + + // Only check + include power if the vote is a commit vote. There must be super-majority, otherwise the + // previous block (the block the vote is for) could not have been committed. + if vote.BlockIdFlag != cmtproto.BlockIDFlagCommit { + continue + } + if !extsEnabled { if len(vote.VoteExtension) > 0 { return fmt.Errorf("vote extensions disabled; received non-empty vote extension at height %d", currentHeight) @@ -83,22 +103,14 @@ func ValidateVoteExtensions( return fmt.Errorf("vote extensions enabled; received empty vote extension signature at height %d", currentHeight) } - valConsAddr := cmtcrypto.Address(vote.Validator.Address) - - validator, err := valStore.GetValidatorByConsAddr(ctx, valConsAddr) - if err != nil { - return fmt.Errorf("failed to get validator %X: %w", valConsAddr, err) - } - if validator == nil { - return fmt.Errorf("validator %X not found", valConsAddr) - } + valConsAddr := sdk.ConsAddress(vote.Validator.Address) - cmtPubKeyProto, err := validator.CmtConsPublicKey() + pubKeyProto, err := valStore.GetPubKeyByConsAddr(ctx, valConsAddr) if err != nil { return fmt.Errorf("failed to get validator %X public key: %w", valConsAddr, err) } - cmtPubKey, err := cryptoenc.PubKeyFromProto(cmtPubKeyProto) + cmtPubKey, err := cryptoenc.PubKeyFromProto(pubKeyProto) if err != nil { return fmt.Errorf("failed to convert validator %X public key: %w", valConsAddr, err) } @@ -119,15 +131,64 @@ func ValidateVoteExtensions( return fmt.Errorf("failed to verify validator %X vote extension signature", valConsAddr) } - sumVP = sumVP.Add(validator.BondedTokens()) + sumVP += vote.Validator.Power + } + + // This check is probably unnecessary, but better safe than sorry. + if totalVP <= 0 { + return fmt.Errorf("total voting power must be positive, got: %d", totalVP) + } + + // If the sum of the voting power has not reached (2/3 + 1) we need to error. + if requiredVP := ((totalVP * 2) / 3) + 1; sumVP < requiredVP { + return fmt.Errorf( + "insufficient cumulative voting power received to verify vote extensions; got: %d, expected: >=%d", + sumVP, requiredVP, + ) + } + return nil +} + +// validateExtendedCommitAgainstLastCommit validates an ExtendedCommitInfo against a LastCommit. Specifically, +// it checks that the ExtendedCommit + LastCommit (for the same height), are consistent with each other + that +// they are ordered correctly (by voting power) in accordance with +// [comet](https://github.com/cometbft/cometbft/blob/4ce0277b35f31985bbf2c25d3806a184a4510010/types/validator_set.go#L784). +func validateExtendedCommitAgainstLastCommit(ec abci.ExtendedCommitInfo, lc comet.CommitInfo) error { + // check that the rounds are the same + if ec.Round != lc.Round() { + return fmt.Errorf("extended commit round %d does not match last commit round %d", ec.Round, lc.Round()) + } + + // check that the # of votes are the same + if len(ec.Votes) != lc.Votes().Len() { + return fmt.Errorf("extended commit votes length %d does not match last commit votes length %d", len(ec.Votes), lc.Votes().Len()) } - // Ensure we have at least 2/3 voting power that submitted valid vote - // extensions. - totalVP := valStore.TotalBondedTokens(ctx) - percentSubmitted := math.LegacyNewDecFromInt(sumVP).Quo(math.LegacyNewDecFromInt(totalVP)) - if percentSubmitted.LT(VoteExtensionThreshold) { - return fmt.Errorf("insufficient cumulative voting power received to verify vote extensions; got: %s, expected: >=%s", percentSubmitted, VoteExtensionThreshold) + // check sort order of extended commit votes + if !slices.IsSortedFunc(ec.Votes, func(vote1, vote2 abci.ExtendedVoteInfo) int { + if vote1.Validator.Power == vote2.Validator.Power { + return bytes.Compare(vote1.Validator.Address, vote2.Validator.Address) // addresses sorted in ascending order (used to break vp conflicts) + } + return -int(vote1.Validator.Power - vote2.Validator.Power) // vp sorted in descending order + }) { + return fmt.Errorf("extended commit votes are not sorted by voting power") + } + + addressCache := make(map[string]struct{}, len(ec.Votes)) + // check that consistency between LastCommit and ExtendedCommit + for i, vote := range ec.Votes { + // cache addresses to check for duplicates + if _, ok := addressCache[string(vote.Validator.Address)]; ok { + return fmt.Errorf("extended commit vote address %X is duplicated", vote.Validator.Address) + } + addressCache[string(vote.Validator.Address)] = struct{}{} + + if !bytes.Equal(vote.Validator.Address, lc.Votes().Get(i).Validator().Address()) { + return fmt.Errorf("extended commit vote address %X does not match last commit vote address %X", vote.Validator.Address, lc.Votes().Get(i).Validator().Address()) + } + if vote.Validator.Power != lc.Votes().Get(i).Validator().Power() { + return fmt.Errorf("extended commit vote power %d does not match last commit vote power %d", vote.Validator.Power, lc.Votes().Get(i).Validator().Power()) + } } return nil @@ -140,23 +201,34 @@ type ( ProposalTxVerifier interface { PrepareProposalVerifyTx(tx sdk.Tx) ([]byte, error) ProcessProposalVerifyTx(txBz []byte) (sdk.Tx, error) + TxDecode(txBz []byte) (sdk.Tx, error) + TxEncode(tx sdk.Tx) ([]byte, error) } // DefaultProposalHandler defines the default ABCI PrepareProposal and // ProcessProposal handlers. DefaultProposalHandler struct { - mempool mempool.Mempool - txVerifier ProposalTxVerifier + mempool mempool.Mempool + txVerifier ProposalTxVerifier + txSelector TxSelector + signerExtAdapter mempool.SignerExtractionAdapter } ) -func NewDefaultProposalHandler(mp mempool.Mempool, txVerifier ProposalTxVerifier) DefaultProposalHandler { - return DefaultProposalHandler{ - mempool: mp, - txVerifier: txVerifier, +func NewDefaultProposalHandler(mp mempool.Mempool, txVerifier ProposalTxVerifier) *DefaultProposalHandler { + return &DefaultProposalHandler{ + mempool: mp, + txVerifier: txVerifier, + txSelector: NewDefaultTxSelector(), + signerExtAdapter: mempool.NewDefaultSignerExtractionAdapter(), } } +// SetTxSelector sets the TxSelector function on the DefaultProposalHandler. +func (h *DefaultProposalHandler) SetTxSelector(ts TxSelector) { + h.txSelector = ts +} + // PrepareProposalHandler returns the default implementation for processing an // ABCI proposal. The application's mempool is enumerated and all valid // transactions are added to the proposal. Transactions are valid if they: @@ -177,50 +249,129 @@ func NewDefaultProposalHandler(mp mempool.Mempool, txVerifier ProposalTxVerifier // - If no mempool is set or if the mempool is a no-op mempool, the transactions // requested from CometBFT will simply be returned, which, by default, are in // FIFO order. -func (h DefaultProposalHandler) PrepareProposalHandler() sdk.PrepareProposalHandler { +func (h *DefaultProposalHandler) PrepareProposalHandler() sdk.PrepareProposalHandler { return func(ctx sdk.Context, req *abci.RequestPrepareProposal) (*abci.ResponsePrepareProposal, error) { + var maxBlockGas uint64 + if b := ctx.ConsensusParams().Block; b != nil { + maxBlockGas = uint64(b.MaxGas) + } + + defer h.txSelector.Clear() + // If the mempool is nil or NoOp we simply return the transactions // requested from CometBFT, which, by default, should be in FIFO order. + // + // Note, we still need to ensure the transactions returned respect req.MaxTxBytes. _, isNoOp := h.mempool.(mempool.NoOpMempool) if h.mempool == nil || isNoOp { - return &abci.ResponsePrepareProposal{Txs: req.Txs}, nil + for _, txBz := range req.Txs { + tx, err := h.txVerifier.TxDecode(txBz) + if err != nil { + return nil, err + } + + stop := h.txSelector.SelectTxForProposal(ctx, uint64(req.MaxTxBytes), maxBlockGas, tx, txBz) + if stop { + break + } + } + + return &abci.ResponsePrepareProposal{Txs: h.txSelector.SelectedTxs(ctx)}, nil } + selectedTxsSignersSeqs := make(map[string]uint64) var ( - selectedTxs [][]byte - totalTxBytes int64 + resError error + selectedTxsNums int + invalidTxs []sdk.Tx // invalid txs to be removed out of the loop to avoid dead lock ) + mempool.SelectBy(ctx, h.mempool, req.Txs, func(memTx sdk.Tx) bool { + unorderedTx, ok := memTx.(sdk.TxWithUnordered) + isUnordered := ok && unorderedTx.GetUnordered() + txSignersSeqs := make(map[string]uint64) + + // if the tx is unordered, we don't need to check the sequence, we just add it + if !isUnordered { + signerData, err := h.signerExtAdapter.GetSigners(memTx) + if err != nil { + // propagate the error to the caller + resError = err + return false + } - iterator := h.mempool.Select(ctx, req.Txs) - - for iterator != nil { - memTx := iterator.Tx() + // If the signers aren't in selectedTxsSignersSeqs then we haven't seen them before + // so we add them and continue given that we don't need to check the sequence. + shouldAdd := true + for _, signer := range signerData { + seq, ok := selectedTxsSignersSeqs[signer.Signer.String()] + if !ok { + txSignersSeqs[signer.Signer.String()] = signer.Sequence + continue + } + + // If we have seen this signer before in this block, we must make + // sure that the current sequence is seq+1; otherwise is invalid + // and we skip it. + if seq+1 != signer.Sequence { + shouldAdd = false + break + } + txSignersSeqs[signer.Signer.String()] = signer.Sequence + } + if !shouldAdd { + return true + } + } // NOTE: Since transaction verification was already executed in CheckTx, // which calls mempool.Insert, in theory everything in the pool should be // valid. But some mempool implementations may insert invalid txs, so we // check again. - bz, err := h.txVerifier.PrepareProposalVerifyTx(memTx) + txBz, err := h.txVerifier.PrepareProposalVerifyTx(memTx) if err != nil { - err := h.mempool.Remove(memTx) - if err != nil && !errors.Is(err, mempool.ErrTxNotFound) { - panic(err) - } + invalidTxs = append(invalidTxs, memTx) } else { - txSize := int64(len(bz)) - if totalTxBytes += txSize; totalTxBytes <= req.MaxTxBytes { - selectedTxs = append(selectedTxs, bz) - } else { - // We've reached capacity per req.MaxTxBytes so we cannot select any - // more transactions. - break + stop := h.txSelector.SelectTxForProposal(ctx, uint64(req.MaxTxBytes), maxBlockGas, memTx, txBz) + if stop { + return false + } + + txsLen := len(h.txSelector.SelectedTxs(ctx)) + // If the tx is unordered, we don't need to update the sender sequence. + if !isUnordered { + for sender, seq := range txSignersSeqs { + // If txsLen != selectedTxsNums is true, it means that we've + // added a new tx to the selected txs, so we need to update + // the sequence of the sender. + if txsLen != selectedTxsNums { + selectedTxsSignersSeqs[sender] = seq + } else if _, ok := selectedTxsSignersSeqs[sender]; !ok { + // The transaction hasn't been added but it passed the + // verification, so we know that the sequence is correct. + // So we set this sender's sequence to seq-1, in order + // to avoid unnecessary calls to PrepareProposalVerifyTx. + selectedTxsSignersSeqs[sender] = seq - 1 + } + } } + selectedTxsNums = txsLen } - iterator = iterator.Next() + return true + }) + + if resError != nil { + return nil, resError + } + + for _, tx := range invalidTxs { + err := h.mempool.Remove(tx) + if err != nil && !errors.Is(err, mempool.ErrTxNotFound) { + return nil, err + } } - return &abci.ResponsePrepareProposal{Txs: selectedTxs}, nil + return &abci.ResponsePrepareProposal{Txs: h.txSelector.SelectedTxs(ctx)}, nil } } @@ -235,7 +386,7 @@ func (h DefaultProposalHandler) PrepareProposalHandler() sdk.PrepareProposalHand // DefaultPrepareProposal. It is very important that the same validation logic // is used in both steps, and applications must ensure that this is the case in // non-default handlers. -func (h DefaultProposalHandler) ProcessProposalHandler() sdk.ProcessProposalHandler { +func (h *DefaultProposalHandler) ProcessProposalHandler() sdk.ProcessProposalHandler { // If the mempool is nil or NoOp we simply return ACCEPT, // because PrepareProposal may have included txs that could fail verification. _, isNoOp := h.mempool.(mempool.NoOpMempool) @@ -244,11 +395,29 @@ func (h DefaultProposalHandler) ProcessProposalHandler() sdk.ProcessProposalHand } return func(ctx sdk.Context, req *abci.RequestProcessProposal) (*abci.ResponseProcessProposal, error) { + var totalTxGas uint64 + + var maxBlockGas int64 + if b := ctx.ConsensusParams().Block; b != nil { + maxBlockGas = b.MaxGas + } + for _, txBytes := range req.Txs { - _, err := h.txVerifier.ProcessProposalVerifyTx(txBytes) + tx, err := h.txVerifier.ProcessProposalVerifyTx(txBytes) if err != nil { return &abci.ResponseProcessProposal{Status: abci.ResponseProcessProposal_REJECT}, nil } + + if maxBlockGas > 0 { + gasTx, ok := tx.(GasTx) + if ok { + totalTxGas += gasTx.GetGas() + } + + if totalTxGas > uint64(maxBlockGas) { + return &abci.ResponseProcessProposal{Status: abci.ResponseProcessProposal_REJECT}, nil + } + } } return &abci.ResponseProcessProposal{Status: abci.ResponseProcessProposal_ACCEPT}, nil @@ -286,3 +455,73 @@ func NoOpVerifyVoteExtensionHandler() sdk.VerifyVoteExtensionHandler { return &abci.ResponseVerifyVoteExtension{Status: abci.ResponseVerifyVoteExtension_ACCEPT}, nil } } + +// TxSelector defines a helper type that assists in selecting transactions during +// mempool transaction selection in PrepareProposal. It keeps track of the total +// number of bytes and total gas of the selected transactions. It also keeps +// track of the selected transactions themselves. +type TxSelector interface { + // SelectedTxs should return a copy of the selected transactions. + SelectedTxs(ctx context.Context) [][]byte + + // Clear should clear the TxSelector, nulling out all relevant fields. + Clear() + + // SelectTxForProposal should attempt to select a transaction for inclusion in + // a proposal based on inclusion criteria defined by the TxSelector. It must + // return if the caller should halt the transaction selection loop + // (typically over a mempool) or otherwise. + SelectTxForProposal(ctx context.Context, maxTxBytes, maxBlockGas uint64, memTx sdk.Tx, txBz []byte) bool +} + +type defaultTxSelector struct { + totalTxBytes uint64 + totalTxGas uint64 + selectedTxs [][]byte +} + +func NewDefaultTxSelector() TxSelector { + return &defaultTxSelector{} +} + +func (ts *defaultTxSelector) SelectedTxs(_ context.Context) [][]byte { + txs := make([][]byte, len(ts.selectedTxs)) + copy(txs, ts.selectedTxs) + return txs +} + +func (ts *defaultTxSelector) Clear() { + ts.totalTxBytes = 0 + ts.totalTxGas = 0 + ts.selectedTxs = nil +} + +func (ts *defaultTxSelector) SelectTxForProposal(_ context.Context, maxTxBytes, maxBlockGas uint64, memTx sdk.Tx, txBz []byte) bool { + txSize := uint64(len(txBz)) + + var txGasLimit uint64 + if memTx != nil { + if gasTx, ok := memTx.(GasTx); ok { + txGasLimit = gasTx.GetGas() + } + } + + // only add the transaction to the proposal if we have enough capacity + if (txSize + ts.totalTxBytes) <= maxTxBytes { + // If there is a max block gas limit, add the tx only if the limit has + // not been met. + if maxBlockGas > 0 { + if (txGasLimit + ts.totalTxGas) <= maxBlockGas { + ts.totalTxGas += txGasLimit + ts.totalTxBytes += txSize + ts.selectedTxs = append(ts.selectedTxs, txBz) + } + } else { + ts.totalTxBytes += txSize + ts.selectedTxs = append(ts.selectedTxs, txBz) + } + } + + // check if we've reached capacity; if so, we cannot select any more transactions + return ts.totalTxBytes >= maxTxBytes || (maxBlockGas > 0 && (ts.totalTxGas >= maxBlockGas)) +} diff --git a/baseapp/abci_utils_test.go b/baseapp/abci_utils_test.go new file mode 100644 index 000000000000..42e843c2e26d --- /dev/null +++ b/baseapp/abci_utils_test.go @@ -0,0 +1,776 @@ +package baseapp_test + +import ( + "bytes" + "sort" + "testing" + + abci "github.com/cometbft/cometbft/abci/types" + cmtsecp256k1 "github.com/cometbft/cometbft/crypto/secp256k1" + cmtprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmttypes "github.com/cometbft/cometbft/types" + dbm "github.com/cosmos/cosmos-db" + protoio "github.com/cosmos/gogoproto/io" + "github.com/cosmos/gogoproto/proto" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + "go.uber.org/mock/gomock" + + "cosmossdk.io/core/comet" + "cosmossdk.io/core/header" + "cosmossdk.io/log" + + "github.com/cosmos/cosmos-sdk/baseapp" + baseapptestutil "github.com/cosmos/cosmos-sdk/baseapp/testutil" + "github.com/cosmos/cosmos-sdk/baseapp/testutil/mock" + "github.com/cosmos/cosmos-sdk/client" + codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" + "github.com/cosmos/cosmos-sdk/testutil/testdata" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/mempool" + signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing" + authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" +) + +const ( + chainID = "chain-id" +) + +type testValidator struct { + consAddr sdk.ConsAddress + tmPk cmtprotocrypto.PublicKey + privKey cmtsecp256k1.PrivKey +} + +func newTestValidator() testValidator { + privkey := cmtsecp256k1.GenPrivKey() + pubkey := privkey.PubKey() + tmPk := cmtprotocrypto.PublicKey{ + Sum: &cmtprotocrypto.PublicKey_Secp256K1{ + Secp256K1: pubkey.Bytes(), + }, + } + + return testValidator{ + consAddr: sdk.ConsAddress(pubkey.Address()), + tmPk: tmPk, + privKey: privkey, + } +} + +func (t testValidator) toValidator(power int64) abci.Validator { + return abci.Validator{ + Address: t.consAddr.Bytes(), + Power: power, + } +} + +type ABCIUtilsTestSuite struct { + suite.Suite + + valStore *mock.MockValidatorStore + vals [3]testValidator + ctx sdk.Context +} + +func NewABCIUtilsTestSuite(t *testing.T) *ABCIUtilsTestSuite { + t.Helper() + // create 3 validators + s := &ABCIUtilsTestSuite{ + vals: [3]testValidator{ + newTestValidator(), + newTestValidator(), + newTestValidator(), + }, + } + + // create mock + ctrl := gomock.NewController(t) + valStore := mock.NewMockValidatorStore(ctrl) + s.valStore = valStore + + // set up mock + s.valStore.EXPECT().GetPubKeyByConsAddr(gomock.Any(), s.vals[0].consAddr.Bytes()).Return(s.vals[0].tmPk, nil).AnyTimes() + s.valStore.EXPECT().GetPubKeyByConsAddr(gomock.Any(), s.vals[1].consAddr.Bytes()).Return(s.vals[1].tmPk, nil).AnyTimes() + s.valStore.EXPECT().GetPubKeyByConsAddr(gomock.Any(), s.vals[2].consAddr.Bytes()).Return(s.vals[2].tmPk, nil).AnyTimes() + + // create context + s.ctx = sdk.Context{}.WithConsensusParams(cmtproto.ConsensusParams{ + Abci: &cmtproto.ABCIParams{ + VoteExtensionsEnableHeight: 2, + }, + }).WithBlockHeader(cmtproto.Header{ + ChainID: chainID, + }).WithLogger(log.NewTestLogger(t)) + return s +} + +func TestABCIUtilsTestSuite(t *testing.T) { + suite.Run(t, NewABCIUtilsTestSuite(t)) +} + +// check ValidateVoteExtensions works when all nodes have CommitBlockID votes +func (s *ABCIUtilsTestSuite) TestValidateVoteExtensionsHappyPath() { + ext := []byte("vote-extension") + cve := cmtproto.CanonicalVoteExtension{ + Extension: ext, + Height: 2, + Round: int64(0), + ChainId: chainID, + } + + bz, err := marshalDelimitedFn(&cve) + s.Require().NoError(err) + + extSig0, err := s.vals[0].privKey.Sign(bz) + s.Require().NoError(err) + + extSig1, err := s.vals[1].privKey.Sign(bz) + s.Require().NoError(err) + + extSig2, err := s.vals[2].privKey.Sign(bz) + s.Require().NoError(err) + + s.ctx = s.ctx.WithBlockHeight(3).WithHeaderInfo(header.Info{Height: 3, ChainID: chainID}) // enable vote-extensions + + llc := abci.ExtendedCommitInfo{ + Round: 0, + Votes: []abci.ExtendedVoteInfo{ + { + Validator: s.vals[0].toValidator(333), + VoteExtension: ext, + ExtensionSignature: extSig0, + BlockIdFlag: cmtproto.BlockIDFlagCommit, + }, + { + Validator: s.vals[1].toValidator(333), + VoteExtension: ext, + ExtensionSignature: extSig1, + BlockIdFlag: cmtproto.BlockIDFlagCommit, + }, + { + Validator: s.vals[2].toValidator(334), + VoteExtension: ext, + ExtensionSignature: extSig2, + BlockIdFlag: cmtproto.BlockIDFlagCommit, + }, + }, + } + + // order + convert to last commit + llc, info := extendedCommitToLastCommit(llc) + s.ctx = s.ctx.WithCometInfo(info) + + // expect-pass (votes of height 2 are included in next block) + s.Require().NoError(baseapp.ValidateVoteExtensions(s.ctx, s.valStore, 0, "", llc)) +} + +// check ValidateVoteExtensions works when a single node has submitted a BlockID_Absent +func (s *ABCIUtilsTestSuite) TestValidateVoteExtensionsSingleVoteAbsent() { + ext := []byte("vote-extension") + cve := cmtproto.CanonicalVoteExtension{ + Extension: ext, + Height: 2, + Round: int64(0), + ChainId: chainID, + } + + bz, err := marshalDelimitedFn(&cve) + s.Require().NoError(err) + + extSig0, err := s.vals[0].privKey.Sign(bz) + s.Require().NoError(err) + + extSig2, err := s.vals[2].privKey.Sign(bz) + s.Require().NoError(err) + + s.ctx = s.ctx.WithBlockHeight(3).WithHeaderInfo(header.Info{Height: 3, ChainID: chainID}) // vote-extensions are enabled + + llc := abci.ExtendedCommitInfo{ + Round: 0, + Votes: []abci.ExtendedVoteInfo{ + { + Validator: s.vals[0].toValidator(333), + VoteExtension: ext, + ExtensionSignature: extSig0, + BlockIdFlag: cmtproto.BlockIDFlagCommit, + }, + // validator of power <1/3 is missing, so commit-info shld still be valid + { + Validator: s.vals[1].toValidator(333), + BlockIdFlag: cmtproto.BlockIDFlagAbsent, + }, + { + Validator: s.vals[2].toValidator(334), + VoteExtension: ext, + ExtensionSignature: extSig2, + BlockIdFlag: cmtproto.BlockIDFlagCommit, + }, + }, + } + + llc, info := extendedCommitToLastCommit(llc) + s.ctx = s.ctx.WithCometInfo(info) + + // expect-pass (votes of height 2 are included in next block) + s.Require().NoError(baseapp.ValidateVoteExtensions(s.ctx, s.valStore, 0, "", llc)) +} + +// check ValidateVoteExtensions works with duplicate votes +func (s *ABCIUtilsTestSuite) TestValidateVoteExtensionsDuplicateVotes() { + ext := []byte("vote-extension") + cve := cmtproto.CanonicalVoteExtension{ + Extension: ext, + Height: 2, + Round: int64(0), + ChainId: chainID, + } + + bz, err := marshalDelimitedFn(&cve) + s.Require().NoError(err) + + extSig0, err := s.vals[0].privKey.Sign(bz) + s.Require().NoError(err) + + ve := abci.ExtendedVoteInfo{ + Validator: s.vals[0].toValidator(333), + VoteExtension: ext, + ExtensionSignature: extSig0, + BlockIdFlag: cmtproto.BlockIDFlagCommit, + } + + ve2 := abci.ExtendedVoteInfo{ + Validator: s.vals[0].toValidator(334), // use diff voting-power to dupe + VoteExtension: ext, + ExtensionSignature: extSig0, + BlockIdFlag: cmtproto.BlockIDFlagCommit, + } + + llc := abci.ExtendedCommitInfo{ + Round: 0, + Votes: []abci.ExtendedVoteInfo{ + ve, + ve2, + }, + } + + s.ctx = s.ctx.WithBlockHeight(3).WithHeaderInfo(header.Info{Height: 3, ChainID: chainID}) // vote-extensions are enabled + llc, info := extendedCommitToLastCommit(llc) + s.ctx = s.ctx.WithCometInfo(info) + + // expect fail (duplicate votes) + s.Require().Error(baseapp.ValidateVoteExtensions(s.ctx, s.valStore, 0, "", llc)) +} + +// check ValidateVoteExtensions works when a single node has submitted a BlockID_Nil +func (s *ABCIUtilsTestSuite) TestValidateVoteExtensionsSingleVoteNil() { + ext := []byte("vote-extension") + cve := cmtproto.CanonicalVoteExtension{ + Extension: ext, + Height: 2, + Round: int64(0), + ChainId: chainID, + } + + bz, err := marshalDelimitedFn(&cve) + s.Require().NoError(err) + + extSig0, err := s.vals[0].privKey.Sign(bz) + s.Require().NoError(err) + + extSig2, err := s.vals[2].privKey.Sign(bz) + s.Require().NoError(err) + + llc := abci.ExtendedCommitInfo{ + Round: 0, + Votes: []abci.ExtendedVoteInfo{ + { + Validator: s.vals[0].toValidator(333), + VoteExtension: ext, + ExtensionSignature: extSig0, + BlockIdFlag: cmtproto.BlockIDFlagCommit, + }, + // validator of power <1/3 is missing, so commit-info should still be valid + { + Validator: s.vals[1].toValidator(333), + BlockIdFlag: cmtproto.BlockIDFlagNil, + }, + { + Validator: s.vals[2].toValidator(334), + VoteExtension: ext, + ExtensionSignature: extSig2, + BlockIdFlag: cmtproto.BlockIDFlagCommit, + }, + }, + } + + s.ctx = s.ctx.WithBlockHeight(3).WithHeaderInfo(header.Info{Height: 3, ChainID: chainID}) // vote-extensions are enabled + + // create last commit + llc, info := extendedCommitToLastCommit(llc) + s.ctx = s.ctx.WithCometInfo(info) + + // expect-pass (votes of height 2 are included in next block) + s.Require().NoError(baseapp.ValidateVoteExtensions(s.ctx, s.valStore, 0, "", llc)) +} + +// check ValidateVoteExtensions works when two nodes have submitted a BlockID_Nil / BlockID_Absent +func (s *ABCIUtilsTestSuite) TestValidateVoteExtensionsTwoVotesNilAbsent() { + ext := []byte("vote-extension") + cve := cmtproto.CanonicalVoteExtension{ + Extension: ext, + Height: 2, + Round: int64(0), + ChainId: chainID, + } + + bz, err := marshalDelimitedFn(&cve) + s.Require().NoError(err) + + extSig0, err := s.vals[0].privKey.Sign(bz) + s.Require().NoError(err) + + llc := abci.ExtendedCommitInfo{ + Round: 0, + Votes: []abci.ExtendedVoteInfo{ + // validator of power >2/3 is missing, so commit-info should not be valid + { + Validator: s.vals[0].toValidator(333), + BlockIdFlag: cmtproto.BlockIDFlagCommit, + VoteExtension: ext, + ExtensionSignature: extSig0, + }, + { + Validator: s.vals[1].toValidator(333), + BlockIdFlag: cmtproto.BlockIDFlagNil, + }, + { + Validator: s.vals[2].toValidator(334), + VoteExtension: ext, + BlockIdFlag: cmtproto.BlockIDFlagAbsent, + }, + }, + } + + s.ctx = s.ctx.WithBlockHeight(3).WithHeaderInfo(header.Info{Height: 3, ChainID: chainID}) // vote-extensions are enabled + + // create last commit + llc, info := extendedCommitToLastCommit(llc) + s.ctx = s.ctx.WithCometInfo(info) + + // expect-pass (votes of height 2 are included in next block) + s.Require().Error(baseapp.ValidateVoteExtensions(s.ctx, s.valStore, 0, "", llc)) +} + +func (s *ABCIUtilsTestSuite) TestValidateVoteExtensionsIncorrectVotingPower() { + ext := []byte("vote-extension") + cve := cmtproto.CanonicalVoteExtension{ + Extension: ext, + Height: 2, + Round: int64(0), + ChainId: chainID, + } + + bz, err := marshalDelimitedFn(&cve) + s.Require().NoError(err) + + extSig0, err := s.vals[0].privKey.Sign(bz) + s.Require().NoError(err) + + llc := abci.ExtendedCommitInfo{ + Round: 0, + Votes: []abci.ExtendedVoteInfo{ + // validator of power >2/3 is missing, so commit-info should not be valid + { + Validator: s.vals[0].toValidator(333), + BlockIdFlag: cmtproto.BlockIDFlagCommit, + VoteExtension: ext, + ExtensionSignature: extSig0, + }, + { + Validator: s.vals[1].toValidator(333), + BlockIdFlag: cmtproto.BlockIDFlagNil, + }, + { + Validator: s.vals[2].toValidator(334), + VoteExtension: ext, + BlockIdFlag: cmtproto.BlockIDFlagAbsent, + }, + }, + } + + s.ctx = s.ctx.WithBlockHeight(3).WithHeaderInfo(header.Info{Height: 3, ChainID: chainID}) // vote-extensions are enabled + + // create last commit + llc, info := extendedCommitToLastCommit(llc) + s.ctx = s.ctx.WithCometInfo(info) + + // modify voting powers to differ from the last-commit + llc.Votes[0].Validator.Power = 335 + llc.Votes[2].Validator.Power = 332 + + // expect-pass (votes of height 2 are included in next block) + s.Require().Error(baseapp.ValidateVoteExtensions(s.ctx, s.valStore, 0, "", llc)) +} + +func (s *ABCIUtilsTestSuite) TestValidateVoteExtensionsIncorrectOrder() { + ext := []byte("vote-extension") + cve := cmtproto.CanonicalVoteExtension{ + Extension: ext, + Height: 2, + Round: int64(0), + ChainId: chainID, + } + + bz, err := marshalDelimitedFn(&cve) + s.Require().NoError(err) + + extSig0, err := s.vals[0].privKey.Sign(bz) + s.Require().NoError(err) + + llc := abci.ExtendedCommitInfo{ + Round: 0, + Votes: []abci.ExtendedVoteInfo{ + // validator of power >2/3 is missing, so commit-info should not be valid + { + Validator: s.vals[0].toValidator(333), + BlockIdFlag: cmtproto.BlockIDFlagCommit, + VoteExtension: ext, + ExtensionSignature: extSig0, + }, + { + Validator: s.vals[1].toValidator(333), + BlockIdFlag: cmtproto.BlockIDFlagNil, + }, + { + Validator: s.vals[2].toValidator(334), + VoteExtension: ext, + BlockIdFlag: cmtproto.BlockIDFlagAbsent, + }, + }, + } + + s.ctx = s.ctx.WithBlockHeight(3).WithHeaderInfo(header.Info{Height: 3, ChainID: chainID}) // vote-extensions are enabled + + // create last commit + llc, info := extendedCommitToLastCommit(llc) + s.ctx = s.ctx.WithCometInfo(info) + + // modify voting powers to differ from the last-commit + llc.Votes[0], llc.Votes[2] = llc.Votes[2], llc.Votes[0] + + // expect-pass (votes of height 2 are included in next block) + s.Require().Error(baseapp.ValidateVoteExtensions(s.ctx, s.valStore, 0, "", llc)) +} + +func (s *ABCIUtilsTestSuite) TestDefaultProposalHandler_NoOpMempoolTxSelection() { + // create a codec for marshaling + cdc := codectestutil.CodecOptions{}.NewCodec() + baseapptestutil.RegisterInterfaces(cdc.InterfaceRegistry()) + + // create a baseapp along with a tx config for tx generation + txConfig := authtx.NewTxConfig(cdc, authtx.DefaultSignModes) + app := baseapp.NewBaseApp(s.T().Name(), log.NewNopLogger(), dbm.NewMemDB(), txConfig.TxDecoder()) + + // create a proposal handler + ph := baseapp.NewDefaultProposalHandler(mempool.NoOpMempool{}, app) + handler := ph.PrepareProposalHandler() + + // build a tx + _, _, addr := testdata.KeyTestPubAddr() + builder := txConfig.NewTxBuilder() + s.Require().NoError(builder.SetMsgs( + &baseapptestutil.MsgCounter{Counter: 0, FailOnHandler: false, Signer: addr.String()}, + )) + builder.SetGasLimit(100) + setTxSignature(s.T(), builder, 0) + + // encode the tx to be used in the proposal request + tx := builder.GetTx() + txBz, err := txConfig.TxEncoder()(tx) + s.Require().NoError(err) + s.Require().Len(txBz, 152) + + testCases := map[string]struct { + ctx sdk.Context + req *abci.RequestPrepareProposal + expectedTxs int + }{ + "small max tx bytes": { + ctx: s.ctx, + req: &abci.RequestPrepareProposal{ + Txs: [][]byte{txBz, txBz, txBz, txBz, txBz}, + MaxTxBytes: 10, + }, + expectedTxs: 0, + }, + "small max gas": { + ctx: s.ctx.WithConsensusParams(cmtproto.ConsensusParams{ + Block: &cmtproto.BlockParams{ + MaxGas: 10, + }, + }), + req: &abci.RequestPrepareProposal{ + Txs: [][]byte{txBz, txBz, txBz, txBz, txBz}, + MaxTxBytes: 456, + }, + expectedTxs: 0, + }, + "large max tx bytes": { + ctx: s.ctx, + req: &abci.RequestPrepareProposal{ + Txs: [][]byte{txBz, txBz, txBz, txBz, txBz}, + MaxTxBytes: 456, + }, + expectedTxs: 3, + }, + "max gas and tx bytes": { + ctx: s.ctx.WithConsensusParams(cmtproto.ConsensusParams{ + Block: &cmtproto.BlockParams{ + MaxGas: 200, + }, + }), + req: &abci.RequestPrepareProposal{ + Txs: [][]byte{txBz, txBz, txBz, txBz, txBz}, + MaxTxBytes: 456, + }, + expectedTxs: 2, + }, + } + + for name, tc := range testCases { + s.Run(name, func() { + // iterate multiple times to ensure the tx selector is cleared each time + for i := 0; i < 5; i++ { + resp, err := handler(tc.ctx, tc.req) + s.Require().NoError(err) + s.Require().Len(resp.Txs, tc.expectedTxs) + } + }) + } +} + +func (s *ABCIUtilsTestSuite) TestDefaultProposalHandler_PriorityNonceMempoolTxSelection() { + cdc := codectestutil.CodecOptions{}.NewCodec() + baseapptestutil.RegisterInterfaces(cdc.InterfaceRegistry()) + txConfig := authtx.NewTxConfig(cdc, authtx.DefaultSignModes) + + var ( + secret1 = []byte("secret1") + secret2 = []byte("secret2") + secret3 = []byte("secret3") + secret4 = []byte("secret4") + secret5 = []byte("secret5") + secret6 = []byte("secret6") + ) + + type testTx struct { + tx sdk.Tx + priority int64 + bz []byte + size int + } + + testTxs := []testTx{ + // test 1 + {tx: buildMsg(s.T(), txConfig, []byte(`0`), [][]byte{secret1}, []uint64{1}), priority: 10}, + {tx: buildMsg(s.T(), txConfig, []byte(`12345678910`), [][]byte{secret1}, []uint64{2}), priority: 10}, + {tx: buildMsg(s.T(), txConfig, []byte(`22`), [][]byte{secret1}, []uint64{3}), priority: 10}, + {tx: buildMsg(s.T(), txConfig, []byte(`32`), [][]byte{secret2}, []uint64{1}), priority: 8}, + // test 2 + {tx: buildMsg(s.T(), txConfig, []byte(`4`), [][]byte{secret1, secret2}, []uint64{3, 3}), priority: 10}, + {tx: buildMsg(s.T(), txConfig, []byte(`52345678910`), [][]byte{secret1, secret3}, []uint64{4, 3}), priority: 10}, + {tx: buildMsg(s.T(), txConfig, []byte(`62`), [][]byte{secret1, secret4}, []uint64{5, 3}), priority: 8}, + {tx: buildMsg(s.T(), txConfig, []byte(`72`), [][]byte{secret3, secret5}, []uint64{4, 3}), priority: 8}, + {tx: buildMsg(s.T(), txConfig, []byte(`82`), [][]byte{secret2, secret6}, []uint64{4, 3}), priority: 8}, + // test 3 + {tx: buildMsg(s.T(), txConfig, []byte(`9`), [][]byte{secret3, secret4}, []uint64{3, 3}), priority: 10}, + {tx: buildMsg(s.T(), txConfig, []byte(`1052345678910`), [][]byte{secret1, secret2}, []uint64{4, 4}), priority: 8}, + {tx: buildMsg(s.T(), txConfig, []byte(`11`), [][]byte{secret1, secret2}, []uint64{5, 5}), priority: 8}, + // test 4 + {tx: buildMsg(s.T(), txConfig, []byte(`1252345678910`), [][]byte{secret1}, []uint64{3}), priority: 10}, + {tx: buildMsg(s.T(), txConfig, []byte(`13`), [][]byte{secret1}, []uint64{5}), priority: 10}, + {tx: buildMsg(s.T(), txConfig, []byte(`14`), [][]byte{secret1}, []uint64{6}), priority: 8}, + } + + for i := range testTxs { + bz, err := txConfig.TxEncoder()(testTxs[i].tx) + s.Require().NoError(err) + testTxs[i].bz = bz + testTxs[i].size = int(cmttypes.ComputeProtoSizeForTxs([]cmttypes.Tx{bz})) + } + + s.Require().Equal(testTxs[0].size, 111) + s.Require().Equal(testTxs[1].size, 121) + s.Require().Equal(testTxs[2].size, 112) + s.Require().Equal(testTxs[3].size, 112) + s.Require().Equal(testTxs[4].size, 195) + s.Require().Equal(testTxs[5].size, 205) + s.Require().Equal(testTxs[6].size, 196) + s.Require().Equal(testTxs[7].size, 196) + s.Require().Equal(testTxs[8].size, 196) + + testCases := map[string]struct { + ctx sdk.Context + txInputs []testTx + req *abci.RequestPrepareProposal + handler sdk.PrepareProposalHandler + expectedTxs []int + }{ + "skip same-sender non-sequential sequence and then add others txs": { + ctx: s.ctx, + txInputs: []testTx{testTxs[0], testTxs[1], testTxs[2], testTxs[3]}, + req: &abci.RequestPrepareProposal{ + MaxTxBytes: 111 + 112, + }, + expectedTxs: []int{0, 3}, + }, + "skip multi-signers msg non-sequential sequence": { + ctx: s.ctx, + txInputs: []testTx{testTxs[4], testTxs[5], testTxs[6], testTxs[7], testTxs[8]}, + req: &abci.RequestPrepareProposal{ + MaxTxBytes: 195 + 196, + }, + expectedTxs: []int{4, 8}, + }, + "only the first tx is added": { + // Because tx 10 is valid, tx 11 can't be valid as they have higher sequence numbers. + ctx: s.ctx, + txInputs: []testTx{testTxs[9], testTxs[10], testTxs[11]}, + req: &abci.RequestPrepareProposal{ + MaxTxBytes: 195 + 196, + }, + expectedTxs: []int{9}, + }, + "no txs added": { + // Becasuse the first tx was deemed valid but too big, the next expected valid sequence is tx[0].seq (3), so + // the rest of the txs fail because they have a seq of 4. + ctx: s.ctx, + txInputs: []testTx{testTxs[12], testTxs[13], testTxs[14]}, + req: &abci.RequestPrepareProposal{ + MaxTxBytes: 112, + }, + expectedTxs: []int{}, + }, + } + + for name, tc := range testCases { + s.Run(name, func() { + ctrl := gomock.NewController(s.T()) + app := mock.NewMockProposalTxVerifier(ctrl) + mp := mempool.NewPriorityMempool( + mempool.PriorityNonceMempoolConfig[int64]{ + TxPriority: mempool.NewDefaultTxPriority(), + MaxTx: 0, + SignerExtractor: mempool.NewDefaultSignerExtractionAdapter(), + }, + ) + + ph := baseapp.NewDefaultProposalHandler(mp, app) + + for _, v := range tc.txInputs { + app.EXPECT().PrepareProposalVerifyTx(v.tx).Return(v.bz, nil).AnyTimes() + s.NoError(mp.Insert(s.ctx.WithPriority(v.priority), v.tx)) + tc.req.Txs = append(tc.req.Txs, v.bz) + } + + resp, err := ph.PrepareProposalHandler()(tc.ctx, tc.req) + s.Require().NoError(err) + respTxIndexes := []int{} + for _, tx := range resp.Txs { + for i, v := range testTxs { + if bytes.Equal(tx, v.bz) { + respTxIndexes = append(respTxIndexes, i) + } + } + } + + s.Require().EqualValues(tc.expectedTxs, respTxIndexes) + }) + } +} + +func marshalDelimitedFn(msg proto.Message) ([]byte, error) { + var buf bytes.Buffer + if err := protoio.NewDelimitedWriter(&buf).WriteMsg(msg); err != nil { + return nil, err + } + + return buf.Bytes(), nil +} + +func buildMsg(t *testing.T, txConfig client.TxConfig, value []byte, secrets [][]byte, nonces []uint64) sdk.Tx { + t.Helper() + builder := txConfig.NewTxBuilder() + _ = builder.SetMsgs( + &baseapptestutil.MsgKeyValue{Value: value}, + ) + require.Equal(t, len(secrets), len(nonces)) + signatures := make([]signingtypes.SignatureV2, 0) + for index, secret := range secrets { + nonce := nonces[index] + privKey := secp256k1.GenPrivKeyFromSecret(secret) + pubKey := privKey.PubKey() + signatures = append(signatures, signingtypes.SignatureV2{ + PubKey: pubKey, + Sequence: nonce, + Data: &signingtypes.SingleSignatureData{}, + }) + } + setTxSignatureWithSecret(t, builder, signatures...) + return builder.GetTx() +} + +func setTxSignatureWithSecret(t *testing.T, builder client.TxBuilder, signatures ...signingtypes.SignatureV2) { + t.Helper() + err := builder.SetSignatures( + signatures..., + ) + require.NoError(t, err) +} + +func extendedCommitToLastCommit(ec abci.ExtendedCommitInfo) (abci.ExtendedCommitInfo, comet.BlockInfo) { + // sort the extended commit info + sort.Sort(extendedVoteInfos(ec.Votes)) + + // convert the extended commit info to last commit info + lastCommit := abci.CommitInfo{ + Round: ec.Round, + Votes: make([]abci.VoteInfo, len(ec.Votes)), + } + + for i, vote := range ec.Votes { + lastCommit.Votes[i] = abci.VoteInfo{ + Validator: abci.Validator{ + Address: vote.Validator.Address, + Power: vote.Validator.Power, + }, + } + } + + return ec, baseapp.NewBlockInfo( + nil, + nil, + nil, + lastCommit, + ) +} + +type extendedVoteInfos []abci.ExtendedVoteInfo + +func (v extendedVoteInfos) Len() int { + return len(v) +} + +func (v extendedVoteInfos) Less(i, j int) bool { + if v[i].Validator.Power == v[j].Validator.Power { + return bytes.Compare(v[i].Validator.Address, v[j].Validator.Address) == -1 + } + return v[i].Validator.Power > v[j].Validator.Power +} + +func (v extendedVoteInfos) Swap(i, j int) { + v[i], v[j] = v[j], v[i] +} diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 5e548dc77bb6..784e5bdf438a 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -3,25 +3,28 @@ package baseapp import ( "context" "fmt" - "sort" + "maps" + "math" + "slices" "strconv" - errorsmod "cosmossdk.io/errors" - "cosmossdk.io/log" "github.com/cockroachdb/errors" abci "github.com/cometbft/cometbft/abci/types" "github.com/cometbft/cometbft/crypto/tmhash" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/gogoproto/proto" - "golang.org/x/exp/maps" protov2 "google.golang.org/protobuf/proto" + "cosmossdk.io/core/header" + errorsmod "cosmossdk.io/errors" + "cosmossdk.io/log" "cosmossdk.io/store" storemetrics "cosmossdk.io/store/metrics" "cosmossdk.io/store/snapshots" storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/baseapp/oe" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" servertypes "github.com/cosmos/cosmos-sdk/server/types" @@ -43,13 +46,14 @@ type ( ) const ( - execModeCheck execMode = iota // Check a transaction - execModeReCheck // Recheck a (pending) transaction after a commit - execModeSimulate // Simulate a transaction - execModePrepareProposal // Prepare a block proposal - execModeProcessProposal // Process a block proposal - execModeVoteExtension // Extend or verify a pre-commit vote - execModeFinalize // Finalize a block proposal + execModeCheck execMode = iota // Check a transaction + execModeReCheck // Recheck a (pending) transaction after a commit + execModeSimulate // Simulate a transaction + execModePrepareProposal // Prepare a block proposal + execModeProcessProposal // Process a block proposal + execModeVoteExtension // Extend or verify a pre-commit vote + execModeVerifyVoteExtension // Verify a vote extension + execModeFinalize // Finalize a block proposal ) var _ servertypes.ABCI = (*BaseApp)(nil) @@ -71,9 +75,10 @@ type BaseApp struct { mempool mempool.Mempool // application side mempool anteHandler sdk.AnteHandler // ante handler for fee and auth - postHandler sdk.PostHandler // post handler, optional, e.g. for tips + postHandler sdk.PostHandler // post handler, optional initChainer sdk.InitChainer // ABCI InitChain handler + preBlocker sdk.PreBlocker // logic to run before BeginBlocker beginBlocker sdk.BeginBlocker // (legacy ABCI) BeginBlock handler endBlocker sdk.EndBlocker // (legacy ABCI) EndBlock handler processProposal sdk.ProcessProposalHandler // ABCI ProcessProposal handler @@ -86,6 +91,7 @@ type BaseApp struct { addrPeerFilter sdk.PeerFilter // filter peers by address and port idPeerFilter sdk.PeerFilter // filter peers by node ID fauxMerkleMode bool // if true, IAVL MountStores uses MountStoresDB for simulation speed. + sigverifyTx bool // in the simulation test, since the account does not have a private key, we have to ignore the tx sigverify. // manages snapshots, i.e. dumps of app state at certain intervals snapshotManager *snapshots.Manager @@ -103,11 +109,6 @@ type BaseApp struct { // previous block's state. This state is never committed. In case of multiple // consensus rounds, the state is always reset to the previous block's state. // - // - voteExtensionState: Used for ExtendVote and VerifyVoteExtension, which is - // set based on the previous block's state. This state is never committed. In - // case of multiple rounds, the state is always reset to the previous block's - // state. - // // - processProposalState: Used for ProcessProposal, which is set based on the // the previous block's state. This state is never committed. In case of // multiple rounds, the state is always reset to the previous block's state. @@ -117,7 +118,6 @@ type BaseApp struct { checkState *state prepareProposalState *state processProposalState *state - voteExtensionState *state finalizeBlockState *state // An inter-block write-through cache provided to the context during the ABCI @@ -128,6 +128,9 @@ type BaseApp struct { // application parameter store. paramStore ParamStore + // queryGasLimit defines the maximum gas for queries; unbounded if 0. + queryGasLimit uint64 + // The minimum gas prices a validator is willing to accept for processing a // transaction. This is mainly used for DoS and spam prevention. minGasPrices sdk.DecCoins @@ -179,6 +182,21 @@ type BaseApp struct { chainID string cdc codec.Codec + + // optimisticExec contains the context required for Optimistic Execution, + // including the goroutine handling.This is experimental and must be enabled + // by developers. + optimisticExec *oe.OptimisticExecution + + // disableBlockGasMeter will disable the block gas meter if true, block gas meter is tricky to support + // when executing transactions in parallel. + // when disabled, the block gas meter in context is a noop one. + // + // SAFETY: it's safe to do if validators validate the total gas wanted in the `ProcessProposal`, which is the case in the default handler. + disableBlockGasMeter bool + + // includeNestedMsgsGas holds a set of message types for which gas costs for its nested messages are calculated. + includeNestedMsgsGas map[string]struct{} } // NewBaseApp returns a reference to an initialized BaseApp. It accepts a @@ -188,7 +206,7 @@ func NewBaseApp( name string, logger log.Logger, db dbm.DB, txDecoder sdk.TxDecoder, options ...func(*BaseApp), ) *BaseApp { app := &BaseApp{ - logger: logger, + logger: logger.With(log.ModuleKey, "baseapp"), name: name, db: db, cms: store.NewCommitMultiStore(db, logger, storemetrics.NewNoOpMetrics()), // by default we use a no-op metric gather in store @@ -197,6 +215,8 @@ func NewBaseApp( msgServiceRouter: NewMsgServiceRouter(), txDecoder: txDecoder, fauxMerkleMode: false, + sigverifyTx: true, + queryGasLimit: math.MaxUint64, } for _, option := range options { @@ -224,11 +244,13 @@ func NewBaseApp( if app.interBlockCache != nil { app.cms.SetInterBlockCache(app.interBlockCache) } - + if app.includeNestedMsgsGas == nil { + app.includeNestedMsgsGas = make(map[string]struct{}) + } app.runTxRecoveryMiddleware = newDefaultRecoveryMiddleware() // Initialize with an empty interface registry to avoid nil pointer dereference. - // Unless SetInterfaceRegistry is called with an interface registry with proper address codecs base app will panic. + // Unless SetInterfaceRegistry is called with an interface registry with proper address codecs baseapp will panic. app.cdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) return app @@ -262,10 +284,8 @@ func (app *BaseApp) Trace() bool { // MsgServiceRouter returns the MsgServiceRouter of a BaseApp. func (app *BaseApp) MsgServiceRouter() *MsgServiceRouter { return app.msgServiceRouter } -// SetMsgServiceRouter sets the MsgServiceRouter of a BaseApp. -func (app *BaseApp) SetMsgServiceRouter(msgServiceRouter *MsgServiceRouter) { - app.msgServiceRouter = msgServiceRouter -} +// GRPCQueryRouter returns the GRPCQueryRouter of a BaseApp. +func (app *BaseApp) GRPCQueryRouter() *GRPCQueryRouter { return app.grpcQueryRouter } // MountStores mounts all IAVL or DB stores to the provided keys in the BaseApp // multistore. @@ -318,8 +338,7 @@ func (app *BaseApp) MountTransientStores(keys map[string]*storetypes.TransientSt // MountMemoryStores mounts all in-memory KVStores with the BaseApp's internal // commit multi-store. func (app *BaseApp) MountMemoryStores(keys map[string]*storetypes.MemoryStoreKey) { - skeys := maps.Keys(keys) - sort.Strings(skeys) + skeys := slices.Sorted(maps.Keys(keys)) for _, key := range skeys { memKey := keys[key] app.MountStore(memKey, storetypes.StoreTypeMemory) @@ -393,6 +412,11 @@ func (app *BaseApp) AnteHandler() sdk.AnteHandler { return app.anteHandler } +// Mempool returns the Mempool of the app. +func (app *BaseApp) Mempool() mempool.Mempool { + return app.mempool +} + // Init initializes the app. It seals the app, preventing any // further modifications. In addition, it validates the app against // the earlier provided settings. Returns an error if validation fails. @@ -402,16 +426,16 @@ func (app *BaseApp) Init() error { panic("cannot call initFromMainStore: baseapp already sealed") } + if app.cms == nil { + return errors.New("commit multi-store must not be nil") + } + emptyHeader := cmtproto.Header{ChainID: app.chainID} // needed for the export command which inits from store but never calls initchain app.setState(execModeCheck, emptyHeader) app.Seal() - if app.cms == nil { - return errors.New("commit multi-store must not be nil") - } - return app.cms.GetPruning().Validate() } @@ -456,16 +480,24 @@ func (app *BaseApp) IsSealed() bool { return app.sealed } // setState sets the BaseApp's state for the corresponding mode with a branched // multi-store (i.e. a CacheMultiStore) and a new Context with the same // multi-store branch, and provided header. -func (app *BaseApp) setState(mode execMode, header cmtproto.Header) { +func (app *BaseApp) setState(mode execMode, h cmtproto.Header) { ms := app.cms.CacheMultiStore() + headerInfo := header.Info{ + Height: h.Height, + Time: h.Time, + ChainID: h.ChainID, + AppHash: h.AppHash, + } baseState := &state{ - ms: ms, - ctx: sdk.NewContext(ms, header, false, app.logger).WithStreamingManager(app.streamingManager), + ms: ms, + ctx: sdk.NewContext(ms, h, false, app.logger). + WithStreamingManager(app.streamingManager). + WithHeaderInfo(headerInfo), } switch mode { case execModeCheck: - baseState.ctx = baseState.ctx.WithIsCheckTx(true).WithMinGasPrices(app.minGasPrices) + baseState.SetContext(baseState.Context().WithIsCheckTx(true).WithMinGasPrices(app.minGasPrices)) app.checkState = baseState case execModePrepareProposal: @@ -474,9 +506,6 @@ func (app *BaseApp) setState(mode execMode, header cmtproto.Header) { case execModeProcessProposal: app.processProposalState = baseState - case execModeVoteExtension: - app.voteExtensionState = baseState - case execModeFinalize: app.finalizeBlockState = baseState @@ -485,18 +514,6 @@ func (app *BaseApp) setState(mode execMode, header cmtproto.Header) { } } -// GetFinalizeBlockStateCtx returns the Context associated with the FinalizeBlock -// state. This Context can be used to write data derived from processing vote -// extensions to application state during ProcessProposal. -// -// NOTE: -// - Do NOT use or write to state using this Context unless you intend for -// that state to be committed. -// - Do NOT use or write to state using this Context on the first block. -func (app *BaseApp) GetFinalizeBlockStateCtx() sdk.Context { - return app.finalizeBlockState.ctx -} - // SetCircuitBreaker sets the circuit breaker for the BaseApp. // The circuit breaker is checked on every message execution to verify if a transaction should be executed or not. func (app *BaseApp) SetCircuitBreaker(cb CircuitBreaker) { @@ -515,7 +532,11 @@ func (app *BaseApp) GetConsensusParams(ctx sdk.Context) cmtproto.ConsensusParams cp, err := app.paramStore.Get(ctx) if err != nil { - panic(fmt.Errorf("consensus key is nil: %w", err)) + // This could happen while migrating from v0.45/v0.46 to v0.50, we should + // allow it to happen so during preblock the upgrade plan can be executed + // and the consensus params set for the first time in the new format. + app.logger.Error("failed to get consensus params", "err", err) + return cmtproto.ConsensusParams{} } return cp @@ -528,7 +549,7 @@ func (app *BaseApp) GetConsensusParams(ctx sdk.Context) cmtproto.ConsensusParams // It's stored instead in the x/upgrade store, with its own bump logic. func (app *BaseApp) StoreConsensusParams(ctx sdk.Context, cp cmtproto.ConsensusParams) error { if app.paramStore == nil { - panic("cannot store consensus params with no params store set") + return errors.New("cannot store consensus params with no params store set") } return app.paramStore.Set(ctx, cp) @@ -630,6 +651,10 @@ func (app *BaseApp) getState(mode execMode) *state { } func (app *BaseApp) getBlockGasMeter(ctx sdk.Context) storetypes.GasMeter { + if app.disableBlockGasMeter { + return noopGasMeter{} + } + if maxGas := app.GetMaximumBlockGas(ctx); maxGas > 0 { return storetypes.NewGasMeter(maxGas) } @@ -643,10 +668,13 @@ func (app *BaseApp) getContextForTx(mode execMode, txBytes []byte) sdk.Context { if modeState == nil { panic(fmt.Sprintf("state is nil for mode %v", mode)) } - ctx := modeState.ctx. - WithTxBytes(txBytes) + ctx := modeState.Context(). + WithTxBytes(txBytes). + WithGasMeter(storetypes.NewInfiniteGasMeter()) // WithVoteInfos(app.voteInfos) // TODO: identify if this is needed + ctx = ctx.WithIsSigverifyTx(app.sigverifyTx) + ctx = ctx.WithConsensusParams(app.GetConsensusParams(ctx)) if mode == execModeReCheck { @@ -655,6 +683,7 @@ func (app *BaseApp) getContextForTx(mode execMode, txBytes []byte) sdk.Context { if mode == execModeSimulate { ctx, _ = ctx.CacheContext() + ctx = ctx.WithExecMode(sdk.ExecMode(execModeSimulate)) } return ctx @@ -679,16 +708,38 @@ func (app *BaseApp) cacheTxContext(ctx sdk.Context, txBytes []byte) (sdk.Context return ctx.WithMultiStore(msCache), msCache } -func (app *BaseApp) beginBlock(req *abci.RequestFinalizeBlock) sdk.BeginBlock { +func (app *BaseApp) preBlock(req *abci.RequestFinalizeBlock) ([]abci.Event, error) { + var events []abci.Event + if app.preBlocker != nil { + ctx := app.finalizeBlockState.Context().WithEventManager(sdk.NewEventManager()) + rsp, err := app.preBlocker(ctx, req) + if err != nil { + return nil, err + } + // rsp.ConsensusParamsChanged is true from preBlocker means ConsensusParams in store get changed + // write the consensus parameters in store to context + if rsp.ConsensusParamsChanged { + ctx = ctx.WithConsensusParams(app.GetConsensusParams(ctx)) + // GasMeter must be set after we get a context with updated consensus params. + gasMeter := app.getBlockGasMeter(ctx) + ctx = ctx.WithBlockGasMeter(gasMeter) + app.finalizeBlockState.SetContext(ctx) + } + events = ctx.EventManager().ABCIEvents() + } + return events, nil +} + +func (app *BaseApp) beginBlock(_ *abci.RequestFinalizeBlock) (sdk.BeginBlock, error) { var ( resp sdk.BeginBlock err error ) if app.beginBlocker != nil { - resp, err = app.beginBlocker(app.finalizeBlockState.ctx) + resp, err = app.beginBlocker(app.finalizeBlockState.Context()) if err != nil { - panic(err) + return resp, err } // append BeginBlock attributes to all events in the EndBlock response @@ -702,7 +753,7 @@ func (app *BaseApp) beginBlock(req *abci.RequestFinalizeBlock) sdk.BeginBlock { resp.Events = sdk.MarkEventsToIndex(resp.Events, app.indexEvents) } - return resp + return resp, nil } func (app *BaseApp) deliverTx(tx []byte) *abci.ExecTxResult { @@ -744,13 +795,13 @@ func (app *BaseApp) deliverTx(tx []byte) *abci.ExecTxResult { // endBlock is an application-defined function that is called after transactions // have been processed in FinalizeBlock. -func (app *BaseApp) endBlock(ctx context.Context) (sdk.EndBlock, error) { +func (app *BaseApp) endBlock(_ context.Context) (sdk.EndBlock, error) { var endblock sdk.EndBlock if app.endBlocker != nil { - eb, err := app.endBlocker(app.finalizeBlockState.ctx) + eb, err := app.endBlocker(app.finalizeBlockState.Context()) if err != nil { - panic(err) + return endblock, err } // append EndBlock attributes to all events in the EndBlock response @@ -768,6 +819,10 @@ func (app *BaseApp) endBlock(ctx context.Context) (sdk.EndBlock, error) { return endblock, nil } +type HasNestedMsgs interface { + GetMsgs() ([]sdk.Msg, error) +} + // runTx processes a transaction within a given execution mode, encoded transaction // bytes, and the decoded transaction itself. All state transitions occur through // a cached Context depending on the mode provided. State only gets persisted @@ -793,6 +848,7 @@ func (app *BaseApp) runTx(mode execMode, txBytes []byte) (gInfo sdk.GasInfo, res if r := recover(); r != nil { recoveryMW := newOutOfGasRecoveryMiddleware(gasWanted, ctx, app.runTxRecoveryMiddleware) err, result = processRecovery(r, recoveryMW), nil + ctx.Logger().Error("panic recovered in runTx", "err", err) } gInfo = sdk.GasInfo{GasWanted: gasWanted, GasUsed: ctx.GasMeter().GasConsumed()} @@ -832,6 +888,13 @@ func (app *BaseApp) runTx(mode execMode, txBytes []byte) (gInfo sdk.GasInfo, res return sdk.GasInfo{}, nil, nil, err } + for _, msg := range msgs { + handler := app.msgServiceRouter.Handler(msg) + if handler == nil { + return sdk.GasInfo{}, nil, nil, errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, "no message handler found for %T", msg) + } + } + if app.anteHandler != nil { var ( anteCtx sdk.Context @@ -865,6 +928,12 @@ func (app *BaseApp) runTx(mode execMode, txBytes []byte) (gInfo sdk.GasInfo, res gasWanted = ctx.GasMeter().Limit() if err != nil { + if mode == execModeReCheck { + // if the ante handler fails on recheck, we want to remove the tx from the mempool + if mempoolErr := app.mempool.Remove(tx); mempoolErr != nil { + return gInfo, nil, anteEvents, errors.Join(err, mempoolErr) + } + } return gInfo, nil, nil, err } @@ -897,24 +966,38 @@ func (app *BaseApp) runTx(mode execMode, txBytes []byte) (gInfo sdk.GasInfo, res if err == nil { result, err = app.runMsgs(runMsgCtx, msgs, msgsV2, mode) } - if err == nil { - // Run optional postHandlers. - // - // Note: If the postHandler fails, we also revert the runMsgs state. - if app.postHandler != nil { - // The runMsgCtx context currently contains events emitted by the ante handler. - // We clear this to correctly order events without duplicates. - // Note that the state is still preserved. - postCtx := runMsgCtx.WithEventManager(sdk.NewEventManager()) - - newCtx, err := app.postHandler(postCtx, tx, mode == execModeSimulate, err == nil) - if err != nil { - return gInfo, nil, anteEvents, err + + if mode == execModeSimulate { + for _, msg := range msgs { + nestedErr := app.simulateNestedMessages(ctx, msg) + if nestedErr != nil { + return gInfo, nil, anteEvents, nestedErr } + } + } - result.Events = append(result.Events, newCtx.EventManager().ABCIEvents()...) + // Run optional postHandlers (should run regardless of the execution result). + // + // Note: If the postHandler fails, we also revert the runMsgs state. + if app.postHandler != nil { + // The runMsgCtx context currently contains events emitted by the ante handler. + // We clear this to correctly order events without duplicates. + // Note that the state is still preserved. + postCtx := runMsgCtx.WithEventManager(sdk.NewEventManager()) + + newCtx, errPostHandler := app.postHandler(postCtx, tx, mode == execModeSimulate, err == nil) + if errPostHandler != nil { + return gInfo, nil, anteEvents, errors.Join(err, errPostHandler) } + // we don't want runTx to panic if runMsgs has failed earlier + if result == nil { + result = &sdk.Result{} + } + result.Events = append(result.Events, newCtx.EventManager().ABCIEvents()...) + } + + if err == nil { if mode == execModeFinalize { // When block gas exceeds, it'll panic and won't commit the cached store. consumeBlockGas() @@ -948,7 +1031,7 @@ func (app *BaseApp) runMsgs(ctx sdk.Context, msgs []sdk.Msg, msgsV2 []protov2.Me handler := app.msgServiceRouter.Handler(msg) if handler == nil { - return nil, errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, "can't route message %+v", msg) + return nil, errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, "no message handler found for %T", msg) } // ADR 031 request type routing @@ -958,7 +1041,10 @@ func (app *BaseApp) runMsgs(ctx sdk.Context, msgs []sdk.Msg, msgsV2 []protov2.Me } // create message events - msgEvents := createEvents(app.cdc, msgResult.GetEvents(), msg, msgsV2[i]) + msgEvents, err := createEvents(app.cdc, msgResult.GetEvents(), msg, msgsV2[i]) + if err != nil { + return nil, errorsmod.Wrapf(err, "failed to create message events; message index: %d", i) + } // append message events and data // @@ -998,24 +1084,67 @@ func (app *BaseApp) runMsgs(ctx sdk.Context, msgs []sdk.Msg, msgsV2 []protov2.Me }, nil } +// simulateNestedMessages simulates a message nested messages. +func (app *BaseApp) simulateNestedMessages(ctx sdk.Context, msg sdk.Msg) error { + nestedMsgs, ok := msg.(HasNestedMsgs) + if !ok { + return nil + } + + msgs, err := nestedMsgs.GetMsgs() + if err != nil { + return err + } + + if err := validateBasicTxMsgs(app.msgServiceRouter, msgs); err != nil { + return err + } + + for _, msg := range msgs { + err = app.simulateNestedMessages(ctx, msg) + if err != nil { + return err + } + } + + protoMessages := make([]protoreflect.Message, len(msgs)) + for i, msg := range msgs { + _, protoMsg, err := app.cdc.GetMsgSigners(msg) + if err != nil { + return err + } + protoMessages[i] = protoMsg + } + + initialGas := ctx.GasMeter().GasConsumed() + _, err = app.runMsgs(ctx, msgs, protoMessages, execModeSimulate) + if err == nil { + if _, includeGas := app.includeNestedMsgsGas[sdk.MsgTypeURL(msg)]; !includeGas { + consumedGas := ctx.GasMeter().GasConsumed() - initialGas + ctx.GasMeter().RefundGas(consumedGas, "simulation of nested messages") + } + } + return err +} + // makeABCIData generates the Data field to be sent to ABCI Check/DeliverTx. func makeABCIData(msgResponses []*codectypes.Any) ([]byte, error) { return proto.Marshal(&sdk.TxMsgData{MsgResponses: msgResponses}) } -func createEvents(cdc codec.Codec, events sdk.Events, msg sdk.Msg, msgV2 protov2.Message) sdk.Events { +func createEvents(cdc codec.Codec, events sdk.Events, msg sdk.Msg, msgV2 protov2.Message) (sdk.Events, error) { eventMsgName := sdk.MsgTypeURL(msg) msgEvent := sdk.NewEvent(sdk.EventTypeMessage, sdk.NewAttribute(sdk.AttributeKeyAction, eventMsgName)) // we set the signer attribute as the sender signers, err := cdc.GetMsgV2Signers(msgV2) if err != nil { - panic(err) + return nil, err } if len(signers) > 0 && signers[0] != nil { addrStr, err := cdc.InterfaceRegistry().SigningContext().AddressCodec().BytesToString(signers[0]) if err != nil { - panic(err) + return nil, err } msgEvent = msgEvent.AppendAttributes(sdk.NewAttribute(sdk.AttributeKeySender, addrStr)) } @@ -1027,7 +1156,7 @@ func createEvents(cdc codec.Codec, events sdk.Events, msg sdk.Msg, msgV2 protov2 } } - return sdk.Events{msgEvent}.AppendEvents(events) + return sdk.Events{msgEvent}.AppendEvents(events), nil } // PrepareProposalVerifyTx performs transaction verification when a proposer is @@ -1068,7 +1197,37 @@ func (app *BaseApp) ProcessProposalVerifyTx(txBz []byte) (sdk.Tx, error) { return tx, nil } +func (app *BaseApp) TxDecode(txBytes []byte) (sdk.Tx, error) { + return app.txDecoder(txBytes) +} + +func (app *BaseApp) TxEncode(tx sdk.Tx) ([]byte, error) { + return app.txEncoder(tx) +} + // Close is called in start cmd to gracefully cleanup resources. func (app *BaseApp) Close() error { - return nil + var errs []error + + // Close app.db (opened by cosmos-sdk/server/start.go call to openDB) + if app.db != nil { + app.logger.Info("Closing application.db") + if err := app.db.Close(); err != nil { + errs = append(errs, err) + } + } + + // Close app.snapshotManager + // - opened when app chains use cosmos-sdk/server/util.go/DefaultBaseappOptions (boilerplate) + // - which calls cosmos-sdk/server/util.go/GetSnapshotStore + // - which is passed to baseapp/options.go/SetSnapshot + // - to set app.snapshotManager = snapshots.NewManager + if app.snapshotManager != nil { + app.logger.Info("Closing snapshots/metadata.db") + if err := app.snapshotManager.Close(); err != nil { + errs = append(errs, err) + } + } + + return errors.Join(errs...) } diff --git a/baseapp/baseapp_test.go b/baseapp/baseapp_test.go index 44c91901f3fc..f847009e8e49 100644 --- a/baseapp/baseapp_test.go +++ b/baseapp/baseapp_test.go @@ -1,25 +1,28 @@ package baseapp_test import ( + "bytes" "context" + "crypto/sha256" "fmt" "math/rand" "testing" "time" - errorsmod "cosmossdk.io/errors" - "cosmossdk.io/log" abci "github.com/cometbft/cometbft/abci/types" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" dbm "github.com/cosmos/cosmos-db" "github.com/stretchr/testify/require" + errorsmod "cosmossdk.io/errors" + "cosmossdk.io/log" "cosmossdk.io/store/metrics" pruningtypes "cosmossdk.io/store/pruning/types" "cosmossdk.io/store/rootmulti" "cosmossdk.io/store/snapshots" snapshottypes "cosmossdk.io/store/snapshots/types" storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/baseapp" baseapptestutil "github.com/cosmos/cosmos-sdk/baseapp/testutil" "github.com/cosmos/cosmos-sdk/client" @@ -43,9 +46,10 @@ var ( type ( BaseAppSuite struct { - baseApp *baseapp.BaseApp - cdc *codec.ProtoCodec - txConfig client.TxConfig + baseApp *baseapp.BaseApp + cdc *codec.ProtoCodec + txConfig client.TxConfig + logBuffer *bytes.Buffer } SnapshotsConfig struct { @@ -63,8 +67,10 @@ func NewBaseAppSuite(t *testing.T, opts ...func(*baseapp.BaseApp)) *BaseAppSuite txConfig := authtx.NewTxConfig(cdc, authtx.DefaultSignModes) db := dbm.NewMemDB() + logBuffer := new(bytes.Buffer) + logger := log.NewLogger(logBuffer, log.ColorOption(false)) - app := baseapp.NewBaseApp(t.Name(), log.NewTestLogger(t), db, txConfig.TxDecoder(), opts...) + app := baseapp.NewBaseApp(t.Name(), logger, db, txConfig.TxDecoder(), opts...) require.Equal(t, t.Name(), app.Name()) app.SetInterfaceRegistry(cdc.InterfaceRegistry()) @@ -78,12 +84,33 @@ func NewBaseAppSuite(t *testing.T, opts ...func(*baseapp.BaseApp)) *BaseAppSuite require.Nil(t, app.LoadLatestVersion()) return &BaseAppSuite{ - baseApp: app, - cdc: cdc, - txConfig: txConfig, + baseApp: app, + cdc: cdc, + txConfig: txConfig, + logBuffer: logBuffer, } } +func getQueryBaseapp(t *testing.T) *baseapp.BaseApp { + t.Helper() + + db := dbm.NewMemDB() + name := t.Name() + app := baseapp.NewBaseApp(name, log.NewTestLogger(t), db, nil) + + _, err := app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 1}) + require.NoError(t, err) + _, err = app.Commit() + require.NoError(t, err) + + _, err = app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 2}) + require.NoError(t, err) + _, err = app.Commit() + require.NoError(t, err) + + return app +} + func NewBaseAppSuiteWithSnapshots(t *testing.T, cfg SnapshotsConfig, opts ...func(*baseapp.BaseApp)) *BaseAppSuite { snapshotTimeout := 1 * time.Minute snapshotStore, err := snapshots.NewStore(dbm.NewMemDB(), testutil.GetTempDir(t)) @@ -100,9 +127,10 @@ func NewBaseAppSuiteWithSnapshots(t *testing.T, cfg SnapshotsConfig, opts ...fun baseapptestutil.RegisterKeyValueServer(suite.baseApp.MsgServiceRouter(), MsgKeyValueImpl{}) - suite.baseApp.InitChain(&abci.RequestInitChain{ + _, err = suite.baseApp.InitChain(&abci.RequestInitChain{ ConsensusParams: &cmtproto.ConsensusParams{}, }) + require.NoError(t, err) r := rand.New(rand.NewSource(3920758213583)) keyCounter := 0 @@ -166,6 +194,40 @@ func NewBaseAppSuiteWithSnapshots(t *testing.T, cfg SnapshotsConfig, opts ...fun return suite } +func TestAnteHandlerGasMeter(t *testing.T) { + // run BeginBlock and assert that the gas meter passed into the first Txn is zeroed out + anteOpt := func(bapp *baseapp.BaseApp) { + bapp.SetAnteHandler(func(ctx sdk.Context, tx sdk.Tx, simulate bool) (newCtx sdk.Context, err error) { + gasMeter := ctx.BlockGasMeter() + require.NotNil(t, gasMeter) + require.Equal(t, storetypes.Gas(0), gasMeter.GasConsumed()) + return ctx, nil + }) + } + // set the beginBlocker to use some gas + beginBlockerOpt := func(bapp *baseapp.BaseApp) { + bapp.SetBeginBlocker(func(ctx sdk.Context) (sdk.BeginBlock, error) { + ctx.BlockGasMeter().ConsumeGas(1, "beginBlocker gas consumption") + return sdk.BeginBlock{}, nil + }) + } + + suite := NewBaseAppSuite(t, anteOpt, beginBlockerOpt) + _, err := suite.baseApp.InitChain(&abci.RequestInitChain{ + ConsensusParams: &cmtproto.ConsensusParams{}, + }) + require.NoError(t, err) + + deliverKey := []byte("deliver-key") + baseapptestutil.RegisterCounterServer(suite.baseApp.MsgServiceRouter(), CounterServerImpl{t, capKey1, deliverKey}) + + tx := newTxCounter(t, suite.txConfig, 0, 0) + txBytes, err := suite.txConfig.TxEncoder()(tx) + require.NoError(t, err) + _, err = suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 1, Txs: [][]byte{txBytes}}) + require.NoError(t, err) +} + func TestLoadVersion(t *testing.T) { logger := log.NewTestLogger(t) pruningOpt := baseapp.SetPruning(pruningtypes.NewPruningOptions(pruningtypes.PruningNothing)) @@ -177,7 +239,9 @@ func TestLoadVersion(t *testing.T) { err := app.LoadLatestVersion() // needed to make stores non-nil require.Nil(t, err) - emptyCommitID := storetypes.CommitID{} + emptyHash := sha256.Sum256([]byte{}) + appHash := emptyHash[:] + emptyCommitID := storetypes.CommitID{Hash: appHash} // fresh store has zero/empty last commit lastHeight := app.LastBlockHeight() @@ -400,6 +464,9 @@ func TestBaseAppOptionSeal(t *testing.T) { require.Panics(t, func() { suite.baseApp.SetInitChainer(nil) }) + require.Panics(t, func() { + suite.baseApp.SetPreBlocker(nil) + }) require.Panics(t, func() { suite.baseApp.SetBeginBlocker(nil) }) @@ -453,11 +520,14 @@ func TestCustomRunTxPanicHandler(t *testing.T) { panic(errorsmod.Wrap(anteErr, "anteHandler")) }) } + suite := NewBaseAppSuite(t, anteOpt) + baseapptestutil.RegisterCounterServer(suite.baseApp.MsgServiceRouter(), NoopCounterServerImpl{}) - suite.baseApp.InitChain(&abci.RequestInitChain{ + _, err := suite.baseApp.InitChain(&abci.RequestInitChain{ ConsensusParams: &cmtproto.ConsensusParams{}, }) + require.NoError(t, err) suite.baseApp.AddRunTxRecoveryHandler(func(recoveryObj interface{}) error { err, ok := recoveryObj.(error) @@ -494,9 +564,10 @@ func TestBaseAppAnteHandler(t *testing.T) { deliverKey := []byte("deliver-key") baseapptestutil.RegisterCounterServer(suite.baseApp.MsgServiceRouter(), CounterServerImpl{t, capKey1, deliverKey}) - suite.baseApp.InitChain(&abci.RequestInitChain{ + _, err := suite.baseApp.InitChain(&abci.RequestInitChain{ ConsensusParams: &cmtproto.ConsensusParams{}, }) + require.NoError(t, err) // execute a tx that will fail ante handler execution // @@ -555,6 +626,60 @@ func TestBaseAppAnteHandler(t *testing.T) { suite.baseApp.Commit() } +func TestBaseAppPostHandler(t *testing.T) { + postHandlerRun := false + anteOpt := func(bapp *baseapp.BaseApp) { + bapp.SetPostHandler(func(ctx sdk.Context, tx sdk.Tx, simulate, success bool) (newCtx sdk.Context, err error) { + postHandlerRun = true + return ctx, nil + }) + } + + suite := NewBaseAppSuite(t, anteOpt) + baseapptestutil.RegisterCounterServer(suite.baseApp.MsgServiceRouter(), CounterServerImpl{t, capKey1, []byte("foo")}) + + _, err := suite.baseApp.InitChain(&abci.RequestInitChain{ + ConsensusParams: &cmtproto.ConsensusParams{}, + }) + require.NoError(t, err) + + // execute a tx that will fail ante handler execution + // + // NOTE: State should not be mutated here. This will be implicitly checked by + // the next txs ante handler execution (anteHandlerTxTest). + tx := newTxCounter(t, suite.txConfig, 0, 0) + txBytes, err := suite.txConfig.TxEncoder()(tx) + require.NoError(t, err) + + res, err := suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 1, Txs: [][]byte{txBytes}}) + require.NoError(t, err) + require.Empty(t, res.Events) + require.True(t, res.TxResults[0].IsOK(), fmt.Sprintf("%v", res)) + + // PostHandler runs on successful message execution + require.True(t, postHandlerRun) + + // It should also run on failed message execution + postHandlerRun = false + tx = setFailOnHandler(suite.txConfig, tx, true) + txBytes, err = suite.txConfig.TxEncoder()(tx) + require.NoError(t, err) + res, err = suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 1, Txs: [][]byte{txBytes}}) + require.NoError(t, err) + require.Empty(t, res.Events) + require.False(t, res.TxResults[0].IsOK(), fmt.Sprintf("%v", res)) + + require.True(t, postHandlerRun) + + // regression test, should not panic when runMsgs fails + tx = wonkyMsg(t, suite.txConfig, tx) + txBytes, err = suite.txConfig.TxEncoder()(tx) + require.NoError(t, err) + _, err = suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 1, Txs: [][]byte{txBytes}}) + require.NoError(t, err) + require.NotContains(t, suite.logBuffer.String(), "panic recovered in runTx") +} + // Test and ensure that invalid block heights always cause errors. // See issues: // - https://github.com/cosmos/cosmos-sdk/issues/11220 @@ -566,31 +691,44 @@ func TestABCI_CreateQueryContext(t *testing.T) { name := t.Name() app := baseapp.NewBaseApp(name, log.NewTestLogger(t), db, nil) - app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 1}) - app.Commit() + _, err := app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 1}) + require.NoError(t, err) + _, err = app.Commit() + require.NoError(t, err) - app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 2}) - app.Commit() + _, err = app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 2}) + require.NoError(t, err) + _, err = app.Commit() + require.NoError(t, err) testCases := []struct { - name string - height int64 - prove bool - expErr bool + name string + height int64 + headerHeight int64 + prove bool + expErr bool }{ - {"valid height", 2, true, false}, - {"future height", 10, true, true}, - {"negative height, prove=true", -1, true, true}, - {"negative height, prove=false", -1, false, true}, + {"valid height", 2, 2, true, false}, + {"valid height with different initial height", 2, 1, true, false}, + {"future height", 10, 10, true, true}, + {"negative height, prove=true", -1, -1, true, true}, + {"negative height, prove=false", -1, -1, false, true}, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - _, err := app.CreateQueryContext(tc.height, tc.prove) + if tc.headerHeight != tc.height { + _, err := app.InitChain(&abci.RequestInitChain{ + InitialHeight: tc.headerHeight, + }) + require.NoError(t, err) + } + ctx, err := app.CreateQueryContext(tc.height, tc.prove) if tc.expErr { require.Error(t, err) } else { require.NoError(t, err) + require.Equal(t, tc.height, ctx.BlockHeight()) } }) } @@ -604,9 +742,65 @@ func TestSetMinGasPrices(t *testing.T) { require.Equal(t, minGasPrices, ctx.MinGasPrices()) } +type ctxType string + +const ( + QueryCtx ctxType = "query" + CheckTxCtx ctxType = "checkTx" +) + +var ctxTypes = []ctxType{QueryCtx, CheckTxCtx} + +func (c ctxType) GetCtx(t *testing.T, bapp *baseapp.BaseApp) sdk.Context { + t.Helper() + if c == QueryCtx { + ctx, err := bapp.CreateQueryContext(1, false) + require.NoError(t, err) + return ctx + } else if c == CheckTxCtx { + return getCheckStateCtx(bapp) + } + // TODO: Not supported yet + return getFinalizeBlockStateCtx(bapp) +} + +func TestQueryGasLimit(t *testing.T) { + testCases := []struct { + queryGasLimit uint64 + gasActuallyUsed uint64 + shouldQueryErr bool + }{ + {queryGasLimit: 100, gasActuallyUsed: 50, shouldQueryErr: false}, // Valid case + {queryGasLimit: 100, gasActuallyUsed: 150, shouldQueryErr: true}, // gasActuallyUsed > queryGasLimit + {queryGasLimit: 0, gasActuallyUsed: 50, shouldQueryErr: false}, // fuzzing with queryGasLimit = 0 + {queryGasLimit: 0, gasActuallyUsed: 0, shouldQueryErr: false}, // both queryGasLimit and gasActuallyUsed are 0 + {queryGasLimit: 200, gasActuallyUsed: 200, shouldQueryErr: false}, // gasActuallyUsed == queryGasLimit + {queryGasLimit: 100, gasActuallyUsed: 1000, shouldQueryErr: true}, // gasActuallyUsed > queryGasLimit + } + + for _, tc := range testCases { + for _, ctxType := range ctxTypes { + t.Run(fmt.Sprintf("%s: %d - %d", ctxType, tc.queryGasLimit, tc.gasActuallyUsed), func(t *testing.T) { + app := getQueryBaseapp(t) + baseapp.SetQueryGasLimit(tc.queryGasLimit)(app) + ctx := ctxType.GetCtx(t, app) + + // query gas limit should have no effect when CtxType != QueryCtx + if tc.shouldQueryErr && ctxType == QueryCtx { + require.Panics(t, func() { ctx.GasMeter().ConsumeGas(tc.gasActuallyUsed, "test") }) + } else { + require.NotPanics(t, func() { ctx.GasMeter().ConsumeGas(tc.gasActuallyUsed, "test") }) + } + }) + } + } +} + func TestGetMaximumBlockGas(t *testing.T) { suite := NewBaseAppSuite(t) - suite.baseApp.InitChain(&abci.RequestInitChain{}) + _, err := suite.baseApp.InitChain(&abci.RequestInitChain{}) + require.NoError(t, err) + ctx := suite.baseApp.NewContext(true) suite.baseApp.StoreConsensusParams(ctx, cmtproto.ConsensusParams{Block: &cmtproto.BlockParams{MaxGas: 0}}) @@ -622,6 +816,17 @@ func TestGetMaximumBlockGas(t *testing.T) { require.Panics(t, func() { suite.baseApp.GetMaximumBlockGas(ctx) }) } +func TestGetEmptyConsensusParams(t *testing.T) { + suite := NewBaseAppSuite(t) + _, err := suite.baseApp.InitChain(&abci.RequestInitChain{}) + require.NoError(t, err) + ctx := suite.baseApp.NewContext(true) + + cp := suite.baseApp.GetConsensusParams(ctx) + require.Equal(t, cmtproto.ConsensusParams{}, cp) + require.Equal(t, uint64(0), suite.baseApp.GetMaximumBlockGas(ctx)) +} + func TestLoadVersionPruning(t *testing.T) { logger := log.NewNopLogger() pruningOptions := pruningtypes.NewCustomPruningOptions(10, 15) @@ -637,7 +842,10 @@ func TestLoadVersionPruning(t *testing.T) { err := app.LoadLatestVersion() // needed to make stores non-nil require.Nil(t, err) - emptyCommitID := storetypes.CommitID{} + emptyHash := sha256.Sum256([]byte{}) + emptyCommitID := storetypes.CommitID{ + Hash: emptyHash[:], + } // fresh store has zero/empty last commit lastHeight := app.LastBlockHeight() diff --git a/baseapp/block_gas_test.go b/baseapp/block_gas_test.go index 518f796fa5f1..443ebc44503b 100644 --- a/baseapp/block_gas_test.go +++ b/baseapp/block_gas_test.go @@ -64,7 +64,7 @@ func TestBaseApp_BlockGas(t *testing.T) { {"less than block gas meter", 10, false, false}, {"more than block gas meter", blockMaxGas, false, true}, {"more than block gas meter", uint64(float64(blockMaxGas) * 1.2), false, true}, - {"consume MaxUint64", math.MaxUint64, false, true}, + {"consume MaxUint64", math.MaxUint64, true, true}, {"consume MaxGasWanted", txtypes.MaxGasWanted, false, true}, {"consume block gas when panicked", 10, true, true}, } @@ -76,7 +76,6 @@ func TestBaseApp_BlockGas(t *testing.T) { appBuilder *runtime.AppBuilder txConfig client.TxConfig cdc codec.Codec - pcdc codec.ProtoCodecMarshaler interfaceRegistry codectypes.InterfaceRegistry err error ) @@ -86,7 +85,6 @@ func TestBaseApp_BlockGas(t *testing.T) { configurator.NewAppConfig( configurator.AuthModule(), configurator.TxModule(), - configurator.ParamsModule(), configurator.ConsensusModule(), configurator.BankModule(), configurator.StakingModule(), @@ -98,7 +96,6 @@ func TestBaseApp_BlockGas(t *testing.T) { &interfaceRegistry, &txConfig, &cdc, - &pcdc, &appBuilder) require.NoError(t, err) @@ -117,12 +114,13 @@ func TestBaseApp_BlockGas(t *testing.T) { genState := GenesisStateWithSingleValidator(t, cdc, appBuilder) stateBytes, err := cmtjson.MarshalIndent(genState, "", " ") require.NoError(t, err) - bapp.InitChain(&abci.RequestInitChain{ + _, err = bapp.InitChain(&abci.RequestInitChain{ Validators: []abci.ValidatorUpdate{}, ConsensusParams: simtestutil.DefaultConsensusParams, AppStateBytes: stateBytes, }) + require.NoError(t, err) ctx := bapp.NewContext(false) // tx fee @@ -150,7 +148,7 @@ func TestBaseApp_BlockGas(t *testing.T) { require.NoError(t, txBuilder.SetMsgs(msg)) txBuilder.SetFeeAmount(feeAmount) - txBuilder.SetGasLimit(txtypes.MaxGasWanted) // tx validation checks that gasLimit can't be bigger than this + txBuilder.SetGasLimit(uint64(simtestutil.DefaultConsensusParams.Block.MaxGas)) senderAccountNumber := accountKeeper.GetAccount(ctx, addr1).GetAccountNumber() privs, accNums, accSeqs := []cryptotypes.PrivKey{priv1}, []uint64{senderAccountNumber}, []uint64{0} @@ -176,11 +174,11 @@ func TestBaseApp_BlockGas(t *testing.T) { require.Equal(t, []byte("ok"), okValue) } // check block gas is always consumed - baseGas := uint64(57554) // baseGas is the gas consumed before tx msg + baseGas := uint64(57504) // baseGas is the gas consumed before tx msg expGasConsumed := addUint64Saturating(tc.gasToConsume, baseGas) - if expGasConsumed > txtypes.MaxGasWanted { + if expGasConsumed > uint64(simtestutil.DefaultConsensusParams.Block.MaxGas) { // capped by gasLimit - expGasConsumed = txtypes.MaxGasWanted + expGasConsumed = uint64(simtestutil.DefaultConsensusParams.Block.MaxGas) } require.Equal(t, int(expGasConsumed), int(ctx.BlockGasMeter().GasConsumed())) // tx fee is always deducted diff --git a/baseapp/genesis.go b/baseapp/genesis.go index 564159edc4ab..4a6b0082b656 100644 --- a/baseapp/genesis.go +++ b/baseapp/genesis.go @@ -3,8 +3,9 @@ package baseapp import ( "errors" - "cosmossdk.io/core/genesis" "github.com/cometbft/cometbft/abci/types" + + "cosmossdk.io/core/genesis" ) var _ genesis.TxHandler = (*BaseApp)(nil) diff --git a/baseapp/grpcrouter.go b/baseapp/grpcrouter.go index 5a127277feab..9955ecb460e4 100644 --- a/baseapp/grpcrouter.go +++ b/baseapp/grpcrouter.go @@ -1,13 +1,16 @@ package baseapp import ( + "context" "fmt" abci "github.com/cometbft/cometbft/abci/types" gogogrpc "github.com/cosmos/gogoproto/grpc" "google.golang.org/grpc" "google.golang.org/grpc/encoding" + "google.golang.org/protobuf/runtime/protoiface" + "github.com/cosmos/cosmos-sdk/baseapp/internal/protocompat" "github.com/cosmos/cosmos-sdk/client/grpc/reflection" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -16,8 +19,16 @@ import ( // GRPCQueryRouter routes ABCI Query requests to GRPC handlers type GRPCQueryRouter struct { - routes map[string]GRPCQueryHandler - cdc encoding.Codec + // routes maps query handlers used in ABCIQuery. + routes map[string]GRPCQueryHandler + // hybridHandlers maps the request name to the handler. It is a hybrid handler which seamlessly + // handles both gogo and protov2 messages. + hybridHandlers map[string][]func(ctx context.Context, req, resp protoiface.MessageV1) error + // binaryCodec is used to encode/decode binary protobuf messages. + binaryCodec codec.BinaryCodec + // cdc is the gRPC codec used by the router to correctly unmarshal messages. + cdc encoding.Codec + // serviceData contains the gRPC services and their handlers. serviceData []serviceData } @@ -32,7 +43,8 @@ var _ gogogrpc.Server = &GRPCQueryRouter{} // NewGRPCQueryRouter creates a new GRPCQueryRouter func NewGRPCQueryRouter() *GRPCQueryRouter { return &GRPCQueryRouter{ - routes: map[string]GRPCQueryHandler{}, + routes: map[string]GRPCQueryHandler{}, + hybridHandlers: map[string][]func(ctx context.Context, req, resp protoiface.MessageV1) error{}, } } @@ -58,46 +70,13 @@ func (qrt *GRPCQueryRouter) Route(path string) GRPCQueryHandler { func (qrt *GRPCQueryRouter) RegisterService(sd *grpc.ServiceDesc, handler interface{}) { // adds a top-level query handler based on the gRPC service name for _, method := range sd.Methods { - fqName := fmt.Sprintf("/%s/%s", sd.ServiceName, method.MethodName) - methodHandler := method.Handler - - // Check that each service is only registered once. If a service is - // registered more than once, then we should error. Since we can't - // return an error (`Server.RegisterService` interface restriction) we - // panic (at startup). - _, found := qrt.routes[fqName] - if found { - panic( - fmt.Errorf( - "gRPC query service %s has already been registered. Please make sure to only register each service once. "+ - "This usually means that there are conflicting modules registering the same gRPC query service", - fqName, - ), - ) + err := qrt.registerABCIQueryHandler(sd, method, handler) + if err != nil { + panic(err) } - - qrt.routes[fqName] = func(ctx sdk.Context, req *abci.RequestQuery) (*abci.ResponseQuery, error) { - // call the method handler from the service description with the handler object, - // a wrapped sdk.Context with proto-unmarshaled data from the ABCI request data - res, err := methodHandler(handler, ctx, func(i interface{}) error { - return qrt.cdc.Unmarshal(req.Data, i) - }, nil) - if err != nil { - return nil, err - } - - // proto marshal the result bytes - var resBytes []byte - resBytes, err = qrt.cdc.Marshal(res) - if err != nil { - return nil, err - } - - // return the result bytes as the response value - return &abci.ResponseQuery{ - Height: req.Height, - Value: resBytes, - }, nil + err = qrt.registerHybridHandler(sd, method, handler) + if err != nil { + panic(err) } } @@ -107,11 +86,73 @@ func (qrt *GRPCQueryRouter) RegisterService(sd *grpc.ServiceDesc, handler interf }) } +func (qrt *GRPCQueryRouter) registerABCIQueryHandler(sd *grpc.ServiceDesc, method grpc.MethodDesc, handler interface{}) error { + fqName := fmt.Sprintf("/%s/%s", sd.ServiceName, method.MethodName) + methodHandler := method.Handler + + // Check that each service is only registered once. If a service is + // registered more than once, then we should error. Since we can't + // return an error (`Server.RegisterService` interface restriction) we + // panic (at startup). + _, found := qrt.routes[fqName] + if found { + return fmt.Errorf( + "gRPC query service %s has already been registered. Please make sure to only register each service once. "+ + "This usually means that there are conflicting modules registering the same gRPC query service", + fqName, + ) + } + + qrt.routes[fqName] = func(ctx sdk.Context, req *abci.RequestQuery) (*abci.ResponseQuery, error) { + // call the method handler from the service description with the handler object, + // a wrapped sdk.Context with proto-unmarshaled data from the ABCI request data + res, err := methodHandler(handler, ctx, func(i interface{}) error { + return qrt.cdc.Unmarshal(req.Data, i) + }, nil) + if err != nil { + return nil, err + } + + // proto marshal the result bytes + var resBytes []byte + resBytes, err = qrt.cdc.Marshal(res) + if err != nil { + return nil, err + } + + // return the result bytes as the response value + return &abci.ResponseQuery{ + Height: req.Height, + Value: resBytes, + }, nil + } + return nil +} + +func (qrt *GRPCQueryRouter) HybridHandlerByRequestName(name string) []func(ctx context.Context, req, resp protoiface.MessageV1) error { + return qrt.hybridHandlers[name] +} + +func (qrt *GRPCQueryRouter) registerHybridHandler(sd *grpc.ServiceDesc, method grpc.MethodDesc, handler interface{}) error { + // extract message name from method descriptor + inputName, err := protocompat.RequestFullNameFromMethodDesc(sd, method) + if err != nil { + return err + } + methodHandler, err := protocompat.MakeHybridHandler(qrt.binaryCodec, sd, method, handler) + if err != nil { + return err + } + qrt.hybridHandlers[string(inputName)] = append(qrt.hybridHandlers[string(inputName)], methodHandler) + return nil +} + // SetInterfaceRegistry sets the interface registry for the router. This will // also register the interface reflection gRPC service. func (qrt *GRPCQueryRouter) SetInterfaceRegistry(interfaceRegistry codectypes.InterfaceRegistry) { // instantiate the codec qrt.cdc = codec.NewProtoCodec(interfaceRegistry).GRPCCodec() + qrt.binaryCodec = codec.NewProtoCodec(interfaceRegistry) // Once we have an interface registry, we can register the interface // registry reflection gRPC service. reflection.RegisterReflectionServiceServer(qrt, reflection.NewReflectionServiceServer(interfaceRegistry)) diff --git a/baseapp/grpcrouter_test.go b/baseapp/grpcrouter_test.go index 825a89dad284..d747fbb74703 100644 --- a/baseapp/grpcrouter_test.go +++ b/baseapp/grpcrouter_test.go @@ -5,11 +5,11 @@ import ( "sync" "testing" - "cosmossdk.io/log" dbm "github.com/cosmos/cosmos-db" "github.com/stretchr/testify/require" "cosmossdk.io/depinject" + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec/types" @@ -53,6 +53,50 @@ func TestGRPCQueryRouter(t *testing.T) { require.Equal(t, spot, res3.HasAnimal.Animal.GetCachedValue()) } +func TestGRPCRouterHybridHandlers(t *testing.T) { + assertRouterBehaviour := func(helper *baseapp.QueryServiceTestHelper) { + // test getting the handler by name + handlers := helper.GRPCQueryRouter.HybridHandlerByRequestName("testpb.EchoRequest") + require.NotNil(t, handlers) + require.Len(t, handlers, 1) + handler := handlers[0] + // sending a protov2 message should work, and return a protov2 message + v2Resp := new(testdata_pulsar.EchoResponse) + err := handler(helper.Ctx, &testdata_pulsar.EchoRequest{Message: "hello"}, v2Resp) + require.Nil(t, err) + require.Equal(t, "hello", v2Resp.Message) + // also sending a protov1 message should work, and return a gogoproto message + gogoResp := new(testdata.EchoResponse) + err = handler(helper.Ctx, &testdata.EchoRequest{Message: "hello"}, gogoResp) + require.NoError(t, err) + require.Equal(t, "hello", gogoResp.Message) + } + + t.Run("protov2 server", func(t *testing.T) { + qr := baseapp.NewGRPCQueryRouter() + interfaceRegistry := testdata.NewTestInterfaceRegistry() + qr.SetInterfaceRegistry(interfaceRegistry) + testdata_pulsar.RegisterQueryServer(qr, testdata_pulsar.QueryImpl{}) + helper := &baseapp.QueryServiceTestHelper{ + GRPCQueryRouter: qr, + Ctx: sdk.Context{}.WithContext(context.Background()), + } + assertRouterBehaviour(helper) + }) + + t.Run("gogoproto server", func(t *testing.T) { + qr := baseapp.NewGRPCQueryRouter() + interfaceRegistry := testdata.NewTestInterfaceRegistry() + qr.SetInterfaceRegistry(interfaceRegistry) + testdata.RegisterQueryServer(qr, testdata.QueryImpl{}) + helper := &baseapp.QueryServiceTestHelper{ + GRPCQueryRouter: qr, + Ctx: sdk.Context{}.WithContext(context.Background()), + } + assertRouterBehaviour(helper) + }) +} + func TestRegisterQueryServiceTwice(t *testing.T) { // Setup baseapp. var appBuilder *runtime.AppBuilder diff --git a/baseapp/grpcserver.go b/baseapp/grpcserver.go index b49efbb16265..eed6d50aba24 100644 --- a/baseapp/grpcserver.go +++ b/baseapp/grpcserver.go @@ -2,9 +2,9 @@ package baseapp import ( "context" + "fmt" "strconv" - errorsmod "cosmossdk.io/errors" gogogrpc "github.com/cosmos/gogoproto/grpc" grpcmiddleware "github.com/grpc-ecosystem/go-grpc-middleware" grpcrecovery "github.com/grpc-ecosystem/go-grpc-middleware/recovery" @@ -13,14 +13,13 @@ import ( "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" grpctypes "github.com/cosmos/cosmos-sdk/types/grpc" ) -// GRPCQueryRouter returns the GRPCQueryRouter of a BaseApp. -func (app *BaseApp) GRPCQueryRouter() *GRPCQueryRouter { return app.grpcQueryRouter } - // RegisterGRPCServer registers gRPC services directly with the gRPC server. func (app *BaseApp) RegisterGRPCServer(server gogogrpc.Server) { // Define an interceptor for all gRPC queries: this interceptor will create @@ -66,6 +65,8 @@ func (app *BaseApp) RegisterGRPCServer(server gogogrpc.Server) { app.logger.Error("failed to set gRPC header", "err", err) } + app.logger.Debug("gRPC query received", "type", fmt.Sprintf("%#v", req)) + return handler(grpcCtx, req) } diff --git a/baseapp/info.go b/baseapp/info.go index 8c8a4451206e..1efb017b0579 100644 --- a/baseapp/info.go +++ b/baseapp/info.go @@ -8,7 +8,21 @@ import ( "cosmossdk.io/core/comet" ) -var _ comet.BlockInfo = (*cometInfo)(nil) +// NewBlockInfo returns a new BlockInfo instance +// This function should be only used in tests +func NewBlockInfo( + misbehavior []abci.Misbehavior, + validatorsHash []byte, + proposerAddress []byte, + lastCommit abci.CommitInfo, +) comet.BlockInfo { + return &cometInfo{ + Misbehavior: misbehavior, + ValidatorsHash: validatorsHash, + ProposerAddress: proposerAddress, + LastCommit: lastCommit, + } +} // CometInfo defines the properties provided by comet to the application type cometInfo struct { diff --git a/baseapp/internal/protocompat/protocompat.go b/baseapp/internal/protocompat/protocompat.go new file mode 100644 index 000000000000..6b8cdc081896 --- /dev/null +++ b/baseapp/internal/protocompat/protocompat.go @@ -0,0 +1,232 @@ +package protocompat + +import ( + "context" + "fmt" + "reflect" + + gogoproto "github.com/cosmos/gogoproto/proto" + "github.com/golang/protobuf/proto" // nolint: staticcheck // needed because gogoproto.Merge does not work consistently. See NOTE: comments. + "google.golang.org/grpc" + proto2 "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/reflect/protoregistry" + "google.golang.org/protobuf/runtime/protoiface" + + "github.com/cosmos/cosmos-sdk/codec" +) + +var ( + gogoType = reflect.TypeOf((*gogoproto.Message)(nil)).Elem() + protov2Type = reflect.TypeOf((*proto2.Message)(nil)).Elem() + protov2MarshalOpts = proto2.MarshalOptions{Deterministic: true} +) + +type Handler = func(ctx context.Context, request, response protoiface.MessageV1) error + +func MakeHybridHandler(cdc codec.BinaryCodec, sd *grpc.ServiceDesc, method grpc.MethodDesc, handler interface{}) (Handler, error) { + methodFullName := protoreflect.FullName(fmt.Sprintf("%s.%s", sd.ServiceName, method.MethodName)) + desc, err := gogoproto.HybridResolver.FindDescriptorByName(methodFullName) + if err != nil { + return nil, err + } + methodDesc, ok := desc.(protoreflect.MethodDescriptor) + if !ok { + return nil, fmt.Errorf("invalid method descriptor %s", methodFullName) + } + + isProtov2Handler, err := isProtov2(method) + if err != nil { + return nil, err + } + if isProtov2Handler { + return makeProtoV2HybridHandler(methodDesc, cdc, method, handler) + } + return makeGogoHybridHandler(methodDesc, cdc, method, handler) +} + +// makeProtoV2HybridHandler returns a handler that can handle both gogo and protov2 messages. +func makeProtoV2HybridHandler(prefMethod protoreflect.MethodDescriptor, cdc codec.BinaryCodec, method grpc.MethodDesc, handler any) (Handler, error) { + // it's a protov2 handler, if a gogo counterparty is not found we cannot handle gogo messages. + gogoExists := gogoproto.MessageType(string(prefMethod.Output().FullName())) != nil + if !gogoExists { + return func(ctx context.Context, inReq, outResp protoiface.MessageV1) error { + protov2Request, ok := inReq.(proto2.Message) + if !ok { + return fmt.Errorf("invalid request type %T, method %s does not accept gogoproto messages", inReq, prefMethod.FullName()) + } + resp, err := method.Handler(handler, ctx, func(msg any) error { + proto2.Merge(msg.(proto2.Message), protov2Request) + return nil + }, nil) + if err != nil { + return err + } + // merge on the resp + proto2.Merge(outResp.(proto2.Message), resp.(proto2.Message)) + return nil + }, nil + } + return func(ctx context.Context, inReq, outResp protoiface.MessageV1) error { + // we check if the request is a protov2 message. + switch m := inReq.(type) { + case proto2.Message: + // we can just call the handler after making a copy of the message, for safety reasons. + resp, err := method.Handler(handler, ctx, func(msg any) error { + proto2.Merge(msg.(proto2.Message), m) + return nil + }, nil) + if err != nil { + return err + } + // merge on the resp + proto2.Merge(outResp.(proto2.Message), resp.(proto2.Message)) + return nil + case gogoproto.Message: + // we need to marshal and unmarshal the request. + requestBytes, err := cdc.Marshal(m) + if err != nil { + return err + } + resp, err := method.Handler(handler, ctx, func(msg any) error { + // unmarshal request into the message. + return proto2.Unmarshal(requestBytes, msg.(proto2.Message)) + }, nil) + if err != nil { + return err + } + // the response is a protov2 message, so we cannot just return it. + // since the request came as gogoproto, we expect the response + // to also be gogoproto. + respBytes, err := protov2MarshalOpts.Marshal(resp.(proto2.Message)) + if err != nil { + return err + } + + // unmarshal response into a gogo message. + return cdc.Unmarshal(respBytes, outResp.(gogoproto.Message)) + default: + panic("unreachable") + } + }, nil +} + +func makeGogoHybridHandler(prefMethod protoreflect.MethodDescriptor, cdc codec.BinaryCodec, method grpc.MethodDesc, handler any) (Handler, error) { + // it's a gogo handler, we check if the existing protov2 counterparty exists. + _, err := protoregistry.GlobalTypes.FindMessageByName(prefMethod.Output().FullName()) + if err != nil { + // this can only be a gogo message. + return func(ctx context.Context, inReq, outResp protoiface.MessageV1) error { + _, ok := inReq.(proto2.Message) + if ok { + return fmt.Errorf("invalid request type %T, method %s does not accept protov2 messages", inReq, prefMethod.FullName()) + } + resp, err := method.Handler(handler, ctx, func(msg any) error { + // merge! ref: https://github.com/cosmos/cosmos-sdk/issues/18003 + // NOTE: using gogoproto.Merge will fail for some reason unknown to me, but + // using proto.Merge with gogo messages seems to work fine. + proto.Merge(msg.(gogoproto.Message), inReq) + return nil + }, nil) + if err != nil { + return err + } + // merge resp, ref: https://github.com/cosmos/cosmos-sdk/issues/18003 + // NOTE: using gogoproto.Merge will fail for some reason unknown to me, but + // using proto.Merge with gogo messages seems to work fine. + proto.Merge(outResp.(gogoproto.Message), resp.(gogoproto.Message)) + return nil + }, nil + } + // this is a gogo handler, and we have a protov2 counterparty. + return func(ctx context.Context, inReq, outResp protoiface.MessageV1) error { + switch m := inReq.(type) { + case proto2.Message: + // we need to marshal and unmarshal the request. + requestBytes, err := protov2MarshalOpts.Marshal(m) + if err != nil { + return err + } + resp, err := method.Handler(handler, ctx, func(msg any) error { + // unmarshal request into the message. + return cdc.Unmarshal(requestBytes, msg.(gogoproto.Message)) + }, nil) + if err != nil { + return err + } + // the response is a gogo message, so we cannot just return it. + // since the request came as protov2, we expect the response + // to also be protov2. + respBytes, err := cdc.Marshal(resp.(gogoproto.Message)) + if err != nil { + return err + } + // now we unmarshal back into a protov2 message. + return proto2.Unmarshal(respBytes, outResp.(proto2.Message)) + case gogoproto.Message: + // we can just call the handler after making a copy of the message, for safety reasons. + resp, err := method.Handler(handler, ctx, func(msg any) error { + // ref: https://github.com/cosmos/cosmos-sdk/issues/18003 + asGogoProto := msg.(gogoproto.Message) + // NOTE: using gogoproto.Merge will fail for some reason unknown to me, but + // using proto.Merge with gogo messages seems to work fine. + proto.Merge(asGogoProto, m) + return nil + }, nil) + if err != nil { + return err + } + // merge on the resp, ref: https://github.com/cosmos/cosmos-sdk/issues/18003 + // NOTE: using gogoproto.Merge will fail for some reason unknown to me, but + // using proto.Merge with gogo messages seems to work fine. + proto.Merge(outResp.(gogoproto.Message), resp.(gogoproto.Message)) + return nil + default: + panic("unreachable") + } + }, nil +} + +// isProtov2 returns true if the given method accepts protov2 messages. +// Returns false if it does not. +// It uses the decoder function passed to the method handler to determine +// the type. Since the decoder function is passed in by the concrete implementer the expected +// message where bytes are unmarshaled to, we can use that to determine the type. +func isProtov2(md grpc.MethodDesc) (isV2Type bool, err error) { + pullRequestType := func(msg interface{}) error { + typ := reflect.TypeOf(msg) + switch { + case typ.Implements(protov2Type): + isV2Type = true + return nil + case typ.Implements(gogoType): + isV2Type = false + return nil + default: + err = fmt.Errorf("invalid request type %T, expected protov2 or gogo message", msg) + return nil + } + } + // doNotExecute is a dummy handler that stops the request execution. + doNotExecute := func(_ context.Context, _ any, _ *grpc.UnaryServerInfo, _ grpc.UnaryHandler) (any, error) { + return nil, nil + } + // we are allowed to pass in a nil context and nil request, since we are not actually executing the request. + // this is made possible by the doNotExecute function which immediately returns without calling other handlers. + _, _ = md.Handler(nil, nil, pullRequestType, doNotExecute) + return +} + +// RequestFullNameFromMethodDesc returns the fully-qualified name of the request message of the provided service's method. +func RequestFullNameFromMethodDesc(sd *grpc.ServiceDesc, method grpc.MethodDesc) (protoreflect.FullName, error) { + methodFullName := protoreflect.FullName(fmt.Sprintf("%s.%s", sd.ServiceName, method.MethodName)) + desc, err := gogoproto.HybridResolver.FindDescriptorByName(methodFullName) + if err != nil { + return "", fmt.Errorf("cannot find method descriptor %s", methodFullName) + } + methodDesc, ok := desc.(protoreflect.MethodDescriptor) + if !ok { + return "", fmt.Errorf("invalid method descriptor %s", methodFullName) + } + return methodDesc.Input().FullName(), nil +} diff --git a/baseapp/msg_service_router.go b/baseapp/msg_service_router.go index b3876075af98..126e0f65e5bc 100644 --- a/baseapp/msg_service_router.go +++ b/baseapp/msg_service_router.go @@ -7,9 +7,12 @@ import ( gogogrpc "github.com/cosmos/gogoproto/grpc" "github.com/cosmos/gogoproto/proto" "google.golang.org/grpc" + "google.golang.org/protobuf/runtime/protoiface" errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/baseapp/internal/protocompat" + "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -26,6 +29,7 @@ type MessageRouter interface { type MsgServiceRouter struct { interfaceRegistry codectypes.InterfaceRegistry routes map[string]MsgServiceHandler + hybridHandlers map[string]func(ctx context.Context, req, resp protoiface.MessageV1) error circuitBreaker CircuitBreaker } @@ -34,7 +38,8 @@ var _ gogogrpc.Server = &MsgServiceRouter{} // NewMsgServiceRouter creates a new MsgServiceRouter. func NewMsgServiceRouter() *MsgServiceRouter { return &MsgServiceRouter{ - routes: map[string]MsgServiceHandler{}, + routes: map[string]MsgServiceHandler{}, + hybridHandlers: map[string]func(ctx context.Context, req, resp protoiface.MessageV1) error{}, } } @@ -66,100 +71,143 @@ func (msr *MsgServiceRouter) HandlerByTypeURL(typeURL string) MsgServiceHandler func (msr *MsgServiceRouter) RegisterService(sd *grpc.ServiceDesc, handler interface{}) { // Adds a top-level query handler based on the gRPC service name. for _, method := range sd.Methods { - fqMethod := fmt.Sprintf("/%s/%s", sd.ServiceName, method.MethodName) - methodHandler := method.Handler - - var requestTypeName string - - // NOTE: This is how we pull the concrete request type for each handler for registering in the InterfaceRegistry. - // This approach is maybe a bit hacky, but less hacky than reflecting on the handler object itself. - // We use a no-op interceptor to avoid actually calling into the handler itself. - _, _ = methodHandler(nil, context.Background(), func(i interface{}) error { - msg, ok := i.(sdk.Msg) - if !ok { - // We panic here because there is no other alternative and the app cannot be initialized correctly - // this should only happen if there is a problem with code generation in which case the app won't - // work correctly anyway. - panic(fmt.Errorf("unable to register service method %s: %T does not implement sdk.Msg", fqMethod, i)) - } + err := msr.registerMsgServiceHandler(sd, method, handler) + if err != nil { + panic(err) + } + err = msr.registerHybridHandler(sd, method, handler) + if err != nil { + panic(err) + } + } +} + +func (msr *MsgServiceRouter) HybridHandlerByMsgName(msgName string) func(ctx context.Context, req, resp protoiface.MessageV1) error { + return msr.hybridHandlers[msgName] +} - requestTypeName = sdk.MsgTypeURL(msg) - return nil - }, noopInterceptor) - - // Check that the service Msg fully-qualified method name has already - // been registered (via RegisterInterfaces). If the user registers a - // service without registering according service Msg type, there might be - // some unexpected behavior down the road. Since we can't return an error - // (`Server.RegisterService` interface restriction) we panic (at startup). - reqType, err := msr.interfaceRegistry.Resolve(requestTypeName) - if err != nil || reqType == nil { - panic( - fmt.Errorf( - "type_url %s has not been registered yet. "+ - "Before calling RegisterService, you must register all interfaces by calling the `RegisterInterfaces` "+ - "method on module.BasicManager. Each module should call `msgservice.RegisterMsgServiceDesc` inside its "+ - "`RegisterInterfaces` method with the `_Msg_serviceDesc` generated by proto-gen", - requestTypeName, - ), - ) +func (msr *MsgServiceRouter) registerHybridHandler(sd *grpc.ServiceDesc, method grpc.MethodDesc, handler interface{}) error { + inputName, err := protocompat.RequestFullNameFromMethodDesc(sd, method) + if err != nil { + return err + } + cdc := codec.NewProtoCodec(msr.interfaceRegistry) + hybridHandler, err := protocompat.MakeHybridHandler(cdc, sd, method, handler) + if err != nil { + return err + } + // if circuit breaker is not nil, then we decorate the hybrid handler with the circuit breaker + if msr.circuitBreaker == nil { + msr.hybridHandlers[string(inputName)] = hybridHandler + return nil + } + // decorate the hybrid handler with the circuit breaker + circuitBreakerHybridHandler := func(ctx context.Context, req, resp protoiface.MessageV1) error { + messageName := codectypes.MsgTypeURL(req) + allowed, err := msr.circuitBreaker.IsAllowed(ctx, messageName) + if err != nil { + return err + } + if !allowed { + return fmt.Errorf("circuit breaker disallows execution of message %s", messageName) } + return hybridHandler(ctx, req, resp) + } + msr.hybridHandlers[string(inputName)] = circuitBreakerHybridHandler + return nil +} - // Check that each service is only registered once. If a service is - // registered more than once, then we should error. Since we can't - // return an error (`Server.RegisterService` interface restriction) we - // panic (at startup). - _, found := msr.routes[requestTypeName] - if found { - panic( - fmt.Errorf( - "msg service %s has already been registered. Please make sure to only register each service once. "+ - "This usually means that there are conflicting modules registering the same msg service", - fqMethod, - ), - ) +func (msr *MsgServiceRouter) registerMsgServiceHandler(sd *grpc.ServiceDesc, method grpc.MethodDesc, handler interface{}) error { + fqMethod := fmt.Sprintf("/%s/%s", sd.ServiceName, method.MethodName) + methodHandler := method.Handler + + var requestTypeName string + + // NOTE: This is how we pull the concrete request type for each handler for registering in the InterfaceRegistry. + // This approach is maybe a bit hacky, but less hacky than reflecting on the handler object itself. + // We use a no-op interceptor to avoid actually calling into the handler itself. + _, _ = methodHandler(nil, context.Background(), func(i interface{}) error { + msg, ok := i.(sdk.Msg) + if !ok { + // We panic here because there is no other alternative and the app cannot be initialized correctly + // this should only happen if there is a problem with code generation in which case the app won't + // work correctly anyway. + panic(fmt.Errorf("unable to register service method %s: %T does not implement sdk.Msg", fqMethod, i)) } - msr.routes[requestTypeName] = func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { - ctx = ctx.WithEventManager(sdk.NewEventManager()) - interceptor := func(goCtx context.Context, _ interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { - goCtx = context.WithValue(goCtx, sdk.SdkContextKey, ctx) - return handler(goCtx, msg) - } + requestTypeName = sdk.MsgTypeURL(msg) + return nil + }, noopInterceptor) + + // Check that the service Msg fully-qualified method name has already + // been registered (via RegisterInterfaces). If the user registers a + // service without registering according service Msg type, there might be + // some unexpected behavior down the road. Since we can't return an error + // (`Server.RegisterService` interface restriction) we panic (at startup). + reqType, err := msr.interfaceRegistry.Resolve(requestTypeName) + if err != nil || reqType == nil { + return fmt.Errorf( + "type_url %s has not been registered yet. "+ + "Before calling RegisterService, you must register all interfaces by calling the `RegisterInterfaces` "+ + "method on module.BasicManager. Each module should call `msgservice.RegisterMsgServiceDesc` inside its "+ + "`RegisterInterfaces` method with the `_Msg_serviceDesc` generated by proto-gen", + requestTypeName, + ) + } - if m, ok := msg.(sdk.HasValidateBasic); ok { - if err := m.ValidateBasic(); err != nil { - return nil, err - } - } + // Check that each service is only registered once. If a service is + // registered more than once, then we should error. Since we can't + // return an error (`Server.RegisterService` interface restriction) we + // panic (at startup). + _, found := msr.routes[requestTypeName] + if found { + return fmt.Errorf( + "msg service %s has already been registered. Please make sure to only register each service once. "+ + "This usually means that there are conflicting modules registering the same msg service", + fqMethod, + ) + } - if msr.circuitBreaker != nil { - msgURL := sdk.MsgTypeURL(msg) - isAllowed, err := msr.circuitBreaker.IsAllowed(ctx, msgURL) - if err != nil { - return nil, err - } + msr.routes[requestTypeName] = func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { + ctx = ctx.WithEventManager(sdk.NewEventManager()) + interceptor := func(goCtx context.Context, _ interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { + goCtx = context.WithValue(goCtx, sdk.SdkContextKey, ctx) + return handler(goCtx, msg) + } - if !isAllowed { - return nil, fmt.Errorf("circuit breaker disables execution of this message: %s", msgURL) - } + if m, ok := msg.(sdk.HasValidateBasic); ok { + if err := m.ValidateBasic(); err != nil { + return nil, err } + } - // Call the method handler from the service description with the handler object. - // We don't do any decoding here because the decoding was already done. - res, err := methodHandler(handler, ctx, noopDecoder, interceptor) + if msr.circuitBreaker != nil { + msgURL := sdk.MsgTypeURL(msg) + isAllowed, err := msr.circuitBreaker.IsAllowed(ctx, msgURL) if err != nil { return nil, err } - resMsg, ok := res.(proto.Message) - if !ok { - return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidType, "Expecting proto.Message, got %T", resMsg) + if !isAllowed { + return nil, fmt.Errorf("circuit breaker disables execution of this message: %s", msgURL) } + } - return sdk.WrapServiceResult(ctx, resMsg, err) + // Call the method handler from the service description with the handler object. + // We don't do any decoding here because the decoding was already done. + res, err := methodHandler(handler, ctx, noopDecoder, interceptor) + if err != nil { + return nil, err } + + resMsg, ok := res.(proto.Message) + if !ok { + return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidType, "Expecting proto.Message, got %T", resMsg) + } + + return sdk.WrapServiceResult(ctx, resMsg, err) } + return nil } // SetInterfaceRegistry sets the interface registry for the router. diff --git a/baseapp/msg_service_router_test.go b/baseapp/msg_service_router_test.go index 23acbe99409b..8ddb490e994d 100644 --- a/baseapp/msg_service_router_test.go +++ b/baseapp/msg_service_router_test.go @@ -86,12 +86,47 @@ func TestRegisterMsgServiceTwice(t *testing.T) { }) } +func TestHybridHandlerByMsgName(t *testing.T) { + // Setup baseapp and router. + var ( + appBuilder *runtime.AppBuilder + registry codectypes.InterfaceRegistry + ) + err := depinject.Inject( + depinject.Configs( + makeMinimalConfig(), + depinject.Supply(log.NewTestLogger(t)), + ), &appBuilder, ®istry) + require.NoError(t, err) + db := dbm.NewMemDB() + app := appBuilder.Build(db, nil) + testdata.RegisterInterfaces(registry) + + testdata.RegisterMsgServer( + app.MsgServiceRouter(), + testdata.MsgServerImpl{}, + ) + + handler := app.MsgServiceRouter().HybridHandlerByMsgName("testpb.MsgCreateDog") + + require.NotNil(t, handler) + require.NoError(t, app.Init()) + ctx := app.NewContext(true) + resp := new(testdata.MsgCreateDogResponse) + err = handler(ctx, &testdata.MsgCreateDog{ + Dog: &testdata.Dog{Name: "Spot"}, + Owner: "me", + }, resp) + require.NoError(t, err) + require.Equal(t, resp.Name, "Spot") +} + func TestMsgService(t *testing.T) { priv, _, _ := testdata.KeyTestPubAddr() var ( appBuilder *runtime.AppBuilder - cdc codec.ProtoCodecMarshaler + cdc codec.Codec interfaceRegistry codectypes.InterfaceRegistry ) err := depinject.Inject( diff --git a/baseapp/noopgasmeter.go b/baseapp/noopgasmeter.go new file mode 100644 index 000000000000..c341bcbe7b11 --- /dev/null +++ b/baseapp/noopgasmeter.go @@ -0,0 +1,17 @@ +package baseapp + +import storetypes "cosmossdk.io/store/types" + +type noopGasMeter struct{} + +var _ storetypes.GasMeter = noopGasMeter{} + +func (noopGasMeter) GasConsumed() storetypes.Gas { return 0 } +func (noopGasMeter) GasConsumedToLimit() storetypes.Gas { return 0 } +func (noopGasMeter) GasRemaining() storetypes.Gas { return 0 } +func (noopGasMeter) Limit() storetypes.Gas { return 0 } +func (noopGasMeter) ConsumeGas(storetypes.Gas, string) {} +func (noopGasMeter) RefundGas(storetypes.Gas, string) {} +func (noopGasMeter) IsPastLimit() bool { return false } +func (noopGasMeter) IsOutOfGas() bool { return false } +func (noopGasMeter) String() string { return "noopGasMeter" } diff --git a/baseapp/oe/optimistic_execution.go b/baseapp/oe/optimistic_execution.go new file mode 100644 index 000000000000..c0c8e2575ac2 --- /dev/null +++ b/baseapp/oe/optimistic_execution.go @@ -0,0 +1,160 @@ +package oe + +import ( + "bytes" + "context" + "encoding/hex" + "math/rand" + "sync" + "time" + + abci "github.com/cometbft/cometbft/abci/types" + + "cosmossdk.io/log" +) + +// FinalizeBlockFunc is the function that is called by the OE to finalize the +// block. It is the same as the one in the ABCI app. +type FinalizeBlockFunc func(context.Context, *abci.RequestFinalizeBlock) (*abci.ResponseFinalizeBlock, error) + +// OptimisticExecution is a struct that contains the OE context. It is used to +// run the FinalizeBlock function in a goroutine, and to abort it if needed. +type OptimisticExecution struct { + finalizeBlockFunc FinalizeBlockFunc // ABCI FinalizeBlock function with a context + logger log.Logger + + mtx sync.Mutex + stopCh chan struct{} + request *abci.RequestFinalizeBlock + response *abci.ResponseFinalizeBlock + err error + cancelFunc func() // cancel function for the context + initialized bool // A boolean value indicating whether the struct has been initialized + + // debugging/testing options + abortRate int // number from 0 to 100 that determines the percentage of OE that should be aborted +} + +// NewOptimisticExecution initializes the Optimistic Execution context but does not start it. +func NewOptimisticExecution(logger log.Logger, fn FinalizeBlockFunc, opts ...func(*OptimisticExecution)) *OptimisticExecution { + logger = logger.With(log.ModuleKey, "oe") + oe := &OptimisticExecution{logger: logger, finalizeBlockFunc: fn} + for _, opt := range opts { + opt(oe) + } + return oe +} + +// WithAbortRate sets the abort rate for the OE. The abort rate is a number from +// 0 to 100 that determines the percentage of OE that should be aborted. +// This is for testing purposes only and must not be used in production. +func WithAbortRate(rate int) func(*OptimisticExecution) { + return func(oe *OptimisticExecution) { + oe.abortRate = rate + } +} + +// Reset resets the OE context. Must be called whenever we want to invalidate +// the current OE. +func (oe *OptimisticExecution) Reset() { + oe.mtx.Lock() + defer oe.mtx.Unlock() + oe.request = nil + oe.response = nil + oe.err = nil + oe.initialized = false +} + +func (oe *OptimisticExecution) Enabled() bool { + return oe != nil +} + +// Initialized returns true if the OE was initialized, meaning that it contains +// a request and it was run or it is running. +func (oe *OptimisticExecution) Initialized() bool { + if oe == nil { + return false + } + oe.mtx.Lock() + defer oe.mtx.Unlock() + + return oe.initialized +} + +// Execute initializes the OE and starts it in a goroutine. +func (oe *OptimisticExecution) Execute(req *abci.RequestProcessProposal) { + oe.mtx.Lock() + defer oe.mtx.Unlock() + + oe.stopCh = make(chan struct{}) + oe.request = &abci.RequestFinalizeBlock{ + Txs: req.Txs, + DecidedLastCommit: req.ProposedLastCommit, + Misbehavior: req.Misbehavior, + Hash: req.Hash, + Height: req.Height, + Time: req.Time, + NextValidatorsHash: req.NextValidatorsHash, + ProposerAddress: req.ProposerAddress, + } + + oe.logger.Debug("OE started", "height", req.Height, "hash", hex.EncodeToString(req.Hash), "time", req.Time.String()) + ctx, cancel := context.WithCancel(context.Background()) + oe.cancelFunc = cancel + oe.initialized = true + + go func() { + start := time.Now() + resp, err := oe.finalizeBlockFunc(ctx, oe.request) + + oe.mtx.Lock() + + executionTime := time.Since(start) + oe.logger.Debug("OE finished", "duration", executionTime.String(), "height", oe.request.Height, "hash", hex.EncodeToString(oe.request.Hash)) + oe.response, oe.err = resp, err + + close(oe.stopCh) + oe.mtx.Unlock() + }() +} + +// AbortIfNeeded aborts the OE if the request hash is not the same as the one in +// the running OE. Returns true if the OE was aborted. +func (oe *OptimisticExecution) AbortIfNeeded(reqHash []byte) bool { + if oe == nil { + return false + } + + oe.mtx.Lock() + defer oe.mtx.Unlock() + + if !bytes.Equal(oe.request.Hash, reqHash) { + oe.logger.Error("OE aborted due to hash mismatch", "oe_hash", hex.EncodeToString(oe.request.Hash), "req_hash", hex.EncodeToString(reqHash), "oe_height", oe.request.Height, "req_height", oe.request.Height) + oe.cancelFunc() + return true + } else if oe.abortRate > 0 && rand.Intn(100) < oe.abortRate { + // this is for test purposes only, we can emulate a certain percentage of + // OE needed to be aborted. + oe.cancelFunc() + oe.logger.Error("OE aborted due to test abort rate") + return true + } + + return false +} + +// Abort aborts the OE unconditionally and waits for it to finish. +func (oe *OptimisticExecution) Abort() { + if oe == nil || oe.cancelFunc == nil { + return + } + + oe.cancelFunc() + <-oe.stopCh +} + +// WaitResult waits for the OE to finish and returns the result. +func (oe *OptimisticExecution) WaitResult() (*abci.ResponseFinalizeBlock, error) { + <-oe.stopCh + return oe.response, oe.err +} diff --git a/baseapp/oe/optimistic_execution_test.go b/baseapp/oe/optimistic_execution_test.go new file mode 100644 index 000000000000..0b92244783cd --- /dev/null +++ b/baseapp/oe/optimistic_execution_test.go @@ -0,0 +1,34 @@ +package oe + +import ( + "context" + "errors" + "testing" + + abci "github.com/cometbft/cometbft/abci/types" + "github.com/stretchr/testify/assert" + + "cosmossdk.io/log" +) + +func testFinalizeBlock(_ context.Context, _ *abci.RequestFinalizeBlock) (*abci.ResponseFinalizeBlock, error) { + return nil, errors.New("test error") +} + +func TestOptimisticExecution(t *testing.T) { + oe := NewOptimisticExecution(log.NewNopLogger(), testFinalizeBlock) + assert.True(t, oe.Enabled()) + oe.Execute(&abci.RequestProcessProposal{ + Hash: []byte("test"), + }) + assert.True(t, oe.Initialized()) + + resp, err := oe.WaitResult() + assert.Nil(t, resp) + assert.EqualError(t, err, "test error") + + assert.False(t, oe.AbortIfNeeded([]byte("test"))) + assert.True(t, oe.AbortIfNeeded([]byte("wrong_hash"))) + + oe.Reset() +} diff --git a/baseapp/options.go b/baseapp/options.go index 4dd566f0c0da..270f49f4d113 100644 --- a/baseapp/options.go +++ b/baseapp/options.go @@ -3,14 +3,17 @@ package baseapp import ( "fmt" "io" + "math" + + dbm "github.com/cosmos/cosmos-db" "cosmossdk.io/store/metrics" pruningtypes "cosmossdk.io/store/pruning/types" "cosmossdk.io/store/snapshots" snapshottypes "cosmossdk.io/store/snapshots/types" storetypes "cosmossdk.io/store/types" - dbm "github.com/cosmos/cosmos-db" + "github.com/cosmos/cosmos-sdk/baseapp/oe" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -35,6 +38,15 @@ func SetMinGasPrices(gasPricesStr string) func(*BaseApp) { return func(bapp *BaseApp) { bapp.setMinGasPrices(gasPrices) } } +// SetQueryGasLimit returns an option that sets a gas limit for queries. +func SetQueryGasLimit(queryGasLimit uint64) func(*BaseApp) { + if queryGasLimit == 0 { + queryGasLimit = math.MaxUint64 + } + + return func(bapp *BaseApp) { bapp.queryGasLimit = queryGasLimit } +} + // SetHaltHeight returns a BaseApp option function that sets the halt block height. func SetHaltHeight(blockHeight uint64) func(*BaseApp) { return func(bapp *BaseApp) { bapp.setHaltHeight(blockHeight) } @@ -93,6 +105,37 @@ func SetChainID(chainID string) func(*BaseApp) { return func(app *BaseApp) { app.chainID = chainID } } +// SetStoreLoader allows customization of the rootMultiStore initialization. +func SetStoreLoader(loader StoreLoader) func(*BaseApp) { + return func(app *BaseApp) { app.SetStoreLoader(loader) } +} + +// SetOptimisticExecution enables optimistic execution. +func SetOptimisticExecution(opts ...func(*oe.OptimisticExecution)) func(*BaseApp) { + return func(app *BaseApp) { + app.optimisticExec = oe.NewOptimisticExecution(app.logger, app.internalFinalizeBlock, opts...) + } +} + +// DisableBlockGasMeter disables the block gas meter. +func DisableBlockGasMeter() func(*BaseApp) { + return func(app *BaseApp) { app.SetDisableBlockGasMeter(true) } +} + + +// SetIncludeNestedMsgsGas sets the message types for which gas costs for its nested messages are calculated when simulating. +func SetIncludeNestedMsgsGas(msgs []sdk.Msg) func(*BaseApp) { + return func(app *BaseApp) { + app.includeNestedMsgsGas = make(map[string]struct{}) + for _, msg := range msgs { + if _, ok := msg.(HasNestedMsgs); !ok { + continue + } + app.includeNestedMsgsGas[sdk.MsgTypeURL(msg)] = struct{}{} + } + } +} + func (app *BaseApp) SetName(name string) { if app.sealed { panic("SetName() on sealed BaseApp") @@ -147,6 +190,18 @@ func (app *BaseApp) SetInitChainer(initChainer sdk.InitChainer) { app.initChainer = initChainer } +func (app *BaseApp) PreBlocker() sdk.PreBlocker { + return app.preBlocker +} + +func (app *BaseApp) SetPreBlocker(preBlocker sdk.PreBlocker) { + if app.sealed { + panic("SetPreBlocker() on sealed BaseApp") + } + + app.preBlocker = preBlocker +} + func (app *BaseApp) SetBeginBlocker(beginBlocker sdk.BeginBlocker) { if app.sealed { panic("SetBeginBlocker() on sealed BaseApp") @@ -219,6 +274,11 @@ func (app *BaseApp) SetFauxMerkleMode() { app.fauxMerkleMode = true } +// SetNotSigverify during simulation testing, transaction signature verification needs to be ignored. +func (app *BaseApp) SetNotSigverifyTx() { + app.sigverifyTx = false +} + // SetCommitMultiStoreTracer sets the store tracer on the BaseApp's underlying // CommitMultiStore. func (app *BaseApp) SetCommitMultiStoreTracer(w io.Writer) { @@ -326,3 +386,18 @@ func (app *BaseApp) SetStoreMetrics(gatherer metrics.StoreMetrics) { func (app *BaseApp) SetStreamingManager(manager storetypes.StreamingManager) { app.streamingManager = manager } + +// SetDisableBlockGasMeter sets the disableBlockGasMeter flag for the BaseApp. +func (app *BaseApp) SetDisableBlockGasMeter(disableBlockGasMeter bool) { + app.disableBlockGasMeter = disableBlockGasMeter +} + +// SetMsgServiceRouter sets the MsgServiceRouter of a BaseApp. +func (app *BaseApp) SetMsgServiceRouter(msgServiceRouter *MsgServiceRouter) { + app.msgServiceRouter = msgServiceRouter +} + +// SetGRPCQueryRouter sets the GRPCQueryRouter of the BaseApp. +func (app *BaseApp) SetGRPCQueryRouter(grpcQueryRouter *GRPCQueryRouter) { + app.grpcQueryRouter = grpcQueryRouter +} diff --git a/baseapp/regression_test.go b/baseapp/regression_test.go new file mode 100644 index 000000000000..c93d732299a1 --- /dev/null +++ b/baseapp/regression_test.go @@ -0,0 +1,41 @@ +package baseapp + +import ( + "testing" + + dbm "github.com/cosmos/cosmos-db" + "github.com/stretchr/testify/require" + + "cosmossdk.io/log" + "cosmossdk.io/store" + storemetrics "cosmossdk.io/store/metrics" +) + +// Ensures that error checks are performed before sealing the app. +// Please see https://github.com/cosmos/cosmos-sdk/issues/18726 +func TestNilCmsCheckBeforeSeal(t *testing.T) { + app := new(BaseApp) + + // 1. Invoking app.Init with a nil cms MUST not seal the app + // and should return an error firstly, which can later be reversed. + for i := 0; i < 10; i++ { // N times, the app shouldn't be sealed. + err := app.Init() + require.Error(t, err) + require.Contains(t, err.Error(), "commit multi-store must not be nil") + require.False(t, app.IsSealed(), "the app MUST not be sealed") + } + + // 2. Now that we've figured out and gotten back an error, let's rectify the problem. + // and we should be able to set the commit multistore then reinvoke app.Init successfully! + db := dbm.NewMemDB() + logger := log.NewTestLogger(t) + app.cms = store.NewCommitMultiStore(db, logger, storemetrics.NewNoOpMetrics()) + err := app.Init() + require.Nil(t, err, "app.Init MUST now succeed") + require.True(t, app.IsSealed(), "the app must now be sealed") + + // 3. Now we should expect a panic because the app is sealed. + require.Panics(t, func() { + _ = app.Init() + }) +} diff --git a/baseapp/state.go b/baseapp/state.go index ddfb82f92de1..19ee4e7eaa40 100644 --- a/baseapp/state.go +++ b/baseapp/state.go @@ -1,13 +1,17 @@ package baseapp import ( + "sync" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" ) type state struct { - ms storetypes.CacheMultiStore + ms storetypes.CacheMultiStore + + mtx sync.RWMutex ctx sdk.Context } @@ -17,7 +21,16 @@ func (st *state) CacheMultiStore() storetypes.CacheMultiStore { return st.ms.CacheMultiStore() } +// SetContext updates the state's context to the context provided. +func (st *state) SetContext(ctx sdk.Context) { + st.mtx.Lock() + defer st.mtx.Unlock() + st.ctx = ctx +} + // Context returns the Context of the state. func (st *state) Context() sdk.Context { + st.mtx.RLock() + defer st.mtx.RUnlock() return st.ctx } diff --git a/baseapp/streaming.go b/baseapp/streaming.go index 56b971f842d4..c978d959aa7c 100644 --- a/baseapp/streaming.go +++ b/baseapp/streaming.go @@ -5,9 +5,10 @@ import ( "sort" "strings" + "github.com/spf13/cast" + "cosmossdk.io/store/streaming" storetypes "cosmossdk.io/store/types" - "github.com/spf13/cast" "github.com/cosmos/cosmos-sdk/client/flags" servertypes "github.com/cosmos/cosmos-sdk/server/types" diff --git a/baseapp/streaming_test.go b/baseapp/streaming_test.go index e4a896a40d28..68ab1320ef1f 100644 --- a/baseapp/streaming_test.go +++ b/baseapp/streaming_test.go @@ -5,11 +5,12 @@ import ( "fmt" "testing" - storetypes "cosmossdk.io/store/types" abci "github.com/cometbft/cometbft/abci/types" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/baseapp" baseapptestutil "github.com/cosmos/cosmos-sdk/baseapp/testutil" ) diff --git a/baseapp/test_helpers.go b/baseapp/test_helpers.go index db603f2f2982..a8f7853f224b 100644 --- a/baseapp/test_helpers.go +++ b/baseapp/test_helpers.go @@ -35,6 +35,7 @@ func (app *BaseApp) SimDeliver(txEncoder sdk.TxEncoder, tx sdk.Tx) (sdk.GasInfo, if err != nil { return sdk.GasInfo{}, nil, errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "%s", err) } + gasInfo, result, _, err := app.runTx(execModeFinalize, bz) return gasInfo, result, err } diff --git a/baseapp/testutil/messages.go b/baseapp/testutil/messages.go index a4b1cd9abbcb..1bc8a8bd920f 100644 --- a/baseapp/testutil/messages.go +++ b/baseapp/testutil/messages.go @@ -3,6 +3,7 @@ package testutil import ( errorsmod "cosmossdk.io/errors" + codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" @@ -16,10 +17,15 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { &MsgCounter{}, &MsgCounter2{}, &MsgKeyValue{}, + &MsgNestedMessages{}, + &MsgSend{}, ) + msgservice.RegisterMsgServiceDesc(registry, &_Counter_serviceDesc) msgservice.RegisterMsgServiceDesc(registry, &_Counter2_serviceDesc) msgservice.RegisterMsgServiceDesc(registry, &_KeyValue_serviceDesc) + msgservice.RegisterMsgServiceDesc(registry, &_NestedMessages_serviceDesc) + msgservice.RegisterMsgServiceDesc(registry, &_Send_serviceDesc) codec.RegisterInterfaces(registry) } @@ -63,3 +69,21 @@ func (msg *MsgKeyValue) ValidateBasic() error { } return nil } + +func (msg *MsgNestedMessages) GetMsgs() ([]sdk.Msg, error) { + cdc := codectestutil.CodecOptions{}.NewCodec() + RegisterInterfaces(cdc.InterfaceRegistry()) + msgs := make([]sdk.Msg, len(msg.GetMessages())) + for i, m := range msg.GetMessages() { + mm, err := cdc.InterfaceRegistry().Resolve(m.TypeUrl) + if err != nil { + return nil, err + } + err = cdc.UnpackAny(m, &mm) + if err != nil { + return nil, err + } + msgs[i] = mm + } + return msgs, nil +} diff --git a/baseapp/testutil/messages.pb.go b/baseapp/testutil/messages.pb.go index 2884ff0f649a..b338a30d4220 100644 --- a/baseapp/testutil/messages.pb.go +++ b/baseapp/testutil/messages.pb.go @@ -6,11 +6,11 @@ package testutil import ( context "context" fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/codec/types" _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" + any "github.com/cosmos/gogoproto/types/any" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -282,43 +282,240 @@ func (m *MsgCreateKeyValueResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgCreateKeyValueResponse proto.InternalMessageInfo +type MsgSend struct { + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` + To string `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` + Amount string `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount,omitempty"` +} + +func (m *MsgSend) Reset() { *m = MsgSend{} } +func (m *MsgSend) String() string { return proto.CompactTextString(m) } +func (*MsgSend) ProtoMessage() {} +func (*MsgSend) Descriptor() ([]byte, []int) { + return fileDescriptor_4dc296cbfe5ffcd5, []int{5} +} +func (m *MsgSend) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSend) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSend.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 *MsgSend) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSend.Merge(m, src) +} +func (m *MsgSend) XXX_Size() int { + return m.Size() +} +func (m *MsgSend) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSend.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSend proto.InternalMessageInfo + +func (m *MsgSend) GetFrom() string { + if m != nil { + return m.From + } + return "" +} + +func (m *MsgSend) GetTo() string { + if m != nil { + return m.To + } + return "" +} + +func (m *MsgSend) GetAmount() string { + if m != nil { + return m.Amount + } + return "" +} + +type MsgSendResponse struct { +} + +func (m *MsgSendResponse) Reset() { *m = MsgSendResponse{} } +func (m *MsgSendResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSendResponse) ProtoMessage() {} +func (*MsgSendResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_4dc296cbfe5ffcd5, []int{6} +} +func (m *MsgSendResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSendResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSendResponse.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 *MsgSendResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSendResponse.Merge(m, src) +} +func (m *MsgSendResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSendResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSendResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSendResponse proto.InternalMessageInfo + +type MsgNestedMessages struct { + Messages []*any.Any `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` + Signer string `protobuf:"bytes,2,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (m *MsgNestedMessages) Reset() { *m = MsgNestedMessages{} } +func (m *MsgNestedMessages) String() string { return proto.CompactTextString(m) } +func (*MsgNestedMessages) ProtoMessage() {} +func (*MsgNestedMessages) Descriptor() ([]byte, []int) { + return fileDescriptor_4dc296cbfe5ffcd5, []int{7} +} +func (m *MsgNestedMessages) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgNestedMessages) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgNestedMessages.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 *MsgNestedMessages) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgNestedMessages.Merge(m, src) +} +func (m *MsgNestedMessages) XXX_Size() int { + return m.Size() +} +func (m *MsgNestedMessages) XXX_DiscardUnknown() { + xxx_messageInfo_MsgNestedMessages.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgNestedMessages proto.InternalMessageInfo + +func (m *MsgNestedMessages) GetMessages() []*any.Any { + if m != nil { + return m.Messages + } + return nil +} + +func (m *MsgNestedMessages) GetSigner() string { + if m != nil { + return m.Signer + } + return "" +} + +type MsgCreateNestedMessagesResponse struct { +} + +func (m *MsgCreateNestedMessagesResponse) Reset() { *m = MsgCreateNestedMessagesResponse{} } +func (m *MsgCreateNestedMessagesResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateNestedMessagesResponse) ProtoMessage() {} +func (*MsgCreateNestedMessagesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_4dc296cbfe5ffcd5, []int{8} +} +func (m *MsgCreateNestedMessagesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateNestedMessagesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateNestedMessagesResponse.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 *MsgCreateNestedMessagesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateNestedMessagesResponse.Merge(m, src) +} +func (m *MsgCreateNestedMessagesResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateNestedMessagesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateNestedMessagesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateNestedMessagesResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgCounter)(nil), "MsgCounter") proto.RegisterType((*MsgCounter2)(nil), "MsgCounter2") proto.RegisterType((*MsgCreateCounterResponse)(nil), "MsgCreateCounterResponse") proto.RegisterType((*MsgKeyValue)(nil), "MsgKeyValue") proto.RegisterType((*MsgCreateKeyValueResponse)(nil), "MsgCreateKeyValueResponse") + proto.RegisterType((*MsgSend)(nil), "MsgSend") + proto.RegisterType((*MsgSendResponse)(nil), "MsgSendResponse") + proto.RegisterType((*MsgNestedMessages)(nil), "MsgNestedMessages") + proto.RegisterType((*MsgCreateNestedMessagesResponse)(nil), "MsgCreateNestedMessagesResponse") } func init() { proto.RegisterFile("messages.proto", fileDescriptor_4dc296cbfe5ffcd5) } var fileDescriptor_4dc296cbfe5ffcd5 = []byte{ - // 390 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x92, 0xcf, 0xaa, 0xd3, 0x40, - 0x14, 0xc6, 0x1b, 0x83, 0x6d, 0x3d, 0xad, 0x5a, 0x42, 0xd1, 0x34, 0x42, 0x28, 0x5d, 0x48, 0x11, - 0x9a, 0xc1, 0xb8, 0x6b, 0x77, 0x8a, 0x54, 0x11, 0x11, 0x22, 0xb8, 0xe8, 0xa6, 0x4c, 0xd2, 0xd3, - 0x69, 0x68, 0x32, 0x13, 0x32, 0x93, 0x42, 0xb7, 0x3e, 0x81, 0x8f, 0xe2, 0x63, 0xb8, 0xec, 0xd2, - 0xa5, 0xb4, 0x0b, 0x5f, 0x43, 0xf2, 0xaf, 0x75, 0x71, 0x7b, 0xb9, 0xab, 0xbb, 0x9a, 0xf3, 0x7d, - 0x87, 0x9c, 0xdf, 0xc9, 0xc7, 0x81, 0x27, 0x31, 0x4a, 0x49, 0x19, 0x4a, 0x27, 0x49, 0x85, 0x12, - 0x56, 0x9f, 0x09, 0x26, 0x8a, 0x92, 0xe4, 0x55, 0xe5, 0x0e, 0x98, 0x10, 0x2c, 0x42, 0x52, 0x28, - 0x3f, 0x5b, 0x13, 0xca, 0xf7, 0x55, 0xeb, 0x79, 0x20, 0x64, 0x2c, 0x24, 0x89, 0x25, 0x23, 0xbb, - 0xd7, 0xf9, 0x53, 0x36, 0x46, 0x12, 0xe0, 0xb3, 0x64, 0xef, 0x44, 0xc6, 0x15, 0xa6, 0x86, 0x09, - 0xad, 0xa0, 0x2c, 0x4d, 0x6d, 0xa8, 0x8d, 0x75, 0xaf, 0x96, 0xc6, 0x4b, 0x78, 0xba, 0xa6, 0x61, - 0xb4, 0x14, 0x7c, 0xb9, 0xa1, 0x7c, 0x15, 0x61, 0x6a, 0x3e, 0x18, 0x6a, 0xe3, 0xb6, 0xf7, 0x38, - 0xb7, 0xbf, 0xf0, 0x0f, 0xa5, 0x69, 0x3c, 0x83, 0xa6, 0x0c, 0x19, 0xc7, 0xd4, 0xd4, 0x87, 0xda, - 0xf8, 0x91, 0x57, 0xa9, 0x69, 0xe7, 0xfb, 0xdf, 0x9f, 0xaf, 0x2a, 0x31, 0x52, 0xd0, 0xb9, 0x40, - 0xdd, 0xfb, 0xa2, 0x5a, 0x60, 0xe6, 0xd4, 0x14, 0xa9, 0xc2, 0x8a, 0xed, 0xa1, 0x4c, 0x04, 0x97, - 0x38, 0x5a, 0x14, 0x1b, 0x7d, 0xc2, 0xfd, 0x37, 0x1a, 0x65, 0x68, 0xf4, 0x40, 0xdf, 0xe2, 0xbe, - 0xd8, 0xa6, 0xeb, 0xe5, 0xa5, 0xd1, 0x87, 0x87, 0xbb, 0xbc, 0x55, 0xf0, 0xbb, 0x5e, 0x29, 0xee, - 0xc6, 0x7d, 0x01, 0x83, 0x33, 0xb7, 0x26, 0xd4, 0x60, 0xf7, 0x3d, 0xb4, 0xea, 0xf0, 0xa7, 0xd0, - 0xfb, 0xc8, 0x83, 0x14, 0x63, 0xe4, 0xaa, 0xf6, 0x3a, 0xce, 0x25, 0x28, 0x6b, 0xe0, 0x5c, 0xdb, - 0xdf, 0x9d, 0x43, 0xfb, 0x1c, 0xe7, 0xec, 0x86, 0x39, 0xdd, 0xff, 0xe6, 0xb8, 0xb7, 0x0d, 0x9a, - 0x41, 0xfb, 0x9c, 0x02, 0x01, 0xfd, 0x2b, 0xaa, 0xf2, 0xdb, 0xda, 0xb4, 0x2c, 0xe7, 0xea, 0xcf, - 0xbc, 0x9d, 0xff, 0x3a, 0xda, 0xda, 0xe1, 0x68, 0x6b, 0x7f, 0x8e, 0xb6, 0xf6, 0xe3, 0x64, 0x37, - 0x0e, 0x27, 0xbb, 0xf1, 0xfb, 0x64, 0x37, 0x16, 0x13, 0x16, 0xaa, 0x4d, 0xe6, 0x3b, 0x81, 0x88, - 0x49, 0x75, 0x8a, 0xe5, 0x33, 0x91, 0xab, 0x2d, 0xf1, 0xa9, 0x44, 0x9a, 0x24, 0x44, 0xa1, 0x54, - 0x99, 0x0a, 0x23, 0xbf, 0x59, 0x1c, 0xe7, 0x9b, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x44, 0x91, - 0x2d, 0xb3, 0xf8, 0x02, 0x00, 0x00, + // 535 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x93, 0xcf, 0x6e, 0xd3, 0x40, + 0x10, 0xc6, 0xeb, 0xa4, 0x6d, 0x92, 0x49, 0x48, 0xd3, 0x55, 0x04, 0x8e, 0x91, 0x4c, 0xc8, 0x01, + 0x45, 0x95, 0xba, 0x06, 0x73, 0x4b, 0xc5, 0x01, 0x2a, 0x54, 0x10, 0x0a, 0x45, 0xae, 0xc4, 0xa1, + 0x97, 0xca, 0x49, 0x26, 0x9b, 0x90, 0x78, 0x37, 0xf2, 0xae, 0x2b, 0xe5, 0xca, 0x13, 0xf0, 0x28, + 0x3c, 0x06, 0xc7, 0x1e, 0x39, 0xa2, 0xe4, 0xc0, 0x6b, 0x20, 0xaf, 0xff, 0xb4, 0x14, 0x02, 0x9c, + 0x38, 0xed, 0xcc, 0xac, 0x77, 0x7e, 0xb3, 0xfb, 0x7d, 0x86, 0x7a, 0x80, 0x52, 0xfa, 0x0c, 0x25, + 0x5d, 0x84, 0x42, 0x09, 0xab, 0xc9, 0x04, 0x13, 0x3a, 0x74, 0xe2, 0x28, 0xad, 0xb6, 0x98, 0x10, + 0x6c, 0x8e, 0x8e, 0xce, 0x06, 0xd1, 0xd8, 0xf1, 0xf9, 0x32, 0xdd, 0xba, 0x37, 0x14, 0x32, 0x10, + 0xd2, 0x09, 0x24, 0x73, 0x2e, 0x9f, 0xc4, 0x4b, 0xb2, 0xd1, 0x91, 0x00, 0x7d, 0xc9, 0x8e, 0x45, + 0xc4, 0x15, 0x86, 0xc4, 0x84, 0xd2, 0x30, 0x09, 0x4d, 0xa3, 0x6d, 0x74, 0x8b, 0x5e, 0x96, 0x92, + 0x47, 0xb0, 0x37, 0xf6, 0xa7, 0xf3, 0x0b, 0xc1, 0x2f, 0x26, 0x3e, 0x1f, 0xcd, 0x31, 0x34, 0x0b, + 0x6d, 0xa3, 0x5b, 0xf6, 0xee, 0xc4, 0xe5, 0x53, 0xfe, 0x2a, 0x29, 0x92, 0xbb, 0xb0, 0x2b, 0xa7, + 0x8c, 0x63, 0x68, 0x16, 0xdb, 0x46, 0xb7, 0xe2, 0xa5, 0x59, 0xaf, 0xfa, 0xf1, 0xfb, 0xe7, 0x83, + 0x34, 0xe9, 0x28, 0xa8, 0x5e, 0x43, 0xdd, 0xff, 0x45, 0xb5, 0xc0, 0x8c, 0xa9, 0x21, 0xfa, 0x0a, + 0x53, 0xb6, 0x87, 0x72, 0x21, 0xb8, 0xc4, 0xce, 0xb9, 0x9e, 0xe8, 0x0d, 0x2e, 0xdf, 0xfb, 0xf3, + 0x08, 0x49, 0x03, 0x8a, 0x33, 0x5c, 0xea, 0x69, 0x6a, 0x5e, 0x1c, 0x92, 0x26, 0xec, 0x5c, 0xc6, + 0x5b, 0x9a, 0x5f, 0xf3, 0x92, 0xe4, 0xdf, 0xb8, 0xf7, 0xa1, 0x95, 0x73, 0x33, 0x42, 0x0e, 0x7e, + 0x07, 0xa5, 0xbe, 0x64, 0x67, 0xc8, 0x47, 0x84, 0xc0, 0xf6, 0x38, 0x14, 0x81, 0xa6, 0x56, 0x3c, + 0x1d, 0x93, 0x3a, 0x14, 0x94, 0xd0, 0xcc, 0x8a, 0x57, 0x50, 0x22, 0x06, 0xfa, 0x41, 0x3c, 0x7b, + 0x06, 0x4c, 0xb2, 0x5e, 0x25, 0x06, 0xea, 0x23, 0x9d, 0x7d, 0xd8, 0x4b, 0x3b, 0xe6, 0x90, 0x0f, + 0xb0, 0xdf, 0x97, 0xec, 0x2d, 0x4a, 0x85, 0xa3, 0x7e, 0xea, 0x24, 0xf2, 0x18, 0xca, 0x99, 0xab, + 0x4c, 0xa3, 0x5d, 0xec, 0x56, 0xdd, 0x26, 0x4d, 0x0c, 0x44, 0x33, 0x03, 0xd1, 0xe7, 0x7c, 0xe9, + 0xe5, 0x5f, 0xdd, 0xb8, 0x6d, 0x61, 0xf3, 0x6d, 0x1f, 0xc2, 0x83, 0xfc, 0xb6, 0x3f, 0x13, 0xb3, + 0x71, 0xdc, 0x97, 0x50, 0xca, 0x0c, 0xd7, 0x83, 0xc6, 0x6b, 0x3e, 0x0c, 0x31, 0x40, 0xae, 0xb2, + 0x5a, 0x95, 0x5e, 0x9b, 0xc3, 0x6a, 0xd1, 0x4d, 0x9a, 0xb9, 0x27, 0x50, 0xce, 0x2d, 0x74, 0xf4, + 0x9b, 0x3e, 0xb5, 0x1b, 0x7d, 0xdc, 0x3f, 0x35, 0x3a, 0x82, 0x72, 0xae, 0xbc, 0x03, 0xc5, 0x33, + 0x54, 0xc9, 0xd9, 0xac, 0x68, 0x59, 0x74, 0xa3, 0x80, 0xee, 0x01, 0x6c, 0x6b, 0xf5, 0x3a, 0xe9, + 0x5a, 0xa6, 0xe9, 0xeb, 0x5b, 0x0d, 0x7a, 0x4b, 0x07, 0xf7, 0x14, 0xea, 0xb7, 0x44, 0x78, 0x06, + 0x3b, 0xc7, 0x13, 0x1c, 0xce, 0x08, 0xa1, 0xbf, 0x28, 0x64, 0xb5, 0xe9, 0x5f, 0x5e, 0xf2, 0xc5, + 0xc9, 0x97, 0x95, 0x6d, 0x5c, 0xad, 0x6c, 0xe3, 0xdb, 0xca, 0x36, 0x3e, 0xad, 0xed, 0xad, 0xab, + 0xb5, 0xbd, 0xf5, 0x75, 0x6d, 0x6f, 0x9d, 0x1f, 0xb2, 0xa9, 0x9a, 0x44, 0x03, 0x3a, 0x14, 0x81, + 0x93, 0xfe, 0xfb, 0xc9, 0x72, 0x28, 0x47, 0x33, 0x67, 0xe0, 0x4b, 0xf4, 0x17, 0x0b, 0x47, 0xa1, + 0x54, 0x91, 0x9a, 0xce, 0x07, 0xbb, 0x5a, 0xf2, 0xa7, 0x3f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x12, + 0x9a, 0xa4, 0x74, 0x69, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -388,6 +585,7 @@ func _Counter_IncrementCounter_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +var Counter_serviceDesc = _Counter_serviceDesc var _Counter_serviceDesc = grpc.ServiceDesc{ ServiceName: "Counter", HandlerType: (*CounterServer)(nil), @@ -460,6 +658,7 @@ func _Counter2_IncrementCounter_Handler(srv interface{}, ctx context.Context, de return interceptor(ctx, in, info, handler) } +var Counter2_serviceDesc = _Counter2_serviceDesc var _Counter2_serviceDesc = grpc.ServiceDesc{ ServiceName: "Counter2", HandlerType: (*Counter2Server)(nil), @@ -532,6 +731,7 @@ func _KeyValue_Set_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } +var KeyValue_serviceDesc = _KeyValue_serviceDesc var _KeyValue_serviceDesc = grpc.ServiceDesc{ ServiceName: "KeyValue", HandlerType: (*KeyValueServer)(nil), @@ -545,6 +745,150 @@ var _KeyValue_serviceDesc = grpc.ServiceDesc{ Metadata: "messages.proto", } +// SendClient is the client API for Send service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type SendClient interface { + Send(ctx context.Context, in *MsgSend, opts ...grpc.CallOption) (*MsgSendResponse, error) +} + +type sendClient struct { + cc grpc1.ClientConn +} + +func NewSendClient(cc grpc1.ClientConn) SendClient { + return &sendClient{cc} +} + +func (c *sendClient) Send(ctx context.Context, in *MsgSend, opts ...grpc.CallOption) (*MsgSendResponse, error) { + out := new(MsgSendResponse) + err := c.cc.Invoke(ctx, "/Send/Send", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// SendServer is the server API for Send service. +type SendServer interface { + Send(context.Context, *MsgSend) (*MsgSendResponse, error) +} + +// UnimplementedSendServer can be embedded to have forward compatible implementations. +type UnimplementedSendServer struct { +} + +func (*UnimplementedSendServer) Send(ctx context.Context, req *MsgSend) (*MsgSendResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Send not implemented") +} + +func RegisterSendServer(s grpc1.Server, srv SendServer) { + s.RegisterService(&_Send_serviceDesc, srv) +} + +func _Send_Send_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSend) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SendServer).Send(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/Send/Send", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SendServer).Send(ctx, req.(*MsgSend)) + } + return interceptor(ctx, in, info, handler) +} + +var _Send_serviceDesc = grpc.ServiceDesc{ + ServiceName: "Send", + HandlerType: (*SendServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Send", + Handler: _Send_Send_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "messages.proto", +} + +// NestedMessagesClient is the client API for NestedMessages service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type NestedMessagesClient interface { + Check(ctx context.Context, in *MsgNestedMessages, opts ...grpc.CallOption) (*MsgCreateNestedMessagesResponse, error) +} + +type nestedMessagesClient struct { + cc grpc1.ClientConn +} + +func NewNestedMessagesClient(cc grpc1.ClientConn) NestedMessagesClient { + return &nestedMessagesClient{cc} +} + +func (c *nestedMessagesClient) Check(ctx context.Context, in *MsgNestedMessages, opts ...grpc.CallOption) (*MsgCreateNestedMessagesResponse, error) { + out := new(MsgCreateNestedMessagesResponse) + err := c.cc.Invoke(ctx, "/NestedMessages/Check", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// NestedMessagesServer is the server API for NestedMessages service. +type NestedMessagesServer interface { + Check(context.Context, *MsgNestedMessages) (*MsgCreateNestedMessagesResponse, error) +} + +// UnimplementedNestedMessagesServer can be embedded to have forward compatible implementations. +type UnimplementedNestedMessagesServer struct { +} + +func (*UnimplementedNestedMessagesServer) Check(ctx context.Context, req *MsgNestedMessages) (*MsgCreateNestedMessagesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Check not implemented") +} + +func RegisterNestedMessagesServer(s grpc1.Server, srv NestedMessagesServer) { + s.RegisterService(&_NestedMessages_serviceDesc, srv) +} + +func _NestedMessages_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgNestedMessages) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NestedMessagesServer).Check(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/NestedMessages/Check", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NestedMessagesServer).Check(ctx, req.(*MsgNestedMessages)) + } + return interceptor(ctx, in, info, handler) +} + +var _NestedMessages_serviceDesc = grpc.ServiceDesc{ + ServiceName: "NestedMessages", + HandlerType: (*NestedMessagesServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Check", + Handler: _NestedMessages_Check_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "messages.proto", +} + func (m *MsgCounter) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -725,39 +1069,173 @@ func (m *MsgCreateKeyValueResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } -func encodeVarintMessages(dAtA []byte, offset int, v uint64) int { - offset -= sovMessages(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *MsgSend) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -func (m *MsgCounter) Size() (n int) { - if m == nil { - return 0 - } + +func (m *MsgSend) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSend) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.Counter != 0 { - n += 1 + sovMessages(uint64(m.Counter)) + if len(m.Amount) > 0 { + i -= len(m.Amount) + copy(dAtA[i:], m.Amount) + i = encodeVarintMessages(dAtA, i, uint64(len(m.Amount))) + i-- + dAtA[i] = 0x1a } - if m.FailOnHandler { - n += 2 + if len(m.To) > 0 { + i -= len(m.To) + copy(dAtA[i:], m.To) + i = encodeVarintMessages(dAtA, i, uint64(len(m.To))) + i-- + dAtA[i] = 0x12 } - l = len(m.Signer) - if l > 0 { - n += 1 + l + sovMessages(uint64(l)) + if len(m.From) > 0 { + i -= len(m.From) + copy(dAtA[i:], m.From) + i = encodeVarintMessages(dAtA, i, uint64(len(m.From))) + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *MsgCounter2) Size() (n int) { - if m == nil { - return 0 +func (m *MsgSendResponse) 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 *MsgSendResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSendResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgNestedMessages) 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 *MsgNestedMessages) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgNestedMessages) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintMessages(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x12 + } + if len(m.Messages) > 0 { + for iNdEx := len(m.Messages) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Messages[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMessages(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *MsgCreateNestedMessagesResponse) 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 *MsgCreateNestedMessagesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateNestedMessagesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintMessages(dAtA []byte, offset int, v uint64) int { + offset -= sovMessages(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgCounter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Counter != 0 { + n += 1 + sovMessages(uint64(m.Counter)) + } + if m.FailOnHandler { + n += 2 + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovMessages(uint64(l)) + } + return n +} + +func (m *MsgCounter2) Size() (n int) { + if m == nil { + return 0 } var l int _ = l @@ -813,6 +1291,64 @@ func (m *MsgCreateKeyValueResponse) Size() (n int) { return n } +func (m *MsgSend) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.From) + if l > 0 { + n += 1 + l + sovMessages(uint64(l)) + } + l = len(m.To) + if l > 0 { + n += 1 + l + sovMessages(uint64(l)) + } + l = len(m.Amount) + if l > 0 { + n += 1 + l + sovMessages(uint64(l)) + } + return n +} + +func (m *MsgSendResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgNestedMessages) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Messages) > 0 { + for _, e := range m.Messages { + l = e.Size() + n += 1 + l + sovMessages(uint64(l)) + } + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovMessages(uint64(l)) + } + return n +} + +func (m *MsgCreateNestedMessagesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovMessages(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1311,6 +1847,368 @@ func (m *MsgCreateKeyValueResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgSend) 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 ErrIntOverflowMessages + } + 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: MsgSend: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSend: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + 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 ErrInvalidLengthMessages + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMessages + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.From = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + 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 ErrInvalidLengthMessages + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMessages + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.To = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + 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 ErrInvalidLengthMessages + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMessages + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Amount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMessages(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMessages + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSendResponse) 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 ErrIntOverflowMessages + } + 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: MsgSendResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSendResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipMessages(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMessages + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgNestedMessages) 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 ErrIntOverflowMessages + } + 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: MsgNestedMessages: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgNestedMessages: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Messages", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMessages + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMessages + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Messages = append(m.Messages, &any.Any{}) + if err := m.Messages[len(m.Messages)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + 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 ErrInvalidLengthMessages + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMessages + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMessages(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMessages + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreateNestedMessagesResponse) 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 ErrIntOverflowMessages + } + 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: MsgCreateNestedMessagesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateNestedMessagesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipMessages(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMessages + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipMessages(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/baseapp/testutil/messages.proto b/baseapp/testutil/messages.proto index 1cce9dba5ded..2e0cfd15195f 100644 --- a/baseapp/testutil/messages.proto +++ b/baseapp/testutil/messages.proto @@ -9,17 +9,17 @@ option go_package = "github.com/cosmos/cosmos-sdk/baseapp/testutil"; message MsgCounter { option (cosmos.msg.v1.signer) = "signer"; - int64 counter = 1; - bool fail_on_handler = 2; - string signer = 3; + int64 counter = 1; + bool fail_on_handler = 2; + string signer = 3; } message MsgCounter2 { option (cosmos.msg.v1.signer) = "signer"; - int64 counter = 1; - bool fail_on_handler = 2; - string signer = 3; + int64 counter = 1; + bool fail_on_handler = 2; + string signer = 3; } message MsgCreateCounterResponse {} @@ -34,6 +34,25 @@ message MsgKeyValue { message MsgCreateKeyValueResponse {} +message MsgSend { + option (cosmos.msg.v1.signer) = "from"; + + string from = 1; + string to = 2; + string amount = 3; +} + +message MsgSendResponse {} + +message MsgNestedMessages { + option (cosmos.msg.v1.signer) = "signer"; + + repeated google.protobuf.Any messages = 1; + string signer = 2; +} + +message MsgCreateNestedMessagesResponse {} + service Counter { rpc IncrementCounter(MsgCounter) returns (MsgCreateCounterResponse); } @@ -44,4 +63,12 @@ service Counter2 { service KeyValue { rpc Set(MsgKeyValue) returns (MsgCreateKeyValueResponse); -} \ No newline at end of file +} + +service Send { + rpc Send(MsgSend) returns (MsgSendResponse); +} + +service NestedMessages { + rpc Check(MsgNestedMessages) returns (MsgCreateNestedMessagesResponse); +} diff --git a/baseapp/testutil/mock/mocks.go b/baseapp/testutil/mock/mocks.go new file mode 100644 index 000000000000..51de61fa7156 --- /dev/null +++ b/baseapp/testutil/mock/mocks.go @@ -0,0 +1,244 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: baseapp/abci_utils.go +// +// Generated by this command: +// +// mockgen -source=baseapp/abci_utils.go -package mock -destination baseapp/testutil/mock/mocks.go +// + +// Package mock is a generated GoMock package. +package mock + +import ( + context "context" + reflect "reflect" + + crypto "github.com/cometbft/cometbft/proto/tendermint/crypto" + types "github.com/cosmos/cosmos-sdk/types" + gomock "go.uber.org/mock/gomock" +) + +// MockValidatorStore is a mock of ValidatorStore interface. +type MockValidatorStore struct { + ctrl *gomock.Controller + recorder *MockValidatorStoreMockRecorder + isgomock struct{} +} + +// MockValidatorStoreMockRecorder is the mock recorder for MockValidatorStore. +type MockValidatorStoreMockRecorder struct { + mock *MockValidatorStore +} + +// NewMockValidatorStore creates a new mock instance. +func NewMockValidatorStore(ctrl *gomock.Controller) *MockValidatorStore { + mock := &MockValidatorStore{ctrl: ctrl} + mock.recorder = &MockValidatorStoreMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockValidatorStore) EXPECT() *MockValidatorStoreMockRecorder { + return m.recorder +} + +// GetPubKeyByConsAddr mocks base method. +func (m *MockValidatorStore) GetPubKeyByConsAddr(arg0 context.Context, arg1 types.ConsAddress) (crypto.PublicKey, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetPubKeyByConsAddr", arg0, arg1) + ret0, _ := ret[0].(crypto.PublicKey) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetPubKeyByConsAddr indicates an expected call of GetPubKeyByConsAddr. +func (mr *MockValidatorStoreMockRecorder) GetPubKeyByConsAddr(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPubKeyByConsAddr", reflect.TypeOf((*MockValidatorStore)(nil).GetPubKeyByConsAddr), arg0, arg1) +} + +// MockGasTx is a mock of GasTx interface. +type MockGasTx struct { + ctrl *gomock.Controller + recorder *MockGasTxMockRecorder + isgomock struct{} +} + +// MockGasTxMockRecorder is the mock recorder for MockGasTx. +type MockGasTxMockRecorder struct { + mock *MockGasTx +} + +// NewMockGasTx creates a new mock instance. +func NewMockGasTx(ctrl *gomock.Controller) *MockGasTx { + mock := &MockGasTx{ctrl: ctrl} + mock.recorder = &MockGasTxMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockGasTx) EXPECT() *MockGasTxMockRecorder { + return m.recorder +} + +// GetGas mocks base method. +func (m *MockGasTx) GetGas() uint64 { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetGas") + ret0, _ := ret[0].(uint64) + return ret0 +} + +// GetGas indicates an expected call of GetGas. +func (mr *MockGasTxMockRecorder) GetGas() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetGas", reflect.TypeOf((*MockGasTx)(nil).GetGas)) +} + +// MockProposalTxVerifier is a mock of ProposalTxVerifier interface. +type MockProposalTxVerifier struct { + ctrl *gomock.Controller + recorder *MockProposalTxVerifierMockRecorder + isgomock struct{} +} + +// MockProposalTxVerifierMockRecorder is the mock recorder for MockProposalTxVerifier. +type MockProposalTxVerifierMockRecorder struct { + mock *MockProposalTxVerifier +} + +// NewMockProposalTxVerifier creates a new mock instance. +func NewMockProposalTxVerifier(ctrl *gomock.Controller) *MockProposalTxVerifier { + mock := &MockProposalTxVerifier{ctrl: ctrl} + mock.recorder = &MockProposalTxVerifierMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockProposalTxVerifier) EXPECT() *MockProposalTxVerifierMockRecorder { + return m.recorder +} + +// PrepareProposalVerifyTx mocks base method. +func (m *MockProposalTxVerifier) PrepareProposalVerifyTx(tx types.Tx) ([]byte, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "PrepareProposalVerifyTx", tx) + ret0, _ := ret[0].([]byte) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// PrepareProposalVerifyTx indicates an expected call of PrepareProposalVerifyTx. +func (mr *MockProposalTxVerifierMockRecorder) PrepareProposalVerifyTx(tx any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PrepareProposalVerifyTx", reflect.TypeOf((*MockProposalTxVerifier)(nil).PrepareProposalVerifyTx), tx) +} + +// ProcessProposalVerifyTx mocks base method. +func (m *MockProposalTxVerifier) ProcessProposalVerifyTx(txBz []byte) (types.Tx, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ProcessProposalVerifyTx", txBz) + ret0, _ := ret[0].(types.Tx) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ProcessProposalVerifyTx indicates an expected call of ProcessProposalVerifyTx. +func (mr *MockProposalTxVerifierMockRecorder) ProcessProposalVerifyTx(txBz any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProcessProposalVerifyTx", reflect.TypeOf((*MockProposalTxVerifier)(nil).ProcessProposalVerifyTx), txBz) +} + +// TxDecode mocks base method. +func (m *MockProposalTxVerifier) TxDecode(txBz []byte) (types.Tx, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "TxDecode", txBz) + ret0, _ := ret[0].(types.Tx) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// TxDecode indicates an expected call of TxDecode. +func (mr *MockProposalTxVerifierMockRecorder) TxDecode(txBz any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TxDecode", reflect.TypeOf((*MockProposalTxVerifier)(nil).TxDecode), txBz) +} + +// TxEncode mocks base method. +func (m *MockProposalTxVerifier) TxEncode(tx types.Tx) ([]byte, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "TxEncode", tx) + ret0, _ := ret[0].([]byte) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// TxEncode indicates an expected call of TxEncode. +func (mr *MockProposalTxVerifierMockRecorder) TxEncode(tx any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TxEncode", reflect.TypeOf((*MockProposalTxVerifier)(nil).TxEncode), tx) +} + +// MockTxSelector is a mock of TxSelector interface. +type MockTxSelector struct { + ctrl *gomock.Controller + recorder *MockTxSelectorMockRecorder + isgomock struct{} +} + +// MockTxSelectorMockRecorder is the mock recorder for MockTxSelector. +type MockTxSelectorMockRecorder struct { + mock *MockTxSelector +} + +// NewMockTxSelector creates a new mock instance. +func NewMockTxSelector(ctrl *gomock.Controller) *MockTxSelector { + mock := &MockTxSelector{ctrl: ctrl} + mock.recorder = &MockTxSelectorMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockTxSelector) EXPECT() *MockTxSelectorMockRecorder { + return m.recorder +} + +// Clear mocks base method. +func (m *MockTxSelector) Clear() { + m.ctrl.T.Helper() + m.ctrl.Call(m, "Clear") +} + +// Clear indicates an expected call of Clear. +func (mr *MockTxSelectorMockRecorder) Clear() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Clear", reflect.TypeOf((*MockTxSelector)(nil).Clear)) +} + +// SelectTxForProposal mocks base method. +func (m *MockTxSelector) SelectTxForProposal(ctx context.Context, maxTxBytes, maxBlockGas uint64, memTx types.Tx, txBz []byte) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SelectTxForProposal", ctx, maxTxBytes, maxBlockGas, memTx, txBz) + ret0, _ := ret[0].(bool) + return ret0 +} + +// SelectTxForProposal indicates an expected call of SelectTxForProposal. +func (mr *MockTxSelectorMockRecorder) SelectTxForProposal(ctx, maxTxBytes, maxBlockGas, memTx, txBz any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SelectTxForProposal", reflect.TypeOf((*MockTxSelector)(nil).SelectTxForProposal), ctx, maxTxBytes, maxBlockGas, memTx, txBz) +} + +// SelectedTxs mocks base method. +func (m *MockTxSelector) SelectedTxs(ctx context.Context) [][]byte { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SelectedTxs", ctx) + ret0, _ := ret[0].([][]byte) + return ret0 +} + +// SelectedTxs indicates an expected call of SelectedTxs. +func (mr *MockTxSelectorMockRecorder) SelectedTxs(ctx any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SelectedTxs", reflect.TypeOf((*MockTxSelector)(nil).SelectedTxs), ctx) +} diff --git a/baseapp/utils_test.go b/baseapp/utils_test.go index e436b47ad73e..403642e5d3f1 100644 --- a/baseapp/utils_test.go +++ b/baseapp/utils_test.go @@ -13,28 +13,31 @@ import ( "testing" "unsafe" - runtimev1alpha1 "cosmossdk.io/api/cosmos/app/runtime/v1alpha1" - appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" - "cosmossdk.io/depinject" - errorsmod "cosmossdk.io/errors" - sdkmath "cosmossdk.io/math" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" cmttypes "github.com/cometbft/cometbft/types" dbm "github.com/cosmos/cosmos-db" "github.com/stretchr/testify/require" + runtimev1alpha1 "cosmossdk.io/api/cosmos/app/runtime/v1alpha1" + appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" + "cosmossdk.io/core/address" "cosmossdk.io/core/appconfig" + "cosmossdk.io/depinject" + errorsmod "cosmossdk.io/errors" + "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" - "github.com/cosmos/cosmos-sdk/testutil/testdata" "github.com/cosmos/cosmos-sdk/baseapp" baseapptestutil "github.com/cosmos/cosmos-sdk/baseapp/testutil" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" + codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/testutil/mock" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/mempool" @@ -72,7 +75,7 @@ func GenesisStateWithSingleValidator(t *testing.T, codec codec.Codec, builder *r balances := []banktypes.Balance{ { Address: acc.GetAddress().String(), - Coins: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(100000000000000))), + Coins: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(100000000000000))), }, } @@ -85,9 +88,15 @@ func GenesisStateWithSingleValidator(t *testing.T, codec codec.Codec, builder *r } func makeMinimalConfig() depinject.Config { - var mempoolOpt runtime.BaseAppOption = baseapp.SetMempool(mempool.NewSenderNonceMempool()) + var ( + mempoolOpt = baseapp.SetMempool(mempool.NewSenderNonceMempool()) + addressCodec = func() address.Codec { return addresscodec.NewBech32Codec("cosmos") } + validatorAddressCodec = func() runtime.ValidatorAddressCodec { return addresscodec.NewBech32Codec("cosmosvaloper") } + consensusAddressCodec = func() runtime.ConsensusAddressCodec { return addresscodec.NewBech32Codec("cosmosvalcons") } + ) + return depinject.Configs( - depinject.Supply(mempoolOpt), + depinject.Supply(mempoolOpt, addressCodec, validatorAddressCodec, consensusAddressCodec), appconfig.Compose(&appv1alpha1.Config{ Modules: []*appv1alpha1.ModuleConfig{ { @@ -382,3 +391,86 @@ func setFailOnHandler(cfg client.TxConfig, tx signing.Tx, fail bool) signing.Tx builder.SetMsgs(msgs...) return builder.GetTx() } + +// wonkyMsg is to be used to run a MsgCounter2 message when the MsgCounter2 handler is not registered. +func wonkyMsg(t *testing.T, cfg client.TxConfig, tx signing.Tx) signing.Tx { + t.Helper() + builder := cfg.NewTxBuilder() + builder.SetMemo(tx.GetMemo()) + + msgs := tx.GetMsgs() + msgs = append(msgs, &baseapptestutil.MsgCounter2{}) + + err := builder.SetMsgs(msgs...) + require.NoError(t, err) + return builder.GetTx() +} + +type SendServerImpl struct { + gas uint64 +} + +func (s SendServerImpl) Send(ctx context.Context, send *baseapptestutil.MsgSend) (*baseapptestutil.MsgSendResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + if send.From == "" { + return nil, errors.New("from address cannot be empty") + } + if send.To == "" { + return nil, errors.New("to address cannot be empty") + } + + _, err := sdk.ParseCoinNormalized(send.Amount) + if err != nil { + return nil, err + } + gas := s.gas + if gas == 0 { + gas = 5 + } + sdkCtx.GasMeter().ConsumeGas(gas, "send test") + return &baseapptestutil.MsgSendResponse{}, nil +} + +type NestedMessgesServerImpl struct { + gas uint64 +} + +func (n NestedMessgesServerImpl) Check(ctx context.Context, message *baseapptestutil.MsgNestedMessages) (*baseapptestutil.MsgCreateNestedMessagesResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + cdc := codectestutil.CodecOptions{}.NewCodec() + baseapptestutil.RegisterInterfaces(cdc.InterfaceRegistry()) + + signer, _, err := cdc.GetMsgSigners(message) + if err != nil { + return nil, err + } + if len(signer) != 1 { + return nil, fmt.Errorf("expected 1 signer, got %d", len(signer)) + } + + msgs, err := message.GetMsgs() + if err != nil { + return nil, err + } + + for _, msg := range msgs { + s, _, err := cdc.GetMsgSigners(msg) + if err != nil { + return nil, err + } + if len(s) != 1 { + return nil, fmt.Errorf("expected 1 signer, got %d", len(s)) + } + if !bytes.Equal(signer[0], s[0]) { + return nil, errors.New("signer does not match") + } + + } + + gas := n.gas + if gas == 0 { + gas = 5 + } + sdkCtx.GasMeter().ConsumeGas(gas, "nested messages test") + return nil, nil +} diff --git a/buf.work.yaml b/buf.work.yaml index d8175d0ef814..7a18eb0259c6 100644 --- a/buf.work.yaml +++ b/buf.work.yaml @@ -1,9 +1,3 @@ -# Generated by "buf config migrate-v1beta1". Edit as necessary, and -# remove this comment when you're finished. -# -# This workspace file points to the roots found in your -# previous "buf.yaml" configuration. version: v1 directories: - - proto - - orm/internal + - proto \ No newline at end of file diff --git a/client/cmd.go b/client/cmd.go index e5f9f793857e..f92c1a09fa19 100644 --- a/client/cmd.go +++ b/client/cmd.go @@ -1,8 +1,10 @@ package client import ( + "context" "crypto/tls" "fmt" + "slices" "strings" "github.com/cockroachdb/errors" @@ -166,7 +168,7 @@ func ReadPersistentCommandFlags(clientCtx Context, flagSet *pflag.FlagSet) (Cont }))) } - grpcClient, err := grpc.Dial(grpcURI, dialOpts...) + grpcClient, err := grpc.Dial(grpcURI, dialOpts...) // nolint:staticcheck // grpc.Dial is deprecated but we still use it if err != nil { return Context{}, err } @@ -277,20 +279,13 @@ func readTxCommandFlags(clientCtx Context, flagSet *pflag.FlagSet) (Context, err from, _ := flagSet.GetString(flags.FlagFrom) fromAddr, fromName, keyType, err := GetFromFields(clientCtx, clientCtx.Keyring, from) if err != nil { - return clientCtx, err + return clientCtx, fmt.Errorf("failed to convert address field to address: %w", err) } clientCtx = clientCtx.WithFrom(from).WithFromAddress(fromAddr).WithFromName(fromName) if keyType == keyring.TypeLedger && clientCtx.SignModeStr == flags.SignModeTextual { - textualEnabled := false - for _, v := range clientCtx.TxConfig.SignModeHandler().SupportedModes() { - if v == signingv1beta1.SignMode_SIGN_MODE_TEXTUAL { - textualEnabled = true - break - } - } - if !textualEnabled { + if !slices.Contains(clientCtx.TxConfig.SignModeHandler().SupportedModes(), signingv1beta1.SignMode_SIGN_MODE_TEXTUAL) { return clientCtx, fmt.Errorf("SIGN_MODE_TEXTUAL is not available") } } @@ -311,14 +306,12 @@ func readTxCommandFlags(clientCtx Context, flagSet *pflag.FlagSet) (Context, err isAux, _ := flagSet.GetBool(flags.FlagAux) clientCtx = clientCtx.WithAux(isAux) if isAux { - // If the user didn't explicitly set an --output flag, use JSON by - // default. + // If the user didn't explicitly set an --output flag, use JSON by default. if clientCtx.OutputFormat == "" || !flagSet.Changed(flags.FlagOutput) { clientCtx = clientCtx.WithOutputFormat(flags.OutputFormatJSON) } - // If the user didn't explicitly set a --sign-mode flag, use - // DIRECT_AUX by default. + // If the user didn't explicitly set a --sign-mode flag, use DIRECT_AUX by default. if clientCtx.SignModeStr == "" || !flagSet.Changed(flags.FlagSignMode) { clientCtx = clientCtx.WithSignModeStr(flags.SignModeDirectAux) } @@ -366,13 +359,17 @@ func GetClientContextFromCmd(cmd *cobra.Command) Context { // SetCmdClientContext sets a command's Context value to the provided argument. // If the context has not been set, set the given context as the default. func SetCmdClientContext(cmd *cobra.Command, clientCtx Context) error { - v := cmd.Context().Value(ClientContextKey) - if v == nil { - v = &clientCtx + cmdCtx := cmd.Context() + if cmdCtx == nil { + cmdCtx = context.Background() } - clientCtxPtr := v.(*Context) - *clientCtxPtr = clientCtx + v := cmd.Context().Value(ClientContextKey) + if clientCtxPtr, ok := v.(*Context); ok { + *clientCtxPtr = clientCtx + } else { + cmd.SetContext(context.WithValue(cmdCtx, ClientContextKey, &clientCtx)) + } return nil } diff --git a/client/cmd_test.go b/client/cmd_test.go index 81d5719ccfb6..559d31d39f40 100644 --- a/client/cmd_test.go +++ b/client/cmd_test.go @@ -79,11 +79,13 @@ func TestSetCmdClientContextHandler(t *testing.T) { name string expectedContext client.Context args []string + ctx context.Context }{ { "no flags set", initClientCtx, []string{}, + context.WithValue(context.Background(), client.ClientContextKey, &client.Context{}), }, { "flags set", @@ -91,6 +93,7 @@ func TestSetCmdClientContextHandler(t *testing.T) { []string{ fmt.Sprintf("--%s=new-chain-id", flags.FlagChainID), }, + context.WithValue(context.Background(), client.ClientContextKey, &client.Context{}), }, { "flags set with space", @@ -99,6 +102,25 @@ func TestSetCmdClientContextHandler(t *testing.T) { fmt.Sprintf("--%s", flags.FlagHome), "/tmp/dir", }, + context.Background(), + }, + { + "no context provided", + initClientCtx.WithHomeDir("/tmp/noctx"), + []string{ + fmt.Sprintf("--%s", flags.FlagHome), + "/tmp/noctx", + }, + nil, + }, + { + "with invalid client value in the context", + initClientCtx.WithHomeDir("/tmp/invalid"), + []string{ + fmt.Sprintf("--%s", flags.FlagHome), + "/tmp/invalid", + }, + context.WithValue(context.Background(), client.ClientContextKey, "invalid"), }, } @@ -106,13 +128,11 @@ func TestSetCmdClientContextHandler(t *testing.T) { tc := tc t.Run(tc.name, func(t *testing.T) { - ctx := context.WithValue(context.Background(), client.ClientContextKey, &client.Context{}) - cmd := newCmd() _ = testutil.ApplyMockIODiscardOutErr(cmd) cmd.SetArgs(tc.args) - require.NoError(t, cmd.ExecuteContext(ctx)) + require.NoError(t, cmd.ExecuteContext(tc.ctx)) clientCtx := client.GetClientContextFromCmd(cmd) require.Equal(t, tc.expectedContext, clientCtx) diff --git a/client/cometbft.go b/client/cometbft.go index 595ea6492d24..fcf9ca64b08b 100644 --- a/client/cometbft.go +++ b/client/cometbft.go @@ -16,6 +16,7 @@ type CometRPC interface { Status(context.Context) (*coretypes.ResultStatus, error) Block(ctx context.Context, height *int64) (*coretypes.ResultBlock, error) BlockByHash(ctx context.Context, hash []byte) (*coretypes.ResultBlock, error) + BlockResults(ctx context.Context, height *int64) (*coretypes.ResultBlockResults, error) BlockchainInfo(ctx context.Context, minHeight, maxHeight int64) (*coretypes.ResultBlockchainInfo, error) Commit(ctx context.Context, height *int64) (*coretypes.ResultCommit, error) Tx(ctx context.Context, hash []byte, prove bool) (*coretypes.ResultTx, error) diff --git a/client/config/config.go b/client/config/config.go index ffe662cfc87e..e3a2a8646d93 100644 --- a/client/config/config.go +++ b/client/config/config.go @@ -46,13 +46,33 @@ func (c *ClientConfig) SetBroadcastMode(broadcastMode string) { c.BroadcastMode = broadcastMode } +// ReadDefaultValuesFromDefaultClientConfig reads default values from default client.toml file and updates them in client.Context +// The client.toml is then discarded. +func ReadDefaultValuesFromDefaultClientConfig(ctx client.Context) (client.Context, error) { + prevHomeDir := ctx.HomeDir + dir, err := os.MkdirTemp("", "simapp") + if err != nil { + return ctx, fmt.Errorf("couldn't create temp dir: %w", err) + } + defer os.RemoveAll(dir) + + ctx.HomeDir = dir + ctx, err = ReadFromClientConfig(ctx) + if err != nil { + return ctx, fmt.Errorf("couldn't create client config: %w", err) + } + + ctx.HomeDir = prevHomeDir + return ctx, nil +} + // ReadFromClientConfig reads values from client.toml file and updates them in client Context func ReadFromClientConfig(ctx client.Context) (client.Context, error) { configPath := filepath.Join(ctx.HomeDir, "config") configFilePath := filepath.Join(configPath, "client.toml") conf := DefaultConfig() - // when config.toml does not exist create and init with default values + // when client.toml does not exist create and init with default values if _, err := os.Stat(configFilePath); os.IsNotExist(err) { if err := os.MkdirAll(configPath, os.ModePerm); err != nil { return ctx, fmt.Errorf("couldn't make client config: %v", err) @@ -78,7 +98,7 @@ func ReadFromClientConfig(ctx client.Context) (client.Context, error) { keyring, err := client.NewKeyringFromBackend(ctx, conf.KeyringBackend) if err != nil { - return ctx, fmt.Errorf("couldn't get key ring: %v", err) + return ctx, fmt.Errorf("couldn't get keyring: %w", err) } ctx = ctx.WithKeyring(keyring) diff --git a/client/config/config_test.go b/client/config/config_test.go index c5630f22a378..42248b194bf9 100644 --- a/client/config/config_test.go +++ b/client/config/config_test.go @@ -5,14 +5,15 @@ import ( "os" "testing" + "github.com/spf13/cobra" + "github.com/stretchr/testify/require" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/config" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - "github.com/spf13/cobra" - "github.com/stretchr/testify/require" ) const ( diff --git a/client/debug/main.go b/client/debug/main.go index 17dd0ba2a19f..1c02a2257da7 100644 --- a/client/debug/main.go +++ b/client/debug/main.go @@ -16,10 +16,9 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" + legacybech32 "github.com/cosmos/cosmos-sdk/types/bech32/legacybech32" //nolint:staticcheck // we do old keys, they're keys after all. "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/version" - - legacybech32 "github.com/cosmos/cosmos-sdk/types/bech32/legacybech32" //nolint:staticcheck // we do old keys, they're keys after all. ) var ( @@ -35,6 +34,7 @@ func Cmd() *cobra.Command { RunE: client.ValidateCmd, } + cmd.AddCommand(CodecCmd()) cmd.AddCommand(PubkeyCmd()) cmd.AddCommand(PubkeyRawCmd()) cmd.AddCommand(AddrCmd()) @@ -44,6 +44,55 @@ func Cmd() *cobra.Command { return cmd } +// CodecCmd creates and returns a new codec debug cmd. +func CodecCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "codec", + Short: "Tool for helping with debugging your application codec", + RunE: client.ValidateCmd, + } + + cmd.AddCommand(getCodecInterfaces()) + cmd.AddCommand(getCodecInterfaceImpls()) + + return cmd +} + +// getCodecInterfaces creates and returns a new cmd used for listing all registered interfaces on the application codec. +func getCodecInterfaces() *cobra.Command { + return &cobra.Command{ + Use: "list-interfaces", + Short: "List all registered interface type URLs", + Long: "List all registered interface type URLs using the application codec", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + iFaces := clientCtx.Codec.InterfaceRegistry().ListAllInterfaces() + for _, iFace := range iFaces { + cmd.Println(iFace) + } + return nil + }, + } +} + +// getCodecInterfaceImpls creates and returns a new cmd used for listing all registered implemenations of a given interface on the application codec. +func getCodecInterfaceImpls() *cobra.Command { + return &cobra.Command{ + Use: "list-implementations [interface]", + Short: "List the registered type URLs for the provided interface", + Long: "List the registered type URLs that can be used for the provided interface name using the application codec", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + impls := clientCtx.Codec.InterfaceRegistry().ListImplementations(args[0]) + for _, imp := range impls { + cmd.Println(imp) + } + return nil + }, + } +} + // getPubKeyFromString decodes SDK PubKey using JSON marshaler. func getPubKeyFromString(ctx client.Context, pkstr string) (cryptotypes.PubKey, error) { var pk cryptotypes.PubKey @@ -130,11 +179,12 @@ func PubkeyRawCmd() *cobra.Command { cmd := &cobra.Command{ Use: "pubkey-raw [pubkey] -t [{ed25519, secp256k1}]", Short: "Decode a ED25519 or secp256k1 pubkey from hex, base64, or bech32", - Long: fmt.Sprintf(`Decode a pubkey from hex, base64, or bech32. -Example: -$ %s debug pubkey-raw TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlz -$ %s debug pubkey-raw cosmos1e0jnq2sun3dzjh8p2xq95kk0expwmd7shwjpfg - `, version.AppName, version.AppName), + Long: "Decode a pubkey from hex, base64, or bech32.", + Example: fmt.Sprintf(` +%s debug pubkey-raw 8FCA9D6D1F80947FD5E9A05309259746F5F72541121766D5F921339DD061174A +%s debug pubkey-raw j8qdbR+AlH/V6aBTCSWXRvX3JUESF2bV+SEzndBhF0o= +%s debug pubkey-raw cosmospub1zcjduepq3l9f6mglsz28l40f5pfsjfvhgm6lwf2pzgtkd40eyyeem5rpza9q47axrz + `, version.AppName, version.AppName, version.AppName), Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { clientCtx := client.GetClientContextFromCmd(cmd) @@ -204,28 +254,43 @@ $ %s debug addr cosmos1e0jnq2sun3dzjh8p2xq95kk0expwmd7shwjpfg Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { addrString := args[0] - var addr []byte - // try hex, then bech32 - var err error - addr, err = hex.DecodeString(addrString) - if err != nil { - var err2 error - addr, err2 = sdk.AccAddressFromBech32(addrString) - if err2 != nil { - var err3 error - addr, err3 = sdk.ValAddressFromBech32(addrString) - - if err3 != nil { - return fmt.Errorf("expected hex or bech32. Got errors: hex: %v, bech32 acc: %v, bech32 val: %v", err, err2, err3) + var ( + addr []byte + err error + ) + decodeFns := []func(text string) ([]byte, error){ + hex.DecodeString, + func(text string) ([]byte, error) { return sdk.AccAddressFromBech32(text) }, + func(text string) ([]byte, error) { return sdk.ValAddressFromBech32(text) }, + func(text string) ([]byte, error) { return sdk.ConsAddressFromBech32(text) }, + } + errs := make([]any, 0, len(decodeFns)) + for _, fn := range decodeFns { + if addr, err = fn(addrString); err == nil { + break + } + errs = append(errs, err) + } + if len(errs) == len(decodeFns) { + errTags := []string{ + "hex", "bech32 acc", "bech32 val", "bech32 con", + } + format := "" + for i := range errs { + if format != "" { + format += ", " } + format += errTags[i] + ": %w" } + return fmt.Errorf("expected hex or bech32. Got errors: "+format, errs...) } cmd.Println("Address:", addr) cmd.Printf("Address (hex): %X\n", addr) cmd.Printf("Bech32 Acc: %s\n", sdk.AccAddress(addr)) cmd.Printf("Bech32 Val: %s\n", sdk.ValAddress(addr)) + cmd.Printf("Bech32 Con: %s\n", sdk.ConsAddress(addr)) return nil }, } @@ -233,14 +298,11 @@ $ %s debug addr cosmos1e0jnq2sun3dzjh8p2xq95kk0expwmd7shwjpfg func RawBytesCmd() *cobra.Command { return &cobra.Command{ - Use: "raw-bytes [raw-bytes]", - Short: "Convert raw bytes output (eg. [10 21 13 255]) to hex", - Long: fmt.Sprintf(`Convert raw-bytes to hex. - -Example: -$ %s debug raw-bytes [72 101 108 108 111 44 32 112 108 97 121 103 114 111 117 110 100] - `, version.AppName), - Args: cobra.ExactArgs(1), + Use: "raw-bytes ", + Short: "Convert raw bytes output (eg. [10 21 13 255]) to hex", + Long: "Convert raw-bytes to hex.", + Example: fmt.Sprintf("%s debug raw-bytes '[72 101 108 108 111 44 32 112 108 97 121 103 114 111 117 110 100]'", version.AppName), + Args: cobra.ExactArgs(1), RunE: func(_ *cobra.Command, args []string) error { stringBytes := args[0] stringBytes = strings.Trim(stringBytes, "[") diff --git a/client/docs/config.json b/client/docs/config.json index 8c79b4ecd8e7..8d21362345ce 100644 --- a/client/docs/config.json +++ b/client/docs/config.json @@ -30,6 +30,9 @@ } } }, + { + "url": "./tmp-swagger-gen/cosmos/base/node/v1beta1/query.swagger.json" + }, { "url": "./tmp-swagger-gen/cosmos/distribution/v1beta1/query.swagger.json", "operationIds": { @@ -150,6 +153,27 @@ "TallyResult": "GroupTallyResult" } } + }, + { + "url": "./tmp-swagger-gen/cosmos/circuit/v1/query.swagger.json", + "operationIds": { + "rename": { + "Accounts": "CircuitAccounts", + "Account": "CircuitAccount", + "Params": "CircuitParams" + } + } + }, + { + "url": "./tmp-swagger-gen/cosmos/consensus/v1/query.swagger.json", + "operationIds": { + "rename": { + "Params": "ConsensusParams" + } + } + }, + { + "url": "./tmp-swagger-gen/cosmos/app/v1alpha1/query.swagger.json" } ] } \ No newline at end of file diff --git a/client/docs/swagger-ui/swagger.yaml b/client/docs/swagger-ui/swagger.yaml index 3315b78ff1b1..c38adbb69676 100644 --- a/client/docs/swagger-ui/swagger.yaml +++ b/client/docs/swagger-ui/swagger.yaml @@ -3568,6 +3568,170 @@ paths: descending order. + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/bank/v1beta1/denom_owners_by_query: + get: + summary: >- + DenomOwnersByQuery queries for all account addresses that own a + particular token + + denomination. + description: 'Since: cosmos-sdk 0.50.3' + operationId: DenomOwnersByQuery + responses: + '200': + description: A successful response. + schema: + type: object + properties: + denom_owners: + type: array + items: + type: object + properties: + address: + type: string + description: >- + address defines the address that owns a particular + denomination. + balance: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: >- + DenomOwner defines structure representing an account that + owns or holds a + + particular denominated token. It contains the account + address and account + + balance of the denominated token. + + + Since: cosmos-sdk 0.46 + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryDenomOwnersByQueryResponse defines the RPC response of a + DenomOwnersByQuery RPC query. + + + Since: cosmos-sdk 0.50.3 + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: denom + description: >- + denom defines the coin denomination to query all account holders + for. + in: query + required: false + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + Since: cosmos-sdk 0.43 in: query required: false @@ -3787,7 +3951,7 @@ paths: - Query /cosmos/bank/v1beta1/denoms_metadata/{denom}: get: - summary: DenomsMetadata queries the client metadata of a given coin denomination. + summary: DenomMetadata queries the client metadata of a given coin denomination. operationId: DenomMetadata responses: '200': @@ -3919,6 +4083,143 @@ paths: type: string tags: - Query + /cosmos/bank/v1beta1/denoms_metadata_by_query_string: + get: + summary: >- + DenomMetadataByQueryString queries the client metadata of a given coin + denomination. + operationId: DenomMetadataByQueryString + responses: + '200': + description: A successful response. + schema: + type: object + properties: + metadata: + type: object + properties: + description: + type: string + denom_units: + type: array + items: + type: object + properties: + denom: + type: string + description: >- + denom represents the string name of the given denom + unit (e.g uatom). + exponent: + type: integer + format: int64 + description: >- + exponent represents power of 10 exponent that one + must + + raise the base_denom to in order to equal the given + DenomUnit's denom + + 1 denom = 10^exponent base_denom + + (e.g. with a base_denom of uatom, one can create a + DenomUnit of 'atom' with + + exponent = 6, thus: 1 atom = 10^6 uatom). + aliases: + type: array + items: + type: string + title: >- + aliases is a list of string aliases for the given + denom + description: |- + DenomUnit represents a struct that describes a given + denomination unit of the basic token. + title: >- + denom_units represents the list of DenomUnit's for a given + coin + base: + type: string + description: >- + base represents the base denom (should be the DenomUnit + with exponent = 0). + display: + type: string + description: |- + display indicates the suggested denom that should be + displayed in clients. + name: + type: string + description: 'Since: cosmos-sdk 0.43' + title: 'name defines the name of the token (eg: Cosmos Atom)' + symbol: + type: string + description: >- + symbol is the token symbol usually shown on exchanges (eg: + ATOM). This can + + be the same as the display. + + + Since: cosmos-sdk 0.43 + uri: + type: string + description: >- + URI to a document (on or off-chain) that contains + additional information. Optional. + + + Since: cosmos-sdk 0.46 + uri_hash: + type: string + description: >- + URIHash is a sha256 hash of a document pointed by URI. + It's used to verify that + + the document didn't change. Optional. + + + Since: cosmos-sdk 0.46 + description: |- + Metadata represents a struct that describes + a basic token. + description: >- + QueryDenomMetadataByQueryStringResponse is the response type for + the Query/DenomMetadata RPC + + method. Identical with QueryDenomMetadataResponse but receives + denom as query string in request. + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: denom + description: denom is the coin denom to query the metadata for. + in: query + required: false + type: string + tags: + - Query /cosmos/bank/v1beta1/params: get: summary: Params queries the parameters of x/bank module. @@ -3930,6 +4231,7 @@ paths: type: object properties: params: + description: params provides the parameters of the bank module. type: object properties: send_enabled: @@ -3960,7 +4262,6 @@ paths: compatibility of genesis files. default_send_enabled: type: boolean - description: Params defines the parameters for the bank module. description: >- QueryParamsResponse defines the response type for querying x/bank parameters. @@ -9157,6 +9458,104 @@ paths: type: boolean tags: - Service + /cosmos/base/node/v1beta1/config: + get: + summary: Config queries for the operator configuration. + operationId: Config + responses: + '200': + description: A successful response. + schema: + type: object + properties: + minimum_gas_price: + type: string + pruning_keep_recent: + type: string + pruning_interval: + type: string + halt_height: + type: string + format: uint64 + description: >- + ConfigResponse defines the response structure for the Config gRPC + query. + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + tags: + - Service + /cosmos/base/node/v1beta1/status: + get: + summary: Status queries for the node status. + operationId: Status + responses: + '200': + description: A successful response. + schema: + type: object + properties: + earliest_store_height: + type: string + format: uint64 + height: + type: string + format: uint64 + timestamp: + type: string + format: date-time + app_hash: + type: string + format: byte + validator_hash: + type: string + format: byte + description: >- + StateResponse defines the response structure for the status of a + node. + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + tags: + - Service /cosmos/distribution/v1beta1/community_pool: get: summary: CommunityPool queries the community pool coins. @@ -12465,8 +12864,8 @@ paths: /cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}: get: summary: >- - Deposit queries single deposit information based proposalID, - depositAddr. + Deposit queries single deposit information based on proposalID, + depositor address. operationId: Deposit responses: '200': @@ -14004,6 +14403,19 @@ paths: burn_vote_veto: type: boolean title: burn deposits if quorum with vote type no_veto is met + min_deposit_ratio: + type: string + description: >- + The ratio representing the proportion of the deposit value + minimum that must be met when making a deposit. + + Default value: 0.01. Meaning that for a chain with a + min_deposit of 100stake, a deposit of 1stake would be + + required. + + + Since: cosmos-sdk 0.50 description: >- QueryParamsResponse is the response type for the Query/Params RPC method. @@ -14502,6 +14914,7 @@ paths: the recommended format of the metadata is to be found here: + https://docs.cosmos.network/v0.47/modules/gov#proposal-3 title: type: string @@ -14519,6 +14932,10 @@ paths: type: boolean description: 'Since: cosmos-sdk 0.50' title: expedited defines if the proposal is expedited + failed_reason: + type: string + description: 'Since: cosmos-sdk 0.50' + title: failed_reason defines the reason why the proposal failed description: >- Proposal defines the core field members of a governance proposal. @@ -15122,6 +15539,7 @@ paths: the recommended format of the metadata is to be found here: + https://docs.cosmos.network/v0.47/modules/gov#proposal-3 title: type: string @@ -15139,6 +15557,10 @@ paths: type: boolean description: 'Since: cosmos-sdk 0.50' title: expedited defines if the proposal is expedited + failed_reason: + type: string + description: 'Since: cosmos-sdk 0.50' + title: failed_reason defines the reason why the proposal failed description: >- Proposal defines the core field members of a governance proposal. @@ -15681,7 +16103,7 @@ paths: /cosmos/gov/v1/proposals/{proposal_id}/deposits/{depositor}: get: summary: >- - Deposit queries single deposit information based proposalID, + Deposit queries single deposit information based on proposalID, depositAddr. operationId: GovV1Deposit responses: @@ -16223,8 +16645,7 @@ paths: metadata: type: string title: >- - metadata is any arbitrary metadata to attached to the - vote. + metadata is any arbitrary metadata attached to the vote. the recommended format of the metadata is to be found here: @@ -16565,8 +16986,7 @@ paths: metadata: type: string title: >- - metadata is any arbitrary metadata to attached to the - vote. + metadata is any arbitrary metadata attached to the vote. the recommended format of the metadata is to be found here: https://docs.cosmos.network/v0.47/modules/gov#vote-5 @@ -17420,13 +17840,13 @@ paths: delegator_address: type: string description: >- - delegator_address is the bech32-encoded address of - the delegator. + delegator_address is the encoded address of the + delegator. validator_address: type: string description: >- - validator_address is the bech32-encoded address of - the validator. + validator_address is the encoded address of the + validator. shares: type: string description: shares define the delegation shares received. @@ -18213,12 +18633,12 @@ paths: delegator_address: type: string description: >- - delegator_address is the bech32-encoded address of the + delegator_address is the encoded address of the delegator. validator_address: type: string description: >- - validator_address is the bech32-encoded address of the + validator_address is the encoded address of the validator. entries: type: array @@ -22023,13 +22443,13 @@ paths: delegator_address: type: string description: >- - delegator_address is the bech32-encoded address of - the delegator. + delegator_address is the encoded address of the + delegator. validator_address: type: string description: >- - validator_address is the bech32-encoded address of - the validator. + validator_address is the encoded address of the + validator. shares: type: string description: shares define the delegation shares received. @@ -22361,12 +22781,12 @@ paths: delegator_address: type: string description: >- - delegator_address is the bech32-encoded address of the + delegator_address is the encoded address of the delegator. validator_address: type: string description: >- - validator_address is the bech32-encoded address of the + validator_address is the encoded address of the validator. shares: type: string @@ -22627,14 +23047,10 @@ paths: properties: delegator_address: type: string - description: >- - delegator_address is the bech32-encoded address of the - delegator. + description: delegator_address is the encoded address of the delegator. validator_address: type: string - description: >- - validator_address is the bech32-encoded address of the - validator. + description: validator_address is the encoded address of the validator. entries: type: array items: @@ -22916,12 +23332,12 @@ paths: delegator_address: type: string description: >- - delegator_address is the bech32-encoded address of the + delegator_address is the encoded address of the delegator. validator_address: type: string description: >- - validator_address is the bech32-encoded address of the + validator_address is the encoded address of the validator. entries: type: array @@ -28847,7 +29263,7 @@ paths: - Query /cosmos/feegrant/v1beta1/allowance/{granter}/{grantee}: get: - summary: Allowance returns fee granted to the grantee by the granter. + summary: Allowance returns granted allwance to the grantee by the granter. operationId: Allowance responses: '200': @@ -29158,7 +29574,7 @@ paths: - Query /cosmos/feegrant/v1beta1/allowances/{grantee}: get: - summary: Allowances returns all the grants for address. + summary: Allowances returns all the grants for the given grantee address. operationId: Allowances responses: '200': @@ -33070,6 +33486,7 @@ paths: the recommended format of the metadata is to be found here: + https://docs.cosmos.network/v0.47/modules/group#decision-policy-1 version: type: string @@ -33586,6 +34003,7 @@ paths: the recommended format of the metadata is to be found here: + https://docs.cosmos.network/v0.47/modules/group#decision-policy-1 version: type: string @@ -34103,6 +34521,7 @@ paths: the recommended format of the metadata is to be found here: + https://docs.cosmos.network/v0.47/modules/group#decision-policy-1 version: type: string @@ -35551,6 +35970,7 @@ paths: the recommended format of the metadata is to be found here: + https://docs.cosmos.network/v0.47/modules/group#proposal-4 proposers: type: array @@ -36324,6 +36744,7 @@ paths: the recommended format of the metadata is to be found here: + https://docs.cosmos.network/v0.47/modules/group#proposal-4 proposers: type: array @@ -37823,6 +38244,425 @@ paths: type: boolean tags: - Query + /cosmos/circuit/v1/accounts: + get: + summary: Account returns account permissions. + operationId: CircuitAccounts + responses: + '200': + description: A successful response. + schema: + type: object + properties: + accounts: + type: array + items: + type: object + properties: + address: + type: string + permissions: + type: object + properties: + level: + description: >- + level is the level of permissions granted to this + account. + type: string + enum: + - LEVEL_NONE_UNSPECIFIED + - LEVEL_SOME_MSGS + - LEVEL_ALL_MSGS + - LEVEL_SUPER_ADMIN + default: LEVEL_NONE_UNSPECIFIED + limit_type_urls: + type: array + items: + type: string + description: >- + limit_type_urls is used with LEVEL_SOME_MSGS to + limit the lists of Msg type + + URLs that the account can trip. It is an error to + use limit_type_urls with + + a level other than LEVEL_SOME_MSGS. + description: >- + Permissions are the permissions that an account has to + trip + + or reset the circuit breaker. + title: >- + GenesisAccountPermissions is the account permissions for the + circuit breaker in genesis + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + AccountsResponse is the response type for the Query/Accounts RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/circuit/v1/accounts/{address}: + get: + summary: Account returns account permissions. + operationId: CircuitAccount + responses: + '200': + description: A successful response. + schema: + type: object + properties: + permission: + type: object + properties: + level: + description: level is the level of permissions granted to this account. + type: string + enum: + - LEVEL_NONE_UNSPECIFIED + - LEVEL_SOME_MSGS + - LEVEL_ALL_MSGS + - LEVEL_SUPER_ADMIN + default: LEVEL_NONE_UNSPECIFIED + limit_type_urls: + type: array + items: + type: string + description: >- + limit_type_urls is used with LEVEL_SOME_MSGS to limit the + lists of Msg type + + URLs that the account can trip. It is an error to use + limit_type_urls with + + a level other than LEVEL_SOME_MSGS. + description: |- + Permissions are the permissions that an account has to trip + or reset the circuit breaker. + description: >- + AccountResponse is the response type for the Query/Account RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: address + in: path + required: true + type: string + tags: + - Query + /cosmos/circuit/v1/disable_list: + get: + summary: DisabledList returns a list of disabled message urls + operationId: DisabledList + responses: + '200': + description: A successful response. + schema: + type: object + properties: + disabled_list: + type: array + items: + type: string + description: >- + DisabledListResponse is the response type for the + Query/DisabledList RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + tags: + - Query + /cosmos/consensus/v1/params: + get: + summary: Params queries the parameters of x/consensus module. + operationId: ConsensusParams + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: >- + params are the tendermint consensus params stored in the + consensus module. + + Please note that `params.version` is not populated in this + response, it is + + tracked separately in the x/upgrade module. + type: object + properties: + block: + type: object + properties: + max_bytes: + type: string + format: int64 + title: |- + Max block size, in bytes. + Note: must be greater than 0 + max_gas: + type: string + format: int64 + title: |- + Max gas per block. + Note: must be greater or equal to -1 + description: BlockParams contains limits on the block size. + evidence: + type: object + properties: + max_age_num_blocks: + type: string + format: int64 + description: >- + Max age of evidence, in blocks. + + + The basic formula for calculating this is: + MaxAgeDuration / {average block + + time}. + max_age_duration: + type: string + description: >- + Max age of evidence, in time. + + + It should correspond with an app's "unbonding period" + or other similar + + mechanism for handling [Nothing-At-Stake + + attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). + max_bytes: + type: string + format: int64 + title: >- + This sets the maximum size of total evidence in bytes + that can be committed in a single block. + + and should fall comfortably under the max block bytes. + + Default is 1048576 or 1MB + description: >- + EvidenceParams determine how we handle evidence of + malfeasance. + validator: + type: object + properties: + pub_key_types: + type: array + items: + type: string + description: >- + ValidatorParams restrict the public key types validators + can use. + + NOTE: uses ABCI pubkey naming, not Amino names. + version: + type: object + properties: + app: + type: string + format: uint64 + description: VersionParams contains the ABCI application version. + abci: + type: object + properties: + vote_extensions_enable_height: + type: string + format: int64 + description: >- + vote_extensions_enable_height configures the first + height during which + + vote extensions will be enabled. During this specified + height, and for all + + subsequent heights, precommit messages that do not + contain valid extension data + + will be considered invalid. Prior to this height, vote + extensions will not + + be used or accepted by validators on the network. + + + Once enabled, vote extensions will be created by the + application in ExtendVote, + + passed to the application for validation in + VerifyVoteExtension and given + + to the application to use when proposing a block + during PrepareProposal. + description: >- + ABCIParams configure functionality specific to the + Application Blockchain Interface. + description: >- + QueryParamsResponse defines the response type for querying + x/consensus parameters. + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + tags: + - Query definitions: cosmos.auth.v1beta1.AddressBytesToStringResponse: type: object @@ -39639,6 +40479,99 @@ definitions: description: >- QueryBalanceResponse is the response type for the Query/Balance RPC method. + cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse: + type: object + properties: + metadata: + type: object + properties: + description: + type: string + denom_units: + type: array + items: + type: object + properties: + denom: + type: string + description: >- + denom represents the string name of the given denom unit + (e.g uatom). + exponent: + type: integer + format: int64 + description: >- + exponent represents power of 10 exponent that one must + + raise the base_denom to in order to equal the given + DenomUnit's denom + + 1 denom = 10^exponent base_denom + + (e.g. with a base_denom of uatom, one can create a DenomUnit + of 'atom' with + + exponent = 6, thus: 1 atom = 10^6 uatom). + aliases: + type: array + items: + type: string + title: aliases is a list of string aliases for the given denom + description: |- + DenomUnit represents a struct that describes a given + denomination unit of the basic token. + title: denom_units represents the list of DenomUnit's for a given coin + base: + type: string + description: >- + base represents the base denom (should be the DenomUnit with + exponent = 0). + display: + type: string + description: |- + display indicates the suggested denom that should be + displayed in clients. + name: + type: string + description: 'Since: cosmos-sdk 0.43' + title: 'name defines the name of the token (eg: Cosmos Atom)' + symbol: + type: string + description: >- + symbol is the token symbol usually shown on exchanges (eg: ATOM). + This can + + be the same as the display. + + + Since: cosmos-sdk 0.43 + uri: + type: string + description: >- + URI to a document (on or off-chain) that contains additional + information. Optional. + + + Since: cosmos-sdk 0.46 + uri_hash: + type: string + description: >- + URIHash is a sha256 hash of a document pointed by URI. It's used + to verify that + + the document didn't change. Optional. + + + Since: cosmos-sdk 0.46 + description: |- + Metadata represents a struct that describes + a basic token. + description: >- + QueryDenomMetadataByQueryStringResponse is the response type for the + Query/DenomMetadata RPC + + method. Identical with QueryDenomMetadataResponse but receives denom as + query string in request. cosmos.bank.v1beta1.QueryDenomMetadataResponse: type: object properties: @@ -39731,6 +40664,68 @@ definitions: Query/DenomMetadata RPC method. + cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse: + type: object + properties: + denom_owners: + type: array + items: + type: object + properties: + address: + type: string + description: address defines the address that owns a particular denomination. + balance: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: >- + DenomOwner defines structure representing an account that owns or + holds a + + particular denominated token. It contains the account address and + account + + balance of the denominated token. + + + Since: cosmos-sdk 0.46 + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryDenomOwnersByQueryResponse defines the RPC response of a + DenomOwnersByQuery RPC query. + + + Since: cosmos-sdk 0.50.3 cosmos.bank.v1beta1.QueryDenomOwnersResponse: type: object properties: @@ -39913,6 +40908,7 @@ definitions: type: object properties: params: + description: params provides the parameters of the bank module. type: object properties: send_enabled: @@ -39943,7 +40939,6 @@ definitions: compatibility of genesis files. default_send_enabled: type: boolean - description: Params defines the parameters for the bank module. description: >- QueryParamsResponse defines the response type for querying x/bank parameters. @@ -46593,6 +47588,38 @@ definitions: application's state transition machine. + cosmos.base.node.v1beta1.ConfigResponse: + type: object + properties: + minimum_gas_price: + type: string + pruning_keep_recent: + type: string + pruning_interval: + type: string + halt_height: + type: string + format: uint64 + description: ConfigResponse defines the response structure for the Config gRPC query. + cosmos.base.node.v1beta1.StatusResponse: + type: object + properties: + earliest_store_height: + type: string + format: uint64 + height: + type: string + format: uint64 + timestamp: + type: string + format: date-time + app_hash: + type: string + format: byte + validator_hash: + type: string + format: byte + description: StateResponse defines the response structure for the status of a node. cosmos.base.v1beta1.DecCoin: type: object properties: @@ -48827,6 +49854,19 @@ definitions: burn_vote_veto: type: boolean title: burn deposits if quorum with vote type no_veto is met + min_deposit_ratio: + type: string + description: >- + The ratio representing the proportion of the deposit value minimum + that must be met when making a deposit. + + Default value: 0.01. Meaning that for a chain with a min_deposit of + 100stake, a deposit of 1stake would be + + required. + + + Since: cosmos-sdk 0.50 description: |- Params defines the parameters for the x/gov module. @@ -49075,9 +50115,8 @@ definitions: description: voting_end_time is the end time of voting on a proposal. metadata: type: string - title: >- + title: |- metadata is any arbitrary metadata attached to the proposal. - the recommended format of the metadata is to be found here: https://docs.cosmos.network/v0.47/modules/gov#proposal-3 title: @@ -49096,6 +50135,10 @@ definitions: type: boolean description: 'Since: cosmos-sdk 0.50' title: expedited defines if the proposal is expedited + failed_reason: + type: string + description: 'Since: cosmos-sdk 0.50' + title: failed_reason defines the reason why the proposal failed description: Proposal defines the core field members of a governance proposal. cosmos.gov.v1.ProposalStatus: type: string @@ -49412,6 +50455,19 @@ definitions: burn_vote_veto: type: boolean title: burn deposits if quorum with vote type no_veto is met + min_deposit_ratio: + type: string + description: >- + The ratio representing the proportion of the deposit value minimum + that must be met when making a deposit. + + Default value: 0.01. Meaning that for a chain with a min_deposit + of 100stake, a deposit of 1stake would be + + required. + + + Since: cosmos-sdk 0.50 description: QueryParamsResponse is the response type for the Query/Params RPC method. cosmos.gov.v1.QueryProposalResponse: type: object @@ -49673,9 +50729,8 @@ definitions: description: voting_end_time is the end time of voting on a proposal. metadata: type: string - title: >- + title: |- metadata is any arbitrary metadata attached to the proposal. - the recommended format of the metadata is to be found here: https://docs.cosmos.network/v0.47/modules/gov#proposal-3 title: @@ -49694,6 +50749,10 @@ definitions: type: boolean description: 'Since: cosmos-sdk 0.50' title: expedited defines if the proposal is expedited + failed_reason: + type: string + description: 'Since: cosmos-sdk 0.50' + title: failed_reason defines the reason why the proposal failed description: Proposal defines the core field members of a governance proposal. description: >- QueryProposalResponse is the response type for the Query/Proposal RPC @@ -49963,9 +51022,8 @@ definitions: description: voting_end_time is the end time of voting on a proposal. metadata: type: string - title: >- + title: |- metadata is any arbitrary metadata attached to the proposal. - the recommended format of the metadata is to be found here: https://docs.cosmos.network/v0.47/modules/gov#proposal-3 title: @@ -49984,6 +51042,10 @@ definitions: type: boolean description: 'Since: cosmos-sdk 0.50' title: expedited defines if the proposal is expedited + failed_reason: + type: string + description: 'Since: cosmos-sdk 0.50' + title: failed_reason defines the reason why the proposal failed description: Proposal defines the core field members of a governance proposal. description: proposals defines all the requested governance proposals. pagination: @@ -50070,7 +51132,7 @@ definitions: metadata: type: string title: >- - metadata is any arbitrary metadata to attached to the vote. + metadata is any arbitrary metadata attached to the vote. the recommended format of the metadata is to be found here: https://docs.cosmos.network/v0.47/modules/gov#vote-5 @@ -50118,7 +51180,7 @@ definitions: metadata: type: string title: >- - metadata is any arbitrary metadata to attached to the vote. + metadata is any arbitrary metadata attached to the vote. the recommended format of the metadata is to be found here: https://docs.cosmos.network/v0.47/modules/gov#vote-5 @@ -50216,7 +51278,7 @@ definitions: metadata: type: string title: >- - metadata is any arbitrary metadata to attached to the vote. + metadata is any arbitrary metadata attached to the vote. the recommended format of the metadata is to be found here: https://docs.cosmos.network/v0.47/modules/gov#vote-5 @@ -50705,10 +51767,10 @@ definitions: properties: delegator_address: type: string - description: delegator_address is the bech32-encoded address of the delegator. + description: delegator_address is the encoded address of the delegator. validator_address: type: string - description: validator_address is the bech32-encoded address of the validator. + description: validator_address is the encoded address of the validator. shares: type: string description: shares define the delegation shares received. @@ -50724,10 +51786,10 @@ definitions: properties: delegator_address: type: string - description: delegator_address is the bech32-encoded address of the delegator. + description: delegator_address is the encoded address of the delegator. validator_address: type: string - description: validator_address is the bech32-encoded address of the validator. + description: validator_address is the encoded address of the validator. shares: type: string description: shares define the delegation shares received. @@ -51226,14 +52288,10 @@ definitions: properties: delegator_address: type: string - description: >- - delegator_address is the bech32-encoded address of the - delegator. + description: delegator_address is the encoded address of the delegator. validator_address: type: string - description: >- - validator_address is the bech32-encoded address of the - validator. + description: validator_address is the encoded address of the validator. shares: type: string description: shares define the delegation shares received. @@ -51282,14 +52340,10 @@ definitions: properties: delegator_address: type: string - description: >- - delegator_address is the bech32-encoded address of the - delegator. + description: delegator_address is the encoded address of the delegator. validator_address: type: string - description: >- - validator_address is the bech32-encoded address of the - validator. + description: validator_address is the encoded address of the validator. shares: type: string description: shares define the delegation shares received. @@ -51355,14 +52409,10 @@ definitions: properties: delegator_address: type: string - description: >- - delegator_address is the bech32-encoded address of the - delegator. + description: delegator_address is the encoded address of the delegator. validator_address: type: string - description: >- - validator_address is the bech32-encoded address of the - validator. + description: validator_address is the encoded address of the validator. entries: type: array items: @@ -52704,10 +53754,10 @@ definitions: properties: delegator_address: type: string - description: delegator_address is the bech32-encoded address of the delegator. + description: delegator_address is the encoded address of the delegator. validator_address: type: string - description: validator_address is the bech32-encoded address of the validator. + description: validator_address is the encoded address of the validator. entries: type: array items: @@ -52764,14 +53814,10 @@ definitions: properties: delegator_address: type: string - description: >- - delegator_address is the bech32-encoded address of the - delegator. + description: delegator_address is the encoded address of the delegator. validator_address: type: string - description: >- - validator_address is the bech32-encoded address of the - validator. + description: validator_address is the encoded address of the validator. shares: type: string description: shares define the delegation shares received. @@ -53147,14 +54193,10 @@ definitions: properties: delegator_address: type: string - description: >- - delegator_address is the bech32-encoded address of the - delegator. + description: delegator_address is the encoded address of the delegator. validator_address: type: string - description: >- - validator_address is the bech32-encoded address of the - validator. + description: validator_address is the encoded address of the validator. entries: type: array items: @@ -53831,10 +54873,10 @@ definitions: properties: delegator_address: type: string - description: delegator_address is the bech32-encoded address of the delegator. + description: delegator_address is the encoded address of the delegator. validator_address: type: string - description: validator_address is the bech32-encoded address of the validator. + description: validator_address is the encoded address of the validator. entries: type: array items: @@ -54853,13 +55895,12 @@ definitions: verified with raw bytes from Tx. - SIGN_MODE_TEXTUAL: SIGN_MODE_TEXTUAL is a future signing mode that will verify some human-readable textual representation on top of the binary representation - from SIGN_MODE_DIRECT. It is currently experimental, and should be used - for testing purposes only, until Textual is fully released. Please follow - the tracking issue https://github.com/cosmos/cosmos-sdk/issues/11970. + from SIGN_MODE_DIRECT. + + Since: cosmos-sdk 0.50 - SIGN_MODE_DIRECT_AUX: SIGN_MODE_DIRECT_AUX specifies a signing mode which uses SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not - require signers signing over other signers' `signer_info`. It also allows - for adding Tips in transactions. + require signers signing over other signers' `signer_info`. Since: cosmos-sdk 0.46 - SIGN_MODE_LEGACY_AMINO_JSON: SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses @@ -56751,22 +57792,15 @@ definitions: human-readable textual representation on top of the binary representation - from SIGN_MODE_DIRECT. It is currently experimental, and should be - used + from SIGN_MODE_DIRECT. - for testing purposes only, until Textual is fully released. Please - follow - the tracking issue - https://github.com/cosmos/cosmos-sdk/issues/11970. + Since: cosmos-sdk 0.50 - SIGN_MODE_DIRECT_AUX: SIGN_MODE_DIRECT_AUX specifies a signing mode which uses SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not - require signers signing over other signers' `signer_info`. It also - allows - - for adding Tips in transactions. + require signers signing over other signers' `signer_info`. Since: cosmos-sdk 0.46 @@ -56862,21 +57896,15 @@ definitions: human-readable textual representation on top of the binary representation - from SIGN_MODE_DIRECT. It is currently experimental, and should be - used + from SIGN_MODE_DIRECT. - for testing purposes only, until Textual is fully released. Please - follow - the tracking issue https://github.com/cosmos/cosmos-sdk/issues/11970. + Since: cosmos-sdk 0.50 - SIGN_MODE_DIRECT_AUX: SIGN_MODE_DIRECT_AUX specifies a signing mode which uses SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not - require signers signing over other signers' `signer_info`. It also - allows - - for adding Tips in transactions. + require signers signing over other signers' `signer_info`. Since: cosmos-sdk 0.46 @@ -61916,9 +62944,8 @@ definitions: description: admin is the account address of the group admin. metadata: type: string - title: >- + title: |- metadata is any arbitrary metadata attached to the group policy. - the recommended format of the metadata is to be found here: https://docs.cosmos.network/v0.47/modules/group#decision-policy-1 version: @@ -62131,9 +63158,8 @@ definitions: description: group_policy_address is the account address of group policy. metadata: type: string - title: >- + title: |- metadata is any arbitrary metadata attached to the proposal. - the recommended format of the metadata is to be found here: https://docs.cosmos.network/v0.47/modules/group#proposal-4 proposers: @@ -62577,6 +63603,7 @@ definitions: metadata is any arbitrary metadata attached to the group policy. the recommended format of the metadata is to be found here: + https://docs.cosmos.network/v0.47/modules/group#decision-policy-1 version: type: string @@ -62816,6 +63843,7 @@ definitions: metadata is any arbitrary metadata attached to the group policy. the recommended format of the metadata is to be found here: + https://docs.cosmos.network/v0.47/modules/group#decision-policy-1 version: type: string @@ -63051,9 +64079,8 @@ definitions: description: admin is the account address of the group admin. metadata: type: string - title: >- + title: |- metadata is any arbitrary metadata attached to the group policy. - the recommended format of the metadata is to be found here: https://docs.cosmos.network/v0.47/modules/group#decision-policy-1 version: @@ -63466,9 +64493,8 @@ definitions: description: group_policy_address is the account address of group policy. metadata: type: string - title: >- + title: |- metadata is any arbitrary metadata attached to the proposal. - the recommended format of the metadata is to be found here: https://docs.cosmos.network/v0.47/modules/group#proposal-4 proposers: @@ -63774,9 +64800,8 @@ definitions: description: group_policy_address is the account address of group policy. metadata: type: string - title: >- + title: |- metadata is any arbitrary metadata attached to the proposal. - the recommended format of the metadata is to be found here: https://docs.cosmos.network/v0.47/modules/group#proposal-4 proposers: @@ -64342,3 +65367,1003 @@ definitions: - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. + cosmos.circuit.v1.AccountResponse: + type: object + properties: + permission: + type: object + properties: + level: + description: level is the level of permissions granted to this account. + type: string + enum: + - LEVEL_NONE_UNSPECIFIED + - LEVEL_SOME_MSGS + - LEVEL_ALL_MSGS + - LEVEL_SUPER_ADMIN + default: LEVEL_NONE_UNSPECIFIED + limit_type_urls: + type: array + items: + type: string + description: >- + limit_type_urls is used with LEVEL_SOME_MSGS to limit the lists of + Msg type + + URLs that the account can trip. It is an error to use + limit_type_urls with + + a level other than LEVEL_SOME_MSGS. + description: |- + Permissions are the permissions that an account has to trip + or reset the circuit breaker. + description: AccountResponse is the response type for the Query/Account RPC method. + cosmos.circuit.v1.AccountsResponse: + type: object + properties: + accounts: + type: array + items: + type: object + properties: + address: + type: string + permissions: + type: object + properties: + level: + description: level is the level of permissions granted to this account. + type: string + enum: + - LEVEL_NONE_UNSPECIFIED + - LEVEL_SOME_MSGS + - LEVEL_ALL_MSGS + - LEVEL_SUPER_ADMIN + default: LEVEL_NONE_UNSPECIFIED + limit_type_urls: + type: array + items: + type: string + description: >- + limit_type_urls is used with LEVEL_SOME_MSGS to limit the + lists of Msg type + + URLs that the account can trip. It is an error to use + limit_type_urls with + + a level other than LEVEL_SOME_MSGS. + description: |- + Permissions are the permissions that an account has to trip + or reset the circuit breaker. + title: >- + GenesisAccountPermissions is the account permissions for the circuit + breaker in genesis + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: AccountsResponse is the response type for the Query/Accounts RPC method. + cosmos.circuit.v1.DisabledListResponse: + type: object + properties: + disabled_list: + type: array + items: + type: string + description: >- + DisabledListResponse is the response type for the Query/DisabledList RPC + method. + cosmos.circuit.v1.GenesisAccountPermissions: + type: object + properties: + address: + type: string + permissions: + type: object + properties: + level: + description: level is the level of permissions granted to this account. + type: string + enum: + - LEVEL_NONE_UNSPECIFIED + - LEVEL_SOME_MSGS + - LEVEL_ALL_MSGS + - LEVEL_SUPER_ADMIN + default: LEVEL_NONE_UNSPECIFIED + limit_type_urls: + type: array + items: + type: string + description: >- + limit_type_urls is used with LEVEL_SOME_MSGS to limit the lists of + Msg type + + URLs that the account can trip. It is an error to use + limit_type_urls with + + a level other than LEVEL_SOME_MSGS. + description: |- + Permissions are the permissions that an account has to trip + or reset the circuit breaker. + title: >- + GenesisAccountPermissions is the account permissions for the circuit + breaker in genesis + cosmos.circuit.v1.Permissions: + type: object + properties: + level: + description: level is the level of permissions granted to this account. + type: string + enum: + - LEVEL_NONE_UNSPECIFIED + - LEVEL_SOME_MSGS + - LEVEL_ALL_MSGS + - LEVEL_SUPER_ADMIN + default: LEVEL_NONE_UNSPECIFIED + limit_type_urls: + type: array + items: + type: string + description: >- + limit_type_urls is used with LEVEL_SOME_MSGS to limit the lists of Msg + type + + URLs that the account can trip. It is an error to use limit_type_urls + with + + a level other than LEVEL_SOME_MSGS. + description: |- + Permissions are the permissions that an account has to trip + or reset the circuit breaker. + cosmos.circuit.v1.Permissions.Level: + type: string + enum: + - LEVEL_NONE_UNSPECIFIED + - LEVEL_SOME_MSGS + - LEVEL_ALL_MSGS + - LEVEL_SUPER_ADMIN + default: LEVEL_NONE_UNSPECIFIED + description: |- + Level is the permission level. + + - LEVEL_NONE_UNSPECIFIED: LEVEL_NONE_UNSPECIFIED indicates that the account will have no circuit + breaker permissions. + - LEVEL_SOME_MSGS: LEVEL_SOME_MSGS indicates that the account will have permission to + trip or reset the circuit breaker for some Msg type URLs. If this level + is chosen, a non-empty list of Msg type URLs must be provided in + limit_type_urls. + - LEVEL_ALL_MSGS: LEVEL_ALL_MSGS indicates that the account can trip or reset the circuit + breaker for Msg's of all type URLs. + - LEVEL_SUPER_ADMIN: LEVEL_SUPER_ADMIN indicates that the account can take all circuit breaker + actions and can grant permissions to other accounts. + cosmos.consensus.v1.QueryParamsResponse: + type: object + properties: + params: + description: >- + params are the tendermint consensus params stored in the consensus + module. + + Please note that `params.version` is not populated in this response, + it is + + tracked separately in the x/upgrade module. + type: object + properties: + block: + type: object + properties: + max_bytes: + type: string + format: int64 + title: |- + Max block size, in bytes. + Note: must be greater than 0 + max_gas: + type: string + format: int64 + title: |- + Max gas per block. + Note: must be greater or equal to -1 + description: BlockParams contains limits on the block size. + evidence: + type: object + properties: + max_age_num_blocks: + type: string + format: int64 + description: >- + Max age of evidence, in blocks. + + + The basic formula for calculating this is: MaxAgeDuration / + {average block + + time}. + max_age_duration: + type: string + description: >- + Max age of evidence, in time. + + + It should correspond with an app's "unbonding period" or other + similar + + mechanism for handling [Nothing-At-Stake + + attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). + max_bytes: + type: string + format: int64 + title: >- + This sets the maximum size of total evidence in bytes that can + be committed in a single block. + + and should fall comfortably under the max block bytes. + + Default is 1048576 or 1MB + description: EvidenceParams determine how we handle evidence of malfeasance. + validator: + type: object + properties: + pub_key_types: + type: array + items: + type: string + description: |- + ValidatorParams restrict the public key types validators can use. + NOTE: uses ABCI pubkey naming, not Amino names. + version: + type: object + properties: + app: + type: string + format: uint64 + description: VersionParams contains the ABCI application version. + abci: + type: object + properties: + vote_extensions_enable_height: + type: string + format: int64 + description: >- + vote_extensions_enable_height configures the first height + during which + + vote extensions will be enabled. During this specified height, + and for all + + subsequent heights, precommit messages that do not contain + valid extension data + + will be considered invalid. Prior to this height, vote + extensions will not + + be used or accepted by validators on the network. + + + Once enabled, vote extensions will be created by the + application in ExtendVote, + + passed to the application for validation in + VerifyVoteExtension and given + + to the application to use when proposing a block during + PrepareProposal. + description: >- + ABCIParams configure functionality specific to the Application + Blockchain Interface. + description: >- + QueryParamsResponse defines the response type for querying x/consensus + parameters. + tendermint.types.ABCIParams: + type: object + properties: + vote_extensions_enable_height: + type: string + format: int64 + description: >- + vote_extensions_enable_height configures the first height during which + + vote extensions will be enabled. During this specified height, and for + all + + subsequent heights, precommit messages that do not contain valid + extension data + + will be considered invalid. Prior to this height, vote extensions will + not + + be used or accepted by validators on the network. + + + Once enabled, vote extensions will be created by the application in + ExtendVote, + + passed to the application for validation in VerifyVoteExtension and + given + + to the application to use when proposing a block during + PrepareProposal. + description: >- + ABCIParams configure functionality specific to the Application Blockchain + Interface. + tendermint.types.BlockParams: + type: object + properties: + max_bytes: + type: string + format: int64 + title: |- + Max block size, in bytes. + Note: must be greater than 0 + max_gas: + type: string + format: int64 + title: |- + Max gas per block. + Note: must be greater or equal to -1 + description: BlockParams contains limits on the block size. + tendermint.types.ConsensusParams: + type: object + properties: + block: + type: object + properties: + max_bytes: + type: string + format: int64 + title: |- + Max block size, in bytes. + Note: must be greater than 0 + max_gas: + type: string + format: int64 + title: |- + Max gas per block. + Note: must be greater or equal to -1 + description: BlockParams contains limits on the block size. + evidence: + type: object + properties: + max_age_num_blocks: + type: string + format: int64 + description: >- + Max age of evidence, in blocks. + + + The basic formula for calculating this is: MaxAgeDuration / + {average block + + time}. + max_age_duration: + type: string + description: >- + Max age of evidence, in time. + + + It should correspond with an app's "unbonding period" or other + similar + + mechanism for handling [Nothing-At-Stake + + attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). + max_bytes: + type: string + format: int64 + title: >- + This sets the maximum size of total evidence in bytes that can be + committed in a single block. + + and should fall comfortably under the max block bytes. + + Default is 1048576 or 1MB + description: EvidenceParams determine how we handle evidence of malfeasance. + validator: + type: object + properties: + pub_key_types: + type: array + items: + type: string + description: |- + ValidatorParams restrict the public key types validators can use. + NOTE: uses ABCI pubkey naming, not Amino names. + version: + type: object + properties: + app: + type: string + format: uint64 + description: VersionParams contains the ABCI application version. + abci: + type: object + properties: + vote_extensions_enable_height: + type: string + format: int64 + description: >- + vote_extensions_enable_height configures the first height during + which + + vote extensions will be enabled. During this specified height, and + for all + + subsequent heights, precommit messages that do not contain valid + extension data + + will be considered invalid. Prior to this height, vote extensions + will not + + be used or accepted by validators on the network. + + + Once enabled, vote extensions will be created by the application + in ExtendVote, + + passed to the application for validation in VerifyVoteExtension + and given + + to the application to use when proposing a block during + PrepareProposal. + description: >- + ABCIParams configure functionality specific to the Application + Blockchain Interface. + description: |- + ConsensusParams contains consensus critical parameters that determine the + validity of blocks. + tendermint.types.EvidenceParams: + type: object + properties: + max_age_num_blocks: + type: string + format: int64 + description: >- + Max age of evidence, in blocks. + + + The basic formula for calculating this is: MaxAgeDuration / {average + block + + time}. + max_age_duration: + type: string + description: >- + Max age of evidence, in time. + + + It should correspond with an app's "unbonding period" or other similar + + mechanism for handling [Nothing-At-Stake + + attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). + max_bytes: + type: string + format: int64 + title: >- + This sets the maximum size of total evidence in bytes that can be + committed in a single block. + + and should fall comfortably under the max block bytes. + + Default is 1048576 or 1MB + description: EvidenceParams determine how we handle evidence of malfeasance. + tendermint.types.ValidatorParams: + type: object + properties: + pub_key_types: + type: array + items: + type: string + description: |- + ValidatorParams restrict the public key types validators can use. + NOTE: uses ABCI pubkey naming, not Amino names. + tendermint.types.VersionParams: + type: object + properties: + app: + type: string + format: uint64 + description: VersionParams contains the ABCI application version. + cosmos.app.v1alpha1.Config: + type: object + properties: + modules: + type: array + items: + type: object + properties: + name: + type: string + description: >- + name is the unique name of the module within the app. It should + be a name + + that persists between different versions of a module so that + modules + + can be smoothly upgraded to new versions. + + + For example, for the module cosmos.bank.module.v1.Module, we may + chose + + to simply name the module "bank" in the app. When we upgrade to + + cosmos.bank.module.v2.Module, the app-specific name "bank" stays + the same + + and the framework knows that the v2 module should receive all + the same state + + that the v1 module had. Note: modules should provide info on + which versions + + they can migrate from in the ModuleDescriptor.can_migration_from + field. + config: + description: >- + config is the config object for the module. Module config + messages should + + define a ModuleDescriptor using the + cosmos.app.v1alpha1.is_module extension. + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + golang_bindings: + type: array + items: + type: object + properties: + interface_type: + type: string + title: >- + interface_type is the interface type which will be bound + to a specific implementation type + implementation: + type: string + title: >- + implementation is the implementing type which will be + supplied when an input of type interface is requested + description: >- + GolangBinding is an explicit interface type to implementing + type binding for dependency injection. + description: >- + golang_bindings specifies explicit interface to implementation + type bindings which + + depinject uses to resolve interface inputs to provider + functions. The scope of this + + field's configuration is module specific. + description: ModuleConfig is a module configuration for an app. + description: modules are the module configurations for the app. + golang_bindings: + type: array + items: + type: object + properties: + interface_type: + type: string + title: >- + interface_type is the interface type which will be bound to a + specific implementation type + implementation: + type: string + title: >- + implementation is the implementing type which will be supplied + when an input of type interface is requested + description: >- + GolangBinding is an explicit interface type to implementing type + binding for dependency injection. + description: >- + golang_bindings specifies explicit interface to implementation type + bindings which + + depinject uses to resolve interface inputs to provider functions. The + scope of this + + field's configuration is global (not module specific). + description: >- + Config represents the configuration for a Cosmos SDK ABCI app. + + It is intended that all state machine logic including the version of + + baseapp and tx handlers (and possibly even Tendermint) that an app needs + + can be described in a config object. For compatibility, the framework + should + + allow a mixture of declarative and imperative app wiring, however, apps + + that strive for the maximum ease of maintainability should be able to + describe + + their state machine with a config object alone. + cosmos.app.v1alpha1.GolangBinding: + type: object + properties: + interface_type: + type: string + title: >- + interface_type is the interface type which will be bound to a specific + implementation type + implementation: + type: string + title: >- + implementation is the implementing type which will be supplied when an + input of type interface is requested + description: >- + GolangBinding is an explicit interface type to implementing type binding + for dependency injection. + cosmos.app.v1alpha1.ModuleConfig: + type: object + properties: + name: + type: string + description: >- + name is the unique name of the module within the app. It should be a + name + + that persists between different versions of a module so that modules + + can be smoothly upgraded to new versions. + + + For example, for the module cosmos.bank.module.v1.Module, we may chose + + to simply name the module "bank" in the app. When we upgrade to + + cosmos.bank.module.v2.Module, the app-specific name "bank" stays the + same + + and the framework knows that the v2 module should receive all the same + state + + that the v1 module had. Note: modules should provide info on which + versions + + they can migrate from in the ModuleDescriptor.can_migration_from + field. + config: + description: >- + config is the config object for the module. Module config messages + should + + define a ModuleDescriptor using the cosmos.app.v1alpha1.is_module + extension. + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above specified + type. + golang_bindings: + type: array + items: + type: object + properties: + interface_type: + type: string + title: >- + interface_type is the interface type which will be bound to a + specific implementation type + implementation: + type: string + title: >- + implementation is the implementing type which will be supplied + when an input of type interface is requested + description: >- + GolangBinding is an explicit interface type to implementing type + binding for dependency injection. + description: >- + golang_bindings specifies explicit interface to implementation type + bindings which + + depinject uses to resolve interface inputs to provider functions. The + scope of this + + field's configuration is module specific. + description: ModuleConfig is a module configuration for an app. + cosmos.app.v1alpha1.QueryConfigResponse: + type: object + properties: + config: + description: config is the current app config. + type: object + properties: + modules: + type: array + items: + type: object + properties: + name: + type: string + description: >- + name is the unique name of the module within the app. It + should be a name + + that persists between different versions of a module so that + modules + + can be smoothly upgraded to new versions. + + + For example, for the module cosmos.bank.module.v1.Module, we + may chose + + to simply name the module "bank" in the app. When we upgrade + to + + cosmos.bank.module.v2.Module, the app-specific name "bank" + stays the same + + and the framework knows that the v2 module should receive + all the same state + + that the v1 module had. Note: modules should provide info on + which versions + + they can migrate from in the + ModuleDescriptor.can_migration_from field. + config: + description: >- + config is the config object for the module. Module config + messages should + + define a ModuleDescriptor using the + cosmos.app.v1alpha1.is_module extension. + type: object + properties: + type_url: + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + value: + type: string + format: byte + description: >- + Must be a valid serialized protocol buffer of the above + specified type. + golang_bindings: + type: array + items: + type: object + properties: + interface_type: + type: string + title: >- + interface_type is the interface type which will be + bound to a specific implementation type + implementation: + type: string + title: >- + implementation is the implementing type which will be + supplied when an input of type interface is requested + description: >- + GolangBinding is an explicit interface type to + implementing type binding for dependency injection. + description: >- + golang_bindings specifies explicit interface to + implementation type bindings which + + depinject uses to resolve interface inputs to provider + functions. The scope of this + + field's configuration is module specific. + description: ModuleConfig is a module configuration for an app. + description: modules are the module configurations for the app. + golang_bindings: + type: array + items: + type: object + properties: + interface_type: + type: string + title: >- + interface_type is the interface type which will be bound to + a specific implementation type + implementation: + type: string + title: >- + implementation is the implementing type which will be + supplied when an input of type interface is requested + description: >- + GolangBinding is an explicit interface type to implementing type + binding for dependency injection. + description: >- + golang_bindings specifies explicit interface to implementation + type bindings which + + depinject uses to resolve interface inputs to provider functions. + The scope of this + + field's configuration is global (not module specific). + description: QueryConfigRequest is the Query/Config response type. diff --git a/client/flags/flags.go b/client/flags/flags.go index a2d918edde9a..2cda1500a082 100644 --- a/client/flags/flags.go +++ b/client/flags/flags.go @@ -35,8 +35,6 @@ const ( // SignModeDirectAux is the value of the --sign-mode flag for SIGN_MODE_DIRECT_AUX SignModeDirectAux = "direct-aux" // SignModeTextual is the value of the --sign-mode flag for SIGN_MODE_TEXTUAL. - // Choosing this flag will result in an error for now, as Textual should be - // used only for TESTING purposes for now. SignModeTextual = "textual" // SignModeEIP191 is the value of the --sign-mode flag for SIGN_MODE_EIP_191 SignModeEIP191 = "eip-191" @@ -76,6 +74,9 @@ const ( FlagOffset = "offset" FlagCountTotal = "count-total" FlagTimeoutHeight = "timeout-height" + FlagTimeoutTimestamp = "timeout-timestamp" + FlagUnordered = "unordered" + FlagKeyAlgorithm = "algo" FlagKeyType = "key-type" FlagFeePayer = "fee-payer" FlagFeeGranter = "fee-granter" @@ -87,8 +88,9 @@ const ( // This differs from FlagOutputDocument that is used to set the output file. FlagOutput = "output" // Logging flags - FlagLogLevel = "log_level" - FlagLogFormat = "log_format" + FlagLogLevel = "log_level" + FlagLogFormat = "log_format" + FlagLogNoColor = "log_no_color" ) // List of supported output formats @@ -118,7 +120,9 @@ func AddQueryFlagsToCmd(cmd *cobra.Command) { func AddTxFlagsToCmd(cmd *cobra.Command) { f := cmd.Flags() f.StringP(FlagOutput, "o", OutputFormatJSON, "Output format (text|json)") - f.String(FlagFrom, "", "Name or address of private key with which to sign") + if cmd.Flag(FlagFrom) == nil { // avoid flag redefinition when it's already been added by AutoCLI + f.String(FlagFrom, "", "Name or address of private key with which to sign") + } f.Uint64P(FlagAccountNumber, "a", 0, "The account number of the signing account (offline mode only)") f.Uint64P(FlagSequence, "s", 0, "The sequence number of the signing account (offline mode only)") f.String(FlagNote, "", "Note to add a description to the transaction (previously --memo)") @@ -132,8 +136,10 @@ func AddTxFlagsToCmd(cmd *cobra.Command) { f.Bool(FlagGenerateOnly, false, "Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name)") f.Bool(FlagOffline, false, "Offline mode (does not allow any online functionality)") f.BoolP(FlagSkipConfirmation, "y", false, "Skip tx broadcasting prompt confirmation") - f.String(FlagSignMode, "", "Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature") - f.Uint64(FlagTimeoutHeight, 0, "Set a block timeout height to prevent the tx from being committed past a certain height") + f.String(FlagSignMode, "", "Choose sign mode (direct|amino-json|direct-aux|textual), this is an advanced feature") + f.Uint64(FlagTimeoutHeight, 0, "DEPRECATED: Please use --timeout-timestamp instead. Set a block timeout height to prevent the tx from being committed past a certain height") + f.Int64(FlagTimeoutTimestamp, 0, "Set a block timeout timestamp to prevent the tx from being committed past a certain time") + f.Bool(FlagUnordered, false, "Enable unordered transaction delivery; must be used in conjunction with --timeout-timestamp") f.String(FlagFeePayer, "", "Fee payer pays fees for the transaction instead of deducting from the signer") f.String(FlagFeeGranter, "", "Fee granter grants fees for the transaction") f.String(FlagTip, "", "Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator") @@ -143,6 +149,9 @@ func AddTxFlagsToCmd(cmd *cobra.Command) { f.String(FlagGas, "", fmt.Sprintf("gas limit to set per-transaction; set to %q to calculate sufficient gas automatically. Note: %q option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of %q. (default %d)", GasFlagAuto, GasFlagAuto, FlagFees, DefaultGasLimit)) + cmd.MarkFlagsMutuallyExclusive(FlagTimeoutHeight, FlagTimeoutTimestamp) + cmd.MarkFlagsRequiredTogether(FlagUnordered, FlagTimeoutTimestamp) + AddKeyringFlags(f) } diff --git a/client/grpc/cmtservice/autocli.go b/client/grpc/cmtservice/autocli.go new file mode 100644 index 000000000000..8fae4b915b49 --- /dev/null +++ b/client/grpc/cmtservice/autocli.go @@ -0,0 +1,71 @@ +package cmtservice + +import ( + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + cmtv1beta1 "cosmossdk.io/api/cosmos/base/tendermint/v1beta1" +) + +var CometBFTAutoCLIDescriptor = &autocliv1.ServiceCommandDescriptor{ + Service: cmtv1beta1.Service_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "GetNodeInfo", + Use: "node-info", + Short: "Query the current node info", + }, + { + RpcMethod: "GetSyncing", + Use: "syncing", + Short: "Query node syncing status", + }, + { + RpcMethod: "GetLatestBlock", + Use: "block-latest", + Short: "Query for the latest committed block", + }, + { + RpcMethod: "GetBlockByHeight", + Use: "block-by-height [height]", + Short: "Query for a committed block by height", + Long: "Query for a specific committed block using the CometBFT RPC `block_by_height` method", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "height"}}, + }, + { + RpcMethod: "GetLatestValidatorSet", + Use: "validator-set", + Alias: []string{"validator-set-latest", "comet-validator-set", "cometbft-validator-set", "tendermint-validator-set"}, + Short: "Query for the latest validator set", + }, + { + RpcMethod: "GetValidatorSetByHeight", + Use: "validator-set-by-height [height]", + Short: "Query for a validator set by height", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "height"}}, + }, + { + RpcMethod: "ABCIQuery", + Skip: true, + }, + }, +} + +// NewCometBFTCommands is a fake `appmodule.Module` to be considered as a module +// and be added in AutoCLI. +func NewCometBFTCommands() *cometModule { //nolint:revive // fake module and limiting import of core + return &cometModule{} +} + +type cometModule struct{} + +func (m cometModule) IsOnePerModuleType() {} +func (m cometModule) IsAppModule() {} + +func (m cometModule) Name() string { + return "comet" +} + +func (m cometModule) AutoCLIOptions() *autocliv1.ModuleOptions { + return &autocliv1.ModuleOptions{ + Query: CometBFTAutoCLIDescriptor, + } +} diff --git a/client/grpc/cmtservice/block.go b/client/grpc/cmtservice/block.go index 2880b3f2aaab..f1cde440f912 100644 --- a/client/grpc/cmtservice/block.go +++ b/client/grpc/cmtservice/block.go @@ -5,9 +5,19 @@ import ( cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" coretypes "github.com/cometbft/cometbft/rpc/core/types" + "github.com/cosmos/cosmos-sdk/client" ) +func getBlockHeight(ctx context.Context, clientCtx client.Context) (int64, error) { + status, err := GetNodeStatus(ctx, clientCtx) + if err != nil { + return 0, err + } + height := status.SyncInfo.LatestBlockHeight + return height, nil +} + func getBlock(ctx context.Context, clientCtx client.Context, height *int64) (*coretypes.ResultBlock, error) { // get the node node, err := clientCtx.GetNode() diff --git a/client/grpc/cmtservice/query.pb.go b/client/grpc/cmtservice/query.pb.go index d745dca1867e..b0bde63432b3 100644 --- a/client/grpc/cmtservice/query.pb.go +++ b/client/grpc/cmtservice/query.pb.go @@ -1566,6 +1566,7 @@ func _Service_ABCIQuery_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } +var Service_serviceDesc = _Service_serviceDesc var _Service_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.base.tendermint.v1beta1.Service", HandlerType: (*ServiceServer)(nil), diff --git a/client/grpc/cmtservice/service.go b/client/grpc/cmtservice/service.go index 8740c0d8f117..e26e65332806 100644 --- a/client/grpc/cmtservice/service.go +++ b/client/grpc/cmtservice/service.go @@ -11,9 +11,10 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/rpc" codectypes "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" qtypes "github.com/cosmos/cosmos-sdk/types/query" "github.com/cosmos/cosmos-sdk/version" ) @@ -48,7 +49,7 @@ func NewQueryServer( // GetSyncing implements ServiceServer.GetSyncing func (s queryServer) GetSyncing(ctx context.Context, _ *GetSyncingRequest) (*GetSyncingResponse, error) { - status, err := getNodeStatus(ctx, s.clientCtx) + status, err := GetNodeStatus(ctx, s.clientCtx) if err != nil { return nil, err } @@ -80,12 +81,12 @@ func (s queryServer) GetLatestBlock(ctx context.Context, _ *GetLatestBlockReques // GetBlockByHeight implements ServiceServer.GetBlockByHeight func (s queryServer) GetBlockByHeight(ctx context.Context, req *GetBlockByHeightRequest) (*GetBlockByHeightResponse, error) { - chainHeight, err := rpc.GetChainHeight(s.clientCtx) + blockHeight, err := getBlockHeight(ctx, s.clientCtx) if err != nil { return nil, err } - if req.Height > chainHeight { + if req.Height > blockHeight { return nil, status.Error(codes.InvalidArgument, "requested block height is bigger then the chain length") } @@ -108,7 +109,7 @@ func (s queryServer) GetLatestValidatorSet(ctx context.Context, req *GetLatestVa return nil, err } - return validatorsOutput(ctx, s.clientCtx, nil, page, limit) + return ValidatorsOutput(ctx, s.clientCtx, nil, page, limit) } func (m *GetLatestValidatorSetResponse) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { @@ -130,16 +131,16 @@ func (s queryServer) GetValidatorSetByHeight(ctx context.Context, req *GetValida return nil, err } - chainHeight, err := rpc.GetChainHeight(s.clientCtx) + blockHeight, err := getBlockHeight(ctx, s.clientCtx) if err != nil { return nil, status.Error(codes.Internal, "failed to parse chain height") } - if req.Height > chainHeight { + if req.Height > blockHeight { return nil, status.Error(codes.InvalidArgument, "requested block height is bigger then the chain length") } - r, err := validatorsOutput(ctx, s.clientCtx, &req.Height, page, limit) + r, err := ValidatorsOutput(ctx, s.clientCtx, &req.Height, page, limit) if err != nil { return nil, err } @@ -151,8 +152,8 @@ func (s queryServer) GetValidatorSetByHeight(ctx context.Context, req *GetValida }, nil } -func validatorsOutput(ctx context.Context, cctx client.Context, height *int64, page, limit int) (*GetLatestValidatorSetResponse, error) { - vs, err := rpc.GetValidators(ctx, cctx, height, &page, &limit) +func ValidatorsOutput(ctx context.Context, clientCtx client.Context, height *int64, page, limit int) (*GetLatestValidatorSetResponse, error) { + vs, err := getValidators(ctx, clientCtx, height, page, limit) if err != nil { return nil, err } @@ -161,18 +162,22 @@ func validatorsOutput(ctx context.Context, cctx client.Context, height *int64, p BlockHeight: vs.BlockHeight, Validators: make([]*Validator, len(vs.Validators)), Pagination: &qtypes.PageResponse{ - Total: vs.Total, + Total: uint64(vs.Total), }, } for i, v := range vs.Validators { - anyPub, err := codectypes.NewAnyWithValue(v.PubKey) + pk, err := cryptocodec.FromCmtPubKeyInterface(v.PubKey) + if err != nil { + return nil, err + } + anyPub, err := codectypes.NewAnyWithValue(pk) if err != nil { return nil, err } resp.Validators[i] = &Validator{ - Address: v.Address.String(), + Address: sdk.ConsAddress(v.Address).String(), ProposerPriority: v.ProposerPriority, PubKey: anyPub, VotingPower: v.VotingPower, @@ -184,7 +189,7 @@ func validatorsOutput(ctx context.Context, cctx client.Context, height *int64, p // GetNodeInfo implements ServiceServer.GetNodeInfo func (s queryServer) GetNodeInfo(ctx context.Context, _ *GetNodeInfoRequest) (*GetNodeInfoResponse, error) { - status, err := getNodeStatus(ctx, s.clientCtx) + status, err := GetNodeStatus(ctx, s.clientCtx) if err != nil { return nil, err } diff --git a/client/grpc/cmtservice/status.go b/client/grpc/cmtservice/status.go index 9f03a71a7672..ea32e00b79a8 100644 --- a/client/grpc/cmtservice/status.go +++ b/client/grpc/cmtservice/status.go @@ -8,7 +8,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" ) -func getNodeStatus(ctx context.Context, clientCtx client.Context) (*coretypes.ResultStatus, error) { +// GetNodeStatus returns the status of the node. +func GetNodeStatus(ctx context.Context, clientCtx client.Context) (*coretypes.ResultStatus, error) { node, err := clientCtx.GetNode() if err != nil { return &coretypes.ResultStatus{}, err diff --git a/client/grpc/cmtservice/status_test.go b/client/grpc/cmtservice/status_test.go new file mode 100644 index 000000000000..74e3b3c2e5dc --- /dev/null +++ b/client/grpc/cmtservice/status_test.go @@ -0,0 +1,32 @@ +package cmtservice_test + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/cosmos/cosmos-sdk/server" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/cosmos/cosmos-sdk/testutil/network" +) + +func TestStatusCommand(t *testing.T) { + t.Skip() // flaky test + + cfg, err := network.DefaultConfigWithAppConfig(network.MinimumAppConfig()) + require.NoError(t, err) + + network, err := network.New(t, t.TempDir(), cfg) + require.NoError(t, err) + require.NoError(t, network.WaitForNextBlock()) + + val0 := network.Validators[0] + cmd := server.StatusCommand() + + out, err := clitestutil.ExecTestCLICmd(val0.ClientCtx, cmd, []string{}) + require.NoError(t, err) + + // Make sure the output has the validator moniker. + require.Contains(t, out.String(), fmt.Sprintf("\"moniker\":\"%s\"", val0.Moniker)) +} diff --git a/client/grpc/cmtservice/util.go b/client/grpc/cmtservice/util.go index 3572a6218533..de06162c8a1c 100644 --- a/client/grpc/cmtservice/util.go +++ b/client/grpc/cmtservice/util.go @@ -2,6 +2,7 @@ package cmtservice import ( cmtprototypes "github.com/cometbft/cometbft/proto/tendermint/types" + sdk "github.com/cosmos/cosmos-sdk/types" ) diff --git a/client/grpc/cmtservice/validator.go b/client/grpc/cmtservice/validator.go new file mode 100644 index 000000000000..5b81d2bc4cac --- /dev/null +++ b/client/grpc/cmtservice/validator.go @@ -0,0 +1,17 @@ +package cmtservice + +import ( + "context" + + coretypes "github.com/cometbft/cometbft/rpc/core/types" + + "github.com/cosmos/cosmos-sdk/client" +) + +func getValidators(ctx context.Context, clientCtx client.Context, height *int64, page, limit int) (*coretypes.ResultValidators, error) { + node, err := clientCtx.GetNode() + if err != nil { + return nil, err + } + return node.Validators(ctx, height, &page, &limit) +} diff --git a/client/grpc/node/autocli.go b/client/grpc/node/autocli.go new file mode 100644 index 000000000000..87819e0f0371 --- /dev/null +++ b/client/grpc/node/autocli.go @@ -0,0 +1,43 @@ +package node + +import ( + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + nodev1beta1 "cosmossdk.io/api/cosmos/base/node/v1beta1" +) + +var ServiceAutoCLIDescriptor = &autocliv1.ServiceCommandDescriptor{ + Service: nodev1beta1.Service_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Config", + Use: "config", + Short: "Query the current node config", + }, + { + RpcMethod: "Status", + Use: "status", + Short: "Query the current node status", + }, + }, +} + +// NewNodeCommands is a fake `appmodule.Module` to be considered as a module +// and be added in AutoCLI. +func NewNodeCommands() *nodeModule { + return &nodeModule{} +} + +type nodeModule struct{} + +func (m nodeModule) IsOnePerModuleType() {} +func (m nodeModule) IsAppModule() {} + +func (m nodeModule) Name() string { + return "node" +} + +func (m nodeModule) AutoCLIOptions() *autocliv1.ModuleOptions { + return &autocliv1.ModuleOptions{ + Query: ServiceAutoCLIDescriptor, + } +} diff --git a/client/grpc/node/query.pb.go b/client/grpc/node/query.pb.go index 8e56808aa627..4bf0fe8ddc46 100644 --- a/client/grpc/node/query.pb.go +++ b/client/grpc/node/query.pb.go @@ -72,10 +72,10 @@ var xxx_messageInfo_ConfigRequest proto.InternalMessageInfo // ConfigResponse defines the response structure for the Config gRPC query. type ConfigResponse struct { - MinimumGasPrice string `protobuf:"bytes,1,opt,name=minimum_gas_price,json=minimumGasPrice,proto3" json:"minimum_gas_price,omitempty"` - // pruning settings + MinimumGasPrice string `protobuf:"bytes,1,opt,name=minimum_gas_price,json=minimumGasPrice,proto3" json:"minimum_gas_price,omitempty"` PruningKeepRecent string `protobuf:"bytes,2,opt,name=pruning_keep_recent,json=pruningKeepRecent,proto3" json:"pruning_keep_recent,omitempty"` PruningInterval string `protobuf:"bytes,3,opt,name=pruning_interval,json=pruningInterval,proto3" json:"pruning_interval,omitempty"` + HaltHeight uint64 `protobuf:"varint,4,opt,name=halt_height,json=haltHeight,proto3" json:"halt_height,omitempty"` } func (m *ConfigResponse) Reset() { *m = ConfigResponse{} } @@ -132,6 +132,13 @@ func (m *ConfigResponse) GetPruningInterval() string { return "" } +func (m *ConfigResponse) GetHaltHeight() uint64 { + if m != nil { + return m.HaltHeight + } + return 0 +} + // StateRequest defines the request structure for the status of a node. type StatusRequest struct { } @@ -258,39 +265,40 @@ func init() { } var fileDescriptor_8324226a07064341 = []byte{ - // 506 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xc1, 0x6f, 0xd3, 0x3e, - 0x1c, 0xc5, 0x9b, 0xfe, 0xfa, 0xeb, 0x98, 0x61, 0x1d, 0xcb, 0x00, 0x95, 0x0a, 0x65, 0x55, 0x05, - 0xa2, 0x20, 0xcd, 0xd6, 0xca, 0x9d, 0xc3, 0x38, 0x6c, 0x88, 0x0b, 0x4a, 0x39, 0x71, 0x89, 0xdc, - 0xf4, 0xbb, 0xc4, 0x5a, 0x62, 0x7b, 0xb6, 0x53, 0x89, 0x2b, 0x12, 0xf7, 0x49, 0x1c, 0x10, 0xff, - 0x11, 0xc7, 0x49, 0x5c, 0x38, 0x01, 0x6a, 0xf9, 0x43, 0x50, 0x6c, 0x67, 0xa8, 0x87, 0x0d, 0x4e, - 0xb1, 0xdf, 0xfb, 0xd8, 0x79, 0x7a, 0x5f, 0xa3, 0x87, 0xa9, 0xd0, 0xa5, 0xd0, 0x64, 0x46, 0x35, - 0x10, 0x2e, 0xe6, 0x40, 0x16, 0x07, 0x33, 0x30, 0xf4, 0x80, 0x9c, 0x55, 0xa0, 0xde, 0x61, 0xa9, - 0x84, 0x11, 0x61, 0xdf, 0x51, 0xb8, 0xa6, 0x70, 0x4d, 0x61, 0x4f, 0x0d, 0x1e, 0x64, 0x42, 0x64, - 0x05, 0x10, 0x2a, 0x19, 0xa1, 0x9c, 0x0b, 0x43, 0x0d, 0x13, 0x5c, 0xbb, 0x73, 0x83, 0x3d, 0xef, - 0xda, 0xdd, 0xac, 0x3a, 0x21, 0x86, 0x95, 0xa0, 0x0d, 0x2d, 0xa5, 0x07, 0xee, 0x64, 0x22, 0x13, - 0x76, 0x49, 0xea, 0x95, 0x53, 0x47, 0xdb, 0x68, 0xeb, 0x85, 0xe0, 0x27, 0x2c, 0x8b, 0xe1, 0xac, - 0x02, 0x6d, 0x46, 0x9f, 0x02, 0xd4, 0x6b, 0x14, 0x2d, 0x05, 0xd7, 0x10, 0x3e, 0x45, 0x3b, 0x25, - 0xe3, 0xac, 0xac, 0xca, 0x24, 0xa3, 0x3a, 0x91, 0x8a, 0xa5, 0xd0, 0x0f, 0x86, 0xc1, 0x78, 0x33, - 0xde, 0xf6, 0xc6, 0x11, 0xd5, 0xaf, 0x6b, 0x39, 0xc4, 0x68, 0x57, 0xaa, 0x8a, 0x33, 0x9e, 0x25, - 0xa7, 0x00, 0x32, 0x51, 0x90, 0x02, 0x37, 0xfd, 0xb6, 0xa5, 0x77, 0xbc, 0xf5, 0x0a, 0x40, 0xc6, - 0xd6, 0x08, 0x9f, 0xa0, 0xdb, 0x0d, 0xcf, 0xb8, 0x01, 0xb5, 0xa0, 0x45, 0xff, 0x3f, 0x77, 0xb5, - 0xd7, 0x5f, 0x7a, 0xb9, 0x8e, 0x3a, 0x35, 0xd4, 0x54, 0xba, 0x89, 0xfa, 0x3d, 0x40, 0xbd, 0x46, - 0xf1, 0x51, 0x27, 0xe8, 0x2e, 0x50, 0x55, 0x30, 0xd0, 0x26, 0xd1, 0x46, 0x28, 0x48, 0x72, 0x60, - 0x59, 0x6e, 0x6c, 0xdc, 0x4e, 0xbc, 0xdb, 0x98, 0xd3, 0xda, 0x3b, 0xb6, 0x56, 0x78, 0x0f, 0x75, - 0x3d, 0xd4, 0xb6, 0x90, 0xdf, 0x85, 0xcf, 0xd1, 0xe6, 0x65, 0x87, 0x36, 0xd3, 0xcd, 0xc9, 0x00, - 0xbb, 0x96, 0x71, 0xd3, 0x32, 0x7e, 0xd3, 0x10, 0x87, 0x9d, 0xf3, 0x1f, 0x7b, 0x41, 0xfc, 0xe7, - 0x48, 0x78, 0x1f, 0xdd, 0xa0, 0x52, 0x26, 0x39, 0xd5, 0x79, 0xbf, 0x33, 0x0c, 0xc6, 0xb7, 0xe2, - 0x0d, 0x2a, 0xe5, 0x31, 0xd5, 0x79, 0xf8, 0x08, 0xf5, 0x16, 0xb4, 0x60, 0x73, 0x6a, 0x84, 0x72, - 0xc0, 0xff, 0x16, 0xd8, 0xba, 0x54, 0x6b, 0x6c, 0xf2, 0xb9, 0x8d, 0x36, 0xa6, 0xa0, 0x16, 0x75, - 0xb1, 0x1f, 0x02, 0xd4, 0x75, 0x73, 0x09, 0x1f, 0xe3, 0xab, 0xde, 0x08, 0x5e, 0x9b, 0xe5, 0x60, - 0xfc, 0x77, 0xd0, 0xf5, 0x36, 0x1a, 0xbf, 0xff, 0xfa, 0xeb, 0x63, 0x7b, 0x14, 0x0e, 0xc9, 0x95, - 0x8f, 0x34, 0x75, 0x3f, 0xaf, 0x73, 0xb8, 0xd2, 0xaf, 0xcb, 0xb1, 0x36, 0xa8, 0xeb, 0x72, 0xac, - 0xcf, 0xef, 0x5f, 0x72, 0x68, 0x7b, 0xe2, 0xf0, 0xe8, 0xcb, 0x32, 0x0a, 0x2e, 0x96, 0x51, 0xf0, - 0x73, 0x19, 0x05, 0xe7, 0xab, 0xa8, 0x75, 0xb1, 0x8a, 0x5a, 0xdf, 0x56, 0x51, 0xeb, 0xed, 0x7e, - 0xc6, 0x4c, 0x5e, 0xcd, 0x70, 0x2a, 0xca, 0xe6, 0x16, 0xf7, 0xd9, 0xd7, 0xf3, 0x53, 0x92, 0x16, - 0x0c, 0xb8, 0x21, 0x99, 0x92, 0xa9, 0xbd, 0x77, 0xd6, 0xb5, 0xb3, 0x7c, 0xf6, 0x3b, 0x00, 0x00, - 0xff, 0xff, 0x89, 0x73, 0x23, 0x6e, 0x9f, 0x03, 0x00, 0x00, + // 522 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x41, 0x6f, 0xd3, 0x30, + 0x14, 0xc7, 0x97, 0x32, 0x3a, 0xe6, 0xb1, 0x8e, 0x79, 0x80, 0x4a, 0x85, 0xd2, 0xaa, 0x02, 0x51, + 0x90, 0x66, 0x6b, 0xe5, 0xce, 0x61, 0x1c, 0x36, 0xc4, 0x05, 0xa5, 0x9c, 0xb8, 0x44, 0x6e, 0xfa, + 0x96, 0x58, 0x4b, 0x6c, 0xcf, 0x76, 0x2a, 0x71, 0x45, 0xe2, 0x3e, 0x89, 0x13, 0xdf, 0x84, 0x8f, + 0xc0, 0x71, 0x12, 0x17, 0x4e, 0x80, 0x5a, 0x3e, 0x08, 0x8a, 0x9d, 0x0c, 0xf5, 0xb0, 0xc1, 0x29, + 0xf6, 0xff, 0xfd, 0xde, 0xcb, 0x7b, 0xef, 0x6f, 0xf4, 0x28, 0x91, 0xa6, 0x90, 0x86, 0x4e, 0x99, + 0x01, 0x2a, 0xe4, 0x0c, 0xe8, 0xfc, 0x60, 0x0a, 0x96, 0x1d, 0xd0, 0xb3, 0x12, 0xf4, 0x7b, 0xa2, + 0xb4, 0xb4, 0x12, 0x77, 0x3d, 0x45, 0x2a, 0x8a, 0x54, 0x14, 0xa9, 0xa9, 0xde, 0xc3, 0x54, 0xca, + 0x34, 0x07, 0xca, 0x14, 0xa7, 0x4c, 0x08, 0x69, 0x99, 0xe5, 0x52, 0x18, 0x9f, 0xd7, 0xeb, 0xd7, + 0x51, 0x77, 0x9b, 0x96, 0x27, 0xd4, 0xf2, 0x02, 0x8c, 0x65, 0x85, 0xaa, 0x81, 0xbb, 0xa9, 0x4c, + 0xa5, 0x3b, 0xd2, 0xea, 0xe4, 0xd5, 0xe1, 0x0e, 0xda, 0x7e, 0x29, 0xc5, 0x09, 0x4f, 0x23, 0x38, + 0x2b, 0xc1, 0xd8, 0xe1, 0x97, 0x00, 0x75, 0x1a, 0xc5, 0x28, 0x29, 0x0c, 0xe0, 0x67, 0x68, 0xb7, + 0xe0, 0x82, 0x17, 0x65, 0x11, 0xa7, 0xcc, 0xc4, 0x4a, 0xf3, 0x04, 0xba, 0xc1, 0x20, 0x18, 0x6d, + 0x46, 0x3b, 0x75, 0xe0, 0x88, 0x99, 0x37, 0x95, 0x8c, 0x09, 0xda, 0x53, 0xba, 0x14, 0x5c, 0xa4, + 0xf1, 0x29, 0x80, 0x8a, 0x35, 0x24, 0x20, 0x6c, 0xb7, 0xe5, 0xe8, 0xdd, 0x3a, 0xf4, 0x1a, 0x40, + 0x45, 0x2e, 0x80, 0x9f, 0xa2, 0x3b, 0x0d, 0xcf, 0x85, 0x05, 0x3d, 0x67, 0x79, 0xf7, 0x86, 0x2f, + 0x5d, 0xeb, 0xaf, 0x6a, 0x19, 0xf7, 0xd1, 0x56, 0xc6, 0x72, 0x1b, 0x67, 0xc0, 0xd3, 0xcc, 0x76, + 0xd7, 0x07, 0xc1, 0x68, 0x3d, 0x42, 0x95, 0x74, 0xec, 0x94, 0x6a, 0x96, 0x89, 0x65, 0xb6, 0x34, + 0xcd, 0x2c, 0x3f, 0x02, 0xd4, 0x69, 0x94, 0x7a, 0x96, 0x31, 0xba, 0x07, 0x4c, 0xe7, 0x1c, 0x8c, + 0x8d, 0x8d, 0x95, 0x1a, 0x9a, 0x72, 0x81, 0x2b, 0xb7, 0xd7, 0x04, 0x27, 0x55, 0xcc, 0xd7, 0xc5, + 0xf7, 0x51, 0xbb, 0x86, 0x5a, 0x0e, 0xaa, 0x6f, 0xf8, 0x05, 0xda, 0xbc, 0x5c, 0xb2, 0x6b, 0x7a, + 0x6b, 0xdc, 0x23, 0xde, 0x06, 0xd2, 0xd8, 0x40, 0xde, 0x36, 0xc4, 0xe1, 0xfa, 0xf9, 0xcf, 0x7e, + 0x10, 0xfd, 0x4d, 0xc1, 0x0f, 0xd0, 0x2d, 0xa6, 0x54, 0x9c, 0x31, 0x93, 0xb9, 0x69, 0x6e, 0x47, + 0x1b, 0x4c, 0xa9, 0x63, 0x66, 0x32, 0xfc, 0x18, 0x75, 0xe6, 0x2c, 0xe7, 0x33, 0x66, 0xa5, 0xf6, + 0xc0, 0x4d, 0x07, 0x6c, 0x5f, 0xaa, 0x15, 0x36, 0xfe, 0xdc, 0x42, 0x1b, 0x13, 0xd0, 0xf3, 0x6a, + 0xf3, 0x1f, 0x03, 0xd4, 0xf6, 0xc6, 0xe1, 0x27, 0xe4, 0xaa, 0x47, 0x44, 0x56, 0xcc, 0xee, 0x8d, + 0xfe, 0x0d, 0xfa, 0xbd, 0x0d, 0x47, 0x1f, 0xbe, 0xfd, 0xfe, 0xd4, 0x1a, 0xe2, 0x01, 0xbd, 0xf2, + 0x15, 0x27, 0xfe, 0xe7, 0x55, 0x1f, 0x7e, 0xe9, 0xd7, 0xf5, 0xb1, 0x62, 0xd4, 0x75, 0x7d, 0xac, + 0xfa, 0xf7, 0x3f, 0x7d, 0x18, 0x97, 0x71, 0x78, 0xf4, 0x75, 0x11, 0x06, 0x17, 0x8b, 0x30, 0xf8, + 0xb5, 0x08, 0x83, 0xf3, 0x65, 0xb8, 0x76, 0xb1, 0x0c, 0xd7, 0xbe, 0x2f, 0xc3, 0xb5, 0x77, 0xfb, + 0x29, 0xb7, 0x59, 0x39, 0x25, 0x89, 0x2c, 0x9a, 0x2a, 0xfe, 0xb3, 0x6f, 0x66, 0xa7, 0x34, 0xc9, + 0x39, 0x08, 0x4b, 0x53, 0xad, 0x12, 0x57, 0x77, 0xda, 0x76, 0x5e, 0x3e, 0xff, 0x13, 0x00, 0x00, + 0xff, 0xff, 0x0c, 0x93, 0xa1, 0xea, 0xc0, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -396,6 +404,7 @@ func _Service_Status_Handler(srv interface{}, ctx context.Context, dec func(inte return interceptor(ctx, in, info, handler) } +var Service_serviceDesc = _Service_serviceDesc var _Service_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.base.node.v1beta1.Service", HandlerType: (*ServiceServer)(nil), @@ -456,6 +465,11 @@ func (m *ConfigResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.HaltHeight != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.HaltHeight)) + i-- + dAtA[i] = 0x20 + } if len(m.PruningInterval) > 0 { i -= len(m.PruningInterval) copy(dAtA[i:], m.PruningInterval) @@ -598,6 +612,9 @@ func (m *ConfigResponse) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } + if m.HaltHeight != 0 { + n += 1 + sovQuery(uint64(m.HaltHeight)) + } return n } @@ -818,6 +835,25 @@ func (m *ConfigResponse) Unmarshal(dAtA []byte) error { } m.PruningInterval = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HaltHeight", wireType) + } + m.HaltHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.HaltHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) diff --git a/client/grpc/node/service.go b/client/grpc/node/service.go index 0d4f27a42932..144722a9cbfb 100644 --- a/client/grpc/node/service.go +++ b/client/grpc/node/service.go @@ -32,6 +32,7 @@ type queryServer struct { func NewQueryServer(clientCtx client.Context, cfg config.Config) ServiceServer { return queryServer{ clientCtx: clientCtx, + cfg: cfg, } } @@ -42,6 +43,7 @@ func (s queryServer) Config(ctx context.Context, _ *ConfigRequest) (*ConfigRespo MinimumGasPrice: sdkCtx.MinGasPrices().String(), PruningKeepRecent: s.cfg.PruningKeepRecent, PruningInterval: s.cfg.PruningInterval, + HaltHeight: s.cfg.HaltHeight, }, nil } diff --git a/client/grpc/node/service_test.go b/client/grpc/node/service_test.go index 2cbc07d3dda8..fc9ddbb5101e 100644 --- a/client/grpc/node/service_test.go +++ b/client/grpc/node/service_test.go @@ -11,11 +11,18 @@ import ( ) func TestServiceServer_Config(t *testing.T) { - svr := NewQueryServer(client.Context{}, *config.DefaultConfig()) + defaultCfg := config.DefaultConfig() + defaultCfg.PruningKeepRecent = "2000" + defaultCfg.PruningInterval = "10" + defaultCfg.HaltHeight = 100 + svr := NewQueryServer(client.Context{}, *defaultCfg) ctx := sdk.Context{}.WithMinGasPrices(sdk.NewDecCoins(sdk.NewInt64DecCoin("stake", 15))) resp, err := svr.Config(ctx, &ConfigRequest{}) require.NoError(t, err) require.NotNil(t, resp) require.Equal(t, ctx.MinGasPrices().String(), resp.MinimumGasPrice) + require.Equal(t, defaultCfg.PruningKeepRecent, resp.PruningKeepRecent) + require.Equal(t, defaultCfg.PruningInterval, resp.PruningInterval) + require.Equal(t, defaultCfg.HaltHeight, resp.HaltHeight) } diff --git a/client/grpc/reflection/reflection.pb.go b/client/grpc/reflection/reflection.pb.go index 3c207e94fefc..d54b1f600157 100644 --- a/client/grpc/reflection/reflection.pb.go +++ b/client/grpc/reflection/reflection.pb.go @@ -351,6 +351,7 @@ func _ReflectionService_ListImplementations_Handler(srv interface{}, ctx context return interceptor(ctx, in, info, handler) } +var ReflectionService_serviceDesc = _ReflectionService_serviceDesc var _ReflectionService_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.base.reflection.v1beta1.ReflectionService", HandlerType: (*ReflectionServiceServer)(nil), diff --git a/client/grpc_query.go b/client/grpc_query.go index 6ae3d9b8b869..493ffe1ae998 100644 --- a/client/grpc_query.go +++ b/client/grpc_query.go @@ -6,16 +6,15 @@ import ( "reflect" "strconv" - "google.golang.org/grpc/encoding" - - "github.com/cosmos/cosmos-sdk/codec" - - errorsmod "cosmossdk.io/errors" abci "github.com/cometbft/cometbft/abci/types" gogogrpc "github.com/cosmos/gogoproto/grpc" "google.golang.org/grpc" + "google.golang.org/grpc/encoding" "google.golang.org/grpc/metadata" + errorsmod "cosmossdk.io/errors" + + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" grpctypes "github.com/cosmos/cosmos-sdk/types/grpc" diff --git a/client/grpc_query_test.go b/client/grpc_query_test.go index 91e06375b4a7..284f6093023d 100644 --- a/client/grpc_query_test.go +++ b/client/grpc_query_test.go @@ -4,9 +4,6 @@ import ( "context" "testing" - "cosmossdk.io/depinject" - "cosmossdk.io/log" - sdkmath "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" cmtjson "github.com/cometbft/cometbft/libs/json" dbm "github.com/cosmos/cosmos-db" @@ -14,6 +11,10 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "cosmossdk.io/depinject" + "cosmossdk.io/log" + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -72,7 +73,7 @@ func (s *IntegrationTestSuite) SetupSuite() { acc := authtypes.NewBaseAccount(senderPrivKey.PubKey().Address().Bytes(), senderPrivKey.PubKey(), 0, 0) balance := types.Balance{ Address: acc.GetAddress().String(), - Coins: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(s.genesisAccountBalance))), + Coins: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(s.genesisAccountBalance))), } genesisState, err := sims.GenesisStateWithValSet(cdc, app.DefaultGenesis(), valSet, []authtypes.GenesisAccount{acc}, balance) @@ -128,7 +129,7 @@ func (s *IntegrationTestSuite) TestGRPCQuery() { ) s.Require().NoError(err) bal := res.GetBalance() - s.Equal(sdk.NewCoin(denom, sdkmath.NewInt(s.genesisAccountBalance)), *bal) + s.Equal(sdk.NewCoin(denom, math.NewInt(s.genesisAccountBalance)), *bal) } func TestIntegrationTestSuite(t *testing.T) { diff --git a/client/keys/add.go b/client/keys/add.go index 4392f90bf25f..b64db8afdc10 100644 --- a/client/keys/add.go +++ b/client/keys/add.go @@ -3,9 +3,12 @@ package keys import ( "bufio" "bytes" + "encoding/base64" "encoding/json" "errors" "fmt" + "io" + "os" "sort" "github.com/cosmos/go-bip39" @@ -15,6 +18,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/input" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/crypto/hd" "github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/cosmos/cosmos-sdk/crypto/keys/multisig" @@ -23,15 +27,17 @@ import ( ) const ( - flagInteractive = "interactive" - flagRecover = "recover" - flagNoBackup = "no-backup" - flagCoinType = "coin-type" - flagAccount = "account" - flagIndex = "index" - flagMultisig = "multisig" - flagNoSort = "nosort" - flagHDPath = "hd-path" + flagInteractive = "interactive" + flagRecover = "recover" + flagNoBackup = "no-backup" + flagCoinType = "coin-type" + flagAccount = "account" + flagIndex = "index" + flagMultisig = "multisig" + flagNoSort = "nosort" + flagHDPath = "hd-path" + flagPubKeyBase64 = "pubkey-base64" + flagMnemonicSrc = "source" // DefaultKeyPass contains the default key password for genesis transactions DefaultKeyPass = "12345678" @@ -54,6 +60,11 @@ local keystore. Use the --pubkey flag to add arbitrary public keys to the keystore for constructing multisig transactions. +Use the --source flag to import mnemonic from a file in recover or interactive mode. +Example: + + keys add testing --recover --source ./mnemonic.txt + You can create and store a multisig key by passing the list of key names stored in a keyring and the minimum number of signatures required through --multisig-threshold. The keys are sorted by address, unless the flag --nosort is set. @@ -69,6 +80,7 @@ Example: f.Int(flagMultiSigThreshold, 1, "K out of N required signatures. For use in conjunction with --multisig") f.Bool(flagNoSort, false, "Keys passed to --multisig are taken in the order they're supplied") f.String(FlagPublicKey, "", "Parse a public key in JSON format and saves key info to file.") + f.String(flagPubKeyBase64, "", "Parse a public key in base64 format and saves key info.") f.BoolP(flagInteractive, "i", false, "Interactively prompt user for BIP39 passphrase and mnemonic") f.Bool(flags.FlagUseLedger, false, "Store a local reference to a private key on a Ledger device") f.Bool(flagRecover, false, "Provide seed phrase to recover existing key instead of creating") @@ -79,10 +91,11 @@ Example: f.Uint32(flagAccount, 0, "Account number for HD derivation (less than equal 2147483647)") f.Uint32(flagIndex, 0, "Address index number for HD derivation (less than equal 2147483647)") f.String(flags.FlagKeyType, string(hd.Secp256k1Type), "Key signing algorithm to generate keys for") + f.String(flagMnemonicSrc, "", "Import mnemonic from a file (only usable when recover or interactive is passed)") // support old flags name for backwards compatibility f.SetNormalizeFunc(func(f *pflag.FlagSet, name string) pflag.NormalizedName { - if name == "algo" { + if name == flags.FlagKeyAlgorithm { name = flags.FlagKeyType } @@ -189,6 +202,10 @@ func runAddCmd(ctx client.Context, cmd *cobra.Command, args []string, inBuf *buf } pubKey, _ := cmd.Flags().GetString(FlagPublicKey) + pubKeyBase64, _ := cmd.Flags().GetString(flagPubKeyBase64) + if pubKey != "" && pubKeyBase64 != "" { + return fmt.Errorf(`flags %s and %s cannot be used simultaneously`, FlagPublicKey, flagPubKeyBase64) + } if pubKey != "" { var pk cryptotypes.PubKey if err = ctx.Codec.UnmarshalInterfaceJSON([]byte(pubKey), &pk); err != nil { @@ -202,6 +219,38 @@ func runAddCmd(ctx client.Context, cmd *cobra.Command, args []string, inBuf *buf return printCreate(cmd, k, false, "", outputFormat) } + if pubKeyBase64 != "" { + b64, err := base64.StdEncoding.DecodeString(pubKeyBase64) + if err != nil { + return err + } + + var pk cryptotypes.PubKey + // create an empty pubkey in order to get the algo TypeUrl. + tempAny, err := codectypes.NewAnyWithValue(algo.Generate()([]byte{}).PubKey()) + if err != nil { + return err + } + + jsonPub, err := json.Marshal(struct { + Type string `json:"@type,omitempty"` + Key string `json:"key,omitempty"` + }{tempAny.TypeUrl, string(b64)}) + if err != nil { + return fmt.Errorf("failed to JSON marshal typeURL and base64 key: %w", err) + } + + if err = ctx.Codec.UnmarshalInterfaceJSON(jsonPub, &pk); err != nil { + return err + } + + k, err := kb.SaveOfflineKey(name, pk) + if err != nil { + return fmt.Errorf("failed to save offline key: %w", err) + } + + return printCreate(cmd, k, false, "", outputFormat) + } coinType, _ := cmd.Flags().GetUint32(flagCoinType) account, _ := cmd.Flags().GetUint32(flagAccount) @@ -230,19 +279,34 @@ func runAddCmd(ctx client.Context, cmd *cobra.Command, args []string, inBuf *buf var mnemonic, bip39Passphrase string recoverFlag, _ := cmd.Flags().GetBool(flagRecover) + mnemonicSrc, _ := cmd.Flags().GetString(flagMnemonicSrc) if recoverFlag { - mnemonic, err = input.GetString("Enter your bip39 mnemonic", inBuf) - if err != nil { - return err + if mnemonicSrc != "" { + mnemonic, err = readMnemonicFromFile(mnemonicSrc) + if err != nil { + return err + } + } else { + mnemonic, err = input.GetString("Enter your bip39 mnemonic", inBuf) + if err != nil { + return err + } } if !bip39.IsMnemonicValid(mnemonic) { return errors.New("invalid mnemonic") } } else if interactive { - mnemonic, err = input.GetString("Enter your bip39 mnemonic, or hit enter to generate one.", inBuf) - if err != nil { - return err + if mnemonicSrc != "" { + mnemonic, err = readMnemonicFromFile(mnemonicSrc) + if err != nil { + return err + } + } else { + mnemonic, err = input.GetString("Enter your bip39 mnemonic, or hit enter to generate one.", inBuf) + if err != nil { + return err + } } if !bip39.IsMnemonicValid(mnemonic) && mnemonic != "" { @@ -337,3 +401,17 @@ func printCreate(cmd *cobra.Command, k *keyring.Record, showMnemonic bool, mnemo return nil } + +func readMnemonicFromFile(filePath string) (string, error) { + file, err := os.Open(filePath) + if err != nil { + return "", err + } + defer file.Close() + + bz, err := io.ReadAll(file) + if err != nil { + return "", err + } + return string(bz), nil +} diff --git a/client/keys/add_ledger_test.go b/client/keys/add_ledger_test.go index 289200e3fe29..797c0452dfbb 100644 --- a/client/keys/add_ledger_test.go +++ b/client/keys/add_ledger_test.go @@ -38,7 +38,7 @@ func Test_runAddCmdLedgerWithCustomCoinType(t *testing.T) { config.SetBech32PrefixForConsensusNode(bech32PrefixConsAddr, bech32PrefixConsPub) cmd := AddKeyCommand() - cmd.Flags().AddFlagSet(Commands("home").PersistentFlags()) + cmd.Flags().AddFlagSet(Commands().PersistentFlags()) // Prepare a keybase kbHome := t.TempDir() @@ -91,7 +91,7 @@ func Test_runAddCmdLedgerWithCustomCoinType(t *testing.T) { func Test_runAddCmdLedger(t *testing.T) { cmd := AddKeyCommand() - cmd.Flags().AddFlagSet(Commands("home").PersistentFlags()) + cmd.Flags().AddFlagSet(Commands().PersistentFlags()) mockIn := testutil.ApplyMockIODiscardOutErr(cmd) kbHome := t.TempDir() @@ -166,7 +166,7 @@ func Test_runAddCmdLedgerDryRun(t *testing.T) { tt := tt t.Run(tt.name, func(t *testing.T) { cmd := AddKeyCommand() - cmd.Flags().AddFlagSet(Commands("home").PersistentFlags()) + cmd.Flags().AddFlagSet(Commands().PersistentFlags()) kbHome := t.TempDir() mockIn := testutil.ApplyMockIODiscardOutErr(cmd) diff --git a/client/keys/add_test.go b/client/keys/add_test.go index f275d001ab38..ea02eb6b539f 100644 --- a/client/keys/add_test.go +++ b/client/keys/add_test.go @@ -7,6 +7,7 @@ import ( "io" "testing" + "github.com/cosmos/go-bip39" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/client" @@ -17,12 +18,11 @@ import ( "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" - "github.com/cosmos/go-bip39" ) func Test_runAddCmdBasic(t *testing.T) { cmd := AddKeyCommand() - cmd.Flags().AddFlagSet(Commands("home").PersistentFlags()) + cmd.Flags().AddFlagSet(Commands().PersistentFlags()) mockIn := testutil.ApplyMockIODiscardOutErr(cmd) kbHome := t.TempDir() @@ -41,7 +41,7 @@ func Test_runAddCmdBasic(t *testing.T) { cmd.SetArgs([]string{ "keyname1", - fmt.Sprintf("--%s=%s", flags.FlagHome, kbHome), + fmt.Sprintf("--%s=%s", flags.FlagKeyringDir, kbHome), fmt.Sprintf("--%s=%s", flags.FlagOutput, flags.OutputFormatText), fmt.Sprintf("--%s=%s", flags.FlagKeyType, hd.Secp256k1Type), fmt.Sprintf("--%s=%s", flags.FlagKeyringBackend, keyring.BackendTest), @@ -54,7 +54,7 @@ func Test_runAddCmdBasic(t *testing.T) { cmd.SetArgs([]string{ "keyname2", - fmt.Sprintf("--%s=%s", flags.FlagHome, kbHome), + fmt.Sprintf("--%s=%s", flags.FlagKeyringDir, kbHome), fmt.Sprintf("--%s=%s", flags.FlagOutput, flags.OutputFormatText), fmt.Sprintf("--%s=%s", flags.FlagKeyType, hd.Secp256k1Type), fmt.Sprintf("--%s=%s", flags.FlagKeyringBackend, keyring.BackendTest), @@ -68,7 +68,7 @@ func Test_runAddCmdBasic(t *testing.T) { cmd.SetArgs([]string{ "keyname4", - fmt.Sprintf("--%s=%s", flags.FlagHome, kbHome), + fmt.Sprintf("--%s=%s", flags.FlagKeyringDir, kbHome), fmt.Sprintf("--%s=%s", flags.FlagOutput, flags.OutputFormatText), fmt.Sprintf("--%s=%s", flags.FlagKeyType, hd.Secp256k1Type), fmt.Sprintf("--%s=%s", flags.FlagKeyringBackend, keyring.BackendTest), @@ -79,7 +79,7 @@ func Test_runAddCmdBasic(t *testing.T) { cmd.SetArgs([]string{ "keyname5", - fmt.Sprintf("--%s=%s", flags.FlagHome, kbHome), + fmt.Sprintf("--%s=%s", flags.FlagKeyringDir, kbHome), fmt.Sprintf("--%s=true", flags.FlagDryRun), fmt.Sprintf("--%s=%s", flags.FlagOutput, flags.OutputFormatText), fmt.Sprintf("--%s=%s", flags.FlagKeyType, hd.Secp256k1Type), @@ -122,6 +122,7 @@ func Test_runAddCmdBasic(t *testing.T) { func Test_runAddCmdDryRun(t *testing.T) { pubkey1 := `{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AtObiFVE4s+9+RX5SP8TN9r2mxpoaT4eGj9CJfK7VRzN"}` pubkey2 := `{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"A/se1vkqgdQ7VJQCM4mxN+L+ciGhnnJ4XYsQCRBMrdRi"}` + b64Pubkey := "QWhnOHhpdXBJcGZ2UlR2ak5la1ExclROUThTOW96YjdHK2RYQmFLVjl4aUo=" cdc := moduletestutil.MakeTestEncodingConfig().Codec testData := []struct { @@ -181,12 +182,30 @@ func Test_runAddCmdDryRun(t *testing.T) { }, added: false, }, + { + name: "base64 pubkey account is added", + args: []string{ + "testkey", + fmt.Sprintf("--%s=%s", flags.FlagDryRun, "false"), + fmt.Sprintf("--%s=%s", flagPubKeyBase64, b64Pubkey), + }, + added: true, + }, + { + name: "base64 pubkey account is not added with dry run", + args: []string{ + "testkey", + fmt.Sprintf("--%s=%s", flags.FlagDryRun, "true"), + fmt.Sprintf("--%s=%s", flagPubKeyBase64, b64Pubkey), + }, + added: false, + }, } for _, tt := range testData { tt := tt t.Run(tt.name, func(t *testing.T) { cmd := AddKeyCommand() - cmd.Flags().AddFlagSet(Commands("home").PersistentFlags()) + cmd.Flags().AddFlagSet(Commands().PersistentFlags()) kbHome := t.TempDir() mockIn := testutil.ApplyMockIODiscardOutErr(cmd) @@ -232,7 +251,7 @@ func Test_runAddCmdDryRun(t *testing.T) { func TestAddRecoverFileBackend(t *testing.T) { cmd := AddKeyCommand() - cmd.Flags().AddFlagSet(Commands("home").PersistentFlags()) + cmd.Flags().AddFlagSet(Commands().PersistentFlags()) cdc := moduletestutil.MakeTestEncodingConfig().Codec mockIn := testutil.ApplyMockIODiscardOutErr(cmd) @@ -243,7 +262,7 @@ func TestAddRecoverFileBackend(t *testing.T) { cmd.SetArgs([]string{ "keyname1", - fmt.Sprintf("--%s=%s", flags.FlagHome, kbHome), + fmt.Sprintf("--%s=%s", flags.FlagKeyringDir, kbHome), fmt.Sprintf("--%s=%s", flags.FlagOutput, flags.OutputFormatText), fmt.Sprintf("--%s=%s", flags.FlagKeyType, hd.Secp256k1Type), fmt.Sprintf("--%s=%s", flags.FlagKeyringBackend, keyring.BackendFile), diff --git a/client/keys/delete.go b/client/keys/delete.go index 46a269091dab..cf6ffe660a90 100644 --- a/client/keys/delete.go +++ b/client/keys/delete.go @@ -37,7 +37,8 @@ private keys stored in a ledger device cannot be deleted with the CLI. for _, name := range args { k, err := clientCtx.Keyring.Key(name) if err != nil { - return err + cmd.PrintErrf("key %s not found\n", name) + continue } // confirm deletion, unless -y is passed diff --git a/client/keys/delete_test.go b/client/keys/delete_test.go index 49f897aece41..17d68a65a3d4 100644 --- a/client/keys/delete_test.go +++ b/client/keys/delete_test.go @@ -1,6 +1,7 @@ package keys import ( + "bytes" "context" "fmt" "testing" @@ -20,9 +21,11 @@ import ( func Test_runDeleteCmd(t *testing.T) { // Now add a temporary keybase kbHome := t.TempDir() + errBuf := new(bytes.Buffer) cmd := DeleteKeyCommand() - cmd.Flags().AddFlagSet(Commands(kbHome).PersistentFlags()) + cmd.Flags().AddFlagSet(Commands().PersistentFlags()) mockIn := testutil.ApplyMockIODiscardOutErr(cmd) + cmd.SetErr(errBuf) yesF, _ := cmd.Flags().GetBool(flagYes) forceF, _ := cmd.Flags().GetBool(flagForce) @@ -36,7 +39,7 @@ func Test_runDeleteCmd(t *testing.T) { path := sdk.GetConfig().GetFullBIP44Path() cdc := moduletestutil.MakeTestEncodingConfig().Codec - cmd.SetArgs([]string{"blah", fmt.Sprintf("--%s=%s", flags.FlagHome, kbHome)}) + cmd.SetArgs([]string{"blah", fmt.Sprintf("--%s=%s", flags.FlagKeyringDir, kbHome)}) kb, err := keyring.New(sdk.KeyringServiceName(), keyring.BackendTest, kbHome, mockIn, cdc) require.NoError(t, err) @@ -53,13 +56,15 @@ func Test_runDeleteCmd(t *testing.T) { ctx := context.WithValue(context.Background(), client.ClientContextKey, &clientCtx) err = cmd.ExecuteContext(ctx) - require.Error(t, err) - require.EqualError(t, err, "blah.info: key not found") + require.NoError(t, err) + + output := errBuf.String() + require.Contains(t, output, "key blah not found") // User confirmation missing cmd.SetArgs([]string{ fakeKeyName1, - fmt.Sprintf("--%s=%s", flags.FlagHome, kbHome), + fmt.Sprintf("--%s=%s", flags.FlagKeyringDir, kbHome), fmt.Sprintf("--%s=%s", flags.FlagKeyringBackend, keyring.BackendTest), }) err = cmd.Execute() @@ -72,7 +77,7 @@ func Test_runDeleteCmd(t *testing.T) { // Now there is a confirmation cmd.SetArgs([]string{ fakeKeyName1, - fmt.Sprintf("--%s=%s", flags.FlagHome, kbHome), + fmt.Sprintf("--%s=%s", flags.FlagKeyringDir, kbHome), fmt.Sprintf("--%s=true", flagYes), fmt.Sprintf("--%s=%s", flags.FlagKeyringBackend, keyring.BackendTest), }) @@ -86,7 +91,7 @@ func Test_runDeleteCmd(t *testing.T) { cmd.SetArgs([]string{ fakeKeyName2, - fmt.Sprintf("--%s=%s", flags.FlagHome, kbHome), + fmt.Sprintf("--%s=%s", flags.FlagKeyringDir, kbHome), fmt.Sprintf("--%s=true", flagYes), fmt.Sprintf("--%s=%s", flags.FlagKeyringBackend, keyring.BackendTest), }) diff --git a/client/keys/export_test.go b/client/keys/export_test.go index cd4dc98049c0..d7e4126f6a7c 100644 --- a/client/keys/export_test.go +++ b/client/keys/export_test.go @@ -9,14 +9,13 @@ import ( "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/crypto/hd" + "github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/cosmos/cosmos-sdk/testutil" "github.com/cosmos/cosmos-sdk/testutil/testdata" - moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" - - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/crypto/keyring" sdk "github.com/cosmos/cosmos-sdk/types" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" ) func Test_runExportCmd(t *testing.T) { @@ -73,12 +72,12 @@ func Test_runExportCmd(t *testing.T) { kbHome := t.TempDir() defaultArgs := []string{ "keyname1", - fmt.Sprintf("--%s=%s", flags.FlagHome, kbHome), + fmt.Sprintf("--%s=%s", flags.FlagKeyringDir, kbHome), fmt.Sprintf("--%s=%s", flags.FlagKeyringBackend, tc.keyringBackend), } cmd := ExportKeyCommand() - cmd.Flags().AddFlagSet(Commands("home").PersistentFlags()) + cmd.Flags().AddFlagSet(Commands().PersistentFlags()) cmd.SetArgs(append(defaultArgs, tc.extraArgs...)) mockIn, mockOut := testutil.ApplyMockIO(cmd) diff --git a/client/keys/import.go b/client/keys/import.go index a9d5c185acb7..98ccb6547ff0 100644 --- a/client/keys/import.go +++ b/client/keys/import.go @@ -2,12 +2,16 @@ package keys import ( "bufio" + "fmt" "os" "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/input" + "github.com/cosmos/cosmos-sdk/crypto/hd" + "github.com/cosmos/cosmos-sdk/version" ) // ImportKeyCommand imports private keys from a keyfile. @@ -38,3 +42,22 @@ func ImportKeyCommand() *cobra.Command { }, } } + +func ImportKeyHexCommand() *cobra.Command { + cmd := &cobra.Command{ + Use: "import-hex ", + Short: "Import private keys into the local keybase", + Long: fmt.Sprintf("Import hex encoded private key into the local keybase.\nSupported key-types can be obtained with:\n%s list-key-types", version.AppName), + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + keyType, _ := cmd.Flags().GetString(flags.FlagKeyType) + return clientCtx.Keyring.ImportPrivKeyHex(args[0], args[1], keyType) + }, + } + cmd.Flags().String(flags.FlagKeyType, string(hd.Secp256k1Type), "private key signing algorithm kind") + return cmd +} diff --git a/client/keys/import_test.go b/client/keys/import_test.go index d9b9d0fee79f..0cff5065d82c 100644 --- a/client/keys/import_test.go +++ b/client/keys/import_test.go @@ -76,11 +76,16 @@ HbP+c6JmeJy9JXe2rbbF1QtCX1gLqGcDQPBXiCtFvP7/8wTZtVOPj8vREzhZ9ElO for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { cmd := ImportKeyCommand() - cmd.Flags().AddFlagSet(Commands("home").PersistentFlags()) + cmd.Flags().AddFlagSet(Commands().PersistentFlags()) mockIn := testutil.ApplyMockIODiscardOutErr(cmd) // Now add a temporary keybase - kbHome := t.TempDir() + kbHome := filepath.Join(t.TempDir(), fmt.Sprintf("kbhome-%s", tc.name)) + // Create dir, otherwise os.WriteFile will fail + if _, err := os.Stat(kbHome); os.IsNotExist(err) { + err = os.MkdirAll(kbHome, 0o700) + require.NoError(t, err) + } kb, err := keyring.New(sdk.KeyringServiceName(), tc.keyringBackend, kbHome, nil, cdc) require.NoError(t, err) @@ -115,3 +120,60 @@ HbP+c6JmeJy9JXe2rbbF1QtCX1gLqGcDQPBXiCtFvP7/8wTZtVOPj8vREzhZ9ElO }) } } + +func Test_runImportHexCmd(t *testing.T) { + cdc := moduletestutil.MakeTestEncodingConfig().Codec + testCases := []struct { + name string + keyringBackend string + hexKey string + keyType string + expectError bool + }{ + { + name: "test backend success", + keyringBackend: keyring.BackendTest, + hexKey: "0xa3e57952e835ed30eea86a2993ac2a61c03e74f2085b3635bd94aa4d7ae0cfdf", + keyType: "secp256k1", + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + cmd := ImportKeyHexCommand() + cmd.Flags().AddFlagSet(Commands().PersistentFlags()) + mockIn := testutil.ApplyMockIODiscardOutErr(cmd) + + // Now add a temporary keybase + kbHome := filepath.Join(t.TempDir(), fmt.Sprintf("kbhome-%s", tc.name)) + kb, err := keyring.New(sdk.KeyringServiceName(), tc.keyringBackend, kbHome, nil, cdc) + require.NoError(t, err) + + clientCtx := client.Context{}. + WithKeyringDir(kbHome). + WithKeyring(kb). + WithInput(mockIn). + WithCodec(cdc) + ctx := context.WithValue(context.Background(), client.ClientContextKey, &clientCtx) + + t.Cleanup(cleanupKeys(t, kb, "keyname1")) + + defer func() { + _ = os.RemoveAll(kbHome) + }() + + cmd.SetArgs([]string{ + "keyname1", tc.hexKey, + fmt.Sprintf("--%s=%s", flags.FlagKeyType, tc.keyType), + fmt.Sprintf("--%s=%s", flags.FlagKeyringBackend, tc.keyringBackend), + }) + + err = cmd.ExecuteContext(ctx) + if tc.expectError { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } +} diff --git a/client/keys/list.go b/client/keys/list.go index e3b3e4f8aea5..4d7140c605ab 100644 --- a/client/keys/list.go +++ b/client/keys/list.go @@ -1,10 +1,10 @@ package keys import ( - "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" ) const flagListNames = "list-names" diff --git a/client/keys/list_test.go b/client/keys/list_test.go index 9fd0b70fb276..21f00cd0d445 100644 --- a/client/keys/list_test.go +++ b/client/keys/list_test.go @@ -31,7 +31,7 @@ func cleanupKeys(t *testing.T, kb keyring.Keyring, keys ...string) func() { func Test_runListCmd(t *testing.T) { cmd := ListKeysCmd() - cmd.Flags().AddFlagSet(Commands("home").PersistentFlags()) + cmd.Flags().AddFlagSet(Commands().PersistentFlags()) kbHome1 := t.TempDir() kbHome2 := t.TempDir() @@ -62,7 +62,7 @@ func Test_runListCmd(t *testing.T) { tt := tt t.Run(tt.name, func(t *testing.T) { cmd.SetArgs([]string{ - fmt.Sprintf("--%s=%s", flags.FlagHome, tt.kbDir), + fmt.Sprintf("--%s=%s", flags.FlagKeyringDir, tt.kbDir), fmt.Sprintf("--%s=false", flagListNames), }) @@ -71,7 +71,7 @@ func Test_runListCmd(t *testing.T) { } cmd.SetArgs([]string{ - fmt.Sprintf("--%s=%s", flags.FlagHome, tt.kbDir), + fmt.Sprintf("--%s=%s", flags.FlagKeyringDir, tt.kbDir), fmt.Sprintf("--%s=true", flagListNames), }) diff --git a/client/keys/migrate.go b/client/keys/migrate.go index 0a9fc78e2143..b2e192dffb93 100644 --- a/client/keys/migrate.go +++ b/client/keys/migrate.go @@ -18,8 +18,6 @@ Otherwise, we try to deserialize it using Amino into LegacyInfo. If this attempt LegacyInfo to Protobuf serialization format and overwrite the keyring entry. If any error occurred, it will be outputted in CLI and migration will be continued until all keys in the keyring DB are exhausted. See https://github.com/cosmos/cosmos-sdk/pull/9695 for more details. - -It is recommended to run in 'dry-run' mode first to verify all key migration material. `, Args: cobra.NoArgs, RunE: runMigrateCmd, diff --git a/client/keys/migrate_test.go b/client/keys/migrate_test.go index 8878f61755c0..bacbbacc7419 100644 --- a/client/keys/migrate_test.go +++ b/client/keys/migrate_test.go @@ -61,7 +61,7 @@ func (s *MigrateTestSuite) Test_runListAndShowCmd() { // run test simd keys list - to see that the migrated key is there cmd := ListKeysCmd() - cmd.Flags().AddFlagSet(Commands("home").PersistentFlags()) + cmd.Flags().AddFlagSet(Commands().PersistentFlags()) mockIn := testutil.ApplyMockIODiscardOutErr(cmd) kb, err := keyring.New(s.appName, keyring.BackendTest, s.dir, mockIn, s.cdc) @@ -75,7 +75,7 @@ func (s *MigrateTestSuite) Test_runListAndShowCmd() { ctx := context.WithValue(context.Background(), client.ClientContextKey, &clientCtx) cmd.SetArgs([]string{ - fmt.Sprintf("--%s=%s", flags.FlagHome, s.dir), + fmt.Sprintf("--%s=%s", flags.FlagKeyringDir, s.dir), fmt.Sprintf("--%s=false", flagListNames), }) diff --git a/client/keys/output_test.go b/client/keys/output_test.go index 88ca42f9b152..fc8e4bf3214c 100644 --- a/client/keys/output_test.go +++ b/client/keys/output_test.go @@ -4,12 +4,11 @@ import ( "fmt" "testing" + "github.com/stretchr/testify/require" + "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" - - "github.com/stretchr/testify/require" - "github.com/cosmos/cosmos-sdk/crypto/keyring" kmultisig "github.com/cosmos/cosmos-sdk/crypto/keys/multisig" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" @@ -45,6 +44,30 @@ func TestBech32KeysOutput(t *testing.T) { require.Equal(t, "{Name:multisig Type:multi Address:cosmos1nf8lf6n4wa43rzmdzwe6hkrnw5guekhqt595cw PubKey:{\"@type\":\"/cosmos.crypto.multisig.LegacyAminoPubKey\",\"threshold\":1,\"public_keys\":[{\"@type\":\"/cosmos.crypto.secp256k1.PubKey\",\"key\":\"AurroA7jvfPd1AadmmOvWM2rJSwipXfRf8yD6pLbA2DJ\"}]} Mnemonic:}", fmt.Sprintf("%+v", out)) } +// TestBech32KeysOutputNestedMsig tests that the output of a nested multisig key is correct +func TestBech32KeysOutputNestedMsig(t *testing.T) { + sk := secp256k1.PrivKey{Key: []byte{154, 49, 3, 117, 55, 232, 249, 20, 205, 216, 102, 7, 136, 72, 177, 2, 131, 202, 234, 81, 31, 208, 46, 244, 179, 192, 167, 163, 142, 117, 246, 13}} + tmpKey := sk.PubKey() + nestedMultiSig := kmultisig.NewLegacyAminoPubKey(1, []types.PubKey{tmpKey}) + multisigPk := kmultisig.NewLegacyAminoPubKey(2, []types.PubKey{tmpKey, nestedMultiSig}) + k, err := keyring.NewMultiRecord("multisig", multisigPk) + require.NotNil(t, k) + require.NoError(t, err) + + pubKey, err := k.GetPubKey() + require.NoError(t, err) + + accAddr := sdk.AccAddress(pubKey.Address()) + expectedOutput, err := NewKeyOutput(k.Name, k.GetType(), accAddr, multisigPk) + require.NoError(t, err) + + out, err := MkAccKeyOutput(k) + require.NoError(t, err) + + require.Equal(t, expectedOutput, out) + require.Equal(t, "{Name:multisig Type:multi Address:cosmos1nffp6v2j7wva4y4975exlrv8x5vh39axxt3swz PubKey:{\"@type\":\"/cosmos.crypto.multisig.LegacyAminoPubKey\",\"threshold\":2,\"public_keys\":[{\"@type\":\"/cosmos.crypto.secp256k1.PubKey\",\"key\":\"AurroA7jvfPd1AadmmOvWM2rJSwipXfRf8yD6pLbA2DJ\"},{\"@type\":\"/cosmos.crypto.multisig.LegacyAminoPubKey\",\"threshold\":1,\"public_keys\":[{\"@type\":\"/cosmos.crypto.secp256k1.PubKey\",\"key\":\"AurroA7jvfPd1AadmmOvWM2rJSwipXfRf8yD6pLbA2DJ\"}]}]} Mnemonic:}", fmt.Sprintf("%+v", out)) +} + func TestProtoMarshalJSON(t *testing.T) { require := require.New(t) pubkeys := generatePubKeys(3) diff --git a/client/keys/rename_test.go b/client/keys/rename_test.go index 40d7d579330b..8df5d641ba05 100644 --- a/client/keys/rename_test.go +++ b/client/keys/rename_test.go @@ -21,7 +21,7 @@ func Test_runRenameCmd(t *testing.T) { // temp keybase kbHome := t.TempDir() cmd := RenameKeyCommand() - cmd.Flags().AddFlagSet(Commands(kbHome).PersistentFlags()) + cmd.Flags().AddFlagSet(Commands().PersistentFlags()) mockIn := testutil.ApplyMockIODiscardOutErr(cmd) yesF, _ := cmd.Flags().GetBool(flagYes) @@ -47,7 +47,7 @@ func Test_runRenameCmd(t *testing.T) { ctx := context.WithValue(context.Background(), client.ClientContextKey, &clientCtx) // rename a key 'blah' which doesnt exist - cmd.SetArgs([]string{"blah", "blaah", fmt.Sprintf("--%s=%s", flags.FlagHome, kbHome)}) + cmd.SetArgs([]string{"blah", "blaah", fmt.Sprintf("--%s=%s", flags.FlagKeyringDir, kbHome)}) err = cmd.ExecuteContext(ctx) require.Error(t, err) require.EqualError(t, err, "blah.info: key not found") @@ -56,7 +56,7 @@ func Test_runRenameCmd(t *testing.T) { cmd.SetArgs([]string{ fakeKeyName1, "nokey", - fmt.Sprintf("--%s=%s", flags.FlagHome, kbHome), + fmt.Sprintf("--%s=%s", flags.FlagKeyringDir, kbHome), fmt.Sprintf("--%s=%s", flags.FlagKeyringBackend, keyring.BackendTest), }) err = cmd.Execute() @@ -70,7 +70,7 @@ func Test_runRenameCmd(t *testing.T) { cmd.SetArgs([]string{ fakeKeyName1, fakeKeyName2, - fmt.Sprintf("--%s=%s", flags.FlagHome, kbHome), + fmt.Sprintf("--%s=%s", flags.FlagKeyringDir, kbHome), fmt.Sprintf("--%s=true", flagYes), fmt.Sprintf("--%s=%s", flags.FlagKeyringBackend, keyring.BackendTest), }) @@ -100,7 +100,7 @@ func Test_runRenameCmd(t *testing.T) { cmd.SetArgs([]string{ fakeKeyName1, fakeKeyName2, - fmt.Sprintf("--%s=%s", flags.FlagHome, kbHome), + fmt.Sprintf("--%s=%s", flags.FlagKeyringDir, kbHome), fmt.Sprintf("--%s=true", flagYes), fmt.Sprintf("--%s=%s", flags.FlagKeyringBackend, keyring.BackendTest), }) diff --git a/client/keys/root.go b/client/keys/root.go index 92fd3ae2e339..9dee7bd48e3a 100644 --- a/client/keys/root.go +++ b/client/keys/root.go @@ -8,7 +8,7 @@ import ( // Commands registers a sub-tree of commands to interact with // local private key storage. -func Commands(defaultNodeHome string) *cobra.Command { +func Commands() *cobra.Command { cmd := &cobra.Command{ Use: "keys", Short: "Manage your application's keys", @@ -41,6 +41,7 @@ The pass backend requires GnuPG: https://gnupg.org/ AddKeyCommand(), ExportKeyCommand(), ImportKeyCommand(), + ImportKeyHexCommand(), ListKeysCmd(), ListKeyTypesCmd(), ShowKeysCmd(), @@ -50,7 +51,6 @@ The pass backend requires GnuPG: https://gnupg.org/ MigrateCommand(), ) - cmd.PersistentFlags().String(flags.FlagHome, defaultNodeHome, "The application home directory") cmd.PersistentFlags().String(flags.FlagOutput, "text", "Output format (text|json)") flags.AddKeyringFlags(cmd.PersistentFlags()) diff --git a/client/keys/root_test.go b/client/keys/root_test.go index 20b3f1a23472..85009c221d06 100644 --- a/client/keys/root_test.go +++ b/client/keys/root_test.go @@ -7,9 +7,9 @@ import ( ) func TestCommands(t *testing.T) { - rootCommands := Commands("home") + rootCommands := Commands() assert.Assert(t, rootCommands != nil) // Commands are registered - assert.Equal(t, 11, len(rootCommands.Commands())) + assert.Equal(t, 12, len(rootCommands.Commands())) } diff --git a/client/keys/show.go b/client/keys/show.go index c65a000409d1..53ffa82ac8fd 100644 --- a/client/keys/show.go +++ b/client/keys/show.go @@ -44,9 +44,9 @@ consisting of all the keys provided by name and multisig threshold.`, } f := cmd.Flags() f.String(FlagBechPrefix, sdk.PrefixAccount, "The Bech32 prefix encoding for a key (acc|val|cons)") - f.BoolP(FlagAddress, "a", false, "Output the address only (overrides --output)") - f.BoolP(FlagPublicKey, "p", false, "Output the public key only (overrides --output)") - f.BoolP(FlagDevice, "d", false, "Output the address in a ledger device") + f.BoolP(FlagAddress, "a", false, "Output the address only (cannot be used with --output)") + f.BoolP(FlagPublicKey, "p", false, "Output the public key only (cannot be used with --output)") + f.BoolP(FlagDevice, "d", false, "Output the address in a ledger device (cannot be used with --pubkey)") f.Int(flagMultiSigThreshold, 1, "K out of N required signatures") return cmd diff --git a/client/keys/show_test.go b/client/keys/show_test.go index 7a180c1a10c5..59d3b2a3247c 100644 --- a/client/keys/show_test.go +++ b/client/keys/show_test.go @@ -49,7 +49,7 @@ func Test_showKeysCmd(t *testing.T) { func Test_runShowCmd(t *testing.T) { cmd := ShowKeysCmd() - cmd.Flags().AddFlagSet(Commands("home").PersistentFlags()) + cmd.Flags().AddFlagSet(Commands().PersistentFlags()) mockIn := testutil.ApplyMockIODiscardOutErr(cmd) kbHome := t.TempDir() @@ -87,7 +87,7 @@ func Test_runShowCmd(t *testing.T) { // Now try single key cmd.SetArgs([]string{ fakeKeyName1, - fmt.Sprintf("--%s=%s", flags.FlagHome, kbHome), + fmt.Sprintf("--%s=%s", flags.FlagKeyringDir, kbHome), fmt.Sprintf("--%s=", FlagBechPrefix), fmt.Sprintf("--%s=%s", flags.FlagKeyringBackend, keyring.BackendTest), }) @@ -95,7 +95,7 @@ func Test_runShowCmd(t *testing.T) { cmd.SetArgs([]string{ fakeKeyName1, - fmt.Sprintf("--%s=%s", flags.FlagHome, kbHome), + fmt.Sprintf("--%s=%s", flags.FlagKeyringDir, kbHome), fmt.Sprintf("--%s=%s", FlagBechPrefix, sdk.PrefixAccount), fmt.Sprintf("--%s=%s", flags.FlagKeyringBackend, keyring.BackendTest), }) @@ -110,7 +110,7 @@ func Test_runShowCmd(t *testing.T) { require.NoError(t, err) cmd.SetArgs([]string{ addr.String(), - fmt.Sprintf("--%s=%s", flags.FlagHome, kbHome), + fmt.Sprintf("--%s=%s", flags.FlagKeyringDir, kbHome), fmt.Sprintf("--%s=%s", FlagBechPrefix, sdk.PrefixAccount), fmt.Sprintf("--%s=%s", flags.FlagKeyringBackend, keyring.BackendTest), }) @@ -120,7 +120,7 @@ func Test_runShowCmd(t *testing.T) { // Now try multisig key - set bech to acc cmd.SetArgs([]string{ fakeKeyName1, fakeKeyName2, - fmt.Sprintf("--%s=%s", flags.FlagHome, kbHome), + fmt.Sprintf("--%s=%s", flags.FlagKeyringDir, kbHome), fmt.Sprintf("--%s=%s", FlagBechPrefix, sdk.PrefixAccount), fmt.Sprintf("--%s=0", flagMultiSigThreshold), fmt.Sprintf("--%s=%s", flags.FlagKeyringBackend, keyring.BackendTest), @@ -129,7 +129,7 @@ func Test_runShowCmd(t *testing.T) { cmd.SetArgs([]string{ fakeKeyName1, fakeKeyName2, - fmt.Sprintf("--%s=%s", flags.FlagHome, kbHome), + fmt.Sprintf("--%s=%s", flags.FlagKeyringDir, kbHome), fmt.Sprintf("--%s=%s", FlagBechPrefix, sdk.PrefixAccount), fmt.Sprintf("--%s=2", flagMultiSigThreshold), fmt.Sprintf("--%s=%s", flags.FlagKeyringBackend, keyring.BackendTest), @@ -139,7 +139,7 @@ func Test_runShowCmd(t *testing.T) { // Now try multisig key - set bech to acc + threshold=2 cmd.SetArgs([]string{ fakeKeyName1, fakeKeyName2, - fmt.Sprintf("--%s=%s", flags.FlagHome, kbHome), + fmt.Sprintf("--%s=%s", flags.FlagKeyringDir, kbHome), fmt.Sprintf("--%s=acc", FlagBechPrefix), fmt.Sprintf("--%s=true", FlagDevice), fmt.Sprintf("--%s=2", flagMultiSigThreshold), @@ -149,7 +149,7 @@ func Test_runShowCmd(t *testing.T) { cmd.SetArgs([]string{ fakeKeyName1, fakeKeyName2, - fmt.Sprintf("--%s=%s", flags.FlagHome, kbHome), + fmt.Sprintf("--%s=%s", flags.FlagKeyringDir, kbHome), fmt.Sprintf("--%s=val", FlagBechPrefix), fmt.Sprintf("--%s=true", FlagDevice), fmt.Sprintf("--%s=2", flagMultiSigThreshold), @@ -159,7 +159,7 @@ func Test_runShowCmd(t *testing.T) { cmd.SetArgs([]string{ fakeKeyName1, fakeKeyName2, - fmt.Sprintf("--%s=%s", flags.FlagHome, kbHome), + fmt.Sprintf("--%s=%s", flags.FlagKeyringDir, kbHome), fmt.Sprintf("--%s=val", FlagBechPrefix), fmt.Sprintf("--%s=true", FlagDevice), fmt.Sprintf("--%s=2", flagMultiSigThreshold), diff --git a/client/prompt_validation_test.go b/client/prompt_validation_test.go index eba30c21c441..488aa03e5414 100644 --- a/client/prompt_validation_test.go +++ b/client/prompt_validation_test.go @@ -3,8 +3,9 @@ package client_test import ( "testing" - "github.com/cosmos/cosmos-sdk/client" "github.com/stretchr/testify/require" + + "github.com/cosmos/cosmos-sdk/client" ) func TestValidatePromptNotEmpty(t *testing.T) { diff --git a/client/pruning/main.go b/client/pruning/main.go index c9442d3df909..51dc5f9c2162 100644 --- a/client/pruning/main.go +++ b/client/pruning/main.go @@ -4,13 +4,13 @@ import ( "fmt" "path/filepath" + dbm "github.com/cosmos/cosmos-db" "github.com/spf13/cobra" "github.com/spf13/viper" "cosmossdk.io/log" pruningtypes "cosmossdk.io/store/pruning/types" "cosmossdk.io/store/rootmulti" - dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/server" @@ -21,41 +21,50 @@ const FlagAppDBBackend = "app-db-backend" // Cmd prunes the sdk root multi store history versions based on the pruning options // specified by command flags. -func Cmd(appCreator servertypes.AppCreator) *cobra.Command { +func Cmd(appCreator servertypes.AppCreator, defaultNodeHome string) *cobra.Command { cmd := &cobra.Command{ - Use: "prune", + Use: "prune [pruning-method]", Short: "Prune app history states by keeping the recent heights and deleting old heights", Long: `Prune app history states by keeping the recent heights and deleting old heights. - The pruning option is provided via the '--pruning' flag or alternatively with '--pruning-keep-recent' - - For '--pruning' the options are as follows: - - default: the last 362880 states are kept - nothing: all historic states will be saved, nothing will be deleted (i.e. archiving node) - everything: 2 latest states will be kept - custom: allow pruning options to be manually specified through 'pruning-keep-recent'. - besides pruning options, database home directory and database backend type should also be specified via flags - '--home' and '--app-db-backend'. - valid app-db-backend type includes 'goleveldb', 'rocksdb', 'pebbledb'. - `, - Example: "prune --home './' --app-db-backend 'goleveldb' --pruning 'custom' --pruning-keep-recent 100", - RunE: func(cmd *cobra.Command, _ []string) error { - vp := viper.New() +The pruning option is provided via the 'pruning' argument or alternatively with '--pruning-keep-recent' - // Bind flags to the Context's Viper so we can get pruning options. +- default: the last 362880 states are kept +- nothing: all historic states will be saved, nothing will be deleted (i.e. archiving node) +- everything: 2 latest states will be kept +- custom: allow pruning options to be manually specified through 'pruning-keep-recent' + +Note: When the --app-db-backend flag is not specified, the default backend type is 'goleveldb'. +Supported app-db-backend types include 'goleveldb', 'rocksdb', 'pebbledb'.`, + Example: "prune custom --pruning-keep-recent 100 --app-db-backend 'goleveldb'", + Args: cobra.RangeArgs(0, 1), + RunE: func(cmd *cobra.Command, args []string) error { + // bind flags to the Context's Viper so we can get pruning options. + vp := viper.New() if err := vp.BindPFlags(cmd.Flags()); err != nil { return err } + + // use the first argument if present to set the pruning method + if len(args) > 0 { + vp.Set(server.FlagPruning, args[0]) + } else { + vp.Set(server.FlagPruning, pruningtypes.PruningOptionDefault) + } pruningOptions, err := server.GetPruningOptionsFromFlags(vp) if err != nil { return err } - fmt.Printf("get pruning options from command flags, strategy: %v, keep-recent: %v\n", + + cmd.Printf("get pruning options from command flags, strategy: %v, keep-recent: %v\n", pruningOptions.Strategy, pruningOptions.KeepRecent, ) home := vp.GetString(flags.FlagHome) + if home == "" { + home = defaultNodeHome + } + db, err := openDB(home, server.GetAppDBBackend(vp)) if err != nil { return err @@ -76,23 +85,20 @@ func Cmd(appCreator servertypes.AppCreator) *cobra.Command { } pruningHeight := latestHeight - int64(pruningOptions.KeepRecent) - fmt.Printf( - "pruning heights up to %v\n", - pruningHeight, - ) + cmd.Printf("pruning heights up to %v\n", pruningHeight) err = rootMultiStore.PruneStores(pruningHeight) if err != nil { return err } - fmt.Printf("successfully pruned the application root multi stores\n") + + cmd.Println("successfully pruned the application root multi stores") return nil }, } - cmd.Flags().String(flags.FlagHome, "", "The database home directory") + cmd.Flags().String(flags.FlagHome, defaultNodeHome, "The application home directory") cmd.Flags().String(FlagAppDBBackend, "", "The type of database for application and snapshots databases") - cmd.Flags().String(server.FlagPruning, pruningtypes.PruningOptionDefault, "Pruning strategy (default|nothing|everything|custom)") cmd.Flags().Uint64(server.FlagPruningKeepRecent, 0, "Number of recent heights to keep on disk (ignored if pruning is not 'custom')") cmd.Flags().Uint64(server.FlagPruningInterval, 10, `Height interval at which pruned heights are removed from disk (ignored if pruning is not 'custom'), diff --git a/client/rpc/block.go b/client/rpc/block.go index 93c710a857c5..d1b99d722942 100644 --- a/client/rpc/block.go +++ b/client/rpc/block.go @@ -6,10 +6,10 @@ import ( "fmt" "time" - "github.com/cosmos/cosmos-sdk/client" - cmt "github.com/cometbft/cometbft/proto/tendermint/types" coretypes "github.com/cometbft/cometbft/rpc/core/types" + + "github.com/cosmos/cosmos-sdk/client" sdk "github.com/cosmos/cosmos-sdk/types" ) diff --git a/client/rpc/rpc_test.go b/client/rpc/rpc_test.go index 3bd9c39ec867..96c2c2c64354 100644 --- a/client/rpc/rpc_test.go +++ b/client/rpc/rpc_test.go @@ -11,8 +11,6 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/metadata" - "github.com/cosmos/cosmos-sdk/client/rpc" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/cosmos/cosmos-sdk/testutil/network" "github.com/cosmos/cosmos-sdk/testutil/testdata" "github.com/cosmos/cosmos-sdk/types/address" @@ -44,17 +42,6 @@ func (s *IntegrationTestSuite) TearDownSuite() { s.network.Cleanup() } -func (s *IntegrationTestSuite) TestStatusCommand() { - val0 := s.network.Validators[0] - cmd := rpc.StatusCommand() - - out, err := clitestutil.ExecTestCLICmd(val0.ClientCtx, cmd, []string{}) - s.Require().NoError(err) - - // Make sure the output has the validator moniker. - s.Require().Contains(out.String(), fmt.Sprintf("\"moniker\":\"%s\"", val0.Moniker)) -} - func (s *IntegrationTestSuite) TestCLIQueryConn() { s.T().Skip("data race in comet is causing this to fail") var header metadata.MD @@ -100,7 +87,10 @@ func (s *IntegrationTestSuite) TestQueryABCIHeight() { for _, tc := range testCases { s.Run(tc.name, func() { - s.network.WaitForHeight(tc.expHeight) + gotHeight, err := s.network.WaitForHeight(tc.expHeight) + if gotHeight != tc.expHeight { + s.Fail(err.Error()) + } val := s.network.Validators[0] diff --git a/client/rpc/status.go b/client/rpc/status.go deleted file mode 100644 index c27d83d68526..000000000000 --- a/client/rpc/status.go +++ /dev/null @@ -1,89 +0,0 @@ -package rpc - -import ( - "context" - - "github.com/spf13/cobra" - - "github.com/cometbft/cometbft/p2p" - coretypes "github.com/cometbft/cometbft/rpc/core/types" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" -) - -// ValidatorInfo is info about the node's validator, same as CometBFT, -// except that we use our own PubKey. -type validatorInfo struct { - Address []byte - PubKey cryptotypes.PubKey - VotingPower int64 -} - -// ResultStatus is node's info, same as CometBFT, except that we use our own -// PubKey. -type resultStatus struct { - NodeInfo p2p.DefaultNodeInfo - SyncInfo coretypes.SyncInfo - ValidatorInfo validatorInfo -} - -// StatusCommand returns the command to return the status of the network. -func StatusCommand() *cobra.Command { - cmd := &cobra.Command{ - Use: "status", - Short: "Query remote node for status", - RunE: func(cmd *cobra.Command, _ []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - status, err := getNodeStatus(clientCtx) - if err != nil { - return err - } - - var pk cryptotypes.PubKey - // `status` has TM pubkeys, we need to convert them to our pubkeys. - if status.ValidatorInfo.PubKey != nil { - pk, err = cryptocodec.FromCmtPubKeyInterface(status.ValidatorInfo.PubKey) - if err != nil { - return err - } - } - statusWithPk := resultStatus{ - NodeInfo: status.NodeInfo, - SyncInfo: status.SyncInfo, - ValidatorInfo: validatorInfo{ - Address: status.ValidatorInfo.Address, - PubKey: pk, - VotingPower: status.ValidatorInfo.VotingPower, - }, - } - - output, err := clientCtx.LegacyAmino.MarshalJSON(statusWithPk) - if err != nil { - return err - } - - cmd.Println(string(output)) - return nil - }, - } - - cmd.Flags().StringP(flags.FlagNode, "n", "tcp://localhost:26657", "Node to connect to") - - return cmd -} - -func getNodeStatus(clientCtx client.Context) (*coretypes.ResultStatus, error) { - node, err := clientCtx.GetNode() - if err != nil { - return &coretypes.ResultStatus{}, err - } - - return node.Status(context.Background()) -} diff --git a/client/rpc/tx.go b/client/rpc/tx.go new file mode 100644 index 000000000000..429dff59caa2 --- /dev/null +++ b/client/rpc/tx.go @@ -0,0 +1,226 @@ +package rpc + +import ( + "context" + "encoding/hex" + "encoding/json" + "fmt" + "io" + "strings" + "time" + + rpchttp "github.com/cometbft/cometbft/rpc/client/http" + coretypes "github.com/cometbft/cometbft/rpc/core/types" + tmtypes "github.com/cometbft/cometbft/types" + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/version" +) + +const TimeoutFlag = "timeout" + +func newTxResponseCheckTx(res *coretypes.ResultBroadcastTxCommit) *sdk.TxResponse { + if res == nil { + return nil + } + + var txHash string + if res.Hash != nil { + txHash = res.Hash.String() + } + + parsedLogs, _ := sdk.ParseABCILogs(res.CheckTx.Log) + + return &sdk.TxResponse{ + Height: res.Height, + TxHash: txHash, + Codespace: res.CheckTx.Codespace, + Code: res.CheckTx.Code, + Data: strings.ToUpper(hex.EncodeToString(res.CheckTx.Data)), + RawLog: res.CheckTx.Log, + Logs: parsedLogs, + Info: res.CheckTx.Info, + GasWanted: res.CheckTx.GasWanted, + GasUsed: res.CheckTx.GasUsed, + Events: res.CheckTx.Events, + } +} + +func newTxResponseDeliverTx(res *coretypes.ResultBroadcastTxCommit) *sdk.TxResponse { + if res == nil { + return nil + } + + var txHash string + if res.Hash != nil { + txHash = res.Hash.String() + } + + parsedLogs, _ := sdk.ParseABCILogs(res.TxResult.Log) + + return &sdk.TxResponse{ + Height: res.Height, + TxHash: txHash, + Codespace: res.TxResult.Codespace, + Code: res.TxResult.Code, + Data: strings.ToUpper(hex.EncodeToString(res.TxResult.Data)), + RawLog: res.TxResult.Log, + Logs: parsedLogs, + Info: res.TxResult.Info, + GasWanted: res.TxResult.GasWanted, + GasUsed: res.TxResult.GasUsed, + Events: res.TxResult.Events, + } +} + +func newResponseFormatBroadcastTxCommit(res *coretypes.ResultBroadcastTxCommit) *sdk.TxResponse { + if res == nil { + return nil + } + + if !res.CheckTx.IsOK() { + return newTxResponseCheckTx(res) + } + + return newTxResponseDeliverTx(res) +} + +// QueryEventForTxCmd is an alias for WaitTxCmd, kept for backwards compatibility. +func QueryEventForTxCmd() *cobra.Command { + return WaitTxCmd() +} + +// WaitTx returns a CLI command that waits for a transaction with the given hash to be included in a block. +func WaitTxCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "wait-tx [hash]", + Aliases: []string{"event-query-tx-for"}, + Short: "Wait for a transaction to be included in a block", + Long: `Subscribes to a CometBFT WebSocket connection and waits for a transaction event with the given hash.`, + Example: fmt.Sprintf(`By providing the transaction hash: +$ %[1]s q wait-tx [hash] + +Or, by piping a "tx" command: +$ %[1]s tx [flags] | %[1]s q wait-tx +`, version.AppName), + Args: cobra.MaximumNArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + timeout, err := cmd.Flags().GetDuration(TimeoutFlag) + if err != nil { + return err + } + + c, err := rpchttp.New(clientCtx.NodeURI, "/websocket") + if err != nil { + return err + } + if err := c.Start(); err != nil { + return err + } + defer c.Stop() //nolint:errcheck // ignore stop error + + ctx, cancel := context.WithTimeout(context.Background(), timeout) + defer cancel() + + var hash []byte + if len(args) == 0 { + // read hash from stdin + in, err := io.ReadAll(cmd.InOrStdin()) + if err != nil { + return err + } + hashByt, err := parseHashFromInput(in) + if err != nil { + return err + } + + hash = hashByt + } else { + // read hash from args + hashByt, err := hex.DecodeString(args[0]) + if err != nil { + return err + } + + hash = hashByt + } + + // subscribe to websocket events + query := fmt.Sprintf("%s='%s' AND %s='%X'", tmtypes.EventTypeKey, tmtypes.EventTx, tmtypes.TxHashKey, hash) + const subscriber = "subscriber" + eventCh, err := c.Subscribe(ctx, subscriber, query) + if err != nil { + return fmt.Errorf("failed to subscribe to tx: %w", err) + } + defer c.UnsubscribeAll(context.Background(), subscriber) //nolint:errcheck // ignore unsubscribe error + + // return immediately if tx is already included in a block + res, err := c.Tx(ctx, hash, false) + if err == nil { + // tx already included in a block + res := &coretypes.ResultBroadcastTxCommit{ + TxResult: res.TxResult, + Hash: res.Hash, + Height: res.Height, + } + return clientCtx.PrintProto(newResponseFormatBroadcastTxCommit(res)) + } + + // tx not yet included in a block, wait for event on websocket + select { + case evt := <-eventCh: + if txe, ok := evt.Data.(tmtypes.EventDataTx); ok { + res := &coretypes.ResultBroadcastTxCommit{ + TxResult: txe.Result, + Hash: tmtypes.Tx(txe.Tx).Hash(), + Height: txe.Height, + } + return clientCtx.PrintProto(newResponseFormatBroadcastTxCommit(res)) + } + case <-ctx.Done(): + return errors.ErrLogic.Wrapf("timed out waiting for transaction %X to be included in a block", hash) + } + return nil + }, + } + + cmd.Flags().Duration(TimeoutFlag, 15*time.Second, "The maximum time to wait for the transaction to be included in a block") + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func parseHashFromInput(in []byte) ([]byte, error) { + // The content of in is expected to be the result of a tx command which should be using GenerateOrBroadcastTxCLI. + // That outputs a sdk.TxResponse as either the json or yaml. As json, we can't unmarshal it back into that struct, + // though, because the height field ends up quoted which confuses json.Unmarshal (because it's for an int64 field). + + // Try to find the txhash from json ouptut. + resultTx := make(map[string]json.RawMessage) + if err := json.Unmarshal(in, &resultTx); err == nil && len(resultTx["txhash"]) > 0 { + // input was JSON, return the hash + hash := strings.Trim(strings.TrimSpace(string(resultTx["txhash"])), `"`) + if len(hash) > 0 { + return hex.DecodeString(hash) + } + } + + // Try to find the txhash from yaml output. + lines := strings.Split(string(in), "\n") + for _, line := range lines { + if strings.HasPrefix(line, "txhash:") { + hash := strings.TrimSpace(line[len("txhash:"):]) + return hex.DecodeString(hash) + } + } + return nil, fmt.Errorf("txhash not found") +} diff --git a/client/rpc/validators.go b/client/rpc/validators.go index 55c2262a8881..7facee4259d4 100644 --- a/client/rpc/validators.go +++ b/client/rpc/validators.go @@ -1,24 +1,16 @@ package rpc import ( - "context" - "fmt" "strconv" - "strings" - cmttypes "github.com/cometbft/cometbft/types" "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - 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/client/grpc/cmtservice" "github.com/cosmos/cosmos-sdk/types/query" ) -// TODO these next two functions feel kinda hacky based on their placement - // ValidatorCommand returns the validator set for a given height func ValidatorCommand() *cobra.Command { cmd := &cobra.Command{ @@ -49,12 +41,12 @@ func ValidatorCommand() *cobra.Command { page, _ := cmd.Flags().GetInt(flags.FlagPage) limit, _ := cmd.Flags().GetInt(flags.FlagLimit) - result, err := GetValidators(cmd.Context(), clientCtx, height, &page, &limit) + response, err := cmtservice.ValidatorsOutput(cmd.Context(), clientCtx, height, page, limit) if err != nil { return err } - return clientCtx.PrintObjectLegacy(result) + return clientCtx.PrintProto(response) }, } @@ -65,84 +57,3 @@ func ValidatorCommand() *cobra.Command { return cmd } - -// Validator output -type ValidatorOutput struct { - Address sdk.ConsAddress `json:"address"` - PubKey cryptotypes.PubKey `json:"pub_key"` - ProposerPriority int64 `json:"proposer_priority"` - VotingPower int64 `json:"voting_power"` -} - -// Validators at a certain height output in bech32 format -type ResultValidatorsOutput struct { - BlockHeight int64 `json:"block_height"` - Validators []ValidatorOutput `json:"validators"` - Total uint64 `json:"total"` -} - -func (rvo ResultValidatorsOutput) String() string { - var b strings.Builder - - fmt.Fprintf(&b, "block height: %d\n", rvo.BlockHeight) - fmt.Fprintf(&b, "total count: %d\n", rvo.Total) - - for _, val := range rvo.Validators { - fmt.Fprintf(&b, ` - Address: %s - Pubkey: %s - ProposerPriority: %d - VotingPower: %d - `, - val.Address, val.PubKey, val.ProposerPriority, val.VotingPower, - ) - } - - return b.String() -} - -func validatorOutput(validator *cmttypes.Validator) (ValidatorOutput, error) { - pk, err := cryptocodec.FromCmtPubKeyInterface(validator.PubKey) - if err != nil { - return ValidatorOutput{}, err - } - - return ValidatorOutput{ - Address: sdk.ConsAddress(validator.Address), - PubKey: pk, - ProposerPriority: validator.ProposerPriority, - VotingPower: validator.VotingPower, - }, nil -} - -// GetValidators from client -func GetValidators(ctx context.Context, clientCtx client.Context, height *int64, page, limit *int) (ResultValidatorsOutput, error) { - // get the node - node, err := clientCtx.GetNode() - if err != nil { - return ResultValidatorsOutput{}, err - } - - validatorsRes, err := node.Validators(ctx, height, page, limit) - if err != nil { - return ResultValidatorsOutput{}, err - } - - total := validatorsRes.Total - if validatorsRes.Total < 0 { - total = 0 - } - out := ResultValidatorsOutput{ - BlockHeight: validatorsRes.BlockHeight, - Validators: make([]ValidatorOutput, len(validatorsRes.Validators)), - Total: uint64(total), - } - for i := 0; i < len(validatorsRes.Validators); i++ { - out.Validators[i], err = validatorOutput(validatorsRes.Validators[i]) - if err != nil { - return out, err - } - } - - return out, nil -} diff --git a/client/snapshot/cmd.go b/client/snapshot/cmd.go index 14388bc8d05e..af7853eb2354 100644 --- a/client/snapshot/cmd.go +++ b/client/snapshot/cmd.go @@ -1,8 +1,9 @@ package snapshot import ( - servertypes "github.com/cosmos/cosmos-sdk/server/types" "github.com/spf13/cobra" + + servertypes "github.com/cosmos/cosmos-sdk/server/types" ) // Cmd returns the snapshots group command diff --git a/client/snapshot/delete.go b/client/snapshot/delete.go index 0259032e1134..3bf322982925 100644 --- a/client/snapshot/delete.go +++ b/client/snapshot/delete.go @@ -3,8 +3,9 @@ package snapshot import ( "strconv" - "github.com/cosmos/cosmos-sdk/server" "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/server" ) func DeleteSnapshotCmd() *cobra.Command { diff --git a/client/snapshot/dump.go b/client/snapshot/dump.go index 72dadbc57254..99cfe3d2d7c3 100644 --- a/client/snapshot/dump.go +++ b/client/snapshot/dump.go @@ -9,8 +9,9 @@ import ( "os" "strconv" - "github.com/cosmos/cosmos-sdk/server" "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/server" ) // DumpArchiveCmd returns a command to dump the snapshot as portable archive format diff --git a/client/snapshot/export.go b/client/snapshot/export.go index b6b083dff7e5..87c5f02e91c9 100644 --- a/client/snapshot/export.go +++ b/client/snapshot/export.go @@ -1,10 +1,12 @@ package snapshot import ( + "github.com/spf13/cobra" + "cosmossdk.io/log" + "github.com/cosmos/cosmos-sdk/server" servertypes "github.com/cosmos/cosmos-sdk/server/types" - "github.com/spf13/cobra" ) // ExportSnapshotCmd returns a command to take a snapshot of the application state diff --git a/client/snapshot/list.go b/client/snapshot/list.go index 78612bf916ee..501bfd7c5291 100644 --- a/client/snapshot/list.go +++ b/client/snapshot/list.go @@ -3,8 +3,9 @@ package snapshot import ( "fmt" - "github.com/cosmos/cosmos-sdk/server" "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/server" ) // ListSnapshotsCmd returns the command to list local snapshots diff --git a/client/snapshot/load.go b/client/snapshot/load.go index 0e6d012aa772..a1bf4e638294 100644 --- a/client/snapshot/load.go +++ b/client/snapshot/load.go @@ -10,10 +10,11 @@ import ( "reflect" "strconv" - "github.com/cosmos/cosmos-sdk/server" "github.com/spf13/cobra" snapshottypes "cosmossdk.io/store/snapshots/types" + + "github.com/cosmos/cosmos-sdk/server" ) const SnapshotFileName = "_snapshot" @@ -43,9 +44,6 @@ func LoadArchiveCmd() *cobra.Command { var snapshot snapshottypes.Snapshot tr := tar.NewReader(reader) - if err != nil { - return fmt.Errorf("failed to create tar reader: %w", err) - } hdr, err := tr.Next() if err != nil { diff --git a/client/snapshot/restore.go b/client/snapshot/restore.go index 5d3f45099297..e1833da6b7af 100644 --- a/client/snapshot/restore.go +++ b/client/snapshot/restore.go @@ -4,10 +4,11 @@ import ( "path/filepath" "strconv" - "cosmossdk.io/log" + dbm "github.com/cosmos/cosmos-db" "github.com/spf13/cobra" - dbm "github.com/cosmos/cosmos-db" + "cosmossdk.io/log" + "github.com/cosmos/cosmos-sdk/server" servertypes "github.com/cosmos/cosmos-sdk/server/types" ) diff --git a/client/tx/aux_builder.go b/client/tx/aux_builder.go index 813d90f872af..f948b510fbda 100644 --- a/client/tx/aux_builder.go +++ b/client/tx/aux_builder.go @@ -2,14 +2,16 @@ package tx import ( "context" + "time" "github.com/cosmos/gogoproto/proto" "google.golang.org/protobuf/types/known/anypb" + "google.golang.org/protobuf/types/known/timestamppb" - basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" txsigning "cosmossdk.io/x/tx/signing" "cosmossdk.io/x/tx/signing/aminojson" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -58,6 +60,18 @@ func (b *AuxTxBuilder) SetTimeoutHeight(height uint64) { b.auxSignerData.SignDoc.BodyBytes = nil } +// SetTimeoutTimestamp sets a timeout timestamp in the tx. +func (b *AuxTxBuilder) SetTimeoutTimestamp(timestamp time.Time) { + // Only set TimeoutTimestamp if we have a non-zero time.Time. + // Setting timestamppb.New() with a zero/default value time.Time results in a non-zero timestamppb.Timestamp, + // which causes the value to show up in the signature - breaking 0 { + b.checkEmptyFields() + b.body.TimeoutTimestamp = timestamppb.New(timestamp) + b.auxSignerData.SignDoc.BodyBytes = nil + } +} + // SetMsgs sets an array of Msgs in the tx. func (b *AuxTxBuilder) SetMsgs(msgs ...sdk.Msg) error { anys := make([]*anypb.Any, len(msgs)) @@ -129,12 +143,6 @@ func (b *AuxTxBuilder) SetSignMode(mode signing.SignMode) error { return nil } -// SetTip sets an optional tip in the AuxSignerData. -func (b *AuxTxBuilder) SetTip(tip *tx.Tip) { - b.checkEmptyFields() - b.auxSignerData.SignDoc.Tip = tip -} - // SetSignature sets the aux signer's signature in the AuxSignerData. func (b *AuxTxBuilder) SetSignature(sig []byte) { b.checkEmptyFields() @@ -213,15 +221,13 @@ func (b *AuxTxBuilder) GetSignBytes() ([]byte, error) { handler := aminojson.NewSignModeHandler(aminojson.SignModeHandlerOptions{ FileResolver: proto.HybridResolver, }) - legacyTip := b.auxSignerData.SignDoc.Tip - tip := &txv1beta1.Tip{ - Amount: make([]*basev1beta1.Coin, len(legacyTip.Amount)), - Tipper: legacyTip.Tipper, - } + auxBody := &txv1beta1.TxBody{ - Messages: body.Messages, - Memo: body.Memo, - TimeoutHeight: body.TimeoutHeight, + Messages: body.Messages, + Memo: body.Memo, + TimeoutHeight: body.TimeoutHeight, + TimeoutTimestamp: body.TimeoutTimestamp, + Unordered: body.Unordered, // AuxTxBuilder has no concern with extension options, so we set them to nil. // This preserves pre-PR#16025 behavior where extension options were ignored, this code path: // https://github.com/cosmos/cosmos-sdk/blob/ac3c209326a26b46f65a6cc6f5b5ebf6beb79b38/client/tx/aux_builder.go#L193 @@ -229,12 +235,7 @@ func (b *AuxTxBuilder) GetSignBytes() ([]byte, error) { ExtensionOptions: nil, NonCriticalExtensionOptions: nil, } - for i, coin := range legacyTip.Amount { - tip.Amount[i] = &basev1beta1.Coin{ - Denom: coin.Denom, - Amount: coin.Amount.String(), - } - } + signBz, err = handler.GetSignBytes( context.Background(), txsigning.SignerData{ @@ -253,7 +254,6 @@ func (b *AuxTxBuilder) GetSignBytes() ([]byte, error) { // over empty fees. // ref: https://github.com/cosmos/cosmos-sdk/pull/10348 Fee: &txv1beta1.Fee{}, - Tip: tip, }, }, ) diff --git a/client/tx/aux_builder_test.go b/client/tx/aux_builder_test.go index 9a967192e50b..f34902b9a998 100644 --- a/client/tx/aux_builder_test.go +++ b/client/tx/aux_builder_test.go @@ -15,6 +15,21 @@ import ( typestx "github.com/cosmos/cosmos-sdk/types/tx" "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/x/bank" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" +) + +const ( + memo = "waboom" + timeoutHeight = uint64(5) +) + +var ( + _, pub1, addr1 = testdata.KeyTestPubAddr() + _, _, addr2 = testdata.KeyTestPubAddr() + rawSig = []byte("dummy") + msg1 = banktypes.NewMsgSend(addr1, addr2, sdk.NewCoins(sdk.NewInt64Coin("wack", 2))) + + chainID = "test-chain" ) func TestAuxTxBuilder(t *testing.T) { @@ -84,25 +99,11 @@ func TestAuxTxBuilder(t *testing.T) { }, true, "got unknown sign mode SIGN_MODE_UNSPECIFIED", }, - { - "GetSignBytes tipper should not be nil (if tip is set)", - func() error { - require.NoError(t, b.SetMsgs(msg1)) - require.NoError(t, b.SetPubKey(pub1)) - b.SetTip(&typestx.Tip{}) - require.NoError(t, b.SetSignMode(signing.SignMode_SIGN_MODE_DIRECT_AUX)) - - _, err := b.GetSignBytes() - return err - }, - true, "tipper cannot be empty", - }, { "GetSignBytes works for DIRECT_AUX", func() error { require.NoError(t, b.SetMsgs(msg1)) require.NoError(t, b.SetPubKey(pub1)) - b.SetTip(tip) require.NoError(t, b.SetSignMode(signing.SignMode_SIGN_MODE_DIRECT_AUX)) _, err := b.GetSignBytes() @@ -115,7 +116,6 @@ func TestAuxTxBuilder(t *testing.T) { func() error { require.NoError(t, b.SetMsgs(msg1)) require.NoError(t, b.SetPubKey(pub1)) - b.SetTip(tip) require.NoError(t, b.SetSignMode(signing.SignMode_SIGN_MODE_DIRECT_AUX)) _, err := b.GetSignBytes() @@ -131,7 +131,6 @@ func TestAuxTxBuilder(t *testing.T) { func() error { require.NoError(t, b.SetMsgs(msg1)) require.NoError(t, b.SetPubKey(pub1)) - b.SetTip(tip) b.SetAddress(addr1.String()) require.NoError(t, b.SetSignMode(signing.SignMode_SIGN_MODE_DIRECT_AUX)) @@ -153,7 +152,6 @@ func TestAuxTxBuilder(t *testing.T) { b.SetChainID(chainID) require.NoError(t, b.SetMsgs(msg1)) require.NoError(t, b.SetPubKey(pub1)) - b.SetTip(tip) b.SetAddress(addr1.String()) err := b.SetSignMode(signing.SignMode_SIGN_MODE_DIRECT_AUX) require.NoError(t, err) @@ -176,7 +174,6 @@ func TestAuxTxBuilder(t *testing.T) { func() error { require.NoError(t, b.SetMsgs(msg1)) require.NoError(t, b.SetPubKey(pub1)) - b.SetTip(tip) b.SetAddress(addr1.String()) err := b.SetSignMode(signing.SignMode_SIGN_MODE_LEGACY_AMINO_JSON) require.NoError(t, err) @@ -196,7 +193,6 @@ func TestAuxTxBuilder(t *testing.T) { b.SetChainID(chainID) require.NoError(t, b.SetMsgs(msg1)) require.NoError(t, b.SetPubKey(pub1)) - b.SetTip(tip) b.SetAddress(addr1.String()) err := b.SetSignMode(signing.SignMode_SIGN_MODE_LEGACY_AMINO_JSON) require.NoError(t, err) @@ -250,7 +246,6 @@ func checkCorrectData(t *testing.T, cdc codec.Codec, auxSignerData typestx.AuxSi require.Equal(t, chainID, auxSignerData.SignDoc.ChainId) require.Equal(t, msgAny, body.GetMessages()[0]) require.Equal(t, pkAny, auxSignerData.SignDoc.PublicKey) - require.Equal(t, tip, auxSignerData.SignDoc.Tip) require.Equal(t, signMode, auxSignerData.Mode) require.Equal(t, rawSig, auxSignerData.Sig) } diff --git a/client/tx/factory.go b/client/tx/factory.go index 082921fe4b40..7a0006b32b4a 100644 --- a/client/tx/factory.go +++ b/client/tx/factory.go @@ -3,22 +3,24 @@ package tx import ( "errors" "fmt" + "math/big" "os" "strings" + "time" - "cosmossdk.io/math" + "github.com/cosmos/go-bip39" "github.com/spf13/pflag" - "github.com/cosmos/go-bip39" + "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/crypto/keyring" + "github.com/cosmos/cosmos-sdk/crypto/keys/multisig" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/tx" "github.com/cosmos/cosmos-sdk/types/tx/signing" ) @@ -32,13 +34,15 @@ type Factory struct { sequence uint64 gas uint64 timeoutHeight uint64 + timeoutTimestamp time.Time gasAdjustment float64 chainID string + fromName string + unordered bool offline bool generateOnly bool memo string fees sdk.Coins - tip *tx.Tip feeGranter sdk.AccAddress feePayer sdk.AccAddress gasPrices sdk.DecCoins @@ -50,10 +54,16 @@ type Factory struct { // NewFactoryCLI creates a new Factory. func NewFactoryCLI(clientCtx client.Context, flagSet *pflag.FlagSet) (Factory, error) { - signModeStr := clientCtx.SignModeStr + if clientCtx.Viper == nil { + clientCtx = clientCtx.WithViper("") + } + + if err := clientCtx.Viper.BindPFlags(flagSet); err != nil { + return Factory{}, fmt.Errorf("failed to bind flags to viper: %w", err) + } signMode := signing.SignMode_SIGN_MODE_UNSPECIFIED - switch signModeStr { + switch clientCtx.SignModeStr { case flags.SignModeDirect: signMode = signing.SignMode_SIGN_MODE_DIRECT case flags.SignModeLegacyAminoJSON: @@ -69,18 +79,21 @@ func NewFactoryCLI(clientCtx client.Context, flagSet *pflag.FlagSet) (Factory, e var accNum, accSeq uint64 if clientCtx.Offline { if flagSet.Changed(flags.FlagAccountNumber) && flagSet.Changed(flags.FlagSequence) { - accNum, _ = flagSet.GetUint64(flags.FlagAccountNumber) - accSeq, _ = flagSet.GetUint64(flags.FlagSequence) + accNum = clientCtx.Viper.GetUint64(flags.FlagAccountNumber) + accSeq = clientCtx.Viper.GetUint64(flags.FlagSequence) } else { return Factory{}, errors.New("account-number and sequence must be set in offline mode") } } - gasAdj, _ := flagSet.GetFloat64(flags.FlagGasAdjustment) - memo, _ := flagSet.GetString(flags.FlagNote) - timeoutHeight, _ := flagSet.GetUint64(flags.FlagTimeoutHeight) + gasAdj := clientCtx.Viper.GetFloat64(flags.FlagGasAdjustment) + memo := clientCtx.Viper.GetString(flags.FlagNote) + timestampUnix := clientCtx.Viper.GetInt64(flags.FlagTimeoutTimestamp) + timeoutTimestamp := time.Unix(timestampUnix, 0) + timeoutHeight := clientCtx.Viper.GetUint64(flags.FlagTimeoutHeight) + unordered := clientCtx.Viper.GetBool(flags.FlagUnordered) - gasStr, _ := flagSet.GetString(flags.FlagGas) + gasStr := clientCtx.Viper.GetString(flags.FlagGas) gasSetting, _ := flags.ParseGasSetting(gasStr) f := Factory{ @@ -88,6 +101,7 @@ func NewFactoryCLI(clientCtx client.Context, flagSet *pflag.FlagSet) (Factory, e accountRetriever: clientCtx.AccountRetriever, keybase: clientCtx.Keyring, chainID: clientCtx.ChainID, + fromName: clientCtx.FromName, offline: clientCtx.Offline, generateOnly: clientCtx.GenerateOnly, gas: gasSetting.Gas, @@ -95,6 +109,8 @@ func NewFactoryCLI(clientCtx client.Context, flagSet *pflag.FlagSet) (Factory, e accountNumber: accNum, sequence: accSeq, timeoutHeight: timeoutHeight, + timeoutTimestamp: timeoutTimestamp, + unordered: unordered, gasAdjustment: gasAdj, memo: memo, signMode: signMode, @@ -102,15 +118,10 @@ func NewFactoryCLI(clientCtx client.Context, flagSet *pflag.FlagSet) (Factory, e feePayer: clientCtx.FeePayer, } - feesStr, _ := flagSet.GetString(flags.FlagFees) + feesStr := clientCtx.Viper.GetString(flags.FlagFees) f = f.WithFees(feesStr) - tipsStr, _ := flagSet.GetString(flags.FlagTip) - // Add tips to factory. The tipper is necessarily the Msg signer, i.e. - // the from address. - f = f.WithTips(tipsStr, clientCtx.FromAddress.String()) - - gasPricesStr, _ := flagSet.GetString(flags.FlagGasPrices) + gasPricesStr := clientCtx.Viper.GetString(flags.FlagGasPrices) f = f.WithGasPrices(gasPricesStr) f = f.WithPreprocessTxHook(clientCtx.PreprocessTxHook) @@ -129,6 +140,9 @@ func (f Factory) Fees() sdk.Coins { return f.fees } func (f Factory) GasPrices() sdk.DecCoins { return f.gasPrices } func (f Factory) AccountRetriever() client.AccountRetriever { return f.accountRetriever } func (f Factory) TimeoutHeight() uint64 { return f.timeoutHeight } +func (f Factory) TimeoutTimestamp() time.Time { return f.timeoutTimestamp } +func (f Factory) Unordered() bool { return f.unordered } +func (f Factory) FromName() string { return f.fromName } // SimulateAndExecute returns the option to simulate and then execute the transaction // using the gas from the simulation results @@ -169,20 +183,6 @@ func (f Factory) WithFees(fees string) Factory { return f } -// WithTips returns a copy of the Factory with an updated tip. -func (f Factory) WithTips(tip, tipper string) Factory { - parsedTips, err := sdk.ParseCoinsNormalized(tip) - if err != nil { - panic(err) - } - - f.tip = &tx.Tip{ - Tipper: tipper, - Amount: parsedTips, - } - return f -} - // WithGasPrices returns a copy of the Factory with updated gas prices. func (f Factory) WithGasPrices(gasPrices string) Factory { parsedGasPrices, err := sdk.ParseDecCoins(gasPrices) @@ -200,6 +200,13 @@ func (f Factory) WithKeybase(keybase keyring.Keyring) Factory { return f } +// WithFromName returns a copy of the Factory with updated fromName +// fromName will be use for building a simulation tx. +func (f Factory) WithFromName(fromName string) Factory { + f.fromName = fromName + return f +} + // WithSequence returns a copy of the Factory with an updated sequence number. func (f Factory) WithSequence(sequence uint64) Factory { f.sequence = sequence @@ -248,6 +255,18 @@ func (f Factory) WithTimeoutHeight(height uint64) Factory { return f } +// WithTimeoutTimestamp returns a copy of the Factory with an updated timeout timestamp. +func (f Factory) WithTimeoutTimestamp(timestamp time.Time) Factory { + f.timeoutTimestamp = timestamp + return f +} + +// WithUnordered returns a copy of the Factory with an updated unordered field. +func (f Factory) WithUnordered(v bool) Factory { + f.unordered = v + return f +} + // WithFeeGranter returns a copy of the Factory with an updated fee granter. func (f Factory) WithFeeGranter(fg sdk.AccAddress) Factory { f.feeGranter = fg @@ -287,7 +306,7 @@ func (f Factory) PreprocessTx(keyname string, builder client.TxBuilder) error { // Example to add dynamic fee extension options: // // extOpt := ethermint.ExtensionOptionDynamicFeeTx{ -// MaxPriorityPrice: sdk.NewInt(1000000), +// MaxPriorityPrice: math.NewInt(1000000), // } // // extBytes, _ := extOpt.Marshal() @@ -310,10 +329,10 @@ func (f Factory) WithExtensionOptions(extOpts ...*codectypes.Any) Factory { func (f Factory) BuildUnsignedTx(msgs ...sdk.Msg) (client.TxBuilder, error) { if f.offline && f.generateOnly { if f.chainID != "" { - return nil, fmt.Errorf("chain ID cannot be used when offline and generate-only flags are set") + return nil, errors.New("chain ID cannot be used when offline and generate-only flags are set") } } else if f.chainID == "" { - return nil, fmt.Errorf("chain ID required but not specified") + return nil, errors.New("chain ID required but not specified") } fees := f.fees @@ -323,14 +342,16 @@ func (f Factory) BuildUnsignedTx(msgs ...sdk.Msg) (client.TxBuilder, error) { return nil, errors.New("cannot provide both fees and gas prices") } - glDec := math.LegacyNewDec(int64(f.gas)) + // f.gas is a uint64 and we should convert to LegacyDec + // without the risk of under/overflow via uint64->int64. + gasLimitDec := math.LegacyNewDecFromBigInt(new(big.Int).SetUint64(f.gas)) // Derive the fees based on the provided gas prices, where // fee = ceil(gasPrice * gasLimit). fees = make(sdk.Coins, len(f.gasPrices)) for i, gp := range f.gasPrices { - fee := gp.Amount.Mul(glDec) + fee := gp.Amount.Mul(gasLimitDec) fees[i] = sdk.NewCoin(gp.Denom, fee.Ceil().RoundInt()) } } @@ -352,6 +373,8 @@ func (f Factory) BuildUnsignedTx(msgs ...sdk.Msg) (client.TxBuilder, error) { tx.SetFeeGranter(f.feeGranter) tx.SetFeePayer(f.feePayer) tx.SetTimeoutHeight(f.TimeoutHeight()) + tx.SetTimeoutTimestamp(f.TimeoutTimestamp()) + tx.SetUnordered(f.Unordered()) if etx, ok := tx.(client.ExtendedTxBuilder); ok { etx.SetExtensionOptions(f.extOptions...) @@ -391,7 +414,12 @@ func (f Factory) PrintUnsignedTx(clientCtx client.Context, msgs ...sdk.Msg) erro return err } - json, err := clientCtx.TxConfig.TxJSONEncoder()(unsignedTx.GetTx()) + encoder := f.txConfig.TxJSONEncoder() + if encoder == nil { + return errors.New("cannot print unsigned tx: tx json encoder is nil") + } + + json, err := encoder(unsignedTx.GetTx()) if err != nil { return err } @@ -416,17 +444,20 @@ func (f Factory) BuildSimTx(msgs ...sdk.Msg) ([]byte, error) { // Create an empty signature literal as the ante handler will populate with a // sentinel pubkey. sig := signing.SignatureV2{ - PubKey: pk, - Data: &signing.SingleSignatureData{ - SignMode: f.signMode, - }, + PubKey: pk, + Data: f.getSimSignatureData(pk), Sequence: f.Sequence(), } if err := txb.SetSignatures(sig); err != nil { return nil, err } - return f.txConfig.TxEncoder()(txb.GetTx()) + encoder := f.txConfig.TxEncoder() + if encoder == nil { + return nil, fmt.Errorf("cannot simulate tx: tx encoder is nil") + } + + return encoder(txb.GetTx()) } // getSimPK gets the public key to use for building a simulation tx. @@ -440,16 +471,13 @@ func (f Factory) getSimPK() (cryptotypes.PubKey, error) { pk cryptotypes.PubKey = &secp256k1.PubKey{} // use default public key type ) - // Use the first element from the list of keys in order to generate a valid - // pubkey that supports multiple algorithms. if f.simulateAndExecute && f.keybase != nil { - records, _ := f.keybase.List() - if len(records) == 0 { - return nil, errors.New("cannot build signature for simulation, key records slice is empty") + record, err := f.keybase.Key(f.fromName) + if err != nil { + return nil, err } - // take the first record just for simulation purposes - pk, ok = records[0].PubKey.GetCachedValue().(cryptotypes.PubKey) + pk, ok = record.PubKey.GetCachedValue().(cryptotypes.PubKey) if !ok { return nil, errors.New("cannot build signature for simulation, failed to convert proto Any to public key") } @@ -458,6 +486,26 @@ func (f Factory) getSimPK() (cryptotypes.PubKey, error) { return pk, nil } +// getSimSignatureData based on the pubKey type gets the correct SignatureData type +// to use for building a simulation tx. +func (f Factory) getSimSignatureData(pk cryptotypes.PubKey) signing.SignatureData { + multisigPubKey, ok := pk.(*multisig.LegacyAminoPubKey) + if !ok { + return &signing.SingleSignatureData{SignMode: f.signMode} + } + + multiSignatureData := make([]signing.SignatureData, 0, multisigPubKey.Threshold) + for i := uint32(0); i < multisigPubKey.Threshold; i++ { + multiSignatureData = append(multiSignatureData, &signing.SingleSignatureData{ + SignMode: f.SignMode(), + }) + } + + return &signing.MultiSignatureData{ + Signatures: multiSignatureData, + } +} + // Prepare ensures the account defined by ctx.GetFromAddress() exists and // if the account number and/or the account sequence number are zero (not set), // they will be queried for and set on the provided Factory. @@ -469,7 +517,7 @@ func (f Factory) Prepare(clientCtx client.Context) (Factory, error) { } fc := f - from := clientCtx.GetFromAddress() + from := clientCtx.FromAddress if err := fc.accountRetriever.EnsureExists(clientCtx, from); err != nil { return fc, err diff --git a/client/tx/factory_test.go b/client/tx/factory_test.go index 7a8c4cc2dd46..402d178a98dc 100644 --- a/client/tx/factory_test.go +++ b/client/tx/factory_test.go @@ -1,34 +1,119 @@ -package tx_test +package tx import ( "testing" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/tx" "github.com/stretchr/testify/require" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + "github.com/cosmos/cosmos-sdk/crypto/hd" + "github.com/cosmos/cosmos-sdk/crypto/keyring" + "github.com/cosmos/cosmos-sdk/crypto/keys/multisig" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" + "github.com/cosmos/cosmos-sdk/crypto/types" + "github.com/cosmos/cosmos-sdk/testutil/testdata" + "github.com/cosmos/cosmos-sdk/types/tx/signing" ) -func TestFactoryPrepate(t *testing.T) { +func TestFactoryPrepare(t *testing.T) { t.Parallel() - factory := tx.Factory{} + factory := Factory{} clientCtx := client.Context{} output, err := factory.Prepare(clientCtx.WithOffline(true)) require.NoError(t, err) require.Equal(t, output, factory) - factory = tx.Factory{}.WithAccountRetriever(client.MockAccountRetriever{ReturnAccNum: 10, ReturnAccSeq: 1}).WithAccountNumber(5) + factory = Factory{}.WithAccountRetriever(client.MockAccountRetriever{ReturnAccNum: 10, ReturnAccSeq: 1}).WithAccountNumber(5) output, err = factory.Prepare(clientCtx.WithFrom("foo")) require.NoError(t, err) require.NotEqual(t, output, factory) require.Equal(t, output.AccountNumber(), uint64(5)) require.Equal(t, output.Sequence(), uint64(1)) - factory = tx.Factory{}.WithAccountRetriever(client.MockAccountRetriever{ReturnAccNum: 10, ReturnAccSeq: 1}) + factory = Factory{}.WithAccountRetriever(client.MockAccountRetriever{ReturnAccNum: 10, ReturnAccSeq: 1}) output, err = factory.Prepare(clientCtx.WithFrom("foo")) require.NoError(t, err) require.NotEqual(t, output, factory) require.Equal(t, output.AccountNumber(), uint64(10)) require.Equal(t, output.Sequence(), uint64(1)) } + +func TestFactory_getSimPKType(t *testing.T) { + // setup keyring + registry := codectypes.NewInterfaceRegistry() + cryptocodec.RegisterInterfaces(registry) + k := keyring.NewInMemory(codec.NewProtoCodec(registry)) + + tests := []struct { + name string + fromName string + genKey func(fromName string, k keyring.Keyring) error + wantType types.PubKey + }{ + { + name: "simple key", + fromName: "testKey", + genKey: func(fromName string, k keyring.Keyring) error { + _, err := k.NewAccount(fromName, testdata.TestMnemonic, "", "", hd.Secp256k1) + return err + }, + wantType: (*secp256k1.PubKey)(nil), + }, + { + name: "multisig key", + fromName: "multiKey", + genKey: func(fromName string, k keyring.Keyring) error { + pk := multisig.NewLegacyAminoPubKey(1, []types.PubKey{&multisig.LegacyAminoPubKey{}}) + _, err := k.SaveMultisig(fromName, pk) + return err + }, + wantType: (*multisig.LegacyAminoPubKey)(nil), + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.genKey(tt.fromName, k) + require.NoError(t, err) + f := Factory{ + keybase: k, + fromName: tt.fromName, + simulateAndExecute: true, + } + got, err := f.getSimPK() + require.NoError(t, err) + require.IsType(t, tt.wantType, got) + }) + } +} + +func TestFactory_getSimSignatureData(t *testing.T) { + tests := []struct { + name string + pk types.PubKey + wantType any + }{ + { + name: "simple pubkey", + pk: &secp256k1.PubKey{}, + wantType: (*signing.SingleSignatureData)(nil), + }, + { + name: "multisig pubkey", + pk: &multisig.LegacyAminoPubKey{}, + wantType: (*signing.MultiSignatureData)(nil), + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got := Factory{}.getSimSignatureData(tt.pk) + require.IsType(t, tt.wantType, got) + }) + } +} diff --git a/client/tx/legacy_test.go b/client/tx/legacy_test.go deleted file mode 100644 index 2e337088cf2f..000000000000 --- a/client/tx/legacy_test.go +++ /dev/null @@ -1,23 +0,0 @@ -package tx_test - -import ( - "github.com/cosmos/cosmos-sdk/testutil/testdata" - "github.com/cosmos/cosmos-sdk/types" - typestx "github.com/cosmos/cosmos-sdk/types/tx" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" -) - -const ( - memo = "waboom" - timeoutHeight = uint64(5) -) - -var ( - _, pub1, addr1 = testdata.KeyTestPubAddr() - _, _, addr2 = testdata.KeyTestPubAddr() - rawSig = []byte("dummy") - msg1 = banktypes.NewMsgSend(addr1, addr2, types.NewCoins(types.NewInt64Coin("wack", 2))) - - chainID = "test-chain" - tip = &typestx.Tip{Tipper: addr1.String(), Amount: testdata.NewTestFeeAmount()} -) diff --git a/client/tx/tx.go b/client/tx/tx.go index d9446906c42a..f71111829627 100644 --- a/client/tx/tx.go +++ b/client/tx/tx.go @@ -100,9 +100,14 @@ func BroadcastTx(clientCtx client.Context, txf Factory, msgs ...sdk.Msg) error { } if !clientCtx.SkipConfirm { - txBytes, err := clientCtx.TxConfig.TxJSONEncoder()(tx.GetTx()) + encoder := txf.txConfig.TxJSONEncoder() + if encoder == nil { + return errors.New("failed to encode transaction: tx json encoder is nil") + } + + txBytes, err := encoder(tx.GetTx()) if err != nil { - return err + return fmt.Errorf("failed to encode transaction: %w", err) } if err := clientCtx.PrintRaw(json.RawMessage(txBytes)); err != nil { @@ -121,8 +126,7 @@ func BroadcastTx(clientCtx client.Context, txf Factory, msgs ...sdk.Msg) error { } } - err = Sign(clientCtx.CmdContext, txf, clientCtx.GetFromName(), tx, true) - if err != nil { + if err = Sign(clientCtx.CmdContext, txf, clientCtx.FromName, tx, true); err != nil { return err } @@ -318,9 +322,7 @@ func Sign(ctx context.Context, txf Factory, name string, txBuilder client.TxBuil return err } - bytesToSign, err := authsigning.GetSignBytesAdapter( - ctx, txf.txConfig.SignModeHandler(), - signMode, signerData, txBuilder.GetTx()) + bytesToSign, err := authsigning.GetSignBytesAdapter(ctx, txf.txConfig.SignModeHandler(), signMode, signerData, txBuilder.GetTx()) if err != nil { return err } @@ -393,13 +395,6 @@ func makeAuxSignerData(clientCtx client.Context, f Factory, msgs ...sdk.Msg) (tx return tx.AuxSignerData{}, err } - if f.tip != nil { - if _, err := sdk.AccAddressFromBech32(f.tip.Tipper); err != nil { - return tx.AuxSignerData{}, sdkerrors.ErrInvalidAddress.Wrap("tipper must be a bech32 address") - } - b.SetTip(f.tip) - } - err = b.SetSignMode(f.SignMode()) if err != nil { return tx.AuxSignerData{}, err diff --git a/client/tx/tx_test.go b/client/tx/tx_test.go index 386a2391e04c..c234739293a5 100644 --- a/client/tx/tx_test.go +++ b/client/tx/tx_test.go @@ -1,4 +1,4 @@ -package tx_test +package tx import ( "context" @@ -9,10 +9,7 @@ import ( "github.com/stretchr/testify/require" "google.golang.org/grpc" - sdkmath "cosmossdk.io/math" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/tx" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/crypto/hd" @@ -82,7 +79,7 @@ func TestCalculateGas(t *testing.T) { defaultSignMode, err := signing.APISignModeToInternal(txCfg.SignModeHandler().DefaultMode()) require.NoError(t, err) - txf := tx.Factory{}. + txf := Factory{}. WithChainID("test-chain"). WithTxConfig(txCfg).WithSignMode(defaultSignMode) @@ -91,7 +88,7 @@ func TestCalculateGas(t *testing.T) { gasUsed: tc.args.mockGasUsed, wantErr: tc.args.mockWantErr, } - simRes, gotAdjusted, err := tx.CalculateGas(mockClientCtx, txf.WithGasAdjustment(stc.args.adjustment)) + simRes, gotAdjusted, err := CalculateGas(mockClientCtx, txf.WithGasAdjustment(stc.args.adjustment)) if stc.expPass { require.NoError(t, err) require.Equal(t, simRes.GasInfo.GasUsed, stc.wantEstimate) @@ -105,8 +102,8 @@ func TestCalculateGas(t *testing.T) { } } -func mockTxFactory(txCfg client.TxConfig) tx.Factory { - return tx.Factory{}. +func mockTxFactory(txCfg client.TxConfig) Factory { + return Factory{}. WithTxConfig(txCfg). WithAccountNumber(50). WithSequence(23). @@ -197,7 +194,7 @@ func TestMnemonicInMemo(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - txf := tx.Factory{}. + txf := Factory{}. WithTxConfig(txConfig). WithAccountNumber(50). WithSequence(23). @@ -268,7 +265,7 @@ func TestSign(t *testing.T) { testCases := []struct { name string - txf tx.Factory + txf Factory txb client.TxBuilder from string overwrite bool @@ -355,7 +352,7 @@ func TestSign(t *testing.T) { var prevSigs []signingtypes.SignatureV2 for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - err = tx.Sign(context.TODO(), tc.txf, tc.from, tc.txb, tc.overwrite) + err = Sign(context.TODO(), tc.txf, tc.from, tc.txb, tc.overwrite) if len(tc.expectedPKs) == 0 { requireT.Error(err) } else { @@ -371,6 +368,8 @@ func TestSign(t *testing.T) { } func TestPreprocessHook(t *testing.T) { + _, _, addr2 := testdata.KeyTestPubAddr() + txConfig, cdc := newTestTxConfig() requireT := require.New(t) path := hd.CreateHDPath(118, 0, 0).String() @@ -388,22 +387,12 @@ func TestPreprocessHook(t *testing.T) { extAny, err := codectypes.NewAnyWithValue(extVal) requireT.NoError(err) - coin := sdk.Coin{ - Denom: "atom", - Amount: sdkmath.NewInt(20), - } - newTip := &txtypes.Tip{ - Amount: sdk.Coins{coin}, - Tipper: "galaxy", - } - preprocessHook := client.PreprocessTxFn(func(chainID string, key keyring.KeyType, tx client.TxBuilder) error { extensionBuilder, ok := tx.(authtx.ExtensionOptionsTxBuilder) requireT.True(ok) // Set new extension and tip extensionBuilder.SetExtensionOptions(extAny) - tx.SetTip(newTip) return nil }) @@ -420,7 +409,7 @@ func TestPreprocessHook(t *testing.T) { txb, err := txfDirect.BuildUnsignedTx(msg1, msg2) requireT.NoError(err) - err = tx.Sign(context.TODO(), txfDirect, from, txb, false) + err = Sign(context.TODO(), txfDirect, from, txb, false) requireT.NoError(err) // Run preprocessing @@ -435,9 +424,6 @@ func TestPreprocessHook(t *testing.T) { opt := hasExtOptsTx.GetExtensionOptions()[0] requireT.Equal(opt, extAny) - - tip := txb.GetTx().GetTip() - requireT.Equal(tip, newTip) } func testSigners(require *require.Assertions, tr signing.Tx, pks ...cryptotypes.PubKey) []signingtypes.SignatureV2 { diff --git a/client/tx_config.go b/client/tx_config.go index 655e19cbeba7..44e07cdd7686 100644 --- a/client/tx_config.go +++ b/client/tx_config.go @@ -1,7 +1,10 @@ package client import ( + "time" + txsigning "cosmossdk.io/x/tx/signing" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/tx" @@ -46,8 +49,9 @@ type ( SetFeeAmount(amount sdk.Coins) SetFeePayer(feePayer sdk.AccAddress) SetGasLimit(limit uint64) - SetTip(tip *tx.Tip) SetTimeoutHeight(height uint64) + SetTimeoutTimestamp(timestamp time.Time) + SetUnordered(v bool) SetFeeGranter(feeGranter sdk.AccAddress) AddAuxSignerData(tx.AuxSignerData) error } diff --git a/client/v2/CHANGELOG.md b/client/v2/CHANGELOG.md index 0c3c9d03857f..a4ecc941ec2b 100644 --- a/client/v2/CHANGELOG.md +++ b/client/v2/CHANGELOG.md @@ -35,3 +35,77 @@ Ref: https://keepachangelog.com/en/1.0.0/ # Changelog ## [Unreleased] + +## [v2.0.0-beta.8] - 2025-01-29 + +* [#23544](https://github.com/cosmos/cosmos-sdk/pull/23544) Support map in queries for autocli. + +## [v2.0.0-beta.7] - 2024-12-10 + +### Bug Fixes + +* [#22817](https://github.com/cosmos/cosmos-sdk/pull/22817) Add DecCoin support in autocli flag builder. + +## [v2.0.0-beta.6] - 2024-11-21 + +### Improvements + +* [#22443](https://github.com/cosmos/cosmos-sdk/pull/22443) Add keyring flags in query commands. +* [#21936](https://github.com/cosmos/cosmos-sdk/pull/21936) Print possible enum values in error message after an invalid input was provided. + +### Bug Fixes + +* [#21809](https://github.com/cosmos/cosmos-sdk/pull/21809) Correctly handle enhanced sub commands. +* [#22576](https://github.com/cosmos/cosmos-sdk/pull/22576) Fix duplicate command addition in `autocli` when custom enhanced command has a different name than module name + +## [v2.0.0-beta.5] - 2024-09-18 + +### Improvements + +* [#21712](https://github.com/cosmos/cosmos-sdk/pull/21712) Marshal `type` field as proto message url in queries instead of amino name. + +## [v2.0.0-beta.4] - 2024-07-16 + +### Bug Fixes + +* [#20964](https://github.com/cosmos/cosmos-sdk/pull/20964) Fix `GetNodeHomeDirectory` helper in `client/v2/helpers` to respect the `(PREFIX)_HOME` environment variable. + +## [v2.0.0-beta.3] - 2024-07-15 + +### Features + +* [#20771](https://github.com/cosmos/cosmos-sdk/pull/20771) Add `GetNodeHomeDirectory` helper in `client/v2/helpers`. + +## [v2.0.0-beta.2] - 2024-06-19 + +### Features + +* [#19039](https://github.com/cosmos/cosmos-sdk/pull/19039) Add support for pubkey in autocli. + +### Improvements + +* [#19646](https://github.com/cosmos/cosmos-sdk/pull/19646) Use keyring from command context. +* (deps) [#19810](https://github.com/cosmos/cosmos-sdk/pull/19810) Upgrade SDK version due to prometheus breaking change. +* (deps) [#19810](https://github.com/cosmos/cosmos-sdk/pull/19810) Bump `cosmossdk.io/store` to v1.1.0. +* [#20083](https://github.com/cosmos/cosmos-sdk/pull/20083) Integrate latest version of cosmos-proto and improve version filtering. +* [#19618](https://github.com/cosmos/cosmos-sdk/pull/19618) Marshal enum as string in queries. +* [#19060](https://github.com/cosmos/cosmos-sdk/pull/19060) Use client context from root (or enhanced) command in autocli commands. + * Note, the given command must have a `client.Context` in its context. +* [#19216](https://github.com/cosmos/cosmos-sdk/pull/19216) Do not overwrite TxConfig, use directly the one provided in context. TxConfig should always be set in the `client.Context` in `root.go` of an app. +* [#20266](https://github.com/cosmos/cosmos-sdk/pull/20266) Add ability to override the short description in AutoCLI-generated top-level commands. + +### Bug Fixes + +* [#19976](https://github.com/cosmos/cosmos-sdk/pull/19976) Add encoder for `cosmos.base.v1beta1.DecCoin`. +* [#19377](https://github.com/cosmos/cosmos-sdk/pull/19377) Partly fix comment parsing in autocli. +* [#19060](https://github.com/cosmos/cosmos-sdk/pull/19060) Simplify key flag parsing logic in flag handler. +* [#20033](https://github.com/cosmos/cosmos-sdk/pull/20033) Respect output format from client ctx. + +### API Breaking Changes + +* [#19646](https://github.com/cosmos/cosmos-sdk/pull/19646) Remove keyring from `autocli.AppOptions` and `flag.Builder` options. + +## [v2.0.0-beta.1] - 2023-11-07 + +This is the first tagged version of client/v2. +It depends on the Cosmos SDK v0.50 release and fully supports AutoCLI. diff --git a/client/v2/Makefile b/client/v2/Makefile index 6868d1941a36..1b4bb0cbe7f6 100644 --- a/client/v2/Makefile +++ b/client/v2/Makefile @@ -1,2 +1,2 @@ codegen: - @(cd internal; buf generate) + @(cd internal; buf generate) \ No newline at end of file diff --git a/client/v2/README.md b/client/v2/README.md index 6ad3c31e9dde..06410452d638 100644 --- a/client/v2/README.md +++ b/client/v2/README.md @@ -1,7 +1,215 @@ +--- +sidebar_position: 1 +--- + # AutoCLI -The `autocli` package is a Go library for generating CLIs (command line interfaces) for Cosmos SDK-based applications. +:::note Synopsis +This document details how to build CLI and REST interfaces for a module. Examples from various Cosmos SDK modules are included. +::: + +:::note Pre-requisite Readings + +* [CLI](https://docs.cosmos.network/main/core/cli) + +::: + +The `autocli` (also known as `client/v2`) package is a [Go library](https://pkg.go.dev/cosmossdk.io/client/v2/autocli) for generating CLI (command line interface) interfaces for Cosmos SDK-based applications. It provides a simple way to add CLI commands to your application by generating them automatically based on your gRPC service definitions. Autocli generates CLI commands and flags directly from your protobuf messages, including options, input parameters, and output parameters. This means that you can easily add a CLI interface to your application without having to manually create and manage commands. + +## Overview + +`autocli` generates CLI commands and flags for each method defined in your gRPC service. By default, it generates commands for each gRPC services. The commands are named based on the name of the service method. + +For example, given the following protobuf definition for a service: + +```protobuf +service MyService { + rpc MyMethod(MyRequest) returns (MyResponse) {} +} +``` + +For instance, `autocli` would generate a command named `my-method` for the `MyMethod` method. The command will have flags for each field in the `MyRequest` message. + +It is possible to customize the generation of transactions and queries by defining options for each service. + +## Application Wiring + +Here are the steps to use AutoCLI: + +1. Ensure your app's modules implements the `appmodule.AppModule` interface. +2. (optional) Configure how behave `autocli` command generation, by implementing the `func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions` method on the module. +3. Use the `autocli.AppOptions` struct to specify the modules you defined. If you are using `depinject`, it can automatically create an instance of `autocli.AppOptions` based on your app's configuration. +4. Use the `EnhanceRootCommand()` method provided by `autocli` to add the CLI commands for the specified modules to your root command. + +:::tip +AutoCLI is additive only, meaning _enhancing_ the root command will only add subcommands that are not already registered. This means that you can use AutoCLI alongside other custom commands within your app. +::: + +Here's an example of how to use `autocli` in your app: + +``` go +// Define your app's modules +testModules := map[string]appmodule.AppModule{ + "testModule": &TestModule{}, +} + +// Define the autocli AppOptions +autoCliOpts := autocli.AppOptions{ + Modules: testModules, +} + +// Create the root command +rootCmd := &cobra.Command{ + Use: "app", +} + +if err := appOptions.EnhanceRootCommand(rootCmd); err != nil { + return err +} + +// Run the root command +if err := rootCmd.Execute(); err != nil { + return err +} +``` + +### Keyring + +`autocli` uses a keyring for key name resolving names and signing transactions. + +:::tip +AutoCLI provides a better UX than normal CLI as it allows to resolve key names directly from the keyring in all transactions and commands. + +```sh + q bank balances alice + tx bank send alice bob 1000denom +``` + +::: + +The keyring used for resolving names and signing transactions is provided via the `client.Context`. +The keyring is then converted to the `client/v2/autocli/keyring` interface. +If no keyring is provided, the `autocli` generated command will not be able to sign transactions, but will still be able to query the chain. + +:::tip +The Cosmos SDK keyring and Hubl keyring both implement the `client/v2/autocli/keyring` interface, thanks to the following wrapper: + +```go +keyring.NewAutoCLIKeyring(kb) +``` + +::: + +## Signing + +`autocli` supports signing transactions with the keyring. +The [`cosmos.msg.v1.signer` protobuf annotation](https://docs.cosmos.network/main/build/building-modules/protobuf-annotations) defines the signer field of the message. +This field is automatically filled when using the `--from` flag or defining the signer as a positional argument. + +:::warning +AutoCLI currently supports only one signer per transaction. +::: + +## Module Wiring & Customization + +The `AutoCLIOptions()` method on your module allows to specify custom commands, sub-commands or flags for each service, as it was a `cobra.Command` instance, within the `RpcCommandOptions` struct. Defining such options will customize the behavior of the `autocli` command generation, which by default generates a command for each method in your gRPC service. + +```go +*autocliv1.RpcCommandOptions{ + RpcMethod: "Params", // The name of the gRPC service + Use: "params", // Command usage that is displayed in the help + Short: "Query the parameters of the governance process", // Short description of the command + Long: "Query the parameters of the governance process. Specify specific param types (voting|tallying|deposit) to filter results.", // Long description of the command + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "params_type", Optional: true}, // Transform a flag into a positional argument + }, +} +``` + +### Specifying Subcommands + +By default, `autocli` generates a command for each method in your gRPC service. However, you can specify subcommands to group related commands together. To specify subcommands, use the `autocliv1.ServiceCommandDescriptor` struct. + +This example shows how to use the `autocliv1.ServiceCommandDescriptor` struct to group related commands together and specify subcommands in your gRPC service by defining an instance of `autocliv1.ModuleOptions` in your `autocli.go`. + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-beta.0/x/gov/autocli.go#L94-L97 +``` + +### Positional Arguments + +By default `autocli` generates a flag for each field in your protobuf message. However, you can choose to use positional arguments instead of flags for certain fields. + +To add positional arguments to a command, use the `autocliv1.PositionalArgDescriptor` struct, as seen in the example below. Specify the `ProtoField` parameter, which is the name of the protobuf field that should be used as the positional argument. In addition, if the parameter is a variable-length argument, you can specify the `Varargs` parameter as `true`. This can only be applied to the last positional parameter, and the `ProtoField` must be a repeated field. + +Here's an example of how to define a positional argument for the `Account` method of the `auth` service: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-beta.0/x/auth/autocli.go#L25-L30 +``` + +Then the command can be used as follows, instead of having to specify the `--address` flag: + +```bash + query auth account cosmos1abcd...xyz +``` + +### Customising Flag Names + +By default, `autocli` generates flag names based on the names of the fields in your protobuf message. However, you can customise the flag names by providing a `FlagOptions`. This parameter allows you to specify custom names for flags based on the names of the message fields. + +For example, if you have a message with the fields `test` and `test1`, you can use the following naming options to customise the flags: + +``` go +autocliv1.RpcCommandOptions{ + FlagOptions: map[string]*autocliv1.FlagOptions{ + "test": { Name: "custom_name", }, + "test1": { Name: "other_name", }, + }, +} +``` + +`FlagsOptions` is defined like sub commands in the `AutoCLIOptions()` method on your module. + +### Combining AutoCLI with Other Commands Within A Module + +AutoCLI can be used alongside other commands within a module. For example, the `gov` module uses AutoCLI to generate commands for the `query` subcommand, but also defines custom commands for the `proposer` subcommands. + +In order to enable this behavior, set in `AutoCLIOptions()` the `EnhanceCustomCommand` field to `true`, for the command type (queries and/or transactions) you want to enhance. + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/fa4d87ef7e6d87aaccc94c337ffd2fe90fcb7a9d/x/gov/autocli.go#L98 +``` + +If not set to true, `AutoCLI` will not generate commands for the module if there are already commands registered for the module (when `GetTxCmd()` or `GetTxCmd()` are defined). + +### Skip a command + +AutoCLI automatically skips unsupported commands when [`cosmos_proto.method_added_in` protobuf annotation](https://docs.cosmos.network/main/build/building-modules/protobuf-annotations) is present. + +Additionally, a command can be manually skipped using the `autocliv1.RpcCommandOptions`: + +```go +*autocliv1.RpcCommandOptions{ + RpcMethod: "Params", // The name of the gRPC service + Skip: true, +} +``` + +### Use AutoCLI for non module commands + +It is possible to use `AutoCLI` for non module commands. The trick is still to implement the `appmodule.Module` interface and append it to the `appOptions.ModuleOptions` map. + +For example, here is how the SDK does it for `cometbft` gRPC commands: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/client/v2.0.0-beta.1/client/grpc/cmtservice/autocli.go#L52-L71 +``` + +## Summary + +`autocli` let you generate CLI to your Cosmos SDK-based applications without any cobra boilerplate. It allows you to easily generate CLI commands and flags from your protobuf messages, and provides many options for customising the behavior of your CLI application. -Read more about in it the Cosmos SDK documentation: +To further enhance your CLI experience with Cosmos SDK-based blockchains, you can use `hubl`. `hubl` is a tool that allows you to query any Cosmos SDK-based blockchain using the new AutoCLI feature of the Cosmos SDK. With `hubl`, you can easily configure a new chain and query modules with just a few simple commands. -* https://docs.cosmos.network/main/building-modules/autocli \ No newline at end of file +For more information on `hubl`, including how to configure a new chain and query a module, see the [Hubl documentation](https://docs.cosmos.network/main/tooling/hubl). diff --git a/client/v2/autocli/app.go b/client/v2/autocli/app.go index 0172b4c3e8cf..607f9052d25c 100644 --- a/client/v2/autocli/app.go +++ b/client/v2/autocli/app.go @@ -1,7 +1,9 @@ package autocli import ( - "errors" + "github.com/spf13/cobra" + "google.golang.org/grpc" + "google.golang.org/protobuf/reflect/protoregistry" autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" "cosmossdk.io/client/v2/autocli/flag" @@ -10,9 +12,8 @@ import ( "cosmossdk.io/depinject" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" - "google.golang.org/grpc" + sdkflags "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/runtime" ) // AppOptions are autocli options for an app. These options can be built via depinject based on an app config. Ex: @@ -36,7 +37,12 @@ type AppOptions struct { ModuleOptions map[string]*autocliv1.ModuleOptions `optional:"true"` // AddressCodec is the address codec to use for the app. - AddressCodec address.Codec + AddressCodec address.Codec + ValidatorAddressCodec runtime.ValidatorAddressCodec + ConsensusAddressCodec runtime.ConsensusAddressCodec + + // ClientCtx contains the necessary information needed to execute the commands. + ClientCtx client.Context } // EnhanceRootCommand enhances the provided root command with autocli AppOptions, @@ -57,21 +63,28 @@ type AppOptions struct { func (appOptions AppOptions) EnhanceRootCommand(rootCmd *cobra.Command) error { builder := &Builder{ Builder: flag.Builder{ - AddressCodec: appOptions.AddressCodec, + TypeResolver: protoregistry.GlobalTypes, + FileResolver: appOptions.ClientCtx.InterfaceRegistry, + AddressCodec: appOptions.AddressCodec, + ValidatorAddressCodec: appOptions.ValidatorAddressCodec, + ConsensusAddressCodec: appOptions.ConsensusAddressCodec, }, GetClientConn: func(cmd *cobra.Command) (grpc.ClientConnInterface, error) { return client.GetClientQueryContext(cmd) }, - AddQueryConnFlags: flags.AddQueryFlagsToCmd, - AddTxConnFlags: flags.AddTxFlagsToCmd, + AddQueryConnFlags: func(c *cobra.Command) { + sdkflags.AddQueryFlagsToCmd(c) + sdkflags.AddKeyringFlags(c.Flags()) + }, + AddTxConnFlags: sdkflags.AddTxFlagsToCmd, } return appOptions.EnhanceRootCommandWithBuilder(rootCmd, builder) } func (appOptions AppOptions) EnhanceRootCommandWithBuilder(rootCmd *cobra.Command, builder *Builder) error { - if builder.AddressCodec == nil { - return errors.New("address codec is required in builder") + if err := builder.ValidateAndComplete(); err != nil { + return err } // extract any custom commands from modules @@ -94,11 +107,11 @@ func (appOptions AppOptions) EnhanceRootCommandWithBuilder(rootCmd *cobra.Comman } if queryCmd := findSubCommand(rootCmd, "query"); queryCmd != nil { - if err := builder.enhanceCommandCommon(queryCmd, appOptions, customQueryCmds, enhanceQuery); err != nil { + if err := builder.enhanceCommandCommon(queryCmd, queryCmdType, appOptions, customQueryCmds); err != nil { return err } } else { - queryCmd, err := builder.BuildQueryCommand(appOptions, customQueryCmds, enhanceQuery) + queryCmd, err := builder.BuildQueryCommand(rootCmd.Context(), appOptions, customQueryCmds) if err != nil { return err } @@ -107,11 +120,11 @@ func (appOptions AppOptions) EnhanceRootCommandWithBuilder(rootCmd *cobra.Comman } if msgCmd := findSubCommand(rootCmd, "tx"); msgCmd != nil { - if err := builder.enhanceCommandCommon(msgCmd, appOptions, customMsgCmds, enhanceMsg); err != nil { + if err := builder.enhanceCommandCommon(msgCmd, msgCmdType, appOptions, customMsgCmds); err != nil { return err } } else { - subCmd, err := builder.BuildMsgCommand(appOptions, customMsgCmds, enhanceMsg) + subCmd, err := builder.BuildMsgCommand(rootCmd.Context(), appOptions, customMsgCmds) if err != nil { return err } diff --git a/client/v2/autocli/builder.go b/client/v2/autocli/builder.go index 5766c5aa8770..81604f0d810b 100644 --- a/client/v2/autocli/builder.go +++ b/client/v2/autocli/builder.go @@ -16,7 +16,13 @@ type Builder struct { // from a given context. GetClientConn func(*cobra.Command) (grpc.ClientConnInterface, error) + // AddQueryConnFlags and AddTxConnFlags are functions that add flags to query and transaction commands AddQueryConnFlags func(*cobra.Command) + AddTxConnFlags func(*cobra.Command) +} - AddTxConnFlags func(*cobra.Command) +// ValidateAndComplete the builder fields. +// It returns an error if any of the required fields are missing. +func (b *Builder) ValidateAndComplete() error { + return b.Builder.ValidateAndComplete() } diff --git a/client/v2/autocli/common.go b/client/v2/autocli/common.go index 301cb43204be..409198267cfd 100644 --- a/client/v2/autocli/common.go +++ b/client/v2/autocli/common.go @@ -1,17 +1,25 @@ package autocli import ( - "context" "fmt" + "strings" - autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" - "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - "golang.org/x/exp/maps" "google.golang.org/protobuf/reflect/protoreflect" "sigs.k8s.io/yaml" + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + "cosmossdk.io/client/v2/internal/flags" "cosmossdk.io/client/v2/internal/util" + + "github.com/cosmos/cosmos-sdk/client" +) + +type cmdType int + +const ( + queryCmdType cmdType = iota + msgCmdType ) func (b *Builder) buildMethodCommandCommon(descriptor protoreflect.MethodDescriptor, options *autocliv1.RpcCommandOptions, exec func(cmd *cobra.Command, input protoreflect.Message) error) (*cobra.Command, error) { @@ -20,9 +28,9 @@ func (b *Builder) buildMethodCommandCommon(descriptor protoreflect.MethodDescrip options = &autocliv1.RpcCommandOptions{} } - long := options.Long - if long == "" { - long = util.DescriptorDocs(descriptor) + short := options.Short + if short == "" { + short = fmt.Sprintf("Execute the %s RPC method", descriptor.Name()) } inputDesc := descriptor.Input() @@ -34,30 +42,58 @@ func (b *Builder) buildMethodCommandCommon(descriptor protoreflect.MethodDescrip } cmd := &cobra.Command{ - Use: use, - Long: long, - Short: options.Short, - Example: options.Example, - Aliases: options.Alias, - SuggestFor: options.SuggestFor, - Deprecated: options.Deprecated, - Version: options.Version, + SilenceUsage: false, + Use: use, + Long: options.Long, + Short: short, + Example: options.Example, + Aliases: options.Alias, + SuggestFor: options.SuggestFor, + Deprecated: options.Deprecated, + Version: options.Version, } - cmd.SetContext(context.Background()) - binder, err := b.AddMessageFlags(cmd.Context(), cmd.Flags(), inputType, options) + // we need to use a pointer to the context as the correct context is set in the RunE function + // however we need to set the flags before the RunE function is called + ctx := cmd.Context() + binder, err := b.AddMessageFlags(&ctx, cmd.Flags(), inputType, options) if err != nil { return nil, err } - cmd.Args = binder.CobraArgs cmd.RunE = func(cmd *cobra.Command, args []string) error { + ctx = cmd.Context() + input, err := binder.BuildMessage(args) if err != nil { return err } + // signer related logic, triggers only when there is a signer defined + if binder.SignerInfo.FieldName != "" { + if binder.SignerInfo.IsFlag { + // the client context uses the from flag to determine the signer. + // this sets the signer flags to the from flag value if a custom signer flag is set. + // marks the custom flag as required. + if binder.SignerInfo.FlagName != flags.FlagFrom { + if err := cmd.MarkFlagRequired(binder.SignerInfo.FlagName); err != nil { + return err + } + + if err := cmd.Flags().Set(flags.FlagFrom, cmd.Flag(binder.SignerInfo.FlagName).Value.String()); err != nil { + return err + } + } + } else { + // if the signer is not a flag, it is a positional argument + // we need to get the correct positional arguments + if err := cmd.Flags().Set(flags.FlagFrom, args[binder.SignerInfo.PositionalArgIndex]); err != nil { + return err + } + } + } + return exec(cmd, input) } @@ -70,55 +106,87 @@ func (b *Builder) buildMethodCommandCommon(descriptor protoreflect.MethodDescrip // automatically fill in missing commands. func (b *Builder) enhanceCommandCommon( cmd *cobra.Command, + cmdType cmdType, appOptions AppOptions, customCmds map[string]*cobra.Command, - buildModuleCommand enhanceCommandFunc, ) error { moduleOptions := appOptions.ModuleOptions if len(moduleOptions) == 0 { - moduleOptions = map[string]*autocliv1.ModuleOptions{} - for name, module := range appOptions.Modules { + moduleOptions = make(map[string]*autocliv1.ModuleOptions) + } + for name, module := range appOptions.Modules { + if _, ok := moduleOptions[name]; !ok { if module, ok := module.(HasAutoCLIConfig); ok { moduleOptions[name] = module.AutoCLIOptions() + } else { + moduleOptions[name] = nil } } } - modules := append(maps.Keys(appOptions.Modules), maps.Keys(moduleOptions)...) - for _, moduleName := range modules { + for moduleName, modOpts := range moduleOptions { + hasModuleOptions := modOpts != nil + // if we have an existing command skip adding one here - if findSubCommand(cmd, moduleName) != nil { + if subCmd := findSubCommand(cmd, moduleName); subCmd != nil { + if hasModuleOptions { // check if we need to enhance the existing command + if err := enhanceCustomCmd(b, subCmd, cmdType, modOpts); err != nil { + return err + } + } + continue } // if we have a custom command use that instead of generating one - if custom := customCmds[moduleName]; custom != nil { - // custom commands get added lower down + if custom, ok := customCmds[moduleName]; ok { + // Custom may not be called the same as its module, so we need to have a separate check here + if subCmd := findSubCommand(cmd, custom.Name()); subCmd != nil { + if hasModuleOptions { // check if we need to enhance the existing command + if err := enhanceCustomCmd(b, subCmd, cmdType, modOpts); err != nil { + return err + } + } + continue + } + if hasModuleOptions { // check if we need to enhance the new command + if err := enhanceCustomCmd(b, custom, cmdType, modOpts); err != nil { + return err + } + } + cmd.AddCommand(custom) continue } - // check for autocli options - modOpts := moduleOptions[moduleName] - if modOpts == nil { + // if we don't have module options, skip adding a command as we don't have anything to add + if !hasModuleOptions { continue } - if err := buildModuleCommand(b, moduleName, cmd, modOpts); err != nil { - return err + switch cmdType { + case queryCmdType: + if err := enhanceQuery(b, moduleName, cmd, modOpts); err != nil { + return err + } + case msgCmdType: + if err := enhanceMsg(b, moduleName, cmd, modOpts); err != nil { + return err + } } } return nil } -type enhanceCommandFunc func(builder *Builder, moduleName string, cmd *cobra.Command, modOpts *autocliv1.ModuleOptions) error - // enhanceQuery enhances the provided query command with the autocli commands for a module. func enhanceQuery(builder *Builder, moduleName string, cmd *cobra.Command, modOpts *autocliv1.ModuleOptions) error { - queryCmdDesc := modOpts.Query - if queryCmdDesc != nil { - subCmd := topLevelCmd(moduleName, fmt.Sprintf("Querying commands for the %s module", moduleName)) + if queryCmdDesc := modOpts.Query; queryCmdDesc != nil { + short := queryCmdDesc.Short + if short == "" { + short = fmt.Sprintf("Querying commands for the %s module", moduleName) + } + subCmd := topLevelCmd(cmd.Context(), moduleName, short) if err := builder.AddQueryServiceCommands(subCmd, queryCmdDesc); err != nil { return err } @@ -131,9 +199,12 @@ func enhanceQuery(builder *Builder, moduleName string, cmd *cobra.Command, modOp // enhanceMsg enhances the provided msg command with the autocli commands for a module. func enhanceMsg(builder *Builder, moduleName string, cmd *cobra.Command, modOpts *autocliv1.ModuleOptions) error { - txCmdDesc := modOpts.Tx - if txCmdDesc != nil { - subCmd := topLevelCmd(moduleName, fmt.Sprintf("Transactions commands for the %s module", moduleName)) + if txCmdDesc := modOpts.Tx; txCmdDesc != nil { + short := txCmdDesc.Short + if short == "" { + short = fmt.Sprintf("Transactions commands for the %s module", moduleName) + } + subCmd := topLevelCmd(cmd.Context(), moduleName, short) if err := builder.AddMsgServiceCommands(subCmd, txCmdDesc); err != nil { return err } @@ -144,19 +215,49 @@ func enhanceMsg(builder *Builder, moduleName string, cmd *cobra.Command, modOpts return nil } +// enhanceCustomCmd enhances the provided custom query or msg command autocli commands for a module. +func enhanceCustomCmd(builder *Builder, cmd *cobra.Command, cmdType cmdType, modOpts *autocliv1.ModuleOptions) error { + switch cmdType { + case queryCmdType: + if modOpts.Query != nil && modOpts.Query.EnhanceCustomCommand { + if err := builder.AddQueryServiceCommands(cmd, modOpts.Query); err != nil { + return err + } + } + case msgCmdType: + if modOpts.Tx != nil && modOpts.Tx.EnhanceCustomCommand { + if err := builder.AddMsgServiceCommands(cmd, modOpts.Tx); err != nil { + return err + } + } + } + + return nil +} + // outOrStdoutFormat formats the output based on the output flag and writes it to the command's output stream. func (b *Builder) outOrStdoutFormat(cmd *cobra.Command, out []byte) error { + clientCtx := client.Context{} + if v := cmd.Context().Value(client.ClientContextKey); v != nil { + clientCtx = *(v.(*client.Context)) + } + flagSet := cmd.Flags() + if clientCtx.OutputFormat == "" || flagSet.Changed(flags.FlagOutput) { + output, _ := flagSet.GetString(flags.FlagOutput) + clientCtx = clientCtx.WithOutputFormat(output) + } + var err error - outputType := cmd.Flag(flags.FlagOutput) + outputType := clientCtx.OutputFormat // if the output type is text, convert the json to yaml // if output type is json or nil, default to json - if outputType != nil && outputType.Value.String() == flags.OutputFormatText { + if outputType == flags.OutputFormatText { out, err = yaml.JSONToYAML(out) if err != nil { return err } } - _, err = fmt.Fprintln(cmd.OutOrStdout(), string(out)) - return err + cmd.Println(strings.TrimSpace(string(out))) + return nil } diff --git a/client/v2/autocli/common_test.go b/client/v2/autocli/common_test.go index 4f605a4f48dc..bcd14360428f 100644 --- a/client/v2/autocli/common_test.go +++ b/client/v2/autocli/common_test.go @@ -9,17 +9,33 @@ import ( "github.com/spf13/cobra" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" + "google.golang.org/protobuf/reflect/protoregistry" "gotest.tools/v3/assert" + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" reflectionv2alpha1 "cosmossdk.io/api/cosmos/base/reflection/v2alpha1" - "github.com/cosmos/cosmos-sdk/client/flags" - addresscodec "github.com/cosmos/cosmos-sdk/codec/address" - "cosmossdk.io/client/v2/autocli/flag" "cosmossdk.io/client/v2/internal/testpb" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" + sdkkeyring "github.com/cosmos/cosmos-sdk/crypto/keyring" + sdk "github.com/cosmos/cosmos-sdk/types" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" + "github.com/cosmos/cosmos-sdk/x/bank" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" ) -func testExecCommon(t *testing.T, buildModuleCommand func(string, *Builder) (*cobra.Command, error), args ...string) *testClientConn { +type fixture struct { + conn *testClientConn + b *Builder + clientCtx client.Context +} + +func initFixture(t *testing.T) *fixture { + t.Helper() + home := t.TempDir() server := grpc.NewServer() testpb.RegisterQueryServer(server, &testEchoServer{}) reflectionv2alpha1.RegisterReflectionServiceServer(server, &testReflectionServer{}) @@ -34,22 +50,32 @@ func testExecCommon(t *testing.T, buildModuleCommand func(string, *Builder) (*co clientConn, err := grpc.Dial(listener.Addr().String(), grpc.WithTransportCredentials(insecure.NewCredentials())) assert.NilError(t, err) - defer func() { - err := clientConn.Close() - if err != nil { - panic(err) - } - }() - conn := &testClientConn{ - ClientConn: clientConn, - t: t, - out: &bytes.Buffer{}, - errorOut: &bytes.Buffer{}, - } + encodingConfig := moduletestutil.MakeTestEncodingConfig(bank.AppModuleBasic{}) + kr, err := sdkkeyring.New(sdk.KeyringServiceName(), sdkkeyring.BackendMemory, home, nil, encodingConfig.Codec) + assert.NilError(t, err) + + interfaceRegistry := encodingConfig.Codec.InterfaceRegistry() + banktypes.RegisterInterfaces(interfaceRegistry) + + clientCtx := client.Context{}. + WithKeyring(kr). + WithKeyringDir(home). + WithHomeDir(home). + WithViper(""). + WithInterfaceRegistry(interfaceRegistry). + WithTxConfig(encodingConfig.TxConfig). + WithAccountRetriever(client.MockAccountRetriever{}). + WithChainID("autocli-test") + + conn := &testClientConn{ClientConn: clientConn} b := &Builder{ Builder: flag.Builder{ - AddressCodec: addresscodec.NewBech32Codec("cosmos"), + TypeResolver: protoregistry.GlobalTypes, + FileResolver: protoregistry.GlobalFiles, + AddressCodec: addresscodec.NewBech32Codec("cosmos"), + ValidatorAddressCodec: addresscodec.NewBech32Codec("cosmosvaloper"), + ConsensusAddressCodec: addresscodec.NewBech32Codec("cosmosvalcons"), }, GetClientConn: func(*cobra.Command) (grpc.ClientConnInterface, error) { return conn, nil @@ -57,15 +83,25 @@ func testExecCommon(t *testing.T, buildModuleCommand func(string, *Builder) (*co AddQueryConnFlags: flags.AddQueryFlagsToCmd, AddTxConnFlags: flags.AddTxFlagsToCmd, } + assert.NilError(t, b.ValidateAndComplete()) + + return &fixture{ + conn: conn, + b: b, + clientCtx: clientCtx, + } +} + +func runCmd(fixture *fixture, command func(moduleName string, f *fixture) (*cobra.Command, error), args ...string) (*bytes.Buffer, error) { + out := &bytes.Buffer{} + cmd, err := command("test", fixture) + if err != nil { + return out, err + } - cmd, err := buildModuleCommand("test", b) - assert.NilError(t, err) - assert.NilError(t, err) cmd.SetArgs(args) - cmd.SetOut(conn.out) - cmd.SetErr(conn.errorOut) - cmd.Execute() - return conn + cmd.SetOut(out) + return out, cmd.Execute() } type testReflectionServer struct { @@ -81,3 +117,104 @@ func (t testReflectionServer) GetConfigurationDescriptor(_ context.Context, clie } var _ reflectionv2alpha1.ReflectionServiceServer = testReflectionServer{} + +type testClientConn struct { + *grpc.ClientConn + lastRequest interface{} + lastResponse interface{} +} + +func (t *testClientConn) Invoke(ctx context.Context, method string, args, reply interface{}, opts ...grpc.CallOption) error { + err := t.ClientConn.Invoke(ctx, method, args, reply, opts...) + t.lastRequest = args + t.lastResponse = reply + return err +} + +type testEchoServer struct { + testpb.UnimplementedQueryServer +} + +func (t testEchoServer) Echo(_ context.Context, request *testpb.EchoRequest) (*testpb.EchoResponse, error) { + return &testpb.EchoResponse{Request: request}, nil +} + +var _ testpb.QueryServer = testEchoServer{} + +func TestEnhanceCommand(t *testing.T) { + b := &Builder{} + // Test that the command has a subcommand + cmd := &cobra.Command{Use: "test"} + cmd.AddCommand(&cobra.Command{Use: "test"}) + + for i := 0; i < 2; i++ { + cmdTp := cmdType(i) + + appOptions := AppOptions{ + ModuleOptions: map[string]*autocliv1.ModuleOptions{ + "test": {}, + }, + } + + err := b.enhanceCommandCommon(cmd, cmdTp, appOptions, map[string]*cobra.Command{}) + assert.NilError(t, err) + + cmd = &cobra.Command{Use: "test"} + + appOptions = AppOptions{ + ModuleOptions: map[string]*autocliv1.ModuleOptions{}, + } + customCommands := map[string]*cobra.Command{ + "test2": {Use: "test"}, + } + err = b.enhanceCommandCommon(cmd, cmdTp, appOptions, customCommands) + assert.NilError(t, err) + + cmd = &cobra.Command{Use: "test"} + appOptions = AppOptions{ + ModuleOptions: map[string]*autocliv1.ModuleOptions{ + "test": {Tx: nil}, + }, + } + err = b.enhanceCommandCommon(cmd, cmdTp, appOptions, map[string]*cobra.Command{}) + assert.NilError(t, err) + } +} + +func TestErrorBuildCommand(t *testing.T) { + fixture := initFixture(t) + b := fixture.b + b.AddQueryConnFlags = nil + b.AddTxConnFlags = nil + + commandDescriptor := &autocliv1.ServiceCommandDescriptor{ + Service: testpb.Msg_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Send", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + { + ProtoField: "un-existent-proto-field", + }, + }, + }, + }, + } + + appOptions := AppOptions{ + ModuleOptions: map[string]*autocliv1.ModuleOptions{ + "test": { + Query: commandDescriptor, + Tx: commandDescriptor, + }, + }, + } + + _, err := b.BuildMsgCommand(context.Background(), appOptions, nil) + assert.ErrorContains(t, err, "can't find field un-existent-proto-field") + + appOptions.ModuleOptions["test"].Tx = &autocliv1.ServiceCommandDescriptor{Service: "un-existent-service"} + appOptions.ModuleOptions["test"].Query = &autocliv1.ServiceCommandDescriptor{Service: "un-existent-service"} + _, err = b.BuildMsgCommand(context.Background(), appOptions, nil) + assert.ErrorContains(t, err, "can't find service un-existent-service") +} diff --git a/client/v2/autocli/flag/address.go b/client/v2/autocli/flag/address.go index 5b5243528a74..58108d094990 100644 --- a/client/v2/autocli/flag/address.go +++ b/client/v2/autocli/flag/address.go @@ -6,22 +6,42 @@ import ( "google.golang.org/protobuf/reflect/protoreflect" + "cosmossdk.io/client/v2/autocli/keyring" "cosmossdk.io/core/address" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + sdkkeyring "github.com/cosmos/cosmos-sdk/crypto/keyring" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" ) type addressStringType struct{} -func (a addressStringType) NewValue(ctx context.Context, b *Builder) Value { - return &addressValue{addressCodec: b.AddressCodec} +func (a addressStringType) NewValue(ctx *context.Context, b *Builder) Value { + return &addressValue{addressCodec: b.AddressCodec, ctx: ctx} } func (a addressStringType) DefaultValue() string { return "" } +type validatorAddressStringType struct{} + +func (a validatorAddressStringType) NewValue(ctx *context.Context, b *Builder) Value { + return &addressValue{addressCodec: b.ValidatorAddressCodec, ctx: ctx} +} + +func (a validatorAddressStringType) DefaultValue() string { + return "" +} + type addressValue struct { - value string + ctx *context.Context addressCodec address.Codec + + value string } func (a addressValue) Get(protoreflect.Value) (protoreflect.Value, error) { @@ -32,11 +52,24 @@ func (a addressValue) String() string { return a.value } -// Set implements the flag.Value interface for addressValue it only supports bech32 addresses. +// Set implements the flag.Value interface for addressValue. func (a *addressValue) Set(s string) error { - _, err := a.addressCodec.StringToBytes(s) + // we get the keyring on set, as in NewValue the context is the parent context (before RunE) + keyring := getKeyringFromCtx(a.ctx) + addr, err := keyring.LookupAddressByKeyName(s) + if err == nil { + addrStr, err := a.addressCodec.BytesToString(addr) + if err != nil { + return fmt.Errorf("invalid account address got from keyring: %w", err) + } + + a.value = addrStr + return nil + } + + _, err = a.addressCodec.StringToBytes(s) if err != nil { - return fmt.Errorf("invalid bech32 account address: %w", err) + return fmt.Errorf("invalid account address or key name: %w", err) } a.value = s @@ -45,5 +78,89 @@ func (a *addressValue) Set(s string) error { } func (a addressValue) Type() string { - return "bech32 account address key name" + return "account address or key name" +} + +type consensusAddressStringType struct{} + +func (a consensusAddressStringType) NewValue(ctx *context.Context, b *Builder) Value { + return &consensusAddressValue{ + addressValue: addressValue{ + addressCodec: b.ConsensusAddressCodec, + ctx: ctx, + }, + } +} + +func (a consensusAddressStringType) DefaultValue() string { + return "" +} + +type consensusAddressValue struct { + addressValue +} + +func (a consensusAddressValue) Get(protoreflect.Value) (protoreflect.Value, error) { + return protoreflect.ValueOfString(a.value), nil +} + +func (a consensusAddressValue) String() string { + return a.value +} + +func (a *consensusAddressValue) Set(s string) error { + // we get the keyring on set, as in NewValue the context is the parent context (before RunE) + keyring := getKeyringFromCtx(a.ctx) + addr, err := keyring.LookupAddressByKeyName(s) + if err == nil { + addrStr, err := a.addressCodec.BytesToString(addr) + if err != nil { + return fmt.Errorf("invalid consensus address got from keyring: %w", err) + } + + a.value = addrStr + return nil + } + + _, err = a.addressCodec.StringToBytes(s) + if err == nil { + a.value = s + return nil + } + + // fallback to pubkey parsing + registry := types.NewInterfaceRegistry() + cryptocodec.RegisterInterfaces(registry) + cdc := codec.NewProtoCodec(registry) + + var pk cryptotypes.PubKey + err2 := cdc.UnmarshalInterfaceJSON([]byte(s), &pk) + if err2 != nil { + return fmt.Errorf("input isn't a pubkey (%w) or is an invalid account address (%w)", err, err2) + } + + a.value, err = a.addressCodec.BytesToString(pk.Address()) + if err != nil { + return fmt.Errorf("invalid pubkey address: %w", err) + } + + return nil +} + +func getKeyringFromCtx(ctx *context.Context) keyring.Keyring { + dctx := *ctx + if dctx != nil { + if clientCtx := dctx.Value(client.ClientContextKey); clientCtx != nil { + k, err := sdkkeyring.NewAutoCLIKeyring(clientCtx.(*client.Context).Keyring) + if err != nil { + panic(fmt.Errorf("failed to create keyring: %w", err)) + } + + return k + } else if k := dctx.Value(keyring.KeyringContextKey); k != nil { + return k.(*keyring.KeyringImpl) + } + } + + return keyring.NoKeyring{} } diff --git a/client/v2/autocli/flag/binary.go b/client/v2/autocli/flag/binary.go index 901b400eb92d..7bd1c23293f7 100644 --- a/client/v2/autocli/flag/binary.go +++ b/client/v2/autocli/flag/binary.go @@ -14,7 +14,7 @@ type binaryType struct{} var _ Value = (*fileBinaryValue)(nil) -func (f binaryType) NewValue(_ context.Context, _ *Builder) Value { +func (f binaryType) NewValue(*context.Context, *Builder) Value { return &fileBinaryValue{} } diff --git a/client/v2/autocli/flag/builder.go b/client/v2/autocli/flag/builder.go index 1d9ec4f09a2c..9c38441750db 100644 --- a/client/v2/autocli/flag/builder.go +++ b/client/v2/autocli/flag/builder.go @@ -1,11 +1,33 @@ package flag import ( + "context" + "errors" + "fmt" + "strconv" + + cosmos_proto "github.com/cosmos/cosmos-proto" + "github.com/spf13/cobra" + "github.com/spf13/pflag" + "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protodesc" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + msgv1 "cosmossdk.io/api/cosmos/msg/v1" + "cosmossdk.io/client/v2/internal/flags" + "cosmossdk.io/client/v2/internal/util" "cosmossdk.io/core/address" + + "github.com/cosmos/cosmos-sdk/runtime" +) + +const ( + AddressStringScalarType = "cosmos.AddressString" + ValidatorAddressStringScalarType = "cosmos.ValidatorAddressString" + ConsensusAddressStringScalarType = "cosmos.ConsensusAddressString" + PubkeyScalarType = "cosmos.Pubkey" ) // Builder manages options for building pflag flags for protobuf messages. @@ -19,13 +41,18 @@ type Builder struct { // FileResolver specifies how protobuf file descriptors will be resolved. If it is // nil protoregistry.GlobalFiles will be used. - FileResolver protodesc.Resolver + FileResolver interface { + protodesc.Resolver + RangeFiles(func(protoreflect.FileDescriptor) bool) + } messageFlagTypes map[protoreflect.FullName]Type scalarFlagTypes map[string]Type - // AddressCodec is the address codec used for the address flag - AddressCodec address.Codec + // Address Codecs are the address codecs to use for client/v2. + AddressCodec address.Codec + ValidatorAddressCodec runtime.ValidatorAddressCodec + ConsensusAddressCodec runtime.ConsensusAddressCodec } func (b *Builder) init() { @@ -34,20 +61,406 @@ func (b *Builder) init() { b.messageFlagTypes["google.protobuf.Timestamp"] = timestampType{} b.messageFlagTypes["google.protobuf.Duration"] = durationType{} b.messageFlagTypes["cosmos.base.v1beta1.Coin"] = coinType{} + b.messageFlagTypes["cosmos.base.v1beta1.DecCoin"] = decCoinType{} } if b.scalarFlagTypes == nil { b.scalarFlagTypes = map[string]Type{} - b.scalarFlagTypes["cosmos.AddressString"] = addressStringType{} + b.scalarFlagTypes[AddressStringScalarType] = addressStringType{} + b.scalarFlagTypes[ValidatorAddressStringScalarType] = validatorAddressStringType{} + b.scalarFlagTypes[ConsensusAddressStringScalarType] = consensusAddressStringType{} + b.scalarFlagTypes[PubkeyScalarType] = pubkeyType{} } } +// ValidateAndComplete the flag builder fields. +// It returns an error if any of the required fields are missing. +// If the keyring is nil, it will be set to a no keyring. +func (b *Builder) ValidateAndComplete() error { + if b.AddressCodec == nil { + return errors.New("address codec is required in flag builder") + } + + if b.ValidatorAddressCodec == nil { + return errors.New("validator address codec is required in flag builder") + } + + if b.ConsensusAddressCodec == nil { + return errors.New("consensus address codec is required in flag builder") + } + + if b.TypeResolver == nil { + return errors.New("type resolver is required in flag builder") + } + + if b.FileResolver == nil { + return errors.New("file resolver is required in flag builder") + } + + return nil +} + +// DefineMessageFlagType allows to extend custom protobuf message type handling for flags (and positional arguments). func (b *Builder) DefineMessageFlagType(messageName protoreflect.FullName, flagType Type) { b.init() b.messageFlagTypes[messageName] = flagType } +// DefineScalarFlagType allows to extend custom scalar type handling for flags (and positional arguments). func (b *Builder) DefineScalarFlagType(scalarName string, flagType Type) { b.init() b.scalarFlagTypes[scalarName] = flagType } + +// AddMessageFlags adds flags for each field in the message to the flag set. +func (b *Builder) AddMessageFlags(ctx *context.Context, flagSet *pflag.FlagSet, messageType protoreflect.MessageType, commandOptions *autocliv1.RpcCommandOptions) (*MessageBinder, error) { + return b.addMessageFlags(ctx, flagSet, messageType, commandOptions, namingOptions{}) +} + +// addMessageFlags adds flags for each field in the message to the flag set. +func (b *Builder) addMessageFlags(ctx *context.Context, flagSet *pflag.FlagSet, messageType protoreflect.MessageType, commandOptions *autocliv1.RpcCommandOptions, options namingOptions) (*MessageBinder, error) { + messageBinder := &MessageBinder{ + messageType: messageType, + // positional args are also parsed using a FlagSet so that we can reuse all the same parsers + positionalFlagSet: pflag.NewFlagSet("positional", pflag.ContinueOnError), + } + + fields := messageType.Descriptor().Fields() + signerFieldName := GetSignerFieldName(messageType.Descriptor()) + + isPositional := map[string]bool{} + + positionalArgsLen := len(commandOptions.PositionalArgs) + for i, arg := range commandOptions.PositionalArgs { + isPositional[arg.ProtoField] = true + + // verify if a positional field is a signer field + if arg.ProtoField == signerFieldName { + messageBinder.SignerInfo = SignerInfo{ + PositionalArgIndex: i, + FieldName: arg.ProtoField, + } + } + + if arg.Optional && arg.Varargs { + return nil, fmt.Errorf("positional argument %s can't be both optional and varargs", arg.ProtoField) + } + + if arg.Varargs { + if i != positionalArgsLen-1 { + return nil, fmt.Errorf("varargs positional argument %s must be the last argument", arg.ProtoField) + } + + messageBinder.hasVarargs = true + } + + if arg.Optional { + if i != positionalArgsLen-1 { + return nil, fmt.Errorf("optional positional argument %s must be the last argument", arg.ProtoField) + } + + messageBinder.hasOptional = true + } + + field := fields.ByName(protoreflect.Name(arg.ProtoField)) + if field == nil { + return nil, fmt.Errorf("can't find field %s on %s", arg.ProtoField, messageType.Descriptor().FullName()) + } + + _, hasValue, err := b.addFieldFlag( + ctx, + messageBinder.positionalFlagSet, + field, + &autocliv1.FlagOptions{Name: fmt.Sprintf("%d", i)}, + namingOptions{}, + ) + if err != nil { + return nil, err + } + + messageBinder.positionalArgs = append(messageBinder.positionalArgs, fieldBinding{ + field: field, + hasValue: hasValue, + }) + } + + switch { + case messageBinder.hasVarargs: + messageBinder.CobraArgs = cobra.MinimumNArgs(positionalArgsLen - 1) + messageBinder.mandatoryArgUntil = positionalArgsLen - 1 + case messageBinder.hasOptional: + messageBinder.CobraArgs = cobra.RangeArgs(positionalArgsLen-1, positionalArgsLen) + messageBinder.mandatoryArgUntil = positionalArgsLen - 1 + default: + messageBinder.CobraArgs = cobra.ExactArgs(positionalArgsLen) + messageBinder.mandatoryArgUntil = positionalArgsLen + } + + // validate flag options + for name, opts := range commandOptions.FlagOptions { + if fields.ByName(protoreflect.Name(name)) == nil { + return nil, fmt.Errorf("can't find field %s on %s specified as a flag", name, messageType.Descriptor().FullName()) + } + + // verify if a flag is a signer field + if name == signerFieldName { + messageBinder.SignerInfo = SignerInfo{ + FieldName: name, + IsFlag: true, + FlagName: opts.Name, + } + } + } + + // if signer has not been specified as positional arguments, + // add it as `--from` flag (instead of --field-name flags) + if signerFieldName != "" && messageBinder.SignerInfo == (SignerInfo{}) { + if commandOptions.FlagOptions == nil { + commandOptions.FlagOptions = make(map[string]*autocliv1.FlagOptions) + } + + commandOptions.FlagOptions[signerFieldName] = &autocliv1.FlagOptions{ + Name: flags.FlagFrom, + Usage: "Name or address with which to sign the message", + Shorthand: "f", + } + + messageBinder.SignerInfo = SignerInfo{ + FieldName: signerFieldName, + IsFlag: true, + FlagName: flags.FlagFrom, + } + } + + // define all other fields as flags + flagOptsByFlagName := map[string]*autocliv1.FlagOptions{} + for i := 0; i < fields.Len(); i++ { + field := fields.Get(i) + fieldName := string(field.Name()) + + // skips positional args and signer field if already set + if isPositional[fieldName] || + (fieldName == signerFieldName && messageBinder.SignerInfo.FlagName == flags.FlagFrom) { + continue + } + + flagOpts := commandOptions.FlagOptions[fieldName] + name, hasValue, err := b.addFieldFlag(ctx, flagSet, field, flagOpts, options) + flagOptsByFlagName[name] = flagOpts + if err != nil { + return nil, err + } + + messageBinder.flagBindings = append(messageBinder.flagBindings, fieldBinding{ + hasValue: hasValue, + field: field, + }) + } + + flagSet.VisitAll(func(flag *pflag.Flag) { + opts := flagOptsByFlagName[flag.Name] + if opts != nil { + // This is a bit of hacking around the pflag API, but + // we need to set these options here using Flag.VisitAll because the flag + // constructors that pflag gives us (StringP, Int32P, etc.) do not + // actually return the *Flag instance + flag.Deprecated = opts.Deprecated + flag.ShorthandDeprecated = opts.ShorthandDeprecated + flag.Hidden = opts.Hidden + } + }) + + return messageBinder, nil +} + +// bindPageRequest create a flag for pagination +func (b *Builder) bindPageRequest(ctx *context.Context, flagSet *pflag.FlagSet, field protoreflect.FieldDescriptor) (HasValue, error) { + return b.addMessageFlags( + ctx, + flagSet, + util.ResolveMessageType(b.TypeResolver, field.Message()), + &autocliv1.RpcCommandOptions{}, + namingOptions{Prefix: "page-"}, + ) +} + +// namingOptions specifies internal naming options for flags. +type namingOptions struct { + // Prefix is a prefix to prepend to all flags. + Prefix string +} + +// addFieldFlag adds a flag for the provided field to the flag set. +func (b *Builder) addFieldFlag(ctx *context.Context, flagSet *pflag.FlagSet, field protoreflect.FieldDescriptor, opts *autocliv1.FlagOptions, options namingOptions) (name string, hasValue HasValue, err error) { + if opts == nil { + opts = &autocliv1.FlagOptions{} + } + + if field.Kind() == protoreflect.MessageKind && field.Message().FullName() == "cosmos.base.query.v1beta1.PageRequest" { + hasValue, err := b.bindPageRequest(ctx, flagSet, field) + return "", hasValue, err + } + + name = opts.Name + if name == "" { + name = options.Prefix + util.DescriptorKebabName(field) + } + + usage := opts.Usage + shorthand := opts.Shorthand + defaultValue := opts.DefaultValue + + if typ := b.resolveFlagType(field); typ != nil { + if defaultValue == "" { + defaultValue = typ.DefaultValue() + } + + val := typ.NewValue(ctx, b) + flagSet.AddFlag(&pflag.Flag{ + Name: name, + Shorthand: shorthand, + Usage: usage, + DefValue: defaultValue, + Value: val, + }) + return name, val, nil + } + + // use the built-in pflag StringP, Int32P, etc. functions + var val HasValue + + if field.IsList() { + val = bindSimpleListFlag(flagSet, field.Kind(), name, shorthand, usage) + } else if field.IsMap() { + keyKind := field.MapKey().Kind() + valKind := field.MapValue().Kind() + val = bindSimpleMapFlag(flagSet, keyKind, valKind, name, shorthand, usage) + } else { + val = bindSimpleFlag(flagSet, field.Kind(), name, shorthand, usage) + } + + // This is a bit of hacking around the pflag API, but the + // defaultValue is set in this way because this is much easier than trying + // to parse the string into the types that StringSliceP, Int32P, etc. + if defaultValue != "" { + err = flagSet.Set(name, defaultValue) + } + + return name, val, err +} + +func (b *Builder) resolveFlagType(field protoreflect.FieldDescriptor) Type { + typ := b.resolveFlagTypeBasic(field) + if field.IsList() { + if typ != nil { + return compositeListType{simpleType: typ} + } + return nil + } + if field.IsMap() { + keyKind := field.MapKey().Kind() + valType := b.resolveFlagType(field.MapValue()) + if valType != nil { + switch keyKind { + case protoreflect.StringKind: + ct := new(compositeMapType[string]) + ct.keyValueResolver = func(s string) (string, error) { return s, nil } + ct.valueType = valType + ct.keyType = "string" + return ct + case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: + ct := new(compositeMapType[int32]) + ct.keyValueResolver = func(s string) (int32, error) { + i, err := strconv.ParseInt(s, 10, 32) + return int32(i), err + } + ct.valueType = valType + ct.keyType = "int32" + return ct + case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: + ct := new(compositeMapType[int64]) + ct.keyValueResolver = func(s string) (int64, error) { + i, err := strconv.ParseInt(s, 10, 64) + return i, err + } + ct.valueType = valType + ct.keyType = "int64" + return ct + case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: + ct := new(compositeMapType[uint32]) + ct.keyValueResolver = func(s string) (uint32, error) { + i, err := strconv.ParseUint(s, 10, 32) + return uint32(i), err + } + ct.valueType = valType + ct.keyType = "uint32" + return ct + case protoreflect.Uint64Kind, protoreflect.Fixed64Kind: + ct := new(compositeMapType[uint64]) + ct.keyValueResolver = func(s string) (uint64, error) { + i, err := strconv.ParseUint(s, 10, 64) + return i, err + } + ct.valueType = valType + ct.keyType = "uint64" + return ct + case protoreflect.BoolKind: + ct := new(compositeMapType[bool]) + ct.keyValueResolver = strconv.ParseBool + ct.valueType = valType + ct.keyType = "bool" + return ct + } + return nil + + } + return nil + } + + return typ +} + +func (b *Builder) resolveFlagTypeBasic(field protoreflect.FieldDescriptor) Type { + scalar, ok := GetScalarType(field) + if ok { + b.init() + if typ, ok := b.scalarFlagTypes[scalar]; ok { + return typ + } + } + + switch field.Kind() { + case protoreflect.BytesKind: + return binaryType{} + case protoreflect.EnumKind: + return enumType{enum: field.Enum()} + case protoreflect.MessageKind: + b.init() + if flagType, ok := b.messageFlagTypes[field.Message().FullName()]; ok { + return flagType + } + return jsonMessageFlagType{ + messageDesc: field.Message(), + } + default: + return nil + } +} + +// GetScalarType gets scalar type of a field. +func GetScalarType(field protoreflect.FieldDescriptor) (string, bool) { + scalar := proto.GetExtension(field.Options(), cosmos_proto.E_Scalar) + scalarStr, ok := scalar.(string) + return scalarStr, ok +} + +// GetSignerFieldName gets signer field name of a message. +// AutoCLI supports only one signer field per message. +func GetSignerFieldName(descriptor protoreflect.MessageDescriptor) string { + signersFields := proto.GetExtension(descriptor.Options(), msgv1.E_Signer).([]string) + if len(signersFields) == 0 { + return "" + } + + return signersFields[0] +} diff --git a/client/v2/autocli/flag/coin.go b/client/v2/autocli/flag/coin.go index f2abd593ed56..c6ec9f363e0a 100644 --- a/client/v2/autocli/flag/coin.go +++ b/client/v2/autocli/flag/coin.go @@ -2,10 +2,13 @@ package flag import ( "context" + "errors" + "strings" - basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" - "cosmossdk.io/core/coins" "google.golang.org/protobuf/reflect/protoreflect" + + basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + "cosmossdk.io/client/v2/internal/coins" ) type coinType struct{} @@ -14,13 +17,12 @@ type coinValue struct { value *basev1beta1.Coin } -func (c coinType) NewValue(_ context.Context, _ *Builder) Value { +func (c coinType) NewValue(*context.Context, *Builder) Value { return &coinValue{} } func (c coinType) DefaultValue() string { - stringCoin, _ := coins.FormatCoins([]*basev1beta1.Coin{}, nil) - return stringCoin + return "zero" } func (c *coinValue) Get(protoreflect.Value) (protoreflect.Value, error) { @@ -31,10 +33,18 @@ func (c *coinValue) Get(protoreflect.Value) (protoreflect.Value, error) { } func (c *coinValue) String() string { + if c.value == nil { + return "" + } + return c.value.String() } func (c *coinValue) Set(stringValue string) error { + if strings.Contains(stringValue, ",") { + return errors.New("coin flag must be a single coin, specific multiple coins with multiple flags or spaces") + } + coin, err := coins.ParseCoin(stringValue) if err != nil { return err diff --git a/client/v2/autocli/flag/dec_coin.go b/client/v2/autocli/flag/dec_coin.go new file mode 100644 index 000000000000..18f9bf1eb284 --- /dev/null +++ b/client/v2/autocli/flag/dec_coin.go @@ -0,0 +1,58 @@ +package flag + +import ( + "context" + "errors" + "strings" + + "google.golang.org/protobuf/reflect/protoreflect" + + basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + "cosmossdk.io/client/v2/internal/coins" +) + +type decCoinType struct{} + +type decCoinValue struct { + value *basev1beta1.DecCoin +} + +func (c decCoinType) NewValue(*context.Context, *Builder) Value { + return &decCoinValue{} +} + +func (c decCoinType) DefaultValue() string { + return "zero" +} + +func (c *decCoinValue) Get(protoreflect.Value) (protoreflect.Value, error) { + if c.value == nil { + return protoreflect.Value{}, nil + } + return protoreflect.ValueOfMessage(c.value.ProtoReflect()), nil +} + +func (c *decCoinValue) String() string { + if c.value == nil { + return "" + } + + return c.value.String() +} + +func (c *decCoinValue) Set(stringValue string) error { + if strings.Contains(stringValue, ",") { + return errors.New("coin flag must be a single coin, specific multiple coins with multiple flags or spaces") + } + + coin, err := coins.ParseDecCoin(stringValue) + if err != nil { + return err + } + c.value = coin + return nil +} + +func (c *decCoinValue) Type() string { + return "cosmos.base.v1beta1.DecCoin" +} diff --git a/client/v2/autocli/flag/duration.go b/client/v2/autocli/flag/duration.go index cf9fe67af495..df02cba700f7 100644 --- a/client/v2/autocli/flag/duration.go +++ b/client/v2/autocli/flag/duration.go @@ -10,7 +10,7 @@ import ( type durationType struct{} -func (d durationType) NewValue(context.Context, *Builder) Value { +func (d durationType) NewValue(*context.Context, *Builder) Value { return &durationValue{} } diff --git a/client/v2/autocli/flag/enum.go b/client/v2/autocli/flag/enum.go index 8b555d9232ec..db3f57627511 100644 --- a/client/v2/autocli/flag/enum.go +++ b/client/v2/autocli/flag/enum.go @@ -14,7 +14,7 @@ type enumType struct { enum protoreflect.EnumDescriptor } -func (b enumType) NewValue(context.Context, *Builder) Value { +func (b enumType) NewValue(*context.Context, *Builder) Value { val := &enumValue{ enum: b.enum, valMap: map[string]protoreflect.EnumValueDescriptor{}, @@ -58,7 +58,12 @@ func (e enumValue) String() string { func (e *enumValue) Set(s string) error { valDesc, ok := e.valMap[s] if !ok { - return fmt.Errorf("%s is not a valid value for enum %s", s, e.enum.FullName()) + var validValues []string + for k := range e.valMap { + validValues = append(validValues, k) + } + + return fmt.Errorf("%s is not a valid value for enum %s. Valid values are: %s", s, e.enum.FullName(), strings.Join(validValues, ", ")) } e.value = valDesc.Number() return nil diff --git a/client/v2/autocli/flag/field.go b/client/v2/autocli/flag/field.go deleted file mode 100644 index 19f0abd8b1d1..000000000000 --- a/client/v2/autocli/flag/field.go +++ /dev/null @@ -1,181 +0,0 @@ -package flag - -import ( - "context" - "strconv" - - "github.com/spf13/pflag" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - - autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" - cosmos_proto "github.com/cosmos/cosmos-proto" - - "cosmossdk.io/client/v2/internal/util" -) - -// namingOptions specifies internal naming options for flags. -type namingOptions struct { - // Prefix is a prefix to prepend to all flags. - Prefix string -} - -// addFieldFlag adds a flag for the provided field to the flag set. -func (b *Builder) addFieldFlag(ctx context.Context, flagSet *pflag.FlagSet, field protoreflect.FieldDescriptor, opts *autocliv1.FlagOptions, options namingOptions) (name string, hasValue HasValue, err error) { - if opts == nil { - opts = &autocliv1.FlagOptions{} - } - - if field.Kind() == protoreflect.MessageKind && field.Message().FullName() == "cosmos.base.query.v1beta1.PageRequest" { - hasValue, err := b.bindPageRequest(ctx, flagSet, field) - return "", hasValue, err - } - - name = opts.Name - if name == "" { - name = options.Prefix + util.DescriptorKebabName(field) - } - - usage := opts.Usage - if usage == "" { - usage = util.DescriptorDocs(field) - } - - shorthand := opts.Shorthand - defaultValue := opts.DefaultValue - - if typ := b.resolveFlagType(field); typ != nil { - if defaultValue == "" { - defaultValue = typ.DefaultValue() - } - - val := typ.NewValue(ctx, b) - flagSet.AddFlag(&pflag.Flag{ - Name: name, - Shorthand: shorthand, - Usage: usage, - DefValue: defaultValue, - Value: val, - }) - return name, val, nil - } - - // use the built-in pflag StringP, Int32P, etc. functions - var val HasValue - - if field.IsList() { - val = bindSimpleListFlag(flagSet, field.Kind(), name, shorthand, usage) - } else if field.IsMap() { - keyKind := field.MapKey().Kind() - valKind := field.MapValue().Kind() - val = bindSimpleMapFlag(flagSet, keyKind, valKind, name, shorthand, usage) - } else { - val = bindSimpleFlag(flagSet, field.Kind(), name, shorthand, usage) - } - - // This is a bit of hacking around the pflag API, but the - // defaultValue is set in this way because this is much easier than trying - // to parse the string into the types that StringSliceP, Int32P, etc. expect - if defaultValue != "" { - err = flagSet.Set(name, defaultValue) - } - return name, val, err -} - -func (b *Builder) resolveFlagType(field protoreflect.FieldDescriptor) Type { - typ := b.resolveFlagTypeBasic(field) - if field.IsList() { - if typ != nil { - return compositeListType{simpleType: typ} - } - return nil - } - if field.IsMap() { - keyKind := field.MapKey().Kind() - valType := b.resolveFlagType(field.MapValue()) - if valType != nil { - switch keyKind { - case protoreflect.StringKind: - ct := new(compositeMapType[string]) - ct.keyValueResolver = func(s string) (string, error) { return s, nil } - ct.valueType = valType - ct.keyType = "string" - return ct - case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: - ct := new(compositeMapType[int32]) - ct.keyValueResolver = func(s string) (int32, error) { - i, err := strconv.ParseInt(s, 10, 32) - return int32(i), err - } - ct.valueType = valType - ct.keyType = "int32" - return ct - case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: - ct := new(compositeMapType[int64]) - ct.keyValueResolver = func(s string) (int64, error) { - i, err := strconv.ParseInt(s, 10, 64) - return i, err - } - ct.valueType = valType - ct.keyType = "int64" - return ct - case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: - ct := new(compositeMapType[uint32]) - ct.keyValueResolver = func(s string) (uint32, error) { - i, err := strconv.ParseUint(s, 10, 32) - return uint32(i), err - } - ct.valueType = valType - ct.keyType = "uint32" - return ct - case protoreflect.Uint64Kind, protoreflect.Fixed64Kind: - ct := new(compositeMapType[uint64]) - ct.keyValueResolver = func(s string) (uint64, error) { - i, err := strconv.ParseUint(s, 10, 64) - return i, err - } - ct.valueType = valType - ct.keyType = "uint64" - return ct - case protoreflect.BoolKind: - ct := new(compositeMapType[bool]) - ct.keyValueResolver = strconv.ParseBool - ct.valueType = valType - ct.keyType = "bool" - return ct - } - return nil - - } - return nil - } - - return typ -} - -func (b *Builder) resolveFlagTypeBasic(field protoreflect.FieldDescriptor) Type { - scalar := proto.GetExtension(field.Options(), cosmos_proto.E_Scalar) - if scalar != nil { - b.init() - if typ, ok := b.scalarFlagTypes[scalar.(string)]; ok { - return typ - } - } - - switch field.Kind() { - case protoreflect.BytesKind: - return binaryType{} - case protoreflect.EnumKind: - return enumType{enum: field.Enum()} - case protoreflect.MessageKind: - b.init() - if flagType, ok := b.messageFlagTypes[field.Message().FullName()]; ok { - return flagType - } - return jsonMessageFlagType{ - messageDesc: field.Message(), - } - default: - return nil - } -} diff --git a/client/v2/autocli/flag/value.go b/client/v2/autocli/flag/interface.go similarity index 69% rename from client/v2/autocli/flag/value.go rename to client/v2/autocli/flag/interface.go index e42c524d7859..1d983c09c630 100644 --- a/client/v2/autocli/flag/value.go +++ b/client/v2/autocli/flag/interface.go @@ -1,10 +1,21 @@ package flag import ( + "context" + "github.com/spf13/pflag" "google.golang.org/protobuf/reflect/protoreflect" ) +// Type specifies a custom flag type. +type Type interface { + // NewValue returns a new pflag.Value which must also implement either SimpleValue or ListValue. + NewValue(*context.Context, *Builder) Value + + // DefaultValue is the default value for this type. + DefaultValue() string +} + // Value represents a single pflag.Value value. type Value interface { pflag.Value diff --git a/client/v2/autocli/flag/message_json.go b/client/v2/autocli/flag/json_message.go similarity index 95% rename from client/v2/autocli/flag/message_json.go rename to client/v2/autocli/flag/json_message.go index 4e93792aaf23..437388994ee9 100644 --- a/client/v2/autocli/flag/message_json.go +++ b/client/v2/autocli/flag/json_message.go @@ -20,7 +20,7 @@ type jsonMessageFlagType struct { messageDesc protoreflect.MessageDescriptor } -func (j jsonMessageFlagType) NewValue(_ context.Context, builder *Builder) Value { +func (j jsonMessageFlagType) NewValue(_ *context.Context, builder *Builder) Value { return &jsonMessageFlagValue{ messageType: util.ResolveMessageType(builder.TypeResolver, j.messageDesc), jsonMarshalOptions: protojson.MarshalOptions{Resolver: builder.TypeResolver}, diff --git a/client/v2/autocli/flag/list.go b/client/v2/autocli/flag/list.go index 72f84c8be3ee..d30f2992ebd9 100644 --- a/client/v2/autocli/flag/list.go +++ b/client/v2/autocli/flag/list.go @@ -52,7 +52,7 @@ type compositeListType struct { simpleType Type } -func (t compositeListType) NewValue(ctx context.Context, opts *Builder) Value { +func (t compositeListType) NewValue(ctx *context.Context, opts *Builder) Value { return &compositeListValue{ simpleType: t.simpleType, values: nil, @@ -68,7 +68,7 @@ func (t compositeListType) DefaultValue() string { type compositeListValue struct { simpleType Type values []protoreflect.Value - ctx context.Context + ctx *context.Context opts *Builder } diff --git a/client/v2/autocli/flag/map.go b/client/v2/autocli/flag/map.go index 66b30e0a7800..a5d70c7f7fce 100644 --- a/client/v2/autocli/flag/map.go +++ b/client/v2/autocli/flag/map.go @@ -8,6 +8,8 @@ import ( "github.com/cockroachdb/errors" "github.com/spf13/pflag" "google.golang.org/protobuf/reflect/protoreflect" + + "cosmossdk.io/client/v2/autocli/flag/maps" ) func bindSimpleMapFlag(flagSet *pflag.FlagSet, keyKind, valueKind protoreflect.Kind, name, shorthand, usage string) HasValue { @@ -18,126 +20,126 @@ func bindSimpleMapFlag(flagSet *pflag.FlagSet, keyKind, valueKind protoreflect.K val := flagSet.StringToStringP(name, shorthand, nil, usage) return newMapValue(val, protoreflect.ValueOfString) case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: - val := StringToInt32P(flagSet, name, shorthand, nil, usage) + val := maps.StringToInt32P(flagSet, name, shorthand, nil, usage) return newMapValue(val, protoreflect.ValueOfInt32) case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: val := flagSet.StringToInt64P(name, shorthand, nil, usage) return newMapValue(val, protoreflect.ValueOfInt64) case protoreflect.Uint32Kind: - val := StringToUint32P(flagSet, name, shorthand, nil, usage) + val := maps.StringToUint32P(flagSet, name, shorthand, nil, usage) return newMapValue(val, protoreflect.ValueOfUint32) case protoreflect.Uint64Kind: - val := StringToUint64P(flagSet, name, shorthand, nil, usage) + val := maps.StringToUint64P(flagSet, name, shorthand, nil, usage) return newMapValue(val, protoreflect.ValueOfUint64) case protoreflect.BoolKind: - val := StringToBoolP(flagSet, name, shorthand, nil, usage) + val := maps.StringToBoolP(flagSet, name, shorthand, nil, usage) return newMapValue(val, protoreflect.ValueOfBool) } case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: switch valueKind { case protoreflect.StringKind: - val := Int32ToStringP(flagSet, name, shorthand, nil, usage) + val := maps.Int32ToStringP(flagSet, name, shorthand, nil, usage) return newMapValue(val, protoreflect.ValueOfString) case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: - val := Int32ToInt32P(flagSet, name, shorthand, nil, usage) + val := maps.Int32ToInt32P(flagSet, name, shorthand, nil, usage) return newMapValue(val, protoreflect.ValueOfInt32) case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: - val := Int32ToInt64P(flagSet, name, shorthand, nil, usage) + val := maps.Int32ToInt64P(flagSet, name, shorthand, nil, usage) return newMapValue(val, protoreflect.ValueOfInt64) case protoreflect.Uint32Kind: - val := Int32ToUint32P(flagSet, name, shorthand, nil, usage) + val := maps.Int32ToUint32P(flagSet, name, shorthand, nil, usage) return newMapValue(val, protoreflect.ValueOfUint32) case protoreflect.Uint64Kind: - val := Int32ToUint64P(flagSet, name, shorthand, nil, usage) + val := maps.Int32ToUint64P(flagSet, name, shorthand, nil, usage) return newMapValue(val, protoreflect.ValueOfUint64) case protoreflect.BoolKind: - val := Int32ToBoolP(flagSet, name, shorthand, nil, usage) + val := maps.Int32ToBoolP(flagSet, name, shorthand, nil, usage) return newMapValue(val, protoreflect.ValueOfBool) } case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: switch valueKind { case protoreflect.StringKind: - val := Int64ToStringP(flagSet, name, shorthand, nil, usage) + val := maps.Int64ToStringP(flagSet, name, shorthand, nil, usage) return newMapValue(val, protoreflect.ValueOfString) case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: - val := Int64ToInt32P(flagSet, name, shorthand, nil, usage) + val := maps.Int64ToInt32P(flagSet, name, shorthand, nil, usage) return newMapValue(val, protoreflect.ValueOfInt32) case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: - val := Int64ToInt64P(flagSet, name, shorthand, nil, usage) + val := maps.Int64ToInt64P(flagSet, name, shorthand, nil, usage) return newMapValue(val, protoreflect.ValueOfInt64) case protoreflect.Uint32Kind: - val := Int64ToUint32P(flagSet, name, shorthand, nil, usage) + val := maps.Int64ToUint32P(flagSet, name, shorthand, nil, usage) return newMapValue(val, protoreflect.ValueOfUint32) case protoreflect.Uint64Kind: - val := Int64ToUint64P(flagSet, name, shorthand, nil, usage) + val := maps.Int64ToUint64P(flagSet, name, shorthand, nil, usage) return newMapValue(val, protoreflect.ValueOfUint64) case protoreflect.BoolKind: - val := Int64ToBoolP(flagSet, name, shorthand, nil, usage) + val := maps.Int64ToBoolP(flagSet, name, shorthand, nil, usage) return newMapValue(val, protoreflect.ValueOfBool) } case protoreflect.Uint32Kind: switch valueKind { case protoreflect.StringKind: - val := Uint32ToStringP(flagSet, name, shorthand, nil, usage) + val := maps.Uint32ToStringP(flagSet, name, shorthand, nil, usage) return newMapValue(val, protoreflect.ValueOfString) case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: - val := Uint32ToInt32P(flagSet, name, shorthand, nil, usage) + val := maps.Uint32ToInt32P(flagSet, name, shorthand, nil, usage) return newMapValue(val, protoreflect.ValueOfInt32) case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: - val := Uint32ToInt64P(flagSet, name, shorthand, nil, usage) + val := maps.Uint32ToInt64P(flagSet, name, shorthand, nil, usage) return newMapValue(val, protoreflect.ValueOfInt64) case protoreflect.Uint32Kind: - val := Uint32ToUint32P(flagSet, name, shorthand, nil, usage) + val := maps.Uint32ToUint32P(flagSet, name, shorthand, nil, usage) return newMapValue(val, protoreflect.ValueOfUint32) case protoreflect.Uint64Kind: - val := Uint32ToUint64P(flagSet, name, shorthand, nil, usage) + val := maps.Uint32ToUint64P(flagSet, name, shorthand, nil, usage) return newMapValue(val, protoreflect.ValueOfUint64) case protoreflect.BoolKind: - val := Uint32ToBoolP(flagSet, name, shorthand, nil, usage) + val := maps.Uint32ToBoolP(flagSet, name, shorthand, nil, usage) return newMapValue(val, protoreflect.ValueOfBool) } case protoreflect.Uint64Kind: switch valueKind { case protoreflect.StringKind: - val := Uint64ToStringP(flagSet, name, shorthand, nil, usage) + val := maps.Uint64ToStringP(flagSet, name, shorthand, nil, usage) return newMapValue(val, protoreflect.ValueOfString) case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: - val := Uint64ToInt32P(flagSet, name, shorthand, nil, usage) + val := maps.Uint64ToInt32P(flagSet, name, shorthand, nil, usage) return newMapValue(val, protoreflect.ValueOfInt32) case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: - val := Uint64ToInt64P(flagSet, name, shorthand, nil, usage) + val := maps.Uint64ToInt64P(flagSet, name, shorthand, nil, usage) return newMapValue(val, protoreflect.ValueOfInt64) case protoreflect.Uint32Kind: - val := Uint64ToUint32P(flagSet, name, shorthand, nil, usage) + val := maps.Uint64ToUint32P(flagSet, name, shorthand, nil, usage) return newMapValue(val, protoreflect.ValueOfUint32) case protoreflect.Uint64Kind: - val := Uint64ToUint64P(flagSet, name, shorthand, nil, usage) + val := maps.Uint64ToUint64P(flagSet, name, shorthand, nil, usage) return newMapValue(val, protoreflect.ValueOfUint64) case protoreflect.BoolKind: - val := Uint64ToBoolP(flagSet, name, shorthand, nil, usage) + val := maps.Uint64ToBoolP(flagSet, name, shorthand, nil, usage) return newMapValue(val, protoreflect.ValueOfBool) } case protoreflect.BoolKind: switch valueKind { case protoreflect.StringKind: - val := BoolToStringP(flagSet, name, shorthand, nil, usage) + val := maps.BoolToStringP(flagSet, name, shorthand, nil, usage) return newMapValue(val, protoreflect.ValueOfString) case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: - val := BoolToInt32P(flagSet, name, shorthand, nil, usage) + val := maps.BoolToInt32P(flagSet, name, shorthand, nil, usage) return newMapValue(val, protoreflect.ValueOfInt32) case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: - val := BoolToInt64P(flagSet, name, shorthand, nil, usage) + val := maps.BoolToInt64P(flagSet, name, shorthand, nil, usage) return newMapValue(val, protoreflect.ValueOfInt64) case protoreflect.Uint32Kind: - val := BoolToUint32P(flagSet, name, shorthand, nil, usage) + val := maps.BoolToUint32P(flagSet, name, shorthand, nil, usage) return newMapValue(val, protoreflect.ValueOfUint32) case protoreflect.Uint64Kind: - val := BoolToUint64P(flagSet, name, shorthand, nil, usage) + val := maps.BoolToUint64P(flagSet, name, shorthand, nil, usage) return newMapValue(val, protoreflect.ValueOfUint64) case protoreflect.BoolKind: - val := BoolToBoolP(flagSet, name, shorthand, nil, usage) + val := maps.BoolToBoolP(flagSet, name, shorthand, nil, usage) return newMapValue(val, protoreflect.ValueOfBool) } @@ -178,7 +180,7 @@ type compositeMapValue[T comparable] struct { keyType string valueType Type values map[T]protoreflect.Value - ctx context.Context + ctx *context.Context opts *Builder } @@ -186,7 +188,7 @@ func (m compositeMapType[T]) DefaultValue() string { return "" } -func (m compositeMapType[T]) NewValue(ctx context.Context, opts *Builder) Value { +func (m compositeMapType[T]) NewValue(ctx *context.Context, opts *Builder) Value { return &compositeMapValue[T]{ keyValueResolver: m.keyValueResolver, valueType: m.valueType, diff --git a/client/v2/autocli/flag/map_types.go b/client/v2/autocli/flag/maps/generic.go similarity index 86% rename from client/v2/autocli/flag/map_types.go rename to client/v2/autocli/flag/maps/generic.go index 8fc0397cbc6f..371cce5f85cd 100644 --- a/client/v2/autocli/flag/map_types.go +++ b/client/v2/autocli/flag/maps/generic.go @@ -1,9 +1,9 @@ -package flag +package maps import ( + "fmt" + "maps" "strings" - - "github.com/cockroachdb/errors" ) type genericMapValueOptions[K comparable, V any] struct { @@ -31,7 +31,7 @@ func (gm *genericMapValue[K, V]) Set(val string) error { for _, pair := range ss { kv := strings.SplitN(pair, "=", 2) if len(kv) != 2 { - return errors.Errorf("%s must be formatted as key=value", pair) + return fmt.Errorf("%s must be formatted as key=value", pair) } key, err := gm.Options.keyParser(kv[0]) if err != nil { @@ -45,9 +45,7 @@ func (gm *genericMapValue[K, V]) Set(val string) error { if !gm.changed { *gm.value = out } else { - for k, v := range out { - (*gm.value)[k] = v - } + maps.Copy(*gm.value, out) } gm.changed = true return nil diff --git a/client/v2/autocli/flag/maps/generic_test.go b/client/v2/autocli/flag/maps/generic_test.go new file mode 100644 index 000000000000..f93bf45f23fc --- /dev/null +++ b/client/v2/autocli/flag/maps/generic_test.go @@ -0,0 +1,123 @@ +package maps + +import ( + "maps" + "strconv" + "testing" + + "github.com/stretchr/testify/require" +) + +func TestGenericMapValue_Set(t *testing.T) { + tests := []struct { + name string + input string + initialMap map[string]int + expectMap map[string]int + expectError bool + changed bool + }{ + { + name: "basic key-value pairs", + input: "key1=1,key2=2", + initialMap: map[string]int{}, + expectMap: map[string]int{"key1": 1, "key2": 2}, + }, + { + name: "invalid format missing value", + input: "key1", + initialMap: map[string]int{}, + expectError: true, + }, + { + name: "invalid format wrong separator", + input: "key1:1", + initialMap: map[string]int{}, + expectError: true, + }, + { + name: "overwrite existing map first time", + input: "key3=3", + initialMap: map[string]int{"key1": 1, "key2": 2}, + expectMap: map[string]int{"key3": 3}, + }, + { + name: "invalid value format", + input: "key1=invalid", + initialMap: map[string]int{}, + expectError: true, + }, + { + name: "empty string input", + input: "", + initialMap: map[string]int{}, + expectError: true, + }, + { + name: "empty value", + input: "key=", + initialMap: map[string]int{}, + expectError: true, + }, + { + name: "append to existing map", + input: "key3=3", + initialMap: map[string]int{"key1": 1, "key2": 2}, + expectMap: map[string]int{"key1": 1, "key2": 2, "key3": 3}, + changed: true, + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + // Create a map value with string keys and int values + mapVal := make(map[string]int) + maps.Copy(mapVal, tc.initialMap) + + gm := newGenericMapValue(mapVal, &mapVal) + gm.changed = tc.changed + gm.Options = genericMapValueOptions[string, int]{ + keyParser: func(s string) (string, error) { + return s, nil + }, + valueParser: strconv.Atoi, + genericType: "map[string]int", + } + + err := gm.Set(tc.input) + + if tc.expectError { + require.Error(t, err) + return + } + + require.NoError(t, err) + require.Equal(t, tc.expectMap, mapVal) + }) + } +} + +func TestGenericMapValue_Changed(t *testing.T) { + mapVal := make(map[string]int) + gm := newGenericMapValue(mapVal, &mapVal) + gm.Options = genericMapValueOptions[string, int]{ + keyParser: func(s string) (string, error) { + return s, nil + }, + valueParser: strconv.Atoi, + genericType: "map[string]int", + } + + require.False(t, gm.changed) + + // First Set should replace the map entirely + err := gm.Set("key1=1") + require.NoError(t, err) + require.True(t, gm.changed) + require.Equal(t, map[string]int{"key1": 1}, mapVal) + + // Second Set should merge with existing map + err = gm.Set("key2=2") + require.NoError(t, err) + require.Equal(t, map[string]int{"key1": 1, "key2": 2}, mapVal) +} diff --git a/client/v2/autocli/flag/map_bool_to_value.go b/client/v2/autocli/flag/maps/map_bool_to_value.go similarity index 99% rename from client/v2/autocli/flag/map_bool_to_value.go rename to client/v2/autocli/flag/maps/map_bool_to_value.go index 5f9406db34f1..aae8a7d6f9b0 100644 --- a/client/v2/autocli/flag/map_bool_to_value.go +++ b/client/v2/autocli/flag/maps/map_bool_to_value.go @@ -1,4 +1,4 @@ -package flag +package maps import ( "strconv" diff --git a/client/v2/autocli/flag/map_int32_to_value.go b/client/v2/autocli/flag/maps/map_int32_to_value.go similarity index 99% rename from client/v2/autocli/flag/map_int32_to_value.go rename to client/v2/autocli/flag/maps/map_int32_to_value.go index a2af9d380797..c10adf739963 100644 --- a/client/v2/autocli/flag/map_int32_to_value.go +++ b/client/v2/autocli/flag/maps/map_int32_to_value.go @@ -1,4 +1,4 @@ -package flag +package maps import ( "strconv" diff --git a/client/v2/autocli/flag/map_int64_to_value.go b/client/v2/autocli/flag/maps/map_int64_to_value.go similarity index 99% rename from client/v2/autocli/flag/map_int64_to_value.go rename to client/v2/autocli/flag/maps/map_int64_to_value.go index 06bd46770ed5..9d85ef964d4c 100644 --- a/client/v2/autocli/flag/map_int64_to_value.go +++ b/client/v2/autocli/flag/maps/map_int64_to_value.go @@ -1,4 +1,4 @@ -package flag +package maps import ( "strconv" diff --git a/client/v2/autocli/flag/map_string_to_value.go b/client/v2/autocli/flag/maps/map_string_to_value.go similarity index 98% rename from client/v2/autocli/flag/map_string_to_value.go rename to client/v2/autocli/flag/maps/map_string_to_value.go index 914835bb8670..aff2fd94ba34 100644 --- a/client/v2/autocli/flag/map_string_to_value.go +++ b/client/v2/autocli/flag/maps/map_string_to_value.go @@ -1,4 +1,4 @@ -package flag +package maps import ( "strconv" diff --git a/client/v2/autocli/flag/map_uint32_to_value.go b/client/v2/autocli/flag/maps/map_uint32_to_value.go similarity index 99% rename from client/v2/autocli/flag/map_uint32_to_value.go rename to client/v2/autocli/flag/maps/map_uint32_to_value.go index ae5edc5ab461..c346cd335102 100644 --- a/client/v2/autocli/flag/map_uint32_to_value.go +++ b/client/v2/autocli/flag/maps/map_uint32_to_value.go @@ -1,4 +1,4 @@ -package flag +package maps import ( "strconv" diff --git a/client/v2/autocli/flag/map_uint64_to_value.go b/client/v2/autocli/flag/maps/map_uint64_to_value.go similarity index 99% rename from client/v2/autocli/flag/map_uint64_to_value.go rename to client/v2/autocli/flag/maps/map_uint64_to_value.go index a53be1864ca3..e5e4318b5bf1 100644 --- a/client/v2/autocli/flag/map_uint64_to_value.go +++ b/client/v2/autocli/flag/maps/map_uint64_to_value.go @@ -1,4 +1,4 @@ -package flag +package maps import ( "strconv" diff --git a/client/v2/autocli/flag/message.go b/client/v2/autocli/flag/messager_binder.go similarity index 64% rename from client/v2/autocli/flag/message.go rename to client/v2/autocli/flag/messager_binder.go index 6d07e3564a07..46a28baa285a 100644 --- a/client/v2/autocli/flag/message.go +++ b/client/v2/autocli/flag/messager_binder.go @@ -8,16 +8,31 @@ import ( "google.golang.org/protobuf/reflect/protoreflect" ) +// SignerInfo contains information about the signer field. +// That field is special because it needs to be known for signing. +// This struct keeps track of the field name and whether it is a flag. +// IsFlag and PositionalArgIndex are mutually exclusive. +type SignerInfo struct { + PositionalArgIndex int + IsFlag bool + + FieldName string + FlagName string // flag name (always set if IsFlag is true) +} + // MessageBinder binds multiple flags in a flag set to a protobuf message. type MessageBinder struct { - CobraArgs cobra.PositionalArgs + CobraArgs cobra.PositionalArgs + SignerInfo SignerInfo positionalFlagSet *pflag.FlagSet positionalArgs []fieldBinding - hasVarargs bool + flagBindings []fieldBinding + messageType protoreflect.MessageType - flagBindings []fieldBinding - messageType protoreflect.MessageType + hasVarargs bool + hasOptional bool + mandatoryArgUntil int } // BuildMessage builds and returns a new message for the bound flags. @@ -32,21 +47,19 @@ func (m MessageBinder) Bind(msg protoreflect.Message, positionalArgs []string) e // first set positional args in the positional arg flag set n := len(positionalArgs) for i := range m.positionalArgs { - if i >= n { - panic("unexpected: validate args should have caught this") + if i == n { + break } name := fmt.Sprintf("%d", i) - if i == n-1 && m.hasVarargs { + if i == m.mandatoryArgUntil && m.hasVarargs { for _, v := range positionalArgs[i:] { - err := m.positionalFlagSet.Set(name, v) - if err != nil { + if err := m.positionalFlagSet.Set(name, v); err != nil { return err } } } else { - err := m.positionalFlagSet.Set(name, positionalArgs[i]) - if err != nil { + if err := m.positionalFlagSet.Set(name, positionalArgs[i]); err != nil { return err } } @@ -54,16 +67,14 @@ func (m MessageBinder) Bind(msg protoreflect.Message, positionalArgs []string) e // bind positional arg values to the message for _, arg := range m.positionalArgs { - err := arg.bind(msg) - if err != nil { + if err := arg.bind(msg); err != nil { return err } } // bind flag values to the message for _, binding := range m.flagBindings { - err := binding.bind(msg) - if err != nil { + if err := binding.bind(msg); err != nil { return err } } @@ -88,12 +99,14 @@ func (f fieldBinding) bind(msg protoreflect.Message) error { if err != nil { return err } - kind := f.field.Kind() - if !(field.IsList() || - field.IsMap() || - kind == protoreflect.MessageKind || - kind == protoreflect.GroupKind) { + + if field.IsMap() { + return nil + } + + if msg.IsValid() && val.IsValid() { msg.Set(f.field, val) } + return nil } diff --git a/client/v2/autocli/flag/pagination.go b/client/v2/autocli/flag/pagination.go deleted file mode 100644 index 31d5316251c7..000000000000 --- a/client/v2/autocli/flag/pagination.go +++ /dev/null @@ -1,21 +0,0 @@ -package flag - -import ( - "context" - - autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" - "github.com/spf13/pflag" - "google.golang.org/protobuf/reflect/protoreflect" - - "cosmossdk.io/client/v2/internal/util" -) - -func (b *Builder) bindPageRequest(ctx context.Context, flagSet *pflag.FlagSet, field protoreflect.FieldDescriptor) (HasValue, error) { - return b.addMessageFlags( - ctx, - flagSet, - util.ResolveMessageType(b.TypeResolver, field.Message()), - &autocliv1.RpcCommandOptions{}, - namingOptions{Prefix: "page-"}, - ) -} diff --git a/client/v2/autocli/flag/pubkey.go b/client/v2/autocli/flag/pubkey.go new file mode 100644 index 000000000000..adc07956f690 --- /dev/null +++ b/client/v2/autocli/flag/pubkey.go @@ -0,0 +1,60 @@ +package flag + +import ( + "context" + "fmt" + + "google.golang.org/protobuf/reflect/protoreflect" + + "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" +) + +type pubkeyType struct{} + +func (a pubkeyType) NewValue(_ *context.Context, _ *Builder) Value { + return &pubkeyValue{} +} + +func (a pubkeyType) DefaultValue() string { + return "" +} + +type pubkeyValue struct { + value *types.Any +} + +func (a pubkeyValue) Get(protoreflect.Value) (protoreflect.Value, error) { + return protoreflect.ValueOf(a.value), nil +} + +func (a pubkeyValue) String() string { + return a.value.String() +} + +func (a *pubkeyValue) Set(s string) error { + registry := types.NewInterfaceRegistry() + cryptocodec.RegisterInterfaces(registry) + cdc := codec.NewProtoCodec(registry) + + var pk cryptotypes.PubKey + err := cdc.UnmarshalInterfaceJSON([]byte(s), &pk) + if err != nil { + return fmt.Errorf("input isn't a pubkey: %w", err) + } + + any, err := types.NewAnyWithValue(pk) + if err != nil { + return fmt.Errorf("error converting to any type") + } + + a.value = any + + return nil +} + +func (a pubkeyValue) Type() string { + return "pubkey" +} diff --git a/client/v2/autocli/flag/register.go b/client/v2/autocli/flag/register.go deleted file mode 100644 index a3a525b34374..000000000000 --- a/client/v2/autocli/flag/register.go +++ /dev/null @@ -1,111 +0,0 @@ -package flag - -import ( - "context" - "fmt" - - autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" - "github.com/spf13/cobra" - "github.com/spf13/pflag" - "google.golang.org/protobuf/reflect/protoreflect" -) - -func (b *Builder) AddMessageFlags(ctx context.Context, flagSet *pflag.FlagSet, messageType protoreflect.MessageType, commandOptions *autocliv1.RpcCommandOptions) (*MessageBinder, error) { - return b.addMessageFlags(ctx, flagSet, messageType, commandOptions, namingOptions{}) -} - -// AddMessageFlags adds flags for each field in the message to the flag set. -func (b *Builder) addMessageFlags(ctx context.Context, flagSet *pflag.FlagSet, messageType protoreflect.MessageType, commandOptions *autocliv1.RpcCommandOptions, options namingOptions) (*MessageBinder, error) { - fields := messageType.Descriptor().Fields() - numFields := fields.Len() - handler := &MessageBinder{ - messageType: messageType, - } - - isPositional := map[string]bool{} - hasVarargs := false - n := len(commandOptions.PositionalArgs) - // positional args are also parsed using a FlagSet so that we can reuse all the same parsers - handler.positionalFlagSet = pflag.NewFlagSet("positional", pflag.ContinueOnError) - for i, arg := range commandOptions.PositionalArgs { - isPositional[arg.ProtoField] = true - - field := fields.ByName(protoreflect.Name(arg.ProtoField)) - if field == nil { - return nil, fmt.Errorf("can't find field %s on %s", arg.ProtoField, messageType.Descriptor().FullName()) - } - - if arg.Varargs { - if i != n-1 { - return nil, fmt.Errorf("varargs positional argument %s must be the last argument", arg.ProtoField) - } - - hasVarargs = true - } - - _, hasValue, err := b.addFieldFlag( - ctx, - handler.positionalFlagSet, - field, - &autocliv1.FlagOptions{Name: fmt.Sprintf("%d", i)}, - namingOptions{}, - ) - if err != nil { - return nil, err - } - - handler.positionalArgs = append(handler.positionalArgs, fieldBinding{ - field: field, - hasValue: hasValue, - }) - } - - if hasVarargs { - handler.CobraArgs = cobra.MinimumNArgs(n) - handler.hasVarargs = true - } else { - handler.CobraArgs = cobra.ExactArgs(n) - } - - // validate flag options - for name := range commandOptions.FlagOptions { - if fields.ByName(protoreflect.Name(name)) == nil { - return nil, fmt.Errorf("can't find field %s on %s specified as a flag", name, messageType.Descriptor().FullName()) - } - } - - flagOptsByFlagName := map[string]*autocliv1.FlagOptions{} - for i := 0; i < numFields; i++ { - field := fields.Get(i) - if isPositional[string(field.Name())] { - continue - } - - flagOpts := commandOptions.FlagOptions[string(field.Name())] - name, hasValue, err := b.addFieldFlag(ctx, flagSet, field, flagOpts, options) - flagOptsByFlagName[name] = flagOpts - if err != nil { - return nil, err - } - - handler.flagBindings = append(handler.flagBindings, fieldBinding{ - hasValue: hasValue, - field: field, - }) - } - - flagSet.VisitAll(func(flag *pflag.Flag) { - opts := flagOptsByFlagName[flag.Name] - if opts != nil { - // This is a bit of hacking around the pflag API, but - // we need to set these options here using Flag.VisitAll because the flag - // constructors that pflag gives us (StringP, Int32P, etc.) do not - // actually return the *Flag instance - flag.Deprecated = opts.Deprecated - flag.ShorthandDeprecated = opts.ShorthandDeprecated - flag.Hidden = opts.Hidden - } - }) - - return handler, nil -} diff --git a/client/v2/autocli/flag/timestamp.go b/client/v2/autocli/flag/timestamp.go index c759c70f2178..d77f0293bd97 100644 --- a/client/v2/autocli/flag/timestamp.go +++ b/client/v2/autocli/flag/timestamp.go @@ -10,7 +10,7 @@ import ( type timestampType struct{} -func (t timestampType) NewValue(context.Context, *Builder) Value { +func (t timestampType) NewValue(*context.Context, *Builder) Value { return ×tampValue{} } diff --git a/client/v2/autocli/flag/type.go b/client/v2/autocli/flag/type.go deleted file mode 100644 index a0e79b553d90..000000000000 --- a/client/v2/autocli/flag/type.go +++ /dev/null @@ -1,15 +0,0 @@ -package flag - -import ( - "context" -) - -// Type specifies a custom flag type. -type Type interface { - // NewValue returns a new pflag.Value which must also implement either - // SimpleValue or ListValue. - NewValue(context.Context, *Builder) Value - - // DefaultValue is the default value for this type. - DefaultValue() string -} diff --git a/client/v2/autocli/interface.go b/client/v2/autocli/interface.go index edcb5226094f..df31817287c3 100644 --- a/client/v2/autocli/interface.go +++ b/client/v2/autocli/interface.go @@ -1,9 +1,9 @@ package autocli import ( - autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" "github.com/spf13/cobra" + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" "cosmossdk.io/core/appmodule" ) diff --git a/client/v2/autocli/keyring/interface.go b/client/v2/autocli/keyring/interface.go new file mode 100644 index 000000000000..fa448bd20599 --- /dev/null +++ b/client/v2/autocli/keyring/interface.go @@ -0,0 +1,23 @@ +package keyring + +import ( + signingv1beta1 "cosmossdk.io/api/cosmos/tx/signing/v1beta1" + + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" +) + +// Keyring is an interface used for signing transactions. +// It aims to be simplistic and easy to use. +type Keyring interface { + // List returns the names of all keys stored in the keyring. + List() ([]string, error) + + // LookupAddressByKeyName returns the address of the key with the given name. + LookupAddressByKeyName(name string) ([]byte, error) + + // GetPubKey returns the public key of the key with the given name. + GetPubKey(name string) (cryptotypes.PubKey, error) + + // Sign signs the given bytes with the key with the given name. + Sign(name string, msg []byte, signMode signingv1beta1.SignMode) ([]byte, error) +} diff --git a/client/v2/autocli/keyring/keyring.go b/client/v2/autocli/keyring/keyring.go new file mode 100644 index 000000000000..601163aac690 --- /dev/null +++ b/client/v2/autocli/keyring/keyring.go @@ -0,0 +1,48 @@ +package keyring + +import ( + "context" + + signingv1beta1 "cosmossdk.io/api/cosmos/tx/signing/v1beta1" + + "github.com/cosmos/cosmos-sdk/crypto/types" +) + +// KeyringContextKey is the key used to store the keyring in the context. +// The keyring must be wrapped using the KeyringImpl. +var KeyringContextKey struct{} + +var _ Keyring = &KeyringImpl{} + +type KeyringImpl struct { //nolint:revive // stuttering is fine + k Keyring +} + +// NewKeyringInContext returns a new context with the keyring set. +func NewKeyringInContext(ctx context.Context, k Keyring) context.Context { + return context.WithValue(ctx, KeyringContextKey, NewKeyringImpl(k)) +} + +func NewKeyringImpl(k Keyring) *KeyringImpl { + return &KeyringImpl{k: k} +} + +// GetPubKey implements Keyring. +func (k *KeyringImpl) GetPubKey(name string) (types.PubKey, error) { + return k.k.GetPubKey(name) +} + +// List implements Keyring. +func (k *KeyringImpl) List() ([]string, error) { + return k.k.List() +} + +// LookupAddressByKeyName implements Keyring. +func (k *KeyringImpl) LookupAddressByKeyName(name string) ([]byte, error) { + return k.k.LookupAddressByKeyName(name) +} + +// Sign implements Keyring. +func (k *KeyringImpl) Sign(name string, msg []byte, signMode signingv1beta1.SignMode) ([]byte, error) { + return k.k.Sign(name, msg, signMode) +} diff --git a/client/v2/autocli/keyring/no_keyring.go b/client/v2/autocli/keyring/no_keyring.go new file mode 100644 index 000000000000..e14267cee5e3 --- /dev/null +++ b/client/v2/autocli/keyring/no_keyring.go @@ -0,0 +1,31 @@ +package keyring + +import ( + "errors" + + signingv1beta1 "cosmossdk.io/api/cosmos/tx/signing/v1beta1" + + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" +) + +var _ Keyring = NoKeyring{} + +var errNoKeyring = errors.New("no keyring configured") + +type NoKeyring struct{} + +func (k NoKeyring) List() ([]string, error) { + return nil, errNoKeyring +} + +func (k NoKeyring) LookupAddressByKeyName(name string) ([]byte, error) { + return nil, errNoKeyring +} + +func (k NoKeyring) GetPubKey(name string) (cryptotypes.PubKey, error) { + return nil, errNoKeyring +} + +func (k NoKeyring) Sign(name string, msg []byte, signMode signingv1beta1.SignMode) ([]byte, error) { + return nil, errNoKeyring +} diff --git a/client/v2/autocli/msg.go b/client/v2/autocli/msg.go index 704d4e3c08b6..322fa6b26228 100644 --- a/client/v2/autocli/msg.go +++ b/client/v2/autocli/msg.go @@ -1,22 +1,29 @@ package autocli import ( + "context" "fmt" - autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" - "github.com/cockroachdb/errors" "github.com/spf13/cobra" - "google.golang.org/protobuf/encoding/protojson" + "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" + "google.golang.org/protobuf/types/dynamicpb" + + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + "cosmossdk.io/client/v2/autocli/flag" + "cosmossdk.io/client/v2/internal/util" + + "github.com/cosmos/cosmos-sdk/client" + clienttx "github.com/cosmos/cosmos-sdk/client/tx" ) // BuildMsgCommand builds the msg commands for all the provided modules. If a custom command is provided for a // module, this is used instead of any automatically generated CLI commands. This allows apps to a fully dynamic client // with a more customized experience if a binary with custom commands is downloaded. -func (b *Builder) BuildMsgCommand(appOptions AppOptions, customCmds map[string]*cobra.Command, buildModuleCommand enhanceCommandFunc) (*cobra.Command, error) { - msgCmd := topLevelCmd("tx", "Transaction subcommands") - if err := b.enhanceCommandCommon(msgCmd, appOptions, customCmds, enhanceMsg); err != nil { +func (b *Builder) BuildMsgCommand(ctx context.Context, appOptions AppOptions, customCmds map[string]*cobra.Command) (*cobra.Command, error) { + msgCmd := topLevelCmd(ctx, "tx", "Transaction subcommands") + + if err := b.enhanceCommandCommon(msgCmd, msgCmdType, appOptions, customCmds); err != nil { return nil, err } @@ -28,13 +35,23 @@ func (b *Builder) BuildMsgCommand(appOptions AppOptions, customCmds map[string]* // order to add auto-generated commands to an existing command. func (b *Builder) AddMsgServiceCommands(cmd *cobra.Command, cmdDescriptor *autocliv1.ServiceCommandDescriptor) error { for cmdName, subCmdDescriptor := range cmdDescriptor.SubCommands { - subCmd := topLevelCmd(cmdName, fmt.Sprintf("Tx commands for the %s service", subCmdDescriptor.Service)) + subCmd := findSubCommand(cmd, cmdName) + if subCmd == nil { + short := subCmdDescriptor.Short + if short == "" { + short = fmt.Sprintf("Tx commands for the %s service", subCmdDescriptor.Service) + } + subCmd = topLevelCmd(cmd.Context(), cmdName, short) + } + // Add recursive sub-commands if there are any. This is used for nested services. - err := b.AddMsgServiceCommands(subCmd, subCmdDescriptor) - if err != nil { + if err := b.AddMsgServiceCommands(subCmd, subCmdDescriptor); err != nil { return err } - cmd.AddCommand(subCmd) + + if !subCmdDescriptor.EnhanceCustomCommand { + cmd.AddCommand(subCmd) + } } if cmdDescriptor.Service == "" { @@ -42,14 +59,9 @@ func (b *Builder) AddMsgServiceCommands(cmd *cobra.Command, cmdDescriptor *autoc return nil } - resolver := b.FileResolver - if b.FileResolver == nil { - resolver = protoregistry.GlobalFiles - } - - descriptor, err := resolver.FindDescriptorByName(protoreflect.FullName(cmdDescriptor.Service)) + descriptor, err := b.FileResolver.FindDescriptorByName(protoreflect.FullName(cmdDescriptor.Service)) if err != nil { - return errors.Errorf("can't find service %s: %v", cmdDescriptor.Service, err) + return fmt.Errorf("can't find service %s: %w", cmdDescriptor.Service, err) } service := descriptor.(protoreflect.ServiceDescriptor) methods := service.Methods() @@ -76,14 +88,22 @@ func (b *Builder) AddMsgServiceCommands(cmd *cobra.Command, cmdDescriptor *autoc continue } + if !util.IsSupportedVersion(methodDescriptor) { + continue + } + methodCmd, err := b.BuildMsgMethodCommand(methodDescriptor, methodOpts) if err != nil { return err } - if methodCmd != nil { - cmd.AddCommand(methodCmd) + if findSubCommand(cmd, methodCmd.Name()) != nil { + // do not overwrite existing commands + // we do not display a warning because you may want to overwrite an autocli command + continue } + + cmd.AddCommand(methodCmd) } return nil @@ -91,26 +111,60 @@ func (b *Builder) AddMsgServiceCommands(cmd *cobra.Command, cmdDescriptor *autoc // BuildMsgMethodCommand returns a command that outputs the JSON representation of the message. func (b *Builder) BuildMsgMethodCommand(descriptor protoreflect.MethodDescriptor, options *autocliv1.RpcCommandOptions) (*cobra.Command, error) { - jsonMarshalOptions := protojson.MarshalOptions{ - Indent: " ", - UseProtoNames: true, - UseEnumNumbers: false, - EmitUnpopulated: true, - Resolver: b.TypeResolver, - } - - cmd, err := b.buildMethodCommandCommon(descriptor, options, func(cmd *cobra.Command, input protoreflect.Message) error { - bz, err := jsonMarshalOptions.Marshal(input.Interface()) + execFunc := func(cmd *cobra.Command, input protoreflect.Message) error { + clientCtx, err := client.GetClientTxContext(cmd) if err != nil { return err } - return b.outOrStdoutFormat(cmd, bz) - }) + clientCtx = clientCtx.WithCmdContext(cmd.Context()) + clientCtx = clientCtx.WithOutput(cmd.OutOrStdout()) + + fd := input.Descriptor().Fields().ByName(protoreflect.Name(flag.GetSignerFieldName(input.Descriptor()))) + addressCodec := b.Builder.AddressCodec + + // set signer to signer field if empty + if addr := input.Get(fd).String(); addr == "" { + scalarType, ok := flag.GetScalarType(fd) + if ok { + // override address codec if validator or consensus address + switch scalarType { + case flag.ValidatorAddressStringScalarType: + addressCodec = b.Builder.ValidatorAddressCodec + case flag.ConsensusAddressStringScalarType: + addressCodec = b.Builder.ConsensusAddressCodec + } + } + + signerFromFlag := clientCtx.GetFromAddress() + signer, err := addressCodec.BytesToString(signerFromFlag.Bytes()) + if err != nil { + return fmt.Errorf("failed to set signer on message, got %v: %w", signerFromFlag, err) + } + + input.Set(fd, protoreflect.ValueOfString(signer)) + } + + // AutoCLI uses protov2 messages, while the SDK only supports proto v1 messages. + // Here we use dynamicpb, to create a proto v1 compatible message. + // The SDK codec will handle protov2 -> protov1 (marshal) + msg := dynamicpb.NewMessage(input.Descriptor()) + proto.Merge(msg, input.Interface()) + + return clienttx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + } + + cmd, err := b.buildMethodCommandCommon(descriptor, options, execFunc) + if err != nil { + return nil, err + } if b.AddTxConnFlags != nil { b.AddTxConnFlags(cmd) } - return cmd, err + // silence usage only for inner txs & queries commands + cmd.SilenceUsage = true + + return cmd, nil } diff --git a/client/v2/autocli/msg_test.go b/client/v2/autocli/msg_test.go index b58393da8b19..612207b6a42e 100644 --- a/client/v2/autocli/msg_test.go +++ b/client/v2/autocli/msg_test.go @@ -1,288 +1,183 @@ package autocli import ( + "context" "fmt" - "strings" "testing" "github.com/spf13/cobra" - "google.golang.org/protobuf/encoding/protojson" "gotest.tools/v3/assert" "gotest.tools/v3/golden" autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" "cosmossdk.io/client/v2/internal/testpb" -) -var buildModuleMsgCommand = func(moduleName string, b *Builder) (*cobra.Command, error) { - cmd := topLevelCmd(moduleName, fmt.Sprintf("Transactions commands for the %s module", moduleName)) + "github.com/cosmos/cosmos-sdk/client" +) - err := b.AddMsgServiceCommands(cmd, testCmdMsgDesc) +var buildModuleMsgCommand = func(moduleName string, f *fixture) (*cobra.Command, error) { + ctx := context.WithValue(context.Background(), client.ClientContextKey, &f.clientCtx) + cmd := topLevelCmd(ctx, moduleName, fmt.Sprintf("Transactions commands for the %s module", moduleName)) + err := f.b.AddMsgServiceCommands(cmd, bankAutoCLI) return cmd, err } -var testCmdMsgDesc = &autocliv1.ServiceCommandDescriptor{ - Service: testpb.Msg_ServiceDesc.ServiceName, +func buildCustomModuleMsgCommand(cmdDescriptor *autocliv1.ServiceCommandDescriptor) func(moduleName string, f *fixture) (*cobra.Command, error) { + return func(moduleName string, f *fixture) (*cobra.Command, error) { + ctx := context.WithValue(context.Background(), client.ClientContextKey, &f.clientCtx) + cmd := topLevelCmd(ctx, moduleName, fmt.Sprintf("Transactions commands for the %s module", moduleName)) + err := f.b.AddMsgServiceCommands(cmd, cmdDescriptor) + return cmd, err + } +} + +var bankAutoCLI = &autocliv1.ServiceCommandDescriptor{ + Service: bankv1beta1.Msg_ServiceDesc.ServiceName, RpcCommandOptions: []*autocliv1.RpcCommandOptions{ { - RpcMethod: "Send", - Use: "send [pos1] [pos2] [pos3...]", - Version: "1.0", - Alias: []string{"s"}, - SuggestFor: []string{"send"}, - Example: "send 1 abc {}", - Short: "send msg the value provided by the user", - Long: "send msg the value provided by the user as a proto JSON object with populated with the provided fields and positional arguments", - PositionalArgs: []*autocliv1.PositionalArgDescriptor{ - { - ProtoField: "positional1", - }, - { - ProtoField: "positional2", - }, - { - ProtoField: "positional3_varargs", - Varargs: true, - }, - }, - FlagOptions: map[string]*autocliv1.FlagOptions{ - "u32": { - Name: "uint32", - Shorthand: "u", - Usage: "some random uint32", - }, - "i32": { - Usage: "some random int32", - DefaultValue: "3", - }, - "u64": { - Usage: "some random uint64", - DefaultValue: "5", - }, - "deprecated_field": { - Deprecated: "don't use this", - }, - "shorthand_deprecated_field": { - Shorthand: "d", - Deprecated: "bad idea", - }, - "hidden_bool": { - Hidden: true, - }, - }, - }, - }, - SubCommands: map[string]*autocliv1.ServiceCommandDescriptor{ - // we test the sub-command functionality using the same service with different options - "deprecatedmsg": { - Service: testpb.Msg_ServiceDesc.ServiceName, - RpcCommandOptions: []*autocliv1.RpcCommandOptions{ - { - RpcMethod: "Send", - Deprecated: "dont use this", - Short: "deprecated subcommand", - }, - }, - }, - "skipmsg": { - Service: testpb.Msg_ServiceDesc.ServiceName, - RpcCommandOptions: []*autocliv1.RpcCommandOptions{ - { - RpcMethod: "Send", - Skip: true, - Short: "skip subcommand", - }, - }, + RpcMethod: "Send", + Use: "send [from_key_or_address] [to_address] [amount] [flags]", + Short: "Send coins from one account to another", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "from_address"}, {ProtoField: "to_address"}, {ProtoField: "amount"}}, }, }, + EnhanceCustomCommand: true, } -func TestMsgOptions(t *testing.T) { - conn := testExecCommon(t, - buildModuleMsgCommand, - "send", "5", "6", "1foo", - "--uint32", "7", - "--u64", "8", +func TestMsg(t *testing.T) { + fixture := initFixture(t) + out, err := runCmd(fixture, buildModuleMsgCommand, "send", + "cosmos1y74p8wyy4enfhfn342njve6cjmj5c8dtl6emdk", "cosmos1y74p8wyy4enfhfn342njve6cjmj5c8dtl6emdk", "1foo", + "--generate-only", "--output", "json", ) - response := conn.out.String() - var output testpb.MsgRequest - err := protojson.Unmarshal([]byte(response), &output) assert.NilError(t, err) - assert.Equal(t, output.GetU32(), uint32(7)) - assert.Equal(t, output.GetPositional1(), int32(5)) - assert.Equal(t, output.GetPositional2(), "6") -} + golden.Assert(t, out.String(), "msg-output.golden") -func TestMsgOutputFormat(t *testing.T) { - conn := testExecCommon(t, buildModuleMsgCommand, - "send", "5", "6", "1foo", + out, err = runCmd(fixture, buildCustomModuleMsgCommand(&autocliv1.ServiceCommandDescriptor{ + Service: bankv1beta1.Msg_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Send", + Use: "send [from_key_or_address] [to_address] [amount] [flags]", + Short: "Send coins from one account to another", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "from_address"}, {ProtoField: "to_address"}, {ProtoField: "amount"}}, + }, + }, + EnhanceCustomCommand: true, + }), "send", + "cosmos1y74p8wyy4enfhfn342njve6cjmj5c8dtl6emdk", "cosmos1y74p8wyy4enfhfn342njve6cjmj5c8dtl6emdk", "1foo", + "--generate-only", "--output", "json", ) - assert.Assert(t, strings.Contains(conn.out.String(), "{")) - conn = testExecCommon(t, buildModuleMsgCommand, - "send", "5", "6", "1foo", - "--output", "text", - ) - - assert.Assert(t, strings.Contains(conn.out.String(), "positional1: 5")) -} + assert.NilError(t, err) + golden.Assert(t, out.String(), "msg-output.golden") -func TestMsgOptionsError(t *testing.T) { - conn := testExecCommon(t, buildModuleMsgCommand, - "send", "5", - "--uint32", "7", - "--u64", "8", + out, err = runCmd(fixture, buildCustomModuleMsgCommand(&autocliv1.ServiceCommandDescriptor{ + Service: bankv1beta1.Msg_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Send", + Use: "send [from_key_or_address] [to_address] [amount] [flags]", + Short: "Send coins from one account to another", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "to_address"}, {ProtoField: "amount"}}, + // from_address should be automatically added + }, + }, + EnhanceCustomCommand: true, + }), "send", + "cosmos1y74p8wyy4enfhfn342njve6cjmj5c8dtl6emdk", "1foo", + "--from", "cosmos1y74p8wyy4enfhfn342njve6cjmj5c8dtl6emdk", + "--generate-only", + "--output", "json", ) + assert.NilError(t, err) + golden.Assert(t, out.String(), "msg-output.golden") - assert.Assert(t, strings.Contains(conn.errorOut.String(), "requires at least 3 arg")) - - conn = testExecCommon(t, buildModuleMsgCommand, - "send", "5", "6", `{"denom":"foo","amount":"1"}`, - "--uint32", "7", - "--u64", "abc", + out, err = runCmd(fixture, buildCustomModuleMsgCommand(&autocliv1.ServiceCommandDescriptor{ + Service: bankv1beta1.Msg_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Send", + Use: "send [from_key_or_address] [to_address] [amount] [flags]", + Short: "Send coins from one account to another", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "to_address"}, {ProtoField: "amount"}}, + FlagOptions: map[string]*autocliv1.FlagOptions{ + "from_address": {Name: "sender"}, // use a custom flag for signer + }, + }, + }, + EnhanceCustomCommand: true, + }), "send", + "cosmos1y74p8wyy4enfhfn342njve6cjmj5c8dtl6emdk", "1foo", + "--sender", "cosmos1y74p8wyy4enfhfn342njve6cjmj5c8dtl6emdk", + "--generate-only", + "--output", "json", ) - assert.Assert(t, strings.Contains(conn.errorOut.String(), "invalid argument ")) + assert.NilError(t, err) + golden.Assert(t, out.String(), "msg-output.golden") } -func TestDeprecatedMsg(t *testing.T) { - conn := testExecCommon(t, buildModuleMsgCommand, "send", - "1", "abc", `{"denom":"foo","amount":"1"}`, - "--deprecated-field", "foo") - assert.Assert(t, strings.Contains(conn.out.String(), "--deprecated-field has been deprecated")) +func TestMsgOptionsError(t *testing.T) { + fixture := initFixture(t) - conn = testExecCommon(t, buildModuleMsgCommand, "send", - "1", "abc", `{"denom":"foo","amount":"1"}`, - "-d", "foo") - assert.Assert(t, strings.Contains(conn.out.String(), "--shorthand-deprecated-field has been deprecated")) -} + _, err := runCmd(fixture, buildModuleMsgCommand, + "send", "5", + ) + assert.ErrorContains(t, err, "accepts 3 arg(s)") -func TestEverythingMsg(t *testing.T) { - conn := testExecCommon(t, buildModuleMsgCommand, - "send", - "1", - "abc", - "1234foo", - "4321foo", - "--output", "json", - "--a-bool", - "--an-enum", "two", - "--a-message", `{"bar":"abc", "baz":-3}`, - "--duration", "4h3s", - "--uint32", "27", - "--u64", "3267246890", - "--i32", "-253", - "--i64", "-234602347", - "--str", "def", - "--timestamp", "2019-01-02T00:01:02Z", - "--a-coin", "10000000foo", - "--an-address", "cosmos1y74p8wyy4enfhfn342njve6cjmj5c8dtl6emdk", - "--bz", "c2RncXdlZndkZ3NkZw==", - "--page-count-total", - "--page-key", "MTIzNTQ4N3NnaGRhcw==", - "--page-limit", "1000", - "--page-offset", "10", - "--page-reverse", - "--bools", "true", - "--bools", "false,false,true", - "--enums", "one", - "--enums", "five", - "--enums", "two", - "--strings", "abc", - "--strings", "xyz", - "--strings", "xyz,qrs", - "--durations", "3s", - "--durations", "5s", - "--durations", "10h", - "--some-messages", "{}", - "--some-messages", `{"bar":"baz"}`, - "--some-messages", `{"baz":-1}`, - "--uints", "1,2,3", - "--uints", "4", + _, err = runCmd(fixture, buildModuleMsgCommand, + "send", "foo", "bar", "invalid", ) - response := conn.out.String() - var output testpb.MsgRequest - err := protojson.Unmarshal([]byte(response), &output) - assert.NilError(t, err) - assert.Equal(t, output.GetU32(), uint32(27)) - assert.Equal(t, output.GetU64(), uint64(3267246890)) - assert.Equal(t, output.GetPositional1(), int32(1)) - assert.Equal(t, output.GetPositional2(), "abc") - assert.Equal(t, output.GetABool(), true) - assert.Equal(t, output.GetAnEnum(), testpb.Enum_ENUM_TWO) + assert.ErrorContains(t, err, "invalid argument") } func TestHelpMsg(t *testing.T) { - conn := testExecCommon(t, buildModuleMsgCommand, "-h") - golden.Assert(t, conn.out.String(), "help-toplevel-msg.golden") + fixture := initFixture(t) - conn = testExecCommon(t, buildModuleMsgCommand, "send", "-h") - golden.Assert(t, conn.out.String(), "help-echo-msg.golden") + out, err := runCmd(fixture, buildModuleMsgCommand, "-h") + assert.NilError(t, err) + golden.Assert(t, out.String(), "help-toplevel-msg.golden") - conn = testExecCommon(t, buildModuleMsgCommand, "deprecatedmsg", "send", "-h") - golden.Assert(t, conn.out.String(), "help-deprecated-msg.golden") + out, err = runCmd(fixture, buildModuleMsgCommand, "send", "-h") + assert.NilError(t, err) + golden.Assert(t, out.String(), "help-echo-msg.golden") } -func TestBuildMsgCommand(t *testing.T) { +func TestBuildCustomMsgCommand(t *testing.T) { b := &Builder{} customCommandCalled := false appOptions := AppOptions{ ModuleOptions: map[string]*autocliv1.ModuleOptions{ "test": { - Tx: testCmdMsgDesc, + Tx: &autocliv1.ServiceCommandDescriptor{ + Service: testpb.Msg_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{}, + }, }, }, } - cmd, err := b.BuildMsgCommand(appOptions, map[string]*cobra.Command{ + cmd, err := b.BuildMsgCommand(context.Background(), appOptions, map[string]*cobra.Command{ "test": {Use: "test", Run: func(cmd *cobra.Command, args []string) { customCommandCalled = true }}, - }, enhanceMsg) + }) assert.NilError(t, err) cmd.SetArgs([]string{"test", "tx"}) assert.NilError(t, cmd.Execute()) assert.Assert(t, customCommandCalled) } -func TestErrorBuildMsgCommand(t *testing.T) { - b := &Builder{} - - commandDescriptor := &autocliv1.ServiceCommandDescriptor{ - Service: testpb.Msg_ServiceDesc.ServiceName, - RpcCommandOptions: []*autocliv1.RpcCommandOptions{ - { - RpcMethod: "Send", - PositionalArgs: []*autocliv1.PositionalArgDescriptor{ - { - ProtoField: "un-existent-proto-field", - }, - }, - }, - }, - } - - appOptions := AppOptions{ - ModuleOptions: map[string]*autocliv1.ModuleOptions{ - "test": { - Tx: commandDescriptor, - }, - }, - } - - _, err := b.BuildMsgCommand(appOptions, nil, enhanceMsg) - assert.ErrorContains(t, err, "can't find field un-existent-proto-field") - - nonExistentService := &autocliv1.ServiceCommandDescriptor{Service: "un-existent-service"} - appOptions.ModuleOptions["test"].Tx = nonExistentService - _, err = b.BuildMsgCommand(appOptions, nil, enhanceMsg) - assert.ErrorContains(t, err, "can't find service un-existent-service") -} - func TestNotFoundErrorsMsg(t *testing.T) { - b := &Builder{} + fixture := initFixture(t) + b := fixture.b + b.AddQueryConnFlags = nil + b.AddTxConnFlags = nil + buildModuleMsgCommand := func(moduleName string, cmdDescriptor *autocliv1.ServiceCommandDescriptor) (*cobra.Command, error) { - cmd := topLevelCmd(moduleName, fmt.Sprintf("Transactions commands for the %s module", moduleName)) + cmd := topLevelCmd(context.Background(), moduleName, fmt.Sprintf("Transactions commands for the %s module", moduleName)) err := b.AddMsgServiceCommands(cmd, cmdDescriptor) return cmd, err @@ -326,38 +221,3 @@ func TestNotFoundErrorsMsg(t *testing.T) { }) assert.ErrorContains(t, err, "can't find field un-existent-flag") } - -func TestEnhanceMessageCommand(t *testing.T) { - b := &Builder{} - // Test that the command has a subcommand - cmd := &cobra.Command{Use: "test"} - cmd.AddCommand(&cobra.Command{Use: "test"}) - - appOptions := AppOptions{ - ModuleOptions: map[string]*autocliv1.ModuleOptions{ - "test": {}, - }, - } - - err := b.enhanceCommandCommon(cmd, appOptions, map[string]*cobra.Command{}, enhanceMsg) - assert.NilError(t, err) - - cmd = &cobra.Command{Use: "test"} - - appOptions.ModuleOptions = map[string]*autocliv1.ModuleOptions{} - customCommands := map[string]*cobra.Command{ - "test2": {Use: "test"}, - } - err = b.enhanceCommandCommon(cmd, appOptions, customCommands, enhanceMsg) - assert.NilError(t, err) - - cmd = &cobra.Command{Use: "test"} - appOptions = AppOptions{ - ModuleOptions: map[string]*autocliv1.ModuleOptions{ - "test": {Tx: nil}, - }, - } - customCommands = map[string]*cobra.Command{} - err = b.enhanceCommandCommon(cmd, appOptions, customCommands, enhanceMsg) - assert.NilError(t, err) -} diff --git a/client/v2/autocli/query.go b/client/v2/autocli/query.go index 3fd10ea525dd..56bad2e3eed4 100644 --- a/client/v2/autocli/query.go +++ b/client/v2/autocli/query.go @@ -1,26 +1,33 @@ package autocli import ( + "context" "fmt" + "io" + "strings" + "time" autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + "cosmossdk.io/math" + "cosmossdk.io/x/tx/signing/aminojson" "github.com/cockroachdb/errors" "github.com/spf13/cobra" - "google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" + "cosmossdk.io/client/v2/internal/flags" "cosmossdk.io/client/v2/internal/util" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // BuildQueryCommand builds the query commands for all the provided modules. If a custom command is provided for a // module, this is used instead of any automatically generated CLI commands. This allows apps to a fully dynamic client // with a more customized experience if a binary with custom commands is downloaded. -func (b *Builder) BuildQueryCommand(appOptions AppOptions, customCmds map[string]*cobra.Command, enhanceQuery enhanceCommandFunc) (*cobra.Command, error) { - queryCmd := topLevelCmd("query", "Querying subcommands") +func (b *Builder) BuildQueryCommand(ctx context.Context, appOptions AppOptions, customCmds map[string]*cobra.Command) (*cobra.Command, error) { + queryCmd := topLevelCmd(ctx, "query", "Querying subcommands") queryCmd.Aliases = []string{"q"} - if err := b.enhanceCommandCommon(queryCmd, appOptions, customCmds, enhanceQuery); err != nil { + if err := b.enhanceCommandCommon(queryCmd, queryCmdType, appOptions, customCmds); err != nil { return nil, err } @@ -32,13 +39,22 @@ func (b *Builder) BuildQueryCommand(appOptions AppOptions, customCmds map[string // order to add auto-generated commands to an existing command. func (b *Builder) AddQueryServiceCommands(cmd *cobra.Command, cmdDescriptor *autocliv1.ServiceCommandDescriptor) error { for cmdName, subCmdDesc := range cmdDescriptor.SubCommands { - subCmd := topLevelCmd(cmdName, fmt.Sprintf("Querying commands for the %s service", subCmdDesc.Service)) - err := b.AddQueryServiceCommands(subCmd, subCmdDesc) - if err != nil { + subCmd := findSubCommand(cmd, cmdName) + if subCmd == nil { + short := subCmdDesc.Short + if short == "" { + short = fmt.Sprintf("Querying commands for the %s service", subCmdDesc.Service) + } + subCmd = topLevelCmd(cmd.Context(), cmdName, short) + } + + if err := b.AddQueryServiceCommands(subCmd, subCmdDesc); err != nil { return err } - cmd.AddCommand(subCmd) + if !subCmdDesc.EnhanceCustomCommand { + cmd.AddCommand(subCmd) + } } // skip empty command descriptors @@ -46,11 +62,7 @@ func (b *Builder) AddQueryServiceCommands(cmd *cobra.Command, cmdDescriptor *aut return nil } - resolver := b.FileResolver - if resolver == nil { - resolver = protoregistry.GlobalFiles - } - descriptor, err := resolver.FindDescriptorByName(protoreflect.FullName(cmdDescriptor.Service)) + descriptor, err := b.FileResolver.FindDescriptorByName(protoreflect.FullName(cmdDescriptor.Service)) if err != nil { return errors.Errorf("can't find service %s: %v", cmdDescriptor.Service, err) } @@ -68,8 +80,7 @@ func (b *Builder) AddQueryServiceCommands(cmd *cobra.Command, cmdDescriptor *aut } } - n := methods.Len() - for i := 0; i < n; i++ { + for i := 0; i < methods.Len(); i++ { methodDescriptor := methods.Get(i) methodOpts, ok := rpcOptMap[methodDescriptor.Name()] if !ok { @@ -80,11 +91,21 @@ func (b *Builder) AddQueryServiceCommands(cmd *cobra.Command, cmdDescriptor *aut continue } - methodCmd, err := b.BuildQueryMethodCommand(methodDescriptor, methodOpts) + if !util.IsSupportedVersion(methodDescriptor) { + continue + } + + methodCmd, err := b.BuildQueryMethodCommand(cmd.Context(), methodDescriptor, methodOpts) if err != nil { return err } + if findSubCommand(cmd, methodCmd.Name()) != nil { + // do not overwrite existing commands + // we do not display a warning because you may want to overwrite an autocli command + continue + } + cmd.AddCommand(methodCmd) } @@ -93,17 +114,19 @@ func (b *Builder) AddQueryServiceCommands(cmd *cobra.Command, cmdDescriptor *aut // BuildQueryMethodCommand creates a gRPC query command for the given service method. This can be used to auto-generate // just a single command for a single service rpc method. -func (b *Builder) BuildQueryMethodCommand(descriptor protoreflect.MethodDescriptor, options *autocliv1.RpcCommandOptions) (*cobra.Command, error) { +func (b *Builder) BuildQueryMethodCommand(ctx context.Context, descriptor protoreflect.MethodDescriptor, options *autocliv1.RpcCommandOptions) (*cobra.Command, error) { getClientConn := b.GetClientConn serviceDescriptor := descriptor.Parent().(protoreflect.ServiceDescriptor) methodName := fmt.Sprintf("/%s/%s", serviceDescriptor.FullName(), descriptor.Name()) outputType := util.ResolveMessageType(b.TypeResolver, descriptor.Output()) - jsonMarshalOptions := protojson.MarshalOptions{ - Indent: " ", - UseProtoNames: true, - UseEnumNumbers: false, - EmitUnpopulated: true, - Resolver: b.TypeResolver, + encoderOptions := aminojson.EncoderOptions{ + Indent: " ", + EnumAsString: true, + DoNotSortFields: true, + AminoNameAsTypeURL: true, + MarshalMappings: true, + TypeResolver: b.TypeResolver, + FileResolver: b.FileResolver, } cmd, err := b.buildMethodCommandCommon(descriptor, options, func(cmd *cobra.Command, input protoreflect.Message) error { @@ -113,15 +136,18 @@ func (b *Builder) BuildQueryMethodCommand(descriptor protoreflect.MethodDescript } output := outputType.New() - ctx := cmd.Context() - err = clientConn.Invoke(ctx, methodName, input.Interface(), output.Interface()) - if err != nil { + if err := clientConn.Invoke(cmd.Context(), methodName, input.Interface(), output.Interface()); err != nil { return err } - bz, err := jsonMarshalOptions.Marshal(output.Interface()) + if noIndent, _ := cmd.Flags().GetBool(flags.FlagNoIndent); noIndent { + encoderOptions.Indent = "" + } + + enc := encoder(aminojson.NewEncoder(encoderOptions)) + bz, err := enc.Marshal(output.Interface()) if err != nil { - return err + return fmt.Errorf("cannot marshal response %v: %w", output.Interface(), err) } err = b.outOrStdoutFormat(cmd, bz) @@ -133,7 +159,77 @@ func (b *Builder) BuildQueryMethodCommand(descriptor protoreflect.MethodDescript if b.AddQueryConnFlags != nil { b.AddQueryConnFlags(cmd) + + cmd.Flags().BoolP(flags.FlagNoIndent, "", false, "Do not indent JSON output") + } + + // silence usage only for inner txs & queries commands + if cmd != nil { + cmd.SilenceUsage = true } return cmd, nil } + +func encoder(encoder aminojson.Encoder) aminojson.Encoder { + return encoder.DefineTypeEncoding("google.protobuf.Duration", func(_ *aminojson.Encoder, msg protoreflect.Message, w io.Writer) error { + var ( + secondsName protoreflect.Name = "seconds" + nanosName protoreflect.Name = "nanos" + ) + + fields := msg.Descriptor().Fields() + secondsField := fields.ByName(secondsName) + if secondsField == nil { + return fmt.Errorf("expected seconds field") + } + + seconds := msg.Get(secondsField).Int() + + nanosField := fields.ByName(nanosName) + if nanosField == nil { + return fmt.Errorf("expected nanos field") + } + + nanos := msg.Get(nanosField).Int() + + _, err := fmt.Fprintf(w, `"%s"`, (time.Duration(seconds)*time.Second + (time.Duration(nanos) * time.Nanosecond)).String()) + return err + }).DefineTypeEncoding("cosmos.base.v1beta1.DecCoin", func(_ *aminojson.Encoder, msg protoreflect.Message, w io.Writer) error { + var ( + denomName protoreflect.Name = "denom" + amountName protoreflect.Name = "amount" + ) + + fields := msg.Descriptor().Fields() + denomField := fields.ByName(denomName) + if denomField == nil { + return fmt.Errorf("expected denom field") + } + + denom := msg.Get(denomField).String() + + amountField := fields.ByName(amountName) + if amountField == nil { + return fmt.Errorf("expected amount field") + } + + amount := msg.Get(amountField).String() + decimalPlace := len(amount) - math.LegacyPrecision + if decimalPlace > 0 { + amount = amount[:decimalPlace] + "." + amount[decimalPlace:] + } else if decimalPlace == 0 { + amount = "0." + amount + } else { + amount = "0." + strings.Repeat("0", -decimalPlace) + amount + } + + amountDec, err := math.LegacyNewDecFromStr(amount) + if err != nil { + return fmt.Errorf("invalid amount: %s: %w", amount, err) + } + + _, err = fmt.Fprintf(w, `"%s"`, sdk.NewDecCoinFromDec(denom, amountDec)) // TODO(@julienrbrt): Eventually remove this SDK dependency + return err + }) +} diff --git a/client/v2/autocli/query_test.go b/client/v2/autocli/query_test.go index 635060b3f961..c949ea021a0a 100644 --- a/client/v2/autocli/query_test.go +++ b/client/v2/autocli/query_test.go @@ -1,27 +1,49 @@ package autocli import ( - "bytes" "context" "fmt" "os" "strings" "testing" + "time" - autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" "github.com/spf13/cobra" - "google.golang.org/grpc" "google.golang.org/protobuf/testing/protocmp" + "google.golang.org/protobuf/types/known/durationpb" + "google.golang.org/protobuf/types/known/timestamppb" "gotest.tools/v3/assert" "gotest.tools/v3/golden" + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + queryv1beta1 "cosmossdk.io/api/cosmos/base/query/v1beta1" + basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" "cosmossdk.io/client/v2/internal/testpb" + + "github.com/cosmos/cosmos-sdk/client" ) -var buildModuleQueryCommand = func(moduleName string, b *Builder) (*cobra.Command, error) { - cmd := topLevelCmd(moduleName, fmt.Sprintf("Querying commands for the %s module", moduleName)) +var buildModuleQueryCommand = func(moduleName string, f *fixture) (*cobra.Command, error) { + ctx := context.WithValue(context.Background(), client.ClientContextKey, &f.clientCtx) + cmd := topLevelCmd(ctx, moduleName, fmt.Sprintf("Querying commands for the %s module", moduleName)) + + err := f.b.AddQueryServiceCommands(cmd, testCmdDesc) + return cmd, err +} + +var buildModuleQueryCommandOptional = func(moduleName string, f *fixture) (*cobra.Command, error) { + ctx := context.WithValue(context.Background(), client.ClientContextKey, &f.clientCtx) + cmd := topLevelCmd(ctx, moduleName, fmt.Sprintf("Querying commands for the %s module", moduleName)) + + err := f.b.AddQueryServiceCommands(cmd, testCmdDescOptional) + return cmd, err +} + +var buildModuleVargasOptional = func(moduleName string, f *fixture) (*cobra.Command, error) { + ctx := context.WithValue(context.Background(), client.ClientContextKey, &f.clientCtx) + cmd := topLevelCmd(ctx, moduleName, fmt.Sprintf("Querying commands for the %s module", moduleName)) - err := b.AddQueryServiceCommands(cmd, testCmdDesc) + err := f.b.AddQueryServiceCommands(cmd, testCmdDescInvalidOptAndVargas) return cmd, err } @@ -117,21 +139,155 @@ var testCmdDesc = &autocliv1.ServiceCommandDescriptor{ }, } +var testCmdDescOptional = &autocliv1.ServiceCommandDescriptor{ + Service: testpb.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Echo", + Use: "echo [pos1] [pos2] [pos3...]", + Version: "1.0", + Alias: []string{"e"}, + SuggestFor: []string{"eco"}, + Example: "echo 1 abc {}", + Short: "echo echos the value provided by the user", + Long: "echo echos the value provided by the user as a proto JSON object with populated with the provided fields and positional arguments", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + { + ProtoField: "positional1", + }, + { + ProtoField: "positional2", + Optional: true, + }, + }, + }, + }, +} + +var testCmdDescInvalidOptAndVargas = &autocliv1.ServiceCommandDescriptor{ + Service: testpb.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Echo", + Use: "echo [pos1] [pos2] [pos3...]", + Version: "1.0", + Alias: []string{"e"}, + SuggestFor: []string{"eco"}, + Example: "echo 1 abc {}", + Short: "echo echos the value provided by the user", + Long: "echo echos the value provided by the user as a proto JSON object with populated with the provided fields and positional arguments", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + { + ProtoField: "positional1", + }, + { + ProtoField: "positional2", + Optional: true, + }, + { + ProtoField: "positional3_varargs", + Varargs: true, + }, + }, + }, + }, +} + func TestCoin(t *testing.T) { - conn := testExecCommon(t, buildModuleQueryCommand, + fixture := initFixture(t) + + _, err := runCmd(fixture, buildModuleQueryCommand, + "echo", + "1", + "abc", + "1234foo,4321bar", + "100uatom", + "--a-coin", "100000foo", + ) + assert.ErrorContains(t, err, "coin flag must be a single coin, specific multiple coins with multiple flags or spaces") + + _, err = runCmd(fixture, buildModuleQueryCommand, "echo", "1", "abc", "1234foo", "4321bar", + "100uatom", "--a-coin", "100000foo", - "--duration", "4h3s", + "--coins", "100000bar", + "--coins", "100uatom", ) - assert.DeepEqual(t, conn.lastRequest, conn.lastResponse.(*testpb.EchoResponse).Request, protocmp.Transform()) + assert.NilError(t, err) + assert.DeepEqual(t, fixture.conn.lastRequest, fixture.conn.lastResponse.(*testpb.EchoResponse).Request, protocmp.Transform()) + expectedResp := &testpb.EchoResponse{ + Request: &testpb.EchoRequest{ + Positional1: 1, + Positional2: "abc", + Positional3Varargs: []*basev1beta1.Coin{ + {Amount: "1234", Denom: "foo"}, + {Amount: "4321", Denom: "bar"}, + {Amount: "100", Denom: "uatom"}, + }, + ACoin: &basev1beta1.Coin{ + Amount: "100000", + Denom: "foo", + }, + Coins: []*basev1beta1.Coin{ + {Amount: "100000", Denom: "bar"}, + {Amount: "100", Denom: "uatom"}, + }, + Page: &queryv1beta1.PageRequest{}, + I32: 3, + U64: 5, + }, + } + assert.DeepEqual(t, fixture.conn.lastResponse.(*testpb.EchoResponse), expectedResp, protocmp.Transform()) +} + +func TestOptional(t *testing.T) { + fixture := initFixture(t) + + _, err := runCmd(fixture, buildModuleQueryCommandOptional, + "echo", + "1", + "abc", + ) + assert.NilError(t, err) + request := fixture.conn.lastRequest.(*testpb.EchoRequest) + assert.Equal(t, request.Positional2, "abc") + assert.DeepEqual(t, fixture.conn.lastRequest, fixture.conn.lastResponse.(*testpb.EchoResponse).Request, protocmp.Transform()) + + _, err = runCmd(fixture, buildModuleQueryCommandOptional, + "echo", + "1", + ) + assert.NilError(t, err) + + request = fixture.conn.lastRequest.(*testpb.EchoRequest) + assert.Equal(t, request.Positional2, "") + assert.DeepEqual(t, fixture.conn.lastRequest, fixture.conn.lastResponse.(*testpb.EchoResponse).Request, protocmp.Transform()) + + _, err = runCmd(fixture, buildModuleQueryCommandOptional, + "echo", + "1", + "abc", + "extra-arg", + ) + assert.ErrorContains(t, err, "accepts between 1 and 2 arg(s), received 3") + + _, err = runCmd(fixture, buildModuleVargasOptional, + "echo", + "1", + "abc", + "extra-arg", + ) + assert.ErrorContains(t, err, "optional positional argument positional2 must be the last argument") } func TestMap(t *testing.T) { - conn := testExecCommon(t, buildModuleQueryCommand, + fixture := initFixture(t) + + _, err := runCmd(fixture, buildModuleQueryCommand, "echo", "1", "abc", @@ -143,9 +299,10 @@ func TestMap(t *testing.T) { "--map-string-coin", "sec=100000bar", "--map-string-coin", "multi=100000bar,flag=100000foo", ) - assert.DeepEqual(t, conn.lastRequest, conn.lastResponse.(*testpb.EchoResponse).Request, protocmp.Transform()) + assert.NilError(t, err) + assert.DeepEqual(t, fixture.conn.lastRequest, fixture.conn.lastResponse.(*testpb.EchoResponse).Request, protocmp.Transform()) - conn = testExecCommon(t, buildModuleQueryCommand, + _, err = runCmd(fixture, buildModuleQueryCommand, "echo", "1", "abc", @@ -155,9 +312,9 @@ func TestMap(t *testing.T) { "--map-string-coin", "baz,100000foo", "--map-string-coin", "sec=100000bar", ) - assert.Equal(t, "Error: invalid argument \"baz,100000foo\" for \"--map-string-coin\" flag: invalid format, expected key=value\n", conn.errorOut.String()) + assert.ErrorContains(t, err, "invalid argument \"baz,100000foo\" for \"--map-string-coin\" flag: invalid format, expected key=value") - conn = testExecCommon(t, buildModuleQueryCommand, + _, err = runCmd(fixture, buildModuleQueryCommand, "echo", "1", "abc", @@ -167,9 +324,9 @@ func TestMap(t *testing.T) { "--map-string-coin", "baz=100000foo", "--map-string-coin", "sec=100000bar", ) - assert.Equal(t, "Error: invalid argument \"bar=not-unint32\" for \"--map-string-uint32\" flag: strconv.ParseUint: parsing \"not-unint32\": invalid syntax\n", conn.errorOut.String()) + assert.ErrorContains(t, err, "invalid argument \"bar=not-unint32\" for \"--map-string-uint32\" flag: strconv.ParseUint: parsing \"not-unint32\": invalid syntax") - conn = testExecCommon(t, buildModuleQueryCommand, + _, err = runCmd(fixture, buildModuleQueryCommand, "echo", "1", "abc", @@ -179,25 +336,15 @@ func TestMap(t *testing.T) { "--map-string-coin", "baz=100000foo", "--map-string-coin", "sec=100000bar", ) - assert.Equal(t, "Error: invalid argument \"bar=123.9\" for \"--map-string-uint32\" flag: strconv.ParseUint: parsing \"123.9\": invalid syntax\n", conn.errorOut.String()) -} - -func TestMapError(t *testing.T) { - conn := testExecCommon(t, buildModuleQueryCommand, - "echo", - "1", - "abc", - "1234foo", - "4321bar", - "--map-string-uint32", "bar=123", - "--map-string-coin", "baz=100000foo", - "--map-string-coin", "sec=100000bar", - ) - assert.DeepEqual(t, conn.lastRequest, conn.lastResponse.(*testpb.EchoResponse).Request, protocmp.Transform()) + assert.ErrorContains(t, err, "invalid argument \"bar=123.9\" for \"--map-string-uint32\" flag: strconv.ParseUint: parsing \"123.9\": invalid syntax") } +// TestEveything tests all the different types of flags are correctly read and as well as correctly returned +// This tests the flag binding and the message building func TestEverything(t *testing.T) { - conn := testExecCommon(t, buildModuleQueryCommand, + fixture := initFixture(t) + + _, err := runCmd(fixture, buildModuleQueryCommand, "echo", "1", "abc", @@ -215,6 +362,8 @@ func TestEverything(t *testing.T) { "--timestamp", "2019-01-02T00:01:02Z", "--a-coin", "100000foo", "--an-address", "cosmos1y74p8wyy4enfhfn342njve6cjmj5c8dtl6emdk", + "--a-validator-address", "cosmosvaloper1tnh2q55v8wyygtt9srz5safamzdengsn9dsd7z", + "--a-consensus-address", "cosmosvalcons16vm0nx49eam4q0xasdnwdzsdl6ymgyjt757sgr", "--bz", "c2RncXdlZndkZ3NkZw==", "--page-count-total", "--page-key", "MTIzNTQ4N3NnaGRhcw==", @@ -238,35 +387,119 @@ func TestEverything(t *testing.T) { "--uints", "1,2,3", "--uints", "4", ) - assert.DeepEqual(t, conn.lastRequest, conn.lastResponse.(*testpb.EchoResponse).Request, protocmp.Transform()) + assert.NilError(t, err) + + expectedResp := &testpb.EchoResponse{ + Request: &testpb.EchoRequest{ + Positional1: 1, + Positional2: "abc", + Positional3Varargs: []*basev1beta1.Coin{ + {Amount: "123.123123124", Denom: "foo"}, + {Amount: "4321", Denom: "bar"}, + }, + ABool: true, + AnEnum: testpb.Enum_ENUM_ONE, + AMessage: &testpb.AMessage{ + Bar: "abc", + Baz: -3, + }, + Duration: durationpb.New(4*time.Hour + 3*time.Second), + U32: 27, + U64: 3267246890, + I32: -253, + I64: -234602347, + Str: "def", + Timestamp: ×tamppb.Timestamp{ + Seconds: 1546387262, + }, + ACoin: &basev1beta1.Coin{ + Amount: "100000", + Denom: "foo", + }, + AnAddress: "cosmos1y74p8wyy4enfhfn342njve6cjmj5c8dtl6emdk", + AValidatorAddress: "cosmosvaloper1tnh2q55v8wyygtt9srz5safamzdengsn9dsd7z", + AConsensusAddress: "cosmosvalcons16vm0nx49eam4q0xasdnwdzsdl6ymgyjt757sgr", + Bz: []byte("sdgqwefwdgsdg"), + Page: &queryv1beta1.PageRequest{ + CountTotal: true, + Key: []byte("1235487sghdas"), + Limit: 1000, + Offset: 10, + Reverse: true, + }, + Bools: []bool{true, false, false, true}, + Enums: []testpb.Enum{testpb.Enum_ENUM_ONE, testpb.Enum_ENUM_FIVE, testpb.Enum_ENUM_TWO}, + Strings: []string{ + "abc", + "xyz", + "xyz", + "qrs", + }, + Durations: []*durationpb.Duration{ + durationpb.New(3 * time.Second), + durationpb.New(5 * time.Second), + durationpb.New(10 * time.Hour), + }, + SomeMessages: []*testpb.AMessage{ + {}, + {Bar: "baz"}, + {Baz: -1}, + }, + Uints: []uint32{1, 2, 3, 4}, + }, + } + + assert.DeepEqual(t, fixture.conn.lastRequest, fixture.conn.lastResponse.(*testpb.EchoResponse).Request, protocmp.Transform()) + assert.DeepEqual(t, fixture.conn.lastResponse.(*testpb.EchoResponse), expectedResp, protocmp.Transform()) +} + +func TestPubKeyParsingConsensusAddress(t *testing.T) { + fixture := initFixture(t) + + _, err := runCmd(fixture, buildModuleQueryCommand, + "echo", + "1", "abc", "1foo", + "--a-consensus-address", "{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"j8qdbR+AlH/V6aBTCSWXRvX3JUESF2bV+SEzndBhF0o=\"}", + "-u", "27", // shorthand + ) + assert.NilError(t, err) + assert.DeepEqual(t, fixture.conn.lastRequest, fixture.conn.lastResponse.(*testpb.EchoResponse).Request, protocmp.Transform()) } func TestJSONParsing(t *testing.T) { - conn := testExecCommon(t, buildModuleQueryCommand, + fixture := initFixture(t) + + _, err := runCmd(fixture, buildModuleQueryCommand, "echo", "1", "abc", "1foo", "--some-messages", `{"bar":"baz"}`, "-u", "27", // shorthand ) - assert.DeepEqual(t, conn.lastRequest, conn.lastResponse.(*testpb.EchoResponse).Request, protocmp.Transform()) + assert.NilError(t, err) + assert.DeepEqual(t, fixture.conn.lastRequest, fixture.conn.lastResponse.(*testpb.EchoResponse).Request, protocmp.Transform()) - conn = testExecCommon(t, buildModuleQueryCommand, + _, err = runCmd(fixture, buildModuleQueryCommand, "echo", "1", "abc", "1foo", "--some-messages", "testdata/some_message.json", "-u", "27", // shorthand ) - assert.DeepEqual(t, conn.lastRequest, conn.lastResponse.(*testpb.EchoResponse).Request, protocmp.Transform()) + assert.NilError(t, err) + assert.DeepEqual(t, fixture.conn.lastRequest, fixture.conn.lastResponse.(*testpb.EchoResponse).Request, protocmp.Transform()) } func TestOptions(t *testing.T) { - conn := testExecCommon(t, buildModuleQueryCommand, + fixture := initFixture(t) + + _, err := runCmd(fixture, buildModuleQueryCommand, "echo", "1", "abc", "123foo", "-u", "27", // shorthand "--u64", "5", // no opt default value ) - lastReq := conn.lastRequest.(*testpb.EchoRequest) + assert.NilError(t, err) + + lastReq := fixture.conn.lastRequest.(*testpb.EchoRequest) assert.Equal(t, uint32(27), lastReq.U32) // shorthand got set assert.Equal(t, int32(3), lastReq.I32) // default value got set assert.Equal(t, uint64(5), lastReq.U64) // no opt default value got set @@ -322,87 +555,104 @@ func TestBinaryFlag(t *testing.T) { } // Run test cases + fixture := initFixture(t) for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { - conn := testExecCommon(t, buildModuleQueryCommand, + _, err := runCmd(fixture, buildModuleQueryCommand, "echo", - "1", "abc", `{"denom":"foo","amount":"1"}`, + "1", "abc", `100foo`, "--bz", tc.input, ) - errorOut := conn.errorOut.String() - if errorOut == "" { - lastReq := conn.lastRequest.(*testpb.EchoRequest) - assert.DeepEqual(t, tc.expected, lastReq.Bz) + if tc.hasError { + assert.ErrorContains(t, err, tc.err) } else { - assert.Assert(t, strings.Contains(conn.errorOut.String(), tc.err)) + assert.NilError(t, err) + lastReq := fixture.conn.lastRequest.(*testpb.EchoRequest) + assert.DeepEqual(t, tc.expected, lastReq.Bz) } }) } } func TestAddressValidation(t *testing.T) { - conn := testExecCommon(t, buildModuleQueryCommand, + t.Skip() // TODO(@julienrbrt) re-able with better keyring instiantiation + + fixture := initFixture(t) + + _, err := runCmd(fixture, buildModuleQueryCommand, "echo", "1", "abc", "1foo", "--an-address", "cosmos1y74p8wyy4enfhfn342njve6cjmj5c8dtl6emdk", ) - assert.Equal(t, "", conn.errorOut.String()) + assert.NilError(t, err) - conn = testExecCommon(t, buildModuleQueryCommand, + _, err = runCmd(fixture, buildModuleQueryCommand, "echo", "1", "abc", "1foo", - "--an-address", "regen1y74p8wyy4enfhfn342njve6cjmj5c8dtl6emdk", + "--an-address", "regen1y74p8wyy4enfhfn342njve6cjmj5c8dtlqj7ule2", ) - assert.Assert(t, strings.Contains(conn.errorOut.String(), "Error: invalid argument")) + assert.ErrorContains(t, err, "invalid account address") - conn = testExecCommon(t, buildModuleQueryCommand, + _, err = runCmd(fixture, buildModuleQueryCommand, "echo", "1", "abc", "1foo", "--an-address", "cosmps1BAD_ENCODING", ) - assert.Assert(t, strings.Contains(conn.errorOut.String(), "Error: invalid argument")) + assert.ErrorContains(t, err, "invalid account address") } func TestOutputFormat(t *testing.T) { - conn := testExecCommon(t, buildModuleQueryCommand, + fixture := initFixture(t) + + out, err := runCmd(fixture, buildModuleQueryCommand, "echo", "1", "abc", "1foo", "--output", "json", ) - assert.Assert(t, strings.Contains(conn.out.String(), "{")) - conn = testExecCommon(t, buildModuleQueryCommand, + assert.NilError(t, err) + assert.Assert(t, strings.Contains(out.String(), "{")) + + out, err = runCmd(fixture, buildModuleQueryCommand, "echo", "1", "abc", "1foo", "--output", "text", ) - fmt.Println(conn.out.String()) - assert.Assert(t, strings.Contains(conn.out.String(), " positional1: 1")) + assert.NilError(t, err) + assert.Assert(t, strings.Contains(out.String(), " positional1: 1")) } -func TestHelp(t *testing.T) { - conn := testExecCommon(t, buildModuleQueryCommand, "-h") - golden.Assert(t, conn.out.String(), "help-toplevel.golden") +func TestHelpQuery(t *testing.T) { + fixture := initFixture(t) - conn = testExecCommon(t, buildModuleQueryCommand, "echo", "-h") - golden.Assert(t, conn.out.String(), "help-echo.golden") + out, err := runCmd(fixture, buildModuleQueryCommand, "-h") + assert.NilError(t, err) + golden.Assert(t, out.String(), "help-toplevel.golden") + + out, err = runCmd(fixture, buildModuleQueryCommand, "echo", "-h") + assert.NilError(t, err) + golden.Assert(t, out.String(), "help-echo.golden") - conn = testExecCommon(t, buildModuleQueryCommand, "deprecatedecho", "echo", "-h") - golden.Assert(t, conn.out.String(), "help-deprecated.golden") + out, err = runCmd(fixture, buildModuleQueryCommand, "deprecatedecho", "echo", "-h") + assert.NilError(t, err) + golden.Assert(t, out.String(), "help-deprecated.golden") - conn = testExecCommon(t, buildModuleQueryCommand, "skipecho", "-h") - golden.Assert(t, conn.out.String(), "help-skip.golden") + out, err = runCmd(fixture, buildModuleQueryCommand, "skipecho", "-h") + assert.NilError(t, err) + golden.Assert(t, out.String(), "help-skip.golden") } -func TestDeprecated(t *testing.T) { - conn := testExecCommon(t, buildModuleQueryCommand, "echo", - "1", "abc", `{}`, - "--deprecated-field", "foo") - assert.Assert(t, strings.Contains(conn.out.String(), "--deprecated-field has been deprecated")) +func TestDeprecatedQuery(t *testing.T) { + fixture := initFixture(t) - conn = testExecCommon(t, buildModuleQueryCommand, "echo", - "1", "abc", `{}`, - "-s", "foo") - assert.Assert(t, strings.Contains(conn.out.String(), "--shorthand-deprecated-field has been deprecated")) + out, err := runCmd(fixture, buildModuleQueryCommand, "echo", + "1", "abc", "--deprecated-field", "foo") + assert.NilError(t, err) + assert.Assert(t, strings.Contains(out.String(), "--deprecated-field has been deprecated")) + + out, err = runCmd(fixture, buildModuleQueryCommand, "echo", + "1", "abc", "-s", "foo") + assert.NilError(t, err) + assert.Assert(t, strings.Contains(out.String(), "--shorthand-deprecated-field has been deprecated")) } func TestBuildCustomQueryCommand(t *testing.T) { @@ -417,23 +667,25 @@ func TestBuildCustomQueryCommand(t *testing.T) { }, } - cmd, err := b.BuildQueryCommand(appOptions, map[string]*cobra.Command{ + cmd, err := b.BuildQueryCommand(context.Background(), appOptions, map[string]*cobra.Command{ "test": {Use: "test", Run: func(cmd *cobra.Command, args []string) { customCommandCalled = true }}, - }, enhanceQuery) + }) assert.NilError(t, err) cmd.SetArgs([]string{"test", "query"}) assert.NilError(t, cmd.Execute()) assert.Assert(t, customCommandCalled) } -func TestNotFoundErrors(t *testing.T) { - b := &Builder{} - - buildModuleQueryCommand := func(moduleName string, cmdDescriptor *autocliv1.ServiceCommandDescriptor) (*cobra.Command, error) { - cmd := topLevelCmd("query", "Querying subcommands") +func TestNotFoundErrorsQuery(t *testing.T) { + fixture := initFixture(t) + b := fixture.b + b.AddQueryConnFlags = nil + b.AddTxConnFlags = nil + buildModuleQueryCommand := func(_ string, cmdDescriptor *autocliv1.ServiceCommandDescriptor) (*cobra.Command, error) { + cmd := topLevelCmd(context.Background(), "query", "Querying subcommands") err := b.AddMsgServiceCommands(cmd, cmdDescriptor) return cmd, err } @@ -480,28 +732,10 @@ func TestNotFoundErrors(t *testing.T) { assert.ErrorContains(t, err, "can't find field baz") } -type testClientConn struct { - *grpc.ClientConn - t *testing.T - lastRequest interface{} - lastResponse interface{} - out *bytes.Buffer - errorOut *bytes.Buffer -} - -func (t *testClientConn) Invoke(ctx context.Context, method string, args, reply interface{}, opts ...grpc.CallOption) error { - err := t.ClientConn.Invoke(ctx, method, args, reply, opts...) - t.lastRequest = args - t.lastResponse = reply - return err -} - -type testEchoServer struct { - testpb.UnimplementedQueryServer -} +func TestDurationMarshal(t *testing.T) { + fixture := initFixture(t) -func (t testEchoServer) Echo(_ context.Context, request *testpb.EchoRequest) (*testpb.EchoResponse, error) { - return &testpb.EchoResponse{Request: request}, nil + out, err := runCmd(fixture, buildModuleQueryCommand, "echo", "1", "abc", "--duration", "1s") + assert.NilError(t, err) + assert.Assert(t, strings.Contains(out.String(), "duration: 1s")) } - -var _ testpb.QueryServer = testEchoServer{} diff --git a/client/v2/autocli/testdata/bank_example.yaml b/client/v2/autocli/testdata/bank_example.yaml deleted file mode 100644 index 6fb937482d28..000000000000 --- a/client/v2/autocli/testdata/bank_example.yaml +++ /dev/null @@ -1,28 +0,0 @@ -tx: - service: cosmos.bank.v1beta1.Msg - rpc_command_options: - - rpc_method: Send - use: send [from_key_or_address] [to_address] [amount...] - positional_args: - - proto_field: from_address - - proto_field: to_address - - proto_field: amount - varargs: true -query: - service: cosmos.bank.v1beta1.Query - rpc_command_options: - - rpc_method: Balance - use: balance [address] [denom] - positional_args: - - proto_field: address - - proto_field: denom - - rpc_method: SupplyOf - # this is a contrived example of how to customize flag options - # we would likely prefer positional args here, but this demonstrates usage - use: supply-of --denom [denom] - flag_options: - # flag_options is a map of proto field names to customization options - denom: - shorthand: d - usage: the denom to query - diff --git a/client/v2/autocli/testdata/help-deprecated-msg.golden b/client/v2/autocli/testdata/help-deprecated-msg.golden deleted file mode 100644 index 810a532a6036..000000000000 --- a/client/v2/autocli/testdata/help-deprecated-msg.golden +++ /dev/null @@ -1,63 +0,0 @@ -Command "send" is deprecated, dont use this -deprecated subcommand - -Usage: - test deprecatedmsg send [flags] - -Flags: - --a-bool - --a-coin cosmos.base.v1beta1.Coin - --a-message testpb.AMessage (json) - -a, --account-number uint The account number of the signing account (offline mode only) - --an-address bech32 account address key name - --an-enum Enum (unspecified | one | two | five | neg-three) (default unspecified) - --aux Generate aux signer data instead of sending a tx - --bools bools (default []) - -b, --broadcast-mode string Transaction broadcasting mode (sync|async) (default "sync") - --bz binary - --chain-id string The network chain ID - --deprecated-field string - --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) - --duration duration - --durations duration (repeated) - --enums Enum (unspecified | one | two | five | neg-three) (repeated) - --fee-granter string Fee granter grants fees for the transaction - --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer - --fees string Fees to pay along with transaction; eg: 10uatom - --from string Name or address of private key with which to sign - --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) - --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) - --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) - --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) - -h, --help help for send - --hidden-bool - --i32 int32 - --i64 int - --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) (default "os") - --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used - --ledger Use a connected Ledger device - --node string : to CometBFT rpc interface for this chain (default "tcp://localhost:26657") - --note string Note to add a description to the transaction (previously --memo) - --offline Offline mode (does not allow any online functionality) - -o, --output string Output format (text|json) (default "json") - --page-count-total - --page-key binary - --page-limit uint - --page-offset uint - --page-reverse - --positional1 int32 - --positional2 string - --positional3-varargs cosmos.base.v1beta1.Coin (repeated) - -s, --sequence uint The sequence number of the signing account (offline mode only) - --shorthand-deprecated-field string - --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature - --some-messages testpb.AMessage (json) (repeated) - --str string - --strings strings - --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height - --timestamp timestamp (RFC 3339) - --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator - --u32 uint32 - --u64 uint - --uints uints (default []) - -y, --yes Skip tx broadcasting prompt confirmation diff --git a/client/v2/autocli/testdata/help-deprecated.golden b/client/v2/autocli/testdata/help-deprecated.golden index c958a689f8dc..94586620952a 100644 --- a/client/v2/autocli/testdata/help-deprecated.golden +++ b/client/v2/autocli/testdata/help-deprecated.golden @@ -1,15 +1,20 @@ Command "echo" is deprecated, don't use this +Execute the Echo RPC method + Usage: test deprecatedecho echo [flags] Flags: --a-bool --a-coin cosmos.base.v1beta1.Coin + --a-consensus-address account address or key name --a-message testpb.AMessage (json) - --an-address bech32 account address key name + --a-validator-address account address or key name + --an-address account address or key name --an-enum Enum (unspecified | one | two | five | neg-three) (default unspecified) --bools bools (default []) --bz binary + --coins cosmos.base.v1beta1.Coin (repeated) --deprecated-field string --duration duration --durations duration (repeated) @@ -24,6 +29,7 @@ Flags: --map-string-coin map[string]cosmos.base.v1beta1.Coin --map-string-string stringToString (default []) --map-string-uint32 stringToUint32 + --no-indent Do not indent JSON output --node string : to CometBFT RPC interface for this chain (default "tcp://localhost:26657") -o, --output string Output format (text|json) (default "text") --page-count-total diff --git a/client/v2/autocli/testdata/help-echo-msg.golden b/client/v2/autocli/testdata/help-echo-msg.golden index b029bd2efe20..7bfc86445b56 100644 --- a/client/v2/autocli/testdata/help-echo-msg.golden +++ b/client/v2/autocli/testdata/help-echo-msg.golden @@ -1,65 +1,32 @@ -send msg the value provided by the user as a proto JSON object with populated with the provided fields and positional arguments +Send coins from one account to another Usage: - test send [pos1] [pos2] [pos3...] [flags] - -Aliases: - send, s - -Examples: -send 1 abc {} + test send [from_key_or_address] [to_address] [amount] [flags] Flags: - --a-bool - --a-coin cosmos.base.v1beta1.Coin - --a-message testpb.AMessage (json) - -a, --account-number uint The account number of the signing account (offline mode only) - --an-address bech32 account address key name - --an-enum Enum (unspecified | one | two | five | neg-three) (default unspecified) - --aux Generate aux signer data instead of sending a tx - --bools bools (default []) - -b, --broadcast-mode string Transaction broadcasting mode (sync|async) (default "sync") - --bz binary - --chain-id string The network chain ID - --deprecated-field string (DEPRECATED: don't use this) - --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) - --duration duration - --durations duration (repeated) - --enums Enum (unspecified | one | two | five | neg-three) (repeated) - --fee-granter string Fee granter grants fees for the transaction - --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer - --fees string Fees to pay along with transaction; eg: 10uatom - --from string Name or address of private key with which to sign - --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) - --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) - --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) - --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) - -h, --help help for send - --i32 int32 some random int32 - --i64 int - --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) (default "os") - --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used - --ledger Use a connected Ledger device - --node string : to CometBFT rpc interface for this chain (default "tcp://localhost:26657") - --note string Note to add a description to the transaction (previously --memo) - --offline Offline mode (does not allow any online functionality) - -o, --output string Output format (text|json) (default "json") - --page-count-total - --page-key binary - --page-limit uint - --page-offset uint - --page-reverse - -s, --sequence uint The sequence number of the signing account (offline mode only) - -d, --shorthand-deprecated-field string (DEPRECATED: bad idea) - --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature - --some-messages testpb.AMessage (json) (repeated) - --str string - --strings strings - --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height - --timestamp timestamp (RFC 3339) - --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator - --u64 uint some random uint64 - -u, --uint32 uint32 some random uint32 - --uints uints (default []) - -v, --version version for send - -y, --yes Skip tx broadcasting prompt confirmation + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async) (default "sync") + --chain-id string The network chain ID + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for send + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) (default "os") + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string : to CometBFT rpc interface for this chain (default "tcp://localhost:26657") + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) (default "json") + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux|textual), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation diff --git a/client/v2/autocli/testdata/help-echo.golden b/client/v2/autocli/testdata/help-echo.golden index 0be9c1de589c..2b3fe024a89c 100644 --- a/client/v2/autocli/testdata/help-echo.golden +++ b/client/v2/autocli/testdata/help-echo.golden @@ -12,11 +12,14 @@ echo 1 abc {} Flags: --a-bool --a-coin cosmos.base.v1beta1.Coin some random coin + --a-consensus-address account address or key name --a-message testpb.AMessage (json) - --an-address bech32 account address key name + --a-validator-address account address or key name + --an-address account address or key name --an-enum Enum (unspecified | one | two | five | neg-three) (default unspecified) --bools bools (default []) --bz binary some bytes + --coins cosmos.base.v1beta1.Coin (repeated) --deprecated-field string (DEPRECATED: don't use this) --duration duration some random duration --durations duration (repeated) @@ -30,6 +33,7 @@ Flags: --map-string-coin map[string]cosmos.base.v1beta1.Coin some map of string to coin --map-string-string stringToString some map of string to string (default []) --map-string-uint32 stringToUint32 some map of string to int32 + --no-indent Do not indent JSON output --node string : to CometBFT RPC interface for this chain (default "tcp://localhost:26657") -o, --output string Output format (text|json) (default "text") --page-count-total diff --git a/client/v2/autocli/testdata/help-toplevel-msg.golden b/client/v2/autocli/testdata/help-toplevel-msg.golden index 0eac1e006f1f..f4afbd999bb4 100644 --- a/client/v2/autocli/testdata/help-toplevel-msg.golden +++ b/client/v2/autocli/testdata/help-toplevel-msg.golden @@ -5,11 +5,13 @@ Usage: test [command] Available Commands: - completion Generate the autocompletion script for the specified shell - deprecatedmsg Tx commands for the testpb.Msg service - help Help about any command - send send msg the value provided by the user - skipmsg Tx commands for the testpb.Msg service + burn Execute the Burn RPC method + completion Generate the autocompletion script for the specified shell + help Help about any command + multi-send Execute the MultiSend RPC method + send Send coins from one account to another + set-send-enabled Execute the SetSendEnabled RPC method + update-params Execute the UpdateParams RPC method Flags: -h, --help help for test diff --git a/client/v2/autocli/testdata/help.golden b/client/v2/autocli/testdata/help.golden index 197f4f9aee91..c8fe6bbffb2a 100644 --- a/client/v2/autocli/testdata/help.golden +++ b/client/v2/autocli/testdata/help.golden @@ -10,30 +10,30 @@ Examples: echo 1 abc {} Flags: - --a-bool - --a-coin cosmos.base.v1beta1.Coin (json) - --a-message testpb.AMessage (json) - --an-address bech32 account address key name + --a-bool + --a-coin cosmos.base.v1beta1.Coin (json) + --a-message testpb.AMessage (json) + --an-address bech32 account address key name --an-enum Enum (unspecified | one | two | five | neg-three) (default unspecified) --bools bools (default []) - --bz bytesBase64 + --bz bytesBase64 --deprecated-field string (DEPRECATED: don't use this) - --duration duration - --durations duration (repeated) - --enums Enum (unspecified | one | two | five | neg-three) (repeated) + --duration duration + --durations duration (repeated) + --enums Enum (unspecified | one | two | five | neg-three) (repeated) -h, --help help for echo --i32 int32 some random int32 - --i64 int - --page-count-total - --page-key bytesBase64 - --page-limit uint - --page-offset uint - --page-reverse + --i64 int + --page-count-total + --page-key bytesBase64 + --page-limit uint + --page-offset uint + --page-reverse -s, --shorthand-deprecated-field string (DEPRECATED: bad idea) - --some-messages testpb.AMessage (json) (repeated) - --str string - --strings strings - --timestamp timestamp (RFC 3339) + --some-messages testpb.AMessage (json) (repeated) + --str string + --strings strings + --timestamp timestamp (RFC 3339) --u64 uint[=5] some random uint64 -u, --uint32 uint32 some random uint32 --uints uints (default []) diff --git a/client/v2/autocli/testdata/msg-output.golden b/client/v2/autocli/testdata/msg-output.golden new file mode 100644 index 000000000000..73bddd4ad8ae --- /dev/null +++ b/client/v2/autocli/testdata/msg-output.golden @@ -0,0 +1 @@ +{"body":{"messages":[{"@type":"/cosmos.bank.v1beta1.MsgSend","from_address":"cosmos1y74p8wyy4enfhfn342njve6cjmj5c8dtl6emdk","to_address":"cosmos1y74p8wyy4enfhfn342njve6cjmj5c8dtl6emdk","amount":[{"denom":"foo","amount":"1"}]}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""},"tip":null},"signatures":[]} diff --git a/client/v2/autocli/util.go b/client/v2/autocli/util.go index 8ca8c39a0fa3..96276543e7db 100644 --- a/client/v2/autocli/util.go +++ b/client/v2/autocli/util.go @@ -1,22 +1,30 @@ package autocli import ( + "context" "strings" + "github.com/spf13/cobra" "google.golang.org/protobuf/reflect/protoreflect" "cosmossdk.io/client/v2/internal/strcase" - "github.com/spf13/cobra" ) // findSubCommand finds a sub-command of the provided command whose Use // string is or begins with the provided subCmdName. +// It verifies the command's aliases as well. func findSubCommand(cmd *cobra.Command, subCmdName string) *cobra.Command { for _, subCmd := range cmd.Commands() { use := subCmd.Use if use == subCmdName || strings.HasPrefix(use, subCmdName+" ") { return subCmd } + + for _, alias := range subCmd.Aliases { + if alias == subCmdName || strings.HasPrefix(alias, subCmdName+" ") { + return subCmd + } + } } return nil } @@ -24,14 +32,17 @@ func findSubCommand(cmd *cobra.Command, subCmdName string) *cobra.Command { // topLevelCmd creates a new top-level command with the provided name and // description. The command will have DisableFlagParsing set to false and // SuggestionsMinimumDistance set to 2. -func topLevelCmd(use, short string) *cobra.Command { - return &cobra.Command{ +func topLevelCmd(ctx context.Context, use, short string) *cobra.Command { + cmd := &cobra.Command{ Use: use, Short: short, DisableFlagParsing: false, SuggestionsMinimumDistance: 2, RunE: validateCmd, } + cmd.SetContext(ctx) + + return cmd } func protoNameToCliName(name protoreflect.Name) string { diff --git a/client/v2/go.mod b/client/v2/go.mod index 536e0c287081..d743d216b7e7 100644 --- a/client/v2/go.mod +++ b/client/v2/go.mod @@ -1,130 +1,162 @@ module cosmossdk.io/client/v2 -go 1.20 +go 1.23.0 require ( - cosmossdk.io/api v0.4.2 - cosmossdk.io/core v0.8.0 - cosmossdk.io/depinject v1.0.0-alpha.3 - github.com/cockroachdb/errors v1.9.1 - github.com/cosmos/cosmos-proto v1.0.0-beta.3 - github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230606190835-3e18f4088b2c - github.com/spf13/cobra v1.7.0 - github.com/spf13/pflag v1.0.5 - golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 - google.golang.org/grpc v1.55.0 - google.golang.org/protobuf v1.30.0 - gotest.tools/v3 v3.4.0 - sigs.k8s.io/yaml v1.3.0 + cosmossdk.io/api v0.7.6 + cosmossdk.io/core v0.11.0 + cosmossdk.io/depinject v1.1.0 + cosmossdk.io/math v1.5.0 + cosmossdk.io/x/tx v0.13.8 + github.com/cockroachdb/errors v1.11.3 + github.com/cosmos/cosmos-proto v1.0.0-beta.5 + github.com/cosmos/cosmos-sdk v0.50.13 + github.com/spf13/cobra v1.9.1 + github.com/spf13/pflag v1.0.6 + github.com/stretchr/testify v1.10.0 + google.golang.org/grpc v1.71.0 + google.golang.org/protobuf v1.36.5 + gotest.tools/v3 v3.5.2 + sigs.k8s.io/yaml v1.4.0 ) require ( - cosmossdk.io/collections v0.1.0 // indirect - cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 // indirect - cosmossdk.io/log v1.1.0 // indirect - cosmossdk.io/math v1.0.1 // indirect - cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c // indirect - cosmossdk.io/x/tx v0.8.0 // indirect - filippo.io/edwards25519 v1.0.0 // indirect + cosmossdk.io/collections v0.4.0 // indirect + cosmossdk.io/errors v1.0.1 // indirect + cosmossdk.io/log v1.5.0 // indirect + cosmossdk.io/store v1.1.1 // indirect + filippo.io/edwards25519 v1.1.0 // 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/armon/go-metrics v0.4.1 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect - github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect + github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect + github.com/bytedance/sonic v1.12.3 // indirect + github.com/bytedance/sonic/loader v0.2.0 // indirect + github.com/cenkalti/backoff/v4 v4.1.3 // indirect github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/cloudwego/base64x v0.1.4 // indirect + github.com/cloudwego/iasm v0.2.0 // indirect + github.com/cockroachdb/apd/v3 v3.2.1 // indirect + github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20230606202032-d96868fd481e // indirect - github.com/cockroachdb/redact v1.1.4 // indirect - github.com/cometbft/cometbft v0.38.0-rc1 // indirect - github.com/cometbft/cometbft-db v0.7.0 // indirect + github.com/cockroachdb/pebble v1.1.2 // indirect + github.com/cockroachdb/redact v1.1.5 // indirect + github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect + github.com/cometbft/cometbft v0.38.12 // indirect + github.com/cometbft/cometbft-db v0.11.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect - github.com/cosmos/cosmos-db v1.0.0 // indirect + github.com/cosmos/cosmos-db v1.1.1 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect - github.com/cosmos/gogoproto v1.4.10 // indirect - github.com/cosmos/iavl v1.0.0-beta.2 // indirect - github.com/cosmos/ics23/go v0.10.0 // indirect - github.com/cosmos/ledger-cosmos-go v0.13.0 // indirect + github.com/cosmos/gogogateway v1.2.0 // indirect + github.com/cosmos/gogoproto v1.7.0 // indirect + github.com/cosmos/iavl v1.2.2 // indirect + github.com/cosmos/ics23/go v0.11.0 // indirect + github.com/cosmos/ledger-cosmos-go v0.14.0 // indirect github.com/danieljoos/wincred v1.1.2 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect 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/dvsekhvalnov/jose2go v1.5.0 // indirect - github.com/emicklei/dot v1.4.2 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/getsentry/sentry-go v0.21.0 // indirect + github.com/dvsekhvalnov/jose2go v1.6.0 // indirect + github.com/emicklei/dot v1.6.2 // indirect + github.com/fatih/color v1.15.0 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect + github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.12.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect + github.com/gogo/googleapis v1.4.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/glog v1.1.0 // indirect - github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/glog v1.2.4 // indirect + github.com/golang/mock v1.6.0 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.4 // indirect - github.com/google/btree v1.1.2 // indirect - github.com/google/go-cmp v0.5.9 // indirect - github.com/gorilla/websocket v1.5.0 // indirect + github.com/google/btree v1.1.3 // indirect + github.com/google/go-cmp v0.6.0 // indirect + github.com/google/orderedcode v0.0.1 // indirect + github.com/gorilla/handlers v1.5.1 // indirect + github.com/gorilla/mux v1.8.0 // indirect + github.com/gorilla/websocket v1.5.3 // indirect + github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect + github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect - github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/go-metrics v0.5.3 // indirect + github.com/hashicorp/go-plugin v1.5.2 // indirect + github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect + github.com/hashicorp/yamux v0.1.1 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect - github.com/iancoleman/strcase v0.2.0 // indirect + github.com/huandu/skiplist v1.2.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/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.16.5 // indirect + github.com/klauspost/compress v1.17.9 // indirect + github.com/klauspost/cpuid/v2 v2.0.9 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect - github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.0 // indirect - github.com/magiconair/properties v1.8.7 // indirect + github.com/lib/pq v1.10.7 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.19 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/minio/highwayhash v1.0.2 // indirect + github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mtibben/percent v0.2.1 // indirect - github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce // indirect - github.com/pelletier/go-toml/v2 v2.0.8 // indirect - github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect + github.com/oklog/run v1.1.0 // indirect + github.com/pelletier/go-toml/v2 v2.2.3 // indirect + github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.15.1 // indirect - github.com/prometheus/client_model v0.4.0 // indirect - github.com/prometheus/common v0.44.0 // indirect - github.com/prometheus/procfs v0.10.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/prometheus/client_golang v1.20.1 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.55.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.10.0 // indirect - github.com/rs/zerolog v1.29.1 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect + github.com/rs/cors v1.11.1 // indirect + github.com/rs/zerolog v1.33.0 // indirect + github.com/sagikazarmark/locafero v0.7.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect - github.com/spf13/afero v1.9.5 // indirect - github.com/spf13/cast v1.5.1 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/spf13/viper v1.16.0 // indirect - github.com/stretchr/testify v1.8.4 // indirect - github.com/subosito/gotenv v1.4.2 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.12.0 // indirect + github.com/spf13/cast v1.7.1 // indirect + github.com/spf13/viper v1.20.0 // indirect + github.com/subosito/gotenv v1.6.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect - github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect github.com/tendermint/go-amino v0.16.0 // indirect - github.com/tidwall/btree v1.6.0 // indirect - github.com/zondax/hid v0.9.1 // indirect - github.com/zondax/ledger-go v0.14.1 // indirect - go.etcd.io/bbolt v1.3.6 // indirect - golang.org/x/crypto v0.9.0 // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/term v0.8.0 // indirect - golang.org/x/text v0.9.0 // indirect - google.golang.org/genproto v0.0.0-20230525234025-438c736192d0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect - gopkg.in/ini.v1 v1.67.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect + github.com/tidwall/btree v1.7.0 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + github.com/zondax/hid v0.9.2 // indirect + github.com/zondax/ledger-go v0.14.3 // indirect + go.etcd.io/bbolt v1.3.10 // indirect + go.uber.org/multierr v1.10.0 // indirect + golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect + golang.org/x/crypto v0.35.0 // indirect + golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 // indirect + golang.org/x/net v0.35.0 // indirect + golang.org/x/sync v0.11.0 // indirect + golang.org/x/sys v0.30.0 // indirect + golang.org/x/term v0.29.0 // indirect + golang.org/x/text v0.22.0 // indirect + golang.org/x/tools v0.22.0 // indirect + google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20250106144421-5f5ef82da422 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - pgregory.net/rapid v0.6.2 // indirect + nhooyr.io/websocket v1.8.6 // indirect + pgregory.net/rapid v1.1.0 // indirect ) diff --git a/client/v2/go.sum b/client/v2/go.sum index abecbe5339c2..65300e8b5ab3 100644 --- a/client/v2/go.sum +++ b/client/v2/go.sum @@ -1,272 +1,321 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= -cosmossdk.io/api v0.4.2 h1:lQBMl4xINnMnBOR/tQLtjlDnR4exr4e6/SfHR8PILE0= -cosmossdk.io/api v0.4.2/go.mod h1:qrVgOp7DIeAXa+Tt5dDjOC47bZCDrwx8ZHxrmy7STNE= -cosmossdk.io/collections v0.1.0 h1:nzJGeiq32KnZroSrhB6rPifw4I85Cgmzw/YAmr4luv8= -cosmossdk.io/collections v0.1.0/go.mod h1:xbauc0YsbUF8qKMVeBZl0pFCunxBIhKN/WlxpZ3lBuo= -cosmossdk.io/core v0.8.0 h1:LcJnu52E1a8f8E317VfQ1xK/RZe+IuhMNQAjnDLh25M= -cosmossdk.io/core v0.8.0/go.mod h1:LF6VLOv2DdCiaHxYVmr0MZcZpaSM9ZgvyrQSYTeg6D0= -cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw= -cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= -cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 h1:BCRz06fvddw7cKGiEGDiSox3qMsjQ97f92K+PDZDHdc= -cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741/go.mod h1:TB05o6YXkZkzsc+6bZFAV5kZRBtoCU9tUkbeMIqEg0w= -cosmossdk.io/log v1.1.0 h1:v0ogPHYeTzPcBTcPR1A3j1hkei4pZama8kz8LKlCMv0= -cosmossdk.io/log v1.1.0/go.mod h1:6zjroETlcDs+mm62gd8Ig7mZ+N+fVOZS91V17H+M4N4= -cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= -cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= -cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c h1:A+FMPW9GtfcPBDQNtFeDFN27h1SAP6OVjnGgPLlYXmI= -cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c/go.mod h1:RbYGvXCbz8uNBCXrwS9Z8SyydeWi+W5x5MZ33muyzMw= -cosmossdk.io/x/tx v0.8.0 h1:gLiGRL/Fy7fs6dd0IX8jOf0PrVr56/SG6XVMGQjyvJU= -cosmossdk.io/x/tx v0.8.0/go.mod h1:T9uEumGNgKU61gJYRv1t3uzQwLnASpJGmSE229HM3xA= +cosmossdk.io/api v0.7.6 h1:PC20PcXy1xYKH2KU4RMurVoFjjKkCgYRbVAD4PdqUuY= +cosmossdk.io/api v0.7.6/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= +cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= +cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= +cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= +cosmossdk.io/depinject v1.1.0 h1:wLan7LG35VM7Yo6ov0jId3RHWCGRhe8E8bsuARorl5E= +cosmossdk.io/depinject v1.1.0/go.mod h1:kkI5H9jCGHeKeYWXTqYdruogYrEeWvBQCw1Pj4/eCFI= +cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= +cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= +cosmossdk.io/log v1.5.0 h1:dVdzPJW9kMrnAYyMf1duqacoidB9uZIl+7c6z0mnq0g= +cosmossdk.io/log v1.5.0/go.mod h1:Tr46PUJjiUthlwQ+hxYtUtPn4D/oCZXAkYevBeh5+FI= +cosmossdk.io/math v1.5.0 h1:sbOASxee9Zxdjd6OkzogvBZ25/hP929vdcYcBJQbkLc= +cosmossdk.io/math v1.5.0/go.mod h1:AAwwBmUhqtk2nlku174JwSll+/DepUXW3rWIXN5q+Nw= +cosmossdk.io/store v1.1.1 h1:NA3PioJtWDVU7cHHeyvdva5J/ggyLDkyH0hGHl2804Y= +cosmossdk.io/store v1.1.1/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM= +cosmossdk.io/x/tx v0.13.8 h1:dQwC8jMe7awx/edi1HPPZ40AjHnsix6KSO/jbKMUYKk= +cosmossdk.io/x/tx v0.13.8/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= -filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= +filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= +filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= 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/99designs/keyring v1.2.1 h1:tYLp1ULvO7i3fI5vE21ReQuj99QFSs7lGm0xWyJo87o= github.com/99designs/keyring v1.2.1/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= -github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= -github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= +github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= -github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= +github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= +github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= +github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= +github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= -github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= -github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c= +github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= +github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= +github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV9fHg= +github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= -github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= -github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= +github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= +github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= -github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= -github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= +github.com/bits-and-blooms/bitset v1.8.0 h1:FD+XqgOZDUxxZ8hzoBFuV9+cGWY9CslN6d5MS5JVb4c= +github.com/bits-and-blooms/bitset v1.8.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= +github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= +github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/btcutil v1.1.6 h1:zFL2+c3Lb9gEgqKNzowKUPQNb8jV7v5Oaodi/AYFd6c= +github.com/btcsuite/btcd/btcutil v1.1.6/go.mod h1:9dFymx8HpuLqBnsPELrImQeTQfKBQqzqGbbV3jK55aE= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= +github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= +github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY= +github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE= +github.com/bytedance/sonic v1.12.3 h1:W2MGa7RCU1QTeYRTPE3+88mVC0yXmsRQRChiyVocVjU= +github.com/bytedance/sonic v1.12.3/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= +github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= +github.com/bytedance/sonic/loader v0.2.0 h1:zNprn+lsIP06C/IqCHs3gPQIvnvpKbbxyXQP1iU4kWM= +github.com/bytedance/sonic/loader v0.2.0/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= +github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= 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= github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= +github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -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/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI= +github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= +github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/0Y= +github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= +github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg= +github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= -github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= +github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= +github.com/cockroachdb/apd/v3 v3.2.1 h1:U+8j7t0axsIgvQUqthuNm82HIrYXodOV2iWLWtEaIwg= +github.com/cockroachdb/apd/v3 v3.2.1/go.mod h1:klXJcjp+FffLTHlhIG69tezTDvdP065naDsHzKhYSqc= +github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= -github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= -github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= +github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce h1:giXvy4KSc/6g/esnpM7Geqxka4WSqI1SZc7sMJFd3y4= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/pebble v0.0.0-20230606202032-d96868fd481e h1:6QuLTQCQZueVNzoYYUuFfaRgBOpj6gIwQA1PZT2rfWM= -github.com/cockroachdb/pebble v0.0.0-20230606202032-d96868fd481e/go.mod h1:TkdVsGYRqtULUppt2RbC+YaKtTHnHoWa2apfFrSKABw= -github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/cockroachdb/redact v1.1.4 h1:Y0XrVI2FAyofNyGveodTN//qdpPtFKcKTeCBsK3AHAQ= -github.com/cockroachdb/redact v1.1.4/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= -github.com/cometbft/cometbft v0.38.0-rc1 h1:ph6smlqX82aH+d72KuxDHqu29M7LyusSp/obfGsGX/w= -github.com/cometbft/cometbft v0.38.0-rc1/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= -github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= -github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= +github.com/cockroachdb/pebble v1.1.2 h1:CUh2IPtR4swHlEj48Rhfzw6l/d0qA31fItcIszQVIsA= +github.com/cockroachdb/pebble v1.1.2/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= +github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= +github.com/cometbft/cometbft v0.38.12 h1:OWsLZN2KcSSFe8bet9xCn07VwhBnavPea3VyPnNq1bg= +github.com/cometbft/cometbft v0.38.12/go.mod h1:GPHp3/pehPqgX1930HmK1BpBLZPxB75v/dZg8Viwy+o= +github.com/cometbft/cometbft-db v0.11.0 h1:M3Lscmpogx5NTbb1EGyGDaFRdsoLWrUWimFEyf7jej8= +github.com/cometbft/cometbft-db v0.11.0/go.mod h1:GDPJAC/iFHNjmZZPN8V8C1yr/eyityhi2W1hz2MGKSc= +github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= +github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= -github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0E= -github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= -github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= -github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230606190835-3e18f4088b2c h1:KTJHQdxejm4kRSS42LHzChCqMq/T8pOb5yxX9KBCMTU= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230606190835-3e18f4088b2c/go.mod h1:rDJWzXPqx4zgC0OGcdMdQQlfgu7iR68UFuMfoUEWJhU= +github.com/cosmos/cosmos-db v1.1.1 h1:FezFSU37AlBC8S98NlSagL76oqBRWq/prTPvFcEJNCM= +github.com/cosmos/cosmos-db v1.1.1/go.mod h1:AghjcIPqdhSLP/2Z0yha5xPH3nLnskz81pBx3tcVSAw= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= +github.com/cosmos/cosmos-sdk v0.50.13 h1:xQ32hhzVy7agEe7behMdZN0ezWhPss3KoLZsF9KoBnw= +github.com/cosmos/cosmos-sdk v0.50.13/go.mod h1:hrWEFMU1eoXqLJeE6VVESpJDQH67FS1nnMrQIjO2daw= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= -github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoKuI= -github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= -github.com/cosmos/iavl v1.0.0-beta.2 h1:XOsIM80Yyml/KifCXEYOy9tWCXwMAbLa91n6pReW07Y= -github.com/cosmos/iavl v1.0.0-beta.2/go.mod h1:EA97dJ07TBktRlG/iGzK6g1eCXNj1q3MGoFYkVzrwHE= -github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= -github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= -github.com/cosmos/ledger-cosmos-go v0.13.0 h1:ex0CvCxToSR7j5WjrghPu2Bu9sSXKikjnVvUryNnx4s= -github.com/cosmos/ledger-cosmos-go v0.13.0/go.mod h1:ZcqYgnfNJ6lAXe4HPtWgarNEY+B74i+2/8MhZw4ziiI= +github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= +github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= +github.com/cosmos/iavl v1.2.2 h1:qHhKW3I70w+04g5KdsdVSHRbFLgt3yY3qTMd4Xa4rC8= +github.com/cosmos/iavl v1.2.2/go.mod h1:GiM43q0pB+uG53mLxLDzimxM9l/5N9UuSY3/D0huuVw= +github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= +github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= +github.com/cosmos/ledger-cosmos-go v0.14.0 h1:WfCHricT3rPbkPSVKRH+L4fQGKYHuGOK9Edpel8TYpE= +github.com/cosmos/ledger-cosmos-go v0.14.0/go.mod h1:E07xCWSBl3mTGofZ2QnL4cIUzMbbGVyik84QYKbX3RA= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= -github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= +github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= -github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= +github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= +github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +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/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= 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/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= -github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= -github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= -github.com/emicklei/dot v1.4.2 h1:UbK6gX4yvrpHKlxuUQicwoAis4zl8Dzwit9SnbBAXWw= -github.com/emicklei/dot v1.4.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= +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/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/emicklei/dot v1.6.2 h1:08GN+DD79cy/tzN6uLCT84+2Wk9u+wvqP+Hkx/dIR8A= +github.com/emicklei/dot v1.6.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= +github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= -github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= -github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= -github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= -github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= +github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= +github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= -github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= +github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= +github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= -github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= -github.com/getsentry/sentry-go v0.21.0 h1:c9l5F1nPF30JIppulk4veau90PK6Smu3abgVtVQWon4= -github.com/getsentry/sentry-go v0.21.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= +github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= +github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= -github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= -github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= +github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= +github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= +github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= +github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= +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-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= +github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= +github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= +github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= +github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= +github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= +github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= +github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= +github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= +github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= +github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= -github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= +github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= +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.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +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/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= -github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= -github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= +github.com/golang/glog v1.2.4 h1:CNNw5U8lSiiBk7druxtSHHTsRWcxKoac6kZKm2peBBc= +github.com/golang/glog v1.2.4/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= +github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= @@ -278,207 +327,277 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -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/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= +github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 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= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= +github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= +github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= +github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= 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/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= +github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= +github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-plugin v1.4.10 h1:xUbmA4jC6Dq163/fWcp8P3JuHilrHHMLNRxzGQJ9hNk= +github.com/hashicorp/go-metrics v0.5.3 h1:M5uADWMOGCTUNU1YuC4hfknOeHNaX54LDm4oYSucoNE= +github.com/hashicorp/go-metrics v0.5.3/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-plugin v1.5.2 h1:aWv8eimFqWlsEiMrYZdPYl+FdHaBJSN4AWwGWfT1G2Y= +github.com/hashicorp/go-plugin v1.5.2/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= +github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= 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/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= github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw= -github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= -github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= -github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= +github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= +github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= +github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= -github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= -github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= -github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= -github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= +github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/jhump/protoreflect v1.15.3 h1:6SFRuqU45u9hIZPJAoZ8c28T3nK64BNdp9w6jFonzls= +github.com/jhump/protoreflect v1.15.3/go.mod h1:4ORHmSBmlCW8fh3xHmJMGyul1zNqZK4Elxc8qKP+p1k= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= -github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= -github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= -github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= -github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +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/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI= -github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= 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.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= +github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= -github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= -github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= -github.com/linxGnu/grocksdb v1.8.0 h1:H4L/LhP7GOMf1j17oQAElHgVlbEje2h14A8Tz9cM2BE= -github.com/linxGnu/grocksdb v1.8.0/go.mod h1:09CeBborffXhXdNpEcOeZrLKEnRtrZFEpFdPNI9Zjjg= +github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= +github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= +github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= +github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= 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= -github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= +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-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= -github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= +github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= 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/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/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= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= 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/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/grpc-proxy v0.0.0-20181017164139-0f1106ef9c76/go.mod h1:x5OoJHDHqxHS801UIuhqGl6QdSAEJvtausosHSdazIo= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= +github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= +github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce h1:/pEpMk55wH0X+E5zedGEMOdLuWmV8P4+4W3+LZaM6kg= -github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a h1:dlRvE5fWabOchtH7znfiFCcOvmIYgOeAS5ifBXBlh9Q= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= +github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= +github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= +github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= +github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/onsi/gomega v1.26.0 h1:03cDLK28U6hWvCAns6NeydX3zIm4SF3ci69ulidS32Q= +github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= +github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= +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-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= +github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= +github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= +github.com/opencontainers/runc v1.1.3/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= +github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= +github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= +github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= +github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= +github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= +github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= +github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= -github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= +github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= +github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= +github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761 h1:W04oB3d0J01W5jgYRGKsV8LCM6g9EkCvPkZcmFuy0OE= -github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= @@ -486,81 +605,112 @@ github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= -github.com/prometheus/client_golang v1.15.1 h1:8tXpTmJbyH5lydzFPoxSIJ0J46jdh3tylbvM1xCv0LI= -github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.20.1 h1:IMJXHOD6eARkQpxo8KkhgEVFlBNm+nkrFUyGlIu7Na8= +github.com/prometheus/client_golang v1.20.1/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= -github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= +github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= -github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= -github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= +github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= +github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= -github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= 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/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= -github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= -github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= -github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.29.1 h1:cO+d60CHkknCbvzEWxP0S9K6KqyTjrCNUy1LdQLCGPc= -github.com/rs/zerolog v1.29.1/go.mod h1:Le6ESbR7hc+DP6Lt1THiV8CQSdkkNrd3R0XbEgp3ZBU= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= +github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= +github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/locafero v0.7.0 h1:5MqpDsTGNDhY8sGp0Aowyf0qKsPrhewaLSsFaodPcyo= +github.com/sagikazarmark/locafero v0.7.0/go.mod h1:2za3Cg5rMaTMoG/2Ulr9AwtFaIppKXTRYnozin4aB5k= +github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= 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/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= +github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= -github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= +github.com/spf13/afero v1.12.0 h1:UcOPyRBYczmFn6yvphxkn9ZEOY65cpwGKb5mL36mrqs= +github.com/spf13/afero v1.12.0/go.mod h1:ZTlWwG4/ahT8W7T0WQ5uYmjI9duaLQGy3Q2OAl4sk/4= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= -github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= +github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= +github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo= +github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= +github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= -github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= +github.com/spf13/viper v1.20.0 h1:zrxIyR3RQIOsarIrgL8+sAvALXul9jeEPa06Y0Ph6vY= +github.com/spf13/viper v1.20.0/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4= +github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -570,412 +720,287 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= -github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +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.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= -github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= +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/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= +github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= +github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= +github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= +github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= -github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= -github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= -github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= -github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= -github.com/zondax/ledger-go v0.14.1 h1:Pip65OOl4iJ84WTpA4BKChvOufMhhbxED3BaihoZN4c= -github.com/zondax/ledger-go v0.14.1/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2feOQv8K320= -go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= -go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= +github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= +github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= +github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= +go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/bbolt v1.3.10 h1:+BqfJTcCzTItrop8mq/lbzL8wSGtj94UO/3U31shqG0= +go.etcd.io/bbolt v1.3.10/go.mod h1:bK3UQLPJZly7IlNmV7uVHJDxfe5aK9Ll93e/74Y9oEQ= +go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= +go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= +go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= +go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY= +go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI= +go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ= +go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE= +go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A= +go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU= +go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk= +go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w= +go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k= +go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= +go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670 h1:18EFjUmQOcUvxNYSkA6jO9VAiXCnxFY6NyDX0bHDmkU= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= -golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= +golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs= +golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 h1:985EYyeCOxTpcgOTJpflJUwOeEz0CQOdPt73OzpE9F8= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +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/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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= +golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= 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= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= +golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= +golang.org/x/sync v0.11.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-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 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-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= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/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-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220315194320-039c03cc5b86/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= +golang.org/x/sys v0.30.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.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU= +golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s= 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= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -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/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= +golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= +golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/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-20181221001348-537d06c36207/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-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +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/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= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -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-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20230525234025-438c736192d0 h1:x1vNwUhVOcsYoKyEGCZBH694SBmmBjA2EfauFVEI2+M= -google.golang.org/genproto v0.0.0-20230525234025-438c736192d0/go.mod h1:9ExIQyXL5hZrHzQceCwuSYwZZ5QZBazOcprJ5rgs3lY= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a h1:HiYVD+FGJkTo+9zj1gqz0anapsa1JxjiSrN+BJKyUmE= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a/go.mod h1:ts19tUU+Z0ZShN1y3aPyq2+O3d5FUNNgT6FtOzmrNn8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= +google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 h1:ToEetK57OidYuqD4Q5w+vfEnPvPpuTwedCNVohYJfNk= +google.golang.org/genproto v0.0.0-20241118233622-e639e219e697/go.mod h1:JJrvXBWRZaFMxBufik1a4RpFw4HhgVtBBWQeQgUj2cc= +google.golang.org/genproto/googleapis/api v0.0.0-20250106144421-5f5ef82da422 h1:GVIKPyP/kLIyVOgOnTwFOrvQaQUzOzGMCxgFUOEmm24= +google.golang.org/genproto/googleapis/api v0.0.0-20250106144421-5f5ef82da422/go.mod h1:b6h1vNKhxaSoEI+5jc3PJUCustfli/mRab7295pY7rw= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f h1:OxYkA3wjPsZyBylwymxSHa7ViiW1Sml4ToBrncvFehI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f/go.mod h1:+2Yz8+CLJbIfL9z73EW45avw8Lmge3xVElCP9zEKi50= +google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= +google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg= +google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -988,51 +1013,51 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= +google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 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.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= 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/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= -gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -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/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= +gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 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= -gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= -gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= +gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q= +gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA= +honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -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= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= -pgregory.net/rapid v0.6.2 h1:ErW5sL+UKtfBfUTsWHDCoeB+eZKLKMxrSd1VJY6W4bw= -pgregory.net/rapid v0.6.2/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= +nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= +pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= +pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= +sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= +sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/client/v2/helpers/home.go b/client/v2/helpers/home.go new file mode 100644 index 000000000000..af3fc2886673 --- /dev/null +++ b/client/v2/helpers/home.go @@ -0,0 +1,48 @@ +package helpers + +import ( + "os" + "path/filepath" + "strings" +) + +// EnvPrefix is the prefix for environment variables that are used by the CLI. +// It should match the one used for viper in the CLI. +var EnvPrefix = "" + +// GetNodeHomeDirectory gets the home directory of the node (where the config is located). +// It parses the home flag if set if the `(PREFIX)_HOME` environment variable if set (and ignores name). +// When no prefix is set, it reads the `NODE_HOME` environment variable. +// Otherwise, it returns the default home directory given its name. +func GetNodeHomeDirectory(name string) (string, error) { + // get the home directory from the flag + args := os.Args + for i := 0; i < len(args); i++ { + if args[i] == "--home" && i+1 < len(args) { + return filepath.Clean(args[i+1]), nil + } else if strings.HasPrefix(args[i], "--home=") { + return filepath.Clean(args[i][7:]), nil + } + } + + // get the home directory from the environment variable + // to not clash with the $HOME system variable, when no prefix is set + // we check the NODE_HOME environment variable + homeDir, envHome := "", "HOME" + if len(EnvPrefix) > 0 { + homeDir = os.Getenv(EnvPrefix + "_" + envHome) + } else { + homeDir = os.Getenv("NODE_" + envHome) + } + if homeDir != "" { + return filepath.Clean(homeDir), nil + } + + // get user home directory + userHomeDir, err := os.UserHomeDir() + if err != nil { + return "", err + } + + return filepath.Join(userHomeDir, name), nil +} diff --git a/client/v2/internal/buf.lock b/client/v2/internal/buf.lock index 696956596bf8..ca09fbb4fad6 100644 --- a/client/v2/internal/buf.lock +++ b/client/v2/internal/buf.lock @@ -4,16 +4,30 @@ deps: - remote: buf.build owner: cosmos repository: cosmos-proto - commit: 1935555c206d4afb9e94615dfd0fad31 + commit: 04467658e59e44bbb22fe568206e1f70 + digest: shake256:73a640bd60e0c523b0f8237ff34eab67c45a38b64bbbde1d80224819d272dbf316ac183526bd245f994af6608b025f5130483d0133c5edd385531326b5990466 - remote: buf.build owner: cosmos repository: cosmos-sdk - commit: b7797ff7f3814399b0c5d52e1b8227ed + commit: 05419252bcc241ea8023acf1ed4cadc5 + digest: shake256:1e54a48c19a8b59d35e0a7efa76402939f515f2d8005df099856f24c37c20a52800308f025abb8cffcd014d437b49707388aaca4865d9d063d8f25d5d4eb77d5 - remote: buf.build owner: cosmos repository: gogo-proto - commit: 6652e3443c3b4504bb3bf82e73a7e409 + commit: 88ef6483f90f478fb938c37dde52ece3 + digest: shake256:89c45df2aa11e0cff97b0d695436713db3d993d76792e9f8dc1ae90e6ab9a9bec55503d48ceedd6b86069ab07d3041b32001b2bfe0227fa725dd515ff381e5ba - remote: buf.build owner: googleapis repository: googleapis - commit: 62f35d8aed1149c291d606d958a7ce32 + commit: 7e6f6e774e29406da95bd61cdcdbc8bc + digest: shake256:fe43dd2265ea0c07d76bd925eeba612667cf4c948d2ce53d6e367e1b4b3cb5fa69a51e6acb1a6a50d32f894f054a35e6c0406f6808a483f2752e10c866ffbf73 + - remote: buf.build + owner: protocolbuffers + repository: wellknowntypes + commit: 657250e6a39648cbb169d079a60bd9ba + digest: shake256:00de25001b8dd2e29d85fc4bcc3ede7aed886d76d67f5e0f7a9b320b90f871d3eb73507d50818d823a0512f3f8db77a11c043685528403e31ff3fef18323a9fb + - remote: buf.build + owner: tendermint + repository: tendermint + commit: 33ed361a90514289beabf3189e1d7665 + digest: shake256:038267e06294714fd883610626554b04a127b576b4e253befb4206cb72d5d3c1eeccacd4b9ec8e3fb891f7c14e1cb0f770c077d2989638995b0a61c85afedb1d diff --git a/client/v2/internal/coins/format.go b/client/v2/internal/coins/format.go new file mode 100644 index 000000000000..b3ca0866a83d --- /dev/null +++ b/client/v2/internal/coins/format.go @@ -0,0 +1,62 @@ +package coins + +import ( + "errors" + "regexp" + "strings" + + basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" +) + +// Amount can be a whole number or a decimal number. Denominations can be 3 ~ 128 +// characters long and support letters, followed by either a letter, a number or +// a separator ('/', ':', '.', '_' or '-'). +var coinRegex = regexp.MustCompile(`^(\d+(\.\d+)?)([a-zA-Z][a-zA-Z0-9\/\:\._\-]{2,127})$`) + +// ParseCoin parses a coin from a string. The string must be in the format +// , where is a number and is a valid denom. +func ParseCoin(input string) (*basev1beta1.Coin, error) { + amount, denom, err := parseCoin(input) + if err != nil { + return nil, err + } + + return &basev1beta1.Coin{ + Amount: amount, + Denom: denom, + }, nil +} + +// ParseDecCoin parses a decCoin from a string. The string must be in the format +// , where is a number and is a valid denom. +func ParseDecCoin(input string) (*basev1beta1.DecCoin, error) { + amount, denom, err := parseCoin(input) + if err != nil { + return nil, err + } + + return &basev1beta1.DecCoin{ + Amount: amount, + Denom: denom, + }, nil +} + +// parseCoin parses a coin string into its amount and denom components. +// The input string must be in the format . +// It returns the amount string, denom string, and any error encountered. +// Returns an error if the input is empty or doesn't match the expected format. +func parseCoin(input string) (amount, denom string, err error) { + input = strings.TrimSpace(input) + + if input == "" { + return "", "", errors.New("empty input when parsing coin") + } + + matches := coinRegex.FindStringSubmatch(input) + + if len(matches) == 0 { + return "", "", errors.New("invalid input format") + } + + return matches[1], matches[3], nil +} diff --git a/client/v2/internal/coins/format_test.go b/client/v2/internal/coins/format_test.go new file mode 100644 index 000000000000..a5c42ac1ed11 --- /dev/null +++ b/client/v2/internal/coins/format_test.go @@ -0,0 +1,73 @@ +package coins + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func Test_parseCoin(t *testing.T) { + tests := []struct { + name string + input string + amount string + denom string + err string + }{ + { + name: "ok", + input: "1000stake", + amount: "1000", + denom: "stake", + }, + { + name: "empty", + input: "", + err: "empty input when parsing coin", + }, + { + name: "empty denom", + input: "1000", + err: "invalid input format", + }, + { + name: "empty amount", + input: "stake", + err: "invalid input format", + }, + { + name: " format", + input: "stake1000", + err: "invalid input format", + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + amount, denom, err := parseCoin(tt.input) + if tt.err != "" { + require.Error(t, err) + require.Contains(t, err.Error(), tt.err) + } else { + require.NoError(t, err) + require.Equal(t, tt.amount, amount) + require.Equal(t, tt.denom, denom) + } + }) + } +} + +func TestParseCoin(t *testing.T) { + encodedCoin := "1000000000foo" + coin, err := ParseCoin(encodedCoin) + require.NoError(t, err) + require.Equal(t, "1000000000", coin.Amount) + require.Equal(t, "foo", coin.Denom) +} + +func TestParseDecCoin(t *testing.T) { + encodedCoin := "1000000000foo" + coin, err := ParseDecCoin(encodedCoin) + require.NoError(t, err) + require.Equal(t, "1000000000", coin.Amount) + require.Equal(t, "foo", coin.Denom) +} diff --git a/client/v2/internal/flags/flags.go b/client/v2/internal/flags/flags.go new file mode 100644 index 000000000000..cd50a96be87b --- /dev/null +++ b/client/v2/internal/flags/flags.go @@ -0,0 +1,19 @@ +package flags + +// This defines flag names that can be used in autocli. +const ( + // FlagFrom is the flag to set the from address with which to sign the transaction. + FlagFrom = "from" + + // FlagOutput is the flag to set the output format. + FlagOutput = "output" + + // FlagNoIndent is the flag to not indent the output. + FlagNoIndent = "no-indent" +) + +// List of supported output formats +const ( + OutputFormatJSON = "json" + OutputFormatText = "text" +) diff --git a/client/v2/internal/strcase/kebab_test.go b/client/v2/internal/strcase/kebab_test.go index 71e2300e31b2..1c82f3ab3bcd 100644 --- a/client/v2/internal/strcase/kebab_test.go +++ b/client/v2/internal/strcase/kebab_test.go @@ -3,8 +3,9 @@ package strcase_test import ( "testing" - "cosmossdk.io/client/v2/internal/strcase" "gotest.tools/v3/assert" + + "cosmossdk.io/client/v2/internal/strcase" ) func toKebab(t testing.TB) { diff --git a/client/v2/internal/testpb/msg.proto b/client/v2/internal/testpb/msg.proto index f11c1d3cad46..a1360175d0a1 100644 --- a/client/v2/internal/testpb/msg.proto +++ b/client/v2/internal/testpb/msg.proto @@ -11,7 +11,13 @@ import "testpb/query.proto"; service Msg { // Send a request and returns the request as a response. - rpc Send(MsgRequest) returns (MsgResponse); + rpc Send(MsgRequest) returns (MsgResponse) { + option (cosmos_proto.method_added_in) = "cosmos-sdk v0.50.0"; + }; + + rpc Clawback(MsgClawbackRequest) returns (MsgClawbackResponse) { + option (cosmos_proto.method_added_in) = "cosmos-sdk v0.51.0"; + } } message MsgRequest { @@ -44,8 +50,13 @@ message MsgRequest { string deprecated_field = 30; string shorthand_deprecated_field = 31; bool hidden_bool = 32; + string a_validator_address = 33 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; } message MsgResponse { MsgRequest request = 1; } + +message MsgClawbackRequest {} + +message MsgClawbackResponse {} \ No newline at end of file diff --git a/client/v2/internal/testpb/msg.pulsar.go b/client/v2/internal/testpb/msg.pulsar.go index d0f23082d2dd..29fd89007a3d 100644 --- a/client/v2/internal/testpb/msg.pulsar.go +++ b/client/v2/internal/testpb/msg.pulsar.go @@ -382,6 +382,7 @@ var ( fd_MsgRequest_deprecated_field protoreflect.FieldDescriptor fd_MsgRequest_shorthand_deprecated_field protoreflect.FieldDescriptor fd_MsgRequest_hidden_bool protoreflect.FieldDescriptor + fd_MsgRequest_a_validator_address protoreflect.FieldDescriptor ) func init() { @@ -413,6 +414,7 @@ func init() { fd_MsgRequest_deprecated_field = md_MsgRequest.Fields().ByName("deprecated_field") fd_MsgRequest_shorthand_deprecated_field = md_MsgRequest.Fields().ByName("shorthand_deprecated_field") fd_MsgRequest_hidden_bool = md_MsgRequest.Fields().ByName("hidden_bool") + fd_MsgRequest_a_validator_address = md_MsgRequest.Fields().ByName("a_validator_address") } var _ protoreflect.Message = (*fastReflection_MsgRequest)(nil) @@ -636,6 +638,12 @@ func (x *fastReflection_MsgRequest) Range(f func(protoreflect.FieldDescriptor, p return } } + if x.AValidatorAddress != "" { + value := protoreflect.ValueOfString(x.AValidatorAddress) + if !f(fd_MsgRequest_a_validator_address, value) { + return + } + } } // Has reports whether a field is populated. @@ -703,6 +711,8 @@ func (x *fastReflection_MsgRequest) Has(fd protoreflect.FieldDescriptor) bool { return x.ShorthandDeprecatedField != "" case "testpb.MsgRequest.hidden_bool": return x.HiddenBool != false + case "testpb.MsgRequest.a_validator_address": + return x.AValidatorAddress != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgRequest")) @@ -771,6 +781,8 @@ func (x *fastReflection_MsgRequest) Clear(fd protoreflect.FieldDescriptor) { x.ShorthandDeprecatedField = "" case "testpb.MsgRequest.hidden_bool": x.HiddenBool = false + case "testpb.MsgRequest.a_validator_address": + x.AValidatorAddress = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgRequest")) @@ -886,6 +898,9 @@ func (x *fastReflection_MsgRequest) Get(descriptor protoreflect.FieldDescriptor) case "testpb.MsgRequest.hidden_bool": value := x.HiddenBool return protoreflect.ValueOfBool(value) + case "testpb.MsgRequest.a_validator_address": + value := x.AValidatorAddress + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgRequest")) @@ -972,6 +987,8 @@ func (x *fastReflection_MsgRequest) Set(fd protoreflect.FieldDescriptor, value p x.ShorthandDeprecatedField = value.Interface().(string) case "testpb.MsgRequest.hidden_bool": x.HiddenBool = value.Bool() + case "testpb.MsgRequest.a_validator_address": + x.AValidatorAddress = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgRequest")) @@ -1087,6 +1104,8 @@ func (x *fastReflection_MsgRequest) Mutable(fd protoreflect.FieldDescriptor) pro panic(fmt.Errorf("field shorthand_deprecated_field of message testpb.MsgRequest is not mutable")) case "testpb.MsgRequest.hidden_bool": panic(fmt.Errorf("field hidden_bool of message testpb.MsgRequest is not mutable")) + case "testpb.MsgRequest.a_validator_address": + panic(fmt.Errorf("field a_validator_address of message testpb.MsgRequest is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgRequest")) @@ -1164,6 +1183,8 @@ func (x *fastReflection_MsgRequest) NewField(fd protoreflect.FieldDescriptor) pr return protoreflect.ValueOfString("") case "testpb.MsgRequest.hidden_bool": return protoreflect.ValueOfBool(false) + case "testpb.MsgRequest.a_validator_address": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgRequest")) @@ -1342,6 +1363,10 @@ func (x *fastReflection_MsgRequest) ProtoMethods() *protoiface.Methods { if x.HiddenBool { n += 3 } + l = len(x.AValidatorAddress) + if l > 0 { + n += 2 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1371,6 +1396,15 @@ func (x *fastReflection_MsgRequest) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.AValidatorAddress) > 0 { + i -= len(x.AValidatorAddress) + copy(dAtA[i:], x.AValidatorAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AValidatorAddress))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0x8a + } if x.HiddenBool { i-- if x.HiddenBool { @@ -2604,6 +2638,38 @@ func (x *fastReflection_MsgRequest) ProtoMethods() *protoiface.Methods { } } x.HiddenBool = bool(v != 0) + case 33: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AValidatorAddress", 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.AValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -3074,161 +3140,874 @@ func (x *fastReflection_MsgResponse) ProtoMethods() *protoiface.Methods { } } -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.0 -// protoc (unknown) -// source: testpb/msg.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 ( + md_MsgClawbackRequest protoreflect.MessageDescriptor ) -type MsgRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields +func init() { + file_testpb_msg_proto_init() + md_MsgClawbackRequest = File_testpb_msg_proto.Messages().ByName("MsgClawbackRequest") +} - // u32 is an uint32 - U32 uint32 `protobuf:"varint,1,opt,name=u32,proto3" json:"u32,omitempty"` - U64 uint64 `protobuf:"varint,2,opt,name=u64,proto3" json:"u64,omitempty"` - Str string `protobuf:"bytes,3,opt,name=str,proto3" json:"str,omitempty"` - Bz []byte `protobuf:"bytes,4,opt,name=bz,proto3" json:"bz,omitempty"` - Timestamp *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Duration *durationpb.Duration `protobuf:"bytes,6,opt,name=duration,proto3" json:"duration,omitempty"` - I32 int32 `protobuf:"varint,7,opt,name=i32,proto3" json:"i32,omitempty"` - I64 int64 `protobuf:"varint,10,opt,name=i64,proto3" json:"i64,omitempty"` - ABool bool `protobuf:"varint,15,opt,name=a_bool,json=aBool,proto3" json:"a_bool,omitempty"` - AnEnum Enum `protobuf:"varint,16,opt,name=an_enum,json=anEnum,proto3,enum=testpb.Enum" json:"an_enum,omitempty"` - AMessage *AMessage `protobuf:"bytes,17,opt,name=a_message,json=aMessage,proto3" json:"a_message,omitempty"` - ACoin *v1beta1.Coin `protobuf:"bytes,18,opt,name=a_coin,json=aCoin,proto3" json:"a_coin,omitempty"` - AnAddress string `protobuf:"bytes,19,opt,name=an_address,json=anAddress,proto3" json:"an_address,omitempty"` - Page *v1beta11.PageRequest `protobuf:"bytes,20,opt,name=page,proto3" json:"page,omitempty"` - Bools []bool `protobuf:"varint,21,rep,packed,name=bools,proto3" json:"bools,omitempty"` - Uints []uint32 `protobuf:"varint,22,rep,packed,name=uints,proto3" json:"uints,omitempty"` - Strings []string `protobuf:"bytes,23,rep,name=strings,proto3" json:"strings,omitempty"` - Enums []Enum `protobuf:"varint,24,rep,packed,name=enums,proto3,enum=testpb.Enum" json:"enums,omitempty"` - Durations []*durationpb.Duration `protobuf:"bytes,25,rep,name=durations,proto3" json:"durations,omitempty"` - SomeMessages []*AMessage `protobuf:"bytes,26,rep,name=some_messages,json=someMessages,proto3" json:"some_messages,omitempty"` - Positional1 int32 `protobuf:"varint,27,opt,name=positional1,proto3" json:"positional1,omitempty"` - Positional2 string `protobuf:"bytes,28,opt,name=positional2,proto3" json:"positional2,omitempty"` - Positional3Varargs []*v1beta1.Coin `protobuf:"bytes,29,rep,name=positional3_varargs,json=positional3Varargs,proto3" json:"positional3_varargs,omitempty"` - DeprecatedField string `protobuf:"bytes,30,opt,name=deprecated_field,json=deprecatedField,proto3" json:"deprecated_field,omitempty"` - ShorthandDeprecatedField string `protobuf:"bytes,31,opt,name=shorthand_deprecated_field,json=shorthandDeprecatedField,proto3" json:"shorthand_deprecated_field,omitempty"` - HiddenBool bool `protobuf:"varint,32,opt,name=hidden_bool,json=hiddenBool,proto3" json:"hidden_bool,omitempty"` +var _ protoreflect.Message = (*fastReflection_MsgClawbackRequest)(nil) + +type fastReflection_MsgClawbackRequest MsgClawbackRequest + +func (x *MsgClawbackRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgClawbackRequest)(x) } -func (x *MsgRequest) Reset() { - *x = MsgRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_msg_proto_msgTypes[0] +func (x *MsgClawbackRequest) slowProtoReflect() protoreflect.Message { + mi := &file_testpb_msg_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } + return mi.MessageOf(x) } -func (x *MsgRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} +var _fastReflection_MsgClawbackRequest_messageType fastReflection_MsgClawbackRequest_messageType +var _ protoreflect.MessageType = fastReflection_MsgClawbackRequest_messageType{} -func (*MsgRequest) ProtoMessage() {} +type fastReflection_MsgClawbackRequest_messageType struct{} -// Deprecated: Use MsgRequest.ProtoReflect.Descriptor instead. -func (*MsgRequest) Descriptor() ([]byte, []int) { - return file_testpb_msg_proto_rawDescGZIP(), []int{0} +func (x fastReflection_MsgClawbackRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgClawbackRequest)(nil) +} +func (x fastReflection_MsgClawbackRequest_messageType) New() protoreflect.Message { + return new(fastReflection_MsgClawbackRequest) +} +func (x fastReflection_MsgClawbackRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgClawbackRequest } -func (x *MsgRequest) GetU32() uint32 { - if x != nil { - return x.U32 - } - return 0 +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgClawbackRequest) Descriptor() protoreflect.MessageDescriptor { + return md_MsgClawbackRequest } -func (x *MsgRequest) GetU64() uint64 { - if x != nil { - return x.U64 - } - return 0 +// 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_MsgClawbackRequest) Type() protoreflect.MessageType { + return _fastReflection_MsgClawbackRequest_messageType } -func (x *MsgRequest) GetStr() string { - if x != nil { - return x.Str - } - return "" +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgClawbackRequest) New() protoreflect.Message { + return new(fastReflection_MsgClawbackRequest) } -func (x *MsgRequest) GetBz() []byte { - if x != nil { - return x.Bz - } - return nil +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgClawbackRequest) Interface() protoreflect.ProtoMessage { + return (*MsgClawbackRequest)(x) } -func (x *MsgRequest) GetTimestamp() *timestamppb.Timestamp { - if x != nil { - return x.Timestamp - } - return nil +// 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_MsgClawbackRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { } -func (x *MsgRequest) GetDuration() *durationpb.Duration { - if x != nil { - return x.Duration +// 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_MsgClawbackRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgClawbackRequest")) + } + panic(fmt.Errorf("message testpb.MsgClawbackRequest does not contain field %s", fd.FullName())) } - return nil } -func (x *MsgRequest) GetI32() int32 { - if x != nil { - return x.I32 +// 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_MsgClawbackRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgClawbackRequest")) + } + panic(fmt.Errorf("message testpb.MsgClawbackRequest does not contain field %s", fd.FullName())) } - return 0 } -func (x *MsgRequest) GetI64() int64 { - if x != nil { - return x.I64 +// 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_MsgClawbackRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgClawbackRequest")) + } + panic(fmt.Errorf("message testpb.MsgClawbackRequest does not contain field %s", descriptor.FullName())) } - return 0 } -func (x *MsgRequest) GetABool() bool { - if x != nil { - return x.ABool +// 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_MsgClawbackRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgClawbackRequest")) + } + panic(fmt.Errorf("message testpb.MsgClawbackRequest does not contain field %s", fd.FullName())) } - return false } -func (x *MsgRequest) GetAnEnum() Enum { - if x != nil { - return x.AnEnum +// 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_MsgClawbackRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgClawbackRequest")) + } + panic(fmt.Errorf("message testpb.MsgClawbackRequest does not contain field %s", fd.FullName())) } - return Enum_ENUM_UNSPECIFIED } -func (x *MsgRequest) GetAMessage() *AMessage { - if x != nil { - return x.AMessage +// 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_MsgClawbackRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgClawbackRequest")) + } + panic(fmt.Errorf("message testpb.MsgClawbackRequest does not contain field %s", fd.FullName())) } - return nil } -func (x *MsgRequest) GetACoin() *v1beta1.Coin { - if x != nil { - return x.ACoin +// 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_MsgClawbackRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in testpb.MsgClawbackRequest", d.FullName())) } - return nil + panic("unreachable") } -func (x *MsgRequest) GetAnAddress() string { - if x != nil { - return x.AnAddress - } +// 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_MsgClawbackRequest) 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_MsgClawbackRequest) 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_MsgClawbackRequest) 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_MsgClawbackRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgClawbackRequest) + 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().(*MsgClawbackRequest) + 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().(*MsgClawbackRequest) + 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: MsgClawbackRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgClawbackRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgClawbackResponse protoreflect.MessageDescriptor +) + +func init() { + file_testpb_msg_proto_init() + md_MsgClawbackResponse = File_testpb_msg_proto.Messages().ByName("MsgClawbackResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgClawbackResponse)(nil) + +type fastReflection_MsgClawbackResponse MsgClawbackResponse + +func (x *MsgClawbackResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgClawbackResponse)(x) +} + +func (x *MsgClawbackResponse) slowProtoReflect() protoreflect.Message { + mi := &file_testpb_msg_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_MsgClawbackResponse_messageType fastReflection_MsgClawbackResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgClawbackResponse_messageType{} + +type fastReflection_MsgClawbackResponse_messageType struct{} + +func (x fastReflection_MsgClawbackResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgClawbackResponse)(nil) +} +func (x fastReflection_MsgClawbackResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgClawbackResponse) +} +func (x fastReflection_MsgClawbackResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgClawbackResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgClawbackResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgClawbackResponse +} + +// 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_MsgClawbackResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgClawbackResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgClawbackResponse) New() protoreflect.Message { + return new(fastReflection_MsgClawbackResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgClawbackResponse) Interface() protoreflect.ProtoMessage { + return (*MsgClawbackResponse)(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_MsgClawbackResponse) 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_MsgClawbackResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgClawbackResponse")) + } + panic(fmt.Errorf("message testpb.MsgClawbackResponse 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_MsgClawbackResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgClawbackResponse")) + } + panic(fmt.Errorf("message testpb.MsgClawbackResponse 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_MsgClawbackResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgClawbackResponse")) + } + panic(fmt.Errorf("message testpb.MsgClawbackResponse 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_MsgClawbackResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgClawbackResponse")) + } + panic(fmt.Errorf("message testpb.MsgClawbackResponse 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_MsgClawbackResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgClawbackResponse")) + } + panic(fmt.Errorf("message testpb.MsgClawbackResponse 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_MsgClawbackResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgClawbackResponse")) + } + panic(fmt.Errorf("message testpb.MsgClawbackResponse 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_MsgClawbackResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in testpb.MsgClawbackResponse", 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_MsgClawbackResponse) 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_MsgClawbackResponse) 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_MsgClawbackResponse) 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_MsgClawbackResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgClawbackResponse) + 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().(*MsgClawbackResponse) + 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().(*MsgClawbackResponse) + 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: MsgClawbackResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgClawbackResponse: 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: testpb/msg.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type MsgRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // u32 is an uint32 + U32 uint32 `protobuf:"varint,1,opt,name=u32,proto3" json:"u32,omitempty"` + U64 uint64 `protobuf:"varint,2,opt,name=u64,proto3" json:"u64,omitempty"` + Str string `protobuf:"bytes,3,opt,name=str,proto3" json:"str,omitempty"` + Bz []byte `protobuf:"bytes,4,opt,name=bz,proto3" json:"bz,omitempty"` + Timestamp *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Duration *durationpb.Duration `protobuf:"bytes,6,opt,name=duration,proto3" json:"duration,omitempty"` + I32 int32 `protobuf:"varint,7,opt,name=i32,proto3" json:"i32,omitempty"` + I64 int64 `protobuf:"varint,10,opt,name=i64,proto3" json:"i64,omitempty"` + ABool bool `protobuf:"varint,15,opt,name=a_bool,json=aBool,proto3" json:"a_bool,omitempty"` + AnEnum Enum `protobuf:"varint,16,opt,name=an_enum,json=anEnum,proto3,enum=testpb.Enum" json:"an_enum,omitempty"` + AMessage *AMessage `protobuf:"bytes,17,opt,name=a_message,json=aMessage,proto3" json:"a_message,omitempty"` + ACoin *v1beta1.Coin `protobuf:"bytes,18,opt,name=a_coin,json=aCoin,proto3" json:"a_coin,omitempty"` + AnAddress string `protobuf:"bytes,19,opt,name=an_address,json=anAddress,proto3" json:"an_address,omitempty"` + Page *v1beta11.PageRequest `protobuf:"bytes,20,opt,name=page,proto3" json:"page,omitempty"` + Bools []bool `protobuf:"varint,21,rep,packed,name=bools,proto3" json:"bools,omitempty"` + Uints []uint32 `protobuf:"varint,22,rep,packed,name=uints,proto3" json:"uints,omitempty"` + Strings []string `protobuf:"bytes,23,rep,name=strings,proto3" json:"strings,omitempty"` + Enums []Enum `protobuf:"varint,24,rep,packed,name=enums,proto3,enum=testpb.Enum" json:"enums,omitempty"` + Durations []*durationpb.Duration `protobuf:"bytes,25,rep,name=durations,proto3" json:"durations,omitempty"` + SomeMessages []*AMessage `protobuf:"bytes,26,rep,name=some_messages,json=someMessages,proto3" json:"some_messages,omitempty"` + Positional1 int32 `protobuf:"varint,27,opt,name=positional1,proto3" json:"positional1,omitempty"` + Positional2 string `protobuf:"bytes,28,opt,name=positional2,proto3" json:"positional2,omitempty"` + Positional3Varargs []*v1beta1.Coin `protobuf:"bytes,29,rep,name=positional3_varargs,json=positional3Varargs,proto3" json:"positional3_varargs,omitempty"` + DeprecatedField string `protobuf:"bytes,30,opt,name=deprecated_field,json=deprecatedField,proto3" json:"deprecated_field,omitempty"` + ShorthandDeprecatedField string `protobuf:"bytes,31,opt,name=shorthand_deprecated_field,json=shorthandDeprecatedField,proto3" json:"shorthand_deprecated_field,omitempty"` + HiddenBool bool `protobuf:"varint,32,opt,name=hidden_bool,json=hiddenBool,proto3" json:"hidden_bool,omitempty"` + AValidatorAddress string `protobuf:"bytes,33,opt,name=a_validator_address,json=aValidatorAddress,proto3" json:"a_validator_address,omitempty"` +} + +func (x *MsgRequest) Reset() { + *x = MsgRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_testpb_msg_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgRequest) ProtoMessage() {} + +// Deprecated: Use MsgRequest.ProtoReflect.Descriptor instead. +func (*MsgRequest) Descriptor() ([]byte, []int) { + return file_testpb_msg_proto_rawDescGZIP(), []int{0} +} + +func (x *MsgRequest) GetU32() uint32 { + if x != nil { + return x.U32 + } + return 0 +} + +func (x *MsgRequest) GetU64() uint64 { + if x != nil { + return x.U64 + } + return 0 +} + +func (x *MsgRequest) GetStr() string { + if x != nil { + return x.Str + } + return "" +} + +func (x *MsgRequest) GetBz() []byte { + if x != nil { + return x.Bz + } + return nil +} + +func (x *MsgRequest) GetTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + +func (x *MsgRequest) GetDuration() *durationpb.Duration { + if x != nil { + return x.Duration + } + return nil +} + +func (x *MsgRequest) GetI32() int32 { + if x != nil { + return x.I32 + } + return 0 +} + +func (x *MsgRequest) GetI64() int64 { + if x != nil { + return x.I64 + } + return 0 +} + +func (x *MsgRequest) GetABool() bool { + if x != nil { + return x.ABool + } + return false +} + +func (x *MsgRequest) GetAnEnum() Enum { + if x != nil { + return x.AnEnum + } + return Enum_ENUM_UNSPECIFIED +} + +func (x *MsgRequest) GetAMessage() *AMessage { + if x != nil { + return x.AMessage + } + return nil +} + +func (x *MsgRequest) GetACoin() *v1beta1.Coin { + if x != nil { + return x.ACoin + } + return nil +} + +func (x *MsgRequest) GetAnAddress() string { + if x != nil { + return x.AnAddress + } return "" } @@ -3323,6 +4102,13 @@ func (x *MsgRequest) GetHiddenBool() bool { return false } +func (x *MsgRequest) GetAValidatorAddress() string { + if x != nil { + return x.AValidatorAddress + } + return "" +} + type MsgResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3358,6 +4144,58 @@ func (x *MsgResponse) GetRequest() *MsgRequest { return nil } +type MsgClawbackRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgClawbackRequest) Reset() { + *x = MsgClawbackRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_testpb_msg_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgClawbackRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgClawbackRequest) ProtoMessage() {} + +// Deprecated: Use MsgClawbackRequest.ProtoReflect.Descriptor instead. +func (*MsgClawbackRequest) Descriptor() ([]byte, []int) { + return file_testpb_msg_proto_rawDescGZIP(), []int{2} +} + +type MsgClawbackResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgClawbackResponse) Reset() { + *x = MsgClawbackResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_testpb_msg_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgClawbackResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgClawbackResponse) ProtoMessage() {} + +// Deprecated: Use MsgClawbackResponse.ProtoReflect.Descriptor instead. +func (*MsgClawbackResponse) Descriptor() ([]byte, []int) { + return file_testpb_msg_proto_rawDescGZIP(), []int{3} +} + var File_testpb_msg_proto protoreflect.FileDescriptor var file_testpb_msg_proto_rawDesc = []byte{ @@ -3374,7 +4212,7 @@ var file_testpb_msg_proto_rawDesc = []byte{ 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x12, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xef, 0x07, 0x0a, 0x0a, 0x4d, 0x73, 0x67, 0x52, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc2, 0x08, 0x0a, 0x0a, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x33, 0x32, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x75, 0x33, 0x32, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x36, 0x34, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x75, 0x36, 0x34, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x74, 0x72, @@ -3437,23 +4275,39 @@ var file_testpb_msg_proto_rawDesc = []byte{ 0x68, 0x6f, 0x72, 0x74, 0x68, 0x61, 0x6e, 0x64, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x68, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x5f, 0x62, 0x6f, 0x6f, 0x6c, 0x18, 0x20, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x68, 0x69, - 0x64, 0x64, 0x65, 0x6e, 0x42, 0x6f, 0x6f, 0x6c, 0x22, 0x3b, 0x0a, 0x0b, 0x4d, 0x73, 0x67, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, - 0x62, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x07, 0x72, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x32, 0x36, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x2f, 0x0a, 0x04, - 0x53, 0x65, 0x6e, 0x64, 0x12, 0x12, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4d, 0x73, - 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, - 0x62, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x86, 0x01, - 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x42, 0x08, 0x4d, 0x73, - 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x32, - 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, - 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xca, - 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xe2, 0x02, 0x12, 0x54, 0x65, 0x73, 0x74, 0x70, - 0x62, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, - 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x64, 0x64, 0x65, 0x6e, 0x42, 0x6f, 0x6f, 0x6c, 0x12, 0x51, 0x0a, 0x13, 0x61, 0x5f, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, + 0x21, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x11, 0x61, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x3b, 0x0a, 0x0b, 0x4d, + 0x73, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x07, 0x72, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x74, 0x65, + 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, + 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x14, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x43, + 0x6c, 0x61, 0x77, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x15, + 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x77, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xab, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x47, 0x0a, + 0x04, 0x53, 0x65, 0x6e, 0x64, 0x12, 0x12, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4d, + 0x73, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x74, 0x65, 0x73, 0x74, + 0x70, 0x62, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, + 0xca, 0xb4, 0x2d, 0x12, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x20, 0x76, + 0x30, 0x2e, 0x35, 0x30, 0x2e, 0x30, 0x12, 0x5b, 0x0a, 0x08, 0x43, 0x6c, 0x61, 0x77, 0x62, 0x61, + 0x63, 0x6b, 0x12, 0x1a, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4d, 0x73, 0x67, 0x43, + 0x6c, 0x61, 0x77, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, + 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x77, 0x62, + 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, 0xca, 0xb4, 0x2d, + 0x12, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x20, 0x76, 0x30, 0x2e, 0x35, + 0x31, 0x2e, 0x30, 0x42, 0x86, 0x01, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x73, 0x74, + 0x70, 0x62, 0x42, 0x08, 0x4d, 0x73, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x63, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x32, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, + 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x54, + 0x65, 0x73, 0x74, 0x70, 0x62, 0xca, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xe2, 0x02, + 0x12, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3468,33 +4322,37 @@ func file_testpb_msg_proto_rawDescGZIP() []byte { return file_testpb_msg_proto_rawDescData } -var file_testpb_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_testpb_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_testpb_msg_proto_goTypes = []interface{}{ (*MsgRequest)(nil), // 0: testpb.MsgRequest (*MsgResponse)(nil), // 1: testpb.MsgResponse - (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp - (*durationpb.Duration)(nil), // 3: google.protobuf.Duration - (Enum)(0), // 4: testpb.Enum - (*AMessage)(nil), // 5: testpb.AMessage - (*v1beta1.Coin)(nil), // 6: cosmos.base.v1beta1.Coin - (*v1beta11.PageRequest)(nil), // 7: cosmos.base.query.v1beta1.PageRequest + (*MsgClawbackRequest)(nil), // 2: testpb.MsgClawbackRequest + (*MsgClawbackResponse)(nil), // 3: testpb.MsgClawbackResponse + (*timestamppb.Timestamp)(nil), // 4: google.protobuf.Timestamp + (*durationpb.Duration)(nil), // 5: google.protobuf.Duration + (Enum)(0), // 6: testpb.Enum + (*AMessage)(nil), // 7: testpb.AMessage + (*v1beta1.Coin)(nil), // 8: cosmos.base.v1beta1.Coin + (*v1beta11.PageRequest)(nil), // 9: cosmos.base.query.v1beta1.PageRequest } var file_testpb_msg_proto_depIdxs = []int32{ - 2, // 0: testpb.MsgRequest.timestamp:type_name -> google.protobuf.Timestamp - 3, // 1: testpb.MsgRequest.duration:type_name -> google.protobuf.Duration - 4, // 2: testpb.MsgRequest.an_enum:type_name -> testpb.Enum - 5, // 3: testpb.MsgRequest.a_message:type_name -> testpb.AMessage - 6, // 4: testpb.MsgRequest.a_coin:type_name -> cosmos.base.v1beta1.Coin - 7, // 5: testpb.MsgRequest.page:type_name -> cosmos.base.query.v1beta1.PageRequest - 4, // 6: testpb.MsgRequest.enums:type_name -> testpb.Enum - 3, // 7: testpb.MsgRequest.durations:type_name -> google.protobuf.Duration - 5, // 8: testpb.MsgRequest.some_messages:type_name -> testpb.AMessage - 6, // 9: testpb.MsgRequest.positional3_varargs:type_name -> cosmos.base.v1beta1.Coin + 4, // 0: testpb.MsgRequest.timestamp:type_name -> google.protobuf.Timestamp + 5, // 1: testpb.MsgRequest.duration:type_name -> google.protobuf.Duration + 6, // 2: testpb.MsgRequest.an_enum:type_name -> testpb.Enum + 7, // 3: testpb.MsgRequest.a_message:type_name -> testpb.AMessage + 8, // 4: testpb.MsgRequest.a_coin:type_name -> cosmos.base.v1beta1.Coin + 9, // 5: testpb.MsgRequest.page:type_name -> cosmos.base.query.v1beta1.PageRequest + 6, // 6: testpb.MsgRequest.enums:type_name -> testpb.Enum + 5, // 7: testpb.MsgRequest.durations:type_name -> google.protobuf.Duration + 7, // 8: testpb.MsgRequest.some_messages:type_name -> testpb.AMessage + 8, // 9: testpb.MsgRequest.positional3_varargs:type_name -> cosmos.base.v1beta1.Coin 0, // 10: testpb.MsgResponse.request:type_name -> testpb.MsgRequest 0, // 11: testpb.Msg.Send:input_type -> testpb.MsgRequest - 1, // 12: testpb.Msg.Send:output_type -> testpb.MsgResponse - 12, // [12:13] is the sub-list for method output_type - 11, // [11:12] is the sub-list for method input_type + 2, // 12: testpb.Msg.Clawback:input_type -> testpb.MsgClawbackRequest + 1, // 13: testpb.Msg.Send:output_type -> testpb.MsgResponse + 3, // 14: testpb.Msg.Clawback:output_type -> testpb.MsgClawbackResponse + 13, // [13:15] is the sub-list for method output_type + 11, // [11:13] is the sub-list for method input_type 11, // [11:11] is the sub-list for extension type_name 11, // [11:11] is the sub-list for extension extendee 0, // [0:11] is the sub-list for field type_name @@ -3531,6 +4389,30 @@ func file_testpb_msg_proto_init() { return nil } } + file_testpb_msg_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgClawbackRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_testpb_msg_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgClawbackResponse); 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{ @@ -3538,7 +4420,7 @@ func file_testpb_msg_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_testpb_msg_proto_rawDesc, NumEnums: 0, - NumMessages: 2, + NumMessages: 4, NumExtensions: 0, NumServices: 1, }, diff --git a/client/v2/internal/testpb/msg_grpc.pb.go b/client/v2/internal/testpb/msg_grpc.pb.go index 4d8c24526e4b..ebcfba150bb9 100644 --- a/client/v2/internal/testpb/msg_grpc.pb.go +++ b/client/v2/internal/testpb/msg_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 +// - protoc-gen-go-grpc v1.3.0 // - protoc (unknown) // source: testpb/msg.proto @@ -18,12 +18,18 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + Msg_Send_FullMethodName = "/testpb.Msg/Send" + Msg_Clawback_FullMethodName = "/testpb.Msg/Clawback" +) + // MsgClient is the client API for Msg service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type MsgClient interface { // Send a request and returns the request as a response. Send(ctx context.Context, in *MsgRequest, opts ...grpc.CallOption) (*MsgResponse, error) + Clawback(ctx context.Context, in *MsgClawbackRequest, opts ...grpc.CallOption) (*MsgClawbackResponse, error) } type msgClient struct { @@ -36,7 +42,16 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { func (c *msgClient) Send(ctx context.Context, in *MsgRequest, opts ...grpc.CallOption) (*MsgResponse, error) { out := new(MsgResponse) - err := c.cc.Invoke(ctx, "/testpb.Msg/Send", in, out, opts...) + err := c.cc.Invoke(ctx, Msg_Send_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Clawback(ctx context.Context, in *MsgClawbackRequest, opts ...grpc.CallOption) (*MsgClawbackResponse, error) { + out := new(MsgClawbackResponse) + err := c.cc.Invoke(ctx, Msg_Clawback_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -49,6 +64,7 @@ func (c *msgClient) Send(ctx context.Context, in *MsgRequest, opts ...grpc.CallO type MsgServer interface { // Send a request and returns the request as a response. Send(context.Context, *MsgRequest) (*MsgResponse, error) + Clawback(context.Context, *MsgClawbackRequest) (*MsgClawbackResponse, error) mustEmbedUnimplementedMsgServer() } @@ -59,6 +75,9 @@ type UnimplementedMsgServer struct { func (UnimplementedMsgServer) Send(context.Context, *MsgRequest) (*MsgResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Send not implemented") } +func (UnimplementedMsgServer) Clawback(context.Context, *MsgClawbackRequest) (*MsgClawbackResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Clawback not implemented") +} func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. @@ -82,7 +101,7 @@ func _Msg_Send_Handler(srv interface{}, ctx context.Context, dec func(interface{ } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/testpb.Msg/Send", + FullMethod: Msg_Send_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).Send(ctx, req.(*MsgRequest)) @@ -90,6 +109,24 @@ func _Msg_Send_Handler(srv interface{}, ctx context.Context, dec func(interface{ return interceptor(ctx, in, info, handler) } +func _Msg_Clawback_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgClawbackRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Clawback(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_Clawback_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Clawback(ctx, req.(*MsgClawbackRequest)) + } + return interceptor(ctx, in, info, handler) +} + // Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -101,6 +138,10 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ MethodName: "Send", Handler: _Msg_Send_Handler, }, + { + MethodName: "Clawback", + Handler: _Msg_Clawback_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "testpb/msg.proto", diff --git a/client/v2/internal/testpb/query.proto b/client/v2/internal/testpb/query.proto index 5e2a5171e45a..9215823f7572 100644 --- a/client/v2/internal/testpb/query.proto +++ b/client/v2/internal/testpb/query.proto @@ -40,12 +40,16 @@ message EchoRequest { string positional2 = 28; repeated cosmos.base.v1beta1.Coin positional3_varargs = 29; - string deprecated_field = 30; - string shorthand_deprecated_field = 31; - bool hidden_bool = 32; - map map_string_string = 33; - map map_string_uint32 = 34; - map map_string_coin = 35; + string deprecated_field = 30; + string shorthand_deprecated_field = 31; + bool hidden_bool = 32; + map map_string_string = 33; + map map_string_uint32 = 34; + map map_string_coin = 35; + string a_validator_address = 36 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; + string a_consensus_address = 37 [(cosmos_proto.scalar) = "cosmos.ConsensusAddressString"]; + + repeated cosmos.base.v1beta1.Coin coins = 38; } enum Enum { diff --git a/client/v2/internal/testpb/query.pulsar.go b/client/v2/internal/testpb/query.pulsar.go index 7baf83be9f3a..53f899b395ca 100644 --- a/client/v2/internal/testpb/query.pulsar.go +++ b/client/v2/internal/testpb/query.pulsar.go @@ -18,148 +18,616 @@ import ( sync "sync" ) -var _ protoreflect.List = (*_EchoRequest_21_list)(nil) +var ( + md_AMessage protoreflect.MessageDescriptor + fd_AMessage_bar protoreflect.FieldDescriptor + fd_AMessage_baz protoreflect.FieldDescriptor +) -type _EchoRequest_21_list struct { - list *[]bool +func init() { + file_testpb_query_proto_init() + md_AMessage = File_testpb_query_proto.Messages().ByName("AMessage") + fd_AMessage_bar = md_AMessage.Fields().ByName("bar") + fd_AMessage_baz = md_AMessage.Fields().ByName("baz") } -func (x *_EchoRequest_21_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} +var _ protoreflect.Message = (*fastReflection_AMessage)(nil) -func (x *_EchoRequest_21_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfBool((*x.list)[i]) -} +type fastReflection_AMessage AMessage -func (x *_EchoRequest_21_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Bool() - concreteValue := valueUnwrapped - (*x.list)[i] = concreteValue +func (x *AMessage) ProtoReflect() protoreflect.Message { + return (*fastReflection_AMessage)(x) } -func (x *_EchoRequest_21_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Bool() - concreteValue := valueUnwrapped - *x.list = append(*x.list, concreteValue) +func (x *AMessage) slowProtoReflect() protoreflect.Message { + mi := &file_testpb_query_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (x *_EchoRequest_21_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message EchoRequest at list field Bools as it is not of Message kind")) -} +var _fastReflection_AMessage_messageType fastReflection_AMessage_messageType +var _ protoreflect.MessageType = fastReflection_AMessage_messageType{} -func (x *_EchoRequest_21_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} +type fastReflection_AMessage_messageType struct{} -func (x *_EchoRequest_21_list) NewElement() protoreflect.Value { - v := false - return protoreflect.ValueOfBool(v) +func (x fastReflection_AMessage_messageType) Zero() protoreflect.Message { + return (*fastReflection_AMessage)(nil) } - -func (x *_EchoRequest_21_list) IsValid() bool { - return x.list != nil +func (x fastReflection_AMessage_messageType) New() protoreflect.Message { + return new(fastReflection_AMessage) } - -var _ protoreflect.List = (*_EchoRequest_22_list)(nil) - -type _EchoRequest_22_list struct { - list *[]uint32 +func (x fastReflection_AMessage_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_AMessage } -func (x *_EchoRequest_22_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_AMessage) Descriptor() protoreflect.MessageDescriptor { + return md_AMessage } -func (x *_EchoRequest_22_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfUint32((*x.list)[i]) +// 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_AMessage) Type() protoreflect.MessageType { + return _fastReflection_AMessage_messageType } -func (x *_EchoRequest_22_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Uint() - concreteValue := (uint32)(valueUnwrapped) - (*x.list)[i] = concreteValue +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_AMessage) New() protoreflect.Message { + return new(fastReflection_AMessage) } -func (x *_EchoRequest_22_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Uint() - concreteValue := (uint32)(valueUnwrapped) - *x.list = append(*x.list, concreteValue) +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_AMessage) Interface() protoreflect.ProtoMessage { + return (*AMessage)(x) } -func (x *_EchoRequest_22_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message EchoRequest at list field Uints as it is not of Message kind")) +// 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_AMessage) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Bar != "" { + value := protoreflect.ValueOfString(x.Bar) + if !f(fd_AMessage_bar, value) { + return + } + } + if x.Baz != int32(0) { + value := protoreflect.ValueOfInt32(x.Baz) + if !f(fd_AMessage_baz, value) { + return + } + } } -func (x *_EchoRequest_22_list) Truncate(n int) { - *x.list = (*x.list)[:n] +// 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_AMessage) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "testpb.AMessage.bar": + return x.Bar != "" + case "testpb.AMessage.baz": + return x.Baz != int32(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.AMessage")) + } + panic(fmt.Errorf("message testpb.AMessage does not contain field %s", fd.FullName())) + } } -func (x *_EchoRequest_22_list) NewElement() protoreflect.Value { - v := uint32(0) - return protoreflect.ValueOfUint32(v) +// 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_AMessage) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "testpb.AMessage.bar": + x.Bar = "" + case "testpb.AMessage.baz": + x.Baz = int32(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.AMessage")) + } + panic(fmt.Errorf("message testpb.AMessage does not contain field %s", fd.FullName())) + } } -func (x *_EchoRequest_22_list) IsValid() bool { - return x.list != nil +// 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_AMessage) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "testpb.AMessage.bar": + value := x.Bar + return protoreflect.ValueOfString(value) + case "testpb.AMessage.baz": + value := x.Baz + return protoreflect.ValueOfInt32(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.AMessage")) + } + panic(fmt.Errorf("message testpb.AMessage does not contain field %s", descriptor.FullName())) + } } -var _ protoreflect.List = (*_EchoRequest_23_list)(nil) +// 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_AMessage) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "testpb.AMessage.bar": + x.Bar = value.Interface().(string) + case "testpb.AMessage.baz": + x.Baz = int32(value.Int()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.AMessage")) + } + panic(fmt.Errorf("message testpb.AMessage does not contain field %s", fd.FullName())) + } +} -type _EchoRequest_23_list struct { - list *[]string +// 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_AMessage) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "testpb.AMessage.bar": + panic(fmt.Errorf("field bar of message testpb.AMessage is not mutable")) + case "testpb.AMessage.baz": + panic(fmt.Errorf("field baz of message testpb.AMessage is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.AMessage")) + } + panic(fmt.Errorf("message testpb.AMessage does not contain field %s", fd.FullName())) + } } -func (x *_EchoRequest_23_list) Len() int { - if x.list == nil { - return 0 +// 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_AMessage) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "testpb.AMessage.bar": + return protoreflect.ValueOfString("") + case "testpb.AMessage.baz": + return protoreflect.ValueOfInt32(int32(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.AMessage")) + } + panic(fmt.Errorf("message testpb.AMessage does not contain field %s", fd.FullName())) } - return len(*x.list) } -func (x *_EchoRequest_23_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfString((*x.list)[i]) +// 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_AMessage) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in testpb.AMessage", d.FullName())) + } + panic("unreachable") } -func (x *_EchoRequest_23_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - (*x.list)[i] = concreteValue +// 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_AMessage) GetUnknown() protoreflect.RawFields { + return x.unknownFields } -func (x *_EchoRequest_23_list) Append(value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - *x.list = append(*x.list, concreteValue) +// 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_AMessage) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields } -func (x *_EchoRequest_23_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message EchoRequest at list field Strings as it is not of Message kind")) +// 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_AMessage) IsValid() bool { + return x != nil } -func (x *_EchoRequest_23_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} +// 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_AMessage) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*AMessage) + 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.Bar) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Baz != 0 { + n += 1 + runtime.Sov(uint64(x.Baz)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } -func (x *_EchoRequest_23_list) NewElement() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*AMessage) + 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.Baz != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Baz)) + i-- + dAtA[i] = 0x10 + } + if len(x.Bar) > 0 { + i -= len(x.Bar) + copy(dAtA[i:], x.Bar) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Bar))) + 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().(*AMessage) + 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: AMessage: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: AMessage: 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 Bar", 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.Bar = 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 Baz", wireType) + } + x.Baz = 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.Baz |= 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 + } + } -func (x *_EchoRequest_23_list) IsValid() bool { - return x.list != nil + 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 = (*_EchoRequest_24_list)(nil) +var _ protoreflect.List = (*_EchoRequest_21_list)(nil) -type _EchoRequest_24_list struct { - list *[]Enum +type _EchoRequest_21_list struct { + list *[]bool +} + +func (x *_EchoRequest_21_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_EchoRequest_21_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfBool((*x.list)[i]) +} + +func (x *_EchoRequest_21_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Bool() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_EchoRequest_21_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Bool() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_EchoRequest_21_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message EchoRequest at list field Bools as it is not of Message kind")) +} + +func (x *_EchoRequest_21_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_EchoRequest_21_list) NewElement() protoreflect.Value { + v := false + return protoreflect.ValueOfBool(v) +} + +func (x *_EchoRequest_21_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_EchoRequest_22_list)(nil) + +type _EchoRequest_22_list struct { + list *[]uint32 +} + +func (x *_EchoRequest_22_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_EchoRequest_22_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfUint32((*x.list)[i]) +} + +func (x *_EchoRequest_22_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Uint() + concreteValue := (uint32)(valueUnwrapped) + (*x.list)[i] = concreteValue +} + +func (x *_EchoRequest_22_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Uint() + concreteValue := (uint32)(valueUnwrapped) + *x.list = append(*x.list, concreteValue) +} + +func (x *_EchoRequest_22_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message EchoRequest at list field Uints as it is not of Message kind")) +} + +func (x *_EchoRequest_22_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_EchoRequest_22_list) NewElement() protoreflect.Value { + v := uint32(0) + return protoreflect.ValueOfUint32(v) +} + +func (x *_EchoRequest_22_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_EchoRequest_23_list)(nil) + +type _EchoRequest_23_list struct { + list *[]string +} + +func (x *_EchoRequest_23_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_EchoRequest_23_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_EchoRequest_23_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_EchoRequest_23_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_EchoRequest_23_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message EchoRequest at list field Strings as it is not of Message kind")) +} + +func (x *_EchoRequest_23_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_EchoRequest_23_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_EchoRequest_23_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_EchoRequest_24_list)(nil) + +type _EchoRequest_24_list struct { + list *[]Enum } func (x *_EchoRequest_24_list) Len() int { @@ -609,6 +1077,57 @@ func (x *_EchoRequest_35_map) IsValid() bool { return x.m != nil } +var _ protoreflect.List = (*_EchoRequest_38_list)(nil) + +type _EchoRequest_38_list struct { + list *[]*v1beta1.Coin +} + +func (x *_EchoRequest_38_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_EchoRequest_38_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_EchoRequest_38_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + (*x.list)[i] = concreteValue +} + +func (x *_EchoRequest_38_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + *x.list = append(*x.list, concreteValue) +} + +func (x *_EchoRequest_38_list) AppendMutable() protoreflect.Value { + v := new(v1beta1.Coin) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_EchoRequest_38_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_EchoRequest_38_list) NewElement() protoreflect.Value { + v := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_EchoRequest_38_list) IsValid() bool { + return x.list != nil +} + var ( md_EchoRequest protoreflect.MessageDescriptor fd_EchoRequest_u32 protoreflect.FieldDescriptor @@ -640,6 +1159,9 @@ var ( fd_EchoRequest_map_string_string protoreflect.FieldDescriptor fd_EchoRequest_map_string_uint32 protoreflect.FieldDescriptor fd_EchoRequest_map_string_coin protoreflect.FieldDescriptor + fd_EchoRequest_a_validator_address protoreflect.FieldDescriptor + fd_EchoRequest_a_consensus_address protoreflect.FieldDescriptor + fd_EchoRequest_coins protoreflect.FieldDescriptor ) func init() { @@ -674,6 +1196,9 @@ func init() { fd_EchoRequest_map_string_string = md_EchoRequest.Fields().ByName("map_string_string") fd_EchoRequest_map_string_uint32 = md_EchoRequest.Fields().ByName("map_string_uint32") fd_EchoRequest_map_string_coin = md_EchoRequest.Fields().ByName("map_string_coin") + fd_EchoRequest_a_validator_address = md_EchoRequest.Fields().ByName("a_validator_address") + fd_EchoRequest_a_consensus_address = md_EchoRequest.Fields().ByName("a_consensus_address") + fd_EchoRequest_coins = md_EchoRequest.Fields().ByName("coins") } var _ protoreflect.Message = (*fastReflection_EchoRequest)(nil) @@ -685,7 +1210,7 @@ func (x *EchoRequest) ProtoReflect() protoreflect.Message { } func (x *EchoRequest) slowProtoReflect() protoreflect.Message { - mi := &file_testpb_query_proto_msgTypes[0] + mi := &file_testpb_query_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -915,6 +1440,24 @@ func (x *fastReflection_EchoRequest) Range(f func(protoreflect.FieldDescriptor, return } } + if x.AValidatorAddress != "" { + value := protoreflect.ValueOfString(x.AValidatorAddress) + if !f(fd_EchoRequest_a_validator_address, value) { + return + } + } + if x.AConsensusAddress != "" { + value := protoreflect.ValueOfString(x.AConsensusAddress) + if !f(fd_EchoRequest_a_consensus_address, value) { + return + } + } + if len(x.Coins) != 0 { + value := protoreflect.ValueOfList(&_EchoRequest_38_list{list: &x.Coins}) + if !f(fd_EchoRequest_coins, value) { + return + } + } } // Has reports whether a field is populated. @@ -988,6 +1531,12 @@ func (x *fastReflection_EchoRequest) Has(fd protoreflect.FieldDescriptor) bool { return len(x.MapStringUint32) != 0 case "testpb.EchoRequest.map_string_coin": return len(x.MapStringCoin) != 0 + case "testpb.EchoRequest.a_validator_address": + return x.AValidatorAddress != "" + case "testpb.EchoRequest.a_consensus_address": + return x.AConsensusAddress != "" + case "testpb.EchoRequest.coins": + return len(x.Coins) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.EchoRequest")) @@ -1062,6 +1611,12 @@ func (x *fastReflection_EchoRequest) Clear(fd protoreflect.FieldDescriptor) { x.MapStringUint32 = nil case "testpb.EchoRequest.map_string_coin": x.MapStringCoin = nil + case "testpb.EchoRequest.a_validator_address": + x.AValidatorAddress = "" + case "testpb.EchoRequest.a_consensus_address": + x.AConsensusAddress = "" + case "testpb.EchoRequest.coins": + x.Coins = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.EchoRequest")) @@ -1195,6 +1750,18 @@ func (x *fastReflection_EchoRequest) Get(descriptor protoreflect.FieldDescriptor } mapValue := &_EchoRequest_35_map{m: &x.MapStringCoin} return protoreflect.ValueOfMap(mapValue) + case "testpb.EchoRequest.a_validator_address": + value := x.AValidatorAddress + return protoreflect.ValueOfString(value) + case "testpb.EchoRequest.a_consensus_address": + value := x.AConsensusAddress + return protoreflect.ValueOfString(value) + case "testpb.EchoRequest.coins": + if len(x.Coins) == 0 { + return protoreflect.ValueOfList(&_EchoRequest_38_list{}) + } + listValue := &_EchoRequest_38_list{list: &x.Coins} + return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.EchoRequest")) @@ -1293,6 +1860,14 @@ func (x *fastReflection_EchoRequest) Set(fd protoreflect.FieldDescriptor, value mv := value.Map() cmv := mv.(*_EchoRequest_35_map) x.MapStringCoin = *cmv.m + case "testpb.EchoRequest.a_validator_address": + x.AValidatorAddress = value.Interface().(string) + case "testpb.EchoRequest.a_consensus_address": + x.AConsensusAddress = value.Interface().(string) + case "testpb.EchoRequest.coins": + lv := value.List() + clv := lv.(*_EchoRequest_38_list) + x.Coins = *clv.list default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.EchoRequest")) @@ -1398,6 +1973,12 @@ func (x *fastReflection_EchoRequest) Mutable(fd protoreflect.FieldDescriptor) pr } value := &_EchoRequest_35_map{m: &x.MapStringCoin} return protoreflect.ValueOfMap(value) + case "testpb.EchoRequest.coins": + if x.Coins == nil { + x.Coins = []*v1beta1.Coin{} + } + value := &_EchoRequest_38_list{list: &x.Coins} + return protoreflect.ValueOfList(value) case "testpb.EchoRequest.u32": panic(fmt.Errorf("field u32 of message testpb.EchoRequest is not mutable")) case "testpb.EchoRequest.u64": @@ -1426,6 +2007,10 @@ func (x *fastReflection_EchoRequest) Mutable(fd protoreflect.FieldDescriptor) pr panic(fmt.Errorf("field shorthand_deprecated_field of message testpb.EchoRequest is not mutable")) case "testpb.EchoRequest.hidden_bool": panic(fmt.Errorf("field hidden_bool of message testpb.EchoRequest is not mutable")) + case "testpb.EchoRequest.a_validator_address": + panic(fmt.Errorf("field a_validator_address of message testpb.EchoRequest is not mutable")) + case "testpb.EchoRequest.a_consensus_address": + panic(fmt.Errorf("field a_consensus_address of message testpb.EchoRequest is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.EchoRequest")) @@ -1512,6 +2097,13 @@ func (x *fastReflection_EchoRequest) NewField(fd protoreflect.FieldDescriptor) p case "testpb.EchoRequest.map_string_coin": m := make(map[string]*v1beta1.Coin) return protoreflect.ValueOfMap(&_EchoRequest_35_map{m: &m}) + case "testpb.EchoRequest.a_validator_address": + return protoreflect.ValueOfString("") + case "testpb.EchoRequest.a_consensus_address": + return protoreflect.ValueOfString("") + case "testpb.EchoRequest.coins": + list := []*v1beta1.Coin{} + return protoreflect.ValueOfList(&_EchoRequest_38_list{list: &list}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.EchoRequest")) @@ -1758,6 +2350,20 @@ func (x *fastReflection_EchoRequest) ProtoMethods() *protoiface.Methods { } } } + l = len(x.AValidatorAddress) + if l > 0 { + n += 2 + l + runtime.Sov(uint64(l)) + } + l = len(x.AConsensusAddress) + if l > 0 { + n += 2 + l + runtime.Sov(uint64(l)) + } + if len(x.Coins) > 0 { + for _, e := range x.Coins { + l = options.Size(e) + n += 2 + l + runtime.Sov(uint64(l)) + } + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1787,6 +2393,42 @@ func (x *fastReflection_EchoRequest) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.Coins) > 0 { + for iNdEx := len(x.Coins) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Coins[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] = 0x2 + i-- + dAtA[i] = 0xb2 + } + } + if len(x.AConsensusAddress) > 0 { + i -= len(x.AConsensusAddress) + copy(dAtA[i:], x.AConsensusAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AConsensusAddress))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xaa + } + if len(x.AValidatorAddress) > 0 { + i -= len(x.AValidatorAddress) + copy(dAtA[i:], x.AValidatorAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AValidatorAddress))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xa2 + } if len(x.MapStringCoin) > 0 { MaRsHaLmAp := func(k string, v *v1beta1.Coin) (protoiface.MarshalOutput, error) { baseI := i @@ -3423,532 +4065,115 @@ func (x *fastReflection_EchoRequest) ProtoMethods() *protoiface.Methods { 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.MapStringCoin == nil { - x.MapStringCoin = make(map[string]*v1beta1.Coin) - } - var mapkey string - var mapvalue *v1beta1.Coin - 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 = &v1beta1.Coin{} - 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.MapStringCoin[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_AMessage protoreflect.MessageDescriptor - fd_AMessage_bar protoreflect.FieldDescriptor - fd_AMessage_baz protoreflect.FieldDescriptor -) - -func init() { - file_testpb_query_proto_init() - md_AMessage = File_testpb_query_proto.Messages().ByName("AMessage") - fd_AMessage_bar = md_AMessage.Fields().ByName("bar") - fd_AMessage_baz = md_AMessage.Fields().ByName("baz") -} - -var _ protoreflect.Message = (*fastReflection_AMessage)(nil) - -type fastReflection_AMessage AMessage - -func (x *AMessage) ProtoReflect() protoreflect.Message { - return (*fastReflection_AMessage)(x) -} - -func (x *AMessage) slowProtoReflect() protoreflect.Message { - mi := &file_testpb_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_AMessage_messageType fastReflection_AMessage_messageType -var _ protoreflect.MessageType = fastReflection_AMessage_messageType{} - -type fastReflection_AMessage_messageType struct{} - -func (x fastReflection_AMessage_messageType) Zero() protoreflect.Message { - return (*fastReflection_AMessage)(nil) -} -func (x fastReflection_AMessage_messageType) New() protoreflect.Message { - return new(fastReflection_AMessage) -} -func (x fastReflection_AMessage_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_AMessage -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_AMessage) Descriptor() protoreflect.MessageDescriptor { - return md_AMessage -} - -// 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_AMessage) Type() protoreflect.MessageType { - return _fastReflection_AMessage_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_AMessage) New() protoreflect.Message { - return new(fastReflection_AMessage) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_AMessage) Interface() protoreflect.ProtoMessage { - return (*AMessage)(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_AMessage) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Bar != "" { - value := protoreflect.ValueOfString(x.Bar) - if !f(fd_AMessage_bar, value) { - return - } - } - if x.Baz != int32(0) { - value := protoreflect.ValueOfInt32(x.Baz) - if !f(fd_AMessage_baz, 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_AMessage) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "testpb.AMessage.bar": - return x.Bar != "" - case "testpb.AMessage.baz": - return x.Baz != int32(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.AMessage")) - } - panic(fmt.Errorf("message testpb.AMessage 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_AMessage) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "testpb.AMessage.bar": - x.Bar = "" - case "testpb.AMessage.baz": - x.Baz = int32(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.AMessage")) - } - panic(fmt.Errorf("message testpb.AMessage 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_AMessage) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "testpb.AMessage.bar": - value := x.Bar - return protoreflect.ValueOfString(value) - case "testpb.AMessage.baz": - value := x.Baz - return protoreflect.ValueOfInt32(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.AMessage")) - } - panic(fmt.Errorf("message testpb.AMessage 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_AMessage) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "testpb.AMessage.bar": - x.Bar = value.Interface().(string) - case "testpb.AMessage.baz": - x.Baz = int32(value.Int()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.AMessage")) - } - panic(fmt.Errorf("message testpb.AMessage 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_AMessage) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "testpb.AMessage.bar": - panic(fmt.Errorf("field bar of message testpb.AMessage is not mutable")) - case "testpb.AMessage.baz": - panic(fmt.Errorf("field baz of message testpb.AMessage is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.AMessage")) - } - panic(fmt.Errorf("message testpb.AMessage 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_AMessage) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "testpb.AMessage.bar": - return protoreflect.ValueOfString("") - case "testpb.AMessage.baz": - return protoreflect.ValueOfInt32(int32(0)) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.AMessage")) - } - panic(fmt.Errorf("message testpb.AMessage 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_AMessage) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in testpb.AMessage", 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_AMessage) 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_AMessage) 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_AMessage) 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_AMessage) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*AMessage) - 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.Bar) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Baz != 0 { - n += 1 + runtime.Sov(uint64(x.Baz)) - } - 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().(*AMessage) - 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.Baz != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Baz)) - i-- - dAtA[i] = 0x10 - } - if len(x.Bar) > 0 { - i -= len(x.Bar) - copy(dAtA[i:], x.Bar) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Bar))) - 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().(*AMessage) - 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 postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - if iNdEx >= l { + if postIndex > 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 + if x.MapStringCoin == nil { + x.MapStringCoin = make(map[string]*v1beta1.Coin) } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: AMessage: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: AMessage: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + var mapkey string + var mapvalue *v1beta1.Coin + 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 = &v1beta1.Coin{} + 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.MapStringCoin[mapkey] = mapvalue + iNdEx = postIndex + case 36: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Bar", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AValidatorAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3976,13 +4201,13 @@ func (x *fastReflection_AMessage) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Bar = string(dAtA[iNdEx:postIndex]) + x.AValidatorAddress = 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 Baz", wireType) + case 37: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AConsensusAddress", wireType) } - x.Baz = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -3992,11 +4217,58 @@ func (x *fastReflection_AMessage) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.Baz |= int32(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.AConsensusAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 38: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Coins", 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.Coins = append(x.Coins, &v1beta1.Coin{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Coins[len(x.Coins)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -4535,6 +4807,49 @@ func (Enum) EnumDescriptor() ([]byte, []int) { return file_testpb_query_proto_rawDescGZIP(), []int{0} } +type AMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Bar string `protobuf:"bytes,1,opt,name=bar,proto3" json:"bar,omitempty"` + Baz int32 `protobuf:"varint,2,opt,name=baz,proto3" json:"baz,omitempty"` +} + +func (x *AMessage) Reset() { + *x = AMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_testpb_query_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AMessage) ProtoMessage() {} + +// Deprecated: Use AMessage.ProtoReflect.Descriptor instead. +func (*AMessage) Descriptor() ([]byte, []int) { + return file_testpb_query_proto_rawDescGZIP(), []int{0} +} + +func (x *AMessage) GetBar() string { + if x != nil { + return x.Bar + } + return "" +} + +func (x *AMessage) GetBaz() int32 { + if x != nil { + return x.Baz + } + return 0 +} + type EchoRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -4570,12 +4885,15 @@ type EchoRequest struct { MapStringString map[string]string `protobuf:"bytes,33,rep,name=map_string_string,json=mapStringString,proto3" json:"map_string_string,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` MapStringUint32 map[string]uint32 `protobuf:"bytes,34,rep,name=map_string_uint32,json=mapStringUint32,proto3" json:"map_string_uint32,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` MapStringCoin map[string]*v1beta1.Coin `protobuf:"bytes,35,rep,name=map_string_coin,json=mapStringCoin,proto3" json:"map_string_coin,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + AValidatorAddress string `protobuf:"bytes,36,opt,name=a_validator_address,json=aValidatorAddress,proto3" json:"a_validator_address,omitempty"` + AConsensusAddress string `protobuf:"bytes,37,opt,name=a_consensus_address,json=aConsensusAddress,proto3" json:"a_consensus_address,omitempty"` + Coins []*v1beta1.Coin `protobuf:"bytes,38,rep,name=coins,proto3" json:"coins,omitempty"` } func (x *EchoRequest) Reset() { *x = EchoRequest{} if protoimpl.UnsafeEnabled { - mi := &file_testpb_query_proto_msgTypes[0] + mi := &file_testpb_query_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4589,7 +4907,7 @@ func (*EchoRequest) ProtoMessage() {} // Deprecated: Use EchoRequest.ProtoReflect.Descriptor instead. func (*EchoRequest) Descriptor() ([]byte, []int) { - return file_testpb_query_proto_rawDescGZIP(), []int{0} + return file_testpb_query_proto_rawDescGZIP(), []int{1} } func (x *EchoRequest) GetU32() uint32 { @@ -4795,47 +5113,25 @@ func (x *EchoRequest) GetMapStringCoin() map[string]*v1beta1.Coin { return nil } -type AMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Bar string `protobuf:"bytes,1,opt,name=bar,proto3" json:"bar,omitempty"` - Baz int32 `protobuf:"varint,2,opt,name=baz,proto3" json:"baz,omitempty"` -} - -func (x *AMessage) Reset() { - *x = AMessage{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_query_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) +func (x *EchoRequest) GetAValidatorAddress() string { + if x != nil { + return x.AValidatorAddress } + return "" } -func (x *AMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AMessage) ProtoMessage() {} - -// Deprecated: Use AMessage.ProtoReflect.Descriptor instead. -func (*AMessage) Descriptor() ([]byte, []int) { - return file_testpb_query_proto_rawDescGZIP(), []int{1} -} - -func (x *AMessage) GetBar() string { +func (x *EchoRequest) GetAConsensusAddress() string { if x != nil { - return x.Bar + return x.AConsensusAddress } return "" } -func (x *AMessage) GetBaz() int32 { +func (x *EchoRequest) GetCoins() []*v1beta1.Coin { if x != nil { - return x.Baz + return x.Coins } - return 0 + return nil } type EchoResponse struct { @@ -4888,7 +5184,10 @@ var file_testpb_query_proto_rawDesc = []byte{ 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd1, 0x0b, 0x0a, 0x0b, 0x45, 0x63, 0x68, 0x6f, 0x52, 0x65, 0x71, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2e, 0x0a, 0x08, 0x41, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x12, 0x10, 0x0a, 0x03, 0x62, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x62, + 0x61, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x61, 0x7a, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x03, 0x62, 0x61, 0x7a, 0x22, 0xa8, 0x0d, 0x0a, 0x0b, 0x45, 0x63, 0x68, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x33, 0x32, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x75, 0x33, 0x32, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x36, 0x34, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x75, 0x36, 0x34, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x74, 0x72, 0x18, @@ -4967,47 +5266,58 @@ var file_testpb_query_proto_rawDesc = []byte{ 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x63, 0x68, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x61, 0x70, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x69, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, 0x6d, 0x61, 0x70, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x43, - 0x6f, 0x69, 0x6e, 0x1a, 0x42, 0x0a, 0x14, 0x4d, 0x61, 0x70, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 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, 0x42, 0x0a, 0x14, 0x4d, 0x61, 0x70, 0x53, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 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, 0x0d, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x5b, 0x0a, 0x12, 0x4d, - 0x61, 0x70, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x69, 0x6e, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x2f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x2e, 0x0a, 0x08, 0x41, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x62, 0x61, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x61, 0x7a, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x03, 0x62, 0x61, 0x7a, 0x22, 0x3d, 0x0a, 0x0c, 0x45, 0x63, 0x68, 0x6f, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x70, 0x62, 0x2e, 0x45, 0x63, 0x68, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x07, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2a, 0x64, 0x0a, 0x04, 0x45, 0x6e, 0x75, 0x6d, 0x12, - 0x14, 0x0a, 0x10, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, - 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x4f, 0x4e, - 0x45, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x54, 0x57, 0x4f, 0x10, - 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x46, 0x49, 0x56, 0x45, 0x10, 0x05, - 0x12, 0x1b, 0x0a, 0x0e, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x4e, 0x45, 0x47, 0x5f, 0x54, 0x48, 0x52, - 0x45, 0x45, 0x10, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x32, 0x3a, 0x0a, - 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x31, 0x0a, 0x04, 0x45, 0x63, 0x68, 0x6f, 0x12, 0x13, - 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x63, 0x68, 0x6f, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x63, 0x68, - 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x88, 0x01, 0x0a, 0x0a, 0x63, 0x6f, - 0x6d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x32, 0x2f, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0xa2, 0x02, - 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xca, 0x02, 0x06, - 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xe2, 0x02, 0x12, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x5c, - 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x54, 0x65, - 0x73, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x69, 0x6e, 0x12, 0x51, 0x0a, 0x13, 0x61, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x24, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x52, 0x11, 0x61, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x51, 0x0a, 0x13, 0x61, 0x5f, 0x63, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x25, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x11, 0x61, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2f, 0x0a, 0x05, 0x63, 0x6f, 0x69, + 0x6e, 0x73, 0x18, 0x26, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, + 0x6f, 0x69, 0x6e, 0x52, 0x05, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x1a, 0x42, 0x0a, 0x14, 0x4d, 0x61, + 0x70, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 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, 0x42, + 0x0a, 0x14, 0x4d, 0x61, 0x70, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x33, + 0x32, 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, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x1a, 0x5b, 0x0a, 0x12, 0x4d, 0x61, 0x70, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x43, + 0x6f, 0x69, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2f, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, + 0x3d, 0x0a, 0x0c, 0x45, 0x63, 0x68, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x2d, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x13, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x63, 0x68, 0x6f, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2a, 0x64, + 0x0a, 0x04, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x14, 0x0a, 0x10, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x55, + 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, + 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x45, 0x4e, + 0x55, 0x4d, 0x5f, 0x54, 0x57, 0x4f, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x45, 0x4e, 0x55, 0x4d, + 0x5f, 0x46, 0x49, 0x56, 0x45, 0x10, 0x05, 0x12, 0x1b, 0x0a, 0x0e, 0x45, 0x4e, 0x55, 0x4d, 0x5f, + 0x4e, 0x45, 0x47, 0x5f, 0x54, 0x48, 0x52, 0x45, 0x45, 0x10, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x01, 0x32, 0x3a, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x31, 0x0a, + 0x04, 0x45, 0x63, 0x68, 0x6f, 0x12, 0x13, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x45, + 0x63, 0x68, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x74, 0x65, 0x73, + 0x74, 0x70, 0x62, 0x2e, 0x45, 0x63, 0x68, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x42, 0x88, 0x01, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x42, + 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x63, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x2f, 0x76, 0x32, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, + 0x65, 0x73, 0x74, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x54, 0x65, + 0x73, 0x74, 0x70, 0x62, 0xca, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xe2, 0x02, 0x12, + 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -5026,8 +5336,8 @@ var file_testpb_query_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_testpb_query_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_testpb_query_proto_goTypes = []interface{}{ (Enum)(0), // 0: testpb.Enum - (*EchoRequest)(nil), // 1: testpb.EchoRequest - (*AMessage)(nil), // 2: testpb.AMessage + (*AMessage)(nil), // 1: testpb.AMessage + (*EchoRequest)(nil), // 2: testpb.EchoRequest (*EchoResponse)(nil), // 3: testpb.EchoResponse nil, // 4: testpb.EchoRequest.MapStringStringEntry nil, // 5: testpb.EchoRequest.MapStringUint32Entry @@ -5041,25 +5351,26 @@ var file_testpb_query_proto_depIdxs = []int32{ 7, // 0: testpb.EchoRequest.timestamp:type_name -> google.protobuf.Timestamp 8, // 1: testpb.EchoRequest.duration:type_name -> google.protobuf.Duration 0, // 2: testpb.EchoRequest.an_enum:type_name -> testpb.Enum - 2, // 3: testpb.EchoRequest.a_message:type_name -> testpb.AMessage + 1, // 3: testpb.EchoRequest.a_message:type_name -> testpb.AMessage 9, // 4: testpb.EchoRequest.a_coin:type_name -> cosmos.base.v1beta1.Coin 10, // 5: testpb.EchoRequest.page:type_name -> cosmos.base.query.v1beta1.PageRequest 0, // 6: testpb.EchoRequest.enums:type_name -> testpb.Enum 8, // 7: testpb.EchoRequest.durations:type_name -> google.protobuf.Duration - 2, // 8: testpb.EchoRequest.some_messages:type_name -> testpb.AMessage + 1, // 8: testpb.EchoRequest.some_messages:type_name -> testpb.AMessage 9, // 9: testpb.EchoRequest.positional3_varargs:type_name -> cosmos.base.v1beta1.Coin 4, // 10: testpb.EchoRequest.map_string_string:type_name -> testpb.EchoRequest.MapStringStringEntry 5, // 11: testpb.EchoRequest.map_string_uint32:type_name -> testpb.EchoRequest.MapStringUint32Entry 6, // 12: testpb.EchoRequest.map_string_coin:type_name -> testpb.EchoRequest.MapStringCoinEntry - 1, // 13: testpb.EchoResponse.request:type_name -> testpb.EchoRequest - 9, // 14: testpb.EchoRequest.MapStringCoinEntry.value:type_name -> cosmos.base.v1beta1.Coin - 1, // 15: testpb.Query.Echo:input_type -> testpb.EchoRequest - 3, // 16: testpb.Query.Echo:output_type -> testpb.EchoResponse - 16, // [16:17] is the sub-list for method output_type - 15, // [15:16] 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 + 9, // 13: testpb.EchoRequest.coins:type_name -> cosmos.base.v1beta1.Coin + 2, // 14: testpb.EchoResponse.request:type_name -> testpb.EchoRequest + 9, // 15: testpb.EchoRequest.MapStringCoinEntry.value:type_name -> cosmos.base.v1beta1.Coin + 2, // 16: testpb.Query.Echo:input_type -> testpb.EchoRequest + 3, // 17: testpb.Query.Echo:output_type -> testpb.EchoResponse + 17, // [17:18] is the sub-list for method output_type + 16, // [16:17] 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_testpb_query_proto_init() } @@ -5069,7 +5380,7 @@ func file_testpb_query_proto_init() { } if !protoimpl.UnsafeEnabled { file_testpb_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EchoRequest); i { + switch v := v.(*AMessage); i { case 0: return &v.state case 1: @@ -5081,7 +5392,7 @@ func file_testpb_query_proto_init() { } } file_testpb_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AMessage); i { + switch v := v.(*EchoRequest); i { case 0: return &v.state case 1: diff --git a/client/v2/internal/testpb/query_grpc.pb.go b/client/v2/internal/testpb/query_grpc.pb.go index 56d177ddc86f..9f444b76c729 100644 --- a/client/v2/internal/testpb/query_grpc.pb.go +++ b/client/v2/internal/testpb/query_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 +// - protoc-gen-go-grpc v1.3.0 // - protoc (unknown) // source: testpb/query.proto @@ -18,6 +18,10 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + Query_Echo_FullMethodName = "/testpb.Query/Echo" +) + // QueryClient is the client API for Query service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. @@ -36,7 +40,7 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { func (c *queryClient) Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error) { out := new(EchoResponse) - err := c.cc.Invoke(ctx, "/testpb.Query/Echo", in, out, opts...) + err := c.cc.Invoke(ctx, Query_Echo_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -82,7 +86,7 @@ func _Query_Echo_Handler(srv interface{}, ctx context.Context, dec func(interfac } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/testpb.Query/Echo", + FullMethod: Query_Echo_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Echo(ctx, req.(*EchoRequest)) diff --git a/client/v2/internal/util/util.go b/client/v2/internal/util/util.go index d37c023a8706..ed82d3973c30 100644 --- a/client/v2/internal/util/util.go +++ b/client/v2/internal/util/util.go @@ -1,6 +1,12 @@ package util import ( + "regexp" + "runtime/debug" + "strings" + + cosmos_proto "github.com/cosmos/cosmos-proto" + "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" "google.golang.org/protobuf/types/dynamicpb" @@ -8,19 +14,17 @@ import ( "cosmossdk.io/client/v2/internal/strcase" ) +// get build info to verify later if comment is supported +// this is a hack in because of the global api module package +// later versions unsupported by the current version can be added +var buildInfo, _ = debug.ReadBuildInfo() + +// DescriptorName returns the name of the descriptor in kebab case. func DescriptorKebabName(descriptor protoreflect.Descriptor) string { return strcase.ToKebab(string(descriptor.Name())) } -func DescriptorDocs(descriptor protoreflect.Descriptor) string { - return descriptor.ParentFile().SourceLocations().ByDescriptor(descriptor).LeadingComments -} - func ResolveMessageType(resolver protoregistry.MessageTypeResolver, descriptor protoreflect.MessageDescriptor) protoreflect.MessageType { - if resolver == nil { - resolver = protoregistry.GlobalTypes - } - typ, err := resolver.FindMessageByName(descriptor.FullName()) if err == nil { return typ @@ -28,3 +32,65 @@ func ResolveMessageType(resolver protoregistry.MessageTypeResolver, descriptor p return dynamicpb.NewMessageType(descriptor) } + +// IsSupportedVersion is used to determine in which version of a module / sdk a rpc was introduced. +// It returns false if the rpc has comment for an higher version than the current one. +// It returns true if the method descriptor contains no annotation. +func IsSupportedVersion(methodDesc protoreflect.MethodDescriptor) bool { + return isSupportedVersion(methodDesc, buildInfo) +} + +// isSupportedVersion is used to determine in which version of a module / sdk a rpc was introduced. +// It returns false if the rpc has comment for an higher version than the current one. +// It returns true if the method descriptor contains no annotation. +// It takes a buildInfo as argument to be able to test it. +func isSupportedVersion(methodDesc protoreflect.MethodDescriptor, buildInfo *debug.BuildInfo) bool { + hasVersion := proto.HasExtension(methodDesc.Options(), cosmos_proto.E_MethodAddedIn) + if !hasVersion || buildInfo == nil || len(buildInfo.Deps) == 0 { + return true + } + + version := proto.GetExtension(methodDesc.Options(), cosmos_proto.E_MethodAddedIn).(string) + moduleName, version := parseVersion(version) + if moduleName == "" || version == "" { + return true // if no comment consider it's supported + } + + for _, dep := range buildInfo.Deps { + if !strings.Contains(dep.Path, moduleName) { + continue + } + + return version <= dep.Version + } + + // if cannot find the module consider it isn't supported + // for instance the x/gov module wasn't extracted in v0.50 + // so it isn't present in the build info, however, that means + // it isn't supported in v0.50. + return false +} + +var sinceCommentRegex = regexp.MustCompile(`(\S+) (\S+)`) + +// parseVersion parses the `cosmos-sdk v0.xx` comment on rpc. +func parseVersion(input string) (string, string) { + var ( + moduleName string + version string + ) + + input = strings.ToLower(input) + input = strings.ReplaceAll(input, "cosmos sdk", "cosmos-sdk") + + matches := sinceCommentRegex.FindStringSubmatch(input) + if len(matches) >= 3 { + moduleName, version = strings.TrimPrefix(matches[1], "x/"), matches[2] + + if !strings.HasPrefix(version, "v") { + version = "v" + version + } + } + + return moduleName, version +} diff --git a/client/v2/internal/util/util_test.go b/client/v2/internal/util/util_test.go new file mode 100644 index 000000000000..60a713ed2143 --- /dev/null +++ b/client/v2/internal/util/util_test.go @@ -0,0 +1,125 @@ +package util + +import ( + "runtime/debug" + "testing" + + "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/reflect/protoregistry" + + _ "cosmossdk.io/client/v2/internal/testpb" +) + +func TestIsSupportedVersion(t *testing.T) { + mockBuildInfo := &debug.BuildInfo{ + Deps: []*debug.Module{ + { + Path: "github.com/cosmos/cosmos-sdk", + Version: "v0.50.0", + }, + { + Path: "cosmossdk.io/feegrant", + Version: "v0.1.0", + }, + }, + } + + cases := []struct { + messageName string + expected bool + }{ + { + messageName: "testpb.Msg.Send", + expected: true, + }, + { + messageName: "testpb.Query.Echo", + expected: true, + }, + { + messageName: "testpb.Msg.Clawback", + expected: false, + }, + } + + for _, tc := range cases { + t.Run(tc.messageName, func(t *testing.T) { + desc, err := protoregistry.GlobalFiles.FindDescriptorByName(protoreflect.FullName(tc.messageName)) + if err != nil { + t.Fatal(err) + } + + methodDesc := desc.(protoreflect.MethodDescriptor) + isSupported := isSupportedVersion(methodDesc, mockBuildInfo) + if isSupported != tc.expected { + t.Errorf("expected %v, got %v for %s", tc.expected, isSupported, methodDesc.FullName()) + } + }) + } +} + +func TestParseVersion(t *testing.T) { + cases := []struct { + input string + expectedModuleName string + expectedVersion string + }{ + { + input: "", + expectedModuleName: "", + expectedVersion: "", + }, + { + input: "Cosmos SDK 0.50", + expectedModuleName: "cosmos-sdk", + expectedVersion: "v0.50", + }, + { + input: "cosmos sdk 0.50", + expectedModuleName: "cosmos-sdk", + expectedVersion: "v0.50", + }, + { + input: "Cosmos-SDK 0.50", + expectedModuleName: "cosmos-sdk", + expectedVersion: "v0.50", + }, + { + input: "cosmos-sdk v0.50", + expectedModuleName: "cosmos-sdk", + expectedVersion: "v0.50", + }, + { + input: "cosmos-sdk v0.50.1", + expectedModuleName: "cosmos-sdk", + expectedVersion: "v0.50.1", + }, + { + input: "cosmos-sdk 0.47.0-veronica", + expectedModuleName: "cosmos-sdk", + expectedVersion: "v0.47.0-veronica", + }, + { + input: "x/feegrant v0.1.0", + expectedModuleName: "feegrant", + expectedVersion: "v0.1.0", + }, + { + input: "x/feegrant 0.1", + expectedModuleName: "feegrant", + expectedVersion: "v0.1", + }, + } + + for _, tc := range cases { + t.Run(tc.input, func(t *testing.T) { + moduleName, version := parseVersion(tc.input) + if moduleName != tc.expectedModuleName { + t.Errorf("expected module name %s, got %s", tc.expectedModuleName, moduleName) + } + if version != tc.expectedVersion { + t.Errorf("expected version %s, got %s", tc.expectedVersion, version) + } + }) + } +} diff --git a/client/v2/sonar-project.properties b/client/v2/sonar-project.properties deleted file mode 100644 index d08e6a24ac5b..000000000000 --- a/client/v2/sonar-project.properties +++ /dev/null @@ -1,14 +0,0 @@ -sonar.projectKey=cosmos-sdk-client-v2 -sonar.organization=cosmos - -sonar.projectName=Cosmos SDK - Client V2 -sonar.project.monorepo.enabled=true - -sonar.sources=. -sonar.exclusions=**/*_test.go,**/*.pb.go,**/*.pulsar.go -sonar.tests=. -sonar.test.inclusions=**/*_test.go -sonar.go.coverage.reportPaths=coverage.out - -sonar.sourceEncoding=UTF-8 -sonar.scm.provider=git \ No newline at end of file diff --git a/codec/address/bech32_codec.go b/codec/address/bech32_codec.go index aaac921f35e2..45e9d2c01177 100644 --- a/codec/address/bech32_codec.go +++ b/codec/address/bech32_codec.go @@ -46,6 +46,10 @@ func (bc Bech32Codec) StringToBytes(text string) ([]byte, error) { // BytesToString decodes bytes to text func (bc Bech32Codec) BytesToString(bz []byte) (string, error) { + if len(bz) == 0 { + return "", nil + } + text, err := bech32.ConvertAndEncode(bc.Bech32Prefix, bz) if err != nil { return "", err diff --git a/codec/bench_test.go b/codec/bench_test.go index cb3c821213e1..d5b5fa132dc9 100644 --- a/codec/bench_test.go +++ b/codec/bench_test.go @@ -3,24 +3,35 @@ package codec_test import ( "testing" - bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" "github.com/stretchr/testify/require" protov2 "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/dynamicpb" + bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" + codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/testutil/testdata" + sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" ) +type bankSendWrapper struct { + *banktypes.MsgSend +} + +func (msg bankSendWrapper) GetSigners() []sdk.AccAddress { + fromAddress, _ := sdk.AccAddressFromBech32(msg.FromAddress) + return []sdk.AccAddress{fromAddress} +} + func BenchmarkLegacyGetSigners(b *testing.B) { _, _, addr := testdata.KeyTestPubAddr() - msg := &banktypes.MsgSend{ + msg := bankSendWrapper{&banktypes.MsgSend{ FromAddress: addr.String(), ToAddress: "", Amount: nil, - } + }} b.ResetTimer() for i := 0; i < b.N; i++ { diff --git a/codec/collections.go b/codec/collections.go index 2904475c8b60..cded358c5cc9 100644 --- a/codec/collections.go +++ b/codec/collections.go @@ -4,12 +4,13 @@ import ( "fmt" "reflect" + "github.com/cosmos/gogoproto/proto" gogotypes "github.com/cosmos/gogoproto/types" + "google.golang.org/protobuf/encoding/protojson" + protov2 "google.golang.org/protobuf/proto" "cosmossdk.io/collections" collcodec "cosmossdk.io/collections/codec" - - "github.com/cosmos/gogoproto/proto" ) // BoolValue implements a ValueCodec that saves the bool value @@ -52,10 +53,13 @@ type protoMessage[T any] interface { // CollValue inits a collections.ValueCodec for a generic gogo protobuf message. func CollValue[T any, PT protoMessage[T]](cdc BinaryCodec) collcodec.ValueCodec[T] { - return &collValue[T, PT]{cdc.(Codec)} + return &collValue[T, PT]{cdc.(Codec), proto.MessageName(PT(new(T)))} } -type collValue[T any, PT protoMessage[T]] struct{ cdc Codec } +type collValue[T any, PT protoMessage[T]] struct { + cdc Codec + messageName string +} func (c collValue[T, PT]) Encode(value T) ([]byte, error) { return c.cdc.Marshal(PT(&value)) @@ -80,7 +84,52 @@ func (c collValue[T, PT]) Stringify(value T) string { } func (c collValue[T, PT]) ValueType() string { - return "gogoproto/" + proto.MessageName(PT(new(T))) + return "github.com/cosmos/gogoproto/" + c.messageName +} + +type protoMessageV2[T any] interface { + *T + protov2.Message +} + +// CollValueV2 is used for protobuf values of the newest google.golang.org/protobuf API. +func CollValueV2[T any, PT protoMessageV2[T]]() collcodec.ValueCodec[PT] { + return &collValue2[T, PT]{ + messageName: string(PT(new(T)).ProtoReflect().Descriptor().FullName()), + } +} + +type collValue2[T any, PT protoMessageV2[T]] struct { + messageName string +} + +func (c collValue2[T, PT]) Encode(value PT) ([]byte, error) { + protov2MarshalOpts := protov2.MarshalOptions{Deterministic: true} + return protov2MarshalOpts.Marshal(value) +} + +func (c collValue2[T, PT]) Decode(b []byte) (PT, error) { + var value T + err := protov2.Unmarshal(b, PT(&value)) + return &value, err +} + +func (c collValue2[T, PT]) EncodeJSON(value PT) ([]byte, error) { + return protojson.Marshal(value) +} + +func (c collValue2[T, PT]) DecodeJSON(b []byte) (PT, error) { + var value T + err := protojson.Unmarshal(b, PT(&value)) + return &value, err +} + +func (c collValue2[T, PT]) Stringify(value PT) string { + return fmt.Sprintf("%v", value) +} + +func (c collValue2[T, PT]) ValueType() string { + return "google.golang.org/protobuf/" + c.messageName } // CollInterfaceValue instantiates a new collections.ValueCodec for a generic diff --git a/codec/collections_test.go b/codec/collections_test.go index 9e8ef18afa18..5aff0e0e06df 100644 --- a/codec/collections_test.go +++ b/codec/collections_test.go @@ -3,14 +3,17 @@ package codec_test import ( "testing" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/testutil/testdata" - + gogotypes "github.com/cosmos/gogoproto/types" + "github.com/google/go-cmp/cmp" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/testing/protocmp" + "google.golang.org/protobuf/types/known/wrapperspb" "cosmossdk.io/collections/colltest" + + "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" - gogotypes "github.com/cosmos/gogoproto/types" + "github.com/cosmos/cosmos-sdk/testutil/testdata" ) func TestCollectionsCorrectness(t *testing.T) { @@ -21,6 +24,28 @@ func TestCollectionsCorrectness(t *testing.T) { }) }) + t.Run("CollValueV2", func(t *testing.T) { + // NOTE: we cannot use colltest.TestValueCodec because protov2 has different + // compare semantics than protov1. We need to use protocmp.Transform() alongside + // cmp to ensure equality. + encoder := codec.CollValueV2[wrapperspb.UInt64Value]() + value := &wrapperspb.UInt64Value{Value: 500} + encodedValue, err := encoder.Encode(value) + require.NoError(t, err) + decodedValue, err := encoder.Decode(encodedValue) + require.NoError(t, err) + require.True(t, cmp.Equal(value, decodedValue, protocmp.Transform()), "encoding and decoding produces different values") + + encodedJSONValue, err := encoder.EncodeJSON(value) + require.NoError(t, err) + decodedJSONValue, err := encoder.DecodeJSON(encodedJSONValue) + require.NoError(t, err) + require.True(t, cmp.Equal(value, decodedJSONValue, protocmp.Transform()), "encoding and decoding produces different values") + require.NotEmpty(t, encoder.ValueType()) + + _ = encoder.Stringify(value) + }) + t.Run("BoolValue", func(t *testing.T) { colltest.TestValueCodec(t, codec.BoolValue, true) colltest.TestValueCodec(t, codec.BoolValue, false) diff --git a/codec/legacy/amino_msg_test.go b/codec/legacy/amino_msg_test.go index c38317020e76..ac13f5a1b8c9 100644 --- a/codec/legacy/amino_msg_test.go +++ b/codec/legacy/amino_msg_test.go @@ -4,10 +4,11 @@ import ( "strings" "testing" + "github.com/stretchr/testify/require" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/legacy" "github.com/cosmos/cosmos-sdk/testutil/testdata" - "github.com/stretchr/testify/require" ) func TestRegisterAminoMsg(t *testing.T) { diff --git a/codec/proto_codec.go b/codec/proto_codec.go index b66c0f348a09..11fa7859c1c1 100644 --- a/codec/proto_codec.go +++ b/codec/proto_codec.go @@ -2,7 +2,6 @@ package codec import ( "encoding/binary" - "encoding/json" "errors" "fmt" "strings" @@ -24,9 +23,9 @@ import ( // ProtoCodecMarshaler defines an interface for codecs that utilize Protobuf for both // binary and JSON encoding. +// Deprecated: Use Codec instead. type ProtoCodecMarshaler interface { Codec - InterfaceRegistry() types.InterfaceRegistry } // ProtoCodec defines a codec that utilizes Protobuf for both binary and JSON @@ -35,10 +34,7 @@ type ProtoCodec struct { interfaceRegistry types.InterfaceRegistry } -var ( - _ Codec = &ProtoCodec{} - _ ProtoCodecMarshaler = &ProtoCodec{} -) +var _ Codec = (*ProtoCodec)(nil) // NewProtoCodec returns a reference to a new ProtoCodec func NewProtoCodec(interfaceRegistry types.InterfaceRegistry) *ProtoCodec { @@ -194,27 +190,7 @@ func (pc *ProtoCodec) MarshalAminoJSON(msg gogoproto.Message) ([]byte, error) { if err != nil { return nil, err } - jsonBytes, err := encoder.Marshal(protoMsg) - if err != nil { - return nil, err - } - // TODO: remove this sort once https://github.com/cosmos/cosmos-sdk/issues/2350#issuecomment-1542715157 lands - // the encoder should be rendering in lexical order - return sortJSON(jsonBytes) -} - -// sortJSON sorts the JSON keys of the given JSON encoded byte slice. -func sortJSON(toSortJSON []byte) ([]byte, error) { - var c interface{} - err := json.Unmarshal(toSortJSON, &c) - if err != nil { - return nil, err - } - js, err := json.Marshal(c) - if err != nil { - return nil, err - } - return js, nil + return encoder.Marshal(protoMsg) } // UnmarshalJSON implements JSONCodec.UnmarshalJSON method, @@ -369,7 +345,8 @@ type grpcProtoCodec struct { func (g grpcProtoCodec) Marshal(v interface{}) ([]byte, error) { switch m := v.(type) { case proto.Message: - return proto.Marshal(m) + protov2MarshalOpts := proto.MarshalOptions{Deterministic: true} + return protov2MarshalOpts.Marshal(m) case gogoproto.Message: return g.cdc.Marshal(m) default: diff --git a/codec/proto_codec_test.go b/codec/proto_codec_test.go index d5ade07f6e0a..95236a472d92 100644 --- a/codec/proto_codec_test.go +++ b/codec/proto_codec_test.go @@ -5,9 +5,6 @@ import ( "reflect" "testing" - bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" - basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" - "cosmossdk.io/x/tx/signing" "github.com/cosmos/gogoproto/proto" "github.com/stretchr/testify/require" "google.golang.org/grpc/codes" @@ -16,6 +13,11 @@ import ( protov2 "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoregistry" + bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" + basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + sdkmath "cosmossdk.io/math" + "cosmossdk.io/x/tx/signing" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/testutil/testdata" @@ -190,7 +192,7 @@ func TestGetSigners(t *testing.T) { testAddr2 := sdk.AccAddress("test2") testAddrStr2 := testAddr2.String() - msgSendV1 := banktypes.NewMsgSend(testAddr, testAddr2, sdk.NewCoins(sdk.NewCoin("foo", sdk.NewInt(1)))) + msgSendV1 := banktypes.NewMsgSend(testAddr, testAddr2, sdk.NewCoins(sdk.NewCoin("foo", sdkmath.NewInt(1)))) msgSendV2 := &bankv1beta1.MsgSend{ FromAddress: testAddrStr, ToAddress: testAddrStr2, diff --git a/codec/testutil/codec.go b/codec/testutil/codec.go index 971994c3d731..4887aa2727b5 100644 --- a/codec/testutil/codec.go +++ b/codec/testutil/codec.go @@ -1,9 +1,10 @@ package testutil import ( - "cosmossdk.io/x/tx/signing" "github.com/cosmos/gogoproto/proto" + "cosmossdk.io/x/tx/signing" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/address" codectypes "github.com/cosmos/cosmos-sdk/codec/types" diff --git a/codec/types/any.go b/codec/types/any.go index 334bed746380..bef5441fd170 100644 --- a/codec/types/any.go +++ b/codec/types/any.go @@ -4,6 +4,7 @@ import ( fmt "fmt" "github.com/cosmos/gogoproto/proto" + protov2 "google.golang.org/protobuf/proto" errorsmod "cosmossdk.io/errors" @@ -63,13 +64,22 @@ func NewAnyWithValue(v proto.Message) (*Any, error) { return nil, errorsmod.Wrap(sdkerrors.ErrPackAny, "Expecting non nil value to create a new Any") } - bz, err := proto.Marshal(v) + var ( + bz []byte + err error + ) + if msg, ok := v.(protov2.Message); ok { + protov2MarshalOpts := protov2.MarshalOptions{Deterministic: true} + bz, err = protov2MarshalOpts.Marshal(msg) + } else { + bz, err = proto.Marshal(v) + } if err != nil { return nil, err } return &Any{ - TypeUrl: "/" + proto.MessageName(v), + TypeUrl: MsgTypeURL(v), Value: bz, cachedValue: v, }, nil @@ -94,8 +104,18 @@ func UnsafePackAny(x interface{}) *Any { // the packed value so that it can be retrieved from GetCachedValue without // unmarshaling func (any *Any) pack(x proto.Message) error { - any.TypeUrl = "/" + proto.MessageName(x) - bz, err := proto.Marshal(x) + any.TypeUrl = MsgTypeURL(x) + + var ( + bz []byte + err error + ) + if msg, ok := x.(protov2.Message); ok { + protov2MarshalOpts := protov2.MarshalOptions{Deterministic: true} + bz, err = protov2MarshalOpts.Marshal(msg) + } else { + bz, err = proto.Marshal(x) + } if err != nil { return err } diff --git a/codec/types/compat.go b/codec/types/compat.go index 3b669385624f..080ca321c72e 100644 --- a/codec/types/compat.go +++ b/codec/types/compat.go @@ -7,7 +7,6 @@ import ( "github.com/cosmos/gogoproto/jsonpb" "github.com/cosmos/gogoproto/proto" - amino "github.com/tendermint/go-amino" ) diff --git a/codec/types/interface_registry.go b/codec/types/interface_registry.go index 50a5ca01c126..93fbca7c8850 100644 --- a/codec/types/interface_registry.go +++ b/codec/types/interface_registry.go @@ -1,6 +1,7 @@ package types import ( + "errors" "fmt" "reflect" @@ -12,6 +13,17 @@ import ( "cosmossdk.io/x/tx/signing" ) +var ( + + // MaxUnpackAnySubCalls extension point that defines the maximum number of sub-calls allowed during the unpacking + // process of protobuf Any messages. + MaxUnpackAnySubCalls = 100 + + // MaxUnpackAnyRecursionDepth extension point that defines the maximum allowed recursion depth during protobuf Any + // message unpacking. + MaxUnpackAnyRecursionDepth = 10 +) + // AnyUnpacker is an interface which allows safely unpacking types packed // in Any's against a whitelist of registered types type AnyUnpacker interface { @@ -187,7 +199,7 @@ func (registry *interfaceRegistry) EnsureRegistered(impl interface{}) error { // same typeURL. func (registry *interfaceRegistry) RegisterImplementations(iface interface{}, impls ...proto.Message) { for _, impl := range impls { - typeURL := "/" + proto.MessageName(impl) + typeURL := MsgTypeURL(impl) registry.registerImpl(iface, typeURL, impl) } } @@ -270,6 +282,45 @@ func (registry *interfaceRegistry) ListImplementations(ifaceName string) []strin } func (registry *interfaceRegistry) UnpackAny(any *Any, iface interface{}) error { + unpacker := &statefulUnpacker{ + registry: registry, + maxDepth: MaxUnpackAnyRecursionDepth, + maxCalls: &sharedCounter{count: MaxUnpackAnySubCalls}, + } + return unpacker.UnpackAny(any, iface) +} + +// sharedCounter is a type that encapsulates a counter value +type sharedCounter struct { + count int +} + +// statefulUnpacker is a struct that helps in deserializing and unpacking +// protobuf Any messages while maintaining certain stateful constraints. +type statefulUnpacker struct { + registry *interfaceRegistry + maxDepth int + maxCalls *sharedCounter +} + +// cloneForRecursion returns a new statefulUnpacker instance with maxDepth reduced by one, preserving the registry and maxCalls. +func (r statefulUnpacker) cloneForRecursion() *statefulUnpacker { + return &statefulUnpacker{ + registry: r.registry, + maxDepth: r.maxDepth - 1, + maxCalls: r.maxCalls, + } +} + +// UnpackAny deserializes a protobuf Any message into the provided interface, ensuring the interface is a pointer. +// It applies stateful constraints such as max depth and call limits, and unpacks interfaces if required. +func (r *statefulUnpacker) UnpackAny(any *Any, iface interface{}) error { + if r.maxDepth == 0 { + return errors.New("max depth exceeded") + } + if r.maxCalls.count == 0 { + return errors.New("call limit exceeded") + } // here we gracefully handle the case in which `any` itself is `nil`, which may occur in message decoding if any == nil { return nil @@ -280,6 +331,8 @@ func (registry *interfaceRegistry) UnpackAny(any *Any, iface interface{}) error return nil } + r.maxCalls.count-- + rv := reflect.ValueOf(iface) if rv.Kind() != reflect.Ptr { return fmt.Errorf("UnpackAny expects a pointer") @@ -295,7 +348,7 @@ func (registry *interfaceRegistry) UnpackAny(any *Any, iface interface{}) error } } - imap, found := registry.interfaceImpls[rt] + imap, found := r.registry.interfaceImpls[rt] if !found { return fmt.Errorf("no registered implementations of type %+v", rt) } @@ -315,7 +368,7 @@ func (registry *interfaceRegistry) UnpackAny(any *Any, iface interface{}) error return err } - err = UnpackInterfaces(msg, registry) + err = UnpackInterfaces(msg, r.cloneForRecursion()) if err != nil { return err } diff --git a/codec/types/util.go b/codec/types/util.go new file mode 100644 index 000000000000..b29fb33b5034 --- /dev/null +++ b/codec/types/util.go @@ -0,0 +1,15 @@ +package types + +import ( + "github.com/cosmos/gogoproto/proto" + protov2 "google.golang.org/protobuf/proto" +) + +// MsgTypeURL returns the TypeURL of a `sdk.Msg`. +func MsgTypeURL(msg proto.Message) string { + if m, ok := msg.(protov2.Message); ok { + return "/" + string(m.ProtoReflect().Descriptor().FullName()) + } + + return "/" + proto.MessageName(msg) +} diff --git a/codec/unknownproto/unknown_fields.go b/codec/unknownproto/unknown_fields.go index 320afc4a657a..4c08c4fe9a6f 100644 --- a/codec/unknownproto/unknown_fields.go +++ b/codec/unknownproto/unknown_fields.go @@ -12,8 +12,9 @@ import ( "github.com/cosmos/gogoproto/jsonpb" "github.com/cosmos/gogoproto/proto" - "github.com/cosmos/gogoproto/protoc-gen-gogo/descriptor" "google.golang.org/protobuf/encoding/protowire" + protov2 "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/descriptorpb" "github.com/cosmos/cosmos-sdk/codec/types" ) @@ -39,9 +40,23 @@ func RejectUnknownFieldsStrict(bz []byte, msg proto.Message, resolver jsonpb.Any // This function traverses inside of messages nested via google.protobuf.Any. It does not do any deserialization of the proto.Message. // An AnyResolver must be provided for traversing inside google.protobuf.Any's. func RejectUnknownFields(bz []byte, msg proto.Message, allowUnknownNonCriticals bool, resolver jsonpb.AnyResolver) (hasUnknownNonCriticals bool, err error) { + // recursion limit with same default as https://github.com/protocolbuffers/protobuf-go/blob/v1.35.2/encoding/protowire/wire.go#L28 + return doRejectUnknownFields(bz, msg, allowUnknownNonCriticals, resolver, 10_000) +} + +func doRejectUnknownFields( + bz []byte, + msg proto.Message, + allowUnknownNonCriticals bool, + resolver jsonpb.AnyResolver, + recursionLimit int, +) (hasUnknownNonCriticals bool, err error) { if len(bz) == 0 { return hasUnknownNonCriticals, nil } + if recursionLimit == 0 { + return false, errors.New("recursion limit reached") + } desc, ok := msg.(descriptorIface) if !ok { @@ -68,7 +83,7 @@ func RejectUnknownFields(bz []byte, msg proto.Message, allowUnknownNonCriticals Type: reflect.ValueOf(msg).Type().String(), TagNum: tagNum, GotWireType: wireType, - WantWireType: protowire.Type(fieldDescProto.WireType()), + WantWireType: toProtowireType(fieldDescProto.GetType()), } } @@ -101,14 +116,14 @@ func RejectUnknownFields(bz []byte, msg proto.Message, allowUnknownNonCriticals bz = bz[n:] // An unknown but non-critical field or just a scalar type (aka *INT and BYTES like). - if fieldDescProto == nil || fieldDescProto.IsScalar() { + if fieldDescProto == nil || isScalar(fieldDescProto) { continue } protoMessageName := fieldDescProto.GetTypeName() if protoMessageName == "" { switch typ := fieldDescProto.GetType(); typ { - case descriptor.FieldDescriptorProto_TYPE_STRING, descriptor.FieldDescriptorProto_TYPE_BYTES: + case descriptorpb.FieldDescriptorProto_TYPE_STRING, descriptorpb.FieldDescriptorProto_TYPE_BYTES: // At this point only TYPE_STRING is expected to be unregistered, since FieldDescriptorProto.IsScalar() returns false for // TYPE_BYTES and TYPE_STRING as per // https://github.com/cosmos/gogoproto/blob/5628607bb4c51c3157aacc3a50f0ab707582b805/protoc-gen-gogo/descriptor/descriptor.go#L95-L118 @@ -129,7 +144,7 @@ func RejectUnknownFields(bz []byte, msg proto.Message, allowUnknownNonCriticals if protoMessageName == ".google.protobuf.Any" { // Firstly typecheck types.Any to ensure nothing snuck in. - hasUnknownNonCriticalsChild, err := RejectUnknownFields(fieldBytes, (*types.Any)(nil), allowUnknownNonCriticals, resolver) + hasUnknownNonCriticalsChild, err := doRejectUnknownFields(fieldBytes, (*types.Any)(nil), allowUnknownNonCriticals, resolver, recursionLimit-1) hasUnknownNonCriticals = hasUnknownNonCriticals || hasUnknownNonCriticalsChild if err != nil { return hasUnknownNonCriticals, err @@ -152,7 +167,7 @@ func RejectUnknownFields(bz []byte, msg proto.Message, allowUnknownNonCriticals } } - hasUnknownNonCriticalsChild, err := RejectUnknownFields(fieldBytes, msg, allowUnknownNonCriticals, resolver) + hasUnknownNonCriticalsChild, err := doRejectUnknownFields(fieldBytes, msg, allowUnknownNonCriticals, resolver, recursionLimit-1) hasUnknownNonCriticals = hasUnknownNonCriticals || hasUnknownNonCriticalsChild if err != nil { return hasUnknownNonCriticals, err @@ -199,68 +214,68 @@ func protoMessageForTypeName(protoMessageName string) (proto.Message, error) { // checks is a mapping of protowire.Type to supported descriptor.FieldDescriptorProto_Type. // it is implemented this way so as to have constant time lookups and avoid the overhead // from O(n) walking of switch. The change to using this mapping boosts throughput by about 200%. -var checks = [...]map[descriptor.FieldDescriptorProto_Type]bool{ +var checks = [...]map[descriptorpb.FieldDescriptorProto_Type]bool{ // "0 Varint: int32, int64, uint32, uint64, sint32, sint64, bool, enum" 0: { - descriptor.FieldDescriptorProto_TYPE_INT32: true, - descriptor.FieldDescriptorProto_TYPE_INT64: true, - descriptor.FieldDescriptorProto_TYPE_UINT32: true, - descriptor.FieldDescriptorProto_TYPE_UINT64: true, - descriptor.FieldDescriptorProto_TYPE_SINT32: true, - descriptor.FieldDescriptorProto_TYPE_SINT64: true, - descriptor.FieldDescriptorProto_TYPE_BOOL: true, - descriptor.FieldDescriptorProto_TYPE_ENUM: true, + descriptorpb.FieldDescriptorProto_TYPE_INT32: true, + descriptorpb.FieldDescriptorProto_TYPE_INT64: true, + descriptorpb.FieldDescriptorProto_TYPE_UINT32: true, + descriptorpb.FieldDescriptorProto_TYPE_UINT64: true, + descriptorpb.FieldDescriptorProto_TYPE_SINT32: true, + descriptorpb.FieldDescriptorProto_TYPE_SINT64: true, + descriptorpb.FieldDescriptorProto_TYPE_BOOL: true, + descriptorpb.FieldDescriptorProto_TYPE_ENUM: true, }, // "1 64-bit: fixed64, sfixed64, double" 1: { - descriptor.FieldDescriptorProto_TYPE_FIXED64: true, - descriptor.FieldDescriptorProto_TYPE_SFIXED64: true, - descriptor.FieldDescriptorProto_TYPE_DOUBLE: true, + descriptorpb.FieldDescriptorProto_TYPE_FIXED64: true, + descriptorpb.FieldDescriptorProto_TYPE_SFIXED64: true, + descriptorpb.FieldDescriptorProto_TYPE_DOUBLE: true, }, // "2 Length-delimited: string, bytes, embedded messages, packed repeated fields" 2: { - descriptor.FieldDescriptorProto_TYPE_STRING: true, - descriptor.FieldDescriptorProto_TYPE_BYTES: true, - descriptor.FieldDescriptorProto_TYPE_MESSAGE: true, + descriptorpb.FieldDescriptorProto_TYPE_STRING: true, + descriptorpb.FieldDescriptorProto_TYPE_BYTES: true, + descriptorpb.FieldDescriptorProto_TYPE_MESSAGE: true, // The following types can be packed repeated. // ref: "Only repeated fields of primitive numeric types (types which use the varint, 32-bit, or 64-bit wire types) can be declared "packed"." // ref: https://developers.google.com/protocol-buffers/docs/encoding#packed - descriptor.FieldDescriptorProto_TYPE_INT32: true, - descriptor.FieldDescriptorProto_TYPE_INT64: true, - descriptor.FieldDescriptorProto_TYPE_UINT32: true, - descriptor.FieldDescriptorProto_TYPE_UINT64: true, - descriptor.FieldDescriptorProto_TYPE_SINT32: true, - descriptor.FieldDescriptorProto_TYPE_SINT64: true, - descriptor.FieldDescriptorProto_TYPE_BOOL: true, - descriptor.FieldDescriptorProto_TYPE_ENUM: true, - descriptor.FieldDescriptorProto_TYPE_FIXED64: true, - descriptor.FieldDescriptorProto_TYPE_SFIXED64: true, - descriptor.FieldDescriptorProto_TYPE_DOUBLE: true, + descriptorpb.FieldDescriptorProto_TYPE_INT32: true, + descriptorpb.FieldDescriptorProto_TYPE_INT64: true, + descriptorpb.FieldDescriptorProto_TYPE_UINT32: true, + descriptorpb.FieldDescriptorProto_TYPE_UINT64: true, + descriptorpb.FieldDescriptorProto_TYPE_SINT32: true, + descriptorpb.FieldDescriptorProto_TYPE_SINT64: true, + descriptorpb.FieldDescriptorProto_TYPE_BOOL: true, + descriptorpb.FieldDescriptorProto_TYPE_ENUM: true, + descriptorpb.FieldDescriptorProto_TYPE_FIXED64: true, + descriptorpb.FieldDescriptorProto_TYPE_SFIXED64: true, + descriptorpb.FieldDescriptorProto_TYPE_DOUBLE: true, }, // "3 Start group: groups (deprecated)" 3: { - descriptor.FieldDescriptorProto_TYPE_GROUP: true, + descriptorpb.FieldDescriptorProto_TYPE_GROUP: true, }, // "4 End group: groups (deprecated)" 4: { - descriptor.FieldDescriptorProto_TYPE_GROUP: true, + descriptorpb.FieldDescriptorProto_TYPE_GROUP: true, }, // "5 32-bit: fixed32, sfixed32, float" 5: { - descriptor.FieldDescriptorProto_TYPE_FIXED32: true, - descriptor.FieldDescriptorProto_TYPE_SFIXED32: true, - descriptor.FieldDescriptorProto_TYPE_FLOAT: true, + descriptorpb.FieldDescriptorProto_TYPE_FIXED32: true, + descriptorpb.FieldDescriptorProto_TYPE_SFIXED32: true, + descriptorpb.FieldDescriptorProto_TYPE_FLOAT: true, }, } // canEncodeType returns true if the wireType is suitable for encoding the descriptor type. // See https://developers.google.com/protocol-buffers/docs/encoding#structure. -func canEncodeType(wireType protowire.Type, descType descriptor.FieldDescriptorProto_Type) bool { +func canEncodeType(wireType protowire.Type, descType descriptorpb.FieldDescriptorProto_Type) bool { if iwt := int(wireType); iwt < 0 || iwt >= len(checks) { return false } @@ -330,11 +345,11 @@ func (twt *errUnknownField) Error() string { var _ error = (*errUnknownField)(nil) var ( - protoFileToDesc = make(map[string]*descriptor.FileDescriptorProto) + protoFileToDesc = make(map[string]*descriptorpb.FileDescriptorProto) protoFileToDescMu sync.RWMutex ) -func unnestDesc(mdescs []*descriptor.DescriptorProto, indices []int) *descriptor.DescriptorProto { +func unnestDesc(mdescs []*descriptorpb.DescriptorProto, indices []int) *descriptorpb.DescriptorProto { mdesc := mdescs[indices[0]] for _, index := range indices[1:] { mdesc = mdesc.NestedType[index] @@ -342,9 +357,9 @@ func unnestDesc(mdescs []*descriptor.DescriptorProto, indices []int) *descriptor return mdesc } -// Invoking descriptor.ForMessage(proto.Message.(Descriptor).Descriptor()) is incredibly slow +// Invoking descriptorpb.ForMessage(proto.Message.(Descriptor).Descriptor()) is incredibly slow // for every single message, thus the need for a hand-rolled custom version that's performant and cacheable. -func extractFileDescMessageDesc(desc descriptorIface) (*descriptor.FileDescriptorProto, *descriptor.DescriptorProto, error) { +func extractFileDescMessageDesc(desc descriptorIface) (*descriptorpb.FileDescriptorProto, *descriptorpb.DescriptorProto, error) { gzippedPb, indices := desc.Descriptor() protoFileToDescMu.RLock() @@ -365,8 +380,8 @@ func extractFileDescMessageDesc(desc descriptorIface) (*descriptor.FileDescripto return nil, nil, err } - fdesc := new(descriptor.FileDescriptorProto) - if err := proto.Unmarshal(protoBlob, fdesc); err != nil { + fdesc := new(descriptorpb.FileDescriptorProto) + if err := protov2.Unmarshal(protoBlob, fdesc); err != nil { return nil, nil, err } @@ -380,8 +395,8 @@ func extractFileDescMessageDesc(desc descriptorIface) (*descriptor.FileDescripto } type descriptorMatch struct { - cache map[int32]*descriptor.FieldDescriptorProto - desc *descriptor.DescriptorProto + cache map[int32]*descriptorpb.FieldDescriptorProto + desc *descriptorpb.DescriptorProto } var ( @@ -390,7 +405,7 @@ var ( ) // getDescriptorInfo retrieves the mapping of field numbers to their respective field descriptors. -func getDescriptorInfo(desc descriptorIface, msg proto.Message) (map[int32]*descriptor.FieldDescriptorProto, *descriptor.DescriptorProto, error) { +func getDescriptorInfo(desc descriptorIface, msg proto.Message) (map[int32]*descriptorpb.FieldDescriptorProto, *descriptorpb.DescriptorProto, error) { key := reflect.ValueOf(msg).Type() descprotoCacheMu.RLock() @@ -407,7 +422,7 @@ func getDescriptorInfo(desc descriptorIface, msg proto.Message) (map[int32]*desc return nil, nil, err } - tagNumToTypeIndex := make(map[int32]*descriptor.FieldDescriptorProto) + tagNumToTypeIndex := make(map[int32]*descriptorpb.FieldDescriptorProto) for _, field := range md.Field { tagNumToTypeIndex[field.GetNumber()] = field } @@ -441,3 +456,68 @@ func (d DefaultAnyResolver) Resolve(typeURL string) (proto.Message, error) { } return reflect.New(mt.Elem()).Interface().(proto.Message), nil } + +// toProtowireType converts a descriptorpb.FieldDescriptorProto_Type to a protowire.Type. +func toProtowireType(fieldType descriptorpb.FieldDescriptorProto_Type) protowire.Type { + switch fieldType { + // varint encoded + case descriptorpb.FieldDescriptorProto_TYPE_INT64, + descriptorpb.FieldDescriptorProto_TYPE_UINT64, + descriptorpb.FieldDescriptorProto_TYPE_INT32, + descriptorpb.FieldDescriptorProto_TYPE_UINT32, + descriptorpb.FieldDescriptorProto_TYPE_BOOL, + descriptorpb.FieldDescriptorProto_TYPE_ENUM, + descriptorpb.FieldDescriptorProto_TYPE_SINT32, + descriptorpb.FieldDescriptorProto_TYPE_SINT64: + return protowire.VarintType + + // fixed64 encoded + case descriptorpb.FieldDescriptorProto_TYPE_DOUBLE, + descriptorpb.FieldDescriptorProto_TYPE_FIXED64, + descriptorpb.FieldDescriptorProto_TYPE_SFIXED64: + return protowire.Fixed64Type + + // fixed32 encoded + case descriptorpb.FieldDescriptorProto_TYPE_FLOAT, + descriptorpb.FieldDescriptorProto_TYPE_FIXED32, + descriptorpb.FieldDescriptorProto_TYPE_SFIXED32: + return protowire.Fixed32Type + + // bytes encoded + case descriptorpb.FieldDescriptorProto_TYPE_STRING, + descriptorpb.FieldDescriptorProto_TYPE_BYTES, + descriptorpb.FieldDescriptorProto_TYPE_MESSAGE, + descriptorpb.FieldDescriptorProto_TYPE_GROUP: + return protowire.BytesType + default: + panic(fmt.Sprintf("unknown field type %s", fieldType)) + } +} + +// isScalar defines whether a field is a scalar type. +// Copied from gogo/protobuf/protoc-gen-gogo +// https://github.com/gogo/protobuf/blob/b03c65ea87cdc3521ede29f62fe3ce239267c1bc/protoc-gen-gogo/descriptor/descriptor.go#L95 +func isScalar(field *descriptorpb.FieldDescriptorProto) bool { + if field.Type == nil { + return false + } + switch *field.Type { + case descriptorpb.FieldDescriptorProto_TYPE_DOUBLE, + descriptorpb.FieldDescriptorProto_TYPE_FLOAT, + descriptorpb.FieldDescriptorProto_TYPE_INT64, + descriptorpb.FieldDescriptorProto_TYPE_UINT64, + descriptorpb.FieldDescriptorProto_TYPE_INT32, + descriptorpb.FieldDescriptorProto_TYPE_FIXED64, + descriptorpb.FieldDescriptorProto_TYPE_FIXED32, + descriptorpb.FieldDescriptorProto_TYPE_BOOL, + descriptorpb.FieldDescriptorProto_TYPE_UINT32, + descriptorpb.FieldDescriptorProto_TYPE_ENUM, + descriptorpb.FieldDescriptorProto_TYPE_SFIXED32, + descriptorpb.FieldDescriptorProto_TYPE_SFIXED64, + descriptorpb.FieldDescriptorProto_TYPE_SINT32, + descriptorpb.FieldDescriptorProto_TYPE_SINT64: + return true + default: + return false + } +} diff --git a/codec/unknownproto/unknown_fields_test.go b/codec/unknownproto/unknown_fields_test.go index 1a8fd0affd7e..7f2228e58436 100644 --- a/codec/unknownproto/unknown_fields_test.go +++ b/codec/unknownproto/unknown_fields_test.go @@ -4,9 +4,8 @@ import ( "reflect" "testing" - "github.com/stretchr/testify/require" - "github.com/cosmos/gogoproto/proto" + "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/testutil/testdata" diff --git a/codec/yaml_test.go b/codec/yaml_test.go index 8601f35b0c16..6d9445fe97b9 100644 --- a/codec/yaml_test.go +++ b/codec/yaml_test.go @@ -3,10 +3,9 @@ package codec_test import ( "testing" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/stretchr/testify/require" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/testutil/testdata" ) diff --git a/collections/CHANGELOG.md b/collections/CHANGELOG.md index 101b5146f396..6b850be66e48 100644 --- a/collections/CHANGELOG.md +++ b/collections/CHANGELOG.md @@ -31,16 +31,59 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +## [v1.1.0](https://github.com/cosmos/cosmos-sdk/releases/tag/collections%2Fv1.1.0) + +### Improvements + +* [#23515](https://github.com/cosmos/cosmos-sdk/pull/23515) Bring in `collections/protocodec` go module as package within `collections` module. + +## [v1.0.0](https://github.com/cosmos/cosmos-sdk/releases/tag/collections%2Fv1.0.0) + +### Features + +* [#22641](https://github.com/cosmos/cosmos-sdk/pull/22641) Add reverse iterator support for `Triple`. +* [#17656](https://github.com/cosmos/cosmos-sdk/pull/17656) Introduces `Vec`, a collection type that allows to represent a growable array on top of a KVStore. +* [#18933](https://github.com/cosmos/cosmos-sdk/pull/18933) Add LookupMap implementation. It is basic wrapping of the standard Map methods but is not iterable. +* [#19343](https://github.com/cosmos/cosmos-sdk/pull/19343) Simplify IndexedMap creation by allowing to infer indexes through reflection. +* [#19861](https://github.com/cosmos/cosmos-sdk/pull/19861) Add `NewJSONValueCodec` value codec as an alternative for `codec.CollValue` from the SDK for non protobuf types. +* [#21090](https://github.com/cosmos/cosmos-sdk/pull/21090) Introduces `Quad`, a composite key with four keys. +* [#20704](https://github.com/cosmos/cosmos-sdk/pull/20704) Add `ModuleCodec` method to `Schema` and `HasSchemaCodec` interface in order to support `cosmossdk.io/schema` compatible indexing. +* [#20538](https://github.com/cosmos/cosmos-sdk/pull/20538) Add `Nameable` variations to `KeyCodec` and `ValueCodec` to allow for better indexing of `collections` types. +* [#22544](https://github.com/cosmos/cosmos-sdk/pull/22544) Schema's `ModuleCodec` will now also return Enum descriptors to be registered with the indexer. + +## [v0.4.0](https://github.com/cosmos/cosmos-sdk/releases/tag/collections%2Fv0.4.0) + +### Features + +* [#17024](https://github.com/cosmos/cosmos-sdk/pull/17024) Introduces `Triple`, a composite key with three keys. + +### API Breaking + +* [#17290](https://github.com/cosmos/cosmos-sdk/pull/17290) Collections iteration methods (Iterate, Walk) will not error when the collection is empty. + +### Improvements + +* [#17021](https://github.com/cosmos/cosmos-sdk/pull/17021) Make collections implement the `appmodule.HasGenesis` interface. + +## [v0.3.0](https://github.com/cosmos/cosmos-sdk/releases/tag/collections%2Fv0.3.0) + +### Features + +* [#16074](https://github.com/cosmos/cosmos-sdk/pull/16607) Introduces `Clear` method for `Map` and `KeySet` +* [#16773](https://github.com/cosmos/cosmos-sdk/pull/16773) + * Adds `AltValueCodec` which provides a way to decode a value in two ways. + * Adds the possibility to specify an alternative way to decode the values of `KeySet`, `indexes.Multi`, `indexes.ReversePair`. + ## [v0.2.0](https://github.com/cosmos/cosmos-sdk/releases/tag/collections%2Fv0.2.0) ### Features -* [#16074](https://github.com/cosmos/cosmos-sdk/pull/16074) – Makes the generic Collection interface public, still highly unstable. +* [#16074](https://github.com/cosmos/cosmos-sdk/pull/16074) Makes the generic Collection interface public, still highly unstable. ### API Breaking -* [#16127](https://github.com/cosmos/cosmos-sdk/pull/16127) – In the `Walk` method the call back function being passed is allowed to error. +* [#16127](https://github.com/cosmos/cosmos-sdk/pull/16127) In the `Walk` method the call back function being passed is allowed to error. ## [v0.1.0](https://github.com/cosmos/cosmos-sdk/releases/tag/collections%2Fv0.1.0) -Collections `v0.1.0` is released! Check out the [docs](https://docs.cosmos.network/main/packages/collections) to know how to use the APIs. +Collections `v0.1.0` is released! Check out the [docs](https://docs.cosmos.network/main/build/packages/collections) to know how to use the APIs. diff --git a/collections/README.md b/collections/README.md index 7f8278233c64..b8d8a62f1d93 100644 --- a/collections/README.md +++ b/collections/README.md @@ -23,11 +23,12 @@ go get cosmossdk.io/collections ## Core types Collections offers 5 different APIs to work with state, which will be explored in the next sections, these APIs are: -- ``Map``: to work with typed arbitrary KV pairings. -- ``KeySet``: to work with just typed keys -- ``Item``: to work with just one typed value -- ``Sequence``: which is a monotonically increasing number. -- ``IndexedMap``: which combines ``Map`` and `KeySet` to provide a `Map` with indexing capabilities. + +* ``Map``: to work with typed arbitrary KV pairings. +* ``KeySet``: to work with just typed keys +* ``Item``: to work with just one typed value +* ``Sequence``: which is a monotonically increasing number. +* ``IndexedMap``: which combines ``Map`` and `KeySet` to provide a `Map` with indexing capabilities. ## Preliminary components @@ -82,15 +83,17 @@ The second argument passed to our ``KeySet`` is a `collections.Prefix`, a prefix where all the state of a specific collection will be saved. Since a module can have multiple collections, the following is expected: -- module params will become a `collections.Item` -- the `AllowList` is a `collections.KeySet` + +* module params will become a `collections.Item` +* the `AllowList` is a `collections.KeySet` We don't want a collection to write over the state of the other collection so we pass it a prefix, which defines a storage partition owned by the collection. -If you already built modules, the prefix translates to the items you were creating in your ``types/keys.go`` file, example: https://github.com/cosmos/cosmos-sdk/blob/main/x/feegrant/key.go#L27 +If you already built modules, the prefix translates to the items you were creating in your ``types/keys.go`` file, example: https://github.com/cosmos/cosmos-sdk/blob/v0.52.0-rc.1/x/feegrant/key.go#L16~L22 your old: + ```go var ( // FeeAllowanceKeyPrefix is the set of the kvstore for fee allowance data @@ -102,7 +105,9 @@ var ( FeeAllowanceQueueKeyPrefix = []byte{0x01} ) ``` + becomes: + ```go var ( // FeeAllowanceKeyPrefix is the set of the kvstore for fee allowance data @@ -130,6 +135,7 @@ prefix2 := collections.NewPrefix("prefix") // THIS IS BAD! prefix1 := collections.NewPrefix("a") prefix2 := collections.NewPrefix("aa") // prefix2 starts with the same as prefix1: BAD!!! ``` + ### Human-Readable Name The third parameter we pass to a collection is a string, which is a human-readable name. @@ -157,7 +163,7 @@ You might need to implement them only if you're migrating to collections and the Let's explore an example: -````go +```go package collections import ( @@ -180,14 +186,14 @@ func NewKeeper(storeKey *storetypes.KVStoreKey) Keeper { IDs: collections.NewMap(sb, IDsPrefix, "ids", collections.StringKey, collections.Uint64Value), } } -```` +``` We're now instantiating a map where the key is string and the value is `uint64`. We already know the first three arguments of the ``NewMap`` function. The fourth parameter is our `KeyCodec`, we know that the ``Map`` has `string` as key so we pass it a `KeyCodec` that handles strings as keys. -The fifth parameter is our `ValueCodec`, we know that the `Map` as a `uint64` as value so we pass it a `ValueCodec` that handles uint64. +The fifth parameter is our `ValueCodec`, we know that the `Map` has a `uint64` as value so we pass it a `ValueCodec` that handles uint64. Collections already comes with all the required implementations for golang primitive types. @@ -390,6 +396,7 @@ func (k Keeper) RemoveValidator(ctx sdk.Context, validator sdk.ValAddress) error return nil } ``` + The first difference we notice is that `KeySet` needs use to specify only one type parameter: the key (`sdk.ValAddress` in this case). The second difference we notice is that `KeySet` in its `NewKeySet` function does not require us to specify a `ValueCodec` but only a `KeyCodec`. This is because a `KeySet` only saves keys and not values. @@ -431,7 +438,7 @@ import ( storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + stakingtypes "cosmossdk.io/x/staking/types" ) var ParamsPrefix = collections.NewPrefix(0) @@ -580,7 +587,7 @@ Let's analyse each method in the example and how it makes use of the `Iterate` a In `GetAllAccounts` we pass to our `Iterate` a nil `Ranger`. This means that the returned `Iterator` will include all the existing keys within the collection. -Then we use some the `Values` method from the returned `Iterator` API to collect all the values into a slice. +Then we use the `Values` method from the returned `Iterator` API to collect all the values into a slice. `Iterator` offers other methods such as `Keys()` to collect only the keys and not the values and `KeyValues` to collect all the keys and values. @@ -595,9 +602,9 @@ we instruct it to report us results in reverse order through `Descending` Then we pass the range instruction to `Iterate` and get an `Iterator`, which will contain only the results we specified in the range. -Then we use again th `Values` method of the `Iterator` to collect all the results. +Then we use again the `Values` method of the `Iterator` to collect all the results. -`collections.Range` also offers a `Prefix` API which is not appliable to all keys types, +`collections.Range` also offers a `Prefix` API which is not applicable to all keys types, for example uint64 cannot be prefix because it is of constant size, but a `string` key can be prefixed. @@ -670,7 +677,7 @@ func NewKeeper(storeKey *storetypes.KVStoreKey) Keeper { Balances: collections.NewMap( sb, BalancesPrefix, "balances", collections.PairKeyCodec(sdk.AccAddressKey, collections.StringKey), - math.IntValue, + sdk.IntValue, ), } } @@ -679,9 +686,10 @@ func NewKeeper(storeKey *storetypes.KVStoreKey) Keeper { #### The Map Key definition First of all we can see that in order to define a composite key of two elements we use the `collections.Pair` type: -````go + +```go collections.Map[collections.Pair[sdk.AccAddress, string], math.Int] -```` +``` `collections.Pair` defines a key composed of two other keys, in our case the first part is `sdk.AccAddress`, the second part is `string`. @@ -698,7 +706,7 @@ encode the second part of the key. Let's expand on the example we used before: -````go +```go var BalancesPrefix = collections.NewPrefix(1) type Keeper struct { @@ -712,7 +720,7 @@ func NewKeeper(storeKey *storetypes.KVStoreKey) Keeper { Balances: collections.NewMap( sb, BalancesPrefix, "balances", collections.PairKeyCodec(sdk.AccAddressKey, collections.StringKey), - math.IntValue, + sdk.IntValue, ), } } @@ -758,7 +766,7 @@ func (k Keeper) GetAllAddressBalancesBetween(ctx sdk.Context, address sdk.AccAdd } ... } -```` +``` #### SetBalance @@ -769,7 +777,7 @@ We use the `collections.Join` function to generate the composite key. `collections.Pair` contains the two keys we have joined, it also exposes two methods: `K1` to fetch the 1st part of the key and `K2` to fetch the second part. -As always, we use the `collections.Map.Set` method to map the composite key to our value (`math.Int`in this case) +As always, we use the `collections.Map.Set` method to map the composite key to our value (`math.Int` in this case) #### GetBalance @@ -788,7 +796,7 @@ in `Pair` keys iterations. ``` As we can see here we're passing the type parameters of the `collections.Pair` because golang type inference -with respect to generics is not as permissive as other languages, so we need to explitly say what are the types of the pair key. +with respect to generics is not as permissive as other languages, so we need to explicitly say what are the types of the pair key. #### GetAllAddressesBalancesBetween @@ -811,7 +819,7 @@ type BaseAccount struct { ``` First of all, when we save our accounts in state we map them using a primary key `sdk.AccAddress`. -If it were to be a `collections.Map` it would be `collections.Map[sdk.AccAddres, authtypes.BaseAccount]`. +If it were to be a `collections.Map` it would be `collections.Map[sdk.AccAddress, authtypes.BaseAccount]`. Then we also want to be able to get an account not only by its `sdk.AccAddress`, but also by its `AccountNumber`. @@ -829,10 +837,6 @@ type AccountsIndexes struct { Number *indexes.Unique[uint64, sdk.AccAddress, authtypes.BaseAccount] } -func (a AccountsIndexes) IndexesList() []collections.Index[sdk.AccAddress, authtypes.BaseAccount] { - return []collections.Index[sdk.AccAddress, authtypes.BaseAccount]{a.Number} -} - func NewAccountIndexes(sb *collections.SchemaBuilder) AccountsIndexes { return AccountsIndexes{ Number: indexes.NewUnique( @@ -856,18 +860,26 @@ Then we can see in our `AccountIndexes` struct the `Number` field is defined as: ``` Where the first type parameter is `uint64`, which is the field type of our index. -The second type parameter is the primary key `sdk.AccAddress` +The second type parameter is the primary key `sdk.AccAddress`. And the third type parameter is the actual object we're storing `authtypes.BaseAccount`. -Then we implement a function called `IndexesList` on our `AccountIndexes` struct, this will be used -by the `IndexedMap` to keep the underlying map in sync with the indexes, in our case `Number`. -This function just needs to return the slice of indexes contained in the struct. - Then we create a `NewAccountIndexes` function that instantiates and returns the `AccountsIndexes` struct. The function takes a `SchemaBuilder`. Then we instantiate our `indexes.Unique`, let's analyse the arguments we pass to `indexes.NewUnique`. +#### NOTE: indexes list + +The `AccountsIndexes` struct contains the indexes, the `NewIndexedMap` function will infer the indexes form that struct +using reflection, this happens only at init and is not computationally expensive. In case you want to explicitly declare +indexes: implement the `Indexes` interface in the `AccountsIndexes` struct: + +```go +func (a AccountsIndexes) IndexesList() []collections.Index[sdk.AccAddress, authtypes.BaseAccount] { + return []collections.Index[sdk.AccAddress, authtypes.BaseAccount]{a.Number} +} +``` + #### Instantiating a `indexes.Unique` The first three arguments, we already know them, they are: `SchemaBuilder`, `Prefix` which is our index prefix (the partition @@ -1117,3 +1129,82 @@ func (k Keeper) GetAccount(ctx sdk.context, addr sdk.AccAddress) (sdk.AccountI, return k.Accounts.Get(ctx, addr) } ``` + +## Triple key + +The `collections.Triple` is a special type of key composed of three keys, it's identical to `collections.Pair`. + +Let's see an example. + +```go +package example + +import ( + "context" + + "cosmossdk.io/collections" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/codec" +) + +type AccAddress = string +type ValAddress = string + +type Keeper struct { + // let's simulate we have redelegations which are stored as a triple key composed of + // the delegator, the source validator and the destination validator. + Redelegations collections.KeySet[collections.Triple[AccAddress, ValAddress, ValAddress]] +} + +func NewKeeper(storeKey *storetypes.KVStoreKey) Keeper { + sb := collections.NewSchemaBuilder(sdk.OpenKVStore(storeKey)) + return Keeper{ + Redelegations: collections.NewKeySet(sb, collections.NewPrefix(0), "redelegations", collections.TripleKeyCodec(collections.StringKey, collections.StringKey, collections.StringKey) + } +} + +// RedelegationsByDelegator iterates over all the redelegations of a given delegator and calls onResult providing +// each redelegation from source validator towards the destination validator. +func (k Keeper) RedelegationsByDelegator(ctx context.Context, delegator AccAddress, onResult func(src, dst ValAddress) (stop bool, err error)) error { + rng := collections.NewPrefixedTripleRange[AccAddress, ValAddress, ValAddress](delegator) + return k.Redelegations.Walk(ctx, rng, func(key collections.Triple[AccAddress, ValAddress, ValAddress]) (stop bool, err error) { + return onResult(key.K2(), key.K3()) + }) +} + +// RedelegationsByDelegatorAndValidator iterates over all the redelegations of a given delegator and its source validator and calls onResult for each +// destination validator. +func (k Keeper) RedelegationsByDelegatorAndValidator(ctx context.Context, delegator AccAddress, validator ValAddress, onResult func(dst ValAddress) (stop bool, err error)) error { + rng := collections.NewSuperPrefixedTripleRange[AccAddress, ValAddress, ValAddress](delegator, validator) + return k.Redelegations.Walk(ctx, rng, func(key collections.Triple[AccAddress, ValAddress, ValAddress]) (stop bool, err error) { + return onResult(key.K3()) + }) +} +``` + +## Advanced Usages + +### Alternative Value Codec + +The `codec.AltValueCodec` allows a collection to decode values using a different codec than the one used to encode them. +Basically it enables to decode two different byte representations of the same concrete value. +It can be used to lazily migrate values from one bytes representation to another, as long as the new representation is +not able to decode the old one. + +A concrete example can be found in `x/bank` where the balance was initially stored as `Coin` and then migrated to `Int`. + +```go + +var BankBalanceValueCodec = codec.NewAltValueCodec(sdk.IntValue, func(b []byte) (sdk.Int, error) { + coin := sdk.Coin{} + err := coin.Unmarshal(b) + if err != nil { + return sdk.Int{}, err + } + return coin.Amount, nil +}) +``` + +The above example shows how to create an `AltValueCodec` that can decode both `sdk.Int` and `sdk.Coin` values. The provided +decoder function will be used as a fallback in case the default decoder fails. When the value will be encoded back into state +it will use the default encoder. This allows to lazily migrate values to a new bytes representation. diff --git a/collections/codec/alternative_value.go b/collections/codec/alternative_value.go new file mode 100644 index 000000000000..4d7902a4be33 --- /dev/null +++ b/collections/codec/alternative_value.go @@ -0,0 +1,47 @@ +package codec + +// NewAltValueCodec returns a new AltValueCodec. canonicalValueCodec is the codec that you want the value +// to be encoded and decoded as, alternativeDecoder is a function that will attempt to decode the value +// in case the canonicalValueCodec fails to decode it. +func NewAltValueCodec[V any](canonicalValueCodec ValueCodec[V], alternativeDecoder func([]byte) (V, error)) ValueCodec[V] { + return AltValueCodec[V]{ + canonicalValueCodec: canonicalValueCodec, + alternativeDecoder: alternativeDecoder, + } +} + +// AltValueCodec is a codec that can decode a value from state in an alternative format. +// This is useful for migrating data from one format to another. For example, in x/bank +// balances were initially encoded as sdk.Coin, now they are encoded as math.Int. +// The AltValueCodec will be trying to decode the value as math.Int, and if that fails, +// it will attempt to decode it as sdk.Coin. +// NOTE: if the canonical format can also decode the alternative format, then this codec +// will produce undefined and undesirable behavior. +type AltValueCodec[V any] struct { + canonicalValueCodec ValueCodec[V] + alternativeDecoder func([]byte) (V, error) +} + +// Decode will attempt to decode the value from state using the canonical value codec. +// If it fails to decode, it will attempt to decode the value using the alternative decoder. +func (a AltValueCodec[V]) Decode(b []byte) (V, error) { + v, err := a.canonicalValueCodec.Decode(b) + if err != nil { + return a.alternativeDecoder(b) + } + return v, nil +} + +// Below there is the implementation of ValueCodec relying on the canonical value codec. + +func (a AltValueCodec[V]) Encode(value V) ([]byte, error) { return a.canonicalValueCodec.Encode(value) } + +func (a AltValueCodec[V]) EncodeJSON(value V) ([]byte, error) { + return a.canonicalValueCodec.EncodeJSON(value) +} + +func (a AltValueCodec[V]) DecodeJSON(b []byte) (V, error) { return a.canonicalValueCodec.DecodeJSON(b) } + +func (a AltValueCodec[V]) Stringify(value V) string { return a.canonicalValueCodec.Stringify(value) } + +func (a AltValueCodec[V]) ValueType() string { return a.canonicalValueCodec.ValueType() } diff --git a/collections/codec/alternative_value_test.go b/collections/codec/alternative_value_test.go new file mode 100644 index 000000000000..358395427b90 --- /dev/null +++ b/collections/codec/alternative_value_test.go @@ -0,0 +1,53 @@ +package codec_test + +import ( + "encoding/json" + "testing" + + "github.com/stretchr/testify/require" + + "cosmossdk.io/collections/codec" + "cosmossdk.io/collections/colltest" +) + +type altValue struct { + Value uint64 `json:"value"` +} + +func TestAltValueCodec(t *testing.T) { + // we assume we want to migrate the value from json(altValue) to just be + // the raw value uint64. + canonical := codec.KeyToValueCodec(codec.NewUint64Key[uint64]()) + alternative := func(v []byte) (uint64, error) { + var alt altValue + err := json.Unmarshal(v, &alt) + if err != nil { + return 0, err + } + return alt.Value, nil + } + + cdc := codec.NewAltValueCodec(canonical, alternative) + + t.Run("decodes alternative value", func(t *testing.T) { + expected := uint64(100) + alternativeEncodedBytes, err := json.Marshal(altValue{Value: expected}) + require.NoError(t, err) + got, err := cdc.Decode(alternativeEncodedBytes) + require.NoError(t, err) + require.Equal(t, expected, got) + }) + + t.Run("decodes canonical value", func(t *testing.T) { + expected := uint64(100) + canonicalEncodedBytes, err := cdc.Encode(expected) + require.NoError(t, err) + got, err := cdc.Decode(canonicalEncodedBytes) + require.NoError(t, err) + require.Equal(t, expected, got) + }) + + t.Run("conformance", func(t *testing.T) { + colltest.TestValueCodec(t, cdc, uint64(100)) + }) +} diff --git a/collections/codec/bool.go b/collections/codec/bool.go index 4016c8d68dcd..8278def71185 100644 --- a/collections/codec/bool.go +++ b/collections/codec/bool.go @@ -6,7 +6,7 @@ import ( "strconv" ) -func NewBoolKey[T ~bool]() KeyCodec[T] { return boolKey[T]{} } +func NewBoolKey[T ~bool]() NameableKeyCodec[T] { return boolKey[T]{} } type boolKey[T ~bool] struct{} @@ -33,7 +33,7 @@ func (b boolKey[T]) Decode(buffer []byte) (int, T, error) { } } -func (b boolKey[T]) Size(key T) int { return 1 } +func (b boolKey[T]) Size(_ T) int { return 1 } func (b boolKey[T]) EncodeJSON(value T) ([]byte, error) { return json.Marshal(value) @@ -64,3 +64,7 @@ func (b boolKey[T]) DecodeNonTerminal(buffer []byte) (int, T, error) { func (b boolKey[T]) SizeNonTerminal(key T) int { return b.Size(key) } + +func (b boolKey[T]) WithName(name string) KeyCodec[T] { + return NamedKeyCodec[T]{KeyCodec: b, Name: name} +} diff --git a/collections/codec/bytes.go b/collections/codec/bytes.go index 28334795e365..0fb056782c05 100644 --- a/collections/codec/bytes.go +++ b/collections/codec/bytes.go @@ -10,7 +10,7 @@ import ( // using the BytesKey KeyCodec. const MaxBytesKeyNonTerminalSize = math.MaxUint8 -func NewBytesKey[T ~[]byte]() KeyCodec[T] { return bytesKey[T]{} } +func NewBytesKey[T ~[]byte]() NameableKeyCodec[T] { return bytesKey[T]{} } type bytesKey[T ~[]byte] struct{} @@ -77,3 +77,7 @@ func (bytesKey[T]) DecodeNonTerminal(buffer []byte) (int, T, error) { func (bytesKey[T]) SizeNonTerminal(key T) int { return len(key) + 1 } + +func (b bytesKey[T]) WithName(name string) KeyCodec[T] { + return NamedKeyCodec[T]{KeyCodec: b, Name: name} +} diff --git a/collections/codec/codec.go b/collections/codec/codec.go index 2988c9f52425..b8f5cf994613 100644 --- a/collections/codec/codec.go +++ b/collections/codec/codec.go @@ -125,7 +125,9 @@ type UntypedValueCodec struct { } // KeyToValueCodec converts a KeyCodec into a ValueCodec. -func KeyToValueCodec[K any](keyCodec KeyCodec[K]) ValueCodec[K] { return keyToValueCodec[K]{keyCodec} } +func KeyToValueCodec[K any](keyCodec KeyCodec[K]) NameableValueCodec[K] { + return keyToValueCodec[K]{kc: keyCodec} +} // keyToValueCodec is a ValueCodec that wraps a KeyCodec to make it behave like a ValueCodec. type keyToValueCodec[K any] struct { @@ -167,3 +169,7 @@ func (k keyToValueCodec[K]) Stringify(value K) string { func (k keyToValueCodec[K]) ValueType() string { return k.kc.KeyType() } + +func (k keyToValueCodec[K]) WithName(name string) ValueCodec[K] { + return NamedValueCodec[K]{ValueCodec: k, Name: name} +} diff --git a/collections/codec/codec_test.go b/collections/codec/codec_test.go index 16fd10553f41..65eb0704ee2d 100644 --- a/collections/codec/codec_test.go +++ b/collections/codec/codec_test.go @@ -7,7 +7,7 @@ import ( ) func TestUntypedValueCodec(t *testing.T) { - vc := NewUntypedValueCodec(KeyToValueCodec(NewStringKeyCodec[string]())) + vc := NewUntypedValueCodec(ValueCodec[string](KeyToValueCodec(KeyCodec[string](NewStringKeyCodec[string]())))) t.Run("encode/decode", func(t *testing.T) { _, err := vc.Encode(0) diff --git a/collections/codec/indexing.go b/collections/codec/indexing.go new file mode 100644 index 000000000000..01f3740bd588 --- /dev/null +++ b/collections/codec/indexing.go @@ -0,0 +1,102 @@ +package codec + +import ( + "encoding/json" + "fmt" + + "cosmossdk.io/schema" +) + +// HasSchemaCodec is an interface that all codec's should implement in order +// to properly support indexing. It is not required by KeyCodec or ValueCodec +// in order to preserve backwards compatibility, but a future version of collections +// may make it required and all codec's should aim to implement it. If it is not +// implemented, fallback defaults will be used for indexing that may be sub-optimal. +// +// Implementations of HasSchemaCodec should test that they are conformant using +// schema.ValidateObjectKey or schema.ValidateObjectValue depending on whether +// the codec is a KeyCodec or ValueCodec respectively. +type HasSchemaCodec[T any] interface { + // SchemaCodec returns the schema codec for the collections codec. + SchemaCodec() (SchemaCodec[T], error) +} + +// SchemaCodec is a codec that supports converting collection codec values to and +// from schema codec values. +type SchemaCodec[T any] struct { + // Fields are the schema fields that the codec represents. If this is empty, + // it will be assumed that this codec represents no value (such as an item key + // or key set value). + Fields []schema.Field + + // ToSchemaType converts a codec value of type T to a value corresponding to + // a schema object key or value (depending on whether this is a key or value + // codec). The returned value should pass validation with schema.ValidateObjectKey + // or schema.ValidateObjectValue with the fields specified in Fields. + // If this function is nil, it will be assumed that T already represents a + // value that conforms to a schema value without any further conversion. + ToSchemaType func(T) (any, error) + + // FromSchemaType converts a schema object key or value to T. + // If this function is nil, it will be assumed that T already represents a + // value that conforms to a schema value without any further conversion. + FromSchemaType func(any) (T, error) +} + +// KeySchemaCodec gets the schema codec for the provided KeyCodec either +// by casting to HasSchemaCodec or returning a fallback codec. +func KeySchemaCodec[K any](cdc KeyCodec[K]) (SchemaCodec[K], error) { + if indexable, ok := cdc.(HasSchemaCodec[K]); ok { + return indexable.SchemaCodec() + } else { + return FallbackSchemaCodec[K](), nil + } +} + +// ValueSchemaCodec gets the schema codec for the provided ValueCodec either +// by casting to HasSchemaCodec or returning a fallback codec. +func ValueSchemaCodec[V any](cdc ValueCodec[V]) (SchemaCodec[V], error) { + if indexable, ok := cdc.(HasSchemaCodec[V]); ok { + return indexable.SchemaCodec() + } else { + return FallbackSchemaCodec[V](), nil + } +} + +// FallbackSchemaCodec returns a fallback schema codec for T when one isn't explicitly +// specified with HasSchemaCodec. It maps all simple types directly to schema kinds +// and converts everything else to JSON String. +func FallbackSchemaCodec[T any]() SchemaCodec[T] { + var t T + kind := schema.KindForGoValue(t) + if err := kind.Validate(); err == nil { + return SchemaCodec[T]{ + Fields: []schema.Field{{ + // we don't set any name so that this can be set to a good default by the caller + Name: "", + Kind: kind, + }}, + // these can be nil because T maps directly to a schema value for this kind + ToSchemaType: nil, + FromSchemaType: nil, + } + } else { + // we default to encoding everything to JSON String + return SchemaCodec[T]{ + Fields: []schema.Field{{Kind: schema.StringKind}}, + ToSchemaType: func(t T) (any, error) { + bz, err := json.Marshal(t) + return string(json.RawMessage(bz)), err + }, + FromSchemaType: func(a any) (T, error) { + var t T + sz, ok := a.(string) + if !ok { + return t, fmt.Errorf("expected string, got %T", a) + } + err := json.Unmarshal([]byte(sz), &t) + return t, err + }, + } + } +} diff --git a/collections/codec/int.go b/collections/codec/int.go index 1300efde4df0..9fb2a824f2fd 100644 --- a/collections/codec/int.go +++ b/collections/codec/int.go @@ -7,7 +7,7 @@ import ( "strconv" ) -func NewInt64Key[T ~int64]() KeyCodec[T] { return int64Key[T]{} } +func NewInt64Key[T ~int64]() NameableKeyCodec[T] { return int64Key[T]{} } type int64Key[T ~int64] struct{} @@ -64,7 +64,11 @@ func (i int64Key[T]) SizeNonTerminal(_ T) int { return 8 } -func NewInt32Key[T ~int32]() KeyCodec[T] { +func (i int64Key[T]) WithName(name string) KeyCodec[T] { + return NamedKeyCodec[T]{KeyCodec: i, Name: name} +} + +func NewInt32Key[T ~int32]() NameableKeyCodec[T] { return int32Key[T]{} } @@ -121,3 +125,7 @@ func (i int32Key[T]) DecodeNonTerminal(buffer []byte) (int, T, error) { func (i int32Key[T]) SizeNonTerminal(_ T) int { return 4 } + +func (i int32Key[T]) WithName(name string) KeyCodec[T] { + return NamedKeyCodec[T]{KeyCodec: i, Name: name} +} diff --git a/collections/codec/naming.go b/collections/codec/naming.go new file mode 100644 index 000000000000..ffaeeae58db3 --- /dev/null +++ b/collections/codec/naming.go @@ -0,0 +1,63 @@ +package codec + +import "fmt" + +// NameableKeyCodec is a KeyCodec that can be named. +type NameableKeyCodec[T any] interface { + KeyCodec[T] + + // WithName returns the KeyCodec with the provided name. + WithName(name string) KeyCodec[T] +} + +// NameableValueCodec is a ValueCodec that can be named. +type NameableValueCodec[T any] interface { + ValueCodec[T] + + // WithName returns the ValueCodec with the provided name. + WithName(name string) ValueCodec[T] +} + +// NamedKeyCodec wraps a KeyCodec with a name. +// The underlying key codec MUST have exactly one field in its schema. +type NamedKeyCodec[T any] struct { + KeyCodec[T] + + // Name is the name of the KeyCodec in the schema. + Name string +} + +// SchemaCodec returns the schema codec for the named key codec. +func (n NamedKeyCodec[T]) SchemaCodec() (SchemaCodec[T], error) { + cdc, err := KeySchemaCodec[T](n.KeyCodec) + if err != nil { + return SchemaCodec[T]{}, err + } + return withName(cdc, n.Name) +} + +// NamedValueCodec wraps a ValueCodec with a name. +// The underlying value codec MUST have exactly one field in its schema. +type NamedValueCodec[T any] struct { + ValueCodec[T] + + // Name is the name of the ValueCodec in the schema. + Name string +} + +// SchemaCodec returns the schema codec for the named value codec. +func (n NamedValueCodec[T]) SchemaCodec() (SchemaCodec[T], error) { + cdc, err := ValueSchemaCodec[T](n.ValueCodec) + if err != nil { + return SchemaCodec[T]{}, err + } + return withName(cdc, n.Name) +} + +func withName[T any](cdc SchemaCodec[T], name string) (SchemaCodec[T], error) { + if len(cdc.Fields) != 1 { + return SchemaCodec[T]{}, fmt.Errorf("expected exactly one field to be named, got %d", len(cdc.Fields)) + } + cdc.Fields[0].Name = name + return cdc, nil +} diff --git a/collections/codec/string.go b/collections/codec/string.go index 3189b8bc9cbf..7b3cdf0faa1e 100644 --- a/collections/codec/string.go +++ b/collections/codec/string.go @@ -6,7 +6,7 @@ import ( "fmt" ) -func NewStringKeyCodec[T ~string]() KeyCodec[T] { return stringKey[T]{} } +func NewStringKeyCodec[T ~string]() NameableKeyCodec[T] { return stringKey[T]{} } const ( // StringDelimiter defines the delimiter of a string key when used in non-terminal encodings. @@ -66,3 +66,7 @@ func (stringKey[T]) Stringify(key T) string { func (stringKey[T]) KeyType() string { return "string" } + +func (s stringKey[T]) WithName(name string) KeyCodec[T] { + return NamedKeyCodec[T]{KeyCodec: s, Name: name} +} diff --git a/collections/codec/uint.go b/collections/codec/uint.go index 658235d385ad..83efa2ec6453 100644 --- a/collections/codec/uint.go +++ b/collections/codec/uint.go @@ -7,7 +7,7 @@ import ( "strconv" ) -func NewUint64Key[T ~uint64]() KeyCodec[T] { return uint64Key[T]{} } +func NewUint64Key[T ~uint64]() NameableKeyCodec[T] { return uint64Key[T]{} } type uint64Key[T ~uint64] struct{} @@ -55,7 +55,11 @@ func (uint64Key[T]) KeyType() string { return "uint64" } -func NewUint32Key[T ~uint32]() KeyCodec[T] { return uint32Key[T]{} } +func (u uint64Key[T]) WithName(name string) KeyCodec[T] { + return NamedKeyCodec[T]{KeyCodec: u, Name: name} +} + +func NewUint32Key[T ~uint32]() NameableKeyCodec[T] { return uint32Key[T]{} } type uint32Key[T ~uint32] struct{} @@ -95,7 +99,11 @@ func (u uint32Key[T]) DecodeNonTerminal(buffer []byte) (int, T, error) { return func (uint32Key[T]) SizeNonTerminal(_ T) int { return 4 } -func NewUint16Key[T ~uint16]() KeyCodec[T] { return uint16Key[T]{} } +func (u uint32Key[T]) WithName(name string) KeyCodec[T] { + return NamedKeyCodec[T]{KeyCodec: u, Name: name} +} + +func NewUint16Key[T ~uint16]() NameableKeyCodec[T] { return uint16Key[T]{} } type uint16Key[T ~uint16] struct{} @@ -135,6 +143,10 @@ func (u uint16Key[T]) DecodeNonTerminal(buffer []byte) (int, T, error) { return func (u uint16Key[T]) SizeNonTerminal(key T) int { return u.Size(key) } +func (u uint16Key[T]) WithName(name string) KeyCodec[T] { + return NamedKeyCodec[T]{KeyCodec: u, Name: name} +} + func uintEncodeJSON(value uint64) ([]byte, error) { str := `"` + strconv.FormatUint(value, 10) + `"` return []byte(str), nil diff --git a/collections/collections.go b/collections/collections.go index 0f6b32253340..2c67de4604aa 100644 --- a/collections/collections.go +++ b/collections/collections.go @@ -3,10 +3,11 @@ package collections import ( "context" "errors" - io "io" + "io" "math" "cosmossdk.io/collections/codec" + "cosmossdk.io/schema" ) var ( @@ -29,7 +30,7 @@ var ( Uint64Key = codec.NewUint64Key[uint64]() // Int32Key can be used to encode int32 keys. Encoding retains ordering by toggling the MSB. Int32Key = codec.NewInt32Key[int32]() - // Int64Key can be used to encode int64. Encoding retains ordering by toggling the MSB. + // Int64Key can be used to encode int64 keys. Encoding retains ordering by toggling the MSB. Int64Key = codec.NewInt64Key[int64]() // StringKey can be used to encode string keys. The encoding just converts the string // to bytes. @@ -90,6 +91,22 @@ type Collection interface { ValueCodec() codec.UntypedValueCodec genesisHandler + + // collectionSchemaCodec returns the schema codec for this collection. + schemaCodec() (*collectionSchemaCodec, error) + + // isSecondaryIndex indicates that this collection represents a secondary index + // in the schema and should be excluded from the module's user facing schema. + isSecondaryIndex() bool +} + +// collectionSchemaCodec maps a collection to a schema object type and provides +// decoders and encoders to and from schema values and raw kv-store bytes. +type collectionSchemaCodec struct { + coll Collection + objectType schema.StateObjectType + keyDecoder func([]byte) (any, error) + valueDecoder func([]byte) (any, error) } // Prefix defines a segregation bytes namespace for specific collections objects. @@ -157,3 +174,5 @@ func (c collectionImpl[K, V]) exportGenesis(ctx context.Context, w io.Writer) er } func (c collectionImpl[K, V]) defaultGenesis(w io.Writer) error { return c.m.defaultGenesis(w) } + +func (c collectionImpl[K, V]) isSecondaryIndex() bool { return c.m.isSecondaryIndex } diff --git a/collections/collections_test.go b/collections/collections_test.go index a85e0ecd2cda..e6d6c3f824f8 100644 --- a/collections/collections_test.go +++ b/collections/collections_test.go @@ -5,49 +5,16 @@ import ( "math" "testing" - "cosmossdk.io/core/store" - db "github.com/cosmos/cosmos-db" - "github.com/stretchr/testify/require" -) - -type testStore struct { - db db.DB -} - -func (t testStore) OpenKVStore(ctx context.Context) store.KVStore { - return t -} - -func (t testStore) Get(key []byte) ([]byte, error) { - return t.db.Get(key) -} - -func (t testStore) Has(key []byte) (bool, error) { - return t.db.Has(key) -} -func (t testStore) Set(key, value []byte) error { - return t.db.Set(key, value) -} - -func (t testStore) Delete(key []byte) error { - return t.db.Delete(key) -} - -func (t testStore) Iterator(start, end []byte) (store.Iterator, error) { - return t.db.Iterator(start, end) -} - -func (t testStore) ReverseIterator(start, end []byte) (store.Iterator, error) { - return t.db.ReverseIterator(start, end) -} - -var _ store.KVStore = testStore{} + "cosmossdk.io/core/store" + "cosmossdk.io/core/testing" +) func deps() (store.KVStoreService, context.Context) { - kv := db.NewMemDB() - return &testStore{kv}, context.Background() + ctx := coretesting.Context() + kv := coretesting.KVStoreService(ctx, "test") + return kv, ctx } func TestPrefix(t *testing.T) { diff --git a/collections/colltest/codec.go b/collections/colltest/codec.go index dddd2df0d026..54249ebf11a3 100644 --- a/collections/colltest/codec.go +++ b/collections/colltest/codec.go @@ -6,11 +6,10 @@ import ( "reflect" "testing" - "cosmossdk.io/collections/codec" + "github.com/stretchr/testify/require" "cosmossdk.io/collections" - - "github.com/stretchr/testify/require" + "cosmossdk.io/collections/codec" ) // TestKeyCodec asserts the correct behavior of a KeyCodec over the type T. @@ -41,6 +40,11 @@ func TestKeyCodec[T any](t *testing.T, keyCodec codec.KeyCodec[T], key T) { decoded, err := keyCodec.DecodeJSON(keyJSON) require.NoError(t, err) require.Equal(t, key, decoded, "json encoding and decoding did not produce the same results") + + // check type + require.NotEmpty(t, keyCodec.KeyType()) + // check string + _ = keyCodec.Stringify(key) } // TestValueCodec asserts the correct behavior of a ValueCodec over the type T. @@ -120,7 +124,7 @@ func (m mockValueCodec[T]) Decode(b []byte) (t T, err error) { typ, exists := m.seenTypes[wrappedValue.TypeName] if !exists { - return t, fmt.Errorf("uknown type %s, you're dealing with interfaces... in order to make the interface types known for the MockValueCodec, you need to first encode them", wrappedValue.TypeName) + return t, fmt.Errorf("unknown type %s, you're dealing with interfaces... in order to make the interface types known for the MockValueCodec, you need to first encode them", wrappedValue.TypeName) } newT := reflect.New(typ).Interface() diff --git a/collections/colltest/store.go b/collections/colltest/store.go index 56231ffb199e..d29c3c8729aa 100644 --- a/collections/colltest/store.go +++ b/collections/colltest/store.go @@ -3,8 +3,9 @@ package colltest import ( "context" - "cosmossdk.io/core/store" db "github.com/cosmos/cosmos-db" + + "cosmossdk.io/core/store" ) type contextStoreKey struct{} diff --git a/collections/genesis.go b/collections/genesis.go index 454ba496e180..0c593e4adfd8 100644 --- a/collections/genesis.go +++ b/collections/genesis.go @@ -32,7 +32,7 @@ func (m Map[K, V]) importGenesis(ctx context.Context, reader io.Reader) error { } func (m Map[K, V]) exportGenesis(ctx context.Context, writer io.Writer) error { - _, err := writer.Write([]byte("[")) + _, err := io.WriteString(writer, "[") if err != nil { return err } @@ -48,7 +48,7 @@ func (m Map[K, V]) exportGenesis(ctx context.Context, writer io.Writer) error { // add a comma before encoding the object // for all objects besides the first one. if !first { - _, err = writer.Write([]byte(",")) + _, err = io.WriteString(writer, ",") if err != nil { return err } @@ -91,7 +91,7 @@ func (m Map[K, V]) exportGenesis(ctx context.Context, writer io.Writer) error { } } - _, err = writer.Write([]byte("]")) + _, err = io.WriteString(writer, "]") return err } @@ -148,6 +148,6 @@ func (m Map[K, V]) doDecodeJSON(reader io.Reader, onEntry func(key K, value V) e } func (m Map[K, V]) defaultGenesis(writer io.Writer) error { - _, err := writer.Write([]byte(`[]`)) + _, err := io.WriteString(writer, `[]`) return err } diff --git a/collections/genesis_test.go b/collections/genesis_test.go index 9ff95c83c16a..34fb60e1414c 100644 --- a/collections/genesis_test.go +++ b/collections/genesis_test.go @@ -6,8 +6,9 @@ import ( "io" "testing" - "cosmossdk.io/core/appmodule" "github.com/stretchr/testify/require" + + "cosmossdk.io/core/appmodule" ) func TestDefaultGenesis(t *testing.T) { @@ -90,6 +91,7 @@ type testFixture struct { } func initFixture(t *testing.T) *testFixture { + t.Helper() sk, ctx := deps() schemaBuilder := NewSchemaBuilder(sk) m := NewMap(schemaBuilder, NewPrefix(1), "map", StringKey, Uint64Value) @@ -109,6 +111,7 @@ func initFixture(t *testing.T) *testFixture { } func createTestGenesisSource(t *testing.T) appmodule.GenesisSource { + t.Helper() expectedOrder := []string{"item", "key_set", "map", "sequence"} currentIndex := 0 return func(field string) (io.ReadCloser, error) { @@ -148,6 +151,7 @@ func (b *bufCloser) Close() error { } func newBufCloser(t *testing.T, str string) *bufCloser { + t.Helper() b := &bufCloser{ Buffer: bytes.NewBufferString(str), closed: false, diff --git a/collections/go.mod b/collections/go.mod index a4a84a773aca..d6516525a083 100644 --- a/collections/go.mod +++ b/collections/go.mod @@ -1,53 +1,52 @@ module cosmossdk.io/collections -go 1.20 +go 1.23.2 require ( - cosmossdk.io/core v0.8.0 - github.com/cosmos/cosmos-db v1.0.0 - github.com/stretchr/testify v1.8.4 - pgregory.net/rapid v0.6.2 + cosmossdk.io/core v1.0.0 + cosmossdk.io/core/testing v0.0.2 + cosmossdk.io/schema v1.0.0 + github.com/cosmos/cosmos-db v1.1.1 + github.com/cosmos/gogoproto v1.7.0 + github.com/google/go-cmp v0.7.0 + github.com/stretchr/testify v1.10.0 + github.com/tidwall/btree v1.7.0 + google.golang.org/protobuf v1.36.5 + pgregory.net/rapid v1.2.0 ) require ( - cosmossdk.io/api v0.4.2 // indirect - cosmossdk.io/depinject v1.0.0-alpha.3 // indirect - github.com/DataDog/zstd v1.5.5 // indirect + github.com/DataDog/zstd v1.4.5 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/cockroachdb/errors v1.9.1 // indirect + github.com/cockroachdb/errors v1.11.3 // indirect + github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20230525220056-bb4fc9527b3b // indirect - github.com/cockroachdb/redact v1.1.4 // indirect - github.com/cosmos/cosmos-proto v1.0.0-beta.3 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/getsentry/sentry-go v0.21.0 // indirect + github.com/cockroachdb/pebble v1.1.2 // indirect + github.com/cockroachdb/redact v1.1.5 // indirect + github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/getsentry/sentry-go v0.27.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.4 // indirect - github.com/google/btree v1.1.2 // indirect - github.com/klauspost/compress v1.16.5 // indirect + github.com/google/btree v1.1.3 // indirect + github.com/klauspost/compress v1.16.0 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect - github.com/linxGnu/grocksdb v1.7.16 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/onsi/gomega v1.20.0 // indirect + github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.15.1 // indirect - github.com/prometheus/client_model v0.4.0 // indirect - github.com/prometheus/common v0.44.0 // indirect - github.com/prometheus/procfs v0.10.0 // indirect - github.com/rogpeppe/go-internal v1.10.0 // indirect - github.com/spf13/cast v1.5.1 // indirect - github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect - golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/text v0.9.0 // indirect - google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect - google.golang.org/grpc v1.55.0 // indirect - google.golang.org/protobuf v1.30.0 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/prometheus/client_golang v1.12.0 // indirect + github.com/prometheus/client_model v0.2.1-0.20210607210712-147c58e9608a // indirect + github.com/prometheus/common v0.32.1 // indirect + github.com/prometheus/procfs v0.7.3 // indirect + github.com/rogpeppe/go-internal v1.9.0 // indirect + github.com/spf13/cast v1.7.1 // indirect + github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect + golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect + golang.org/x/sys v0.29.0 // indirect + golang.org/x/text v0.21.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/collections/go.sum b/collections/go.sum index fd119d9a369a..fbbd1907de5f 100644 --- a/collections/go.sum +++ b/collections/go.sum @@ -1,104 +1,131 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cosmossdk.io/api v0.4.2 h1:lQBMl4xINnMnBOR/tQLtjlDnR4exr4e6/SfHR8PILE0= -cosmossdk.io/api v0.4.2/go.mod h1:qrVgOp7DIeAXa+Tt5dDjOC47bZCDrwx8ZHxrmy7STNE= -cosmossdk.io/core v0.8.0 h1:LcJnu52E1a8f8E317VfQ1xK/RZe+IuhMNQAjnDLh25M= -cosmossdk.io/core v0.8.0/go.mod h1:LF6VLOv2DdCiaHxYVmr0MZcZpaSM9ZgvyrQSYTeg6D0= -cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw= -cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= -github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cosmossdk.io/core v1.0.0 h1:e7XBbISOytLBOXMVwpRPixThXqEkeLGlg8no/qpgS8U= +cosmossdk.io/core v1.0.0/go.mod h1:mKIp3RkoEmtqdEdFHxHwWAULRe+79gfdOvmArrLDbDc= +cosmossdk.io/core/testing v0.0.2 h1:TXAmsnHa1C5lLiVN1z+rnkiyNS6sNwcGJCb6OouaNv8= +cosmossdk.io/core/testing v0.0.2/go.mod h1:6Y3QaoNXsgeHiV4+9oYF/IqMFqCK5cJClonw/OXxHlY= +cosmossdk.io/schema v1.0.0 h1:/diH4XJjpV1JQwuIozwr+A4uFuuwanFdnw2kKeiXwwQ= +cosmossdk.io/schema v1.0.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= -github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= -github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= -github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= -github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= -github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= -github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= -github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ= +github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= -github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= -github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= -github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= +github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce h1:giXvy4KSc/6g/esnpM7Geqxka4WSqI1SZc7sMJFd3y4= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/pebble v0.0.0-20230525220056-bb4fc9527b3b h1:LCs8gDhg6vt8A3dN7AEJxmCoETZ4qkySoVJVm3rcSJk= -github.com/cockroachdb/pebble v0.0.0-20230525220056-bb4fc9527b3b/go.mod h1:TkdVsGYRqtULUppt2RbC+YaKtTHnHoWa2apfFrSKABw= -github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/cockroachdb/redact v1.1.4 h1:Y0XrVI2FAyofNyGveodTN//qdpPtFKcKTeCBsK3AHAQ= -github.com/cockroachdb/redact v1.1.4/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0E= -github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= -github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= -github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/cockroachdb/pebble v1.1.2 h1:CUh2IPtR4swHlEj48Rhfzw6l/d0qA31fItcIszQVIsA= +github.com/cockroachdb/pebble v1.1.2/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= +github.com/cosmos/cosmos-db v1.1.1 h1:FezFSU37AlBC8S98NlSagL76oqBRWq/prTPvFcEJNCM= +github.com/cosmos/cosmos-db v1.1.1/go.mod h1:AghjcIPqdhSLP/2Z0yha5xPH3nLnskz81pBx3tcVSAw= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= -github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= -github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= -github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= -github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= -github.com/getsentry/sentry-go v0.21.0 h1:c9l5F1nPF30JIppulk4veau90PK6Smu3abgVtVQWon4= -github.com/getsentry/sentry-go v0.21.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= -github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= -github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= -github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= +github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= -github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= -github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= -github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= -github.com/gofrs/uuid v4.2.0+incompatible h1:yyYWMnhkhrKwwr8gAOcOCYxOOscHgDS9yZgBrnJfGa0= -github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= -github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= -github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= -github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= @@ -106,312 +133,408 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= -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/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= +github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 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= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= -github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= -github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= -github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= -github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= -github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= -github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= -github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= -github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +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/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/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI= -github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/compress v1.16.0 h1:iULayQNOReoYUe+1qtKOqw9CwJv3aNQu8ivo7lw1HU4= +github.com/klauspost/compress v1.16.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= 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.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= -github.com/linxGnu/grocksdb v1.7.16 h1:Q2co1xrpdkr5Hx3Fp+f+f7fRGhQFQhvi/+226dtLmA8= -github.com/linxGnu/grocksdb v1.7.16/go.mod h1:JkS7pl5qWpGpuVb3bPqTz8nC12X3YtPZT+Xq7+QfQo4= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= -github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= -github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= +github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= +github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= -github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= -github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= -github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= -github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= -github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= +github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= +github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= -github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= -github.com/onsi/gomega v1.20.0 h1:8W0cWlwFkflGPLltQvLRB7ZVD5HuP6ng320w2IS245Q= -github.com/onsi/gomega v1.20.0/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.15.1 h1:8tXpTmJbyH5lydzFPoxSIJ0J46jdh3tylbvM1xCv0LI= -github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.12.0 h1:C+UIj/QWtmqY13Arb8kwMt5j34/0Z2iKamrJ+ryC0Gg= +github.com/prometheus/client_golang v1.12.0/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= -github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= -github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= -github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= -github.com/prometheus/procfs v0.10.0 h1:UkG7GPYkO4UZyLnyXjaWYcgOSONqwdBqFUT95ugmt6I= -github.com/prometheus/procfs v0.10.0/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= -github.com/regen-network/gocuke v0.6.2 h1:pHviZ0kKAq2U2hN2q3smKNxct6hS0mGByFMHGnWA97M= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.1-0.20210607210712-147c58e9608a h1:CmF68hwI0XsOQ5UwlBopMi2Ow4Pbg32akc4KIVCOm+Y= +github.com/prometheus/client_model v0.2.1-0.20210607210712-147c58e9608a/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= +github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= +github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= -github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= +github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= -github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= -github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= -github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= -github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +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/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= +github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/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-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +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-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df h1:UA2aFVmmsIlefxMk29Dp2juaUSth8Pyn3Tq5Y5mJGME= +golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= 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= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 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-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/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= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.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/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= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= +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= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181221001348-537d06c36207/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-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= 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= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +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-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= -google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -420,34 +543,40 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= +google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 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/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= -gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -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= -gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -pgregory.net/rapid v0.6.2 h1:ErW5sL+UKtfBfUTsWHDCoeB+eZKLKMxrSd1VJY6W4bw= -pgregory.net/rapid v0.6.2/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +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= +pgregory.net/rapid v1.2.0 h1:keKAYRcjm+e1F0oAuU5F5+YPAWcyxNNRK2wud503Gnk= +pgregory.net/rapid v1.2.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/collections/indexed_map.go b/collections/indexed_map.go index 4a45edbe45c0..d763bb721af4 100644 --- a/collections/indexed_map.go +++ b/collections/indexed_map.go @@ -2,6 +2,9 @@ package collections import ( "context" + "errors" + "fmt" + "reflect" "cosmossdk.io/collections/codec" ) @@ -32,17 +35,77 @@ type Index[PrimaryKey, Value any] interface { // Internally IndexedMap can be seen as a partitioned collection, one partition // is a Map[PrimaryKey, Value], that maintains the object, the second // are the Indexes. -type IndexedMap[PrimaryKey, Value any, Idx Indexes[PrimaryKey, Value]] struct { - Indexes Idx - m Map[PrimaryKey, Value] +type IndexedMap[PrimaryKey, Value, Idx any] struct { + Indexes Idx + computedIndexes []Index[PrimaryKey, Value] + m Map[PrimaryKey, Value] +} + +// NewIndexedMapSafe behaves like NewIndexedMap but returns errors. +func NewIndexedMapSafe[K, V, I any]( + schema *SchemaBuilder, + prefix Prefix, + name string, + pkCodec codec.KeyCodec[K], + valueCodec codec.ValueCodec[V], + indexes I, +) (im *IndexedMap[K, V, I], err error) { + var indexesList []Index[K, V] + indexesImpl, ok := any(indexes).(Indexes[K, V]) + if ok { + indexesList = indexesImpl.IndexesList() + } else { + // if does not implement Indexes, then we try to infer using reflection + indexesList, err = tryInferIndexes[I, K, V](indexes) + if err != nil { + return nil, fmt.Errorf("unable to infer indexes using reflection, consider implementing Indexes interface: %w", err) + } + } + + return &IndexedMap[K, V, I]{ + computedIndexes: indexesList, + Indexes: indexes, + m: NewMap(schema, prefix, name, pkCodec, valueCodec), + }, nil +} + +var ( + // testing sentinel errors + errNotStruct = errors.New("wanted struct or pointer to a struct") + errNotIndex = errors.New("field is not an index implementation") +) + +func tryInferIndexes[I, K, V any](indexes I) ([]Index[K, V], error) { + typ := reflect.TypeOf(indexes) + v := reflect.ValueOf(indexes) + // check if struct or pointer to a struct + if typ.Kind() != reflect.Struct && (typ.Kind() != reflect.Pointer || typ.Elem().Kind() != reflect.Struct) { + return nil, fmt.Errorf("%w: type %v", errNotStruct, typ) + } + // dereference + if typ.Kind() == reflect.Pointer { + v = v.Elem() + } + indexesImpl := make([]Index[K, V], v.NumField()) + for i := 0; i < v.NumField(); i++ { + field := v.Field(i) + index, ok := field.Interface().(Index[K, V]) + if !ok { + return nil, fmt.Errorf("%w: field number %d", errNotIndex, i) + } + indexesImpl[i] = index + } + return indexesImpl, nil } // NewIndexedMap instantiates a new IndexedMap. Accepts a SchemaBuilder, a Prefix, // a humanized name that defines the name of the collection, the primary key codec // which is basically what IndexedMap uses to encode the primary key to bytes, // the value codec which is what the IndexedMap uses to encode the value. -// Then it expects the initialized indexes. -func NewIndexedMap[PrimaryKey, Value any, Idx Indexes[PrimaryKey, Value]]( +// Then it expects the initialized indexes. Reflection is used to infer the +// indexes, Indexes can optionally be implemented to be explicit. Panics +// on failure to create indexes. If you want an erroring API use NewIndexedMapSafe. +func NewIndexedMap[PrimaryKey, Value, Idx any]( schema *SchemaBuilder, prefix Prefix, name string, @@ -50,10 +113,11 @@ func NewIndexedMap[PrimaryKey, Value any, Idx Indexes[PrimaryKey, Value]]( valueCodec codec.ValueCodec[Value], indexes Idx, ) *IndexedMap[PrimaryKey, Value, Idx] { - return &IndexedMap[PrimaryKey, Value, Idx]{ - Indexes: indexes, - m: NewMap(schema, prefix, name, pkCodec, valueCodec), + im, err := NewIndexedMapSafe(schema, prefix, name, pkCodec, valueCodec, indexes) + if err != nil { + panic(err) } + return im } // Get gets the object given its primary key. @@ -111,7 +175,7 @@ func (m *IndexedMap[PrimaryKey, Value, Idx]) ValueCodec() codec.ValueCodec[Value } func (m *IndexedMap[PrimaryKey, Value, Idx]) ref(ctx context.Context, pk PrimaryKey, value Value) error { - for _, index := range m.Indexes.IndexesList() { + for _, index := range m.computedIndexes { err := index.Reference(ctx, pk, value, cachedGet[PrimaryKey, Value](ctx, m, pk)) if err != nil { return err @@ -121,7 +185,7 @@ func (m *IndexedMap[PrimaryKey, Value, Idx]) ref(ctx context.Context, pk Primary } func (m *IndexedMap[PrimaryKey, Value, Idx]) unref(ctx context.Context, pk PrimaryKey) error { - for _, index := range m.Indexes.IndexesList() { + for _, index := range m.computedIndexes { err := index.Unreference(ctx, pk, cachedGet[PrimaryKey, Value](ctx, m, pk)) if err != nil { return err diff --git a/collections/indexed_map_internal_test.go b/collections/indexed_map_internal_test.go new file mode 100644 index 000000000000..8f315ca1e520 --- /dev/null +++ b/collections/indexed_map_internal_test.go @@ -0,0 +1,30 @@ +package collections + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func TestTryInferIndex(t *testing.T) { + invalidIdx := 5 + + t.Run("not a pointer to struct", func(t *testing.T) { + _, err := tryInferIndexes[*int, string, string](&invalidIdx) + require.ErrorIs(t, err, errNotStruct) + }) + + t.Run("not a struct", func(t *testing.T) { + _, err := tryInferIndexes[int, string, string](invalidIdx) + require.ErrorIs(t, err, errNotStruct) + }) + + t.Run("not an index field", func(t *testing.T) { + type invalidIndex struct { + A int + } + + _, err := tryInferIndexes[invalidIndex, string, string](invalidIndex{}) + require.ErrorIs(t, err, errNotIndex) + }) +} diff --git a/collections/indexed_map_test.go b/collections/indexed_map_test.go index 9af4dd74b7e6..f7eba42d401e 100644 --- a/collections/indexed_map_test.go +++ b/collections/indexed_map_test.go @@ -3,10 +3,12 @@ package collections_test import ( "testing" + "github.com/stretchr/testify/require" + "cosmossdk.io/collections" "cosmossdk.io/collections/colltest" "cosmossdk.io/collections/indexes" - "github.com/stretchr/testify/require" + "cosmossdk.io/core/testing" ) type company struct { @@ -43,7 +45,9 @@ func newTestIndexedMap(schema *collections.SchemaBuilder) *collections.IndexedMa } func TestIndexedMap(t *testing.T) { - sk, ctx := colltest.MockStore() + ctx := coretesting.Context() + sk := coretesting.KVStoreService(ctx, "test") + schema := collections.NewSchemaBuilder(sk) im := newTestIndexedMap(schema) @@ -103,3 +107,27 @@ func TestIndexedMap(t *testing.T) { require.NoError(t, err) require.Equal(t, company{"milan", 4}, v) } + +type inferIndex struct { + City *indexes.Multi[string, string, company] + Vat *indexes.Unique[uint64, string, company] +} + +func newInferIndex(schema *collections.SchemaBuilder) *inferIndex { + return &inferIndex{ + City: indexes.NewMulti(schema, collections.NewPrefix(1), "companies_by_city", collections.StringKey, collections.StringKey, func(pk string, value company) (string, error) { + return value.City, nil + }), + Vat: indexes.NewUnique(schema, collections.NewPrefix(2), "companies_by_vat", collections.Uint64Key, collections.StringKey, func(pk string, value company) (uint64, error) { + return value.Vat, nil + }), + } +} + +func TestIndexedMapInfer(t *testing.T) { + sk := coretesting.KVStoreService(coretesting.Context(), "test") + schema := collections.NewSchemaBuilder(sk) + + _, err := collections.NewIndexedMapSafe(schema, collections.NewPrefix(0), "im", collections.StringKey, colltest.MockValueCodec[company](), newInferIndex(schema)) + require.NoError(t, err) +} diff --git a/collections/indexes/helpers_test.go b/collections/indexes/helpers_test.go index 469aa38dba33..87901e486a5f 100644 --- a/collections/indexes/helpers_test.go +++ b/collections/indexes/helpers_test.go @@ -3,8 +3,9 @@ package indexes import ( "testing" - "cosmossdk.io/collections" "github.com/stretchr/testify/require" + + "cosmossdk.io/collections" ) func TestHelpers(t *testing.T) { diff --git a/collections/indexes/indexes_test.go b/collections/indexes/indexes_test.go index a2754ae7d416..470b6d4a6200 100644 --- a/collections/indexes/indexes_test.go +++ b/collections/indexes/indexes_test.go @@ -4,48 +4,13 @@ import ( "context" "cosmossdk.io/core/store" - db "github.com/cosmos/cosmos-db" + "cosmossdk.io/core/testing" ) -// TODO remove this when we add testStore to core/store. - -type testStore struct { - db db.DB -} - -func (t testStore) OpenKVStore(ctx context.Context) store.KVStore { - return t -} - -func (t testStore) Get(key []byte) ([]byte, error) { - return t.db.Get(key) -} - -func (t testStore) Has(key []byte) (bool, error) { - return t.db.Has(key) -} - -func (t testStore) Set(key, value []byte) error { - return t.db.Set(key, value) -} - -func (t testStore) Delete(key []byte) error { - return t.db.Delete(key) -} - -func (t testStore) Iterator(start, end []byte) (store.Iterator, error) { - return t.db.Iterator(start, end) -} - -func (t testStore) ReverseIterator(start, end []byte) (store.Iterator, error) { - return t.db.ReverseIterator(start, end) -} - -var _ store.KVStore = testStore{} - func deps() (store.KVStoreService, context.Context) { - kv := db.NewMemDB() - return &testStore{kv}, context.Background() + ctx := coretesting.Context() + kv := coretesting.KVStoreService(ctx, "test") + return kv, ctx } type company struct { diff --git a/collections/indexes/multi.go b/collections/indexes/multi.go index 9e567aaab425..3554346906cb 100644 --- a/collections/indexes/multi.go +++ b/collections/indexes/multi.go @@ -8,6 +8,21 @@ import ( "cosmossdk.io/collections/codec" ) +type multiOptions struct { + uncheckedValue bool +} + +// WithMultiUncheckedValue is an option that can be passed to NewMulti to +// ignore index values different from '[]byte{}' and continue with the operation. +// This should be used only to behave nicely in case you have used values different +// from '[]byte{}' in your storage before migrating to collections. Refer to +// WithKeySetUncheckedValue for more information. +func WithMultiUncheckedValue() func(*multiOptions) { + return func(o *multiOptions) { + o.uncheckedValue = true + } +} + // Multi defines the most common index. It can be used to create a reference between // a field of value and its primary key. Multiple primary keys can be mapped to the same // reference key as the index does not enforce uniqueness constraints. @@ -27,10 +42,35 @@ func NewMulti[ReferenceKey, PrimaryKey, Value any]( refCodec codec.KeyCodec[ReferenceKey], pkCodec codec.KeyCodec[PrimaryKey], getRefKeyFunc func(pk PrimaryKey, value Value) (ReferenceKey, error), + options ...func(*multiOptions), ) *Multi[ReferenceKey, PrimaryKey, Value] { + o := new(multiOptions) + for _, opt := range options { + opt(o) + } + if o.uncheckedValue { + return &Multi[ReferenceKey, PrimaryKey, Value]{ + getRefKey: getRefKeyFunc, + refKeys: collections.NewKeySet( + schema, + prefix, + name, + collections.PairKeyCodec(refCodec, pkCodec), + collections.WithKeySetUncheckedValue(), + collections.WithKeySetSecondaryIndex(), + ), + } + } + return &Multi[ReferenceKey, PrimaryKey, Value]{ getRefKey: getRefKeyFunc, - refKeys: collections.NewKeySet(schema, prefix, name, collections.PairKeyCodec(refCodec, pkCodec)), + refKeys: collections.NewKeySet( + schema, + prefix, + name, + collections.PairKeyCodec(refCodec, pkCodec), + collections.WithKeySetSecondaryIndex(), + ), } } diff --git a/collections/indexes/multi_test.go b/collections/indexes/multi_test.go index ed11195bf0f4..a0b1313b8568 100644 --- a/collections/indexes/multi_test.go +++ b/collections/indexes/multi_test.go @@ -3,8 +3,9 @@ package indexes import ( "testing" - "cosmossdk.io/collections" "github.com/stretchr/testify/require" + + "cosmossdk.io/collections" ) func TestMultiIndex(t *testing.T) { @@ -15,7 +16,7 @@ func TestMultiIndex(t *testing.T) { return value.City, nil }) - // we crete two reference keys for primary key 1 and 2 associated with "milan" + // we create two reference keys for primary key 1 and 2 associated with "milan" require.NoError(t, mi.Reference(ctx, 1, company{City: "milan"}, func() (company, error) { return company{}, collections.ErrNotFound })) require.NoError(t, mi.Reference(ctx, 2, company{City: "milan"}, func() (company, error) { return company{}, collections.ErrNotFound })) @@ -60,3 +61,52 @@ func TestMultiIndex(t *testing.T) { require.False(t, iter.Valid()) require.NoError(t, iter.Close()) } + +func TestMultiUnchecked(t *testing.T) { + sk, ctx := deps() + schema := collections.NewSchemaBuilder(sk) + + uncheckedMi := NewMulti(schema, collections.NewPrefix("prefix"), "multi_index", collections.StringKey, collections.Uint64Key, func(_ uint64, value company) (string, error) { + return value.City, nil + }, WithMultiUncheckedValue()) + + mi := NewMulti(schema, collections.NewPrefix("prefix"), "multi_index", collections.StringKey, collections.Uint64Key, func(_ uint64, value company) (string, error) { + return value.City, nil + }) + + rawKey, err := collections.EncodeKeyWithPrefix( + collections.NewPrefix("prefix"), + uncheckedMi.KeyCodec(), + collections.Join("milan", uint64(2))) + require.NoError(t, err) + + // set value to be something different from []byte{} + require.NoError(t, sk.OpenKVStore(ctx).Set(rawKey, []byte("something"))) + + // normal multi index will fail. + err = mi.Walk(ctx, nil, func(indexingKey string, indexedKey uint64) (stop bool, err error) { + return true, err + }) + require.ErrorIs(t, err, collections.ErrEncoding) + + // unchecked multi index will not fail. + err = uncheckedMi.Walk(ctx, nil, func(indexingKey string, indexedKey uint64) (stop bool, err error) { + require.Equal(t, "milan", indexingKey) + require.Equal(t, uint64(2), indexedKey) + return true, err + }) + require.NoError(t, err) + + // unchecked multi will also reset the value + err = mi.Reference(ctx, 2, company{City: "milan"}, func() (company, error) { + return company{ + City: "milan", + }, nil + }) + require.NoError(t, err) + + // value reset to []byte{} + rawValue, err := sk.OpenKVStore(ctx).Get(rawKey) + require.NoError(t, err) + require.Equal(t, []byte{}, rawValue) +} diff --git a/collections/indexes/reverse_pair.go b/collections/indexes/reverse_pair.go index 243b2d289ad8..4b85b62c6c97 100644 --- a/collections/indexes/reverse_pair.go +++ b/collections/indexes/reverse_pair.go @@ -7,6 +7,21 @@ import ( "cosmossdk.io/collections/codec" ) +type reversePairOptions struct { + uncheckedValue bool +} + +// WithReversePairUncheckedValue is an option that can be passed to NewReversePair to +// ignore index values different from '[]byte{}' and continue with the operation. +// This should be used only if you are migrating to collections and have used a different +// placeholder value in your storage index keys. +// Refer to WithKeySetUncheckedValue for more information. +func WithReversePairUncheckedValue() func(*reversePairOptions) { + return func(o *reversePairOptions) { + o.uncheckedValue = true + } +} + // ReversePair is an index that is used with collections.Pair keys. It indexes objects by their second part of the key. // When the value is being indexed by collections.IndexedMap then ReversePair will create a relationship between // the second part of the primary key and the first part. @@ -31,10 +46,34 @@ func NewReversePair[Value, K1, K2 any]( prefix collections.Prefix, name string, pairCodec codec.KeyCodec[collections.Pair[K1, K2]], + options ...func(*reversePairOptions), ) *ReversePair[K1, K2, Value] { pkc := pairCodec.(pairKeyCodec[K1, K2]) + o := new(reversePairOptions) + for _, option := range options { + option(o) + } + if o.uncheckedValue { + return &ReversePair[K1, K2, Value]{ + refKeys: collections.NewKeySet( + sb, + prefix, + name, + collections.PairKeyCodec(pkc.KeyCodec2(), pkc.KeyCodec1()), + collections.WithKeySetUncheckedValue(), + collections.WithKeySetSecondaryIndex(), + ), + } + } + mi := &ReversePair[K1, K2, Value]{ - refKeys: collections.NewKeySet(sb, prefix, name, collections.PairKeyCodec(pkc.KeyCodec2(), pkc.KeyCodec1())), + refKeys: collections.NewKeySet( + sb, + prefix, + name, + collections.PairKeyCodec(pkc.KeyCodec2(), pkc.KeyCodec1()), + collections.WithKeySetSecondaryIndex(), + ), } return mi diff --git a/collections/indexes/reverse_pair_test.go b/collections/indexes/reverse_pair_test.go index 15f0b996677a..da1c1c961166 100644 --- a/collections/indexes/reverse_pair_test.go +++ b/collections/indexes/reverse_pair_test.go @@ -3,8 +3,9 @@ package indexes import ( "testing" - "cosmossdk.io/collections" "github.com/stretchr/testify/require" + + "cosmossdk.io/collections" ) type ( @@ -63,6 +64,45 @@ func TestReversePair(t *testing.T) { // assert if we remove address1 atom balance, we can no longer find it in the index err = indexedMap.Remove(ctx, collections.Join("address1", "atom")) require.NoError(t, err) - _, err = indexedMap.Indexes.Denom.MatchExact(ctx, "atom") - require.ErrorIs(t, collections.ErrInvalidIterator, err) + iter, err = indexedMap.Indexes.Denom.MatchExact(ctx, "atom") + require.NoError(t, err) + defer iter.Close() + pks, err = iter.PrimaryKeys() + require.NoError(t, err) + require.Empty(t, pks) +} + +func TestUncheckedReversePair(t *testing.T) { + sk, ctx := deps() + sb := collections.NewSchemaBuilder(sk) + prefix := collections.NewPrefix("prefix") + keyCodec := collections.PairKeyCodec(collections.StringKey, collections.StringKey) + + uncheckedRp := NewReversePair[Amount](sb, prefix, "denom_index", keyCodec, WithReversePairUncheckedValue()) + rp := NewReversePair[Amount](sb, prefix, "denom_index", keyCodec) + + rawKey, err := collections.EncodeKeyWithPrefix(prefix, uncheckedRp.KeyCodec(), collections.Join("atom", "address1")) + require.NoError(t, err) + + require.NoError(t, sk.OpenKVStore(ctx).Set(rawKey, []byte("i should not be here"))) + + // normal reverse pair fails + err = rp.Walk(ctx, nil, func(denom, address string) (bool, error) { + return false, nil + }) + require.ErrorIs(t, err, collections.ErrEncoding) + + // unchecked reverse pair succeeds + err = uncheckedRp.Walk(ctx, nil, func(indexingKey, indexedKey string) (stop bool, err error) { + require.Equal(t, "atom", indexingKey) + return true, nil + }) + require.NoError(t, err) + + // unchecked reverse pair lazily updates + err = uncheckedRp.Reference(ctx, collections.Join("address1", "atom"), 0, nil) + require.NoError(t, err) + rawValue, err := sk.OpenKVStore(ctx).Get(rawKey) + require.NoError(t, err) + require.Equal(t, []byte{}, rawValue) } diff --git a/collections/indexes/unique_test.go b/collections/indexes/unique_test.go index f3a174fc3981..54e46c962e1e 100644 --- a/collections/indexes/unique_test.go +++ b/collections/indexes/unique_test.go @@ -3,8 +3,9 @@ package indexes import ( "testing" - "cosmossdk.io/collections" "github.com/stretchr/testify/require" + + "cosmossdk.io/collections" ) func TestUniqueIndex(t *testing.T) { diff --git a/collections/indexing.go b/collections/indexing.go new file mode 100644 index 000000000000..8a482c39810f --- /dev/null +++ b/collections/indexing.go @@ -0,0 +1,258 @@ +package collections + +import ( + "bytes" + "fmt" + "reflect" + "strings" + + "github.com/cosmos/gogoproto/proto" + "github.com/tidwall/btree" + "google.golang.org/protobuf/reflect/protoreflect" + + "cosmossdk.io/collections/codec" + "cosmossdk.io/schema" +) + +// IndexingOptions are indexing options for the collections schema. +type IndexingOptions struct { + // RetainDeletionsFor is the list of collections to retain deletions for. + RetainDeletionsFor []string +} + +// ModuleCodec returns the ModuleCodec for this schema for the provided options. +func (s Schema) ModuleCodec(opts IndexingOptions) (schema.ModuleCodec, error) { + decoder := moduleDecoder{ + collectionLookup: &btree.Map[string, *collectionSchemaCodec]{}, + } + + retainDeletions := make(map[string]bool) + for _, collName := range opts.RetainDeletionsFor { + retainDeletions[collName] = true + } + + var types []schema.Type + for _, collName := range s.collectionsOrdered { + coll := s.collectionsByName[collName] + + // skip secondary indexes + if coll.isSecondaryIndex() { + continue + } + + cdc, err := coll.schemaCodec() + if err != nil { + return schema.ModuleCodec{}, err + } + + if retainDeletions[coll.GetName()] { + cdc.objectType.RetainDeletions = true + } + + // this part below is a bit hacky, it will try to convert to a proto.Message + // in order to get any enum types inside of it. + emptyVal, err := coll.ValueCodec().Decode([]byte{}) + if err == nil { + // convert to proto.Message + pt, err := toProtoMessage(emptyVal) + if err == nil { + msgName := proto.MessageName(pt) + desc, err := proto.HybridResolver.FindDescriptorByName(protoreflect.FullName(msgName)) + if err != nil { + return schema.ModuleCodec{}, fmt.Errorf("could not find descriptor for %s: %w", msgName, err) + } + msgDesc := desc.(protoreflect.MessageDescriptor) + + // go through enum descriptors and add them to types + for i := 0; i < msgDesc.Fields().Len(); i++ { + field := msgDesc.Fields().Get(i) + enum := field.Enum() + if enum == nil { + continue + } + + enumType := schema.EnumType{ + Name: strings.ReplaceAll(string(enum.FullName()), ".", "_"), // make it compatible with schema + } + for j := 0; j < enum.Values().Len(); j++ { + val := enum.Values().Get(j) + enumType.Values = append(enumType.Values, schema.EnumValueDefinition{ + Name: string(val.Name()), + Value: int32(val.Number()), + }) + } + types = append(types, enumType) + } + + } + } + + types = append(types, cdc.objectType) + decoder.collectionLookup.Set(string(coll.GetPrefix()), cdc) + } + + modSchema, err := schema.CompileModuleSchema(types...) + if err != nil { + return schema.ModuleCodec{}, err + } + + return schema.ModuleCodec{ + Schema: modSchema, + KVDecoder: decoder.decodeKV, + }, nil +} + +type moduleDecoder struct { + // collectionLookup lets us efficiently look the correct collection based on raw key bytes + collectionLookup *btree.Map[string, *collectionSchemaCodec] +} + +func (m moduleDecoder) decodeKV(update schema.KVPairUpdate) ([]schema.StateObjectUpdate, error) { + key := update.Key + ks := string(key) + var cd *collectionSchemaCodec + // we look for the collection whose prefix is less than this key + m.collectionLookup.Descend(ks, func(prefix string, cur *collectionSchemaCodec) bool { + bytesPrefix := cur.coll.GetPrefix() + if bytes.HasPrefix(key, bytesPrefix) { + cd = cur + return true + } + return false + }) + if cd == nil { + return nil, nil + } + + return cd.decodeKVPair(update) +} + +func (c collectionSchemaCodec) decodeKVPair(update schema.KVPairUpdate) ([]schema.StateObjectUpdate, error) { + // strip prefix + key := update.Key + key = key[len(c.coll.GetPrefix()):] + + k, err := c.keyDecoder(key) + if err != nil { + return []schema.StateObjectUpdate{ + {TypeName: c.coll.GetName()}, + }, err + } + + if update.Remove { + return []schema.StateObjectUpdate{ + {TypeName: c.coll.GetName(), Key: k, Delete: true}, + }, nil + } + + v, err := c.valueDecoder(update.Value) + if err != nil { + return []schema.StateObjectUpdate{ + {TypeName: c.coll.GetName(), Key: k}, + }, err + } + + return []schema.StateObjectUpdate{ + {TypeName: c.coll.GetName(), Key: k, Value: v}, + }, nil +} + +func (c collectionImpl[K, V]) schemaCodec() (*collectionSchemaCodec, error) { + res := &collectionSchemaCodec{ + coll: c, + } + res.objectType.Name = c.GetName() + + keyDecoder, err := codec.KeySchemaCodec(c.m.kc) + if err != nil { + return nil, err + } + res.objectType.KeyFields = keyDecoder.Fields + res.keyDecoder = func(i []byte) (any, error) { + _, x, err := c.m.kc.Decode(i) + if err != nil { + return nil, err + } + if keyDecoder.ToSchemaType == nil { + return x, nil + } + return keyDecoder.ToSchemaType(x) + } + ensureFieldNames(c.m.kc, "key", res.objectType.KeyFields) + + valueDecoder, err := codec.ValueSchemaCodec(c.m.vc) + if err != nil { + return nil, err + } + res.objectType.ValueFields = valueDecoder.Fields + res.valueDecoder = func(i []byte) (any, error) { + x, err := c.m.vc.Decode(i) + if err != nil { + return nil, err + } + + if valueDecoder.ToSchemaType == nil { + return x, nil + } + + return valueDecoder.ToSchemaType(x) + } + ensureFieldNames(c.m.vc, "value", res.objectType.ValueFields) + + return res, nil +} + +// ensureFieldNames makes sure that all fields have valid names - either the +// names were specified by user or they get filled +func ensureFieldNames(x any, defaultName string, cols []schema.Field) { + var names []string = nil + if hasName, ok := x.(interface{ Name() string }); ok { + name := hasName.Name() + if name != "" { + names = strings.Split(hasName.Name(), ",") + } + } + for i, col := range cols { + if names != nil && i < len(names) { + col.Name = names[i] + } else if col.Name == "" { + if i == 0 && len(cols) == 1 { + col.Name = defaultName + } else { + col.Name = fmt.Sprintf("%s%d", defaultName, i+1) + } + } + cols[i] = col + } +} + +// toProtoMessage is a helper to convert a value to a proto.Message. +func toProtoMessage(value interface{}) (proto.Message, error) { + if value == nil { + return nil, fmt.Errorf("value is nil") + } + + // Check if the value already implements proto.Message + if msg, ok := value.(proto.Message); ok { + return msg, nil + } + + // Use reflection to handle non-pointer values + v := reflect.ValueOf(value) + if v.Kind() == reflect.Ptr { + // Already a pointer, but doesn't implement proto.Message + return nil, fmt.Errorf("value is a pointer but does not implement proto.Message") + } + + // If not a pointer, create a pointer to the value dynamically + ptr := reflect.New(v.Type()) + ptr.Elem().Set(v) + + // Assert if the pointer implements proto.Message + msg, ok := ptr.Interface().(proto.Message) + if !ok { + return nil, fmt.Errorf("value does not implement proto.Message") + } + + return msg, nil +} diff --git a/collections/item.go b/collections/item.go index 155cb729aa24..1b36bf46dad6 100644 --- a/collections/item.go +++ b/collections/item.go @@ -37,7 +37,7 @@ func (i Item[V]) Set(ctx context.Context, value V) error { } // Has reports whether the item exists in the store or not. -// Returns an error in case +// Returns an error in case encoding fails. func (i Item[V]) Has(ctx context.Context) (bool, error) { return (Map[noKey, V])(i).Has(ctx, noKey{}) } diff --git a/collections/iter.go b/collections/iter.go index 38a21a22a353..ea87082a267c 100644 --- a/collections/iter.go +++ b/collections/iter.go @@ -1,12 +1,12 @@ package collections import ( + "bytes" "context" "errors" "fmt" "cosmossdk.io/collections/codec" - "cosmossdk.io/core/store" ) @@ -130,39 +130,51 @@ func (r *Range[K]) RangeValues() (start, end *RangeKey[K], order Order, err erro return r.start, r.end, r.order, nil } -// iteratorFromRanger generates an Iterator instance, with the proper prefixing and ranging. -// a nil Ranger can be seen as an ascending iteration over all the possible keys. -func iteratorFromRanger[K, V any](ctx context.Context, m Map[K, V], r Ranger[K]) (iter Iterator[K, V], err error) { +// parseRangeInstruction converts a Ranger into start bytes, end bytes and order of a store iteration. +func parseRangeInstruction[K any](prefix []byte, keyCodec codec.KeyCodec[K], r Ranger[K]) ([]byte, []byte, Order, error) { var ( start *RangeKey[K] end *RangeKey[K] order = OrderAscending + err error ) if r != nil { start, end, order, err = r.RangeValues() if err != nil { - return iter, err + return nil, nil, 0, err } } - startBytes := m.prefix + startBytes := prefix if start != nil { - startBytes, err = encodeRangeBound(m.prefix, m.kc, start) + startBytes, err = encodeRangeBound(prefix, keyCodec, start) if err != nil { - return iter, err + return nil, nil, 0, err } } var endBytes []byte if end != nil { - endBytes, err = encodeRangeBound(m.prefix, m.kc, end) + endBytes, err = encodeRangeBound(prefix, keyCodec, end) if err != nil { - return iter, err + return nil, nil, 0, err } } else { - endBytes = nextBytesPrefixKey(m.prefix) + endBytes = nextBytesPrefixKey(prefix) } + if bytes.Compare(startBytes, endBytes) == 1 { + return nil, nil, 0, ErrInvalidIterator + } + return startBytes, endBytes, order, nil +} +// iteratorFromRanger generates an Iterator instance, with the proper prefixing and ranging. +// a nil Ranger can be seen as an ascending iteration over all the possible keys. +func iteratorFromRanger[K, V any](ctx context.Context, m Map[K, V], r Ranger[K]) (iter Iterator[K, V], err error) { + startBytes, endBytes, order, err := parseRangeInstruction(m.prefix, m.kc, r) + if err != nil { + return Iterator[K, V]{}, err + } return newIterator(ctx, startBytes, endBytes, order, m) } @@ -183,9 +195,6 @@ func newIterator[K, V any](ctx context.Context, start, end []byte, order Order, if err != nil { return Iterator[K, V]{}, err } - if !iter.Valid() { - return Iterator[K, V]{}, ErrInvalidIterator - } return Iterator[K, V]{ kc: m.kc, @@ -195,7 +204,7 @@ func newIterator[K, V any](ctx context.Context, start, end []byte, order Order, }, nil } -// Iterator defines a generic wrapper around an storetypes.Iterator. +// Iterator defines a generic wrapper around a storetypes.Iterator. // This iterator provides automatic key and value encoding, // it assumes all the keys and values contained within the storetypes.Iterator // range are the same. diff --git a/collections/iter_test.go b/collections/iter_test.go index dfe690bb97ba..872156196900 100644 --- a/collections/iter_test.go +++ b/collections/iter_test.go @@ -1,6 +1,7 @@ package collections import ( + "errors" "fmt" "testing" @@ -10,11 +11,13 @@ import ( func TestIteratorBasic(t *testing.T) { sk, ctx := deps() // safety check to ensure that iteration does not cross prefix boundaries - sk.OpenKVStore(ctx).Set([]byte{0, 0}, []byte("before prefix")) - sk.OpenKVStore(ctx).Set([]byte{2, 1}, []byte("after prefix")) + err := sk.OpenKVStore(ctx).Set([]byte{0, 0}, []byte("before prefix")) + require.NoError(t, err) + err = sk.OpenKVStore(ctx).Set([]byte{2, 1}, []byte("after prefix")) + require.NoError(t, err) schemaBuilder := NewSchemaBuilder(sk) m := NewMap(schemaBuilder, NewPrefix(1), "m", StringKey, Uint64Value) - _, err := schemaBuilder.Build() + _, err = schemaBuilder.Build() require.NoError(t, err) for i := uint64(1); i <= 2; i++ { @@ -186,7 +189,7 @@ func TestWalk(t *testing.T) { }) require.NoError(t, err) - sentinelErr := fmt.Errorf("sentinel error") + sentinelErr := errors.New("sentinel error") err = m.Walk(ctx, nil, func(key, value uint64) (stop bool, err error) { require.LessOrEqual(t, key, uint64(3)) // asserts that after the number three we stop if key == 3 { diff --git a/collections/json.go b/collections/json.go new file mode 100644 index 000000000000..6b6866ecfbdc --- /dev/null +++ b/collections/json.go @@ -0,0 +1,58 @@ +package collections + +import ( + "encoding/json" + "fmt" + + "cosmossdk.io/collections/codec" +) + +func NewJSONValueCodec[T any]() codec.ValueCodec[T] { + return jsonValue[T]{ + typeName: fmt.Sprintf("%T", new(T)), + } +} + +type jsonValue[T any] struct { + typeName string +} + +// Decode implements codec.ValueCodec. +func (jsonValue[T]) Decode(b []byte) (T, error) { + var t T + if err := json.Unmarshal(b, &t); err != nil { + return t, err + } + + return t, nil +} + +// DecodeJSON implements codec.ValueCodec. +func (jsonValue[T]) DecodeJSON(b []byte) (T, error) { + var t T + if err := json.Unmarshal(b, &t); err != nil { + return t, err + } + + return t, nil +} + +// Encode implements codec.ValueCodec. +func (jsonValue[T]) Encode(value T) ([]byte, error) { + return json.Marshal(value) +} + +// EncodeJSON implements codec.ValueCodec. +func (jsonValue[T]) EncodeJSON(value T) ([]byte, error) { + return json.Marshal(value) +} + +// Stringify implements codec.ValueCodec. +func (jsonValue[T]) Stringify(value T) string { + return fmt.Sprintf("%v", value) +} + +// ValueType implements codec.ValueCodec. +func (jv jsonValue[T]) ValueType() string { + return fmt.Sprintf("json(%s)", jv.typeName) +} diff --git a/collections/keyset.go b/collections/keyset.go index 408086b67262..ee8e5ba011bc 100644 --- a/collections/keyset.go +++ b/collections/keyset.go @@ -8,14 +8,53 @@ import ( "cosmossdk.io/collections/codec" ) +// WithKeySetUncheckedValue changes the behavior of the KeySet when it encounters +// a value different from '[]byte{}', by default the KeySet errors when this happens. +// This option allows to ignore the value and continue with the operation, in turn +// the value will be cleared out and set to '[]byte{}'. +// You should never use this option if you're creating a new state object from scratch. +// This should be used only to behave nicely in case you have used values different +// from '[]byte{}' in your storage before migrating to collections. +func WithKeySetUncheckedValue() func(opt *keySetOptions) { + return func(opt *keySetOptions) { + opt.uncheckedValue = true + } +} + +// WithKeySetSecondaryIndex changes the behavior of the KeySet to be a secondary index. +func WithKeySetSecondaryIndex() func(opt *keySetOptions) { + return func(opt *keySetOptions) { + opt.isSecondaryIndex = true + } +} + +type keySetOptions struct { + uncheckedValue bool + isSecondaryIndex bool +} + // KeySet builds on top of a Map and represents a collection retaining only a set // of keys and no value. It can be used, for example, in an allow list. type KeySet[K any] Map[K, NoValue] // NewKeySet returns a KeySet given a Schema, Prefix a human name for the collection // and a KeyCodec for the key K. -func NewKeySet[K any](schema *SchemaBuilder, prefix Prefix, name string, keyCodec codec.KeyCodec[K]) KeySet[K] { - return (KeySet[K])(NewMap(schema, prefix, name, keyCodec, noValueCodec)) +func NewKeySet[K any]( + schema *SchemaBuilder, + prefix Prefix, + name string, + keyCodec codec.KeyCodec[K], + options ...func(opt *keySetOptions), +) KeySet[K] { + o := new(keySetOptions) + for _, opt := range options { + opt(o) + } + vc := noValueCodec + if o.uncheckedValue { + vc = codec.NewAltValueCodec(vc, func(_ []byte) (NoValue, error) { return NoValue{}, nil }) + } + return (KeySet[K])(NewMap(schema, prefix, name, keyCodec, vc, withMapSecondaryIndex(o.isSecondaryIndex))) } // Set adds the key to the KeySet. Errors on encoding problems. @@ -57,6 +96,12 @@ func (k KeySet[K]) Walk(ctx context.Context, ranger Ranger[K], walkFunc func(key return (Map[K, NoValue])(k).Walk(ctx, ranger, func(key K, value NoValue) (bool, error) { return walkFunc(key) }) } +// Clear clears the KeySet using the provided Ranger. Refer to Map.Clear for +// behavioral documentation. +func (k KeySet[K]) Clear(ctx context.Context, ranger Ranger[K]) error { + return (Map[K, NoValue])(k).Clear(ctx, ranger) +} + func (k KeySet[K]) KeyCodec() codec.KeyCodec[K] { return (Map[K, NoValue])(k).KeyCodec() } func (k KeySet[K]) ValueCodec() codec.ValueCodec[NoValue] { return (Map[K, NoValue])(k).ValueCodec() } @@ -73,6 +118,7 @@ var noValueCodec codec.ValueCodec[NoValue] = NoValue{} const noValueValueType = "no_value" +// NoValue is a type that can be used to represent a non-existing value. type NoValue struct{} func (n NoValue) EncodeJSON(_ NoValue) ([]byte, error) { @@ -92,7 +138,7 @@ func (NoValue) Encode(_ NoValue) ([]byte, error) { func (NoValue) Decode(b []byte) (NoValue, error) { if !bytes.Equal(b, []byte{}) { - return NoValue{}, fmt.Errorf("%w: invalid value, wanted an empty non-nil byte slice", ErrEncoding) + return NoValue{}, fmt.Errorf("%w: invalid value, wanted an empty non-nil byte slice, got: %x", ErrEncoding, b) } return NoValue{}, nil } diff --git a/collections/keyset_test.go b/collections/keyset_test.go index 6fe3e7eedfb0..cabc2ead865b 100644 --- a/collections/keyset_test.go +++ b/collections/keyset_test.go @@ -67,3 +67,34 @@ func Test_noValue(t *testing.T) { _, err = noValueCodec.Decode([]byte("bad")) require.ErrorIs(t, err, ErrEncoding) } + +func TestUncheckedKeySet(t *testing.T) { + sk, ctx := deps() + schema := NewSchemaBuilder(sk) + uncheckedKs := NewKeySet(schema, NewPrefix("keyset"), "keyset", StringKey, WithKeySetUncheckedValue()) + ks := NewKeySet(schema, NewPrefix("keyset"), "keyset", StringKey) + // we set a NoValue unfriendly value. + require.NoError(t, sk.OpenKVStore(ctx).Set([]byte("keyset1"), []byte("A"))) + require.NoError(t, sk.OpenKVStore(ctx).Set([]byte("keyset2"), []byte("B"))) + + // the standard KeySet errors here, because it doesn't like the fact that the value is []byte("A") + // and not []byte{}. + err := ks.Walk(ctx, nil, func(key string) (stop bool, err error) { + return true, nil + }) + require.ErrorIs(t, err, ErrEncoding) + + // the unchecked KeySet doesn't care about the value, so it works. + err = uncheckedKs.Walk(ctx, nil, func(key string) (stop bool, err error) { + require.Equal(t, "1", key) + return true, nil + }) + require.NoError(t, err) + + // now we set it again + require.NoError(t, uncheckedKs.Set(ctx, "1")) + // and we will see that the value which was []byte("A") has been cleared to be []byte{} + raw, err := sk.OpenKVStore(ctx).Get([]byte("keyset1")) + require.NoError(t, err) + require.Equal(t, []byte{}, raw) +} diff --git a/collections/lookup_map.go b/collections/lookup_map.go new file mode 100644 index 000000000000..fcb7c4466e40 --- /dev/null +++ b/collections/lookup_map.go @@ -0,0 +1,104 @@ +package collections + +import ( + "context" + "fmt" + + "cosmossdk.io/collections/codec" +) + +// LookupMap represents a map that is not iterable. +type LookupMap[K, V any] Map[K, V] + +// NewLookupMap creates a new LookupMap. +func NewLookupMap[K, V any]( + schemaBuilder *SchemaBuilder, + prefix Prefix, + name string, + keyCodec codec.KeyCodec[K], + valueCodec codec.ValueCodec[V], +) LookupMap[K, V] { + m := LookupMap[K, V](NewMap[K, V](schemaBuilder, prefix, name, keyCodec, valueCodec)) + return m +} + +// GetName returns the name of the collection. +func (m LookupMap[K, V]) GetName() string { + return m.name +} + +// GetPrefix returns the prefix of the collection. +func (m LookupMap[K, V]) GetPrefix() []byte { + return m.prefix +} + +// Set maps the provided value to the provided key in the store. +// Errors with ErrEncoding if key or value encoding fails. +func (m LookupMap[K, V]) Set(ctx context.Context, key K, value V) error { + bytesKey, err := EncodeKeyWithPrefix(m.prefix, m.kc, key) + if err != nil { + return err + } + + valueBytes, err := m.vc.Encode(value) + if err != nil { + return fmt.Errorf("%w: value encode: %w", ErrEncoding, err) + } + + kvStore := m.sa(ctx) + return kvStore.Set(bytesKey, valueBytes) +} + +// Get returns the value associated with the provided key, +// errors with ErrNotFound if the key does not exist, or +// with ErrEncoding if the key or value decoding fails. +func (m LookupMap[K, V]) Get(ctx context.Context, key K) (v V, err error) { + bytesKey, err := EncodeKeyWithPrefix(m.prefix, m.kc, key) + if err != nil { + return v, err + } + + kvStore := m.sa(ctx) + valueBytes, err := kvStore.Get(bytesKey) + if err != nil { + return v, err + } + if valueBytes == nil { + return v, fmt.Errorf("%w: key '%s' of type %s", ErrNotFound, m.kc.Stringify(key), m.vc.ValueType()) + } + + v, err = m.vc.Decode(valueBytes) + if err != nil { + return v, fmt.Errorf("%w: value decode: %w", ErrEncoding, err) + } + return v, nil +} + +// Has reports whether the key is present in storage or not. +// Errors with ErrEncoding if key encoding fails. +func (m LookupMap[K, V]) Has(ctx context.Context, key K) (bool, error) { + bytesKey, err := EncodeKeyWithPrefix(m.prefix, m.kc, key) + if err != nil { + return false, err + } + kvStore := m.sa(ctx) + return kvStore.Has(bytesKey) +} + +// Remove removes the key from the storage. +// Errors with ErrEncoding if key encoding fails. +// If the key does not exist then this is a no-op. +func (m LookupMap[K, V]) Remove(ctx context.Context, key K) error { + bytesKey, err := EncodeKeyWithPrefix(m.prefix, m.kc, key) + if err != nil { + return err + } + kvStore := m.sa(ctx) + return kvStore.Delete(bytesKey) +} + +// KeyCodec returns the Map's KeyCodec. +func (m LookupMap[K, V]) KeyCodec() codec.KeyCodec[K] { return m.kc } + +// ValueCodec returns the Map's ValueCodec. +func (m LookupMap[K, V]) ValueCodec() codec.ValueCodec[V] { return m.vc } diff --git a/collections/lookup_map_test.go b/collections/lookup_map_test.go new file mode 100644 index 000000000000..74d3cbac6b46 --- /dev/null +++ b/collections/lookup_map_test.go @@ -0,0 +1,42 @@ +package collections_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "cosmossdk.io/collections" + "cosmossdk.io/core/testing" +) + +func TestLookupMap(t *testing.T) { + ctx := coretesting.Context() + sk := coretesting.KVStoreService(ctx, "test") + schema := collections.NewSchemaBuilder(sk) + + lm := collections.NewLookupMap(schema, collections.NewPrefix("hi"), "lm", collections.Uint64Key, collections.Uint64Value) + _, err := schema.Build() + require.NoError(t, err) + + // test not has + has, err := lm.Has(ctx, 1) + require.NoError(t, err) + require.False(t, has) + // test get error + _, err = lm.Get(ctx, 1) + require.ErrorIs(t, err, collections.ErrNotFound) + + // test set/get + err = lm.Set(ctx, 1, 100) + require.NoError(t, err) + v, err := lm.Get(ctx, 1) + require.NoError(t, err) + require.Equal(t, uint64(100), v) + + // test remove + err = lm.Remove(ctx, 1) + require.NoError(t, err) + has, err = lm.Has(ctx, 1) + require.NoError(t, err) + require.False(t, has) +} diff --git a/collections/map.go b/collections/map.go index 9ada53c494cc..3fda806df380 100644 --- a/collections/map.go +++ b/collections/map.go @@ -1,11 +1,11 @@ package collections import ( + "bytes" "context" "fmt" "cosmossdk.io/collections/codec" - "cosmossdk.io/core/store" ) @@ -20,6 +20,22 @@ type Map[K, V any] struct { sa func(context.Context) store.KVStore prefix []byte name string + + // isSecondaryIndex indicates that this map represents a secondary index + // on another collection and that it should be skipped when generating + // a user facing schema + isSecondaryIndex bool +} + +// withMapSecondaryIndex changes the behavior of the Map to be a secondary index. +func withMapSecondaryIndex(isSecondaryIndex bool) func(opt *mapOptions) { + return func(opt *mapOptions) { + opt.isSecondaryIndex = isSecondaryIndex + } +} + +type mapOptions struct { + isSecondaryIndex bool } // NewMap returns a Map given a StoreKey, a Prefix, human-readable name and the relative value and key encoders. @@ -31,13 +47,19 @@ func NewMap[K, V any]( name string, keyCodec codec.KeyCodec[K], valueCodec codec.ValueCodec[V], + options ...func(opt *mapOptions), ) Map[K, V] { + o := new(mapOptions) + for _, opt := range options { + opt(o) + } m := Map[K, V]{ - kc: keyCodec, - vc: valueCodec, - sa: schemaBuilder.schema.storeAccessor, - prefix: prefix.Bytes(), - name: name, + kc: keyCodec, + vc: valueCodec, + sa: schemaBuilder.schema.storeAccessor, + prefix: prefix.Bytes(), + name: name, + isSecondaryIndex: o.isSecondaryIndex, } schemaBuilder.addCollection(collectionImpl[K, V]{m}) return m @@ -61,12 +83,11 @@ func (m Map[K, V]) Set(ctx context.Context, key K, value V) error { valueBytes, err := m.vc.Encode(value) if err != nil { - return fmt.Errorf("%w: value encode: %s", ErrEncoding, err) // TODO: use multi err wrapping in go1.20: https://github.com/golang/go/issues/53435 + return fmt.Errorf("%w: value encode: %w", ErrEncoding, err) } kvStore := m.sa(ctx) - kvStore.Set(bytesKey, valueBytes) - return nil + return kvStore.Set(bytesKey, valueBytes) } // Get returns the value associated with the provided key, @@ -89,7 +110,7 @@ func (m Map[K, V]) Get(ctx context.Context, key K) (v V, err error) { v, err = m.vc.Decode(valueBytes) if err != nil { - return v, fmt.Errorf("%w: value decode: %s", ErrEncoding, err) // TODO: use multi err wrapping in go1.20: https://github.com/golang/go/issues/53435 + return v, fmt.Errorf("%w: value decode: %w", ErrEncoding, err) } return v, nil } @@ -150,6 +171,58 @@ func (m Map[K, V]) Walk(ctx context.Context, ranger Ranger[K], walkFunc func(key return nil } +// Clear clears the collection contained within the provided key range. +// A nil ranger equals to clearing the whole collection. +// NOTE: this API needs to be used with care, considering that as of today +// cosmos-sdk stores the deletion records to be committed in a memory cache, +// clearing a lot of data might make the node go OOM. +func (m Map[K, V]) Clear(ctx context.Context, ranger Ranger[K]) error { + startBytes, endBytes, _, err := parseRangeInstruction(m.prefix, m.kc, ranger) + if err != nil { + return err + } + return deleteDomain(m.sa(ctx), startBytes, endBytes) +} + +const clearBatchSize = 10000 + +// deleteDomain deletes the domain of an iterator, the key difference +// is that it uses batches to clear the store meaning that it will read +// the keys within the domain close the iterator and then delete them. +func deleteDomain(s store.KVStore, start, end []byte) error { + for { + iter, err := s.Iterator(start, end) + if err != nil { + return err + } + + keys := make([][]byte, 0, clearBatchSize) + for ; iter.Valid() && len(keys) < clearBatchSize; iter.Next() { + keys = append(keys, iter.Key()) + } + + // we close the iterator here instead of deferring + err = iter.Close() + if err != nil { + return err + } + + for _, key := range keys { + err = s.Delete(key) + if err != nil { + return err + } + } + + // If we've retrieved less than the batchSize, we're done. + if len(keys) < clearBatchSize { + break + } + } + + return nil +} + // IterateRaw iterates over the collection. The iteration range is untyped, it uses raw // bytes. The resulting Iterator is typed. // A nil start iterates from the first key contained in the collection. @@ -165,6 +238,10 @@ func (m Map[K, V]) IterateRaw(ctx context.Context, start, end []byte, order Orde prefixedEnd = append(m.prefix, end...) } + if bytes.Compare(prefixedStart, prefixedEnd) == 1 { + return Iterator[K, V]{}, ErrInvalidIterator + } + s := m.sa(ctx) var ( storeIter store.Iterator @@ -182,9 +259,6 @@ func (m Map[K, V]) IterateRaw(ctx context.Context, start, end []byte, order Orde return Iterator[K, V]{}, err } - if !storeIter.Valid() { - return Iterator[K, V]{}, ErrInvalidIterator - } return Iterator[K, V]{ kc: m.kc, vc: m.vc, @@ -210,7 +284,7 @@ func EncodeKeyWithPrefix[K any](prefix []byte, kc codec.KeyCodec[K], key K) ([]b // put key _, err := kc.Encode(keyBytes[prefixLen:], key) if err != nil { - return nil, fmt.Errorf("%w: key encode: %s", ErrEncoding, err) // TODO: use multi err wrapping in go1.20: https://github.com/golang/go/issues/53435 + return nil, fmt.Errorf("%w: key encode: %w", ErrEncoding, err) } return keyBytes, nil } diff --git a/collections/map_test.go b/collections/map_test.go index 2887693d53a2..5f1ae176df07 100644 --- a/collections/map_test.go +++ b/collections/map_test.go @@ -1,6 +1,8 @@ package collections import ( + "context" + "errors" "testing" "github.com/stretchr/testify/require" @@ -36,6 +38,42 @@ func TestMap(t *testing.T) { require.False(t, has) } +func TestMap_Clear(t *testing.T) { + makeTest := func() (context.Context, Map[uint64, uint64]) { + sk, ctx := deps() + m := NewMap(NewSchemaBuilder(sk), NewPrefix(0), "test", Uint64Key, Uint64Value) + for i := uint64(0); i < clearBatchSize*2; i++ { + require.NoError(t, m.Set(ctx, i, i)) + } + return ctx, m + } + + t.Run("nil ranger", func(t *testing.T) { + ctx, m := makeTest() + err := m.Clear(ctx, nil) + require.NoError(t, err) + err = m.Walk(ctx, nil, func(key, value uint64) (bool, error) { + return false, errors.New("should never be called") + }) + require.NoError(t, err) + }) + + t.Run("custom ranger", func(t *testing.T) { + ctx, m := makeTest() + // delete from 0 to 100 + err := m.Clear(ctx, new(Range[uint64]).StartInclusive(0).EndInclusive(100)) + require.NoError(t, err) + + iter, err := m.Iterate(ctx, nil) + require.NoError(t, err) + keys, err := iter.Keys() + require.NoError(t, err) + require.Len(t, keys, clearBatchSize*2-101) + require.Equal(t, keys[0], uint64(101)) + require.Equal(t, keys[len(keys)-1], uint64(clearBatchSize*2-1)) + }) +} + func TestMap_IterateRaw(t *testing.T) { sk, ctx := deps() // safety check to ensure prefix boundaries are not crossed @@ -69,6 +107,15 @@ func TestMap_IterateRaw(t *testing.T) { keys, err = iter.Keys() require.NoError(t, err) require.Equal(t, []uint64{2, 1, 0}, keys) + + // test invalid iter + _, err = m.IterateRaw(ctx, []byte{0x2, 0x0}, []byte{0x0, 0x0}, OrderAscending) + require.ErrorIs(t, err, ErrInvalidIterator) + + // test on empty collection iterating does not error + require.NoError(t, m.Clear(ctx, nil)) + _, err = m.IterateRaw(ctx, nil, nil, OrderAscending) + require.NoError(t, err) } func Test_encodeKey(t *testing.T) { diff --git a/collections/naming_test.go b/collections/naming_test.go new file mode 100644 index 000000000000..39b275d920a9 --- /dev/null +++ b/collections/naming_test.go @@ -0,0 +1,59 @@ +package collections + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "cosmossdk.io/collections/codec" +) + +func TestNaming(t *testing.T) { + expectKeyCodecName(t, "u16", Uint16Key.WithName("u16")) + expectKeyCodecName(t, "u32", Uint32Key.WithName("u32")) + expectKeyCodecName(t, "u64", Uint64Key.WithName("u64")) + expectKeyCodecName(t, "i32", Int32Key.WithName("i32")) + expectKeyCodecName(t, "i64", Int64Key.WithName("i64")) + expectKeyCodecName(t, "str", StringKey.WithName("str")) + expectKeyCodecName(t, "bytes", BytesKey.WithName("bytes")) + expectKeyCodecName(t, "bool", BoolKey.WithName("bool")) + + expectValueCodecName(t, "vu16", Uint16Value.WithName("vu16")) + expectValueCodecName(t, "vu32", Uint32Value.WithName("vu32")) + expectValueCodecName(t, "vu64", Uint64Value.WithName("vu64")) + expectValueCodecName(t, "vi32", Int32Value.WithName("vi32")) + expectValueCodecName(t, "vi64", Int64Value.WithName("vi64")) + expectValueCodecName(t, "vstr", StringValue.WithName("vstr")) + expectValueCodecName(t, "vbytes", BytesValue.WithName("vbytes")) + expectValueCodecName(t, "vbool", BoolValue.WithName("vbool")) + + expectKeyCodecNames(t, NamedPairKeyCodec[bool, string]("abc", BoolKey, "def", StringKey), "abc", "def") + expectKeyCodecNames(t, NamedTripleKeyCodec[bool, string, int32]("abc", BoolKey, "def", StringKey, "ghi", Int32Key), "abc", "def", "ghi") + expectKeyCodecNames(t, NamedQuadKeyCodec[bool, string, int32, uint64]("abc", BoolKey, "def", StringKey, "ghi", Int32Key, "jkl", Uint64Key), "abc", "def", "ghi", "jkl") +} + +func expectKeyCodecName[T any](t *testing.T, name string, cdc codec.KeyCodec[T]) { + t.Helper() + schema, err := codec.KeySchemaCodec(cdc) + require.NoError(t, err) + require.Equal(t, 1, len(schema.Fields)) + require.Equal(t, name, schema.Fields[0].Name) +} + +func expectValueCodecName[T any](t *testing.T, name string, cdc codec.ValueCodec[T]) { + t.Helper() + schema, err := codec.ValueSchemaCodec(cdc) + require.NoError(t, err) + require.Equal(t, 1, len(schema.Fields)) + require.Equal(t, name, schema.Fields[0].Name) +} + +func expectKeyCodecNames[T any](t *testing.T, cdc codec.KeyCodec[T], names ...string) { + t.Helper() + schema, err := codec.KeySchemaCodec(cdc) + require.NoError(t, err) + require.Equal(t, len(names), len(schema.Fields)) + for i, name := range names { + require.Equal(t, name, schema.Fields[i].Name) + } +} diff --git a/collections/pair.go b/collections/pair.go index f12aaac1b576..bf22a6711d70 100644 --- a/collections/pair.go +++ b/collections/pair.go @@ -6,6 +6,7 @@ import ( "strings" "cosmossdk.io/collections/codec" + "cosmossdk.io/schema" ) // Pair defines a key composed of two keys. @@ -54,9 +55,22 @@ func PairKeyCodec[K1, K2 any](keyCodec1 codec.KeyCodec[K1], keyCodec2 codec.KeyC } } +// NamedPairKeyCodec instantiates a new KeyCodec instance that can encode the Pair, given the KeyCodec of the +// first part of the key and the KeyCodec of the second part of the key. +// It also provides names for the keys which are used for indexing purposes. +func NamedPairKeyCodec[K1, K2 any](key1Name string, keyCodec1 codec.KeyCodec[K1], key2Name string, keyCodec2 codec.KeyCodec[K2]) codec.KeyCodec[Pair[K1, K2]] { + return pairKeyCodec[K1, K2]{ + key1Name: key1Name, + key2Name: key2Name, + keyCodec1: keyCodec1, + keyCodec2: keyCodec2, + } +} + type pairKeyCodec[K1, K2 any] struct { - keyCodec1 codec.KeyCodec[K1] - keyCodec2 codec.KeyCodec[K2] + key1Name, key2Name string + keyCodec1 codec.KeyCodec[K1] + keyCodec2 codec.KeyCodec[K2] } func (p pairKeyCodec[K1, K2]) KeyCodec1() codec.KeyCodec[K1] { return p.keyCodec1 } @@ -216,6 +230,94 @@ func (p pairKeyCodec[K1, K2]) DecodeJSON(b []byte) (Pair[K1, K2], error) { return Join(k1, k2), nil } +func (p pairKeyCodec[K1, K2]) Name() string { + return fmt.Sprintf("%s,%s", p.key1Name, p.key2Name) +} + +func (p pairKeyCodec[K1, K2]) SchemaCodec() (codec.SchemaCodec[Pair[K1, K2]], error) { + field1, err := getNamedKeyField(p.keyCodec1, p.key1Name) + if err != nil { + return codec.SchemaCodec[Pair[K1, K2]]{}, fmt.Errorf("error getting key1 field: %w", err) + } + + field2, err := getNamedKeyField(p.keyCodec2, p.key2Name) + if err != nil { + return codec.SchemaCodec[Pair[K1, K2]]{}, fmt.Errorf("error getting key2 field: %w", err) + } + + codec1, err := codec.KeySchemaCodec(p.keyCodec1) + if err != nil { + return codec.SchemaCodec[Pair[K1, K2]]{}, fmt.Errorf("error getting key1 schema codec: %w", err) + } + + codec2, err := codec.KeySchemaCodec(p.keyCodec2) + if err != nil { + return codec.SchemaCodec[Pair[K1, K2]]{}, fmt.Errorf("error getting key2 schema codec: %w", err) + } + + return codec.SchemaCodec[Pair[K1, K2]]{ + Fields: []schema.Field{field1, field2}, + ToSchemaType: func(pair Pair[K1, K2]) (any, error) { + k1, err := toKeySchemaType(codec1, pair.K1()) + if err != nil { + return nil, err + } + k2, err := toKeySchemaType(codec2, pair.K2()) + if err != nil { + return nil, err + } + return []interface{}{k1, k2}, nil + }, + FromSchemaType: func(a any) (Pair[K1, K2], error) { + aSlice, ok := a.([]interface{}) + if !ok || len(aSlice) != 2 { + return Pair[K1, K2]{}, fmt.Errorf("expected slice of length 2, got %T", a) + } + k1, err := fromKeySchemaType(codec1, aSlice[0]) + if err != nil { + return Pair[K1, K2]{}, err + } + k2, err := fromKeySchemaType(codec2, aSlice[1]) + if err != nil { + return Pair[K1, K2]{}, err + } + return Join(k1, k2), nil + }, + }, nil +} + +func getNamedKeyField[T any](keyCdc codec.KeyCodec[T], name string) (schema.Field, error) { + keySchema, err := codec.KeySchemaCodec(keyCdc) + if err != nil { + return schema.Field{}, err + } + if len(keySchema.Fields) != 1 { + return schema.Field{}, fmt.Errorf("key schema in composite key has more than one field, got %v", keySchema.Fields) + } + field := keySchema.Fields[0] + field.Name = name + return field, nil +} + +func toKeySchemaType[T any](cdc codec.SchemaCodec[T], key T) (any, error) { + if cdc.ToSchemaType != nil { + return cdc.ToSchemaType(key) + } + return key, nil +} + +func fromKeySchemaType[T any](cdc codec.SchemaCodec[T], key any) (T, error) { + if cdc.FromSchemaType != nil { + return cdc.FromSchemaType(key) + } + tKey, ok := key.(T) + if !ok { + var zero T + return zero, fmt.Errorf("expected type %T, got %T", zero, key) + } + return tKey, nil +} + // NewPrefixUntilPairRange defines a collection query which ranges until the provided Pair prefix. // Unstable: this API might change in the future. func NewPrefixUntilPairRange[K1, K2 any](prefix K1) *PairRange[K1, K2] { diff --git a/collections/protocodec/collections.go b/collections/protocodec/collections.go new file mode 100644 index 000000000000..f989cddbcd0f --- /dev/null +++ b/collections/protocodec/collections.go @@ -0,0 +1,137 @@ +package protocodec + +import ( + "fmt" + + "github.com/cosmos/gogoproto/proto" + gogotypes "github.com/cosmos/gogoproto/types" + "google.golang.org/protobuf/encoding/protojson" + protov2 "google.golang.org/protobuf/proto" + + "cosmossdk.io/collections" + collcodec "cosmossdk.io/collections/codec" + corecodec "cosmossdk.io/core/codec" +) + +// BoolValue implements a ValueCodec that saves the bool value +// as if it was a prototypes.BoolValue. Required for backwards +// compatibility of state. +var BoolValue collcodec.ValueCodec[bool] = boolValue{} + +type boolValue struct{} + +func (boolValue) Encode(value bool) ([]byte, error) { + return (&gogotypes.BoolValue{Value: value}).Marshal() +} + +func (boolValue) Decode(b []byte) (bool, error) { + v := new(gogotypes.BoolValue) + err := v.Unmarshal(b) + return v.Value, err +} + +func (boolValue) EncodeJSON(value bool) ([]byte, error) { + return collections.BoolValue.EncodeJSON(value) +} + +func (boolValue) DecodeJSON(b []byte) (bool, error) { + return collections.BoolValue.DecodeJSON(b) +} + +func (boolValue) Stringify(value bool) string { + return collections.BoolValue.Stringify(value) +} + +func (boolValue) ValueType() string { + return "protobuf/bool" +} + +type protoMessage[T any] interface { + *T + proto.Message +} + +// CollValue inits a collections.ValueCodec for a generic gogo protobuf message. +func CollValue[T any, PT protoMessage[T]](cdc interface { + Marshal(proto.Message) ([]byte, error) + Unmarshal([]byte, proto.Message) error +}, +) collcodec.ValueCodec[T] { + return &collValue[T, PT]{cdc.(corecodec.Codec), proto.MessageName(PT(new(T)))} +} + +type collValue[T any, PT protoMessage[T]] struct { + cdc corecodec.Codec + messageName string +} + +func (c collValue[T, PT]) Encode(value T) ([]byte, error) { + return c.cdc.Marshal(PT(&value)) +} + +func (c collValue[T, PT]) Decode(b []byte) (value T, err error) { + err = c.cdc.Unmarshal(b, PT(&value)) + return value, err +} + +func (c collValue[T, PT]) EncodeJSON(value T) ([]byte, error) { + return c.cdc.MarshalJSON(PT(&value)) +} + +func (c collValue[T, PT]) DecodeJSON(b []byte) (value T, err error) { + err = c.cdc.UnmarshalJSON(b, PT(&value)) + return +} + +func (c collValue[T, PT]) Stringify(value T) string { + return PT(&value).String() +} + +func (c collValue[T, PT]) ValueType() string { + return "github.com/cosmos/gogoproto/" + c.messageName +} + +type protoMessageV2[T any] interface { + *T + protov2.Message +} + +// CollValueV2 is used for protobuf values of the newest google.golang.org/protobuf API. +func CollValueV2[T any, PT protoMessageV2[T]]() collcodec.ValueCodec[PT] { + return &collValue2[T, PT]{ + messageName: string(PT(new(T)).ProtoReflect().Descriptor().FullName()), + } +} + +type collValue2[T any, PT protoMessageV2[T]] struct { + messageName string +} + +func (c collValue2[T, PT]) Encode(value PT) ([]byte, error) { + protov2MarshalOpts := protov2.MarshalOptions{Deterministic: true} + return protov2MarshalOpts.Marshal(value) +} + +func (c collValue2[T, PT]) Decode(b []byte) (PT, error) { + var value T + err := protov2.Unmarshal(b, PT(&value)) + return &value, err +} + +func (c collValue2[T, PT]) EncodeJSON(value PT) ([]byte, error) { + return protojson.Marshal(value) +} + +func (c collValue2[T, PT]) DecodeJSON(b []byte) (PT, error) { + var value T + err := protojson.Unmarshal(b, PT(&value)) + return &value, err +} + +func (c collValue2[T, PT]) Stringify(value PT) string { + return fmt.Sprintf("%v", value) +} + +func (c collValue2[T, PT]) ValueType() string { + return "google.golang.org/protobuf/" + c.messageName +} diff --git a/collections/protocodec/collections_test.go b/collections/protocodec/collections_test.go new file mode 100644 index 000000000000..cf2af632f788 --- /dev/null +++ b/collections/protocodec/collections_test.go @@ -0,0 +1,55 @@ +package protocodec_test + +import ( + "testing" + + gogotypes "github.com/cosmos/gogoproto/types" + "github.com/google/go-cmp/cmp" + "github.com/stretchr/testify/require" + "google.golang.org/protobuf/testing/protocmp" + "google.golang.org/protobuf/types/known/wrapperspb" + + "cosmossdk.io/collections/colltest" + codec "cosmossdk.io/collections/protocodec" +) + +func TestCollectionsCorrectness(t *testing.T) { + t.Run("CollValueV2", func(t *testing.T) { + // NOTE: we cannot use colltest.TestValueCodec because protov2 has different + // compare semantics than protov1. We need to use protocmp.Transform() alongside + // cmp to ensure equality. + encoder := codec.CollValueV2[wrapperspb.UInt64Value]() + value := &wrapperspb.UInt64Value{Value: 500} + encodedValue, err := encoder.Encode(value) + require.NoError(t, err) + decodedValue, err := encoder.Decode(encodedValue) + require.NoError(t, err) + require.True(t, cmp.Equal(value, decodedValue, protocmp.Transform()), "encoding and decoding produces different values") + + encodedJSONValue, err := encoder.EncodeJSON(value) + require.NoError(t, err) + decodedJSONValue, err := encoder.DecodeJSON(encodedJSONValue) + require.NoError(t, err) + require.True(t, cmp.Equal(value, decodedJSONValue, protocmp.Transform()), "encoding and decoding produces different values") + require.NotEmpty(t, encoder.ValueType()) + + _ = encoder.Stringify(value) + }) + + t.Run("BoolValue", func(t *testing.T) { + colltest.TestValueCodec(t, codec.BoolValue, true) + colltest.TestValueCodec(t, codec.BoolValue, false) + + // asserts produced bytes are equal + valueAssert := func(b bool) { + wantBytes, err := (&gogotypes.BoolValue{Value: b}).Marshal() + require.NoError(t, err) + gotBytes, err := codec.BoolValue.Encode(b) + require.NoError(t, err) + require.Equal(t, wantBytes, gotBytes) + } + + valueAssert(true) + valueAssert(false) + }) +} diff --git a/collections/quad.go b/collections/quad.go new file mode 100644 index 000000000000..48b98a526538 --- /dev/null +++ b/collections/quad.go @@ -0,0 +1,435 @@ +package collections + +import ( + "encoding/json" + "fmt" + "strings" + + "cosmossdk.io/collections/codec" + "cosmossdk.io/schema" +) + +// Quad defines a multipart key composed of four keys. +type Quad[K1, K2, K3, K4 any] struct { + k1 *K1 + k2 *K2 + k3 *K3 + k4 *K4 +} + +// Join4 instantiates a new Quad instance composed of the four provided keys, in order. +func Join4[K1, K2, K3, K4 any](k1 K1, k2 K2, k3 K3, k4 K4) Quad[K1, K2, K3, K4] { + return Quad[K1, K2, K3, K4]{&k1, &k2, &k3, &k4} +} + +// K1 returns the first part of the key. If nil, the zero value is returned. +func (t Quad[K1, K2, K3, K4]) K1() (x K1) { + if t.k1 != nil { + return *t.k1 + } + return x +} + +// K2 returns the second part of the key. If nil, the zero value is returned. +func (t Quad[K1, K2, K3, K4]) K2() (x K2) { + if t.k2 != nil { + return *t.k2 + } + return x +} + +// K3 returns the third part of the key. If nil, the zero value is returned. +func (t Quad[K1, K2, K3, K4]) K3() (x K3) { + if t.k3 != nil { + return *t.k3 + } + return x +} + +// K4 returns the fourth part of the key. If nil, the zero value is returned. +func (t Quad[K1, K2, K3, K4]) K4() (x K4) { + if t.k4 != nil { + return *t.k4 + } + return x +} + +// QuadPrefix creates a new Quad instance composed only of the first part of the key. +func QuadPrefix[K1, K2, K3, K4 any](k1 K1) Quad[K1, K2, K3, K4] { + return Quad[K1, K2, K3, K4]{k1: &k1} +} + +// QuadSuperPrefix creates a new Quad instance composed only of the first two parts of the key. +func QuadSuperPrefix[K1, K2, K3, K4 any](k1 K1, k2 K2) Quad[K1, K2, K3, K4] { + return Quad[K1, K2, K3, K4]{k1: &k1, k2: &k2} +} + +// QuadSuperPrefix3 creates a new Quad instance composed only of the first three parts of the key. +func QuadSuperPrefix3[K1, K2, K3, K4 any](k1 K1, k2 K2, k3 K3) Quad[K1, K2, K3, K4] { + return Quad[K1, K2, K3, K4]{k1: &k1, k2: &k2, k3: &k3} +} + +// QuadKeyCodec instantiates a new KeyCodec instance that can encode the Quad, given +// the KeyCodecs of the four parts of the key, in order. +func QuadKeyCodec[K1, K2, K3, K4 any](keyCodec1 codec.KeyCodec[K1], keyCodec2 codec.KeyCodec[K2], keyCodec3 codec.KeyCodec[K3], keyCodec4 codec.KeyCodec[K4]) codec.KeyCodec[Quad[K1, K2, K3, K4]] { + return quadKeyCodec[K1, K2, K3, K4]{ + keyCodec1: keyCodec1, + keyCodec2: keyCodec2, + keyCodec3: keyCodec3, + keyCodec4: keyCodec4, + } +} + +// NamedQuadKeyCodec instantiates a new KeyCodec instance that can encode the Quad, given +// the KeyCodecs of the four parts of the key, in order. +// The provided names are used to identify the parts of the key in the schema for indexing. +func NamedQuadKeyCodec[K1, K2, K3, K4 any](key1Name string, keyCodec1 codec.KeyCodec[K1], key2Name string, keyCodec2 codec.KeyCodec[K2], key3Name string, keyCodec3 codec.KeyCodec[K3], key4Name string, keyCodec4 codec.KeyCodec[K4]) codec.KeyCodec[Quad[K1, K2, K3, K4]] { + return quadKeyCodec[K1, K2, K3, K4]{ + name1: key1Name, + keyCodec1: keyCodec1, + name2: key2Name, + keyCodec2: keyCodec2, + name3: key3Name, + keyCodec3: keyCodec3, + name4: key4Name, + keyCodec4: keyCodec4, + } +} + +type quadKeyCodec[K1, K2, K3, K4 any] struct { + name1, name2, name3, name4 string + keyCodec1 codec.KeyCodec[K1] + keyCodec2 codec.KeyCodec[K2] + keyCodec3 codec.KeyCodec[K3] + keyCodec4 codec.KeyCodec[K4] +} + +type jsonQuadKey [4]json.RawMessage + +// EncodeJSON encodes Quads to json +func (t quadKeyCodec[K1, K2, K3, K4]) EncodeJSON(value Quad[K1, K2, K3, K4]) ([]byte, error) { + json1, err := t.keyCodec1.EncodeJSON(*value.k1) + if err != nil { + return nil, err + } + + json2, err := t.keyCodec2.EncodeJSON(*value.k2) + if err != nil { + return nil, err + } + + json3, err := t.keyCodec3.EncodeJSON(*value.k3) + if err != nil { + return nil, err + } + + json4, err := t.keyCodec4.EncodeJSON(*value.k4) + if err != nil { + return nil, err + } + + return json.Marshal(jsonQuadKey{json1, json2, json3, json4}) +} + +// DecodeJSON decodes json to Quads +func (t quadKeyCodec[K1, K2, K3, K4]) DecodeJSON(b []byte) (Quad[K1, K2, K3, K4], error) { + var jsonKey jsonQuadKey + err := json.Unmarshal(b, &jsonKey) + if err != nil { + return Quad[K1, K2, K3, K4]{}, err + } + + key1, err := t.keyCodec1.DecodeJSON(jsonKey[0]) + if err != nil { + return Quad[K1, K2, K3, K4]{}, err + } + + key2, err := t.keyCodec2.DecodeJSON(jsonKey[1]) + if err != nil { + return Quad[K1, K2, K3, K4]{}, err + } + + key3, err := t.keyCodec3.DecodeJSON(jsonKey[2]) + if err != nil { + return Quad[K1, K2, K3, K4]{}, err + } + + key4, err := t.keyCodec4.DecodeJSON(jsonKey[3]) + if err != nil { + return Quad[K1, K2, K3, K4]{}, err + } + + return Join4(key1, key2, key3, key4), nil +} + +// Stringify converts Quads to string +func (t quadKeyCodec[K1, K2, K3, K4]) Stringify(key Quad[K1, K2, K3, K4]) string { + b := new(strings.Builder) + b.WriteByte('(') + if key.k1 != nil { + b.WriteByte('"') + b.WriteString(t.keyCodec1.Stringify(*key.k1)) + b.WriteByte('"') + } else { + b.WriteString("") + } + + b.WriteString(", ") + if key.k2 != nil { + b.WriteByte('"') + b.WriteString(t.keyCodec2.Stringify(*key.k2)) + b.WriteByte('"') + } else { + b.WriteString("") + } + + b.WriteString(", ") + if key.k3 != nil { + b.WriteByte('"') + b.WriteString(t.keyCodec3.Stringify(*key.k3)) + b.WriteByte('"') + } else { + b.WriteString("") + } + + b.WriteString(", ") + if key.k4 != nil { + b.WriteByte('"') + b.WriteString(t.keyCodec4.Stringify(*key.k4)) + b.WriteByte('"') + } else { + b.WriteString("") + } + + b.WriteByte(')') + return b.String() +} + +func (t quadKeyCodec[K1, K2, K3, K4]) KeyType() string { + return fmt.Sprintf("Quad[%s,%s,%s,%s]", t.keyCodec1.KeyType(), t.keyCodec2.KeyType(), t.keyCodec3.KeyType(), t.keyCodec4.KeyType()) +} + +func (t quadKeyCodec[K1, K2, K3, K4]) Encode(buffer []byte, key Quad[K1, K2, K3, K4]) (int, error) { + writtenTotal := 0 + if key.k1 != nil { + written, err := t.keyCodec1.EncodeNonTerminal(buffer, *key.k1) + if err != nil { + return 0, err + } + writtenTotal += written + } + if key.k2 != nil { + written, err := t.keyCodec2.EncodeNonTerminal(buffer[writtenTotal:], *key.k2) + if err != nil { + return 0, err + } + writtenTotal += written + } + if key.k3 != nil { + written, err := t.keyCodec3.EncodeNonTerminal(buffer[writtenTotal:], *key.k3) + if err != nil { + return 0, err + } + writtenTotal += written + } + if key.k4 != nil { + written, err := t.keyCodec4.Encode(buffer[writtenTotal:], *key.k4) + if err != nil { + return 0, err + } + writtenTotal += written + } + return writtenTotal, nil +} + +func (t quadKeyCodec[K1, K2, K3, K4]) Decode(buffer []byte) (int, Quad[K1, K2, K3, K4], error) { + readTotal := 0 + read, key1, err := t.keyCodec1.DecodeNonTerminal(buffer) + if err != nil { + return 0, Quad[K1, K2, K3, K4]{}, err + } + readTotal += read + read, key2, err := t.keyCodec2.DecodeNonTerminal(buffer[readTotal:]) + if err != nil { + return 0, Quad[K1, K2, K3, K4]{}, err + } + readTotal += read + read, key3, err := t.keyCodec3.DecodeNonTerminal(buffer[readTotal:]) + if err != nil { + return 0, Quad[K1, K2, K3, K4]{}, err + } + readTotal += read + read, key4, err := t.keyCodec4.Decode(buffer[readTotal:]) + if err != nil { + return 0, Quad[K1, K2, K3, K4]{}, err + } + readTotal += read + return readTotal, Join4(key1, key2, key3, key4), nil +} + +func (t quadKeyCodec[K1, K2, K3, K4]) Size(key Quad[K1, K2, K3, K4]) int { + size := 0 + if key.k1 != nil { + size += t.keyCodec1.SizeNonTerminal(*key.k1) + } + if key.k2 != nil { + size += t.keyCodec2.SizeNonTerminal(*key.k2) + } + if key.k3 != nil { + size += t.keyCodec3.SizeNonTerminal(*key.k3) + } + if key.k4 != nil { + size += t.keyCodec4.Size(*key.k4) + } + return size +} + +func (t quadKeyCodec[K1, K2, K3, K4]) EncodeNonTerminal(buffer []byte, key Quad[K1, K2, K3, K4]) (int, error) { + writtenTotal := 0 + if key.k1 != nil { + written, err := t.keyCodec1.EncodeNonTerminal(buffer, *key.k1) + if err != nil { + return 0, err + } + writtenTotal += written + } + if key.k2 != nil { + written, err := t.keyCodec2.EncodeNonTerminal(buffer[writtenTotal:], *key.k2) + if err != nil { + return 0, err + } + writtenTotal += written + } + if key.k3 != nil { + written, err := t.keyCodec3.EncodeNonTerminal(buffer[writtenTotal:], *key.k3) + if err != nil { + return 0, err + } + writtenTotal += written + } + if key.k4 != nil { + written, err := t.keyCodec4.EncodeNonTerminal(buffer[writtenTotal:], *key.k4) + if err != nil { + return 0, err + } + writtenTotal += written + } + return writtenTotal, nil +} + +func (t quadKeyCodec[K1, K2, K3, K4]) DecodeNonTerminal(buffer []byte) (int, Quad[K1, K2, K3, K4], error) { + readTotal := 0 + read, key1, err := t.keyCodec1.DecodeNonTerminal(buffer) + if err != nil { + return 0, Quad[K1, K2, K3, K4]{}, err + } + readTotal += read + read, key2, err := t.keyCodec2.DecodeNonTerminal(buffer[readTotal:]) + if err != nil { + return 0, Quad[K1, K2, K3, K4]{}, err + } + readTotal += read + read, key3, err := t.keyCodec3.DecodeNonTerminal(buffer[readTotal:]) + if err != nil { + return 0, Quad[K1, K2, K3, K4]{}, err + } + readTotal += read + read, key4, err := t.keyCodec4.DecodeNonTerminal(buffer[readTotal:]) + if err != nil { + return 0, Quad[K1, K2, K3, K4]{}, err + } + readTotal += read + return readTotal, Join4(key1, key2, key3, key4), nil +} + +func (t quadKeyCodec[K1, K2, K3, K4]) SizeNonTerminal(key Quad[K1, K2, K3, K4]) int { + size := 0 + if key.k1 != nil { + size += t.keyCodec1.SizeNonTerminal(*key.k1) + } + if key.k2 != nil { + size += t.keyCodec2.SizeNonTerminal(*key.k2) + } + if key.k3 != nil { + size += t.keyCodec3.SizeNonTerminal(*key.k3) + } + if key.k4 != nil { + size += t.keyCodec4.SizeNonTerminal(*key.k4) + } + return size +} + +func (t quadKeyCodec[K1, K2, K3, K4]) SchemaCodec() (codec.SchemaCodec[Quad[K1, K2, K3, K4]], error) { + field1, err := getNamedKeyField(t.keyCodec1, t.name1) + if err != nil { + return codec.SchemaCodec[Quad[K1, K2, K3, K4]]{}, fmt.Errorf("error getting key1 field: %w", err) + } + + field2, err := getNamedKeyField(t.keyCodec2, t.name2) + if err != nil { + return codec.SchemaCodec[Quad[K1, K2, K3, K4]]{}, fmt.Errorf("error getting key2 field: %w", err) + } + + field3, err := getNamedKeyField(t.keyCodec3, t.name3) + if err != nil { + return codec.SchemaCodec[Quad[K1, K2, K3, K4]]{}, fmt.Errorf("error getting key3 field: %w", err) + } + + field4, err := getNamedKeyField(t.keyCodec4, t.name4) + if err != nil { + return codec.SchemaCodec[Quad[K1, K2, K3, K4]]{}, fmt.Errorf("error getting key4 field: %w", err) + } + + return codec.SchemaCodec[Quad[K1, K2, K3, K4]]{ + Fields: []schema.Field{field1, field2, field3, field4}, + ToSchemaType: func(q Quad[K1, K2, K3, K4]) (any, error) { + return []interface{}{q.K1(), q.K2(), q.K3(), q.K4()}, nil + }, + FromSchemaType: func(a any) (Quad[K1, K2, K3, K4], error) { + aSlice, ok := a.([]interface{}) + if !ok || len(aSlice) != 4 { + return Quad[K1, K2, K3, K4]{}, fmt.Errorf("expected slice of length 4, got %T", a) + } + return Join4(aSlice[0].(K1), aSlice[1].(K2), aSlice[2].(K3), aSlice[3].(K4)), nil + }, + }, nil +} + +// NewPrefixUntilQuadRange defines a collection query which ranges until the provided Quad prefix. +// Unstable: this API might change in the future. +func NewPrefixUntilQuadRange[K1, K2, K3, K4 any](k1 K1) Ranger[Quad[K1, K2, K3, K4]] { + key := QuadPrefix[K1, K2, K3, K4](k1) + return &Range[Quad[K1, K2, K3, K4]]{ + end: RangeKeyPrefixEnd(key), + } +} + +// NewPrefixedQuadRange provides a Range for all keys prefixed with the given +// first part of the Quad key. +func NewPrefixedQuadRange[K1, K2, K3, K4 any](k1 K1) Ranger[Quad[K1, K2, K3, K4]] { + key := QuadPrefix[K1, K2, K3, K4](k1) + return &Range[Quad[K1, K2, K3, K4]]{ + start: RangeKeyExact(key), + end: RangeKeyPrefixEnd(key), + } +} + +// NewSuperPrefixedQuadRange provides a Range for all keys prefixed with the given +// first and second parts of the Quad key. +func NewSuperPrefixedQuadRange[K1, K2, K3, K4 any](k1 K1, k2 K2) Ranger[Quad[K1, K2, K3, K4]] { + key := QuadSuperPrefix[K1, K2, K3, K4](k1, k2) + return &Range[Quad[K1, K2, K3, K4]]{ + start: RangeKeyExact(key), + end: RangeKeyPrefixEnd(key), + } +} + +// NewSuperPrefixedQuadRange3 provides a Range for all keys prefixed with the given +// first, second and third parts of the Quad key. +func NewSuperPrefixedQuadRange3[K1, K2, K3, K4 any](k1 K1, k2 K2, k3 K3) Ranger[Quad[K1, K2, K3, K4]] { + key := QuadSuperPrefix3[K1, K2, K3, K4](k1, k2, k3) + return &Range[Quad[K1, K2, K3, K4]]{ + start: RangeKeyExact(key), + end: RangeKeyPrefixEnd(key), + } +} diff --git a/collections/quad_test.go b/collections/quad_test.go new file mode 100644 index 000000000000..0a4b3cc779d9 --- /dev/null +++ b/collections/quad_test.go @@ -0,0 +1,61 @@ +package collections_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "cosmossdk.io/collections" + "cosmossdk.io/collections/colltest" + coretesting "cosmossdk.io/core/testing" +) + +func TestQuad(t *testing.T) { + kc := collections.QuadKeyCodec(collections.Uint64Key, collections.StringKey, collections.BytesKey, collections.BoolKey) + + t.Run("conformance", func(t *testing.T) { + colltest.TestKeyCodec(t, kc, collections.Join4(uint64(1), "2", []byte("3"), true)) + }) +} + +func TestQuadRange(t *testing.T) { + ctx := coretesting.Context() + sk := coretesting.KVStoreService(ctx, "test") + schema := collections.NewSchemaBuilder(sk) + // this is a key composed of 4 parts: uint64, string, []byte, bool + kc := collections.QuadKeyCodec(collections.Uint64Key, collections.StringKey, collections.BytesKey, collections.BoolKey) + + keySet := collections.NewKeySet(schema, collections.NewPrefix(0), "Quad", kc) + + keys := []collections.Quad[uint64, string, []byte, bool]{ + collections.Join4(uint64(1), "A", []byte("1"), true), + collections.Join4(uint64(1), "A", []byte("2"), true), + collections.Join4(uint64(1), "B", []byte("3"), false), + collections.Join4(uint64(2), "B", []byte("4"), false), + } + + for _, k := range keys { + require.NoError(t, keySet.Set(ctx, k)) + } + + // we prefix over (1) we expect 3 results + iter, err := keySet.Iterate(ctx, collections.NewPrefixedQuadRange[uint64, string, []byte, bool](uint64(1))) + require.NoError(t, err) + gotKeys, err := iter.Keys() + require.NoError(t, err) + require.Equal(t, keys[:3], gotKeys) + + // we super prefix over Join(1, "A") we expect 2 results + iter, err = keySet.Iterate(ctx, collections.NewSuperPrefixedQuadRange[uint64, string, []byte, bool](1, "A")) + require.NoError(t, err) + gotKeys, err = iter.Keys() + require.NoError(t, err) + require.Equal(t, keys[:2], gotKeys) + + // we super prefix 3 over Join(1, "A", []byte("1")) we expect 1 result + iter, err = keySet.Iterate(ctx, collections.NewSuperPrefixedQuadRange3[uint64, string, []byte, bool](1, "A", []byte("1"))) + require.NoError(t, err) + gotKeys, err = iter.Keys() + require.NoError(t, err) + require.Equal(t, keys[:1], gotKeys) +} diff --git a/collections/schema.go b/collections/schema.go index 806f350e6b7b..8cc851166f61 100644 --- a/collections/schema.go +++ b/collections/schema.go @@ -8,7 +8,6 @@ import ( "strings" "cosmossdk.io/core/appmodule" - "cosmossdk.io/core/store" ) @@ -162,6 +161,12 @@ func NewSchemaFromAccessor(accessor func(context.Context) store.KVStore) Schema } } +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (s Schema) IsOnePerModuleType() {} + +// IsAppModule implements the appmodule.AppModule interface. +func (s Schema) IsAppModule() {} + // DefaultGenesis implements the appmodule.HasGenesis.DefaultGenesis method. func (s Schema) DefaultGenesis(target appmodule.GenesisTarget) error { for _, name := range s.collectionsOrdered { diff --git a/collections/sequence.go b/collections/sequence.go index 2290d27a5d7e..5503baf3323e 100644 --- a/collections/sequence.go +++ b/collections/sequence.go @@ -32,7 +32,7 @@ func (s Sequence) Peek(ctx context.Context) (uint64, error) { } } -// Next returns the next sequence number, and sets the next expected sequence. +// Next returns the current sequence number, and sets the next expected sequence. // Errors on encoding issues. func (s Sequence) Next(ctx context.Context) (uint64, error) { seq, err := s.Peek(ctx) diff --git a/collections/sonar-project.properties b/collections/sonar-project.properties index b22f312ca999..63d047f3ad6c 100644 --- a/collections/sonar-project.properties +++ b/collections/sonar-project.properties @@ -5,10 +5,11 @@ sonar.projectName=Cosmos SDK - Collections sonar.project.monorepo.enabled=true sonar.sources=. -sonar.exclusions=**/*_test.go +sonar.exclusions=**/*_test.go,**/*.pb.go,**/*.pulsar.go,**/*.pb.gateway.go sonar.tests=. sonar.test.inclusions=**/*_test.go sonar.go.coverage.reportPaths=coverage.out sonar.sourceEncoding=UTF-8 -sonar.scm.provider=git \ No newline at end of file +sonar.scm.provider=git +sonar.scm.forceReloadAll=true diff --git a/collections/triple.go b/collections/triple.go new file mode 100644 index 000000000000..7474e01ccd59 --- /dev/null +++ b/collections/triple.go @@ -0,0 +1,387 @@ +package collections + +import ( + "encoding/json" + "fmt" + "strings" + + "cosmossdk.io/collections/codec" + "cosmossdk.io/schema" +) + +// Triple defines a multipart key composed of three keys. +type Triple[K1, K2, K3 any] struct { + k1 *K1 + k2 *K2 + k3 *K3 +} + +// Join3 instantiates a new Triple instance composed of the three provided keys, in order. +func Join3[K1, K2, K3 any](k1 K1, k2 K2, k3 K3) Triple[K1, K2, K3] { + return Triple[K1, K2, K3]{&k1, &k2, &k3} +} + +// K1 returns the first part of the key. If nil, the zero value is returned. +func (t Triple[K1, K2, K3]) K1() (x K1) { + if t.k1 != nil { + return *t.k1 + } + return x +} + +// K2 returns the second part of the key. If nil, the zero value is returned. +func (t Triple[K1, K2, K3]) K2() (x K2) { + if t.k2 != nil { + return *t.k2 + } + return x +} + +// K3 returns the third part of the key. If nil, the zero value is returned. +func (t Triple[K1, K2, K3]) K3() (x K3) { + if t.k3 != nil { + return *t.k3 + } + return x +} + +// TriplePrefix creates a new Triple instance composed only of the first part of the key. +func TriplePrefix[K1, K2, K3 any](k1 K1) Triple[K1, K2, K3] { + return Triple[K1, K2, K3]{k1: &k1} +} + +// TripleSuperPrefix creates a new Triple instance composed only of the first two parts of the key. +func TripleSuperPrefix[K1, K2, K3 any](k1 K1, k2 K2) Triple[K1, K2, K3] { + return Triple[K1, K2, K3]{k1: &k1, k2: &k2} +} + +// TripleKeyCodec instantiates a new KeyCodec instance that can encode the Triple, given +// the KeyCodecs of the three parts of the key, in order. +func TripleKeyCodec[K1, K2, K3 any](keyCodec1 codec.KeyCodec[K1], keyCodec2 codec.KeyCodec[K2], keyCodec3 codec.KeyCodec[K3]) codec.KeyCodec[Triple[K1, K2, K3]] { + return tripleKeyCodec[K1, K2, K3]{ + keyCodec1: keyCodec1, + keyCodec2: keyCodec2, + keyCodec3: keyCodec3, + } +} + +func NamedTripleKeyCodec[K1, K2, K3 any](key1Name string, keyCodec1 codec.KeyCodec[K1], key2Name string, keyCodec2 codec.KeyCodec[K2], key3Name string, keyCodec3 codec.KeyCodec[K3]) codec.KeyCodec[Triple[K1, K2, K3]] { + return tripleKeyCodec[K1, K2, K3]{ + key1Name: key1Name, + key2Name: key2Name, + key3Name: key3Name, + keyCodec1: keyCodec1, + keyCodec2: keyCodec2, + keyCodec3: keyCodec3, + } +} + +type tripleKeyCodec[K1, K2, K3 any] struct { + key1Name, key2Name, key3Name string + keyCodec1 codec.KeyCodec[K1] + keyCodec2 codec.KeyCodec[K2] + keyCodec3 codec.KeyCodec[K3] +} + +type jsonTripleKey [3]json.RawMessage + +// EncodeJSON convert triple keys to json +func (t tripleKeyCodec[K1, K2, K3]) EncodeJSON(value Triple[K1, K2, K3]) ([]byte, error) { + json1, err := t.keyCodec1.EncodeJSON(*value.k1) + if err != nil { + return nil, err + } + + json2, err := t.keyCodec2.EncodeJSON(*value.k2) + if err != nil { + return nil, err + } + + json3, err := t.keyCodec3.EncodeJSON(*value.k3) + if err != nil { + return nil, err + } + + return json.Marshal(jsonTripleKey{json1, json2, json3}) +} + +// DecodeJSON convert json to triple keys +func (t tripleKeyCodec[K1, K2, K3]) DecodeJSON(b []byte) (Triple[K1, K2, K3], error) { + var jsonKey jsonTripleKey + err := json.Unmarshal(b, &jsonKey) + if err != nil { + return Triple[K1, K2, K3]{}, err + } + + key1, err := t.keyCodec1.DecodeJSON(jsonKey[0]) + if err != nil { + return Triple[K1, K2, K3]{}, err + } + + key2, err := t.keyCodec2.DecodeJSON(jsonKey[1]) + if err != nil { + return Triple[K1, K2, K3]{}, err + } + + key3, err := t.keyCodec3.DecodeJSON(jsonKey[2]) + if err != nil { + return Triple[K1, K2, K3]{}, err + } + + return Join3(key1, key2, key3), nil +} + +// Stringify convert triple keys to string +func (t tripleKeyCodec[K1, K2, K3]) Stringify(key Triple[K1, K2, K3]) string { + b := new(strings.Builder) + b.WriteByte('(') + if key.k1 != nil { + b.WriteByte('"') + b.WriteString(t.keyCodec1.Stringify(*key.k1)) + b.WriteByte('"') + } else { + b.WriteString("") + } + + b.WriteString(", ") + if key.k2 != nil { + b.WriteByte('"') + b.WriteString(t.keyCodec2.Stringify(*key.k2)) + b.WriteByte('"') + } else { + b.WriteString("") + } + + b.WriteString(", ") + if key.k3 != nil { + b.WriteByte('"') + b.WriteString(t.keyCodec3.Stringify(*key.k3)) + b.WriteByte('"') + } else { + b.WriteString("") + } + + b.WriteByte(')') + return b.String() +} + +func (t tripleKeyCodec[K1, K2, K3]) KeyType() string { + return fmt.Sprintf("Triple[%s,%s,%s]", t.keyCodec1.KeyType(), t.keyCodec2.KeyType(), t.keyCodec3.KeyType()) +} + +func (t tripleKeyCodec[K1, K2, K3]) Encode(buffer []byte, key Triple[K1, K2, K3]) (int, error) { + writtenTotal := 0 + if key.k1 != nil { + written, err := t.keyCodec1.EncodeNonTerminal(buffer, *key.k1) + if err != nil { + return 0, err + } + writtenTotal += written + } + if key.k2 != nil { + written, err := t.keyCodec2.EncodeNonTerminal(buffer[writtenTotal:], *key.k2) + if err != nil { + return 0, err + } + writtenTotal += written + } + if key.k3 != nil { + written, err := t.keyCodec3.Encode(buffer[writtenTotal:], *key.k3) + if err != nil { + return 0, err + } + writtenTotal += written + } + return writtenTotal, nil +} + +func (t tripleKeyCodec[K1, K2, K3]) Decode(buffer []byte) (int, Triple[K1, K2, K3], error) { + readTotal := 0 + read, key1, err := t.keyCodec1.DecodeNonTerminal(buffer) + if err != nil { + return 0, Triple[K1, K2, K3]{}, err + } + readTotal += read + read, key2, err := t.keyCodec2.DecodeNonTerminal(buffer[readTotal:]) + if err != nil { + return 0, Triple[K1, K2, K3]{}, err + } + readTotal += read + read, key3, err := t.keyCodec3.Decode(buffer[readTotal:]) + if err != nil { + return 0, Triple[K1, K2, K3]{}, err + } + readTotal += read + return readTotal, Join3(key1, key2, key3), nil +} + +func (t tripleKeyCodec[K1, K2, K3]) Size(key Triple[K1, K2, K3]) int { + size := 0 + if key.k1 != nil { + size += t.keyCodec1.SizeNonTerminal(*key.k1) + } + if key.k2 != nil { + size += t.keyCodec2.SizeNonTerminal(*key.k2) + } + if key.k3 != nil { + size += t.keyCodec3.Size(*key.k3) + } + return size +} + +func (t tripleKeyCodec[K1, K2, K3]) EncodeNonTerminal(buffer []byte, key Triple[K1, K2, K3]) (int, error) { + writtenTotal := 0 + if key.k1 != nil { + written, err := t.keyCodec1.EncodeNonTerminal(buffer, *key.k1) + if err != nil { + return 0, err + } + writtenTotal += written + } + if key.k2 != nil { + written, err := t.keyCodec2.EncodeNonTerminal(buffer[writtenTotal:], *key.k2) + if err != nil { + return 0, err + } + writtenTotal += written + } + if key.k3 != nil { + written, err := t.keyCodec3.EncodeNonTerminal(buffer[writtenTotal:], *key.k3) + if err != nil { + return 0, err + } + writtenTotal += written + } + return writtenTotal, nil +} + +func (t tripleKeyCodec[K1, K2, K3]) DecodeNonTerminal(buffer []byte) (int, Triple[K1, K2, K3], error) { + readTotal := 0 + read, key1, err := t.keyCodec1.DecodeNonTerminal(buffer) + if err != nil { + return 0, Triple[K1, K2, K3]{}, err + } + readTotal += read + read, key2, err := t.keyCodec2.DecodeNonTerminal(buffer[readTotal:]) + if err != nil { + return 0, Triple[K1, K2, K3]{}, err + } + readTotal += read + read, key3, err := t.keyCodec3.DecodeNonTerminal(buffer[readTotal:]) + if err != nil { + return 0, Triple[K1, K2, K3]{}, err + } + readTotal += read + return readTotal, Join3(key1, key2, key3), nil +} + +func (t tripleKeyCodec[K1, K2, K3]) SizeNonTerminal(key Triple[K1, K2, K3]) int { + size := 0 + if key.k1 != nil { + size += t.keyCodec1.SizeNonTerminal(*key.k1) + } + if key.k2 != nil { + size += t.keyCodec2.SizeNonTerminal(*key.k2) + } + if key.k3 != nil { + size += t.keyCodec3.SizeNonTerminal(*key.k3) + } + return size +} + +func (t tripleKeyCodec[K1, K2, K3]) Name() string { + return fmt.Sprintf("%s,%s,%s", t.key1Name, t.key2Name, t.key3Name) +} + +func (t tripleKeyCodec[K1, K2, K3]) SchemaCodec() (codec.SchemaCodec[Triple[K1, K2, K3]], error) { + field1, err := getNamedKeyField(t.keyCodec1, t.key1Name) + if err != nil { + return codec.SchemaCodec[Triple[K1, K2, K3]]{}, fmt.Errorf("error getting key1 field: %w", err) + } + + field2, err := getNamedKeyField(t.keyCodec2, t.key2Name) + if err != nil { + return codec.SchemaCodec[Triple[K1, K2, K3]]{}, fmt.Errorf("error getting key2 field: %w", err) + } + + field3, err := getNamedKeyField(t.keyCodec3, t.key3Name) + if err != nil { + return codec.SchemaCodec[Triple[K1, K2, K3]]{}, fmt.Errorf("error getting key3 field: %w", err) + } + + return codec.SchemaCodec[Triple[K1, K2, K3]]{ + Fields: []schema.Field{field1, field2, field3}, + ToSchemaType: func(t Triple[K1, K2, K3]) (any, error) { + return []interface{}{t.K1(), t.K2(), t.K3()}, nil + }, + FromSchemaType: func(a any) (Triple[K1, K2, K3], error) { + aSlice, ok := a.([]interface{}) + if !ok || len(aSlice) != 3 { + return Triple[K1, K2, K3]{}, fmt.Errorf("expected slice of length 3, got %T", a) + } + return Join3(aSlice[0].(K1), aSlice[1].(K2), aSlice[2].(K3)), nil + }, + }, nil +} + +// NewPrefixUntilTripleRange defines a collection query which ranges until the provided Pair prefix. +// Unstable: this API might change in the future. +func NewPrefixUntilTripleRange[K1, K2, K3 any](k1 K1) Ranger[Triple[K1, K2, K3]] { + key := TriplePrefix[K1, K2, K3](k1) + return &Range[Triple[K1, K2, K3]]{ + end: RangeKeyPrefixEnd(key), + } +} + +// NewPrefixedTripleRange provides a Range for all keys prefixed with the given +// first part of the Triple key. +func NewPrefixedTripleRange[K1, K2, K3 any](k1 K1) Ranger[Triple[K1, K2, K3]] { + key := TriplePrefix[K1, K2, K3](k1) + return &Range[Triple[K1, K2, K3]]{ + start: RangeKeyExact(key), + end: RangeKeyPrefixEnd(key), + } +} + +// NewSuperPrefixedTripleRange provides a Range for all keys prefixed with the given +// first and second parts of the Triple key. +func NewSuperPrefixedTripleRange[K1, K2, K3 any](k1 K1, k2 K2) Ranger[Triple[K1, K2, K3]] { + key := TripleSuperPrefix[K1, K2, K3](k1, k2) + return &Range[Triple[K1, K2, K3]]{ + start: RangeKeyExact(key), + end: RangeKeyPrefixEnd(key), + } +} + +// NewPrefixUntilTripleRangeReversed defines a collection query which ranges until the provided Pair prefix +// in reverse order. +// Unstable: this API might change in the future. +func NewPrefixUntilTripleRangeReversed[K1, K2, K3 any](k1 K1) Ranger[Triple[K1, K2, K3]] { + key := TriplePrefix[K1, K2, K3](k1) + return &Range[Triple[K1, K2, K3]]{ + end: RangeKeyPrefixEnd(key), + order: OrderDescending, + } +} + +// NewPrefixedTripleRangeReversed provides a Range for all keys prefixed with the given +// first part of the Triple key in reverse order. +func NewPrefixedTripleRangeReversed[K1, K2, K3 any](k1 K1) Ranger[Triple[K1, K2, K3]] { + key := TriplePrefix[K1, K2, K3](k1) + return &Range[Triple[K1, K2, K3]]{ + start: RangeKeyExact(key), + end: RangeKeyPrefixEnd(key), + order: OrderDescending, + } +} + +// NewSuperPrefixedTripleRangeReversed provides a Range for all keys prefixed with the given +// first and second parts of the Triple key in reverse order. +func NewSuperPrefixedTripleRangeReversed[K1, K2, K3 any](k1 K1, k2 K2) Ranger[Triple[K1, K2, K3]] { + key := TripleSuperPrefix[K1, K2, K3](k1, k2) + return &Range[Triple[K1, K2, K3]]{ + start: RangeKeyExact(key), + end: RangeKeyPrefixEnd(key), + order: OrderDescending, + } +} diff --git a/collections/triple_test.go b/collections/triple_test.go new file mode 100644 index 000000000000..c605a7aeaba7 --- /dev/null +++ b/collections/triple_test.go @@ -0,0 +1,74 @@ +package collections_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "cosmossdk.io/collections" + "cosmossdk.io/collections/colltest" + coretesting "cosmossdk.io/core/testing" +) + +func TestTriple(t *testing.T) { + kc := collections.TripleKeyCodec(collections.Uint64Key, collections.StringKey, collections.BytesKey) + + t.Run("conformance", func(t *testing.T) { + colltest.TestKeyCodec(t, kc, collections.Join3(uint64(1), "2", []byte("3"))) + }) +} + +func TestTripleRange(t *testing.T) { + ctx := coretesting.Context() + sk := coretesting.KVStoreService(ctx, "test") + schema := collections.NewSchemaBuilder(sk) + // this is a key composed of 3 parts: uint64, string, []byte + kc := collections.TripleKeyCodec(collections.Uint64Key, collections.StringKey, collections.BytesKey) + + keySet := collections.NewKeySet(schema, collections.NewPrefix(0), "triple", kc) + + keys := []collections.Triple[uint64, string, []byte]{ + collections.Join3(uint64(1), "A", []byte("1")), + collections.Join3(uint64(1), "A", []byte("2")), + collections.Join3(uint64(1), "B", []byte("3")), + collections.Join3(uint64(2), "B", []byte("4")), + } + + for _, k := range keys { + require.NoError(t, keySet.Set(ctx, k)) + } + + // we prefix over (1) we expect 3 results + iter, err := keySet.Iterate(ctx, collections.NewPrefixedTripleRange[uint64, string, []byte](uint64(1))) + require.NoError(t, err) + gotKeys, err := iter.Keys() + require.NoError(t, err) + require.Equal(t, keys[:3], gotKeys) + + // we prefix over (1) with "reverse" enabled, we expect 3 results in reverse order + iter, err = keySet.Iterate(ctx, collections.NewPrefixedTripleRangeReversed[uint64, string, []byte](uint64(1))) + require.NoError(t, err) + gotKeys, err = iter.Keys() + require.NoError(t, err) + require.Len(t, gotKeys, 3) + for i := range gotKeys { + require.Equal(t, gotKeys[i], keys[len(gotKeys)-i-1]) + } + + // we super prefix over Join(1, "A") we expect 2 results + iter, err = keySet.Iterate(ctx, collections.NewSuperPrefixedTripleRange[uint64, string, []byte](1, "A")) + require.NoError(t, err) + gotKeys, err = iter.Keys() + require.NoError(t, err) + require.Equal(t, keys[:2], gotKeys) + + // we prefix over Join(1, "A") with "reverse" enabled, we expect 2 results in reverse order + iter, err = keySet.Iterate(ctx, collections.NewSuperPrefixedTripleRangeReversed[uint64, string, []byte](1, "A")) + require.NoError(t, err) + gotKeys, err = iter.Keys() + require.NoError(t, err) + require.Len(t, gotKeys, 2) + for i := range gotKeys { + require.Equal(t, gotKeys[i], keys[len(gotKeys)-i-1]) + } +} diff --git a/collections/vec.go b/collections/vec.go new file mode 100644 index 000000000000..58ea87fe62ac --- /dev/null +++ b/collections/vec.go @@ -0,0 +1,141 @@ +package collections + +import ( + "context" + "errors" + "fmt" + + "cosmossdk.io/collections/codec" +) + +var ( + // ErrEmptyVec is returned when trying to pop an element from an empty Vec. + ErrEmptyVec = errors.New("vec is empty") + // ErrOutOfBounds is returned when trying to do an operation on an index that is out of bounds. + ErrOutOfBounds = errors.New("vec index is out of bounds") +) + +const ( + VecElementsNameSuffix = "_elements" + VecLengthNameSuffix = "_length" + VecElementsPrefixSuffix = 0x0 + VecLengthPrefixSuffix = 0x1 +) + +// NewVec creates a new Vec instance. Since Vec relies on two collections, one for the length +// and the other for the elements, it will register two state objects on the schema builder. +// The first is the length which is an item, whose prefix is the provided prefix with a suffix +// which equals to VecLengthPrefixSuffix, the name is also suffixed with VecLengthNameSuffix. +// The second is the elements which is a map, whose prefix is the provided prefix with a suffix +// which equals to VecElementsPrefixSuffix, the name is also suffixed with VecElementsNameSuffix. +func NewVec[T any](sb *SchemaBuilder, prefix Prefix, name string, vc codec.ValueCodec[T]) Vec[T] { + return Vec[T]{ + length: NewItem(sb, append(prefix, VecLengthPrefixSuffix), name+VecLengthNameSuffix, Uint64Value), + elements: NewMap(sb, append(prefix, VecElementsPrefixSuffix), name+VecElementsNameSuffix, Uint64Key, vc), + } +} + +// Vec works like a slice sitting on top of a KVStore. +// It relies on two collections, one for the length which is an Item[uint64], +// the other for the elements which is a Map[uint64, T]. +type Vec[T any] struct { + length Item[uint64] + elements Map[uint64, T] +} + +// Push adds an element to the end of the Vec. +func (v Vec[T]) Push(ctx context.Context, elem T) error { + length, err := v.length.Get(ctx) + if err != nil && !errors.Is(err, ErrNotFound) { + return err + } + err = v.elements.Set(ctx, length, elem) + if err != nil { + return err + } + err = v.length.Set(ctx, length+1) + if err != nil { + return err + } + return nil +} + +// Pop removes an element from the end of the Vec and returns it. Fails +// if the Vec is empty. +func (v Vec[T]) Pop(ctx context.Context) (elem T, err error) { + length, err := v.length.Get(ctx) + if err != nil && !errors.Is(err, ErrNotFound) { + return elem, err + } + if length == 0 { + return elem, ErrEmptyVec + } + length -= 1 + elem, err = v.elements.Get(ctx, length) + if err != nil { + return elem, err + } + err = v.elements.Remove(ctx, length) + if err != nil { + return elem, err + } + err = v.length.Set(ctx, length) + if err != nil { + return elem, err + } + return elem, nil +} + +// Replace replaces an element at a given index. Fails if the index is out of bounds. +func (v Vec[T]) Replace(ctx context.Context, index uint64, elem T) error { + length, err := v.length.Get(ctx) + if err != nil && !errors.Is(err, ErrNotFound) { + return err + } + if index >= length { + return fmt.Errorf("%w: length %d", ErrOutOfBounds, length) + } + return v.elements.Set(ctx, index, elem) +} + +// Get returns an element at a given index. Returns ErrOutOfBounds +// if the index is out of bounds. +func (v Vec[T]) Get(ctx context.Context, index uint64) (elem T, err error) { + elem, err = v.elements.Get(ctx, index) + switch { + case err == nil: + return elem, nil + case errors.Is(err, ErrNotFound): + return elem, fmt.Errorf("%w: index %d", ErrOutOfBounds, index) + default: + return elem, err + } +} + +// Len returns the length of the Vec. +func (v Vec[T]) Len(ctx context.Context) (uint64, error) { + length, err := v.length.Get(ctx) + switch { + // no error, return length as the vec is populated + case err == nil: + return length, nil + // not found, return 0 as the vec is empty + case errors.Is(err, ErrNotFound): + return 0, nil + // something else happened + default: + return 0, err + } +} + +// Iterate iterates over the Vec. It returns an Iterator whose key is the index +// and the value is the element at that index. +func (v Vec[T]) Iterate(ctx context.Context, rng Ranger[uint64]) (Iterator[uint64, T], error) { + return v.elements.Iterate(ctx, rng) +} + +// Walk walks over the Vec. It calls the walkFn for each element in the Vec, +// where the key is the index and the value is the element at that index. +func (v Vec[T]) Walk(ctx context.Context, rng Ranger[uint64], walkFn func(index uint64, elem T) (stop bool, err error)) error { + return v.elements.Walk(ctx, rng, walkFn) +} diff --git a/collections/vec_test.go b/collections/vec_test.go new file mode 100644 index 000000000000..d7640aec708d --- /dev/null +++ b/collections/vec_test.go @@ -0,0 +1,63 @@ +package collections + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func TestVec(t *testing.T) { + sk, ctx := deps() + schemaBuilder := NewSchemaBuilder(sk) + vec := NewVec(schemaBuilder, NewPrefix(0), "vec", StringValue) + _, err := schemaBuilder.Build() + require.NoError(t, err) + + // length when empty + length, err := vec.Len(ctx) + require.NoError(t, err) + require.Equal(t, uint64(0), length) + + // pop when empty should error with an empty vec error + _, err = vec.Pop(ctx) + require.ErrorIs(t, err, ErrEmptyVec) + + // replace when out of bounds should error with an out of bounds error + err = vec.Replace(ctx, 0, "foo") + require.ErrorIs(t, err, ErrOutOfBounds) + + // get out of bounds should error with an out of bounds error + _, err = vec.Get(ctx, 0) + require.ErrorIs(t, err, ErrOutOfBounds) + + // push + err = vec.Push(ctx, "foo") + require.NoError(t, err) + + // push more + err = vec.Push(ctx, "bar") + require.NoError(t, err) + + // check length + length, err = vec.Len(ctx) + require.NoError(t, err) + require.Equal(t, uint64(2), length) + + // get + v, err := vec.Get(ctx, 0) + require.NoError(t, err) + require.Equal(t, "foo", v) + + // replace + err = vec.Replace(ctx, 0, "bar") + require.NoError(t, err) + + v, err = vec.Get(ctx, 0) + require.NoError(t, err) + require.Equal(t, "bar", v) + + // pop + v, err = vec.Pop(ctx) + require.NoError(t, err) + require.Equal(t, "bar", v) +} diff --git a/contrib/devtools/Dockerfile b/contrib/devtools/Dockerfile index 3a38f5f14857..59a32de26b24 100644 --- a/contrib/devtools/Dockerfile +++ b/contrib/devtools/Dockerfile @@ -2,8 +2,8 @@ # docker build --pull --rm -f "contrib/devtools/Dockerfile" -t cosmossdk-proto:latest "contrib/devtools" # docker run --rm -v $(pwd):/workspace --workdir /workspace cosmossdk-proto sh ./scripts/protocgen.sh -FROM bufbuild/buf:1.20.0 as BUILDER -FROM golang:1.20-alpine +FROM bufbuild/buf:1.50.0 AS builder +FROM golang:1.23-alpine RUN apk add --no-cache \ nodejs \ @@ -11,7 +11,8 @@ RUN apk add --no-cache \ git \ make \ clang-extra-tools \ - g++ + g++ \ + jq RUN npm install -g swagger-combine @@ -21,13 +22,13 @@ RUN adduser -u $UID -s /bin/sh $UNAME -D USER $UNAME ENV GOLANG_PROTOBUF_VERSION=1.28.1 \ - GRPC_GATEWAY_VERSION=1.16.0 + GRPC_GATEWAY_VERSION=1.16.0 \ + GRPC_GATEWAY_PROTOC_GEN_OPENAPIV2_VERSION=2.20.0 RUN go install github.com/cosmos/cosmos-proto/cmd/protoc-gen-go-pulsar@latest && \ go install google.golang.org/protobuf/cmd/protoc-gen-go@v${GOLANG_PROTOBUF_VERSION} && \ - go install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway@v${GRPC_GATEWAY_VERSION} \ - github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger@v${GRPC_GATEWAY_VERSION} && \ - go install cosmossdk.io/orm/cmd/protoc-gen-go-cosmos-orm@v1.0.0-beta.3 && \ + go install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway@v${GRPC_GATEWAY_VERSION} && \ + go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@v${GRPC_GATEWAY_PROTOC_GEN_OPENAPIV2_VERSION} && \ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest # install all gogo protobuf binaries @@ -36,4 +37,4 @@ RUN git clone https://github.com/cosmos/gogoproto.git; \ go mod download; \ make install -COPY --from=BUILDER /usr/local/bin /usr/local/bin +COPY --from=builder /usr/local/bin /usr/local/bin diff --git a/contrib/githooks/README.md b/contrib/githooks/README.md index 19a89bd4e0d3..074527b137a4 100644 --- a/contrib/githooks/README.md +++ b/contrib/githooks/README.md @@ -14,8 +14,8 @@ that all the aforementioned commands are installed and available in the user's search `$PATH` environment variable: ```shell -go get golang.org/x/tools/cmd/goimports -go get github.com/golangci/misspell/cmd/misspell@master +go install golang.org/x/tools/cmd/goimports +go install github.com/golangci/misspell/cmd/misspell@master ``` It also runs `go mod tidy` and `golangci-lint` if available. diff --git a/contrib/images/simd-dlv/Dockerfile b/contrib/images/simd-dlv/Dockerfile index 55b591c7bd8b..8645c3b49cbb 100644 --- a/contrib/images/simd-dlv/Dockerfile +++ b/contrib/images/simd-dlv/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.20-alpine AS build +FROM golang:1.23-alpine AS build RUN apk add build-base git linux-headers libc-dev RUN go install github.com/go-delve/delve/cmd/dlv@latest @@ -10,7 +10,6 @@ COPY math/go.mod math/go.sum /work/math/ COPY api/go.mod api/go.sum /work/api/ COPY core/go.mod core/go.sum /work/core/ COPY depinject/go.mod depinject/go.sum /work/depinject/ -COPY tools/rosetta/go.mod tools/rosetta/go.sum /work/tools/rosetta/ COPY collections/go.mod collections/go.sum /work/collections/ COPY store/go.mod store/go.sum /work/store/ COPY log/go.mod log/go.sum /work/log/ diff --git a/contrib/images/simd-dlv/README.md b/contrib/images/simd-dlv/README.md index dcca3cde5c8b..d8955049976e 100644 --- a/contrib/images/simd-dlv/README.md +++ b/contrib/images/simd-dlv/README.md @@ -6,7 +6,7 @@ Cosmos-SDK provides you with a local network to bootstrap a chain in your machine, but how does one debug a node or module? -If we start a single node, we won't be able to debug transactions as the machine will be in bootstrapping phase trying to find peers to connect too, thats why we need to start a local network. +If we start a single node, we won't be able to debug transactions as the machine will be in bootstrapping phase trying to find peers to connect too, that's why we need to start a local network. But the current `localnet-start` does not provide us with debugging tools so that's why there is a different image for debugging a local network, that is to avoid any issues in the future were debugging won't be needed. diff --git a/contrib/images/simd-env/Dockerfile b/contrib/images/simd-env/Dockerfile index 3b1b4521f79a..ea18a85be5e3 100644 --- a/contrib/images/simd-env/Dockerfile +++ b/contrib/images/simd-env/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.20-alpine AS build +FROM golang:1.23-alpine AS build RUN apk add build-base git linux-headers @@ -9,11 +9,11 @@ COPY math/go.mod math/go.sum /work/math/ COPY api/go.mod api/go.sum /work/api/ COPY core/go.mod core/go.sum /work/core/ COPY depinject/go.mod depinject/go.sum /work/depinject/ -COPY tools/rosetta/go.mod tools/rosetta/go.sum /work/tools/rosetta/ COPY collections/go.mod collections/go.sum /work/collections/ COPY store/go.mod store/go.sum /work/store/ COPY log/go.mod log/go.sum /work/log/ COPY x/tx/go.mod x/tx/go.sum /work/x/tx/ + RUN go mod download COPY ./ /work diff --git a/contrib/localnet_liveness.sh b/contrib/localnet_liveness.sh deleted file mode 100755 index 00c360b98dc7..000000000000 --- a/contrib/localnet_liveness.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash - -CNT=0 -ITER=$1 -SLEEP=$2 -NUMBLOCKS=$3 -NODEADDR=$4 - -if [ -z "$1" ]; then - echo "Need to input number of iterations to run..." - exit 1 -fi - -if [ -z "$2" ]; then - echo "Need to input number of seconds to sleep between iterations" - exit 1 -fi - -if [ -z "$3" ]; then - echo "Need to input block height to declare completion..." - exit 1 -fi - -if [ -z "$4" ]; then - echo "Need to input node address to poll..." - exit 1 -fi - -docker_containers=( $(docker ps -q -f name=simd --format='{{.Names}}') ) - -while [ ${CNT} -lt $ITER ]; do - curr_block=$(curl -s $NODEADDR:26657/status | jq -r '.result.sync_info.latest_block_height') - - if [ ! -z ${curr_block} ] ; then - echo "Number of Blocks: ${curr_block}" - fi - - if [ ! -z ${curr_block} ] && [ ${curr_block} -gt ${NUMBLOCKS} ]; then - echo "Number of blocks reached. Success!" - exit 0 - fi - - # Emulate network chaos: - # - # Every 10 blocks, pick a random container and restart it. - if ! ((${CNT} % 10)); then - rand_container=${docker_containers["$[RANDOM % ${#docker_containers[@]}]"]}; - echo "Restarting random docker container ${rand_container}" - docker restart ${rand_container} &>/dev/null & - fi - let CNT=CNT+1 - sleep $SLEEP -done -echo "Timeout reached. Failure!" -exit 1 diff --git a/contrib/rosetta/README.md b/contrib/rosetta/README.md deleted file mode 100644 index 77955b1b4394..000000000000 --- a/contrib/rosetta/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# rosetta - -This directory contains the files required to run the rosetta CI. It builds `simapp` based on the current codebase. - -## docker-compose.yaml - -Builds: - -* cosmos-sdk simapp node, with prefixed data directory, keys etc. This is required to test historical balances. -* faucet is required so we can test construction API, it was literally impossible to put there a deterministic address to request funds for -* rosetta is the rosetta node used by rosetta-cli to interact with the cosmos-sdk app -* test_rosetta runs the rosetta-cli test against construction API and data API - -## configuration - -Contains the required files to set up rosetta cli and make it work against its workflows - -## Rosetta-ci - -Contains the files for a deterministic network, with fixed keys and some actions on there, to test parsing of msgs and historical balances. This image is used to run a simapp node and to run the rosetta server and the rosetta-cli. -Whenever [rosetta-cli](https://github.com/coinbase/rosetta-cli) releases a new version, rosetta-ci/Dockerfile should be updated to reflect the new version. - -## Notes - -* Keyring password is 12345678 -* data.sh creates node data, it's required in case consensus breaking changes are made to quickly recreate replicable node data for rosetta diff --git a/contrib/rosetta/configuration/bootstrap.json b/contrib/rosetta/configuration/bootstrap.json deleted file mode 100644 index ddf504179711..000000000000 --- a/contrib/rosetta/configuration/bootstrap.json +++ /dev/null @@ -1,12 +0,0 @@ -[ - { - "account_identifier": { - "address":"cosmos1f3d3s7jjy5zune554w7fnhrhyuxhll7s7rps0h" - }, - "currency":{ - "symbol":"stake", - "decimals":0 - }, - "value": "999990000000" - } -] \ No newline at end of file diff --git a/contrib/rosetta/configuration/data.sh b/contrib/rosetta/configuration/data.sh deleted file mode 100644 index 017b2e642f9c..000000000000 --- a/contrib/rosetta/configuration/data.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/sh - -set -e - -wait_simd() { - timeout 30 sh -c 'until nc -z $0 $1; do sleep 1; done' localhost 9090 -} -# this script is used to recreate the data dir -echo clearing /root/.simapp -rm -rf /root/.simapp/* -echo initting new chain -# init config files -simd init simd --chain-id testing - -# create accounts -simd keys add fd --keyring-backend=test - -addr=$(simd keys show fd -a --keyring-backend=test) -val_addr=$(simd keys show fd --keyring-backend=test --bech val -a) - -# give the accounts some money -simd genesis add-genesis-account "$addr" 1000000000000stake --keyring-backend=test - -# save configs for the daemon -simd genesis gentx fd 10000000stake --chain-id testing --keyring-backend=test - -# input genTx to the genesis file -simd genesis collect-gentxs -# verify genesis file is fine -simd genesis validate-genesis -echo changing network settings -sed -i 's/127.0.0.1/0.0.0.0/g' /root/.simapp/config/config.toml - -# start simd -echo starting simd... -simd start --pruning=nothing & -pid=$! -echo simd started with PID $pid - -echo awaiting for simd to be ready -wait_simd -echo simd is ready -sleep 10 - - -# send transaction to deterministic address -echo sending transaction with addr $addr -simd tx bank send "$addr" cosmos19g9cm8ymzchq2qkcdv3zgqtwayj9asv3hjv5u5 100stake --yes --keyring-backend=test --chain-id=testing - -sleep 10 - -echo stopping simd... -kill -9 $pid - -echo zipping data dir and saving to /tmp/data.tar.gz - -tar -czvf /tmp/data.tar.gz /root/.simapp - -echo new address for bootstrap.json "$addr" "$val_addr" diff --git a/contrib/rosetta/configuration/faucet.py b/contrib/rosetta/configuration/faucet.py deleted file mode 100644 index 44536a84bb3b..000000000000 --- a/contrib/rosetta/configuration/faucet.py +++ /dev/null @@ -1,25 +0,0 @@ -from http.server import HTTPServer, BaseHTTPRequestHandler -import subprocess - -import os - - -class SimpleHTTPRequestHandler(BaseHTTPRequestHandler): - - def do_POST(self): - try: - content_len = int(self.headers.get('Content-Length')) - addr = self.rfile.read(content_len).decode("utf-8") - print("sending funds to " + addr) - subprocess.call(['sh', './send_funds.sh', addr]) - self.send_response(200) - self.end_headers() - except Exception as e: - print("failed " + str(e)) - os._exit(1) - - -if __name__ == "__main__": - print("starting faucet server...") - httpd = HTTPServer(('0.0.0.0', 8000), SimpleHTTPRequestHandler) - httpd.serve_forever() diff --git a/contrib/rosetta/configuration/rosetta.json b/contrib/rosetta/configuration/rosetta.json deleted file mode 100644 index 5802c3c90dff..000000000000 --- a/contrib/rosetta/configuration/rosetta.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "network": { - "blockchain": "app", - "network": "network" - }, - "online_url": "http://rosetta:8080", - "data_directory": "", - "http_timeout": 300, - "max_retries": 5, - "retry_elapsed_time": 0, - "max_online_connections": 0, - "max_sync_concurrency": 0, - "tip_delay": 60, - "log_configuration": true, - "construction": { - "offline_url": "http://rosetta:8080", - "max_offline_connections": 0, - "stale_depth": 0, - "broadcast_limit": 0, - "ignore_broadcast_failures": false, - "clear_broadcasts": false, - "broadcast_behind_tip": false, - "block_broadcast_limit": 0, - "rebroadcast_all": false, - "constructor_dsl_file": "transfer.ros", - "end_conditions": { - "create_account": 1, - "transfer": 1 - } - }, - "data": { - "active_reconciliation_concurrency": 0, - "inactive_reconciliation_concurrency": 0, - "inactive_reconciliation_frequency": 0, - "log_blocks": false, - "log_transactions": false, - "log_balance_changes": false, - "log_reconciliations": false, - "ignore_reconciliation_error": false, - "exempt_accounts": "", - "bootstrap_balances": "bootstrap.json", - "interesting_accounts": "", - "reconciliation_disabled": false, - "inactive_discrepancy_search_disabled": false, - "balance_tracking_disabled": false, - "coin_tracking_disabled": false, - "end_conditions": { - "tip": true - } - } -} \ No newline at end of file diff --git a/contrib/rosetta/configuration/run_tests.sh b/contrib/rosetta/configuration/run_tests.sh deleted file mode 100755 index c53f89ff88a4..000000000000 --- a/contrib/rosetta/configuration/run_tests.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -set -e - -wait_for_rosetta() { - timeout 30 sh -c 'until nc -z $0 $1; do sleep 1; done' rosetta 8080 -} - -echo "waiting for rosetta instance to be up" -wait_for_rosetta - -echo "checking data API" -rosetta-cli check:data --configuration-file ./config/rosetta.json - -echo "checking construction API" -rosetta-cli check:construction --configuration-file ./config/rosetta.json - diff --git a/contrib/rosetta/configuration/send_funds.sh b/contrib/rosetta/configuration/send_funds.sh deleted file mode 100644 index 3a897539d225..000000000000 --- a/contrib/rosetta/configuration/send_funds.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -set -e -addr=$(simd keys show fd -a --keyring-backend=test) -echo "12345678" | simd tx bank send "$addr" "$1" 100stake --chain-id="testing" --node tcp://cosmos:26657 --yes --keyring-backend=test \ No newline at end of file diff --git a/contrib/rosetta/configuration/transfer.ros b/contrib/rosetta/configuration/transfer.ros deleted file mode 100644 index 201a8ab7c449..000000000000 --- a/contrib/rosetta/configuration/transfer.ros +++ /dev/null @@ -1,105 +0,0 @@ -request_funds(1){ - find_account{ - currency = {"symbol":"stake", "decimals":0}; - random_account = find_balance({ - "minimum_balance":{ - "value": "0", - "currency": {{currency}} - }, - "create_limit":1 - }); - }, - send_funds{ - account_identifier = {{random_account.account_identifier}}; - address = {{account_identifier.address}}; - idk = http_request({ - "method": "POST", - "url": "http:\/\/faucet:8000", - "timeout": 10, - "body": {{random_account.account_identifier.address}} - }); - }, - // Create a separate scenario to request funds so that - // the address we are using to request funds does not - // get rolled back if funds do not yet exist. - request{ - loaded_account = find_balance({ - "account_identifier": {{random_account.account_identifier}}, - "minimum_balance":{ - "value": "50", - "currency": {{currency}} - } - }); - } -} -create_account(1){ - create{ - network = {"network":"network", "blockchain":"app"}; - key = generate_key({"curve_type": "secp256k1"}); - account = derive({ - "network_identifier": {{network}}, - "public_key": {{key.public_key}} - }); - // If the account is not saved, the key will be lost! - save_account({ - "account_identifier": {{account.account_identifier}}, - "keypair": {{key}} - }); - } -} -transfer(3){ - transfer{ - transfer.network = {"network":"network", "blockchain":"app"}; - currency = {"symbol":"stake", "decimals":0}; - sender = find_balance({ - "minimum_balance":{ - "value": "100", - "currency": {{currency}} - } - }); - acc_identifier = {{sender.account_identifier}}; - sender_address = {{acc_identifier.address}}; - // Set the recipient_amount as some value <= sender.balance-max_fee - max_fee = "0"; - fee_amount = "1"; - fee_value = 0 - {{fee_amount}}; - available_amount = {{sender.balance.value}} - {{max_fee}}; - recipient_amount = random_number({"minimum": "1", "maximum": {{available_amount}}}); - print_message({"recipient_amount":{{recipient_amount}}}); - // Find recipient and construct operations - sender_amount = 0 - {{recipient_amount}}; - recipient = find_balance({ - "not_account_identifier":[{{sender.account_identifier}}], - "minimum_balance":{ - "value": "0", - "currency": {{currency}} - }, - "create_limit": 100, - "create_probability": 50 - }); - transfer.confirmation_depth = "1"; - recipient_account_identifier = {{recipient.account_identifier}}; - recipient_address = {{recipient_account_identifier.address}}; - transfer.operations = [ - { - "operation_identifier":{"index":0}, - "type":"/cosmos.bank.v1beta1.MsgSend", - "account":{{sender.account_identifier}}, - "metadata": { - "amount": [ - { - "amount": {{recipient_amount}}, - "denom": {{currency.symbol}} - } - ], - "from_address": {{sender_address}}, - "to_address": {{recipient_address}} - } - } - ]; - transfer.preprocess_metadata = { - "gas_price": "1stake", - "gas_limit": 250000 - }; - } -} diff --git a/contrib/rosetta/docker-compose.yaml b/contrib/rosetta/docker-compose.yaml deleted file mode 100644 index c5c4cc3eb12d..000000000000 --- a/contrib/rosetta/docker-compose.yaml +++ /dev/null @@ -1,45 +0,0 @@ -version: "3" - -services: - cosmos: - image: rosetta-ci:latest - command: ["simd", "start", "--pruning", "nothing", "--grpc.enable", "true", "--grpc.address", "0.0.0.0:9090", "--grpc-web.enable", "true"] - ports: - - 9090:9090 - - 26657:26657 - logging: - driver: "none" - - rosetta: - image: rosetta-ci:latest - depends_on: - - "cosmos" - command: [ - "simd", - "rosetta", - "--blockchain", "app", - "--network", "network", - "--tendermint", "cosmos:26657", - "--grpc", "cosmos:9090", - "--addr", ":8080", - ] - ports: - - 8080:8080 - - faucet: - image: rosetta-ci:latest - working_dir: /rosetta - command: ["python3", "faucet.py"] - expose: - - 8080 - - test_rosetta: - image: rosetta-ci:latest - depends_on: - - "cosmos" - - "rosetta" - - "faucet" - volumes: - - ./configuration:/rosetta/config:z - command: ["./config/run_tests.sh"] - working_dir: /rosetta diff --git a/contrib/rosetta/rosetta-ci/Dockerfile b/contrib/rosetta/rosetta-ci/Dockerfile deleted file mode 100644 index 165d0d0f0aa8..000000000000 --- a/contrib/rosetta/rosetta-ci/Dockerfile +++ /dev/null @@ -1,42 +0,0 @@ -FROM golang:1.20-alpine as build - -RUN apk add git tar gcc libc-dev --no-cache - -ARG ROSETTA_VERSION="v0.10.0" - -# build rosetta CLI -WORKDIR /rosetta -RUN git clone https://github.com/coinbase/rosetta-cli . && \ - git checkout tags/$ROSETTA_VERSION && \ - go build -o rosetta-cli ./main.go - -# prepare node data -WORKDIR /node -COPY ./contrib/rosetta/rosetta-ci/data.tar.gz data.tar.gz -RUN tar -zxvf data.tar.gz -C . - -# build simd -WORKDIR /simd -COPY . ./ -RUN cd simapp && go build -o simd ./simd/ - -FROM alpine -RUN apk add gcc git libc-dev python3 --no-cache - -ENV PATH=$PATH:/bin -# Set GENESIS_HASH env needed for api correctness -ENV GENESIS_HASH "01331100220a94b9acc0ceef697a6db44ba70fc61e9e6c24802974a0b6cba29b" - -COPY --from=build /rosetta/rosetta-cli /bin/rosetta-cli -COPY --from=build /simd/simapp/simd/simd /bin/simd - -WORKDIR /rosetta -COPY ./contrib/rosetta/configuration ./ -RUN chmod +x run_tests.sh && \ - chmod +x send_funds.sh && \ - chmod +x faucet.py - -COPY --from=build /node/root /root/ -WORKDIR /root/.simapp - -RUN chmod -R 0777 ./ diff --git a/contrib/rosetta/rosetta-ci/data.tar.gz b/contrib/rosetta/rosetta-ci/data.tar.gz deleted file mode 100644 index 96fef01975f5..000000000000 Binary files a/contrib/rosetta/rosetta-ci/data.tar.gz and /dev/null differ diff --git a/core/CHANGELOG.md b/core/CHANGELOG.md index ac6434ff22de..9f75d72639e2 100644 --- a/core/CHANGELOG.md +++ b/core/CHANGELOG.md @@ -36,6 +36,27 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +## [v0.11.2](https://github.com/cosmos/cosmos-sdk/releases/tag/core%2Fv0.11.2) + +* [#21298](https://github.com/cosmos/cosmos-sdk/pull/21298) Backport [#19265](https://github.com/cosmos/cosmos-sdk/pull/19265) to core. +* [#21298](https://github.com/cosmos/cosmos-sdk/pull/21298) Clean-up after depinject upgrade. + +## [v0.11.1](https://github.com/cosmos/cosmos-sdk/releases/tag/core%2Fv0.11.1) + +* [#21022](https://github.com/cosmos/cosmos-sdk/pull/21022) Upgrade depinject to v1.0.0. + +## [v0.11.0](https://github.com/cosmos/cosmos-sdk/releases/tag/core%2Fv0.11.0) + +* [#17468](https://github.com/cosmos/cosmos-sdk/pull/17468) Add `appmodule.HasPreBlocker` interface. + +## [v0.10.0](https://github.com/cosmos/cosmos-sdk/releases/tag/core%2Fv0.10.0) + +* [#17383](https://github.com/cosmos/cosmos-sdk/pull/17383) Add `appmoduke.UpgradeModule` interface. + +## [v0.9.0](https://github.com/cosmos/cosmos-sdk/releases/tag/core%2Fv0.9.0) + +* [#16739](https://github.com/cosmos/cosmos-sdk/pull/16739) Add `AppHash` to header.Info. + ## [v0.8.0](https://github.com/cosmos/cosmos-sdk/releases/tag/core%2Fv0.8.0) * [#15519](https://github.com/cosmos/cosmos-sdk/pull/15519) Update `comet.VoteInfo` for CometBFT v0.38. diff --git a/core/appconfig/config.go b/core/appconfig/config.go index 808c0cdc8aaa..670565018dc5 100644 --- a/core/appconfig/config.go +++ b/core/appconfig/config.go @@ -1,125 +1,18 @@ package appconfig import ( - "fmt" - "strings" - - "github.com/cosmos/cosmos-proto/anyutil" - "google.golang.org/protobuf/encoding/protojson" - "google.golang.org/protobuf/proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" - "google.golang.org/protobuf/types/known/anypb" - "sigs.k8s.io/yaml" - - appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" - - "cosmossdk.io/depinject" - - "cosmossdk.io/core/internal" + depinjectappconfig "cosmossdk.io/depinject/appconfig" ) // LoadJSON loads an app config in JSON format. -func LoadJSON(bz []byte) depinject.Config { - config := &appv1alpha1.Config{} - err := protojson.Unmarshal(bz, config) - if err != nil { - return depinject.Error(err) - } - - return Compose(config) -} +var LoadJSON = depinjectappconfig.LoadJSON // LoadYAML loads an app config in YAML format. -func LoadYAML(bz []byte) depinject.Config { - j, err := yaml.YAMLToJSON(bz) - if err != nil { - return depinject.Error(err) - } - - return LoadJSON(j) -} +var LoadYAML = depinjectappconfig.LoadYAML // WrapAny marshals a proto message into a proto Any instance -func WrapAny(config protoreflect.ProtoMessage) *anypb.Any { - cfg, err := anyutil.New(config) - if err != nil { - panic(err) - } - - return cfg -} +var WrapAny = depinjectappconfig.WrapAny // Compose composes a v1alpha1 app config into a container option by resolving // the required modules and composing their options. -func Compose(appConfig *appv1alpha1.Config) depinject.Config { - opts := []depinject.Config{ - depinject.Supply(appConfig), - } - - for _, module := range appConfig.Modules { - if module.Name == "" { - return depinject.Error(fmt.Errorf("module is missing name")) - } - - if module.Config == nil { - return depinject.Error(fmt.Errorf("module %q is missing a config object", module.Name)) - } - - msgType, err := protoregistry.GlobalTypes.FindMessageByURL(module.Config.TypeUrl) - if err != nil { - return depinject.Error(err) - } - - modules, err := internal.ModulesByProtoMessageName() - if err != nil { - return depinject.Error(err) - } - - init, ok := modules[msgType.Descriptor().FullName()] - if !ok { - modDesc := proto.GetExtension(msgType.Descriptor().Options(), appv1alpha1.E_Module).(*appv1alpha1.ModuleDescriptor) - if modDesc == nil { - return depinject.Error(fmt.Errorf("no module registered for type URL %s and that protobuf type does not have the option %s\n\n%s", - module.Config.TypeUrl, appv1alpha1.E_Module.TypeDescriptor().FullName(), dumpRegisteredModules(modules))) - } - - return depinject.Error(fmt.Errorf("no module registered for type URL %s, did you forget to import %s: find more information on how to make a module ready for app wiring: https://docs.cosmos.network/main/building-modules/depinject\n\n%s", - module.Config.TypeUrl, modDesc.GoImport, dumpRegisteredModules(modules))) - } - - config := init.ConfigProtoMessage.ProtoReflect().Type().New().Interface() - err = anypb.UnmarshalTo(module.Config, config, proto.UnmarshalOptions{}) - if err != nil { - return depinject.Error(err) - } - - opts = append(opts, depinject.Supply(config)) - - for _, provider := range init.Providers { - opts = append(opts, depinject.ProvideInModule(module.Name, provider)) - } - - for _, invoker := range init.Invokers { - opts = append(opts, depinject.InvokeInModule(module.Name, invoker)) - } - - for _, binding := range module.GolangBindings { - opts = append(opts, depinject.BindInterfaceInModule(module.Name, binding.InterfaceType, binding.Implementation)) - } - } - - for _, binding := range appConfig.GolangBindings { - opts = append(opts, depinject.BindInterface(binding.InterfaceType, binding.Implementation)) - } - - return depinject.Configs(opts...) -} - -func dumpRegisteredModules(modules map[protoreflect.FullName]*internal.ModuleInitializer) string { - var mods []string - for name := range modules { - mods = append(mods, " "+string(name)) - } - return fmt.Sprintf("registered modules are:\n%s", strings.Join(mods, "\n")) -} +var Compose = depinjectappconfig.Compose diff --git a/core/appmodule/genesis.go b/core/appmodule/genesis.go index 77940ce5fee3..7f955a467749 100644 --- a/core/appmodule/genesis.go +++ b/core/appmodule/genesis.go @@ -7,6 +7,7 @@ import ( // HasGenesis is the extension interface that modules should implement to handle // genesis data and state initialization. +// WARNING: This interface is experimental and may change at any time. type HasGenesis interface { AppModule diff --git a/core/appmodule/module.go b/core/appmodule/module.go index a701a307c974..61714b32bb13 100644 --- a/core/appmodule/module.go +++ b/core/appmodule/module.go @@ -3,8 +3,9 @@ package appmodule import ( "context" - "cosmossdk.io/depinject" "google.golang.org/grpc" + + "cosmossdk.io/depinject" ) // AppModule is a tag interface for app module implementations to use as a basis @@ -51,6 +52,22 @@ type HasPrecommit interface { Precommit(context.Context) error } +// ResponsePreBlock represents the response from the PreBlock method. +// It can modify consensus parameters in storage and signal the caller through the return value. +// When it returns ConsensusParamsChanged=true, the caller must refresh the consensus parameter in the finalize context. +// The new context (ctx) must be passed to all the other lifecycle methods. +type ResponsePreBlock interface { + IsConsensusParamsChanged() bool +} + +// HasPreBlocker is the extension interface that modules should implement to run +// custom logic before BeginBlock. +type HasPreBlocker interface { + AppModule + // PreBlock is method that will be run before BeginBlock. + PreBlock(context.Context) (ResponsePreBlock, error) +} + // HasBeginBlocker is the extension interface that modules should implement to run // custom logic before transaction processing in a block. type HasBeginBlocker interface { @@ -70,3 +87,10 @@ type HasEndBlocker interface { // a block. EndBlock(context.Context) error } + +// UpgradeModule is the extension interface that upgrade module should implement to differentiate +// it from other modules, migration handler need ensure the upgrade module's migration is executed +// before the rest of the modules. +type UpgradeModule interface { + IsUpgradeModule() +} diff --git a/core/appmodule/option.go b/core/appmodule/option.go index 951bfc6e2d7c..1926ec36e950 100644 --- a/core/appmodule/option.go +++ b/core/appmodule/option.go @@ -1,37 +1,19 @@ package appmodule import ( - "cosmossdk.io/core/internal" + depinjectappconfig "cosmossdk.io/depinject/appconfig" ) // Option is a functional option for implementing modules. -type Option interface { - apply(*internal.ModuleInitializer) error -} - -type funcOption func(initializer *internal.ModuleInitializer) error - -func (f funcOption) apply(initializer *internal.ModuleInitializer) error { - return f(initializer) -} +type Option = depinjectappconfig.Option // Provide registers providers with the dependency injection system that will be // run within the module scope. See cosmossdk.io/depinject for // documentation on the dependency injection system. -func Provide(providers ...interface{}) Option { - return funcOption(func(initializer *internal.ModuleInitializer) error { - initializer.Providers = append(initializer.Providers, providers...) - return nil - }) -} +var Provide = depinjectappconfig.Provide // Invoke registers invokers to run with depinject. Each invoker will be called // at the end of dependency graph configuration in the order in which it was defined. Invokers may not define output // parameters, although they may return an error, and all of their input parameters will be marked as optional so that // invokers impose no additional constraints on the dependency graph. Invoker functions should nil-check all inputs. -func Invoke(invokers ...interface{}) Option { - return funcOption(func(initializer *internal.ModuleInitializer) error { - initializer.Invokers = append(initializer.Invokers, invokers...) - return nil - }) -} +var Invoke = depinjectappconfig.Invoke diff --git a/core/appmodule/register.go b/core/appmodule/register.go index 56004dbb863c..8475365a8450 100644 --- a/core/appmodule/register.go +++ b/core/appmodule/register.go @@ -1,11 +1,7 @@ package appmodule import ( - "reflect" - - "google.golang.org/protobuf/proto" - - "cosmossdk.io/core/internal" + depinjectappconfig "cosmossdk.io/depinject/appconfig" ) // Register registers a module with the global module registry. The provided @@ -17,18 +13,4 @@ import ( // Protobuf message types used for module configuration should define the // cosmos.app.v1alpha.module option and must explicitly specify go_package // to make debugging easier for users. -func Register(msg proto.Message, options ...Option) { - ty := reflect.TypeOf(msg) - init := &internal.ModuleInitializer{ - ConfigProtoMessage: msg, - ConfigGoType: ty, - } - internal.ModuleRegistry[ty] = init - - for _, option := range options { - init.Error = option.apply(init) - if init.Error != nil { - return - } - } -} +var Register = depinjectappconfig.RegisterModule diff --git a/core/coins/format.go b/core/coins/format.go index 315c96d78f46..c23a25dc2612 100644 --- a/core/coins/format.go +++ b/core/coins/format.go @@ -84,6 +84,12 @@ func FormatCoins(coins []*basev1beta1.Coin, metadata []*bankv1beta1.Metadata) (s if err != nil { return "", err } + + // If a coin contains a comma, return an error given that the output + // could be misinterpreted by the user as 2 different coins. + if strings.Contains(formatted[i], ",") { + return "", fmt.Errorf("coin %s contains a comma", formatted[i]) + } } if len(coins) == 0 { diff --git a/core/coins/format_test.go b/core/coins/format_test.go index f17d449791f2..994be1a82925 100644 --- a/core/coins/format_test.go +++ b/core/coins/format_test.go @@ -5,10 +5,11 @@ import ( "os" "testing" + "github.com/stretchr/testify/require" + bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" "cosmossdk.io/core/coins" - "github.com/stretchr/testify/require" ) // coinsJsonTest is the type of test cases in the coin.json file. diff --git a/core/genesis/source_test.go b/core/genesis/source_test.go index 3efdfb4d54d5..cff1a3bde467 100644 --- a/core/genesis/source_test.go +++ b/core/genesis/source_test.go @@ -24,6 +24,7 @@ func TestSource(t *testing.T) { } func expectJSON(t *testing.T, source appmodule.GenesisSource, field, contents string) { + t.Helper() r, err := source(field) require.NoError(t, err) bz, err := io.ReadAll(r) diff --git a/core/go.mod b/core/go.mod index 963f84c662f9..8322aaa39e13 100644 --- a/core/go.mod +++ b/core/go.mod @@ -1,55 +1,62 @@ module cosmossdk.io/core -go 1.20 +go 1.23 require ( - cosmossdk.io/api v0.4.2 - cosmossdk.io/depinject v1.0.0-alpha.3 - cosmossdk.io/math v1.0.1 - github.com/cosmos/cosmos-db v1.0.0 - github.com/cosmos/cosmos-proto v1.0.0-beta.3 - github.com/stretchr/testify v1.8.4 - google.golang.org/grpc v1.55.0 - google.golang.org/protobuf v1.30.0 - gotest.tools/v3 v3.4.0 - sigs.k8s.io/yaml v1.3.0 + cosmossdk.io/api v0.7.6 + cosmossdk.io/depinject v1.1.0 + cosmossdk.io/math v1.5.0 + github.com/cosmos/cosmos-db v1.1.1 + github.com/stretchr/testify v1.10.0 + google.golang.org/grpc v1.71.0 + google.golang.org/protobuf v1.36.5 ) require ( + cosmossdk.io/errors v1.0.1 // indirect github.com/DataDog/zstd v1.5.5 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/cockroachdb/errors v1.9.1 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/cockroachdb/apd/v3 v3.2.1 // indirect + github.com/cockroachdb/errors v1.11.3 // indirect + github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20230525220056-bb4fc9527b3b // indirect - github.com/cockroachdb/redact v1.1.4 // indirect - github.com/cosmos/gogoproto v1.4.10 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/getsentry/sentry-go v0.21.0 // indirect + github.com/cockroachdb/pebble v1.1.2 // indirect + github.com/cockroachdb/redact v1.1.5 // indirect + github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect + github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect + github.com/cosmos/gogoproto v1.7.0 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/getsentry/sentry-go v0.27.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.4 // indirect - github.com/google/btree v1.1.2 // indirect - github.com/google/go-cmp v0.5.9 // indirect + github.com/google/btree v1.1.3 // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/klauspost/compress v1.16.5 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect - github.com/linxGnu/grocksdb v1.7.16 // indirect + github.com/linxGnu/grocksdb v1.8.12 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.15.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/prometheus/client_golang v1.16.0 // indirect github.com/prometheus/client_model v0.4.0 // indirect github.com/prometheus/common v0.44.0 // indirect - github.com/prometheus/procfs v0.10.0 // indirect - github.com/rogpeppe/go-internal v1.10.0 // indirect - github.com/spf13/cast v1.5.1 // indirect + github.com/prometheus/procfs v0.10.1 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect + github.com/spf13/cast v1.7.1 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect - golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/text v0.9.0 // indirect - google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect + github.com/tendermint/go-amino v0.16.0 // indirect + golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 // indirect + golang.org/x/net v0.35.0 // indirect + golang.org/x/sys v0.30.0 // indirect + golang.org/x/text v0.22.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20250106144421-5f5ef82da422 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f // indirect gopkg.in/yaml.v3 v3.0.1 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect ) + +// Version tagged too early and incompatible with v0.50 (latest at the time of tagging) +retract v0.12.0 diff --git a/core/go.sum b/core/go.sum index 39b0d149e12b..345bb4f9e632 100644 --- a/core/go.sum +++ b/core/go.sum @@ -1,205 +1,113 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cosmossdk.io/api v0.4.2 h1:lQBMl4xINnMnBOR/tQLtjlDnR4exr4e6/SfHR8PILE0= -cosmossdk.io/api v0.4.2/go.mod h1:qrVgOp7DIeAXa+Tt5dDjOC47bZCDrwx8ZHxrmy7STNE= -cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw= -cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= -cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= -cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= -github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= -github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= +cosmossdk.io/api v0.7.6 h1:PC20PcXy1xYKH2KU4RMurVoFjjKkCgYRbVAD4PdqUuY= +cosmossdk.io/api v0.7.6/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/depinject v1.1.0 h1:wLan7LG35VM7Yo6ov0jId3RHWCGRhe8E8bsuARorl5E= +cosmossdk.io/depinject v1.1.0/go.mod h1:kkI5H9jCGHeKeYWXTqYdruogYrEeWvBQCw1Pj4/eCFI= +cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= +cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= +cosmossdk.io/math v1.5.0 h1:sbOASxee9Zxdjd6OkzogvBZ25/hP929vdcYcBJQbkLc= +cosmossdk.io/math v1.5.0/go.mod h1:AAwwBmUhqtk2nlku174JwSll+/DepUXW3rWIXN5q+Nw= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= -github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= -github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= -github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= -github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -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/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= -github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/apd/v3 v3.2.1 h1:U+8j7t0axsIgvQUqthuNm82HIrYXodOV2iWLWtEaIwg= +github.com/cockroachdb/apd/v3 v3.2.1/go.mod h1:klXJcjp+FffLTHlhIG69tezTDvdP065naDsHzKhYSqc= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= -github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= -github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= +github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce h1:giXvy4KSc/6g/esnpM7Geqxka4WSqI1SZc7sMJFd3y4= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/pebble v0.0.0-20230525220056-bb4fc9527b3b h1:LCs8gDhg6vt8A3dN7AEJxmCoETZ4qkySoVJVm3rcSJk= -github.com/cockroachdb/pebble v0.0.0-20230525220056-bb4fc9527b3b/go.mod h1:TkdVsGYRqtULUppt2RbC+YaKtTHnHoWa2apfFrSKABw= -github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/cockroachdb/redact v1.1.4 h1:Y0XrVI2FAyofNyGveodTN//qdpPtFKcKTeCBsK3AHAQ= -github.com/cockroachdb/redact v1.1.4/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0E= -github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= -github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= -github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoKuI= -github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/cockroachdb/pebble v1.1.2 h1:CUh2IPtR4swHlEj48Rhfzw6l/d0qA31fItcIszQVIsA= +github.com/cockroachdb/pebble v1.1.2/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= +github.com/cosmos/cosmos-db v1.1.1 h1:FezFSU37AlBC8S98NlSagL76oqBRWq/prTPvFcEJNCM= +github.com/cosmos/cosmos-db v1.1.1/go.mod h1:AghjcIPqdhSLP/2Z0yha5xPH3nLnskz81pBx3tcVSAw= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= -github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= -github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= -github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= -github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= -github.com/getsentry/sentry-go v0.21.0 h1:c9l5F1nPF30JIppulk4veau90PK6Smu3abgVtVQWon4= -github.com/getsentry/sentry-go v0.21.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= -github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= -github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= -github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= +github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= -github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= +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-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= -github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= -github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= -github.com/gofrs/uuid v4.2.0+incompatible h1:yyYWMnhkhrKwwr8gAOcOCYxOOscHgDS9yZgBrnJfGa0= -github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= -github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= -github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= -github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= -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/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= +github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= 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= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= -github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= -github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= -github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= -github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= -github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= -github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= -github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= -github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= 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/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI= github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -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.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= -github.com/linxGnu/grocksdb v1.7.16 h1:Q2co1xrpdkr5Hx3Fp+f+f7fRGhQFQhvi/+226dtLmA8= -github.com/linxGnu/grocksdb v1.7.16/go.mod h1:JkS7pl5qWpGpuVb3bPqTz8nC12X3YtPZT+Xq7+QfQo4= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= -github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= +github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= +github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= +github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= -github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= -github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= -github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= -github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= @@ -210,233 +118,134 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.15.1 h1:8tXpTmJbyH5lydzFPoxSIJ0J46jdh3tylbvM1xCv0LI= -github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= +github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= -github.com/prometheus/procfs v0.10.0 h1:UkG7GPYkO4UZyLnyXjaWYcgOSONqwdBqFUT95ugmt6I= -github.com/prometheus/procfs v0.10.0/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= -github.com/regen-network/gocuke v0.6.2 h1:pHviZ0kKAq2U2hN2q3smKNxct6hS0mGByFMHGnWA97M= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= +github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= +github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= -github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= +github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= -github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= -github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= -github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= +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/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= +go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= +go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY= +go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI= +go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ= +go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE= +go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A= +go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU= +go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk= +go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w= +go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k= +go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 h1:985EYyeCOxTpcgOTJpflJUwOeEz0CQOdPt73OzpE9F8= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= +golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= +golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 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-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= +golang.org/x/sys v0.30.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= +golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181221001348-537d06c36207/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-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= 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= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= -google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= +google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto/googleapis/api v0.0.0-20250106144421-5f5ef82da422 h1:GVIKPyP/kLIyVOgOnTwFOrvQaQUzOzGMCxgFUOEmm24= +google.golang.org/genproto/googleapis/api v0.0.0-20250106144421-5f5ef82da422/go.mod h1:b6h1vNKhxaSoEI+5jc3PJUCustfli/mRab7295pY7rw= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f h1:OxYkA3wjPsZyBylwymxSHa7ViiW1Sml4ToBrncvFehI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f/go.mod h1:+2Yz8+CLJbIfL9z73EW45avw8Lmge3xVElCP9zEKi50= +google.golang.org/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg= +google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= +google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= -gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -444,15 +253,11 @@ gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -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= -gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= -gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -pgregory.net/rapid v0.5.5 h1:jkgx1TjbQPD/feRoK+S/mXw9e1uj6WilpHrXJowi6oA= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= +gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= +pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= +pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/core/header/service.go b/core/header/service.go index 982b9a049c15..cce7e6de30c5 100644 --- a/core/header/service.go +++ b/core/header/service.go @@ -16,4 +16,5 @@ type Info struct { Hash []byte // Hash returns the hash of the block header Time time.Time // Time returns the time of the block ChainID string // ChainId returns the chain ID of the block + AppHash []byte // AppHash used in the current block header } diff --git a/core/internal/buf.gen.yaml b/core/internal/buf.gen.yaml deleted file mode 100644 index f4e31b03e8ae..000000000000 --- a/core/internal/buf.gen.yaml +++ /dev/null @@ -1,11 +0,0 @@ -version: v1 -managed: - enabled: true - go_package_prefix: - default: cosmossdk.io/core/internal - override: - buf.build/cosmos/cosmos-sdk: cosmossdk.io/api -plugins: - - name: go-pulsar - out: . - opt: paths=source_relative diff --git a/core/internal/registry.go b/core/internal/registry.go deleted file mode 100644 index ce8dbb203f17..000000000000 --- a/core/internal/registry.go +++ /dev/null @@ -1,58 +0,0 @@ -package internal - -import ( - "fmt" - "reflect" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - - appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" -) - -// ModuleRegistry is the registry of module initializers indexed by their golang -// type to avoid any issues with protobuf descriptor initialization. -var ModuleRegistry = map[reflect.Type]*ModuleInitializer{} - -// ModuleInitializer describes how to initialize a module. -type ModuleInitializer struct { - ConfigGoType reflect.Type - ConfigProtoMessage proto.Message - Error error - Providers []interface{} - Invokers []interface{} -} - -// ModulesByProtoMessageName should be used to retrieve modules by their protobuf name. -// This is done lazily after module registration to deal with non-deterministic issues -// that can occur with respect to protobuf descriptor initialization. -func ModulesByProtoMessageName() (map[protoreflect.FullName]*ModuleInitializer, error) { - res := map[protoreflect.FullName]*ModuleInitializer{} - - for _, initializer := range ModuleRegistry { - descriptor := initializer.ConfigProtoMessage.ProtoReflect().Descriptor() - fullName := descriptor.FullName() - if _, ok := res[fullName]; ok { - return nil, fmt.Errorf("duplicate module registratio for %s", fullName) - } - - modDesc := proto.GetExtension(descriptor.Options(), appv1alpha1.E_Module).(*appv1alpha1.ModuleDescriptor) - if modDesc == nil { - return nil, fmt.Errorf( - "protobuf type %s registered as a module should have the option %s", - fullName, - appv1alpha1.E_Module.TypeDescriptor().FullName()) - } - - if modDesc.GoImport == "" { - return nil, fmt.Errorf( - "protobuf type %s registered as a module should have ModuleDescriptor.go_import specified", - fullName, - ) - } - - res[fullName] = initializer - } - - return res, nil -} diff --git a/core/sonar-project.properties b/core/sonar-project.properties deleted file mode 100644 index c5d84a78ed11..000000000000 --- a/core/sonar-project.properties +++ /dev/null @@ -1,14 +0,0 @@ -sonar.projectKey=cosmos-sdk-core -sonar.organization=cosmos - -sonar.projectName=Cosmos SDK - Core -sonar.project.monorepo.enabled=true - -sonar.sources=. -sonar.exclusions=**/*_test.go,**/*.pulsar.go -sonar.tests=. -sonar.test.inclusions=**/*_test.go -sonar.go.coverage.reportPaths=coverage.out - -sonar.sourceEncoding=UTF-8 -sonar.scm.provider=git \ No newline at end of file diff --git a/crypto/armor.go b/crypto/armor.go index ee858f43f4e5..aab662161c1a 100644 --- a/crypto/armor.go +++ b/crypto/armor.go @@ -8,10 +8,10 @@ import ( "github.com/cometbft/cometbft/crypto" "golang.org/x/crypto/argon2" + "golang.org/x/crypto/chacha20poly1305" "golang.org/x/crypto/openpgp/armor" //nolint:staticcheck //TODO: remove this dependency errorsmod "cosmossdk.io/errors" - "golang.org/x/crypto/chacha20poly1305" "github.com/cosmos/cosmos-sdk/codec/legacy" "github.com/cosmos/cosmos-sdk/crypto/keys/bcrypt" diff --git a/crypto/armor_test.go b/crypto/armor_test.go index 0533aec90837..f774165ae4d8 100644 --- a/crypto/armor_test.go +++ b/crypto/armor_test.go @@ -8,16 +8,15 @@ import ( "testing" cmtcrypto "github.com/cometbft/cometbft/crypto" - "github.com/cosmos/cosmos-sdk/crypto/xsalsa20symmetric" - - _ "github.com/cosmos/cosmos-sdk/runtime" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "cosmossdk.io/core/address" "cosmossdk.io/depinject" "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/codec" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/codec/legacy" "github.com/cosmos/cosmos-sdk/crypto" "github.com/cosmos/cosmos-sdk/crypto/hd" @@ -25,6 +24,8 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/bcrypt" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + "github.com/cosmos/cosmos-sdk/crypto/xsalsa20symmetric" + "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/testutil/configurator" "github.com/cosmos/cosmos-sdk/types" ) @@ -81,7 +82,11 @@ func TestArmorUnarmorPubKey(t *testing.T) { err := depinject.Inject(depinject.Configs( configurator.NewAppConfig(), - depinject.Supply(log.NewNopLogger()), + depinject.Supply(log.NewNopLogger(), + func() address.Codec { return addresscodec.NewBech32Codec("cosmos") }, + func() runtime.ValidatorAddressCodec { return addresscodec.NewBech32Codec("cosmosvaloper") }, + func() runtime.ConsensusAddressCodec { return addresscodec.NewBech32Codec("cosmosvalcons") }, + ), ), &cdc) require.NoError(t, err) diff --git a/crypto/hd/hdpath_test.go b/crypto/hd/hdpath_test.go index cce81df86f20..7b9816fd0bc7 100644 --- a/crypto/hd/hdpath_test.go +++ b/crypto/hd/hdpath_test.go @@ -1,7 +1,6 @@ package hd_test import ( - "encoding/hex" "fmt" "testing" @@ -185,6 +184,7 @@ func TestDeriveHDPathRange(t *testing.T) { } } +/* func ExampleStringifyPathParams() { //nolint:govet // ignore naming convention path := hd.NewParams(44, 0, 0, false, 0) fmt.Println(path.String()) @@ -280,6 +280,7 @@ func ExampleSomeBIP32TestVecs() { //nolint:govet // ignore naming convention // // c4c11d8c03625515905d7e89d25dfc66126fbc629ecca6db489a1a72fc4bda78 } +*/ // Ensuring that we don't crash if values have trailing slashes // See issue https://github.com/cosmos/cosmos-sdk/issues/8557. diff --git a/crypto/keyring/autocli.go b/crypto/keyring/autocli.go new file mode 100644 index 000000000000..0dd91ff60a43 --- /dev/null +++ b/crypto/keyring/autocli.go @@ -0,0 +1,86 @@ +package keyring + +import ( + signingv1beta1 "cosmossdk.io/api/cosmos/tx/signing/v1beta1" + + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" +) + +// autoCLIKeyring represents the keyring interface used by the AutoCLI. +// It purposely does not import the AutoCLI package to avoid circular dependencies. +type autoCLIKeyring interface { + // List returns the names of all keys stored in the keyring. + List() ([]string, error) + + // LookupAddressByKeyName returns the address of the key with the given name. + LookupAddressByKeyName(name string) ([]byte, error) + + // GetPubKey returns the public key of the key with the given name. + GetPubKey(name string) (cryptotypes.PubKey, error) + + // Sign signs the given bytes with the key with the given name. + Sign(name string, msg []byte, signMode signingv1beta1.SignMode) ([]byte, error) +} + +// NewAutoCLIKeyring wraps the SDK keyring and make it compatible with the AutoCLI keyring interfaces. +func NewAutoCLIKeyring(kr Keyring) (autoCLIKeyring, error) { + return &autoCLIKeyringAdapter{kr}, nil +} + +type autoCLIKeyringAdapter struct { + Keyring +} + +func (a *autoCLIKeyringAdapter) List() ([]string, error) { + list, err := a.Keyring.List() + if err != nil { + return nil, err + } + + names := make([]string, len(list)) + for i, key := range list { + names[i] = key.Name + } + + return names, nil +} + +// LookupAddressByKeyName returns the address of a key stored in the keyring +func (a *autoCLIKeyringAdapter) LookupAddressByKeyName(name string) ([]byte, error) { + record, err := a.Keyring.Key(name) + if err != nil { + return nil, err + } + + addr, err := record.GetAddress() + if err != nil { + return nil, err + } + + return addr, nil +} + +func (a *autoCLIKeyringAdapter) GetPubKey(name string) (cryptotypes.PubKey, error) { + record, err := a.Keyring.Key(name) + if err != nil { + return nil, err + } + + return record.GetPubKey() +} + +func (a *autoCLIKeyringAdapter) Sign(name string, msg []byte, signMode signingv1beta1.SignMode) ([]byte, error) { + record, err := a.Keyring.Key(name) + if err != nil { + return nil, err + } + + sdkSignMode, err := authsigning.APISignModeToInternal(signMode) + if err != nil { + return nil, err + } + + signBytes, _, err := a.Keyring.Sign(record.Name, msg, sdkSignMode) + return signBytes, err +} diff --git a/crypto/keyring/doc.go b/crypto/keyring/doc.go index a3bc8d8824ac..87a9e0908b36 100644 --- a/crypto/keyring/doc.go +++ b/crypto/keyring/doc.go @@ -33,6 +33,8 @@ // https://github.com/KDE/kwallet // pass This backend uses the pass command line utility to store and retrieve keys: // https://www.passwordstore.org/ +// keyctl This backend leverages the Linux's kernel security key management system +// to store cryptographic keys securely in memory. This is available on Linux only. // test This backend stores keys insecurely to disk. It does not prompt for a password to // be unlocked and it should be used only for testing purposes. // memory Same instance as returned by NewInMemory. This backend uses a transient storage. Keys diff --git a/crypto/keyring/keyring.go b/crypto/keyring/keyring.go index 8610cbf1473d..6598aa88738f 100644 --- a/crypto/keyring/keyring.go +++ b/crypto/keyring/keyring.go @@ -12,13 +12,11 @@ import ( "github.com/99designs/keyring" "github.com/cockroachdb/errors" - "github.com/cosmos/go-bip39" + "golang.org/x/crypto/bcrypt" errorsmod "cosmossdk.io/errors" - "golang.org/x/crypto/bcrypt" - "github.com/cosmos/cosmos-sdk/client/input" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/crypto" @@ -47,6 +45,8 @@ const ( // temporary pass phrase for exporting a key during a key rename passPhrase = "temp" + // prefix for exported hex private keys + hexPrefix = "0x" ) var ( @@ -117,7 +117,8 @@ type Signer interface { type Importer interface { // ImportPrivKey imports ASCII armored passphrase-encrypted private keys. ImportPrivKey(uid, armor, passphrase string) error - + // ImportPrivKeyHex imports hex encoded keys. + ImportPrivKeyHex(uid, privKey, algoStr string) error // ImportPubKey imports ASCII armored public keys. ImportPubKey(uid, armor string) error } @@ -142,23 +143,6 @@ type Exporter interface { // Option overrides keyring configuration options. type Option func(options *Options) -// Options define the options of the Keyring. -type Options struct { - // supported signing algorithms for keyring - SupportedAlgos SigningAlgoList - // supported signing algorithms for Ledger - SupportedAlgosLedger SigningAlgoList - // define Ledger Derivation function - LedgerDerivation func() (ledger.SECP256K1, error) - // define Ledger key generation function - LedgerCreateKey func([]byte) types.PubKey - // define Ledger app name - LedgerAppName string - // indicate whether Ledger should skip DER Conversion on signature, - // depending on which format (DER or BER) the Ledger app returns signatures - LedgerSigSkipDERConv bool -} - // NewInMemory creates a transient keyring useful for testing // purposes and on-the-fly key generation. // Keybase options can be applied when generating this new Keybase. @@ -175,7 +159,7 @@ func NewInMemoryWithKeyring(kr keyring.Keyring, cdc codec.Codec, opts ...Option) // New creates a new instance of a keyring. // Keyring options can be applied when generating the new instance. // Available backends are "os", "file", "kwallet", "memory", "pass", "test". -func New( +func newKeyringGeneric( appName, backend, rootDir string, userInput io.Reader, cdc codec.Codec, opts ...Option, ) (Keyring, error) { var ( @@ -337,6 +321,29 @@ func (ks keystore) ImportPrivKey(uid, armor, passphrase string) error { return nil } +func (ks keystore) ImportPrivKeyHex(uid, privKey, algoStr string) error { + if _, err := ks.Key(uid); err == nil { + return errorsmod.Wrap(ErrOverwriteKey, uid) + } + if privKey[:2] == hexPrefix { + privKey = privKey[2:] + } + decodedPriv, err := hex.DecodeString(privKey) + if err != nil { + return err + } + algo, err := NewSigningAlgoFromString(algoStr, ks.options.SupportedAlgos) + if err != nil { + return err + } + priv := algo.Generate()(decodedPriv) + _, err = ks.writeLocalKey(uid, priv) + if err != nil { + return err + } + return nil +} + func (ks keystore) ImportPubKey(uid, armor string) error { if _, err := ks.Key(uid); err == nil { return errorsmod.Wrap(ErrOverwriteKey, uid) @@ -610,6 +617,14 @@ func SignWithLedger(k *Record, msg []byte, signMode signing.SignMode) (sig []byt if err != nil { return } + ledgerPubKey := priv.PubKey() + pubKey, err := k.GetPubKey() + if err != nil { + return nil, nil, err + } + if !pubKey.Equals(ledgerPubKey) { + return nil, nil, fmt.Errorf("the public key that the user attempted to sign with does not match the public key on the ledger device. %v does not match %v", pubKey.String(), ledgerPubKey.String()) + } switch signMode { case signing.SignMode_SIGN_MODE_TEXTUAL: @@ -892,7 +907,7 @@ func (ks keystore) MigrateAll() ([]*Record, error) { rec, err := ks.migrate(key) if err != nil { - fmt.Printf("migrate err for key %s: %q\n", key, err) + fmt.Fprintf(os.Stderr, "migrate err for key %s: %q\n", key, err) continue } @@ -962,7 +977,7 @@ func (ks keystore) migrate(key string) (*Record, error) { return nil, errorsmod.Wrap(err, "unable to set keyring.Item") } - fmt.Printf("Successfully migrated key %s.\n", key) + fmt.Fprintf(os.Stderr, "Successfully migrated key %s.\n", key) return k, nil } diff --git a/crypto/keyring/keyring_ledger_test.go b/crypto/keyring/keyring_ledger_test.go index ca1b79bfbf99..0b123bd20eae 100644 --- a/crypto/keyring/keyring_ledger_test.go +++ b/crypto/keyring/keyring_ledger_test.go @@ -8,9 +8,13 @@ import ( "testing" "github.com/cockroachdb/errors" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/crypto/hd" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" + "github.com/cosmos/cosmos-sdk/crypto/ledger" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/tx/signing" ) @@ -133,3 +137,65 @@ func TestAltKeyring_SaveLedgerKey(t *testing.T) { path := ledgerInfo.GetPath() require.Equal(t, "m/44'/118'/3'/0/1", path.String()) } + +func TestSignWithLedger(t *testing.T) { + // Create two distinct Ledger records: recordA and recordB. + // RecordA is added to the Ledger but recordB is not added. + pathA := hd.NewFundraiserParams(0, types.CoinType, 0) + privA, _, err := ledger.NewPrivKeySecp256k1(*pathA, "cosmos") + require.NoError(t, err) + recordA, err := NewLedgerRecord("ledgerA", privA.PubKey(), pathA) + require.NoError(t, err) + pubA, err := recordA.GetPubKey() + require.NoError(t, err) + + pathB := hd.NewFundraiserParams(0, types.CoinType, 1) + // privB won't be added to the Ledger because it doesn't use ledger.NewPrivKeySecp256k1 + privB := secp256k1.GenPrivKey() + recordB, err := NewLedgerRecord("ledgerB", privB.PubKey(), pathB) + require.NoError(t, err) + pubB, err := recordB.GetPubKey() + require.NoError(t, err) + + require.NotEqual(t, pubA, pubB) + type testCase struct { + name string + record *Record + msg []byte + wantSig []byte + wantPub cryptotypes.PubKey + wantErr bool + wantErrContains string + } + testCases := []testCase{ + { + name: "ordinary ledger tx", + record: recordA, + msg: []byte("msg"), + wantSig: []byte{0xfb, 0x93, 0x1b, 0xb9, 0x75, 0x25, 0xe7, 0x99, 0x64, 0xc2, 0x78, 0xf7, 0x94, 0x9a, 0x63, 0x83, 0xe2, 0x59, 0x76, 0x48, 0x1d, 0x2, 0xbc, 0xc2, 0x83, 0x21, 0x24, 0x4b, 0x95, 0x99, 0x25, 0x8b, 0x30, 0x38, 0x6, 0x61, 0x79, 0x9a, 0x9e, 0x8, 0x98, 0xfd, 0x34, 0xc6, 0x7e, 0x47, 0x4d, 0x5f, 0xe, 0xf3, 0xc3, 0xe7, 0xdd, 0xe3, 0x89, 0x80, 0xda, 0x8b, 0x48, 0x15, 0x34, 0xce, 0xdf, 0x1c}, + wantPub: pubA, + wantErr: false, + }, + { + name: "want error when the public key the user attempted to sign with doesn't match the public key on the ledger", + record: recordB, + msg: []byte("msg"), + wantSig: []byte(nil), + wantPub: nil, + wantErr: true, + wantErrContains: "the public key that the user attempted to sign with does not match the public key on the ledger device", + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + sig, pub, err := SignWithLedger(tc.record, tc.msg, signing.SignMode_SIGN_MODE_LEGACY_AMINO_JSON) + assert.Equal(t, tc.wantSig, sig) + assert.Equal(t, tc.wantPub, pub) + if tc.wantErr { + assert.Error(t, err) + assert.Contains(t, err.Error(), tc.wantErrContains) + } + }) + } +} diff --git a/crypto/keyring/keyring_linux.go b/crypto/keyring/keyring_linux.go new file mode 100644 index 000000000000..7db47961bab1 --- /dev/null +++ b/crypto/keyring/keyring_linux.go @@ -0,0 +1,84 @@ +//go:build linux +// +build linux + +package keyring + +import ( + "fmt" + "io" + + "github.com/99designs/keyring" + + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/crypto/ledger" + "github.com/cosmos/cosmos-sdk/crypto/types" +) + +// Linux-only backend options. +const BackendKeyctl = "keyctl" + +func KeyctlScopeUser(options *Options) { setKeyctlScope(options, "user") } +func KeyctlScopeUserSession(options *Options) { setKeyctlScope(options, "usersession") } +func KeyctlScopeSession(options *Options) { setKeyctlScope(options, "session") } +func KeyctlScopeProcess(options *Options) { setKeyctlScope(options, "process") } +func KeyctlScopeThread(options *Options) { setKeyctlScope(options, "thread") } + +// Options define the options of the Keyring. +type Options struct { + // supported signing algorithms for keyring + SupportedAlgos SigningAlgoList + // supported signing algorithms for Ledger + SupportedAlgosLedger SigningAlgoList + // define Ledger Derivation function + LedgerDerivation func() (ledger.SECP256K1, error) + // define Ledger key generation function + LedgerCreateKey func([]byte) types.PubKey + // define Ledger app name + LedgerAppName string + // indicate whether Ledger should skip DER Conversion on signature, + // depending on which format (DER or BER) the Ledger app returns signatures + LedgerSigSkipDERConv bool + // KeyctlScope defines the scope of the keyctl's keyring. + KeyctlScope string +} + +func newKeyctlBackendConfig(appName, _ string, _ io.Reader, opts ...Option) keyring.Config { + options := Options{ + KeyctlScope: keyctlDefaultScope, // currently "process" + } + + for _, optionFn := range opts { + optionFn(&options) + } + + return keyring.Config{ + AllowedBackends: []keyring.BackendType{keyring.KeyCtlBackend}, + ServiceName: appName, + KeyCtlScope: options.KeyctlScope, + } +} + +// New creates a new instance of a keyring. +// Keyring options can be applied when generating the new instance. +// Available backends are "os", "file", "kwallet", "memory", "pass", "test", "keyctl". +func New( + appName, backend, rootDir string, userInput io.Reader, cdc codec.Codec, opts ...Option, +) (Keyring, error) { + if backend != BackendKeyctl { + return newKeyringGeneric(appName, backend, rootDir, userInput, cdc, opts...) + } + + db, err := keyring.Open(newKeyctlBackendConfig(appName, "", userInput, opts...)) + if err != nil { + return nil, fmt.Errorf("couldn't open keyring for %q: %w", appName, err) + } + + return newKeystore(db, cdc, backend, opts...), nil +} + +func setKeyctlScope(options *Options, scope string) { options.KeyctlScope = scope } + +// this is private as it is meant to be here for SDK devs convenience +// as the user does not need to pick any default when he wants to +// initialize keyctl with the default scope. +const keyctlDefaultScope = "process" diff --git a/crypto/keyring/keyring_linux_test.go b/crypto/keyring/keyring_linux_test.go new file mode 100644 index 000000000000..a6695b6b9471 --- /dev/null +++ b/crypto/keyring/keyring_linux_test.go @@ -0,0 +1,51 @@ +//go:build linux +// +build linux + +package keyring + +import ( + "errors" + "io" + "strings" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/cosmos/cosmos-sdk/codec" +) + +func TestNewKeyctlKeyring(t *testing.T) { + cdc := getCodec() + + tests := []struct { + name string + appName string + backend string + dir string + userInput io.Reader + cdc codec.Codec + expectedErr error + }{ + { + name: "keyctl backend", + appName: "cosmos", + backend: BackendKeyctl, + dir: t.TempDir(), + userInput: strings.NewReader(""), + cdc: cdc, + expectedErr: nil, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + kr, err := New(tt.appName, tt.backend, tt.dir, tt.userInput, tt.cdc) + if tt.expectedErr == nil { + require.NoError(t, err) + } else { + require.Error(t, err) + require.Nil(t, kr) + require.True(t, errors.Is(err, tt.expectedErr)) + } + }) + } +} diff --git a/crypto/keyring/keyring_other.go b/crypto/keyring/keyring_other.go new file mode 100644 index 000000000000..9c25a1e954e2 --- /dev/null +++ b/crypto/keyring/keyring_other.go @@ -0,0 +1,35 @@ +//go:build !linux +// +build !linux + +package keyring + +import ( + "io" + + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/crypto/ledger" + "github.com/cosmos/cosmos-sdk/crypto/types" +) + +// Options define the options of the Keyring. +type Options struct { + // supported signing algorithms for keyring + SupportedAlgos SigningAlgoList + // supported signing algorithms for Ledger + SupportedAlgosLedger SigningAlgoList + // define Ledger Derivation function + LedgerDerivation func() (ledger.SECP256K1, error) + // define Ledger key generation function + LedgerCreateKey func([]byte) types.PubKey + // define Ledger app name + LedgerAppName string + // indicate whether Ledger should skip DER Conversion on signature, + // depending on which format (DER or BER) the Ledger app returns signatures + LedgerSigSkipDERConv bool +} + +func New( + appName, backend, rootDir string, userInput io.Reader, cdc codec.Codec, opts ...Option, +) (Keyring, error) { + return newKeyringGeneric(appName, backend, rootDir, userInput, cdc, opts...) +} diff --git a/crypto/keyring/keyring_test.go b/crypto/keyring/keyring_test.go index e89b0ff24652..05d58981d7b4 100644 --- a/crypto/keyring/keyring_test.go +++ b/crypto/keyring/keyring_test.go @@ -564,7 +564,65 @@ func TestImportPrivKey(t *testing.T) { } } -func TestExportImportPrivKey(t *testing.T) { +func TestImportPrivKeyHex(t *testing.T) { + cdc := getCodec() + tests := []struct { + name string + uid string + backend string + hexKey string + algo string + expectedErr error + }{ + { + name: "correct import", + uid: "hexImport", + backend: BackendTest, + hexKey: "0xa3e57952e835ed30eea86a2993ac2a61c03e74f2085b3635bd94aa4d7ae0cfdf", + algo: "secp256k1", + expectedErr: nil, + }, + { + name: "correct import without prefix", + uid: "hexImport", + backend: BackendTest, + hexKey: "a3e57952e835ed30eea86a2993ac2a61c03e74f2085b3635bd94aa4d7ae0cfdf", + algo: "secp256k1", + expectedErr: nil, + }, + { + name: "wrong hex length", + uid: "hexImport", + backend: BackendTest, + hexKey: "0xae57952e835ed30eea86a2993ac2a61c03e74f2085b3635bd94aa4d7ae0cfdf", + algo: "secp256k1", + expectedErr: hex.ErrLength, + }, + { + name: "unsupported algo", + uid: "hexImport", + backend: BackendTest, + hexKey: "0xa3e57952e835ed30eea86a2993ac2a61c03e74f2085b3635bd94aa4d7ae0cfdf", + algo: "notSupportedAlgo", + expectedErr: ErrUnsupportedSigningAlgo, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + kb, err := New("TestExport", tt.backend, t.TempDir(), nil, cdc) + require.NoError(t, err) + err = kb.ImportPrivKeyHex(tt.uid, tt.hexKey, tt.algo) + if tt.expectedErr == nil { + require.NoError(t, err) + } else { + require.Error(t, err) + require.True(t, errors.Is(err, tt.expectedErr)) + } + }) + } +} + +func TestExportImportPrivKeyArmor(t *testing.T) { cdc := getCodec() tests := []struct { name string diff --git a/crypto/keyring/migration_test.go b/crypto/keyring/migration_test.go index 1e07fd16772e..a8ddee925acb 100644 --- a/crypto/keyring/migration_test.go +++ b/crypto/keyring/migration_test.go @@ -7,11 +7,10 @@ import ( "github.com/99designs/keyring" "github.com/stretchr/testify/suite" - "github.com/cosmos/cosmos-sdk/codec/legacy" - "github.com/cosmos/cosmos-sdk/crypto/hd" - errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/codec/legacy" + "github.com/cosmos/cosmos-sdk/crypto/hd" "github.com/cosmos/cosmos-sdk/crypto/keys/multisig" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" diff --git a/crypto/keyring/record_test.go b/crypto/keyring/record_test.go index 2ec0401d87ff..fdc5c661e563 100644 --- a/crypto/keyring/record_test.go +++ b/crypto/keyring/record_test.go @@ -4,13 +4,12 @@ import ( "strings" "testing" - "github.com/cosmos/cosmos-sdk/codec" "github.com/stretchr/testify/suite" + "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/crypto/hd" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" ) diff --git a/crypto/keys/bcrypt/bcrypt.go b/crypto/keys/bcrypt/bcrypt.go index 9badc4670cd1..f4f62d500cf7 100644 --- a/crypto/keys/bcrypt/bcrypt.go +++ b/crypto/keys/bcrypt/bcrypt.go @@ -8,6 +8,7 @@ package bcrypt // The code is a port of Provos and Mazières's C implementation. + import ( "crypto/subtle" "errors" diff --git a/crypto/keys/ed25519/ed25519.go b/crypto/keys/ed25519/ed25519.go index 122be97cb254..680b9f070095 100644 --- a/crypto/keys/ed25519/ed25519.go +++ b/crypto/keys/ed25519/ed25519.go @@ -33,7 +33,7 @@ const ( // private key representations used by RFC 8032. SeedSize = 32 - keyType = "ed25519" + KeyType = "ed25519" ) var ( @@ -91,7 +91,7 @@ func (privKey *PrivKey) Equals(other cryptotypes.LedgerPrivKey) bool { } func (privKey *PrivKey) Type() string { - return keyType + return KeyType } // MarshalAmino overrides Amino binary marshaling. @@ -192,7 +192,7 @@ func (pubKey *PubKey) String() string { } func (pubKey *PubKey) Type() string { - return keyType + return KeyType } func (pubKey *PubKey) Equals(other cryptotypes.PubKey) bool { diff --git a/crypto/keys/multisig/multisig_test.go b/crypto/keys/multisig/multisig_test.go index 9c02fe6e1550..3fa46e35d0b6 100644 --- a/crypto/keys/multisig/multisig_test.go +++ b/crypto/keys/multisig/multisig_test.go @@ -6,10 +6,12 @@ import ( "github.com/stretchr/testify/require" + "cosmossdk.io/core/address" "cosmossdk.io/depinject" "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/codec" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/codec/legacy" "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" @@ -17,7 +19,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/crypto/types/multisig" - _ "github.com/cosmos/cosmos-sdk/runtime" + "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/testutil/configurator" "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" @@ -359,7 +361,11 @@ func TestDisplay(t *testing.T) { err := depinject.Inject( depinject.Configs( configurator.NewAppConfig(), - depinject.Supply(log.NewNopLogger()), + depinject.Supply(log.NewNopLogger(), + func() address.Codec { return addresscodec.NewBech32Codec("cosmos") }, + func() runtime.ValidatorAddressCodec { return addresscodec.NewBech32Codec("cosmosvaloper") }, + func() runtime.ConsensusAddressCodec { return addresscodec.NewBech32Codec("cosmosvalcons") }, + ), ), &cdc) require.NoError(err) bz, err := cdc.MarshalInterfaceJSON(msig) diff --git a/crypto/keys/secp256k1/secp256k1.go b/crypto/keys/secp256k1/secp256k1.go index a4860fbb9240..c9c4864339b2 100644 --- a/crypto/keys/secp256k1/secp256k1.go +++ b/crypto/keys/secp256k1/secp256k1.go @@ -8,11 +8,12 @@ import ( "io" "math/big" - errorsmod "cosmossdk.io/errors" "github.com/cometbft/cometbft/crypto" secp256k1 "github.com/decred/dcrd/dcrec/secp256k1/v4" "golang.org/x/crypto/ripemd160" //nolint: staticcheck // keep around for backwards compatibility + errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/codec" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/types/errors" diff --git a/crypto/keys/secp256k1/secp256k1_nocgo.go b/crypto/keys/secp256k1/secp256k1_nocgo.go index db66325f0bf4..fff3ba5e0544 100644 --- a/crypto/keys/secp256k1/secp256k1_nocgo.go +++ b/crypto/keys/secp256k1/secp256k1_nocgo.go @@ -6,10 +6,9 @@ package secp256k1 import ( "errors" + "github.com/cometbft/cometbft/crypto" secp256k1 "github.com/decred/dcrd/dcrec/secp256k1/v4" "github.com/decred/dcrd/dcrec/secp256k1/v4/ecdsa" - - "github.com/cometbft/cometbft/crypto" ) // Sign creates an ECDSA signature on curve Secp256k1, using SHA256 on the msg. diff --git a/crypto/keys/secp256r1/privkey.go b/crypto/keys/secp256r1/privkey.go index c6702111c738..3080dec21785 100644 --- a/crypto/keys/secp256r1/privkey.go +++ b/crypto/keys/secp256r1/privkey.go @@ -1,10 +1,14 @@ package secp256r1 import ( + "encoding/base64" + "github.com/cosmos/cosmos-sdk/crypto/keys/internal/ecdsa" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" ) +var _ customProtobufType = (*ecdsaSK)(nil) + // GenPrivKey generates a new secp256r1 private key. It uses operating system randomness. func GenPrivKey() (*PrivKey, error) { key, err := ecdsa.GenPrivKey(secp256r1) @@ -52,6 +56,27 @@ type ecdsaSK struct { ecdsa.PrivKey } +// Marshal implements customProtobufType. +func (sk ecdsaSK) Marshal() ([]byte, error) { + return sk.PrivKey.Bytes(), nil +} + +// MarshalJSON implements customProtobufType. +func (sk ecdsaSK) MarshalJSON() ([]byte, error) { + b64 := base64.StdEncoding.EncodeToString(sk.PrivKey.Bytes()) + return []byte("\"" + b64 + "\""), nil +} + +// UnmarshalJSON implements customProtobufType. +func (sk *ecdsaSK) UnmarshalJSON(data []byte) error { + bz, err := base64.StdEncoding.DecodeString(string(data[1 : len(data)-1])) + if err != nil { + return err + } + + return sk.PrivKey.Unmarshal(bz, secp256r1, fieldSize) +} + // Size implements proto.Marshaler interface func (sk *ecdsaSK) Size() int { if sk == nil { diff --git a/crypto/keys/secp256r1/privkey_internal_test.go b/crypto/keys/secp256r1/privkey_internal_test.go index 902ee6dafbf8..52ea3239dac6 100644 --- a/crypto/keys/secp256r1/privkey_internal_test.go +++ b/crypto/keys/secp256r1/privkey_internal_test.go @@ -113,3 +113,14 @@ func (suite *SKSuite) TestSize() { var nilPk *ecdsaSK require.Equal(0, nilPk.Size(), "nil value must have zero size") } + +func (suite *SKSuite) TestJson() { + require := suite.Require() + asd := suite.sk.(*PrivKey) + bz, err := asd.Secret.MarshalJSON() + require.NoError(err) + + sk := &ecdsaSK{} + require.NoError(sk.UnmarshalJSON(bz)) + require.Equal(suite.sk.(*PrivKey).Secret, sk) +} diff --git a/crypto/keys/secp256r1/pubkey.go b/crypto/keys/secp256r1/pubkey.go index cacec514c3d7..fea06f73f201 100644 --- a/crypto/keys/secp256r1/pubkey.go +++ b/crypto/keys/secp256r1/pubkey.go @@ -1,6 +1,8 @@ package secp256r1 import ( + "encoding/base64" + cmtcrypto "github.com/cometbft/cometbft/crypto" "github.com/cosmos/gogoproto/proto" @@ -8,6 +10,20 @@ import ( cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" ) +// customProtobufType is here to make sure that ecdsaPK and ecdsaSK implement the +// gogoproto customtype interface. +type customProtobufType interface { + Marshal() ([]byte, error) + MarshalTo(data []byte) (n int, err error) + Unmarshal(data []byte) error + Size() int + + MarshalJSON() ([]byte, error) + UnmarshalJSON(data []byte) error +} + +var _ customProtobufType = (*ecdsaPK)(nil) + // String implements proto.Message interface. func (m *PubKey) String() string { return m.Key.String(name) @@ -49,6 +65,28 @@ type ecdsaPK struct { ecdsa.PubKey } +// Marshal implements customProtobufType. +func (pk ecdsaPK) Marshal() ([]byte, error) { + return pk.PubKey.Bytes(), nil +} + +// MarshalJSON implements customProtobufType. +func (pk ecdsaPK) MarshalJSON() ([]byte, error) { + b64 := base64.StdEncoding.EncodeToString(pk.PubKey.Bytes()) + return []byte("\"" + b64 + "\""), nil +} + +// UnmarshalJSON implements customProtobufType. +func (pk *ecdsaPK) UnmarshalJSON(data []byte) error { + // the string is quoted so we need to remove them + bz, err := base64.StdEncoding.DecodeString(string(data[1 : len(data)-1])) + if err != nil { + return err + } + + return pk.PubKey.Unmarshal(bz, secp256r1, pubKeySize) +} + // Size implements proto.Marshaler interface func (pk *ecdsaPK) Size() int { if pk == nil { diff --git a/crypto/keys/secp256r1/pubkey_internal_test.go b/crypto/keys/secp256r1/pubkey_internal_test.go index d3d2ed3823eb..77f4a66e5114 100644 --- a/crypto/keys/secp256r1/pubkey_internal_test.go +++ b/crypto/keys/secp256r1/pubkey_internal_test.go @@ -126,3 +126,14 @@ func (suite *PKSuite) TestSize() { var nilPk *ecdsaPK require.Equal(0, nilPk.Size(), "nil value must have zero size") } + +func (suite *PKSuite) TestJson() { + require := suite.Require() + + bz, err := suite.pk.Key.MarshalJSON() + require.NoError(err) + + pk := &ecdsaPK{} + require.NoError(pk.UnmarshalJSON(bz)) + require.Equal(suite.pk.Key, pk) +} diff --git a/crypto/ledger/encode_test.go b/crypto/ledger/encode_test.go index b5b06d04f37c..6f428f879873 100644 --- a/crypto/ledger/encode_test.go +++ b/crypto/ledger/encode_test.go @@ -1,7 +1,6 @@ package ledger import ( - "os" "testing" "github.com/stretchr/testify/require" @@ -24,6 +23,7 @@ func checkAminoJSON(t *testing.T, src, dst interface{}, isNil bool) { require.Nil(t, err, "%+v", err) } +/* func ExamplePrintRegisteredTypes() { //nolint:govet // ignore for examples _ = cdc.PrintTypes(os.Stdout) // | Type | Name | Prefix | Length | Notes | @@ -37,6 +37,7 @@ func ExamplePrintRegisteredTypes() { //nolint:govet // ignore for examples // | PrivKey | tendermint/PrivKeySr25519 | 0x2F82D78B | variable | | // | PrivKey | tendermint/PrivKeySecp256k1 | 0xE1B0F79B | variable | | } +*/ func TestNilEncodings(t *testing.T) { // Check nil Signature. diff --git a/crypto/ledger/ledger_secp256k1.go b/crypto/ledger/ledger_secp256k1.go index 285e351f3b01..e0f4a4d94a99 100644 --- a/crypto/ledger/ledger_secp256k1.go +++ b/crypto/ledger/ledger_secp256k1.go @@ -331,7 +331,7 @@ func getPubKeyUnsafe(device SECP256K1, path hd.BIP44Params) (types.PubKey, error return options.createPubkey(compressedPublicKey), nil } -// getPubKeyAddr reads the pubkey and the address from a ledger device. +// getPubKeyAddrSafe reads the pubkey and the address from a ledger device. // This function is marked as Safe as it will require user confirmation and // account and index will be shown in the device. // @@ -340,7 +340,13 @@ func getPubKeyUnsafe(device SECP256K1, path hd.BIP44Params) (types.PubKey, error func getPubKeyAddrSafe(device SECP256K1, path hd.BIP44Params, hrp string) (types.PubKey, string, error) { publicKey, addr, err := device.GetAddressPubKeySECP256K1(path.DerivationPath(), hrp) if err != nil { - return nil, "", fmt.Errorf("%w: address rejected for path %s", err, path.String()) + // Check special case if user is trying to use an index > 100 + if path.AddressIndex > 100 { + return nil, "", fmt.Errorf("%w: cannot derive paths where index > 100: %s "+ + "This is a security measure to avoid very hard to find derivation paths introduced by a possible attacker. "+ + "You can disable this by setting expert mode in your ledger device. Do this at your own risk", err, path) + } + return nil, "", fmt.Errorf("%w: address rejected for path %s", err, path) } // re-serialize in the 33-byte compressed format diff --git a/crypto/xsalsa20symmetric/symmetric_test.go b/crypto/xsalsa20symmetric/symmetric_test.go index 0a7431671877..e80d48449890 100644 --- a/crypto/xsalsa20symmetric/symmetric_test.go +++ b/crypto/xsalsa20symmetric/symmetric_test.go @@ -6,7 +6,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "golang.org/x/crypto/bcrypt" ) diff --git a/depinject/CHANGELOG.md b/depinject/CHANGELOG.md new file mode 100644 index 000000000000..dfbafdd21103 --- /dev/null +++ b/depinject/CHANGELOG.md @@ -0,0 +1,37 @@ + + +# Changelog + +## [Unreleased] + +## 1.1.0 + +* [#22438](https://github.com/cosmos/cosmos-sdk/pull/22438) Unexported fields on `In` structs are now silently ignored instead of failing. + +## 1.0.0 + +* [#20540](https://github.com/cosmos/cosmos-sdk/pull/20540) Add support for defining `appconfig` module configuration types using `github.com/cosmos/gogoproto/proto` in addition to `google.golang.org/protobuf` so that users can use gogo proto across their stack. +* Move `cosmossdk.io/core/appconfig` to `cosmossdk.io/depinject/appconfig`. + +## 1.0.0-alpha.x + +Depinject is still in alpha stage even though its API is already quite stable. +There is no changelog during this stage. diff --git a/depinject/README.md b/depinject/README.md index 258e1e0b6347..383fad59c03a 100644 --- a/depinject/README.md +++ b/depinject/README.md @@ -12,15 +12,15 @@ sidebar_position: 1 `depinject` is particularly useful for developing blockchain applications: -* With multiple interdependent components, modules, or services. Helping manage their dependencies effectively. -* That require decoupling of these components, making it easier to test, modify, or replace individual parts without affecting the entire system. -* That are wanting to simplify the setup and initialisation of modules and their dependencies by reducing boilerplate code and automating dependency management. +* With multiple interdependent components, modules, or services. Helping manage their dependencies effectively. +* That require decoupling of these components, making it easier to test, modify, or replace individual parts without affecting the entire system. +* That are wanting to simplify the setup and initialisation of modules and their dependencies by reducing boilerplate code and automating dependency management. By using `depinject`, developers can achieve: -* Cleaner and more organised code. -* Improved modularity and maintainability. -* A more maintainable and modular structure for their blockchain applications, ultimately enhancing development velocity and code quality. +* Cleaner and more organised code. +* Improved modularity and maintainability. +* A more maintainable and modular structure for their blockchain applications, ultimately enhancing development velocity and code quality. * [Go Doc](https://pkg.go.dev/cosmossdk.io/depinject) @@ -38,41 +38,44 @@ Example: package main import ( - "fmt" + "fmt" - "cosmossdk.io/depinject" + "cosmossdk.io/depinject" ) type AnotherInt int +func GetInt() int { return 1 } +func GetAnotherInt() AnotherInt { return 2 } + func main() { - var ( - x int - y AnotherInt - ) - - fmt.Printf("Before (%v, %v)\n", x, y) - depinject.Inject( - depinject.Provide( - func() int { return 1 }, - func() AnotherInt { return AnotherInt(2) }, - ), - &x, - &y, - ) - fmt.Printf("After (%v, %v)\n", x, y) + var ( + x int + y AnotherInt + ) + + fmt.Printf("Before (%v, %v)\n", x, y) + depinject.Inject( + depinject.Provide( + GetInt, + GetAnotherInt, + ), + &x, + &y, + ) + fmt.Printf("After (%v, %v)\n", x, y) } ``` In this example, `depinject.Provide` registers two provider functions that return `int` and `AnotherInt` values. The `depinject.Inject` function is then used to inject these values into the variables `x` and `y`. -Provider functions serve as the basis for the dependency tree. They are analysed to identify their inputs as dependencies and their outputs as dependents. These dependents can either be used by another provider function or be stored outside the DI container (e.g., `&x` and `&y` in the example above). +Provider functions serve as the basis for the dependency tree. They are analysed to identify their inputs as dependencies and their outputs as dependents. These dependents can either be used by another provider function or be stored outside the DI container (e.g., `&x` and `&y` in the example above). Provider functions must be exported. ### Interface type resolution `depinject` supports the use of interface types as inputs to provider functions, which helps decouple dependencies between modules. This approach is particularly useful for managing complex systems with multiple modules, such as the Cosmos SDK, where dependencies need to be flexible and maintainable. -For example, `x/bank` expects an [AccountKeeper](https://pkg.go.dev/github.com/cosmos/cosmos-sdk/x/bank/types#AccountKeeper) interface as [input to ProvideModule](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/bank/module.go#L208-L260). `SimApp` uses the implementation in `x/auth`, but the modular design allows for easy changes to the implementation if needed. +For example, `x/bank` expects an [AccountKeeper](https://pkg.go.dev/cosmossdk.io/x/bank/types#AccountKeeper) interface as [input to ProvideModule](https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/x/bank/module.go#L208-L260). `SimApp` uses the implementation in `x/auth`, but the modular design allows for easy changes to the implementation if needed. Consider the following example: @@ -80,11 +83,11 @@ Consider the following example: package duck type Duck interface { - quack() + quack() } type AlsoDuck interface { - quack() + quack() } type Mallard struct{} @@ -94,7 +97,23 @@ func (duck Mallard) quack() {} func (duck Canvasback) quack() {} type Pond struct { - Duck AlsoDuck + Duck AlsoDuck +} +``` + +And the following provider functions: + +```go +func GetMallard() duck.Mallard { + return Mallard{} +} + +func GetPond(duck Duck) Pond { + return Pond{Duck: duck} +} + +func GetCanvasback() Canvasback { + return Canvasback{} } ``` @@ -105,10 +124,9 @@ var pond Pond depinject.Inject( depinject.Provide( - func() Mallard { return Mallard{} }, - func(duck Duck) Pond { - return Pond{Duck: duck} - }), + GetMallard, + GetPond, + ), &pond) ``` @@ -120,13 +138,12 @@ However, if there are multiple implementations of the `Duck` interface, as in th var pond Pond depinject.Inject( - depinject.Provide( - func() Mallard { return Mallard{} }, - func() Canvasback { return Canvasback{} }, - func(duck Duck) Pond { - return Pond{Duck: duck} - }), - &pond) + depinject.Provide( + GetMallard, + GetCanvasback, + GetPond, + ), + &pond) ``` A specific binding preference for `Duck` is required. @@ -137,20 +154,21 @@ In the above situation registering a binding for a given interface binding may l ```go depinject.Inject( - depinject.Configs( - depinject.BindInterface( - "duck.Duck", - "duck.Mallard"), - depinject.Provide( - func() Mallard { return Mallard{} }, - func() Canvasback { return Canvasback{} }, - func(duck Duck) APond { - return Pond{Duck: duck} - })), - &pond) + depinject.Configs( + depinject.BindInterface( + "duck/duck.Duck", + "duck/duck.Mallard", + ), + depinject.Provide( + GetMallard, + GetCanvasback, + GetPond, + ), + ), + &pond) ``` -Now `depinject` has enough information to provide `Mallard` as an input to `APond`. +Now `depinject` has enough information to provide `Mallard` as an input to `APond`. ### Full example in real app @@ -159,7 +177,7 @@ When using `depinject.Inject`, the injected types must be pointers. ::: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/app_v2.go#L219-L244 +https://github.com/cosmos/cosmos-sdk/blob/v0.52.0-beta.2/simapp/app_di.go#L187-L206 ``` ## Debugging diff --git a/depinject/appconfig/README.md b/depinject/appconfig/README.md new file mode 100644 index 000000000000..3bc3d371ea79 --- /dev/null +++ b/depinject/appconfig/README.md @@ -0,0 +1,232 @@ +# Wiring up app modules for use with appconfig + +The `appconfig` framework allows Cosmos SDK modules to be composed declaratively using a configuration file without +requiring the app developer to understand the details of inter-module dependencies. + +## 1. Create a module config protobuf message + +The first step in creating a module that works with `appconfig`, is to create a protobuf message for the module configuration. The best practices for defining the module configuration message are: + +* Use a dedicated protobuf package for the module configuration message instead of placing it in the API protobuf package. For example, the module configuration for bank would go in `cosmos.bank.module.v1` instead of just `cosmos.bank.v1`. This decouples the state machine version from the API version. +* The module configuration message is usually called simply `Module`, ex. `cosmos.bank.module.v1.Module`. +* Create a new protobuf package and configuration message for each state machine breaking version of the module, ex. `cosmos.bank.module.v2.Module`, etc. + +The module configuration message should include any parameters which should be initialized at application startup. For example, the auth module needs to know the bech32 prefix of the app and the permissions of module accounts. + +In the future, it may be possible to update the app config through a governance proposal at runtime. + +All module configuration messages should define a module descriptor, using the `cosmos.app.v1alpha1.module` message option. + +Here is an example module configuration message for the `auth` module: + +```protobuf +package cosmos.auth.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/auth" + }; + string bech32_prefix = 1; + repeated ModuleAccountPermission module_account_permissions = 2; +} +``` + +## 2. Register module depinject providers and invokers + +Once we have a module config object, we need to register depinject providers and invokers for the module using the `cosmossdk.io/core/appmodule` package. + +At the most basic level, we must define an `init` function in the package listed as the `go_import` in the module descriptor. This `init` function must call `appconfig.RegisterModule` with an empty instance of the config object and some options for initializing the module, ex: + +```go +func init() { + appconfig.RegisterModule(&modulev1.Module{}, + // options + ) +} +``` + +### `depinject` Provider and Invoker Basics + +A `depinject` "provider" is a function which takes dependencies from other modules as inputs and returns outputs for +other modules to use as dependencies. A `depinject` "invoker" is function which takes optional dependencies as inputs, +returns no outputs, and is run at the end of initializing the dependency graph. Providers are much more common than +invokers and should be the preferred method of wiring up modules when possible. Providers and invokers can be registered +for modules by using `appconfig.Provide` and `appconfig.Invoke` to create options which get passed +to `appconfig.RegisterModule` in the module `init` function, ex: + +```go +func init() { + appconfig.RegisterModule(&modulev1.Module{}, + appconfig.Provide(provideSomething, provideSomethingElse), + appconfig.Invoke(invokeSomething), + ) +} +``` + +### `depinject` Types + +`depinject` constructor functions support these classes of input and output parameter types: + +* regular golang types (with special treatment of interface types as input parameters) +* structs with `depinject.In` and `depinject.Out` embedded +* `depinject.OnePerModuleType`s +* `depinject.ManyPerContainerType`s +* `depinject.ModuleKey` (which can only be defined as an input type) +* `error` (which gets special treatment as an output type) + +#### Regular Golang Types + +Regular golang types (besides the special cases described above) can be provided as both input and output parameters +to providers and invokers. For `depinject` to match an output parameter of one provider to an input parameter of +another, there must be an exact match for the type unless the input parameter is an input type. For instance, if +a provider defines a dependency on `Foo` and some module provides `*Foo`, these two types will not match and there +will be an error. + +#### Interface Input Types + +When interfaces are used as input parameters to providers and invokers, `depinject` will search the container for +all types that implement this interface. If there is an unambiguously matching type, then this type will be used +to satisfy that interface. If there is a conflict between two types matching the interface, the app developer +can use `golang_bindings` options in their app config in order to resolve the conflict. + +#### Structs with embedded `depinject.In` and `depinject.Out` + +Structs that have `depinject.In` or `depinject.Out` as an embedded field are treated specially by `depinject`, where +all of these structs fields are treated as input or output parameters, respectively. These structs allow custom options +to be defined using struct field tags. Currently, the only supported custom option is `optional:"true"` which marks +a field as optional. + +#### `depinject.OnePerModuleType`s + +Any type which implements the `depinject.OnePerModuleType` interface can be provided at most once by every module. +These types can be collected as an input parameter to some provider or invoker by defining an input parameter which +is a map of module names as strings to this parameter type. For example if `Foo` is a `OnePerModuleType`, then +`map[string]Foo` can be declared as an input parameter by some provider (which obviously cannot provide an instance of +`Foo` itself because that would cause a circular dependency). + +`OnePerModuleType`s should be used whenever different modules may provide the type *and* there is a need to provide +an ordering of these types based on the module name. Generally, in blockchains there is always a need for deterministic +orderings so using module names to provide that ordering is generally a good strategy for this use case. Ordering based +on module names can either be done implicitly by sorting the module names or explicitly as a parameter in the module +configuration object. + +#### `depinject.ManyPerContainerType`s + +`ManyPerContainerType`s can be provided by as many providers in as many modules as the user would like. If a type `Bar` +is a `ManyPerContainerType`, a provider may define an output parameter of `Bar` or `[]Bar` to provide `Bar` instances +to the container. A provider may define an input parameter of `[]Bar` to get all of the `Bar` instances in the +container (such a provider may not also return `Bar` as that would cause a circular dependency). The ordering of `Bar` +instances in the `[]Bar` input type should be assumed to be deterministic. + +`ManyPerContainerType`s should be used only when 1) ordering is unimportant or 2) the ordering can be defined by +some parameter on the type. For instance, if `Bar` had a field `Name string`, that is supposed to be unique in the +container then that could be used to provide an ordering. An example of a type that could work as a +`ManyPerContainerType` in this way is a wrapper around `*cobra.Command`, ex. +`type QueryCommand struct {*cobra.Command}`. This could be used to collect all the query commands in an app and then +cobra would take care of ordering. If this type of ordering is not available, a `OnePerModuleType` is probably a better +bet. + +#### Module-scoped Providers/`depinject.ModuleKey` as an input + +If `depinject.ModuleKey` is used as input parameter for a provider, the provider function will be treated as a +"module-scoped provider" which means that the provider function will be called exactly once every time +one of its outputs is needed by a module so that the provider can provide a unique instance of the dependency to +each module. + +Module-scoped dependencies should be used to provide dependencies which are private and unique to each module. Examples +of these are store keys and param subspaces. + +#### `error` as an output parameter + +`error` can be used as the last output parameter on any provider or invoker. If a provider or invoker with an `error` +parameter returns a non-nil value for `error`, `depinject` will fail and propagate this error up to the caller. + +### Provider Invocation Details + +Providers are called lazily as they are needed and will be invoked at most once (except for "module-scoped providers" +described above) if and only if at least one of their outputs is needed somewhere in the dependency graph. Providers +will only get called if all of their non-optional inputs can successfully be resolved by some other module, otherwise an +error will occur. Modules should proactively mark dependencies as `optional` if the module can still be successfully +built without this dependency. + +### Invoker Invocation Details + +Invokers are called at the end of container initialization after all providers that were needed to build the graph +were called. All the dependencies of invokers are automatically marked as optional so invokers should `nil` check +every input parameter. Invokers may cause additional providers to get run if they have a dependency that wasn't built +yet. But if a dependency to an invoker cannot be provided for some reason, the invoker will still get called but with +`nil` for that input. This allows invokers to still work with the lazy invocation model of providers which only +builds things which are actually necessary as a dependency for some module or the caller. + +Invokers should generally be used sparingly to perform some initialization logic which can't be done in the initial +provider, usually because of a circular dependency, and which may be optional. + +### Best practices + +* make dependencies `optional` whenever possible! +* interface types should be used whenever possible to avoid tight couplings between two modules. +* `OnePerModuleType`s should be used when there is something occurs at most once per module and the module name is a +convenient way for providing a deterministic order. +* `ManyPerContainerType`s should be used only when there is an obvious way to create an ordering from the types or +when ordering *really* doesn't matter (which is rare). +* module-scoped providers should be used for private, module-scoped dependencies +* use different providers for unrelated or loosely components or to resolve circular dependencies (see below) +* use invokers sparingly and always `nil`-check the inputs. + +### Resolving Circular Dependencies + +Circular dependencies are inevitable to crop up and there are ways to avoid them. While `depinject` cannot handle +circular dependency graphs of providers, many of the above tools are designed to enable satisfying circular dependencies +between modules. + +One of the key tactics for resolving circular dependencies is to use different providers and/or invokers to allow a +circular dependency between components. For example, say the slashing keeper depends on the keeper module but the +staking keeper also depends on the staking module indirectly (in the form of "staking hooks"). The slashing module +can declare a dependency directly on the staking keeper (using an interface to avoid actually importing the staking +keeper package). It can also provide an instance of the slashing keeper wrapped as staking hooks in a `OnePerModuleType` +we'll call `StakingHooksWrapper`. Now, if the staking module directly depended on the staking hooks wrappers +(`map[string]StakingHooksWrapper`) we would have a circular dependency graph and `depinject` would fail. To fix this, +the staking module can define an invoker which depends on `map[string]StakingHooksWrapper` and the staking keeper +(which was provided by the staking module already in a separate provided). In this way `depinject` will be able to +satisfy this dependency graph which allows staking and slashing to depend on each other in this order: + +* provide staking keeper -> slashing keeper +* provide slashing keeper wrapped as `StakingHooksWrapper` +* get `map[string]StakingHooksWrapper` and the staking keeper and wire them together + +## 3. Testing and Debugging The Module + +In order to test and debug the module configuration, we need to build an app config, generally defined in a YAML file. +This configuration should be passed first to `appconfig.LoadYAML` to get an `depinject.Config` instance.Then the +`depinject.Config` can be passed to `depinject.Inject` and we can try to resolve dependencies in the app config. +Alternatively, the `depinject.Config` can be created via [pure Go code](https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/simapp/app_config.go). + +Ex: + +```go +//go:embed app.yaml +var appConfig []byte + +var AppConfig = appconfig.LoadYAML(appConfig) + +func TestModule(t *testing.T) { + var keeper Keeper + assert.NilError(t, depinject.Inject(AppConfig, &keeper)) +} +``` + +### Debugging `depinject` Graphs + +Whenever there is an error in a `depinject` graph, by default `depinject` will dump a bunch of logging output to the +console, print the error message, and save the dependency graph in [GraphViz](https://graphviz.org) DOT format to +the file `debug_container.dot`. Inspecting the GraphViz output by converting it to an SVG and viewing it in a web +browser or using some other GraphViz tool is *highly recommended*. + +If `depinject` does not return an error but there is still some weird issue wiring up modules, inspecting the GraphViz +and logging output is still *highly recommended* and can be done using `depinject.InjectDebug` with the debug option +`depinject.Debug`. + +App developers should attempt to familiarize themselves with the GraphViz graph of their app to see which modules +depend on which other modules. diff --git a/depinject/appconfig/config.go b/depinject/appconfig/config.go new file mode 100644 index 000000000000..9bffeae41c50 --- /dev/null +++ b/depinject/appconfig/config.go @@ -0,0 +1,173 @@ +package appconfig + +import ( + "errors" + "fmt" + "reflect" + "strings" + + gogoproto "github.com/cosmos/gogoproto/proto" + "google.golang.org/protobuf/encoding/protojson" + protov2 "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/types/dynamicpb" + "google.golang.org/protobuf/types/known/anypb" + "sigs.k8s.io/yaml" + + "cosmossdk.io/depinject" + "cosmossdk.io/depinject/appconfig/v1alpha1" + internal "cosmossdk.io/depinject/internal/appconfig" +) + +// LoadJSON loads an app config in JSON format. +func LoadJSON(bz []byte) depinject.Config { + // in order to avoid a direct dependency on api types, but in order to also be able to support + // either gogo or google.golang.org/protobuf types, we use protojson and dynamicpb to unmarshal + // from JSON + resolver := gogoproto.HybridResolver + desc, err := resolver.FindDescriptorByName(protoreflect.FullName(gogoproto.MessageName(&v1alpha1.Config{}))) + if err != nil { + return depinject.Error(err) + } + + config := dynamicpb.NewMessage(desc.(protoreflect.MessageDescriptor)) + err = protojson.UnmarshalOptions{ + Resolver: dynamicTypeResolver{resolver: gogoproto.HybridResolver}, + }.Unmarshal(bz, config) + if err != nil { + return depinject.Error(err) + } + + return Compose(config) +} + +// LoadYAML loads an app config in YAML format. +func LoadYAML(bz []byte) depinject.Config { + j, err := yaml.YAMLToJSON(bz) + if err != nil { + return depinject.Error(err) + } + + return LoadJSON(j) +} + +// WrapAny marshals a proto message into a proto Any instance +func WrapAny(config gogoproto.Message) *anypb.Any { + pbz, err := gogoproto.Marshal(config) + if err != nil { + panic(err) + } + + return &anypb.Any{ + TypeUrl: "/" + gogoproto.MessageName(config), + Value: pbz, + } +} + +// Compose composes an app config into a container option by resolving +// the required modules and composing their options. appConfig should be an instance +// of cosmos.app.v1alpha1.Config (it doesn't matter whether you use gogo proto or +// google.golang.org/protobuf types). +func Compose(appConfig gogoproto.Message) depinject.Config { + appConfigConcrete, ok := appConfig.(*v1alpha1.Config) + if !ok { + // we convert any other proto type that was passed (such as an api module type) to the concrete + // type we're using here + appConfigConcrete = &v1alpha1.Config{} + bz, err := gogoproto.Marshal(appConfig) + if err != nil { + return depinject.Error(err) + } + + err = gogoproto.Unmarshal(bz, appConfigConcrete) + if err != nil { + return depinject.Error(err) + } + } + + opts := []depinject.Config{ + depinject.Supply(appConfig), + } + + modules, err := internal.ModulesByModuleTypeName() + if err != nil { + return depinject.Error(err) + } + + for _, module := range appConfigConcrete.Modules { + if module.Name == "" { + return depinject.Error(errors.New("module is missing name")) + } + + if module.Config == nil { + return depinject.Error(fmt.Errorf("module %q is missing a config object", module.Name)) + } + + msgName := module.Config.TypeUrl + // strip type URL prefix + if slashIdx := strings.LastIndex(msgName, "/"); slashIdx >= 0 { + msgName = msgName[slashIdx+1:] + } + if msgName == "" { + return depinject.Error(fmt.Errorf("module %q is missing a type URL", module.Name)) + } + + init, ok := modules[msgName] + if !ok { + if msgDesc, err := gogoproto.HybridResolver.FindDescriptorByName(protoreflect.FullName(msgName)); err == nil { + modDesc, err := internal.GetModuleDescriptor(msgDesc) + if err != nil { + return depinject.Error(err) + } + + if modDesc == nil { + return depinject.Error(fmt.Errorf("no module registered for type URL %s and that protobuf type does not have the option %s\n\n%s", + module.Config.TypeUrl, v1alpha1.E_Module.Name, dumpRegisteredModules(modules))) + } + + return depinject.Error(fmt.Errorf("no module registered for type URL %s, did you forget to import %s: find more information on how to make a module ready for app wiring: https://docs.cosmos.network/main/building-modules/depinject\n\n%s", + module.Config.TypeUrl, modDesc.GoImport, dumpRegisteredModules(modules))) + } + } + + var config gogoproto.Message + if configInit, ok := init.ConfigProtoMessage.(protov2.Message); ok { + config = configInit.ProtoReflect().Type().New().Interface().(gogoproto.Message) + } else { + config = reflect.New(init.ConfigGoType.Elem()).Interface().(gogoproto.Message) + } + // as of gogo v1.5.0 this should work with either gogoproto or golang v2 proto + err = gogoproto.Unmarshal(module.Config.Value, config) + if err != nil { + return depinject.Error(err) + } + + opts = append(opts, depinject.Supply(config)) + + for _, provider := range init.Providers { + opts = append(opts, depinject.ProvideInModule(module.Name, provider)) + } + + for _, invoker := range init.Invokers { + opts = append(opts, depinject.InvokeInModule(module.Name, invoker)) + } + + for _, binding := range module.GolangBindings { + opts = append(opts, depinject.BindInterfaceInModule(module.Name, binding.InterfaceType, binding.Implementation)) + } + } + + for _, binding := range appConfigConcrete.GolangBindings { + opts = append(opts, depinject.BindInterface(binding.InterfaceType, binding.Implementation)) + } + + return depinject.Configs(opts...) +} + +func dumpRegisteredModules(modules map[string]*internal.ModuleInitializer) string { + var mods []string + for name := range modules { + mods = append(mods, " "+name) + } + return fmt.Sprintf("registered modules are:\n%s", strings.Join(mods, "\n")) +} diff --git a/core/appconfig/config_test.go b/depinject/appconfig/config_test.go similarity index 82% rename from core/appconfig/config_test.go rename to depinject/appconfig/config_test.go index 4466981f85bb..4c98ae2221ba 100644 --- a/core/appconfig/config_test.go +++ b/depinject/appconfig/config_test.go @@ -11,11 +11,10 @@ import ( "gotest.tools/v3/assert" "cosmossdk.io/depinject" - - "cosmossdk.io/core/appconfig" - "cosmossdk.io/core/appmodule" - "cosmossdk.io/core/internal" - "cosmossdk.io/core/internal/testpb" + "cosmossdk.io/depinject/appconfig" + internal "cosmossdk.io/depinject/internal/appconfig" + "cosmossdk.io/depinject/internal/appconfig/testpb" + testpbgogo "cosmossdk.io/depinject/internal/appconfiggogo/testpb" ) func expectContainerErrorContains(t *testing.T, option depinject.Config, contains string) { @@ -70,7 +69,10 @@ modules: "@type": testpb.TestModuleA - name: b config: - "@type": testpb.TestModuleB + "@type": /testpb.TestModuleB +- name: c + config: + "@type": /testpb.TestModuleGogo `)) assert.NilError(t, depinject.Inject(opt, &app)) buf := &bytes.Buffer{} @@ -103,7 +105,7 @@ modules: assert.NilError(t, depinject.Inject(opt)) // module registration failures: - appmodule.Register(&testpb.TestNoModuleOptionModule{}) + appconfig.RegisterModule(&testpb.TestNoModuleOptionModule{}) opt = appconfig.LoadYAML([]byte(` modules: - name: a @@ -113,7 +115,7 @@ modules: expectContainerErrorContains(t, opt, "module should have the option cosmos.app.v1alpha1.module") internal.ModuleRegistry = map[reflect.Type]*internal.ModuleInitializer{} // reset module registry - appmodule.Register(&testpb.TestNoGoImportModule{}) + appconfig.RegisterModule(&testpb.TestNoGoImportModule{}) opt = appconfig.LoadYAML([]byte(` modules: - name: a @@ -128,16 +130,20 @@ modules: // func init() { - appmodule.Register(&testpb.TestRuntimeModule{}, - appmodule.Provide(ProvideRuntimeState, ProvideStoreKey, ProvideApp), + appconfig.RegisterModule(&testpb.TestRuntimeModule{}, + appconfig.Provide(ProvideRuntimeState, ProvideStoreKey, ProvideApp), + ) + + appconfig.RegisterModule(&testpb.TestModuleA{}, + appconfig.Provide(ProvideModuleA), ) - appmodule.Register(&testpb.TestModuleA{}, - appmodule.Provide(ProvideModuleA), + appconfig.RegisterModule(&testpb.TestModuleB{}, + appconfig.Provide(ProvideModuleB), ) - appmodule.Register(&testpb.TestModuleB{}, - appmodule.Provide(ProvideModuleB), + appconfig.RegisterModule(&testpbgogo.TestModuleGogo{}, + appconfig.Provide(ProvideModuleC), ) } @@ -222,3 +228,17 @@ type KeeperB interface { } func (k keeperB) isKeeperB() {} + +func ProvideModuleC(key StoreKey, b KeeperB) KeeperC { + return keeperC{key: key} +} + +type keeperC struct { + key StoreKey +} + +type KeeperC interface { + isKeeperC() +} + +func (k keeperC) isKeeperC() {} diff --git a/depinject/appconfig/doc.go b/depinject/appconfig/doc.go new file mode 100644 index 000000000000..a2bf09cfb1a4 --- /dev/null +++ b/depinject/appconfig/doc.go @@ -0,0 +1,3 @@ +// Package appconfig defines functionality for loading declarative Cosmos SDK +// app configurations. +package appconfig diff --git a/depinject/appconfig/dynamic_resolver.go b/depinject/appconfig/dynamic_resolver.go new file mode 100644 index 000000000000..7c957e1327b7 --- /dev/null +++ b/depinject/appconfig/dynamic_resolver.go @@ -0,0 +1,82 @@ +package appconfig + +import ( + "strings" + + "google.golang.org/protobuf/reflect/protodesc" + "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/reflect/protoregistry" + "google.golang.org/protobuf/types/dynamicpb" +) + +// dynamic resolver allows marshaling gogo proto messages from the gogoproto.HybridResolver as long as those +// files have been imported before calling LoadJSON. There is similar code in autocli, this should probably +// eventually be moved into a library. +type dynamicTypeResolver struct { + resolver protodesc.Resolver +} + +func (r dynamicTypeResolver) FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error) { + ext, err := protoregistry.GlobalTypes.FindExtensionByName(field) + if err == nil { + return ext, nil + } + + desc, err := r.resolver.FindDescriptorByName(field) + if err != nil { + return nil, err + } + + return dynamicpb.NewExtensionType(desc.(protoreflect.ExtensionTypeDescriptor)), nil +} + +func (r dynamicTypeResolver) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) { + ext, err := protoregistry.GlobalTypes.FindExtensionByNumber(message, field) + if err == nil { + return ext, nil + } + + desc, err := r.resolver.FindDescriptorByName(message) + if err != nil { + return nil, err + } + + messageDesc := desc.(protoreflect.MessageDescriptor) + exts := messageDesc.Extensions() + n := exts.Len() + for i := 0; i < n; i++ { + ext := exts.Get(i) + if ext.Number() == field { + return dynamicpb.NewExtensionType(ext), nil + } + } + + return nil, protoregistry.NotFound +} + +func (r dynamicTypeResolver) FindMessageByName(message protoreflect.FullName) (protoreflect.MessageType, error) { + typ, err := protoregistry.GlobalTypes.FindMessageByName(message) + if err == nil { + return typ, nil + } + + desc, err := r.resolver.FindDescriptorByName(message) + if err != nil { + return nil, err + } + + return dynamicpb.NewMessageType(desc.(protoreflect.MessageDescriptor)), nil +} + +func (r dynamicTypeResolver) FindMessageByURL(url string) (protoreflect.MessageType, error) { + if i := strings.LastIndexByte(url, '/'); i >= 0 { + url = url[i+1:] + } + + return r.FindMessageByName(protoreflect.FullName(url)) +} + +var ( + _ protoregistry.MessageTypeResolver = dynamicTypeResolver{} + _ protoregistry.ExtensionTypeResolver = dynamicTypeResolver{} +) diff --git a/depinject/appconfig/module.go b/depinject/appconfig/module.go new file mode 100644 index 000000000000..a4d3d5d16a56 --- /dev/null +++ b/depinject/appconfig/module.go @@ -0,0 +1,106 @@ +package appconfig + +import ( + "fmt" + "reflect" + + "github.com/cosmos/gogoproto/proto" + + internal "cosmossdk.io/depinject/internal/appconfig" +) + +var Register = RegisterModule + +// RegisterModule registers a module with the global module registry. The provided +// protobuf message is used only to uniquely identify the protobuf module config +// type. The instance of the protobuf message used in the actual configuration +// will be injected into the container and can be requested by a provider +// function. All module initialization should be handled by the provided options. +// +// Config is a protobuf message type. It should define the cosmos.app.v1alpha.module +// option and must explicitly specify go_packageto make debugging easier for users. +// +// If you want to customize an existing module, you need to overwrite by calling +// RegisterModule again with the same config (proto API type) and new Provide or +// Invoke options. Example: +// +// - Create a new struct and wrap the existing module inside it: +// +// type MyBankAppModule struct { +// bank.AppModule // core bank module +// // additional helper fields +// cdc codec.Codec +// } +// +// - Overwrite function that you want to customize (eg DefaultGenesis). +// - Create a new Provide function (to provide new Module implementation for the proto module): +// +// func ProvideBankModule(in bank.ModuleInputs) BankModuleOutputs { +// // original provider that initializes the bank keeper +// pm := bank.ProvideModule(in) +// m := NewMyBankAppModule(in.Cdc, pm.BankKeeper, in.AccountKeeper) +// return BankModuleOutputs{ +// BankKeeper: pm.BankKeeper, +// Module: m, +// } +// } +// +// - Re-register the bank module by using the original proto api module, and the new provider: +// +// appconfig.RegisterModule( +// &bankmodulev1.Module{}, // from cosmossdk.io/api/cosmos/bank/module/v1 +// appconfig.Provide(ProvideBankModule), +// appconfig.Invoke(bank.InvokeSetSendRestrictions), +// ) +func RegisterModule(config any, options ...Option) { + protoConfig, ok := config.(proto.Message) + if !ok { + panic(fmt.Errorf("expected config to be a proto.Message, got %T", config)) + } + + ty := reflect.TypeOf(config) + init := &internal.ModuleInitializer{ + ConfigProtoMessage: protoConfig, + ConfigGoType: ty, + } + internal.ModuleRegistry[ty] = init + + for _, option := range options { + init.Error = option.apply(init) + if init.Error != nil { + return + } + } +} + +// Option is a functional option for implementing modules. +type Option interface { + apply(*internal.ModuleInitializer) error +} + +type funcOption func(initializer *internal.ModuleInitializer) error + +func (f funcOption) apply(initializer *internal.ModuleInitializer) error { + return f(initializer) +} + +// Provide registers providers with the dependency injection system that will be +// run within the module scope (depinject.ProvideInModule). See cosmossdk.io/depinject for +// documentation on the dependency injection system. +func Provide(providers ...interface{}) Option { + return funcOption(func(initializer *internal.ModuleInitializer) error { + initializer.Providers = append(initializer.Providers, providers...) + return nil + }) +} + +// Invoke registers invokers to run with depinject (depinject.InvokeInModule). Each invoker will be called +// at the end of dependency graph configuration in the order in which it was defined. Invokers may not define output +// parameters, although they may return an error, and all of their input parameters will be marked as optional so that +// invokers impose no additional constraints on the dependency graph. Invoker functions should nil-check all inputs. +func Invoke(invokers ...interface{}) Option { + return funcOption(func(initializer *internal.ModuleInitializer) error { + initializer.Invokers = append(initializer.Invokers, invokers...) + return nil + }) +} diff --git a/depinject/appconfig/v1alpha1/config.pb.go b/depinject/appconfig/v1alpha1/config.pb.go new file mode 100644 index 000000000000..af7197e22057 --- /dev/null +++ b/depinject/appconfig/v1alpha1/config.pb.go @@ -0,0 +1,942 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/app/v1alpha1/config.proto + +package v1alpha1 + +import ( + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/codec/types" + 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 + +// Config represents the configuration for a Cosmos SDK ABCI app. +// It is intended that all state machine logic including the version of +// baseapp and tx handlers (and possibly even Tendermint) that an app needs +// can be described in a config object. For compatibility, the framework should +// allow a mixture of declarative and imperative app wiring, however, apps +// that strive for the maximum ease of maintainability should be able to describe +// their state machine with a config object alone. +type Config struct { + // modules are the module configurations for the app. + Modules []*ModuleConfig `protobuf:"bytes,1,rep,name=modules,proto3" json:"modules,omitempty"` + // golang_bindings specifies explicit interface to implementation type bindings which + // depinject uses to resolve interface inputs to provider functions. The scope of this + // field's configuration is global (not module specific). + GolangBindings []*GolangBinding `protobuf:"bytes,2,rep,name=golang_bindings,json=golangBindings,proto3" json:"golang_bindings,omitempty"` +} + +func (m *Config) Reset() { *m = Config{} } +func (m *Config) String() string { return proto.CompactTextString(m) } +func (*Config) ProtoMessage() {} +func (*Config) Descriptor() ([]byte, []int) { + return fileDescriptor_5af1d229673256fa, []int{0} +} +func (m *Config) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Config.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 *Config) XXX_Merge(src proto.Message) { + xxx_messageInfo_Config.Merge(m, src) +} +func (m *Config) XXX_Size() int { + return m.Size() +} +func (m *Config) XXX_DiscardUnknown() { + xxx_messageInfo_Config.DiscardUnknown(m) +} + +var xxx_messageInfo_Config proto.InternalMessageInfo + +func (m *Config) GetModules() []*ModuleConfig { + if m != nil { + return m.Modules + } + return nil +} + +func (m *Config) GetGolangBindings() []*GolangBinding { + if m != nil { + return m.GolangBindings + } + return nil +} + +// ModuleConfig is a module configuration for an app. +type ModuleConfig struct { + // name is the unique name of the module within the app. It should be a name + // that persists between different versions of a module so that modules + // can be smoothly upgraded to new versions. + // + // For example, for the module cosmos.bank.module.v1.Module, we may chose + // to simply name the module "bank" in the app. When we upgrade to + // cosmos.bank.module.v2.Module, the app-specific name "bank" stays the same + // and the framework knows that the v2 module should receive all the same state + // that the v1 module had. Note: modules should provide info on which versions + // they can migrate from in the ModuleDescriptor.can_migration_from field. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // config is the config object for the module. Module config messages should + // define a ModuleDescriptor using the cosmos.app.v1alpha1.is_module extension. + Config *types.Any `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"` + // golang_bindings specifies explicit interface to implementation type bindings which + // depinject uses to resolve interface inputs to provider functions. The scope of this + // field's configuration is module specific. + GolangBindings []*GolangBinding `protobuf:"bytes,3,rep,name=golang_bindings,json=golangBindings,proto3" json:"golang_bindings,omitempty"` +} + +func (m *ModuleConfig) Reset() { *m = ModuleConfig{} } +func (m *ModuleConfig) String() string { return proto.CompactTextString(m) } +func (*ModuleConfig) ProtoMessage() {} +func (*ModuleConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_5af1d229673256fa, []int{1} +} +func (m *ModuleConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ModuleConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ModuleConfig.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 *ModuleConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_ModuleConfig.Merge(m, src) +} +func (m *ModuleConfig) XXX_Size() int { + return m.Size() +} +func (m *ModuleConfig) XXX_DiscardUnknown() { + xxx_messageInfo_ModuleConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_ModuleConfig proto.InternalMessageInfo + +func (m *ModuleConfig) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ModuleConfig) GetConfig() *types.Any { + if m != nil { + return m.Config + } + return nil +} + +func (m *ModuleConfig) GetGolangBindings() []*GolangBinding { + if m != nil { + return m.GolangBindings + } + return nil +} + +// GolangBinding is an explicit interface type to implementing type binding for dependency injection. +type GolangBinding struct { + // interface_type is the interface type which will be bound to a specific implementation type + InterfaceType string `protobuf:"bytes,1,opt,name=interface_type,json=interfaceType,proto3" json:"interface_type,omitempty"` + // implementation is the implementing type which will be supplied when an input of type interface is requested + Implementation string `protobuf:"bytes,2,opt,name=implementation,proto3" json:"implementation,omitempty"` +} + +func (m *GolangBinding) Reset() { *m = GolangBinding{} } +func (m *GolangBinding) String() string { return proto.CompactTextString(m) } +func (*GolangBinding) ProtoMessage() {} +func (*GolangBinding) Descriptor() ([]byte, []int) { + return fileDescriptor_5af1d229673256fa, []int{2} +} +func (m *GolangBinding) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GolangBinding) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GolangBinding.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 *GolangBinding) XXX_Merge(src proto.Message) { + xxx_messageInfo_GolangBinding.Merge(m, src) +} +func (m *GolangBinding) XXX_Size() int { + return m.Size() +} +func (m *GolangBinding) XXX_DiscardUnknown() { + xxx_messageInfo_GolangBinding.DiscardUnknown(m) +} + +var xxx_messageInfo_GolangBinding proto.InternalMessageInfo + +func (m *GolangBinding) GetInterfaceType() string { + if m != nil { + return m.InterfaceType + } + return "" +} + +func (m *GolangBinding) GetImplementation() string { + if m != nil { + return m.Implementation + } + return "" +} + +func init() { + proto.RegisterType((*Config)(nil), "cosmos.app.v1alpha1.Config") + proto.RegisterType((*ModuleConfig)(nil), "cosmos.app.v1alpha1.ModuleConfig") + proto.RegisterType((*GolangBinding)(nil), "cosmos.app.v1alpha1.GolangBinding") +} + +func init() { proto.RegisterFile("cosmos/app/v1alpha1/config.proto", fileDescriptor_5af1d229673256fa) } + +var fileDescriptor_5af1d229673256fa = []byte{ + // 333 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x31, 0x4f, 0x02, 0x31, + 0x1c, 0xc5, 0x29, 0x18, 0x0c, 0x45, 0x30, 0xa9, 0x0e, 0xa7, 0xc3, 0xe5, 0x24, 0xd1, 0x60, 0x62, + 0xda, 0x80, 0xa3, 0x93, 0x30, 0x38, 0x18, 0x97, 0x8b, 0x93, 0x83, 0xa4, 0xdc, 0x95, 0x5a, 0xbd, + 0x6b, 0x1b, 0x5a, 0x4c, 0xee, 0x5b, 0x18, 0x77, 0xbf, 0x8f, 0x23, 0xa3, 0xa3, 0x81, 0x2f, 0x62, + 0x6c, 0x3d, 0x82, 0x86, 0xc9, 0xad, 0xfd, 0xe7, 0xf7, 0x7f, 0x7d, 0xaf, 0x79, 0x30, 0x4a, 0x94, + 0xc9, 0x95, 0x21, 0x54, 0x6b, 0xf2, 0xdc, 0xa3, 0x99, 0x7e, 0xa0, 0x3d, 0x92, 0x28, 0x39, 0x11, + 0x1c, 0xeb, 0xa9, 0xb2, 0x0a, 0xed, 0x79, 0x02, 0x53, 0xad, 0x71, 0x49, 0x1c, 0x1e, 0x70, 0xa5, + 0x78, 0xc6, 0x88, 0x43, 0xc6, 0xb3, 0x09, 0xa1, 0xb2, 0xf0, 0x7c, 0xe7, 0x15, 0xc0, 0xfa, 0xd0, + 0x09, 0xa0, 0x0b, 0xb8, 0x9d, 0xab, 0x74, 0x96, 0x31, 0x13, 0x80, 0xa8, 0xd6, 0x6d, 0xf6, 0x8f, + 0xf0, 0x06, 0x31, 0x7c, 0xe3, 0x18, 0xbf, 0x13, 0x97, 0x1b, 0xe8, 0x1a, 0xee, 0x72, 0x95, 0x51, + 0xc9, 0x47, 0x63, 0x21, 0x53, 0x21, 0xb9, 0x09, 0xaa, 0x4e, 0xa4, 0xb3, 0x51, 0xe4, 0xca, 0xb1, + 0x03, 0x8f, 0xc6, 0x6d, 0xbe, 0x7e, 0x35, 0x9d, 0x37, 0x00, 0x77, 0xd6, 0x9f, 0x41, 0x08, 0x6e, + 0x49, 0x9a, 0xb3, 0x00, 0x44, 0xa0, 0xdb, 0x88, 0xdd, 0x19, 0x9d, 0xc1, 0xba, 0x4f, 0x1e, 0x54, + 0x23, 0xd0, 0x6d, 0xf6, 0xf7, 0xb1, 0x4f, 0x89, 0xcb, 0x94, 0xf8, 0x52, 0x16, 0xf1, 0x0f, 0xb3, + 0xc9, 0x5f, 0xed, 0xdf, 0xfe, 0xee, 0x61, 0xeb, 0x17, 0x80, 0x8e, 0x61, 0x5b, 0x48, 0xcb, 0xa6, + 0x13, 0x9a, 0xb0, 0x91, 0x2d, 0x74, 0xe9, 0xb4, 0xb5, 0x9a, 0xde, 0x16, 0x9a, 0xa1, 0x13, 0xd8, + 0x16, 0xb9, 0xce, 0x58, 0xce, 0xa4, 0xa5, 0x56, 0x28, 0xe9, 0xac, 0x37, 0xe2, 0x3f, 0xd3, 0xc1, + 0xf0, 0x7d, 0x11, 0x82, 0xf9, 0x22, 0x04, 0x9f, 0x8b, 0x10, 0xbc, 0x2c, 0xc3, 0xca, 0x7c, 0x19, + 0x56, 0x3e, 0x96, 0x61, 0xe5, 0xee, 0xd4, 0x9b, 0x35, 0xe9, 0x13, 0x16, 0x8a, 0xa4, 0x4c, 0x0b, + 0xf9, 0xc8, 0x12, 0xfb, 0x5d, 0x08, 0x1f, 0x74, 0x55, 0x8b, 0x71, 0xdd, 0xfd, 0xc3, 0xf9, 0x57, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xd5, 0xfa, 0x9f, 0xcf, 0x34, 0x02, 0x00, 0x00, +} + +func (m *Config) 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 *Config) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Config) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.GolangBindings) > 0 { + for iNdEx := len(m.GolangBindings) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.GolangBindings[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Modules) > 0 { + for iNdEx := len(m.Modules) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Modules[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *ModuleConfig) 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 *ModuleConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModuleConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.GolangBindings) > 0 { + for iNdEx := len(m.GolangBindings) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.GolangBindings[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if m.Config != nil { + { + size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintConfig(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintConfig(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GolangBinding) 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 *GolangBinding) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GolangBinding) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Implementation) > 0 { + i -= len(m.Implementation) + copy(dAtA[i:], m.Implementation) + i = encodeVarintConfig(dAtA, i, uint64(len(m.Implementation))) + i-- + dAtA[i] = 0x12 + } + if len(m.InterfaceType) > 0 { + i -= len(m.InterfaceType) + copy(dAtA[i:], m.InterfaceType) + i = encodeVarintConfig(dAtA, i, uint64(len(m.InterfaceType))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintConfig(dAtA []byte, offset int, v uint64) int { + offset -= sovConfig(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Config) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Modules) > 0 { + for _, e := range m.Modules { + l = e.Size() + n += 1 + l + sovConfig(uint64(l)) + } + } + if len(m.GolangBindings) > 0 { + for _, e := range m.GolangBindings { + l = e.Size() + n += 1 + l + sovConfig(uint64(l)) + } + } + return n +} + +func (m *ModuleConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + if m.Config != nil { + l = m.Config.Size() + n += 1 + l + sovConfig(uint64(l)) + } + if len(m.GolangBindings) > 0 { + for _, e := range m.GolangBindings { + l = e.Size() + n += 1 + l + sovConfig(uint64(l)) + } + } + return n +} + +func (m *GolangBinding) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.InterfaceType) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + l = len(m.Implementation) + if l > 0 { + n += 1 + l + sovConfig(uint64(l)) + } + return n +} + +func sovConfig(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozConfig(x uint64) (n int) { + return sovConfig(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Config) 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 ErrIntOverflowConfig + } + 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: Config: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Config: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Modules", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthConfig + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Modules = append(m.Modules, &ModuleConfig{}) + if err := m.Modules[len(m.Modules)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GolangBindings", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthConfig + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GolangBindings = append(m.GolangBindings, &GolangBinding{}) + if err := m.GolangBindings[len(m.GolangBindings)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipConfig(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthConfig + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ModuleConfig) 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 ErrIntOverflowConfig + } + 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: ModuleConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ModuleConfig: 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 ErrIntOverflowConfig + } + 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 ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + 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 Config", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthConfig + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Config == nil { + m.Config = &types.Any{} + } + if err := m.Config.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GolangBindings", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthConfig + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GolangBindings = append(m.GolangBindings, &GolangBinding{}) + if err := m.GolangBindings[len(m.GolangBindings)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipConfig(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthConfig + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GolangBinding) 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 ErrIntOverflowConfig + } + 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: GolangBinding: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GolangBinding: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InterfaceType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + 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 ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.InterfaceType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Implementation", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConfig + } + 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 ErrInvalidLengthConfig + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConfig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Implementation = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipConfig(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthConfig + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipConfig(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, ErrIntOverflowConfig + } + 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, ErrIntOverflowConfig + } + 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, ErrIntOverflowConfig + } + 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, ErrInvalidLengthConfig + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupConfig + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthConfig + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthConfig = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowConfig = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupConfig = fmt.Errorf("proto: unexpected end of group") +) diff --git a/depinject/appconfig/v1alpha1/module.pb.go b/depinject/appconfig/v1alpha1/module.pb.go new file mode 100644 index 000000000000..67dde820c1ec --- /dev/null +++ b/depinject/appconfig/v1alpha1/module.pb.go @@ -0,0 +1,893 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/app/v1alpha1/module.proto + +package v1alpha1 + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + descriptorpb "google.golang.org/protobuf/types/descriptorpb" + 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 + +// ModuleDescriptor describes an app module. +type ModuleDescriptor struct { + // go_import names the package that should be imported by an app to load the + // module in the runtime module registry. It is required to make debugging + // of configuration errors easier for users. + GoImport string `protobuf:"bytes,1,opt,name=go_import,json=goImport,proto3" json:"go_import,omitempty"` + // use_package refers to a protobuf package that this module + // uses and exposes to the world. In an app, only one module should "use" + // or own a single protobuf package. It is assumed that the module uses + // all of the .proto files in a single package. + UsePackage []*PackageReference `protobuf:"bytes,2,rep,name=use_package,json=usePackage,proto3" json:"use_package,omitempty"` + // can_migrate_from defines which module versions this module can migrate + // state from. The framework will check that one module version is able to + // migrate from a previous module version before attempting to update its + // config. It is assumed that modules can transitively migrate from earlier + // versions. For instance if v3 declares it can migrate from v2, and v2 + // declares it can migrate from v1, the framework knows how to migrate + // from v1 to v3, assuming all 3 module versions are registered at runtime. + CanMigrateFrom []*MigrateFromInfo `protobuf:"bytes,3,rep,name=can_migrate_from,json=canMigrateFrom,proto3" json:"can_migrate_from,omitempty"` +} + +func (m *ModuleDescriptor) Reset() { *m = ModuleDescriptor{} } +func (m *ModuleDescriptor) String() string { return proto.CompactTextString(m) } +func (*ModuleDescriptor) ProtoMessage() {} +func (*ModuleDescriptor) Descriptor() ([]byte, []int) { + return fileDescriptor_0e7eb8b9b8dcd164, []int{0} +} +func (m *ModuleDescriptor) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ModuleDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ModuleDescriptor.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 *ModuleDescriptor) XXX_Merge(src proto.Message) { + xxx_messageInfo_ModuleDescriptor.Merge(m, src) +} +func (m *ModuleDescriptor) XXX_Size() int { + return m.Size() +} +func (m *ModuleDescriptor) XXX_DiscardUnknown() { + xxx_messageInfo_ModuleDescriptor.DiscardUnknown(m) +} + +var xxx_messageInfo_ModuleDescriptor proto.InternalMessageInfo + +func (m *ModuleDescriptor) GetGoImport() string { + if m != nil { + return m.GoImport + } + return "" +} + +func (m *ModuleDescriptor) GetUsePackage() []*PackageReference { + if m != nil { + return m.UsePackage + } + return nil +} + +func (m *ModuleDescriptor) GetCanMigrateFrom() []*MigrateFromInfo { + if m != nil { + return m.CanMigrateFrom + } + return nil +} + +// PackageReference is a reference to a protobuf package used by a module. +type PackageReference struct { + // name is the fully-qualified name of the package. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // revision is the optional revision of the package that is being used. + // Protobuf packages used in Cosmos should generally have a major version + // as the last part of the package name, ex. foo.bar.baz.v1. + // The revision of a package can be thought of as the minor version of a + // package which has additional backwards compatible definitions that weren't + // present in a previous version. + // + // A package should indicate its revision with a source code comment + // above the package declaration in one of its files containing the + // text "Revision N" where N is an integer revision. All packages start + // at revision 0 the first time they are released in a module. + // + // When a new version of a module is released and items are added to existing + // .proto files, these definitions should contain comments of the form + // "Since: Revision N" where N is an integer revision. + // + // When the module runtime starts up, it will check the pinned proto + // image and panic if there are runtime protobuf definitions that are not + // in the pinned descriptor which do not have + // a "Since Revision N" comment or have a "Since Revision N" comment where + // N is <= to the revision specified here. This indicates that the protobuf + // files have been updated, but the pinned file descriptor hasn't. + // + // If there are items in the pinned file descriptor with a revision + // greater than the value indicated here, this will also cause a panic + // as it may mean that the pinned descriptor for a legacy module has been + // improperly updated or that there is some other versioning discrepancy. + // Runtime protobuf definitions will also be checked for compatibility + // with pinned file descriptors to make sure there are no incompatible changes. + // + // This behavior ensures that: + // - pinned proto images are up-to-date + // - protobuf files are carefully annotated with revision comments which + // are important good client UX + // - protobuf files are changed in backwards and forwards compatible ways + Revision uint32 `protobuf:"varint,2,opt,name=revision,proto3" json:"revision,omitempty"` +} + +func (m *PackageReference) Reset() { *m = PackageReference{} } +func (m *PackageReference) String() string { return proto.CompactTextString(m) } +func (*PackageReference) ProtoMessage() {} +func (*PackageReference) Descriptor() ([]byte, []int) { + return fileDescriptor_0e7eb8b9b8dcd164, []int{1} +} +func (m *PackageReference) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PackageReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PackageReference.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 *PackageReference) XXX_Merge(src proto.Message) { + xxx_messageInfo_PackageReference.Merge(m, src) +} +func (m *PackageReference) XXX_Size() int { + return m.Size() +} +func (m *PackageReference) XXX_DiscardUnknown() { + xxx_messageInfo_PackageReference.DiscardUnknown(m) +} + +var xxx_messageInfo_PackageReference proto.InternalMessageInfo + +func (m *PackageReference) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *PackageReference) GetRevision() uint32 { + if m != nil { + return m.Revision + } + return 0 +} + +// MigrateFromInfo is information on a module version that a newer module +// can migrate from. +type MigrateFromInfo struct { + // module is the fully-qualified protobuf name of the module config object + // for the previous module version, ex: "cosmos.group.module.v1.Module". + Module string `protobuf:"bytes,1,opt,name=module,proto3" json:"module,omitempty"` +} + +func (m *MigrateFromInfo) Reset() { *m = MigrateFromInfo{} } +func (m *MigrateFromInfo) String() string { return proto.CompactTextString(m) } +func (*MigrateFromInfo) ProtoMessage() {} +func (*MigrateFromInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_0e7eb8b9b8dcd164, []int{2} +} +func (m *MigrateFromInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MigrateFromInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MigrateFromInfo.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 *MigrateFromInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_MigrateFromInfo.Merge(m, src) +} +func (m *MigrateFromInfo) XXX_Size() int { + return m.Size() +} +func (m *MigrateFromInfo) XXX_DiscardUnknown() { + xxx_messageInfo_MigrateFromInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_MigrateFromInfo proto.InternalMessageInfo + +func (m *MigrateFromInfo) GetModule() string { + if m != nil { + return m.Module + } + return "" +} + +var E_Module = &proto.ExtensionDesc{ + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*ModuleDescriptor)(nil), + Field: 57193479, + Name: "cosmos.app.v1alpha1.module", + Tag: "bytes,57193479,opt,name=module", + Filename: "cosmos/app/v1alpha1/module.proto", +} + +func init() { + proto.RegisterType((*ModuleDescriptor)(nil), "cosmos.app.v1alpha1.ModuleDescriptor") + proto.RegisterType((*PackageReference)(nil), "cosmos.app.v1alpha1.PackageReference") + proto.RegisterType((*MigrateFromInfo)(nil), "cosmos.app.v1alpha1.MigrateFromInfo") + proto.RegisterExtension(E_Module) +} + +func init() { proto.RegisterFile("cosmos/app/v1alpha1/module.proto", fileDescriptor_0e7eb8b9b8dcd164) } + +var fileDescriptor_0e7eb8b9b8dcd164 = []byte{ + // 368 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0xcd, 0xaa, 0x13, 0x31, + 0x18, 0x6d, 0xee, 0x95, 0xcb, 0x6d, 0x8a, 0x5a, 0x22, 0xc8, 0xd0, 0xc2, 0x38, 0x14, 0x85, 0x76, + 0x93, 0xa1, 0xba, 0x73, 0x59, 0xa5, 0xd0, 0x45, 0x55, 0x66, 0xe9, 0x66, 0x48, 0x33, 0xdf, 0xc4, + 0xd8, 0x4e, 0xbe, 0x90, 0xcc, 0xf4, 0x15, 0xdc, 0xfa, 0x0c, 0xbe, 0x8c, 0x2e, 0xbb, 0x74, 0x29, + 0xed, 0xc6, 0xc7, 0x10, 0xe7, 0xa7, 0x48, 0xa9, 0xbb, 0x9c, 0x93, 0x93, 0x73, 0xf2, 0x1d, 0x3e, + 0x1a, 0x49, 0xf4, 0x05, 0xfa, 0x58, 0x58, 0x1b, 0xef, 0xe7, 0x62, 0x67, 0x3f, 0x89, 0x79, 0x5c, + 0x60, 0x56, 0xed, 0x80, 0x5b, 0x87, 0x25, 0xb2, 0x27, 0x8d, 0x82, 0x0b, 0x6b, 0x79, 0xa7, 0x18, + 0x45, 0x0a, 0x51, 0xed, 0x20, 0xae, 0x25, 0x9b, 0x2a, 0x8f, 0x33, 0xf0, 0xd2, 0x69, 0x5b, 0xa2, + 0x6b, 0x9e, 0x4d, 0xbe, 0x13, 0x3a, 0x5c, 0xd7, 0x3e, 0x6f, 0xcf, 0x57, 0x6c, 0x4c, 0xfb, 0x0a, + 0x53, 0x5d, 0x58, 0x74, 0x65, 0x40, 0x22, 0x32, 0xed, 0x27, 0xf7, 0x0a, 0x57, 0x35, 0x66, 0x4b, + 0x3a, 0xa8, 0x3c, 0xa4, 0x56, 0xc8, 0xad, 0x50, 0x10, 0xdc, 0x44, 0xb7, 0xd3, 0xc1, 0xcb, 0x17, + 0xfc, 0x4a, 0x3c, 0xff, 0xd0, 0x68, 0x12, 0xc8, 0xc1, 0x81, 0x91, 0x90, 0xd0, 0xca, 0x43, 0x4b, + 0xb2, 0x77, 0x74, 0x28, 0x85, 0x49, 0x0b, 0xad, 0x9c, 0x28, 0x21, 0xcd, 0x1d, 0x16, 0xc1, 0x6d, + 0x6d, 0xf6, 0xfc, 0xaa, 0xd9, 0xba, 0x11, 0x2e, 0x1d, 0x16, 0x2b, 0x93, 0x63, 0xf2, 0x48, 0x0a, + 0xf3, 0x0f, 0x37, 0x59, 0xd0, 0xe1, 0x65, 0x1e, 0x63, 0xf4, 0x81, 0x11, 0x05, 0xb4, 0x33, 0xd4, + 0x67, 0x36, 0xa2, 0xf7, 0x0e, 0xf6, 0xda, 0x6b, 0x34, 0xc1, 0x4d, 0x44, 0xa6, 0x0f, 0x93, 0x33, + 0x9e, 0xcc, 0xe8, 0xe3, 0x8b, 0x18, 0xf6, 0x94, 0xde, 0x35, 0x3d, 0xb7, 0x26, 0x2d, 0x7a, 0x2d, + 0x3a, 0x9e, 0x3d, 0xe3, 0x4d, 0xcb, 0xbc, 0x6b, 0x99, 0xaf, 0xc1, 0x7b, 0xa1, 0xe0, 0xbd, 0x2d, + 0x35, 0x1a, 0x1f, 0x7c, 0xf9, 0xfd, 0x6d, 0x1c, 0x91, 0xff, 0xb6, 0x74, 0x59, 0x7f, 0x17, 0xb1, + 0x78, 0xf3, 0xe3, 0x18, 0x92, 0xc3, 0x31, 0x24, 0xbf, 0x8e, 0x21, 0xf9, 0x7a, 0x0a, 0x7b, 0x87, + 0x53, 0xd8, 0xfb, 0x79, 0x0a, 0x7b, 0x1f, 0x67, 0x8d, 0x8f, 0xcf, 0xb6, 0x5c, 0x63, 0x9c, 0x81, + 0xd5, 0xe6, 0x33, 0xc8, 0xf2, 0xef, 0x7a, 0x48, 0x34, 0xb9, 0x56, 0xe7, 0x25, 0xd9, 0xdc, 0xd5, + 0xbf, 0x7a, 0xf5, 0x27, 0x00, 0x00, 0xff, 0xff, 0xf5, 0x00, 0xca, 0xe6, 0x42, 0x02, 0x00, 0x00, +} + +func (m *ModuleDescriptor) 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 *ModuleDescriptor) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModuleDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CanMigrateFrom) > 0 { + for iNdEx := len(m.CanMigrateFrom) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.CanMigrateFrom[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.UsePackage) > 0 { + for iNdEx := len(m.UsePackage) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.UsePackage[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.GoImport) > 0 { + i -= len(m.GoImport) + copy(dAtA[i:], m.GoImport) + i = encodeVarintModule(dAtA, i, uint64(len(m.GoImport))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PackageReference) 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 *PackageReference) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PackageReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Revision != 0 { + i = encodeVarintModule(dAtA, i, uint64(m.Revision)) + i-- + dAtA[i] = 0x10 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintModule(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MigrateFromInfo) 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 *MigrateFromInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MigrateFromInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Module) > 0 { + i -= len(m.Module) + copy(dAtA[i:], m.Module) + i = encodeVarintModule(dAtA, i, uint64(len(m.Module))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintModule(dAtA []byte, offset int, v uint64) int { + offset -= sovModule(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ModuleDescriptor) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.GoImport) + if l > 0 { + n += 1 + l + sovModule(uint64(l)) + } + if len(m.UsePackage) > 0 { + for _, e := range m.UsePackage { + l = e.Size() + n += 1 + l + sovModule(uint64(l)) + } + } + if len(m.CanMigrateFrom) > 0 { + for _, e := range m.CanMigrateFrom { + l = e.Size() + n += 1 + l + sovModule(uint64(l)) + } + } + return n +} + +func (m *PackageReference) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovModule(uint64(l)) + } + if m.Revision != 0 { + n += 1 + sovModule(uint64(m.Revision)) + } + return n +} + +func (m *MigrateFromInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Module) + if l > 0 { + n += 1 + l + sovModule(uint64(l)) + } + return n +} + +func sovModule(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozModule(x uint64) (n int) { + return sovModule(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ModuleDescriptor) 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 ErrIntOverflowModule + } + 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: ModuleDescriptor: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ModuleDescriptor: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GoImport", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModule + } + 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 ErrInvalidLengthModule + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GoImport = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UsePackage", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModule + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UsePackage = append(m.UsePackage, &PackageReference{}) + if err := m.UsePackage[len(m.UsePackage)-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 CanMigrateFrom", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModule + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CanMigrateFrom = append(m.CanMigrateFrom, &MigrateFromInfo{}) + if err := m.CanMigrateFrom[len(m.CanMigrateFrom)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModule(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModule + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PackageReference) 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 ErrIntOverflowModule + } + 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: PackageReference: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PackageReference: 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 ErrIntOverflowModule + } + 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 ErrInvalidLengthModule + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType) + } + m.Revision = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Revision |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipModule(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModule + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MigrateFromInfo) 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 ErrIntOverflowModule + } + 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: MigrateFromInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MigrateFromInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Module", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModule + } + 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 ErrInvalidLengthModule + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Module = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModule(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModule + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipModule(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, ErrIntOverflowModule + } + 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, ErrIntOverflowModule + } + 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, ErrIntOverflowModule + } + 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, ErrInvalidLengthModule + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupModule + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthModule + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthModule = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowModule = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupModule = fmt.Errorf("proto: unexpected end of group") +) diff --git a/depinject/appconfig/v1alpha1/query.pb.go b/depinject/appconfig/v1alpha1/query.pb.go new file mode 100644 index 000000000000..22f736440fad --- /dev/null +++ b/depinject/appconfig/v1alpha1/query.pb.go @@ -0,0 +1,538 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/app/v1alpha1/query.proto + +package v1alpha1 + +import ( + context "context" + fmt "fmt" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// QueryConfigRequest is the Query/Config request type. +type QueryConfigRequest struct { +} + +func (m *QueryConfigRequest) Reset() { *m = QueryConfigRequest{} } +func (m *QueryConfigRequest) String() string { return proto.CompactTextString(m) } +func (*QueryConfigRequest) ProtoMessage() {} +func (*QueryConfigRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_bd84655af543ba53, []int{0} +} +func (m *QueryConfigRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryConfigRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryConfigRequest.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 *QueryConfigRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryConfigRequest.Merge(m, src) +} +func (m *QueryConfigRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryConfigRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryConfigRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryConfigRequest proto.InternalMessageInfo + +// QueryConfigResponse is the Query/Config response type. +type QueryConfigResponse struct { + // config is the current app config. + Config *Config `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` +} + +func (m *QueryConfigResponse) Reset() { *m = QueryConfigResponse{} } +func (m *QueryConfigResponse) String() string { return proto.CompactTextString(m) } +func (*QueryConfigResponse) ProtoMessage() {} +func (*QueryConfigResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bd84655af543ba53, []int{1} +} +func (m *QueryConfigResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryConfigResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryConfigResponse.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 *QueryConfigResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryConfigResponse.Merge(m, src) +} +func (m *QueryConfigResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryConfigResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryConfigResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryConfigResponse proto.InternalMessageInfo + +func (m *QueryConfigResponse) GetConfig() *Config { + if m != nil { + return m.Config + } + return nil +} + +func init() { + proto.RegisterType((*QueryConfigRequest)(nil), "cosmos.app.v1alpha1.QueryConfigRequest") + proto.RegisterType((*QueryConfigResponse)(nil), "cosmos.app.v1alpha1.QueryConfigResponse") +} + +func init() { proto.RegisterFile("cosmos/app/v1alpha1/query.proto", fileDescriptor_bd84655af543ba53) } + +var fileDescriptor_bd84655af543ba53 = []byte{ + // 222 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0x2c, 0x28, 0xd0, 0x2f, 0x33, 0x4c, 0xcc, 0x29, 0xc8, 0x48, 0x34, 0xd4, + 0x2f, 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, 0x28, 0xd0, + 0x4b, 0x2c, 0x28, 0xd0, 0x83, 0x29, 0x90, 0x52, 0xc0, 0xa6, 0x2b, 0x39, 0x3f, 0x2f, 0x2d, 0x33, + 0x1d, 0xa2, 0x4d, 0x49, 0x84, 0x4b, 0x28, 0x10, 0x64, 0x8a, 0x33, 0x58, 0x30, 0x28, 0xb5, 0xb0, + 0x34, 0xb5, 0xb8, 0x44, 0xc9, 0x8b, 0x4b, 0x18, 0x45, 0xb4, 0xb8, 0x20, 0x3f, 0xaf, 0x38, 0x55, + 0xc8, 0x98, 0x8b, 0x0d, 0xa2, 0x59, 0x82, 0x51, 0x81, 0x51, 0x83, 0xdb, 0x48, 0x5a, 0x0f, 0x8b, + 0xa5, 0x7a, 0x50, 0x4d, 0x50, 0xa5, 0x46, 0x99, 0x5c, 0xac, 0x60, 0xb3, 0x84, 0x12, 0xb8, 0xd8, + 0x20, 0x52, 0x42, 0xea, 0x58, 0xf5, 0x61, 0xba, 0x43, 0x4a, 0x83, 0xb0, 0x42, 0x88, 0xd3, 0x94, + 0x98, 0x3b, 0x98, 0x18, 0x9d, 0x9c, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, + 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, + 0x4a, 0x13, 0x62, 0x4e, 0x71, 0x4a, 0xb6, 0x5e, 0x66, 0xbe, 0x7e, 0x4a, 0x6a, 0x41, 0x66, 0x5e, + 0x56, 0x6a, 0x72, 0x09, 0x28, 0x60, 0x20, 0xce, 0x84, 0x07, 0x4f, 0x12, 0x1b, 0x38, 0x60, 0x8c, + 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x72, 0xe6, 0x07, 0x7f, 0x72, 0x01, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // Config returns the current app config. + Config(ctx context.Context, in *QueryConfigRequest, opts ...grpc.CallOption) (*QueryConfigResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +// Deprecated: Do not use. +func (c *queryClient) Config(ctx context.Context, in *QueryConfigRequest, opts ...grpc.CallOption) (*QueryConfigResponse, error) { + out := new(QueryConfigResponse) + err := c.cc.Invoke(ctx, "/cosmos.app.v1alpha1.Query/Config", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // Config returns the current app config. + Config(context.Context, *QueryConfigRequest) (*QueryConfigResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Config(ctx context.Context, req *QueryConfigRequest) (*QueryConfigResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Config not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Config_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Config(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.app.v1alpha1.Query/Config", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Config(ctx, req.(*QueryConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var Query_serviceDesc = _Query_serviceDesc +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.app.v1alpha1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Config", + Handler: _Query_Config_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/app/v1alpha1/query.proto", +} + +func (m *QueryConfigRequest) 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 *QueryConfigRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryConfigRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryConfigResponse) 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 *QueryConfigResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryConfigResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Config != nil { + { + size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryConfigRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryConfigResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Config != nil { + l = m.Config.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryConfigRequest) 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: QueryConfigRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryConfigRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryConfigResponse) 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: QueryConfigResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryConfigResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Config", 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.Config == nil { + m.Config = &Config{} + } + if err := m.Config.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/depinject/binding_test.go b/depinject/binding_test.go index 0aee332d9775..3c90ec5e2e7b 100644 --- a/depinject/binding_test.go +++ b/depinject/binding_test.go @@ -7,20 +7,9 @@ import ( "github.com/stretchr/testify/require" - "github.com/regen-network/gocuke" - "github.com/stretchr/testify/assert" - "cosmossdk.io/depinject" ) -func TestBindInterface(t *testing.T) { - gocuke.NewRunner(t, &bindingSuite{}). - Path("features/bindings.feature"). - Step(`we try to resolve a "Duck" in global scope`, (*bindingSuite).WeTryToResolveADuckInGlobalScope). - Step(`module "(\w+)" wants a "Duck"`, (*bindingSuite).ModuleWantsADuck). - Run() -} - type Duck interface { quack() } @@ -46,115 +35,281 @@ type Pond struct { Ducks []DuckWrapper } -type bindingSuite struct { - gocuke.TestingT // this gets injected by gocuke +func IsResolvedInGlobalScope(t *testing.T, pond Pond, typeName string) { + t.Helper() - configs []depinject.Config - pond *Pond - err error -} + found := false + for _, dw := range pond.Ducks { + if dw.Module == "" { + require.Contains(t, reflect.TypeOf(dw.Duck).Name(), typeName) + found = true + } + } -func (s bindingSuite) AnInterfaceDuck() { - // we don't need to do anything because this is defined at the type level + require.True(t, found) } -func (s bindingSuite) TwoImplementationsMallardAndCanvasback() { - // we don't need to do anything because this is defined at the type level -} +func IsResolvedModuleScope(t *testing.T, pond Pond, module, duckType string) { + t.Helper() -func ProvideMallard() Mallard { return Mallard{} } -func ProvideCanvasback() Canvasback { return Canvasback{} } -func ProvideMarbled() Marbled { return Marbled{} } - -func (s *bindingSuite) IsProvided(a string) { - switch a { - case "Mallard": - s.addConfig(depinject.Provide(ProvideMallard)) - case "Canvasback": - s.addConfig(depinject.Provide(ProvideCanvasback)) - case "Marbled": - s.addConfig(depinject.Provide(ProvideMarbled)) - default: - s.Fatalf("unexpected duck type %s", a) + moduleFound := false + for _, dw := range pond.Ducks { + if dw.Module == module { + require.Contains(t, reflect.TypeOf(dw.Duck).Name(), duckType) + moduleFound = true + } } + require.True(t, moduleFound) } -func (s *bindingSuite) addConfig(config depinject.Config) { - s.configs = append(s.configs, config) -} +func ProvideMallard() Mallard { return Mallard{} } + +func ProvideCanvasback() Canvasback { return Canvasback{} } + +func ProvideMarbled() Marbled { return Marbled{} } func ProvideDuckWrapper(duck Duck) DuckWrapper { return DuckWrapper{Module: "", Duck: duck} } -func (s *bindingSuite) WeTryToResolveADuckInGlobalScope() { - s.addConfig(depinject.Provide(ProvideDuckWrapper)) +func ProvideModuleDuck(duck Duck, key depinject.OwnModuleKey) DuckWrapper { + return DuckWrapper{Module: depinject.ModuleKey(key).Name(), Duck: duck} } func ResolvePond(ducks []DuckWrapper) Pond { return Pond{Ducks: ducks} } -func (s *bindingSuite) resolvePond() *Pond { - if s.pond != nil { - return s.pond - } +func fullTypeName(typeName string) string { + return fmt.Sprintf("cosmossdk.io/depinject_test/depinject_test.%s", typeName) +} + +func TestProvideNoBinding(t *testing.T) { + t.Parallel() + + configs := depinject.Configs( + depinject.Provide( + ProvideMallard, + ProvideDuckWrapper, + ResolvePond, + ), + ) - s.addConfig(depinject.Provide(ResolvePond)) var pond Pond - s.err = depinject.Inject(depinject.Configs(s.configs...), &pond) - s.pond = &pond - return s.pond + err := depinject.Inject(configs, &pond) + require.NoError(t, err) + + IsResolvedInGlobalScope(t, pond, "Mallard") } -func (s *bindingSuite) IsResolvedInGlobalScope(typeName string) { - pond := s.resolvePond() - found := false - for _, dw := range pond.Ducks { - if dw.Module == "" { - require.Contains(s, reflect.TypeOf(dw.Duck).Name(), typeName) - found = true - } - } - assert.True(s, found) +func TestProvideNoBindingImplementationErrorAmbiguous(t *testing.T) { + t.Parallel() + + configs := depinject.Configs( + depinject.Provide( + ProvideMallard, + ProvideCanvasback, + ProvideDuckWrapper, + ResolvePond, + ), + ) + + var pond Pond + err := depinject.Inject(configs, &pond) + require.ErrorContains(t, err, "Multiple implementations found") } -func (s *bindingSuite) ThereIsAError(expectedErrorMsg string) { - s.resolvePond() - assert.ErrorContains(s, s.err, expectedErrorMsg) +func TestBindInterface(t *testing.T) { + t.Parallel() + + configs := depinject.Configs( + depinject.BindInterface(fullTypeName("Duck"), fullTypeName("Mallard")), + depinject.Provide( + ProvideMallard, + ProvideDuckWrapper, + ResolvePond, + ), + ) + + var pond Pond + err := depinject.Inject(configs, &pond) + require.NoError(t, err) } -func (s *bindingSuite) ThereIsNoError() { - s.resolvePond() - assert.NoError(s, s.err) +func TestBindInterfaceBoundTypeNotProvided(t *testing.T) { + t.Parallel() + + configs := depinject.Configs( + depinject.BindInterface(fullTypeName("Duck"), fullTypeName("Marbled")), + depinject.Provide( + ProvideMallard, + ProvideDuckWrapper, + ResolvePond, + ), + ) + + var pond Pond + err := depinject.Inject(configs, &pond) + require.ErrorContains(t, err, "No type for explicit binding") } -func fullTypeName(typeName string) string { - return fmt.Sprintf("cosmossdk.io/depinject_test/depinject_test.%s", typeName) +func TestBindInterfaceOverwriteImplicitTypeResolution(t *testing.T) { + t.Parallel() + + configs := depinject.Configs( + depinject.BindInterface(fullTypeName("Duck"), fullTypeName("Marbled")), // overwrite Canvasback + depinject.Provide( + ProvideCanvasback, + ProvideDuckWrapper, + ResolvePond, + ), + ) + + var pond Pond + err := depinject.Inject(configs, &pond) + require.ErrorContains(t, err, "No type for explicit binding") + + // same in module scope + moduleName := "A" + configs = depinject.Configs( + depinject.BindInterfaceInModule(moduleName, fullTypeName("Duck"), fullTypeName("Marbled")), // overwrite Canvasback + depinject.Provide( + ProvideCanvasback, + ResolvePond, + ), + depinject.ProvideInModule(moduleName, ProvideModuleDuck), + ) + + err = depinject.Inject(configs, &pond) + require.ErrorContains(t, err, "No type for explicit binding") } -func (s *bindingSuite) ThereIsAGlobalBindingForA(preferredType, interfaceType string) { - s.addConfig(depinject.BindInterface(fullTypeName(interfaceType), fullTypeName(preferredType))) +func TestBindingInterfaceGlobalScopeApplyToGlobalAndModuleScope(t *testing.T) { + t.Parallel() + + configs := depinject.Configs( + depinject.BindInterface(fullTypeName("Duck"), fullTypeName("Mallard")), // order is important + depinject.Provide( + ProvideMallard, + ProvideCanvasback, + ProvideDuckWrapper, + ResolvePond, + ), + ) + + var pond Pond + err := depinject.Inject(configs, &pond) + require.NoError(t, err) + IsResolvedInGlobalScope(t, pond, "Mallard") + + // same in module scope + moduleName := "A" + configs = depinject.Configs( + depinject.BindInterface(fullTypeName("Duck"), fullTypeName("Mallard")), + depinject.Provide( + ProvideMallard, + ProvideCanvasback, + ResolvePond, + ), + depinject.ProvideInModule(moduleName, ProvideModuleDuck), + ) + + err = depinject.Inject(configs, &pond) + require.NoError(t, err) + IsResolvedModuleScope(t, pond, moduleName, "Mallard") } -func (s *bindingSuite) ThereIsABindingForAInModule(preferredType, interfaceType, moduleName string) { - s.addConfig(depinject.BindInterfaceInModule(moduleName, fullTypeName(interfaceType), fullTypeName(preferredType))) +func TestBindingInterfaceModuleScopeApplyOnlyModuleScope(t *testing.T) { + t.Parallel() + + moduleName := "A" + configs := depinject.Configs( + depinject.BindInterfaceInModule(moduleName, fullTypeName("Duck"), fullTypeName("Canvasback")), + depinject.Provide( + ProvideMallard, + ProvideCanvasback, + ProvideDuckWrapper, + ResolvePond, + ), + ) + + var pond Pond + err := depinject.Inject(configs, &pond) + require.ErrorContains(t, err, "Multiple implementations found") + + configs = depinject.Configs( + depinject.BindInterfaceInModule(moduleName, fullTypeName("Duck"), fullTypeName("Canvasback")), + depinject.Provide( + ProvideMallard, + ProvideCanvasback, + ResolvePond, + ), + depinject.ProvideInModule(moduleName, ProvideModuleDuck), + ) + + err = depinject.Inject(configs, &pond) + require.NoError(t, err) + IsResolvedModuleScope(t, pond, moduleName, "Canvasback") } -func ProvideModuleDuck(duck Duck, key depinject.OwnModuleKey) DuckWrapper { - return DuckWrapper{Module: depinject.ModuleKey(key).Name(), Duck: duck} +func TestBindingInterfaceModuleScopeApplyCorrectModule(t *testing.T) { + t.Parallel() + + moduleName := "A" + configs := depinject.Configs( + depinject.BindInterfaceInModule(moduleName, fullTypeName("Duck"), fullTypeName("Canvasback")), + depinject.Provide( + ProvideMallard, + ProvideCanvasback, + ProvideDuckWrapper, + ResolvePond, + ), + depinject.ProvideInModule("B", ProvideModuleDuck), + ) + + var pond Pond + err := depinject.Inject(configs, &pond) + require.ErrorContains(t, err, "Multiple implementations found") } -func (s *bindingSuite) ModuleWantsADuck(module string) { - s.addConfig(depinject.ProvideInModule(module, ProvideModuleDuck)) +func TestBindingInterfaceTwoModuleScopedAndGlobalBinding(t *testing.T) { + t.Parallel() + + moduleA, moduleB, moduleC := "A", "B", "C" + + configs := depinject.Configs( + depinject.BindInterface(fullTypeName("Duck"), fullTypeName("Marbled")), + depinject.BindInterfaceInModule(moduleA, fullTypeName("Duck"), fullTypeName("Canvasback")), + depinject.BindInterfaceInModule(moduleB, fullTypeName("Duck"), fullTypeName("Mallard")), + depinject.Provide( + ProvideMallard, + ProvideCanvasback, + ProvideMarbled, + ProvideDuckWrapper, + ResolvePond, + ), + depinject.ProvideInModule(moduleA, ProvideModuleDuck), + depinject.ProvideInModule(moduleB, ProvideModuleDuck), + depinject.ProvideInModule(moduleC, ProvideModuleDuck), + ) + + var pond Pond + err := depinject.Inject(configs, &pond) + require.NoError(t, err) + + IsResolvedModuleScope(t, pond, moduleA, "Canvasback") + IsResolvedModuleScope(t, pond, moduleB, "Mallard") + IsResolvedModuleScope(t, pond, moduleC, "Marbled") + IsResolvedInGlobalScope(t, pond, "Marbled") } -func (s *bindingSuite) ModuleResolvesA(module, duckType string) { - pond := s.resolvePond() - moduleFound := false - for _, dw := range pond.Ducks { - if dw.Module == module { - assert.Contains(s, reflect.TypeOf(dw.Duck).Name(), duckType) - moduleFound = true - } - } - assert.True(s, moduleFound) +func TestIgnoredField(t *testing.T) { + t.Parallel() + cfg := struct { + depinject.In + TheDuck Duck + privateField bool + AnotherDuck Duck + }{} + + err := depinject.Inject(depinject.Provide(ProvideMallard), &cfg) + require.NoError(t, err) } diff --git a/depinject/check_type.go b/depinject/check_type.go index 5df053fd6ccc..01bcd07d7f0b 100644 --- a/depinject/check_type.go +++ b/depinject/check_type.go @@ -1,12 +1,11 @@ package depinject import ( + "fmt" "reflect" + "slices" "strings" "unicode" - - "github.com/cockroachdb/errors" - "golang.org/x/exp/slices" ) // isExportedType checks if the type is exported and not in an internal @@ -21,12 +20,12 @@ func isExportedType(typ reflect.Type) error { pkgPath := typ.PkgPath() if name != "" && pkgPath != "" { if unicode.IsLower([]rune(name)[0]) { - return errors.Errorf("type must be exported: %s", typ) + return fmt.Errorf("type must be exported: %s", typ) } pkgParts := strings.Split(pkgPath, "/") if slices.Contains(pkgParts, "internal") { - return errors.Errorf("type must not come from an internal package: %s", typ) + return fmt.Errorf("type must not come from an internal package: %s", typ) } return nil diff --git a/depinject/config.go b/depinject/config.go index 947539c4b34f..8547fda40f8b 100644 --- a/depinject/config.go +++ b/depinject/config.go @@ -1,9 +1,10 @@ package depinject import ( + "errors" + "fmt" "reflect" - - "github.com/cockroachdb/errors" + "runtime" ) // Config is a functional configuration of a container. @@ -33,7 +34,7 @@ func Provide(providers ...interface{}) Config { func ProvideInModule(moduleName string, providers ...interface{}) Config { return containerConfig(func(ctr *container) error { if moduleName == "" { - return errors.Errorf("expected non-empty module name") + return errors.New("expected non-empty module name") } return provide(ctr, ctr.moduleKeyContext.createOrGetModuleKey(moduleName), providers) @@ -44,11 +45,11 @@ func provide(ctr *container, key *moduleKey, providers []interface{}) error { for _, c := range providers { rc, err := extractProviderDescriptor(c) if err != nil { - return errors.WithStack(err) + return fmt.Errorf("%w\n%s", err, getStackTrace()) } _, err = ctr.addNode(&rc, key) if err != nil { - return errors.WithStack(err) + return fmt.Errorf("%w\n%s", err, getStackTrace()) } } return nil @@ -80,7 +81,7 @@ func Invoke(invokers ...interface{}) Config { func InvokeInModule(moduleName string, invokers ...interface{}) Config { return containerConfig(func(ctr *container) error { if moduleName == "" { - return errors.Errorf("expected non-empty module name") + return errors.New("expected non-empty module name") } return invoke(ctr, ctr.moduleKeyContext.createOrGetModuleKey(moduleName), invokers) @@ -91,7 +92,7 @@ func invoke(ctr *container, key *moduleKey, invokers []interface{}) error { for _, c := range invokers { rc, err := extractInvokerDescriptor(c) if err != nil { - return errors.WithStack(err) + return fmt.Errorf("%w\n%s", err, getStackTrace()) } err = ctr.addInvoker(&rc, key) if err != nil { @@ -151,7 +152,7 @@ func Supply(values ...interface{}) Config { for _, v := range values { err := ctr.supply(reflect.ValueOf(v), loc) if err != nil { - return errors.WithStack(err) + return fmt.Errorf("%w\n%s", err, getStackTrace()) } } return nil @@ -162,7 +163,7 @@ func Supply(values ...interface{}) Config { // fail immediately. func Error(err error) Config { return containerConfig(func(*container) error { - return errors.WithStack(err) + return fmt.Errorf("%w\n%s", err, getStackTrace()) }) } @@ -172,7 +173,7 @@ func Configs(opts ...Config) Config { for _, opt := range opts { err := opt.apply(ctr) if err != nil { - return errors.WithStack(err) + return fmt.Errorf("%w\n%s", err, getStackTrace()) } } return nil @@ -186,3 +187,9 @@ func (c containerConfig) apply(ctr *container) error { } var _ Config = (*containerConfig)(nil) + +func getStackTrace() string { + var stack [4096]byte + n := runtime.Stack(stack[:], false) + return string(stack[:n]) +} diff --git a/depinject/container.go b/depinject/container.go index 1ca20cc81cfa..948a4b545cac 100644 --- a/depinject/container.go +++ b/depinject/container.go @@ -2,11 +2,10 @@ package depinject import ( "bytes" + stderrors "errors" "fmt" "reflect" - "github.com/cockroachdb/errors" - "cosmossdk.io/depinject/internal/graphviz" ) @@ -62,7 +61,7 @@ func (c *container) call(provider *providerDescriptor, moduleKey *moduleKey) ([] markGraphNodeAsFailed(graphNode) if c.callerMap[loc] { - return nil, errors.Errorf("cyclic dependency: %s -> %s", loc.Name(), loc.Name()) + return nil, fmt.Errorf("cyclic dependency: %s -> %s", loc.Name(), loc.Name()) } c.callerMap[loc] = true @@ -72,6 +71,9 @@ func (c *container) call(provider *providerDescriptor, moduleKey *moduleKey) ([] c.indentLogger() inVals := make([]reflect.Value, len(provider.Inputs)) for i, in := range provider.Inputs { + if in.Ignored { + continue + } val, err := c.resolve(in, moduleKey, loc) if err != nil { return nil, err @@ -86,7 +88,7 @@ func (c *container) call(provider *providerDescriptor, moduleKey *moduleKey) ([] out, err := provider.Fn(inVals) if err != nil { - return nil, errors.Wrapf(err, "error calling provider %s", loc) + return nil, fmt.Errorf("error calling provider %s: %w", loc, err) } markGraphNodeAsUsed(graphNode) @@ -235,9 +237,6 @@ func (c *container) addNode(provider *providerDescriptor, key *moduleKey) (inter typeGraphNode = vr.typeGraphNode() } else { typeGraphNode = c.typeGraphNode(typ) - if err != nil { - return nil, err - } } c.addGraphEdge(typeGraphNode, providerGraphNode) @@ -298,7 +297,7 @@ func (c *container) addNode(provider *providerDescriptor, key *moduleKey) (inter } if hasOwnModuleKeyParam { - return nil, errors.Errorf("%T and %T must not be declared as dependencies on the same provided", + return nil, fmt.Errorf("%T and %T must not be declared as dependencies on the same provided", ModuleKey{}, OwnModuleKey{}) } @@ -319,7 +318,7 @@ func (c *container) addNode(provider *providerDescriptor, key *moduleKey) (inter existing, ok := c.resolverByType(typ) if ok { - return nil, errors.Errorf("duplicate provision of type %v by module-scoped provider %s\n\talready provided by %s", + return nil, fmt.Errorf("duplicate provision of type %v by module-scoped provider %s\n\talready provided by %s", typ, provider.Location, existing.describeLocation()) } @@ -380,7 +379,7 @@ func (c *container) resolve(in providerInput, moduleKey *moduleKey, caller Locat if in.Type == moduleKeyType { if moduleKey == nil { - return reflect.Value{}, errors.Errorf("trying to resolve %T for %s but not inside of any module's scope", moduleKey, caller) + return reflect.Value{}, fmt.Errorf("trying to resolve %T for %s but not inside of any module's scope", moduleKey, caller) } c.logf("Providing ModuleKey %s", moduleKey.name) markGraphNodeAsUsed(typeGraphNode) @@ -389,7 +388,7 @@ func (c *container) resolve(in providerInput, moduleKey *moduleKey, caller Locat if in.Type == ownModuleKeyType { if moduleKey == nil { - return reflect.Value{}, errors.Errorf("trying to resolve %T for %s but not inside of any module's scope", moduleKey, caller) + return reflect.Value{}, fmt.Errorf("trying to resolve %T for %s but not inside of any module's scope", moduleKey, caller) } c.logf("Providing OwnModuleKey %s", moduleKey.name) markGraphNodeAsUsed(typeGraphNode) @@ -408,7 +407,7 @@ func (c *container) resolve(in providerInput, moduleKey *moduleKey, caller Locat } markGraphNodeAsFailed(typeGraphNode) - return reflect.Value{}, errors.Errorf("can't resolve type %v for %s:\n%s", + return reflect.Value{}, fmt.Errorf("can't resolve type %v for %s:\n%s", fullyQualifiedTypeName(in.Type), caller, c.formatResolveStack()) } @@ -441,7 +440,7 @@ func (c *container) build(loc Location, outputs ...interface{}) error { Outputs: nil, Fn: func(values []reflect.Value) ([]reflect.Value, error) { if len(values) != len(outputs) { - return nil, fmt.Errorf("internal error, unexpected number of values") + return nil, stderrors.New("internal error, unexpected number of values") } for i, output := range outputs { @@ -477,7 +476,7 @@ func (c *container) build(loc Location, outputs ...interface{}) error { sn, ok := node.(*simpleProvider) if !ok { - return errors.Errorf("cannot run module-scoped provider as an invoker") + return stderrors.New("cannot run module-scoped provider as an invoker") } c.logf("Building container") diff --git a/depinject/container_test.go b/depinject/container_test.go index cf9394a56b11..925ae44e3048 100644 --- a/depinject/container_test.go +++ b/depinject/container_test.go @@ -1,6 +1,7 @@ package depinject_test import ( + "errors" "fmt" "os" "testing" @@ -212,7 +213,7 @@ func TestUnexportedField(t *testing.T) { "depinject.Out struct", ) - require.ErrorContains(t, + require.NoError(t, depinject.Inject( scenarioConfigDependency, &handlers, @@ -220,7 +221,6 @@ func TestUnexportedField(t *testing.T) { &a, &c, ), - "depinject.In struct", ) require.ErrorContains(t, @@ -300,7 +300,7 @@ func TestCyclic(t *testing.T) { } func TestErrorOption(t *testing.T) { - err := depinject.Inject(depinject.Error(fmt.Errorf("an error"))) + err := depinject.Inject(depinject.Error(errors.New("an error"))) require.Error(t, err) } @@ -606,7 +606,7 @@ func ProvideTestOutput() (TestOutput, error) { } func ProvideTestOutputErr() (TestOutput, error) { - return TestOutput{}, fmt.Errorf("error") + return TestOutput{}, errors.New("error") } func TestStructArgs(t *testing.T) { @@ -744,3 +744,50 @@ func TestConditionalDebugging(t *testing.T) { require.Empty(t, logs) require.True(t, success) } + +type TestFuncTypesInputs struct { + depinject.In + + DuckReturner func() Duck `optional:"true"` +} + +type smallMallard struct{} + +func (smallMallard) quack() {} + +func DuckProvider(in TestFuncTypesInputs) Duck { + if in.DuckReturner != nil { + return in.DuckReturner() + } + return Mallard{} +} + +func TestFuncTypes(t *testing.T) { + var duckReturnerFactory func() Duck + err := depinject.Inject( + depinject.Supply(func() Duck { return smallMallard{} }), + &duckReturnerFactory) + require.NoError(t, err) + _, ok := duckReturnerFactory().(smallMallard) + require.True(t, ok) + + var duck Duck + err = depinject.Inject( + depinject.Configs( + depinject.Supply(func() Duck { return smallMallard{} }), + depinject.Provide(DuckProvider), + ), + &duck) + _, ok = duck.(smallMallard) + require.True(t, ok) + require.NoError(t, err) + + err = depinject.Inject( + depinject.Configs( + depinject.Provide(DuckProvider), + ), + &duck) + _, ok = duck.(Mallard) + require.True(t, ok) + require.NoError(t, err) +} diff --git a/depinject/errors.go b/depinject/errors.go index ebef77d47e38..94b9956a0115 100644 --- a/depinject/errors.go +++ b/depinject/errors.go @@ -3,8 +3,6 @@ package depinject import ( "fmt" "reflect" - - "github.com/cockroachdb/errors" ) // ErrMultipleImplicitInterfaceBindings defines an error condition where an attempt was made to implicitly bind @@ -63,6 +61,6 @@ func (err ErrNoTypeForExplicitBindingFound) Error() string { } func duplicateDefinitionError(typ reflect.Type, duplicateLoc Location, existingLoc string) error { - return errors.Errorf("duplicate provision of type %v by %s\n\talready provided by %s", + return fmt.Errorf("duplicate provision of type %v by %s\n\talready provided by %s", typ, duplicateLoc, existingLoc) } diff --git a/depinject/features/bindings.feature b/depinject/features/bindings.feature deleted file mode 100644 index fafa61de2b91..000000000000 --- a/depinject/features/bindings.feature +++ /dev/null @@ -1,94 +0,0 @@ -Feature: interface type resolution - - Background: - Given an interface Duck - And two implementations Mallard and Canvasback - - Rule: interface types resolve to a concrete type implicitly if there is only one matching implementation - Example: only one implementation - Given "Mallard" is provided - When we try to resolve a "Duck" in global scope - Then "Mallard" is resolved in global scope - - Example: two implementations - Given "Mallard" is provided - * "Canvasback" is provided - When we try to resolve a "Duck" in global scope - Then there is a "Multiple implementations found" error - - Rule: bindings must point to a real type - Example: a bound type is not provided - Given "Mallard" is provided - And there is a global binding for a "Marbled" "Duck" - When we try to resolve a "Duck" in global scope - Then there is a "No type for explicit binding" error - - Rule: bindings supersede implicit type resolution - Example: global scope - Given "Canvasback" is provided - And there is a global binding for a "Mallard" "Duck" - When we try to resolve a "Duck" in global scope - Then there is a "No type for explicit binding" error - - Example: module scope - Given "Canvasback" is provided - And there is a binding for a "Mallard" "Duck" in module "A" - When module "A" wants a "Duck" - Then there is a "No type for explicit binding" error - - Rule: bindings in global scope apply to both global and module-scoped resolution (if there is no module-scoped binding) - Example: global resolution - Given "Mallard" is provided - And "Canvasback" is provided - And there is a global binding for a "Mallard" "Duck" - When we try to resolve a "Duck" in global scope - Then "Mallard" is resolved in global scope - - Example: module-scoped resolution - Given "Mallard" is provided - And "Canvasback" is provided - And there is a global binding for a "Mallard" "Duck" - When module "A" wants a "Duck" - Then module "A" resolves a "Mallard" - - Rule: module-scoped bindings only apply to module-scoped resolution - Example: a module-scoped binding doesn't work for global scope - Given "Mallard" is provided - * "Canvasback" is provided - * there is a binding for a "Canvasback" "Duck" in module "A" - When we try to resolve a "Duck" in global scope - Then there is a "Multiple implementations found" error - - Example: a module-scoped binding works for that module - Given "Mallard" is provided - * "Canvasback" is provided - * there is a binding for a "Canvasback" "Duck" in module "A" - When module "A" wants a "Duck" - Then module "A" resolves a "Canvasback" - - Example: a module-scoped binding doesn't work for another module - Given "Mallard" is provided - * "Canvasback" is provided - * there is a binding for a "Canvasback" "Duck" in module "A" - When module "B" wants a "Duck" - Then there is a "Multiple implementations found" error - - # this case is called a "journey" scenario which tests a bunch of things together - # most tests should be short and to the point like the ones above but one or two long ones - # are good to test more things together &/or do integration tests - Example: two module-scoped binding and a global binding - Given "Mallard" is provided - * "Canvasback" is provided - * "Marbled" is provided - * there is a global binding for a "Marbled" "Duck" - * there is a binding for a "Canvasback" "Duck" in module "A" - * there is a binding for a "Mallard" "Duck" in module "B" - When module "A" wants a "Duck" - * module "B" wants a "Duck" - * module "C" wants a "Duck" - * we try to resolve a "Duck" in global scope - Then there is no error - * module "A" resolves a "Canvasback" - * module "B" resolves a "Mallard" - * module "C" resolves a "Marbled" - * "Marbled" is resolved in global scope diff --git a/depinject/features/invoke.feature b/depinject/features/invoke.feature deleted file mode 100644 index 7f4e9ee1836d..000000000000 --- a/depinject/features/invoke.feature +++ /dev/null @@ -1,30 +0,0 @@ -Feature: invokers - - Invokers are functions the will always get called, have strictly optional - dependencies and no return outputs (other than error). - - Background: - - Rule: invokers get called even if their dependencies can't be resolved - Example: no providers - Given an invoker requesting an int and string pointer - When the container is built - Then the invoker will get the int parameter set to 0 - And the invoker will get the string pointer parameter set to nil - - Rule: invokers get called with dependencies if they are provided - Example: int and string pointer providers - Given an invoker requesting an int and string pointer - And an int provider returning 5 - And a string pointer provider pointing to "foo" - When the container is built - Then the invoker will get the int parameter set to 5 - And the invoker will get the string pointer parameter set to "foo" - - Rule: invokers get module scoped dependencies - Example: module-scoped int - Given an invoker requesting an int and string pointer run in module "foo" - And a module-scoped int provider which returns the length of the module name - When the container is built - Then the invoker will get the int parameter set to 3 - And the invoker will get the string pointer parameter set to nil diff --git a/depinject/go.mod b/depinject/go.mod index 385c8a4dd8a4..7bf68f16ef24 100644 --- a/depinject/go.mod +++ b/depinject/go.mod @@ -1,35 +1,42 @@ module cosmossdk.io/depinject -go 1.20 +go 1.23 require ( - github.com/cockroachdb/errors v1.9.1 - github.com/regen-network/gocuke v0.6.2 - github.com/stretchr/testify v1.8.4 - golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e - gotest.tools/v3 v3.4.0 + github.com/cosmos/cosmos-proto v1.0.0-beta.5 + github.com/cosmos/cosmos-sdk v0.50.13 + github.com/cosmos/gogoproto v1.7.0 + github.com/stretchr/testify v1.10.0 + google.golang.org/grpc v1.71.0 + google.golang.org/protobuf v1.36.5 + gotest.tools/v3 v3.5.2 + sigs.k8s.io/yaml v1.4.0 ) require ( - github.com/alecthomas/participle/v2 v2.0.0-alpha7 // indirect - github.com/cockroachdb/apd/v3 v3.1.0 // indirect - github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f // indirect - github.com/cockroachdb/redact v1.1.3 // indirect - github.com/cucumber/common/gherkin/go/v22 v22.0.0 // indirect - github.com/cucumber/common/messages/go/v17 v17.1.1 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/getsentry/sentry-go v0.12.0 // indirect - github.com/gofrs/uuid v4.2.0+incompatible // indirect - github.com/gogo/protobuf v1.3.2 // indirect - github.com/google/go-cmp v0.5.8 // indirect - github.com/kr/pretty v0.3.0 // indirect - github.com/kr/text v0.2.0 // indirect - github.com/lib/pq v1.10.6 // indirect + cosmossdk.io/api v0.7.6 // indirect + cosmossdk.io/core v0.11.0 // indirect + cosmossdk.io/errors v1.0.1 // indirect + cosmossdk.io/x/tx v0.13.7 // indirect + github.com/cometbft/cometbft v0.38.17 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect + github.com/golang/protobuf v1.5.4 // indirect + github.com/google/go-cmp v0.7.0 // indirect + github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect + github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rogpeppe/go-internal v1.8.1 // indirect - golang.org/x/sys v0.5.0 // indirect - gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/sasha-s/go-deadlock v0.3.5 // indirect + github.com/tendermint/go-amino v0.16.0 // indirect + golang.org/x/crypto v0.32.0 // indirect + golang.org/x/net v0.34.0 // indirect + golang.org/x/sys v0.29.0 // indirect + golang.org/x/text v0.21.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250122153221-138b5a5a4fd4 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - pgregory.net/rapid v0.6.2 // indirect ) + +// keep grpc 1.67.1 to avoid go minimum version bump (depinject should be compatible with 0.47, 0.50 and 0.52) +replace google.golang.org/grpc => google.golang.org/grpc v1.67.1 diff --git a/depinject/go.sum b/depinject/go.sum index 16b450b19f55..7f06423882d5 100644 --- a/depinject/go.sum +++ b/depinject/go.sum @@ -1,365 +1,200 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= -github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= -github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= -github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= -github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= -github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c= -github.com/alecthomas/participle/v2 v2.0.0-alpha7/go.mod h1:NumScqsC42o9x+dGj8/YqsIfhrIQjFEOFovxotbBirA= -github.com/alecthomas/repr v0.0.0-20181024024818-d37bc2a10ba1 h1:GDQdwm/gAcJcLAKQQZGOJ4knlw+7rfEQQcmwTbt4p5E= -github.com/alecthomas/repr v0.0.0-20181024024818-d37bc2a10ba1/go.mod h1:xTS7Pm1pD1mvyM075QCDSRqH6qRLXylzS24ZTpRiSzQ= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= -github.com/cockroachdb/apd/v3 v3.1.0/go.mod h1:6qgPBMXjATAdD/VefbRP9NoSLKjbB4LCoA7gN4LpHs4= -github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= -github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= -github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= -github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f h1:6jduT9Hfc0njg5jJ1DdKCFPdMBrp/mdZfCpa5h+WM74= -github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ= -github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= -github.com/cucumber/common/gherkin/go/v22 v22.0.0/go.mod h1:3mJT10B2GGn3MvVPd3FwR7m2u4tLhSRhWUqJU4KN4Fg= -github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= -github.com/cucumber/common/messages/go/v17 v17.1.1/go.mod h1:bpGxb57tDE385Rb2EohgUadLkAbhoC4IyCFi89u/JQI= +cosmossdk.io/api v0.7.6 h1:PC20PcXy1xYKH2KU4RMurVoFjjKkCgYRbVAD4PdqUuY= +cosmossdk.io/api v0.7.6/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= +cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= +cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= +cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= +cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= +cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= +cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= +cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= +cosmossdk.io/math v1.4.0 h1:XbgExXFnXmF/CccPPEto40gOO7FpWu9yWNAZPN3nkNQ= +cosmossdk.io/math v1.4.0/go.mod h1:O5PkD4apz2jZs4zqFdTr16e1dcaQCc5z6lkEnrrppuk= +cosmossdk.io/store v1.1.1 h1:NA3PioJtWDVU7cHHeyvdva5J/ggyLDkyH0hGHl2804Y= +cosmossdk.io/store v1.1.1/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM= +cosmossdk.io/x/tx v0.13.7 h1:8WSk6B/OHJLYjiZeMKhq7DK7lHDMyK0UfDbBMxVmeOI= +cosmossdk.io/x/tx v0.13.7/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w= +github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= +github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/btcsuite/btcd/btcutil v1.1.6 h1:zFL2+c3Lb9gEgqKNzowKUPQNb8jV7v5Oaodi/AYFd6c= +github.com/btcsuite/btcd/btcutil v1.1.6/go.mod h1:9dFymx8HpuLqBnsPELrImQeTQfKBQqzqGbbV3jK55aE= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= +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/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= +github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce h1:giXvy4KSc/6g/esnpM7Geqxka4WSqI1SZc7sMJFd3y4= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/pebble v1.1.2 h1:CUh2IPtR4swHlEj48Rhfzw6l/d0qA31fItcIszQVIsA= +github.com/cockroachdb/pebble v1.1.2/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= +github.com/cometbft/cometbft v0.38.17 h1:FkrQNbAjiFqXydeAO81FUzriL4Bz0abYxN/eOHrQGOk= +github.com/cometbft/cometbft v0.38.17/go.mod h1:5l0SkgeLRXi6bBfQuevXjKqML1jjfJJlvI1Ulp02/o4= +github.com/cometbft/cometbft-db v0.14.1 h1:SxoamPghqICBAIcGpleHbmoPqy+crij/++eZz3DlerQ= +github.com/cometbft/cometbft-db v0.14.1/go.mod h1:KHP1YghilyGV/xjD5DP3+2hyigWx0WTp9X+0Gnx0RxQ= +github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= +github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= +github.com/cosmos/cosmos-db v1.1.1 h1:FezFSU37AlBC8S98NlSagL76oqBRWq/prTPvFcEJNCM= +github.com/cosmos/cosmos-db v1.1.1/go.mod h1:AghjcIPqdhSLP/2Z0yha5xPH3nLnskz81pBx3tcVSAw= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= +github.com/cosmos/cosmos-sdk v0.50.13 h1:xQ32hhzVy7agEe7behMdZN0ezWhPss3KoLZsF9KoBnw= +github.com/cosmos/cosmos-sdk v0.50.13/go.mod h1:hrWEFMU1eoXqLJeE6VVESpJDQH67FS1nnMrQIjO2daw= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= +github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= +github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= -github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= -github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= -github.com/getsentry/sentry-go v0.12.0 h1:era7g0re5iY13bHSdN/xMkyV+5zZppjRVQhZrXCaEIk= -github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= -github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= -github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= -github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= -github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= -github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= -github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= -github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= -github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= -github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gofrs/uuid v4.2.0+incompatible h1:yyYWMnhkhrKwwr8gAOcOCYxOOscHgDS9yZgBrnJfGa0= -github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= -github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= -github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= +github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/dgraph-io/badger/v4 v4.2.0 h1:kJrlajbXXL9DFTNuhhu9yCx7JJa4qpYWxtE8BzuWsEs= +github.com/dgraph-io/badger/v4 v4.2.0/go.mod h1:qfCqhPoWDFJRx1gp5QwwyGo8xk1lbHUxvK9nK0OGAak= +github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= +github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= +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/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= +github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= +github.com/go-kit/kit v0.13.0 h1:OoneCcHKHQ03LfBpoQCUfCluwd2Vt3ohz+kvbJneZAU= +github.com/go-kit/kit v0.13.0/go.mod h1:phqEHMMUbyrCFCTgH48JueqrM3md2HcAZ8N3XE4FKDg= +github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= +github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= +github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= +github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= -github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -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= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= -github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= -github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= -github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= -github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= -github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= -github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= -github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= -github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= -github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= -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/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= -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/golang/glog v1.2.3 h1:oDTdz9f5VGVVNGu/Q7UXKWYsD0873HXLHdJUNBsSEKM= +github.com/golang/glog v1.2.3/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= +github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= +github.com/google/flatbuffers v1.12.1 h1:MVlul7pQNoDzWRLTw5imwYsl+usrS1TXG2H4jg6ImGw= +github.com/google/flatbuffers v1.12.1/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= +github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-metrics v0.5.3 h1:M5uADWMOGCTUNU1YuC4hfknOeHNaX54LDm4oYSucoNE= +github.com/hashicorp/go-metrics v0.5.3/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= +github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= 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.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= -github.com/lib/pq v1.10.6 h1:jbk+ZieJ0D7EVGJYpL9QTz7/YW6UHbmdnZWYyK5cdBs= -github.com/lib/pq v1.10.6/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= -github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= -github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= -github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= -github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= -github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= -github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= -github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +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/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a h1:dlRvE5fWabOchtH7znfiFCcOvmIYgOeAS5ifBXBlh9Q= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 h1:Dx7Ovyv/SFnMFw3fD4oEoeorXc6saIiQ23LrGLth0Gw= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/regen-network/gocuke v0.6.2 h1:pHviZ0kKAq2U2hN2q3smKNxct6hS0mGByFMHGnWA97M= -github.com/regen-network/gocuke v0.6.2/go.mod h1:zYaqIHZobHyd0xOrHGPQjbhGJsuZ1oElx150u2o1xuk= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= -github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= +github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= +github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io= +github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= +github.com/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb2NsU= +github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U= +github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= +github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= -github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= -github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= -github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/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-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA= -golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -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= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= +github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= +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= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 h1:qxen9oVGzDdIRP6ejyAJc760RwW4SnVDiTYTzwnXuxo= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5/go.mod h1:eW0HG9/oHQhvRCvb1/pIXW4cOvtDqeQK+XSi3TnwaXY= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -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= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -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-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181221001348-537d06c36207/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-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -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= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= +google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 h1:wKguEg1hsxI2/L3hUYrpo1RVi48K+uTyzKqprwLXsb8= +google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142/go.mod h1:d6be+8HhtEtucleCbxpPW9PA9XwISACu8nvpPqF0BVo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250122153221-138b5a5a4fd4 h1:yrTuav+chrF0zF/joFGICKTzYv7mh/gr9AgEXrVU8ao= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250122153221-138b5a5a4fd4/go.mod h1:+2Yz8+CLJbIfL9z73EW45avw8Lmge3xVElCP9zEKi50= +google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= +google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= +google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= +google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 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/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= -gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -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= -gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= -gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -pgregory.net/rapid v0.6.2 h1:ErW5sL+UKtfBfUTsWHDCoeB+eZKLKMxrSd1VJY6W4bw= -pgregory.net/rapid v0.6.2/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= +gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q= +gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA= +pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= +pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/depinject/group.go b/depinject/group.go index 43bbce7b396a..e6d008012305 100644 --- a/depinject/group.go +++ b/depinject/group.go @@ -4,8 +4,6 @@ import ( "fmt" "reflect" - "github.com/cockroachdb/errors" - "cosmossdk.io/depinject/internal/graphviz" ) @@ -85,7 +83,7 @@ func (g *sliceGroupResolver) resolve(c *container, _ *moduleKey, caller Location } func (g *groupResolver) resolve(_ *container, _ *moduleKey, _ Location) (reflect.Value, error) { - return reflect.Value{}, errors.Errorf("%v is an many-per-container type and cannot be used as an input value, instead use %v", g.typ, g.sliceType) + return reflect.Value{}, fmt.Errorf("%v is a many-per-container type and cannot be used as an input value, instead use %v", g.typ, g.sliceType) } func (g *groupResolver) addNode(n *simpleProvider, i int) error { diff --git a/depinject/internal/appconfig/buf.gen.pulsar.yaml b/depinject/internal/appconfig/buf.gen.pulsar.yaml new file mode 100644 index 000000000000..fbc7775f4871 --- /dev/null +++ b/depinject/internal/appconfig/buf.gen.pulsar.yaml @@ -0,0 +1,9 @@ +version: v1 +managed: + enabled: true + go_package_prefix: + default: cosmossdk.io/depinject +plugins: + - name: go-pulsar + out: . + opt: paths=source_relative,Mcosmos/app/v1alpha1/module.proto=cosmossdk.io/depinject/appconfig/v1alpha1 diff --git a/depinject/internal/appconfig/buf.lock b/depinject/internal/appconfig/buf.lock new file mode 100644 index 000000000000..28c135cc08bb --- /dev/null +++ b/depinject/internal/appconfig/buf.lock @@ -0,0 +1,28 @@ +# Generated by buf. DO NOT EDIT. +version: v1 +deps: + - remote: buf.build + owner: cosmos + repository: cosmos-proto + commit: 04467658e59e44bbb22fe568206e1f70 + digest: shake256:73a640bd60e0c523b0f8237ff34eab67c45a38b64bbbde1d80224819d272dbf316ac183526bd245f994af6608b025f5130483d0133c5edd385531326b5990466 + - remote: buf.build + owner: cosmos + repository: cosmos-sdk + commit: cf13c7d232dd405180c2af616fa8a075 + digest: shake256:769a38e306a98339b549bc96991c97fae8bd3ceb1a7646c7bfe9a74e406ab068372970fbc5abda1891e2f3c36527cf2d3a25f631739d36900787226e564bb612 + - remote: buf.build + owner: cosmos + repository: gogo-proto + commit: 5e5b9fdd01804356895f8f79a6f1ddc1 + digest: shake256:0b85da49e2e5f9ebc4806eae058e2f56096ff3b1c59d1fb7c190413dd15f45dd456f0b69ced9059341c80795d2b6c943de15b120a9e0308b499e43e4b5fc2952 + - remote: buf.build + owner: googleapis + repository: googleapis + commit: 28151c0d0a1641bf938a7672c500e01d + digest: shake256:49215edf8ef57f7863004539deff8834cfb2195113f0b890dd1f67815d9353e28e668019165b9d872395871eeafcbab3ccfdb2b5f11734d3cca95be9e8d139de + - remote: buf.build + owner: protocolbuffers + repository: wellknowntypes + commit: 657250e6a39648cbb169d079a60bd9ba + digest: shake256:00de25001b8dd2e29d85fc4bcc3ede7aed886d76d67f5e0f7a9b320b90f871d3eb73507d50818d823a0512f3f8db77a11c043685528403e31ff3fef18323a9fb diff --git a/core/internal/buf.yaml b/depinject/internal/appconfig/buf.yaml similarity index 74% rename from core/internal/buf.yaml rename to depinject/internal/appconfig/buf.yaml index ac1df238ebec..fffe6eb932cf 100644 --- a/core/internal/buf.yaml +++ b/depinject/internal/appconfig/buf.yaml @@ -1,4 +1,6 @@ version: v1 +deps: + - buf.build/cosmos/cosmos-sdk lint: use: - DEFAULT diff --git a/depinject/internal/appconfig/registry.go b/depinject/internal/appconfig/registry.go new file mode 100644 index 000000000000..87161353b66e --- /dev/null +++ b/depinject/internal/appconfig/registry.go @@ -0,0 +1,113 @@ +package internal + +import ( + "fmt" + "reflect" + + gogoproto "github.com/cosmos/gogoproto/proto" + "github.com/cosmos/gogoproto/protoc-gen-gogo/descriptor" + "google.golang.org/protobuf/encoding/protowire" + protov2 "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/reflect/protodesc" + "google.golang.org/protobuf/reflect/protoreflect" + + "cosmossdk.io/depinject/appconfig/v1alpha1" +) + +// ModuleRegistry is the registry of module initializers indexed by their golang +// type to avoid any issues with protobuf descriptor initialization. +var ModuleRegistry = map[reflect.Type]*ModuleInitializer{} + +// ModuleInitializer describes how to initialize a module. +type ModuleInitializer struct { + ConfigGoType reflect.Type + ConfigProtoMessage gogoproto.Message + Error error + Providers []interface{} + Invokers []interface{} +} + +// ModulesByModuleTypeName should be used to retrieve modules by their module type name. +// This is done lazily after module registration to deal with non-deterministic issues +// that can occur with respect to protobuf descriptor initialization. +func ModulesByModuleTypeName() (map[string]*ModuleInitializer, error) { + res := map[string]*ModuleInitializer{} + + for _, initializer := range ModuleRegistry { + // as of gogoproto v1.5.0 this should work with either gogoproto or golang v2 proto + fullName := gogoproto.MessageName(initializer.ConfigProtoMessage) + + if desc, err := gogoproto.HybridResolver.FindDescriptorByName(protoreflect.FullName(fullName)); err == nil { + modDesc, err := GetModuleDescriptor(desc) + if err != nil { + return nil, err + } + + if modDesc == nil { + return nil, fmt.Errorf( + "protobuf type %s registered as a module should have the option %s", + desc.FullName(), + v1alpha1.E_Module.Name) + } + + if modDesc.GoImport == "" { + return nil, fmt.Errorf( + "protobuf type %s registered as a module should have ModuleDescriptor.go_import specified", + fullName, + ) + } + } + + if _, ok := res[fullName]; ok { + return nil, fmt.Errorf("duplicate module registration for %s", fullName) + } + + res[fullName] = initializer + } + + return res, nil +} + +// GetModuleDescriptor returns the cosmos.app.v1alpha1.ModuleDescriptor or nil if one isn't found. +// Errors are returned in unexpected cases. +func GetModuleDescriptor(desc protoreflect.Descriptor) (*v1alpha1.ModuleDescriptor, error) { + // we need to take a somewhat round about way to get the extension here + // our most complete type registry has a mix of gogoproto and protoreflect types + // so we start with a protoreflect descriptor, convert it to a gogo descriptor + // and then get the extension by its raw field value to avoid any unmarshaling errors + + rawV2Desc := protodesc.ToDescriptorProto(desc.(protoreflect.MessageDescriptor)) + bz, err := protov2.Marshal(rawV2Desc) + if err != nil { + return nil, err + } + var gogoDesc descriptor.DescriptorProto + err = gogoproto.Unmarshal(bz, &gogoDesc) + if err != nil { + return nil, err + } + + opts := gogoDesc.Options + if !gogoproto.HasExtension(opts, v1alpha1.E_Module) { + return nil, nil + } + + bz, err = gogoproto.GetRawExtension(gogoproto.GetUnsafeExtensionsMap(opts), v1alpha1.E_Module.Field) + if err != nil { + return nil, err + } + + // we have to skip the field tag and length prefix itself to actually get the raw bytes we want + // this is really overly complex, but other methods caused runtime errors because of validation + // that gogo does that appears simply not necessary + _, _, n := protowire.ConsumeTag(bz) + bz, _ = protowire.ConsumeBytes(bz[n:]) + + var ext v1alpha1.ModuleDescriptor + err = gogoproto.Unmarshal(bz, &ext) + if err != nil { + return nil, err + } + + return &ext, nil +} diff --git a/core/internal/testpb/test.proto b/depinject/internal/appconfig/testpb/test.proto similarity index 90% rename from core/internal/testpb/test.proto rename to depinject/internal/appconfig/testpb/test.proto index fe6535a2d44a..ac1a8939e0ec 100644 --- a/core/internal/testpb/test.proto +++ b/depinject/internal/appconfig/testpb/test.proto @@ -4,6 +4,8 @@ package testpb; import "cosmos/app/v1alpha1/module.proto"; +option go_package = "cosmossdk.io/depinject/internal/appconfig/testpb"; + message TestRuntimeModule { option (cosmos.app.v1alpha1.module) = { go_import: "cosmossdk.io/core/internal/testpb" diff --git a/core/internal/testpb/test.pulsar.go b/depinject/internal/appconfig/testpb/test.pulsar.go similarity index 99% rename from core/internal/testpb/test.pulsar.go rename to depinject/internal/appconfig/testpb/test.pulsar.go index 90dcab61cc2b..720a0e5ef580 100644 --- a/core/internal/testpb/test.pulsar.go +++ b/depinject/internal/appconfig/testpb/test.pulsar.go @@ -2,7 +2,7 @@ package testpb import ( - _ "cosmossdk.io/api/cosmos/app/v1alpha1" + _ "cosmossdk.io/depinject/appconfig/v1alpha1" fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -2344,14 +2344,14 @@ var file_testpb_test_proto_rawDesc = []byte{ 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x22, 0x1e, 0x0a, 0x14, 0x54, 0x65, 0x73, 0x74, 0x4e, 0x6f, 0x47, 0x6f, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x06, 0xba, 0xc0, 0x96, 0xda, - 0x01, 0x00, 0x42, 0x72, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, - 0x42, 0x09, 0x54, 0x65, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x21, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, - 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xca, - 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xe2, 0x02, 0x12, 0x54, 0x65, 0x73, 0x74, 0x70, - 0x62, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, - 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x01, 0x00, 0x42, 0x6e, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, + 0x42, 0x09, 0x54, 0x65, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1d, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x64, 0x65, 0x70, 0x69, + 0x6e, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x54, + 0x58, 0x58, 0xaa, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xca, 0x02, 0x06, 0x54, 0x65, + 0x73, 0x74, 0x70, 0x62, 0xe2, 0x02, 0x12, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, + 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/depinject/internal/appconfiggogo/buf.gen.gogo.yaml b/depinject/internal/appconfiggogo/buf.gen.gogo.yaml new file mode 100644 index 000000000000..a65eb7fa539c --- /dev/null +++ b/depinject/internal/appconfiggogo/buf.gen.gogo.yaml @@ -0,0 +1,5 @@ +version: v1 +plugins: + - name: gocosmos + out: . + opt: paths=source_relative,Mcosmos/app/v1alpha1/module.proto=cosmossdk.io/depinject/appconfig/v1alpha1 diff --git a/depinject/internal/appconfiggogo/buf.lock b/depinject/internal/appconfiggogo/buf.lock new file mode 100644 index 000000000000..28c135cc08bb --- /dev/null +++ b/depinject/internal/appconfiggogo/buf.lock @@ -0,0 +1,28 @@ +# Generated by buf. DO NOT EDIT. +version: v1 +deps: + - remote: buf.build + owner: cosmos + repository: cosmos-proto + commit: 04467658e59e44bbb22fe568206e1f70 + digest: shake256:73a640bd60e0c523b0f8237ff34eab67c45a38b64bbbde1d80224819d272dbf316ac183526bd245f994af6608b025f5130483d0133c5edd385531326b5990466 + - remote: buf.build + owner: cosmos + repository: cosmos-sdk + commit: cf13c7d232dd405180c2af616fa8a075 + digest: shake256:769a38e306a98339b549bc96991c97fae8bd3ceb1a7646c7bfe9a74e406ab068372970fbc5abda1891e2f3c36527cf2d3a25f631739d36900787226e564bb612 + - remote: buf.build + owner: cosmos + repository: gogo-proto + commit: 5e5b9fdd01804356895f8f79a6f1ddc1 + digest: shake256:0b85da49e2e5f9ebc4806eae058e2f56096ff3b1c59d1fb7c190413dd15f45dd456f0b69ced9059341c80795d2b6c943de15b120a9e0308b499e43e4b5fc2952 + - remote: buf.build + owner: googleapis + repository: googleapis + commit: 28151c0d0a1641bf938a7672c500e01d + digest: shake256:49215edf8ef57f7863004539deff8834cfb2195113f0b890dd1f67815d9353e28e668019165b9d872395871eeafcbab3ccfdb2b5f11734d3cca95be9e8d139de + - remote: buf.build + owner: protocolbuffers + repository: wellknowntypes + commit: 657250e6a39648cbb169d079a60bd9ba + digest: shake256:00de25001b8dd2e29d85fc4bcc3ede7aed886d76d67f5e0f7a9b320b90f871d3eb73507d50818d823a0512f3f8db77a11c043685528403e31ff3fef18323a9fb diff --git a/orm/internal/buf.yaml b/depinject/internal/appconfiggogo/buf.yaml similarity index 74% rename from orm/internal/buf.yaml rename to depinject/internal/appconfiggogo/buf.yaml index ac1df238ebec..fffe6eb932cf 100644 --- a/orm/internal/buf.yaml +++ b/depinject/internal/appconfiggogo/buf.yaml @@ -1,4 +1,6 @@ version: v1 +deps: + - buf.build/cosmos/cosmos-sdk lint: use: - DEFAULT diff --git a/depinject/internal/appconfiggogo/testpb/test.pb.go b/depinject/internal/appconfiggogo/testpb/test.pb.go new file mode 100644 index 000000000000..64cb974281db --- /dev/null +++ b/depinject/internal/appconfiggogo/testpb/test.pb.go @@ -0,0 +1,266 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: testpb/test.proto + +package testpb + +import ( + _ "cosmossdk.io/depinject/appconfig/v1alpha1" + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type TestModuleGogo struct { +} + +func (m *TestModuleGogo) Reset() { *m = TestModuleGogo{} } +func (m *TestModuleGogo) String() string { return proto.CompactTextString(m) } +func (*TestModuleGogo) ProtoMessage() {} +func (*TestModuleGogo) Descriptor() ([]byte, []int) { + return fileDescriptor_41c67e33ca9d1f26, []int{0} +} +func (m *TestModuleGogo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TestModuleGogo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TestModuleGogo.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 *TestModuleGogo) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestModuleGogo.Merge(m, src) +} +func (m *TestModuleGogo) XXX_Size() int { + return m.Size() +} +func (m *TestModuleGogo) XXX_DiscardUnknown() { + xxx_messageInfo_TestModuleGogo.DiscardUnknown(m) +} + +var xxx_messageInfo_TestModuleGogo proto.InternalMessageInfo + +func init() { + proto.RegisterType((*TestModuleGogo)(nil), "testpb.TestModuleGogo") +} + +func init() { proto.RegisterFile("testpb/test.proto", fileDescriptor_41c67e33ca9d1f26) } + +var fileDescriptor_41c67e33ca9d1f26 = []byte{ + // 186 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2c, 0x49, 0x2d, 0x2e, + 0x29, 0x48, 0xd2, 0x07, 0x51, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x6c, 0x10, 0x21, 0x29, + 0x85, 0xe4, 0xfc, 0xe2, 0xdc, 0xfc, 0x62, 0xfd, 0xc4, 0x82, 0x02, 0xfd, 0x32, 0xc3, 0xc4, 0x9c, + 0x82, 0x8c, 0x44, 0x43, 0xfd, 0xdc, 0xfc, 0x94, 0xd2, 0x9c, 0x54, 0x88, 0x4a, 0x25, 0x4f, 0x2e, + 0xbe, 0x90, 0xd4, 0xe2, 0x12, 0x5f, 0xb0, 0x98, 0x7b, 0x7e, 0x7a, 0xbe, 0x95, 0xf9, 0xae, 0x03, + 0xd3, 0x6e, 0x31, 0x1a, 0x72, 0xe9, 0x43, 0xf4, 0x16, 0xa7, 0x64, 0xeb, 0x65, 0xe6, 0xeb, 0x27, + 0xe7, 0x17, 0xa5, 0xea, 0x67, 0xe6, 0x95, 0xa4, 0x16, 0xe5, 0x25, 0xe6, 0x80, 0xcc, 0x4b, 0xce, + 0xcf, 0x4b, 0xcb, 0x4c, 0x4f, 0xcf, 0x4f, 0xcf, 0xd7, 0x87, 0x58, 0xe6, 0xe4, 0x77, 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, 0x26, 0x28, 0x46, 0xa5, 0xa4, 0x16, 0x64, 0xe6, + 0x65, 0xa5, 0x26, 0x97, 0xe0, 0x37, 0x2f, 0x89, 0x0d, 0xec, 0x42, 0x63, 0x40, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x1e, 0xdb, 0x22, 0xe2, 0xe0, 0x00, 0x00, 0x00, +} + +func (m *TestModuleGogo) 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 *TestModuleGogo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestModuleGogo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTest(dAtA []byte, offset int, v uint64) int { + offset -= sovTest(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *TestModuleGogo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTest(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTest(x uint64) (n int) { + return sovTest(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *TestModuleGogo) 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 ErrIntOverflowTest + } + 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: TestModuleGogo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TestModuleGogo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTest(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTest + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTest(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, ErrIntOverflowTest + } + 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, ErrIntOverflowTest + } + 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, ErrIntOverflowTest + } + 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, ErrInvalidLengthTest + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTest + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTest + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTest = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTest = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTest = fmt.Errorf("proto: unexpected end of group") +) diff --git a/depinject/internal/appconfiggogo/testpb/test.proto b/depinject/internal/appconfiggogo/testpb/test.proto new file mode 100644 index 000000000000..4b2154571d2e --- /dev/null +++ b/depinject/internal/appconfiggogo/testpb/test.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; + +package testpb; + +import "cosmos/app/v1alpha1/module.proto"; + +option go_package = "cosmossdk.io/depinject/internal/appconfiggogo/testpb"; + +message TestModuleGogo { + option (cosmos.app.v1alpha1.module) = { + go_import: "cosmossdk.io/core/internal/appconfiggogo/testpb" + }; +} diff --git a/depinject/internal/codegen/file.go b/depinject/internal/codegen/file.go index dba77becb13e..09a1a6109637 100644 --- a/depinject/internal/codegen/file.go +++ b/depinject/internal/codegen/file.go @@ -1,7 +1,7 @@ package codegen import ( - "fmt" + "errors" "go/ast" "go/token" "strconv" @@ -61,7 +61,7 @@ func NewFileGen(file *ast.File, codegenPkgPath string) (*FileGen, error) { if spec.Name != nil { name := spec.Name.Name if name == "." { - return nil, fmt.Errorf(". package imports are not allowed") + return nil, errors.New(". package imports are not allowed") } info = &importInfo{importPrefix: name, ImportSpec: spec} diff --git a/depinject/internal/util/util.go b/depinject/internal/util/util.go index 3a9a95120da0..98be7b869ded 100644 --- a/depinject/internal/util/util.go +++ b/depinject/internal/util/util.go @@ -1,14 +1,14 @@ package util import ( - "golang.org/x/exp/constraints" - "golang.org/x/exp/maps" - "golang.org/x/exp/slices" + "cmp" + "maps" + "slices" ) // IterateMapOrdered iterates over the map with keys sorted in ascending order // calling forEach for each key-value pair as long as forEach does not return an error. -func IterateMapOrdered[K constraints.Ordered, V any](m map[K]V, forEach func(k K, v V) error) error { +func IterateMapOrdered[K cmp.Ordered, V any](m map[K]V, forEach func(k K, v V) error) error { keys := OrderedMapKeys(m) for _, k := range keys { if err := forEach(k, m[k]); err != nil { @@ -19,8 +19,6 @@ func IterateMapOrdered[K constraints.Ordered, V any](m map[K]V, forEach func(k K } // OrderedMapKeys returns the map keys in ascending order. -func OrderedMapKeys[K constraints.Ordered, V any](m map[K]V) []K { - keys := maps.Keys(m) - slices.Sort(keys) - return keys +func OrderedMapKeys[K cmp.Ordered, V any](m map[K]V) []K { + return slices.Sorted(maps.Keys(m)) } diff --git a/depinject/invoke_test.go b/depinject/invoke_test.go index 3f2a7b023c53..740b5230dfc1 100644 --- a/depinject/invoke_test.go +++ b/depinject/invoke_test.go @@ -3,32 +3,14 @@ package depinject_test import ( "testing" - "github.com/regen-network/gocuke" - "gotest.tools/v3/assert" + "github.com/stretchr/testify/require" "cosmossdk.io/depinject" ) -func TestInvoke(t *testing.T) { - gocuke.NewRunner(t, &InvokeSuite{}). - Path("features/invoke.feature"). - Step("an int provider returning 5", (*InvokeSuite).AnIntProviderReturning5). - Step(`a string pointer provider pointing to "foo"`, (*InvokeSuite).AStringPointerProviderPointingToFoo). - Run() -} - type InvokeSuite struct { - gocuke.TestingT - configs []depinject.Config - i int - sp *string -} - -func (s *InvokeSuite) AnInvokerRequestingAnIntAndStringPointer() { - s.configs = append(s.configs, - depinject.Supply(s), - depinject.Invoke((*InvokeSuite).IntStringPointerInvoker), - ) + i int + sp *string } func (s *InvokeSuite) IntStringPointerInvoker(i int, sp *string) { @@ -36,53 +18,67 @@ func (s *InvokeSuite) IntStringPointerInvoker(i int, sp *string) { s.sp = sp } -func (s *InvokeSuite) TheContainerIsBuilt() { - assert.NilError(s, depinject.Inject(depinject.Configs(s.configs...))) -} - -func (s *InvokeSuite) TheInvokerWillGetTheIntParameterSetTo(a int64) { - assert.Equal(s, int(a), s.i) -} - -func (s *InvokeSuite) TheInvokerWillGetTheStringPointerParameterSetToNil() { - if s.sp != nil { - s.Fatalf("expected a nil string pointer, got %s", *s.sp) - } +func ProvideLenModuleKey(key depinject.ModuleKey) int { + return len(key.Name()) } func IntProvider5() int { return 5 } -func (s *InvokeSuite) AnIntProviderReturning5() { - s.configs = append(s.configs, depinject.Provide(IntProvider5)) -} - func StringPtrProviderFoo() *string { x := "foo" return &x } -func (s *InvokeSuite) AStringPointerProviderPointingToFoo() { - s.configs = append(s.configs, depinject.Provide(StringPtrProviderFoo)) -} +func TestInvokerNoResolvableDependencies(t *testing.T) { + t.Parallel() -func (s *InvokeSuite) TheInvokerWillGetTheStringPointerParameterSetTo(a string) { - if s.sp == nil { - s.Fatalf("expected a non-nil string pointer") - } - assert.Equal(s, a, *s.sp) + invokerSuite := &InvokeSuite{} + configs := depinject.Configs( + depinject.Supply(invokerSuite), + depinject.Invoke((*InvokeSuite).IntStringPointerInvoker), + ) + + err := depinject.Inject(configs) + require.NoError(t, err) + + // invokers get called even if their dependencies can't be resolved + // values are still zeroed + require.Equal(t, 0, invokerSuite.i) + require.Equal(t, (*string)(nil), invokerSuite.sp) } -func (s *InvokeSuite) AnInvokerRequestingAnIntAndStringPointerRunInModule(a string) { - s.configs = append(s.configs, - depinject.Supply(s), - depinject.InvokeInModule(a, (*InvokeSuite).IntStringPointerInvoker), +func TestInvokerProvidedDependencies(t *testing.T) { + t.Parallel() + + invokerSuite := &InvokeSuite{} + configs := depinject.Configs( + depinject.Supply(invokerSuite), + depinject.Provide(IntProvider5, StringPtrProviderFoo), + depinject.Invoke((*InvokeSuite).IntStringPointerInvoker), ) -} -func ProvideLenModuleKey(key depinject.ModuleKey) int { - return len(key.Name()) + err := depinject.Inject(configs) + require.NoError(t, err) + + require.Equal(t, 5, invokerSuite.i) + require.Equal(t, "foo", *invokerSuite.sp) } -func (s *InvokeSuite) AModulescopedIntProviderWhichReturnsTheLengthOfTheModuleName() { - s.configs = append(s.configs, depinject.Provide(ProvideLenModuleKey)) +func TestInvokerScopedDependencies(t *testing.T) { + t.Parallel() + + moduleName := "test" + + invokerSuite := &InvokeSuite{} + configs := depinject.Configs( + depinject.Supply(invokerSuite), + depinject.Provide(ProvideLenModuleKey), + depinject.InvokeInModule(moduleName, (*InvokeSuite).IntStringPointerInvoker), + ) + + err := depinject.Inject(configs) + require.NoError(t, err) + + require.Equal(t, len(moduleName), invokerSuite.i) + require.Equal(t, (*string)(nil), invokerSuite.sp) } diff --git a/depinject/location.go b/depinject/location.go index 7b18d5e1b16a..4eb4a7254b02 100644 --- a/depinject/location.go +++ b/depinject/location.go @@ -90,7 +90,7 @@ const _vendor = "/vendor/" func splitFuncName(function string) (pname, fname string) { if len(function) == 0 { - return + return "", "" } // We have something like "path.to/my/pkg.MyFunction". If the function is diff --git a/depinject/one_per_module.go b/depinject/one_per_module.go index 69916434be3d..55d19a7d93f3 100644 --- a/depinject/one_per_module.go +++ b/depinject/one_per_module.go @@ -4,8 +4,6 @@ import ( "fmt" "reflect" - "github.com/cockroachdb/errors" - "cosmossdk.io/depinject/internal/graphviz" ) @@ -46,7 +44,7 @@ type mapOfOnePerModuleResolver struct { } func (o *onePerModuleResolver) resolve(_ *container, _ *moduleKey, _ Location) (reflect.Value, error) { - return reflect.Value{}, errors.Errorf("%v is a one-per-module type and thus can't be used as an input parameter, instead use %v", o.typ, o.mapType) + return reflect.Value{}, fmt.Errorf("%v is a one-per-module type and thus can't be used as an input parameter, instead use %v", o.typ, o.mapType) } func (o *onePerModuleResolver) describeLocation() string { @@ -72,7 +70,7 @@ func (o *mapOfOnePerModuleResolver) resolve(c *container, _ *moduleKey, caller L } idx := o.idxMap[key] if len(values) <= idx { - return reflect.Value{}, errors.Errorf("expected value of type %T at index %d", o.typ, idx) + return reflect.Value{}, fmt.Errorf("expected value of type %T at index %d", o.typ, idx) } value := values[idx] res.SetMapIndex(reflect.ValueOf(key.name), value) @@ -87,11 +85,11 @@ func (o *mapOfOnePerModuleResolver) resolve(c *container, _ *moduleKey, caller L func (o *onePerModuleResolver) addNode(n *simpleProvider, i int) error { if n.moduleKey == nil { - return errors.Errorf("cannot define a provider with one-per-module dependency %v which isn't provided in a module", o.typ) + return fmt.Errorf("cannot define a provider with one-per-module dependency %v which isn't provided in a module", o.typ) } if existing, ok := o.providers[n.moduleKey]; ok { - return errors.Errorf("duplicate provision for one-per-module type %v in module %s: %s\n\talready provided by %s", + return fmt.Errorf("duplicate provision for one-per-module type %v in module %s: %s\n\talready provided by %s", o.typ, n.moduleKey.name, n.provider.Location, existing.provider.Location) } @@ -102,7 +100,7 @@ func (o *onePerModuleResolver) addNode(n *simpleProvider, i int) error { } func (o *mapOfOnePerModuleResolver) addNode(s *simpleProvider, _ int) error { - return errors.Errorf("%v is a one-per-module type and thus %v can't be used as an output parameter in %s", o.typ, o.mapType, s.provider.Location) + return fmt.Errorf("%v is a one-per-module type and thus %v can't be used as an output parameter in %s", o.typ, o.mapType, s.provider.Location) } func (o onePerModuleResolver) typeGraphNode() *graphviz.Node { diff --git a/depinject/provider_desc.go b/depinject/provider_desc.go index dfbac5dabaf7..fbcfa7756ce1 100644 --- a/depinject/provider_desc.go +++ b/depinject/provider_desc.go @@ -1,12 +1,11 @@ package depinject import ( + "fmt" "reflect" + "slices" "strings" "unicode" - - "github.com/cockroachdb/errors" - "golang.org/x/exp/slices" ) // providerDescriptor defines a special provider type that is defined by @@ -32,6 +31,7 @@ type providerDescriptor struct { type providerInput struct { Type reflect.Type Optional bool + Ignored bool } type providerOutput struct { @@ -65,32 +65,32 @@ func doExtractProviderDescriptor(ctr interface{}) (providerDescriptor, error) { val := reflect.ValueOf(ctr) typ := val.Type() if typ.Kind() != reflect.Func { - return providerDescriptor{}, errors.Errorf("expected a Func type, got %v", typ) + return providerDescriptor{}, fmt.Errorf("expected a Func type, got %v", typ) } loc := LocationFromPC(val.Pointer()).(*location) nameParts := strings.Split(loc.name, ".") if len(nameParts) == 0 { - return providerDescriptor{}, errors.Errorf("missing function name %s", loc) + return providerDescriptor{}, fmt.Errorf("missing function name %s", loc) } lastNamePart := nameParts[len(nameParts)-1] if unicode.IsLower([]rune(lastNamePart)[0]) { - return providerDescriptor{}, errors.Errorf("function must be exported: %s", loc) + return providerDescriptor{}, fmt.Errorf("function must be exported: %s", loc) } if strings.Contains(lastNamePart, "-") { - return providerDescriptor{}, errors.Errorf("function can't be used as a provider (it might be a bound instance method): %s", loc) + return providerDescriptor{}, fmt.Errorf("function can't be used as a provider (it might be a bound instance method): %s", loc) } pkgParts := strings.Split(loc.pkg, "/") if slices.Contains(pkgParts, "internal") { - return providerDescriptor{}, errors.Errorf("function must not be in an internal package: %s", loc) + return providerDescriptor{}, fmt.Errorf("function must not be in an internal package: %s", loc) } if typ.IsVariadic() { - return providerDescriptor{}, errors.Errorf("variadic function can't be used as a provider: %s", loc) + return providerDescriptor{}, fmt.Errorf("variadic function can't be used as a provider: %s", loc) } numIn := typ.NumIn() @@ -108,7 +108,7 @@ func doExtractProviderDescriptor(ctr interface{}) (providerDescriptor, error) { t := typ.Out(i) if t == errType { if i != numOut-1 { - return providerDescriptor{}, errors.Errorf("output error parameter is not last parameter in function %s", loc) + return providerDescriptor{}, fmt.Errorf("output error parameter is not last parameter in function %s", loc) } errIdx = i } else { diff --git a/depinject/provider_desc_test.go b/depinject/provider_desc_test.go index a620620d7800..cbaca1d197a3 100644 --- a/depinject/provider_desc_test.go +++ b/depinject/provider_desc_test.go @@ -45,7 +45,7 @@ func StructInAndOut(_ float32, _ StructIn, _ byte) (int16, StructOut, int32, err return int16(0), StructOut{}, int32(0), nil } -func BadErrorPosition() (error, int) { return nil, 0 } //nolint:revive,stylecheck // Deliberately has error as first of multiple arguments. +func BadErrorPosition() (error, int) { return nil, 0 } //nolint:stylecheck // Deliberately has error as first of multiple arguments. func BadOptionalFn(_ BadOptional) int { return 0 } diff --git a/depinject/sonar-project.properties b/depinject/sonar-project.properties deleted file mode 100644 index 04c63cddf780..000000000000 --- a/depinject/sonar-project.properties +++ /dev/null @@ -1,14 +0,0 @@ -sonar.projectKey=cosmos-sdk-depinject -sonar.organization=cosmos - -sonar.projectName=Cosmos SDK Depinject -sonar.project.monorepo.enabled=true - -sonar.sources=. -sonar.exclusions=**/*_test.go,**/*.pulsar.go -sonar.tests=. -sonar.test.inclusions=**/*_test.go -sonar.go.coverage.reportPaths=coverage.out - -sonar.sourceEncoding=UTF-8 -sonar.scm.provider=git \ No newline at end of file diff --git a/depinject/struct_args.go b/depinject/struct_args.go index 565bee406c7d..312070948079 100644 --- a/depinject/struct_args.go +++ b/depinject/struct_args.go @@ -3,14 +3,12 @@ package depinject import ( "fmt" "reflect" - - "github.com/cockroachdb/errors" ) // In can be embedded in another struct to inform the container that the // fields of the struct should be treated as dependency inputs. // This allows a struct to be used to specify dependencies rather than -// positional parameters. +// positional parameters. Unexpected fields will be ignored. // // Fields of the struct may support the following tags: // @@ -121,13 +119,14 @@ func structArgsInTypes(typ reflect.Type) ([]providerInput, error) { if optTag == "true" { optional = true } else { - return nil, errors.Errorf("bad optional tag %q (should be \"true\") in %v", optTag, typ) + return nil, fmt.Errorf("bad optional tag %q (should be \"true\") in %v", optTag, typ) } } res = append(res, providerInput{ Type: f.Type, Optional: optional, + Ignored: !f.IsExported(), }) } return res, nil @@ -168,13 +167,15 @@ func buildIn(typ reflect.Type, values []reflect.Value) (reflect.Value, int, erro j := 0 res := reflect.New(typ) for i := 0; i < numFields; i++ { + if !res.Elem().Field(i).CanSet() { + // private field, skip + j++ + continue + } f := typ.Field(i) if f.Type.AssignableTo(isInType) { continue } - if !res.Elem().Field(i).CanSet() { - return reflect.Value{}, 0, fmt.Errorf("depinject.In struct %s on package %s can't have unexported field", res.Elem().String(), f.PkgPath) - } if !values[j].CanInterface() { return reflect.Value{}, 0, fmt.Errorf("depinject.Out struct %s on package %s can't have unexported field", res.Elem().String(), f.PkgPath) } diff --git a/docs/.gitignore b/docs/.gitignore index baff39bd9e55..61c0f6f4db6d 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -2,7 +2,8 @@ /node_modules # Production -/build +build +!docs/build # Generated files .docusaurus @@ -17,11 +18,12 @@ docs/docs/rfc docs/docs/tooling/01-cosmovisor.md docs/docs/tooling/02-confix.md docs/docs/tooling/03-hubl.md +docs/docs/core/17-autocli.md docs/docs/packages/01-depinject.md docs/docs/packages/02-collections.md -docs/docs/packages/03-orm.md -docs/run-node/04-rosetta.md -docs/migrations/02-upgrading.md +docs/user/run-node/04-rosetta.md +docs/build/migrations/02-upgrading.md +docs/learn/advanced/17-autocli.md # Misc .DS_Store @@ -32,4 +34,4 @@ docs/migrations/02-upgrading.md npm-debug.log* yarn-debug.log* -yarn-error.log* \ No newline at end of file +yarn-error.log* diff --git a/docs/architecture/README.md b/docs/architecture/README.md index 8a5c5f307c35..fd3a3b1e0e46 100644 --- a/docs/architecture/README.md +++ b/docs/architecture/README.md @@ -86,9 +86,14 @@ When writing ADRs, follow the same best practices for writing RFCs. When writing * [ADR 062: Collections State Layer](./adr-062-collections-state-layer.md) * [ADR 063: Core Module API](./adr-063-core-module-api.md) * [ADR 065: Store V2](./adr-065-store-v2.md) +* [ADR 067: Simulator v2](./adr-067-simulator-v2.md) +* [ADR 069: `x/gov` modularity, multiple choice and optimisic proposals](./adr-069-gov-improvements.md) +* [ADR 074: Messages with implicit signers](./adr-074-implicit-msg-signers.md) +* [ADR 076: Transaction Malleability Risk Review and Recommendations](./adr-076-tx-malleability.md) ### Draft * [ADR 044: Guidelines for Updating Protobuf Definitions](./adr-044-protobuf-updates-guidelines.md) * [ADR 047: Extend Upgrade Plan](./adr-047-extend-upgrade-plan.md) * [ADR 053: Go Module Refactoring](./adr-053-go-module-refactoring.md) +* [ADR 068: Preblock](./adr-068-preblock.md) diff --git a/docs/architecture/_category_.json b/docs/architecture/_category_.json index 87ceb9374844..e0b1907a9bb4 100644 --- a/docs/architecture/_category_.json +++ b/docs/architecture/_category_.json @@ -1,5 +1,5 @@ { "label": "ADRs", - "position": 11, + "position": 6, "link": null } \ No newline at end of file diff --git a/docs/architecture/adr-013-metrics.md b/docs/architecture/adr-013-metrics.md index 33849b56caf0..b0808d462514 100644 --- a/docs/architecture/adr-013-metrics.md +++ b/docs/architecture/adr-013-metrics.md @@ -21,7 +21,7 @@ and is rich with ecosystem tooling. We must also aim to integrate metrics into the Cosmos SDK in the most seamless way possible such that metrics may be added or removed at will and without much friction. To do this, we will use the -[go-metrics](https://github.com/armon/go-metrics) library. +[go-metrics](https://github.com/hashicorp/go-metrics) library. Finally, operators may enable telemetry along with specific configuration options. If enabled, metrics will be exposed via `/metrics?format={text|prometheus}` via the API server. diff --git a/docs/architecture/adr-018-extendable-voting-period.md b/docs/architecture/adr-018-extendable-voting-period.md index ee238fc35ae8..5e8f058d12fa 100644 --- a/docs/architecture/adr-018-extendable-voting-period.md +++ b/docs/architecture/adr-018-extendable-voting-period.md @@ -6,7 +6,7 @@ ## Context -Currently the voting period for all governance proposals is the same. However, this is suboptimal as all governance proposals do not require the same time period. For more non-contentious proposals, they can be dealt with more efficently with a faster period, while more contentious or complex proposals may need a longer period for extended discussion/consideration. +Currently the voting period for all governance proposals is the same. However, this is suboptimal as all governance proposals do not require the same time period. For more non-contentious proposals, they can be dealt with more efficiently with a faster period, while more contentious or complex proposals may need a longer period for extended discussion/consideration. ## Decision diff --git a/docs/architecture/adr-020-protobuf-transaction-encoding.md b/docs/architecture/adr-020-protobuf-transaction-encoding.md index 4c30bb9ebe3d..b26f394bd5d8 100644 --- a/docs/architecture/adr-020-protobuf-transaction-encoding.md +++ b/docs/architecture/adr-020-protobuf-transaction-encoding.md @@ -277,7 +277,7 @@ We propose that field numbers with bit 11 set (for most use cases this is the range of 1024-2047) be considered non-critical fields that can safely be ignored if unknown. -To handle this we will need a unknown field filter that: +To handle this we will need an unknown field filter that: * always rejects unknown fields in unsigned content (i.e. top-level `Tx` and unsigned parts of `AuthInfo` if present based on the signing mode) diff --git a/docs/architecture/adr-023-protobuf-naming.md b/docs/architecture/adr-023-protobuf-naming.md index 4360befded06..a192dfce3264 100644 --- a/docs/architecture/adr-023-protobuf-naming.md +++ b/docs/architecture/adr-023-protobuf-naming.md @@ -191,7 +191,7 @@ is used in source code to denote modules, this is often unnecessary for .proto files as modules are the primary thing sub-packages are used for. Only items which are known to be used infrequently should have deep sub-package depths. -For the Cosmos SDK, it is recommended that that we simply write `cosmos.bank`, +For the Cosmos SDK, it is recommended that we simply write `cosmos.bank`, `cosmos.gov`, etc. rather than `cosmos.x.bank`. In practice, most non-module types can go straight in the `cosmos` package or we can introduce a `cosmos.base` package if needed. Note that this naming _will not_ change diff --git a/docs/architecture/adr-033-protobuf-inter-module-comm.md b/docs/architecture/adr-033-protobuf-inter-module-comm.md index ea634dac9748..28c69a910b23 100644 --- a/docs/architecture/adr-033-protobuf-inter-module-comm.md +++ b/docs/architecture/adr-033-protobuf-inter-module-comm.md @@ -20,7 +20,7 @@ service definitions defined in [ADR 021](./adr-021-protobuf-query-encoding.md) a ## Context -In the current Cosmos SDK documentation on the [Object-Capability Model](../core/10-ocap.md), it is stated that: +In the current Cosmos SDK documentation on the [Object-Capability Model](../../learn/advanced/10-ocap.md), it is stated that: > We assume that a thriving ecosystem of Cosmos SDK modules that are easy to compose into a blockchain application will contain faulty or malicious modules. diff --git a/docs/architecture/adr-038-state-listening.md b/docs/architecture/adr-038-state-listening.md index 81bfa5a712db..319d872be36e 100644 --- a/docs/architecture/adr-038-state-listening.md +++ b/docs/architecture/adr-038-state-listening.md @@ -568,9 +568,12 @@ func registerABCIListenerPlugin( exposeKeysStr := cast.ToStringSlice(appOpts.Get(keysKey)) exposedKeys := exposeStoreKeysSorted(exposeKeysStr, keys) bApp.cms.AddListeners(exposedKeys) - bApp.SetStreamingService(abciListener) - bApp.stopNodeOnABCIListenerErr = stopNodeOnErr - bApp.abciListenersAsync = async + app.SetStreamingManager( + storetypes.StreamingManager{ + ABCIListeners: []storetypes.ABCIListener{abciListener}, + StopNodeOnErr: stopNodeOnErr, + }, + ) } ``` diff --git a/docs/architecture/adr-063-core-module-api.md b/docs/architecture/adr-063-core-module-api.md index d5e0d06b7cbd..743dd5fee539 100644 --- a/docs/architecture/adr-063-core-module-api.md +++ b/docs/architecture/adr-063-core-module-api.md @@ -90,7 +90,7 @@ slower than more fast moving projects. ### Core Services The following "core services" are defined by the core API. All valid runtime module implementations should provide -implementations of these services to modules via both [dependency injection](./adr-057-app-wiring-1.md) and +implementations of these services to modules via both [dependency injection](./adr-057-app-wiring.md) and manual wiring. The individual services described below are all bundled in a convenient `appmodule.Service` "bundle service" so that for simplicity modules can declare a dependency on a single service. @@ -280,6 +280,17 @@ type HasGenesis interface { } ``` +#### Pre Blockers + +Modules that have functionality that runs before BeginBlock and should implement the has `HasPreBlocker` interfaces: + +```go +type HasPreBlocker interface { + AppModule + PreBlock(context.Context) error +} +``` + #### Begin and End Blockers Modules that have functionality that runs before transactions (begin blockers) or after transactions diff --git a/docs/architecture/adr-064-abci-2.0.md b/docs/architecture/adr-064-abci-2.0.md index 9a47180509c2..c0dc7f746e81 100644 --- a/docs/architecture/adr-064-abci-2.0.md +++ b/docs/architecture/adr-064-abci-2.0.md @@ -5,6 +5,8 @@ * 2023-01-17: Initial Draft (@alexanderbez) * 2023-04-06: Add upgrading section (@alexanderbez) * 2023-04-10: Simplify vote extension state persistence (@alexanderbez) +* 2023-07-07: Revise vote extension state persistence (@alexanderbez) +* 2023-08-24: Revise vote extension power calculations and staking interface (@davidterpay) ## Status @@ -105,10 +107,11 @@ type ExtendVoteHandler func(sdk.Context, abci.RequestExtendVote) abci.ResponseEx type VerifyVoteExtensionHandler func(sdk.Context, abci.RequestVerifyVoteExtension) abci.ResponseVerifyVoteExtension ``` -A new execution state, `voteExtensionState`, will be introduced and provided as -the `Context` that is supplied to both handlers. It will contain relevant metadata -such as the block height and block hash. Note, `voteExtensionState` is never -committed and will exist as ephemeral state only in the context of a single block. +An ephemeral context and state will be supplied to both handlers. The +context will contain relevant metadata such as the block height and block hash. +The state will be a cached version of the committed state of the application and +will be discarded after the execution of the handler, this means that both handlers +get a fresh state view and no changes made to it will be written. If an application decides to implement `ExtendVoteHandler`, it must return a non-nil `ResponseExtendVote.VoteExtension`. @@ -217,33 +220,37 @@ a default signature verification method which applications can use: ```go type ValidatorStore interface { - GetValidatorByConsAddr(sdk.Context, cryptotypes.Address) (cryptotypes.PubKey, error) + GetPubKeyByConsAddr(context.Context, sdk.ConsAddress) (cmtprotocrypto.PublicKey, error) } // ValidateVoteExtensions is a function that an application can execute in // ProcessProposal to verify vote extension signatures. func (app *BaseApp) ValidateVoteExtensions(ctx sdk.Context, currentHeight int64, extCommit abci.ExtendedCommitInfo) error { + votingPower := 0 + totalVotingPower := 0 + for _, vote := range extCommit.Votes { + totalVotingPower += vote.Validator.Power + if !vote.SignedLastBlock || len(vote.VoteExtension) == 0 { continue } - valConsAddr := cmtcrypto.Address(vote.Validator.Address) - - validator, err := app.validatorStore.GetValidatorByConsAddr(ctx, valConsAddr) - if err != nil { - return fmt.Errorf("failed to get validator %s for vote extension", valConsAddr) - } - - cmtPubKey, err := validator.CmtConsPublicKey() + valConsAddr := sdk.ConsAddress(vote.Validator.Address) + pubKeyProto, err := valStore.GetPubKeyByConsAddr(ctx, valConsAddr) if err != nil { - return fmt.Errorf("failed to convert public key: %w", err) + return fmt.Errorf("failed to get public key for validator %s: %w", valConsAddr, err) } if len(vote.ExtensionSignature) == 0 { return fmt.Errorf("received a non-empty vote extension with empty signature for validator %s", valConsAddr) } + cmtPubKey, err := cryptoenc.PubKeyFromProto(pubKeyProto) + if err != nil { + return fmt.Errorf("failed to convert validator %X public key: %w", valConsAddr, err) + } + cve := cmtproto.CanonicalVoteExtension{ Extension: vote.VoteExtension, Height: currentHeight - 1, // the vote extension was signed in the previous height @@ -260,8 +267,14 @@ func (app *BaseApp) ValidateVoteExtensions(ctx sdk.Context, currentHeight int64, return errors.New("received vote with invalid signature") } - return nil + votingPower += vote.Validator.Power } + + if (votingPower / totalVotingPower) < threshold { + return errors.New("not enough voting power for the vote extensions") + } + + return nil } ``` @@ -279,32 +292,22 @@ decision based on the vote extensions. #### Vote Extension Persistence In certain contexts, it may be useful or necessary for applications to persist -data derived from vote extensions. In order to facilitate this use case, we -propose to allow application developers to manually retrieve the `finalizeState` -context (see [`FinalizeBlock`](#finalizeblock-1) below). Using this context, -state can be directly written to `finalizeState`, which will be used during -`FinalizeBlock` and eventually committed to the application state. Note, since -`ProcessProposal` can timeout and thus require another round of consensus, we -will reset `finalizeState` in the beginning of `ProcessProposal`. +data derived from vote extensions. In order to facilitate this use case, we propose +to allow app developers to define a pre-Blocker hook which will be called +at the very beginning of `FinalizeBlock`, i.e. before `BeginBlock` (see below). -A `ProcessProposal` handler could look like the following: +Note, we cannot allow applications to directly write to the application state +during `ProcessProposal` because during replay, CometBFT will NOT call `ProcessProposal`, +which would result in an incomplete state view. ```go -func (h MyHandler) ProcessProposalHandler() sdk.ProcessProposalHandler { - return func(ctx sdk.Context, req abci.RequestProcessProposal) abci.ResponseProcessProposal { - for _, txBytes := range req.Txs { - _, err := h.app.ProcessProposalVerifyTx(txBytes) - if err != nil { - return abci.ResponseProcessProposal{Status: abci.ResponseProcessProposal_REJECT} - } - } - - fCtx := h.app.GetFinalizeState() - - // Any state changes that occur on the provided fCtx WILL be written to state! - h.myKeeper.SetVoteExtResult(fCtx, ...) +func (a MyApp) PreBlocker(ctx sdk.Context, req *abci.RequestFinalizeBlock) error { + voteExts := GetVoteExtensions(ctx, req.Txs) - return abci.ResponseProcessProposal{Status: abci.ResponseProcessProposal_ACCEPT} + // Process and perform some compute on vote extensions, storing any resulting + // state. + if err a.processVoteExtensions(ctx, voteExts); if err != nil { + return err } } ``` @@ -347,11 +350,20 @@ legacy ABCI types, e.g. `LegacyBeginBlockRequest` and `LegacyEndBlockRequest`. O we can come up with new types and names altogether. ```go -func (app *BaseApp) FinalizeBlock(req abci.RequestFinalizeBlock) abci.ResponseFinalizeBlock { - // merge any state changes from ProcessProposal into the FinalizeBlock state - app.MergeProcessProposalState() +func (app *BaseApp) FinalizeBlock(req abci.RequestFinalizeBlock) (*abci.ResponseFinalizeBlock, error) { + ctx := ... - beginBlockResp := app.beginBlock(ctx, req) + if app.preBlocker != nil { + ctx := app.finalizeBlockState.ctx + rsp, err := app.preBlocker(ctx, req) + if err != nil { + return nil, err + } + if rsp.ConsensusParamsChanged { + app.finalizeBlockState.ctx = ctx.WithConsensusParams(app.GetConsensusParams(ctx)) + } + } + beginBlockResp, err := app.beginBlock(req) appendBlockEventAttr(beginBlockResp.Events, "begin_block") txExecResults := make([]abci.ExecTxResult, 0, len(req.Txs)) @@ -360,7 +372,7 @@ func (app *BaseApp) FinalizeBlock(req abci.RequestFinalizeBlock) abci.ResponseFi txExecResults = append(txExecResults, result) } - endBlockResp := app.endBlock(ctx, req) + endBlockResp, err := app.endBlock(app.finalizeBlockState.ctx) appendBlockEventAttr(beginBlockResp.Events, "end_block") return abci.ResponseFinalizeBlock{ diff --git a/docs/architecture/adr-068-preblock.md b/docs/architecture/adr-068-preblock.md new file mode 100644 index 000000000000..86692c412c4d --- /dev/null +++ b/docs/architecture/adr-068-preblock.md @@ -0,0 +1,61 @@ +# ADR 068: Preblock + +## Changelog + +* Sept 13, 2023: Initial Draft + +## Status + +DRAFT + +## Abstract + +Introduce `PreBlock`, which runs before begin blocker other modules, and allows to modify consensus parameters, and the changes are visible to the following state machine logics. + +## Context + +When upgrading to sdk 0.47, the storage format for consensus parameters changed, but in the migration block, `ctx.ConsensusParams()` is always `nil`, because it fails to load the old format using new code, it's supposed to be migrated by the `x/upgrade` module first, but unfortunately, the migration happens in `BeginBlocker` handler, which runs after the `ctx` is initialized. +When we try to solve this, we find the `x/upgrade` module can't modify the context to make the consensus parameters visible for the other modules, the context is passed by value, and sdk team want to keep it that way, that's good for isolations between modules. + +## Alternatives + +The first alternative solution introduced a `MigrateModuleManager`, which only includes the `x/upgrade` module right now, and baseapp will run their `BeginBlocker`s before the other modules, and reload context's consensus parameters in between. + +## Decision + +Suggested this new lifecycle method. + +### `PreBlocker` + +There are two semantics around the new lifecycle method: + +- It runs before the `BeginBlocker` of all modules +- It can modify consensus parameters in storage, and signal the caller through the return value. + +When it returns `ConsensusParamsChanged=true`, the caller must refresh the consensus parameter in the finalize context: +``` +app.finalizeBlockState.ctx = app.finalizeBlockState.ctx.WithConsensusParams(app.GetConsensusParams()) +``` + +The new ctx must be passed to all the other lifecycle methods. + + +## Consequences + +### Backwards Compatibility + +### Positive + +### Negative + +### Neutral + +## Further Discussions + +## Test Cases + +## References +* [1] https://github.com/cosmos/cosmos-sdk/issues/16494 +* [2] https://github.com/cosmos/cosmos-sdk/pull/16583 +* [3] https://github.com/cosmos/cosmos-sdk/pull/17421 +* [4] https://github.com/cosmos/cosmos-sdk/pull/17713 diff --git a/docs/architecture/adr-070-unordered-account.md b/docs/architecture/adr-070-unordered-account.md new file mode 100644 index 000000000000..e4e879d84a10 --- /dev/null +++ b/docs/architecture/adr-070-unordered-account.md @@ -0,0 +1,337 @@ +# ADR 070: Unordered Transactions + +## Changelog + +* Dec 4, 2023: Initial Draft (@yihuang, @tac0turtle, @alexanderbez) +* Jan 30, 2024: Include section on deterministic transaction encoding + +## Status + +ACCEPTED + +## Abstract + +We propose a way to do replay-attack protection without enforcing the order of +transactions, without requiring the use of nonces. In this way, we can support +un-ordered transaction inclusion. + +## Context + +As of today, the nonce value (account sequence number) prevents replay-attack and +ensures the transactions from the same sender are included into blocks and executed +in sequential order. However it makes it tricky to send many transactions from the +same sender concurrently in a reliable way. IBC relayer and crypto exchanges are +typical examples of such use cases. + +## Decision + +We propose to add a boolean field `unordered` to transaction body to mark "un-ordered" +transactions. + +Un-ordered transactions will bypass the nonce rules and follow the rules described +below instead, in contrary, the default ordered transactions are not impacted by +this proposal, they'll follow the nonce rules the same as before. + +When an un-ordered transaction is included into a block, the transaction hash is +recorded in a dictionary. New transactions are checked against this dictionary for +duplicates, and to prevent the dictionary grow indefinitely, the transaction must +specify `timeout_timestamp` for expiration, so it's safe to removed it from the +dictionary after it's expired. + +The dictionary can be simply implemented as an in-memory golang map, a preliminary +analysis shows that the memory consumption won't be too big, for example `32M = 32 * 1024 * 1024` +can support 1024 blocks where each block contains 1024 unordered transactions. For +safety, we should limit the range of `timeout_timestamp` to prevent very long expiration, +and limit the size of the dictionary. + +### Transaction Format + +```protobuf +message TxBody { + ... + + bool unordered = 4; +} +``` + +### Replay Protection + +In order to provide replay protection, a user should ensure that the transaction's +TTL value is relatively short-lived but long enough to provide enough time to be +included in a block, e.g. ~10 minutes. + +We facilitate this by storing the transaction's hash in a durable map, `UnorderedTxManager`, +to prevent duplicates, i.e. replay attacks. Upon transaction ingress during `CheckTx`, +we check if the transaction's hash exists in this map or if the TTL value is stale, +i.e. before the current block time. If so, we reject it. Upon inclusion in a block +during `DeliverTx`, the transaction's hash is set in the map along with it's TTL +value. + +This map is evaluated at the end of each block, e.g. ABCI `Commit`, and all stale +transactions, i.e. transactions's TTL value who's now beyond the committed block, +are purged from the map. + +An important point to note is that in theory, it may be possible to submit an unordered +transaction twice, or multiple times, before the transaction is included in a block. +However, we'll note a few important layers of protection and mitigation: + +* Assuming CometBFT is used as the underlying consensus engine and a non-noop mempool + is used, CometBFT will reject the duplicate for you. +* For applications that leverage ABCI++, `ProcessProposal` should evaluate and reject + malicious proposals with duplicate transactions. +* For applications that leverage their own application mempool, their mempool should + reject the duplicate for you. +* Finally, worst case if the duplicate transaction is somehow selected for a block + proposal, 2nd and all further attempts to evaluate it, will fail during `DeliverTx`, + so worst case you just end up filling up block space with a duplicate transaction. + +```golang +type TxHash [32]byte + +const PurgeLoopSleepMS = 500 + +// UnorderedTxManager contains the tx hash dictionary for duplicates checking, +// and expire them when block production progresses. +type UnorderedTxManager struct { + // blockCh defines a channel to receive newly committed block time + blockCh chan time.Time + + mu sync.RWMutex + // txHashes defines a map from tx hash -> TTL value, which is used for duplicate + // checking and replay protection, as well as purging the map when the TTL is + // expired. + txHashes map[TxHash]time.Time +} + +func NewUnorderedTxManager() *UnorderedTxManager { + m := &UnorderedTxManager{ + blockCh: make(chan time.Time, 16), + txHashes: make(map[TxHash]time.Time), + } + + return m +} + +func (m *UnorderedTxManager) Start() { + go m.purgeLoop() +} + +func (m *UnorderedTxManager) Close() error { + close(m.blockCh) + m.blockCh = nil + return nil +} + +func (m *UnorderedTxManager) Contains(hash TxHash) bool{ + m.mu.RLock() + defer m.mu.RUnlock() + + _, ok := m.txHashes[hash] + return ok +} + +func (m *UnorderedTxManager) Size() int { + m.mu.RLock() + defer m.mu.RUnlock() + + return len(m.txHashes) +} + +func (m *UnorderedTxManager) Add(hash TxHash, expire time.Time) { + m.mu.Lock() + defer m.mu.Unlock() + + m.txHashes[hash] = expire +} + +// OnNewBlock send the latest block time to the background purge loop, which +// should be called in ABCI Commit event. +func (m *UnorderedTxManager) OnNewBlock(blockTime time.Time) { + m.blockCh <- blockTime +} + +// expiredTxs returns expired tx hashes based on the provided block time. +func (m *UnorderedTxManager) expiredTxs(blockTime time.Time) []TxHash { + m.mu.RLock() + defer m.mu.RUnlock() + + var result []TxHash + for txHash, expire := range m.txHashes { + if blockTime.After(expire) { + result = append(result, txHash) + } + } + + return result +} + +func (m *UnorderedTxManager) purge(txHashes []TxHash) { + m.mu.Lock() + defer m.mu.Unlock() + + for _, txHash := range txHashes { + delete(m.txHashes, txHash) + } +} + + +// purgeLoop removes expired tx hashes in the background +func (m *UnorderedTxManager) purgeLoop() error { + for { + latestTime, ok := m.batchReceive() + if !ok { + // channel closed + return + } + + hashes := m.expiredTxs(latestTime) + if len(hashes) > 0 { + m.purge(hashes) + } + } +} + + +// channelBatchRecv try to exhaust the channel buffer when it's not empty, +// and block when it's empty. +func channelBatchRecv[T any](ch <-chan *T) []*T { + item := <-ch // block if channel is empty + if item == nil { + // channel is closed + return nil + } + + remaining := len(ch) + result := make([]*T, 0, remaining+1) + result = append(result, item) + for i := 0; i < remaining; i++ { + result = append(result, <-ch) + } + + return result +} +``` + +### AnteHandler Decorator + +In order to facilitate bypassing nonce verification, we have to modify the existing +`IncrementSequenceDecorator` AnteHandler decorator to skip the nonce verification +when the transaction is marked as un-ordered. + +```golang +func (isd IncrementSequenceDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) { + if tx.UnOrdered() { + return next(ctx, tx, simulate) + } + + // ... +} +``` + +In addition, we need to introduce a new decorator to perform the un-ordered transaction +verification and map lookup. + +```golang +const ( + // DefaultMaxTimeoutDuration defines the default maximum duration an un-ordered transaction + // can set. + DefaultMaxTimeoutDuration = time.Minute * 40 +) + +type DedupTxDecorator struct { + m *UnorderedTxManager + maxTimeoutDuration time.Time +} + +func (d *DedupTxDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) { + // only apply to un-ordered transactions + if !tx.UnOrdered() { + return next(ctx, tx, simulate) + } + + headerInfo := d.env.HeaderService.HeaderInfo(ctx) + timeoutTimestamp := unorderedTx.GetTimeoutTimeStamp() + if timeoutTimestamp.IsZero() || timeoutTimestamp.Unix() == 0 { + return ctx, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "unordered transaction must have timeout_timestamp set") + } + if timeoutTimestamp.Before(headerInfo.Time) { + return ctx, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "unordered transaction has a timeout_timestamp that has already passed") + } + if timeoutTimestamp.After(headerInfo.Time.Add(d.maxTimeoutDuration)) { + return ctx, errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "unordered tx ttl exceeds %s", d.maxTimeoutDuration.String()) + } + + // in order to create a deterministic hash based on the tx, we need to hash the contents of the tx with signature + // Get a Buffer from the pool + buf := bufPool.Get().(*bytes.Buffer) + // Make sure to reset the buffer + buf.Reset() + + // Use the buffer + for _, msg := range tx.GetMsgs() { + // loop through the messages and write them to the buffer + // encoding the msg to bytes makes it deterministic within the state machine. + // Malleability is not a concern here because the state machine will encode the transaction deterministically. + bz, err := proto.Marshal(msg) + if err != nil { + return ctx, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "failed to marshal message") + } + + buf.Write(bz) + } + + // check for duplicates + // check for duplicates + if d.txManager.Contains(txHash) { + return ctx, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "tx %X is duplicated") + } + + if d.env.TransactionService.ExecMode(ctx) == transaction.ExecModeFinalize { + // a new tx included in the block, add the hash to the unordered tx manager + d.txManager.Add(txHash, ttl) + } + + return next(ctx, tx, simulate) +} +``` + +### Transaction Hashes + +It is absolutely vital that transaction hashes are deterministic, i.e. transaction +encoding is not malleable. If a given transaction, which is otherwise valid, can +be encoded to produce different hashes, which reflect the same valid transaction, +then a duplicate unordered transaction can be submitted and included in a block. + +In order to prevent this, the decoded transaction contents is taken. Starting with the content of the transaction we marshal the transaction in order to prevent a client reordering the transaction. Next we include the gas and timeout timestamp as part of the identifier. All these fields are signed over in the transaction payload. If one of them changes the signature will not match the transaction. + +### State Management + +On start up, the node needs to ensure the TxManager's state contains all un-expired +transactions that have been committed to the chain. This is critical since if the +state is not properly initialized, the node will not reject duplicate transactions +and thus will not provide replay protection, and will likely get an app hash mismatch error. + +We propose to write all un-expired unordered transactions from the TxManager's to +file on disk. On start up, the node will read this file and re-populate the TxManager's +map. The write to file will happen when the node gracefully shuts down on `Close()`. + +Note, this is not a perfect solution, in the context of store v1. With store v2, +we can omit explicit file handling altogether and simply write the all the transactions +to non-consensus state, i.e State Storage (SS). + +Alternatively, we can write all the transactions to consensus state. + +## Consequences + +### Positive + +* Support un-ordered and concurrent transaction inclusion. + +### Negative + +* Requires additional storage overhead and management of processed unordered + transactions that exist outside of consensus state. + +## References + +* https://github.com/cosmos/cosmos-sdk/issues/13009 diff --git a/docs/architecture/adr-076-tx-malleability.md b/docs/architecture/adr-076-tx-malleability.md new file mode 100644 index 000000000000..49625d9d0c6d --- /dev/null +++ b/docs/architecture/adr-076-tx-malleability.md @@ -0,0 +1,165 @@ +# Cosmos SDK Transaction Malleability Risk Review and Recommendations + +## Changelog + +* 2025-03-10: Initial draft (@aaronc) + +## Status + +PROPOSED: Not Implemented + +## Abstract + +Several encoding and sign mode related issues have historically resulted in the possibility +that Cosmos SDK transactions may be re-encoded in such a way as to change their hash +(and in rare cases, their meaning) without invalidating the signature. +This document details these cases, their potential risks, the extent to which they have been +addressed, and provides recommendations for future improvements. + +## Review + +One naive assumption about Cosmos SDK transactions is that hashing the raw bytes of a submitted transaction creates a safe unique identifier for the transaction. In reality, there are multiple ways in which transactions could be manipulated to create different transaction bytes (and as a result different hashes) that still pass signature verification. + +This document attempts to enumerate the various potential transaction "malleability" risks that we have identified and the extent to which they have or have not been addressed in various sign modes. We also identify vulnerabilities that could be introduced if developers make changes in the future without careful consideration of the complexities involved with transaction encoding, sign modes and signatures. + +### Risks Associated with Malleability + +The malleability of transactions poses the following potential risks to end users: +* unsigned data could get added to transactions and be processed by state machines +* clients often rely on transaction hashes for checking transaction status, but whether or not submitted transaction hashes match processed transaction hashes depends primarily on good network actors rather than fundamental protocol guarantees +* transactions could potentially get executed more than once (faulty replay protection) + +If a client generates a transaction, keeps a record of its hash and then attempts to query nodes to check the transaction's status, this process may falsely conclude that the transaction had not been processed if an intermediary +processor decoded and re-encoded the transaction with different encoding rules (either maliciously or unintentionally). +As long as no malleability is present in the signature bytes themselves, clients _should_ query transactions by signature instead of hash. + +Not being cognizant of this risk may lead clients to submit the same transaction multiple times if they believe that +earlier transactions had failed or gotten lost in processing. +This could be an attack vector against users if wallets primarily query transactions by hash. + +If the state machine were to rely on transaction hashes as a replay mechanism itself, this would be faulty and not +provide the intended replay protection. Instead, the state machine should rely on deterministic representations of +transactions rather than the raw encoding, or other nonces, +if they want to provide some replay protection that doesn't rely on a monotonically +increasing account sequence number. + + +### Sources of Malleability + +#### Non-deterministic Protobuf Encoding + +Cosmos SDK transactions are encoded using protobuf binary encoding when they are submitted to the network. Protobuf binary is not inherently a deterministic encoding meaning that the same logical payload could have several valid bytes representations. In a basic sense, this means that protobuf in general can be decoded and re-encoded to produce a different byte stream (and thus different hash) without changing the logical meaning of the bytes. [ADR 027: Deterministic Protobuf Serialization](https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-027-deterministic-protobuf-serialization.md) describes in detail what needs to be done to produce what we consider to be a "canonical", deterministic protobuf serialization. Briefly, the following sources of malleability at the encoding level have been identified and are addressed by this specification: +* fields can be emitted in any order +* default field values can be included or omitted, and this doesn't change meaning unless `optional` is used +* `repeated` fields of scalars may use packed or "regular" encoding +* `varint`s can include extra ignored bits +* extra fields may be added and are usually simply ignored by decoders. [ADR 020](https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-020-protobuf-transaction-encoding.md#unknown-field-filtering) specifies that in general such extra fields should cause messages and transactions to be rejected) + +When using `SIGN_MODE_DIRECT` none of the above malleabilities will be tolerated because: +* signatures of messages and extensions must be done over the raw encoded bytes of those fields +* the outer tx envelope (`TxRaw`) must follow ADR 027 rules or be rejected + +Transactions signed with `SIGN_MODE_LEGACY_AMINO_JSON`, however, have no way of protecting against the above malleabilities because what is signed is a JSON representation of the logical contents of the transaction. These logical contents could have any number of valid protobuf binary encodings, so in general there are no guarantees regarding transaction hash with Amino JSON signing. + +In addition to being aware of the general non-determinism of protobuf binary, developers need to pay special attention to make sure that unknown protobuf fields get rejected when developing new capabilities related to protobuf transactions. The protobuf serialization format was designed with the assumption that unknown data known to encoders could safely be ignored by decoders. This assumption may have been fairly safe within the walled garden of Google's centralized infrastructure. However, in distributed blockchain systems, this assumption is generally unsafe. If a newer client encodes a protobuf message with data intended for a newer server, it is not safe for an older server to simply ignore and discard instructions that it does not understand. These instructions could include critical information that the transaction signer is relying upon and just assuming that it is unimportant is not safe. + +[ADR 020](https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-020-protobuf-transaction-encoding.md#unknown-field-filtering) specifies some provisions for "non-critical" fields which can safely be ignored by older servers. In practice, I have not seen any valid usages of this. It is something in the design that maintainers should be aware of, but it may not be necessary or even 100% safe. + +#### Non-deterministic Value Encoding + +In addition to the non-determinism present in protobuf binary itself, some protobuf field data is encoded using a micro-format which itself may not be deterministic. Consider for instance integer or decimal encoding. Some decoders may allow for the presence of leading or trailing zeros without changing the logical meaning, ex. `00100` vs `100` or `100.00` vs `100`. So if a sign mode encodes numbers deterministically, but decoders accept multiple representations, +a user may sign over the value `100` while `0100` gets encoded. This would be possible with Amino JSON to the extent that the integer decoder accepts leading zeros. I believe the current `Int` implementation will reject this, however, it is +probably possible to encode a octal or hexadecimal representation in the transaction whereas the user signs over a decimal integer. + +#### Signature Encoding + +Signatures themselves are encoded using a micro-format specific to the signature algorithm being used and sometimes these +micro-formats can allow for non-determinism (multiple valid bytes for the same signature). +Most of the signature algorithms supported by the SDK should reject non-canonical bytes in their current implementation. +However, the `Multisignature` protobuf type uses normal protobuf encoding and there is no check as to whether the +decoded bytes followed canonical ADR 027 rules or not. Therefore, multisig transactions can have malleability in +their signatures. +Any new or custom signature algorithms must make sure that they reject any non-canonical bytes, otherwise even +with `SIGN_MODE_DIRECT` there can be transaction hash malleability by re-encoding signatures with a non-canonical +representation. + +#### Fields not covered by Amino JSON + +Another area that needs to be addressed carefully is the discrepancy between `AminoSignDoc`(see [`aminojson.proto`](../../x/tx/signing/aminojson/internal/aminojsonpb/aminojson.proto)) used for `SIGN_MODE_LEGACY_AMINO_JSON` and the actual contents of `TxBody` and `AuthInfo` (see [`tx.proto`](../../proto/cosmos/tx/v1beta1/tx.proto)). +If fields get added to `TxBody` or `AuthInfo`, they must either have a corresponding representing in `AminoSignDoc` or Amino JSON signatures must be rejected when those new fields are set. Making sure that this is done is a +highly manual process, and developers could easily make the mistake of updating `TxBody` or `AuthInfo` +without paying any attention to the implementation of `GetSignBytes` for Amino JSON. This is a critical +vulnerability in which unsigned content can now get into the transaction and signature verification will +pass. + +## Sign Mode Summary and Recommendations + +The sign modes officially supported by the SDK are `SIGN_MODE_DIRECT`, `SIGN_MODE_TEXTUAL`, `SIGN_MODE_DIRECT_AUX`, +and `SIGN_MODE_LEGACY_AMINO_JSON`. +`SIGN_MODE_LEGACY_AMINO_JSON` is used commonly by wallets and is currently the only sign mode supported on Nano Ledger hardware devices +(although `SIGN_MODE_TEXTUAL` was designed to also support hardware devices). +`SIGN_MODE_DIRECT` is the simplest sign mode and its usage is also fairly common. +`SIGN_MODE_DIRECT_AUX` is a variant of `SIGN_MODE_DIRECT` that can be used by auxiliary signers in a multi-signer +transaction by those signers who are not paying gas. +`SIGN_MODE_TEXTUAL` was intended as a replacement for `SIGN_MODE_LEGACY_AMINO_JSON`, but as far as we know it +has not been adopted by any clients yet and thus is not in active use. + +All known malleability concerns have been addressed in the current implementation of `SIGN_MODE_DIRECT`. +The only known malleability that could occur with a transaction signed with `SIGN_MODE_DIRECT` would +need to be in the signature bytes themselves. +Since signatures are not signed over, it is impossible for any sign mode to address this directly +and instead signature algorithms need to take care to reject any non-canonically encoded signature bytes +to prevent malleability. +For the known malleability of the `Multisignature` type, we should make sure that any valid signatures +were encoded following canonical ADR 027 rules when doing signature verification. + +`SIGN_MODE_DIRECT_AUX` provides the same level of safety as `SIGN_MODE_DIRECT` because +* the raw encoded `TxBody` bytes are signed over in `SignDocDirectAux`, and +* a transaction using `SIGN_MODE_DIRECT_AUX` still requires the primary signer to sign the transaction with `SIGN_MODE_DIRECT` + +`SIGN_MODE_TEXTUAL` also provides the same level of safety as `SIGN_MODE_DIRECT` because the hash of the raw encoded +`TxBody` and `AuthInfo` bytes are signed over. + +Unfortunately, the vast majority of unaddressed malleability risks affect `SIGN_MODE_LEGACY_AMINO_JSON` and this +sign mode is still commonly used. +It is recommended that the following improvements be made to Amino JSON signing: +* hashes of `TxBody` and `AuthInfo` should be added to `AminoSignDoc` so that encoding-level malleablity is addressed +* when constructing `AminoSignDoc`, [protoreflect](https://pkg.go.dev/google.golang.org/protobuf/reflect/protoreflect) API should be used to ensure that there no fields in `TxBody` or `AuthInfo` which do not have a mapping in `AminoSignDoc` have been set +* fields present in `TxBody` or `AuthInfo` that are not present in `AminoSignDoc` (such as extension options) should +be added to `AminoSignDoc` if possible + +## Testing + +To test that transactions are resistant to malleability, +we can develop a test suite to run against all sign modes that +attempts to manipulate transaction bytes in the following ways: +- changing protobuf encoding by + - reordering fields + - setting default values + - adding extra bits to varints, or + - setting new unknown fields +- modifying integer and decimal values encoded as strings with leading or trailing zeros + +Whenever any of these manipulations is done, we should observe that the sign doc bytes for the sign mode being +tested also change, meaning that the corresponding signatures will also have to change. + +In the case of Amino JSON, we should also develop tests which ensure that if any `TxBody` or `AuthInfo` +field not supported by Amino's `AminoSignDoc` is set that signing fails. + +In the general case of transaction decoding, we should have unit tests to ensure that +- any `TxRaw` bytes which do not follow ADR 027 canonical encoding cause decoding to fail, and +- any top-level transaction elements including `TxBody`, `AuthInfo`, public keys, and messages which +have unknown fields set cause the transaction to be rejected +(this ensures that ADR 020 unknown field filtering is properly applied) + +For each supported signature algorithm, +there should also be unit tests to ensure that signatures must be encoded canonically +or get rejected. + +## References + +* [ADR 027: Deterministic Protobuf Serialization](https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-027-deterministic-protobuf-serialization.md) +* [ADR 020](https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-020-protobuf-transaction-encoding.md#unknown-field-filtering) +* [`aminojson.proto`](../../x/tx/signing/aminojson/internal/aminojsonpb/aminojson.proto) +* [`tx.proto`](../../proto/cosmos/tx/v1beta1/tx.proto) + diff --git a/docs/docs/README.md b/docs/docs/Introduction.md similarity index 60% rename from docs/docs/README.md rename to docs/docs/Introduction.md index 451a0bc1942e..e5fc4a77bd2b 100644 --- a/docs/docs/README.md +++ b/docs/docs/Introduction.md @@ -9,19 +9,19 @@ Cosmos SDK is the world’s most popular framework for building application-spec Read all about the SDK or dive straight into the code with tutorials. -* [**Introductions to the Cosmos SDK**](./intro/00-overview.md) - Learn about all the parts of the Cosmos SDK. +* [**Introductions to the Cosmos SDK**](learn/intro/00-overview.md) - Learn about all the parts of the Cosmos SDK. * [**SDK Tutorials**](https://tutorials.cosmos.network) - Build a complete blockchain application from scratch. ## Explore the SDK Get familiar with the SDK and explore its main concepts. -* [**Introduction**](./intro/00-overview.md) - High-level overview of the Cosmos SDK. -* [**Basics**](./basics/00-app-anatomy.md) - Anatomy of a blockchain, transaction lifecycle, accounts and more. -* [**Core Concepts**](./core/00-baseapp.md) - Read about the core concepts like baseapp, the store, or the server. -* [**Building Modules**](./building-modules/01-intro.md) - Discover how to build modules for the Cosmos SDK. -* [**Running a Node**](./run-node/00-keyring.md) - Running and interacting with nodes using the CLI and API. -* [**Modules**](./modules/README.md) - Explore existing modules to build your application with. +* [**Introduction**](learn/intro/00-overview.md) - High-level overview of the Cosmos SDK. +* [**Basics**](learn/beginner/00-app-anatomy.md) - Anatomy of a blockchain, transaction lifecycle, accounts and more. +* [**Core Concepts**](learn/advanced/00-baseapp.md) - Read about the core concepts like baseapp, the store, or the server. +* [**Building Modules**](build/building-modules/00-intro.md) - Discover how to build modules for the Cosmos SDK. +* [**Running a Node**](user/run-node/00-keyring.md) - Running and interacting with nodes using the CLI and API. +* [**Modules**](build/modules) - Explore existing modules to build your application with. ## Explore the Stack diff --git a/docs/docs/basics/_category_.json b/docs/docs/basics/_category_.json deleted file mode 100644 index 1f2b57293f6d..000000000000 --- a/docs/docs/basics/_category_.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "label": "Basics", - "position": 1, - "link": null -} \ No newline at end of file diff --git a/docs/docs/build/_category_.json b/docs/docs/build/_category_.json new file mode 100644 index 000000000000..9f3088236274 --- /dev/null +++ b/docs/docs/build/_category_.json @@ -0,0 +1,5 @@ +{ + "label": "Build", + "position": 0, + "link": null +} \ No newline at end of file diff --git a/docs/docs/build/abci/00-introduction.md b/docs/docs/build/abci/00-introduction.md new file mode 100644 index 000000000000..5eef47e1c276 --- /dev/null +++ b/docs/docs/build/abci/00-introduction.md @@ -0,0 +1,51 @@ +# Introduction + +## What is ABCI? + +ABC, Application Blockchain Interface is the interface between CometBFT and the application, more information about ABCI can be found [here](https://docs.cometbft.com/v0.38/spec/abci/). Within the release of ABCI 2.0 for the 0.38 CometBFT release there were additional methods introduced. + +The 5 methods introduced during ABCI 2.0 are: + +* `PrepareProposal` +* `ProcessProposal` +* `ExtendVote` +* `VerifyVoteExtension` +* `FinalizeBlock` + + +## The Flow + +## PrepareProposal + +Based on their voting power, CometBFT chooses a block proposer and calls `PrepareProposal` on the block proposer's application (Cosmos SDK). The selected block proposer is responsible for collecting outstanding transactions from the mempool, adhering to the application's specifications. The application can enforce custom transaction ordering and incorporate additional transactions, potentially generated from vote extensions in the previous block. + +To perform this manipulation on the application side, a custom handler must be implemented. By default, the Cosmos SDK provides `PrepareProposalHandler`, used in conjunction with an application specific mempool. A custom handler can be written by application developer, if a noop handler provided, all transactions are considered valid. Please see [this](https://github.com/fatal-fruit/abci-workshop) tutorial for more information on custom handlers. + +Please note that vote extensions will only be available on the following height in which vote extensions are enabled. More information about vote extensions can be found [here](https://docs.cosmos.network/main/build/abci/03-vote-extensions.md). + +After creating the proposal, the proposer returns it to CometBFT. + +PrepareProposal CAN be non-deterministic. + +## ProcessProposal + +This method allows validators to perform application-specific checks on the block proposal and is called on all validators. This is an important step in the consensus process, as it ensures that the block is valid and meets the requirements of the application. For example, validators could check that the block contains all the required transactions or that the block does not create any invalid state transitions. + +The implementation of `ProcessProposal` MUST be deterministic. + +## ExtendVote and VerifyVoteExtensions + +These methods allow applications to extend the voting process by requiring validators to perform additional actions beyond simply validating blocks. + +If vote extensions are enabled, `ExtendVote` will be called on every validator and each one will return its vote extension which is in practice a bunch of bytes. As mentioned above this data (vote extension) can only be retrieved in the next block height during `PrepareProposal`. Additionally, this data can be arbitrary, but in the provided tutorials, it serves as an oracle or proof of transactions in the mempool. Essentially, vote extensions are processed and injected as transactions. Examples of use-cases for vote extensions include prices for a price oracle or encryption shares for an encrypted transaction mempool. `ExtendVote` CAN be non-deterministic. + +`VerifyVoteExtensions` is performed on every validator multiple times in order to verify other validators' vote extensions. This check is submitted to validate the integrity and validity of the vote extensions preventing malicious or invalid vote extensions. + +Additionally, applications must keep the vote extension data concise as it can degrade the performance of their chain, see testing results [here](https://docs.cometbft.com/v0.38/qa/cometbft-qa-38#vote-extensions-testbed). + +`VerifyVoteExtensions` MUST be deterministic. + + +## FinalizeBlock + +`FinalizeBlock` is then called and is responsible for updating the state of the blockchain and making the block available to users diff --git a/docs/docs/build/abci/01-prepare-proposal.md b/docs/docs/build/abci/01-prepare-proposal.md new file mode 100644 index 000000000000..b38243508573 --- /dev/null +++ b/docs/docs/build/abci/01-prepare-proposal.md @@ -0,0 +1,45 @@ +# Prepare Proposal + +`PrepareProposal` handles construction of the block, meaning that when a proposer +is preparing to propose a block, it requests the application to evaluate a +`RequestPrepareProposal`, which contains a series of transactions from CometBFT's +mempool. At this point, the application has complete control over the proposal. +It can modify, delete, and inject transactions from its own app-side mempool into +the proposal or even ignore all the transactions altogether. What the application +does with the transactions provided to it by `RequestPrepareProposal` has no +effect on CometBFT's mempool. + +Note, that the application defines the semantics of the `PrepareProposal` and it +MAY be non-deterministic and is only executed by the current block proposer. + +Now, reading mempool twice in the previous sentence is confusing, lets break it down. +CometBFT has a mempool that handles gossiping transactions to other nodes +in the network. The order of these transactions is determined by CometBFT's mempool, +using FIFO as the sole ordering mechanism. It's worth noting that the priority mempool +in Comet was removed or deprecated. +However, since the application is able to fully inspect +all transactions, it can provide greater control over transaction ordering. +Allowing the application to handle ordering enables the application to define how +it would like the block constructed. + +The Cosmos SDK defines the `DefaultProposalHandler` type, which provides applications with +`PrepareProposal` and `ProcessProposal` handlers. If you decide to implement your +own `PrepareProposal` handler, you must be sure to ensure that the transactions +selected DO NOT exceed the maximum block gas (if set) and the maximum bytes provided +by `req.MaxBytes`. + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/baseapp/abci_utils.go +``` + +This default implementation can be overridden by the application developer in +favor of a custom implementation in [`app.go`](./01-app-go-v2.md): + +```go +prepareOpt := func(app *baseapp.BaseApp) { +abciPropHandler := baseapp.NewDefaultProposalHandler(mempool, app) +app.SetPrepareProposal(abciPropHandler.PrepareProposalHandler()) +} + +baseAppOptions = append(baseAppOptions, prepareOpt) +``` \ No newline at end of file diff --git a/docs/docs/build/abci/02-process-proposal.md b/docs/docs/build/abci/02-process-proposal.md new file mode 100644 index 000000000000..815c093fe782 --- /dev/null +++ b/docs/docs/build/abci/02-process-proposal.md @@ -0,0 +1,32 @@ +# Process Proposal + +`ProcessProposal` handles the validation of a proposal from `PrepareProposal`, +which also includes a block header. Meaning, that after a block has been proposed +the other validators have the right to vote on a block. The validator in the +default implementation of `PrepareProposal` runs basic validity checks on each +transaction. + +Note, `ProcessProposal` MAY NOT be non-deterministic, i.e. it must be deterministic. +This means if `ProcessProposal` panics or fails and we reject, all honest validator +processes will prevote nil and the CometBFT round will proceed again until a valid +proposal is proposed. + +Here is the implementation of the default implementation: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/baseapp/abci_utils.go#L153-L159 +``` + +Like `PrepareProposal` this implementation is the default and can be modified by +the application developer in [`app.go`](./01-app-go-v2.md). If you decide to implement +your own `ProcessProposal` handler, you must be sure to ensure that the transactions +provided in the proposal DO NOT exceed the maximum block gas and `maxtxbytes` (if set). + +```go +processOpt := func(app *baseapp.BaseApp) { +abciPropHandler := baseapp.NewDefaultProposalHandler(mempool, app) +app.SetProcessProposal(abciPropHandler.ProcessProposalHandler()) +} + +baseAppOptions = append(baseAppOptions, processOpt) +``` diff --git a/docs/docs/build/abci/03-vote-extensions.md b/docs/docs/build/abci/03-vote-extensions.md new file mode 100644 index 000000000000..758c1ae45db6 --- /dev/null +++ b/docs/docs/build/abci/03-vote-extensions.md @@ -0,0 +1,123 @@ +# Vote Extensions + +:::note Synopsis +This section describes how the application can define and use vote extensions +defined in ABCI++. +::: + +## Extend Vote + +ABCI++ allows an application to extend a pre-commit vote with arbitrary data. This +process does NOT have to be deterministic, and the data returned can be unique to the +validator process. The Cosmos SDK defines [`baseapp.ExtendVoteHandler`](https://github.com/cosmos/cosmos-sdk/blob/v0.50.1/types/abci.go#L26-L27): + +```go +type ExtendVoteHandler func(Context, *abci.RequestExtendVote) (*abci.ResponseExtendVote, error) +``` + +An application can set this handler in `app.go` via the `baseapp.SetExtendVoteHandler` +`BaseApp` option function. The `sdk.ExtendVoteHandler`, if defined, is called during +the `ExtendVote` ABCI method. Note, if an application decides to implement +`baseapp.ExtendVoteHandler`, it MUST return a non-nil `VoteExtension`. However, the vote +extension can be empty. See [here](https://github.com/cometbft/cometbft/blob/v0.38.0-rc1/spec/abci/abci++_methods.md#extendvote) +for more details. + +There are many decentralized censorship-resistant use cases for vote extensions. +For example, a validator may want to submit prices for a price oracle or encryption +shares for an encrypted transaction mempool. Note, an application should be careful +to consider the size of the vote extensions as they could increase latency in block +production. See [here](https://github.com/cometbft/cometbft/blob/v0.38.0-rc1/docs/qa/CometBFT-QA-38.md#vote-extensions-testbed) +for more details. + +Click [here](https://docs.cosmos.network/main/user/tutorials/vote-extensions) if you would like a walkthrough of how to implement vote extensions. + + +## Verify Vote Extension + +Similar to extending a vote, an application can also verify vote extensions from +other validators when validating their pre-commits. For a given vote extension, +this process MUST be deterministic. The Cosmos SDK defines [`sdk.VerifyVoteExtensionHandler`](https://github.com/cosmos/cosmos-sdk/blob/v0.50.1/types/abci.go#L29-L31): + +```go +type VerifyVoteExtensionHandler func(Context, *abci.RequestVerifyVoteExtension) (*abci.ResponseVerifyVoteExtension, error) +``` + +An application can set this handler in `app.go` via the `baseapp.SetVerifyVoteExtensionHandler` +`BaseApp` option function. The `sdk.VerifyVoteExtensionHandler`, if defined, is called +during the `VerifyVoteExtension` ABCI method. If an application defines a vote +extension handler, it should also define a verification handler. Note, not all +validators will share the same view of what vote extensions they verify depending +on how votes are propagated. See [here](https://github.com/cometbft/cometbft/blob/v0.38.0-rc1/spec/abci/abci++_methods.md#verifyvoteextension) +for more details. + +Additionally, please keep in mind that performance can be degraded if vote extensions are too big (https://docs.cometbft.com/v0.38/qa/cometbft-qa-38#vote-extensions-testbed), so we highly recommend a size validation in `VerifyVoteExtensions`. + + +## Vote Extension Propagation + +The agreed upon vote extensions at height `H` are provided to the proposing validator +at height `H+1` during `PrepareProposal`. As a result, the vote extensions are +not natively provided or exposed to the remaining validators during `ProcessProposal`. +As a result, if an application requires that the agreed upon vote extensions from +height `H` are available to all validators at `H+1`, the application must propagate +these vote extensions manually in the block proposal itself. This can be done by +"injecting" them into the block proposal, since the `Txs` field in `PrepareProposal` +is just a slice of byte slices. + +`FinalizeBlock` will ignore any byte slice that doesn't implement an `sdk.Tx`, so +any injected vote extensions will safely be ignored in `FinalizeBlock`. For more +details on propagation, see the [ABCI++ 2.0 ADR](https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-064-abci-2.0.md#vote-extension-propagation--verification). + +### Recovery of injected Vote Extensions + +As stated before, vote extensions can be injected into a block proposal (along with +other transactions in the `Txs` field). The Cosmos SDK provides a pre-FinalizeBlock +hook to allow applications to recover vote extensions, perform any necessary +computation on them, and then store the results in the cached store. These results +will be available to the application during the subsequent `FinalizeBlock` call. + +An example of how a pre-FinalizeBlock hook could look like is shown below: + +```go +app.SetPreBlocker(func(ctx sdk.Context, req *abci.RequestFinalizeBlock) error { + allVEs := []VE{} // store all parsed vote extensions here + for _, tx := range req.Txs { + // define a custom function that tries to parse the tx as a vote extension + ve, ok := parseVoteExtension(tx) + if !ok { + continue + } + + allVEs = append(allVEs, ve) + } + + // perform any necessary computation on the vote extensions and store the result + // in the cached store + result := compute(allVEs) + err := storeVEResult(ctx, result) + if err != nil { + return err + } + + return nil +}) + +``` + +Then, in an app's module, the application can retrieve the result of the computation +of vote extensions from the cached store: + +```go +func (k Keeper) BeginBlocker(ctx context.Context) error { + // retrieve the result of the computation of vote extensions from the cached store + result, err := k.GetVEResult(ctx) + if err != nil { + return err + } + + // use the result of the computation of vote extensions + k.setSomething(result) + + return nil +} +``` diff --git a/docs/docs/core/_category_.json b/docs/docs/build/abci/_category_.json similarity index 56% rename from docs/docs/core/_category_.json rename to docs/docs/build/abci/_category_.json index 2a5703c287b9..d4ebb80c32a8 100644 --- a/docs/docs/core/_category_.json +++ b/docs/docs/build/abci/_category_.json @@ -1,5 +1,5 @@ { - "label": "Core Concepts", + "label": "ABCI", "position": 2, "link": null } \ No newline at end of file diff --git a/docs/docs/build/build.md b/docs/docs/build/build.md new file mode 100644 index 000000000000..3b86eb472b52 --- /dev/null +++ b/docs/docs/build/build.md @@ -0,0 +1,13 @@ +--- +sidebar_position: 0 +--- + +# Build + +* [Building Apps](./building-apps/00-app-go.md) - The documentation in this section will guide you through the process of developing your dApp using the Cosmos SDK framework. +* [Modules](./modules/README.md) - Information about the various modules available in the Cosmos SDK: Auth, Authz, Bank, Crisis, Distribution, Evidence, Feegrant, Governance, Mint, Params, Slashing, Staking, Upgrade, NFT, Consensus, Circuit, Genutil. +* [Migrations](./migrations/01-intro.md) - See what has been updated in each release the process of the transition between versions. +* [Packages](./packages/README.md) - Explore a curated collection of pre-built modules and functionalities, streamlining the development process. +* [Tooling](./tooling/README.md) - A suite of utilities designed to enhance the development workflow, optimizing the efficiency of Cosmos SDK-based projects. +* [ADR's](./architecture/README.md) - Provides a structured repository of key decisions made during the development process, which have been documented and offers rationale behind key decisions being made. +* [REST API](https://docs.cosmos.network/api) - A comprehensive reference for the application programming interfaces (APIs) provided by the SDK. diff --git a/docs/docs/building-apps/00-app-go.md b/docs/docs/build/building-apps/00-app-go.md similarity index 80% rename from docs/docs/building-apps/00-app-go.md rename to docs/docs/build/building-apps/00-app-go.md index f4af6dcfce3a..5a0524f3bbf7 100644 --- a/docs/docs/building-apps/00-app-go.md +++ b/docs/docs/build/building-apps/00-app-go.md @@ -10,5 +10,5 @@ For now please instead read the [tutorials](https://tutorials.cosmos.network) fo ## Complete `app.go` ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/app.go#L107-L738 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/app.go ``` diff --git a/docs/docs/building-apps/01-app-go-v2.md b/docs/docs/build/building-apps/01-app-go-v2.md similarity index 66% rename from docs/docs/building-apps/01-app-go-v2.md rename to docs/docs/build/building-apps/01-app-go-v2.md index d22b9b040216..8b64e55bfc45 100644 --- a/docs/docs/building-apps/01-app-go-v2.md +++ b/docs/docs/build/building-apps/01-app-go-v2.md @@ -11,9 +11,7 @@ Learn more about the rationale of App Wiring in [ADR-057](../architecture/adr-05 ::: -:::note - -### Pre-requisite Readings +:::note Pre-requisite Readings * [ADR 057: App Wiring](../architecture/adr-057-app-wiring.md) * [Depinject Documentation](../packages/01-depinject.md) @@ -30,29 +28,29 @@ The `app_config.go` file is the single place to configure all modules parameters 1. Create the `AppConfig` variable: ```go reference - https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/app_config.go#L91-L93 + https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/app_config.go#L103 ``` 2. Configure the `runtime` module: ```go reference - https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/app_config.go#L94-L158 + https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/app_config.go#L103-L167 ``` -3. Configure the modules defined in the `BeginBlocker` and `EndBlocker` and the `tx` module: +3. Configure the modules defined in the `PreBlocker`, `BeginBlocker` and `EndBlocker` and the `tx` module: ```go reference - https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/app_config.go#L159-L177 + https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/app_config.go#L112-L129 ``` ```go reference - https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/app_config.go#L192-L194 + https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/app_config.go#L200-L203 ``` ### Complete `app_config.go` ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/app_config.go#L52-L254 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/app_config.go ``` ### Alternative formats @@ -103,7 +101,7 @@ A more complete example of `app.yaml` can be found [here](https://github.com/cos In short `depinject` and the [`runtime` package](https://pkg.go.dev/github.com/cosmos/cosmos-sdk/runtime) abstract the wiring of the app, and the `AppBuilder` is the place where the app is constructed. [`runtime`](https://pkg.go.dev/github.com/cosmos/cosmos-sdk/runtime) takes care of registering the codecs, KV store, subspaces and instantiating `baseapp`. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/app_v2.go#L158-L291 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/app_v2.go#L101-L245 ``` :::warning @@ -117,9 +115,34 @@ In this case, use `depinject.Configs` for combining the extra configuration and More information on how work `depinject.Configs` and `depinject.Supply` can be found in the [`depinject` documentation](https://pkg.go.dev/cosmossdk.io/depinject). ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/app_v2.go#L186-L216 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/app_v2.go#L114-L146 ``` +### Registering non app wiring modules + +It is possible to combine app wiring / depinject enabled modules with non app wiring modules. +To do so, use the `app.RegisterModules` method to register the modules on your app, as well as `app.RegisterStores` for registering the extra stores needed. + +```go +// .... +app.App = appBuilder.Build(db, traceStore, baseAppOptions...) + +// register module manually +app.RegisterStores(storetypes.NewKVStoreKey(example.ModuleName)) +app.ExampleKeeper = examplekeeper.NewKeeper(app.appCodec, app.AccountKeeper.AddressCodec(), runtime.NewKVStoreService(app.GetKey(example.ModuleName)), authtypes.NewModuleAddress(govtypes.ModuleName).String()) +exampleAppModule := examplemodule.NewAppModule(app.ExampleKeeper) +if err := app.RegisterModules(&exampleAppModule); err != nil { + panic(err) +} + +// .... +``` + +:::warning +When using AutoCLI and combining app wiring and non app wiring modules. The AutoCLI options should be manually constructed instead of injected. +Otherwise it will miss the non depinject modules and not register their CLI. +::: + ### Complete `app_v2.go` :::tip @@ -127,5 +150,5 @@ Note that in the complete `SimApp` `app_v2.go` file, testing utilities are also ::: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/app_v2.go#L75-L395 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/app_v2.go ``` diff --git a/docs/docs/building-apps/02-app-mempool.md b/docs/docs/build/building-apps/02-app-mempool.md similarity index 90% rename from docs/docs/building-apps/02-app-mempool.md rename to docs/docs/build/building-apps/02-app-mempool.md index a8083f76f42b..630b94ba70ee 100644 --- a/docs/docs/building-apps/02-app-mempool.md +++ b/docs/docs/build/building-apps/02-app-mempool.md @@ -13,11 +13,9 @@ block building than previous versions. This change was enabled by [ABCI 1.0](https://github.com/cometbft/cometbft/blob/v0.37.0/spec/abci). Notably it introduces the `PrepareProposal` and `ProcessProposal` steps of ABCI++. -:::note +:::note Pre-requisite Readings -### Pre-requisite Readings - -* [BaseApp](../core/00-baseapp.md) +* [BaseApp](../../learn/advanced/00-baseapp.md) ::: @@ -44,10 +42,13 @@ Allowing the application to handle ordering enables the application to define ho it would like the block constructed. The Cosmos SDK defines the `DefaultProposalHandler` type, which provides applications with -`PrepareProposal` and `ProcessProposal` handlers. +`PrepareProposal` and `ProcessProposal` handlers. If you decide to implement your +own `PrepareProposal` handler, you must be sure to ensure that the transactions +selected DO NOT exceed the maximum block gas (if set) and the maximum bytes provided +by `req.MaxBytes`. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/baseapp/baseapp.go#L868-L916 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/baseapp/abci_utils.go ``` This default implementation can be overridden by the application developer in @@ -78,10 +79,13 @@ proposal is proposed. Here is the implementation of the default implementation: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/baseapp/baseapp.go#L927-L942 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/baseapp/abci_utils.go#L153-L159 ``` -Like `PrepareProposal` this implementation is the default and can be modified by the application developer in [`app.go`](./01-app-go-v2.md): +Like `PrepareProposal` this implementation is the default and can be modified by +the application developer in [`app.go`](./01-app-go-v2.md). If you decide to implement +your own `ProcessProposal` handler, you must be sure to ensure that the transactions +provided in the proposal DO NOT exceed the maximum block gas (if set). ```go processOpt := func(app *baseapp.BaseApp) { diff --git a/docs/docs/building-apps/03-app-upgrade.md b/docs/docs/build/building-apps/03-app-upgrade.md similarity index 92% rename from docs/docs/building-apps/03-app-upgrade.md rename to docs/docs/build/building-apps/03-app-upgrade.md index f90c7b385230..ef4e4bae785d 100644 --- a/docs/docs/building-apps/03-app-upgrade.md +++ b/docs/docs/build/building-apps/03-app-upgrade.md @@ -12,9 +12,7 @@ This document describes how to upgrade your application. If you are looking spec This section is currently incomplete. Track the progress of this document [here](https://github.com/cosmos/cosmos-sdk/issues/11504). ::: -:::note - -### Pre-requisite Reading +:::note Pre-requisite Readings * [`x/upgrade` Documentation](https://docs.cosmos.network/main/modules/upgrade) @@ -54,14 +52,20 @@ be a matter of minutes and not even require them to be awake at that time. ## Integrating With An App -Setup an upgrade Keeper for the app and then define a `BeginBlocker` that calls the upgrade -keeper's BeginBlocker method: +:::tip +The following is not required for users using `depinject`, this is abstracted for them. +::: + +In addition to basic module wiring, setup the upgrade Keeper for the app and then define a `PreBlocker` that calls the upgrade +keeper's PreBlocker method: ```go - func (app *myApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) (abci.ResponseBeginBlock, error) { - app.upgradeKeeper.BeginBlocker(ctx, req) - return abci.ResponseBeginBlock{}, nil - } +func (app *myApp) PreBlocker(ctx sdk.Context, req req.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error) { + // For demonstration sake, the app PreBlocker only returns the upgrade module pre-blocker. + // In a real app, the module manager should call all pre-blockers + // return return app.ModuleManager.PreBlock(ctx, req) + return app.upgradeKeeper.PreBlocker(ctx, req) +} ``` The app must then integrate the upgrade keeper with its governance module as appropriate. The governance module @@ -76,7 +80,7 @@ module to know that the upgrade has been safely applied, a handler with the name Here is an example handler for an upgrade named "my-fancy-upgrade": ```go -app.upgradeKeeper.SetUpgradeHandler("my-fancy-upgrade", func(ctx sdk.Context, plan upgrade.Plan) { +app.upgradeKeeper.SetUpgradeHandler("my-fancy-upgrade", func(ctx context.Context, plan upgrade.Plan) { // Perform any migrations of the state store needed for this upgrade }) ``` @@ -90,7 +94,7 @@ Here is a sample code to set store migrations with an upgrade: ```go // this configures a no-op upgrade handler for the "my-fancy-upgrade" upgrade -app.UpgradeKeeper.SetUpgradeHandler("my-fancy-upgrade", func(ctx sdk.Context, plan upgrade.Plan) { +app.UpgradeKeeper.SetUpgradeHandler("my-fancy-upgrade", func(ctx context.Context, plan upgrade.Plan) { // upgrade changes here }) upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk() diff --git a/docs/docs/build/building-apps/04-vote-extensions.md b/docs/docs/build/building-apps/04-vote-extensions.md new file mode 100644 index 000000000000..d2f33aa0778b --- /dev/null +++ b/docs/docs/build/building-apps/04-vote-extensions.md @@ -0,0 +1,121 @@ +--- +sidebar_position: 1 +--- + +# Vote Extensions + +:::note Synopsis +This section describes how the application can define and use vote extensions +defined in ABCI++. +::: + +## Extend Vote + +ABCI++ allows an application to extend a pre-commit vote with arbitrary data. This +process does NOT have to be deterministic, and the data returned can be unique to the +validator process. The Cosmos SDK defines `baseapp.ExtendVoteHandler`: + +```go +type ExtendVoteHandler func(Context, *abci.RequestExtendVote) (*abci.ResponseExtendVote, error) +``` + +An application can set this handler in `app.go` via the `baseapp.SetExtendVoteHandler` +`BaseApp` option function. The `sdk.ExtendVoteHandler`, if defined, is called during +the `ExtendVote` ABCI method. Note, if an application decides to implement +`baseapp.ExtendVoteHandler`, it MUST return a non-nil `VoteExtension`. However, the vote +extension can be empty. See [here](https://github.com/cometbft/cometbft/blob/v0.38.0-rc1/spec/abci/abci++_methods.md#extendvote) +for more details. + +There are many decentralized censorship-resistant use cases for vote extensions. +For example, a validator may want to submit prices for a price oracle or encryption +shares for an encrypted transaction mempool. Note, an application should be careful +to consider the size of the vote extensions as they could increase latency in block +production. See [here](https://github.com/cometbft/cometbft/blob/v0.38.0-rc1/docs/qa/CometBFT-QA-38.md#vote-extensions-testbed) +for more details. + +## Verify Vote Extension + +Similar to extending a vote, an application can also verify vote extensions from +other validators when validating their pre-commits. For a given vote extension, +this process MUST be deterministic. The Cosmos SDK defines `sdk.VerifyVoteExtensionHandler`: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/types/abci.go#L26-L27 +``` + +An application can set this handler in `app.go` via the `baseapp.SetVerifyVoteExtensionHandler` +`BaseApp` option function. The `sdk.VerifyVoteExtensionHandler`, if defined, is called +during the `VerifyVoteExtension` ABCI method. If an application defines a vote +extension handler, it should also define a verification handler. Note, not all +validators will share the same view of what vote extensions they verify depending +on how votes are propagated. See [here](https://github.com/cometbft/cometbft/blob/v0.38.0-rc1/spec/abci/abci++_methods.md#verifyvoteextension) +for more details. + +## Vote Extension Propagation + +The agreed upon vote extensions at height `H` are provided to the proposing validator +at height `H+1` during `PrepareProposal`. As a result, the vote extensions are +not natively provided or exposed to the remaining validators during `ProcessProposal`. +As a result, if an application requires that the agreed upon vote extensions from +height `H` are available to all validators at `H+1`, the application must propagate +these vote extensions manually in the block proposal itself. This can be done by +"injecting" them into the block proposal, since the `Txs` field in `PrepareProposal` +is just a slice of byte slices. + +`FinalizeBlock` will ignore any byte slice that doesn't implement an `sdk.Tx`, so +any injected vote extensions will safely be ignored in `FinalizeBlock`. For more +details on propagation, see the [ABCI++ 2.0 ADR](https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-064-abci-2.0.md#vote-extension-propagation--verification). + +### Recovery of injected Vote Extensions + +As stated before, vote extensions can be injected into a block proposal (along with +other transactions in the `Txs` field). The Cosmos SDK provides a pre-FinalizeBlock +hook to allow applications to recover vote extensions, perform any necessary +computation on them, and then store the results in the cached store. These results +will be available to the application during the subsequent `FinalizeBlock` call. + +An example of how a pre-FinalizeBlock hook could look like is shown below: + +```go +app.SetPreBlocker(func(ctx sdk.Context, req *abci.RequestFinalizeBlock) error { + allVEs := []VE{} // store all parsed vote extensions here + for _, tx := range req.Txs { + // define a custom function that tries to parse the tx as a vote extension + ve, ok := parseVoteExtension(tx) + if !ok { + continue + } + + allVEs = append(allVEs, ve) + } + + // perform any necessary computation on the vote extensions and store the result + // in the cached store + result := compute(allVEs) + err := storeVEResult(ctx, result) + if err != nil { + return err + } + + return nil +}) + +``` + +Then, in an app's module, the application can retrieve the result of the computation +of vote extensions from the cached store: + +```go +func (k Keeper) BeginBlocker(ctx context.Context) error { + // retrieve the result of the computation of vote extensions from the cached store + result, err := k.GetVEResult(ctx) + if err != nil { + return err + } + + // use the result of the computation of vote extensions + k.setSomething(result) + + return nil +} +``` diff --git a/docs/docs/build/building-apps/05-app-testnet.md b/docs/docs/build/building-apps/05-app-testnet.md new file mode 100644 index 000000000000..c30ca0a6454e --- /dev/null +++ b/docs/docs/build/building-apps/05-app-testnet.md @@ -0,0 +1,235 @@ +--- +sidebar_position: 1 +--- + +# Application Testnets + +Building an application is complicated and requires a lot of testing. The Cosmos SDK provides a way to test your application in a real-world environment: a testnet. + +We allow developers to take the state from their mainnet and run tests against the state. This is useful for testing upgrade migrations, or for testing the application in a real-world environment. + +## Testnet Setup + +We will be breaking down the steps to create a testnet from mainnet state. + +```go + // InitSimAppForTestnet is broken down into two sections: + // Required Changes: Changes that, if not made, will cause the testnet to halt or panic + // Optional Changes: Changes to customize the testnet to one's liking (lower vote times, fund accounts, etc) + func InitSimAppForTestnet(app *SimApp, newValAddr bytes.HexBytes, newValPubKey crypto.PubKey, newOperatorAddress, upgradeToTrigger string) *SimApp { + ... + } +``` + +### Required Changes + +#### Staking + +When creating a testnet the important part is migrate the validator set from many validators to one or a few. This allows developers to spin up the chain without needing to replace validator keys. + +```go + ctx := app.BaseApp.NewUncachedContext(true, tmproto.Header{}) + pubkey := &ed25519.PubKey{Key: newValPubKey.Bytes()} + pubkeyAny, err := types.NewAnyWithValue(pubkey) + if err != nil { + tmos.Exit(err.Error()) + } + + // STAKING + // + + // Create Validator struct for our new validator. + _, bz, err := bech32.DecodeAndConvert(newOperatorAddress) + if err != nil { + tmos.Exit(err.Error()) + } + bech32Addr, err := bech32.ConvertAndEncode("simvaloper", bz) + if err != nil { + tmos.Exit(err.Error()) + } + newVal := stakingtypes.Validator{ + OperatorAddress: bech32Addr, + ConsensusPubkey: pubkeyAny, + Jailed: false, + Status: stakingtypes.Bonded, + Tokens: sdk.NewInt(900000000000000), + DelegatorShares: sdk.MustNewDecFromStr("10000000"), + Description: stakingtypes.Description{ + Moniker: "Testnet Validator", + }, + Commission: stakingtypes.Commission{ + CommissionRates: stakingtypes.CommissionRates{ + Rate: sdk.MustNewDecFromStr("0.05"), + MaxRate: sdk.MustNewDecFromStr("0.1"), + MaxChangeRate: sdk.MustNewDecFromStr("0.05"), + }, + }, + MinSelfDelegation: sdk.OneInt(), + } + + // Remove all validators from power store + stakingKey := app.GetKey(stakingtypes.ModuleName) + stakingStore := ctx.KVStore(stakingKey) + iterator := app.StakingKeeper.ValidatorsPowerStoreIterator(ctx) + for ; iterator.Valid(); iterator.Next() { + stakingStore.Delete(iterator.Key()) + } + iterator.Close() + + // Remove all valdiators from last validators store + iterator = app.StakingKeeper.LastValidatorsIterator(ctx) + for ; iterator.Valid(); iterator.Next() { + app.StakingKeeper.LastValidatorPower.Delete(iterator.Key()) + } + iterator.Close() + + // Add our validator to power and last validators store + app.StakingKeeper.SetValidator(ctx, newVal) + err = app.StakingKeeper.SetValidatorByConsAddr(ctx, newVal) + if err != nil { + panic(err) + } + app.StakingKeeper.SetValidatorByPowerIndex(ctx, newVal) + app.StakingKeeper.SetLastValidatorPower(ctx, newVal.GetOperator(), 0) + if err := app.StakingKeeper.Hooks().AfterValidatorCreated(ctx, newVal.GetOperator()); err != nil { + panic(err) + } +``` + +#### Distribution + +Since the validator set has changed, we need to update the distribution records for the new validator. + + +```go + // Initialize records for this validator across all distribution stores + app.DistrKeeper.ValidatorHistoricalRewards.Set(ctx, newVal.GetOperator(), 0, distrtypes.NewValidatorHistoricalRewards(sdk.DecCoins{}, 1)) + app.DistrKeeper.ValidatorCurrentRewards.Set(ctx, newVal.GetOperator(), distrtypes.NewValidatorCurrentRewards(sdk.DecCoins{}, 1)) + app.DistrKeeper.ValidatorAccumulatedCommission.Set(ctx, newVal.GetOperator(), distrtypes.InitialValidatorAccumulatedCommission()) + app.DistrKeeper.ValidatorOutstandingRewards.Set(ctx, newVal.GetOperator(), distrtypes.ValidatorOutstandingRewards{Rewards: sdk.DecCoins{}}) +``` + +#### Slashing + +We also need to set the validator signing info for the new validator. + +```go + // SLASHING + // + + // Set validator signing info for our new validator. + newConsAddr := sdk.ConsAddress(newValAddr.Bytes()) + newValidatorSigningInfo := slashingtypes.ValidatorSigningInfo{ + Address: newConsAddr.String(), + StartHeight: app.LastBlockHeight() - 1, + Tombstoned: false, + } + app.SlashingKeeper.ValidatorSigningInfo.Set(ctx, newConsAddr, newValidatorSigningInfo) +``` + +#### Bank + +It is useful to create new accounts for your testing purposes. This avoids the need to have the same key as you may have on mainnet. + +```go + // BANK + // + + defaultCoins := sdk.NewCoins(sdk.NewInt64Coin("ustake", 1000000000000)) + + localSimAppAccounts := []sdk.AccAddress{ + sdk.MustAccAddressFromBech32("cosmos12smx2wdlyttvyzvzg54y2vnqwq2qjateuf7thj"), + sdk.MustAccAddressFromBech32("cosmos1cyyzpxplxdzkeea7kwsydadg87357qnahakaks"), + sdk.MustAccAddressFromBech32("cosmos18s5lynnmx37hq4wlrw9gdn68sg2uxp5rgk26vv"), + sdk.MustAccAddressFromBech32("cosmos1qwexv7c6sm95lwhzn9027vyu2ccneaqad4w8ka"), + sdk.MustAccAddressFromBech32("cosmos14hcxlnwlqtq75ttaxf674vk6mafspg8xwgnn53"), + sdk.MustAccAddressFromBech32("cosmos12rr534cer5c0vj53eq4y32lcwguyy7nndt0u2t"), + sdk.MustAccAddressFromBech32("cosmos1nt33cjd5auzh36syym6azgc8tve0jlvklnq7jq"), + sdk.MustAccAddressFromBech32("cosmos10qfrpash5g2vk3hppvu45x0g860czur8ff5yx0"), + sdk.MustAccAddressFromBech32("cosmos1f4tvsdukfwh6s9swrc24gkuz23tp8pd3e9r5fa"), + sdk.MustAccAddressFromBech32("cosmos1myv43sqgnj5sm4zl98ftl45af9cfzk7nhjxjqh"), + sdk.MustAccAddressFromBech32("cosmos14gs9zqh8m49yy9kscjqu9h72exyf295afg6kgk"), + sdk.MustAccAddressFromBech32("cosmos1jllfytsz4dryxhz5tl7u73v29exsf80vz52ucc")} + + // Fund localSimApp accounts + for _, account := range localSimAppAccounts { + err := app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, defaultCoins) + if err != nil { + tmos.Exit(err.Error()) + } + err = app.BankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, account, defaultCoins) + if err != nil { + tmos.Exit(err.Error()) + } + } +``` + +#### Upgrade + +If you would like to schedule an upgrade the below can be used. + +```go + // UPGRADE + // + + if upgradeToTrigger != "" { + upgradePlan := upgradetypes.Plan{ + Name: upgradeToTrigger, + Height: app.LastBlockHeight(), + } + err = app.UpgradeKeeper.ScheduleUpgrade(ctx, upgradePlan) + if err != nil { + panic(err) + } + } +``` + +### Optional Changes + +If you have custom modules that rely on specific state from the above modules and/or you would like to test your custom module, you will need to update the state of your custom module to reflect your needs + +## Running the Testnet + +Before we can run the testnet we must plug everything together. + +in `root.go`, in the `initRootCmd` function we add: + +```diff + server.AddCommands(rootCmd, simapp.DefaultNodeHome, newApp, createSimAppAndExport, addModuleInitFlags) + ++ server.AddTestnetCreatorCommand(rootCmd, simapp.DefaultNodeHome, newTestnetApp, addModuleInitFlags) +``` + +Next we will add a newTestnetApp helper function: + +```diff +// newTestnetApp starts by running the normal newApp method. From there, the app interface returned is modified in order +// for a testnet to be created from the provided app. +func newTestnetApp(logger log.Logger, db cometbftdb.DB, traceStore io.Writer, appOpts servertypes.AppOptions) servertypes.Application { + // Create an app and type cast to an SimApp + app := newApp(logger, db, traceStore, appOpts) + simApp, ok := app.(*simapp.SimApp) + if !ok { + panic("app created from newApp is not of type simApp") + } + + newValAddr, ok := appOpts.Get(server.KeyNewValAddr).(bytes.HexBytes) + if !ok { + panic("newValAddr is not of type bytes.HexBytes") + } + newValPubKey, ok := appOpts.Get(server.KeyUserPubKey).(crypto.PubKey) + if !ok { + panic("newValPubKey is not of type crypto.PubKey") + } + newOperatorAddress, ok := appOpts.Get(server.KeyNewOpAddr).(string) + if !ok { + panic("newOperatorAddress is not of type string") + } + upgradeToTrigger, ok := appOpts.Get(server.KeyTriggerTestnetUpgrade).(string) + if !ok { + panic("upgradeToTrigger is not of type string") + } + + // Make modifications to the normal SimApp required to run the network locally + return simapp.InitSimAppForTestnet(simApp, newValAddr, newValPubKey, newOperatorAddress, upgradeToTrigger) +} +``` diff --git a/docs/docs/building-apps/_category_.json b/docs/docs/build/building-apps/_category_.json similarity index 72% rename from docs/docs/building-apps/_category_.json rename to docs/docs/build/building-apps/_category_.json index de6617ddc10b..342732cce36e 100644 --- a/docs/docs/building-apps/_category_.json +++ b/docs/docs/build/building-apps/_category_.json @@ -1,5 +1,5 @@ { "label": "Building Apps", - "position": 4, + "position": 0, "link": null } \ No newline at end of file diff --git a/docs/docs/building-modules/01-intro.md b/docs/docs/build/building-modules/00-intro.md similarity index 80% rename from docs/docs/building-modules/01-intro.md rename to docs/docs/build/building-modules/00-intro.md index bb45d5d13252..4ac5462f376c 100644 --- a/docs/docs/building-modules/01-intro.md +++ b/docs/docs/build/building-modules/00-intro.md @@ -8,22 +8,20 @@ sidebar_position: 1 Modules define most of the logic of Cosmos SDK applications. Developers compose modules together using the Cosmos SDK to build their custom application-specific blockchains. This document outlines the basic concepts behind SDK modules and how to approach module management. ::: -:::note +:::note Pre-requisite Readings -### Pre-requisite Readings - -* [Anatomy of a Cosmos SDK application](../basics/00-app-anatomy.md) -* [Lifecycle of a Cosmos SDK transaction](../basics/01-tx-lifecycle.md) +* [Anatomy of a Cosmos SDK application](../../learn/beginner/00-app-anatomy.md) +* [Lifecycle of a Cosmos SDK transaction](../../learn/beginner/01-tx-lifecycle.md) ::: ## Role of Modules in a Cosmos SDK Application -The Cosmos SDK can be thought of as the Ruby-on-Rails of blockchain development. It comes with a core that provides the basic functionalities every blockchain application needs, like a [boilerplate implementation of the ABCI](../core/00-baseapp.md) to communicate with the underlying consensus engine, a [`multistore`](../core/04-store.md#multistore) to persist state, a [server](../core/03-node.md) to form a full-node and [interfaces](./09-module-interfaces.md) to handle queries. +The Cosmos SDK can be thought of as the Ruby-on-Rails of blockchain development. It comes with a core that provides the basic functionalities every blockchain application needs, like a [boilerplate implementation of the ABCI](../../learn/advanced/00-baseapp.md) to communicate with the underlying consensus engine, a [`multistore`](../../learn/advanced/04-store.md#multistore) to persist state, a [server](../../learn/advanced/03-node.md) to form a full-node and [interfaces](./09-module-interfaces.md) to handle queries. On top of this core, the Cosmos SDK enables developers to build modules that implement the business logic of their application. In other words, SDK modules implement the bulk of the logic of applications, while the core does the wiring and enables modules to be composed together. The end goal is to build a robust ecosystem of open-source Cosmos SDK modules, making it increasingly easier to build complex blockchain applications. -Cosmos SDK modules can be seen as little state-machines within the state-machine. They generally define a subset of the state using one or more `KVStore`s in the [main multistore](../core/04-store.md), as well as a subset of [message types](./02-messages-and-queries.md#messages). These messages are routed by one of the main components of Cosmos SDK core, [`BaseApp`](../core/00-baseapp.md), to a module Protobuf [`Msg` service](./03-msg-services.md) that defines them. +Cosmos SDK modules can be seen as little state-machines within the state-machine. They generally define a subset of the state using one or more `KVStore`s in the [main multistore](../../learn/advanced/04-store.md), as well as a subset of [message types](./02-messages-and-queries.md#messages). These messages are routed by one of the main components of Cosmos SDK core, [`BaseApp`](../../learn/advanced/00-baseapp.md), to a module Protobuf [`Msg` service](./03-msg-services.md) that defines them. ```text + @@ -72,21 +70,30 @@ Cosmos SDK modules can be seen as little state-machines within the state-machine As a result of this architecture, building a Cosmos SDK application usually revolves around writing modules to implement the specialized logic of the application and composing them with existing modules to complete the application. Developers will generally work on modules that implement logic needed for their specific use case that do not exist yet, and will use existing modules for more generic functionalities like staking, accounts, or token management. + +### Modules as Sudo + +Modules have the ability to perform actions that are not available to regular users. This is because modules are given sudo permissions by the state machine. Modules can reject another modules desire to execute a function but this logic must be explicit. Examples of this can be seen when modules create functions to modify parameters: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/61da5d1c29c16a1eb5bb5488719fde604ec07b10/x/bank/keeper/msg_server.go#L147-L149 +``` + ## How to Approach Building Modules as a Developer While there are no definitive guidelines for writing modules, here are some important design principles developers should keep in mind when building them: * **Composability**: Cosmos SDK applications are almost always composed of multiple modules. This means developers need to carefully consider the integration of their module not only with the core of the Cosmos SDK, but also with other modules. The former is achieved by following standard design patterns outlined [here](#main-components-of-sdk-modules), while the latter is achieved by properly exposing the store(s) of the module via the [`keeper`](./06-keeper.md). -* **Specialization**: A direct consequence of the **composability** feature is that modules should be **specialized**. Developers should carefully establish the scope of their module and not batch multiple functionalities into the same module. This separation of concerns enables modules to be re-used in other projects and improves the upgradability of the application. **Specialization** also plays an important role in the [object-capabilities model](../core/10-ocap.md) of the Cosmos SDK. +* **Specialization**: A direct consequence of the **composability** feature is that modules should be **specialized**. Developers should carefully establish the scope of their module and not batch multiple functionalities into the same module. This separation of concerns enables modules to be re-used in other projects and improves the upgradability of the application. **Specialization** also plays an important role in the [object-capabilities model](../../learn/advanced/10-ocap.md) of the Cosmos SDK. * **Capabilities**: Most modules need to read and/or write to the store(s) of other modules. However, in an open-source environment, it is possible for some modules to be malicious. That is why module developers need to carefully think not only about how their module interacts with other modules, but also about how to give access to the module's store(s). The Cosmos SDK takes a capabilities-oriented approach to inter-module security. This means that each store defined by a module is accessed by a `key`, which is held by the module's [`keeper`](./06-keeper.md). This `keeper` defines how to access the store(s) and under what conditions. Access to the module's store(s) is done by passing a reference to the module's `keeper`. ## Main Components of Cosmos SDK Modules Modules are by convention defined in the `./x/` subfolder (e.g. the `bank` module will be defined in the `./x/bank` folder). They generally share the same core components: -* A [`keeper`](./06-keeper.md), used to access the module's store(s) and update the state. -* A [`Msg` service](./02-messages-and-queries.md#messages), used to process messages when they are routed to the module by [`BaseApp`](../core/00-baseapp.md#message-routing) and trigger state-transitions. -* A [query service](./04-query-services.md), used to process user queries when they are routed to the module by [`BaseApp`](../core/00-baseapp.md#query-routing). +* A [`keeper`](./06-keeper.md), used to access the module's store(s) and update the state. +* A [`Msg` service](./02-messages-and-queries.md#messages), used to process messages when they are routed to the module by [`BaseApp`](../../learn/advanced/00-baseapp.md#message-routing) and trigger state-transitions. +* A [query service](./04-query-services.md), used to process user queries when they are routed to the module by [`BaseApp`](../../learn/advanced/00-baseapp.md#query-routing). * Interfaces, for end users to query the subset of the state defined by the module and create `message`s of the custom types defined in the module. In addition to these components, modules implement the `AppModule` interface in order to be managed by the [`module manager`](./01-module-manager.md). diff --git a/docs/docs/build/building-modules/01-module-manager.md b/docs/docs/build/building-modules/01-module-manager.md new file mode 100644 index 000000000000..955c82ff2ae8 --- /dev/null +++ b/docs/docs/build/building-modules/01-module-manager.md @@ -0,0 +1,330 @@ +--- +sidebar_position: 1 +--- + +# Module Manager + +:::note Synopsis +Cosmos SDK modules need to implement the [`AppModule` interfaces](#application-module-interfaces), in order to be managed by the application's [module manager](#module-manager). The module manager plays an important role in [`message` and `query` routing](../../learn/advanced/00-baseapp.md#routing), and allows application developers to set the order of execution of a variety of functions like [`PreBlocker`](../../learn/beginner/00-app-anatomy#preblocker) and [`BeginBlocker` and `EndBlocker`](../../learn/beginner/00-app-anatomy.md#begingblocker-and-endblocker). +::: + +:::note Pre-requisite Readings + +* [Introduction to Cosmos SDK Modules](./00-intro.md) + +::: + +## Application Module Interfaces + +Application module interfaces exist to facilitate the composition of modules together to form a functional Cosmos SDK application. + +:::note + +It is recommended to implement interfaces from the [Core API](https://docs.cosmos.network/main/architecture/adr-063-core-module-api) `appmodule` package. This makes modules less dependent on the SDK. +For legacy reason modules can still implement interfaces from the SDK `module` package. +::: + +There are 2 main application module interfaces: + +* [`appmodule.AppModule` / `module.AppModule`](#appmodule) for inter-dependent module functionalities (except genesis-related functionalities). +* (legacy) [`module.AppModuleBasic`](#appmodulebasic) for independent module functionalities. New modules can use `module.CoreAppModuleBasicAdaptor` instead. + +The above interfaces are mostly embedding smaller interfaces (extension interfaces), that defines specific functionalities: + +* (legacy) `module.HasName`: Allows the module to provide its own name for legacy purposes. +* (legacy) [`module.HasGenesisBasics`](#modulehasgenesisbasics): The legacy interface for stateless genesis methods. +* [`module.HasGenesis`](#modulehasgenesis) for inter-dependent genesis-related module functionalities. +* [`module.HasABCIGenesis`](#modulehasabcigenesis) for inter-dependent genesis-related module functionalities. +* [`appmodule.HasGenesis` / `module.HasGenesis`](#appmodulehasgenesis): The extension interface for stateful genesis methods. +* [`appmodule.HasPreBlocker`](#haspreblocker): The extension interface that contains information about the `AppModule` and `PreBlock`. +* [`appmodule.HasBeginBlocker`](#hasbeginblocker): The extension interface that contains information about the `AppModule` and `BeginBlock`. +* [`appmodule.HasEndBlocker`](#hasendblocker): The extension interface that contains information about the `AppModule` and `EndBlock`. +* [`appmodule.HasPrecommit`](#hasprecommit): The extension interface that contains information about the `AppModule` and `Precommit`. +* [`appmodule.HasPrepareCheckState`](#haspreparecheckstate): The extension interface that contains information about the `AppModule` and `PrepareCheckState`. +* [`appmodule.HasService` / `module.HasServices`](#hasservices): The extension interface for modules to register services. +* [`module.HasABCIEndBlock`](#hasabciendblock): The extension interface that contains information about the `AppModule`, `EndBlock` and returns an updated validator set. +* (legacy) [`module.HasInvariants`](#hasinvariants): The extension interface for registering invariants. +* (legacy) [`module.HasConsensusVersion`](#hasconsensusversion): The extension interface for declaring a module consensus version. + +The `AppModuleBasic` interface exists to define independent methods of the module, i.e. those that do not depend on other modules in the application. This allows for the construction of the basic application structure early in the application definition, generally in the `init()` function of the [main application file](../../learn/beginner/00-app-anatomy.md#core-application-file). + +The `AppModule` interface exists to define inter-dependent module methods. Many modules need to interact with other modules, typically through [`keeper`s](./06-keeper.md), which means there is a need for an interface where modules list their `keeper`s and other methods that require a reference to another module's object. `AppModule` interface extension, such as `HasBeginBlocker` and `HasEndBlocker`, also enables the module manager to set the order of execution between module's methods like `BeginBlock` and `EndBlock`, which is important in cases where the order of execution between modules matters in the context of the application. + +The usage of extension interfaces allows modules to define only the functionalities they need. For example, a module that does not need an `EndBlock` does not need to define the `HasEndBlocker` interface and thus the `EndBlock` method. `AppModule` and `AppModuleGenesis` are voluntarily small interfaces, that can take advantage of the `Module` patterns without having to define many placeholder functions. + +### `AppModuleBasic` + +:::note +Use `module.CoreAppModuleBasicAdaptor` instead for creating an `AppModuleBasic` from an `appmodule.AppModule`. +::: + +The `AppModuleBasic` interface defines the independent methods modules need to implement. + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/types/module/module.go#L56-L66 +``` + +Let us go through the methods: + +* `RegisterLegacyAminoCodec(*codec.LegacyAmino)`: Registers the `amino` codec for the module, which is used to marshal and unmarshal structs to/from `[]byte` in order to persist them in the module's `KVStore`. +* `RegisterInterfaces(codectypes.InterfaceRegistry)`: Registers a module's interface types and their concrete implementations as `proto.Message`. +* `RegisterGRPCGatewayRoutes(client.Context, *runtime.ServeMux)`: Registers gRPC routes for the module. + +All the `AppModuleBasic` of an application are managed by the [`BasicManager`](#basicmanager). + +### `HasName` + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/types/module/module.go#L71-L73 +``` + +* `HasName` is an interface that has a method `Name()`. This method returns the name of the module as a `string`. + +### Genesis + +:::tip +For easily creating an `AppModule` that only has genesis functionalities, use `module.GenesisOnlyAppModule`. +::: + +#### `module.HasGenesisBasics` + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/types/module/module.go#L76-L79 +``` + +Let us go through the methods: + +* `DefaultGenesis(codec.JSONCodec)`: Returns a default [`GenesisState`](./08-genesis.md#genesisstate) for the module, marshalled to `json.RawMessage`. The default `GenesisState` need to be defined by the module developer and is primarily used for testing. +* `ValidateGenesis(codec.JSONCodec, client.TxEncodingConfig, json.RawMessage)`: Used to validate the `GenesisState` defined by a module, given in its `json.RawMessage` form. It will usually unmarshall the `json` before running a custom [`ValidateGenesis`](./08-genesis.md#validategenesis) function defined by the module developer. + +#### `module.HasGenesis` + +`HasGenesis` is an extension interface for allowing modules to implement genesis functionalities. + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/6ce2505/types/module/module.go#L184-L189 +``` + +#### `module.HasABCIGenesis` + +`HasABCIGenesis` is an extension interface for allowing modules to implement genesis functionalities and returns validator set updates. + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/6ce2505/types/module/module.go#L191-L196 +``` + +#### `appmodule.HasGenesis` + +:::warning +`appmodule.HasGenesis` is experimental and should be considered unstable, it is recommended to not use this interface at this time. +::: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/6ce2505/core/appmodule/genesis.go#L8-L25 +``` + +### `AppModule` + +The `AppModule` interface defines a module. Modules can declare their functionalities by implementing extensions interfaces. +`AppModule`s are managed by the [module manager](#manager), which checks which extension interfaces are implemented by the module. + +#### `appmodule.AppModule` + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/6afece6/core/appmodule/module.go#L11-L20 +``` + +#### `module.AppModule` + +:::note +Previously the `module.AppModule` interface was containing all the methods that are defined in the extensions interfaces. This was leading to much boilerplate for modules that did not need all the functionalities. +::: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/types/module/module.go#L195-L199 +``` + +### `HasInvariants` + +This interface defines one method. It allows to checks if a module can register invariants. + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/types/module/module.go#L202-L205 +``` + +* `RegisterInvariants(sdk.InvariantRegistry)`: Registers the [`invariants`](./07-invariants.md) of the module. If an invariant deviates from its predicted value, the [`InvariantRegistry`](./07-invariants.md#registry) triggers appropriate logic (most often the chain will be halted). + +### `HasServices` + +This interface defines one method. It allows to checks if a module can register invariants. + +#### `appmodule.HasService` + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/6afece6/core/appmodule/module.go#L22-L40 +``` + +#### `module.HasServices` + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/types/module/module.go#L208-L211 +``` + +* `RegisterServices(Configurator)`: Allows a module to register services. + +### `HasConsensusVersion` + +This interface defines one method for checking a module consensus version. + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/types/module/module.go#L214-L220 +``` + +* `ConsensusVersion() uint64`: Returns the consensus version of the module. + +### `HasPreBlocker` + +The `HasPreBlocker` is an extension interface from `appmodule.AppModule`. All modules that have an `PreBlock` method implement this interface. + +### `HasBeginBlocker` + +The `HasBeginBlocker` is an extension interface from `appmodule.AppModule`. All modules that have an `BeginBlock` method implement this interface. + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/core/appmodule/module.go#L56-L63 +``` + +* `BeginBlock(context.Context) error`: This method gives module developers the option to implement logic that is automatically triggered at the beginning of each block. + +### `HasEndBlocker` + +The `HasEndBlocker` is an extension interface from `appmodule.AppModule`. All modules that have an `EndBlock` method implement this interface. If a module need to return validator set updates (staking), they can use `HasABCIEndBlock` + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/core/appmodule/module.go#L66-L72 +``` + +* `EndBlock(context.Context) error`: This method gives module developers the option to implement logic that is automatically triggered at the end of each block. + +### `HasABCIEndBlock` + +The `HasABCIEndBlock` is an extension interface from `module.AppModule`. All modules that have an `EndBlock` which return validator set updates implement this interface. + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/types/module/module.go#L222-L225 +``` + +* `EndBlock(context.Context) ([]abci.ValidatorUpdate, error)`: This method gives module developers the option to inform the underlying consensus engine of validator set changes (e.g. the `staking` module). + +### `HasPrecommit` + +`HasPrecommit` is an extension interface from `appmodule.AppModule`. All modules that have a `Precommit` method implement this interface. + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/core/appmodule/module.go#L49-L52 +``` + +* `Precommit(context.Context)`: This method gives module developers the option to implement logic that is automatically triggered during [`Commit'](../../learn/advanced/00-baseapp.md#commit) of each block using the [`finalizeblockstate`](../../learn/advanced/00-baseapp.md#state-updates) of the block to be committed. Implement empty if no logic needs to be triggered during `Commit` of each block for this module. + +### `HasPrepareCheckState` + +`HasPrepareCheckState` is an extension interface from `appmodule.AppModule`. All modules that have a `PrepareCheckState` method implement this interface. + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/core/appmodule/module.go#L49-L52 +``` + +* `PrepareCheckState(context.Context)`: This method gives module developers the option to implement logic that is automatically triggered during [`Commit'](../../learn/advanced/00-baseapp.md#commit) of each block using the [`checkState`](../../learn/advanced/00-baseapp.md#state-updates) of the next block. Implement empty if no logic needs to be triggered during `Commit` of each block for this module. + +### Implementing the Application Module Interfaces + +Typically, the various application module interfaces are implemented in a file called `module.go`, located in the module's folder (e.g. `./x/module/module.go`). + +Almost every module needs to implement the `AppModuleBasic` and `AppModule` interfaces. If the module is only used for genesis, it will implement `AppModuleGenesis` instead of `AppModule`. The concrete type that implements the interface can add parameters that are required for the implementation of the various methods of the interface. For example, the `Route()` function often calls a `NewMsgServerImpl(k keeper)` function defined in `keeper/msg_server.go` and therefore needs to pass the module's [`keeper`](./06-keeper.md) as a parameter. + +```go +// example +type AppModule struct { + AppModuleBasic + keeper Keeper +} +``` + +In the example above, you can see that the `AppModule` concrete type references an `AppModuleBasic`, and not an `AppModuleGenesis`. That is because `AppModuleGenesis` only needs to be implemented in modules that focus on genesis-related functionalities. In most modules, the concrete `AppModule` type will have a reference to an `AppModuleBasic` and implement the two added methods of `AppModuleGenesis` directly in the `AppModule` type. + +If no parameter is required (which is often the case for `AppModuleBasic`), just declare an empty concrete type like so: + +```go +type AppModuleBasic struct{} +``` + +## Module Managers + +Module managers are used to manage collections of `AppModuleBasic` and `AppModule`. + +### `BasicManager` + +The `BasicManager` is a structure that lists all the `AppModuleBasic` of an application: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/types/module/module.go#L82 +``` + +It implements the following methods: + +* `NewBasicManager(modules ...AppModuleBasic)`: Constructor function. It takes a list of the application's `AppModuleBasic` and builds a new `BasicManager`. This function is generally called in the `init()` function of [`app.go`](../../learn/beginner/00-app-anatomy.md#core-application-file) to quickly initialize the independent elements of the application's modules (click [here](https://github.com/cosmos/gaia/blob/main/app/app.go#L59-L74) to see an example). +* `NewBasicManagerFromManager(manager *Manager, customModuleBasics map[string]AppModuleBasic)`: Contructor function. It creates a new `BasicManager` from a `Manager`. The `BasicManager` will contain all `AppModuleBasic` from the `AppModule` manager using `CoreAppModuleBasicAdaptor` whenever possible. Module's `AppModuleBasic` can be overridden by passing a custom AppModuleBasic map +* `RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)`: Registers the [`codec.LegacyAmino`s](../../learn/advanced/05-encoding.md#amino) of each of the application's `AppModuleBasic`. This function is usually called early on in the [application's construction](../../learn/beginner/00-app-anatomy.md#constructor). +* `RegisterInterfaces(registry codectypes.InterfaceRegistry)`: Registers interface types and implementations of each of the application's `AppModuleBasic`. +* `DefaultGenesis(cdc codec.JSONCodec)`: Provides default genesis information for modules in the application by calling the [`DefaultGenesis(cdc codec.JSONCodec)`](./08-genesis.md#defaultgenesis) function of each module. It only calls the modules that implements the `HasGenesisBasics` interfaces. +* `ValidateGenesis(cdc codec.JSONCodec, txEncCfg client.TxEncodingConfig, genesis map[string]json.RawMessage)`: Validates the genesis information modules by calling the [`ValidateGenesis(codec.JSONCodec, client.TxEncodingConfig, json.RawMessage)`](./08-genesis.md#validategenesis) function of modules implementing the `HasGenesisBasics` interface. +* `RegisterGRPCGatewayRoutes(clientCtx client.Context, rtr *runtime.ServeMux)`: Registers gRPC routes for modules. +* `AddTxCommands(rootTxCmd *cobra.Command)`: Adds modules' transaction commands (defined as `GetTxCmd() *cobra.Command`) to the application's [`rootTxCommand`](../../learn/advanced/07-cli.md#transaction-commands). This function is usually called function from the `main.go` function of the [application's command-line interface](../../learn/advanced/07-cli.md). +* `AddQueryCommands(rootQueryCmd *cobra.Command)`: Adds modules' query commands (defined as `GetQueryCmd() *cobra.Command`) to the application's [`rootQueryCommand`](../../learn/advanced/07-cli.md#query-commands). This function is usually called function from the `main.go` function of the [application's command-line interface](../../learn/advanced/07-cli.md). + +### `Manager` + +The `Manager` is a structure that holds all the `AppModule` of an application, and defines the order of execution between several key components of these modules: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/types/module/module.go#L267-L276 +``` + +The module manager is used throughout the application whenever an action on a collection of modules is required. It implements the following methods: + +* `NewManager(modules ...AppModule)`: Constructor function. It takes a list of the application's `AppModule`s and builds a new `Manager`. It is generally called from the application's main [constructor function](../../learn/beginner/00-app-anatomy.md#constructor-function). +* `SetOrderInitGenesis(moduleNames ...string)`: Sets the order in which the [`InitGenesis`](./08-genesis.md#initgenesis) function of each module will be called when the application is first started. This function is generally called from the application's main [constructor function](../../learn/beginner/00-app-anatomy.md#constructor-function). + To initialize modules successfully, module dependencies should be considered. For example, the `genutil` module must occur after `staking` module so that the pools are properly initialized with tokens from genesis accounts, the `genutils` module must also occur after `auth` so that it can access the params from auth, IBC's `capability` module should be initialized before all other modules so that it can initialize any capabilities. +* `SetOrderExportGenesis(moduleNames ...string)`: Sets the order in which the [`ExportGenesis`](./08-genesis.md#exportgenesis) function of each module will be called in case of an export. This function is generally called from the application's main [constructor function](../../learn/beginner/00-app-anatomy.md#constructor-function). +* `SetOrderPreBlockers(moduleNames ...string)`: Sets the order in which the `PreBlock()` function of each module will be called before `BeginBlock()` of all modules. This function is generally called from the application's main [constructor function](../../learn/beginner/00-app-anatomy.md#constructor-function). +* `SetOrderBeginBlockers(moduleNames ...string)`: Sets the order in which the `BeginBlock()` function of each module will be called at the beginning of each block. This function is generally called from the application's main [constructor function](../../learn/beginner/00-app-anatomy.md#constructor-function). +* `SetOrderEndBlockers(moduleNames ...string)`: Sets the order in which the `EndBlock()` function of each module will be called at the end of each block. This function is generally called from the application's main [constructor function](../../learn/beginner/00-app-anatomy.md#constructor-function). +* `SetOrderPrecommiters(moduleNames ...string)`: Sets the order in which the `Precommit()` function of each module will be called during commit of each block. This function is generally called from the application's main [constructor function](../../learn/beginner/00-app-anatomy.md#constructor-function). +* `SetOrderPrepareCheckStaters(moduleNames ...string)`: Sets the order in which the `PrepareCheckState()` function of each module will be called during commit of each block. This function is generally called from the application's main [constructor function](../../learn/beginner/00-app-anatomy.md#constructor-function). +* `SetOrderMigrations(moduleNames ...string)`: Sets the order of migrations to be run. If not set then migrations will be run with an order defined in `DefaultMigrationsOrder`. +* `RegisterInvariants(ir sdk.InvariantRegistry)`: Registers the [invariants](./07-invariants.md) of module implementing the `HasInvariants` interface. +* `RegisterServices(cfg Configurator)`: Registers the services of modules implementing the `HasServices` interface. +* `InitGenesis(ctx context.Context, cdc codec.JSONCodec, genesisData map[string]json.RawMessage)`: Calls the [`InitGenesis`](./08-genesis.md#initgenesis) function of each module when the application is first started, in the order defined in `OrderInitGenesis`. Returns an `abci.ResponseInitChain` to the underlying consensus engine, which can contain validator updates. +* `ExportGenesis(ctx context.Context, cdc codec.JSONCodec)`: Calls the [`ExportGenesis`](./08-genesis.md#exportgenesis) function of each module, in the order defined in `OrderExportGenesis`. The export constructs a genesis file from a previously existing state, and is mainly used when a hard-fork upgrade of the chain is required. +* `ExportGenesisForModules(ctx context.Context, cdc codec.JSONCodec, modulesToExport []string)`: Behaves the same as `ExportGenesis`, except takes a list of modules to export. +* `BeginBlock(ctx context.Context) error`: At the beginning of each block, this function is called from [`BaseApp`](../../learn/advanced/00-baseapp.md#beginblock) and, in turn, calls the [`BeginBlock`](./06-beginblock-endblock.md) function of each modules implementing the `appmodule.HasBeginBlocker` interface, in the order defined in `OrderBeginBlockers`. It creates a child [context](../../learn/advanced/02-context.md) with an event manager to aggregate [events](../../learn/advanced/08-events.md) emitted from each modules. +* `EndBlock(ctx context.Context) error`: At the end of each block, this function is called from [`BaseApp`](../../learn/advanced/00-baseapp.md#endblock) and, in turn, calls the [`EndBlock`](./06-beginblock-endblock.md) function of each modules implementing the `appmodule.HasEndBlocker` interface, in the order defined in `OrderEndBlockers`. It creates a child [context](../../learn/advanced/02-context.md) with an event manager to aggregate [events](../../learn/advanced/08-events.md) emitted from all modules. The function returns an `abci` which contains the aforementioned events, as well as validator set updates (if any). +* `EndBlock(context.Context) ([]abci.ValidatorUpdate, error)`: At the end of each block, this function is called from [`BaseApp`](../../learn/advanced/00-baseapp.md#endblock) and, in turn, calls the [`EndBlock`](./06-beginblock-endblock.md) function of each modules implementing the `module.HasABCIEndBlock` interface, in the order defined in `OrderEndBlockers`. It creates a child [context](../../learn/advanced/02-context.md) with an event manager to aggregate [events](../../learn/advanced/08-events.md) emitted from all modules. The function returns an `abci` which contains the aforementioned events, as well as validator set updates (if any). +* `Precommit(ctx context.Context)`: During [`Commit`](../../learn/advanced/00-baseapp.md#commit), this function is called from `BaseApp` immediately before the [`deliverState`](../../learn/advanced/00-baseapp.md#state-updates) is written to the underlying [`rootMultiStore`](../../learn/advanced/04-store.md#commitmultistore) and, in turn calls the `Precommit` function of each modules implementing the `HasPrecommit` interface, in the order defined in `OrderPrecommiters`. It creates a child [context](../../learn/advanced/02-context.md) where the underlying `CacheMultiStore` is that of the newly committed block's [`finalizeblockstate`](../../learn/advanced/00-baseapp.md#state-updates). +* `PrepareCheckState(ctx context.Context)`: During [`Commit`](../../learn/advanced/00-baseapp.md#commit), this function is called from `BaseApp` immediately after the [`deliverState`](../../learn/advanced/00-baseapp.md#state-updates) is written to the underlying [`rootMultiStore`](../../learn/advanced/04-store.md#commitmultistore) and, in turn calls the `PrepareCheckState` function of each module implementing the `HasPrepareCheckState` interface, in the order defined in `OrderPrepareCheckStaters`. It creates a child [context](../../learn/advanced/02-context.md) where the underlying `CacheMultiStore` is that of the next block's [`checkState`](../../learn/advanced/00-baseapp.md#state-updates). Writes to this state will be present in the [`checkState`](../../learn/advanced/00-baseapp.md#state-updates) of the next block, and therefore this method can be used to prepare the `checkState` for the next block. + +Here's an example of a concrete integration within an `simapp`: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/app.go#L411-L434 +``` + +This is the same example from `runtime` (the package that powers app di): + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/runtime/module.go#L61 +``` + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/runtime/module.go#L82 +``` diff --git a/docs/docs/building-modules/02-messages-and-queries.md b/docs/docs/build/building-modules/02-messages-and-queries.md similarity index 62% rename from docs/docs/building-modules/02-messages-and-queries.md rename to docs/docs/build/building-modules/02-messages-and-queries.md index e2cb642ee6ef..573c35cd770e 100644 --- a/docs/docs/building-modules/02-messages-and-queries.md +++ b/docs/docs/build/building-modules/02-messages-and-queries.md @@ -8,29 +8,22 @@ sidebar_position: 1 `Msg`s and `Queries` are the two primary objects handled by modules. Most of the core components defined in a module, like `Msg` services, `keeper`s and `Query` services, exist to process `message`s and `queries`. ::: -:::note +:::note Pre-requisite Readings -### Pre-requisite Readings - -* [Introduction to Cosmos SDK Modules](./01-intro.md) +* [Introduction to Cosmos SDK Modules](./00-intro.md) ::: ## Messages -`Msg`s are objects whose end-goal is to trigger state-transitions. They are wrapped in [transactions](../core/01-transactions.md), which may contain one or more of them. +`Msg`s are objects whose end-goal is to trigger state-transitions. They are wrapped in [transactions](../../learn/advanced/01-transactions.md), which may contain one or more of them. -When a transaction is relayed from the underlying consensus engine to the Cosmos SDK application, it is first decoded by [`BaseApp`](../core/00-baseapp.md). Then, each message contained in the transaction is extracted and routed to the appropriate module via `BaseApp`'s `MsgServiceRouter` so that it can be processed by the module's [`Msg` service](./03-msg-services.md). For a more detailed explanation of the lifecycle of a transaction, click [here](../basics/01-tx-lifecycle.md). +When a transaction is relayed from the underlying consensus engine to the Cosmos SDK application, it is first decoded by [`BaseApp`](../../learn/advanced/00-baseapp.md). Then, each message contained in the transaction is extracted and routed to the appropriate module via `BaseApp`'s `MsgServiceRouter` so that it can be processed by the module's [`Msg` service](./03-msg-services.md). For a more detailed explanation of the lifecycle of a transaction, click [here](../../learn/beginner/01-tx-lifecycle.md). ### `Msg` Services -Defining Protobuf `Msg` services is the recommended way to handle messages. A Protobuf `Msg` service should be created for each module, typically in `tx.proto` (see more info about [conventions and naming](../core/05-encoding.md#faq)). It must have an RPC service method defined for each message in the module. - -See an example of a `Msg` service definition from `x/bank` module: +Defining Protobuf `Msg` services is the recommended way to handle messages. A Protobuf `Msg` service should be created for each module, typically in `tx.proto` (see more info about [conventions and naming](../../learn/advanced/05-encoding.md#faq)). It must have an RPC service method defined for each message in the module. -```protobuf reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/bank/v1beta1/tx.proto#L13-L36 -``` Each `Msg` service method must have exactly one argument, which must implement the `sdk.Msg` interface, and a Protobuf response. The naming convention is to call the RPC argument `Msg` and the RPC response `MsgResponse`. For example: @@ -38,47 +31,65 @@ Each `Msg` service method must have exactly one argument, which must implement t rpc Send(MsgSend) returns (MsgSendResponse); ``` -`sdk.Msg` interface is a simplified version of the Amino `LegacyMsg` interface described [below](#legacy-amino-msgs) with the `GetSigners()` method. For backwards compatibility with [Amino `LegacyMsg`s](#legacy-amino-msgs), existing `LegacyMsg` types should be used as the request parameter for `service` RPC definitions. Newer `sdk.Msg` types, which only support `service` definitions, should use canonical `Msg...` name. - -The Cosmos SDK uses Protobuf definitions to generate client and server code: +See an example of a `Msg` service definition from `x/bank` module: -* `MsgServer` interface defines the server API for the `Msg` service and its implementation is described as part of the [`Msg` services](./03-msg-services.md) documentation. -* Structures are generated for all RPC request and response types. +```protobuf reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/proto/cosmos/bank/v1beta1/tx.proto#L13-L36 +``` -A `RegisterMsgServer` method is also generated and should be used to register the module's `MsgServer` implementation in `RegisterServices` method from the [`AppModule` interface](./01-module-manager.md#appmodule). +### `sdk.Msg` Interface -In order for clients (CLI and grpc-gateway) to have these URLs registered, the Cosmos SDK provides the function `RegisterMsgServiceDesc(registry codectypes.InterfaceRegistry, sd *grpc.ServiceDesc)` that should be called inside module's [`RegisterInterfaces`](01-module-manager.md#appmodulebasic) method, using the proto-generated `&_Msg_serviceDesc` as `*grpc.ServiceDesc` argument. +`sdk.Msg` is a alias of `proto.Message`. -### Legacy Amino `LegacyMsg`s +To attach a `ValidateBasic()` method to a message then you must add methods to the type adhereing to the `HasValidateBasic`. -The following way of defining messages is deprecated and using [`Msg` services](#msg-services) is preferred. +```go reference +https://github.com/cosmos/cosmos-sdk/blob/9c1e8b247cd47b5d3decda6e86fbc3bc996ee5d7/types/tx_msg.go#L84-L88 +``` -Amino `LegacyMsg`s can be defined as protobuf messages. The messages definition usually includes a list of parameters needed to process the message that will be provided by end-users when they want to create a new transaction containing said message. +In 0.50+ signers from the `GetSigners()` call is automated via a protobuf annotation. -A `LegacyMsg` is typically accompanied by a standard constructor function, that is called from one of the [module's interface](./09-module-interfaces.md). `message`s also need to implement the `sdk.Msg` interface: +Read more about the signer field [here](./05-protobuf-annotations.md). -```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/types/tx_msg.go#L14-L26 +```protobuf reference +https://github.com/cosmos/cosmos-sdk/blob/e6848d99b55a65d014375b295bdd7f9641aac95e/proto/cosmos/bank/v1beta1/tx.proto#L40 ``` -It extends `proto.Message` and contains the following methods: +If there is a need for custom signers then there is an alternative path which can be taken. A function which returns `signing.CustomGetSigner` for a specific message can be defined. -* `GetSignBytes() []byte`: Return the canonical byte representation of the message. Used to generate a signature. -* `GetSigners() []AccAddress`: Return the list of signers. The Cosmos SDK will make sure that each `message` contained in a transaction is signed by all the signers listed in the list returned by this method. +```go +func ProvideBankSendTransactionGetSigners() signing.CustomGetSigner { -```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/auth/migrations/legacytx/stdsign.go#L20-L36 + // Extract the signer from the signature. + signer, err := coretypes.LatestSigner(Tx).Sender(ethTx) + if err != nil { + return nil, err + } + + // Return the signer in the required format. + return [][]byte{signer.Bytes()}, nil +} ``` -See an example implementation of a `message` from the `gov` module: +When using dependency injection (depinject) this can be provided to the application via the provide method. -```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/gov/types/v1/msgs.go#L121-L153 +```go +depinject.Provide(banktypes.ProvideBankSendTransactionGetSigners) ``` +The Cosmos SDK uses Protobuf definitions to generate client and server code: + +* `MsgServer` interface defines the server API for the `Msg` service and its implementation is described as part of the [`Msg` services](./03-msg-services.md) documentation. +* Structures are generated for all RPC request and response types. + +A `RegisterMsgServer` method is also generated and should be used to register the module's `MsgServer` implementation in `RegisterServices` method from the [`AppModule` interface](./01-module-manager.md#appmodule). + +In order for clients (CLI and grpc-gateway) to have these URLs registered, the Cosmos SDK provides the function `RegisterMsgServiceDesc(registry codectypes.InterfaceRegistry, sd *grpc.ServiceDesc)` that should be called inside module's [`RegisterInterfaces`](01-module-manager.md#appmodulebasic) method, using the proto-generated `&_Msg_serviceDesc` as `*grpc.ServiceDesc` argument. + + ## Queries -A `query` is a request for information made by end-users of applications through an interface and processed by a full-node. A `query` is received by a full-node through its consensus engine and relayed to the application via the ABCI. It is then routed to the appropriate module via `BaseApp`'s `QueryRouter` so that it can be processed by the module's query service (./04-query-services.md). For a deeper look at the lifecycle of a `query`, click [here](../basics/02-query-lifecycle.md). +A `query` is a request for information made by end-users of applications through an interface and processed by a full-node. A `query` is received by a full-node through its consensus engine and relayed to the application via the ABCI. It is then routed to the appropriate module via `BaseApp`'s `QueryRouter` so that it can be processed by the module's query service (./04-query-services.md). For a deeper look at the lifecycle of a `query`, click [here](../../learn/beginner/02-query-lifecycle.md). ### gRPC Queries @@ -87,7 +98,7 @@ Queries should be defined using [Protobuf services](https://developers.google.co Here's an example of such a `Query` service definition: ```protobuf reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/auth/v1beta1/query.proto#L14-L89 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/proto/cosmos/auth/v1beta1/query.proto#L14-L89 ``` As `proto.Message`s, generated `Response` types implement by default `String()` method of [`fmt.Stringer`](https://pkg.go.dev/fmt#Stringer). @@ -104,14 +115,14 @@ queryCategory/queryRoute/queryType/arg1/arg2/... where: -* `queryCategory` is the category of the `query`, typically `custom` for module queries. It is used to differentiate between different kinds of queries within `BaseApp`'s [`Query` method](../core/00-baseapp.md#query). -* `queryRoute` is used by `BaseApp`'s [`queryRouter`](../core/00-baseapp.md#query-routing) to map the `query` to its module. Usually, `queryRoute` should be the name of the module. +* `queryCategory` is the category of the `query`, typically `custom` for module queries. It is used to differentiate between different kinds of queries within `BaseApp`'s [`Query` method](../../learn/advanced/00-baseapp.md#query). +* `queryRoute` is used by `BaseApp`'s [`queryRouter`](../../learn/advanced/00-baseapp.md#query-routing) to map the `query` to its module. Usually, `queryRoute` should be the name of the module. * `queryType` is used by the module's [`querier`](./04-query-services.md#legacy-queriers) to map the `query` to the appropriate `querier function` within the module. * `args` are the actual arguments needed to process the `query`. They are filled out by the end-user. Note that for bigger queries, you might prefer passing arguments in the `Data` field of the request `req` instead of the `path`. The `path` for each `query` must be defined by the module developer in the module's [command-line interface file](./09-module-interfaces.md#query-commands).Overall, there are 3 mains components module developers need to implement in order to make the subset of the state defined by their module queryable: -* A [`querier`](./04-query-services.md#legacy-queriers), to process the `query` once it has been [routed to the module](../core/00-baseapp.md#query-routing). +* A [`querier`](./04-query-services.md#legacy-queriers), to process the `query` once it has been [routed to the module](../../learn/advanced/00-baseapp.md#query-routing). * [Query commands](./09-module-interfaces.md#query-commands) in the module's CLI file, where the `path` for each `query` is specified. * `query` return types. Typically defined in a file `types/querier.go`, they specify the result type of each of the module's `queries`. These custom types must implement the `String()` method of [`fmt.Stringer`](https://pkg.go.dev/fmt#Stringer). @@ -122,5 +133,5 @@ Store queries query directly for store keys. They use `clientCtx.QueryABCI(req a See following examples: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/baseapp/abci.go#L881-L902 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/baseapp/abci.go#L864-L894 ``` diff --git a/docs/docs/building-modules/03-msg-services.md b/docs/docs/build/building-modules/03-msg-services.md similarity index 75% rename from docs/docs/building-modules/03-msg-services.md rename to docs/docs/build/building-modules/03-msg-services.md index c1c57b3f1fef..421e53deca3a 100644 --- a/docs/docs/building-modules/03-msg-services.md +++ b/docs/docs/build/building-modules/03-msg-services.md @@ -5,12 +5,10 @@ sidebar_position: 1 # `Msg` Services :::note Synopsis -A Protobuf `Msg` service processes [messages](./02-messages-and-queries.md#messages). Protobuf `Msg` services are specific to the module in which they are defined, and only process messages defined within the said module. They are called from `BaseApp` during [`DeliverTx`](../core/00-baseapp.md#delivertx). +A Protobuf `Msg` service processes [messages](./02-messages-and-queries.md#messages). Protobuf `Msg` services are specific to the module in which they are defined, and only process messages defined within the said module. They are called from `BaseApp` during [`DeliverTx`](../../learn/advanced/00-baseapp.md#delivertx). ::: -:::note - -### Pre-requisite Readings +:::note Pre-requisite Readings * [Module Manager](./01-module-manager.md) * [Messages and Queries](./02-messages-and-queries.md) @@ -26,19 +24,19 @@ As further described in [ADR 031](../architecture/adr-031-msg-service.md), this Protobuf generates a `MsgServer` interface based on a definition of `Msg` service. It is the role of the module developer to implement this interface, by implementing the state transition logic that should happen upon receival of each `sdk.Msg`. As an example, here is the generated `MsgServer` interface for `x/bank`, which exposes two `sdk.Msg`s: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/bank/types/tx.pb.go#L550-L568 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/bank/types/tx.pb.go#L550-L568 ``` When possible, the existing module's [`Keeper`](./06-keeper.md) should implement `MsgServer`, otherwise a `msgServer` struct that embeds the `Keeper` can be created, typically in `./keeper/msg_server.go`: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/bank/keeper/msg_server.go#L15-L17 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/bank/keeper/msg_server.go#L17-L19 ``` -`msgServer` methods can retrieve the `sdk.Context` from the `context.Context` parameter method using the `sdk.UnwrapSDKContext`: +`msgServer` methods can retrieve the `context.Context` from the `context.Context` parameter method using the `sdk.UnwrapSDKContext`: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/bank/keeper/msg_server.go#L28 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/bank/keeper/msg_server.go#L56 ``` `sdk.Msg` processing usually follows these 3 steps: @@ -73,7 +71,7 @@ After the validation is successful, the `msgServer` method uses the [`keeper`](. ### Events -Before returning, `msgServer` methods generally emit one or more [events](../core/08-events.md) by using the `EventManager` held in the `ctx`. Use the new `EmitTypedEvent` function that uses protobuf-based event types: +Before returning, `msgServer` methods generally emit one or more [events](../../learn/advanced/08-events.md) by using the `EventManager` held in the `ctx`. Use the new `EmitTypedEvent` function that uses protobuf-based event types: ```go ctx.EventManager().EmitTypedEvent( @@ -92,18 +90,18 @@ ctx.EventManager().EmitEvent( ) ``` -These events are relayed back to the underlying consensus engine and can be used by service providers to implement services around the application. Click [here](../core/08-events.md) to learn more about events. +These events are relayed back to the underlying consensus engine and can be used by service providers to implement services around the application. Click [here](../../learn/advanced/08-events.md) to learn more about events. -The invoked `msgServer` method returns a `proto.Message` response and an `error`. These return values are then wrapped into an `*sdk.Result` or an `error` using `sdk.WrapServiceResult(ctx sdk.Context, res proto.Message, err error)`: +The invoked `msgServer` method returns a `proto.Message` response and an `error`. These return values are then wrapped into an `*sdk.Result` or an `error` using `sdk.WrapServiceResult(ctx context.Context, res proto.Message, err error)`: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/baseapp/msg_service_router.go#L131 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/baseapp/msg_service_router.go#L160 ``` This method takes care of marshaling the `res` parameter to protobuf and attaching any events on the `ctx.EventManager()` to the `sdk.Result`. ```protobuf reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/base/abci/v1beta1/abci.proto#L88-L109 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/proto/cosmos/base/abci/v1beta1/abci.proto#L93-L113 ``` This diagram shows a typical structure of a Protobuf `Msg` service, and how the message propagates through the module. @@ -112,10 +110,10 @@ This diagram shows a typical structure of a Protobuf `Msg` service, and how the ## Telemetry -New [telemetry metrics](../core/09-telemetry.md) can be created from `msgServer` methods when handling messages. +New [telemetry metrics](../../learn/advanced/09-telemetry.md) can be created from `msgServer` methods when handling messages. This is an example from the `x/auth/vesting` module: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/auth/vesting/msg_server.go#L68-L80 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/auth/vesting/msg_server.go#L76-L88 ``` diff --git a/docs/docs/building-modules/04-query-services.md b/docs/docs/build/building-modules/04-query-services.md similarity index 91% rename from docs/docs/building-modules/04-query-services.md rename to docs/docs/build/building-modules/04-query-services.md index cedeb092844c..a787a0c22b6f 100644 --- a/docs/docs/building-modules/04-query-services.md +++ b/docs/docs/build/building-modules/04-query-services.md @@ -5,12 +5,10 @@ sidebar_position: 1 # Query Services :::note Synopsis -A Protobuf Query service processes [`queries`](./02-messages-and-queries.md#queries). Query services are specific to the module in which they are defined, and only process `queries` defined within said module. They are called from `BaseApp`'s [`Query` method](../core/00-baseapp.md#query). +A Protobuf Query service processes [`queries`](./02-messages-and-queries.md#queries). Query services are specific to the module in which they are defined, and only process `queries` defined within said module. They are called from `BaseApp`'s [`Query` method](../../learn/advanced/00-baseapp.md#query). ::: -:::note - -### Pre-requisite Readings +:::note Pre-requisite Readings * [Module Manager](./01-module-manager.md) * [Messages and Queries](./02-messages-and-queries.md) @@ -30,13 +28,13 @@ type QueryServer interface { } ``` -These custom queries methods should be implemented by a module's keeper, typically in `./keeper/grpc_query.go`. The first parameter of these methods is a generic `context.Context`. Therefore, the Cosmos SDK provides a function `sdk.UnwrapSDKContext` to retrieve the `sdk.Context` from the provided +These custom queries methods should be implemented by a module's keeper, typically in `./keeper/grpc_query.go`. The first parameter of these methods is a generic `context.Context`. Therefore, the Cosmos SDK provides a function `sdk.UnwrapSDKContext` to retrieve the `context.Context` from the provided `context.Context`. Here's an example implementation for the bank module: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/bank/keeper/grpc_query.go +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/bank/keeper/grpc_query.go ``` ### Calling queries from the State Machine diff --git a/docs/docs/build/building-modules/05-protobuf-annotations.md b/docs/docs/build/building-modules/05-protobuf-annotations.md new file mode 100644 index 000000000000..5240112e9054 --- /dev/null +++ b/docs/docs/build/building-modules/05-protobuf-annotations.md @@ -0,0 +1,133 @@ +--- +sidebar_position: 1 +--- + +# ProtocolBuffer Annotations + +This document explains the various protobuf scalars that have been added to make working with protobuf easier for Cosmos SDK application developers + +## Signer + +Signer specifies which field should be used to determine the signer of a message for the Cosmos SDK. This field can be used for clients as well to infer which field should be used to determine the signer of a message. + +Read more about the signer field [here](./02-messages-and-queries.md). + +```protobuf reference +https://github.com/cosmos/cosmos-sdk/blob/e6848d99b55a65d014375b295bdd7f9641aac95e/proto/cosmos/bank/v1beta1/tx.proto#L40 +``` + +```proto +option (cosmos.msg.v1.signer) = "from_address"; +``` + +## Scalar + +The scalar type defines a way for clients to understand how to construct protobuf messages according to what is expected by the module and sdk. + +```proto +(cosmos_proto.scalar) = "cosmos.AddressString" +``` + +Example of account address string scalar: + +```proto reference +https://github.com/cosmos/cosmos-sdk/blob/e6848d99b55a65d014375b295bdd7f9641aac95e/proto/cosmos/bank/v1beta1/tx.proto#L46 +``` + +Example of validator address string scalar: + +```proto reference +https://github.com/cosmos/cosmos-sdk/blob/e8f28bf5db18b8d6b7e0d94b542ce4cf48fed9d6/proto/cosmos/distribution/v1beta1/query.proto#L87 +``` + +Example of Decimals scalar: + +```proto reference +https://github.com/cosmos/cosmos-sdk/blob/e8f28bf5db18b8d6b7e0d94b542ce4cf48fed9d6/proto/cosmos/distribution/v1beta1/distribution.proto#L26 +``` + +Example of Int scalar: + +```proto reference +https://github.com/cosmos/cosmos-sdk/blob/e8f28bf5db18b8d6b7e0d94b542ce4cf48fed9d6/proto/cosmos/gov/v1/gov.proto#L137 +``` + +There are a few options for what can be provided as a scalar: `cosmos.AddressString`, `cosmos.ValidatorAddressString`, `cosmos.ConsensusAddressString`, `cosmos.Int`, `cosmos.Dec`. + +## Implements_Interface + +Implement interface is used to provide information to client tooling like [telescope](https://github.com/cosmology-tech/telescope) on how to encode and decode protobuf messages. + +```proto +option (cosmos_proto.implements_interface) = "cosmos.auth.v1beta1.AccountI"; +``` + +## Method,Field,Message Added In + +`method_added_in`, `field_added_in` and `message_added_in` are annotations to denotate to clients that a field has been supported in a later version. This is useful when new methods or fields are added in later versions and that the client needs to be aware of what it can call. + +The annotation should be worded as follow: + +```proto +option (cosmos_proto.method_added_in) = "cosmos-sdk v0.50.1"; +option (cosmos_proto.method_added_in) = "x/epochs v1.0.0"; +option (cosmos_proto.method_added_in) = "simapp v24.0.0"; +``` + +## Amino + +The amino codec was removed in `v0.50+`, this means there is not a need register `legacyAminoCodec`. To replace the amino codec, Amino protobuf annotations are used to provide information to the amino codec on how to encode and decode protobuf messages. + +:::note +Amino annotations are only used for backwards compatibility with amino. New modules are not required use amino annotations. +::: + +The below annotations are used to provide information to the amino codec on how to encode and decode protobuf messages in a backwards compatible manner. + +### Name + +Name specifies the amino name that would show up for the user in order for them see which message they are signing. + +```proto +option (amino.name) = "cosmos-sdk/BaseAccount"; +``` + +```proto reference +https://github.com/cosmos/cosmos-sdk/blob/e8f28bf5db18b8d6b7e0d94b542ce4cf48fed9d6/proto/cosmos/bank/v1beta1/tx.proto#L41 +``` + +### Field_Name + +Field name specifies the amino name that would show up for the user in order for them see which field they are signing. + +```proto +uint64 height = 1 [(amino.field_name) = "public_key"]; +``` + +```proto reference +https://github.com/cosmos/cosmos-sdk/blob/e8f28bf5db18b8d6b7e0d94b542ce4cf48fed9d6/proto/cosmos/distribution/v1beta1/distribution.proto#L166 +``` + +### Dont_OmitEmpty + +Dont omitempty specifies that the field should not be omitted when encoding to amino. + +```proto +repeated cosmos.base.v1beta1.Coin amount = 3 [(amino.dont_omitempty) = true]; +``` + +```proto reference +https://github.com/cosmos/cosmos-sdk/blob/e8f28bf5db18b8d6b7e0d94b542ce4cf48fed9d6/proto/cosmos/bank/v1beta1/bank.proto#L56 +``` + +### Encoding + +Encoding instructs the amino json marshaler how to encode certain fields that may differ from the standard encoding behaviour. The most common example of this is how `repeated cosmos.base.v1beta1.Coin` is encoded when using the amino json encoding format. The `legacy_coins` option tells the json marshaler [how to encode a null slice](https://github.com/cosmos/cosmos-sdk/blob/e8f28bf5db18b8d6b7e0d94b542ce4cf48fed9d6/x/tx/signing/aminojson/json_marshal.go#L65) of `cosmos.base.v1beta1.Coin`. + +```proto +(amino.encoding) = "legacy_coins", +``` + +```proto reference +https://github.com/cosmos/cosmos-sdk/blob/e8f28bf5db18b8d6b7e0d94b542ce4cf48fed9d6/proto/cosmos/bank/v1beta1/genesis.proto#L23 +``` diff --git a/docs/docs/build/building-modules/06-beginblock-endblock.md b/docs/docs/build/building-modules/06-beginblock-endblock.md new file mode 100644 index 000000000000..a8eafdf67be7 --- /dev/null +++ b/docs/docs/build/building-modules/06-beginblock-endblock.md @@ -0,0 +1,47 @@ +--- +sidebar_position: 1 +--- + +# BeginBlocker and EndBlocker + +:::note Synopsis +`BeginBlocker` and `EndBlocker` are optional methods module developers can implement in their module. They will be triggered at the beginning and at the end of each block respectively, when the [`BeginBlock`](../../learn/advanced/00-baseapp.md#beginblock) and [`EndBlock`](../../learn/advanced/00-baseapp.md#endblock) ABCI messages are received from the underlying consensus engine. +::: + +:::note Pre-requisite Readings + +* [Module Manager](./01-module-manager.md) + +::: + +## BeginBlocker and EndBlocker + +`BeginBlocker` and `EndBlocker` are a way for module developers to add automatic execution of logic to their module. This is a powerful tool that should be used carefully, as complex automatic functions can slow down or even halt the chain. + +In 0.47.0, Prepare and Process Proposal were added that allow app developers to do arbitrary work at those phases, but they do not influence the work that will be done in BeginBlock. If an application required `BeginBlock` to execute prior to any sort of work is done then this is not possible today (0.50.0). + +When needed, `BeginBlocker` and `EndBlocker` are implemented as part of the [`HasBeginBlocker`, `HasABCIEndBlocker` and `EndBlocker` interfaces](./01-module-manager.md#appmodule). This means either can be left-out if not required. The `BeginBlock` and `EndBlock` methods of the interface implemented in `module.go` generally defer to `BeginBlocker` and `EndBlocker` methods respectively, which are usually implemented in `abci.go`. + +The actual implementation of `BeginBlocker` and `EndBlocker` in `abci.go` are very similar to that of a [`Msg` service](./03-msg-services.md): + +* They generally use the [`keeper`](./06-keeper.md) and [`ctx`](../../learn/advanced/02-context.md) to retrieve information about the latest state. +* If needed, they use the `keeper` and `ctx` to trigger state-transitions. +* If needed, they can emit [`events`](../../learn/advanced/08-events.md) via the `ctx`'s `EventManager`. + +A specific type of `EndBlocker` is available to return validator updates to the underlying consensus engine in the form of an [`[]abci.ValidatorUpdates`](https://docs.cometbft.com/v0.37/spec/abci/abci++_methods#endblock). This is the preferred way to implement custom validator changes. + +It is possible for developers to define the order of execution between the `BeginBlocker`/`EndBlocker` functions of each of their application's modules via the module's manager `SetOrderBeginBlocker`/`SetOrderEndBlocker` methods. For more on the module manager, click [here](./01-module-manager.md#manager). + +See an example implementation of `BeginBlocker` from the `distribution` module: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/distribution/abci.go#L14-L38 +``` + +and an example implementation of `EndBlocker` from the `staking` module: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/staking/keeper/abci.go#L22-L27 +``` + + diff --git a/docs/docs/building-modules/06-keeper.md b/docs/docs/build/building-modules/06-keeper.md similarity index 63% rename from docs/docs/building-modules/06-keeper.md rename to docs/docs/build/building-modules/06-keeper.md index 7f8f4457556f..399ec648cac8 100644 --- a/docs/docs/building-modules/06-keeper.md +++ b/docs/docs/build/building-modules/06-keeper.md @@ -8,11 +8,9 @@ sidebar_position: 1 `Keeper`s refer to a Cosmos SDK abstraction whose role is to manage access to the subset of the state defined by various modules. `Keeper`s are module-specific, i.e. the subset of state defined by a module can only be accessed by a `keeper` defined in said module. If a module needs to access the subset of state defined by another module, a reference to the second module's internal `keeper` needs to be passed to the first one. This is done in `app.go` during the instantiation of module keepers. ::: -:::note +:::note Pre-requisite Readings -### Pre-requisite Readings - -* [Introduction to Cosmos SDK Modules](./01-intro.md) +* [Introduction to Cosmos SDK Modules](./00-intro.md) ::: @@ -20,9 +18,9 @@ sidebar_position: 1 The Cosmos SDK is a framework that makes it easy for developers to build complex decentralized applications from scratch, mainly by composing modules together. As the ecosystem of open-source modules for the Cosmos SDK expands, it will become increasingly likely that some of these modules contain vulnerabilities, as a result of the negligence or malice of their developer. -The Cosmos SDK adopts an [object-capabilities-based approach](../core/10-ocap.md) to help developers better protect their application from unwanted inter-module interactions, and `keeper`s are at the core of this approach. A `keeper` can be considered quite literally to be the gatekeeper of a module's store(s). Each store (typically an [`IAVL` Store](../core/04-store.md#iavl-store)) defined within a module comes with a `storeKey`, which grants unlimited access to it. The module's `keeper` holds this `storeKey` (which should otherwise remain unexposed), and defines [methods](#implementing-methods) for reading and writing to the store(s). +The Cosmos SDK adopts an [object-capabilities-based approach](../../learn/advanced/10-ocap.md) to help developers better protect their application from unwanted inter-module interactions, and `keeper`s are at the core of this approach. A `keeper` can be considered quite literally to be the gatekeeper of a module's store(s). Each store (typically an [`IAVL` Store](../../learn/advanced/04-store.md#iavl-store)) defined within a module comes with a `storeKey`, which grants unlimited access to it. The module's `keeper` holds this `storeKey` (which should otherwise remain unexposed), and defines [methods](#implementing-methods) for reading and writing to the store(s). -The core idea behind the object-capabilities approach is to only reveal what is necessary to get the work done. In practice, this means that instead of handling permissions of modules through access-control lists, module `keeper`s are passed a reference to the specific instance of the other modules' `keeper`s that they need to access (this is done in the [application's constructor function](../basics/00-app-anatomy.md#constructor-function)). As a consequence, a module can only interact with the subset of state defined in another module via the methods exposed by the instance of the other module's `keeper`. This is a great way for developers to control the interactions that their own module can have with modules developed by external developers. +The core idea behind the object-capabilities approach is to only reveal what is necessary to get the work done. In practice, this means that instead of handling permissions of modules through access-control lists, module `keeper`s are passed a reference to the specific instance of the other modules' `keeper`s that they need to access (this is done in the [application's constructor function](../../learn/beginner/00-app-anatomy.md#constructor-function)). As a consequence, a module can only interact with the subset of state defined in another module via the methods exposed by the instance of the other module's `keeper`. This is a great way for developers to control the interactions that their own module can have with modules developed by external developers. ## Type Definition @@ -43,16 +41,17 @@ type Keeper struct { For example, here is the type definition of the `keeper` from the `staking` module: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/staking/keeper/keeper.go#L23-L31 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/staking/keeper/keeper.go#L23-L31 ``` Let us go through the different parameters: * An expected `keeper` is a `keeper` external to a module that is required by the internal `keeper` of said module. External `keeper`s are listed in the internal `keeper`'s type definition as interfaces. These interfaces are themselves defined in an `expected_keepers.go` file in the root of the module's folder. In this context, interfaces are used to reduce the number of dependencies, as well as to facilitate the maintenance of the module itself. -* `storeKey`s grant access to the store(s) of the [multistore](../core/04-store.md) managed by the module. They should always remain unexposed to external modules. -* `cdc` is the [codec](../core/05-encoding.md) used to marshall and unmarshall structs to/from `[]byte`. The `cdc` can be any of `codec.BinaryCodec`, `codec.JSONCodec` or `codec.Codec` based on your requirements. It can be either a proto or amino codec as long as they implement these interfaces. The authority listed is a module account or user account that has the right to change module level parameters. Previously this was handled by the param module, which has been deprecated. +* `storeKey`s grant access to the store(s) of the [multistore](../../learn/advanced/04-store.md) managed by the module. They should always remain unexposed to external modules. +* `cdc` is the [codec](../../learn/advanced/05-encoding.md) used to marshall and unmarshall structs to/from `[]byte`. The `cdc` can be any of `codec.BinaryCodec`, `codec.JSONCodec` or `codec.Codec` based on your requirements. It can be either a proto or amino codec as long as they implement these interfaces. +* The authority listed is a module account or user account that has the right to change module level parameters. Previously this was handled by the param module, which has been deprecated. -Of course, it is possible to define different types of internal `keeper`s for the same module (e.g. a read-only `keeper`). Each type of `keeper` comes with its own constructor function, which is called from the [application's constructor function](../basics/00-app-anatomy.md). This is where `keeper`s are instantiated, and where developers make sure to pass correct instances of modules' `keeper`s to other modules that require them. +Of course, it is possible to define different types of internal `keeper`s for the same module (e.g. a read-only `keeper`). Each type of `keeper` comes with its own constructor function, which is called from the [application's constructor function](../../learn/beginner/00-app-anatomy.md). This is where `keeper`s are instantiated, and where developers make sure to pass correct instances of modules' `keeper`s to other modules that require them. ## Implementing Methods @@ -61,7 +60,7 @@ Of course, it is possible to define different types of internal `keeper`s for th Typically, a *getter* method will have the following signature ```go -func (k Keeper) Get(ctx sdk.Context, key string) returnType +func (k Keeper) Get(ctx context.Context, key string) returnType ``` and the method will go through the following steps: @@ -73,7 +72,7 @@ and the method will go through the following steps: Similarly, a *setter* method will have the following signature ```go -func (k Keeper) Set(ctx sdk.Context, key string, value valueType) +func (k Keeper) Set(ctx context.Context, key string, value valueType) ``` and the method will go through the following steps: @@ -82,12 +81,12 @@ and the method will go through the following steps: 2. Marshal `value` to `[]byte` using the codec `cdc`. 3. Set the encoded value in the store at location `key` using the `Set(key []byte, value []byte)` method of the store. -For more, see an example of `keeper`'s [methods implementation from the `staking` module](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/staking/keeper/keeper.go). +For more, see an example of `keeper`'s [methods implementation from the `staking` module](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/staking/keeper/keeper.go). -The [module `KVStore`](../core/04-store.md#kvstore-and-commitkvstore-interfaces) also provides an `Iterator()` method which returns an `Iterator` object to iterate over a domain of keys. +The [module `KVStore`](../../learn/advanced/04-store.md#kvstore-and-commitkvstore-interfaces) also provides an `Iterator()` method which returns an `Iterator` object to iterate over a domain of keys. This is an example from the `auth` module to iterate accounts: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/auth/keeper/account.go#L94-L108 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/auth/keeper/account.go ``` diff --git a/docs/docs/building-modules/07-invariants.md b/docs/docs/build/building-modules/07-invariants.md similarity index 84% rename from docs/docs/building-modules/07-invariants.md rename to docs/docs/build/building-modules/07-invariants.md index 4c53169d4277..018796f716a6 100644 --- a/docs/docs/building-modules/07-invariants.md +++ b/docs/docs/build/building-modules/07-invariants.md @@ -8,9 +8,7 @@ sidebar_position: 1 An invariant is a property of the application that should always be true. In the context of the Cosmos SDK, an `Invariant` is a function that checks for a particular invariant. These functions are useful to detect bugs early on and act upon them to limit their potential consequences (e.g. by halting the chain). They are also useful in the development process of the application to detect bugs via simulations. ::: -:::note - -### Pre-requisite Readings +:::note Pre-requisite Readings * [Keepers](./06-keeper.md) @@ -21,7 +19,7 @@ An invariant is a property of the application that should always be true. In the An `Invariant` is a function that checks for a particular invariant within a module. Module `Invariant`s must follow the `Invariant` type: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/types/invariant.go#L9 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/types/invariant.go#L9 ``` The `string` return value is the invariant message, which can be used when printing logs, and the `bool` return value is the actual result of the invariant check. @@ -32,7 +30,7 @@ In practice, each module implements `Invariant`s in a `keeper/invariants.go` fil // Example for an Invariant that checks balance-related invariants func BalanceInvariants(k Keeper) sdk.Invariant { - return func(ctx sdk.Context) (string, bool) { + return func(ctx context.Context) (string, bool) { // Implement checks for balance-related invariants } } @@ -46,7 +44,7 @@ Additionally, module developers should generally implement an `AllInvariants` fu func AllInvariants(k Keeper) sdk.Invariant { - return func(ctx sdk.Context) (string, bool) { + return func(ctx context.Context) (string, bool) { res, stop := BalanceInvariants(k)(ctx) if stop { return res, stop @@ -60,10 +58,10 @@ func AllInvariants(k Keeper) sdk.Invariant { Finally, module developers need to implement the `RegisterInvariants` method as part of the [`AppModule` interface](./01-module-manager.md#appmodule). Indeed, the `RegisterInvariants` method of the module, implemented in the `module/module.go` file, typically only defers the call to a `RegisterInvariants` method implemented in the `keeper/invariants.go` file. The `RegisterInvariants` method registers a route for each `Invariant` function in the [`InvariantRegistry`](#invariant-registry): ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/staking/keeper/invariants.go#L12-L22 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/staking/keeper/invariants.go#L12-L22 ``` -For more, see an example of [`Invariant`s implementation from the `staking` module](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/staking/keeper/invariants.go). +For more, see an example of [`Invariant`s implementation from the `staking` module](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/staking/keeper/invariants.go). ## Invariant Registry @@ -72,21 +70,21 @@ The `InvariantRegistry` is a registry where the `Invariant`s of all the modules At its core, the `InvariantRegistry` is defined in the Cosmos SDK as an interface: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/types/invariant.go#L14-L17 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/types/invariant.go#L14-L17 ``` Typically, this interface is implemented in the `keeper` of a specific module. The most used implementation of an `InvariantRegistry` can be found in the `crisis` module: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/crisis/keeper/keeper.go#L57-L61 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/crisis/keeper/keeper.go#L48-L50 ``` -The `InvariantRegistry` is therefore typically instantiated by instantiating the `keeper` of the `crisis` module in the [application's constructor function](../basics/00-app-anatomy.md#constructor-function). +The `InvariantRegistry` is therefore typically instantiated by instantiating the `keeper` of the `crisis` module in the [application's constructor function](../../learn/beginner/00-app-anatomy.md#constructor-function). `Invariant`s can be checked manually via [`message`s](./02-messages-and-queries.md), but most often they are checked automatically at the end of each block. Here is an example from the `crisis` module: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/crisis/abci.go#L12-L21 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/crisis/abci.go#L13-L23 ``` In both cases, if one of the `Invariant`s returns false, the `InvariantRegistry` can trigger special logic (e.g. have the application panic and print the `Invariant`s message in the log). diff --git a/docs/docs/building-modules/08-genesis.md b/docs/docs/build/building-modules/08-genesis.md similarity index 66% rename from docs/docs/building-modules/08-genesis.md rename to docs/docs/build/building-modules/08-genesis.md index 2221097bff63..7abb21fb6577 100644 --- a/docs/docs/building-modules/08-genesis.md +++ b/docs/docs/build/building-modules/08-genesis.md @@ -8,9 +8,7 @@ sidebar_position: 1 Modules generally handle a subset of the state and, as such, they need to define the related subset of the genesis file as well as methods to initialize, verify and export it. ::: -:::note - -### Pre-requisite Readings +:::note Pre-requisite Readings * [Module Manager](./01-module-manager.md) * [Keepers](./06-keeper.md) @@ -19,12 +17,12 @@ Modules generally handle a subset of the state and, as such, they need to define ## Type Definition -The subset of the genesis state defined from a given module is generally defined in a `genesis.proto` file ([more info](../core/05-encoding.md#gogoproto) on how to define protobuf messages). The struct defining the module's subset of the genesis state is usually called `GenesisState` and contains all the module-related values that need to be initialized during the genesis process. +The subset of the genesis state defined from a given module is generally defined in a `genesis.proto` file ([more info](../../learn/advanced/05-encoding.md#gogoproto) on how to define protobuf messages). The struct defining the module's subset of the genesis state is usually called `GenesisState` and contains all the module-related values that need to be initialized during the genesis process. See an example of `GenesisState` protobuf message definition from the `auth` module: ```protobuf reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/auth/v1beta1/genesis.proto +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/proto/cosmos/auth/v1beta1/genesis.proto ``` Next we present the main genesis-related methods that need to be implemented by module developers in order for their module to be used in Cosmos SDK applications. @@ -34,7 +32,7 @@ Next we present the main genesis-related methods that need to be implemented by The `DefaultGenesis()` method is a simple method that calls the constructor function for `GenesisState` with the default value for each parameter. See an example from the `auth` module: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/auth/module.go#L55-L59 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/auth/module.go#L63-L67 ``` ### `ValidateGenesis` @@ -42,7 +40,7 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/auth/module.go#L55-L59 The `ValidateGenesis(data GenesisState)` method is called to verify that the provided `genesisState` is correct. It should perform validity checks on each of the parameters listed in `GenesisState`. See an example from the `auth` module: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/auth/types/genesis.go#L61-L74 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/auth/types/genesis.go#L62-L75 ``` ## Other Genesis Methods @@ -51,14 +49,14 @@ Other than the methods related directly to `GenesisState`, module developers are ### `InitGenesis` -The `InitGenesis` method is executed during [`InitChain`](../core/00-baseapp.md#initchain) when the application is first started. Given a `GenesisState`, it initializes the subset of the state managed by the module by using the module's [`keeper`](./06-keeper.md) setter function on each parameter within the `GenesisState`. +The `InitGenesis` method is executed during [`InitChain`](../../learn/advanced/00-baseapp.md#initchain) when the application is first started. Given a `GenesisState`, it initializes the subset of the state managed by the module by using the module's [`keeper`](./06-keeper.md) setter function on each parameter within the `GenesisState`. -The [module manager](./01-module-manager.md#manager) of the application is responsible for calling the `InitGenesis` method of each of the application's modules in order. This order is set by the application developer via the manager's `SetOrderGenesisMethod`, which is called in the [application's constructor function](../basics/00-app-anatomy.md#constructor-function). +The [module manager](./01-module-manager.md#manager) of the application is responsible for calling the `InitGenesis` method of each of the application's modules in order. This order is set by the application developer via the manager's `SetOrderGenesisMethod`, which is called in the [application's constructor function](../../learn/beginner/00-app-anatomy.md#constructor-function). See an example of `InitGenesis` from the `auth` module: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/auth/keeper/genesis.go#L8-L35 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/auth/keeper/genesis.go#L8-L35 ``` ### `ExportGenesis` @@ -68,7 +66,7 @@ The `ExportGenesis` method is executed whenever an export of the state is made. See an example of `ExportGenesis` from the `auth` module. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/auth/keeper/genesis.go#L37-L49 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/auth/keeper/genesis.go#L37-L49 ``` ### GenesisTxHandler @@ -76,5 +74,5 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/auth/keeper/genesis.go#L `GenesisTxHandler` is a way for modules to submit state transitions prior to the first block. This is used by `x/genutil` to submit the genesis transactions for the validators to be added to staking. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/core/genesis/txhandler.go#L3-L6 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/core/genesis/txhandler.go#L3-L6 ``` diff --git a/docs/docs/building-modules/09-module-interfaces.md b/docs/docs/build/building-modules/09-module-interfaces.md similarity index 78% rename from docs/docs/building-modules/09-module-interfaces.md rename to docs/docs/build/building-modules/09-module-interfaces.md index 4059e9a87753..4552baef240e 100644 --- a/docs/docs/building-modules/09-module-interfaces.md +++ b/docs/docs/build/building-modules/09-module-interfaces.md @@ -8,28 +8,26 @@ sidebar_position: 1 This document details how to build CLI and REST interfaces for a module. Examples from various Cosmos SDK modules are included. ::: -:::note +:::note Pre-requisite Readings -### Pre-requisite Readings - -* [Building Modules Intro](./01-intro.md) +* [Building Modules Intro](./00-intro.md) ::: ## CLI -One of the main interfaces for an application is the [command-line interface](../core/07-cli.md). This entrypoint adds commands from the application's modules enabling end-users to create [**messages**](./02-messages-and-queries.md#messages) wrapped in transactions and [**queries**](./02-messages-and-queries.md#queries). The CLI files are typically found in the module's `./client/cli` folder. +One of the main interfaces for an application is the [command-line interface](../../learn/advanced/07-cli.md). This entrypoint adds commands from the application's modules enabling end-users to create [**messages**](./02-messages-and-queries.md#messages) wrapped in transactions and [**queries**](./02-messages-and-queries.md#queries). The CLI files are typically found in the module's `./client/cli` folder. ### Transaction Commands -In order to create messages that trigger state changes, end-users must create [transactions](../core/01-transactions.md) that wrap and deliver the messages. A transaction command creates a transaction that includes one or more messages. +In order to create messages that trigger state changes, end-users must create [transactions](../../learn/advanced/01-transactions.md) that wrap and deliver the messages. A transaction command creates a transaction that includes one or more messages. Transaction commands typically have their own `tx.go` file that lives within the module's `./client/cli` folder. The commands are specified in getter functions and the name of the function should include the name of the command. Here is an example from the `x/bank` module: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/bank/client/cli/tx.go#L35-L71 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/bank/client/cli/tx.go#L37-L76 ``` In the example, `NewSendTxCmd()` creates and returns the transaction command for a transaction that wraps and delivers `MsgSend`. `MsgSend` is the message used to send tokens from one account to another. @@ -48,24 +46,29 @@ In general, the getter function does the following: * **Adds transaction flags:** All transaction commands must add a set of transaction [flags](#flags). The transaction flags are used to collect additional information from the user (e.g. the amount of fees the user is willing to pay). The transaction flags are added to the constructed command using `AddTxFlagsToCmd(cmd)`. * **Returns the command:** Finally, the transaction command is returned. -Each module must implement `NewTxCmd()`, which aggregates all of the transaction commands of the module. Here is an example from the `x/bank` module: +Each module can implement `NewTxCmd()`, which aggregates all of the transaction commands of the module. Here is an example from the `x/bank` module: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/bank/client/cli/tx.go#L17-L33 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/bank/client/cli/tx.go#L20-L35 ``` -Each module must also implement the `GetTxCmd()` method for `AppModuleBasic` that simply returns `NewTxCmd()`. This allows the root command to easily aggregate all of the transaction commands for each module. Here is an example: +Each module then can also implement a `GetTxCmd()` method that simply returns `NewTxCmd()`. This allows the root command to easily aggregate all of the transaction commands for each module. Here is an example: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/bank/module.go#L79-L82 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/bank/module.go#L84-L86 ``` ### Query Commands +:::warning +This section is being rewritten. Refer to [AutoCLI](https://docs.cosmos.network/main/core/autocli) while this section is being updated. +::: + + ## gRPC @@ -143,7 +146,7 @@ In order to do that, modules must implement `RegisterGRPCGatewayRoutes(clientCtx Here's an example from the `x/auth` module: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/auth/module.go#L71-L76 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/auth/module.go#L71-L76 ``` ## gRPC-gateway REST @@ -153,9 +156,9 @@ Applications need to support web services that use HTTP requests (e.g. a web wal Modules that want to expose REST queries should add `google.api.http` annotations to their `rpc` methods, such as in the example below from the `x/auth` module: ```protobuf reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/auth/v1beta1/query.proto#L14-L89 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/proto/cosmos/auth/v1beta1/query.proto#L14-L89 ``` -gRPC gateway is started in-process along with the application and CometBFT. It can be enabled or disabled by setting gRPC Configuration `enable` in [`app.toml`](../run-node/02-interact-node.md#configuring-the-node-using-apptoml). +gRPC gateway is started in-process along with the application and CometBFT. It can be enabled or disabled by setting gRPC Configuration `enable` in [`app.toml`](../run-node/01-run-node.md#configuring-the-node-using-apptoml-and-configtoml). -The Cosmos SDK provides a command for generating [Swagger](https://swagger.io/) documentation (`protoc-gen-swagger`). Setting `swagger` in [`app.toml`](../run-node/02-interact-node.md#configuring-the-node-using-apptoml) defines if swagger documentation should be automatically registered. +The Cosmos SDK provides a command for generating [Swagger](https://swagger.io/) documentation (`protoc-gen-swagger`). Setting `swagger` in [`app.toml`](../run-node/01-run-node.md#configuring-the-node-using-apptoml-and-configtoml) defines if swagger documentation should be automatically registered. diff --git a/docs/docs/building-modules/11-structure.md b/docs/docs/build/building-modules/11-structure.md similarity index 97% rename from docs/docs/building-modules/11-structure.md rename to docs/docs/build/building-modules/11-structure.md index e0d742171540..71a5b3cc2fc7 100644 --- a/docs/docs/building-modules/11-structure.md +++ b/docs/docs/build/building-modules/11-structure.md @@ -80,7 +80,7 @@ x/{module_name} * `keeper/`: The module's `Keeper` and `MsgServer` implementation. * `module/`: The module's `AppModule` and `AppModuleBasic` implementation. * `abci.go`: The module's `BeginBlocker` and `EndBlocker` implementations (this file is only required if `BeginBlocker` and/or `EndBlocker` need to be defined). - * `autocli.go`: The module [autocli](./10-autocli.md) options. + * `autocli.go`: The module [autocli](https://docs.cosmos.network/main/core/autocli) options. * `simulation/`: The module's [simulation](./14-simulator.md) package defines functions used by the blockchain simulator application (`simapp`). * `REAMDE.md`: The module's specification documents outlining important concepts, state storage structure, and message and event type definitions. Learn more how to write module specs in the [spec guidelines](../spec/SPEC_MODULE.md). * The root directory includes type definitions for messages, events, and genesis state, including the type definitions generated by Protocol Buffers. diff --git a/docs/docs/building-modules/12-errors.md b/docs/docs/build/building-modules/12-errors.md similarity index 92% rename from docs/docs/building-modules/12-errors.md rename to docs/docs/build/building-modules/12-errors.md index 969ce6e75f4e..214ab70e8803 100644 --- a/docs/docs/building-modules/12-errors.md +++ b/docs/docs/build/building-modules/12-errors.md @@ -21,7 +21,7 @@ Registration of errors is handled via the [`errors` package](https://github.com/ Example: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/distribution/types/errors.go#L1-L21 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/distribution/types/errors.go ``` Each custom module error must provide the codespace, which is typically the module name @@ -43,7 +43,7 @@ execution. Example: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/bank/keeper/keeper.go#L141-L182 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/bank/keeper/keeper.go#L141-L182 ``` Regardless if an error is wrapped or not, the Cosmos SDK's `errors` package provides a function to determine if diff --git a/docs/docs/building-modules/13-upgrade.md b/docs/docs/build/building-modules/13-upgrade.md similarity index 78% rename from docs/docs/building-modules/13-upgrade.md rename to docs/docs/build/building-modules/13-upgrade.md index 18484c68c658..908a6a06eeb0 100644 --- a/docs/docs/building-modules/13-upgrade.md +++ b/docs/docs/build/building-modules/13-upgrade.md @@ -5,14 +5,12 @@ sidebar_position: 1 # Upgrading Modules :::note Synopsis -[In-Place Store Migrations](../core/15-upgrade.md) allow your modules to upgrade to new versions that include breaking changes. This document outlines how to build modules to take advantage of this functionality. +[In-Place Store Migrations](../../learn/advanced/15-upgrade.md) allow your modules to upgrade to new versions that include breaking changes. This document outlines how to build modules to take advantage of this functionality. ::: -:::note +:::note Pre-requisite Readings -### Pre-requisite Readings - -* [In-Place Store Migration](../core/15-upgrade.md) +* [In-Place Store Migration](../../learn/advanced/15-upgrade.md) ::: @@ -48,7 +46,7 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { Since these migrations are functions that need access to a Keeper's store, use a wrapper around the keepers called `Migrator` as shown in this example: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/bank/keeper/migrations.go#L11-L35 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/bank/keeper/migrations.go ``` ## Writing Migration Scripts @@ -62,4 +60,4 @@ func (m Migrator) Migrate1to2(ctx sdk.Context) error { } ``` -To see example code of changes that were implemented in a migration of balance keys, check out [migrateBalanceKeys](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/bank/migrations/v2/store.go#L52-L73). For context, this code introduced migrations of the bank store that updated addresses to be prefixed by their length in bytes as outlined in [ADR-028](../architecture/adr-028-public-key-addresses.md). +To see example code of changes that were implemented in a migration of balance keys, check out [migrateBalanceKeys](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/bank/migrations/v2/store.go#L55-L76). For context, this code introduced migrations of the bank store that updated addresses to be prefixed by their length in bytes as outlined in [ADR-028](../architecture/adr-028-public-key-addresses.md). diff --git a/docs/docs/building-modules/14-simulator.md b/docs/docs/build/building-modules/14-simulator.md similarity index 86% rename from docs/docs/building-modules/14-simulator.md rename to docs/docs/build/building-modules/14-simulator.md index 7eed92011556..f7b9b84546e7 100644 --- a/docs/docs/building-modules/14-simulator.md +++ b/docs/docs/build/building-modules/14-simulator.md @@ -4,11 +4,9 @@ sidebar_position: 1 # Module Simulation -:::note +:::note Pre-requisite Readings -### Pre-requisite Readings - -* [Cosmos Blockchain Simulator](../core/12-simulation.md) +* [Cosmos Blockchain Simulator](../../learn/advanced/12-simulation.md) ::: ## Synopsis @@ -19,7 +17,6 @@ integrated with the application `SimulationManager`. * [Simulation package](#simulation-package) * [Store decoders](#store-decoders) * [Randomized genesis](#randomized-genesis) - * [Randomized parameter changes](#randomized-parameter-changes) * [Random weighted operations](#random-weighted-operations) * [Random proposal contents](#random-proposal-contents) * [Registering simulation functions](#registering-simulation-functions) @@ -39,7 +36,7 @@ for the key-value pairs from the stores to be decoded (_i.e_ unmarshalled) to their corresponding types. In particular, it matches the key to a concrete type and then unmarshals the value from the `KVPair` to the type provided. -You can use the example [here](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/distribution/simulation/decoder.go) from the distribution module to implement your store decoders. +You can use the example [here](https://github.com/cosmos/cosmos-sdk/blob/v/x/distribution/simulation/decoder.go) from the distribution module to implement your store decoders. ### Randomized genesis @@ -50,13 +47,13 @@ Once the module genesis parameter are generated randomly (or with the key and values defined in a `params` file), they are marshaled to JSON format and added to the app genesis JSON to use it on the simulations. -You can check an example on how to create the randomized genesis [here](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/staking/simulation/genesis.go). +You can check an example on how to create the randomized genesis [here](https://github.com/cosmos/cosmos-sdk/blob/v/x/staking/simulation/genesis.go). ### Randomized parameter changes The simulator is able to test parameter changes at random. The simulator package from each module must contain a `RandomizedParams` func that will simulate parameter changes of the module throughout the simulations lifespan. -You can see how an example of what is needed to fully test parameter changes [here](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/staking/simulation/params.go) +You can see how an example of what is needed to fully test parameter changes [here](https://github.com/cosmos/cosmos-sdk/blob/v/x/staking/simulation/params.go) ### Random weighted operations @@ -64,13 +61,13 @@ Operations are one of the crucial parts of the Cosmos SDK simulation. They are t (`Msg`) that are simulated with random field values. The sender of the operation is also assigned randomly. -Operations on the simulation are simulated using the full [transaction cycle](../core/01-transactions.md) of a +Operations on the simulation are simulated using the full [transaction cycle](../../learn/advanced/01-transactions.md) of a `ABCI` application that exposes the `BaseApp`. Shown below is how weights are set: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/staking/simulation/operations.go#L19-L86 +https://github.com/cosmos/cosmos-sdk/blob/release/v0.50.x/x/staking/simulation/operations.go#L19-L86 ``` As you can see, the weights are predefined in this case. Options exist to override this behavior with different weights. One option is to use `*rand.Rand` to define a random weight for the operation, or you can inject your own predefined weights. @@ -78,7 +75,7 @@ As you can see, the weights are predefined in this case. Options exist to overri Here is how one can override the above package `simappparams`. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/Makefile#L293-L299 +https://github.com/cosmos/cosmos-sdk/blob/release/v0.50.x/Makefile#L293-L299 ``` For the last test a tool called [runsim](https://github.com/cosmos/tools/tree/master/cmd/runsim) is used, this is used to parallelize go test instances, provide info to Github and slack integrations to provide information to your team on how the simulations are running. @@ -94,7 +91,7 @@ them to be used on the parameters. Now that all the required functions are defined, we need to integrate them into the module pattern within the `module.go`: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/distribution/module.go#L180-L203 +https://github.com/cosmos/cosmos-sdk/blob/release/v0.50.x/x/distribution/module.go#L180-L203 ``` ## App Simulator manager diff --git a/docs/docs/building-modules/15-depinject.md b/docs/docs/build/building-modules/15-depinject.md similarity index 65% rename from docs/docs/building-modules/15-depinject.md rename to docs/docs/build/building-modules/15-depinject.md index fc793f04b780..f277e5b1db79 100644 --- a/docs/docs/building-modules/15-depinject.md +++ b/docs/docs/build/building-modules/15-depinject.md @@ -4,9 +4,7 @@ sidebar_position: 1 # Modules depinject-ready -:::note - -### Pre-requisite Readings +:::note Pre-requisite Readings * [Depinject Documentation](../packages/01-depinject.md) @@ -32,25 +30,25 @@ A chain developer can then use the module by following these two steps: The module available configuration is defined in a Protobuf file, located at `{moduleName}/module/v1/module.proto`. ```protobuf reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/group/module/v1/module.proto +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/proto/cosmos/group/module/v1/module.proto ``` * `go_import` must point to the Go package of the custom module. * Message fields define the module configuration. That configuration can be set in the `app_config.go` / `app.yaml` file for a chain developer to configure the module. - Taking `group` as example, a chain developer is able to decide, thanks to `uint64 max_metadata_len`, what the maximum metatada length allowed for a group porposal is. + Taking `group` as example, a chain developer is able to decide, thanks to `uint64 max_metadata_len`, what the maximum metadata length allowed for a group proposal is. ```go reference - https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/app_config.go#L226-L230 + https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/app_config.go#L228-L234 ``` -That message is generated using [`pulsar`](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/scripts/protocgen-pulsar.sh) (by running `make proto-gen`). -In the case of the `group` module, this file is generated here: https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/api/cosmos/group/module/v1/module.pulsar.go. +That message is generated using [`pulsar`](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/scripts/protocgen-pulsar.sh) (by running `make proto-gen`). +In the case of the `group` module, this file is generated here: https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/api/cosmos/group/module/v1/module.pulsar.go. The part that is relevant for the module configuration is: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/api/cosmos/group/module/v1/module.pulsar.go#L515-L527 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/api/cosmos/group/module/v1/module.pulsar.go#L515-L527 ``` :::note @@ -68,46 +66,46 @@ All methods, structs and their fields must be public for `depinject`. 1. Import the module configuration generated package: - ```go reference - https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/group/module/module.go#L12-L14 - ``` + ```go reference + https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/group/module/module.go#L12-L14 + ``` - Define an `init()` function for defining the `providers` of the module configuration: - This registers the module configuration message and the wiring of the module. + Define an `init()` function for defining the `providers` of the module configuration: + This registers the module configuration message and the wiring of the module. - ```go reference - https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/group/module/module.go#L199-L204 - ``` + ```go reference + https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/group/module/module.go#L194-L199 + ``` 2. Ensure that the module implements the `appmodule.AppModule` interface: - ```go reference - https://github.com/cosmos/cosmos-sdk/blob/v0.47.0/x/group/module/module.go#L58-L64 - ``` + ```go reference + https://github.com/cosmos/cosmos-sdk/blob/v0.47.0/x/group/module/module.go#L58-L64 + ``` 3. Define a struct that inherits `depinject.In` and define the module inputs (i.e. module dependencies): * `depinject` provides the right dependencies to the module. * `depinject` also checks that all dependencies are provided. - :::tip - For making a dependency optional, add the `optional:"true"` struct tag. - ::: + :::tip + For making a dependency optional, add the `optional:"true"` struct tag. + ::: - ```go reference - https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/group/module/module.go#L206-L216 - ``` + ```go reference + https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/group/module/module.go#L201-L211 + ``` 4. Define the module outputs with a public struct that inherits `depinject.Out`: The module outputs are the dependencies that the module provides to other modules. It is usually the module itself and its keeper. - ```go reference - https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/group/module/module.go#L218-L223 - ``` + ```go reference + https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/group/module/module.go#L213-L218 + ``` 5. Create a function named `ProvideModule` (as called in 1.) and use the inputs for instantiating the module outputs. ```go reference - https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/group/module/module.go#L225-L235 + https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/group/module/module.go#L220-L235 ``` The `ProvideModule` function should return an instance of `cosmossdk.io/core/appmodule.AppModule` which implements @@ -116,7 +114,7 @@ one or more app module extension interfaces for initializing the module. Following is the complete app wiring configuration for `group`: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/group/module/module.go#L195-L235 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/group/module/module.go#L194-L235 ``` The module is now ready to be used with `depinject` by a chain developer. diff --git a/docs/docs/building-modules/16-testing.md b/docs/docs/build/building-modules/16-testing.md similarity index 78% rename from docs/docs/building-modules/16-testing.md rename to docs/docs/build/building-modules/16-testing.md index cd49fc454a30..4b1d005ebadf 100644 --- a/docs/docs/building-modules/16-testing.md +++ b/docs/docs/build/building-modules/16-testing.md @@ -19,37 +19,37 @@ All packages and modules should have unit test coverage. Modules should have the The SDK uses `mockgen` to generate mocks for keepers: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/scripts/mockgen.sh#L3-L6 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/scripts/mockgen.sh#L3-L6 ``` -You can read more about mockgen [here](https://github.com/golang/mock). +You can read more about mockgen [here](https://go.uber.org/mock). ### Example -As an example, we will walkthrough the [keeper tests](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/gov/keeper/keeper_test.go) of the `x/gov` module. +As an example, we will walkthrough the [keeper tests](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/gov/keeper/keeper_test.go) of the `x/gov` module. -The `x/gov` module has a `Keeper` type requires a few external dependencies (ie. imports outside `x/gov` to work properly). +The `x/gov` module has a `Keeper` type, which requires a few external dependencies (ie. imports outside `x/gov` to work properly). ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/gov/keeper/keeper.go#L61-L65 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/gov/keeper/keeper.go#L22-L24 ``` In order to only test `x/gov`, we mock the [expected keepers](https://docs.cosmos.network/v0.46/building-modules/keeper.html#type-definition) and instantiate the `Keeper` with the mocked dependencies. Note that we may need to configure the mocked dependencies to return the expected values: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/gov/keeper/common_test.go#L67-L81 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/gov/keeper/common_test.go#L67-L81 ``` This allows us to test the `x/gov` module without having to import other modules. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/gov/keeper/keeper_test.go#L3-L35 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/gov/keeper/keeper_test.go#L3-L42 ``` We can test then create unit tests using the newly created `Keeper` instance. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/gov/keeper/keeper_test.go#L73-L91 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/gov/keeper/keeper_test.go#L83-L107 ``` ## Integration Tests @@ -66,7 +66,7 @@ The SDK provides small helpers for quickly setting up an integration tests. Thes ### Example ```go reference -https://github.com/cosmos/cosmos-sdk/blob/29e22b3bdb05353555c8e0b269311bbff7b8deca/testutil/integration/example_test.go#L22-L89 +https://github.com/cosmos/cosmos-sdk/blob/a2f73a7dd37bea0ab303792c55fa1e4e1db3b898/testutil/integration/example_test.go#L30-L116 ``` ## Deterministic and Regression tests @@ -81,7 +81,7 @@ Each query is tested using 2 methods: Here's an example of regression tests: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/tests/integration/bank/keeper/deterministic_test.go#L102-L115 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/tests/integration/bank/keeper/deterministic_test.go#L134-L151 ``` ## Simulations @@ -89,17 +89,17 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/tests/integration/bank/kee Simulations uses as well a minimal application, built with [`depinject`](../packages/01-depinject.md): :::note -You can as well use the `AppConfig` `configurator` for creating an `AppConfig` [inline](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/slashing/app_test.go#L54-L62). There is no difference between those two ways, use whichever you prefer. +You can as well use the `AppConfig` `configurator` for creating an `AppConfig` [inline](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/slashing/app_test.go#L54-L62). There is no difference between those two ways, use whichever you prefer. ::: Following is an example for `x/gov/` simulations: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/gov/simulation/operations_test.go#L292-L310 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/gov/simulation/operations_test.go#L406-L430 ``` ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/gov/simulation/operations_test.go#L69-L111 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/gov/simulation/operations_test.go#L90-L132 ``` ## End-to-end Tests diff --git a/docs/docs/build/building-modules/17-preblock.md b/docs/docs/build/building-modules/17-preblock.md new file mode 100644 index 000000000000..a79646bd4e70 --- /dev/null +++ b/docs/docs/build/building-modules/17-preblock.md @@ -0,0 +1,31 @@ +--- +sidebar_position: 1 +--- + +# PreBlocker + +:::note Synopsis +`PreBlocker` is optional method module developers can implement in their module. They will be triggered before [`BeginBlock`](../../learn/advanced/00-baseapp.md#beginblock). +::: + +:::note Pre-requisite Readings + +* [Module Manager](./01-module-manager.md) + +::: + +## PreBlocker + +There are two semantics around the new lifecycle method: + +- It runs before the `BeginBlocker` of all modules +- It can modify consensus parameters in storage, and signal the caller through the return value. + +When it returns `ConsensusParamsChanged=true`, the caller must refresh the consensus parameter in the deliver context: +``` +app.finalizeBlockState.ctx = app.finalizeBlockState.ctx.WithConsensusParams(app.GetConsensusParams()) +``` + +The new ctx must be passed to all the other lifecycle methods. + + diff --git a/docs/docs/building-modules/_category_.json b/docs/docs/build/building-modules/_category_.json similarity index 73% rename from docs/docs/building-modules/_category_.json rename to docs/docs/build/building-modules/_category_.json index 8dc3f9a9411b..2d50f8b3ec57 100644 --- a/docs/docs/building-modules/_category_.json +++ b/docs/docs/build/building-modules/_category_.json @@ -1,5 +1,5 @@ { "label": "Building Modules", - "position": 3, + "position": 1, "link": null } \ No newline at end of file diff --git a/docs/docs/migrations/01-intro.md b/docs/docs/build/migrations/01-intro.md similarity index 100% rename from docs/docs/migrations/01-intro.md rename to docs/docs/build/migrations/01-intro.md diff --git a/docs/docs/build/migrations/_category_.json b/docs/docs/build/migrations/_category_.json new file mode 100644 index 000000000000..5a06c3ebba6c --- /dev/null +++ b/docs/docs/build/migrations/_category_.json @@ -0,0 +1,5 @@ +{ + "label": "Migrations", + "position": 3, + "link": null +} diff --git a/docs/docs/build/modules/_category_.json b/docs/docs/build/modules/_category_.json new file mode 100644 index 000000000000..72d229c0b058 --- /dev/null +++ b/docs/docs/build/modules/_category_.json @@ -0,0 +1,5 @@ +{ + "label": "Modules", + "position": 2, + "link": null +} diff --git a/docs/docs/packages/README.md b/docs/docs/build/packages/README.md similarity index 92% rename from docs/docs/packages/README.md rename to docs/docs/build/packages/README.md index ad5e6699cab5..65324dc59ca6 100644 --- a/docs/docs/packages/README.md +++ b/docs/docs/build/packages/README.md @@ -21,12 +21,11 @@ For more information on SDK tooling, see the [Tooling](https://docs.cosmos.netwo ## State Management * [Collections](./02-collections.md) - State management library -* [ORM](./03-orm.md) - State management library ## Automation * [Depinject](./01-depinject.md) - Dependency injection framework -* [Client/v2](https://pkg.go.dev/cosmossdk.io/client/v2) - Library powering [AutoCLI](https://docs.cosmos.network/main/building-modules/autocli) +* [Client/v2](https://pkg.go.dev/cosmossdk.io/client/v2) - Library powering [AutoCLI](https://docs.cosmos.network/main/core/autocli) ## Utilities diff --git a/docs/docs/packages/_category_.json b/docs/docs/build/packages/_category_.json similarity index 70% rename from docs/docs/packages/_category_.json rename to docs/docs/build/packages/_category_.json index e91118d38435..5ed885eb2836 100644 --- a/docs/docs/packages/_category_.json +++ b/docs/docs/build/packages/_category_.json @@ -1,5 +1,5 @@ { "label": "Packages", - "position": 9, + "position": 4, "link": null } \ No newline at end of file diff --git a/docs/docs/tooling/00-protobuf.md b/docs/docs/build/tooling/00-protobuf.md similarity index 86% rename from docs/docs/tooling/00-protobuf.md rename to docs/docs/build/tooling/00-protobuf.md index 53decb74d8b7..7f9e33159403 100644 --- a/docs/docs/tooling/00-protobuf.md +++ b/docs/docs/build/tooling/00-protobuf.md @@ -4,20 +4,20 @@ sidebar_position: 1 # Protocol Buffers -It is known that Cosmos SDK uses protocol buffers extensively, this docuemnt is meant to provide a guide on how it is used in the cosmos-sdk. +It is known that Cosmos SDK uses protocol buffers extensively, this document is meant to provide a guide on how it is used in the cosmos-sdk. To generate the proto file, the Cosmos SDK uses a docker image, this image is provided to all to use as well. The latest version is `ghcr.io/cosmos/proto-builder:0.12.x` Below is the example of the Cosmos SDK's commands for generating, linting, and formatting protobuf files that can be reused in any applications makefile. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/Makefile#L411-L432 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/Makefile#L411-L432 ``` The script used to generate the protobuf files can be found in the `scripts/` directory. ```shell reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/scripts/protocgen.sh#L1-L37 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/scripts/protocgen.sh ``` ## Buf @@ -90,7 +90,7 @@ Example of how to define `gen` files can be found [here](https://docs.buf.build/ #### `buf.lock` -This is a autogenerated file based off the dependencies required by the `.gen` files. There is no need to copy the current one. If you depend on cosmos-sdk proto definitions a new entry for the Cosmos SDK will need to be provided. The dependency you will need to use is `buf.build/cosmos/cosmos-sdk`. +This is an autogenerated file based off the dependencies required by the `.gen` files. There is no need to copy the current one. If you depend on cosmos-sdk proto definitions a new entry for the Cosmos SDK will need to be provided. The dependency you will need to use is `buf.build/cosmos/cosmos-sdk`. ```go reference https://github.com/cosmos/cosmos-sdk/blob/main/proto/buf.lock#L1-L16 @@ -98,7 +98,7 @@ https://github.com/cosmos/cosmos-sdk/blob/main/proto/buf.lock#L1-L16 #### `buf.yaml` -`buf.yaml` defines the [name of your package](https://github.com/cosmos/cosmos-sdk/blob/main/proto/buf.yaml#L3), which [breakage checker](https://docs.buf.build/tour/detect-breaking-changes) to use and how to [lint your protobuf files](https://docs.buf.build/tour/lint-your-api). +`buf.yaml` defines the [name of your package](https://github.com/cosmos/cosmos-sdk/blob/main/proto/buf.yaml#L3), which [breakage checker](https://docs.buf.build/tour/detect-breaking-changes) to use and how to [lint your protobuf files](https://buf.build/docs/tutorials/getting-started-with-buf-cli#lint-your-api). ```go reference https://github.com/cosmos/cosmos-sdk/blob/main/proto/buf.yaml#L1-L24 diff --git a/docs/docs/tooling/README.md b/docs/docs/build/tooling/README.md similarity index 100% rename from docs/docs/tooling/README.md rename to docs/docs/build/tooling/README.md diff --git a/docs/docs/tooling/_category_.json b/docs/docs/build/tooling/_category_.json similarity index 68% rename from docs/docs/tooling/_category_.json rename to docs/docs/build/tooling/_category_.json index a01a4fcc48f6..eb57cb8a5a5e 100644 --- a/docs/docs/tooling/_category_.json +++ b/docs/docs/build/tooling/_category_.json @@ -1,5 +1,5 @@ { "label": "Tooling", - "position": 10, + "position": 5, "link": null } \ No newline at end of file diff --git a/docs/docs/building-modules/01-module-manager.md b/docs/docs/building-modules/01-module-manager.md deleted file mode 100644 index 3778d3d608db..000000000000 --- a/docs/docs/building-modules/01-module-manager.md +++ /dev/null @@ -1,273 +0,0 @@ ---- -sidebar_position: 1 ---- - -# Module Manager - -:::note Synopsis -Cosmos SDK modules need to implement the [`AppModule` interfaces](#application-module-interfaces), in order to be managed by the application's [module manager](#module-manager). The module manager plays an important role in [`message` and `query` routing](../core/00-baseapp.md#routing), and allows application developers to set the order of execution of a variety of functions like [`BeginBlocker` and `EndBlocker`](../basics/00-app-anatomy.md#begingblocker-and-endblocker). -::: - -:::note - -### Pre-requisite Readings - -* [Introduction to Cosmos SDK Modules](./01-intro.md) - -::: - -## Application Module Interfaces - -Application module interfaces exist to facilitate the composition of modules together to form a functional Cosmos SDK application. -There are 4 main application module interfaces: - -* [`AppModuleBasic`](#appmodulebasic) for independent module functionalities. -* [`AppModule`](#appmodule) for inter-dependent module functionalities (except genesis-related functionalities). -* [`AppModuleGenesis`](#appmodulegenesis) for inter-dependent genesis-related module functionalities. -* `GenesisOnlyAppModule`: Defines an `AppModule` that only has import/export functionality - -The above interfaces are mostly embedding smaller interfaces (extension interfaces), that defines specific functionalities: - -* `HasName`: Allows the module to provide its own name for legacy purposes. -* [`HasGenesisBasics`](#hasgenesisbasics): The legacy interface for stateless genesis methods. -* [`HasGenesis`](#hasgenesis): The extension interface for stateful genesis methods. -* [`HasInvariants`](#hasinvariants): The extension interface for registering invariants. -* [`HasServices`](#hasservices): The extension interface for modules to register services. -* [`HasConsensusVersion`](#hasconsensusversion): The extension interface for declaring a module consensus version. -* [`BeginBlockAppModule`](#beginblockappmodule): The extension interface that contains information about the `AppModule` and `BeginBlock`. -* [`EndBlockAppModule`](#endblockappmodule): The extension interface that contains information about the `AppModule` and `EndBlock`. -* [`HasPrecommit`](#hasprecommit): The extension interface that contains information about the `AppModule` and `Precommit`. -* [`HasPrepareCheckState`](#haspreparecheckstate): The extension interface that contains information about the `AppModule` and `PrepareCheckState`. - -The `AppModuleBasic` interface exists to define independent methods of the module, i.e. those that do not depend on other modules in the application. This allows for the construction of the basic application structure early in the application definition, generally in the `init()` function of the [main application file](../basics/00-app-anatomy.md#core-application-file). - -The `AppModule` interface exists to define inter-dependent module methods. Many modules need to interact with other modules, typically through [`keeper`s](./06-keeper.md), which means there is a need for an interface where modules list their `keeper`s and other methods that require a reference to another module's object. `AppModule` interface extension, such as `BeginBlockAppModule` and `EndBlockAppModule`, also enables the module manager to set the order of execution between module's methods like `BeginBlock` and `EndBlock`, which is important in cases where the order of execution between modules matters in the context of the application. - -The usage of extension interfaces allows modules to define only the functionalities they need. For example, a module that does not need an `EndBlock` does not need to define the `EndBlockAppModule` interface and thus the `EndBlock` method. `AppModule` and `AppModuleGenesis` are voluntarily small interfaces, that can take advantage of the `Module` patterns without having to define many placeholder functions. - -### `AppModuleBasic` - -The `AppModuleBasic` interface defines the independent methods modules need to implement. - -```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/types/module/module.go#L49-L59 -``` - -Let us go through the methods: - -* `RegisterLegacyAminoCodec(*codec.LegacyAmino)`: Registers the `amino` codec for the module, which is used to marshal and unmarshal structs to/from `[]byte` in order to persist them in the module's `KVStore`. -* `RegisterInterfaces(codectypes.InterfaceRegistry)`: Registers a module's interface types and their concrete implementations as `proto.Message`. -* `RegisterGRPCGatewayRoutes(client.Context, *runtime.ServeMux)`: Registers gRPC routes for the module. -* `GetTxCmd()`: Returns the root [`Tx` command](./09-module-interfaces.md#tx) for the module. The subcommands of this root command are used by end-users to generate new transactions containing [`message`s](./02-messages-and-queries.md#queries) defined in the module. -* `GetQueryCmd()`: Return the root [`query` command](./09-module-interfaces.md#query) for the module. The subcommands of this root command are used by end-users to generate new queries to the subset of the state defined by the module. - -All the `AppModuleBasic` of an application are managed by the [`BasicManager`](#basicmanager). - -### `HasName` - -```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/types/module/module.go#L61-L66 -``` - -* `HasName` is an interface that has a method `Name()`. This method returns the name of the module as a `string`. - -### `HasGenesisBasics` - -```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/types/module/module.go#L68-L72 -``` - -Let us go through the methods: - -* `DefaultGenesis(codec.JSONCodec)`: Returns a default [`GenesisState`](./08-genesis.md#genesisstate) for the module, marshalled to `json.RawMessage`. The default `GenesisState` need to be defined by the module developer and is primarily used for testing. -* `ValidateGenesis(codec.JSONCodec, client.TxEncodingConfig, json.RawMessage)`: Used to validate the `GenesisState` defined by a module, given in its `json.RawMessage` form. It will usually unmarshall the `json` before running a custom [`ValidateGenesis`](./08-genesis.md#validategenesis) function defined by the module developer. - -### `AppModuleGenesis` - -The `AppModuleGenesis` interface is a simple embedding of the `AppModuleBasic` and `HasGenesis` interfaces. - -```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/types/module/module.go#L156-L160 -``` - -It does not have its own manager, and exists separately from [`AppModule`](#appmodule) only for modules that exist only to implement genesis functionalities, so that they can be managed without having to implement all of `AppModule`'s methods. - -### `HasGenesis` - -The `HasGenesis` interface is an extension interface of `HasGenesisBasics`. - -```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/types/module/module.go#L162-L167 -``` - -Let us go through the two added methods: - -* `InitGenesis(sdk.Context, codec.JSONCodec, json.RawMessage)`: Initializes the subset of the state managed by the module. It is called at genesis (i.e. when the chain is first started). -* `ExportGenesis(sdk.Context, codec.JSONCodec)`: Exports the latest subset of the state managed by the module to be used in a new genesis file. `ExportGenesis` is called for each module when a new chain is started from the state of an existing chain. - -### `AppModule` - -The `AppModule` interface defines a module. Modules can declare their functionalities by implementing extensions interfaces. - -```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/types/module/module.go#L169-L173 -``` - -`AppModule`s are managed by the [module manager](#manager), which checks which extension interfaces are implemented by the module. - -:::note -Previously the `AppModule` interface was containing all the methods that are defined in the extensions interfaces. This was leading to much boilerplate for modules that did not need all the functionalities. -::: - -### `HasInvariants` - -This interface defines one method. It allows to checks if a module can register invariants. - -```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/types/module/module.go#L175-L179 -``` - -* `RegisterInvariants(sdk.InvariantRegistry)`: Registers the [`invariants`](./07-invariants.md) of the module. If an invariant deviates from its predicted value, the [`InvariantRegistry`](./07-invariants.md#registry) triggers appropriate logic (most often the chain will be halted). - -### `HasServices` - -This interface defines one method. It allows to checks if a module can register invariants. - -```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/types/module/module.go#L181-L185 -``` - -* `RegisterServices(Configurator)`: Allows a module to register services. - -### `HasConsensusVersion` - -This interface defines one method for checking a module consensus version. - -```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/types/module/module.go#L187-L194 -``` - -* `ConsensusVersion() uint64`: Returns the consensus version of the module. - -### `BeginBlockAppModule` - -The `BeginBlockAppModule` is an extension interface from `AppModule`. All modules that have an `BeginBlock` method implement this interface. - -```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/types/module/module.go#L196-L200 -``` - -* `BeginBlock(sdk.Context, abci.RequestBeginBlock)`: This method gives module developers the option to implement logic that is automatically triggered at the beginning of each block. Implement empty if no logic needs to be triggered at the beginning of each block for this module. - -### `EndBlockAppModule` - -The `EndBlockAppModule` is an extension interface from `AppModule`. All modules that have an `EndBlock` method implement this interface. - -```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/types/module/module.go#L202-L206 -``` - -* `EndBlock(sdk.Context, abci.RequestEndBlock)`: This method gives module developers the option to implement logic that is automatically triggered at the end of each block. This is also where the module can inform the underlying consensus engine of validator set changes (e.g. the `staking` module). Implement empty if no logic needs to be triggered at the end of each block for this module. - -### `HasPrecommit` - -`HasPrecommit` is an extension interface from `AppModule`. All modules that have a `Precommit` method implement this interface. - -* `Precommit(sdk.Context)`: This method gives module developers the option to implement logic that is automatically triggered during [`Commit'](../core/00-baseapp.md#commit) of each block using the [`deliverState`](../core/00-baseapp.md#state-updates) of the block to be committed. Implement empty if no logic needs to be triggered during `Commit` of each block for this module. - -### `HasPrepareCheckState` - -`HasPrepareCheckState` is an extension interface from `AppModule`. All modules that have a `PrepareCheckState` method implement this interface. - -* `PrepareCheckState(sdk.Context)`: This method gives module developers the option to implement logic that is automatically triggered during [`Commit'](../core/00-baseapp.md#commit) of each block using the [`checkState`](../core/00-baseapp.md#state-updates) of the next block. Implement empty if no logic needs to be triggered during `Commit` of each block for this module. - -### Implementing the Application Module Interfaces - -Typically, the various application module interfaces are implemented in a file called `module.go`, located in the module's folder (e.g. `./x/module/module.go`). - -Almost every module needs to implement the `AppModuleBasic` and `AppModule` interfaces. If the module is only used for genesis, it will implement `AppModuleGenesis` instead of `AppModule`. The concrete type that implements the interface can add parameters that are required for the implementation of the various methods of the interface. For example, the `Route()` function often calls a `NewMsgServerImpl(k keeper)` function defined in `keeper/msg_server.go` and therefore needs to pass the module's [`keeper`](./06-keeper.md) as a parameter. - -```go -// example -type AppModule struct { - AppModuleBasic - keeper Keeper -} -``` - -In the example above, you can see that the `AppModule` concrete type references an `AppModuleBasic`, and not an `AppModuleGenesis`. That is because `AppModuleGenesis` only needs to be implemented in modules that focus on genesis-related functionalities. In most modules, the concrete `AppModule` type will have a reference to an `AppModuleBasic` and implement the two added methods of `AppModuleGenesis` directly in the `AppModule` type. - -If no parameter is required (which is often the case for `AppModuleBasic`), just declare an empty concrete type like so: - -```go -type AppModuleBasic struct{} -``` - -## Module Managers - -Module managers are used to manage collections of `AppModuleBasic` and `AppModule`. - -### `BasicManager` - -The `BasicManager` is a structure that lists all the `AppModuleBasic` of an application: - -```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/types/module/module.go#L74-L84 -``` - -It implements the following methods: - -* `NewBasicManager(modules ...AppModuleBasic)`: Constructor function. It takes a list of the application's `AppModuleBasic` and builds a new `BasicManager`. This function is generally called in the `init()` function of [`app.go`](../basics/00-app-anatomy.md#core-application-file) to quickly initialize the independent elements of the application's modules (click [here](https://github.com/cosmos/gaia/blob/main/app/app.go#L59-L74) to see an example). -* `RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)`: Registers the [`codec.LegacyAmino`s](../core/05-encoding.md#amino) of each of the application's `AppModuleBasic`. This function is usually called early on in the [application's construction](../basics/00-app-anatomy.md#constructor). -* `RegisterInterfaces(registry codectypes.InterfaceRegistry)`: Registers interface types and implementations of each of the application's `AppModuleBasic`. -* `DefaultGenesis(cdc codec.JSONCodec)`: Provides default genesis information for modules in the application by calling the [`DefaultGenesis(cdc codec.JSONCodec)`](./08-genesis.md#defaultgenesis) function of each module. It only calls the modules that implements the `HasGenesisBasics` interfaces. -* `ValidateGenesis(cdc codec.JSONCodec, txEncCfg client.TxEncodingConfig, genesis map[string]json.RawMessage)`: Validates the genesis information modules by calling the [`ValidateGenesis(codec.JSONCodec, client.TxEncodingConfig, json.RawMessage)`](./08-genesis.md#validategenesis) function of modules implementing the `HasGenesisBasics` interface. -* `RegisterGRPCGatewayRoutes(clientCtx client.Context, rtr *runtime.ServeMux)`: Registers gRPC routes for modules. -* `AddTxCommands(rootTxCmd *cobra.Command)`: Adds modules' transaction commands to the application's [`rootTxCommand`](../core/07-cli.md#transaction-commands). This function is usually called function from the `main.go` function of the [application's command-line interface](../core/07-cli.md). -* `AddQueryCommands(rootQueryCmd *cobra.Command)`: Adds modules' query commands to the application's [`rootQueryCommand`](../core/07-cli.md#query-commands). This function is usually called function from the `main.go` function of the [application's command-line interface](../core/07-cli.md). - -### `Manager` - -The `Manager` is a structure that holds all the `AppModule` of an application, and defines the order of execution between several key components of these modules: - -```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/types/module/module.go#L246-L273 -``` - -The module manager is used throughout the application whenever an action on a collection of modules is required. It implements the following methods: - -* `NewManager(modules ...AppModule)`: Constructor function. It takes a list of the application's `AppModule`s and builds a new `Manager`. It is generally called from the application's main [constructor function](../basics/00-app-anatomy.md#constructor-function). -* `SetOrderInitGenesis(moduleNames ...string)`: Sets the order in which the [`InitGenesis`](./08-genesis.md#initgenesis) function of each module will be called when the application is first started. This function is generally called from the application's main [constructor function](../basics/00-app-anatomy.md#constructor-function). - To initialize modules successfully, module dependencies should be considered. For example, the `genutil` module must occur after `staking` module so that the pools are properly initialized with tokens from genesis accounts, the `genutils` module must also occur after `auth` so that it can access the params from auth, IBC's `capability` module should be initialized before all other modules so that it can initialize any capabilities. -* `SetOrderExportGenesis(moduleNames ...string)`: Sets the order in which the [`ExportGenesis`](./08-genesis.md#exportgenesis) function of each module will be called in case of an export. This function is generally called from the application's main [constructor function](../basics/00-app-anatomy.md#constructor-function). -* `SetOrderBeginBlockers(moduleNames ...string)`: Sets the order in which the `BeginBlock()` function of each module will be called at the beginning of each block. This function is generally called from the application's main [constructor function](../basics/00-app-anatomy.md#constructor-function). -* `SetOrderEndBlockers(moduleNames ...string)`: Sets the order in which the `EndBlock()` function of each module will be called at the end of each block. This function is generally called from the application's main [constructor function](../basics/00-app-anatomy.md#constructor-function). -* `SetOrderPrecommiters(moduleNames ...string)`: Sets the order in which the `Precommit()` function of each module will be called during commit of each block. This function is generally called from the application's main [constructor function](../basics/00-app-anatomy.md#constructor-function). -* `SetOrderPrepareCheckStaters(moduleNames ...string)`: Sets the order in which the `PrepareCheckState()` function of each module will be called during commit of each block. This function is generally called from the application's main [constructor function](../basics/00-app-anatomy.md#constructor-function). -* `SetOrderMigrations(moduleNames ...string)`: Sets the order of migrations to be run. If not set then migrations will be run with an order defined in `DefaultMigrationsOrder`. -* `RegisterInvariants(ir sdk.InvariantRegistry)`: Registers the [invariants](./07-invariants.md) of module implementing the `HasInvariants` interface. -* `RegisterRoutes(router sdk.Router, queryRouter sdk.QueryRouter, legacyQuerierCdc *codec.LegacyAmino)`: Registers legacy [`Msg`](./02-messages-and-queries.md#messages) and [`querier`](./04-query-services.md#legacy-queriers) routes. -* `RegisterServices(cfg Configurator)`: Registers the services of modules implementing the `HasServices` interface. -* `InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, genesisData map[string]json.RawMessage)`: Calls the [`InitGenesis`](./08-genesis.md#initgenesis) function of each module when the application is first started, in the order defined in `OrderInitGenesis`. Returns an `abci.ResponseInitChain` to the underlying consensus engine, which can contain validator updates. -* `ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec)`: Calls the [`ExportGenesis`](./08-genesis.md#exportgenesis) function of each module, in the order defined in `OrderExportGenesis`. The export constructs a genesis file from a previously existing state, and is mainly used when a hard-fork upgrade of the chain is required. -* `ExportGenesisForModules(ctx sdk.Context, cdc codec.JSONCodec, modulesToExport []string)`: Behaves the same as `ExportGenesis`, except takes a list of modules to export. -* `BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock)`: At the beginning of each block, this function is called from [`BaseApp`](../core/00-baseapp.md#beginblock) and, in turn, calls the [`BeginBlock`](./05-beginblock-endblock.md) function of each modules implementing the `BeginBlockAppModule` interface, in the order defined in `OrderBeginBlockers`. It creates a child [context](../core/02-context.md) with an event manager to aggregate [events](../core/08-events.md) emitted from all modules. The function returns an `abci.ResponseBeginBlock` which contains the aforementioned events. -* `EndBlock(ctx sdk.Context, req abci.RequestEndBlock)`: At the end of each block, this function is called from [`BaseApp`](../core/00-baseapp.md#endblock) and, in turn, calls the [`EndBlock`](./05-beginblock-endblock.md) function of each modules implementing the `EndBlockAppModule` interface, in the order defined in `OrderEndBlockers`. It creates a child [context](../core/02-context.md) with an event manager to aggregate [events](../core/08-events.md) emitted from all modules. The function returns an `abci.ResponseEndBlock` which contains the aforementioned events, as well as validator set updates (if any). -* `Precommit(ctx sdk.Context)`: During [`Commit`](../core/00-baseapp.md#commit), this function is called from `BaseApp` immediately before the [`deliverState`](../core/00-baseapp.md#state-updates) is written to the underlying [`rootMultiStore`](../core/04-store.md#commitmultistore) and, in turn calls the `Precommit` function of each modules implementing the `HasPrecommit` interface, in the order defined in `OrderPrecommiters`. It creates a child [context](../core/02-context.md) where the underlying `CacheMultiStore` is that of the newly committed block's [`deliverState`](../core/00-baseapp.md#state-updates). -* `PrepareCheckState(ctx sdk.Context)`: During [`Commit`](../core/00-baseapp.md#commit), this function is called from `BaseApp` immediately after the [`deliverState`](../core/00-baseapp.md#state-updates) is written to the underlying [`rootMultiStore`](../core/04-store.md#commitmultistore) and, in turn calls the `PrepareCheckState` function of each module implementing the `HasPrepareCheckState` interface, in the order defined in `OrderPrepareCheckStaters`. It creates a child [context](../core/02-context.md) where the underlying `CacheMultiStore` is that of the next block's [`checkState`](../core/00-baseapp.md#state-updates). Writes to this state will be present in the [`checkState`](../core/00-baseapp.md#state-updates) of the next block, and therefore this method can be used to prepare the `checkState` for the next block. - -Here's an example of a concrete integration within an `simapp`: - -```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/app.go#L386-L432 -``` - -This is the same example from `runtime` (the package that powers app v2): - -```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/runtime/module.go#L77 -``` - -```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/runtime/module.go#L87 -``` diff --git a/docs/docs/building-modules/05-beginblock-endblock.md b/docs/docs/building-modules/05-beginblock-endblock.md deleted file mode 100644 index 3e5667ed7d97..000000000000 --- a/docs/docs/building-modules/05-beginblock-endblock.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -sidebar_position: 1 ---- - -# BeginBlocker and EndBlocker - -:::note Synopsis -`BeginBlocker` and `EndBlocker` are optional methods module developers can implement in their module. They will be triggered at the beginning and at the end of each block respectively, when the [`BeginBlock`](../core/00-baseapp.md#beginblock) and [`EndBlock`](../core/00-baseapp.md#endblock) ABCI messages are received from the underlying consensus engine. -::: - -:::note - -### Pre-requisite Readings - -* [Module Manager](./01-module-manager.md) - -::: - -## BeginBlocker and EndBlocker - -`BeginBlocker` and `EndBlocker` are a way for module developers to add automatic execution of logic to their module. This is a powerful tool that should be used carefully, as complex automatic functions can slow down or even halt the chain. - -When needed, `BeginBlocker` and `EndBlocker` are implemented as part of the [`BeginBlockAppModule` and `BeginBlockAppModule` interfaces](./01-module-manager.md#appmodule). This means either can be left-out if not required. The `BeginBlock` and `EndBlock` methods of the interface implemented in `module.go` generally defer to `BeginBlocker` and `EndBlocker` methods respectively, which are usually implemented in `abci.go`. - -The actual implementation of `BeginBlocker` and `EndBlocker` in `abci.go` are very similar to that of a [`Msg` service](./03-msg-services.md): - -* They generally use the [`keeper`](./06-keeper.md) and [`ctx`](../core/02-context.md) to retrieve information about the latest state. -* If needed, they use the `keeper` and `ctx` to trigger state-transitions. -* If needed, they can emit [`events`](../core/08-events.md) via the `ctx`'s `EventManager`. - -A specificity of the `EndBlocker` is that it can return validator updates to the underlying consensus engine in the form of an [`[]abci.ValidatorUpdates`](https://docs.cometbft.com/v0.37/spec/abci/abci++_methods#endblock). This is the preferred way to implement custom validator changes. - -It is possible for developers to define the order of execution between the `BeginBlocker`/`EndBlocker` functions of each of their application's modules via the module's manager `SetOrderBeginBlocker`/`SetOrderEndBlocker` methods. For more on the module manager, click [here](./01-module-manager.md#manager). - -See an example implementation of `BeginBlocker` from the `distribution` module: - -```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/distribution/abci.go#L14-L38 -``` - -and an example implementation of `EndBlocker` from the `staking` module: - -```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/staking/abci.go#L22-L27 -``` - - diff --git a/docs/docs/building-modules/10-autocli.md b/docs/docs/building-modules/10-autocli.md deleted file mode 100644 index 10a9bde61701..000000000000 --- a/docs/docs/building-modules/10-autocli.md +++ /dev/null @@ -1,157 +0,0 @@ ---- -sidebar_position: 1 ---- - - -# AutoCLI - -:::note Synopsis -This document details how to build CLI and REST interfaces for a module. Examples from various Cosmos SDK modules are included. -::: - -:::note - -## Pre-requisite Readings - -* [Building Modules Intro](./01-intro.md) - -::: - -The `autocli` package is a [Go library](https://pkg.go.dev/cosmossdk.io/client/v2/autocli) for generating CLI (command line interface) interfaces for Cosmos SDK-based applications. It provides a simple way to add CLI commands to your application by generating them automatically based on your gRPC service definitions. Autocli generates CLI commands and flags directly from your protobuf messages, including options, input parameters, and output parameters. This means that you can easily add a CLI interface to your application without having to manually create and manage commands. - -## Getting Started - -Here are the steps to use the `autocli` package: - -1. Define your app's modules that implement the `appmodule.AppModule` interface. -2. Configure how behave `autocli` command generation, by implementing the `func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions` method on the module. Learn more [here](#advanced-usage). -3. Use the `autocli.AppOptions` struct to specifies the modules you defined. If you are using the `depinject` package to manage your app's dependencies, it can automatically create an instance of `autocli.AppOptions` based on your app's configuration. -4. Use the `EnhanceRootCommand()` method provided by `autocli` to add the CLI commands for the specified modules to your root command and can also be found in the `client/v2/autocli/app.go` file. Additionally, this method adds the `autocli` functionality to your app's root command. This method is additive only, meaning that it does not create commands if they are already registered for a module. Instead, it adds any missing commands to the root command. - -Here's an example of how to use `autocli`: - -``` go -// Define your app's modules -testModules := map[string]appmodule.AppModule{ - "testModule": &TestModule{}, -} - -// Define the autocli AppOptions -autoCliOpts := autocli.AppOptions{ - Modules: testModules, -} - -// Get the root command -rootCmd := &cobra.Command{ - Use: "app", -} - -// Enhance the root command with autocli -autocli.EnhanceRootCommand(rootCmd, autoCliOpts) - -// Run the root command -if err := rootCmd.Execute(); err != nil { - fmt.Println(err) -} -``` - -## Flags - -`autocli` generates flags for each field in a protobuf message. By default, the names of the flags are generated based on the names of the fields in the message. You can customise the flag names using the `namingOptions` parameter of the `Builder.AddMessageFlags()` method. - -To define flags for a message, you can use the `Builder.AddMessageFlags()` method. This method takes the `cobra.Command` instance and the message type as input, and generates flags for each field in the message. - -```go reference -https://github.com/cosmos/cosmos-sdk/blob/1ac260cb1c6f05666f47e67f8b2cfd6229a55c3b/client/v2/autocli/common.go#L44-L49 -``` - -The `binder` variable returned by the `AddMessageFlags()` method is used to bind the command-line arguments to the fields in the message. - -You can also customise the behavior of the flags using the `namingOptions` parameter of the `Builder.AddMessageFlags()` method. This parameter allows you to specify a custom prefix for the flags, and to specify whether to generate flags for repeated fields and whether to generate flags for fields with default values. - -## Commands and Queries - -The `autocli` package generates CLI commands and flags for each method defined in your gRPC service. By default, it generates commands for each RPC method that does not return a stream of messages. The commands are named based on the name of the service method. - -For example, given the following protobuf definition for a service: - -```protobuf -service MyService { - rpc MyMethod(MyRequest) returns (MyResponse) {} -} -``` - -`autocli` will generate a command named `my-method` for the `MyMethod` method. The command will have flags for each field in the `MyRequest` message. - -If you want to customise the behavior of a command, you can define a custom command by implementing the `autocli.Command` interface. You can then register the command with the `autocli.Builder` instance for your application. - -Similarly, you can define a custom query by implementing the `autocli.Query` interface. You can then register the query with the `autocli.Builder` instance for your application. - -To add a custom command or query, you can use the `Builder.AddCustomCommand` or `Builder.AddCustomQuery` methods, respectively. These methods take a `cobra.Command` or `cobra.Command` instance, respectively, which can be used to define the behavior of the command or query. - -## Advanced Usage - -### Specifying Subcommands - -By default, `autocli` generates a command for each method in your gRPC service. However, you can specify subcommands to group related commands together. To specify subcommands, you can use the `autocliv1.ServiceCommandDescriptor` struct. - -This example shows how to use the `autocliv1.ServiceCommandDescriptor` struct to group related commands together and specify subcommands in your gRPC service by defining an instance of `autocliv1.ModuleOptions` in your `autocli.go` file. - -```go reference -https://github.com/cosmos/cosmos-sdk/blob/bcdf81cbaf8d70c4e4fa763f51292d54aed689fd/x/gov/autocli.go#L9-L27 -``` - -The `AutoCLIOptions()` method in the autocli package allows you to specify the services and sub-commands to be mapped for your app. In the example code, an instance of the `autocliv1.ModuleOptions` struct is defined in the `appmodule.AppModule` implementation located in the `x/gov/autocli.go` file. This configuration groups related commands together and specifies subcommands for each service. - -### Positional Arguments - -Positional arguments are arguments that are passed to a command without being specified as a flag. They are typically used for providing additional context to a command, such as a filename or search query. - -To add positional arguments to a command, you can use the `autocliv1.PositionalArgDescriptor` struct, as seen in the example below. You need to specify the `ProtoField` parameter, which is the name of the protobuf field that should be used as the positional argument. In addition, if the parameter is a variable-length argument, you can specify the `Varargs` parameter as `true`. This can only be applied to the last positional parameter, and the `ProtoField` must be a repeated field. - -Here's an example of how to define a positional argument for the `Account` method of the `auth` service: - -```go reference -https://github.com/cosmos/cosmos-sdk/blob/bcdf81cbaf8d70c4e4fa763f51292d54aed689fd/x/auth/autocli.go#L8-L32 -``` - -Here are some example commands that use the positional arguments we defined above: - -To query an account by address: - -```bash - query auth account cosmos1abcd...xyz -``` - -To query an account address by account number: - -```bash - query auth address-by-acc-num 1 -``` - -In both of these commands, the `auth` service is being queried with the `query` subcommand, followed by the specific method being called (`account` or `address-by-acc-num`). The positional argument is included at the end of the command (`cosmos1abcd...xyz` or `1`) to specify the address or account number, respectively. - -### Customising Flag Names - -By default, `autocli` generates flag names based on the names of the fields in your protobuf message. However, you can customise the flag names by providing a `FlagOptions` parameter to the `Builder.AddMessageFlags()` method. This parameter allows you to specify custom names for flags based on the names of the message fields. For example, if you have a message with the fields `test` and `test1`, you can use the following naming options to customise the flags - -``` go -options := autocliv1.RpcCommandOptions{ - FlagOptions: map[string]*autocliv1.FlagOptions{ - "test": { Name: "custom_name", }, - "test1": { Name: "other_name", }, - }, -} - -builder.AddMessageFlags(message, options) -``` - -Note that `autocliv1.RpcCommandOptions` is a field of the `autocliv1.ServiceCommandDescriptor` struct, which is defined in the `autocliv1` package. To use this option, you can define an instance of `autocliv1.ModuleOptions` in your `appmodule.AppModule` implementation and specify the `FlagOptions` for the relevant service command descriptor. - -## Conclusion - -`autocli` is a powerful tool for adding CLI interfaces to your Cosmos SDK-based applications. It allows you to easily generate CLI commands and flags from your protobuf messages, and provides many options for customising the behavior of your CLI application. - -To further enhance your CLI experience with Cosmos SDK-based blockchains, you can use `Hubl`. `Hubl` is a tool that allows you to query any Cosmos SDK-based blockchain using the new AutoCLI feature of the Cosmos SDK. With hubl, you can easily configure a new chain and query modules with just a few simple commands. - -For more information on `Hubl`, including how to configure a new chain and query a module, see the [Hubl documentation](https://docs.cosmos.network/main/tooling/hubl). diff --git a/docs/docs/core/14-tips.md b/docs/docs/core/14-tips.md deleted file mode 100644 index 7a3261233f2c..000000000000 --- a/docs/docs/core/14-tips.md +++ /dev/null @@ -1,214 +0,0 @@ ---- -sidebar_position: 1 ---- - -# Transaction Tips - -:::note Synopsis -Transaction tips are a mechanism to pay for transaction fees using another denom than the native fee denom of the chain. They are still in beta, and are not included by default in the SDK. -::: - -## Context - -In a Cosmos ecosystem where more and more chains are connected via [IBC](https://ibc.cosmos.network/), it happens that users want to perform actions on chains where they don't have native tokens yet. An example would be an Osmosis user who wants to vote on a proposal on the Cosmos Hub, but they don't have ATOMs in their wallet. A solution would be to swap OSMO for ATOM just for voting on this proposal, but that is cumbersome. Cross-chain DeFi project [Emeris](https://emeris.com/) is another use case. - -Transaction tips is a new solution for cross-chain transaction fees payment, whereby the transaction initiator signs a transaction without specifying fees, but uses a new `Tip` field. They send this signed transaction to a fee relayer who will choose the transaction fees and broadcast the final transaction, and the SDK provides a mechanism that will transfer the pre-defined `Tip` to the fee payer, to cover for fees. - -Assuming we have two chains, A and B, we define the following terms: - -* **the tipper**: this is the initiator of the transaction, who wants to execute a `Msg` on chain A, but doesn't have any native chain A tokens, only chain B tokens. In our example above, the tipper is the Osmosis (chain B) user wanting to vote on a Cosmos Hub (chain A) proposal. -* **the fee payer**: this is the party that will relay and broadcast the final transaction on chain A, and has chain A tokens. The tipper doesn't need to trust the feepayer. -* **the target chain**: the chain where the `Msg` is executed, chain A in this case. - -## Transaction Tips Flow - -The transaction tips flow happens in multiple steps. - -1. The tipper sends via IBC some chain B tokens to chain A. These tokens will cover for fees on the target chain A. This means that chain A's bank module holds some IBC tokens under the tipper's address. - -2. The tipper drafts a transaction to be executed on the chain A. It can include chain A `Msg`s. However, instead of creating a normal transaction, they create the following `AuxSignerData` document: - - ```protobuf reference - https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/tx/v1beta1/tx.proto#L237-L256 - ``` - - where we have defined `SignDocDirectAux` as: - - ```protobuf reference - https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/tx/v1beta1/tx.proto#L67-L97 - ``` - - where `Tip` is defined as - - ```protobuf reference - https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/tx/v1beta1/tx.proto#L226-L235 - ``` - - Notice that this document doesn't sign over the final chain A fees. Instead, it includes a `Tip` field. It also doesn't include the whole `AuthInfo` object as in `SIGN_MODE_DIRECT`, only the minimum information needed by the tipper - -3. The tipper signs the `SignDocDirectAux` document and attaches the signature to the `AuxSignerData`, then sends the signed `AuxSignerData` to the fee payer. - -4. From the signed `AuxSignerData` document, the fee payer constructs a transaction, using the following algorithm: - -* use as `TxBody` the exact `AuxSignerData.SignDocDirectAux.body_bytes`, to not alter the original intent of the tipper, -* create an `AuthInfo` with: - * `AuthInfo.Tip` copied from `AuxSignerData.SignDocDirectAux.Tip`, - * `AuthInfo.Fee` chosen by the fee payer, which should cover for the transaction gas, but also be small enough so that the tip/fee exchange rate is economically interesting for the fee payer, - * `AuthInfo.SignerInfos` has two signers: the first signer is the tipper, using the public key, sequence and sign mode specified in `AuxSignerData`; and the second signer is the fee payer, using their favorite sign mode, -* a `Signatures` array with two items: the tipper's signature from `AuxSignerData.Sig`, and the final fee payer's signature. - -5. Broadcast the final transaction signed by the two parties to the target chain. Once included, the Cosmos SDK will trigger a transfer of the `Tip` specified in the transaction from the tipper address to the fee payer address. - -### Fee Payers Market - -The benefit of transaction tips for the tipper is clear: there is no need to swap tokens before executing a cross-chain message. - -For the fee payer, the benefit is in the tip v.s. fee exchange. Put simply, the fee payer pays the fees of an unknown tipper's transaction, and gets in exchange the tip that the tipper chose. There is an economic incentive for the fee payer to do so only when the tip is greater than the transaction fees, given the exchange rates between the two tokens. - -In the future, we imagine a market where fee payers will compete to include transactions from tippers, who on their side will optimize by specifying the lowest tip possible. A number of automated services might spin up to perform transaction gas simulation and exchange rate monitoring to optimize both the tip and fee values in real-time. - -### Tipper and Fee Payer Sign Modes - -As we mentioned in the flow above, the tipper signs over the `SignDocDirectAux`, and the fee payer signs over the whole final transaction. As such, both parties might use different sign modes. - -* The tipper MUST use `SIGN_MODE_DIRECT_AUX` or `SIGN_MODE_LEGACY_AMINO_JSON`. That is because the tipper needs to sign over the body, the tip, but not the other signers' information and not over the fee (which is unknown to the tipper). -* The fee payer MUST use `SIGN_MODE_DIRECT` or `SIGN_MODE_LEGACY_AMINO_JSON`. The fee payer signs over the whole transaction. - -For example, if the fee payer signs the whole transaction with `SIGN_MODE_DIRECT_AUX`, it will be rejected by the node, as that would introduce malleability issues (`SIGN_MODE_DIRECT_AUX` doesn't sign over fees). - -In both cases, using `SIGN_MODE_LEGACY_AMINO_JSON` is recommended only if hardware wallet signing is needed. - -## Enabling Tips on your Chain - -The transaction tips functionality is introduced in Cosmos SDK v0.46, so earlier versions do not have support for tips. It is however not included by default in a v0.46 app. Sending a transaction with tips to a chain which didn't enable tips will result in a no-op, i.e. the `tip` field in the transaction will be ignored. - -Enabling tips on a chain is done by adding the `TipDecorator` in the posthandler chain: - -```go -// HandlerOptions are the options required for constructing a SDK PostHandler which supports tips. -type HandlerOptions struct { - BankKeeper types.BankKeeper -} - -// MyPostHandler returns a posthandler chain with the TipDecorator. -func MyPostHandler(options HandlerOptions) (sdk.AnteHandler, error) { - if options.BankKeeper == nil { - return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "bank keeper is required for posthandler") - } - - postDecorators := []sdk.AnteDecorator{ - posthandler.NewTipDecorator(options.bankKeeper), - } - - return sdk.ChainAnteDecorators(postDecorators...), nil -} - -func (app *SimApp) setPostHandler() { - postHandler, err := MyPostHandler( - HandlerOptions{ - BankKeeper: app.BankKeeper, - }, - ) - if err != nil { - panic(err) - } - - app.SetPostHandler(postHandler) -} -``` - -Notice that `NewTipDecorator` needs a reference to the BankKeeper, for transferring the tip to the fee payer. - -## CLI Usage - -The Cosmos SDK also provides some CLI tooling for the transaction tips flow, both for the tipper and for the feepayer. - -For the tipper, the CLI `tx` subcommand has two new flags: `--aux` and `--tip`. The `--aux` flag is used to denote that we are creating an `AuxSignerData` instead of a `Tx`, and the `--tip` is used to populate its `Tip` field. - -```bash -$ simd tx gov vote 16 yes --from --aux --tip 50ibcdenom - - -### Prints the AuxSignerData as JSON: -### {"address":"cosmos1q0ayf5vq6fd2xxrwh30upg05hxdnyw2h5249a2","sign_doc":{"body_bytes":"CosBChwvY29zbW9zLmJhbmsudjFiZXRhMS5Nc2dTZW5kEmsKLWNvc21vczFxMGF5ZjV2cTZmZDJ4eHJ3aDMwdXBnMDVoeGRueXcyaDUyNDlhMhItY29zbW9zMXdlNWoyZXI2MHV5OXF3YzBta3ptdGdtdHA5Z3F5NXY2bjhnZGdlGgsKBXN0YWtlEgIxMA==","public_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AojOF/1luQ5H/nZDSrE1w3CyzGJhJdQuS7hFX5wAA6uJ"},"chain_id":"","account_number":"0","sequence":"1","tip":{"amount":[{"denom":"ibcdenom","amount":"50"}],"tipper":"cosmos1q0ayf5vq6fd2xxrwh30upg05hxdnyw2h5249a2"}},"mode":"SIGN_MODE_DIRECT_AUX","sig":"v/d/bGq9FGdecs6faMG2t//nRirFTiqwFtUB65M6kh0QdUeM6jg3r8oJX1o17xkoDxJ09EyJiSyvo6fbU7vUxg=="} -``` - -It is useful to pipe the JSON output to a file, `> aux_signed_tx.json` - -For the fee payer, the Cosmos SDK added a `tx aux-to-fee` subcommand to include an `AuxSignerData` into a transaction, add fees to it, and broadcast it. - -```bash -$ simd tx aux-to-fee aux_signed_tx.json --from --fees 30atom - -### Prints the broadcasted tx response: -### code: 0 -### codespace: sdk -### data: "" -### events: [] -### gas_used: "0" -### gas_wanted: "0" -### height: "0" -### info: "" -### logs: [] -### timestamp: "" -### tx: null -``` - -Upon completion of the second command, the fee payer's balance will be down the `30atom` fees, and up the `50ibcdenom` tip. - -For both commands, the flag `--sign-mode=amino-json` is still available for hardware wallet signing. - -## Programmatic Usage - -For the tipper, the SDK exposes a new transaction builder, the `AuxTxBuilder`, for generating an `AuxSignerData`. The API of `AuxTxBuilder` is defined [in `client/tx`](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/client/tx/aux_builder.go#L16), and can be used as follows: - -```go -// Note: there's no need to use clientCtx.TxConfig anymore. - -bldr := clienttx.NewAuxTxBuilder() -err := bldr.SetMsgs(msgs...) -bldr.SetAddress("cosmos1...") -bldr.SetMemo(...) -bldr.SetTip(...) -bldr.SetPubKey(...) -err := bldr.SetSignMode(...) // DIRECT_AUX or AMINO, or else error -// ... other setters are also available - -// Get the bytes to sign. -signBz, err := bldr.GetSignBytes() - -// Sign the bz using your favorite method. -sig, err := privKey.sign(signBz) - -// Set the signature -bldr.SetSig(sig) - -// Get the final auxSignerData to be sent to the fee payer -auxSignerData, err:= bldr.GetAuxSignerData() -``` - -For the fee payer, the SDK added a new method on the existing `TxBuilder` to import data from an `AuxSignerData`: - -```go -// get `auxSignerData` from tipper, see code snippet above. - -txBuilder := clientCtx.TxConfig.NewTxBuilder() -err := txBuilder.AddAuxSignerData(auxSignerData) -if err != nil { - return err -} - -// A lot of fields will be populated in txBuilder, such as its Msgs, tip -// memo, etc... - -// The fee payer choses the fee to set on the transaction. -txBuilder.SetFeePayer() -txBuilder.SetFeeAmount(...) -txBuilder.SetGasLimit(...) - -// Usual signing code -err = authclient.SignTx(...) -if err != nil { - return err -} -``` diff --git a/docs/docs/intro/00-overview.md b/docs/docs/intro/00-overview.md deleted file mode 100644 index 31301657727a..000000000000 --- a/docs/docs/intro/00-overview.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -sidebar_position: 1 ---- - -# High-level Overview - -## What is the Cosmos SDK - -The [Cosmos SDK](https://github.com/cosmos/cosmos-sdk) is an open-source framework for building multi-asset public Proof-of-Stake (PoS) blockchains, like the Cosmos Hub, as well as permissioned Proof-of-Authority (PoA) blockchains. Blockchains built with the Cosmos SDK are generally referred to as **application-specific blockchains**. - -The goal of the Cosmos SDK is to allow developers to easily create custom blockchains from scratch that can natively interoperate with other blockchains. We envision the Cosmos SDK as the npm-like framework to build secure blockchain applications on top of [CometBFT](https://github.com/cometbft/cometbft). SDK-based blockchains are built out of composable [modules](../building-modules/01-intro.md), most of which are open-source and readily available for any developers to use. Anyone can create a module for the Cosmos SDK, and integrating already-built modules is as simple as importing them into your blockchain application. What's more, the Cosmos SDK is a capabilities-based system that allows developers to better reason about the security of interactions between modules. For a deeper look at capabilities, jump to [Object-Capability Model](../core/10-ocap.md). - -## What are Application-Specific Blockchains - -One development paradigm in the blockchain world today is that of virtual-machine blockchains like Ethereum, where development generally revolves around building decentralized applications on top of an existing blockchain as a set of smart contracts. While smart contracts can be very good for some use cases like single-use applications (e.g. ICOs), they often fall short for building complex decentralized platforms. More generally, smart contracts can be limiting in terms of flexibility, sovereignty and performance. - -Application-specific blockchains offer a radically different development paradigm than virtual-machine blockchains. An application-specific blockchain is a blockchain customized to operate a single application: developers have all the freedom to make the design decisions required for the application to run optimally. They can also provide better sovereignty, security and performance. - -Learn more about [application-specific blockchains](./01-why-app-specific.md). - -## Why the Cosmos SDK - -The Cosmos SDK is the most advanced framework for building custom application-specific blockchains today. Here are a few reasons why you might want to consider building your decentralized application with the Cosmos SDK: - -* The default consensus engine available within the Cosmos SDK is [CometBFT](https://github.com/cometbft/cometbft). CometBFT is the most (and only) mature BFT consensus engine in existence. It is widely used across the industry and is considered the gold standard consensus engine for building Proof-of-Stake systems. -* The Cosmos SDK is open-source and designed to make it easy to build blockchains out of composable [modules](../modules). As the ecosystem of open-source Cosmos SDK modules grows, it will become increasingly easier to build complex decentralized platforms with it. -* The Cosmos SDK is inspired by capabilities-based security, and informed by years of wrestling with blockchain state-machines. This makes the Cosmos SDK a very secure environment to build blockchains. -* Most importantly, the Cosmos SDK has already been used to build many application-specific blockchains that are already in production. Among others, we can cite [Cosmos Hub](https://hub.cosmos.network), [IRIS Hub](https://irisnet.org), [Binance Chain](https://docs.binance.org/), [Terra](https://terra.money/) or [Kava](https://www.kava.io/). [Many more](https://cosmos.network/ecosystem) are building on the Cosmos SDK. - -## Getting started with the Cosmos SDK - -* Learn more about the [architecture of a Cosmos SDK application](./02-sdk-app-architecture.md) -* Learn how to build an application-specific blockchain from scratch with the [Cosmos SDK Tutorial](https://cosmos.network/docs/tutorial) diff --git a/docs/docs/core/00-baseapp.md b/docs/docs/learn/advanced/00-baseapp.md similarity index 68% rename from docs/docs/core/00-baseapp.md rename to docs/docs/learn/advanced/00-baseapp.md index f54053ad8076..161a1d1a23c6 100644 --- a/docs/docs/core/00-baseapp.md +++ b/docs/docs/learn/advanced/00-baseapp.md @@ -8,12 +8,10 @@ sidebar_position: 1 This document describes `BaseApp`, the abstraction that implements the core functionalities of a Cosmos SDK application. ::: -:::note +:::note Pre-requisite Readings -### Pre-requisite Readings - -* [Anatomy of a Cosmos SDK application](../basics/00-app-anatomy.md) -* [Lifecycle of a Cosmos SDK transaction](../basics/01-tx-lifecycle.md) +* [Anatomy of a Cosmos SDK application](../beginner/00-app-anatomy.md) +* [Lifecycle of a Cosmos SDK transaction](../beginner/01-tx-lifecycle.md) ::: @@ -52,7 +50,7 @@ management logic. The `BaseApp` type holds many important parameters for any Cosmos SDK based application. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/baseapp/baseapp.go#L50-L146 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/baseapp/baseapp.go#L58-L182 ``` Let us go through the most important components. @@ -79,17 +77,16 @@ First, the important parameters that are initialized during the bootstrapping of raw transaction bytes relayed by the underlying CometBFT engine. * [`AnteHandler`](#antehandler): This handler is used to handle signature verification, fee payment, and other pre-message execution checks when a transaction is received. It's executed during - [`CheckTx/RecheckTx`](#checktx) and [`DeliverTx`](#delivertx). -* [`InitChainer`](../basics/00-app-anatomy.md#initchainer), - [`BeginBlocker` and `EndBlocker`](../basics/00-app-anatomy.md#beginblocker-and-endblocker): These are - the functions executed when the application receives the `InitChain`, `BeginBlock` and `EndBlock` + [`CheckTx/RecheckTx`](#checktx) and [`FinalizeBlock`](#finalizeblock). +* [`InitChainer`](../beginner/00-app-anatomy.md#initchainer), [`PreBlocker`](../beginner/00-app-anatomy.md#preblocker), [`BeginBlocker` and `EndBlocker`](../beginner/00-app-anatomy.md#beginblocker-and-endblocker): These are + the functions executed when the application receives the `InitChain` and `FinalizeBlock` ABCI messages from the underlying CometBFT engine. Then, parameters used to define [volatile states](#state-updates) (i.e. cached states): * `checkState`: This state is updated during [`CheckTx`](#checktx), and reset on [`Commit`](#commit). -* `deliverState`: This state is updated during [`DeliverTx`](#delivertx), and set to `nil` on - [`Commit`](#commit) and gets re-initialized on BeginBlock. +* `finalizeBlockState`: This state is updated during [`FinalizeBlock`](#finalizeblock), and set to `nil` on + [`Commit`](#commit) and gets re-initialized on `FinalizeBlock`. * `processProposalState`: This state is updated during [`ProcessProposal`](#process-proposal). * `prepareProposalState`: This state is updated during [`PrepareProposal`](#prepare-proposal). @@ -97,7 +94,7 @@ Finally, a few more important parameters: * `voteInfos`: This parameter carries the list of validators whose precommit is missing, either because they did not vote or because the proposer did not include their vote. This information is - carried by the [Context](#context) and can be used by the application for various things like + carried by the [Context](./02-context.md) and can be used by the application for various things like punishing absent validators. * `minGasPrices`: This parameter defines the minimum gas prices accepted by the node. This is a **local** parameter, meaning each full-node can set a different `minGasPrices`. It is used in the @@ -107,7 +104,7 @@ Finally, a few more important parameters: `minGasPrices` (e.g. if `minGasPrices == 1uatom,1photon`, the `gas-price` of the transaction must be greater than `1uatom` OR `1photon`). * `appVersion`: Version of the application. It is set in the - [application's constructor function](../basics/00-app-anatomy.md#constructor-function). + [application's constructor function](../beginner/00-app-anatomy.md#constructor-function). ## Constructor @@ -121,7 +118,7 @@ func NewBaseApp( ``` The `BaseApp` constructor function is pretty straightforward. The only thing worth noting is the -possibility to provide additional [`options`](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/baseapp/options.go) +possibility to provide additional [`options`](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/baseapp/options.go) to the `BaseApp`, which will execute them in order. The `options` are generally `setter` functions for important parameters, like `SetPruning()` to set pruning options or `SetMinGasPrices()` to set the node's `min-gas-prices`. @@ -131,7 +128,7 @@ Naturally, developers can add additional `options` based on their application's ## State Updates The `BaseApp` maintains four primary volatile states and a root or main state. The main state -is the canonical state of the application and the volatile states, `checkState`, `deliverState`, `prepareProposalState`, `processPreposalState`, +is the canonical state of the application and the volatile states, `checkState`, `prepareProposalState`, `processProposalState` and `finalizeBlockState` are used to handle state transitions in-between the main state made during [`Commit`](#commit). Internally, there is only a single `CommitMultiStore` which we refer to as the main or root state. @@ -143,7 +140,7 @@ The types can be illustrated as follows: ### InitChain State Updates During `InitChain`, the four volatile states, `checkState`, `prepareProposalState`, `processProposalState` -and `deliverState` are set by branching the root `CommitMultiStore`. Any subsequent reads and writes happen +and `finalizeBlockState` are set by branching the root `CommitMultiStore`. Any subsequent reads and writes happen on branched versions of the `CommitMultiStore`. To avoid unnecessary roundtrip to the main state, all reads to the branched store are cached. @@ -184,30 +181,24 @@ Again we want to highlight that the described behavior is that of the default ha ![ProcessProposal](./baseapp_state-processproposal.png) -### BeginBlock State Updates - -During `BeginBlock`, the `deliverState` is set for use in subsequent `DeliverTx` ABCI messages. The -`deliverState` is based off of the last committed state from the root store and is branched. -Note, the `deliverState` is set to `nil` on [`Commit`](#commit). - -![BeginBlock](./baseapp_state-begin_block.png) +### FinalizeBlock State Updates -### DeliverTx State Updates +During `FinalizeBlock`, the `finalizeBlockState` is set for use during transaction execution and endblock. The +`finalizeBlockState` is based off of the last committed state from the root store and is branched. +Note, the `finalizeBlockState` is set to `nil` on [`Commit`](#commit). -The state flow for `DeliverTx` is nearly identical to `CheckTx` except state transitions occur on -the `deliverState` and messages in a transaction are executed. Similarly to `CheckTx`, state transitions -occur on a doubly branched state -- `deliverState`. Successful message execution results in -writes being committed to `deliverState`. Note, if message execution fails, state transitions from +The state flow for transaction execution is nearly identical to `CheckTx` except state transitions occur on +the `finalizeBlockState` and messages in a transaction are executed. Similarly to `CheckTx`, state transitions +occur on a doubly branched state -- `finalizeBlockState`. Successful message execution results in +writes being committed to `finalizeBlockState`. Note, if message execution fails, state transitions from the AnteHandler are persisted. -![DeliverTx](./baseapp_state-deliver_tx.png) - ### Commit State Updates -During `Commit` all the state transitions that occurred in the `deliverState` are finally written to +During `Commit` all the state transitions that occurred in the `finalizeBlockState` are finally written to the root `CommitMultiStore` which in turn is committed to disk and results in a new application root hash. These state transitions are now considered final. Finally, the `checkState` is set to the -newly committed state and `deliverState` is set to `nil` to be reset on `BeginBlock`. +newly committed state and `finalizeBlockState` is set to `nil` to be reset on `FinalizeBlock`. ![Commit](./baseapp_state-commit.png) @@ -225,19 +216,19 @@ When messages and queries are received by the application, they must be routed t ### `Msg` Service Router -[`sdk.Msg`s](../building-modules/02-messages-and-queries.md#messages) need to be routed after they are extracted from transactions, which are sent from the underlying CometBFT engine via the [`CheckTx`](#checktx) and [`DeliverTx`](#delivertx) ABCI messages. To do so, `BaseApp` holds a `msgServiceRouter` which maps fully-qualified service methods (`string`, defined in each module's Protobuf `Msg` service) to the appropriate module's `MsgServer` implementation. +[`sdk.Msg`s](../../build/building-modules/02-messages-and-queries.md#messages) need to be routed after they are extracted from transactions, which are sent from the underlying CometBFT engine via the [`CheckTx`](#checktx) and [`FinalizeBlock`](#finalizeblock) ABCI messages. To do so, `BaseApp` holds a `msgServiceRouter` which maps fully-qualified service methods (`string`, defined in each module's Protobuf `Msg` service) to the appropriate module's `MsgServer` implementation. -The [default `msgServiceRouter` included in `BaseApp`](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/baseapp/msg_service_router.go) is stateless. However, some applications may want to make use of more stateful routing mechanisms such as allowing governance to disable certain routes or point them to new modules for upgrade purposes. For this reason, the `sdk.Context` is also passed into each [route handler inside `msgServiceRouter`](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/baseapp/msg_service_router.go#L31-L32). For a stateless router that doesn't want to make use of this, you can just ignore the `ctx`. +The [default `msgServiceRouter` included in `BaseApp`](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/baseapp/msg_service_router.go) is stateless. However, some applications may want to make use of more stateful routing mechanisms such as allowing governance to disable certain routes or point them to new modules for upgrade purposes. For this reason, the `sdk.Context` is also passed into each [route handler inside `msgServiceRouter`](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/baseapp/msg_service_router.go#L31-L32). For a stateless router that doesn't want to make use of this, you can just ignore the `ctx`. -The application's `msgServiceRouter` is initialized with all the routes using the application's [module manager](../building-modules/01-module-manager.md#manager) (via the `RegisterServices` method), which itself is initialized with all the application's modules in the application's [constructor](../basics/00-app-anatomy.md#constructor-function). +The application's `msgServiceRouter` is initialized with all the routes using the application's [module manager](../../build/building-modules/01-module-manager.md#manager) (via the `RegisterServices` method), which itself is initialized with all the application's modules in the application's [constructor](../beginner/00-app-anatomy.md#constructor-function). ### gRPC Query Router -Similar to `sdk.Msg`s, [`queries`](../building-modules/02-messages-and-queries.md#queries) need to be routed to the appropriate module's [`Query` service](../building-modules/04-query-services.md). To do so, `BaseApp` holds a `grpcQueryRouter`, which maps modules' fully-qualified service methods (`string`, defined in their Protobuf `Query` gRPC) to their `QueryServer` implementation. The `grpcQueryRouter` is called during the initial stages of query processing, which can be either by directly sending a gRPC query to the gRPC endpoint, or via the [`Query` ABCI message](#query) on the CometBFT RPC endpoint. +Similar to `sdk.Msg`s, [`queries`](../../build/building-modules/02-messages-and-queries.md#queries) need to be routed to the appropriate module's [`Query` service](../../build/building-modules/04-query-services.md). To do so, `BaseApp` holds a `grpcQueryRouter`, which maps modules' fully-qualified service methods (`string`, defined in their Protobuf `Query` gRPC) to their `QueryServer` implementation. The `grpcQueryRouter` is called during the initial stages of query processing, which can be either by directly sending a gRPC query to the gRPC endpoint, or via the [`Query` ABCI message](#query) on the CometBFT RPC endpoint. -Just like the `msgServiceRouter`, the `grpcQueryRouter` is initialized with all the query routes using the application's [module manager](../building-modules/01-module-manager.md) (via the `RegisterServices` method), which itself is initialized with all the application's modules in the application's [constructor](../basics/00-app-anatomy.md#app-constructor). +Just like the `msgServiceRouter`, the `grpcQueryRouter` is initialized with all the query routes using the application's [module manager](../../build/building-modules/01-module-manager.md) (via the `RegisterServices` method), which itself is initialized with all the application's modules in the application's [constructor](../beginner/00-app-anatomy.md#app-constructor). -## Main ABCI 1.0 Messages +## Main ABCI 2.0 Messages The [Application-Blockchain Interface](https://github.com/cometbft/cometbft/blob/v0.37.x/spec/abci/abci++_basic_concepts.md) (ABCI) is a generic interface that connects a state-machine with a consensus engine to form a functional full-node. It can be wrapped in any language, and needs to be implemented by each application-specific blockchain built on top of an ABCI-compatible consensus engine like CometBFT. @@ -253,7 +244,9 @@ Developers building on top of the Cosmos SDK need not implement the ABCI themsel * [`Prepare Proposal`](#prepare-proposal) * [`Process Proposal`](#process-proposal) * [`CheckTx`](#checktx) -* [`DeliverTx`](#delivertx) +* [`FinalizeBlock`](#finalizeblock) +* [`ExtendVote`](#extendvote) +* [`VerifyVoteExtension`](#verifyvoteextension) ### Prepare Proposal @@ -265,9 +258,9 @@ Here is how the `PrepareProposal` function can be implemented: 1. Extract the `sdk.Msg`s from the transaction. 2. Perform _stateful_ checks by calling `Validate()` on each of the `sdk.Msg`'s. This is done after _stateless_ checks as _stateful_ checks are more computationally expensive. If `Validate()` fails, `PrepareProposal` returns before running further checks, which saves resources. 3. Perform any additional checks that are specific to the application, such as checking account balances, or ensuring that certain conditions are met before a transaction is proposed.hey are processed by the consensus engine, if necessary. -5. Return the updated transactions to be processed by the consensus engine +4. Return the updated transactions to be processed by the consensus engine -Note that, unlike `CheckTx()`, `PrepareProposal` process `sdk.Msg`s, so it can directly update the state. However, unlike `DeliverTx()`, it does not commit the state updates. It's important to exercise caution when using `PrepareProposal` as incorrect coding could affect the overall liveness of the network. +Note that, unlike `CheckTx()`, `PrepareProposal` process `sdk.Msg`s, so it can directly update the state. However, unlike `FinalizeBlock()`, it does not commit the state updates. It's important to exercise caution when using `PrepareProposal` as incorrect coding could affect the overall liveness of the network. It's important to note that `PrepareProposal` complements the `ProcessProposal` method which is executed after this method. The combination of these two methods means that it is possible to guarantee that no invalid transactions are ever committed. Furthermore, such a setup can give rise to other interesting use cases such as Oracles, threshold decryption and more. @@ -281,7 +274,7 @@ It's important to note that `PrepareProposal` complements the `ProcessProposal` ### Process Proposal -The `ProcessProposal` function is called by the BaseApp as part of the ABCI message flow, and is executed during the `BeginBlock` phase of the consensus process. The purpose of this function is to give more control to the application for block validation, allowing it to check all transactions in a proposed block before the validator sends the prevote for the block. It allows a validator to perform application-dependent work in a proposed block, enabling features such as immediate block execution, and allows the Application to reject invalid blocks. +The `ProcessProposal` function is called by the BaseApp as part of the ABCI message flow, and is executed during the `FinalizeBlock` phase of the consensus process. The purpose of this function is to give more control to the application for block validation, allowing it to check all transactions in a proposed block before the validator sends the prevote for the block. It allows a validator to perform application-dependent work in a proposed block, enabling features such as immediate block execution, and allows the Application to reject invalid blocks. The `ProcessProposal` function performs several key tasks, including: @@ -324,16 +317,16 @@ to do the following checks: first, as _stateless_ checks are less computationally expensive than _stateful_ checks. If `ValidateBasic()` fail, `CheckTx` returns before running _stateful_ checks, which saves resources. This check is still performed for messages that have not yet migrated to the new message validation mechanism defined in [RFC 001](https://docs.cosmos.network/main/rfc/rfc-001-tx-validation) and still have a `ValidateBasic()` method. -3. Perform non-module related _stateful_ checks on the [account](../basics/03-accounts.md). This step is mainly about checking +3. Perform non-module related _stateful_ checks on the [account](../beginner/03-accounts.md). This step is mainly about checking that the `sdk.Msg` signatures are valid, that enough fees are provided and that the sending account - has enough funds to pay for said fees. Note that no precise [`gas`](../basics/04-gas-fees.md) counting occurs here, - as `sdk.Msg`s are not processed. Usually, the [`AnteHandler`](../basics/04-gas-fees.md#antehandler) will check that the `gas` provided + has enough funds to pay for said fees. Note that no precise [`gas`](../beginner/04-gas-fees.md) counting occurs here, + as `sdk.Msg`s are not processed. Usually, the [`AnteHandler`](../beginner/04-gas-fees.md#antehandler) will check that the `gas` provided with the transaction is superior to a minimum reference gas amount based on the raw transaction size, in order to avoid spam with transactions that provide 0 gas. -`CheckTx` does **not** process `sdk.Msg`s - they only need to be processed when the canonical state need to be updated, which happens during `DeliverTx`. +`CheckTx` does **not** process `sdk.Msg`s - they only need to be processed when the canonical state needs to be updated, which happens during `FinalizeBlock`. -Steps 2. and 3. are performed by the [`AnteHandler`](../basics/04-gas-fees.md#antehandler) in the [`RunTx()`](#runtx-antehandler-and-runmsgs) +Steps 2. and 3. are performed by the [`AnteHandler`](../beginner/04-gas-fees.md#antehandler) in the [`RunTx()`](#runtx-antehandler-and-runmsgs) function, which `CheckTx()` calls with the `runTxModeCheck` mode. During each step of `CheckTx()`, a special [volatile state](#state-updates) called `checkState` is updated. This state is used to keep track of the temporary changes triggered by the `CheckTx()` calls of each transaction without modifying @@ -356,7 +349,7 @@ The response contains: * `GasUsed (int64)`: Amount of gas consumed by transaction. During `CheckTx`, this value is computed by multiplying the standard cost of a transaction byte by the size of the raw transaction. Next is an example: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/auth/ante/basic.go#L96 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/auth/ante/basic.go#L102 ``` * `Events ([]cmn.KVPair)`: Key-Value tags for filtering and indexing transactions (eg. by account). See [`event`s](./08-events.md) for more. @@ -371,62 +364,32 @@ Tendermint v0.32.1, an additional `Type` parameter is made available to the `Che indicates whether an incoming transaction is new (`CheckTxType_New`), or a recheck (`CheckTxType_Recheck`). This allows certain checks like signature verification can be skipped during `CheckTxType_Recheck`. -### DeliverTx - -When the underlying consensus engine receives a block proposal, each transaction in the block needs to be processed by the application. To that end, the underlying consensus engine sends a `DeliverTx` message to the application for each transaction in a sequential order. - -Before the first transaction of a given block is processed, a [volatile state](#state-updates) called `deliverState` is initialized during [`BeginBlock`](#beginblock). This state is updated each time a transaction is processed via `DeliverTx`, and committed to the [main state](#main-state) when the block is [committed](#commit), after what it is set to `nil`. - -`DeliverTx` performs the **exact same steps as `CheckTx`**, with a little caveat at step 3 and the addition of a fifth step: - -1. The `AnteHandler` does **not** check that the transaction's `gas-prices` is sufficient. That is because the `min-gas-prices` value `gas-prices` is checked against is local to the node, and therefore what is enough for one full-node might not be for another. This means that the proposer can potentially include transactions for free, although they are not incentivised to do so, as they earn a bonus on the total fee of the block they propose. -2. For each `sdk.Msg` in the transaction, route to the appropriate module's Protobuf [`Msg` service](../building-modules/03-msg-services.md). Additional _stateful_ checks are performed, and the branched multistore held in `deliverState`'s `context` is updated by the module's `keeper`. If the `Msg` service returns successfully, the branched multistore held in `context` is written to `deliverState` `CacheMultiStore`. - -During the additional fifth step outlined in (2), each read/write to the store increases the value of `GasConsumed`. You can find the default cost of each operation: - -```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/store/types/gas.go#L230-L241 -``` - -At any point, if `GasConsumed > GasWanted`, the function returns with `Code != 0` and `DeliverTx` fails. - -`DeliverTx` returns a response to the underlying consensus engine of type [`abci.ResponseDeliverTx`](https://github.com/cometbft/cometbft/blob/v0.37.x/spec/abci/abci++_methods.md#delivertx). The response contains: - -* `Code (uint32)`: Response Code. `0` if successful. -* `Data ([]byte)`: Result bytes, if any. -* `Log (string):` The output of the application's logger. May be non-deterministic. -* `Info (string):` Additional information. May be non-deterministic. -* `GasWanted (int64)`: Amount of gas requested for transaction. It is provided by users when they generate the transaction. -* `GasUsed (int64)`: Amount of gas consumed by transaction. During `DeliverTx`, this value is computed by multiplying the standard cost of a transaction byte by the size of the raw transaction, and by adding gas each time a read/write to the store occurs. -* `Events ([]cmn.KVPair)`: Key-Value tags for filtering and indexing transactions (eg. by account). See [`event`s](./08-events.md) for more. -* `Codespace (string)`: Namespace for the Code. - ## RunTx, AnteHandler, RunMsgs, PostHandler ### RunTx -`RunTx` is called from `CheckTx`/`DeliverTx` to handle the transaction, with `runTxModeCheck` or `runTxModeDeliver` as parameter to differentiate between the two modes of execution. Note that when `RunTx` receives a transaction, it has already been decoded. +`RunTx` is called from `CheckTx`/`Finalizeblock` to handle the transaction, with `execModeCheck` or `execModeFinalize` as parameter to differentiate between the two modes of execution. Note that when `RunTx` receives a transaction, it has already been decoded. -The first thing `RunTx` does upon being called is to retrieve the `context`'s `CacheMultiStore` by calling the `getContextForTx()` function with the appropriate mode (either `runTxModeCheck` or `runTxModeDeliver`). This `CacheMultiStore` is a branch of the main store, with cache functionality (for query requests), instantiated during `BeginBlock` for `DeliverTx` and during the `Commit` of the previous block for `CheckTx`. After that, two `defer func()` are called for [`gas`](../basics/04-gas-fees.md) management. They are executed when `runTx` returns and make sure `gas` is actually consumed, and will throw errors, if any. +The first thing `RunTx` does upon being called is to retrieve the `context`'s `CacheMultiStore` by calling the `getContextForTx()` function with the appropriate mode (either `runTxModeCheck` or `execModeFinalize`). This `CacheMultiStore` is a branch of the main store, with cache functionality (for query requests), instantiated during `FinalizeBlock` for transaction execution and during the `Commit` of the previous block for `CheckTx`. After that, two `defer func()` are called for [`gas`](../beginner/04-gas-fees.md) management. They are executed when `runTx` returns and make sure `gas` is actually consumed, and will throw errors, if any. After that, `RunTx()` calls `ValidateBasic()`, when available and for backward compatibility, on each `sdk.Msg`in the `Tx`, which runs preliminary _stateless_ validity checks. If any `sdk.Msg` fails to pass `ValidateBasic()`, `RunTx()` returns with an error. -Then, the [`anteHandler`](#antehandler) of the application is run (if it exists). In preparation of this step, both the `checkState`/`deliverState`'s `context` and `context`'s `CacheMultiStore` are branched using the `cacheTxContext()` function. +Then, the [`anteHandler`](#antehandler) of the application is run (if it exists). In preparation of this step, both the `checkState`/`finalizeBlockState`'s `context` and `context`'s `CacheMultiStore` are branched using the `cacheTxContext()` function. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/baseapp/baseapp.go#L663-L672 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/baseapp/baseapp.go#L663-L680 ``` This allows `RunTx` not to commit the changes made to the state during the execution of `anteHandler` if it ends up failing. It also prevents the module implementing the `anteHandler` from writing to state, which is an important part of the [object-capabilities](./10-ocap.md) of the Cosmos SDK. -Finally, the [`RunMsgs()`](#runmsgs) function is called to process the `sdk.Msg`s in the `Tx`. In preparation of this step, just like with the `anteHandler`, both the `checkState`/`deliverState`'s `context` and `context`'s `CacheMultiStore` are branched using the `cacheTxContext()` function. +Finally, the [`RunMsgs()`](#runmsgs) function is called to process the `sdk.Msg`s in the `Tx`. In preparation of this step, just like with the `anteHandler`, both the `checkState`/`finalizeBlockState`'s `context` and `context`'s `CacheMultiStore` are branched using the `cacheTxContext()` function. ### AnteHandler The `AnteHandler` is a special handler that implements the `AnteHandler` interface and is used to authenticate the transaction before the transaction's internal messages are processed. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/types/handler.go#L6-L8 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/types/handler.go#L6-L8 ``` The `AnteHandler` is theoretically optional, but still a very important component of public blockchain networks. It serves 3 primary purposes: @@ -435,25 +398,26 @@ The `AnteHandler` is theoretically optional, but still a very important componen * Perform preliminary _stateful_ validity checks like ensuring signatures are valid or that the sender has enough funds to pay for fees. * Play a role in the incentivisation of stakeholders via the collection of transaction fees. -`BaseApp` holds an `anteHandler` as parameter that is initialized in the [application's constructor](../basics/00-app-anatomy.md#application-constructor). The most widely used `anteHandler` is the [`auth` module](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/auth/ante/ante.go). +`BaseApp` holds an `anteHandler` as parameter that is initialized in the [application's constructor](../beginner/00-app-anatomy.md#application-constructor). The most widely used `anteHandler` is the [`auth` module](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/auth/ante/ante.go). -Click [here](../basics/04-gas-fees.md#antehandler) for more on the `anteHandler`. +Click [here](../beginner/04-gas-fees.md#antehandler) for more on the `anteHandler`. ### RunMsgs -`RunMsgs` is called from `RunTx` with `runTxModeCheck` as parameter to check the existence of a route for each message the transaction, and with `runTxModeDeliver` to actually process the `sdk.Msg`s. +`RunMsgs` is called from `RunTx` with `runTxModeCheck` as parameter to check the existence of a route for each message the transaction, and with `execModeFinalize` to actually process the `sdk.Msg`s. -First, it retrieves the `sdk.Msg`'s fully-qualified type name, by checking the `type_url` of the Protobuf `Any` representing the `sdk.Msg`. Then, using the application's [`msgServiceRouter`](#msg-service-router), it checks for the existence of `Msg` service method related to that `type_url`. At this point, if `mode == runTxModeCheck`, `RunMsgs` returns. Otherwise, if `mode == runTxModeDeliver`, the [`Msg` service](../building-modules/03-msg-services.md) RPC is executed, before `RunMsgs` returns. +First, it retrieves the `sdk.Msg`'s fully-qualified type name, by checking the `type_url` of the Protobuf `Any` representing the `sdk.Msg`. Then, using the application's [`msgServiceRouter`](#msg-service-router), it checks for the existence of `Msg` service method related to that `type_url`. At this point, if `mode == runTxModeCheck`, `RunMsgs` returns. Otherwise, if `mode == execModeFinalize`, the [`Msg` service](../../build/building-modules/03-msg-services.md) RPC is executed, before `RunMsgs` returns. ### PostHandler -`PostHandler` is similar to `AnteHandler`, but it, as the name suggests, executes custom post tx processing logic after [`RunMsgs`](#runmsgs) is called. `PostHandler` receives the `Result` of the the `RunMsgs` in order to enable this customizable behavior. +`PostHandler` is similar to `AnteHandler`, but it, as the name suggests, executes custom post tx processing logic after [`RunMsgs`](#runmsgs) is called. `PostHandler` receives the `Result` of the `RunMsgs` in order to enable this customizable behavior. + +Like `AnteHandler`s, `PostHandler`s are theoretically optional. -Like `AnteHandler`s, `PostHandler`s are theoretically optional, one use case for `PostHandler`s is transaction tips (enabled by default in simapp). Other use cases like unused gas refund can also be enabled by `PostHandler`s. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/auth/posthandler/post.go#L1-L15 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/auth/posthandler/post.go#L1-L15 ``` Note, when `PostHandler`s fail, the state from `runMsgs` is also reverted, effectively making the transaction fail. @@ -465,36 +429,86 @@ Note, when `PostHandler`s fail, the state from `runMsgs` is also reverted, effec The [`InitChain` ABCI message](https://github.com/cometbft/cometbft/blob/v0.37.x/spec/abci/abci++_basic_concepts.md#method-overview) is sent from the underlying CometBFT engine when the chain is first started. It is mainly used to **initialize** parameters and state like: * [Consensus Parameters](https://github.com/cometbft/cometbft/blob/v0.37.x/spec/abci/abci++_app_requirements.md#consensus-parameters) via `setConsensusParams`. -* [`checkState` and `deliverState`](#state-updates) via `setState`. -* The [block gas meter](../basics/04-gas-fees.md#block-gas-meter), with infinite gas to process genesis transactions. +* [`checkState` and `finalizeBlockState`](#state-updates) via `setState`. +* The [block gas meter](../beginner/04-gas-fees.md#block-gas-meter), with infinite gas to process genesis transactions. + +Finally, the `InitChain(req abci.RequestInitChain)` method of `BaseApp` calls the [`initChainer()`](../beginner/00-app-anatomy.md#initchainer) of the application in order to initialize the main state of the application from the `genesis file` and, if defined, call the [`InitGenesis`](../../build/building-modules/08-genesis.md#initgenesis) function of each of the application's modules. -Finally, the `InitChain(req abci.RequestInitChain)` method of `BaseApp` calls the [`initChainer()`](../basics/00-app-anatomy.md#initchainer) of the application in order to initialize the main state of the application from the `genesis file` and, if defined, call the [`InitGenesis`](../building-modules/08-genesis.md#initgenesis) function of each of the application's modules. -### BeginBlock +### FinalizeBlock -The [`BeginBlock` ABCI message](https://github.com/cometbft/cometbft/blob/v0.37.x/spec/abci/abci++_basic_concepts.md#method-overview) is sent from the underlying CometBFT engine when a block proposal created by the correct proposer is received, before [`DeliverTx`](#delivertx) is run for each transaction in the block. It allows developers to have logic be executed at the beginning of each block. In the Cosmos SDK, the `BeginBlock(req abci.RequestBeginBlock)` method does the following: +The [`FinalizeBlock` ABCI message](https://github.com/cometbft/cometbft/blob/v0.38.x/spec/abci/abci++_basic_concepts.md#method-overview) is sent from the underlying CometBFT engine when a block proposal created by the correct proposer is received. The previous `BeginBlock, DeliverTx and Endblock` calls are private methods on the BaseApp struct. -* Initialize [`deliverState`](#state-updates) with the latest header using the `req abci.RequestBeginBlock` passed as parameter via the `setState` function. + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/baseapp/abci.go#L623 +``` + +#### PreBlock + +* Run the application's [`preBlocker()`](../beginner/00-app-anatomy.md#preblocker), which mainly runs the [`PreBlocker()`](../../build/building-modules/17-preblock.md#preblock) method of each of the modules. + +#### BeginBlock + +* Initialize [`finalizeBlockState`](#state-updates) with the latest header using the `req abci.RequestFinalizeBlock` passed as parameter via the `setState` function. ```go reference - https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/baseapp/baseapp.go#L406-L433 + https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/baseapp/baseapp.go#L682-L706 ``` - This function also resets the [main gas meter](../basics/04-gas-fees.md#main-gas-meter). + This function also resets the [main gas meter](../beginner/04-gas-fees.md#main-gas-meter). + +* Initialize the [block gas meter](../beginner/04-gas-fees.md#block-gas-meter) with the `maxGas` limit. The `gas` consumed within the block cannot go above `maxGas`. This parameter is defined in the application's consensus parameters. +* Run the application's [`beginBlocker()`](../beginner/00-app-anatomy.md#beginblocker-and-endblocker), which mainly runs the [`BeginBlocker()`](../../build/building-modules/06-beginblock-endblock.md#beginblock) method of each of the modules. +* Set the [`VoteInfos`](https://github.com/cometbft/cometbft/blob/v0.37.x/spec/abci/abci++_methods.md#voteinfo) of the application, i.e. the list of validators whose _precommit_ for the previous block was included by the proposer of the current block. This information is carried into the [`Context`](./02-context.md) so that it can be used during transaction execution and EndBlock. + +#### Transaction Execution -* Initialize the [block gas meter](../basics/04-gas-fees.md#block-gas-meter) with the `maxGas` limit. The `gas` consumed within the block cannot go above `maxGas`. This parameter is defined in the application's consensus parameters. -* Run the application's [`beginBlocker()`](../basics/00-app-anatomy.md#beginblocker-and-endblock), which mainly runs the [`BeginBlocker()`](../building-modules/05-beginblock-endblock.md#beginblock) method of each of the application's modules. -* Set the [`VoteInfos`](https://github.com/cometbft/cometbft/blob/v0.37.x/spec/abci/abci++_methods.md#voteinfo) of the application, i.e. the list of validators whose _precommit_ for the previous block was included by the proposer of the current block. This information is carried into the [`Context`](./02-context.md) so that it can be used during `DeliverTx` and `EndBlock`. +When the underlying consensus engine receives a block proposal, each transaction in the block needs to be processed by the application. To that end, the underlying consensus engine sends the transactions in FinalizeBlock message to the application for each transaction in a sequential order. -### EndBlock +Before the first transaction of a given block is processed, a [volatile state](#state-updates) called `finalizeBlockState` is initialized during FinalizeBlock. This state is updated each time a transaction is processed via `FinalizeBlock`, and committed to the [main state](#main-state) when the block is [committed](#commit), after what it is set to `nil`. -The [`EndBlock` ABCI message](https://github.com/cometbft/cometbft/blob/v0.37.x/spec/abci/abci++_basic_concepts.md#method-overview) is sent from the underlying CometBFT engine after [`DeliverTx`](#delivertx) as been run for each transaction in the block. It allows developers to have logic be executed at the end of each block. In the Cosmos SDK, the bulk `EndBlock(req abci.RequestEndBlock)` method is to run the application's [`EndBlocker()`](../basics/00-app-anatomy.md#beginblocker-and-endblock), which mainly runs the [`EndBlocker()`](../building-modules/05-beginblock-endblock.md#beginblock) method of each of the application's modules. +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/baseapp/baseapp.go#LL708-L743 +``` + +Transaction execution within `FinalizeBlock` performs the **exact same steps as `CheckTx`**, with a little caveat at step 3 and the addition of a fifth step: + +1. The `AnteHandler` does **not** check that the transaction's `gas-prices` is sufficient. That is because the `min-gas-prices` value `gas-prices` is checked against is local to the node, and therefore what is enough for one full-node might not be for another. This means that the proposer can potentially include transactions for free, although they are not incentivised to do so, as they earn a bonus on the total fee of the block they propose. +2. For each `sdk.Msg` in the transaction, route to the appropriate module's Protobuf [`Msg` service](../../build/building-modules/03-msg-services.md). Additional _stateful_ checks are performed, and the branched multistore held in `finalizeBlockState`'s `context` is updated by the module's `keeper`. If the `Msg` service returns successfully, the branched multistore held in `context` is written to `finalizeBlockState` `CacheMultiStore`. + +During the additional fifth step outlined in (2), each read/write to the store increases the value of `GasConsumed`. You can find the default cost of each operation: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/store/types/gas.go#L230-L241 +``` + +At any point, if `GasConsumed > GasWanted`, the function returns with `Code != 0` and the execution fails. + +Each transactions returns a response to the underlying consensus engine of type [`abci.ExecTxResult`](https://github.com/cometbft/cometbft/blob/v0.38.0-rc1/spec/abci/abci%2B%2B_methods.md#exectxresult). The response contains: + +* `Code (uint32)`: Response Code. `0` if successful. +* `Data ([]byte)`: Result bytes, if any. +* `Log (string):` The output of the application's logger. May be non-deterministic. +* `Info (string):` Additional information. May be non-deterministic. +* `GasWanted (int64)`: Amount of gas requested for transaction. It is provided by users when they generate the transaction. +* `GasUsed (int64)`: Amount of gas consumed by transaction. During transaction execution, this value is computed by multiplying the standard cost of a transaction byte by the size of the raw transaction, and by adding gas each time a read/write to the store occurs. +* `Events ([]cmn.KVPair)`: Key-Value tags for filtering and indexing transactions (eg. by account). See [`event`s](./08-events.md) for more. +* `Codespace (string)`: Namespace for the Code. + +#### EndBlock + +EndBlock is run after transaction execution completes. It allows developers to have logic be executed at the end of each block. In the Cosmos SDK, the bulk EndBlock() method is to run the application's EndBlocker(), which mainly runs the EndBlocker() method of each of the application's modules. + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/baseapp/baseapp.go#L747-L769 +``` ### Commit -The [`Commit` ABCI message](https://github.com/cometbft/cometbft/blob/v0.37.x/spec/abci/abci++_basic_concepts.md#method-overview) is sent from the underlying CometBFT engine after the full-node has received _precommits_ from 2/3+ of validators (weighted by voting power). On the `BaseApp` end, the `Commit(res abci.ResponseCommit)` function is implemented to commit all the valid state transitions that occurred during `BeginBlock`, `DeliverTx` and `EndBlock` and to reset state for the next block. +The [`Commit` ABCI message](https://github.com/cometbft/cometbft/blob/v0.37.x/spec/abci/abci++_basic_concepts.md#method-overview) is sent from the underlying CometBFT engine after the full-node has received _precommits_ from 2/3+ of validators (weighted by voting power). On the `BaseApp` end, the `Commit(res abci.ResponseCommit)` function is implemented to commit all the valid state transitions that occurred during `FinalizeBlock` and to reset state for the next block. -To commit state-transitions, the `Commit` function calls the `Write()` function on `deliverState.ms`, where `deliverState.ms` is a branched multistore of the main store `app.cms`. Then, the `Commit` function sets `checkState` to the latest header (obtained from `deliverState.ctx.BlockHeader`) and `deliverState` to `nil`. +To commit state-transitions, the `Commit` function calls the `Write()` function on `finalizeBlockState.ms`, where `finalizeBlockState.ms` is a branched multistore of the main store `app.cms`. Then, the `Commit` function sets `checkState` to the latest header (obtained from `finalizeBlockState.ctx.BlockHeader`) and `finalizeBlockState` to `nil`. Finally, `Commit` returns the hash of the commitment of `app.cms` back to the underlying consensus engine. This hash is used as a reference in the header of the next block. @@ -504,10 +518,30 @@ The [`Info` ABCI message](https://github.com/cometbft/cometbft/blob/v0.37.x/spec ### Query -The [`Query` ABCI message](https://github.com/cometbft/cometbft/blob/v0.37.x/spec/abci/abci++_basic_concepts.md#info-methods) is used to serve queries received from the underlying consensus engine, including queries received via RPC like CometBFT RPC. It used to be the main entrypoint to build interfaces with the application, but with the introduction of [gRPC queries](../building-modules/04-query-services.md) in Cosmos SDK v0.40, its usage is more limited. The application must respect a few rules when implementing the `Query` method, which are outlined [here](https://github.com/cometbft/cometbft/blob/v0.37.x/spec/abci/abci++_app_requirements.md#query). +The [`Query` ABCI message](https://github.com/cometbft/cometbft/blob/v0.37.x/spec/abci/abci++_basic_concepts.md#info-methods) is used to serve queries received from the underlying consensus engine, including queries received via RPC like CometBFT RPC. It used to be the main entrypoint to build interfaces with the application, but with the introduction of [gRPC queries](../../build/building-modules/04-query-services.md) in Cosmos SDK v0.40, its usage is more limited. The application must respect a few rules when implementing the `Query` method, which are outlined [here](https://github.com/cometbft/cometbft/blob/v0.37.x/spec/abci/abci++_app_requirements.md#query). Each CometBFT `query` comes with a `path`, which is a `string` which denotes what to query. If the `path` matches a gRPC fully-qualified service method, then `BaseApp` will defer the query to the `grpcQueryRouter` and let it handle it like explained [above](#grpc-query-router). Otherwise, the `path` represents a query that is not (yet) handled by the gRPC router. `BaseApp` splits the `path` string with the `/` delimiter. By convention, the first element of the split string (`split[0]`) contains the category of `query` (`app`, `p2p`, `store` or `custom` ). The `BaseApp` implementation of the `Query(req abci.RequestQuery)` method is a simple dispatcher serving these 4 main categories of queries: * Application-related queries like querying the application's version, which are served via the `handleQueryApp` method. * Direct queries to the multistore, which are served by the `handlerQueryStore` method. These direct queries are different from custom queries which go through `app.queryRouter`, and are mainly used by third-party service provider like block explorers. * P2P queries, which are served via the `handleQueryP2P` method. These queries return either `app.addrPeerFilter` or `app.ipPeerFilter` that contain the list of peers filtered by address or IP respectively. These lists are first initialized via `options` in `BaseApp`'s [constructor](#constructor). + +### ExtendVote + +`ExtendVote` allows an application to extend a pre-commit vote with arbitrary data. This process does NOT have to be deterministic and the data returned can be unique to the validator process. + +In the Cosmos-SDK this is implemented as a NoOp: + +``` go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/baseapp/abci_utils.go#L274-L281 +``` + +### VerifyVoteExtension + +`VerifyVoteExtension` allows an application to verify that the data returned by `ExtendVote` is valid. This process MUST be deterministic. Moreover, the value of ResponseVerifyVoteExtension.status MUST exclusively depend on the parameters passed in the call to RequestVerifyVoteExtension, and the last committed Application state. + +In the Cosmos-SDK this is implemented as a NoOp: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/baseapp/abci_utils.go#L282-L288 +``` diff --git a/docs/docs/core/01-transactions.md b/docs/docs/learn/advanced/01-transactions.md similarity index 60% rename from docs/docs/core/01-transactions.md rename to docs/docs/learn/advanced/01-transactions.md index e8446646ae8c..900d8b3fe182 100644 --- a/docs/docs/core/01-transactions.md +++ b/docs/docs/learn/advanced/01-transactions.md @@ -8,36 +8,34 @@ sidebar_position: 1 `Transactions` are objects created by end-users to trigger state changes in the application. ::: -:::note - -### Pre-requisite Readings +:::note Pre-requisite Readings -* [Anatomy of a Cosmos SDK Application](../basics/00-app-anatomy.md) +* [Anatomy of a Cosmos SDK Application](../beginner/00-app-anatomy.md) ::: ## Transactions -Transactions are comprised of metadata held in [contexts](./02-context.md) and [`sdk.Msg`s](../building-modules/02-messages-and-queries.md) that trigger state changes within a module through the module's Protobuf [`Msg` service](../building-modules/03-msg-services.md). +Transactions are comprised of metadata held in [contexts](./02-context.md) and [`sdk.Msg`s](../../build/building-modules/02-messages-and-queries.md) that trigger state changes within a module through the module's Protobuf [`Msg` service](../../build/building-modules/03-msg-services.md). -When users want to interact with an application and make state changes (e.g. sending coins), they create transactions. Each of a transaction's `sdk.Msg` must be signed using the private key associated with the appropriate account(s), before the transaction is broadcasted to the network. A transaction must then be included in a block, validated, and approved by the network through the consensus process. To read more about the lifecycle of a transaction, click [here](../basics/01-tx-lifecycle.md). +When users want to interact with an application and make state changes (e.g. sending coins), they create transactions. Each of a transaction's `sdk.Msg` must be signed using the private key associated with the appropriate account(s), before the transaction is broadcasted to the network. A transaction must then be included in a block, validated, and approved by the network through the consensus process. To read more about the lifecycle of a transaction, click [here](../beginner/01-tx-lifecycle.md). ## Type Definition Transaction objects are Cosmos SDK types that implement the `Tx` interface ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/types/tx_msg.go#L42-L50 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/types/tx_msg.go#L51-L56 ``` It contains the following methods: * **GetMsgs:** unwraps the transaction and returns a list of contained `sdk.Msg`s - one transaction may have one or multiple messages, which are defined by module developers. -* **ValidateBasic:** lightweight, [_stateless_](../basics/01-tx-lifecycle.md#types-of-checks) checks used by ABCI messages [`CheckTx`](./00-baseapp.md#checktx) and [`DeliverTx`](./00-baseapp.md#delivertx) to make sure transactions are not invalid. For example, the [`auth`](https://github.com/cosmos/cosmos-sdk/tree/main/x/auth) module's `ValidateBasic` function checks that its transactions are signed by the correct number of signers and that the fees do not exceed what the user's maximum. When [`runTx`](./00-baseapp.md#runtx) is checking a transaction created from the [`auth`](https://github.com/cosmos/cosmos-sdk/tree/main/x/auth/spec) module, it first runs `ValidateBasic` on each message, then runs the `auth` module AnteHandler which calls `ValidateBasic` for the transaction itself. +* **ValidateBasic:** lightweight, [_stateless_](../beginner/01-tx-lifecycle.md#types-of-checks) checks used by ABCI messages [`CheckTx`](./00-baseapp.md#checktx) and [`DeliverTx`](./00-baseapp.md#delivertx) to make sure transactions are not invalid. For example, the [`auth`](https://github.com/cosmos/cosmos-sdk/tree/main/x/auth) module's `ValidateBasic` function checks that its transactions are signed by the correct number of signers and that the fees do not exceed what the user's maximum. When [`runTx`](./00-baseapp.md#runtx) is checking a transaction created from the [`auth`](https://github.com/cosmos/cosmos-sdk/tree/main/x/auth/spec) module, it first runs `ValidateBasic` on each message, then runs the `auth` module AnteHandler which calls `ValidateBasic` for the transaction itself. - :::note - This function is different from the deprecated `sdk.Msg` [`ValidateBasic`](../basics/01-tx-lifecycle.md#ValidateBasic) methods, which was performing basic validity checks on messages only. - ::: +:::note +This function is different from the deprecated `sdk.Msg` [`ValidateBasic`](../beginner/01-tx-lifecycle.md#ValidateBasic) methods, which was performing basic validity checks on messages only. +::: As a developer, you should rarely manipulate `Tx` directly, as `Tx` is really an intermediate type used for transaction generation. Instead, developers should prefer the `TxBuilder` interface, which you can learn more about [below](#transaction-generation). @@ -50,13 +48,13 @@ Every message in a transaction must be signed by the addresses specified by its The most used implementation of the `Tx` interface is the Protobuf `Tx` message, which is used in `SIGN_MODE_DIRECT`: ```protobuf reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/tx/v1beta1/tx.proto#L13-L26 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/proto/cosmos/tx/v1beta1/tx.proto#L13-L26 ``` -Because Protobuf serialization is not deterministic, the Cosmos SDK uses an additional `TxRaw` type to denote the pinned bytes over which a transaction is signed. Any user can generate a valid `body` and `auth_info` for a transaction, and serialize these two messages using Protobuf. `TxRaw` then pins the user's exact binary representation of `body` and `auth_info`, called respectively `body_bytes` and `auth_info_bytes`. The document that is signed by all signers of the transaction is `SignDoc` (deterministically serialized using [ADR-027](../architecture/adr-027-deterministic-protobuf-serialization.md)): +Because Protobuf serialization is not deterministic, the Cosmos SDK uses an additional `TxRaw` type to denote the pinned bytes over which a transaction is signed. Any user can generate a valid `body` and `auth_info` for a transaction, and serialize these two messages using Protobuf. `TxRaw` then pins the user's exact binary representation of `body` and `auth_info`, called respectively `body_bytes` and `auth_info_bytes`. The document that is signed by all signers of the transaction is `SignDoc` (deterministically serialized using [ADR-027](../../build/architecture/adr-027-deterministic-protobuf-serialization.md)): ```protobuf reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/tx/v1beta1/tx.proto#L48-L65 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/proto/cosmos/tx/v1beta1/tx.proto#L48-L65 ``` Once signed by all signers, the `body_bytes`, `auth_info_bytes` and `signatures` are gathered into `TxRaw`, whose serialized bytes are broadcasted over the network. @@ -66,13 +64,13 @@ Once signed by all signers, the `body_bytes`, `auth_info_bytes` and `signatures` The legacy implementation of the `Tx` interface is the `StdTx` struct from `x/auth`: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/auth/migrations/legacytx/stdtx.go#L83-L93 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/auth/migrations/legacytx/stdtx.go#L83-L90 ``` The document signed by all signers is `StdSignDoc`: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/auth/migrations/legacytx/stdsign.go#L38-L52 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/auth/migrations/legacytx/stdsign.go#L31-L45 ``` which is encoded into bytes using Amino JSON. Once all signatures are gathered into `StdTx`, `StdTx` is serialized using Amino JSON, and these bytes are broadcasted over the network. @@ -87,21 +85,26 @@ The Cosmos SDK also provides a couple of other sign modes for particular use cas need to sign over the fees: ```protobuf reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/tx/v1beta1/tx.proto#L67-L97 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/proto/cosmos/tx/v1beta1/tx.proto#L67-L98 ``` The use case is a multi-signer transaction, where one of the signers is appointed to gather all signatures, broadcast the signature and pay for fees, and the others only care about the transaction body. This generally allows for a better multi-signing UX. If Alice, Bob and Charlie are part of a 3-signer transaction, then Alice and Bob can both use `SIGN_MODE_DIRECT_AUX` to sign over the `TxBody` and their own signer info (no need an additional step to gather other signers' ones, like in `SIGN_MODE_DIRECT`), without specifying a fee in their SignDoc. Charlie can then gather both signatures from Alice and Bob, and create the final transaction by appending a fee. Note that the fee payer of the transaction (in our case Charlie) must sign over the fees, so must use `SIGN_MODE_DIRECT` or `SIGN_MODE_LEGACY_AMINO_JSON`. -A concrete use case is implemented in [transaction tips](./14-tips.md): the tipper may use `SIGN_MODE_DIRECT_AUX` to specify a tip in the transaction, without signing over the actual transaction fees. Then, the fee payer appends fees inside the tipper's desired `TxBody`, and as an exchange for paying the fees and broadcasting the transaction, receives the tipper's transaction tips as payment. #### `SIGN_MODE_TEXTUAL` -`SIGN_MODE_TEXTUAL` is a new sign mode for delivering a better signing experience on hardware wallets, it is currently still under implementation. If you wish to learn more, please refer to [ADR-050](https://github.com/cosmos/cosmos-sdk/pull/10701). +`SIGN_MODE_TEXTUAL` is a new sign mode for delivering a better signing experience on hardware wallets and it is included in the v0.50 release. In this mode, the signer signs over the human-readable string representation of the transaction (CBOR) and makes all data being displayed easier to read. The data is formatted as screens, and each screen is meant to be displayed in its entirety even on small devices like the Ledger Nano. + +There are also _expert_ screens, which will only be displayed if the user has chosen that option in its hardware device. These screens contain things like account number, account sequence and the sign data hash. + +Data is formatted using a set of `ValueRenderer` which the SDK provides defaults for all the known messages and value types. Chain developers can also opt to implement their own `ValueRenderer` for a type/message if they'd like to display information differently. + +If you wish to learn more, please refer to [ADR-050](../../build/architecture/adr-050-sign-mode-textual.md). #### Custom Sign modes -There is the the opportunity to add your own custom sign mode to the Cosmos-SDK. While we can not accept the implementation of the sign mode to the repository, we can accept a pull request to add the custom signmode to the SignMode enum located [here](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/tx/signing/v1beta1/signing.proto#L17) +There is the opportunity to add your own custom sign mode to the Cosmos-SDK. While we can not accept the implementation of the sign mode to the repository, we can accept a pull request to add the custom signmode to the SignMode enum located [here](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/proto/cosmos/tx/signing/v1beta1/signing.proto#L17) ## Transaction Process @@ -119,12 +122,12 @@ The next paragraphs will describe each of these components, in this order. Module `sdk.Msg`s are not to be confused with [ABCI Messages](https://docs.cometbft.com/v0.37/spec/abci/) which define interactions between the CometBFT and application layers. ::: -**Messages** (or `sdk.Msg`s) are module-specific objects that trigger state transitions within the scope of the module they belong to. Module developers define the messages for their module by adding methods to the Protobuf [`Msg` service](../building-modules/03-msg-services.md), and also implement the corresponding `MsgServer`. +**Messages** (or `sdk.Msg`s) are module-specific objects that trigger state transitions within the scope of the module they belong to. Module developers define the messages for their module by adding methods to the Protobuf [`Msg` service](../../build/building-modules/03-msg-services.md), and also implement the corresponding `MsgServer`. -Each `sdk.Msg`s is related to exactly one Protobuf [`Msg` service](../building-modules/03-msg-services.md) RPC, defined inside each module's `tx.proto` file. A SDK app router automatically maps every `sdk.Msg` to a corresponding RPC. Protobuf generates a `MsgServer` interface for each module `Msg` service, and the module developer needs to implement this interface. +Each `sdk.Msg`s is related to exactly one Protobuf [`Msg` service](../../build/building-modules/03-msg-services.md) RPC, defined inside each module's `tx.proto` file. A SDK app router automatically maps every `sdk.Msg` to a corresponding RPC. Protobuf generates a `MsgServer` interface for each module `Msg` service, and the module developer needs to implement this interface. This design puts more responsibility on module developers, allowing application developers to reuse common functionalities without having to implement state transition logic repetitively. -To learn more about Protobuf `Msg` services and how to implement `MsgServer`, click [here](../building-modules/03-msg-services.md). +To learn more about Protobuf `Msg` services and how to implement `MsgServer`, click [here](../../build/building-modules/03-msg-services.md). While messages contain the information for state transition logic, a transaction's other metadata and relevant information are stored in the `TxBuilder` and `Context`. @@ -133,7 +136,7 @@ While messages contain the information for state transition logic, a transaction The `TxBuilder` interface contains data closely related with the generation of transactions, which an end-user can freely set to generate the desired transaction: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/client/tx_config.go#L33-L50 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/client/tx_config.go#L40-L53 ``` * `Msg`s, the array of [messages](#messages) included in the transaction. @@ -145,13 +148,13 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/client/tx_config.go#L33-L5 As there are currently two sign modes for signing transactions, there are also two implementations of `TxBuilder`: -* [wrapper](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/auth/tx/builder.go#L18-L34) for creating transactions for `SIGN_MODE_DIRECT`, -* [StdTxBuilder](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/auth/migrations/legacytx/stdtx_builder.go#L15-L21) for `SIGN_MODE_LEGACY_AMINO_JSON`. +* [wrapper](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/auth/tx/builder.go#L26-L43) for creating transactions for `SIGN_MODE_DIRECT`, +* [StdTxBuilder](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/auth/migrations/legacytx/stdtx_builder.go#L14-L17) for `SIGN_MODE_LEGACY_AMINO_JSON`. -However, the two implementation of `TxBuilder` should be hidden away from end-users, as they should prefer using the overarching `TxConfig` interface: +However, the two implementations of `TxBuilder` should be hidden away from end-users, as they should prefer using the overarching `TxConfig` interface: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/client/tx_config.go#L22-L31 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/client/tx_config.go#L24-L34 ``` `TxConfig` is an app-wide configuration for managing transactions. Most importantly, it holds the information about whether to sign each transaction with `SIGN_MODE_DIRECT` or `SIGN_MODE_LEGACY_AMINO_JSON`. By calling `txBuilder := txConfig.NewTxBuilder()`, a new `TxBuilder` will be created with the appropriate sign mode. @@ -172,9 +175,9 @@ Once the transaction bytes are generated, there are currently three ways of broa #### CLI -Application developers create entry points to the application by creating a [command-line interface](../core/07-cli.md), [gRPC and/or REST interface](../core/06-grpc_rest.md), typically found in the application's `./cmd` folder. These interfaces allow users to interact with the application through command-line. +Application developers create entry points to the application by creating a [command-line interface](./07-cli.md), [gRPC and/or REST interface](./06-grpc_rest.md), typically found in the application's `./cmd` folder. These interfaces allow users to interact with the application through command-line. -For the [command-line interface](../building-modules/09-module-interfaces.md#cli), module developers create subcommands to add as children to the application top-level transaction command `TxCmd`. CLI commands actually bundle all the steps of transaction processing into one simple command: creating messages, generating transactions and broadcasting. For concrete examples, see the [Interacting with a Node](../run-node/02-interact-node.md) section. An example transaction made using CLI looks like: +For the [command-line interface](../../build/building-modules/09-module-interfaces.md#cli), module developers create subcommands to add as children to the application top-level transaction command `TxCmd`. CLI commands actually bundle all the steps of transaction processing into one simple command: creating messages, generating transactions and broadcasting. For concrete examples, see the [Interacting with a Node](../../user/run-node/02-interact-node.md) section. An example transaction made using CLI looks like: ```bash simd tx send $MY_VALIDATOR_ADDRESS $RECIPIENT 1000stake @@ -182,21 +185,21 @@ simd tx send $MY_VALIDATOR_ADDRESS $RECIPIENT 1000stake #### gRPC -[gRPC](https://grpc.io) is the main component for the Cosmos SDK's RPC layer. Its principal usage is in the context of modules' [`Query` services](../building-modules/04-query-services.md). However, the Cosmos SDK also exposes a few other module-agnostic gRPC services, one of them being the `Tx` service: +[gRPC](https://grpc.io) is the main component for the Cosmos SDK's RPC layer. Its principal usage is in the context of modules' [`Query` services](../../build/building-modules/04-query-services.md). However, the Cosmos SDK also exposes a few other module-agnostic gRPC services, one of them being the `Tx` service: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/tx/v1beta1/service.proto +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/proto/cosmos/tx/v1beta1/service.proto ``` The `Tx` service exposes a handful of utility functions, such as simulating a transaction or querying a transaction, and also one method to broadcast transactions. -Examples of broadcasting and simulating a transaction are shown [here](../run-node/03-txs.md#programmatically-with-go). +Examples of broadcasting and simulating a transaction are shown [here](../../user/run-node/03-txs.md#programmatically-with-go). #### REST Each gRPC method has its corresponding REST endpoint, generated using [gRPC-gateway](https://github.com/grpc-ecosystem/grpc-gateway). Therefore, instead of using gRPC, you can also use HTTP to broadcast the same transaction, on the `POST /cosmos/tx/v1beta1/txs` endpoint. -An example can be seen [here](../run-node/03-txs.md#using-rest) +An example can be seen [here](../../user/run-node/03-txs.md#using-rest) #### CometBFT RPC diff --git a/docs/docs/core/02-context.md b/docs/docs/learn/advanced/02-context.md similarity index 72% rename from docs/docs/core/02-context.md rename to docs/docs/learn/advanced/02-context.md index 74e4a7a24f12..0056ec10cc45 100644 --- a/docs/docs/core/02-context.md +++ b/docs/docs/learn/advanced/02-context.md @@ -8,12 +8,10 @@ sidebar_position: 1 The `context` is a data structure intended to be passed from function to function that carries information about the current state of the application. It provides access to a branched storage (a safe branch of the entire state) as well as useful objects and information like `gasMeter`, `block height`, `consensus parameters` and more. ::: -:::note +:::note Pre-requisite Readings -### Pre-requisites Readings - -* [Anatomy of a Cosmos SDK Application](../basics/00-app-anatomy.md) -* [Lifecycle of a Transaction](../basics/01-tx-lifecycle.md) +* [Anatomy of a Cosmos SDK Application](../beginner/00-app-anatomy.md) +* [Lifecycle of a Transaction](../beginner/01-tx-lifecycle.md) ::: @@ -22,26 +20,29 @@ The `context` is a data structure intended to be passed from function to functio The Cosmos SDK `Context` is a custom data structure that contains Go's stdlib [`context`](https://pkg.go.dev/context) as its base, and has many additional types within its definition that are specific to the Cosmos SDK. The `Context` is integral to transaction processing in that it allows modules to easily access their respective [store](./04-store.md#base-layer-kvstores) in the [`multistore`](./04-store.md#multistore) and retrieve transactional context such as the block header and gas meter. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/types/context.go#L17-L44 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/types/context.go#L41-L67 ``` * **Base Context:** The base type is a Go [Context](https://pkg.go.dev/context), which is explained further in the [Go Context Package](#go-context-package) section below. * **Multistore:** Every application's `BaseApp` contains a [`CommitMultiStore`](./04-store.md#multistore) which is provided when a `Context` is created. Calling the `KVStore()` and `TransientStore()` methods allows modules to fetch their respective [`KVStore`](./04-store.md#base-layer-kvstores) using their unique `StoreKey`. * **Header:** The [header](https://docs.cometbft.com/v0.37/spec/core/data_structures#header) is a Blockchain type. It carries important information about the state of the blockchain, such as block height and proposer of the current block. -* **Header Hash:** The current block header hash, obtained during `abci.RequestBeginBlock`. +* **Header Hash:** The current block header hash, obtained during `abci.FinalizeBlock`. * **Chain ID:** The unique identification number of the blockchain a block pertains to. -* **Transaction Bytes:** The `[]byte` representation of a transaction being processed using the context. Every transaction is processed by various parts of the Cosmos SDK and consensus engine (e.g. CometBFT) throughout its [lifecycle](../basics/01-tx-lifecycle.md), some of which do not have any understanding of transaction types. Thus, transactions are marshaled into the generic `[]byte` type using some kind of [encoding format](./05-encoding.md) such as [Amino](./05-encoding.md). +* **Transaction Bytes:** The `[]byte` representation of a transaction being processed using the context. Every transaction is processed by various parts of the Cosmos SDK and consensus engine (e.g. CometBFT) throughout its [lifecycle](../beginner/01-tx-lifecycle.md), some of which do not have any understanding of transaction types. Thus, transactions are marshaled into the generic `[]byte` type using some kind of [encoding format](./05-encoding.md) such as [Amino](./05-encoding.md). * **Logger:** A `logger` from the CometBFT libraries. Learn more about logs [here](https://docs.cometbft.com/v0.37/core/configuration). Modules call this method to create their own unique module-specific logger. * **VoteInfo:** A list of the ABCI type [`VoteInfo`](https://docs.cometbft.com/master/spec/abci/abci.html#voteinfo), which includes the name of a validator and a boolean indicating whether they have signed the block. -* **Gas Meters:** Specifically, a [`gasMeter`](../basics/04-gas-fees.md#main-gas-meter) for the transaction currently being processed using the context and a [`blockGasMeter`](../basics/04-gas-fees.md#block-gas-meter) for the entire block it belongs to. Users specify how much in fees they wish to pay for the execution of their transaction; these gas meters keep track of how much [gas](../basics/04-gas-fees.md) has been used in the transaction or block so far. If the gas meter runs out, execution halts. +* **Gas Meters:** Specifically, a [`gasMeter`](../beginner/04-gas-fees.md#main-gas-meter) for the transaction currently being processed using the context and a [`blockGasMeter`](../beginner/04-gas-fees.md#block-gas-meter) for the entire block it belongs to. Users specify how much in fees they wish to pay for the execution of their transaction; these gas meters keep track of how much [gas](../beginner/04-gas-fees.md) has been used in the transaction or block so far. If the gas meter runs out, execution halts. * **CheckTx Mode:** A boolean value indicating whether a transaction should be processed in `CheckTx` or `DeliverTx` mode. -* **Min Gas Price:** The minimum [gas](../basics/04-gas-fees.md) price a node is willing to take in order to include a transaction in its block. This price is a local value configured by each node individually, and should therefore **not be used in any functions used in sequences leading to state-transitions**. +* **Min Gas Price:** The minimum [gas](../beginner/04-gas-fees.md) price a node is willing to take in order to include a transaction in its block. This price is a local value configured by each node individually, and should therefore **not be used in any functions used in sequences leading to state-transitions**. * **Consensus Params:** The ABCI type [Consensus Parameters](https://docs.cometbft.com/master/spec/abci/apps.html#consensus-parameters), which specify certain limits for the blockchain, such as maximum gas for a block. * **Event Manager:** The event manager allows any caller with access to a `Context` to emit [`Events`](./08-events.md). Modules may define module specific - `Events` by defining various `Types` and `Attributes` or use the common definitions found in `types/`. Clients can subscribe or query for these `Events`. These `Events` are collected throughout `DeliverTx`, `BeginBlock`, and `EndBlock` and are returned to CometBFT for indexing. For example: + `Events` by defining various `Types` and `Attributes` or use the common definitions found in `types/`. Clients can subscribe or query for these `Events`. These `Events` are collected throughout `FinalizeBlock` and are returned to CometBFT for indexing. * **Priority:** The transaction priority, only relevant in `CheckTx`. * **KV `GasConfig`:** Enables applications to set a custom `GasConfig` for the `KVStore`. * **Transient KV `GasConfig`:** Enables applications to set a custom `GasConfig` for the transiant `KVStore`. +* **StreamingManager:** The streamingManager field provides access to the streaming manager, which allows modules to subscribe to state changes emitted by the blockchain. The streaming manager is used by the state listening API, which is described in [ADR 038](https://docs.cosmos.network/main/architecture/adr-038-state-listening). +* **CometInfo:** A lightweight field that contains information about the current block, such as the block height, time, and hash. This information can be used for validating evidence, providing historical data, and enhancing the user experience. For further details see [here](https://github.com/cosmos/cosmos-sdk/blob/main/core/comet/service.go#L14). +* **HeaderInfo:** The `headerInfo` field contains information about the current block header, such as the chain ID, gas limit, and timestamp. For further details see [here](https://github.com/cosmos/cosmos-sdk/blob/main/core/header/service.go#L14). ## Go Context Package @@ -61,7 +62,7 @@ explicitly pass a context `ctx` as the first argument of a process. ## Store branching -The `Context` contains a `MultiStore`, which allows for branchinig and caching functionality using `CacheMultiStore` +The `Context` contains a `MultiStore`, which allows for branching and caching functionality using `CacheMultiStore` (queries in `CacheMultiStore` are cached to avoid future round trips). Each `KVStore` is branched in a safe and isolated ephemeral storage. Processes are free to write changes to the `CacheMultiStore`. If a state-transition sequence is performed without issue, the store branch can diff --git a/docs/docs/core/03-node.md b/docs/docs/learn/advanced/03-node.md similarity index 84% rename from docs/docs/core/03-node.md rename to docs/docs/learn/advanced/03-node.md index 67eb018caa52..47b691b32c6b 100644 --- a/docs/docs/core/03-node.md +++ b/docs/docs/learn/advanced/03-node.md @@ -8,11 +8,9 @@ sidebar_position: 1 The main endpoint of a Cosmos SDK application is the daemon client, otherwise known as the full-node client. The full-node runs the state-machine, starting from a genesis file. It connects to peers running the same client in order to receive and relay transactions, block proposals and signatures. The full-node is constituted of the application, defined with the Cosmos SDK, and of a consensus engine connected to the application via the ABCI. ::: -:::note +:::note Pre-requisite Readings -### Pre-requisite Readings - -* [Anatomy of an SDK application](../basics/00-app-anatomy.md) +* [Anatomy of an SDK application](../beginner/00-app-anatomy.md) ::: @@ -23,10 +21,10 @@ The full-node client of any Cosmos SDK application is built by running a `main` In general, developers will implement the `main.go` function with the following structure: * First, an [`encodingCodec`](./05-encoding.md) is instantiated for the application. -* Then, the `config` is retrieved and config parameters are set. This mainly involves setting the Bech32 prefixes for [addresses](../basics/03-accounts.md#addresses). +* Then, the `config` is retrieved and config parameters are set. This mainly involves setting the Bech32 prefixes for [addresses](../beginner/03-accounts.md#addresses). ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/types/config.go#L14-L29 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/types/config.go#L14-L29 ``` * Using [cobra](https://github.com/spf13/cobra), the root command of the full-node client is created. After that, all the custom commands of the application are added using the `AddCommand()` method of `rootCmd`. @@ -40,7 +38,7 @@ https://github.com/cometbft/cometbft/blob/v0.37.0/libs/cli/setup.go#L74-L78 See an example of `main` function from the `simapp` application, the Cosmos SDK's application for demo purposes: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/simd/main.go +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/simd/main.go ``` ## `start` command @@ -62,25 +60,25 @@ The flow of the `start` command is pretty straightforward. First, it retrieves t With the `db`, the `start` command creates a new instance of the application using an `appCreator` function: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/server/start.go#L220 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/server/start.go#L220 ``` Note that an `appCreator` is a function that fulfills the `AppCreator` signature: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/server/types/app.go#L64-L66 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/server/types/app.go#L68 ``` -In practice, the [constructor of the application](../basics/00-app-anatomy.md#constructor-function) is passed as the `appCreator`. +In practice, the [constructor of the application](../beginner/00-app-anatomy.md#constructor-function) is passed as the `appCreator`. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/simd/cmd/root.go#L254-L268 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/simd/cmd/root_v2.go#L294-L308 ``` Then, the instance of `app` is used to instantiate a new CometBFT node: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/server/start.go#L336-L348 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/server/start.go#L341-L378 ``` The CometBFT node can be created with `app` because the latter satisfies the [`abci.Application` interface](https://github.com/cometbft/cometbft/blob/v0.37.0/abci/types/application.go#L9-L35) (given that `app` extends [`baseapp`](./00-baseapp.md)). As part of the `node.New` method, CometBFT makes sure that the height of the application (i.e. number of blocks since genesis) is equal to the height of the CometBFT node. The difference between these two heights should always be negative or null. If it is strictly negative, `node.New` will replay blocks until the height of the application reaches the height of the CometBFT node. Finally, if the height of the application is `0`, the CometBFT node will call [`InitChain`](./00-baseapp.md#initchain) on the application to initialize the state from the genesis file. @@ -88,11 +86,11 @@ The CometBFT node can be created with `app` because the latter satisfies the [`a Once the CometBFT node is instantiated and in sync with the application, the node can be started: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/server/start.go#L350-L352 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/server/start.go#L350-L352 ``` Upon starting, the node will bootstrap its RPC and P2P server and start dialing peers. During handshake with its peers, if the node realizes they are ahead, it will query all the blocks sequentially in order to catch up. Then, it will wait for new block proposals and block signatures from validators in order to make progress. ## Other commands -To discover how to concretely run a node and interact with it, please refer to our [Running a Node, API and CLI](../run-node/01-run-node.md) guide. +To discover how to concretely run a node and interact with it, please refer to our [Running a Node, API and CLI](../../user/run-node/01-run-node.md) guide. diff --git a/docs/docs/core/04-store.md b/docs/docs/learn/advanced/04-store.md similarity index 79% rename from docs/docs/core/04-store.md rename to docs/docs/learn/advanced/04-store.md index 239cec484af5..1419b54ae90d 100644 --- a/docs/docs/core/04-store.md +++ b/docs/docs/learn/advanced/04-store.md @@ -8,17 +8,15 @@ sidebar_position: 1 A store is a data structure that holds the state of the application. ::: -:::note +:::note Pre-requisite Readings -### Pre-requisite Readings - -* [Anatomy of a Cosmos SDK application](../basics/00-app-anatomy.md) +* [Anatomy of a Cosmos SDK application](../beginner/00-app-anatomy.md) ::: ## Introduction to Cosmos SDK Stores -The Cosmos SDK comes with a large set of stores to persist the state of applications. By default, the main store of Cosmos SDK applications is a `multistore`, i.e. a store of stores. Developers can add any number of key-value stores to the multistore, depending on their application needs. The multistore exists to support the modularity of the Cosmos SDK, as it lets each module declare and manage their own subset of the state. Key-value stores in the multistore can only be accessed with a specific capability `key`, which is typically held in the [`keeper`](../building-modules/06-keeper.md) of the module that declared the store. +The Cosmos SDK comes with a large set of stores to persist the state of applications. By default, the main store of Cosmos SDK applications is a `multistore`, i.e. a store of stores. Developers can add any number of key-value stores to the multistore, depending on their application needs. The multistore exists to support the modularity of the Cosmos SDK, as it lets each module declare and manage their own subset of the state. Key-value stores in the multistore can only be accessed with a specific capability `key`, which is typically held in the [`keeper`](../../build/building-modules/06-keeper.md) of the module that declared the store. ```text +-----------------------------------------------------+ @@ -65,13 +63,13 @@ The Cosmos SDK comes with a large set of stores to persist the state of applicat At its very core, a Cosmos SDK `store` is an object that holds a `CacheWrapper` and has a `GetStoreType()` method: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/store/types/store.go#L15-L18 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/store/types/store.go#L15-L18 ``` The `GetStoreType` is a simple method that returns the type of store, whereas a `CacheWrapper` is a simple interface that implements store read caching and write branching through `Write` method: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/store/types/store.go#L260-L284 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/store/types/store.go#L287-L320 ``` Branching and cache is used ubiquitously in the Cosmos SDK and required to be implemented on every store type. A storage branch creates an isolated, ephemeral branch of a store that can be passed around and updated without affecting the main underlying store. This is used to trigger temporary state-transitions that may be reverted later should an error occur. Read more about it in [context](./02-context.md#Store-branching) @@ -81,13 +79,13 @@ Branching and cache is used ubiquitously in the Cosmos SDK and required to be im A commit store is a store that has the ability to commit changes made to the underlying tree or db. The Cosmos SDK differentiates simple stores from commit stores by extending the basic store interfaces with a `Committer`: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/store/types/store.go#L28-L33 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/store/types/store.go#L32-L37 ``` The `Committer` is an interface that defines methods to persist changes to disk: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/store/types/store.go#L20-L27 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/store/types/store.go#L20-L30 ``` The `CommitID` is a deterministic commit of the state tree. Its hash is returned to the underlying consensus engine and stored in the block header. Note that commit store interfaces exist for various purposes, one of which is to make sure not every object can commit the store. As part of the [object-capabilities model](./10-ocap.md) of the Cosmos SDK, only `baseapp` should have the ability to commit stores. For example, this is the reason why the `ctx.KVStore()` method by which modules typically access stores returns a `KVStore` and not a `CommitKVStore`. @@ -101,7 +99,7 @@ The Cosmos SDK comes with many types of stores, the most used being [`CommitMult Each Cosmos SDK application holds a multistore at its root to persist its state. The multistore is a store of `KVStores` that follows the `Multistore` interface: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/store/types/store.go#L101-L133 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/store/types/store.go#L123-L155 ``` If tracing is enabled, then branching the multistore will firstly wrap all the underlying `KVStore` in [`TraceKv.Store`](#tracekv-store). @@ -111,23 +109,23 @@ If tracing is enabled, then branching the multistore will firstly wrap all the u The main type of `Multistore` used in the Cosmos SDK is `CommitMultiStore`, which is an extension of the `Multistore` interface: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/store/types/store.go#L141-L200 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/store/types/store.go#L164-L227 ``` As for concrete implementation, the [`rootMulti.Store`] is the go-to implementation of the `CommitMultiStore` interface. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/store/rootmulti/store.go#L53-L77 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/store/rootmulti/store.go#L53-L77 ``` The `rootMulti.Store` is a base-layer multistore built around a `db` on top of which multiple `KVStores` can be mounted, and is the default multistore store used in [`baseapp`](./00-baseapp.md). ### CacheMultiStore -Whenever the `rootMulti.Store` needs to be branched, a [`cachemulti.Store`](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/store/cachemulti/store.go) is used. +Whenever the `rootMulti.Store` needs to be branched, a [`cachemulti.Store`](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/store/cachemulti/store.go) is used. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/store/cachemulti/store.go#L19-L33 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/store/cachemulti/store.go#L19-L33 ``` `cachemulti.Store` branches all substores (creates a virtual store for each substore) in its constructor and hold them in `Store.stores`. Moreover caches all read queries. `Store.GetKVStore()` returns the store from `Store.stores`, and `Store.Write()` recursively calls `CacheWrap.Write()` on all the substores. @@ -138,18 +136,18 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/store/cachemulti/store.go# A `KVStore` is a simple key-value store used to store and retrieve data. A `CommitKVStore` is a `KVStore` that also implements a `Committer`. By default, stores mounted in `baseapp`'s main `CommitMultiStore` are `CommitKVStore`s. The `KVStore` interface is primarily used to restrict modules from accessing the committer. -Individual `KVStore`s are used by modules to manage a subset of the global state. `KVStores` can be accessed by objects that hold a specific key. This `key` should only be exposed to the [`keeper`](../building-modules/06-keeper.md) of the module that defines the store. +Individual `KVStore`s are used by modules to manage a subset of the global state. `KVStores` can be accessed by objects that hold a specific key. This `key` should only be exposed to the [`keeper`](../../build/building-modules/06-keeper.md) of the module that defines the store. -`CommitKVStore`s are declared by proxy of their respective `key` and mounted on the application's [multistore](#multistore) in the [main application file](../basics/00-app-anatomy.md#core-application-file). In the same file, the `key` is also passed to the module's `keeper` that is responsible for managing the store. +`CommitKVStore`s are declared by proxy of their respective `key` and mounted on the application's [multistore](#multistore) in the [main application file](../beginner/00-app-anatomy.md#core-application-file). In the same file, the `key` is also passed to the module's `keeper` that is responsible for managing the store. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/store/types/store.go#L206-L239 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/store/types/store.go#L229-L266 ``` Apart from the traditional `Get` and `Set` methods, that a `KVStore` must implement via the `BasicKVStore` interface; a `KVStore` must provide an `Iterator(start, end)` method which returns an `Iterator` object. It is used to iterate over a range of keys, typically keys that share a common prefix. Below is an example from the bank's module keeper, used to iterate over all account balances: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/bank/keeper/view.go#L115-L132 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/bank/keeper/view.go#L125-L140 ``` ### `IAVL` Store @@ -157,7 +155,7 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/bank/keeper/view.go#L115 The default implementation of `KVStore` and `CommitKVStore` used in `baseapp` is the `iavl.Store`. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/store/iavl/store.go#L37-L41 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/store/iavl/store.go#L35-L40 ``` `iavl` stores are based around an [IAVL Tree](https://github.com/cosmos/iavl), a self-balancing binary tree which guarantees that: @@ -170,10 +168,10 @@ The documentation on the IAVL Tree is located [here](https://github.com/cosmos/i ### `DbAdapter` Store -`dbadapter.Store` is a adapter for `dbm.DB` making it fulfilling the `KVStore` interface. +`dbadapter.Store` is an adapter for `dbm.DB` making it fulfilling the `KVStore` interface. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/store/dbadapter/store.go#L13-L16 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/store/dbadapter/store.go#L13-L16 ``` `dbadapter.Store` embeds `dbm.DB`, meaning most of the `KVStore` interface functions are implemented. The other functions (mostly miscellaneous) are manually implemented. This store is primarily used within [Transient Stores](#transient-store) @@ -183,7 +181,7 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/store/dbadapter/store.go#L `Transient.Store` is a base-layer `KVStore` which is automatically discarded at the end of the block. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/store/transient/store.go#L16-L19 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/store/transient/store.go#L16-L19 ``` `Transient.Store` is a `dbadapter.Store` with a `dbm.NewMemDB()`. All `KVStore` methods are reused. When `Store.Commit()` is called, a new `dbadapter.Store` is assigned, discarding previous reference and making it garbage collected. @@ -191,13 +189,13 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/store/transient/store.go#L This type of store is useful to persist information that is only relevant per-block. One example would be to store parameter changes (i.e. a bool set to `true` if a parameter changed in a block). ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/params/types/subspace.go#L21-L31 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/params/types/subspace.go#L21-L31 ``` Transient stores are typically accessed via the [`context`](./02-context.md) via the `TransientStore()` method: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/types/context.go#L284-L287 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/types/context.go#L340-L343 ``` ## KVStore Wrappers @@ -207,7 +205,7 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/types/context.go#L284-L287 `cachekv.Store` is a wrapper `KVStore` which provides buffered writing / cached reading functionalities over the underlying `KVStore`. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/store/cachekv/store.go#L26-L36 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/store/cachekv/store.go#L26-L36 ``` This is the type used whenever an IAVL Store needs to be branched to create an isolated store (typically when we need to mutate a state that might be reverted later). @@ -226,29 +224,29 @@ This is the type used whenever an IAVL Store needs to be branched to create an i ### `GasKv` Store -Cosmos SDK applications use [`gas`](../basics/04-gas-fees.md) to track resources usage and prevent spam. [`GasKv.Store`](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/store/gaskv/store.go) is a `KVStore` wrapper that enables automatic gas consumption each time a read or write to the store is made. It is the solution of choice to track storage usage in Cosmos SDK applications. +Cosmos SDK applications use [`gas`](../beginner/04-gas-fees.md) to track resources usage and prevent spam. [`GasKv.Store`](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/store/gaskv/store.go) is a `KVStore` wrapper that enables automatic gas consumption each time a read or write to the store is made. It is the solution of choice to track storage usage in Cosmos SDK applications. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/store/gaskv/store.go#L11-L17 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/store/gaskv/store.go#L11-L17 ``` When methods of the parent `KVStore` are called, `GasKv.Store` automatically consumes appropriate amount of gas depending on the `Store.gasConfig`: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/store/types/gas.go#L219-L228 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/store/types/gas.go#L219-L228 ``` By default, all `KVStores` are wrapped in `GasKv.Stores` when retrieved. This is done in the `KVStore()` method of the [`context`](./02-context.md): ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/types/context.go#L279-L282 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/types/context.go#L335-L338 ``` In this case, the gas configuration set in the `context` is used. The gas configuration can be set using the `WithKVGasConfig` method of the `context`. Otherwise it uses the following default: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/store/types/gas.go#L230-L241 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/store/types/gas.go#L230-L241 ``` ### `TraceKv` Store @@ -256,7 +254,7 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/store/types/gas.go#L230-L2 `tracekv.Store` is a wrapper `KVStore` which provides operation tracing functionalities over the underlying `KVStore`. It is applied automatically by the Cosmos SDK on all `KVStore` if tracing is enabled on the parent `MultiStore`. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/store/tracekv/store.go#L20-L43 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/store/tracekv/store.go#L20-L43 ``` When each `KVStore` methods are called, `tracekv.Store` automatically logs `traceOperation` to the `Store.writer`. `traceOperation.Metadata` is filled with `Store.context` when it is not nil. `TraceContext` is a `map[string]interface{}`. @@ -266,21 +264,21 @@ When each `KVStore` methods are called, `tracekv.Store` automatically logs `trac `prefix.Store` is a wrapper `KVStore` which provides automatic key-prefixing functionalities over the underlying `KVStore`. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/store/prefix/store.go#L15-L21 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/store/prefix/store.go#L15-L21 ``` When `Store.{Get, Set}()` is called, the store forwards the call to its parent, with the key prefixed with the `Store.prefix`. -When `Store.Iterator()` is called, it does not simply prefix the `Store.prefix`, since it does not work as intended. In that case, some of the elements are traversed even they are not starting with the prefix. +When `Store.Iterator()` is called, it does not simply prefix the `Store.prefix`, since it does not work as intended. In that case, some of the elements are traversed even if they are not starting with the prefix. ### `ListenKv` Store `listenkv.Store` is a wrapper `KVStore` which provides state listening capabilities over the underlying `KVStore`. It is applied automatically by the Cosmos SDK on any `KVStore` whose `StoreKey` is specified during state streaming configuration. -Additional information about state streaming configuration can be found in the [store/streaming/README.md](https://github.com/cosmos/cosmos-sdk/tree/v0.47.0-rc1/store/streaming). +Additional information about state streaming configuration can be found in the [store/streaming/README.md](https://github.com/cosmos/cosmos-sdk/tree/v0.50.0-alpha.0/store/streaming). ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/store/listenkv/store.go#L11-L18 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/store/listenkv/store.go#L11-L18 ``` When `KVStore.Set` or `KVStore.Delete` methods are called, `listenkv.Store` automatically writes the operations to the set of `Store.listeners`. diff --git a/docs/docs/core/05-encoding.md b/docs/docs/learn/advanced/05-encoding.md similarity index 69% rename from docs/docs/core/05-encoding.md rename to docs/docs/learn/advanced/05-encoding.md index f1b0586cfe9f..9ddc21d104e4 100644 --- a/docs/docs/core/05-encoding.md +++ b/docs/docs/learn/advanced/05-encoding.md @@ -8,11 +8,9 @@ sidebar_position: 1 While encoding in the Cosmos SDK used to be mainly handled by `go-amino` codec, the Cosmos SDK is moving towards using `gogoprotobuf` for both state and client-side encoding. ::: -:::note +:::note Pre-requisite Readings -### Pre-requisite Readings - -* [Anatomy of a Cosmos SDK application](../basics/00-app-anatomy.md) +* [Anatomy of a Cosmos SDK application](../beginner/00-app-anatomy.md) ::: @@ -44,58 +42,12 @@ In the `codec` package, there exists two core interfaces, `BinaryCodec` and `JSO where the former encapsulates the current Amino interface except it operates on types implementing the latter instead of generic `interface{}` types. -In addition, there exists two implementations of `Codec`. The first being -`AminoCodec`, where both binary and JSON serialization is handled via Amino. The -second being `ProtoCodec`, where both binary and JSON serialization is handled -via Protobuf. - -This means that modules may use Amino or Protobuf encoding, but the types must +The `ProtoCodec`, where both binary and JSON serialization is handled +via Protobuf. This means that modules may use Protobuf encoding, but the types must implement `ProtoMarshaler`. If modules wish to avoid implementing this interface -for their types, they may use an Amino codec directly. - -### Amino - -Every module uses an Amino codec to serialize types and interfaces. This codec typically -has types and interfaces registered in that module's domain only (e.g. messages), -but there are exceptions like `x/gov`. Each module exposes a `RegisterLegacyAminoCodec` function -that allows a user to provide a codec and have all the types registered. An application -will call this method for each necessary module. - -Where there is no protobuf-based type definition for a module (see below), Amino -is used to encode and decode raw wire bytes to the concrete type or interface: - -```go -bz := keeper.cdc.MustMarshal(typeOrInterface) -keeper.cdc.MustUnmarshal(bz, &typeOrInterface) -``` - -Note, there are length-prefixed variants of the above functionality and this is -typically used for when the data needs to be streamed or grouped together -(e.g. `ResponseDeliverTx.Data`) - -#### Authz authorizations and Gov/Group proposals - -Since authz's `MsgExec` and `MsgGrant` message types, as well as gov's and group's `MsgSubmitProposal`, can contain different messages instances, it is important that developers -add the following code inside the `init` method of their module's `codec.go` file: - -```go -import ( - authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec" - govcodec "github.com/cosmos/cosmos-sdk/x/gov/codec" - groupcodec "github.com/cosmos/cosmos-sdk/x/group/codec" -) +for their types, this is autogenerated via [buf](https://buf.build/) -init() { - // Register all Amino interfaces and concrete types on the authz and gov Amino codec so that this can later be - // used to properly serialize MsgGrant, MsgExec and MsgSubmitProposal instances - RegisterLegacyAminoCodec(authzcodec.Amino) - RegisterLegacyAminoCodec(govcodec.Amino) - RegisterLegacyAminoCodec(groupcodec.Amino) -} -``` - -This will allow the `x/authz` module to properly serialize and de-serializes `MsgExec` instances using Amino, -which is required when signing this kind of messages using a Ledger. +If modules use [Collections](../../build/packages/02-collections.md), encoding and decoding are handled, marshal and unmarshal should not be handled manually unless for specific cases identified by the developer. ### Gogoproto @@ -126,24 +78,24 @@ the consensus engine accepts only transactions in the form of raw bytes. * The `TxDecoder` object performs the decoding. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/types/tx_msg.go#L76-L80 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/types/tx_msg.go#L91-L95 ``` -A standard implementation of both these objects can be found in the [`auth/tx` module](../modules/auth/tx/README.md): +A standard implementation of both these objects can be found in the [`auth/tx` module](../../build/modules/auth/2-tx.md): ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/auth/tx/decoder.go +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/auth/tx/decoder.go ``` ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/auth/tx/encoder.go +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/auth/tx/encoder.go ``` -See [ADR-020](../architecture/adr-020-protobuf-transaction-encoding.md) for details of how a transaction is encoded. +See [ADR-020](../../architecture/adr-020-protobuf-transaction-encoding.md) for details of how a transaction is encoded. ### Interface Encoding and Usage of `Any` -The Protobuf DSL is strongly typed, which can make inserting variable-typed fields difficult. Imagine we want to create a `Profile` protobuf message that serves as a wrapper over [an account](../basics/03-accounts.md): +The Protobuf DSL is strongly typed, which can make inserting variable-typed fields difficult. Imagine we want to create a `Profile` protobuf message that serves as a wrapper over [an account](../beginner/03-accounts.md): ```protobuf message Profile { @@ -154,13 +106,13 @@ message Profile { } ``` -In this `Profile` example, we hardcoded `account` as a `BaseAccount`. However, there are several other types of [user accounts related to vesting](../modules/auth/1-vesting.md), such as `BaseVestingAccount` or `ContinuousVestingAccount`. All of these accounts are different, but they all implement the `AccountI` interface. How would you create a `Profile` that allows all these types of accounts with an `account` field that accepts an `AccountI` interface? +In this `Profile` example, we hardcoded `account` as a `BaseAccount`. However, there are several other types of [user accounts related to vesting](../../build/modules/auth/1-vesting.md), such as `BaseVestingAccount` or `ContinuousVestingAccount`. All of these accounts are different, but they all implement the `AccountI` interface. How would you create a `Profile` that allows all these types of accounts with an `account` field that accepts an `AccountI` interface? ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/auth/types/account.go#L307-L330 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/types/account.go#L15-L32 ``` -In [ADR-019](../architecture/adr-019-protobuf-state-encoding.md), it has been decided to use [`Any`](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/any.proto)s to encode interfaces in protobuf. An `Any` contains an arbitrary serialized message as bytes, along with a URL that acts as a globally unique identifier for and resolves to that message's type. This strategy allows us to pack arbitrary Go types inside protobuf messages. Our new `Profile` then looks like: +In [ADR-019](../../architecture/adr-019-protobuf-state-encoding.md), it has been decided to use [`Any`](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/any.proto)s to encode interfaces in protobuf. An `Any` contains an arbitrary serialized message as bytes, along with a URL that acts as a globally unique identifier for and resolves to that message's type. This strategy allows us to pack arbitrary Go types inside protobuf messages. Our new `Profile` then looks like: ```protobuf message Profile { @@ -196,7 +148,7 @@ bz, err := cdc.Marshal(profile) jsonBz, err := cdc.MarshalJSON(profile) ``` -To summarize, to encode an interface, you must 1/ pack the interface into an `Any` and 2/ marshal the `Any`. For convenience, the Cosmos SDK provides a `MarshalInterface` method to bundle these two steps. Have a look at [a real-life example in the x/auth module](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/auth/keeper/keeper.go#L240-L243). +To summarize, to encode an interface, you must 1/ pack the interface into an `Any` and 2/ marshal the `Any`. For convenience, the Cosmos SDK provides a `MarshalInterface` method to bundle these two steps. Have a look at [a real-life example in the x/auth module](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/auth/keeper/keeper.go#L240-L243). The reverse operation of retrieving the concrete Go type from inside an `Any`, called "unpacking", is done with the `GetCachedValue()` on `Any`. @@ -210,7 +162,7 @@ err := cdc.Unmarshal(profilebz, &myProfile) fmt.Printf("%T\n", myProfile.Account) // Prints "Any" fmt.Printf("%T\n", myProfile.Account.GetCachedValue()) // Prints "BaseAccount", "ContinuousVestingAccount" or whatever was initially packed in the Any. -// Get the address of the accountt. +// Get the address of the account. accAddr := myProfile.Account.GetCachedValue().(AccountI).GetAddress() ``` @@ -229,7 +181,7 @@ func (p *Profile) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { The `UnpackInterfaces` gets called recursively on all structs implementing this method, to allow all `Any`s to have their `GetCachedValue()` correctly populated. -For more information about interface encoding, and especially on `UnpackInterfaces` and how the `Any`'s `type_url` gets resolved using the `InterfaceRegistry`, please refer to [ADR-019](../architecture/adr-019-protobuf-state-encoding.md). +For more information about interface encoding, and especially on `UnpackInterfaces` and how the `Any`'s `type_url` gets resolved using the `InterfaceRegistry`, please refer to [ADR-019](../../architecture/adr-019-protobuf-state-encoding.md). #### `Any` Encoding in the Cosmos SDK @@ -237,15 +189,15 @@ The above `Profile` example is a fictive example used for educational purposes. * the `cryptotypes.PubKey` interface for encoding different types of public keys, * the `sdk.Msg` interface for encoding different `Msg`s in a transaction, -* the `AccountI` interface for encodinig different types of accounts (similar to the above example) in the x/auth query responses, -* the `Evidencei` interface for encoding different types of evidences in the x/evidence module, +* the `AccountI` interface for encoding different types of accounts (similar to the above example) in the x/auth query responses, +* the `EvidenceI` interface for encoding different types of evidences in the x/evidence module, * the `AuthorizationI` interface for encoding different types of x/authz authorizations, -* the [`Validator`](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/staking/types/staking.pb.go#L340-L377) struct that contains information about a validator. +* the [`Validator`](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/staking/types/staking.pb.go#L340-L377) struct that contains information about a validator. A real-life example of encoding the pubkey as `Any` inside the Validator struct in x/staking is shown in the following example: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/staking/types/validator.go#L41-L64 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/staking/types/validator.go#L41-L64 ``` #### `Any`'s TypeURL @@ -253,11 +205,13 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/staking/types/validator. When packing a protobuf message inside an `Any`, the message's type is uniquely defined by its type URL, which is the message's fully qualified name prefixed by a `/` (slash) character. In some implementations of `Any`, like the gogoproto one, there's generally [a resolvable prefix, e.g. `type.googleapis.com`](https://github.com/gogo/protobuf/blob/b03c65ea87cdc3521ede29f62fe3ce239267c1bc/protobuf/google/protobuf/any.proto#L87-L91). However, in the Cosmos SDK, we made the decision to not include such prefix, to have shorter type URLs. The Cosmos SDK's own `Any` implementation can be found in `github.com/cosmos/cosmos-sdk/codec/types`. The Cosmos SDK is also switching away from gogoproto to the official `google.golang.org/protobuf` (known as the Protobuf API v2). Its default `Any` implementation also contains the [`type.googleapis.com`](https://github.com/protocolbuffers/protobuf-go/blob/v1.28.1/types/known/anypb/any.pb.go#L266) prefix. To maintain compatibility with the SDK, the following methods from `"google.golang.org/protobuf/types/known/anypb"` should not be used: + * `anypb.New` * `anypb.MarshalFrom` * `anypb.Any#MarshalFrom` Instead, the Cosmos SDK provides helper functions in `"github.com/cosmos/cosmos-proto/anyutil"`, which create an official `anypb.Any` without inserting the prefixes: + * `anyutil.New` * `anyutil.MarshalFrom` @@ -285,14 +239,14 @@ import ( Protobuf types can be defined to encode: * state -* [`Msg`s](../building-modules/02-messages-and-queries.md#messages) -* [Query services](../building-modules/04-query-services.md) -* [genesis](../building-modules/08-genesis.md) +* [`Msg`s](../../build/building-modules/02-messages-and-queries.md#messages) +* [Query services](../../build/building-modules/04-query-services.md) +* [genesis](../../build/building-modules/08-genesis.md) #### Naming and conventions We encourage developers to follow industry guidelines: [Protocol Buffers style guide](https://developers.google.com/protocol-buffers/docs/style) -and [Buf](https://buf.build/docs/style-guide), see more details in [ADR 023](../architecture/adr-023-protobuf-naming.md) +and [Buf](https://buf.build/docs/style-guide), see more details in [ADR 023](../../architecture/adr-023-protobuf-naming.md) ### How to update modules to protobuf encoding @@ -319,7 +273,7 @@ The Cosmos SDK `codec.Codec` interface provides support methods `MarshalInterfac Module should register interfaces using `InterfaceRegistry` which provides a mechanism for registering interfaces: `RegisterInterface(protoName string, iface interface{}, impls ...proto.Message)` and implementations: `RegisterImplementations(iface interface{}, impls ...proto.Message)` that can be safely unpacked from Any, similarly to type registration with Amino: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/codec/types/interface_registry.go#L24-L57 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/codec/types/interface_registry.go#L28-L75 ``` In addition, an `UnpackInterfaces` phase should be introduced to deserialization to unpack interfaces before they're needed. Protobuf types that contain a protobuf `Any` either directly or via one of their members should implement the `UnpackInterfacesMessage` interface: @@ -329,20 +283,3 @@ type UnpackInterfacesMessage interface { UnpackInterfaces(InterfaceUnpacker) error } ``` - -### Custom Stringer - -Using `option (gogoproto.goproto_stringer) = false;` in a proto message definition leads to unexpected behaviour, like returning wrong output or having missing fields in the output. -For that reason a proto Message's `String()` must not be customized, and the `goproto_stringer` option must be avoided. - -A correct YAML output can be obtained through ProtoJSON, using the `JSONToYAML` function: - -```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/codec/yaml.go#L8-L20 -``` - -For example: - -```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/auth/types/account.go#L141-L151 -``` diff --git a/docs/docs/core/06-grpc_rest.md b/docs/docs/learn/advanced/06-grpc_rest.md similarity index 80% rename from docs/docs/core/06-grpc_rest.md rename to docs/docs/learn/advanced/06-grpc_rest.md index 51ca4db40ad7..ee3af79e5d34 100644 --- a/docs/docs/core/06-grpc_rest.md +++ b/docs/docs/learn/advanced/06-grpc_rest.md @@ -20,17 +20,21 @@ Each node exposes the following endpoints for users to interact with a node, eac The node also exposes some other endpoints, such as the CometBFT P2P endpoint, or the [Prometheus endpoint](https://docs.cometbft.com/v0.37/core/metrics), which are not directly related to the Cosmos SDK. Please refer to the [CometBFT documentation](https://docs.cometbft.com/v0.37/core/configuration) for more information about these endpoints. ::: +:::note +All endpoints are defaulted to localhost and must be modified to be exposed to the public internet. +::: + ## gRPC Server In the Cosmos SDK, Protobuf is the main [encoding](./encoding) library. This brings a wide range of Protobuf-based tools that can be plugged into the Cosmos SDK. One such tool is [gRPC](https://grpc.io), a modern open-source high performance RPC framework that has decent client support in several languages. -Each module exposes a [Protobuf `Query` service](../building-modules/02-messages-and-queries.md#queries) that defines state queries. The `Query` services and a transaction service used to broadcast transactions are hooked up to the gRPC server via the following function inside the application: +Each module exposes a [Protobuf `Query` service](../../build/building-modules/02-messages-and-queries.md#queries) that defines state queries. The `Query` services and a transaction service used to broadcast transactions are hooked up to the gRPC server via the following function inside the application: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/server/types/app.go#L46-L48 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/server/types/app.go#L46-L48 ``` -Note: It is not possible to expose any [Protobuf `Msg` service](../building-modules/02-messages-and-queries.md#messages) endpoints via gRPC. Transactions must be generated and signed using the CLI or programmatically before they can be broadcasted using gRPC. See [Generating, Signing, and Broadcasting Transactions](../run-node/03-txs.md) for more information. +Note: It is not possible to expose any [Protobuf `Msg` service](../../build/building-modules/02-messages-and-queries.md#messages) endpoints via gRPC. Transactions must be generated and signed using the CLI or programmatically before they can be broadcasted using gRPC. See [Generating, Signing, and Broadcasting Transactions](../../user/run-node/03-txs.md) for more information. The `grpc.Server` is a concrete gRPC server, which spawns and serves all gRPC query requests and a broadcast transaction request. This server can be configured inside `~/.simapp/config/app.toml`: @@ -41,7 +45,7 @@ The `grpc.Server` is a concrete gRPC server, which spawns and serves all gRPC qu `~/.simapp` is the directory where the node's configuration and databases are stored. By default, it's set to `~/.{app_name}`. ::: -Once the gRPC server is started, you can send requests to it using a gRPC client. Some examples are given in our [Interact with the Node](../run-node/02-interact-node.md#using-grpc) tutorial. +Once the gRPC server is started, you can send requests to it using a gRPC client. Some examples are given in our [Interact with the Node](../../user/run-node/02-interact-node.md#using-grpc) tutorial. An overview of all available gRPC endpoints shipped with the Cosmos SDK is [Protobuf documentation](https://buf.build/cosmos/cosmos-sdk). @@ -62,7 +66,7 @@ If, for various reasons, you cannot use gRPC (for example, you are building a we [gRPC-gateway](https://grpc-ecosystem.github.io/grpc-gateway/) is a tool to expose gRPC endpoints as REST endpoints. For each gRPC endpoint defined in a Protobuf `Query` service, the Cosmos SDK offers a REST equivalent. For instance, querying a balance could be done via the `/cosmos.bank.v1beta1.QueryAllBalances` gRPC endpoint, or alternatively via the gRPC-gateway `"/cosmos/bank/v1beta1/balances/{address}"` REST endpoint: both will return the same result. For each RPC method defined in a Protobuf `Query` service, the corresponding REST endpoint is defined as an option: ```protobuf reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/bank/v1beta1/query.proto#L23-L30 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/proto/cosmos/bank/v1beta1/query.proto#L23-L30 ``` For application developers, gRPC-gateway REST routes needs to be wired up to the REST server, this is done by calling the `RegisterGRPCGatewayRoutes` function on the ModuleManager. @@ -71,14 +75,14 @@ For application developers, gRPC-gateway REST routes needs to be wired up to the A [Swagger](https://swagger.io/) (or OpenAPIv2) specification file is exposed under the `/swagger` route on the API server. Swagger is an open specification describing the API endpoints a server serves, including description, input arguments, return types and much more about each endpoint. -Enabling the `/swagger` endpoint is configurable inside `~/.simapp/config/app.toml` via the `api.swagger` field, which is set to true by default. +Enabling the `/swagger` endpoint is configurable inside `~/.simapp/config/app.toml` via the `api.swagger` field, which is set to false by default. For application developers, you may want to generate your own Swagger definitions based on your custom modules. -The Cosmos SDK's [Swagger generation script](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/scripts/protoc-swagger-gen.sh) is a good place to start. +The Cosmos SDK's [Swagger generation script](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/scripts/protoc-swagger-gen.sh) is a good place to start. ## CometBFT RPC -Independently from the Cosmos SDK, CometBFT also exposes a RPC server. This RPC server can be configured by tuning parameters under the `rpc` table in the `~/.simapp/config/config.toml`, the default listening address is `tcp://localhost:26657`. An OpenAPI specification of all CometBFT RPC endpoints is available [here](https://docs.cometbft.com/master/rpc/). +Independently from the Cosmos SDK, CometBFT also exposes a RPC server. This RPC server can be configured by tuning parameters under the `rpc` table in the `~/.simapp/config/config.toml`, the default listening address is `tcp://localhost:26657`. An OpenAPI specification of all CometBFT RPC endpoints is available [here](https://docs.cometbft.com/main/rpc/). Some CometBFT RPC endpoints are directly related to the Cosmos SDK: @@ -86,10 +90,11 @@ Some CometBFT RPC endpoints are directly related to the Cosmos SDK: * any Protobuf fully-qualified service method, such as `/cosmos.bank.v1beta1.Query/AllBalances`. The `data` field should then include the method's request parameter(s) encoded as bytes using Protobuf. * `/app/simulate`: this will simulate a transaction, and return some information such as gas used. * `/app/version`: this will return the application's version. - * `/store/{path}`: this will query the store directly. + * `/store/{storeName}/key`: this will directly query the named store for data associated with the key represented in the `data` parameter. + * `/store/{storeName}/subspace`: this will directly query the named store for key/value pairs in which the key has the value of the `data` parameter as a prefix. * `/p2p/filter/addr/{port}`: this will return a filtered list of the node's P2P peers by address port. * `/p2p/filter/id/{id}`: this will return a filtered list of the node's P2P peers by ID. -* `/broadcast_tx_{aync,async,commit}`: these 3 endpoint will broadcast a transaction to other peers. CLI, gRPC and REST expose [a way to broadcast transations](./01-transactions.md#broadcasting-the-transaction), but they all use these 3 CometBFT RPCs under the hood. +* `/broadcast_tx_{sync,async,commit}`: these 3 endpoints will broadcast a transaction to other peers. CLI, gRPC and REST expose [a way to broadcast transactions](./01-transactions.md#broadcasting-the-transaction), but they all use these 3 CometBFT RPCs under the hood. ## Comparison Table diff --git a/docs/docs/core/07-cli.md b/docs/docs/learn/advanced/07-cli.md similarity index 54% rename from docs/docs/core/07-cli.md rename to docs/docs/learn/advanced/07-cli.md index ae3592581279..1420f2e1abc4 100644 --- a/docs/docs/core/07-cli.md +++ b/docs/docs/learn/advanced/07-cli.md @@ -5,7 +5,7 @@ sidebar_position: 1 # Command-Line Interface :::note Synopsis -This document describes how command-line interface (CLI) works on a high-level, for an [**application**](../basics/00-app-anatomy.md). A separate document for implementing a CLI for a Cosmos SDK [**module**](../building-modules/01-intro.md) can be found [here](../building-modules/09-module-interfaces.md#cli). +This document describes how command-line interface (CLI) works on a high-level, for an [**application**](../beginner/00-app-anatomy.md). A separate document for implementing a CLI for a Cosmos SDK [**module**](../../build/building-modules/00-intro.md) can be found [here](../../build/building-modules/09-module-interfaces.md#cli). ::: ## Command-Line Interface @@ -24,12 +24,12 @@ The first four strings specify the command: * The root command for the entire application `simd`. * The subcommand `tx`, which contains all commands that let users create transactions. -* The subcommand `bank` to indicate which module to route the command to ([`x/bank`](../modules/bank/README.md) module in this case). +* The subcommand `bank` to indicate which module to route the command to ([`x/bank`](../../build/modules/bank/README.md) module in this case). * The type of transaction `send`. The next two strings are arguments: the `from_address` the user wishes to send from, the `to_address` of the recipient, and the `amount` they want to send. Finally, the last few strings of the command are optional flags to indicate how much the user is willing to pay in fees (calculated using the amount of gas used to execute the transaction and the gas prices provided by the user). -The CLI interacts with a [node](../core/03-node.md) to handle this command. The interface itself is defined in a `main.go` file. +The CLI interacts with a [node](./03-node.md) to handle this command. The interface itself is defined in a `main.go` file. ### Building the CLI @@ -37,13 +37,13 @@ The `main.go` file needs to have a `main()` function that creates a root command * **setting configurations** by reading in configuration files (e.g. the Cosmos SDK config file). * **adding any flags** to it, such as `--chain-id`. -* **instantiating the `codec`** by calling the application's `MakeCodec()` function (called `MakeTestEncodingConfig` in `simapp`). The [`codec`](../core/05-encoding.md) is used to encode and decode data structures for the application - stores can only persist `[]byte`s so the developer must define a serialization format for their data structures or use the default, Protobuf. +* **instantiating the `codec`** by injecting the application codecs. The [`codec`](./05-encoding.md) is used to encode and decode data structures for the application - stores can only persist `[]byte`s so the developer must define a serialization format for their data structures or use the default, Protobuf. * **adding subcommand** for all the possible user interactions, including [transaction commands](#transaction-commands) and [query commands](#query-commands). The `main()` function finally creates an executor and [execute](https://pkg.go.dev/github.com/spf13/cobra#Command.Execute) the root command. See an example of `main()` function from the `simapp` application: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/simd/main.go#L12-L24 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/simd/main.go#L12-L24 ``` The rest of the document will detail what needs to be implemented for each step and include smaller portions of code from the `simapp` CLI files. @@ -56,88 +56,104 @@ Every application CLI first constructs a root command, then adds functionality b The root command (called `rootCmd`) is what the user first types into the command line to indicate which application they wish to interact with. The string used to invoke the command (the "Use" field) is typically the name of the application suffixed with `-d`, e.g. `simd` or `gaiad`. The root command typically includes the following commands to support basic functionality in the application. -* **Status** command from the Cosmos SDK rpc client tools, which prints information about the status of the connected [`Node`](../core/03-node.md). The Status of a node includes `NodeInfo`,`SyncInfo` and `ValidatorInfo`. -* **Keys** [commands](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/client/keys) from the Cosmos SDK client tools, which includes a collection of subcommands for using the key functions in the Cosmos SDK crypto tools, including adding a new key and saving it to the keyring, listing all public keys stored in the keyring, and deleting a key. For example, users can type `simd keys add ` to add a new key and save an encrypted copy to the keyring, using the flag `--recover` to recover a private key from a seed phrase or the flag `--multisig` to group multiple keys together to create a multisig key. For full details on the `add` key command, see the code [here](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/client/keys/add.go). For more details about usage of `--keyring-backend` for storage of key credentials look at the [keyring docs](../run-node/00-keyring.md). +* **Status** command from the Cosmos SDK rpc client tools, which prints information about the status of the connected [`Node`](./03-node.md). The Status of a node includes `NodeInfo`,`SyncInfo` and `ValidatorInfo`. +* **Keys** [commands](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/client/keys) from the Cosmos SDK client tools, which includes a collection of subcommands for using the key functions in the Cosmos SDK crypto tools, including adding a new key and saving it to the keyring, listing all public keys stored in the keyring, and deleting a key. For example, users can type `simd keys add ` to add a new key and save an encrypted copy to the keyring, using the flag `--recover` to recover a private key from a seed phrase or the flag `--multisig` to group multiple keys together to create a multisig key. For full details on the `add` key command, see the code [here](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/client/keys/add.go). For more details about usage of `--keyring-backend` for storage of key credentials look at the [keyring docs](../../user/run-node/00-keyring.md). * **Server** commands from the Cosmos SDK server package. These commands are responsible for providing the mechanisms necessary to start an ABCI CometBFT application and provides the CLI framework (based on [cobra](https://github.com/spf13/cobra)) necessary to fully bootstrap an application. The package exposes two core functions: `StartCmd` and `ExportCmd` which creates commands to start the application and export state respectively. -Learn more [here](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/server). +Learn more [here](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/server). * [**Transaction**](#transaction-commands) commands. * [**Query**](#query-commands) commands. Next is an example `rootCmd` function from the `simapp` application. It instantiates the root command, adds a [*persistent* flag](#flags) and `PreRun` function to be run before every execution, and adds all of the necessary subcommands. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/simd/cmd/root.go#L38-L92 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/simd/cmd/root_v2.go#L47-L130 ``` +:::tip +Use the `EnhanceRootCommand()` from the AutoCLI options to automatically add auto-generated commands from the modules to the root command. +Additionnally it adds all manually defined modules commands (`tx` and `query`) as well. +Read more about [AutoCLI](https://docs.cosmos.network/main/core/autocli) in its dedicated section. +::: + `rootCmd` has a function called `initAppConfig()` which is useful for setting the application's custom configs. By default app uses CometBFT app config template from Cosmos SDK, which can be over-written via `initAppConfig()`. Here's an example code to override default `app.toml` template. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/simd/cmd/root.go#L106-L161 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/simd/cmd/root_v2.go#L144-L199 ``` -The `initAppConfig()` also allows overriding the default Cosmos SDK's [server config](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/server/config/config.go#L235). One example is the `min-gas-prices` config, which defines the minimum gas prices a validator is willing to accept for processing a transaction. By default, the Cosmos SDK sets this parameter to `""` (empty string), which forces all validators to tweak their own `app.toml` and set a non-empty value, or else the node will halt on startup. This might not be the best UX for validators, so the chain developer can set a default `app.toml` value for validators inside this `initAppConfig()` function. +The `initAppConfig()` also allows overriding the default Cosmos SDK's [server config](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/server/config/config.go#L235). One example is the `min-gas-prices` config, which defines the minimum gas prices a validator is willing to accept for processing a transaction. By default, the Cosmos SDK sets this parameter to `""` (empty string), which forces all validators to tweak their own `app.toml` and set a non-empty value, or else the node will halt on startup. This might not be the best UX for validators, so the chain developer can set a default `app.toml` value for validators inside this `initAppConfig()` function. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/simd/cmd/root.go#L126-L142 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/simd/cmd/root_v2.go#L164-L180 ``` The root-level `status` and `keys` subcommands are common across most applications and do not interact with application state. The bulk of an application's functionality - what users can actually *do* with it - is enabled by its `tx` and `query` commands. ### Transaction Commands -[Transactions](./01-transactions.md) are objects wrapping [`Msg`s](../building-modules/02-messages-and-queries.md#messages) that trigger state changes. To enable the creation of transactions using the CLI interface, a function `txCommand` is generally added to the `rootCmd`: +[Transactions](./01-transactions.md) are objects wrapping [`Msg`s](../../build/building-modules/02-messages-and-queries.md#messages) that trigger state changes. To enable the creation of transactions using the CLI interface, a function `txCommand` is generally added to the `rootCmd`: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/simd/cmd/root.go#L177-L184 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/simd/cmd/root_v2.go#L222-L229 ``` This `txCommand` function adds all the transaction available to end-users for the application. This typically includes: -* **Sign command** from the [`auth`](../modules/auth/README.md) module that signs messages in a transaction. To enable multisig, add the `auth` module's `MultiSign` command. Since every transaction requires some sort of signature in order to be valid, the signing command is necessary for every application. +* **Sign command** from the [`auth`](../../build/modules/auth/README.md) module that signs messages in a transaction. To enable multisig, add the `auth` module's `MultiSign` command. Since every transaction requires some sort of signature in order to be valid, the signing command is necessary for every application. * **Broadcast command** from the Cosmos SDK client tools, to broadcast transactions. -* **All [module transaction commands](../building-modules/09-module-interfaces.md#transaction-commands)** the application is dependent on, retrieved by using the [basic module manager's](../building-modules/01-module-manager.md#basic-manager) `AddTxCommands()` function. +* **All [module transaction commands](../../build/building-modules/09-module-interfaces.md#transaction-commands)** the application is dependent on, retrieved by using the [basic module manager's](../../build/building-modules/01-module-manager.md#basic-manager) `AddTxCommands()` function, or enhanced by [AutoCLI](https://docs.cosmos.network/main/core/autocli). Here is an example of a `txCommand` aggregating these subcommands from the `simapp` application: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/simd/cmd/root.go#L227-L251 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/simd/cmd/root_v2.go#L270-L292 ``` +:::tip +When using AutoCLI to generate module transaction commands, `EnhanceRootCommand()` automatically adds the module `tx` command to the root command. +Read more about [AutoCLI](https://docs.cosmos.network/main/core/autocli) in its dedicated section. +::: + ### Query Commands -[**Queries**](../building-modules/02-messages-and-queries.md#queries) are objects that allow users to retrieve information about the application's state. To enable the creation of queries using the CLI interface, a function `queryCommand` is generally added to the `rootCmd`: +[**Queries**](../../build/building-modules/02-messages-and-queries.md#queries) are objects that allow users to retrieve information about the application's state. To enable the creation of queries using the CLI interface, a function `queryCommand` is generally added to the `rootCmd`: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/simd/cmd/root.go#L177-L184 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/simd/cmd/root_v2.go#L222-L229 ``` This `queryCommand` function adds all the queries available to end-users for the application. This typically includes: -* **QueryTx** and/or other transaction query commands] from the `auth` module which allow the user to search for a transaction by inputting its hash, a list of tags, or a block height. These queries allow users to see if transactions have been included in a block. +* **QueryTx** and/or other transaction query commands from the `auth` module which allow the user to search for a transaction by inputting its hash, a list of tags, or a block height. These queries allow users to see if transactions have been included in a block. * **Account command** from the `auth` module, which displays the state (e.g. account balance) of an account given an address. * **Validator command** from the Cosmos SDK rpc client tools, which displays the validator set of a given height. * **Block command** from the Cosmos SDK RPC client tools, which displays the block data for a given height. -* **All [module query commands](../building-modules/09-module-interfaces.md#query-commands)** the application is dependent on, retrieved by using the [basic module manager's](../building-modules/01-module-manager.md#basic-manager) `AddQueryCommands()` function. +* **All [module query commands](../../build/building-modules/09-module-interfaces.md#query-commands)** the application is dependent on, retrieved by using the [basic module manager's](../../build/building-modules/01-module-manager.md#basic-manager) `AddQueryCommands()` function, or enhanced by [AutoCLI](https://docs.cosmos.network/main/core/autocli). Here is an example of a `queryCommand` aggregating subcommands from the `simapp` application: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/simd/cmd/root.go#L204-L225 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/simd/cmd/root_v2.go#L249-L268 ``` +:::tip +When using AutoCLI to generate module query commands, `EnhanceRootCommand()` automatically adds the module `query` command to the root command. +Read more about [AutoCLI](https://docs.cosmos.network/main/core/autocli) in its dedicated section. +::: + ## Flags -Flags are used to modify commands; developers can include them in a `flags.go` file with their CLI. Users can explicitly include them in commands or pre-configure them by inside their [`app.toml`](../run-node/02-interact-node.md#configuring-the-node-using-apptoml). Commonly pre-configured flags include the `--node` to connect to and `--chain-id` of the blockchain the user wishes to interact with. +Flags are used to modify commands; developers can include them in a `flags.go` file with their CLI. Users can explicitly include them in commands or pre-configure them by inside their [`app.toml`](../../user/run-node/01-run-node.md#configuring-the-node-using-apptoml-and-configtoml). Commonly pre-configured flags include the `--node` to connect to and `--chain-id` of the blockchain the user wishes to interact with. A *persistent* flag (as opposed to a *local* flag) added to a command transcends all of its children: subcommands will inherit the configured values for these flags. Additionally, all flags have default values when they are added to commands; some toggle an option off but others are empty values that the user needs to override to create valid commands. A flag can be explicitly marked as *required* so that an error is automatically thrown if the user does not provide a value, but it is also acceptable to handle unexpected missing flags differently. -Flags are added to commands directly (generally in the [module's CLI file](../building-modules/09-module-interfaces.md#flags) where module commands are defined) and no flag except for the `rootCmd` persistent flags has to be added at application level. It is common to add a *persistent* flag for `--chain-id`, the unique identifier of the blockchain the application pertains to, to the root command. Adding this flag can be done in the `main()` function. Adding this flag makes sense as the chain ID should not be changing across commands in this application CLI. +Flags are added to commands directly (generally in the [module's CLI file](../../build/building-modules/09-module-interfaces.md#flags) where module commands are defined) and no flag except for the `rootCmd` persistent flags has to be added at application level. It is common to add a *persistent* flag for `--chain-id`, the unique identifier of the blockchain the application pertains to, to the root command. Adding this flag can be done in the `main()` function. Adding this flag makes sense as the chain ID should not be changing across commands in this application CLI. ## Environment variables -Each flag is bound to it's respecteve named environment variable. Then name of the environment variable consist of two parts - capital case `basename` followed by flag name of the flag. `-` must be substituted with `_`. For example flag `--home` for application with basename `GAIA` is bound to `GAIA_HOME`. It allows reducing the amount of flags typed for routine operations. For example instead of: +Each flag is bound to its respective named environment variable. Then name of the environment variable consist of two parts - capital case `basename` followed by flag name of the flag. `-` must be substituted with `_`. For example flag `--node` for application with basename `GAIA` is bound to `GAIA_NODE`. It allows reducing the amount of flags typed for routine operations. For example instead of: ```shell gaia --home=./ --node= --chain-id="testchain-1" --keyring-backend=test tx ... --from= @@ -158,12 +174,12 @@ gaia tx ... --from= ## Configurations -It is vital that the root command of an application uses `PersistentPreRun()` cobra command property for executing the command, so all child commands have access to the server and client contexts. These contexts are set as their default values initially and maybe modified, scoped to the command, in their respective `PersistentPreRun()` functions. Note that the `client.Context` is typically pre-populated with "default" values that may be useful for all commands to inherit and override if necessary. +It is vital that the root command of an application uses `PersistentPreRun()` cobra command property for executing the command, so all child commands have access to the server and client contexts. These contexts are set as their default values initially and may be modified, scoped to the command, in their respective `PersistentPreRun()` functions. Note that the `client.Context` is typically pre-populated with "default" values that may be useful for all commands to inherit and override if necessary. Here is an example of an `PersistentPreRun()` function from `simapp`: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/simd/cmd/root.go#L63-L86 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/simd/cmd/root_v2.go#L81-L120 ``` The `SetCmdClientContextHandler` call reads persistent flags via `ReadPersistentCommandFlags` which creates a `client.Context` and sets that on the root command's `Context`. @@ -171,7 +187,7 @@ The `SetCmdClientContextHandler` call reads persistent flags via `ReadPersistent The `InterceptConfigsPreRunHandler` call creates a viper literal, default `server.Context`, and a logger and sets that on the root command's `Context`. The `server.Context` will be modified and saved to disk. The internal `interceptConfigs` call reads or creates a CometBFT configuration based on the home path provided. In addition, `interceptConfigs` also reads and loads the application configuration, `app.toml`, and binds that to the `server.Context` viper literal. This is vital so the application can get access to not only the CLI flags, but also to the application configuration values provided by this file. :::tip -When willing to configure which logger is used, do not to use `InterceptConfigsPreRunHandler`, which sets the default SDK logger, but instead use `InterceptConfigsAndCreateContext` and set the server context and the logger manually: +When willing to configure which logger is used, do not use `InterceptConfigsPreRunHandler`, which sets the default SDK logger, but instead use `InterceptConfigsAndCreateContext` and set the server context and the logger manually: ```diff -return server.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig, customCMTConfig) diff --git a/docs/docs/core/08-events.md b/docs/docs/learn/advanced/08-events.md similarity index 80% rename from docs/docs/core/08-events.md rename to docs/docs/learn/advanced/08-events.md index 0f133966e374..410e20ade09d 100644 --- a/docs/docs/core/08-events.md +++ b/docs/docs/learn/advanced/08-events.md @@ -7,11 +7,9 @@ sidebar_position: 1 `Event`s are objects that contain information about the execution of the application. They are mainly used by service providers like block explorers and wallet to track the execution of various messages and index transactions. ::: -:::note +:::note Pre-requisite Readings -### Pre-requisite Readings - -* [Anatomy of a Cosmos SDK application](../basics/00-app-anatomy.md) +* [Anatomy of a Cosmos SDK application](../beginner/00-app-anatomy.md) * [CometBFT Documentation on Events](https://docs.cometbft.com/v0.37/spec/abci/abci++_basic_concepts#events) ::: @@ -35,10 +33,10 @@ An Event contains: To parse the attribute values as strings, make sure to add `'` (single quotes) around each attribute value. ::: -_Typed Events_ are Protobuf-defined [messages](../architecture/adr-032-typed-events.md) used by the Cosmos SDK +_Typed Events_ are Protobuf-defined [messages](../../build/architecture/adr-032-typed-events.md) used by the Cosmos SDK for emitting and querying Events. They are defined in a `event.proto` file, on a **per-module basis** and are read as `proto.Message`. _Legacy Events_ are defined on a **per-module basis** in the module's `/types/events.go` file. -They are triggered from the module's Protobuf [`Msg` service](../building-modules/03-msg-services.md) +They are triggered from the module's Protobuf [`Msg` service](../../build/building-modules/03-msg-services.md) by using the [`EventManager`](#eventmanager). In addition, each module documents its events under in the `Events` sections of its specs (x/{moduleName}/`README.md`). @@ -48,7 +46,7 @@ Lastly, Events are returned to the underlying consensus engine in the response o * [`BeginBlock`](./00-baseapp.md#beginblock) * [`EndBlock`](./00-baseapp.md#endblock) * [`CheckTx`](./00-baseapp.md#checktx) -* [`DeliverTx`](./00-baseapp.md#delivertx) +* [`Transaction Execution`](./00-baseapp.md#transactionexecution) ### Examples @@ -57,18 +55,18 @@ The following examples show how to query Events using the Cosmos SDK. | Event | Description | | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tx.height=23` | Query all transactions at height 23 | -| `message.action='/cosmos.bank.v1beta1.Msg/Send'` | Query all transactions containing a x/bank `Send` [Service `Msg`](../building-modules/03-msg-services.md). Note the `'`s around the value. | +| `message.action='/cosmos.bank.v1beta1.Msg/Send'` | Query all transactions containing a x/bank `Send` [Service `Msg`](../../build/building-modules/03-msg-services.md). Note the `'`s around the value. | | `message.module='bank'` | Query all transactions containing messages from the x/bank module. Note the `'`s around the value. | -| `create_validator.validator='cosmosval1...'` | x/staking-specific Event, see [x/staking SPEC](../modules/staking/README.md). | +| `create_validator.validator='cosmosval1...'` | x/staking-specific Event, see [x/staking SPEC](../../build/modules/staking/README.md). | ## EventManager In Cosmos SDK applications, Events are managed by an abstraction called the `EventManager`. -Internally, the `EventManager` tracks a list of Events for the entire execution flow of a -transaction or `BeginBlock`/`EndBlock`. +Internally, the `EventManager` tracks a list of Events for the entire execution flow of `FinalizeBlock` +(i.e. transaction execution, `BeginBlock`, `EndBlock`). ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/types/events.go#L24-L27 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/types/events.go#L19-L26 ``` The `EventManager` comes with a set of useful methods to manage Events. The method @@ -76,7 +74,7 @@ that is used most by module and application developers is `EmitTypedEvent` or `E an Event in the `EventManager`. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/types/events.go#L53-L62 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/types/events.go#L53-L62 ``` Module developers should handle Event emission via the `EventManager#EmitTypedEvent` or `EventManager#EmitEvent` in each message @@ -87,7 +85,7 @@ the [`Context`](./02-context.md), where Event should be already registered, and **Typed events:** ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/group/keeper/msg_server.go#L88-L91 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/group/keeper/msg_server.go#L95-L97 ``` **Legacy events:** @@ -98,16 +96,9 @@ ctx.EventManager().EmitEvent( ) ``` -Module's `handler` function should also set a new `EventManager` to the `context` to isolate emitted Events per `message`: - -```go -func NewHandler(keeper Keeper) sdk.Handler { - return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { - ctx = ctx.WithEventManager(sdk.NewEventManager()) - switch msg := msg.(type) { -``` +Where the `EventManager` is accessed via the [`Context`](./02-context.md). -See the [`Msg` services](../building-modules/03-msg-services.md) concept doc for a more detailed +See the [`Msg` services](../../build/building-modules/03-msg-services.md) concept doc for a more detailed view on how to typically implement Events and use the `EventManager` in modules. ## Subscribing to Events @@ -134,7 +125,7 @@ The main `eventCategory` you can subscribe to are: These Events are triggered from the `state` package after a block is committed. You can get the full list of Event categories [on the CometBFT Go documentation](https://pkg.go.dev/github.com/cometbft/cometbft/types#pkg-constants). -The `type` and `attribute` value of the `query` allow you to filter the specific Event you are looking for. For example, a `Mint` transaction triggers an Event of type `EventMint` and has an `Id` and an `Owner` as `attributes` (as defined in the [`events.proto` file of the `NFT` module](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/nft/v1beta1/event.proto#L21-L31)). +The `type` and `attribute` value of the `query` allow you to filter the specific Event you are looking for. For example, a `Mint` transaction triggers an Event of type `EventMint` and has an `Id` and an `Owner` as `attributes` (as defined in the [`events.proto` file of the `NFT` module](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/proto/cosmos/nft/v1beta1/event.proto#L21-L31)). Subscribing to this Event would be done like so: @@ -149,9 +140,9 @@ Subscribing to this Event would be done like so: } ``` -where `ownerAddress` is an address following the [`AccAddress`](../basics/03-accounts.md#addresses) format. +where `ownerAddress` is an address following the [`AccAddress`](../beginner/03-accounts.md#addresses) format. -The same way can be used to subscribe to [legacy events](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/bank/types/events.go). +The same way can be used to subscribe to [legacy events](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/bank/types/events.go). ## Default Events diff --git a/docs/docs/core/09-telemetry.md b/docs/docs/learn/advanced/09-telemetry.md similarity index 98% rename from docs/docs/core/09-telemetry.md rename to docs/docs/learn/advanced/09-telemetry.md index 2be2dc680001..c5916544f111 100644 --- a/docs/docs/core/09-telemetry.md +++ b/docs/docs/learn/advanced/09-telemetry.md @@ -18,8 +18,8 @@ To query active metrics (see retention note above) you have to enable API server ## Emitting metrics If telemetry is enabled via configuration, a single global metrics collector is registered via the -[go-metrics](https://github.com/armon/go-metrics) library. This allows emitting and collecting -metrics through simple [API](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/telemetry/wrapper.go). Example: +[go-metrics](https://github.com/hashicorp/go-metrics) library. This allows emitting and collecting +metrics through simple [API](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/telemetry/wrapper.go). Example: ```go func EndBlocker(ctx sdk.Context, k keeper.Keeper) { diff --git a/docs/docs/core/10-ocap.md b/docs/docs/learn/advanced/10-ocap.md similarity index 97% rename from docs/docs/core/10-ocap.md rename to docs/docs/learn/advanced/10-ocap.md index 078b23e58020..c5a472b7f6c4 100644 --- a/docs/docs/core/10-ocap.md +++ b/docs/docs/learn/advanced/10-ocap.md @@ -68,10 +68,9 @@ sumValue := externalModule.ComputeSumValue(*account) In the Cosmos SDK, you can see the application of this principle in simapp. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/app.go#L294-L318 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/app.go ``` The following diagram shows the current dependencies between keepers. ![Keeper dependencies](https://raw.githubusercontent.com/cosmos/cosmos-sdk/release/v0.46.x/docs/uml/svg/keeper_dependencies.svg) - diff --git a/docs/docs/core/11-runtx_middleware.md b/docs/docs/learn/advanced/11-runtx_middleware.md similarity index 85% rename from docs/docs/core/11-runtx_middleware.md rename to docs/docs/learn/advanced/11-runtx_middleware.md index 40210085f8e0..f083a77888e5 100644 --- a/docs/docs/core/11-runtx_middleware.md +++ b/docs/docs/learn/advanced/11-runtx_middleware.md @@ -8,12 +8,12 @@ sidebar_position: 1 Depending on the panic type different handler is used, for instance the default one prints an error log message. Recovery middleware is used to add custom panic recovery for Cosmos SDK application developers. -More context can found in the corresponding [ADR-022](../architecture/adr-022-custom-panic-handling.md) and the implementation in [recovery.go](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/baseapp/recovery.go). +More context can found in the corresponding [ADR-022](../../build/architecture/adr-022-custom-panic-handling.md) and the implementation in [recovery.go](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/baseapp/recovery.go). ## Interface ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/baseapp/recovery.go#L11-L14 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/baseapp/recovery.go#L14-L17 ``` `recoveryObj` is a return value for `recover()` function from the `buildin` Go package. diff --git a/docs/docs/core/12-simulation.md b/docs/docs/learn/advanced/12-simulation.md similarity index 87% rename from docs/docs/core/12-simulation.md rename to docs/docs/learn/advanced/12-simulation.md index ed23f3990444..dfbcddd0d29f 100644 --- a/docs/docs/core/12-simulation.md +++ b/docs/docs/learn/advanced/12-simulation.md @@ -7,8 +7,8 @@ sidebar_position: 1 The Cosmos SDK offers a full fledged simulation framework to fuzz test every message defined by a module. -On the Cosmos SDK, this functionality is provided by [`SimApp`](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/app_v2.go), which is a -`Baseapp` application that is used for running the [`simulation`](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/simulation) module. +On the Cosmos SDK, this functionality is provided by [`SimApp`](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/app_v2.go), which is a +`Baseapp` application that is used for running the [`simulation`](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/simulation) module. This module defines all the simulation logic as well as the operations for randomized parameters like accounts, balances etc. @@ -41,7 +41,7 @@ failure type: Each simulation must receive a set of inputs (_i.e_ flags) such as the number of blocks that the simulation is run, seed, block size, etc. -Check the full list of flags [here](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/simulation/client/cli/flags.go#L33-L57). +Check the full list of flags [here](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/simulation/client/cli/flags.go#L35-L59). ## Simulator Modes @@ -53,7 +53,7 @@ In addition to the various inputs and commands, the simulator runs in three mode This mode is helpful for running simulations on a known state such as a live network export where a new (mostly likely breaking) version of the application needs to be tested. 3. From a `params.json` file where the initial state is pseudo-randomly generated but the module and simulation parameters can be provided manually. This allows for a more controlled and deterministic simulation setup while allowing the state space to still be pseudo-randomly simulated. - The list of available parameters are listed [here](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/simulation/client/cli/flags.go#L59-L78). + The list of available parameters are listed [here](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/simulation/client/cli/flags.go#L59-L78). :::tip These modes are not mutually exclusive. So you can for example run a randomly @@ -63,7 +63,7 @@ generated genesis state (`1`) with manually generated simulation params (`3`). ## Usage This is a general example of how simulations are run. For more specific examples -check the Cosmos SDK [Makefile](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/Makefile#L282-L318). +check the Cosmos SDK [Makefile](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/Makefile#L282-L318). ```bash $ go test -mod=readonly github.com/cosmos/cosmos-sdk/simapp \ @@ -90,12 +90,12 @@ Here are some suggestions when encountering a simulation failure: * Run invariants on every operation with `-SimulateEveryOperation`. _Note_: this will slow down your simulation **a lot**. * Try adding logs to operations that are not logged. You will have to define a - [Logger](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/staking/keeper/keeper.go#L65-L68) on your `Keeper`. + [Logger](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/staking/keeper/keeper.go#L65-L68) on your `Keeper`. ## Use simulation in your Cosmos SDK-based application -Learn how you can integrate the simulation into your Cosmos SDK-based application: +Learn how you can build the simulation into your Cosmos SDK-based application: * Application Simulation Manager -* [Building modules: Simulator](../building-modules/14-simulator.md) +* [Building modules: Simulator](../../build/building-modules/14-simulator.md) * Simulator tests diff --git a/docs/docs/core/13-proto-docs.md b/docs/docs/learn/advanced/13-proto-docs.md similarity index 100% rename from docs/docs/core/13-proto-docs.md rename to docs/docs/learn/advanced/13-proto-docs.md diff --git a/docs/docs/core/15-upgrade.md b/docs/docs/learn/advanced/15-upgrade.md similarity index 97% rename from docs/docs/core/15-upgrade.md rename to docs/docs/learn/advanced/15-upgrade.md index b5db25589658..5d56f2b59605 100644 --- a/docs/docs/core/15-upgrade.md +++ b/docs/docs/learn/advanced/15-upgrade.md @@ -16,7 +16,7 @@ The Cosmos SDK uses two methods to perform upgrades: * Exporting the entire application state to a JSON file using the `export` CLI command, making changes, and then starting a new binary with the changed JSON file as the genesis file. -* Perform upgrades in place, which significantly decrease the upgrade time for chains with a larger state. Use the [Module Upgrade Guide](../building-modules/13-upgrade.md) to set up your application modules to take advantage of in-place upgrades. +* Perform upgrades in place, which significantly decrease the upgrade time for chains with a larger state. Use the [Module Upgrade Guide](../../build/building-modules/13-upgrade.md) to set up your application modules to take advantage of in-place upgrades. This document provides steps to use the In-Place Store Migrations upgrade method. @@ -63,7 +63,7 @@ app.UpgradeKeeper.SetUpgradeHandler("my-plan", func(ctx sdk.Context, plan upgrad }) ``` -To learn more about configuring migration scripts for your modules, see the [Module Upgrade Guide](../building-modules/13-upgrade.md). +To learn more about configuring migration scripts for your modules, see the [Module Upgrade Guide](../../build/building-modules/13-upgrade.md). ### Order Of Migrations @@ -159,4 +159,4 @@ You can sync a full node to an existing blockchain which has been upgraded using To successfully sync, you must start with the initial binary that the blockchain started with at genesis. If all Software Upgrade Plans contain binary instruction, then you can run Cosmovisor with auto-download option to automatically handle downloading and switching to the binaries associated with each sequential upgrade. Otherwise, you need to manually provide all binaries to Cosmovisor. -To learn more about Cosmovisor, see the [Cosmovisor Quick Start](../tooling/01-cosmovisor.md). +To learn more about Cosmovisor, see the [Cosmovisor Quick Start](../../build/tooling/01-cosmovisor.md). diff --git a/docs/docs/core/16-config.md b/docs/docs/learn/advanced/16-config.md similarity index 100% rename from docs/docs/core/16-config.md rename to docs/docs/learn/advanced/16-config.md diff --git a/docs/docs/learn/advanced/_category_.json b/docs/docs/learn/advanced/_category_.json new file mode 100644 index 000000000000..a49201e64e97 --- /dev/null +++ b/docs/docs/learn/advanced/_category_.json @@ -0,0 +1,5 @@ +{ + "label": "Advanced", + "position": 3, + "link": null +} \ No newline at end of file diff --git a/docs/docs/core/baseapp_state-begin_block.png b/docs/docs/learn/advanced/baseapp_state-begin_block.png similarity index 100% rename from docs/docs/core/baseapp_state-begin_block.png rename to docs/docs/learn/advanced/baseapp_state-begin_block.png diff --git a/docs/docs/core/baseapp_state-checktx.png b/docs/docs/learn/advanced/baseapp_state-checktx.png similarity index 100% rename from docs/docs/core/baseapp_state-checktx.png rename to docs/docs/learn/advanced/baseapp_state-checktx.png diff --git a/docs/docs/core/baseapp_state-commit.png b/docs/docs/learn/advanced/baseapp_state-commit.png similarity index 100% rename from docs/docs/core/baseapp_state-commit.png rename to docs/docs/learn/advanced/baseapp_state-commit.png diff --git a/docs/docs/core/baseapp_state-deliver_tx.png b/docs/docs/learn/advanced/baseapp_state-deliver_tx.png similarity index 100% rename from docs/docs/core/baseapp_state-deliver_tx.png rename to docs/docs/learn/advanced/baseapp_state-deliver_tx.png diff --git a/docs/docs/core/baseapp_state-initchain.png b/docs/docs/learn/advanced/baseapp_state-initchain.png similarity index 100% rename from docs/docs/core/baseapp_state-initchain.png rename to docs/docs/learn/advanced/baseapp_state-initchain.png diff --git a/docs/docs/core/baseapp_state-prepareproposal.png b/docs/docs/learn/advanced/baseapp_state-prepareproposal.png similarity index 100% rename from docs/docs/core/baseapp_state-prepareproposal.png rename to docs/docs/learn/advanced/baseapp_state-prepareproposal.png diff --git a/docs/docs/core/baseapp_state-processproposal.png b/docs/docs/learn/advanced/baseapp_state-processproposal.png similarity index 100% rename from docs/docs/core/baseapp_state-processproposal.png rename to docs/docs/learn/advanced/baseapp_state-processproposal.png diff --git a/docs/docs/core/baseapp_state.png b/docs/docs/learn/advanced/baseapp_state.png similarity index 100% rename from docs/docs/core/baseapp_state.png rename to docs/docs/learn/advanced/baseapp_state.png diff --git a/docs/docs/basics/00-app-anatomy.md b/docs/docs/learn/beginner/00-app-anatomy.md similarity index 58% rename from docs/docs/basics/00-app-anatomy.md rename to docs/docs/learn/beginner/00-app-anatomy.md index 482d2b4a0d5a..07f656db2417 100644 --- a/docs/docs/basics/00-app-anatomy.md +++ b/docs/docs/learn/beginner/00-app-anatomy.md @@ -10,7 +10,7 @@ This document describes the core parts of a Cosmos SDK application, represented ## Node Client -The Daemon, or [Full-Node Client](../core/03-node.md), is the core process of a Cosmos SDK-based blockchain. Participants in the network run this process to initialize their state-machine, connect with other full-nodes, and update their state-machine as new blocks come in. +The Daemon, or [Full-Node Client](../advanced/03-node.md), is the core process of a Cosmos SDK-based blockchain. Participants in the network run this process to initialize their state-machine, connect with other full-nodes, and update their state-machine as new blocks come in. ```text ^ +-------------------------------+ ^ @@ -30,9 +30,9 @@ Blockchain Node | | Consensus | | v +-------------------------------+ v ``` -The blockchain full-node presents itself as a binary, generally suffixed by `-d` for "daemon" (e.g. `appd` for `app` or `gaiad` for `gaia`). This binary is built by running a simple [`main.go`](../core/03-node.md#main-function) function placed in `./cmd/appd/`. This operation usually happens through the [Makefile](#dependencies-and-makefile). +The blockchain full-node presents itself as a binary, generally suffixed by `-d` for "daemon" (e.g. `appd` for `app` or `gaiad` for `gaia`). This binary is built by running a simple [`main.go`](../advanced/03-node.md#main-function) function placed in `./cmd/appd/`. This operation usually happens through the [Makefile](#dependencies-and-makefile). -Once the main binary is built, the node can be started by running the [`start` command](../core/03-node.md#start-command). This command function primarily does three things: +Once the main binary is built, the node can be started by running the [`start` command](../advanced/03-node.md#start-command). This command function primarily does three things: 1. Create an instance of the state-machine defined in [`app.go`](#core-application-file). 2. Initialize the state-machine with the latest known state, extracted from the `db` stored in the `~/.app/data` folder. At this point, the state-machine is at height `appBlockHeight`. @@ -50,40 +50,41 @@ In general, the core of the state-machine is defined in a file called `app.go`. The first thing defined in `app.go` is the `type` of the application. It is generally comprised of the following parts: -* **A reference to [`baseapp`](../core/00-baseapp.md).** The custom application defined in `app.go` is an extension of `baseapp`. When a transaction is relayed by CometBFT to the application, `app` uses `baseapp`'s methods to route them to the appropriate module. `baseapp` implements most of the core logic for the application, including all the [ABCI methods](https://docs.cometbft.com/v0.37/spec/abci/) and the [routing logic](../core/00-baseapp.md#routing). -* **A list of store keys**. The [store](../core/04-store.md), which contains the entire state, is implemented as a [`multistore`](../core/04-store.md#multistore) (i.e. a store of stores) in the Cosmos SDK. Each module uses one or multiple stores in the multistore to persist their part of the state. These stores can be accessed with specific keys that are declared in the `app` type. These keys, along with the `keepers`, are at the heart of the [object-capabilities model](../core/10-ocap.md) of the Cosmos SDK. -* **A list of module's `keeper`s.** Each module defines an abstraction called [`keeper`](../building-modules/06-keeper.md), which handles reads and writes for this module's store(s). The `keeper`'s methods of one module can be called from other modules (if authorized), which is why they are declared in the application's type and exported as interfaces to other modules so that the latter can only access the authorized functions. -* **A reference to an [`appCodec`](../core/05-encoding.md).** The application's `appCodec` is used to serialize and deserialize data structures in order to store them, as stores can only persist `[]bytes`. The default codec is [Protocol Buffers](../core/05-encoding.md). -* **A reference to a [`legacyAmino`](../core/05-encoding.md) codec.** Some parts of the Cosmos SDK have not been migrated to use the `appCodec` above, and are still hardcoded to use Amino. Other parts explicitly use Amino for backwards compatibility. For these reasons, the application still holds a reference to the legacy Amino codec. Please note that the Amino codec will be removed from the SDK in the upcoming releases. -* **A reference to a [module manager](../building-modules/01-module-manager.md#manager)** and a [basic module manager](../building-modules/01-module-manager.md#basicmanager). The module manager is an object that contains a list of the application's modules. It facilitates operations related to these modules, like registering their [`Msg` service](../core/00-baseapp.md#msg-services) and [gRPC `Query` service](../core/00-baseapp.md#grpc-query-services), or setting the order of execution between modules for various functions like [`InitChainer`](#initchainer), [`BeginBlocker` and `EndBlocker`](#beginblocker-and-endblocker). +* **A reference to [`baseapp`](../advanced/00-baseapp.md).** The custom application defined in `app.go` is an extension of `baseapp`. When a transaction is relayed by CometBFT to the application, `app` uses `baseapp`'s methods to route them to the appropriate module. `baseapp` implements most of the core logic for the application, including all the [ABCI methods](https://docs.cometbft.com/v0.37/spec/abci/) and the [routing logic](../advanced/00-baseapp.md#routing). +* **A list of store keys**. The [store](../advanced/04-store.md), which contains the entire state, is implemented as a [`multistore`](../advanced/04-store.md#multistore) (i.e. a store of stores) in the Cosmos SDK. Each module uses one or multiple stores in the multistore to persist their part of the state. These stores can be accessed with specific keys that are declared in the `app` type. These keys, along with the `keepers`, are at the heart of the [object-capabilities model](../advanced/10-ocap.md) of the Cosmos SDK. +* **A list of module's `keeper`s.** Each module defines an abstraction called [`keeper`](../../build/building-modules/06-keeper.md), which handles reads and writes for this module's store(s). The `keeper`'s methods of one module can be called from other modules (if authorized), which is why they are declared in the application's type and exported as interfaces to other modules so that the latter can only access the authorized functions. +* **A reference to an [`appCodec`](../advanced/05-encoding.md).** The application's `appCodec` is used to serialize and deserialize data structures in order to store them, as stores can only persist `[]bytes`. The default codec is [Protocol Buffers](../advanced/05-encoding.md). +* **A reference to a [`legacyAmino`](../advanced/05-encoding.md) codec.** Some parts of the Cosmos SDK have not been migrated to use the `appCodec` above, and are still hardcoded to use Amino. Other parts explicitly use Amino for backwards compatibility. For these reasons, the application still holds a reference to the legacy Amino codec. Please note that the Amino codec will be removed from the SDK in the upcoming releases. +* **A reference to a [module manager](../../build/building-modules/01-module-manager.md#manager)** and a [basic module manager](../../build/building-modules/01-module-manager.md#basicmanager). The module manager is an object that contains a list of the application's modules. It facilitates operations related to these modules, like registering their [`Msg` service](../advanced/00-baseapp.md#msg-services) and [gRPC `Query` service](../advanced/00-baseapp.md#grpc-query-services), or setting the order of execution between modules for various functions like [`InitChainer`](#initchainer), [`PreBlocker`](#preblocker) and [`BeginBlocker` and `EndBlocker`](#beginblocker-and-endblocker). See an example of application type definition from `simapp`, the Cosmos SDK's own app used for demo and testing purposes: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/app.go#L161-L203 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/app.go#L173-L212 ``` ### Constructor Function -Also defined in `app.go` is the constructor function, which constructs a new application of the type defined in the preceding section. The function must fulfill the `AppCreator` signature in order to be used in the [`start` command](../core/03-node.md#start-command) of the application's daemon command. +Also defined in `app.go` is the constructor function, which constructs a new application of the type defined in the preceding section. The function must fulfill the `AppCreator` signature in order to be used in the [`start` command](../advanced/03-node.md#start-command) of the application's daemon command. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/server/types/app.go#L64-L66 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/server/types/app.go#L66-L68 ``` Here are the main actions performed by this function: -* Instantiate a new [`codec`](../core/05-encoding.md) and initialize the `codec` of each of the application's modules using the [basic manager](../building-modules/01-module-manager.md#basicmanager). +* Instantiate a new [`codec`](../advanced/05-encoding.md) and initialize the `codec` of each of the application's modules using the [basic manager](../../build/building-modules/01-module-manager.md#basicmanager). * Instantiate a new application with a reference to a `baseapp` instance, a codec, and all the appropriate store keys. * Instantiate all the [`keeper`](#keeper) objects defined in the application's `type` using the `NewKeeper` function of each of the application's modules. Note that keepers must be instantiated in the correct order, as the `NewKeeper` of one module might require a reference to another module's `keeper`. -* Instantiate the application's [module manager](../building-modules/01-module-manager.md#manager) with the [`AppModule`](#application-module-interface) object of each of the application's modules. -* With the module manager, initialize the application's [`Msg` services](../core/00-baseapp.md#msg-services), [gRPC `Query` services](../core/00-baseapp.md#grpc-query-services), [legacy `Msg` routes](../core/00-baseapp.md#routing), and [legacy query routes](../core/00-baseapp.md#query-routing). When a transaction is relayed to the application by CometBFT via the ABCI, it is routed to the appropriate module's [`Msg` service](#msg-services) using the routes defined here. Likewise, when a gRPC query request is received by the application, it is routed to the appropriate module's [`gRPC query service`](#grpc-query-services) using the gRPC routes defined here. The Cosmos SDK still supports legacy `Msg`s and legacy CometBFT queries, which are routed using the legacy `Msg` routes and the legacy query routes, respectively. -* With the module manager, register the [application's modules' invariants](../building-modules/07-invariants.md). Invariants are variables (e.g. total supply of a token) that are evaluated at the end of each block. The process of checking invariants is done via a special module called the [`InvariantsRegistry`](../building-modules/07-invariants.md#invariant-registry). The value of the invariant should be equal to a predicted value defined in the module. Should the value be different than the predicted one, special logic defined in the invariant registry is triggered (usually the chain is halted). This is useful to make sure that no critical bug goes unnoticed, producing long-lasting effects that are hard to fix. -* With the module manager, set the order of execution between the `InitGenesis`, `BeginBlocker`, and `EndBlocker` functions of each of the [application's modules](#application-module-interface). Note that not all modules implement these functions. +* Instantiate the application's [module manager](../../build/building-modules/01-module-manager.md#manager) with the [`AppModule`](#application-module-interface) object of each of the application's modules. +* With the module manager, initialize the application's [`Msg` services](../advanced/00-baseapp.md#msg-services), [gRPC `Query` services](../advanced/00-baseapp.md#grpc-query-services), [legacy `Msg` routes](../advanced/00-baseapp.md#routing), and [legacy query routes](../advanced/00-baseapp.md#query-routing). When a transaction is relayed to the application by CometBFT via the ABCI, it is routed to the appropriate module's [`Msg` service](#msg-services) using the routes defined here. Likewise, when a gRPC query request is received by the application, it is routed to the appropriate module's [`gRPC query service`](#grpc-query-services) using the gRPC routes defined here. The Cosmos SDK still supports legacy `Msg`s and legacy CometBFT queries, which are routed using the legacy `Msg` routes and the legacy query routes, respectively. +* With the module manager, register the [application's modules' invariants](../../build/building-modules/07-invariants.md). Invariants are variables (e.g. total supply of a token) that are evaluated at the end of each block. The process of checking invariants is done via a special module called the [`InvariantsRegistry`](../../build/building-modules/07-invariants.md#invariant-registry). The value of the invariant should be equal to a predicted value defined in the module. Should the value be different than the predicted one, special logic defined in the invariant registry is triggered (usually the chain is halted). This is useful to make sure that no critical bug goes unnoticed, producing long-lasting effects that are hard to fix. +* With the module manager, set the order of execution between the `InitGenesis`, `PreBlocker`, `BeginBlocker`, and `EndBlocker` functions of each of the [application's modules](#application-module-interface). Note that not all modules implement these functions. * Set the remaining application parameters: * [`InitChainer`](#initchainer): used to initialize the application when it is first started. - * [`BeginBlocker`, `EndBlocker`](#beginblocker-and-endlbocker): called at the beginning and at the end of every block. - * [`anteHandler`](../core/00-baseapp.md#antehandler): used to handle fees and signature verification. + * [`PreBlocker`](#preblocker): called before BeginBlock. + * [`BeginBlocker`, `EndBlocker`](#beginblocker-and-endblocker): called at the beginning and at the end of every block. + * [`anteHandler`](../advanced/00-baseapp.md#antehandler): used to handle fees and signature verification. * Mount the stores. * Return the application. @@ -92,33 +93,48 @@ Note that the constructor function only creates an instance of the app, while th See an example of application constructor from `simapp`: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/app.go#L214-L522 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/app.go#L223-L575 ``` ### InitChainer The `InitChainer` is a function that initializes the state of the application from a genesis file (i.e. token balances of genesis accounts). It is called when the application receives the `InitChain` message from the CometBFT engine, which happens when the node is started at `appBlockHeight == 0` (i.e. on genesis). The application must set the `InitChainer` in its [constructor](#constructor-function) via the [`SetInitChainer`](https://pkg.go.dev/github.com/cosmos/cosmos-sdk/baseapp#BaseApp.SetInitChainer) method. -In general, the `InitChainer` is mostly composed of the [`InitGenesis`](../building-modules/08-genesis.md#initgenesis) function of each of the application's modules. This is done by calling the `InitGenesis` function of the module manager, which in turn calls the `InitGenesis` function of each of the modules it contains. Note that the order in which the modules' `InitGenesis` functions must be called has to be set in the module manager using the [module manager's](../building-modules/01-module-manager.md) `SetOrderInitGenesis` method. This is done in the [application's constructor](#application-constructor), and the `SetOrderInitGenesis` has to be called before the `SetInitChainer`. +In general, the `InitChainer` is mostly composed of the [`InitGenesis`](../../build/building-modules/08-genesis.md#initgenesis) function of each of the application's modules. This is done by calling the `InitGenesis` function of the module manager, which in turn calls the `InitGenesis` function of each of the modules it contains. Note that the order in which the modules' `InitGenesis` functions must be called has to be set in the module manager using the [module manager's](../../build/building-modules/01-module-manager.md) `SetOrderInitGenesis` method. This is done in the [application's constructor](#application-constructor), and the `SetOrderInitGenesis` has to be called before the `SetInitChainer`. See an example of an `InitChainer` from `simapp`: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/app.go#L569-L577 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/app.go#L626-L634 ``` +### PreBlocker + +There are two semantics around the new lifecycle method: + +* It runs before the `BeginBlocker` of all modules +* It can modify consensus parameters in storage, and signal the caller through the return value. + +When it returns `ConsensusParamsChanged=true`, the caller must refresh the consensus parameter in the finalize context: + +```go +app.finalizeBlockState.ctx = app.finalizeBlockState.ctx.WithConsensusParams(app.GetConsensusParams()) +``` + +The new ctx must be passed to all the other lifecycle methods. + ### BeginBlocker and EndBlocker -The Cosmos SDK offers developers the possibility to implement automatic execution of code as part of their application. This is implemented through two functions called `BeginBlocker` and `EndBlocker`. They are called when the application receives the `BeginBlock` and `EndBlock` messages from the CometBFT engine, which happens respectively at the beginning and at the end of each block. The application must set the `BeginBlocker` and `EndBlocker` in its [constructor](#constructor-function) via the [`SetBeginBlocker`](https://pkg.go.dev/github.com/cosmos/cosmos-sdk/baseapp#BaseApp.SetBeginBlocker) and [`SetEndBlocker`](https://pkg.go.dev/github.com/cosmos/cosmos-sdk/baseapp#BaseApp.SetEndBlocker) methods. +The Cosmos SDK offers developers the possibility to implement automatic execution of code as part of their application. This is implemented through two functions called `BeginBlocker` and `EndBlocker`. They are called when the application receives the `FinalizeBlock` messages from the CometBFT consensus engine, which happens respectively at the beginning and at the end of each block. The application must set the `BeginBlocker` and `EndBlocker` in its [constructor](#constructor-function) via the [`SetBeginBlocker`](https://pkg.go.dev/github.com/cosmos/cosmos-sdk/baseapp#BaseApp.SetBeginBlocker) and [`SetEndBlocker`](https://pkg.go.dev/github.com/cosmos/cosmos-sdk/baseapp#BaseApp.SetEndBlocker) methods. -In general, the `BeginBlocker` and `EndBlocker` functions are mostly composed of the [`BeginBlock` and `EndBlock`](../building-modules/05-beginblock-endblock.md) functions of each of the application's modules. This is done by calling the `BeginBlock` and `EndBlock` functions of the module manager, which in turn calls the `BeginBlock` and `EndBlock` functions of each of the modules it contains. Note that the order in which the modules' `BeginBlock` and `EndBlock` functions must be called has to be set in the module manager using the `SetOrderBeginBlockers` and `SetOrderEndBlockers` methods, respectively. This is done via the [module manager](../building-modules/01-module-manager.md) in the [application's constructor](#application-constructor), and the `SetOrderBeginBlockers` and `SetOrderEndBlockers` methods have to be called before the `SetBeginBlocker` and `SetEndBlocker` functions. +In general, the `BeginBlocker` and `EndBlocker` functions are mostly composed of the [`BeginBlock` and `EndBlock`](../../build/building-modules/06-beginblock-endblock.md) functions of each of the application's modules. This is done by calling the `BeginBlock` and `EndBlock` functions of the module manager, which in turn calls the `BeginBlock` and `EndBlock` functions of each of the modules it contains. Note that the order in which the modules' `BeginBlock` and `EndBlock` functions must be called has to be set in the module manager using the `SetOrderBeginBlockers` and `SetOrderEndBlockers` methods, respectively. This is done via the [module manager](../../build/building-modules/01-module-manager.md) in the [application's constructor](#application-constructor), and the `SetOrderBeginBlockers` and `SetOrderEndBlockers` methods have to be called before the `SetBeginBlocker` and `SetEndBlocker` functions. As a sidenote, it is important to remember that application-specific blockchains are deterministic. Developers must be careful not to introduce non-determinism in `BeginBlocker` or `EndBlocker`, and must also be careful not to make them too computationally expensive, as [gas](./04-gas-fees.md) does not constrain the cost of `BeginBlocker` and `EndBlocker` execution. See an example of `BeginBlocker` and `EndBlocker` functions from `simapp` ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/app.go#L555-L563 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/app.go#L613-L620 ``` ### Register Codec @@ -126,40 +142,40 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/app.go#L555-L563 The `EncodingConfig` structure is the last important part of the `app.go` file. The goal of this structure is to define the codecs that will be used throughout the app. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/params/encoding.go#L9-L16 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/params/encoding.go#L9-L16 ``` Here are descriptions of what each of the four fields means: * `InterfaceRegistry`: The `InterfaceRegistry` is used by the Protobuf codec to handle interfaces that are encoded and decoded (we also say "unpacked") using [`google.protobuf.Any`](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/any.proto). `Any` could be thought as a struct that contains a `type_url` (name of a concrete type implementing the interface) and a `value` (its encoded bytes). `InterfaceRegistry` provides a mechanism for registering interfaces and implementations that can be safely unpacked from `Any`. Each application module implements the `RegisterInterfaces` method that can be used to register the module's own interfaces and implementations. - * You can read more about `Any` in [ADR-019](../architecture/adr-019-protobuf-state-encoding.md). - * To go more into details, the Cosmos SDK uses an implementation of the Protobuf specification called [`gogoprotobuf`](https://github.com/cosmos/gogoproto). By default, the [gogo protobuf implementation of `Any`](https://pkg.go.dev/github.com/cosmos/gogoproto/types) uses [global type registration](https://github.com/cosmos/gogoproto/blob/master/proto/properties.go#L540) to decode values packed in `Any` into concrete Go types. This introduces a vulnerability where any malicious module in the dependency tree could register a type with the global protobuf registry and cause it to be loaded and unmarshaled by a transaction that referenced it in the `type_url` field. For more information, please refer to [ADR-019](../architecture/adr-019-protobuf-state-encoding.md). + * You can read more about `Any` in [ADR-019](../../build/architecture/adr-019-protobuf-state-encoding.md). + * To go more into details, the Cosmos SDK uses an implementation of the Protobuf specification called [`gogoprotobuf`](https://github.com/cosmos/gogoproto). By default, the [gogo protobuf implementation of `Any`](https://pkg.go.dev/github.com/cosmos/gogoproto/types) uses [global type registration](https://github.com/cosmos/gogoproto/blob/master/proto/properties.go#L540) to decode values packed in `Any` into concrete Go types. This introduces a vulnerability where any malicious module in the dependency tree could register a type with the global protobuf registry and cause it to be loaded and unmarshaled by a transaction that referenced it in the `type_url` field. For more information, please refer to [ADR-019](../../build/architecture/adr-019-protobuf-state-encoding.md). * `Codec`: The default codec used throughout the Cosmos SDK. It is composed of a `BinaryCodec` used to encode and decode state, and a `JSONCodec` used to output data to the users (for example, in the [CLI](#cli)). By default, the SDK uses Protobuf as `Codec`. -* `TxConfig`: `TxConfig` defines an interface a client can utilize to generate an application-defined concrete transaction type. Currently, the SDK handles two transaction types: `SIGN_MODE_DIRECT` (which uses Protobuf binary as over-the-wire encoding) and `SIGN_MODE_LEGACY_AMINO_JSON` (which depends on Amino). Read more about transactions [here](../core/01-transactions.md). +* `TxConfig`: `TxConfig` defines an interface a client can utilize to generate an application-defined concrete transaction type. Currently, the SDK handles two transaction types: `SIGN_MODE_DIRECT` (which uses Protobuf binary as over-the-wire encoding) and `SIGN_MODE_LEGACY_AMINO_JSON` (which depends on Amino). Read more about transactions [here](../advanced/01-transactions.md). * `Amino`: Some legacy parts of the Cosmos SDK still use Amino for backwards-compatibility. Each module exposes a `RegisterLegacyAmino` method to register the module's specific types within Amino. This `Amino` codec should not be used by app developers anymore, and will be removed in future releases. An application should create its own encoding config. See an example of a `simappparams.EncodingConfig` from `simapp`: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/app.go#L731-L738 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/params/encoding.go#L11-L16 ``` ## Modules -[Modules](../building-modules/01-intro.md) are the heart and soul of Cosmos SDK applications. They can be considered as state-machines nested within the state-machine. When a transaction is relayed from the underlying CometBFT engine via the ABCI to the application, it is routed by [`baseapp`](../core/00-baseapp.md) to the appropriate module in order to be processed. This paradigm enables developers to easily build complex state-machines, as most of the modules they need often already exist. **For developers, most of the work involved in building a Cosmos SDK application revolves around building custom modules required by their application that do not exist yet, and integrating them with modules that do already exist into one coherent application**. In the application directory, the standard practice is to store modules in the `x/` folder (not to be confused with the Cosmos SDK's `x/` folder, which contains already-built modules). +[Modules](../../build/building-modules/00-intro.md) are the heart and soul of Cosmos SDK applications. They can be considered as state-machines nested within the state-machine. When a transaction is relayed from the underlying CometBFT engine via the ABCI to the application, it is routed by [`baseapp`](../advanced/00-baseapp.md) to the appropriate module in order to be processed. This paradigm enables developers to easily build complex state-machines, as most of the modules they need often already exist. **For developers, most of the work involved in building a Cosmos SDK application revolves around building custom modules required by their application that do not exist yet, and integrating them with modules that do already exist into one coherent application**. In the application directory, the standard practice is to store modules in the `x/` folder (not to be confused with the Cosmos SDK's `x/` folder, which contains already-built modules). ### Application Module Interface -Modules must implement [interfaces](../building-modules/01-module-manager.md#application-module-interfaces) defined in the Cosmos SDK, [`AppModuleBasic`](../building-modules/01-module-manager.md#appmodulebasic) and [`AppModule`](../building-modules/01-module-manager.md#appmodule). The former implements basic non-dependent elements of the module, such as the `codec`, while the latter handles the bulk of the module methods (including methods that require references to other modules' `keeper`s). Both the `AppModule` and `AppModuleBasic` types are, by convention, defined in a file called `module.go`. +Modules must implement [interfaces](../../build/building-modules/01-module-manager.md#application-module-interfaces) defined in the Cosmos SDK, [`AppModuleBasic`](../../build/building-modules/01-module-manager.md#appmodulebasic) and [`AppModule`](../../build/building-modules/01-module-manager.md#appmodule). The former implements basic non-dependent elements of the module, such as the `codec`, while the latter handles the bulk of the module methods (including methods that require references to other modules' `keeper`s). Both the `AppModule` and `AppModuleBasic` types are, by convention, defined in a file called `module.go`. -`AppModule` exposes a collection of useful methods on the module that facilitates the composition of modules into a coherent application. These methods are called from the [`module manager`](../building-modules/01-module-manager.md#manager), which manages the application's collection of modules. +`AppModule` exposes a collection of useful methods on the module that facilitates the composition of modules into a coherent application. These methods are called from the [`module manager`](../../build/building-modules/01-module-manager.md#manager), which manages the application's collection of modules. ### `Msg` Services Each application module defines two [Protobuf services](https://developers.google.com/protocol-buffers/docs/proto#services): one `Msg` service to handle messages, and one gRPC `Query` service to handle queries. If we consider the module as a state-machine, then a `Msg` service is a set of state transition RPC methods. Each Protobuf `Msg` service method is 1:1 related to a Protobuf request type, which must implement `sdk.Msg` interface. -Note that `sdk.Msg`s are bundled in [transactions](../core/01-transactions.md), and each transaction contains one or multiple messages. +Note that `sdk.Msg`s are bundled in [transactions](../advanced/01-transactions.md), and each transaction contains one or multiple messages. When a valid block of transactions is received by the full-node, CometBFT relays each one to the application via [`DeliverTx`](https://docs.cometbft.com/v0.37/spec/abci/abci++_app_requirements#specifics-of-responsedelivertx). Then, the application handles the transaction: @@ -173,7 +189,7 @@ For more details, see [transaction lifecycle](./01-tx-lifecycle.md). Module developers create custom `Msg` services when they build their own module. The general practice is to define the `Msg` Protobuf service in a `tx.proto` file. For example, the `x/bank` module defines a service with two methods to transfer tokens: ```protobuf reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/bank/v1beta1/tx.proto#L13-L36 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/proto/cosmos/bank/v1beta1/tx.proto#L13-L36 ``` Service methods use `keeper` in order to update the module state. @@ -182,7 +198,7 @@ Each module should also implement the `RegisterServices` method as part of the [ ### gRPC `Query` Services -gRPC `Query` services allow users to query the state using [gRPC](https://grpc.io). They are enabled by default, and can be configured under the `grpc.enable` and `grpc.address` fields inside [`app.toml`](../run-node/02-interact-node.md#configuring-the-node-using-apptoml). +gRPC `Query` services allow users to query the state using [gRPC](https://grpc.io). They are enabled by default, and can be configured under the `grpc.enable` and `grpc.address` fields inside [`app.toml`](../../user/run-node/01-run-node.md#configuring-the-node-using-apptoml-and-configtoml). gRPC `Query` services are defined in the module's Protobuf definition files, specifically inside `query.proto`. The `query.proto` definition file exposes a single `Query` [Protobuf service](https://developers.google.com/protocol-buffers/docs/proto#services). Each gRPC query endpoint corresponds to a service method, starting with the `rpc` keyword, inside the `Query` service. @@ -192,7 +208,7 @@ Finally, each module should also implement the `RegisterServices` method as part ### Keeper -[`Keepers`](../building-modules/06-keeper.md) are the gatekeepers of their module's store(s). To read or write in a module's store, it is mandatory to go through one of its `keeper`'s methods. This is ensured by the [object-capabilities](../core/10-ocap.md) model of the Cosmos SDK. Only objects that hold the key to a store can access it, and only the module's `keeper` should hold the key(s) to the module's store(s). +[`Keepers`](../../build/building-modules/06-keeper.md) are the gatekeepers of their module's store(s). To read or write in a module's store, it is mandatory to go through one of its `keeper`'s methods. This is ensured by the [object-capabilities](../advanced/10-ocap.md) model of the Cosmos SDK. Only objects that hold the key to a store can access it, and only the module's `keeper` should hold the key(s) to the module's store(s). `Keepers` are generally defined in a file called `keeper.go`. It contains the `keeper`'s type definition and methods. @@ -210,10 +226,10 @@ Each module defines command-line commands, gRPC services, and REST routes to be #### CLI -Generally, the [commands related to a module](../building-modules/09-module-interfaces.md#cli) are defined in a folder called `client/cli` in the module's folder. The CLI divides commands into two categories, transactions and queries, defined in `client/cli/tx.go` and `client/cli/query.go`, respectively. Both commands are built on top of the [Cobra Library](https://github.com/spf13/cobra): +Generally, the [commands related to a module](../../build/building-modules/09-module-interfaces.md#cli) are defined in a folder called `client/cli` in the module's folder. The CLI divides commands into two categories, transactions and queries, defined in `client/cli/tx.go` and `client/cli/query.go`, respectively. Both commands are built on top of the [Cobra Library](https://github.com/spf13/cobra): * Transactions commands let users generate new transactions so that they can be included in a block and eventually update the state. One command should be created for each [message type](#message-types) defined in the module. The command calls the constructor of the message with the parameters provided by the end-user, and wraps it into a transaction. The Cosmos SDK handles signing and the addition of other transaction metadata. -* Queries let users query the subset of the state defined by the module. Query commands forward queries to the [application's query router](../core/00-baseapp.md#query-routing), which routes them to the appropriate [querier](#querier) the `queryRoute` parameter supplied. +* Queries let users query the subset of the state defined by the module. Query commands forward queries to the [application's query router](../advanced/00-baseapp.md#query-routing), which routes them to the appropriate [querier](#querier) the `queryRoute` parameter supplied. #### gRPC @@ -230,13 +246,13 @@ Some external clients may not wish to use gRPC. In this case, the Cosmos SDK pro The REST endpoints are defined in the Protobuf files, along with the gRPC services, using Protobuf annotations. Modules that want to expose REST queries should add `google.api.http` annotations to their `rpc` methods. By default, all REST endpoints defined in the SDK have a URL starting with the `/cosmos/` prefix. -The Cosmos SDK also provides a development endpoint to generate [Swagger](https://swagger.io/) definition files for these REST endpoints. This endpoint can be enabled inside the [`app.toml`](../run-node/01-run-node.md#configuring-the-node-using-apptoml) config file, under the `api.swagger` key. +The Cosmos SDK also provides a development endpoint to generate [Swagger](https://swagger.io/) definition files for these REST endpoints. This endpoint can be enabled inside the [`app.toml`](../../user/run-node/01-run-node.md#configuring-the-node-using-apptoml-and-configtoml) config file, under the `api.swagger` key. ## Application Interface [Interfaces](#command-line-grpc-services-and-rest-interfaces) let end-users interact with full-node clients. This means querying data from the full-node or creating and sending new transactions to be relayed by the full-node and eventually included in a block. -The main interface is the [Command-Line Interface](../core/07-cli.md). The CLI of a Cosmos SDK application is built by aggregating [CLI commands](#cli) defined in each of the modules used by the application. The CLI of an application is the same as the daemon (e.g. `appd`), and is defined in a file called `appd/main.go`. The file contains the following: +The main interface is the [Command-Line Interface](../advanced/07-cli.md). The CLI of a Cosmos SDK application is built by aggregating [CLI commands](#cli) defined in each of the modules used by the application. The CLI of an application is the same as the daemon (e.g. `appd`), and is defined in a file called `appd/main.go`. The file contains the following: * **A `main()` function**, which is executed to build the `appd` interface client. This function prepares each command and adds them to the `rootCmd` before building them. At the root of `appd`, the function adds generic commands like `status`, `keys`, and `config`, query commands, tx commands, and `rest-server`. * **Query commands**, which are added by calling the `queryCmd` function. This function returns a Cobra command that contains the query commands defined in each of the application's modules (passed as an array of `sdk.ModuleClients` from the `main()` function), as well as some other lower level query commands such as block or validator queries. Query command are called by using the command `appd query [query]` of the CLI. @@ -258,6 +274,6 @@ The following is the `go.mod` of the [Cosmos Hub](https://github.com/cosmos/gaia https://github.com/cosmos/gaia/blob/26ae7c2/go.mod#L1-L28 ``` -For building the application, a [Makefile](https://en.wikipedia.org/wiki/Makefile) is generally used. The Makefile primarily ensures that the `go.mod` is run before building the two entrypoints to the application, [`appd`](#node-client) and [`appd`](#application-interface). +For building the application, a [Makefile](https://en.wikipedia.org/wiki/Makefile) is generally used. The Makefile primarily ensures that the `go.mod` is run before building the two entrypoints to the application, [`Node Client`](#node-client) and [`Application Interface`](#application-interface). Here is an example of the [Cosmos Hub Makefile](https://github.com/cosmos/gaia/blob/main/Makefile). diff --git a/docs/docs/basics/01-tx-lifecycle.md b/docs/docs/learn/beginner/01-tx-lifecycle.md similarity index 68% rename from docs/docs/basics/01-tx-lifecycle.md rename to docs/docs/learn/beginner/01-tx-lifecycle.md index 29ed40370dea..2f86f168a1d7 100644 --- a/docs/docs/basics/01-tx-lifecycle.md +++ b/docs/docs/learn/beginner/01-tx-lifecycle.md @@ -5,12 +5,10 @@ sidebar_position: 1 # Transaction Lifecycle :::note Synopsis -This document describes the lifecycle of a transaction from creation to committed state changes. Transaction definition is described in a [different doc](../core/01-transactions.md). The transaction is referred to as `Tx`. +This document describes the lifecycle of a transaction from creation to committed state changes. Transaction definition is described in a [different doc](../advanced/01-transactions.md). The transaction is referred to as `Tx`. ::: -:::note - -### Pre-requisite Readings +:::note Pre-requisite Readings * [Anatomy of a Cosmos SDK Application](./00-app-anatomy.md) ::: @@ -19,7 +17,7 @@ This document describes the lifecycle of a transaction from creation to committe ### Transaction Creation -One of the main application interfaces is the command-line interface. The transaction `Tx` can be created by the user inputting a command in the following format from the [command-line](../core/07-cli.md), providing the type of transaction in `[command]`, arguments in `[args]`, and configurations such as gas prices in `[flags]`: +One of the main application interfaces is the command-line interface. The transaction `Tx` can be created by the user inputting a command in the following format from the [command-line](../advanced/07-cli.md), providing the type of transaction in `[command]`, arguments in `[args]`, and configurations such as gas prices in `[flags]`: ```bash [appname] tx [command] [args] [flags] @@ -31,7 +29,7 @@ There are several required and optional flags for transaction creation. The `--f #### Gas and Fees -Additionally, there are several [flags](../core/07-cli.md) users can use to indicate how much they are willing to pay in [fees](./04-gas-fees.md): +Additionally, there are several [flags](../advanced/07-cli.md) users can use to indicate how much they are willing to pay in [fees](./04-gas-fees.md): * `--gas` refers to how much [gas](./04-gas-fees.md), which represents computational resources, `Tx` consumes. Gas is dependent on the transaction and is not precisely calculated until execution, but can be estimated by providing `auto` as the value for `--gas`. * `--gas-adjustment` (optional) can be used to scale `gas` up in order to avoid underestimating. For example, users can specify their gas adjustment as 1.5 to use 1.5 times the estimated gas. @@ -53,7 +51,7 @@ appd tx send 1000uatom --from --gas auto --ga #### Other Transaction Creation Methods -The command-line is an easy way to interact with an application, but `Tx` can also be created using a [gRPC or REST interface](../core/06-grpc_rest.md) or some other entry point defined by the application developer. From the user's perspective, the interaction depends on the web interface or wallet they are using (e.g. creating `Tx` using [Lunie.io](https://lunie.io/#/) and signing it with a Ledger Nano S). +The command-line is an easy way to interact with an application, but `Tx` can also be created using a [gRPC or REST interface](../advanced/06-grpc_rest.md) or some other entry point defined by the application developer. From the user's perspective, the interaction depends on the web interface or wallet they are using (e.g. creating `Tx` using [Lunie.io](https://lunie.io/#/) and signing it with a Ledger Nano S). ## Addition to Mempool @@ -73,7 +71,7 @@ are not empty, enforcing nonnegative numbers, and other logic specified in the d **_Stateful_** checks validate transactions and messages based on a committed state. Examples include checking that the relevant values exist and can be transacted with, the address has sufficient funds, and the sender is authorized or has the correct ownership to transact. -At any given moment, full-nodes typically have [multiple versions](../core/00-baseapp.md#state-updates) +At any given moment, full-nodes typically have [multiple versions](../advanced/00-baseapp.md#state-updates) of the application's internal state for different purposes. For example, nodes execute state changes while in the process of verifying transactions, but still need a copy of the last committed state in order to answer queries - they should not respond using state with uncommitted changes. @@ -84,16 +82,16 @@ through several steps, beginning with decoding `Tx`. ### Decoding -When `Tx` is received by the application from the underlying consensus engine (e.g. CometBFT ), it is still in its [encoded](../core/05-encoding.md) `[]byte` form and needs to be unmarshaled in order to be processed. Then, the [`runTx`](../core/00-baseapp.md#runtx-antehandler-runmsgs-posthandler) function is called to run in `runTxModeCheck` mode, meaning the function runs all checks but exits before executing messages and writing state changes. +When `Tx` is received by the application from the underlying consensus engine (e.g. CometBFT ), it is still in its [encoded](../advanced/05-encoding.md) `[]byte` form and needs to be unmarshaled in order to be processed. Then, the [`runTx`](../advanced/00-baseapp.md#runtx-antehandler-runmsgs-posthandler) function is called to run in `runTxModeCheck` mode, meaning the function runs all checks but exits before executing messages and writing state changes. ### ValidateBasic (deprecated) -Messages ([`sdk.Msg`](../core/01-transactions.md#messages)) are extracted from transactions (`Tx`). The `ValidateBasic` method of the `sdk.Msg` interface implemented by the module developer is run for each transaction. -To discard obviously invalid messages, the `BaseApp` type calls the `ValidateBasic` method very early in the processing of the message in the [`CheckTx`](../core/00-baseapp.md#checktx) and [`DeliverTx`](../core/00-baseapp.md#delivertx) transactions. +Messages ([`sdk.Msg`](../advanced/01-transactions.md#messages)) are extracted from transactions (`Tx`). The `ValidateBasic` method of the `sdk.Msg` interface implemented by the module developer is run for each transaction. +To discard obviously invalid messages, the `BaseApp` type calls the `ValidateBasic` method very early in the processing of the message in the [`CheckTx`](../advanced/00-baseapp.md#checktx) and [`DeliverTx`](../advanced/00-baseapp.md#delivertx) transactions. `ValidateBasic` can include only **stateless** checks (the checks that do not require access to the state). :::warning -The `ValidateBasic` method on messages has been deprecated in favor of validating messages directly in their respective [`Msg` services](../building-modules/03-msg-services.md#Validation). +The `ValidateBasic` method on messages has been deprecated in favor of validating messages directly in their respective [`Msg` services](../../build/building-modules/03-msg-services.md#Validation). Read [RFC 001](https://docs.cosmos.network/main/rfc/rfc-001-tx-validation) for more details. ::: @@ -104,7 +102,7 @@ Read [RFC 001](https://docs.cosmos.network/main/rfc/rfc-001-tx-validation) for m #### Guideline -`ValidateBasic` should not be used anymore. Message validation should be performed in the `Msg` service when [handling a message](../building-modules/msg-services#Validation) in a module Msg Server. +`ValidateBasic` should not be used anymore. Message validation should be performed in the `Msg` service when [handling a message](../../build/building-modules/msg-services#Validation) in a module Msg Server. ### AnteHandler @@ -114,9 +112,13 @@ A copy of the cached context is provided to the `AnteHandler`, which performs li For example, the [`auth`](https://github.com/cosmos/cosmos-sdk/tree/main/x/auth/spec) module `AnteHandler` checks and increments sequence numbers, checks signatures and account numbers, and deducts fees from the first signer of the transaction - all state changes are made using the `checkState`. +:::warning +Ante handlers only run on a transaction. If a transaction embed multiple messages (like some x/authz, x/gov transactions for instance), the ante handlers only have awareness of the outer message. Inner messages are mostly directly routed to the [message router](https://docs.cosmos.network/main/learn/advanced/baseapp#msg-service-router) and will skip the chain of ante handlers. Keep that in mind when designing your own ante handler. +::: + ### Gas -The [`Context`](../core/02-context.md), which keeps a `GasMeter` that tracks how much gas is used during the execution of `Tx`, is initialized. The user-provided amount of gas for `Tx` is known as `GasWanted`. If `GasConsumed`, the amount of gas consumed during execution, ever exceeds `GasWanted`, the execution stops and the changes made to the cached copy of the state are not committed. Otherwise, `CheckTx` sets `GasUsed` equal to `GasConsumed` and returns it in the result. After calculating the gas and fee values, validator-nodes check that the user-specified `gas-prices` is greater than their locally defined `min-gas-prices`. +The [`Context`](../advanced/02-context.md), which keeps a `GasMeter` that tracks how much gas is used during the execution of `Tx`, is initialized. The user-provided amount of gas for `Tx` is known as `GasWanted`. If `GasConsumed`, the amount of gas consumed during execution, ever exceeds `GasWanted`, the execution stops and the changes made to the cached copy of the state are not committed. Otherwise, `CheckTx` sets `GasUsed` equal to `GasConsumed` and returns it in the result. After calculating the gas and fee values, validator-nodes check that the user-specified `gas-prices` is greater than their locally defined `min-gas-prices`. ### Discard or Addition to Mempool @@ -157,59 +159,62 @@ must be in this proposer's mempool. ## State Changes The next step of consensus is to execute the transactions to fully validate them. All full-nodes -that receive a block proposal from the correct proposer execute the transactions by calling the ABCI functions -[`BeginBlock`](./00-app-anatomy.md#beginblocker-and-endblocker), `DeliverTx` for each transaction, -and [`EndBlock`](./00-app-anatomy.md#beginblocker-and-endblocker). While each full-node runs everything -locally, this process yields a single, unambiguous result, since the messages' state transitions are deterministic and transactions are -explicitly ordered in the block proposal. +that receive a block proposal from the correct proposer execute the transactions by calling the ABCI function `FinalizeBlock`. +As mentioned throughout the documentation `BeginBlock`, `ExecuteTx` and `EndBlock` are called within FinalizeBlock. +Although every full-node operates individually and locally, the outcome is always consistent and unequivocal. This is because the state changes brought about by the messages are predictable, and the transactions are specifically sequenced in the proposed block. ```text - ----------------------- - |Receive Block Proposal| - ----------------------- - | - v - ----------------------- - | BeginBlock | - ----------------------- - | - v - ----------------------- - | DeliverTx(tx0) | - | DeliverTx(tx1) | - | DeliverTx(tx2) | - | DeliverTx(tx3) | - | . | - | . | - | . | - ----------------------- - | - v - ----------------------- - | EndBlock | - ----------------------- - | - v - ----------------------- - | Consensus | - ----------------------- - | - v - ----------------------- - | Commit | - ----------------------- + -------------------------- + | Receive Block Proposal | + -------------------------- + | + v + ------------------------- + | FinalizeBlock | + ------------------------- + | + v + ------------------- + | BeginBlock | + ------------------- + | + v + -------------------- + | ExecuteTx(tx0) | + | ExecuteTx(tx1) | + | ExecuteTx(tx2) | + | ExecuteTx(tx3) | + | . | + | . | + | . | + ------------------- + | + v + -------------------- + | EndBlock | + -------------------- + | + v + ------------------------- + | Consensus | + ------------------------- + | + v + ------------------------- + | Commit | + ------------------------- ``` -### DeliverTx +### Transaction Execution -The `DeliverTx` ABCI function defined in [`BaseApp`](../core/00-baseapp.md) does the bulk of the +The `FinalizeBlock` ABCI function defined in [`BaseApp`](../advanced/00-baseapp.md) does the bulk of the state transitions: it is run for each transaction in the block in sequential order as committed -to during consensus. Under the hood, `DeliverTx` is almost identical to `CheckTx` but calls the -[`runTx`](../core/00-baseapp.md#runtx) function in deliver mode instead of check mode. -Instead of using their `checkState`, full-nodes use `deliverState`: +to during consensus. Under the hood, transaction execution is almost identical to `CheckTx` but calls the +[`runTx`](../advanced/00-baseapp.md#runtx) function in deliver mode instead of check mode. +Instead of using their `checkState`, full-nodes use `finalizeblock`: -* **Decoding:** Since `DeliverTx` is an ABCI call, `Tx` is received in the encoded `[]byte` form. - Nodes first unmarshal the transaction, using the [`TxConfig`](./app-anatomy#register-codec) defined in the app, then call `runTx` in `runTxModeDeliver`, which is very similar to `CheckTx` but also executes and writes state changes. +* **Decoding:** Since `FinalizeBlock` is an ABCI call, `Tx` is received in the encoded `[]byte` form. + Nodes first unmarshal the transaction, using the [`TxConfig`](./app-anatomy#register-codec) defined in the app, then call `runTx` in `execModeFinalize`, which is very similar to `CheckTx` but also executes and writes state changes. * **Checks and `AnteHandler`:** Full-nodes call `validateBasicMsgs` and `AnteHandler` again. This second check happens because they may not have seen the same transactions during the addition to Mempool stage @@ -217,19 +222,19 @@ Instead of using their `checkState`, full-nodes use `deliverState`: `AnteHandler` does not compare `gas-prices` to the node's `min-gas-prices` since that value is local to each node - differing values across nodes yield nondeterministic results. -* **`MsgServiceRouter`:** After `CheckTx` exits, `DeliverTx` continues to run - [`runMsgs`](../core/00-baseapp.md#runtx-antehandler-runmsgs-posthandler) to fully execute each `Msg` within the transaction. +* **`MsgServiceRouter`:** After `CheckTx` exits, `FinalizeBlock` continues to run + [`runMsgs`](../advanced/00-baseapp.md#runtx-antehandler-runmsgs-posthandler) to fully execute each `Msg` within the transaction. Since the transaction may have messages from different modules, `BaseApp` needs to know which module - to find the appropriate handler. This is achieved using `BaseApp`'s `MsgServiceRouter` so that it can be processed by the module's Protobuf [`Msg` service](../building-modules/03-msg-services.md). - For `LegacyMsg` routing, the `Route` function is called via the [module manager](../building-modules/01-module-manager.md) to retrieve the route name and find the legacy [`Handler`](../building-modules/03-msg-services.md#handler-type) within the module. + to find the appropriate handler. This is achieved using `BaseApp`'s `MsgServiceRouter` so that it can be processed by the module's Protobuf [`Msg` service](../../build/building-modules/03-msg-services.md). + For `LegacyMsg` routing, the `Route` function is called via the [module manager](../../build/building-modules/01-module-manager.md) to retrieve the route name and find the legacy [`Handler`](../../build/building-modules/03-msg-services.md#handler-type) within the module. -* **`Msg` service:** Protobuf `Msg` service is responsible for executing each message in the `Tx` and causes state transitions to persist in `deliverTxState`. +* **`Msg` service:** Protobuf `Msg` service is responsible for executing each message in the `Tx` and causes state transitions to persist in `finalizeBlockState`. -* **PostHandlers:** [`PostHandler`](../core/00-baseapp.md#posthandler)s run after the execution of the message. If they fail, the state change of `runMsgs`, as well of `PostHandlers`, are both reverted. +* **PostHandlers:** [`PostHandler`](../advanced/00-baseapp.md#posthandler)s run after the execution of the message. If they fail, the state change of `runMsgs`, as well of `PostHandlers`, are both reverted. * **Gas:** While a `Tx` is being delivered, a `GasMeter` is used to keep track of how much gas is being used; if execution completes, `GasUsed` is set and returned in the - `abci.ResponseDeliverTx`. If execution halts because `BlockGasMeter` or `GasMeter` has run out or something else goes + `abci.ExecTxResult`. If execution halts because `BlockGasMeter` or `GasMeter` has run out or something else goes wrong, a deferred function at the end appropriately errors or panics. If there are any failed state changes resulting from a `Tx` being invalid or `GasMeter` running out, @@ -246,8 +251,8 @@ not they should commit the state changes. When they receive enough validator votes (2/3+ _precommits_ weighted by voting power), full nodes commit to a new block to be added to the blockchain and finalize the state transitions in the application layer. A new state root is generated to serve as -a merkle proof for the state transitions. Applications use the [`Commit`](../core/00-baseapp.md#commit) -ABCI method inherited from [Baseapp](../core/00-baseapp.md); it syncs all the state transitions by +a merkle proof for the state transitions. Applications use the [`Commit`](../advanced/00-baseapp.md#commit) +ABCI method inherited from [Baseapp](../advanced/00-baseapp.md); it syncs all the state transitions by writing the `deliverState` into the application's internal state. As soon as the state changes are committed, `checkState` starts afresh from the most recently committed state and `deliverState` resets to `nil` in order to be consistent and reflect the changes. diff --git a/docs/docs/basics/02-query-lifecycle.md b/docs/docs/learn/beginner/02-query-lifecycle.md similarity index 62% rename from docs/docs/basics/02-query-lifecycle.md rename to docs/docs/learn/beginner/02-query-lifecycle.md index 27db1caf4e4f..04e4fc9ed644 100644 --- a/docs/docs/basics/02-query-lifecycle.md +++ b/docs/docs/learn/beginner/02-query-lifecycle.md @@ -8,18 +8,16 @@ sidebar_position: 1 This document describes the lifecycle of a query in a Cosmos SDK application, from the user interface to application stores and back. The query is referred to as `MyQuery`. ::: -:::note - -### Pre-requisite Readings +:::note Pre-requisite Readings * [Transaction Lifecycle](./01-tx-lifecycle.md) ::: ## Query Creation -A [**query**](../building-modules/02-messages-and-queries.md#queries) is a request for information made by end-users of applications through an interface and processed by a full-node. Users can query information about the network, the application itself, and application state directly from the application's stores or modules. Note that queries are different from [transactions](../core/01-transactions.md) (view the lifecycle [here](./01-tx-lifecycle.md)), particularly in that they do not require consensus to be processed (as they do not trigger state-transitions); they can be fully handled by one full-node. +A [**query**](../../build/building-modules/02-messages-and-queries.md#queries) is a request for information made by end-users of applications through an interface and processed by a full-node. Users can query information about the network, the application itself, and application state directly from the application's stores or modules. Note that queries are different from [transactions](../advanced/01-transactions.md) (view the lifecycle [here](./01-tx-lifecycle.md)), particularly in that they do not require consensus to be processed (as they do not trigger state-transitions); they can be fully handled by one full-node. -For the purpose of explaining the query lifecycle, let's say the query, `MyQuery`, is requesting a list of delegations made by a certain delegator address in the application called `simapp`. As is to be expected, the [`staking`](../modules/staking/README.md) module handles this query. But first, there are a few ways `MyQuery` can be created by users. +For the purpose of explaining the query lifecycle, let's say the query, `MyQuery`, is requesting a list of delegations made by a certain delegator address in the application called `simapp`. As is to be expected, the [`staking`](../../build/modules/staking/README.md) module handles this query. But first, there are a few ways `MyQuery` can be created by users. ### CLI @@ -29,7 +27,7 @@ The main interface for an application is the command-line interface. Users conne simd query staking delegations ``` -This query command was defined by the [`staking`](../modules/staking/README.md) module developer and added to the list of subcommands by the application developer when creating the CLI. +This query command was defined by the [`staking`](../../build/modules/staking/README.md) module developer and added to the list of subcommands by the application developer when creating the CLI. Note that the general format is as follows: @@ -37,13 +35,13 @@ Note that the general format is as follows: simd query [moduleName] [command] --flag ``` -To provide values such as `--node` (the full-node the CLI connects to), the user can use the [`app.toml`](../run-node/02-interact-node.md#configuring-the-node-using-apptoml) config file to set them or provide them as flags. +To provide values such as `--node` (the full-node the CLI connects to), the user can use the [`app.toml`](../../user/run-node/01-run-node.md#configuring-the-node-using-apptoml-and-configtoml) config file to set them or provide them as flags. -The CLI understands a specific set of commands, defined in a hierarchical structure by the application developer: from the [root command](../core/07-cli.md#root-command) (`simd`), the type of command (`Myquery`), the module that contains the command (`staking`), and command itself (`delegations`). Thus, the CLI knows exactly which module handles this command and directly passes the call there. +The CLI understands a specific set of commands, defined in a hierarchical structure by the application developer: from the [root command](../advanced/07-cli.md#root-command) (`simd`), the type of command (`Myquery`), the module that contains the command (`staking`), and command itself (`delegations`). Thus, the CLI knows exactly which module handles this command and directly passes the call there. ### gRPC -Another interface through which users can make queries is [gRPC](https://grpc.io) requests to a [gRPC server](../core/06-grpc_rest.md#grpc-server). The endpoints are defined as [Protocol Buffers](https://developers.google.com/protocol-buffers) service methods inside `.proto` files, written in Protobuf's own language-agnostic interface definition language (IDL). The Protobuf ecosystem developed tools for code-generation from `*.proto` files into various languages. These tools allow to build gRPC clients easily. +Another interface through which users can make queries is [gRPC](https://grpc.io) requests to a [gRPC server](../advanced/06-grpc_rest.md#grpc-server). The endpoints are defined as [Protocol Buffers](https://developers.google.com/protocol-buffers) service methods inside `.proto` files, written in Protobuf's own language-agnostic interface definition language (IDL). The Protobuf ecosystem developed tools for code-generation from `*.proto` files into various languages. These tools allow to build gRPC clients easily. One such tool is [grpcurl](https://github.com/fullstorydev/grpcurl), and a gRPC request for `MyQuery` using this client looks like: @@ -59,7 +57,7 @@ grpcurl \ ### REST -Another interface through which users can make queries is through HTTP Requests to a [REST server](../core/06-grpc_rest.md#rest-server). The REST server is fully auto-generated from Protobuf services, using [gRPC-gateway](https://github.com/grpc-ecosystem/grpc-gateway). +Another interface through which users can make queries is through HTTP Requests to a [REST server](../advanced/06-grpc_rest.md#rest-server). The REST server is fully auto-generated from Protobuf services, using [gRPC-gateway](https://github.com/grpc-ecosystem/grpc-gateway). An example HTTP request for `MyQuery` looks like: @@ -75,17 +73,17 @@ The preceding examples show how an external user can interact with a node by que The first thing that is created in the execution of a CLI command is a `client.Context`. A `client.Context` is an object that stores all the data needed to process a request on the user side. In particular, a `client.Context` stores the following: -* **Codec**: The [encoder/decoder](../core/05-encoding.md) used by the application, used to marshal the parameters and query before making the CometBFT RPC request and unmarshal the returned response into a JSON object. The default codec used by the CLI is Protobuf. -* **Account Decoder**: The account decoder from the [`auth`](../modules/auth/README.md) module, which translates `[]byte`s into accounts. +* **Codec**: The [encoder/decoder](../advanced/05-encoding.md) used by the application, used to marshal the parameters and query before making the CometBFT RPC request and unmarshal the returned response into a JSON object. The default codec used by the CLI is Protobuf. +* **Account Decoder**: The account decoder from the [`auth`](../../build/modules/auth/README.md) module, which translates `[]byte`s into accounts. * **RPC Client**: The CometBFT RPC Client, or node, to which requests are relayed. -* **Keyring**: A [Key Manager](../basics/03-accounts.md#keyring) used to sign transactions and handle other operations with keys. +* **Keyring**: A [Key Manager]../beginner/03-accounts.md#keyring) used to sign transactions and handle other operations with keys. * **Output Writer**: A [Writer](https://pkg.go.dev/io/#Writer) used to output the response. * **Configurations**: The flags configured by the user for this command, including `--height`, specifying the height of the blockchain to query, and `--indent`, which indicates to add an indent to the JSON response. The `client.Context` also contains various functions such as `Query()`, which retrieves the RPC Client and makes an ABCI call to relay a query to a full-node. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/client/context.go#L24-L64 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/client/context.go#L25-L68 ``` The `client.Context`'s primary role is to store data used during interactions with the end-user and provide methods to interact with this data - it is used before and after the query is processed by the full-node. Specifically, in handling `MyQuery`, the `client.Context` is utilized to encode the query parameters, retrieve the full-node, and write the output. Prior to being relayed to a full-node, the query needs to be encoded into a `[]byte` form, as full-nodes are application-agnostic and do not understand specific types. The full-node (RPC Client) itself is retrieved using the `client.Context`, which knows which node the user CLI is connected to. The query is relayed to this full-node to be processed. Finally, the `client.Context` contains a `Writer` to write output when the response is returned. These steps are further described in later sections. @@ -101,7 +99,7 @@ In our case (querying an address's delegations), `MyQuery` contains an [address] Here is what the code looks like for the CLI command: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/staking/client/cli/query.go#L323-L326 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/staking/client/cli/query.go#L315-L318 ``` #### gRPC Query Client Creation @@ -109,28 +107,28 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/staking/client/cli/query The Cosmos SDK leverages code generated from Protobuf services to make queries. The `staking` module's `MyQuery` service generates a `queryClient`, which the CLI uses to make queries. Here is the relevant code: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/staking/client/cli/query.go#L317-L343 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/staking/client/cli/query.go#L308-L343 ``` -Under the hood, the `client.Context` has a `Query()` function used to retrieve the pre-configured node and relay a query to it; the function takes the query fully-qualified service method name as path (in our case: `/cosmos.staking.v1beta1.Query/Delegations`), and arguments as parameters. It first retrieves the RPC Client (called the [**node**](../core/03-node.md)) configured by the user to relay this query to, and creates the `ABCIQueryOptions` (parameters formatted for the ABCI call). The node is then used to make the ABCI call, `ABCIQueryWithOptions()`. +Under the hood, the `client.Context` has a `Query()` function used to retrieve the pre-configured node and relay a query to it; the function takes the query fully-qualified service method name as path (in our case: `/cosmos.staking.v1beta1.Query/Delegations`), and arguments as parameters. It first retrieves the RPC Client (called the [**node**](../advanced/03-node.md)) configured by the user to relay this query to, and creates the `ABCIQueryOptions` (parameters formatted for the ABCI call). The node is then used to make the ABCI call, `ABCIQueryWithOptions()`. Here is what the code looks like: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/client/query.go#L79-L113 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/client/query.go#L79-L113 ``` ## RPC -With a call to `ABCIQueryWithOptions()`, `MyQuery` is received by a [full-node](../core/05-encoding.md) which then processes the request. Note that, while the RPC is made to the consensus engine (e.g. CometBFT) of a full-node, queries are not part of consensus and so are not broadcasted to the rest of the network, as they do not require anything the network needs to agree upon. +With a call to `ABCIQueryWithOptions()`, `MyQuery` is received by a [full-node](../advanced/05-encoding.md) which then processes the request. Note that, while the RPC is made to the consensus engine (e.g. CometBFT) of a full-node, queries are not part of consensus and so are not broadcasted to the rest of the network, as they do not require anything the network needs to agree upon. Read more about ABCI Clients and CometBFT RPC in the [CometBFT documentation](https://docs.cometbft.com/v0.37/spec/rpc/). ## Application Query Handling -When a query is received by the full-node after it has been relayed from the underlying consensus engine, it is at that point being handled within an environment that understands application-specific types and has a copy of the state. [`baseapp`](../core/00-baseapp.md) implements the ABCI [`Query()`](../core/00-baseapp.md#query) function and handles gRPC queries. The query route is parsed, and it matches the fully-qualified service method name of an existing service method (most likely in one of the modules), then `baseapp` relays the request to the relevant module. +When a query is received by the full-node after it has been relayed from the underlying consensus engine, it is at that point being handled within an environment that understands application-specific types and has a copy of the state. [`baseapp`](../advanced/00-baseapp.md) implements the ABCI [`Query()`](../advanced/00-baseapp.md#query) function and handles gRPC queries. The query route is parsed, and it matches the fully-qualified service method name of an existing service method (most likely in one of the modules), then `baseapp` relays the request to the relevant module. -Since `MyQuery` has a Protobuf fully-qualified service method name from the `staking` module (recall `/cosmos.staking.v1beta1.Query/Delegations`), `baseapp` first parses the path, then uses its own internal `GRPCQueryRouter` to retrieve the corresponding gRPC handler, and routes the query to the module. The gRPC handler is responsible for recognizing this query, retrieving the appropriate values from the application's stores, and returning a response. Read more about query services [here](../building-modules/04-query-services.md). +Since `MyQuery` has a Protobuf fully-qualified service method name from the `staking` module (recall `/cosmos.staking.v1beta1.Query/Delegations`), `baseapp` first parses the path, then uses its own internal `GRPCQueryRouter` to retrieve the corresponding gRPC handler, and routes the query to the module. The gRPC handler is responsible for recognizing this query, retrieving the appropriate values from the application's stores, and returning a response. Read more about query services [here](../../build/building-modules/04-query-services.md). Once a result is received from the querier, `baseapp` begins the process of returning a response to the user. @@ -140,10 +138,10 @@ Since `Query()` is an ABCI function, `baseapp` returns the response as an [`abci ### CLI Response -The application [`codec`](../core/05-encoding.md) is used to unmarshal the response to a JSON and the `client.Context` prints the output to the command line, applying any configurations such as the output type (text, JSON or YAML). +The application [`codec`](../advanced/05-encoding.md) is used to unmarshal the response to a JSON and the `client.Context` prints the output to the command line, applying any configurations such as the output type (text, JSON or YAML). ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/client/context.go#L330-L358 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/client/context.go#L341-L349 ``` And that's a wrap! The result of the query is outputted to the console by the CLI. diff --git a/docs/docs/basics/03-accounts.md b/docs/docs/learn/beginner/03-accounts.md similarity index 83% rename from docs/docs/basics/03-accounts.md rename to docs/docs/learn/beginner/03-accounts.md index 3f908e225608..7280108ac744 100644 --- a/docs/docs/basics/03-accounts.md +++ b/docs/docs/learn/beginner/03-accounts.md @@ -8,9 +8,8 @@ sidebar_position: 1 This document describes the in-built account and public key system of the Cosmos SDK. ::: -:::note +:::note Pre-requisite Readings -### Pre-requisite Readings * [Anatomy of a Cosmos SDK Application](./00-app-anatomy.md) @@ -18,7 +17,7 @@ This document describes the in-built account and public key system of the Cosmos ## Account Definition -In the Cosmos SDK, an _account_ designates a pair of _public key_ `PubKey` and _private key_ `PrivKey`. The `PubKey` can be derived to generate various `Addresses`, which are used to identify users (among other parties) in the application. `Addresses` are also associated with [`message`s](../building-modules/02-messages-and-queries.md#messages) to identify the sender of the `message`. The `PrivKey` is used to generate [digital signatures](#signatures) to prove that an `Address` associated with the `PrivKey` approved of a given `message`. +In the Cosmos SDK, an _account_ designates a pair of _public key_ `PubKey` and _private key_ `PrivKey`. The `PubKey` can be derived to generate various `Addresses`, which are used to identify users (among other parties) in the application. `Addresses` are also associated with [`message`s](../../build/building-modules/02-messages-and-queries.md#messages) to identify the sender of the `message`. The `PrivKey` is used to generate [digital signatures](#signatures) to prove that an `Address` associated with the `PrivKey` approved of a given `message`. For HD key derivation the Cosmos SDK uses a standard called [BIP32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki). The BIP32 allows users to create an HD wallet (as specified in [BIP44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki)) - a set of accounts derived from an initial secret seed. A seed is usually created from a 12- or 24-word mnemonic. A single seed can derive any number of `PrivKey`s using a one-way cryptographic function. Then, a `PubKey` can be derived from the `PrivKey`. Naturally, the mnemonic is the most sensitive information, as private keys can always be re-generated if the mnemonic is preserved. @@ -72,9 +71,9 @@ In the node, all data is stored using Protocol Buffers serialization. The Cosmos SDK supports the following digital key schemes for creating digital signatures: -* `secp256k1`, as implemented in the [Cosmos SDK's `crypto/keys/secp256k1` package](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/crypto/keys/secp256k1/secp256k1.go). -* `secp256r1`, as implemented in the [Cosmos SDK's `crypto/keys/secp256r1` package](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/crypto/keys/secp256r1/pubkey.go), -* `tm-ed25519`, as implemented in the [Cosmos SDK `crypto/keys/ed25519` package](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/crypto/keys/ed25519/ed25519.go). This scheme is supported only for the consensus validation. +* `secp256k1`, as implemented in the [Cosmos SDK's `crypto/keys/secp256k1` package](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/crypto/keys/secp256k1/secp256k1.go). +* `secp256r1`, as implemented in the [Cosmos SDK's `crypto/keys/secp256r1` package](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/crypto/keys/secp256r1/pubkey.go), +* `tm-ed25519`, as implemented in the [Cosmos SDK `crypto/keys/ed25519` package](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/crypto/keys/ed25519/ed25519.go). This scheme is supported only for the consensus validation. | | Address length in bytes | Public key length in bytes | Used for transaction authentication | Used for consensus (cometbft) | | :----------: | :---------------------: | :------------------------: | :---------------------------------: | :-----------------------------: | @@ -95,7 +94,7 @@ Each account is identified using `Address` which is a sequence of bytes derived These types implement the `Address` interface: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/types/address.go#L108-L124 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/types/address.go#L126-L134 ``` Address construction algorithm is defined in [ADR-28](https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-028-public-key-addresses.md). @@ -110,7 +109,7 @@ Of note, the `Marshal()` and `Bytes()` method both return the same raw `[]byte` For user interaction, addresses are formatted using [Bech32](https://en.bitcoin.it/wiki/Bech32) and implemented by the `String` method. The Bech32 method is the only supported format to use when interacting with a blockchain. The Bech32 human-readable part (Bech32 prefix) is used to denote an address type. Example: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/types/address.go#L281-L295 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/types/address.go#L299-L316 ``` | | Address Bech32 Prefix | @@ -124,7 +123,7 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/types/address.go#L281-L295 Public keys in Cosmos SDK are defined by `cryptotypes.PubKey` interface. Since public keys are saved in a store, `cryptotypes.PubKey` extends the `proto.Message` interface: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/crypto/types/types.go#L8-L17 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/crypto/types/types.go#L8-L17 ``` A compressed format is used for `secp256k1` and `secp256r1` serialization. @@ -135,10 +134,10 @@ A compressed format is used for `secp256k1` and `secp256r1` serialization. This prefix is followed by the `x`-coordinate. Public Keys are not used to reference accounts (or users) and in general are not used when composing transaction messages (with few exceptions: `MsgCreateValidator`, `Validator` and `Multisig` messages). -For user interactions, `PubKey` is formatted using Protobufs JSON ([ProtoMarshalJSON](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/codec/json.go#L14-L34) function). Example: +For user interactions, `PubKey` is formatted using Protobufs JSON ([ProtoMarshalJSON](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/codec/json.go#L14-L34) function). Example: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/crypto/keyring/output.go#L23-L39 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/client/keys/output.go#L23-L39 ``` ## Keyring @@ -146,20 +145,20 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/crypto/keyring/output.go#L A `Keyring` is an object that stores and manages accounts. In the Cosmos SDK, a `Keyring` implementation follows the `Keyring` interface: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/crypto/keyring/keyring.go#L54-L101 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/crypto/keyring/keyring.go#L57-L105 ``` The default implementation of `Keyring` comes from the third-party [`99designs/keyring`](https://github.com/99designs/keyring) library. A few notes on the `Keyring` methods: -* `Sign(uid string, msg []byte) ([]byte, types.PubKey, error)` strictly deals with the signature of the `msg` bytes. You must prepare and encode the transaction into a canonical `[]byte` form. Because protobuf is not deterministic, it has been decided in [ADR-020](../architecture/adr-020-protobuf-transaction-encoding.md) that the canonical `payload` to sign is the `SignDoc` struct, deterministically encoded using [ADR-027](../architecture/adr-027-deterministic-protobuf-serialization.md). Note that signature verification is not implemented in the Cosmos SDK by default, it is deferred to the [`anteHandler`](../core/00-baseapp.md#antehandler). +* `Sign(uid string, msg []byte) ([]byte, types.PubKey, error)` strictly deals with the signature of the `msg` bytes. You must prepare and encode the transaction into a canonical `[]byte` form. Because protobuf is not deterministic, it has been decided in [ADR-020](../../build/architecture/adr-020-protobuf-transaction-encoding.md) that the canonical `payload` to sign is the `SignDoc` struct, deterministically encoded using [ADR-027](../../build/architecture/adr-027-deterministic-protobuf-serialization.md). Note that signature verification is not implemented in the Cosmos SDK by default, it is deferred to the [`anteHandler`](../advanced/00-baseapp.md#antehandler). ```protobuf reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/tx/v1beta1/tx.proto#L48-L65 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/proto/cosmos/tx/v1beta1/tx.proto#L50-L66 ``` -* `NewAccount(uid, mnemonic, bip39Passphrase, hdPath string, algo SignatureAlgo) (*Record, error)` creates a new account based on the [`bip44 path`](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki) and persists it on disk. The `PrivKey` is **never stored unencrypted**, instead it is [encrypted with a passphrase](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/crypto/armor.go) before being persisted. In the context of this method, the key type and sequence number refer to the segment of the BIP44 derivation path (for example, `0`, `1`, `2`, ...) that is used to derive a private and a public key from the mnemonic. Using the same mnemonic and derivation path, the same `PrivKey`, `PubKey` and `Address` is generated. The following keys are supported by the keyring: +* `NewAccount(uid, mnemonic, bip39Passphrase, hdPath string, algo SignatureAlgo) (*Record, error)` creates a new account based on the [`bip44 path`](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki) and persists it on disk. The `PrivKey` is **never stored unencrypted**, instead it is [encrypted with a passphrase](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/crypto/armor.go) before being persisted. In the context of this method, the key type and sequence number refer to the segment of the BIP44 derivation path (for example, `0`, `1`, `2`, ...) that is used to derive a private and a public key from the mnemonic. Using the same mnemonic and derivation path, the same `PrivKey`, `PubKey` and `Address` is generated. The following keys are supported by the keyring: * `secp256k1` * `ed25519` @@ -171,18 +170,19 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/tx/v1beta1/tx To create a new key type for using in keyring, `keyring.SignatureAlgo` interface must be fulfilled. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/crypto/keyring/signing_algorithms.go#L10-L15 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/crypto/keyring/signing_algorithms.go#L10-L15 ``` The interface consists in three methods where `Name()` returns the name of the algorithm as a `hd.PubKeyType` and `Derive()` and `Generate()` must return the following functions respectively: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/crypto/hd/algo.go#L28-L31 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/crypto/hd/algo.go#L28-L31 ``` -Once the `keyring.SignatureAlgo` has been implemented it must be added to the [list of supported algos](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/crypto/keyring/keyring.go#L217) of the keyring. + +Once the `keyring.SignatureAlgo` has been implemented it must be added to the [list of supported algos](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/crypto/keyring/keyring.go#L217) of the keyring. For simplicity the implementation of a new key type should be done inside the `crypto/hd` package. -There is an example of a working `secp256k1` implementation in [algo.go](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/crypto/hd/algo.go#L38). +There is an example of a working `secp256k1` implementation in [algo.go](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/crypto/hd/algo.go#L38). #### Implementing secp256r1 algo @@ -261,7 +261,7 @@ func (s secp256r1Algo) Generate() GenerateFn { } ``` -Finally, the algo must be added to the list of [supported algos](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/crypto/keyring/keyring.go#L217) by the keyring. +Finally, the algo must be added to the list of [supported algos](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/crypto/keyring/keyring.go#L217) by the keyring. ```go // cosmos-sdk/crypto/keyring/keyring.go @@ -278,4 +278,4 @@ func newKeystore(kr keyring.Keyring, cdc codec.Codec, backend string, opts ...Op Hereafter to create new keys using your algo, you must specify it with the flag `--algo` : -`simd keys add myKey --algo secp256r1` \ No newline at end of file +`simd keys add myKey --algo secp256r1` diff --git a/docs/docs/basics/04-gas-fees.md b/docs/docs/learn/beginner/04-gas-fees.md similarity index 54% rename from docs/docs/basics/04-gas-fees.md rename to docs/docs/learn/beginner/04-gas-fees.md index 821fe9711ccb..4def021ea7bc 100644 --- a/docs/docs/basics/04-gas-fees.md +++ b/docs/docs/learn/beginner/04-gas-fees.md @@ -8,9 +8,7 @@ sidebar_position: 1 This document describes the default strategies to handle gas and fees within a Cosmos SDK application. ::: -:::note - -### Pre-requisite Readings +:::note Pre-requisite Readings * [Anatomy of a Cosmos SDK Application](./00-app-anatomy.md) @@ -21,14 +19,14 @@ This document describes the default strategies to handle gas and fees within a C In the Cosmos SDK, `gas` is a special unit that is used to track the consumption of resources during execution. `gas` is typically consumed whenever read and writes are made to the store, but it can also be consumed if expensive computation needs to be done. It serves two main purposes: * Make sure blocks are not consuming too many resources and are finalized. This is implemented by default in the Cosmos SDK via the [block gas meter](#block-gas-meter). -* Prevent spam and abuse from end-user. To this end, `gas` consumed during [`message`](../building-modules/02-messages-and-queries.md#messages) execution is typically priced, resulting in a `fee` (`fees = gas * gas-prices`). `fees` generally have to be paid by the sender of the `message`. Note that the Cosmos SDK does not enforce `gas` pricing by default, as there may be other ways to prevent spam (e.g. bandwidth schemes). Still, most applications implement `fee` mechanisms to prevent spam by using the [`AnteHandler`](#antehandler). +* Prevent spam and abuse from end-user. To this end, `gas` consumed during [`message`](../../build/building-modules/02-messages-and-queries.md#messages) execution is typically priced, resulting in a `fee` (`fees = gas * gas-prices`). `fees` generally have to be paid by the sender of the `message`. Note that the Cosmos SDK does not enforce `gas` pricing by default, as there may be other ways to prevent spam (e.g. bandwidth schemes). Still, most applications implement `fee` mechanisms to prevent spam by using the [`AnteHandler`](#antehandler). ## Gas Meter In the Cosmos SDK, `gas` is a simple alias for `uint64`, and is managed by an object called a _gas meter_. Gas meters implement the `GasMeter` interface ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/store/types/gas.go#L40-L51 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/store/types/gas.go#L40-L51 ``` where: @@ -42,7 +40,7 @@ where: * `IsPastLimit()` returns `true` if the amount of gas consumed by the gas meter instance is strictly above the limit, `false` otherwise. * `IsOutOfGas()` returns `true` if the amount of gas consumed by the gas meter instance is above or equal to the limit, `false` otherwise. -The gas meter is generally held in [`ctx`](../core/02-context.md), and consuming gas is done with the following pattern: +The gas meter is generally held in [`ctx`](../advanced/02-context.md), and consuming gas is done with the following pattern: ```go ctx.GasMeter().ConsumeGas(amount, "description") @@ -52,48 +50,52 @@ By default, the Cosmos SDK makes use of two different gas meters, the [main gas ### Main Gas Meter -`ctx.GasMeter()` is the main gas meter of the application. The main gas meter is initialized in `BeginBlock` via `setDeliverState`, and then tracks gas consumption during execution sequences that lead to state-transitions, i.e. those originally triggered by [`BeginBlock`](../core/00-baseapp.md#beginblock), [`DeliverTx`](../core/00-baseapp.md#delivertx) and [`EndBlock`](../core/00-baseapp.md#endblock). At the beginning of each `DeliverTx`, the main gas meter **must be set to 0** in the [`AnteHandler`](#antehandler), so that it can track gas consumption per-transaction. +`ctx.GasMeter()` is the main gas meter of the application. The main gas meter is initialized in `FinalizeBlock` via `setFinalizeBlockState`, and then tracks gas consumption during execution sequences that lead to state-transitions, i.e. those originally triggered by [`FinalizeBlock`](../advanced/00-baseapp.md#finalizeblock). At the beginning of each transaction execution, the main gas meter **must be set to 0** in the [`AnteHandler`](#antehandler), so that it can track gas consumption per-transaction. -Gas consumption can be done manually, generally by the module developer in the [`BeginBlocker`, `EndBlocker`](../building-modules/05-beginblock-endblock.md) or [`Msg` service](../building-modules/03-msg-services.md), but most of the time it is done automatically whenever there is a read or write to the store. This automatic gas consumption logic is implemented in a special store called [`GasKv`](../core/04-store.md#gaskv-store). +Gas consumption can be done manually, generally by the module developer in the [`BeginBlocker`, `EndBlocker`](../../build/building-modules/06-beginblock-endblock.md) or [`Msg` service](../../build/building-modules/03-msg-services.md), but most of the time it is done automatically whenever there is a read or write to the store. This automatic gas consumption logic is implemented in a special store called [`GasKv`](../advanced/04-store.md#gaskv-store). ### Block Gas Meter -`ctx.BlockGasMeter()` is the gas meter used to track gas consumption per block and make sure it does not go above a certain limit. A new instance of the `BlockGasMeter` is created each time [`BeginBlock`](../core/00-baseapp.md#beginblock) is called. The `BlockGasMeter` is finite, and the limit of gas per block is defined in the application's consensus parameters. By default, Cosmos SDK applications use the default consensus parameters provided by CometBFT: +`ctx.BlockGasMeter()` is the gas meter used to track gas consumption per block and make sure it does not go above a certain limit. -```go reference -https://github.com/cometbft/cometbft/blob/v0.37.0/types/params.go#L66-L105 +During the genesis phase, gas consumption is unlimited to accommodate initialisation transactions. + +```go +app.finalizeBlockState.SetContext(app.finalizeBlockState.Context().WithBlockGasMeter(storetypes.NewInfiniteGasMeter())) ``` -When a new [transaction](../core/01-transactions.md) is being processed via `DeliverTx`, the current value of `BlockGasMeter` is checked to see if it is above the limit. If it is, `DeliverTx` returns immediately. This can happen even with the first transaction in a block, as `BeginBlock` itself can consume gas. If not, the transaction is processed normally. At the end of `DeliverTx`, the gas tracked by `ctx.BlockGasMeter()` is increased by the amount consumed to process the transaction: +Following the genesis block, the block gas meter is set to a finite value by the SDK. This transition is facilitated by the consensus engine (e.g., CometBFT) calling the `RequestFinalizeBlock` function, which in turn triggers the SDK's `FinalizeBlock` method. Within `FinalizeBlock`, `internalFinalizeBlock` is executed, performing necessary state updates and function executions. The block gas meter, initialised each with a finite limit, is then incorporated into the context for transaction execution, ensuring gas consumption does not exceed the block's gas limit and is reset at the end of each block. + +Modules within the Cosmos SDK can consume block gas at any point during their execution by utilising the `ctx`. This gas consumption primarily occurs during state read/write operations and transaction processing. The block gas meter, accessible via `ctx.BlockGasMeter()`, monitors the total gas usage within a block, enforcing the gas limit to prevent excessive computation. This ensures that gas limits are adhered to on a per-block basis, starting from the first block post-genesis. ```go -ctx.BlockGasMeter().ConsumeGas( - ctx.GasMeter().GasConsumedToLimit(), - "block gas meter", -) +gasMeter := app.getBlockGasMeter(app.finalizeBlockState.Context()) +app.finalizeBlockState.SetContext(app.finalizeBlockState.Context().WithBlockGasMeter(gasMeter)) ``` +This above shows the general mechanism for setting the block gas meter with a finite limit based on the block's consensus parameters. + ## AnteHandler -The `AnteHandler` is run for every transaction during `CheckTx` and `DeliverTx`, before a Protobuf `Msg` service method for each `sdk.Msg` in the transaction. +The `AnteHandler` is run for every transaction during `CheckTx` and `FinalizeBlock`, before a Protobuf `Msg` service method for each `sdk.Msg` in the transaction. The anteHandler is not implemented in the core Cosmos SDK but in a module. That said, most applications today use the default implementation defined in the [`auth` module](https://github.com/cosmos/cosmos-sdk/tree/main/x/auth). Here is what the `anteHandler` is intended to do in a normal Cosmos SDK application: * Verify that the transactions are of the correct type. Transaction types are defined in the module that implements the `anteHandler`, and they follow the transaction interface: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/types/tx_msg.go#L42-L50 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/types/tx_msg.go#L51-L56 ``` This enables developers to play with various types for the transaction of their application. In the default `auth` module, the default transaction type is `Tx`: ```protobuf reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/tx/v1beta1/tx.proto#L13-L26 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/proto/cosmos/tx/v1beta1/tx.proto#L14-L27 ``` -* Verify signatures for each [`message`](../building-modules/02-messages-and-queries.md#messages) contained in the transaction. Each `message` should be signed by one or multiple sender(s), and these signatures must be verified in the `anteHandler`. +* Verify signatures for each [`message`](../../build/building-modules/02-messages-and-queries.md#messages) contained in the transaction. Each `message` should be signed by one or multiple sender(s), and these signatures must be verified in the `anteHandler`. * During `CheckTx`, verify that the gas prices provided with the transaction is greater than the local `min-gas-prices` (as a reminder, gas-prices can be deducted from the following equation: `fees = gas * gas-prices`). `min-gas-prices` is a parameter local to each full-node and used during `CheckTx` to discard transactions that do not provide a minimum amount of fees. This ensures that the mempool cannot be spammed with garbage transactions. * Verify that the sender of the transaction has enough funds to cover for the `fees`. When the end-user generates a transaction, they must indicate 2 of the 3 following parameters (the third one being implicit): `fees`, `gas` and `gas-prices`. This signals how much they are willing to pay for nodes to execute their transaction. The provided `gas` value is stored in a parameter called `GasWanted` for later use. -* Set `newCtx.GasMeter` to 0, with a limit of `GasWanted`. **This step is crucial**, as it not only makes sure the transaction cannot consume infinite gas, but also that `ctx.GasMeter` is reset in-between each `DeliverTx` (`ctx` is set to `newCtx` after `anteHandler` is run, and the `anteHandler` is run each time `DeliverTx` is called). +* Set `newCtx.GasMeter` to 0, with a limit of `GasWanted`. **This step is crucial**, as it not only makes sure the transaction cannot consume infinite gas, but also that `ctx.GasMeter` is reset in-between each transaction (`ctx` is set to `newCtx` after `anteHandler` is run, and the `anteHandler` is run each time a transactions executes). -As explained above, the `anteHandler` returns a maximum limit of `gas` the transaction can consume during execution called `GasWanted`. The actual amount consumed in the end is denominated `GasUsed`, and we must therefore have `GasUsed =< GasWanted`. Both `GasWanted` and `GasUsed` are relayed to the underlying consensus engine when [`DeliverTx`](../core/00-baseapp.md#delivertx) returns. +As explained above, the `anteHandler` returns a maximum limit of `gas` the transaction can consume during execution called `GasWanted`. The actual amount consumed in the end is denominated `GasUsed`, and we must therefore have `GasUsed =< GasWanted`. Both `GasWanted` and `GasUsed` are relayed to the underlying consensus engine when [`FinalizeBlock`](../advanced/00-baseapp.md#finalizeblock) returns. diff --git a/docs/docs/learn/beginner/_category_.json b/docs/docs/learn/beginner/_category_.json new file mode 100644 index 000000000000..d09097faee58 --- /dev/null +++ b/docs/docs/learn/beginner/_category_.json @@ -0,0 +1,5 @@ +{ + "label": "Beginner", + "position": 2, + "link": null +} \ No newline at end of file diff --git a/docs/docs/learn/intro/00-overview.md b/docs/docs/learn/intro/00-overview.md new file mode 100644 index 000000000000..a424dfdfe113 --- /dev/null +++ b/docs/docs/learn/intro/00-overview.md @@ -0,0 +1,43 @@ +--- +sidebar_position: 1 +--- + +# What is the Cosmos SDK + +The [Cosmos SDK](https://github.com/cosmos/cosmos-sdk) is an open-source toolkit for building multi-asset public Proof-of-Stake (PoS) blockchains, like the Cosmos Hub, as well as permissioned Proof-of-Authority (PoA) blockchains. Blockchains built with the Cosmos SDK are generally referred to as **application-specific blockchains**. + +The goal of the Cosmos SDK is to allow developers to easily create custom blockchains from scratch that can natively interoperate with other blockchains. +We further this modular approach by allowing developers to plug and play with different consensus engines this can range from the [CometBFT](https://github.com/cometbft/cometbft) or [Rollkit](https://rollkit.dev/). + +SDK-based blockchains have the choice to use the predefined modules or to build their own modules. What this means is that developers can build a blockchain that is tailored to their specific use case, without having to worry about the low-level details of building a blockchain from scratch. Predefined modules include staking, governance, and token issuance, among others. + +What's more, the Cosmos SDK is a capabilities-based system that allows developers to better reason about the security of interactions between modules. For a deeper look at capabilities, jump to [Object-Capability Model](../advanced/10-ocap.md). + +How you can look at this is if we imagine that the SDK is like a lego kit. You can choose to build the basic house from the instructions or you can choose to modify your house and add more floors, more doors, more windows. The choice is yours. + +## What are Application-Specific Blockchains + +One development paradigm in the blockchain world today is that of virtual-machine blockchains like Ethereum, where development generally revolves around building decentralized applications on top of an existing blockchain as a set of smart contracts. While smart contracts can be very good for some use cases like single-use applications (e.g. ICOs), they often fall short for building complex decentralized platforms. More generally, smart contracts can be limiting in terms of flexibility, sovereignty and performance. + +Application-specific blockchains offer a radically different development paradigm than virtual-machine blockchains. An application-specific blockchain is a blockchain customized to operate a single application: developers have all the freedom to make the design decisions required for the application to run optimally. They can also provide better sovereignty, security and performance. + +Learn more about [application-specific blockchains](./01-why-app-specific.md). + +## What is Modularity + +Today there is a lot of talk around modularity and discussions between monolithic and modular. Originally the Cosmos SDK was built with a vision of modularity in mind. Modularity is derived from splitting a blockchain into customizable layers of execution, consensus, settlement and data availability, which is what the Cosmos SDK enables. This means that developers can plug and play, making their blockchain customisable by using different software for different layers. For example you can choose to build a vanilla chain and use the Cosmos SDK with CometBFT. CometBFT will be your consensus layer and the chain itself would be the settlement and execution layer. Another route could be to use the SDK with Rollkit and Celestia as your consensus and data availability layer. The benefit of modularity is that you can customize your chain to your specific use case. + +## Why the Cosmos SDK + +The Cosmos SDK is the most advanced framework for building custom modular application-specific blockchains today. Here are a few reasons why you might want to consider building your decentralized application with the Cosmos SDK: + +* It allows you to plug and play and customize your consensus layer. As above you can use Rollkit and Celestia as your consensus and data availability layer. This offers a lot of flexibility and customisation. +* Previously the default consensus engine available within the Cosmos SDK is [CometBFT](https://github.com/cometbft/cometbft). CometBFT is the most (and only) mature BFT consensus engine in existence. It is widely used across the industry and is considered the gold standard consensus engine for building Proof-of-Stake systems. +* The Cosmos SDK is open-source and designed to make it easy to build blockchains out of composable [modules](../../build/modules). As the ecosystem of open-source Cosmos SDK modules grows, it will become increasingly easier to build complex decentralized platforms with it. +* The Cosmos SDK is inspired by capabilities-based security, and informed by years of wrestling with blockchain state-machines. This makes the Cosmos SDK a very secure environment to build blockchains. +* Most importantly, the Cosmos SDK has already been used to build many application-specific blockchains that are already in production. Among others, we can cite [Cosmos Hub](https://hub.cosmos.network), [IRIS Hub](https://irisnet.org), [Binance Chain](https://docs.binance.org/), [Terra](https://terra.money/) or [Kava](https://www.kava.io/). [Many more](https://cosmos.network/ecosystem) are building on the Cosmos SDK. + +## Getting started with the Cosmos SDK + +* Learn more about the [architecture of a Cosmos SDK application](./02-sdk-app-architecture.md) +* Learn how to build an application-specific blockchain from scratch with the [Cosmos SDK Tutorial](https://cosmos.network/docs/tutorial) diff --git a/docs/docs/intro/01-why-app-specific.md b/docs/docs/learn/intro/01-why-app-specific.md similarity index 99% rename from docs/docs/intro/01-why-app-specific.md rename to docs/docs/learn/intro/01-why-app-specific.md index 5830530ae706..0f0c1c64ed42 100644 --- a/docs/docs/intro/01-why-app-specific.md +++ b/docs/docs/learn/intro/01-why-app-specific.md @@ -58,7 +58,7 @@ The list above contains a few examples that show how much flexibility applicatio ### Performance -decentralized applications built with Smart Contracts are inherently capped in performance by the underlying environment. For a decentralized application to optimise performance, it needs to be built as an application-specific blockchain. Next are some of the benefits an application-specific blockchain brings in terms of performance: +Decentralized applications built with Smart Contracts are inherently capped in performance by the underlying environment. For a decentralized application to optimise performance, it needs to be built as an application-specific blockchain. Next are some of the benefits an application-specific blockchain brings in terms of performance: * Developers of application-specific blockchains can choose to operate with a novel consensus engine such as CometBFT BFT. Compared to Proof-of-Work (used by most virtual-machine blockchains today), it offers significant gains in throughput. * An application-specific blockchain only operates a single application, so that the application does not compete with others for computation and storage. This is the opposite of most non-sharded virtual-machine blockchains today, where smart contracts all compete for computation and storage. diff --git a/docs/docs/intro/02-sdk-app-architecture.md b/docs/docs/learn/intro/02-sdk-app-architecture.md similarity index 91% rename from docs/docs/intro/02-sdk-app-architecture.md rename to docs/docs/learn/intro/02-sdk-app-architecture.md index 465948bacac5..cc18c54d9d99 100644 --- a/docs/docs/intro/02-sdk-app-architecture.md +++ b/docs/docs/learn/intro/02-sdk-app-architecture.md @@ -84,8 +84,8 @@ Note that **CometBFT only handles transaction bytes**. It has no knowledge of wh Here are the most important messages of the ABCI: -* `CheckTx`: When a transaction is received by CometBFT, it is passed to the application to check if a few basic requirements are met. `CheckTx` is used to protect the mempool of full-nodes against spam transactions. . A special handler called the [`AnteHandler`](../basics/04-gas-fees.md#antehandler) is used to execute a series of validation steps such as checking for sufficient fees and validating the signatures. If the checks are valid, the transaction is added to the [mempool](https://docs.cometbft.com/v0.37/spec/p2p/messages/mempool) and relayed to peer nodes. Note that transactions are not processed (i.e. no modification of the state occurs) with `CheckTx` since they have not been included in a block yet. -* `DeliverTx`: When a [valid block](https://docs.cometbft.com/v0.37/spec/core/data_structures#block) is received by CometBFT, each transaction in the block is passed to the application via `DeliverTx` in order to be processed. It is during this stage that the state transitions occur. The `AnteHandler` executes again, along with the actual [`Msg` service](../building-modules/03-msg-services.md) RPC for each message in the transaction. +* `CheckTx`: When a transaction is received by CometBFT, it is passed to the application to check if a few basic requirements are met. `CheckTx` is used to protect the mempool of full-nodes against spam transactions. . A special handler called the [`AnteHandler`](../beginner/04-gas-fees.md#antehandler) is used to execute a series of validation steps such as checking for sufficient fees and validating the signatures. If the checks are valid, the transaction is added to the [mempool](https://docs.cometbft.com/v0.37/spec/p2p/messages/mempool) and relayed to peer nodes. Note that transactions are not processed (i.e. no modification of the state occurs) with `CheckTx` since they have not been included in a block yet. +* `DeliverTx`: When a [valid block](https://docs.cometbft.com/v0.37/spec/core/data_structures#block) is received by CometBFT, each transaction in the block is passed to the application via `DeliverTx` in order to be processed. It is during this stage that the state transitions occur. The `AnteHandler` executes again, along with the actual [`Msg` service](../../build/building-modules/03-msg-services.md) RPC for each message in the transaction. * `BeginBlock`/`EndBlock`: These messages are executed at the beginning and the end of each block, whether the block contains transactions or not. It is useful to trigger automatic execution of logic. Proceed with caution though, as computationally expensive loops could slow down your blockchain, or even freeze it if the loop is infinite. Find a more detailed view of the ABCI methods from the [CometBFT docs](https://docs.cometbft.com/v0.37/spec/abci/). diff --git a/docs/docs/intro/03-sdk-design.md b/docs/docs/learn/intro/03-sdk-design.md similarity index 83% rename from docs/docs/intro/03-sdk-design.md rename to docs/docs/learn/intro/03-sdk-design.md index 6b6fd68e64d2..f392ec9502a9 100644 --- a/docs/docs/intro/03-sdk-design.md +++ b/docs/docs/learn/intro/03-sdk-design.md @@ -4,7 +4,7 @@ sidebar_position: 1 # Main Components of the Cosmos SDK -The Cosmos SDK is a framework that facilitates the development of secure state-machines on top of CometBFT. At its core, the Cosmos SDK is a boilerplate implementation of the [ABCI](./02-sdk-app-architecture.md#abci) in Golang. It comes with a [`multistore`](../core/04-store.md#multistore) to persist data and a [`router`](../core/00-baseapp.md#routing) to handle transactions. +The Cosmos SDK is a framework that facilitates the development of secure state-machines on top of CometBFT. At its core, the Cosmos SDK is a boilerplate implementation of the [ABCI](./02-sdk-app-architecture.md#abci) in Golang. It comes with a [`multistore`](../advanced/04-store.md#multistore) to persist data and a [`router`](../advanced/00-baseapp.md#routing) to handle transactions. Here is a simplified view of how transactions are handled by an application built on top of the Cosmos SDK when transferred from CometBFT via `DeliverTx`: @@ -15,23 +15,23 @@ Here is a simplified view of how transactions are handled by an application buil ## `baseapp` -`baseapp` is the boilerplate implementation of a Cosmos SDK application. It comes with an implementation of the ABCI to handle the connection with the underlying consensus engine. Typically, a Cosmos SDK application extends `baseapp` by embedding it in [`app.go`](../basics/00-app-anatomy.md#core-application-file). +`baseapp` is the boilerplate implementation of a Cosmos SDK application. It comes with an implementation of the ABCI to handle the connection with the underlying consensus engine. Typically, a Cosmos SDK application extends `baseapp` by embedding it in [`app.go`](../beginner/00-app-anatomy.md#core-application-file). Here is an example of this from `simapp`, the Cosmos SDK demonstration app: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/app.go#L164-L203 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/app.go#L170-L212 ``` The goal of `baseapp` is to provide a secure interface between the store and the extensible state machine while defining as little about the state machine as possible (staying true to the ABCI). -For more on `baseapp`, please click [here](../core/00-baseapp.md). +For more on `baseapp`, please click [here](../advanced/00-baseapp.md). ## Multistore -The Cosmos SDK provides a [`multistore`](../core/04-store.md#multistore) for persisting state. The multistore allows developers to declare any number of [`KVStores`](../core/04-store.md#base-layer-kvstores). These `KVStores` only accept the `[]byte` type as value and therefore any custom structure needs to be marshalled using [a codec](../core/05-encoding.md) before being stored. +The Cosmos SDK provides a [`multistore`](../advanced/04-store.md#multistore) for persisting state. The multistore allows developers to declare any number of [`KVStores`](../advanced/04-store.md#base-layer-kvstores). These `KVStores` only accept the `[]byte` type as value and therefore any custom structure needs to be marshalled using [a codec](../advanced/05-encoding.md) before being stored. -The multistore abstraction is used to divide the state in distinct compartments, each managed by its own module. For more on the multistore, click [here](../core/04-store.md#multistore) +The multistore abstraction is used to divide the state in distinct compartments, each managed by its own module. For more on the multistore, click [here](../advanced/04-store.md#multistore) ## Modules @@ -84,7 +84,7 @@ Here is a simplified view of how a transaction is processed by the application o v ``` -Each module can be seen as a little state-machine. Developers need to define the subset of the state handled by the module, as well as custom message types that modify the state (*Note:* `messages` are extracted from `transactions` by `baseapp`). In general, each module declares its own `KVStore` in the `multistore` to persist the subset of the state it defines. Most developers will need to access other 3rd party modules when building their own modules. Given that the Cosmos SDK is an open framework, some of the modules may be malicious, which means there is a need for security principles to reason about inter-module interactions. These principles are based on [object-capabilities](../core/10-ocap.md). In practice, this means that instead of having each module keep an access control list for other modules, each module implements special objects called `keepers` that can be passed to other modules to grant a pre-defined set of capabilities. +Each module can be seen as a little state-machine. Developers need to define the subset of the state handled by the module, as well as custom message types that modify the state (*Note:* `messages` are extracted from `transactions` by `baseapp`). In general, each module declares its own `KVStore` in the `multistore` to persist the subset of the state it defines. Most developers will need to access other 3rd party modules when building their own modules. Given that the Cosmos SDK is an open framework, some of the modules may be malicious, which means there is a need for security principles to reason about inter-module interactions. These principles are based on [object-capabilities](../advanced/10-ocap.md). In practice, this means that instead of having each module keep an access control list for other modules, each module implements special objects called `keepers` that can be passed to other modules to grant a pre-defined set of capabilities. Cosmos SDK modules are defined in the `x/` folder of the Cosmos SDK. Some core modules include: diff --git a/docs/docs/intro/_category_.json b/docs/docs/learn/intro/_category_.json similarity index 72% rename from docs/docs/intro/_category_.json rename to docs/docs/learn/intro/_category_.json index b218fe9be4aa..bb0bcd14af39 100644 --- a/docs/docs/intro/_category_.json +++ b/docs/docs/learn/intro/_category_.json @@ -1,5 +1,5 @@ { "label": "Introduction", - "position": 0, + "position": 1, "link": null } \ No newline at end of file diff --git a/docs/docs/learn/learn.md b/docs/docs/learn/learn.md new file mode 100644 index 000000000000..af624fa3048e --- /dev/null +++ b/docs/docs/learn/learn.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 0 +--- +# Learn + +* [Introduction](./intro/00-overview.md) - Dive into the fundamentals of Cosmos SDK with an insightful introduction, +laying the groundwork for understanding blockchain development. In this section we provide a High-Level Overview of the SDK, then dive deeper into Core concepts such as Application-Specific Blockchains, Blockchain Architecture, and finally we begin to explore what are the main components of the SDK. +* [Beginner](./beginner/00-app-anatomy.md) - Start your journey with beginner-friendly resources in the Cosmos SDK's "Learn" +section, providing a gentle entry point for newcomers to blockchain development. Here we focus on a little more detail, covering the Anatomy of a Cosmos SDK Application, Transaction Lifecycles, Accounts and lastly, Gas and Fees. +* [Advanced](./advanced/00-baseapp.md) - Level up your Cosmos SDK expertise with advanced topics, tailored for experienced +developers diving into intricate blockchain application development. We cover the Cosmos SDK on a lower level as we dive into the core of the SDK with BaseApp, Transactions, Context, Node Client (Daemon), Store, Encoding, gRPC, REST, and CometBFT Endpoints, CLI, Events, Telementry, Object-Capability Model, RunTx recovery middleware, Cosmos Blockchain Simulator, Protobuf Documentation, In-Place Store Migrations, Configuration and AutoCLI. diff --git a/docs/docs/migrations/_category_.json b/docs/docs/migrations/_category_.json deleted file mode 100644 index add3887b861b..000000000000 --- a/docs/docs/migrations/_category_.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "label": "SDK Migrations", - "position": 6, - "link": null -} \ No newline at end of file diff --git a/docs/docs/modules/_category_.json b/docs/docs/modules/_category_.json deleted file mode 100644 index 6038c766228e..000000000000 --- a/docs/docs/modules/_category_.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "label": "SDK Modules", - "position": 7, - "link": null -} \ No newline at end of file diff --git a/docs/docs/run-node/00-keyring.md b/docs/docs/user/run-node/00-keyring.md similarity index 89% rename from docs/docs/run-node/00-keyring.md rename to docs/docs/user/run-node/00-keyring.md index 2cb15b115cfd..f96fa7d22607 100644 --- a/docs/docs/run-node/00-keyring.md +++ b/docs/docs/user/run-node/00-keyring.md @@ -5,7 +5,7 @@ sidebar_position: 1 # Setting up the keyring :::note Synopsis -This document describes how to configure and use the keyring and its various backends for an [**application**](../basics/00-app-anatomy.md). +This document describes how to configure and use the keyring and its various backends for an [**application**](../../learn/beginner/00-app-anatomy.md). ::: The keyring holds the private/public keypairs used to interact with a node. For instance, a validator key needs to be set up before running the blockchain node, so that blocks can be correctly signed. The private key can be stored in different locations, called "backends", such as a file or the operating system's own key storage. @@ -29,12 +29,14 @@ is a list of the most popular operating systems and their respective passwords m * GNU/Linux: * [libsecret](https://gitlab.gnome.org/GNOME/libsecret) * [kwallet](https://api.kde.org/frameworks/kwallet/html/index.html) + * [keyctl](https://www.kernel.org/doc/html/latest/security/keys/core.html) GNU/Linux distributions that use GNOME as default desktop environment typically come with [Seahorse](https://wiki.gnome.org/Apps/Seahorse). Users of KDE based distributions are commonly provided with [KDE Wallet Manager](https://userbase.kde.org/KDE_Wallet_Manager). Whilst the former is in fact a `libsecret` convenient frontend, the latter is a `kwallet` -client. +client. `keyctl` is a secure backend leverages the Linux's kernel security key management system +to store cryptographic keys securely in memory. `os` is the default option since operating system's default credentials managers are designed to meet users' most common needs and provide them with a comfortable @@ -93,6 +95,15 @@ GNU/Linux distributions that ships KDE as default desktop environment. Please re [KWallet Handbook](https://docs.kde.org/stable5/en/kdeutils/kwallet5/index.html) for more information. +### The `keyctl` backend + +The *Kernel Key Retention Service* is a security facility that +has been added to the Linux kernel relatively recently. It allows sensitive +cryptographic data such as passwords, private key, authentication tokens, etc +to be stored securely in memory. + +The `keyctl` backend is available on Linux platforms only. + ### The `test` backend The `test` backend is a password-less variation of the `file` backend. Keys are stored @@ -108,7 +119,7 @@ The `memory` backend stores keys in memory. The keys are immediately deleted aft ### Setting backend using the env variable -You can set the keyring-backend using env variable: `BINNAME_KEYRING_BACKEND`. For example, if you binary name is `gaia-v5` then set: `export GAIA_V5_KEYRING_BACKEND=pass` +You can set the keyring-backend using env variable: `BINNAME_KEYRING_BACKEND`. For example, if your binary name is `gaia-v5` then set: `export GAIA_V5_KEYRING_BACKEND=pass` ## Adding keys to the keyring diff --git a/docs/docs/run-node/01-run-node.md b/docs/docs/user/run-node/01-run-node.md similarity index 83% rename from docs/docs/run-node/01-run-node.md rename to docs/docs/user/run-node/01-run-node.md index 64300b4a0046..f16eb42f52de 100644 --- a/docs/docs/run-node/01-run-node.md +++ b/docs/docs/user/run-node/01-run-node.md @@ -8,11 +8,9 @@ sidebar_position: 1 Now that the application is ready and the keyring populated, it's time to see how to run the blockchain node. In this section, the application we are running is called [`simapp`](https://github.com/cosmos/cosmos-sdk/tree/main/simapp), and its corresponding CLI binary `simd`. ::: -:::note +:::note Pre-requisite Readings -### Pre-requisite Readings - -* [Anatomy of a Cosmos SDK Application](../basics/00-app-anatomy.md) +* [Anatomy of a Cosmos SDK Application](../../learn/beginner/00-app-anatomy.md) * [Setting up the keyring](./00-keyring.md) ::: @@ -30,7 +28,12 @@ Before actually running the node, we need to initialize the chain, and most impo simd init --chain-id my-test-chain ``` -The command above creates all the configuration files needed for your node to run, as well as a default genesis file, which defines the initial state of the network. All these configuration files are in `~/.simapp` by default, but you can overwrite the location of this folder by passing the `--home` flag. +The command above creates all the configuration files needed for your node to run, as well as a default genesis file, which defines the initial state of the network. + +:::tip +All these configuration files are in `~/.simapp` by default, but you can overwrite the location of this folder by passing the `--home` flag to each commands, +or set an `$APPD_HOME` environment variable (where `APPD` is the name of the binary). +::: The `~/.simapp` folder has the following structure: @@ -82,9 +85,9 @@ Now that you have created a local account, go ahead and grant it some `stake` to simd genesis add-genesis-account $MY_VALIDATOR_ADDRESS 100000000000stake ``` -Recall that `$MY_VALIDATOR_ADDRESS` is a variable that holds the address of the `my_validator` key in the [keyring](./00-keyring.md#adding-keys-to-the-keyring). Also note that the tokens in the Cosmos SDK have the `{amount}{denom}` format: `amount` is is a 18-digit-precision decimal number, and `denom` is the unique token identifier with its denomination key (e.g. `atom` or `uatom`). Here, we are granting `stake` tokens, as `stake` is the token identifier used for staking in [`simapp`](https://github.com/cosmos/cosmos-sdk/tree/main/simapp). For your own chain with its own staking denom, that token identifier should be used instead. +Recall that `$MY_VALIDATOR_ADDRESS` is a variable that holds the address of the `my_validator` key in the [keyring](./00-keyring.md#adding-keys-to-the-keyring). Also note that the tokens in the Cosmos SDK have the `{amount}{denom}` format: `amount` is an 18-digit-precision decimal number, and `denom` is the unique token identifier with its denomination key (e.g. `atom` or `uatom`). Here, we are granting `stake` tokens, as `stake` is the token identifier used for staking in [`simapp`](https://github.com/cosmos/cosmos-sdk/tree/main/simapp). For your own chain with its own staking denom, that token identifier should be used instead. -Now that your account has some tokens, you need to add a validator to your chain. Validators are special full-nodes that participate in the consensus process (implemented in the [underlying consensus engine](../intro/02-sdk-app-architecture.md#cometbft)) in order to add new blocks to the chain. Any account can declare its intention to become a validator operator, but only those with sufficient delegation get to enter the active set (for example, only the top 125 validator candidates with the most delegation get to be validators in the Cosmos Hub). For this guide, you will add your local node (created via the `init` command above) as a validator of your chain. Validators can be declared before a chain is first started via a special transaction included in the genesis file called a `gentx`: +Now that your account has some tokens, you need to add a validator to your chain. Validators are special full-nodes that participate in the consensus process (implemented in the [underlying consensus engine](../../learn/intro/02-sdk-app-architecture.md#cometbft)) in order to add new blocks to the chain. Any account can declare its intention to become a validator operator, but only those with sufficient delegation get to enter the active set (for example, only the top 125 validator candidates with the most delegation get to be validators in the Cosmos Hub). For this guide, you will add your local node (created via the `init` command above) as a validator of your chain. Validators can be declared before a chain is first started via a special transaction included in the genesis file called a `gentx`: ```bash # Create a gentx. @@ -152,7 +155,14 @@ You should see blocks come in. The previous command allow you to run a single node. This is enough for the next section on interacting with this node, but you may wish to run multiple nodes at the same time, and see how consensus happens between them. -The naive way would be to run the same commands again in separate terminal windows. This is possible, however in the Cosmos SDK, we leverage the power of [Docker Compose](https://docs.docker.com/compose/) to run a localnet. If you need inspiration on how to set up your own localnet with Docker Compose, you can have a look at the Cosmos SDK's [`docker-compose.yml`](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/docker-compose.yml). +The naive way would be to run the same commands again in separate terminal windows. This is possible, however in the Cosmos SDK, we leverage the power of [Docker Compose](https://docs.docker.com/compose/) to run a localnet. If you need inspiration on how to set up your own localnet with Docker Compose, you can have a look at the Cosmos SDK's [`docker-compose.yml`](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/docker-compose.yml). + +### Standalone App/CometBFT + +By default, the Cosmos SDK runs CometBFT in-process with the application +If you want to run the application and CometBFT in separate processes, +start the application with the `--with-comet=false` flag +and set `rpc.laddr` in `config.toml` to the CometBFT node's RPC address. ## Logging diff --git a/docs/docs/run-node/02-interact-node.md b/docs/docs/user/run-node/02-interact-node.md similarity index 92% rename from docs/docs/run-node/02-interact-node.md rename to docs/docs/user/run-node/02-interact-node.md index aaade7bcef14..a511aec41836 100644 --- a/docs/docs/run-node/02-interact-node.md +++ b/docs/docs/user/run-node/02-interact-node.md @@ -8,11 +8,9 @@ sidebar_position: 1 There are multiple ways to interact with a node: using the CLI, using gRPC or using the REST endpoints. ::: -:::note +:::note Pre-requisite Readings -### Pre-requisite Readings - -* [gRPC, REST and CometBFT Endpoints](../core/06-grpc_rest.md) +* [gRPC, REST and CometBFT Endpoints](../../learn/advanced/06-grpc_rest.md) * [Running a Node](./01-run-node.md) ::: @@ -56,7 +54,7 @@ You should see two delegations, the first one made from the `gentx`, and the sec ## Using gRPC -The Protobuf ecosystem developed tools for different use cases, including code-generation from `*.proto` files into various languages. These tools allow the building of clients easily. Often, the client connection (i.e. the transport) can be plugged and replaced very easily. Let's explore one of the most popular transport: [gRPC](../core/06-grpc_rest.md). +The Protobuf ecosystem developed tools for different use cases, including code-generation from `*.proto` files into various languages. These tools allow the building of clients easily. Often, the client connection (i.e. the transport) can be plugged and replaced very easily. Let's explore one of the most popular transport: [gRPC](../../learn/advanced/06-grpc_rest.md). Since the code generation library largely depends on your own tech stack, we will only present three alternatives: @@ -68,7 +66,7 @@ Since the code generation library largely depends on your own tech stack, we wil [grpcurl](https://github.com/fullstorydev/grpcurl) is like `curl` but for gRPC. It is also available as a Go library, but we will use it only as a CLI command for debugging and testing purposes. Follow the instructions in the previous link to install it. -Assuming you have a local node running (either a localnet, or connected a live network), you should be able to run the following command to list the Protobuf services available (you can replace `localhost:9000` by the gRPC server endpoint of another node, which is configured under the `grpc.address` field inside [`app.toml`](../run-node/01-run-node.md#configuring-the-node-using-apptoml)): +Assuming you have a local node running (either a localnet, or connected a live network), you should be able to run the following command to list the Protobuf services available (you can replace `localhost:9000` by the gRPC server endpoint of another node, which is configured under the `grpc.address` field inside [`app.toml`](../run-node/01-run-node.md#configuring-the-node-using-apptoml-and-configtoml)): ```bash grpcurl -plaintext localhost:9090 list @@ -250,7 +248,7 @@ CosmJS documentation can be found at [https://cosmos.github.io/cosmjs](https://c ## Using the REST Endpoints -As described in the [gRPC guide](../core/06-grpc_rest.md), all gRPC services on the Cosmos SDK are made available for more convenient REST-based queries through gRPC-gateway. The format of the URL path is based on the Protobuf service method's full-qualified name, but may contain small customizations so that final URLs look more idiomatic. For example, the REST endpoint for the `cosmos.bank.v1beta1.Query/AllBalances` method is `GET /cosmos/bank/v1beta1/balances/{address}`. Request arguments are passed as query parameters. +As described in the [gRPC guide](../../learn/advanced/06-grpc_rest.md), all gRPC services on the Cosmos SDK are made available for more convenient REST-based queries through gRPC-gateway. The format of the URL path is based on the Protobuf service method's full-qualified name, but may contain small customizations so that final URLs look more idiomatic. For example, the REST endpoint for the `cosmos.bank.v1beta1.Query/AllBalances` method is `GET /cosmos/bank/v1beta1/balances/{address}`. Request arguments are passed as query parameters. Note that the REST endpoints are not enabled by default. To enable them, edit the `api` section of your `~/.simapp/config/app.toml` file: @@ -270,7 +268,7 @@ curl \ Make sure to replace `localhost:1317` with the REST endpoint of your node, configured under the `api.address` field. -The list of all available REST endpoints is available as a Swagger specification file, it can be viewed at `localhost:1317/swagger`. Make sure that the `api.swagger` field is set to true in your [`app.toml`](../run-node/01-run-node.md#configuring-the-node-using-apptoml) file. +The list of all available REST endpoints is available as a Swagger specification file, it can be viewed at `localhost:1317/swagger`. Make sure that the `api.swagger` field is set to true in your [`app.toml`](../run-node/01-run-node.md#configuring-the-node-using-apptoml-and-configtoml) file. ### Query for historical state using REST @@ -288,4 +286,4 @@ Assuming the state at that block has not yet been pruned by the node, this query ### Cross-Origin Resource Sharing (CORS) -[CORS policies](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) are not enabled by default to help with security. If you would like to use the rest-server in a public environment we recommend you provide a reverse proxy, this can be done with [nginx](https://www.nginx.com/). For testing and development purposes there is an `enabled-unsafe-cors` field inside [`app.toml`](../run-node/01-run-node.md#configuring-the-node-using-apptoml). +[CORS policies](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) are not enabled by default to help with security. If you would like to use the rest-server in a public environment we recommend you provide a reverse proxy, this can be done with [nginx](https://www.nginx.com/). For testing and development purposes there is an `enabled-unsafe-cors` field inside [`app.toml`](../run-node/01-run-node.md#configuring-the-node-using-apptoml-and-configtoml). diff --git a/docs/docs/run-node/03-txs.md b/docs/docs/user/run-node/03-txs.md similarity index 98% rename from docs/docs/run-node/03-txs.md rename to docs/docs/user/run-node/03-txs.md index c8d2b610b159..106f02e8e8e8 100644 --- a/docs/docs/run-node/03-txs.md +++ b/docs/docs/user/run-node/03-txs.md @@ -147,7 +147,7 @@ priv3, _, addr3 := testdata.KeyTestPubAddr() Populating the `TxBuilder` can be done via its methods: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/client/tx_config.go#L33-L50 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/client/tx_config.go#L33-L50 ``` ```go @@ -269,7 +269,7 @@ func sendTx() error { ### Broadcasting a Transaction -The preferred way to broadcast a transaction is to use gRPC, though using REST (via `gRPC-gateway`) or the CometBFT RPC is also posible. An overview of the differences between these methods is exposed [here](../core/06-grpc_rest.md). For this tutorial, we will only describe the gRPC method. +The preferred way to broadcast a transaction is to use gRPC, though using REST (via `gRPC-gateway`) or the CometBFT RPC is also posible. An overview of the differences between these methods is exposed [here](../../learn/advanced/06-grpc_rest.md). For this tutorial, we will only describe the gRPC method. ```go import ( diff --git a/docs/docs/run-node/05-run-testnet.md b/docs/docs/user/run-node/05-run-testnet.md similarity index 100% rename from docs/docs/run-node/05-run-testnet.md rename to docs/docs/user/run-node/05-run-testnet.md diff --git a/docs/docs/run-node/06-run-production.md b/docs/docs/user/run-node/06-run-production.md similarity index 100% rename from docs/docs/run-node/06-run-production.md rename to docs/docs/user/run-node/06-run-production.md diff --git a/docs/docs/run-node/_category_.json b/docs/docs/user/run-node/_category_.json similarity index 77% rename from docs/docs/run-node/_category_.json rename to docs/docs/user/run-node/_category_.json index 375a7c423023..65e64b945f56 100644 --- a/docs/docs/run-node/_category_.json +++ b/docs/docs/user/run-node/_category_.json @@ -1,5 +1,5 @@ { "label": "Running a Node, API and CLI", - "position": 5, + "position": 0, "link": null } \ No newline at end of file diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 9d5007d122c5..ce1aff326752 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -4,6 +4,9 @@ const lightCodeTheme = require("prism-react-renderer/themes/github"); const darkCodeTheme = require("prism-react-renderer/themes/dracula"); +const lastVersion = "current"; +// const lastVersion = "v0.50"; + /** @type {import('@docusaurus/types').Config} */ const config = { title: "Cosmos SDK", @@ -37,16 +40,16 @@ const config = { docs: { sidebarPath: require.resolve("./sidebars.js"), routeBasePath: "/", - lastVersion: "v0.47", + lastVersion: lastVersion, versions: { current: { path: "main", - banner: "unreleased", - }, - "v0.47": { - path: "v0.47", - label: "v0.47", + // banner: "unreleased", }, + // "v0.50": { + // path: "v0.50", + // label: "v0.50", + // }, }, }, theme: { @@ -212,6 +215,24 @@ const config = { { fromExtensions: ["html"], toExtensions: ["html"], + createRedirects(existingPath) { + return [ + existingPath.replace('/core', '/learn/advanced'), + existingPath.replace('/basics', '/learn/beginner'), + existingPath.replace('/intro', '/learn/intro'), + existingPath.replace('/architecture', '/build/architecture/'), + existingPath.replace('/building-apps', '/build/building-apps'), + existingPath.replace('/building-modules', '/build/building-modules'), + existingPath.replace('/tooling', '/build/tooling'), + existingPath.replace('/migrations', '/build/migrations'), + existingPath.replace('/modules', '/build/modules'), + existingPath.replace('/rfc', '/build/rfc'), + existingPath.replace('/spec', '/build/spec'), + existingPath.replace('/tooling', '/build/tooling'), + existingPath.replace('/run-node', '/user/run-node'), + existingPath.replace('/validate', '/user/validate') + ]; + }, redirects: [ { from: ["/", "/master", "/v0.43", "/v0.44"], @@ -226,11 +247,11 @@ const config = { "/main/modules/auth/06_params", "/main/modules/auth/07_client", ], - to: "/main/modules/auth", + to: "/main/build/modules/auth", }, { from: "/main/modules/auth/05_vesting", - to: "/main/modules/auth/vesting", + to: "/main/build/modules/auth/vesting", }, { from: [ @@ -240,7 +261,7 @@ const config = { "/main/modules/authz/04_events", "/main/modules/authz/05_client", ], - to: "/main/modules/authz", + to: "/main/build/modules/authz", }, { from: [ @@ -250,7 +271,7 @@ const config = { "/main/modules/bank/05_params", "/main/modules/bank/06_client", ], - to: "/main/modules/bank", + to: "/main/build/modules/bank", }, { from: [ @@ -260,7 +281,7 @@ const config = { "/main/modules/crisis/04_params", "/main/modules/crisis/05_client", ], - to: "/main/modules/crisis", + to: "/main/build/modules/crisis", }, { from: [ @@ -273,7 +294,7 @@ const config = { "/main/modules/distribution/07_params", "/main/modules/distribution/08_client", ], - to: "/main/modules/distribution", + to: "/main/build/modules/distribution", }, { from: [ @@ -285,7 +306,7 @@ const config = { "/main/modules/evidence/06_begin_block", "/main/modules/evidence/07_client", ], - to: "/main/modules/evidence", + to: "/main/build/modules/evidence", }, { from: [ @@ -295,7 +316,7 @@ const config = { "/main/modules/feegrant/04_events", "/main/modules/feegrant/05_client", ], - to: "/main/modules/feegrant", + to: "/main/build/modules/feegrant", }, { from: [ @@ -308,7 +329,7 @@ const config = { "/main/modules/gov/07_client", "/main/modules/gov/08_metadata", ], - to: "/main/modules/gov", + to: "/main/build/modules/gov", }, { from: [ @@ -319,7 +340,7 @@ const config = { "/main/modules/group/05_client", "/main/modules/group/06_metadata", ], - to: "/main/modules/group/", + to: "/main/build/modules/group/", }, { from: [ @@ -330,7 +351,7 @@ const config = { "/main/modules/mint/05_events", "/main/modules/mint/06_client", ], - to: "/main/modules/mint/", + to: "/main/build/modules/mint/", }, { from: [ @@ -339,14 +360,14 @@ const config = { "/main/modules/nft/03_messages", "/main/modules/nft/04_events", ], - to: "/main/modules/nft/", + to: "/main/build/modules/nft/", }, { from: [ "/main/modules/params/01_keeper", "/main/modules/params/02_subspace", ], - to: "/main/modules/params/", + to: "/main/build/modules/params/", }, { from: [ @@ -360,7 +381,7 @@ const config = { "/main/modules/slashing/08_params", "/main/modules/slashing/09_client", ], - to: "/main/modules/slashing/", + to: "/main/build/modules/slashing/", }, { from: [ @@ -374,7 +395,7 @@ const config = { "/main/modules/staking/08_params", "/main/modules/staking/09_client", ], - to: "/main/modules/staking/", + to: "/main/build/modules/staking/", }, { from: [ @@ -383,31 +404,35 @@ const config = { "/main/modules/upgrade/03_events", "/main/modules/upgrade/04_client", ], - to: "/main/modules/upgrade/", + to: "/main/build/modules/upgrade/", }, { from: ["/main/modules/capability", "/main/ecosystem"], - to: "/main/modules", + to: "/main/build/modules/auth", }, { from: ["/main/spec/circuit-breaker"], - to: "/main/modules/circuit", + to: "/main/build/modules/circuit", }, { from: ["/main/spec/reserve-pool"], - to: "/main/modules/distribution", + to: "/main/build/modules/distribution", }, { from: ["/main/run-node/cosmovisor"], - to: "/main/tooling/cosmovisor", + to: "/main/build/tooling/cosmovisor", }, { from: ["/main/migrations/pre-upgrade"], - to: "/main/building-apps/app-upgrade", + to: "/main/build/building-apps/app-upgrade", }, { from: ["/main/tooling/depinject"], - to: "/main/packages/depinject", + to: "/main/build/packages/depinject", + }, + { + from: ["/main/building-modules/autocli"], + to: "/main/learn/advanced/autocli", }, ], }, diff --git a/docs/post.sh b/docs/post.sh index a70eb526ad0c..c10a7541f6a1 100755 --- a/docs/post.sh +++ b/docs/post.sh @@ -1,15 +1,16 @@ #!/usr/bin/env bash -find docs/modules ! -name '_category_.json' -type f -exec rm -rf {} + -rm -rf docs/tooling/01-cosmovisor.md -rm -rf docs/tooling/02-confix.md -rm -rf docs/tooling/03-hubl.md -rm -rf docs/packages/01-depinject.md -rm -rf docs/packages/02-collections.md -rm -rf docs/packages/03-orm.md -rm -rf docs/run-node/04-rosetta.md -rm -rf docs/architecture -rm -rf docs/spec -rm -rf docs/rfc -rm -rf docs/migrations/02-upgrading.md -rm -rf versioned_docs versioned_sidebars versions.json \ No newline at end of file +find docs/build/modules ! -name '_category_.json' -type f -exec rm -rf {} + +rm -rf docs/build/tooling/01-cosmovisor.md +rm -rf docs/build/tooling/02-confix.md +rm -rf docs/build/tooling/03-hubl.md +rm -rf docs/build/packages/01-depinject.md +rm -rf docs/build/packages/02-collections.md +rm -rf docs/learn/advaced-concepts/17-autocli.md +rm -rf docs/user/run-node/04-rosetta.md +rm -rf docs/build/architecture +rm -rf docs/build/spec +rm -rf docs/build/rfc +rm -rf docs/learn/advanced/17-autocli.md +rm -rf docs/build/migrations/02-upgrading.md +rm -rf versioned_docs versioned_sidebars versions.json diff --git a/docs/pre.sh b/docs/pre.sh index cbe88f049ae8..9ec8b7820c4e 100755 --- a/docs/pre.sh +++ b/docs/pre.sh @@ -3,41 +3,44 @@ ## Create modules pages for D in ../x/*; do if [ -d "${D}" ]; then - MODDOC=docs/modules/$(echo $D | awk -F/ '{print $NF}') + DIR_NAME=$(echo $D | awk -F/ '{print $NF}') + MODDOC=docs/build/modules/$DIR_NAME rm -rf $MODDOC - mkdir -p $MODDOC && cp -r $D/README.md "$_" + mkdir -p $MODDOC + if [ -f "$D/README.md" ]; then + cp -r $D/README.md $MODDOC/ + fi fi done + ## Vesting is a submodule of auth, but we still want to display it in docs ## TODO to be removed in https://github.com/cosmos/cosmos-sdk/issues/9958 -cp ../x/auth/vesting/README.md ./docs/modules/auth/1-vesting.md -cp ../x/auth/tx/README.md ./docs/modules/auth/2-tx.md +cp ../x/auth/vesting/README.md ./docs/build/modules/auth/1-vesting.md +cp ../x/auth/tx/README.md ./docs/build/modules/auth/2-tx.md ## Add modules page list -cat ../x/README.md | sed 's/\.\.\/docs\/building-modules\/README\.md/\/building-modules\/intro\.html/g' > ./docs/modules/README.md +cat ../x/README.md | sed 's/\.\.\/docs\/build\/building-modules\/README\.md/\/building-modules\/intro\.html/g' > ./docs/modules/README.md ## Add tooling documentation -cp ../tools/cosmovisor/README.md ./docs/tooling/01-cosmovisor.md -cp ../tools/confix/README.md ./docs/tooling/02-confix.md -cp ../tools/hubl/README.md ./docs/tooling/03-hubl.md +cp ../tools/cosmovisor/README.md ./docs/build/tooling/01-cosmovisor.md +cp ../tools/confix/README.md ./docs/build/tooling/02-confix.md +cp ../tools/hubl/README.md ./docs/build/tooling/03-hubl.md +wget -O docs/user/run-node/04-rosetta.md https://raw.githubusercontent.com/cosmos/rosetta/main/README.md ## Add package documentation -cp ../depinject/README.md ./docs/packages/01-depinject.md -cp ../collections/README.md ./docs/packages/02-collections.md -cp ../orm/README.md ./docs/packages/03-orm.md - -## Add rosetta documentation -cp ../tools/rosetta/README.md ./docs/run-node/04-rosetta.md +cp ../client/v2/README.md ./docs/learn/advanced/17-autocli.md +cp ../depinject/README.md ./docs/build/packages/01-depinject.md +cp ../collections/README.md ./docs/build/packages/02-collections.md ## Add architecture documentation -cp -r ./architecture ./docs +cp -r ./architecture ./docs/build ## Add spec documentation -cp -r ./spec ./docs +cp -r ./spec ./docs/build ## Add rfc documentation -cp -r ./rfc ./docs +cp -r ./rfc ./docs/build/rfc ## Add SDK migration documentation -cp -r ../UPGRADING.md ./docs/migrations/02-upgrading.md \ No newline at end of file +cp -r ../UPGRADING.md ./docs/build/migrations/02-upgrading.md diff --git a/docs/rfc/README.md b/docs/rfc/README.md index 24887ac3f668..8b8ead2414ca 100644 --- a/docs/rfc/README.md +++ b/docs/rfc/README.md @@ -13,7 +13,7 @@ discussion that might otherwise only be recorded in an ad-hoc way (for example, via gists or Google docs) that are difficult to discover for someone after the fact. An RFC _may_ give rise to more specific architectural _decisions_ for the Cosmos SDK, but those decisions must be recorded separately in -[Architecture Decision Records (ADR)](../architecture/). +[Architecture Decision Records (ADR)](../architecture). As a rule of thumb, if you can articulate a specific question that needs to be answered, write an ADR. If you need to explore the topic and get input from @@ -35,4 +35,4 @@ sections. ## Table of Contents - +* [RFC-001: Tx Validation](./rfc-001-tx-validation.md) diff --git a/docs/rfc/_category_.json b/docs/rfc/_category_.json index 40fac9822465..a5712bdaeec1 100644 --- a/docs/rfc/_category_.json +++ b/docs/rfc/_category_.json @@ -1,5 +1,5 @@ { - "label": "RFCs", - "position": 12, - "link": null + "label": "RFC", + "position": 7, + "link": null } \ No newline at end of file diff --git a/docs/spec/_category_.json b/docs/spec/_category_.json index 1143a00a1d4a..5c2ccf7d4f56 100644 --- a/docs/spec/_category_.json +++ b/docs/spec/_category_.json @@ -1,5 +1,5 @@ { "label": "Specifications", - "position": 13, + "position": 8, "link": null } \ No newline at end of file diff --git a/docs/versions.json b/docs/versions.json deleted file mode 100644 index 9ad5d640357b..000000000000 --- a/docs/versions.json +++ /dev/null @@ -1,3 +0,0 @@ -[ - "v0.47" -] \ No newline at end of file diff --git a/errors/CHANGELOG.md b/errors/CHANGELOG.md index 74f343055879..94759445ae8f 100644 --- a/errors/CHANGELOG.md +++ b/errors/CHANGELOG.md @@ -31,6 +31,18 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +### Improvements + +* [#23901](https://github.com/cosmos/cosmos-sdk/pull/23901) Minor dependency improvements. + +## [v1.0.1](https://github.com/cosmos/cosmos-sdk/releases/tag/errors%2Fv1.0.1) + +### Improvements + +* [#18918](https://github.com/cosmos/cosmos-sdk/pull/18918) Improve `IsOf` by returning earlier when the checked error is nil. + +## [v1.0.0](https://github.com/cosmos/cosmos-sdk/releases/tag/errors%2Fv1.0.0) + ### Features * [#15989](https://github.com/cosmos/cosmos-sdk/pull/15989) Add `ErrStopIterating` for modules to use for breaking out of iteration. diff --git a/errors/abci_test.go b/errors/abci_test.go index 333731d01518..be300d931302 100644 --- a/errors/abci_test.go +++ b/errors/abci_test.go @@ -181,7 +181,6 @@ func (s *abciTestSuite) TestABCIInfoSerializeErr() { }, } for msg, spec := range specs { - spec := spec _, _, log := ABCIInfo(spec.src, spec.debug) s.Require().Equal(spec.exp, log, msg) } diff --git a/errors/errors.go b/errors/errors.go index 2e5140d72828..16f10f36a6ee 100644 --- a/errors/errors.go +++ b/errors/errors.go @@ -284,6 +284,9 @@ func WithType(err error, obj interface{}) error { // IsOf checks if a received error is caused by one of the target errors. // It extends the errors.Is functionality to a list of errors. func IsOf(received error, targets ...error) bool { + if received == nil { + return false + } for _, t := range targets { if errors.Is(received, t) { return true diff --git a/errors/errors_test.go b/errors/errors_test.go index 48a978c8f3b7..54a33e1842b1 100644 --- a/errors/errors_test.go +++ b/errors/errors_test.go @@ -118,6 +118,8 @@ func (s *errorsTestSuite) TestIsOf() { err := ErrInvalidAddress errW := Wrap(ErrLogic, "more info") + require.False(IsOf(nil), "nil should always have no causer") + require.False(IsOf(nil, err), "nil should always have no causer") require.False(IsOf(errNil), "nil error should always have no causer") require.False(IsOf(errNil, err), "nil error should always have no causer") diff --git a/errors/go.mod b/errors/go.mod index d196b8002aeb..bc27a5b34441 100644 --- a/errors/go.mod +++ b/errors/go.mod @@ -1,23 +1,21 @@ module cosmossdk.io/errors -go 1.20 +go 1.23.0 require ( github.com/pkg/errors v0.9.1 - github.com/stretchr/testify v1.8.4 - google.golang.org/grpc v1.55.0 + github.com/stretchr/testify v1.10.0 + google.golang.org/grpc v1.71.0 ) require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/golang/protobuf v1.5.3 // indirect - github.com/kr/pretty v0.3.0 // indirect + github.com/kr/pretty v0.3.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rogpeppe/go-internal v1.8.1 // indirect - golang.org/x/net v0.9.0 // indirect - golang.org/x/sys v0.8.0 // indirect - google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect - google.golang.org/protobuf v1.30.0 // indirect + github.com/rogpeppe/go-internal v1.14.1 // indirect + golang.org/x/sys v0.31.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250303144028-a0af3efb3deb // indirect + google.golang.org/protobuf v1.36.5 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/errors/go.sum b/errors/go.sum index 2f01598e45ce..43115d64d76b 100644 --- a/errors/go.sum +++ b/errors/go.sum @@ -1,15 +1,13 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= 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= @@ -19,29 +17,25 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= -github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= -golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= -google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= +github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= +golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= +golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250303144028-a0af3efb3deb h1:TLPQVbx1GJ8VKZxz52VAxl1EBgKXXbTiU9Fc5fZeLn4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250303144028-a0af3efb3deb/go.mod h1:LuRYeWDFV6WOn90g357N17oMCaxpgCnbi/44qJvDn2I= +google.golang.org/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg= +google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec= +google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= +google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 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/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/errors/sonar-project.properties b/errors/sonar-project.properties deleted file mode 100644 index 121c12cb75aa..000000000000 --- a/errors/sonar-project.properties +++ /dev/null @@ -1,14 +0,0 @@ -sonar.projectKey=cosmos-sdk-errors -sonar.organization=cosmos - -sonar.projectName=Cosmos SDK - Errors -sonar.project.monorepo.enabled=true - -sonar.sources=. -sonar.exclusions=**/*_test.go -sonar.tests=. -sonar.test.inclusions=**/*_test.go -sonar.go.coverage.reportPaths=coverage.out - -sonar.sourceEncoding=UTF-8 -sonar.scm.provider=git \ No newline at end of file diff --git a/errors/stacktrace.go b/errors/stacktrace.go index 7453284dd378..d7021085db34 100644 --- a/errors/stacktrace.go +++ b/errors/stacktrace.go @@ -79,9 +79,7 @@ func writeSimpleFrame(s io.Writer, f errors.Frame) { // Format works like pkg/errors, with additions. // %s is just the error message // %+v is the full stack trace -// %v appends a compressed [filename:line] where the error -// -// was created +// %v appends a compressed [filename:line] where the error was created // // Inspired by https://github.com/pkg/errors/blob/v0.8.1/errors.go#L162-L176 func (e *wrappedError) Format(s fmt.State, verb rune) { diff --git a/fuzz/oss-fuzz-build.sh b/fuzz/oss-fuzz-build.sh deleted file mode 100644 index 60037271817b..000000000000 --- a/fuzz/oss-fuzz-build.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -export FUZZ_ROOT="github.com/cosmos/cosmos-sdk" - -build_go_fuzzer() { - local function="$1" - local fuzzer="$2" - - go run github.com/orijtech/otils/corpus2ossfuzz@latest -o "$OUT"/"$fuzzer"_seed_corpus.zip -corpus fuzz/tests/testdata/fuzz/"$function" - compile_native_go_fuzzer "$FUZZ_ROOT"/fuzz/tests "$function" "$fuzzer" -} - -( - cd math && \ - go get github.com/AdamKorcz/go-118-fuzz-build/testing && \ - compile_native_go_fuzzer cosmossdk.io/math FuzzLegacyNewDecFromStr fuzz_math_legacy_new_dec_from_str -) - -go get github.com/AdamKorcz/go-118-fuzz-build/testing - -# TODO: fails to build with -# main.413864645.go:12:2: found packages query (collections_pagination.go) and query_test (fuzz_test.go_fuzz.go) in /src/cosmos-sdk/types/query -# because of the separate query_test package. -# compile_native_go_fuzzer "$FUZZ_ROOT"/types/query FuzzPagination fuzz_types_query_pagination -compile_native_go_fuzzer "$FUZZ_ROOT"/types FuzzCoinUnmarshalJSON fuzz_types_coin_unmarshal_json - -build_go_fuzzer FuzzCryptoHDDerivePrivateKeyForPath fuzz_crypto_hd_deriveprivatekeyforpath -build_go_fuzzer FuzzCryptoHDNewParamsFromPath fuzz_crypto_hd_newparamsfrompath - -build_go_fuzzer FuzzCryptoTypesCompactbitarrayMarshalUnmarshal fuzz_crypto_types_compactbitarray_marshalunmarshal - -build_go_fuzzer FuzzTendermintAminoDecodeTime fuzz_tendermint_amino_decodetime - -build_go_fuzzer FuzzTypesParseCoin fuzz_types_parsecoin -build_go_fuzzer FuzzTypesParseDecCoin fuzz_types_parsedeccoin -build_go_fuzzer FuzzTypesParseTimeBytes fuzz_types_parsetimebytes -build_go_fuzzer FuzzTypesVerifyAddressFormat fuzz_types_verifyaddressformat -build_go_fuzzer FuzzTypesDecSetString fuzz_types_dec_setstring - -build_go_fuzzer FuzzUnknownProto fuzz_unknownproto - -build_go_fuzzer FuzzXBankTypesAddressFromBalancesStore fuzz_x_bank_types_addressfrombalancesstore diff --git a/go.mod b/go.mod index a70f93d6a2ee..905bcb641b2a 100644 --- a/go.mod +++ b/go.mod @@ -1,165 +1,182 @@ -go 1.20 +go 1.23.0 module github.com/cosmos/cosmos-sdk require ( - cosmossdk.io/api v0.4.2 - cosmossdk.io/collections v0.2.0 - cosmossdk.io/core v0.8.0 - cosmossdk.io/depinject v1.0.0-alpha.3 - cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 - cosmossdk.io/log v1.1.0 - cosmossdk.io/math v1.0.1 - cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c - cosmossdk.io/x/tx v0.8.0 + cosmossdk.io/api v0.7.6 + cosmossdk.io/collections v0.4.0 + cosmossdk.io/core v0.11.0 + cosmossdk.io/depinject v1.1.0 + cosmossdk.io/errors v1.0.1 + cosmossdk.io/log v1.5.0 + cosmossdk.io/math v1.5.0 + cosmossdk.io/store v1.1.1 + cosmossdk.io/x/tx v0.13.7 github.com/99designs/keyring v1.2.1 - github.com/armon/go-metrics v0.4.1 - github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 - github.com/bits-and-blooms/bitset v1.7.0 + github.com/bgentry/speakeasy v0.2.0 + github.com/bits-and-blooms/bitset v1.22.0 github.com/chzyer/readline v1.5.1 github.com/cockroachdb/apd/v2 v2.0.2 - github.com/cockroachdb/errors v1.9.1 - github.com/cometbft/cometbft v0.38.0-rc1 + github.com/cockroachdb/errors v1.11.3 + github.com/cometbft/cometbft v0.38.17 github.com/cosmos/btcutil v1.0.5 - github.com/cosmos/cosmos-db v1.0.0 - github.com/cosmos/cosmos-proto v1.0.0-beta.3 - github.com/cosmos/cosmos-sdk/db v1.0.0-beta.1.0.20220726092710-f848e4300a8a + github.com/cosmos/cosmos-db v1.1.1 + github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/cosmos/go-bip39 v1.0.0 github.com/cosmos/gogogateway v1.2.0 - github.com/cosmos/gogoproto v1.4.10 - github.com/cosmos/ledger-cosmos-go v0.13.0 - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 - github.com/golang/mock v1.6.0 - github.com/golang/protobuf v1.5.3 - github.com/google/go-cmp v0.5.9 + github.com/cosmos/gogoproto v1.7.0 + github.com/cosmos/ledger-cosmos-go v0.14.0 + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 + github.com/golang/protobuf v1.5.4 + github.com/google/go-cmp v0.7.0 github.com/google/gofuzz v1.2.0 - github.com/gorilla/handlers v1.5.1 - github.com/gorilla/mux v1.8.0 + github.com/gorilla/handlers v1.5.2 + github.com/gorilla/mux v1.8.1 github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 - github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d - github.com/hdevalence/ed25519consensus v0.1.0 - github.com/huandu/skiplist v1.2.0 + github.com/hashicorp/go-metrics v0.5.4 + github.com/hashicorp/golang-lru v1.0.2 + github.com/hdevalence/ed25519consensus v0.2.0 + github.com/huandu/skiplist v1.2.1 github.com/improbable-eng/grpc-web v0.15.0 - github.com/jhump/protoreflect v1.15.1 - github.com/magiconair/properties v1.8.7 + github.com/jhump/protoreflect v1.17.0 + github.com/magiconair/properties v1.8.9 github.com/manifoldco/promptui v0.9.0 - github.com/mattn/go-isatty v0.0.19 - github.com/prometheus/client_golang v1.15.1 - github.com/prometheus/common v0.44.0 - github.com/rs/zerolog v1.29.1 - github.com/spf13/cast v1.5.1 - github.com/spf13/cobra v1.7.0 - github.com/spf13/pflag v1.0.5 - github.com/spf13/viper v1.16.0 - github.com/stretchr/testify v1.8.4 + github.com/mattn/go-isatty v0.0.20 + github.com/prometheus/client_golang v1.21.1 + github.com/prometheus/common v0.62.0 + github.com/rs/zerolog v1.33.0 + github.com/spf13/cast v1.7.1 + github.com/spf13/cobra v1.9.1 + github.com/spf13/pflag v1.0.6 + github.com/spf13/viper v1.20.0 + github.com/stretchr/testify v1.10.0 github.com/tendermint/go-amino v0.16.0 - golang.org/x/crypto v0.9.0 - golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 - golang.org/x/sync v0.2.0 - google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a - google.golang.org/grpc v1.55.0 - google.golang.org/protobuf v1.30.0 - gotest.tools/v3 v3.4.0 - pgregory.net/rapid v0.6.2 - sigs.k8s.io/yaml v1.3.0 + go.uber.org/mock v0.5.0 + golang.org/x/crypto v0.36.0 + golang.org/x/sync v0.12.0 + google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a + google.golang.org/grpc v1.71.0 + google.golang.org/protobuf v1.36.5 + gotest.tools/v3 v3.5.2 + pgregory.net/rapid v1.2.0 + sigs.k8s.io/yaml v1.4.0 ) require ( - filippo.io/edwards25519 v1.0.0 // indirect + filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect - github.com/DataDog/zstd v1.5.5 // indirect + github.com/DataDog/datadog-go v3.2.0+incompatible // indirect + github.com/DataDog/zstd v1.5.6 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect - github.com/bufbuild/protocompile v0.5.1 // indirect + github.com/bufbuild/protocompile v0.14.1 // indirect + github.com/bytedance/sonic v1.13.1 // indirect + github.com/bytedance/sonic/loader v0.2.4 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // indirect - github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/cloudwego/base64x v0.1.5 // indirect + github.com/cockroachdb/apd/v3 v3.2.1 // indirect + github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20230606152911-c4be581b807f // indirect - github.com/cockroachdb/redact v1.1.4 // indirect - github.com/cometbft/cometbft-db v0.7.0 // indirect - github.com/cosmos/iavl v1.0.0-beta.2 // indirect - github.com/cosmos/ics23/go v0.10.0 // indirect + github.com/cockroachdb/pebble v1.1.2 // indirect + github.com/cockroachdb/redact v1.1.5 // indirect + github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect + github.com/cometbft/cometbft-db v0.14.1 // indirect + github.com/cosmos/iavl v1.2.2 // indirect + github.com/cosmos/ics23/go v0.11.0 // indirect github.com/danieljoos/wincred v1.1.2 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect - github.com/dgraph-io/badger/v2 v2.2007.4 // indirect + github.com/dgraph-io/badger/v4 v4.2.0 // indirect 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/dvsekhvalnov/jose2go v1.5.0 // indirect - github.com/emicklei/dot v1.4.2 // indirect + github.com/dvsekhvalnov/jose2go v1.6.0 // indirect + github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.15.0 // indirect - github.com/felixge/httpsnoop v1.0.2 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/getsentry/sentry-go v0.21.0 // indirect - github.com/go-kit/kit v0.12.0 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect + github.com/getsentry/sentry-go v0.27.0 // indirect + github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/googleapis v1.4.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/glog v1.1.0 // indirect + github.com/golang/glog v1.2.4 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/snappy v0.0.4 // indirect - github.com/google/btree v1.1.2 // indirect + github.com/google/btree v1.1.3 // indirect + github.com/google/flatbuffers v1.12.1 // indirect github.com/google/orderedcode v0.0.1 // indirect - github.com/gorilla/websocket v1.5.0 // indirect + github.com/gorilla/websocket v1.5.3 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/go-plugin v1.4.10 // indirect - github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/go-plugin v1.5.2 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/yamux v0.1.1 // indirect - github.com/iancoleman/strcase v0.2.0 // indirect + github.com/iancoleman/strcase v0.3.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.16.5 // indirect + github.com/klauspost/compress v1.17.11 // indirect + github.com/klauspost/cpuid/v2 v2.2.10 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect - github.com/lib/pq v1.10.7 // indirect - github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.0 // indirect - github.com/mattn/go-colorable v0.1.13 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/minio/highwayhash v1.0.2 // indirect + github.com/lib/pq v1.10.9 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect + github.com/mattn/go-colorable v0.1.14 // indirect + github.com/minio/highwayhash v1.0.3 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect - github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/nxadm/tail v1.4.8 // indirect - github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce // indirect + github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.0.8 // indirect - github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761 // indirect + github.com/pelletier/go-toml/v2 v2.2.3 // indirect + github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_model v0.4.0 // indirect - github.com/prometheus/procfs v0.10.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.10.0 // indirect - github.com/rs/cors v1.8.3 // indirect - github.com/sasha-s/go-deadlock v0.3.1 // indirect - github.com/spf13/afero v1.9.5 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/subosito/gotenv v1.4.2 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect + github.com/rs/cors v1.11.1 // indirect + github.com/sagikazarmark/locafero v0.7.0 // indirect + github.com/sasha-s/go-deadlock v0.3.5 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.12.0 // indirect + github.com/subosito/gotenv v1.6.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect - github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect - github.com/tidwall/btree v1.6.0 // indirect - github.com/zondax/hid v0.9.1 // indirect - github.com/zondax/ledger-go v0.14.1 // indirect - go.etcd.io/bbolt v1.3.6 // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/term v0.8.0 // indirect - golang.org/x/text v0.9.0 // indirect - google.golang.org/genproto v0.0.0-20230525234025-438c736192d0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect - gopkg.in/ini.v1 v1.67.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect + github.com/tidwall/btree v1.7.0 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + github.com/zondax/hid v0.9.2 // indirect + github.com/zondax/ledger-go v0.14.3 // indirect + go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 // indirect + go.opencensus.io v0.24.0 // indirect + go.uber.org/multierr v1.10.0 // indirect + golang.org/x/arch v0.15.0 // indirect + golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect + golang.org/x/net v0.35.0 // indirect + golang.org/x/sys v0.31.0 // indirect + golang.org/x/term v0.30.0 // indirect + golang.org/x/text v0.23.0 // indirect + google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.6 // indirect ) +// Here are the short-lived replace from the Cosmos SDK +// Replace here are pending PRs, or version to be tagged +// replace ( +// +// ) +replace cosmossdk.io/api => ./api + +replace cosmossdk.io/log => ./log + // Below are the long-lived replace of the Cosmos SDK replace ( // use cosmos fork of keyring @@ -169,12 +186,16 @@ replace ( github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2 // Fix upstream GHSA-h395-qcrw-5vmq and GHSA-3vp4-m3rf-835h vulnerabilities. // TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 - github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0 + github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.1 // replace broken goleveldb github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 ) retract ( + // false start by tagging the wrong branch + v0.50.0 + // revert fix https://github.com/cosmos/cosmos-sdk/pull/16331 + v0.46.12 // subject to a bug in the group module and gov module migration [v0.46.5, v0.46.6] // subject to the dragonberry vulnerability diff --git a/go.sum b/go.sum index 9408b0371b84..8e6041624a02 100644 --- a/go.sum +++ b/go.sum @@ -1,87 +1,44 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= -cosmossdk.io/api v0.4.2 h1:lQBMl4xINnMnBOR/tQLtjlDnR4exr4e6/SfHR8PILE0= -cosmossdk.io/api v0.4.2/go.mod h1:qrVgOp7DIeAXa+Tt5dDjOC47bZCDrwx8ZHxrmy7STNE= -cosmossdk.io/collections v0.2.0 h1:CgMfLtE16+qox3zBYrGh60i4yKV8SeExLnIdOS2sbQs= -cosmossdk.io/collections v0.2.0/go.mod h1:Oc1FK0vlmxJZsgUn9/o3ldE6zNyWKvobVzaLhWknZJE= -cosmossdk.io/core v0.8.0 h1:LcJnu52E1a8f8E317VfQ1xK/RZe+IuhMNQAjnDLh25M= -cosmossdk.io/core v0.8.0/go.mod h1:LF6VLOv2DdCiaHxYVmr0MZcZpaSM9ZgvyrQSYTeg6D0= -cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw= -cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= -cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 h1:BCRz06fvddw7cKGiEGDiSox3qMsjQ97f92K+PDZDHdc= -cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741/go.mod h1:TB05o6YXkZkzsc+6bZFAV5kZRBtoCU9tUkbeMIqEg0w= -cosmossdk.io/log v1.1.0 h1:v0ogPHYeTzPcBTcPR1A3j1hkei4pZama8kz8LKlCMv0= -cosmossdk.io/log v1.1.0/go.mod h1:6zjroETlcDs+mm62gd8Ig7mZ+N+fVOZS91V17H+M4N4= -cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= -cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= -cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c h1:A+FMPW9GtfcPBDQNtFeDFN27h1SAP6OVjnGgPLlYXmI= -cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c/go.mod h1:RbYGvXCbz8uNBCXrwS9Z8SyydeWi+W5x5MZ33muyzMw= -cosmossdk.io/x/tx v0.8.0 h1:gLiGRL/Fy7fs6dd0IX8jOf0PrVr56/SG6XVMGQjyvJU= -cosmossdk.io/x/tx v0.8.0/go.mod h1:T9uEumGNgKU61gJYRv1t3uzQwLnASpJGmSE229HM3xA= +cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= +cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= +cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= +cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= +cosmossdk.io/depinject v1.1.0 h1:wLan7LG35VM7Yo6ov0jId3RHWCGRhe8E8bsuARorl5E= +cosmossdk.io/depinject v1.1.0/go.mod h1:kkI5H9jCGHeKeYWXTqYdruogYrEeWvBQCw1Pj4/eCFI= +cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= +cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= +cosmossdk.io/math v1.5.0 h1:sbOASxee9Zxdjd6OkzogvBZ25/hP929vdcYcBJQbkLc= +cosmossdk.io/math v1.5.0/go.mod h1:AAwwBmUhqtk2nlku174JwSll+/DepUXW3rWIXN5q+Nw= +cosmossdk.io/store v1.1.1 h1:NA3PioJtWDVU7cHHeyvdva5J/ggyLDkyH0hGHl2804Y= +cosmossdk.io/store v1.1.1/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM= +cosmossdk.io/x/tx v0.13.7 h1:8WSk6B/OHJLYjiZeMKhq7DK7lHDMyK0UfDbBMxVmeOI= +cosmossdk.io/x/tx v0.13.7/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= -filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= +filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= +filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= 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-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= -github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= +github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= -github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= -github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= +github.com/DataDog/zstd v1.5.6 h1:LbEglqepa/ipmmQJUDnSsfvA8e8IStVcGaFWDuxvGOY= +github.com/DataDog/zstd v1.5.6/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= -github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= +github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= 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/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= +github.com/adlio/schema v1.3.6 h1:k1/zc2jNfeiZBA5aFTRy37jlBIuCkXCm0XmvpzCKI9I= +github.com/adlio/schema v1.3.6/go.mod h1:qkxwLgPBd1FgLRHYVCmQT/rrBr3JH38J9LjmVzWNudg= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= -github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= -github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -91,35 +48,36 @@ github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kd github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= 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/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= -github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bits-and-blooms/bitset v1.7.0 h1:YjAGVd3XmtK9ktAbX8Zg2g2PwLIMjGREZJHlV4j7NEo= -github.com/bits-and-blooms/bitset v1.7.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= -github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= -github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= -github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= -github.com/bufbuild/protocompile v0.5.1 h1:mixz5lJX4Hiz4FpqFREJHIXLfaLBntfaJv1h+/jS+Qg= -github.com/bufbuild/protocompile v0.5.1/go.mod h1:G5iLmavmF4NsYtpZFvE3B/zFch2GIY8+wjsYLR/lc40= +github.com/bgentry/speakeasy v0.2.0 h1:tgObeVOf8WAvtuAX6DhJ4xks4CFNwPDZiqzGqIHE51E= +github.com/bgentry/speakeasy v0.2.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bits-and-blooms/bitset v1.22.0 h1:Tquv9S8+SGaS3EhyA+up3FXzmkhxPGjQQCkcs2uw7w4= +github.com/bits-and-blooms/bitset v1.22.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= +github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= +github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/btcutil v1.1.6 h1:zFL2+c3Lb9gEgqKNzowKUPQNb8jV7v5Oaodi/AYFd6c= +github.com/btcsuite/btcd/btcutil v1.1.6/go.mod h1:9dFymx8HpuLqBnsPELrImQeTQfKBQqzqGbbV3jK55aE= +github.com/bufbuild/protocompile v0.14.1 h1:iA73zAf/fyljNjQKwYzUHD6AD4R8KMasmwa/FBatYVw= +github.com/bufbuild/protocompile v0.14.1/go.mod h1:ppVdAIhbr2H8asPk6k4pY7t9zB1OU5DoEw9xY/FUi1c= github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= -github.com/bytedance/sonic v1.8.0 h1:ea0Xadu+sHlu7x5O3gKhRpQ1IKiMrSiHttPF0ybECuA= -github.com/bytedance/sonic v1.8.0/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= +github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= +github.com/bytedance/sonic v1.13.1 h1:Jyd5CIvdFnkOWuKXr+wm4Nyk2h0yAFsr8ucJgEasO3g= +github.com/bytedance/sonic v1.13.1/go.mod h1:o68xyaF9u2gvVBuGHPlUVCy+ZfmNNO5ETf1+KgkJhz4= +github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= +github.com/bytedance/sonic/loader v0.2.4 h1:ZWCw4stuXUsn1/+zQDqeE7JKP+QO47tz7QCNan80NzY= +github.com/bytedance/sonic/loader v0.2.4/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= @@ -127,13 +85,10 @@ github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInq github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -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/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= -github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM= @@ -148,8 +103,10 @@ github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6D github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudwego/base64x v0.1.5 h1:XPciSp1xaq2VCSt6lF0phncD4koWyULpl5bUxbfCyP4= +github.com/cloudwego/base64x v0.1.5/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= +github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= @@ -158,148 +115,135 @@ github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= -github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= +github.com/cockroachdb/apd/v3 v3.2.1 h1:U+8j7t0axsIgvQUqthuNm82HIrYXodOV2iWLWtEaIwg= +github.com/cockroachdb/apd/v3 v3.2.1/go.mod h1:klXJcjp+FffLTHlhIG69tezTDvdP065naDsHzKhYSqc= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= -github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= -github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= +github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce h1:giXvy4KSc/6g/esnpM7Geqxka4WSqI1SZc7sMJFd3y4= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/pebble v0.0.0-20230606152911-c4be581b807f h1:qQW3qCVRpjYsV4YNaUOjm6YLeliAD2jpgex9+D9tqU4= -github.com/cockroachdb/pebble v0.0.0-20230606152911-c4be581b807f/go.mod h1:TkdVsGYRqtULUppt2RbC+YaKtTHnHoWa2apfFrSKABw= -github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/cockroachdb/redact v1.1.4 h1:Y0XrVI2FAyofNyGveodTN//qdpPtFKcKTeCBsK3AHAQ= -github.com/cockroachdb/redact v1.1.4/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/pebble v1.1.2 h1:CUh2IPtR4swHlEj48Rhfzw6l/d0qA31fItcIszQVIsA= +github.com/cockroachdb/pebble v1.1.2/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= -github.com/cometbft/cometbft v0.38.0-rc1 h1:ph6smlqX82aH+d72KuxDHqu29M7LyusSp/obfGsGX/w= -github.com/cometbft/cometbft v0.38.0-rc1/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= -github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= -github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= +github.com/cometbft/cometbft v0.38.17 h1:FkrQNbAjiFqXydeAO81FUzriL4Bz0abYxN/eOHrQGOk= +github.com/cometbft/cometbft v0.38.17/go.mod h1:5l0SkgeLRXi6bBfQuevXjKqML1jjfJJlvI1Ulp02/o4= +github.com/cometbft/cometbft-db v0.14.1 h1:SxoamPghqICBAIcGpleHbmoPqy+crij/++eZz3DlerQ= +github.com/cometbft/cometbft-db v0.14.1/go.mod h1:KHP1YghilyGV/xjD5DP3+2hyigWx0WTp9X+0Gnx0RxQ= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= +github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= -github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0E= -github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= -github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= -github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/cosmos-sdk/db v1.0.0-beta.1.0.20220726092710-f848e4300a8a h1:2humuGPw3O5riJVFq/E2FRjF57UrO97W1qJcGVmK+6k= -github.com/cosmos/cosmos-sdk/db v1.0.0-beta.1.0.20220726092710-f848e4300a8a/go.mod h1:c8IO23vgNxueCCJlSI9awQtcxsvc+buzaeThB85qfBU= +github.com/cosmos/cosmos-db v1.1.1 h1:FezFSU37AlBC8S98NlSagL76oqBRWq/prTPvFcEJNCM= +github.com/cosmos/cosmos-db v1.1.1/go.mod h1:AghjcIPqdhSLP/2Z0yha5xPH3nLnskz81pBx3tcVSAw= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoKuI= -github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= -github.com/cosmos/iavl v1.0.0-beta.2 h1:XOsIM80Yyml/KifCXEYOy9tWCXwMAbLa91n6pReW07Y= -github.com/cosmos/iavl v1.0.0-beta.2/go.mod h1:EA97dJ07TBktRlG/iGzK6g1eCXNj1q3MGoFYkVzrwHE= -github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= -github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= +github.com/cosmos/iavl v1.2.2 h1:qHhKW3I70w+04g5KdsdVSHRbFLgt3yY3qTMd4Xa4rC8= +github.com/cosmos/iavl v1.2.2/go.mod h1:GiM43q0pB+uG53mLxLDzimxM9l/5N9UuSY3/D0huuVw= +github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= +github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= -github.com/cosmos/ledger-cosmos-go v0.13.0 h1:ex0CvCxToSR7j5WjrghPu2Bu9sSXKikjnVvUryNnx4s= -github.com/cosmos/ledger-cosmos-go v0.13.0/go.mod h1:ZcqYgnfNJ6lAXe4HPtWgarNEY+B74i+2/8MhZw4ziiI= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/cosmos/ledger-cosmos-go v0.14.0 h1:WfCHricT3rPbkPSVKRH+L4fQGKYHuGOK9Edpel8TYpE= +github.com/cosmos/ledger-cosmos-go v0.14.0/go.mod h1:E07xCWSBl3mTGofZ2QnL4cIUzMbbGVyik84QYKbX3RA= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= -github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/decred/dcrd/crypto/blake256 v1.1.0 h1:zPMNGQCm0g4QTY27fOCorQW7EryeQ/U0x++OzVrdms8= +github.com/decred/dcrd/crypto/blake256 v1.1.0/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 h1:NMZiJj8QnKe1LgsbDayM4UoHwbvwDRwnI3hwNaAHRnc= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0/go.mod h1:ZXNYxsqcloTdSy/rNShjYzMhyjf0LaoftYK0p+A3h40= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= -github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= -github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= -github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= -github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= +github.com/dgraph-io/badger/v4 v4.2.0 h1:kJrlajbXXL9DFTNuhhu9yCx7JJa4qpYWxtE8BzuWsEs= +github.com/dgraph-io/badger/v4 v4.2.0/go.mod h1:qfCqhPoWDFJRx1gp5QwwyGo8xk1lbHUxvK9nK0OGAak= github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= 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/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= 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/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= -github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= +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/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= -github.com/emicklei/dot v1.4.2 h1:UbK6gX4yvrpHKlxuUQicwoAis4zl8Dzwit9SnbBAXWw= -github.com/emicklei/dot v1.4.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= +github.com/emicklei/dot v1.6.2 h1:08GN+DD79cy/tzN6uLCT84+2Wk9u+wvqP+Hkx/dIR8A= +github.com/emicklei/dot v1.6.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= -github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= -github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= -github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= -github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= -github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= -github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= -github.com/getsentry/sentry-go v0.21.0 h1:c9l5F1nPF30JIppulk4veau90PK6Smu3abgVtVQWon4= -github.com/getsentry/sentry-go v0.21.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= +github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= +github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= +github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= +github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.9.0 h1:OjyFBKICoexlu99ctXNR2gg+c5pKrKMuyjgARg9qeY8= -github.com/gin-gonic/gin v1.9.0/go.mod h1:W1Me9+hsUSyj3CePGrd1/QrKJMSJ1Tu/0hFEH89961k= -github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= +github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= -github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= -github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= +github.com/go-kit/kit v0.13.0 h1:OoneCcHKHQ03LfBpoQCUfCluwd2Vt3ohz+kvbJneZAU= +github.com/go-kit/kit v0.13.0/go.mod h1:phqEHMMUbyrCFCTgH48JueqrM3md2HcAZ8N3XE4FKDg= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= @@ -308,29 +252,32 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= +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-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU= -github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= +github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js= +github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= -github.com/goccy/go-json v0.10.0 h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA= -github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= +github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= -github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= 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= @@ -341,23 +288,16 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV 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/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= -github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= -github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= +github.com/golang/glog v1.2.4 h1:CNNw5U8lSiiBk7druxtSHHTsRWcxKoac6kZKm2peBBc= +github.com/golang/glog v1.2.4/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -365,7 +305,6 @@ github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= @@ -377,68 +316,52 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -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/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= +github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= +github.com/google/flatbuffers v1.12.1 h1:MVlul7pQNoDzWRLTw5imwYsl+usrS1TXG2H4jg6ImGw= +github.com/google/flatbuffers v1.12.1/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 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= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= -github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= +github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE= +github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= @@ -459,10 +382,12 @@ github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVH github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-metrics v0.5.4 h1:8mmPiIJkTPPEbAiV97IxdAGNdRdaWwVap1BU6elejKY= +github.com/hashicorp/go-metrics v0.5.4/go.mod h1:CG5yz4NZ/AI/aQt9Ucm/vdBnbh7fvmv4lxZ350i+QQI= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-plugin v1.4.10 h1:xUbmA4jC6Dq163/fWcp8P3JuHilrHHMLNRxzGQJ9hNk= -github.com/hashicorp/go-plugin v1.4.10/go.mod h1:6/1TEzT0eQznvI/gV2CM29DLSkAK/e58mUWKVsPaph0= +github.com/hashicorp/go-plugin v1.5.2 h1:aWv8eimFqWlsEiMrYZdPYl+FdHaBJSN4AWwGWfT1G2Y= +github.com/hashicorp/go-plugin v1.5.2/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= @@ -474,43 +399,34 @@ github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= 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/hdevalence/ed25519consensus v0.2.0 h1:37ICyZqdyj0lAZ8P4D1d1id3HqbbG1N3iBb1Tb4rdcU= +github.com/hdevalence/ed25519consensus v0.2.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= 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= -github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw= -github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= +github.com/huandu/skiplist v1.2.1 h1:dTi93MgjwErA/8idWTzIw4Y1kZsMWx35fmI2c8Rij7w= +github.com/huandu/skiplist v1.2.1/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= -github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= -github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= -github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= +github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= -github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= -github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= -github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= -github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= -github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= -github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= +github.com/jhump/protoreflect v1.17.0 h1:qOEr613fac2lOuTgWN4tPAtLL7fUSbuJL5X5XumQh94= +github.com/jhump/protoreflect v1.17.0/go.mod h1:h9+vUUL38jiBzck8ck+6G/aeMX8Z4QUY/NiJPwPNi+8= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= @@ -521,96 +437,71 @@ github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= 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/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= -github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= -github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= -github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= -github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= 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/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI= -github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/klauspost/cpuid v1.2.1 h1:vJi+O/nMdFt0vqm8NZBI6wzALWdA2X+egi0ogNyrC/w= -github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= +github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= +github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= +github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE= +github.com/klauspost/cpuid/v2 v2.2.10/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0= +github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= 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.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= -github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= -github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= -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= -github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= +github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.0 h1:H4L/LhP7GOMf1j17oQAElHgVlbEje2h14A8Tz9cM2BE= -github.com/linxGnu/grocksdb v1.8.0/go.mod h1:09CeBborffXhXdNpEcOeZrLKEnRtrZFEpFdPNI9Zjjg= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= -github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/magiconair/properties v1.8.9 h1:nWcCbLq1N2v/cpNsy5WvQ37Fb+YElfq20WJ/a8RkpQM= +github.com/magiconair/properties v1.8.9/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.8/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= +github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= +github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= 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-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= -github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= -github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= +github.com/minio/highwayhash v1.0.3 h1:kbnuUMoHYyVl7szWjSxJnxw11k2U709jqFPPmIUyD6Q= +github.com/minio/highwayhash v1.0.3/go.mod h1:GGYsuwP/fPD6Y9hMiXuapVvlIUEhFhMTh0rxU3ik1LQ= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= @@ -618,8 +509,6 @@ github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS4 github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/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= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -627,9 +516,10 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= 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/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -645,8 +535,8 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce h1:/pEpMk55wH0X+E5zedGEMOdLuWmV8P4+4W3+LZaM6kg= -github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a h1:dlRvE5fWabOchtH7znfiFCcOvmIYgOeAS5ifBXBlh9Q= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= @@ -654,7 +544,6 @@ github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DV github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= @@ -662,10 +551,14 @@ github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1Cpa github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.26.0 h1:03cDLK28U6hWvCAns6NeydX3zIm4SF3ci69ulidS32Q= +github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= 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-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= -github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= +github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= +github.com/opencontainers/runc v1.1.12 h1:BOIssBaW1La0/qbNZHXOOa71dZfZEQOzW7dqQf3phss= +github.com/opencontainers/runc v1.1.12/go.mod h1:S+lQwSfncpBha7XTy/5lBwWgm5+y5Ma/O44Ekby9FK8= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -675,19 +568,18 @@ github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJ github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= +github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= -github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= +github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= +github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= -github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761 h1:W04oB3d0J01W5jgYRGKsV8LCM6g9EkCvPkZcmFuy0OE= -github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 h1:Dx7Ovyv/SFnMFw3fD4oEoeorXc6saIiQ23LrGLth0Gw= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= @@ -698,9 +590,9 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= @@ -708,103 +600,94 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.15.1 h1:8tXpTmJbyH5lydzFPoxSIJ0J46jdh3tylbvM1xCv0LI= -github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= +github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.21.1 h1:DOvXXTqVzvkIewV/CDPFdejpMCGeMcbGCQ8YOmu+Ibk= +github.com/prometheus/client_golang v1.21.1/go.mod h1:U9NM32ykUErtVBxdvD3zfi+EuFkkaBvMb09mIfe0Zgg= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= -github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= -github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io= +github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= -github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= 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/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= -github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= -github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= -github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.29.1 h1:cO+d60CHkknCbvzEWxP0S9K6KqyTjrCNUy1LdQLCGPc= -github.com/rs/zerolog v1.29.1/go.mod h1:Le6ESbR7hc+DP6Lt1THiV8CQSdkkNrd3R0XbEgp3ZBU= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= +github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/locafero v0.7.0 h1:5MqpDsTGNDhY8sGp0Aowyf0qKsPrhewaLSsFaodPcyo= +github.com/sagikazarmark/locafero v0.7.0/go.mod h1:2za3Cg5rMaTMoG/2Ulr9AwtFaIppKXTRYnozin4aB5k= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -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/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= +github.com/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb2NsU= +github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= -github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= -github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= -github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= +github.com/spf13/afero v1.12.0 h1:UcOPyRBYczmFn6yvphxkn9ZEOY65cpwGKb5mL36mrqs= +github.com/spf13/afero v1.12.0/go.mod h1:ZTlWwG4/ahT8W7T0WQ5uYmjI9duaLQGy3Q2OAl4sk/4= +github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= +github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo= +github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= -github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= +github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= +github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.20.0 h1:zrxIyR3RQIOsarIrgL8+sAvALXul9jeEPa06Y0Ph6vY= +github.com/spf13/viper v1.20.0/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -815,141 +698,111 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= -github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +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/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= -github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= +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/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= -github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/ugorji/go/codec v1.2.9 h1:rmenucSohSTiyL09Y+l2OCk+FrMxGMzho2+tjr5ticU= -github.com/ugorji/go/codec v1.2.9/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= +github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= +github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= -github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= -github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= -github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= -github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= -github.com/zondax/ledger-go v0.14.1 h1:Pip65OOl4iJ84WTpA4BKChvOufMhhbxED3BaihoZN4c= -github.com/zondax/ledger-go v0.14.1/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2feOQv8K320= +github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= +github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= +github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= +github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= -go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 h1:qxen9oVGzDdIRP6ejyAJc760RwW4SnVDiTYTzwnXuxo= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5/go.mod h1:eW0HG9/oHQhvRCvb1/pIXW4cOvtDqeQK+XSi3TnwaXY= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= +go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= +go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY= +go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI= +go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ= +go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE= +go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A= +go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU= +go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk= +go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w= +go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k= +go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU= +go.uber.org/mock v0.5.0/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= +go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -golang.org/x/arch v0.0.0-20210923205945-b76863e36670 h1:18EFjUmQOcUvxNYSkA6jO9VAiXCnxFY6NyDX0bHDmkU= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +golang.org/x/arch v0.15.0 h1:QtOrQd0bTUnhNVNndMpLHNWrDmYzZ2KDqSrEymqInZw= +golang.org/x/arch v0.15.0/go.mod h1:JmwW7aLIoRUKgaTzhkiEFxvcEiQGyOg9BMonBJUS7EE= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= -golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= +golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= +golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34= +golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= +golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= 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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -961,72 +814,44 @@ golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= +golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= 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= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= -golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw= +golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= 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-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1035,284 +860,148 @@ golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 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-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= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/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-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220315194320-039c03cc5b86/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= +golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= 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.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= +golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y= +golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g= 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= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= +golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -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= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/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-20181221001348-537d06c36207/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-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg= +golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= 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= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -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-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= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20230525234025-438c736192d0 h1:x1vNwUhVOcsYoKyEGCZBH694SBmmBjA2EfauFVEI2+M= -google.golang.org/genproto v0.0.0-20230525234025-438c736192d0/go.mod h1:9ExIQyXL5hZrHzQceCwuSYwZZ5QZBazOcprJ5rgs3lY= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a h1:HiYVD+FGJkTo+9zj1gqz0anapsa1JxjiSrN+BJKyUmE= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a/go.mod h1:ts19tUU+Z0ZShN1y3aPyq2+O3d5FUNNgT6FtOzmrNn8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 h1:ToEetK57OidYuqD4Q5w+vfEnPvPpuTwedCNVohYJfNk= +google.golang.org/genproto v0.0.0-20241118233622-e639e219e697/go.mod h1:JJrvXBWRZaFMxBufik1a4RpFw4HhgVtBBWQeQgUj2cc= +google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a h1:nwKuGPlUAt+aR+pcrkfFRrTU1BVrSmYyYMxYbUIVHr0= +google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a/go.mod h1:3kWAYMk1I75K4vykHtKt2ycnOgpA6974V7bREqbsenU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a h1:51aaUVRocpvUOSQKM6Q7VuoaktNIaMCLuhZB6DKksq4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a/go.mod h1:uRxBH1mhmO8PGhU89cMcHaXKZqO+OfakD8QQO0oYwlQ= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= +google.golang.org/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg= +google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1327,8 +1016,9 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= +google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1340,10 +1030,6 @@ gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qS 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/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= -gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -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/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= @@ -1356,32 +1042,23 @@ gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 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= -gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= -gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= +gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q= +gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -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= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= -pgregory.net/rapid v0.6.2 h1:ErW5sL+UKtfBfUTsWHDCoeB+eZKLKMxrSd1VJY6W4bw= -pgregory.net/rapid v0.6.2/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= +pgregory.net/rapid v1.2.0 h1:keKAYRcjm+e1F0oAuU5F5+YPAWcyxNNRK2wud503Gnk= +pgregory.net/rapid v1.2.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/go.work.example b/go.work.example deleted file mode 100644 index e93f4caff3cc..000000000000 --- a/go.work.example +++ /dev/null @@ -1,27 +0,0 @@ -go 1.20 - -use ( - . - ./api - ./client/v2 - ./collections - ./core - ./depinject - ./errors - ./log - ./math - ./orm - ./simapp - ./tests - ./store - ./tools/rosetta - ./tools/cosmovisor - ./tools/confix - ./tools/hubl - ./x/tx - ./x/nft - ./x/circuit - ./x/feegrant - ./x/evidence - ./x/upgrade -) diff --git a/internal/conv/doc.go b/internal/conv/doc.go index 1c86f5c14409..4b45d1ab53f9 100644 --- a/internal/conv/doc.go +++ b/internal/conv/doc.go @@ -1,2 +1,2 @@ -// Package conv provides internal functions for convertions and data manipulation +// Package conv provides internal functions for conversions and data manipulation package conv diff --git a/internal/conv/string.go b/internal/conv/string.go index ab2b7f44b38a..fa9e507be06d 100644 --- a/internal/conv/string.go +++ b/internal/conv/string.go @@ -1,20 +1,13 @@ package conv import ( - "reflect" "unsafe" ) // UnsafeStrToBytes uses unsafe to convert string into byte array. Returned bytes // must not be altered after this function is called as it will cause a segmentation fault. func UnsafeStrToBytes(s string) []byte { - var buf []byte - sHdr := (*reflect.StringHeader)(unsafe.Pointer(&s)) - bufHdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) - bufHdr.Data = sHdr.Data - bufHdr.Cap = sHdr.Len - bufHdr.Len = sHdr.Len - return buf + return unsafe.Slice(unsafe.StringData(s), len(s)) // ref https://github.com/golang/go/issues/53003#issuecomment-1140276077 } // UnsafeBytesToStr is meant to make a zero allocation conversion @@ -22,5 +15,5 @@ func UnsafeStrToBytes(s string) []byte { // to be used generally, but for a specific pattern to delete keys // from a map. func UnsafeBytesToStr(b []byte) string { - return *(*string)(unsafe.Pointer(&b)) + return unsafe.String(unsafe.SliceData(b), len(b)) } diff --git a/internal/db/iterator_adapter.go b/internal/db/iterator_adapter.go deleted file mode 100644 index 02b18acf0fd4..000000000000 --- a/internal/db/iterator_adapter.go +++ /dev/null @@ -1,25 +0,0 @@ -package db - -import ( - storetypes "cosmossdk.io/store/types" - - dbm "github.com/cosmos/cosmos-sdk/db" -) - -var _ = (*storetypes.Iterator)(nil) - -type AsStoreIter struct { - dbm.Iterator - valid bool -} - -// DBToStoreIterator returns an iterator wrapping the given iterator so that it satisfies the -// (store/types).Iterator interface. -func ToStoreIterator(source dbm.Iterator) *AsStoreIter { - ret := &AsStoreIter{Iterator: source} - ret.Next() // The DB iterator must be primed before it can access the first element, because Next also returns the validity status - return ret -} - -func (it *AsStoreIter) Next() { it.valid = it.Iterator.Next() } -func (it *AsStoreIter) Valid() bool { return it.valid } diff --git a/internal/testutil/cmd.go b/internal/testutil/cmd.go new file mode 100644 index 000000000000..2d3c662cbe3b --- /dev/null +++ b/internal/testutil/cmd.go @@ -0,0 +1,50 @@ +package testutil + +import ( + "strings" + "testing" + + "github.com/spf13/cobra" + "github.com/spf13/pflag" +) + +// ResetArgs resets arguments for the command. It is desired to be a helpful function for the cmd.SetArgs +// in the case of calling multiple times in a unit test, as cmd.SetArgs doesn't +// reset the flag value as expected. +// +// **Warning**: this is only compatible with following flag types: +// 1. the implementations of pflag.Value +// 2. the built-in implementations of pflag.SliceValue +// 3. the custom implementations of pflag.SliceValue that are split by comma "," +// +// see https://github.com/spf13/cobra/issues/2079#issuecomment-1870115781 for more detail info +func ResetArgs(t *testing.T, cmd *cobra.Command) { + t.Helper() + // if flags haven't been parsed yet, there is no need to reset the args + if !cmd.Flags().Parsed() { + return + } + // If flags have already been parsed, we should reset the values of flags that haven't been set + cmd.Flags().Visit(func(pf *pflag.Flag) { + // if the flag hasn't been changed, there is no need to reset the args + if !pf.Changed { + return + } + // handle pflag.SliceValue + if v, ok := pf.Value.(pflag.SliceValue); ok { + defVal := strings.Trim(pf.DefValue, "[]") + defSliceVal := make([]string, 0) + if defVal != "" { + defSliceVal = strings.Split(defVal, ",") + } + if err := v.Replace(defSliceVal); err != nil { + t.Errorf("error resetting argument <%s> with default value <%+v>: %v", pf.Name, defSliceVal, err) + } + return + } + // handle pflag.Value + if err := pf.Value.Set(pf.DefValue); err != nil { + t.Errorf("error resetting argument <%s> with default value <%s>: %v", pf.Name, pf.DefValue, err) + } + }) +} diff --git a/internal/testutil/cmd_test.go b/internal/testutil/cmd_test.go new file mode 100644 index 000000000000..4151360b9a0d --- /dev/null +++ b/internal/testutil/cmd_test.go @@ -0,0 +1,207 @@ +package testutil_test + +import ( + "errors" + "fmt" + "testing" + + "github.com/spf13/cobra" + "github.com/stretchr/testify/require" + + "github.com/cosmos/cosmos-sdk/internal/testutil" +) + +// TestSetArgsWithOriginalMethod is used to illustrate cobra.Command.SetArgs won't reset args as expected +func TestSetArgsWithOriginalMethod(t *testing.T) { + getCMD := func() *cobra.Command { + cmd := &cobra.Command{ + Use: "testcmd", + RunE: func(cmd *cobra.Command, args []string) error { + a, _ := cmd.Flags().GetBool("a") + b, _ := cmd.Flags().GetBool("b") + c, _ := cmd.Flags().GetBool("c") + switch { + case a && b, a && c, b && c: + return errors.New("a,b,c only one could be true") + } + return nil + }, + } + f := cmd.Flags() + f.BoolP("a", "a", false, "a,b,c only one could be true") + f.BoolP("b", "b", false, "a,b,c only one could be true") + f.Bool("c", false, "a,b,c only one could be true") + return cmd + } + + cmd := getCMD() + + cmd.SetArgs([]string{ + "testcmd", + "--a=true", + }) + require.NoError(t, cmd.Execute()) + + // This call to cmd.SetArgs is expected to set only the 'b' flag. However, due to the bug, the 'a' flag remains set from the previous call to cmd.SetArgs, leading to an error. + cmd.SetArgs([]string{ + "testcmd", + "--b=true", + }) + require.True(t, cmd.Flags().Changed("a")) + require.Error(t, cmd.Execute()) + + // This call to cmd.SetArgs is expected to set only the 'c' flag. However, the 'a' and 'b' flags remain set from the previous calls, causing an unexpected error. + cmd.SetArgs([]string{ + "testcmd", + "--c=true", + }) + require.Error(t, cmd.Execute()) + + // To work around the bug, we must explicitly reset the 'a' and 'b' flags to false, even though we only want to set the 'c' flag to true. + cmd.SetArgs([]string{ + "testcmd", + "--a=false", + "--b=false", + "--c=true", + }) + require.NoError(t, cmd.Execute()) +} + +func TestSetArgsWithWrappedMethod(t *testing.T) { + var ( + mockFlagWithCommaD = testutil.MockFlagsWithComma{Ary: []string{"g;m", "g;n"}} + mockFlagWithCommaE testutil.MockFlagsWithComma + ) + var ( + mockFlagWithSemicolonF = testutil.MockFlagsWithSemicolon{Ary: []string{"g,m", "g,n"}} + mockFlagWithSemicolonG testutil.MockFlagsWithSemicolon + ) + getCMD := func() *cobra.Command { + cmd := &cobra.Command{ + Use: "testcmd", + RunE: func(cmd *cobra.Command, args []string) error { + return nil + }, + } + f := cmd.Flags() + f.BoolP("a", "a", false, "check built-in pflag.Value") + f.IntSlice("b", []int{1, 2}, "check built-in pflag.SliceValue with default value") + f.IntSliceP("c", "c", nil, "check built pflag.SliceValue with nil default value") + f.Var(&mockFlagWithCommaD, "d", "check custom implementation of pflag.SliceValue with splitting by comma and default value") + f.VarP(&mockFlagWithCommaE, "e", "e", "check custom implementation of pflag.SliceValue with splitting by comma and nil default value") + f.Var(&mockFlagWithSemicolonF, "f", "check custom implementation of pflag.SliceValue with splitting by semicolon and default value") + f.VarP(&mockFlagWithSemicolonG, "g", "g", "check custom implementation of pflag.SliceValue with splitting by semicolon and nil default value") + return cmd + } + + cmd := getCMD() + + checkFlagsValue := func(cmd *cobra.Command, notDefaultFlags map[string]string) bool { + require.NoError(t, cmd.Execute()) + for _, k := range []string{"a", "b", "c", "d", "e", "f", "g"} { + curVal := cmd.Flag(k).Value + curDefVal := cmd.Flag(k).DefValue + if v, ok := notDefaultFlags[k]; ok { + require.NotEqual(t, curVal.String(), curDefVal, fmt.Sprintf("flag: %s, cmp_to: %v", k, curVal)) + require.Equal(t, curVal.String(), v, fmt.Sprintf("flag: %s, cmp_to: %v", k, curVal)) + } else { + require.Equal(t, curVal.String(), curDefVal, fmt.Sprintf("flag: %s, cmp_to: %v", k, curVal)) + } + } + return true + } + + testCases := []struct { + name string + steps []struct { + args []string + expectNotDefaultFlags map[string]string + } + }{ + { + name: "no args", + steps: []struct { + args []string + expectNotDefaultFlags map[string]string + }{ + { + args: nil, + expectNotDefaultFlags: nil, + }, + }, + }, + { + name: "built-in implementation of pflag.Value", + steps: []struct { + args []string + expectNotDefaultFlags map[string]string + }{ + { + args: []string{"--a=true"}, + expectNotDefaultFlags: map[string]string{"a": "true"}, + }, + }, + }, + { + name: "built-in implementation of pflag.SliceValue", + steps: []struct { + args []string + expectNotDefaultFlags map[string]string + }{ + { + args: []string{"--b=3,4"}, + expectNotDefaultFlags: map[string]string{"b": "[3,4]"}, + }, + { + args: []string{"--c=3,4"}, + expectNotDefaultFlags: map[string]string{"c": "[3,4]"}, + }, + }, + }, + { + name: "custom implementation of pflag.SliceValue with comma", + steps: []struct { + args []string + expectNotDefaultFlags map[string]string + }{ + { + args: []string{"--d=g;n,g;m"}, + expectNotDefaultFlags: map[string]string{"d": "g;n,g;m"}, + }, + { + args: []string{"--e=g;n,g;m"}, + expectNotDefaultFlags: map[string]string{"e": "g;n,g;m"}, + }, + }, + }, + { + // custom implementation of pflag.SliceValue with splitting by semicolon is not compatible with testutil.SetArgs. + // So `f` is changed to "g;m;g;n" (split to ["g", "m;g", "n"], and then join with ";"), not default value "g,m;g,n" + name: "custom implementation of pflag.SliceValue with semicolon", + steps: []struct { + args []string + expectNotDefaultFlags map[string]string + }{ + { + args: []string{"--f=g,n;g,m"}, + expectNotDefaultFlags: map[string]string{"f": "g,n;g,m"}, + }, + { + args: []string{"--g=g,n;g,m"}, + expectNotDefaultFlags: map[string]string{"f": "g;m;g;n", "g": "g,n;g,m"}, + }, + }, + }, + } + + for _, testCase := range testCases { + t.Run(testCase.name, func(t *testing.T) { + for _, step := range testCase.steps { + testutil.ResetArgs(t, cmd) + args := append([]string{"testcmd"}, step.args...) + cmd.SetArgs(args) + checkFlagsValue(cmd, step.expectNotDefaultFlags) + } + }) + } +} diff --git a/internal/testutil/mock_flags.go b/internal/testutil/mock_flags.go new file mode 100644 index 000000000000..ab2dab71780a --- /dev/null +++ b/internal/testutil/mock_flags.go @@ -0,0 +1,77 @@ +package testutil + +import "strings" + +type MockFlagsWithComma struct { + Ary []string + changed bool +} + +func (m *MockFlagsWithComma) String() string { + return strings.Join(m.Ary, ",") +} + +func (m *MockFlagsWithComma) Set(value string) error { + if m.changed { + m.Ary = append(m.Ary, strings.Split(value, ",")...) + } else { + m.Ary = strings.Split(value, ",") + m.changed = true + } + return nil +} + +func (m *MockFlagsWithComma) Type() string { + return "mock_flags" +} + +func (m *MockFlagsWithComma) Replace(value []string) error { + m.Ary = value + return nil +} + +func (m *MockFlagsWithComma) Append(value string) error { + m.Ary = append(m.Ary, value) + return nil +} + +func (m *MockFlagsWithComma) GetSlice() []string { + return m.Ary +} + +type MockFlagsWithSemicolon struct { + Ary []string + changed bool +} + +func (m *MockFlagsWithSemicolon) String() string { + return strings.Join(m.Ary, ";") +} + +func (m *MockFlagsWithSemicolon) Set(value string) error { + if m.changed { + m.Ary = append(m.Ary, strings.Split(value, ";")...) + } else { + m.Ary = strings.Split(value, ";") + m.changed = true + } + return nil +} + +func (m *MockFlagsWithSemicolon) Type() string { + return "mock_flags" +} + +func (m *MockFlagsWithSemicolon) Replace(value []string) error { + m.Ary = value + return nil +} + +func (m *MockFlagsWithSemicolon) Append(value string) error { + m.Ary = append(m.Ary, value) + return nil +} + +func (m *MockFlagsWithSemicolon) GetSlice() []string { + return m.Ary +} diff --git a/log/CHANGELOG.md b/log/CHANGELOG.md index 08768555e71d..70c661e724dc 100644 --- a/log/CHANGELOG.md +++ b/log/CHANGELOG.md @@ -11,29 +11,59 @@ Mention whether you follow Semantic Versioning. Usage: -Change log entries are to be added to the Unreleased section under the -appropriate stanza (see below). Each entry should ideally include a tag and -the Github issue reference in the following format: +Change log entries are to be added to the Unreleased section from newest to oldest. +Each entry must include the Github issue reference in the following format: -* () [#] Changelog message. +* [#] Changelog message. -Types of changes (Stanzas): - -"Features" for new features. -"Improvements" for changes in existing functionality. -"Deprecated" for soon-to-be removed features. -"Bug Fixes" for any bug fixes. -"API Breaking" for breaking exported APIs used by developers building on SDK. -Ref: https://keepachangelog.com/en/1.0.0/ --> # Changelog ## [Unreleased] -### Features +## [v1.5.1](https://github.com/cosmos/cosmos-sdk/releases/tag/log/v1.5.1) - 2025-03-07 + +* [#23928](https://github.com/cosmos/cosmos-sdk/pull/23928) Bump sonic json library to [v1.3.1](https://github.com/bytedance/sonic/releases/tag/v1.13.1) for Go 1.24 compatibility. + +## [v1.5.0](https://github.com/cosmos/cosmos-sdk/releases/tag/log/v1.5.0) - 2024-11-07 + +* [#22466](https://github.com/cosmos/cosmos-sdk/pull/22466) Disable coloring in testing logger. +* [#22233](https://github.com/cosmos/cosmos-sdk/pull/22233) Use sonic json library for faster json handling. +* [#22347](https://github.com/cosmos/cosmos-sdk/pull/22347) Add `cosmossdk.io/log/slog` to allow using a standard library log/slog-backed logger. This required to bump the minimum go version of `cosmossdk.io/log` to 1.21. + +## [v1.4.1](https://github.com/cosmos/cosmos-sdk/releases/tag/log/v1.4.1) - 2024-08-16 + +* [#21326](https://github.com/cosmos/cosmos-sdk/pull/21326) Avoid context key collision. + +## [v1.4.0](https://github.com/cosmos/cosmos-sdk/releases/tag/log/v1.4.0) - 2024-08-07 + +* [#21045](https://github.com/cosmos/cosmos-sdk/pull/21045) Add `WithContext` method implementations to make all returned loggers compatible with `cosmossdk.io/core/log.Logger` (v1) without a direct dependency. + +## [v1.3.1](https://github.com/cosmos/cosmos-sdk/releases/tag/log/v1.3.1) - 2024-02-05 + +* [#19346](https://github.com/cosmos/cosmos-sdk/pull/19346) Upgrade zerolog to v1.32.0. +* [#19346](https://github.com/cosmos/cosmos-sdk/pull/19346) `#15956` now works thanks to the upgrade of `zerolog`. + +## [v1.3.0](https://github.com/cosmos/cosmos-sdk/releases/tag/log/v1.3.0) - 2024-01-10 + +* [#18916](https://github.com/cosmos/cosmos-sdk/pull/18916) Introduce an option for setting hooks. +* [#18429](https://github.com/cosmos/cosmos-sdk/pull/18429) Support customization of log json marshal. +* [#18898](https://github.com/cosmos/cosmos-sdk/pull/18898) Add `WARN` level. + +## [v1.2.1](https://github.com/cosmos/cosmos-sdk/releases/tag/log/v1.2.1) - 2023-08-25 + +* [#17532](https://github.com/cosmos/cosmos-sdk/pull/17532) Proper marshalling of `fmt.Stringer` (follow-up of [#17205](https://github.com/cosmos/cosmos-sdk/pull/17205)). + +## [v1.2.0](https://github.com/cosmos/cosmos-sdk/releases/tag/log/v1.2.0) - 2023-07-31 + +* [#17194](https://github.com/cosmos/cosmos-sdk/pull/17194) Avoid repeating parse log level in `ParseLogLevel`. +* [#17205](https://github.com/cosmos/cosmos-sdk/pull/17205) Fix types that do not implement the `json.Marshaler` interface. +* [#15956](https://github.com/cosmos/cosmos-sdk/pull/15956) Introduce an option for enabling error stack trace. + +## [v1.1.0](https://github.com/cosmos/cosmos-sdk/releases/tag/log/v1.1.0) - 2023-04-27 -* [#15956](https://github.com/cosmos/cosmos-sdk/pull/15956) Introduce extra options to configure logger. +* [#15956](https://github.com/cosmos/cosmos-sdk/pull/15956) Introduce options to configure logger (enable/disable colored output, customize log timestamps). ## [v1.0.0](https://github.com/cosmos/cosmos-sdk/releases/tag/log/v1.0.0) - 2023-03-30 diff --git a/log/README.md b/log/README.md index c06f26e933b4..2dd94366a29b 100644 --- a/log/README.md +++ b/log/README.md @@ -1,3 +1,5 @@ # Log The `cosmossdk.io/log` provides a zerolog logging implementation for the Cosmos SDK and Cosmos SDK modules. + +To use a logger wrapping an instance of the standard library's `log/slog` package, use `cosmossdk.io/log/slog`. diff --git a/log/bench_test.go b/log/bench_test.go index d1dd9d8e6439..fdf5fca645ee 100644 --- a/log/bench_test.go +++ b/log/bench_test.go @@ -7,8 +7,9 @@ import ( "testing" "time" - "cosmossdk.io/log" "github.com/rs/zerolog" + + "cosmossdk.io/log" ) const message = "test message" @@ -82,7 +83,6 @@ func BenchmarkLoggers(b *testing.B) { // so that real write time is negligible. b.Run("zerolog", func(b *testing.B) { for _, bc := range benchCases { - bc := bc b.Run(bc.name, func(b *testing.B) { zl := zerolog.New(io.Discard) logger := log.NewCustomLogger(zl) @@ -98,7 +98,6 @@ func BenchmarkLoggers(b *testing.B) { // also useful as a reference for how expensive zerolog is. b.Run("specialized nop logger", func(b *testing.B) { for _, bc := range nopCases { - bc := bc b.Run(bc.name, func(b *testing.B) { logger := log.NewNopLogger() @@ -114,7 +113,6 @@ func BenchmarkLoggers(b *testing.B) { // so we offer the specialized version in the exported API. b.Run("zerolog nop logger", func(b *testing.B) { for _, bc := range nopCases { - bc := bc b.Run(bc.name, func(b *testing.B) { logger := log.NewCustomLogger(zerolog.Nop()) diff --git a/log/go.mod b/log/go.mod index b50bff9e7dbf..a98f8e92e556 100644 --- a/log/go.mod +++ b/log/go.mod @@ -1,15 +1,20 @@ module cosmossdk.io/log -go 1.20 +go 1.23.0 require ( - github.com/rs/zerolog v1.29.1 - gotest.tools/v3 v3.4.0 + github.com/bytedance/sonic v1.13.1 + github.com/pkg/errors v0.9.1 + github.com/rs/zerolog v1.33.0 ) require ( - github.com/google/go-cmp v0.5.5 // indirect - github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.19 // indirect - golang.org/x/sys v0.8.0 // indirect + github.com/bytedance/sonic/loader v0.2.4 // indirect + github.com/cloudwego/base64x v0.1.5 // indirect + github.com/klauspost/cpuid/v2 v2.2.10 // indirect + github.com/mattn/go-colorable v0.1.14 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + golang.org/x/arch v0.15.0 // indirect + golang.org/x/sys v0.31.0 // indirect ) diff --git a/log/go.sum b/log/go.sum index 9eaba02a5ecd..7befa19279b4 100644 --- a/log/go.sum +++ b/log/go.sum @@ -1,47 +1,53 @@ +github.com/bytedance/sonic v1.13.1 h1:Jyd5CIvdFnkOWuKXr+wm4Nyk2h0yAFsr8ucJgEasO3g= +github.com/bytedance/sonic v1.13.1/go.mod h1:o68xyaF9u2gvVBuGHPlUVCy+ZfmNNO5ETf1+KgkJhz4= +github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= +github.com/bytedance/sonic/loader v0.2.4 h1:ZWCw4stuXUsn1/+zQDqeE7JKP+QO47tz7QCNan80NzY= +github.com/bytedance/sonic/loader v0.2.4/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI= +github.com/cloudwego/base64x v0.1.5 h1:XPciSp1xaq2VCSt6lF0phncD4koWyULpl5bUxbfCyP4= +github.com/cloudwego/base64x v0.1.5/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= +github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= -github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE= +github.com/klauspost/cpuid/v2 v2.2.10/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0= +github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= +github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= 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/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.29.1 h1:cO+d60CHkknCbvzEWxP0S9K6KqyTjrCNUy1LdQLCGPc= -github.com/rs/zerolog v1.29.1/go.mod h1:Le6ESbR7hc+DP6Lt1THiV8CQSdkkNrd3R0XbEgp3ZBU= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= +golang.org/x/arch v0.15.0 h1:QtOrQd0bTUnhNVNndMpLHNWrDmYzZ2KDqSrEymqInZw= +golang.org/x/arch v0.15.0/go.mod h1:JmwW7aLIoRUKgaTzhkiEFxvcEiQGyOg9BMonBJUS7EE= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -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= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= -gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= +golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/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= +nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= diff --git a/log/level.go b/log/level.go index 9a4f094f2c9f..d8523f136a6c 100644 --- a/log/level.go +++ b/log/level.go @@ -35,7 +35,7 @@ func ParseLogLevel(levelStr string) (FilterFunc, error) { } // parse and validate the levels - filterMap := make(map[string]string) + filterMap := make(map[string]zerolog.Level) list := strings.Split(l, ",") for _, item := range list { moduleAndLevel := strings.Split(item, ":") @@ -50,18 +50,19 @@ func ParseLogLevel(levelStr string) (FilterFunc, error) { return nil, fmt.Errorf("duplicate module %s in log level list %s", module, list) } - if _, err := zerolog.ParseLevel(level); err != nil { + zllevel, err := zerolog.ParseLevel(level) + if err != nil { return nil, fmt.Errorf("invalid log level %s in log level list %s", level, list) } - filterMap[module] = level + filterMap[module] = zllevel } filterFunc := func(key, lvl string) bool { - level, ok := filterMap[key] + zllevel, ok := filterMap[key] if !ok { // no level filter for this key // check if there is a default level filter - level, ok = filterMap[defaultLogLevelKey] + zllevel, ok = filterMap[defaultLogLevelKey] if !ok { return false } @@ -72,11 +73,6 @@ func ParseLogLevel(levelStr string) (FilterFunc, error) { panic(err) } - zllevel, err := zerolog.ParseLevel(level) - if err != nil { - panic(err) - } - return zllvl < zllevel } diff --git a/log/level_test.go b/log/level_test.go index 3e2b804542ae..9b7e2a5ac103 100644 --- a/log/level_test.go +++ b/log/level_test.go @@ -4,44 +4,87 @@ import ( "testing" "cosmossdk.io/log" - "gotest.tools/v3/assert" ) func TestParseLogLevel(t *testing.T) { _, err := log.ParseLogLevel("") - assert.Error(t, err, "empty log level") + if err == nil { + t.Errorf("expected error for empty log level, got nil") + } level := "consensus:foo,mempool:debug,*:error" _, err = log.ParseLogLevel(level) - assert.Error(t, err, "invalid log level foo in log level list [consensus:foo mempool:debug *:error]") + if err == nil { + t.Errorf("expected error for invalid log level foo in log level list [consensus:foo mempool:debug *:error], got nil") + } level = "consensus:debug,mempool:debug,*:error" filter, err := log.ParseLogLevel(level) - assert.NilError(t, err) - assert.Assert(t, filter != nil) - - assert.Assert(t, !filter("consensus", "debug")) - assert.Assert(t, !filter("consensus", "info")) - assert.Assert(t, !filter("consensus", "error")) - assert.Assert(t, !filter("mempool", "debug")) - assert.Assert(t, !filter("mempool", "info")) - assert.Assert(t, !filter("mempool", "error")) - assert.Assert(t, !filter("state", "error")) - assert.Assert(t, !filter("server", "panic")) - - assert.Assert(t, filter("server", "debug")) - assert.Assert(t, filter("state", "debug")) - assert.Assert(t, filter("state", "info")) + if err != nil { + t.Errorf("unexpected error: %v", err) + } + if filter == nil { + t.Fatalf("expected non-nil filter, got nil") + } + + if filter("consensus", "debug") { + t.Errorf("expected filter to return false for consensus:debug") + } + if filter("consensus", "info") { + t.Errorf("expected filter to return false for consensus:info") + } + if filter("consensus", "error") { + t.Errorf("expected filter to return false for consensus:error") + } + if filter("mempool", "debug") { + t.Errorf("expected filter to return false for mempool:debug") + } + if filter("mempool", "info") { + t.Errorf("expected filter to return false for mempool:info") + } + if filter("mempool", "error") { + t.Errorf("expected filter to return false for mempool:error") + } + if filter("state", "error") { + t.Errorf("expected filter to return false for state:error") + } + if filter("server", "panic") { + t.Errorf("expected filter to return false for server:panic") + } + + if !filter("server", "debug") { + t.Errorf("expected filter to return true for server:debug") + } + if !filter("state", "debug") { + t.Errorf("expected filter to return true for state:debug") + } + if !filter("state", "info") { + t.Errorf("expected filter to return true for state:info") + } level = "error" filter, err = log.ParseLogLevel(level) - assert.NilError(t, err) - assert.Assert(t, filter != nil) + if err != nil { + t.Errorf("unexpected error: %v", err) + } + if filter == nil { + t.Fatalf("expected non-nil filter, got nil") + } - assert.Assert(t, !filter("state", "error")) - assert.Assert(t, !filter("consensus", "error")) + if filter("state", "error") { + t.Errorf("expected filter to return false for state:error") + } + if filter("consensus", "error") { + t.Errorf("expected filter to return false for consensus:error") + } - assert.Assert(t, filter("consensus", "debug")) - assert.Assert(t, filter("consensus", "info")) - assert.Assert(t, filter("state", "debug")) + if !filter("consensus", "debug") { + t.Errorf("expected filter to return true for consensus:debug") + } + if !filter("consensus", "info") { + t.Errorf("expected filter to return true for consensus:info") + } + if !filter("state", "debug") { + t.Errorf("expected filter to return true for state:debug") + } } diff --git a/log/logger.go b/log/logger.go index 46ae75b6198c..d8f5a314c09f 100644 --- a/log/logger.go +++ b/log/logger.go @@ -1,25 +1,50 @@ package log import ( + "encoding" + "encoding/json" + "fmt" "io" + "github.com/bytedance/sonic" + "github.com/pkg/errors" "github.com/rs/zerolog" + "github.com/rs/zerolog/pkgerrors" ) +func init() { + zerolog.InterfaceMarshalFunc = func(i any) ([]byte, error) { + switch v := i.(type) { + case json.Marshaler: + return sonic.Marshal(i) + case encoding.TextMarshaler: + return sonic.Marshal(i) + case fmt.Stringer: + return sonic.Marshal(v.String()) + default: + return sonic.Marshal(i) + } + } +} + // ModuleKey defines a module logging key. const ModuleKey = "module" // ContextKey is used to store the logger in the context. -var ContextKey struct{} +var ContextKey contextKey + +type contextKey struct{} // Logger is the Cosmos SDK logger interface. -// It maintains as much backward compatibility with the CometBFT logger as possible. -// All functionalities of the logger are available through the Impl() method. type Logger interface { // Info takes a message and a set of key/value pairs and logs with level INFO. // The key of the tuple must be a string. Info(msg string, keyVals ...any) + // Warn takes a message and a set of key/value pairs and logs with level WARN. + // The key of the tuple must be a string. + Warn(msg string, keyVals ...any) + // Error takes a message and a set of key/value pairs and logs with level ERR. // The key of the tuple must be a string. Error(msg string, keyVals ...any) @@ -37,6 +62,22 @@ type Logger interface { Impl() any } +// WithJSONMarshal configures zerolog global json encoding. +func WithJSONMarshal(marshaler func(v any) ([]byte, error)) { + zerolog.InterfaceMarshalFunc = func(i any) ([]byte, error) { + switch v := i.(type) { + case json.Marshaler: + return marshaler(i) + case encoding.TextMarshaler: + return marshaler(i) + case fmt.Stringer: + return marshaler(v.String()) + default: + return marshaler(i) + } + } +} + type zeroLogWrapper struct { *zerolog.Logger } @@ -69,6 +110,15 @@ func NewLogger(dst io.Writer, options ...Option) Logger { } logger := zerolog.New(output) + + if logCfg.StackTrace { + zerolog.ErrorStackMarshaler = func(err error) interface{} { + return pkgerrors.MarshalStack(errors.WithStack(err)) + } + + logger = logger.With().Stack().Logger() + } + if logCfg.TimeFormat != "" { logger = logger.With().Timestamp().Logger() } @@ -77,6 +127,8 @@ func NewLogger(dst io.Writer, options ...Option) Logger { logger = logger.Level(logCfg.Level) } + logger = logger.Hook(logCfg.Hooks...) + return zeroLogWrapper{&logger} } @@ -91,13 +143,19 @@ func (l zeroLogWrapper) Info(msg string, keyVals ...interface{}) { l.Logger.Info().Fields(keyVals).Msg(msg) } -// Error takes a message and a set of key/value pairs and logs with level DEBUG. +// Warn takes a message and a set of key/value pairs and logs with level WARN. +// The key of the tuple must be a string. +func (l zeroLogWrapper) Warn(msg string, keyVals ...interface{}) { + l.Logger.Warn().Fields(keyVals).Msg(msg) +} + +// Error takes a message and a set of key/value pairs and logs with level ERROR. // The key of the tuple must be a string. func (l zeroLogWrapper) Error(msg string, keyVals ...interface{}) { l.Logger.Error().Fields(keyVals).Msg(msg) } -// Debug takes a message and a set of key/value pairs and logs with level ERR. +// Debug takes a message and a set of key/value pairs and logs with level DEBUG. // The key of the tuple must be a string. func (l zeroLogWrapper) Debug(msg string, keyVals ...interface{}) { l.Logger.Debug().Fields(keyVals).Msg(msg) @@ -109,6 +167,12 @@ func (l zeroLogWrapper) With(keyVals ...interface{}) Logger { return zeroLogWrapper{&logger} } +// WithContext returns a new wrapped logger with additional context provided by a set. +func (l zeroLogWrapper) WithContext(keyVals ...interface{}) any { + logger := l.Logger.With().Fields(keyVals).Logger() + return zeroLogWrapper{&logger} +} + // Impl returns the underlying zerolog logger. // It can be used to used zerolog structured API directly instead of the wrapper. func (l zeroLogWrapper) Impl() interface{} { @@ -126,8 +190,10 @@ func NewNopLogger() Logger { // The custom implementation is about 3x faster. type nopLogger struct{} -func (nopLogger) Info(string, ...any) {} -func (nopLogger) Error(string, ...any) {} -func (nopLogger) Debug(string, ...any) {} -func (nopLogger) With(...any) Logger { return nopLogger{} } -func (nopLogger) Impl() any { return nopLogger{} } +func (nopLogger) Info(string, ...any) {} +func (nopLogger) Warn(string, ...any) {} +func (nopLogger) Error(string, ...any) {} +func (nopLogger) Debug(string, ...any) {} +func (nopLogger) With(...any) Logger { return nopLogger{} } +func (nopLogger) WithContext(...any) any { return nopLogger{} } +func (nopLogger) Impl() any { return nopLogger{} } diff --git a/log/logger_test.go b/log/logger_test.go new file mode 100644 index 000000000000..752026a25bd8 --- /dev/null +++ b/log/logger_test.go @@ -0,0 +1,61 @@ +package log_test + +import ( + "bytes" + "errors" + "strings" + "testing" + + "github.com/rs/zerolog" + + "cosmossdk.io/log" +) + +func inner() error { + return errors.New("seems we have an error here") +} + +type _MockHook string + +func (h _MockHook) Run(e *zerolog.Event, l zerolog.Level, msg string) { + e.Bool(string(h), true) +} + +func TestLoggerOptionHooks(t *testing.T) { + buf := new(bytes.Buffer) + var ( + mockHook1 _MockHook = "mock_message1" + mockHook2 _MockHook = "mock_message2" + ) + logger := log.NewLogger(buf, log.HooksOption(mockHook1, mockHook2), log.ColorOption(false)) + logger.Info("hello world") + if !strings.Contains(buf.String(), "mock_message1=true") { + t.Fatalf("expected mock_message1=true, got: %s", buf.String()) + } + if !strings.Contains(buf.String(), "mock_message2=true") { + t.Fatalf("expected mock_message2=true, got: %s", buf.String()) + } + + buf.Reset() + logger = log.NewLogger(buf, log.HooksOption(), log.ColorOption(false)) + logger.Info("hello world") + if !strings.Contains(buf.String(), "hello world") { + t.Fatalf("expected hello world, got: %s", buf.String()) + } +} + +func TestLoggerOptionStackTrace(t *testing.T) { + buf := new(bytes.Buffer) + logger := log.NewLogger(buf, log.TraceOption(true), log.ColorOption(false)) + logger.Error("this log should be displayed", "error", inner()) + if strings.Count(buf.String(), "logger_test.go") != 1 { + t.Fatalf("stack trace not found, got: %s", buf.String()) + } + buf.Reset() + + logger = log.NewLogger(buf, log.TraceOption(false), log.ColorOption(false)) + logger.Error("this log should be displayed", "error", inner()) + if strings.Count(buf.String(), "logger_test.go") > 0 { + t.Fatalf("stack trace found, got: %s", buf.String()) + } +} diff --git a/log/options.go b/log/options.go index f939fd486309..28cfefee2e80 100644 --- a/log/options.go +++ b/log/options.go @@ -12,7 +12,9 @@ var defaultConfig = Config{ Filter: nil, OutputJSON: false, Color: true, + StackTrace: false, TimeFormat: time.Kitchen, + Hooks: nil, } // Config defines configuration for the logger. @@ -21,7 +23,9 @@ type Config struct { Filter FilterFunc OutputJSON bool Color bool + StackTrace bool TimeFormat string + Hooks []zerolog.Hook } type Option func(*Config) @@ -78,3 +82,17 @@ func TimeFormatOption(format string) Option { cfg.TimeFormat = format } } + +// TraceOption add option to enable/disable print of stacktrace on error log +func TraceOption(val bool) Option { + return func(cfg *Config) { + cfg.StackTrace = val + } +} + +// HooksOption append hooks to the Logger hooks +func HooksOption(hooks ...zerolog.Hook) Option { + return func(cfg *Config) { + cfg.Hooks = append(cfg.Hooks, hooks...) + } +} diff --git a/log/slog/logger.go b/log/slog/logger.go new file mode 100644 index 000000000000..4b6c30ec4b97 --- /dev/null +++ b/log/slog/logger.go @@ -0,0 +1,50 @@ +// Package slog contains a Logger type that satisfies [cosmossdk.io/log.Logger], +// backed by a standard library [*log/slog.Logger]. +package slog + +import ( + "log/slog" + + "cosmossdk.io/log" +) + +var _ log.Logger = Logger{} + +// Logger satisfies [log.Logger] with logging backed by +// an instance of [*slog.Logger]. +type Logger struct { + log *slog.Logger +} + +// NewCustomLogger returns a Logger backed by an existing slog.Logger instance. +// All logging methods are called directly on the *slog.Logger; +// therefore it is the caller's responsibility to configure message filtering, +// level filtering, output format, and so on. +func NewCustomLogger(log *slog.Logger) Logger { + return Logger{log: log} +} + +func (l Logger) Info(msg string, keyVals ...any) { + l.log.Info(msg, keyVals...) +} + +func (l Logger) Warn(msg string, keyVals ...any) { + l.log.Warn(msg, keyVals...) +} + +func (l Logger) Error(msg string, keyVals ...any) { + l.log.Error(msg, keyVals...) +} + +func (l Logger) Debug(msg string, keyVals ...any) { + l.log.Debug(msg, keyVals...) +} + +func (l Logger) With(keyVals ...any) log.Logger { + return Logger{log: l.log.With(keyVals...)} +} + +// Impl returns l's underlying [*slog.Logger]. +func (l Logger) Impl() any { + return l.log +} diff --git a/log/slog/logger_test.go b/log/slog/logger_test.go new file mode 100644 index 000000000000..4a7a9d836eac --- /dev/null +++ b/log/slog/logger_test.go @@ -0,0 +1,92 @@ +package slog_test + +import ( + "bytes" + "encoding/json" + stdslog "log/slog" + "testing" + + "cosmossdk.io/log/slog" +) + +func TestSlog(t *testing.T) { + var buf bytes.Buffer + h := stdslog.NewJSONHandler(&buf, &stdslog.HandlerOptions{ + Level: stdslog.LevelDebug, + }) + logger := slog.NewCustomLogger(stdslog.New(h)) + + type logLine struct { + Level string `json:"level"` + Msg string `json:"msg"` + Num int `json:"num"` + } + + var line logLine + + logger.Debug("Message one", "num", 1) + if err := json.Unmarshal(buf.Bytes(), &line); err != nil { + t.Fatal(err) + } + if want := (logLine{ + Level: stdslog.LevelDebug.String(), + Msg: "Message one", + Num: 1, + }); want != line { + t.Fatalf("unexpected log record: want %v, got %v", want, line) + } + + buf.Reset() + logger.Info("Message two", "num", 2) + if err := json.Unmarshal(buf.Bytes(), &line); err != nil { + t.Fatal(err) + } + if want := (logLine{ + Level: stdslog.LevelInfo.String(), + Msg: "Message two", + Num: 2, + }); want != line { + t.Fatalf("unexpected log record: want %v, got %v", want, line) + } + + buf.Reset() + logger.Warn("Message three", "num", 3) + if err := json.Unmarshal(buf.Bytes(), &line); err != nil { + t.Fatal(err) + } + if want := (logLine{ + Level: stdslog.LevelWarn.String(), + Msg: "Message three", + Num: 3, + }); want != line { + t.Fatalf("unexpected log record: want %v, got %v", want, line) + } + + buf.Reset() + logger.Error("Message four", "num", 4) + if err := json.Unmarshal(buf.Bytes(), &line); err != nil { + t.Fatal(err) + } + if want := (logLine{ + Level: stdslog.LevelError.String(), + Msg: "Message four", + Num: 4, + }); want != line { + t.Fatalf("unexpected log record: want %v, got %v", want, line) + } + + wLogger := logger.With("num", 5) + buf.Reset() + wLogger.Info("Using .With") + + if err := json.Unmarshal(buf.Bytes(), &line); err != nil { + t.Fatal(err) + } + if want := (logLine{ + Level: stdslog.LevelInfo.String(), + Msg: "Using .With", + Num: 5, + }); want != line { + t.Fatalf("unexpected log record: want %v, got %v", want, line) + } +} diff --git a/log/sonar-project.properties b/log/sonar-project.properties deleted file mode 100644 index c78e11c7ec09..000000000000 --- a/log/sonar-project.properties +++ /dev/null @@ -1,14 +0,0 @@ -sonar.projectKey=cosmos-sdk-log -sonar.organization=cosmos - -sonar.projectName=Cosmos SDK - Log -sonar.project.monorepo.enabled=true - -sonar.sources=. -sonar.exclusions=**/*_test.go -sonar.tests=. -sonar.test.inclusions=**/*_test.go -sonar.go.coverage.reportPaths=coverage.out - -sonar.sourceEncoding=UTF-8 -sonar.scm.provider=git diff --git a/log/testing.go b/log/testing.go index f31f6e5182f4..0e82eced62ba 100644 --- a/log/testing.go +++ b/log/testing.go @@ -1,6 +1,10 @@ package log -import "github.com/rs/zerolog" +import ( + "time" + + "github.com/rs/zerolog" +) // TestingT is the interface required for logging in tests. // It is a subset of testing.T to avoid a direct dependency on the testing package. @@ -39,15 +43,18 @@ func NewTestLoggerError(t TestingT) Logger { } func newTestLogger(t TestingT, lvl zerolog.Level) Logger { - cw := zerolog.NewConsoleWriter() - cw.Out = zerolog.TestWriter{ - T: t, - // Normally one would use zerolog.ConsoleTestWriter - // to set the option on NewConsoleWriter, - // but the zerolog source for that is hardcoded to Frame=6. - // With Frame=6, all source locations are printed as "logger.go", - // but Frame=7 prints correct source locations. - Frame: 7, + cw := zerolog.ConsoleWriter{ + NoColor: true, + TimeFormat: time.Kitchen, + Out: zerolog.TestWriter{ + T: t, + // Normally one would use zerolog.ConsoleTestWriter + // to set the option on NewConsoleWriter, + // but the zerolog source for that is hardcoded to Frame=6. + // With Frame=6, all source locations are printed as "logger.go", + // but Frame=7 prints correct source locations. + Frame: 7, + }, } return NewCustomLogger(zerolog.New(cw).Level(lvl)) } diff --git a/log/writer.go b/log/writer.go index 9c6befef71fe..d6f0dc2381cb 100644 --- a/log/writer.go +++ b/log/writer.go @@ -1,9 +1,10 @@ package log import ( - "encoding/json" "fmt" "io" + + "github.com/bytedance/sonic" ) // NewFilterWriter returns a writer that filters out all key/value pairs that do not match the filter. @@ -28,7 +29,7 @@ func (fw *filterWriter) Write(p []byte) (n int, err error) { Module string `json:"module"` } - if err := json.Unmarshal(p, &event); err != nil { + if err := sonic.Unmarshal(p, &event); err != nil { return 0, fmt.Errorf("failed to unmarshal event: %w", err) } diff --git a/log/writer_test.go b/log/writer_test.go index fc312efb679b..d69d6ccdd60c 100644 --- a/log/writer_test.go +++ b/log/writer_test.go @@ -6,7 +6,6 @@ import ( "testing" "cosmossdk.io/log" - "gotest.tools/v3/assert" ) func TestFilteredWriter(t *testing.T) { @@ -14,13 +13,19 @@ func TestFilteredWriter(t *testing.T) { level := "consensus:debug,mempool:debug,*:error" filter, err := log.ParseLogLevel(level) - assert.NilError(t, err) + if err != nil { + t.Fatalf("failed to parse log level: %v", err) + } logger := log.NewLogger(buf, log.FilterOption(filter)) logger.Debug("this log line should be displayed", log.ModuleKey, "consensus") - assert.Check(t, strings.Contains(buf.String(), "this log line should be displayed")) + if !strings.Contains(buf.String(), "this log line should be displayed") { + t.Errorf("expected log line to be displayed, but it was not") + } buf.Reset() logger.Debug("this log line should be filtered", log.ModuleKey, "server") - assert.Check(t, buf.Len() == 0) + if buf.Len() != 0 { + t.Errorf("expected log line to be filtered, but it was not") + } } diff --git a/math/CHANGELOG.md b/math/CHANGELOG.md index b337d786d431..84b645292954 100644 --- a/math/CHANGELOG.md +++ b/math/CHANGELOG.md @@ -36,9 +36,79 @@ Ref: https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.j ## [Unreleased] +## [math/v1.5.0](https://github.com/cosmos/cosmos-sdk/releases/tag/math/v1.5.0) - 2025-01-06 + +* [#11783](https://github.com/cosmos/cosmos-sdk/issues/11783) Upstream GDA based decimal type + +## [math/v1.4.0](https://github.com/cosmos/cosmos-sdk/releases/tag/math/v1.4.0) - 2024-11-20 + +### Features + +* [#20034](https://github.com/cosmos/cosmos-sdk/pull/20034) Significantly speedup LegacyDec.QuoTruncate and LegacyDec.QuoRoundUp. + +### Bug fixes + +* Fix [ASA-2024-010: Math](https://github.com/cosmos/cosmos-sdk/security/advisories/GHSA-7225-m954-23v7) Bit length differences between Int and Dec + + +## [math/v1.3.0](https://github.com/cosmos/cosmos-sdk/releases/tag/math/v1.3.0) - 2024-02-22 + +### Features + +* [#18552](https://github.com/cosmos/cosmos-sdk/pull/18552) Add safe arithmetic operations for `math.Int` that return an error in case of an overflow or any mishap. +* [#18421](https://github.com/cosmos/cosmos-sdk/pull/18421) Add mutative api for `LegacyDec.BigInt()`. +* [#18874](https://github.com/cosmos/cosmos-sdk/pull/18874) Speedup `math.Int.Mul` by removing a duplicate overflow check +* [#19386](https://github.com/cosmos/cosmos-sdk/pull/19386) Speedup `math.Int` overflow checks +* [#19466](https://github.com/cosmos/cosmos-sdk/pull/19466) Speedup `math.NewLegacyDec` by one heap allocation +* [#19467](https://github.com/cosmos/cosmos-sdk/pull/19467) Slightly speedup `math.LegacyDec` `Ceil` and `MarshalTo` methods +* [#19479](https://github.com/cosmos/cosmos-sdk/pull/19479) Speedup `math.LegacyDec` functions that involve `math.Int` by removing a heap allocation. (`Ceil`, `TruncateInt`, `NewLegacyDecFromInt`) + +### Bug Fixes + +* [#18519](https://github.com/cosmos/cosmos-sdk/pull/18519) Prevent Overflow in `Dec.Ceil()`. + +## [math/v1.2.0](https://github.com/cosmos/cosmos-sdk/releases/tag/math/v1.2.0) - 2023-11-07 + +### Features + +* [#18247](https://github.com/cosmos/cosmos-sdk/pull/18247) Add mutative api for `Uint.BigInt()`. +* [#17803](https://github.com/cosmos/cosmos-sdk/pull/17803) Add mutative api for `Int.BigInt()`. +* [#18030](https://github.com/cosmos/cosmos-sdk/pull/18030) Add mutative api for `NewIntFromBigInt`. + +### Bug Fixes + +* [#18228](https://github.com/cosmos/cosmos-sdk/pull/18228) Fix panic when calling `BigInt()` on an uninitialized `Uint`. +* [#18214](https://github.com/cosmos/cosmos-sdk/pull/18214) Ensure that modifying the argument to `NewUIntFromBigInt` doesn't mutate the returned value. +* [#18211](https://github.com/cosmos/cosmos-sdk/pull/18211) RelativePow now returns 1 when 0^0, before it was returning the scale factor. +* [#17725](https://github.com/cosmos/cosmos-sdk/pull/17725) Fix state break in ApproxRoot. This has been present since math/v1.0.1. It changed the rounding behavior at precision end in an intermediary division from banker's to truncation. The truncation occurs from binary right shift in the case of square roots. The change is now reverted back to banker's rounding universally for any root. + +## [math/v1.1.2](https://github.com/cosmos/cosmos-sdk/releases/tag/math/v1.1.2) - 2023-08-21 + +### Bug Fixes + +* [#17489](https://github.com/cosmos/cosmos-sdk/pull/17489) Revert [#16263](https://github.com/cosmos/cosmos-sdk/pull/16263). + +## [math/v1.1.1](https://github.com/cosmos/cosmos-sdk/releases/tag/math/v1.1.1) - 2023-08-21 + +### Bug Fixes + +* [#17480](https://github.com/cosmos/cosmos-sdk/pull/17480) Fix panic when calling `.Size()` on a nil `math.Int` value. + +## [math/v1.1.0](https://github.com/cosmos/cosmos-sdk/releases/tag/math/v1.1.0) - 2023-08-19 + +### Features + +* [#17427](https://github.com/cosmos/cosmos-sdk/pull/17427) Implement LegacyDec.MulRoundUp that rounds up at precision end. + +### Improvements + +* [#17109](https://github.com/cosmos/cosmos-sdk/pull/17109) Add `.ToLegacyDec()` method on `math.Int` type for converting to `math.LegacyDec`. +* [#16263](https://github.com/cosmos/cosmos-sdk/pull/16263) Improved `math/Int.Size` by computing the decimal digits count instead of firstly invoking .Marshal() then checking the length + ### Bug Fixes -* [#16266](https://github.com/cosmos/cosmos-sdk/pull/16266) fix: legacy dec power mut zero exponent precision. +* [#17352](https://github.com/cosmos/cosmos-sdk/pull/17352) Ensure that modifying the argument to `NewIntFromBigInt` doesn't mutate the returned value. +* [#16266](https://github.com/cosmos/cosmos-sdk/pull/16266) Fix legacy dec power mut zero exponent precision. ## [math/v1.0.1](https://github.com/cosmos/cosmos-sdk/releases/tag/math/v1.0.1) - 2023-05-15 diff --git a/math/dec.go b/math/dec.go index d92b0042f38a..4935fb2eb9a3 100644 --- a/math/dec.go +++ b/math/dec.go @@ -2,949 +2,521 @@ package math import ( "encoding/json" - "errors" - "fmt" + stderrors "errors" "math/big" "strconv" - "strings" - "testing" -) - -// NOTE: never use new(Dec) or else we will panic unmarshalling into the -// nil embedded big.Int -type LegacyDec struct { - i *big.Int -} - -const ( - // number of decimal places - LegacyPrecision = 18 - // bits required to represent the above precision - // Ceiling[Log2[10^Precision - 1]] - LegacyDecimalPrecisionBits = 60 + "github.com/cockroachdb/apd/v3" - // decimalTruncateBits is the minimum number of bits removed - // by a truncate operation. It is equal to - // Floor[Log2[10^Precision - 1]]. - decimalTruncateBits = LegacyDecimalPrecisionBits - 1 - - maxDecBitLen = MaxBitLen + decimalTruncateBits - - // max number of iterations in ApproxRoot function - maxApproxRootIterations = 300 + "cosmossdk.io/errors" ) -var ( - precisionReuse = new(big.Int).Exp(big.NewInt(10), big.NewInt(LegacyPrecision), nil) - fivePrecision = new(big.Int).Quo(precisionReuse, big.NewInt(2)) - precisionMultipliers []*big.Int - zeroInt = big.NewInt(0) - oneInt = big.NewInt(1) - tenInt = big.NewInt(10) -) +var _ customProtobufType = &Dec{} -// Decimal errors -var ( - ErrLegacyEmptyDecimalStr = errors.New("decimal string cannot be empty") - ErrLegacyInvalidDecimalLength = errors.New("invalid decimal length") - ErrLegacyInvalidDecimalStr = errors.New("invalid decimal string") +const ( + // MaxExponent is the highest exponent supported. Exponents near this range will + // perform very slowly (many seconds per operation). + MaxExponent = apd.MaxExponent + // MinExponent is the lowest exponent supported with the same limitations as + // MaxExponent. + MinExponent = apd.MinExponent ) -// Set precision multipliers -func init() { - precisionMultipliers = make([]*big.Int, LegacyPrecision+1) - for i := 0; i <= LegacyPrecision; i++ { - precisionMultipliers[i] = calcPrecisionMultiplier(int64(i)) - } -} - -func precisionInt() *big.Int { - return new(big.Int).Set(precisionReuse) +// Dec is a wrapper struct around apd.Decimal that does no mutation of apd.Decimal's when performing +// arithmetic, instead creating a new apd.Decimal for every operation ensuring usage is safe. +// +// Using apd.Decimal directly can be unsafe because apd operations mutate the underlying Decimal, +// but when copying the big.Int structure can be shared between Decimal instances causing corruption. +// This was originally discovered in regen0-network/mainnet#15. +type Dec struct { + dec apd.Decimal } -func LegacyZeroDec() LegacyDec { return LegacyDec{new(big.Int).Set(zeroInt)} } -func LegacyOneDec() LegacyDec { return LegacyDec{precisionInt()} } -func LegacySmallestDec() LegacyDec { return LegacyDec{new(big.Int).Set(oneInt)} } +const mathCodespace = "math" -// calculate the precision multiplier -func calcPrecisionMultiplier(prec int64) *big.Int { - if prec < 0 { - panic(fmt.Sprintf("negative precision %v", prec)) - } +var ( + ErrInvalidDec = errors.Register(mathCodespace, 1, "invalid decimal") + ErrUnexpectedRounding = errors.Register(mathCodespace, 2, "unexpected rounding") + ErrNonIntegral = errors.Register(mathCodespace, 3, "value is non-integral") +) - if prec > LegacyPrecision { - panic(fmt.Sprintf("too much precision, maximum %v, provided %v", LegacyPrecision, prec)) - } - zerosToAdd := LegacyPrecision - prec - multiplier := new(big.Int).Exp(tenInt, big.NewInt(zerosToAdd), nil) - return multiplier +// In cosmos-sdk#7773, decimal128 (with 34 digits of precision) was suggested for performing +// Quo/Mult arithmetic generically across the SDK. Even though the SDK +// has yet to support a GDA with decimal128 (34 digits), we choose to utilize it here. +// https://github.com/cosmos/cosmos-sdk/issues/7773#issuecomment-725006142 +var dec128Context = apd.Context{ + Precision: 34, + MaxExponent: MaxExponent, + MinExponent: MinExponent, + Traps: apd.DefaultTraps, } -// get the precision multiplier, do not mutate result -func precisionMultiplier(prec int64) *big.Int { - if prec < 0 { - panic(fmt.Sprintf("negative precision %v", prec)) +// NewDecFromString converts a string to a Dec type, supporting standard, scientific, and negative notations. +// It handles non-numeric values and overflow conditions, returning errors for invalid inputs like "NaN" or "Infinity". +// +// Examples: +// - "123" -> Dec{123} +// - "-123.456" -> Dec{-123.456} +// - "1.23E4" -> Dec{12300} +// - "NaN" or "Infinity" -> ErrInvalidDec +// +// The internal representation is an arbitrary-precision decimal: Negative × Coeff × 10*Exponent +// The maximum exponent is 100_000 and must not be exceeded. Following values would be invalid: +// 1E100001 -> ErrInvalidDec +// -1E100001 -> ErrInvalidDec +// 1E-100001 -> ErrInvalidDec +// +// This function is essential for converting textual data into Dec types for numerical operations. +func NewDecFromString(s string) (Dec, error) { + d, _, err := apd.NewFromString(s) + if err != nil { + return Dec{}, ErrInvalidDec.Wrap(err.Error()) } - if prec > LegacyPrecision { - panic(fmt.Sprintf("too much precision, maximum %v, provided %v", LegacyPrecision, prec)) + switch d.Form { + case apd.NaN, apd.NaNSignaling: + return Dec{}, ErrInvalidDec.Wrap("not a number") + case apd.Infinite: + return Dec{}, ErrInvalidDec.Wrap(s) + case apd.Finite: + result := Dec{*d} + return result, nil + default: + return Dec{}, ErrInvalidDec.Wrapf("unsupported type: %d", d.Form) } - return precisionMultipliers[prec] } -// create a new Dec from integer assuming whole number -func LegacyNewDec(i int64) LegacyDec { - return LegacyNewDecWithPrec(i, 0) -} - -// create a new Dec from integer with decimal place at prec -// CONTRACT: prec <= Precision -func LegacyNewDecWithPrec(i, prec int64) LegacyDec { - return LegacyDec{ - new(big.Int).Mul(big.NewInt(i), precisionMultiplier(prec)), - } -} - -// create a new Dec from big integer assuming whole numbers -// CONTRACT: prec <= Precision -func LegacyNewDecFromBigInt(i *big.Int) LegacyDec { - return LegacyNewDecFromBigIntWithPrec(i, 0) +// NewDecFromInt64 converts an int64 to a Dec type. +// This function is useful for creating Dec values from integer literals or variables, +// ensuring they can be used in high-precision arithmetic operations defined for Dec types. +// +// Example: +// - NewDecFromInt64(123) returns a Dec representing the value 123. +func NewDecFromInt64(x int64) Dec { + var res Dec + res.dec.SetInt64(x) + return res +} + +// NewDecWithExp creates a Dec from a coefficient and exponent, calculated as coeff * 10^exp. +// Useful for precise decimal representations. +// Although this method can be used with a higher than maximum exponent or lower than minimum exponent, further arithmetic +// or other method may fail. +// +// Example: +// - NewDecWithExp(123, -2) -> Dec representing 1.23. +func NewDecWithExp(coeff int64, exp int32) Dec { + var res Dec + res.dec.SetFinite(coeff, exp) + return res } -// create a new Dec from big integer assuming whole numbers -// CONTRACT: prec <= Precision -func LegacyNewDecFromBigIntWithPrec(i *big.Int, prec int64) LegacyDec { - return LegacyDec{ - new(big.Int).Mul(i, precisionMultiplier(prec)), +// Add returns a new Dec representing the sum of `x` and `y` using returning a new Dec, we use apd.BaseContext. +// This function ensures that no arguments are mutated during the operation and checks for overflow conditions. +// If an overflow occurs, an error is returned. +// +// The precision is much higher as long as the max exponent is not exceeded. If the max exponent is exceeded, an error is returned. +// For example: +// - 1e100000 + -1e-1 +// - 1e100000 + 9e100000 +// - 1e100001 + 0 +// We can see that in apd.BaseContext the max exponent is defined hence we cannot exceed. +// +// This function wraps any internal errors with a context-specific error message for clarity. +func (x Dec) Add(y Dec) (Dec, error) { + var z Dec + _, err := apd.BaseContext.Add(&z.dec, &x.dec, &y.dec) + if err != nil { + return Dec{}, ErrInvalidDec.Wrap(err.Error()) } -} -// create a new Dec from big integer assuming whole numbers -// CONTRACT: prec <= Precision -func LegacyNewDecFromInt(i Int) LegacyDec { - return LegacyNewDecFromIntWithPrec(i, 0) + return z, nil } -// create a new Dec from big integer with decimal place at prec -// CONTRACT: prec <= Precision -func LegacyNewDecFromIntWithPrec(i Int, prec int64) LegacyDec { - return LegacyDec{ - new(big.Int).Mul(i.BigInt(), precisionMultiplier(prec)), +// Sub returns a new Dec representing the sum of `x` and `y` using returning a new Dec, we use apd.BaseContext. +// This function ensures that no arguments are mutated during the operation and checks for overflow conditions. +// If an overflow occurs, an error is returned. +// +// The precision is much higher as long as the max exponent is not exceeded. If the max exponent is exceeded, an error is returned. +// For example: +// - 1e-100001 - 0 +// - 1e100000 - 1e-1 +// - 1e100000 - -9e100000 +// - 1e100001 - 1e100001 (upper limit exceeded) +// - 1e-100001 - 1e-100001 (lower limit exceeded) +// We can see that in apd.BaseContext the max exponent is defined hence we cannot exceed. +// +// This function wraps any internal errors with a context-specific error message for clarity. +func (x Dec) Sub(y Dec) (Dec, error) { + var z Dec + _, err := apd.BaseContext.Sub(&z.dec, &x.dec, &y.dec) + if err != nil { + if err2 := stderrors.Unwrap(err); err2 != nil { + // use unwrapped error to not return "add:" prefix from raw apd error + err = err2 + } + return Dec{}, ErrInvalidDec.Wrap("sub: " + err.Error()) } + return z, nil } -// create a decimal from an input decimal string. -// valid must come in the form: +// Quo performs division of x by y using the decimal128 context with 34 digits of precision. +// It returns a new Dec or an error if the division is not feasible due to constraints of decimal128. // -// (-) whole integers (.) decimal integers +// Within Quo half up rounding may be performed to match the defined precision. If this is unwanted, QuoExact +// should be used instead. // -// examples of acceptable input include: +// Key error scenarios: +// - Division by zero (e.g., `123 / 0` or `0 / 0`) results in ErrInvalidDec. +// - Non-representable values due to extreme ratios or precision limits. // -// -123.456 -// 456.7890 -// 345 -// -456789 +// Examples: +// - `0 / 123` yields `0`. +// - `123 / 123` yields `1.000000000000000000000000000000000`. +// - `-123 / 123` yields `-1.000000000000000000000000000000000`. +// - `4 / 9` yields `0.4444444444444444444444444444444444`. +// - `5 / 9` yields `0.5555555555555555555555555555555556`. +// - `6 / 9` yields `0.6666666666666666666666666666666667`. +// - `1e-100000 / 10` yields error. // -// NOTE - An error will return if more decimal places -// are provided in the string than the constant Precision. -// -// CONTRACT - This function does not mutate the input str. -func LegacyNewDecFromStr(str string) (LegacyDec, error) { - // first extract any negative symbol - neg := false - if len(str) > 0 && str[0] == '-' { - neg = true - str = str[1:] - } - - if len(str) == 0 { - return LegacyDec{}, ErrLegacyEmptyDecimalStr - } - - strs := strings.Split(str, ".") - lenDecs := 0 - combinedStr := strs[0] - - if len(strs) == 2 { // has a decimal place - lenDecs = len(strs[1]) - if lenDecs == 0 || len(combinedStr) == 0 { - return LegacyDec{}, ErrLegacyInvalidDecimalLength - } - combinedStr += strs[1] - } else if len(strs) > 2 { - return LegacyDec{}, ErrLegacyInvalidDecimalStr - } - - if lenDecs > LegacyPrecision { - return LegacyDec{}, fmt.Errorf("value '%s' exceeds max precision by %d decimal places: max precision %d", str, LegacyPrecision-lenDecs, LegacyPrecision) - } - - // add some extra zero's to correct to the Precision factor - zerosToAdd := LegacyPrecision - lenDecs - zeros := strings.Repeat("0", zerosToAdd) - combinedStr += zeros - - combined, ok := new(big.Int).SetString(combinedStr, 10) // base 10 - if !ok { - return LegacyDec{}, fmt.Errorf("failed to set decimal string with base 10: %s", combinedStr) - } - if combined.BitLen() > maxDecBitLen { - return LegacyDec{}, fmt.Errorf("decimal '%s' out of range; bitLen: got %d, max %d", str, combined.BitLen(), maxDecBitLen) - } - if neg { - combined = new(big.Int).Neg(combined) - } - - return LegacyDec{combined}, nil -} - -// Decimal from string, panic on error -func LegacyMustNewDecFromStr(s string) LegacyDec { - dec, err := LegacyNewDecFromStr(s) +// This function is non-mutative and enhances error clarity with specific messages. +func (x Dec) Quo(y Dec) (Dec, error) { + var z Dec + _, err := dec128Context.Quo(&z.dec, &x.dec, &y.dec) if err != nil { - panic(err) + return Dec{}, ErrInvalidDec.Wrap(err.Error()) } - return dec -} - -func (d LegacyDec) IsNil() bool { return d.i == nil } // is decimal nil -func (d LegacyDec) IsZero() bool { return (d.i).Sign() == 0 } // is equal to zero -func (d LegacyDec) IsNegative() bool { return (d.i).Sign() == -1 } // is negative -func (d LegacyDec) IsPositive() bool { return (d.i).Sign() == 1 } // is positive -func (d LegacyDec) Equal(d2 LegacyDec) bool { return (d.i).Cmp(d2.i) == 0 } // equal decimals -func (d LegacyDec) GT(d2 LegacyDec) bool { return (d.i).Cmp(d2.i) > 0 } // greater than -func (d LegacyDec) GTE(d2 LegacyDec) bool { return (d.i).Cmp(d2.i) >= 0 } // greater than or equal -func (d LegacyDec) LT(d2 LegacyDec) bool { return (d.i).Cmp(d2.i) < 0 } // less than -func (d LegacyDec) LTE(d2 LegacyDec) bool { return (d.i).Cmp(d2.i) <= 0 } // less than or equal -func (d LegacyDec) Neg() LegacyDec { return LegacyDec{new(big.Int).Neg(d.i)} } // reverse the decimal sign -func (d LegacyDec) NegMut() LegacyDec { d.i.Neg(d.i); return d } // reverse the decimal sign, mutable -func (d LegacyDec) Abs() LegacyDec { return LegacyDec{new(big.Int).Abs(d.i)} } // absolute value -func (d LegacyDec) AbsMut() LegacyDec { d.i.Abs(d.i); return d } // absolute value, mutable -func (d LegacyDec) Set(d2 LegacyDec) LegacyDec { d.i.Set(d2.i); return d } // set to existing dec value -func (d LegacyDec) Clone() LegacyDec { return LegacyDec{new(big.Int).Set(d.i)} } // clone new dec - -// BigInt returns a copy of the underlying big.Int. -func (d LegacyDec) BigInt() *big.Int { - if d.IsNil() { - return nil - } - - cp := new(big.Int) - return cp.Set(d.i) -} -func (d LegacyDec) ImmutOp(op func(LegacyDec, LegacyDec) LegacyDec, d2 LegacyDec) LegacyDec { - return op(d.Clone(), d2) + return z, errors.Wrap(err, "decimal quotient error") } -func (d LegacyDec) ImmutOpInt(op func(LegacyDec, Int) LegacyDec, d2 Int) LegacyDec { - return op(d.Clone(), d2) -} - -func (d LegacyDec) ImmutOpInt64(op func(LegacyDec, int64) LegacyDec, d2 int64) LegacyDec { - // TODO: use already allocated operand bigint to avoid - // newint each time, add mutex for race condition - // Issue: https://github.com/cosmos/cosmos-sdk/issues/11166 - return op(d.Clone(), d2) -} - -func (d LegacyDec) SetInt64(i int64) LegacyDec { - d.i.SetInt64(i) - d.i.Mul(d.i, precisionReuse) - return d -} - -// addition -func (d LegacyDec) Add(d2 LegacyDec) LegacyDec { - return d.ImmutOp(LegacyDec.AddMut, d2) -} - -// mutable addition -func (d LegacyDec) AddMut(d2 LegacyDec) LegacyDec { - d.i.Add(d.i, d2.i) - - if d.i.BitLen() > maxDecBitLen { - panic("Int overflow") - } - return d -} - -// subtraction -func (d LegacyDec) Sub(d2 LegacyDec) LegacyDec { - return d.ImmutOp(LegacyDec.SubMut, d2) -} - -// mutable subtraction -func (d LegacyDec) SubMut(d2 LegacyDec) LegacyDec { - d.i.Sub(d.i, d2.i) - - if d.i.BitLen() > maxDecBitLen { - panic("Int overflow") - } - return d -} - -// multiplication -func (d LegacyDec) Mul(d2 LegacyDec) LegacyDec { - return d.ImmutOp(LegacyDec.MulMut, d2) -} - -// mutable multiplication -func (d LegacyDec) MulMut(d2 LegacyDec) LegacyDec { - d.i.Mul(d.i, d2.i) - chopped := chopPrecisionAndRound(d.i) - - if chopped.BitLen() > maxDecBitLen { - panic("Int overflow") +// QuoExact performs division like Quo and additionally checks for rounding. It returns ErrUnexpectedRounding if +// any rounding occurred during the division. If the division is exact, it returns the result without error. +// +// This function is particularly useful in financial calculations or other scenarios where precision is critical +// and rounding could lead to significant errors. +// +// Key error scenarios: +// - Division by zero (e.g., `123 / 0` or `0 / 0`) results in ErrInvalidDec. +// - Rounding would have occurred, which is not permissible in this context, resulting in ErrUnexpectedRounding. +// +// Examples: +// - `0 / 123` yields `0` without rounding. +// - `123 / 123` yields `1.000000000000000000000000000000000` exactly. +// - `-123 / 123` yields `-1.000000000000000000000000000000000` exactly. +// - `1 / 9` yields error for the precision limit +// - `1e-100000 / 10` yields error for crossing the lower exponent limit. +// - Any division resulting in a non-terminating decimal under decimal128 precision constraints triggers ErrUnexpectedRounding. +// +// This function does not mutate any arguments and wraps any internal errors with a context-specific error message for clarity. +func (x Dec) QuoExact(y Dec) (Dec, error) { + var z Dec + condition, err := dec128Context.Quo(&z.dec, &x.dec, &y.dec) + if err != nil { + return z, ErrInvalidDec.Wrap(err.Error()) } - *d.i = *chopped - return d -} - -// multiplication truncate -func (d LegacyDec) MulTruncate(d2 LegacyDec) LegacyDec { - return d.ImmutOp(LegacyDec.MulTruncateMut, d2) -} - -// mutable multiplication truncage -func (d LegacyDec) MulTruncateMut(d2 LegacyDec) LegacyDec { - d.i.Mul(d.i, d2.i) - chopPrecisionAndTruncate(d.i) - - if d.i.BitLen() > maxDecBitLen { - panic("Int overflow") + if condition.Rounded() { + return z, ErrUnexpectedRounding } - return d + return z, errors.Wrap(err, "decimal quotient error") } -// multiplication -func (d LegacyDec) MulInt(i Int) LegacyDec { - return d.ImmutOpInt(LegacyDec.MulIntMut, i) -} - -func (d LegacyDec) MulIntMut(i Int) LegacyDec { - d.i.Mul(d.i, i.BigInt()) - if d.i.BitLen() > maxDecBitLen { - panic("Int overflow") +// QuoInteger performs integer division of x by y, returning a new Dec formatted as decimal128 with 34 digit precision. +// This function returns the integer part of the quotient, discarding any fractional part, and is useful in scenarios +// where only the whole number part of the division result is needed without rounding. +// +// Key error scenarios: +// - Division by zero (e.g., `123 / 0`) results in ErrInvalidDec. +// - Overflow conditions if the result exceeds the storage capacity of a decimal128 formatted number. +// +// Examples: +// - `123 / 50` yields `2` (since the fractional part .46 is discarded). +// - `100 / 3` yields `33` (since the fractional part .3333... is discarded). +// - `50 / 100` yields `0` (since 0.5 is less than 1 and thus discarded). +// +// The function does not mutate any arguments and ensures that errors are wrapped with specific messages for clarity. +func (x Dec) QuoInteger(y Dec) (Dec, error) { + var z Dec + _, err := dec128Context.QuoInteger(&z.dec, &x.dec, &y.dec) + if err != nil { + return z, ErrInvalidDec.Wrap(err.Error()) } - return d -} - -// MulInt64 - multiplication with int64 -func (d LegacyDec) MulInt64(i int64) LegacyDec { - return d.ImmutOpInt64(LegacyDec.MulInt64Mut, i) + return z, nil } -func (d LegacyDec) MulInt64Mut(i int64) LegacyDec { - d.i.Mul(d.i, big.NewInt(i)) - - if d.i.BitLen() > maxDecBitLen { - panic("Int overflow") +// Mul returns a new Dec with value `x*y` (formatted as decimal128, with 34 digit precision) without +// mutating any argument and error if there is an overflow. +func (x Dec) Mul(y Dec) (Dec, error) { + var z Dec + if _, err := dec128Context.Mul(&z.dec, &x.dec, &y.dec); err != nil { + return z, ErrInvalidDec.Wrap(err.Error()) } - return d -} - -// quotient -func (d LegacyDec) Quo(d2 LegacyDec) LegacyDec { - return d.ImmutOp(LegacyDec.QuoMut, d2) + return z, nil } -var squaredPrecisionReuse = new(big.Int).Mul(precisionReuse, precisionReuse) - -// mutable quotient -func (d LegacyDec) QuoMut(d2 LegacyDec) LegacyDec { - // multiply by precision twice - d.i.Mul(d.i, squaredPrecisionReuse) - d.i.Quo(d.i, d2.i) - - chopPrecisionAndRound(d.i) - if d.i.BitLen() > maxDecBitLen { - panic("Int overflow") +// MulExact multiplies two Dec values x and y without rounding, using decimal128 precision. +// It returns an error if rounding is necessary to fit the result within the 34-digit limit. +// +// Example: +// - MulExact(Dec{1.234}, Dec{2.345}) -> Dec{2.893}, or ErrUnexpectedRounding if precision exceeded. +// +// Note: +// - This function does not alter the original Dec values. +func (x Dec) MulExact(y Dec) (Dec, error) { + var z Dec + condition, err := dec128Context.Mul(&z.dec, &x.dec, &y.dec) + if err != nil { + return z, ErrInvalidDec.Wrap(err.Error()) } - return d -} - -// quotient truncate -func (d LegacyDec) QuoTruncate(d2 LegacyDec) LegacyDec { - return d.ImmutOp(LegacyDec.QuoTruncateMut, d2) -} - -// mutable quotient truncate -func (d LegacyDec) QuoTruncateMut(d2 LegacyDec) LegacyDec { - // multiply precision twice - d.i.Mul(d.i, squaredPrecisionReuse) - d.i.Quo(d.i, d2.i) - - chopPrecisionAndTruncate(d.i) - if d.i.BitLen() > maxDecBitLen { - panic("Int overflow") + if condition.Rounded() { + return z, ErrUnexpectedRounding } - return d -} -// quotient, round up -func (d LegacyDec) QuoRoundUp(d2 LegacyDec) LegacyDec { - return d.ImmutOp(LegacyDec.QuoRoundupMut, d2) + return z, nil } -// mutable quotient, round up -func (d LegacyDec) QuoRoundupMut(d2 LegacyDec) LegacyDec { - // multiply precision twice - d.i.Mul(d.i, squaredPrecisionReuse) - d.i.Quo(d.i, d2.i) - - chopPrecisionAndRoundUp(d.i) - if d.i.BitLen() > maxDecBitLen { - panic("Int overflow") +// Modulo computes the remainder of division of x by y using decimal128 precision. +// It returns an error if y is zero or if any other error occurs during the computation. +// +// Example: +// - 7 mod 3 = 1 +// - 6 mod 3 = 0 +func (x Dec) Modulo(y Dec) (Dec, error) { + var z Dec + _, err := dec128Context.Rem(&z.dec, &x.dec, &y.dec) + if err != nil { + return z, ErrInvalidDec.Wrap(err.Error()) } - return d -} - -// quotient -func (d LegacyDec) QuoInt(i Int) LegacyDec { - return d.ImmutOpInt(LegacyDec.QuoIntMut, i) -} - -func (d LegacyDec) QuoIntMut(i Int) LegacyDec { - d.i.Quo(d.i, i.BigInt()) - return d + return z, errors.Wrap(err, "decimal remainder error") } -// QuoInt64 - quotient with int64 -func (d LegacyDec) QuoInt64(i int64) LegacyDec { - return d.ImmutOpInt64(LegacyDec.QuoInt64Mut, i) +// Int64 converts x to an int64 or returns an error if x cannot +// fit precisely into an int64. +func (x Dec) Int64() (int64, error) { + return x.dec.Int64() } -func (d LegacyDec) QuoInt64Mut(i int64) LegacyDec { - d.i.Quo(d.i, big.NewInt(i)) - return d -} - -// ApproxRoot returns an approximate estimation of a Dec's positive real nth root -// using Newton's method (where n is positive). The algorithm starts with some guess and -// computes the sequence of improved guesses until an answer converges to an -// approximate answer. It returns `|d|.ApproxRoot() * -1` if input is negative. -// A maximum number of 100 iterations is used a backup boundary condition for -// cases where the answer never converges enough to satisfy the main condition. -func (d LegacyDec) ApproxRoot(root uint64) (guess LegacyDec, err error) { - defer func() { - if r := recover(); r != nil { - var ok bool - err, ok = r.(error) - if !ok { - err = errors.New("out of bounds") - } - } - }() - - if d.IsNegative() { - absRoot, err := d.Neg().ApproxRoot(root) - return absRoot.NegMut(), err - } - - // One decimal, that we invalidate later. Helps us save a heap allocation. - scratchOneDec := LegacyOneDec() - if root == 1 || d.IsZero() || d.Equal(scratchOneDec) { - return d, nil - } - - if root == 0 { - return scratchOneDec, nil - } - - guess, delta := scratchOneDec, LegacyOneDec() - smallestDec := LegacySmallestDec() - - for iter := 0; delta.AbsMut().GT(smallestDec) && iter < maxApproxRootIterations; iter++ { - // Set prev = guess^{root - 1}, with an optimization for sqrt - // where root=2 => prev = guess. (And thus no extra heap allocations) - prev := guess - if root != 2 { - prev = guess.Power(root - 1) - } - if prev.IsZero() { - prev = smallestDec - } - delta.Set(d).QuoMut(prev) - delta.SubMut(guess) - // delta = delta / root. - // We optimize for sqrt, where root=2 => delta = delta >> 1 - if root == 2 { - delta.i.Rsh(delta.i, 1) +// BigInt converts x to a *big.Int or returns an error if x cannot +// fit precisely into an *big.Int. +func (x Dec) BigInt() (*big.Int, error) { + y, _ := x.Reduce() + z, ok := new(big.Int).SetString(y.Text('f'), 10) + if !ok { + return nil, ErrNonIntegral + } + return z, nil +} + +// SdkIntTrim rounds the decimal number towards zero to the nearest integer, then converts and returns it as `sdkmath.Int`. +// It handles both positive and negative values correctly by truncating towards zero. +// This function returns an ErrNonIntegral error if the resulting integer is larger than the maximum value that `sdkmath.Int` can represent. +func (x Dec) SdkIntTrim() (Int, error) { + y, _ := x.Reduce() + r := y.dec.Coeff + if y.dec.Exponent != 0 { + decs := apd.NewBigInt(10) + if y.dec.Exponent > 0 { + decs.Exp(decs, apd.NewBigInt(int64(y.dec.Exponent)), nil) + r.Mul(&y.dec.Coeff, decs) } else { - delta.QuoInt64Mut(int64(root)) - } - - guess.AddMut(delta) - } - - return guess, nil -} - -// Power returns a the result of raising to a positive integer power -func (d LegacyDec) Power(power uint64) LegacyDec { - res := LegacyDec{new(big.Int).Set(d.i)} - return res.PowerMut(power) -} - -func (d LegacyDec) PowerMut(power uint64) LegacyDec { - if power == 0 { - // Set to 1 with the correct precision. - d.i.Set(precisionReuse) - return d - } - tmp := LegacyOneDec() - - for i := power; i > 1; { - if i%2 != 0 { - tmp.MulMut(d) + decs.Exp(decs, apd.NewBigInt(int64(-y.dec.Exponent)), nil) + r.Quo(&y.dec.Coeff, decs) } - i /= 2 - d.MulMut(d) } - - return d.MulMut(tmp) -} - -// ApproxSqrt is a wrapper around ApproxRoot for the common special case -// of finding the square root of a number. It returns -(sqrt(abs(d)) if input is negative. -func (d LegacyDec) ApproxSqrt() (LegacyDec, error) { - return d.ApproxRoot(2) -} - -// is integer, e.g. decimals are zero -func (d LegacyDec) IsInteger() bool { - return new(big.Int).Rem(d.i, precisionReuse).Sign() == 0 -} - -// format decimal state -func (d LegacyDec) Format(s fmt.State, verb rune) { - _, err := s.Write([]byte(d.String())) - if err != nil { - panic(err) + if x.dec.Negative { + r.Neg(&r) } -} - -func (d LegacyDec) String() string { - if d.i == nil { - return d.i.String() + bigInt := r.MathBigInt() + if bigInt.BitLen() > MaxBitLen { + return ZeroInt(), ErrNonIntegral } - - isNeg := d.IsNegative() - - if isNeg { - d = d.Neg() - } - - bzInt, err := d.i.MarshalText() - if err != nil { - return "" - } - inputSize := len(bzInt) - - var bzStr []byte - - // TODO: Remove trailing zeros - // case 1, purely decimal - if inputSize <= LegacyPrecision { - bzStr = make([]byte, LegacyPrecision+2) - - // 0. prefix - bzStr[0] = byte('0') - bzStr[1] = byte('.') - - // set relevant digits to 0 - for i := 0; i < LegacyPrecision-inputSize; i++ { - bzStr[i+2] = byte('0') - } - - // set final digits - copy(bzStr[2+(LegacyPrecision-inputSize):], bzInt) - } else { - // inputSize + 1 to account for the decimal point that is being added - bzStr = make([]byte, inputSize+1) - decPointPlace := inputSize - LegacyPrecision - - copy(bzStr, bzInt[:decPointPlace]) // pre-decimal digits - bzStr[decPointPlace] = byte('.') // decimal point - copy(bzStr[decPointPlace+1:], bzInt[decPointPlace:]) // post-decimal digits - } - - if isNeg { - return "-" + string(bzStr) - } - - return string(bzStr) + return NewIntFromBigInt(bigInt), nil } -// Float64 returns the float64 representation of a Dec. -// Will return the error if the conversion failed. -func (d LegacyDec) Float64() (float64, error) { - return strconv.ParseFloat(d.String(), 64) +// String formatted in decimal notation: '-ddddd.dddd', no exponent +func (x Dec) String() string { + return string(fmtE(x.dec, 'E')) } -// MustFloat64 returns the float64 representation of a Dec. -// Would panic if the conversion failed. -func (d LegacyDec) MustFloat64() float64 { - if value, err := strconv.ParseFloat(d.String(), 64); err != nil { - panic(err) - } else { - return value - } -} - -// ____ -// __| |__ "chop 'em -// ` \ round!" -// ___|| ~ _ -bankers -// | | __ -// | | | __|__|__ -// |_____: / | $$$ | -// |________| - -// Remove a Precision amount of rightmost digits and perform bankers rounding -// on the remainder (gaussian rounding) on the digits which have been removed. +// Text converts the floating-point number x to a string according +// to the given format. The format is one of: // -// Mutates the input. Use the non-mutative version if that is undesired -func chopPrecisionAndRound(d *big.Int) *big.Int { - // remove the negative and add it back when returning - if d.Sign() == -1 { - // make d positive, compute chopped value, and then un-mutate d - d = d.Neg(d) - d = chopPrecisionAndRound(d) - d = d.Neg(d) - return d - } - - // get the truncated quotient and remainder - quo, rem := d, big.NewInt(0) - quo, rem = quo.QuoRem(d, precisionReuse, rem) - - if rem.Sign() == 0 { // remainder is zero - return quo - } - - switch rem.Cmp(fivePrecision) { - case -1: - return quo - case 1: - return quo.Add(quo, oneInt) - default: // bankers rounding must take place - // always round to an even number - if quo.Bit(0) == 0 { - return quo - } - return quo.Add(quo, oneInt) - } -} - -func chopPrecisionAndRoundUp(d *big.Int) *big.Int { - // remove the negative and add it back when returning - if d.Sign() == -1 { - // make d positive, compute chopped value, and then un-mutate d - d = d.Neg(d) - // truncate since d is negative... - chopPrecisionAndTruncate(d) - d = d.Neg(d) - return d - } - - // get the truncated quotient and remainder - quo, rem := d, big.NewInt(0) - quo, rem = quo.QuoRem(d, precisionReuse, rem) - - if rem.Sign() == 0 { // remainder is zero - return quo - } - - return quo.Add(quo, oneInt) -} - -func chopPrecisionAndRoundNonMutative(d *big.Int) *big.Int { - tmp := new(big.Int).Set(d) - return chopPrecisionAndRound(tmp) -} - -// RoundInt64 rounds the decimal using bankers rounding -func (d LegacyDec) RoundInt64() int64 { - chopped := chopPrecisionAndRoundNonMutative(d.i) - if !chopped.IsInt64() { - panic("Int64() out of bound") - } - return chopped.Int64() +// 'e' -d.ddddeÂądd, decimal exponent, exponent digits +// 'E' -d.ddddEÂądd, decimal exponent, exponent digits +// 'f' -ddddd.dddd, no exponent +// 'g' like 'e' for large exponents, like 'f' otherwise +// 'G' like 'E' for large exponents, like 'f' otherwise +// +// If format is a different character, Text returns a "%" followed by the +// unrecognized.Format character. The 'f' format has the possibility of +// displaying precision that is not present in the Decimal when it appends +// zeros (the 'g' format avoids the use of 'f' in this case). All other +// formats always show the exact precision of the Decimal. +func (x Dec) Text(format byte) string { + return x.dec.Text(format) } -// RoundInt round the decimal using bankers rounding -func (d LegacyDec) RoundInt() Int { - return NewIntFromBigInt(chopPrecisionAndRoundNonMutative(d.i)) +// Cmp compares x and y and returns: +// -1 if x < y +// 0 if x == y +// +1 if x > y +// undefined if d or x are NaN +func (x Dec) Cmp(y Dec) int { + return x.dec.Cmp(&y.dec) } -// chopPrecisionAndTruncate is similar to chopPrecisionAndRound, -// but always rounds down. It does not mutate the input. -func chopPrecisionAndTruncate(d *big.Int) { - d.Quo(d, precisionReuse) +// Equal checks if the decimal values of x and y are exactly equal. +// It returns true if both decimals represent the same value, otherwise false. +func (x Dec) Equal(y Dec) bool { + return x.dec.Cmp(&y.dec) == 0 } -func chopPrecisionAndTruncateNonMutative(d *big.Int) *big.Int { - tmp := new(big.Int).Set(d) - chopPrecisionAndTruncate(tmp) - return tmp +// IsZero returns true if the decimal is zero. +func (x Dec) IsZero() bool { + return x.dec.IsZero() } -// TruncateInt64 truncates the decimals from the number and returns an int64 -func (d LegacyDec) TruncateInt64() int64 { - chopped := chopPrecisionAndTruncateNonMutative(d.i) - if !chopped.IsInt64() { - panic("Int64() out of bound") - } - return chopped.Int64() +// IsNegative returns true if the decimal is negative. +func (x Dec) IsNegative() bool { + return x.dec.Negative && !x.dec.IsZero() } -// TruncateInt truncates the decimals from the number and returns an Int -func (d LegacyDec) TruncateInt() Int { - return NewIntFromBigInt(chopPrecisionAndTruncateNonMutative(d.i)) +// IsPositive returns true if the decimal is positive. +func (x Dec) IsPositive() bool { + return !x.dec.Negative && !x.dec.IsZero() } -// TruncateDec truncates the decimals from the number and returns a Dec -func (d LegacyDec) TruncateDec() LegacyDec { - return LegacyNewDecFromBigInt(chopPrecisionAndTruncateNonMutative(d.i)) +// IsFinite returns true if the decimal is finite. +func (x Dec) IsFinite() bool { + return x.dec.Form == apd.Finite } -// Ceil returns the smallest interger value (as a decimal) that is greater than -// or equal to the given decimal. -func (d LegacyDec) Ceil() LegacyDec { - tmp := new(big.Int).Set(d.i) - - quo, rem := tmp, big.NewInt(0) - quo, rem = quo.QuoRem(tmp, precisionReuse, rem) - - // no need to round with a zero remainder regardless of sign - if rem.Cmp(zeroInt) == 0 { - return LegacyNewDecFromBigInt(quo) - } - - if rem.Sign() == -1 { - return LegacyNewDecFromBigInt(quo) +// NumDecimalPlaces returns the number of decimal places in x. +func (x Dec) NumDecimalPlaces() uint32 { + exp := x.dec.Exponent + if exp >= 0 { + return 0 } - - return LegacyNewDecFromBigInt(quo.Add(quo, oneInt)) -} - -// LegacyMaxSortableDec is the largest Dec that can be passed into SortableDecBytes() -// Its negative form is the least Dec that can be passed in. -var LegacyMaxSortableDec LegacyDec - -func init() { - LegacyMaxSortableDec = LegacyOneDec().Quo(LegacySmallestDec()) + return uint32(-exp) } -// ValidSortableDec ensures that a Dec is within the sortable bounds, -// a Dec can't have a precision of less than 10^-18. -// Max sortable decimal was set to the reciprocal of SmallestDec. -func LegacyValidSortableDec(dec LegacyDec) bool { - return dec.Abs().LTE(LegacyMaxSortableDec) +// Reduce returns a copy of x with all trailing zeros removed and the number of zeros that were removed. +// It does not modify the original decimal. +func (x Dec) Reduce() (Dec, int) { + y := Dec{} + _, n := y.dec.Reduce(&x.dec) + return y, n } -// SortableDecBytes returns a byte slice representation of a Dec that can be sorted. -// Left and right pads with 0s so there are 18 digits to left and right of the decimal point. -// For this reason, there is a maximum and minimum value for this, enforced by ValidSortableDec. -func LegacySortableDecBytes(dec LegacyDec) []byte { - if !LegacyValidSortableDec(dec) { - panic("dec must be within bounds") - } - // Instead of adding an extra byte to all sortable decs in order to handle max sortable, we just - // makes its bytes be "max" which comes after all numbers in ASCIIbetical order - if dec.Equal(LegacyMaxSortableDec) { - return []byte("max") - } - // For the same reason, we make the bytes of minimum sortable dec be --, which comes before all numbers. - if dec.Equal(LegacyMaxSortableDec.Neg()) { - return []byte("--") - } - // We move the negative sign to the front of all the left padded 0s, to make negative numbers come before positive numbers - if dec.IsNegative() { - return append([]byte("-"), []byte(fmt.Sprintf(fmt.Sprintf("%%0%ds", LegacyPrecision*2+1), dec.Abs().String()))...) - } - return []byte(fmt.Sprintf(fmt.Sprintf("%%0%ds", LegacyPrecision*2+1), dec.String())) -} - -// reuse nil values -var nilJSON []byte - -func init() { - empty := new(big.Int) - bz, _ := empty.MarshalText() - nilJSON, _ = json.Marshal(string(bz)) -} - -// MarshalJSON marshals the decimal -func (d LegacyDec) MarshalJSON() ([]byte, error) { - if d.i == nil { - return nilJSON, nil +// Marshal serializes the decimal value into a byte slice in text format. +// This method represents the decimal in a portable and compact hybrid notation. +// Based on the exponent value, the number is formatted into decimal: -ddddd.ddddd, no exponent +// or scientific notation: -d.ddddEÂądd +// +// For example, the following transformations are made: +// - 0 -> 0 +// - 123 -> 123 +// - 10000 -> 10000 +// - -0.001 -> -0.001 +// - -0.000000001 -> -1E-9 +// +// Returns: +// - A byte slice of the decimal in text format. +// - An error if the decimal cannot be reduced or marshaled properly. +func (x Dec) Marshal() ([]byte, error) { + var d apd.Decimal + if _, _, err := dec128Context.Reduce(&d, &x.dec); err != nil { + return nil, ErrInvalidDec.Wrap(err.Error()) + } + return fmtE(d, 'E'), nil +} + +// fmtE formats a decimal number into a byte slice in scientific notation or fixed-point notation depending on the exponent. +// If the adjusted exponent is between -6 and 6 inclusive, it uses fixed-point notation, otherwise it uses scientific notation. +func fmtE(d apd.Decimal, fmt byte) []byte { + var scratch, dest [16]byte + buf := dest[:0] + digits := d.Coeff.Append(scratch[:0], 10) + totalDigits := int64(len(digits)) + adj := int64(d.Exponent) + totalDigits - 1 + if adj > -6 && adj < 6 { + return []byte(d.Text('f')) + } + switch { + case totalDigits > 5: + beforeComma := digits[0 : totalDigits-6] + adj -= int64(len(beforeComma) - 1) + buf = append(buf, beforeComma...) + buf = append(buf, '.') + buf = append(buf, digits[totalDigits-6:]...) + case totalDigits > 1: + buf = append(buf, digits[0]) + buf = append(buf, '.') + buf = append(buf, digits[1:]...) + default: + buf = append(buf, digits[0:]...) + } + + buf = append(buf, fmt) + var ch byte + if adj < 0 { + ch = '-' + adj = -adj + } else { + ch = '+' } - return json.Marshal(d.String()) + buf = append(buf, ch) + return strconv.AppendInt(buf, adj, 10) } -// UnmarshalJSON defines custom decoding scheme -func (d *LegacyDec) UnmarshalJSON(bz []byte) error { - if d.i == nil { - d.i = new(big.Int) - } - - var text string - err := json.Unmarshal(bz, &text) +// Unmarshal parses a byte slice containing a text-formatted decimal and stores the result in the receiver. +// It returns an error if the byte slice does not represent a valid decimal. +func (x *Dec) Unmarshal(data []byte) error { + result, err := NewDecFromString(string(data)) if err != nil { - return err + return ErrInvalidDec.Wrap(err.Error()) } - // TODO: Reuse dec allocation - newDec, err := LegacyNewDecFromStr(text) - if err != nil { - return err + if result.dec.Form != apd.Finite { + return ErrInvalidDec.Wrap("unknown decimal form") } - d.i = newDec.i + x.dec = result.dec return nil } -// MarshalYAML returns the YAML representation. -func (d LegacyDec) MarshalYAML() (interface{}, error) { - return d.String(), nil -} - -// Marshal implements the gogo proto custom type interface. -func (d LegacyDec) Marshal() ([]byte, error) { - i := d.i - if i == nil { - i = new(big.Int) - } - return i.MarshalText() -} - -// MarshalTo implements the gogo proto custom type interface. -func (d *LegacyDec) MarshalTo(data []byte) (n int, err error) { - i := d.i - if i == nil { - i = new(big.Int) - } - - if i.Cmp(zeroInt) == 0 { - copy(data, []byte{0x30}) - return 1, nil - } - - bz, err := d.Marshal() +// MarshalTo encodes the receiver into the provided byte slice and returns the number of bytes written and any error encountered. +func (x Dec) MarshalTo(data []byte) (n int, err error) { + bz, err := x.Marshal() if err != nil { return 0, err } - copy(data, bz) - return len(bz), nil -} - -// Unmarshal implements the gogo proto custom type interface. -func (d *LegacyDec) Unmarshal(data []byte) error { - if len(data) == 0 { - d = nil - return nil - } - - if d.i == nil { - d.i = new(big.Int) - } - - if err := d.i.UnmarshalText(data); err != nil { - return err - } - - if d.i.BitLen() > maxDecBitLen { - return fmt.Errorf("decimal out of range; got: %d, max: %d", d.i.BitLen(), maxDecBitLen) - } - - return nil + return copy(data, bz), nil } -// Size implements the gogo proto custom type interface. -func (d *LegacyDec) Size() int { - bz, _ := d.Marshal() +// Size returns the number of bytes required to encode the Dec value, which is useful for determining storage requirements. +func (x Dec) Size() int { + bz, _ := x.Marshal() return len(bz) } -// Override Amino binary serialization by proxying to protobuf. -func (d LegacyDec) MarshalAmino() ([]byte, error) { return d.Marshal() } -func (d *LegacyDec) UnmarshalAmino(bz []byte) error { return d.Unmarshal(bz) } - -// helpers - -// test if two decimal arrays are equal -func LegacyDecsEqual(d1s, d2s []LegacyDec) bool { - if len(d1s) != len(d2s) { - return false - } - - for i, d1 := range d1s { - if !d1.Equal(d2s[i]) { - return false - } - } - return true -} - -// minimum decimal between two -func LegacyMinDec(d1, d2 LegacyDec) LegacyDec { - if d1.LT(d2) { - return d1 - } - return d2 -} - -// maximum decimal between two -func LegacyMaxDec(d1, d2 LegacyDec) LegacyDec { - if d1.LT(d2) { - return d2 - } - return d1 -} - -// intended to be used with require/assert: require.True(DecEq(...)) -func LegacyDecEq(t *testing.T, exp, got LegacyDec) (*testing.T, bool, string, string, string) { - return t, exp.Equal(got), "expected:\t%v\ngot:\t\t%v", exp.String(), got.String() +// MarshalJSON serializes the Dec struct into a JSON-encoded byte slice using scientific notation. +func (x Dec) MarshalJSON() ([]byte, error) { + return json.Marshal(fmtE(x.dec, 'E')) } -func LegacyDecApproxEq(t *testing.T, d1, d2, tol LegacyDec) (*testing.T, bool, string, string, string) { - diff := d1.Sub(d2).Abs() - return t, diff.LTE(tol), "expected |d1 - d2| <:\t%v\ngot |d1 - d2| = \t\t%v", tol.String(), diff.String() -} - -// FormatDec formats a decimal (as encoded in protobuf) into a value-rendered -// string following ADR-050. This function operates with string manipulation -// (instead of manipulating the sdk.Dec object). -func FormatDec(v string) (string, error) { - parts := strings.Split(v, ".") - if len(parts) > 2 { - return "", fmt.Errorf("invalid decimal: too many points in %s", v) - } - - intPart, err := FormatInt(parts[0]) +// UnmarshalJSON implements the json.Unmarshaler interface for the Dec type, converting JSON strings to Dec objects. +func (x *Dec) UnmarshalJSON(data []byte) error { + var text string + err := json.Unmarshal(data, &text) if err != nil { - return "", err - } - - if len(parts) == 1 { - return intPart, nil - } - - decPart := strings.TrimRight(parts[1], "0") - if len(decPart) == 0 { - return intPart, nil + return err } - - // Ensure that the decimal part has only digits. - // https://github.com/cosmos/cosmos-sdk/issues/12811 - if !hasOnlyDigits(decPart) { - return "", fmt.Errorf("non-digits detected after decimal point in: %q", decPart) + val, err := NewDecFromString(text) + if err != nil { + return err } - - return intPart + "." + decPart, nil + *x = val + return nil } diff --git a/math/dec_bench_test.go b/math/dec_bench_test.go new file mode 100644 index 000000000000..52d79c8b4407 --- /dev/null +++ b/math/dec_bench_test.go @@ -0,0 +1,353 @@ +package math + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func BenchmarkCompareLegacyDecAndNewDecQuotient(b *testing.B) { + specs := map[string]struct { + dividend, divisor string + }{ + "small/ small": { + dividend: "100", divisor: "5", + }, + "big18/ small": { + dividend: "999999999999999999", divisor: "10", + }, + "self18/ self18": { + dividend: "999999999999999999", divisor: "999999999999999999", + }, + "big18/ big18": { + dividend: "888888888888888888", divisor: "444444444444444444", + }, + "decimal18b/ decimal18c": { + dividend: "8.88888888888888888", divisor: "4.1234567890123", + }, + "small/ big18": { + dividend: "100", divisor: "999999999999999999", + }, + "big34/ big34": { + dividend: "9999999999999999999999999999999999", divisor: "1999999999999999999999999999999999", + }, + "negative big34": { + dividend: "-9999999999999999999999999999999999", divisor: "999999999999999999999999999", + }, + "decimal small": { + dividend: "0.0000000001", divisor: "10", + }, + "decimal small/decimal small ": { + dividend: "0.0000000001", divisor: "0.0001", + }, + } + for name, spec := range specs { + b.Run(name, func(b *testing.B) { + b.Run("LegacyDec", func(b *testing.B) { + dv, ds := LegacyMustNewDecFromStr(spec.dividend), LegacyMustNewDecFromStr(spec.divisor) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _ = dv.Quo(ds) + } + }) + + b.Run("NewDec", func(b *testing.B) { + dv, ds := must(NewDecFromString(spec.dividend)), must(NewDecFromString(spec.divisor)) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, _ = dv.Quo(ds) + } + }) + }) + } +} + +func BenchmarkCompareLegacyDecAndNewDecSum(b *testing.B) { + specs := map[string]struct { + summands []string + }{ + "1+2": { + summands: []string{"1", "2"}, + }, + "small numbers": { + summands: []string{"123", "0.2", "3.1415", "15"}, + }, + "medium numbers": { + summands: []string{"1234.567899", "9991345552.2340134"}, + }, + "big18": { + summands: []string{"123456789012345678", "123456789012345678", "123456789012345678", "123456789012345678", "123456789012345678", "123456789012345678"}, + }, + + "growing numbers": { + summands: []string{"1", "100", "1000", "100000", "10000000", "10000000000", "10000000000000", "100000000000000000"}, + }, + "decimals": { + summands: []string{"0.1", "0.01", "0.001", "0.000001", "0.00000001", "0.00000000001", "0.00000000000001", "0.000000000000000001"}, + }, + } + for name, spec := range specs { + b.Run(name, func(b *testing.B) { + b.Run("LegacyDec", func(b *testing.B) { + summands := make([]LegacyDec, len(spec.summands)) + for i, s := range spec.summands { + summands[i] = LegacyMustNewDecFromStr(s) + } + sum := LegacyNewDec(0) + b.ResetTimer() + for i := 0; i < b.N; i++ { + for _, s := range summands { + sum = sum.Add(s) + } + } + }) + + b.Run("NewDec", func(b *testing.B) { + summands := make([]Dec, len(spec.summands)) + for i, s := range spec.summands { + summands[i] = must(NewDecFromString(s)) + } + sum := NewDecFromInt64(0) + b.ResetTimer() + for i := 0; i < b.N; i++ { + for _, s := range summands { + sum, _ = sum.Add(s) + } + } + }) + }) + } +} + +func BenchmarkCompareLegacyDecAndNewDecSub(b *testing.B) { + specs := map[string]struct { + minuend string + subtrahends []string + }{ + "100 - 1 - 2": { + minuend: "100", + subtrahends: []string{"1", "2"}, + }, + "small numbers": { + minuend: "152.4013", + subtrahends: []string{"123", "0.2", "3.1415", "15"}, + }, + "10000000 - big18 numbers": { + minuend: "10000000", + subtrahends: []string{"123456789012345678", "123456789012345678", "123456789012345678", "123456789012345678", "123456789012345678", "123456789012345678"}, + }, + "10000000 - growing numbers": { + minuend: "10000000", + subtrahends: []string{"1", "100", "1000", "100000", "10000000", "10000000000", "10000000000000", "100000000000000000"}, + }, + "10000000 shrinking decimals": { + minuend: "10000000", + subtrahends: []string{"0.1", "0.01", "0.001", "0.000001", "0.00000001", "0.00000000001", "0.00000000000001", "0.000000000000000001"}, + }, + } + for name, spec := range specs { + b.Run(name, func(b *testing.B) { + b.Run("LegacyDec", func(b *testing.B) { + summands := make([]LegacyDec, len(spec.subtrahends)) + for i, s := range spec.subtrahends { + summands[i] = LegacyMustNewDecFromStr(s) + } + diff := LegacyMustNewDecFromStr(spec.minuend) + b.ResetTimer() + for i := 0; i < b.N; i++ { + for _, s := range summands { + diff = diff.Sub(s) + } + } + }) + + b.Run("NewDec", func(b *testing.B) { + summands := make([]Dec, len(spec.subtrahends)) + for i, s := range spec.subtrahends { + summands[i] = must(NewDecFromString(s)) + } + diff := must(NewDecFromString(spec.minuend)) + b.ResetTimer() + for i := 0; i < b.N; i++ { + for _, s := range summands { + diff, _ = diff.Sub(s) + } + } + }) + }) + } +} + +func BenchmarkCompareLegacyDecAndNewDecMul(b *testing.B) { + specs := map[string]struct { + multiplier, multiplicant string + }{ + "small/ small": { + multiplier: "100", multiplicant: "5", + }, + "big18/ small": { + multiplier: "999999999999999999", multiplicant: "10", + }, + "self18/ self18": { + multiplier: "999999999999999999", multiplicant: "999999999999999999", + }, + "big18/ big18": { + multiplier: "888888888888888888", multiplicant: "444444444444444444", + }, + "decimal18b/ decimal18c": { + multiplier: "8.88888888888888888", multiplicant: "4.1234567890123", + }, + "small/ big18": { + multiplier: "100", multiplicant: "999999999999999999", + }, + "big34/ big34": { + multiplier: "9999999999999999999999999999999999", multiplicant: "1999999999999999999999999999999999", + }, + "negative big34": { + multiplier: "-9999999999999999999999999999999999", multiplicant: "999999999999999999999999999", + }, + "decimal small": { + multiplier: "0.0000000001", multiplicant: "10", + }, + "decimal small/decimal small ": { + multiplier: "0.0000000001", multiplicant: "0.0001", + }, + } + for name, spec := range specs { + b.Run(name, func(b *testing.B) { + b.Run("LegacyDec", func(b *testing.B) { + dv, ds := LegacyMustNewDecFromStr(spec.multiplier), LegacyMustNewDecFromStr(spec.multiplicant) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _ = dv.Mul(ds) + } + }) + + b.Run("NewDec", func(b *testing.B) { + dv, ds := must(NewDecFromString(spec.multiplier)), must(NewDecFromString(spec.multiplicant)) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, _ = dv.Mul(ds) + } + }) + }) + } +} + +func BenchmarkCompareLegacyDecAndNewDecMarshalUnmarshal(b *testing.B) { + specs := map[string]struct { + src string + }{ + "small": { + src: "1", + }, + "big18": { + src: "999999999999999999", + }, + "negative big34": { + src: "9999999999999999999999999999999999", + }, + "decimal": { + src: "12345.678901234341", + }, + } + for name, spec := range specs { + b.Run(name, func(b *testing.B) { + b.Run("LegacyDec", func(b *testing.B) { + src := LegacyMustNewDecFromStr(spec.src) + b.ResetTimer() + for i := 0; i < b.N; i++ { + bz, err := src.Marshal() + require.NoError(b, err) + var d LegacyDec + require.NoError(b, d.Unmarshal(bz)) + } + }) + + b.Run("NewDec", func(b *testing.B) { + src := must(NewDecFromString(spec.src)) + b.ResetTimer() + for i := 0; i < b.N; i++ { + bz, err := src.Marshal() + require.NoError(b, err) + var d Dec + require.NoError(b, d.Unmarshal(bz)) + } + }) + }) + } +} + +func BenchmarkCompareLegacyDecAndNewDecQuoInteger(b *testing.B) { + legacyB1 := LegacyNewDec(100) + newB1 := NewDecFromInt64(100) + + b.Run("LegacyDec", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _ = legacyB1.Quo(LegacyNewDec(1)) + } + }) + + b.Run("NewDec", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, _ = newB1.QuoInteger(NewDecFromInt64(1)) + } + }) +} + +func BenchmarkCompareLegacyAddAndDecAdd(b *testing.B) { + legacyB1 := LegacyNewDec(100) + legacyB2 := LegacyNewDec(5) + newB1 := NewDecFromInt64(100) + newB2 := NewDecFromInt64(5) + + b.Run("LegacyDec", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _ = legacyB1.Add(legacyB2) + } + }) + + b.Run("NewDec", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, _ = newB1.Add(newB2) + } + }) +} + +func BenchmarkCompareLegacySubAndDecMul(b *testing.B) { + legacyB1 := LegacyNewDec(100) + legacyB2 := LegacyNewDec(5) + newB1 := NewDecFromInt64(100) + newB2 := NewDecFromInt64(5) + + b.Run("LegacyDec", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _ = legacyB1.Mul(legacyB2) + } + }) + + b.Run("NewDec", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, _ = newB1.Mul(newB2) + } + }) +} + +func BenchmarkCompareLegacySubAndDecSub(b *testing.B) { + legacyB1 := LegacyNewDec(100) + legacyB2 := LegacyNewDec(5) + newB1 := NewDecFromInt64(100) + newB2 := NewDecFromInt64(5) + + b.Run("LegacyDec", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _ = legacyB1.Sub(legacyB2) + } + }) + + b.Run("NewDec", func(b *testing.B) { + for i := 0; i < b.N; i++ { + _, _ = newB1.Sub(newB2) + } + }) +} diff --git a/math/dec_examples_test.go b/math/dec_examples_test.go new file mode 100644 index 000000000000..c2cf3f5a836f --- /dev/null +++ b/math/dec_examples_test.go @@ -0,0 +1,323 @@ +package math + +import "fmt" + +func ExampleDec() { + d := NewDecFromInt64(1) // 1 + fmt.Println(d.String()) + + d = NewDecWithExp(-1234, -3) // -1.234 + fmt.Println(d.String()) + d = NewDecWithExp(1234, 0) // 1234 + fmt.Println(d.String()) + d = NewDecWithExp(1234, 1) // 12340 + fmt.Println(d.String()) + + // scientific notation + d, err := NewDecFromString("1.23E+4") // 12300 + if err != nil { + panic(err) + } + fmt.Println(d.String()) + + // decimal notation + d, err = NewDecFromString("1.234") + if err != nil { + panic(err) + } + fmt.Println(d.String()) + + // Output: 1 + // -1.234 + // 1234 + // 12340 + // 12300 + // 1.234 +} + +func ExampleDec_Add() { + sum, err := NewDecFromInt64(1).Add(NewDecFromInt64(1)) // 1 + 1 = 2 + if err != nil { + panic(err) + } + fmt.Println(sum.String()) + + const maxExp = 100_000 + _, err = NewDecWithExp(1, maxExp).Add(NewDecFromInt64(1)) // 1E+1000000 + 1 + if err != nil { + fmt.Println(err.Error()) + } + + sum, err = NewDecWithExp(1, maxExp).Add(NewDecWithExp(1, maxExp)) // 1E+1000000 + 1E+1000000 + if err != nil { + panic(err) + } + fmt.Println(sum.Text('E')) + + // the max exponent must not be exceeded + _, err = NewDecWithExp(1, maxExp+1).Add(NewDecFromInt64(1)) // 1E+1000001 + 1 + if err != nil { + fmt.Println(err.Error()) + } + + const minExp = -100_000 + // same for min exponent + _, err = NewDecWithExp(1, minExp-1).Add(NewDecFromInt64(1)) // 1E-1000001 + 1 + if err != nil { + fmt.Println(err.Error()) + } + // not even by adding 0 + _, err = NewDecWithExp(1, minExp-1).Add(NewDecFromInt64(0)) // 1E-1000001 + 0 + if err != nil { + fmt.Println(err.Error()) + } + + // Output: 2 + // 2E+100000 + // add: exponent out of range: invalid decimal + // add: exponent out of range: invalid decimal + // add: exponent out of range: invalid decimal +} + +func ExampleDec_Sub() { + sum, err := NewDecFromInt64(2).Sub(NewDecFromInt64(1)) // 2 - 1 + if err != nil { + panic(err) + } + fmt.Println(sum.String()) + + const maxExp = 100_000 + _, err = NewDecWithExp(1, maxExp).Sub(NewDecFromInt64(1)) // 1E+1000000 - 1 + if err != nil { + fmt.Println(err.Error()) + } + + sum, err = NewDecWithExp(1, maxExp).Sub(NewDecWithExp(1, maxExp)) // 1E+1000000 - 1E+1000000 + if err != nil { + panic(err) + } + fmt.Println(sum.Text('E')) + + // the max exponent must not be exceeded + _, err = NewDecWithExp(1, maxExp+1).Sub(NewDecFromInt64(1)) // 1E+1000001 - 1 + if err != nil { + fmt.Println(err.Error()) + } + + const minExp = -100_000 + // same for min exponent + _, err = NewDecWithExp(1, minExp-1).Sub(NewDecFromInt64(1)) // 1E-1000001 - 1 + if err != nil { + fmt.Println(err.Error()) + } + // not even by adding 0 + _, err = NewDecWithExp(1, minExp-1).Sub(NewDecFromInt64(0)) // 1E-1000001 - 0 + if err != nil { + fmt.Println(err.Error()) + } + + // Output: 1 + // 0E+100000 + // sub: exponent out of range: invalid decimal + // sub: exponent out of range: invalid decimal + // sub: exponent out of range: invalid decimal +} + +func ExampleDec_Quo() { + sum, err := NewDecFromInt64(6).Quo(NewDecFromInt64(2)) // 6 / 2 + if err != nil { + panic(err) + } + fmt.Println(sum.String()) + + sum, err = NewDecFromInt64(7).Quo(NewDecFromInt64(2)) // 7 / 2 + if err != nil { + panic(err) + } + fmt.Println(sum.String()) + + sum, err = NewDecFromInt64(4).Quo(NewDecFromInt64(9)) // 4 / 9 + if err != nil { + panic(err) + } + fmt.Println(sum.String()) + + const minExp = -100_000 + sum, err = NewDecWithExp(1, minExp).Quo(NewDecFromInt64(10)) // 1e-100000 / 10 + if err != nil { + fmt.Println(err.Error()) + } + + sum, err = NewDecFromInt64(1).Quo(NewDecFromInt64(0)) // 1 / 0 -> error + if err != nil { + fmt.Println(err.Error()) + } + + // Output: 3.000000000000000000000000000000000 + // 3.500000000000000000000000000000000 + // 0.4444444444444444444444444444444444 + // exponent out of range: invalid decimal + // division by zero: invalid decimal +} + +func ExampleDec_QuoExact() { + sum, err := NewDecFromInt64(6).QuoExact(NewDecFromInt64(2)) // 6 / 2 + if err != nil { + panic(err) + } + fmt.Println(sum.String()) + + sum, err = NewDecFromInt64(7).QuoExact(NewDecFromInt64(2)) // 7 / 2 + if err != nil { + panic(err) + } + fmt.Println(sum.String()) + + sum, err = NewDecFromInt64(4).QuoExact(NewDecFromInt64(9)) // 4 / 9 -> error + if err != nil { + fmt.Println(err.Error()) + } + + const minExp = -100_000 + sum, err = NewDecWithExp(1, minExp).QuoExact(NewDecFromInt64(10)) // 1e-100000 / 10 -> error + if err != nil { + fmt.Println(err.Error()) + } + + sum, err = NewDecFromInt64(1).QuoExact(NewDecFromInt64(0)) // 1 / 0 -> error + if err != nil { + fmt.Println(err.Error()) + } + + // Output: 3.000000000000000000000000000000000 + // 3.500000000000000000000000000000000 + // unexpected rounding + // exponent out of range: invalid decimal + // division by zero: invalid decimal +} + +func ExampleDec_QuoInteger() { + sum, err := NewDecFromInt64(6).QuoInteger(NewDecFromInt64(2)) // 6 / 2 + if err != nil { + panic(err) + } + fmt.Println(sum.String()) + + sum, err = NewDecFromInt64(7).QuoInteger(NewDecFromInt64(2)) // 7 / 2 + if err != nil { + panic(err) + } + fmt.Println(sum.String()) + + sum, err = NewDecFromInt64(4).QuoInteger(NewDecFromInt64(9)) // 4 / 9 -> error + if err != nil { + panic(err) + } + fmt.Println(sum.String()) + + const minExp = -100_000 + sum, err = NewDecWithExp(1, minExp).QuoInteger(NewDecFromInt64(10)) // 1e-100000 / 10 -> 0 + if err != nil { + panic(err) + } + fmt.Println(sum.String()) + + sum, err = NewDecFromInt64(1).QuoInteger(NewDecFromInt64(0)) // 1 / 0 -> error + if err != nil { + fmt.Println(err.Error()) + } + + // Output: 3 + // 3 + // 0 + // 0 + // division by zero: invalid decimal +} + +func ExampleDec_Mul() { + sum, err := NewDecFromInt64(2).Mul(NewDecFromInt64(3)) // 2 * 3 + if err != nil { + panic(err) + } + fmt.Println(sum.String()) + + sum, err = NewDecWithExp(125, -2).Mul(NewDecFromInt64(2)) // 1.25 * 2 + if err != nil { + panic(err) + } + fmt.Println(sum.String()) + + const maxExp = 100_000 + sum, err = NewDecWithExp(1, maxExp).Mul(NewDecFromInt64(10)) // 1e100000 * 10 -> err + if err != nil { + fmt.Println(err.Error()) + } + + sum, err = NewDecFromInt64(1).Mul(NewDecFromInt64(0)) // 1 * 0 + if err != nil { + panic(err) + } + fmt.Println(sum.String()) + + // Output: 6 + // 2.50 + // exponent out of range: invalid decimal + // 0 +} + +func ExampleDec_MulExact() { + sum, err := NewDecFromInt64(2).MulExact(NewDecFromInt64(3)) // 2 * 3 + if err != nil { + panic(err) + } + fmt.Println(sum.String()) + + sum, err = NewDecWithExp(125, -2).MulExact(NewDecFromInt64(2)) // 1.25 * 2 + if err != nil { + panic(err) + } + fmt.Println(sum.String()) + + const maxExp = 100_000 + sum, err = NewDecWithExp(1, maxExp).MulExact(NewDecFromInt64(10)) // 1e100000 * 10 -> err + if err != nil { + fmt.Println(err.Error()) + } + a, err := NewDecFromString("0.12345678901234567890123456789012345") // 35 digits after the comma + if err != nil { + panic(err) + } + sum, err = a.MulExact(NewDecFromInt64(1)) + if err != nil { + fmt.Println(err.Error()) + } + + sum, err = a.MulExact(NewDecFromInt64(0)) + if err != nil { + panic(err) + } + fmt.Println(sum.String()) + + sum, err = NewDecFromInt64(1).MulExact(NewDecFromInt64(0)) // 1 * 0 + if err != nil { + panic(err) + } + fmt.Println(sum.String()) + + // Output: 6 + // 2.50 + // exponent out of range: invalid decimal + // unexpected rounding + // 0E-35 + // 0 +} + +func ExampleDec_Modulo() { + sum, err := NewDecFromInt64(7).Modulo(NewDecFromInt64(3)) // 7 mod 3 = 1 + if err != nil { + panic(err) + } + fmt.Println(sum.String()) + + // Output: 1 +} diff --git a/math/dec_rapid_test.go b/math/dec_rapid_test.go new file mode 100644 index 000000000000..8a1830b86694 --- /dev/null +++ b/math/dec_rapid_test.go @@ -0,0 +1,527 @@ +package math + +import ( + "fmt" + "regexp" + "strconv" + "testing" + + "github.com/stretchr/testify/require" + "pgregory.net/rapid" +) + +// Rapid is a Go library for property-based testing. +func TestDecWithRapid(t *testing.T) { + // Property tests + t.Run("TestNewDecFromInt64", rapid.MakeCheck(testDecInt64)) + + // Properties about *FromString functions + t.Run("TestInvalidNewDecFromString", rapid.MakeCheck(testInvalidNewDecFromString)) + + // Properties about addition + t.Run("TestAddLeftIdentity", rapid.MakeCheck(testAddLeftIdentity)) + t.Run("TestAddRightIdentity", rapid.MakeCheck(testAddRightIdentity)) + t.Run("TestAddCommutative", rapid.MakeCheck(testAddCommutative)) + t.Run("TestAddAssociative", rapid.MakeCheck(testAddAssociative)) + + // Properties about subtraction + t.Run("TestSubRightIdentity", rapid.MakeCheck(testSubRightIdentity)) + t.Run("TestSubZero", rapid.MakeCheck(testSubZero)) + + // Properties about multiplication + t.Run("TestMulLeftIdentity", rapid.MakeCheck(testMulLeftIdentity)) + t.Run("TestMulRightIdentity", rapid.MakeCheck(testMulRightIdentity)) + t.Run("TestMulCommutative", rapid.MakeCheck(testMulCommutative)) + t.Run("TestMulAssociative", rapid.MakeCheck(testMulAssociative)) + t.Run("TestZeroIdentity", rapid.MakeCheck(testMulZero)) + + // Properties about division + t.Run("TestDivisionBySelf", rapid.MakeCheck(testSelfQuo)) + t.Run("TestDivisionByOne", rapid.MakeCheck(testQuoByOne)) + + // Properties combining operations + t.Run("TestSubAdd", rapid.MakeCheck(testSubAdd)) + t.Run("TestAddSub", rapid.MakeCheck(testAddSub)) + t.Run("TestMulQuoA", rapid.MakeCheck(testMulQuoA)) + t.Run("TestMulQuoB", rapid.MakeCheck(testMulQuoB)) + t.Run("TestMulQuoExact", rapid.MakeCheck(testMulQuoExact)) + t.Run("TestQuoMulExact", rapid.MakeCheck(testQuoMulExact)) + + // Properties about comparison and equality + t.Run("TestCmpInverse", rapid.MakeCheck(testCmpInverse)) + t.Run("TestEqualCommutative", rapid.MakeCheck(testEqualCommutative)) + + // Properties about tests on a single Dec + t.Run("TestIsZero", rapid.MakeCheck(testIsZero)) + t.Run("TestIsNegative", rapid.MakeCheck(testIsNegative)) + t.Run("TestIsPositive", rapid.MakeCheck(testIsPositive)) + t.Run("TestNumDecimalPlaces", rapid.MakeCheck(testNumDecimalPlaces)) + + // Unit tests + zero := Dec{} + one := NewDecFromInt64(1) + two := NewDecFromInt64(2) + three := NewDecFromInt64(3) + four := NewDecFromInt64(4) + five := NewDecFromInt64(5) + minusOne := NewDecFromInt64(-1) + + onePointOneFive, err := NewDecFromString("1.15") + require.NoError(t, err) + twoPointThreeFour, err := NewDecFromString("2.34") + require.NoError(t, err) + threePointFourNine, err := NewDecFromString("3.49") + require.NoError(t, err) + onePointFourNine, err := NewDecFromString("1.49") + require.NoError(t, err) + minusFivePointZero, err := NewDecFromString("-5.0") + require.NoError(t, err) + + twoThousand := NewDecWithExp(2, 3) + require.True(t, twoThousand.Equal(NewDecFromInt64(2000))) + + res, err := two.Add(zero) + require.NoError(t, err) + require.True(t, res.Equal(two)) + + res, err = five.Sub(two) + require.NoError(t, err) + require.True(t, res.Equal(three)) + + res, err = four.Quo(two) + require.NoError(t, err) + require.True(t, res.Equal(two)) + + res, err = five.QuoInteger(two) + require.NoError(t, err) + require.True(t, res.Equal(two)) + + res, err = five.Modulo(two) + require.NoError(t, err) + require.True(t, res.Equal(one)) + + x, err := four.Int64() + require.NoError(t, err) + require.Equal(t, int64(4), x) + + require.Equal(t, "5", five.String()) + + res, err = onePointOneFive.Add(twoPointThreeFour) + require.NoError(t, err) + require.True(t, res.Equal(threePointFourNine)) + + res, err = threePointFourNine.Sub(two) + require.NoError(t, err) + require.True(t, res.Equal(onePointFourNine)) + + res, err = minusOne.Sub(four) + require.NoError(t, err) + require.True(t, res.Equal(minusFivePointZero)) + + require.True(t, zero.IsZero()) + require.False(t, zero.IsPositive()) + require.False(t, zero.IsNegative()) + + require.False(t, one.IsZero()) + require.True(t, one.IsPositive()) + require.False(t, one.IsNegative()) + + require.False(t, minusOne.IsZero()) + require.False(t, minusOne.IsPositive()) + require.True(t, minusOne.IsNegative()) + + res, err = one.MulExact(two) + require.NoError(t, err) + require.True(t, res.Equal(two)) +} + +var genDec *rapid.Generator[Dec] = rapid.Custom(func(t *rapid.T) Dec { + f := rapid.Float64().Draw(t, "f") + dec, err := NewDecFromString(fmt.Sprintf("%g", f)) + require.NoError(t, err) + return dec +}) + +// A Dec value and the float used to create it +type floatAndDec struct { + float float64 + dec Dec +} + +// Generate a Dec value along with the float used to create it +var genFloatAndDec *rapid.Generator[floatAndDec] = rapid.Custom(func(t *rapid.T) floatAndDec { + f := rapid.Float64().Draw(t, "f") + dec, err := NewDecFromString(fmt.Sprintf("%g", f)) + require.NoError(t, err) + return floatAndDec{f, dec} +}) + +// Property: n == NewDecFromInt64(n).Int64() +func testDecInt64(t *rapid.T) { + nIn := rapid.Int64().Draw(t, "n") + nOut, err := NewDecFromInt64(nIn).Int64() + + require.NoError(t, err) + require.Equal(t, nIn, nOut) +} + +// Property: invalid_number_string(s) => NewDecFromString(s) == err +func testInvalidNewDecFromString(t *rapid.T) { + s := rapid.StringMatching("[[:alpha:]]+").Draw(t, "s") + _, err := NewDecFromString(s) + require.Error(t, err) +} + +// Property: 0 + a == a +func testAddLeftIdentity(t *rapid.T) { + a := genDec.Draw(t, "a") + zero := NewDecFromInt64(0) + + b, err := zero.Add(a) + require.NoError(t, err) + + require.True(t, a.Equal(b)) +} + +// Property: a + 0 == a +func testAddRightIdentity(t *rapid.T) { + a := genDec.Draw(t, "a") + zero := NewDecFromInt64(0) + + b, err := a.Add(zero) + require.NoError(t, err) + + require.True(t, a.Equal(b)) +} + +// Property: a + b == b + a +func testAddCommutative(t *rapid.T) { + a := genDec.Draw(t, "a") + b := genDec.Draw(t, "b") + + c, err := a.Add(b) + require.NoError(t, err) + + d, err := b.Add(a) + require.NoError(t, err) + + require.True(t, c.Equal(d)) +} + +// Property: (a + b) + c == a + (b + c) +func testAddAssociative(t *rapid.T) { + a := genDec.Draw(t, "a") + b := genDec.Draw(t, "b") + c := genDec.Draw(t, "c") + + // (a + b) + c + d, err := a.Add(b) + require.NoError(t, err) + + e, err := d.Add(c) + require.NoError(t, err) + + // a + (b + c) + f, err := b.Add(c) + require.NoError(t, err) + + g, err := a.Add(f) + require.NoError(t, err) + + require.True(t, e.Equal(g)) +} + +// Property: a - 0 == a +func testSubRightIdentity(t *rapid.T) { + a := genDec.Draw(t, "a") + zero := NewDecFromInt64(0) + + b, err := a.Sub(zero) + require.NoError(t, err) + + require.True(t, a.Equal(b)) +} + +// Property: a - a == 0 +func testSubZero(t *rapid.T) { + a := genDec.Draw(t, "a") + zero := NewDecFromInt64(0) + + b, err := a.Sub(a) + require.NoError(t, err) + + require.True(t, b.Equal(zero)) +} + +// Property: 1 * a == a +func testMulLeftIdentity(t *rapid.T) { + a := genDec.Draw(t, "a") + one := NewDecFromInt64(1) + + b, err := one.Mul(a) + require.NoError(t, err) + + require.True(t, a.Equal(b)) +} + +// Property: a * 1 == a +func testMulRightIdentity(t *rapid.T) { + a := genDec.Draw(t, "a") + one := NewDecFromInt64(1) + + b, err := a.Mul(one) + require.NoError(t, err) + + require.True(t, a.Equal(b)) +} + +// Property: a * b == b * a +func testMulCommutative(t *rapid.T) { + a := genDec.Draw(t, "a") + b := genDec.Draw(t, "b") + + c, err := a.Mul(b) + require.NoError(t, err) + + d, err := b.Mul(a) + require.NoError(t, err) + + require.True(t, c.Equal(d)) +} + +// Property: (a * b) * c == a * (b * c) +func testMulAssociative(t *rapid.T) { + a := genDec.Draw(t, "a") + b := genDec.Draw(t, "b") + c := genDec.Draw(t, "c") + + // (a * b) * c + d, err := a.Mul(b) + require.NoError(t, err) + + e, err := d.Mul(c) + require.NoError(t, err) + + // a * (b * c) + f, err := b.Mul(c) + require.NoError(t, err) + + g, err := a.Mul(f) + require.NoError(t, err) + + require.True(t, e.Equal(g)) +} + +// Property: (a - b) + b == a +func testSubAdd(t *rapid.T) { + a := genDec.Draw(t, "a") + b := genDec.Draw(t, "b") + + c, err := a.Sub(b) + require.NoError(t, err) + + d, err := c.Add(b) + require.NoError(t, err) + + require.True(t, a.Equal(d)) +} + +// Property: (a + b) - b == a +func testAddSub(t *rapid.T) { + a := genDec.Draw(t, "a") + b := genDec.Draw(t, "b") + + c, err := a.Add(b) + require.NoError(t, err) + + d, err := c.Sub(b) + require.NoError(t, err) + + require.True(t, a.Equal(d)) +} + +// Property: a * 0 = 0 +func testMulZero(t *rapid.T) { + a := genDec.Draw(t, "a") + zero := Dec{} + + c, err := a.Mul(zero) + require.NoError(t, err) + require.True(t, c.IsZero()) +} + +// Property: a/a = 1 +func testSelfQuo(t *rapid.T) { + decNotZero := func(d Dec) bool { return !d.IsZero() } + a := genDec.Filter(decNotZero).Draw(t, "a") + one := NewDecFromInt64(1) + + b, err := a.Quo(a) + require.NoError(t, err) + require.True(t, one.Equal(b)) +} + +// Property: a/1 = a +func testQuoByOne(t *rapid.T) { + a := genDec.Draw(t, "a") + one := NewDecFromInt64(1) + + b, err := a.Quo(one) + require.NoError(t, err) + require.True(t, a.Equal(b)) +} + +// Property: (a * b) / a == b +func testMulQuoA(t *rapid.T) { + decNotZero := func(d Dec) bool { return !d.IsZero() } + a := genDec.Filter(decNotZero).Draw(t, "a") + b := genDec.Draw(t, "b") + + c, err := a.Mul(b) + require.NoError(t, err) + + d, err := c.Quo(a) + require.NoError(t, err) + + require.True(t, b.Equal(d)) +} + +// Property: (a * b) / b == a +func testMulQuoB(t *rapid.T) { + decNotZero := func(d Dec) bool { return !d.IsZero() } + a := genDec.Draw(t, "a") + b := genDec.Filter(decNotZero).Draw(t, "b") + + c, err := a.Mul(b) + require.NoError(t, err) + + d, err := c.Quo(b) + require.NoError(t, err) + + require.True(t, a.Equal(d)) +} + +// Property: (a * 10^b) / 10^b == a using MulExact and QuoExact +// and a with no more than b decimal places (b <= 32). +func testMulQuoExact(t *rapid.T) { + b := rapid.Uint32Range(0, 32).Draw(t, "b") + decPrec := func(d Dec) bool { return d.NumDecimalPlaces() <= b } + a := genDec.Filter(decPrec).Draw(t, "a") + + c := NewDecWithExp(1, int32(b)) + + d, err := a.MulExact(c) + require.NoError(t, err) + + e, err := d.QuoExact(c) + require.NoError(t, err) + + require.True(t, a.Equal(e)) +} + +// Property: (a / b) * b == a using QuoExact and MulExact and +// a as an integer. +func testQuoMulExact(t *rapid.T) { + a := rapid.Uint64().Draw(t, "a") + aDec, err := NewDecFromString(fmt.Sprintf("%d", a)) + require.NoError(t, err) + b := rapid.Uint32Range(0, 32).Draw(t, "b") + c := NewDecWithExp(1, int32(b)) + + require.NoError(t, err) + + d, err := aDec.QuoExact(c) + require.NoError(t, err) + + e, err := d.MulExact(c) + require.NoError(t, err) + + require.True(t, aDec.Equal(e)) +} + +// Property: Cmp(a, b) == -Cmp(b, a) +func testCmpInverse(t *rapid.T) { + a := genDec.Draw(t, "a") + b := genDec.Draw(t, "b") + + require.Equal(t, a.Cmp(b), -b.Cmp(a)) +} + +// Property: Equal(a, b) == Equal(b, a) +func testEqualCommutative(t *rapid.T) { + a := genDec.Draw(t, "a") + b := genDec.Draw(t, "b") + + require.Equal(t, a.Equal(b), b.Equal(a)) +} + +// Property: isZero(f) == isZero(NewDecFromString(f.String())) +func testIsZero(t *rapid.T) { + floatAndDec := genFloatAndDec.Draw(t, "floatAndDec") + f, dec := floatAndDec.float, floatAndDec.dec + + require.Equal(t, f == 0, dec.IsZero()) +} + +// Property: isNegative(f) == isNegative(NewDecFromString(f.String())) +func testIsNegative(t *rapid.T) { + floatAndDec := genFloatAndDec.Draw(t, "floatAndDec") + f, dec := floatAndDec.float, floatAndDec.dec + + require.Equal(t, f < 0, dec.IsNegative()) +} + +// Property: isPositive(f) == isPositive(NewDecFromString(f.String())) +func testIsPositive(t *rapid.T) { + floatAndDec := genFloatAndDec.Draw(t, "floatAndDec") + f, dec := floatAndDec.float, floatAndDec.dec + + require.Equal(t, f > 0, dec.IsPositive()) +} + +// Property: floatDecimalPlaces(f) == NumDecimalPlaces(NewDecFromString(f.String())) +func testNumDecimalPlaces(t *rapid.T) { + floatAndDec := genFloatAndDec.Draw(t, "floatAndDec") + f, dec := floatAndDec.float, floatAndDec.dec + + require.Equal(t, floatDecimalPlaces(t, f), dec.NumDecimalPlaces()) +} + +func floatDecimalPlaces(t *rapid.T, f float64) uint32 { + reScientific := regexp.MustCompile(`^\-?(?:[[:digit:]]+(?:\.([[:digit:]]+))?|\.([[:digit:]]+))(?:e?(?:\+?([[:digit:]]+)|(-[[:digit:]]+)))?$`) + fStr := fmt.Sprintf("%g", f) + matches := reScientific.FindAllStringSubmatch(fStr, 1) + if len(matches) != 1 { + t.Fatalf("Didn't match float: %g", f) + } + + // basePlaces is the number of decimal places in the decimal part of the + // string + basePlaces := 0 + if matches[0][1] != "" { + basePlaces = len(matches[0][1]) + } else if matches[0][2] != "" { + basePlaces = len(matches[0][2]) + } + t.Logf("Base places: %d", basePlaces) + + // exp is the exponent + exp := 0 + if matches[0][3] != "" { + var err error + exp, err = strconv.Atoi(matches[0][3]) + require.NoError(t, err) + } else if matches[0][4] != "" { + var err error + exp, err = strconv.Atoi(matches[0][4]) + require.NoError(t, err) + } + + // Subtract exponent from base and check if negative + res := basePlaces - exp + if res <= 0 { + return 0 + } + + return uint32(res) +} diff --git a/math/dec_test.go b/math/dec_test.go index 3ff0a9a50e4b..0b148032eb1f 100644 --- a/math/dec_test.go +++ b/math/dec_test.go @@ -1,738 +1,1455 @@ -package math_test +package math import ( - "bytes" - "encoding/json" "fmt" - "math/big" - "os" + "math" "strings" "testing" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/stretchr/testify/suite" - "sigs.k8s.io/yaml" - - "cosmossdk.io/math" ) -type decimalTestSuite struct { - suite.Suite -} - -func TestDecimalTestSuite(t *testing.T) { - suite.Run(t, new(decimalTestSuite)) -} - -func TestDecApproxEq(t *testing.T) { - // d1 = 0.55, d2 = 0.6, tol = 0.1 - d1 := math.LegacyNewDecWithPrec(55, 2) - d2 := math.LegacyNewDecWithPrec(6, 1) - tol := math.LegacyNewDecWithPrec(1, 1) - - require.True(math.LegacyDecApproxEq(t, d1, d2, tol)) - - // d1 = 0.55, d2 = 0.6, tol = 1E-5 - d1 = math.LegacyNewDecWithPrec(55, 2) - d2 = math.LegacyNewDecWithPrec(6, 1) - tol = math.LegacyNewDecWithPrec(1, 5) - - require.False(math.LegacyDecApproxEq(t, d1, d2, tol)) - - // d1 = 0.6, d2 = 0.61, tol = 0.01 - d1 = math.LegacyNewDecWithPrec(6, 1) - d2 = math.LegacyNewDecWithPrec(61, 2) - tol = math.LegacyNewDecWithPrec(1, 2) - - require.True(math.LegacyDecApproxEq(t, d1, d2, tol)) -} - -// create a decimal from a decimal string (ex. "1234.5678") -func (s *decimalTestSuite) mustNewDecFromStr(str string) (d math.LegacyDec) { - d, err := math.LegacyNewDecFromStr(str) - s.Require().NoError(err) - - return d -} - -func (s *decimalTestSuite) TestNewDecFromStr() { - largeBigInt, ok := new(big.Int).SetString("3144605511029693144278234343371835", 10) - s.Require().True(ok) - - largerBigInt, ok := new(big.Int).SetString("8888888888888888888888888888888888888888888888888888888888888888888844444440", 10) - s.Require().True(ok) - - largestBigInt, ok := new(big.Int).SetString("33499189745056880149688856635597007162669032647290798121690100488888732861290034376435130433535", 10) - s.Require().True(ok) - - tests := []struct { - decimalStr string - expErr bool - exp math.LegacyDec +func TestNewDecFromString(t *testing.T) { + specs := map[string]struct { + src string + exp Dec + expErr error }{ - {"", true, math.LegacyDec{}}, - {"0.-75", true, math.LegacyDec{}}, - {"0", false, math.LegacyNewDec(0)}, - {"1", false, math.LegacyNewDec(1)}, - {"1.1", false, math.LegacyNewDecWithPrec(11, 1)}, - {"0.75", false, math.LegacyNewDecWithPrec(75, 2)}, - {"0.8", false, math.LegacyNewDecWithPrec(8, 1)}, - {"0.11111", false, math.LegacyNewDecWithPrec(11111, 5)}, - {"314460551102969.3144278234343371835", true, math.LegacyNewDec(3141203149163817869)}, - { - "314460551102969314427823434337.1835718092488231350", - true, math.LegacyNewDecFromBigIntWithPrec(largeBigInt, 4), - }, - { - "314460551102969314427823434337.1835", - false, math.LegacyNewDecFromBigIntWithPrec(largeBigInt, 4), - }, - {".", true, math.LegacyDec{}}, - {".0", true, math.LegacyNewDec(0)}, - {"1.", true, math.LegacyNewDec(1)}, - {"foobar", true, math.LegacyDec{}}, - {"0.foobar", true, math.LegacyDec{}}, - {"0.foobar.", true, math.LegacyDec{}}, - {"8888888888888888888888888888888888888888888888888888888888888888888844444440", false, math.LegacyNewDecFromBigInt(largerBigInt)}, - {"33499189745056880149688856635597007162669032647290798121690100488888732861290.034376435130433535", false, math.LegacyNewDecFromBigIntWithPrec(largestBigInt, 18)}, - {"133499189745056880149688856635597007162669032647290798121690100488888732861291", true, math.LegacyDec{}}, - } - - for tcIndex, tc := range tests { - res, err := math.LegacyNewDecFromStr(tc.decimalStr) - if tc.expErr { - s.Require().NotNil(err, "error expected, decimalStr %v, tc %v", tc.decimalStr, tcIndex) - } else { - s.Require().Nil(err, "unexpected error, decimalStr %v, tc %v", tc.decimalStr, tcIndex) - s.Require().True(res.Equal(tc.exp), "equality was incorrect, res %v, exp %v, tc %v", res, tc.exp, tcIndex) - } - - // negative tc - res, err = math.LegacyNewDecFromStr("-" + tc.decimalStr) - if tc.expErr { - s.Require().NotNil(err, "error expected, decimalStr %v, tc %v", tc.decimalStr, tcIndex) - } else { - s.Require().Nil(err, "unexpected error, decimalStr %v, tc %v", tc.decimalStr, tcIndex) - exp := tc.exp.Mul(math.LegacyNewDec(-1)) - s.Require().True(res.Equal(exp), "equality was incorrect, res %v, exp %v, tc %v", res, exp, tcIndex) - } - } -} + "simple decimal": { + src: "1", + exp: NewDecFromInt64(1), + }, + "simple negative decimal": { + src: "-1", + exp: NewDecFromInt64(-1), + }, + "valid decimal with decimal places": { + src: "1.234", + exp: NewDecWithExp(1234, -3), + }, + "valid negative decimal": { + src: "-1.234", + exp: NewDecWithExp(-1234, -3), + }, + "min decimal": { + src: "-" + strings.Repeat("9", 34), + exp: must(NewDecWithExp(-1, 34).Add(NewDecFromInt64(1))), + }, + "max decimal": { + src: strings.Repeat("9", 34), + exp: must(NewDecWithExp(1, 34).Sub(NewDecFromInt64(1))), + }, + "too big": { + src: strings.Repeat("9", 100_0000), + expErr: ErrInvalidDec, + }, + "too small": { + src: "-" + strings.Repeat("9", 100_0000), + expErr: ErrInvalidDec, + }, + "valid decimal with leading zero": { + src: "01234", + exp: NewDecWithExp(1234, 0), + }, + "valid decimal without leading zero": { + src: ".1234", + exp: NewDecWithExp(1234, -4), + }, -func (s *decimalTestSuite) TestDecString() { - tests := []struct { - d math.LegacyDec - want string - }{ - {math.LegacyNewDec(0), "0.000000000000000000"}, - {math.LegacyNewDec(1), "1.000000000000000000"}, - {math.LegacyNewDec(10), "10.000000000000000000"}, - {math.LegacyNewDec(12340), "12340.000000000000000000"}, - {math.LegacyNewDecWithPrec(12340, 4), "1.234000000000000000"}, - {math.LegacyNewDecWithPrec(12340, 5), "0.123400000000000000"}, - {math.LegacyNewDecWithPrec(12340, 8), "0.000123400000000000"}, - {math.LegacyNewDecWithPrec(1009009009009009009, 17), "10.090090090090090090"}, - } - for tcIndex, tc := range tests { - s.Require().Equal(tc.want, tc.d.String(), "bad String(), index: %v", tcIndex) - } -} + "valid decimal without trailing digits": { + src: "123.", + exp: NewDecWithExp(123, 0), + }, -func (s *decimalTestSuite) TestDecFloat64() { - tests := []struct { - d math.LegacyDec - want float64 - }{ - {math.LegacyNewDec(0), 0.000000000000000000}, - {math.LegacyNewDec(1), 1.000000000000000000}, - {math.LegacyNewDec(10), 10.000000000000000000}, - {math.LegacyNewDec(12340), 12340.000000000000000000}, - {math.LegacyNewDecWithPrec(12340, 4), 1.234000000000000000}, - {math.LegacyNewDecWithPrec(12340, 5), 0.123400000000000000}, - {math.LegacyNewDecWithPrec(12340, 8), 0.000123400000000000}, - {math.LegacyNewDecWithPrec(1009009009009009009, 17), 10.090090090090090090}, + "valid negative decimal without leading zero": { + src: "-.1234", + exp: NewDecWithExp(-1234, -4), + }, + "valid negative decimal without trailing digits": { + src: "-123.", + exp: NewDecWithExp(-123, 0), + }, + "decimal with scientific notation": { + src: "1.23e4", + exp: NewDecWithExp(123, 2), + }, + "decimal with upper case scientific notation": { + src: "1.23E+4", + exp: NewDecWithExp(123, 2), + }, + "negative decimal with scientific notation": { + src: "-1.23e4", + exp: NewDecWithExp(-123, 2), + }, + "exceed max exp 11E+1000000": { + src: "11E+1000000", + expErr: ErrInvalidDec, + }, + "exceed min exp 11E-1000000": { + src: "11E-1000000", + expErr: ErrInvalidDec, + }, + "exceed max exp 1E100001": { + src: "1E100001", + expErr: ErrInvalidDec, + }, + "exceed min exp 1E-100001": { + src: "1E-100001", + expErr: ErrInvalidDec, + }, + "empty string": { + src: "", + expErr: ErrInvalidDec, + }, + "NaN": { + src: "NaN", + expErr: ErrInvalidDec, + }, + "random string": { + src: "1foo", + expErr: ErrInvalidDec, + }, + "Infinity": { + src: "Infinity", + expErr: ErrInvalidDec, + }, + "Inf": { + src: "Inf", + expErr: ErrInvalidDec, + }, } - for tcIndex, tc := range tests { - value, err := tc.d.Float64() - s.Require().Nil(err, "error getting Float64(), index: %v", tcIndex) - s.Require().Equal(tc.want, value, "bad Float64(), index: %v", tcIndex) - s.Require().Equal(tc.want, tc.d.MustFloat64(), "bad MustFloat64(), index: %v", tcIndex) + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + got, gotErr := NewDecFromString(spec.src) + if spec.expErr != nil { + require.ErrorIs(t, gotErr, spec.expErr, got.String()) + return + } + require.NoError(t, gotErr) + assert.True(t, spec.exp.Equal(got)) + }) } } -func (s *decimalTestSuite) TestEqualities() { - tests := []struct { - d1, d2 math.LegacyDec - gt, lt, eq bool +func TestNewDecFromInt64(t *testing.T) { + specs := map[string]struct { + src int64 + exp string }{ - {math.LegacyNewDec(0), math.LegacyNewDec(0), false, false, true}, - {math.LegacyNewDecWithPrec(0, 2), math.LegacyNewDecWithPrec(0, 4), false, false, true}, - {math.LegacyNewDecWithPrec(100, 0), math.LegacyNewDecWithPrec(100, 0), false, false, true}, - {math.LegacyNewDecWithPrec(-100, 0), math.LegacyNewDecWithPrec(-100, 0), false, false, true}, - {math.LegacyNewDecWithPrec(-1, 1), math.LegacyNewDecWithPrec(-1, 1), false, false, true}, - {math.LegacyNewDecWithPrec(3333, 3), math.LegacyNewDecWithPrec(3333, 3), false, false, true}, - - {math.LegacyNewDecWithPrec(0, 0), math.LegacyNewDecWithPrec(3333, 3), false, true, false}, - {math.LegacyNewDecWithPrec(0, 0), math.LegacyNewDecWithPrec(100, 0), false, true, false}, - {math.LegacyNewDecWithPrec(-1, 0), math.LegacyNewDecWithPrec(3333, 3), false, true, false}, - {math.LegacyNewDecWithPrec(-1, 0), math.LegacyNewDecWithPrec(100, 0), false, true, false}, - {math.LegacyNewDecWithPrec(1111, 3), math.LegacyNewDecWithPrec(100, 0), false, true, false}, - {math.LegacyNewDecWithPrec(1111, 3), math.LegacyNewDecWithPrec(3333, 3), false, true, false}, - {math.LegacyNewDecWithPrec(-3333, 3), math.LegacyNewDecWithPrec(-1111, 3), false, true, false}, - - {math.LegacyNewDecWithPrec(3333, 3), math.LegacyNewDecWithPrec(0, 0), true, false, false}, - {math.LegacyNewDecWithPrec(100, 0), math.LegacyNewDecWithPrec(0, 0), true, false, false}, - {math.LegacyNewDecWithPrec(3333, 3), math.LegacyNewDecWithPrec(-1, 0), true, false, false}, - {math.LegacyNewDecWithPrec(100, 0), math.LegacyNewDecWithPrec(-1, 0), true, false, false}, - {math.LegacyNewDecWithPrec(100, 0), math.LegacyNewDecWithPrec(1111, 3), true, false, false}, - {math.LegacyNewDecWithPrec(3333, 3), math.LegacyNewDecWithPrec(1111, 3), true, false, false}, - {math.LegacyNewDecWithPrec(-1111, 3), math.LegacyNewDecWithPrec(-3333, 3), true, false, false}, + "zero value": { + src: 0, + exp: "0", + }, + "positive value": { + src: 123, + exp: "123", + }, + "negative value": { + src: -123, + exp: "-123", + }, + "max value": { + src: math.MaxInt64, + exp: "9223372036854.775807E+6", + }, + "min value": { + src: math.MinInt64, + exp: "9223372036854.775808E+6", + }, } - - for tcIndex, tc := range tests { - s.Require().Equal(tc.gt, tc.d1.GT(tc.d2), "GT result is incorrect, tc %d", tcIndex) - s.Require().Equal(tc.lt, tc.d1.LT(tc.d2), "LT result is incorrect, tc %d", tcIndex) - s.Require().Equal(tc.eq, tc.d1.Equal(tc.d2), "equality result is incorrect, tc %d", tcIndex) + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + got := NewDecFromInt64(spec.src) + assert.Equal(t, spec.exp, got.String()) + }) } } -func (s *decimalTestSuite) TestDecsEqual() { - tests := []struct { - d1s, d2s []math.LegacyDec - eq bool +func TestAdd(t *testing.T) { + specs := map[string]struct { + x Dec + y Dec + exp Dec + expErr error }{ - {[]math.LegacyDec{math.LegacyNewDec(0)}, []math.LegacyDec{math.LegacyNewDec(0)}, true}, - {[]math.LegacyDec{math.LegacyNewDec(0)}, []math.LegacyDec{math.LegacyNewDec(1)}, false}, - {[]math.LegacyDec{math.LegacyNewDec(0)}, []math.LegacyDec{}, false}, - {[]math.LegacyDec{math.LegacyNewDec(0), math.LegacyNewDec(1)}, []math.LegacyDec{math.LegacyNewDec(0), math.LegacyNewDec(1)}, true}, - {[]math.LegacyDec{math.LegacyNewDec(1), math.LegacyNewDec(0)}, []math.LegacyDec{math.LegacyNewDec(1), math.LegacyNewDec(0)}, true}, - {[]math.LegacyDec{math.LegacyNewDec(1), math.LegacyNewDec(0)}, []math.LegacyDec{math.LegacyNewDec(0), math.LegacyNewDec(1)}, false}, - {[]math.LegacyDec{math.LegacyNewDec(1), math.LegacyNewDec(0)}, []math.LegacyDec{math.LegacyNewDec(1)}, false}, - {[]math.LegacyDec{math.LegacyNewDec(1), math.LegacyNewDec(2)}, []math.LegacyDec{math.LegacyNewDec(2), math.LegacyNewDec(4)}, false}, - {[]math.LegacyDec{math.LegacyNewDec(3), math.LegacyNewDec(18)}, []math.LegacyDec{math.LegacyNewDec(1), math.LegacyNewDec(6)}, false}, + "0 + 0 = 0": { + x: NewDecFromInt64(0), + y: NewDecFromInt64(0), + exp: NewDecFromInt64(0), + }, + "0 + 123 = 123": { + x: NewDecFromInt64(0), + y: NewDecFromInt64(123), + exp: NewDecFromInt64(123), + }, + "0 + -123 = -123": { + x: NewDecFromInt64(0), + y: NewDecFromInt64(-123), + exp: NewDecFromInt64(-123), + }, + "123 + 123 = 246": { + x: NewDecFromInt64(123), + y: NewDecFromInt64(123), + exp: NewDecFromInt64(246), + }, + "-123 + 123 = 0": { + x: NewDecFromInt64(-123), + y: NewDecFromInt64(123), + exp: NewDecFromInt64(0), + }, + "-123 + -123 = -246": { + x: NewDecFromInt64(-123), + y: NewDecFromInt64(-123), + exp: NewDecFromInt64(-246), + }, + "1.234 + 1.234 = 2.468": { + x: NewDecWithExp(1234, -3), + y: NewDecWithExp(1234, -3), + exp: NewDecWithExp(2468, -3), + }, + "1.234 + 123 = 124.234": { + x: NewDecWithExp(1234, -3), + y: NewDecFromInt64(123), + exp: NewDecWithExp(124234, -3), + }, + "1.234 + -123 = -121.766": { + x: NewDecWithExp(1234, -3), + y: NewDecFromInt64(-123), + exp: must(NewDecFromString("-121.766")), + }, + "1.234 + -1.234 = 0": { + x: NewDecWithExp(1234, -3), + y: NewDecWithExp(-1234, -3), + exp: NewDecWithExp(0, -3), + }, + "-1.234 + -1.234 = -2.468": { + x: NewDecWithExp(-1234, -3), + y: NewDecWithExp(-1234, -3), + exp: NewDecWithExp(-2468, -3), + }, + "1e100000 + 9e900000 -> Err": { + x: NewDecWithExp(1, 100_000), + y: NewDecWithExp(9, 900_000), + expErr: ErrInvalidDec, + }, + "1e100000 + -9e900000 -> Err": { + x: NewDecWithExp(1, 100_000), + y: NewDecWithExp(9, 900_000), + expErr: ErrInvalidDec, + }, + "1e100000 + 1e^-1 -> err": { + x: NewDecWithExp(1, 100_000), + y: NewDecWithExp(1, -1), + expErr: ErrInvalidDec, + }, + "1e100000 + -1e^-1 -> err": { + x: NewDecWithExp(1, 100_000), + y: NewDecWithExp(-1, -1), + expErr: ErrInvalidDec, + }, + "1e100000 + 1 -> 100..1": { + x: NewDecWithExp(1, 100_000), + y: NewDecFromInt64(1), + exp: must(NewDecWithExp(1, 100_000).Add(NewDecFromInt64(1))), + }, + "1e100001 + 0 -> err": { + x: NewDecWithExp(1, 100_001), + y: NewDecFromInt64(0), + expErr: ErrInvalidDec, + }, + "-1e100001 + 0 -> err": { + x: NewDecWithExp(1, -100_001), + y: NewDecFromInt64(0), + expErr: ErrInvalidDec, + }, } - - for tcIndex, tc := range tests { - s.Require().Equal(tc.eq, math.LegacyDecsEqual(tc.d1s, tc.d2s), "equality of decional arrays is incorrect, tc %d", tcIndex) - s.Require().Equal(tc.eq, math.LegacyDecsEqual(tc.d2s, tc.d1s), "equality of decional arrays is incorrect (converse), tc %d", tcIndex) + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + got, gotErr := spec.x.Add(spec.y) + if spec.expErr != nil { + require.ErrorIs(t, gotErr, spec.expErr, got) + return + } + require.NoError(t, gotErr) + assert.Equal(t, spec.exp, got) + }) } } -func (s *decimalTestSuite) TestArithmetic() { - tests := []struct { - d1, d2 math.LegacyDec - expMul, expMulTruncate math.LegacyDec - expQuo, expQuoRoundUp, expQuoTruncate math.LegacyDec - expAdd, expSub math.LegacyDec +func TestSub(t *testing.T) { + specs := map[string]struct { + x Dec + y Dec + exp Dec + expErr error }{ - // d1 d2 MUL MulTruncate QUO QUORoundUp QUOTrunctate ADD SUB - {math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0)}, - {math.LegacyNewDec(1), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(1), math.LegacyNewDec(1)}, - {math.LegacyNewDec(0), math.LegacyNewDec(1), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(1), math.LegacyNewDec(-1)}, - {math.LegacyNewDec(0), math.LegacyNewDec(-1), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(-1), math.LegacyNewDec(1)}, - {math.LegacyNewDec(-1), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(-1), math.LegacyNewDec(-1)}, - - {math.LegacyNewDec(1), math.LegacyNewDec(1), math.LegacyNewDec(1), math.LegacyNewDec(1), math.LegacyNewDec(1), math.LegacyNewDec(1), math.LegacyNewDec(1), math.LegacyNewDec(2), math.LegacyNewDec(0)}, - {math.LegacyNewDec(-1), math.LegacyNewDec(-1), math.LegacyNewDec(1), math.LegacyNewDec(1), math.LegacyNewDec(1), math.LegacyNewDec(1), math.LegacyNewDec(1), math.LegacyNewDec(-2), math.LegacyNewDec(0)}, - {math.LegacyNewDec(1), math.LegacyNewDec(-1), math.LegacyNewDec(-1), math.LegacyNewDec(-1), math.LegacyNewDec(-1), math.LegacyNewDec(-1), math.LegacyNewDec(-1), math.LegacyNewDec(0), math.LegacyNewDec(2)}, - {math.LegacyNewDec(-1), math.LegacyNewDec(1), math.LegacyNewDec(-1), math.LegacyNewDec(-1), math.LegacyNewDec(-1), math.LegacyNewDec(-1), math.LegacyNewDec(-1), math.LegacyNewDec(0), math.LegacyNewDec(-2)}, - - { - math.LegacyNewDec(3), math.LegacyNewDec(7), math.LegacyNewDec(21), math.LegacyNewDec(21), - math.LegacyNewDecWithPrec(428571428571428571, 18), math.LegacyNewDecWithPrec(428571428571428572, 18), math.LegacyNewDecWithPrec(428571428571428571, 18), - math.LegacyNewDec(10), math.LegacyNewDec(-4), + "0 - 0 = 0": { + x: NewDecFromInt64(0), + y: NewDecFromInt64(0), + exp: NewDecFromInt64(0), }, - { - math.LegacyNewDec(2), math.LegacyNewDec(4), math.LegacyNewDec(8), math.LegacyNewDec(8), math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDecWithPrec(5, 1), - math.LegacyNewDec(6), math.LegacyNewDec(-2), + "0 - 123 = -123": { + x: NewDecFromInt64(0), + y: NewDecFromInt64(123), + exp: NewDecFromInt64(-123), }, - - {math.LegacyNewDec(100), math.LegacyNewDec(100), math.LegacyNewDec(10000), math.LegacyNewDec(10000), math.LegacyNewDec(1), math.LegacyNewDec(1), math.LegacyNewDec(1), math.LegacyNewDec(200), math.LegacyNewDec(0)}, - - { - math.LegacyNewDecWithPrec(15, 1), math.LegacyNewDecWithPrec(15, 1), math.LegacyNewDecWithPrec(225, 2), math.LegacyNewDecWithPrec(225, 2), - math.LegacyNewDec(1), math.LegacyNewDec(1), math.LegacyNewDec(1), math.LegacyNewDec(3), math.LegacyNewDec(0), + "0 - -123 = 123": { + x: NewDecFromInt64(0), + y: NewDecFromInt64(-123), + exp: NewDecFromInt64(123), + }, + "123 - 123 = 0": { + x: NewDecFromInt64(123), + y: NewDecFromInt64(123), + exp: NewDecFromInt64(0), + }, + "-123 - 123 = -246": { + x: NewDecFromInt64(-123), + y: NewDecFromInt64(123), + exp: NewDecFromInt64(-246), + }, + "-123 - -123 = 0": { + x: NewDecFromInt64(-123), + y: NewDecFromInt64(-123), + exp: NewDecFromInt64(0), + }, + "1.234 - 1.234 = 0.000": { + x: NewDecWithExp(1234, -3), + y: NewDecWithExp(1234, -3), + exp: NewDecWithExp(0, -3), + }, + "1.234 - 123 = -121.766": { + x: NewDecWithExp(1234, -3), + y: NewDecFromInt64(123), + exp: NewDecWithExp(-121766, -3), + }, + "1.234 - -123 = 124.234": { + x: NewDecWithExp(1234, -3), + y: NewDecFromInt64(-123), + exp: NewDecWithExp(124234, -3), + }, + "1.234 - -1.234 = 2.468": { + x: NewDecWithExp(1234, -3), + y: NewDecWithExp(-1234, -3), + exp: NewDecWithExp(2468, -3), + }, + "-1.234 - -1.234 = 2.468": { + x: NewDecWithExp(-1234, -3), + y: NewDecWithExp(-1234, -3), + exp: NewDecWithExp(0, -3), + }, + "1 - 0.999 = 0.001 - rounding after comma": { + x: NewDecFromInt64(1), + y: NewDecWithExp(999, -3), + exp: NewDecWithExp(1, -3), + }, + "1e100000 - 1^-1 -> Err": { + x: NewDecWithExp(1, 100_000), + y: NewDecWithExp(1, -1), + expErr: ErrInvalidDec, + }, + "1e100000 - 1^1-> Err": { + x: NewDecWithExp(1, 100_000), + y: NewDecWithExp(1, -1), + expErr: ErrInvalidDec, + }, + "upper exp limit exceeded": { + x: NewDecWithExp(1, 100_001), + y: NewDecWithExp(1, 100_001), + expErr: ErrInvalidDec, + }, + "lower exp limit exceeded": { + x: NewDecWithExp(1, -100_001), + y: NewDecWithExp(1, -100_001), + expErr: ErrInvalidDec, + }, + "1e100000 - 1 = 999..9": { + x: NewDecWithExp(1, 100_000), + y: NewDecFromInt64(1), + exp: must(NewDecFromString(strings.Repeat("9", 100_000))), + }, + "1e100000 - 0 = 1e100000": { + x: NewDecWithExp(1, 100_000), + y: NewDecFromInt64(0), + exp: must(NewDecFromString("1e100000")), + }, + "1e100001 - 0 -> err": { + x: NewDecWithExp(1, 100_001), + y: NewDecFromInt64(0), + expErr: ErrInvalidDec, + }, + "1e100000 - -1 -> 100..1": { + x: NewDecWithExp(1, 100_000), + y: must(NewDecFromString("-9e100000")), + expErr: ErrInvalidDec, + }, + "1e-100000 - 0 = 1e-100000": { + x: NewDecWithExp(1, -100_000), + y: NewDecFromInt64(0), + exp: must(NewDecFromString("1e-100000")), + }, + "1e-100001 - 0 -> err": { + x: NewDecWithExp(1, -100_001), + y: NewDecFromInt64(0), + expErr: ErrInvalidDec, }, - { - math.LegacyNewDecWithPrec(3333, 4), math.LegacyNewDecWithPrec(333, 4), math.LegacyNewDecWithPrec(1109889, 8), math.LegacyNewDecWithPrec(1109889, 8), - math.LegacyMustNewDecFromStr("10.009009009009009009"), math.LegacyMustNewDecFromStr("10.009009009009009010"), math.LegacyMustNewDecFromStr("10.009009009009009009"), - math.LegacyNewDecWithPrec(3666, 4), math.LegacyNewDecWithPrec(3, 1), + "1e-100000 - -1 -> 0.000..01": { + x: NewDecWithExp(1, -100_000), + y: NewDecFromInt64(-1), + exp: must(NewDecFromString("1." + strings.Repeat("0", 99999) + "1")), }, } - - for tcIndex, tc := range tests { - tc := tc - resAdd := tc.d1.Add(tc.d2) - resSub := tc.d1.Sub(tc.d2) - resMul := tc.d1.Mul(tc.d2) - resMulTruncate := tc.d1.MulTruncate(tc.d2) - s.Require().True(tc.expAdd.Equal(resAdd), "exp %v, res %v, tc %d", tc.expAdd, resAdd, tcIndex) - s.Require().True(tc.expSub.Equal(resSub), "exp %v, res %v, tc %d", tc.expSub, resSub, tcIndex) - s.Require().True(tc.expMul.Equal(resMul), "exp %v, res %v, tc %d", tc.expMul, resMul, tcIndex) - s.Require().True(tc.expMulTruncate.Equal(resMulTruncate), "exp %v, res %v, tc %d", tc.expMulTruncate, resMulTruncate, tcIndex) - - if tc.d2.IsZero() { // panic for divide by zero - s.Require().Panics(func() { tc.d1.Quo(tc.d2) }) - } else { - resQuo := tc.d1.Quo(tc.d2) - s.Require().True(tc.expQuo.Equal(resQuo), "exp %v, res %v, tc %d", tc.expQuo.String(), resQuo.String(), tcIndex) - - resQuoRoundUp := tc.d1.QuoRoundUp(tc.d2) - s.Require().True(tc.expQuoRoundUp.Equal(resQuoRoundUp), "exp %v, res %v, tc %d", - tc.expQuoRoundUp.String(), resQuoRoundUp.String(), tcIndex) - - resQuoTruncate := tc.d1.QuoTruncate(tc.d2) - s.Require().True(tc.expQuoTruncate.Equal(resQuoTruncate), "exp %v, res %v, tc %d", - tc.expQuoTruncate.String(), resQuoTruncate.String(), tcIndex) - } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + got, gotErr := spec.x.Sub(spec.y) + if spec.expErr != nil { + require.ErrorIs(t, gotErr, spec.expErr) + return + } + require.NoError(t, gotErr) + assert.True(t, spec.exp.Equal(got), got.String()) + }) } } -func (s *decimalTestSuite) TestBankerRoundChop() { - tests := []struct { - d1 math.LegacyDec - exp int64 +func TestQuo(t *testing.T) { + specs := map[string]struct { + src string + x Dec + y Dec + exp Dec + expErr error }{ - {s.mustNewDecFromStr("0.25"), 0}, - {s.mustNewDecFromStr("0"), 0}, - {s.mustNewDecFromStr("1"), 1}, - {s.mustNewDecFromStr("0.75"), 1}, - {s.mustNewDecFromStr("0.5"), 0}, - {s.mustNewDecFromStr("7.5"), 8}, - {s.mustNewDecFromStr("1.5"), 2}, - {s.mustNewDecFromStr("2.5"), 2}, - {s.mustNewDecFromStr("0.545"), 1}, // 0.545-> 1 even though 5 is first decimal and 1 not even - {s.mustNewDecFromStr("1.545"), 2}, + "0 / 0 -> Err": { + x: NewDecFromInt64(0), + y: NewDecFromInt64(0), + expErr: ErrInvalidDec, + }, + " 0 / 123 = 0": { + x: NewDecFromInt64(0), + y: NewDecFromInt64(123), + exp: NewDecFromInt64(0), + }, + "123 / 0 = 0": { + x: NewDecFromInt64(123), + y: NewDecFromInt64(0), + expErr: ErrInvalidDec, + }, + "-123 / 0 = 0": { + x: NewDecFromInt64(-123), + y: NewDecFromInt64(0), + expErr: ErrInvalidDec, + }, + "123 / 123 = 1": { + x: NewDecFromInt64(123), + y: NewDecFromInt64(123), + exp: must(NewDecFromString("1.000000000000000000000000000000000")), + }, + "-123 / 123 = -1": { + x: NewDecFromInt64(-123), + y: NewDecFromInt64(123), + exp: must(NewDecFromString("-1.000000000000000000000000000000000")), + }, + "-123 / -123 = 1": { + x: NewDecFromInt64(-123), + y: NewDecFromInt64(-123), + exp: must(NewDecFromString("1.000000000000000000000000000000000")), + }, + "1.234 / 1.234 = 1": { + x: NewDecWithExp(1234, -3), + y: NewDecWithExp(1234, -3), + exp: must(NewDecFromString("1.000000000000000000000000000000000")), + }, + "-1.234 / 1234 = -1": { + x: NewDecWithExp(-1234, -3), + y: NewDecWithExp(1234, -3), + exp: must(NewDecFromString("-1.000000000000000000000000000000000")), + }, + "1.234 / -123 = 1.0100": { + x: NewDecWithExp(1234, -3), + y: NewDecFromInt64(-123), + exp: must(NewDecFromString("-0.01003252032520325203252032520325203")), + }, + "1.234 / -1.234 = -1": { + x: NewDecWithExp(1234, -3), + y: NewDecWithExp(-1234, -3), + exp: must(NewDecFromString("-1.000000000000000000000000000000000")), + }, + "-1.234 / -1.234 = 1": { + x: NewDecWithExp(-1234, -3), + y: NewDecWithExp(-1234, -3), + exp: must(NewDecFromString("1.000000000000000000000000000000000")), + }, + "3 / -9 = -0.3333...3 - round down": { + x: NewDecFromInt64(3), + y: NewDecFromInt64(-9), + exp: must(NewDecFromString("-0.3333333333333333333333333333333333")), + }, + "4 / 9 = 0.4444...4 - round down": { + x: NewDecFromInt64(4), + y: NewDecFromInt64(9), + exp: must(NewDecFromString("0.4444444444444444444444444444444444")), + }, + "5 / 9 = 0.5555...6 - round up": { + x: NewDecFromInt64(5), + y: NewDecFromInt64(9), + exp: must(NewDecFromString("0.5555555555555555555555555555555556")), + }, + "6 / 9 = 0.6666...7 - round up": { + x: NewDecFromInt64(6), + y: NewDecFromInt64(9), + exp: must(NewDecFromString("0.6666666666666666666666666666666667")), + }, + "7 / 9 = 0.7777...8 - round up": { + x: NewDecFromInt64(7), + y: NewDecFromInt64(9), + exp: must(NewDecFromString("0.7777777777777777777777777777777778")), + }, + "8 / 9 = 0.8888...9 - round up": { + x: NewDecFromInt64(8), + y: NewDecFromInt64(9), + exp: must(NewDecFromString("0.8888888888888888888888888888888889")), + }, + "9e-34 / 10 = 9e-35 - no rounding": { + x: NewDecWithExp(9, -34), + y: NewDecFromInt64(10), + exp: must(NewDecFromString("9e-35")), + }, + "9e-35 / 10 = 9e-36 - no rounding": { + x: NewDecWithExp(9, -35), + y: NewDecFromInt64(10), + exp: must(NewDecFromString("9e-36")), + }, + "high precision - min/0.1": { + x: NewDecWithExp(1, -100_000), + y: NewDecWithExp(1, -1), + exp: NewDecWithExp(1, -99_999), + }, + "high precision - min/1": { + x: NewDecWithExp(1, -100_000), + y: NewDecWithExp(1, 0), + exp: NewDecWithExp(1, -100_000), + }, + "high precision - min/10": { + x: NewDecWithExp(1, -100_000), + y: NewDecWithExp(1, 1), + expErr: ErrInvalidDec, + }, + "high precision - <_min/0.1": { + x: NewDecWithExp(1, -100_001), + y: NewDecWithExp(1, -1), + exp: NewDecWithExp(1, -100_000), + }, + "high precision - <_min/1": { + x: NewDecWithExp(1, -100_001), + y: NewDecWithExp(1, 0), + expErr: ErrInvalidDec, + }, + "high precision - <_min/10": { + x: NewDecWithExp(1, -100_001), + y: NewDecWithExp(1, 1), + expErr: ErrInvalidDec, + }, + "high precision - min/-0.1": { + x: NewDecWithExp(1, -100_000), + y: NewDecWithExp(-1, -1), + exp: NewDecWithExp(-1, -99_999), + }, + "high precision - min/-1": { + x: NewDecWithExp(1, -100_000), + y: NewDecWithExp(-1, 0), + exp: NewDecWithExp(-1, -100_000), + }, + "high precision - min/-10": { + x: NewDecWithExp(1, -100_000), + y: NewDecWithExp(-1, 1), + expErr: ErrInvalidDec, + }, + "high precision - <_min/-0.1": { + x: NewDecWithExp(1, -100_001), + y: NewDecWithExp(-1, -1), + exp: NewDecWithExp(-1, -100_000), + }, + "high precision - <_min/-1": { + x: NewDecWithExp(1, -100_001), + y: NewDecWithExp(-1, 0), + expErr: ErrInvalidDec, + }, + "high precision - <_min/-10": { + x: NewDecWithExp(1, -100_001), + y: NewDecWithExp(-1, 1), + expErr: ErrInvalidDec, + }, } - - for tcIndex, tc := range tests { - resNeg := tc.d1.Neg().RoundInt64() - s.Require().Equal(-1*tc.exp, resNeg, "negative tc %d", tcIndex) - - resPos := tc.d1.RoundInt64() - s.Require().Equal(tc.exp, resPos, "positive tc %d", tcIndex) + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + got, gotErr := spec.x.Quo(spec.y) + if spec.expErr != nil { + require.ErrorIs(t, gotErr, spec.expErr) + return + } + require.NoError(t, gotErr) + last35 := func(s string) string { + var x int + if len(s) < 36 { + x = 0 + } else { + x = len(s) - 36 + } + return fmt.Sprintf("%s(%d)", s[x:], len(s)) + } + gotReduced, _ := got.Reduce() + assert.True(t, spec.exp.Equal(gotReduced), "exp %s, got: %s", last35(spec.exp.String()), last35(gotReduced.String())) + }) } } -func (s *decimalTestSuite) TestTruncate() { - tests := []struct { - d1 math.LegacyDec - exp int64 +func TestQuoExact(t *testing.T) { + specs := map[string]struct { + src string + x Dec + y Dec + exp Dec + expErr error }{ - {s.mustNewDecFromStr("0"), 0}, - {s.mustNewDecFromStr("0.25"), 0}, - {s.mustNewDecFromStr("0.75"), 0}, - {s.mustNewDecFromStr("1"), 1}, - {s.mustNewDecFromStr("1.5"), 1}, - {s.mustNewDecFromStr("7.5"), 7}, - {s.mustNewDecFromStr("7.6"), 7}, - {s.mustNewDecFromStr("7.4"), 7}, - {s.mustNewDecFromStr("100.1"), 100}, - {s.mustNewDecFromStr("1000.1"), 1000}, - } - - for tcIndex, tc := range tests { - resNeg := tc.d1.Neg().TruncateInt64() - s.Require().Equal(-1*tc.exp, resNeg, "negative tc %d", tcIndex) - - resPos := tc.d1.TruncateInt64() - s.Require().Equal(tc.exp, resPos, "positive tc %d", tcIndex) + "0 / 0 -> Err": { + x: NewDecFromInt64(0), + y: NewDecFromInt64(0), + expErr: ErrInvalidDec, + }, + " 0 / 123 = 0": { + x: NewDecFromInt64(0), + y: NewDecFromInt64(123), + exp: NewDecFromInt64(0), + }, + "123 / 0 -> Err": { + x: NewDecFromInt64(123), + y: NewDecFromInt64(0), + expErr: ErrInvalidDec, + }, + "-123 / 0 -> Err": { + x: NewDecFromInt64(-123), + y: NewDecFromInt64(0), + expErr: ErrInvalidDec, + }, + "123 / 123 = 1": { + x: NewDecFromInt64(123), + y: NewDecFromInt64(123), + exp: must(NewDecFromString("1.000000000000000000000000000000000")), + }, + "-123 / 123 = 1": { + x: NewDecFromInt64(-123), + y: NewDecFromInt64(123), + exp: must(NewDecFromString("-1.000000000000000000000000000000000")), + }, + "-123 / -123 = 1": { + x: NewDecFromInt64(-123), + y: NewDecFromInt64(-123), + exp: must(NewDecFromString("1.000000000000000000000000000000000")), + }, + "1.234 / 1.234 = 1": { + x: NewDecWithExp(1234, -3), + y: NewDecWithExp(1234, -3), + exp: must(NewDecFromString("1.000000000000000000000000000000000")), + }, + "-1.234 / 1.234 = -1": { + x: NewDecWithExp(-1234, -3), + y: NewDecWithExp(1234, -3), + exp: must(NewDecFromString("-1.000000000000000000000000000000000")), + }, + "1.234 / -123 -> Err": { + x: NewDecWithExp(1234, -3), + y: NewDecFromInt64(-123), + expErr: ErrUnexpectedRounding, + }, + "1.234 / -1.234 = -1": { + x: NewDecWithExp(1234, -3), + y: NewDecWithExp(-1234, -3), + exp: must(NewDecFromString("-1.000000000000000000000000000000000")), + }, + "-1.234 / -1.234 = 1": { + x: NewDecWithExp(-1234, -3), + y: NewDecWithExp(-1234, -3), + exp: must(NewDecFromString("1.000000000000000000000000000000000")), + }, + "3 / -9 -> Err": { + x: NewDecFromInt64(3), + y: NewDecFromInt64(-9), + expErr: ErrUnexpectedRounding, + }, + "4 / 9 -> Err": { + x: NewDecFromInt64(4), + y: NewDecFromInt64(9), + expErr: ErrUnexpectedRounding, + }, + "5 / 9 -> Err": { + x: NewDecFromInt64(5), + y: NewDecFromInt64(9), + expErr: ErrUnexpectedRounding, + }, + "6 / 9 -> Err": { + x: NewDecFromInt64(6), + y: NewDecFromInt64(9), + expErr: ErrUnexpectedRounding, + }, + "7 / 9 -> Err": { + x: NewDecFromInt64(7), + y: NewDecFromInt64(9), + expErr: ErrUnexpectedRounding, + }, + "8 / 9 -> Err": { + x: NewDecFromInt64(8), + y: NewDecFromInt64(9), + expErr: ErrUnexpectedRounding, + }, + "9e-34 / 10 = 9e-35 - no rounding": { + x: NewDecWithExp(9, -34), + y: NewDecFromInt64(10), + exp: must(NewDecFromString("0.00000000000000000000000000000000009000000000000000000000000000000000")), + }, + "9e-35 / 10 = 9e-36 - no rounding": { + x: NewDecWithExp(9, -35), + y: NewDecFromInt64(10), + exp: must(NewDecFromString("9e-36")), + }, + "high precision - min/0.1": { + x: NewDecWithExp(1, -100_000), + y: NewDecWithExp(1, -1), + exp: NewDecWithExp(1, -99_999), + }, + "high precision - min/1": { + x: NewDecWithExp(1, -100_000), + y: NewDecWithExp(1, 0), + exp: NewDecWithExp(1, -100_000), + }, + "high precision - min/10": { + x: NewDecWithExp(1, -100_000), + y: NewDecWithExp(1, 1), + expErr: ErrInvalidDec, + }, + "high precision - <_min/0.1": { + x: NewDecWithExp(1, -100_001), + y: NewDecWithExp(1, -1), + exp: NewDecWithExp(1, -100_000), + }, + "high precision - <_min/1": { + x: NewDecWithExp(1, -100_001), + y: NewDecWithExp(1, 0), + expErr: ErrInvalidDec, + }, + "high precision - <_min/10 -> Err": { + x: NewDecWithExp(1, -100_001), + y: NewDecWithExp(1, 1), + expErr: ErrInvalidDec, + }, + "high precision - min/-0.1": { + x: NewDecWithExp(1, -100_000), + y: NewDecWithExp(-1, -1), + exp: NewDecWithExp(-1, -99_999), + }, + "high precision - min/-1": { + x: NewDecWithExp(1, -100_000), + y: NewDecWithExp(-1, 0), + exp: NewDecWithExp(-1, -100_000), + }, + "high precision - min/-10 -> Err": { + x: NewDecWithExp(1, -100_000), + y: NewDecWithExp(-1, 1), + expErr: ErrInvalidDec, + }, + "high precision - <_min/-0.1": { + x: NewDecWithExp(1, -100_001), + y: NewDecWithExp(-1, -1), + exp: NewDecWithExp(-1, -100_000), + }, + "high precision - <_min/-1": { + x: NewDecWithExp(1, -100_001), + y: NewDecWithExp(-1, 0), + expErr: ErrInvalidDec, + }, + "high precision - <_min/-10": { + x: NewDecWithExp(1, -100_001), + y: NewDecWithExp(-1, 1), + expErr: ErrInvalidDec, + }, } -} - -func (s *decimalTestSuite) TestStringOverflow() { - // two random 64 bit primes - dec1, err := math.LegacyNewDecFromStr("51643150036226787134389711697696177267") - s.Require().NoError(err) - dec2, err := math.LegacyNewDecFromStr("-31798496660535729618459429845579852627") - s.Require().NoError(err) - dec3 := dec1.Add(dec2) - s.Require().Equal( - "19844653375691057515930281852116324640.000000000000000000", - dec3.String(), - ) -} + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + got, gotErr := spec.x.QuoExact(spec.y) -func (s *decimalTestSuite) TestDecMulInt() { - tests := []struct { - sdkDec math.LegacyDec - sdkInt math.Int - want math.LegacyDec - }{ - {math.LegacyNewDec(10), math.NewInt(2), math.LegacyNewDec(20)}, - {math.LegacyNewDec(1000000), math.NewInt(100), math.LegacyNewDec(100000000)}, - {math.LegacyNewDecWithPrec(1, 1), math.NewInt(10), math.LegacyNewDec(1)}, - {math.LegacyNewDecWithPrec(1, 5), math.NewInt(20), math.LegacyNewDecWithPrec(2, 4)}, - } - for i, tc := range tests { - got := tc.sdkDec.MulInt(tc.sdkInt) - s.Require().Equal(tc.want, got, "Incorrect result on test case %d", i) + if spec.expErr != nil { + require.ErrorIs(t, gotErr, spec.expErr) + return + } + require.NoError(t, gotErr) + assert.True(t, spec.exp.Equal(got)) + }) } } -func (s *decimalTestSuite) TestDecCeil() { - testCases := []struct { - input math.LegacyDec - expected math.LegacyDec +func TestQuoInteger(t *testing.T) { + specs := map[string]struct { + src string + x Dec + y Dec + exp Dec + expErr error }{ - {math.LegacyNewDecWithPrec(1000000000000000, math.LegacyPrecision), math.LegacyNewDec(1)}, // 0.001 => 1.0 - {math.LegacyNewDecWithPrec(-1000000000000000, math.LegacyPrecision), math.LegacyZeroDec()}, // -0.001 => 0.0 - {math.LegacyZeroDec(), math.LegacyZeroDec()}, // 0.0 => 0.0 - {math.LegacyNewDecWithPrec(900000000000000000, math.LegacyPrecision), math.LegacyNewDec(1)}, // 0.9 => 1.0 - {math.LegacyNewDecWithPrec(4001000000000000000, math.LegacyPrecision), math.LegacyNewDec(5)}, // 4.001 => 5.0 - {math.LegacyNewDecWithPrec(-4001000000000000000, math.LegacyPrecision), math.LegacyNewDec(-4)}, // -4.001 => -4.0 - {math.LegacyNewDecWithPrec(4700000000000000000, math.LegacyPrecision), math.LegacyNewDec(5)}, // 4.7 => 5.0 - {math.LegacyNewDecWithPrec(-4700000000000000000, math.LegacyPrecision), math.LegacyNewDec(-4)}, // -4.7 => -4.0 + "0 / 0 -> Err": { + x: NewDecFromInt64(0), + y: NewDecFromInt64(0), + expErr: ErrInvalidDec, + }, + " 0 / 123 = 0": { + x: NewDecFromInt64(0), + y: NewDecFromInt64(123), + exp: NewDecFromInt64(0), + }, + "123 / 0 -> Err": { + x: NewDecFromInt64(123), + y: NewDecFromInt64(0), + expErr: ErrInvalidDec, + }, + "-123 / -> Err": { + x: NewDecFromInt64(-123), + y: NewDecFromInt64(0), + expErr: ErrInvalidDec, + }, + "123 / 123 = 1": { + x: NewDecFromInt64(123), + y: NewDecFromInt64(123), + exp: NewDecFromInt64(1), + }, + "-123 / 123 = -1": { + x: NewDecFromInt64(-123), + y: NewDecFromInt64(123), + exp: NewDecFromInt64(-1), + }, + "-123 / -123 = 1": { + x: NewDecFromInt64(-123), + y: NewDecFromInt64(-123), + exp: NewDecFromInt64(1), + }, + "1.234 / 1.234": { + x: NewDecWithExp(1234, -3), + y: NewDecWithExp(1234, -3), + exp: NewDecFromInt64(1), + }, + "-1.234 / 1234 = -121.766": { + x: NewDecWithExp(-1234, -3), + y: NewDecWithExp(1234, -3), + exp: NewDecFromInt64(-1), + }, + "1.234 / -1.234 = 2.468": { + x: NewDecWithExp(1234, -3), + y: NewDecWithExp(-1234, -3), + exp: NewDecFromInt64(-1), + }, + "-1.234 / -1.234 = 1": { + x: NewDecWithExp(-1234, -3), + y: NewDecWithExp(-1234, -3), + exp: NewDecFromInt64(1), + }, + "3 / -9 = 0": { + x: NewDecFromInt64(3), + y: NewDecFromInt64(-9), + exp: must(NewDecFromString("0")), + }, + "8 / 9 = 0": { + x: NewDecFromInt64(8), + y: NewDecFromInt64(9), + exp: must(NewDecFromString("0")), + }, + "high precision - min/0.1": { + x: NewDecWithExp(1, -100_000), + y: NewDecWithExp(1, -1), + exp: NewDecFromInt64(0), + }, + "high precision - <_min/-1 -> Err": { + x: NewDecWithExp(1, -100_001), + y: NewDecWithExp(-1, 0), + expErr: ErrInvalidDec, + }, + "high precision - <_min/-10 -> Err": { + x: NewDecWithExp(1, -100_001), + y: NewDecWithExp(-1, 1), + expErr: ErrInvalidDec, + }, + "1e000 / 1 -> Err": { + x: NewDecWithExp(1, 100_000), + y: NewDecFromInt64(1), + expErr: ErrInvalidDec, + }, + "1e100000 - 1^1 -> Err": { + x: NewDecWithExp(1, 100_000), + y: NewDecWithExp(1, -1), + expErr: ErrInvalidDec, + }, } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + got, gotErr := spec.x.QuoInteger(spec.y) - for i, tc := range testCases { - res := tc.input.Ceil() - s.Require().Equal(tc.expected, res, "unexpected result for test case %d, input: %v", i, tc.input) + if spec.expErr != nil { + require.ErrorIs(t, gotErr, spec.expErr) + return + } + require.NoError(t, gotErr) + assert.True(t, spec.exp.Equal(got)) + }) } } -func (s *decimalTestSuite) TestPower() { - testCases := []struct { - input math.LegacyDec - power uint64 - expected math.LegacyDec +func TestModulo(t *testing.T) { + specs := map[string]struct { + x Dec + y Dec + exp Dec + expErr error }{ - {math.LegacyNewDec(100), 0, math.LegacyOneDec()}, // 10 ^ (0) => 1.0 - {math.LegacyOneDec(), 10, math.LegacyOneDec()}, // 1.0 ^ (10) => 1.0 - {math.LegacyNewDecWithPrec(5, 1), 2, math.LegacyNewDecWithPrec(25, 2)}, // 0.5 ^ 2 => 0.25 - {math.LegacyNewDecWithPrec(2, 1), 2, math.LegacyNewDecWithPrec(4, 2)}, // 0.2 ^ 2 => 0.04 - {math.LegacyNewDecFromInt(math.NewInt(3)), 3, math.LegacyNewDecFromInt(math.NewInt(27))}, // 3 ^ 3 => 27 - {math.LegacyNewDecFromInt(math.NewInt(-3)), 4, math.LegacyNewDecFromInt(math.NewInt(81))}, // -3 ^ 4 = 81 - {math.LegacyNewDecWithPrec(1414213562373095049, 18), 2, math.LegacyNewDecFromInt(math.NewInt(2))}, // 1.414213562373095049 ^ 2 = 2 + "0 / 123 = 0": { + x: NewDecFromInt64(0), + y: NewDecFromInt64(123), + exp: NewDecFromInt64(0), + }, + "123 / 10 = 3": { + x: NewDecFromInt64(123), + y: NewDecFromInt64(10), + exp: NewDecFromInt64(3), + }, + "123 / -10 = 3": { + x: NewDecFromInt64(123), + y: NewDecFromInt64(-10), + exp: NewDecFromInt64(3), + }, + "-123 / 10 = -3": { + x: NewDecFromInt64(-123), + y: NewDecFromInt64(10), + exp: NewDecFromInt64(-3), + }, + "1.234 / 1 = 0.234": { + x: NewDecWithExp(1234, -3), + y: NewDecFromInt64(1), + exp: NewDecWithExp(234, -3), + }, + "1.234 / 0.1 = 0.034": { + x: NewDecWithExp(1234, -3), + y: NewDecWithExp(1, -1), + exp: NewDecWithExp(34, -3), + }, + "1.234 / 1.1 = 0.134": { + x: NewDecWithExp(1234, -3), + y: NewDecWithExp(11, -1), + exp: NewDecWithExp(134, -3), + }, + "10 / 0 -> Err": { + x: NewDecFromInt64(10), + y: NewDecFromInt64(0), + expErr: ErrInvalidDec, + }, + "-1e0000 / 9e0000 = 1e0000": { + x: NewDecWithExp(-1, 100_000), + y: NewDecWithExp(9, 100_000), + exp: NewDecWithExp(-1, 100_000), + }, + "1e0000 / 9e0000 = 1e0000": { + x: NewDecWithExp(1, 100_000), + y: NewDecWithExp(9, 100_000), + exp: NewDecWithExp(1, 100_000), + }, } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + got, gotErr := spec.x.Modulo(spec.y) - for i, tc := range testCases { - res := tc.input.Power(tc.power) - s.Require().True(tc.expected.Sub(res).Abs().LTE(math.LegacySmallestDec()), "unexpected result for test case %d, normal power, input: %v", i, tc.input) - - mutableInput := tc.input - mutableInput.PowerMut(tc.power) - s.Require().True(tc.expected.Sub(mutableInput).Abs().LTE(math.LegacySmallestDec()), - "unexpected result for test case %d, input %v", i, tc.input) - s.Require().True(res.Equal(tc.input), "unexpected result for test case %d, mutable power, input: %v", i, tc.input) + if spec.expErr != nil { + require.ErrorIs(t, gotErr, spec.expErr) + return + } + require.NoError(t, gotErr) + assert.True(t, spec.exp.Equal(got)) + }) } } -func (s *decimalTestSuite) TestApproxRoot() { - testCases := []struct { - input math.LegacyDec - root uint64 - expected math.LegacyDec +func TestNumDecimalPlaces(t *testing.T) { + specs := map[string]struct { + src Dec + exp uint32 }{ - {math.LegacyOneDec(), 10, math.LegacyOneDec()}, // 1.0 ^ (0.1) => 1.0 - {math.LegacyNewDecWithPrec(25, 2), 2, math.LegacyNewDecWithPrec(5, 1)}, // 0.25 ^ (0.5) => 0.5 - {math.LegacyNewDecWithPrec(4, 2), 2, math.LegacyNewDecWithPrec(2, 1)}, // 0.04 ^ (0.5) => 0.2 - {math.LegacyNewDecFromInt(math.NewInt(27)), 3, math.LegacyNewDecFromInt(math.NewInt(3))}, // 27 ^ (1/3) => 3 - {math.LegacyNewDecFromInt(math.NewInt(-81)), 4, math.LegacyNewDecFromInt(math.NewInt(-3))}, // -81 ^ (0.25) => -3 - {math.LegacyNewDecFromInt(math.NewInt(2)), 2, math.LegacyNewDecWithPrec(1414213562373095049, 18)}, // 2 ^ (0.5) => 1.414213562373095049 - {math.LegacyNewDecWithPrec(1005, 3), 31536000, math.LegacyMustNewDecFromStr("1.000000000158153904")}, // 1.005 ^ (1/31536000) ≈ 1.00000000016 - {math.LegacySmallestDec(), 2, math.LegacyNewDecWithPrec(1, 9)}, // 1e-18 ^ (0.5) => 1e-9 - {math.LegacySmallestDec(), 3, math.LegacyMustNewDecFromStr("0.000000999999999997")}, // 1e-18 ^ (1/3) => 1e-6 - {math.LegacyNewDecWithPrec(1, 8), 3, math.LegacyMustNewDecFromStr("0.002154434690031900")}, // 1e-8 ^ (1/3) ≈ 0.00215443469 - {math.LegacyMustNewDecFromStr("9000002314687921634000000000000000000021394871242000000000000000"), 2, math.LegacyMustNewDecFromStr("94868342004527103646332858502867.899477053226766107")}, + "integer": { + src: NewDecFromInt64(123), + exp: 0, + }, + "one decimal place": { + src: NewDecWithExp(1234, -1), + exp: 1, + }, + "two decimal places": { + src: NewDecWithExp(12345, -2), + exp: 2, + }, + "three decimal places": { + src: NewDecWithExp(123456, -3), + exp: 3, + }, + "trailing zeros": { + src: NewDecWithExp(123400, -4), + exp: 4, + }, + "zero value": { + src: NewDecFromInt64(0), + exp: 0, + }, + "negative value": { + src: NewDecWithExp(-12345, -3), + exp: 3, + }, } - - // In the case of 1e-8 ^ (1/3), the result repeats every 5 iterations starting from iteration 24 - // (i.e. 24, 29, 34, ... give the same result) and never converges enough. The maximum number of - // iterations (300) causes the result at iteration 300 to be returned, regardless of convergence. - - for i, tc := range testCases { - res, err := tc.input.ApproxRoot(tc.root) - s.Require().NoError(err) - s.Require().True(tc.expected.Sub(res).Abs().LTE(math.LegacySmallestDec()), "unexpected result for test case %d, input: %v", i, tc.input) + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + got := spec.src.NumDecimalPlaces() + assert.Equal(t, spec.exp, got) + }) } } -func (s *decimalTestSuite) TestApproxSqrt() { - testCases := []struct { - input math.LegacyDec - expected math.LegacyDec +func TestCmp(t *testing.T) { + specs := map[string]struct { + x Dec + y Dec + exp int }{ - {math.LegacyOneDec(), math.LegacyOneDec()}, // 1.0 => 1.0 - {math.LegacyNewDecWithPrec(25, 2), math.LegacyNewDecWithPrec(5, 1)}, // 0.25 => 0.5 - {math.LegacyNewDecWithPrec(4, 2), math.LegacyNewDecWithPrec(2, 1)}, // 0.09 => 0.3 - {math.LegacyNewDec(9), math.LegacyNewDecFromInt(math.NewInt(3))}, // 9 => 3 - {math.LegacyNewDec(-9), math.LegacyNewDecFromInt(math.NewInt(-3))}, // -9 => -3 - {math.LegacyNewDec(2), math.LegacyNewDecWithPrec(1414213562373095049, 18)}, // 2 => 1.414213562373095049 - { // 2^127 - 1 => 13043817825332782212.3495718062525083688 which rounds to 13043817825332782212.3495718062525083689 - math.LegacyNewDec(2).Power(127).Sub(math.LegacyOneDec()), - math.LegacyMustNewDecFromStr("13043817825332782212.349571806252508369"), + "0 == 0": { + x: NewDecFromInt64(0), + y: NewDecFromInt64(0), + exp: 0, + }, + "0 < 123 = -1": { + x: NewDecFromInt64(0), + y: NewDecFromInt64(123), + exp: -1, + }, + "123 > 0 = 1": { + x: NewDecFromInt64(123), + y: NewDecFromInt64(0), + exp: 1, + }, + "-123 < 0 = -1": { + x: NewDecFromInt64(-123), + y: NewDecFromInt64(0), + exp: -1, + }, + "123 == 123": { + x: NewDecFromInt64(123), + y: NewDecFromInt64(123), + exp: 0, + }, + "-123 == -123": { + x: NewDecFromInt64(-123), + y: NewDecFromInt64(-123), + exp: 0, + }, + "1.234 == 1.234": { + x: NewDecWithExp(1234, -3), + y: NewDecWithExp(1234, -3), + exp: 0, + }, + "1.234 > 1.233": { + x: NewDecWithExp(1234, -3), + y: NewDecWithExp(1233, -3), + exp: 1, + }, + "1.233 < 1.234": { + x: NewDecWithExp(1233, -3), + y: NewDecWithExp(1234, -3), + exp: -1, }, } - - for i, tc := range testCases { - res, err := tc.input.ApproxSqrt() - s.Require().NoError(err) - s.Require().Equal(tc.expected, res, "unexpected result for test case %d, input: %v", i, tc.input) + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + got := spec.x.Cmp(spec.y) + assert.Equal(t, spec.exp, got) + }) } } -func (s *decimalTestSuite) TestDecSortableBytes() { - tests := []struct { - d math.LegacyDec - want []byte +func TestReduce(t *testing.T) { + specs := map[string]struct { + src string + exp string + decPlaces int }{ - {math.LegacyNewDec(0), []byte("000000000000000000.000000000000000000")}, - {math.LegacyNewDec(1), []byte("000000000000000001.000000000000000000")}, - {math.LegacyNewDec(10), []byte("000000000000000010.000000000000000000")}, - {math.LegacyNewDec(12340), []byte("000000000000012340.000000000000000000")}, - {math.LegacyNewDecWithPrec(12340, 4), []byte("000000000000000001.234000000000000000")}, - {math.LegacyNewDecWithPrec(12340, 5), []byte("000000000000000000.123400000000000000")}, - {math.LegacyNewDecWithPrec(12340, 8), []byte("000000000000000000.000123400000000000")}, - {math.LegacyNewDecWithPrec(1009009009009009009, 17), []byte("000000000000000010.090090090090090090")}, - {math.LegacyNewDecWithPrec(-1009009009009009009, 17), []byte("-000000000000000010.090090090090090090")}, - {math.LegacyNewDec(1000000000000000000), []byte("max")}, - {math.LegacyNewDec(-1000000000000000000), []byte("--")}, + "positive value": { + src: "10", + exp: "10", + decPlaces: 1, + }, + "negative value": { + src: "-10", + exp: "-10", + decPlaces: 1, + }, + "positive decimal": { + src: "1.30000", + exp: "1.3", + decPlaces: 4, + }, + "negative decimal": { + src: "-1.30000", + exp: "-1.3", + decPlaces: 4, + }, + "zero decimal and decimal places": { + src: "0.00000", + exp: "0", + decPlaces: 0, + }, } - for tcIndex, tc := range tests { - s.Require().Equal(tc.want, math.LegacySortableDecBytes(tc.d), "bad String(), index: %v", tcIndex) + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + src := must(NewDecFromString(spec.src)) + got, gotZerosRemoved := src.Reduce() + assert.Equal(t, spec.decPlaces, gotZerosRemoved) + assert.Equal(t, spec.exp, got.String()) + }) } - - s.Require().Panics(func() { math.LegacySortableDecBytes(math.LegacyNewDec(1000000000000000001)) }) - s.Require().Panics(func() { math.LegacySortableDecBytes(math.LegacyNewDec(-1000000000000000001)) }) } -func (s *decimalTestSuite) TestDecEncoding() { - largestBigInt, ok := new(big.Int).SetString("33499189745056880149688856635597007162669032647290798121690100488888732861290034376435130433535", 10) - s.Require().True(ok) - - smallestBigInt, ok := new(big.Int).SetString("-33499189745056880149688856635597007162669032647290798121690100488888732861290034376435130433535", 10) - s.Require().True(ok) - - const maxDecBitLen = 315 - maxInt, ok := new(big.Int).SetString(strings.Repeat("1", maxDecBitLen), 2) - s.Require().True(ok) - - testCases := []struct { - input math.LegacyDec - rawBz string - jsonStr string - yamlStr string +func TestMulExact(t *testing.T) { + specs := map[string]struct { + x Dec + y Dec + exp Dec + expErr error }{ - { - math.LegacyNewDec(0), "30", - "\"0.000000000000000000\"", - "\"0.000000000000000000\"\n", - }, - { - math.LegacyNewDecWithPrec(4, 2), - "3430303030303030303030303030303030", - "\"0.040000000000000000\"", - "\"0.040000000000000000\"\n", - }, - { - math.LegacyNewDecWithPrec(-4, 2), - "2D3430303030303030303030303030303030", - "\"-0.040000000000000000\"", - "\"-0.040000000000000000\"\n", - }, - { - math.LegacyNewDecWithPrec(1414213562373095049, 18), - "31343134323133353632333733303935303439", - "\"1.414213562373095049\"", - "\"1.414213562373095049\"\n", - }, - { - math.LegacyNewDecWithPrec(-1414213562373095049, 18), - "2D31343134323133353632333733303935303439", - "\"-1.414213562373095049\"", - "\"-1.414213562373095049\"\n", - }, - { - math.LegacyNewDecFromBigIntWithPrec(largestBigInt, 18), - "3333343939313839373435303536383830313439363838383536363335353937303037313632363639303332363437323930373938313231363930313030343838383838373332383631323930303334333736343335313330343333353335", - "\"33499189745056880149688856635597007162669032647290798121690100488888732861290.034376435130433535\"", - "\"33499189745056880149688856635597007162669032647290798121690100488888732861290.034376435130433535\"\n", - }, - { - math.LegacyNewDecFromBigIntWithPrec(smallestBigInt, 18), - "2D3333343939313839373435303536383830313439363838383536363335353937303037313632363639303332363437323930373938313231363930313030343838383838373332383631323930303334333736343335313330343333353335", - "\"-33499189745056880149688856635597007162669032647290798121690100488888732861290.034376435130433535\"", - "\"-33499189745056880149688856635597007162669032647290798121690100488888732861290.034376435130433535\"\n", - }, - { - math.LegacyNewDecFromBigIntWithPrec(maxInt, 18), - "3636373439353934383732353238343430303734383434343238333137373938353033353831333334353136333233363435333939303630383435303530323434343434333636343330363435303137313838323137353635323136373637", - "\"66749594872528440074844428317798503581334516323645399060845050244444366430645.017188217565216767\"", - "\"66749594872528440074844428317798503581334516323645399060845050244444366430645.017188217565216767\"\n", + "200 * 200 = 40000": { + x: NewDecFromInt64(200), + y: NewDecFromInt64(200), + exp: NewDecFromInt64(40000), + }, + "-200 * -200 = 40000": { + x: NewDecFromInt64(-200), + y: NewDecFromInt64(-200), + exp: NewDecFromInt64(40000), + }, + "-100 * -100 = 10000": { + x: NewDecFromInt64(-100), + y: NewDecFromInt64(-100), + exp: NewDecFromInt64(10000), + }, + "0 * 0 = 0": { + x: NewDecFromInt64(0), + y: NewDecFromInt64(0), + exp: NewDecFromInt64(0), + }, + "1.1 * 1.1 = 1.21": { + x: NewDecWithExp(11, -1), + y: NewDecWithExp(11, -1), + exp: NewDecWithExp(121, -2), + }, + "1.000 * 1.000 = 1.000000": { + x: NewDecWithExp(1000, -3), + y: NewDecWithExp(1000, -3), + exp: must(NewDecFromString("1.000000")), + }, + "0.0000001 * 0.0000001 = 0": { + x: NewDecWithExp(0o0000001, -7), + y: NewDecWithExp(0o0000001, -7), + exp: NewDecWithExp(1, -14), + }, + "0.12345678901234567890123456789012345 * 1": { + x: must(NewDecFromString("0.12345678901234567890123456789012345")), + y: NewDecWithExp(1, 0), + expErr: ErrUnexpectedRounding, + }, + "0.12345678901234567890123456789012345 * 0": { + x: must(NewDecFromString("0.12345678901234567890123456789012345")), + y: NewDecFromInt64(0), + exp: NewDecFromInt64(0), + }, + "0.12345678901234567890123456789012345 * 0.1": { + x: must(NewDecFromString("0.12345678901234567890123456789012345")), + y: NewDecWithExp(1, -1), + expErr: ErrUnexpectedRounding, + }, + "1000001 * 1.000001 = 1000002.000001": { + x: NewDecFromInt64(1000001), + y: NewDecWithExp(1000001, -6), + exp: must(NewDecFromString("1000002.000001")), + }, + "1000001 * 1000000 = 1000001000000 ": { + x: NewDecFromInt64(1000001), + y: NewDecFromInt64(1000000), + exp: NewDecFromInt64(1000001000000), + }, + "1e0000 * 1e0000 -> Err": { + x: NewDecWithExp(1, 100_000), + y: NewDecWithExp(1, 100_000), + expErr: ErrInvalidDec, + }, + "1e0000 * 1 = 1e0000": { + x: NewDecWithExp(1, 100_000), + y: NewDecWithExp(1, 0), + exp: NewDecWithExp(1, 100_000), + }, + "1e100000 * 9 = 9e100000": { + x: NewDecWithExp(1, 100_000), + y: NewDecFromInt64(9), + exp: NewDecWithExp(9, 100_000), + }, + "1e100000 * 10 = err": { + x: NewDecWithExp(1, 100_000), + y: NewDecWithExp(1, 1), + expErr: ErrInvalidDec, + }, + "1e0000 * -1 = -1e0000": { + x: NewDecWithExp(1, 100_000), + y: NewDecWithExp(-1, 0), + exp: NewDecWithExp(-1, 100_000), + }, + "1e100000 * -9 = 9e100000": { + x: NewDecWithExp(1, 100_000), + y: NewDecFromInt64(-9), + exp: NewDecWithExp(-9, 100_000), + }, + "1e100000 * -10 = err": { + x: NewDecWithExp(1, 100_000), + y: NewDecWithExp(-1, 1), + expErr: ErrInvalidDec, }, } - - for _, tc := range testCases { - bz, err := tc.input.Marshal() - s.Require().NoError(err) - s.Require().Equal(tc.rawBz, fmt.Sprintf("%X", bz)) - - var other math.LegacyDec - s.Require().NoError((&other).Unmarshal(bz)) - s.Require().True(tc.input.Equal(other)) - - bz, err = json.Marshal(tc.input) - s.Require().NoError(err) - s.Require().Equal(tc.jsonStr, string(bz)) - s.Require().NoError(json.Unmarshal(bz, &other)) - s.Require().True(tc.input.Equal(other)) - - bz, err = yaml.Marshal(tc.input) - s.Require().NoError(err) - s.Require().Equal(tc.yamlStr, string(bz)) + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + got, gotErr := spec.x.MulExact(spec.y) + if spec.expErr != nil { + require.ErrorIs(t, gotErr, spec.expErr, gotErr) + return + } + require.NoError(t, gotErr) + assert.True(t, spec.exp.Equal(got), "exp: %s, got: %s", spec.exp.Text('E'), got.Text('E')) + }) } } -// Showcase that different orders of operations causes different results. -func (s *decimalTestSuite) TestOperationOrders() { - n1 := math.LegacyNewDec(10) - n2 := math.LegacyNewDec(1000000010) - s.Require().Equal(n1.Mul(n2).Quo(n2), math.LegacyNewDec(10)) - s.Require().NotEqual(n1.Mul(n2).Quo(n2), n1.Quo(n2).Mul(n2)) -} - -func BenchmarkMarshalTo(b *testing.B) { - b.ReportAllocs() - bis := []struct { - in math.LegacyDec - want []byte +func TestToBigInt(t *testing.T) { + i1 := "1000000000000000000000000000000000000123456789" + tcs := []struct { + intStr string + out string + isError error }{ - { - math.LegacyNewDec(1e8), []byte{ - 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, - 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, - 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, - }, - }, - {math.LegacyNewDec(0), []byte{0x30}}, + {i1, i1, nil}, + {"1000000000000000000000000000000000000123456789.00000000", i1, nil}, + {"123.456e6", "123456000", nil}, + {"12345.6", "", ErrNonIntegral}, } - data := make([]byte, 100) - - b.ReportAllocs() - b.ResetTimer() - - for i := 0; i < b.N; i++ { - for _, bi := range bis { - if n, err := bi.in.MarshalTo(data); err != nil { - b.Fatal(err) - } else if !bytes.Equal(data[:n], bi.want) { - b.Fatalf("Mismatch\nGot: % x\nWant: % x\n", data[:n], bi.want) + for idx, tc := range tcs { + t.Run(fmt.Sprintf("%d", idx), func(t *testing.T) { + a, err := NewDecFromString(tc.intStr) + require.NoError(t, err) + b, err := a.BigInt() + if tc.isError == nil { + require.NoError(t, err, "test_%d", idx) + require.Equal(t, tc.out, b.String(), "test_%d", idx) + } else { + require.ErrorIs(t, err, tc.isError, "test_%d", idx) } - } - } -} - -var sink interface{} - -func BenchmarkLegacyQuoMut(b *testing.B) { - b1 := math.LegacyNewDec(17e2 + 8371) - b2 := math.LegacyNewDec(4371) - b.ReportAllocs() - b.ResetTimer() - for i := 0; i < b.N; i++ { - sink = b1.QuoMut(b2) - } - - if sink == nil { - b.Fatal("Benchmark did not run") - } - sink = (interface{})(nil) -} - -func BenchmarkLegacyQuoTruncateMut(b *testing.B) { - b1 := math.LegacyNewDec(17e2 + 8371) - b2 := math.LegacyNewDec(4371) - b.ReportAllocs() - b.ResetTimer() - for i := 0; i < b.N; i++ { - sink = b1.QuoTruncateMut(b2) - } - - if sink == nil { - b.Fatal("Benchmark did not run") + }) } - sink = (interface{})(nil) } -func BenchmarkLegacySqrtOnMersennePrime(b *testing.B) { - b1 := math.LegacyNewDec(2).Power(127).Sub(math.LegacyOneDec()) - b.ReportAllocs() - b.ResetTimer() - for i := 0; i < b.N; i++ { - sink, _ = b1.ApproxSqrt() +func TestToSdkInt(t *testing.T) { + maxIntValue := "115792089237316195423570985008687907853269984665640564039457584007913129639935" // 2^256 -1 + tcs := []struct { + src string + exp string + expErr bool + }{ + {src: maxIntValue, exp: maxIntValue}, + {src: "1000000000000000000000000000000000000123456789.00000001", exp: "1000000000000000000000000000000000000123456789"}, + {src: "123.456e6", exp: "123456000"}, + {src: "123.456e1", exp: "1234"}, + {src: "123.456", exp: "123"}, + {src: "123.956", exp: "123"}, + {src: "-123.456", exp: "-123"}, + {src: "-123.956", exp: "-123"}, + {src: "-0.956", exp: "0"}, + {src: "-0.9", exp: "0"}, + {src: "1E-100000", exp: "0"}, + {src: "115792089237316195423570985008687907853269984665640564039457584007913129639936", expErr: true}, // 2^256 + {src: "1E100000", expErr: true}, } - - if sink == nil { - b.Fatal("Benchmark did not run") + for _, tc := range tcs { + t.Run(fmt.Sprint(tc.src), func(t *testing.T) { + a, err := NewDecFromString(tc.src) + require.NoError(t, err) + b, gotErr := a.SdkIntTrim() + if tc.expErr { + require.Error(t, gotErr, "value: %s", b.String()) + return + } + require.NoError(t, gotErr) + require.Equal(t, tc.exp, b.String()) + }) } - sink = (interface{})(nil) } -func BenchmarkLegacyQuoRoundupMut(b *testing.B) { - b1 := math.LegacyNewDec(17e2 + 8371) - b2 := math.LegacyNewDec(4371) - b.ReportAllocs() - b.ResetTimer() - for i := 0; i < b.N; i++ { - sink = b1.QuoRoundupMut(b2) - } - - if sink == nil { - b.Fatal("Benchmark did not run") - } - sink = (interface{})(nil) +func TestInfDecString(t *testing.T) { + _, err := NewDecFromString("iNf") + require.Error(t, err) + require.ErrorIs(t, err, ErrInvalidDec) } -func TestFormatDec(t *testing.T) { - type decimalTest []string - var testcases []decimalTest - raw, err := os.ReadFile("./testdata/decimals.json") - require.NoError(t, err) - err = json.Unmarshal(raw, &testcases) - require.NoError(t, err) - - for _, tc := range testcases { - tc := tc - t.Run(tc[0], func(t *testing.T) { - out, err := math.FormatDec(tc[0]) - require.NoError(t, err) - require.Equal(t, tc[1], out) - }) +func must[T any](r T, err error) T { + if err != nil { + panic(err) } + return r } -func TestFormatDecNonDigits(t *testing.T) { - badCases := []string{ - "10.a", - "1a.10", - "p1a10.", - "0.10p", - "--10", - "12.😎😎", - "11111111111133333333333333333333333333333a", - "11111111111133333333333333333333333333333 192892", +func TestMarshalUnmarshal(t *testing.T) { + specs := map[string]struct { + x Dec + exp string + expErr error + }{ + "Zero value": { + x: NewDecFromInt64(0), + exp: "0", + }, + "-0": { + x: NewDecFromInt64(-0), + exp: "0", + }, + "1 decimal place": { + x: must(NewDecFromString("0.1")), + exp: "0.1", + }, + "2 decimal places": { + x: must(NewDecFromString("0.01")), + exp: "0.01", + }, + "3 decimal places": { + x: must(NewDecFromString("0.001")), + exp: "0.001", + }, + "4 decimal places": { + x: must(NewDecFromString("0.0001")), + exp: "0.0001", + }, + "5 decimal places": { + x: must(NewDecFromString("0.00001")), + exp: "0.00001", + }, + "6 decimal places": { + x: must(NewDecFromString("0.000001")), + exp: "1E-6", + }, + "7 decimal places": { + x: must(NewDecFromString("0.0000001")), + exp: "1E-7", + }, + "1": { + x: must(NewDecFromString("1")), + exp: "1", + }, + "12": { + x: must(NewDecFromString("12")), + exp: "12", + }, + "123": { + x: must(NewDecFromString("123")), + exp: "123", + }, + "1234": { + x: must(NewDecFromString("1234")), + exp: "1234", + }, + "12345": { + x: must(NewDecFromString("12345")), + exp: "12345", + }, + "123456": { + x: must(NewDecFromString("123456")), + exp: "123456", + }, + "1234567": { + x: must(NewDecFromString("1234567")), + exp: "1.234567E+6", + }, + "12345678": { + x: must(NewDecFromString("12345678")), + exp: "12.345678E+6", + }, + "123456789": { + x: must(NewDecFromString("123456789")), + exp: "123.456789E+6", + }, + "1234567890": { + x: must(NewDecFromString("1234567890")), + exp: "123.456789E+7", + }, + "12345678900": { + x: must(NewDecFromString("12345678900")), + exp: "123.456789E+8", + }, + "negative 1 with negative exponent": { + x: must(NewDecFromString("-1.000001")), + exp: "-1.000001", + }, + "-1.0000001 - negative 1 with negative exponent": { + x: must(NewDecFromString("-1.0000001")), + exp: "-1.0000001", + }, + "3 decimal places before the comma": { + x: must(NewDecFromString("100")), + exp: "100", + }, + "4 decimal places before the comma": { + x: must(NewDecFromString("1000")), + exp: "1000", + }, + "5 decimal places before the comma": { + x: must(NewDecFromString("10000")), + exp: "10000", + }, + "6 decimal places before the comma": { + x: must(NewDecFromString("100000")), + exp: "100000", + }, + "7 decimal places before the comma": { + x: must(NewDecFromString("1000000")), + exp: "1E+6", + }, + "1e100000": { + x: NewDecWithExp(1, 100_000), + exp: "1E+100000", + }, + "1.1e100000": { + x: must(NewDecFromString("1.1e100000")), + exp: "1.1E+100000", + }, + "1e100001": { + x: NewDecWithExp(1, 100_001), + expErr: ErrInvalidDec, + }, } - - for _, value := range badCases { - value := value - t.Run(value, func(t *testing.T) { - s, err := math.FormatDec(value) - if err == nil { - t.Fatal("Expected an error") - } - if g, w := err.Error(), "non-digits"; !strings.Contains(g, w) { - t.Errorf("Error mismatch\nGot: %q\nWant substring: %q", g, w) - } - if s != "" { - t.Fatalf("Got a non-empty string: %q", s) + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + marshaled, gotErr := spec.x.Marshal() + if spec.expErr != nil { + require.ErrorIs(t, gotErr, spec.expErr) + return } + require.NoError(t, gotErr) + assert.Equal(t, spec.exp, string(marshaled)) + // and backwards + unmarshalledDec := new(Dec) + require.NoError(t, unmarshalledDec.Unmarshal(marshaled)) + assert.Equal(t, spec.exp, unmarshalledDec.String()) + assert.True(t, spec.x.Equal(*unmarshalledDec)) }) } } - -func TestNegativePrecisionPanic(t *testing.T) { - require.Panics(t, func() { - math.LegacyNewDecWithPrec(10, -1) - }) -} diff --git a/math/go.mod b/math/go.mod index 2e7317cacac3..35c233fc8e01 100644 --- a/math/go.mod +++ b/math/go.mod @@ -1,18 +1,38 @@ module cosmossdk.io/math -go 1.20 +go 1.23 + +toolchain go1.23.0 require ( - github.com/stretchr/testify v1.8.4 - golang.org/x/exp v0.0.0-20221205204356-47842c84f3db - sigs.k8s.io/yaml v1.3.0 + cosmossdk.io/errors v1.0.1 + github.com/cockroachdb/apd/v3 v3.2.1 + github.com/stretchr/testify v1.10.0 + pgregory.net/rapid v1.2.0 + sigs.k8s.io/yaml v1.4.0 ) require ( - github.com/davecgh/go-spew v1.1.1 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/kr/pretty v0.3.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/rogpeppe/go-internal v1.14.0 // indirect + golang.org/x/net v0.35.0 // indirect + golang.org/x/sys v0.30.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250122153221-138b5a5a4fd4 // indirect + google.golang.org/grpc v1.70.0 // indirect + google.golang.org/protobuf v1.36.5 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +// Issue with math.Int{}.Size() implementation. +retract [v1.1.0, v1.1.1] + +// Bit length differences between Int and Dec +retract ( + v1.3.0 + v1.2.0 + v1.1.2 + [v1.0.0, v1.0.1] +) diff --git a/math/go.sum b/math/go.sum index ea4dfe1b256c..7415b2ab493e 100644 --- a/math/go.sum +++ b/math/go.sum @@ -1,28 +1,49 @@ +cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= +cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= +github.com/cockroachdb/apd/v3 v3.2.1 h1:U+8j7t0axsIgvQUqthuNm82HIrYXodOV2iWLWtEaIwg= +github.com/cockroachdb/apd/v3 v3.2.1/go.mod h1:klXJcjp+FffLTHlhIG69tezTDvdP065naDsHzKhYSqc= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -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/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= +github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -golang.org/x/exp v0.0.0-20221205204356-47842c84f3db h1:D/cFflL63o2KSLJIwjlcIt8PR064j/xsmdEJL/YvY/o= -golang.org/x/exp v0.0.0-20221205204356-47842c84f3db/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +github.com/rogpeppe/go-internal v1.14.0 h1:unbRd941gNa8SS77YznHXOYVBDgWcF9xhzECdm8juZc= +github.com/rogpeppe/go-internal v1.14.0/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= +golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= +golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= +golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= +golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250122153221-138b5a5a4fd4 h1:yrTuav+chrF0zF/joFGICKTzYv7mh/gr9AgEXrVU8ao= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250122153221-138b5a5a4fd4/go.mod h1:+2Yz8+CLJbIfL9z73EW45avw8Lmge3xVElCP9zEKi50= +google.golang.org/grpc v1.70.0 h1:pWFv03aZoHzlRKHWicjsZytKAiYCtNS0dHbXnIdq7jQ= +google.golang.org/grpc v1.70.0/go.mod h1:ofIJqVKDXx/JiXrwr2IG4/zwdH9txy3IlF40RmcJSQw= +google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= +google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 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/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +pgregory.net/rapid v1.2.0 h1:keKAYRcjm+e1F0oAuU5F5+YPAWcyxNNRK2wud503Gnk= +pgregory.net/rapid v1.2.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/math/int.go b/math/int.go index 3e6b5c257dec..12217981a40c 100644 --- a/math/int.go +++ b/math/int.go @@ -3,8 +3,10 @@ package math import ( "encoding" "encoding/json" + "errors" "fmt" "math/big" + "math/bits" "strings" "sync" "testing" @@ -13,6 +15,20 @@ import ( // MaxBitLen defines the maximum bit length supported bit Int and Uint types. const MaxBitLen = 256 +// maxWordLen defines the maximum word length supported by Int and Uint types. +// We check overflow, by first doing a fast check if the word length is below maxWordLen +// and if not then do the slower full bitlen check. +// NOTE: If MaxBitLen is not a multiple of bits.UintSize, then we need to edit the used logic slightly. +const maxWordLen = MaxBitLen / bits.UintSize + +// Integer errors +var ( + // ErrIntOverflow is the error returned when an integer overflow occurs + ErrIntOverflow = errors.New("integer overflow") + // ErrDivideByZero is the error returned when a divide by zero occurs + ErrDivideByZero = errors.New("divide by zero") +) + func newIntegerFromString(s string) (*big.Int, bool) { return new(big.Int).SetString(s, 0) } @@ -62,7 +78,7 @@ func unmarshalText(i *big.Int, text string) error { return err } - if i.BitLen() > MaxBitLen { + if bigIntOverflows(i) { return fmt.Errorf("integer out of range: %s", text) } @@ -71,7 +87,7 @@ func unmarshalText(i *big.Int, text string) error { var _ customProtobufType = (*Int)(nil) -// Int wraps big.Int with a 257 bit range bound +// Int wraps big.Int with a 256 bit range bound // Checks overflow, underflow and division by zero // Exists in range from -(2^256 - 1) to 2^256 - 1 type Int struct { @@ -86,6 +102,14 @@ func (i Int) BigInt() *big.Int { return new(big.Int).Set(i.i) } +// BigIntMut converts Int to big.Int, mutative the input +func (i Int) BigIntMut() *big.Int { + if i.IsNil() { + return nil + } + return i.i +} + // IsNil returns true if Int is uninitialized func (i Int) IsNil() bool { return i.i == nil @@ -105,14 +129,31 @@ func NewIntFromUint64(n uint64) Int { // NewIntFromBigInt constructs Int from big.Int. If the provided big.Int is nil, // it returns an empty instance. This function panics if the bit length is > 256. +// Note, the caller can safely mutate the argument after this function returns. func NewIntFromBigInt(i *big.Int) Int { if i == nil { return Int{} } - if i.BitLen() > MaxBitLen { + if bigIntOverflows(i) { panic("NewIntFromBigInt() out of bound") } + + return Int{new(big.Int).Set(i)} +} + +// NewIntFromBigIntMut constructs Int from big.Int. If the provided big.Int is nil, +// it returns an empty instance. This function panics if the bit length is > 256. +// Note, this function mutate the argument. +func NewIntFromBigIntMut(i *big.Int) Int { + if i == nil { + return Int{} + } + + if bigIntOverflows(i) { + panic("NewIntFromBigInt() out of bound") + } + return Int{i} } @@ -123,7 +164,7 @@ func NewIntFromString(s string) (res Int, ok bool) { return } // Check overflow - if i.BitLen() > MaxBitLen { + if bigIntOverflows(i) { ok = false return } @@ -141,7 +182,7 @@ func NewIntWithDecimal(n int64, dec int) Int { i.Mul(big.NewInt(n), exp) // Check overflow - if i.BitLen() > MaxBitLen { + if bigIntOverflows(i) { panic("NewIntWithDecimal() out of bound") } return Int{i} @@ -153,6 +194,11 @@ func ZeroInt() Int { return Int{big.NewInt(0)} } // OneInt returns Int value with one func OneInt() Int { return Int{big.NewInt(1)} } +// ToLegacyDec converts Int to LegacyDec +func (i Int) ToLegacyDec() LegacyDec { + return LegacyNewDecFromInt(i) +} + // Int64 converts Int to int64 // Panics if the value is out of range func (i Int) Int64() int64 { @@ -229,12 +275,12 @@ func (i Int) LTE(i2 Int) bool { // Add adds Int from another func (i Int) Add(i2 Int) (res Int) { - res = Int{add(i.i, i2.i)} // Check overflow - if res.i.BitLen() > MaxBitLen { - panic("Int overflow") + x, err := i.SafeAdd(i2) + if err != nil { + panic(err) } - return + return x } // AddRaw adds int64 to Int @@ -242,14 +288,24 @@ func (i Int) AddRaw(i2 int64) Int { return i.Add(NewInt(i2)) } +// SafeAdd adds Int from another and returns an error if overflow +func (i Int) SafeAdd(i2 Int) (res Int, err error) { + res = Int{add(i.i, i2.i)} + // Check overflow + if bigIntOverflows(res.i) { + return Int{}, ErrIntOverflow + } + return res, nil +} + // Sub subtracts Int from another func (i Int) Sub(i2 Int) (res Int) { - res = Int{sub(i.i, i2.i)} // Check overflow - if res.i.BitLen() > MaxBitLen { - panic("Int overflow") + x, err := i.SafeSub(i2) + if err != nil { + panic(err) } - return + return x } // SubRaw subtracts int64 from Int @@ -257,32 +313,49 @@ func (i Int) SubRaw(i2 int64) Int { return i.Sub(NewInt(i2)) } +// SafeSub subtracts Int from another and returns an error if overflow or underflow +func (i Int) SafeSub(i2 Int) (res Int, err error) { + res = Int{sub(i.i, i2.i)} + // Check overflow/underflow + if bigIntOverflows(res.i) { + return Int{}, ErrIntOverflow + } + return res, nil +} + // Mul multiples two Ints func (i Int) Mul(i2 Int) (res Int) { // Check overflow - if i.i.BitLen()+i2.i.BitLen()-1 > MaxBitLen { - panic("Int overflow") - } - res = Int{mul(i.i, i2.i)} - // Check overflow if sign of both are same - if res.i.BitLen() > MaxBitLen { - panic("Int overflow") + x, err := i.SafeMul(i2) + if err != nil { + panic(err) } - return + return x } -// MulRaw multipies Int and int64 +// MulRaw multiplies Int and int64 func (i Int) MulRaw(i2 int64) Int { return i.Mul(NewInt(i2)) } +// SafeMul multiples Int from another and returns an error if overflow +func (i Int) SafeMul(i2 Int) (res Int, err error) { + res = Int{mul(i.i, i2.i)} + // Check overflow + if bigIntOverflows(res.i) { + return Int{}, ErrIntOverflow + } + return res, nil +} + // Quo divides Int with Int func (i Int) Quo(i2 Int) (res Int) { // Check division-by-zero - if i2.i.Sign() == 0 { + x, err := i.SafeQuo(i2) + if err != nil { panic("Division by zero") } - return Int{div(i.i, i2.i)} + return x } // QuoRaw divides Int with int64 @@ -290,12 +363,22 @@ func (i Int) QuoRaw(i2 int64) Int { return i.Quo(NewInt(i2)) } +// SafeQuo divides Int with Int and returns an error if division by zero +func (i Int) SafeQuo(i2 Int) (res Int, err error) { + // Check division-by-zero + if i2.i.Sign() == 0 { + return Int{}, ErrDivideByZero + } + return Int{div(i.i, i2.i)}, nil +} + // Mod returns remainder after dividing with Int func (i Int) Mod(i2 Int) Int { - if i2.Sign() == 0 { - panic("division-by-zero") + x, err := i.SafeMod(i2) + if err != nil { + panic(err) } - return Int{mod(i.i, i2.i)} + return x } // ModRaw returns remainder after dividing with int64 @@ -303,6 +386,14 @@ func (i Int) ModRaw(i2 int64) Int { return i.Mod(NewInt(i2)) } +// SafeMod returns remainder after dividing with Int and returns an error if division by zero +func (i Int) SafeMod(i2 Int) (res Int, err error) { + if i2.Sign() == 0 { + return Int{}, ErrDivideByZero + } + return Int{mod(i.i, i2.i)}, nil +} + // Neg negates Int func (i Int) Neg() (res Int) { return Int{neg(i.i)} @@ -313,7 +404,7 @@ func (i Int) Abs() Int { return Int{abs(i.i)} } -// return the minimum of the ints +// MinInt return the minimum of the ints func MinInt(i1, i2 Int) Int { return Int{min(i1.BigInt(), i2.BigInt())} } @@ -323,7 +414,7 @@ func MaxInt(i, i2 Int) Int { return Int{max(i.BigInt(), i2.BigInt())} } -// Human readable string +// String returns human-readable string func (i Int) String() string { return i.i.String() } @@ -344,7 +435,7 @@ func (i *Int) UnmarshalJSON(bz []byte) error { return unmarshalJSON(i.i, bz) } -// MarshalJSON for custom encoding scheme +// marshalJSON for custom encoding scheme // Must be encoded as a string for JSON precision func marshalJSON(i encoding.TextMarshaler) ([]byte, error) { text, err := i.MarshalText() @@ -355,7 +446,7 @@ func marshalJSON(i encoding.TextMarshaler) ([]byte, error) { return json.Marshal(string(text)) } -// UnmarshalJSON for custom decoding scheme +// unmarshalJSON for custom decoding scheme // Must be encoded as a string for JSON precision func unmarshalJSON(i *big.Int, bz []byte) error { var text string @@ -413,7 +504,7 @@ func (i *Int) Unmarshal(data []byte) error { return err } - if i.i.BitLen() > MaxBitLen { + if bigIntOverflows(i.i) { return fmt.Errorf("integer out of range; got: %d, max: %d", i.i.BitLen(), MaxBitLen) } @@ -426,12 +517,13 @@ func (i *Int) Size() int { return len(bz) } -// Override Amino binary serialization by proxying to protobuf. +// MarshalAmino Override Amino binary serialization by proxying to protobuf. func (i Int) MarshalAmino() ([]byte, error) { return i.Marshal() } func (i *Int) UnmarshalAmino(bz []byte) error { return i.Unmarshal(bz) } -// intended to be used with require/assert: require.True(IntEq(...)) +// IntEq intended to be used with require/assert: require.True(IntEq(...)) func IntEq(t *testing.T, exp, got Int) (*testing.T, bool, string, string, string) { + t.Helper() return t, exp.Equal(got), "expected:\t%v\ngot:\t\t%v", exp.String(), got.String() } @@ -455,10 +547,10 @@ var stringsBuilderPool = &sync.Pool{ // FormatInt formats an integer (encoded as in protobuf) into a value-rendered // string following ADR-050. This function operates with string manipulation -// (instead of manipulating the int or sdk.Int object). +// (instead of manipulating the int or math.Int object). func FormatInt(v string) (string, error) { if len(v) == 0 { - return "", fmt.Errorf("cannot format empty string") + return "", errors.New("cannot format empty string") } sign := "" @@ -506,3 +598,15 @@ func FormatInt(v string) (string, error) { return sign + sb.String(), nil } + +// check if the big int overflows. +func bigIntOverflows(i *big.Int) bool { + // overflow is defined as i.BitLen() > MaxBitLen + // however this check can be expensive when doing many operations. + // So we first check if the word length is greater than maxWordLen. + // However the most significant word could be zero, hence we still do the bitlen check. + if len(i.Bits()) > maxWordLen { + return i.BitLen() > MaxBitLen + } + return false +} diff --git a/math/int_test.go b/math/int_test.go index 56b05cc69f94..e09caf6ae566 100644 --- a/math/int_test.go +++ b/math/int_test.go @@ -43,6 +43,57 @@ func (s *intTestSuite) TestFromUint64() { } } +func (s *intTestSuite) TestNewIntFromBigInt() { + i := math.NewIntFromBigInt(nil) + s.Require().True(i.IsNil()) + + r := big.NewInt(42) + i = math.NewIntFromBigInt(r) + s.Require().Equal(r, i.BigInt()) + + // modify r and ensure i doesn't change + r = r.SetInt64(100) + s.Require().NotEqual(r, i.BigInt()) +} + +func (s *intTestSuite) TestNewIntFromBigIntMut() { + im := math.NewIntFromBigIntMut(nil) + s.Require().True(im.IsNil()) + + r := big.NewInt(42) + im = math.NewIntFromBigIntMut(r) + s.Require().Equal(r, im.BigInt()) + + // Compare value of NewIntFromBigInt and NewIntFromBigIntMut + i := math.NewIntFromBigInt(r) + s.Require().Equal(i, im) + + // modify r and ensure i doesn't change & im changes + r = r.SetInt64(100) + s.Require().NotEqual(r, i.BigInt()) + s.Require().Equal(r, im.BigInt()) +} + +func (s *intTestSuite) TestConvertToBigIntMutative() { + r := big.NewInt(42) + i := math.NewIntFromBigInt(r) + + // Compare value of BigInt & BigIntMut + s.Require().Equal(i.BigInt(), i.BigIntMut()) + + // Modify BigIntMut() pointer and ensure i.BigIntMut() & i.BigInt() change + p := i.BigIntMut() + p.SetInt64(50) + s.Require().Equal(big.NewInt(50), i.BigIntMut()) + s.Require().Equal(big.NewInt(50), i.BigInt()) + + // Modify big.Int() pointer and ensure i.BigIntMut() & i.BigInt() don't change + p = i.BigInt() + p.SetInt64(60) + s.Require().NotEqual(big.NewInt(60), i.BigIntMut()) + s.Require().NotEqual(big.NewInt(60), i.BigInt()) +} + func (s *intTestSuite) TestIntPanic() { // Max Int = 2^256-1 = 1.1579209e+77 // Min Int = -(2^256-1) = -1.1579209e+77 @@ -60,32 +111,66 @@ func (s *intTestSuite) TestIntPanic() { s.Require().NotPanics(func() { i1.Add(i1) }) s.Require().NotPanics(func() { i2.Add(i2) }) s.Require().Panics(func() { i3.Add(i3) }) + _, err := i1.SafeAdd(i1) + s.Require().Nil(err) + _, err = i2.SafeAdd(i2) + s.Require().Nil(err) + _, err = i3.SafeAdd(i3) + s.Require().Error(err) s.Require().NotPanics(func() { i1.Sub(i1.Neg()) }) s.Require().NotPanics(func() { i2.Sub(i2.Neg()) }) s.Require().Panics(func() { i3.Sub(i3.Neg()) }) + _, err = i1.SafeSub(i1.Neg()) + s.Require().Nil(err) + _, err = i2.SafeSub(i2.Neg()) + s.Require().Nil(err) + _, err = i3.SafeSub(i3.Neg()) + s.Require().Error(err) s.Require().Panics(func() { i1.Mul(i1) }) s.Require().Panics(func() { i2.Mul(i2) }) s.Require().Panics(func() { i3.Mul(i3) }) + _, err = i1.SafeMul(i1) + s.Require().Error(err) + _, err = i2.SafeMul(i2) + s.Require().Error(err) + _, err = i3.SafeMul(i3) + s.Require().Error(err) s.Require().Panics(func() { i1.Neg().Mul(i1.Neg()) }) s.Require().Panics(func() { i2.Neg().Mul(i2.Neg()) }) s.Require().Panics(func() { i3.Neg().Mul(i3.Neg()) }) - - // // Underflow check + _, err = i1.Neg().SafeMul(i1.Neg()) + s.Require().Error(err) + _, err = i2.Neg().SafeMul(i2.Neg()) + s.Require().Error(err) + _, err = i3.Neg().SafeMul(i3.Neg()) + s.Require().Error(err) + + // Underflow check i3n := i3.Neg() s.Require().NotPanics(func() { i3n.Sub(i1) }) s.Require().NotPanics(func() { i3n.Sub(i2) }) s.Require().Panics(func() { i3n.Sub(i3) }) + _, err = i3n.SafeSub(i3) + s.Require().Error(err) s.Require().NotPanics(func() { i3n.Add(i1.Neg()) }) s.Require().NotPanics(func() { i3n.Add(i2.Neg()) }) s.Require().Panics(func() { i3n.Add(i3.Neg()) }) + _, err = i3n.SafeAdd(i3.Neg()) + s.Require().Error(err) s.Require().Panics(func() { i1.Mul(i1.Neg()) }) s.Require().Panics(func() { i2.Mul(i2.Neg()) }) s.Require().Panics(func() { i3.Mul(i3.Neg()) }) + _, err = i1.SafeMul(i1.Neg()) + s.Require().Error(err) + _, err = i2.SafeMul(i2.Neg()) + s.Require().Error(err) + _, err = i3.SafeMul(i3.Neg()) + s.Require().Error(err) // Bound check intmax := math.NewIntFromBigInt(new(big.Int).Sub(new(big.Int).Exp(big.NewInt(2), big.NewInt(256), nil), big.NewInt(1))) @@ -94,12 +179,18 @@ func (s *intTestSuite) TestIntPanic() { s.Require().NotPanics(func() { intmin.Sub(math.ZeroInt()) }) s.Require().Panics(func() { intmax.Add(math.OneInt()) }) s.Require().Panics(func() { intmin.Sub(math.OneInt()) }) + _, err = intmax.SafeAdd(math.OneInt()) + s.Require().Error(err) + _, err = intmin.SafeSub(math.OneInt()) + s.Require().Error(err) s.Require().NotPanics(func() { math.NewIntFromBigInt(nil) }) s.Require().True(math.NewIntFromBigInt(nil).IsNil()) // Division-by-zero check s.Require().Panics(func() { i1.Quo(math.NewInt(0)) }) + _, err = i1.SafeQuo(math.NewInt(0)) + s.Require().Error(err) s.Require().NotPanics(func() { math.Int{}.BigInt() }) } @@ -408,7 +499,6 @@ func TestRoundTripMarshalToInt(t *testing.T) { } for _, value := range values { - value := value t.Run(fmt.Sprintf("%d", value), func(t *testing.T) { t.Parallel() @@ -457,7 +547,6 @@ func TestFormatIntNonDigits(t *testing.T) { } for _, value := range badCases { - value := value t.Run(value, func(t *testing.T) { s, err := math.FormatInt(value) if err == nil { @@ -500,7 +589,6 @@ func TestFormatIntCorrectness(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.in, func(t *testing.T) { got, err := math.FormatInt(tt.in) if err != nil { @@ -513,3 +601,108 @@ func TestFormatIntCorrectness(t *testing.T) { }) } } + +var sizeTests = []struct { + s string + want int +}{ + {"", 1}, + {"0", 1}, + {"-0", 1}, + {"-10", 3}, + {"-10000", 6}, + {"10000", 5}, + {"100000", 6}, + {"99999", 5}, + {"9999999999", 10}, + {"10000000000", 11}, + {"99999999999", 11}, + {"999999999999", 12}, + {"9999999999999", 13}, + {"99999999999999", 14}, + {"999999999999999", 15}, + {"1000000000000000", 16}, + {"9999999999999999", 16}, + {"99999999999999999", 17}, + {"999999999999999999", 18}, + {"-999999999999999999", 19}, + {"9000000000000000000", 19}, + {"-9999999999999990000", 20}, + {"9999999999999990000", 19}, + {"9999999999999999000", 19}, + {"9999999999999999999", 19}, + {"-9999999999999999999", 20}, + {"18446744073709551616", 20}, + {"18446744073709551618", 20}, + {"184467440737095516181", 21}, + {"100000000000000000000000", 24}, + {"1000000000000000000000000000", 28}, + {"9000000000099999999999999999", 28}, + {"9999999999999999999999999999", 28}, + {"9903520314283042199192993792", 28}, + {"340282366920938463463374607431768211456", 39}, + {"3402823669209384634633746074317682114569999", 43}, + {"9999999999999999999999999999999999999999999", 43}, + {"99999999999999999999999999999999999999999999", 44}, + {"999999999999999999999999999999999999999999999", 45}, + {"90000000000999999999999999999000000000099999999999999999", 56}, + {"-90000000000999999999999999999000000000099999999999999999", 57}, + {"9000000000099999999999999999900000000009999999999999999990", 58}, + {"990000000009999999999999999990000000000999999999999999999999", 60}, + {"99000000000999999999999999999000000000099999999999999999999919", 62}, + {"90000000000999999990000000000000000000000000000000000000000000", 62}, + {"99999999999999999999999999990000000000000000000000000000000000", 62}, + {"11111111111111119999999999990000000000000000000000000000000000", 62}, + {"99000000000999999999999999999000000000099999999999999999999919", 62}, + {"10000000000000000000000000000000000000000000000000000000000000", 62}, + {"10000000000000000000000000000000000000000000000000000000000000000000000000000", 77}, + {"99999999999999999999999999999999999999999999999999999999999999999999999999999", 77}, + {"110000000000000000000000000000000000000000000000000000000000000000000000000009", 78}, +} + +func TestNewIntFromString(t *testing.T) { + for _, st := range sizeTests { + ii, _ := math.NewIntFromString(st.s) + require.Equal(t, st.want, ii.Size(), "size mismatch for %q", st.s) + } +} + +func BenchmarkIntSize(b *testing.B) { + b.ReportAllocs() + for i := 0; i < b.N; i++ { + for _, st := range sizeTests { + ii, _ := math.NewIntFromString(st.s) + got := ii.Size() + if got != st.want { + b.Errorf("%q:: got=%d, want=%d", st.s, got, st.want) + } + sink = got + } + } + if sink == nil { + b.Fatal("Benchmark did not run!") + } + sink = nil +} + +func BenchmarkIntOverflowCheckTime(b *testing.B) { + ints := []*big.Int{} + + for _, st := range sizeTests { + ii, _ := math.NewIntFromString(st.s) + ints = append(ints, ii.BigInt()) + } + b.ResetTimer() + + b.ReportAllocs() + for i := 0; i < b.N; i++ { + for j := range sizeTests { + got := math.NewIntFromBigIntMut(ints[j]) + sink = got + } + } + if sink == nil { + b.Fatal("Benchmark did not run!") + } + sink = nil +} diff --git a/math/legacy_dec.go b/math/legacy_dec.go new file mode 100644 index 000000000000..16bb0806861b --- /dev/null +++ b/math/legacy_dec.go @@ -0,0 +1,971 @@ +package math + +import ( + "encoding/json" + "errors" + "fmt" + "math/big" + "strconv" + "strings" + "testing" +) + +// LegacyDec NOTE: never use new(Dec) or else we will panic unmarshalling into the +// nil embedded big.Int +type LegacyDec struct { + i *big.Int +} + +const ( + // LegacyPrecision number of decimal places + LegacyPrecision = 18 + + // LegacyDecimalPrecisionBits bits required to represent the above precision + // Ceiling[Log2[10^Precision - 1]] + // Deprecated: This is unused and will be removed + LegacyDecimalPrecisionBits = 60 + + // maxApproxRootIterations max number of iterations in ApproxRoot function + maxApproxRootIterations = 300 +) + +var ( + precisionReuse = new(big.Int).Exp(big.NewInt(10), big.NewInt(LegacyPrecision), nil) + fivePrecision = new(big.Int).Quo(precisionReuse, big.NewInt(2)) + + upperLimit LegacyDec + lowerLimit LegacyDec + + precisionMultipliers []*big.Int + zeroInt = big.NewInt(0) + oneInt = big.NewInt(1) + tenInt = big.NewInt(10) + smallestDec = LegacySmallestDec() +) + +// Decimal errors +var ( + ErrLegacyEmptyDecimalStr = errors.New("decimal string cannot be empty") + ErrLegacyInvalidDecimalLength = errors.New("invalid decimal length") + ErrLegacyInvalidDecimalStr = errors.New("invalid decimal string") +) + +// Set precision multipliers +func init() { + precisionMultipliers = make([]*big.Int, LegacyPrecision+1) + for i := 0; i <= LegacyPrecision; i++ { + precisionMultipliers[i] = calcPrecisionMultiplier(int64(i)) + } + // 2^256 * 10^18 -1 + tmp := new(big.Int).Exp(big.NewInt(2), big.NewInt(256), nil) + tmp = new(big.Int).Sub(new(big.Int).Mul(tmp, precisionReuse), big.NewInt(1)) + upperLimit = LegacyNewDecFromBigIntWithPrec(tmp, LegacyPrecision) + lowerLimit = upperLimit.Neg() +} + +func precisionInt() *big.Int { + return new(big.Int).Set(precisionReuse) +} + +func LegacyZeroDec() LegacyDec { return LegacyDec{new(big.Int).Set(zeroInt)} } +func LegacyOneDec() LegacyDec { return LegacyDec{precisionInt()} } +func LegacySmallestDec() LegacyDec { return LegacyDec{new(big.Int).Set(oneInt)} } + +// calculate the precision multiplier +func calcPrecisionMultiplier(prec int64) *big.Int { + if prec < 0 { + panic(fmt.Sprintf("negative precision %v", prec)) + } + + if prec > LegacyPrecision { + panic(fmt.Sprintf("too much precision, maximum %v, provided %v", LegacyPrecision, prec)) + } + zerosToAdd := LegacyPrecision - prec + multiplier := new(big.Int).Exp(tenInt, big.NewInt(zerosToAdd), nil) + return multiplier +} + +// get the precision multiplier, do not mutate result +func precisionMultiplier(prec int64) *big.Int { + if prec < 0 { + panic(fmt.Sprintf("negative precision %v", prec)) + } + + if prec > LegacyPrecision { + panic(fmt.Sprintf("too much precision, maximum %v, provided %v", LegacyPrecision, prec)) + } + return precisionMultipliers[prec] +} + +// LegacyNewDec create a new Dec from integer assuming whole number +func LegacyNewDec(i int64) LegacyDec { + return LegacyNewDecWithPrec(i, 0) +} + +// LegacyNewDecWithPrec create a new Dec from integer with decimal place at prec +// CONTRACT: prec <= Precision +func LegacyNewDecWithPrec(i, prec int64) LegacyDec { + bi := big.NewInt(i) + return LegacyDec{ + bi.Mul(bi, precisionMultiplier(prec)), + } +} + +// LegacyNewDecFromBigInt create a new Dec from big integer assuming whole numbers +// CONTRACT: prec <= Precision +func LegacyNewDecFromBigInt(i *big.Int) LegacyDec { + return LegacyNewDecFromBigIntWithPrec(i, 0) +} + +// LegacyNewDecFromBigIntWithPrec create a new Dec from big integer assuming whole numbers +// CONTRACT: prec <= Precision +func LegacyNewDecFromBigIntWithPrec(i *big.Int, prec int64) LegacyDec { + return LegacyDec{ + new(big.Int).Mul(i, precisionMultiplier(prec)), + } +} + +// LegacyNewDecFromInt create a new Dec from big integer assuming whole numbers +// CONTRACT: prec <= Precision +func LegacyNewDecFromInt(i Int) LegacyDec { + return LegacyNewDecFromIntWithPrec(i, 0) +} + +// LegacyNewDecFromIntWithPrec create a new Dec from big integer with decimal place at prec +// CONTRACT: prec <= Precision +func LegacyNewDecFromIntWithPrec(i Int, prec int64) LegacyDec { + return LegacyDec{ + new(big.Int).Mul(i.BigIntMut(), precisionMultiplier(prec)), + } +} + +// LegacyNewDecFromStr create a decimal from an input decimal string. +// valid must come in the form: +// +// (-) whole integers (.) decimal integers +// +// examples of acceptable input include: +// +// -123.456 +// 456.7890 +// 345 +// -456789 +// +// NOTE - An error will return if more decimal places +// are provided in the string than the constant Precision. +// +// CONTRACT - This function does not mutate the input str. +func LegacyNewDecFromStr(str string) (LegacyDec, error) { + // first extract any negative symbol + neg := false + if len(str) > 0 && str[0] == '-' { + neg = true + str = str[1:] + } + + if len(str) == 0 { + return LegacyDec{}, ErrLegacyEmptyDecimalStr + } + + strs := strings.Split(str, ".") + lenDecs := 0 + combinedStr := strs[0] + + if len(strs) == 2 { // has a decimal place + lenDecs = len(strs[1]) + if lenDecs == 0 || len(combinedStr) == 0 { + return LegacyDec{}, ErrLegacyInvalidDecimalLength + } + combinedStr += strs[1] + } else if len(strs) > 2 { + return LegacyDec{}, ErrLegacyInvalidDecimalStr + } + + if lenDecs > LegacyPrecision { + return LegacyDec{}, fmt.Errorf("value '%s' exceeds max precision by %d decimal places: max precision %d", str, LegacyPrecision-lenDecs, LegacyPrecision) + } + + // add some extra zero's to correct to the Precision factor + zerosToAdd := LegacyPrecision - lenDecs + zeros := strings.Repeat("0", zerosToAdd) + combinedStr += zeros + + combined, ok := new(big.Int).SetString(combinedStr, 10) // base 10 + if !ok { + return LegacyDec{}, fmt.Errorf("failed to set decimal string with base 10: %s", combinedStr) + } + if neg { + combined = new(big.Int).Neg(combined) + } + + result := LegacyDec{i: combined} + if !result.IsInValidRange() { + return LegacyDec{}, fmt.Errorf("out of range: %w", ErrLegacyInvalidDecimalStr) + } + return result, nil +} + +// LegacyMustNewDecFromStr Decimal from string, panic on error +func LegacyMustNewDecFromStr(s string) LegacyDec { + dec, err := LegacyNewDecFromStr(s) + if err != nil { + panic(err) + } + return dec +} + +func (d LegacyDec) IsNil() bool { return d.i == nil } // is decimal nil +func (d LegacyDec) IsZero() bool { return (d.i).Sign() == 0 } // is equal to zero +func (d LegacyDec) IsNegative() bool { return (d.i).Sign() == -1 } // is negative +func (d LegacyDec) IsPositive() bool { return (d.i).Sign() == 1 } // is positive +func (d LegacyDec) Equal(d2 LegacyDec) bool { return (d.i).Cmp(d2.i) == 0 } // equal decimals +func (d LegacyDec) GT(d2 LegacyDec) bool { return (d.i).Cmp(d2.i) > 0 } // greater than +func (d LegacyDec) GTE(d2 LegacyDec) bool { return (d.i).Cmp(d2.i) >= 0 } // greater than or equal +func (d LegacyDec) LT(d2 LegacyDec) bool { return (d.i).Cmp(d2.i) < 0 } // less than +func (d LegacyDec) LTE(d2 LegacyDec) bool { return (d.i).Cmp(d2.i) <= 0 } // less than or equal +func (d LegacyDec) Neg() LegacyDec { return LegacyDec{new(big.Int).Neg(d.i)} } // reverse the decimal sign +func (d LegacyDec) NegMut() LegacyDec { d.i.Neg(d.i); return d } // reverse the decimal sign, mutable +func (d LegacyDec) Abs() LegacyDec { return LegacyDec{new(big.Int).Abs(d.i)} } // absolute value +func (d LegacyDec) AbsMut() LegacyDec { d.i.Abs(d.i); return d } // absolute value, mutable +func (d LegacyDec) Set(d2 LegacyDec) LegacyDec { d.i.Set(d2.i); return d } // set to existing dec value +func (d LegacyDec) Clone() LegacyDec { return LegacyDec{new(big.Int).Set(d.i)} } // clone new dec + +// BigInt returns a copy of the underlying big.Int. +func (d LegacyDec) BigInt() *big.Int { + if d.IsNil() { + return nil + } + + cp := new(big.Int) + return cp.Set(d.i) +} + +// BigIntMut converts LegacyDec to big.Int, mutative the input +func (d LegacyDec) BigIntMut() *big.Int { + if d.IsNil() { + return nil + } + + return d.i +} + +func (d LegacyDec) ImmutOp(op func(LegacyDec, LegacyDec) LegacyDec, d2 LegacyDec) LegacyDec { + return op(d.Clone(), d2) +} + +func (d LegacyDec) ImmutOpInt(op func(LegacyDec, Int) LegacyDec, d2 Int) LegacyDec { + return op(d.Clone(), d2) +} + +func (d LegacyDec) ImmutOpInt64(op func(LegacyDec, int64) LegacyDec, d2 int64) LegacyDec { + // TODO: use already allocated operand bigint to avoid + // newint each time, add mutex for race condition + // Issue: https://github.com/cosmos/cosmos-sdk/issues/11166 + return op(d.Clone(), d2) +} + +func (d LegacyDec) SetInt64(i int64) LegacyDec { + d.i.SetInt64(i) + d.i.Mul(d.i, precisionReuse) + return d +} + +// Add addition +func (d LegacyDec) Add(d2 LegacyDec) LegacyDec { + return d.ImmutOp(LegacyDec.AddMut, d2) +} + +// AddMut mutable addition +func (d LegacyDec) AddMut(d2 LegacyDec) LegacyDec { + d.i.Add(d.i, d2.i) + + d.assertInValidRange() + return d +} + +// Sub subtraction +func (d LegacyDec) Sub(d2 LegacyDec) LegacyDec { + return d.ImmutOp(LegacyDec.SubMut, d2) +} + +// SubMut mutable subtraction +func (d LegacyDec) SubMut(d2 LegacyDec) LegacyDec { + d.i.Sub(d.i, d2.i) + + d.assertInValidRange() + return d +} + +func (d LegacyDec) assertInValidRange() { + if !d.IsInValidRange() { + panic("Int overflow") + } +} + +// IsInValidRange returns true when the value is between the upper limit of (2^256 * 10^18) +// and the lower limit of -1*(2^256 * 10^18). +func (d LegacyDec) IsInValidRange() bool { + return !(d.GT(upperLimit) || d.LT(lowerLimit)) +} + +// Mul multiplication +func (d LegacyDec) Mul(d2 LegacyDec) LegacyDec { + return d.ImmutOp(LegacyDec.MulMut, d2) +} + +// MulMut mutable multiplication +func (d LegacyDec) MulMut(d2 LegacyDec) LegacyDec { + d.i.Mul(d.i, d2.i) + chopped := chopPrecisionAndRound(d.i) + + *d.i = *chopped + d.assertInValidRange() + return d +} + +// MulTruncate multiplication truncate +func (d LegacyDec) MulTruncate(d2 LegacyDec) LegacyDec { + return d.ImmutOp(LegacyDec.MulTruncateMut, d2) +} + +// MulTruncateMut mutable multiplication truncate +func (d LegacyDec) MulTruncateMut(d2 LegacyDec) LegacyDec { + d.i.Mul(d.i, d2.i) + chopPrecisionAndTruncate(d.i) + d.assertInValidRange() + return d +} + +// MulRoundUp multiplication round up at precision end. +func (d LegacyDec) MulRoundUp(d2 LegacyDec) LegacyDec { + return d.ImmutOp(LegacyDec.MulRoundUpMut, d2) +} + +// MulRoundUpMut mutable multiplication with round up at precision end. +func (d LegacyDec) MulRoundUpMut(d2 LegacyDec) LegacyDec { + d.i.Mul(d.i, d2.i) + chopPrecisionAndRoundUp(d.i) + + d.assertInValidRange() + return d +} + +// MulInt multiplication +func (d LegacyDec) MulInt(i Int) LegacyDec { + return d.ImmutOpInt(LegacyDec.MulIntMut, i) +} + +func (d LegacyDec) MulIntMut(i Int) LegacyDec { + d.i.Mul(d.i, i.BigIntMut()) + d.assertInValidRange() + return d +} + +// MulInt64 multiplication with int64 +func (d LegacyDec) MulInt64(i int64) LegacyDec { + return d.ImmutOpInt64(LegacyDec.MulInt64Mut, i) +} + +func (d LegacyDec) MulInt64Mut(i int64) LegacyDec { + d.i.Mul(d.i, big.NewInt(i)) + d.assertInValidRange() + return d +} + +// Quo quotient +func (d LegacyDec) Quo(d2 LegacyDec) LegacyDec { + return d.ImmutOp(LegacyDec.QuoMut, d2) +} + +var squaredPrecisionReuse = new(big.Int).Mul(precisionReuse, precisionReuse) + +// QuoMut mutable quotient +func (d LegacyDec) QuoMut(d2 LegacyDec) LegacyDec { + // multiply by precision twice + d.i.Mul(d.i, squaredPrecisionReuse) + d.i.Quo(d.i, d2.i) + + chopPrecisionAndRound(d.i) + d.assertInValidRange() + return d +} + +// QuoTruncate quotient truncate +func (d LegacyDec) QuoTruncate(d2 LegacyDec) LegacyDec { + return d.ImmutOp(LegacyDec.QuoTruncateMut, d2) +} + +// QuoTruncateMut divides the current LegacyDec value by the provided LegacyDec value, truncating the result. +func (d LegacyDec) QuoTruncateMut(d2 LegacyDec) LegacyDec { + // multiply precision once before performing division + d.i.Mul(d.i, precisionReuse) + d.i.Quo(d.i, d2.i) + + d.assertInValidRange() + return d +} + +// QuoRoundUp quotient, round up +func (d LegacyDec) QuoRoundUp(d2 LegacyDec) LegacyDec { + return d.ImmutOp(LegacyDec.QuoRoundupMut, d2) +} + +// QuoRoundupMut mutable quotient, round up +func (d LegacyDec) QuoRoundupMut(d2 LegacyDec) LegacyDec { + // multiply precision twice + d.i.Mul(d.i, precisionReuse) + _, rem := d.i.QuoRem(d.i, d2.i, big.NewInt(0)) + if rem.Sign() > 0 && d.IsNegative() == d2.IsNegative() || + rem.Sign() < 0 && d.IsNegative() != d2.IsNegative() { + d.i.Add(d.i, oneInt) + } + d.assertInValidRange() + return d +} + +// QuoInt quotient +func (d LegacyDec) QuoInt(i Int) LegacyDec { + return d.ImmutOpInt(LegacyDec.QuoIntMut, i) +} + +func (d LegacyDec) QuoIntMut(i Int) LegacyDec { + d.i.Quo(d.i, i.BigIntMut()) + return d +} + +// QuoInt64 quotient with int64 +func (d LegacyDec) QuoInt64(i int64) LegacyDec { + return d.ImmutOpInt64(LegacyDec.QuoInt64Mut, i) +} + +func (d LegacyDec) QuoInt64Mut(i int64) LegacyDec { + d.i.Quo(d.i, big.NewInt(i)) + return d +} + +// ApproxRoot returns an approximate estimation of a Dec's positive real nth root +// using Newton's method (where n is positive). The algorithm starts with some guess and +// computes the sequence of improved guesses until an answer converges to an +// approximate answer. It returns `|d|.ApproxRoot() * -1` if input is negative. +// A maximum number of 100 iterations is used a backup boundary condition for +// cases where the answer never converges enough to satisfy the main condition. +func (d LegacyDec) ApproxRoot(root uint64) (guess LegacyDec, err error) { + defer func() { + if r := recover(); r != nil { + var ok bool + err, ok = r.(error) + if !ok { + err = errors.New("out of bounds") + } + } + }() + + if root == 0 { + // Return 1 as root 0 of any number is considered 1. + return LegacyOneDec(), nil + } + + if d.IsNegative() { + absRoot, err := d.Neg().ApproxRoot(root) + return absRoot.NegMut(), err + } + + // Direct return for base cases: d^1 = d or when d is 0 or 1. + scratchOneDec := LegacyOneDec() + if root == 1 || d.IsZero() || d.Equal(scratchOneDec) { + return d, nil + } + + guess, delta := scratchOneDec, LegacyOneDec() + + for iter := 0; iter < maxApproxRootIterations; iter++ { + prev := guess.Power(root - 1) + if prev.IsZero() { + prev = smallestDec + } + + // Compute delta = (d/prev - guess) / root + delta.Set(d).QuoMut(prev) + delta.SubMut(guess) + delta.QuoInt64Mut(int64(root)) + + guess.AddMut(delta) + + // Stop when delta is small enough + if delta.Abs().LTE(smallestDec) { + break + } + } + + return guess, nil +} + +// Power returns the result of raising to a positive integer power +func (d LegacyDec) Power(power uint64) LegacyDec { + res := LegacyDec{new(big.Int).Set(d.i)} + return res.PowerMut(power) +} + +func (d LegacyDec) PowerMut(power uint64) LegacyDec { + if power == 0 { + // Set to 1 with the correct precision. + d.i.Set(precisionReuse) + return d + } + tmp := LegacyOneDec() + + for i := power; i > 1; { + if i%2 != 0 { + tmp.MulMut(d) + } + i /= 2 + d.MulMut(d) + } + + return d.MulMut(tmp) +} + +// ApproxSqrt is a wrapper around ApproxRoot for the common special case +// of finding the square root of a number. It returns -(sqrt(abs(d)) if input is negative. +func (d LegacyDec) ApproxSqrt() (LegacyDec, error) { + return d.ApproxRoot(2) +} + +// IsInteger is integer, e.g. decimals are zero +func (d LegacyDec) IsInteger() bool { + return new(big.Int).Rem(d.i, precisionReuse).Sign() == 0 +} + +// Format format decimal state +func (d LegacyDec) Format(s fmt.State, verb rune) { + _, err := s.Write([]byte(d.String())) + if err != nil { + panic(err) + } +} + +func (d LegacyDec) String() string { + if d.i == nil { + return d.i.String() + } + + isNeg := d.IsNegative() + + if isNeg { + d = d.Neg() + } + + bzInt, err := d.i.MarshalText() + if err != nil { + return "" + } + inputSize := len(bzInt) + + var bzStr []byte + + // TODO: Remove trailing zeros + // case 1, purely decimal + if inputSize <= LegacyPrecision { + bzStr = make([]byte, LegacyPrecision+2) + + // 0. prefix + bzStr[0] = byte('0') + bzStr[1] = byte('.') + + // set relevant digits to 0 + for i := 0; i < LegacyPrecision-inputSize; i++ { + bzStr[i+2] = byte('0') + } + + // set final digits + copy(bzStr[2+(LegacyPrecision-inputSize):], bzInt) + } else { + // inputSize + 1 to account for the decimal point that is being added + bzStr = make([]byte, inputSize+1) + decPointPlace := inputSize - LegacyPrecision + + copy(bzStr, bzInt[:decPointPlace]) // pre-decimal digits + bzStr[decPointPlace] = byte('.') // decimal point + copy(bzStr[decPointPlace+1:], bzInt[decPointPlace:]) // post-decimal digits + } + + if isNeg { + return "-" + string(bzStr) + } + + return string(bzStr) +} + +// Float64 returns the float64 representation of a Dec. +// Will return the error if the conversion failed. +func (d LegacyDec) Float64() (float64, error) { + return strconv.ParseFloat(d.String(), 64) +} + +// MustFloat64 returns the float64 representation of a Dec. +// Would panic if the conversion failed. +func (d LegacyDec) MustFloat64() float64 { + if value, err := strconv.ParseFloat(d.String(), 64); err != nil { + panic(err) + } else { + return value + } +} + +// ____ +// __| |__ "chop 'em +// ` \ round!" +// ___|| ~ _ -bankers +// | | __ +// | | | __|__|__ +// |_____: / | $$$ | +// |________| + +// Remove a Precision amount of rightmost digits and perform bankers rounding +// on the remainder (gaussian rounding) on the digits which have been removed. +// +// Mutates the input. Use the non-mutative version if that is undesired +func chopPrecisionAndRound(d *big.Int) *big.Int { + // remove the negative and add it back when returning + if d.Sign() == -1 { + // make d positive, compute chopped value, and then un-mutate d + d = d.Neg(d) + d = chopPrecisionAndRound(d) + d = d.Neg(d) + return d + } + + // get the truncated quotient and remainder + quo, rem := d, big.NewInt(0) + quo, rem = quo.QuoRem(d, precisionReuse, rem) + + if rem.Sign() == 0 { // remainder is zero + return quo + } + + switch rem.Cmp(fivePrecision) { + case -1: + return quo + case 1: + return quo.Add(quo, oneInt) + default: // bankers rounding must take place + // always round to an even number + if quo.Bit(0) == 0 { + return quo + } + return quo.Add(quo, oneInt) + } +} + +func chopPrecisionAndRoundUp(d *big.Int) *big.Int { + // remove the negative and add it back when returning + if d.Sign() == -1 { + // make d positive, compute chopped value, and then un-mutate d + d = d.Neg(d) + // truncate since d is negative... + chopPrecisionAndTruncate(d) + d = d.Neg(d) + return d + } + + // get the truncated quotient and remainder + quo, rem := d, big.NewInt(0) + quo, rem = quo.QuoRem(d, precisionReuse, rem) + + if rem.Sign() == 0 { // remainder is zero + return quo + } + + return quo.Add(quo, oneInt) +} + +func chopPrecisionAndRoundNonMutative(d *big.Int) *big.Int { + tmp := new(big.Int).Set(d) + return chopPrecisionAndRound(tmp) +} + +// RoundInt64 rounds the decimal using bankers rounding +func (d LegacyDec) RoundInt64() int64 { + chopped := chopPrecisionAndRoundNonMutative(d.i) + if !chopped.IsInt64() { + panic("Int64() out of bound") + } + return chopped.Int64() +} + +// RoundInt round the decimal using bankers rounding +func (d LegacyDec) RoundInt() Int { + return NewIntFromBigIntMut(chopPrecisionAndRoundNonMutative(d.i)) +} + +// chopPrecisionAndTruncate is similar to chopPrecisionAndRound, +// but always rounds down. It does not mutate the input. +func chopPrecisionAndTruncate(d *big.Int) { + d.Quo(d, precisionReuse) +} + +func chopPrecisionAndTruncateNonMutative(d *big.Int) *big.Int { + tmp := new(big.Int).Set(d) + chopPrecisionAndTruncate(tmp) + return tmp +} + +// TruncateInt64 truncates the decimals from the number and returns an int64 +func (d LegacyDec) TruncateInt64() int64 { + chopped := chopPrecisionAndTruncateNonMutative(d.i) + if !chopped.IsInt64() { + panic("Int64() out of bound") + } + return chopped.Int64() +} + +// TruncateInt truncates the decimals from the number and returns an Int +func (d LegacyDec) TruncateInt() Int { + return NewIntFromBigIntMut(chopPrecisionAndTruncateNonMutative(d.i)) +} + +// TruncateDec truncates the decimals from the number and returns a Dec +func (d LegacyDec) TruncateDec() LegacyDec { + return LegacyNewDecFromBigInt(chopPrecisionAndTruncateNonMutative(d.i)) +} + +// Ceil returns the smallest integer value (as a decimal) that is greater than +// or equal to the given decimal. +func (d LegacyDec) Ceil() LegacyDec { + tmp := new(big.Int).Set(d.i) + + quo, rem := tmp, big.NewInt(0) + quo, rem = quo.QuoRem(tmp, precisionReuse, rem) + + // no need to round with a zero remainder regardless of sign + var r LegacyDec + switch rem.Sign() { + case 0: + r = LegacyNewDecFromBigInt(quo) + case -1: + r = LegacyNewDecFromBigInt(quo) + default: + r = LegacyNewDecFromBigInt(quo.Add(quo, oneInt)) + } + r.assertInValidRange() + return r +} + +// LegacyMaxSortableDec is the largest Dec that can be passed into SortableDecBytes() +// Its negative form is the least Dec that can be passed in. +var LegacyMaxSortableDec LegacyDec + +func init() { + LegacyMaxSortableDec = LegacyOneDec().Quo(LegacySmallestDec()) +} + +// LegacyValidSortableDec ensures that a Dec is within the sortable bounds, +// a Dec can't have a precision of less than 10^-18. +// Max sortable decimal was set to the reciprocal of SmallestDec. +func LegacyValidSortableDec(dec LegacyDec) bool { + return dec.Abs().LTE(LegacyMaxSortableDec) +} + +// LegacySortableDecBytes returns a byte slice representation of a Dec that can be sorted. +// Left and right pads with 0s so there are 18 digits to left and right of the decimal point. +// For this reason, there is a maximum and minimum value for this, enforced by ValidSortableDec. +func LegacySortableDecBytes(dec LegacyDec) []byte { + if !LegacyValidSortableDec(dec) { + panic("dec must be within bounds") + } + // Instead of adding an extra byte to all sortable decs in order to handle max sortable, we just + // makes its bytes be "max" which comes after all numbers in ASCIIbetical order + if dec.Equal(LegacyMaxSortableDec) { + return []byte("max") + } + // For the same reason, we make the bytes of minimum sortable dec be --, which comes before all numbers. + if dec.Equal(LegacyMaxSortableDec.Neg()) { + return []byte("--") + } + // We move the negative sign to the front of all the left padded 0s, to make negative numbers come before positive numbers + if dec.IsNegative() { + return append([]byte("-"), []byte(fmt.Sprintf(fmt.Sprintf("%%0%ds", LegacyPrecision*2+1), dec.Abs().String()))...) + } + return []byte(fmt.Sprintf(fmt.Sprintf("%%0%ds", LegacyPrecision*2+1), dec.String())) +} + +// reuse nil values +var nilJSON []byte + +func init() { + empty := new(big.Int) + bz, _ := empty.MarshalText() + nilJSON, _ = json.Marshal(string(bz)) +} + +// MarshalJSON marshals the decimal +func (d LegacyDec) MarshalJSON() ([]byte, error) { + if d.i == nil { + return nilJSON, nil + } + return json.Marshal(d.String()) +} + +// UnmarshalJSON defines custom decoding scheme +func (d *LegacyDec) UnmarshalJSON(bz []byte) error { + if d.i == nil { + d.i = new(big.Int) + } + + var text string + err := json.Unmarshal(bz, &text) + if err != nil { + return err + } + + // TODO: Reuse dec allocation + newDec, err := LegacyNewDecFromStr(text) + if err != nil { + return err + } + + d.i = newDec.i + return nil +} + +// MarshalYAML returns the YAML representation. +func (d LegacyDec) MarshalYAML() (interface{}, error) { + return d.String(), nil +} + +// Marshal implements the gogo proto custom type interface. +func (d LegacyDec) Marshal() ([]byte, error) { + i := d.i + if i == nil { + i = new(big.Int) + } + return i.MarshalText() +} + +// MarshalTo implements the gogo proto custom type interface. +func (d *LegacyDec) MarshalTo(data []byte) (n int, err error) { + i := d.i + if i == nil { + i = new(big.Int) + } + + if i.Sign() == 0 { + copy(data, []byte{0x30}) + return 1, nil + } + + bz, err := d.Marshal() + if err != nil { + return 0, err + } + + copy(data, bz) + return len(bz), nil +} + +// Unmarshal implements the gogo proto custom type interface. +func (d *LegacyDec) Unmarshal(data []byte) error { + if len(data) == 0 { + d = nil + return nil + } + + if d.i == nil { + d.i = new(big.Int) + } + + if err := d.i.UnmarshalText(data); err != nil { + return err + } + + if !d.IsInValidRange() { + return errors.New("decimal out of range") + } + return nil +} + +// Size implements the gogo proto custom type interface. +func (d *LegacyDec) Size() int { + bz, _ := d.Marshal() + return len(bz) +} + +// MarshalAmino Override Amino binary serialization by proxying to protobuf. +func (d LegacyDec) MarshalAmino() ([]byte, error) { return d.Marshal() } +func (d *LegacyDec) UnmarshalAmino(bz []byte) error { return d.Unmarshal(bz) } + +// helpers + +// LegacyDecsEqual return true if two decimal arrays are equal. +func LegacyDecsEqual(d1s, d2s []LegacyDec) bool { + if len(d1s) != len(d2s) { + return false + } + + for i, d1 := range d1s { + if !d1.Equal(d2s[i]) { + return false + } + } + return true +} + +// LegacyMinDec minimum decimal between two +func LegacyMinDec(d1, d2 LegacyDec) LegacyDec { + if d1.LT(d2) { + return d1 + } + return d2 +} + +// LegacyMaxDec maximum decimal between two +func LegacyMaxDec(d1, d2 LegacyDec) LegacyDec { + if d1.LT(d2) { + return d2 + } + return d1 +} + +// LegacyDecEq intended to be used with require/assert: require.True(DecEq(...)) +func LegacyDecEq(t *testing.T, exp, got LegacyDec) (*testing.T, bool, string, string, string) { + t.Helper() + return t, exp.Equal(got), "expected:\t%v\ngot:\t\t%v", exp.String(), got.String() +} + +func LegacyDecApproxEq(t *testing.T, d1, d2, tol LegacyDec) (*testing.T, bool, string, string, string) { + t.Helper() + diff := d1.Sub(d2).Abs() + return t, diff.LTE(tol), "expected |d1 - d2| <:\t%v\ngot |d1 - d2| = \t\t%v", tol.String(), diff.String() +} + +// FormatDec formats a decimal (as encoded in protobuf) into a value-rendered +// string following ADR-050. This function operates with string manipulation +// (instead of manipulating the sdk.Dec object). +func FormatDec(v string) (string, error) { + parts := strings.Split(v, ".") + if len(parts) > 2 { + return "", fmt.Errorf("invalid decimal: too many points in %s", v) + } + + intPart, err := FormatInt(parts[0]) + if err != nil { + return "", err + } + + if len(parts) == 1 { + return intPart, nil + } + + decPart := strings.TrimRight(parts[1], "0") + if len(decPart) == 0 { + return intPart, nil + } + + // Ensure that the decimal part has only digits. + // https://github.com/cosmos/cosmos-sdk/issues/12811 + if !hasOnlyDigits(decPart) { + return "", fmt.Errorf("non-digits detected after decimal point in: %q", decPart) + } + + return intPart + "." + decPart, nil +} diff --git a/math/fuzz_test.go b/math/legacy_dec_fuzz_test.go similarity index 73% rename from math/fuzz_test.go rename to math/legacy_dec_fuzz_test.go index 3fae5a7e5cfa..e50ae41bfa13 100644 --- a/math/fuzz_test.go +++ b/math/legacy_dec_fuzz_test.go @@ -22,9 +22,3 @@ func FuzzLegacyNewDecFromStr(f *testing.F) { } }) } - -func TestDecNegativePrecision(t *testing.T) { - t.Skip("https://github.com/cosmos/cosmos-sdk/issues/14004 is not yet addressed") - - LegacyNewDecWithPrec(10, -1) -} diff --git a/math/dec_internal_test.go b/math/legacy_dec_internal_test.go similarity index 99% rename from math/dec_internal_test.go rename to math/legacy_dec_internal_test.go index 8b899300e3b0..5273edfc9b5e 100644 --- a/math/dec_internal_test.go +++ b/math/legacy_dec_internal_test.go @@ -90,7 +90,6 @@ func (s *decimalInternalTestSuite) TestDecMarshalJSON() { {"12340Int", LegacyNewDec(12340), "\"12340.000000000000000000\"", false}, } for _, tt := range tests { - tt := tt s.T().Run(tt.name, func(t *testing.T) { got, err := tt.d.MarshalJSON() if (err != nil) != tt.wantErr { diff --git a/math/legacy_dec_test.go b/math/legacy_dec_test.go new file mode 100644 index 000000000000..1f0b288a080e --- /dev/null +++ b/math/legacy_dec_test.go @@ -0,0 +1,1328 @@ +package math_test + +import ( + "bytes" + "encoding/json" + "fmt" + "math/big" + "os" + "strings" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + "sigs.k8s.io/yaml" + + "cosmossdk.io/math" +) + +type decimalTestSuite struct { + suite.Suite +} + +func TestDecimalTestSuite(t *testing.T) { + suite.Run(t, new(decimalTestSuite)) +} + +func TestDecApproxEq(t *testing.T) { + // d1 = 0.55, d2 = 0.6, tol = 0.1 + d1 := math.LegacyNewDecWithPrec(55, 2) + d2 := math.LegacyNewDecWithPrec(6, 1) + tol := math.LegacyNewDecWithPrec(1, 1) + + require.True(math.LegacyDecApproxEq(t, d1, d2, tol)) + + // d1 = 0.55, d2 = 0.6, tol = 1E-5 + d1 = math.LegacyNewDecWithPrec(55, 2) + d2 = math.LegacyNewDecWithPrec(6, 1) + tol = math.LegacyNewDecWithPrec(1, 5) + + require.False(math.LegacyDecApproxEq(t, d1, d2, tol)) + + // d1 = 0.6, d2 = 0.61, tol = 0.01 + d1 = math.LegacyNewDecWithPrec(6, 1) + d2 = math.LegacyNewDecWithPrec(61, 2) + tol = math.LegacyNewDecWithPrec(1, 2) + + require.True(math.LegacyDecApproxEq(t, d1, d2, tol)) +} + +// create a decimal from a decimal string (ex. "1234.5678") +func (s *decimalTestSuite) mustNewDecFromStr(str string) (d math.LegacyDec) { + d, err := math.LegacyNewDecFromStr(str) + s.Require().NoError(err) + + return d +} + +func (s *decimalTestSuite) TestNewDecFromStr() { + largeBigInt, ok := new(big.Int).SetString("3144605511029693144278234343371835", 10) + s.Require().True(ok) + + largerBigInt, ok := new(big.Int).SetString("8888888888888888888888888888888888888888888888888888888888888888888844444440", 10) + s.Require().True(ok) + + largestBigInt, ok := new(big.Int).SetString("33499189745056880149688856635597007162669032647290798121690100488888732861290034376435130433535", 10) + s.Require().True(ok) + + tests := []struct { + decimalStr string + expErr bool + exp math.LegacyDec + }{ + {"", true, math.LegacyDec{}}, + {"0.-75", true, math.LegacyDec{}}, + {"0", false, math.LegacyNewDec(0)}, + {"1", false, math.LegacyNewDec(1)}, + {"1.1", false, math.LegacyNewDecWithPrec(11, 1)}, + {"0.75", false, math.LegacyNewDecWithPrec(75, 2)}, + {"0.8", false, math.LegacyNewDecWithPrec(8, 1)}, + {"0.11111", false, math.LegacyNewDecWithPrec(11111, 5)}, + {"314460551102969.3144278234343371835", true, math.LegacyNewDec(3141203149163817869)}, + { + "314460551102969314427823434337.1835718092488231350", + true, math.LegacyNewDecFromBigIntWithPrec(largeBigInt, 4), + }, + { + "314460551102969314427823434337.1835", + false, math.LegacyNewDecFromBigIntWithPrec(largeBigInt, 4), + }, + {".", true, math.LegacyDec{}}, + {".0", true, math.LegacyNewDec(0)}, + {"1.", true, math.LegacyNewDec(1)}, + {"foobar", true, math.LegacyDec{}}, + {"0.foobar", true, math.LegacyDec{}}, + {"0.foobar.", true, math.LegacyDec{}}, + {"8888888888888888888888888888888888888888888888888888888888888888888844444440", false, math.LegacyNewDecFromBigInt(largerBigInt)}, + {"33499189745056880149688856635597007162669032647290798121690100488888732861290.034376435130433535", false, math.LegacyNewDecFromBigIntWithPrec(largestBigInt, 18)}, + {"133499189745056880149688856635597007162669032647290798121690100488888732861291", true, math.LegacyDec{}}, + {"115792089237316195423570985008687907853269984665640564039457584007913129639936", true, math.LegacyDec{}}, // 2^256 + } + + for tcIndex, tc := range tests { + res, err := math.LegacyNewDecFromStr(tc.decimalStr) + if tc.expErr { + s.Require().NotNil(err, "error expected, decimalStr %v, tc %v", tc.decimalStr, tcIndex) + } else { + s.Require().Nil(err, "unexpected error, decimalStr %v, tc %v", tc.decimalStr, tcIndex) + s.Require().True(res.Equal(tc.exp), "equality was incorrect, res %v, expTruncated %v, tc %v", res, tc.exp, tcIndex) + } + + // negative tc + res, err = math.LegacyNewDecFromStr("-" + tc.decimalStr) + if tc.expErr { + s.Require().NotNil(err, "error expected, decimalStr %v, tc %v", tc.decimalStr, tcIndex) + } else { + s.Require().Nil(err, "unexpected error, decimalStr %v, tc %v", tc.decimalStr, tcIndex) + exp := tc.exp.Mul(math.LegacyNewDec(-1)) + s.Require().True(res.Equal(exp), "equality was incorrect, res %v, expTruncated %v, tc %v", res, exp, tcIndex) + } + } +} + +func (s *decimalTestSuite) TestDecString() { + tests := []struct { + d math.LegacyDec + want string + }{ + {math.LegacyNewDec(0), "0.000000000000000000"}, + {math.LegacyNewDec(1), "1.000000000000000000"}, + {math.LegacyNewDec(10), "10.000000000000000000"}, + {math.LegacyNewDec(12340), "12340.000000000000000000"}, + {math.LegacyNewDecWithPrec(12340, 4), "1.234000000000000000"}, + {math.LegacyNewDecWithPrec(12340, 5), "0.123400000000000000"}, + {math.LegacyNewDecWithPrec(12340, 8), "0.000123400000000000"}, + {math.LegacyNewDecWithPrec(1009009009009009009, 17), "10.090090090090090090"}, + } + for tcIndex, tc := range tests { + s.Require().Equal(tc.want, tc.d.String(), "bad String(), index: %v", tcIndex) + } +} + +func (s *decimalTestSuite) TestDecFloat64() { + tests := []struct { + d math.LegacyDec + want float64 + }{ + {math.LegacyNewDec(0), 0.000000000000000000}, + {math.LegacyNewDec(1), 1.000000000000000000}, + {math.LegacyNewDec(10), 10.000000000000000000}, + {math.LegacyNewDec(12340), 12340.000000000000000000}, + {math.LegacyNewDecWithPrec(12340, 4), 1.234000000000000000}, + {math.LegacyNewDecWithPrec(12340, 5), 0.123400000000000000}, + {math.LegacyNewDecWithPrec(12340, 8), 0.000123400000000000}, + {math.LegacyNewDecWithPrec(1009009009009009009, 17), 10.090090090090090090}, + } + for tcIndex, tc := range tests { + value, err := tc.d.Float64() + s.Require().Nil(err, "error getting Float64(), index: %v", tcIndex) + s.Require().Equal(tc.want, value, "bad Float64(), index: %v", tcIndex) + s.Require().Equal(tc.want, tc.d.MustFloat64(), "bad MustFloat64(), index: %v", tcIndex) + } +} + +func (s *decimalTestSuite) TestEqualities() { + tests := []struct { + d1, d2 math.LegacyDec + gt, lt, eq bool + }{ + {math.LegacyNewDec(0), math.LegacyNewDec(0), false, false, true}, + {math.LegacyNewDecWithPrec(0, 2), math.LegacyNewDecWithPrec(0, 4), false, false, true}, + {math.LegacyNewDecWithPrec(100, 0), math.LegacyNewDecWithPrec(100, 0), false, false, true}, + {math.LegacyNewDecWithPrec(-100, 0), math.LegacyNewDecWithPrec(-100, 0), false, false, true}, + {math.LegacyNewDecWithPrec(-1, 1), math.LegacyNewDecWithPrec(-1, 1), false, false, true}, + {math.LegacyNewDecWithPrec(3333, 3), math.LegacyNewDecWithPrec(3333, 3), false, false, true}, + + {math.LegacyNewDecWithPrec(0, 0), math.LegacyNewDecWithPrec(3333, 3), false, true, false}, + {math.LegacyNewDecWithPrec(0, 0), math.LegacyNewDecWithPrec(100, 0), false, true, false}, + {math.LegacyNewDecWithPrec(-1, 0), math.LegacyNewDecWithPrec(3333, 3), false, true, false}, + {math.LegacyNewDecWithPrec(-1, 0), math.LegacyNewDecWithPrec(100, 0), false, true, false}, + {math.LegacyNewDecWithPrec(1111, 3), math.LegacyNewDecWithPrec(100, 0), false, true, false}, + {math.LegacyNewDecWithPrec(1111, 3), math.LegacyNewDecWithPrec(3333, 3), false, true, false}, + {math.LegacyNewDecWithPrec(-3333, 3), math.LegacyNewDecWithPrec(-1111, 3), false, true, false}, + + {math.LegacyNewDecWithPrec(3333, 3), math.LegacyNewDecWithPrec(0, 0), true, false, false}, + {math.LegacyNewDecWithPrec(100, 0), math.LegacyNewDecWithPrec(0, 0), true, false, false}, + {math.LegacyNewDecWithPrec(3333, 3), math.LegacyNewDecWithPrec(-1, 0), true, false, false}, + {math.LegacyNewDecWithPrec(100, 0), math.LegacyNewDecWithPrec(-1, 0), true, false, false}, + {math.LegacyNewDecWithPrec(100, 0), math.LegacyNewDecWithPrec(1111, 3), true, false, false}, + {math.LegacyNewDecWithPrec(3333, 3), math.LegacyNewDecWithPrec(1111, 3), true, false, false}, + {math.LegacyNewDecWithPrec(-1111, 3), math.LegacyNewDecWithPrec(-3333, 3), true, false, false}, + } + + for tcIndex, tc := range tests { + s.Require().Equal(tc.gt, tc.d1.GT(tc.d2), "GT result is incorrect, tc %d", tcIndex) + s.Require().Equal(tc.lt, tc.d1.LT(tc.d2), "LT result is incorrect, tc %d", tcIndex) + s.Require().Equal(tc.eq, tc.d1.Equal(tc.d2), "equality result is incorrect, tc %d", tcIndex) + } +} + +func (s *decimalTestSuite) TestDecsEqual() { + tests := []struct { + d1s, d2s []math.LegacyDec + eq bool + }{ + {[]math.LegacyDec{math.LegacyNewDec(0)}, []math.LegacyDec{math.LegacyNewDec(0)}, true}, + {[]math.LegacyDec{math.LegacyNewDec(0)}, []math.LegacyDec{math.LegacyNewDec(1)}, false}, + {[]math.LegacyDec{math.LegacyNewDec(0)}, []math.LegacyDec{}, false}, + {[]math.LegacyDec{math.LegacyNewDec(0), math.LegacyNewDec(1)}, []math.LegacyDec{math.LegacyNewDec(0), math.LegacyNewDec(1)}, true}, + {[]math.LegacyDec{math.LegacyNewDec(1), math.LegacyNewDec(0)}, []math.LegacyDec{math.LegacyNewDec(1), math.LegacyNewDec(0)}, true}, + {[]math.LegacyDec{math.LegacyNewDec(1), math.LegacyNewDec(0)}, []math.LegacyDec{math.LegacyNewDec(0), math.LegacyNewDec(1)}, false}, + {[]math.LegacyDec{math.LegacyNewDec(1), math.LegacyNewDec(0)}, []math.LegacyDec{math.LegacyNewDec(1)}, false}, + {[]math.LegacyDec{math.LegacyNewDec(1), math.LegacyNewDec(2)}, []math.LegacyDec{math.LegacyNewDec(2), math.LegacyNewDec(4)}, false}, + {[]math.LegacyDec{math.LegacyNewDec(3), math.LegacyNewDec(18)}, []math.LegacyDec{math.LegacyNewDec(1), math.LegacyNewDec(6)}, false}, + } + + for tcIndex, tc := range tests { + s.Require().Equal(tc.eq, math.LegacyDecsEqual(tc.d1s, tc.d2s), "equality of decional arrays is incorrect, tc %d", tcIndex) + s.Require().Equal(tc.eq, math.LegacyDecsEqual(tc.d2s, tc.d1s), "equality of decional arrays is incorrect (converse), tc %d", tcIndex) + } +} + +func (s *decimalTestSuite) TestArithmetic() { + tests := []struct { + d1, d2 math.LegacyDec + expMul, expMulTruncate, expMulRoundUp math.LegacyDec + expQuo, expQuoRoundUp, expQuoTruncate math.LegacyDec + expAdd, expSub math.LegacyDec + }{ + // d1 d2 MUL MulTruncate MulRoundUp QUO QUORoundUp QUOTrunctate ADD SUB + {math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0)}, + {math.LegacyNewDec(1), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(1), math.LegacyNewDec(1)}, + {math.LegacyNewDec(0), math.LegacyNewDec(1), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(1), math.LegacyNewDec(-1)}, + {math.LegacyNewDec(0), math.LegacyNewDec(-1), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(-1), math.LegacyNewDec(1)}, + {math.LegacyNewDec(-1), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(-1), math.LegacyNewDec(-1)}, + + {math.LegacyNewDec(1), math.LegacyNewDec(1), math.LegacyNewDec(1), math.LegacyNewDec(1), math.LegacyNewDec(1), math.LegacyNewDec(1), math.LegacyNewDec(1), math.LegacyNewDec(1), math.LegacyNewDec(2), math.LegacyNewDec(0)}, + {math.LegacyNewDec(-1), math.LegacyNewDec(-1), math.LegacyNewDec(1), math.LegacyNewDec(1), math.LegacyNewDec(1), math.LegacyNewDec(1), math.LegacyNewDec(1), math.LegacyNewDec(1), math.LegacyNewDec(-2), math.LegacyNewDec(0)}, + {math.LegacyNewDec(1), math.LegacyNewDec(-1), math.LegacyNewDec(-1), math.LegacyNewDec(-1), math.LegacyNewDec(-1), math.LegacyNewDec(-1), math.LegacyNewDec(-1), math.LegacyNewDec(-1), math.LegacyNewDec(0), math.LegacyNewDec(2)}, + {math.LegacyNewDec(-1), math.LegacyNewDec(1), math.LegacyNewDec(-1), math.LegacyNewDec(-1), math.LegacyNewDec(-1), math.LegacyNewDec(-1), math.LegacyNewDec(-1), math.LegacyNewDec(-1), math.LegacyNewDec(0), math.LegacyNewDec(-2)}, + + { + math.LegacyNewDec(3), math.LegacyNewDec(7), math.LegacyNewDec(21), math.LegacyNewDec(21), math.LegacyNewDec(21), + math.LegacyNewDecWithPrec(428571428571428571, 18), math.LegacyNewDecWithPrec(428571428571428572, 18), math.LegacyNewDecWithPrec(428571428571428571, 18), + math.LegacyNewDec(10), math.LegacyNewDec(-4), + }, + { + math.LegacyNewDec(2), math.LegacyNewDec(4), math.LegacyNewDec(8), math.LegacyNewDec(8), math.LegacyNewDec(8), math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDecWithPrec(5, 1), + math.LegacyNewDec(6), math.LegacyNewDec(-2), + }, + + {math.LegacyNewDec(100), math.LegacyNewDec(100), math.LegacyNewDec(10000), math.LegacyNewDec(10000), math.LegacyNewDec(10000), math.LegacyNewDec(1), math.LegacyNewDec(1), math.LegacyNewDec(1), math.LegacyNewDec(200), math.LegacyNewDec(0)}, + + { + math.LegacyNewDecWithPrec(15, 1), math.LegacyNewDecWithPrec(15, 1), math.LegacyNewDecWithPrec(225, 2), math.LegacyNewDecWithPrec(225, 2), math.LegacyNewDecWithPrec(225, 2), + math.LegacyNewDec(1), math.LegacyNewDec(1), math.LegacyNewDec(1), math.LegacyNewDec(3), math.LegacyNewDec(0), + }, + { + math.LegacyNewDecWithPrec(3333, 4), math.LegacyNewDecWithPrec(333, 4), math.LegacyNewDecWithPrec(1109889, 8), math.LegacyNewDecWithPrec(1109889, 8), math.LegacyNewDecWithPrec(1109889, 8), + math.LegacyMustNewDecFromStr("10.009009009009009009"), math.LegacyMustNewDecFromStr("10.009009009009009010"), math.LegacyMustNewDecFromStr("10.009009009009009009"), + math.LegacyNewDecWithPrec(3666, 4), math.LegacyNewDecWithPrec(3, 1), + }, + } + + for tcIndex, tc := range tests { + + resAdd := tc.d1.Add(tc.d2) + resSub := tc.d1.Sub(tc.d2) + resMul := tc.d1.Mul(tc.d2) + resMulTruncate := tc.d1.MulTruncate(tc.d2) + resMulRoundUp := tc.d1.MulRoundUp(tc.d2) + s.Require().True(tc.expAdd.Equal(resAdd), "expTruncated %v, res %v, tc %d", tc.expAdd, resAdd, tcIndex) + s.Require().True(tc.expSub.Equal(resSub), "expTruncated %v, res %v, tc %d", tc.expSub, resSub, tcIndex) + s.Require().True(tc.expMul.Equal(resMul), "expTruncated %v, res %v, tc %d", tc.expMul, resMul, tcIndex) + s.Require().True(tc.expMulTruncate.Equal(resMulTruncate), "expTruncated %v, res %v, tc %d", tc.expMulTruncate, resMulTruncate, tcIndex) + s.Require().True(tc.expMulRoundUp.Equal(resMulRoundUp), "expTruncated %v, res %v, tc %d", tc.expMulRoundUp, resMulRoundUp, tcIndex) + + if tc.d2.IsZero() { // panic for divide by zero + s.Require().Panics(func() { tc.d1.Quo(tc.d2) }) + } else { + resQuo := tc.d1.Quo(tc.d2) + s.Require().True(tc.expQuo.Equal(resQuo), "expTruncated %v, res %v, tc %d", tc.expQuo.String(), resQuo.String(), tcIndex) + + resQuoRoundUp := tc.d1.QuoRoundUp(tc.d2) + s.Require().True(tc.expQuoRoundUp.Equal(resQuoRoundUp), "expTruncated %v, res %v, tc %d", + tc.expQuoRoundUp.String(), resQuoRoundUp.String(), tcIndex) + + resQuoTruncate := tc.d1.QuoTruncate(tc.d2) + s.Require().True(tc.expQuoTruncate.Equal(resQuoTruncate), "expTruncated %v, res %v, tc %d", + tc.expQuoTruncate.String(), resQuoTruncate.String(), tcIndex) + } + } +} + +func (s *decimalTestSuite) TestMulRoundUp_RoundingAtPrecisionEnd() { + var ( + a = math.LegacyMustNewDecFromStr("0.000000000000000009") + b = math.LegacyMustNewDecFromStr("0.000000000000000009") + expectedRoundUp = math.LegacyMustNewDecFromStr("0.000000000000000001") + expectedTruncate = math.LegacyMustNewDecFromStr("0.000000000000000000") + ) + + actualRoundUp := a.MulRoundUp(b) + s.Require().Equal(expectedRoundUp.String(), actualRoundUp.String(), "expTruncated %v, res %v", expectedRoundUp, actualRoundUp) + + actualTruncate := a.MulTruncate(b) + s.Require().Equal(expectedTruncate.String(), actualTruncate.String(), "expTruncated %v, res %v", expectedRoundUp, actualTruncate) +} + +func (s *decimalTestSuite) TestBankerRoundChop() { + tests := []struct { + d1 math.LegacyDec + exp int64 + }{ + {s.mustNewDecFromStr("0.25"), 0}, + {s.mustNewDecFromStr("0"), 0}, + {s.mustNewDecFromStr("1"), 1}, + {s.mustNewDecFromStr("0.75"), 1}, + {s.mustNewDecFromStr("0.5"), 0}, + {s.mustNewDecFromStr("7.5"), 8}, + {s.mustNewDecFromStr("1.5"), 2}, + {s.mustNewDecFromStr("2.5"), 2}, + {s.mustNewDecFromStr("0.545"), 1}, // 0.545-> 1 even though 5 is first decimal and 1 not even + {s.mustNewDecFromStr("1.545"), 2}, + } + + for tcIndex, tc := range tests { + resNeg := tc.d1.Neg().RoundInt64() + s.Require().Equal(-1*tc.exp, resNeg, "negative tc %d", tcIndex) + + resPos := tc.d1.RoundInt64() + s.Require().Equal(tc.exp, resPos, "positive tc %d", tcIndex) + } +} + +func (s *decimalTestSuite) TestTruncate() { + tests := []struct { + d1 math.LegacyDec + exp int64 + }{ + {s.mustNewDecFromStr("0"), 0}, + {s.mustNewDecFromStr("0.25"), 0}, + {s.mustNewDecFromStr("0.75"), 0}, + {s.mustNewDecFromStr("1"), 1}, + {s.mustNewDecFromStr("1.5"), 1}, + {s.mustNewDecFromStr("7.5"), 7}, + {s.mustNewDecFromStr("7.6"), 7}, + {s.mustNewDecFromStr("7.4"), 7}, + {s.mustNewDecFromStr("100.1"), 100}, + {s.mustNewDecFromStr("1000.1"), 1000}, + } + + for tcIndex, tc := range tests { + resNeg := tc.d1.Neg().TruncateInt64() + s.Require().Equal(-1*tc.exp, resNeg, "negative tc %d", tcIndex) + + resPos := tc.d1.TruncateInt64() + s.Require().Equal(tc.exp, resPos, "positive tc %d", tcIndex) + } +} + +func (s *decimalTestSuite) TestStringOverflow() { + // two random 64 bit primes + dec1, err := math.LegacyNewDecFromStr("51643150036226787134389711697696177267") + s.Require().NoError(err) + dec2, err := math.LegacyNewDecFromStr("-31798496660535729618459429845579852627") + s.Require().NoError(err) + dec3 := dec1.Add(dec2) + s.Require().Equal( + "19844653375691057515930281852116324640.000000000000000000", + dec3.String(), + ) +} + +func (s *decimalTestSuite) TestDecMulInt() { + tests := []struct { + sdkDec math.LegacyDec + sdkInt math.Int + want math.LegacyDec + }{ + {math.LegacyNewDec(10), math.NewInt(2), math.LegacyNewDec(20)}, + {math.LegacyNewDec(1000000), math.NewInt(100), math.LegacyNewDec(100000000)}, + {math.LegacyNewDecWithPrec(1, 1), math.NewInt(10), math.LegacyNewDec(1)}, + {math.LegacyNewDecWithPrec(1, 5), math.NewInt(20), math.LegacyNewDecWithPrec(2, 4)}, + } + for i, tc := range tests { + got := tc.sdkDec.MulInt(tc.sdkInt) + s.Require().Equal(tc.want, got, "Incorrect result on test case %d", i) + } +} + +func (s *decimalTestSuite) TestDecCeil() { + testCases := []struct { + input math.LegacyDec + expected math.LegacyDec + }{ + {math.LegacyNewDecWithPrec(1000000000000000, math.LegacyPrecision), math.LegacyNewDec(1)}, // 0.001 => 1.0 + {math.LegacyNewDecWithPrec(-1000000000000000, math.LegacyPrecision), math.LegacyZeroDec()}, // -0.001 => 0.0 + {math.LegacyZeroDec(), math.LegacyZeroDec()}, // 0.0 => 0.0 + {math.LegacyNewDecWithPrec(900000000000000000, math.LegacyPrecision), math.LegacyNewDec(1)}, // 0.9 => 1.0 + {math.LegacyNewDecWithPrec(4001000000000000000, math.LegacyPrecision), math.LegacyNewDec(5)}, // 4.001 => 5.0 + {math.LegacyNewDecWithPrec(-4001000000000000000, math.LegacyPrecision), math.LegacyNewDec(-4)}, // -4.001 => -4.0 + {math.LegacyNewDecWithPrec(4700000000000000000, math.LegacyPrecision), math.LegacyNewDec(5)}, // 4.7 => 5.0 + {math.LegacyNewDecWithPrec(-4700000000000000000, math.LegacyPrecision), math.LegacyNewDec(-4)}, // -4.7 => -4.0 + } + + for i, tc := range testCases { + res := tc.input.Ceil() + s.Require().Equal(tc.expected, res, "unexpected result for test case %d, input: %v", i, tc.input) + } +} + +func (s *decimalTestSuite) TestCeilOverflow() { + // (2^256 * 10^18 -1) / 10^18 + d, err := math.LegacyNewDecFromStr("115792089237316195423570985008687907853269984665640564039457584007913129639935.999999999999999999") + s.Require().NoError(err) + s.Require().True(d.IsInValidRange()) + // this call panics because the value is too large + s.Require().Panics(func() { d.Ceil() }, "Ceil should panic on overflow") +} + +func (s *decimalTestSuite) TestPower() { + testCases := []struct { + input math.LegacyDec + power uint64 + expected math.LegacyDec + }{ + {math.LegacyNewDec(100), 0, math.LegacyOneDec()}, // 10 ^ (0) => 1.0 + {math.LegacyOneDec(), 10, math.LegacyOneDec()}, // 1.0 ^ (10) => 1.0 + {math.LegacyNewDecWithPrec(5, 1), 2, math.LegacyNewDecWithPrec(25, 2)}, // 0.5 ^ 2 => 0.25 + {math.LegacyNewDecWithPrec(2, 1), 2, math.LegacyNewDecWithPrec(4, 2)}, // 0.2 ^ 2 => 0.04 + {math.LegacyNewDecFromInt(math.NewInt(3)), 3, math.LegacyNewDecFromInt(math.NewInt(27))}, // 3 ^ 3 => 27 + {math.LegacyNewDecFromInt(math.NewInt(-3)), 4, math.LegacyNewDecFromInt(math.NewInt(81))}, // -3 ^ 4 = 81 + {math.LegacyNewDecWithPrec(1414213562373095049, 18), 2, math.LegacyNewDecFromInt(math.NewInt(2))}, // 1.414213562373095049 ^ 2 = 2 + } + + for i, tc := range testCases { + res := tc.input.Power(tc.power) + s.Require().True(tc.expected.Sub(res).Abs().LTE(math.LegacySmallestDec()), "unexpected result for test case %d, normal power, input: %v", i, tc.input) + + mutableInput := tc.input + mutableInput.PowerMut(tc.power) + s.Require().True(tc.expected.Sub(mutableInput).Abs().LTE(math.LegacySmallestDec()), + "unexpected result for test case %d, input %v", i, tc.input) + s.Require().True(res.Equal(tc.input), "unexpected result for test case %d, mutable power, input: %v", i, tc.input) + } +} + +func (s *decimalTestSuite) TestApproxRoot() { + testCases := []struct { + input math.LegacyDec + root uint64 + expected math.LegacyDec + }{ + {math.LegacyNewDecFromInt(math.NewInt(2)), 0, math.LegacyOneDec()}, // 2 ^ 0 => 1.0 + {math.LegacyNewDecWithPrec(4, 2), 0, math.LegacyOneDec()}, // 0.04 ^ 0 => 1.0 + {math.LegacyNewDec(0), 1, math.LegacyNewDec(0)}, // 0 ^ 1 => 0 + {math.LegacyOneDec(), 10, math.LegacyOneDec()}, // 1.0 ^ (0.1) => 1.0 + {math.LegacyNewDecWithPrec(25, 2), 2, math.LegacyNewDecWithPrec(5, 1)}, // 0.25 ^ (0.5) => 0.5 + {math.LegacyNewDecWithPrec(4, 2), 2, math.LegacyNewDecWithPrec(2, 1)}, // 0.04 ^ (0.5) => 0.2 + {math.LegacyNewDecFromInt(math.NewInt(27)), 3, math.LegacyNewDecFromInt(math.NewInt(3))}, // 27 ^ (1/3) => 3 + {math.LegacyNewDecFromInt(math.NewInt(-81)), 4, math.LegacyNewDecFromInt(math.NewInt(-3))}, // -81 ^ (0.25) => -3 + {math.LegacyNewDecFromInt(math.NewInt(2)), 2, math.LegacyNewDecWithPrec(1414213562373095049, 18)}, // 2 ^ (0.5) => 1.414213562373095049 + {math.LegacyNewDecWithPrec(1005, 3), 31536000, math.LegacyMustNewDecFromStr("1.000000000158153904")}, // 1.005 ^ (1/31536000) ≈ 1.00000000016 + {math.LegacySmallestDec(), 2, math.LegacyNewDecWithPrec(1, 9)}, // 1e-18 ^ (0.5) => 1e-9 + {math.LegacySmallestDec(), 3, math.LegacyMustNewDecFromStr("0.000000999999999997")}, // 1e-18 ^ (1/3) => 1e-6 + {math.LegacyNewDecWithPrec(1, 8), 3, math.LegacyMustNewDecFromStr("0.002154434690031900")}, // 1e-8 ^ (1/3) ≈ 0.00215443469 + {math.LegacyMustNewDecFromStr("9000002314687921634000000000000000000021394871242000000000000000"), 2, math.LegacyMustNewDecFromStr("94868342004527103646332858502867.899477053226766107")}, + } + + // In the case of 1e-8 ^ (1/3), the result repeats every 5 iterations starting from iteration 24 + // (i.e. 24, 29, 34, ... give the same result) and never converges enough. The maximum number of + // iterations (300) causes the result at iteration 300 to be returned, regardless of convergence. + + for i, tc := range testCases { + res, err := tc.input.ApproxRoot(tc.root) + s.Require().NoError(err) + s.Require().True(tc.expected.Sub(res).Abs().LTE(math.LegacySmallestDec()), "unexpected result for test case %d, input: %v", i, tc.input) + } +} + +func (s *decimalTestSuite) TestApproxSqrt() { + testCases := []struct { + input math.LegacyDec + expected math.LegacyDec + }{ + {math.LegacyOneDec(), math.LegacyOneDec()}, // 1.0 => 1.0 + {math.LegacyNewDecWithPrec(25, 2), math.LegacyNewDecWithPrec(5, 1)}, // 0.25 => 0.5 + {math.LegacyNewDecWithPrec(4, 2), math.LegacyNewDecWithPrec(2, 1)}, // 0.09 => 0.3 + {math.LegacyNewDec(9), math.LegacyNewDecFromInt(math.NewInt(3))}, // 9 => 3 + {math.LegacyNewDec(-9), math.LegacyNewDecFromInt(math.NewInt(-3))}, // -9 => -3 + {math.LegacyNewDec(2), math.LegacyNewDecWithPrec(1414213562373095049, 18)}, // 2 => 1.414213562373095049 + { // 2^127 - 1 => 13043817825332782212.3495718062525083688 which rounds to 13043817825332782212.3495718062525083689 + math.LegacyNewDec(2).Power(127).Sub(math.LegacyOneDec()), + math.LegacyMustNewDecFromStr("13043817825332782212.349571806252508369"), + }, + {math.LegacyMustNewDecFromStr("1.000000011823380862"), math.LegacyMustNewDecFromStr("1.000000005911690414")}, + } + + for i, tc := range testCases { + res, err := tc.input.ApproxSqrt() + s.Require().NoError(err) + s.Require().Equal(tc.expected, res, "unexpected result for test case %d, input: %v", i, tc.input) + } +} + +func (s *decimalTestSuite) TestDecSortableBytes() { + tests := []struct { + d math.LegacyDec + want []byte + }{ + {math.LegacyNewDec(0), []byte("000000000000000000.000000000000000000")}, + {math.LegacyNewDec(1), []byte("000000000000000001.000000000000000000")}, + {math.LegacyNewDec(10), []byte("000000000000000010.000000000000000000")}, + {math.LegacyNewDec(12340), []byte("000000000000012340.000000000000000000")}, + {math.LegacyNewDecWithPrec(12340, 4), []byte("000000000000000001.234000000000000000")}, + {math.LegacyNewDecWithPrec(12340, 5), []byte("000000000000000000.123400000000000000")}, + {math.LegacyNewDecWithPrec(12340, 8), []byte("000000000000000000.000123400000000000")}, + {math.LegacyNewDecWithPrec(1009009009009009009, 17), []byte("000000000000000010.090090090090090090")}, + {math.LegacyNewDecWithPrec(-1009009009009009009, 17), []byte("-000000000000000010.090090090090090090")}, + {math.LegacyNewDec(1000000000000000000), []byte("max")}, + {math.LegacyNewDec(-1000000000000000000), []byte("--")}, + } + for tcIndex, tc := range tests { + s.Require().Equal(tc.want, math.LegacySortableDecBytes(tc.d), "bad String(), index: %v", tcIndex) + } + + s.Require().Panics(func() { math.LegacySortableDecBytes(math.LegacyNewDec(1000000000000000001)) }) + s.Require().Panics(func() { math.LegacySortableDecBytes(math.LegacyNewDec(-1000000000000000001)) }) +} + +func (s *decimalTestSuite) TestDecEncoding() { + largestBigInt, ok := new(big.Int).SetString("33499189745056880149688856635597007162669032647290798121690100488888732861290034376435130433535", 10) + s.Require().True(ok) + + smallestBigInt, ok := new(big.Int).SetString("-33499189745056880149688856635597007162669032647290798121690100488888732861290034376435130433535", 10) + s.Require().True(ok) + + const maxDecBitLen = 315 + maxInt, ok := new(big.Int).SetString(strings.Repeat("1", maxDecBitLen), 2) + s.Require().True(ok) + + testCases := []struct { + input math.LegacyDec + rawBz string + jsonStr string + yamlStr string + }{ + { + math.LegacyNewDec(0), "30", + "\"0.000000000000000000\"", + "\"0.000000000000000000\"\n", + }, + { + math.LegacyNewDecWithPrec(4, 2), + "3430303030303030303030303030303030", + "\"0.040000000000000000\"", + "\"0.040000000000000000\"\n", + }, + { + math.LegacyNewDecWithPrec(-4, 2), + "2D3430303030303030303030303030303030", + "\"-0.040000000000000000\"", + "\"-0.040000000000000000\"\n", + }, + { + math.LegacyNewDecWithPrec(1414213562373095049, 18), + "31343134323133353632333733303935303439", + "\"1.414213562373095049\"", + "\"1.414213562373095049\"\n", + }, + { + math.LegacyNewDecWithPrec(-1414213562373095049, 18), + "2D31343134323133353632333733303935303439", + "\"-1.414213562373095049\"", + "\"-1.414213562373095049\"\n", + }, + { + math.LegacyNewDecFromBigIntWithPrec(largestBigInt, 18), + "3333343939313839373435303536383830313439363838383536363335353937303037313632363639303332363437323930373938313231363930313030343838383838373332383631323930303334333736343335313330343333353335", + "\"33499189745056880149688856635597007162669032647290798121690100488888732861290.034376435130433535\"", + "\"33499189745056880149688856635597007162669032647290798121690100488888732861290.034376435130433535\"\n", + }, + { + math.LegacyNewDecFromBigIntWithPrec(smallestBigInt, 18), + "2D3333343939313839373435303536383830313439363838383536363335353937303037313632363639303332363437323930373938313231363930313030343838383838373332383631323930303334333736343335313330343333353335", + "\"-33499189745056880149688856635597007162669032647290798121690100488888732861290.034376435130433535\"", + "\"-33499189745056880149688856635597007162669032647290798121690100488888732861290.034376435130433535\"\n", + }, + { + math.LegacyNewDecFromBigIntWithPrec(maxInt, 18), + "3636373439353934383732353238343430303734383434343238333137373938353033353831333334353136333233363435333939303630383435303530323434343434333636343330363435303137313838323137353635323136373637", + "\"66749594872528440074844428317798503581334516323645399060845050244444366430645.017188217565216767\"", + "\"66749594872528440074844428317798503581334516323645399060845050244444366430645.017188217565216767\"\n", + }, + } + + for _, tc := range testCases { + bz, err := tc.input.Marshal() + s.Require().NoError(err) + s.Require().Equal(tc.rawBz, fmt.Sprintf("%X", bz)) + + var other math.LegacyDec + s.Require().NoError((&other).Unmarshal(bz)) + s.Require().True(tc.input.Equal(other)) + + bz, err = json.Marshal(tc.input) + s.Require().NoError(err) + s.Require().Equal(tc.jsonStr, string(bz)) + s.Require().NoError(json.Unmarshal(bz, &other)) + s.Require().True(tc.input.Equal(other)) + + bz, err = yaml.Marshal(tc.input) + s.Require().NoError(err) + s.Require().Equal(tc.yamlStr, string(bz)) + } +} + +// Showcase that different orders of operations causes different results. +func (s *decimalTestSuite) TestOperationOrders() { + n1 := math.LegacyNewDec(10) + n2 := math.LegacyNewDec(1000000010) + s.Require().Equal(n1.Mul(n2).Quo(n2), math.LegacyNewDec(10)) + s.Require().NotEqual(n1.Mul(n2).Quo(n2), n1.Quo(n2).Mul(n2)) +} + +func BenchmarkMarshalTo(b *testing.B) { + b.ReportAllocs() + bis := []struct { + in math.LegacyDec + want []byte + }{ + { + math.LegacyNewDec(1e8), []byte{ + 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + }, + }, + {math.LegacyNewDec(0), []byte{0x30}}, + } + data := make([]byte, 100) + + b.ReportAllocs() + b.ResetTimer() + + for i := 0; i < b.N; i++ { + for _, bi := range bis { + if n, err := bi.in.MarshalTo(data); err != nil { + b.Fatal(err) + } else if !bytes.Equal(data[:n], bi.want) { + b.Fatalf("Mismatch\nGot: % x\nWant: % x\n", data[:n], bi.want) + } + } + } +} + +var sink interface{} + +func BenchmarkLegacyQuoMut(b *testing.B) { + b1 := math.LegacyNewDec(17e2 + 8371) + b2 := math.LegacyNewDec(4371) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + sink = b1.QuoMut(b2) + } + + if sink == nil { + b.Fatal("Benchmark did not run") + } + sink = (interface{})(nil) +} + +func BenchmarkLegacyQuoTruncateMut(b *testing.B) { + b1 := math.LegacyNewDec(17e2 + 8371) + baseArr := make([]math.LegacyDec, b.N) + for i := 0; i < b.N; i++ { + baseArr[i] = b1.Clone() + } + b2 := math.LegacyNewDec(4371) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + sink = baseArr[i].QuoTruncateMut(b2) + } + + if sink == nil { + b.Fatal("Benchmark did not run") + } + sink = (interface{})(nil) +} + +func BenchmarkLegacySqrtOnMersennePrime(b *testing.B) { + b1 := math.LegacyNewDec(2).Power(127).Sub(math.LegacyOneDec()) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + sink, _ = b1.ApproxSqrt() + } + + if sink == nil { + b.Fatal("Benchmark did not run") + } + sink = (interface{})(nil) +} + +func BenchmarkLegacyQuoRoundupMut(b *testing.B) { + b1 := math.LegacyNewDec(17e2 + 8371) + baseArr := make([]math.LegacyDec, b.N) + for i := 0; i < b.N; i++ { + baseArr[i] = b1.Clone() + } + b2 := math.LegacyNewDec(4371) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + sink = baseArr[i].QuoRoundupMut(b2) + } + + if sink == nil { + b.Fatal("Benchmark did not run") + } + sink = (interface{})(nil) +} + +func TestFormatDec(t *testing.T) { + type decimalTest []string + var testcases []decimalTest + raw, err := os.ReadFile("./testdata/decimals.json") + require.NoError(t, err) + err = json.Unmarshal(raw, &testcases) + require.NoError(t, err) + + for _, tc := range testcases { + t.Run(tc[0], func(t *testing.T) { + out, err := math.FormatDec(tc[0]) + require.NoError(t, err) + require.Equal(t, tc[1], out) + }) + } +} + +func TestFormatDecNonDigits(t *testing.T) { + badCases := []string{ + "10.a", + "1a.10", + "p1a10.", + "0.10p", + "--10", + "12.😎😎", + "11111111111133333333333333333333333333333a", + "11111111111133333333333333333333333333333 192892", + } + + for _, value := range badCases { + t.Run(value, func(t *testing.T) { + s, err := math.FormatDec(value) + if err == nil { + t.Fatal("Expected an error") + } + if g, w := err.Error(), "non-digits"; !strings.Contains(g, w) { + t.Errorf("Error mismatch\nGot: %q\nWant substring: %q", g, w) + } + if s != "" { + t.Fatalf("Got a non-empty string: %q", s) + } + }) + } +} + +func TestNegativePrecisionPanic(t *testing.T) { + require.Panics(t, func() { + math.LegacyNewDecWithPrec(10, -1) + }) +} + +func (s *decimalTestSuite) TestConvertToBigIntMutativeForLegacyDec() { + r := big.NewInt(30) + i := math.LegacyNewDecFromBigInt(r) + + // Compare value of BigInt & BigIntMut + s.Require().Equal(i.BigInt(), i.BigIntMut()) + + // Modify BigIntMut() pointer and ensure i.BigIntMut() & i.BigInt() change + p1 := i.BigIntMut() + p1.SetInt64(40) + s.Require().Equal(big.NewInt(40), i.BigIntMut()) + s.Require().Equal(big.NewInt(40), i.BigInt()) + + // Modify big.Int() pointer and ensure i.BigIntMut() & i.BigInt() don't change + p2 := i.BigInt() + p2.SetInt64(50) + s.Require().NotEqual(big.NewInt(50), i.BigIntMut()) + s.Require().NotEqual(big.NewInt(50), i.BigInt()) +} + +func TestQuoMut(t *testing.T) { + specs := map[string]struct { + dividend, divisor math.LegacyDec + expTruncated, expRoundedUp string + expPanic bool + }{ + "0.0000000000000000001": { + dividend: math.LegacyNewDecWithPrec(1, 18), + divisor: math.LegacyMustNewDecFromStr("10"), + expRoundedUp: "0.000000000000000001", + expTruncated: "0.000000000000000000", + }, + "0.0000000000000000002": { + dividend: math.LegacyNewDecWithPrec(1, 18), + divisor: math.LegacyMustNewDecFromStr("5"), + expRoundedUp: "0.000000000000000001", + expTruncated: "0.000000000000000000", + }, + "0.0000000000000000003": { + dividend: math.LegacyNewDecWithPrec(1, 18), + divisor: math.LegacyMustNewDecFromStr("3.333333333333333"), + expRoundedUp: "0.000000000000000001", + expTruncated: "0.000000000000000000", + }, + "0.0000000000000000004": { + dividend: math.LegacyNewDecWithPrec(1, 18), + divisor: math.LegacyMustNewDecFromStr("2.5"), + expRoundedUp: "0.000000000000000001", + expTruncated: "0.000000000000000000", + }, + "0.0000000000000000005": { + dividend: math.LegacyNewDecWithPrec(1, 18), + divisor: math.LegacyMustNewDecFromStr("2"), + expRoundedUp: "0.000000000000000001", + + expTruncated: "0.000000000000000000", + }, + "0.0000000000000000006": { + dividend: math.LegacyNewDecWithPrec(1, 18), + divisor: math.LegacyMustNewDecFromStr("1.666666666666666666"), + expRoundedUp: "0.000000000000000001", + + expTruncated: "0.000000000000000000", + }, + "0.0000000000000000007": { + dividend: math.LegacyNewDecWithPrec(1, 18), + divisor: math.LegacyMustNewDecFromStr("1.428571428571429"), + expRoundedUp: "0.000000000000000001", + + expTruncated: "0.000000000000000000", + }, + "0.0000000000000000008": { + dividend: math.LegacyNewDecWithPrec(1, 18), + divisor: math.LegacyMustNewDecFromStr("1.25"), + expRoundedUp: "0.000000000000000001", + + expTruncated: "0.000000000000000000", + }, + "0.0000000000000000009": { + dividend: math.LegacyNewDecWithPrec(1, 18), + divisor: math.LegacyMustNewDecFromStr("1.111111111111111"), + expRoundedUp: "0.000000000000000001", + + expTruncated: "0.000000000000000000", + }, + "-0.0000000000000000001": { + dividend: math.LegacyNewDecWithPrec(1, 18).Neg(), + divisor: math.LegacyMustNewDecFromStr("10"), + expRoundedUp: "0.000000000000000000", + expTruncated: "0.000000000000000000", + }, + "-0.0000000000000000002": { + dividend: math.LegacyNewDecWithPrec(1, 18).Neg(), + divisor: math.LegacyMustNewDecFromStr("5"), + expRoundedUp: "0.000000000000000000", + expTruncated: "0.000000000000000000", + }, + "-0.0000000000000000003": { + dividend: math.LegacyNewDecWithPrec(1, 18).Neg(), + divisor: math.LegacyMustNewDecFromStr("3.333333333333333"), + expRoundedUp: "0.000000000000000000", + expTruncated: "0.000000000000000000", + }, + "-0.0000000000000000004": { + dividend: math.LegacyNewDecWithPrec(1, 18).Neg(), + divisor: math.LegacyMustNewDecFromStr("2.5"), + expRoundedUp: "0.000000000000000000", + expTruncated: "0.000000000000000000", + }, + "-0.0000000000000000005": { + dividend: math.LegacyNewDecWithPrec(1, 18).Neg(), + divisor: math.LegacyMustNewDecFromStr("2"), + expRoundedUp: "0.000000000000000000", + expTruncated: "0.000000000000000000", + }, + "-0.0000000000000000006": { + dividend: math.LegacyNewDecWithPrec(1, 18).Neg(), + divisor: math.LegacyMustNewDecFromStr("1.666666666666666666"), + expRoundedUp: "0.000000000000000000", + expTruncated: "0.000000000000000000", + }, + "-0.0000000000000000007": { + dividend: math.LegacyNewDecWithPrec(1, 18).Neg(), + divisor: math.LegacyMustNewDecFromStr("1.428571428571429"), + expRoundedUp: "0.000000000000000000", + expTruncated: "0.000000000000000000", + }, + "-0.0000000000000000008": { + dividend: math.LegacyNewDecWithPrec(1, 18).Neg(), + divisor: math.LegacyMustNewDecFromStr("1.25"), + expRoundedUp: "0.000000000000000000", + expTruncated: "0.000000000000000000", + }, + "-0.0000000000000000009": { + dividend: math.LegacyNewDecWithPrec(1, 18).Neg(), + divisor: math.LegacyMustNewDecFromStr("1.111111111111111"), + expRoundedUp: "0.000000000000000000", + expTruncated: "0.000000000000000000", + }, + "--0.0000000000000000001": { + dividend: math.LegacyNewDecWithPrec(1, 18).Neg(), + divisor: math.LegacyMustNewDecFromStr("-10"), + expRoundedUp: "0.000000000000000001", + expTruncated: "0.000000000000000000", + }, + "--0.0000000000000000002": { + dividend: math.LegacyNewDecWithPrec(1, 18).Neg(), + divisor: math.LegacyMustNewDecFromStr("-5"), + expRoundedUp: "0.000000000000000001", + expTruncated: "0.000000000000000000", + }, + "--0.0000000000000000003": { + dividend: math.LegacyNewDecWithPrec(1, 18).Neg(), + divisor: math.LegacyMustNewDecFromStr("-3.333333333333333"), + expRoundedUp: "0.000000000000000001", + expTruncated: "0.000000000000000000", + }, + "--0.0000000000000000004": { + dividend: math.LegacyNewDecWithPrec(1, 18).Neg(), + divisor: math.LegacyMustNewDecFromStr("-2.5"), + expRoundedUp: "0.000000000000000001", + expTruncated: "0.000000000000000000", + }, + "--0.0000000000000000005": { + dividend: math.LegacyNewDecWithPrec(1, 18).Neg(), + divisor: math.LegacyMustNewDecFromStr("-2"), + expRoundedUp: "0.000000000000000001", + expTruncated: "0.000000000000000000", + }, + "--0.0000000000000000006": { + dividend: math.LegacyNewDecWithPrec(1, 18).Neg(), + divisor: math.LegacyMustNewDecFromStr("-1.666666666666666666"), + expRoundedUp: "0.000000000000000001", + expTruncated: "0.000000000000000000", + }, + "--0.0000000000000000007": { + dividend: math.LegacyNewDecWithPrec(1, 18).Neg(), + divisor: math.LegacyMustNewDecFromStr("-1.428571428571429"), + expRoundedUp: "0.000000000000000001", + expTruncated: "0.000000000000000000", + }, + "--0.0000000000000000008": { + dividend: math.LegacyNewDecWithPrec(1, 18).Neg(), + divisor: math.LegacyMustNewDecFromStr("-1.25"), + expRoundedUp: "0.000000000000000001", + expTruncated: "0.000000000000000000", + }, + "--0.0000000000000000009": { + dividend: math.LegacyNewDecWithPrec(1, 18).Neg(), + divisor: math.LegacyMustNewDecFromStr("-1.111111111111111"), + expRoundedUp: "0.000000000000000001", + expTruncated: "0.000000000000000000", + }, + "big / small": { + dividend: math.LegacyMustNewDecFromStr("999999999999999999"), + divisor: math.LegacyNewDecWithPrec(1, 18), + expRoundedUp: "999999999999999999000000000000000000.000000000000000000", + expTruncated: "999999999999999999000000000000000000.000000000000000000", + }, + "divide by dividend": { + dividend: math.LegacyNewDecWithPrec(123, 0), + divisor: math.LegacyMustNewDecFromStr("123"), + expRoundedUp: "1.000000000000000000", + expTruncated: "1.000000000000000000", + }, + "zero divided": { + dividend: math.LegacyNewDecWithPrec(0, 0), + divisor: math.LegacyMustNewDecFromStr("1"), + expRoundedUp: "0.000000000000000000", + expTruncated: "0.000000000000000000", + }, + "zero divided by negative value": { + dividend: math.LegacyNewDecWithPrec(0, 0), + divisor: math.LegacyMustNewDecFromStr("-1"), + expRoundedUp: "0.000000000000000000", + expTruncated: "0.000000000000000000", + }, + "zero divided by zero": { + dividend: math.LegacyNewDecWithPrec(0, 0), + divisor: math.LegacyMustNewDecFromStr("0"), + expPanic: true, + }, + "divide by zero": { + dividend: math.LegacyNewDecWithPrec(1, 0), + divisor: math.LegacyMustNewDecFromStr("0"), + expPanic: true, + }, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + t.Run("round up", func(t *testing.T) { + t.Parallel() + if !spec.expPanic { + got := spec.dividend.Clone().QuoRoundupMut(spec.divisor.Clone()) + require.Equal(t, spec.expRoundedUp, got.String()) + return + } + require.Panics(t, func() { + _ = spec.dividend.Clone().QuoRoundupMut(spec.divisor.Clone()) + }) + }) + t.Run("truncate", func(t *testing.T) { + t.Parallel() + if !spec.expPanic { + got := spec.dividend.Clone().QuoTruncateMut(spec.divisor.Clone()) + require.Equal(t, spec.expTruncated, got.String()) + return + } + require.Panics(t, func() { + _ = spec.dividend.Clone().QuoTruncateMut(spec.divisor.Clone()) + }) + }) + }) + } +} + +func Test_DocumentLegacyAsymmetry(t *testing.T) { + zeroDec := math.LegacyZeroDec() + emptyDec := math.LegacyDec{} + + zeroDecBz, err := zeroDec.Marshal() + require.NoError(t, err) + zeroDecJSON, err := zeroDec.MarshalJSON() + require.NoError(t, err) + + emptyDecBz, err := emptyDec.Marshal() + require.NoError(t, err) + emptyDecJSON, err := emptyDec.MarshalJSON() + require.NoError(t, err) + + // makes sense, zero and empty are semantically different and render differently + require.NotEqual(t, zeroDecJSON, emptyDecJSON) + // but on the proto wire they encode to the same bytes + require.Equal(t, zeroDecBz, emptyDecBz) + + // zero values are symmetrical + zeroDecRoundTrip := math.LegacyDec{} + err = zeroDecRoundTrip.Unmarshal(zeroDecBz) + require.NoError(t, err) + zeroDecRoundTripJSON, err := zeroDecRoundTrip.MarshalJSON() + require.NoError(t, err) + require.Equal(t, zeroDecJSON, zeroDecRoundTripJSON) + require.Equal(t, zeroDec, zeroDecRoundTrip) + + // empty values are not + emptyDecRoundTrip := math.LegacyDec{} + err = emptyDecRoundTrip.Unmarshal(emptyDecBz) + require.NoError(t, err) + emptyDecRoundTripJSON, err := emptyDecRoundTrip.MarshalJSON() + require.NoError(t, err) + + // !!! this is the key point, they are not equal, it looks like a bug + require.NotEqual(t, emptyDecJSON, emptyDecRoundTripJSON) + require.NotEqual(t, emptyDec, emptyDecRoundTrip) +} + +// 2^256 * 10^18 -1 +const maxValidDecNumber = "115792089237316195423570985008687907853269984665640564039457584007913129639935999999999999999999" + +func TestDecOpsWithinLimits(t *testing.T) { + maxValid, ok := new(big.Int).SetString(maxValidDecNumber, 10) + require.True(t, ok) + minValid := new(big.Int).Neg(maxValid) + specs := map[string]struct { + src *big.Int + expErr bool + }{ + "max": { + src: maxValid, + }, + "max + 1": { + src: new(big.Int).Add(maxValid, big.NewInt(1)), + expErr: true, + }, + "min": { + src: minValid, + }, + "min - 1": { + src: new(big.Int).Sub(minValid, big.NewInt(1)), + expErr: true, + }, + "max Int": { + // max Int is 2^256 -1 + src: math.NewIntFromBigInt(new(big.Int).Sub(new(big.Int).Exp(big.NewInt(2), big.NewInt(256), nil), big.NewInt(1))).BigIntMut(), + }, + "min Int": { + // max Int is -1 *(2^256 -1) + src: math.NewIntFromBigInt(new(big.Int).Neg(new(big.Int).Sub(new(big.Int).Exp(big.NewInt(2), big.NewInt(256), nil), big.NewInt(1)))).BigIntMut(), + }, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + src := math.LegacyNewDecFromBigIntWithPrec(spec.src, 18) + + ops := map[string]struct { + fn func(src math.LegacyDec) math.LegacyDec + }{ + "AddMut": { + fn: func(src math.LegacyDec) math.LegacyDec { return src.AddMut(math.LegacyNewDec(0)) }, + }, + "SubMut": { + fn: func(src math.LegacyDec) math.LegacyDec { return src.SubMut(math.LegacyNewDec(0)) }, + }, + "MulMut": { + fn: func(src math.LegacyDec) math.LegacyDec { return src.MulMut(math.LegacyNewDec(1)) }, + }, + "MulTruncateMut": { + fn: func(src math.LegacyDec) math.LegacyDec { return src.MulTruncateMut(math.LegacyNewDec(1)) }, + }, + "MulRoundUpMut": { + fn: func(src math.LegacyDec) math.LegacyDec { return src.MulRoundUpMut(math.LegacyNewDec(1)) }, + }, + "MulIntMut": { + fn: func(src math.LegacyDec) math.LegacyDec { return src.MulIntMut(math.NewInt(1)) }, + }, + "MulInt64Mut": { + fn: func(src math.LegacyDec) math.LegacyDec { return src.MulInt64Mut(1) }, + }, + "QuoMut": { + fn: func(src math.LegacyDec) math.LegacyDec { return src.QuoMut(math.LegacyNewDec(1)) }, + }, + "QuoTruncateMut": { + fn: func(src math.LegacyDec) math.LegacyDec { return src.QuoTruncateMut(math.LegacyNewDec(1)) }, + }, + "QuoRoundupMut": { + fn: func(src math.LegacyDec) math.LegacyDec { return src.QuoRoundupMut(math.LegacyNewDec(1)) }, + }, + } + for name, op := range ops { + t.Run(name, func(t *testing.T) { + if spec.expErr { + assert.Panics(t, func() { + got := op.fn(src) + t.Log(got.String()) + }) + return + } + exp := src.String() + // exp no panics + got := op.fn(src) + assert.Equal(t, exp, got.String()) + }) + } + }) + } +} + +func TestDecCeilLimits(t *testing.T) { + maxValid, ok := new(big.Int).SetString(maxValidDecNumber, 10) + require.True(t, ok) + minValid := new(big.Int).Neg(maxValid) + + specs := map[string]struct { + src *big.Int + exp string + expErr bool + }{ + "max": { + src: maxValid, + expErr: true, + }, + "max + 1": { + src: new(big.Int).Add(maxValid, big.NewInt(1)), + expErr: true, + }, + "max - 1e18, previous full number": { + src: new(big.Int).Sub(maxValid, new(big.Int).Exp(big.NewInt(10), big.NewInt(18), nil)), + exp: "115792089237316195423570985008687907853269984665640564039457584007913129639935.000000000000000000", + }, + "min": { + src: minValid, + exp: "-115792089237316195423570985008687907853269984665640564039457584007913129639935.000000000000000000", + }, + "min - 1": { + src: new(big.Int).Sub(minValid, big.NewInt(1)), + expErr: true, + }, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + src := math.LegacyNewDecFromBigIntWithPrec(spec.src, 18) + if spec.expErr { + assert.Panics(t, func() { + got := src.Ceil() + t.Log(got.String()) + }) + return + } + got := src.Ceil() + assert.Equal(t, spec.exp, got.String()) + }) + } +} + +func TestTruncateIntLimits(t *testing.T) { + maxValid, ok := new(big.Int).SetString(maxValidDecNumber, 10) + require.True(t, ok) + minValid := new(big.Int).Neg(maxValid) + + specs := map[string]struct { + src *big.Int + exp string + expErr bool + }{ + "max": { + src: maxValid, + exp: "115792089237316195423570985008687907853269984665640564039457584007913129639935", + }, + "max + 1": { + src: new(big.Int).Add(maxValid, big.NewInt(1)), + expErr: true, + }, + "min": { + src: minValid, + exp: "-115792089237316195423570985008687907853269984665640564039457584007913129639935", + }, + "min - 1": { + src: new(big.Int).Sub(minValid, big.NewInt(1)), + expErr: true, + }, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + src := math.LegacyNewDecFromBigIntWithPrec(spec.src, 18) + if spec.expErr { + assert.Panics(t, func() { + got := src.TruncateInt() + t.Log(got.String()) + }) + return + } + got := src.TruncateInt() + assert.Equal(t, spec.exp, got.String()) + }) + } +} + +func TestRoundIntLimits(t *testing.T) { + maxValid, ok := new(big.Int).SetString(maxValidDecNumber, 10) + require.True(t, ok) + minValid := new(big.Int).Neg(maxValid) + oneE18 := new(big.Int).Exp(big.NewInt(10), big.NewInt(18), nil) + + specs := map[string]struct { + src *big.Int + exp string + expErr bool + }{ + "max -1e18; previous full number": { + src: new(big.Int).Sub(maxValid, oneE18), + exp: "115792089237316195423570985008687907853269984665640564039457584007913129639935", + }, + "max": { + src: maxValid, + expErr: true, + }, + "max + 1": { + src: new(big.Int).Add(maxValid, big.NewInt(1)), + expErr: true, + }, + "min + 1e18; previous full number": { + src: new(big.Int).Add(minValid, oneE18), + exp: "-115792089237316195423570985008687907853269984665640564039457584007913129639935", + }, + "min": { + src: minValid, + expErr: true, + }, + "min - 1": { + src: new(big.Int).Sub(minValid, big.NewInt(1)), + expErr: true, + }, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + src := math.LegacyNewDecFromBigIntWithPrec(spec.src, 18) + t.Log(src.String()) + if spec.expErr { + assert.Panics(t, func() { + got := src.RoundInt() + t.Log(got.String()) + }) + return + } + got := src.RoundInt() + assert.Equal(t, spec.exp, got.String()) + }) + } +} + +func BenchmarkIsInValidRange(b *testing.B) { + maxValid, ok := new(big.Int).SetString(maxValidDecNumber, 10) + require.True(b, ok) + souceMax := math.LegacyNewDecFromBigIntWithPrec(maxValid, 18) + b.ResetTimer() + specs := map[string]math.LegacyDec{ + "max": souceMax, + "greater max": math.LegacyNewDecFromBigIntWithPrec(maxValid, 16), + "min": souceMax.Neg(), + "lower min": math.LegacyNewDecFromBigIntWithPrec(new(big.Int).Neg(maxValid), 16), + "zero": math.LegacyZeroDec(), + "one": math.LegacyOneDec(), + } + for name, source := range specs { + b.Run(name, func(b *testing.B) { + for i := 0; i < b.N; i++ { + _ = source.IsInValidRange() + } + }) + } +} diff --git a/math/max_min.go b/math/max_min.go index 407dd816ce68..bf381138429e 100644 --- a/math/max_min.go +++ b/math/max_min.go @@ -1,8 +1,8 @@ package math -import "golang.org/x/exp/constraints" +import "cmp" -func Max[T constraints.Ordered](a, b T, rest ...T) T { +func Max[T cmp.Ordered](a, b T, rest ...T) T { max := a if b > a { max = b @@ -15,7 +15,7 @@ func Max[T constraints.Ordered](a, b T, rest ...T) T { return max } -func Min[T constraints.Ordered](a, b T, rest ...T) T { +func Min[T cmp.Ordered](a, b T, rest ...T) T { min := a if b < a { min = b diff --git a/math/sonar-project.properties b/math/sonar-project.properties index d4a36b3a6e01..8f90cb222b7a 100644 --- a/math/sonar-project.properties +++ b/math/sonar-project.properties @@ -5,10 +5,12 @@ sonar.projectName=Cosmos SDK - Math sonar.project.monorepo.enabled=true sonar.sources=. -sonar.exclusions=**/*_test.go +sonar.exclusions=**/*_test.go,**/*.pb.go,**/*.pulsar.go,**/*.pb.gw.go +sonar.coverage.exclusions=**/*_test.go,**/testutil/**,**/*.pb.go,**/*.pb.gw.go,**/*.pulsar.go,test_helpers.go,docs/** sonar.tests=. sonar.test.inclusions=**/*_test.go sonar.go.coverage.reportPaths=coverage.out sonar.sourceEncoding=UTF-8 -sonar.scm.provider=git \ No newline at end of file +sonar.scm.provider=git +sonar.scm.forceReloadAll=true diff --git a/math/uint.go b/math/uint.go index 406d9418cea1..b780633ef4c0 100644 --- a/math/uint.go +++ b/math/uint.go @@ -15,24 +15,36 @@ type Uint struct { // BigInt converts Uint to big.Int func (u Uint) BigInt() *big.Int { + if u.IsNil() { + return nil + } return new(big.Int).Set(u.i) } +// BigIntMut converts Uint to big.Int, mutative the input +func (u Uint) BigIntMut() *big.Int { + if u.IsNil() { + return nil + } + return u.i +} + // IsNil returns true if Uint is uninitialized func (u Uint) IsNil() bool { return u.i == nil } -// NewUintFromBigUint constructs Uint from big.Uint +// NewUintFromBigInt constructs Uint from big.Int +// Panics if i is negative or wider than 256 bits func NewUintFromBigInt(i *big.Int) Uint { u, err := checkNewUint(i) if err != nil { - panic(fmt.Errorf("overflow: %s", err)) + panic(fmt.Errorf("overflow: %w", err)) } return u } -// NewUint constructs Uint from int64 +// NewUint constructs Uint from uint64 func NewUint(n uint64) Uint { i := new(big.Int) i.SetUint64(n) @@ -40,6 +52,7 @@ func NewUint(n uint64) Uint { } // NewUintFromString constructs Uint from string +// Panics if parsed s is negative or wider than 256 bits func NewUintFromString(s string) Uint { u, err := ParseUint(s) if err != nil { @@ -86,7 +99,7 @@ func (u Uint) LTE(u2 Uint) bool { return !u.GT(u2) } // Add adds Uint from another func (u Uint) Add(u2 Uint) Uint { return NewUintFromBigInt(new(big.Int).Add(u.i, u2.i)) } -// Add convert uint64 and add it to Uint +// AddUint64 convert uint64 and add it to Uint func (u Uint) AddUint64(u2 uint64) Uint { return u.Add(NewUint(u2)) } // Sub adds Uint from another @@ -100,13 +113,14 @@ func (u Uint) Mul(u2 Uint) (res Uint) { return NewUintFromBigInt(new(big.Int).Mul(u.i, u2.i)) } -// Mul multiplies two Uints +// MulUint64 multiplies two Uints func (u Uint) MulUint64(u2 uint64) (res Uint) { return u.Mul(NewUint(u2)) } // Quo divides Uint with Uint func (u Uint) Quo(u2 Uint) (res Uint) { return NewUintFromBigInt(div(u.i, u2.i)) } // Mod returns remainder after dividing with Uint +// Panics if u2 is zero func (u Uint) Mod(u2 Uint) Uint { if u2.IsZero() { panic("division-by-zero") @@ -125,16 +139,16 @@ func (u Uint) Decr() Uint { return u.Sub(OneUint()) } -// Quo divides Uint with uint64 +// QuoUint64 divides Uint with uint64 func (u Uint) QuoUint64(u2 uint64) Uint { return u.Quo(NewUint(u2)) } -// Return the minimum of the Uints +// MinUint returns the minimum of the Uints func MinUint(u1, u2 Uint) Uint { return NewUintFromBigInt(min(u1.i, u2.i)) } -// Return the maximum of the Uints +// MaxUint returns the maximum of the Uints func MaxUint(u1, u2 Uint) Uint { return NewUintFromBigInt(max(u1.i, u2.i)) } -// Human readable string +// String returns human-readable string func (u Uint) String() string { return u.i.String() } // MarshalJSON defines custom encoding scheme @@ -205,7 +219,7 @@ func (u *Uint) Size() int { return len(bz) } -// Override Amino binary serialization by proxying to protobuf. +// MarshalAmino override Amino binary serialization by proxying to protobuf. func (u Uint) MarshalAmino() ([]byte, error) { return u.Marshal() } func (u *Uint) UnmarshalAmino(bz []byte) error { return u.Unmarshal(bz) } @@ -235,7 +249,7 @@ func checkNewUint(i *big.Int) (Uint, error) { if err := UintOverflow(i); err != nil { return Uint{}, err } - return Uint{i}, nil + return Uint{new(big.Int).Set(i)}, nil } // RelativePow raises x to the power of n, where x (and the result, z) are scaled by factor b @@ -243,11 +257,11 @@ func checkNewUint(i *big.Int) (Uint, error) { func RelativePow(x, n, b Uint) (z Uint) { if x.IsZero() { if n.IsZero() { - z = b // 0^0 = 1 - return + z = OneUint() // 0^0 = 1 + return z } z = ZeroUint() // otherwise 0^a = 0 - return + return z } z = x diff --git a/math/uint_test.go b/math/uint_test.go index 428672cb2cea..62a081d5151e 100644 --- a/math/uint_test.go +++ b/math/uint_test.go @@ -8,8 +8,9 @@ import ( "strings" "testing" - sdkmath "cosmossdk.io/math" "github.com/stretchr/testify/suite" + + sdkmath "cosmossdk.io/math" ) type uintTestSuite struct { @@ -68,6 +69,8 @@ func (s *uintTestSuite) TestUintPanics() { s.Require().Panics(func() { uintmin.Sub(sdkmath.OneUint()) }) s.Require().Panics(func() { uintmin.Decr() }) + s.Require().NotPanics(func() { sdkmath.Uint{}.BigInt() }) + s.Require().Equal(uint64(0), sdkmath.MinUint(sdkmath.ZeroUint(), sdkmath.OneUint()).Uint64()) s.Require().Equal(uint64(1), sdkmath.MaxUint(sdkmath.ZeroUint(), sdkmath.OneUint()).Uint64()) @@ -96,6 +99,26 @@ func (s *uintTestSuite) TestIsNil() { s.Require().True(sdkmath.Uint{}.IsNil()) } +func (s *uintTestSuite) TestConvertToBigIntMutativeForUint() { + r := big.NewInt(30) + i := sdkmath.NewUintFromBigInt(r) + + // Compare value of BigInt & BigIntMut + s.Require().Equal(i.BigInt(), i.BigIntMut()) + + // Modify BigIntMut() pointer and ensure i.BigIntMut() & i.BigInt() change + p1 := i.BigIntMut() + p1.SetInt64(40) + s.Require().Equal(big.NewInt(40), i.BigIntMut()) + s.Require().Equal(big.NewInt(40), i.BigInt()) + + // Modify big.Int() pointer and ensure i.BigIntMut() & i.BigInt() don't change + p2 := i.BigInt() + p2.SetInt64(50) + s.Require().NotEqual(big.NewInt(50), i.BigIntMut()) + s.Require().NotEqual(big.NewInt(50), i.BigInt()) +} + func (s *uintTestSuite) TestArithUint() { for d := 0; d < 1000; d++ { n1 := uint64(rand.Uint32()) @@ -221,7 +244,7 @@ func (s *uintTestSuite) TestSafeSub() { } for i, tc := range testCases { - tc := tc + if tc.panic { s.Require().Panics(func() { tc.x.Sub(tc.y) }) continue @@ -260,6 +283,16 @@ func (s *uintTestSuite) TestParseUint() { } } +func (s *uintTestSuite) TestNewUintFromBigInt() { + r := big.NewInt(42) + i := sdkmath.NewUintFromBigInt(r) + s.Require().Equal(r, i.BigInt()) + + // modify r and ensure i doesn't change + r = r.SetInt64(100) + s.Require().NotEqual(r, i.BigInt()) +} + func randuint() sdkmath.Uint { return sdkmath.NewUint(rand.Uint64()) } @@ -270,7 +303,7 @@ func (s *uintTestSuite) TestRelativePow() { want sdkmath.Uint }{ {[]sdkmath.Uint{sdkmath.ZeroUint(), sdkmath.ZeroUint(), sdkmath.OneUint()}, sdkmath.OneUint()}, - {[]sdkmath.Uint{sdkmath.ZeroUint(), sdkmath.ZeroUint(), sdkmath.NewUint(10)}, sdkmath.NewUint(10)}, + {[]sdkmath.Uint{sdkmath.ZeroUint(), sdkmath.ZeroUint(), sdkmath.NewUint(10)}, sdkmath.NewUint(1)}, {[]sdkmath.Uint{sdkmath.ZeroUint(), sdkmath.OneUint(), sdkmath.NewUint(10)}, sdkmath.ZeroUint()}, {[]sdkmath.Uint{sdkmath.NewUint(10), sdkmath.NewUint(2), sdkmath.OneUint()}, sdkmath.NewUint(100)}, {[]sdkmath.Uint{sdkmath.NewUint(210), sdkmath.NewUint(2), sdkmath.NewUint(100)}, sdkmath.NewUint(441)}, @@ -310,7 +343,6 @@ func TestRoundTripMarshalToUint(t *testing.T) { } for _, value := range values { - value := value t.Run(fmt.Sprintf("%d", value), func(t *testing.T) { t.Parallel() diff --git a/orm/CHANGELOG.md b/orm/CHANGELOG.md deleted file mode 100644 index ba73a0d75a89..000000000000 --- a/orm/CHANGELOG.md +++ /dev/null @@ -1,55 +0,0 @@ - - -# Changelog - -## [Unreleased] - -### Feature - -* [#15320](https://github.com/cosmos/cosmos-sdk/pull/15320) Add current sequence getter (`LastInsertedSequence`) for auto increment tables. - -### API Breaking Changes - -* [#15870](https://github.com/cosmos/cosmos-sdk/pull/15870) Rename the orm package to `cosmossdk.io/orm`. -* [#14822](https://github.com/cosmos/cosmos-sdk/pull/14822) Migrate to cosmossdk.io/core genesis API. - -### State-machine Breaking Changes - -* [#12273](https://github.com/cosmos/cosmos-sdk/pull/12273) The timestamp key encoding was reworked to properly handle nil values. Existing users will need to manually migrate their data to the new encoding before upgrading. -* [#15138](https://github.com/cosmos/cosmos-sdk/pull/15138) The duration key encoding was reworked to properly handle nil values. Existing users will need to manually migrate their data to the new encoding before upgrading. - -### Bug Fixes - -* [#16023](https://github.com/cosmos/cosmos-sdk/pull/16023) Fix bugs introduced by lack of CI tests in [#15138](https://github.com/cosmos/cosmos-sdk/pull/15138) and [#15813](https://github.com/cosmos/cosmos-sdk/pull/15813). This changes the duration encoding in [#15138](https://github.com/cosmos/cosmos-sdk/pull/15138) to correctly order values with negative nanos. diff --git a/orm/Makefile b/orm/Makefile deleted file mode 100644 index 8914a830f72c..000000000000 --- a/orm/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -codegen: - go install ./cmd/protoc-gen-go-cosmos-orm - go install ./cmd/protoc-gen-go-cosmos-orm-proto - # generate .proto files first - (cd internal; buf generate --template buf.proto.gen.yaml) - # generate go code - (cd internal; buf generate) \ No newline at end of file diff --git a/orm/README.md b/orm/README.md deleted file mode 100644 index 14bc84b8812a..000000000000 --- a/orm/README.md +++ /dev/null @@ -1,329 +0,0 @@ -# ORM - -The Cosmos SDK ORM is a state management library that provides a rich, but opinionated set of tools for managing a -module's state. It provides support for: - -* type safe management of state -* multipart keys -* secondary indexes -* unique indexes -* easy prefix and range queries -* automatic genesis import/export -* automatic query services for clients, including support for light client proofs (still in development) -* indexing state data in external databases (still in development) - -## Design and Philosophy - -The ORM's data model is inspired by the relational data model found in SQL databases. The core abstraction is a table -with a primary key and optional secondary indexes. - -Because the Cosmos SDK uses protobuf as its encoding layer, ORM tables are defined directly in .proto files using -protobuf options. Each table is defined by a single protobuf `message` type and a schema of multiple tables is -represented by a single .proto file. - -Table structure is specified in the same file where messages are defined in order to make it easy to focus on better -design of the state layer. Because blockchain state layout is part of the public API for clients (TODO: link to docs on -light client proofs), it is important to think about the state layout as being part of the public API of a module. -Changing the state layout actually breaks clients, so it is ideal to think through it carefully up front and to aim for -a design that will eliminate or minimize breaking changes down the road. Also, good design of state enables building -more performant and sophisticated applications. Providing users with a set of tools inspired by relational databases -which have a long history of database design best practices and allowing schema to be specified declaratively in a -single place are design choices the ORM makes to enable better design and more durable APIs. - -Also, by only supporting the table abstraction as opposed to key-value pair maps, it is easy to add to new -columns/fields to any data structure without causing a breaking change and the data structures can easily be indexed in -any off-the-shelf SQL database for more sophisticated queries. - -The encoding of fields in keys is designed to support ordered iteration for all protobuf primitive field types -except for `bytes` as well as the well-known types `google.protobuf.Timestamp` and `google.protobuf.Duration`. Encodings -are optimized for storage space when it makes sense (see the documentation in `cosmos/orm/v1/orm.proto` for more details) -and table rows do not use extra storage space to store key fields in the value. - -We recommend that users of the ORM attempt to follow database design best practices such as -[normalization](https://en.wikipedia.org/wiki/Database_normalization) (at least 1NF). -For instance, defining `repeated` fields in a table is considered an anti-pattern because breaks first normal form (1NF). -Although we support `repeated` fields in tables, they cannot be used as key fields for this reason. This may seem -restrictive but years of best practice (and also experience in the SDK) have shown that following this pattern -leads to easier to maintain schemas. - -To illustrate the motivation for these principles with an example from the SDK, historically balances were stored -as a mapping from account -> map of denom to amount. This did not scale well because an account with 100 token balances -needed to be encoded/decoded every time a single coin balance changed. Now balances are stored as account,denom -> amount -as in the example above. With the ORM's data model, if we wanted to add a new field to `Balance` such as -`unlocked_balance` (if vesting accounts were redesigned in this way), it would be easy to add it to this table without -requiring a data migration. Because of the ORM's optimizations, the account and denom are only stored in the key part -of storage and not in the value leading to both a flexible data model and efficient usage of storage. - -## Defining Tables - -To define a table: - -1) create a .proto file to describe the module's state (naming it `state.proto` is recommended for consistency), -and import "cosmos/orm/v1/orm.proto", ex: - -```protobuf -syntax = "proto3"; -package bank_example; - -import "cosmos/orm/v1/orm.proto"; -``` - -2) define a `message` for the table, ex: - -```protobuf -message Balance { - bytes account = 1; - string denom = 2; - uint64 balance = 3; -} -``` - -3) add the `cosmos.orm.v1.table` option to the table and give the table an `id` unique within this .proto file: - -```protobuf -message Balance { - option (cosmos.orm.v1.table) = { - id: 1 - }; - - bytes account = 1; - string denom = 2; - uint64 balance = 3; -} -``` - -4) define the primary key field or fields, as a comma-separated list of the fields from the message which should make -up the primary key: - -```protobuf -message Balance { - option (cosmos.orm.v1.table) = { - id: 1 - primary_key: { fields: "account,denom" } - }; - - bytes account = 1; - string denom = 2; - uint64 balance = 3; -} -``` - -5) add any desired secondary indexes by specifying an `id` unique within the table and a comma-separate list of the -index fields: - -```protobuf -message Balance { - option (cosmos.orm.v1.table) = { - id: 1; - primary_key: { fields: "account,denom" } - index: { id: 1 fields: "denom" } // this allows querying for the accounts which own a denom - }; - - bytes account = 1; - string denom = 2; - uint64 amount = 3; -} -``` - -### Auto-incrementing Primary Keys - -A common pattern in SDK modules and in database design is to define tables with a single integer `id` field with an -automatically generated primary key. In the ORM we can do this by setting the `auto_increment` option to `true` on the -primary key, ex: - -```protobuf -message Account { - option (cosmos.orm.v1.table) = { - id: 2; - primary_key: { fields: "id", auto_increment: true } - }; - - uint64 id = 1; - bytes address = 2; -} -``` - -### Unique Indexes - -A unique index can be added by setting the `unique` option to `true` on an index, ex: - -```protobuf -message Account { - option (cosmos.orm.v1.table) = { - id: 2; - primary_key: { fields: "id", auto_increment: true } - index: {id: 1, fields: "address", unique: true} - }; - - uint64 id = 1; - bytes address = 2; -} -``` - -### Singletons - -The ORM also supports a special type of table with only one row called a `singleton`. This can be used for storing -module parameters. Singletons only need to define a unique `id` and that cannot conflict with the id of other -tables or singletons in the same .proto file. Ex: - -```protobuf -message Params { - option (cosmos.orm.v1.singleton) = { - id: 3; - }; - - google.protobuf.Duration voting_period = 1; - uint64 min_threshold = 2; -} -``` - -## Running Codegen - -NOTE: the ORM will only work with protobuf code that implements the [google.golang.org/protobuf](https://pkg.go.dev/google.golang.org/protobuf) -API. That means it will not work with code generated using gogo-proto. - -To install the ORM's code generator, run: - -```shell -go install cosmossdk.io/orm/cmd/protoc-gen-go-cosmos-orm@latest -``` - -The recommended way to run the code generator is to use [buf build](https://docs.buf.build/build/usage). -This is an example `buf.gen.yaml` that runs `protoc-gen-go`, `protoc-gen-go-grpc` and `protoc-gen-go-cosmos-orm` -using buf managed mode: - -```yaml -version: v1 -managed: - enabled: true - go_package_prefix: - default: foo.bar/api # the go package prefix of your package - override: - buf.build/cosmos/cosmos-sdk: cosmossdk.io/api # required to import the Cosmos SDK api module -plugins: - - name: go - out: . - opt: paths=source_relative - - name: go-grpc - out: . - opt: paths=source_relative - - name: go-cosmos-orm - out: . - opt: paths=source_relative -``` - -## Using the ORM in a module - -### Initialization - -To use the ORM in a module, first create a `ModuleSchemaDescriptor`. This tells the ORM which .proto files have defined -an ORM schema and assigns them all a unique non-zero id. Ex: - -```go -var MyModuleSchema = &ormv1alpha1.ModuleSchemaDescriptor{ - SchemaFile: []*ormv1alpha1.ModuleSchemaDescriptor_FileEntry{ - { - Id: 1, - ProtoFileName: mymodule.File_my_module_state_proto.Path(), - }, - }, -} -``` - -In the ORM generated code for a file named `state.proto`, there should be an interface `StateStore` that got generated -with a constructor `NewStateStore` that takes a parameter of type `ormdb.ModuleDB`. Add a reference to `StateStore` -to your module's keeper struct. Ex: - -```go -type Keeper struct { - db StateStore -} -``` - -Then instantiate the `StateStore` instance via an `ormdb.ModuleDB` that is instantiated from the `SchemaDescriptor` -above and one or more store services from `cosmossdk.io/core/store`. Ex: - -```go -func NewKeeper(storeService store.KVStoreService) (*Keeper, error) { - modDb, err := ormdb.NewModuleDB(MyModuleSchema, ormdb.ModuleDBOptions{KVStoreService: storeService}) - if err != nil { - return nil, err - } - db, err := NewStateStore(modDb) - if err != nil { - return nil, err - } - return Keeper{db: db}, nil -} -``` - -### Using the generated code - -The generated code for the ORM contains methods for inserting, updating, deleting and querying table entries. -For each table in a .proto file, there is a type-safe table interface implemented in generated code. For instance, -for a table named `Balance` there should be a `BalanceTable` interface that looks like this: - -```go -type BalanceTable interface { - Insert(ctx context.Context, balance *Balance) error - Update(ctx context.Context, balance *Balance) error - Save(ctx context.Context, balance *Balance) error - Delete(ctx context.Context, balance *Balance) error - Has(ctx context.Context, acocunt []byte, denom 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, acocunt []byte, denom string) (*Balance, error) - List(ctx context.Context, prefixKey BalanceIndexKey, opts ...ormlist.Option) (BalanceIterator, error) - ListRange(ctx context.Context, from, to BalanceIndexKey, opts ...ormlist.Option) (BalanceIterator, error) - DeleteBy(ctx context.Context, prefixKey BalanceIndexKey) error - DeleteRange(ctx context.Context, from, to BalanceIndexKey) error - - doNotImplement() -} -``` - -This `BalanceTable` should be accessible from the `StateStore` interface (assuming our file is named `state.proto`) -via a `BalanceTable()` accessor method. If all the above example tables/singletons were in the same `state.proto`, -then `StateStore` would get generated like this: - -```go -type BankStore interface { - BalanceTable() BalanceTable - AccountTable() AccountTable - ParamsTable() ParamsTable - - doNotImplement() -} -``` - -So to work with the `BalanceTable` in a keeper method we could use code like this: - -```go -func (k keeper) AddBalance(ctx context.Context, acct []byte, denom string, amount uint64) error { - balance, err := k.db.BalanceTable().Get(ctx, acct, denom) - if err != nil && !ormerrors.IsNotFound(err) { - return err - } - - if balance == nil { - balance = &Balance{ - Account: acct, - Denom: denom, - Amount: amount, - } - } else { - balance.Amount = balance.Amount + amount - } - - return k.db.BalanceTable().Save(ctx, balance) -} -``` - -`List` methods take `IndexKey` parameters. For instance, `BalanceTable.List` takes `BalanceIndexKey`. `BalanceIndexKey` -let's represent index keys for the different indexes (primary and secondary) on the `Balance` table. The primary key -in the `Balance` table gets a struct `BalanceAccountDenomIndexKey` and the first index gets an index key `BalanceDenomIndexKey`. -If we wanted to list all the denoms and amounts that an account holds, we would use `BalanceAccountDenomIndexKey` -with a `List` query just on the account prefix. Ex: - -```go -it, err := keeper.db.BalanceTable().List(ctx, BalanceAccountDenomIndexKey{}.WithAccount(acct)) -``` diff --git a/orm/cmd/protoc-gen-go-cosmos-orm-proto/main.go b/orm/cmd/protoc-gen-go-cosmos-orm-proto/main.go deleted file mode 100644 index 0c3db5cf6b30..000000000000 --- a/orm/cmd/protoc-gen-go-cosmos-orm-proto/main.go +++ /dev/null @@ -1,11 +0,0 @@ -package main - -import ( - "google.golang.org/protobuf/compiler/protogen" - - "cosmossdk.io/orm/internal/codegen" -) - -func main() { - protogen.Options{}.Run(codegen.QueryProtoPluginRunner) -} diff --git a/orm/cmd/protoc-gen-go-cosmos-orm/main.go b/orm/cmd/protoc-gen-go-cosmos-orm/main.go deleted file mode 100644 index bc83d887b6fe..000000000000 --- a/orm/cmd/protoc-gen-go-cosmos-orm/main.go +++ /dev/null @@ -1,11 +0,0 @@ -package main - -import ( - "google.golang.org/protobuf/compiler/protogen" - - "cosmossdk.io/orm/internal/codegen" -) - -func main() { - protogen.Options{}.Run(codegen.ORMPluginRunner) -} diff --git a/orm/encoding/docs.go b/orm/encoding/docs.go deleted file mode 100644 index 7088a0e488e5..000000000000 --- a/orm/encoding/docs.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package encoding defines the core types and algorithms for encoding and decoding -// protobuf objects and values to/from ORM key-value pairs. -package encoding diff --git a/orm/encoding/encodeutil/util.go b/orm/encoding/encodeutil/util.go deleted file mode 100644 index 0d84093803f2..000000000000 --- a/orm/encoding/encodeutil/util.go +++ /dev/null @@ -1,54 +0,0 @@ -package encodeutil - -import ( - "bytes" - "encoding/binary" - "io" - "reflect" - - "google.golang.org/protobuf/reflect/protoreflect" -) - -// SkipPrefix skips the provided prefix in the reader or returns an error. -// This is used for efficient logical decoding of keys. -func SkipPrefix(r *bytes.Reader, prefix []byte) error { - n := len(prefix) - if n > 0 { - // we skip checking the prefix for performance reasons because we assume - // that it was checked by the caller - _, err := r.Seek(int64(n), io.SeekCurrent) - return err - } - return nil -} - -// AppendVarUInt32 creates a new key prefix, by encoding and appending a -// var-uint32 to the provided prefix. -func AppendVarUInt32(prefix []byte, x uint32) []byte { - prefixLen := len(prefix) - res := make([]byte, prefixLen+binary.MaxVarintLen32) - copy(res, prefix) - n := binary.PutUvarint(res[prefixLen:], uint64(x)) - return res[:prefixLen+n] -} - -// ValuesOf takes the arguments and converts them to protoreflect.Value's. -func ValuesOf(values ...interface{}) []protoreflect.Value { - n := len(values) - res := make([]protoreflect.Value, n) - for i := 0; i < n; i++ { - // we catch the case of proto messages here and call ProtoReflect. - // this allows us to use imported messages, such as timestamppb.Timestamp - // in iterators. - value := values[i] - if v, ok := value.(protoreflect.ProtoMessage); ok { - if !reflect.ValueOf(value).IsNil() { - value = v.ProtoReflect() - } else { - value = nil - } - } - res[i] = protoreflect.ValueOf(value) - } - return res -} diff --git a/orm/encoding/ormfield/bool.go b/orm/encoding/ormfield/bool.go deleted file mode 100644 index 454963b607ae..000000000000 --- a/orm/encoding/ormfield/bool.go +++ /dev/null @@ -1,60 +0,0 @@ -package ormfield - -import ( - io "io" - - "google.golang.org/protobuf/reflect/protoreflect" -) - -// BoolCodec encodes a bool value as a single byte 0 or 1. -type BoolCodec struct{} - -func (b BoolCodec) Decode(r Reader) (protoreflect.Value, error) { - x, err := r.ReadByte() - return protoreflect.ValueOfBool(x != 0), err -} - -var ( - zeroBz = []byte{0} - oneBz = []byte{1} -) - -func (b BoolCodec) Encode(value protoreflect.Value, w io.Writer) error { - var err error - if !value.IsValid() || !value.Bool() { - _, err = w.Write(zeroBz) - } else { - _, err = w.Write(oneBz) - } - return err -} - -func (b BoolCodec) Compare(v1, v2 protoreflect.Value) int { - var b1, b2 bool - if v1.IsValid() { - b1 = v1.Bool() - } - if v2.IsValid() { - b2 = v2.Bool() - } - switch { - case b1 == b2: - return 0 - case b1: - return -1 - default: - return 1 - } -} - -func (b BoolCodec) IsOrdered() bool { - return false -} - -func (b BoolCodec) FixedBufferSize() int { - return 1 -} - -func (b BoolCodec) ComputeBufferSize(protoreflect.Value) (int, error) { - return b.FixedBufferSize(), nil -} diff --git a/orm/encoding/ormfield/bytes.go b/orm/encoding/ormfield/bytes.go deleted file mode 100644 index 0eea476b8a47..000000000000 --- a/orm/encoding/ormfield/bytes.go +++ /dev/null @@ -1,121 +0,0 @@ -package ormfield - -import ( - "bytes" - "encoding/binary" - "io" - - "google.golang.org/protobuf/reflect/protoreflect" -) - -// BytesCodec encodes bytes as raw bytes. It errors if the byte array is longer -// than 255 bytes. -type BytesCodec struct{} - -func (b BytesCodec) FixedBufferSize() int { - return -1 -} - -// ComputeBufferSize returns the bytes size of the value. -func (b BytesCodec) ComputeBufferSize(value protoreflect.Value) (int, error) { - return bytesSize(value), nil -} - -func bytesSize(value protoreflect.Value) int { - if !value.IsValid() { - return 0 - } - return len(value.Bytes()) -} - -func (b BytesCodec) IsOrdered() bool { - return false -} - -func (b BytesCodec) Decode(r Reader) (protoreflect.Value, error) { - bz, err := io.ReadAll(r) - return protoreflect.ValueOfBytes(bz), err -} - -func (b BytesCodec) Encode(value protoreflect.Value, w io.Writer) error { - if !value.IsValid() { - return nil - } - _, err := w.Write(value.Bytes()) - return err -} - -func (b BytesCodec) Compare(v1, v2 protoreflect.Value) int { - return compareBytes(v1, v2) -} - -// NonTerminalBytesCodec encodes bytes as raw bytes length prefixed by a single -// byte. It errors if the byte array is longer than 255 bytes. -type NonTerminalBytesCodec struct{} - -func (b NonTerminalBytesCodec) FixedBufferSize() int { - return -1 -} - -// ComputeBufferSize returns the bytes size of the value plus the length of the -// varint length-prefix. -func (b NonTerminalBytesCodec) ComputeBufferSize(value protoreflect.Value) (int, error) { - n := bytesSize(value) - prefixLen := 1 - // we use varint, if the first bit of a byte is 1 then we need to signal continuation - for n >= 0x80 { - prefixLen++ - n >>= 7 - } - return n + prefixLen, nil -} - -func (b NonTerminalBytesCodec) IsOrdered() bool { - return false -} - -func (b NonTerminalBytesCodec) Compare(v1, v2 protoreflect.Value) int { - return compareBytes(v1, v2) -} - -func (b NonTerminalBytesCodec) Decode(r Reader) (protoreflect.Value, error) { - n, err := binary.ReadUvarint(r) - if err != nil { - return protoreflect.Value{}, err - } - - if n == 0 { - return protoreflect.ValueOfBytes([]byte{}), nil - } - - bz := make([]byte, n) - _, err = r.Read(bz) - return protoreflect.ValueOfBytes(bz), err -} - -func (b NonTerminalBytesCodec) Encode(value protoreflect.Value, w io.Writer) error { - var bz []byte - if value.IsValid() { - bz = value.Bytes() - } - n := len(bz) - var prefix [binary.MaxVarintLen64]byte - prefixLen := binary.PutUvarint(prefix[:], uint64(n)) - _, err := w.Write(prefix[:prefixLen]) - if err != nil { - return err - } - _, err = w.Write(bz) - return err -} - -func compareBytes(v1, v2 protoreflect.Value) int { - var bz1, bz2 []byte - if v1.IsValid() { - bz1 = v1.Bytes() - } - if v2.IsValid() { - bz2 = v2.Bytes() - } - return bytes.Compare(bz1, bz2) -} diff --git a/orm/encoding/ormfield/codec.go b/orm/encoding/ormfield/codec.go deleted file mode 100644 index ae18c5953935..000000000000 --- a/orm/encoding/ormfield/codec.go +++ /dev/null @@ -1,113 +0,0 @@ -package ormfield - -import ( - "io" - - "cosmossdk.io/orm/types/ormerrors" - - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/types/known/durationpb" - "google.golang.org/protobuf/types/known/timestamppb" -) - -// Codec defines an interface for decoding and encoding values in ORM index keys. -type Codec interface { - // Decode decodes a value in a key. - Decode(r Reader) (protoreflect.Value, error) - - // Encode encodes a value in a key. - Encode(value protoreflect.Value, w io.Writer) error - - // Compare compares two values of this type and should primarily be used - // for testing. - Compare(v1, v2 protoreflect.Value) int - - // IsOrdered returns true if callers can always assume that this ordering - // is suitable for sorted iteration. - IsOrdered() bool - - // FixedBufferSize returns a positive value if encoders should assume a - // fixed size buffer for encoding. Encoders will use at most this much size - // to encode the value. - FixedBufferSize() int - - // ComputeBufferSize estimates the buffer size needed to encode the field. - // Encoders will use at most this much size to encode the value. - ComputeBufferSize(value protoreflect.Value) (int, error) -} - -type Reader interface { - io.Reader - io.ByteReader -} - -var ( - timestampMsgType = (×tamppb.Timestamp{}).ProtoReflect().Type() - timestampFullName = timestampMsgType.Descriptor().FullName() - durationMsgType = (&durationpb.Duration{}).ProtoReflect().Type() - durationFullName = durationMsgType.Descriptor().FullName() -) - -// GetCodec returns the Codec for the provided field if one is defined. -// nonTerminal should be set to true if this value is being encoded as a -// non-terminal segment of a multi-part key. -func GetCodec(field protoreflect.FieldDescriptor, nonTerminal bool) (Codec, error) { - if field == nil { - return nil, ormerrors.InvalidKeyField.Wrap("nil field") - } - if field.IsList() { - return nil, ormerrors.InvalidKeyField.Wrapf("repeated field %s", field.FullName()) - } - - if field.ContainingOneof() != nil { - return nil, ormerrors.InvalidKeyField.Wrapf("oneof field %s", field.FullName()) - } - - if field.HasOptionalKeyword() { - return nil, ormerrors.InvalidKeyField.Wrapf("optional field %s", field.FullName()) - } - - switch field.Kind() { - case protoreflect.BytesKind: - if nonTerminal { - return NonTerminalBytesCodec{}, nil - } - - return BytesCodec{}, nil - case protoreflect.StringKind: - if nonTerminal { - return NonTerminalStringCodec{}, nil - } - - return StringCodec{}, nil - - case protoreflect.Uint32Kind: - return CompactUint32Codec{}, nil - case protoreflect.Fixed32Kind: - return FixedUint32Codec{}, nil - case protoreflect.Uint64Kind: - return CompactUint64Codec{}, nil - case protoreflect.Fixed64Kind: - return FixedUint64Codec{}, nil - case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: - return Int32Codec{}, nil - case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: - return Int64Codec{}, nil - case protoreflect.BoolKind: - return BoolCodec{}, nil - case protoreflect.EnumKind: - return EnumCodec{}, nil - case protoreflect.MessageKind: - msgName := field.Message().FullName() - switch msgName { - case timestampFullName: - return TimestampCodec{}, nil - case durationFullName: - return DurationCodec{}, nil - default: - return nil, ormerrors.InvalidKeyField.Wrapf("%s of type %s", field.FullName(), msgName) - } - default: - return nil, ormerrors.InvalidKeyField.Wrapf("%s of kind %s", field.FullName(), field.Kind()) - } -} diff --git a/orm/encoding/ormfield/codec_test.go b/orm/encoding/ormfield/codec_test.go deleted file mode 100644 index b9e00281d466..000000000000 --- a/orm/encoding/ormfield/codec_test.go +++ /dev/null @@ -1,171 +0,0 @@ -package ormfield_test - -import ( - "bytes" - "fmt" - "testing" - - "google.golang.org/protobuf/reflect/protoreflect" - "gotest.tools/v3/assert" - "pgregory.net/rapid" - - "cosmossdk.io/orm/encoding/ormfield" - "cosmossdk.io/orm/internal/testutil" - "cosmossdk.io/orm/types/ormerrors" -) - -func TestCodec(t *testing.T) { - for _, ks := range testutil.TestFieldSpecs { - testCodec(t, ks) - } -} - -func testCodec(t *testing.T, spec testutil.TestFieldSpec) { - t.Run(fmt.Sprintf("%s %v", spec.FieldName, false), func(t *testing.T) { - testCodecNT(t, spec.FieldName, spec.Gen, false) - }) - t.Run(fmt.Sprintf("%s %v", spec.FieldName, true), func(t *testing.T) { - testCodecNT(t, spec.FieldName, spec.Gen, true) - }) -} - -func testCodecNT(t *testing.T, fname protoreflect.Name, generator *rapid.Generator[any], nonTerminal bool) { - cdc, err := testutil.MakeTestCodec(fname, nonTerminal) - assert.NilError(t, err) - rapid.Check(t, func(t *rapid.T) { - x := protoreflect.ValueOf(generator.Draw(t, string(fname))) - bz1 := checkEncodeDecodeSize(t, x, cdc) - if cdc.IsOrdered() { - y := protoreflect.ValueOf(generator.Draw(t, fmt.Sprintf("%s 2", fname))) - bz2 := checkEncodeDecodeSize(t, y, cdc) - assert.Equal(t, cdc.Compare(x, y), bytes.Compare(bz1, bz2)) - } - }) -} - -func checkEncodeDecodeSize(t *rapid.T, x protoreflect.Value, cdc ormfield.Codec) []byte { - buf := &bytes.Buffer{} - err := cdc.Encode(x, buf) - assert.NilError(t, err) - bz := buf.Bytes() - size, err := cdc.ComputeBufferSize(x) - assert.NilError(t, err) - assert.Assert(t, size >= len(bz)) - fixedSize := cdc.FixedBufferSize() - if fixedSize > 0 { - assert.Equal(t, fixedSize, size) - } - y, err := cdc.Decode(bytes.NewReader(bz)) - assert.NilError(t, err) - assert.Equal(t, 0, cdc.Compare(x, y)) - return bz -} - -func TestUnsupportedFields(t *testing.T) { - _, err := ormfield.GetCodec(nil, false) - assert.ErrorContains(t, err, ormerrors.InvalidKeyField.Error()) - _, err = ormfield.GetCodec(testutil.GetTestField("repeated"), false) - assert.ErrorContains(t, err, ormerrors.InvalidKeyField.Error()) - _, err = ormfield.GetCodec(testutil.GetTestField("map"), false) - assert.ErrorContains(t, err, ormerrors.InvalidKeyField.Error()) - _, err = ormfield.GetCodec(testutil.GetTestField("msg"), false) - assert.ErrorContains(t, err, ormerrors.InvalidKeyField.Error()) - _, err = ormfield.GetCodec(testutil.GetTestField("oneof"), false) - assert.ErrorContains(t, err, ormerrors.InvalidKeyField.Error()) -} - -func TestCompactUInt32(t *testing.T) { - var lastBz []byte - testEncodeDecode := func(x uint32, expectedLen int) { - bz := ormfield.EncodeCompactUint32(x) - assert.Equal(t, expectedLen, len(bz)) - y, err := ormfield.DecodeCompactUint32(bytes.NewReader(bz)) - assert.NilError(t, err) - assert.Equal(t, x, y) - assert.Assert(t, bytes.Compare(lastBz, bz) < 0) - lastBz = bz - } - - testEncodeDecode(64, 2) - testEncodeDecode(16383, 2) - testEncodeDecode(16384, 3) - testEncodeDecode(4194303, 3) - testEncodeDecode(4194304, 4) - testEncodeDecode(1073741823, 4) - testEncodeDecode(1073741824, 5) - - // randomized tests - rapid.Check(t, func(t *rapid.T) { - x := rapid.Uint32().Draw(t, "x") - y := rapid.Uint32().Draw(t, "y") - - bx := ormfield.EncodeCompactUint32(x) - by := ormfield.EncodeCompactUint32(y) - - cmp := bytes.Compare(bx, by) - switch { - case x < y: - assert.Equal(t, -1, cmp) - case x == y: - assert.Equal(t, 0, cmp) - default: - assert.Equal(t, 1, cmp) - } - - x2, err := ormfield.DecodeCompactUint32(bytes.NewReader(bx)) - assert.NilError(t, err) - assert.Equal(t, x, x2) - y2, err := ormfield.DecodeCompactUint32(bytes.NewReader(by)) - assert.NilError(t, err) - assert.Equal(t, y, y2) - }) -} - -func TestCompactUInt64(t *testing.T) { - var lastBz []byte - testEncodeDecode := func(x uint64, expectedLen int) { - bz := ormfield.EncodeCompactUint64(x) - assert.Equal(t, expectedLen, len(bz)) - y, err := ormfield.DecodeCompactUint64(bytes.NewReader(bz)) - assert.NilError(t, err) - assert.Equal(t, x, y) - assert.Assert(t, bytes.Compare(lastBz, bz) < 0) - lastBz = bz - } - - testEncodeDecode(64, 2) - testEncodeDecode(16383, 2) - testEncodeDecode(16384, 4) - testEncodeDecode(4194303, 4) - testEncodeDecode(4194304, 4) - testEncodeDecode(1073741823, 4) - testEncodeDecode(1073741824, 6) - testEncodeDecode(70368744177663, 6) - testEncodeDecode(70368744177664, 9) - - // randomized tests - rapid.Check(t, func(t *rapid.T) { - x := rapid.Uint64().Draw(t, "x") - y := rapid.Uint64().Draw(t, "y") - - bx := ormfield.EncodeCompactUint64(x) - by := ormfield.EncodeCompactUint64(y) - - cmp := bytes.Compare(bx, by) - switch { - case x < y: - assert.Equal(t, -1, cmp) - case x == y: - assert.Equal(t, 0, cmp) - default: - assert.Equal(t, 1, cmp) - } - - x2, err := ormfield.DecodeCompactUint64(bytes.NewReader(bx)) - assert.NilError(t, err) - assert.Equal(t, x, x2) - y2, err := ormfield.DecodeCompactUint64(bytes.NewReader(by)) - assert.NilError(t, err) - assert.Equal(t, y, y2) - }) -} diff --git a/orm/encoding/ormfield/duration.go b/orm/encoding/ormfield/duration.go deleted file mode 100644 index 078d0ca61477..000000000000 --- a/orm/encoding/ormfield/duration.go +++ /dev/null @@ -1,193 +0,0 @@ -package ormfield - -import ( - "fmt" - io "io" - - "google.golang.org/protobuf/reflect/protoreflect" -) - -const ( - DurationSecondsMin int64 = -315576000000 - DurationSecondsMax int64 = 315576000000 - DurationNanosMin = -999999999 - DurationNanosMax = 999999999 -) - -// DurationCodec encodes google.protobuf.Duration values with the following -// encoding: -// - nil is encoded as []byte{0xFF} -// - seconds (which can range from -315,576,000,000 to +315,576,000,000) is encoded as 5 fixed bytes -// - nanos (which can range from 0 to 999,999,999 or -999,999,999 to 0 if seconds is negative) is encoded as: -// - []byte{0x0} for zero nanos -// - 4 fixed bytes with the bit mask 0xC0 applied to the first byte, with negative nanos scaled so that -999,999,999 -// is encoded as 1 and -1 is encoded as 999,999,999 -// -// When iterating over timestamp indexes, nil values will always be ordered last. -// -// Values for seconds and nanos outside the ranges specified by google.protobuf.Duration will be rejected. -type DurationCodec struct{} - -func (d DurationCodec) Encode(value protoreflect.Value, w io.Writer) error { - // nil case - if !value.IsValid() { - _, err := w.Write(timestampDurationNilBz) - return err - } - - seconds, nanos := getDurationSecondsAndNanos(value) - secondsInt := seconds.Int() - if secondsInt < DurationSecondsMin || secondsInt > DurationSecondsMax { - return fmt.Errorf("duration seconds is out of range %d, must be between %d and %d", secondsInt, DurationSecondsMin, DurationSecondsMax) - } - negative := secondsInt < 0 - // we subtract the min duration value to make sure secondsInt is always non-negative and starts at 0. - secondsInt -= DurationSecondsMin - err := encodeSeconds(secondsInt, w) - if err != nil { - return err - } - - nanosInt := nanos.Int() - if nanosInt == 0 { - _, err = w.Write(timestampZeroNanosBz) - return err - } - - if negative { - if nanosInt < DurationNanosMin || nanosInt > 0 { - return fmt.Errorf("negative duration nanos is out of range %d, must be between %d and %d", nanosInt, DurationNanosMin, 0) - } - nanosInt = DurationNanosMax + nanosInt + 1 - } else if nanosInt < 0 || nanosInt > DurationNanosMax { - return fmt.Errorf("duration nanos is out of range %d, must be between %d and %d", nanosInt, 0, DurationNanosMax) - } - - return encodeNanos(nanosInt, w) -} - -func (d DurationCodec) Decode(r Reader) (protoreflect.Value, error) { - isNil, seconds, err := decodeSeconds(r) - if isNil || err != nil { - return protoreflect.Value{}, err - } - - // we add the min duration value to get back the original value - seconds += DurationSecondsMin - - negative := seconds < 0 - - msg := durationMsgType.New() - msg.Set(durationSecondsField, protoreflect.ValueOfInt64(seconds)) - - nanos, err := decodeNanos(r) - if err != nil { - return protoreflect.Value{}, err - } - - if nanos == 0 { - return protoreflect.ValueOfMessage(msg), nil - } - - if negative { - nanos = nanos - DurationNanosMax - 1 - } - - msg.Set(durationNanosField, protoreflect.ValueOfInt32(nanos)) - return protoreflect.ValueOfMessage(msg), nil -} - -func (d DurationCodec) Compare(v1, v2 protoreflect.Value) int { - if !v1.IsValid() { - if !v2.IsValid() { - return 0 - } - return 1 - } - - if !v2.IsValid() { - return -1 - } - - s1, n1 := getDurationSecondsAndNanos(v1) - s2, n2 := getDurationSecondsAndNanos(v2) - c := compareInt(s1, s2) - if c != 0 { - return c - } - - return compareInt(n1, n2) -} - -func (d DurationCodec) IsOrdered() bool { - return true -} - -func (d DurationCodec) FixedBufferSize() int { - return timestampDurationBufferSize -} - -func (d DurationCodec) ComputeBufferSize(protoreflect.Value) (int, error) { - return timestampDurationBufferSize, nil -} - -var ( - durationSecondsField = durationMsgType.Descriptor().Fields().ByName("seconds") - durationNanosField = durationMsgType.Descriptor().Fields().ByName("nanos") -) - -func getDurationSecondsAndNanos(value protoreflect.Value) (protoreflect.Value, protoreflect.Value) { - msg := value.Message() - return msg.Get(durationSecondsField), msg.Get(durationNanosField) -} - -// DurationV0Codec encodes a google.protobuf.Duration value as 12 bytes using -// Int64Codec for seconds followed by Int32Codec for nanos. This allows for -// sorted iteration. -type DurationV0Codec struct{} - -func (d DurationV0Codec) Decode(r Reader) (protoreflect.Value, error) { - seconds, err := int64Codec.Decode(r) - if err != nil { - return protoreflect.Value{}, err - } - nanos, err := int32Codec.Decode(r) - if err != nil { - return protoreflect.Value{}, err - } - msg := durationMsgType.New() - msg.Set(durationSecondsField, seconds) - msg.Set(durationNanosField, nanos) - return protoreflect.ValueOfMessage(msg), nil -} - -func (d DurationV0Codec) Encode(value protoreflect.Value, w io.Writer) error { - seconds, nanos := getDurationSecondsAndNanos(value) - err := int64Codec.Encode(seconds, w) - if err != nil { - return err - } - return int32Codec.Encode(nanos, w) -} - -func (d DurationV0Codec) Compare(v1, v2 protoreflect.Value) int { - s1, n1 := getDurationSecondsAndNanos(v1) - s2, n2 := getDurationSecondsAndNanos(v2) - c := compareInt(s1, s2) - if c != 0 { - return c - } - return compareInt(n1, n2) -} - -func (d DurationV0Codec) IsOrdered() bool { - return true -} - -func (d DurationV0Codec) FixedBufferSize() int { - return 12 -} - -func (d DurationV0Codec) ComputeBufferSize(protoreflect.Value) (int, error) { - return d.FixedBufferSize(), nil -} diff --git a/orm/encoding/ormfield/duration_test.go b/orm/encoding/ormfield/duration_test.go deleted file mode 100644 index 0e0d1d1217e3..000000000000 --- a/orm/encoding/ormfield/duration_test.go +++ /dev/null @@ -1,281 +0,0 @@ -package ormfield_test - -import ( - "bytes" - "testing" - "time" - - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/types/known/durationpb" - "gotest.tools/v3/assert" - - "cosmossdk.io/orm/encoding/ormfield" -) - -func TestDurationNil(t *testing.T) { - t.Parallel() - - cdc := ormfield.DurationCodec{} - buf := &bytes.Buffer{} - assert.NilError(t, cdc.Encode(protoreflect.Value{}, buf)) - assert.Equal(t, 1, len(buf.Bytes())) - val, err := cdc.Decode(buf) - assert.NilError(t, err) - assert.Assert(t, !val.IsValid()) -} - -func TestDuration(t *testing.T) { - t.Parallel() - cdc := ormfield.DurationCodec{} - - tt := []struct { - name string - seconds int64 - nanos int32 - wantLen int - }{ - { - "no nanos", - 100, - 0, - 6, - }, - { - "with nanos", - 3, - 879468295, - 9, - }, - { - "min seconds, -1 nanos", - -315576000000, - -1, - 9, - }, - { - "min value", - -315576000000, - -999999999, - 9, - }, - { - "max value", - 315576000000, - 999999999, - 9, - }, - { - "max seconds, 1 nanos", - 315576000000, - 1, - 9, - }, - } - - for _, tc := range tt { - t.Run(tc.name, func(t *testing.T) { - durPb := &durationpb.Duration{ - Seconds: tc.seconds, - Nanos: tc.nanos, - } - val := protoreflect.ValueOfMessage(durPb.ProtoReflect()) - buf := &bytes.Buffer{} - assert.NilError(t, cdc.Encode(val, buf)) - assert.Equal(t, tc.wantLen, len(buf.Bytes())) - val2, err := cdc.Decode(buf) - assert.NilError(t, err) - assert.Equal(t, 0, cdc.Compare(val, val2)) - }) - } -} - -func TestDurationOutOfRange(t *testing.T) { - t.Parallel() - cdc := ormfield.DurationCodec{} - - tt := []struct { - name string - dur *durationpb.Duration - expectErr string - }{ - { - name: "seconds too small", - dur: &durationpb.Duration{ - Seconds: -315576000001, - Nanos: 0, - }, - expectErr: "seconds is out of range", - }, - { - name: "seconds too big", - dur: &durationpb.Duration{ - Seconds: 315576000001, - Nanos: 0, - }, - expectErr: "seconds is out of range", - }, - { - name: "positive seconds negative nanos", - dur: &durationpb.Duration{ - Seconds: 0, - Nanos: -1, - }, - expectErr: "nanos is out of range", - }, - { - name: "positive seconds nanos too big", - dur: &durationpb.Duration{ - Seconds: 0, - Nanos: 1000000000, - }, - expectErr: "nanos is out of range", - }, - { - name: "negative seconds positive nanos", - dur: &durationpb.Duration{ - Seconds: -1, - Nanos: 1, - }, - expectErr: "negative duration nanos is out of range", - }, - { - name: "negative seconds nanos too small", - dur: &durationpb.Duration{ - Seconds: -1, - Nanos: -1000000000, - }, - expectErr: "negative duration nanos is out of range", - }, - } - for _, tc := range tt { - tc := tc - t.Run(tc.name, func(t *testing.T) { - t.Parallel() - val := protoreflect.ValueOfMessage(tc.dur.ProtoReflect()) - buf := &bytes.Buffer{} - err := cdc.Encode(val, buf) - assert.ErrorContains(t, err, tc.expectErr) - }) - } -} - -func TestDurationCompare(t *testing.T) { - t.Parallel() - cdc := ormfield.DurationCodec{} - - tt := []struct { - name string - dur1 *durationpb.Duration - dur2 *durationpb.Duration - want int - }{ - { - name: "equal", - dur1: &durationpb.Duration{ - Seconds: 1, - Nanos: 1, - }, - dur2: &durationpb.Duration{ - Seconds: 1, - Nanos: 1, - }, - want: 0, - }, - { - name: "seconds equal, dur1 nanos less than dur2 nanos", - dur1: &durationpb.Duration{ - Seconds: 1, - Nanos: 1, - }, - dur2: &durationpb.Duration{ - Seconds: 1, - Nanos: 2, - }, - want: -1, - }, - { - name: "seconds equal, dur1 nanos greater than dur2 nanos", - dur1: &durationpb.Duration{ - Seconds: 1, - Nanos: 2, - }, - dur2: &durationpb.Duration{ - Seconds: 1, - Nanos: 1, - }, - want: 1, - }, - { - name: "seconds less than", - dur1: &durationpb.Duration{ - Seconds: 1, - Nanos: 1, - }, - dur2: &durationpb.Duration{ - Seconds: 2, - Nanos: 1, - }, - want: -1, - }, - { - name: "seconds greater than", - dur1: &durationpb.Duration{ - Seconds: 2, - Nanos: 1, - }, - dur2: &durationpb.Duration{ - Seconds: 1, - Nanos: 1, - }, - want: 1, - }, - { - name: "negative seconds equal, dur1 nanos less than dur2 nanos", - dur1: &durationpb.Duration{ - Seconds: -1, - Nanos: -2, - }, - dur2: &durationpb.Duration{ - Seconds: -1, - Nanos: -1, - }, - want: -1, - }, - } - - for _, tc := range tt { - tc := tc - t.Run(tc.name, func(t *testing.T) { - t.Parallel() - - val1 := protoreflect.ValueOfMessage(tc.dur1.ProtoReflect()) - val2 := protoreflect.ValueOfMessage(tc.dur2.ProtoReflect()) - got := cdc.Compare(val1, val2) - assert.Equal(t, tc.want, got, "Compare(%v, %v)", tc.dur1, tc.dur2) - - bz1 := encodeValue(t, cdc, val1) - bz2 := encodeValue(t, cdc, val2) - assert.Equal(t, tc.want, bytes.Compare(bz1, bz2), "bytes.Compare(%v, %v)", bz1, bz2) - }) - } - - t.Run("nanos", func(t *testing.T) { - t.Parallel() - dur, err := time.ParseDuration("3879468295ns") - assert.NilError(t, err) - durPb := durationpb.New(dur) - val := protoreflect.ValueOfMessage(durPb.ProtoReflect()) - buf := &bytes.Buffer{} - assert.NilError(t, cdc.Encode(val, buf)) - assert.Equal(t, 9, len(buf.Bytes())) - val2, err := cdc.Decode(buf) - assert.NilError(t, err) - assert.Equal(t, 0, cdc.Compare(val, val2)) - }) -} - -func encodeValue(t *testing.T, cdc ormfield.Codec, val protoreflect.Value) []byte { - buf := &bytes.Buffer{} - assert.NilError(t, cdc.Encode(val, buf)) - return buf.Bytes() -} diff --git a/orm/encoding/ormfield/enum.go b/orm/encoding/ormfield/enum.go deleted file mode 100644 index 03b95a3821bf..000000000000 --- a/orm/encoding/ormfield/enum.go +++ /dev/null @@ -1,57 +0,0 @@ -package ormfield - -import ( - "encoding/binary" - io "io" - - "google.golang.org/protobuf/reflect/protoreflect" -) - -// EnumCodec encodes enum values as varints. -type EnumCodec struct{} - -func (e EnumCodec) Decode(r Reader) (protoreflect.Value, error) { - x, err := binary.ReadVarint(r) - return protoreflect.ValueOfEnum(protoreflect.EnumNumber(x)), err -} - -func (e EnumCodec) Encode(value protoreflect.Value, w io.Writer) error { - var x protoreflect.EnumNumber - if value.IsValid() { - x = value.Enum() - } - buf := make([]byte, binary.MaxVarintLen32) - n := binary.PutVarint(buf, int64(x)) - _, err := w.Write(buf[:n]) - return err -} - -func (e EnumCodec) Compare(v1, v2 protoreflect.Value) int { - var x, y protoreflect.EnumNumber - if v1.IsValid() { - x = v1.Enum() - } - if v2.IsValid() { - y = v2.Enum() - } - switch { - case x == y: - return 0 - case x < y: - return -1 - default: - return 1 - } -} - -func (e EnumCodec) IsOrdered() bool { - return false -} - -func (e EnumCodec) FixedBufferSize() int { - return binary.MaxVarintLen32 -} - -func (e EnumCodec) ComputeBufferSize(protoreflect.Value) (int, error) { - return e.FixedBufferSize(), nil -} diff --git a/orm/encoding/ormfield/int32.go b/orm/encoding/ormfield/int32.go deleted file mode 100644 index 8b2dd9331af8..000000000000 --- a/orm/encoding/ormfield/int32.go +++ /dev/null @@ -1,52 +0,0 @@ -package ormfield - -import ( - "encoding/binary" - io "io" - - "google.golang.org/protobuf/reflect/protoreflect" -) - -// Int32Codec encodes 32-bit integers as big-endian unsigned 32-bit integers -// by adding the maximum value of int32 (2147583647) + 1 before encoding so -// that these values can be used for ordered iteration. -type Int32Codec struct{} - -var int32Codec = Int32Codec{} - -const ( - int32Max = 2147483647 - int32Offset = int32Max + 1 -) - -func (i Int32Codec) Decode(r Reader) (protoreflect.Value, error) { - var x uint32 - err := binary.Read(r, binary.BigEndian, &x) - y := int64(x) - int32Offset - return protoreflect.ValueOfInt32(int32(y)), err -} - -func (i Int32Codec) Encode(value protoreflect.Value, w io.Writer) error { - var x int64 - if value.IsValid() { - x = value.Int() - } - x += int32Offset - return binary.Write(w, binary.BigEndian, uint32(x)) -} - -func (i Int32Codec) Compare(v1, v2 protoreflect.Value) int { - return compareInt(v1, v2) -} - -func (i Int32Codec) IsOrdered() bool { - return true -} - -func (i Int32Codec) FixedBufferSize() int { - return 4 -} - -func (i Int32Codec) ComputeBufferSize(protoreflect.Value) (int, error) { - return i.FixedBufferSize(), nil -} diff --git a/orm/encoding/ormfield/int64.go b/orm/encoding/ormfield/int64.go deleted file mode 100644 index 1a1230ef206e..000000000000 --- a/orm/encoding/ormfield/int64.go +++ /dev/null @@ -1,78 +0,0 @@ -package ormfield - -import ( - "encoding/binary" - io "io" - - "google.golang.org/protobuf/reflect/protoreflect" -) - -// Int64Codec encodes 64-bit integers as big-endian unsigned 64-bit integers -// by adding the maximum value of int32 (9223372036854775807) + 1 before encoding so -// that these values can be used for ordered iteration. -type Int64Codec struct{} - -var int64Codec = Int64Codec{} - -const int64Max = 9223372036854775807 - -func (i Int64Codec) Decode(r Reader) (protoreflect.Value, error) { - var x uint64 - err := binary.Read(r, binary.BigEndian, &x) - if x >= int64Max { - x = x - int64Max - 1 - return protoreflect.ValueOfInt64(int64(x)), err - } - - y := int64(x) - int64Max - 1 - return protoreflect.ValueOfInt64(y), err -} - -func (i Int64Codec) Encode(value protoreflect.Value, w io.Writer) error { - var x int64 - if value.IsValid() { - x = value.Int() - } - if x >= -1 { - y := uint64(x) + int64Max + 1 - return binary.Write(w, binary.BigEndian, y) - } - - x += int64Max - x++ - return binary.Write(w, binary.BigEndian, uint64(x)) -} - -func (i Int64Codec) Compare(v1, v2 protoreflect.Value) int { - return compareInt(v1, v2) -} - -func (i Int64Codec) IsOrdered() bool { - return true -} - -func (i Int64Codec) FixedBufferSize() int { - return 8 -} - -func (i Int64Codec) ComputeBufferSize(protoreflect.Value) (int, error) { - return i.FixedBufferSize(), nil -} - -func compareInt(v1, v2 protoreflect.Value) int { - var x, y int64 - if v1.IsValid() { - x = v1.Int() - } - if v2.IsValid() { - y = v2.Int() - } - switch { - case x == y: - return 0 - case x < y: - return -1 - default: - return 1 - } -} diff --git a/orm/encoding/ormfield/string.go b/orm/encoding/ormfield/string.go deleted file mode 100644 index e052efab31d4..000000000000 --- a/orm/encoding/ormfield/string.go +++ /dev/null @@ -1,109 +0,0 @@ -package ormfield - -import ( - "fmt" - "io" - "strings" - - "google.golang.org/protobuf/reflect/protoreflect" -) - -// StringCodec encodes strings as raw bytes. -type StringCodec struct{} - -func (s StringCodec) FixedBufferSize() int { - return -1 -} - -func (s StringCodec) ComputeBufferSize(value protoreflect.Value) (int, error) { - if !value.IsValid() { - return 0, nil - } - - return len(value.String()), nil -} - -func (s StringCodec) IsOrdered() bool { - return true -} - -func (s StringCodec) Compare(v1, v2 protoreflect.Value) int { - return compareStrings(v1, v2) -} - -func (s StringCodec) Decode(r Reader) (protoreflect.Value, error) { - bz, err := io.ReadAll(r) - return protoreflect.ValueOfString(string(bz)), err -} - -func (s StringCodec) Encode(value protoreflect.Value, w io.Writer) error { - var x string - if value.IsValid() { - x = value.String() - } - _, err := w.Write([]byte(x)) - return err -} - -// NonTerminalStringCodec encodes strings as null-terminated raw bytes. Null -// values within strings will produce an error. -type NonTerminalStringCodec struct{} - -func (s NonTerminalStringCodec) FixedBufferSize() int { - return -1 -} - -func (s NonTerminalStringCodec) ComputeBufferSize(value protoreflect.Value) (int, error) { - return len(value.String()) + 1, nil -} - -func (s NonTerminalStringCodec) IsOrdered() bool { - return true -} - -func (s NonTerminalStringCodec) Compare(v1, v2 protoreflect.Value) int { - return compareStrings(v1, v2) -} - -func (s NonTerminalStringCodec) Decode(r Reader) (protoreflect.Value, error) { - var bz []byte - for { - b, err := r.ReadByte() - if b == 0 || err == io.EOF { - return protoreflect.ValueOfString(string(bz)), err - } - bz = append(bz, b) - } -} - -func (s NonTerminalStringCodec) Encode(value protoreflect.Value, w io.Writer) error { - var str string - if value.IsValid() { - str = value.String() - } - bz := []byte(str) - for _, b := range bz { - if b == 0 { - return fmt.Errorf("illegal null terminator found in index string: %s", str) - } - } - _, err := w.Write([]byte(str)) - if err != nil { - return err - } - _, err = w.Write(nullTerminator) - return err -} - -var nullTerminator = []byte{0} - -func compareStrings(v1, v2 protoreflect.Value) int { - var x, y string - if v1.IsValid() { - x = v1.String() - } - if v2.IsValid() { - y = v2.String() - } - return strings.Compare(x, y) -} diff --git a/orm/encoding/ormfield/timestamp.go b/orm/encoding/ormfield/timestamp.go deleted file mode 100644 index 0049b13f156a..000000000000 --- a/orm/encoding/ormfield/timestamp.go +++ /dev/null @@ -1,266 +0,0 @@ -package ormfield - -import ( - "fmt" - "io" - - "google.golang.org/protobuf/reflect/protoreflect" -) - -// TimestampCodec encodes google.protobuf.Timestamp values with the following -// encoding: -// - nil is encoded as []byte{0xFF} -// - seconds (which can range from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z) is encoded as 5 fixed bytes -// - nanos (which can range from 0 to 999,999,999) is encoded as: -// - []byte{0x0} for zero nanos -// - 4 fixed bytes with the bit mask 0xC0 applied to the first byte -// -// When iterating over timestamp indexes, nil values will always be ordered last. -// -// Values for seconds and nanos outside the ranges specified by google.protobuf.Timestamp will be rejected. -type TimestampCodec struct{} - -const ( - timestampDurationNilValue = 0xFF - timestampDurationZeroNanosValue = 0x0 - timestampDurationBufferSize = 9 - TimestampSecondsMin int64 = -62135596800 - TimestampSecondsMax int64 = 253402300799 - TimestampNanosMax = 999999999 -) - -var ( - timestampDurationNilBz = []byte{timestampDurationNilValue} - timestampZeroNanosBz = []byte{timestampDurationZeroNanosValue} -) - -func (t TimestampCodec) Encode(value protoreflect.Value, w io.Writer) error { - // nil case - if !value.IsValid() { - _, err := w.Write(timestampDurationNilBz) - return err - } - - seconds, nanos := getTimestampSecondsAndNanos(value) - secondsInt := seconds.Int() - if secondsInt < TimestampSecondsMin || secondsInt > TimestampSecondsMax { - return fmt.Errorf("timestamp seconds is out of range %d, must be between %d and %d", secondsInt, TimestampSecondsMin, TimestampSecondsMax) - } - secondsInt -= TimestampSecondsMin - err := encodeSeconds(secondsInt, w) - if err != nil { - return err - } - - nanosInt := nanos.Int() - if nanosInt == 0 { - _, err = w.Write(timestampZeroNanosBz) - return err - } - - if nanosInt < 0 || nanosInt > TimestampNanosMax { - return fmt.Errorf("timestamp nanos is out of range %d, must be between %d and %d", secondsInt, 0, TimestampNanosMax) - } - - return encodeNanos(nanosInt, w) -} - -func encodeSeconds(secondsInt int64, w io.Writer) error { - var secondsBz [5]byte - // write the seconds buffer from the end to the front - for i := 4; i >= 0; i-- { - secondsBz[i] = byte(secondsInt) - secondsInt >>= 8 - } - _, err := w.Write(secondsBz[:]) - return err -} - -func encodeNanos(nanosInt int64, w io.Writer) error { - var nanosBz [4]byte - for i := 3; i >= 0; i-- { - nanosBz[i] = byte(nanosInt) - nanosInt >>= 8 - } - nanosBz[0] |= 0xC0 - _, err := w.Write(nanosBz[:]) - return err -} - -func (t TimestampCodec) Decode(r Reader) (protoreflect.Value, error) { - isNil, seconds, err := decodeSeconds(r) - if isNil || err != nil { - return protoreflect.Value{}, err - } - - seconds += TimestampSecondsMin - - msg := timestampMsgType.New() - msg.Set(timestampSecondsField, protoreflect.ValueOfInt64(seconds)) - - nanos, err := decodeNanos(r) - if err != nil { - return protoreflect.Value{}, err - } - - if nanos == 0 { - return protoreflect.ValueOfMessage(msg), nil - } - - msg.Set(timestampNanosField, protoreflect.ValueOfInt32(nanos)) - return protoreflect.ValueOfMessage(msg), nil -} - -func decodeSeconds(r Reader) (isNil bool, seconds int64, err error) { - b0, err := r.ReadByte() - if err != nil { - return false, 0, err - } - - if b0 == timestampDurationNilValue { - return true, 0, nil - } - - var secondsBz [4]byte - n, err := r.Read(secondsBz[:]) - if err != nil { - return false, 0, err - } - if n < 4 { - return false, 0, io.EOF - } - - seconds = int64(b0) - for i := 0; i < 4; i++ { - seconds <<= 8 - seconds |= int64(secondsBz[i]) - } - - return false, seconds, nil -} - -func decodeNanos(r Reader) (int32, error) { - b0, err := r.ReadByte() - if err != nil { - return 0, err - } - - if b0 == timestampDurationZeroNanosValue { - return 0, nil - } - - var nanosBz [3]byte - n, err := r.Read(nanosBz[:]) - if err != nil { - return 0, err - } - if n < 3 { - return 0, io.EOF - } - - nanos := int32(b0) & 0x3F // clear first two bits - for i := 0; i < 3; i++ { - nanos <<= 8 - nanos |= int32(nanosBz[i]) - } - - return nanos, nil -} - -func (t TimestampCodec) Compare(v1, v2 protoreflect.Value) int { - if !v1.IsValid() { - if !v2.IsValid() { - return 0 - } - return 1 - } - - if !v2.IsValid() { - return -1 - } - - s1, n1 := getTimestampSecondsAndNanos(v1) - s2, n2 := getTimestampSecondsAndNanos(v2) - c := compareInt(s1, s2) - if c != 0 { - return c - } - - return compareInt(n1, n2) -} - -func (t TimestampCodec) IsOrdered() bool { - return true -} - -func (t TimestampCodec) FixedBufferSize() int { - return timestampDurationBufferSize -} - -func (t TimestampCodec) ComputeBufferSize(protoreflect.Value) (int, error) { - return timestampDurationBufferSize, nil -} - -// TimestampV0Codec encodes a google.protobuf.Timestamp value as 12 bytes using -// Int64Codec for seconds followed by Int32Codec for nanos. This type does not -// encode nil values correctly, but is retained in order to allow users of the -// previous encoding to successfully migrate from this encoding to the new encoding -// specified by TimestampCodec. -type TimestampV0Codec struct{} - -var ( - timestampSecondsField = timestampMsgType.Descriptor().Fields().ByName("seconds") - timestampNanosField = timestampMsgType.Descriptor().Fields().ByName("nanos") -) - -func getTimestampSecondsAndNanos(value protoreflect.Value) (protoreflect.Value, protoreflect.Value) { - msg := value.Message() - return msg.Get(timestampSecondsField), msg.Get(timestampNanosField) -} - -func (t TimestampV0Codec) Decode(r Reader) (protoreflect.Value, error) { - seconds, err := int64Codec.Decode(r) - if err != nil { - return protoreflect.Value{}, err - } - nanos, err := int32Codec.Decode(r) - if err != nil { - return protoreflect.Value{}, err - } - msg := timestampMsgType.New() - msg.Set(timestampSecondsField, seconds) - msg.Set(timestampNanosField, nanos) - return protoreflect.ValueOfMessage(msg), nil -} - -func (t TimestampV0Codec) Encode(value protoreflect.Value, w io.Writer) error { - seconds, nanos := getTimestampSecondsAndNanos(value) - err := int64Codec.Encode(seconds, w) - if err != nil { - return err - } - return int32Codec.Encode(nanos, w) -} - -func (t TimestampV0Codec) Compare(v1, v2 protoreflect.Value) int { - s1, n1 := getTimestampSecondsAndNanos(v1) - s2, n2 := getTimestampSecondsAndNanos(v2) - c := compareInt(s1, s2) - if c != 0 { - return c - } - - return compareInt(n1, n2) -} - -func (t TimestampV0Codec) IsOrdered() bool { - return true -} - -func (t TimestampV0Codec) FixedBufferSize() int { - return 12 -} - -func (t TimestampV0Codec) ComputeBufferSize(protoreflect.Value) (int, error) { - return t.FixedBufferSize(), nil -} diff --git a/orm/encoding/ormfield/timestamp_test.go b/orm/encoding/ormfield/timestamp_test.go deleted file mode 100644 index 52b7caeadacd..000000000000 --- a/orm/encoding/ormfield/timestamp_test.go +++ /dev/null @@ -1,126 +0,0 @@ -package ormfield_test - -import ( - "bytes" - "testing" - "time" - - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/types/known/timestamppb" - "gotest.tools/v3/assert" - - "cosmossdk.io/orm/encoding/ormfield" -) - -func TestTimestamp(t *testing.T) { - t.Parallel() - cdc := ormfield.TimestampCodec{} - - t.Run("nil value", func(t *testing.T) { - t.Parallel() - buf := &bytes.Buffer{} - assert.NilError(t, cdc.Encode(protoreflect.Value{}, buf)) - assert.Equal(t, 1, len(buf.Bytes())) - val, err := cdc.Decode(buf) - assert.NilError(t, err) - assert.Assert(t, !val.IsValid()) - }) - - t.Run("no nanos", func(t *testing.T) { - t.Parallel() - ts := timestamppb.New(time.Date(2022, 1, 1, 12, 30, 15, 0, time.UTC)) - val := protoreflect.ValueOfMessage(ts.ProtoReflect()) - buf := &bytes.Buffer{} - assert.NilError(t, cdc.Encode(val, buf)) - assert.Equal(t, 6, len(buf.Bytes())) - val2, err := cdc.Decode(buf) - assert.NilError(t, err) - assert.Equal(t, 0, cdc.Compare(val, val2)) - }) - - t.Run("nanos", func(t *testing.T) { - t.Parallel() - ts := timestamppb.New(time.Date(2022, 1, 1, 12, 30, 15, 235809753, time.UTC)) - val := protoreflect.ValueOfMessage(ts.ProtoReflect()) - buf := &bytes.Buffer{} - assert.NilError(t, cdc.Encode(val, buf)) - assert.Equal(t, 9, len(buf.Bytes())) - val2, err := cdc.Decode(buf) - assert.NilError(t, err) - assert.Equal(t, 0, cdc.Compare(val, val2)) - }) - - t.Run("min value", func(t *testing.T) { - t.Parallel() - ts := timestamppb.New(time.Date(1, 1, 1, 0, 0, 0, 0, time.UTC)) - val := protoreflect.ValueOfMessage(ts.ProtoReflect()) - buf := &bytes.Buffer{} - assert.NilError(t, cdc.Encode(val, buf)) - assert.Equal(t, 6, len(buf.Bytes())) - assert.Assert(t, bytes.Equal(buf.Bytes(), []byte{0, 0, 0, 0, 0, 0})) // the minimum value should be all zeros - val2, err := cdc.Decode(buf) - assert.NilError(t, err) - assert.Equal(t, 0, cdc.Compare(val, val2)) - }) - - t.Run("max value", func(t *testing.T) { - t.Parallel() - ts := timestamppb.New(time.Date(9999, 12, 31, 23, 59, 59, 999999999, time.UTC)) - val := protoreflect.ValueOfMessage(ts.ProtoReflect()) - buf := &bytes.Buffer{} - assert.NilError(t, cdc.Encode(val, buf)) - assert.Equal(t, 9, len(buf.Bytes())) - val2, err := cdc.Decode(buf) - assert.NilError(t, err) - assert.Equal(t, 0, cdc.Compare(val, val2)) - }) -} - -func TestTimestampOutOfRange(t *testing.T) { - t.Parallel() - cdc := ormfield.TimestampCodec{} - - tt := []struct { - name string - ts *timestamppb.Timestamp - expectErr string - }{ - { - name: "before min", - ts: timestamppb.New(time.Date(0, 1, 1, 0, 0, 0, 0, time.UTC)), - expectErr: "timestamp seconds is out of range", - }, - { - name: "after max", - ts: timestamppb.New(time.Date(10000, 1, 1, 0, 0, 0, 0, time.UTC)), - expectErr: "timestamp seconds is out of range", - }, - { - name: "nanos too small", - ts: ×tamppb.Timestamp{ - Seconds: 0, - Nanos: -1, - }, - expectErr: "timestamp nanos is out of range", - }, - - { - name: "nanos too big", - ts: ×tamppb.Timestamp{ - Seconds: 0, - Nanos: 1000000000, - }, - expectErr: "timestamp nanos is out of range", - }, - } - for _, tc := range tt { - tc := tc - t.Run(tc.name, func(t *testing.T) { - t.Parallel() - val := protoreflect.ValueOfMessage(tc.ts.ProtoReflect()) - buf := &bytes.Buffer{} - err := cdc.Encode(val, buf) - assert.ErrorContains(t, err, tc.expectErr) - }) - } -} diff --git a/orm/encoding/ormfield/uint32.go b/orm/encoding/ormfield/uint32.go deleted file mode 100644 index 0e770ad6b482..000000000000 --- a/orm/encoding/ormfield/uint32.go +++ /dev/null @@ -1,188 +0,0 @@ -package ormfield - -import ( - "encoding/binary" - "fmt" - "io" - - "google.golang.org/protobuf/reflect/protoreflect" -) - -// FixedUint32Codec encodes uint32 values as 4-byte big-endian integers. -type FixedUint32Codec struct{} - -func (u FixedUint32Codec) FixedBufferSize() int { - return 4 -} - -func (u FixedUint32Codec) ComputeBufferSize(protoreflect.Value) (int, error) { - return u.FixedBufferSize(), nil -} - -func (u FixedUint32Codec) IsOrdered() bool { - return true -} - -func (u FixedUint32Codec) Compare(v1, v2 protoreflect.Value) int { - return compareUint(v1, v2) -} - -func (u FixedUint32Codec) Decode(r Reader) (protoreflect.Value, error) { - var x uint32 - err := binary.Read(r, binary.BigEndian, &x) - return protoreflect.ValueOfUint32(x), err -} - -func (u FixedUint32Codec) Encode(value protoreflect.Value, w io.Writer) error { - var x uint64 - if value.IsValid() { - x = value.Uint() - } - return binary.Write(w, binary.BigEndian, uint32(x)) -} - -// CompactUint32Codec encodes uint32 values using EncodeCompactUint32. -type CompactUint32Codec struct{} - -func (c CompactUint32Codec) Decode(r Reader) (protoreflect.Value, error) { - x, err := DecodeCompactUint32(r) - return protoreflect.ValueOfUint32(x), err -} - -func (c CompactUint32Codec) Encode(value protoreflect.Value, w io.Writer) error { - var x uint64 - if value.IsValid() { - x = value.Uint() - } - _, err := w.Write(EncodeCompactUint32(uint32(x))) - return err -} - -func (c CompactUint32Codec) Compare(v1, v2 protoreflect.Value) int { - return compareUint(v1, v2) -} - -func (c CompactUint32Codec) IsOrdered() bool { - return true -} - -func (c CompactUint32Codec) FixedBufferSize() int { - return 5 -} - -func (c CompactUint32Codec) ComputeBufferSize(protoreflect.Value) (int, error) { - return c.FixedBufferSize(), nil -} - -// EncodeCompactUint32 encodes uint32 values in 2,3,4 or 5 bytes. -// Unlike regular varints, this encoding is -// suitable for ordered prefix scans. The length of the output + 2 is encoded -// in the first 2 bits of the first byte and the remaining bits encoded with -// big-endian ordering. -// Values less than 2^14 fill fit in 2 bytes, values less than 2^22 will -// fit in 3, and values less than 2^30 will fit in 4. -func EncodeCompactUint32(x uint32) []byte { - switch { - case x < 16384: // 2^14 - buf := make([]byte, 2) - buf[0] = byte(x >> 8) - buf[1] = byte(x) - return buf - case x < 4194304: // 2^22 - buf := make([]byte, 3) - buf[0] = 0x40 - buf[0] |= byte(x >> 16) - buf[1] = byte(x >> 8) - buf[2] = byte(x) - return buf - case x < 1073741824: // 2^30 - buf := make([]byte, 4) - buf[0] = 0x80 - buf[0] |= byte(x >> 24) - buf[1] = byte(x >> 16) - buf[2] = byte(x >> 8) - buf[3] = byte(x) - return buf - default: - buf := make([]byte, 5) - buf[0] = 0xC0 - buf[0] |= byte(x >> 26) - buf[1] = byte(x >> 18) - buf[2] = byte(x >> 10) - buf[3] = byte(x >> 2) - buf[4] = byte(x) & 0x3 - return buf - } -} - -// DecodeCompactUint32 decodes a uint32 encoded with EncodeCompactU32. -func DecodeCompactUint32(reader io.Reader) (uint32, error) { - var buf [5]byte - - n, err := reader.Read(buf[:1]) - if err != nil { - return 0, err - } - if n < 1 { - return 0, io.ErrUnexpectedEOF - } - - switch buf[0] >> 6 { - case 0: - n, err := reader.Read(buf[1:2]) - if err != nil { - return 0, err - } - if n < 1 { - return 0, io.ErrUnexpectedEOF - } - - x := uint32(buf[0]) << 8 - x |= uint32(buf[1]) - return x, nil - case 1: - n, err := reader.Read(buf[1:3]) - if err != nil { - return 0, err - } - if n < 2 { - return 0, io.ErrUnexpectedEOF - } - - x := (uint32(buf[0]) & 0x3F) << 16 - x |= uint32(buf[1]) << 8 - x |= uint32(buf[2]) - return x, nil - case 2: - n, err := reader.Read(buf[1:4]) - if err != nil { - return 0, err - } - if n < 3 { - return 0, io.ErrUnexpectedEOF - } - - x := (uint32(buf[0]) & 0x3F) << 24 - x |= uint32(buf[1]) << 16 - x |= uint32(buf[2]) << 8 - x |= uint32(buf[3]) - return x, nil - case 3: - n, err := reader.Read(buf[1:5]) - if err != nil { - return 0, err - } - if n < 4 { - return 0, io.ErrUnexpectedEOF - } - - x := (uint32(buf[0]) & 0x3F) << 26 - x |= uint32(buf[1]) << 18 - x |= uint32(buf[2]) << 10 - x |= uint32(buf[3]) << 2 - x |= uint32(buf[4]) - return x, nil - default: - return 0, fmt.Errorf("unexpected case") - } -} diff --git a/orm/encoding/ormfield/uint64.go b/orm/encoding/ormfield/uint64.go deleted file mode 100644 index 8623e516b155..000000000000 --- a/orm/encoding/ormfield/uint64.go +++ /dev/null @@ -1,218 +0,0 @@ -package ormfield - -import ( - "encoding/binary" - "fmt" - "io" - - "google.golang.org/protobuf/reflect/protoreflect" -) - -// FixedUint64Codec encodes uint64 values as 8-byte big-endian integers. -type FixedUint64Codec struct{} - -func (u FixedUint64Codec) FixedBufferSize() int { - return 8 -} - -func (u FixedUint64Codec) ComputeBufferSize(protoreflect.Value) (int, error) { - return u.FixedBufferSize(), nil -} - -func (u FixedUint64Codec) IsOrdered() bool { - return true -} - -func (u FixedUint64Codec) Compare(v1, v2 protoreflect.Value) int { - return compareUint(v1, v2) -} - -func (u FixedUint64Codec) Decode(r Reader) (protoreflect.Value, error) { - var x uint64 - err := binary.Read(r, binary.BigEndian, &x) - return protoreflect.ValueOfUint64(x), err -} - -func (u FixedUint64Codec) Encode(value protoreflect.Value, w io.Writer) error { - var x uint64 - if value.IsValid() { - x = value.Uint() - } - return binary.Write(w, binary.BigEndian, x) -} - -func compareUint(v1, v2 protoreflect.Value) int { - var x, y uint64 - if v1.IsValid() { - x = v1.Uint() - } - if v2.IsValid() { - y = v2.Uint() - } - switch { - case x == y: - return 0 - case x < y: - return -1 - default: - return 1 - } -} - -// CompactUint64Codec encodes uint64 values using EncodeCompactUint64. -type CompactUint64Codec struct{} - -func (c CompactUint64Codec) Decode(r Reader) (protoreflect.Value, error) { - x, err := DecodeCompactUint64(r) - return protoreflect.ValueOfUint64(x), err -} - -func (c CompactUint64Codec) Encode(value protoreflect.Value, w io.Writer) error { - var x uint64 - if value.IsValid() { - x = value.Uint() - } - _, err := w.Write(EncodeCompactUint64(x)) - return err -} - -func (c CompactUint64Codec) Compare(v1, v2 protoreflect.Value) int { - return compareUint(v1, v2) -} - -func (c CompactUint64Codec) IsOrdered() bool { - return true -} - -func (c CompactUint64Codec) FixedBufferSize() int { - return 9 -} - -func (c CompactUint64Codec) ComputeBufferSize(protoreflect.Value) (int, error) { - return c.FixedBufferSize(), nil -} - -// EncodeCompactUint64 encodes uint64 values in 2,4,6 or 9 bytes. -// Unlike regular varints, this encoding is -// suitable for ordered prefix scans. The first two bits of the first byte -// indicate the length of the buffer - 00 for 2, 01 for 4, 10 for 6 and -// 11 for 9. The remaining bits are encoded with big-endian ordering. -// Values less than 2^14 fill fit in 2 bytes, values less than 2^30 will -// fit in 4, and values less than 2^46 will fit in 6. -func EncodeCompactUint64(x uint64) []byte { - switch { - case x < 16384: // 2^14 - buf := make([]byte, 2) - buf[0] = byte(x >> 8) - buf[1] = byte(x) - return buf - case x < 1073741824: // 2^30 - buf := make([]byte, 4) - buf[0] = 0x40 - buf[0] |= byte(x >> 24) - buf[1] = byte(x >> 16) - buf[2] = byte(x >> 8) - buf[3] = byte(x) - return buf - case x < 70368744177664: // 2^46 - buf := make([]byte, 6) - buf[0] = 0x80 - buf[0] |= byte(x >> 40) - buf[1] = byte(x >> 32) - buf[2] = byte(x >> 24) - buf[3] = byte(x >> 16) - buf[4] = byte(x >> 8) - buf[5] = byte(x) - return buf - default: - buf := make([]byte, 9) - buf[0] = 0xC0 - buf[0] |= byte(x >> 58) - buf[1] = byte(x >> 50) - buf[2] = byte(x >> 42) - buf[3] = byte(x >> 34) - buf[4] = byte(x >> 26) - buf[5] = byte(x >> 18) - buf[6] = byte(x >> 10) - buf[7] = byte(x >> 2) - buf[8] = byte(x) & 0x3 - return buf - } -} - -func DecodeCompactUint64(reader io.Reader) (uint64, error) { - var buf [9]byte - n, err := reader.Read(buf[:1]) - if err != nil { - return 0, err - } - if n < 1 { - return 0, io.ErrUnexpectedEOF - } - - switch buf[0] >> 6 { - case 0: - n, err := reader.Read(buf[1:2]) - if err != nil { - return 0, err - } - if n < 1 { - return 0, io.ErrUnexpectedEOF - } - - x := uint64(buf[0]) << 8 - x |= uint64(buf[1]) - return x, nil - case 1: - n, err := reader.Read(buf[1:4]) - if err != nil { - return 0, err - } - if n < 3 { - return 0, io.ErrUnexpectedEOF - } - - x := (uint64(buf[0]) & 0x3F) << 24 - x |= uint64(buf[1]) << 16 - x |= uint64(buf[2]) << 8 - x |= uint64(buf[3]) - return x, nil - case 2: - n, err := reader.Read(buf[1:6]) - if err != nil { - return 0, err - } - if n < 5 { - return 0, io.ErrUnexpectedEOF - } - - x := (uint64(buf[0]) & 0x3F) << 40 - x |= uint64(buf[1]) << 32 - x |= uint64(buf[2]) << 24 - x |= uint64(buf[3]) << 16 - x |= uint64(buf[4]) << 8 - x |= uint64(buf[5]) - return x, nil - case 3: - n, err := reader.Read(buf[1:9]) - if err != nil { - return 0, err - } - if n < 8 { - return 0, io.ErrUnexpectedEOF - } - - x := (uint64(buf[0]) & 0x3F) << 58 - x |= uint64(buf[1]) << 50 - x |= uint64(buf[2]) << 42 - x |= uint64(buf[3]) << 34 - x |= uint64(buf[4]) << 26 - x |= uint64(buf[5]) << 18 - x |= uint64(buf[6]) << 10 - x |= uint64(buf[7]) << 2 - x |= uint64(buf[8]) - return x, nil - default: - return 0, fmt.Errorf("unexpected case") - } -} diff --git a/orm/encoding/ormkv/codec.go b/orm/encoding/ormkv/codec.go deleted file mode 100644 index 1f93b9e54220..000000000000 --- a/orm/encoding/ormkv/codec.go +++ /dev/null @@ -1,47 +0,0 @@ -package ormkv - -import "google.golang.org/protobuf/reflect/protoreflect" - -// EntryCodec defines an interfaces for decoding and encoding entries in the -// kv-store backing an ORM instance. EntryCodec's enable full logical decoding -// of ORM data. -type EntryCodec interface { - // DecodeEntry decodes a kv-pair into an Entry. - DecodeEntry(k, v []byte) (Entry, error) - - // EncodeEntry encodes an entry into a kv-pair. - EncodeEntry(entry Entry) (k, v []byte, err error) -} - -// IndexCodec defines an interfaces for encoding and decoding index-keys in the -// kv-store. -type IndexCodec interface { - EntryCodec - - // MessageType returns the message type this index codec applies to. - MessageType() protoreflect.MessageType - - // GetFieldNames returns the field names in the key of this index. - GetFieldNames() []protoreflect.Name - - // DecodeIndexKey decodes a kv-pair into index-fields and primary-key field - // values. These fields may or may not overlap depending on the index. - DecodeIndexKey(k, v []byte) (indexFields, primaryKey []protoreflect.Value, err error) - - // EncodeKVFromMessage encodes a kv-pair for the index from a message. - EncodeKVFromMessage(message protoreflect.Message) (k, v []byte, err error) - - // CompareKeys compares the provided values which must correspond to the - // fields in this key. Prefix keys of different lengths are supported but the - // function will panic if either array is too long. A negative value is returned - // if values1 is less than values2, 0 is returned if the two arrays are equal, - // and a positive value is returned if values2 is greater. - CompareKeys(key1, key2 []protoreflect.Value) int - - // EncodeKeyFromMessage encodes the key part of this index and returns both - // index values and encoded key. - EncodeKeyFromMessage(message protoreflect.Message) (keyValues []protoreflect.Value, key []byte, err error) - - // IsFullyOrdered returns true if all fields in the key are also ordered. - IsFullyOrdered() bool -} diff --git a/orm/encoding/ormkv/entry.go b/orm/encoding/ormkv/entry.go deleted file mode 100644 index fd44833994cc..000000000000 --- a/orm/encoding/ormkv/entry.go +++ /dev/null @@ -1,135 +0,0 @@ -package ormkv - -import ( - "fmt" - "strings" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - - "cosmossdk.io/orm/internal/stablejson" -) - -// Entry defines a logical representation of a kv-store entry for ORM instances. -type Entry interface { - fmt.Stringer - - // GetTableName returns the table-name (equivalent to the fully-qualified - // proto message name) this entry corresponds to. - GetTableName() protoreflect.FullName - - // to allow new methods to be added without breakage, this interface - // shouldn't be implemented outside this package, - // see https://go.dev/blog/module-compatibility - doNotImplement() -} - -// PrimaryKeyEntry represents a logically decoded primary-key entry. -type PrimaryKeyEntry struct { - // TableName is the table this entry represents. - TableName protoreflect.FullName - - // Key represents the primary key values. - Key []protoreflect.Value - - // Value represents the message stored under the primary key. - Value proto.Message -} - -func (p *PrimaryKeyEntry) GetTableName() protoreflect.FullName { - return p.TableName -} - -func (p *PrimaryKeyEntry) String() string { - if p.Value == nil { - return fmt.Sprintf("PK %s %s -> _", p.TableName, fmtValues(p.Key)) - } - - valBz, err := stablejson.Marshal(p.Value) - valStr := string(valBz) - if err != nil { - valStr = fmt.Sprintf("ERR %v", err) - } - return fmt.Sprintf("PK %s %s -> %s", p.TableName, fmtValues(p.Key), valStr) -} - -func fmtValues(values []protoreflect.Value) string { - if len(values) == 0 { - return "_" - } - - parts := make([]string, len(values)) - for i, v := range values { - parts[i] = fmt.Sprintf("%v", v.Interface()) - } - - return strings.Join(parts, "/") -} - -func (p *PrimaryKeyEntry) doNotImplement() {} - -// IndexKeyEntry represents a logically decoded index entry. -type IndexKeyEntry struct { - // TableName is the table this entry represents. - TableName protoreflect.FullName - - // Fields are the index fields this entry represents. - Fields []protoreflect.Name - - // IsUnique indicates whether this index is unique or not. - IsUnique bool - - // IndexValues represent the index values. - IndexValues []protoreflect.Value - - // PrimaryKey represents the primary key values, it is empty if this is a - // prefix key - PrimaryKey []protoreflect.Value -} - -func (i *IndexKeyEntry) GetTableName() protoreflect.FullName { - return i.TableName -} - -func (i *IndexKeyEntry) doNotImplement() {} - -func (i *IndexKeyEntry) string() string { - return fmt.Sprintf("%s %s : %s -> %s", i.TableName, fmtFields(i.Fields), fmtValues(i.IndexValues), fmtValues(i.PrimaryKey)) -} - -func fmtFields(fields []protoreflect.Name) string { - strs := make([]string, len(fields)) - for i, field := range fields { - strs[i] = string(field) - } - return strings.Join(strs, "/") -} - -func (i *IndexKeyEntry) String() string { - if i.IsUnique { - return fmt.Sprintf("UNIQ %s", i.string()) - } - - return fmt.Sprintf("IDX %s", i.string()) -} - -// SeqEntry represents a sequence for tables with auto-incrementing primary keys. -type SeqEntry struct { - // TableName is the table this entry represents. - TableName protoreflect.FullName - - // Value is the uint64 value stored for this sequence. - Value uint64 -} - -func (s *SeqEntry) GetTableName() protoreflect.FullName { - return s.TableName -} - -func (s *SeqEntry) doNotImplement() {} - -func (s *SeqEntry) String() string { - return fmt.Sprintf("SEQ %s %d", s.TableName, s.Value) -} - -var _, _, _ Entry = &PrimaryKeyEntry{}, &IndexKeyEntry{}, &SeqEntry{} diff --git a/orm/encoding/ormkv/entry_test.go b/orm/encoding/ormkv/entry_test.go deleted file mode 100644 index 91c9fd9e251e..000000000000 --- a/orm/encoding/ormkv/entry_test.go +++ /dev/null @@ -1,75 +0,0 @@ -package ormkv_test - -import ( - "testing" - - "google.golang.org/protobuf/reflect/protoreflect" - "gotest.tools/v3/assert" - - "cosmossdk.io/orm/encoding/encodeutil" - "cosmossdk.io/orm/encoding/ormkv" - "cosmossdk.io/orm/internal/testpb" -) - -var aFullName = (&testpb.ExampleTable{}).ProtoReflect().Descriptor().FullName() - -func TestPrimaryKeyEntry(t *testing.T) { - entry := &ormkv.PrimaryKeyEntry{ - TableName: aFullName, - Key: encodeutil.ValuesOf(uint32(1), "abc"), - Value: &testpb.ExampleTable{I32: -1}, - } - assert.Equal(t, `PK testpb.ExampleTable 1/abc -> {"i32":-1}`, entry.String()) - assert.Equal(t, aFullName, entry.GetTableName()) - - // prefix key - entry = &ormkv.PrimaryKeyEntry{ - TableName: aFullName, - Key: encodeutil.ValuesOf(uint32(1), "abc"), - Value: nil, - } - assert.Equal(t, `PK testpb.ExampleTable 1/abc -> _`, entry.String()) - assert.Equal(t, aFullName, entry.GetTableName()) -} - -func TestIndexKeyEntry(t *testing.T) { - entry := &ormkv.IndexKeyEntry{ - TableName: aFullName, - Fields: []protoreflect.Name{"u32", "i32", "str"}, - IsUnique: false, - IndexValues: encodeutil.ValuesOf(uint32(10), int32(-1), "abc"), - PrimaryKey: encodeutil.ValuesOf("abc", int32(-1)), - } - assert.Equal(t, `IDX testpb.ExampleTable u32/i32/str : 10/-1/abc -> abc/-1`, entry.String()) - assert.Equal(t, aFullName, entry.GetTableName()) - - entry = &ormkv.IndexKeyEntry{ - TableName: aFullName, - Fields: []protoreflect.Name{"u32"}, - IsUnique: true, - IndexValues: encodeutil.ValuesOf(uint32(10)), - PrimaryKey: encodeutil.ValuesOf("abc", int32(-1)), - } - assert.Equal(t, `UNIQ testpb.ExampleTable u32 : 10 -> abc/-1`, entry.String()) - assert.Equal(t, aFullName, entry.GetTableName()) - - // prefix key - entry = &ormkv.IndexKeyEntry{ - TableName: aFullName, - Fields: []protoreflect.Name{"u32", "i32", "str"}, - IsUnique: false, - IndexValues: encodeutil.ValuesOf(uint32(10), int32(-1)), - } - assert.Equal(t, `IDX testpb.ExampleTable u32/i32/str : 10/-1 -> _`, entry.String()) - assert.Equal(t, aFullName, entry.GetTableName()) - - // prefix key - entry = &ormkv.IndexKeyEntry{ - TableName: aFullName, - Fields: []protoreflect.Name{"str", "i32"}, - IsUnique: true, - IndexValues: encodeutil.ValuesOf("abc", int32(1)), - } - assert.Equal(t, `UNIQ testpb.ExampleTable str/i32 : abc/1 -> _`, entry.String()) - assert.Equal(t, aFullName, entry.GetTableName()) -} diff --git a/orm/encoding/ormkv/index_key.go b/orm/encoding/ormkv/index_key.go deleted file mode 100644 index bcb2341ecc6e..000000000000 --- a/orm/encoding/ormkv/index_key.go +++ /dev/null @@ -1,123 +0,0 @@ -package ormkv - -import ( - "bytes" - "io" - - "google.golang.org/protobuf/reflect/protoreflect" - - "cosmossdk.io/orm/types/ormerrors" -) - -// IndexKeyCodec is the codec for (non-unique) index keys. -type IndexKeyCodec struct { - *KeyCodec - pkFieldOrder []int -} - -var _ IndexCodec = &IndexKeyCodec{} - -// NewIndexKeyCodec creates a new IndexKeyCodec with an optional prefix for the -// provided message descriptor, index and primary key fields. -func NewIndexKeyCodec(prefix []byte, messageType protoreflect.MessageType, indexFields, primaryKeyFields []protoreflect.Name) (*IndexKeyCodec, error) { - if len(indexFields) == 0 { - return nil, ormerrors.InvalidTableDefinition.Wrapf("index fields are empty") - } - - if len(primaryKeyFields) == 0 { - return nil, ormerrors.InvalidTableDefinition.Wrapf("primary key fields are empty") - } - - indexFieldMap := map[protoreflect.Name]int{} - - keyFields := make([]protoreflect.Name, 0, len(indexFields)+len(primaryKeyFields)) - for i, f := range indexFields { - indexFieldMap[f] = i - keyFields = append(keyFields, f) - } - - numIndexFields := len(indexFields) - numPrimaryKeyFields := len(primaryKeyFields) - pkFieldOrder := make([]int, numPrimaryKeyFields) - k := 0 - for j, f := range primaryKeyFields { - if i, ok := indexFieldMap[f]; ok { - pkFieldOrder[j] = i - continue - } - keyFields = append(keyFields, f) - pkFieldOrder[j] = numIndexFields + k - k++ - } - - cdc, err := NewKeyCodec(prefix, messageType, keyFields) - if err != nil { - return nil, err - } - - return &IndexKeyCodec{ - KeyCodec: cdc, - pkFieldOrder: pkFieldOrder, - }, nil -} - -func (cdc IndexKeyCodec) DecodeIndexKey(k, _ []byte) (indexFields, primaryKey []protoreflect.Value, err error) { - values, err := cdc.DecodeKey(bytes.NewReader(k)) - // got prefix key - if err == io.EOF { - return values, nil, nil - } else if err != nil { - return nil, nil, err - } - - // got prefix key - if len(values) < len(cdc.fieldCodecs) { - return values, nil, nil - } - - numPkFields := len(cdc.pkFieldOrder) - pkValues := make([]protoreflect.Value, numPkFields) - - for i := 0; i < numPkFields; i++ { - pkValues[i] = values[cdc.pkFieldOrder[i]] - } - - return values, pkValues, nil -} - -func (cdc IndexKeyCodec) DecodeEntry(k, v []byte) (Entry, error) { - idxValues, pk, err := cdc.DecodeIndexKey(k, v) - if err != nil { - return nil, err - } - - return &IndexKeyEntry{ - TableName: cdc.messageType.Descriptor().FullName(), - Fields: cdc.fieldNames, - IndexValues: idxValues, - PrimaryKey: pk, - }, nil -} - -func (cdc IndexKeyCodec) EncodeEntry(entry Entry) (k, v []byte, err error) { - indexEntry, ok := entry.(*IndexKeyEntry) - if !ok { - return nil, nil, ormerrors.BadDecodeEntry - } - - if indexEntry.TableName != cdc.messageType.Descriptor().FullName() { - return nil, nil, ormerrors.BadDecodeEntry - } - - bz, err := cdc.KeyCodec.EncodeKey(indexEntry.IndexValues) - if err != nil { - return nil, nil, err - } - - return bz, []byte{}, nil -} - -func (cdc IndexKeyCodec) EncodeKVFromMessage(message protoreflect.Message) (k, v []byte, err error) { - _, k, err = cdc.EncodeKeyFromMessage(message) - return k, []byte{}, err -} diff --git a/orm/encoding/ormkv/index_key_test.go b/orm/encoding/ormkv/index_key_test.go deleted file mode 100644 index eefcef35e205..000000000000 --- a/orm/encoding/ormkv/index_key_test.go +++ /dev/null @@ -1,63 +0,0 @@ -package ormkv_test - -import ( - "bytes" - "fmt" - "testing" - - "gotest.tools/v3/assert" - "pgregory.net/rapid" - - "cosmossdk.io/orm/encoding/ormkv" - "cosmossdk.io/orm/internal/testpb" - "cosmossdk.io/orm/internal/testutil" -) - -func TestIndexKeyCodec(t *testing.T) { - rapid.Check(t, func(t *rapid.T) { - idxPartCdc := testutil.TestKeyCodecGen(1, 5).Draw(t, "idxPartCdc") - pkCodec := testutil.TestKeyCodecGen(1, 5).Draw(t, "pkCdc") - prefix := rapid.SliceOfN(rapid.Byte(), 0, 5).Draw(t, "prefix") - messageType := (&testpb.ExampleTable{}).ProtoReflect().Type() - indexKeyCdc, err := ormkv.NewIndexKeyCodec( - prefix, - messageType, - idxPartCdc.Codec.GetFieldNames(), - pkCodec.Codec.GetFieldNames(), - ) - assert.NilError(t, err) - for i := 0; i < 100; i++ { - a := testutil.GenA.Draw(t, fmt.Sprintf("a%d", i)) - key := indexKeyCdc.GetKeyValues(a.ProtoReflect()) - pk := pkCodec.Codec.GetKeyValues(a.ProtoReflect()) - idx1 := &ormkv.IndexKeyEntry{ - TableName: messageType.Descriptor().FullName(), - Fields: indexKeyCdc.GetFieldNames(), - IsUnique: false, - IndexValues: key, - PrimaryKey: pk, - } - k, v, err := indexKeyCdc.EncodeEntry(idx1) - assert.NilError(t, err) - - k2, v2, err := indexKeyCdc.EncodeKVFromMessage(a.ProtoReflect()) - assert.NilError(t, err) - assert.Assert(t, bytes.Equal(k, k2)) - assert.Assert(t, bytes.Equal(v, v2)) - - entry2, err := indexKeyCdc.DecodeEntry(k, v) - assert.NilError(t, err) - idx2 := entry2.(*ormkv.IndexKeyEntry) - assert.Equal(t, 0, indexKeyCdc.CompareKeys(idx1.IndexValues, idx2.IndexValues)) - assert.Equal(t, 0, pkCodec.Codec.CompareKeys(idx1.PrimaryKey, idx2.PrimaryKey)) - assert.Equal(t, false, idx2.IsUnique) - assert.Equal(t, messageType.Descriptor().FullName(), idx2.TableName) - assert.DeepEqual(t, idx1.Fields, idx2.Fields) - - idxFields, pk2, err := indexKeyCdc.DecodeIndexKey(k, v) - assert.NilError(t, err) - assert.Equal(t, 0, indexKeyCdc.CompareKeys(key, idxFields)) - assert.Equal(t, 0, pkCodec.Codec.CompareKeys(pk, pk2)) - } - }) -} diff --git a/orm/encoding/ormkv/key_codec.go b/orm/encoding/ormkv/key_codec.go deleted file mode 100644 index b1056aaf3a58..000000000000 --- a/orm/encoding/ormkv/key_codec.go +++ /dev/null @@ -1,307 +0,0 @@ -package ormkv - -import ( - "bytes" - "io" - - "google.golang.org/protobuf/reflect/protoreflect" - - "cosmossdk.io/orm/encoding/encodeutil" - "cosmossdk.io/orm/encoding/ormfield" - "cosmossdk.io/orm/types/ormerrors" -) - -type KeyCodec struct { - fixedSize int - variableSizers []struct { - cdc ormfield.Codec - i int - } - - prefix []byte - fieldDescriptors []protoreflect.FieldDescriptor - fieldNames []protoreflect.Name - fieldCodecs []ormfield.Codec - messageType protoreflect.MessageType -} - -// NewKeyCodec returns a new KeyCodec with an optional prefix for the provided -// message descriptor and fields. -func NewKeyCodec(prefix []byte, messageType protoreflect.MessageType, fieldNames []protoreflect.Name) (*KeyCodec, error) { - n := len(fieldNames) - fieldCodecs := make([]ormfield.Codec, n) - fieldDescriptors := make([]protoreflect.FieldDescriptor, n) - var variableSizers []struct { - cdc ormfield.Codec - i int - } - fixedSize := 0 - messageFields := messageType.Descriptor().Fields() - - for i := 0; i < n; i++ { - nonTerminal := i != n-1 - field := messageFields.ByName(fieldNames[i]) - if field == nil { - return nil, ormerrors.FieldNotFound.Wrapf("field %s on %s", fieldNames[i], messageType.Descriptor().FullName()) - } - cdc, err := ormfield.GetCodec(field, nonTerminal) - if err != nil { - return nil, err - } - if x := cdc.FixedBufferSize(); x > 0 { - fixedSize += x - } else { - variableSizers = append(variableSizers, struct { - cdc ormfield.Codec - i int - }{cdc, i}) - } - fieldCodecs[i] = cdc - fieldDescriptors[i] = field - } - - return &KeyCodec{ - fieldCodecs: fieldCodecs, - fieldDescriptors: fieldDescriptors, - fieldNames: fieldNames, - prefix: prefix, - fixedSize: fixedSize, - variableSizers: variableSizers, - messageType: messageType, - }, nil -} - -// EncodeKey encodes the values assuming that they correspond to the fields -// specified for the key. If the array of values is shorter than the -// number of fields in the key, a partial "prefix" key will be encoded -// which can be used for constructing a prefix iterator. -func (cdc *KeyCodec) EncodeKey(values []protoreflect.Value) ([]byte, error) { - sz, err := cdc.ComputeKeyBufferSize(values) - if err != nil { - return nil, err - } - - w := bytes.NewBuffer(make([]byte, 0, sz+len(cdc.prefix))) - if _, err = w.Write(cdc.prefix); err != nil { - return nil, err - } - - n := len(values) - if n > len(cdc.fieldCodecs) { - return nil, ormerrors.IndexOutOfBounds.Wrapf("cannot encode %d values into %d fields", n, len(cdc.fieldCodecs)) - } - - for i := 0; i < n; i++ { - if err = cdc.fieldCodecs[i].Encode(values[i], w); err != nil { - return nil, err - } - } - return w.Bytes(), nil -} - -// GetKeyValues extracts the values specified by the key fields from the message. -func (cdc *KeyCodec) GetKeyValues(message protoreflect.Message) []protoreflect.Value { - res := make([]protoreflect.Value, len(cdc.fieldDescriptors)) - for i, f := range cdc.fieldDescriptors { - if message.Has(f) { - res[i] = message.Get(f) - } - } - return res -} - -// DecodeKey decodes the values in the key specified by the reader. If the -// provided key is a prefix key, the values that could be decoded will -// be returned with io.EOF as the error. -func (cdc *KeyCodec) DecodeKey(r *bytes.Reader) ([]protoreflect.Value, error) { - if err := encodeutil.SkipPrefix(r, cdc.prefix); err != nil { - return nil, err - } - - n := len(cdc.fieldCodecs) - values := make([]protoreflect.Value, 0, n) - for i := 0; i < n; i++ { - value, err := cdc.fieldCodecs[i].Decode(r) - if err == io.EOF { - return values, err - } else if err != nil { - return nil, err - } - values = append(values, value) - } - return values, nil -} - -// EncodeKeyFromMessage combines GetKeyValues and EncodeKey. -func (cdc *KeyCodec) EncodeKeyFromMessage(message protoreflect.Message) ([]protoreflect.Value, []byte, error) { - values := cdc.GetKeyValues(message) - bz, err := cdc.EncodeKey(values) - return values, bz, err -} - -// IsFullyOrdered returns true if all fields are also ordered. -func (cdc *KeyCodec) IsFullyOrdered() bool { - for _, p := range cdc.fieldCodecs { - if !p.IsOrdered() { - return false - } - } - return true -} - -// CompareKeys compares the provided values which must correspond to the -// fields in this key. Prefix keys of different lengths are supported but the -// function will panic if either array is too long. A negative value is returned -// if values1 is less than values2, 0 is returned if the two arrays are equal, -// and a positive value is returned if values2 is greater. -func (cdc *KeyCodec) CompareKeys(values1, values2 []protoreflect.Value) int { - j := len(values1) - k := len(values2) - n := j - if k < j { - n = k - } - - if n > len(cdc.fieldCodecs) { - panic("array is too long") - } - - var cmp int - for i := 0; i < n; i++ { - cmp = cdc.fieldCodecs[i].Compare(values1[i], values2[i]) - // any non-equal parts determine our ordering - if cmp != 0 { - return cmp - } - } - - // values are equal but arrays of different length - switch { - case j == k: - return 0 - case j < k: - return -1 - default: - return 1 - } -} - -// ComputeKeyBufferSize computes the required buffer size for the provided values -// which can represent a full or prefix key. -func (cdc KeyCodec) ComputeKeyBufferSize(values []protoreflect.Value) (int, error) { - size := cdc.fixedSize - n := len(values) - for _, sz := range cdc.variableSizers { - // handle prefix key encoding case where don't need all the sizers - if sz.i >= n { - return size, nil - } - - x, err := sz.cdc.ComputeBufferSize(values[sz.i]) - if err != nil { - return 0, err - } - size += x - } - return size, nil -} - -// SetKeyValues sets the provided values on the message which must correspond -// exactly to the field descriptors for this key. Prefix keys aren't -// supported. -func (cdc *KeyCodec) SetKeyValues(message protoreflect.Message, values []protoreflect.Value) { - for i, f := range cdc.fieldDescriptors { - value := values[i] - if value.IsValid() { - message.Set(f, value) - } - } -} - -// CheckValidRangeIterationKeys checks if the start and end key prefixes are valid -// for range iteration meaning that for each non-equal field in the prefixes -// those field types support ordered iteration. If start or end is longer than -// the other, the omitted values will function as the minimum and maximum -// values of that type respectively. -func (cdc KeyCodec) CheckValidRangeIterationKeys(start, end []protoreflect.Value) error { - lenStart := len(start) - shortest := lenStart - longest := lenStart - lenEnd := len(end) - if lenEnd < shortest { - shortest = lenEnd - } else { - longest = lenEnd - } - - if longest > len(cdc.fieldCodecs) { - return ormerrors.IndexOutOfBounds - } - - i := 0 - var cmp int - - for ; i < shortest; i++ { - fieldCdc := cdc.fieldCodecs[i] - x := start[i] - y := end[i] - - cmp = fieldCdc.Compare(x, y) - if cmp > 0 { - return ormerrors.InvalidRangeIterationKeys.Wrapf( - "start must be before end for field %s", - cdc.fieldDescriptors[i].FullName(), - ) - } else if !fieldCdc.IsOrdered() && cmp != 0 { - descriptor := cdc.fieldDescriptors[i] - return ormerrors.InvalidRangeIterationKeys.Wrapf( - "field %s of kind %s doesn't support ordered range iteration", - descriptor.FullName(), - descriptor.Kind(), - ) - } else if cmp < 0 { - break - } - } - - // the last prefix value must not be equal if the key lengths are the same - if lenStart == lenEnd { - if cmp == 0 { - return ormerrors.InvalidRangeIterationKeys - } - } else { - // check any remaining values in start or end - for j := i; j < longest; j++ { - if !cdc.fieldCodecs[j].IsOrdered() { - return ormerrors.InvalidRangeIterationKeys.Wrapf( - "field %s of kind %s doesn't support ordered range iteration", - cdc.fieldDescriptors[j].FullName(), - cdc.fieldDescriptors[j].Kind(), - ) - } - } - } - - return nil -} - -// GetFieldDescriptors returns the field descriptors for this codec. -func (cdc *KeyCodec) GetFieldDescriptors() []protoreflect.FieldDescriptor { - return cdc.fieldDescriptors -} - -// GetFieldNames returns the field names for this codec. -func (cdc *KeyCodec) GetFieldNames() []protoreflect.Name { - return cdc.fieldNames -} - -// Prefix returns the prefix applied to keys in this codec before any field -// values are encoded. -func (cdc *KeyCodec) Prefix() []byte { - return cdc.prefix -} - -// MessageType returns the message type of fields in this key. -func (cdc *KeyCodec) MessageType() protoreflect.MessageType { - return cdc.messageType -} diff --git a/orm/encoding/ormkv/key_codec_test.go b/orm/encoding/ormkv/key_codec_test.go deleted file mode 100644 index b2937426a7a0..000000000000 --- a/orm/encoding/ormkv/key_codec_test.go +++ /dev/null @@ -1,317 +0,0 @@ -package ormkv_test - -import ( - "bytes" - "io" - "testing" - - "google.golang.org/protobuf/reflect/protoreflect" - "gotest.tools/v3/assert" - "pgregory.net/rapid" - - "cosmossdk.io/orm/encoding/encodeutil" - "cosmossdk.io/orm/encoding/ormkv" - "cosmossdk.io/orm/internal/testpb" - "cosmossdk.io/orm/internal/testutil" -) - -func TestKeyCodec(t *testing.T) { - rapid.Check(t, func(t *rapid.T) { - key := testutil.TestKeyCodecGen(0, 5).Draw(t, "key") - for i := 0; i < 100; i++ { - keyValues := key.Draw(t, "values") - - bz1 := assertEncDecKey(t, key, keyValues) - - if key.Codec.IsFullyOrdered() { - // check if ordered keys have ordered encodings - keyValues2 := key.Draw(t, "values2") - bz2 := assertEncDecKey(t, key, keyValues2) - // bytes comparison should equal comparison of values - assert.Equal(t, key.Codec.CompareKeys(keyValues, keyValues2), bytes.Compare(bz1, bz2)) - } - } - }) -} - -func assertEncDecKey(t *rapid.T, key testutil.TestKeyCodec, keyValues []protoreflect.Value) []byte { - bz, err := key.Codec.EncodeKey(keyValues) - assert.NilError(t, err) - keyValues2, err := key.Codec.DecodeKey(bytes.NewReader(bz)) - assert.NilError(t, err) - assert.Equal(t, 0, key.Codec.CompareKeys(keyValues, keyValues2)) - return bz -} - -func TestCompareValues(t *testing.T) { - cdc, err := ormkv.NewKeyCodec(nil, - (&testpb.ExampleTable{}).ProtoReflect().Type(), - []protoreflect.Name{"u32", "str", "i32"}) - assert.NilError(t, err) - - tests := []struct { - name string - values1 []protoreflect.Value - values2 []protoreflect.Value - expect int - validRange bool - }{ - { - "eq", - encodeutil.ValuesOf(uint32(0), "abc", int32(-3)), - encodeutil.ValuesOf(uint32(0), "abc", int32(-3)), - 0, - false, - }, - { - "eq prefix 0", - encodeutil.ValuesOf(), - encodeutil.ValuesOf(), - 0, - false, - }, - { - "eq prefix 1", - encodeutil.ValuesOf(uint32(0)), - encodeutil.ValuesOf(uint32(0)), - 0, - false, - }, - { - "eq prefix 2", - encodeutil.ValuesOf(uint32(0), "abc"), - encodeutil.ValuesOf(uint32(0), "abc"), - 0, - false, - }, - { - "lt1", - encodeutil.ValuesOf(uint32(0), "abc", int32(-3)), - encodeutil.ValuesOf(uint32(1), "abc", int32(-3)), - -1, - true, - }, - { - "lt2", - encodeutil.ValuesOf(uint32(1), "abb", int32(-3)), - encodeutil.ValuesOf(uint32(1), "abc", int32(-3)), - -1, - true, - }, - { - "lt3", - encodeutil.ValuesOf(uint32(1), "abb", int32(-4)), - encodeutil.ValuesOf(uint32(1), "abb", int32(-3)), - -1, - true, - }, - { - "less prefix 0", - encodeutil.ValuesOf(), - encodeutil.ValuesOf(uint32(1), "abb", int32(-4)), - -1, - true, - }, - { - "less prefix 1", - encodeutil.ValuesOf(uint32(1)), - encodeutil.ValuesOf(uint32(1), "abb", int32(-4)), - -1, - true, - }, - { - "less prefix 2", - encodeutil.ValuesOf(uint32(1), "abb"), - encodeutil.ValuesOf(uint32(1), "abb", int32(-4)), - -1, - true, - }, - { - "gt1", - encodeutil.ValuesOf(uint32(2), "abb", int32(-4)), - encodeutil.ValuesOf(uint32(1), "abb", int32(-4)), - 1, - false, - }, - { - "gt2", - encodeutil.ValuesOf(uint32(2), "abc", int32(-4)), - encodeutil.ValuesOf(uint32(2), "abb", int32(-4)), - 1, - false, - }, - { - "gt3", - encodeutil.ValuesOf(uint32(2), "abc", int32(1)), - encodeutil.ValuesOf(uint32(2), "abc", int32(-3)), - 1, - false, - }, - { - "gt prefix 0", - encodeutil.ValuesOf(uint32(2), "abc", int32(-3)), - encodeutil.ValuesOf(), - 1, - true, - }, - { - "gt prefix 1", - encodeutil.ValuesOf(uint32(2), "abc", int32(-3)), - encodeutil.ValuesOf(uint32(2)), - 1, - true, - }, - { - "gt prefix 2", - encodeutil.ValuesOf(uint32(2), "abc", int32(-3)), - encodeutil.ValuesOf(uint32(2), "abc"), - 1, - true, - }, - } - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - assert.Equal( - t, test.expect, - cdc.CompareKeys(test.values1, test.values2), - ) - // CheckValidRangeIterationKeys should give comparable results - err := cdc.CheckValidRangeIterationKeys(test.values1, test.values2) - if test.validRange { - assert.NilError(t, err) - } else { - assert.ErrorContains(t, err, "") - } - }) - } -} - -func TestDecodePrefixKey(t *testing.T) { - cdc, err := ormkv.NewKeyCodec(nil, - (&testpb.ExampleTable{}).ProtoReflect().Type(), - []protoreflect.Name{"u32", "str", "bz", "i32"}) - - assert.NilError(t, err) - tests := []struct { - name string - values []protoreflect.Value - }{ - { - "1", - encodeutil.ValuesOf(uint32(5), "abc"), - }, - } - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - bz, err := cdc.EncodeKey(test.values) - assert.NilError(t, err) - values, err := cdc.DecodeKey(bytes.NewReader(bz)) - assert.ErrorType(t, err, io.EOF) - assert.Equal(t, 0, cdc.CompareKeys(test.values, values)) - }) - } -} - -func TestValidRangeIterationKeys(t *testing.T) { - cdc, err := ormkv.NewKeyCodec(nil, - (&testpb.ExampleTable{}).ProtoReflect().Type(), - []protoreflect.Name{"u32", "str", "bz", "i32"}) - assert.NilError(t, err) - - tests := []struct { - name string - values1 []protoreflect.Value - values2 []protoreflect.Value - expectErr bool - }{ - { - "1 eq", - encodeutil.ValuesOf(uint32(0)), - encodeutil.ValuesOf(uint32(0)), - true, - }, - { - "1 lt", - encodeutil.ValuesOf(uint32(0)), - encodeutil.ValuesOf(uint32(1)), - false, - }, - { - "1 gt", - encodeutil.ValuesOf(uint32(1)), - encodeutil.ValuesOf(uint32(0)), - true, - }, - { - "1,2 lt", - encodeutil.ValuesOf(uint32(0)), - encodeutil.ValuesOf(uint32(0), "abc"), - false, - }, - { - "1,2 gt", - encodeutil.ValuesOf(uint32(0), "abc"), - encodeutil.ValuesOf(uint32(0)), - false, - }, - { - "1,2,3", - encodeutil.ValuesOf(uint32(0)), - encodeutil.ValuesOf(uint32(0), "abc", []byte{1, 2}), - true, - }, - { - "1,2,3,4 lt", - encodeutil.ValuesOf(uint32(0), "abc", []byte{1, 2}, int32(-1)), - encodeutil.ValuesOf(uint32(0), "abc", []byte{1, 2}, int32(1)), - false, - }, - { - "too long", - encodeutil.ValuesOf(uint32(0), "abc", []byte{1, 2}, int32(-1)), - encodeutil.ValuesOf(uint32(0), "abc", []byte{1, 2}, int32(1), int32(1)), - true, - }, - { - "1,2,3,4 eq", - encodeutil.ValuesOf(uint32(0), "abc", []byte{1, 2}, int32(1)), - encodeutil.ValuesOf(uint32(0), "abc", []byte{1, 2}, int32(1)), - true, - }, - { - "1,2,3,4 bz err", - encodeutil.ValuesOf(uint32(0), "abc", []byte{1, 2}, int32(-1)), - encodeutil.ValuesOf(uint32(0), "abc", []byte{1, 2, 3}, int32(1)), - true, - }, - } - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - err := cdc.CheckValidRangeIterationKeys(test.values1, test.values2) - if test.expectErr { - assert.ErrorContains(t, err, "") - } else { - assert.NilError(t, err) - } - }) - } -} - -func TestGetSet(t *testing.T) { - cdc, err := ormkv.NewKeyCodec(nil, - (&testpb.ExampleTable{}).ProtoReflect().Type(), - []protoreflect.Name{"u32", "str", "i32"}) - assert.NilError(t, err) - - var a testpb.ExampleTable - values := encodeutil.ValuesOf(uint32(4), "abc", int32(1)) - cdc.SetKeyValues(a.ProtoReflect(), values) - values2 := cdc.GetKeyValues(a.ProtoReflect()) - assert.Equal(t, 0, cdc.CompareKeys(values, values2)) - bz, err := cdc.EncodeKey(values) - assert.NilError(t, err) - values3, bz2, err := cdc.EncodeKeyFromMessage(a.ProtoReflect()) - assert.NilError(t, err) - assert.Equal(t, 0, cdc.CompareKeys(values, values3)) - assert.Assert(t, bytes.Equal(bz, bz2)) -} diff --git a/orm/encoding/ormkv/primary_key.go b/orm/encoding/ormkv/primary_key.go deleted file mode 100644 index 6c02d7e6b3b4..000000000000 --- a/orm/encoding/ormkv/primary_key.go +++ /dev/null @@ -1,140 +0,0 @@ -package ormkv - -import ( - "bytes" - "io" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - - "cosmossdk.io/orm/types/ormerrors" -) - -// PrimaryKeyCodec is the codec for primary keys. -type PrimaryKeyCodec struct { - *KeyCodec - unmarshalOptions proto.UnmarshalOptions -} - -var _ IndexCodec = &PrimaryKeyCodec{} - -// NewPrimaryKeyCodec creates a new PrimaryKeyCodec for the provided msg and -// fields, with an optional prefix and unmarshal options. -func NewPrimaryKeyCodec(prefix []byte, msgType protoreflect.MessageType, fieldNames []protoreflect.Name, unmarshalOptions proto.UnmarshalOptions) (*PrimaryKeyCodec, error) { - keyCodec, err := NewKeyCodec(prefix, msgType, fieldNames) - if err != nil { - return nil, err - } - - return &PrimaryKeyCodec{ - KeyCodec: keyCodec, - unmarshalOptions: unmarshalOptions, - }, nil -} - -var _ IndexCodec = PrimaryKeyCodec{} - -func (p PrimaryKeyCodec) DecodeIndexKey(k, _ []byte) (indexFields, primaryKey []protoreflect.Value, err error) { - indexFields, err = p.DecodeKey(bytes.NewReader(k)) - - // got prefix key - if err == io.EOF { - return indexFields, nil, nil - } else if err != nil { - return nil, nil, err - } - - if len(indexFields) == len(p.fieldCodecs) { - // for primary keys the index fields are the primary key - // but only if we don't have a prefix key - primaryKey = indexFields - } - return indexFields, primaryKey, nil -} - -func (p PrimaryKeyCodec) DecodeEntry(k, v []byte) (Entry, error) { - values, err := p.DecodeKey(bytes.NewReader(k)) - if err == io.EOF { - return &PrimaryKeyEntry{ - TableName: p.messageType.Descriptor().FullName(), - Key: values, - }, nil - } else if err != nil { - return nil, err - } - - msg := p.messageType.New().Interface() - err = p.Unmarshal(values, v, msg) - - return &PrimaryKeyEntry{ - TableName: p.messageType.Descriptor().FullName(), - Key: values, - Value: msg, - }, err -} - -func (p PrimaryKeyCodec) EncodeEntry(entry Entry) (k, v []byte, err error) { - pkEntry, ok := entry.(*PrimaryKeyEntry) - if !ok { - return nil, nil, ormerrors.BadDecodeEntry.Wrapf("expected %T, got %T", &PrimaryKeyEntry{}, entry) - } - - if pkEntry.TableName != p.messageType.Descriptor().FullName() { - return nil, nil, ormerrors.BadDecodeEntry.Wrapf( - "wrong table name, got %s, expected %s", - pkEntry.TableName, - p.messageType.Descriptor().FullName(), - ) - } - - k, err = p.KeyCodec.EncodeKey(pkEntry.Key) - if err != nil { - return nil, nil, err - } - - v, err = p.marshal(pkEntry.Key, pkEntry.Value) - return k, v, err -} - -func (p PrimaryKeyCodec) marshal(key []protoreflect.Value, message proto.Message) (v []byte, err error) { - // first clear the priamry key values because these are already stored in - // the key so we don't need to store them again in the value - p.ClearValues(message.ProtoReflect()) - - v, err = proto.MarshalOptions{Deterministic: true}.Marshal(message) - if err != nil { - return nil, err - } - - // set the primary key values again returning the message to its original state - p.SetKeyValues(message.ProtoReflect(), key) - - return v, nil -} - -func (p *PrimaryKeyCodec) ClearValues(message protoreflect.Message) { - for _, f := range p.fieldDescriptors { - message.Clear(f) - } -} - -func (p *PrimaryKeyCodec) Unmarshal(key []protoreflect.Value, value []byte, message proto.Message) error { - err := p.unmarshalOptions.Unmarshal(value, message) - if err != nil { - return err - } - - // rehydrate primary key - p.SetKeyValues(message.ProtoReflect(), key) - return nil -} - -func (p PrimaryKeyCodec) EncodeKVFromMessage(message protoreflect.Message) (k, v []byte, err error) { - ks, k, err := p.KeyCodec.EncodeKeyFromMessage(message) - if err != nil { - return nil, nil, err - } - - v, err = p.marshal(ks, message.Interface()) - return k, v, err -} diff --git a/orm/encoding/ormkv/primary_key_test.go b/orm/encoding/ormkv/primary_key_test.go deleted file mode 100644 index 6ae43a8c0ba7..000000000000 --- a/orm/encoding/ormkv/primary_key_test.go +++ /dev/null @@ -1,60 +0,0 @@ -package ormkv_test - -import ( - "bytes" - "fmt" - "testing" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/testing/protocmp" - "gotest.tools/v3/assert" - "pgregory.net/rapid" - - "cosmossdk.io/orm/encoding/ormkv" - "cosmossdk.io/orm/internal/testpb" - "cosmossdk.io/orm/internal/testutil" -) - -func TestPrimaryKeyCodec(t *testing.T) { - rapid.Check(t, func(t *rapid.T) { - keyCodec := testutil.TestKeyCodecGen(0, 5).Draw(t, "keyCodec") - pkCodec, err := ormkv.NewPrimaryKeyCodec( - keyCodec.Codec.Prefix(), - (&testpb.ExampleTable{}).ProtoReflect().Type(), - keyCodec.Codec.GetFieldNames(), - proto.UnmarshalOptions{}, - ) - assert.NilError(t, err) - for i := 0; i < 100; i++ { - a := testutil.GenA.Draw(t, fmt.Sprintf("a%d", i)) - key := keyCodec.Codec.GetKeyValues(a.ProtoReflect()) - pk1 := &ormkv.PrimaryKeyEntry{ - TableName: aFullName, - Key: key, - Value: a, - } - k, v, err := pkCodec.EncodeEntry(pk1) - assert.NilError(t, err) - - k2, v2, err := pkCodec.EncodeKVFromMessage(a.ProtoReflect()) - assert.NilError(t, err) - assert.Assert(t, bytes.Equal(k, k2)) - assert.Assert(t, bytes.Equal(v, v2)) - - entry2, err := pkCodec.DecodeEntry(k, v) - assert.NilError(t, err) - pk2 := entry2.(*ormkv.PrimaryKeyEntry) - assert.Equal(t, 0, pkCodec.CompareKeys(pk1.Key, pk2.Key)) - assert.DeepEqual(t, pk1.Value, pk2.Value, protocmp.Transform()) - - idxFields, pk3, err := pkCodec.DecodeIndexKey(k, v) - assert.NilError(t, err) - assert.Equal(t, 0, pkCodec.CompareKeys(pk1.Key, pk3)) - assert.Equal(t, 0, pkCodec.CompareKeys(pk1.Key, idxFields)) - - pkCodec.ClearValues(a.ProtoReflect()) - pkCodec.SetKeyValues(a.ProtoReflect(), pk1.Key) - assert.DeepEqual(t, a, pk2.Value, protocmp.Transform()) - } - }) -} diff --git a/orm/encoding/ormkv/seq.go b/orm/encoding/ormkv/seq.go deleted file mode 100644 index ace5fe3d2eba..000000000000 --- a/orm/encoding/ormkv/seq.go +++ /dev/null @@ -1,69 +0,0 @@ -package ormkv - -import ( - "bytes" - "encoding/binary" - - "google.golang.org/protobuf/reflect/protoreflect" - - "cosmossdk.io/orm/types/ormerrors" -) - -// SeqCodec is the codec for auto-incrementing uint64 primary key sequences. -type SeqCodec struct { - messageType protoreflect.FullName - prefix []byte -} - -// NewSeqCodec creates a new SeqCodec. -func NewSeqCodec(messageType protoreflect.MessageType, prefix []byte) *SeqCodec { - return &SeqCodec{messageType: messageType.Descriptor().FullName(), prefix: prefix} -} - -var _ EntryCodec = &SeqCodec{} - -func (s SeqCodec) DecodeEntry(k, v []byte) (Entry, error) { - if !bytes.Equal(k, s.prefix) { - return nil, ormerrors.UnexpectedDecodePrefix - } - - x, err := s.DecodeValue(v) - if err != nil { - return nil, err - } - - return &SeqEntry{ - TableName: s.messageType, - Value: x, - }, nil -} - -func (s SeqCodec) EncodeEntry(entry Entry) (k, v []byte, err error) { - seqEntry, ok := entry.(*SeqEntry) - if !ok { - return nil, nil, ormerrors.BadDecodeEntry - } - - if seqEntry.TableName != s.messageType { - return nil, nil, ormerrors.BadDecodeEntry - } - - return s.prefix, s.EncodeValue(seqEntry.Value), nil -} - -func (s SeqCodec) Prefix() []byte { - return s.prefix -} - -func (s SeqCodec) EncodeValue(seq uint64) (v []byte) { - bz := make([]byte, binary.MaxVarintLen64) - n := binary.PutUvarint(bz, seq) - return bz[:n] -} - -func (s SeqCodec) DecodeValue(v []byte) (uint64, error) { - if len(v) == 0 { - return 0, nil - } - return binary.ReadUvarint(bytes.NewReader(v)) -} diff --git a/orm/encoding/ormkv/seq_test.go b/orm/encoding/ormkv/seq_test.go deleted file mode 100644 index 4b9742a25719..000000000000 --- a/orm/encoding/ormkv/seq_test.go +++ /dev/null @@ -1,47 +0,0 @@ -package ormkv_test - -import ( - "bytes" - "testing" - - "gotest.tools/v3/assert" - "pgregory.net/rapid" - - "cosmossdk.io/orm/encoding/ormkv" - "cosmossdk.io/orm/internal/testpb" -) - -func TestSeqCodec(t *testing.T) { - rapid.Check(t, func(t *rapid.T) { - prefix := rapid.SliceOfN(rapid.Byte(), 0, 5).Draw(t, "prefix") - typ := (&testpb.ExampleTable{}).ProtoReflect().Type() - tableName := typ.Descriptor().FullName() - cdc := ormkv.NewSeqCodec(typ, prefix) - - seq, err := cdc.DecodeValue(nil) - assert.NilError(t, err) - assert.Equal(t, uint64(0), seq) - - seq, err = cdc.DecodeValue([]byte{}) - assert.NilError(t, err) - assert.Equal(t, uint64(0), seq) - - seq = rapid.Uint64().Draw(t, "seq") - - v := cdc.EncodeValue(seq) - seq2, err := cdc.DecodeValue(v) - assert.NilError(t, err) - assert.Equal(t, seq, seq2) - - entry := &ormkv.SeqEntry{ - TableName: tableName, - Value: seq, - } - k, v, err := cdc.EncodeEntry(entry) - assert.NilError(t, err) - entry2, err := cdc.DecodeEntry(k, v) - assert.NilError(t, err) - assert.DeepEqual(t, entry, entry2) - assert.Assert(t, bytes.Equal(cdc.Prefix(), k)) - }) -} diff --git a/orm/encoding/ormkv/unique_key.go b/orm/encoding/ormkv/unique_key.go deleted file mode 100644 index 7a8955d1a51a..000000000000 --- a/orm/encoding/ormkv/unique_key.go +++ /dev/null @@ -1,209 +0,0 @@ -package ormkv - -import ( - "bytes" - "io" - - "google.golang.org/protobuf/reflect/protoreflect" - - "cosmossdk.io/orm/types/ormerrors" -) - -// UniqueKeyCodec is the codec for unique indexes. -type UniqueKeyCodec struct { - pkFieldOrder []struct { - inKey bool - i int - } - keyCodec *KeyCodec - valueCodec *KeyCodec -} - -var _ IndexCodec = &UniqueKeyCodec{} - -// NewUniqueKeyCodec creates a new UniqueKeyCodec with an optional prefix for the -// provided message descriptor, index and primary key fields. -func NewUniqueKeyCodec(prefix []byte, messageType protoreflect.MessageType, indexFields, primaryKeyFields []protoreflect.Name) (*UniqueKeyCodec, error) { - if len(indexFields) == 0 { - return nil, ormerrors.InvalidTableDefinition.Wrapf("index fields are empty") - } - - if len(primaryKeyFields) == 0 { - return nil, ormerrors.InvalidTableDefinition.Wrapf("primary key fields are empty") - } - - keyCodec, err := NewKeyCodec(prefix, messageType, indexFields) - if err != nil { - return nil, err - } - - haveFields := map[protoreflect.Name]int{} - for i, descriptor := range keyCodec.fieldDescriptors { - haveFields[descriptor.Name()] = i - } - - var valueFields []protoreflect.Name - var pkFieldOrder []struct { - inKey bool - i int - } - k := 0 - for _, field := range primaryKeyFields { - if j, ok := haveFields[field]; ok { - pkFieldOrder = append(pkFieldOrder, struct { - inKey bool - i int - }{inKey: true, i: j}) - } else { - valueFields = append(valueFields, field) - pkFieldOrder = append(pkFieldOrder, struct { - inKey bool - i int - }{inKey: false, i: k}) - k++ - } - } - - // if there is nothing in the value we have a trivial unique index - // which shouldn't actually be a unique index at all - if len(valueFields) == 0 { - return nil, ormerrors.InvalidTableDefinition.Wrapf("unique index %s on table %s introduces no new uniqueness constraint not already in the primary key and should not be marked as unique", - indexFields, messageType.Descriptor().FullName()) - } - - valueCodec, err := NewKeyCodec(nil, messageType, valueFields) - if err != nil { - return nil, err - } - - return &UniqueKeyCodec{ - pkFieldOrder: pkFieldOrder, - keyCodec: keyCodec, - valueCodec: valueCodec, - }, nil -} - -func (u UniqueKeyCodec) DecodeIndexKey(k, v []byte) (indexFields, primaryKey []protoreflect.Value, err error) { - ks, err := u.keyCodec.DecodeKey(bytes.NewReader(k)) - - // got prefix key - if err == io.EOF { - return ks, nil, err - } else if err != nil { - return nil, nil, err - } - - // got prefix key - if len(ks) < len(u.keyCodec.fieldCodecs) { - return ks, nil, err - } - - vs, err := u.valueCodec.DecodeKey(bytes.NewReader(v)) - if err != nil { - return nil, nil, err - } - - pk := u.extractPrimaryKey(ks, vs) - return ks, pk, nil -} - -func (u UniqueKeyCodec) extractPrimaryKey(keyValues, valueValues []protoreflect.Value) []protoreflect.Value { - numPkFields := len(u.pkFieldOrder) - pkValues := make([]protoreflect.Value, numPkFields) - - for i := 0; i < numPkFields; i++ { - fo := u.pkFieldOrder[i] - if fo.inKey { - pkValues[i] = keyValues[fo.i] - } else { - pkValues[i] = valueValues[fo.i] - } - } - - return pkValues -} - -func (u UniqueKeyCodec) DecodeEntry(k, v []byte) (Entry, error) { - idxVals, pk, err := u.DecodeIndexKey(k, v) - if err != nil { - return nil, err - } - - return &IndexKeyEntry{ - TableName: u.MessageType().Descriptor().FullName(), - Fields: u.keyCodec.fieldNames, - IsUnique: true, - IndexValues: idxVals, - PrimaryKey: pk, - }, err -} - -func (u UniqueKeyCodec) EncodeEntry(entry Entry) (k, v []byte, err error) { - indexEntry, ok := entry.(*IndexKeyEntry) - if !ok { - return nil, nil, ormerrors.BadDecodeEntry - } - k, err = u.keyCodec.EncodeKey(indexEntry.IndexValues) - if err != nil { - return nil, nil, err - } - - n := len(indexEntry.PrimaryKey) - if n != len(u.pkFieldOrder) { - return nil, nil, ormerrors.BadDecodeEntry.Wrapf("wrong primary key length") - } - - var values []protoreflect.Value - for i := 0; i < n; i++ { - value := indexEntry.PrimaryKey[i] - fieldOrder := u.pkFieldOrder[i] - if !fieldOrder.inKey { - // goes in values because it is not present in the index key otherwise - values = append(values, value) - } else if u.keyCodec.fieldCodecs[fieldOrder.i].Compare(value, indexEntry.IndexValues[fieldOrder.i]) != 0 { - // does not go in values, but we need to verify that the value in index values matches the primary key value - return nil, nil, ormerrors.BadDecodeEntry.Wrapf("value in primary key does not match corresponding value in index key") - } - } - - v, err = u.valueCodec.EncodeKey(values) - return k, v, err -} - -func (u UniqueKeyCodec) EncodeKVFromMessage(message protoreflect.Message) (k, v []byte, err error) { - _, k, err = u.keyCodec.EncodeKeyFromMessage(message) - if err != nil { - return nil, nil, err - } - - _, v, err = u.valueCodec.EncodeKeyFromMessage(message) - return k, v, err -} - -func (u UniqueKeyCodec) GetFieldNames() []protoreflect.Name { - return u.keyCodec.GetFieldNames() -} - -func (u UniqueKeyCodec) GetKeyCodec() *KeyCodec { - return u.keyCodec -} - -func (u UniqueKeyCodec) GetValueCodec() *KeyCodec { - return u.valueCodec -} - -func (u UniqueKeyCodec) CompareKeys(key1, key2 []protoreflect.Value) int { - return u.keyCodec.CompareKeys(key1, key2) -} - -func (u UniqueKeyCodec) EncodeKeyFromMessage(message protoreflect.Message) (keyValues []protoreflect.Value, key []byte, err error) { - return u.keyCodec.EncodeKeyFromMessage(message) -} - -func (u UniqueKeyCodec) IsFullyOrdered() bool { - return u.keyCodec.IsFullyOrdered() -} - -func (u UniqueKeyCodec) MessageType() protoreflect.MessageType { - return u.keyCodec.messageType -} diff --git a/orm/encoding/ormkv/unique_key_test.go b/orm/encoding/ormkv/unique_key_test.go deleted file mode 100644 index f7448d409d58..000000000000 --- a/orm/encoding/ormkv/unique_key_test.go +++ /dev/null @@ -1,92 +0,0 @@ -package ormkv_test - -import ( - "bytes" - "fmt" - "testing" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - "gotest.tools/v3/assert" - "pgregory.net/rapid" - - "cosmossdk.io/orm/encoding/ormkv" - "cosmossdk.io/orm/internal/testpb" - "cosmossdk.io/orm/internal/testutil" - "cosmossdk.io/orm/types/ormerrors" -) - -func TestUniqueKeyCodec(t *testing.T) { - rapid.Check(t, func(t *rapid.T) { - keyCodec := testutil.TestKeyCodecGen(1, 5).Draw(t, "keyCodec") - pkCodec := testutil.TestKeyCodecGen(1, 5).Draw(t, "primaryKeyCodec") - - // check if we have a trivial unique index where all of the fields - // in the primary key are in the unique key, we should expect an - // error in this case - isInPk := map[protoreflect.Name]bool{} - for _, spec := range pkCodec.KeySpecs { - isInPk[spec.FieldName] = true - } - numPkFields := 0 - for _, spec := range keyCodec.KeySpecs { - if isInPk[spec.FieldName] { - numPkFields++ - } - } - isTrivialUniqueKey := numPkFields == len(pkCodec.KeySpecs) - - messageType := (&testpb.ExampleTable{}).ProtoReflect().Type() - uniqueKeyCdc, err := ormkv.NewUniqueKeyCodec( - keyCodec.Codec.Prefix(), - messageType, - keyCodec.Codec.GetFieldNames(), - pkCodec.Codec.GetFieldNames(), - ) - - if isTrivialUniqueKey { - assert.ErrorContains(t, err, "no new uniqueness constraint") - return - } - assert.NilError(t, err) - - for i := 0; i < 100; i++ { - a := testutil.GenA.Draw(t, fmt.Sprintf("a%d", i)) - key := keyCodec.Codec.GetKeyValues(a.ProtoReflect()) - pk := pkCodec.Codec.GetKeyValues(a.ProtoReflect()) - uniq1 := &ormkv.IndexKeyEntry{ - TableName: messageType.Descriptor().FullName(), - Fields: keyCodec.Codec.GetFieldNames(), - IsUnique: true, - IndexValues: key, - PrimaryKey: pk, - } - k, v, err := uniqueKeyCdc.EncodeEntry(uniq1) - assert.NilError(t, err) - - k2, v2, err := uniqueKeyCdc.EncodeKVFromMessage(a.ProtoReflect()) - assert.NilError(t, err) - assert.Assert(t, bytes.Equal(k, k2)) - assert.Assert(t, bytes.Equal(v, v2)) - - entry2, err := uniqueKeyCdc.DecodeEntry(k, v) - assert.NilError(t, err) - uniq2 := entry2.(*ormkv.IndexKeyEntry) - assert.Equal(t, 0, keyCodec.Codec.CompareKeys(uniq1.IndexValues, uniq2.IndexValues)) - assert.Equal(t, 0, pkCodec.Codec.CompareKeys(uniq1.PrimaryKey, uniq2.PrimaryKey)) - assert.Equal(t, true, uniq2.IsUnique) - assert.Equal(t, messageType.Descriptor().FullName(), uniq2.TableName) - assert.DeepEqual(t, uniq1.Fields, uniq2.Fields) - - idxFields, pk2, err := uniqueKeyCdc.DecodeIndexKey(k, v) - assert.NilError(t, err) - assert.Equal(t, 0, keyCodec.Codec.CompareKeys(key, idxFields)) - assert.Equal(t, 0, pkCodec.Codec.CompareKeys(pk, pk2)) - } - }) -} - -func TestTrivialUnique(t *testing.T) { - _, err := ormkv.NewUniqueKeyCodec(nil, (&testpb.ExampleTable{}).ProtoReflect().Type(), - []protoreflect.Name{"u32", "str"}, []protoreflect.Name{"str", "u32"}) - assert.ErrorIs(t, err, ormerrors.InvalidTableDefinition) -} diff --git a/orm/features/table/saving.feature b/orm/features/table/saving.feature deleted file mode 100644 index 59c6151971b9..000000000000 --- a/orm/features/table/saving.feature +++ /dev/null @@ -1,49 +0,0 @@ -Feature: inserting, updating and saving entities - - Scenario: can't insert an entity with a duplicate primary key - Given an existing entity - """ - {"name": "foo", "not_unique": "bar"} - """ - When I insert - """ - {"name": "foo", "not_unique": "baz"} - """ - Then expect a "already exists" error - And expect grpc error code "ALREADY_EXISTS" - - Scenario: can't update entity that doesn't exist - When I update - """ - {"name":"foo"} - """ - Then expect a "not found" error - And expect grpc error code "NOT_FOUND" -# - Scenario: can't violate unique constraint on insert - Given an existing entity - """ - {"name": "foo", "unique": "bar"} - """ - When I insert - """ - {"name": "baz", "unique": "bar"} - """ - Then expect a "unique key violation" error - And expect grpc error code "FAILED_PRECONDITION" - - Scenario: can't violate unique constraint on update - Given an existing entity - """ - {"name": "foo", "unique": "bar"} - """ - And an existing entity - """ - {"name": "baz", "unique": "bam"} - """ - When I update - """ - {"name": "baz", "unique": "bar"} - """ - Then expect a "unique key violation" error - And expect grpc error code "FAILED_PRECONDITION" diff --git a/orm/go.mod b/orm/go.mod deleted file mode 100644 index 6d7202540370..000000000000 --- a/orm/go.mod +++ /dev/null @@ -1,68 +0,0 @@ -module cosmossdk.io/orm - -go 1.20 - -require ( - cosmossdk.io/api v0.4.2 - cosmossdk.io/core v0.8.0 - cosmossdk.io/depinject v1.0.0-alpha.3 - cosmossdk.io/errors v1.0.0-beta.7 - github.com/cosmos/cosmos-db v1.0.0 - github.com/cosmos/cosmos-proto v1.0.0-beta.3 - github.com/golang/mock v1.6.0 - github.com/google/go-cmp v0.5.9 - github.com/iancoleman/strcase v0.2.0 - github.com/regen-network/gocuke v0.6.2 - github.com/stretchr/testify v1.8.4 - golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 - google.golang.org/grpc v1.55.0 - google.golang.org/protobuf v1.30.0 - gotest.tools/v3 v3.4.0 - pgregory.net/rapid v0.6.2 -) - -require ( - github.com/DataDog/zstd v1.5.5 // indirect - github.com/alecthomas/participle/v2 v2.0.0-alpha7 // indirect - github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/cockroachdb/apd/v3 v3.1.0 // indirect - github.com/cockroachdb/errors v1.9.1 // indirect - github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20230525220056-bb4fc9527b3b // indirect - github.com/cockroachdb/redact v1.1.4 // indirect - github.com/cosmos/gogoproto v1.4.10 // indirect - github.com/cucumber/common/gherkin/go/v22 v22.0.0 // indirect - github.com/cucumber/common/messages/go/v17 v17.1.1 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/getsentry/sentry-go v0.21.0 // indirect - github.com/gofrs/uuid v4.2.0+incompatible // indirect - github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/protobuf v1.5.3 // indirect - github.com/golang/snappy v0.0.4 // indirect - github.com/google/btree v1.1.2 // indirect - github.com/klauspost/compress v1.16.5 // indirect - github.com/kr/pretty v0.3.1 // indirect - github.com/kr/text v0.2.0 // indirect - github.com/lib/pq v1.10.7 // indirect - github.com/linxGnu/grocksdb v1.7.16 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/onsi/gomega v1.20.0 // indirect - github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.15.1 // indirect - github.com/prometheus/client_model v0.4.0 // indirect - github.com/prometheus/common v0.44.0 // indirect - github.com/prometheus/procfs v0.10.0 // indirect - github.com/rogpeppe/go-internal v1.10.0 // indirect - github.com/spf13/cast v1.5.1 // indirect - github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/text v0.9.0 // indirect - google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect -) diff --git a/orm/go.sum b/orm/go.sum deleted file mode 100644 index bea52fcc7e47..000000000000 --- a/orm/go.sum +++ /dev/null @@ -1,481 +0,0 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cosmossdk.io/api v0.4.2 h1:lQBMl4xINnMnBOR/tQLtjlDnR4exr4e6/SfHR8PILE0= -cosmossdk.io/api v0.4.2/go.mod h1:qrVgOp7DIeAXa+Tt5dDjOC47bZCDrwx8ZHxrmy7STNE= -cosmossdk.io/core v0.8.0 h1:LcJnu52E1a8f8E317VfQ1xK/RZe+IuhMNQAjnDLh25M= -cosmossdk.io/core v0.8.0/go.mod h1:LF6VLOv2DdCiaHxYVmr0MZcZpaSM9ZgvyrQSYTeg6D0= -cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw= -cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= -cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= -cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= -github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= -github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= -github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= -github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= -github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= -github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= -github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= -github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c= -github.com/alecthomas/participle/v2 v2.0.0-alpha7/go.mod h1:NumScqsC42o9x+dGj8/YqsIfhrIQjFEOFovxotbBirA= -github.com/alecthomas/repr v0.0.0-20181024024818-d37bc2a10ba1 h1:GDQdwm/gAcJcLAKQQZGOJ4knlw+7rfEQQcmwTbt4p5E= -github.com/alecthomas/repr v0.0.0-20181024024818-d37bc2a10ba1/go.mod h1:xTS7Pm1pD1mvyM075QCDSRqH6qRLXylzS24ZTpRiSzQ= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= -github.com/cockroachdb/apd/v3 v3.1.0/go.mod h1:6qgPBMXjATAdD/VefbRP9NoSLKjbB4LCoA7gN4LpHs4= -github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= -github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= -github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= -github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/pebble v0.0.0-20230525220056-bb4fc9527b3b h1:LCs8gDhg6vt8A3dN7AEJxmCoETZ4qkySoVJVm3rcSJk= -github.com/cockroachdb/pebble v0.0.0-20230525220056-bb4fc9527b3b/go.mod h1:TkdVsGYRqtULUppt2RbC+YaKtTHnHoWa2apfFrSKABw= -github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/cockroachdb/redact v1.1.4 h1:Y0XrVI2FAyofNyGveodTN//qdpPtFKcKTeCBsK3AHAQ= -github.com/cockroachdb/redact v1.1.4/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0E= -github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= -github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= -github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoKuI= -github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= -github.com/cucumber/common/gherkin/go/v22 v22.0.0/go.mod h1:3mJT10B2GGn3MvVPd3FwR7m2u4tLhSRhWUqJU4KN4Fg= -github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= -github.com/cucumber/common/messages/go/v17 v17.1.1/go.mod h1:bpGxb57tDE385Rb2EohgUadLkAbhoC4IyCFi89u/JQI= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= -github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= -github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= -github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= -github.com/getsentry/sentry-go v0.21.0 h1:c9l5F1nPF30JIppulk4veau90PK6Smu3abgVtVQWon4= -github.com/getsentry/sentry-go v0.21.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= -github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= -github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= -github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= -github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= -github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= -github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= -github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= -github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gofrs/uuid v4.2.0+incompatible h1:yyYWMnhkhrKwwr8gAOcOCYxOOscHgDS9yZgBrnJfGa0= -github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= -github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= -github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= -github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= -github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= -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/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -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= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= -github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= -github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= -github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= -github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= -github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= -github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= -github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= -github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= -github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= -github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= -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/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI= -github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= -github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -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.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= -github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= -github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/linxGnu/grocksdb v1.7.16 h1:Q2co1xrpdkr5Hx3Fp+f+f7fRGhQFQhvi/+226dtLmA8= -github.com/linxGnu/grocksdb v1.7.16/go.mod h1:JkS7pl5qWpGpuVb3bPqTz8nC12X3YtPZT+Xq7+QfQo4= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= -github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= -github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= -github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= -github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= -github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= -github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= -github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= -github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= -github.com/onsi/gomega v1.20.0 h1:8W0cWlwFkflGPLltQvLRB7ZVD5HuP6ng320w2IS245Q= -github.com/onsi/gomega v1.20.0/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= -github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.15.1 h1:8tXpTmJbyH5lydzFPoxSIJ0J46jdh3tylbvM1xCv0LI= -github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= -github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= -github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= -github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= -github.com/prometheus/procfs v0.10.0 h1:UkG7GPYkO4UZyLnyXjaWYcgOSONqwdBqFUT95ugmt6I= -github.com/prometheus/procfs v0.10.0/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= -github.com/regen-network/gocuke v0.6.2 h1:pHviZ0kKAq2U2hN2q3smKNxct6hS0mGByFMHGnWA97M= -github.com/regen-network/gocuke v0.6.2/go.mod h1:zYaqIHZobHyd0xOrHGPQjbhGJsuZ1oElx150u2o1xuk= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= -github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= -github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= -github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= -github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= -github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/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-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -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= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= -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= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -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-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181221001348-537d06c36207/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-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -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= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= -google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -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/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= -gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -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= -gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= -gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -pgregory.net/rapid v0.6.2 h1:ErW5sL+UKtfBfUTsWHDCoeB+eZKLKMxrSd1VJY6W4bw= -pgregory.net/rapid v0.6.2/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/orm/internal/buf.gen.yaml b/orm/internal/buf.gen.yaml deleted file mode 100644 index 7baeb94c19a7..000000000000 --- a/orm/internal/buf.gen.yaml +++ /dev/null @@ -1,17 +0,0 @@ -version: v1 -managed: - enabled: true - go_package_prefix: - default: cosmossdk.io/orm/internal - override: - buf.build/cosmos/cosmos-sdk: cosmossdk.io/api -plugins: - - name: go - out: . - opt: paths=source_relative - - name: go-grpc - out: . - opt: paths=source_relative - - name: go-cosmos-orm - out: . - opt: paths=source_relative diff --git a/orm/internal/buf.proto.gen.yaml b/orm/internal/buf.proto.gen.yaml deleted file mode 100644 index 8f6ad94efa82..000000000000 --- a/orm/internal/buf.proto.gen.yaml +++ /dev/null @@ -1,11 +0,0 @@ -version: v1 -managed: - enabled: true - go_package_prefix: - default: cosmossdk.io/orm/internal - override: - buf.build/cosmos/cosmos-sdk: cosmossdk.io/api -plugins: - - name: go-cosmos-orm-proto - out: . - opt: paths=source_relative diff --git a/orm/internal/codegen/codegen.go b/orm/internal/codegen/codegen.go deleted file mode 100644 index aa2513504ed5..000000000000 --- a/orm/internal/codegen/codegen.go +++ /dev/null @@ -1,91 +0,0 @@ -package codegen - -import ( - "fmt" - "os" - - "google.golang.org/protobuf/compiler/protogen" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/pluginpb" - - ormv1 "cosmossdk.io/api/cosmos/orm/v1" - "github.com/cosmos/cosmos-proto/generator" -) - -const ( - contextPkg = protogen.GoImportPath("context") - ormListPkg = protogen.GoImportPath("cosmossdk.io/orm/model/ormlist") - ormErrPkg = protogen.GoImportPath("cosmossdk.io/orm/types/ormerrors") - ormTablePkg = protogen.GoImportPath("cosmossdk.io/orm/model/ormtable") -) - -func ORMPluginRunner(p *protogen.Plugin) error { - p.SupportedFeatures = uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL) - for _, f := range p.Files { - if !f.Generate { - continue - } - - if !hasTables(f) { - continue - } - - gen := p.NewGeneratedFile(fmt.Sprintf("%s.cosmos_orm.go", f.GeneratedFilenamePrefix), f.GoImportPath) - cgen := &generator.GeneratedFile{ - GeneratedFile: gen, - LocalPackages: map[string]bool{}, - } - fgen := fileGen{GeneratedFile: cgen, file: f} - err := fgen.gen() - if err != nil { - return err - } - } - - return nil -} - -func QueryProtoPluginRunner(p *protogen.Plugin) error { - p.SupportedFeatures = uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL) - for _, f := range p.Files { - if !f.Generate { - continue - } - - if !hasTables(f) { - continue - } - - out, err := os.OpenFile(fmt.Sprintf("%s_query.proto", f.GeneratedFilenamePrefix), os.O_RDWR|os.O_TRUNC|os.O_CREATE, 0o644) - if err != nil { - return err - } - - err = queryProtoGen{ - File: f, - svc: newWriter(), - msgs: newWriter(), - outFile: out, - imports: map[string]bool{}, - }.gen() - if err != nil { - return err - } - } - - return nil -} - -func hasTables(file *protogen.File) bool { - for _, message := range file.Messages { - if proto.GetExtension(message.Desc.Options(), ormv1.E_Table).(*ormv1.TableDescriptor) != nil { - return true - } - - if proto.GetExtension(message.Desc.Options(), ormv1.E_Singleton).(*ormv1.SingletonDescriptor) != nil { - return true - } - } - - return false -} diff --git a/orm/internal/codegen/file.go b/orm/internal/codegen/file.go deleted file mode 100644 index bd494174f797..000000000000 --- a/orm/internal/codegen/file.go +++ /dev/null @@ -1,179 +0,0 @@ -// nolint:unused // ignore unused code linting -package codegen - -import ( - "path/filepath" - "strings" - - "github.com/cosmos/cosmos-proto/generator" - "github.com/iancoleman/strcase" - "google.golang.org/protobuf/compiler/protogen" - "google.golang.org/protobuf/proto" - - ormv1 "cosmossdk.io/api/cosmos/orm/v1" -) - -type fileGen struct { - *generator.GeneratedFile - file *protogen.File -} - -func (f fileGen) gen() error { - f.P("// Code generated by protoc-gen-go-cosmos-orm. DO NOT EDIT.") - f.P() - f.P("package ", f.file.GoPackageName) - stores := make([]*protogen.Message, 0) - for _, msg := range f.file.Messages { - tableDesc := proto.GetExtension(msg.Desc.Options(), ormv1.E_Table).(*ormv1.TableDescriptor) - if tableDesc != nil { - tableGen, err := newTableGen(f, msg, tableDesc) - if err != nil { - return err - } - tableGen.gen() - } - singletonDesc := proto.GetExtension(msg.Desc.Options(), ormv1.E_Singleton).(*ormv1.SingletonDescriptor) - if singletonDesc != nil { - // do some singleton magic - singletonGen, err := newSingletonGen(f, msg, singletonDesc) - if err != nil { - return err - } - singletonGen.gen() - } - - if tableDesc != nil || singletonDesc != nil { // message is one of the tables, - stores = append(stores, msg) - } - } - f.genStoreInterface(stores) - f.genStoreStruct(stores) - f.genStoreMethods(stores) - f.genStoreInterfaceGuard() - f.genStoreConstructor(stores) - return nil -} - -func (f fileGen) genStoreInterface(stores []*protogen.Message) { - f.P("type ", f.storeInterfaceName(), " interface {") - for _, store := range stores { - name := f.messageTableInterfaceName(store) - f.P(name, "()", name) - } - f.P() - f.P("doNotImplement()") - f.P("}") - f.P() -} - -func (f fileGen) genStoreStruct(stores []*protogen.Message) { - // struct - f.P("type ", f.storeStructName(), " struct {") - for _, message := range stores { - f.P(f.param(message.GoIdent.GoName), " ", f.messageTableInterfaceName(message)) - } - f.P("}") -} - -func (f fileGen) storeAccessorName() string { - return f.storeInterfaceName() -} - -func (f fileGen) storeInterfaceName() string { - return strcase.ToCamel(f.fileShortName()) + "Store" -} - -func (f fileGen) storeStructName() string { - return strcase.ToLowerCamel(f.fileShortName()) + "Store" -} - -func (f fileGen) fileShortName() string { - return fileShortName(f.file) -} - -func fileShortName(file *protogen.File) string { - filename := file.Proto.GetName() - shortName := filepath.Base(filename) - i := strings.Index(shortName, ".") - if i > 0 { - return shortName[:i] - } - return strcase.ToCamel(shortName) -} - -func (f fileGen) messageTableInterfaceName(m *protogen.Message) string { - return m.GoIdent.GoName + "Table" -} - -func (f fileGen) messageReaderInterfaceName(m *protogen.Message) string { - return m.GoIdent.GoName + "Reader" -} - -func (f fileGen) messageTableVar(m *protogen.Message) string { - return f.param(m.GoIdent.GoName + "Table") -} - -func (f fileGen) param(name string) string { - return strcase.ToLowerCamel(name) -} - -func (f fileGen) messageTableReceiverName(m *protogen.Message) string { - return f.param(f.messageTableInterfaceName(m)) -} - -func (f fileGen) messageConstructorName(m *protogen.Message) string { - return "New" + f.messageTableInterfaceName(m) -} - -func (f fileGen) genStoreMethods(stores []*protogen.Message) { - // getters - for _, msg := range stores { - name := f.messageTableInterfaceName(msg) - f.P("func(x ", f.storeStructName(), ") ", name, "() ", name, "{") - f.P("return x.", f.param(msg.GoIdent.GoName)) - f.P("}") - f.P() - } - f.P("func(", f.storeStructName(), ") doNotImplement() {}") - f.P() -} - -func (f fileGen) genStoreInterfaceGuard() { - f.P("var _ ", f.storeInterfaceName(), " = ", f.storeStructName(), "{}") -} - -func (f fileGen) genStoreConstructor(stores []*protogen.Message) { - f.P("func New", f.storeInterfaceName(), "(db ", ormTablePkg.Ident("Schema"), ") (", f.storeInterfaceName(), ", error) {") - for _, store := range stores { - f.P(f.messageTableReceiverName(store), ", err := ", f.messageConstructorName(store), "(db)") - f.P("if err != nil {") - f.P("return nil, err") - f.P("}") - f.P() - } - - f.P("return ", f.storeStructName(), "{") - for _, store := range stores { - f.P(f.messageTableReceiverName(store), ",") - } - f.P("}, nil") - f.P("}") -} - -func fieldsToCamelCase(fields string) string { - splitFields := strings.Split(fields, ",") - camelFields := make([]string, len(splitFields)) - for i, field := range splitFields { - camelFields[i] = strcase.ToCamel(field) - } - return strings.Join(camelFields, "") -} - -func fieldsToSnakeCase(fields string) string { - splitFields := strings.Split(fields, ",") - camelFields := make([]string, len(splitFields)) - for i, field := range splitFields { - camelFields[i] = strcase.ToSnake(field) - } - return strings.Join(camelFields, "_") -} diff --git a/orm/internal/codegen/index.go b/orm/internal/codegen/index.go deleted file mode 100644 index 2a02d296148c..000000000000 --- a/orm/internal/codegen/index.go +++ /dev/null @@ -1,138 +0,0 @@ -// nolint:unused // ignore unused code linting -package codegen - -import ( - "fmt" - "strings" - - "github.com/iancoleman/strcase" - "google.golang.org/protobuf/reflect/protoreflect" -) - -func (t tableGen) genIndexKeys() { - // interface that all keys must adhere to - t.P("type ", t.indexKeyInterfaceName(), " interface {") - t.P("id() uint32") - t.P("values() []interface{}") - t.P(t.param(t.indexKeyInterfaceName()), "()") - t.P("}") - t.P() - - // start with primary key.. - t.P("// primary key starting index..") - t.genIndex(t.table.PrimaryKey.Fields, 0, true) - for _, idx := range t.table.Index { - t.genIndex(idx.Fields, idx.Id, false) - } -} - -func (t tableGen) genIterator() { - t.P("type ", t.iteratorName(), " struct {") - t.P(ormTablePkg.Ident("Iterator")) - t.P("}") - t.P() - t.genValueFunc() - t.P() -} - -func (t tableGen) genValueFunc() { - varName := t.param(t.msg.GoIdent.GoName) - t.P("func (i ", t.iteratorName(), ") Value() (*", t.QualifiedGoIdent(t.msg.GoIdent), ", error) {") - t.P("var ", varName, " ", t.QualifiedGoIdent(t.msg.GoIdent)) - t.P("err := i.UnmarshalMessage(&", varName, ")") - t.P("return &", varName, ", err") - t.P("}") -} - -func (t tableGen) genIndexMethods(idxKeyName string) { - receiverFunc := fmt.Sprintf("func (x %s) ", idxKeyName) - t.P(receiverFunc, "id() uint32 { return ", t.table.Id, " /* primary key */ }") - t.P(receiverFunc, "values() []interface{} { return x.vs }") - t.P(receiverFunc, t.param(t.indexKeyInterfaceName()), "() {}") - t.P() -} - -func (t tableGen) genIndexInterfaceGuard(idxKeyName string) { - t.P("var _ ", t.indexKeyInterfaceName(), " = ", idxKeyName, "{}") - t.P() -} - -func (t tableGen) indexKeyInterfaceName() string { - return t.msg.GoIdent.GoName + "IndexKey" -} - -func (t tableGen) genIndexKey(idxKeyName string) { - t.P("type ", idxKeyName, " struct {") - t.P("vs []interface{}") - t.P("}") - t.P() -} - -func (t tableGen) indexKeyParts(names []protoreflect.Name) string { - cnames := make([]string, len(names)) - for i, name := range names { - cnames[i] = strcase.ToCamel(string(name)) - } - return strings.Join(cnames, "") -} - -func (t tableGen) indexKeyName(names []protoreflect.Name) string { - cnames := make([]string, len(names)) - for i, name := range names { - cnames[i] = strcase.ToCamel(string(name)) - } - joinedNames := strings.Join(cnames, "") - return t.msg.GoIdent.GoName + joinedNames + "IndexKey" -} - -func (t tableGen) indexStructName(fields []string) string { - names := make([]string, len(fields)) - for i, field := range fields { - names[i] = strcase.ToCamel(field) - } - joinedNames := strings.Join(names, "") - return t.msg.GoIdent.GoName + joinedNames + "IndexKey" -} - -func (t tableGen) genIndex(fields string, id uint32, isPrimaryKey bool) { - fieldsSlc := strings.Split(fields, ",") - idxKeyName := t.indexStructName(fieldsSlc) - - if isPrimaryKey { - t.P("type ", t.msg.GoIdent.GoName, "PrimaryKey = ", idxKeyName) - t.P() - } - - t.P("type ", idxKeyName, " struct {") - t.P("vs []interface{}") - t.P("}") - - t.genIndexInterfaceMethods(id, idxKeyName) - - for i := 1; i < len(fieldsSlc)+1; i++ { - t.genWithMethods(idxKeyName, fieldsSlc[:i]) - } -} - -func (t tableGen) genIndexInterfaceMethods(id uint32, indexStructName string) { - funPrefix := fmt.Sprintf("func (x %s) ", indexStructName) - t.P(funPrefix, "id() uint32 {return ", id, "}") - t.P(funPrefix, "values() []interface{} {return x.vs}") - t.P(funPrefix, t.param(t.indexKeyInterfaceName()), "() {}") - t.P() -} - -func (t tableGen) genWithMethods(indexStructName string, parts []string) { - funcPrefix := fmt.Sprintf("func (this %s) ", indexStructName) - camelParts := make([]string, len(parts)) - for i, part := range parts { - camelParts[i] = strcase.ToCamel(part) - } - funcName := "With" + strings.Join(camelParts, "") - - t.P(funcPrefix, funcName, "(", t.fieldArgsFromStringSlice(parts), ") ", indexStructName, "{") - t.P("this.vs = []interface{}{", strings.Join(parts, ","), "}") - t.P("return this") - t.P("}") - t.P() -} diff --git a/orm/internal/codegen/query.go b/orm/internal/codegen/query.go deleted file mode 100644 index 52551dccaee8..000000000000 --- a/orm/internal/codegen/query.go +++ /dev/null @@ -1,320 +0,0 @@ -package codegen - -import ( - "bytes" - "fmt" - "os" - - "github.com/iancoleman/strcase" - "golang.org/x/exp/maps" - "golang.org/x/exp/slices" - "google.golang.org/protobuf/compiler/protogen" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - - ormv1 "cosmossdk.io/api/cosmos/orm/v1" - - "cosmossdk.io/orm/internal/fieldnames" -) - -type queryProtoGen struct { - *protogen.File - imports map[string]bool - svc *writer - msgs *writer - outFile *os.File -} - -func (g queryProtoGen) gen() error { - g.imports[g.Desc.Path()] = true - - g.svc.F("// %sService queries the state of the tables specified by %s.", g.queryServiceName(), g.Desc.Path()) - g.svc.F("service %sService {", g.queryServiceName()) - g.svc.Indent() - for _, msg := range g.Messages { - tableDesc := proto.GetExtension(msg.Desc.Options(), ormv1.E_Table).(*ormv1.TableDescriptor) - if tableDesc != nil { - err := g.genTableRPCMethods(msg, tableDesc) - if err != nil { - return err - } - } - singletonDesc := proto.GetExtension(msg.Desc.Options(), ormv1.E_Singleton).(*ormv1.SingletonDescriptor) - if singletonDesc != nil { - err := g.genSingletonRPCMethods(msg) - if err != nil { - return err - } - } - } - g.svc.Dedent() - g.svc.F("}") - g.svc.F("") - - outBuf := newWriter() - outBuf.F("// Code generated by protoc-gen-go-cosmos-orm-proto. DO NOT EDIT.") - outBuf.F(`syntax = "proto3";`) - outBuf.F("package %s;", g.Desc.Package()) - outBuf.F("") - - imports := maps.Keys(g.imports) - slices.Sort(imports) - for _, i := range imports { - outBuf.F(`import "%s";`, i) - } - outBuf.F("") - - _, err := outBuf.Write(g.svc.Bytes()) - if err != nil { - return err - } - - _, err = outBuf.Write(g.msgs.Bytes()) - if err != nil { - return err - } - - _, err = g.outFile.Write(outBuf.Bytes()) - if err != nil { - return err - } - - return g.outFile.Close() -} - -func (g queryProtoGen) genTableRPCMethods(msg *protogen.Message, desc *ormv1.TableDescriptor) error { - name := msg.Desc.Name() - g.svc.F("// Get queries the %s table by its primary key.", name) - g.svc.F("rpc Get%s(Get%sRequest) returns (Get%sResponse) {}", name, name, name) // TODO grpc gateway - - g.startRequestType("Get%sRequest", name) - g.msgs.Indent() - primaryKeyFields := fieldnames.CommaSeparatedFieldNames(desc.PrimaryKey.Fields) - fields := msg.Desc.Fields() - for i, fieldName := range primaryKeyFields.Names() { - field := fields.ByName(fieldName) - if field == nil { - return fmt.Errorf("can't find primary key field %s", fieldName) - } - g.msgs.F("// %s specifies the value of the %s field in the primary key.", fieldName, fieldName) - g.msgs.F("%s %s = %d;", g.fieldType(field), fieldName, i+1) - } - g.msgs.Dedent() - - g.msgs.F("}") - g.msgs.F("") - g.startResponseType("Get%sResponse", name) - g.msgs.Indent() - g.msgs.F("// value is the response value.") - g.msgs.F("%s value = 1;", name) - g.msgs.Dedent() - g.msgs.F("}") - g.msgs.F("") - - for _, idx := range desc.Index { - if !idx.Unique { - continue - } - - fieldsCamel := fieldsToCamelCase(idx.Fields) - methodName := fmt.Sprintf("Get%sBy%s", name, fieldsCamel) - g.svc.F("// %s queries the %s table by its %s index", methodName, name, fieldsCamel) - g.svc.F("rpc %s(%sRequest) returns (%sResponse) {}", methodName, methodName, methodName) // TODO grpc gateway - - g.startRequestType("%sRequest", methodName) - g.msgs.Indent() - fieldNames := fieldnames.CommaSeparatedFieldNames(idx.Fields) - for i, fieldName := range fieldNames.Names() { - field := fields.ByName(fieldName) - if field == nil { - return fmt.Errorf("can't find unique index field %s", fieldName) - } - g.msgs.F("%s %s = %d;", g.fieldType(field), fieldName, i+1) - } - g.msgs.Dedent() - - g.msgs.F("}") - g.msgs.F("") - g.startResponseType("%sResponse", methodName) - g.msgs.Indent() - g.msgs.F("%s value = 1;", name) - g.msgs.Dedent() - g.msgs.F("}") - g.msgs.F("") - } - - g.imports["cosmos/base/query/v1beta1/pagination.proto"] = true - g.svc.F("// List%s queries the %s table using prefix and range queries against defined indexes.", name, name) - g.svc.F("rpc List%s(List%sRequest) returns (List%sResponse) {}", name, name, name) // TODO grpc gateway - g.startRequestType("List%sRequest", name) - g.msgs.Indent() - g.msgs.F("// IndexKey specifies the value of an index key to use in prefix and range queries.") - g.msgs.F("message IndexKey {") - g.msgs.Indent() - - indexFields := []string{desc.PrimaryKey.Fields} - // the primary key has field number 1 - fieldNums := []uint32{1} - for _, index := range desc.Index { - indexFields = append(indexFields, index.Fields) - // index field numbers are their id + 1 - fieldNums = append(fieldNums, index.Id+1) - } - - g.msgs.F("// key specifies the index key value.") - g.msgs.F("oneof key {") - g.msgs.Indent() - for i, fields := range indexFields { - fieldName := fieldsToSnakeCase(fields) - typeName := fieldsToCamelCase(fields) - g.msgs.F("// %s specifies the value of the %s index key to use in the query.", fieldName, typeName) - g.msgs.F("%s %s = %d;", typeName, fieldName, fieldNums[i]) - } - g.msgs.Dedent() - g.msgs.F("}") - - for _, fieldNames := range indexFields { - g.msgs.F("") - g.msgs.F("message %s {", fieldsToCamelCase(fieldNames)) - g.msgs.Indent() - for i, fieldName := range fieldnames.CommaSeparatedFieldNames(fieldNames).Names() { - g.msgs.F("// %s is the value of the %s field in the index.", fieldName, fieldName) - g.msgs.F("// It can be omitted to query for all valid values of that field in this segment of the index.") - g.msgs.F("optional %s %s = %d;", g.fieldType(fields.ByName(fieldName)), fieldName, i+1) - } - g.msgs.Dedent() - g.msgs.F("}") - } - - g.msgs.Dedent() - g.msgs.F("}") - g.msgs.F("") - g.msgs.F("// query specifies the type of query - either a prefix or range query.") - g.msgs.F("oneof query {") - g.msgs.Indent() - g.msgs.F("// prefix_query specifies the index key value to use for the prefix query.") - g.msgs.F("IndexKey prefix_query = 1;") - g.msgs.F("// range_query specifies the index key from/to values to use for the range query.") - g.msgs.F("RangeQuery range_query = 2;") - g.msgs.Dedent() - g.msgs.F("}") - - g.msgs.F("// pagination specifies optional pagination parameters.") - g.msgs.F("cosmos.base.query.v1beta1.PageRequest pagination = 3;") - g.msgs.F("") - g.msgs.F("// RangeQuery specifies the from/to index keys for a range query.") - g.msgs.F("message RangeQuery {") - g.msgs.Indent() - g.msgs.F("// from is the index key to use for the start of the range query.") - g.msgs.F("// To query from the start of an index, specify an index key for that index with empty values.") - g.msgs.F("IndexKey from = 1;") - g.msgs.F("// to is the index key to use for the end of the range query.") - g.msgs.F("// The index key type MUST be the same as the index key type used for from.") - g.msgs.F("// To query from to the end of an index it can be omitted.") - g.msgs.F("IndexKey to = 2;") - g.msgs.Dedent() - g.msgs.F("}") - g.msgs.Dedent() - g.msgs.F("}") - g.msgs.F("") - g.startResponseType("List%sResponse", name) - g.msgs.Indent() - g.msgs.F("// values are the results of the query.") - g.msgs.F("repeated %s values = 1;", name) - g.msgs.F("// pagination is the pagination response.") - g.msgs.F("cosmos.base.query.v1beta1.PageResponse pagination = 2;") - g.msgs.Dedent() - g.msgs.F("}") - g.msgs.F("") - return nil -} - -func (g queryProtoGen) genSingletonRPCMethods(msg *protogen.Message) error { - name := msg.Desc.Name() - g.svc.F("// Get%s queries the %s singleton.", name, name) - g.svc.F("rpc Get%s(Get%sRequest) returns (Get%sResponse) {}", name, name, name) // TODO grpc gateway - g.startRequestType("Get%sRequest", name) - g.msgs.F("}") - g.msgs.F("") - g.startRequestType("Get%sResponse", name) - g.msgs.Indent() - g.msgs.F("%s value = 1;", name) - g.msgs.Dedent() - g.msgs.F("}") - g.msgs.F("") - return nil -} - -func (g queryProtoGen) startRequestType(format string, args ...any) { - g.startRequestResponseType("request", format, args...) -} - -func (g queryProtoGen) startResponseType(format string, args ...any) { - g.startRequestResponseType("response", format, args...) -} - -func (g queryProtoGen) startRequestResponseType(typ, format string, args ...any) { - msgTypeName := fmt.Sprintf(format, args...) - g.msgs.F("// %s is the %s/%s %s type.", msgTypeName, g.queryServiceName(), msgTypeName, typ) - g.msgs.F("message %s {", msgTypeName) -} - -func (g queryProtoGen) queryServiceName() string { - return fmt.Sprintf("%sQuery", strcase.ToCamel(fileShortName(g.File))) -} - -func (g queryProtoGen) fieldType(descriptor protoreflect.FieldDescriptor) string { - if descriptor.Kind() == protoreflect.MessageKind { - message := descriptor.Message() - g.imports[message.ParentFile().Path()] = true - return string(message.FullName()) - } - - return descriptor.Kind().String() -} - -type writer struct { - *bytes.Buffer - indent int - indentStr string -} - -func newWriter() *writer { - return &writer{ - Buffer: &bytes.Buffer{}, - } -} - -func (w *writer) F(format string, args ...interface{}) { - _, err := w.Write([]byte(w.indentStr)) - if err != nil { - panic(err) - } - - _, err = fmt.Fprintf(w, format, args...) - if err != nil { - panic(err) - } - - _, err = fmt.Fprintln(w) - if err != nil { - panic(err) - } -} - -func (w *writer) Indent() { - w.indent++ - w.updateIndent() -} - -func (w *writer) updateIndent() { - w.indentStr = "" - for i := 0; i < w.indent; i++ { - w.indentStr += " " - } -} - -func (w *writer) Dedent() { - w.indent-- - w.updateIndent() -} diff --git a/orm/internal/codegen/singleton.go b/orm/internal/codegen/singleton.go deleted file mode 100644 index 851e70b73437..000000000000 --- a/orm/internal/codegen/singleton.go +++ /dev/null @@ -1,86 +0,0 @@ -package codegen - -import ( - "fmt" - - "google.golang.org/protobuf/compiler/protogen" - "google.golang.org/protobuf/types/dynamicpb" - - ormv1 "cosmossdk.io/api/cosmos/orm/v1" - - "cosmossdk.io/orm/model/ormtable" -) - -type singletonGen struct { - fileGen - msg *protogen.Message - table *ormv1.SingletonDescriptor - ormTable ormtable.Table -} - -func newSingletonGen(fileGen fileGen, msg *protogen.Message, table *ormv1.SingletonDescriptor) (*singletonGen, error) { - s := &singletonGen{fileGen: fileGen, msg: msg, table: table} - var err error - s.ormTable, err = ormtable.Build(ormtable.Options{ - MessageType: dynamicpb.NewMessageType(msg.Desc), - SingletonDescriptor: table, - }) - return s, err -} - -func (s singletonGen) gen() { - s.genInterface() - s.genStruct() - s.genInterfaceGuard() - s.genMethods() - s.genConstructor() -} - -func (s singletonGen) genInterface() { - s.P("// singleton store") - s.P("type ", s.messageTableInterfaceName(s.msg), " interface {") - s.P("Get(ctx ", contextPkg.Ident("Context"), ") (*", s.msg.GoIdent.GoName, ", error)") - s.P("Save(ctx ", contextPkg.Ident("Context"), ", ", s.param(s.msg.GoIdent.GoName), "*", s.msg.GoIdent.GoName, ") error") - s.P("}") - s.P() -} - -func (s singletonGen) genStruct() { - s.P("type ", s.messageTableReceiverName(s.msg), " struct {") - s.P("table ", ormTablePkg.Ident("Table")) - s.P("}") - s.P() -} - -func (s singletonGen) genInterfaceGuard() { - s.P("var _ ", s.messageTableInterfaceName(s.msg), " = ", s.messageTableReceiverName(s.msg), "{}") -} - -func (s singletonGen) genMethods() { - receiver := fmt.Sprintf("func (x %s) ", s.messageTableReceiverName(s.msg)) - varName := s.param(s.msg.GoIdent.GoName) - // Get - s.P(receiver, "Get(ctx ", contextPkg.Ident("Context"), ") (*", s.msg.GoIdent.GoName, ", error) {") - s.P(varName, " := &", s.msg.GoIdent.GoName, "{}") - s.P("_, err := x.table.Get(ctx, ", varName, ")") - s.P("return ", varName, ", err") - s.P("}") - s.P() - - // Save - s.P(receiver, "Save(ctx ", contextPkg.Ident("Context"), ", ", varName, " *", s.msg.GoIdent.GoName, ") error {") - s.P("return x.table.Save(ctx, ", varName, ")") - s.P("}") - s.P() -} - -func (s singletonGen) genConstructor() { - iface := s.messageTableInterfaceName(s.msg) - s.P("func New", iface, "(db ", ormTablePkg.Ident("Schema"), ") (", iface, ", error) {") - s.P("table := db.GetTable(&", s.msg.GoIdent.GoName, "{})") - s.P("if table == nil {") - s.P("return nil, ", ormErrPkg.Ident("TableNotFound.Wrap"), "(string((&", s.msg.GoIdent.GoName, "{}).ProtoReflect().Descriptor().FullName()))") - s.P("}") - s.P("return &", s.messageTableReceiverName(s.msg), "{table}, nil") - s.P("}") -} diff --git a/orm/internal/codegen/table.go b/orm/internal/codegen/table.go deleted file mode 100644 index 1b26e9103d2c..000000000000 --- a/orm/internal/codegen/table.go +++ /dev/null @@ -1,305 +0,0 @@ -//nolint:unused // ignore unused code linting -package codegen - -import ( - "fmt" - "strings" - - "google.golang.org/protobuf/compiler/protogen" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/types/dynamicpb" - - ormv1 "cosmossdk.io/api/cosmos/orm/v1" - - "cosmossdk.io/orm/internal/fieldnames" - "cosmossdk.io/orm/model/ormtable" -) - -type tableGen struct { - fileGen - msg *protogen.Message - table *ormv1.TableDescriptor - primaryKeyFields fieldnames.FieldNames - fields map[protoreflect.Name]*protogen.Field - uniqueIndexes []*ormv1.SecondaryIndexDescriptor - ormTable ormtable.Table -} - -const notFoundDocs = " returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found." - -func newTableGen(fileGen fileGen, msg *protogen.Message, table *ormv1.TableDescriptor) (*tableGen, error) { - t := &tableGen{fileGen: fileGen, msg: msg, table: table, fields: map[protoreflect.Name]*protogen.Field{}} - t.primaryKeyFields = fieldnames.CommaSeparatedFieldNames(table.PrimaryKey.Fields) - for _, field := range msg.Fields { - t.fields[field.Desc.Name()] = field - } - uniqIndexes := make([]*ormv1.SecondaryIndexDescriptor, 0) - for _, idx := range t.table.Index { - if idx.Unique { - uniqIndexes = append(uniqIndexes, idx) - } - } - t.uniqueIndexes = uniqIndexes - var err error - t.ormTable, err = ormtable.Build(ormtable.Options{ - MessageType: dynamicpb.NewMessageType(msg.Desc), - TableDescriptor: table, - }) - return t, err -} - -func (t tableGen) gen() { - t.getTableInterface() - t.genIterator() - t.genIndexKeys() - t.genStruct() - t.genTableImpl() - t.genTableImplGuard() - t.genConstructor() -} - -func (t tableGen) getTableInterface() { - t.P("type ", t.messageTableInterfaceName(t.msg), " interface {") - t.P("Insert(ctx ", contextPkg.Ident("Context"), ", ", t.param(t.msg.GoIdent.GoName), " *", t.QualifiedGoIdent(t.msg.GoIdent), ") error") - if t.table.PrimaryKey.AutoIncrement { - t.P("InsertReturning", fieldsToCamelCase(t.table.PrimaryKey.Fields), "(ctx ", contextPkg.Ident("Context"), ", ", t.param(t.msg.GoIdent.GoName), " *", t.QualifiedGoIdent(t.msg.GoIdent), ") (uint64, error)") - t.P("LastInsertedSequence(ctx ", contextPkg.Ident("Context"), ") (uint64, error)") - } - t.P("Update(ctx ", contextPkg.Ident("Context"), ", ", t.param(t.msg.GoIdent.GoName), " *", t.QualifiedGoIdent(t.msg.GoIdent), ") error") - t.P("Save(ctx ", contextPkg.Ident("Context"), ", ", t.param(t.msg.GoIdent.GoName), " *", t.QualifiedGoIdent(t.msg.GoIdent), ") error") - t.P("Delete(ctx ", contextPkg.Ident("Context"), ", ", t.param(t.msg.GoIdent.GoName), " *", t.QualifiedGoIdent(t.msg.GoIdent), ") error") - t.P("Has(ctx ", contextPkg.Ident("Context"), ", ", t.fieldsArgs(t.primaryKeyFields.Names()), ") (found bool, err error)") - t.P("// Get", notFoundDocs) - t.P("Get(ctx ", contextPkg.Ident("Context"), ", ", t.fieldsArgs(t.primaryKeyFields.Names()), ") (*", t.QualifiedGoIdent(t.msg.GoIdent), ", error)") - - for _, idx := range t.uniqueIndexes { - t.genUniqueIndexSig(idx) - } - t.P("List(ctx ", contextPkg.Ident("Context"), ", prefixKey ", t.indexKeyInterfaceName(), ", opts ...", ormListPkg.Ident("Option"), ") ", "(", t.iteratorName(), ", error)") - t.P("ListRange(ctx ", contextPkg.Ident("Context"), ", from, to ", t.indexKeyInterfaceName(), ", opts ...", ormListPkg.Ident("Option"), ") ", "(", t.iteratorName(), ", error)") - t.P("DeleteBy(ctx ", contextPkg.Ident("Context"), ", prefixKey ", t.indexKeyInterfaceName(), ") error") - t.P("DeleteRange(ctx ", contextPkg.Ident("Context"), ", from, to ", t.indexKeyInterfaceName(), ") error") - t.P() - t.P("doNotImplement()") - t.P("}") - t.P() -} - -// returns the has and get (in that order) function signature for unique indexes. -func (t tableGen) uniqueIndexSig(idxFields string) (string, string, string) { - fieldsSlc := strings.Split(idxFields, ",") - camelFields := fieldsToCamelCase(idxFields) - - hasFuncName := "HasBy" + camelFields - getFuncName := "GetBy" + camelFields - args := t.fieldArgsFromStringSlice(fieldsSlc) - - hasFuncSig := fmt.Sprintf("%s (ctx context.Context, %s) (found bool, err error)", hasFuncName, args) - getFuncSig := fmt.Sprintf("%s (ctx context.Context, %s) (*%s, error)", getFuncName, args, t.msg.GoIdent.GoName) - return hasFuncSig, getFuncSig, getFuncName -} - -func (t tableGen) genUniqueIndexSig(idx *ormv1.SecondaryIndexDescriptor) { - hasSig, getSig, getFuncName := t.uniqueIndexSig(idx.Fields) - t.P(hasSig) - t.P("// ", getFuncName, notFoundDocs) - t.P(getSig) -} - -func (t tableGen) iteratorName() string { - return t.msg.GoIdent.GoName + "Iterator" -} - -func (t tableGen) getSig() string { - res := "Get" + t.msg.GoIdent.GoName + "(" - res += t.fieldsArgs(t.primaryKeyFields.Names()) - res += ") (*" + t.QualifiedGoIdent(t.msg.GoIdent) + ", error)" - return res -} - -func (t tableGen) hasSig() string { - t.P("Has(ctx ", contextPkg.Ident("Context"), ", ", t.fieldsArgs(t.primaryKeyFields.Names()), ") (found bool, err error)") - return "" -} - -func (t tableGen) listSig() string { - res := "List" + t.msg.GoIdent.GoName + "(" - res += t.indexKeyInterfaceName() - res += ") (" - res += t.iteratorName() - res += ", error)" - return res -} - -func (t tableGen) fieldArgsFromStringSlice(names []string) string { - args := make([]string, len(names)) - for i, name := range names { - args[i] = t.fieldArg(protoreflect.Name(name)) - } - return strings.Join(args, ",") -} - -func (t tableGen) fieldsArgs(names []protoreflect.Name) string { - var params []string - for _, name := range names { - params = append(params, t.fieldArg(name)) - } - return strings.Join(params, ",") -} - -func (t tableGen) fieldArg(name protoreflect.Name) string { - typ, pointer := t.GeneratedFile.FieldGoType(t.fields[name]) - if pointer { - typ = "*" + typ - } - return string(name) + " " + typ -} - -func (t tableGen) genStruct() { - t.P("type ", t.messageTableReceiverName(t.msg), " struct {") - if t.table.PrimaryKey.AutoIncrement { - t.P("table ", ormTablePkg.Ident("AutoIncrementTable")) - } else { - t.P("table ", ormTablePkg.Ident("Table")) - } - t.P("}") - t.storeStructName() -} - -func (t tableGen) genTableImpl() { - receiverVar := "this" - receiver := fmt.Sprintf("func (%s %s) ", receiverVar, t.messageTableReceiverName(t.msg)) - varName := t.param(t.msg.GoIdent.GoName) - varTypeName := t.QualifiedGoIdent(t.msg.GoIdent) - - // these methods all have the same impl sans their names. so we can just loop and replace. - methods := []string{"Insert", "Update", "Save", "Delete"} - for _, method := range methods { - t.P(receiver, method, "(ctx ", contextPkg.Ident("Context"), ", ", varName, " *", varTypeName, ") error {") - t.P("return ", receiverVar, ".table.", method, "(ctx, ", varName, ")") - t.P("}") - t.P() - } - - if t.table.PrimaryKey.AutoIncrement { - t.P(receiver, "InsertReturning", fieldsToCamelCase(t.table.PrimaryKey.Fields), "(ctx ", contextPkg.Ident("Context"), ", ", varName, " *", varTypeName, ") (uint64, error) {") - t.P("return ", receiverVar, ".table.InsertReturningPKey(ctx, ", varName, ")") - t.P("}") - t.P() - - t.P(receiver, "LastInsertedSequence(ctx ", contextPkg.Ident("Context"), ") (uint64, error) {") - t.P("return ", receiverVar, ".table.LastInsertedSequence(ctx)") - t.P("}") - t.P() - } - - // Has - t.P(receiver, "Has(ctx ", contextPkg.Ident("Context"), ", ", t.fieldsArgs(t.primaryKeyFields.Names()), ") (found bool, err error) {") - t.P("return ", receiverVar, ".table.PrimaryKey().Has(ctx, ", t.primaryKeyFields.String(), ")") - t.P("}") - t.P() - - // Get - t.P(receiver, "Get(ctx ", contextPkg.Ident("Context"), ", ", t.fieldsArgs(t.primaryKeyFields.Names()), ") (*", varTypeName, ", error) {") - t.P("var ", varName, " ", varTypeName) - t.P("found, err := ", receiverVar, ".table.PrimaryKey().Get(ctx, &", varName, ", ", t.primaryKeyFields.String(), ")") - t.P("if err != nil {") - t.P("return nil, err") - t.P("}") - t.P("if !found {") - t.P("return nil, ", ormErrPkg.Ident("NotFound")) - t.P("}") - t.P("return &", varName, ", nil") - t.P("}") - t.P() - - for _, idx := range t.uniqueIndexes { - fields := strings.Split(idx.Fields, ",") - hasName, getName, _ := t.uniqueIndexSig(idx.Fields) - - // has - t.P("func (", receiverVar, " ", t.messageTableReceiverName(t.msg), ") ", hasName, "{") - t.P("return ", receiverVar, ".table.GetIndexByID(", idx.Id, ").(", - ormTablePkg.Ident("UniqueIndex"), ").Has(ctx,") - for _, field := range fields { - t.P(field, ",") - } - t.P(")") - t.P("}") - t.P() - - // get - varName := t.param(t.msg.GoIdent.GoName) - varTypeName := t.msg.GoIdent.GoName - t.P("func (", receiverVar, " ", t.messageTableReceiverName(t.msg), ") ", getName, "{") - t.P("var ", varName, " ", varTypeName) - t.P("found, err := ", receiverVar, ".table.GetIndexByID(", idx.Id, ").(", - ormTablePkg.Ident("UniqueIndex"), ").Get(ctx, &", varName, ",") - for _, field := range fields { - t.P(field, ",") - } - t.P(")") - t.P("if err != nil {") - t.P("return nil, err") - t.P("}") - t.P("if !found {") - t.P("return nil, ", ormErrPkg.Ident("NotFound")) - t.P("}") - t.P("return &", varName, ", nil") - t.P("}") - t.P() - } - - // List - t.P(receiver, "List(ctx ", contextPkg.Ident("Context"), ", prefixKey ", t.indexKeyInterfaceName(), ", opts ...", ormListPkg.Ident("Option"), ") (", t.iteratorName(), ", error) {") - t.P("it, err := ", receiverVar, ".table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...)") - t.P("return ", t.iteratorName(), "{it}, err") - t.P("}") - t.P() - - // ListRange - t.P(receiver, "ListRange(ctx ", contextPkg.Ident("Context"), ", from, to ", t.indexKeyInterfaceName(), ", opts ...", ormListPkg.Ident("Option"), ") (", t.iteratorName(), ", error) {") - t.P("it, err := ", receiverVar, ".table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...)") - t.P("return ", t.iteratorName(), "{it}, err") - t.P("}") - t.P() - - // DeleteBy - t.P(receiver, "DeleteBy(ctx ", contextPkg.Ident("Context"), ", prefixKey ", t.indexKeyInterfaceName(), ") error {") - t.P("return ", receiverVar, ".table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...)") - t.P("}") - t.P() - t.P() - - // DeleteRange - t.P(receiver, "DeleteRange(ctx ", contextPkg.Ident("Context"), ", from, to ", t.indexKeyInterfaceName(), ") error {") - t.P("return ", receiverVar, ".table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values())") - t.P("}") - t.P() - t.P() - - t.P(receiver, "doNotImplement() {}") - t.P() -} - -func (t tableGen) genTableImplGuard() { - t.P("var _ ", t.messageTableInterfaceName(t.msg), " = ", t.messageTableReceiverName(t.msg), "{}") -} - -func (t tableGen) genConstructor() { - iface := t.messageTableInterfaceName(t.msg) - t.P("func New", iface, "(db ", ormTablePkg.Ident("Schema"), ") (", iface, ", error) {") - t.P("table := db.GetTable(&", t.msg.GoIdent.GoName, "{})") - t.P("if table == nil {") - t.P("return nil,", ormErrPkg.Ident("TableNotFound.Wrap"), "(string((&", t.msg.GoIdent.GoName, "{}).ProtoReflect().Descriptor().FullName()))") - t.P("}") - if t.table.PrimaryKey.AutoIncrement { - t.P( - "return ", t.messageTableReceiverName(t.msg), "{table.(", - ormTablePkg.Ident("AutoIncrementTable"), ")}, nil", - ) - } else { - t.P("return ", t.messageTableReceiverName(t.msg), "{table}, nil") - } - t.P("}") -} diff --git a/orm/internal/fieldnames/fieldnames.go b/orm/internal/fieldnames/fieldnames.go deleted file mode 100644 index e348e3a1971b..000000000000 --- a/orm/internal/fieldnames/fieldnames.go +++ /dev/null @@ -1,55 +0,0 @@ -package fieldnames - -import ( - "strings" - - "google.golang.org/protobuf/reflect/protoreflect" -) - -// FieldNames abstractly represents a list of fields with a comparable type which -// can be used as a map key. It is used primarily to lookup indexes. -type FieldNames struct { - fields string -} - -// CommaSeparatedFieldNames creates a FieldNames instance from a list of comma-separated -// fields. -func CommaSeparatedFieldNames(fields string) FieldNames { - // normalize cases where there are spaces - if strings.IndexByte(fields, ' ') >= 0 { - parts := strings.Split(fields, ",") - for i, part := range parts { - parts[i] = strings.TrimSpace(part) - } - fields = strings.Join(parts, ",") - } - return FieldNames{fields: fields} -} - -// FieldsFromNames creates a FieldNames instance from an array of field -// names. -func FieldsFromNames(fnames []protoreflect.Name) FieldNames { - var names []string - for _, name := range fnames { - names = append(names, string(name)) - } - return FieldNames{fields: strings.Join(names, ",")} -} - -// Names returns the array of names this FieldNames instance represents. -func (f FieldNames) Names() []protoreflect.Name { - if f.fields == "" { - return nil - } - - fields := strings.Split(f.fields, ",") - names := make([]protoreflect.Name, len(fields)) - for i, field := range fields { - names[i] = protoreflect.Name(field) - } - return names -} - -func (f FieldNames) String() string { - return f.fields -} diff --git a/orm/internal/fieldnames/fieldnames_test.go b/orm/internal/fieldnames/fieldnames_test.go deleted file mode 100644 index f341fd7e3fe4..000000000000 --- a/orm/internal/fieldnames/fieldnames_test.go +++ /dev/null @@ -1,43 +0,0 @@ -package fieldnames - -import ( - "testing" - - "google.golang.org/protobuf/reflect/protoreflect" - - "gotest.tools/v3/assert" -) - -func TestFieldNames(t *testing.T) { - names := []protoreflect.Name{"a", "b", "c"} - - abc := "a,b,c" - f := CommaSeparatedFieldNames(abc) - assert.Equal(t, FieldNames{abc}, f) - assert.DeepEqual(t, names, f.Names()) - assert.Equal(t, abc, f.String()) - - f = CommaSeparatedFieldNames("a, b ,c") - assert.Equal(t, FieldNames{abc}, f) - assert.DeepEqual(t, names, f.Names()) - assert.Equal(t, abc, f.String()) - - // empty okay - f = CommaSeparatedFieldNames("") - assert.Equal(t, FieldNames{""}, f) - assert.Equal(t, 0, len(f.Names())) - assert.Equal(t, "", f.String()) - - f = FieldsFromNames(names) - assert.Equal(t, FieldNames{abc}, f) - assert.DeepEqual(t, names, f.Names()) - assert.Equal(t, abc, f.String()) - - // empty okay - f = FieldsFromNames([]protoreflect.Name{}) - assert.Equal(t, FieldNames{""}, f) - f = FieldsFromNames(nil) - assert.Equal(t, FieldNames{""}, f) - assert.Equal(t, 0, len(f.Names())) - assert.Equal(t, "", f.String()) -} diff --git a/orm/internal/listinternal/options.go b/orm/internal/listinternal/options.go deleted file mode 100644 index fb5c254dc88d..000000000000 --- a/orm/internal/listinternal/options.go +++ /dev/null @@ -1,40 +0,0 @@ -package listinternal - -import ( - "fmt" - - "google.golang.org/protobuf/proto" -) - -// Options is the internal list options struct. -type Options struct { - Reverse, CountTotal bool - Offset, Limit, DefaultLimit uint64 - Cursor []byte - Filter func(proto.Message) bool -} - -func (o Options) Validate() error { - if len(o.Cursor) != 0 { - if o.Offset > 0 { - return fmt.Errorf("can only specify one of cursor or offset") - } - } - return nil -} - -type Option interface { - apply(*Options) -} - -type FuncOption func(*Options) - -func (f FuncOption) apply(options *Options) { - f(options) -} - -func ApplyOptions(opts *Options, funcOpts []Option) { - for _, opt := range funcOpts { - opt.apply(opts) - } -} diff --git a/orm/internal/stablejson/encode.go b/orm/internal/stablejson/encode.go deleted file mode 100644 index e9dd143773d0..000000000000 --- a/orm/internal/stablejson/encode.go +++ /dev/null @@ -1,93 +0,0 @@ -package stablejson - -import ( - "bytes" - "fmt" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protopath" - "google.golang.org/protobuf/reflect/protorange" - "google.golang.org/protobuf/reflect/protoreflect" -) - -// Marshal marshals the provided message to JSON with a stable ordering based -// on ascending field numbers. -func Marshal(message proto.Message) ([]byte, error) { - buf := &bytes.Buffer{} - firstStack := []bool{true} - err := protorange.Options{ - Stable: true, - }.Range(message.ProtoReflect(), - func(p protopath.Values) error { - // Starting printing the value. - if !firstStack[len(firstStack)-1] { - _, _ = fmt.Fprintf(buf, ",") - } - firstStack[len(firstStack)-1] = false - - // Print the key. - var fd protoreflect.FieldDescriptor - last := p.Index(-1) - beforeLast := p.Index(-2) - switch last.Step.Kind() { - case protopath.FieldAccessStep: - fd = last.Step.FieldDescriptor() - _, _ = fmt.Fprintf(buf, "%q:", fd.Name()) - case protopath.ListIndexStep: - fd = beforeLast.Step.FieldDescriptor() // lists always appear in the context of a repeated field - case protopath.MapIndexStep: - fd = beforeLast.Step.FieldDescriptor() // maps always appear in the context of a repeated field - _, _ = fmt.Fprintf(buf, "%v:", last.Step.MapIndex().Interface()) - case protopath.AnyExpandStep: - _, _ = fmt.Fprintf(buf, `"@type":%q`, last.Value.Message().Descriptor().FullName()) - return nil - case protopath.UnknownAccessStep: - _, _ = fmt.Fprintf(buf, "?: ") - } - - switch v := last.Value.Interface().(type) { - case protoreflect.Message: - _, _ = fmt.Fprintf(buf, "{") - firstStack = append(firstStack, true) - case protoreflect.List: - _, _ = fmt.Fprintf(buf, "[") - firstStack = append(firstStack, true) - case protoreflect.Map: - _, _ = fmt.Fprintf(buf, "{") - firstStack = append(firstStack, true) - case protoreflect.EnumNumber: - var ev protoreflect.EnumValueDescriptor - if fd != nil { - ev = fd.Enum().Values().ByNumber(v) - } - if ev != nil { - _, _ = fmt.Fprintf(buf, "%v", ev.Name()) - } else { - _, _ = fmt.Fprintf(buf, "%v", v) - } - case string, []byte: - _, _ = fmt.Fprintf(buf, "%q", v) - default: - _, _ = fmt.Fprintf(buf, "%v", v) - } - return nil - }, - func(p protopath.Values) error { - last := p.Index(-1) - switch last.Value.Interface().(type) { - case protoreflect.Message: - if last.Step.Kind() != protopath.AnyExpandStep { - _, _ = fmt.Fprintf(buf, "}") - } - case protoreflect.List: - _, _ = fmt.Fprintf(buf, "]") - firstStack = firstStack[:len(firstStack)-1] - case protoreflect.Map: - _, _ = fmt.Fprintf(buf, "}") - firstStack = firstStack[:len(firstStack)-1] - } - return nil - }, - ) - return buf.Bytes(), err -} diff --git a/orm/internal/stablejson/encode_test.go b/orm/internal/stablejson/encode_test.go deleted file mode 100644 index c75b48f15479..000000000000 --- a/orm/internal/stablejson/encode_test.go +++ /dev/null @@ -1,38 +0,0 @@ -package stablejson_test - -import ( - "testing" - - "github.com/stretchr/testify/require" - "google.golang.org/protobuf/types/known/anypb" - - bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" - basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" - txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" - "github.com/cosmos/cosmos-proto/anyutil" - - "cosmossdk.io/orm/internal/stablejson" -) - -func TestStableJSON(t *testing.T) { - msg, err := anyutil.New(&bankv1beta1.MsgSend{ - FromAddress: "foo213325", - ToAddress: "foo32t5sdfh", - Amount: []*basev1beta1.Coin{ - { - Denom: "bar", - Amount: "1234", - }, - { - Denom: "baz", - Amount: "321", - }, - }, - }) - require.NoError(t, err) - bz, err := stablejson.Marshal(&txv1beta1.TxBody{Messages: []*anypb.Any{msg}}) - require.NoError(t, err) - require.Equal(t, - `{"messages":[{"@type":"cosmos.bank.v1beta1.MsgSend","from_address":"foo213325","to_address":"foo32t5sdfh","amount":[{"denom":"bar","amount":"1234"},{"denom":"baz","amount":"321"}]}]}`, - string(bz)) -} diff --git a/orm/internal/testkv/compare.go b/orm/internal/testkv/compare.go deleted file mode 100644 index 35b50cbe5d16..000000000000 --- a/orm/internal/testkv/compare.go +++ /dev/null @@ -1,38 +0,0 @@ -package testkv - -import ( - "bytes" - - "gotest.tools/v3/assert" - - "cosmossdk.io/orm/model/ormtable" - "cosmossdk.io/orm/types/kv" -) - -func AssertBackendsEqual(t assert.TestingT, b1, b2 ormtable.Backend) { - it1, err := b1.CommitmentStoreReader().Iterator(nil, nil) - assert.NilError(t, err) - - it2, err := b2.CommitmentStoreReader().Iterator(nil, nil) - assert.NilError(t, err) - - AssertIteratorsEqual(t, it1, it2) - - it1, err = b1.IndexStoreReader().Iterator(nil, nil) - assert.NilError(t, err) - - it2, err = b2.IndexStoreReader().Iterator(nil, nil) - assert.NilError(t, err) - - AssertIteratorsEqual(t, it1, it2) -} - -func AssertIteratorsEqual(t assert.TestingT, it1, it2 kv.Iterator) { - for it1.Valid() { - assert.Assert(t, it2.Valid()) - assert.Assert(t, bytes.Equal(it1.Key(), it2.Key())) - assert.Assert(t, bytes.Equal(it1.Value(), it2.Value())) - it1.Next() - it2.Next() - } -} diff --git a/orm/internal/testkv/debug.go b/orm/internal/testkv/debug.go deleted file mode 100644 index 5278409550d7..000000000000 --- a/orm/internal/testkv/debug.go +++ /dev/null @@ -1,329 +0,0 @@ -package testkv - -import ( - "context" - "fmt" - - "google.golang.org/protobuf/proto" - - "cosmossdk.io/orm/encoding/ormkv" - "cosmossdk.io/orm/internal/stablejson" - "cosmossdk.io/orm/model/ormtable" - "cosmossdk.io/orm/types/kv" -) - -// Debugger is an interface that handles debug info from the debug store wrapper. -type Debugger interface { - // Log logs a single log message. - Log(string) - - // Decode decodes a key-value entry into a debug string. - Decode(key, value []byte) string -} - -// NewDebugBackend wraps both stores from a Backend with a debugger. -func NewDebugBackend(backend ormtable.Backend, debugger Debugger) ormtable.Backend { - hooks := debugHooks{ - debugger: debugger, - validateHooks: backend.ValidateHooks(), - writeHooks: backend.WriteHooks(), - } - return ormtable.NewBackend(ormtable.BackendOptions{ - CommitmentStore: NewDebugStore(backend.CommitmentStore(), debugger, "commit"), - IndexStore: NewDebugStore(backend.IndexStore(), debugger, "index"), - ValidateHooks: hooks, - WriteHooks: hooks, - }) -} - -type debugStore struct { - store kv.Store - debugger Debugger - storeName string -} - -// NewDebugStore wraps the store with the debugger instance returning a debug store wrapper. -func NewDebugStore(store kv.Store, debugger Debugger, storeName string) kv.Store { - return &debugStore{store: store, debugger: debugger, storeName: storeName} -} - -func (t debugStore) Get(key []byte) ([]byte, error) { - val, err := t.store.Get(key) - if err != nil { - if t.debugger != nil { - t.debugger.Log(fmt.Sprintf("ERR on GET %s: %v", t.debugger.Decode(key, nil), err)) - } - return nil, err - } - if t.debugger != nil { - t.debugger.Log(fmt.Sprintf("GET %x %x", key, val)) - t.debugger.Log(fmt.Sprintf(" %s", t.debugger.Decode(key, val))) - } - return val, nil -} - -func (t debugStore) Has(key []byte) (bool, error) { - has, err := t.store.Has(key) - if err != nil { - if t.debugger != nil { - t.debugger.Log(fmt.Sprintf("ERR on HAS %s: %v", t.debugger.Decode(key, nil), err)) - } - return has, err - } - if t.debugger != nil { - t.debugger.Log(fmt.Sprintf("HAS %x", key)) - t.debugger.Log(fmt.Sprintf(" %s", t.debugger.Decode(key, nil))) - } - return has, nil -} - -func (t debugStore) Iterator(start, end []byte) (kv.Iterator, error) { - if t.debugger != nil { - t.debugger.Log(fmt.Sprintf("ITERATOR %x -> %x", start, end)) - } - it, err := t.store.Iterator(start, end) - if err != nil { - return nil, err - } - return &debugIterator{ - iterator: it, - storeName: t.storeName, - debugger: t.debugger, - }, nil -} - -func (t debugStore) ReverseIterator(start, end []byte) (kv.Iterator, error) { - if t.debugger != nil { - t.debugger.Log(fmt.Sprintf("ITERATOR %x <- %x", start, end)) - } - it, err := t.store.ReverseIterator(start, end) - if err != nil { - return nil, err - } - return &debugIterator{ - iterator: it, - storeName: t.storeName, - debugger: t.debugger, - }, nil -} - -func (t debugStore) Set(key, value []byte) error { - if t.debugger != nil { - t.debugger.Log(fmt.Sprintf("SET %x %x", key, value)) - t.debugger.Log(fmt.Sprintf(" %s", t.debugger.Decode(key, value))) - } - err := t.store.Set(key, value) - if err != nil { - if t.debugger != nil { - t.debugger.Log(fmt.Sprintf("ERR on SET %s: %v", t.debugger.Decode(key, value), err)) - } - return err - } - return nil -} - -func (t debugStore) Delete(key []byte) error { - if t.debugger != nil { - t.debugger.Log(fmt.Sprintf("DEL %x", key)) - t.debugger.Log(fmt.Sprintf("DEL %s", t.debugger.Decode(key, nil))) - } - err := t.store.Delete(key) - if err != nil { - if t.debugger != nil { - t.debugger.Log(fmt.Sprintf("ERR on SET %s: %v", t.debugger.Decode(key, nil), err)) - } - return err - } - return nil -} - -var _ kv.Store = &debugStore{} - -type debugIterator struct { - iterator kv.Iterator - storeName string - debugger Debugger -} - -func (d debugIterator) Domain() (start, end []byte) { - start, end = d.iterator.Domain() - d.debugger.Log(fmt.Sprintf(" DOMAIN %x -> %x", start, end)) - return start, end -} - -func (d debugIterator) Valid() bool { - valid := d.iterator.Valid() - d.debugger.Log(fmt.Sprintf(" VALID %t", valid)) - return valid -} - -func (d debugIterator) Next() { - d.debugger.Log(" NEXT") - d.iterator.Next() -} - -func (d debugIterator) Key() (key []byte) { - key = d.iterator.Key() - value := d.iterator.Value() - d.debugger.Log(fmt.Sprintf(" KEY %x %x", key, value)) - d.debugger.Log(fmt.Sprintf(" %s", d.debugger.Decode(key, value))) - return key -} - -func (d debugIterator) Value() (value []byte) { - return d.iterator.Value() -} - -func (d debugIterator) Error() error { - err := d.iterator.Error() - d.debugger.Log(fmt.Sprintf(" ERR %+v", err)) - return err -} - -func (d debugIterator) Close() error { - d.debugger.Log(" CLOSE") - return d.iterator.Close() -} - -var _ kv.Iterator = &debugIterator{} - -// EntryCodecDebugger is a Debugger instance that uses an EntryCodec and Print -// function for debugging. -type EntryCodecDebugger struct { - EntryCodec ormkv.EntryCodec - Print func(string) -} - -func (d *EntryCodecDebugger) Log(s string) { - if d.Print != nil { - d.Print(s) - } else { - fmt.Println(s) - } -} - -func (d *EntryCodecDebugger) Decode(key, value []byte) string { - entry, err := d.EntryCodec.DecodeEntry(key, value) - if err != nil { - return fmt.Sprintf("ERR:%v", err) - } - - return entry.String() -} - -type debugHooks struct { - debugger Debugger - validateHooks ormtable.ValidateHooks - writeHooks ormtable.WriteHooks -} - -func (d debugHooks) ValidateInsert(context context.Context, message proto.Message) error { - jsonBz, err := stablejson.Marshal(message) - if err != nil { - return err - } - - d.debugger.Log(fmt.Sprintf( - "ORM BEFORE INSERT %s %s", - message.ProtoReflect().Descriptor().FullName(), - jsonBz, - )) - if d.validateHooks != nil { - return d.validateHooks.ValidateInsert(context, message) - } - return nil -} - -func (d debugHooks) ValidateUpdate(ctx context.Context, existing, new proto.Message) error { - existingJSON, err := stablejson.Marshal(existing) - if err != nil { - return err - } - - newJSON, err := stablejson.Marshal(new) - if err != nil { - return err - } - - d.debugger.Log(fmt.Sprintf( - "ORM BEFORE UPDATE %s %s -> %s", - existing.ProtoReflect().Descriptor().FullName(), - existingJSON, - newJSON, - )) - if d.validateHooks != nil { - return d.validateHooks.ValidateUpdate(ctx, existing, new) - } - return nil -} - -func (d debugHooks) ValidateDelete(ctx context.Context, message proto.Message) error { - jsonBz, err := stablejson.Marshal(message) - if err != nil { - return err - } - - d.debugger.Log(fmt.Sprintf( - "ORM BEFORE DELETE %s %s", - message.ProtoReflect().Descriptor().FullName(), - jsonBz, - )) - if d.validateHooks != nil { - return d.validateHooks.ValidateDelete(ctx, message) - } - return nil -} - -func (d debugHooks) OnInsert(ctx context.Context, message proto.Message) { - jsonBz, err := stablejson.Marshal(message) - if err != nil { - panic(err) - } - - d.debugger.Log(fmt.Sprintf( - "ORM AFTER INSERT %s %s", - message.ProtoReflect().Descriptor().FullName(), - jsonBz, - )) - if d.writeHooks != nil { - d.writeHooks.OnInsert(ctx, message) - } -} - -func (d debugHooks) OnUpdate(ctx context.Context, existing, new proto.Message) { - existingJSON, err := stablejson.Marshal(existing) - if err != nil { - panic(err) - } - - newJSON, err := stablejson.Marshal(new) - if err != nil { - panic(err) - } - - d.debugger.Log(fmt.Sprintf( - "ORM AFTER UPDATE %s %s -> %s", - existing.ProtoReflect().Descriptor().FullName(), - existingJSON, - newJSON, - )) - if d.writeHooks != nil { - d.writeHooks.OnUpdate(ctx, existing, new) - } -} - -func (d debugHooks) OnDelete(ctx context.Context, message proto.Message) { - jsonBz, err := stablejson.Marshal(message) - if err != nil { - panic(err) - } - - d.debugger.Log(fmt.Sprintf( - "ORM AFTER DELETE %s %s", - message.ProtoReflect().Descriptor().FullName(), - jsonBz, - )) - if d.writeHooks != nil { - d.writeHooks.OnDelete(ctx, message) - } -} diff --git a/orm/internal/testkv/leveldb.go b/orm/internal/testkv/leveldb.go deleted file mode 100644 index c75d643bd274..000000000000 --- a/orm/internal/testkv/leveldb.go +++ /dev/null @@ -1,18 +0,0 @@ -package testkv - -import ( - "testing" - - dbm "github.com/cosmos/cosmos-db" - "gotest.tools/v3/assert" - - "cosmossdk.io/orm/model/ormtable" -) - -func NewGoLevelDBBackend(t testing.TB) ormtable.Backend { - db, err := dbm.NewGoLevelDB("test", t.TempDir(), nil) - assert.NilError(t, err) - return ormtable.NewBackend(ormtable.BackendOptions{ - CommitmentStore: db, - }) -} diff --git a/orm/internal/testkv/mem.go b/orm/internal/testkv/mem.go deleted file mode 100644 index e1a10a7664a1..000000000000 --- a/orm/internal/testkv/mem.go +++ /dev/null @@ -1,27 +0,0 @@ -package testkv - -import ( - dbm "github.com/cosmos/cosmos-db" - - "cosmossdk.io/orm/model/ormtable" -) - -// NewSplitMemBackend returns a Backend instance -// which uses two separate memory stores to simulate behavior when there -// are really two separate backing stores. -func NewSplitMemBackend() ormtable.Backend { - return ormtable.NewBackend(ormtable.BackendOptions{ - CommitmentStore: dbm.NewMemDB(), - IndexStore: dbm.NewMemDB(), - }) -} - -// NewSharedMemBackend returns a Backend instance -// which uses a single backing memory store to simulate legacy scenarios -// where only a single KV-store is available to modules. -func NewSharedMemBackend() ormtable.Backend { - return ormtable.NewBackend(ormtable.BackendOptions{ - CommitmentStore: dbm.NewMemDB(), - // commit store is automatically used as the index store - }) -} diff --git a/orm/internal/testpb/bank.cosmos_orm.go b/orm/internal/testpb/bank.cosmos_orm.go deleted file mode 100644 index f7fa09cdc16b..000000000000 --- a/orm/internal/testpb/bank.cosmos_orm.go +++ /dev/null @@ -1,297 +0,0 @@ -// Code generated by protoc-gen-go-cosmos-orm. DO NOT EDIT. - -package testpb - -import ( - context "context" - ormlist "cosmossdk.io/orm/model/ormlist" - ormtable "cosmossdk.io/orm/model/ormtable" - ormerrors "cosmossdk.io/orm/types/ormerrors" -) - -type BalanceTable interface { - Insert(ctx context.Context, balance *Balance) error - Update(ctx context.Context, balance *Balance) error - Save(ctx context.Context, balance *Balance) error - Delete(ctx context.Context, balance *Balance) error - Has(ctx context.Context, address string, denom 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, address string, denom string) (*Balance, error) - List(ctx context.Context, prefixKey BalanceIndexKey, opts ...ormlist.Option) (BalanceIterator, error) - ListRange(ctx context.Context, from, to BalanceIndexKey, opts ...ormlist.Option) (BalanceIterator, error) - DeleteBy(ctx context.Context, prefixKey BalanceIndexKey) error - DeleteRange(ctx context.Context, from, to BalanceIndexKey) error - - doNotImplement() -} - -type BalanceIterator struct { - ormtable.Iterator -} - -func (i BalanceIterator) Value() (*Balance, error) { - var balance Balance - err := i.UnmarshalMessage(&balance) - return &balance, err -} - -type BalanceIndexKey interface { - id() uint32 - values() []interface{} - balanceIndexKey() -} - -// primary key starting index.. -type BalancePrimaryKey = BalanceAddressDenomIndexKey - -type BalanceAddressDenomIndexKey struct { - vs []interface{} -} - -func (x BalanceAddressDenomIndexKey) id() uint32 { return 0 } -func (x BalanceAddressDenomIndexKey) values() []interface{} { return x.vs } -func (x BalanceAddressDenomIndexKey) balanceIndexKey() {} - -func (this BalanceAddressDenomIndexKey) WithAddress(address string) BalanceAddressDenomIndexKey { - this.vs = []interface{}{address} - return this -} - -func (this BalanceAddressDenomIndexKey) WithAddressDenom(address string, denom string) BalanceAddressDenomIndexKey { - this.vs = []interface{}{address, denom} - return this -} - -type BalanceDenomIndexKey struct { - vs []interface{} -} - -func (x BalanceDenomIndexKey) id() uint32 { return 1 } -func (x BalanceDenomIndexKey) values() []interface{} { return x.vs } -func (x BalanceDenomIndexKey) balanceIndexKey() {} - -func (this BalanceDenomIndexKey) WithDenom(denom string) BalanceDenomIndexKey { - this.vs = []interface{}{denom} - return this -} - -type balanceTable struct { - table ormtable.Table -} - -func (this balanceTable) Insert(ctx context.Context, balance *Balance) error { - return this.table.Insert(ctx, balance) -} - -func (this balanceTable) Update(ctx context.Context, balance *Balance) error { - return this.table.Update(ctx, balance) -} - -func (this balanceTable) Save(ctx context.Context, balance *Balance) error { - return this.table.Save(ctx, balance) -} - -func (this balanceTable) Delete(ctx context.Context, balance *Balance) error { - return this.table.Delete(ctx, balance) -} - -func (this balanceTable) Has(ctx context.Context, address string, denom string) (found bool, err error) { - return this.table.PrimaryKey().Has(ctx, address, denom) -} - -func (this balanceTable) Get(ctx context.Context, address string, denom string) (*Balance, error) { - var balance Balance - found, err := this.table.PrimaryKey().Get(ctx, &balance, address, denom) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &balance, nil -} - -func (this balanceTable) List(ctx context.Context, prefixKey BalanceIndexKey, opts ...ormlist.Option) (BalanceIterator, error) { - it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) - return BalanceIterator{it}, err -} - -func (this balanceTable) ListRange(ctx context.Context, from, to BalanceIndexKey, opts ...ormlist.Option) (BalanceIterator, error) { - it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) - return BalanceIterator{it}, err -} - -func (this balanceTable) DeleteBy(ctx context.Context, prefixKey BalanceIndexKey) error { - return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) -} - -func (this balanceTable) DeleteRange(ctx context.Context, from, to BalanceIndexKey) error { - return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) -} - -func (this balanceTable) doNotImplement() {} - -var _ BalanceTable = balanceTable{} - -func NewBalanceTable(db ormtable.Schema) (BalanceTable, error) { - table := db.GetTable(&Balance{}) - if table == nil { - return nil, ormerrors.TableNotFound.Wrap(string((&Balance{}).ProtoReflect().Descriptor().FullName())) - } - return balanceTable{table}, nil -} - -type SupplyTable interface { - Insert(ctx context.Context, supply *Supply) error - Update(ctx context.Context, supply *Supply) error - Save(ctx context.Context, supply *Supply) error - Delete(ctx context.Context, supply *Supply) error - Has(ctx context.Context, denom 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, denom string) (*Supply, error) - List(ctx context.Context, prefixKey SupplyIndexKey, opts ...ormlist.Option) (SupplyIterator, error) - ListRange(ctx context.Context, from, to SupplyIndexKey, opts ...ormlist.Option) (SupplyIterator, error) - DeleteBy(ctx context.Context, prefixKey SupplyIndexKey) error - DeleteRange(ctx context.Context, from, to SupplyIndexKey) error - - doNotImplement() -} - -type SupplyIterator struct { - ormtable.Iterator -} - -func (i SupplyIterator) Value() (*Supply, error) { - var supply Supply - err := i.UnmarshalMessage(&supply) - return &supply, err -} - -type SupplyIndexKey interface { - id() uint32 - values() []interface{} - supplyIndexKey() -} - -// primary key starting index.. -type SupplyPrimaryKey = SupplyDenomIndexKey - -type SupplyDenomIndexKey struct { - vs []interface{} -} - -func (x SupplyDenomIndexKey) id() uint32 { return 0 } -func (x SupplyDenomIndexKey) values() []interface{} { return x.vs } -func (x SupplyDenomIndexKey) supplyIndexKey() {} - -func (this SupplyDenomIndexKey) WithDenom(denom string) SupplyDenomIndexKey { - this.vs = []interface{}{denom} - return this -} - -type supplyTable struct { - table ormtable.Table -} - -func (this supplyTable) Insert(ctx context.Context, supply *Supply) error { - return this.table.Insert(ctx, supply) -} - -func (this supplyTable) Update(ctx context.Context, supply *Supply) error { - return this.table.Update(ctx, supply) -} - -func (this supplyTable) Save(ctx context.Context, supply *Supply) error { - return this.table.Save(ctx, supply) -} - -func (this supplyTable) Delete(ctx context.Context, supply *Supply) error { - return this.table.Delete(ctx, supply) -} - -func (this supplyTable) Has(ctx context.Context, denom string) (found bool, err error) { - return this.table.PrimaryKey().Has(ctx, denom) -} - -func (this supplyTable) Get(ctx context.Context, denom string) (*Supply, error) { - var supply Supply - found, err := this.table.PrimaryKey().Get(ctx, &supply, denom) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &supply, nil -} - -func (this supplyTable) List(ctx context.Context, prefixKey SupplyIndexKey, opts ...ormlist.Option) (SupplyIterator, error) { - it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) - return SupplyIterator{it}, err -} - -func (this supplyTable) ListRange(ctx context.Context, from, to SupplyIndexKey, opts ...ormlist.Option) (SupplyIterator, error) { - it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) - return SupplyIterator{it}, err -} - -func (this supplyTable) DeleteBy(ctx context.Context, prefixKey SupplyIndexKey) error { - return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) -} - -func (this supplyTable) DeleteRange(ctx context.Context, from, to SupplyIndexKey) error { - return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) -} - -func (this supplyTable) doNotImplement() {} - -var _ SupplyTable = supplyTable{} - -func NewSupplyTable(db ormtable.Schema) (SupplyTable, error) { - table := db.GetTable(&Supply{}) - if table == nil { - return nil, ormerrors.TableNotFound.Wrap(string((&Supply{}).ProtoReflect().Descriptor().FullName())) - } - return supplyTable{table}, nil -} - -type BankStore interface { - BalanceTable() BalanceTable - SupplyTable() SupplyTable - - doNotImplement() -} - -type bankStore struct { - balance BalanceTable - supply SupplyTable -} - -func (x bankStore) BalanceTable() BalanceTable { - return x.balance -} - -func (x bankStore) SupplyTable() SupplyTable { - return x.supply -} - -func (bankStore) doNotImplement() {} - -var _ BankStore = bankStore{} - -func NewBankStore(db ormtable.Schema) (BankStore, error) { - balanceTable, err := NewBalanceTable(db) - if err != nil { - return nil, err - } - - supplyTable, err := NewSupplyTable(db) - if err != nil { - return nil, err - } - - return bankStore{ - balanceTable, - supplyTable, - }, nil -} diff --git a/orm/internal/testpb/bank.pb.go b/orm/internal/testpb/bank.pb.go deleted file mode 100644 index e3320c6e8a80..000000000000 --- a/orm/internal/testpb/bank.pb.go +++ /dev/null @@ -1,308 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc (unknown) -// source: testpb/bank.proto - -package testpb - -import ( - _ "cosmossdk.io/api/cosmos/app/v1alpha1" - _ "cosmossdk.io/api/cosmos/orm/v1" - _ "cosmossdk.io/api/cosmos/orm/v1alpha1" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Module is a test module for demonstrating how to use the ORM with appconfig. -type Module struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *Module) Reset() { - *x = Module{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_bank_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() {} - -func (x *Module) ProtoReflect() protoreflect.Message { - mi := &file_testpb_bank_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Module.ProtoReflect.Descriptor instead. -func (*Module) Descriptor() ([]byte, []int) { - return file_testpb_bank_proto_rawDescGZIP(), []int{0} -} - -type Balance struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` - Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` -} - -func (x *Balance) Reset() { - *x = Balance{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_bank_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Balance) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Balance) ProtoMessage() {} - -func (x *Balance) ProtoReflect() protoreflect.Message { - mi := &file_testpb_bank_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Balance.ProtoReflect.Descriptor instead. -func (*Balance) Descriptor() ([]byte, []int) { - return file_testpb_bank_proto_rawDescGZIP(), []int{1} -} - -func (x *Balance) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *Balance) GetDenom() string { - if x != nil { - return x.Denom - } - return "" -} - -func (x *Balance) GetAmount() uint64 { - if x != nil { - return x.Amount - } - return 0 -} - -type Supply struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` - Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` -} - -func (x *Supply) Reset() { - *x = Supply{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_bank_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Supply) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Supply) ProtoMessage() {} - -func (x *Supply) ProtoReflect() protoreflect.Message { - mi := &file_testpb_bank_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Supply.ProtoReflect.Descriptor instead. -func (*Supply) Descriptor() ([]byte, []int) { - return file_testpb_bank_proto_rawDescGZIP(), []int{2} -} - -func (x *Supply) GetDenom() string { - if x != nil { - return x.Denom - } - return "" -} - -func (x *Supply) GetAmount() uint64 { - if x != nil { - return x.Amount - } - return 0 -} - -var File_testpb_bank_proto protoreflect.FileDescriptor - -var file_testpb_bank_proto_rawDesc = []byte{ - 0x0a, 0x11, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 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, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6f, 0x72, 0x6d, - 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 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, 0x50, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0x3a, 0x46, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x23, 0x0a, 0x21, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6f, 0x72, - 0x6d, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x6f, 0x72, 0x6d, 0x64, 0x62, 0x82, 0x9f, 0xd3, - 0x8e, 0x03, 0x17, 0x0a, 0x15, 0x08, 0x01, 0x12, 0x11, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2f, - 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x77, 0x0a, 0x07, 0x42, 0x61, - 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, - 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x24, 0xf2, - 0x9e, 0xd3, 0x8e, 0x03, 0x1e, 0x0a, 0x0f, 0x0a, 0x0d, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x2c, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x09, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x10, - 0x01, 0x18, 0x01, 0x22, 0x49, 0x0a, 0x06, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x14, 0x0a, - 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, - 0x6e, 0x6f, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x11, 0xf2, 0x9e, 0xd3, - 0x8e, 0x03, 0x0b, 0x0a, 0x07, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x02, 0x42, 0x71, - 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x42, 0x09, 0x42, 0x61, - 0x6e, 0x6b, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6f, 0x72, 0x6d, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x54, 0x58, - 0x58, 0xaa, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xca, 0x02, 0x06, 0x54, 0x65, 0x73, - 0x74, 0x70, 0x62, 0xe2, 0x02, 0x12, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x5c, 0x47, 0x50, 0x42, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, - 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_testpb_bank_proto_rawDescOnce sync.Once - file_testpb_bank_proto_rawDescData = file_testpb_bank_proto_rawDesc -) - -func file_testpb_bank_proto_rawDescGZIP() []byte { - file_testpb_bank_proto_rawDescOnce.Do(func() { - file_testpb_bank_proto_rawDescData = protoimpl.X.CompressGZIP(file_testpb_bank_proto_rawDescData) - }) - return file_testpb_bank_proto_rawDescData -} - -var file_testpb_bank_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_testpb_bank_proto_goTypes = []interface{}{ - (*Module)(nil), // 0: testpb.Module - (*Balance)(nil), // 1: testpb.Balance - (*Supply)(nil), // 2: testpb.Supply -} -var file_testpb_bank_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_testpb_bank_proto_init() } -func file_testpb_bank_proto_init() { - if File_testpb_bank_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_testpb_bank_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 - } - } - file_testpb_bank_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Balance); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_bank_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Supply); 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_testpb_bank_proto_rawDesc, - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_testpb_bank_proto_goTypes, - DependencyIndexes: file_testpb_bank_proto_depIdxs, - MessageInfos: file_testpb_bank_proto_msgTypes, - }.Build() - File_testpb_bank_proto = out.File - file_testpb_bank_proto_rawDesc = nil - file_testpb_bank_proto_goTypes = nil - file_testpb_bank_proto_depIdxs = nil -} diff --git a/orm/internal/testpb/bank.proto b/orm/internal/testpb/bank.proto deleted file mode 100644 index 1778aacd4b35..000000000000 --- a/orm/internal/testpb/bank.proto +++ /dev/null @@ -1,50 +0,0 @@ -syntax = "proto3"; - -package testpb; - -import "cosmos/orm/v1/orm.proto"; -import "cosmos/orm/v1alpha1/schema.proto"; -import "cosmos/app/v1alpha1/module.proto"; - -// This is a simulated bank schema used for testing. - -// Module is a test module for demonstrating how to use the ORM with appconfig. -message Module { - option (cosmos.app.v1alpha1.module) = { - go_import: "github.com/cosmos/orm/model/ormdb" - }; - option (cosmos.orm.v1alpha1.module_schema) = { - schema_file: {id: 1 proto_file_name: "testpb/bank.proto"} - }; -} - -message Balance { - option (cosmos.orm.v1.table) = { - id: 1; -primary_key: { -fields: - "address,denom" -} -index: { -id: - 1 fields: "denom" -} -}; - -string address = 1; -string denom = 2; -uint64 amount = 3; -} - -message Supply { - option (cosmos.orm.v1.table) = { - id: 2; -primary_key: { -fields: - "denom" -} -}; - -string denom = 1; -uint64 amount = 2; -} diff --git a/orm/internal/testpb/bank_query.pb.go b/orm/internal/testpb/bank_query.pb.go deleted file mode 100644 index fc75fcfff5e8..000000000000 --- a/orm/internal/testpb/bank_query.pb.go +++ /dev/null @@ -1,1411 +0,0 @@ -// Code generated by protoc-gen-go-cosmos-orm-proto. DO NOT EDIT. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc (unknown) -// source: testpb/bank_query.proto - -package testpb - -import ( - v1beta1 "cosmossdk.io/api/cosmos/base/query/v1beta1" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// GetBalanceRequest is the BankQuery/GetBalanceRequest request type. -type GetBalanceRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // address specifies the value of the address field in the primary key. - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - // denom specifies the value of the denom field in the primary key. - Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` -} - -func (x *GetBalanceRequest) Reset() { - *x = GetBalanceRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_bank_query_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetBalanceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetBalanceRequest) ProtoMessage() {} - -func (x *GetBalanceRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_bank_query_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetBalanceRequest.ProtoReflect.Descriptor instead. -func (*GetBalanceRequest) Descriptor() ([]byte, []int) { - return file_testpb_bank_query_proto_rawDescGZIP(), []int{0} -} - -func (x *GetBalanceRequest) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *GetBalanceRequest) GetDenom() string { - if x != nil { - return x.Denom - } - return "" -} - -// GetBalanceResponse is the BankQuery/GetBalanceResponse response type. -type GetBalanceResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // value is the response value. - Value *Balance `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *GetBalanceResponse) Reset() { - *x = GetBalanceResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_bank_query_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetBalanceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetBalanceResponse) ProtoMessage() {} - -func (x *GetBalanceResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_bank_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) -} - -// Deprecated: Use GetBalanceResponse.ProtoReflect.Descriptor instead. -func (*GetBalanceResponse) Descriptor() ([]byte, []int) { - return file_testpb_bank_query_proto_rawDescGZIP(), []int{1} -} - -func (x *GetBalanceResponse) GetValue() *Balance { - if x != nil { - return x.Value - } - return nil -} - -// ListBalanceRequest is the BankQuery/ListBalanceRequest request type. -type ListBalanceRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // query specifies the type of query - either a prefix or range query. - // - // Types that are assignable to Query: - // - // *ListBalanceRequest_PrefixQuery - // *ListBalanceRequest_RangeQuery_ - Query isListBalanceRequest_Query `protobuf_oneof:"query"` - // pagination specifies optional pagination parameters. - Pagination *v1beta1.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *ListBalanceRequest) Reset() { - *x = ListBalanceRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_bank_query_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListBalanceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListBalanceRequest) ProtoMessage() {} - -func (x *ListBalanceRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_bank_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) -} - -// Deprecated: Use ListBalanceRequest.ProtoReflect.Descriptor instead. -func (*ListBalanceRequest) Descriptor() ([]byte, []int) { - return file_testpb_bank_query_proto_rawDescGZIP(), []int{2} -} - -func (m *ListBalanceRequest) GetQuery() isListBalanceRequest_Query { - if m != nil { - return m.Query - } - return nil -} - -func (x *ListBalanceRequest) GetPrefixQuery() *ListBalanceRequest_IndexKey { - if x, ok := x.GetQuery().(*ListBalanceRequest_PrefixQuery); ok { - return x.PrefixQuery - } - return nil -} - -func (x *ListBalanceRequest) GetRangeQuery() *ListBalanceRequest_RangeQuery { - if x, ok := x.GetQuery().(*ListBalanceRequest_RangeQuery_); ok { - return x.RangeQuery - } - return nil -} - -func (x *ListBalanceRequest) GetPagination() *v1beta1.PageRequest { - if x != nil { - return x.Pagination - } - return nil -} - -type isListBalanceRequest_Query interface { - isListBalanceRequest_Query() -} - -type ListBalanceRequest_PrefixQuery struct { - // prefix_query specifies the index key value to use for the prefix query. - PrefixQuery *ListBalanceRequest_IndexKey `protobuf:"bytes,1,opt,name=prefix_query,json=prefixQuery,proto3,oneof"` -} - -type ListBalanceRequest_RangeQuery_ struct { - // range_query specifies the index key from/to values to use for the range query. - RangeQuery *ListBalanceRequest_RangeQuery `protobuf:"bytes,2,opt,name=range_query,json=rangeQuery,proto3,oneof"` -} - -func (*ListBalanceRequest_PrefixQuery) isListBalanceRequest_Query() {} - -func (*ListBalanceRequest_RangeQuery_) isListBalanceRequest_Query() {} - -// ListBalanceResponse is the BankQuery/ListBalanceResponse response type. -type ListBalanceResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // values are the results of the query. - Values []*Balance `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` - // pagination is the pagination response. - Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *ListBalanceResponse) Reset() { - *x = ListBalanceResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_bank_query_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListBalanceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListBalanceResponse) ProtoMessage() {} - -func (x *ListBalanceResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_bank_query_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListBalanceResponse.ProtoReflect.Descriptor instead. -func (*ListBalanceResponse) Descriptor() ([]byte, []int) { - return file_testpb_bank_query_proto_rawDescGZIP(), []int{3} -} - -func (x *ListBalanceResponse) GetValues() []*Balance { - if x != nil { - return x.Values - } - return nil -} - -func (x *ListBalanceResponse) GetPagination() *v1beta1.PageResponse { - if x != nil { - return x.Pagination - } - return nil -} - -// GetSupplyRequest is the BankQuery/GetSupplyRequest request type. -type GetSupplyRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // denom specifies the value of the denom field in the primary key. - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` -} - -func (x *GetSupplyRequest) Reset() { - *x = GetSupplyRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_bank_query_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetSupplyRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSupplyRequest) ProtoMessage() {} - -func (x *GetSupplyRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_bank_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) -} - -// Deprecated: Use GetSupplyRequest.ProtoReflect.Descriptor instead. -func (*GetSupplyRequest) Descriptor() ([]byte, []int) { - return file_testpb_bank_query_proto_rawDescGZIP(), []int{4} -} - -func (x *GetSupplyRequest) GetDenom() string { - if x != nil { - return x.Denom - } - return "" -} - -// GetSupplyResponse is the BankQuery/GetSupplyResponse response type. -type GetSupplyResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // value is the response value. - Value *Supply `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *GetSupplyResponse) Reset() { - *x = GetSupplyResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_bank_query_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetSupplyResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSupplyResponse) ProtoMessage() {} - -func (x *GetSupplyResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_bank_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) -} - -// Deprecated: Use GetSupplyResponse.ProtoReflect.Descriptor instead. -func (*GetSupplyResponse) Descriptor() ([]byte, []int) { - return file_testpb_bank_query_proto_rawDescGZIP(), []int{5} -} - -func (x *GetSupplyResponse) GetValue() *Supply { - if x != nil { - return x.Value - } - return nil -} - -// ListSupplyRequest is the BankQuery/ListSupplyRequest request type. -type ListSupplyRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // query specifies the type of query - either a prefix or range query. - // - // Types that are assignable to Query: - // - // *ListSupplyRequest_PrefixQuery - // *ListSupplyRequest_RangeQuery_ - Query isListSupplyRequest_Query `protobuf_oneof:"query"` - // pagination specifies optional pagination parameters. - Pagination *v1beta1.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *ListSupplyRequest) Reset() { - *x = ListSupplyRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_bank_query_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListSupplyRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListSupplyRequest) ProtoMessage() {} - -func (x *ListSupplyRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_bank_query_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListSupplyRequest.ProtoReflect.Descriptor instead. -func (*ListSupplyRequest) Descriptor() ([]byte, []int) { - return file_testpb_bank_query_proto_rawDescGZIP(), []int{6} -} - -func (m *ListSupplyRequest) GetQuery() isListSupplyRequest_Query { - if m != nil { - return m.Query - } - return nil -} - -func (x *ListSupplyRequest) GetPrefixQuery() *ListSupplyRequest_IndexKey { - if x, ok := x.GetQuery().(*ListSupplyRequest_PrefixQuery); ok { - return x.PrefixQuery - } - return nil -} - -func (x *ListSupplyRequest) GetRangeQuery() *ListSupplyRequest_RangeQuery { - if x, ok := x.GetQuery().(*ListSupplyRequest_RangeQuery_); ok { - return x.RangeQuery - } - return nil -} - -func (x *ListSupplyRequest) GetPagination() *v1beta1.PageRequest { - if x != nil { - return x.Pagination - } - return nil -} - -type isListSupplyRequest_Query interface { - isListSupplyRequest_Query() -} - -type ListSupplyRequest_PrefixQuery struct { - // prefix_query specifies the index key value to use for the prefix query. - PrefixQuery *ListSupplyRequest_IndexKey `protobuf:"bytes,1,opt,name=prefix_query,json=prefixQuery,proto3,oneof"` -} - -type ListSupplyRequest_RangeQuery_ struct { - // range_query specifies the index key from/to values to use for the range query. - RangeQuery *ListSupplyRequest_RangeQuery `protobuf:"bytes,2,opt,name=range_query,json=rangeQuery,proto3,oneof"` -} - -func (*ListSupplyRequest_PrefixQuery) isListSupplyRequest_Query() {} - -func (*ListSupplyRequest_RangeQuery_) isListSupplyRequest_Query() {} - -// ListSupplyResponse is the BankQuery/ListSupplyResponse response type. -type ListSupplyResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // values are the results of the query. - Values []*Supply `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` - // pagination is the pagination response. - Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *ListSupplyResponse) Reset() { - *x = ListSupplyResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_bank_query_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListSupplyResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListSupplyResponse) ProtoMessage() {} - -func (x *ListSupplyResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_bank_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) -} - -// Deprecated: Use ListSupplyResponse.ProtoReflect.Descriptor instead. -func (*ListSupplyResponse) Descriptor() ([]byte, []int) { - return file_testpb_bank_query_proto_rawDescGZIP(), []int{7} -} - -func (x *ListSupplyResponse) GetValues() []*Supply { - if x != nil { - return x.Values - } - return nil -} - -func (x *ListSupplyResponse) GetPagination() *v1beta1.PageResponse { - if x != nil { - return x.Pagination - } - return nil -} - -// IndexKey specifies the value of an index key to use in prefix and range queries. -type ListBalanceRequest_IndexKey struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // key specifies the index key value. - // - // Types that are assignable to Key: - // - // *ListBalanceRequest_IndexKey_AddressDenom_ - // *ListBalanceRequest_IndexKey_Denom_ - Key isListBalanceRequest_IndexKey_Key `protobuf_oneof:"key"` -} - -func (x *ListBalanceRequest_IndexKey) Reset() { - *x = ListBalanceRequest_IndexKey{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_bank_query_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListBalanceRequest_IndexKey) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListBalanceRequest_IndexKey) ProtoMessage() {} - -func (x *ListBalanceRequest_IndexKey) ProtoReflect() protoreflect.Message { - mi := &file_testpb_bank_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) -} - -// Deprecated: Use ListBalanceRequest_IndexKey.ProtoReflect.Descriptor instead. -func (*ListBalanceRequest_IndexKey) Descriptor() ([]byte, []int) { - return file_testpb_bank_query_proto_rawDescGZIP(), []int{2, 0} -} - -func (m *ListBalanceRequest_IndexKey) GetKey() isListBalanceRequest_IndexKey_Key { - if m != nil { - return m.Key - } - return nil -} - -func (x *ListBalanceRequest_IndexKey) GetAddressDenom() *ListBalanceRequest_IndexKey_AddressDenom { - if x, ok := x.GetKey().(*ListBalanceRequest_IndexKey_AddressDenom_); ok { - return x.AddressDenom - } - return nil -} - -func (x *ListBalanceRequest_IndexKey) GetDenom() *ListBalanceRequest_IndexKey_Denom { - if x, ok := x.GetKey().(*ListBalanceRequest_IndexKey_Denom_); ok { - return x.Denom - } - return nil -} - -type isListBalanceRequest_IndexKey_Key interface { - isListBalanceRequest_IndexKey_Key() -} - -type ListBalanceRequest_IndexKey_AddressDenom_ struct { - // address_denom specifies the value of the AddressDenom index key to use in the query. - AddressDenom *ListBalanceRequest_IndexKey_AddressDenom `protobuf:"bytes,1,opt,name=address_denom,json=addressDenom,proto3,oneof"` -} - -type ListBalanceRequest_IndexKey_Denom_ struct { - // denom specifies the value of the Denom index key to use in the query. - Denom *ListBalanceRequest_IndexKey_Denom `protobuf:"bytes,2,opt,name=denom,proto3,oneof"` -} - -func (*ListBalanceRequest_IndexKey_AddressDenom_) isListBalanceRequest_IndexKey_Key() {} - -func (*ListBalanceRequest_IndexKey_Denom_) isListBalanceRequest_IndexKey_Key() {} - -// RangeQuery specifies the from/to index keys for a range query. -type ListBalanceRequest_RangeQuery struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // from is the index key to use for the start of the range query. - // To query from the start of an index, specify an index key for that index with empty values. - From *ListBalanceRequest_IndexKey `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` - // to is the index key to use for the end of the range query. - // The index key type MUST be the same as the index key type used for from. - // To query from to the end of an index it can be omitted. - To *ListBalanceRequest_IndexKey `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` -} - -func (x *ListBalanceRequest_RangeQuery) Reset() { - *x = ListBalanceRequest_RangeQuery{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_bank_query_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListBalanceRequest_RangeQuery) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListBalanceRequest_RangeQuery) ProtoMessage() {} - -func (x *ListBalanceRequest_RangeQuery) ProtoReflect() protoreflect.Message { - mi := &file_testpb_bank_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) -} - -// Deprecated: Use ListBalanceRequest_RangeQuery.ProtoReflect.Descriptor instead. -func (*ListBalanceRequest_RangeQuery) Descriptor() ([]byte, []int) { - return file_testpb_bank_query_proto_rawDescGZIP(), []int{2, 1} -} - -func (x *ListBalanceRequest_RangeQuery) GetFrom() *ListBalanceRequest_IndexKey { - if x != nil { - return x.From - } - return nil -} - -func (x *ListBalanceRequest_RangeQuery) GetTo() *ListBalanceRequest_IndexKey { - if x != nil { - return x.To - } - return nil -} - -type ListBalanceRequest_IndexKey_AddressDenom struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // address is the value of the address field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - Address *string `protobuf:"bytes,1,opt,name=address,proto3,oneof" json:"address,omitempty"` - // denom is the value of the denom field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - Denom *string `protobuf:"bytes,2,opt,name=denom,proto3,oneof" json:"denom,omitempty"` -} - -func (x *ListBalanceRequest_IndexKey_AddressDenom) Reset() { - *x = ListBalanceRequest_IndexKey_AddressDenom{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_bank_query_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListBalanceRequest_IndexKey_AddressDenom) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListBalanceRequest_IndexKey_AddressDenom) ProtoMessage() {} - -func (x *ListBalanceRequest_IndexKey_AddressDenom) ProtoReflect() protoreflect.Message { - mi := &file_testpb_bank_query_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) -} - -// Deprecated: Use ListBalanceRequest_IndexKey_AddressDenom.ProtoReflect.Descriptor instead. -func (*ListBalanceRequest_IndexKey_AddressDenom) Descriptor() ([]byte, []int) { - return file_testpb_bank_query_proto_rawDescGZIP(), []int{2, 0, 0} -} - -func (x *ListBalanceRequest_IndexKey_AddressDenom) GetAddress() string { - if x != nil && x.Address != nil { - return *x.Address - } - return "" -} - -func (x *ListBalanceRequest_IndexKey_AddressDenom) GetDenom() string { - if x != nil && x.Denom != nil { - return *x.Denom - } - return "" -} - -type ListBalanceRequest_IndexKey_Denom struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // denom is the value of the denom field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - Denom *string `protobuf:"bytes,1,opt,name=denom,proto3,oneof" json:"denom,omitempty"` -} - -func (x *ListBalanceRequest_IndexKey_Denom) Reset() { - *x = ListBalanceRequest_IndexKey_Denom{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_bank_query_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListBalanceRequest_IndexKey_Denom) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListBalanceRequest_IndexKey_Denom) ProtoMessage() {} - -func (x *ListBalanceRequest_IndexKey_Denom) ProtoReflect() protoreflect.Message { - mi := &file_testpb_bank_query_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) -} - -// Deprecated: Use ListBalanceRequest_IndexKey_Denom.ProtoReflect.Descriptor instead. -func (*ListBalanceRequest_IndexKey_Denom) Descriptor() ([]byte, []int) { - return file_testpb_bank_query_proto_rawDescGZIP(), []int{2, 0, 1} -} - -func (x *ListBalanceRequest_IndexKey_Denom) GetDenom() string { - if x != nil && x.Denom != nil { - return *x.Denom - } - return "" -} - -// IndexKey specifies the value of an index key to use in prefix and range queries. -type ListSupplyRequest_IndexKey struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // key specifies the index key value. - // - // Types that are assignable to Key: - // - // *ListSupplyRequest_IndexKey_Denom_ - Key isListSupplyRequest_IndexKey_Key `protobuf_oneof:"key"` -} - -func (x *ListSupplyRequest_IndexKey) Reset() { - *x = ListSupplyRequest_IndexKey{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_bank_query_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListSupplyRequest_IndexKey) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListSupplyRequest_IndexKey) ProtoMessage() {} - -func (x *ListSupplyRequest_IndexKey) ProtoReflect() protoreflect.Message { - mi := &file_testpb_bank_query_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) -} - -// Deprecated: Use ListSupplyRequest_IndexKey.ProtoReflect.Descriptor instead. -func (*ListSupplyRequest_IndexKey) Descriptor() ([]byte, []int) { - return file_testpb_bank_query_proto_rawDescGZIP(), []int{6, 0} -} - -func (m *ListSupplyRequest_IndexKey) GetKey() isListSupplyRequest_IndexKey_Key { - if m != nil { - return m.Key - } - return nil -} - -func (x *ListSupplyRequest_IndexKey) GetDenom() *ListSupplyRequest_IndexKey_Denom { - if x, ok := x.GetKey().(*ListSupplyRequest_IndexKey_Denom_); ok { - return x.Denom - } - return nil -} - -type isListSupplyRequest_IndexKey_Key interface { - isListSupplyRequest_IndexKey_Key() -} - -type ListSupplyRequest_IndexKey_Denom_ struct { - // denom specifies the value of the Denom index key to use in the query. - Denom *ListSupplyRequest_IndexKey_Denom `protobuf:"bytes,1,opt,name=denom,proto3,oneof"` -} - -func (*ListSupplyRequest_IndexKey_Denom_) isListSupplyRequest_IndexKey_Key() {} - -// RangeQuery specifies the from/to index keys for a range query. -type ListSupplyRequest_RangeQuery struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // from is the index key to use for the start of the range query. - // To query from the start of an index, specify an index key for that index with empty values. - From *ListSupplyRequest_IndexKey `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` - // to is the index key to use for the end of the range query. - // The index key type MUST be the same as the index key type used for from. - // To query from to the end of an index it can be omitted. - To *ListSupplyRequest_IndexKey `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` -} - -func (x *ListSupplyRequest_RangeQuery) Reset() { - *x = ListSupplyRequest_RangeQuery{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_bank_query_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListSupplyRequest_RangeQuery) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListSupplyRequest_RangeQuery) ProtoMessage() {} - -func (x *ListSupplyRequest_RangeQuery) ProtoReflect() protoreflect.Message { - mi := &file_testpb_bank_query_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) -} - -// Deprecated: Use ListSupplyRequest_RangeQuery.ProtoReflect.Descriptor instead. -func (*ListSupplyRequest_RangeQuery) Descriptor() ([]byte, []int) { - return file_testpb_bank_query_proto_rawDescGZIP(), []int{6, 1} -} - -func (x *ListSupplyRequest_RangeQuery) GetFrom() *ListSupplyRequest_IndexKey { - if x != nil { - return x.From - } - return nil -} - -func (x *ListSupplyRequest_RangeQuery) GetTo() *ListSupplyRequest_IndexKey { - if x != nil { - return x.To - } - return nil -} - -type ListSupplyRequest_IndexKey_Denom struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // denom is the value of the denom field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - Denom *string `protobuf:"bytes,1,opt,name=denom,proto3,oneof" json:"denom,omitempty"` -} - -func (x *ListSupplyRequest_IndexKey_Denom) Reset() { - *x = ListSupplyRequest_IndexKey_Denom{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_bank_query_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListSupplyRequest_IndexKey_Denom) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListSupplyRequest_IndexKey_Denom) ProtoMessage() {} - -func (x *ListSupplyRequest_IndexKey_Denom) ProtoReflect() protoreflect.Message { - mi := &file_testpb_bank_query_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListSupplyRequest_IndexKey_Denom.ProtoReflect.Descriptor instead. -func (*ListSupplyRequest_IndexKey_Denom) Descriptor() ([]byte, []int) { - return file_testpb_bank_query_proto_rawDescGZIP(), []int{6, 0, 0} -} - -func (x *ListSupplyRequest_IndexKey_Denom) GetDenom() string { - if x != nil && x.Denom != nil { - return *x.Denom - } - return "" -} - -var File_testpb_bank_query_proto protoreflect.FileDescriptor - -var file_testpb_bank_query_proto_rawDesc = []byte{ - 0x0a, 0x17, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x5f, 0x71, 0x75, - 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x74, 0x65, 0x73, 0x74, 0x70, - 0x62, 0x1a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x67, - 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x74, - 0x65, 0x73, 0x74, 0x70, 0x62, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0x43, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, - 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x22, 0x3b, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x42, 0x61, 0x6c, 0x61, - 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x74, 0x65, 0x73, - 0x74, 0x70, 0x62, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x22, 0xb3, 0x05, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, - 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x48, 0x0a, 0x0c, 0x70, 0x72, 0x65, - 0x66, 0x69, 0x78, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x23, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x6c, - 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x4b, 0x65, 0x79, 0x48, 0x00, 0x52, 0x0b, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x12, 0x48, 0x0a, 0x0b, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x71, 0x75, 0x65, - 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, - 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, - 0x00, 0x52, 0x0a, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x46, 0x0a, - 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, - 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xbb, 0x02, 0x0a, 0x08, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, - 0x65, 0x79, 0x12, 0x57, 0x0a, 0x0d, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x64, 0x65, - 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x2e, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x48, 0x00, 0x52, 0x0c, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x41, 0x0a, 0x05, 0x64, - 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x74, 0x65, 0x73, - 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x2e, - 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x48, 0x00, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x1a, 0x5e, - 0x0a, 0x0c, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x1d, - 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, - 0x00, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, - 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x05, - 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x1a, 0x2c, - 0x0a, 0x05, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x19, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x88, - 0x01, 0x01, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x42, 0x05, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x1a, 0x7a, 0x0a, 0x0a, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x12, 0x37, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x23, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x6c, - 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x4b, 0x65, 0x79, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x33, 0x0a, 0x02, 0x74, 0x6f, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, 0x02, 0x74, 0x6f, 0x42, - 0x07, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x87, 0x01, 0x0a, 0x13, 0x4c, 0x69, 0x73, - 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x27, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x0f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, - 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, - 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x22, 0x28, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x22, 0x39, 0x0a, 0x11, - 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x24, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xf4, 0x03, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, - 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x47, 0x0a, - 0x0c, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x48, 0x00, 0x52, 0x0b, 0x70, 0x72, 0x65, 0x66, 0x69, - 0x78, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x47, 0x0a, 0x0b, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x48, 0x00, 0x52, 0x0a, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, - 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, - 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, - 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x81, 0x01, 0x0a, 0x08, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x4b, 0x65, 0x79, 0x12, 0x40, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x2e, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x48, 0x00, 0x52, - 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x1a, 0x2c, 0x0a, 0x05, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, - 0x19, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, - 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x88, 0x01, 0x01, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x64, - 0x65, 0x6e, 0x6f, 0x6d, 0x42, 0x05, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x1a, 0x78, 0x0a, 0x0a, 0x52, - 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x36, 0x0a, 0x04, 0x66, 0x72, 0x6f, - 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, 0x04, 0x66, 0x72, 0x6f, - 0x6d, 0x12, 0x32, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, - 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, - 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, - 0x79, 0x52, 0x02, 0x74, 0x6f, 0x42, 0x07, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x85, - 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x53, - 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x47, 0x0a, - 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, - 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, - 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0xae, 0x02, 0x0a, 0x10, 0x42, 0x61, 0x6e, 0x6b, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x45, 0x0a, 0x0a, 0x47, - 0x65, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x19, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, - 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x48, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, - 0x65, 0x12, 0x1a, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, - 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, - 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, - 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x09, - 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x18, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, - 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x45, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x19, - 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x70, 0x70, - 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x76, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x74, - 0x65, 0x73, 0x74, 0x70, 0x62, 0x42, 0x0e, 0x42, 0x61, 0x6e, 0x6b, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, - 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6f, 0x72, 0x6d, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, - 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xca, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, - 0x62, 0xe2, 0x02, 0x12, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_testpb_bank_query_proto_rawDescOnce sync.Once - file_testpb_bank_query_proto_rawDescData = file_testpb_bank_query_proto_rawDesc -) - -func file_testpb_bank_query_proto_rawDescGZIP() []byte { - file_testpb_bank_query_proto_rawDescOnce.Do(func() { - file_testpb_bank_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_testpb_bank_query_proto_rawDescData) - }) - return file_testpb_bank_query_proto_rawDescData -} - -var file_testpb_bank_query_proto_msgTypes = make([]protoimpl.MessageInfo, 15) -var file_testpb_bank_query_proto_goTypes = []interface{}{ - (*GetBalanceRequest)(nil), // 0: testpb.GetBalanceRequest - (*GetBalanceResponse)(nil), // 1: testpb.GetBalanceResponse - (*ListBalanceRequest)(nil), // 2: testpb.ListBalanceRequest - (*ListBalanceResponse)(nil), // 3: testpb.ListBalanceResponse - (*GetSupplyRequest)(nil), // 4: testpb.GetSupplyRequest - (*GetSupplyResponse)(nil), // 5: testpb.GetSupplyResponse - (*ListSupplyRequest)(nil), // 6: testpb.ListSupplyRequest - (*ListSupplyResponse)(nil), // 7: testpb.ListSupplyResponse - (*ListBalanceRequest_IndexKey)(nil), // 8: testpb.ListBalanceRequest.IndexKey - (*ListBalanceRequest_RangeQuery)(nil), // 9: testpb.ListBalanceRequest.RangeQuery - (*ListBalanceRequest_IndexKey_AddressDenom)(nil), // 10: testpb.ListBalanceRequest.IndexKey.AddressDenom - (*ListBalanceRequest_IndexKey_Denom)(nil), // 11: testpb.ListBalanceRequest.IndexKey.Denom - (*ListSupplyRequest_IndexKey)(nil), // 12: testpb.ListSupplyRequest.IndexKey - (*ListSupplyRequest_RangeQuery)(nil), // 13: testpb.ListSupplyRequest.RangeQuery - (*ListSupplyRequest_IndexKey_Denom)(nil), // 14: testpb.ListSupplyRequest.IndexKey.Denom - (*Balance)(nil), // 15: testpb.Balance - (*v1beta1.PageRequest)(nil), // 16: cosmos.base.query.v1beta1.PageRequest - (*v1beta1.PageResponse)(nil), // 17: cosmos.base.query.v1beta1.PageResponse - (*Supply)(nil), // 18: testpb.Supply -} -var file_testpb_bank_query_proto_depIdxs = []int32{ - 15, // 0: testpb.GetBalanceResponse.value:type_name -> testpb.Balance - 8, // 1: testpb.ListBalanceRequest.prefix_query:type_name -> testpb.ListBalanceRequest.IndexKey - 9, // 2: testpb.ListBalanceRequest.range_query:type_name -> testpb.ListBalanceRequest.RangeQuery - 16, // 3: testpb.ListBalanceRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 15, // 4: testpb.ListBalanceResponse.values:type_name -> testpb.Balance - 17, // 5: testpb.ListBalanceResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 18, // 6: testpb.GetSupplyResponse.value:type_name -> testpb.Supply - 12, // 7: testpb.ListSupplyRequest.prefix_query:type_name -> testpb.ListSupplyRequest.IndexKey - 13, // 8: testpb.ListSupplyRequest.range_query:type_name -> testpb.ListSupplyRequest.RangeQuery - 16, // 9: testpb.ListSupplyRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 18, // 10: testpb.ListSupplyResponse.values:type_name -> testpb.Supply - 17, // 11: testpb.ListSupplyResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 10, // 12: testpb.ListBalanceRequest.IndexKey.address_denom:type_name -> testpb.ListBalanceRequest.IndexKey.AddressDenom - 11, // 13: testpb.ListBalanceRequest.IndexKey.denom:type_name -> testpb.ListBalanceRequest.IndexKey.Denom - 8, // 14: testpb.ListBalanceRequest.RangeQuery.from:type_name -> testpb.ListBalanceRequest.IndexKey - 8, // 15: testpb.ListBalanceRequest.RangeQuery.to:type_name -> testpb.ListBalanceRequest.IndexKey - 14, // 16: testpb.ListSupplyRequest.IndexKey.denom:type_name -> testpb.ListSupplyRequest.IndexKey.Denom - 12, // 17: testpb.ListSupplyRequest.RangeQuery.from:type_name -> testpb.ListSupplyRequest.IndexKey - 12, // 18: testpb.ListSupplyRequest.RangeQuery.to:type_name -> testpb.ListSupplyRequest.IndexKey - 0, // 19: testpb.BankQueryService.GetBalance:input_type -> testpb.GetBalanceRequest - 2, // 20: testpb.BankQueryService.ListBalance:input_type -> testpb.ListBalanceRequest - 4, // 21: testpb.BankQueryService.GetSupply:input_type -> testpb.GetSupplyRequest - 6, // 22: testpb.BankQueryService.ListSupply:input_type -> testpb.ListSupplyRequest - 1, // 23: testpb.BankQueryService.GetBalance:output_type -> testpb.GetBalanceResponse - 3, // 24: testpb.BankQueryService.ListBalance:output_type -> testpb.ListBalanceResponse - 5, // 25: testpb.BankQueryService.GetSupply:output_type -> testpb.GetSupplyResponse - 7, // 26: testpb.BankQueryService.ListSupply:output_type -> testpb.ListSupplyResponse - 23, // [23:27] is the sub-list for method output_type - 19, // [19:23] is the sub-list for method input_type - 19, // [19:19] is the sub-list for extension type_name - 19, // [19:19] is the sub-list for extension extendee - 0, // [0:19] is the sub-list for field type_name -} - -func init() { file_testpb_bank_query_proto_init() } -func file_testpb_bank_query_proto_init() { - if File_testpb_bank_query_proto != nil { - return - } - file_testpb_bank_proto_init() - if !protoimpl.UnsafeEnabled { - file_testpb_bank_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetBalanceRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_bank_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetBalanceResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_bank_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListBalanceRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_bank_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListBalanceResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_bank_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetSupplyRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_bank_query_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetSupplyResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_bank_query_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListSupplyRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_bank_query_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListSupplyResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_bank_query_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListBalanceRequest_IndexKey); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_bank_query_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListBalanceRequest_RangeQuery); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_bank_query_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListBalanceRequest_IndexKey_AddressDenom); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_bank_query_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListBalanceRequest_IndexKey_Denom); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_bank_query_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListSupplyRequest_IndexKey); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_bank_query_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListSupplyRequest_RangeQuery); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_bank_query_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListSupplyRequest_IndexKey_Denom); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_testpb_bank_query_proto_msgTypes[2].OneofWrappers = []interface{}{ - (*ListBalanceRequest_PrefixQuery)(nil), - (*ListBalanceRequest_RangeQuery_)(nil), - } - file_testpb_bank_query_proto_msgTypes[6].OneofWrappers = []interface{}{ - (*ListSupplyRequest_PrefixQuery)(nil), - (*ListSupplyRequest_RangeQuery_)(nil), - } - file_testpb_bank_query_proto_msgTypes[8].OneofWrappers = []interface{}{ - (*ListBalanceRequest_IndexKey_AddressDenom_)(nil), - (*ListBalanceRequest_IndexKey_Denom_)(nil), - } - file_testpb_bank_query_proto_msgTypes[10].OneofWrappers = []interface{}{} - file_testpb_bank_query_proto_msgTypes[11].OneofWrappers = []interface{}{} - file_testpb_bank_query_proto_msgTypes[12].OneofWrappers = []interface{}{ - (*ListSupplyRequest_IndexKey_Denom_)(nil), - } - file_testpb_bank_query_proto_msgTypes[14].OneofWrappers = []interface{}{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_testpb_bank_query_proto_rawDesc, - NumEnums: 0, - NumMessages: 15, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_testpb_bank_query_proto_goTypes, - DependencyIndexes: file_testpb_bank_query_proto_depIdxs, - MessageInfos: file_testpb_bank_query_proto_msgTypes, - }.Build() - File_testpb_bank_query_proto = out.File - file_testpb_bank_query_proto_rawDesc = nil - file_testpb_bank_query_proto_goTypes = nil - file_testpb_bank_query_proto_depIdxs = nil -} diff --git a/orm/internal/testpb/bank_query.proto b/orm/internal/testpb/bank_query.proto deleted file mode 100644 index a204777bd4ba..000000000000 --- a/orm/internal/testpb/bank_query.proto +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by protoc-gen-go-cosmos-orm-proto. DO NOT EDIT. -syntax = "proto3"; -package testpb; - -import "cosmos/base/query/v1beta1/pagination.proto"; -import "testpb/bank.proto"; - -// BankQueryService queries the state of the tables specified by testpb/bank.proto. -service BankQueryService { - // Get queries the Balance table by its primary key. - rpc GetBalance(GetBalanceRequest) returns (GetBalanceResponse) {} - // ListBalance queries the Balance table using prefix and range queries against defined indexes. - rpc ListBalance(ListBalanceRequest) returns (ListBalanceResponse) {} - // Get queries the Supply table by its primary key. - rpc GetSupply(GetSupplyRequest) returns (GetSupplyResponse) {} - // ListSupply queries the Supply table using prefix and range queries against defined indexes. - rpc ListSupply(ListSupplyRequest) returns (ListSupplyResponse) {} -} - -// GetBalanceRequest is the BankQuery/GetBalanceRequest request type. -message GetBalanceRequest { - // address specifies the value of the address field in the primary key. - string address = 1; - // denom specifies the value of the denom field in the primary key. - string denom = 2; -} - -// GetBalanceResponse is the BankQuery/GetBalanceResponse response type. -message GetBalanceResponse { - // value is the response value. - Balance value = 1; -} - -// ListBalanceRequest is the BankQuery/ListBalanceRequest request type. -message ListBalanceRequest { - // IndexKey specifies the value of an index key to use in prefix and range queries. - message IndexKey { - // key specifies the index key value. - oneof key { - // address_denom specifies the value of the AddressDenom index key to use in the query. - AddressDenom address_denom = 1; - // denom specifies the value of the Denom index key to use in the query. - Denom denom = 2; - } - - message AddressDenom { - // address is the value of the address field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional string address = 1; - // denom is the value of the denom field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional string denom = 2; - } - - message Denom { - // denom is the value of the denom field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional string denom = 1; - } - } - - // query specifies the type of query - either a prefix or range query. - oneof query { - // prefix_query specifies the index key value to use for the prefix query. - IndexKey prefix_query = 1; - // range_query specifies the index key from/to values to use for the range query. - RangeQuery range_query = 2; - } - // pagination specifies optional pagination parameters. - cosmos.base.query.v1beta1.PageRequest pagination = 3; - - // RangeQuery specifies the from/to index keys for a range query. - message RangeQuery { - // from is the index key to use for the start of the range query. - // To query from the start of an index, specify an index key for that index with empty values. - IndexKey from = 1; - // to is the index key to use for the end of the range query. - // The index key type MUST be the same as the index key type used for from. - // To query from to the end of an index it can be omitted. - IndexKey to = 2; - } -} - -// ListBalanceResponse is the BankQuery/ListBalanceResponse response type. -message ListBalanceResponse { - // values are the results of the query. - repeated Balance values = 1; - // pagination is the pagination response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// GetSupplyRequest is the BankQuery/GetSupplyRequest request type. -message GetSupplyRequest { - // denom specifies the value of the denom field in the primary key. - string denom = 1; -} - -// GetSupplyResponse is the BankQuery/GetSupplyResponse response type. -message GetSupplyResponse { - // value is the response value. - Supply value = 1; -} - -// ListSupplyRequest is the BankQuery/ListSupplyRequest request type. -message ListSupplyRequest { - // IndexKey specifies the value of an index key to use in prefix and range queries. - message IndexKey { - // key specifies the index key value. - oneof key { - // denom specifies the value of the Denom index key to use in the query. - Denom denom = 1; - } - - message Denom { - // denom is the value of the denom field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional string denom = 1; - } - } - - // query specifies the type of query - either a prefix or range query. - oneof query { - // prefix_query specifies the index key value to use for the prefix query. - IndexKey prefix_query = 1; - // range_query specifies the index key from/to values to use for the range query. - RangeQuery range_query = 2; - } - // pagination specifies optional pagination parameters. - cosmos.base.query.v1beta1.PageRequest pagination = 3; - - // RangeQuery specifies the from/to index keys for a range query. - message RangeQuery { - // from is the index key to use for the start of the range query. - // To query from the start of an index, specify an index key for that index with empty values. - IndexKey from = 1; - // to is the index key to use for the end of the range query. - // The index key type MUST be the same as the index key type used for from. - // To query from to the end of an index it can be omitted. - IndexKey to = 2; - } -} - -// ListSupplyResponse is the BankQuery/ListSupplyResponse response type. -message ListSupplyResponse { - // values are the results of the query. - repeated Supply values = 1; - // pagination is the pagination response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - diff --git a/orm/internal/testpb/bank_query_grpc.pb.go b/orm/internal/testpb/bank_query_grpc.pb.go deleted file mode 100644 index dc8eac20dbd6..000000000000 --- a/orm/internal/testpb/bank_query_grpc.pb.go +++ /dev/null @@ -1,230 +0,0 @@ -// Code generated by protoc-gen-go-cosmos-orm-proto. DO NOT EDIT. - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc (unknown) -// source: testpb/bank_query.proto - -package testpb - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - BankQueryService_GetBalance_FullMethodName = "/testpb.BankQueryService/GetBalance" - BankQueryService_ListBalance_FullMethodName = "/testpb.BankQueryService/ListBalance" - BankQueryService_GetSupply_FullMethodName = "/testpb.BankQueryService/GetSupply" - BankQueryService_ListSupply_FullMethodName = "/testpb.BankQueryService/ListSupply" -) - -// BankQueryServiceClient is the client API for BankQueryService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type BankQueryServiceClient interface { - // Get queries the Balance table by its primary key. - GetBalance(ctx context.Context, in *GetBalanceRequest, opts ...grpc.CallOption) (*GetBalanceResponse, error) - // ListBalance queries the Balance table using prefix and range queries against defined indexes. - ListBalance(ctx context.Context, in *ListBalanceRequest, opts ...grpc.CallOption) (*ListBalanceResponse, error) - // Get queries the Supply table by its primary key. - GetSupply(ctx context.Context, in *GetSupplyRequest, opts ...grpc.CallOption) (*GetSupplyResponse, error) - // ListSupply queries the Supply table using prefix and range queries against defined indexes. - ListSupply(ctx context.Context, in *ListSupplyRequest, opts ...grpc.CallOption) (*ListSupplyResponse, error) -} - -type bankQueryServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewBankQueryServiceClient(cc grpc.ClientConnInterface) BankQueryServiceClient { - return &bankQueryServiceClient{cc} -} - -func (c *bankQueryServiceClient) GetBalance(ctx context.Context, in *GetBalanceRequest, opts ...grpc.CallOption) (*GetBalanceResponse, error) { - out := new(GetBalanceResponse) - err := c.cc.Invoke(ctx, BankQueryService_GetBalance_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *bankQueryServiceClient) ListBalance(ctx context.Context, in *ListBalanceRequest, opts ...grpc.CallOption) (*ListBalanceResponse, error) { - out := new(ListBalanceResponse) - err := c.cc.Invoke(ctx, BankQueryService_ListBalance_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *bankQueryServiceClient) GetSupply(ctx context.Context, in *GetSupplyRequest, opts ...grpc.CallOption) (*GetSupplyResponse, error) { - out := new(GetSupplyResponse) - err := c.cc.Invoke(ctx, BankQueryService_GetSupply_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *bankQueryServiceClient) ListSupply(ctx context.Context, in *ListSupplyRequest, opts ...grpc.CallOption) (*ListSupplyResponse, error) { - out := new(ListSupplyResponse) - err := c.cc.Invoke(ctx, BankQueryService_ListSupply_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// BankQueryServiceServer is the server API for BankQueryService service. -// All implementations must embed UnimplementedBankQueryServiceServer -// for forward compatibility -type BankQueryServiceServer interface { - // Get queries the Balance table by its primary key. - GetBalance(context.Context, *GetBalanceRequest) (*GetBalanceResponse, error) - // ListBalance queries the Balance table using prefix and range queries against defined indexes. - ListBalance(context.Context, *ListBalanceRequest) (*ListBalanceResponse, error) - // Get queries the Supply table by its primary key. - GetSupply(context.Context, *GetSupplyRequest) (*GetSupplyResponse, error) - // ListSupply queries the Supply table using prefix and range queries against defined indexes. - ListSupply(context.Context, *ListSupplyRequest) (*ListSupplyResponse, error) - mustEmbedUnimplementedBankQueryServiceServer() -} - -// UnimplementedBankQueryServiceServer must be embedded to have forward compatible implementations. -type UnimplementedBankQueryServiceServer struct { -} - -func (UnimplementedBankQueryServiceServer) GetBalance(context.Context, *GetBalanceRequest) (*GetBalanceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetBalance not implemented") -} -func (UnimplementedBankQueryServiceServer) ListBalance(context.Context, *ListBalanceRequest) (*ListBalanceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListBalance not implemented") -} -func (UnimplementedBankQueryServiceServer) GetSupply(context.Context, *GetSupplyRequest) (*GetSupplyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetSupply not implemented") -} -func (UnimplementedBankQueryServiceServer) ListSupply(context.Context, *ListSupplyRequest) (*ListSupplyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListSupply not implemented") -} -func (UnimplementedBankQueryServiceServer) mustEmbedUnimplementedBankQueryServiceServer() {} - -// UnsafeBankQueryServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to BankQueryServiceServer will -// result in compilation errors. -type UnsafeBankQueryServiceServer interface { - mustEmbedUnimplementedBankQueryServiceServer() -} - -func RegisterBankQueryServiceServer(s grpc.ServiceRegistrar, srv BankQueryServiceServer) { - s.RegisterService(&BankQueryService_ServiceDesc, srv) -} - -func _BankQueryService_GetBalance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetBalanceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BankQueryServiceServer).GetBalance(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BankQueryService_GetBalance_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BankQueryServiceServer).GetBalance(ctx, req.(*GetBalanceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BankQueryService_ListBalance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListBalanceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BankQueryServiceServer).ListBalance(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BankQueryService_ListBalance_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BankQueryServiceServer).ListBalance(ctx, req.(*ListBalanceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BankQueryService_GetSupply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetSupplyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BankQueryServiceServer).GetSupply(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BankQueryService_GetSupply_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BankQueryServiceServer).GetSupply(ctx, req.(*GetSupplyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BankQueryService_ListSupply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListSupplyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BankQueryServiceServer).ListSupply(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BankQueryService_ListSupply_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BankQueryServiceServer).ListSupply(ctx, req.(*ListSupplyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// BankQueryService_ServiceDesc is the grpc.ServiceDesc for BankQueryService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var BankQueryService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "testpb.BankQueryService", - HandlerType: (*BankQueryServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetBalance", - Handler: _BankQueryService_GetBalance_Handler, - }, - { - MethodName: "ListBalance", - Handler: _BankQueryService_ListBalance_Handler, - }, - { - MethodName: "GetSupply", - Handler: _BankQueryService_GetSupply_Handler, - }, - { - MethodName: "ListSupply", - Handler: _BankQueryService_ListSupply_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "testpb/bank_query.proto", -} diff --git a/orm/internal/testpb/test_schema.cosmos_orm.go b/orm/internal/testpb/test_schema.cosmos_orm.go deleted file mode 100644 index 177886eee338..000000000000 --- a/orm/internal/testpb/test_schema.cosmos_orm.go +++ /dev/null @@ -1,1054 +0,0 @@ -// Code generated by protoc-gen-go-cosmos-orm. DO NOT EDIT. - -package testpb - -import ( - context "context" - ormlist "cosmossdk.io/orm/model/ormlist" - ormtable "cosmossdk.io/orm/model/ormtable" - ormerrors "cosmossdk.io/orm/types/ormerrors" - durationpb "google.golang.org/protobuf/types/known/durationpb" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" -) - -type ExampleTableTable interface { - Insert(ctx context.Context, exampleTable *ExampleTable) error - Update(ctx context.Context, exampleTable *ExampleTable) error - Save(ctx context.Context, exampleTable *ExampleTable) error - Delete(ctx context.Context, exampleTable *ExampleTable) error - Has(ctx context.Context, u32 uint32, i64 int64, str 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, u32 uint32, i64 int64, str string) (*ExampleTable, error) - HasByU64Str(ctx context.Context, u64 uint64, str string) (found bool, err error) - // GetByU64Str returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - GetByU64Str(ctx context.Context, u64 uint64, str string) (*ExampleTable, error) - List(ctx context.Context, prefixKey ExampleTableIndexKey, opts ...ormlist.Option) (ExampleTableIterator, error) - ListRange(ctx context.Context, from, to ExampleTableIndexKey, opts ...ormlist.Option) (ExampleTableIterator, error) - DeleteBy(ctx context.Context, prefixKey ExampleTableIndexKey) error - DeleteRange(ctx context.Context, from, to ExampleTableIndexKey) error - - doNotImplement() -} - -type ExampleTableIterator struct { - ormtable.Iterator -} - -func (i ExampleTableIterator) Value() (*ExampleTable, error) { - var exampleTable ExampleTable - err := i.UnmarshalMessage(&exampleTable) - return &exampleTable, err -} - -type ExampleTableIndexKey interface { - id() uint32 - values() []interface{} - exampleTableIndexKey() -} - -// primary key starting index.. -type ExampleTablePrimaryKey = ExampleTableU32I64StrIndexKey - -type ExampleTableU32I64StrIndexKey struct { - vs []interface{} -} - -func (x ExampleTableU32I64StrIndexKey) id() uint32 { return 0 } -func (x ExampleTableU32I64StrIndexKey) values() []interface{} { return x.vs } -func (x ExampleTableU32I64StrIndexKey) exampleTableIndexKey() {} - -func (this ExampleTableU32I64StrIndexKey) WithU32(u32 uint32) ExampleTableU32I64StrIndexKey { - this.vs = []interface{}{u32} - return this -} - -func (this ExampleTableU32I64StrIndexKey) WithU32I64(u32 uint32, i64 int64) ExampleTableU32I64StrIndexKey { - this.vs = []interface{}{u32, i64} - return this -} - -func (this ExampleTableU32I64StrIndexKey) WithU32I64Str(u32 uint32, i64 int64, str string) ExampleTableU32I64StrIndexKey { - this.vs = []interface{}{u32, i64, str} - return this -} - -type ExampleTableU64StrIndexKey struct { - vs []interface{} -} - -func (x ExampleTableU64StrIndexKey) id() uint32 { return 1 } -func (x ExampleTableU64StrIndexKey) values() []interface{} { return x.vs } -func (x ExampleTableU64StrIndexKey) exampleTableIndexKey() {} - -func (this ExampleTableU64StrIndexKey) WithU64(u64 uint64) ExampleTableU64StrIndexKey { - this.vs = []interface{}{u64} - return this -} - -func (this ExampleTableU64StrIndexKey) WithU64Str(u64 uint64, str string) ExampleTableU64StrIndexKey { - this.vs = []interface{}{u64, str} - return this -} - -type ExampleTableStrU32IndexKey struct { - vs []interface{} -} - -func (x ExampleTableStrU32IndexKey) id() uint32 { return 2 } -func (x ExampleTableStrU32IndexKey) values() []interface{} { return x.vs } -func (x ExampleTableStrU32IndexKey) exampleTableIndexKey() {} - -func (this ExampleTableStrU32IndexKey) WithStr(str string) ExampleTableStrU32IndexKey { - this.vs = []interface{}{str} - return this -} - -func (this ExampleTableStrU32IndexKey) WithStrU32(str string, u32 uint32) ExampleTableStrU32IndexKey { - this.vs = []interface{}{str, u32} - return this -} - -type ExampleTableBzStrIndexKey struct { - vs []interface{} -} - -func (x ExampleTableBzStrIndexKey) id() uint32 { return 3 } -func (x ExampleTableBzStrIndexKey) values() []interface{} { return x.vs } -func (x ExampleTableBzStrIndexKey) exampleTableIndexKey() {} - -func (this ExampleTableBzStrIndexKey) WithBz(bz []byte) ExampleTableBzStrIndexKey { - this.vs = []interface{}{bz} - return this -} - -func (this ExampleTableBzStrIndexKey) WithBzStr(bz []byte, str string) ExampleTableBzStrIndexKey { - this.vs = []interface{}{bz, str} - return this -} - -type exampleTableTable struct { - table ormtable.Table -} - -func (this exampleTableTable) Insert(ctx context.Context, exampleTable *ExampleTable) error { - return this.table.Insert(ctx, exampleTable) -} - -func (this exampleTableTable) Update(ctx context.Context, exampleTable *ExampleTable) error { - return this.table.Update(ctx, exampleTable) -} - -func (this exampleTableTable) Save(ctx context.Context, exampleTable *ExampleTable) error { - return this.table.Save(ctx, exampleTable) -} - -func (this exampleTableTable) Delete(ctx context.Context, exampleTable *ExampleTable) error { - return this.table.Delete(ctx, exampleTable) -} - -func (this exampleTableTable) Has(ctx context.Context, u32 uint32, i64 int64, str string) (found bool, err error) { - return this.table.PrimaryKey().Has(ctx, u32, i64, str) -} - -func (this exampleTableTable) Get(ctx context.Context, u32 uint32, i64 int64, str string) (*ExampleTable, error) { - var exampleTable ExampleTable - found, err := this.table.PrimaryKey().Get(ctx, &exampleTable, u32, i64, str) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &exampleTable, nil -} - -func (this exampleTableTable) HasByU64Str(ctx context.Context, u64 uint64, str string) (found bool, err error) { - return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx, - u64, - str, - ) -} - -func (this exampleTableTable) GetByU64Str(ctx context.Context, u64 uint64, str string) (*ExampleTable, error) { - var exampleTable ExampleTable - found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &exampleTable, - u64, - str, - ) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &exampleTable, nil -} - -func (this exampleTableTable) List(ctx context.Context, prefixKey ExampleTableIndexKey, opts ...ormlist.Option) (ExampleTableIterator, error) { - it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) - return ExampleTableIterator{it}, err -} - -func (this exampleTableTable) ListRange(ctx context.Context, from, to ExampleTableIndexKey, opts ...ormlist.Option) (ExampleTableIterator, error) { - it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) - return ExampleTableIterator{it}, err -} - -func (this exampleTableTable) DeleteBy(ctx context.Context, prefixKey ExampleTableIndexKey) error { - return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) -} - -func (this exampleTableTable) DeleteRange(ctx context.Context, from, to ExampleTableIndexKey) error { - return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) -} - -func (this exampleTableTable) doNotImplement() {} - -var _ ExampleTableTable = exampleTableTable{} - -func NewExampleTableTable(db ormtable.Schema) (ExampleTableTable, error) { - table := db.GetTable(&ExampleTable{}) - if table == nil { - return nil, ormerrors.TableNotFound.Wrap(string((&ExampleTable{}).ProtoReflect().Descriptor().FullName())) - } - return exampleTableTable{table}, nil -} - -type ExampleAutoIncrementTableTable interface { - Insert(ctx context.Context, exampleAutoIncrementTable *ExampleAutoIncrementTable) error - InsertReturningId(ctx context.Context, exampleAutoIncrementTable *ExampleAutoIncrementTable) (uint64, error) - LastInsertedSequence(ctx context.Context) (uint64, error) - Update(ctx context.Context, exampleAutoIncrementTable *ExampleAutoIncrementTable) error - Save(ctx context.Context, exampleAutoIncrementTable *ExampleAutoIncrementTable) error - Delete(ctx context.Context, exampleAutoIncrementTable *ExampleAutoIncrementTable) error - Has(ctx context.Context, id uint64) (found bool, err error) - // Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - Get(ctx context.Context, id uint64) (*ExampleAutoIncrementTable, error) - HasByX(ctx context.Context, x string) (found bool, err error) - // GetByX returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - GetByX(ctx context.Context, x string) (*ExampleAutoIncrementTable, error) - List(ctx context.Context, prefixKey ExampleAutoIncrementTableIndexKey, opts ...ormlist.Option) (ExampleAutoIncrementTableIterator, error) - ListRange(ctx context.Context, from, to ExampleAutoIncrementTableIndexKey, opts ...ormlist.Option) (ExampleAutoIncrementTableIterator, error) - DeleteBy(ctx context.Context, prefixKey ExampleAutoIncrementTableIndexKey) error - DeleteRange(ctx context.Context, from, to ExampleAutoIncrementTableIndexKey) error - - doNotImplement() -} - -type ExampleAutoIncrementTableIterator struct { - ormtable.Iterator -} - -func (i ExampleAutoIncrementTableIterator) Value() (*ExampleAutoIncrementTable, error) { - var exampleAutoIncrementTable ExampleAutoIncrementTable - err := i.UnmarshalMessage(&exampleAutoIncrementTable) - return &exampleAutoIncrementTable, err -} - -type ExampleAutoIncrementTableIndexKey interface { - id() uint32 - values() []interface{} - exampleAutoIncrementTableIndexKey() -} - -// primary key starting index.. -type ExampleAutoIncrementTablePrimaryKey = ExampleAutoIncrementTableIdIndexKey - -type ExampleAutoIncrementTableIdIndexKey struct { - vs []interface{} -} - -func (x ExampleAutoIncrementTableIdIndexKey) id() uint32 { return 0 } -func (x ExampleAutoIncrementTableIdIndexKey) values() []interface{} { return x.vs } -func (x ExampleAutoIncrementTableIdIndexKey) exampleAutoIncrementTableIndexKey() {} - -func (this ExampleAutoIncrementTableIdIndexKey) WithId(id uint64) ExampleAutoIncrementTableIdIndexKey { - this.vs = []interface{}{id} - return this -} - -type ExampleAutoIncrementTableXIndexKey struct { - vs []interface{} -} - -func (x ExampleAutoIncrementTableXIndexKey) id() uint32 { return 1 } -func (x ExampleAutoIncrementTableXIndexKey) values() []interface{} { return x.vs } -func (x ExampleAutoIncrementTableXIndexKey) exampleAutoIncrementTableIndexKey() {} - -func (this ExampleAutoIncrementTableXIndexKey) WithX(x string) ExampleAutoIncrementTableXIndexKey { - this.vs = []interface{}{x} - return this -} - -type exampleAutoIncrementTableTable struct { - table ormtable.AutoIncrementTable -} - -func (this exampleAutoIncrementTableTable) Insert(ctx context.Context, exampleAutoIncrementTable *ExampleAutoIncrementTable) error { - return this.table.Insert(ctx, exampleAutoIncrementTable) -} - -func (this exampleAutoIncrementTableTable) Update(ctx context.Context, exampleAutoIncrementTable *ExampleAutoIncrementTable) error { - return this.table.Update(ctx, exampleAutoIncrementTable) -} - -func (this exampleAutoIncrementTableTable) Save(ctx context.Context, exampleAutoIncrementTable *ExampleAutoIncrementTable) error { - return this.table.Save(ctx, exampleAutoIncrementTable) -} - -func (this exampleAutoIncrementTableTable) Delete(ctx context.Context, exampleAutoIncrementTable *ExampleAutoIncrementTable) error { - return this.table.Delete(ctx, exampleAutoIncrementTable) -} - -func (this exampleAutoIncrementTableTable) InsertReturningId(ctx context.Context, exampleAutoIncrementTable *ExampleAutoIncrementTable) (uint64, error) { - return this.table.InsertReturningPKey(ctx, exampleAutoIncrementTable) -} - -func (this exampleAutoIncrementTableTable) LastInsertedSequence(ctx context.Context) (uint64, error) { - return this.table.LastInsertedSequence(ctx) -} - -func (this exampleAutoIncrementTableTable) Has(ctx context.Context, id uint64) (found bool, err error) { - return this.table.PrimaryKey().Has(ctx, id) -} - -func (this exampleAutoIncrementTableTable) Get(ctx context.Context, id uint64) (*ExampleAutoIncrementTable, error) { - var exampleAutoIncrementTable ExampleAutoIncrementTable - found, err := this.table.PrimaryKey().Get(ctx, &exampleAutoIncrementTable, id) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &exampleAutoIncrementTable, nil -} - -func (this exampleAutoIncrementTableTable) HasByX(ctx context.Context, x string) (found bool, err error) { - return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx, - x, - ) -} - -func (this exampleAutoIncrementTableTable) GetByX(ctx context.Context, x string) (*ExampleAutoIncrementTable, error) { - var exampleAutoIncrementTable ExampleAutoIncrementTable - found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &exampleAutoIncrementTable, - x, - ) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &exampleAutoIncrementTable, nil -} - -func (this exampleAutoIncrementTableTable) List(ctx context.Context, prefixKey ExampleAutoIncrementTableIndexKey, opts ...ormlist.Option) (ExampleAutoIncrementTableIterator, error) { - it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) - return ExampleAutoIncrementTableIterator{it}, err -} - -func (this exampleAutoIncrementTableTable) ListRange(ctx context.Context, from, to ExampleAutoIncrementTableIndexKey, opts ...ormlist.Option) (ExampleAutoIncrementTableIterator, error) { - it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) - return ExampleAutoIncrementTableIterator{it}, err -} - -func (this exampleAutoIncrementTableTable) DeleteBy(ctx context.Context, prefixKey ExampleAutoIncrementTableIndexKey) error { - return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) -} - -func (this exampleAutoIncrementTableTable) DeleteRange(ctx context.Context, from, to ExampleAutoIncrementTableIndexKey) error { - return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) -} - -func (this exampleAutoIncrementTableTable) doNotImplement() {} - -var _ ExampleAutoIncrementTableTable = exampleAutoIncrementTableTable{} - -func NewExampleAutoIncrementTableTable(db ormtable.Schema) (ExampleAutoIncrementTableTable, error) { - table := db.GetTable(&ExampleAutoIncrementTable{}) - if table == nil { - return nil, ormerrors.TableNotFound.Wrap(string((&ExampleAutoIncrementTable{}).ProtoReflect().Descriptor().FullName())) - } - return exampleAutoIncrementTableTable{table.(ormtable.AutoIncrementTable)}, nil -} - -// singleton store -type ExampleSingletonTable interface { - Get(ctx context.Context) (*ExampleSingleton, error) - Save(ctx context.Context, exampleSingleton *ExampleSingleton) error -} - -type exampleSingletonTable struct { - table ormtable.Table -} - -var _ ExampleSingletonTable = exampleSingletonTable{} - -func (x exampleSingletonTable) Get(ctx context.Context) (*ExampleSingleton, error) { - exampleSingleton := &ExampleSingleton{} - _, err := x.table.Get(ctx, exampleSingleton) - return exampleSingleton, err -} - -func (x exampleSingletonTable) Save(ctx context.Context, exampleSingleton *ExampleSingleton) error { - return x.table.Save(ctx, exampleSingleton) -} - -func NewExampleSingletonTable(db ormtable.Schema) (ExampleSingletonTable, error) { - table := db.GetTable(&ExampleSingleton{}) - if table == nil { - return nil, ormerrors.TableNotFound.Wrap(string((&ExampleSingleton{}).ProtoReflect().Descriptor().FullName())) - } - return &exampleSingletonTable{table}, nil -} - -type ExampleTimestampTable interface { - Insert(ctx context.Context, exampleTimestamp *ExampleTimestamp) error - InsertReturningId(ctx context.Context, exampleTimestamp *ExampleTimestamp) (uint64, error) - LastInsertedSequence(ctx context.Context) (uint64, error) - Update(ctx context.Context, exampleTimestamp *ExampleTimestamp) error - Save(ctx context.Context, exampleTimestamp *ExampleTimestamp) error - Delete(ctx context.Context, exampleTimestamp *ExampleTimestamp) error - Has(ctx context.Context, id uint64) (found bool, err error) - // Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - Get(ctx context.Context, id uint64) (*ExampleTimestamp, error) - List(ctx context.Context, prefixKey ExampleTimestampIndexKey, opts ...ormlist.Option) (ExampleTimestampIterator, error) - ListRange(ctx context.Context, from, to ExampleTimestampIndexKey, opts ...ormlist.Option) (ExampleTimestampIterator, error) - DeleteBy(ctx context.Context, prefixKey ExampleTimestampIndexKey) error - DeleteRange(ctx context.Context, from, to ExampleTimestampIndexKey) error - - doNotImplement() -} - -type ExampleTimestampIterator struct { - ormtable.Iterator -} - -func (i ExampleTimestampIterator) Value() (*ExampleTimestamp, error) { - var exampleTimestamp ExampleTimestamp - err := i.UnmarshalMessage(&exampleTimestamp) - return &exampleTimestamp, err -} - -type ExampleTimestampIndexKey interface { - id() uint32 - values() []interface{} - exampleTimestampIndexKey() -} - -// primary key starting index.. -type ExampleTimestampPrimaryKey = ExampleTimestampIdIndexKey - -type ExampleTimestampIdIndexKey struct { - vs []interface{} -} - -func (x ExampleTimestampIdIndexKey) id() uint32 { return 0 } -func (x ExampleTimestampIdIndexKey) values() []interface{} { return x.vs } -func (x ExampleTimestampIdIndexKey) exampleTimestampIndexKey() {} - -func (this ExampleTimestampIdIndexKey) WithId(id uint64) ExampleTimestampIdIndexKey { - this.vs = []interface{}{id} - return this -} - -type ExampleTimestampTsIndexKey struct { - vs []interface{} -} - -func (x ExampleTimestampTsIndexKey) id() uint32 { return 1 } -func (x ExampleTimestampTsIndexKey) values() []interface{} { return x.vs } -func (x ExampleTimestampTsIndexKey) exampleTimestampIndexKey() {} - -func (this ExampleTimestampTsIndexKey) WithTs(ts *timestamppb.Timestamp) ExampleTimestampTsIndexKey { - this.vs = []interface{}{ts} - return this -} - -type exampleTimestampTable struct { - table ormtable.AutoIncrementTable -} - -func (this exampleTimestampTable) Insert(ctx context.Context, exampleTimestamp *ExampleTimestamp) error { - return this.table.Insert(ctx, exampleTimestamp) -} - -func (this exampleTimestampTable) Update(ctx context.Context, exampleTimestamp *ExampleTimestamp) error { - return this.table.Update(ctx, exampleTimestamp) -} - -func (this exampleTimestampTable) Save(ctx context.Context, exampleTimestamp *ExampleTimestamp) error { - return this.table.Save(ctx, exampleTimestamp) -} - -func (this exampleTimestampTable) Delete(ctx context.Context, exampleTimestamp *ExampleTimestamp) error { - return this.table.Delete(ctx, exampleTimestamp) -} - -func (this exampleTimestampTable) InsertReturningId(ctx context.Context, exampleTimestamp *ExampleTimestamp) (uint64, error) { - return this.table.InsertReturningPKey(ctx, exampleTimestamp) -} - -func (this exampleTimestampTable) LastInsertedSequence(ctx context.Context) (uint64, error) { - return this.table.LastInsertedSequence(ctx) -} - -func (this exampleTimestampTable) Has(ctx context.Context, id uint64) (found bool, err error) { - return this.table.PrimaryKey().Has(ctx, id) -} - -func (this exampleTimestampTable) Get(ctx context.Context, id uint64) (*ExampleTimestamp, error) { - var exampleTimestamp ExampleTimestamp - found, err := this.table.PrimaryKey().Get(ctx, &exampleTimestamp, id) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &exampleTimestamp, nil -} - -func (this exampleTimestampTable) List(ctx context.Context, prefixKey ExampleTimestampIndexKey, opts ...ormlist.Option) (ExampleTimestampIterator, error) { - it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) - return ExampleTimestampIterator{it}, err -} - -func (this exampleTimestampTable) ListRange(ctx context.Context, from, to ExampleTimestampIndexKey, opts ...ormlist.Option) (ExampleTimestampIterator, error) { - it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) - return ExampleTimestampIterator{it}, err -} - -func (this exampleTimestampTable) DeleteBy(ctx context.Context, prefixKey ExampleTimestampIndexKey) error { - return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) -} - -func (this exampleTimestampTable) DeleteRange(ctx context.Context, from, to ExampleTimestampIndexKey) error { - return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) -} - -func (this exampleTimestampTable) doNotImplement() {} - -var _ ExampleTimestampTable = exampleTimestampTable{} - -func NewExampleTimestampTable(db ormtable.Schema) (ExampleTimestampTable, error) { - table := db.GetTable(&ExampleTimestamp{}) - if table == nil { - return nil, ormerrors.TableNotFound.Wrap(string((&ExampleTimestamp{}).ProtoReflect().Descriptor().FullName())) - } - return exampleTimestampTable{table.(ormtable.AutoIncrementTable)}, nil -} - -type ExampleDurationTable interface { - Insert(ctx context.Context, exampleDuration *ExampleDuration) error - InsertReturningId(ctx context.Context, exampleDuration *ExampleDuration) (uint64, error) - LastInsertedSequence(ctx context.Context) (uint64, error) - Update(ctx context.Context, exampleDuration *ExampleDuration) error - Save(ctx context.Context, exampleDuration *ExampleDuration) error - Delete(ctx context.Context, exampleDuration *ExampleDuration) error - Has(ctx context.Context, id uint64) (found bool, err error) - // Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - Get(ctx context.Context, id uint64) (*ExampleDuration, error) - List(ctx context.Context, prefixKey ExampleDurationIndexKey, opts ...ormlist.Option) (ExampleDurationIterator, error) - ListRange(ctx context.Context, from, to ExampleDurationIndexKey, opts ...ormlist.Option) (ExampleDurationIterator, error) - DeleteBy(ctx context.Context, prefixKey ExampleDurationIndexKey) error - DeleteRange(ctx context.Context, from, to ExampleDurationIndexKey) error - - doNotImplement() -} - -type ExampleDurationIterator struct { - ormtable.Iterator -} - -func (i ExampleDurationIterator) Value() (*ExampleDuration, error) { - var exampleDuration ExampleDuration - err := i.UnmarshalMessage(&exampleDuration) - return &exampleDuration, err -} - -type ExampleDurationIndexKey interface { - id() uint32 - values() []interface{} - exampleDurationIndexKey() -} - -// primary key starting index.. -type ExampleDurationPrimaryKey = ExampleDurationIdIndexKey - -type ExampleDurationIdIndexKey struct { - vs []interface{} -} - -func (x ExampleDurationIdIndexKey) id() uint32 { return 0 } -func (x ExampleDurationIdIndexKey) values() []interface{} { return x.vs } -func (x ExampleDurationIdIndexKey) exampleDurationIndexKey() {} - -func (this ExampleDurationIdIndexKey) WithId(id uint64) ExampleDurationIdIndexKey { - this.vs = []interface{}{id} - return this -} - -type ExampleDurationDurIndexKey struct { - vs []interface{} -} - -func (x ExampleDurationDurIndexKey) id() uint32 { return 1 } -func (x ExampleDurationDurIndexKey) values() []interface{} { return x.vs } -func (x ExampleDurationDurIndexKey) exampleDurationIndexKey() {} - -func (this ExampleDurationDurIndexKey) WithDur(dur *durationpb.Duration) ExampleDurationDurIndexKey { - this.vs = []interface{}{dur} - return this -} - -type exampleDurationTable struct { - table ormtable.AutoIncrementTable -} - -func (this exampleDurationTable) Insert(ctx context.Context, exampleDuration *ExampleDuration) error { - return this.table.Insert(ctx, exampleDuration) -} - -func (this exampleDurationTable) Update(ctx context.Context, exampleDuration *ExampleDuration) error { - return this.table.Update(ctx, exampleDuration) -} - -func (this exampleDurationTable) Save(ctx context.Context, exampleDuration *ExampleDuration) error { - return this.table.Save(ctx, exampleDuration) -} - -func (this exampleDurationTable) Delete(ctx context.Context, exampleDuration *ExampleDuration) error { - return this.table.Delete(ctx, exampleDuration) -} - -func (this exampleDurationTable) InsertReturningId(ctx context.Context, exampleDuration *ExampleDuration) (uint64, error) { - return this.table.InsertReturningPKey(ctx, exampleDuration) -} - -func (this exampleDurationTable) LastInsertedSequence(ctx context.Context) (uint64, error) { - return this.table.LastInsertedSequence(ctx) -} - -func (this exampleDurationTable) Has(ctx context.Context, id uint64) (found bool, err error) { - return this.table.PrimaryKey().Has(ctx, id) -} - -func (this exampleDurationTable) Get(ctx context.Context, id uint64) (*ExampleDuration, error) { - var exampleDuration ExampleDuration - found, err := this.table.PrimaryKey().Get(ctx, &exampleDuration, id) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &exampleDuration, nil -} - -func (this exampleDurationTable) List(ctx context.Context, prefixKey ExampleDurationIndexKey, opts ...ormlist.Option) (ExampleDurationIterator, error) { - it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) - return ExampleDurationIterator{it}, err -} - -func (this exampleDurationTable) ListRange(ctx context.Context, from, to ExampleDurationIndexKey, opts ...ormlist.Option) (ExampleDurationIterator, error) { - it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) - return ExampleDurationIterator{it}, err -} - -func (this exampleDurationTable) DeleteBy(ctx context.Context, prefixKey ExampleDurationIndexKey) error { - return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) -} - -func (this exampleDurationTable) DeleteRange(ctx context.Context, from, to ExampleDurationIndexKey) error { - return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) -} - -func (this exampleDurationTable) doNotImplement() {} - -var _ ExampleDurationTable = exampleDurationTable{} - -func NewExampleDurationTable(db ormtable.Schema) (ExampleDurationTable, error) { - table := db.GetTable(&ExampleDuration{}) - if table == nil { - return nil, ormerrors.TableNotFound.Wrap(string((&ExampleDuration{}).ProtoReflect().Descriptor().FullName())) - } - return exampleDurationTable{table.(ormtable.AutoIncrementTable)}, nil -} - -type SimpleExampleTable interface { - Insert(ctx context.Context, simpleExample *SimpleExample) error - Update(ctx context.Context, simpleExample *SimpleExample) error - Save(ctx context.Context, simpleExample *SimpleExample) error - Delete(ctx context.Context, simpleExample *SimpleExample) error - Has(ctx context.Context, name 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, name string) (*SimpleExample, error) - HasByUnique(ctx context.Context, unique string) (found bool, err error) - // GetByUnique returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - GetByUnique(ctx context.Context, unique string) (*SimpleExample, error) - List(ctx context.Context, prefixKey SimpleExampleIndexKey, opts ...ormlist.Option) (SimpleExampleIterator, error) - ListRange(ctx context.Context, from, to SimpleExampleIndexKey, opts ...ormlist.Option) (SimpleExampleIterator, error) - DeleteBy(ctx context.Context, prefixKey SimpleExampleIndexKey) error - DeleteRange(ctx context.Context, from, to SimpleExampleIndexKey) error - - doNotImplement() -} - -type SimpleExampleIterator struct { - ormtable.Iterator -} - -func (i SimpleExampleIterator) Value() (*SimpleExample, error) { - var simpleExample SimpleExample - err := i.UnmarshalMessage(&simpleExample) - return &simpleExample, err -} - -type SimpleExampleIndexKey interface { - id() uint32 - values() []interface{} - simpleExampleIndexKey() -} - -// primary key starting index.. -type SimpleExamplePrimaryKey = SimpleExampleNameIndexKey - -type SimpleExampleNameIndexKey struct { - vs []interface{} -} - -func (x SimpleExampleNameIndexKey) id() uint32 { return 0 } -func (x SimpleExampleNameIndexKey) values() []interface{} { return x.vs } -func (x SimpleExampleNameIndexKey) simpleExampleIndexKey() {} - -func (this SimpleExampleNameIndexKey) WithName(name string) SimpleExampleNameIndexKey { - this.vs = []interface{}{name} - return this -} - -type SimpleExampleUniqueIndexKey struct { - vs []interface{} -} - -func (x SimpleExampleUniqueIndexKey) id() uint32 { return 1 } -func (x SimpleExampleUniqueIndexKey) values() []interface{} { return x.vs } -func (x SimpleExampleUniqueIndexKey) simpleExampleIndexKey() {} - -func (this SimpleExampleUniqueIndexKey) WithUnique(unique string) SimpleExampleUniqueIndexKey { - this.vs = []interface{}{unique} - return this -} - -type simpleExampleTable struct { - table ormtable.Table -} - -func (this simpleExampleTable) Insert(ctx context.Context, simpleExample *SimpleExample) error { - return this.table.Insert(ctx, simpleExample) -} - -func (this simpleExampleTable) Update(ctx context.Context, simpleExample *SimpleExample) error { - return this.table.Update(ctx, simpleExample) -} - -func (this simpleExampleTable) Save(ctx context.Context, simpleExample *SimpleExample) error { - return this.table.Save(ctx, simpleExample) -} - -func (this simpleExampleTable) Delete(ctx context.Context, simpleExample *SimpleExample) error { - return this.table.Delete(ctx, simpleExample) -} - -func (this simpleExampleTable) Has(ctx context.Context, name string) (found bool, err error) { - return this.table.PrimaryKey().Has(ctx, name) -} - -func (this simpleExampleTable) Get(ctx context.Context, name string) (*SimpleExample, error) { - var simpleExample SimpleExample - found, err := this.table.PrimaryKey().Get(ctx, &simpleExample, name) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &simpleExample, nil -} - -func (this simpleExampleTable) HasByUnique(ctx context.Context, unique string) (found bool, err error) { - return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx, - unique, - ) -} - -func (this simpleExampleTable) GetByUnique(ctx context.Context, unique string) (*SimpleExample, error) { - var simpleExample SimpleExample - found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &simpleExample, - unique, - ) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &simpleExample, nil -} - -func (this simpleExampleTable) List(ctx context.Context, prefixKey SimpleExampleIndexKey, opts ...ormlist.Option) (SimpleExampleIterator, error) { - it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) - return SimpleExampleIterator{it}, err -} - -func (this simpleExampleTable) ListRange(ctx context.Context, from, to SimpleExampleIndexKey, opts ...ormlist.Option) (SimpleExampleIterator, error) { - it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) - return SimpleExampleIterator{it}, err -} - -func (this simpleExampleTable) DeleteBy(ctx context.Context, prefixKey SimpleExampleIndexKey) error { - return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) -} - -func (this simpleExampleTable) DeleteRange(ctx context.Context, from, to SimpleExampleIndexKey) error { - return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) -} - -func (this simpleExampleTable) doNotImplement() {} - -var _ SimpleExampleTable = simpleExampleTable{} - -func NewSimpleExampleTable(db ormtable.Schema) (SimpleExampleTable, error) { - table := db.GetTable(&SimpleExample{}) - if table == nil { - return nil, ormerrors.TableNotFound.Wrap(string((&SimpleExample{}).ProtoReflect().Descriptor().FullName())) - } - return simpleExampleTable{table}, nil -} - -type ExampleAutoIncFieldNameTable interface { - Insert(ctx context.Context, exampleAutoIncFieldName *ExampleAutoIncFieldName) error - InsertReturningFoo(ctx context.Context, exampleAutoIncFieldName *ExampleAutoIncFieldName) (uint64, error) - LastInsertedSequence(ctx context.Context) (uint64, error) - Update(ctx context.Context, exampleAutoIncFieldName *ExampleAutoIncFieldName) error - Save(ctx context.Context, exampleAutoIncFieldName *ExampleAutoIncFieldName) error - Delete(ctx context.Context, exampleAutoIncFieldName *ExampleAutoIncFieldName) error - Has(ctx context.Context, foo uint64) (found bool, err error) - // Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - Get(ctx context.Context, foo uint64) (*ExampleAutoIncFieldName, error) - List(ctx context.Context, prefixKey ExampleAutoIncFieldNameIndexKey, opts ...ormlist.Option) (ExampleAutoIncFieldNameIterator, error) - ListRange(ctx context.Context, from, to ExampleAutoIncFieldNameIndexKey, opts ...ormlist.Option) (ExampleAutoIncFieldNameIterator, error) - DeleteBy(ctx context.Context, prefixKey ExampleAutoIncFieldNameIndexKey) error - DeleteRange(ctx context.Context, from, to ExampleAutoIncFieldNameIndexKey) error - - doNotImplement() -} - -type ExampleAutoIncFieldNameIterator struct { - ormtable.Iterator -} - -func (i ExampleAutoIncFieldNameIterator) Value() (*ExampleAutoIncFieldName, error) { - var exampleAutoIncFieldName ExampleAutoIncFieldName - err := i.UnmarshalMessage(&exampleAutoIncFieldName) - return &exampleAutoIncFieldName, err -} - -type ExampleAutoIncFieldNameIndexKey interface { - id() uint32 - values() []interface{} - exampleAutoIncFieldNameIndexKey() -} - -// primary key starting index.. -type ExampleAutoIncFieldNamePrimaryKey = ExampleAutoIncFieldNameFooIndexKey - -type ExampleAutoIncFieldNameFooIndexKey struct { - vs []interface{} -} - -func (x ExampleAutoIncFieldNameFooIndexKey) id() uint32 { return 0 } -func (x ExampleAutoIncFieldNameFooIndexKey) values() []interface{} { return x.vs } -func (x ExampleAutoIncFieldNameFooIndexKey) exampleAutoIncFieldNameIndexKey() {} - -func (this ExampleAutoIncFieldNameFooIndexKey) WithFoo(foo uint64) ExampleAutoIncFieldNameFooIndexKey { - this.vs = []interface{}{foo} - return this -} - -type exampleAutoIncFieldNameTable struct { - table ormtable.AutoIncrementTable -} - -func (this exampleAutoIncFieldNameTable) Insert(ctx context.Context, exampleAutoIncFieldName *ExampleAutoIncFieldName) error { - return this.table.Insert(ctx, exampleAutoIncFieldName) -} - -func (this exampleAutoIncFieldNameTable) Update(ctx context.Context, exampleAutoIncFieldName *ExampleAutoIncFieldName) error { - return this.table.Update(ctx, exampleAutoIncFieldName) -} - -func (this exampleAutoIncFieldNameTable) Save(ctx context.Context, exampleAutoIncFieldName *ExampleAutoIncFieldName) error { - return this.table.Save(ctx, exampleAutoIncFieldName) -} - -func (this exampleAutoIncFieldNameTable) Delete(ctx context.Context, exampleAutoIncFieldName *ExampleAutoIncFieldName) error { - return this.table.Delete(ctx, exampleAutoIncFieldName) -} - -func (this exampleAutoIncFieldNameTable) InsertReturningFoo(ctx context.Context, exampleAutoIncFieldName *ExampleAutoIncFieldName) (uint64, error) { - return this.table.InsertReturningPKey(ctx, exampleAutoIncFieldName) -} - -func (this exampleAutoIncFieldNameTable) LastInsertedSequence(ctx context.Context) (uint64, error) { - return this.table.LastInsertedSequence(ctx) -} - -func (this exampleAutoIncFieldNameTable) Has(ctx context.Context, foo uint64) (found bool, err error) { - return this.table.PrimaryKey().Has(ctx, foo) -} - -func (this exampleAutoIncFieldNameTable) Get(ctx context.Context, foo uint64) (*ExampleAutoIncFieldName, error) { - var exampleAutoIncFieldName ExampleAutoIncFieldName - found, err := this.table.PrimaryKey().Get(ctx, &exampleAutoIncFieldName, foo) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &exampleAutoIncFieldName, nil -} - -func (this exampleAutoIncFieldNameTable) List(ctx context.Context, prefixKey ExampleAutoIncFieldNameIndexKey, opts ...ormlist.Option) (ExampleAutoIncFieldNameIterator, error) { - it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) - return ExampleAutoIncFieldNameIterator{it}, err -} - -func (this exampleAutoIncFieldNameTable) ListRange(ctx context.Context, from, to ExampleAutoIncFieldNameIndexKey, opts ...ormlist.Option) (ExampleAutoIncFieldNameIterator, error) { - it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) - return ExampleAutoIncFieldNameIterator{it}, err -} - -func (this exampleAutoIncFieldNameTable) DeleteBy(ctx context.Context, prefixKey ExampleAutoIncFieldNameIndexKey) error { - return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) -} - -func (this exampleAutoIncFieldNameTable) DeleteRange(ctx context.Context, from, to ExampleAutoIncFieldNameIndexKey) error { - return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) -} - -func (this exampleAutoIncFieldNameTable) doNotImplement() {} - -var _ ExampleAutoIncFieldNameTable = exampleAutoIncFieldNameTable{} - -func NewExampleAutoIncFieldNameTable(db ormtable.Schema) (ExampleAutoIncFieldNameTable, error) { - table := db.GetTable(&ExampleAutoIncFieldName{}) - if table == nil { - return nil, ormerrors.TableNotFound.Wrap(string((&ExampleAutoIncFieldName{}).ProtoReflect().Descriptor().FullName())) - } - return exampleAutoIncFieldNameTable{table.(ormtable.AutoIncrementTable)}, nil -} - -type TestSchemaStore interface { - ExampleTableTable() ExampleTableTable - ExampleAutoIncrementTableTable() ExampleAutoIncrementTableTable - ExampleSingletonTable() ExampleSingletonTable - ExampleTimestampTable() ExampleTimestampTable - ExampleDurationTable() ExampleDurationTable - SimpleExampleTable() SimpleExampleTable - ExampleAutoIncFieldNameTable() ExampleAutoIncFieldNameTable - - doNotImplement() -} - -type testSchemaStore struct { - exampleTable ExampleTableTable - exampleAutoIncrementTable ExampleAutoIncrementTableTable - exampleSingleton ExampleSingletonTable - exampleTimestamp ExampleTimestampTable - exampleDuration ExampleDurationTable - simpleExample SimpleExampleTable - exampleAutoIncFieldName ExampleAutoIncFieldNameTable -} - -func (x testSchemaStore) ExampleTableTable() ExampleTableTable { - return x.exampleTable -} - -func (x testSchemaStore) ExampleAutoIncrementTableTable() ExampleAutoIncrementTableTable { - return x.exampleAutoIncrementTable -} - -func (x testSchemaStore) ExampleSingletonTable() ExampleSingletonTable { - return x.exampleSingleton -} - -func (x testSchemaStore) ExampleTimestampTable() ExampleTimestampTable { - return x.exampleTimestamp -} - -func (x testSchemaStore) ExampleDurationTable() ExampleDurationTable { - return x.exampleDuration -} - -func (x testSchemaStore) SimpleExampleTable() SimpleExampleTable { - return x.simpleExample -} - -func (x testSchemaStore) ExampleAutoIncFieldNameTable() ExampleAutoIncFieldNameTable { - return x.exampleAutoIncFieldName -} - -func (testSchemaStore) doNotImplement() {} - -var _ TestSchemaStore = testSchemaStore{} - -func NewTestSchemaStore(db ormtable.Schema) (TestSchemaStore, error) { - exampleTableTable, err := NewExampleTableTable(db) - if err != nil { - return nil, err - } - - exampleAutoIncrementTableTable, err := NewExampleAutoIncrementTableTable(db) - if err != nil { - return nil, err - } - - exampleSingletonTable, err := NewExampleSingletonTable(db) - if err != nil { - return nil, err - } - - exampleTimestampTable, err := NewExampleTimestampTable(db) - if err != nil { - return nil, err - } - - exampleDurationTable, err := NewExampleDurationTable(db) - if err != nil { - return nil, err - } - - simpleExampleTable, err := NewSimpleExampleTable(db) - if err != nil { - return nil, err - } - - exampleAutoIncFieldNameTable, err := NewExampleAutoIncFieldNameTable(db) - if err != nil { - return nil, err - } - - return testSchemaStore{ - exampleTableTable, - exampleAutoIncrementTableTable, - exampleSingletonTable, - exampleTimestampTable, - exampleDurationTable, - simpleExampleTable, - exampleAutoIncFieldNameTable, - }, nil -} diff --git a/orm/internal/testpb/test_schema.pb.go b/orm/internal/testpb/test_schema.pb.go deleted file mode 100644 index 79f8f8655356..000000000000 --- a/orm/internal/testpb/test_schema.pb.go +++ /dev/null @@ -1,999 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc (unknown) -// source: testpb/test_schema.proto - -package testpb - -import ( - _ "cosmossdk.io/api/cosmos/orm/v1" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - durationpb "google.golang.org/protobuf/types/known/durationpb" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Enum int32 - -const ( - Enum_ENUM_UNSPECIFIED Enum = 0 - Enum_ENUM_ONE Enum = 1 - Enum_ENUM_TWO Enum = 2 - Enum_ENUM_FIVE Enum = 5 - Enum_ENUM_NEG_THREE Enum = -3 -) - -// Enum value maps for Enum. -var ( - Enum_name = map[int32]string{ - 0: "ENUM_UNSPECIFIED", - 1: "ENUM_ONE", - 2: "ENUM_TWO", - 5: "ENUM_FIVE", - -3: "ENUM_NEG_THREE", - } - Enum_value = map[string]int32{ - "ENUM_UNSPECIFIED": 0, - "ENUM_ONE": 1, - "ENUM_TWO": 2, - "ENUM_FIVE": 5, - "ENUM_NEG_THREE": -3, - } -) - -func (x Enum) Enum() *Enum { - p := new(Enum) - *p = x - return p -} - -func (x Enum) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Enum) Descriptor() protoreflect.EnumDescriptor { - return file_testpb_test_schema_proto_enumTypes[0].Descriptor() -} - -func (Enum) Type() protoreflect.EnumType { - return &file_testpb_test_schema_proto_enumTypes[0] -} - -func (x Enum) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Enum.Descriptor instead. -func (Enum) EnumDescriptor() ([]byte, []int) { - return file_testpb_test_schema_proto_rawDescGZIP(), []int{0} -} - -type ExampleTable struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Valid key fields: - U32 uint32 `protobuf:"varint,1,opt,name=u32,proto3" json:"u32,omitempty"` - U64 uint64 `protobuf:"varint,2,opt,name=u64,proto3" json:"u64,omitempty"` - Str string `protobuf:"bytes,3,opt,name=str,proto3" json:"str,omitempty"` - Bz []byte `protobuf:"bytes,4,opt,name=bz,proto3" json:"bz,omitempty"` - Ts *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=ts,proto3" json:"ts,omitempty"` - Dur *durationpb.Duration `protobuf:"bytes,6,opt,name=dur,proto3" json:"dur,omitempty"` - I32 int32 `protobuf:"varint,7,opt,name=i32,proto3" json:"i32,omitempty"` - S32 int32 `protobuf:"zigzag32,8,opt,name=s32,proto3" json:"s32,omitempty"` - Sf32 int32 `protobuf:"fixed32,9,opt,name=sf32,proto3" json:"sf32,omitempty"` - I64 int64 `protobuf:"varint,10,opt,name=i64,proto3" json:"i64,omitempty"` - S64 int64 `protobuf:"zigzag64,11,opt,name=s64,proto3" json:"s64,omitempty"` - Sf64 int64 `protobuf:"fixed64,12,opt,name=sf64,proto3" json:"sf64,omitempty"` - F32 uint32 `protobuf:"fixed32,13,opt,name=f32,proto3" json:"f32,omitempty"` - F64 uint64 `protobuf:"fixed64,14,opt,name=f64,proto3" json:"f64,omitempty"` - B bool `protobuf:"varint,15,opt,name=b,proto3" json:"b,omitempty"` - E Enum `protobuf:"varint,16,opt,name=e,proto3,enum=testpb.Enum" json:"e,omitempty"` - // Invalid key fields: - Repeated []uint32 `protobuf:"varint,17,rep,packed,name=repeated,proto3" json:"repeated,omitempty"` - Map map[string]uint32 `protobuf:"bytes,18,rep,name=map,proto3" json:"map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - Msg *ExampleTable_ExampleMessage `protobuf:"bytes,19,opt,name=msg,proto3" json:"msg,omitempty"` - // Types that are assignable to Sum: - // - // *ExampleTable_Oneof - Sum isExampleTable_Sum `protobuf_oneof:"sum"` -} - -func (x *ExampleTable) Reset() { - *x = ExampleTable{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExampleTable) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExampleTable) ProtoMessage() {} - -func (x *ExampleTable) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ExampleTable.ProtoReflect.Descriptor instead. -func (*ExampleTable) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_proto_rawDescGZIP(), []int{0} -} - -func (x *ExampleTable) GetU32() uint32 { - if x != nil { - return x.U32 - } - return 0 -} - -func (x *ExampleTable) GetU64() uint64 { - if x != nil { - return x.U64 - } - return 0 -} - -func (x *ExampleTable) GetStr() string { - if x != nil { - return x.Str - } - return "" -} - -func (x *ExampleTable) GetBz() []byte { - if x != nil { - return x.Bz - } - return nil -} - -func (x *ExampleTable) GetTs() *timestamppb.Timestamp { - if x != nil { - return x.Ts - } - return nil -} - -func (x *ExampleTable) GetDur() *durationpb.Duration { - if x != nil { - return x.Dur - } - return nil -} - -func (x *ExampleTable) GetI32() int32 { - if x != nil { - return x.I32 - } - return 0 -} - -func (x *ExampleTable) GetS32() int32 { - if x != nil { - return x.S32 - } - return 0 -} - -func (x *ExampleTable) GetSf32() int32 { - if x != nil { - return x.Sf32 - } - return 0 -} - -func (x *ExampleTable) GetI64() int64 { - if x != nil { - return x.I64 - } - return 0 -} - -func (x *ExampleTable) GetS64() int64 { - if x != nil { - return x.S64 - } - return 0 -} - -func (x *ExampleTable) GetSf64() int64 { - if x != nil { - return x.Sf64 - } - return 0 -} - -func (x *ExampleTable) GetF32() uint32 { - if x != nil { - return x.F32 - } - return 0 -} - -func (x *ExampleTable) GetF64() uint64 { - if x != nil { - return x.F64 - } - return 0 -} - -func (x *ExampleTable) GetB() bool { - if x != nil { - return x.B - } - return false -} - -func (x *ExampleTable) GetE() Enum { - if x != nil { - return x.E - } - return Enum_ENUM_UNSPECIFIED -} - -func (x *ExampleTable) GetRepeated() []uint32 { - if x != nil { - return x.Repeated - } - return nil -} - -func (x *ExampleTable) GetMap() map[string]uint32 { - if x != nil { - return x.Map - } - return nil -} - -func (x *ExampleTable) GetMsg() *ExampleTable_ExampleMessage { - if x != nil { - return x.Msg - } - return nil -} - -func (m *ExampleTable) GetSum() isExampleTable_Sum { - if m != nil { - return m.Sum - } - return nil -} - -func (x *ExampleTable) GetOneof() uint32 { - if x, ok := x.GetSum().(*ExampleTable_Oneof); ok { - return x.Oneof - } - return 0 -} - -type isExampleTable_Sum interface { - isExampleTable_Sum() -} - -type ExampleTable_Oneof struct { - Oneof uint32 `protobuf:"varint,20,opt,name=oneof,proto3,oneof"` -} - -func (*ExampleTable_Oneof) isExampleTable_Sum() {} - -type ExampleAutoIncrementTable struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - X string `protobuf:"bytes,2,opt,name=x,proto3" json:"x,omitempty"` - Y int32 `protobuf:"varint,3,opt,name=y,proto3" json:"y,omitempty"` -} - -func (x *ExampleAutoIncrementTable) Reset() { - *x = ExampleAutoIncrementTable{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExampleAutoIncrementTable) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExampleAutoIncrementTable) ProtoMessage() {} - -func (x *ExampleAutoIncrementTable) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ExampleAutoIncrementTable.ProtoReflect.Descriptor instead. -func (*ExampleAutoIncrementTable) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_proto_rawDescGZIP(), []int{1} -} - -func (x *ExampleAutoIncrementTable) GetId() uint64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *ExampleAutoIncrementTable) GetX() string { - if x != nil { - return x.X - } - return "" -} - -func (x *ExampleAutoIncrementTable) GetY() int32 { - if x != nil { - return x.Y - } - return 0 -} - -type ExampleSingleton struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Foo string `protobuf:"bytes,1,opt,name=foo,proto3" json:"foo,omitempty"` - Bar int32 `protobuf:"varint,2,opt,name=bar,proto3" json:"bar,omitempty"` -} - -func (x *ExampleSingleton) Reset() { - *x = ExampleSingleton{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExampleSingleton) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExampleSingleton) ProtoMessage() {} - -func (x *ExampleSingleton) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ExampleSingleton.ProtoReflect.Descriptor instead. -func (*ExampleSingleton) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_proto_rawDescGZIP(), []int{2} -} - -func (x *ExampleSingleton) GetFoo() string { - if x != nil { - return x.Foo - } - return "" -} - -func (x *ExampleSingleton) GetBar() int32 { - if x != nil { - return x.Bar - } - return 0 -} - -type ExampleTimestamp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Ts *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=ts,proto3" json:"ts,omitempty"` -} - -func (x *ExampleTimestamp) Reset() { - *x = ExampleTimestamp{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExampleTimestamp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExampleTimestamp) ProtoMessage() {} - -func (x *ExampleTimestamp) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ExampleTimestamp.ProtoReflect.Descriptor instead. -func (*ExampleTimestamp) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_proto_rawDescGZIP(), []int{3} -} - -func (x *ExampleTimestamp) GetId() uint64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *ExampleTimestamp) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *ExampleTimestamp) GetTs() *timestamppb.Timestamp { - if x != nil { - return x.Ts - } - return nil -} - -type ExampleDuration struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Dur *durationpb.Duration `protobuf:"bytes,3,opt,name=dur,proto3" json:"dur,omitempty"` -} - -func (x *ExampleDuration) Reset() { - *x = ExampleDuration{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExampleDuration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExampleDuration) ProtoMessage() {} - -func (x *ExampleDuration) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ExampleDuration.ProtoReflect.Descriptor instead. -func (*ExampleDuration) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_proto_rawDescGZIP(), []int{4} -} - -func (x *ExampleDuration) GetId() uint64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *ExampleDuration) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *ExampleDuration) GetDur() *durationpb.Duration { - if x != nil { - return x.Dur - } - return nil -} - -type SimpleExample struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Unique string `protobuf:"bytes,2,opt,name=unique,proto3" json:"unique,omitempty"` - NotUnique string `protobuf:"bytes,3,opt,name=not_unique,json=notUnique,proto3" json:"not_unique,omitempty"` -} - -func (x *SimpleExample) Reset() { - *x = SimpleExample{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SimpleExample) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SimpleExample) ProtoMessage() {} - -func (x *SimpleExample) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SimpleExample.ProtoReflect.Descriptor instead. -func (*SimpleExample) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_proto_rawDescGZIP(), []int{5} -} - -func (x *SimpleExample) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *SimpleExample) GetUnique() string { - if x != nil { - return x.Unique - } - return "" -} - -func (x *SimpleExample) GetNotUnique() string { - if x != nil { - return x.NotUnique - } - return "" -} - -// ExampleAutoIncFieldName is a table for testing InsertReturning. -type ExampleAutoIncFieldName struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Foo uint64 `protobuf:"varint,1,opt,name=foo,proto3" json:"foo,omitempty"` - Bar uint64 `protobuf:"varint,2,opt,name=bar,proto3" json:"bar,omitempty"` -} - -func (x *ExampleAutoIncFieldName) Reset() { - *x = ExampleAutoIncFieldName{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExampleAutoIncFieldName) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExampleAutoIncFieldName) ProtoMessage() {} - -func (x *ExampleAutoIncFieldName) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_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) -} - -// Deprecated: Use ExampleAutoIncFieldName.ProtoReflect.Descriptor instead. -func (*ExampleAutoIncFieldName) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_proto_rawDescGZIP(), []int{6} -} - -func (x *ExampleAutoIncFieldName) GetFoo() uint64 { - if x != nil { - return x.Foo - } - return 0 -} - -func (x *ExampleAutoIncFieldName) GetBar() uint64 { - if x != nil { - return x.Bar - } - return 0 -} - -type ExampleTable_ExampleMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Foo string `protobuf:"bytes,1,opt,name=foo,proto3" json:"foo,omitempty"` - Bar int32 `protobuf:"varint,2,opt,name=bar,proto3" json:"bar,omitempty"` -} - -func (x *ExampleTable_ExampleMessage) Reset() { - *x = ExampleTable_ExampleMessage{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExampleTable_ExampleMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExampleTable_ExampleMessage) ProtoMessage() {} - -func (x *ExampleTable_ExampleMessage) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_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) -} - -// Deprecated: Use ExampleTable_ExampleMessage.ProtoReflect.Descriptor instead. -func (*ExampleTable_ExampleMessage) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_proto_rawDescGZIP(), []int{0, 1} -} - -func (x *ExampleTable_ExampleMessage) GetFoo() string { - if x != nil { - return x.Foo - } - return "" -} - -func (x *ExampleTable_ExampleMessage) GetBar() int32 { - if x != nil { - return x.Bar - } - return 0 -} - -var File_testpb_test_schema_proto protoreflect.FileDescriptor - -var file_testpb_test_schema_proto_rawDesc = []byte{ - 0x0a, 0x18, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x73, 0x63, - 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x74, 0x65, 0x73, 0x74, - 0x70, 0x62, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6f, 0x72, 0x6d, 0x2f, - 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbd, 0x05, 0x0a, - 0x0c, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x10, 0x0a, - 0x03, 0x75, 0x33, 0x32, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x75, 0x33, 0x32, 0x12, - 0x10, 0x0a, 0x03, 0x75, 0x36, 0x34, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x75, 0x36, - 0x34, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x74, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x73, 0x74, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x62, 0x7a, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x02, 0x62, 0x7a, 0x12, 0x2a, 0x0a, 0x02, 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x02, 0x74, 0x73, 0x12, - 0x2b, 0x0a, 0x03, 0x64, 0x75, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, - 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x03, 0x64, 0x75, 0x72, 0x12, 0x10, 0x0a, 0x03, - 0x69, 0x33, 0x32, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x69, 0x33, 0x32, 0x12, 0x10, - 0x0a, 0x03, 0x73, 0x33, 0x32, 0x18, 0x08, 0x20, 0x01, 0x28, 0x11, 0x52, 0x03, 0x73, 0x33, 0x32, - 0x12, 0x12, 0x0a, 0x04, 0x73, 0x66, 0x33, 0x32, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0f, 0x52, 0x04, - 0x73, 0x66, 0x33, 0x32, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x36, 0x34, 0x18, 0x0a, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x03, 0x69, 0x36, 0x34, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x36, 0x34, 0x18, 0x0b, 0x20, - 0x01, 0x28, 0x12, 0x52, 0x03, 0x73, 0x36, 0x34, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x66, 0x36, 0x34, - 0x18, 0x0c, 0x20, 0x01, 0x28, 0x10, 0x52, 0x04, 0x73, 0x66, 0x36, 0x34, 0x12, 0x10, 0x0a, 0x03, - 0x66, 0x33, 0x32, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x07, 0x52, 0x03, 0x66, 0x33, 0x32, 0x12, 0x10, - 0x0a, 0x03, 0x66, 0x36, 0x34, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x06, 0x52, 0x03, 0x66, 0x36, 0x34, - 0x12, 0x0c, 0x0a, 0x01, 0x62, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x01, 0x62, 0x12, 0x1a, - 0x0a, 0x01, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0c, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x70, 0x62, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x01, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, - 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x11, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x08, 0x72, 0x65, - 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x2f, 0x0a, 0x03, 0x6d, 0x61, 0x70, 0x18, 0x12, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x03, 0x6d, 0x61, 0x70, 0x12, 0x35, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x13, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, - 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x16, - 0x0a, 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, - 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x1a, 0x36, 0x0a, 0x08, 0x4d, 0x61, 0x70, 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, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x34, - 0x0a, 0x0e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x12, 0x10, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x66, - 0x6f, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x61, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x03, 0x62, 0x61, 0x72, 0x3a, 0x3f, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x39, 0x0a, 0x0d, 0x0a, 0x0b, - 0x75, 0x33, 0x32, 0x2c, 0x69, 0x36, 0x34, 0x2c, 0x73, 0x74, 0x72, 0x12, 0x0d, 0x0a, 0x07, 0x75, - 0x36, 0x34, 0x2c, 0x73, 0x74, 0x72, 0x10, 0x01, 0x18, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x73, 0x74, - 0x72, 0x2c, 0x75, 0x33, 0x32, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x62, 0x7a, 0x2c, 0x73, 0x74, - 0x72, 0x10, 0x03, 0x18, 0x01, 0x42, 0x05, 0x0a, 0x03, 0x73, 0x75, 0x6d, 0x22, 0x62, 0x0a, 0x19, - 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x72, 0x65, - 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x01, 0x79, 0x3a, 0x19, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x13, 0x0a, 0x06, 0x0a, - 0x02, 0x69, 0x64, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x01, 0x78, 0x10, 0x01, 0x18, 0x01, 0x18, 0x03, - 0x22, 0x40, 0x0a, 0x10, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, - 0x65, 0x74, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x66, 0x6f, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x61, 0x72, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x03, 0x62, 0x61, 0x72, 0x3a, 0x08, 0xfa, 0x9e, 0xd3, 0x8e, 0x03, 0x02, - 0x08, 0x02, 0x22, 0x7c, 0x0a, 0x10, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x02, 0x74, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x52, 0x02, 0x74, 0x73, 0x3a, 0x18, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x12, 0x0a, 0x06, - 0x0a, 0x02, 0x69, 0x64, 0x10, 0x01, 0x12, 0x06, 0x0a, 0x02, 0x74, 0x73, 0x10, 0x01, 0x18, 0x04, - 0x22, 0x7d, 0x0a, 0x0f, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2b, 0x0a, 0x03, 0x64, 0x75, 0x72, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x03, 0x64, 0x75, 0x72, 0x3a, 0x19, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x13, 0x0a, 0x06, 0x0a, 0x02, - 0x69, 0x64, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x64, 0x75, 0x72, 0x10, 0x01, 0x18, 0x04, 0x22, - 0x7a, 0x0a, 0x0d, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x12, 0x1d, 0x0a, 0x0a, - 0x6e, 0x6f, 0x74, 0x5f, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x6e, 0x6f, 0x74, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x3a, 0x1e, 0xf2, 0x9e, 0xd3, - 0x8e, 0x03, 0x18, 0x0a, 0x06, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0c, 0x0a, 0x06, 0x75, - 0x6e, 0x69, 0x71, 0x75, 0x65, 0x10, 0x01, 0x18, 0x01, 0x18, 0x05, 0x22, 0x50, 0x0a, 0x17, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x46, 0x69, 0x65, - 0x6c, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x03, 0x66, 0x6f, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x61, 0x72, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x62, 0x61, 0x72, 0x3a, 0x11, 0xf2, 0x9e, 0xd3, 0x8e, - 0x03, 0x0b, 0x0a, 0x07, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x10, 0x01, 0x18, 0x06, 0x2a, 0x64, 0x0a, - 0x04, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x14, 0x0a, 0x10, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x55, 0x4e, - 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x45, - 0x4e, 0x55, 0x4d, 0x5f, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x45, 0x4e, 0x55, - 0x4d, 0x5f, 0x54, 0x57, 0x4f, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x45, 0x4e, 0x55, 0x4d, 0x5f, - 0x46, 0x49, 0x56, 0x45, 0x10, 0x05, 0x12, 0x1b, 0x0a, 0x0e, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x4e, - 0x45, 0x47, 0x5f, 0x54, 0x48, 0x52, 0x45, 0x45, 0x10, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0x01, 0x42, 0x77, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, - 0x62, 0x42, 0x0f, 0x54, 0x65, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, - 0x69, 0x6f, 0x2f, 0x6f, 0x72, 0x6d, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, - 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x54, - 0x65, 0x73, 0x74, 0x70, 0x62, 0xca, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xe2, 0x02, - 0x12, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_testpb_test_schema_proto_rawDescOnce sync.Once - file_testpb_test_schema_proto_rawDescData = file_testpb_test_schema_proto_rawDesc -) - -func file_testpb_test_schema_proto_rawDescGZIP() []byte { - file_testpb_test_schema_proto_rawDescOnce.Do(func() { - file_testpb_test_schema_proto_rawDescData = protoimpl.X.CompressGZIP(file_testpb_test_schema_proto_rawDescData) - }) - return file_testpb_test_schema_proto_rawDescData -} - -var file_testpb_test_schema_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_testpb_test_schema_proto_msgTypes = make([]protoimpl.MessageInfo, 9) -var file_testpb_test_schema_proto_goTypes = []interface{}{ - (Enum)(0), // 0: testpb.Enum - (*ExampleTable)(nil), // 1: testpb.ExampleTable - (*ExampleAutoIncrementTable)(nil), // 2: testpb.ExampleAutoIncrementTable - (*ExampleSingleton)(nil), // 3: testpb.ExampleSingleton - (*ExampleTimestamp)(nil), // 4: testpb.ExampleTimestamp - (*ExampleDuration)(nil), // 5: testpb.ExampleDuration - (*SimpleExample)(nil), // 6: testpb.SimpleExample - (*ExampleAutoIncFieldName)(nil), // 7: testpb.ExampleAutoIncFieldName - nil, // 8: testpb.ExampleTable.MapEntry - (*ExampleTable_ExampleMessage)(nil), // 9: testpb.ExampleTable.ExampleMessage - (*timestamppb.Timestamp)(nil), // 10: google.protobuf.Timestamp - (*durationpb.Duration)(nil), // 11: google.protobuf.Duration -} -var file_testpb_test_schema_proto_depIdxs = []int32{ - 10, // 0: testpb.ExampleTable.ts:type_name -> google.protobuf.Timestamp - 11, // 1: testpb.ExampleTable.dur:type_name -> google.protobuf.Duration - 0, // 2: testpb.ExampleTable.e:type_name -> testpb.Enum - 8, // 3: testpb.ExampleTable.map:type_name -> testpb.ExampleTable.MapEntry - 9, // 4: testpb.ExampleTable.msg:type_name -> testpb.ExampleTable.ExampleMessage - 10, // 5: testpb.ExampleTimestamp.ts:type_name -> google.protobuf.Timestamp - 11, // 6: testpb.ExampleDuration.dur:type_name -> google.protobuf.Duration - 7, // [7:7] is the sub-list for method output_type - 7, // [7:7] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name -} - -func init() { file_testpb_test_schema_proto_init() } -func file_testpb_test_schema_proto_init() { - if File_testpb_test_schema_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_testpb_test_schema_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExampleTable); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExampleAutoIncrementTable); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExampleSingleton); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExampleTimestamp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExampleDuration); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SimpleExample); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExampleAutoIncFieldName); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExampleTable_ExampleMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_testpb_test_schema_proto_msgTypes[0].OneofWrappers = []interface{}{ - (*ExampleTable_Oneof)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_testpb_test_schema_proto_rawDesc, - NumEnums: 1, - NumMessages: 9, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_testpb_test_schema_proto_goTypes, - DependencyIndexes: file_testpb_test_schema_proto_depIdxs, - EnumInfos: file_testpb_test_schema_proto_enumTypes, - MessageInfos: file_testpb_test_schema_proto_msgTypes, - }.Build() - File_testpb_test_schema_proto = out.File - file_testpb_test_schema_proto_rawDesc = nil - file_testpb_test_schema_proto_goTypes = nil - file_testpb_test_schema_proto_depIdxs = nil -} diff --git a/orm/internal/testpb/test_schema.proto b/orm/internal/testpb/test_schema.proto deleted file mode 100644 index 3aed58319e3f..000000000000 --- a/orm/internal/testpb/test_schema.proto +++ /dev/null @@ -1,142 +0,0 @@ -syntax = "proto3"; - -package testpb; - -import "google/protobuf/timestamp.proto"; -import "google/protobuf/duration.proto"; -import "cosmos/orm/v1/orm.proto"; - -message ExampleTable { - // clang-format off - option (cosmos.orm.v1.table) = { - id: 1; - primary_key: { - fields: - "u32,i64,str" - } - index: { - id: - 1; - fields: - "u64,str" unique: true - } - index: { - id: - 2; - fields: - "str,u32" - } - index: { - id: - 3; - fields: - "bz,str" - } - }; -// clang-format on - -// Valid key fields: -uint32 u32 = 1; -uint64 u64 = 2; -string str = 3; -bytes bz = 4; -google.protobuf.Timestamp ts = 5; -google.protobuf.Duration dur = 6; -int32 i32 = 7; -sint32 s32 = 8; -sfixed32 sf32 = 9; -int64 i64 = 10; -sint64 s64 = 11; -sfixed64 sf64 = 12; -fixed32 f32 = 13; -fixed64 f64 = 14; -bool b = 15; -Enum e = 16; - -// Invalid key fields: -repeated uint32 repeated = 17; -map map = 18; -ExampleMessage msg = 19; -oneof sum { - uint32 oneof = 20; -} - -message ExampleMessage { - string foo = 1; - int32 bar = 2; -} -} - -enum Enum { - ENUM_UNSPECIFIED = 0; - ENUM_ONE = 1; - ENUM_TWO = 2; - ENUM_FIVE = 5; - ENUM_NEG_THREE = -3; -} - -message ExampleAutoIncrementTable { - option (cosmos.orm.v1.table) = { - id: 3 - primary_key: {fields: "id" auto_increment: true} - index: {id: 1 fields: "x" unique: true} - }; - - uint64 id = 1; - string x = 2; - int32 y = 3; -} - -message ExampleSingleton { - option (cosmos.orm.v1.singleton) = { - id: 2 - }; - string foo = 1; - int32 bar = 2; -} - -message ExampleTimestamp { - option (cosmos.orm.v1.table) = { - id: 4 - primary_key: {fields: "id" auto_increment: true} - index: {id: 1 fields: "ts"} - }; - - uint64 id = 1; - string name = 2; - google.protobuf.Timestamp ts = 3; -} - -message ExampleDuration { - option (cosmos.orm.v1.table) = { - id: 4 - primary_key: {fields: "id" auto_increment: true} - index: {id: 1 fields: "dur"} - }; - - uint64 id = 1; - string name = 2; - google.protobuf.Duration dur = 3; -} - -message SimpleExample { - option (cosmos.orm.v1.table) = { - id: 5 - primary_key: {fields: "name"} - index: {id: 1, fields: "unique", unique: true} - }; - - string name = 1; - string unique = 2; - string not_unique = 3; -} - -// ExampleAutoIncFieldName is a table for testing InsertReturning. -message ExampleAutoIncFieldName { - option (cosmos.orm.v1.table) = { - id: 6 - primary_key: {fields: "foo" auto_increment: true} - }; - uint64 foo = 1; - uint64 bar = 2; -} \ No newline at end of file diff --git a/orm/internal/testpb/test_schema_query.pb.go b/orm/internal/testpb/test_schema_query.pb.go deleted file mode 100644 index 48d7a1339a74..000000000000 --- a/orm/internal/testpb/test_schema_query.pb.go +++ /dev/null @@ -1,5036 +0,0 @@ -// Code generated by protoc-gen-go-cosmos-orm-proto. DO NOT EDIT. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc (unknown) -// source: testpb/test_schema_query.proto - -package testpb - -import ( - v1beta1 "cosmossdk.io/api/cosmos/base/query/v1beta1" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - durationpb "google.golang.org/protobuf/types/known/durationpb" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// GetExampleTableRequest is the TestSchemaQuery/GetExampleTableRequest request type. -type GetExampleTableRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // u32 specifies the value of the u32 field in the primary key. - U32 uint32 `protobuf:"varint,1,opt,name=u32,proto3" json:"u32,omitempty"` - // i64 specifies the value of the i64 field in the primary key. - I64 int64 `protobuf:"varint,2,opt,name=i64,proto3" json:"i64,omitempty"` - // str specifies the value of the str field in the primary key. - Str string `protobuf:"bytes,3,opt,name=str,proto3" json:"str,omitempty"` -} - -func (x *GetExampleTableRequest) Reset() { - *x = GetExampleTableRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetExampleTableRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExampleTableRequest) ProtoMessage() {} - -func (x *GetExampleTableRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetExampleTableRequest.ProtoReflect.Descriptor instead. -func (*GetExampleTableRequest) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{0} -} - -func (x *GetExampleTableRequest) GetU32() uint32 { - if x != nil { - return x.U32 - } - return 0 -} - -func (x *GetExampleTableRequest) GetI64() int64 { - if x != nil { - return x.I64 - } - return 0 -} - -func (x *GetExampleTableRequest) GetStr() string { - if x != nil { - return x.Str - } - return "" -} - -// GetExampleTableResponse is the TestSchemaQuery/GetExampleTableResponse response type. -type GetExampleTableResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // value is the response value. - Value *ExampleTable `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *GetExampleTableResponse) Reset() { - *x = GetExampleTableResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetExampleTableResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExampleTableResponse) ProtoMessage() {} - -func (x *GetExampleTableResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_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) -} - -// Deprecated: Use GetExampleTableResponse.ProtoReflect.Descriptor instead. -func (*GetExampleTableResponse) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{1} -} - -func (x *GetExampleTableResponse) GetValue() *ExampleTable { - if x != nil { - return x.Value - } - return nil -} - -// GetExampleTableByU64StrRequest is the TestSchemaQuery/GetExampleTableByU64StrRequest request type. -type GetExampleTableByU64StrRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - U64 uint64 `protobuf:"varint,1,opt,name=u64,proto3" json:"u64,omitempty"` - Str string `protobuf:"bytes,2,opt,name=str,proto3" json:"str,omitempty"` -} - -func (x *GetExampleTableByU64StrRequest) Reset() { - *x = GetExampleTableByU64StrRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetExampleTableByU64StrRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExampleTableByU64StrRequest) ProtoMessage() {} - -func (x *GetExampleTableByU64StrRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_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) -} - -// Deprecated: Use GetExampleTableByU64StrRequest.ProtoReflect.Descriptor instead. -func (*GetExampleTableByU64StrRequest) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{2} -} - -func (x *GetExampleTableByU64StrRequest) GetU64() uint64 { - if x != nil { - return x.U64 - } - return 0 -} - -func (x *GetExampleTableByU64StrRequest) GetStr() string { - if x != nil { - return x.Str - } - return "" -} - -// GetExampleTableByU64StrResponse is the TestSchemaQuery/GetExampleTableByU64StrResponse response type. -type GetExampleTableByU64StrResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value *ExampleTable `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *GetExampleTableByU64StrResponse) Reset() { - *x = GetExampleTableByU64StrResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetExampleTableByU64StrResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExampleTableByU64StrResponse) ProtoMessage() {} - -func (x *GetExampleTableByU64StrResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetExampleTableByU64StrResponse.ProtoReflect.Descriptor instead. -func (*GetExampleTableByU64StrResponse) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{3} -} - -func (x *GetExampleTableByU64StrResponse) GetValue() *ExampleTable { - if x != nil { - return x.Value - } - return nil -} - -// ListExampleTableRequest is the TestSchemaQuery/ListExampleTableRequest request type. -type ListExampleTableRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // query specifies the type of query - either a prefix or range query. - // - // Types that are assignable to Query: - // - // *ListExampleTableRequest_PrefixQuery - // *ListExampleTableRequest_RangeQuery_ - Query isListExampleTableRequest_Query `protobuf_oneof:"query"` - // pagination specifies optional pagination parameters. - Pagination *v1beta1.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *ListExampleTableRequest) Reset() { - *x = ListExampleTableRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleTableRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleTableRequest) ProtoMessage() {} - -func (x *ListExampleTableRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_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) -} - -// Deprecated: Use ListExampleTableRequest.ProtoReflect.Descriptor instead. -func (*ListExampleTableRequest) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{4} -} - -func (m *ListExampleTableRequest) GetQuery() isListExampleTableRequest_Query { - if m != nil { - return m.Query - } - return nil -} - -func (x *ListExampleTableRequest) GetPrefixQuery() *ListExampleTableRequest_IndexKey { - if x, ok := x.GetQuery().(*ListExampleTableRequest_PrefixQuery); ok { - return x.PrefixQuery - } - return nil -} - -func (x *ListExampleTableRequest) GetRangeQuery() *ListExampleTableRequest_RangeQuery { - if x, ok := x.GetQuery().(*ListExampleTableRequest_RangeQuery_); ok { - return x.RangeQuery - } - return nil -} - -func (x *ListExampleTableRequest) GetPagination() *v1beta1.PageRequest { - if x != nil { - return x.Pagination - } - return nil -} - -type isListExampleTableRequest_Query interface { - isListExampleTableRequest_Query() -} - -type ListExampleTableRequest_PrefixQuery struct { - // prefix_query specifies the index key value to use for the prefix query. - PrefixQuery *ListExampleTableRequest_IndexKey `protobuf:"bytes,1,opt,name=prefix_query,json=prefixQuery,proto3,oneof"` -} - -type ListExampleTableRequest_RangeQuery_ struct { - // range_query specifies the index key from/to values to use for the range query. - RangeQuery *ListExampleTableRequest_RangeQuery `protobuf:"bytes,2,opt,name=range_query,json=rangeQuery,proto3,oneof"` -} - -func (*ListExampleTableRequest_PrefixQuery) isListExampleTableRequest_Query() {} - -func (*ListExampleTableRequest_RangeQuery_) isListExampleTableRequest_Query() {} - -// ListExampleTableResponse is the TestSchemaQuery/ListExampleTableResponse response type. -type ListExampleTableResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // values are the results of the query. - Values []*ExampleTable `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` - // pagination is the pagination response. - Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *ListExampleTableResponse) Reset() { - *x = ListExampleTableResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleTableResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleTableResponse) ProtoMessage() {} - -func (x *ListExampleTableResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_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) -} - -// Deprecated: Use ListExampleTableResponse.ProtoReflect.Descriptor instead. -func (*ListExampleTableResponse) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{5} -} - -func (x *ListExampleTableResponse) GetValues() []*ExampleTable { - if x != nil { - return x.Values - } - return nil -} - -func (x *ListExampleTableResponse) GetPagination() *v1beta1.PageResponse { - if x != nil { - return x.Pagination - } - return nil -} - -// GetExampleAutoIncrementTableRequest is the TestSchemaQuery/GetExampleAutoIncrementTableRequest request type. -type GetExampleAutoIncrementTableRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // id specifies the value of the id field in the primary key. - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *GetExampleAutoIncrementTableRequest) Reset() { - *x = GetExampleAutoIncrementTableRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetExampleAutoIncrementTableRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExampleAutoIncrementTableRequest) ProtoMessage() {} - -func (x *GetExampleAutoIncrementTableRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetExampleAutoIncrementTableRequest.ProtoReflect.Descriptor instead. -func (*GetExampleAutoIncrementTableRequest) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{6} -} - -func (x *GetExampleAutoIncrementTableRequest) GetId() uint64 { - if x != nil { - return x.Id - } - return 0 -} - -// GetExampleAutoIncrementTableResponse is the TestSchemaQuery/GetExampleAutoIncrementTableResponse response type. -type GetExampleAutoIncrementTableResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // value is the response value. - Value *ExampleAutoIncrementTable `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *GetExampleAutoIncrementTableResponse) Reset() { - *x = GetExampleAutoIncrementTableResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetExampleAutoIncrementTableResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExampleAutoIncrementTableResponse) ProtoMessage() {} - -func (x *GetExampleAutoIncrementTableResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_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) -} - -// Deprecated: Use GetExampleAutoIncrementTableResponse.ProtoReflect.Descriptor instead. -func (*GetExampleAutoIncrementTableResponse) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{7} -} - -func (x *GetExampleAutoIncrementTableResponse) GetValue() *ExampleAutoIncrementTable { - if x != nil { - return x.Value - } - return nil -} - -// GetExampleAutoIncrementTableByXRequest is the TestSchemaQuery/GetExampleAutoIncrementTableByXRequest request type. -type GetExampleAutoIncrementTableByXRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - X string `protobuf:"bytes,1,opt,name=x,proto3" json:"x,omitempty"` -} - -func (x *GetExampleAutoIncrementTableByXRequest) Reset() { - *x = GetExampleAutoIncrementTableByXRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetExampleAutoIncrementTableByXRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExampleAutoIncrementTableByXRequest) ProtoMessage() {} - -func (x *GetExampleAutoIncrementTableByXRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_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) -} - -// Deprecated: Use GetExampleAutoIncrementTableByXRequest.ProtoReflect.Descriptor instead. -func (*GetExampleAutoIncrementTableByXRequest) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{8} -} - -func (x *GetExampleAutoIncrementTableByXRequest) GetX() string { - if x != nil { - return x.X - } - return "" -} - -// GetExampleAutoIncrementTableByXResponse is the TestSchemaQuery/GetExampleAutoIncrementTableByXResponse response type. -type GetExampleAutoIncrementTableByXResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value *ExampleAutoIncrementTable `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *GetExampleAutoIncrementTableByXResponse) Reset() { - *x = GetExampleAutoIncrementTableByXResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetExampleAutoIncrementTableByXResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExampleAutoIncrementTableByXResponse) ProtoMessage() {} - -func (x *GetExampleAutoIncrementTableByXResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_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) -} - -// Deprecated: Use GetExampleAutoIncrementTableByXResponse.ProtoReflect.Descriptor instead. -func (*GetExampleAutoIncrementTableByXResponse) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{9} -} - -func (x *GetExampleAutoIncrementTableByXResponse) GetValue() *ExampleAutoIncrementTable { - if x != nil { - return x.Value - } - return nil -} - -// ListExampleAutoIncrementTableRequest is the TestSchemaQuery/ListExampleAutoIncrementTableRequest request type. -type ListExampleAutoIncrementTableRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // query specifies the type of query - either a prefix or range query. - // - // Types that are assignable to Query: - // - // *ListExampleAutoIncrementTableRequest_PrefixQuery - // *ListExampleAutoIncrementTableRequest_RangeQuery_ - Query isListExampleAutoIncrementTableRequest_Query `protobuf_oneof:"query"` - // pagination specifies optional pagination parameters. - Pagination *v1beta1.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *ListExampleAutoIncrementTableRequest) Reset() { - *x = ListExampleAutoIncrementTableRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleAutoIncrementTableRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleAutoIncrementTableRequest) ProtoMessage() {} - -func (x *ListExampleAutoIncrementTableRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_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) -} - -// Deprecated: Use ListExampleAutoIncrementTableRequest.ProtoReflect.Descriptor instead. -func (*ListExampleAutoIncrementTableRequest) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{10} -} - -func (m *ListExampleAutoIncrementTableRequest) GetQuery() isListExampleAutoIncrementTableRequest_Query { - if m != nil { - return m.Query - } - return nil -} - -func (x *ListExampleAutoIncrementTableRequest) GetPrefixQuery() *ListExampleAutoIncrementTableRequest_IndexKey { - if x, ok := x.GetQuery().(*ListExampleAutoIncrementTableRequest_PrefixQuery); ok { - return x.PrefixQuery - } - return nil -} - -func (x *ListExampleAutoIncrementTableRequest) GetRangeQuery() *ListExampleAutoIncrementTableRequest_RangeQuery { - if x, ok := x.GetQuery().(*ListExampleAutoIncrementTableRequest_RangeQuery_); ok { - return x.RangeQuery - } - return nil -} - -func (x *ListExampleAutoIncrementTableRequest) GetPagination() *v1beta1.PageRequest { - if x != nil { - return x.Pagination - } - return nil -} - -type isListExampleAutoIncrementTableRequest_Query interface { - isListExampleAutoIncrementTableRequest_Query() -} - -type ListExampleAutoIncrementTableRequest_PrefixQuery struct { - // prefix_query specifies the index key value to use for the prefix query. - PrefixQuery *ListExampleAutoIncrementTableRequest_IndexKey `protobuf:"bytes,1,opt,name=prefix_query,json=prefixQuery,proto3,oneof"` -} - -type ListExampleAutoIncrementTableRequest_RangeQuery_ struct { - // range_query specifies the index key from/to values to use for the range query. - RangeQuery *ListExampleAutoIncrementTableRequest_RangeQuery `protobuf:"bytes,2,opt,name=range_query,json=rangeQuery,proto3,oneof"` -} - -func (*ListExampleAutoIncrementTableRequest_PrefixQuery) isListExampleAutoIncrementTableRequest_Query() { -} - -func (*ListExampleAutoIncrementTableRequest_RangeQuery_) isListExampleAutoIncrementTableRequest_Query() { -} - -// ListExampleAutoIncrementTableResponse is the TestSchemaQuery/ListExampleAutoIncrementTableResponse response type. -type ListExampleAutoIncrementTableResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // values are the results of the query. - Values []*ExampleAutoIncrementTable `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` - // pagination is the pagination response. - Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *ListExampleAutoIncrementTableResponse) Reset() { - *x = ListExampleAutoIncrementTableResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleAutoIncrementTableResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleAutoIncrementTableResponse) ProtoMessage() {} - -func (x *ListExampleAutoIncrementTableResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_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) -} - -// Deprecated: Use ListExampleAutoIncrementTableResponse.ProtoReflect.Descriptor instead. -func (*ListExampleAutoIncrementTableResponse) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{11} -} - -func (x *ListExampleAutoIncrementTableResponse) GetValues() []*ExampleAutoIncrementTable { - if x != nil { - return x.Values - } - return nil -} - -func (x *ListExampleAutoIncrementTableResponse) GetPagination() *v1beta1.PageResponse { - if x != nil { - return x.Pagination - } - return nil -} - -// GetExampleSingletonRequest is the TestSchemaQuery/GetExampleSingletonRequest request type. -type GetExampleSingletonRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *GetExampleSingletonRequest) Reset() { - *x = GetExampleSingletonRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetExampleSingletonRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExampleSingletonRequest) ProtoMessage() {} - -func (x *GetExampleSingletonRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_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) -} - -// Deprecated: Use GetExampleSingletonRequest.ProtoReflect.Descriptor instead. -func (*GetExampleSingletonRequest) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{12} -} - -// GetExampleSingletonResponse is the TestSchemaQuery/GetExampleSingletonResponse request type. -type GetExampleSingletonResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value *ExampleSingleton `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *GetExampleSingletonResponse) Reset() { - *x = GetExampleSingletonResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetExampleSingletonResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExampleSingletonResponse) ProtoMessage() {} - -func (x *GetExampleSingletonResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_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) -} - -// Deprecated: Use GetExampleSingletonResponse.ProtoReflect.Descriptor instead. -func (*GetExampleSingletonResponse) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{13} -} - -func (x *GetExampleSingletonResponse) GetValue() *ExampleSingleton { - if x != nil { - return x.Value - } - return nil -} - -// GetExampleTimestampRequest is the TestSchemaQuery/GetExampleTimestampRequest request type. -type GetExampleTimestampRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // id specifies the value of the id field in the primary key. - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *GetExampleTimestampRequest) Reset() { - *x = GetExampleTimestampRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetExampleTimestampRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExampleTimestampRequest) ProtoMessage() {} - -func (x *GetExampleTimestampRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetExampleTimestampRequest.ProtoReflect.Descriptor instead. -func (*GetExampleTimestampRequest) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{14} -} - -func (x *GetExampleTimestampRequest) GetId() uint64 { - if x != nil { - return x.Id - } - return 0 -} - -// GetExampleTimestampResponse is the TestSchemaQuery/GetExampleTimestampResponse response type. -type GetExampleTimestampResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // value is the response value. - Value *ExampleTimestamp `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *GetExampleTimestampResponse) Reset() { - *x = GetExampleTimestampResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetExampleTimestampResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExampleTimestampResponse) ProtoMessage() {} - -func (x *GetExampleTimestampResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetExampleTimestampResponse.ProtoReflect.Descriptor instead. -func (*GetExampleTimestampResponse) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{15} -} - -func (x *GetExampleTimestampResponse) GetValue() *ExampleTimestamp { - if x != nil { - return x.Value - } - return nil -} - -// ListExampleTimestampRequest is the TestSchemaQuery/ListExampleTimestampRequest request type. -type ListExampleTimestampRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // query specifies the type of query - either a prefix or range query. - // - // Types that are assignable to Query: - // - // *ListExampleTimestampRequest_PrefixQuery - // *ListExampleTimestampRequest_RangeQuery_ - Query isListExampleTimestampRequest_Query `protobuf_oneof:"query"` - // pagination specifies optional pagination parameters. - Pagination *v1beta1.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *ListExampleTimestampRequest) Reset() { - *x = ListExampleTimestampRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleTimestampRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleTimestampRequest) ProtoMessage() {} - -func (x *ListExampleTimestampRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleTimestampRequest.ProtoReflect.Descriptor instead. -func (*ListExampleTimestampRequest) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{16} -} - -func (m *ListExampleTimestampRequest) GetQuery() isListExampleTimestampRequest_Query { - if m != nil { - return m.Query - } - return nil -} - -func (x *ListExampleTimestampRequest) GetPrefixQuery() *ListExampleTimestampRequest_IndexKey { - if x, ok := x.GetQuery().(*ListExampleTimestampRequest_PrefixQuery); ok { - return x.PrefixQuery - } - return nil -} - -func (x *ListExampleTimestampRequest) GetRangeQuery() *ListExampleTimestampRequest_RangeQuery { - if x, ok := x.GetQuery().(*ListExampleTimestampRequest_RangeQuery_); ok { - return x.RangeQuery - } - return nil -} - -func (x *ListExampleTimestampRequest) GetPagination() *v1beta1.PageRequest { - if x != nil { - return x.Pagination - } - return nil -} - -type isListExampleTimestampRequest_Query interface { - isListExampleTimestampRequest_Query() -} - -type ListExampleTimestampRequest_PrefixQuery struct { - // prefix_query specifies the index key value to use for the prefix query. - PrefixQuery *ListExampleTimestampRequest_IndexKey `protobuf:"bytes,1,opt,name=prefix_query,json=prefixQuery,proto3,oneof"` -} - -type ListExampleTimestampRequest_RangeQuery_ struct { - // range_query specifies the index key from/to values to use for the range query. - RangeQuery *ListExampleTimestampRequest_RangeQuery `protobuf:"bytes,2,opt,name=range_query,json=rangeQuery,proto3,oneof"` -} - -func (*ListExampleTimestampRequest_PrefixQuery) isListExampleTimestampRequest_Query() {} - -func (*ListExampleTimestampRequest_RangeQuery_) isListExampleTimestampRequest_Query() {} - -// ListExampleTimestampResponse is the TestSchemaQuery/ListExampleTimestampResponse response type. -type ListExampleTimestampResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // values are the results of the query. - Values []*ExampleTimestamp `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` - // pagination is the pagination response. - Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *ListExampleTimestampResponse) Reset() { - *x = ListExampleTimestampResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleTimestampResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleTimestampResponse) ProtoMessage() {} - -func (x *ListExampleTimestampResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleTimestampResponse.ProtoReflect.Descriptor instead. -func (*ListExampleTimestampResponse) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{17} -} - -func (x *ListExampleTimestampResponse) GetValues() []*ExampleTimestamp { - if x != nil { - return x.Values - } - return nil -} - -func (x *ListExampleTimestampResponse) GetPagination() *v1beta1.PageResponse { - if x != nil { - return x.Pagination - } - return nil -} - -// GetExampleDurationRequest is the TestSchemaQuery/GetExampleDurationRequest request type. -type GetExampleDurationRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // id specifies the value of the id field in the primary key. - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *GetExampleDurationRequest) Reset() { - *x = GetExampleDurationRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetExampleDurationRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExampleDurationRequest) ProtoMessage() {} - -func (x *GetExampleDurationRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[18] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetExampleDurationRequest.ProtoReflect.Descriptor instead. -func (*GetExampleDurationRequest) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{18} -} - -func (x *GetExampleDurationRequest) GetId() uint64 { - if x != nil { - return x.Id - } - return 0 -} - -// GetExampleDurationResponse is the TestSchemaQuery/GetExampleDurationResponse response type. -type GetExampleDurationResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // value is the response value. - Value *ExampleDuration `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *GetExampleDurationResponse) Reset() { - *x = GetExampleDurationResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetExampleDurationResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExampleDurationResponse) ProtoMessage() {} - -func (x *GetExampleDurationResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[19] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetExampleDurationResponse.ProtoReflect.Descriptor instead. -func (*GetExampleDurationResponse) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{19} -} - -func (x *GetExampleDurationResponse) GetValue() *ExampleDuration { - if x != nil { - return x.Value - } - return nil -} - -// ListExampleDurationRequest is the TestSchemaQuery/ListExampleDurationRequest request type. -type ListExampleDurationRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // query specifies the type of query - either a prefix or range query. - // - // Types that are assignable to Query: - // - // *ListExampleDurationRequest_PrefixQuery - // *ListExampleDurationRequest_RangeQuery_ - Query isListExampleDurationRequest_Query `protobuf_oneof:"query"` - // pagination specifies optional pagination parameters. - Pagination *v1beta1.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *ListExampleDurationRequest) Reset() { - *x = ListExampleDurationRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleDurationRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleDurationRequest) ProtoMessage() {} - -func (x *ListExampleDurationRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[20] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleDurationRequest.ProtoReflect.Descriptor instead. -func (*ListExampleDurationRequest) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{20} -} - -func (m *ListExampleDurationRequest) GetQuery() isListExampleDurationRequest_Query { - if m != nil { - return m.Query - } - return nil -} - -func (x *ListExampleDurationRequest) GetPrefixQuery() *ListExampleDurationRequest_IndexKey { - if x, ok := x.GetQuery().(*ListExampleDurationRequest_PrefixQuery); ok { - return x.PrefixQuery - } - return nil -} - -func (x *ListExampleDurationRequest) GetRangeQuery() *ListExampleDurationRequest_RangeQuery { - if x, ok := x.GetQuery().(*ListExampleDurationRequest_RangeQuery_); ok { - return x.RangeQuery - } - return nil -} - -func (x *ListExampleDurationRequest) GetPagination() *v1beta1.PageRequest { - if x != nil { - return x.Pagination - } - return nil -} - -type isListExampleDurationRequest_Query interface { - isListExampleDurationRequest_Query() -} - -type ListExampleDurationRequest_PrefixQuery struct { - // prefix_query specifies the index key value to use for the prefix query. - PrefixQuery *ListExampleDurationRequest_IndexKey `protobuf:"bytes,1,opt,name=prefix_query,json=prefixQuery,proto3,oneof"` -} - -type ListExampleDurationRequest_RangeQuery_ struct { - // range_query specifies the index key from/to values to use for the range query. - RangeQuery *ListExampleDurationRequest_RangeQuery `protobuf:"bytes,2,opt,name=range_query,json=rangeQuery,proto3,oneof"` -} - -func (*ListExampleDurationRequest_PrefixQuery) isListExampleDurationRequest_Query() {} - -func (*ListExampleDurationRequest_RangeQuery_) isListExampleDurationRequest_Query() {} - -// ListExampleDurationResponse is the TestSchemaQuery/ListExampleDurationResponse response type. -type ListExampleDurationResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // values are the results of the query. - Values []*ExampleDuration `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` - // pagination is the pagination response. - Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *ListExampleDurationResponse) Reset() { - *x = ListExampleDurationResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleDurationResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleDurationResponse) ProtoMessage() {} - -func (x *ListExampleDurationResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[21] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleDurationResponse.ProtoReflect.Descriptor instead. -func (*ListExampleDurationResponse) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{21} -} - -func (x *ListExampleDurationResponse) GetValues() []*ExampleDuration { - if x != nil { - return x.Values - } - return nil -} - -func (x *ListExampleDurationResponse) GetPagination() *v1beta1.PageResponse { - if x != nil { - return x.Pagination - } - return nil -} - -// GetSimpleExampleRequest is the TestSchemaQuery/GetSimpleExampleRequest request type. -type GetSimpleExampleRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // name specifies the value of the name field in the primary key. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *GetSimpleExampleRequest) Reset() { - *x = GetSimpleExampleRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetSimpleExampleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSimpleExampleRequest) ProtoMessage() {} - -func (x *GetSimpleExampleRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[22] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetSimpleExampleRequest.ProtoReflect.Descriptor instead. -func (*GetSimpleExampleRequest) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{22} -} - -func (x *GetSimpleExampleRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -// GetSimpleExampleResponse is the TestSchemaQuery/GetSimpleExampleResponse response type. -type GetSimpleExampleResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // value is the response value. - Value *SimpleExample `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *GetSimpleExampleResponse) Reset() { - *x = GetSimpleExampleResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetSimpleExampleResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSimpleExampleResponse) ProtoMessage() {} - -func (x *GetSimpleExampleResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[23] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetSimpleExampleResponse.ProtoReflect.Descriptor instead. -func (*GetSimpleExampleResponse) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{23} -} - -func (x *GetSimpleExampleResponse) GetValue() *SimpleExample { - if x != nil { - return x.Value - } - return nil -} - -// GetSimpleExampleByUniqueRequest is the TestSchemaQuery/GetSimpleExampleByUniqueRequest request type. -type GetSimpleExampleByUniqueRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Unique string `protobuf:"bytes,1,opt,name=unique,proto3" json:"unique,omitempty"` -} - -func (x *GetSimpleExampleByUniqueRequest) Reset() { - *x = GetSimpleExampleByUniqueRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetSimpleExampleByUniqueRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSimpleExampleByUniqueRequest) ProtoMessage() {} - -func (x *GetSimpleExampleByUniqueRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[24] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetSimpleExampleByUniqueRequest.ProtoReflect.Descriptor instead. -func (*GetSimpleExampleByUniqueRequest) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{24} -} - -func (x *GetSimpleExampleByUniqueRequest) GetUnique() string { - if x != nil { - return x.Unique - } - return "" -} - -// GetSimpleExampleByUniqueResponse is the TestSchemaQuery/GetSimpleExampleByUniqueResponse response type. -type GetSimpleExampleByUniqueResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value *SimpleExample `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *GetSimpleExampleByUniqueResponse) Reset() { - *x = GetSimpleExampleByUniqueResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetSimpleExampleByUniqueResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSimpleExampleByUniqueResponse) ProtoMessage() {} - -func (x *GetSimpleExampleByUniqueResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[25] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetSimpleExampleByUniqueResponse.ProtoReflect.Descriptor instead. -func (*GetSimpleExampleByUniqueResponse) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{25} -} - -func (x *GetSimpleExampleByUniqueResponse) GetValue() *SimpleExample { - if x != nil { - return x.Value - } - return nil -} - -// ListSimpleExampleRequest is the TestSchemaQuery/ListSimpleExampleRequest request type. -type ListSimpleExampleRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // query specifies the type of query - either a prefix or range query. - // - // Types that are assignable to Query: - // - // *ListSimpleExampleRequest_PrefixQuery - // *ListSimpleExampleRequest_RangeQuery_ - Query isListSimpleExampleRequest_Query `protobuf_oneof:"query"` - // pagination specifies optional pagination parameters. - Pagination *v1beta1.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *ListSimpleExampleRequest) Reset() { - *x = ListSimpleExampleRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListSimpleExampleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListSimpleExampleRequest) ProtoMessage() {} - -func (x *ListSimpleExampleRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[26] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListSimpleExampleRequest.ProtoReflect.Descriptor instead. -func (*ListSimpleExampleRequest) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{26} -} - -func (m *ListSimpleExampleRequest) GetQuery() isListSimpleExampleRequest_Query { - if m != nil { - return m.Query - } - return nil -} - -func (x *ListSimpleExampleRequest) GetPrefixQuery() *ListSimpleExampleRequest_IndexKey { - if x, ok := x.GetQuery().(*ListSimpleExampleRequest_PrefixQuery); ok { - return x.PrefixQuery - } - return nil -} - -func (x *ListSimpleExampleRequest) GetRangeQuery() *ListSimpleExampleRequest_RangeQuery { - if x, ok := x.GetQuery().(*ListSimpleExampleRequest_RangeQuery_); ok { - return x.RangeQuery - } - return nil -} - -func (x *ListSimpleExampleRequest) GetPagination() *v1beta1.PageRequest { - if x != nil { - return x.Pagination - } - return nil -} - -type isListSimpleExampleRequest_Query interface { - isListSimpleExampleRequest_Query() -} - -type ListSimpleExampleRequest_PrefixQuery struct { - // prefix_query specifies the index key value to use for the prefix query. - PrefixQuery *ListSimpleExampleRequest_IndexKey `protobuf:"bytes,1,opt,name=prefix_query,json=prefixQuery,proto3,oneof"` -} - -type ListSimpleExampleRequest_RangeQuery_ struct { - // range_query specifies the index key from/to values to use for the range query. - RangeQuery *ListSimpleExampleRequest_RangeQuery `protobuf:"bytes,2,opt,name=range_query,json=rangeQuery,proto3,oneof"` -} - -func (*ListSimpleExampleRequest_PrefixQuery) isListSimpleExampleRequest_Query() {} - -func (*ListSimpleExampleRequest_RangeQuery_) isListSimpleExampleRequest_Query() {} - -// ListSimpleExampleResponse is the TestSchemaQuery/ListSimpleExampleResponse response type. -type ListSimpleExampleResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // values are the results of the query. - Values []*SimpleExample `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` - // pagination is the pagination response. - Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *ListSimpleExampleResponse) Reset() { - *x = ListSimpleExampleResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListSimpleExampleResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListSimpleExampleResponse) ProtoMessage() {} - -func (x *ListSimpleExampleResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[27] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListSimpleExampleResponse.ProtoReflect.Descriptor instead. -func (*ListSimpleExampleResponse) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{27} -} - -func (x *ListSimpleExampleResponse) GetValues() []*SimpleExample { - if x != nil { - return x.Values - } - return nil -} - -func (x *ListSimpleExampleResponse) GetPagination() *v1beta1.PageResponse { - if x != nil { - return x.Pagination - } - return nil -} - -// GetExampleAutoIncFieldNameRequest is the TestSchemaQuery/GetExampleAutoIncFieldNameRequest request type. -type GetExampleAutoIncFieldNameRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // foo specifies the value of the foo field in the primary key. - Foo uint64 `protobuf:"varint,1,opt,name=foo,proto3" json:"foo,omitempty"` -} - -func (x *GetExampleAutoIncFieldNameRequest) Reset() { - *x = GetExampleAutoIncFieldNameRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetExampleAutoIncFieldNameRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExampleAutoIncFieldNameRequest) ProtoMessage() {} - -func (x *GetExampleAutoIncFieldNameRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[28] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetExampleAutoIncFieldNameRequest.ProtoReflect.Descriptor instead. -func (*GetExampleAutoIncFieldNameRequest) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{28} -} - -func (x *GetExampleAutoIncFieldNameRequest) GetFoo() uint64 { - if x != nil { - return x.Foo - } - return 0 -} - -// GetExampleAutoIncFieldNameResponse is the TestSchemaQuery/GetExampleAutoIncFieldNameResponse response type. -type GetExampleAutoIncFieldNameResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // value is the response value. - Value *ExampleAutoIncFieldName `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *GetExampleAutoIncFieldNameResponse) Reset() { - *x = GetExampleAutoIncFieldNameResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[29] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetExampleAutoIncFieldNameResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExampleAutoIncFieldNameResponse) ProtoMessage() {} - -func (x *GetExampleAutoIncFieldNameResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[29] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetExampleAutoIncFieldNameResponse.ProtoReflect.Descriptor instead. -func (*GetExampleAutoIncFieldNameResponse) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{29} -} - -func (x *GetExampleAutoIncFieldNameResponse) GetValue() *ExampleAutoIncFieldName { - if x != nil { - return x.Value - } - return nil -} - -// ListExampleAutoIncFieldNameRequest is the TestSchemaQuery/ListExampleAutoIncFieldNameRequest request type. -type ListExampleAutoIncFieldNameRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // query specifies the type of query - either a prefix or range query. - // - // Types that are assignable to Query: - // - // *ListExampleAutoIncFieldNameRequest_PrefixQuery - // *ListExampleAutoIncFieldNameRequest_RangeQuery_ - Query isListExampleAutoIncFieldNameRequest_Query `protobuf_oneof:"query"` - // pagination specifies optional pagination parameters. - Pagination *v1beta1.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *ListExampleAutoIncFieldNameRequest) Reset() { - *x = ListExampleAutoIncFieldNameRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[30] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleAutoIncFieldNameRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleAutoIncFieldNameRequest) ProtoMessage() {} - -func (x *ListExampleAutoIncFieldNameRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[30] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleAutoIncFieldNameRequest.ProtoReflect.Descriptor instead. -func (*ListExampleAutoIncFieldNameRequest) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{30} -} - -func (m *ListExampleAutoIncFieldNameRequest) GetQuery() isListExampleAutoIncFieldNameRequest_Query { - if m != nil { - return m.Query - } - return nil -} - -func (x *ListExampleAutoIncFieldNameRequest) GetPrefixQuery() *ListExampleAutoIncFieldNameRequest_IndexKey { - if x, ok := x.GetQuery().(*ListExampleAutoIncFieldNameRequest_PrefixQuery); ok { - return x.PrefixQuery - } - return nil -} - -func (x *ListExampleAutoIncFieldNameRequest) GetRangeQuery() *ListExampleAutoIncFieldNameRequest_RangeQuery { - if x, ok := x.GetQuery().(*ListExampleAutoIncFieldNameRequest_RangeQuery_); ok { - return x.RangeQuery - } - return nil -} - -func (x *ListExampleAutoIncFieldNameRequest) GetPagination() *v1beta1.PageRequest { - if x != nil { - return x.Pagination - } - return nil -} - -type isListExampleAutoIncFieldNameRequest_Query interface { - isListExampleAutoIncFieldNameRequest_Query() -} - -type ListExampleAutoIncFieldNameRequest_PrefixQuery struct { - // prefix_query specifies the index key value to use for the prefix query. - PrefixQuery *ListExampleAutoIncFieldNameRequest_IndexKey `protobuf:"bytes,1,opt,name=prefix_query,json=prefixQuery,proto3,oneof"` -} - -type ListExampleAutoIncFieldNameRequest_RangeQuery_ struct { - // range_query specifies the index key from/to values to use for the range query. - RangeQuery *ListExampleAutoIncFieldNameRequest_RangeQuery `protobuf:"bytes,2,opt,name=range_query,json=rangeQuery,proto3,oneof"` -} - -func (*ListExampleAutoIncFieldNameRequest_PrefixQuery) isListExampleAutoIncFieldNameRequest_Query() {} - -func (*ListExampleAutoIncFieldNameRequest_RangeQuery_) isListExampleAutoIncFieldNameRequest_Query() {} - -// ListExampleAutoIncFieldNameResponse is the TestSchemaQuery/ListExampleAutoIncFieldNameResponse response type. -type ListExampleAutoIncFieldNameResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // values are the results of the query. - Values []*ExampleAutoIncFieldName `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` - // pagination is the pagination response. - Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *ListExampleAutoIncFieldNameResponse) Reset() { - *x = ListExampleAutoIncFieldNameResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[31] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleAutoIncFieldNameResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleAutoIncFieldNameResponse) ProtoMessage() {} - -func (x *ListExampleAutoIncFieldNameResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[31] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleAutoIncFieldNameResponse.ProtoReflect.Descriptor instead. -func (*ListExampleAutoIncFieldNameResponse) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{31} -} - -func (x *ListExampleAutoIncFieldNameResponse) GetValues() []*ExampleAutoIncFieldName { - if x != nil { - return x.Values - } - return nil -} - -func (x *ListExampleAutoIncFieldNameResponse) GetPagination() *v1beta1.PageResponse { - if x != nil { - return x.Pagination - } - return nil -} - -// IndexKey specifies the value of an index key to use in prefix and range queries. -type ListExampleTableRequest_IndexKey struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // key specifies the index key value. - // - // Types that are assignable to Key: - // - // *ListExampleTableRequest_IndexKey_U_32I_64Str - // *ListExampleTableRequest_IndexKey_U_64Str - // *ListExampleTableRequest_IndexKey_StrU_32 - // *ListExampleTableRequest_IndexKey_BzStr_ - Key isListExampleTableRequest_IndexKey_Key `protobuf_oneof:"key"` -} - -func (x *ListExampleTableRequest_IndexKey) Reset() { - *x = ListExampleTableRequest_IndexKey{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[32] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleTableRequest_IndexKey) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleTableRequest_IndexKey) ProtoMessage() {} - -func (x *ListExampleTableRequest_IndexKey) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[32] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleTableRequest_IndexKey.ProtoReflect.Descriptor instead. -func (*ListExampleTableRequest_IndexKey) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{4, 0} -} - -func (m *ListExampleTableRequest_IndexKey) GetKey() isListExampleTableRequest_IndexKey_Key { - if m != nil { - return m.Key - } - return nil -} - -func (x *ListExampleTableRequest_IndexKey) GetU_32I_64Str() *ListExampleTableRequest_IndexKey_U32I64Str { - if x, ok := x.GetKey().(*ListExampleTableRequest_IndexKey_U_32I_64Str); ok { - return x.U_32I_64Str - } - return nil -} - -func (x *ListExampleTableRequest_IndexKey) GetU_64Str() *ListExampleTableRequest_IndexKey_U64Str { - if x, ok := x.GetKey().(*ListExampleTableRequest_IndexKey_U_64Str); ok { - return x.U_64Str - } - return nil -} - -func (x *ListExampleTableRequest_IndexKey) GetStrU_32() *ListExampleTableRequest_IndexKey_StrU32 { - if x, ok := x.GetKey().(*ListExampleTableRequest_IndexKey_StrU_32); ok { - return x.StrU_32 - } - return nil -} - -func (x *ListExampleTableRequest_IndexKey) GetBzStr() *ListExampleTableRequest_IndexKey_BzStr { - if x, ok := x.GetKey().(*ListExampleTableRequest_IndexKey_BzStr_); ok { - return x.BzStr - } - return nil -} - -type isListExampleTableRequest_IndexKey_Key interface { - isListExampleTableRequest_IndexKey_Key() -} - -type ListExampleTableRequest_IndexKey_U_32I_64Str struct { - // u_32_i_64_str specifies the value of the U32I64Str index key to use in the query. - U_32I_64Str *ListExampleTableRequest_IndexKey_U32I64Str `protobuf:"bytes,1,opt,name=u_32_i_64_str,json=u32I64Str,proto3,oneof"` -} - -type ListExampleTableRequest_IndexKey_U_64Str struct { - // u_64_str specifies the value of the U64Str index key to use in the query. - U_64Str *ListExampleTableRequest_IndexKey_U64Str `protobuf:"bytes,2,opt,name=u_64_str,json=u64Str,proto3,oneof"` -} - -type ListExampleTableRequest_IndexKey_StrU_32 struct { - // str_u_32 specifies the value of the StrU32 index key to use in the query. - StrU_32 *ListExampleTableRequest_IndexKey_StrU32 `protobuf:"bytes,3,opt,name=str_u_32,json=strU32,proto3,oneof"` -} - -type ListExampleTableRequest_IndexKey_BzStr_ struct { - // bz_str specifies the value of the BzStr index key to use in the query. - BzStr *ListExampleTableRequest_IndexKey_BzStr `protobuf:"bytes,4,opt,name=bz_str,json=bzStr,proto3,oneof"` -} - -func (*ListExampleTableRequest_IndexKey_U_32I_64Str) isListExampleTableRequest_IndexKey_Key() {} - -func (*ListExampleTableRequest_IndexKey_U_64Str) isListExampleTableRequest_IndexKey_Key() {} - -func (*ListExampleTableRequest_IndexKey_StrU_32) isListExampleTableRequest_IndexKey_Key() {} - -func (*ListExampleTableRequest_IndexKey_BzStr_) isListExampleTableRequest_IndexKey_Key() {} - -// RangeQuery specifies the from/to index keys for a range query. -type ListExampleTableRequest_RangeQuery struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // from is the index key to use for the start of the range query. - // To query from the start of an index, specify an index key for that index with empty values. - From *ListExampleTableRequest_IndexKey `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` - // to is the index key to use for the end of the range query. - // The index key type MUST be the same as the index key type used for from. - // To query from to the end of an index it can be omitted. - To *ListExampleTableRequest_IndexKey `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` -} - -func (x *ListExampleTableRequest_RangeQuery) Reset() { - *x = ListExampleTableRequest_RangeQuery{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[33] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleTableRequest_RangeQuery) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleTableRequest_RangeQuery) ProtoMessage() {} - -func (x *ListExampleTableRequest_RangeQuery) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[33] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleTableRequest_RangeQuery.ProtoReflect.Descriptor instead. -func (*ListExampleTableRequest_RangeQuery) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{4, 1} -} - -func (x *ListExampleTableRequest_RangeQuery) GetFrom() *ListExampleTableRequest_IndexKey { - if x != nil { - return x.From - } - return nil -} - -func (x *ListExampleTableRequest_RangeQuery) GetTo() *ListExampleTableRequest_IndexKey { - if x != nil { - return x.To - } - return nil -} - -type ListExampleTableRequest_IndexKey_U32I64Str struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // u32 is the value of the u32 field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - U32 *uint32 `protobuf:"varint,1,opt,name=u32,proto3,oneof" json:"u32,omitempty"` - // i64 is the value of the i64 field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - I64 *int64 `protobuf:"varint,2,opt,name=i64,proto3,oneof" json:"i64,omitempty"` - // str is the value of the str field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - Str *string `protobuf:"bytes,3,opt,name=str,proto3,oneof" json:"str,omitempty"` -} - -func (x *ListExampleTableRequest_IndexKey_U32I64Str) Reset() { - *x = ListExampleTableRequest_IndexKey_U32I64Str{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[34] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleTableRequest_IndexKey_U32I64Str) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleTableRequest_IndexKey_U32I64Str) ProtoMessage() {} - -func (x *ListExampleTableRequest_IndexKey_U32I64Str) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[34] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleTableRequest_IndexKey_U32I64Str.ProtoReflect.Descriptor instead. -func (*ListExampleTableRequest_IndexKey_U32I64Str) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{4, 0, 0} -} - -func (x *ListExampleTableRequest_IndexKey_U32I64Str) GetU32() uint32 { - if x != nil && x.U32 != nil { - return *x.U32 - } - return 0 -} - -func (x *ListExampleTableRequest_IndexKey_U32I64Str) GetI64() int64 { - if x != nil && x.I64 != nil { - return *x.I64 - } - return 0 -} - -func (x *ListExampleTableRequest_IndexKey_U32I64Str) GetStr() string { - if x != nil && x.Str != nil { - return *x.Str - } - return "" -} - -type ListExampleTableRequest_IndexKey_U64Str struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // u64 is the value of the u64 field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - U64 *uint64 `protobuf:"varint,1,opt,name=u64,proto3,oneof" json:"u64,omitempty"` - // str is the value of the str field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - Str *string `protobuf:"bytes,2,opt,name=str,proto3,oneof" json:"str,omitempty"` -} - -func (x *ListExampleTableRequest_IndexKey_U64Str) Reset() { - *x = ListExampleTableRequest_IndexKey_U64Str{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[35] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleTableRequest_IndexKey_U64Str) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleTableRequest_IndexKey_U64Str) ProtoMessage() {} - -func (x *ListExampleTableRequest_IndexKey_U64Str) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[35] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleTableRequest_IndexKey_U64Str.ProtoReflect.Descriptor instead. -func (*ListExampleTableRequest_IndexKey_U64Str) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{4, 0, 1} -} - -func (x *ListExampleTableRequest_IndexKey_U64Str) GetU64() uint64 { - if x != nil && x.U64 != nil { - return *x.U64 - } - return 0 -} - -func (x *ListExampleTableRequest_IndexKey_U64Str) GetStr() string { - if x != nil && x.Str != nil { - return *x.Str - } - return "" -} - -type ListExampleTableRequest_IndexKey_StrU32 struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // str is the value of the str field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - Str *string `protobuf:"bytes,1,opt,name=str,proto3,oneof" json:"str,omitempty"` - // u32 is the value of the u32 field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - U32 *uint32 `protobuf:"varint,2,opt,name=u32,proto3,oneof" json:"u32,omitempty"` -} - -func (x *ListExampleTableRequest_IndexKey_StrU32) Reset() { - *x = ListExampleTableRequest_IndexKey_StrU32{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[36] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleTableRequest_IndexKey_StrU32) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleTableRequest_IndexKey_StrU32) ProtoMessage() {} - -func (x *ListExampleTableRequest_IndexKey_StrU32) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[36] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleTableRequest_IndexKey_StrU32.ProtoReflect.Descriptor instead. -func (*ListExampleTableRequest_IndexKey_StrU32) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{4, 0, 2} -} - -func (x *ListExampleTableRequest_IndexKey_StrU32) GetStr() string { - if x != nil && x.Str != nil { - return *x.Str - } - return "" -} - -func (x *ListExampleTableRequest_IndexKey_StrU32) GetU32() uint32 { - if x != nil && x.U32 != nil { - return *x.U32 - } - return 0 -} - -type ListExampleTableRequest_IndexKey_BzStr struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // bz is the value of the bz field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - Bz []byte `protobuf:"bytes,1,opt,name=bz,proto3,oneof" json:"bz,omitempty"` - // str is the value of the str field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - Str *string `protobuf:"bytes,2,opt,name=str,proto3,oneof" json:"str,omitempty"` -} - -func (x *ListExampleTableRequest_IndexKey_BzStr) Reset() { - *x = ListExampleTableRequest_IndexKey_BzStr{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[37] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleTableRequest_IndexKey_BzStr) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleTableRequest_IndexKey_BzStr) ProtoMessage() {} - -func (x *ListExampleTableRequest_IndexKey_BzStr) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[37] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleTableRequest_IndexKey_BzStr.ProtoReflect.Descriptor instead. -func (*ListExampleTableRequest_IndexKey_BzStr) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{4, 0, 3} -} - -func (x *ListExampleTableRequest_IndexKey_BzStr) GetBz() []byte { - if x != nil { - return x.Bz - } - return nil -} - -func (x *ListExampleTableRequest_IndexKey_BzStr) GetStr() string { - if x != nil && x.Str != nil { - return *x.Str - } - return "" -} - -// IndexKey specifies the value of an index key to use in prefix and range queries. -type ListExampleAutoIncrementTableRequest_IndexKey struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // key specifies the index key value. - // - // Types that are assignable to Key: - // - // *ListExampleAutoIncrementTableRequest_IndexKey_Id_ - // *ListExampleAutoIncrementTableRequest_IndexKey_X_ - Key isListExampleAutoIncrementTableRequest_IndexKey_Key `protobuf_oneof:"key"` -} - -func (x *ListExampleAutoIncrementTableRequest_IndexKey) Reset() { - *x = ListExampleAutoIncrementTableRequest_IndexKey{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[38] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleAutoIncrementTableRequest_IndexKey) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleAutoIncrementTableRequest_IndexKey) ProtoMessage() {} - -func (x *ListExampleAutoIncrementTableRequest_IndexKey) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[38] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleAutoIncrementTableRequest_IndexKey.ProtoReflect.Descriptor instead. -func (*ListExampleAutoIncrementTableRequest_IndexKey) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{10, 0} -} - -func (m *ListExampleAutoIncrementTableRequest_IndexKey) GetKey() isListExampleAutoIncrementTableRequest_IndexKey_Key { - if m != nil { - return m.Key - } - return nil -} - -func (x *ListExampleAutoIncrementTableRequest_IndexKey) GetId() *ListExampleAutoIncrementTableRequest_IndexKey_Id { - if x, ok := x.GetKey().(*ListExampleAutoIncrementTableRequest_IndexKey_Id_); ok { - return x.Id - } - return nil -} - -func (x *ListExampleAutoIncrementTableRequest_IndexKey) GetX() *ListExampleAutoIncrementTableRequest_IndexKey_X { - if x, ok := x.GetKey().(*ListExampleAutoIncrementTableRequest_IndexKey_X_); ok { - return x.X - } - return nil -} - -type isListExampleAutoIncrementTableRequest_IndexKey_Key interface { - isListExampleAutoIncrementTableRequest_IndexKey_Key() -} - -type ListExampleAutoIncrementTableRequest_IndexKey_Id_ struct { - // id specifies the value of the Id index key to use in the query. - Id *ListExampleAutoIncrementTableRequest_IndexKey_Id `protobuf:"bytes,1,opt,name=id,proto3,oneof"` -} - -type ListExampleAutoIncrementTableRequest_IndexKey_X_ struct { - // x specifies the value of the X index key to use in the query. - X *ListExampleAutoIncrementTableRequest_IndexKey_X `protobuf:"bytes,2,opt,name=x,proto3,oneof"` -} - -func (*ListExampleAutoIncrementTableRequest_IndexKey_Id_) isListExampleAutoIncrementTableRequest_IndexKey_Key() { -} - -func (*ListExampleAutoIncrementTableRequest_IndexKey_X_) isListExampleAutoIncrementTableRequest_IndexKey_Key() { -} - -// RangeQuery specifies the from/to index keys for a range query. -type ListExampleAutoIncrementTableRequest_RangeQuery struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // from is the index key to use for the start of the range query. - // To query from the start of an index, specify an index key for that index with empty values. - From *ListExampleAutoIncrementTableRequest_IndexKey `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` - // to is the index key to use for the end of the range query. - // The index key type MUST be the same as the index key type used for from. - // To query from to the end of an index it can be omitted. - To *ListExampleAutoIncrementTableRequest_IndexKey `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` -} - -func (x *ListExampleAutoIncrementTableRequest_RangeQuery) Reset() { - *x = ListExampleAutoIncrementTableRequest_RangeQuery{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[39] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleAutoIncrementTableRequest_RangeQuery) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleAutoIncrementTableRequest_RangeQuery) ProtoMessage() {} - -func (x *ListExampleAutoIncrementTableRequest_RangeQuery) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[39] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleAutoIncrementTableRequest_RangeQuery.ProtoReflect.Descriptor instead. -func (*ListExampleAutoIncrementTableRequest_RangeQuery) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{10, 1} -} - -func (x *ListExampleAutoIncrementTableRequest_RangeQuery) GetFrom() *ListExampleAutoIncrementTableRequest_IndexKey { - if x != nil { - return x.From - } - return nil -} - -func (x *ListExampleAutoIncrementTableRequest_RangeQuery) GetTo() *ListExampleAutoIncrementTableRequest_IndexKey { - if x != nil { - return x.To - } - return nil -} - -type ListExampleAutoIncrementTableRequest_IndexKey_Id struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // id is the value of the id field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - Id *uint64 `protobuf:"varint,1,opt,name=id,proto3,oneof" json:"id,omitempty"` -} - -func (x *ListExampleAutoIncrementTableRequest_IndexKey_Id) Reset() { - *x = ListExampleAutoIncrementTableRequest_IndexKey_Id{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[40] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleAutoIncrementTableRequest_IndexKey_Id) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleAutoIncrementTableRequest_IndexKey_Id) ProtoMessage() {} - -func (x *ListExampleAutoIncrementTableRequest_IndexKey_Id) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[40] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleAutoIncrementTableRequest_IndexKey_Id.ProtoReflect.Descriptor instead. -func (*ListExampleAutoIncrementTableRequest_IndexKey_Id) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{10, 0, 0} -} - -func (x *ListExampleAutoIncrementTableRequest_IndexKey_Id) GetId() uint64 { - if x != nil && x.Id != nil { - return *x.Id - } - return 0 -} - -type ListExampleAutoIncrementTableRequest_IndexKey_X struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // x is the value of the x field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - X *string `protobuf:"bytes,1,opt,name=x,proto3,oneof" json:"x,omitempty"` -} - -func (x *ListExampleAutoIncrementTableRequest_IndexKey_X) Reset() { - *x = ListExampleAutoIncrementTableRequest_IndexKey_X{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[41] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleAutoIncrementTableRequest_IndexKey_X) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleAutoIncrementTableRequest_IndexKey_X) ProtoMessage() {} - -func (x *ListExampleAutoIncrementTableRequest_IndexKey_X) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[41] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleAutoIncrementTableRequest_IndexKey_X.ProtoReflect.Descriptor instead. -func (*ListExampleAutoIncrementTableRequest_IndexKey_X) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{10, 0, 1} -} - -func (x *ListExampleAutoIncrementTableRequest_IndexKey_X) GetX() string { - if x != nil && x.X != nil { - return *x.X - } - return "" -} - -// IndexKey specifies the value of an index key to use in prefix and range queries. -type ListExampleTimestampRequest_IndexKey struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // key specifies the index key value. - // - // Types that are assignable to Key: - // - // *ListExampleTimestampRequest_IndexKey_Id_ - // *ListExampleTimestampRequest_IndexKey_Ts_ - Key isListExampleTimestampRequest_IndexKey_Key `protobuf_oneof:"key"` -} - -func (x *ListExampleTimestampRequest_IndexKey) Reset() { - *x = ListExampleTimestampRequest_IndexKey{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[42] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleTimestampRequest_IndexKey) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleTimestampRequest_IndexKey) ProtoMessage() {} - -func (x *ListExampleTimestampRequest_IndexKey) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[42] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleTimestampRequest_IndexKey.ProtoReflect.Descriptor instead. -func (*ListExampleTimestampRequest_IndexKey) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{16, 0} -} - -func (m *ListExampleTimestampRequest_IndexKey) GetKey() isListExampleTimestampRequest_IndexKey_Key { - if m != nil { - return m.Key - } - return nil -} - -func (x *ListExampleTimestampRequest_IndexKey) GetId() *ListExampleTimestampRequest_IndexKey_Id { - if x, ok := x.GetKey().(*ListExampleTimestampRequest_IndexKey_Id_); ok { - return x.Id - } - return nil -} - -func (x *ListExampleTimestampRequest_IndexKey) GetTs() *ListExampleTimestampRequest_IndexKey_Ts { - if x, ok := x.GetKey().(*ListExampleTimestampRequest_IndexKey_Ts_); ok { - return x.Ts - } - return nil -} - -type isListExampleTimestampRequest_IndexKey_Key interface { - isListExampleTimestampRequest_IndexKey_Key() -} - -type ListExampleTimestampRequest_IndexKey_Id_ struct { - // id specifies the value of the Id index key to use in the query. - Id *ListExampleTimestampRequest_IndexKey_Id `protobuf:"bytes,1,opt,name=id,proto3,oneof"` -} - -type ListExampleTimestampRequest_IndexKey_Ts_ struct { - // ts specifies the value of the Ts index key to use in the query. - Ts *ListExampleTimestampRequest_IndexKey_Ts `protobuf:"bytes,2,opt,name=ts,proto3,oneof"` -} - -func (*ListExampleTimestampRequest_IndexKey_Id_) isListExampleTimestampRequest_IndexKey_Key() {} - -func (*ListExampleTimestampRequest_IndexKey_Ts_) isListExampleTimestampRequest_IndexKey_Key() {} - -// RangeQuery specifies the from/to index keys for a range query. -type ListExampleTimestampRequest_RangeQuery struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // from is the index key to use for the start of the range query. - // To query from the start of an index, specify an index key for that index with empty values. - From *ListExampleTimestampRequest_IndexKey `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` - // to is the index key to use for the end of the range query. - // The index key type MUST be the same as the index key type used for from. - // To query from to the end of an index it can be omitted. - To *ListExampleTimestampRequest_IndexKey `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` -} - -func (x *ListExampleTimestampRequest_RangeQuery) Reset() { - *x = ListExampleTimestampRequest_RangeQuery{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[43] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleTimestampRequest_RangeQuery) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleTimestampRequest_RangeQuery) ProtoMessage() {} - -func (x *ListExampleTimestampRequest_RangeQuery) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[43] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleTimestampRequest_RangeQuery.ProtoReflect.Descriptor instead. -func (*ListExampleTimestampRequest_RangeQuery) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{16, 1} -} - -func (x *ListExampleTimestampRequest_RangeQuery) GetFrom() *ListExampleTimestampRequest_IndexKey { - if x != nil { - return x.From - } - return nil -} - -func (x *ListExampleTimestampRequest_RangeQuery) GetTo() *ListExampleTimestampRequest_IndexKey { - if x != nil { - return x.To - } - return nil -} - -type ListExampleTimestampRequest_IndexKey_Id struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // id is the value of the id field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - Id *uint64 `protobuf:"varint,1,opt,name=id,proto3,oneof" json:"id,omitempty"` -} - -func (x *ListExampleTimestampRequest_IndexKey_Id) Reset() { - *x = ListExampleTimestampRequest_IndexKey_Id{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[44] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleTimestampRequest_IndexKey_Id) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleTimestampRequest_IndexKey_Id) ProtoMessage() {} - -func (x *ListExampleTimestampRequest_IndexKey_Id) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[44] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleTimestampRequest_IndexKey_Id.ProtoReflect.Descriptor instead. -func (*ListExampleTimestampRequest_IndexKey_Id) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{16, 0, 0} -} - -func (x *ListExampleTimestampRequest_IndexKey_Id) GetId() uint64 { - if x != nil && x.Id != nil { - return *x.Id - } - return 0 -} - -type ListExampleTimestampRequest_IndexKey_Ts struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // ts is the value of the ts field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - Ts *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=ts,proto3,oneof" json:"ts,omitempty"` -} - -func (x *ListExampleTimestampRequest_IndexKey_Ts) Reset() { - *x = ListExampleTimestampRequest_IndexKey_Ts{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[45] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleTimestampRequest_IndexKey_Ts) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleTimestampRequest_IndexKey_Ts) ProtoMessage() {} - -func (x *ListExampleTimestampRequest_IndexKey_Ts) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[45] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleTimestampRequest_IndexKey_Ts.ProtoReflect.Descriptor instead. -func (*ListExampleTimestampRequest_IndexKey_Ts) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{16, 0, 1} -} - -func (x *ListExampleTimestampRequest_IndexKey_Ts) GetTs() *timestamppb.Timestamp { - if x != nil { - return x.Ts - } - return nil -} - -// IndexKey specifies the value of an index key to use in prefix and range queries. -type ListExampleDurationRequest_IndexKey struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // key specifies the index key value. - // - // Types that are assignable to Key: - // - // *ListExampleDurationRequest_IndexKey_Id_ - // *ListExampleDurationRequest_IndexKey_Dur_ - Key isListExampleDurationRequest_IndexKey_Key `protobuf_oneof:"key"` -} - -func (x *ListExampleDurationRequest_IndexKey) Reset() { - *x = ListExampleDurationRequest_IndexKey{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[46] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleDurationRequest_IndexKey) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleDurationRequest_IndexKey) ProtoMessage() {} - -func (x *ListExampleDurationRequest_IndexKey) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[46] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleDurationRequest_IndexKey.ProtoReflect.Descriptor instead. -func (*ListExampleDurationRequest_IndexKey) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{20, 0} -} - -func (m *ListExampleDurationRequest_IndexKey) GetKey() isListExampleDurationRequest_IndexKey_Key { - if m != nil { - return m.Key - } - return nil -} - -func (x *ListExampleDurationRequest_IndexKey) GetId() *ListExampleDurationRequest_IndexKey_Id { - if x, ok := x.GetKey().(*ListExampleDurationRequest_IndexKey_Id_); ok { - return x.Id - } - return nil -} - -func (x *ListExampleDurationRequest_IndexKey) GetDur() *ListExampleDurationRequest_IndexKey_Dur { - if x, ok := x.GetKey().(*ListExampleDurationRequest_IndexKey_Dur_); ok { - return x.Dur - } - return nil -} - -type isListExampleDurationRequest_IndexKey_Key interface { - isListExampleDurationRequest_IndexKey_Key() -} - -type ListExampleDurationRequest_IndexKey_Id_ struct { - // id specifies the value of the Id index key to use in the query. - Id *ListExampleDurationRequest_IndexKey_Id `protobuf:"bytes,1,opt,name=id,proto3,oneof"` -} - -type ListExampleDurationRequest_IndexKey_Dur_ struct { - // dur specifies the value of the Dur index key to use in the query. - Dur *ListExampleDurationRequest_IndexKey_Dur `protobuf:"bytes,2,opt,name=dur,proto3,oneof"` -} - -func (*ListExampleDurationRequest_IndexKey_Id_) isListExampleDurationRequest_IndexKey_Key() {} - -func (*ListExampleDurationRequest_IndexKey_Dur_) isListExampleDurationRequest_IndexKey_Key() {} - -// RangeQuery specifies the from/to index keys for a range query. -type ListExampleDurationRequest_RangeQuery struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // from is the index key to use for the start of the range query. - // To query from the start of an index, specify an index key for that index with empty values. - From *ListExampleDurationRequest_IndexKey `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` - // to is the index key to use for the end of the range query. - // The index key type MUST be the same as the index key type used for from. - // To query from to the end of an index it can be omitted. - To *ListExampleDurationRequest_IndexKey `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` -} - -func (x *ListExampleDurationRequest_RangeQuery) Reset() { - *x = ListExampleDurationRequest_RangeQuery{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[47] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleDurationRequest_RangeQuery) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleDurationRequest_RangeQuery) ProtoMessage() {} - -func (x *ListExampleDurationRequest_RangeQuery) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[47] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleDurationRequest_RangeQuery.ProtoReflect.Descriptor instead. -func (*ListExampleDurationRequest_RangeQuery) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{20, 1} -} - -func (x *ListExampleDurationRequest_RangeQuery) GetFrom() *ListExampleDurationRequest_IndexKey { - if x != nil { - return x.From - } - return nil -} - -func (x *ListExampleDurationRequest_RangeQuery) GetTo() *ListExampleDurationRequest_IndexKey { - if x != nil { - return x.To - } - return nil -} - -type ListExampleDurationRequest_IndexKey_Id struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // id is the value of the id field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - Id *uint64 `protobuf:"varint,1,opt,name=id,proto3,oneof" json:"id,omitempty"` -} - -func (x *ListExampleDurationRequest_IndexKey_Id) Reset() { - *x = ListExampleDurationRequest_IndexKey_Id{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[48] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleDurationRequest_IndexKey_Id) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleDurationRequest_IndexKey_Id) ProtoMessage() {} - -func (x *ListExampleDurationRequest_IndexKey_Id) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[48] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleDurationRequest_IndexKey_Id.ProtoReflect.Descriptor instead. -func (*ListExampleDurationRequest_IndexKey_Id) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{20, 0, 0} -} - -func (x *ListExampleDurationRequest_IndexKey_Id) GetId() uint64 { - if x != nil && x.Id != nil { - return *x.Id - } - return 0 -} - -type ListExampleDurationRequest_IndexKey_Dur struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // dur is the value of the dur field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - Dur *durationpb.Duration `protobuf:"bytes,1,opt,name=dur,proto3,oneof" json:"dur,omitempty"` -} - -func (x *ListExampleDurationRequest_IndexKey_Dur) Reset() { - *x = ListExampleDurationRequest_IndexKey_Dur{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[49] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleDurationRequest_IndexKey_Dur) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleDurationRequest_IndexKey_Dur) ProtoMessage() {} - -func (x *ListExampleDurationRequest_IndexKey_Dur) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[49] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleDurationRequest_IndexKey_Dur.ProtoReflect.Descriptor instead. -func (*ListExampleDurationRequest_IndexKey_Dur) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{20, 0, 1} -} - -func (x *ListExampleDurationRequest_IndexKey_Dur) GetDur() *durationpb.Duration { - if x != nil { - return x.Dur - } - return nil -} - -// IndexKey specifies the value of an index key to use in prefix and range queries. -type ListSimpleExampleRequest_IndexKey struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // key specifies the index key value. - // - // Types that are assignable to Key: - // - // *ListSimpleExampleRequest_IndexKey_Name_ - // *ListSimpleExampleRequest_IndexKey_Unique_ - Key isListSimpleExampleRequest_IndexKey_Key `protobuf_oneof:"key"` -} - -func (x *ListSimpleExampleRequest_IndexKey) Reset() { - *x = ListSimpleExampleRequest_IndexKey{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[50] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListSimpleExampleRequest_IndexKey) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListSimpleExampleRequest_IndexKey) ProtoMessage() {} - -func (x *ListSimpleExampleRequest_IndexKey) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[50] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListSimpleExampleRequest_IndexKey.ProtoReflect.Descriptor instead. -func (*ListSimpleExampleRequest_IndexKey) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{26, 0} -} - -func (m *ListSimpleExampleRequest_IndexKey) GetKey() isListSimpleExampleRequest_IndexKey_Key { - if m != nil { - return m.Key - } - return nil -} - -func (x *ListSimpleExampleRequest_IndexKey) GetName() *ListSimpleExampleRequest_IndexKey_Name { - if x, ok := x.GetKey().(*ListSimpleExampleRequest_IndexKey_Name_); ok { - return x.Name - } - return nil -} - -func (x *ListSimpleExampleRequest_IndexKey) GetUnique() *ListSimpleExampleRequest_IndexKey_Unique { - if x, ok := x.GetKey().(*ListSimpleExampleRequest_IndexKey_Unique_); ok { - return x.Unique - } - return nil -} - -type isListSimpleExampleRequest_IndexKey_Key interface { - isListSimpleExampleRequest_IndexKey_Key() -} - -type ListSimpleExampleRequest_IndexKey_Name_ struct { - // name specifies the value of the Name index key to use in the query. - Name *ListSimpleExampleRequest_IndexKey_Name `protobuf:"bytes,1,opt,name=name,proto3,oneof"` -} - -type ListSimpleExampleRequest_IndexKey_Unique_ struct { - // unique specifies the value of the Unique index key to use in the query. - Unique *ListSimpleExampleRequest_IndexKey_Unique `protobuf:"bytes,2,opt,name=unique,proto3,oneof"` -} - -func (*ListSimpleExampleRequest_IndexKey_Name_) isListSimpleExampleRequest_IndexKey_Key() {} - -func (*ListSimpleExampleRequest_IndexKey_Unique_) isListSimpleExampleRequest_IndexKey_Key() {} - -// RangeQuery specifies the from/to index keys for a range query. -type ListSimpleExampleRequest_RangeQuery struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // from is the index key to use for the start of the range query. - // To query from the start of an index, specify an index key for that index with empty values. - From *ListSimpleExampleRequest_IndexKey `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` - // to is the index key to use for the end of the range query. - // The index key type MUST be the same as the index key type used for from. - // To query from to the end of an index it can be omitted. - To *ListSimpleExampleRequest_IndexKey `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` -} - -func (x *ListSimpleExampleRequest_RangeQuery) Reset() { - *x = ListSimpleExampleRequest_RangeQuery{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[51] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListSimpleExampleRequest_RangeQuery) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListSimpleExampleRequest_RangeQuery) ProtoMessage() {} - -func (x *ListSimpleExampleRequest_RangeQuery) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[51] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListSimpleExampleRequest_RangeQuery.ProtoReflect.Descriptor instead. -func (*ListSimpleExampleRequest_RangeQuery) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{26, 1} -} - -func (x *ListSimpleExampleRequest_RangeQuery) GetFrom() *ListSimpleExampleRequest_IndexKey { - if x != nil { - return x.From - } - return nil -} - -func (x *ListSimpleExampleRequest_RangeQuery) GetTo() *ListSimpleExampleRequest_IndexKey { - if x != nil { - return x.To - } - return nil -} - -type ListSimpleExampleRequest_IndexKey_Name struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // name is the value of the name field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - Name *string `protobuf:"bytes,1,opt,name=name,proto3,oneof" json:"name,omitempty"` -} - -func (x *ListSimpleExampleRequest_IndexKey_Name) Reset() { - *x = ListSimpleExampleRequest_IndexKey_Name{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[52] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListSimpleExampleRequest_IndexKey_Name) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListSimpleExampleRequest_IndexKey_Name) ProtoMessage() {} - -func (x *ListSimpleExampleRequest_IndexKey_Name) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[52] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListSimpleExampleRequest_IndexKey_Name.ProtoReflect.Descriptor instead. -func (*ListSimpleExampleRequest_IndexKey_Name) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{26, 0, 0} -} - -func (x *ListSimpleExampleRequest_IndexKey_Name) GetName() string { - if x != nil && x.Name != nil { - return *x.Name - } - return "" -} - -type ListSimpleExampleRequest_IndexKey_Unique struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // unique is the value of the unique field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - Unique *string `protobuf:"bytes,1,opt,name=unique,proto3,oneof" json:"unique,omitempty"` -} - -func (x *ListSimpleExampleRequest_IndexKey_Unique) Reset() { - *x = ListSimpleExampleRequest_IndexKey_Unique{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[53] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListSimpleExampleRequest_IndexKey_Unique) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListSimpleExampleRequest_IndexKey_Unique) ProtoMessage() {} - -func (x *ListSimpleExampleRequest_IndexKey_Unique) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[53] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListSimpleExampleRequest_IndexKey_Unique.ProtoReflect.Descriptor instead. -func (*ListSimpleExampleRequest_IndexKey_Unique) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{26, 0, 1} -} - -func (x *ListSimpleExampleRequest_IndexKey_Unique) GetUnique() string { - if x != nil && x.Unique != nil { - return *x.Unique - } - return "" -} - -// IndexKey specifies the value of an index key to use in prefix and range queries. -type ListExampleAutoIncFieldNameRequest_IndexKey struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // key specifies the index key value. - // - // Types that are assignable to Key: - // - // *ListExampleAutoIncFieldNameRequest_IndexKey_Foo_ - Key isListExampleAutoIncFieldNameRequest_IndexKey_Key `protobuf_oneof:"key"` -} - -func (x *ListExampleAutoIncFieldNameRequest_IndexKey) Reset() { - *x = ListExampleAutoIncFieldNameRequest_IndexKey{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[54] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleAutoIncFieldNameRequest_IndexKey) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleAutoIncFieldNameRequest_IndexKey) ProtoMessage() {} - -func (x *ListExampleAutoIncFieldNameRequest_IndexKey) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[54] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleAutoIncFieldNameRequest_IndexKey.ProtoReflect.Descriptor instead. -func (*ListExampleAutoIncFieldNameRequest_IndexKey) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{30, 0} -} - -func (m *ListExampleAutoIncFieldNameRequest_IndexKey) GetKey() isListExampleAutoIncFieldNameRequest_IndexKey_Key { - if m != nil { - return m.Key - } - return nil -} - -func (x *ListExampleAutoIncFieldNameRequest_IndexKey) GetFoo() *ListExampleAutoIncFieldNameRequest_IndexKey_Foo { - if x, ok := x.GetKey().(*ListExampleAutoIncFieldNameRequest_IndexKey_Foo_); ok { - return x.Foo - } - return nil -} - -type isListExampleAutoIncFieldNameRequest_IndexKey_Key interface { - isListExampleAutoIncFieldNameRequest_IndexKey_Key() -} - -type ListExampleAutoIncFieldNameRequest_IndexKey_Foo_ struct { - // foo specifies the value of the Foo index key to use in the query. - Foo *ListExampleAutoIncFieldNameRequest_IndexKey_Foo `protobuf:"bytes,1,opt,name=foo,proto3,oneof"` -} - -func (*ListExampleAutoIncFieldNameRequest_IndexKey_Foo_) isListExampleAutoIncFieldNameRequest_IndexKey_Key() { -} - -// RangeQuery specifies the from/to index keys for a range query. -type ListExampleAutoIncFieldNameRequest_RangeQuery struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // from is the index key to use for the start of the range query. - // To query from the start of an index, specify an index key for that index with empty values. - From *ListExampleAutoIncFieldNameRequest_IndexKey `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` - // to is the index key to use for the end of the range query. - // The index key type MUST be the same as the index key type used for from. - // To query from to the end of an index it can be omitted. - To *ListExampleAutoIncFieldNameRequest_IndexKey `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` -} - -func (x *ListExampleAutoIncFieldNameRequest_RangeQuery) Reset() { - *x = ListExampleAutoIncFieldNameRequest_RangeQuery{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[55] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleAutoIncFieldNameRequest_RangeQuery) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleAutoIncFieldNameRequest_RangeQuery) ProtoMessage() {} - -func (x *ListExampleAutoIncFieldNameRequest_RangeQuery) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[55] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleAutoIncFieldNameRequest_RangeQuery.ProtoReflect.Descriptor instead. -func (*ListExampleAutoIncFieldNameRequest_RangeQuery) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{30, 1} -} - -func (x *ListExampleAutoIncFieldNameRequest_RangeQuery) GetFrom() *ListExampleAutoIncFieldNameRequest_IndexKey { - if x != nil { - return x.From - } - return nil -} - -func (x *ListExampleAutoIncFieldNameRequest_RangeQuery) GetTo() *ListExampleAutoIncFieldNameRequest_IndexKey { - if x != nil { - return x.To - } - return nil -} - -type ListExampleAutoIncFieldNameRequest_IndexKey_Foo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // foo is the value of the foo field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - Foo *uint64 `protobuf:"varint,1,opt,name=foo,proto3,oneof" json:"foo,omitempty"` -} - -func (x *ListExampleAutoIncFieldNameRequest_IndexKey_Foo) Reset() { - *x = ListExampleAutoIncFieldNameRequest_IndexKey_Foo{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[56] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleAutoIncFieldNameRequest_IndexKey_Foo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleAutoIncFieldNameRequest_IndexKey_Foo) ProtoMessage() {} - -func (x *ListExampleAutoIncFieldNameRequest_IndexKey_Foo) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[56] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleAutoIncFieldNameRequest_IndexKey_Foo.ProtoReflect.Descriptor instead. -func (*ListExampleAutoIncFieldNameRequest_IndexKey_Foo) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{30, 0, 0} -} - -func (x *ListExampleAutoIncFieldNameRequest_IndexKey_Foo) GetFoo() uint64 { - if x != nil && x.Foo != nil { - return *x.Foo - } - return 0 -} - -var File_testpb_test_schema_query_proto protoreflect.FileDescriptor - -var file_testpb_test_schema_query_proto_rawDesc = []byte{ - 0x0a, 0x1e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x73, 0x63, - 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x06, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x1a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2f, 0x74, 0x65, - 0x73, 0x74, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0x4e, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, - 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x33, 0x32, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x75, 0x33, 0x32, 0x12, 0x10, 0x0a, 0x03, 0x69, - 0x36, 0x34, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x69, 0x36, 0x34, 0x12, 0x10, 0x0a, - 0x03, 0x73, 0x74, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x74, 0x72, 0x22, - 0x45, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, - 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x70, 0x62, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x44, 0x0a, 0x1e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x79, 0x55, 0x36, 0x34, 0x53, 0x74, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x36, 0x34, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x75, 0x36, 0x34, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x74, - 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x74, 0x72, 0x22, 0x4d, 0x0a, 0x1f, - 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x42, - 0x79, 0x55, 0x36, 0x34, 0x53, 0x74, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, - 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, - 0x61, 0x62, 0x6c, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x9c, 0x08, 0x0a, 0x17, - 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4d, 0x0a, 0x0c, 0x70, 0x72, 0x65, 0x66, 0x69, - 0x78, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, - 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, - 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x48, 0x00, 0x52, 0x0b, 0x70, 0x72, 0x65, 0x66, 0x69, - 0x78, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x4d, 0x0a, 0x0b, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x61, 0x6e, - 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, 0x00, 0x52, 0x0a, 0x72, 0x61, 0x6e, 0x67, 0x65, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x8a, 0x05, - 0x0a, 0x08, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x12, 0x56, 0x0a, 0x0d, 0x75, 0x5f, - 0x33, 0x32, 0x5f, 0x69, 0x5f, 0x36, 0x34, 0x5f, 0x73, 0x74, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x32, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x2e, 0x55, 0x33, 0x32, 0x49, - 0x36, 0x34, 0x53, 0x74, 0x72, 0x48, 0x00, 0x52, 0x09, 0x75, 0x33, 0x32, 0x49, 0x36, 0x34, 0x53, - 0x74, 0x72, 0x12, 0x4b, 0x0a, 0x08, 0x75, 0x5f, 0x36, 0x34, 0x5f, 0x73, 0x74, 0x72, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x2e, 0x55, - 0x36, 0x34, 0x53, 0x74, 0x72, 0x48, 0x00, 0x52, 0x06, 0x75, 0x36, 0x34, 0x53, 0x74, 0x72, 0x12, - 0x4b, 0x0a, 0x08, 0x73, 0x74, 0x72, 0x5f, 0x75, 0x5f, 0x33, 0x32, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x2f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x2e, 0x53, 0x74, 0x72, 0x55, - 0x33, 0x32, 0x48, 0x00, 0x52, 0x06, 0x73, 0x74, 0x72, 0x55, 0x33, 0x32, 0x12, 0x47, 0x0a, 0x06, - 0x62, 0x7a, 0x5f, 0x73, 0x74, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x74, - 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, - 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x2e, 0x42, 0x7a, 0x53, 0x74, 0x72, 0x48, 0x00, 0x52, 0x05, - 0x62, 0x7a, 0x53, 0x74, 0x72, 0x1a, 0x68, 0x0a, 0x09, 0x55, 0x33, 0x32, 0x49, 0x36, 0x34, 0x53, - 0x74, 0x72, 0x12, 0x15, 0x0a, 0x03, 0x75, 0x33, 0x32, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x48, - 0x00, 0x52, 0x03, 0x75, 0x33, 0x32, 0x88, 0x01, 0x01, 0x12, 0x15, 0x0a, 0x03, 0x69, 0x36, 0x34, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x03, 0x69, 0x36, 0x34, 0x88, 0x01, 0x01, - 0x12, 0x15, 0x0a, 0x03, 0x73, 0x74, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, - 0x03, 0x73, 0x74, 0x72, 0x88, 0x01, 0x01, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x75, 0x33, 0x32, 0x42, - 0x06, 0x0a, 0x04, 0x5f, 0x69, 0x36, 0x34, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x73, 0x74, 0x72, 0x1a, - 0x46, 0x0a, 0x06, 0x55, 0x36, 0x34, 0x53, 0x74, 0x72, 0x12, 0x15, 0x0a, 0x03, 0x75, 0x36, 0x34, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x03, 0x75, 0x36, 0x34, 0x88, 0x01, 0x01, - 0x12, 0x15, 0x0a, 0x03, 0x73, 0x74, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, - 0x03, 0x73, 0x74, 0x72, 0x88, 0x01, 0x01, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x75, 0x36, 0x34, 0x42, - 0x06, 0x0a, 0x04, 0x5f, 0x73, 0x74, 0x72, 0x1a, 0x46, 0x0a, 0x06, 0x53, 0x74, 0x72, 0x55, 0x33, - 0x32, 0x12, 0x15, 0x0a, 0x03, 0x73, 0x74, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, - 0x52, 0x03, 0x73, 0x74, 0x72, 0x88, 0x01, 0x01, 0x12, 0x15, 0x0a, 0x03, 0x75, 0x33, 0x32, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x01, 0x52, 0x03, 0x75, 0x33, 0x32, 0x88, 0x01, 0x01, 0x42, - 0x06, 0x0a, 0x04, 0x5f, 0x73, 0x74, 0x72, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x75, 0x33, 0x32, 0x1a, - 0x42, 0x0a, 0x05, 0x42, 0x7a, 0x53, 0x74, 0x72, 0x12, 0x13, 0x0a, 0x02, 0x62, 0x7a, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x02, 0x62, 0x7a, 0x88, 0x01, 0x01, 0x12, 0x15, 0x0a, - 0x03, 0x73, 0x74, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x03, 0x73, 0x74, - 0x72, 0x88, 0x01, 0x01, 0x42, 0x05, 0x0a, 0x03, 0x5f, 0x62, 0x7a, 0x42, 0x06, 0x0a, 0x04, 0x5f, - 0x73, 0x74, 0x72, 0x42, 0x05, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x1a, 0x84, 0x01, 0x0a, 0x0a, 0x52, - 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x3c, 0x0a, 0x04, 0x66, 0x72, 0x6f, - 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, - 0x79, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x38, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, 0x02, 0x74, - 0x6f, 0x42, 0x07, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x91, 0x01, 0x0a, 0x18, 0x4c, - 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, - 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x06, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x35, - 0x0a, 0x23, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, - 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x02, 0x69, 0x64, 0x22, 0x5f, 0x0a, 0x24, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x74, - 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, - 0x6f, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x36, 0x0a, 0x26, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, - 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x79, 0x58, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x78, 0x22, 0x62, - 0x0a, 0x27, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, - 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x79, - 0x58, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, - 0x62, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, - 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x22, 0xb9, 0x05, 0x0a, 0x24, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, - 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, - 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5a, 0x0a, 0x0c, 0x70, - 0x72, 0x65, 0x66, 0x69, 0x78, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x35, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, - 0x65, 0x6e, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x48, 0x00, 0x52, 0x0b, 0x70, 0x72, 0x65, 0x66, - 0x69, 0x78, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x5a, 0x0a, 0x0b, 0x72, 0x61, 0x6e, 0x67, 0x65, - 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x74, - 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x61, - 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, 0x00, 0x52, 0x0a, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, - 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xe6, 0x01, 0x0a, 0x08, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x12, 0x4a, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, - 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x2e, 0x49, 0x64, 0x48, 0x00, - 0x52, 0x02, 0x69, 0x64, 0x12, 0x47, 0x0a, 0x01, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x37, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, - 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, - 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x2e, 0x58, 0x48, 0x00, 0x52, 0x01, 0x78, 0x1a, 0x20, 0x0a, - 0x02, 0x49, 0x64, 0x12, 0x13, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x48, - 0x00, 0x52, 0x02, 0x69, 0x64, 0x88, 0x01, 0x01, 0x42, 0x05, 0x0a, 0x03, 0x5f, 0x69, 0x64, 0x1a, - 0x1c, 0x0a, 0x01, 0x58, 0x12, 0x11, 0x0a, 0x01, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, - 0x00, 0x52, 0x01, 0x78, 0x88, 0x01, 0x01, 0x42, 0x04, 0x0a, 0x02, 0x5f, 0x78, 0x42, 0x05, 0x0a, - 0x03, 0x6b, 0x65, 0x79, 0x1a, 0x9e, 0x01, 0x0a, 0x0a, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x12, 0x49, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x35, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, - 0x65, 0x6e, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x45, - 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x74, 0x65, 0x73, - 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, - 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x62, 0x6c, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, - 0x79, 0x52, 0x02, 0x74, 0x6f, 0x42, 0x07, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0xab, - 0x01, 0x0a, 0x25, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, - 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, - 0x62, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, - 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x1c, 0x0a, 0x1a, - 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, - 0x74, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4d, 0x0a, 0x1b, 0x47, 0x65, - 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x74, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, - 0x62, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x74, - 0x6f, 0x6e, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x2c, 0x0a, 0x1a, 0x47, 0x65, 0x74, - 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x22, 0x4d, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x45, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x9d, 0x05, 0x0a, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x51, 0x0a, 0x0c, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, - 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x74, - 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x48, 0x00, 0x52, 0x0b, 0x70, 0x72, - 0x65, 0x66, 0x69, 0x78, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x51, 0x0a, 0x0b, 0x72, 0x61, 0x6e, - 0x67, 0x65, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, - 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, 0x00, - 0x52, 0x0a, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x46, 0x0a, 0x0a, - 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xf7, 0x01, 0x0a, 0x08, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, - 0x79, 0x12, 0x41, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, - 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, - 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x2e, 0x49, 0x64, 0x48, 0x00, - 0x52, 0x02, 0x69, 0x64, 0x12, 0x41, 0x0a, 0x02, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x2f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x2e, 0x54, - 0x73, 0x48, 0x00, 0x52, 0x02, 0x74, 0x73, 0x1a, 0x20, 0x0a, 0x02, 0x49, 0x64, 0x12, 0x13, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x02, 0x69, 0x64, 0x88, - 0x01, 0x01, 0x42, 0x05, 0x0a, 0x03, 0x5f, 0x69, 0x64, 0x1a, 0x3c, 0x0a, 0x02, 0x54, 0x73, 0x12, - 0x2f, 0x0a, 0x02, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x00, 0x52, 0x02, 0x74, 0x73, 0x88, 0x01, 0x01, - 0x42, 0x05, 0x0a, 0x03, 0x5f, 0x74, 0x73, 0x42, 0x05, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x1a, 0x8c, - 0x01, 0x0a, 0x0a, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x40, 0x0a, - 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, - 0x3c, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, 0x02, 0x74, 0x6f, 0x42, 0x07, 0x0a, - 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x99, 0x01, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, - 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, - 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x22, 0x2b, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x22, - 0x4b, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, - 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x9c, 0x05, 0x0a, - 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x50, 0x0a, 0x0c, 0x70, - 0x72, 0x65, 0x66, 0x69, 0x78, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x2b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x48, 0x00, - 0x52, 0x0b, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x50, 0x0a, - 0x0b, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x48, 0x00, 0x52, 0x0a, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, - 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, - 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, - 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xfb, 0x01, 0x0a, 0x08, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x4b, 0x65, 0x79, 0x12, 0x40, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x2e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x2e, 0x49, 0x64, - 0x48, 0x00, 0x52, 0x02, 0x69, 0x64, 0x12, 0x43, 0x0a, 0x03, 0x64, 0x75, 0x72, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, - 0x2e, 0x44, 0x75, 0x72, 0x48, 0x00, 0x52, 0x03, 0x64, 0x75, 0x72, 0x1a, 0x20, 0x0a, 0x02, 0x49, - 0x64, 0x12, 0x13, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, - 0x02, 0x69, 0x64, 0x88, 0x01, 0x01, 0x42, 0x05, 0x0a, 0x03, 0x5f, 0x69, 0x64, 0x1a, 0x3f, 0x0a, - 0x03, 0x44, 0x75, 0x72, 0x12, 0x30, 0x0a, 0x03, 0x64, 0x75, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x03, - 0x64, 0x75, 0x72, 0x88, 0x01, 0x01, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x64, 0x75, 0x72, 0x42, 0x05, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x1a, 0x8a, 0x01, 0x0a, 0x0a, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x12, 0x3f, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, - 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x3b, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x2b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, 0x02, - 0x74, 0x6f, 0x42, 0x07, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x97, 0x01, 0x0a, 0x1b, - 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x06, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x47, 0x0a, 0x0a, - 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x2d, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x70, - 0x6c, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x47, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x70, 0x6c, - 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x2b, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x15, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x39, 0x0a, - 0x1f, 0x47, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x42, 0x79, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x16, 0x0a, 0x06, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x22, 0x4f, 0x0a, 0x20, 0x47, 0x65, 0x74, 0x53, - 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x55, 0x6e, - 0x69, 0x71, 0x75, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x70, 0x62, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, - 0x6c, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x96, 0x05, 0x0a, 0x18, 0x4c, 0x69, - 0x73, 0x74, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4e, 0x0a, 0x0c, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, - 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x74, - 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, - 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x48, 0x00, 0x52, 0x0b, 0x70, 0x72, 0x65, 0x66, 0x69, - 0x78, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x4e, 0x0a, 0x0b, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x61, - 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, 0x00, 0x52, 0x0a, 0x72, 0x61, 0x6e, 0x67, - 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xff, - 0x01, 0x0a, 0x08, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x12, 0x44, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x45, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x4b, 0x65, 0x79, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x48, 0x00, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x4a, 0x0a, 0x06, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x30, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, - 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x2e, 0x55, 0x6e, 0x69, - 0x71, 0x75, 0x65, 0x48, 0x00, 0x52, 0x06, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x1a, 0x28, 0x0a, - 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, 0x07, - 0x0a, 0x05, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x1a, 0x30, 0x0a, 0x06, 0x55, 0x6e, 0x69, 0x71, 0x75, - 0x65, 0x12, 0x1b, 0x0a, 0x06, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x48, 0x00, 0x52, 0x06, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x88, 0x01, 0x01, 0x42, 0x09, - 0x0a, 0x07, 0x5f, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x42, 0x05, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x1a, 0x86, 0x01, 0x0a, 0x0a, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, - 0x3d, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, - 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x69, 0x6d, 0x70, 0x6c, - 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x39, - 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x74, 0x65, 0x73, - 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x45, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, 0x02, 0x74, 0x6f, 0x42, 0x07, 0x0a, 0x05, 0x71, 0x75, 0x65, - 0x72, 0x79, 0x22, 0x93, 0x01, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x69, 0x6d, 0x70, 0x6c, - 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x2d, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x15, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, - 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, - 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, - 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, - 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x35, 0x0a, 0x21, 0x47, 0x65, 0x74, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x46, 0x69, 0x65, - 0x6c, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, - 0x03, 0x66, 0x6f, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x66, 0x6f, 0x6f, 0x22, - 0x5b, 0x0a, 0x22, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, - 0x6f, 0x49, 0x6e, 0x63, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x46, 0x69, 0x65, 0x6c, - 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xcd, 0x04, 0x0a, - 0x22, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, - 0x49, 0x6e, 0x63, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x58, 0x0a, 0x0c, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x5f, 0x71, 0x75, - 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, - 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x48, 0x00, - 0x52, 0x0b, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x58, 0x0a, - 0x0b, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x46, 0x69, - 0x65, 0x6c, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, - 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, 0x00, 0x52, 0x0a, 0x72, 0x61, 0x6e, - 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, - 0x84, 0x01, 0x0a, 0x08, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x12, 0x4b, 0x0a, 0x03, - 0x66, 0x6f, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, - 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x2e, 0x46, - 0x6f, 0x6f, 0x48, 0x00, 0x52, 0x03, 0x66, 0x6f, 0x6f, 0x1a, 0x24, 0x0a, 0x03, 0x46, 0x6f, 0x6f, - 0x12, 0x15, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, - 0x03, 0x66, 0x6f, 0x6f, 0x88, 0x01, 0x01, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x66, 0x6f, 0x6f, 0x42, - 0x05, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x1a, 0x9a, 0x01, 0x0a, 0x0a, 0x52, 0x61, 0x6e, 0x67, 0x65, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x47, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x46, - 0x69, 0x65, 0x6c, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x43, - 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x74, 0x65, 0x73, - 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, - 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, - 0x02, 0x74, 0x6f, 0x42, 0x07, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0xa7, 0x01, 0x0a, - 0x23, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, - 0x49, 0x6e, 0x63, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x46, 0x69, 0x65, 0x6c, - 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x47, 0x0a, - 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, - 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, - 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0xba, 0x0d, 0x0a, 0x16, 0x54, 0x65, 0x73, 0x74, 0x53, - 0x63, 0x68, 0x65, 0x6d, 0x61, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x12, 0x54, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, - 0x61, 0x62, 0x6c, 0x65, 0x12, 0x1e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, - 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, - 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6c, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x45, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x79, 0x55, 0x36, 0x34, 0x53, - 0x74, 0x72, 0x12, 0x26, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x79, 0x55, 0x36, 0x34, - 0x53, 0x74, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x74, 0x65, 0x73, - 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, - 0x62, 0x6c, 0x65, 0x42, 0x79, 0x55, 0x36, 0x34, 0x53, 0x74, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x57, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x1f, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, - 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x74, 0x65, 0x73, - 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, - 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7b, - 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, - 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x2b, - 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, - 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, - 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, - 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x62, 0x6c, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x84, 0x01, 0x0a, 0x1f, - 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, - 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x79, 0x58, 0x12, - 0x2e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x54, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x79, 0x58, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x2f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x54, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x79, 0x58, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x7e, 0x0a, 0x1d, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x61, - 0x62, 0x6c, 0x65, 0x12, 0x2c, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x72, - 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x2d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, - 0x65, 0x6e, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x60, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x74, 0x6f, 0x6e, 0x12, 0x22, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x53, 0x69, 0x6e, - 0x67, 0x6c, 0x65, 0x74, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, - 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x74, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x12, 0x60, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, - 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x22, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x23, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x63, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x23, - 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5d, 0x0a, 0x12, 0x47, - 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x21, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, - 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x60, 0x0a, 0x13, 0x4c, 0x69, - 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x22, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x57, 0x0a, 0x10, - 0x47, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x12, 0x1f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x69, 0x6d, - 0x70, 0x6c, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x20, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x69, - 0x6d, 0x70, 0x6c, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6f, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x70, - 0x6c, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x55, 0x6e, 0x69, 0x71, 0x75, - 0x65, 0x12, 0x27, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x69, - 0x6d, 0x70, 0x6c, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x55, 0x6e, 0x69, - 0x71, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x74, 0x65, 0x73, - 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x45, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5a, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x69, - 0x6d, 0x70, 0x6c, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x20, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, - 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x69, 0x6d, 0x70, 0x6c, - 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x75, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4e, 0x61, 0x6d, 0x65, - 0x12, 0x29, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x46, 0x69, 0x65, 0x6c, 0x64, - 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, - 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x78, 0x0a, 0x1b, 0x4c, 0x69, 0x73, - 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x46, - 0x69, 0x65, 0x6c, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, - 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, - 0x6f, 0x49, 0x6e, 0x63, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, - 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x42, 0x7c, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, - 0x62, 0x42, 0x14, 0x54, 0x65, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6f, 0x72, 0x6d, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x54, 0x58, - 0x58, 0xaa, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xca, 0x02, 0x06, 0x54, 0x65, 0x73, - 0x74, 0x70, 0x62, 0xe2, 0x02, 0x12, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x5c, 0x47, 0x50, 0x42, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, - 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_testpb_test_schema_query_proto_rawDescOnce sync.Once - file_testpb_test_schema_query_proto_rawDescData = file_testpb_test_schema_query_proto_rawDesc -) - -func file_testpb_test_schema_query_proto_rawDescGZIP() []byte { - file_testpb_test_schema_query_proto_rawDescOnce.Do(func() { - file_testpb_test_schema_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_testpb_test_schema_query_proto_rawDescData) - }) - return file_testpb_test_schema_query_proto_rawDescData -} - -var file_testpb_test_schema_query_proto_msgTypes = make([]protoimpl.MessageInfo, 57) -var file_testpb_test_schema_query_proto_goTypes = []interface{}{ - (*GetExampleTableRequest)(nil), // 0: testpb.GetExampleTableRequest - (*GetExampleTableResponse)(nil), // 1: testpb.GetExampleTableResponse - (*GetExampleTableByU64StrRequest)(nil), // 2: testpb.GetExampleTableByU64StrRequest - (*GetExampleTableByU64StrResponse)(nil), // 3: testpb.GetExampleTableByU64StrResponse - (*ListExampleTableRequest)(nil), // 4: testpb.ListExampleTableRequest - (*ListExampleTableResponse)(nil), // 5: testpb.ListExampleTableResponse - (*GetExampleAutoIncrementTableRequest)(nil), // 6: testpb.GetExampleAutoIncrementTableRequest - (*GetExampleAutoIncrementTableResponse)(nil), // 7: testpb.GetExampleAutoIncrementTableResponse - (*GetExampleAutoIncrementTableByXRequest)(nil), // 8: testpb.GetExampleAutoIncrementTableByXRequest - (*GetExampleAutoIncrementTableByXResponse)(nil), // 9: testpb.GetExampleAutoIncrementTableByXResponse - (*ListExampleAutoIncrementTableRequest)(nil), // 10: testpb.ListExampleAutoIncrementTableRequest - (*ListExampleAutoIncrementTableResponse)(nil), // 11: testpb.ListExampleAutoIncrementTableResponse - (*GetExampleSingletonRequest)(nil), // 12: testpb.GetExampleSingletonRequest - (*GetExampleSingletonResponse)(nil), // 13: testpb.GetExampleSingletonResponse - (*GetExampleTimestampRequest)(nil), // 14: testpb.GetExampleTimestampRequest - (*GetExampleTimestampResponse)(nil), // 15: testpb.GetExampleTimestampResponse - (*ListExampleTimestampRequest)(nil), // 16: testpb.ListExampleTimestampRequest - (*ListExampleTimestampResponse)(nil), // 17: testpb.ListExampleTimestampResponse - (*GetExampleDurationRequest)(nil), // 18: testpb.GetExampleDurationRequest - (*GetExampleDurationResponse)(nil), // 19: testpb.GetExampleDurationResponse - (*ListExampleDurationRequest)(nil), // 20: testpb.ListExampleDurationRequest - (*ListExampleDurationResponse)(nil), // 21: testpb.ListExampleDurationResponse - (*GetSimpleExampleRequest)(nil), // 22: testpb.GetSimpleExampleRequest - (*GetSimpleExampleResponse)(nil), // 23: testpb.GetSimpleExampleResponse - (*GetSimpleExampleByUniqueRequest)(nil), // 24: testpb.GetSimpleExampleByUniqueRequest - (*GetSimpleExampleByUniqueResponse)(nil), // 25: testpb.GetSimpleExampleByUniqueResponse - (*ListSimpleExampleRequest)(nil), // 26: testpb.ListSimpleExampleRequest - (*ListSimpleExampleResponse)(nil), // 27: testpb.ListSimpleExampleResponse - (*GetExampleAutoIncFieldNameRequest)(nil), // 28: testpb.GetExampleAutoIncFieldNameRequest - (*GetExampleAutoIncFieldNameResponse)(nil), // 29: testpb.GetExampleAutoIncFieldNameResponse - (*ListExampleAutoIncFieldNameRequest)(nil), // 30: testpb.ListExampleAutoIncFieldNameRequest - (*ListExampleAutoIncFieldNameResponse)(nil), // 31: testpb.ListExampleAutoIncFieldNameResponse - (*ListExampleTableRequest_IndexKey)(nil), // 32: testpb.ListExampleTableRequest.IndexKey - (*ListExampleTableRequest_RangeQuery)(nil), // 33: testpb.ListExampleTableRequest.RangeQuery - (*ListExampleTableRequest_IndexKey_U32I64Str)(nil), // 34: testpb.ListExampleTableRequest.IndexKey.U32I64Str - (*ListExampleTableRequest_IndexKey_U64Str)(nil), // 35: testpb.ListExampleTableRequest.IndexKey.U64Str - (*ListExampleTableRequest_IndexKey_StrU32)(nil), // 36: testpb.ListExampleTableRequest.IndexKey.StrU32 - (*ListExampleTableRequest_IndexKey_BzStr)(nil), // 37: testpb.ListExampleTableRequest.IndexKey.BzStr - (*ListExampleAutoIncrementTableRequest_IndexKey)(nil), // 38: testpb.ListExampleAutoIncrementTableRequest.IndexKey - (*ListExampleAutoIncrementTableRequest_RangeQuery)(nil), // 39: testpb.ListExampleAutoIncrementTableRequest.RangeQuery - (*ListExampleAutoIncrementTableRequest_IndexKey_Id)(nil), // 40: testpb.ListExampleAutoIncrementTableRequest.IndexKey.Id - (*ListExampleAutoIncrementTableRequest_IndexKey_X)(nil), // 41: testpb.ListExampleAutoIncrementTableRequest.IndexKey.X - (*ListExampleTimestampRequest_IndexKey)(nil), // 42: testpb.ListExampleTimestampRequest.IndexKey - (*ListExampleTimestampRequest_RangeQuery)(nil), // 43: testpb.ListExampleTimestampRequest.RangeQuery - (*ListExampleTimestampRequest_IndexKey_Id)(nil), // 44: testpb.ListExampleTimestampRequest.IndexKey.Id - (*ListExampleTimestampRequest_IndexKey_Ts)(nil), // 45: testpb.ListExampleTimestampRequest.IndexKey.Ts - (*ListExampleDurationRequest_IndexKey)(nil), // 46: testpb.ListExampleDurationRequest.IndexKey - (*ListExampleDurationRequest_RangeQuery)(nil), // 47: testpb.ListExampleDurationRequest.RangeQuery - (*ListExampleDurationRequest_IndexKey_Id)(nil), // 48: testpb.ListExampleDurationRequest.IndexKey.Id - (*ListExampleDurationRequest_IndexKey_Dur)(nil), // 49: testpb.ListExampleDurationRequest.IndexKey.Dur - (*ListSimpleExampleRequest_IndexKey)(nil), // 50: testpb.ListSimpleExampleRequest.IndexKey - (*ListSimpleExampleRequest_RangeQuery)(nil), // 51: testpb.ListSimpleExampleRequest.RangeQuery - (*ListSimpleExampleRequest_IndexKey_Name)(nil), // 52: testpb.ListSimpleExampleRequest.IndexKey.Name - (*ListSimpleExampleRequest_IndexKey_Unique)(nil), // 53: testpb.ListSimpleExampleRequest.IndexKey.Unique - (*ListExampleAutoIncFieldNameRequest_IndexKey)(nil), // 54: testpb.ListExampleAutoIncFieldNameRequest.IndexKey - (*ListExampleAutoIncFieldNameRequest_RangeQuery)(nil), // 55: testpb.ListExampleAutoIncFieldNameRequest.RangeQuery - (*ListExampleAutoIncFieldNameRequest_IndexKey_Foo)(nil), // 56: testpb.ListExampleAutoIncFieldNameRequest.IndexKey.Foo - (*ExampleTable)(nil), // 57: testpb.ExampleTable - (*v1beta1.PageRequest)(nil), // 58: cosmos.base.query.v1beta1.PageRequest - (*v1beta1.PageResponse)(nil), // 59: cosmos.base.query.v1beta1.PageResponse - (*ExampleAutoIncrementTable)(nil), // 60: testpb.ExampleAutoIncrementTable - (*ExampleSingleton)(nil), // 61: testpb.ExampleSingleton - (*ExampleTimestamp)(nil), // 62: testpb.ExampleTimestamp - (*ExampleDuration)(nil), // 63: testpb.ExampleDuration - (*SimpleExample)(nil), // 64: testpb.SimpleExample - (*ExampleAutoIncFieldName)(nil), // 65: testpb.ExampleAutoIncFieldName - (*timestamppb.Timestamp)(nil), // 66: google.protobuf.Timestamp - (*durationpb.Duration)(nil), // 67: google.protobuf.Duration -} -var file_testpb_test_schema_query_proto_depIdxs = []int32{ - 57, // 0: testpb.GetExampleTableResponse.value:type_name -> testpb.ExampleTable - 57, // 1: testpb.GetExampleTableByU64StrResponse.value:type_name -> testpb.ExampleTable - 32, // 2: testpb.ListExampleTableRequest.prefix_query:type_name -> testpb.ListExampleTableRequest.IndexKey - 33, // 3: testpb.ListExampleTableRequest.range_query:type_name -> testpb.ListExampleTableRequest.RangeQuery - 58, // 4: testpb.ListExampleTableRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 57, // 5: testpb.ListExampleTableResponse.values:type_name -> testpb.ExampleTable - 59, // 6: testpb.ListExampleTableResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 60, // 7: testpb.GetExampleAutoIncrementTableResponse.value:type_name -> testpb.ExampleAutoIncrementTable - 60, // 8: testpb.GetExampleAutoIncrementTableByXResponse.value:type_name -> testpb.ExampleAutoIncrementTable - 38, // 9: testpb.ListExampleAutoIncrementTableRequest.prefix_query:type_name -> testpb.ListExampleAutoIncrementTableRequest.IndexKey - 39, // 10: testpb.ListExampleAutoIncrementTableRequest.range_query:type_name -> testpb.ListExampleAutoIncrementTableRequest.RangeQuery - 58, // 11: testpb.ListExampleAutoIncrementTableRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 60, // 12: testpb.ListExampleAutoIncrementTableResponse.values:type_name -> testpb.ExampleAutoIncrementTable - 59, // 13: testpb.ListExampleAutoIncrementTableResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 61, // 14: testpb.GetExampleSingletonResponse.value:type_name -> testpb.ExampleSingleton - 62, // 15: testpb.GetExampleTimestampResponse.value:type_name -> testpb.ExampleTimestamp - 42, // 16: testpb.ListExampleTimestampRequest.prefix_query:type_name -> testpb.ListExampleTimestampRequest.IndexKey - 43, // 17: testpb.ListExampleTimestampRequest.range_query:type_name -> testpb.ListExampleTimestampRequest.RangeQuery - 58, // 18: testpb.ListExampleTimestampRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 62, // 19: testpb.ListExampleTimestampResponse.values:type_name -> testpb.ExampleTimestamp - 59, // 20: testpb.ListExampleTimestampResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 63, // 21: testpb.GetExampleDurationResponse.value:type_name -> testpb.ExampleDuration - 46, // 22: testpb.ListExampleDurationRequest.prefix_query:type_name -> testpb.ListExampleDurationRequest.IndexKey - 47, // 23: testpb.ListExampleDurationRequest.range_query:type_name -> testpb.ListExampleDurationRequest.RangeQuery - 58, // 24: testpb.ListExampleDurationRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 63, // 25: testpb.ListExampleDurationResponse.values:type_name -> testpb.ExampleDuration - 59, // 26: testpb.ListExampleDurationResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 64, // 27: testpb.GetSimpleExampleResponse.value:type_name -> testpb.SimpleExample - 64, // 28: testpb.GetSimpleExampleByUniqueResponse.value:type_name -> testpb.SimpleExample - 50, // 29: testpb.ListSimpleExampleRequest.prefix_query:type_name -> testpb.ListSimpleExampleRequest.IndexKey - 51, // 30: testpb.ListSimpleExampleRequest.range_query:type_name -> testpb.ListSimpleExampleRequest.RangeQuery - 58, // 31: testpb.ListSimpleExampleRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 64, // 32: testpb.ListSimpleExampleResponse.values:type_name -> testpb.SimpleExample - 59, // 33: testpb.ListSimpleExampleResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 65, // 34: testpb.GetExampleAutoIncFieldNameResponse.value:type_name -> testpb.ExampleAutoIncFieldName - 54, // 35: testpb.ListExampleAutoIncFieldNameRequest.prefix_query:type_name -> testpb.ListExampleAutoIncFieldNameRequest.IndexKey - 55, // 36: testpb.ListExampleAutoIncFieldNameRequest.range_query:type_name -> testpb.ListExampleAutoIncFieldNameRequest.RangeQuery - 58, // 37: testpb.ListExampleAutoIncFieldNameRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 65, // 38: testpb.ListExampleAutoIncFieldNameResponse.values:type_name -> testpb.ExampleAutoIncFieldName - 59, // 39: testpb.ListExampleAutoIncFieldNameResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 34, // 40: testpb.ListExampleTableRequest.IndexKey.u_32_i_64_str:type_name -> testpb.ListExampleTableRequest.IndexKey.U32I64Str - 35, // 41: testpb.ListExampleTableRequest.IndexKey.u_64_str:type_name -> testpb.ListExampleTableRequest.IndexKey.U64Str - 36, // 42: testpb.ListExampleTableRequest.IndexKey.str_u_32:type_name -> testpb.ListExampleTableRequest.IndexKey.StrU32 - 37, // 43: testpb.ListExampleTableRequest.IndexKey.bz_str:type_name -> testpb.ListExampleTableRequest.IndexKey.BzStr - 32, // 44: testpb.ListExampleTableRequest.RangeQuery.from:type_name -> testpb.ListExampleTableRequest.IndexKey - 32, // 45: testpb.ListExampleTableRequest.RangeQuery.to:type_name -> testpb.ListExampleTableRequest.IndexKey - 40, // 46: testpb.ListExampleAutoIncrementTableRequest.IndexKey.id:type_name -> testpb.ListExampleAutoIncrementTableRequest.IndexKey.Id - 41, // 47: testpb.ListExampleAutoIncrementTableRequest.IndexKey.x:type_name -> testpb.ListExampleAutoIncrementTableRequest.IndexKey.X - 38, // 48: testpb.ListExampleAutoIncrementTableRequest.RangeQuery.from:type_name -> testpb.ListExampleAutoIncrementTableRequest.IndexKey - 38, // 49: testpb.ListExampleAutoIncrementTableRequest.RangeQuery.to:type_name -> testpb.ListExampleAutoIncrementTableRequest.IndexKey - 44, // 50: testpb.ListExampleTimestampRequest.IndexKey.id:type_name -> testpb.ListExampleTimestampRequest.IndexKey.Id - 45, // 51: testpb.ListExampleTimestampRequest.IndexKey.ts:type_name -> testpb.ListExampleTimestampRequest.IndexKey.Ts - 42, // 52: testpb.ListExampleTimestampRequest.RangeQuery.from:type_name -> testpb.ListExampleTimestampRequest.IndexKey - 42, // 53: testpb.ListExampleTimestampRequest.RangeQuery.to:type_name -> testpb.ListExampleTimestampRequest.IndexKey - 66, // 54: testpb.ListExampleTimestampRequest.IndexKey.Ts.ts:type_name -> google.protobuf.Timestamp - 48, // 55: testpb.ListExampleDurationRequest.IndexKey.id:type_name -> testpb.ListExampleDurationRequest.IndexKey.Id - 49, // 56: testpb.ListExampleDurationRequest.IndexKey.dur:type_name -> testpb.ListExampleDurationRequest.IndexKey.Dur - 46, // 57: testpb.ListExampleDurationRequest.RangeQuery.from:type_name -> testpb.ListExampleDurationRequest.IndexKey - 46, // 58: testpb.ListExampleDurationRequest.RangeQuery.to:type_name -> testpb.ListExampleDurationRequest.IndexKey - 67, // 59: testpb.ListExampleDurationRequest.IndexKey.Dur.dur:type_name -> google.protobuf.Duration - 52, // 60: testpb.ListSimpleExampleRequest.IndexKey.name:type_name -> testpb.ListSimpleExampleRequest.IndexKey.Name - 53, // 61: testpb.ListSimpleExampleRequest.IndexKey.unique:type_name -> testpb.ListSimpleExampleRequest.IndexKey.Unique - 50, // 62: testpb.ListSimpleExampleRequest.RangeQuery.from:type_name -> testpb.ListSimpleExampleRequest.IndexKey - 50, // 63: testpb.ListSimpleExampleRequest.RangeQuery.to:type_name -> testpb.ListSimpleExampleRequest.IndexKey - 56, // 64: testpb.ListExampleAutoIncFieldNameRequest.IndexKey.foo:type_name -> testpb.ListExampleAutoIncFieldNameRequest.IndexKey.Foo - 54, // 65: testpb.ListExampleAutoIncFieldNameRequest.RangeQuery.from:type_name -> testpb.ListExampleAutoIncFieldNameRequest.IndexKey - 54, // 66: testpb.ListExampleAutoIncFieldNameRequest.RangeQuery.to:type_name -> testpb.ListExampleAutoIncFieldNameRequest.IndexKey - 0, // 67: testpb.TestSchemaQueryService.GetExampleTable:input_type -> testpb.GetExampleTableRequest - 2, // 68: testpb.TestSchemaQueryService.GetExampleTableByU64Str:input_type -> testpb.GetExampleTableByU64StrRequest - 4, // 69: testpb.TestSchemaQueryService.ListExampleTable:input_type -> testpb.ListExampleTableRequest - 6, // 70: testpb.TestSchemaQueryService.GetExampleAutoIncrementTable:input_type -> testpb.GetExampleAutoIncrementTableRequest - 8, // 71: testpb.TestSchemaQueryService.GetExampleAutoIncrementTableByX:input_type -> testpb.GetExampleAutoIncrementTableByXRequest - 10, // 72: testpb.TestSchemaQueryService.ListExampleAutoIncrementTable:input_type -> testpb.ListExampleAutoIncrementTableRequest - 12, // 73: testpb.TestSchemaQueryService.GetExampleSingleton:input_type -> testpb.GetExampleSingletonRequest - 14, // 74: testpb.TestSchemaQueryService.GetExampleTimestamp:input_type -> testpb.GetExampleTimestampRequest - 16, // 75: testpb.TestSchemaQueryService.ListExampleTimestamp:input_type -> testpb.ListExampleTimestampRequest - 18, // 76: testpb.TestSchemaQueryService.GetExampleDuration:input_type -> testpb.GetExampleDurationRequest - 20, // 77: testpb.TestSchemaQueryService.ListExampleDuration:input_type -> testpb.ListExampleDurationRequest - 22, // 78: testpb.TestSchemaQueryService.GetSimpleExample:input_type -> testpb.GetSimpleExampleRequest - 24, // 79: testpb.TestSchemaQueryService.GetSimpleExampleByUnique:input_type -> testpb.GetSimpleExampleByUniqueRequest - 26, // 80: testpb.TestSchemaQueryService.ListSimpleExample:input_type -> testpb.ListSimpleExampleRequest - 28, // 81: testpb.TestSchemaQueryService.GetExampleAutoIncFieldName:input_type -> testpb.GetExampleAutoIncFieldNameRequest - 30, // 82: testpb.TestSchemaQueryService.ListExampleAutoIncFieldName:input_type -> testpb.ListExampleAutoIncFieldNameRequest - 1, // 83: testpb.TestSchemaQueryService.GetExampleTable:output_type -> testpb.GetExampleTableResponse - 3, // 84: testpb.TestSchemaQueryService.GetExampleTableByU64Str:output_type -> testpb.GetExampleTableByU64StrResponse - 5, // 85: testpb.TestSchemaQueryService.ListExampleTable:output_type -> testpb.ListExampleTableResponse - 7, // 86: testpb.TestSchemaQueryService.GetExampleAutoIncrementTable:output_type -> testpb.GetExampleAutoIncrementTableResponse - 9, // 87: testpb.TestSchemaQueryService.GetExampleAutoIncrementTableByX:output_type -> testpb.GetExampleAutoIncrementTableByXResponse - 11, // 88: testpb.TestSchemaQueryService.ListExampleAutoIncrementTable:output_type -> testpb.ListExampleAutoIncrementTableResponse - 13, // 89: testpb.TestSchemaQueryService.GetExampleSingleton:output_type -> testpb.GetExampleSingletonResponse - 15, // 90: testpb.TestSchemaQueryService.GetExampleTimestamp:output_type -> testpb.GetExampleTimestampResponse - 17, // 91: testpb.TestSchemaQueryService.ListExampleTimestamp:output_type -> testpb.ListExampleTimestampResponse - 19, // 92: testpb.TestSchemaQueryService.GetExampleDuration:output_type -> testpb.GetExampleDurationResponse - 21, // 93: testpb.TestSchemaQueryService.ListExampleDuration:output_type -> testpb.ListExampleDurationResponse - 23, // 94: testpb.TestSchemaQueryService.GetSimpleExample:output_type -> testpb.GetSimpleExampleResponse - 25, // 95: testpb.TestSchemaQueryService.GetSimpleExampleByUnique:output_type -> testpb.GetSimpleExampleByUniqueResponse - 27, // 96: testpb.TestSchemaQueryService.ListSimpleExample:output_type -> testpb.ListSimpleExampleResponse - 29, // 97: testpb.TestSchemaQueryService.GetExampleAutoIncFieldName:output_type -> testpb.GetExampleAutoIncFieldNameResponse - 31, // 98: testpb.TestSchemaQueryService.ListExampleAutoIncFieldName:output_type -> testpb.ListExampleAutoIncFieldNameResponse - 83, // [83:99] is the sub-list for method output_type - 67, // [67:83] is the sub-list for method input_type - 67, // [67:67] is the sub-list for extension type_name - 67, // [67:67] is the sub-list for extension extendee - 0, // [0:67] is the sub-list for field type_name -} - -func init() { file_testpb_test_schema_query_proto_init() } -func file_testpb_test_schema_query_proto_init() { - if File_testpb_test_schema_query_proto != nil { - return - } - file_testpb_test_schema_proto_init() - if !protoimpl.UnsafeEnabled { - file_testpb_test_schema_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExampleTableRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExampleTableResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExampleTableByU64StrRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExampleTableByU64StrResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleTableRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleTableResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExampleAutoIncrementTableRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExampleAutoIncrementTableResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExampleAutoIncrementTableByXRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExampleAutoIncrementTableByXResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleAutoIncrementTableRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleAutoIncrementTableResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExampleSingletonRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExampleSingletonResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExampleTimestampRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExampleTimestampResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleTimestampRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleTimestampResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExampleDurationRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExampleDurationResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleDurationRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleDurationResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetSimpleExampleRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetSimpleExampleResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetSimpleExampleByUniqueRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetSimpleExampleByUniqueResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListSimpleExampleRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListSimpleExampleResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExampleAutoIncFieldNameRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExampleAutoIncFieldNameResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleAutoIncFieldNameRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleAutoIncFieldNameResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleTableRequest_IndexKey); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleTableRequest_RangeQuery); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleTableRequest_IndexKey_U32I64Str); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleTableRequest_IndexKey_U64Str); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleTableRequest_IndexKey_StrU32); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleTableRequest_IndexKey_BzStr); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleAutoIncrementTableRequest_IndexKey); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleAutoIncrementTableRequest_RangeQuery); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleAutoIncrementTableRequest_IndexKey_Id); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleAutoIncrementTableRequest_IndexKey_X); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleTimestampRequest_IndexKey); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleTimestampRequest_RangeQuery); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleTimestampRequest_IndexKey_Id); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleTimestampRequest_IndexKey_Ts); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleDurationRequest_IndexKey); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleDurationRequest_RangeQuery); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleDurationRequest_IndexKey_Id); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleDurationRequest_IndexKey_Dur); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListSimpleExampleRequest_IndexKey); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListSimpleExampleRequest_RangeQuery); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListSimpleExampleRequest_IndexKey_Name); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListSimpleExampleRequest_IndexKey_Unique); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleAutoIncFieldNameRequest_IndexKey); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleAutoIncFieldNameRequest_RangeQuery); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleAutoIncFieldNameRequest_IndexKey_Foo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_testpb_test_schema_query_proto_msgTypes[4].OneofWrappers = []interface{}{ - (*ListExampleTableRequest_PrefixQuery)(nil), - (*ListExampleTableRequest_RangeQuery_)(nil), - } - file_testpb_test_schema_query_proto_msgTypes[10].OneofWrappers = []interface{}{ - (*ListExampleAutoIncrementTableRequest_PrefixQuery)(nil), - (*ListExampleAutoIncrementTableRequest_RangeQuery_)(nil), - } - file_testpb_test_schema_query_proto_msgTypes[16].OneofWrappers = []interface{}{ - (*ListExampleTimestampRequest_PrefixQuery)(nil), - (*ListExampleTimestampRequest_RangeQuery_)(nil), - } - file_testpb_test_schema_query_proto_msgTypes[20].OneofWrappers = []interface{}{ - (*ListExampleDurationRequest_PrefixQuery)(nil), - (*ListExampleDurationRequest_RangeQuery_)(nil), - } - file_testpb_test_schema_query_proto_msgTypes[26].OneofWrappers = []interface{}{ - (*ListSimpleExampleRequest_PrefixQuery)(nil), - (*ListSimpleExampleRequest_RangeQuery_)(nil), - } - file_testpb_test_schema_query_proto_msgTypes[30].OneofWrappers = []interface{}{ - (*ListExampleAutoIncFieldNameRequest_PrefixQuery)(nil), - (*ListExampleAutoIncFieldNameRequest_RangeQuery_)(nil), - } - file_testpb_test_schema_query_proto_msgTypes[32].OneofWrappers = []interface{}{ - (*ListExampleTableRequest_IndexKey_U_32I_64Str)(nil), - (*ListExampleTableRequest_IndexKey_U_64Str)(nil), - (*ListExampleTableRequest_IndexKey_StrU_32)(nil), - (*ListExampleTableRequest_IndexKey_BzStr_)(nil), - } - file_testpb_test_schema_query_proto_msgTypes[34].OneofWrappers = []interface{}{} - file_testpb_test_schema_query_proto_msgTypes[35].OneofWrappers = []interface{}{} - file_testpb_test_schema_query_proto_msgTypes[36].OneofWrappers = []interface{}{} - file_testpb_test_schema_query_proto_msgTypes[37].OneofWrappers = []interface{}{} - file_testpb_test_schema_query_proto_msgTypes[38].OneofWrappers = []interface{}{ - (*ListExampleAutoIncrementTableRequest_IndexKey_Id_)(nil), - (*ListExampleAutoIncrementTableRequest_IndexKey_X_)(nil), - } - file_testpb_test_schema_query_proto_msgTypes[40].OneofWrappers = []interface{}{} - file_testpb_test_schema_query_proto_msgTypes[41].OneofWrappers = []interface{}{} - file_testpb_test_schema_query_proto_msgTypes[42].OneofWrappers = []interface{}{ - (*ListExampleTimestampRequest_IndexKey_Id_)(nil), - (*ListExampleTimestampRequest_IndexKey_Ts_)(nil), - } - file_testpb_test_schema_query_proto_msgTypes[44].OneofWrappers = []interface{}{} - file_testpb_test_schema_query_proto_msgTypes[45].OneofWrappers = []interface{}{} - file_testpb_test_schema_query_proto_msgTypes[46].OneofWrappers = []interface{}{ - (*ListExampleDurationRequest_IndexKey_Id_)(nil), - (*ListExampleDurationRequest_IndexKey_Dur_)(nil), - } - file_testpb_test_schema_query_proto_msgTypes[48].OneofWrappers = []interface{}{} - file_testpb_test_schema_query_proto_msgTypes[49].OneofWrappers = []interface{}{} - file_testpb_test_schema_query_proto_msgTypes[50].OneofWrappers = []interface{}{ - (*ListSimpleExampleRequest_IndexKey_Name_)(nil), - (*ListSimpleExampleRequest_IndexKey_Unique_)(nil), - } - file_testpb_test_schema_query_proto_msgTypes[52].OneofWrappers = []interface{}{} - file_testpb_test_schema_query_proto_msgTypes[53].OneofWrappers = []interface{}{} - file_testpb_test_schema_query_proto_msgTypes[54].OneofWrappers = []interface{}{ - (*ListExampleAutoIncFieldNameRequest_IndexKey_Foo_)(nil), - } - file_testpb_test_schema_query_proto_msgTypes[56].OneofWrappers = []interface{}{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_testpb_test_schema_query_proto_rawDesc, - NumEnums: 0, - NumMessages: 57, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_testpb_test_schema_query_proto_goTypes, - DependencyIndexes: file_testpb_test_schema_query_proto_depIdxs, - MessageInfos: file_testpb_test_schema_query_proto_msgTypes, - }.Build() - File_testpb_test_schema_query_proto = out.File - file_testpb_test_schema_query_proto_rawDesc = nil - file_testpb_test_schema_query_proto_goTypes = nil - file_testpb_test_schema_query_proto_depIdxs = nil -} diff --git a/orm/internal/testpb/test_schema_query.proto b/orm/internal/testpb/test_schema_query.proto deleted file mode 100644 index 8e07ccfcfe80..000000000000 --- a/orm/internal/testpb/test_schema_query.proto +++ /dev/null @@ -1,514 +0,0 @@ -// Code generated by protoc-gen-go-cosmos-orm-proto. DO NOT EDIT. -syntax = "proto3"; -package testpb; - -import "cosmos/base/query/v1beta1/pagination.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "testpb/test_schema.proto"; - -// TestSchemaQueryService queries the state of the tables specified by testpb/test_schema.proto. -service TestSchemaQueryService { - // Get queries the ExampleTable table by its primary key. - rpc GetExampleTable(GetExampleTableRequest) returns (GetExampleTableResponse) {} - // GetExampleTableByU64Str queries the ExampleTable table by its U64Str index - rpc GetExampleTableByU64Str(GetExampleTableByU64StrRequest) returns (GetExampleTableByU64StrResponse) {} - // ListExampleTable queries the ExampleTable table using prefix and range queries against defined indexes. - rpc ListExampleTable(ListExampleTableRequest) returns (ListExampleTableResponse) {} - // Get queries the ExampleAutoIncrementTable table by its primary key. - rpc GetExampleAutoIncrementTable(GetExampleAutoIncrementTableRequest) returns (GetExampleAutoIncrementTableResponse) {} - // GetExampleAutoIncrementTableByX queries the ExampleAutoIncrementTable table by its X index - rpc GetExampleAutoIncrementTableByX(GetExampleAutoIncrementTableByXRequest) returns (GetExampleAutoIncrementTableByXResponse) {} - // ListExampleAutoIncrementTable queries the ExampleAutoIncrementTable table using prefix and range queries against defined indexes. - rpc ListExampleAutoIncrementTable(ListExampleAutoIncrementTableRequest) returns (ListExampleAutoIncrementTableResponse) {} - // GetExampleSingleton queries the ExampleSingleton singleton. - rpc GetExampleSingleton(GetExampleSingletonRequest) returns (GetExampleSingletonResponse) {} - // Get queries the ExampleTimestamp table by its primary key. - rpc GetExampleTimestamp(GetExampleTimestampRequest) returns (GetExampleTimestampResponse) {} - // ListExampleTimestamp queries the ExampleTimestamp table using prefix and range queries against defined indexes. - rpc ListExampleTimestamp(ListExampleTimestampRequest) returns (ListExampleTimestampResponse) {} - // Get queries the ExampleDuration table by its primary key. - rpc GetExampleDuration(GetExampleDurationRequest) returns (GetExampleDurationResponse) {} - // ListExampleDuration queries the ExampleDuration table using prefix and range queries against defined indexes. - rpc ListExampleDuration(ListExampleDurationRequest) returns (ListExampleDurationResponse) {} - // Get queries the SimpleExample table by its primary key. - rpc GetSimpleExample(GetSimpleExampleRequest) returns (GetSimpleExampleResponse) {} - // GetSimpleExampleByUnique queries the SimpleExample table by its Unique index - rpc GetSimpleExampleByUnique(GetSimpleExampleByUniqueRequest) returns (GetSimpleExampleByUniqueResponse) {} - // ListSimpleExample queries the SimpleExample table using prefix and range queries against defined indexes. - rpc ListSimpleExample(ListSimpleExampleRequest) returns (ListSimpleExampleResponse) {} - // Get queries the ExampleAutoIncFieldName table by its primary key. - rpc GetExampleAutoIncFieldName(GetExampleAutoIncFieldNameRequest) returns (GetExampleAutoIncFieldNameResponse) {} - // ListExampleAutoIncFieldName queries the ExampleAutoIncFieldName table using prefix and range queries against defined indexes. - rpc ListExampleAutoIncFieldName(ListExampleAutoIncFieldNameRequest) returns (ListExampleAutoIncFieldNameResponse) {} -} - -// GetExampleTableRequest is the TestSchemaQuery/GetExampleTableRequest request type. -message GetExampleTableRequest { - // u32 specifies the value of the u32 field in the primary key. - uint32 u32 = 1; - // i64 specifies the value of the i64 field in the primary key. - int64 i64 = 2; - // str specifies the value of the str field in the primary key. - string str = 3; -} - -// GetExampleTableResponse is the TestSchemaQuery/GetExampleTableResponse response type. -message GetExampleTableResponse { - // value is the response value. - ExampleTable value = 1; -} - -// GetExampleTableByU64StrRequest is the TestSchemaQuery/GetExampleTableByU64StrRequest request type. -message GetExampleTableByU64StrRequest { - uint64 u64 = 1; - string str = 2; -} - -// GetExampleTableByU64StrResponse is the TestSchemaQuery/GetExampleTableByU64StrResponse response type. -message GetExampleTableByU64StrResponse { - ExampleTable value = 1; -} - -// ListExampleTableRequest is the TestSchemaQuery/ListExampleTableRequest request type. -message ListExampleTableRequest { - // IndexKey specifies the value of an index key to use in prefix and range queries. - message IndexKey { - // key specifies the index key value. - oneof key { - // u_32_i_64_str specifies the value of the U32I64Str index key to use in the query. - U32I64Str u_32_i_64_str = 1; - // u_64_str specifies the value of the U64Str index key to use in the query. - U64Str u_64_str = 2; - // str_u_32 specifies the value of the StrU32 index key to use in the query. - StrU32 str_u_32 = 3; - // bz_str specifies the value of the BzStr index key to use in the query. - BzStr bz_str = 4; - } - - message U32I64Str { - // u32 is the value of the u32 field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional uint32 u32 = 1; - // i64 is the value of the i64 field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional int64 i64 = 2; - // str is the value of the str field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional string str = 3; - } - - message U64Str { - // u64 is the value of the u64 field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional uint64 u64 = 1; - // str is the value of the str field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional string str = 2; - } - - message StrU32 { - // str is the value of the str field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional string str = 1; - // u32 is the value of the u32 field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional uint32 u32 = 2; - } - - message BzStr { - // bz is the value of the bz field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional bytes bz = 1; - // str is the value of the str field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional string str = 2; - } - } - - // query specifies the type of query - either a prefix or range query. - oneof query { - // prefix_query specifies the index key value to use for the prefix query. - IndexKey prefix_query = 1; - // range_query specifies the index key from/to values to use for the range query. - RangeQuery range_query = 2; - } - // pagination specifies optional pagination parameters. - cosmos.base.query.v1beta1.PageRequest pagination = 3; - - // RangeQuery specifies the from/to index keys for a range query. - message RangeQuery { - // from is the index key to use for the start of the range query. - // To query from the start of an index, specify an index key for that index with empty values. - IndexKey from = 1; - // to is the index key to use for the end of the range query. - // The index key type MUST be the same as the index key type used for from. - // To query from to the end of an index it can be omitted. - IndexKey to = 2; - } -} - -// ListExampleTableResponse is the TestSchemaQuery/ListExampleTableResponse response type. -message ListExampleTableResponse { - // values are the results of the query. - repeated ExampleTable values = 1; - // pagination is the pagination response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// GetExampleAutoIncrementTableRequest is the TestSchemaQuery/GetExampleAutoIncrementTableRequest request type. -message GetExampleAutoIncrementTableRequest { - // id specifies the value of the id field in the primary key. - uint64 id = 1; -} - -// GetExampleAutoIncrementTableResponse is the TestSchemaQuery/GetExampleAutoIncrementTableResponse response type. -message GetExampleAutoIncrementTableResponse { - // value is the response value. - ExampleAutoIncrementTable value = 1; -} - -// GetExampleAutoIncrementTableByXRequest is the TestSchemaQuery/GetExampleAutoIncrementTableByXRequest request type. -message GetExampleAutoIncrementTableByXRequest { - string x = 1; -} - -// GetExampleAutoIncrementTableByXResponse is the TestSchemaQuery/GetExampleAutoIncrementTableByXResponse response type. -message GetExampleAutoIncrementTableByXResponse { - ExampleAutoIncrementTable value = 1; -} - -// ListExampleAutoIncrementTableRequest is the TestSchemaQuery/ListExampleAutoIncrementTableRequest request type. -message ListExampleAutoIncrementTableRequest { - // IndexKey specifies the value of an index key to use in prefix and range queries. - message IndexKey { - // key specifies the index key value. - oneof key { - // id specifies the value of the Id index key to use in the query. - Id id = 1; - // x specifies the value of the X index key to use in the query. - X x = 2; - } - - message Id { - // id is the value of the id field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional uint64 id = 1; - } - - message X { - // x is the value of the x field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional string x = 1; - } - } - - // query specifies the type of query - either a prefix or range query. - oneof query { - // prefix_query specifies the index key value to use for the prefix query. - IndexKey prefix_query = 1; - // range_query specifies the index key from/to values to use for the range query. - RangeQuery range_query = 2; - } - // pagination specifies optional pagination parameters. - cosmos.base.query.v1beta1.PageRequest pagination = 3; - - // RangeQuery specifies the from/to index keys for a range query. - message RangeQuery { - // from is the index key to use for the start of the range query. - // To query from the start of an index, specify an index key for that index with empty values. - IndexKey from = 1; - // to is the index key to use for the end of the range query. - // The index key type MUST be the same as the index key type used for from. - // To query from to the end of an index it can be omitted. - IndexKey to = 2; - } -} - -// ListExampleAutoIncrementTableResponse is the TestSchemaQuery/ListExampleAutoIncrementTableResponse response type. -message ListExampleAutoIncrementTableResponse { - // values are the results of the query. - repeated ExampleAutoIncrementTable values = 1; - // pagination is the pagination response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// GetExampleSingletonRequest is the TestSchemaQuery/GetExampleSingletonRequest request type. -message GetExampleSingletonRequest { -} - -// GetExampleSingletonResponse is the TestSchemaQuery/GetExampleSingletonResponse request type. -message GetExampleSingletonResponse { - ExampleSingleton value = 1; -} - -// GetExampleTimestampRequest is the TestSchemaQuery/GetExampleTimestampRequest request type. -message GetExampleTimestampRequest { - // id specifies the value of the id field in the primary key. - uint64 id = 1; -} - -// GetExampleTimestampResponse is the TestSchemaQuery/GetExampleTimestampResponse response type. -message GetExampleTimestampResponse { - // value is the response value. - ExampleTimestamp value = 1; -} - -// ListExampleTimestampRequest is the TestSchemaQuery/ListExampleTimestampRequest request type. -message ListExampleTimestampRequest { - // IndexKey specifies the value of an index key to use in prefix and range queries. - message IndexKey { - // key specifies the index key value. - oneof key { - // id specifies the value of the Id index key to use in the query. - Id id = 1; - // ts specifies the value of the Ts index key to use in the query. - Ts ts = 2; - } - - message Id { - // id is the value of the id field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional uint64 id = 1; - } - - message Ts { - // ts is the value of the ts field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional google.protobuf.Timestamp ts = 1; - } - } - - // query specifies the type of query - either a prefix or range query. - oneof query { - // prefix_query specifies the index key value to use for the prefix query. - IndexKey prefix_query = 1; - // range_query specifies the index key from/to values to use for the range query. - RangeQuery range_query = 2; - } - // pagination specifies optional pagination parameters. - cosmos.base.query.v1beta1.PageRequest pagination = 3; - - // RangeQuery specifies the from/to index keys for a range query. - message RangeQuery { - // from is the index key to use for the start of the range query. - // To query from the start of an index, specify an index key for that index with empty values. - IndexKey from = 1; - // to is the index key to use for the end of the range query. - // The index key type MUST be the same as the index key type used for from. - // To query from to the end of an index it can be omitted. - IndexKey to = 2; - } -} - -// ListExampleTimestampResponse is the TestSchemaQuery/ListExampleTimestampResponse response type. -message ListExampleTimestampResponse { - // values are the results of the query. - repeated ExampleTimestamp values = 1; - // pagination is the pagination response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// GetExampleDurationRequest is the TestSchemaQuery/GetExampleDurationRequest request type. -message GetExampleDurationRequest { - // id specifies the value of the id field in the primary key. - uint64 id = 1; -} - -// GetExampleDurationResponse is the TestSchemaQuery/GetExampleDurationResponse response type. -message GetExampleDurationResponse { - // value is the response value. - ExampleDuration value = 1; -} - -// ListExampleDurationRequest is the TestSchemaQuery/ListExampleDurationRequest request type. -message ListExampleDurationRequest { - // IndexKey specifies the value of an index key to use in prefix and range queries. - message IndexKey { - // key specifies the index key value. - oneof key { - // id specifies the value of the Id index key to use in the query. - Id id = 1; - // dur specifies the value of the Dur index key to use in the query. - Dur dur = 2; - } - - message Id { - // id is the value of the id field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional uint64 id = 1; - } - - message Dur { - // dur is the value of the dur field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional google.protobuf.Duration dur = 1; - } - } - - // query specifies the type of query - either a prefix or range query. - oneof query { - // prefix_query specifies the index key value to use for the prefix query. - IndexKey prefix_query = 1; - // range_query specifies the index key from/to values to use for the range query. - RangeQuery range_query = 2; - } - // pagination specifies optional pagination parameters. - cosmos.base.query.v1beta1.PageRequest pagination = 3; - - // RangeQuery specifies the from/to index keys for a range query. - message RangeQuery { - // from is the index key to use for the start of the range query. - // To query from the start of an index, specify an index key for that index with empty values. - IndexKey from = 1; - // to is the index key to use for the end of the range query. - // The index key type MUST be the same as the index key type used for from. - // To query from to the end of an index it can be omitted. - IndexKey to = 2; - } -} - -// ListExampleDurationResponse is the TestSchemaQuery/ListExampleDurationResponse response type. -message ListExampleDurationResponse { - // values are the results of the query. - repeated ExampleDuration values = 1; - // pagination is the pagination response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// GetSimpleExampleRequest is the TestSchemaQuery/GetSimpleExampleRequest request type. -message GetSimpleExampleRequest { - // name specifies the value of the name field in the primary key. - string name = 1; -} - -// GetSimpleExampleResponse is the TestSchemaQuery/GetSimpleExampleResponse response type. -message GetSimpleExampleResponse { - // value is the response value. - SimpleExample value = 1; -} - -// GetSimpleExampleByUniqueRequest is the TestSchemaQuery/GetSimpleExampleByUniqueRequest request type. -message GetSimpleExampleByUniqueRequest { - string unique = 1; -} - -// GetSimpleExampleByUniqueResponse is the TestSchemaQuery/GetSimpleExampleByUniqueResponse response type. -message GetSimpleExampleByUniqueResponse { - SimpleExample value = 1; -} - -// ListSimpleExampleRequest is the TestSchemaQuery/ListSimpleExampleRequest request type. -message ListSimpleExampleRequest { - // IndexKey specifies the value of an index key to use in prefix and range queries. - message IndexKey { - // key specifies the index key value. - oneof key { - // name specifies the value of the Name index key to use in the query. - Name name = 1; - // unique specifies the value of the Unique index key to use in the query. - Unique unique = 2; - } - - message Name { - // name is the value of the name field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional string name = 1; - } - - message Unique { - // unique is the value of the unique field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional string unique = 1; - } - } - - // query specifies the type of query - either a prefix or range query. - oneof query { - // prefix_query specifies the index key value to use for the prefix query. - IndexKey prefix_query = 1; - // range_query specifies the index key from/to values to use for the range query. - RangeQuery range_query = 2; - } - // pagination specifies optional pagination parameters. - cosmos.base.query.v1beta1.PageRequest pagination = 3; - - // RangeQuery specifies the from/to index keys for a range query. - message RangeQuery { - // from is the index key to use for the start of the range query. - // To query from the start of an index, specify an index key for that index with empty values. - IndexKey from = 1; - // to is the index key to use for the end of the range query. - // The index key type MUST be the same as the index key type used for from. - // To query from to the end of an index it can be omitted. - IndexKey to = 2; - } -} - -// ListSimpleExampleResponse is the TestSchemaQuery/ListSimpleExampleResponse response type. -message ListSimpleExampleResponse { - // values are the results of the query. - repeated SimpleExample values = 1; - // pagination is the pagination response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// GetExampleAutoIncFieldNameRequest is the TestSchemaQuery/GetExampleAutoIncFieldNameRequest request type. -message GetExampleAutoIncFieldNameRequest { - // foo specifies the value of the foo field in the primary key. - uint64 foo = 1; -} - -// GetExampleAutoIncFieldNameResponse is the TestSchemaQuery/GetExampleAutoIncFieldNameResponse response type. -message GetExampleAutoIncFieldNameResponse { - // value is the response value. - ExampleAutoIncFieldName value = 1; -} - -// ListExampleAutoIncFieldNameRequest is the TestSchemaQuery/ListExampleAutoIncFieldNameRequest request type. -message ListExampleAutoIncFieldNameRequest { - // IndexKey specifies the value of an index key to use in prefix and range queries. - message IndexKey { - // key specifies the index key value. - oneof key { - // foo specifies the value of the Foo index key to use in the query. - Foo foo = 1; - } - - message Foo { - // foo is the value of the foo field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional uint64 foo = 1; - } - } - - // query specifies the type of query - either a prefix or range query. - oneof query { - // prefix_query specifies the index key value to use for the prefix query. - IndexKey prefix_query = 1; - // range_query specifies the index key from/to values to use for the range query. - RangeQuery range_query = 2; - } - // pagination specifies optional pagination parameters. - cosmos.base.query.v1beta1.PageRequest pagination = 3; - - // RangeQuery specifies the from/to index keys for a range query. - message RangeQuery { - // from is the index key to use for the start of the range query. - // To query from the start of an index, specify an index key for that index with empty values. - IndexKey from = 1; - // to is the index key to use for the end of the range query. - // The index key type MUST be the same as the index key type used for from. - // To query from to the end of an index it can be omitted. - IndexKey to = 2; - } -} - -// ListExampleAutoIncFieldNameResponse is the TestSchemaQuery/ListExampleAutoIncFieldNameResponse response type. -message ListExampleAutoIncFieldNameResponse { - // values are the results of the query. - repeated ExampleAutoIncFieldName values = 1; - // pagination is the pagination response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - diff --git a/orm/internal/testpb/test_schema_query_grpc.pb.go b/orm/internal/testpb/test_schema_query_grpc.pb.go deleted file mode 100644 index 3043f57c516d..000000000000 --- a/orm/internal/testpb/test_schema_query_grpc.pb.go +++ /dev/null @@ -1,699 +0,0 @@ -// Code generated by protoc-gen-go-cosmos-orm-proto. DO NOT EDIT. - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc (unknown) -// source: testpb/test_schema_query.proto - -package testpb - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - TestSchemaQueryService_GetExampleTable_FullMethodName = "/testpb.TestSchemaQueryService/GetExampleTable" - TestSchemaQueryService_GetExampleTableByU64Str_FullMethodName = "/testpb.TestSchemaQueryService/GetExampleTableByU64Str" - TestSchemaQueryService_ListExampleTable_FullMethodName = "/testpb.TestSchemaQueryService/ListExampleTable" - TestSchemaQueryService_GetExampleAutoIncrementTable_FullMethodName = "/testpb.TestSchemaQueryService/GetExampleAutoIncrementTable" - TestSchemaQueryService_GetExampleAutoIncrementTableByX_FullMethodName = "/testpb.TestSchemaQueryService/GetExampleAutoIncrementTableByX" - TestSchemaQueryService_ListExampleAutoIncrementTable_FullMethodName = "/testpb.TestSchemaQueryService/ListExampleAutoIncrementTable" - TestSchemaQueryService_GetExampleSingleton_FullMethodName = "/testpb.TestSchemaQueryService/GetExampleSingleton" - TestSchemaQueryService_GetExampleTimestamp_FullMethodName = "/testpb.TestSchemaQueryService/GetExampleTimestamp" - TestSchemaQueryService_ListExampleTimestamp_FullMethodName = "/testpb.TestSchemaQueryService/ListExampleTimestamp" - TestSchemaQueryService_GetExampleDuration_FullMethodName = "/testpb.TestSchemaQueryService/GetExampleDuration" - TestSchemaQueryService_ListExampleDuration_FullMethodName = "/testpb.TestSchemaQueryService/ListExampleDuration" - TestSchemaQueryService_GetSimpleExample_FullMethodName = "/testpb.TestSchemaQueryService/GetSimpleExample" - TestSchemaQueryService_GetSimpleExampleByUnique_FullMethodName = "/testpb.TestSchemaQueryService/GetSimpleExampleByUnique" - TestSchemaQueryService_ListSimpleExample_FullMethodName = "/testpb.TestSchemaQueryService/ListSimpleExample" - TestSchemaQueryService_GetExampleAutoIncFieldName_FullMethodName = "/testpb.TestSchemaQueryService/GetExampleAutoIncFieldName" - TestSchemaQueryService_ListExampleAutoIncFieldName_FullMethodName = "/testpb.TestSchemaQueryService/ListExampleAutoIncFieldName" -) - -// TestSchemaQueryServiceClient is the client API for TestSchemaQueryService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type TestSchemaQueryServiceClient interface { - // Get queries the ExampleTable table by its primary key. - GetExampleTable(ctx context.Context, in *GetExampleTableRequest, opts ...grpc.CallOption) (*GetExampleTableResponse, error) - // GetExampleTableByU64Str queries the ExampleTable table by its U64Str index - GetExampleTableByU64Str(ctx context.Context, in *GetExampleTableByU64StrRequest, opts ...grpc.CallOption) (*GetExampleTableByU64StrResponse, error) - // ListExampleTable queries the ExampleTable table using prefix and range queries against defined indexes. - ListExampleTable(ctx context.Context, in *ListExampleTableRequest, opts ...grpc.CallOption) (*ListExampleTableResponse, error) - // Get queries the ExampleAutoIncrementTable table by its primary key. - GetExampleAutoIncrementTable(ctx context.Context, in *GetExampleAutoIncrementTableRequest, opts ...grpc.CallOption) (*GetExampleAutoIncrementTableResponse, error) - // GetExampleAutoIncrementTableByX queries the ExampleAutoIncrementTable table by its X index - GetExampleAutoIncrementTableByX(ctx context.Context, in *GetExampleAutoIncrementTableByXRequest, opts ...grpc.CallOption) (*GetExampleAutoIncrementTableByXResponse, error) - // ListExampleAutoIncrementTable queries the ExampleAutoIncrementTable table using prefix and range queries against defined indexes. - ListExampleAutoIncrementTable(ctx context.Context, in *ListExampleAutoIncrementTableRequest, opts ...grpc.CallOption) (*ListExampleAutoIncrementTableResponse, error) - // GetExampleSingleton queries the ExampleSingleton singleton. - GetExampleSingleton(ctx context.Context, in *GetExampleSingletonRequest, opts ...grpc.CallOption) (*GetExampleSingletonResponse, error) - // Get queries the ExampleTimestamp table by its primary key. - GetExampleTimestamp(ctx context.Context, in *GetExampleTimestampRequest, opts ...grpc.CallOption) (*GetExampleTimestampResponse, error) - // ListExampleTimestamp queries the ExampleTimestamp table using prefix and range queries against defined indexes. - ListExampleTimestamp(ctx context.Context, in *ListExampleTimestampRequest, opts ...grpc.CallOption) (*ListExampleTimestampResponse, error) - // Get queries the ExampleDuration table by its primary key. - GetExampleDuration(ctx context.Context, in *GetExampleDurationRequest, opts ...grpc.CallOption) (*GetExampleDurationResponse, error) - // ListExampleDuration queries the ExampleDuration table using prefix and range queries against defined indexes. - ListExampleDuration(ctx context.Context, in *ListExampleDurationRequest, opts ...grpc.CallOption) (*ListExampleDurationResponse, error) - // Get queries the SimpleExample table by its primary key. - GetSimpleExample(ctx context.Context, in *GetSimpleExampleRequest, opts ...grpc.CallOption) (*GetSimpleExampleResponse, error) - // GetSimpleExampleByUnique queries the SimpleExample table by its Unique index - GetSimpleExampleByUnique(ctx context.Context, in *GetSimpleExampleByUniqueRequest, opts ...grpc.CallOption) (*GetSimpleExampleByUniqueResponse, error) - // ListSimpleExample queries the SimpleExample table using prefix and range queries against defined indexes. - ListSimpleExample(ctx context.Context, in *ListSimpleExampleRequest, opts ...grpc.CallOption) (*ListSimpleExampleResponse, error) - // Get queries the ExampleAutoIncFieldName table by its primary key. - GetExampleAutoIncFieldName(ctx context.Context, in *GetExampleAutoIncFieldNameRequest, opts ...grpc.CallOption) (*GetExampleAutoIncFieldNameResponse, error) - // ListExampleAutoIncFieldName queries the ExampleAutoIncFieldName table using prefix and range queries against defined indexes. - ListExampleAutoIncFieldName(ctx context.Context, in *ListExampleAutoIncFieldNameRequest, opts ...grpc.CallOption) (*ListExampleAutoIncFieldNameResponse, error) -} - -type testSchemaQueryServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewTestSchemaQueryServiceClient(cc grpc.ClientConnInterface) TestSchemaQueryServiceClient { - return &testSchemaQueryServiceClient{cc} -} - -func (c *testSchemaQueryServiceClient) GetExampleTable(ctx context.Context, in *GetExampleTableRequest, opts ...grpc.CallOption) (*GetExampleTableResponse, error) { - out := new(GetExampleTableResponse) - err := c.cc.Invoke(ctx, TestSchemaQueryService_GetExampleTable_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testSchemaQueryServiceClient) GetExampleTableByU64Str(ctx context.Context, in *GetExampleTableByU64StrRequest, opts ...grpc.CallOption) (*GetExampleTableByU64StrResponse, error) { - out := new(GetExampleTableByU64StrResponse) - err := c.cc.Invoke(ctx, TestSchemaQueryService_GetExampleTableByU64Str_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testSchemaQueryServiceClient) ListExampleTable(ctx context.Context, in *ListExampleTableRequest, opts ...grpc.CallOption) (*ListExampleTableResponse, error) { - out := new(ListExampleTableResponse) - err := c.cc.Invoke(ctx, TestSchemaQueryService_ListExampleTable_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testSchemaQueryServiceClient) GetExampleAutoIncrementTable(ctx context.Context, in *GetExampleAutoIncrementTableRequest, opts ...grpc.CallOption) (*GetExampleAutoIncrementTableResponse, error) { - out := new(GetExampleAutoIncrementTableResponse) - err := c.cc.Invoke(ctx, TestSchemaQueryService_GetExampleAutoIncrementTable_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testSchemaQueryServiceClient) GetExampleAutoIncrementTableByX(ctx context.Context, in *GetExampleAutoIncrementTableByXRequest, opts ...grpc.CallOption) (*GetExampleAutoIncrementTableByXResponse, error) { - out := new(GetExampleAutoIncrementTableByXResponse) - err := c.cc.Invoke(ctx, TestSchemaQueryService_GetExampleAutoIncrementTableByX_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testSchemaQueryServiceClient) ListExampleAutoIncrementTable(ctx context.Context, in *ListExampleAutoIncrementTableRequest, opts ...grpc.CallOption) (*ListExampleAutoIncrementTableResponse, error) { - out := new(ListExampleAutoIncrementTableResponse) - err := c.cc.Invoke(ctx, TestSchemaQueryService_ListExampleAutoIncrementTable_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testSchemaQueryServiceClient) GetExampleSingleton(ctx context.Context, in *GetExampleSingletonRequest, opts ...grpc.CallOption) (*GetExampleSingletonResponse, error) { - out := new(GetExampleSingletonResponse) - err := c.cc.Invoke(ctx, TestSchemaQueryService_GetExampleSingleton_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testSchemaQueryServiceClient) GetExampleTimestamp(ctx context.Context, in *GetExampleTimestampRequest, opts ...grpc.CallOption) (*GetExampleTimestampResponse, error) { - out := new(GetExampleTimestampResponse) - err := c.cc.Invoke(ctx, TestSchemaQueryService_GetExampleTimestamp_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testSchemaQueryServiceClient) ListExampleTimestamp(ctx context.Context, in *ListExampleTimestampRequest, opts ...grpc.CallOption) (*ListExampleTimestampResponse, error) { - out := new(ListExampleTimestampResponse) - err := c.cc.Invoke(ctx, TestSchemaQueryService_ListExampleTimestamp_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testSchemaQueryServiceClient) GetExampleDuration(ctx context.Context, in *GetExampleDurationRequest, opts ...grpc.CallOption) (*GetExampleDurationResponse, error) { - out := new(GetExampleDurationResponse) - err := c.cc.Invoke(ctx, TestSchemaQueryService_GetExampleDuration_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testSchemaQueryServiceClient) ListExampleDuration(ctx context.Context, in *ListExampleDurationRequest, opts ...grpc.CallOption) (*ListExampleDurationResponse, error) { - out := new(ListExampleDurationResponse) - err := c.cc.Invoke(ctx, TestSchemaQueryService_ListExampleDuration_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testSchemaQueryServiceClient) GetSimpleExample(ctx context.Context, in *GetSimpleExampleRequest, opts ...grpc.CallOption) (*GetSimpleExampleResponse, error) { - out := new(GetSimpleExampleResponse) - err := c.cc.Invoke(ctx, TestSchemaQueryService_GetSimpleExample_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testSchemaQueryServiceClient) GetSimpleExampleByUnique(ctx context.Context, in *GetSimpleExampleByUniqueRequest, opts ...grpc.CallOption) (*GetSimpleExampleByUniqueResponse, error) { - out := new(GetSimpleExampleByUniqueResponse) - err := c.cc.Invoke(ctx, TestSchemaQueryService_GetSimpleExampleByUnique_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testSchemaQueryServiceClient) ListSimpleExample(ctx context.Context, in *ListSimpleExampleRequest, opts ...grpc.CallOption) (*ListSimpleExampleResponse, error) { - out := new(ListSimpleExampleResponse) - err := c.cc.Invoke(ctx, TestSchemaQueryService_ListSimpleExample_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testSchemaQueryServiceClient) GetExampleAutoIncFieldName(ctx context.Context, in *GetExampleAutoIncFieldNameRequest, opts ...grpc.CallOption) (*GetExampleAutoIncFieldNameResponse, error) { - out := new(GetExampleAutoIncFieldNameResponse) - err := c.cc.Invoke(ctx, TestSchemaQueryService_GetExampleAutoIncFieldName_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testSchemaQueryServiceClient) ListExampleAutoIncFieldName(ctx context.Context, in *ListExampleAutoIncFieldNameRequest, opts ...grpc.CallOption) (*ListExampleAutoIncFieldNameResponse, error) { - out := new(ListExampleAutoIncFieldNameResponse) - err := c.cc.Invoke(ctx, TestSchemaQueryService_ListExampleAutoIncFieldName_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// TestSchemaQueryServiceServer is the server API for TestSchemaQueryService service. -// All implementations must embed UnimplementedTestSchemaQueryServiceServer -// for forward compatibility -type TestSchemaQueryServiceServer interface { - // Get queries the ExampleTable table by its primary key. - GetExampleTable(context.Context, *GetExampleTableRequest) (*GetExampleTableResponse, error) - // GetExampleTableByU64Str queries the ExampleTable table by its U64Str index - GetExampleTableByU64Str(context.Context, *GetExampleTableByU64StrRequest) (*GetExampleTableByU64StrResponse, error) - // ListExampleTable queries the ExampleTable table using prefix and range queries against defined indexes. - ListExampleTable(context.Context, *ListExampleTableRequest) (*ListExampleTableResponse, error) - // Get queries the ExampleAutoIncrementTable table by its primary key. - GetExampleAutoIncrementTable(context.Context, *GetExampleAutoIncrementTableRequest) (*GetExampleAutoIncrementTableResponse, error) - // GetExampleAutoIncrementTableByX queries the ExampleAutoIncrementTable table by its X index - GetExampleAutoIncrementTableByX(context.Context, *GetExampleAutoIncrementTableByXRequest) (*GetExampleAutoIncrementTableByXResponse, error) - // ListExampleAutoIncrementTable queries the ExampleAutoIncrementTable table using prefix and range queries against defined indexes. - ListExampleAutoIncrementTable(context.Context, *ListExampleAutoIncrementTableRequest) (*ListExampleAutoIncrementTableResponse, error) - // GetExampleSingleton queries the ExampleSingleton singleton. - GetExampleSingleton(context.Context, *GetExampleSingletonRequest) (*GetExampleSingletonResponse, error) - // Get queries the ExampleTimestamp table by its primary key. - GetExampleTimestamp(context.Context, *GetExampleTimestampRequest) (*GetExampleTimestampResponse, error) - // ListExampleTimestamp queries the ExampleTimestamp table using prefix and range queries against defined indexes. - ListExampleTimestamp(context.Context, *ListExampleTimestampRequest) (*ListExampleTimestampResponse, error) - // Get queries the ExampleDuration table by its primary key. - GetExampleDuration(context.Context, *GetExampleDurationRequest) (*GetExampleDurationResponse, error) - // ListExampleDuration queries the ExampleDuration table using prefix and range queries against defined indexes. - ListExampleDuration(context.Context, *ListExampleDurationRequest) (*ListExampleDurationResponse, error) - // Get queries the SimpleExample table by its primary key. - GetSimpleExample(context.Context, *GetSimpleExampleRequest) (*GetSimpleExampleResponse, error) - // GetSimpleExampleByUnique queries the SimpleExample table by its Unique index - GetSimpleExampleByUnique(context.Context, *GetSimpleExampleByUniqueRequest) (*GetSimpleExampleByUniqueResponse, error) - // ListSimpleExample queries the SimpleExample table using prefix and range queries against defined indexes. - ListSimpleExample(context.Context, *ListSimpleExampleRequest) (*ListSimpleExampleResponse, error) - // Get queries the ExampleAutoIncFieldName table by its primary key. - GetExampleAutoIncFieldName(context.Context, *GetExampleAutoIncFieldNameRequest) (*GetExampleAutoIncFieldNameResponse, error) - // ListExampleAutoIncFieldName queries the ExampleAutoIncFieldName table using prefix and range queries against defined indexes. - ListExampleAutoIncFieldName(context.Context, *ListExampleAutoIncFieldNameRequest) (*ListExampleAutoIncFieldNameResponse, error) - mustEmbedUnimplementedTestSchemaQueryServiceServer() -} - -// UnimplementedTestSchemaQueryServiceServer must be embedded to have forward compatible implementations. -type UnimplementedTestSchemaQueryServiceServer struct { -} - -func (UnimplementedTestSchemaQueryServiceServer) GetExampleTable(context.Context, *GetExampleTableRequest) (*GetExampleTableResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetExampleTable not implemented") -} -func (UnimplementedTestSchemaQueryServiceServer) GetExampleTableByU64Str(context.Context, *GetExampleTableByU64StrRequest) (*GetExampleTableByU64StrResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetExampleTableByU64Str not implemented") -} -func (UnimplementedTestSchemaQueryServiceServer) ListExampleTable(context.Context, *ListExampleTableRequest) (*ListExampleTableResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListExampleTable not implemented") -} -func (UnimplementedTestSchemaQueryServiceServer) GetExampleAutoIncrementTable(context.Context, *GetExampleAutoIncrementTableRequest) (*GetExampleAutoIncrementTableResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetExampleAutoIncrementTable not implemented") -} -func (UnimplementedTestSchemaQueryServiceServer) GetExampleAutoIncrementTableByX(context.Context, *GetExampleAutoIncrementTableByXRequest) (*GetExampleAutoIncrementTableByXResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetExampleAutoIncrementTableByX not implemented") -} -func (UnimplementedTestSchemaQueryServiceServer) ListExampleAutoIncrementTable(context.Context, *ListExampleAutoIncrementTableRequest) (*ListExampleAutoIncrementTableResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListExampleAutoIncrementTable not implemented") -} -func (UnimplementedTestSchemaQueryServiceServer) GetExampleSingleton(context.Context, *GetExampleSingletonRequest) (*GetExampleSingletonResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetExampleSingleton not implemented") -} -func (UnimplementedTestSchemaQueryServiceServer) GetExampleTimestamp(context.Context, *GetExampleTimestampRequest) (*GetExampleTimestampResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetExampleTimestamp not implemented") -} -func (UnimplementedTestSchemaQueryServiceServer) ListExampleTimestamp(context.Context, *ListExampleTimestampRequest) (*ListExampleTimestampResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListExampleTimestamp not implemented") -} -func (UnimplementedTestSchemaQueryServiceServer) GetExampleDuration(context.Context, *GetExampleDurationRequest) (*GetExampleDurationResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetExampleDuration not implemented") -} -func (UnimplementedTestSchemaQueryServiceServer) ListExampleDuration(context.Context, *ListExampleDurationRequest) (*ListExampleDurationResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListExampleDuration not implemented") -} -func (UnimplementedTestSchemaQueryServiceServer) GetSimpleExample(context.Context, *GetSimpleExampleRequest) (*GetSimpleExampleResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetSimpleExample not implemented") -} -func (UnimplementedTestSchemaQueryServiceServer) GetSimpleExampleByUnique(context.Context, *GetSimpleExampleByUniqueRequest) (*GetSimpleExampleByUniqueResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetSimpleExampleByUnique not implemented") -} -func (UnimplementedTestSchemaQueryServiceServer) ListSimpleExample(context.Context, *ListSimpleExampleRequest) (*ListSimpleExampleResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListSimpleExample not implemented") -} -func (UnimplementedTestSchemaQueryServiceServer) GetExampleAutoIncFieldName(context.Context, *GetExampleAutoIncFieldNameRequest) (*GetExampleAutoIncFieldNameResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetExampleAutoIncFieldName not implemented") -} -func (UnimplementedTestSchemaQueryServiceServer) ListExampleAutoIncFieldName(context.Context, *ListExampleAutoIncFieldNameRequest) (*ListExampleAutoIncFieldNameResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListExampleAutoIncFieldName not implemented") -} -func (UnimplementedTestSchemaQueryServiceServer) mustEmbedUnimplementedTestSchemaQueryServiceServer() { -} - -// UnsafeTestSchemaQueryServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to TestSchemaQueryServiceServer will -// result in compilation errors. -type UnsafeTestSchemaQueryServiceServer interface { - mustEmbedUnimplementedTestSchemaQueryServiceServer() -} - -func RegisterTestSchemaQueryServiceServer(s grpc.ServiceRegistrar, srv TestSchemaQueryServiceServer) { - s.RegisterService(&TestSchemaQueryService_ServiceDesc, srv) -} - -func _TestSchemaQueryService_GetExampleTable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetExampleTableRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestSchemaQueryServiceServer).GetExampleTable(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TestSchemaQueryService_GetExampleTable_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestSchemaQueryServiceServer).GetExampleTable(ctx, req.(*GetExampleTableRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TestSchemaQueryService_GetExampleTableByU64Str_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetExampleTableByU64StrRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestSchemaQueryServiceServer).GetExampleTableByU64Str(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TestSchemaQueryService_GetExampleTableByU64Str_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestSchemaQueryServiceServer).GetExampleTableByU64Str(ctx, req.(*GetExampleTableByU64StrRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TestSchemaQueryService_ListExampleTable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListExampleTableRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestSchemaQueryServiceServer).ListExampleTable(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TestSchemaQueryService_ListExampleTable_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestSchemaQueryServiceServer).ListExampleTable(ctx, req.(*ListExampleTableRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TestSchemaQueryService_GetExampleAutoIncrementTable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetExampleAutoIncrementTableRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestSchemaQueryServiceServer).GetExampleAutoIncrementTable(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TestSchemaQueryService_GetExampleAutoIncrementTable_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestSchemaQueryServiceServer).GetExampleAutoIncrementTable(ctx, req.(*GetExampleAutoIncrementTableRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TestSchemaQueryService_GetExampleAutoIncrementTableByX_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetExampleAutoIncrementTableByXRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestSchemaQueryServiceServer).GetExampleAutoIncrementTableByX(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TestSchemaQueryService_GetExampleAutoIncrementTableByX_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestSchemaQueryServiceServer).GetExampleAutoIncrementTableByX(ctx, req.(*GetExampleAutoIncrementTableByXRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TestSchemaQueryService_ListExampleAutoIncrementTable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListExampleAutoIncrementTableRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestSchemaQueryServiceServer).ListExampleAutoIncrementTable(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TestSchemaQueryService_ListExampleAutoIncrementTable_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestSchemaQueryServiceServer).ListExampleAutoIncrementTable(ctx, req.(*ListExampleAutoIncrementTableRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TestSchemaQueryService_GetExampleSingleton_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetExampleSingletonRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestSchemaQueryServiceServer).GetExampleSingleton(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TestSchemaQueryService_GetExampleSingleton_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestSchemaQueryServiceServer).GetExampleSingleton(ctx, req.(*GetExampleSingletonRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TestSchemaQueryService_GetExampleTimestamp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetExampleTimestampRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestSchemaQueryServiceServer).GetExampleTimestamp(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TestSchemaQueryService_GetExampleTimestamp_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestSchemaQueryServiceServer).GetExampleTimestamp(ctx, req.(*GetExampleTimestampRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TestSchemaQueryService_ListExampleTimestamp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListExampleTimestampRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestSchemaQueryServiceServer).ListExampleTimestamp(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TestSchemaQueryService_ListExampleTimestamp_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestSchemaQueryServiceServer).ListExampleTimestamp(ctx, req.(*ListExampleTimestampRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TestSchemaQueryService_GetExampleDuration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetExampleDurationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestSchemaQueryServiceServer).GetExampleDuration(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TestSchemaQueryService_GetExampleDuration_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestSchemaQueryServiceServer).GetExampleDuration(ctx, req.(*GetExampleDurationRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TestSchemaQueryService_ListExampleDuration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListExampleDurationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestSchemaQueryServiceServer).ListExampleDuration(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TestSchemaQueryService_ListExampleDuration_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestSchemaQueryServiceServer).ListExampleDuration(ctx, req.(*ListExampleDurationRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TestSchemaQueryService_GetSimpleExample_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetSimpleExampleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestSchemaQueryServiceServer).GetSimpleExample(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TestSchemaQueryService_GetSimpleExample_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestSchemaQueryServiceServer).GetSimpleExample(ctx, req.(*GetSimpleExampleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TestSchemaQueryService_GetSimpleExampleByUnique_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetSimpleExampleByUniqueRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestSchemaQueryServiceServer).GetSimpleExampleByUnique(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TestSchemaQueryService_GetSimpleExampleByUnique_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestSchemaQueryServiceServer).GetSimpleExampleByUnique(ctx, req.(*GetSimpleExampleByUniqueRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TestSchemaQueryService_ListSimpleExample_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListSimpleExampleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestSchemaQueryServiceServer).ListSimpleExample(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TestSchemaQueryService_ListSimpleExample_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestSchemaQueryServiceServer).ListSimpleExample(ctx, req.(*ListSimpleExampleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TestSchemaQueryService_GetExampleAutoIncFieldName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetExampleAutoIncFieldNameRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestSchemaQueryServiceServer).GetExampleAutoIncFieldName(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TestSchemaQueryService_GetExampleAutoIncFieldName_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestSchemaQueryServiceServer).GetExampleAutoIncFieldName(ctx, req.(*GetExampleAutoIncFieldNameRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TestSchemaQueryService_ListExampleAutoIncFieldName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListExampleAutoIncFieldNameRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestSchemaQueryServiceServer).ListExampleAutoIncFieldName(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TestSchemaQueryService_ListExampleAutoIncFieldName_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestSchemaQueryServiceServer).ListExampleAutoIncFieldName(ctx, req.(*ListExampleAutoIncFieldNameRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// TestSchemaQueryService_ServiceDesc is the grpc.ServiceDesc for TestSchemaQueryService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var TestSchemaQueryService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "testpb.TestSchemaQueryService", - HandlerType: (*TestSchemaQueryServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetExampleTable", - Handler: _TestSchemaQueryService_GetExampleTable_Handler, - }, - { - MethodName: "GetExampleTableByU64Str", - Handler: _TestSchemaQueryService_GetExampleTableByU64Str_Handler, - }, - { - MethodName: "ListExampleTable", - Handler: _TestSchemaQueryService_ListExampleTable_Handler, - }, - { - MethodName: "GetExampleAutoIncrementTable", - Handler: _TestSchemaQueryService_GetExampleAutoIncrementTable_Handler, - }, - { - MethodName: "GetExampleAutoIncrementTableByX", - Handler: _TestSchemaQueryService_GetExampleAutoIncrementTableByX_Handler, - }, - { - MethodName: "ListExampleAutoIncrementTable", - Handler: _TestSchemaQueryService_ListExampleAutoIncrementTable_Handler, - }, - { - MethodName: "GetExampleSingleton", - Handler: _TestSchemaQueryService_GetExampleSingleton_Handler, - }, - { - MethodName: "GetExampleTimestamp", - Handler: _TestSchemaQueryService_GetExampleTimestamp_Handler, - }, - { - MethodName: "ListExampleTimestamp", - Handler: _TestSchemaQueryService_ListExampleTimestamp_Handler, - }, - { - MethodName: "GetExampleDuration", - Handler: _TestSchemaQueryService_GetExampleDuration_Handler, - }, - { - MethodName: "ListExampleDuration", - Handler: _TestSchemaQueryService_ListExampleDuration_Handler, - }, - { - MethodName: "GetSimpleExample", - Handler: _TestSchemaQueryService_GetSimpleExample_Handler, - }, - { - MethodName: "GetSimpleExampleByUnique", - Handler: _TestSchemaQueryService_GetSimpleExampleByUnique_Handler, - }, - { - MethodName: "ListSimpleExample", - Handler: _TestSchemaQueryService_ListSimpleExample_Handler, - }, - { - MethodName: "GetExampleAutoIncFieldName", - Handler: _TestSchemaQueryService_GetExampleAutoIncFieldName_Handler, - }, - { - MethodName: "ListExampleAutoIncFieldName", - Handler: _TestSchemaQueryService_ListExampleAutoIncFieldName_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "testpb/test_schema_query.proto", -} diff --git a/orm/internal/testutil/testutil.go b/orm/internal/testutil/testutil.go deleted file mode 100644 index ea9c29f33efd..000000000000 --- a/orm/internal/testutil/testutil.go +++ /dev/null @@ -1,199 +0,0 @@ -package testutil - -import ( - "fmt" - "math" - "strings" - - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/types/known/durationpb" - "google.golang.org/protobuf/types/known/timestamppb" - "pgregory.net/rapid" - - "cosmossdk.io/orm/encoding/ormfield" - "cosmossdk.io/orm/encoding/ormkv" - "cosmossdk.io/orm/internal/testpb" -) - -// TestFieldSpec defines a test field against the testpb.ExampleTable message. -type TestFieldSpec struct { - FieldName protoreflect.Name - Gen *rapid.Generator[any] -} - -var TestFieldSpecs = []TestFieldSpec{ - { - "u32", - rapid.Uint32().AsAny(), - }, - { - "u64", - rapid.Uint64().AsAny(), - }, - { - "str", - rapid.String().Filter(func(x string) bool { - // filter out null terminators - return strings.IndexByte(x, 0) < 0 - }).AsAny(), - }, - { - "bz", - rapid.SliceOfN(rapid.Byte(), 0, math.MaxUint32).AsAny(), - }, - { - "i32", - rapid.Int32().AsAny(), - }, - { - "f32", - rapid.Uint32().AsAny(), - }, - { - "s32", - rapid.Int32().AsAny(), - }, - { - "sf32", - rapid.Int32().AsAny(), - }, - { - "i64", - rapid.Int64().AsAny(), - }, - { - "f64", - rapid.Uint64().AsAny(), - }, - { - "s64", - rapid.Int64().AsAny(), - }, - { - "sf64", - rapid.Int64().AsAny(), - }, - { - "b", - rapid.Bool().AsAny(), - }, - { - "ts", - rapid.Custom(func(t *rapid.T) protoreflect.Message { - isNil := rapid.Float32().Draw(t, "isNil") - if isNil >= 0.95 { // draw a nil 5% of the time - return nil - } - seconds := rapid.Int64Range(ormfield.TimestampSecondsMin, ormfield.TimestampSecondsMax).Draw(t, "seconds") - nanos := rapid.Int32Range(0, ormfield.TimestampNanosMax).Draw(t, "nanos") - return (×tamppb.Timestamp{ - Seconds: seconds, - Nanos: nanos, - }).ProtoReflect() - }).AsAny(), - }, - { - "dur", - rapid.Custom(func(t *rapid.T) protoreflect.Message { - isNil := rapid.Float32().Draw(t, "isNil") - if isNil >= 0.95 { // draw a nil 5% of the time - return nil - } - seconds := rapid.Int64Range(ormfield.DurationNanosMin, ormfield.DurationNanosMax).Draw(t, "seconds") - nanos := rapid.Int32Range(0, ormfield.DurationNanosMax).Draw(t, "nanos") - if seconds < 0 { - nanos = -nanos - } - return (&durationpb.Duration{ - Seconds: seconds, - Nanos: nanos, - }).ProtoReflect() - }).AsAny(), - }, - { - "e", - rapid.Map(rapid.Int32(), func(x int32) protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) - }).AsAny(), - }, -} - -func MakeTestCodec(fname protoreflect.Name, nonTerminal bool) (ormfield.Codec, error) { - field := GetTestField(fname) - if field == nil { - return nil, fmt.Errorf("can't find field %s", fname) - } - return ormfield.GetCodec(field, nonTerminal) -} - -func GetTestField(fname protoreflect.Name) protoreflect.FieldDescriptor { - a := &testpb.ExampleTable{} - return a.ProtoReflect().Descriptor().Fields().ByName(fname) -} - -type TestKeyCodec struct { - KeySpecs []TestFieldSpec - Codec *ormkv.KeyCodec -} - -func TestFieldSpecsGen(minLen, maxLen int) *rapid.Generator[[]TestFieldSpec] { - return rapid.Custom(func(t *rapid.T) []TestFieldSpec { - xs := rapid.SliceOfNDistinct(rapid.IntRange(0, len(TestFieldSpecs)-1), minLen, maxLen, func(i int) int { return i }). - Draw(t, "fieldSpecIndexes") - - var specs []TestFieldSpec - - for _, x := range xs { - spec := TestFieldSpecs[x] - specs = append(specs, spec) - } - - return specs - }) -} - -func TestKeyCodecGen(minLen, maxLen int) *rapid.Generator[TestKeyCodec] { - return rapid.Custom(func(t *rapid.T) TestKeyCodec { - specs := TestFieldSpecsGen(minLen, maxLen).Draw(t, "fieldSpecs") - - var fields []protoreflect.Name - for _, spec := range specs { - fields = append(fields, spec.FieldName) - } - - prefix := rapid.SliceOfN(rapid.Byte(), 0, 5).Draw(t, "prefix") - - msgType := (&testpb.ExampleTable{}).ProtoReflect().Type() - cdc, err := ormkv.NewKeyCodec(prefix, msgType, fields) - if err != nil { - panic(err) - } - - return TestKeyCodec{ - Codec: cdc, - KeySpecs: specs, - } - }) -} - -func (k TestKeyCodec) Draw(t *rapid.T, id string) []protoreflect.Value { - n := len(k.KeySpecs) - keyValues := make([]protoreflect.Value, n) - for i, k := range k.KeySpecs { - keyValues[i] = protoreflect.ValueOf(k.Gen.Draw(t, fmt.Sprintf("%s[%d]", id, i))) - } - return keyValues -} - -var GenA = rapid.Custom(func(t *rapid.T) *testpb.ExampleTable { - a := &testpb.ExampleTable{} - ref := a.ProtoReflect() - for _, spec := range TestFieldSpecs { - field := GetTestField(spec.FieldName) - value := spec.Gen.Draw(t, string(spec.FieldName)) - if value != nil { - ref.Set(field, protoreflect.ValueOf(value)) - } - } - return a -}) diff --git a/orm/model/doc.go b/orm/model/doc.go deleted file mode 100644 index af731c839ca3..000000000000 --- a/orm/model/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package model contains packages which define ORM data "model" types -// such as tables, indexes, and schemas. -package model diff --git a/orm/model/ormdb/file.go b/orm/model/ormdb/file.go deleted file mode 100644 index 2fda9396f05c..000000000000 --- a/orm/model/ormdb/file.go +++ /dev/null @@ -1,123 +0,0 @@ -package ormdb - -import ( - "bytes" - "encoding/binary" - "errors" - "math" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" - - "cosmossdk.io/orm/encoding/encodeutil" - "cosmossdk.io/orm/encoding/ormkv" - "cosmossdk.io/orm/model/ormtable" - "cosmossdk.io/orm/types/ormerrors" -) - -type fileDescriptorDBOptions struct { - Prefix []byte - ID uint32 - TypeResolver ormtable.TypeResolver - JSONValidator func(proto.Message) error - BackendResolver ormtable.BackendResolver -} - -type fileDescriptorDB struct { - id uint32 - prefix []byte - tablesByID map[uint32]ormtable.Table - tablesByName map[protoreflect.FullName]ormtable.Table - fileDescriptor protoreflect.FileDescriptor -} - -func newFileDescriptorDB(fileDescriptor protoreflect.FileDescriptor, options fileDescriptorDBOptions) (*fileDescriptorDB, error) { - prefix := encodeutil.AppendVarUInt32(options.Prefix, options.ID) - - schema := &fileDescriptorDB{ - id: options.ID, - prefix: prefix, - tablesByID: map[uint32]ormtable.Table{}, - tablesByName: map[protoreflect.FullName]ormtable.Table{}, - fileDescriptor: fileDescriptor, - } - - resolver := options.TypeResolver - if resolver == nil { - resolver = protoregistry.GlobalTypes - } - - messages := fileDescriptor.Messages() - n := messages.Len() - for i := 0; i < n; i++ { - messageDescriptor := messages.Get(i) - tableName := messageDescriptor.FullName() - messageType, err := resolver.FindMessageByName(tableName) - if err != nil { - return nil, err - } - - table, err := ormtable.Build(ormtable.Options{ - Prefix: prefix, - MessageType: messageType, - TypeResolver: resolver, - JSONValidator: options.JSONValidator, - BackendResolver: options.BackendResolver, - }) - if errors.Is(err, ormerrors.NoTableDescriptor) { - continue - } - if err != nil { - return nil, err - } - - id := table.ID() - if _, ok := schema.tablesByID[id]; ok { - return nil, ormerrors.InvalidTableId.Wrapf("duplicate ID %d for %s", id, tableName) - } - schema.tablesByID[id] = table - - if _, ok := schema.tablesByName[tableName]; ok { - return nil, ormerrors.InvalidTableDefinition.Wrapf("duplicate table %s", tableName) - } - schema.tablesByName[tableName] = table - } - - return schema, nil -} - -func (f fileDescriptorDB) DecodeEntry(k, v []byte) (ormkv.Entry, error) { - r := bytes.NewReader(k) - err := encodeutil.SkipPrefix(r, f.prefix) - if err != nil { - return nil, err - } - - id, err := binary.ReadUvarint(r) - if err != nil { - return nil, err - } - - if id > math.MaxUint32 { - return nil, ormerrors.UnexpectedDecodePrefix.Wrapf("uint32 varint id out of range %d", id) - } - - table, ok := f.tablesByID[uint32(id)] - if !ok { - return nil, ormerrors.UnexpectedDecodePrefix.Wrapf("can't find table with id %d", id) - } - - return table.DecodeEntry(k, v) -} - -func (f fileDescriptorDB) EncodeEntry(entry ormkv.Entry) (k, v []byte, err error) { - table, ok := f.tablesByName[entry.GetTableName()] - if !ok { - return nil, nil, ormerrors.BadDecodeEntry.Wrapf("can't find table %s", entry.GetTableName()) - } - - return table.EncodeEntry(entry) -} - -var _ ormkv.EntryCodec = fileDescriptorDB{} diff --git a/orm/model/ormdb/genesis.go b/orm/model/ormdb/genesis.go deleted file mode 100644 index 29cd0d8e65ca..000000000000 --- a/orm/model/ormdb/genesis.go +++ /dev/null @@ -1,152 +0,0 @@ -package ormdb - -import ( - "context" - "fmt" - "sort" - - "cosmossdk.io/core/appmodule" - "golang.org/x/exp/maps" - "google.golang.org/protobuf/reflect/protoreflect" - - "cosmossdk.io/errors" - - "cosmossdk.io/orm/types/ormerrors" -) - -type appModuleGenesisWrapper struct { - moduleDB -} - -func (m appModuleGenesisWrapper) IsOnePerModuleType() {} - -func (m appModuleGenesisWrapper) IsAppModule() {} - -func (m appModuleGenesisWrapper) DefaultGenesis(target appmodule.GenesisTarget) error { - tableNames := maps.Keys(m.tablesByName) - sort.Slice(tableNames, func(i, j int) bool { - ti, tj := tableNames[i], tableNames[j] - return ti.Name() < tj.Name() - }) - - for _, name := range tableNames { - table := m.tablesByName[name] - w, err := target(string(name)) - if err != nil { - return err - } - - _, err = w.Write(table.DefaultJSON()) - if err != nil { - return err - } - - err = w.Close() - if err != nil { - return err - } - } - return nil -} - -func (m appModuleGenesisWrapper) ValidateGenesis(source appmodule.GenesisSource) error { - errMap := map[protoreflect.FullName]error{} - names := maps.Keys(m.tablesByName) - sort.Slice(names, func(i, j int) bool { - ti, tj := names[i], names[j] - return ti.Name() < tj.Name() - }) - for _, name := range names { - r, err := source(string(name)) - if err != nil { - return err - } - - if r == nil { - continue - } - - table := m.tablesByName[name] - err = table.ValidateJSON(r) - if err != nil { - errMap[name] = err - } - - err = r.Close() - if err != nil { - return err - } - } - - if len(errMap) != 0 { - var allErrors string - for name, err := range errMap { - allErrors += fmt.Sprintf("Error in JSON for table %s: %v\n", name, err) - } - return ormerrors.JSONValidationError.Wrap(allErrors) - } - - return nil -} - -func (m appModuleGenesisWrapper) InitGenesis(ctx context.Context, source appmodule.GenesisSource) error { - var names []string - for name := range m.tablesByName { - names = append(names, string(name)) - } - sort.Strings(names) - - for _, name := range names { - fullName := protoreflect.FullName(name) - table := m.tablesByName[fullName] - - r, err := source(string(fullName)) - if err != nil { - return errors.Wrapf(err, "table %s", fullName) - } - - if r == nil { - continue - } - - err = table.ImportJSON(ctx, r) - if err != nil { - return errors.Wrapf(err, "table %s", fullName) - } - - err = r.Close() - if err != nil { - return errors.Wrapf(err, "table %s", fullName) - } - } - - return nil -} - -func (m appModuleGenesisWrapper) ExportGenesis(ctx context.Context, sink appmodule.GenesisTarget) error { - // Ensure that we export the tables in a deterministic order. - tableNames := maps.Keys(m.tablesByName) - sort.Slice(tableNames, func(i, j int) bool { - ti, tj := tableNames[i], tableNames[j] - return ti.Name() < tj.Name() - }) - - for _, name := range tableNames { - w, err := sink(string(name)) - if err != nil { - return err - } - - table := m.tablesByName[name] - err = table.ExportJSON(ctx, w) - if err != nil { - return err - } - - err = w.Close() - if err != nil { - return err - } - } - return nil -} diff --git a/orm/model/ormdb/module.go b/orm/model/ormdb/module.go deleted file mode 100644 index a8ab9f89aa97..000000000000 --- a/orm/model/ormdb/module.go +++ /dev/null @@ -1,220 +0,0 @@ -package ormdb - -import ( - "bytes" - "context" - "encoding/binary" - "fmt" - "math" - - "cosmossdk.io/core/appmodule" - "cosmossdk.io/core/store" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protodesc" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" - - ormv1alpha1 "cosmossdk.io/api/cosmos/orm/v1alpha1" - - "cosmossdk.io/orm/encoding/encodeutil" - "cosmossdk.io/orm/encoding/ormkv" - "cosmossdk.io/orm/model/ormtable" - "cosmossdk.io/orm/types/ormerrors" -) - -// ModuleDB defines the ORM database type to be used by modules. -type ModuleDB interface { - ormtable.Schema - - // GenesisHandler returns an implementation of appmodule.HasGenesis - // to be embedded in or called from app module implementations. - // Ex: - // type AppModule struct { - // appmodule.HasGenesis - // } - // - // func NewKeeper(db ModuleDB) *Keeper { - // return &Keeper{genesisHandler: db.GenesisHandler()} - // } - // - // func NewAppModule(keeper keeper.Keeper) AppModule { - // return AppModule{HasGenesis: keeper.GenesisHandler()} - // } - GenesisHandler() appmodule.HasGenesis - - private() -} - -type moduleDB struct { - prefix []byte - filesByID map[uint32]*fileDescriptorDB - tablesByName map[protoreflect.FullName]ormtable.Table -} - -// ModuleDBOptions are options for constructing a ModuleDB. -type ModuleDBOptions struct { - // TypeResolver is an optional type resolver to be used when unmarshaling - // protobuf messages. If it is nil, protoregistry.GlobalTypes will be used. - TypeResolver ormtable.TypeResolver - - // FileResolver is an optional file resolver that can be used to retrieve - // pinned file descriptors that may be different from those available at - // runtime. The file descriptor versions returned by this resolver will be - // used instead of the ones provided at runtime by the ModuleSchema. - FileResolver protodesc.Resolver - - // JSONValidator is an optional validator that can be used for validating - // messaging when using ValidateJSON. If it is nil, DefaultJSONValidator - // will be used - JSONValidator func(proto.Message) error - - // KVStoreService is the storage service to use for the DB if default KV-store storage is used. - KVStoreService store.KVStoreService - - // KVStoreService is the storage service to use for the DB if memory storage is used. - MemoryStoreService store.MemoryStoreService - - // KVStoreService is the storage service to use for the DB if transient storage is used. - TransientStoreService store.TransientStoreService -} - -// NewModuleDB constructs a ModuleDB instance from the provided schema and options. -func NewModuleDB(schema *ormv1alpha1.ModuleSchemaDescriptor, options ModuleDBOptions) (ModuleDB, error) { - prefix := schema.Prefix - db := &moduleDB{ - prefix: prefix, - filesByID: map[uint32]*fileDescriptorDB{}, - tablesByName: map[protoreflect.FullName]ormtable.Table{}, - } - - fileResolver := options.FileResolver - if fileResolver == nil { - fileResolver = protoregistry.GlobalFiles - } - - for _, entry := range schema.SchemaFile { - var backendResolver ormtable.BackendResolver - - switch entry.StorageType { - case ormv1alpha1.StorageType_STORAGE_TYPE_DEFAULT_UNSPECIFIED: - service := options.KVStoreService - if service != nil { - // for testing purposes, the ORM allows KVStoreService to be omitted - // and a default test backend can be used - backendResolver = func(ctx context.Context) (ormtable.ReadBackend, error) { - kvStore := service.OpenKVStore(ctx) - return ormtable.NewBackend(ormtable.BackendOptions{ - CommitmentStore: kvStore, - IndexStore: kvStore, - }), nil - } - } - case ormv1alpha1.StorageType_STORAGE_TYPE_MEMORY: - service := options.MemoryStoreService - if service == nil { - return nil, fmt.Errorf("missing MemoryStoreService") - } - - backendResolver = func(ctx context.Context) (ormtable.ReadBackend, error) { - kvStore := service.OpenMemoryStore(ctx) - return ormtable.NewBackend(ormtable.BackendOptions{ - CommitmentStore: kvStore, - IndexStore: kvStore, - }), nil - } - case ormv1alpha1.StorageType_STORAGE_TYPE_TRANSIENT: - service := options.TransientStoreService - if service == nil { - return nil, fmt.Errorf("missing TransientStoreService") - } - - backendResolver = func(ctx context.Context) (ormtable.ReadBackend, error) { - kvStore := service.OpenTransientStore(ctx) - return ormtable.NewBackend(ormtable.BackendOptions{ - CommitmentStore: kvStore, - IndexStore: kvStore, - }), nil - } - default: - return nil, fmt.Errorf("unsupported storage type %s", entry.StorageType) - } - - id := entry.Id - fileDescriptor, err := fileResolver.FindFileByPath(entry.ProtoFileName) - if err != nil { - return nil, err - } - - if id == 0 { - return nil, ormerrors.InvalidFileDescriptorID.Wrapf("for %s", fileDescriptor.Path()) - } - - opts := fileDescriptorDBOptions{ - ID: id, - Prefix: prefix, - TypeResolver: options.TypeResolver, - JSONValidator: options.JSONValidator, - BackendResolver: backendResolver, - } - - fdSchema, err := newFileDescriptorDB(fileDescriptor, opts) - if err != nil { - return nil, err - } - - db.filesByID[id] = fdSchema - for name, table := range fdSchema.tablesByName { - if _, ok := db.tablesByName[name]; ok { - return nil, ormerrors.UnexpectedError.Wrapf("duplicate table %s", name) - } - - db.tablesByName[name] = table - } - } - - return db, nil -} - -func (m moduleDB) DecodeEntry(k, v []byte) (ormkv.Entry, error) { - r := bytes.NewReader(k) - err := encodeutil.SkipPrefix(r, m.prefix) - if err != nil { - return nil, err - } - - id, err := binary.ReadUvarint(r) - if err != nil { - return nil, err - } - - if id > math.MaxUint32 { - return nil, ormerrors.UnexpectedDecodePrefix.Wrapf("uint32 varint id out of range %d", id) - } - - fileSchema, ok := m.filesByID[uint32(id)] - if !ok { - return nil, ormerrors.UnexpectedDecodePrefix.Wrapf("can't find FileDescriptor schema with id %d", id) - } - - return fileSchema.DecodeEntry(k, v) -} - -func (m moduleDB) EncodeEntry(entry ormkv.Entry) (k, v []byte, err error) { - tableName := entry.GetTableName() - table, ok := m.tablesByName[tableName] - if !ok { - return nil, nil, ormerrors.BadDecodeEntry.Wrapf("can't find table %s", tableName) - } - - return table.EncodeEntry(entry) -} - -func (m moduleDB) GetTable(message proto.Message) ormtable.Table { - return m.tablesByName[message.ProtoReflect().Descriptor().FullName()] -} - -func (m moduleDB) GenesisHandler() appmodule.HasGenesis { - return appModuleGenesisWrapper{m} -} - -func (moduleDB) private() {} diff --git a/orm/model/ormdb/module_test.go b/orm/model/ormdb/module_test.go deleted file mode 100644 index b2e73357c8c5..000000000000 --- a/orm/model/ormdb/module_test.go +++ /dev/null @@ -1,416 +0,0 @@ -package ormdb_test - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "strings" - "testing" - - appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" - ormmodulev1alpha1 "cosmossdk.io/api/cosmos/orm/module/v1alpha1" - ormv1alpha1 "cosmossdk.io/api/cosmos/orm/v1alpha1" - "cosmossdk.io/core/appconfig" - "cosmossdk.io/core/appmodule" - "cosmossdk.io/core/genesis" - "cosmossdk.io/core/store" - "cosmossdk.io/depinject" - dbm "github.com/cosmos/cosmos-db" - - "github.com/golang/mock/gomock" - "gotest.tools/v3/assert" - "gotest.tools/v3/golden" - - _ "cosmossdk.io/orm" // required for ORM module registration - "cosmossdk.io/orm/internal/testkv" - "cosmossdk.io/orm/internal/testpb" - "cosmossdk.io/orm/model/ormdb" - "cosmossdk.io/orm/model/ormtable" - "cosmossdk.io/orm/testing/ormmocks" - "cosmossdk.io/orm/testing/ormtest" - "cosmossdk.io/orm/types/ormerrors" -) - -// These tests use a simulated bank keeper. Addresses and balances use -// string and uint64 types respectively for simplicity. - -func init() { - // this registers the test module with the module registry - appmodule.Register(&testpb.Module{}, - appmodule.Provide(NewKeeper), - ) -} - -var TestBankSchema = &ormv1alpha1.ModuleSchemaDescriptor{ - SchemaFile: []*ormv1alpha1.ModuleSchemaDescriptor_FileEntry{ - { - Id: 1, - ProtoFileName: testpb.File_testpb_bank_proto.Path(), - }, - }, -} - -type keeper struct { - store testpb.BankStore -} - -func NewKeeper(db ormdb.ModuleDB) (Keeper, error) { - bankStore, err := testpb.NewBankStore(db) - return keeper{bankStore}, err -} - -type Keeper interface { - Send(ctx context.Context, from, to, denom string, amount uint64) error - Mint(ctx context.Context, acct, denom string, amount uint64) error - Burn(ctx context.Context, acct, denom string, amount uint64) error - Balance(ctx context.Context, acct, denom string) (uint64, error) - Supply(ctx context.Context, denom string) (uint64, error) -} - -func (k keeper) Send(ctx context.Context, from, to, denom string, amount uint64) error { - err := k.safeSubBalance(ctx, from, denom, amount) - if err != nil { - return err - } - - return k.addBalance(ctx, to, denom, amount) -} - -func (k keeper) Mint(ctx context.Context, acct, denom string, amount uint64) error { - supply, err := k.store.SupplyTable().Get(ctx, denom) - if err != nil && !ormerrors.IsNotFound(err) { - return err - } - - if supply == nil { - supply = &testpb.Supply{Denom: denom, Amount: amount} - } else { - supply.Amount += amount - } - - err = k.store.SupplyTable().Save(ctx, supply) - if err != nil { - return err - } - - return k.addBalance(ctx, acct, denom, amount) -} - -func (k keeper) Burn(ctx context.Context, acct, denom string, amount uint64) error { - supplyStore := k.store.SupplyTable() - supply, err := supplyStore.Get(ctx, denom) - if err != nil { - return err - } - - if amount > supply.Amount { - return fmt.Errorf("insufficient supply") - } - - supply.Amount -= amount - - if supply.Amount == 0 { - err = supplyStore.Delete(ctx, supply) - } else { - err = supplyStore.Save(ctx, supply) - } - if err != nil { - return err - } - - return k.safeSubBalance(ctx, acct, denom, amount) -} - -func (k keeper) Balance(ctx context.Context, acct, denom string) (uint64, error) { - balance, err := k.store.BalanceTable().Get(ctx, acct, denom) - if err != nil { - if ormerrors.IsNotFound(err) { - return 0, nil - } - - return 0, err - } - return balance.Amount, err -} - -func (k keeper) Supply(ctx context.Context, denom string) (uint64, error) { - supply, err := k.store.SupplyTable().Get(ctx, denom) - if supply == nil { - if ormerrors.IsNotFound(err) { - return 0, nil - } - - return 0, err - } - return supply.Amount, err -} - -func (k keeper) addBalance(ctx context.Context, acct, denom string, amount uint64) error { - balance, err := k.store.BalanceTable().Get(ctx, acct, denom) - if err != nil && !ormerrors.IsNotFound(err) { - return err - } - - if balance == nil { - balance = &testpb.Balance{ - Address: acct, - Denom: denom, - Amount: amount, - } - } else { - balance.Amount += amount - } - - return k.store.BalanceTable().Save(ctx, balance) -} - -func (k keeper) safeSubBalance(ctx context.Context, acct, denom string, amount uint64) error { - balanceStore := k.store.BalanceTable() - balance, err := balanceStore.Get(ctx, acct, denom) - if err != nil { - return err - } - - if amount > balance.Amount { - return fmt.Errorf("insufficient funds") - } - - balance.Amount -= amount - - if balance.Amount == 0 { - return balanceStore.Delete(ctx, balance) - } - - return balanceStore.Save(ctx, balance) -} - -func TestModuleDB(t *testing.T) { - // create db & debug context - db, err := ormdb.NewModuleDB(TestBankSchema, ormdb.ModuleDBOptions{}) - assert.NilError(t, err) - debugBuf := &strings.Builder{} - backend := ormtest.NewMemoryBackend() - ctx := ormtable.WrapContextDefault(testkv.NewDebugBackend( - backend, - &testkv.EntryCodecDebugger{ - EntryCodec: db, - Print: func(s string) { debugBuf.WriteString(s + "\n") }, - }, - )) - - // create keeper - k, err := NewKeeper(db) - assert.NilError(t, err) - - runSimpleBankTests(t, k, ctx) - - // check debug output - golden.Assert(t, debugBuf.String(), "bank_scenario.golden") - - // check decode & encode - it, err := backend.CommitmentStore().Iterator(nil, nil) - assert.NilError(t, err) - for it.Valid() { - entry, err := db.DecodeEntry(it.Key(), it.Value()) - assert.NilError(t, err) - k, v, err := db.EncodeEntry(entry) - assert.NilError(t, err) - assert.Assert(t, bytes.Equal(k, it.Key())) - assert.Assert(t, bytes.Equal(v, it.Value())) - it.Next() - } - - // check JSON - target := genesis.RawJSONTarget{} - assert.NilError(t, db.GenesisHandler().DefaultGenesis(target.Target())) - rawJSON, err := target.JSON() - assert.NilError(t, err) - golden.Assert(t, string(rawJSON), "default_json.golden") - - target = genesis.RawJSONTarget{} - assert.NilError(t, db.GenesisHandler().ExportGenesis(ctx, target.Target())) - rawJSON, err = target.JSON() - assert.NilError(t, err) - - goodJSON := `{ - "testpb.Supply": [] -}` - source, err := genesis.SourceFromRawJSON(json.RawMessage(goodJSON)) - assert.NilError(t, err) - assert.NilError(t, db.GenesisHandler().ValidateGenesis(source)) - assert.NilError(t, db.GenesisHandler().InitGenesis(ormtable.WrapContextDefault(ormtest.NewMemoryBackend()), source)) - - badJSON := `{ - "testpb.Balance": 5, - "testpb.Supply": {} -} -` - source, err = genesis.SourceFromRawJSON(json.RawMessage(badJSON)) - assert.NilError(t, err) - assert.ErrorIs(t, db.GenesisHandler().ValidateGenesis(source), ormerrors.JSONValidationError) - - backend2 := ormtest.NewMemoryBackend() - ctx2 := ormtable.WrapContextDefault(backend2) - source, err = genesis.SourceFromRawJSON(rawJSON) - assert.NilError(t, err) - assert.NilError(t, db.GenesisHandler().ValidateGenesis(source)) - assert.NilError(t, db.GenesisHandler().InitGenesis(ctx2, source)) - testkv.AssertBackendsEqual(t, backend, backend2) -} - -func runSimpleBankTests(t *testing.T, k Keeper, ctx context.Context) { // nolint:revive // test function - // mint coins - denom := "foo" - acct1 := "bob" - err := k.Mint(ctx, acct1, denom, 100) - assert.NilError(t, err) - bal, err := k.Balance(ctx, acct1, denom) - assert.NilError(t, err) - assert.Equal(t, uint64(100), bal) - supply, err := k.Supply(ctx, denom) - assert.NilError(t, err) - assert.Equal(t, uint64(100), supply) - - // send coins - acct2 := "sally" - err = k.Send(ctx, acct1, acct2, denom, 30) - assert.NilError(t, err) - bal, err = k.Balance(ctx, acct1, denom) - assert.NilError(t, err) - assert.Equal(t, uint64(70), bal) - bal, err = k.Balance(ctx, acct2, denom) - assert.NilError(t, err) - assert.Equal(t, uint64(30), bal) - - // burn coins - err = k.Burn(ctx, acct2, denom, 3) - assert.NilError(t, err) - bal, err = k.Balance(ctx, acct2, denom) - assert.NilError(t, err) - assert.Equal(t, uint64(27), bal) - supply, err = k.Supply(ctx, denom) - assert.NilError(t, err) - assert.Equal(t, uint64(97), supply) -} - -func TestHooks(t *testing.T) { - ctrl := gomock.NewController(t) - db, err := ormdb.NewModuleDB(TestBankSchema, ormdb.ModuleDBOptions{}) - assert.NilError(t, err) - validateHooks := ormmocks.NewMockValidateHooks(ctrl) - writeHooks := ormmocks.NewMockWriteHooks(ctrl) - ctx := ormtable.WrapContextDefault(ormtest.NewMemoryBackend(). - WithValidateHooks(validateHooks). - WithWriteHooks(writeHooks)) - k, err := NewKeeper(db) - assert.NilError(t, err) - - denom := "foo" - acct1 := "bob" - acct2 := "sally" - - validateHooks.EXPECT().ValidateInsert(gomock.Any(), ormmocks.Eq(&testpb.Balance{Address: acct1, Denom: denom, Amount: 10})) - validateHooks.EXPECT().ValidateInsert(gomock.Any(), ormmocks.Eq(&testpb.Supply{Denom: denom, Amount: 10})) - writeHooks.EXPECT().OnInsert(gomock.Any(), ormmocks.Eq(&testpb.Balance{Address: acct1, Denom: denom, Amount: 10})) - writeHooks.EXPECT().OnInsert(gomock.Any(), ormmocks.Eq(&testpb.Supply{Denom: denom, Amount: 10})) - assert.NilError(t, k.Mint(ctx, acct1, denom, 10)) - - validateHooks.EXPECT().ValidateUpdate( - gomock.Any(), - ormmocks.Eq(&testpb.Balance{Address: acct1, Denom: denom, Amount: 10}), - ormmocks.Eq(&testpb.Balance{Address: acct1, Denom: denom, Amount: 5}), - ) - validateHooks.EXPECT().ValidateInsert( - gomock.Any(), - ormmocks.Eq(&testpb.Balance{Address: acct2, Denom: denom, Amount: 5}), - ) - writeHooks.EXPECT().OnUpdate( - gomock.Any(), - ormmocks.Eq(&testpb.Balance{Address: acct1, Denom: denom, Amount: 10}), - ormmocks.Eq(&testpb.Balance{Address: acct1, Denom: denom, Amount: 5}), - ) - writeHooks.EXPECT().OnInsert( - gomock.Any(), - ormmocks.Eq(&testpb.Balance{Address: acct2, Denom: denom, Amount: 5}), - ) - assert.NilError(t, k.Send(ctx, acct1, acct2, denom, 5)) - - validateHooks.EXPECT().ValidateUpdate( - gomock.Any(), - ormmocks.Eq(&testpb.Supply{Denom: denom, Amount: 10}), - ormmocks.Eq(&testpb.Supply{Denom: denom, Amount: 5}), - ) - validateHooks.EXPECT().ValidateDelete( - gomock.Any(), - ormmocks.Eq(&testpb.Balance{Address: acct1, Denom: denom, Amount: 5}), - ) - writeHooks.EXPECT().OnUpdate( - gomock.Any(), - ormmocks.Eq(&testpb.Supply{Denom: denom, Amount: 10}), - ormmocks.Eq(&testpb.Supply{Denom: denom, Amount: 5}), - ) - writeHooks.EXPECT().OnDelete( - gomock.Any(), - ormmocks.Eq(&testpb.Balance{Address: acct1, Denom: denom, Amount: 5}), - ) - assert.NilError(t, k.Burn(ctx, acct1, denom, 5)) -} - -type testStoreService struct { - db dbm.DB -} - -func (t testStoreService) OpenKVStore(context.Context) store.KVStore { - return t.db -} - -func (t testStoreService) OpenMemoryStore(context.Context) store.KVStore { - return t.db -} - -func TestGetBackendResolver(t *testing.T) { - _, err := ormdb.NewModuleDB(&ormv1alpha1.ModuleSchemaDescriptor{ - SchemaFile: []*ormv1alpha1.ModuleSchemaDescriptor_FileEntry{ - { - Id: 1, - ProtoFileName: testpb.File_testpb_bank_proto.Path(), - StorageType: ormv1alpha1.StorageType_STORAGE_TYPE_MEMORY, - }, - }, - }, ormdb.ModuleDBOptions{}) - assert.ErrorContains(t, err, "missing MemoryStoreService") - - _, err = ormdb.NewModuleDB(&ormv1alpha1.ModuleSchemaDescriptor{ - SchemaFile: []*ormv1alpha1.ModuleSchemaDescriptor_FileEntry{ - { - Id: 1, - ProtoFileName: testpb.File_testpb_bank_proto.Path(), - StorageType: ormv1alpha1.StorageType_STORAGE_TYPE_MEMORY, - }, - }, - }, ormdb.ModuleDBOptions{ - MemoryStoreService: testStoreService{db: dbm.NewMemDB()}, - }) - assert.NilError(t, err) -} - -func ProvideTestRuntime() store.KVStoreService { - return testStoreService{db: dbm.NewMemDB()} -} - -func TestAppConfigModule(t *testing.T) { - appCfg := appconfig.Compose(&appv1alpha1.Config{ - Modules: []*appv1alpha1.ModuleConfig{ - {Name: "bank", Config: appconfig.WrapAny(&testpb.Module{})}, - {Name: "orm", Config: appconfig.WrapAny(&ormmodulev1alpha1.Module{})}, - }, - }) - var k Keeper - err := depinject.Inject(depinject.Configs( - appCfg, depinject.Provide(ProvideTestRuntime), - ), &k) - assert.NilError(t, err) - - runSimpleBankTests(t, k, context.Background()) -} diff --git a/orm/model/ormdb/testdata/bank_scenario.golden b/orm/model/ormdb/testdata/bank_scenario.golden deleted file mode 100644 index 29c61ebb91f5..000000000000 --- a/orm/model/ormdb/testdata/bank_scenario.golden +++ /dev/null @@ -1,64 +0,0 @@ -GET 010200666f6f - PK testpb.Supply foo -> {"denom":"foo"} -GET 010200666f6f - PK testpb.Supply foo -> {"denom":"foo"} -ORM BEFORE INSERT testpb.Supply {"denom":"foo","amount":100} -SET 010200666f6f 1064 - PK testpb.Supply foo -> {"denom":"foo","amount":100} -ORM AFTER INSERT testpb.Supply {"denom":"foo","amount":100} -GET 010100626f6200666f6f - PK testpb.Balance bob/foo -> {"address":"bob","denom":"foo"} -GET 010100626f6200666f6f - PK testpb.Balance bob/foo -> {"address":"bob","denom":"foo"} -ORM BEFORE INSERT testpb.Balance {"address":"bob","denom":"foo","amount":100} -SET 010100626f6200666f6f 1864 - PK testpb.Balance bob/foo -> {"address":"bob","denom":"foo","amount":100} -SET 010101666f6f00626f62 - IDX testpb.Balance denom/address : foo/bob -> bob/foo -ORM AFTER INSERT testpb.Balance {"address":"bob","denom":"foo","amount":100} -GET 010100626f6200666f6f 1864 - PK testpb.Balance bob/foo -> {"address":"bob","denom":"foo","amount":100} -GET 010200666f6f 1064 - PK testpb.Supply foo -> {"denom":"foo","amount":100} -GET 010100626f6200666f6f 1864 - PK testpb.Balance bob/foo -> {"address":"bob","denom":"foo","amount":100} -GET 010100626f6200666f6f 1864 - PK testpb.Balance bob/foo -> {"address":"bob","denom":"foo","amount":100} -ORM BEFORE UPDATE testpb.Balance {"address":"bob","denom":"foo","amount":100} -> {"address":"bob","denom":"foo","amount":70} -SET 010100626f6200666f6f 1846 - PK testpb.Balance bob/foo -> {"address":"bob","denom":"foo","amount":70} -ORM AFTER UPDATE testpb.Balance {"address":"bob","denom":"foo","amount":100} -> {"address":"bob","denom":"foo","amount":70} -GET 01010073616c6c7900666f6f - PK testpb.Balance sally/foo -> {"address":"sally","denom":"foo"} -GET 01010073616c6c7900666f6f - PK testpb.Balance sally/foo -> {"address":"sally","denom":"foo"} -ORM BEFORE INSERT testpb.Balance {"address":"sally","denom":"foo","amount":30} -SET 01010073616c6c7900666f6f 181e - PK testpb.Balance sally/foo -> {"address":"sally","denom":"foo","amount":30} -SET 010101666f6f0073616c6c79 - IDX testpb.Balance denom/address : foo/sally -> sally/foo -ORM AFTER INSERT testpb.Balance {"address":"sally","denom":"foo","amount":30} -GET 010100626f6200666f6f 1846 - PK testpb.Balance bob/foo -> {"address":"bob","denom":"foo","amount":70} -GET 01010073616c6c7900666f6f 181e - PK testpb.Balance sally/foo -> {"address":"sally","denom":"foo","amount":30} -GET 010200666f6f 1064 - PK testpb.Supply foo -> {"denom":"foo","amount":100} -GET 010200666f6f 1064 - PK testpb.Supply foo -> {"denom":"foo","amount":100} -ORM BEFORE UPDATE testpb.Supply {"denom":"foo","amount":100} -> {"denom":"foo","amount":97} -SET 010200666f6f 1061 - PK testpb.Supply foo -> {"denom":"foo","amount":97} -ORM AFTER UPDATE testpb.Supply {"denom":"foo","amount":100} -> {"denom":"foo","amount":97} -GET 01010073616c6c7900666f6f 181e - PK testpb.Balance sally/foo -> {"address":"sally","denom":"foo","amount":30} -GET 01010073616c6c7900666f6f 181e - PK testpb.Balance sally/foo -> {"address":"sally","denom":"foo","amount":30} -ORM BEFORE UPDATE testpb.Balance {"address":"sally","denom":"foo","amount":30} -> {"address":"sally","denom":"foo","amount":27} -SET 01010073616c6c7900666f6f 181b - PK testpb.Balance sally/foo -> {"address":"sally","denom":"foo","amount":27} -ORM AFTER UPDATE testpb.Balance {"address":"sally","denom":"foo","amount":30} -> {"address":"sally","denom":"foo","amount":27} -GET 01010073616c6c7900666f6f 181b - PK testpb.Balance sally/foo -> {"address":"sally","denom":"foo","amount":27} -GET 010200666f6f 1061 - PK testpb.Supply foo -> {"denom":"foo","amount":97} diff --git a/orm/model/ormdb/testdata/default_json.golden b/orm/model/ormdb/testdata/default_json.golden deleted file mode 100644 index 89cfec2aafcb..000000000000 --- a/orm/model/ormdb/testdata/default_json.golden +++ /dev/null @@ -1,4 +0,0 @@ -{ - "testpb.Balance": [], - "testpb.Supply": [] -} \ No newline at end of file diff --git a/orm/model/ormlist/options.go b/orm/model/ormlist/options.go deleted file mode 100644 index e713dfd81400..000000000000 --- a/orm/model/ormlist/options.go +++ /dev/null @@ -1,82 +0,0 @@ -// Package ormlist defines options for listing items from ORM indexes. -package ormlist - -import ( - "google.golang.org/protobuf/proto" - - queryv1beta1 "cosmossdk.io/api/cosmos/base/query/v1beta1" - - "cosmossdk.io/orm/internal/listinternal" -) - -// Option represents a list option. -type Option = listinternal.Option - -// Reverse reverses the direction of iteration. If Reverse is -// provided twice, iteration will happen in the forward direction. -func Reverse() Option { - return listinternal.FuncOption(func(options *listinternal.Options) { - options.Reverse = !options.Reverse - }) -} - -// Filter returns an option which applies a filter function to each item -// and skips over it when the filter function returns false. -func Filter(filterFn func(message proto.Message) bool) Option { - return listinternal.FuncOption(func(options *listinternal.Options) { - options.Filter = filterFn - }) -} - -// Cursor specifies a cursor after which to restart iteration. Cursor values -// are returned by iterators and in pagination results. -func Cursor(cursor CursorT) Option { - return listinternal.FuncOption(func(options *listinternal.Options) { - options.Cursor = cursor - }) -} - -// Paginate paginates iterator output based on the provided page request. -// The Iterator.PageRequest value on the returned iterator will be non-nil -// after Iterator.Next() returns false when this option is provided. -// -// Care should be taken when using Paginate together with Reverse and/or Cursor. -// In the case of combining Reverse and Paginate, if pageRequest.Reverse is -// true then iteration will proceed in the forward direction. This allows -// the default iteration direction for a query to be reverse with the option -// to switch this (to forward in this case) using PageRequest. If Cursor -// and Paginate are used together, whichever option is used first wins. -// If pageRequest is nil, this option will be a no-op so the caller does not -// need to do a nil check. This function defines no default limit, so if -// the caller does not define a limit, this will return all results. To -// specify a default limit use the DefaultLimit option. -func Paginate(pageRequest *queryv1beta1.PageRequest) Option { - return listinternal.FuncOption(func(options *listinternal.Options) { - if pageRequest == nil { - return - } - - if pageRequest.Reverse { - // if the reverse is true we invert the direction of iteration, - // meaning if iteration was already reversed we set it forward. - options.Reverse = !options.Reverse - } - - options.Cursor = pageRequest.Key - options.Offset = pageRequest.Offset - options.Limit = pageRequest.Limit - options.CountTotal = pageRequest.CountTotal - }) -} - -// DefaultLimit specifies a default limit for iteration. This option can be -// combined with Paginate to ensure that there is a default limit if none -// is specified in PageRequest. -func DefaultLimit(defaultLimit uint64) Option { - return listinternal.FuncOption(func(options *listinternal.Options) { - options.DefaultLimit = defaultLimit - }) -} - -// CursorT defines a cursor type. -type CursorT []byte diff --git a/orm/model/ormtable/auto_increment.go b/orm/model/ormtable/auto_increment.go deleted file mode 100644 index e483f27286ec..000000000000 --- a/orm/model/ormtable/auto_increment.go +++ /dev/null @@ -1,250 +0,0 @@ -package ormtable - -import ( - "context" - "encoding/json" - "fmt" - "io" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - - "cosmossdk.io/orm/encoding/ormkv" - "cosmossdk.io/orm/types/kv" - "cosmossdk.io/orm/types/ormerrors" -) - -// autoIncrementTable is a Table implementation for tables with an -// auto-incrementing uint64 primary key. -type autoIncrementTable struct { - *tableImpl - autoIncField protoreflect.FieldDescriptor - seqCodec *ormkv.SeqCodec -} - -func (t autoIncrementTable) InsertReturningPKey(ctx context.Context, message proto.Message) (newPK uint64, err error) { - backend, err := t.getWriteBackend(ctx) - if err != nil { - return 0, err - } - - return t.save(ctx, backend, message, saveModeInsert) -} - -func (t autoIncrementTable) Save(ctx context.Context, message proto.Message) error { - backend, err := t.getWriteBackend(ctx) - if err != nil { - return err - } - - _, err = t.save(ctx, backend, message, saveModeDefault) - return err -} - -func (t autoIncrementTable) Insert(ctx context.Context, message proto.Message) error { - backend, err := t.getWriteBackend(ctx) - if err != nil { - return err - } - - _, err = t.save(ctx, backend, message, saveModeInsert) - return err -} - -func (t autoIncrementTable) Update(ctx context.Context, message proto.Message) error { - backend, err := t.getWriteBackend(ctx) - if err != nil { - return err - } - - _, err = t.save(ctx, backend, message, saveModeUpdate) - return err -} - -func (t autoIncrementTable) LastInsertedSequence(ctx context.Context) (uint64, error) { - backend, err := t.getBackend(ctx) - if err != nil { - return 0, err - } - - return t.curSeqValue(backend.IndexStoreReader()) -} - -func (t *autoIncrementTable) save(ctx context.Context, backend Backend, message proto.Message, mode saveMode) (newPK uint64, err error) { - messageRef := message.ProtoReflect() - val := messageRef.Get(t.autoIncField).Uint() - writer := newBatchIndexCommitmentWriter(backend) - defer writer.Close() - - if val == 0 { - if mode == saveModeUpdate { - return 0, ormerrors.PrimaryKeyInvalidOnUpdate - } - - mode = saveModeInsert - newPK, err = t.nextSeqValue(writer.IndexStore()) - if err != nil { - return 0, err - } - - messageRef.Set(t.autoIncField, protoreflect.ValueOfUint64(newPK)) - } else { - if mode == saveModeInsert { - return 0, ormerrors.AutoIncrementKeyAlreadySet - } - - mode = saveModeUpdate - } - - return newPK, t.tableImpl.doSave(ctx, writer, message, mode) -} - -func (t *autoIncrementTable) curSeqValue(kv kv.ReadonlyStore) (uint64, error) { - bz, err := kv.Get(t.seqCodec.Prefix()) - if err != nil { - return 0, err - } - - return t.seqCodec.DecodeValue(bz) -} - -func (t *autoIncrementTable) nextSeqValue(kv kv.Store) (uint64, error) { - seq, err := t.curSeqValue(kv) - if err != nil { - return 0, err - } - - seq++ - return seq, t.setSeqValue(kv, seq) -} - -func (t *autoIncrementTable) setSeqValue(kv kv.Store, seq uint64) error { - return kv.Set(t.seqCodec.Prefix(), t.seqCodec.EncodeValue(seq)) -} - -func (t autoIncrementTable) EncodeEntry(entry ormkv.Entry) (k, v []byte, err error) { - if _, ok := entry.(*ormkv.SeqEntry); ok { - return t.seqCodec.EncodeEntry(entry) - } - return t.tableImpl.EncodeEntry(entry) -} - -func (t autoIncrementTable) ValidateJSON(reader io.Reader) error { - return t.decodeAutoIncJSON(nil, reader, func(message proto.Message, maxSeq uint64) error { - messageRef := message.ProtoReflect() - pkey := messageRef.Get(t.autoIncField).Uint() - if pkey > maxSeq { - return fmt.Errorf("invalid auto increment primary key %d, expected a value <= %d, the highest "+ - "sequence number", pkey, maxSeq) - } - - if t.customJSONValidator != nil { - return t.customJSONValidator(message) - } - - return DefaultJSONValidator(message) - }) -} - -func (t autoIncrementTable) ImportJSON(ctx context.Context, reader io.Reader) error { - backend, err := t.getWriteBackend(ctx) - if err != nil { - return err - } - - return t.decodeAutoIncJSON(backend, reader, func(message proto.Message, maxSeq uint64) error { - messageRef := message.ProtoReflect() - pkey := messageRef.Get(t.autoIncField).Uint() - if pkey == 0 { - // we don't have a primary key in the JSON, so we call Save to insert and - // generate one - _, err = t.save(ctx, backend, message, saveModeInsert) - return err - } - - if pkey > maxSeq { - return fmt.Errorf("invalid auto increment primary key %d, expected a value <= %d, the highest "+ - "sequence number", pkey, maxSeq) - } - // we do have a primary key and calling Save will fail because it expects - // either no primary key or SAVE_MODE_UPDATE. So instead we drop one level - // down and insert using tableImpl which doesn't know about - // auto-incrementing primary keys. - return t.tableImpl.save(ctx, backend, message, saveModeInsert) - }) -} - -func (t autoIncrementTable) decodeAutoIncJSON(backend Backend, reader io.Reader, onMsg func(message proto.Message, maxID uint64) error) error { - decoder, err := t.startDecodeJSON(reader) - if err != nil { - return err - } - - var seq uint64 - - return t.doDecodeJSON(decoder, - func(message json.RawMessage) bool { - err = json.Unmarshal(message, &seq) - if err == nil { - // writer is nil during validation - if backend != nil { - writer := newBatchIndexCommitmentWriter(backend) - defer writer.Close() - err = t.setSeqValue(writer.IndexStore(), seq) - if err != nil { - panic(err) - } - err = writer.Write() - if err != nil { - panic(err) - } - } - return true - } - return false - }, - func(message proto.Message) error { - return onMsg(message, seq) - }) -} - -func (t autoIncrementTable) ExportJSON(ctx context.Context, writer io.Writer) error { - backend, err := t.getBackend(ctx) - if err != nil { - return err - } - - _, err = writer.Write([]byte("[")) - if err != nil { - return err - } - - seq, err := t.curSeqValue(backend.IndexStoreReader()) - if err != nil { - return err - } - - start := true - if seq != 0 { - start = false - bz, err := json.Marshal(seq) - if err != nil { - return err - } - _, err = writer.Write(bz) - if err != nil { - return err - } - } - - return t.doExportJSON(ctx, writer, start) -} - -func (t *autoIncrementTable) GetTable(message proto.Message) Table { - if message.ProtoReflect().Descriptor().FullName() == t.MessageType().Descriptor().FullName() { - return t - } - return nil -} - -var _ AutoIncrementTable = &autoIncrementTable{} diff --git a/orm/model/ormtable/auto_increment_test.go b/orm/model/ormtable/auto_increment_test.go deleted file mode 100644 index 053b8a239168..000000000000 --- a/orm/model/ormtable/auto_increment_test.go +++ /dev/null @@ -1,106 +0,0 @@ -package ormtable_test - -import ( - "bytes" - "context" - "os" - "strings" - "testing" - - "gotest.tools/v3/assert" - "gotest.tools/v3/golden" - - "cosmossdk.io/orm/internal/testkv" - "cosmossdk.io/orm/internal/testpb" - "cosmossdk.io/orm/model/ormtable" -) - -func TestAutoIncrementScenario(t *testing.T) { - table, err := ormtable.Build(ormtable.Options{ - MessageType: (&testpb.ExampleAutoIncrementTable{}).ProtoReflect().Type(), - }) - assert.NilError(t, err) - - autoTable, ok := table.(ormtable.AutoIncrementTable) - assert.Assert(t, ok) - - // first run tests with a split index-commitment store - runAutoIncrementScenario(t, autoTable, ormtable.WrapContextDefault(testkv.NewSplitMemBackend())) - - // now run with shared store and debugging - debugBuf := &strings.Builder{} - store := testkv.NewDebugBackend( - testkv.NewSharedMemBackend(), - &testkv.EntryCodecDebugger{ - EntryCodec: table, - Print: func(s string) { debugBuf.WriteString(s + "\n") }, - }, - ) - runAutoIncrementScenario(t, autoTable, ormtable.WrapContextDefault(store)) - - golden.Assert(t, debugBuf.String(), "test_auto_inc.golden") - checkEncodeDecodeEntries(t, table, store.IndexStoreReader()) -} - -func runAutoIncrementScenario(t *testing.T, table ormtable.AutoIncrementTable, ctx context.Context) { //nolint:revive // ignore linting on testing function signature - store, err := testpb.NewExampleAutoIncrementTableTable(table) - assert.NilError(t, err) - - err = store.Save(ctx, &testpb.ExampleAutoIncrementTable{Id: 5}) - assert.ErrorContains(t, err, "not found") - - ex1 := &testpb.ExampleAutoIncrementTable{X: "foo", Y: 5} - assert.NilError(t, store.Save(ctx, ex1)) - assert.Equal(t, uint64(1), ex1.Id) - curSeq, err := table.LastInsertedSequence(ctx) - assert.NilError(t, err) - assert.Equal(t, curSeq, uint64(1)) - - ex2 := &testpb.ExampleAutoIncrementTable{X: "bar", Y: 10} - newID, err := table.InsertReturningPKey(ctx, ex2) - assert.NilError(t, err) - assert.Equal(t, uint64(2), ex2.Id) - assert.Equal(t, newID, ex2.Id) - curSeq, err = table.LastInsertedSequence(ctx) - assert.NilError(t, err) - assert.Equal(t, curSeq, uint64(2)) - - buf := &bytes.Buffer{} - assert.NilError(t, table.ExportJSON(ctx, buf)) - assert.NilError(t, table.ValidateJSON(bytes.NewReader(buf.Bytes()))) - store2 := ormtable.WrapContextDefault(testkv.NewSplitMemBackend()) - assert.NilError(t, table.ImportJSON(store2, bytes.NewReader(buf.Bytes()))) - assertTablesEqual(t, table, ctx, store2) - - // test edge case where we have deleted all entities but we're still exporting the sequence number - assert.NilError(t, table.Delete(ctx, ex1)) - assert.NilError(t, table.Delete(ctx, ex2)) - buf = &bytes.Buffer{} - assert.NilError(t, table.ExportJSON(ctx, buf)) - assert.NilError(t, table.ValidateJSON(bytes.NewReader(buf.Bytes()))) - golden.Assert(t, buf.String(), "trivial_auto_inc_export.golden") - store3 := ormtable.WrapContextDefault(testkv.NewSplitMemBackend()) - assert.NilError(t, table.ImportJSON(store3, bytes.NewReader(buf.Bytes()))) - ex1.Id = 0 - assert.NilError(t, table.Insert(store3, ex1)) - assert.Equal(t, uint64(3), ex1.Id) // should equal 3 because the sequence number 2 should have been imported from JSON - curSeq, err = table.LastInsertedSequence(store3) - assert.NilError(t, err) - assert.Equal(t, curSeq, uint64(3)) -} - -func TestBadJSON(t *testing.T) { - table, err := ormtable.Build(ormtable.Options{ - MessageType: (&testpb.ExampleAutoIncrementTable{}).ProtoReflect().Type(), - }) - assert.NilError(t, err) - - store := ormtable.WrapContextDefault(testkv.NewSplitMemBackend()) - f, err := os.Open("testdata/bad_auto_inc.json") - assert.NilError(t, err) - assert.ErrorContains(t, table.ImportJSON(store, f), "invalid auto increment primary key") - - f, err = os.Open("testdata/bad_auto_inc2.json") - assert.NilError(t, err) - assert.ErrorContains(t, table.ImportJSON(store, f), "invalid auto increment primary key") -} diff --git a/orm/model/ormtable/backend.go b/orm/model/ormtable/backend.go deleted file mode 100644 index 455ca90da533..000000000000 --- a/orm/model/ormtable/backend.go +++ /dev/null @@ -1,193 +0,0 @@ -package ormtable - -import ( - "context" - "fmt" - - "cosmossdk.io/orm/types/kv" -) - -// ReadBackend defines the type used for read-only ORM operations. -type ReadBackend interface { - // CommitmentStoreReader returns the reader for the commitment store. - CommitmentStoreReader() kv.ReadonlyStore - - // IndexStoreReader returns the reader for the index store. - IndexStoreReader() kv.ReadonlyStore - - private() -} - -// Backend defines the type used for read-write ORM operations. -// Unlike ReadBackend, write access to the underlying kv-store -// is hidden so that this can be fully encapsulated by the ORM. -type Backend interface { - ReadBackend - - // CommitmentStore returns the merklized commitment store. - CommitmentStore() kv.Store - - // IndexStore returns the index store if a separate one exists, - // otherwise it the commitment store. - IndexStore() kv.Store - - // ValidateHooks returns a ValidateHooks instance or nil. - ValidateHooks() ValidateHooks - - // WithValidateHooks returns a copy of this backend with the provided validate hooks. - WithValidateHooks(ValidateHooks) Backend - - // WriteHooks returns a WriteHooks instance of nil. - WriteHooks() WriteHooks - - // WithWriteHooks returns a copy of this backend with the provided write hooks. - WithWriteHooks(WriteHooks) Backend -} - -// ReadBackendOptions defines options for creating a ReadBackend. -// Read context can optionally define two stores - a commitment store -// that is backed by a merkle tree and an index store that isn't. -// If the index store is not defined, the commitment store will be -// used for all operations. -type ReadBackendOptions struct { - // CommitmentStoreReader is a reader for the commitment store. - CommitmentStoreReader kv.ReadonlyStore - - // IndexStoreReader is an optional reader for the index store. - // If it is nil the CommitmentStoreReader will be used. - IndexStoreReader kv.ReadonlyStore -} - -type readBackend struct { - commitmentReader kv.ReadonlyStore - indexReader kv.ReadonlyStore -} - -func (r readBackend) CommitmentStoreReader() kv.ReadonlyStore { - return r.commitmentReader -} - -func (r readBackend) IndexStoreReader() kv.ReadonlyStore { - return r.indexReader -} - -func (readBackend) private() {} - -// NewReadBackend creates a new ReadBackend. -func NewReadBackend(options ReadBackendOptions) ReadBackend { - indexReader := options.IndexStoreReader - if indexReader == nil { - indexReader = options.CommitmentStoreReader - } - return &readBackend{ - commitmentReader: options.CommitmentStoreReader, - indexReader: indexReader, - } -} - -type backend struct { - commitmentStore kv.Store - indexStore kv.Store - validateHooks ValidateHooks - writeHooks WriteHooks -} - -func (c backend) ValidateHooks() ValidateHooks { - return c.validateHooks -} - -func (c backend) WithValidateHooks(hooks ValidateHooks) Backend { - c.validateHooks = hooks - return c -} - -func (c backend) WriteHooks() WriteHooks { - return c.writeHooks -} - -func (c backend) WithWriteHooks(hooks WriteHooks) Backend { - c.writeHooks = hooks - return c -} - -func (backend) private() {} - -func (c backend) CommitmentStoreReader() kv.ReadonlyStore { - return c.commitmentStore -} - -func (c backend) IndexStoreReader() kv.ReadonlyStore { - return c.indexStore -} - -func (c backend) CommitmentStore() kv.Store { - return c.commitmentStore -} - -func (c backend) IndexStore() kv.Store { - return c.indexStore -} - -// BackendOptions defines options for creating a Backend. -// Context can optionally define two stores - a commitment store -// that is backed by a merkle tree and an index store that isn't. -// If the index store is not defined, the commitment store will be -// used for all operations. -type BackendOptions struct { - // CommitmentStore is the commitment store. - CommitmentStore kv.Store - - // IndexStore is the optional index store. - // If it is nil the CommitmentStore will be used. - IndexStore kv.Store - - // ValidateHooks are optional hooks into ORM insert, update and delete operations. - ValidateHooks ValidateHooks - - WriteHooks WriteHooks -} - -// NewBackend creates a new Backend. -func NewBackend(options BackendOptions) Backend { - indexStore := options.IndexStore - if indexStore == nil { - indexStore = options.CommitmentStore - } - return &backend{ - commitmentStore: options.CommitmentStore, - indexStore: indexStore, - validateHooks: options.ValidateHooks, - writeHooks: options.WriteHooks, - } -} - -// BackendResolver resolves a backend from the context or returns an error. -// Callers should type cast the returned ReadBackend to Backend to test whether -// the backend is writable. -type BackendResolver func(context.Context) (ReadBackend, error) - -// WrapContextDefault performs the default wrapping of a backend in a context. -// This should be used primarily for testing purposes and production code -// should use some other framework specific wrapping (for instance using -// "store keys"). -func WrapContextDefault(backend ReadBackend) context.Context { - return context.WithValue(context.Background(), defaultContextKey, backend) -} - -type contextKeyType string - -var defaultContextKey = contextKeyType("backend") - -func getBackendDefault(ctx context.Context) (ReadBackend, error) { - value := ctx.Value(defaultContextKey) - if value == nil { - return nil, fmt.Errorf("can't resolve backend") - } - - backend, ok := value.(ReadBackend) - if !ok { - return nil, fmt.Errorf("expected value of type %T, instead got %T", backend, value) - } - - return backend, nil -} diff --git a/orm/model/ormtable/batch.go b/orm/model/ormtable/batch.go deleted file mode 100644 index 75ca19422879..000000000000 --- a/orm/model/ormtable/batch.go +++ /dev/null @@ -1,129 +0,0 @@ -package ormtable - -import ( - "cosmossdk.io/orm/types/kv" -) - -type batchIndexCommitmentWriter struct { - Backend - commitmentWriter *batchStoreWriter - indexWriter *batchStoreWriter -} - -func newBatchIndexCommitmentWriter(store Backend) *batchIndexCommitmentWriter { - return &batchIndexCommitmentWriter{ - Backend: store, - commitmentWriter: &batchStoreWriter{ - ReadonlyStore: store.CommitmentStoreReader(), - curBuf: make([]*batchWriterEntry, 0, capacity), - }, - indexWriter: &batchStoreWriter{ - ReadonlyStore: store.IndexStoreReader(), - curBuf: make([]*batchWriterEntry, 0, capacity), - }, - } -} - -func (w *batchIndexCommitmentWriter) CommitmentStore() kv.Store { - return w.commitmentWriter -} - -func (w *batchIndexCommitmentWriter) IndexStore() kv.Store { - return w.indexWriter -} - -// Write flushes any pending writes. -func (w *batchIndexCommitmentWriter) Write() error { - err := flushWrites(w.Backend.CommitmentStore(), w.commitmentWriter) - if err != nil { - return err - } - - err = flushWrites(w.Backend.IndexStore(), w.indexWriter) - if err != nil { - return err - } - - // clear writes - w.Close() - - return err -} - -func flushWrites(store kv.Store, writer *batchStoreWriter) error { - for _, buf := range writer.prevBufs { - err := flushBuf(store, buf) - if err != nil { - return err - } - } - return flushBuf(store, writer.curBuf) -} - -func flushBuf(store kv.Store, writes []*batchWriterEntry) error { - for _, write := range writes { - switch { - case write.hookCall != nil: - write.hookCall() - case !write.delete: - err := store.Set(write.key, write.value) - if err != nil { - return err - } - default: - err := store.Delete(write.key) - if err != nil { - return err - } - } - } - return nil -} - -// Close discards any pending writes and should generally be called using -// a defer statement. -func (w *batchIndexCommitmentWriter) Close() { - w.commitmentWriter.prevBufs = nil - w.commitmentWriter.curBuf = nil - w.indexWriter.prevBufs = nil - w.indexWriter.curBuf = nil -} - -type batchWriterEntry struct { - key, value []byte - delete bool - hookCall func() -} - -type batchStoreWriter struct { - kv.ReadonlyStore - prevBufs [][]*batchWriterEntry - curBuf []*batchWriterEntry -} - -const capacity = 16 - -func (b *batchStoreWriter) Set(key, value []byte) error { - b.append(&batchWriterEntry{key: key, value: value}) - return nil -} - -func (b *batchStoreWriter) Delete(key []byte) error { - b.append(&batchWriterEntry{key: key, delete: true}) - return nil -} - -func (w *batchIndexCommitmentWriter) enqueueHook(f func()) { - w.indexWriter.append(&batchWriterEntry{hookCall: f}) -} - -func (b *batchStoreWriter) append(entry *batchWriterEntry) { - if len(b.curBuf) == capacity { - b.prevBufs = append(b.prevBufs, b.curBuf) - b.curBuf = make([]*batchWriterEntry, 0, capacity) - } - - b.curBuf = append(b.curBuf, entry) -} - -var _ Backend = &batchIndexCommitmentWriter{} diff --git a/orm/model/ormtable/bench_test.go b/orm/model/ormtable/bench_test.go deleted file mode 100644 index dcd68324f342..000000000000 --- a/orm/model/ormtable/bench_test.go +++ /dev/null @@ -1,314 +0,0 @@ -package ormtable_test - -import ( - "context" - "fmt" - "testing" - - "google.golang.org/protobuf/proto" - - dbm "github.com/cosmos/cosmos-db" - "gotest.tools/v3/assert" - - "cosmossdk.io/orm/internal/testkv" - "cosmossdk.io/orm/internal/testpb" - "cosmossdk.io/orm/model/ormtable" - "cosmossdk.io/orm/testing/ormtest" - "cosmossdk.io/orm/types/kv" -) - -func initBalanceTable(t testing.TB) testpb.BalanceTable { - table, err := ormtable.Build(ormtable.Options{ - MessageType: (&testpb.Balance{}).ProtoReflect().Type(), - }) - assert.NilError(t, err) - - balanceTable, err := testpb.NewBalanceTable(table) - assert.NilError(t, err) - - return balanceTable -} - -func BenchmarkMemory(b *testing.B) { - bench(b, func(tb testing.TB) ormtable.Backend { - return ormtest.NewMemoryBackend() - }) -} - -func BenchmarkLevelDB(b *testing.B) { - bench(b, testkv.NewGoLevelDBBackend) -} - -func bench(b *testing.B, newBackend func(testing.TB) ormtable.Backend) { - b.Run("insert", func(b *testing.B) { - b.StopTimer() - ctx := ormtable.WrapContextDefault(newBackend(b)) - b.StartTimer() - benchInsert(b, ctx) - }) - b.Run("update", func(b *testing.B) { - b.StopTimer() - ctx := ormtable.WrapContextDefault(newBackend(b)) - benchInsert(b, ctx) - b.StartTimer() - benchUpdate(b, ctx) - }) - b.Run("get", func(b *testing.B) { - b.StopTimer() - ctx := ormtable.WrapContextDefault(newBackend(b)) - benchInsert(b, ctx) - b.StartTimer() - benchGet(b, ctx) - }) - b.Run("delete", func(b *testing.B) { - b.StopTimer() - ctx := ormtable.WrapContextDefault(newBackend(b)) - benchInsert(b, ctx) - b.StartTimer() - benchDelete(b, ctx) - }) -} - -func benchInsert(b *testing.B, ctx context.Context) { //nolint:revive // ignore for benchmark - balanceTable := initBalanceTable(b) - for i := 0; i < b.N; i++ { - assert.NilError(b, balanceTable.Insert(ctx, &testpb.Balance{ - Address: fmt.Sprintf("acct%d", i), - Denom: "bar", - Amount: 10, - })) - } -} - -func benchUpdate(b *testing.B, ctx context.Context) { //nolint:revive // ignore for benchmark - balanceTable := initBalanceTable(b) - for i := 0; i < b.N; i++ { - assert.NilError(b, balanceTable.Update(ctx, &testpb.Balance{ - Address: fmt.Sprintf("acct%d", i), - Denom: "bar", - Amount: 11, - })) - } -} - -func benchGet(b *testing.B, ctx context.Context) { //nolint:revive // ignore for benchmark - balanceTable := initBalanceTable(b) - for i := 0; i < b.N; i++ { - balance, err := balanceTable.Get(ctx, fmt.Sprintf("acct%d", i), "bar") - assert.NilError(b, err) - assert.Equal(b, uint64(10), balance.Amount) - } -} - -func benchDelete(b *testing.B, ctx context.Context) { //nolint:revive // ignore for benchmark - balanceTable := initBalanceTable(b) - for i := 0; i < b.N; i++ { - assert.NilError(b, balanceTable.Delete(ctx, &testpb.Balance{ - Address: fmt.Sprintf("acct%d", i), - Denom: "bar", - })) - } -} - -// -// Manually written versions of insert, update, delete and get for testpb.Balance -// - -const ( - addressDenomPrefix byte = iota - denomAddressPrefix -) - -func insertBalance(store kv.Store, balance *testpb.Balance) error { - denom := balance.Denom - balance.Denom = "" - addr := balance.Address - balance.Address = "" - - addressDenomKey := []byte{addressDenomPrefix} - addressDenomKey = append(addressDenomKey, []byte(addr)...) - addressDenomKey = append(addressDenomKey, 0x0) - addressDenomKey = append(addressDenomKey, []byte(denom)...) - has, err := store.Has(addressDenomKey) - if err != nil { - return err - } - - if has { - return fmt.Errorf("already exists") - } - - bz, err := proto.Marshal(balance) - if err != nil { - return err - } - balance.Denom = denom - balance.Address = addr - - err = store.Set(addressDenomKey, bz) - if err != nil { - return err - } - - // set denom address index - denomAddressKey := []byte{denomAddressPrefix} - denomAddressKey = append(denomAddressKey, []byte(balance.Denom)...) - denomAddressKey = append(denomAddressKey, 0x0) - denomAddressKey = append(denomAddressKey, []byte(balance.Address)...) - err = store.Set(denomAddressKey, []byte{}) - if err != nil { - return err - } - - return nil -} - -func updateBalance(store kv.Store, balance *testpb.Balance) error { - denom := balance.Denom - balance.Denom = "" - addr := balance.Address - balance.Address = "" - bz, err := proto.Marshal(balance) - if err != nil { - return err - } - balance.Denom = denom - balance.Address = addr - - addressDenomKey := []byte{addressDenomPrefix} - addressDenomKey = append(addressDenomKey, []byte(addr)...) - addressDenomKey = append(addressDenomKey, 0x0) - addressDenomKey = append(addressDenomKey, []byte(denom)...) - - return store.Set(addressDenomKey, bz) -} - -func deleteBalance(store kv.Store, balance *testpb.Balance) error { - denom := balance.Denom - addr := balance.Address - - addressDenomKey := []byte{addressDenomPrefix} - addressDenomKey = append(addressDenomKey, []byte(addr)...) - addressDenomKey = append(addressDenomKey, 0x0) - addressDenomKey = append(addressDenomKey, []byte(denom)...) - err := store.Delete(addressDenomKey) - if err != nil { - return err - } - - denomAddressKey := []byte{denomAddressPrefix} - denomAddressKey = append(denomAddressKey, []byte(balance.Denom)...) - denomAddressKey = append(denomAddressKey, 0x0) - denomAddressKey = append(denomAddressKey, []byte(balance.Address)...) - return store.Delete(denomAddressKey) -} - -func getBalance(store kv.Store, address, denom string) (*testpb.Balance, error) { - addressDenomKey := []byte{addressDenomPrefix} - addressDenomKey = append(addressDenomKey, []byte(address)...) - addressDenomKey = append(addressDenomKey, 0x0) - addressDenomKey = append(addressDenomKey, []byte(denom)...) - - bz, err := store.Get(addressDenomKey) - if err != nil { - return nil, err - } - - if bz == nil { - return nil, fmt.Errorf("not found") - } - - balance := testpb.Balance{} - err = proto.Unmarshal(bz, &balance) - if err != nil { - return nil, err - } - - balance.Address = address - balance.Denom = denom - - return &balance, nil -} - -func BenchmarkManualInsertMemory(b *testing.B) { - benchManual(b, func() (dbm.DB, error) { - return dbm.NewMemDB(), nil - }) -} - -func BenchmarkManualInsertLevelDB(b *testing.B) { - benchManual(b, func() (dbm.DB, error) { - return dbm.NewGoLevelDB("test", b.TempDir(), nil) - }) -} - -func benchManual(b *testing.B, newStore func() (dbm.DB, error)) { - b.Run("insert", func(b *testing.B) { - b.StopTimer() - store, err := newStore() - assert.NilError(b, err) - b.StartTimer() - benchManualInsert(b, store) - }) - b.Run("update", func(b *testing.B) { - b.StopTimer() - store, err := newStore() - assert.NilError(b, err) - benchManualInsert(b, store) - b.StartTimer() - benchManualUpdate(b, store) - }) - b.Run("get", func(b *testing.B) { - b.StopTimer() - store, err := newStore() - assert.NilError(b, err) - benchManualInsert(b, store) - b.StartTimer() - benchManualGet(b, store) - }) - b.Run("delete", func(b *testing.B) { - b.StopTimer() - store, err := newStore() - assert.NilError(b, err) - benchManualInsert(b, store) - b.StartTimer() - benchManualDelete(b, store) - }) -} - -func benchManualInsert(b *testing.B, store kv.Store) { - for i := 0; i < b.N; i++ { - assert.NilError(b, insertBalance(store, &testpb.Balance{ - Address: fmt.Sprintf("acct%d", i), - Denom: "bar", - Amount: 10, - })) - } -} - -func benchManualUpdate(b *testing.B, store kv.Store) { - for i := 0; i < b.N; i++ { - assert.NilError(b, updateBalance(store, &testpb.Balance{ - Address: fmt.Sprintf("acct%d", i), - Denom: "bar", - Amount: 11, - })) - } -} - -func benchManualDelete(b *testing.B, store kv.Store) { - for i := 0; i < b.N; i++ { - assert.NilError(b, deleteBalance(store, &testpb.Balance{ - Address: fmt.Sprintf("acct%d", i), - Denom: "bar", - })) - } -} - -func benchManualGet(b *testing.B, store kv.Store) { - for i := 0; i < b.N; i++ { - balance, err := getBalance(store, fmt.Sprintf("acct%d", i), "bar") - assert.NilError(b, err) - assert.Equal(b, uint64(10), balance.Amount) - } -} diff --git a/orm/model/ormtable/build.go b/orm/model/ormtable/build.go deleted file mode 100644 index b946e3f59801..000000000000 --- a/orm/model/ormtable/build.go +++ /dev/null @@ -1,290 +0,0 @@ -package ormtable - -import ( - "fmt" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" - - ormv1 "cosmossdk.io/api/cosmos/orm/v1" - - "cosmossdk.io/orm/encoding/encodeutil" - "cosmossdk.io/orm/encoding/ormkv" - "cosmossdk.io/orm/internal/fieldnames" - "cosmossdk.io/orm/types/ormerrors" -) - -const ( - primaryKeyID uint32 = 0 - indexIDLimit uint32 = 32768 - seqID = indexIDLimit -) - -// Options are options for building a Table. -type Options struct { - // Prefix is an optional prefix used to build the table's prefix. - Prefix []byte - - // MessageType is the protobuf message type of the table. - MessageType protoreflect.MessageType - - // TableDescriptor is an optional table descriptor to be explicitly used - // with the table. Generally this should be nil and the table descriptor - // should be pulled from the table message option. TableDescriptor - // cannot be used together with SingletonDescriptor. - TableDescriptor *ormv1.TableDescriptor - - // SingletonDescriptor is an optional singleton descriptor to be explicitly used. - // Generally this should be nil and the table descriptor - // should be pulled from the singleton message option. SingletonDescriptor - // cannot be used together with TableDescriptor. - SingletonDescriptor *ormv1.SingletonDescriptor - - // TypeResolver is an optional type resolver to be used when unmarshaling - // protobuf messages. - TypeResolver TypeResolver - - // JSONValidator is an optional validator that can be used for validating - // messaging when using ValidateJSON. If it is nil, DefaultJSONValidator - // will be used - JSONValidator func(proto.Message) error - - // BackendResolver is an optional function which retrieves a Backend from the context. - // If it is nil, the default behavior will be to attempt to retrieve a - // backend using the method that WrapContextDefault uses. This method - // can be used to implement things like "store keys" which would allow a - // table to only be used with a specific backend and to hide direct - // access to the backend other than through the table interface. - // Mutating operations will attempt to cast ReadBackend to Backend and - // will return an error if that fails. - BackendResolver BackendResolver -} - -// TypeResolver is an interface that can be used for the protoreflect.UnmarshalOptions.Resolver option. -type TypeResolver interface { - protoregistry.MessageTypeResolver - protoregistry.ExtensionTypeResolver -} - -// Build builds a Table instance from the provided Options. -func Build(options Options) (Table, error) { - messageDescriptor := options.MessageType.Descriptor() - - backendResolver := options.BackendResolver - if backendResolver == nil { - backendResolver = getBackendDefault - } - - table := &tableImpl{ - primaryKeyIndex: &primaryKeyIndex{ - indexers: []indexer{}, - getBackend: backendResolver, - }, - indexes: []Index{}, - indexesByFields: map[fieldnames.FieldNames]concreteIndex{}, - uniqueIndexesByFields: map[fieldnames.FieldNames]UniqueIndex{}, - entryCodecsByID: map[uint32]ormkv.EntryCodec{}, - indexesByID: map[uint32]Index{}, - typeResolver: options.TypeResolver, - customJSONValidator: options.JSONValidator, - } - - pkIndex := table.primaryKeyIndex - - tableDesc := options.TableDescriptor - if tableDesc == nil { - tableDesc = proto.GetExtension(messageDescriptor.Options(), ormv1.E_Table).(*ormv1.TableDescriptor) - } - - singletonDesc := options.SingletonDescriptor - if singletonDesc == nil { - singletonDesc = proto.GetExtension(messageDescriptor.Options(), ormv1.E_Singleton).(*ormv1.SingletonDescriptor) - } - - switch { - case tableDesc != nil: - if singletonDesc != nil { - return nil, ormerrors.InvalidTableDefinition.Wrapf("message %s cannot be declared as both a table and a singleton", messageDescriptor.FullName()) - } - case singletonDesc != nil: - if singletonDesc.Id == 0 { - return nil, ormerrors.InvalidTableId.Wrapf("%s", messageDescriptor.FullName()) - } - - prefix := encodeutil.AppendVarUInt32(options.Prefix, singletonDesc.Id) - pkCodec, err := ormkv.NewPrimaryKeyCodec( - prefix, - options.MessageType, - nil, - proto.UnmarshalOptions{Resolver: options.TypeResolver}, - ) - if err != nil { - return nil, err - } - - pkIndex.PrimaryKeyCodec = pkCodec - table.tablePrefix = prefix - table.tableID = singletonDesc.Id - - return &singleton{table}, nil - default: - return nil, ormerrors.NoTableDescriptor.Wrapf("missing table descriptor for %s", messageDescriptor.FullName()) - } - - tableID := tableDesc.Id - if tableID == 0 { - return nil, ormerrors.InvalidTableId.Wrapf("table %s", messageDescriptor.FullName()) - } - - prefix := options.Prefix - prefix = encodeutil.AppendVarUInt32(prefix, tableID) - table.tablePrefix = prefix - table.tableID = tableID - - if tableDesc.PrimaryKey == nil { - return nil, ormerrors.MissingPrimaryKey.Wrap(string(messageDescriptor.FullName())) - } - - pkFields := fieldnames.CommaSeparatedFieldNames(tableDesc.PrimaryKey.Fields) - table.primaryKeyIndex.fields = pkFields - pkFieldNames := pkFields.Names() - if len(pkFieldNames) == 0 { - return nil, ormerrors.InvalidTableDefinition.Wrapf("empty primary key fields for %s", messageDescriptor.FullName()) - } - - pkPrefix := encodeutil.AppendVarUInt32(prefix, primaryKeyID) - pkCodec, err := ormkv.NewPrimaryKeyCodec( - pkPrefix, - options.MessageType, - pkFieldNames, - proto.UnmarshalOptions{Resolver: options.TypeResolver}, - ) - if err != nil { - return nil, err - } - - pkIndex.PrimaryKeyCodec = pkCodec - table.indexesByFields[pkFields] = pkIndex - table.uniqueIndexesByFields[pkFields] = pkIndex - table.entryCodecsByID[primaryKeyID] = pkIndex - table.indexesByID[primaryKeyID] = pkIndex - table.indexes = append(table.indexes, pkIndex) - - for _, idxDesc := range tableDesc.Index { - id := idxDesc.Id - if id == 0 || id >= indexIDLimit { - return nil, ormerrors.InvalidIndexId.Wrapf("index on table %s with fields %s, invalid id %d", messageDescriptor.FullName(), idxDesc.Fields, id) - } - - if _, ok := table.entryCodecsByID[id]; ok { - return nil, ormerrors.DuplicateIndexId.Wrapf("id %d on table %s", id, messageDescriptor.FullName()) - } - - idxFields := fieldnames.CommaSeparatedFieldNames(idxDesc.Fields) - idxPrefix := encodeutil.AppendVarUInt32(prefix, id) - var index concreteIndex - - // altNames contains all the alternative "names" of this index - altNames := map[fieldnames.FieldNames]bool{idxFields: true} - - if idxDesc.Unique && isNonTrivialUniqueKey(idxFields.Names(), pkFieldNames) { - uniqCdc, err := ormkv.NewUniqueKeyCodec( - idxPrefix, - options.MessageType, - idxFields.Names(), - pkFieldNames, - ) - if err != nil { - return nil, err - } - uniqIdx := &uniqueKeyIndex{ - UniqueKeyCodec: uniqCdc, - fields: idxFields, - primaryKey: pkIndex, - getReadBackend: backendResolver, - } - table.uniqueIndexesByFields[idxFields] = uniqIdx - index = uniqIdx - } else { - idxCdc, err := ormkv.NewIndexKeyCodec( - idxPrefix, - options.MessageType, - idxFields.Names(), - pkFieldNames, - ) - if err != nil { - return nil, err - } - index = &indexKeyIndex{ - IndexKeyCodec: idxCdc, - fields: idxFields, - primaryKey: pkIndex, - getReadBackend: backendResolver, - } - - // non-unique indexes can sometimes be named by several sub-lists of - // fields and we need to handle all of them. For example consider, - // a primary key for fields "a,b,c" and an index on field "c". Because the - // rest of the primary key gets appended to the index key, the index for "c" - // is actually stored as "c,a,b". So this index can be referred to - // by the fields "c", "c,a", or "c,a,b". - allFields := index.GetFieldNames() - allFieldNames := fieldnames.FieldsFromNames(allFields) - altNames[allFieldNames] = true - for i := 1; i < len(allFields); i++ { - altName := fieldnames.FieldsFromNames(allFields[:i]) - if altNames[altName] { - continue - } - - // we check by generating a codec for each sub-list of fields, - // then we see if the full list of fields matches. - altIdxCdc, err := ormkv.NewIndexKeyCodec( - idxPrefix, - options.MessageType, - allFields[:i], - pkFieldNames, - ) - if err != nil { - return nil, err - } - - if fieldnames.FieldsFromNames(altIdxCdc.GetFieldNames()) == allFieldNames { - altNames[altName] = true - } - } - } - - for name := range altNames { - if _, ok := table.indexesByFields[name]; ok { - return nil, fmt.Errorf("duplicate index for fields %s", name) - } - - table.indexesByFields[name] = index - } - - table.entryCodecsByID[id] = index - table.indexesByID[id] = index - table.indexes = append(table.indexes, index) - table.indexers = append(table.indexers, index.(indexer)) - } - - if tableDesc.PrimaryKey.AutoIncrement { - autoIncField := pkCodec.GetFieldDescriptors()[0] - if len(pkFieldNames) != 1 && autoIncField.Kind() != protoreflect.Uint64Kind { - return nil, ormerrors.InvalidAutoIncrementKey.Wrapf("field %s", autoIncField.FullName()) - } - - seqPrefix := encodeutil.AppendVarUInt32(prefix, seqID) - seqCodec := ormkv.NewSeqCodec(options.MessageType, seqPrefix) - table.entryCodecsByID[seqID] = seqCodec - return &autoIncrementTable{ - tableImpl: table, - autoIncField: autoIncField, - seqCodec: seqCodec, - }, nil - } - - return table, nil -} diff --git a/orm/model/ormtable/doc.go b/orm/model/ormtable/doc.go deleted file mode 100644 index 4421dd69abbd..000000000000 --- a/orm/model/ormtable/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package ormtable defines the interfaces and implementations of tables and -// indexes. -package ormtable diff --git a/orm/model/ormtable/duration_test.go b/orm/model/ormtable/duration_test.go deleted file mode 100644 index 7309eb4a0767..000000000000 --- a/orm/model/ormtable/duration_test.go +++ /dev/null @@ -1,103 +0,0 @@ -package ormtable_test - -import ( - "testing" - "time" - - "google.golang.org/protobuf/types/known/durationpb" - "gotest.tools/v3/assert" - - "cosmossdk.io/orm/internal/testkv" - "cosmossdk.io/orm/internal/testpb" - "cosmossdk.io/orm/model/ormtable" -) - -func TestDurationIndex(t *testing.T) { - table, err := ormtable.Build(ormtable.Options{ - MessageType: (&testpb.ExampleDuration{}).ProtoReflect().Type(), - }) - assert.NilError(t, err) - backend := testkv.NewDebugBackend(testkv.NewSplitMemBackend(), &testkv.EntryCodecDebugger{ - EntryCodec: table, - }) - ctx := ormtable.WrapContextDefault(backend) - store, err := testpb.NewExampleDurationTable(table) - assert.NilError(t, err) - - neg, err := time.ParseDuration("-1h") - assert.NilError(t, err) - zero, err := time.ParseDuration("0") - assert.NilError(t, err) - pos, err := time.ParseDuration("11000ms") - assert.NilError(t, err) - - negPb, zeroPb, posPb := durationpb.New(neg), durationpb.New(zero), durationpb.New(pos) - durOrder := []*durationpb.Duration{negPb, zeroPb, posPb} - - assert.NilError(t, store.Insert(ctx, &testpb.ExampleDuration{ - Name: "foo", - Dur: negPb, - })) - assert.NilError(t, store.Insert(ctx, &testpb.ExampleDuration{ - Name: "bar", - Dur: zeroPb, - })) - assert.NilError(t, store.Insert(ctx, &testpb.ExampleDuration{ - Name: "baz", - Dur: posPb, - })) - - from, to := testpb.ExampleDurationDurIndexKey{}.WithDur(durationpb.New(neg)), - testpb.ExampleDurationDurIndexKey{}.WithDur(durationpb.New(pos)) - it, err := store.ListRange(ctx, from, to) - assert.NilError(t, err) - - i := 0 - for it.Next() { - v, err := it.Value() - assert.NilError(t, err) - assert.Equal(t, durOrder[i].String(), v.Dur.String()) - i++ - } - - // insert a nil entry - id, err := store.InsertReturningId(ctx, &testpb.ExampleDuration{ - Name: "nil", - Dur: nil, - }) - assert.NilError(t, err) - - res, err := store.Get(ctx, id) - assert.NilError(t, err) - assert.Assert(t, res.Dur == nil) - - it, err = store.List(ctx, testpb.ExampleDurationDurIndexKey{}) - assert.NilError(t, err) - - // make sure nils are ordered last - durOrder = append(durOrder, nil) - i = 0 - for it.Next() { - v, err := it.Value() - assert.NilError(t, err) - assert.Assert(t, v != nil) - x := durOrder[i] - if x == nil { - assert.Assert(t, v.Dur == nil) - } else { - assert.Equal(t, x.String(), v.Dur.String()) - } - i++ - } - it.Close() - - // try iterating over just nil timestamps - it, err = store.List(ctx, testpb.ExampleDurationDurIndexKey{}.WithDur(nil)) - assert.NilError(t, err) - assert.Assert(t, it.Next()) - res, err = it.Value() - assert.NilError(t, err) - assert.Assert(t, res.Dur == nil) - assert.Assert(t, !it.Next()) - it.Close() -} diff --git a/orm/model/ormtable/filter.go b/orm/model/ormtable/filter.go deleted file mode 100644 index a7df4ff62bb7..000000000000 --- a/orm/model/ormtable/filter.go +++ /dev/null @@ -1,28 +0,0 @@ -package ormtable - -import "google.golang.org/protobuf/proto" - -type filterIterator struct { - Iterator - filter func(proto.Message) bool - msg proto.Message -} - -func (f *filterIterator) Next() bool { - for f.Iterator.Next() { - msg, err := f.Iterator.GetMessage() - if err != nil { - return false - } - - if f.filter(msg) { - f.msg = msg - return true - } - } - return false -} - -func (f filterIterator) GetMessage() (proto.Message, error) { - return f.msg, nil -} diff --git a/orm/model/ormtable/hooks.go b/orm/model/ormtable/hooks.go deleted file mode 100644 index c5a76a6af8fa..000000000000 --- a/orm/model/ormtable/hooks.go +++ /dev/null @@ -1,40 +0,0 @@ -package ormtable - -import ( - "context" - - "google.golang.org/protobuf/proto" -) - -// ValidateHooks defines an interface for a table hooks which can intercept -// insert, update and delete operations and possibly return an error. -type ValidateHooks interface { - // ValidateInsert is called before the message is inserted. - // If error is not nil the insertion will fail. - ValidateInsert(context.Context, proto.Message) error - - // ValidateUpdate is called before the existing message is updated with the new one. - // If error is not nil the update will fail. - ValidateUpdate(ctx context.Context, existing, new proto.Message) error - - // ValidateDelete is called before the message is deleted. - // If error is not nil the deletion will fail. - ValidateDelete(context.Context, proto.Message) error -} - -// WriteHooks defines an interface for listening to insertions, updates and -// deletes after they are written to the store. This can be used for indexing -// state in another database. Indexers should make sure they coordinate with -// transactions at live at the next level above the ORM as they write hooks -// may be called but the enclosing transaction may still fail. The context -// is provided in each method to help coordinate this. -type WriteHooks interface { - // OnInsert is called after an message is inserted into the store. - OnInsert(context.Context, proto.Message) - - // OnUpdate is called after the entity is updated in the store. - OnUpdate(ctx context.Context, existing, new proto.Message) - - // OnDelete is called after the entity is deleted from the store. - OnDelete(context.Context, proto.Message) -} diff --git a/orm/model/ormtable/index.go b/orm/model/ormtable/index.go deleted file mode 100644 index 8b1b625734c6..000000000000 --- a/orm/model/ormtable/index.go +++ /dev/null @@ -1,78 +0,0 @@ -package ormtable - -import ( - "context" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - - "cosmossdk.io/orm/encoding/ormkv" - "cosmossdk.io/orm/model/ormlist" - "cosmossdk.io/orm/types/kv" -) - -// Index defines an index on a table. Index instances -// are stateless, with all state existing only in the store passed -// to index methods. -type Index interface { - // List does iteration over the index with the provided prefix key and options. - // Prefix key values must correspond in type to the index's fields and the - // number of values provided cannot exceed the number of fields in the index, - // although fewer values can be provided. - List(ctx context.Context, prefixKey []interface{}, options ...ormlist.Option) (Iterator, error) - - // ListRange does range iteration over the index with the provided from and to - // values and options. - // - // From and to values must correspond in type to the index's fields and the number of values - // provided cannot exceed the number of fields in the index, although fewer - // values can be provided. - // - // Range iteration can only be done for from and to values which are - // well-ordered, meaning that any unordered components must be equal. Ex. - // the bytes type is considered unordered, so a range iterator is created - // over an index with a bytes field, both start and end must have the same - // value for bytes. - // - // Range iteration is inclusive at both ends. - ListRange(ctx context.Context, from, to []interface{}, options ...ormlist.Option) (Iterator, error) - - // DeleteBy deletes any entries which match the provided prefix key. - DeleteBy(context context.Context, prefixKey ...interface{}) error - - // DeleteRange deletes any entries between the provided range keys. - DeleteRange(context context.Context, from, to []interface{}) error - - // MessageType returns the protobuf message type of the index. - MessageType() protoreflect.MessageType - - // Fields returns the canonical field names of the index. - Fields() string - - doNotImplement() -} - -// concreteIndex is used internally by table implementations. -type concreteIndex interface { - Index - ormkv.IndexCodec - - readValueFromIndexKey(context ReadBackend, primaryKey []protoreflect.Value, value []byte, message proto.Message) error -} - -// UniqueIndex defines an unique index on a table. -type UniqueIndex interface { - Index - - // Has returns true if the key values are present in the store for this index. - Has(context context.Context, keyValues ...interface{}) (found bool, err error) - - // Get retrieves the message if one exists for the provided key values. - Get(context context.Context, message proto.Message, keyValues ...interface{}) (found bool, err error) -} - -type indexer interface { - onInsert(store kv.Store, message protoreflect.Message) error - onUpdate(store kv.Store, new, existing protoreflect.Message) error - onDelete(store kv.Store, message protoreflect.Message) error -} diff --git a/orm/model/ormtable/index_impl.go b/orm/model/ormtable/index_impl.go deleted file mode 100644 index 7aacd5aebac4..000000000000 --- a/orm/model/ormtable/index_impl.go +++ /dev/null @@ -1,121 +0,0 @@ -package ormtable - -import ( - "context" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - - "cosmossdk.io/orm/encoding/ormkv" - "cosmossdk.io/orm/internal/fieldnames" - "cosmossdk.io/orm/model/ormlist" - "cosmossdk.io/orm/types/kv" - "cosmossdk.io/orm/types/ormerrors" -) - -// indexKeyIndex implements Index for a regular IndexKey. -type indexKeyIndex struct { - *ormkv.IndexKeyCodec - fields fieldnames.FieldNames - primaryKey *primaryKeyIndex - getReadBackend func(context.Context) (ReadBackend, error) -} - -func (i indexKeyIndex) DeleteBy(ctx context.Context, keyValues ...interface{}) error { - it, err := i.List(ctx, keyValues) - if err != nil { - return err - } - - return i.primaryKey.deleteByIterator(ctx, it) -} - -func (i indexKeyIndex) DeleteRange(ctx context.Context, from, to []interface{}) error { - it, err := i.ListRange(ctx, from, to) - if err != nil { - return err - } - - return i.primaryKey.deleteByIterator(ctx, it) -} - -func (i indexKeyIndex) List(ctx context.Context, prefixKey []interface{}, options ...ormlist.Option) (Iterator, error) { - backend, err := i.getReadBackend(ctx) - if err != nil { - return nil, err - } - - return prefixIterator(backend.IndexStoreReader(), backend, i, i.KeyCodec, prefixKey, options) -} - -func (i indexKeyIndex) ListRange(ctx context.Context, from, to []interface{}, options ...ormlist.Option) (Iterator, error) { - backend, err := i.getReadBackend(ctx) - if err != nil { - return nil, err - } - - return rangeIterator(backend.IndexStoreReader(), backend, i, i.KeyCodec, from, to, options) -} - -var ( - _ indexer = &indexKeyIndex{} - _ Index = &indexKeyIndex{} -) - -func (i indexKeyIndex) doNotImplement() {} - -func (i indexKeyIndex) onInsert(store kv.Store, message protoreflect.Message) error { - k, v, err := i.EncodeKVFromMessage(message) - if err != nil { - return err - } - return store.Set(k, v) -} - -func (i indexKeyIndex) onUpdate(store kv.Store, new, existing protoreflect.Message) error { - newValues := i.GetKeyValues(new) - existingValues := i.GetKeyValues(existing) - if i.CompareKeys(newValues, existingValues) == 0 { - return nil - } - - existingKey, err := i.EncodeKey(existingValues) - if err != nil { - return err - } - err = store.Delete(existingKey) - if err != nil { - return err - } - - newKey, err := i.EncodeKey(newValues) - if err != nil { - return err - } - return store.Set(newKey, []byte{}) -} - -func (i indexKeyIndex) onDelete(store kv.Store, message protoreflect.Message) error { - _, key, err := i.EncodeKeyFromMessage(message) - if err != nil { - return err - } - return store.Delete(key) -} - -func (i indexKeyIndex) readValueFromIndexKey(backend ReadBackend, primaryKey []protoreflect.Value, _ []byte, message proto.Message) error { - found, err := i.primaryKey.get(backend, message, primaryKey) - if err != nil { - return err - } - - if !found { - return ormerrors.UnexpectedError.Wrapf("can't find primary key") - } - - return nil -} - -func (i indexKeyIndex) Fields() string { - return i.fields.String() -} diff --git a/orm/model/ormtable/iterator.go b/orm/model/ormtable/iterator.go deleted file mode 100644 index 3d8765d2adec..000000000000 --- a/orm/model/ormtable/iterator.go +++ /dev/null @@ -1,264 +0,0 @@ -package ormtable - -import ( - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - - queryv1beta1 "cosmossdk.io/api/cosmos/base/query/v1beta1" - "cosmossdk.io/orm/encoding/encodeutil" - "cosmossdk.io/orm/encoding/ormkv" - "cosmossdk.io/orm/internal/listinternal" - "cosmossdk.io/orm/model/ormlist" - "cosmossdk.io/orm/types/kv" -) - -// Iterator defines the interface for iterating over indexes. -// -// WARNING: it is generally unsafe to mutate a table while iterating over it. -// Instead you should do reads and writes separately, or use a helper -// function like DeleteBy which does this efficiently. -type Iterator interface { - // Next advances the iterator and returns true if a valid entry is found. - // Next must be called before starting iteration. - Next() bool - - // Keys returns the current index key and primary key values that the - // iterator points to. - Keys() (indexKey, primaryKey []protoreflect.Value, err error) - - // UnmarshalMessage unmarshals the entry the iterator currently points to - // the provided proto.Message. - UnmarshalMessage(proto.Message) error - - // GetMessage retrieves the proto.Message that the iterator currently points - // to. - GetMessage() (proto.Message, error) - - // Cursor returns the cursor referencing the current iteration position - // and can be used to restart iteration right after this position. - Cursor() ormlist.CursorT - - // PageResponse returns a non-nil page response after Next() returns false - // if pagination was requested in list options. - PageResponse() *queryv1beta1.PageResponse - - // Close closes the iterator and must always be called when done using - // the iterator. The defer keyword should generally be used for this. - Close() - - doNotImplement() -} - -func prefixIterator(iteratorStore kv.ReadonlyStore, backend ReadBackend, index concreteIndex, codec *ormkv.KeyCodec, prefix []interface{}, opts []listinternal.Option) (Iterator, error) { - options := &listinternal.Options{} - listinternal.ApplyOptions(options, opts) - if err := options.Validate(); err != nil { - return nil, err - } - - var prefixBz []byte - prefixBz, err := codec.EncodeKey(encodeutil.ValuesOf(prefix...)) - if err != nil { - return nil, err - } - - var res Iterator - if !options.Reverse { - var start []byte - if len(options.Cursor) != 0 { - // must start right after cursor - start = append(options.Cursor, 0x0) - } else { - start = prefixBz - } - end := prefixEndBytes(prefixBz) - it, err := iteratorStore.Iterator(start, end) - if err != nil { - return nil, err - } - res = &indexIterator{ - index: index, - store: backend, - iterator: it, - started: false, - } - } else { - var end []byte - if len(options.Cursor) != 0 { - // end bytes is already exclusive by default - end = options.Cursor - } else { - end = prefixEndBytes(prefixBz) - } - it, err := iteratorStore.ReverseIterator(prefixBz, end) - if err != nil { - return nil, err - } - - res = &indexIterator{ - index: index, - store: backend, - iterator: it, - started: false, - } - } - - return applyCommonIteratorOptions(res, options) -} - -func rangeIterator(iteratorStore kv.ReadonlyStore, reader ReadBackend, index concreteIndex, codec *ormkv.KeyCodec, start, end []interface{}, opts []listinternal.Option) (Iterator, error) { - options := &listinternal.Options{} - listinternal.ApplyOptions(options, opts) - if err := options.Validate(); err != nil { - return nil, err - } - - startValues := encodeutil.ValuesOf(start...) - endValues := encodeutil.ValuesOf(end...) - err := codec.CheckValidRangeIterationKeys(startValues, endValues) - if err != nil { - return nil, err - } - - startBz, err := codec.EncodeKey(startValues) - if err != nil { - return nil, err - } - - endBz, err := codec.EncodeKey(endValues) - if err != nil { - return nil, err - } - - // NOTE: fullEndKey indicates whether the end key contained all the fields of the key, - // if it did then we need to use inclusive end bytes, otherwise we prefix the end bytes - fullEndKey := len(codec.GetFieldNames()) == len(end) - - var res Iterator - if !options.Reverse { - if len(options.Cursor) != 0 { - startBz = append(options.Cursor, 0) - } - - if fullEndKey { - endBz = inclusiveEndBytes(endBz) - } else { - endBz = prefixEndBytes(endBz) - } - - it, err := iteratorStore.Iterator(startBz, endBz) - if err != nil { - return nil, err - } - res = &indexIterator{ - index: index, - store: reader, - iterator: it, - started: false, - } - } else { - if len(options.Cursor) != 0 { - endBz = options.Cursor - } else { - if fullEndKey { - endBz = inclusiveEndBytes(endBz) - } else { - endBz = prefixEndBytes(endBz) - } - } - it, err := iteratorStore.ReverseIterator(startBz, endBz) - if err != nil { - return nil, err - } - - res = &indexIterator{ - index: index, - store: reader, - iterator: it, - started: false, - } - } - - return applyCommonIteratorOptions(res, options) -} - -func applyCommonIteratorOptions(iterator Iterator, options *listinternal.Options) (Iterator, error) { - if options.Filter != nil { - iterator = &filterIterator{Iterator: iterator, filter: options.Filter} - } - - if options.CountTotal || options.Limit != 0 || options.Offset != 0 || options.DefaultLimit != 0 { - iterator = paginate(iterator, options) - } - - return iterator, nil -} - -type indexIterator struct { - index concreteIndex - store ReadBackend - iterator kv.Iterator - - indexValues []protoreflect.Value - primaryKey []protoreflect.Value - value []byte - started bool -} - -func (i *indexIterator) PageResponse() *queryv1beta1.PageResponse { - return nil -} - -func (i *indexIterator) Next() bool { - if !i.started { - i.started = true - } else { - i.iterator.Next() - i.indexValues = nil - } - - return i.iterator.Valid() -} - -func (i *indexIterator) Keys() (indexKey, primaryKey []protoreflect.Value, err error) { - if i.indexValues != nil { - return i.indexValues, i.primaryKey, nil - } - - i.value = i.iterator.Value() - i.indexValues, i.primaryKey, err = i.index.DecodeIndexKey(i.iterator.Key(), i.value) - if err != nil { - return nil, nil, err - } - - return i.indexValues, i.primaryKey, nil -} - -func (i indexIterator) UnmarshalMessage(message proto.Message) error { - _, pk, err := i.Keys() - if err != nil { - return err - } - return i.index.readValueFromIndexKey(i.store, pk, i.value, message) -} - -func (i *indexIterator) GetMessage() (proto.Message, error) { - msg := i.index.MessageType().New().Interface() - err := i.UnmarshalMessage(msg) - return msg, err -} - -func (i indexIterator) Cursor() ormlist.CursorT { - return i.iterator.Key() -} - -func (i indexIterator) Close() { - err := i.iterator.Close() - if err != nil { - panic(err) - } -} - -func (indexIterator) doNotImplement() {} - -var _ Iterator = &indexIterator{} diff --git a/orm/model/ormtable/paginate.go b/orm/model/ormtable/paginate.go deleted file mode 100644 index 02ae110a83c0..000000000000 --- a/orm/model/ormtable/paginate.go +++ /dev/null @@ -1,97 +0,0 @@ -package ormtable - -import ( - "math" - - "cosmossdk.io/orm/internal/listinternal" - - queryv1beta1 "cosmossdk.io/api/cosmos/base/query/v1beta1" -) - -func paginate(it Iterator, options *listinternal.Options) Iterator { - offset := int(options.Offset) - limit := int(options.Limit) - if limit == 0 { - limit = int(options.DefaultLimit) - } - - i := 0 - if offset != 0 { - for ; i < offset; i++ { - if !it.Next() { - return &paginationIterator{ - Iterator: it, - pageRes: &queryv1beta1.PageResponse{Total: uint64(i)}, - } - } - } - } - - var done int - if limit != 0 { - done = limit + offset - } else { - done = math.MaxInt - } - - return &paginationIterator{ - Iterator: it, - pageRes: nil, - countTotal: options.CountTotal, - i: i, - done: done, - } -} - -type paginationIterator struct { - Iterator - pageRes *queryv1beta1.PageResponse - countTotal bool - i int - done int -} - -func (it *paginationIterator) Next() bool { - if it.i >= it.done { - it.pageRes = &queryv1beta1.PageResponse{} - cursor := it.Cursor() - next := it.Iterator.Next() - if next { - it.pageRes.NextKey = cursor - it.i++ - } - if it.countTotal { - // once it.Iterator.Next() returns false, another call to it will panic. - // we check next here to ensure we do not call it again. - if next { - for { - if !it.Iterator.Next() { - it.pageRes.Total = uint64(it.i) - return false - } - it.i++ - } - } else { - // when next is false, the iterator can no longer move forward, - // so the index == total entries. - it.pageRes.Total = uint64(it.i) - } - } - return false - } - - ok := it.Iterator.Next() - if ok { - it.i++ - return true - } - - it.pageRes = &queryv1beta1.PageResponse{ - Total: uint64(it.i), - } - return false -} - -func (it paginationIterator) PageResponse() *queryv1beta1.PageResponse { - return it.pageRes -} diff --git a/orm/model/ormtable/primary_key.go b/orm/model/ormtable/primary_key.go deleted file mode 100644 index 1efd1cbbf802..000000000000 --- a/orm/model/ormtable/primary_key.go +++ /dev/null @@ -1,240 +0,0 @@ -package ormtable - -import ( - "context" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - - "cosmossdk.io/orm/encoding/encodeutil" - "cosmossdk.io/orm/encoding/ormkv" - "cosmossdk.io/orm/internal/fieldnames" - "cosmossdk.io/orm/model/ormlist" - "cosmossdk.io/orm/types/ormerrors" -) - -// primaryKeyIndex defines an UniqueIndex for the primary key. -type primaryKeyIndex struct { - *ormkv.PrimaryKeyCodec - fields fieldnames.FieldNames - indexers []indexer - getBackend func(context.Context) (ReadBackend, error) -} - -func (p primaryKeyIndex) List(ctx context.Context, prefixKey []interface{}, options ...ormlist.Option) (Iterator, error) { - backend, err := p.getBackend(ctx) - if err != nil { - return nil, err - } - - return prefixIterator(backend.CommitmentStoreReader(), backend, p, p.KeyCodec, prefixKey, options) -} - -func (p primaryKeyIndex) ListRange(ctx context.Context, from, to []interface{}, options ...ormlist.Option) (Iterator, error) { - backend, err := p.getBackend(ctx) - if err != nil { - return nil, err - } - - return rangeIterator(backend.CommitmentStoreReader(), backend, p, p.KeyCodec, from, to, options) -} - -func (p primaryKeyIndex) doNotImplement() {} - -func (p primaryKeyIndex) Has(ctx context.Context, key ...interface{}) (found bool, err error) { - backend, err := p.getBackend(ctx) - if err != nil { - return false, err - } - - return p.has(backend, encodeutil.ValuesOf(key...)) -} - -func (p primaryKeyIndex) has(backend ReadBackend, values []protoreflect.Value) (found bool, err error) { - keyBz, err := p.EncodeKey(values) - if err != nil { - return false, err - } - - return backend.CommitmentStoreReader().Has(keyBz) -} - -func (p primaryKeyIndex) Get(ctx context.Context, message proto.Message, values ...interface{}) (found bool, err error) { - backend, err := p.getBackend(ctx) - if err != nil { - return false, err - } - - return p.get(backend, message, encodeutil.ValuesOf(values...)) -} - -func (p primaryKeyIndex) get(backend ReadBackend, message proto.Message, values []protoreflect.Value) (found bool, err error) { - key, err := p.EncodeKey(values) - if err != nil { - return false, err - } - - return p.getByKeyBytes(backend, key, values, message) -} - -func (p primaryKeyIndex) DeleteBy(ctx context.Context, primaryKeyValues ...interface{}) error { - if len(primaryKeyValues) == len(p.GetFieldNames()) { - return p.doDelete(ctx, encodeutil.ValuesOf(primaryKeyValues...)) - } - - it, err := p.List(ctx, primaryKeyValues) - if err != nil { - return err - } - - return p.deleteByIterator(ctx, it) -} - -func (p primaryKeyIndex) DeleteRange(ctx context.Context, from, to []interface{}) error { - it, err := p.ListRange(ctx, from, to) - if err != nil { - return err - } - - return p.deleteByIterator(ctx, it) -} - -func (p primaryKeyIndex) getWriteBackend(ctx context.Context) (Backend, error) { - backend, err := p.getBackend(ctx) - if err != nil { - return nil, err - } - - if writeBackend, ok := backend.(Backend); ok { - return writeBackend, nil - } - - return nil, ormerrors.ReadOnly -} - -func (p primaryKeyIndex) doDelete(ctx context.Context, primaryKeyValues []protoreflect.Value) error { - backend, err := p.getWriteBackend(ctx) - if err != nil { - return err - } - - // delete object - writer := newBatchIndexCommitmentWriter(backend) - defer writer.Close() - - pk, err := p.EncodeKey(primaryKeyValues) - if err != nil { - return err - } - - msg := p.MessageType().New().Interface() - found, err := p.getByKeyBytes(backend, pk, primaryKeyValues, msg) - if err != nil { - return err - } - - if !found { - return nil - } - - err = p.doDeleteWithWriteBatch(ctx, backend, writer, pk, msg) - if err != nil { - return err - } - - return writer.Write() -} - -func (p primaryKeyIndex) doDeleteWithWriteBatch(ctx context.Context, backend Backend, writer *batchIndexCommitmentWriter, primaryKeyBz []byte, message proto.Message) error { - if hooks := backend.ValidateHooks(); hooks != nil { - err := hooks.ValidateDelete(ctx, message) - if err != nil { - return err - } - } - - // delete object - err := writer.CommitmentStore().Delete(primaryKeyBz) - if err != nil { - return err - } - - // clear indexes - mref := message.ProtoReflect() - indexStoreWriter := writer.IndexStore() - for _, idx := range p.indexers { - err := idx.onDelete(indexStoreWriter, mref) - if err != nil { - return err - } - } - - if writeHooks := backend.WriteHooks(); writeHooks != nil { - writer.enqueueHook(func() { - writeHooks.OnDelete(ctx, message) - }) - } - - return nil -} - -func (p primaryKeyIndex) getByKeyBytes(store ReadBackend, key []byte, keyValues []protoreflect.Value, message proto.Message) (found bool, err error) { - bz, err := store.CommitmentStoreReader().Get(key) - if err != nil { - return false, err - } - - if bz == nil { - return false, nil - } - - return true, p.Unmarshal(keyValues, bz, message) -} - -func (p primaryKeyIndex) readValueFromIndexKey(_ ReadBackend, primaryKey []protoreflect.Value, value []byte, message proto.Message) error { - return p.Unmarshal(primaryKey, value, message) -} - -func (p primaryKeyIndex) Fields() string { - return p.fields.String() -} - -func (p primaryKeyIndex) deleteByIterator(ctx context.Context, it Iterator) error { - backend, err := p.getWriteBackend(ctx) - if err != nil { - return err - } - - // we batch writes while the iterator is still open - writer := newBatchIndexCommitmentWriter(backend) - defer writer.Close() - - for it.Next() { - _, pk, err := it.Keys() - if err != nil { - return err - } - - msg, err := it.GetMessage() - if err != nil { - return err - } - - pkBz, err := p.EncodeKey(pk) - if err != nil { - return err - } - - err = p.doDeleteWithWriteBatch(ctx, backend, writer, pkBz, msg) - if err != nil { - return err - } - } - - // close iterator - it.Close() - // then write batch - return writer.Write() -} - -var _ UniqueIndex = &primaryKeyIndex{} diff --git a/orm/model/ormtable/save_test.go b/orm/model/ormtable/save_test.go deleted file mode 100644 index 3222ff3ad89f..000000000000 --- a/orm/model/ormtable/save_test.go +++ /dev/null @@ -1,69 +0,0 @@ -package ormtable_test - -import ( - "context" - "fmt" - "testing" - - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/encoding/protojson" - - "github.com/regen-network/gocuke" - "gotest.tools/v3/assert" - - "cosmossdk.io/orm/internal/testpb" - "cosmossdk.io/orm/model/ormtable" - "cosmossdk.io/orm/testing/ormtest" -) - -func TestSave(t *testing.T) { - gocuke.NewRunner(t, &suite{}).Path("../../features/table/saving.feature").Run() -} - -type suite struct { - gocuke.TestingT - table ormtable.Table - ctx context.Context - err error -} - -func (s *suite) Before() { - var err error - s.table, err = ormtable.Build(ormtable.Options{ - MessageType: (&testpb.SimpleExample{}).ProtoReflect().Type(), - }) - assert.NilError(s, err) - s.ctx = ormtable.WrapContextDefault(ormtest.NewMemoryBackend()) -} - -func (s *suite) AnExistingEntity(docString gocuke.DocString) { - existing := s.simpleExampleFromDocString(docString) - assert.NilError(s, s.table.Insert(s.ctx, existing)) -} - -func (s suite) simpleExampleFromDocString(docString gocuke.DocString) *testpb.SimpleExample { - ex := &testpb.SimpleExample{} - assert.NilError(s, protojson.Unmarshal([]byte(docString.Content), ex)) - return ex -} - -func (s *suite) IInsert(a gocuke.DocString) { - ex := s.simpleExampleFromDocString(a) - s.err = s.table.Insert(s.ctx, ex) -} - -func (s *suite) IUpdate(a gocuke.DocString) { - ex := s.simpleExampleFromDocString(a) - s.err = s.table.Update(s.ctx, ex) -} - -func (s *suite) ExpectAError(a string) { - assert.ErrorContains(s, s.err, a) -} - -func (s *suite) ExpectGrpcErrorCode(a string) { - var code codes.Code - assert.NilError(s, code.UnmarshalJSON([]byte(fmt.Sprintf("%q", a)))) - assert.Equal(s, code, status.Code(s.err)) -} diff --git a/orm/model/ormtable/singleton.go b/orm/model/ormtable/singleton.go deleted file mode 100644 index 13bf37f2afa1..000000000000 --- a/orm/model/ormtable/singleton.go +++ /dev/null @@ -1,101 +0,0 @@ -package ormtable - -import ( - "context" - "encoding/json" - "io" - - "google.golang.org/protobuf/encoding/protojson" - "google.golang.org/protobuf/proto" -) - -// singleton implements a Table instance for singletons. -type singleton struct { - *tableImpl -} - -func (t singleton) DefaultJSON() json.RawMessage { - msg := t.MessageType().New().Interface() - bz, err := t.jsonMarshalOptions().Marshal(msg) - if err != nil { - return json.RawMessage("{}") - } - return bz -} - -func (t singleton) ValidateJSON(reader io.Reader) error { - bz, err := io.ReadAll(reader) - if err != nil { - return err - } - - msg := t.MessageType().New().Interface() - err = protojson.Unmarshal(bz, msg) - if err != nil { - return err - } - - if t.customJSONValidator != nil { - return t.customJSONValidator(msg) - } - - return DefaultJSONValidator(msg) -} - -func (t singleton) ImportJSON(ctx context.Context, reader io.Reader) error { - backend, err := t.getWriteBackend(ctx) - if err != nil { - return err - } - - bz, err := io.ReadAll(reader) - if err != nil { - return err - } - - msg := t.MessageType().New().Interface() - err = protojson.Unmarshal(bz, msg) - if err != nil { - return err - } - - return t.save(ctx, backend, msg, saveModeDefault) -} - -func (t singleton) ExportJSON(ctx context.Context, writer io.Writer) error { - msg := t.MessageType().New().Interface() - found, err := t.Get(ctx, msg) - if err != nil { - return err - } - - var bz []byte - if !found { - bz = t.DefaultJSON() - } else { - bz, err = t.jsonMarshalOptions().Marshal(msg) - if err != nil { - return err - } - } - - _, err = writer.Write(bz) - return err -} - -func (t singleton) jsonMarshalOptions() protojson.MarshalOptions { - return protojson.MarshalOptions{ - Multiline: true, - Indent: "", - UseProtoNames: true, - EmitUnpopulated: true, - Resolver: t.typeResolver, - } -} - -func (t *singleton) GetTable(message proto.Message) Table { - if message.ProtoReflect().Descriptor().FullName() == t.MessageType().Descriptor().FullName() { - return t - } - return nil -} diff --git a/orm/model/ormtable/singleton_test.go b/orm/model/ormtable/singleton_test.go deleted file mode 100644 index 44a8c8f778f9..000000000000 --- a/orm/model/ormtable/singleton_test.go +++ /dev/null @@ -1,48 +0,0 @@ -package ormtable_test - -import ( - "bytes" - "testing" - - "google.golang.org/protobuf/testing/protocmp" - - "gotest.tools/v3/assert" - - "cosmossdk.io/orm/internal/testkv" - "cosmossdk.io/orm/internal/testpb" - "cosmossdk.io/orm/model/ormtable" -) - -func TestSingleton(t *testing.T) { - table, err := ormtable.Build(ormtable.Options{ - MessageType: (&testpb.ExampleSingleton{}).ProtoReflect().Type(), - }) - assert.NilError(t, err) - ctx := ormtable.WrapContextDefault(testkv.NewSplitMemBackend()) - - store, err := testpb.NewExampleSingletonTable(table) - assert.NilError(t, err) - - val, err := store.Get(ctx) - assert.NilError(t, err) - assert.Assert(t, val != nil) // singletons are always set - assert.NilError(t, store.Save(ctx, &testpb.ExampleSingleton{})) - - val.Foo = "abc" - val.Bar = 3 - assert.NilError(t, store.Save(ctx, val)) - - val2, err := store.Get(ctx) - assert.NilError(t, err) - assert.DeepEqual(t, val, val2, protocmp.Transform()) - - buf := &bytes.Buffer{} - assert.NilError(t, table.ExportJSON(ctx, buf)) - assert.NilError(t, table.ValidateJSON(bytes.NewReader(buf.Bytes()))) - store2 := ormtable.WrapContextDefault(testkv.NewSplitMemBackend()) - assert.NilError(t, table.ImportJSON(store2, bytes.NewReader(buf.Bytes()))) - - val3, err := store.Get(ctx) - assert.NilError(t, err) - assert.DeepEqual(t, val, val3, protocmp.Transform()) -} diff --git a/orm/model/ormtable/table.go b/orm/model/ormtable/table.go deleted file mode 100644 index 1bbdab7376ed..000000000000 --- a/orm/model/ormtable/table.go +++ /dev/null @@ -1,164 +0,0 @@ -package ormtable - -import ( - "context" - "encoding/json" - "io" - - "google.golang.org/protobuf/proto" - - "cosmossdk.io/orm/encoding/ormkv" -) - -// View defines a read-only table. -// -// It exists as a separate interacted to support future scenarios where -// tables may be "supported" virtually to provide compatibility between -// systems, for instance to enable backwards compatibility when a major -// migration needs to be performed. -type View interface { - Index - - // Has returns true if there is an entity in the table with the same - // primary key as message. Other fields besides the primary key fields will not - // be used for retrieval. - Has(ctx context.Context, message proto.Message) (found bool, err error) - - // Get retrieves the message if one exists for the primary key fields - // set on the message. Other fields besides the primary key fields will not - // be used for retrieval. - Get(ctx context.Context, message proto.Message) (found bool, err error) - - // GetIndex returns the index referenced by the provided fields if - // one exists or nil. Note that some concrete indexes can be retrieved by - // multiple lists of fields. - GetIndex(fields string) Index - - // GetUniqueIndex returns the unique index referenced by the provided fields if - // one exists or nil. Note that some concrete indexes can be retrieved by - // multiple lists of fields. - GetUniqueIndex(fields string) UniqueIndex - - // Indexes returns all the concrete indexes for the table. - Indexes() []Index - - // GetIndexByID returns the index with the provided ID or nil. - GetIndexByID(id uint32) Index - - // PrimaryKey returns the primary key unique index. - PrimaryKey() UniqueIndex -} - -// Table is an abstract interface around a concrete table. Table instances -// are stateless, with all state existing only in the store passed -// to table and index methods. -type Table interface { - View - - ormkv.EntryCodec - - // Save saves the provided entry in the store either inserting it or - // updating it if needed. - // - // If store implement the ValidateHooks interface, the appropriate ValidateInsert or - // ValidateUpdate hook method will be called. - // - // Save attempts to be atomic with respect to the underlying store, - // meaning that either the full save operation is written or the store is - // left unchanged, unless there is an error with the underlying store. - // - // If a unique key constraint is violated, ormerrors.UniqueKeyViolation - // (or an error wrapping it) will be returned. - Save(context context.Context, message proto.Message) error - - // Insert inserts the provided entry in the store and fails if there is - // an unique key violation. See Save for more details on behavior. - // - // If an entity with the same primary key exists, an error wrapping - // ormerrors.AlreadyExists will be returned. - Insert(ctx context.Context, message proto.Message) error - - // Update updates the provided entry in the store and fails if an entry - // with a matching primary key does not exist. See Save for more details - // on behavior. - // - // If an entity with the same primary key does not exist, ormerrors.NotFound - // (or an error wrapping it) will be returned. - Update(ctx context.Context, message proto.Message) error - - // Delete deletes the entry with the with primary key fields set on message - // if one exists. Other fields besides the primary key fields will not - // be used for retrieval. - // - // If store implement the ValidateHooks interface, the ValidateDelete hook method will - // be called. - // - // Delete attempts to be atomic with respect to the underlying store, - // meaning that either the full save operation is written or the store is - // left unchanged, unless there is an error with the underlying store. - Delete(ctx context.Context, message proto.Message) error - - // DefaultJSON returns default JSON that can be used as a template for - // genesis files. - // - // For regular tables this an empty JSON array, but for singletons an - // empty instance of the singleton is marshaled. - DefaultJSON() json.RawMessage - - // ValidateJSON validates JSON streamed from the reader. - ValidateJSON(io.Reader) error - - // ImportJSON imports JSON into the store, streaming one entry at a time. - // Each table should be import from a separate JSON file to enable proper - // streaming. - // - // Regular tables should be stored as an array of objects with each object - // corresponding to a single record in the table. - // - // Auto-incrementing tables - // can optionally have the last sequence value as the first element in the - // array. If the last sequence value is provided, then each value of the - // primary key in the file must be <= this last sequence value or omitted - // entirely. If no last sequence value is provided, no entries should - // contain the primary key as this will be auto-assigned. - // - // Singletons should define a single object and not an array. - // - // ImportJSON is not atomic with respect to the underlying store, meaning - // that in the case of an error, some records may already have been - // imported. It is assumed that ImportJSON is called in the context of some - // larger transaction isolation. - ImportJSON(context.Context, io.Reader) error - - // ExportJSON exports JSON in the format accepted by ImportJSON. - // Auto-incrementing tables will export the last sequence number as the - // first element in the JSON array. - ExportJSON(context.Context, io.Writer) error - - // ID is the ID of this table within the schema of its FileDescriptor. - ID() uint32 - - Schema -} - -// Schema is an interface for things that contain tables and can encode and -// decode kv-store pairs. - -type Schema interface { - ormkv.EntryCodec - - // GetTable returns the table for the provided message type or nil. - GetTable(message proto.Message) Table -} - -type AutoIncrementTable interface { - Table - - // InsertReturningPKey inserts the provided entry in the store and returns the newly - // generated primary key for the message or an error. - InsertReturningPKey(ctx context.Context, message proto.Message) (newPK uint64, err error) - - // LastInsertedSequence retrieves the sequence number of the last entry inserted into the table. - // The LastInsertedSequence is 0 if no entries have been inserted into the table. - LastInsertedSequence(ctx context.Context) (uint64, error) -} diff --git a/orm/model/ormtable/table_impl.go b/orm/model/ormtable/table_impl.go deleted file mode 100644 index 9321ae269664..000000000000 --- a/orm/model/ormtable/table_impl.go +++ /dev/null @@ -1,430 +0,0 @@ -package ormtable - -import ( - "bytes" - "context" - "encoding/binary" - "encoding/json" - "io" - "math" - - "google.golang.org/protobuf/encoding/protojson" - "google.golang.org/protobuf/proto" - - "cosmossdk.io/orm/encoding/encodeutil" - "cosmossdk.io/orm/encoding/ormkv" - "cosmossdk.io/orm/internal/fieldnames" - "cosmossdk.io/orm/types/ormerrors" -) - -// tableImpl implements Table. -type tableImpl struct { - *primaryKeyIndex - indexes []Index - indexesByFields map[fieldnames.FieldNames]concreteIndex - uniqueIndexesByFields map[fieldnames.FieldNames]UniqueIndex - indexesByID map[uint32]Index - entryCodecsByID map[uint32]ormkv.EntryCodec - tablePrefix []byte - tableID uint32 - typeResolver TypeResolver - customJSONValidator func(message proto.Message) error -} - -func (t *tableImpl) GetTable(message proto.Message) Table { - if message.ProtoReflect().Descriptor().FullName() == t.MessageType().Descriptor().FullName() { - return t - } - return nil -} - -func (t tableImpl) PrimaryKey() UniqueIndex { - return t.primaryKeyIndex -} - -func (t tableImpl) GetIndexByID(id uint32) Index { - return t.indexesByID[id] -} - -func (t tableImpl) Save(ctx context.Context, message proto.Message) error { - backend, err := t.getWriteBackend(ctx) - if err != nil { - return err - } - - return t.save(ctx, backend, message, saveModeDefault) -} - -func (t tableImpl) Insert(ctx context.Context, message proto.Message) error { - backend, err := t.getWriteBackend(ctx) - if err != nil { - return err - } - - return t.save(ctx, backend, message, saveModeInsert) -} - -func (t tableImpl) Update(ctx context.Context, message proto.Message) error { - backend, err := t.getWriteBackend(ctx) - if err != nil { - return err - } - - return t.save(ctx, backend, message, saveModeUpdate) -} - -func (t tableImpl) save(ctx context.Context, backend Backend, message proto.Message, mode saveMode) error { - writer := newBatchIndexCommitmentWriter(backend) - defer writer.Close() - return t.doSave(ctx, writer, message, mode) -} - -func (t tableImpl) doSave(ctx context.Context, writer *batchIndexCommitmentWriter, message proto.Message, mode saveMode) error { - mref := message.ProtoReflect() - pkValues, pk, err := t.EncodeKeyFromMessage(mref) - if err != nil { - return err - } - - existing := mref.New().Interface() - haveExisting, err := t.getByKeyBytes(writer, pk, pkValues, existing) - if err != nil { - return err - } - - if haveExisting { - if mode == saveModeInsert { - return ormerrors.AlreadyExists.Wrapf("%q:%+v", mref.Descriptor().FullName(), pkValues) - } - - if validateHooks := writer.ValidateHooks(); validateHooks != nil { - err = validateHooks.ValidateUpdate(ctx, existing, message) - if err != nil { - return err - } - } - } else { - if mode == saveModeUpdate { - return ormerrors.NotFound.Wrapf("%q", mref.Descriptor().FullName()) - } - - if validateHooks := writer.ValidateHooks(); validateHooks != nil { - err = validateHooks.ValidateInsert(ctx, message) - if err != nil { - return err - } - } - } - - // temporarily clear primary key - t.ClearValues(mref) - - // store object - bz, err := proto.MarshalOptions{Deterministic: true}.Marshal(message) - if err != nil { - return err - } - err = writer.CommitmentStore().Set(pk, bz) - if err != nil { - return err - } - - // set primary key again - t.SetKeyValues(mref, pkValues) - - // set indexes - indexStoreWriter := writer.IndexStore() - if !haveExisting { - for _, idx := range t.indexers { - err = idx.onInsert(indexStoreWriter, mref) - if err != nil { - return err - } - - } - if writeHooks := writer.WriteHooks(); writeHooks != nil { - writer.enqueueHook(func() { - writeHooks.OnInsert(ctx, message) - }) - } - } else { - existingMref := existing.ProtoReflect() - for _, idx := range t.indexers { - err = idx.onUpdate(indexStoreWriter, mref, existingMref) - if err != nil { - return err - } - } - if writeHooks := writer.WriteHooks(); writeHooks != nil { - writer.enqueueHook(func() { - writeHooks.OnUpdate(ctx, existing, message) - }) - } - } - - return writer.Write() -} - -func (t tableImpl) Delete(ctx context.Context, message proto.Message) error { - pk := t.PrimaryKeyCodec.GetKeyValues(message.ProtoReflect()) - return t.doDelete(ctx, pk) -} - -func (t tableImpl) GetIndex(fields string) Index { - return t.indexesByFields[fieldnames.CommaSeparatedFieldNames(fields)] -} - -func (t tableImpl) GetUniqueIndex(fields string) UniqueIndex { - return t.uniqueIndexesByFields[fieldnames.CommaSeparatedFieldNames(fields)] -} - -func (t tableImpl) Indexes() []Index { - return t.indexes -} - -func (t tableImpl) DefaultJSON() json.RawMessage { - return json.RawMessage("[]") -} - -func (t tableImpl) decodeJSON(reader io.Reader, onMsg func(message proto.Message) error) error { - decoder, err := t.startDecodeJSON(reader) - if err != nil { - return err - } - - return t.doDecodeJSON(decoder, nil, onMsg) -} - -func (t tableImpl) startDecodeJSON(reader io.Reader) (*json.Decoder, error) { - decoder := json.NewDecoder(reader) - token, err := decoder.Token() - if err != nil { - return nil, err - } - - if token != json.Delim('[') { - return nil, ormerrors.JSONImportError.Wrapf("expected [ got %s", token) - } - - return decoder, nil -} - -// onFirst is called on the first RawMessage and used for auto-increment tables -// to decode the sequence in which case it should return true. -// onMsg is called on every decoded message -func (t tableImpl) doDecodeJSON(decoder *json.Decoder, onFirst func(message json.RawMessage) bool, onMsg func(message proto.Message) error) error { - unmarshalOptions := protojson.UnmarshalOptions{Resolver: t.typeResolver} - - first := true - for decoder.More() { - var rawJSON json.RawMessage - err := decoder.Decode(&rawJSON) - if err != nil { - return ormerrors.JSONImportError.Wrapf("%s", err) - } - - if first { - first = false - if onFirst != nil { - if onFirst(rawJSON) { - // if onFirst handled this, skip decoding into a proto message - continue - } - } - } - - msg := t.MessageType().New().Interface() - err = unmarshalOptions.Unmarshal(rawJSON, msg) - if err != nil { - return err - } - - err = onMsg(msg) - if err != nil { - return err - } - } - - token, err := decoder.Token() - if err != nil { - return err - } - - if token != json.Delim(']') { - return ormerrors.JSONImportError.Wrapf("expected ] got %s", token) - } - - return nil -} - -// DefaultJSONValidator is the default validator used when calling -// Table.ValidateJSON(). It will call methods with the signature `ValidateBasic() error` -// and/or `Validate() error` to validate the message. -func DefaultJSONValidator(message proto.Message) error { - if v, ok := message.(interface{ ValidateBasic() error }); ok { - err := v.ValidateBasic() - if err != nil { - return err - } - } - - if v, ok := message.(interface{ Validate() error }); ok { - err := v.Validate() - if err != nil { - return err - } - } - - return nil -} - -func (t tableImpl) ValidateJSON(reader io.Reader) error { - return t.decodeJSON(reader, func(message proto.Message) error { - if t.customJSONValidator != nil { - return t.customJSONValidator(message) - } - - return DefaultJSONValidator(message) - }) -} - -func (t tableImpl) ImportJSON(ctx context.Context, reader io.Reader) error { - backend, err := t.getWriteBackend(ctx) - if err != nil { - return err - } - - return t.decodeJSON(reader, func(message proto.Message) error { - return t.save(ctx, backend, message, saveModeDefault) - }) -} - -func (t tableImpl) ExportJSON(context context.Context, writer io.Writer) error { - _, err := writer.Write([]byte("[")) - if err != nil { - return err - } - - return t.doExportJSON(context, writer, true) -} - -func (t tableImpl) doExportJSON(ctx context.Context, writer io.Writer, start bool) error { - marshalOptions := protojson.MarshalOptions{ - UseProtoNames: true, - Resolver: t.typeResolver, - } - - var err error - it, _ := t.List(ctx, nil) - for { - found := it.Next() - - if !found { - _, err = writer.Write([]byte("]")) - return err - } else if !start { - _, err = writer.Write([]byte(",\n")) - if err != nil { - return err - } - } - start = false - - msg := t.MessageType().New().Interface() - err = it.UnmarshalMessage(msg) - if err != nil { - return err - } - - bz, err := marshalOptions.Marshal(msg) - if err != nil { - return err - } - - _, err = writer.Write(bz) - if err != nil { - return err - } - - } -} - -func (t tableImpl) DecodeEntry(k, v []byte) (ormkv.Entry, error) { - r := bytes.NewReader(k) - err := encodeutil.SkipPrefix(r, t.tablePrefix) - if err != nil { - return nil, err - } - - id, err := binary.ReadUvarint(r) - if err != nil { - return nil, err - } - - if id > math.MaxUint32 { - return nil, ormerrors.UnexpectedDecodePrefix.Wrapf("uint32 varint id out of range %d", id) - } - - idx, ok := t.entryCodecsByID[uint32(id)] - if !ok { - return nil, ormerrors.UnexpectedDecodePrefix.Wrapf("can't find field with id %d", id) - } - - return idx.DecodeEntry(k, v) -} - -func (t tableImpl) EncodeEntry(entry ormkv.Entry) (k, v []byte, err error) { - switch entry := entry.(type) { - case *ormkv.PrimaryKeyEntry: - return t.PrimaryKeyCodec.EncodeEntry(entry) - case *ormkv.IndexKeyEntry: - idx, ok := t.indexesByFields[fieldnames.FieldsFromNames(entry.Fields)] - if !ok { - return nil, nil, ormerrors.BadDecodeEntry.Wrapf("can't find index with fields %s", entry.Fields) - } - - return idx.EncodeEntry(entry) - default: - return nil, nil, ormerrors.BadDecodeEntry.Wrapf("%s", entry) - } -} - -func (t tableImpl) ID() uint32 { - return t.tableID -} - -func (t tableImpl) Has(ctx context.Context, message proto.Message) (found bool, err error) { - backend, err := t.getBackend(ctx) - if err != nil { - return false, err - } - - keyValues := t.primaryKeyIndex.PrimaryKeyCodec.GetKeyValues(message.ProtoReflect()) - return t.primaryKeyIndex.has(backend, keyValues) -} - -// Get retrieves the message if one exists for the primary key fields -// set on the message. Other fields besides the primary key fields will not -// be used for retrieval. -func (t tableImpl) Get(ctx context.Context, message proto.Message) (found bool, err error) { - backend, err := t.getBackend(ctx) - if err != nil { - return false, err - } - - keyValues := t.primaryKeyIndex.PrimaryKeyCodec.GetKeyValues(message.ProtoReflect()) - return t.primaryKeyIndex.get(backend, message, keyValues) -} - -var ( - _ Table = &tableImpl{} - _ Schema = &tableImpl{} -) - -type saveMode int - -const ( - saveModeDefault saveMode = iota - saveModeInsert - saveModeUpdate -) diff --git a/orm/model/ormtable/table_test.go b/orm/model/ormtable/table_test.go deleted file mode 100644 index 766bb76592f5..000000000000 --- a/orm/model/ormtable/table_test.go +++ /dev/null @@ -1,763 +0,0 @@ -package ormtable_test - -import ( - "bytes" - "context" - "fmt" - "sort" - "strings" - "testing" - - dbm "github.com/cosmos/cosmos-db" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/testing/protocmp" - "gotest.tools/v3/assert" - "gotest.tools/v3/golden" - "pgregory.net/rapid" - - queryv1beta1 "cosmossdk.io/api/cosmos/base/query/v1beta1" - sdkerrors "cosmossdk.io/errors" - - "cosmossdk.io/orm/encoding/ormkv" - "cosmossdk.io/orm/internal/testkv" - "cosmossdk.io/orm/internal/testpb" - "cosmossdk.io/orm/internal/testutil" - "cosmossdk.io/orm/model/ormlist" - "cosmossdk.io/orm/model/ormtable" - "cosmossdk.io/orm/types/kv" - "cosmossdk.io/orm/types/ormerrors" -) - -func TestScenario(t *testing.T) { - table, err := ormtable.Build(ormtable.Options{ - MessageType: (&testpb.ExampleTable{}).ProtoReflect().Type(), - }) - assert.NilError(t, err) - - // first run tests with a split index-commitment store - runTestScenario(t, table, testkv.NewSplitMemBackend()) - - // now run tests with a shared index-commitment store - - // we're going to wrap this test in a debug store and save the decoded debug - // messages, these will be checked against a golden file at the end of the - // test. the golden file can be used for fine-grained debugging of kv-store - // layout - debugBuf := &strings.Builder{} - store := testkv.NewDebugBackend( - testkv.NewSharedMemBackend(), - &testkv.EntryCodecDebugger{ - EntryCodec: table, - Print: func(s string) { debugBuf.WriteString(s + "\n") }, - }, - ) - - runTestScenario(t, table, store) - - // we're going to store debug data in a golden file to make sure that - // logical decoding works successfully - // run `go test pkgname -test.update-golden` to update the golden file - // see https://pkg.go.dev/gotest.tools/v3/golden for docs - golden.Assert(t, debugBuf.String(), "test_scenario.golden") - - checkEncodeDecodeEntries(t, table, store.IndexStoreReader()) -} - -// isolated test for bug - https://github.com/cosmos/cosmos-sdk/issues/11431 -func TestPaginationLimitCountTotal(t *testing.T) { - table, err := ormtable.Build(ormtable.Options{ - MessageType: (&testpb.ExampleTable{}).ProtoReflect().Type(), - }) - assert.NilError(t, err) - backend := testkv.NewSplitMemBackend() - ctx := ormtable.WrapContextDefault(backend) - store, err := testpb.NewExampleTableTable(table) - assert.NilError(t, err) - - assert.NilError(t, store.Insert(ctx, &testpb.ExampleTable{U32: 4, I64: 2, Str: "co"})) - assert.NilError(t, store.Insert(ctx, &testpb.ExampleTable{U32: 5, I64: 2, Str: "sm"})) - assert.NilError(t, store.Insert(ctx, &testpb.ExampleTable{U32: 6, I64: 2, Str: "os"})) - - it, err := store.List(ctx, &testpb.ExampleTablePrimaryKey{}, ormlist.Paginate(&queryv1beta1.PageRequest{Limit: 3, CountTotal: true})) - assert.NilError(t, err) - assert.Check(t, it.Next()) - - it, err = store.List(ctx, &testpb.ExampleTablePrimaryKey{}, ormlist.Paginate(&queryv1beta1.PageRequest{Limit: 4, CountTotal: true})) - assert.NilError(t, err) - assert.Check(t, it.Next()) - - it, err = store.List(ctx, &testpb.ExampleTablePrimaryKey{}, ormlist.Paginate(&queryv1beta1.PageRequest{Limit: 1, CountTotal: true})) - assert.NilError(t, err) - for it.Next() { - } - pr := it.PageResponse() - assert.Check(t, pr != nil) - assert.Equal(t, uint64(3), pr.Total) -} - -// check that the ormkv.Entry's decode and encode to the same bytes -func checkEncodeDecodeEntries(t *testing.T, table ormtable.Table, store kv.ReadonlyStore) { - it, err := store.Iterator(nil, nil) - assert.NilError(t, err) - for it.Valid() { - key := it.Key() - value := it.Value() - entry, err := table.DecodeEntry(key, value) - assert.NilError(t, err) - k, v, err := table.EncodeEntry(entry) - assert.NilError(t, err) - assert.Assert(t, bytes.Equal(key, k), "%x %x %s", key, k, entry) - assert.Assert(t, bytes.Equal(value, v), "%x %x %s", value, v, entry) - it.Next() - } -} - -func runTestScenario(t *testing.T, table ormtable.Table, backend ormtable.Backend) { - ctx := ormtable.WrapContextDefault(backend) - store, err := testpb.NewExampleTableTable(table) - assert.NilError(t, err) - - // let's create 10 data items we'll use later and give them indexes - data := []*testpb.ExampleTable{ - {U32: 4, I64: -2, Str: "abc", U64: 7}, // 0 - {U32: 4, I64: -2, Str: "abd", U64: 7}, // 1 - {U32: 4, I64: -1, Str: "abc", U64: 8}, // 2 - {U32: 5, I64: -2, Str: "abd", U64: 8}, // 3 - {U32: 5, I64: -2, Str: "abe", U64: 9}, // 4 - {U32: 7, I64: -2, Str: "abe", U64: 10}, // 5 - {U32: 7, I64: -1, Str: "abe", U64: 11}, // 6 - {U32: 8, I64: -4, Str: "abc", U64: 11}, // 7 - {U32: 8, I64: 1, Str: "abc", U64: 12}, // 8 - {U32: 8, I64: 1, Str: "abd", U64: 10}, // 9 - } - - // let's make a function to match what's in our iterator with what we - // expect using indexes in the data array above - assertIteratorItems := func(it ormtable.Iterator, xs ...int) { - for _, i := range xs { - assert.Assert(t, it.Next()) - msg, err := it.GetMessage() - assert.NilError(t, err) - // t.Logf("data[%d] %v == %v", i, data[i], msg) - assert.DeepEqual(t, data[i], msg, protocmp.Transform()) - } - // make sure the iterator is done - assert.Assert(t, !it.Next()) - } - - // insert one record - err = store.Insert(ctx, data[0]) - assert.NilError(t, err) - // trivial prefix query has one record - it, err := store.List(ctx, testpb.ExampleTablePrimaryKey{}) - assert.NilError(t, err) - assertIteratorItems(it, 0) - - // insert one record - err = store.Insert(ctx, data[1]) - assert.NilError(t, err) - // trivial prefix query has two records - it, err = store.List(ctx, testpb.ExampleTablePrimaryKey{}) - assert.NilError(t, err) - assertIteratorItems(it, 0, 1) - - // insert the other records - assert.NilError(t, err) - for i := 2; i < len(data); i++ { - err = store.Insert(ctx, data[i]) - assert.NilError(t, err) - } - - // let's do a prefix query on the primary key - it, err = store.List(ctx, testpb.ExampleTablePrimaryKey{}.WithU32(8)) - assert.NilError(t, err) - assertIteratorItems(it, 7, 8, 9) - - // let's try a reverse prefix query - it, err = store.List(ctx, testpb.ExampleTablePrimaryKey{}.WithU32(4), ormlist.Reverse()) - assert.NilError(t, err) - defer it.Close() - assertIteratorItems(it, 2, 1, 0) - - // let's try a range query - it, err = store.ListRange(ctx, - testpb.ExampleTablePrimaryKey{}.WithU32I64(4, -1), - testpb.ExampleTablePrimaryKey{}.WithU32(7), - ) - assert.NilError(t, err) - defer it.Close() - assertIteratorItems(it, 2, 3, 4, 5, 6) - - // and another range query - it, err = store.ListRange(ctx, - testpb.ExampleTablePrimaryKey{}.WithU32I64(5, -3), - testpb.ExampleTablePrimaryKey{}.WithU32I64Str(8, 1, "abc"), - ) - assert.NilError(t, err) - defer it.Close() - assertIteratorItems(it, 3, 4, 5, 6, 7, 8) - - // now a reverse range query on a different index - strU32Index := table.GetIndex("str,u32") - assert.Assert(t, strU32Index != nil) - it, err = store.ListRange(ctx, - testpb.ExampleTableStrU32IndexKey{}.WithStr("abc"), - testpb.ExampleTableStrU32IndexKey{}.WithStr("abd"), - ormlist.Reverse(), - ) - assert.NilError(t, err) - assertIteratorItems(it, 9, 3, 1, 8, 7, 2, 0) - - // another prefix query forwards - - it, err = store.List(ctx, - testpb.ExampleTableStrU32IndexKey{}.WithStrU32("abe", 7), - ) - assert.NilError(t, err) - assertIteratorItems(it, 5, 6) - // and backwards - it, err = store.List(ctx, - testpb.ExampleTableStrU32IndexKey{}.WithStrU32("abc", 4), - ormlist.Reverse(), - ) - assert.NilError(t, err) - assertIteratorItems(it, 2, 0) - - // try filtering - it, err = store.List(ctx, testpb.ExampleTablePrimaryKey{}, ormlist.Filter(func(message proto.Message) bool { - ex := message.(*testpb.ExampleTable) - return ex.U64 != 10 - })) - assert.NilError(t, err) - assertIteratorItems(it, 0, 1, 2, 3, 4, 6, 7, 8) - - // try a cursor - it, err = store.List(ctx, testpb.ExampleTablePrimaryKey{}) - assert.NilError(t, err) - assert.Assert(t, it.Next()) - assert.Assert(t, it.Next()) - it, err = store.List(ctx, testpb.ExampleTablePrimaryKey{}, ormlist.Cursor(it.Cursor())) - assert.NilError(t, err) - assertIteratorItems(it, 2, 3, 4, 5, 6, 7, 8, 9) - - // try an unique index - found, err := store.HasByU64Str(ctx, 12, "abc") - assert.NilError(t, err) - assert.Assert(t, found) - a, err := store.GetByU64Str(ctx, 12, "abc") - assert.NilError(t, err) - assert.DeepEqual(t, data[8], a, protocmp.Transform()) - - // let's try paginating some stuff - it, err = store.List(ctx, testpb.ExampleTablePrimaryKey{}, ormlist.Paginate(&queryv1beta1.PageRequest{ - Limit: 4, - CountTotal: true, - })) - assert.NilError(t, err) - assertIteratorItems(it, 0, 1, 2, 3) - res := it.PageResponse() - assert.Assert(t, res != nil) - assert.Equal(t, uint64(10), res.Total) - assert.Assert(t, res.NextKey != nil) - - // let's use a default limit - it, err = store.List(ctx, testpb.ExampleTablePrimaryKey{}, - ormlist.DefaultLimit(4), - ormlist.Paginate(&queryv1beta1.PageRequest{ - CountTotal: true, - })) - assert.NilError(t, err) - assertIteratorItems(it, 0, 1, 2, 3) - res = it.PageResponse() - assert.Assert(t, res != nil) - assert.Equal(t, uint64(10), res.Total) - assert.Assert(t, res.NextKey != nil) - - // read another page - it, err = store.List(ctx, testpb.ExampleTablePrimaryKey{}, ormlist.Paginate(&queryv1beta1.PageRequest{ - Key: res.NextKey, - Limit: 4, - })) - assert.NilError(t, err) - assertIteratorItems(it, 4, 5, 6, 7) - res = it.PageResponse() - assert.Assert(t, res != nil) - assert.Assert(t, res.NextKey != nil) - - // and the last page - it, err = store.List(ctx, testpb.ExampleTablePrimaryKey{}, ormlist.Paginate(&queryv1beta1.PageRequest{ - Key: res.NextKey, - Limit: 4, - })) - assert.NilError(t, err) - assertIteratorItems(it, 8, 9) - res = it.PageResponse() - assert.Assert(t, res != nil) - assert.Assert(t, res.NextKey == nil) - - // let's go backwards - it, err = store.List(ctx, testpb.ExampleTablePrimaryKey{}, ormlist.Paginate(&queryv1beta1.PageRequest{ - Limit: 2, - CountTotal: true, - Reverse: true, - })) - assert.NilError(t, err) - assertIteratorItems(it, 9, 8) - res = it.PageResponse() - assert.Assert(t, res != nil) - assert.Assert(t, res.NextKey != nil) - assert.Equal(t, uint64(10), res.Total) - - // a bit more - it, err = store.List(ctx, testpb.ExampleTablePrimaryKey{}, ormlist.Paginate(&queryv1beta1.PageRequest{ - Key: res.NextKey, - Limit: 2, - Reverse: true, - })) - assert.NilError(t, err) - assertIteratorItems(it, 7, 6) - res = it.PageResponse() - assert.Assert(t, res != nil) - assert.Assert(t, res.NextKey != nil) - - // range query - it, err = store.ListRange(ctx, - testpb.ExampleTablePrimaryKey{}.WithU32I64Str(4, -1, "abc"), - testpb.ExampleTablePrimaryKey{}.WithU32I64Str(7, -2, "abe"), - ormlist.Paginate(&queryv1beta1.PageRequest{ - Limit: 10, - })) - assert.NilError(t, err) - assertIteratorItems(it, 2, 3, 4, 5) - res = it.PageResponse() - assert.Assert(t, res != nil) - assert.Assert(t, res.NextKey == nil) - - // let's try an offset - it, err = store.List(ctx, testpb.ExampleTablePrimaryKey{}, ormlist.Paginate(&queryv1beta1.PageRequest{ - Limit: 2, - CountTotal: true, - Offset: 3, - })) - assert.NilError(t, err) - assertIteratorItems(it, 3, 4) - res = it.PageResponse() - assert.Assert(t, res != nil) - assert.Assert(t, res.NextKey != nil) - assert.Equal(t, uint64(10), res.Total) - - // and reverse - it, err = store.List(ctx, testpb.ExampleTablePrimaryKey{}, ormlist.Paginate(&queryv1beta1.PageRequest{ - Limit: 3, - CountTotal: true, - Offset: 5, - Reverse: true, - })) - assert.NilError(t, err) - assertIteratorItems(it, 4, 3, 2) - res = it.PageResponse() - assert.Assert(t, res != nil) - assert.Assert(t, res.NextKey != nil) - assert.Equal(t, uint64(10), res.Total) - - // now an offset that's slightly too big - it, err = store.List(ctx, testpb.ExampleTablePrimaryKey{}, ormlist.Paginate(&queryv1beta1.PageRequest{ - Limit: 1, - CountTotal: true, - Offset: 10, - })) - assert.NilError(t, err) - assert.Assert(t, !it.Next()) - res = it.PageResponse() - assert.Assert(t, res != nil) - assert.Assert(t, res.NextKey == nil) - assert.Equal(t, uint64(10), res.Total) - - // now let's update some things - for i := 0; i < 5; i++ { - data[i].U64 *= 2 - data[i].Bz = []byte(data[i].Str) - err = store.Update(ctx, data[i]) - assert.NilError(t, err) - } - it, err = store.List(ctx, testpb.ExampleTablePrimaryKey{}) - assert.NilError(t, err) - // we should still get everything in the same order - assertIteratorItems(it, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9) - - // let's use SAVE_MODE_DEFAULT and add something - data = append(data, &testpb.ExampleTable{U32: 9}) - err = store.Save(ctx, data[10]) - assert.NilError(t, err) - a, err = store.Get(ctx, 9, 0, "") - assert.NilError(t, err) - assert.Assert(t, a != nil) - assert.DeepEqual(t, data[10], a, protocmp.Transform()) - // and update it - data[10].B = true - assert.NilError(t, table.Save(ctx, data[10])) - a, err = store.Get(ctx, 9, 0, "") - assert.NilError(t, err) - assert.Assert(t, a != nil) - assert.DeepEqual(t, data[10], a, protocmp.Transform()) - // and iterate - it, err = store.List(ctx, testpb.ExampleTablePrimaryKey{}) - assert.NilError(t, err) - assertIteratorItems(it, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10) - - // let's export and import JSON and use a read-only backend - buf := &bytes.Buffer{} - readBackend := ormtable.NewReadBackend(ormtable.ReadBackendOptions{ - CommitmentStoreReader: backend.CommitmentStoreReader(), - IndexStoreReader: backend.IndexStoreReader(), - }) - assert.NilError(t, table.ExportJSON(ormtable.WrapContextDefault(readBackend), buf)) - assert.NilError(t, table.ValidateJSON(bytes.NewReader(buf.Bytes()))) - store2 := ormtable.WrapContextDefault(testkv.NewSplitMemBackend()) - assert.NilError(t, table.ImportJSON(store2, bytes.NewReader(buf.Bytes()))) - assertTablesEqual(t, table, ctx, store2) - - // let's delete item 5 - err = store.DeleteBy(ctx, testpb.ExampleTableU32I64StrIndexKey{}.WithU32I64Str(7, -2, "abe")) - assert.NilError(t, err) - // it should be gone - found, err = store.Has(ctx, 7, -2, "abe") - assert.NilError(t, err) - assert.Assert(t, !found) - // and missing from the iterator - it, err = store.List(ctx, testpb.ExampleTablePrimaryKey{}) - assert.NilError(t, err) - assertIteratorItems(it, 0, 1, 2, 3, 4, 6, 7, 8, 9, 10) - - // let's do a batch delete - // first iterate over the items we'll delete to check that iterator - it, err = store.List(ctx, testpb.ExampleTableStrU32IndexKey{}.WithStr("abd")) - assert.NilError(t, err) - assertIteratorItems(it, 1, 3, 9) - // now delete them - assert.NilError(t, store.DeleteBy(ctx, testpb.ExampleTableStrU32IndexKey{}.WithStr("abd"))) - it, err = store.List(ctx, testpb.ExampleTablePrimaryKey{}) - assert.NilError(t, err) - assertIteratorItems(it, 0, 2, 4, 6, 7, 8, 10) - - // Let's do a range delete - assert.NilError(t, store.DeleteRange(ctx, - testpb.ExampleTableStrU32IndexKey{}.WithStrU32("abc", 8), - testpb.ExampleTableStrU32IndexKey{}.WithStrU32("abe", 5), - )) - it, err = store.List(ctx, testpb.ExampleTablePrimaryKey{}) - assert.NilError(t, err) - assertIteratorItems(it, 0, 2, 6, 10) - - // Let's delete something directly - assert.NilError(t, store.Delete(ctx, data[0])) - it, err = store.List(ctx, testpb.ExampleTablePrimaryKey{}) - assert.NilError(t, err) - assertIteratorItems(it, 2, 6, 10) -} - -func TestRandomTableData(t *testing.T) { - testTable(t, TableDataGen(testutil.GenA, 100).Example()) -} - -func testTable(t *testing.T, tableData *TableData) { - for _, index := range tableData.table.Indexes() { - indexModel := &IndexModel{ - TableData: tableData, - index: index.(TestIndex), - } - sort.Sort(indexModel) - if _, ok := index.(ormtable.UniqueIndex); ok { - testUniqueIndex(t, indexModel) - } - testIndex(t, indexModel) - } -} - -func testUniqueIndex(t *testing.T, model *IndexModel) { - index := model.index.(ormtable.UniqueIndex) - t.Logf("testing unique index %T %s", index, index.Fields()) - for i := 0; i < len(model.data); i++ { - x := model.data[i] - ks, _, err := index.(ormkv.IndexCodec).EncodeKeyFromMessage(x.ProtoReflect()) - assert.NilError(t, err) - - values := protoValuesToInterfaces(ks) - - found, err := index.Has(model.context, values...) - assert.NilError(t, err) - assert.Assert(t, found) - - msg := model.table.MessageType().New().Interface() - found, err = index.Get(model.context, msg, values...) - assert.NilError(t, err) - assert.Assert(t, found) - assert.DeepEqual(t, x, msg, protocmp.Transform()) - } -} - -func testIndex(t *testing.T, model *IndexModel) { - index := model.index - if index.IsFullyOrdered() { - t.Logf("testing index %T %s", index, index.Fields()) - - it, err := model.index.List(model.context, nil) - assert.NilError(t, err) - checkIteratorAgainstSlice(t, it, model.data) - - it, err = model.index.List(model.context, nil, ormlist.Reverse()) - assert.NilError(t, err) - checkIteratorAgainstSlice(t, it, reverseData(model.data)) - - rapid.Check(t, func(t *rapid.T) { - i := rapid.IntRange(0, len(model.data)-2).Draw(t, "i") - j := rapid.IntRange(i+1, len(model.data)-1).Draw(t, "j") - - start, _, err := model.index.(ormkv.IndexCodec).EncodeKeyFromMessage(model.data[i].ProtoReflect()) - assert.NilError(t, err) - end, _, err := model.index.(ormkv.IndexCodec).EncodeKeyFromMessage(model.data[j].ProtoReflect()) - assert.NilError(t, err) - - startVals := protoValuesToInterfaces(start) - endVals := protoValuesToInterfaces(end) - - it, err = model.index.ListRange(model.context, startVals, endVals) - assert.NilError(t, err) - checkIteratorAgainstSlice(t, it, model.data[i:j+1]) - - it, err = model.index.ListRange(model.context, startVals, endVals, ormlist.Reverse()) - assert.NilError(t, err) - checkIteratorAgainstSlice(t, it, reverseData(model.data[i:j+1])) - }) - } else { - t.Logf("testing unordered index %T %s", index, index.Fields()) - - // get all the data - it, err := model.index.List(model.context, nil) - assert.NilError(t, err) - var data2 []proto.Message - for it.Next() { - msg, err := it.GetMessage() - assert.NilError(t, err) - data2 = append(data2, msg) - } - assert.Equal(t, len(model.data), len(data2)) - - // sort it - model2 := &IndexModel{ - TableData: &TableData{ - table: model.table, - data: data2, - context: model.context, - }, - index: model.index, - } - sort.Sort(model2) - - // compare - for i := 0; i < len(data2); i++ { - assert.DeepEqual(t, model.data[i], data2[i], protocmp.Transform()) - } - } -} - -func reverseData(data []proto.Message) []proto.Message { - n := len(data) - reverse := make([]proto.Message, n) - for i := 0; i < n; i++ { - reverse[n-i-1] = data[i] - } - return reverse -} - -func checkIteratorAgainstSlice(t assert.TestingT, iterator ormtable.Iterator, data []proto.Message) { - i := 0 - for iterator.Next() { - if i >= len(data) { - for iterator.Next() { - i++ - } - t.Log(fmt.Sprintf("too many elements in iterator, len(data) = %d, i = %d", len(data), i)) - t.FailNow() - } - msg, err := iterator.GetMessage() - assert.NilError(t, err) - assert.DeepEqual(t, data[i], msg, protocmp.Transform()) - i++ - } -} - -func TableDataGen[T proto.Message](elemGen *rapid.Generator[T], n int) *rapid.Generator[*TableData] { - return rapid.Custom(func(t *rapid.T) *TableData { - prefix := rapid.SliceOfN(rapid.Byte(), 0, 5).Draw(t, "prefix") - message := elemGen.Draw(t, "message") - table, err := ormtable.Build(ormtable.Options{ - Prefix: prefix, - MessageType: message.ProtoReflect().Type(), - }) - if err != nil { - panic(err) - } - - data := make([]proto.Message, n) - store := ormtable.WrapContextDefault(testkv.NewSplitMemBackend()) - - for i := 0; i < n; { - message = elemGen.Draw(t, fmt.Sprintf("message[%d]", i)) - err := table.Insert(store, message) - if sdkerrors.IsOf(err, ormerrors.PrimaryKeyConstraintViolation, ormerrors.UniqueKeyViolation) { - continue - } else if err != nil { - panic(err) - } - data[i] = message - i++ - } - - return &TableData{ - data: data, - table: table, - context: store, - } - }) -} - -type TableData struct { - table ormtable.Table - data []proto.Message - context context.Context -} - -type IndexModel struct { - *TableData - index TestIndex -} - -// TestIndex exposes methods that all index implementations expose publicly -// but on private structs because they are intended only to be used for testing. -type TestIndex interface { - ormtable.Index - - // CompareKeys the two keys against the underlying IndexCodec, returning a - // negative value if key1 is less than key2, 0 if they are equal, and a - // positive value otherwise. - CompareKeys(key1, key2 []protoreflect.Value) int - - // IsFullyOrdered returns true if all of the fields in the index are - // considered "well-ordered" in terms of sorted iteration. - IsFullyOrdered() bool -} - -func (m *IndexModel) Len() int { - return len(m.data) -} - -func (m *IndexModel) Less(i, j int) bool { - is, _, err := m.index.(ormkv.IndexCodec).EncodeKeyFromMessage(m.data[i].ProtoReflect()) - if err != nil { - panic(err) - } - js, _, err := m.index.(ormkv.IndexCodec).EncodeKeyFromMessage(m.data[j].ProtoReflect()) - if err != nil { - panic(err) - } - return m.index.CompareKeys(is, js) < 0 -} - -func (m *IndexModel) Swap(i, j int) { - m.data[i], m.data[j] = m.data[j], m.data[i] -} - -var _ sort.Interface = &IndexModel{} - -func TestJSONExportImport(t *testing.T) { - table, err := ormtable.Build(ormtable.Options{ - MessageType: (&testpb.ExampleTable{}).ProtoReflect().Type(), - }) - assert.NilError(t, err) - store := ormtable.WrapContextDefault(testkv.NewSplitMemBackend()) - - for i := 0; i < 100; { - x := testutil.GenA.Example() - err = table.Insert(store, x) - if sdkerrors.IsOf(err, ormerrors.PrimaryKeyConstraintViolation, ormerrors.UniqueKeyViolation) { - continue - } else { - assert.NilError(t, err) - } - i++ - } - - buf := &bytes.Buffer{} - assert.NilError(t, table.ExportJSON(store, buf)) - - assert.NilError(t, table.ValidateJSON(bytes.NewReader(buf.Bytes()))) - - store2 := ormtable.WrapContextDefault(testkv.NewSplitMemBackend()) - assert.NilError(t, table.ImportJSON(store2, bytes.NewReader(buf.Bytes()))) - - assertTablesEqual(t, table, store, store2) -} - -func assertTablesEqual(t assert.TestingT, table ormtable.Table, ctx, ctx2 context.Context) { //nolint:revive // ignore long function name - it, err := table.List(ctx, nil) - assert.NilError(t, err) - it2, err := table.List(ctx2, nil) - assert.NilError(t, err) - - for { - have := it.Next() - have2 := it2.Next() - assert.Equal(t, have, have2) - if !have { - break - } - - msg1, err := it.GetMessage() - assert.NilError(t, err) - msg2, err := it.GetMessage() - assert.NilError(t, err) - - assert.DeepEqual(t, msg1, msg2, protocmp.Transform()) - } -} - -func protoValuesToInterfaces(ks []protoreflect.Value) []interface{} { - values := make([]interface{}, len(ks)) - for i := 0; i < len(ks); i++ { - values[i] = ks[i].Interface() - } - - return values -} - -func TestReadonly(t *testing.T) { - table, err := ormtable.Build(ormtable.Options{ - MessageType: (&testpb.ExampleTable{}).ProtoReflect().Type(), - }) - assert.NilError(t, err) - readBackend := ormtable.NewReadBackend(ormtable.ReadBackendOptions{ - CommitmentStoreReader: dbm.NewMemDB(), - IndexStoreReader: dbm.NewMemDB(), - }) - ctx := ormtable.WrapContextDefault(readBackend) - assert.ErrorIs(t, ormerrors.ReadOnly, table.Insert(ctx, &testpb.ExampleTable{})) -} - -func TestInsertReturningFieldName(t *testing.T) { - table, err := ormtable.Build(ormtable.Options{ - MessageType: (&testpb.ExampleAutoIncFieldName{}).ProtoReflect().Type(), - }) - assert.NilError(t, err) - backend := testkv.NewSplitMemBackend() - ctx := ormtable.WrapContextDefault(backend) - store, err := testpb.NewExampleAutoIncFieldNameTable(table) - assert.NilError(t, err) - foo, err := store.InsertReturningFoo(ctx, &testpb.ExampleAutoIncFieldName{ - Bar: 45, - }) - assert.NilError(t, err) - assert.Equal(t, uint64(1), foo) -} diff --git a/orm/model/ormtable/testdata/bad_auto_inc.json b/orm/model/ormtable/testdata/bad_auto_inc.json deleted file mode 100644 index 48521d55dd0c..000000000000 --- a/orm/model/ormtable/testdata/bad_auto_inc.json +++ /dev/null @@ -1,2 +0,0 @@ -[1, - {"id":"2","x":"foo","y":5}] diff --git a/orm/model/ormtable/testdata/bad_auto_inc2.json b/orm/model/ormtable/testdata/bad_auto_inc2.json deleted file mode 100644 index dbdbbbf91b0a..000000000000 --- a/orm/model/ormtable/testdata/bad_auto_inc2.json +++ /dev/null @@ -1 +0,0 @@ -[{"id":"1","x":"foo","y":5}] diff --git a/orm/model/ormtable/testdata/test_auto_inc.golden b/orm/model/ormtable/testdata/test_auto_inc.golden deleted file mode 100644 index 432c3a371c9b..000000000000 --- a/orm/model/ormtable/testdata/test_auto_inc.golden +++ /dev/null @@ -1,80 +0,0 @@ -GET 03000005 - PK testpb.ExampleAutoIncrementTable 5 -> {"id":5} -GET 03808002 - SEQ testpb.ExampleAutoIncrementTable 0 -GET 03000001 - PK testpb.ExampleAutoIncrementTable 1 -> {"id":1} -ORM BEFORE INSERT testpb.ExampleAutoIncrementTable {"id":1,"x":"foo","y":5} -HAS 0301666f6f - ERR:EOF -SET 03000001 1203666f6f1805 - PK testpb.ExampleAutoIncrementTable 1 -> {"id":1,"x":"foo","y":5} -SET 03808002 01 - SEQ testpb.ExampleAutoIncrementTable 1 -SET 0301666f6f 0001 - UNIQ testpb.ExampleAutoIncrementTable x : foo -> 1 -ORM AFTER INSERT testpb.ExampleAutoIncrementTable {"id":1,"x":"foo","y":5} -GET 03808002 01 - SEQ testpb.ExampleAutoIncrementTable 1 -GET 03808002 01 - SEQ testpb.ExampleAutoIncrementTable 1 -GET 03000002 - PK testpb.ExampleAutoIncrementTable 2 -> {"id":2} -ORM BEFORE INSERT testpb.ExampleAutoIncrementTable {"id":2,"x":"bar","y":10} -HAS 0301626172 - ERR:EOF -SET 03000002 1203626172180a - PK testpb.ExampleAutoIncrementTable 2 -> {"id":2,"x":"bar","y":10} -SET 03808002 02 - SEQ testpb.ExampleAutoIncrementTable 2 -SET 0301626172 0002 - UNIQ testpb.ExampleAutoIncrementTable x : bar -> 2 -ORM AFTER INSERT testpb.ExampleAutoIncrementTable {"id":2,"x":"bar","y":10} -GET 03808002 02 - SEQ testpb.ExampleAutoIncrementTable 2 -GET 03808002 02 - SEQ testpb.ExampleAutoIncrementTable 2 -ITERATOR 0300 -> 0301 - VALID true - KEY 03000001 1203666f6f1805 - PK testpb.ExampleAutoIncrementTable 1 -> {"id":1,"x":"foo","y":5} - NEXT - VALID true - KEY 03000002 1203626172180a - PK testpb.ExampleAutoIncrementTable 2 -> {"id":2,"x":"bar","y":10} - NEXT - VALID false -ITERATOR 0300 -> 0301 - VALID true - KEY 03000001 1203666f6f1805 - PK testpb.ExampleAutoIncrementTable 1 -> {"id":1,"x":"foo","y":5} - KEY 03000001 1203666f6f1805 - PK testpb.ExampleAutoIncrementTable 1 -> {"id":1,"x":"foo","y":5} - NEXT - VALID true - KEY 03000002 1203626172180a - PK testpb.ExampleAutoIncrementTable 2 -> {"id":2,"x":"bar","y":10} - KEY 03000002 1203626172180a - PK testpb.ExampleAutoIncrementTable 2 -> {"id":2,"x":"bar","y":10} - NEXT - VALID false -GET 03000001 1203666f6f1805 - PK testpb.ExampleAutoIncrementTable 1 -> {"id":1,"x":"foo","y":5} -ORM BEFORE DELETE testpb.ExampleAutoIncrementTable {"id":1,"x":"foo","y":5} -DEL 03000001 -DEL PK testpb.ExampleAutoIncrementTable 1 -> {"id":1} -DEL 0301666f6f -DEL ERR:EOF -ORM AFTER DELETE testpb.ExampleAutoIncrementTable {"id":1,"x":"foo","y":5} -GET 03000002 1203626172180a - PK testpb.ExampleAutoIncrementTable 2 -> {"id":2,"x":"bar","y":10} -ORM BEFORE DELETE testpb.ExampleAutoIncrementTable {"id":2,"x":"bar","y":10} -DEL 03000002 -DEL PK testpb.ExampleAutoIncrementTable 2 -> {"id":2} -DEL 0301626172 -DEL ERR:EOF -ORM AFTER DELETE testpb.ExampleAutoIncrementTable {"id":2,"x":"bar","y":10} -GET 03808002 02 - SEQ testpb.ExampleAutoIncrementTable 2 -ITERATOR 0300 -> 0301 - VALID false diff --git a/orm/model/ormtable/testdata/test_scenario.golden b/orm/model/ormtable/testdata/test_scenario.golden deleted file mode 100644 index d6dad07dbe0b..000000000000 --- a/orm/model/ormtable/testdata/test_scenario.golden +++ /dev/null @@ -1,1185 +0,0 @@ -GET 010000047ffffffffffffffe616263 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"str":"abc","i64":-2} -ORM BEFORE INSERT testpb.ExampleTable {"u32":4,"u64":7,"str":"abc","i64":-2} -HAS 01010007616263 - ERR:EOF -SET 010000047ffffffffffffffe616263 1007 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":7,"str":"abc","i64":-2} -SET 01010007616263 00047ffffffffffffffe - UNIQ testpb.ExampleTable u64/str : 7/abc -> 4/-2/abc -SET 01026162630000047ffffffffffffffe - IDX testpb.ExampleTable str/u32/i64 : abc/4/-2 -> 4/-2/abc -SET 0103006162630000047ffffffffffffffe - IDX testpb.ExampleTable bz/str/u32/i64 : []/abc/4/-2 -> 4/-2/abc -ORM AFTER INSERT testpb.ExampleTable {"u32":4,"u64":7,"str":"abc","i64":-2} -ITERATOR 0100 -> 0101 - VALID true - KEY 010000047ffffffffffffffe616263 1007 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":7,"str":"abc","i64":-2} - NEXT - VALID false -GET 010000047ffffffffffffffe616264 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"str":"abd","i64":-2} -ORM BEFORE INSERT testpb.ExampleTable {"u32":4,"u64":7,"str":"abd","i64":-2} -HAS 01010007616264 - ERR:EOF -SET 010000047ffffffffffffffe616264 1007 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"u64":7,"str":"abd","i64":-2} -SET 01010007616264 00047ffffffffffffffe - UNIQ testpb.ExampleTable u64/str : 7/abd -> 4/-2/abd -SET 01026162640000047ffffffffffffffe - IDX testpb.ExampleTable str/u32/i64 : abd/4/-2 -> 4/-2/abd -SET 0103006162640000047ffffffffffffffe - IDX testpb.ExampleTable bz/str/u32/i64 : []/abd/4/-2 -> 4/-2/abd -ORM AFTER INSERT testpb.ExampleTable {"u32":4,"u64":7,"str":"abd","i64":-2} -ITERATOR 0100 -> 0101 - VALID true - KEY 010000047ffffffffffffffe616263 1007 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":7,"str":"abc","i64":-2} - NEXT - VALID true - KEY 010000047ffffffffffffffe616264 1007 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"u64":7,"str":"abd","i64":-2} - NEXT - VALID false -GET 010000047fffffffffffffff616263 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"str":"abc","i64":-1} -ORM BEFORE INSERT testpb.ExampleTable {"u32":4,"u64":8,"str":"abc","i64":-1} -HAS 01010008616263 - ERR:EOF -SET 010000047fffffffffffffff616263 1008 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":8,"str":"abc","i64":-1} -SET 01010008616263 00047fffffffffffffff - UNIQ testpb.ExampleTable u64/str : 8/abc -> 4/-1/abc -SET 01026162630000047fffffffffffffff - IDX testpb.ExampleTable str/u32/i64 : abc/4/-1 -> 4/-1/abc -SET 0103006162630000047fffffffffffffff - IDX testpb.ExampleTable bz/str/u32/i64 : []/abc/4/-1 -> 4/-1/abc -ORM AFTER INSERT testpb.ExampleTable {"u32":4,"u64":8,"str":"abc","i64":-1} -GET 010000057ffffffffffffffe616264 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"str":"abd","i64":-2} -ORM BEFORE INSERT testpb.ExampleTable {"u32":5,"u64":8,"str":"abd","i64":-2} -HAS 01010008616264 - ERR:EOF -SET 010000057ffffffffffffffe616264 1008 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":8,"str":"abd","i64":-2} -SET 01010008616264 00057ffffffffffffffe - UNIQ testpb.ExampleTable u64/str : 8/abd -> 5/-2/abd -SET 01026162640000057ffffffffffffffe - IDX testpb.ExampleTable str/u32/i64 : abd/5/-2 -> 5/-2/abd -SET 0103006162640000057ffffffffffffffe - IDX testpb.ExampleTable bz/str/u32/i64 : []/abd/5/-2 -> 5/-2/abd -ORM AFTER INSERT testpb.ExampleTable {"u32":5,"u64":8,"str":"abd","i64":-2} -GET 010000057ffffffffffffffe616265 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"str":"abe","i64":-2} -ORM BEFORE INSERT testpb.ExampleTable {"u32":5,"u64":9,"str":"abe","i64":-2} -HAS 01010009616265 - ERR:EOF -SET 010000057ffffffffffffffe616265 1009 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":9,"str":"abe","i64":-2} -SET 01010009616265 00057ffffffffffffffe - UNIQ testpb.ExampleTable u64/str : 9/abe -> 5/-2/abe -SET 01026162650000057ffffffffffffffe - IDX testpb.ExampleTable str/u32/i64 : abe/5/-2 -> 5/-2/abe -SET 0103006162650000057ffffffffffffffe - IDX testpb.ExampleTable bz/str/u32/i64 : []/abe/5/-2 -> 5/-2/abe -ORM AFTER INSERT testpb.ExampleTable {"u32":5,"u64":9,"str":"abe","i64":-2} -GET 010000077ffffffffffffffe616265 - PK testpb.ExampleTable 7/-2/abe -> {"u32":7,"str":"abe","i64":-2} -ORM BEFORE INSERT testpb.ExampleTable {"u32":7,"u64":10,"str":"abe","i64":-2} -HAS 0101000a616265 - ERR:EOF -SET 010000077ffffffffffffffe616265 100a - PK testpb.ExampleTable 7/-2/abe -> {"u32":7,"u64":10,"str":"abe","i64":-2} -SET 0101000a616265 00077ffffffffffffffe - UNIQ testpb.ExampleTable u64/str : 10/abe -> 7/-2/abe -SET 01026162650000077ffffffffffffffe - IDX testpb.ExampleTable str/u32/i64 : abe/7/-2 -> 7/-2/abe -SET 0103006162650000077ffffffffffffffe - IDX testpb.ExampleTable bz/str/u32/i64 : []/abe/7/-2 -> 7/-2/abe -ORM AFTER INSERT testpb.ExampleTable {"u32":7,"u64":10,"str":"abe","i64":-2} -GET 010000077fffffffffffffff616265 - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"str":"abe","i64":-1} -ORM BEFORE INSERT testpb.ExampleTable {"u32":7,"u64":11,"str":"abe","i64":-1} -HAS 0101000b616265 - ERR:EOF -SET 010000077fffffffffffffff616265 100b - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"u64":11,"str":"abe","i64":-1} -SET 0101000b616265 00077fffffffffffffff - UNIQ testpb.ExampleTable u64/str : 11/abe -> 7/-1/abe -SET 01026162650000077fffffffffffffff - IDX testpb.ExampleTable str/u32/i64 : abe/7/-1 -> 7/-1/abe -SET 0103006162650000077fffffffffffffff - IDX testpb.ExampleTable bz/str/u32/i64 : []/abe/7/-1 -> 7/-1/abe -ORM AFTER INSERT testpb.ExampleTable {"u32":7,"u64":11,"str":"abe","i64":-1} -GET 010000087ffffffffffffffc616263 - PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"str":"abc","i64":-4} -ORM BEFORE INSERT testpb.ExampleTable {"u32":8,"u64":11,"str":"abc","i64":-4} -HAS 0101000b616263 - ERR:EOF -SET 010000087ffffffffffffffc616263 100b - PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"u64":11,"str":"abc","i64":-4} -SET 0101000b616263 00087ffffffffffffffc - UNIQ testpb.ExampleTable u64/str : 11/abc -> 8/-4/abc -SET 01026162630000087ffffffffffffffc - IDX testpb.ExampleTable str/u32/i64 : abc/8/-4 -> 8/-4/abc -SET 0103006162630000087ffffffffffffffc - IDX testpb.ExampleTable bz/str/u32/i64 : []/abc/8/-4 -> 8/-4/abc -ORM AFTER INSERT testpb.ExampleTable {"u32":8,"u64":11,"str":"abc","i64":-4} -GET 010000088000000000000001616263 - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"str":"abc","i64":1} -ORM BEFORE INSERT testpb.ExampleTable {"u32":8,"u64":12,"str":"abc","i64":1} -HAS 0101000c616263 - ERR:EOF -SET 010000088000000000000001616263 100c - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"u64":12,"str":"abc","i64":1} -SET 0101000c616263 00088000000000000001 - UNIQ testpb.ExampleTable u64/str : 12/abc -> 8/1/abc -SET 01026162630000088000000000000001 - IDX testpb.ExampleTable str/u32/i64 : abc/8/1 -> 8/1/abc -SET 0103006162630000088000000000000001 - IDX testpb.ExampleTable bz/str/u32/i64 : []/abc/8/1 -> 8/1/abc -ORM AFTER INSERT testpb.ExampleTable {"u32":8,"u64":12,"str":"abc","i64":1} -GET 010000088000000000000001616264 - PK testpb.ExampleTable 8/1/abd -> {"u32":8,"str":"abd","i64":1} -ORM BEFORE INSERT testpb.ExampleTable {"u32":8,"u64":10,"str":"abd","i64":1} -HAS 0101000a616264 - ERR:EOF -SET 010000088000000000000001616264 100a - PK testpb.ExampleTable 8/1/abd -> {"u32":8,"u64":10,"str":"abd","i64":1} -SET 0101000a616264 00088000000000000001 - UNIQ testpb.ExampleTable u64/str : 10/abd -> 8/1/abd -SET 01026162640000088000000000000001 - IDX testpb.ExampleTable str/u32/i64 : abd/8/1 -> 8/1/abd -SET 0103006162640000088000000000000001 - IDX testpb.ExampleTable bz/str/u32/i64 : []/abd/8/1 -> 8/1/abd -ORM AFTER INSERT testpb.ExampleTable {"u32":8,"u64":10,"str":"abd","i64":1} -ITERATOR 01000008 -> 01000009 - VALID true - KEY 010000087ffffffffffffffc616263 100b - PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"u64":11,"str":"abc","i64":-4} - NEXT - VALID true - KEY 010000088000000000000001616263 100c - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"u64":12,"str":"abc","i64":1} - NEXT - VALID true - KEY 010000088000000000000001616264 100a - PK testpb.ExampleTable 8/1/abd -> {"u32":8,"u64":10,"str":"abd","i64":1} - NEXT - VALID false -ITERATOR 01000004 <- 01000005 - VALID true - KEY 010000047fffffffffffffff616263 1008 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":8,"str":"abc","i64":-1} - NEXT - VALID true - KEY 010000047ffffffffffffffe616264 1007 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"u64":7,"str":"abd","i64":-2} - NEXT - VALID true - KEY 010000047ffffffffffffffe616263 1007 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":7,"str":"abc","i64":-2} - NEXT - VALID false -ITERATOR 010000047fffffffffffffff -> 01000008 - VALID true - KEY 010000047fffffffffffffff616263 1008 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":8,"str":"abc","i64":-1} - NEXT - VALID true - KEY 010000057ffffffffffffffe616264 1008 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":8,"str":"abd","i64":-2} - NEXT - VALID true - KEY 010000057ffffffffffffffe616265 1009 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":9,"str":"abe","i64":-2} - NEXT - VALID true - KEY 010000077ffffffffffffffe616265 100a - PK testpb.ExampleTable 7/-2/abe -> {"u32":7,"u64":10,"str":"abe","i64":-2} - NEXT - VALID true - KEY 010000077fffffffffffffff616265 100b - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"u64":11,"str":"abe","i64":-1} - NEXT - VALID false -ITERATOR 010000057ffffffffffffffd -> 01000008800000000000000161626300 - VALID true - KEY 010000057ffffffffffffffe616264 1008 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":8,"str":"abd","i64":-2} - NEXT - VALID true - KEY 010000057ffffffffffffffe616265 1009 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":9,"str":"abe","i64":-2} - NEXT - VALID true - KEY 010000077ffffffffffffffe616265 100a - PK testpb.ExampleTable 7/-2/abe -> {"u32":7,"u64":10,"str":"abe","i64":-2} - NEXT - VALID true - KEY 010000077fffffffffffffff616265 100b - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"u64":11,"str":"abe","i64":-1} - NEXT - VALID true - KEY 010000087ffffffffffffffc616263 100b - PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"u64":11,"str":"abc","i64":-4} - NEXT - VALID true - KEY 010000088000000000000001616263 100c - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"u64":12,"str":"abc","i64":1} - NEXT - VALID false -ITERATOR 010261626300 <- 010261626401 - VALID true - KEY 01026162640000088000000000000001 - IDX testpb.ExampleTable str/u32/i64 : abd/8/1 -> 8/1/abd -GET 010000088000000000000001616264 100a - PK testpb.ExampleTable 8/1/abd -> {"u32":8,"u64":10,"str":"abd","i64":1} - NEXT - VALID true - KEY 01026162640000057ffffffffffffffe - IDX testpb.ExampleTable str/u32/i64 : abd/5/-2 -> 5/-2/abd -GET 010000057ffffffffffffffe616264 1008 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":8,"str":"abd","i64":-2} - NEXT - VALID true - KEY 01026162640000047ffffffffffffffe - IDX testpb.ExampleTable str/u32/i64 : abd/4/-2 -> 4/-2/abd -GET 010000047ffffffffffffffe616264 1007 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"u64":7,"str":"abd","i64":-2} - NEXT - VALID true - KEY 01026162630000088000000000000001 - IDX testpb.ExampleTable str/u32/i64 : abc/8/1 -> 8/1/abc -GET 010000088000000000000001616263 100c - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"u64":12,"str":"abc","i64":1} - NEXT - VALID true - KEY 01026162630000087ffffffffffffffc - IDX testpb.ExampleTable str/u32/i64 : abc/8/-4 -> 8/-4/abc -GET 010000087ffffffffffffffc616263 100b - PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"u64":11,"str":"abc","i64":-4} - NEXT - VALID true - KEY 01026162630000047fffffffffffffff - IDX testpb.ExampleTable str/u32/i64 : abc/4/-1 -> 4/-1/abc -GET 010000047fffffffffffffff616263 1008 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":8,"str":"abc","i64":-1} - NEXT - VALID true - KEY 01026162630000047ffffffffffffffe - IDX testpb.ExampleTable str/u32/i64 : abc/4/-2 -> 4/-2/abc -GET 010000047ffffffffffffffe616263 1007 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":7,"str":"abc","i64":-2} - NEXT - VALID false -ITERATOR 0102616265000007 -> 0102616265000008 - VALID true - KEY 01026162650000077ffffffffffffffe - IDX testpb.ExampleTable str/u32/i64 : abe/7/-2 -> 7/-2/abe -GET 010000077ffffffffffffffe616265 100a - PK testpb.ExampleTable 7/-2/abe -> {"u32":7,"u64":10,"str":"abe","i64":-2} - NEXT - VALID true - KEY 01026162650000077fffffffffffffff - IDX testpb.ExampleTable str/u32/i64 : abe/7/-1 -> 7/-1/abe -GET 010000077fffffffffffffff616265 100b - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"u64":11,"str":"abe","i64":-1} - NEXT - VALID false -ITERATOR 0102616263000004 <- 0102616263000005 - VALID true - KEY 01026162630000047fffffffffffffff - IDX testpb.ExampleTable str/u32/i64 : abc/4/-1 -> 4/-1/abc -GET 010000047fffffffffffffff616263 1008 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":8,"str":"abc","i64":-1} - NEXT - VALID true - KEY 01026162630000047ffffffffffffffe - IDX testpb.ExampleTable str/u32/i64 : abc/4/-2 -> 4/-2/abc -GET 010000047ffffffffffffffe616263 1007 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":7,"str":"abc","i64":-2} - NEXT - VALID false -ITERATOR 0100 -> 0101 - VALID true - KEY 010000047ffffffffffffffe616263 1007 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":7,"str":"abc","i64":-2} - NEXT - VALID true - KEY 010000047ffffffffffffffe616264 1007 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"u64":7,"str":"abd","i64":-2} - NEXT - VALID true - KEY 010000047fffffffffffffff616263 1008 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":8,"str":"abc","i64":-1} - NEXT - VALID true - KEY 010000057ffffffffffffffe616264 1008 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":8,"str":"abd","i64":-2} - NEXT - VALID true - KEY 010000057ffffffffffffffe616265 1009 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":9,"str":"abe","i64":-2} - NEXT - VALID true - KEY 010000077ffffffffffffffe616265 100a - PK testpb.ExampleTable 7/-2/abe -> {"u32":7,"u64":10,"str":"abe","i64":-2} - NEXT - VALID true - KEY 010000077fffffffffffffff616265 100b - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"u64":11,"str":"abe","i64":-1} - NEXT - VALID true - KEY 010000087ffffffffffffffc616263 100b - PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"u64":11,"str":"abc","i64":-4} - NEXT - VALID true - KEY 010000088000000000000001616263 100c - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"u64":12,"str":"abc","i64":1} - NEXT - VALID true - KEY 010000088000000000000001616264 100a - PK testpb.ExampleTable 8/1/abd -> {"u32":8,"u64":10,"str":"abd","i64":1} - NEXT - VALID false -ITERATOR 0100 -> 0101 - VALID true - NEXT - VALID true - KEY 010000047ffffffffffffffe616264 1007 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"u64":7,"str":"abd","i64":-2} -ITERATOR 010000047ffffffffffffffe61626400 -> 0101 - VALID true - KEY 010000047fffffffffffffff616263 1008 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":8,"str":"abc","i64":-1} - NEXT - VALID true - KEY 010000057ffffffffffffffe616264 1008 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":8,"str":"abd","i64":-2} - NEXT - VALID true - KEY 010000057ffffffffffffffe616265 1009 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":9,"str":"abe","i64":-2} - NEXT - VALID true - KEY 010000077ffffffffffffffe616265 100a - PK testpb.ExampleTable 7/-2/abe -> {"u32":7,"u64":10,"str":"abe","i64":-2} - NEXT - VALID true - KEY 010000077fffffffffffffff616265 100b - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"u64":11,"str":"abe","i64":-1} - NEXT - VALID true - KEY 010000087ffffffffffffffc616263 100b - PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"u64":11,"str":"abc","i64":-4} - NEXT - VALID true - KEY 010000088000000000000001616263 100c - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"u64":12,"str":"abc","i64":1} - NEXT - VALID true - KEY 010000088000000000000001616264 100a - PK testpb.ExampleTable 8/1/abd -> {"u32":8,"u64":10,"str":"abd","i64":1} - NEXT - VALID false -HAS 0101000c616263 - ERR:EOF -GET 0101000c616263 00088000000000000001 - UNIQ testpb.ExampleTable u64/str : 12/abc -> 8/1/abc -GET 010000088000000000000001616263 100c - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"u64":12,"str":"abc","i64":1} -ITERATOR 0100 -> 0101 - VALID true - KEY 010000047ffffffffffffffe616263 1007 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":7,"str":"abc","i64":-2} - NEXT - VALID true - KEY 010000047ffffffffffffffe616264 1007 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"u64":7,"str":"abd","i64":-2} - NEXT - VALID true - KEY 010000047fffffffffffffff616263 1008 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":8,"str":"abc","i64":-1} - NEXT - VALID true - KEY 010000057ffffffffffffffe616264 1008 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":8,"str":"abd","i64":-2} - KEY 010000057ffffffffffffffe616264 1008 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":8,"str":"abd","i64":-2} - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID false -ITERATOR 0100 -> 0101 - VALID true - KEY 010000047ffffffffffffffe616263 1007 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":7,"str":"abc","i64":-2} - NEXT - VALID true - KEY 010000047ffffffffffffffe616264 1007 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"u64":7,"str":"abd","i64":-2} - NEXT - VALID true - KEY 010000047fffffffffffffff616263 1008 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":8,"str":"abc","i64":-1} - NEXT - VALID true - KEY 010000057ffffffffffffffe616264 1008 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":8,"str":"abd","i64":-2} - KEY 010000057ffffffffffffffe616264 1008 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":8,"str":"abd","i64":-2} - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID false -ITERATOR 010000057ffffffffffffffe61626400 -> 0101 - VALID true - KEY 010000057ffffffffffffffe616265 1009 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":9,"str":"abe","i64":-2} - NEXT - VALID true - KEY 010000077ffffffffffffffe616265 100a - PK testpb.ExampleTable 7/-2/abe -> {"u32":7,"u64":10,"str":"abe","i64":-2} - NEXT - VALID true - KEY 010000077fffffffffffffff616265 100b - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"u64":11,"str":"abe","i64":-1} - NEXT - VALID true - KEY 010000087ffffffffffffffc616263 100b - PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"u64":11,"str":"abc","i64":-4} - KEY 010000087ffffffffffffffc616263 100b - PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"u64":11,"str":"abc","i64":-4} - NEXT - VALID true -ITERATOR 010000087ffffffffffffffc61626300 -> 0101 - VALID true - KEY 010000088000000000000001616263 100c - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"u64":12,"str":"abc","i64":1} - NEXT - VALID true - KEY 010000088000000000000001616264 100a - PK testpb.ExampleTable 8/1/abd -> {"u32":8,"u64":10,"str":"abd","i64":1} - NEXT - VALID false -ITERATOR 0100 <- 0101 - VALID true - KEY 010000088000000000000001616264 100a - PK testpb.ExampleTable 8/1/abd -> {"u32":8,"u64":10,"str":"abd","i64":1} - NEXT - VALID true - KEY 010000088000000000000001616263 100c - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"u64":12,"str":"abc","i64":1} - KEY 010000088000000000000001616263 100c - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"u64":12,"str":"abc","i64":1} - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID false -ITERATOR 0100 <- 010000088000000000000001616263 - VALID true - KEY 010000087ffffffffffffffc616263 100b - PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"u64":11,"str":"abc","i64":-4} - NEXT - VALID true - KEY 010000077fffffffffffffff616265 100b - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"u64":11,"str":"abe","i64":-1} - KEY 010000077fffffffffffffff616265 100b - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"u64":11,"str":"abe","i64":-1} - NEXT - VALID true -ITERATOR 010000047fffffffffffffff616263 -> 010000077ffffffffffffffe61626500 - VALID true - KEY 010000047fffffffffffffff616263 1008 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":8,"str":"abc","i64":-1} - NEXT - VALID true - KEY 010000057ffffffffffffffe616264 1008 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":8,"str":"abd","i64":-2} - NEXT - VALID true - KEY 010000057ffffffffffffffe616265 1009 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":9,"str":"abe","i64":-2} - NEXT - VALID true - KEY 010000077ffffffffffffffe616265 100a - PK testpb.ExampleTable 7/-2/abe -> {"u32":7,"u64":10,"str":"abe","i64":-2} - NEXT - VALID false -ITERATOR 0100 -> 0101 - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - KEY 010000057ffffffffffffffe616264 1008 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":8,"str":"abd","i64":-2} - NEXT - VALID true - KEY 010000057ffffffffffffffe616265 1009 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":9,"str":"abe","i64":-2} - KEY 010000057ffffffffffffffe616265 1009 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":9,"str":"abe","i64":-2} - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID false -ITERATOR 0100 <- 0101 - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - KEY 010000057ffffffffffffffe616265 1009 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":9,"str":"abe","i64":-2} - NEXT - VALID true - KEY 010000057ffffffffffffffe616264 1008 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":8,"str":"abd","i64":-2} - NEXT - VALID true - KEY 010000047fffffffffffffff616263 1008 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":8,"str":"abc","i64":-1} - KEY 010000047fffffffffffffff616263 1008 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":8,"str":"abc","i64":-1} - NEXT - VALID true - NEXT - VALID true - NEXT - VALID false -ITERATOR 0100 -> 0101 - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID false -GET 010000047ffffffffffffffe616263 1007 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":7,"str":"abc","i64":-2} -ORM BEFORE UPDATE testpb.ExampleTable {"u32":4,"u64":7,"str":"abc","i64":-2} -> {"u32":4,"u64":14,"str":"abc","bz":"abc","i64":-2} -HAS 0101000e616263 - ERR:EOF -SET 010000047ffffffffffffffe616263 100e2203616263 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":14,"str":"abc","bz":"abc","i64":-2} -DEL 01010007616263 -DEL ERR:EOF -SET 0101000e616263 00047ffffffffffffffe - UNIQ testpb.ExampleTable u64/str : 14/abc -> 4/-2/abc -DEL 0103006162630000047ffffffffffffffe -DEL IDX testpb.ExampleTable bz/str/u32/i64 : []/abc/4/-2 -> 4/-2/abc -SET 0103036162636162630000047ffffffffffffffe - IDX testpb.ExampleTable bz/str/u32/i64 : [97 98 99]/abc/4/-2 -> 4/-2/abc -ORM AFTER UPDATE testpb.ExampleTable {"u32":4,"u64":7,"str":"abc","i64":-2} -> {"u32":4,"u64":14,"str":"abc","bz":"abc","i64":-2} -GET 010000047ffffffffffffffe616264 1007 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"u64":7,"str":"abd","i64":-2} -ORM BEFORE UPDATE testpb.ExampleTable {"u32":4,"u64":7,"str":"abd","i64":-2} -> {"u32":4,"u64":14,"str":"abd","bz":"abd","i64":-2} -HAS 0101000e616264 - ERR:EOF -SET 010000047ffffffffffffffe616264 100e2203616264 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"u64":14,"str":"abd","bz":"abd","i64":-2} -DEL 01010007616264 -DEL ERR:EOF -SET 0101000e616264 00047ffffffffffffffe - UNIQ testpb.ExampleTable u64/str : 14/abd -> 4/-2/abd -DEL 0103006162640000047ffffffffffffffe -DEL IDX testpb.ExampleTable bz/str/u32/i64 : []/abd/4/-2 -> 4/-2/abd -SET 0103036162646162640000047ffffffffffffffe - IDX testpb.ExampleTable bz/str/u32/i64 : [97 98 100]/abd/4/-2 -> 4/-2/abd -ORM AFTER UPDATE testpb.ExampleTable {"u32":4,"u64":7,"str":"abd","i64":-2} -> {"u32":4,"u64":14,"str":"abd","bz":"abd","i64":-2} -GET 010000047fffffffffffffff616263 1008 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":8,"str":"abc","i64":-1} -ORM BEFORE UPDATE testpb.ExampleTable {"u32":4,"u64":8,"str":"abc","i64":-1} -> {"u32":4,"u64":16,"str":"abc","bz":"abc","i64":-1} -HAS 01010010616263 - ERR:EOF -SET 010000047fffffffffffffff616263 10102203616263 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":16,"str":"abc","bz":"abc","i64":-1} -DEL 01010008616263 -DEL ERR:EOF -SET 01010010616263 00047fffffffffffffff - UNIQ testpb.ExampleTable u64/str : 16/abc -> 4/-1/abc -DEL 0103006162630000047fffffffffffffff -DEL IDX testpb.ExampleTable bz/str/u32/i64 : []/abc/4/-1 -> 4/-1/abc -SET 0103036162636162630000047fffffffffffffff - IDX testpb.ExampleTable bz/str/u32/i64 : [97 98 99]/abc/4/-1 -> 4/-1/abc -ORM AFTER UPDATE testpb.ExampleTable {"u32":4,"u64":8,"str":"abc","i64":-1} -> {"u32":4,"u64":16,"str":"abc","bz":"abc","i64":-1} -GET 010000057ffffffffffffffe616264 1008 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":8,"str":"abd","i64":-2} -ORM BEFORE UPDATE testpb.ExampleTable {"u32":5,"u64":8,"str":"abd","i64":-2} -> {"u32":5,"u64":16,"str":"abd","bz":"abd","i64":-2} -HAS 01010010616264 - ERR:EOF -SET 010000057ffffffffffffffe616264 10102203616264 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":16,"str":"abd","bz":"abd","i64":-2} -DEL 01010008616264 -DEL ERR:EOF -SET 01010010616264 00057ffffffffffffffe - UNIQ testpb.ExampleTable u64/str : 16/abd -> 5/-2/abd -DEL 0103006162640000057ffffffffffffffe -DEL IDX testpb.ExampleTable bz/str/u32/i64 : []/abd/5/-2 -> 5/-2/abd -SET 0103036162646162640000057ffffffffffffffe - IDX testpb.ExampleTable bz/str/u32/i64 : [97 98 100]/abd/5/-2 -> 5/-2/abd -ORM AFTER UPDATE testpb.ExampleTable {"u32":5,"u64":8,"str":"abd","i64":-2} -> {"u32":5,"u64":16,"str":"abd","bz":"abd","i64":-2} -GET 010000057ffffffffffffffe616265 1009 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":9,"str":"abe","i64":-2} -ORM BEFORE UPDATE testpb.ExampleTable {"u32":5,"u64":9,"str":"abe","i64":-2} -> {"u32":5,"u64":18,"str":"abe","bz":"abe","i64":-2} -HAS 01010012616265 - ERR:EOF -SET 010000057ffffffffffffffe616265 10122203616265 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":18,"str":"abe","bz":"abe","i64":-2} -DEL 01010009616265 -DEL ERR:EOF -SET 01010012616265 00057ffffffffffffffe - UNIQ testpb.ExampleTable u64/str : 18/abe -> 5/-2/abe -DEL 0103006162650000057ffffffffffffffe -DEL IDX testpb.ExampleTable bz/str/u32/i64 : []/abe/5/-2 -> 5/-2/abe -SET 0103036162656162650000057ffffffffffffffe - IDX testpb.ExampleTable bz/str/u32/i64 : [97 98 101]/abe/5/-2 -> 5/-2/abe -ORM AFTER UPDATE testpb.ExampleTable {"u32":5,"u64":9,"str":"abe","i64":-2} -> {"u32":5,"u64":18,"str":"abe","bz":"abe","i64":-2} -ITERATOR 0100 -> 0101 - VALID true - KEY 010000047ffffffffffffffe616263 100e2203616263 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":14,"str":"abc","bz":"abc","i64":-2} - NEXT - VALID true - KEY 010000047ffffffffffffffe616264 100e2203616264 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"u64":14,"str":"abd","bz":"abd","i64":-2} - NEXT - VALID true - KEY 010000047fffffffffffffff616263 10102203616263 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":16,"str":"abc","bz":"abc","i64":-1} - NEXT - VALID true - KEY 010000057ffffffffffffffe616264 10102203616264 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":16,"str":"abd","bz":"abd","i64":-2} - NEXT - VALID true - KEY 010000057ffffffffffffffe616265 10122203616265 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":18,"str":"abe","bz":"abe","i64":-2} - NEXT - VALID true - KEY 010000077ffffffffffffffe616265 100a - PK testpb.ExampleTable 7/-2/abe -> {"u32":7,"u64":10,"str":"abe","i64":-2} - NEXT - VALID true - KEY 010000077fffffffffffffff616265 100b - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"u64":11,"str":"abe","i64":-1} - NEXT - VALID true - KEY 010000087ffffffffffffffc616263 100b - PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"u64":11,"str":"abc","i64":-4} - NEXT - VALID true - KEY 010000088000000000000001616263 100c - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"u64":12,"str":"abc","i64":1} - NEXT - VALID true - KEY 010000088000000000000001616264 100a - PK testpb.ExampleTable 8/1/abd -> {"u32":8,"u64":10,"str":"abd","i64":1} - NEXT - VALID false -GET 010000098000000000000000 - PK testpb.ExampleTable 9/0/ -> {"u32":9} -ORM BEFORE INSERT testpb.ExampleTable {"u32":9} -HAS 01010000 - ERR:EOF -SET 010000098000000000000000 - PK testpb.ExampleTable 9/0/ -> {"u32":9} -SET 01010000 00098000000000000000 - UNIQ testpb.ExampleTable u64/str : 0/ -> 9/0/ -SET 01020000098000000000000000 - IDX testpb.ExampleTable str/u32/i64 : /9/0 -> 9/0/ -SET 0103000000098000000000000000 - IDX testpb.ExampleTable bz/str/u32/i64 : []//9/0 -> 9/0/ -ORM AFTER INSERT testpb.ExampleTable {"u32":9} -GET 010000098000000000000000 - PK testpb.ExampleTable 9/0/ -> {"u32":9} -GET 010000098000000000000000 - PK testpb.ExampleTable 9/0/ -> {"u32":9} -ORM BEFORE UPDATE testpb.ExampleTable {"u32":9} -> {"u32":9,"b":true} -SET 010000098000000000000000 7801 - PK testpb.ExampleTable 9/0/ -> {"u32":9,"b":true} -ORM AFTER UPDATE testpb.ExampleTable {"u32":9} -> {"u32":9,"b":true} -GET 010000098000000000000000 7801 - PK testpb.ExampleTable 9/0/ -> {"u32":9,"b":true} -ITERATOR 0100 -> 0101 - VALID true - KEY 010000047ffffffffffffffe616263 100e2203616263 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":14,"str":"abc","bz":"abc","i64":-2} - NEXT - VALID true - KEY 010000047ffffffffffffffe616264 100e2203616264 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"u64":14,"str":"abd","bz":"abd","i64":-2} - NEXT - VALID true - KEY 010000047fffffffffffffff616263 10102203616263 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":16,"str":"abc","bz":"abc","i64":-1} - NEXT - VALID true - KEY 010000057ffffffffffffffe616264 10102203616264 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":16,"str":"abd","bz":"abd","i64":-2} - NEXT - VALID true - KEY 010000057ffffffffffffffe616265 10122203616265 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":18,"str":"abe","bz":"abe","i64":-2} - NEXT - VALID true - KEY 010000077ffffffffffffffe616265 100a - PK testpb.ExampleTable 7/-2/abe -> {"u32":7,"u64":10,"str":"abe","i64":-2} - NEXT - VALID true - KEY 010000077fffffffffffffff616265 100b - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"u64":11,"str":"abe","i64":-1} - NEXT - VALID true - KEY 010000087ffffffffffffffc616263 100b - PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"u64":11,"str":"abc","i64":-4} - NEXT - VALID true - KEY 010000088000000000000001616263 100c - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"u64":12,"str":"abc","i64":1} - NEXT - VALID true - KEY 010000088000000000000001616264 100a - PK testpb.ExampleTable 8/1/abd -> {"u32":8,"u64":10,"str":"abd","i64":1} - NEXT - VALID true - KEY 010000098000000000000000 7801 - PK testpb.ExampleTable 9/0/ -> {"u32":9,"b":true} - NEXT - VALID false -ITERATOR 0100 -> 0101 - VALID true - KEY 010000047ffffffffffffffe616263 100e2203616263 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":14,"str":"abc","bz":"abc","i64":-2} - NEXT - VALID true - KEY 010000047ffffffffffffffe616264 100e2203616264 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"u64":14,"str":"abd","bz":"abd","i64":-2} - NEXT - VALID true - KEY 010000047fffffffffffffff616263 10102203616263 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":16,"str":"abc","bz":"abc","i64":-1} - NEXT - VALID true - KEY 010000057ffffffffffffffe616264 10102203616264 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":16,"str":"abd","bz":"abd","i64":-2} - NEXT - VALID true - KEY 010000057ffffffffffffffe616265 10122203616265 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":18,"str":"abe","bz":"abe","i64":-2} - NEXT - VALID true - KEY 010000077ffffffffffffffe616265 100a - PK testpb.ExampleTable 7/-2/abe -> {"u32":7,"u64":10,"str":"abe","i64":-2} - NEXT - VALID true - KEY 010000077fffffffffffffff616265 100b - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"u64":11,"str":"abe","i64":-1} - NEXT - VALID true - KEY 010000087ffffffffffffffc616263 100b - PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"u64":11,"str":"abc","i64":-4} - NEXT - VALID true - KEY 010000088000000000000001616263 100c - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"u64":12,"str":"abc","i64":1} - NEXT - VALID true - KEY 010000088000000000000001616264 100a - PK testpb.ExampleTable 8/1/abd -> {"u32":8,"u64":10,"str":"abd","i64":1} - NEXT - VALID true - KEY 010000098000000000000000 7801 - PK testpb.ExampleTable 9/0/ -> {"u32":9,"b":true} - NEXT - VALID false -ITERATOR 0100 -> 0101 - VALID true - KEY 010000047ffffffffffffffe616263 100e2203616263 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":14,"str":"abc","bz":"abc","i64":-2} - KEY 010000047ffffffffffffffe616263 100e2203616263 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":14,"str":"abc","bz":"abc","i64":-2} - NEXT - VALID true - KEY 010000047ffffffffffffffe616264 100e2203616264 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"u64":14,"str":"abd","bz":"abd","i64":-2} - KEY 010000047ffffffffffffffe616264 100e2203616264 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"u64":14,"str":"abd","bz":"abd","i64":-2} - NEXT - VALID true - KEY 010000047fffffffffffffff616263 10102203616263 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":16,"str":"abc","bz":"abc","i64":-1} - KEY 010000047fffffffffffffff616263 10102203616263 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":16,"str":"abc","bz":"abc","i64":-1} - NEXT - VALID true - KEY 010000057ffffffffffffffe616264 10102203616264 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":16,"str":"abd","bz":"abd","i64":-2} - KEY 010000057ffffffffffffffe616264 10102203616264 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":16,"str":"abd","bz":"abd","i64":-2} - NEXT - VALID true - KEY 010000057ffffffffffffffe616265 10122203616265 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":18,"str":"abe","bz":"abe","i64":-2} - KEY 010000057ffffffffffffffe616265 10122203616265 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":18,"str":"abe","bz":"abe","i64":-2} - NEXT - VALID true - KEY 010000077ffffffffffffffe616265 100a - PK testpb.ExampleTable 7/-2/abe -> {"u32":7,"u64":10,"str":"abe","i64":-2} - KEY 010000077ffffffffffffffe616265 100a - PK testpb.ExampleTable 7/-2/abe -> {"u32":7,"u64":10,"str":"abe","i64":-2} - NEXT - VALID true - KEY 010000077fffffffffffffff616265 100b - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"u64":11,"str":"abe","i64":-1} - KEY 010000077fffffffffffffff616265 100b - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"u64":11,"str":"abe","i64":-1} - NEXT - VALID true - KEY 010000087ffffffffffffffc616263 100b - PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"u64":11,"str":"abc","i64":-4} - KEY 010000087ffffffffffffffc616263 100b - PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"u64":11,"str":"abc","i64":-4} - NEXT - VALID true - KEY 010000088000000000000001616263 100c - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"u64":12,"str":"abc","i64":1} - KEY 010000088000000000000001616263 100c - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"u64":12,"str":"abc","i64":1} - NEXT - VALID true - KEY 010000088000000000000001616264 100a - PK testpb.ExampleTable 8/1/abd -> {"u32":8,"u64":10,"str":"abd","i64":1} - KEY 010000088000000000000001616264 100a - PK testpb.ExampleTable 8/1/abd -> {"u32":8,"u64":10,"str":"abd","i64":1} - NEXT - VALID true - KEY 010000098000000000000000 7801 - PK testpb.ExampleTable 9/0/ -> {"u32":9,"b":true} - KEY 010000098000000000000000 7801 - PK testpb.ExampleTable 9/0/ -> {"u32":9,"b":true} - NEXT - VALID false -GET 010000077ffffffffffffffe616265 100a - PK testpb.ExampleTable 7/-2/abe -> {"u32":7,"u64":10,"str":"abe","i64":-2} -ORM BEFORE DELETE testpb.ExampleTable {"u32":7,"u64":10,"str":"abe","i64":-2} -DEL 010000077ffffffffffffffe616265 -DEL PK testpb.ExampleTable 7/-2/abe -> {"u32":7,"str":"abe","i64":-2} -DEL 0101000a616265 -DEL ERR:EOF -DEL 01026162650000077ffffffffffffffe -DEL IDX testpb.ExampleTable str/u32/i64 : abe/7/-2 -> 7/-2/abe -DEL 0103006162650000077ffffffffffffffe -DEL IDX testpb.ExampleTable bz/str/u32/i64 : []/abe/7/-2 -> 7/-2/abe -ORM AFTER DELETE testpb.ExampleTable {"u32":7,"u64":10,"str":"abe","i64":-2} -HAS 010000077ffffffffffffffe616265 - PK testpb.ExampleTable 7/-2/abe -> {"u32":7,"str":"abe","i64":-2} -ITERATOR 0100 -> 0101 - VALID true - KEY 010000047ffffffffffffffe616263 100e2203616263 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":14,"str":"abc","bz":"abc","i64":-2} - NEXT - VALID true - KEY 010000047ffffffffffffffe616264 100e2203616264 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"u64":14,"str":"abd","bz":"abd","i64":-2} - NEXT - VALID true - KEY 010000047fffffffffffffff616263 10102203616263 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":16,"str":"abc","bz":"abc","i64":-1} - NEXT - VALID true - KEY 010000057ffffffffffffffe616264 10102203616264 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":16,"str":"abd","bz":"abd","i64":-2} - NEXT - VALID true - KEY 010000057ffffffffffffffe616265 10122203616265 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":18,"str":"abe","bz":"abe","i64":-2} - NEXT - VALID true - KEY 010000077fffffffffffffff616265 100b - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"u64":11,"str":"abe","i64":-1} - NEXT - VALID true - KEY 010000087ffffffffffffffc616263 100b - PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"u64":11,"str":"abc","i64":-4} - NEXT - VALID true - KEY 010000088000000000000001616263 100c - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"u64":12,"str":"abc","i64":1} - NEXT - VALID true - KEY 010000088000000000000001616264 100a - PK testpb.ExampleTable 8/1/abd -> {"u32":8,"u64":10,"str":"abd","i64":1} - NEXT - VALID true - KEY 010000098000000000000000 7801 - PK testpb.ExampleTable 9/0/ -> {"u32":9,"b":true} - NEXT - VALID false -ITERATOR 010261626400 -> 010261626401 - VALID true - KEY 01026162640000047ffffffffffffffe - IDX testpb.ExampleTable str/u32/i64 : abd/4/-2 -> 4/-2/abd -GET 010000047ffffffffffffffe616264 100e2203616264 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"u64":14,"str":"abd","bz":"abd","i64":-2} - NEXT - VALID true - KEY 01026162640000057ffffffffffffffe - IDX testpb.ExampleTable str/u32/i64 : abd/5/-2 -> 5/-2/abd -GET 010000057ffffffffffffffe616264 10102203616264 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":16,"str":"abd","bz":"abd","i64":-2} - NEXT - VALID true - KEY 01026162640000088000000000000001 - IDX testpb.ExampleTable str/u32/i64 : abd/8/1 -> 8/1/abd -GET 010000088000000000000001616264 100a - PK testpb.ExampleTable 8/1/abd -> {"u32":8,"u64":10,"str":"abd","i64":1} - NEXT - VALID false -ITERATOR 010261626400 -> 010261626401 - VALID true - KEY 01026162640000047ffffffffffffffe - IDX testpb.ExampleTable str/u32/i64 : abd/4/-2 -> 4/-2/abd -GET 010000047ffffffffffffffe616264 100e2203616264 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"u64":14,"str":"abd","bz":"abd","i64":-2} -ORM BEFORE DELETE testpb.ExampleTable {"u32":4,"u64":14,"str":"abd","bz":"abd","i64":-2} - NEXT - VALID true - KEY 01026162640000057ffffffffffffffe - IDX testpb.ExampleTable str/u32/i64 : abd/5/-2 -> 5/-2/abd -GET 010000057ffffffffffffffe616264 10102203616264 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":16,"str":"abd","bz":"abd","i64":-2} -ORM BEFORE DELETE testpb.ExampleTable {"u32":5,"u64":16,"str":"abd","bz":"abd","i64":-2} - NEXT - VALID true - KEY 01026162640000088000000000000001 - IDX testpb.ExampleTable str/u32/i64 : abd/8/1 -> 8/1/abd -GET 010000088000000000000001616264 100a - PK testpb.ExampleTable 8/1/abd -> {"u32":8,"u64":10,"str":"abd","i64":1} -ORM BEFORE DELETE testpb.ExampleTable {"u32":8,"u64":10,"str":"abd","i64":1} - NEXT - VALID false - CLOSE -DEL 010000047ffffffffffffffe616264 -DEL PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"str":"abd","i64":-2} -DEL 010000057ffffffffffffffe616264 -DEL PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"str":"abd","i64":-2} -DEL 010000088000000000000001616264 -DEL PK testpb.ExampleTable 8/1/abd -> {"u32":8,"str":"abd","i64":1} -DEL 0101000e616264 -DEL ERR:EOF -DEL 01026162640000047ffffffffffffffe -DEL IDX testpb.ExampleTable str/u32/i64 : abd/4/-2 -> 4/-2/abd -DEL 0103036162646162640000047ffffffffffffffe -DEL IDX testpb.ExampleTable bz/str/u32/i64 : [97 98 100]/abd/4/-2 -> 4/-2/abd -ORM AFTER DELETE testpb.ExampleTable {"u32":4,"u64":14,"str":"abd","bz":"abd","i64":-2} -DEL 01010010616264 -DEL ERR:EOF -DEL 01026162640000057ffffffffffffffe -DEL IDX testpb.ExampleTable str/u32/i64 : abd/5/-2 -> 5/-2/abd -DEL 0103036162646162640000057ffffffffffffffe -DEL IDX testpb.ExampleTable bz/str/u32/i64 : [97 98 100]/abd/5/-2 -> 5/-2/abd -ORM AFTER DELETE testpb.ExampleTable {"u32":5,"u64":16,"str":"abd","bz":"abd","i64":-2} -DEL 0101000a616264 -DEL ERR:EOF -DEL 01026162640000088000000000000001 -DEL IDX testpb.ExampleTable str/u32/i64 : abd/8/1 -> 8/1/abd -DEL 0103006162640000088000000000000001 -DEL IDX testpb.ExampleTable bz/str/u32/i64 : []/abd/8/1 -> 8/1/abd -ORM AFTER DELETE testpb.ExampleTable {"u32":8,"u64":10,"str":"abd","i64":1} -ITERATOR 0100 -> 0101 - VALID true - KEY 010000047ffffffffffffffe616263 100e2203616263 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":14,"str":"abc","bz":"abc","i64":-2} - NEXT - VALID true - KEY 010000047fffffffffffffff616263 10102203616263 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":16,"str":"abc","bz":"abc","i64":-1} - NEXT - VALID true - KEY 010000057ffffffffffffffe616265 10122203616265 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":18,"str":"abe","bz":"abe","i64":-2} - NEXT - VALID true - KEY 010000077fffffffffffffff616265 100b - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"u64":11,"str":"abe","i64":-1} - NEXT - VALID true - KEY 010000087ffffffffffffffc616263 100b - PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"u64":11,"str":"abc","i64":-4} - NEXT - VALID true - KEY 010000088000000000000001616263 100c - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"u64":12,"str":"abc","i64":1} - NEXT - VALID true - KEY 010000098000000000000000 7801 - PK testpb.ExampleTable 9/0/ -> {"u32":9,"b":true} - NEXT - VALID false -ITERATOR 0102616263000008 -> 0102616265000006 - VALID true - KEY 01026162630000087ffffffffffffffc - IDX testpb.ExampleTable str/u32/i64 : abc/8/-4 -> 8/-4/abc -GET 010000087ffffffffffffffc616263 100b - PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"u64":11,"str":"abc","i64":-4} -ORM BEFORE DELETE testpb.ExampleTable {"u32":8,"u64":11,"str":"abc","i64":-4} - NEXT - VALID true - KEY 01026162630000088000000000000001 - IDX testpb.ExampleTable str/u32/i64 : abc/8/1 -> 8/1/abc -GET 010000088000000000000001616263 100c - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"u64":12,"str":"abc","i64":1} -ORM BEFORE DELETE testpb.ExampleTable {"u32":8,"u64":12,"str":"abc","i64":1} - NEXT - VALID true - KEY 01026162650000057ffffffffffffffe - IDX testpb.ExampleTable str/u32/i64 : abe/5/-2 -> 5/-2/abe -GET 010000057ffffffffffffffe616265 10122203616265 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":18,"str":"abe","bz":"abe","i64":-2} -ORM BEFORE DELETE testpb.ExampleTable {"u32":5,"u64":18,"str":"abe","bz":"abe","i64":-2} - NEXT - VALID false - CLOSE -DEL 010000087ffffffffffffffc616263 -DEL PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"str":"abc","i64":-4} -DEL 010000088000000000000001616263 -DEL PK testpb.ExampleTable 8/1/abc -> {"u32":8,"str":"abc","i64":1} -DEL 010000057ffffffffffffffe616265 -DEL PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"str":"abe","i64":-2} -DEL 0101000b616263 -DEL ERR:EOF -DEL 01026162630000087ffffffffffffffc -DEL IDX testpb.ExampleTable str/u32/i64 : abc/8/-4 -> 8/-4/abc -DEL 0103006162630000087ffffffffffffffc -DEL IDX testpb.ExampleTable bz/str/u32/i64 : []/abc/8/-4 -> 8/-4/abc -ORM AFTER DELETE testpb.ExampleTable {"u32":8,"u64":11,"str":"abc","i64":-4} -DEL 0101000c616263 -DEL ERR:EOF -DEL 01026162630000088000000000000001 -DEL IDX testpb.ExampleTable str/u32/i64 : abc/8/1 -> 8/1/abc -DEL 0103006162630000088000000000000001 -DEL IDX testpb.ExampleTable bz/str/u32/i64 : []/abc/8/1 -> 8/1/abc -ORM AFTER DELETE testpb.ExampleTable {"u32":8,"u64":12,"str":"abc","i64":1} -DEL 01010012616265 -DEL ERR:EOF -DEL 01026162650000057ffffffffffffffe -DEL IDX testpb.ExampleTable str/u32/i64 : abe/5/-2 -> 5/-2/abe -DEL 0103036162656162650000057ffffffffffffffe -DEL IDX testpb.ExampleTable bz/str/u32/i64 : [97 98 101]/abe/5/-2 -> 5/-2/abe -ORM AFTER DELETE testpb.ExampleTable {"u32":5,"u64":18,"str":"abe","bz":"abe","i64":-2} -ITERATOR 0100 -> 0101 - VALID true - KEY 010000047ffffffffffffffe616263 100e2203616263 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":14,"str":"abc","bz":"abc","i64":-2} - NEXT - VALID true - KEY 010000047fffffffffffffff616263 10102203616263 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":16,"str":"abc","bz":"abc","i64":-1} - NEXT - VALID true - KEY 010000077fffffffffffffff616265 100b - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"u64":11,"str":"abe","i64":-1} - NEXT - VALID true - KEY 010000098000000000000000 7801 - PK testpb.ExampleTable 9/0/ -> {"u32":9,"b":true} - NEXT - VALID false -GET 010000047ffffffffffffffe616263 100e2203616263 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":14,"str":"abc","bz":"abc","i64":-2} -ORM BEFORE DELETE testpb.ExampleTable {"u32":4,"u64":14,"str":"abc","bz":"abc","i64":-2} -DEL 010000047ffffffffffffffe616263 -DEL PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"str":"abc","i64":-2} -DEL 0101000e616263 -DEL ERR:EOF -DEL 01026162630000047ffffffffffffffe -DEL IDX testpb.ExampleTable str/u32/i64 : abc/4/-2 -> 4/-2/abc -DEL 0103036162636162630000047ffffffffffffffe -DEL IDX testpb.ExampleTable bz/str/u32/i64 : [97 98 99]/abc/4/-2 -> 4/-2/abc -ORM AFTER DELETE testpb.ExampleTable {"u32":4,"u64":14,"str":"abc","bz":"abc","i64":-2} -ITERATOR 0100 -> 0101 - VALID true - KEY 010000047fffffffffffffff616263 10102203616263 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":16,"str":"abc","bz":"abc","i64":-1} - NEXT - VALID true - KEY 010000077fffffffffffffff616265 100b - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"u64":11,"str":"abe","i64":-1} - NEXT - VALID true - KEY 010000098000000000000000 7801 - PK testpb.ExampleTable 9/0/ -> {"u32":9,"b":true} - NEXT - VALID false - CLOSE - CLOSE - CLOSE diff --git a/orm/model/ormtable/testdata/trivial_auto_inc_export.golden b/orm/model/ormtable/testdata/trivial_auto_inc_export.golden deleted file mode 100644 index 5d50c80c0683..000000000000 --- a/orm/model/ormtable/testdata/trivial_auto_inc_export.golden +++ /dev/null @@ -1 +0,0 @@ -[2] \ No newline at end of file diff --git a/orm/model/ormtable/timestamp_test.go b/orm/model/ormtable/timestamp_test.go deleted file mode 100644 index 031d755f2cdb..000000000000 --- a/orm/model/ormtable/timestamp_test.go +++ /dev/null @@ -1,103 +0,0 @@ -package ormtable_test - -import ( - "testing" - "time" - - "google.golang.org/protobuf/types/known/timestamppb" - - "gotest.tools/v3/assert" - - "cosmossdk.io/orm/internal/testkv" - "cosmossdk.io/orm/internal/testpb" - "cosmossdk.io/orm/model/ormtable" -) - -func TestTimestampIndex(t *testing.T) { - table, err := ormtable.Build(ormtable.Options{ - MessageType: (&testpb.ExampleTimestamp{}).ProtoReflect().Type(), - }) - assert.NilError(t, err) - backend := testkv.NewDebugBackend(testkv.NewSplitMemBackend(), &testkv.EntryCodecDebugger{ - EntryCodec: table, - }) - ctx := ormtable.WrapContextDefault(backend) - store, err := testpb.NewExampleTimestampTable(table) - assert.NilError(t, err) - - past, err := time.Parse("2006-01-02", "2000-01-01") - assert.NilError(t, err) - middle, err := time.Parse("2006-01-02", "2020-01-01") - assert.NilError(t, err) - future, err := time.Parse("2006-01-02", "2049-01-01") - assert.NilError(t, err) - - pastPb, middlePb, futurePb := timestamppb.New(past), timestamppb.New(middle), timestamppb.New(future) - timeOrder := []*timestamppb.Timestamp{pastPb, middlePb, futurePb} - - assert.NilError(t, store.Insert(ctx, &testpb.ExampleTimestamp{ - Name: "foo", - Ts: pastPb, - })) - assert.NilError(t, store.Insert(ctx, &testpb.ExampleTimestamp{ - Name: "bar", - Ts: middlePb, - })) - assert.NilError(t, store.Insert(ctx, &testpb.ExampleTimestamp{ - Name: "baz", - Ts: futurePb, - })) - - from, to := testpb.ExampleTimestampTsIndexKey{}.WithTs(timestamppb.New(past)), testpb.ExampleTimestampTsIndexKey{}.WithTs(timestamppb.New(future)) - it, err := store.ListRange(ctx, from, to) - assert.NilError(t, err) - - i := 0 - for it.Next() { - v, err := it.Value() - assert.NilError(t, err) - assert.Equal(t, timeOrder[i].String(), v.Ts.String()) - i++ - } - - // insert a nil entry - id, err := store.InsertReturningId(ctx, &testpb.ExampleTimestamp{ - Name: "nil", - Ts: nil, - }) - assert.NilError(t, err) - - res, err := store.Get(ctx, id) - assert.NilError(t, err) - assert.Assert(t, res.Ts == nil) - - it, err = store.List(ctx, testpb.ExampleTimestampTsIndexKey{}) - assert.NilError(t, err) - - // make sure nils are ordered last - timeOrder = append(timeOrder, nil) - i = 0 - for it.Next() { - v, err := it.Value() - assert.NilError(t, err) - assert.Assert(t, v != nil) - x := timeOrder[i] - if x == nil { - assert.Assert(t, v.Ts == nil) - } else { - assert.Equal(t, x.String(), v.Ts.String()) - } - i++ - } - it.Close() - - // try iterating over just nil timestamps - it, err = store.List(ctx, testpb.ExampleTimestampTsIndexKey{}.WithTs(nil)) - assert.NilError(t, err) - assert.Assert(t, it.Next()) - res, err = it.Value() - assert.NilError(t, err) - assert.Assert(t, res.Ts == nil) - assert.Assert(t, !it.Next()) - it.Close() -} diff --git a/orm/model/ormtable/unique.go b/orm/model/ormtable/unique.go deleted file mode 100644 index d82df89a0805..000000000000 --- a/orm/model/ormtable/unique.go +++ /dev/null @@ -1,210 +0,0 @@ -package ormtable - -import ( - "context" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - - "cosmossdk.io/orm/encoding/encodeutil" - "cosmossdk.io/orm/encoding/ormkv" - "cosmossdk.io/orm/internal/fieldnames" - "cosmossdk.io/orm/model/ormlist" - "cosmossdk.io/orm/types/kv" - "cosmossdk.io/orm/types/ormerrors" -) - -type uniqueKeyIndex struct { - *ormkv.UniqueKeyCodec - fields fieldnames.FieldNames - primaryKey *primaryKeyIndex - getReadBackend func(context.Context) (ReadBackend, error) -} - -func (u uniqueKeyIndex) List(ctx context.Context, prefixKey []interface{}, options ...ormlist.Option) (Iterator, error) { - backend, err := u.getReadBackend(ctx) - if err != nil { - return nil, err - } - - return prefixIterator(backend.IndexStoreReader(), backend, u, u.GetKeyCodec(), prefixKey, options) -} - -func (u uniqueKeyIndex) ListRange(ctx context.Context, from, to []interface{}, options ...ormlist.Option) (Iterator, error) { - backend, err := u.getReadBackend(ctx) - if err != nil { - return nil, err - } - - return rangeIterator(backend.IndexStoreReader(), backend, u, u.GetKeyCodec(), from, to, options) -} - -func (u uniqueKeyIndex) doNotImplement() {} - -func (u uniqueKeyIndex) Has(ctx context.Context, values ...interface{}) (found bool, err error) { - backend, err := u.getReadBackend(ctx) - if err != nil { - return false, err - } - - key, err := u.GetKeyCodec().EncodeKey(encodeutil.ValuesOf(values...)) - if err != nil { - return false, err - } - - return backend.IndexStoreReader().Has(key) -} - -func (u uniqueKeyIndex) Get(ctx context.Context, message proto.Message, keyValues ...interface{}) (found bool, err error) { - backend, err := u.getReadBackend(ctx) - if err != nil { - return false, err - } - - key, err := u.GetKeyCodec().EncodeKey(encodeutil.ValuesOf(keyValues...)) - if err != nil { - return false, err - } - - value, err := backend.IndexStoreReader().Get(key) - if err != nil { - return false, err - } - - // for unique keys, value can be empty and the entry still exists - if value == nil { - return false, nil - } - - _, pk, err := u.DecodeIndexKey(key, value) - if err != nil { - return true, err - } - - return u.primaryKey.get(backend, message, pk) -} - -func (u uniqueKeyIndex) DeleteBy(ctx context.Context, keyValues ...interface{}) error { - it, err := u.List(ctx, keyValues) - if err != nil { - return err - } - - return u.primaryKey.deleteByIterator(ctx, it) -} - -func (u uniqueKeyIndex) DeleteRange(ctx context.Context, from, to []interface{}) error { - it, err := u.ListRange(ctx, from, to) - if err != nil { - return err - } - - return u.primaryKey.deleteByIterator(ctx, it) -} - -func (u uniqueKeyIndex) onInsert(store kv.Store, message protoreflect.Message) error { - k, v, err := u.EncodeKVFromMessage(message) - if err != nil { - return err - } - - has, err := store.Has(k) - if err != nil { - return err - } - - if has { - return ormerrors.UniqueKeyViolation.Wrapf("%q", u.fields) - } - - return store.Set(k, v) -} - -func (u uniqueKeyIndex) onUpdate(store kv.Store, new, existing protoreflect.Message) error { - keyCodec := u.GetKeyCodec() - newValues := keyCodec.GetKeyValues(new) - existingValues := keyCodec.GetKeyValues(existing) - if keyCodec.CompareKeys(newValues, existingValues) == 0 { - return nil - } - - newKey, err := keyCodec.EncodeKey(newValues) - if err != nil { - return err - } - - has, err := store.Has(newKey) - if err != nil { - return err - } - - if has { - return ormerrors.UniqueKeyViolation.Wrapf("%q", u.fields) - } - - existingKey, err := keyCodec.EncodeKey(existingValues) - if err != nil { - return err - } - - err = store.Delete(existingKey) - if err != nil { - return err - } - - _, value, err := u.GetValueCodec().EncodeKeyFromMessage(new) - if err != nil { - return err - } - - return store.Set(newKey, value) -} - -func (u uniqueKeyIndex) onDelete(store kv.Store, message protoreflect.Message) error { - _, key, err := u.GetKeyCodec().EncodeKeyFromMessage(message) - if err != nil { - return err - } - - return store.Delete(key) -} - -func (u uniqueKeyIndex) readValueFromIndexKey(store ReadBackend, primaryKey []protoreflect.Value, _ []byte, message proto.Message) error { - found, err := u.primaryKey.get(store, message, primaryKey) - if err != nil { - return err - } - - if !found { - return ormerrors.UnexpectedError.Wrapf("can't find primary key") - } - - return nil -} - -func (u uniqueKeyIndex) Fields() string { - return u.fields.String() -} - -var ( - _ indexer = &uniqueKeyIndex{} - _ UniqueIndex = &uniqueKeyIndex{} -) - -// isNonTrivialUniqueKey checks if unique key fields are non-trivial, meaning that they -// don't contain the full primary key. If they contain the full primary key, then -// we can just use a regular index because there is no new unique constraint. -func isNonTrivialUniqueKey(fields, primaryKeyFields []protoreflect.Name) bool { - have := map[protoreflect.Name]bool{} - for _, field := range fields { - have[field] = true - } - - for _, field := range primaryKeyFields { - if !have[field] { - return true - } - } - - return false -} diff --git a/orm/model/ormtable/util.go b/orm/model/ormtable/util.go deleted file mode 100644 index c3098d0eee5f..000000000000 --- a/orm/model/ormtable/util.go +++ /dev/null @@ -1,35 +0,0 @@ -package ormtable - -// prefixEndBytes returns the []byte that would end a -// range query for all []byte with a certain prefix -// Deals with last byte of prefix being FF without overflowing -func prefixEndBytes(prefix []byte) []byte { - if len(prefix) == 0 { - return nil - } - - end := make([]byte, len(prefix)) - copy(end, prefix) - - for { - if end[len(end)-1] != byte(255) { - end[len(end)-1]++ - break - } - - end = end[:len(end)-1] - - if len(end) == 0 { - end = nil - break - } - } - - return end -} - -// inclusiveEndBytes returns the []byte that would end a -// range query such that the input would be included -func inclusiveEndBytes(inclusiveBytes []byte) []byte { - return append(inclusiveBytes, byte(0x00)) -} diff --git a/orm/orm.go b/orm/orm.go deleted file mode 100644 index d533b2b4623d..000000000000 --- a/orm/orm.go +++ /dev/null @@ -1,69 +0,0 @@ -package orm - -import ( - "fmt" - - appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" - modulev1alpha1 "cosmossdk.io/api/cosmos/orm/module/v1alpha1" - ormv1alpha1 "cosmossdk.io/api/cosmos/orm/v1alpha1" - "cosmossdk.io/core/appmodule" - "cosmossdk.io/core/store" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protodesc" - "google.golang.org/protobuf/reflect/protoregistry" - - "cosmossdk.io/depinject" - - "cosmossdk.io/orm/model/ormdb" - "cosmossdk.io/orm/model/ormtable" -) - -func init() { - appmodule.Register(&modulev1alpha1.Module{}, - appmodule.Provide(ProvideModuleDB), - ) -} - -// ModuleDBInputs are the inputs to ProvideModuleDB. NOTE: this is intended to be used by depinject. -type ModuleDBInputs struct { - depinject.In - - AppConfig *appv1alpha1.Config - KVStoreService store.KVStoreService - MemoryStoreService store.MemoryStoreService `optional:"true"` - TransientStoreService store.TransientStoreService `optional:"true"` - TypeResolver ormtable.TypeResolver `optional:"true"` - FileResolver protodesc.Resolver `optional:"true"` -} - -// ProvideModuleDB provides an ORM ModuleDB scoped to a module. NOTE: this is intended to be used by depinject. -func ProvideModuleDB(moduleKey depinject.ModuleKey, inputs ModuleDBInputs) (ormdb.ModuleDB, error) { - for _, module := range inputs.AppConfig.Modules { - if module.Name == moduleKey.Name() { - typeResolver := inputs.TypeResolver - if typeResolver == nil { - typeResolver = protoregistry.GlobalTypes - } - - modTyp, err := typeResolver.FindMessageByURL(module.Config.TypeUrl) - if err != nil { - return nil, err - } - - modSchema := proto.GetExtension(modTyp.Descriptor().Options(), ormv1alpha1.E_ModuleSchema).(*ormv1alpha1.ModuleSchemaDescriptor) - if modSchema == nil { - return nil, fmt.Errorf("no schema for module %s", moduleKey.Name()) - } - - return ormdb.NewModuleDB(modSchema, ormdb.ModuleDBOptions{ - TypeResolver: inputs.TypeResolver, - FileResolver: inputs.FileResolver, - KVStoreService: inputs.KVStoreService, - MemoryStoreService: inputs.MemoryStoreService, - TransientStoreService: inputs.TransientStoreService, - }) - } - } - - return nil, fmt.Errorf("unable to find config for module %s", moduleKey.Name()) -} diff --git a/orm/sonar-project.properties b/orm/sonar-project.properties deleted file mode 100644 index 868608220c6e..000000000000 --- a/orm/sonar-project.properties +++ /dev/null @@ -1,14 +0,0 @@ -sonar.projectKey=cosmos-sdk-orm -sonar.organization=cosmos - -sonar.projectName=Cosmos SDK - ORM -sonar.project.monorepo.enabled=true - -sonar.sources=. -sonar.exclusions=**/*_test.go -sonar.tests=. -sonar.test.inclusions=**/*_test.go -sonar.go.coverage.reportPaths=coverage.out - -sonar.sourceEncoding=UTF-8 -sonar.scm.provider=git \ No newline at end of file diff --git a/orm/testing/ormmocks/docs.go b/orm/testing/ormmocks/docs.go deleted file mode 100644 index 7065a2fed8b9..000000000000 --- a/orm/testing/ormmocks/docs.go +++ /dev/null @@ -1,13 +0,0 @@ -// Package ormmocks contains generated mocks for orm types that can be used -// in testing. Right now, this package only contains a mock for ormtable.ValidateHooks -// as this useful way for unit testing using an in-memory database. Rather -// than attempting to mock a whole table or database instance, instead -// a mock Hook instance can be passed in to verify that the expected -// insert/update/delete operations are happening in the database. -// -// The Eq function gomock.Matcher that compares protobuf messages can -// be used in gomock EXPECT functions. -// -// See TestHooks in ormdb/module_test.go for examples of how to use -// mock ValidateHooks in a real-world scenario. -package ormmocks diff --git a/orm/testing/ormmocks/hooks.go b/orm/testing/ormmocks/hooks.go deleted file mode 100644 index c5ad0e6f0b17..000000000000 --- a/orm/testing/ormmocks/hooks.go +++ /dev/null @@ -1,137 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: orm/model/ormtable/hooks.go - -// Package ormmocks is a generated GoMock package. -package ormmocks - -import ( - context "context" - reflect "reflect" - - gomock "github.com/golang/mock/gomock" - proto "google.golang.org/protobuf/proto" -) - -// MockValidateHooks is a mock of ValidateHooks interface. -type MockValidateHooks struct { - ctrl *gomock.Controller - recorder *MockValidateHooksMockRecorder -} - -// MockValidateHooksMockRecorder is the mock recorder for MockValidateHooks. -type MockValidateHooksMockRecorder struct { - mock *MockValidateHooks -} - -// NewMockValidateHooks creates a new mock instance. -func NewMockValidateHooks(ctrl *gomock.Controller) *MockValidateHooks { - mock := &MockValidateHooks{ctrl: ctrl} - mock.recorder = &MockValidateHooksMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockValidateHooks) EXPECT() *MockValidateHooksMockRecorder { - return m.recorder -} - -// ValidateDelete mocks base method. -func (m *MockValidateHooks) ValidateDelete(arg0 context.Context, arg1 proto.Message) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ValidateDelete", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// ValidateDelete indicates an expected call of ValidateDelete. -func (mr *MockValidateHooksMockRecorder) ValidateDelete(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateDelete", reflect.TypeOf((*MockValidateHooks)(nil).ValidateDelete), arg0, arg1) -} - -// ValidateInsert mocks base method. -func (m *MockValidateHooks) ValidateInsert(arg0 context.Context, arg1 proto.Message) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ValidateInsert", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// ValidateInsert indicates an expected call of ValidateInsert. -func (mr *MockValidateHooksMockRecorder) ValidateInsert(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateInsert", reflect.TypeOf((*MockValidateHooks)(nil).ValidateInsert), arg0, arg1) -} - -// ValidateUpdate mocks base method. -func (m *MockValidateHooks) ValidateUpdate(ctx context.Context, existing, new proto.Message) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ValidateUpdate", ctx, existing, new) - ret0, _ := ret[0].(error) - return ret0 -} - -// ValidateUpdate indicates an expected call of ValidateUpdate. -func (mr *MockValidateHooksMockRecorder) ValidateUpdate(ctx, existing, new interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateUpdate", reflect.TypeOf((*MockValidateHooks)(nil).ValidateUpdate), ctx, existing, new) -} - -// MockWriteHooks is a mock of WriteHooks interface. -type MockWriteHooks struct { - ctrl *gomock.Controller - recorder *MockWriteHooksMockRecorder -} - -// MockWriteHooksMockRecorder is the mock recorder for MockWriteHooks. -type MockWriteHooksMockRecorder struct { - mock *MockWriteHooks -} - -// NewMockWriteHooks creates a new mock instance. -func NewMockWriteHooks(ctrl *gomock.Controller) *MockWriteHooks { - mock := &MockWriteHooks{ctrl: ctrl} - mock.recorder = &MockWriteHooksMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockWriteHooks) EXPECT() *MockWriteHooksMockRecorder { - return m.recorder -} - -// OnDelete mocks base method. -func (m *MockWriteHooks) OnDelete(arg0 context.Context, arg1 proto.Message) { - m.ctrl.T.Helper() - m.ctrl.Call(m, "OnDelete", arg0, arg1) -} - -// OnDelete indicates an expected call of OnDelete. -func (mr *MockWriteHooksMockRecorder) OnDelete(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnDelete", reflect.TypeOf((*MockWriteHooks)(nil).OnDelete), arg0, arg1) -} - -// OnInsert mocks base method. -func (m *MockWriteHooks) OnInsert(arg0 context.Context, arg1 proto.Message) { - m.ctrl.T.Helper() - m.ctrl.Call(m, "OnInsert", arg0, arg1) -} - -// OnInsert indicates an expected call of OnInsert. -func (mr *MockWriteHooksMockRecorder) OnInsert(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnInsert", reflect.TypeOf((*MockWriteHooks)(nil).OnInsert), arg0, arg1) -} - -// OnUpdate mocks base method. -func (m *MockWriteHooks) OnUpdate(ctx context.Context, existing, new proto.Message) { - m.ctrl.T.Helper() - m.ctrl.Call(m, "OnUpdate", ctx, existing, new) -} - -// OnUpdate indicates an expected call of OnUpdate. -func (mr *MockWriteHooksMockRecorder) OnUpdate(ctx, existing, new interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnUpdate", reflect.TypeOf((*MockWriteHooks)(nil).OnUpdate), ctx, existing, new) -} diff --git a/orm/testing/ormmocks/match.go b/orm/testing/ormmocks/match.go deleted file mode 100644 index 8c1da2c022f0..000000000000 --- a/orm/testing/ormmocks/match.go +++ /dev/null @@ -1,29 +0,0 @@ -package ormmocks - -import ( - "github.com/golang/mock/gomock" - "github.com/google/go-cmp/cmp" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/testing/protocmp" -) - -// Code adapted from MIT-licensed https://github.com/budougumi0617/cmpmock/blob/master/diffmatcher.go - -// Eq returns a gomock.Matcher which uses go-cmp to compare protobuf messages. -func Eq(message proto.Message) gomock.Matcher { - return &protoEq{message: message} -} - -type protoEq struct { - message interface{} - diff string -} - -func (p protoEq) Matches(x interface{}) bool { - p.diff = cmp.Diff(x, p.message, protocmp.Transform()) - return len(p.diff) == 0 -} - -func (p protoEq) String() string { - return p.diff -} diff --git a/orm/testing/ormtest/membackend.go b/orm/testing/ormtest/membackend.go deleted file mode 100644 index 2fbeda2866d0..000000000000 --- a/orm/testing/ormtest/membackend.go +++ /dev/null @@ -1,19 +0,0 @@ -// Package ormtest contains utilities for testing modules built with the ORM. -package ormtest - -import ( - "cosmossdk.io/orm/internal/testkv" - "cosmossdk.io/orm/model/ormtable" -) - -// NewMemoryBackend returns a new ORM memory backend which can be used for -// testing purposes independent of any storage layer. -// -// Example: -// -// backend := ormtest.NewMemoryBackend() -// ctx := ormtable.WrapContextDefault() -// ... -func NewMemoryBackend() ormtable.Backend { - return testkv.NewSplitMemBackend() -} diff --git a/orm/types/docs.go b/orm/types/docs.go deleted file mode 100644 index 42d7b07b50af..000000000000 --- a/orm/types/docs.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package types contains types used in the ORM implementation that don't -// have another home. -package types diff --git a/orm/types/kv/store.go b/orm/types/kv/store.go deleted file mode 100644 index f1281b356a0a..000000000000 --- a/orm/types/kv/store.go +++ /dev/null @@ -1,50 +0,0 @@ -// Package kvstore defines the abstract interfaces which ORM tables and indexes -// use for reading and writing data against a KV-store backend. -package kv - -import ( - dbm "github.com/cosmos/cosmos-db" -) - -// ReadonlyStore is an interface for readonly access to a kv-store. -type ReadonlyStore interface { - // Get fetches the value of the given key, or nil if it does not exist. - // CONTRACT: key, value readonly []byte - Get(key []byte) ([]byte, error) - - // Has checks if a key exists. - // CONTRACT: key, value readonly []byte - Has(key []byte) (bool, error) - - // Iterator returns an iterator over a domain of keys, in ascending order. The caller must call - // Close when done. End is exclusive, and start must be less than end. A nil start iterates - // from the first key, and a nil end iterates to the last key (inclusive). Empty keys are not - // valid. - // CONTRACT: No writes may happen within a domain while an iterator exists over it. - // CONTRACT: start, end readonly []byte - Iterator(start, end []byte) (Iterator, error) - - // ReverseIterator returns an iterator over a domain of keys, in descending order. The caller - // must call Close when done. End is exclusive, and start must be less than end. A nil end - // iterates from the last key (inclusive), and a nil start iterates to the first key (inclusive). - // Empty keys are not valid. - // CONTRACT: No writes may happen within a domain while an iterator exists over it. - // CONTRACT: start, end readonly []byte - ReverseIterator(start, end []byte) (Iterator, error) -} - -// Iterator aliases github.com/cosmos/cosmos-db.Iterator. -type Iterator = dbm.Iterator - -// Store is an interface for writing to a kv-store. -type Store interface { - ReadonlyStore - - // Set sets the value for the given key, replacing it if it already exists. - // CONTRACT: key, value readonly []byte - Set(key, value []byte) error - - // Delete deletes the key, or does nothing if the key does not exist. - // CONTRACT: key readonly []byte - Delete(key []byte) error -} diff --git a/orm/types/ormerrors/errors.go b/orm/types/ormerrors/errors.go deleted file mode 100644 index 2f40da7e7eb3..000000000000 --- a/orm/types/ormerrors/errors.go +++ /dev/null @@ -1,48 +0,0 @@ -package ormerrors - -import ( - "cosmossdk.io/errors" - "google.golang.org/grpc/codes" -) - -var codespace = "orm" - -// IsNotFound returns true if the error indicates that the record was not found. -func IsNotFound(err error) bool { - return errors.IsOf(err, NotFound) -} - -// nolint: revive // avoid break API -var ( - InvalidTableId = errors.New(codespace, 1, "invalid or missing table or single id, need a non-zero value") - MissingPrimaryKey = errors.New(codespace, 2, "table is missing primary key") - InvalidKeyFieldsDefinition = errors.New(codespace, 3, "invalid field definition for key") - DuplicateKeyField = errors.New(codespace, 4, "duplicate field in key") - FieldNotFound = errors.New(codespace, 5, "field not found") - InvalidAutoIncrementKey = errors.New(codespace, 6, "an auto-increment primary key must specify a single uint64 field") - InvalidIndexId = errors.New(codespace, 7, "invalid or missing index id, need a value >= 0 and < 32768") - DuplicateIndexId = errors.New(codespace, 8, "duplicate index id") - PrimaryKeyConstraintViolation = errors.New(codespace, 9, "object with primary key already exists") - PrimaryKeyInvalidOnUpdate = errors.New(codespace, 11, "can't update object with missing or invalid primary key") - AutoIncrementKeyAlreadySet = errors.New(codespace, 12, "can't create with auto-increment primary key already set") - CantFindIndex = errors.New(codespace, 13, "can't find index") - UnexpectedDecodePrefix = errors.New(codespace, 14, "unexpected prefix while trying to decode an entry") - UnsupportedOperation = errors.New(codespace, 16, "unsupported operation") - BadDecodeEntry = errors.New(codespace, 17, "bad decode entry") - IndexOutOfBounds = errors.New(codespace, 18, "index out of bounds") - InvalidListOptions = errors.New(codespace, 19, "invalid list options") - InvalidKeyField = errors.New(codespace, 20, "invalid key field") - UnexpectedError = errors.New(codespace, 21, "unexpected error") - InvalidRangeIterationKeys = errors.New(codespace, 22, "invalid range iteration keys") - JSONImportError = errors.New(codespace, 23, "json import error") - UniqueKeyViolation = errors.RegisterWithGRPCCode(codespace, 24, codes.FailedPrecondition, "unique key violation") - InvalidTableDefinition = errors.New(codespace, 25, "invalid table definition") - InvalidFileDescriptorID = errors.New(codespace, 26, "invalid file descriptor ID") - TableNotFound = errors.New(codespace, 27, "table not found") - JSONValidationError = errors.New(codespace, 28, "invalid JSON") - NotFound = errors.RegisterWithGRPCCode(codespace, 29, codes.NotFound, "not found") - ReadOnly = errors.New(codespace, 30, "database is read-only") - AlreadyExists = errors.RegisterWithGRPCCode(codespace, 31, codes.AlreadyExists, "already exists") - ConstraintViolation = errors.RegisterWithGRPCCode(codespace, 32, codes.FailedPrecondition, "failed precondition") - NoTableDescriptor = errors.New(codespace, 33, "no table descriptor found") -) diff --git a/proto/README.md b/proto/README.md index a54d5adf7a79..ea225558a9be 100644 --- a/proto/README.md +++ b/proto/README.md @@ -15,6 +15,7 @@ https://docs.buf.build/bsr/documentation. | Prior v0.46.0 | [Unavailable](https://github.com/bufbuild/buf/issues/1415) | | v0.46.x | [8cb30a2c4de74dc9bd8d260b1e75e176](https://buf.build/cosmos/cosmos-sdk/docs/8cb30a2c4de74dc9bd8d260b1e75e176) | | v0.47.x | [v0.47.0](https://buf.build/cosmos/cosmos-sdk/docs/v0.47.0) | +| v0.50.x | [v0.50.0](https://buf.build/cosmos/cosmos-sdk/docs/v0.50.0) | | Next | [latest on buf](https://buf.build/cosmos/cosmos-sdk/commits/main) | ## Generate diff --git a/proto/buf.gen.gogo.yaml b/proto/buf.gen.gogo.yaml index e3cd0b1acb5a..9c8ba0a4b1fd 100644 --- a/proto/buf.gen.gogo.yaml +++ b/proto/buf.gen.gogo.yaml @@ -2,7 +2,7 @@ version: v1 plugins: - name: gocosmos out: .. - opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types,Mcosmos/orm/v1/orm.proto=cosmossdk.io/orm + opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types - name: grpc-gateway out: .. opt: logtostderr=true,allow_colon_final_segments=true diff --git a/proto/buf.gen.pulsar.yaml b/proto/buf.gen.pulsar.yaml index 41cfbe2af251..fada5e7dd3b0 100644 --- a/proto/buf.gen.pulsar.yaml +++ b/proto/buf.gen.pulsar.yaml @@ -15,6 +15,3 @@ plugins: - name: go-grpc out: ../api opt: paths=source_relative - - name: go-cosmos-orm - out: ../api - opt: paths=source_relative diff --git a/proto/buf.lock b/proto/buf.lock index ddc6786a250a..a272b130d521 100644 --- a/proto/buf.lock +++ b/proto/buf.lock @@ -4,15 +4,15 @@ deps: - remote: buf.build owner: cosmos repository: cosmos-proto - commit: 1935555c206d4afb9e94615dfd0fad31 - digest: shake256:c74d91a3ac7ae07d579e90eee33abf9b29664047ac8816500cf22c081fec0d72d62c89ce0bebafc1f6fec7aa5315be72606717740ca95007248425102c365377 + commit: 04467658e59e44bbb22fe568206e1f70 + digest: shake256:73a640bd60e0c523b0f8237ff34eab67c45a38b64bbbde1d80224819d272dbf316ac183526bd245f994af6608b025f5130483d0133c5edd385531326b5990466 - remote: buf.build owner: cosmos repository: gogo-proto - commit: 5e5b9fdd01804356895f8f79a6f1ddc1 - digest: shake256:0b85da49e2e5f9ebc4806eae058e2f56096ff3b1c59d1fb7c190413dd15f45dd456f0b69ced9059341c80795d2b6c943de15b120a9e0308b499e43e4b5fc2952 + commit: 88ef6483f90f478fb938c37dde52ece3 + digest: shake256:89c45df2aa11e0cff97b0d695436713db3d993d76792e9f8dc1ae90e6ab9a9bec55503d48ceedd6b86069ab07d3041b32001b2bfe0227fa725dd515ff381e5ba - remote: buf.build owner: googleapis repository: googleapis - commit: cc916c31859748a68fd229a3c8d7a2e8 - digest: shake256:469b049d0eb04203d5272062636c078decefc96fec69739159c25d85349c50c34c7706918a8b216c5c27f76939df48452148cff8c5c3ae77fa6ba5c25c1b8bf8 + commit: 546238c53f7340c6a2a6099fb863bc1b + digest: shake256:8d75c12f391e392b24c076d05117b47aeddb090add99c70247a8f4389b906a65f61a933c68e54ed8b73a050b967b6b712ba194348b67c3ab3ee26cc2cb25852c diff --git a/proto/cosmos/app/runtime/v1alpha1/module.proto b/proto/cosmos/app/runtime/v1alpha1/module.proto index c02612170271..826376db4ddc 100644 --- a/proto/cosmos/app/runtime/v1alpha1/module.proto +++ b/proto/cosmos/app/runtime/v1alpha1/module.proto @@ -38,9 +38,14 @@ message Module { // to be used in keeper construction. repeated StoreKeyConfig override_store_keys = 6; + // skip_store_keys is an optional list of store keys to skip when constructing the + // module's keeper. This is useful when a module does not have a store key. + // NOTE: the provided environment variable will have a fake store service. + repeated string skip_store_keys = 11; + // order_migrations defines the order in which module migrations are performed. // If this is left empty, it uses the default migration order. - // https://pkg.go.dev/github.com/cosmos/cosmos-sdk@v0.47.0-alpha2/types/module#DefaultMigrationsOrder + // https://pkg.go.dev/github.com/cosmos/cosmos-sdk/types/module#DefaultMigrationsOrder repeated string order_migrations = 7; // precommiters specifies the module names of the precommiters @@ -52,6 +57,11 @@ message Module { // to call in the order in which they should be called. If this is left empty // no preparecheckstate function will be registered. repeated string prepare_check_staters = 9; + + // pre_blockers specifies the module names of pre blockers + // to call in the order in which they should be called. If this is left empty + // no pre blocker will be registered. + repeated string pre_blockers = 10; } // StoreKeyConfig may be supplied to override the default module store key, which diff --git a/proto/cosmos/app/v1alpha1/config.proto b/proto/cosmos/app/v1alpha1/config.proto index ee3e70659e4b..1aac4b4396f5 100644 --- a/proto/cosmos/app/v1alpha1/config.proto +++ b/proto/cosmos/app/v1alpha1/config.proto @@ -4,6 +4,8 @@ package cosmos.app.v1alpha1; import "google/protobuf/any.proto"; +option go_package = "cosmossdk.io/depinject/appconfig/v1alpha1"; + // Config represents the configuration for a Cosmos SDK ABCI app. // It is intended that all state machine logic including the version of // baseapp and tx handlers (and possibly even Tendermint) that an app needs diff --git a/proto/cosmos/app/v1alpha1/module.proto b/proto/cosmos/app/v1alpha1/module.proto index e5413786509e..ea475f35e17e 100644 --- a/proto/cosmos/app/v1alpha1/module.proto +++ b/proto/cosmos/app/v1alpha1/module.proto @@ -4,6 +4,8 @@ package cosmos.app.v1alpha1; import "google/protobuf/descriptor.proto"; +option go_package = "cosmossdk.io/depinject/appconfig/v1alpha1"; + extend google.protobuf.MessageOptions { // module indicates that this proto type is a config object for an app module // and optionally provides other descriptive information about the module. diff --git a/proto/cosmos/app/v1alpha1/query.proto b/proto/cosmos/app/v1alpha1/query.proto index efec9c81ad71..a51aea691db8 100644 --- a/proto/cosmos/app/v1alpha1/query.proto +++ b/proto/cosmos/app/v1alpha1/query.proto @@ -4,17 +4,21 @@ package cosmos.app.v1alpha1; import "cosmos/app/v1alpha1/config.proto"; +option go_package = "cosmossdk.io/depinject/appconfig/v1alpha1"; + // Query is the app module query service. service Query { // Config returns the current app config. - rpc Config(QueryConfigRequest) returns (QueryConfigResponse) {} + rpc Config(QueryConfigRequest) returns (QueryConfigResponse) { + option deprecated = true; + } } // QueryConfigRequest is the Query/Config request type. message QueryConfigRequest {} -// QueryConfigRequest is the Query/Config response type. +// QueryConfigResponse is the Query/Config response type. message QueryConfigResponse { // config is the current app config. diff --git a/proto/cosmos/auth/v1beta1/auth.proto b/proto/cosmos/auth/v1beta1/auth.proto index bcac98314597..ebc18b69f052 100644 --- a/proto/cosmos/auth/v1beta1/auth.proto +++ b/proto/cosmos/auth/v1beta1/auth.proto @@ -18,15 +18,12 @@ message BaseAccount { option (cosmos_proto.implements_interface) = "cosmos.auth.v1beta1.AccountI"; - string address = 1 [ - (cosmos_proto.scalar) = "cosmos.AddressString"]; + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - google.protobuf.Any pub_key = 2 [ - (gogoproto.jsontag) = "public_key,omitempty", - (amino.field_name) = "public_key"]; + google.protobuf.Any pub_key = 2 [(gogoproto.jsontag) = "public_key,omitempty", (amino.field_name) = "public_key"]; - uint64 account_number = 3; - uint64 sequence = 4; + uint64 account_number = 3; + uint64 sequence = 4; } // ModuleAccount defines an account for modules that holds coins on a pool. diff --git a/proto/cosmos/authz/v1beta1/query.proto b/proto/cosmos/authz/v1beta1/query.proto index 62154ac19a43..fcd56815a64b 100644 --- a/proto/cosmos/authz/v1beta1/query.proto +++ b/proto/cosmos/authz/v1beta1/query.proto @@ -65,7 +65,7 @@ message QueryGranterGrantsResponse { cosmos.base.query.v1beta1.PageResponse pagination = 2; } -// QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. +// QueryGranteeGrantsRequest is the request type for the Query/GranteeGrants RPC method. message QueryGranteeGrantsRequest { string grantee = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; diff --git a/proto/cosmos/authz/v1beta1/tx.proto b/proto/cosmos/authz/v1beta1/tx.proto index 69277c95ee28..a1abff0d6f00 100644 --- a/proto/cosmos/authz/v1beta1/tx.proto +++ b/proto/cosmos/authz/v1beta1/tx.proto @@ -44,10 +44,8 @@ message MsgGrant { cosmos.authz.v1beta1.Grant grant = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } -// MsgExecResponse defines the Msg/MsgExecResponse response type. -message MsgExecResponse { - repeated bytes results = 1; -} +// MsgGrantResponse defines the Msg/MsgGrant response type. +message MsgGrantResponse {} // MsgExec attempts to execute the provided messages using // authorizations granted to the grantee. Each message should have only @@ -63,8 +61,10 @@ message MsgExec { repeated google.protobuf.Any msgs = 2 [(cosmos_proto.accepts_interface) = "cosmos.base.v1beta1.Msg"]; } -// MsgGrantResponse defines the Msg/MsgGrant response type. -message MsgGrantResponse {} +// MsgExecResponse defines the Msg/MsgExecResponse response type. +message MsgExecResponse { + repeated bytes results = 1; +} // MsgRevoke revokes any authorization with the provided sdk.Msg type on the // granter's account with that has been granted to the grantee. diff --git a/proto/cosmos/autocli/v1/options.proto b/proto/cosmos/autocli/v1/options.proto index b023490c9709..af9783a920f1 100644 --- a/proto/cosmos/autocli/v1/options.proto +++ b/proto/cosmos/autocli/v1/options.proto @@ -2,6 +2,8 @@ syntax = "proto3"; package cosmos.autocli.v1; +import "cosmos_proto/cosmos.proto"; + option go_package = "cosmossdk.io/api/cosmos/base/cli/v1;cliv1"; // ModuleOptions describes the CLI options for a Cosmos SDK module. @@ -15,7 +17,6 @@ message ModuleOptions { // ServiceCommandDescriptor describes a CLI command based on a protobuf service. message ServiceCommandDescriptor { - // service is the fully qualified name of the protobuf service to build // the command from. It can be left empty if sub_commands are used instead // which may be the case if a module provides multiple tx and/or query services. @@ -30,6 +31,14 @@ message ServiceCommandDescriptor { // different protobuf services. The map key is used as the name of the // sub-command. map sub_commands = 3; + + // enhance_custom_commands specifies whether to skip the service when generating commands, if a custom command already + // exists, or enhance the existing command. If set to true, the custom command will be enhanced with the services from + // gRPC. otherwise when a custom command exists, no commands will be generated for the service. + bool enhance_custom_command = 4; + + // short is an optional parameter used to override the short description of the auto generated command. + string short = 5; } // RpcCommandOptions specifies options for commands generated from protobuf @@ -81,6 +90,12 @@ message RpcCommandOptions { // skip specifies whether to skip this rpc method when generating commands. bool skip = 12; + + // gov_proposal specifies whether autocli should generate a gov proposal transaction for this rpc method. + // Normally autocli generates a transaction containing the message and broadcast it. + // However, when true, autocli generates a proposal transaction containing the message and broadcast it. + // This option is ineffective for query commands. + bool gov_proposal = 13 [(cosmos_proto.field_added_in) = "client/v2 v2.0.0-beta.2"]; } // FlagOptions are options for flags generated from rpc request fields. @@ -88,7 +103,6 @@ message RpcCommandOptions { // kebab-case name of the field. Fields can be turned into positional arguments // instead by using RpcCommandOptions.positional_args. message FlagOptions { - // name is an alternate name to use for the field flag. string name = 1; @@ -119,6 +133,10 @@ message PositionalArgDescriptor { // varargs makes a positional parameter a varargs parameter. This can only be // applied to last positional parameter and the proto_field must a repeated - // field. + // field. Note: It is mutually exclusive with optional. bool varargs = 2; + + // optional makes the last positional parameter optional. + // Note: It is mutually exclusive with varargs. + bool optional = 3; } diff --git a/proto/cosmos/bank/module/v1/module.proto b/proto/cosmos/bank/module/v1/module.proto index 51e3158b6860..d7d4a7fafdf7 100644 --- a/proto/cosmos/bank/module/v1/module.proto +++ b/proto/cosmos/bank/module/v1/module.proto @@ -10,11 +10,17 @@ message Module { go_import: "github.com/cosmos/cosmos-sdk/x/bank" }; - // blocked_module_accounts configures exceptional module accounts which should be blocked from receiving funds. - // If left empty it defaults to the list of account names supplied in the auth module configuration as + // blocked_module_accounts_override configures exceptional module accounts which should be blocked from receiving + // funds. If left empty it defaults to the list of account names supplied in the auth module configuration as // module_account_permissions repeated string blocked_module_accounts_override = 1; // authority defines the custom module authority. If not set, defaults to the governance module. string authority = 2; -} \ No newline at end of file + + // restrictions_order specifies the order of send restrictions and should be + // a list of module names which provide a send restriction instance. If no + // order is provided, then restrictions will be applied in alphabetical order + // of module names. + repeated string restrictions_order = 3; +} diff --git a/proto/cosmos/bank/v1beta1/query.proto b/proto/cosmos/bank/v1beta1/query.proto index 9aed76477799..d7161524107f 100644 --- a/proto/cosmos/bank/v1beta1/query.proto +++ b/proto/cosmos/bank/v1beta1/query.proto @@ -77,12 +77,6 @@ service Query { option (google.api.http).get = "/cosmos/bank/v1beta1/params"; } - // DenomsMetadata queries the client metadata of a given coin denomination. - rpc DenomMetadata(QueryDenomMetadataRequest) returns (QueryDenomMetadataResponse) { - option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata/{denom}"; - } - // DenomsMetadata queries the client metadata for all registered coin // denominations. rpc DenomsMetadata(QueryDenomsMetadataRequest) returns (QueryDenomsMetadataResponse) { @@ -90,6 +84,19 @@ service Query { option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata"; } + // DenomMetadata queries the client metadata of a given coin denomination. + rpc DenomMetadata(QueryDenomMetadataRequest) returns (QueryDenomMetadataResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata/{denom=**}"; + } + + // DenomMetadataByQueryString queries the client metadata of a given coin denomination. + rpc DenomMetadataByQueryString(QueryDenomMetadataByQueryStringRequest) + returns (QueryDenomMetadataByQueryStringResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata_by_query_string"; + } + // DenomOwners queries for all account addresses that own a particular token // denomination. // @@ -99,7 +106,16 @@ service Query { // Since: cosmos-sdk 0.46 rpc DenomOwners(QueryDenomOwnersRequest) returns (QueryDenomOwnersResponse) { option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/cosmos/bank/v1beta1/denom_owners/{denom}"; + option (google.api.http).get = "/cosmos/bank/v1beta1/denom_owners/{denom=**}"; + } + + // DenomOwnersByQuery queries for all account addresses that own a particular token + // denomination. + // + // Since: cosmos-sdk 0.50.3 + rpc DenomOwnersByQuery(QueryDenomOwnersByQueryRequest) returns (QueryDenomOwnersByQueryResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/denom_owners_by_query"; } // SendEnabled queries for SendEnabled entries. @@ -267,6 +283,7 @@ message QueryParamsRequest {} // QueryParamsResponse defines the response type for querying x/bank parameters. message QueryParamsResponse { + // params provides the parameters of the bank module. Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } @@ -299,6 +316,20 @@ message QueryDenomMetadataResponse { Metadata metadata = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } +// QueryDenomMetadataByQueryStringRequest is the request type for the Query/DenomMetadata RPC method. +// Identical with QueryDenomMetadataRequest but receives denom as query string. +message QueryDenomMetadataByQueryStringRequest { + // denom is the coin denom to query the metadata for. + string denom = 1; +} + +// QueryDenomMetadataByQueryStringResponse is the response type for the Query/DenomMetadata RPC +// method. Identical with QueryDenomMetadataResponse but receives denom as query string in request. +message QueryDenomMetadataByQueryStringResponse { + // metadata describes and provides all the client information for the requested token. + Metadata metadata = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + // QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, // which queries for a paginated set of all account holders of a particular // denomination. @@ -333,6 +364,29 @@ message QueryDenomOwnersResponse { cosmos.base.query.v1beta1.PageResponse pagination = 2; } +// QueryDenomOwnersByQueryRequest defines the request type for the DenomOwnersByQuery RPC query, +// which queries for a paginated set of all account holders of a particular +// denomination. +// +// Since: cosmos-sdk 0.50.3 +message QueryDenomOwnersByQueryRequest { + // denom defines the coin denomination to query all account holders for. + string denom = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryDenomOwnersByQueryResponse defines the RPC response of a DenomOwnersByQuery RPC query. +// +// Since: cosmos-sdk 0.50.3 +message QueryDenomOwnersByQueryResponse { + repeated DenomOwner denom_owners = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + // QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries. // // Since: cosmos-sdk 0.47 diff --git a/proto/cosmos/bank/v1beta1/tx.proto b/proto/cosmos/bank/v1beta1/tx.proto index c780be37866f..a4e8fae41f84 100644 --- a/proto/cosmos/bank/v1beta1/tx.proto +++ b/proto/cosmos/bank/v1beta1/tx.proto @@ -105,6 +105,7 @@ message MsgSetSendEnabled { option (cosmos.msg.v1.signer) = "authority"; option (amino.name) = "cosmos-sdk/MsgSetSendEnabled"; + // authority is the address that controls the module. string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // send_enabled is the list of entries to add or update. diff --git a/proto/cosmos/base/abci/v1beta1/abci.proto b/proto/cosmos/base/abci/v1beta1/abci.proto index fc3c0c6da503..9e3b4e55dbc7 100644 --- a/proto/cosmos/base/abci/v1beta1/abci.proto +++ b/proto/cosmos/base/abci/v1beta1/abci.proto @@ -27,10 +27,7 @@ message TxResponse { // non-deterministic. string raw_log = 6; // The output of the application's logger (typed). May be non-deterministic. - repeated ABCIMessageLog logs = 7 [ - (gogoproto.castrepeated) = "ABCIMessageLogs", - (gogoproto.nullable) = false - ]; + repeated ABCIMessageLog logs = 7 [(gogoproto.castrepeated) = "ABCIMessageLogs", (gogoproto.nullable) = false]; // Additional information. May be non-deterministic. string info = 8; // Amount of gas requested for transaction. @@ -61,8 +58,7 @@ message ABCIMessageLog { // Events contains a slice of Event objects that were emitted during some // execution. - repeated StringEvent events = 3 - [(gogoproto.castrepeated) = "StringEvents", (gogoproto.nullable) = false]; + repeated StringEvent events = 3 [(gogoproto.castrepeated) = "StringEvents", (gogoproto.nullable) = false]; } // StringEvent defines en Event object wrapper where all the attributes diff --git a/proto/cosmos/base/node/v1beta1/query.proto b/proto/cosmos/base/node/v1beta1/query.proto index 78fd9f6703a3..95df568f1175 100644 --- a/proto/cosmos/base/node/v1beta1/query.proto +++ b/proto/cosmos/base/node/v1beta1/query.proto @@ -24,10 +24,10 @@ message ConfigRequest {} // ConfigResponse defines the response structure for the Config gRPC query. message ConfigResponse { - string minimum_gas_price = 1; - // pruning settings + string minimum_gas_price = 1; string pruning_keep_recent = 2; string pruning_interval = 3; + uint64 halt_height = 4; } // StateRequest defines the request structure for the status of a node. @@ -35,9 +35,9 @@ message StatusRequest {} // StateResponse defines the response structure for the status of a node. message StatusResponse { - uint64 earliest_store_height = 1; // earliest block height available in the store - uint64 height = 2; // current block height - google.protobuf.Timestamp timestamp = 3 [(gogoproto.stdtime) = true]; // block height timestamp - bytes app_hash = 4; // app hash of the current block - bytes validator_hash = 5; // validator hash provided by the consensus header + uint64 earliest_store_height = 1; // earliest block height available in the store + uint64 height = 2; // current block height + google.protobuf.Timestamp timestamp = 3 [(gogoproto.stdtime) = true]; // block height timestamp + bytes app_hash = 4; // app hash of the current block + bytes validator_hash = 5; // validator hash provided by the consensus header } diff --git a/proto/cosmos/base/v1beta1/coin.proto b/proto/cosmos/base/v1beta1/coin.proto index 69c96f6771b6..1447d642d51f 100644 --- a/proto/cosmos/base/v1beta1/coin.proto +++ b/proto/cosmos/base/v1beta1/coin.proto @@ -19,7 +19,7 @@ message Coin { string denom = 1; string amount = 2 [ (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; @@ -33,16 +33,29 @@ message DecCoin { option (gogoproto.equal) = true; string denom = 1; - string amount = 2 - [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "Dec", (gogoproto.nullable) = false]; + string amount = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; } // IntProto defines a Protobuf wrapper around an Int object. +// Deprecated: Prefer to use math.Int directly. It supports binary Marshal and Unmarshal. message IntProto { - string int = 1 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "Int", (gogoproto.nullable) = false]; + string int = 1 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; } // DecProto defines a Protobuf wrapper around a Dec object. +// Deprecated: Prefer to use math.LegacyDec directly. It supports binary Marshal and Unmarshal. message DecProto { - string dec = 1 [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "Dec", (gogoproto.nullable) = false]; + string dec = 1 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; } diff --git a/proto/cosmos/circuit/v1/query.proto b/proto/cosmos/circuit/v1/query.proto index 1b952020d1f1..0115d335f439 100644 --- a/proto/cosmos/circuit/v1/query.proto +++ b/proto/cosmos/circuit/v1/query.proto @@ -8,7 +8,7 @@ import "cosmos/circuit/v1/types.proto"; import "google/api/annotations.proto"; import "cosmos/query/v1/query.proto"; -// Query defines the circuit Msg service. +// Query defines the circuit gRPC querier service. service Query { // Account returns account permissions. rpc Account(QueryAccountRequest) returns (AccountResponse) { diff --git a/proto/cosmos/circuit/v1/tx.proto b/proto/cosmos/circuit/v1/tx.proto index c0684316d04a..71f708bb2ad9 100644 --- a/proto/cosmos/circuit/v1/tx.proto +++ b/proto/cosmos/circuit/v1/tx.proto @@ -39,7 +39,7 @@ message MsgAuthorizeCircuitBreaker { Permissions permissions = 3; } -// MsgAuthorizeCircuitBreaker defines the Msg/AuthorizeCircuitBreaker response type. +// MsgAuthorizeCircuitBreakerResponse defines the Msg/AuthorizeCircuitBreaker response type. message MsgAuthorizeCircuitBreakerResponse { bool success = 1; } @@ -59,7 +59,7 @@ message MsgTripCircuitBreaker { repeated string msg_type_urls = 2; } -// MsgTripCircuitBreaker defines the Msg/TripCircuitBreaker response type. +// MsgTripCircuitBreakerResponse defines the Msg/TripCircuitBreaker response type. message MsgTripCircuitBreakerResponse { bool success = 1; } diff --git a/proto/cosmos/consensus/v1/query.proto b/proto/cosmos/consensus/v1/query.proto index cdcb07ba4100..84648d97c097 100644 --- a/proto/cosmos/consensus/v1/query.proto +++ b/proto/cosmos/consensus/v1/query.proto @@ -9,7 +9,7 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/consensus/types"; // Query defines the gRPC querier service. service Query { - // Params queries the parameters of x/consensus_param module. + // Params queries the parameters of x/consensus module. rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { option (google.api.http).get = "/cosmos/consensus/v1/params"; } diff --git a/proto/cosmos/consensus/v1/tx.proto b/proto/cosmos/consensus/v1/tx.proto index 2f798528858d..4323de703a5e 100644 --- a/proto/cosmos/consensus/v1/tx.proto +++ b/proto/cosmos/consensus/v1/tx.proto @@ -9,11 +9,11 @@ import "tendermint/types/params.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/consensus/types"; -// Msg defines the bank Msg service. +// Msg defines the consensus Msg service. service Msg { option (cosmos.msg.v1.service) = true; - // UpdateParams defines a governance operation for updating the x/consensus_param module parameters. + // UpdateParams defines a governance operation for updating the x/consensus module parameters. // The authority is defined in the keeper. // // Since: cosmos-sdk 0.47 @@ -23,7 +23,7 @@ service Msg { // MsgUpdateParams is the Msg/UpdateParams request type. message MsgUpdateParams { option (cosmos.msg.v1.signer) = "authority"; - option (amino.name) = "cosmos-sdk/x/consensus/MsgUpdateParams"; + option (amino.name) = "cosmos-sdk/x/consensus/MsgUpdateParams"; // authority is the address that controls the module (defaults to x/gov unless overwritten). string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; @@ -36,6 +36,9 @@ message MsgUpdateParams { tendermint.types.BlockParams block = 2; tendermint.types.EvidenceParams evidence = 3; tendermint.types.ValidatorParams validator = 4; + + // Since: cosmos-sdk 0.50 + tendermint.types.ABCIParams abci = 5; } // MsgUpdateParamsResponse defines the response structure for executing a diff --git a/proto/cosmos/counter/module/v1/module.proto b/proto/cosmos/counter/module/v1/module.proto new file mode 100644 index 000000000000..7c0fa4055d11 --- /dev/null +++ b/proto/cosmos/counter/module/v1/module.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +package cosmos.counter.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/testutil/x/counter/types"; + +// Module is the config object of the counter module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/testutil/x/counter" + }; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 1; +} diff --git a/proto/cosmos/counter/v1/query.proto b/proto/cosmos/counter/v1/query.proto new file mode 100644 index 000000000000..d8151da08359 --- /dev/null +++ b/proto/cosmos/counter/v1/query.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; +package cosmos.counter.v1; + +option go_package = "github.com/cosmos/cosmos-sdk/testutil/x/counter/types"; + +// Query defines the gRPC querier service. +service Query { + // GetCount queries the parameters of x/Counter module. + rpc GetCount(QueryGetCountRequest) returns (QueryGetCountResponse); +} + +// QueryGetCountRequest defines the request type for querying x/mock count. +message QueryGetCountRequest {} + +// QueryGetCountResponse defines the response type for querying x/mock count. +message QueryGetCountResponse { + int64 total_count = 1; +} diff --git a/proto/cosmos/counter/v1/tx.proto b/proto/cosmos/counter/v1/tx.proto new file mode 100644 index 000000000000..771d683cee0e --- /dev/null +++ b/proto/cosmos/counter/v1/tx.proto @@ -0,0 +1,35 @@ + +syntax = "proto3"; +package cosmos.counter.v1; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/testutil/x/counter/types"; + +// Msg defines the counter Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // IncreaseCount increments the counter by the specified amount. + rpc IncreaseCount(MsgIncreaseCounter) returns (MsgIncreaseCountResponse); +} + +// MsgIncreaseCounter defines a count Msg service counter. +message MsgIncreaseCounter { + option (amino.name) = "cosmos-sdk/increase_counter"; // TODO: remove amino + option (cosmos.msg.v1.signer) = "signer"; + + // signer is the address that controls the module (defaults to x/gov unless overwritten). + string signer = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // count is the number of times to increment the counter. + int64 count = 2; +} + +// MsgIncreaseCountResponse is the Msg/Counter response type. +message MsgIncreaseCountResponse { + // new_count is the number of times the counter was incremented. + int64 new_count = 1; +} diff --git a/proto/cosmos/distribution/v1beta1/distribution.proto b/proto/cosmos/distribution/v1beta1/distribution.proto index 34c6e774abd1..0c20286f9a09 100644 --- a/proto/cosmos/distribution/v1beta1/distribution.proto +++ b/proto/cosmos/distribution/v1beta1/distribution.proto @@ -15,7 +15,7 @@ message Params { string community_tax = 1 [ (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (amino.dont_omitempty) = true, (gogoproto.nullable) = false ]; @@ -24,7 +24,7 @@ message Params { // in the x/distribution module's reward mechanism. string base_proposer_reward = 2 [ (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (amino.dont_omitempty) = true, deprecated = true @@ -34,7 +34,7 @@ message Params { // in the x/distribution module's reward mechanism. string bonus_proposer_reward = 3 [ (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (amino.dont_omitempty) = true, deprecated = true @@ -104,7 +104,7 @@ message ValidatorSlashEvent { uint64 validator_period = 1; string fraction = 2 [ (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; } @@ -158,7 +158,7 @@ message DelegatorStartingInfo { uint64 previous_period = 1; string stake = 2 [ (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; diff --git a/proto/cosmos/distribution/v1beta1/tx.proto b/proto/cosmos/distribution/v1beta1/tx.proto index fc14c5e10c53..32318bd81219 100644 --- a/proto/cosmos/distribution/v1beta1/tx.proto +++ b/proto/cosmos/distribution/v1beta1/tx.proto @@ -192,14 +192,14 @@ message MsgCommunityPoolSpendResponse {} // // Since: cosmos-sdk 0.50 message MsgDepositValidatorRewardsPool { - option (amino.name) = "cosmos-sdk/distr/MsgDepositValRewards"; + option (amino.name) = "cosmos-sdk/distr/MsgDepositValRewards"; option (cosmos.msg.v1.signer) = "depositor"; option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - string depositor = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; + string depositor = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; repeated cosmos.base.v1beta1.Coin amount = 3 [ (gogoproto.nullable) = false, (amino.encoding) = "legacy_coins", diff --git a/proto/cosmos/epochs/module/v1/module.proto b/proto/cosmos/epochs/module/v1/module.proto new file mode 100644 index 000000000000..a21b9f36be38 --- /dev/null +++ b/proto/cosmos/epochs/module/v1/module.proto @@ -0,0 +1,13 @@ +// Since: cosmos-sdk 0.53 +syntax = "proto3"; + +package cosmos.epochs.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the epochs module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/epochs" + }; +} \ No newline at end of file diff --git a/proto/cosmos/epochs/v1beta1/events.proto b/proto/cosmos/epochs/v1beta1/events.proto new file mode 100644 index 000000000000..2b37f204fb3c --- /dev/null +++ b/proto/cosmos/epochs/v1beta1/events.proto @@ -0,0 +1,17 @@ +// Since: cosmos-sdk 0.53 +syntax = "proto3"; + +package cosmos.epochs.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/epochs/types"; + +// EventEpochEnd is an event emitted when an epoch end. +message EventEpochEnd { + int64 epoch_number = 1; +} + +// EventEpochStart is an event emitted when an epoch start. +message EventEpochStart { + int64 epoch_number = 1; + int64 epoch_start_time = 2; +} diff --git a/proto/cosmos/epochs/v1beta1/genesis.proto b/proto/cosmos/epochs/v1beta1/genesis.proto new file mode 100644 index 000000000000..e274ac73e578 --- /dev/null +++ b/proto/cosmos/epochs/v1beta1/genesis.proto @@ -0,0 +1,61 @@ +// Since: cosmos-sdk 0.53 +syntax = "proto3"; +package cosmos.epochs.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/epochs/types"; + +// EpochInfo is a struct that describes the data going into +// a timer defined by the x/epochs module. +message EpochInfo { + // identifier is a unique reference to this particular timer. + string identifier = 1; + // start_time is the time at which the timer first ever ticks. + // If start_time is in the future, the epoch will not begin until the start + // time. + google.protobuf.Timestamp start_time = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + // duration is the time in between epoch ticks. + // In order for intended behavior to be met, duration should + // be greater than the chains expected block time. + // Duration must be non-zero. + google.protobuf.Duration duration = 3 + [(gogoproto.nullable) = false, (gogoproto.stdduration) = true, (gogoproto.jsontag) = "duration,omitempty"]; + // current_epoch is the current epoch number, or in other words, + // how many times has the timer 'ticked'. + // The first tick (current_epoch=1) is defined as + // the first block whose blocktime is greater than the EpochInfo start_time. + int64 current_epoch = 4; + // current_epoch_start_time describes the start time of the current timer + // interval. The interval is (current_epoch_start_time, + // current_epoch_start_time + duration] When the timer ticks, this is set to + // current_epoch_start_time = last_epoch_start_time + duration only one timer + // tick for a given identifier can occur per block. + // + // NOTE! The current_epoch_start_time may diverge significantly from the + // wall-clock time the epoch began at. Wall-clock time of epoch start may be + // >> current_epoch_start_time. Suppose current_epoch_start_time = 10, + // duration = 5. Suppose the chain goes offline at t=14, and comes back online + // at t=30, and produces blocks at every successive time. (t=31, 32, etc.) + // * The t=30 block will start the epoch for (10, 15] + // * The t=31 block will start the epoch for (15, 20] + // * The t=32 block will start the epoch for (20, 25] + // * The t=33 block will start the epoch for (25, 30] + // * The t=34 block will start the epoch for (30, 35] + // * The **t=36** block will start the epoch for (35, 40] + google.protobuf.Timestamp current_epoch_start_time = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + // epoch_counting_started is a boolean, that indicates whether this + // epoch timer has began yet. + bool epoch_counting_started = 6; + reserved 7; + // current_epoch_start_height is the block height at which the current epoch + // started. (The block height at which the timer last ticked) + int64 current_epoch_start_height = 8; +} + +// GenesisState defines the epochs module's genesis state. +message GenesisState { + repeated EpochInfo epochs = 1 [(gogoproto.nullable) = false]; +} diff --git a/proto/cosmos/epochs/v1beta1/query.proto b/proto/cosmos/epochs/v1beta1/query.proto new file mode 100644 index 000000000000..52f846fd9824 --- /dev/null +++ b/proto/cosmos/epochs/v1beta1/query.proto @@ -0,0 +1,43 @@ +// Since: cosmos-sdk 0.53 +syntax = "proto3"; +package cosmos.epochs.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/epochs/v1beta1/genesis.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/epochs/types"; + +// Query defines the gRPC querier service. +service Query { + // EpochInfos provide running epochInfos + rpc EpochInfos(QueryEpochInfosRequest) returns (QueryEpochInfosResponse) { + option (google.api.http).get = "/cosmos/epochs/v1beta1/epochs"; + } + // CurrentEpoch provide current epoch of specified identifier + rpc CurrentEpoch(QueryCurrentEpochRequest) returns (QueryCurrentEpochResponse) { + option (google.api.http).get = "/cosmos/epochs/v1beta1/current_epoch"; + } +} + +// QueryEpochInfosRequest defines the gRPC request structure for +// querying all epoch info. +message QueryEpochInfosRequest {} + +// QueryEpochInfosRequest defines the gRPC response structure for +// querying all epoch info. +message QueryEpochInfosResponse { + repeated EpochInfo epochs = 1 [(gogoproto.nullable) = false]; +} + +// QueryCurrentEpochRequest defines the gRPC request structure for +// querying an epoch by its identifier. +message QueryCurrentEpochRequest { + string identifier = 1; +} + +// QueryCurrentEpochResponse defines the gRPC response structure for +// querying an epoch by its identifier. +message QueryCurrentEpochResponse { + int64 current_epoch = 1; +} \ No newline at end of file diff --git a/proto/cosmos/feegrant/v1beta1/query.proto b/proto/cosmos/feegrant/v1beta1/query.proto index cc0b969c55de..591537acd9ef 100644 --- a/proto/cosmos/feegrant/v1beta1/query.proto +++ b/proto/cosmos/feegrant/v1beta1/query.proto @@ -12,12 +12,12 @@ option go_package = "cosmossdk.io/x/feegrant"; // Query defines the gRPC querier service. service Query { - // Allowance returns fee granted to the grantee by the granter. + // Allowance returns granted allwance to the grantee by the granter. rpc Allowance(QueryAllowanceRequest) returns (QueryAllowanceResponse) { option (google.api.http).get = "/cosmos/feegrant/v1beta1/allowance/{granter}/{grantee}"; } - // Allowances returns all the grants for address. + // Allowances returns all the grants for the given grantee address. rpc Allowances(QueryAllowancesRequest) returns (QueryAllowancesResponse) { option (google.api.http).get = "/cosmos/feegrant/v1beta1/allowances/{grantee}"; } diff --git a/proto/cosmos/feegrant/v1beta1/tx.proto b/proto/cosmos/feegrant/v1beta1/tx.proto index 37e505c4e9a2..a45eec3ba368 100644 --- a/proto/cosmos/feegrant/v1beta1/tx.proto +++ b/proto/cosmos/feegrant/v1beta1/tx.proto @@ -20,6 +20,11 @@ service Msg { // RevokeAllowance revokes any fee allowance of granter's account that // has been granted to the grantee. rpc RevokeAllowance(MsgRevokeAllowance) returns (MsgRevokeAllowanceResponse); + + // PruneAllowances prunes expired fee allowances, currently up to 75 at a time. + // + // Since cosmos-sdk 0.50 + rpc PruneAllowances(MsgPruneAllowances) returns (MsgPruneAllowancesResponse); } // MsgGrantAllowance adds permission for Grantee to spend up to Allowance @@ -55,3 +60,18 @@ message MsgRevokeAllowance { // MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. message MsgRevokeAllowanceResponse {} + +// MsgPruneAllowances prunes expired fee allowances. +// +// Since cosmos-sdk 0.50 +message MsgPruneAllowances { + option (cosmos.msg.v1.signer) = "pruner"; + + // pruner is the address of the user pruning expired allowances. + string pruner = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgPruneAllowancesResponse defines the Msg/PruneAllowancesResponse response type. +// +// Since cosmos-sdk 0.50 +message MsgPruneAllowancesResponse {} \ No newline at end of file diff --git a/proto/cosmos/gov/v1/gov.proto b/proto/cosmos/gov/v1/gov.proto index 9edd903b982c..0ebfbc1d1f0f 100644 --- a/proto/cosmos/gov/v1/gov.proto +++ b/proto/cosmos/gov/v1/gov.proto @@ -80,7 +80,8 @@ message Proposal { google.protobuf.Timestamp voting_end_time = 9 [(gogoproto.stdtime) = true]; // metadata is any arbitrary metadata attached to the proposal. - // the recommended format of the metadata is to be found here: https://docs.cosmos.network/v0.47/modules/gov#proposal-3 + // the recommended format of the metadata is to be found here: + // https://docs.cosmos.network/v0.47/modules/gov#proposal-3 string metadata = 10; // title is the title of the proposal @@ -102,6 +103,11 @@ message Proposal { // // Since: cosmos-sdk 0.50 bool expedited = 14; + + // failed_reason defines the reason why the proposal failed + // + // Since: cosmos-sdk 0.50 + string failed_reason = 15; } // ProposalStatus enumerates the valid statuses of a proposal. @@ -151,7 +157,7 @@ message Vote { // options is the weighted vote options. repeated WeightedVoteOption options = 4; - // metadata is any arbitrary metadata to attached to the vote. + // metadata is any arbitrary metadata attached to the vote. // the recommended format of the metadata is to be found here: https://docs.cosmos.network/v0.47/modules/gov#vote-5 string metadata = 5; } @@ -244,14 +250,22 @@ message Params { string expedited_threshold = 11 [(cosmos_proto.scalar) = "cosmos.Dec"]; // Minimum expedited deposit for a proposal to enter voting period. - repeated cosmos.base.v1beta1.Coin expedited_min_deposit = 12 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + repeated cosmos.base.v1beta1.Coin expedited_min_deposit = 12 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // burn deposits if a proposal does not meet quorum bool burn_vote_quorum = 13; - + // burn deposits if the proposal does not enter voting period bool burn_proposal_deposit_prevote = 14; - + // burn deposits if quorum with vote type no_veto is met bool burn_vote_veto = 15; + + // The ratio representing the proportion of the deposit value minimum that must be met when making a deposit. + // Default value: 0.01. Meaning that for a chain with a min_deposit of 100stake, a deposit of 1stake would be + // required. + // + // Since: cosmos-sdk 0.50 + string min_deposit_ratio = 16 [(cosmos_proto.scalar) = "cosmos.Dec"]; } diff --git a/proto/cosmos/gov/v1/query.proto b/proto/cosmos/gov/v1/query.proto index ce308c7db24c..006d12fd6148 100644 --- a/proto/cosmos/gov/v1/query.proto +++ b/proto/cosmos/gov/v1/query.proto @@ -1,4 +1,3 @@ - // Since: cosmos-sdk 0.46 syntax = "proto3"; package cosmos.gov.v1; @@ -42,7 +41,7 @@ service Query { option (google.api.http).get = "/cosmos/gov/v1/params/{params_type}"; } - // Deposit queries single deposit information based proposalID, depositAddr. + // Deposit queries single deposit information based on proposalID, depositAddr. rpc Deposit(QueryDepositRequest) returns (QueryDepositResponse) { option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/deposits/{depositor}"; } diff --git a/proto/cosmos/gov/v1/tx.proto b/proto/cosmos/gov/v1/tx.proto index 57a062602b6d..21920a5ffcf0 100644 --- a/proto/cosmos/gov/v1/tx.proto +++ b/proto/cosmos/gov/v1/tx.proto @@ -56,10 +56,10 @@ message MsgSubmitProposal { // initial_deposit is the deposit value that must be paid at proposal submission. repeated cosmos.base.v1beta1.Coin initial_deposit = 2 [ - (gogoproto.nullable) = false, + (gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (amino.dont_omitempty) = true, - (amino.encoding) = "legacy_coins" + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins" ]; // proposer is the account address of the proposer. @@ -78,7 +78,7 @@ message MsgSubmitProposal { // Since: cosmos-sdk 0.47 string summary = 6; - // expedided defines if the proposal is expedited or not + // expedited defines if the proposal is expedited or not // // Since: cosmos-sdk 0.50 bool expedited = 7; @@ -193,8 +193,10 @@ message MsgUpdateParamsResponse {} message MsgCancelProposal { option (cosmos.msg.v1.signer) = "proposer"; + // proposal_id defines the unique id of the proposal. uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"]; - string proposer = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // proposer is the account address of the proposer. + string proposer = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } // MsgCancelProposalResponse defines the response structure for executing a @@ -202,6 +204,7 @@ message MsgCancelProposal { // // Since: cosmos-sdk 0.50 message MsgCancelProposalResponse { + // proposal_id defines the unique id of the proposal. uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"]; // canceled_time is the time when proposal is canceled. google.protobuf.Timestamp canceled_time = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; diff --git a/proto/cosmos/gov/v1beta1/genesis.proto b/proto/cosmos/gov/v1beta1/genesis.proto index a680590ca565..f0c679a31870 100644 --- a/proto/cosmos/gov/v1beta1/genesis.proto +++ b/proto/cosmos/gov/v1beta1/genesis.proto @@ -21,10 +21,10 @@ message GenesisState { // proposals defines all the proposals present at genesis. repeated Proposal proposals = 4 [(gogoproto.castrepeated) = "Proposals", (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - // params defines all the parameters of related to deposit. + // deposit_params defines all the parameters related to deposit. DepositParams deposit_params = 5 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - // params defines all the parameters of related to voting. + // voting_params defines all the parameters related to voting. VotingParams voting_params = 6 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - // params defines all the parameters of related to tally. + // tally_params defines all the parameters related to tally. TallyParams tally_params = 7 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } diff --git a/proto/cosmos/gov/v1beta1/gov.proto b/proto/cosmos/gov/v1beta1/gov.proto index 37b4e8b2ce3e..99b97191c164 100644 --- a/proto/cosmos/gov/v1beta1/gov.proto +++ b/proto/cosmos/gov/v1beta1/gov.proto @@ -39,7 +39,7 @@ message WeightedVoteOption { // weight is the vote weight associated with the vote option. string weight = 2 [ (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (amino.dont_omitempty) = true, (gogoproto.nullable) = false ]; @@ -152,28 +152,28 @@ message TallyResult { // yes is the number of yes votes on a proposal. string yes = 1 [ (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; // abstain is the number of abstain votes on a proposal. string abstain = 2 [ (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; // no is the number of no votes on a proposal. string no = 3 [ (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; // no_with_veto is the number of no with veto votes on a proposal. string no_with_veto = 4 [ (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; } @@ -229,14 +229,16 @@ message TallyParams { // Minimum percentage of total stake needed to vote for a result to be // considered valid. bytes quorum = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.jsontag) = "quorum,omitempty" ]; // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. bytes threshold = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.jsontag) = "threshold,omitempty" ]; @@ -244,7 +246,8 @@ message TallyParams { // Minimum value of Veto votes to Total votes ratio for proposal to be // vetoed. Default value: 1/3. bytes veto_threshold = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.jsontag) = "veto_threshold,omitempty" ]; diff --git a/proto/cosmos/gov/v1beta1/query.proto b/proto/cosmos/gov/v1beta1/query.proto index f225a0f65059..28352ed40c06 100644 --- a/proto/cosmos/gov/v1beta1/query.proto +++ b/proto/cosmos/gov/v1beta1/query.proto @@ -37,7 +37,7 @@ service Query { option (google.api.http).get = "/cosmos/gov/v1beta1/params/{params_type}"; } - // Deposit queries single deposit information based proposalID, depositAddr. + // Deposit queries single deposit information based on proposalID, depositor address. rpc Deposit(QueryDepositRequest) returns (QueryDepositResponse) { option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}"; } diff --git a/proto/cosmos/gov/v1beta1/tx.proto b/proto/cosmos/gov/v1beta1/tx.proto index 24795ab3b405..9de763be360b 100644 --- a/proto/cosmos/gov/v1beta1/tx.proto +++ b/proto/cosmos/gov/v1beta1/tx.proto @@ -11,7 +11,7 @@ import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"; -// Msg defines the bank Msg service. +// Msg defines the gov Msg service. service Msg { option (cosmos.msg.v1.service) = true; diff --git a/proto/cosmos/group/v1/events.proto b/proto/cosmos/group/v1/events.proto index 2b98ec9abc32..754afa5dac3c 100644 --- a/proto/cosmos/group/v1/events.proto +++ b/proto/cosmos/group/v1/events.proto @@ -92,3 +92,13 @@ message EventProposalPruned { // tally_result is the proposal tally result (when applicable). TallyResult tally_result = 3; } + +// EventTallyError is an event emitted when a proposal tally failed with an error. +message EventTallyError { + + // proposal_id is the unique ID of the proposal. + uint64 proposal_id = 1; + + // error_message is the raw error output + string error_message = 2; +} diff --git a/proto/cosmos/mint/v1beta1/mint.proto b/proto/cosmos/mint/v1beta1/mint.proto index 28840255fbf2..440a392dbd87 100644 --- a/proto/cosmos/mint/v1beta1/mint.proto +++ b/proto/cosmos/mint/v1beta1/mint.proto @@ -12,13 +12,13 @@ message Minter { // current annual inflation rate string inflation = 1 [ (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // current annual expected provisions string annual_provisions = 2 [ (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; } @@ -32,28 +32,28 @@ message Params { // maximum annual change in inflation rate string inflation_rate_change = 2 [ (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; // maximum inflation rate string inflation_max = 3 [ (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; // minimum inflation rate string inflation_min = 4 [ (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; // goal of percent bonded atoms string goal_bonded = 5 [ (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; diff --git a/proto/cosmos/mint/v1beta1/query.proto b/proto/cosmos/mint/v1beta1/query.proto index 002f2744c2cb..db5c90fb31c4 100644 --- a/proto/cosmos/mint/v1beta1/query.proto +++ b/proto/cosmos/mint/v1beta1/query.proto @@ -5,6 +5,7 @@ import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "cosmos/mint/v1beta1/mint.proto"; import "amino/amino.proto"; +import "cosmos_proto/cosmos.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types"; @@ -43,7 +44,8 @@ message QueryInflationRequest {} message QueryInflationResponse { // inflation is the current minting inflation value. bytes inflation = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; @@ -58,7 +60,8 @@ message QueryAnnualProvisionsRequest {} message QueryAnnualProvisionsResponse { // annual_provisions is the current minting annual provisions value. bytes annual_provisions = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; diff --git a/proto/cosmos/orm/module/v1alpha1/module.proto b/proto/cosmos/orm/module/v1alpha1/module.proto deleted file mode 100644 index 260db3699745..000000000000 --- a/proto/cosmos/orm/module/v1alpha1/module.proto +++ /dev/null @@ -1,14 +0,0 @@ -syntax = "proto3"; - -package cosmos.orm.module.v1alpha1; - -import "cosmos/app/v1alpha1/module.proto"; - -// Module defines the ORM module which adds providers to the app container for -// ORM ModuleDB's and in the future will automatically register query -// services for modules that use the ORM. -message Module { - option (cosmos.app.v1alpha1.module) = { - go_import: "cosmossdk.io/orm" - }; -} diff --git a/proto/cosmos/orm/query/v1alpha1/query.proto b/proto/cosmos/orm/query/v1alpha1/query.proto deleted file mode 100644 index 4500e99d5dc6..000000000000 --- a/proto/cosmos/orm/query/v1alpha1/query.proto +++ /dev/null @@ -1,131 +0,0 @@ -syntax = "proto3"; - -package cosmos.orm.query.v1alpha1; - -import "google/protobuf/timestamp.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/any.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; - -// Query is a generic gRPC service for querying ORM data. -service Query { - - // Get queries an ORM table against an unique index. - rpc Get(GetRequest) returns (GetResponse); - - // List queries an ORM table against an index. - rpc List(ListRequest) returns (ListResponse); -} - -// GetRequest is the Query/Get request type. -message GetRequest { - // message_name is the fully-qualified message name of the ORM table being queried. - string message_name = 1; - - // index is the index fields expression used in orm definitions. If it - // is empty, the table's primary key is assumed. If it is non-empty, it must - // refer to an unique index. - string index = 2; - - // values are the values of the fields corresponding to the requested index. - // There must be as many values provided as there are fields in the index and - // these values must correspond to the index field types. - repeated IndexValue values = 3; -} - -// GetResponse is the Query/Get response type. -message GetResponse { - - // result is the result of the get query. If no value is found, the gRPC - // status code NOT_FOUND will be returned. - google.protobuf.Any result = 1; -} - -// ListRequest is the Query/List request type. -message ListRequest { - // message_name is the fully-qualified message name of the ORM table being queried. - string message_name = 1; - - // index is the index fields expression used in orm definitions. If it - // is empty, the table's primary key is assumed. - string index = 2; - - // query is the query expression corresponding to the provided index. If - // neither prefix nor range is specified, the query will list all the fields - // in the index. - oneof query { - - // prefix defines a prefix query. - Prefix prefix = 3; - - // range defines a range query. - Range range = 4; - } - - // pagination is the pagination request. - cosmos.base.query.v1beta1.PageRequest pagination = 5; - - // Prefix specifies the arguments to a prefix query. - message Prefix { - // values specifies the index values for the prefix query. - // It is valid to special a partial prefix with fewer values than - // the number of fields in the index. - repeated IndexValue values = 1; - } - - // Range specifies the arguments to a range query. - message Range { - // start specifies the starting index values for the range query. - // It is valid to provide fewer values than the number of fields in the - // index. - repeated IndexValue start = 1; - - // end specifies the inclusive ending index values for the range query. - // It is valid to provide fewer values than the number of fields in the - // index. - repeated IndexValue end = 2; - } -} - -// ListResponse is the Query/List response type. -message ListResponse { - - // results are the results of the query. - repeated google.protobuf.Any results = 1; - - // pagination is the pagination response. - cosmos.base.query.v1beta1.PageResponse pagination = 5; -} - -// IndexValue represents the value of a field in an ORM index expression. -message IndexValue { - - // value specifies the index value - oneof value { - // uint specifies a value for an uint32, fixed32, uint64, or fixed64 - // index field. - uint64 uint = 1; - - // int64 specifies a value for an int32, sfixed32, int64, or sfixed64 - // index field. - int64 int = 2; - - // str specifies a value for a string index field. - string str = 3; - - // bytes specifies a value for a bytes index field. - bytes bytes = 4; - - // enum specifies a value for an enum index field. - string enum = 5; - - // bool specifies a value for a bool index field. - bool bool = 6; - - // timestamp specifies a value for a timestamp index field. - google.protobuf.Timestamp timestamp = 7; - - // duration specifies a value for a duration index field. - google.protobuf.Duration duration = 8; - } -} diff --git a/proto/cosmos/orm/v1/orm.proto b/proto/cosmos/orm/v1/orm.proto deleted file mode 100644 index e8509392b8a1..000000000000 --- a/proto/cosmos/orm/v1/orm.proto +++ /dev/null @@ -1,107 +0,0 @@ -syntax = "proto3"; - -package cosmos.orm.v1; - -import "google/protobuf/descriptor.proto"; - -extend google.protobuf.MessageOptions { - - // table specifies that this message will be used as an ORM table. It cannot - // be used together with the singleton option. - TableDescriptor table = 104503790; - - // singleton specifies that this message will be used as an ORM singleton. It cannot - // be used together with the table option. - SingletonDescriptor singleton = 104503791; -} - -// TableDescriptor describes an ORM table. -message TableDescriptor { - - // primary_key defines the primary key for the table. - PrimaryKeyDescriptor primary_key = 1; - - // index defines one or more secondary indexes. - repeated SecondaryIndexDescriptor index = 2; - - // id is a non-zero integer ID that must be unique within the - // tables and singletons in this file. It may be deprecated in the future when this - // can be auto-generated. - uint32 id = 3; -} - -// PrimaryKeyDescriptor describes a table primary key. -message PrimaryKeyDescriptor { - - // fields is a comma-separated list of fields in the primary key. Spaces are - // not allowed. Supported field types, their encodings, and any applicable constraints - // are described below. - // - uint32 are encoded as 2,3,4 or 5 bytes using a compact encoding that - // is suitable for sorted iteration (not varint encoding). This type is - // well-suited for small integers. - // - uint64 are encoded as 2,4,6 or 9 bytes using a compact encoding that - // is suitable for sorted iteration (not varint encoding). This type is - // well-suited for small integers such as auto-incrementing sequences. - // - fixed32, fixed64 are encoded as big-endian fixed width bytes and support - // sorted iteration. These types are well-suited for encoding fixed with - // decimals as integers. - // - string's are encoded as raw bytes in terminal key segments and null-terminated - // in non-terminal segments. Null characters are thus forbidden in strings. - // string fields support sorted iteration. - // - bytes are encoded as raw bytes in terminal segments and length-prefixed - // with a 32-bit unsigned varint in non-terminal segments. - // - int32, sint32, int64, sint64, sfixed32, sfixed64 are encoded as fixed width bytes with - // an encoding that enables sorted iteration. - // - google.protobuf.Timestamp is encoded such that values with only seconds occupy 6 bytes, - // values including nanos occupy 9 bytes, and nil values occupy 1 byte. When iterating, nil - // values will always be ordered last. Seconds and nanos values must conform to the officially - // specified ranges of 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z and 0 to 999,999,999 respectively. - // - google.protobuf.Duration is encoded as 12 bytes using an encoding that enables sorted iteration. - // - enum fields are encoded using varint encoding and do not support sorted - // iteration. - // - bool fields are encoded as a single byte 0 or 1. - // - // All other fields types are unsupported in keys including repeated and - // oneof fields. - // - // Primary keys are prefixed by the varint encoded table id and the byte 0x0 - // plus any additional prefix specified by the schema. - string fields = 1; - - // auto_increment specifies that the primary key is generated by an - // auto-incrementing integer. If this is set to true fields must only - // contain one field of that is of type uint64. - bool auto_increment = 2; -} - -// PrimaryKeyDescriptor describes a table secondary index. -message SecondaryIndexDescriptor { - - // fields is a comma-separated list of fields in the index. The supported - // field types are the same as those for PrimaryKeyDescriptor.fields. - // Index keys are prefixed by the varint encoded table id and the varint - // encoded index id plus any additional prefix specified by the schema. - // - // In addition the field segments, non-unique index keys are suffixed with - // any additional primary key fields not present in the index fields so that the - // primary key can be reconstructed. Unique indexes instead of being suffixed - // store the remaining primary key fields in the value.. - string fields = 1; - - // id is a non-zero integer ID that must be unique within the indexes for this - // table and less than 32768. It may be deprecated in the future when this can - // be auto-generated. - uint32 id = 2; - - // unique specifies that this an unique index. - bool unique = 3; -} - -// TableDescriptor describes an ORM singleton table which has at most one instance. -message SingletonDescriptor { - - // id is a non-zero integer ID that must be unique within the - // tables and singletons in this file. It may be deprecated in the future when this - // can be auto-generated. - uint32 id = 1; -} \ No newline at end of file diff --git a/proto/cosmos/orm/v1alpha1/schema.proto b/proto/cosmos/orm/v1alpha1/schema.proto deleted file mode 100644 index cbe90de3d3ef..000000000000 --- a/proto/cosmos/orm/v1alpha1/schema.proto +++ /dev/null @@ -1,58 +0,0 @@ -syntax = "proto3"; - -package cosmos.orm.v1alpha1; - -import "google/protobuf/descriptor.proto"; - -extend google.protobuf.MessageOptions { - // module_schema is used to define the ORM schema for an app module. - // All module config messages that use module_schema must also declare - // themselves as app module config messages using the cosmos.app.v1.is_module - // option. - ModuleSchemaDescriptor module_schema = 104503792; -} - -// ModuleSchemaDescriptor describe's a module's ORM schema. -message ModuleSchemaDescriptor { - repeated FileEntry schema_file = 1; - - // FileEntry describes an ORM file used in a module. - message FileEntry { - // id is a prefix that will be varint encoded and prepended to all the - // table keys specified in the file's tables. - uint32 id = 1; - - // proto_file_name is the name of a file .proto in that contains - // table definitions. The .proto file must be in a package that the - // module has referenced using cosmos.app.v1.ModuleDescriptor.use_package. - string proto_file_name = 2; - - // storage_type optionally indicates the type of storage this file's - // tables should used. If it is left unspecified, the default KV-storage - // of the app will be used. - StorageType storage_type = 3; - } - - // prefix is an optional prefix that precedes all keys in this module's - // store. - bytes prefix = 2; -} - -// StorageType -enum StorageType { - // STORAGE_TYPE_DEFAULT_UNSPECIFIED indicates the persistent storage where all - // data is stored in the regular Merkle-tree backed KV-store. - STORAGE_TYPE_DEFAULT_UNSPECIFIED = 0; - - // STORAGE_TYPE_MEMORY indicates in-memory storage that will be - // reloaded every time an app restarts. Tables with this type of storage - // will by default be ignored when importing and exporting a module's - // state from JSON. - STORAGE_TYPE_MEMORY = 1; - - // STORAGE_TYPE_TRANSIENT indicates transient storage that is reset - // at the end of every block. Tables with this type of storage - // will by default be ignored when importing and exporting a module's - // state from JSON. - STORAGE_TYPE_TRANSIENT = 2; -} diff --git a/proto/cosmos/slashing/v1beta1/query.proto b/proto/cosmos/slashing/v1beta1/query.proto index 761e1a4b86c7..e7279709edeb 100644 --- a/proto/cosmos/slashing/v1beta1/query.proto +++ b/proto/cosmos/slashing/v1beta1/query.proto @@ -40,7 +40,7 @@ message QueryParamsResponse { // method message QuerySigningInfoRequest { // cons_address is the address to query signing info of - string cons_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string cons_address = 1 [(cosmos_proto.scalar) = "cosmos.ConsensusAddressString"]; } // QuerySigningInfoResponse is the response type for the Query/SigningInfo RPC diff --git a/proto/cosmos/slashing/v1beta1/slashing.proto b/proto/cosmos/slashing/v1beta1/slashing.proto index 11c3d784cf19..2347f34973cc 100644 --- a/proto/cosmos/slashing/v1beta1/slashing.proto +++ b/proto/cosmos/slashing/v1beta1/slashing.proto @@ -23,11 +23,8 @@ message ValidatorSigningInfo { // signed_blocks_window param determines the index in the missed block bitmap. int64 index_offset = 3; // Timestamp until which the validator is jailed due to liveness downtime. - google.protobuf.Timestamp jailed_until = 4 [ - (gogoproto.stdtime) = true, - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true - ]; + google.protobuf.Timestamp jailed_until = 4 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // Whether or not a validator has been tombstoned (killed out of validator // set). It is set once the validator commits an equivocation or for any other // configured misbehavior. @@ -43,26 +40,23 @@ message Params { int64 signed_blocks_window = 1; bytes min_signed_per_window = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, - (amino.encoding) = "cosmos_dec_bytes", (amino.dont_omitempty) = true ]; - google.protobuf.Duration downtime_jail_duration = 3 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.stdduration) = true - ]; + google.protobuf.Duration downtime_jail_duration = 3 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdduration) = true]; bytes slash_fraction_double_sign = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, - (amino.encoding) = "cosmos_dec_bytes", (amino.dont_omitempty) = true ]; bytes slash_fraction_downtime = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, - (amino.encoding) = "cosmos_dec_bytes", (amino.dont_omitempty) = true ]; } diff --git a/proto/cosmos/staking/module/v1/module.proto b/proto/cosmos/staking/module/v1/module.proto index 7ef4a06cf075..fd92a54805d6 100644 --- a/proto/cosmos/staking/module/v1/module.proto +++ b/proto/cosmos/staking/module/v1/module.proto @@ -17,4 +17,10 @@ message Module { // authority defines the custom module authority. If not set, defaults to the governance module. string authority = 2; + + // bech32_prefix_validator is the bech32 validator prefix for the app. + string bech32_prefix_validator = 3; + + // bech32_prefix_consensus is the bech32 consensus node prefix for the app. + string bech32_prefix_consensus = 4; } diff --git a/proto/cosmos/staking/v1beta1/genesis.proto b/proto/cosmos/staking/v1beta1/genesis.proto index 8b278ff91af7..c3f1ce5dee91 100644 --- a/proto/cosmos/staking/v1beta1/genesis.proto +++ b/proto/cosmos/staking/v1beta1/genesis.proto @@ -16,7 +16,8 @@ message GenesisState { // last_total_power tracks the total amounts of bonded tokens recorded during // the previous end block. bytes last_total_power = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; @@ -37,6 +38,7 @@ message GenesisState { // redelegations defines the redelegations active at genesis. repeated Redelegation redelegations = 7 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // exported defines a bool to identify whether the chain dealing with exported or initialized genesis. bool exported = 8; } diff --git a/proto/cosmos/staking/v1beta1/query.proto b/proto/cosmos/staking/v1beta1/query.proto index 06eb5551c98a..9b9812235274 100644 --- a/proto/cosmos/staking/v1beta1/query.proto +++ b/proto/cosmos/staking/v1beta1/query.proto @@ -151,7 +151,7 @@ message QueryValidatorsResponse { // QueryValidatorRequest is response type for the Query/Validator RPC method message QueryValidatorRequest { // validator_addr defines the validator address to query for. - string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; } // QueryValidatorResponse is response type for the Query/Validator RPC method @@ -164,7 +164,7 @@ message QueryValidatorResponse { // Query/ValidatorDelegations RPC method message QueryValidatorDelegationsRequest { // validator_addr defines the validator address to query for. - string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; // pagination defines an optional pagination for the request. cosmos.base.query.v1beta1.PageRequest pagination = 2; @@ -184,7 +184,7 @@ message QueryValidatorDelegationsResponse { // Query/ValidatorUnbondingDelegations RPC method message QueryValidatorUnbondingDelegationsRequest { // validator_addr defines the validator address to query for. - string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; // pagination defines an optional pagination for the request. cosmos.base.query.v1beta1.PageRequest pagination = 2; @@ -208,7 +208,7 @@ message QueryDelegationRequest { string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // validator_addr defines the validator address to query for. - string validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; } // QueryDelegationResponse is response type for the Query/Delegation RPC method. @@ -227,7 +227,7 @@ message QueryUnbondingDelegationRequest { string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // validator_addr defines the validator address to query for. - string validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; } // QueryDelegationResponse is response type for the Query/UnbondingDelegation @@ -292,10 +292,10 @@ message QueryRedelegationsRequest { string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // src_validator_addr defines the validator address to redelegate from. - string src_validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string src_validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; // dst_validator_addr defines the validator address to redelegate to. - string dst_validator_addr = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string dst_validator_addr = 3 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; // pagination defines an optional pagination for the request. cosmos.base.query.v1beta1.PageRequest pagination = 4; @@ -344,7 +344,7 @@ message QueryDelegatorValidatorRequest { string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // validator_addr defines the validator address to query for. - string validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; } // QueryDelegatorValidatorResponse response type for the diff --git a/proto/cosmos/staking/v1beta1/staking.proto b/proto/cosmos/staking/v1beta1/staking.proto index 231a200c89dd..24ec65d10202 100644 --- a/proto/cosmos/staking/v1beta1/staking.proto +++ b/proto/cosmos/staking/v1beta1/staking.proto @@ -31,21 +31,21 @@ message CommissionRates { // rate is the commission rate charged to delegators, as a fraction. string rate = 1 [ (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; // max_rate defines the maximum commission rate which validator can ever charge, as a fraction. string max_rate = 2 [ (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; // max_change_rate defines the maximum daily increase of the validator commission, as a fraction. string max_change_rate = 3 [ (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; @@ -102,13 +102,13 @@ message Validator { // tokens define the delegated tokens (incl. self-delegation). string tokens = 5 [ (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; // delegator_shares defines total shares issued to a validator's delegators. string delegator_shares = 6 [ (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // description defines the description terms for the validator. @@ -125,7 +125,7 @@ message Validator { // Since: cosmos-sdk 0.46 string min_self_delegation = 11 [ (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; @@ -163,7 +163,7 @@ message DVPair { option (gogoproto.goproto_getters) = false; string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; } // DVPairs defines an array of DVPair objects. @@ -180,8 +180,8 @@ message DVVTriplet { option (gogoproto.goproto_getters) = false; string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string validator_src_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string validator_dst_address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_src_address = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; + string validator_dst_address = 3 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; } // DVVTriplets defines an array of DVVTriplet objects. @@ -196,14 +196,14 @@ message Delegation { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - // delegator_address is the bech32-encoded address of the delegator. + // delegator_address is the encoded address of the delegator. string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // validator_address is the bech32-encoded address of the validator. - string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // validator_address is the encoded address of the validator. + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; // shares define the delegation shares received. string shares = 3 [ (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; } @@ -214,10 +214,10 @@ message UnbondingDelegation { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - // delegator_address is the bech32-encoded address of the delegator. + // delegator_address is the encoded address of the delegator. string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // validator_address is the bech32-encoded address of the validator. - string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // validator_address is the encoded address of the validator. + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; // entries are the unbonding delegation entries. repeated UnbondingDelegationEntry entries = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // unbonding delegation entries @@ -235,13 +235,13 @@ message UnbondingDelegationEntry { // initial_balance defines the tokens initially scheduled to receive at completion. string initial_balance = 3 [ (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; // balance defines the tokens to receive at completion. string balance = 4 [ (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; // Incrementing id that uniquely identifies this entry @@ -263,13 +263,13 @@ message RedelegationEntry { // initial_balance defines the initial balance when redelegation started. string initial_balance = 3 [ (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; // shares_dst is the amount of destination-validator shares created by redelegation. string shares_dst = 4 [ (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // Incrementing id that uniquely identifies this entry @@ -288,9 +288,9 @@ message Redelegation { // delegator_address is the bech32-encoded address of the delegator. string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // validator_src_address is the validator redelegation source operator address. - string validator_src_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_src_address = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; // validator_dst_address is the validator redelegation destination operator address. - string validator_dst_address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_dst_address = 3 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; // entries are the redelegation entries. repeated RedelegationEntry entries = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // redelegation entries @@ -315,7 +315,7 @@ message Params { // min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators string min_commission_rate = 6 [ (gogoproto.moretags) = "yaml:\"min_commission_rate\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (amino.dont_omitempty) = true, (cosmos_proto.scalar) = "cosmos.Dec" @@ -341,7 +341,7 @@ message RedelegationEntryResponse { RedelegationEntry redelegation_entry = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; string balance = 4 [ (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; } @@ -363,14 +363,14 @@ message Pool { option (gogoproto.equal) = true; string not_bonded_tokens = 1 [ (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false, (gogoproto.jsontag) = "not_bonded_tokens", (amino.dont_omitempty) = true ]; string bonded_tokens = 2 [ (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false, (gogoproto.jsontag) = "bonded_tokens", (amino.dont_omitempty) = true diff --git a/proto/cosmos/staking/v1beta1/tx.proto b/proto/cosmos/staking/v1beta1/tx.proto index a05a84145173..238645ba9232 100644 --- a/proto/cosmos/staking/v1beta1/tx.proto +++ b/proto/cosmos/staking/v1beta1/tx.proto @@ -59,7 +59,7 @@ message MsgCreateValidator { CommissionRates commission = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; string min_self_delegation = 3 [ (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; @@ -91,9 +91,9 @@ message MsgEditValidator { // zero with no way to distinguish if an update was intended. // REF: #2373 string commission_rate = 3 - [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec"]; + [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec"]; string min_self_delegation = 4 - [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int"]; + [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "cosmossdk.io/math.Int"]; } // MsgEditValidatorResponse defines the Msg/EditValidator response type. @@ -159,7 +159,7 @@ message MsgUndelegateResponse { // amount returns the amount of undelegated coins // // Since: cosmos-sdk 0.50 - cosmos.base.v1beta1.Coin amount = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + cosmos.base.v1beta1.Coin amount = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // MsgCancelUnbondingDelegation defines the SDK message for performing a cancel unbonding delegation for delegator diff --git a/proto/cosmos/store/v1beta1/commit_info.proto b/proto/cosmos/store/v1beta1/commit_info.proto index a931e3e7d762..37459a0d05a1 100644 --- a/proto/cosmos/store/v1beta1/commit_info.proto +++ b/proto/cosmos/store/v1beta1/commit_info.proto @@ -11,8 +11,7 @@ option go_package = "cosmossdk.io/store/types"; message CommitInfo { int64 version = 1; repeated StoreInfo store_infos = 2 [(gogoproto.nullable) = false]; - google.protobuf.Timestamp timestamp = 3 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Timestamp timestamp = 3 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; } // StoreInfo defines store-specific commit information. It contains a reference diff --git a/proto/cosmos/store/v1beta1/listening.proto b/proto/cosmos/store/v1beta1/listening.proto index 24131a47df53..14bc2e7a78fd 100644 --- a/proto/cosmos/store/v1beta1/listening.proto +++ b/proto/cosmos/store/v1beta1/listening.proto @@ -11,8 +11,8 @@ option go_package = "cosmossdk.io/store/types"; // // Since: cosmos-sdk 0.43 message StoreKVPair { - string store_key = 1; // the store key for the KVStore this pair originates from - bool delete = 2; // true indicates a delete operation, false indicates a set operation + string store_key = 1; // the store key for the KVStore this pair originates from + bool delete = 2; // true indicates a delete operation, false indicates a set operation bytes key = 3; bytes value = 4; } @@ -22,7 +22,7 @@ message StoreKVPair { message BlockMetadata { tendermint.abci.ResponseCommit response_commit = 6; tendermint.abci.RequestFinalizeBlock request_finalize_block = 7; - tendermint.abci.ResponseFinalizeBlock response_finalize_block = 8; // TODO: should we renumber this? + tendermint.abci.ResponseFinalizeBlock response_finalize_block = 8; // TODO: should we renumber this? - reserved 1, 2, 3, 4, 5; // reserved for from previous use in comet <= 0.37 + reserved 1, 2, 3, 4, 5; // reserved for from previous use in comet <= 0.37 } diff --git a/proto/cosmos/tx/signing/v1beta1/signing.proto b/proto/cosmos/tx/signing/v1beta1/signing.proto index faad739b5aab..584eff4e41fd 100644 --- a/proto/cosmos/tx/signing/v1beta1/signing.proto +++ b/proto/cosmos/tx/signing/v1beta1/signing.proto @@ -25,15 +25,14 @@ enum SignMode { // SIGN_MODE_TEXTUAL is a future signing mode that will verify some // human-readable textual representation on top of the binary representation - // from SIGN_MODE_DIRECT. It is currently experimental, and should be used - // for testing purposes only, until Textual is fully released. Please follow - // the tracking issue https://github.com/cosmos/cosmos-sdk/issues/11970. + // from SIGN_MODE_DIRECT. + // + // Since: cosmos-sdk 0.50 SIGN_MODE_TEXTUAL = 2; // SIGN_MODE_DIRECT_AUX specifies a signing mode which uses // SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not - // require signers signing over other signers' `signer_info`. It also allows - // for adding Tips in transactions. + // require signers signing over other signers' `signer_info`. // // Since: cosmos-sdk 0.46 SIGN_MODE_DIRECT_AUX = 3; diff --git a/proto/cosmos/tx/v1beta1/service.proto b/proto/cosmos/tx/v1beta1/service.proto index 5cd848e09afc..7e19a1865259 100644 --- a/proto/cosmos/tx/v1beta1/service.proto +++ b/proto/cosmos/tx/v1beta1/service.proto @@ -37,8 +37,7 @@ service Service { // GetBlockWithTxs fetches a block with decoded txs. // // Since: cosmos-sdk 0.45.2 - rpc GetBlockWithTxs(GetBlockWithTxsRequest) - returns (GetBlockWithTxsResponse) { + rpc GetBlockWithTxs(GetBlockWithTxsRequest) returns (GetBlockWithTxsResponse) { option (google.api.http).get = "/cosmos/tx/v1beta1/txs/block/{height}"; } // TxDecode decodes the transaction. diff --git a/proto/cosmos/tx/v1beta1/tx.proto b/proto/cosmos/tx/v1beta1/tx.proto index 04f98cf57f63..340f1fe87906 100644 --- a/proto/cosmos/tx/v1beta1/tx.proto +++ b/proto/cosmos/tx/v1beta1/tx.proto @@ -8,6 +8,7 @@ import "cosmos/base/v1beta1/coin.proto"; import "cosmos/tx/signing/v1beta1/signing.proto"; import "google/protobuf/any.proto"; import "cosmos_proto/cosmos.proto"; +import "google/protobuf/timestamp.proto"; option go_package = "github.com/cosmos/cosmos-sdk/types/tx"; @@ -88,13 +89,8 @@ message SignDocDirectAux { // sequence is the sequence number of the signing account. uint64 sequence = 5; - // Tip is the optional tip used for transactions fees paid in another denom. - // It should be left empty if the signer is not the tipper for this - // transaction. - // - // This field is ignored if the chain didn't enable tips, i.e. didn't add the - // `TipDecorator` in its posthandler. - Tip tip = 6; + // tips have been depreacted and should not be used + Tip tip = 6 [deprecated = true]; } // TxBody is the body of a transaction that all signers sign over. @@ -110,13 +106,37 @@ message TxBody { // memo is any arbitrary note/comment to be added to the transaction. // WARNING: in clients, any publicly exposed text should not be called memo, - // but should be called `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122). + // but should be called `note` instead (see + // https://github.com/cosmos/cosmos-sdk/issues/9122). string memo = 2; - // timeout is the block height after which this transaction will not - // be processed by the chain + // timeout_height is the block height after which this transaction will not + // be processed by the chain. uint64 timeout_height = 3; + // unordered, when set to true, indicates that the transaction signer(s) + // intend for the transaction to be evaluated and executed in an un-ordered + // fashion. Specifically, the account's nonce will NOT be checked or + // incremented, which allows for fire-and-forget as well as concurrent + // transaction execution. + // + // Note, when set to true, the existing 'timeout_timestamp' value must + // be set and will be used to correspond to a timestamp in which the transaction is deemed + // valid. + // + // Since: cosmos-sdk 0.53 + bool unordered = 4; + + // timeout_timestamp is the block time after which this transaction will not + // be processed by the chain. + // + // Note, if unordered=true this value MUST be set + // and will act as a short-lived TTL in which the transaction is deemed valid + // and kept in memory to prevent duplicates. + // + // Since: cosmos-sdk 0.53 + google.protobuf.Timestamp timeout_timestamp = 5 [(gogoproto.nullable) = true, (gogoproto.stdtime) = true]; + // extension_options are arbitrary options that can be added by chains // when the default options are not sufficient. If any of these are present // and can't be handled, the transaction will be rejected @@ -142,14 +162,13 @@ message AuthInfo { // based on the cost of evaluating the body and doing signature verification // of the signers. This can be estimated via simulation. Fee fee = 2; - // Tip is the optional tip used for transactions fees paid in another denom. // // This field is ignored if the chain didn't enable tips, i.e. didn't add the // `TipDecorator` in its posthandler. // // Since: cosmos-sdk 0.46 - Tip tip = 3; + Tip tip = 3 [deprecated = true]; } // SignerInfo describes the public key and signing mode of a single top-level @@ -207,24 +226,26 @@ message ModeInfo { message Fee { // amount is the amount of coins to be paid as a fee repeated cosmos.base.v1beta1.Coin amount = 1 [ - (gogoproto.nullable) = false, + (gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (amino.dont_omitempty) = true, - (amino.encoding) = "legacy_coins" + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins" ]; // gas_limit is the maximum gas that can be used in transaction processing // before an out of gas error occurs uint64 gas_limit = 2; - // if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees. - // the payer must be a tx signer (and thus have signed this field in AuthInfo). - // setting this field does *not* change the ordering of required signers for the transaction. + // if unset, the first signer is responsible for paying the fees. If set, the + // specified account must pay the fees. the payer must be a tx signer (and + // thus have signed this field in AuthInfo). setting this field does *not* + // change the ordering of required signers for the transaction. string payer = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used - // to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does - // not support fee grants, this will fail + // if set, the fee payer (either the first signer or the value of the payer + // field) requests that a fee grant be used to pay fees instead of the fee + // payer's own balance. If an appropriate fee grant does not exist or the + // chain does not support fee grants, this will fail string granter = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } @@ -232,12 +253,13 @@ message Fee { // // Since: cosmos-sdk 0.46 message Tip { + option deprecated = true; // amount is the amount of the tip repeated cosmos.base.v1beta1.Coin amount = 1 [ - (gogoproto.nullable) = false, + (gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (amino.dont_omitempty) = true, - (amino.encoding) = "legacy_coins" + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins" ]; // tipper is the address of the account paying for the tip string tipper = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; diff --git a/proto/tendermint/abci/types.proto b/proto/tendermint/abci/types.proto index 73151984ff95..78eeccebf468 100644 --- a/proto/tendermint/abci/types.proto +++ b/proto/tendermint/abci/types.proto @@ -25,10 +25,8 @@ service ABCI { rpc InitChain(RequestInitChain) returns (ResponseInitChain); rpc ListSnapshots(RequestListSnapshots) returns (ResponseListSnapshots); rpc OfferSnapshot(RequestOfferSnapshot) returns (ResponseOfferSnapshot); - rpc LoadSnapshotChunk(RequestLoadSnapshotChunk) - returns (ResponseLoadSnapshotChunk); - rpc ApplySnapshotChunk(RequestApplySnapshotChunk) - returns (ResponseApplySnapshotChunk); + rpc LoadSnapshotChunk(RequestLoadSnapshotChunk) returns (ResponseLoadSnapshotChunk); + rpc ApplySnapshotChunk(RequestApplySnapshotChunk) returns (ResponseApplySnapshotChunk); rpc PrepareProposal(RequestPrepareProposal) returns (ResponsePrepareProposal); rpc ProcessProposal(RequestProcessProposal) returns (ResponseProcessProposal); rpc ExtendVote(RequestExtendVote) returns (ResponseExtendVote); @@ -58,7 +56,7 @@ message Request { RequestVerifyVoteExtension verify_vote_extension = 19; RequestFinalizeBlock finalize_block = 20; } - reserved 4, 7, 9, 10; // SetOption, BeginBlock, DeliverTx, EndBlock + reserved 4, 7, 9, 10; // SetOption, BeginBlock, DeliverTx, EndBlock } message RequestEcho { @@ -75,8 +73,7 @@ message RequestInfo { } message RequestInitChain { - google.protobuf.Timestamp time = 1 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Timestamp time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; string chain_id = 2; tendermint.types.ConsensusParams consensus_params = 3; repeated ValidatorUpdate validators = 4 [(gogoproto.nullable) = false]; @@ -108,8 +105,8 @@ message RequestListSnapshots {} // offers a snapshot to the application message RequestOfferSnapshot { - Snapshot snapshot = 1; // snapshot offered by peers - bytes app_hash = 2; // light client-verified app hash for snapshot height + Snapshot snapshot = 1; // snapshot offered by peers + bytes app_hash = 2; // light client-verified app hash for snapshot height } // loads a snapshot chunk @@ -156,16 +153,24 @@ message RequestProcessProposal { // Extends a vote with application-injected data message RequestExtendVote { - // the hash of the block that this vote may be referring to - bytes hash = 1; + // the hash of the block that this vote may be referring to + bytes hash = 1; // the height of the extended vote int64 height = 2; + // info of the block that this vote may be referring to + google.protobuf.Timestamp time = 3 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + repeated bytes txs = 4; + CommitInfo proposed_last_commit = 5 [(gogoproto.nullable) = false]; + repeated Misbehavior misbehavior = 6 [(gogoproto.nullable) = false]; + bytes next_validators_hash = 7; + // address of the public key of the original proposer of the block. + bytes proposer_address = 8; } // Verify the vote extension message RequestVerifyVoteExtension { // the hash of the block that this received vote corresponds to - bytes hash = 1; + bytes hash = 1; // the validator that signed the vote extension bytes validator_address = 2; int64 height = 3; @@ -208,7 +213,7 @@ message Response { ResponseVerifyVoteExtension verify_vote_extension = 20; ResponseFinalizeBlock finalize_block = 21; } - reserved 5, 8, 10, 11; // SetOption, BeginBlock, DeliverTx, EndBlock + reserved 5, 8, 10, 11; // SetOption, BeginBlock, DeliverTx, EndBlock } // nondeterministic @@ -241,8 +246,8 @@ message ResponseInitChain { message ResponseQuery { uint32 code = 1; // bytes data = 2; // use "value" instead. - string log = 3; // nondeterministic - string info = 4; // nondeterministic + string log = 3; // nondeterministic + string info = 4; // nondeterministic int64 index = 5; bytes key = 6; bytes value = 7; @@ -254,13 +259,12 @@ message ResponseQuery { message ResponseCheckTx { uint32 code = 1; bytes data = 2; - string log = 3; // nondeterministic - string info = 4; // nondeterministic + string log = 3; // nondeterministic + string info = 4; // nondeterministic int64 gas_wanted = 5 [json_name = "gas_wanted"]; int64 gas_used = 6 [json_name = "gas_used"]; - repeated Event events = 7 - [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; - string codespace = 8; + repeated Event events = 7 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; + string codespace = 8; // These reserved fields were used until v0.37 by the priority mempool (now // removed). @@ -269,7 +273,7 @@ message ResponseCheckTx { } message ResponseCommit { - reserved 1, 2; // data was previously returned here + reserved 1, 2; // data was previously returned here int64 retain_height = 3; } @@ -281,12 +285,12 @@ message ResponseOfferSnapshot { Result result = 1; enum Result { - UNKNOWN = 0; // Unknown result, abort all snapshot restoration - ACCEPT = 1; // Snapshot accepted, apply chunks - ABORT = 2; // Abort all snapshot restoration - REJECT = 3; // Reject this specific snapshot, try others - REJECT_FORMAT = 4; // Reject all snapshots of this format, try others - REJECT_SENDER = 5; // Reject all snapshots from the sender(s), try others + UNKNOWN = 0; // Unknown result, abort all snapshot restoration + ACCEPT = 1; // Snapshot accepted, apply chunks + ABORT = 2; // Abort all snapshot restoration + REJECT = 3; // Reject this specific snapshot, try others + REJECT_FORMAT = 4; // Reject all snapshots of this format, try others + REJECT_SENDER = 5; // Reject all snapshots from the sender(s), try others } } @@ -296,16 +300,16 @@ message ResponseLoadSnapshotChunk { message ResponseApplySnapshotChunk { Result result = 1; - repeated uint32 refetch_chunks = 2; // Chunks to refetch and reapply - repeated string reject_senders = 3; // Chunk senders to reject and ban + repeated uint32 refetch_chunks = 2; // Chunks to refetch and reapply + repeated string reject_senders = 3; // Chunk senders to reject and ban enum Result { - UNKNOWN = 0; // Unknown result, abort all snapshot restoration - ACCEPT = 1; // Chunk successfully accepted - ABORT = 2; // Abort all snapshot restoration - RETRY = 3; // Retry chunk (combine with refetch and reject) - RETRY_SNAPSHOT = 4; // Retry snapshot (combine with refetch and reject) - REJECT_SNAPSHOT = 5; // Reject this snapshot, try others + UNKNOWN = 0; // Unknown result, abort all snapshot restoration + ACCEPT = 1; // Chunk successfully accepted + ABORT = 2; // Abort all snapshot restoration + RETRY = 3; // Retry chunk (combine with refetch and reject) + RETRY_SNAPSHOT = 4; // Retry snapshot (combine with refetch and reject) + REJECT_SNAPSHOT = 5; // Reject this snapshot, try others } } @@ -337,14 +341,13 @@ message ResponseVerifyVoteExtension { // Incorrectly implementing this thus has liveness implications as it may affect // CometBFT's ability to receive 2/3+ valid votes to finalize the block. // Honest nodes should never be rejected. - REJECT = 2; + REJECT = 2; } } message ResponseFinalizeBlock { // set of block events emmitted as part of executing the block - repeated Event events = 1 - [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; + repeated Event events = 1 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; // the result of executing each transaction including the events // the particular transction emitted. This should match the order // of the transactions delivered in the block itself @@ -353,7 +356,8 @@ message ResponseFinalizeBlock { repeated ValidatorUpdate validator_updates = 3 [(gogoproto.nullable) = false]; // updates to the consensus params, if any. tendermint.types.ConsensusParams consensus_param_updates = 4; - // app_hash is the hash of the applications' state which is used to confirm that execution of the transactions was deterministic. It is up to the application to decide which algorithm to use. + // app_hash is the hash of the applications' state which is used to confirm that execution of the transactions was + // deterministic. It is up to the application to decide which algorithm to use. bytes app_hash = 5; } @@ -381,17 +385,14 @@ message ExtendedCommitInfo { // Later, transactions may be queried using these events. message Event { string type = 1; - repeated EventAttribute attributes = 2 [ - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "attributes,omitempty" - ]; + repeated EventAttribute attributes = 2 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "attributes,omitempty"]; } // EventAttribute is a single key-value pair, associated with an event. message EventAttribute { string key = 1; string value = 2; - bool index = 3; // nondeterministic + bool index = 3; // nondeterministic } // ExecTxResult contains results of executing one individual transaction. @@ -400,12 +401,12 @@ message EventAttribute { message ExecTxResult { uint32 code = 1; bytes data = 2; - string log = 3; // nondeterministic - string info = 4; // nondeterministic - int64 gas_wanted = 5; - int64 gas_used = 6; + string log = 3; // nondeterministic + string info = 4; // nondeterministic + int64 gas_wanted = 5 [json_name = "gas_wanted"]; + int64 gas_used = 6 [json_name = "gas_used"]; repeated Event events = 7 - [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; // nondeterministic + [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; // nondeterministic string codespace = 8; } @@ -423,9 +424,9 @@ message TxResult { // Blockchain Types message Validator { - bytes address = 1; // The first 20 bytes of SHA256(public key) + bytes address = 1; // The first 20 bytes of SHA256(public key) // PubKey pub_key = 2 [(gogoproto.nullable)=false]; - int64 power = 3; // The voting power + int64 power = 3; // The voting power } message ValidatorUpdate { @@ -434,7 +435,7 @@ message ValidatorUpdate { } message VoteInfo { - Validator validator = 1 [(gogoproto.nullable) = false]; + Validator validator = 1 [(gogoproto.nullable) = false]; tendermint.types.BlockIDFlag block_id_flag = 3; reserved 2; // signed_last_block @@ -466,8 +467,7 @@ message Misbehavior { // The height when the offense occurred int64 height = 3; // The corresponding time where the offense occurred - google.protobuf.Timestamp time = 4 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Timestamp time = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; // Total voting power of the validator set in case the ABCI application does // not store historical validators. // https://github.com/tendermint/tendermint/issues/4581 @@ -478,9 +478,9 @@ message Misbehavior { // State Sync Types message Snapshot { - uint64 height = 1; // The height at which the snapshot was taken - uint32 format = 2; // The application-specific snapshot format - uint32 chunks = 3; // Number of chunks in the snapshot - bytes hash = 4; // Arbitrary snapshot hash, equal only if identical - bytes metadata = 5; // Arbitrary application metadata + uint64 height = 1; // The height at which the snapshot was taken + uint32 format = 2; // The application-specific snapshot format + uint32 chunks = 3; // Number of chunks in the snapshot + bytes hash = 4; // Arbitrary snapshot hash, equal only if identical + bytes metadata = 5; // Arbitrary application metadata } diff --git a/proto/tendermint/types/evidence.proto b/proto/tendermint/types/evidence.proto index 1f35049bdc4f..06f30ec2f5f3 100644 --- a/proto/tendermint/types/evidence.proto +++ b/proto/tendermint/types/evidence.proto @@ -30,7 +30,7 @@ message LightClientAttackEvidence { int64 common_height = 2; repeated tendermint.types.Validator byzantine_validators = 3; int64 total_voting_power = 4; - google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; } message EvidenceList { diff --git a/proto/tendermint/types/params.proto b/proto/tendermint/types/params.proto index f96a2e2f5726..6a42d5ef0da7 100644 --- a/proto/tendermint/types/params.proto +++ b/proto/tendermint/types/params.proto @@ -27,7 +27,7 @@ message BlockParams { // Note: must be greater or equal to -1 int64 max_gas = 2; - reserved 3; // was TimeIotaMs see https://github.com/tendermint/tendermint/pull/5792 + reserved 3; // was TimeIotaMs see https://github.com/tendermint/tendermint/pull/5792 } // EvidenceParams determine how we handle evidence of malfeasance. @@ -43,8 +43,7 @@ message EvidenceParams { // It should correspond with an app's "unbonding period" or other similar // mechanism for handling [Nothing-At-Stake // attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). - google.protobuf.Duration max_age_duration = 2 - [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; + google.protobuf.Duration max_age_duration = 2 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; // This sets the maximum size of total evidence in bytes that can be committed in a single block. // and should fall comfortably under the max block bytes. diff --git a/proto/tendermint/types/types.proto b/proto/tendermint/types/types.proto index a527e2ffb217..a0d545ad9ee7 100644 --- a/proto/tendermint/types/types.proto +++ b/proto/tendermint/types/types.proto @@ -55,19 +55,19 @@ message Header { BlockID last_block_id = 5 [(gogoproto.nullable) = false]; // hashes of block data - bytes last_commit_hash = 6; // commit from validators from the last block - bytes data_hash = 7; // transactions + bytes last_commit_hash = 6; // commit from validators from the last block + bytes data_hash = 7; // transactions // hashes from the app output from the prev block - bytes validators_hash = 8; // validators for the current block - bytes next_validators_hash = 9; // validators for the next block - bytes consensus_hash = 10; // consensus params for current block - bytes app_hash = 11; // state after txs from the previous block - bytes last_results_hash = 12; // root hash of all results from the txs from the previous block + bytes validators_hash = 8; // validators for the current block + bytes next_validators_hash = 9; // validators for the next block + bytes consensus_hash = 10; // consensus params for current block + bytes app_hash = 11; // state after txs from the previous block + bytes last_results_hash = 12; // root hash of all results from the txs from the previous block // consensus info - bytes evidence_hash = 13; // evidence included in the block - bytes proposer_address = 14; // original proposer of the block + bytes evidence_hash = 13; // evidence included in the block + bytes proposer_address = 14; // original proposer of the block } // Data contains the set of transactions included in the block @@ -84,12 +84,10 @@ message Vote { SignedMsgType type = 1; int64 height = 2; int32 round = 3; - BlockID block_id = 4 - [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; // zero if vote is nil. - google.protobuf.Timestamp timestamp = 5 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - bytes validator_address = 6; - int32 validator_index = 7; + BlockID block_id = 4 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; // zero if vote is nil. + google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes validator_address = 6; + int32 validator_index = 7; // Vote signature by the validator if they participated in consensus for the // associated block. bytes signature = 8; @@ -114,16 +112,14 @@ message Commit { message CommitSig { tendermint.types.BlockIDFlag block_id_flag = 1; bytes validator_address = 2; - google.protobuf.Timestamp timestamp = 3 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - bytes signature = 4; + google.protobuf.Timestamp timestamp = 3 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes signature = 4; } message ExtendedCommit { - int64 height = 1; - int32 round = 2; - BlockID block_id = 3 - [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; + int64 height = 1; + int32 round = 2; + BlockID block_id = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; repeated ExtendedCommitSig extended_signatures = 4 [(gogoproto.nullable) = false]; } @@ -133,9 +129,8 @@ message ExtendedCommit { message ExtendedCommitSig { tendermint.types.BlockIDFlag block_id_flag = 1; bytes validator_address = 2; - google.protobuf.Timestamp timestamp = 3 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - bytes signature = 4; + google.protobuf.Timestamp timestamp = 3 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes signature = 4; // Vote extension data bytes extension = 5; // Vote extension signature @@ -148,9 +143,8 @@ message Proposal { int32 round = 3; int32 pol_round = 4; BlockID block_id = 5 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false]; - google.protobuf.Timestamp timestamp = 6 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - bytes signature = 7; + google.protobuf.Timestamp timestamp = 6 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes signature = 7; } message SignedHeader { diff --git a/proto/tendermint/types/validator.proto b/proto/tendermint/types/validator.proto index 7b55956fcdd1..cd5105fac765 100644 --- a/proto/tendermint/types/validator.proto +++ b/proto/tendermint/types/validator.proto @@ -11,13 +11,13 @@ enum BlockIDFlag { option (gogoproto.goproto_enum_stringer) = true; option (gogoproto.goproto_enum_prefix) = false; - BLOCK_ID_FLAG_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "BlockIDFlagUnknown"]; // indicates an error condition - BLOCK_ID_FLAG_ABSENT = 1 [(gogoproto.enumvalue_customname) = "BlockIDFlagAbsent"]; // the vote was not received - BLOCK_ID_FLAG_COMMIT = 2 [(gogoproto.enumvalue_customname) = "BlockIDFlagCommit"]; // voted for the block that received the majority - BLOCK_ID_FLAG_NIL = 3 [(gogoproto.enumvalue_customname) = "BlockIDFlagNil"]; // voted for nil + BLOCK_ID_FLAG_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "BlockIDFlagUnknown"]; // indicates an error condition + BLOCK_ID_FLAG_ABSENT = 1 [(gogoproto.enumvalue_customname) = "BlockIDFlagAbsent"]; // the vote was not received + BLOCK_ID_FLAG_COMMIT = 2 + [(gogoproto.enumvalue_customname) = "BlockIDFlagCommit"]; // voted for the block that received the majority + BLOCK_ID_FLAG_NIL = 3 [(gogoproto.enumvalue_customname) = "BlockIDFlagNil"]; // voted for nil } - message ValidatorSet { repeated Validator validators = 1; Validator proposer = 2; diff --git a/runtime/app.go b/runtime/app.go index e2cb361d4c84..890b1a5a87a1 100644 --- a/runtime/app.go +++ b/runtime/app.go @@ -3,14 +3,15 @@ package runtime import ( "encoding/json" "fmt" + "slices" + + abci "github.com/cometbft/cometbft/abci/types" runtimev1alpha1 "cosmossdk.io/api/cosmos/app/runtime/v1alpha1" appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" + "cosmossdk.io/core/appmodule" "cosmossdk.io/log" - storetypes "cosmossdk.io/store/types" - abci "github.com/cometbft/cometbft/abci/types" - "golang.org/x/exp/slices" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" @@ -24,6 +25,7 @@ import ( servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + "github.com/cosmos/cosmos-sdk/x/auth/ante/unorderedtx" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" ) @@ -39,7 +41,9 @@ import ( type App struct { *baseapp.BaseApp - ModuleManager *module.Manager + ModuleManager *module.Manager + UnorderedTxManager *unorderedtx.Manager + configurator module.Configurator config *runtimev1alpha1.Module storeKeys []storetypes.StoreKey @@ -49,6 +53,7 @@ type App struct { basicManager module.BasicManager baseAppOptions []BaseAppOption msgServiceRouter *baseapp.MsgServiceRouter + grpcQueryRouter *baseapp.GRPCQueryRouter appConfig *appv1alpha1.Config logger log.Logger // initChainer is the init chainer function defined by the app config. @@ -75,7 +80,26 @@ func (a *App) RegisterModules(modules ...module.AppModule) error { appModule.RegisterInterfaces(a.interfaceRegistry) appModule.RegisterLegacyAminoCodec(a.amino) + if module, ok := appModule.(module.HasServices); ok { + module.RegisterServices(a.configurator) + } else if module, ok := appModule.(appmodule.HasServices); ok { + if err := module.RegisterServices(a.configurator); err != nil { + return err + } + } } + + return nil +} + +// RegisterStores registers the provided store keys. +// This method should only be used for registering extra stores +// wiich is necessary for modules that not registered using the app config. +// To be used in combination of RegisterModules. +func (a *App) RegisterStores(keys ...storetypes.StoreKey) error { + a.storeKeys = append(a.storeKeys, keys...) + a.MountStores(keys...) + return nil } @@ -94,6 +118,13 @@ func (a *App) Load(loadLatest bool) error { a.ModuleManager.SetOrderExportGenesis(a.config.InitGenesis...) } + if len(a.config.PreBlockers) != 0 { + a.ModuleManager.SetOrderPreBlockers(a.config.PreBlockers...) + if a.BaseApp.PreBlocker() == nil { + a.SetPreBlocker(a.PreBlocker) + } + } + if len(a.config.BeginBlockers) != 0 { a.ModuleManager.SetOrderBeginBlockers(a.config.BeginBlockers...) a.SetBeginBlocker(a.BeginBlocker) @@ -127,6 +158,14 @@ func (a *App) Load(loadLatest bool) error { return nil } +// PreBlocker application updates every pre block +func (a *App) PreBlocker(ctx sdk.Context, _ *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error) { + if a.UnorderedTxManager != nil { + a.UnorderedTxManager.OnNewBlock(ctx.BlockTime()) + } + return a.ModuleManager.PreBlock(ctx) +} + // BeginBlocker application updates every begin block func (a *App) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error) { return a.ModuleManager.BeginBlock(ctx) diff --git a/runtime/autocli.go b/runtime/autocli.go index 62e1b4569478..49ff9619115f 100644 --- a/runtime/autocli.go +++ b/runtime/autocli.go @@ -7,33 +7,35 @@ import ( ) func (m appModule) AutoCLIOptions() *autocliv1.ModuleOptions { - return &autocliv1.ModuleOptions{Query: &autocliv1.ServiceCommandDescriptor{ - Service: appv1alpha1.Query_ServiceDesc.ServiceName, - RpcCommandOptions: []*autocliv1.RpcCommandOptions{ - { - RpcMethod: "Config", - Short: "Queries the current app config", + return &autocliv1.ModuleOptions{ + Query: &autocliv1.ServiceCommandDescriptor{ + Service: appv1alpha1.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Config", + Short: "Query the current app config", + }, }, - }, - SubCommands: map[string]*autocliv1.ServiceCommandDescriptor{ - "autocli": { - Service: autocliv1.Query_ServiceDesc.ServiceName, - RpcCommandOptions: []*autocliv1.RpcCommandOptions{ - { - RpcMethod: "AppOptions", - Short: "Queries custom autocli options", + SubCommands: map[string]*autocliv1.ServiceCommandDescriptor{ + "autocli": { + Service: autocliv1.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "AppOptions", + Short: "Query the custom autocli options", + }, }, }, - }, - "reflection": { - Service: reflectionv1.ReflectionService_ServiceDesc.ServiceName, - RpcCommandOptions: []*autocliv1.RpcCommandOptions{ - { - RpcMethod: "FileDescriptors", - Short: "Queries the app's protobuf file descriptors", + "reflection": { + Service: reflectionv1.ReflectionService_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "FileDescriptors", + Short: "Query the app's protobuf file descriptors", + }, }, }, }, }, - }} + } } diff --git a/runtime/builder.go b/runtime/builder.go index e340a9db7eb5..b91b894668b2 100644 --- a/runtime/builder.go +++ b/runtime/builder.go @@ -29,8 +29,18 @@ func (a *AppBuilder) Build(db dbm.DB, traceStore io.Writer, baseAppOptions ...fu baseAppOptions = append(baseAppOptions, option) } + // set routers first in case they get modified by other options + baseAppOptions = append( + []func(*baseapp.BaseApp){ + func(bApp *baseapp.BaseApp) { + bApp.SetMsgServiceRouter(a.app.msgServiceRouter) + bApp.SetGRPCQueryRouter(a.app.grpcQueryRouter) + }, + }, + baseAppOptions..., + ) + bApp := baseapp.NewBaseApp(a.app.config.AppName, a.app.logger, db, nil, baseAppOptions...) - bApp.SetMsgServiceRouter(a.app.msgServiceRouter) bApp.SetCommitMultiStoreTracer(traceStore) bApp.SetVersion(version.Version) bApp.SetInterfaceRegistry(a.app.interfaceRegistry) @@ -38,6 +48,7 @@ func (a *AppBuilder) Build(db dbm.DB, traceStore io.Writer, baseAppOptions ...fu a.app.BaseApp = bApp a.app.configurator = module.NewConfigurator(a.app.cdc, a.app.MsgServiceRouter(), a.app.GRPCQueryRouter()) + if err := a.app.ModuleManager.RegisterServices(a.app.configurator); err != nil { panic(err) } diff --git a/runtime/events.go b/runtime/events.go index 4139ede7b7d6..752dcae2bb30 100644 --- a/runtime/events.go +++ b/runtime/events.go @@ -3,9 +3,10 @@ package runtime import ( "context" - "cosmossdk.io/core/event" "google.golang.org/protobuf/runtime/protoiface" + "cosmossdk.io/core/event" + sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -32,12 +33,12 @@ func NewEventManager(ctx context.Context) event.Manager { } // Emit emits an typed event that is defined in the protobuf file. -// In the future these events will be added to consensus +// In the future these events will be added to consensus. func (e Events) Emit(ctx context.Context, event protoiface.MessageV1) error { return e.EventManagerI.EmitTypedEvent(event) } -// EmitKV emits a key value pair event +// EmitKV emits a key value pair event. func (e Events) EmitKV(ctx context.Context, eventType string, attrs ...event.Attribute) error { attributes := make([]sdk.Attribute, 0, len(attrs)) @@ -45,15 +46,12 @@ func (e Events) EmitKV(ctx context.Context, eventType string, attrs ...event.Att attributes = append(attributes, sdk.NewAttribute(attr.Key, attr.Value)) } - events := sdk.Events{ - sdk.NewEvent(eventType, attributes...), - } - e.EventManagerI.EmitEvents(events) + e.EventManagerI.EmitEvents(sdk.Events{sdk.NewEvent(eventType, attributes...)}) return nil } // Emit emits an typed event that is defined in the protobuf file. -// In the future these events will be added to consensus +// In the future these events will be added to consensus. func (e Events) EmitNonConsensus(ctx context.Context, event protoiface.MessageV1) error { return e.EventManagerI.EmitTypedEvent(event) } diff --git a/runtime/module.go b/runtime/module.go index 8fca550d7261..d7d46cc75b90 100644 --- a/runtime/module.go +++ b/runtime/module.go @@ -4,30 +4,31 @@ import ( "fmt" "os" - runtimev1alpha1 "cosmossdk.io/api/cosmos/app/runtime/v1alpha1" - appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" - "cosmossdk.io/depinject" - "cosmossdk.io/log" - "cosmossdk.io/x/tx/signing" "github.com/cosmos/gogoproto/proto" "google.golang.org/protobuf/reflect/protodesc" "google.golang.org/protobuf/reflect/protoregistry" + runtimev1alpha1 "cosmossdk.io/api/cosmos/app/runtime/v1alpha1" + appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" + authmodulev1 "cosmossdk.io/api/cosmos/auth/module/v1" + stakingmodulev1 "cosmossdk.io/api/cosmos/staking/module/v1" + "cosmossdk.io/core/address" "cosmossdk.io/core/appmodule" "cosmossdk.io/core/comet" "cosmossdk.io/core/event" "cosmossdk.io/core/genesis" "cosmossdk.io/core/header" "cosmossdk.io/core/store" + "cosmossdk.io/depinject" + "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" - - "github.com/cosmos/cosmos-sdk/codec/address" + "cosmossdk.io/x/tx/signing" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/std" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/types/msgservice" ) @@ -74,6 +75,7 @@ func init() { ProvideHeaderInfoService, ProvideCometInfoService, ProvideBasicManager, + ProvideAddressCodec, ), appmodule.Invoke(SetupAppBuilder), ) @@ -83,8 +85,8 @@ func ProvideApp(interfaceRegistry codectypes.InterfaceRegistry) ( codec.Codec, *codec.LegacyAmino, *AppBuilder, - codec.ProtoCodecMarshaler, *baseapp.MsgServiceRouter, + *baseapp.GRPCQueryRouter, appmodule.AppModule, protodesc.Resolver, protoregistry.MessageTypeResolver, @@ -95,7 +97,7 @@ func ProvideApp(interfaceRegistry codectypes.InterfaceRegistry) ( // At startup, check that all proto annotations are correct. if err := msgservice.ValidateProtoAnnotations(protoFiles); err != nil { - // Once we switch to using protoreflect-based antehandlers, we might + // Once we switch to using protoreflect-based ante handlers, we might // want to panic here instead of logging a warning. _, _ = fmt.Fprintln(os.Stderr, err.Error()) } @@ -107,6 +109,7 @@ func ProvideApp(interfaceRegistry codectypes.InterfaceRegistry) ( cdc := codec.NewProtoCodec(interfaceRegistry) msgServiceRouter := baseapp.NewMsgServiceRouter() + grpcQueryRouter := baseapp.NewGRPCQueryRouter() app := &App{ storeKeys: nil, interfaceRegistry: interfaceRegistry, @@ -114,16 +117,17 @@ func ProvideApp(interfaceRegistry codectypes.InterfaceRegistry) ( amino: amino, basicManager: module.BasicManager{}, msgServiceRouter: msgServiceRouter, + grpcQueryRouter: grpcQueryRouter, } appBuilder := &AppBuilder{app} - return cdc, amino, appBuilder, cdc, msgServiceRouter, appModule{app}, protoFiles, protoTypes, nil + return cdc, amino, appBuilder, msgServiceRouter, grpcQueryRouter, appModule{app}, protoFiles, protoTypes, nil } type AppInputs struct { depinject.In - AppConfig *appv1alpha1.Config + AppConfig *appv1alpha1.Config `optional:"true"` Config *runtimev1alpha1.Module AppBuilder *AppBuilder Modules map[string]appmodule.AppModule @@ -157,16 +161,10 @@ func SetupAppBuilder(inputs AppInputs) { } } -func ProvideInterfaceRegistry(customGetSigners []signing.CustomGetSigner) (codectypes.InterfaceRegistry, error) { +func ProvideInterfaceRegistry(addressCodec address.Codec, validatorAddressCodec ValidatorAddressCodec, customGetSigners []signing.CustomGetSigner) (codectypes.InterfaceRegistry, error) { signingOptions := signing.Options{ - // using the global prefixes is a temporary solution until we refactor this - // to get the address.Codec's from the container - AddressCodec: address.Bech32Codec{ - Bech32Prefix: sdk.GetConfig().GetBech32AccountAddrPrefix(), - }, - ValidatorAddressCodec: address.Bech32Codec{ - Bech32Prefix: sdk.GetConfig().GetBech32ValidatorAddrPrefix(), - }, + AddressCodec: addressCodec, + ValidatorAddressCodec: validatorAddressCodec, } for _, signer := range customGetSigners { signingOptions.DefineCustomGetSigners(signer.MsgType, signer.Fn) @@ -179,10 +177,11 @@ func ProvideInterfaceRegistry(customGetSigners []signing.CustomGetSigner) (codec if err != nil { return nil, err } - err = interfaceRegistry.SigningContext().Validate() - if err != nil { + + if err := interfaceRegistry.SigningContext().Validate(); err != nil { return nil, err } + return interfaceRegistry, nil } @@ -260,3 +259,50 @@ func ProvideHeaderInfoService(app *AppBuilder) header.Service { func ProvideBasicManager(app *AppBuilder) module.BasicManager { return app.app.basicManager } + +type ( + // ValidatorAddressCodec is an alias for address.Codec for validator addresses. + ValidatorAddressCodec address.Codec + + // ConsensusAddressCodec is an alias for address.Codec for validator consensus addresses. + ConsensusAddressCodec address.Codec +) + +type AddressCodecInputs struct { + depinject.In + + AuthConfig *authmodulev1.Module `optional:"true"` + StakingConfig *stakingmodulev1.Module `optional:"true"` + + AddressCodecFactory func() address.Codec `optional:"true"` + ValidatorAddressCodecFactory func() ValidatorAddressCodec `optional:"true"` + ConsensusAddressCodecFactory func() ConsensusAddressCodec `optional:"true"` +} + +// ProvideAddressCodec provides an address.Codec to the container for any +// modules that want to do address string <> bytes conversion. +func ProvideAddressCodec(in AddressCodecInputs) (address.Codec, ValidatorAddressCodec, ConsensusAddressCodec) { + if in.AddressCodecFactory != nil && in.ValidatorAddressCodecFactory != nil && in.ConsensusAddressCodecFactory != nil { + return in.AddressCodecFactory(), in.ValidatorAddressCodecFactory(), in.ConsensusAddressCodecFactory() + } + + if in.AuthConfig == nil || in.AuthConfig.Bech32Prefix == "" { + panic("auth config bech32 prefix cannot be empty if no custom address codec is provided") + } + + if in.StakingConfig == nil { + in.StakingConfig = &stakingmodulev1.Module{} + } + + if in.StakingConfig.Bech32PrefixValidator == "" { + in.StakingConfig.Bech32PrefixValidator = fmt.Sprintf("%svaloper", in.AuthConfig.Bech32Prefix) + } + + if in.StakingConfig.Bech32PrefixConsensus == "" { + in.StakingConfig.Bech32PrefixConsensus = fmt.Sprintf("%svalcons", in.AuthConfig.Bech32Prefix) + } + + return addresscodec.NewBech32Codec(in.AuthConfig.Bech32Prefix), + addresscodec.NewBech32Codec(in.StakingConfig.Bech32PrefixValidator), + addresscodec.NewBech32Codec(in.StakingConfig.Bech32PrefixConsensus) +} diff --git a/runtime/services.go b/runtime/services.go index a16a3a6b5a57..3730b4a2af92 100644 --- a/runtime/services.go +++ b/runtime/services.go @@ -6,16 +6,20 @@ import ( appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" - "cosmossdk.io/core/comet" "cosmossdk.io/core/header" + "github.com/cosmos/cosmos-sdk/runtime/services" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" ) func (a *App) registerRuntimeServices(cfg module.Configurator) error { - appv1alpha1.RegisterQueryServer(cfg.QueryServer(), services.NewAppQueryService(a.appConfig)) + // no app config service if user is using app.yaml / app.json + // it is as in v0.52, this whole query service does not exist at all. + if a.appConfig != nil { + appv1alpha1.RegisterQueryServer(cfg.QueryServer(), services.NewAppQueryService(a.appConfig)) + } autocliv1.RegisterQueryServer(cfg.QueryServer(), services.NewAutoCLIQueryService(a.ModuleManager.Modules)) reflectionSvc, err := services.NewReflectionService() diff --git a/runtime/services/autocli.go b/runtime/services/autocli.go index 5c2a7efe43fd..66c70b31e7ee 100644 --- a/runtime/services/autocli.go +++ b/runtime/services/autocli.go @@ -3,9 +3,6 @@ package services import ( "context" - autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" - cosmosmsg "cosmossdk.io/api/cosmos/msg/v1" - "cosmossdk.io/core/appmodule" gogogrpc "github.com/cosmos/gogoproto/grpc" "github.com/cosmos/gogoproto/proto" "google.golang.org/grpc" @@ -13,6 +10,10 @@ import ( "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + cosmosmsg "cosmossdk.io/api/cosmos/msg/v1" + "cosmossdk.io/core/appmodule" + "github.com/cosmos/cosmos-sdk/types/module" ) @@ -31,6 +32,7 @@ func NewAutoCLIQueryService(appModules map[string]interface{}) *AutoCLIQueryServ } // ExtractAutoCLIOptions extracts autocli ModuleOptions from the provided app modules. +// // Example Usage: // // ExtractAutoCLIOptions(ModuleManager.Modules) diff --git a/runtime/services/reflection.go b/runtime/services/reflection.go index 890ff66e350e..65225a482606 100644 --- a/runtime/services/reflection.go +++ b/runtime/services/reflection.go @@ -3,9 +3,10 @@ package services import ( "context" - reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" "github.com/cosmos/gogoproto/proto" "google.golang.org/protobuf/types/descriptorpb" + + reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" ) // ReflectionService implements the cosmos.reflection.v1 service. diff --git a/runtime/store.go b/runtime/store.go index 9374fb0c199f..4cfe131c5071 100644 --- a/runtime/store.go +++ b/runtime/store.go @@ -4,12 +4,11 @@ import ( "context" "io" - "cosmossdk.io/core/store" + dbm "github.com/cosmos/cosmos-db" + "cosmossdk.io/core/store" storetypes "cosmossdk.io/store/types" - dbm "github.com/cosmos/cosmos-db" - sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -25,6 +24,10 @@ func (k kvStoreService) OpenKVStore(ctx context.Context) store.KVStore { return newKVStore(sdk.UnwrapSDKContext(ctx).KVStore(k.key)) } +func NewMemStoreService(storeKey *storetypes.MemoryStoreKey) store.MemoryStoreService { + return &memStoreService{key: storeKey} +} + type memStoreService struct { key *storetypes.MemoryStoreKey } @@ -33,6 +36,10 @@ func (m memStoreService) OpenMemoryStore(ctx context.Context) store.KVStore { return newKVStore(sdk.UnwrapSDKContext(ctx).KVStore(m.key)) } +func NewTransientStoreService(storeKey *storetypes.TransientStoreKey) store.TransientStoreService { + return &transientStoreService{key: storeKey} +} + type transientStoreService struct { key *storetypes.TransientStoreKey } diff --git a/runtime/types.go b/runtime/types.go index a87ff8944282..afde0e42d1f8 100644 --- a/runtime/types.go +++ b/runtime/types.go @@ -18,7 +18,7 @@ type AppI interface { Name() string // The application types codec. - // NOTE: This shoult be sealed before being returned. + // NOTE: This should NOT be sealed before being returned. LegacyAmino() *codec.LegacyAmino // Application updates every begin block. diff --git a/scripts/go-lint-all.bash b/scripts/go-lint-all.bash index b99606844d79..a94b513659a8 100755 --- a/scripts/go-lint-all.bash +++ b/scripts/go-lint-all.bash @@ -1,6 +1,9 @@ #!/usr/bin/env bash -set -eu -o pipefail +set -e -o pipefail + +LINT_TAGS="e2e,ledger,test_ledger_mock,system_test" +export LINT_TAGS REPO_ROOT="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )/.." &> /dev/null && pwd )" export REPO_ROOT @@ -10,9 +13,28 @@ lint_module() { shift cd "$(dirname "$root")" && echo "linting $(grep "^module" go.mod) [$(date -Iseconds -u)]" && - golangci-lint run ./... -c "${REPO_ROOT}/.golangci.yml" "$@" + golangci-lint run ./... -c "${REPO_ROOT}/.golangci.yml" "$@" --new-from-rev=HEAD~ --build-tags=${LINT_TAGS} } export -f lint_module -find "${REPO_ROOT}" -type f -name go.mod -print0 | - xargs -0 -I{} bash -c 'lint_module "$@"' _ {} "$@" # Prepend go.mod file before command-line args. +# if LINT_DIFF env is set, only lint the files in the current commit otherwise lint all files +if [[ -z "${LINT_DIFF:-}" ]]; then + find "${REPO_ROOT}" -type f -name go.mod -print0 | + xargs -0 -I{} bash -c 'lint_module "$@"' _ {} "$@" +else + if [[ -z $GIT_DIFF ]]; then + GIT_DIFF=$(git diff --name-only --diff-filter=d | grep \.go$ | grep -v \.pb\.go$) || true + fi + + if [[ -z "$GIT_DIFF" ]]; then + echo "no files to lint" + exit 0 + fi + + for f in $(dirname $(echo "$GIT_DIFF" | tr -d "'") | uniq); do + echo "linting $f [$(date -Iseconds -u)]" && + cd $f && + golangci-lint run ./... -c "${REPO_ROOT}/.golangci.yml" "$@" --new-from-rev=HEAD~ --build-tags=${LINT_TAGS} && + cd $REPO_ROOT + done +fi \ No newline at end of file diff --git a/scripts/go-lint-changes.bash b/scripts/go-lint-changes.bash new file mode 100755 index 000000000000..ce60b0bd6fe9 --- /dev/null +++ b/scripts/go-lint-changes.bash @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +set -e -o pipefail + + +LINT_TAGS="e2e,ledger,test_ledger_mock,system_test" +export LINT_TAGS + +REPO_ROOT="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )/.." &> /dev/null && pwd )" +export REPO_ROOT + +lint_module() { + local root="$1" + shift + cd "$(dirname "$root")" && + echo "linting $(grep "^module" go.mod) [$(date -Iseconds -u)]" && + golangci-lint run ./... -c "${REPO_ROOT}/.golangci.yml" "$@" --new-from-rev=HEAD~ --build-tags=${LINT_TAGS} +} +export -f lint_module + +# if LINT_DIFF env is set, only lint the files in the current commit otherwise lint all files +if [[ -z "${LINT_DIFF:-}" ]]; then + find "${REPO_ROOT}" -type f -name go.mod -print0 | + xargs -0 -I{} bash -c 'lint_module "$@"' _ {} "$@" +else + if [[ -z $GIT_DIFF ]]; then + GIT_DIFF=$(git diff --name-only --diff-filter=d | grep \.go$ | grep -v \.pb\.go$) || true + fi + + if [[ -z "$GIT_DIFF" ]]; then + echo "no files to lint" + exit 0 + fi + + for f in $(dirname $(echo "$GIT_DIFF" | tr -d "'") | uniq); do + echo "linting $f [$(date -Iseconds -u)]" && + cd $f && + golangci-lint run ./... -c "${REPO_ROOT}/.golangci.yml" "$@" --new-from-rev=HEAD~ --build-tags=${LINT_TAGS} && + cd $REPO_ROOT + done +fi \ No newline at end of file diff --git a/scripts/init-simapp.sh b/scripts/init-simapp.sh index 5db89d2c5066..6913079e0a31 100755 --- a/scripts/init-simapp.sh +++ b/scripts/init-simapp.sh @@ -1,16 +1,17 @@ -#!/bin/bash +#!/usr/bin/env bash SIMD_BIN=${SIMD_BIN:=$(which simd 2>/dev/null)} if [ -z "$SIMD_BIN" ]; then echo "SIMD_BIN is not set. Make sure to run make install before"; exit 1; fi echo "using $SIMD_BIN" -if [ -d "$($SIMD_BIN config home)" ]; then rm -r $($SIMD_BIN config home); fi +if [ -d "$($SIMD_BIN config home)" ]; then rm -rv $($SIMD_BIN config home); fi $SIMD_BIN config set client chain-id demo $SIMD_BIN config set client keyring-backend test +$SIMD_BIN config set app api.enable true $SIMD_BIN keys add alice $SIMD_BIN keys add bob $SIMD_BIN init test --chain-id demo $SIMD_BIN genesis add-genesis-account alice 5000000000stake --keyring-backend test $SIMD_BIN genesis add-genesis-account bob 5000000000stake --keyring-backend test $SIMD_BIN genesis gentx alice 1000000stake --chain-id demo -$SIMD_BIN genesis collect-gentxs \ No newline at end of file +$SIMD_BIN genesis collect-gentxs diff --git a/scripts/mockgen.sh b/scripts/mockgen.sh index a3786acc50d2..87c8ba387a8f 100755 --- a/scripts/mockgen.sh +++ b/scripts/mockgen.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash mockgen_cmd="mockgen" +$mockgen_cmd -source=baseapp/abci_utils.go -package mock -destination baseapp/testutil/mock/mocks.go $mockgen_cmd -source=client/account_retriever.go -package mock -destination testutil/mock/account_retriever.go $mockgen_cmd -package mock -destination store/mock/cosmos_cosmos_db_DB.go github.com/cosmos/cosmos-db DB $mockgen_cmd -source=types/module/module.go -package mock -destination testutil/mock/types_module_module.go @@ -8,12 +9,10 @@ $mockgen_cmd -source=types/module/mock_appmodule_test.go -package mock -destinat $mockgen_cmd -source=types/invariant.go -package mock -destination testutil/mock/types_invariant.go $mockgen_cmd -package mock -destination testutil/mock/grpc_server.go github.com/cosmos/gogoproto/grpc Server $mockgen_cmd -package mock -destination testutil/mock/logger.go cosmossdk.io/log Logger -$mockgen_cmd -source=orm/model/ormtable/hooks.go -package ormmocks -destination orm/testing/ormmocks/hooks.go $mockgen_cmd -source=x/nft/expected_keepers.go -package testutil -destination x/nft/testutil/expected_keepers_mocks.go $mockgen_cmd -source=x/feegrant/expected_keepers.go -package testutil -destination x/feegrant/testutil/expected_keepers_mocks.go $mockgen_cmd -source=x/mint/types/expected_keepers.go -package testutil -destination x/mint/testutil/expected_keepers_mocks.go $mockgen_cmd -source=x/params/proposal_handler_test.go -package testutil -destination x/params/testutil/staking_keeper_mock.go -$mockgen_cmd -source=x/crisis/types/expected_keepers.go -package testutil -destination x/crisis/testutil/expected_keepers_mocks.go $mockgen_cmd -source=x/auth/tx/config/expected_keepers.go -package testutil -destination x/auth/tx/testutil/expected_keepers_mocks.go $mockgen_cmd -source=x/auth/types/expected_keepers.go -package testutil -destination x/auth/testutil/expected_keepers_mocks.go $mockgen_cmd -source=x/auth/ante/expected_keepers.go -package testutil -destination x/auth/ante/testutil/expected_keepers_mocks.go diff --git a/scripts/protocgen.sh b/scripts/protocgen.sh index b1a4428e8572..e84178a05f43 100755 --- a/scripts/protocgen.sh +++ b/scripts/protocgen.sh @@ -4,6 +4,9 @@ # docker build --pull --rm -f "contrib/devtools/Dockerfile" -t cosmossdk-proto:latest "contrib/devtools" # docker run --rm -v $(pwd):/workspace --workdir /workspace cosmossdk-proto sh ./scripts/protocgen.sh +echo "Formatting protobuf files" +find ./ -name "*.proto" -exec clang-format -i {} \; + set -e echo "Generating gogo proto code" @@ -22,11 +25,10 @@ done cd .. -# generate codec/testdata proto code +# generate tests proto code (cd testutil/testdata; buf generate) - -# generate baseapp test messages (cd baseapp/testutil; buf generate) +(cd tests/integration/tx/internal; make codegen) # move proto files to the right places cp -r github.com/cosmos/cosmos-sdk/* ./ @@ -35,4 +37,4 @@ rm -rf github.com cosmossdk.io go mod tidy -./scripts/protocgen-pulsar.sh +./scripts/protocgen-pulsar.sh \ No newline at end of file diff --git a/server/README.md b/server/README.md index 21c6bed620d8..a7c0e275fe1b 100644 --- a/server/README.md +++ b/server/README.md @@ -74,26 +74,12 @@ the viper literal and passed to the application construction. Example: ```go -func newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, appOpts server.AppOptions) server.Application { - var cache sdk.MultiStorePersistentCache - - if cast.ToBool(appOpts.Get(server.FlagInterBlockCache)) { - cache = store.NewCommitKVStoreCacheManager() - } - - pruningOpts, err := server.GetPruningOptionsFromFlags(appOpts) - if err != nil { - panic(err) - } - +func newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, appOpts servertypes.AppOptions) servertypes.Application { + baseappOptions := server.DefaultBaseappOptions(appOpts) return simapp.NewSimApp( logger, db, traceStore, true, - baseapp.SetPruning(pruningOpts), - baseapp.SetMinGasPrices(cast.ToString(appOpts.Get(server.FlagMinGasPrices))), - baseapp.SetHaltHeight(cast.ToUint64(appOpts.Get(server.FlagHaltHeight))), - baseapp.SetHaltTime(cast.ToUint64(appOpts.Get(server.FlagHaltTime))), - baseapp.SetInterBlockCache(cache), - baseapp.SetTrace(cast.ToBool(appOpts.Get(server.FlagTrace))), + appOpts, + baseappOptions..., ) } ``` diff --git a/server/api/server.go b/server/api/server.go index 5e273f645360..84a0ad6bd827 100644 --- a/server/api/server.go +++ b/server/api/server.go @@ -9,7 +9,6 @@ import ( "sync" "time" - "cosmossdk.io/log" tmrpcserver "github.com/cometbft/cometbft/rpc/jsonrpc/server" gateway "github.com/cosmos/gogogateway" "github.com/gorilla/handlers" @@ -18,6 +17,8 @@ import ( "github.com/improbable-eng/grpc-web/go/grpcweb" "google.golang.org/grpc" + "cosmossdk.io/log" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec/legacy" "github.com/cosmos/cosmos-sdk/server/config" diff --git a/server/cmd/execute.go b/server/cmd/execute.go index 7a1a0c5ad1f3..cf8e7c009f44 100644 --- a/server/cmd/execute.go +++ b/server/cmd/execute.go @@ -25,9 +25,10 @@ func Execute(rootCmd *cobra.Command, envPrefix, defaultHome string) error { // https://github.com/spf13/cobra/pull/1118. ctx := CreateExecuteContext(context.Background()) - rootCmd.PersistentFlags().String(flags.FlagLogLevel, zerolog.InfoLevel.String(), "The logging level (trace|debug|info|warn|error|fatal|panic)") + rootCmd.PersistentFlags().String(flags.FlagLogLevel, zerolog.InfoLevel.String(), "The logging level (trace|debug|info|warn|error|fatal|panic|disabled or '*:,:')") // NOTE: The default logger is only checking for the "json" value, any other value will default to plain text. rootCmd.PersistentFlags().String(flags.FlagLogFormat, "plain", "The logging format (json|plain)") + rootCmd.PersistentFlags().Bool(flags.FlagLogNoColor, false, "Disable colored logs") executor := cmtcli.PrepareBaseCmd(rootCmd, envPrefix, defaultHome) return executor.ExecuteContext(ctx) diff --git a/server/cmt_abci.go b/server/cmt_abci.go index 3db12dafed5a..74040f245169 100644 --- a/server/cmt_abci.go +++ b/server/cmt_abci.go @@ -4,6 +4,7 @@ import ( "context" abci "github.com/cometbft/cometbft/abci/types" + servertypes "github.com/cosmos/cosmos-sdk/server/types" ) diff --git a/server/cmt_cmds.go b/server/cmt_cmds.go index 02b14a7b4aa4..a66956a9b419 100644 --- a/server/cmt_cmds.go +++ b/server/cmt_cmds.go @@ -1,29 +1,28 @@ package server import ( + "context" + "encoding/json" "fmt" "strconv" "strings" - "cosmossdk.io/log" cmtcfg "github.com/cometbft/cometbft/config" - "github.com/cometbft/cometbft/light" + cmtjson "github.com/cometbft/cometbft/libs/json" "github.com/cometbft/cometbft/node" "github.com/cometbft/cometbft/p2p" pvm "github.com/cometbft/cometbft/privval" - cmtstore "github.com/cometbft/cometbft/proto/tendermint/store" - sm "github.com/cometbft/cometbft/state" - "github.com/cometbft/cometbft/statesync" - "github.com/cometbft/cometbft/store" cmtversion "github.com/cometbft/cometbft/version" "github.com/spf13/cobra" "sigs.k8s.io/yaml" + "cosmossdk.io/log" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/grpc/cmtservice" rpc "github.com/cosmos/cosmos-sdk/client/rpc" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" - servercmtlog "github.com/cosmos/cosmos-sdk/server/log" "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" @@ -31,6 +30,43 @@ import ( auth "github.com/cosmos/cosmos-sdk/x/auth/client/cli" ) +// StatusCommand returns the command to return the status of the network. +func StatusCommand() *cobra.Command { + cmd := &cobra.Command{ + Use: "status", + Short: "Query remote node for status", + RunE: func(cmd *cobra.Command, _ []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + status, err := cmtservice.GetNodeStatus(context.Background(), clientCtx) + if err != nil { + return err + } + + output, err := cmtjson.Marshal(status) + if err != nil { + return err + } + + // In order to maintain backwards compatibility, the default json format output + outputFormat, _ := cmd.Flags().GetString(flags.FlagOutput) + if outputFormat == flags.OutputFormatJSON { + clientCtx = clientCtx.WithOutputFormat(flags.OutputFormatJSON) + } + + return clientCtx.PrintRaw(output) + }, + } + + cmd.Flags().StringP(flags.FlagNode, "n", "tcp://localhost:26657", "Node to connect to") + cmd.Flags().StringP(flags.FlagOutput, "o", "json", "Output format (text|json)") + + return cmd +} + // ShowNodeIDCmd - ported from CometBFT, dump node ID to stdout func ShowNodeIDCmd() *cobra.Command { return &cobra.Command{ @@ -45,7 +81,7 @@ func ShowNodeIDCmd() *cobra.Command { return err } - fmt.Println(nodeKey.ID()) + cmd.Println(nodeKey.ID()) return nil }, } @@ -77,7 +113,7 @@ func ShowValidatorCmd() *cobra.Command { return err } - fmt.Println(string(bz)) + cmd.Println(string(bz)) return nil }, } @@ -97,7 +133,8 @@ func ShowAddressCmd() *cobra.Command { privValidator := pvm.LoadFilePV(cfg.PrivValidatorKeyFile(), cfg.PrivValidatorStateFile()) valConsAddr := (sdk.ConsAddress)(privValidator.GetAddress()) - fmt.Println(valConsAddr.String()) + + cmd.Println(valConsAddr.String()) return nil }, } @@ -127,7 +164,7 @@ func VersionCmd() *cobra.Command { return err } - cmd.Print(string(bs)) + cmd.Println(string(bs)) return nil }, } @@ -145,7 +182,7 @@ Please refer to each module's documentation for the full set of events to query for. Each module documents its respective events under 'xx_events.md'. `, Example: fmt.Sprintf( - "$ %s query blocks --query \"message.sender='cosmos1...' AND block.height > 7\" --page 1 --limit 30 --order-by ASC", + "$ %s query blocks --query \"message.sender='cosmos1...' AND block.height > 7\" --page 1 --limit 30 --order_by asc", version.AppName, ), RunE: func(cmd *cobra.Command, args []string) error { @@ -189,7 +226,7 @@ $ %s query block --%s=%s `, version.AppName, auth.FlagType, auth.TypeHeight, version.AppName, auth.FlagType, auth.TypeHash)), - Args: cobra.ExactArgs(1), + Args: cobra.MaximumNArgs(1), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { @@ -197,29 +234,37 @@ $ %s query block --%s=%s } typ, _ := cmd.Flags().GetString(auth.FlagType) + if len(args) == 0 { + // do not break default v0.50 behavior of block hash + // if no args are provided, set the type to height + typ = auth.TypeHeight + } switch typ { case auth.TypeHeight: - - if args[0] == "" { - return fmt.Errorf("argument should be a block height") + var ( + err error + height int64 + ) + heightStr := "" + if len(args) > 0 { + heightStr = args[0] } - var height *int64 - - // optional height - if len(args) > 0 { - h, err := strconv.Atoi(args[0]) + if heightStr == "" { + cmd.Println("Falling back to latest block height:") + height, err = rpc.GetChainHeight(clientCtx) if err != nil { - return err + return fmt.Errorf("failed to get chain height: %w", err) } - if h > 0 { - tmp := int64(h) - height = &tmp + } else { + height, err = strconv.ParseInt(heightStr, 10, 64) + if err != nil { + return fmt.Errorf("failed to parse block height: %w", err) } } - output, err := rpc.GetBlockByHeight(clientCtx, height) + output, err := rpc.GetBlockByHeight(clientCtx, &height) if err != nil { return err } @@ -260,87 +305,87 @@ $ %s query block --%s=%s return cmd } -func BootstrapStateCmd(appCreator types.AppCreator) *cobra.Command { +// QueryBlockResultsCmd implements the default command for a BlockResults query. +func QueryBlockResultsCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "bootstrap-state", - Short: "Bootstrap CometBFT state at an arbitrary block height using a light client", - Args: cobra.NoArgs, + Use: "block-results [height]", + Short: "Query for a committed block's results by height", + Long: "Query for a specific committed block's results using the CometBFT RPC `block_results` method", + Args: cobra.RangeArgs(0, 1), RunE: func(cmd *cobra.Command, args []string) error { - serverCtx := GetServerContextFromCmd(cmd) - logger := log.NewLogger(cmd.OutOrStdout()) - cfg := serverCtx.Config + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } - height, err := cmd.Flags().GetInt64("height") + node, err := clientCtx.GetNode() if err != nil { return err } - if height == 0 { - home := serverCtx.Viper.GetString(flags.FlagHome) - db, err := openDB(home, GetAppDBBackend(serverCtx.Viper)) + + // optional height + var height int64 + if len(args) > 0 { + height, err = strconv.ParseInt(args[0], 10, 64) if err != nil { return err } - - app := appCreator(logger, db, nil, serverCtx.Viper) - height = app.CommitMultiStore().LastCommitID().Version + } else { + cmd.Println("Falling back to latest block height:") + height, err = rpc.GetChainHeight(clientCtx) + if err != nil { + return fmt.Errorf("failed to get chain height: %w", err) + } } - blockStoreDB, err := cmtcfg.DefaultDBProvider(&cmtcfg.DBContext{ID: "blockstore", Config: cfg}) + blockRes, err := node.BlockResults(context.Background(), &height) if err != nil { return err } - blockStore := store.NewBlockStore(blockStoreDB) - stateDB, err := cmtcfg.DefaultDBProvider(&cmtcfg.DBContext{ID: "state", Config: cfg}) + // coretypes.ResultBlockResults doesn't implement proto.Message interface + // so we can't print it using clientCtx.PrintProto + // we choose to serialize it to json and print the json instead + blockResStr, err := json.Marshal(blockRes) if err != nil { return err } - stateStore := sm.NewStore(stateDB, sm.StoreOptions{ - DiscardABCIResponses: cfg.Storage.DiscardABCIResponses, - }) - genState, _, err := node.LoadStateFromDBOrGenesisDocProvider(stateDB, node.DefaultGenesisDocProviderFunc(cfg)) - if err != nil { - return err - } + return clientCtx.PrintRaw(blockResStr) + }, + } - stateProvider, err := statesync.NewLightClientStateProvider( - cmd.Context(), - genState.ChainID, genState.Version, genState.InitialHeight, - cfg.StateSync.RPCServers, light.TrustOptions{ - Period: cfg.StateSync.TrustPeriod, - Height: cfg.StateSync.TrustHeight, - Hash: cfg.StateSync.TrustHashBytes(), - }, servercmtlog.CometLoggerWrapper{Logger: logger.With("module", "light")}) - if err != nil { - return fmt.Errorf("failed to set up light client state provider: %w", err) - } + flags.AddQueryFlagsToCmd(cmd) - state, err := stateProvider.State(cmd.Context(), uint64(height)) - if err != nil { - return fmt.Errorf("failed to get state: %w", err) - } + return cmd +} - commit, err := stateProvider.Commit(cmd.Context(), uint64(height)) - if err != nil { - return fmt.Errorf("failed to get commit: %w", err) - } +func BootstrapStateCmd(appCreator types.AppCreator) *cobra.Command { + cmd := &cobra.Command{ + Use: "bootstrap-state", + Short: "Bootstrap CometBFT state at an arbitrary block height using a light client", + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) error { + serverCtx := GetServerContextFromCmd(cmd) + logger := log.NewLogger(cmd.OutOrStdout()) + cfg := serverCtx.Config - if err := stateStore.Bootstrap(state); err != nil { - return fmt.Errorf("failed to bootstrap state: %w", err) + height, err := cmd.Flags().GetInt64("height") + if err != nil { + return err } + if height == 0 { + home := serverCtx.Viper.GetString(flags.FlagHome) + db, err := openDB(home, GetAppDBBackend(serverCtx.Viper)) + if err != nil { + return err + } - if err := blockStore.SaveSeenCommit(state.LastBlockHeight, commit); err != nil { - return fmt.Errorf("failed to save seen commit: %w", err) + app := appCreator(logger, db, nil, serverCtx.Viper) + height = app.CommitMultiStore().LastCommitID().Version } - store.SaveBlockStoreState(&cmtstore.BlockStoreState{ - // it breaks the invariant that blocks in range [Base, Height] must exists, but it do works in practice. - Base: state.LastBlockHeight, - Height: state.LastBlockHeight, - }, blockStoreDB) - - return nil + return node.BootstrapStateWithGenProvider(cmd.Context(), cfg, cmtcfg.DefaultDBProvider, getGenDocProvider(cfg), uint64(height), nil) }, } diff --git a/server/config/config.go b/server/config/config.go index 5cf1313b6673..d97dedc5f54e 100644 --- a/server/config/config.go +++ b/server/config/config.go @@ -3,7 +3,6 @@ package config import ( "fmt" "math" - "strings" "github.com/spf13/viper" @@ -39,6 +38,10 @@ type BaseConfig struct { // specified in this config (e.g. 0.25token1;0.0001token2). MinGasPrices string `mapstructure:"minimum-gas-prices"` + // The maximum amount of gas a grpc/Rest query may consume. + // If set to 0, it is unbounded. + QueryGasLimit uint64 `mapstructure:"query-gas-limit"` + Pruning string `mapstructure:"pruning"` PruningKeepRecent string `mapstructure:"pruning-keep-recent"` PruningInterval string `mapstructure:"pruning-interval"` @@ -85,9 +88,6 @@ type BaseConfig struct { // IAVLDisableFastNode enables or disables the fast sync node. IAVLDisableFastNode bool `mapstructure:"iavl-disable-fastnode"` - // IAVLLazyLoading enable/disable the lazy loading of iavl store. - IAVLLazyLoading bool `mapstructure:"iavl-lazy-loading"` - // AppDBBackend defines the type of Database to use for the application and snapshots databases. // An empty string indicates that the CometBFT config's DBBackend value should be used. AppDBBackend string `mapstructure:"app-db-backend"` @@ -165,7 +165,7 @@ type MempoolConfig struct { // the mempool is disabled entirely, zero indicates that the mempool is // unbounded in how many txs it may contain, and a positive value indicates // the maximum amount of txs it may contain. - MaxTxs int + MaxTxs int `mapstructure:"max-txs"` } // State Streaming configuration @@ -201,23 +201,15 @@ func (c *Config) SetMinGasPrices(gasPrices sdk.DecCoins) { c.MinGasPrices = gasPrices.String() } -// GetMinGasPrices returns the validator's minimum gas prices based on the set -// configuration. +// GetMinGasPrices returns the validator's minimum gas prices based on the set configuration. func (c *Config) GetMinGasPrices() sdk.DecCoins { if c.MinGasPrices == "" { return sdk.DecCoins{} } - gasPricesStr := strings.Split(c.MinGasPrices, ";") - gasPrices := make(sdk.DecCoins, len(gasPricesStr)) - - for i, s := range gasPricesStr { - gasPrice, err := sdk.ParseDecCoin(s) - if err != nil { - panic(fmt.Errorf("failed to parse minimum gas price coin (%s): %s", s, err)) - } - - gasPrices[i] = gasPrice + gasPrices, err := sdk.ParseDecCoins(c.MinGasPrices) + if err != nil { + panic(fmt.Sprintf("invalid minimum gas prices: %v", err)) } return gasPrices @@ -228,6 +220,7 @@ func DefaultConfig() *Config { return &Config{ BaseConfig: BaseConfig{ MinGasPrices: defaultMinGasPrices, + QueryGasLimit: 0, InterBlockCache: true, Pruning: pruningtypes.PruningOptionDefault, PruningKeepRecent: "0", @@ -236,7 +229,6 @@ func DefaultConfig() *Config { IndexEvents: make([]string, 0), IAVLCacheSize: 781250, IAVLDisableFastNode: false, - IAVLLazyLoading: false, AppDBBackend: "", }, Telemetry: telemetry.Config{ @@ -271,7 +263,7 @@ func DefaultConfig() *Config { }, }, Mempool: MempoolConfig{ - MaxTxs: 5_000, + MaxTxs: -1, }, } } diff --git a/server/config/config_test.go b/server/config/config_test.go index c15186e73a2d..bd5cf061b350 100644 --- a/server/config/config_test.go +++ b/server/config/config_test.go @@ -18,10 +18,18 @@ func TestDefaultConfig(t *testing.T) { require.True(t, cfg.GetMinGasPrices().IsZero()) } -func TestSetMinimumFees(t *testing.T) { +func TestGetAndSetMinimumGas(t *testing.T) { cfg := DefaultConfig() - cfg.SetMinGasPrices(sdk.DecCoins{sdk.NewInt64DecCoin("foo", 5)}) + + input := sdk.DecCoins{sdk.NewInt64DecCoin("foo", 5)} + cfg.SetMinGasPrices(input) require.Equal(t, "5.000000000000000000foo", cfg.MinGasPrices) + require.EqualValues(t, cfg.GetMinGasPrices(), input) + + input = sdk.DecCoins{sdk.NewInt64DecCoin("bar", 1), sdk.NewInt64DecCoin("foo", 5)} + cfg.SetMinGasPrices(input) + require.Equal(t, "1.000000000000000000bar,5.000000000000000000foo", cfg.MinGasPrices) + require.EqualValues(t, cfg.GetMinGasPrices(), input) } func TestIndexEventsMarshalling(t *testing.T) { @@ -208,3 +216,21 @@ func TestSetConfigTemplate(t *testing.T) { actual := setBuffer.String() require.Equal(t, expected, actual, "resulting config strings") } + +func TestAppConfig(t *testing.T) { + appConfigFile := filepath.Join(t.TempDir(), "app.toml") + defer func() { + _ = os.Remove(appConfigFile) + }() + + defAppConfig := DefaultConfig() + SetConfigTemplate(DefaultConfigTemplate) + WriteConfigFile(appConfigFile, defAppConfig) + + v := viper.New() + v.SetConfigFile(appConfigFile) + require.NoError(t, v.ReadInConfig()) + appCfg := new(Config) + require.NoError(t, v.Unmarshal(appCfg)) + require.EqualValues(t, appCfg, defAppConfig) +} diff --git a/server/config/toml.go b/server/config/toml.go index de846d8f8575..b3c20c69a024 100644 --- a/server/config/toml.go +++ b/server/config/toml.go @@ -18,9 +18,13 @@ const DefaultConfigTemplate = `# This is a TOML config file. # The minimum gas prices a validator is willing to accept for processing a # transaction. A transaction's fees must meet the minimum of any denomination -# specified in this config (e.g. 0.25token1;0.0001token2). +# specified in this config (e.g. 0.25token1,0.0001token2). minimum-gas-prices = "{{ .BaseConfig.MinGasPrices }}" +# The maximum gas a query coming over rest/grpc may consume. +# If this is set to zero, the query can consume an unbounded amount of gas. +query-gas-limit = "{{ .BaseConfig.QueryGasLimit }}" + # default: the last 362880 states are kept, pruning at 10 block intervals # nothing: all historic states will be saved, nothing will be deleted (i.e. archiving node) # everything: 2 latest states will be kept; pruning at 10 block intervals. @@ -77,14 +81,9 @@ iavl-cache-size = {{ .BaseConfig.IAVLCacheSize }} # Default is false. iavl-disable-fastnode = {{ .BaseConfig.IAVLDisableFastNode }} -# IAVLLazyLoading enable/disable the lazy loading of iavl store. -# Default is false. -iavl-lazy-loading = {{ .BaseConfig.IAVLLazyLoading }} - # AppDBBackend defines the database backend type to use for the application and snapshots DBs. # An empty string indicates that a fallback will be used. -# First fallback is the deprecated compile-time types.DBBackend value. -# Second fallback (if the types.DBBackend also isn't set), is the db-backend value set in CometBFT's config.toml. +# The fallback is the db_backend value set in CometBFT's config.toml. app-db-backend = "{{ .BaseConfig.AppDBBackend }}" ############################################################################### @@ -122,6 +121,17 @@ global-labels = [{{ range $k, $v := .Telemetry.GlobalLabels }} ["{{index $v 0 }}", "{{ index $v 1}}"],{{ end }} ] +# MetricsSink defines the type of metrics sink to use. +metrics-sink = "{{ .Telemetry.MetricsSink }}" + +# StatsdAddr defines the address of a statsd server to send metrics to. +# Only utilized if MetricsSink is set to "statsd" or "dogstatsd". +statsd-addr = "{{ .Telemetry.StatsdAddr }}" + +# DatadogHostname defines the hostname to use when emitting metrics to +# Datadog. Only utilized if MetricsSink is set to "dogstatsd". +datadog-hostname = "{{ .Telemetry.DatadogHostname }}" + ############################################################################### ### API Configuration ### ############################################################################### @@ -230,12 +240,12 @@ stop-node-on-err = {{ .Streaming.ABCI.StopNodeOnErr }} [mempool] # Setting max-txs to 0 will allow for a unbounded amount of transactions in the mempool. -# Setting max_txs to negative 1 (-1) will disable transactions from being inserted into the mempool. +# Setting max_txs to negative 1 (-1) will disable transactions from being inserted into the mempool (no-op mempool). # Setting max_txs to a positive number (> 0) will limit the number of transactions in the mempool, by the specified amount. # # Note, this configuration only applies to SDK built-in app-side mempool # implementations. -max-txs = "{{ .Mempool.MaxTxs }}" +max-txs = {{ .Mempool.MaxTxs }} ` var configTemplate *template.Template diff --git a/server/constructors_test.go b/server/constructors_test.go index 02e3c51feb9d..0932d79488d0 100644 --- a/server/constructors_test.go +++ b/server/constructors_test.go @@ -4,9 +4,8 @@ import ( "path/filepath" "testing" - "github.com/stretchr/testify/require" - dbm "github.com/cosmos/cosmos-db" + "github.com/stretchr/testify/require" ) func Test_openDB(t *testing.T) { diff --git a/server/export.go b/server/export.go index eeac72fabe5f..9b43da0c854e 100644 --- a/server/export.go +++ b/server/export.go @@ -11,6 +11,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/server/types" + "github.com/cosmos/cosmos-sdk/version" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" ) @@ -87,6 +88,10 @@ func ExportCmd(appExporter types.AppExporter, defaultNodeHome string) *cobra.Com return err } + // set current binary version + appGenesis.AppName = version.AppName + appGenesis.AppVersion = version.Version + appGenesis.AppState = exported.AppState appGenesis.InitialHeight = exported.Height appGenesis.Consensus = genutiltypes.NewConsensusGenesis(exported.ConsensusParams, exported.Validators) diff --git a/server/export_test.go b/server/export_test.go index 6d1886469181..d1dad66aaa65 100644 --- a/server/export_test.go +++ b/server/export_test.go @@ -10,11 +10,16 @@ import ( "testing" "time" - "cosmossdk.io/log" cmtcfg "github.com/cometbft/cometbft/config" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" cmttypes "github.com/cometbft/cometbft/types" dbm "github.com/cosmos/cosmos-db" + "github.com/rs/zerolog" + "github.com/spf13/viper" + "github.com/stretchr/testify/require" + + "cosmossdk.io/log" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/server" "github.com/cosmos/cosmos-sdk/server/types" @@ -22,9 +27,6 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" - "github.com/rs/zerolog" - "github.com/spf13/viper" - "github.com/stretchr/testify/require" ) // ExportSystem wraps a (*cmdtest).System diff --git a/server/grpc/gogoreflection/serverreflection.go b/server/grpc/gogoreflection/serverreflection.go index 916015366dba..fd48aa416b40 100644 --- a/server/grpc/gogoreflection/serverreflection.go +++ b/server/grpc/gogoreflection/serverreflection.go @@ -51,7 +51,7 @@ import ( dpb "github.com/golang/protobuf/protoc-gen-go/descriptor" "google.golang.org/grpc" "google.golang.org/grpc/codes" - rpb "google.golang.org/grpc/reflection/grpc_reflection_v1" + rpb "google.golang.org/grpc/reflection/grpc_reflection_v1alpha" "google.golang.org/grpc/status" ) @@ -387,60 +387,60 @@ func (s *serverReflectionServer) ServerReflectionInfo(stream rpb.ServerReflectio return err } - out := &rpb.ServerReflectionResponse{ - ValidHost: in.Host, + out := &rpb.ServerReflectionResponse{ //nolint:staticcheck // SA1019: we want to keep using v1alpha + ValidHost: in.Host, //nolint:staticcheck // SA1019: we want to keep using v1alpha OriginalRequest: in, } switch req := in.MessageRequest.(type) { case *rpb.ServerReflectionRequest_FileByFilename: - b, err := s.fileDescEncodingByFilename(req.FileByFilename, sentFileDescriptors) + b, err := s.fileDescEncodingByFilename(req.FileByFilename, sentFileDescriptors) //nolint:staticcheck // SA1019: we want to keep using v1alpha if err != nil { out.MessageResponse = &rpb.ServerReflectionResponse_ErrorResponse{ - ErrorResponse: &rpb.ErrorResponse{ + ErrorResponse: &rpb.ErrorResponse{ //nolint:staticcheck // SA1019: we want to keep using v1alpha ErrorCode: int32(codes.NotFound), ErrorMessage: err.Error(), }, } } else { out.MessageResponse = &rpb.ServerReflectionResponse_FileDescriptorResponse{ - FileDescriptorResponse: &rpb.FileDescriptorResponse{FileDescriptorProto: b}, + FileDescriptorResponse: &rpb.FileDescriptorResponse{FileDescriptorProto: b}, //nolint:staticcheck // SA1019: we want to keep using v1alpha } } case *rpb.ServerReflectionRequest_FileContainingSymbol: - b, err := s.fileDescEncodingContainingSymbol(req.FileContainingSymbol, sentFileDescriptors) + b, err := s.fileDescEncodingContainingSymbol(req.FileContainingSymbol, sentFileDescriptors) //nolint:staticcheck // SA1019: we want to keep using v1alpha if err != nil { out.MessageResponse = &rpb.ServerReflectionResponse_ErrorResponse{ - ErrorResponse: &rpb.ErrorResponse{ + ErrorResponse: &rpb.ErrorResponse{ //nolint:staticcheck // SA1019: we want to keep using v1alpha ErrorCode: int32(codes.NotFound), ErrorMessage: err.Error(), }, } } else { out.MessageResponse = &rpb.ServerReflectionResponse_FileDescriptorResponse{ - FileDescriptorResponse: &rpb.FileDescriptorResponse{FileDescriptorProto: b}, + FileDescriptorResponse: &rpb.FileDescriptorResponse{FileDescriptorProto: b}, //nolint:staticcheck // SA1019: we want to keep using v1alpha } } case *rpb.ServerReflectionRequest_FileContainingExtension: - typeName := req.FileContainingExtension.ContainingType - extNum := req.FileContainingExtension.ExtensionNumber + typeName := req.FileContainingExtension.ContainingType //nolint:staticcheck // SA1019: we want to keep using v1alpha + extNum := req.FileContainingExtension.ExtensionNumber //nolint:staticcheck // SA1019: we want to keep using v1alpha b, err := s.fileDescEncodingContainingExtension(typeName, extNum, sentFileDescriptors) if err != nil { out.MessageResponse = &rpb.ServerReflectionResponse_ErrorResponse{ - ErrorResponse: &rpb.ErrorResponse{ + ErrorResponse: &rpb.ErrorResponse{ //nolint:staticcheck // SA1019: we want to keep using v1alpha ErrorCode: int32(codes.NotFound), ErrorMessage: err.Error(), }, } } else { out.MessageResponse = &rpb.ServerReflectionResponse_FileDescriptorResponse{ - FileDescriptorResponse: &rpb.FileDescriptorResponse{FileDescriptorProto: b}, + FileDescriptorResponse: &rpb.FileDescriptorResponse{FileDescriptorProto: b}, //nolint:staticcheck // SA1019: we want to keep using v1alpha } } case *rpb.ServerReflectionRequest_AllExtensionNumbersOfType: - extNums, err := s.allExtensionNumbersForTypeName(req.AllExtensionNumbersOfType) + extNums, err := s.allExtensionNumbersForTypeName(req.AllExtensionNumbersOfType) //nolint:staticcheck // SA1019: we want to keep using v1alpha if err != nil { out.MessageResponse = &rpb.ServerReflectionResponse_ErrorResponse{ - ErrorResponse: &rpb.ErrorResponse{ + ErrorResponse: &rpb.ErrorResponse{ //nolint:staticcheck // SA1019: we want to keep using v1alpha ErrorCode: int32(codes.NotFound), ErrorMessage: err.Error(), }, @@ -448,22 +448,22 @@ func (s *serverReflectionServer) ServerReflectionInfo(stream rpb.ServerReflectio log.Printf("OH NO: %s", err) } else { out.MessageResponse = &rpb.ServerReflectionResponse_AllExtensionNumbersResponse{ - AllExtensionNumbersResponse: &rpb.ExtensionNumberResponse{ - BaseTypeName: req.AllExtensionNumbersOfType, + AllExtensionNumbersResponse: &rpb.ExtensionNumberResponse{ //nolint:staticcheck // SA1019: we want to keep using v1alpha + BaseTypeName: req.AllExtensionNumbersOfType, //nolint:staticcheck // SA1019: we want to keep using v1alpha ExtensionNumber: extNums, }, } } case *rpb.ServerReflectionRequest_ListServices: svcNames, _ := s.getSymbols() - serviceResponses := make([]*rpb.ServiceResponse, len(svcNames)) + serviceResponses := make([]*rpb.ServiceResponse, len(svcNames)) //nolint:staticcheck // SA1019: we want to keep using v1alpha for i, n := range svcNames { - serviceResponses[i] = &rpb.ServiceResponse{ + serviceResponses[i] = &rpb.ServiceResponse{ //nolint:staticcheck // SA1019: we want to keep using v1alpha Name: n, } } out.MessageResponse = &rpb.ServerReflectionResponse_ListServicesResponse{ - ListServicesResponse: &rpb.ListServiceResponse{ + ListServicesResponse: &rpb.ListServiceResponse{ //nolint:staticcheck // SA1019: we want to keep using v1alpha Service: serviceResponses, }, } diff --git a/server/grpc/reflection/v2alpha1/reflection.pb.go b/server/grpc/reflection/v2alpha1/reflection.pb.go index 360e4440e8f6..260a44d1755f 100644 --- a/server/grpc/reflection/v2alpha1/reflection.pb.go +++ b/server/grpc/reflection/v2alpha1/reflection.pb.go @@ -1677,6 +1677,7 @@ func _ReflectionService_GetTxDescriptor_Handler(srv interface{}, ctx context.Con return interceptor(ctx, in, info, handler) } +var ReflectionService_serviceDesc = _ReflectionService_serviceDesc var _ReflectionService_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.base.reflection.v2alpha1.ReflectionService", HandlerType: (*ReflectionServiceServer)(nil), diff --git a/server/grpc/server_test.go b/server/grpc/server_test.go index 8cc51e0a5be8..6c45094b24f0 100644 --- a/server/grpc/server_test.go +++ b/server/grpc/server_test.go @@ -6,10 +6,9 @@ import ( "testing" "time" + "github.com/jhump/protoreflect/grpcreflect" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - - "github.com/jhump/protoreflect/grpcreflect" "google.golang.org/grpc" "google.golang.org/grpc/metadata" @@ -52,7 +51,7 @@ func (s *IntegrationTestSuite) SetupSuite() { s.Require().NoError(err) val0 := s.network.Validators[0] - s.conn, err = grpc.Dial( + s.conn, err = grpc.Dial( //nolint:staticcheck // ignore this line for this linter val0.AppConfig.GRPC.Address, grpc.WithInsecure(), //nolint:staticcheck // ignore SA1019, we don't need to use a secure connection for tests grpc.WithDefaultCallOptions(grpc.ForceCodec(codec.NewProtoCodec(s.cfg.InterfaceRegistry).GRPCCodec())), diff --git a/server/log/cmt_logger.go b/server/log/cmt_logger.go index 9780c11ee5e8..9cc9380372e6 100644 --- a/server/log/cmt_logger.go +++ b/server/log/cmt_logger.go @@ -1,8 +1,9 @@ package server import ( - "cosmossdk.io/log" cmtlog "github.com/cometbft/cometbft/libs/log" + + "cosmossdk.io/log" ) var _ cmtlog.Logger = (*CometLoggerWrapper)(nil) diff --git a/server/mock/app.go b/server/mock/app.go index d5ebd12f0cf1..3b4205166008 100644 --- a/server/mock/app.go +++ b/server/mock/app.go @@ -10,10 +10,14 @@ import ( abci "github.com/cometbft/cometbft/abci/types" db "github.com/cosmos/cosmos-db" "google.golang.org/grpc" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/reflect/protodesc" + "google.golang.org/protobuf/reflect/protoregistry" + "google.golang.org/protobuf/types/descriptorpb" "cosmossdk.io/log" - storetypes "cosmossdk.io/store/types" + bam "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/testutil" @@ -45,7 +49,7 @@ func NewApp(rootDir string, logger log.Logger) (servertypes.ABCI, error) { router.SetInterfaceRegistry(interfaceRegistry) newDesc := &grpc.ServiceDesc{ - ServiceName: "test", + ServiceName: "Test", Methods: []grpc.MethodDesc{ { MethodName: "Test", @@ -66,7 +70,7 @@ func NewApp(rootDir string, logger log.Logger) (servertypes.ABCI, error) { // KVStoreHandler is a simple handler that takes KVStoreTx and writes // them to the db. -func KVStoreHandler(storeKey storetypes.StoreKey) sdk.Handler { +func KVStoreHandler(storeKey storetypes.StoreKey) bam.MsgServiceHandler { return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { dTx, ok := msg.(*KVStoreTx) if !ok { @@ -170,3 +174,47 @@ func MsgTestHandler(srv interface{}, ctx context.Context, dec func(interface{}) func (m MsgServerImpl) Test(ctx context.Context, msg *KVStoreTx) (*sdk.Result, error) { return KVStoreHandler(m.capKeyMainStore)(sdk.UnwrapSDKContext(ctx), msg) } + +func init() { + err := registerFauxDescriptor() + if err != nil { + panic(err) + } +} + +func registerFauxDescriptor() error { + fauxDescriptor, err := protodesc.NewFile(&descriptorpb.FileDescriptorProto{ + Name: proto.String("faux_proto/test.proto"), + Dependency: nil, + PublicDependency: nil, + WeakDependency: nil, + MessageType: []*descriptorpb.DescriptorProto{ + { + Name: proto.String("KVStoreTx"), + }, + }, + EnumType: nil, + Service: []*descriptorpb.ServiceDescriptorProto{ + { + Name: proto.String("Test"), + Method: []*descriptorpb.MethodDescriptorProto{ + { + Name: proto.String("Test"), + InputType: proto.String("KVStoreTx"), + OutputType: proto.String("KVStoreTx"), + }, + }, + }, + }, + Extension: nil, + Options: nil, + SourceCodeInfo: nil, + Syntax: nil, + Edition: nil, + }, nil) + if err != nil { + return err + } + + return protoregistry.GlobalFiles.RegisterFile(fauxDescriptor) +} diff --git a/server/mock/app_test.go b/server/mock/app_test.go index f204c5f5f26c..bb5bd906cc2e 100644 --- a/server/mock/app_test.go +++ b/server/mock/app_test.go @@ -6,10 +6,11 @@ import ( "testing" "time" - "cosmossdk.io/log" abci "github.com/cometbft/cometbft/abci/types" "github.com/stretchr/testify/require" + "cosmossdk.io/log" + servertypes "github.com/cosmos/cosmos-sdk/server/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" diff --git a/server/mock/store.go b/server/mock/store.go index 2094e2905d0a..6e8a30364614 100644 --- a/server/mock/store.go +++ b/server/mock/store.go @@ -142,10 +142,6 @@ func (ms multiStore) SetIAVLDisableFastNode(disable bool) { panic("not implemented") } -func (ms multiStore) SetLazyLoading(bool) { - panic("not implemented") -} - func (ms multiStore) SetInitialVersion(version int64) error { panic("not implemented") } diff --git a/server/mock/tx.go b/server/mock/tx.go index 941c002e0036..f8bdef446a9a 100644 --- a/server/mock/tx.go +++ b/server/mock/tx.go @@ -4,17 +4,16 @@ import ( "bytes" "fmt" - bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" protov2 "google.golang.org/protobuf/proto" - "github.com/cosmos/cosmos-sdk/x/auth/signing" - + bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" errorsmod "cosmossdk.io/errors" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" txsigning "github.com/cosmos/cosmos-sdk/types/tx/signing" + "github.com/cosmos/cosmos-sdk/x/auth/signing" ) // An sdk.Tx which is its own sdk.Msg. diff --git a/server/module_hash.go b/server/module_hash.go new file mode 100644 index 000000000000..d959b4261c8d --- /dev/null +++ b/server/module_hash.go @@ -0,0 +1,101 @@ +package server + +import ( + "encoding/hex" + "fmt" + "sort" + "strconv" + "strings" + + "github.com/spf13/cobra" + + "cosmossdk.io/store/rootmulti" + storetypes "cosmossdk.io/store/types" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/server/types" + "github.com/cosmos/cosmos-sdk/version" +) + +// ModuleHashByHeightQuery retrieves the module hashes at a given height. +func ModuleHashByHeightQuery(appCreator types.AppCreator) *cobra.Command { + cmd := &cobra.Command{ + Use: "module-hash-by-height [height]", + Short: "Get module hashes at a given height", + Long: "Get module hashes at a given height. This command is useful for debugging and verifying the state of the application at a given height. Daemon should not be running when calling this command.", + Example: fmt.Sprintf("%s module-hash-by-height 16841115", version.AppName), + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + heightToRetrieveString := args[0] + + serverCtx := GetServerContextFromCmd(cmd) + + height, err := strconv.ParseInt(heightToRetrieveString, 10, 64) + if err != nil { + return fmt.Errorf("invalid height: %w", err) + } + + commitInfoForHeight, err := getModuleHashesAtHeight(serverCtx, appCreator, height) + if err != nil { + return err + } + + clientCtx := client.GetClientContextFromCmd(cmd) + return clientCtx.PrintProto(commitInfoForHeight) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func getModuleHashesAtHeight(svrCtx *Context, appCreator types.AppCreator, height int64) (*storetypes.CommitInfo, error) { + home := svrCtx.Config.RootDir + db, err := openDB(home, GetAppDBBackend(svrCtx.Viper)) + if err != nil { + return nil, fmt.Errorf("error opening DB, make sure daemon is not running when calling this query: %w", err) + } + app := appCreator(svrCtx.Logger, db, nil, svrCtx.Viper) + rms, ok := app.CommitMultiStore().(*rootmulti.Store) + if !ok { + return nil, fmt.Errorf("expected rootmulti.Store, got %T", app.CommitMultiStore()) + } + + commitInfoForHeight, err := rms.GetCommitInfo(height) + if err != nil { + return nil, err + } + + // Create a new slice of StoreInfos for storing the modified hashes. + storeInfos := make([]storetypes.StoreInfo, len(commitInfoForHeight.StoreInfos)) + + for i, storeInfo := range commitInfoForHeight.StoreInfos { + // Convert the hash to a hexadecimal string. + hash := strings.ToUpper(hex.EncodeToString(storeInfo.CommitId.Hash)) + + // Create a new StoreInfo with the modified hash. + storeInfos[i] = storetypes.StoreInfo{ + Name: storeInfo.Name, + CommitId: storetypes.CommitID{ + Version: storeInfo.CommitId.Version, + Hash: []byte(hash), + }, + } + } + + // Sort the storeInfos slice based on the module name. + sort.Slice(storeInfos, func(i, j int) bool { + return storeInfos[i].Name < storeInfos[j].Name + }) + + // Create a new CommitInfo with the modified StoreInfos. + commitInfoForHeight = &storetypes.CommitInfo{ + Version: commitInfoForHeight.Version, + StoreInfos: storeInfos, + Timestamp: commitInfoForHeight.Timestamp, + } + + return commitInfoForHeight, nil +} diff --git a/server/start.go b/server/start.go index c589045e62ff..dbc575464669 100644 --- a/server/start.go +++ b/server/start.go @@ -1,32 +1,42 @@ package server import ( + "bufio" "context" - "errors" "fmt" "io" "net" "os" + "path/filepath" "runtime/pprof" + "strings" + "time" - pruningtypes "cosmossdk.io/store/pruning/types" - "github.com/armon/go-metrics" "github.com/cometbft/cometbft/abci/server" cmtcmd "github.com/cometbft/cometbft/cmd/cometbft/commands" cmtcfg "github.com/cometbft/cometbft/config" + cmtjson "github.com/cometbft/cometbft/libs/json" "github.com/cometbft/cometbft/node" "github.com/cometbft/cometbft/p2p" pvm "github.com/cometbft/cometbft/privval" + cmtstate "github.com/cometbft/cometbft/proto/tendermint/state" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cometbft/cometbft/proxy" + rpchttp "github.com/cometbft/cometbft/rpc/client/http" "github.com/cometbft/cometbft/rpc/client/local" + sm "github.com/cometbft/cometbft/state" + "github.com/cometbft/cometbft/store" cmttypes "github.com/cometbft/cometbft/types" dbm "github.com/cosmos/cosmos-db" + "github.com/hashicorp/go-metrics" "github.com/spf13/cobra" "github.com/spf13/pflag" "golang.org/x/sync/errgroup" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" + pruningtypes "cosmossdk.io/store/pruning/types" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/codec" @@ -49,6 +59,7 @@ const ( flagTraceStore = "trace-store" flagCPUProfile = "cpu-profile" FlagMinGasPrices = "minimum-gas-prices" + FlagQueryGasLimit = "query-gas-limit" FlagHaltHeight = "halt-height" FlagHaltTime = "halt-time" FlagInterBlockCache = "inter-block-cache" @@ -63,6 +74,7 @@ const ( FlagMinRetainBlocks = "min-retain-blocks" FlagIAVLCacheSize = "iavl-cache-size" FlagDisableIAVLFastNode = "iavl-disable-fastnode" + FlagShutdownGrace = "shutdown-grace" // state sync-related flags FlagStateSyncSnapshotInterval = "state-sync.snapshot-interval" @@ -86,6 +98,14 @@ const ( // mempool flags FlagMempoolMaxTxs = "mempool.max-txs" + + // testnet keys + KeyIsTestnet = "is-testnet" + KeyNewChainID = "new-chain-ID" + KeyNewOpAddr = "new-operator-addr" + KeyNewValAddr = "new-validator-addr" + KeyUserPubKey = "user-pub-key" + KeyTriggerTestnetUpgrade = "trigger-testnet-upgrade" ) // StartCmdOptions defines options that can be customized in `StartCmdWithOptions`, @@ -96,8 +116,12 @@ type StartCmdOptions struct { // PostSetup can be used to setup extra services under the same cancellable context, // it's not called in stand-alone mode, only for in-process mode. PostSetup func(svrCtx *Context, clientCtx client.Context, ctx context.Context, g *errgroup.Group) error + // PostSetupStandalone can be used to setup extra services under the same cancellable context, + PostSetupStandalone func(svrCtx *Context, clientCtx client.Context, ctx context.Context, g *errgroup.Group) error // AddFlags add custom flags to start cmd AddFlags func(cmd *cobra.Command) + // StartCommandHanlder can be used to customize the start command handler + StartCommandHandler func(svrCtx *Context, clientCtx client.Context, appCreator types.AppCreator, inProcessConsensus bool, opts StartCmdOptions) error } // StartCmd runs the service passed in, either stand-alone or in-process with @@ -113,6 +137,10 @@ func StartCmdWithOptions(appCreator types.AppCreator, defaultNodeHome string, op opts.DBOpener = openDB } + if opts.StartCommandHandler == nil { + opts.StartCommandHandler = start + } + cmd := &cobra.Command{ Use: "start", Short: "Run the full node", @@ -167,61 +195,24 @@ is performed. Note, when enabled, gRPC will also be automatically enabled. serverCtx.Logger.Info("starting ABCI without CometBFT") } - return wrapCPUProfile(serverCtx, func() error { - return start(serverCtx, clientCtx, appCreator, withCMT, opts) + err = wrapCPUProfile(serverCtx, func() error { + return opts.StartCommandHandler(serverCtx, clientCtx, appCreator, withCMT, opts) }) + + serverCtx.Logger.Debug("received quit signal") + graceDuration, _ := cmd.Flags().GetDuration(FlagShutdownGrace) + if graceDuration > 0 { + serverCtx.Logger.Info("graceful shutdown start", FlagShutdownGrace, graceDuration) + <-time.After(graceDuration) + serverCtx.Logger.Info("graceful shutdown complete") + } + + return err }, } cmd.Flags().String(flags.FlagHome, defaultNodeHome, "The application home directory") - cmd.Flags().Bool(flagWithComet, true, "Run abci app embedded in-process with CometBFT") - cmd.Flags().String(flagAddress, "tcp://0.0.0.0:26658", "Listen address") - cmd.Flags().String(flagTransport, "socket", "Transport protocol: socket, grpc") - cmd.Flags().String(flagTraceStore, "", "Enable KVStore tracing to an output file") - cmd.Flags().String(FlagMinGasPrices, "", "Minimum gas prices to accept for transactions; Any fee in a tx must meet this minimum (e.g. 0.01photino;0.0001stake)") - cmd.Flags().IntSlice(FlagUnsafeSkipUpgrades, []int{}, "Skip a set of upgrade heights to continue the old binary") - cmd.Flags().Uint64(FlagHaltHeight, 0, "Block height at which to gracefully halt the chain and shutdown the node") - cmd.Flags().Uint64(FlagHaltTime, 0, "Minimum block time (in Unix seconds) at which to gracefully halt the chain and shutdown the node") - cmd.Flags().Bool(FlagInterBlockCache, true, "Enable inter-block caching") - cmd.Flags().String(flagCPUProfile, "", "Enable CPU profiling and write to the provided file") - cmd.Flags().Bool(FlagTrace, false, "Provide full stack traces for errors in ABCI Log") - cmd.Flags().String(FlagPruning, pruningtypes.PruningOptionDefault, "Pruning strategy (default|nothing|everything|custom)") - cmd.Flags().Uint64(FlagPruningKeepRecent, 0, "Number of recent heights to keep on disk (ignored if pruning is not 'custom')") - cmd.Flags().Uint64(FlagPruningInterval, 0, "Height interval at which pruned heights are removed from disk (ignored if pruning is not 'custom')") - cmd.Flags().Uint(FlagInvCheckPeriod, 0, "Assert registered invariants every N blocks") - cmd.Flags().Uint64(FlagMinRetainBlocks, 0, "Minimum block height offset during ABCI commit to prune CometBFT blocks") - cmd.Flags().Bool(FlagAPIEnable, false, "Define if the API server should be enabled") - cmd.Flags().Bool(FlagAPISwagger, false, "Define if swagger documentation should automatically be registered (Note: the API must also be enabled)") - cmd.Flags().String(FlagAPIAddress, serverconfig.DefaultAPIAddress, "the API server address to listen on") - cmd.Flags().Uint(FlagAPIMaxOpenConnections, 1000, "Define the number of maximum open connections") - cmd.Flags().Uint(FlagRPCReadTimeout, 10, "Define the CometBFT RPC read timeout (in seconds)") - cmd.Flags().Uint(FlagRPCWriteTimeout, 0, "Define the CometBFT RPC write timeout (in seconds)") - cmd.Flags().Uint(FlagRPCMaxBodyBytes, 1000000, "Define the CometBFT maximum request body (in bytes)") - cmd.Flags().Bool(FlagAPIEnableUnsafeCORS, false, "Define if CORS should be enabled (unsafe - use it at your own risk)") - cmd.Flags().Bool(flagGRPCOnly, false, "Start the node in gRPC query only mode (no CometBFT process is started)") - cmd.Flags().Bool(flagGRPCEnable, true, "Define if the gRPC server should be enabled") - cmd.Flags().String(flagGRPCAddress, serverconfig.DefaultGRPCAddress, "the gRPC server address to listen on") - cmd.Flags().Bool(flagGRPCWebEnable, true, "Define if the gRPC-Web server should be enabled. (Note: gRPC must also be enabled)") - cmd.Flags().Uint64(FlagStateSyncSnapshotInterval, 0, "State sync snapshot interval") - cmd.Flags().Uint32(FlagStateSyncSnapshotKeepRecent, 2, "State sync snapshot to keep") - cmd.Flags().Bool(FlagDisableIAVLFastNode, false, "Disable fast node for IAVL tree") - cmd.Flags().Int(FlagMempoolMaxTxs, mempool.DefaultMaxTx, "Sets MaxTx value for the app-side mempool") - - // support old flags name for backwards compatibility - cmd.Flags().SetNormalizeFunc(func(f *pflag.FlagSet, name string) pflag.NormalizedName { - if name == "with-tendermint" { - name = flagWithComet - } - - return pflag.NormalizedName(name) - }) - - // add support for all CometBFT-specific command line options - cmtcmd.AddNodeFlags(cmd) - - if opts.AddFlags != nil { - opts.AddFlags(cmd) - } + addStartNodeFlags(cmd, opts) return cmd } @@ -245,12 +236,12 @@ func start(svrCtx *Context, clientCtx client.Context, appCreator types.AppCreato emitServerInfoMetrics() if !withCmt { - return startStandAlone(svrCtx, app, opts) + return startStandAlone(svrCtx, svrCfg, clientCtx, app, metrics, opts) } return startInProcess(svrCtx, svrCfg, clientCtx, app, metrics, opts) } -func startStandAlone(svrCtx *Context, app types.Application, opts StartCmdOptions) error { +func startStandAlone(svrCtx *Context, svrCfg serverconfig.Config, clientCtx client.Context, app types.Application, metrics *telemetry.Metrics, opts StartCmdOptions) error { addr := svrCtx.Viper.GetString(flagAddress) transport := svrCtx.Viper.GetString(flagTransport) @@ -264,6 +255,42 @@ func startStandAlone(svrCtx *Context, app types.Application, opts StartCmdOption g, ctx := getCtx(svrCtx, false) + // Add the tx service to the gRPC router. We only need to register this + // service if API or gRPC is enabled, and avoid doing so in the general + // case, because it spawns a new local CometBFT RPC client. + if svrCfg.API.Enable || svrCfg.GRPC.Enable { + // create tendermint client + // assumes the rpc listen address is where tendermint has its rpc server + rpcclient, err := rpchttp.New(svrCtx.Config.RPC.ListenAddress, "/websocket") + if err != nil { + return err + } + // re-assign for making the client available below + // do not use := to avoid shadowing clientCtx + clientCtx = clientCtx.WithClient(rpcclient) + + // use the provided clientCtx to register the services + app.RegisterTxService(clientCtx) + app.RegisterTendermintService(clientCtx) + app.RegisterNodeService(clientCtx, svrCfg) + } + + grpcSrv, clientCtx, err := startGrpcServer(ctx, g, svrCfg.GRPC, clientCtx, svrCtx, app) + if err != nil { + return err + } + + err = startAPIServer(ctx, g, svrCfg, clientCtx, svrCtx, app, svrCtx.Config.RootDir, grpcSrv, metrics) + if err != nil { + return err + } + + if opts.PostSetupStandalone != nil { + if err := opts.PostSetupStandalone(svrCtx, clientCtx, ctx, g); err != nil { + return err + } + } + g.Go(func() error { if err := svr.Start(); err != nil { svrCtx.Logger.Error("failed to start out-of-process ABCI server", "err", err) @@ -274,7 +301,7 @@ func startStandAlone(svrCtx *Context, app types.Application, opts StartCmdOption // so we can gracefully stop the ABCI server. <-ctx.Done() svrCtx.Logger.Info("stopping the ABCI server...") - return errors.Join(svr.Stop(), app.Close()) + return svr.Stop() }) return g.Wait() @@ -284,17 +311,17 @@ func startInProcess(svrCtx *Context, svrCfg serverconfig.Config, clientCtx clien metrics *telemetry.Metrics, opts StartCmdOptions, ) error { cmtCfg := svrCtx.Config - home := cmtCfg.RootDir - gRPCOnly := svrCtx.Viper.GetBool(flagGRPCOnly) + g, ctx := getCtx(svrCtx, true) + if gRPCOnly { // TODO: Generalize logic so that gRPC only is really in startStandAlone svrCtx.Logger.Info("starting node in gRPC only mode; CometBFT is disabled") svrCfg.GRPC.Enable = true } else { svrCtx.Logger.Info("starting node with ABCI CometBFT in-process") - tmNode, cleanupFn, err := startCmtNode(cmtCfg, app, svrCtx) + tmNode, cleanupFn, err := startCmtNode(ctx, cmtCfg, app, svrCtx) if err != nil { return err } @@ -314,14 +341,12 @@ func startInProcess(svrCtx *Context, svrCfg serverconfig.Config, clientCtx clien } } - g, ctx := getCtx(svrCtx, true) - grpcSrv, clientCtx, err := startGrpcServer(ctx, g, svrCfg.GRPC, clientCtx, svrCtx, app) if err != nil { return err } - err = startAPIServer(ctx, g, cmtCfg, svrCfg, clientCtx, svrCtx, app, home, grpcSrv, metrics) + err = startAPIServer(ctx, g, svrCfg, clientCtx, svrCtx, app, cmtCfg.RootDir, grpcSrv, metrics) if err != nil { return err } @@ -339,6 +364,7 @@ func startInProcess(svrCtx *Context, svrCfg serverconfig.Config, clientCtx clien // TODO: Move nodeKey into being created within the function. func startCmtNode( + ctx context.Context, cfg *cmtcfg.Config, app types.Application, svrCtx *Context, @@ -349,7 +375,8 @@ func startCmtNode( } cmtApp := NewCometABCIWrapper(app) - tmNode, err = node.NewNode( + tmNode, err = node.NewNodeWithContext( + ctx, cfg, pvm.LoadOrGenFilePV(cfg.PrivValidatorKeyFile(), cfg.PrivValidatorStateFile()), nodeKey, @@ -370,7 +397,6 @@ func startCmtNode( cleanupFn = func() { if tmNode != nil && tmNode.IsRunning() { _ = tmNode.Stop() - _ = app.Close() } } @@ -435,7 +461,7 @@ func startGrpcServer( // return grpcServer as nil if gRPC is disabled return nil, clientCtx, nil } - _, port, err := net.SplitHostPort(config.Address) + _, _, err := net.SplitHostPort(config.Address) if err != nil { return nil, clientCtx, err } @@ -450,11 +476,9 @@ func startGrpcServer( maxRecvMsgSize = serverconfig.DefaultGRPCMaxRecvMsgSize } - grpcAddress := fmt.Sprintf("127.0.0.1:%s", port) - // if gRPC is enabled, configure gRPC client for gRPC gateway - grpcClient, err := grpc.Dial( - grpcAddress, + grpcClient, err := grpc.Dial( //nolint: staticcheck // ignore this line for this linter + config.Address, grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithDefaultCallOptions( grpc.ForceCodec(codec.NewProtoCodec(clientCtx.InterfaceRegistry).GRPCCodec()), @@ -467,7 +491,7 @@ func startGrpcServer( } clientCtx = clientCtx.WithGRPCClient(grpcClient) - svrCtx.Logger.Debug("gRPC client assigned to client context", "target", grpcAddress) + svrCtx.Logger.Debug("gRPC client assigned to client context", "target", config.Address) grpcSrv, err := servergrpc.NewGRPCServer(clientCtx, app, config) if err != nil { @@ -485,7 +509,6 @@ func startGrpcServer( func startAPIServer( ctx context.Context, g *errgroup.Group, - cmtCfg *cmtcfg.Config, svrCfg serverconfig.Config, clientCtx client.Context, svrCtx *Context, @@ -514,10 +537,6 @@ func startAPIServer( } func startTelemetry(cfg serverconfig.Config) (*telemetry.Metrics, error) { - if !cfg.Telemetry.Enabled { - return nil, nil - } - return telemetry.New(cfg.Telemetry) } @@ -549,12 +568,7 @@ func wrapCPUProfile(svrCtx *Context, callbackFn func() error) error { }() } - errCh := make(chan error) - go func() { - errCh <- callbackFn() - }() - - return <-errCh + return callbackFn() } // emitServerInfoMetrics emits server info related metrics using application telemetry. @@ -596,7 +610,15 @@ func startApp(svrCtx *Context, appCreator types.AppCreator, opts StartCmdOptions return app, traceCleanupFn, err } - app = appCreator(svrCtx.Logger, db, traceWriter, svrCtx.Viper) + if isTestnet, ok := svrCtx.Viper.Get(KeyIsTestnet).(bool); ok && isTestnet { + app, err = testnetify(svrCtx, appCreator, db, traceWriter) + if err != nil { + return app, traceCleanupFn, err + } + } else { + app = appCreator(svrCtx.Logger, db, traceWriter, svrCtx.Viper) + } + cleanupFn = func() { traceCleanupFn() if localErr := app.Close(); localErr != nil { @@ -605,3 +627,390 @@ func startApp(svrCtx *Context, appCreator types.AppCreator, opts StartCmdOptions } return app, cleanupFn, nil } + +// InPlaceTestnetCreator utilizes the provided chainID and operatorAddress as well as the local private validator key to +// control the network represented in the data folder. This is useful to create testnets nearly identical to your +// mainnet environment. +func InPlaceTestnetCreator(testnetAppCreator types.AppCreator) *cobra.Command { + opts := StartCmdOptions{} + if opts.DBOpener == nil { + opts.DBOpener = openDB + } + + if opts.StartCommandHandler == nil { + opts.StartCommandHandler = start + } + + cmd := &cobra.Command{ + Use: "in-place-testnet [newChainID] [newOperatorAddress]", + Short: "Create and start a testnet from current local state", + Long: `Create and start a testnet from current local state. +After utilizing this command the network will start. If the network is stopped, +the normal "start" command should be used. Re-using this command on state that +has already been modified by this command could result in unexpected behavior. + +Additionally, the first block may take up to one minute to be committed, depending +on how old the block is. For instance, if a snapshot was taken weeks ago and we want +to turn this into a testnet, it is possible lots of pending state needs to be committed +(expiring locks, etc.). It is recommended that you should wait for this block to be committed +before stopping the daemon. + +If the --trigger-testnet-upgrade flag is set, the upgrade handler specified by the flag will be run +on the first block of the testnet. + +Regardless of whether the flag is set or not, if any new stores are introduced in the daemon being run, +those stores will be registered in order to prevent panics. Therefore, you only need to set the flag if +you want to test the upgrade handler itself. +`, + Example: "in-place-testnet localosmosis osmo12smx2wdlyttvyzvzg54y2vnqwq2qjateuf7thj", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + serverCtx := GetServerContextFromCmd(cmd) + _, err := GetPruningOptionsFromFlags(serverCtx.Viper) + if err != nil { + return err + } + + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + withCMT, _ := cmd.Flags().GetBool(flagWithComet) + if !withCMT { + serverCtx.Logger.Info("starting ABCI without CometBFT") + } + + newChainID := args[0] + newOperatorAddress := args[1] + + skipConfirmation, _ := cmd.Flags().GetBool("skip-confirmation") + + if !skipConfirmation { + // Confirmation prompt to prevent accidental modification of state. + reader := bufio.NewReader(os.Stdin) + fmt.Println("This operation will modify state in your data folder and cannot be undone. Do you want to continue? (y/n)") + text, _ := reader.ReadString('\n') + response := strings.TrimSpace(strings.ToLower(text)) + if response != "y" && response != "yes" { + fmt.Println("Operation canceled.") + return nil + } + } + + // Set testnet keys to be used by the application. + // This is done to prevent changes to existing start API. + serverCtx.Viper.Set(KeyIsTestnet, true) + serverCtx.Viper.Set(KeyNewChainID, newChainID) + serverCtx.Viper.Set(KeyNewOpAddr, newOperatorAddress) + + err = wrapCPUProfile(serverCtx, func() error { + return opts.StartCommandHandler(serverCtx, clientCtx, testnetAppCreator, withCMT, opts) + }) + + serverCtx.Logger.Debug("received quit signal") + graceDuration, _ := cmd.Flags().GetDuration(FlagShutdownGrace) + if graceDuration > 0 { + serverCtx.Logger.Info("graceful shutdown start", FlagShutdownGrace, graceDuration) + <-time.After(graceDuration) + serverCtx.Logger.Info("graceful shutdown complete") + } + + return err + }, + } + + addStartNodeFlags(cmd, opts) + cmd.Flags().String(KeyTriggerTestnetUpgrade, "", "If set (example: \"v21\"), triggers the v21 upgrade handler to run on the first block of the testnet") + cmd.Flags().Bool("skip-confirmation", false, "Skip the confirmation prompt") + return cmd +} + +// testnetify modifies both state and blockStore, allowing the provided operator address and local validator key to control the network +// that the state in the data folder represents. The chainID of the local genesis file is modified to match the provided chainID. +func testnetify(ctx *Context, testnetAppCreator types.AppCreator, db dbm.DB, traceWriter io.WriteCloser) (types.Application, error) { + config := ctx.Config + + newChainID, ok := ctx.Viper.Get(KeyNewChainID).(string) + if !ok { + return nil, fmt.Errorf("expected string for key %s", KeyNewChainID) + } + + // Modify app genesis chain ID and save to genesis file. + genFilePath := config.GenesisFile() + appGen, err := genutiltypes.AppGenesisFromFile(genFilePath) + if err != nil { + return nil, err + } + appGen.ChainID = newChainID + if err := appGen.ValidateAndComplete(); err != nil { + return nil, err + } + if err := appGen.SaveAs(genFilePath); err != nil { + return nil, err + } + + // Regenerate addrbook.json to prevent peers on old network from causing error logs. + addrBookPath := filepath.Join(config.RootDir, "config", "addrbook.json") + if err := os.Remove(addrBookPath); err != nil && !os.IsNotExist(err) { + return nil, fmt.Errorf("failed to remove existing addrbook.json: %w", err) + } + + emptyAddrBook := []byte("{}") + if err := os.WriteFile(addrBookPath, emptyAddrBook, 0o600); err != nil { + return nil, fmt.Errorf("failed to create empty addrbook.json: %w", err) + } + + // Load the comet genesis doc provider. + genDocProvider := node.DefaultGenesisDocProviderFunc(config) + + // Initialize blockStore and stateDB. + blockStoreDB, err := cmtcfg.DefaultDBProvider(&cmtcfg.DBContext{ID: "blockstore", Config: config}) + if err != nil { + return nil, err + } + blockStore := store.NewBlockStore(blockStoreDB) + + stateDB, err := cmtcfg.DefaultDBProvider(&cmtcfg.DBContext{ID: "state", Config: config}) + if err != nil { + return nil, err + } + + defer blockStore.Close() + defer stateDB.Close() + + privValidator := pvm.LoadOrGenFilePV(config.PrivValidatorKeyFile(), config.PrivValidatorStateFile()) + userPubKey, err := privValidator.GetPubKey() + if err != nil { + return nil, err + } + validatorAddress := userPubKey.Address() + + stateStore := sm.NewStore(stateDB, sm.StoreOptions{ + DiscardABCIResponses: config.Storage.DiscardABCIResponses, + }) + + state, genDoc, err := node.LoadStateFromDBOrGenesisDocProvider(stateDB, genDocProvider) + if err != nil { + return nil, err + } + + ctx.Viper.Set(KeyNewValAddr, validatorAddress) + ctx.Viper.Set(KeyUserPubKey, userPubKey) + testnetApp := testnetAppCreator(ctx.Logger, db, traceWriter, ctx.Viper) + + // We need to create a temporary proxyApp to get the initial state of the application. + // Depending on how the node was stopped, the application height can differ from the blockStore height. + // This height difference changes how we go about modifying the state. + cmtApp := NewCometABCIWrapper(testnetApp) + _, context := getCtx(ctx, true) + clientCreator := proxy.NewLocalClientCreator(cmtApp) + metrics := node.DefaultMetricsProvider(cmtcfg.DefaultConfig().Instrumentation) + _, _, _, _, proxyMetrics, _, _ := metrics(genDoc.ChainID) + proxyApp := proxy.NewAppConns(clientCreator, proxyMetrics) + if err := proxyApp.Start(); err != nil { + return nil, fmt.Errorf("error starting proxy app connections: %v", err) + } + res, err := proxyApp.Query().Info(context, proxy.RequestInfo) + if err != nil { + return nil, fmt.Errorf("error calling Info: %v", err) + } + err = proxyApp.Stop() + if err != nil { + return nil, err + } + appHash := res.LastBlockAppHash + appHeight := res.LastBlockHeight + + var block *cmttypes.Block + switch { + case appHeight == blockStore.Height(): + block = blockStore.LoadBlock(blockStore.Height()) + // If the state's last blockstore height does not match the app and blockstore height, we likely stopped with the halt height flag. + if state.LastBlockHeight != appHeight { + state.LastBlockHeight = appHeight + block.AppHash = appHash + state.AppHash = appHash + } else { + // Node was likely stopped via SIGTERM, delete the next block's seen commit + err := blockStoreDB.Delete([]byte(fmt.Sprintf("SC:%v", blockStore.Height()+1))) + if err != nil { + return nil, err + } + } + case blockStore.Height() > state.LastBlockHeight: + // This state usually occurs when we gracefully stop the node. + err = blockStore.DeleteLatestBlock() + if err != nil { + return nil, err + } + block = blockStore.LoadBlock(blockStore.Height()) + default: + // If there is any other state, we just load the block + block = blockStore.LoadBlock(blockStore.Height()) + } + + block.ChainID = newChainID + state.ChainID = newChainID + + block.LastBlockID = state.LastBlockID + block.LastCommit.BlockID = state.LastBlockID + + // Create a vote from our validator + vote := cmttypes.Vote{ + Type: cmtproto.PrecommitType, + Height: state.LastBlockHeight, + Round: 0, + BlockID: state.LastBlockID, + Timestamp: time.Now(), + ValidatorAddress: validatorAddress, + ValidatorIndex: 0, + Signature: []byte{}, + } + + // Sign the vote, and copy the proto changes from the act of signing to the vote itself + voteProto := vote.ToProto() + err = privValidator.SignVote(newChainID, voteProto) + if err != nil { + return nil, err + } + vote.Signature = voteProto.Signature + vote.Timestamp = voteProto.Timestamp + + // Modify the block's lastCommit to be signed only by our validator + block.LastCommit.Signatures[0].ValidatorAddress = validatorAddress + block.LastCommit.Signatures[0].Signature = vote.Signature + block.LastCommit.Signatures = []cmttypes.CommitSig{block.LastCommit.Signatures[0]} + + // Load the seenCommit of the lastBlockHeight and modify it to be signed from our validator + seenCommit := blockStore.LoadSeenCommit(state.LastBlockHeight) + seenCommit.BlockID = state.LastBlockID + seenCommit.Round = vote.Round + seenCommit.Signatures[0].Signature = vote.Signature + seenCommit.Signatures[0].ValidatorAddress = validatorAddress + seenCommit.Signatures[0].Timestamp = vote.Timestamp + seenCommit.Signatures = []cmttypes.CommitSig{seenCommit.Signatures[0]} + err = blockStore.SaveSeenCommit(state.LastBlockHeight, seenCommit) + if err != nil { + return nil, err + } + + // Create ValidatorSet struct containing just our valdiator. + newVal := &cmttypes.Validator{ + Address: validatorAddress, + PubKey: userPubKey, + VotingPower: 900000000000000, + } + newValSet := &cmttypes.ValidatorSet{ + Validators: []*cmttypes.Validator{newVal}, + Proposer: newVal, + } + + // Replace all valSets in state to be the valSet with just our validator. + state.Validators = newValSet + state.LastValidators = newValSet + state.NextValidators = newValSet + state.LastHeightValidatorsChanged = blockStore.Height() + + err = stateStore.Save(state) + if err != nil { + return nil, err + } + + // Create a ValidatorsInfo struct to store in stateDB. + valSet, err := state.Validators.ToProto() + if err != nil { + return nil, err + } + valInfo := &cmtstate.ValidatorsInfo{ + ValidatorSet: valSet, + LastHeightChanged: state.LastBlockHeight, + } + buf, err := valInfo.Marshal() + if err != nil { + return nil, err + } + + // Modfiy Validators stateDB entry. + err = stateDB.Set([]byte(fmt.Sprintf("validatorsKey:%v", blockStore.Height())), buf) + if err != nil { + return nil, err + } + + // Modify LastValidators stateDB entry. + err = stateDB.Set([]byte(fmt.Sprintf("validatorsKey:%v", blockStore.Height()-1)), buf) + if err != nil { + return nil, err + } + + // Modify NextValidators stateDB entry. + err = stateDB.Set([]byte(fmt.Sprintf("validatorsKey:%v", blockStore.Height()+1)), buf) + if err != nil { + return nil, err + } + + // Since we modified the chainID, we set the new genesisDoc in the stateDB. + b, err := cmtjson.Marshal(genDoc) + if err != nil { + return nil, err + } + if err := stateDB.SetSync([]byte("genesisDoc"), b); err != nil { + return nil, err + } + + return testnetApp, err +} + +// addStartNodeFlags should be added to any CLI commands that start the network. +func addStartNodeFlags(cmd *cobra.Command, opts StartCmdOptions) { + cmd.Flags().Bool(flagWithComet, true, "Run abci app embedded in-process with CometBFT") + cmd.Flags().String(flagAddress, "tcp://127.0.0.1:26658", "Listen address") + cmd.Flags().String(flagTransport, "socket", "Transport protocol: socket, grpc") + cmd.Flags().String(flagTraceStore, "", "Enable KVStore tracing to an output file") + cmd.Flags().String(FlagMinGasPrices, "", "Minimum gas prices to accept for transactions; Any fee in a tx must meet this minimum (e.g. 0.01photino;0.0001stake)") + cmd.Flags().Uint64(FlagQueryGasLimit, 0, "Maximum gas a Rest/Grpc query can consume. Blank and 0 imply unbounded.") + cmd.Flags().IntSlice(FlagUnsafeSkipUpgrades, []int{}, "Skip a set of upgrade heights to continue the old binary") + cmd.Flags().Uint64(FlagHaltHeight, 0, "Block height at which to gracefully halt the chain and shutdown the node") + cmd.Flags().Uint64(FlagHaltTime, 0, "Minimum block time (in Unix seconds) at which to gracefully halt the chain and shutdown the node") + cmd.Flags().Bool(FlagInterBlockCache, true, "Enable inter-block caching") + cmd.Flags().String(flagCPUProfile, "", "Enable CPU profiling and write to the provided file") + cmd.Flags().Bool(FlagTrace, false, "Provide full stack traces for errors in ABCI Log") + cmd.Flags().String(FlagPruning, pruningtypes.PruningOptionDefault, "Pruning strategy (default|nothing|everything|custom)") + cmd.Flags().Uint64(FlagPruningKeepRecent, 0, "Number of recent heights to keep on disk (ignored if pruning is not 'custom')") + cmd.Flags().Uint64(FlagPruningInterval, 0, "Height interval at which pruned heights are removed from disk (ignored if pruning is not 'custom')") + cmd.Flags().Uint(FlagInvCheckPeriod, 0, "Assert registered invariants every N blocks") + cmd.Flags().Uint64(FlagMinRetainBlocks, 0, "Minimum block height offset during ABCI commit to prune CometBFT blocks") + cmd.Flags().Bool(FlagAPIEnable, false, "Define if the API server should be enabled") + cmd.Flags().Bool(FlagAPISwagger, false, "Define if swagger documentation should automatically be registered (Note: the API must also be enabled)") + cmd.Flags().String(FlagAPIAddress, serverconfig.DefaultAPIAddress, "the API server address to listen on") + cmd.Flags().Uint(FlagAPIMaxOpenConnections, 1000, "Define the number of maximum open connections") + cmd.Flags().Uint(FlagRPCReadTimeout, 10, "Define the CometBFT RPC read timeout (in seconds)") + cmd.Flags().Uint(FlagRPCWriteTimeout, 0, "Define the CometBFT RPC write timeout (in seconds)") + cmd.Flags().Uint(FlagRPCMaxBodyBytes, 1000000, "Define the CometBFT maximum request body (in bytes)") + cmd.Flags().Bool(FlagAPIEnableUnsafeCORS, false, "Define if CORS should be enabled (unsafe - use it at your own risk)") + cmd.Flags().Bool(flagGRPCOnly, false, "Start the node in gRPC query only mode (no CometBFT process is started)") + cmd.Flags().Bool(flagGRPCEnable, true, "Define if the gRPC server should be enabled") + cmd.Flags().String(flagGRPCAddress, serverconfig.DefaultGRPCAddress, "the gRPC server address to listen on") + cmd.Flags().Bool(flagGRPCWebEnable, true, "Define if the gRPC-Web server should be enabled. (Note: gRPC must also be enabled)") + cmd.Flags().Uint64(FlagStateSyncSnapshotInterval, 0, "State sync snapshot interval") + cmd.Flags().Uint32(FlagStateSyncSnapshotKeepRecent, 2, "State sync snapshot to keep") + cmd.Flags().Bool(FlagDisableIAVLFastNode, false, "Disable fast node for IAVL tree") + cmd.Flags().Int(FlagMempoolMaxTxs, mempool.DefaultMaxTx, "Sets MaxTx value for the app-side mempool") + cmd.Flags().Duration(FlagShutdownGrace, 0*time.Second, "On Shutdown, duration to wait for resource clean up") + + // support old flags name for backwards compatibility + cmd.Flags().SetNormalizeFunc(func(f *pflag.FlagSet, name string) pflag.NormalizedName { + if name == "with-tendermint" { + name = flagWithComet + } + + return pflag.NormalizedName(name) + }) + + // add support for all CometBFT-specific command line options + cmtcmd.AddNodeFlags(cmd) + + if opts.AddFlags != nil { + opts.AddFlags(cmd) + } +} diff --git a/server/types/app.go b/server/types/app.go index a13588150d58..3b5feab3c0ca 100644 --- a/server/types/app.go +++ b/server/types/app.go @@ -4,15 +4,16 @@ import ( "encoding/json" "io" - "cosmossdk.io/log" - "cosmossdk.io/store/snapshots" - storetypes "cosmossdk.io/store/types" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" cmttypes "github.com/cometbft/cometbft/types" dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/gogoproto/grpc" "github.com/spf13/cobra" + "cosmossdk.io/log" + "cosmossdk.io/store/snapshots" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/server/api" "github.com/cosmos/cosmos-sdk/server/config" diff --git a/server/util.go b/server/util.go index 37293317dd55..0e078a028470 100644 --- a/server/util.go +++ b/server/util.go @@ -173,6 +173,10 @@ func CreateSDKLogger(ctx *Context, out io.Writer) (log.Logger, error) { if ctx.Viper.GetString(flags.FlagLogFormat) == flags.OutputFormatJSON { opts = append(opts, log.OutputJSONOption()) } + opts = append(opts, + log.ColorOption(!ctx.Viper.GetBool(flags.FlagLogNoColor)), + // We use CometBFT flag (cmtcli.TraceFlag) for trace logging. + log.TraceOption(ctx.Viper.GetBool(FlagTrace))) // check and set filter level or keys for the logger if any logLvlStr := ctx.Viper.GetString(flags.FlagLogLevel) @@ -190,11 +194,6 @@ func CreateSDKLogger(ctx *Context, out io.Writer) (log.Logger, error) { } opts = append(opts, log.FilterOption(filterFunc)) - - case ctx.Viper.GetBool("trace"): // cmtcli.TraceFlag - // Check if the CometBFT flag for trace logging is set if it is then setup a tracing logger in this app as well. - // Note it overrides log level passed in `log_levels`. - opts = append(opts, log.LevelOption(zerolog.TraceLevel)) default: opts = append(opts, log.LevelOption(logLvl)) } @@ -339,9 +338,46 @@ func AddCommands(rootCmd *cobra.Command, defaultNodeHome string, appCreator type ExportCmd(appExport, defaultNodeHome), version.NewVersionCommand(), NewRollbackCmd(appCreator, defaultNodeHome), + ModuleHashByHeightQuery(appCreator), ) } +// AddCommandsWithStartCmdOptions adds server commands with the provided StartCmdOptions. +func AddCommandsWithStartCmdOptions(rootCmd *cobra.Command, defaultNodeHome string, appCreator types.AppCreator, appExport types.AppExporter, opts StartCmdOptions) { + cometCmd := &cobra.Command{ + Use: "comet", + Aliases: []string{"cometbft", "tendermint"}, + Short: "CometBFT subcommands", + } + + cometCmd.AddCommand( + ShowNodeIDCmd(), + ShowValidatorCmd(), + ShowAddressCmd(), + VersionCmd(), + cmtcmd.ResetAllCmd, + cmtcmd.ResetStateCmd, + BootstrapStateCmd(appCreator), + ) + + startCmd := StartCmdWithOptions(appCreator, defaultNodeHome, opts) + + rootCmd.AddCommand( + startCmd, + cometCmd, + ExportCmd(appExport, defaultNodeHome), + version.NewVersionCommand(), + NewRollbackCmd(appCreator, defaultNodeHome), + ) +} + +// AddTestnetCreatorCommand allows chains to create a testnet from the state existing in their node's data directory. +func AddTestnetCreatorCommand(rootCmd *cobra.Command, appCreator types.AppCreator, addStartFlags types.ModuleInitFlags) { + testnetCreateCmd := InPlaceTestnetCreator(appCreator) + addStartFlags(testnetCreateCmd) + rootCmd.AddCommand(testnetCreateCmd) +} + // https://stackoverflow.com/questions/23558425/how-do-i-get-the-local-ip-address-in-go // TODO there must be a better way to get external IP func ExternalIP() (string, error) { @@ -405,7 +441,7 @@ func ListenForQuitSignals(g *errgroup.Group, block bool, cancelFn context.Cancel func GetAppDBBackend(opts types.AppOptions) dbm.BackendType { rv := cast.ToString(opts.Get("app-db-backend")) if len(rv) == 0 { - rv = cast.ToString(opts.Get("db-backend")) + rv = cast.ToString(opts.Get("db_backend")) } // Cosmos SDK has migrated to cosmos-db which does not support all the backends which tm-db supported @@ -477,12 +513,21 @@ func DefaultBaseappOptions(appOpts types.AppOptions) []func(*baseapp.BaseApp) { chainID := cast.ToString(appOpts.Get(flags.FlagChainID)) if chainID == "" { // fallback to genesis chain-id - appGenesis, err := genutiltypes.AppGenesisFromFile(filepath.Join(homeDir, "config", "genesis.json")) + genesisPathCfg, _ := appOpts.Get("genesis_file").(string) + if genesisPathCfg == "" { + genesisPathCfg = filepath.Join("config", "genesis.json") + } + + reader, err := os.Open(filepath.Join(homeDir, genesisPathCfg)) if err != nil { panic(err) } + defer reader.Close() - chainID = appGenesis.ChainID + chainID, err = genutiltypes.ParseChainIDFromGenesis(reader) + if err != nil { + panic(fmt.Errorf("failed to parse chain-id from genesis file: %w", err)) + } } snapshotStore, err := GetSnapshotStore(appOpts) @@ -518,13 +563,14 @@ func DefaultBaseappOptions(appOpts types.AppOptions) []func(*baseapp.BaseApp) { baseapp.SetIAVLDisableFastNode(cast.ToBool(appOpts.Get(FlagDisableIAVLFastNode))), defaultMempool, baseapp.SetChainID(chainID), + baseapp.SetQueryGasLimit(cast.ToUint64(appOpts.Get(FlagQueryGasLimit))), } } func GetSnapshotStore(appOpts types.AppOptions) (*snapshots.Store, error) { homeDir := cast.ToString(appOpts.Get(flags.FlagHome)) snapshotDir := filepath.Join(homeDir, "data", "snapshots") - if err := os.MkdirAll(snapshotDir, os.ModePerm); err != nil { + if err := os.MkdirAll(snapshotDir, 0o744); err != nil { return nil, fmt.Errorf("failed to create snapshots directory: %w", err) } diff --git a/server/util_test.go b/server/util_test.go index 0f60877508ff..a9d17f0e050b 100644 --- a/server/util_test.go +++ b/server/util_test.go @@ -11,7 +11,9 @@ import ( "testing" cmtcfg "github.com/cometbft/cometbft/config" + db "github.com/cosmos/cosmos-db" "github.com/spf13/cobra" + "github.com/spf13/viper" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/client" @@ -37,6 +39,15 @@ func preRunETestImpl(cmd *cobra.Command, args []string) error { return errCanceledInPreRun } +func TestGetAppDBBackend(t *testing.T) { + v := viper.New() + require.Equal(t, server.GetAppDBBackend(v), db.GoLevelDBBackend) + v.Set("db_backend", "dbtype1") // value from CometBFT config + require.Equal(t, server.GetAppDBBackend(v), db.BackendType("dbtype1")) + v.Set("app-db-backend", "dbtype2") // value from app.toml + require.Equal(t, server.GetAppDBBackend(v), db.BackendType("dbtype2")) +} + func TestInterceptConfigsPreRunHandlerCreatesConfigFilesWhenMissing(t *testing.T) { tempDir := t.TempDir() cmd := server.StartCmd(nil, "/foobar") diff --git a/simapp/.goreleaser.yml b/simapp/.goreleaser.yml new file mode 100644 index 000000000000..38a09fe2633e --- /dev/null +++ b/simapp/.goreleaser.yml @@ -0,0 +1,44 @@ +project_name: simd + +release: + disable: false + name_template: "{{.Tag}}" + +before: + hooks: + - go mod tidy + +builds: + - main: ./simd + goos: + - linux + - darwin + goarch: + - amd64 + - arm64 + env: + - LEDGER_ENABLED=true + flags: + - -trimpath + - -mod=readonly + tags: + - netgo + - ledger + ldflags: + - '-X github.com/cosmos/cosmos-sdk/version.Name=sim' + - '-X github.com/cosmos/cosmos-sdk/version.AppName=simd' + - '-X github.com/cosmos/cosmos-sdk/version.Version={{.Version}}' + - '-X github.com/cosmos/cosmos-sdk/version.Commit={{.Commit}}' + - '-X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger"' + - '-w' + - '-s' + +archives: + - name_template: '{{ replace .Version "simd/" "simd-" }}-{{ .Os }}-{{ .Arch }}' + +checksum: + name_template: 'SHA256SUMS-{{ replace .Version "simd/" "simd-" }}.txt' + algorithm: sha256 + +changelog: + skip: true diff --git a/simapp/abci.go b/simapp/abci.go new file mode 100644 index 000000000000..7848d254d50f --- /dev/null +++ b/simapp/abci.go @@ -0,0 +1,84 @@ +package simapp + +import ( + "bytes" + "crypto/rand" + "encoding/json" + "fmt" + + abci "github.com/cometbft/cometbft/abci/types" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +type ( + // VoteExtensionHandler defines a dummy vote extension handler for SimApp. + // + // NOTE: This implementation is solely used for testing purposes. DO NOT use + // in a production application! + VoteExtensionHandler struct{} + + // VoteExtension defines the structure used to create a dummy vote extension. + VoteExtension struct { + Hash []byte + Height int64 + Data []byte + } +) + +func NewVoteExtensionHandler() *VoteExtensionHandler { + return &VoteExtensionHandler{} +} + +func (h *VoteExtensionHandler) SetHandlers(bApp *baseapp.BaseApp) { + bApp.SetExtendVoteHandler(h.ExtendVote()) + bApp.SetVerifyVoteExtensionHandler(h.VerifyVoteExtension()) +} + +func (h *VoteExtensionHandler) ExtendVote() sdk.ExtendVoteHandler { + return func(_ sdk.Context, req *abci.RequestExtendVote) (*abci.ResponseExtendVote, error) { + buf := make([]byte, 1024) + + _, err := rand.Read(buf) + if err != nil { + return nil, fmt.Errorf("failed to generate random vote extension data: %w", err) + } + + ve := VoteExtension{ + Hash: req.Hash, + Height: req.Height, + Data: buf, + } + + bz, err := json.Marshal(ve) + if err != nil { + return nil, fmt.Errorf("failed to encode vote extension: %w", err) + } + + return &abci.ResponseExtendVote{VoteExtension: bz}, nil + } +} + +func (h *VoteExtensionHandler) VerifyVoteExtension() sdk.VerifyVoteExtensionHandler { + return func(ctx sdk.Context, req *abci.RequestVerifyVoteExtension) (*abci.ResponseVerifyVoteExtension, error) { + var ve VoteExtension + + if err := json.Unmarshal(req.VoteExtension, &ve); err != nil { + return &abci.ResponseVerifyVoteExtension{Status: abci.ResponseVerifyVoteExtension_REJECT}, nil + } + + switch { + case req.Height != ve.Height: + return &abci.ResponseVerifyVoteExtension{Status: abci.ResponseVerifyVoteExtension_REJECT}, nil + + case !bytes.Equal(req.Hash, ve.Hash): + return &abci.ResponseVerifyVoteExtension{Status: abci.ResponseVerifyVoteExtension_REJECT}, nil + + case len(ve.Data) != 1024: + return &abci.ResponseVerifyVoteExtension{Status: abci.ResponseVerifyVoteExtension_REJECT}, nil + } + + return &abci.ResponseVerifyVoteExtension{Status: abci.ResponseVerifyVoteExtension_ACCEPT}, nil + } +} diff --git a/simapp/ante.go b/simapp/ante.go index 2a17d69bdbb7..6ccb5df2686e 100644 --- a/simapp/ante.go +++ b/simapp/ante.go @@ -4,8 +4,10 @@ import ( "errors" circuitante "cosmossdk.io/x/circuit/ante" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/ante" + "github.com/cosmos/cosmos-sdk/x/auth/ante/unorderedtx" ) // HandlerOptions are the options required for constructing a default SDK AnteHandler. @@ -46,5 +48,9 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { ante.NewIncrementSequenceDecorator(options.AccountKeeper), } + if options.UnorderedTxManager != nil { + anteDecorators = append(anteDecorators, ante.NewUnorderedTxDecorator(unorderedtx.DefaultMaxTimeoutDuration, options.UnorderedTxManager, ante.DefaultSha256GasCost)) + } + return sdk.ChainAnteDecorators(anteDecorators...), nil } diff --git a/simapp/app.go b/simapp/app.go index 7e4681399232..cf14834418a1 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -9,48 +9,53 @@ import ( "os" "path/filepath" - "cosmossdk.io/log" - "cosmossdk.io/x/tx/signing" - - autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" - reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" - "cosmossdk.io/client/v2/autocli" - "cosmossdk.io/core/appmodule" - - "github.com/cosmos/cosmos-sdk/codec/address" - - authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec" - "github.com/cosmos/cosmos-sdk/x/auth/tx" - abci "github.com/cometbft/cometbft/abci/types" dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/gogoproto/proto" "github.com/spf13/cast" + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" + "cosmossdk.io/client/v2/autocli" + clienthelpers "cosmossdk.io/client/v2/helpers" + "cosmossdk.io/core/appmodule" + "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" + "cosmossdk.io/x/circuit" + circuitkeeper "cosmossdk.io/x/circuit/keeper" + circuittypes "cosmossdk.io/x/circuit/types" "cosmossdk.io/x/evidence" evidencekeeper "cosmossdk.io/x/evidence/keeper" evidencetypes "cosmossdk.io/x/evidence/types" "cosmossdk.io/x/feegrant" feegrantkeeper "cosmossdk.io/x/feegrant/keeper" feegrantmodule "cosmossdk.io/x/feegrant/module" + "cosmossdk.io/x/gov" + govkeeper "cosmossdk.io/x/gov/keeper" + govtypes "cosmossdk.io/x/gov/types" + govv1 "cosmossdk.io/x/gov/types/v1" + govv1beta1 "cosmossdk.io/x/gov/types/v1beta1" + "cosmossdk.io/x/group" + groupkeeper "cosmossdk.io/x/group/keeper" + groupmodule "cosmossdk.io/x/group/module" + "cosmossdk.io/x/mint" + mintkeeper "cosmossdk.io/x/mint/keeper" + minttypes "cosmossdk.io/x/mint/types" "cosmossdk.io/x/nft" nftkeeper "cosmossdk.io/x/nft/keeper" nftmodule "cosmossdk.io/x/nft/module" + "cosmossdk.io/x/tx/signing" "cosmossdk.io/x/upgrade" upgradekeeper "cosmossdk.io/x/upgrade/keeper" upgradetypes "cosmossdk.io/x/upgrade/types" - "cosmossdk.io/x/circuit" - circuitkeeper "cosmossdk.io/x/circuit/keeper" - circuittypes "cosmossdk.io/x/circuit/types" - "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/grpc/cmtservice" nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node" "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/runtime" runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services" @@ -63,13 +68,18 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/types/msgservice" + sigtypes "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/version" "github.com/cosmos/cosmos-sdk/x/auth" "github.com/cosmos/cosmos-sdk/x/auth/ante" + "github.com/cosmos/cosmos-sdk/x/auth/ante/unorderedtx" + authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" "github.com/cosmos/cosmos-sdk/x/auth/posthandler" authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation" + "github.com/cosmos/cosmos-sdk/x/auth/tx" authtx "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/cosmos/cosmos-sdk/x/auth/vesting" vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" @@ -82,12 +92,12 @@ import ( consensus "github.com/cosmos/cosmos-sdk/x/consensus" consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" - "github.com/cosmos/cosmos-sdk/x/crisis" - crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper" - crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" distr "github.com/cosmos/cosmos-sdk/x/distribution" distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + "github.com/cosmos/cosmos-sdk/x/epochs" + epochskeeper "github.com/cosmos/cosmos-sdk/x/epochs/keeper" + epochstypes "github.com/cosmos/cosmos-sdk/x/epochs/types" "github.com/cosmos/cosmos-sdk/x/genutil" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" "github.com/cosmos/cosmos-sdk/x/gov" @@ -101,11 +111,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/mint" mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - "github.com/cosmos/cosmos-sdk/x/params" - paramsclient "github.com/cosmos/cosmos-sdk/x/params/client" - paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" - paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" "github.com/cosmos/cosmos-sdk/x/slashing" slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" @@ -137,36 +142,6 @@ var ( _ servertypes.Application = (*SimApp)(nil) ) -// stdAccAddressCodec is a temporary address codec that we will use until we -// can populate it with the correct bech32 prefixes without depending on the global. -type stdAccAddressCodec struct{} - -func (g stdAccAddressCodec) StringToBytes(text string) ([]byte, error) { - if text == "" { - return nil, nil - } - return sdk.AccAddressFromBech32(text) -} - -func (g stdAccAddressCodec) BytesToString(bz []byte) (string, error) { - if bz == nil { - return "", nil - } - return sdk.AccAddress(bz).String(), nil -} - -// stdValAddressCodec is a temporary address codec that we will use until we -// can populate it with the correct bech32 prefixes without depending on the global. -type stdValAddressCodec struct{} - -func (g stdValAddressCodec) StringToBytes(text string) ([]byte, error) { - return sdk.ValAddressFromBech32(text) -} - -func (g stdValAddressCodec) BytesToString(bz []byte) (string, error) { - return sdk.ValAddress(bz).String(), nil -} - // SimApp extends an ABCI application, but with most of its parameters exported. // They are exported for convenience in creating helper functions, as object // capabilities aren't needed for testing. @@ -178,32 +153,34 @@ type SimApp struct { interfaceRegistry types.InterfaceRegistry // keys to access the substores - keys map[string]*storetypes.KVStoreKey - tkeys map[string]*storetypes.TransientStoreKey + keys map[string]*storetypes.KVStoreKey - // keepers + // essential keepers AccountKeeper authkeeper.AccountKeeper - BankKeeper bankkeeper.Keeper + BankKeeper bankkeeper.BaseKeeper StakingKeeper *stakingkeeper.Keeper SlashingKeeper slashingkeeper.Keeper MintKeeper mintkeeper.Keeper DistrKeeper distrkeeper.Keeper GovKeeper govkeeper.Keeper - CrisisKeeper *crisiskeeper.Keeper UpgradeKeeper *upgradekeeper.Keeper - ParamsKeeper paramskeeper.Keeper - AuthzKeeper authzkeeper.Keeper EvidenceKeeper evidencekeeper.Keeper - FeeGrantKeeper feegrantkeeper.Keeper - GroupKeeper groupkeeper.Keeper - NFTKeeper nftkeeper.Keeper ConsensusParamsKeeper consensusparamkeeper.Keeper CircuitKeeper circuitkeeper.Keeper + // supplementary keepers + FeeGrantKeeper feegrantkeeper.Keeper + GroupKeeper groupkeeper.Keeper + AuthzKeeper authzkeeper.Keeper + NFTKeeper nftkeeper.Keeper + EpochsKeeper epochskeeper.Keeper + // the module manager ModuleManager *module.Manager BasicModuleManager module.BasicManager + UnorderedTxManager *unorderedtx.Manager + // simulation manager sm *module.SimulationManager @@ -212,12 +189,11 @@ type SimApp struct { } func init() { - userHomeDir, err := os.UserHomeDir() + var err error + DefaultNodeHome, err = clienthelpers.GetNodeHomeDirectory(".simapp") if err != nil { panic(err) } - - DefaultNodeHome = filepath.Join(userHomeDir, ".simapp") } // NewSimApp returns a reference to an initialized SimApp. @@ -244,6 +220,10 @@ func NewSimApp( legacyAmino := codec.NewLegacyAmino() txConfig := tx.NewTxConfig(appCodec, tx.DefaultSignModes) + if err := interfaceRegistry.SigningContext().Validate(); err != nil { + panic(err) + } + std.RegisterLegacyAminoCodec(legacyAmino) std.RegisterInterfaces(interfaceRegistry) @@ -273,6 +253,14 @@ func NewSimApp( // } // baseAppOptions = append(baseAppOptions, prepareOpt) + // create and set dummy vote extension handler + voteExtOp := func(bApp *baseapp.BaseApp) { + voteExtHandler := NewVoteExtensionHandler() + voteExtHandler.SetHandlers(bApp) + } + baseAppOptions = append(baseAppOptions, voteExtOp, baseapp.SetOptimisticExecution(), + baseapp.SetIncludeNestedMsgsGas([]sdk.Msg{&govv1.MsgSubmitProposal{}})) + bApp := baseapp.NewBaseApp(appName, logger, db, txConfig.TxDecoder(), baseAppOptions...) bApp.SetCommitMultiStoreTracer(traceStore) bApp.SetVersion(version.Version) @@ -280,11 +268,22 @@ func NewSimApp( bApp.SetTxEncoder(txConfig.TxEncoder()) keys := storetypes.NewKVStoreKeys( - authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, crisistypes.StoreKey, - minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey, - govtypes.StoreKey, paramstypes.StoreKey, consensusparamtypes.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey, - evidencetypes.StoreKey, circuittypes.StoreKey, - authzkeeper.StoreKey, nftkeeper.StoreKey, group.StoreKey, + authtypes.StoreKey, + banktypes.StoreKey, + stakingtypes.StoreKey, + minttypes.StoreKey, + distrtypes.StoreKey, + slashingtypes.StoreKey, + govtypes.StoreKey, + consensusparamtypes.StoreKey, + upgradetypes.StoreKey, + feegrant.StoreKey, + evidencetypes.StoreKey, + circuittypes.StoreKey, + authzkeeper.StoreKey, + nftkeeper.StoreKey, + group.StoreKey, + epochstypes.StoreKey, ) // register streaming services @@ -292,7 +291,6 @@ func NewSimApp( panic(err) } - tkeys := storetypes.NewTransientStoreKeys(paramstypes.TStoreKey) app := &SimApp{ BaseApp: bApp, legacyAmino: legacyAmino, @@ -300,17 +298,27 @@ func NewSimApp( txConfig: txConfig, interfaceRegistry: interfaceRegistry, keys: keys, - tkeys: tkeys, } - app.ParamsKeeper = initParamsKeeper(appCodec, legacyAmino, keys[paramstypes.StoreKey], tkeys[paramstypes.TStoreKey]) - // set the BaseApp's parameter store - app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper(appCodec, runtime.NewKVStoreService(keys[consensusparamtypes.StoreKey]), authtypes.NewModuleAddress(govtypes.ModuleName).String(), runtime.EventService{}) + app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper( + appCodec, + runtime.NewKVStoreService(keys[consensusparamtypes.StoreKey]), + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + runtime.EventService{}, + ) bApp.SetParamStore(app.ConsensusParamsKeeper.ParamsStore) // add keepers - app.AccountKeeper = authkeeper.NewAccountKeeper(appCodec, runtime.NewKVStoreService(keys[authtypes.StoreKey]), authtypes.ProtoBaseAccount, maccPerms, sdk.Bech32MainPrefix, authtypes.NewModuleAddress(govtypes.ModuleName).String()) + app.AccountKeeper = authkeeper.NewAccountKeeper( + appCodec, + runtime.NewKVStoreService(keys[authtypes.StoreKey]), + authtypes.ProtoBaseAccount, + maccPerms, + authcodec.NewBech32Codec(sdk.Bech32MainPrefix), + sdk.Bech32MainPrefix, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) app.BankKeeper = bankkeeper.NewBaseKeeper( appCodec, @@ -320,40 +328,101 @@ func NewSimApp( authtypes.NewModuleAddress(govtypes.ModuleName).String(), logger, ) + + // optional: enable sign mode textual by overwriting the default tx config (after setting the bank keeper) + enabledSignModes := append(tx.DefaultSignModes, sigtypes.SignMode_SIGN_MODE_TEXTUAL) + txConfigOpts := tx.ConfigOptions{ + EnabledSignModes: enabledSignModes, + TextualCoinMetadataQueryFn: txmodule.NewBankKeeperCoinMetadataQueryFn(app.BankKeeper), + } + txConfig, err := tx.NewTxConfigWithOptions( + appCodec, + txConfigOpts, + ) + if err != nil { + panic(err) + } + app.txConfig = txConfig + app.StakingKeeper = stakingkeeper.NewKeeper( - appCodec, keys[stakingtypes.StoreKey], app.AccountKeeper, app.BankKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), + appCodec, + runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), + app.AccountKeeper, + app.BankKeeper, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + authcodec.NewBech32Codec(sdk.Bech32PrefixValAddr), + authcodec.NewBech32Codec(sdk.Bech32PrefixConsAddr), + ) + app.MintKeeper = mintkeeper.NewKeeper( + appCodec, + runtime.NewKVStoreService(keys[minttypes.StoreKey]), + app.StakingKeeper, + app.AccountKeeper, + app.BankKeeper, + authtypes.FeeCollectorName, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) - app.MintKeeper = mintkeeper.NewKeeper(appCodec, runtime.NewKVStoreService(keys[minttypes.StoreKey]), app.StakingKeeper, app.AccountKeeper, app.BankKeeper, authtypes.FeeCollectorName, authtypes.NewModuleAddress(govtypes.ModuleName).String()) - app.DistrKeeper = distrkeeper.NewKeeper(appCodec, runtime.NewKVStoreService(keys[distrtypes.StoreKey]), app.AccountKeeper, app.BankKeeper, app.StakingKeeper, authtypes.FeeCollectorName, authtypes.NewModuleAddress(govtypes.ModuleName).String()) + app.DistrKeeper = distrkeeper.NewKeeper( + appCodec, + runtime.NewKVStoreService(keys[distrtypes.StoreKey]), + app.AccountKeeper, + app.BankKeeper, + app.StakingKeeper, + authtypes.FeeCollectorName, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) app.SlashingKeeper = slashingkeeper.NewKeeper( - appCodec, legacyAmino, runtime.NewKVStoreService(keys[slashingtypes.StoreKey]), app.StakingKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), + appCodec, + legacyAmino, + runtime.NewKVStoreService(keys[slashingtypes.StoreKey]), + app.StakingKeeper, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) - invCheckPeriod := cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)) - app.CrisisKeeper = crisiskeeper.NewKeeper(appCodec, runtime.NewKVStoreService(keys[crisistypes.StoreKey]), invCheckPeriod, - app.BankKeeper, authtypes.FeeCollectorName, authtypes.NewModuleAddress(govtypes.ModuleName).String(), app.AccountKeeper.AddressCodec()) - - app.FeeGrantKeeper = feegrantkeeper.NewKeeper(appCodec, runtime.NewKVStoreService(keys[feegrant.StoreKey]), app.AccountKeeper) + app.FeeGrantKeeper = feegrantkeeper.NewKeeper( + appCodec, + runtime.NewKVStoreService(keys[feegrant.StoreKey]), + app.AccountKeeper, + ) // register the staking hooks // NOTE: stakingKeeper above is passed by reference, so that it will contain these hooks app.StakingKeeper.SetHooks( - stakingtypes.NewMultiStakingHooks(app.DistrKeeper.Hooks(), app.SlashingKeeper.Hooks()), + stakingtypes.NewMultiStakingHooks( + app.DistrKeeper.Hooks(), + app.SlashingKeeper.Hooks(), + ), ) - app.CircuitKeeper = circuitkeeper.NewKeeper(appCodec, runtime.NewKVStoreService(keys[circuittypes.StoreKey]), authtypes.NewModuleAddress(govtypes.ModuleName).String(), app.AccountKeeper.AddressCodec()) + app.CircuitKeeper = circuitkeeper.NewKeeper( + appCodec, + runtime.NewKVStoreService(keys[circuittypes.StoreKey]), + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + app.AccountKeeper.AddressCodec(), + ) app.BaseApp.SetCircuitBreaker(&app.CircuitKeeper) - app.AuthzKeeper = authzkeeper.NewKeeper(runtime.NewKVStoreService(keys[authzkeeper.StoreKey]), appCodec, app.MsgServiceRouter(), app.AccountKeeper) + app.AuthzKeeper = authzkeeper.NewKeeper( + runtime.NewKVStoreService(keys[authzkeeper.StoreKey]), + appCodec, + app.MsgServiceRouter(), + app.AccountKeeper, + ) groupConfig := group.DefaultConfig() /* Example of setting group params: groupConfig.MaxMetadataLen = 1000 */ - app.GroupKeeper = groupkeeper.NewKeeper(keys[group.StoreKey], appCodec, app.MsgServiceRouter(), app.AccountKeeper, groupConfig) + app.GroupKeeper = groupkeeper.NewKeeper( + keys[group.StoreKey], + appCodec, + app.MsgServiceRouter(), + app.AccountKeeper, + groupConfig, + ) // get skipUpgradeHeights from the app options skipUpgradeHeights := map[int64]bool{} @@ -362,24 +431,36 @@ func NewSimApp( } homePath := cast.ToString(appOpts.Get(flags.FlagHome)) // set the governance module account as the authority for conducting upgrades - app.UpgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, runtime.NewKVStoreService(keys[upgradetypes.StoreKey]), appCodec, homePath, app.BaseApp, authtypes.NewModuleAddress(govtypes.ModuleName).String()) + app.UpgradeKeeper = upgradekeeper.NewKeeper( + skipUpgradeHeights, + runtime.NewKVStoreService(keys[upgradetypes.StoreKey]), + appCodec, + homePath, + app.BaseApp, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) // Register the proposal types // Deprecated: Avoid adding new handlers, instead use the new proposal flow // by granting the governance module the right to execute the message. // See: https://docs.cosmos.network/main/modules/gov#proposal-messages govRouter := govv1beta1.NewRouter() - govRouter.AddRoute(govtypes.RouterKey, govv1beta1.ProposalHandler). - AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)). - AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)) + govRouter.AddRoute(govtypes.RouterKey, govv1beta1.ProposalHandler) govConfig := govtypes.DefaultConfig() /* Example of setting gov params: govConfig.MaxMetadataLen = 10000 */ govKeeper := govkeeper.NewKeeper( - appCodec, runtime.NewKVStoreService(keys[govtypes.StoreKey]), app.AccountKeeper, app.BankKeeper, - app.StakingKeeper, app.DistrKeeper, app.MsgServiceRouter(), govConfig, authtypes.NewModuleAddress(govtypes.ModuleName).String(), + appCodec, + runtime.NewKVStoreService(keys[govtypes.StoreKey]), + app.AccountKeeper, + app.BankKeeper, + app.StakingKeeper, + app.DistrKeeper, + app.MsgServiceRouter(), + govConfig, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) // Set legacy router for backwards compatibility with gov v1beta1 @@ -391,20 +472,37 @@ func NewSimApp( ), ) - app.NFTKeeper = nftkeeper.NewKeeper(runtime.NewKVStoreService(keys[nftkeeper.StoreKey]), appCodec, app.AccountKeeper, app.BankKeeper) + app.NFTKeeper = nftkeeper.NewKeeper( + runtime.NewKVStoreService(keys[nftkeeper.StoreKey]), + appCodec, + app.AccountKeeper, + app.BankKeeper, + ) // create evidence keeper with router evidenceKeeper := evidencekeeper.NewKeeper( - appCodec, runtime.NewKVStoreService(keys[evidencetypes.StoreKey]), app.StakingKeeper, app.SlashingKeeper, app.AccountKeeper.AddressCodec(), runtime.ProvideCometInfoService(), + appCodec, + runtime.NewKVStoreService(keys[evidencetypes.StoreKey]), + app.StakingKeeper, + app.SlashingKeeper, + app.AccountKeeper.AddressCodec(), + runtime.ProvideCometInfoService(), ) // If evidence needs to be handled for the app, set routes in router here and seal app.EvidenceKeeper = *evidenceKeeper - /**** Module Options ****/ + app.EpochsKeeper = epochskeeper.NewKeeper( + runtime.NewKVStoreService(keys[epochstypes.StoreKey]), + appCodec, + ) + + app.EpochsKeeper.SetHooks( + epochstypes.NewMultiEpochHooks( + // insert epoch hooks receivers here + ), + ) - // NOTE: we may consider parsing `appOpts` inside module constructors. For the moment - // we prefer to be more strict in what arguments the modules expect. - skipGenesisInvariants := cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants)) + /**** Module Options ****/ // NOTE: Any module instantiated in the module manager that is later modified // must be passed by reference here. @@ -413,24 +511,23 @@ func NewSimApp( app.AccountKeeper, app.StakingKeeper, app, txConfig, ), - auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)), + auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, nil), vesting.NewAppModule(app.AccountKeeper, app.BankKeeper), - bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper, app.GetSubspace(banktypes.ModuleName)), - crisis.NewAppModule(app.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)), + bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper, nil), feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), - gov.NewAppModule(appCodec, &app.GovKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(govtypes.ModuleName)), - mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, nil, app.GetSubspace(minttypes.ModuleName)), - slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName), app.interfaceRegistry), - distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(distrtypes.ModuleName)), - staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)), + gov.NewAppModule(appCodec, &app.GovKeeper, app.AccountKeeper, app.BankKeeper, nil), + mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, nil, nil), + slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, nil, app.interfaceRegistry), + distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, nil), + staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, nil), upgrade.NewAppModule(app.UpgradeKeeper, app.AccountKeeper.AddressCodec()), evidence.NewAppModule(app.EvidenceKeeper), - params.NewAppModule(app.ParamsKeeper), authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), groupmodule.NewAppModule(appCodec, app.GroupKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), nftmodule.NewAppModule(appCodec, app.NFTKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), consensus.NewAppModule(appCodec, app.ConsensusParamsKeeper), circuit.NewAppModule(appCodec, app.CircuitKeeper), + epochs.NewAppModule(appCodec, app.EpochsKeeper), ) // BasicModuleManager defines the module BasicManager is in charge of setting up basic, @@ -442,20 +539,21 @@ func NewSimApp( map[string]module.AppModuleBasic{ genutiltypes.ModuleName: genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator), govtypes.ModuleName: gov.NewAppModuleBasic( - []govclient.ProposalHandler{ - paramsclient.ProposalHandler, - }, + []govclient.ProposalHandler{}, ), }) app.BasicModuleManager.RegisterLegacyAminoCodec(legacyAmino) app.BasicModuleManager.RegisterInterfaces(interfaceRegistry) + // NOTE: upgrade module is required to be prioritized + app.ModuleManager.SetOrderPreBlockers( + upgradetypes.ModuleName, + ) // During begin block slashing happens after distr.BeginBlocker so that // there is nothing left over in the validator fee pool, so as to keep the // CanWithdrawInvariant invariant. // NOTE: staking module is required if HistoricalEntries param > 0 app.ModuleManager.SetOrderBeginBlockers( - upgradetypes.ModuleName, minttypes.ModuleName, distrtypes.ModuleName, slashingtypes.ModuleName, @@ -463,9 +561,9 @@ func NewSimApp( stakingtypes.ModuleName, genutiltypes.ModuleName, authz.ModuleName, + epochstypes.ModuleName, ) app.ModuleManager.SetOrderEndBlockers( - crisistypes.ModuleName, govtypes.ModuleName, stakingtypes.ModuleName, genutiltypes.ModuleName, @@ -477,11 +575,24 @@ func NewSimApp( // properly initialized with tokens from genesis accounts. // NOTE: The genutils module must also occur after auth so that it can access the params from auth. genesisModuleOrder := []string{ - authtypes.ModuleName, banktypes.ModuleName, - distrtypes.ModuleName, stakingtypes.ModuleName, slashingtypes.ModuleName, govtypes.ModuleName, - minttypes.ModuleName, crisistypes.ModuleName, genutiltypes.ModuleName, evidencetypes.ModuleName, authz.ModuleName, - feegrant.ModuleName, nft.ModuleName, group.ModuleName, paramstypes.ModuleName, upgradetypes.ModuleName, - vestingtypes.ModuleName, consensusparamtypes.ModuleName, circuittypes.ModuleName, + authtypes.ModuleName, + banktypes.ModuleName, + distrtypes.ModuleName, + stakingtypes.ModuleName, + slashingtypes.ModuleName, + govtypes.ModuleName, + minttypes.ModuleName, + genutiltypes.ModuleName, + evidencetypes.ModuleName, + authz.ModuleName, + feegrant.ModuleName, + nft.ModuleName, + group.ModuleName, + upgradetypes.ModuleName, + vestingtypes.ModuleName, + consensusparamtypes.ModuleName, + circuittypes.ModuleName, + epochstypes.ModuleName, } app.ModuleManager.SetOrderInitGenesis(genesisModuleOrder...) app.ModuleManager.SetOrderExportGenesis(genesisModuleOrder...) @@ -489,9 +600,8 @@ func NewSimApp( // Uncomment if you want to set a custom migration order here. // app.ModuleManager.SetOrderMigrations(custom order) - app.ModuleManager.RegisterInvariants(app.CrisisKeeper) app.configurator = module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter()) - err := app.ModuleManager.RegisterServices(app.configurator) + err = app.ModuleManager.RegisterServices(app.configurator) if err != nil { panic(err) } @@ -516,18 +626,37 @@ func NewSimApp( // NOTE: this is not required apps that don't use the simulator for fuzz testing // transactions overrideModules := map[string]module.AppModuleSimulation{ - authtypes.ModuleName: auth.NewAppModule(app.appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)), + authtypes.ModuleName: auth.NewAppModule(app.appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, nil), } app.sm = module.NewSimulationManagerFromAppModules(app.ModuleManager.Modules, overrideModules) + // create, start, and load the unordered tx manager + utxDataDir := filepath.Join(cast.ToString(appOpts.Get(flags.FlagHome)), "data") + app.UnorderedTxManager = unorderedtx.NewManager(utxDataDir) + app.UnorderedTxManager.Start() + + if err := app.UnorderedTxManager.OnInit(); err != nil { + panic(fmt.Errorf("failed to initialize unordered tx manager: %w", err)) + } + + // register custom snapshot extensions (if any) + if manager := app.SnapshotManager(); manager != nil { + err := manager.RegisterExtensions( + unorderedtx.NewSnapshotter(app.UnorderedTxManager), + ) + if err != nil { + panic(fmt.Errorf("failed to register snapshot extension: %s", err)) + } + } + app.sm.RegisterStoreDecoders() // initialize stores app.MountKVStores(keys) - app.MountTransientStores(tkeys) // initialize BaseApp app.SetInitChainer(app.InitChainer) + app.SetPreBlocker(app.PreBlocker) app.SetBeginBlocker(app.BeginBlocker) app.SetEndBlocker(app.EndBlocker) app.setAnteHandler(txConfig) @@ -540,12 +669,7 @@ func NewSimApp( // meaning that both `runMsgs` and `postHandler` state will be committed if // both are successful, and both will be reverted if any of the two fails. // - // The SDK exposes a default postHandlers chain, which comprises of only - // one decorator: the Transaction Tips decorator. However, some chains do - // not need it by default, so feel free to comment the next line if you do - // not need tips. - // To read more about tips: - // https://docs.cosmos.network/main/core/tips.html + // The SDK exposes a default postHandlers chain // // Please note that changing any of the anteHandler or postHandler chain is // likely to be a state-machine breaking change, which needs a coordinated @@ -578,11 +702,12 @@ func (app *SimApp) setAnteHandler(txConfig client.TxConfig) { anteHandler, err := NewAnteHandler( HandlerOptions{ ante.HandlerOptions{ - AccountKeeper: app.AccountKeeper, - BankKeeper: app.BankKeeper, - SignModeHandler: txConfig.SignModeHandler(), - FeegrantKeeper: app.FeeGrantKeeper, - SigGasConsumer: ante.DefaultSigVerificationGasConsumer, + AccountKeeper: app.AccountKeeper, + BankKeeper: app.BankKeeper, + SignModeHandler: txConfig.SignModeHandler(), + FeegrantKeeper: app.FeeGrantKeeper, + SigGasConsumer: ante.DefaultSigVerificationGasConsumer, + UnorderedTxManager: app.UnorderedTxManager, }, &app.CircuitKeeper, }, @@ -606,9 +731,21 @@ func (app *SimApp) setPostHandler() { app.SetPostHandler(postHandler) } +// Close implements the Application interface and closes all necessary application +// resources. +func (app *SimApp) Close() error { + return app.UnorderedTxManager.Close() +} + // Name returns the name of the App func (app *SimApp) Name() string { return app.BaseApp.Name() } +// PreBlocker application updates every pre block +func (app *SimApp) PreBlocker(ctx sdk.Context, _ *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error) { + app.UnorderedTxManager.OnNewBlock(ctx.BlockTime()) + return app.ModuleManager.PreBlock(ctx) +} + // BeginBlocker application updates every begin block func (app *SimApp) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error) { return app.ModuleManager.BeginBlock(ctx) @@ -677,8 +814,11 @@ func (app *SimApp) AutoCliOpts() autocli.AppOptions { } return autocli.AppOptions{ - Modules: modules, - AddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()), + Modules: modules, + ModuleOptions: runtimeservices.ExtractAutoCLIOptions(app.ModuleManager.Modules), + AddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()), + ValidatorAddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()), + ConsensusAddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ConsensusAddrPrefix()), } } @@ -696,7 +836,7 @@ func (app *SimApp) GetKey(storeKey string) *storetypes.KVStoreKey { // GetStoreKeys returns all the stored store keys. func (app *SimApp) GetStoreKeys() []storetypes.StoreKey { - keys := make([]storetypes.StoreKey, len(app.keys)) + keys := make([]storetypes.StoreKey, 0, len(app.keys)) for _, key := range app.keys { keys = append(keys, key) } @@ -704,14 +844,6 @@ func (app *SimApp) GetStoreKeys() []storetypes.StoreKey { return keys } -// GetSubspace returns a param subspace for a given module name. -// -// NOTE: This is solely to be used for testing purposes. -func (app *SimApp) GetSubspace(moduleName string) paramstypes.Subspace { - subspace, _ := app.ParamsKeeper.GetSubspace(moduleName) - return subspace -} - // SimulationManager implements the SimulationApp interface func (app *SimApp) SimulationManager() *module.SimulationManager { return app.sm @@ -783,19 +915,3 @@ func BlockedAddresses() map[string]bool { return modAccAddrs } - -// initParamsKeeper init params keeper and its subspaces -func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key, tkey storetypes.StoreKey) paramskeeper.Keeper { - paramsKeeper := paramskeeper.NewKeeper(appCodec, legacyAmino, key, tkey) - - paramsKeeper.Subspace(authtypes.ModuleName) - paramsKeeper.Subspace(banktypes.ModuleName) - paramsKeeper.Subspace(stakingtypes.ModuleName) - paramsKeeper.Subspace(minttypes.ModuleName) - paramsKeeper.Subspace(distrtypes.ModuleName) - paramsKeeper.Subspace(slashingtypes.ModuleName) - paramsKeeper.Subspace(govtypes.ModuleName) - paramsKeeper.Subspace(crisistypes.ModuleName) - - return paramsKeeper -} diff --git a/simapp/app_config.go b/simapp/app_config.go index b8a79d7fe9e8..51b5cb9208e2 100644 --- a/simapp/app_config.go +++ b/simapp/app_config.go @@ -12,8 +12,8 @@ import ( bankmodulev1 "cosmossdk.io/api/cosmos/bank/module/v1" circuitmodulev1 "cosmossdk.io/api/cosmos/circuit/module/v1" consensusmodulev1 "cosmossdk.io/api/cosmos/consensus/module/v1" - crisismodulev1 "cosmossdk.io/api/cosmos/crisis/module/v1" distrmodulev1 "cosmossdk.io/api/cosmos/distribution/module/v1" + epochsmodulev1 "cosmossdk.io/api/cosmos/epochs/module/v1" evidencemodulev1 "cosmossdk.io/api/cosmos/evidence/module/v1" feegrantmodulev1 "cosmossdk.io/api/cosmos/feegrant/module/v1" genutilmodulev1 "cosmossdk.io/api/cosmos/genutil/module/v1" @@ -21,57 +21,52 @@ import ( groupmodulev1 "cosmossdk.io/api/cosmos/group/module/v1" mintmodulev1 "cosmossdk.io/api/cosmos/mint/module/v1" nftmodulev1 "cosmossdk.io/api/cosmos/nft/module/v1" - paramsmodulev1 "cosmossdk.io/api/cosmos/params/module/v1" slashingmodulev1 "cosmossdk.io/api/cosmos/slashing/module/v1" stakingmodulev1 "cosmossdk.io/api/cosmos/staking/module/v1" txconfigv1 "cosmossdk.io/api/cosmos/tx/config/v1" upgrademodulev1 "cosmossdk.io/api/cosmos/upgrade/module/v1" vestingmodulev1 "cosmossdk.io/api/cosmos/vesting/module/v1" - "cosmossdk.io/depinject" - - _ "cosmossdk.io/x/circuit" // import for side-effects - _ "cosmossdk.io/x/evidence" // import for side-effects - _ "cosmossdk.io/x/feegrant/module" // import for side-effects - _ "cosmossdk.io/x/nft/module" // import for side-effects - _ "cosmossdk.io/x/upgrade" // import for side-effects - _ "github.com/cosmos/cosmos-sdk/x/auth/tx/config" // import for side-effects - _ "github.com/cosmos/cosmos-sdk/x/auth/vesting" // import for side-effects - _ "github.com/cosmos/cosmos-sdk/x/authz/module" // import for side-effects - _ "github.com/cosmos/cosmos-sdk/x/bank" // import for side-effects - _ "github.com/cosmos/cosmos-sdk/x/consensus" // import for side-effects - _ "github.com/cosmos/cosmos-sdk/x/crisis" // import for side-effects - _ "github.com/cosmos/cosmos-sdk/x/distribution" // import for side-effects - "github.com/cosmos/cosmos-sdk/x/genutil" - "github.com/cosmos/cosmos-sdk/x/gov" - _ "github.com/cosmos/cosmos-sdk/x/group/module" // import for side-effects - _ "github.com/cosmos/cosmos-sdk/x/mint" // import for side-effects - _ "github.com/cosmos/cosmos-sdk/x/params" // import for side-effects - _ "github.com/cosmos/cosmos-sdk/x/slashing" // import for side-effects - _ "github.com/cosmos/cosmos-sdk/x/staking" // import for side-effects - "cosmossdk.io/core/appconfig" + "cosmossdk.io/depinject" + _ "cosmossdk.io/x/circuit" // import for side-effects circuittypes "cosmossdk.io/x/circuit/types" + _ "cosmossdk.io/x/evidence" // import for side-effects evidencetypes "cosmossdk.io/x/evidence/types" "cosmossdk.io/x/feegrant" + _ "cosmossdk.io/x/feegrant/module" // import for side-effects "cosmossdk.io/x/nft" + _ "cosmossdk.io/x/nft/module" // import for side-effects + _ "cosmossdk.io/x/upgrade" // import for side-effects upgradetypes "cosmossdk.io/x/upgrade/types" + "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/types/module" + _ "github.com/cosmos/cosmos-sdk/x/auth/tx/config" // import for side-effects authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + _ "github.com/cosmos/cosmos-sdk/x/auth/vesting" // import for side-effects vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" "github.com/cosmos/cosmos-sdk/x/authz" + _ "github.com/cosmos/cosmos-sdk/x/authz/module" // import for side-effects + _ "github.com/cosmos/cosmos-sdk/x/bank" // import for side-effects banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + _ "github.com/cosmos/cosmos-sdk/x/consensus" // import for side-effects consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types" - crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" + _ "github.com/cosmos/cosmos-sdk/x/distribution" // import for side-effects distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + _ "github.com/cosmos/cosmos-sdk/x/epochs" // import for side-effects + epochstypes "github.com/cosmos/cosmos-sdk/x/epochs/types" + "github.com/cosmos/cosmos-sdk/x/genutil" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" + "github.com/cosmos/cosmos-sdk/x/gov" govclient "github.com/cosmos/cosmos-sdk/x/gov/client" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/group" + _ "github.com/cosmos/cosmos-sdk/x/group/module" // import for side-effects + _ "github.com/cosmos/cosmos-sdk/x/mint" // import for side-effects minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - paramsclient "github.com/cosmos/cosmos-sdk/x/params/client" - paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + _ "github.com/cosmos/cosmos-sdk/x/slashing" // import for side-effects slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" + _ "github.com/cosmos/cosmos-sdk/x/staking" // import for side-effects stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -106,25 +101,26 @@ var ( Name: runtime.ModuleName, Config: appconfig.WrapAny(&runtimev1alpha1.Module{ AppName: "SimApp", + // NOTE: upgrade module is required to be prioritized + PreBlockers: []string{ + upgradetypes.ModuleName, + }, // During begin block slashing happens after distr.BeginBlocker so that // there is nothing left over in the validator fee pool, so as to keep the // CanWithdrawInvariant invariant. // NOTE: staking module is required if HistoricalEntries param > 0 BeginBlockers: []string{ - upgradetypes.ModuleName, minttypes.ModuleName, distrtypes.ModuleName, slashingtypes.ModuleName, evidencetypes.ModuleName, stakingtypes.ModuleName, - genutiltypes.ModuleName, authz.ModuleName, + epochstypes.ModuleName, }, EndBlockers: []string{ - crisistypes.ModuleName, govtypes.ModuleName, stakingtypes.ModuleName, - genutiltypes.ModuleName, feegrant.ModuleName, group.ModuleName, }, @@ -145,18 +141,16 @@ var ( slashingtypes.ModuleName, govtypes.ModuleName, minttypes.ModuleName, - crisistypes.ModuleName, genutiltypes.ModuleName, evidencetypes.ModuleName, authz.ModuleName, feegrant.ModuleName, nft.ModuleName, group.ModuleName, - paramstypes.ModuleName, upgradetypes.ModuleName, vestingtypes.ModuleName, - consensustypes.ModuleName, circuittypes.ModuleName, + epochstypes.ModuleName, }, // When ExportGenesis is not specified, the export genesis module order // is equal to the init genesis order @@ -186,20 +180,23 @@ var ( }), }, { - Name: stakingtypes.ModuleName, - Config: appconfig.WrapAny(&stakingmodulev1.Module{}), + Name: stakingtypes.ModuleName, + Config: appconfig.WrapAny(&stakingmodulev1.Module{ + // NOTE: specifying a prefix is only necessary when using bech32 addresses + // If not specfied, the auth Bech32Prefix appended with "valoper" and "valcons" is used by default + Bech32PrefixValidator: "cosmosvaloper", + Bech32PrefixConsensus: "cosmosvalcons", + }), }, { Name: slashingtypes.ModuleName, Config: appconfig.WrapAny(&slashingmodulev1.Module{}), }, { - Name: paramstypes.ModuleName, - Config: appconfig.WrapAny(¶msmodulev1.Module{}), - }, - { - Name: "tx", - Config: appconfig.WrapAny(&txconfigv1.Config{}), + Name: "tx", + Config: appconfig.WrapAny(&txconfigv1.Config{ + SkipAnteHandler: true, // Enable this to skip the default antehandlers and set custom ante handlers. + }), }, { Name: genutiltypes.ModuleName, @@ -244,10 +241,6 @@ var ( Name: govtypes.ModuleName, Config: appconfig.WrapAny(&govmodulev1.Module{}), }, - { - Name: crisistypes.ModuleName, - Config: appconfig.WrapAny(&crisismodulev1.Module{}), - }, { Name: consensustypes.ModuleName, Config: appconfig.WrapAny(&consensusmodulev1.Module{}), @@ -256,6 +249,10 @@ var ( Name: circuittypes.ModuleName, Config: appconfig.WrapAny(&circuitmodulev1.Module{}), }, + { + Name: epochstypes.ModuleName, + Config: appconfig.WrapAny(&epochsmodulev1.Module{}), + }, }, }), depinject.Supply( @@ -263,9 +260,7 @@ var ( map[string]module.AppModuleBasic{ genutiltypes.ModuleName: genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator), govtypes.ModuleName: gov.NewAppModuleBasic( - []govclient.ProposalHandler{ - paramsclient.ProposalHandler, - }, + []govclient.ProposalHandler{}, ), }, )) diff --git a/simapp/app_v2.go b/simapp/app_di.go similarity index 74% rename from simapp/app_v2.go rename to simapp/app_di.go index 7ec1f3732449..6da2f0886929 100644 --- a/simapp/app_v2.go +++ b/simapp/app_di.go @@ -3,14 +3,16 @@ package simapp import ( + "fmt" "io" - "os" "path/filepath" - "cosmossdk.io/log" dbm "github.com/cosmos/cosmos-db" + "github.com/spf13/cast" + clienthelpers "cosmossdk.io/client/v2/helpers" "cosmossdk.io/depinject" + "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" circuitkeeper "cosmossdk.io/x/circuit/keeper" evidencekeeper "cosmossdk.io/x/evidence/keeper" @@ -20,6 +22,7 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/runtime" @@ -30,19 +33,19 @@ import ( testdata_pulsar "github.com/cosmos/cosmos-sdk/testutil/testdata/testpb" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/auth" + "github.com/cosmos/cosmos-sdk/x/auth/ante" + "github.com/cosmos/cosmos-sdk/x/auth/ante/unorderedtx" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" consensuskeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" - crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper" distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" + epochskeeper "github.com/cosmos/cosmos-sdk/x/epochs/keeper" govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" groupkeeper "github.com/cosmos/cosmos-sdk/x/group/keeper" mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" - paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" - paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" ) @@ -65,36 +68,38 @@ type SimApp struct { txConfig client.TxConfig interfaceRegistry codectypes.InterfaceRegistry - // keepers + UnorderedTxManager *unorderedtx.Manager + + // essential keepers AccountKeeper authkeeper.AccountKeeper - BankKeeper bankkeeper.Keeper + BankKeeper bankkeeper.BaseKeeper StakingKeeper *stakingkeeper.Keeper SlashingKeeper slashingkeeper.Keeper MintKeeper mintkeeper.Keeper DistrKeeper distrkeeper.Keeper GovKeeper *govkeeper.Keeper - CrisisKeeper *crisiskeeper.Keeper UpgradeKeeper *upgradekeeper.Keeper - ParamsKeeper paramskeeper.Keeper - AuthzKeeper authzkeeper.Keeper EvidenceKeeper evidencekeeper.Keeper - FeeGrantKeeper feegrantkeeper.Keeper - GroupKeeper groupkeeper.Keeper - NFTKeeper nftkeeper.Keeper ConsensusParamsKeeper consensuskeeper.Keeper - CircuitBreakerKeeper circuitkeeper.Keeper + CircuitKeeper circuitkeeper.Keeper + + // supplementary keepers + FeeGrantKeeper feegrantkeeper.Keeper + GroupKeeper groupkeeper.Keeper + AuthzKeeper authzkeeper.Keeper + NFTKeeper nftkeeper.Keeper + EpochsKeeper epochskeeper.Keeper // simulation manager sm *module.SimulationManager } func init() { - userHomeDir, err := os.UserHomeDir() + var err error + DefaultNodeHome, err = clienthelpers.GetNodeHomeDirectory(".simapp") if err != nil { panic(err) } - - DefaultNodeHome = filepath.Join(userHomeDir, ".simapp") } // NewSimApp returns a reference to an initialized SimApp. @@ -118,7 +123,6 @@ func NewSimApp( appOpts, // supply the logger logger, - // ADVANCED CONFIGURATION // @@ -128,11 +132,28 @@ func NewSimApp( // add it below. By default the auth module uses simulation.RandomGenesisAccounts. // // authtypes.RandomGenesisAccountsFn(simulation.RandomGenesisAccounts), - + // // For providing a custom a base account type add it below. // By default the auth module uses authtypes.ProtoBaseAccount(). // // func() sdk.AccountI { return authtypes.ProtoBaseAccount() }, + // + // For providing a different address codec, add it below. + // By default the auth module uses a Bech32 address codec, + // with the prefix defined in the auth module configuration. + // + // func() address.Codec { return <- custom address codec type -> } + + // + // STAKING + // + // For provinding a different validator and consensus address codec, add it below. + // By default the staking module uses the bech32 prefix provided in the auth config, + // and appends "valoper" and "valcons" for validator and consensus addresses respectively. + // When providing a custom address codec in auth, custom address codecs must be provided here as well. + // + // func() runtime.ValidatorAddressCodec { return <- custom validator address codec type -> } + // func() runtime.ConsensusAddressCodec { return <- custom consensus address codec type -> } // // MINT @@ -158,16 +179,15 @@ func NewSimApp( &app.MintKeeper, &app.DistrKeeper, &app.GovKeeper, - &app.CrisisKeeper, &app.UpgradeKeeper, - &app.ParamsKeeper, &app.AuthzKeeper, &app.EvidenceKeeper, &app.FeeGrantKeeper, &app.GroupKeeper, &app.NFTKeeper, &app.ConsensusParamsKeeper, - &app.CircuitBreakerKeeper, + &app.CircuitKeeper, + &app.EpochsKeeper, ); err != nil { panic(err) } @@ -198,6 +218,13 @@ func NewSimApp( // } // baseAppOptions = append(baseAppOptions, prepareOpt) + // create and set dummy vote extension handler + voteExtOp := func(bApp *baseapp.BaseApp) { + voteExtHandler := NewVoteExtensionHandler() + voteExtHandler.SetHandlers(bApp) + } + baseAppOptions = append(baseAppOptions, voteExtOp, baseapp.SetOptimisticExecution()) + app.App = appBuilder.Build(db, traceStore, baseAppOptions...) // register streaming services @@ -207,8 +234,6 @@ func NewSimApp( /**** Module Options ****/ - app.ModuleManager.RegisterInvariants(app.CrisisKeeper) - // RegisterUpgradeHandlers is used for registering any on-chain upgrades. app.RegisterUpgradeHandlers() @@ -220,7 +245,7 @@ func NewSimApp( // NOTE: this is not required apps that don't use the simulator for fuzz testing // transactions overrideModules := map[string]module.AppModuleSimulation{ - authtypes.ModuleName: auth.NewAppModule(app.appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)), + authtypes.ModuleName: auth.NewAppModule(app.appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, nil), } app.sm = module.NewSimulationManagerFromAppModules(app.ModuleManager.Modules, overrideModules) @@ -232,11 +257,33 @@ func NewSimApp( // However, when registering a module manually (i.e. that does not support app wiring), the module version map // must be set manually as follow. The upgrade module will de-duplicate the module version map. // - // app.SetInitChainer(func(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain { + // app.SetInitChainer(func(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error) { // app.UpgradeKeeper.SetModuleVersionMap(ctx, app.ModuleManager.GetVersionMap()) // return app.App.InitChainer(ctx, req) // }) + // create, start, and load the unordered tx manager + utxDataDir := filepath.Join(cast.ToString(appOpts.Get(flags.FlagHome)), "data") + app.UnorderedTxManager = unorderedtx.NewManager(utxDataDir) + app.UnorderedTxManager.Start() + + if err := app.UnorderedTxManager.OnInit(); err != nil { + panic(fmt.Errorf("failed to initialize unordered tx manager: %w", err)) + } + + // register custom snapshot extensions (if any) + if manager := app.SnapshotManager(); manager != nil { + err := manager.RegisterExtensions( + unorderedtx.NewSnapshotter(app.UnorderedTxManager), + ) + if err != nil { + panic(fmt.Errorf("failed to register snapshot extension: %w", err)) + } + } + + // set custom ante handler + app.setAnteHandler(app.txConfig) + if err := app.Load(loadLatest); err != nil { panic(err) } @@ -244,8 +291,29 @@ func NewSimApp( return app } -// Name returns the name of the App -func (app *SimApp) Name() string { return app.BaseApp.Name() } +// setAnteHandler sets custom ante handlers. +// "x/auth/tx" pre-defined ante handler have been disabled in app_config. +func (app *SimApp) setAnteHandler(txConfig client.TxConfig) { + anteHandler, err := NewAnteHandler( + HandlerOptions{ + ante.HandlerOptions{ + AccountKeeper: app.AccountKeeper, + BankKeeper: app.BankKeeper, + SignModeHandler: txConfig.SignModeHandler(), + FeegrantKeeper: app.FeeGrantKeeper, + SigGasConsumer: ante.DefaultSigVerificationGasConsumer, + UnorderedTxManager: app.UnorderedTxManager, + }, + &app.CircuitKeeper, + }, + ) + if err != nil { + panic(err) + } + + // Set the AnteHandler for the app + app.SetAnteHandler(anteHandler) +} // LegacyAmino returns SimApp's amino codec. // @@ -296,14 +364,6 @@ func (app *SimApp) kvStoreKeys() map[string]*storetypes.KVStoreKey { return keys } -// GetSubspace returns a param subspace for a given module name. -// -// NOTE: This is solely to be used for testing purposes. -func (app *SimApp) GetSubspace(moduleName string) paramstypes.Subspace { - subspace, _ := app.ParamsKeeper.GetSubspace(moduleName) - return subspace -} - // SimulationManager implements the SimulationApp interface func (app *SimApp) SimulationManager() *module.SimulationManager { return app.sm diff --git a/simapp/app_test.go b/simapp/app_test.go index d5929d28714f..011e6c932eb4 100644 --- a/simapp/app_test.go +++ b/simapp/app_test.go @@ -5,38 +5,56 @@ import ( "fmt" "testing" - "cosmossdk.io/core/appmodule" - "cosmossdk.io/log" - "cosmossdk.io/x/evidence" - feegrantmodule "cosmossdk.io/x/feegrant/module" - "cosmossdk.io/x/upgrade" abci "github.com/cometbft/cometbft/abci/types" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/gogoproto/proto" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" + + "cosmossdk.io/core/address" + "cosmossdk.io/core/appmodule" + "cosmossdk.io/depinject" + "cosmossdk.io/log" + "cosmossdk.io/x/evidence" + evidencetypes "cosmossdk.io/x/evidence/types" + "cosmossdk.io/x/feegrant" + feegrantmodule "cosmossdk.io/x/feegrant/module" + "cosmossdk.io/x/upgrade" + upgradetypes "cosmossdk.io/x/upgrade/types" "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/testutil/mock" + "github.com/cosmos/cosmos-sdk/testutil/network" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/types/msgservice" "github.com/cosmos/cosmos-sdk/x/auth" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/auth/vesting" + vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" + "github.com/cosmos/cosmos-sdk/x/authz" authzmodule "github.com/cosmos/cosmos-sdk/x/authz/module" "github.com/cosmos/cosmos-sdk/x/bank" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/cosmos/cosmos-sdk/x/crisis" "github.com/cosmos/cosmos-sdk/x/distribution" + distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + "github.com/cosmos/cosmos-sdk/x/epochs" + epochstypes "github.com/cosmos/cosmos-sdk/x/epochs/types" "github.com/cosmos/cosmos-sdk/x/genutil" + genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" "github.com/cosmos/cosmos-sdk/x/gov" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + grouptypes "github.com/cosmos/cosmos-sdk/x/group" group "github.com/cosmos/cosmos-sdk/x/group/module" "github.com/cosmos/cosmos-sdk/x/mint" - "github.com/cosmos/cosmos-sdk/x/params" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" "github.com/cosmos/cosmos-sdk/x/slashing" + slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" "github.com/cosmos/cosmos-sdk/x/staking" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) func TestSimAppExportAndBlockedAddrs(t *testing.T) { @@ -48,7 +66,7 @@ func TestSimAppExportAndBlockedAddrs(t *testing.T) { AppOpts: simtestutil.NewAppOptionsWithFlagHome(t.TempDir()), }) - // BlockedAddresses returns a map of addresses in app v1 and a map of modules name in app v2. + // BlockedAddresses returns a map of addresses in app v1 and a map of modules name in app di. for acc := range BlockedAddresses() { var addr sdk.AccAddress if modAddr, err := sdk.AccAddressFromBech32(acc); err == nil { @@ -190,22 +208,21 @@ func TestRunMigrations(t *testing.T) { _, err = app.ModuleManager.RunMigrations( app.NewContextLegacy(true, cmtproto.Header{Height: app.LastBlockHeight()}), configurator, module.VersionMap{ - "bank": 1, - "auth": auth.AppModule{}.ConsensusVersion(), - "authz": authzmodule.AppModule{}.ConsensusVersion(), - "staking": staking.AppModule{}.ConsensusVersion(), - "mint": mint.AppModule{}.ConsensusVersion(), - "distribution": distribution.AppModule{}.ConsensusVersion(), - "slashing": slashing.AppModule{}.ConsensusVersion(), - "gov": gov.AppModule{}.ConsensusVersion(), - "group": group.AppModule{}.ConsensusVersion(), - "params": params.AppModule{}.ConsensusVersion(), - "upgrade": upgrade.AppModule{}.ConsensusVersion(), - "vesting": vesting.AppModule{}.ConsensusVersion(), - "feegrant": feegrantmodule.AppModule{}.ConsensusVersion(), - "evidence": evidence.AppModule{}.ConsensusVersion(), - "crisis": crisis.AppModule{}.ConsensusVersion(), - "genutil": genutil.AppModule{}.ConsensusVersion(), + banktypes.ModuleName: 1, + authtypes.ModuleName: auth.AppModule{}.ConsensusVersion(), + authz.ModuleName: authzmodule.AppModule{}.ConsensusVersion(), + stakingtypes.ModuleName: staking.AppModule{}.ConsensusVersion(), + minttypes.ModuleName: mint.AppModule{}.ConsensusVersion(), + distrtypes.ModuleName: distribution.AppModule{}.ConsensusVersion(), + slashingtypes.ModuleName: slashing.AppModule{}.ConsensusVersion(), + govtypes.ModuleName: gov.AppModule{}.ConsensusVersion(), + grouptypes.ModuleName: group.AppModule{}.ConsensusVersion(), + upgradetypes.ModuleName: upgrade.AppModule{}.ConsensusVersion(), + vestingtypes.ModuleName: vesting.AppModule{}.ConsensusVersion(), + feegrant.ModuleName: feegrantmodule.AppModule{}.ConsensusVersion(), + evidencetypes.ModuleName: evidence.AppModule{}.ConsensusVersion(), + genutiltypes.ModuleName: genutil.AppModule{}.ConsensusVersion(), + epochstypes.ModuleName: epochs.AppModule{}.ConsensusVersion(), }, ) if tc.expRunErr { @@ -231,7 +248,7 @@ func TestInitGenesisOnMigration(t *testing.T) { mockModule := mock.NewMockAppModuleWithAllExtensions(mockCtrl) mockDefaultGenesis := json.RawMessage(`{"key": "value"}`) mockModule.EXPECT().DefaultGenesis(gomock.Eq(app.appCodec)).Times(1).Return(mockDefaultGenesis) - mockModule.EXPECT().InitGenesis(gomock.Eq(ctx), gomock.Eq(app.appCodec), gomock.Eq(mockDefaultGenesis)).Times(1).Return(nil) + mockModule.EXPECT().InitGenesis(gomock.Eq(ctx), gomock.Eq(app.appCodec), gomock.Eq(mockDefaultGenesis)).Times(1) mockModule.EXPECT().ConsensusVersion().Times(1).Return(uint64(0)) app.ModuleManager.Modules["mock"] = mockModule @@ -248,12 +265,10 @@ func TestInitGenesisOnMigration(t *testing.T) { "distribution": distribution.AppModule{}.ConsensusVersion(), "slashing": slashing.AppModule{}.ConsensusVersion(), "gov": gov.AppModule{}.ConsensusVersion(), - "params": params.AppModule{}.ConsensusVersion(), "upgrade": upgrade.AppModule{}.ConsensusVersion(), "vesting": vesting.AppModule{}.ConsensusVersion(), "feegrant": feegrantmodule.AppModule{}.ConsensusVersion(), "evidence": evidence.AppModule{}.ConsensusVersion(), - "crisis": crisis.AppModule{}.ConsensusVersion(), "genutil": genutil.AppModule{}.ConsensusVersion(), }, ) @@ -295,3 +310,61 @@ func TestProtoAnnotations(t *testing.T) { err = msgservice.ValidateProtoAnnotations(r) require.NoError(t, err) } + +var _ address.Codec = (*customAddressCodec)(nil) + +type customAddressCodec struct{} + +func (c customAddressCodec) StringToBytes(text string) ([]byte, error) { + return []byte(text), nil +} + +func (c customAddressCodec) BytesToString(bz []byte) (string, error) { + return string(bz), nil +} + +func TestAddressCodecFactory(t *testing.T) { + var addrCodec address.Codec + var valAddressCodec runtime.ValidatorAddressCodec + var consAddressCodec runtime.ConsensusAddressCodec + + err := depinject.Inject( + depinject.Configs( + network.MinimumAppConfig(), + depinject.Supply(log.NewNopLogger()), + ), + &addrCodec, &valAddressCodec, &consAddressCodec) + require.NoError(t, err) + require.NotNil(t, addrCodec) + _, ok := addrCodec.(customAddressCodec) + require.False(t, ok) + require.NotNil(t, valAddressCodec) + _, ok = valAddressCodec.(customAddressCodec) + require.False(t, ok) + require.NotNil(t, consAddressCodec) + _, ok = consAddressCodec.(customAddressCodec) + require.False(t, ok) + + // Set the address codec to the custom one + err = depinject.Inject( + depinject.Configs( + network.MinimumAppConfig(), + depinject.Supply( + log.NewNopLogger(), + func() address.Codec { return customAddressCodec{} }, + func() runtime.ValidatorAddressCodec { return customAddressCodec{} }, + func() runtime.ConsensusAddressCodec { return customAddressCodec{} }, + ), + ), + &addrCodec, &valAddressCodec, &consAddressCodec) + require.NoError(t, err) + require.NotNil(t, addrCodec) + _, ok = addrCodec.(customAddressCodec) + require.True(t, ok) + require.NotNil(t, valAddressCodec) + _, ok = valAddressCodec.(customAddressCodec) + require.True(t, ok) + require.NotNil(t, consAddressCodec) + _, ok = consAddressCodec.(customAddressCodec) + require.True(t, ok) +} diff --git a/simapp/export.go b/simapp/export.go index 9b233dc74680..f509a72203e1 100644 --- a/simapp/export.go +++ b/simapp/export.go @@ -71,19 +71,27 @@ func (app *SimApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [] allowedAddrsMap[addr] = true } - /* Just to be safe, assert the invariants on current state. */ - app.CrisisKeeper.AssertInvariants(ctx) - /* Handle fee distribution state. */ // withdraw all validator commission - app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { - _, _ = app.DistrKeeper.WithdrawValidatorCommission(ctx, val.GetOperator()) + err := app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { + valBz, err := app.StakingKeeper.ValidatorAddressCodec().StringToBytes(val.GetOperator()) + if err != nil { + panic(err) + } + _, _ = app.DistrKeeper.WithdrawValidatorCommission(ctx, valBz) return false }) + if err != nil { + panic(err) + } // withdraw all delegator rewards - dels := app.StakingKeeper.GetAllDelegations(ctx) + dels, err := app.StakingKeeper.GetAllDelegations(ctx) + if err != nil { + panic(err) + } + for _, delegation := range dels { valAddr, err := sdk.ValAddressFromBech32(delegation.ValidatorAddress) if err != nil { @@ -106,9 +114,13 @@ func (app *SimApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [] ctx = ctx.WithBlockHeight(0) // reinitialize all validators - app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { + err = app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { + valBz, err := app.StakingKeeper.ValidatorAddressCodec().StringToBytes(val.GetOperator()) + if err != nil { + panic(err) + } // donate any unwithdrawn outstanding reward fraction tokens to the community pool - scraps, err := app.DistrKeeper.GetValidatorOutstandingRewardsCoins(ctx, val.GetOperator()) + scraps, err := app.DistrKeeper.GetValidatorOutstandingRewardsCoins(ctx, valBz) if err != nil { panic(err) } @@ -121,7 +133,7 @@ func (app *SimApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [] panic(err) } - if err := app.DistrKeeper.Hooks().AfterValidatorCreated(ctx, val.GetOperator()); err != nil { + if err := app.DistrKeeper.Hooks().AfterValidatorCreated(ctx, valBz); err != nil { panic(err) } return false @@ -156,7 +168,10 @@ func (app *SimApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [] for i := range red.Entries { red.Entries[i].CreationHeight = 0 } - app.StakingKeeper.SetRedelegation(ctx, red) + err = app.StakingKeeper.SetRedelegation(ctx, red) + if err != nil { + panic(err) + } return false }) @@ -165,7 +180,10 @@ func (app *SimApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [] for i := range ubd.Entries { ubd.Entries[i].CreationHeight = 0 } - app.StakingKeeper.SetUnbondingDelegation(ctx, ubd) + err = app.StakingKeeper.SetUnbondingDelegation(ctx, ubd) + if err != nil { + panic(err) + } return false }) @@ -177,8 +195,8 @@ func (app *SimApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [] for ; iter.Valid(); iter.Next() { addr := sdk.ValAddress(stakingtypes.AddressFromValidatorsKey(iter.Key())) - validator, found := app.StakingKeeper.GetValidator(ctx, addr) - if !found { + validator, err := app.StakingKeeper.GetValidator(ctx, addr) + if err != nil { panic("expected validator, not found") } @@ -196,7 +214,7 @@ func (app *SimApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [] return } - _, err := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + _, err = app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) if err != nil { log.Fatal(err) } diff --git a/simapp/genesis_account_test.go b/simapp/genesis_account_test.go index ea62b588045c..d813e9ec7e31 100644 --- a/simapp/genesis_account_test.go +++ b/simapp/genesis_account_test.go @@ -4,13 +4,14 @@ import ( "testing" "time" + "github.com/cometbft/cometbft/crypto" + "github.com/stretchr/testify/require" + "cosmossdk.io/simapp" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - - "github.com/cometbft/cometbft/crypto" - "github.com/stretchr/testify/require" ) func TestSimGenesisAccountValidate(t *testing.T) { diff --git a/simapp/go.mod b/simapp/go.mod index 421da8de902f..4b662e45dabe 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -1,221 +1,237 @@ module cosmossdk.io/simapp -go 1.20 +go 1.23.0 require ( - cosmossdk.io/api v0.4.2 - cosmossdk.io/client/v2 v2.0.0-20230309163709-87da587416ba - cosmossdk.io/core v0.8.0 - cosmossdk.io/depinject v1.0.0-alpha.3 - cosmossdk.io/log v1.1.0 - cosmossdk.io/math v1.0.1 - cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c - cosmossdk.io/tools/confix v0.0.0-20230120150717-4f6f6c00021f - cosmossdk.io/tools/rosetta v0.2.1 - cosmossdk.io/x/circuit v0.0.0-20230220112800-f69b9ff58fbe - cosmossdk.io/x/evidence v0.1.0 - cosmossdk.io/x/feegrant v0.0.0-20230117113717-50e7c4a4ceff - cosmossdk.io/x/nft v0.0.0-20230113085233-fae3332d62fc - cosmossdk.io/x/tx v0.8.0 - cosmossdk.io/x/upgrade v0.0.0-20230127052425-54c8e1568335 - github.com/cometbft/cometbft v0.38.0-rc1 - github.com/cosmos/cosmos-db v1.0.0 + cosmossdk.io/api v0.7.6 + cosmossdk.io/client/v2 v2.0.0-beta.5.0.20241121152743-3dad36d9a29e + cosmossdk.io/collections v0.4.0 // indirect + cosmossdk.io/core v0.11.1 + cosmossdk.io/depinject v1.1.0 + cosmossdk.io/log v1.5.0 + cosmossdk.io/math v1.5.0 + cosmossdk.io/store v1.1.1 + cosmossdk.io/tools/confix v0.1.2 + cosmossdk.io/x/circuit v0.1.1 + cosmossdk.io/x/evidence v0.1.1 + cosmossdk.io/x/feegrant v0.1.1 + cosmossdk.io/x/nft v0.1.1 + cosmossdk.io/x/tx v0.13.7 + cosmossdk.io/x/upgrade v0.1.4 + github.com/cometbft/cometbft v0.38.17 + github.com/cosmos/cosmos-db v1.1.1 // this version is not used as it is always replaced by the latest Cosmos SDK version - github.com/cosmos/cosmos-sdk v0.50.0 - github.com/cosmos/gogoproto v1.4.10 - github.com/golang/mock v1.6.0 - github.com/spf13/cast v1.5.1 - github.com/spf13/cobra v1.7.0 - github.com/spf13/pflag v1.0.5 - github.com/spf13/viper v1.16.0 - github.com/stretchr/testify v1.8.4 - google.golang.org/protobuf v1.30.0 + github.com/cosmos/cosmos-sdk v0.50.13 + github.com/cosmos/gogoproto v1.7.0 + github.com/spf13/cast v1.7.1 + github.com/spf13/cobra v1.9.1 + github.com/spf13/pflag v1.0.6 + github.com/spf13/viper v1.20.0 + github.com/stretchr/testify v1.10.0 + go.uber.org/mock v0.5.0 + google.golang.org/protobuf v1.36.5 ) require ( - cloud.google.com/go v0.110.0 // indirect - cloud.google.com/go/compute v1.19.0 // indirect - cloud.google.com/go/compute/metadata v0.2.3 // indirect - cloud.google.com/go/iam v0.13.0 // indirect - cloud.google.com/go/storage v1.30.0 // indirect - cosmossdk.io/collections v0.2.0 // indirect - cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 // indirect - filippo.io/edwards25519 v1.0.0 // indirect + cel.dev/expr v0.19.1 // indirect + cloud.google.com/go v0.116.0 // indirect + cloud.google.com/go/auth v0.13.0 // indirect + cloud.google.com/go/auth/oauth2adapt v0.2.6 // indirect + cloud.google.com/go/compute/metadata v0.6.0 // indirect + cloud.google.com/go/iam v1.2.2 // indirect + cloud.google.com/go/monitoring v1.21.2 // indirect + cloud.google.com/go/storage v1.49.0 // indirect + cosmossdk.io/errors v1.0.1 // indirect + filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect - github.com/DataDog/zstd v1.5.5 // indirect - github.com/armon/go-metrics v0.4.1 // indirect + github.com/DataDog/datadog-go v3.2.0+incompatible // indirect + github.com/DataDog/zstd v1.5.6 // indirect + github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0 // indirect + github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.48.1 // indirect + github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.48.1 // indirect github.com/aws/aws-sdk-go v1.44.224 // 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 - github.com/bits-and-blooms/bitset v1.7.0 // indirect - github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect + github.com/bgentry/speakeasy v0.2.0 // indirect + github.com/bits-and-blooms/bitset v1.22.0 // indirect + github.com/bytedance/sonic v1.13.1 // indirect + github.com/bytedance/sonic/loader v0.2.4 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // indirect - github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chzyer/readline v1.5.1 // indirect + github.com/cloudwego/base64x v0.1.5 // indirect + github.com/cncf/xds/go v0.0.0-20241223141626-cff3c89139a3 // indirect github.com/cockroachdb/apd/v2 v2.0.2 // indirect - github.com/cockroachdb/errors v1.9.1 // indirect + github.com/cockroachdb/apd/v3 v3.2.1 // indirect + github.com/cockroachdb/errors v1.11.3 // indirect + github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20230606202032-d96868fd481e // indirect - github.com/cockroachdb/redact v1.1.4 // indirect - github.com/coinbase/rosetta-sdk-go/types v1.0.0 // indirect - github.com/cometbft/cometbft-db v0.7.0 // indirect + github.com/cockroachdb/pebble v1.1.2 // indirect + github.com/cockroachdb/redact v1.1.5 // indirect + github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect + github.com/cometbft/cometbft-db v0.14.1 // indirect github.com/cosmos/btcutil v1.0.5 // indirect - github.com/cosmos/cosmos-proto v1.0.0-beta.3 // indirect + github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.0.0-beta.2 // indirect - github.com/cosmos/ics23/go v0.10.0 // indirect - github.com/cosmos/ledger-cosmos-go v0.13.0 // indirect - github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect + github.com/cosmos/iavl v1.2.2 // indirect + github.com/cosmos/ics23/go v0.11.0 // indirect + github.com/cosmos/ledger-cosmos-go v0.14.0 // indirect github.com/creachadair/atomicfile v0.3.1 // indirect github.com/creachadair/tomledit v0.0.24 // indirect github.com/danieljoos/wincred v1.1.2 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect - github.com/dgraph-io/badger/v2 v2.2007.4 // indirect + github.com/dgraph-io/badger/v4 v4.2.0 // indirect 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/dvsekhvalnov/jose2go v1.5.0 // indirect - github.com/emicklei/dot v1.4.2 // indirect + github.com/dvsekhvalnov/jose2go v1.6.0 // indirect + github.com/emicklei/dot v1.6.2 // indirect + github.com/envoyproxy/go-control-plane/envoy v1.32.4 // indirect + github.com/envoyproxy/protoc-gen-validate v1.2.1 // indirect github.com/fatih/color v1.15.0 // indirect - github.com/felixge/httpsnoop v1.0.2 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/getsentry/sentry-go v0.21.0 // indirect - github.com/go-kit/kit v0.12.0 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect + github.com/getsentry/sentry-go v0.27.0 // indirect + github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect + github.com/go-logr/logr v1.4.2 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/googleapis v1.4.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/glog v1.1.0 // indirect + github.com/golang/glog v1.2.4 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.4 // indirect - github.com/google/btree v1.1.2 // indirect - github.com/google/go-cmp v0.5.9 // indirect + github.com/google/btree v1.1.3 // indirect + github.com/google/flatbuffers v1.12.1 // indirect + github.com/google/go-cmp v0.7.0 // indirect github.com/google/orderedcode v0.0.1 // indirect - github.com/google/s2a-go v0.1.3 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect - github.com/googleapis/gax-go/v2 v2.8.0 // indirect - github.com/gorilla/handlers v1.5.1 // indirect - github.com/gorilla/mux v1.8.0 // indirect - github.com/gorilla/websocket v1.5.0 // indirect + github.com/google/s2a-go v0.1.8 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect + github.com/googleapis/gax-go/v2 v2.14.1 // 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/grpc-ecosystem/grpc-gateway v1.16.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-getter v1.7.1 // indirect + github.com/hashicorp/go-getter v1.7.4 // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/go-plugin v1.4.10 // indirect + github.com/hashicorp/go-metrics v0.5.4 // indirect + github.com/hashicorp/go-plugin v1.5.2 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-version v1.6.0 // indirect - github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect - github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/yamux v0.1.1 // indirect - github.com/hdevalence/ed25519consensus v0.1.0 // indirect - github.com/huandu/skiplist v1.2.0 // indirect - github.com/iancoleman/strcase v0.2.0 // indirect + github.com/hdevalence/ed25519consensus v0.2.0 // indirect + github.com/huandu/skiplist v1.2.1 // 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/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.16.5 // indirect + github.com/klauspost/compress v1.17.11 // indirect + github.com/klauspost/cpuid/v2 v2.2.10 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect - github.com/lib/pq v1.10.7 // indirect - github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.0 // indirect - github.com/magiconair/properties v1.8.7 // indirect + github.com/lib/pq v1.10.9 // indirect + github.com/linxGnu/grocksdb v1.8.14 // 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.19 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/minio/highwayhash v1.0.2 // indirect + github.com/mattn/go-colorable v0.1.14 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/minio/highwayhash v1.0.3 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect - github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect - github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.0.8 // indirect - github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761 // indirect + github.com/pelletier/go-toml/v2 v2.2.3 // indirect + github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.15.1 // indirect - github.com/prometheus/client_model v0.4.0 // indirect - github.com/prometheus/common v0.44.0 // indirect - github.com/prometheus/procfs v0.10.1 // indirect + github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/prometheus/client_golang v1.21.1 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.62.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.10.0 // indirect - github.com/rs/cors v1.8.3 // indirect - github.com/rs/zerolog v1.29.1 // indirect - github.com/sasha-s/go-deadlock v0.3.1 // indirect - github.com/spf13/afero v1.9.5 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/subosito/gotenv v1.4.2 // indirect + github.com/rogpeppe/go-internal v1.13.1 // indirect + github.com/rs/cors v1.11.1 // indirect + github.com/rs/zerolog v1.33.0 // indirect + github.com/sagikazarmark/locafero v0.7.0 // indirect + github.com/sasha-s/go-deadlock v0.3.5 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.12.0 // indirect + github.com/subosito/gotenv v1.6.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect - github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect github.com/tendermint/go-amino v0.16.0 // indirect - github.com/tidwall/btree v1.6.0 // indirect + github.com/tidwall/btree v1.7.0 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ulikunitz/xz v0.5.11 // indirect - github.com/zondax/hid v0.9.1 // indirect - github.com/zondax/ledger-go v0.14.1 // indirect - go.etcd.io/bbolt v1.3.7 // indirect + github.com/zondax/hid v0.9.2 // indirect + github.com/zondax/ledger-go v0.14.3 // indirect + go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 // indirect go.opencensus.io v0.24.0 // indirect - golang.org/x/crypto v0.9.0 // indirect - golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/oauth2 v0.8.0 // indirect - golang.org/x/sync v0.2.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/term v0.8.0 // indirect - golang.org/x/text v0.9.0 // indirect - golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect - google.golang.org/api v0.122.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20230525234025-438c736192d0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect - google.golang.org/grpc v1.55.0 // indirect - gopkg.in/ini.v1 v1.67.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect + go.opentelemetry.io/auto/sdk v1.1.0 // indirect + go.opentelemetry.io/contrib/detectors/gcp v1.34.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect + go.opentelemetry.io/otel v1.34.0 // indirect + go.opentelemetry.io/otel/metric v1.34.0 // indirect + go.opentelemetry.io/otel/sdk v1.34.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.34.0 // indirect + go.opentelemetry.io/otel/trace v1.34.0 // indirect + go.uber.org/multierr v1.10.0 // indirect + golang.org/x/arch v0.15.0 // indirect + golang.org/x/crypto v0.36.0 // indirect + golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect + golang.org/x/net v0.35.0 // indirect + golang.org/x/oauth2 v0.25.0 // indirect + golang.org/x/sync v0.12.0 // indirect + golang.org/x/sys v0.31.0 // indirect + golang.org/x/term v0.30.0 // indirect + golang.org/x/text v0.23.0 // indirect + golang.org/x/time v0.8.0 // indirect + google.golang.org/api v0.215.0 // indirect + google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a // indirect + google.golang.org/grpc v1.71.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - gotest.tools/v3 v3.4.0 // indirect + gotest.tools/v3 v3.5.2 // indirect nhooyr.io/websocket v1.8.6 // indirect - pgregory.net/rapid v0.6.2 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect + pgregory.net/rapid v1.2.0 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect ) // Here are the short-lived replace from the SimApp // Replace here are pending PRs, or version to be tagged -replace ( - cosmossdk.io/client/v2 => ../client/v2 - cosmossdk.io/tools/confix => ../tools/confix - cosmossdk.io/tools/rosetta => ../tools/rosetta - cosmossdk.io/x/circuit => ../x/circuit - cosmossdk.io/x/evidence => ../x/evidence - cosmossdk.io/x/feegrant => ../x/feegrant - cosmossdk.io/x/nft => ../x/nft - cosmossdk.io/x/tx => ../x/tx - cosmossdk.io/x/upgrade => ../x/upgrade -) +// replace ( +// +// ) // Below are the long-lived replace of the SimApp replace ( + cosmossdk.io/api => ../api + cosmossdk.io/log => ../log // use cosmos fork of keyring github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 // Simapp always use the latest version of the cosmos-sdk github.com/cosmos/cosmos-sdk => ../. // Fix upstream GHSA-h395-qcrw-5vmq and GHSA-3vp4-m3rf-835h vulnerabilities. // TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 - github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0 + github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.1 // replace broken goleveldb github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 ) diff --git a/simapp/go.sum b/simapp/go.sum index 94d6aa531ecf..be4b31ca9f0a 100644 --- a/simapp/go.sum +++ b/simapp/go.sum @@ -1,9 +1,10 @@ +cel.dev/expr v0.19.1 h1:NciYrtDRIR0lNCnH1LFJegdjspNx9fI59O7TWcua/W4= +cel.dev/expr v0.19.1/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= @@ -16,7 +17,6 @@ cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOY cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= @@ -32,8 +32,8 @@ cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w9 cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= -cloud.google.com/go v0.110.0 h1:Zc8gqp3+a9/Eyph2KDmcGaPtbKRIoqq4YTlL4NMD0Ys= -cloud.google.com/go v0.110.0/go.mod h1:SJnCLqQ0FCFGSZMUNUf84MV3Aia54kn7pi8st7tMzaY= +cloud.google.com/go v0.116.0 h1:B3fRrSDkLRt5qSHWe40ERJvhvnQwdZiHu0bJOpldweE= +cloud.google.com/go v0.116.0/go.mod h1:cEPSRWPzZEswwdr9BxE6ChEn01dWlTaF05LiC2Xs70U= cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= @@ -48,6 +48,10 @@ cloud.google.com/go/asset v1.8.0/go.mod h1:mUNGKhiqIdbr8X7KNayoYvyc4HbbFO9URsjby cloud.google.com/go/assuredworkloads v1.5.0/go.mod h1:n8HOZ6pff6re5KYfBXcFvSViQjDwxFkAkmUFffJRbbY= cloud.google.com/go/assuredworkloads v1.6.0/go.mod h1:yo2YOk37Yc89Rsd5QMVECvjaMKymF9OP+QXWlKXUkXw= cloud.google.com/go/assuredworkloads v1.7.0/go.mod h1:z/736/oNmtGAyU47reJgGN+KVoYoxeLBoj4XkKYscNI= +cloud.google.com/go/auth v0.13.0 h1:8Fu8TZy167JkW8Tj3q7dIkr2v4cndv41ouecJx0PAHs= +cloud.google.com/go/auth v0.13.0/go.mod h1:COOjD9gwfKNKz+IIduatIhYJQIc0mG3H102r/EMxX6Q= +cloud.google.com/go/auth/oauth2adapt v0.2.6 h1:V6a6XDu2lTwPZWOawrAa9HUK+DB2zfJyTuciBG5hFkU= +cloud.google.com/go/auth/oauth2adapt v0.2.6/go.mod h1:AlmsELtlEBnaNTL7jCj8VQFLy6mbZv0s4Q7NGBeQ5E8= cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0= cloud.google.com/go/automl v1.6.0/go.mod h1:ugf8a6Fx+zP0D59WLhqgTDsQI9w07o64uf/Is3Nh5p8= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= @@ -70,10 +74,8 @@ cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= -cloud.google.com/go/compute v1.19.0 h1:+9zda3WGgW1ZSTlVppLCYFIr48Pa35q1uG2N1itbCEQ= -cloud.google.com/go/compute v1.19.0/go.mod h1:rikpw2y+UMidAe9tISo04EHNOIf42RLYF/q8Bs93scU= -cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= -cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +cloud.google.com/go/compute/metadata v0.6.0 h1:A6hENjEsCDtC1k8byVsgwvVcioamEHvZ4j01OwKxG9I= +cloud.google.com/go/compute/metadata v0.6.0/go.mod h1:FjyFAW1MW0C203CEOMDTu3Dk1FlqW3Rga40jzHL4hfg= cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0= @@ -111,19 +113,24 @@ cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y97 cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= -cloud.google.com/go/iam v0.13.0 h1:+CmB+K0J/33d0zSQ9SlFWUeCCEn5XJA0ZMZ3pHE9u8k= -cloud.google.com/go/iam v0.13.0/go.mod h1:ljOg+rcNfzZ5d6f1nAUJ8ZIxOaZUVoS14bKCtaLZ/D0= +cloud.google.com/go/iam v1.2.2 h1:ozUSofHUGf/F4tCNy/mu9tHLTaxZFLOUiKzjcgWHGIA= +cloud.google.com/go/iam v1.2.2/go.mod h1:0Ys8ccaZHdI1dEUilwzqng/6ps2YB6vRsjIe00/+6JY= cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08= -cloud.google.com/go/longrunning v0.4.1 h1:v+yFJOfKC3yZdY6ZUI933pIYdhyhV8S3NpWrXWmg7jM= +cloud.google.com/go/logging v1.12.0 h1:ex1igYcGFd4S/RZWOCU51StlIEuey5bjqwH9ZYjHibk= +cloud.google.com/go/logging v1.12.0/go.mod h1:wwYBt5HlYP1InnrtYI0wtwttpVU1rifnMT7RejksUAM= +cloud.google.com/go/longrunning v0.6.2 h1:xjDfh1pQcWPEvnfjZmwjKQEcHnpz6lHjfy7Fo0MK+hc= +cloud.google.com/go/longrunning v0.6.2/go.mod h1:k/vIs83RN4bE3YCswdXC5PFfWVILjm3hpEUlSko4PiI= cloud.google.com/go/mediatranslation v0.5.0/go.mod h1:jGPUhGTybqsPQn91pNXw0xVHfuJ3leR1wj37oU3y1f4= cloud.google.com/go/mediatranslation v0.6.0/go.mod h1:hHdBCTYNigsBxshbznuIMFNe5QXEowAuNmmC7h8pu5w= cloud.google.com/go/memcache v1.4.0/go.mod h1:rTOfiGZtJX1AaFUrOgsMHX5kAzaTQ8azHiuDoTPzNsE= cloud.google.com/go/memcache v1.5.0/go.mod h1:dk3fCK7dVo0cUU2c36jKb4VqKPS22BTkf81Xq617aWM= cloud.google.com/go/metastore v1.5.0/go.mod h1:2ZNrDcQwghfdtCwJ33nM0+GrBGlVuh8rakL3vdPY3XY= cloud.google.com/go/metastore v1.6.0/go.mod h1:6cyQTls8CWXzk45G55x57DVQ9gWg7RiH65+YgPsNh9s= +cloud.google.com/go/monitoring v1.21.2 h1:FChwVtClH19E7pJ+e0xUhJPGksctZNVOk2UhMmblmdU= +cloud.google.com/go/monitoring v1.21.2/go.mod h1:hS3pXvaG8KgWTSz+dAdyzPrGUYmi2Q+WFX8g2hqVEZU= cloud.google.com/go/networkconnectivity v1.4.0/go.mod h1:nOl7YL8odKyAOtzNX73/M5/mGZgqqMeryi6UPZTk/rA= cloud.google.com/go/networkconnectivity v1.5.0/go.mod h1:3GzqJx7uhtlM3kln0+x5wyFvuVH1pIBJjhCpjzSt75o= cloud.google.com/go/networksecurity v0.5.0/go.mod h1:xS6fOCoqpVC5zx15Z/MqkfDwH4+m/61A3ODiDV1xmiQ= @@ -171,14 +178,15 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= -cloud.google.com/go/storage v1.30.0 h1:g1yrbxAWOrvg/594228pETWkOi00MLTrOWfh56veU5o= -cloud.google.com/go/storage v1.30.0/go.mod h1:xAVretHSROm1BQX4IIsoVgJqw0LqOyX+I/O2GzRAzdE= +cloud.google.com/go/storage v1.49.0 h1:zenOPBOWHCnojRd9aJZAyQXBYqkJkdQS42dxL55CIMw= +cloud.google.com/go/storage v1.49.0/go.mod h1:k1eHhhpLvrPjVGfo0mOUPEJ4Y2+a/Hv5PiwehZI9qGU= cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= +cloud.google.com/go/trace v1.11.2 h1:4ZmaBdL8Ng/ajrgKqY5jfvzqMXbrDcBsUGXOT9aqTtI= +cloud.google.com/go/trace v1.11.2/go.mod h1:bn7OwXd4pd5rFuAnTrzBuoZ4ax2XQeG3qNgYmfCy0Io= cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= cloud.google.com/go/videointelligence v1.7.0/go.mod h1:k8pI/1wAhjznARtVT9U1llUaFNPh7muw8QyOUpavru4= cloud.google.com/go/vision v1.2.0/go.mod h1:SmNwgObm5DpFBme2xpyOyasvBc1aPdjvMk2bBk0tKD0= @@ -188,51 +196,68 @@ cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xX cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= -cosmossdk.io/api v0.4.2 h1:lQBMl4xINnMnBOR/tQLtjlDnR4exr4e6/SfHR8PILE0= -cosmossdk.io/api v0.4.2/go.mod h1:qrVgOp7DIeAXa+Tt5dDjOC47bZCDrwx8ZHxrmy7STNE= -cosmossdk.io/collections v0.2.0 h1:CgMfLtE16+qox3zBYrGh60i4yKV8SeExLnIdOS2sbQs= -cosmossdk.io/collections v0.2.0/go.mod h1:Oc1FK0vlmxJZsgUn9/o3ldE6zNyWKvobVzaLhWknZJE= -cosmossdk.io/core v0.8.0 h1:LcJnu52E1a8f8E317VfQ1xK/RZe+IuhMNQAjnDLh25M= -cosmossdk.io/core v0.8.0/go.mod h1:LF6VLOv2DdCiaHxYVmr0MZcZpaSM9ZgvyrQSYTeg6D0= -cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw= -cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= -cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 h1:BCRz06fvddw7cKGiEGDiSox3qMsjQ97f92K+PDZDHdc= -cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741/go.mod h1:TB05o6YXkZkzsc+6bZFAV5kZRBtoCU9tUkbeMIqEg0w= -cosmossdk.io/log v1.1.0 h1:v0ogPHYeTzPcBTcPR1A3j1hkei4pZama8kz8LKlCMv0= -cosmossdk.io/log v1.1.0/go.mod h1:6zjroETlcDs+mm62gd8Ig7mZ+N+fVOZS91V17H+M4N4= -cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= -cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= -cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c h1:A+FMPW9GtfcPBDQNtFeDFN27h1SAP6OVjnGgPLlYXmI= -cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c/go.mod h1:RbYGvXCbz8uNBCXrwS9Z8SyydeWi+W5x5MZ33muyzMw= +cosmossdk.io/client/v2 v2.0.0-beta.5.0.20241121152743-3dad36d9a29e h1:NqQEVIjRqSdsAfTI9uDRZ1oU/cQuCoAbUuIkndQM+Bo= +cosmossdk.io/client/v2 v2.0.0-beta.5.0.20241121152743-3dad36d9a29e/go.mod h1:4p0P6o0ro+FizakJUYS9SeM94RNbv0thLmkHRw5o5as= +cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= +cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= +cosmossdk.io/core v0.11.1 h1:h9WfBey7NAiFfIcUhDVNS503I2P2HdZLebJlUIs8LPA= +cosmossdk.io/core v0.11.1/go.mod h1:OJzxcdC+RPrgGF8NJZR2uoQr56tc7gfBKhiKeDO7hH0= +cosmossdk.io/depinject v1.1.0 h1:wLan7LG35VM7Yo6ov0jId3RHWCGRhe8E8bsuARorl5E= +cosmossdk.io/depinject v1.1.0/go.mod h1:kkI5H9jCGHeKeYWXTqYdruogYrEeWvBQCw1Pj4/eCFI= +cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= +cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= +cosmossdk.io/math v1.5.0 h1:sbOASxee9Zxdjd6OkzogvBZ25/hP929vdcYcBJQbkLc= +cosmossdk.io/math v1.5.0/go.mod h1:AAwwBmUhqtk2nlku174JwSll+/DepUXW3rWIXN5q+Nw= +cosmossdk.io/store v1.1.1 h1:NA3PioJtWDVU7cHHeyvdva5J/ggyLDkyH0hGHl2804Y= +cosmossdk.io/store v1.1.1/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM= +cosmossdk.io/tools/confix v0.1.2 h1:2hoM1oFCNisd0ltSAAZw2i4ponARPmlhuNu3yy0VwI4= +cosmossdk.io/tools/confix v0.1.2/go.mod h1:7XfcbK9sC/KNgVGxgLM0BrFbVcR/+6Dg7MFfpx7duYo= +cosmossdk.io/x/circuit v0.1.1 h1:KPJCnLChWrxD4jLwUiuQaf5mFD/1m7Omyo7oooefBVQ= +cosmossdk.io/x/circuit v0.1.1/go.mod h1:B6f/urRuQH8gjt4eLIXfZJucrbreuYrKh5CSjaOxr+Q= +cosmossdk.io/x/evidence v0.1.1 h1:Ks+BLTa3uftFpElLTDp9L76t2b58htjVbSZ86aoK/E4= +cosmossdk.io/x/evidence v0.1.1/go.mod h1:OoDsWlbtuyqS70LY51aX8FBTvguQqvFrt78qL7UzeNc= +cosmossdk.io/x/feegrant v0.1.1 h1:EKFWOeo/pup0yF0svDisWWKAA9Zags6Zd0P3nRvVvw8= +cosmossdk.io/x/feegrant v0.1.1/go.mod h1:2GjVVxX6G2fta8LWj7pC/ytHjryA6MHAJroBWHFNiEQ= +cosmossdk.io/x/nft v0.1.1 h1:pslAVS8P5NkW080+LWOamInjDcq+v2GSCo+BjN9sxZ8= +cosmossdk.io/x/nft v0.1.1/go.mod h1:Kac6F6y2gsKvoxU+fy8uvxRTi4BIhLOor2zgCNQwVgY= +cosmossdk.io/x/tx v0.13.7 h1:8WSk6B/OHJLYjiZeMKhq7DK7lHDMyK0UfDbBMxVmeOI= +cosmossdk.io/x/tx v0.13.7/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w= +cosmossdk.io/x/upgrade v0.1.4 h1:/BWJim24QHoXde8Bc64/2BSEB6W4eTydq0X/2f8+g38= +cosmossdk.io/x/upgrade v0.1.4/go.mod h1:9v0Aj+fs97O+Ztw+tG3/tp5JSlrmT7IcFhAebQHmOPo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= -filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= +filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= +filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= 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-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= -github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= +github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= -github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= -github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= +github.com/DataDog/zstd v1.5.6 h1:LbEglqepa/ipmmQJUDnSsfvA8e8IStVcGaFWDuxvGOY= +github.com/DataDog/zstd v1.5.6/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0 h1:3c8yed4lgqTt+oTQ+JNMDo+F4xprBf+O/il4ZC0nRLw= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0/go.mod h1:obipzmGjfSjam60XLwGfqUkJsfiheAl+TUjG+4yzyPM= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.48.1 h1:UQ0AhxogsIRZDkElkblfnwjc3IaltCm2HUMvezQaL7s= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.48.1/go.mod h1:jyqM3eLpJ3IbIFDTKVz2rF9T/xWGW0rIriGwnz8l9Tk= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.48.1 h1:oTX4vsorBZo/Zdum6OKPA4o7544hm6smoRv1QjpTwGo= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.48.1/go.mod h1:0wEl7vrAD8mehJyohS9HZy+WyEOaQO2mJx86Cvh93kM= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.48.1 h1:8nn+rsCvTq9axyEh382S0PFLBeaFwNsT43IrPWzctRU= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.48.1/go.mod h1:viRWSEhtMZqz1rhwmOVKkWl6SwmVowfL9O2YR5gI2PE= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= -github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= +github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= 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/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= +github.com/adlio/schema v1.3.6 h1:k1/zc2jNfeiZBA5aFTRy37jlBIuCkXCm0XmvpzCKI9I= +github.com/adlio/schema v1.3.6/go.mod h1:qkxwLgPBd1FgLRHYVCmQT/rrBr3JH38J9LjmVzWNudg= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= -github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= -github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -242,9 +267,7 @@ github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kd github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= 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/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= @@ -254,7 +277,6 @@ github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX 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/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -263,18 +285,23 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= -github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bits-and-blooms/bitset v1.7.0 h1:YjAGVd3XmtK9ktAbX8Zg2g2PwLIMjGREZJHlV4j7NEo= -github.com/bits-and-blooms/bitset v1.7.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= -github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= -github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= -github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= -github.com/bufbuild/protocompile v0.5.1 h1:mixz5lJX4Hiz4FpqFREJHIXLfaLBntfaJv1h+/jS+Qg= +github.com/bgentry/speakeasy v0.2.0 h1:tgObeVOf8WAvtuAX6DhJ4xks4CFNwPDZiqzGqIHE51E= +github.com/bgentry/speakeasy v0.2.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bits-and-blooms/bitset v1.22.0 h1:Tquv9S8+SGaS3EhyA+up3FXzmkhxPGjQQCkcs2uw7w4= +github.com/bits-and-blooms/bitset v1.22.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= +github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= +github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/btcutil v1.1.6 h1:zFL2+c3Lb9gEgqKNzowKUPQNb8jV7v5Oaodi/AYFd6c= +github.com/btcsuite/btcd/btcutil v1.1.6/go.mod h1:9dFymx8HpuLqBnsPELrImQeTQfKBQqzqGbbV3jK55aE= +github.com/bufbuild/protocompile v0.14.1 h1:iA73zAf/fyljNjQKwYzUHD6AD4R8KMasmwa/FBatYVw= +github.com/bufbuild/protocompile v0.14.1/go.mod h1:ppVdAIhbr2H8asPk6k4pY7t9zB1OU5DoEw9xY/FUi1c= github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= -github.com/bytedance/sonic v1.8.0 h1:ea0Xadu+sHlu7x5O3gKhRpQ1IKiMrSiHttPF0ybECuA= -github.com/bytedance/sonic v1.8.0/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= +github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= +github.com/bytedance/sonic v1.13.1 h1:Jyd5CIvdFnkOWuKXr+wm4Nyk2h0yAFsr8ucJgEasO3g= +github.com/bytedance/sonic v1.13.1/go.mod h1:o68xyaF9u2gvVBuGHPlUVCy+ZfmNNO5ETf1+KgkJhz4= +github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= +github.com/bytedance/sonic/loader v0.2.4 h1:ZWCw4stuXUsn1/+zQDqeE7JKP+QO47tz7QCNan80NzY= +github.com/bytedance/sonic/loader v0.2.4/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= @@ -282,14 +309,12 @@ github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInq github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -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/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= -github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM= @@ -304,6 +329,9 @@ github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6D github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudwego/base64x v0.1.5 h1:XPciSp1xaq2VCSt6lF0phncD4koWyULpl5bUxbfCyP4= +github.com/cloudwego/base64x v0.1.5/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= +github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -313,85 +341,81 @@ github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20241223141626-cff3c89139a3 h1:boJj011Hh+874zpIySeApCX4GeOjPl9qhRF3QuIZq+Q= +github.com/cncf/xds/go v0.0.0-20241223141626-cff3c89139a3/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8= github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= -github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= +github.com/cockroachdb/apd/v3 v3.2.1 h1:U+8j7t0axsIgvQUqthuNm82HIrYXodOV2iWLWtEaIwg= +github.com/cockroachdb/apd/v3 v3.2.1/go.mod h1:klXJcjp+FffLTHlhIG69tezTDvdP065naDsHzKhYSqc= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= -github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= -github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= +github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce h1:giXvy4KSc/6g/esnpM7Geqxka4WSqI1SZc7sMJFd3y4= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/pebble v0.0.0-20230606202032-d96868fd481e h1:6QuLTQCQZueVNzoYYUuFfaRgBOpj6gIwQA1PZT2rfWM= -github.com/cockroachdb/pebble v0.0.0-20230606202032-d96868fd481e/go.mod h1:TkdVsGYRqtULUppt2RbC+YaKtTHnHoWa2apfFrSKABw= -github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/cockroachdb/redact v1.1.4 h1:Y0XrVI2FAyofNyGveodTN//qdpPtFKcKTeCBsK3AHAQ= -github.com/cockroachdb/redact v1.1.4/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/pebble v1.1.2 h1:CUh2IPtR4swHlEj48Rhfzw6l/d0qA31fItcIszQVIsA= +github.com/cockroachdb/pebble v1.1.2/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= -github.com/coinbase/rosetta-sdk-go/types v1.0.0 h1:jpVIwLcPoOeCR6o1tU+Xv7r5bMONNbHU7MuEHboiFuA= -github.com/coinbase/rosetta-sdk-go/types v1.0.0/go.mod h1:eq7W2TMRH22GTW0N0beDnN931DW0/WOI1R2sdHNHG4c= -github.com/cometbft/cometbft v0.38.0-rc1 h1:ph6smlqX82aH+d72KuxDHqu29M7LyusSp/obfGsGX/w= -github.com/cometbft/cometbft v0.38.0-rc1/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= -github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= -github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= +github.com/cometbft/cometbft v0.38.17 h1:FkrQNbAjiFqXydeAO81FUzriL4Bz0abYxN/eOHrQGOk= +github.com/cometbft/cometbft v0.38.17/go.mod h1:5l0SkgeLRXi6bBfQuevXjKqML1jjfJJlvI1Ulp02/o4= +github.com/cometbft/cometbft-db v0.14.1 h1:SxoamPghqICBAIcGpleHbmoPqy+crij/++eZz3DlerQ= +github.com/cometbft/cometbft-db v0.14.1/go.mod h1:KHP1YghilyGV/xjD5DP3+2hyigWx0WTp9X+0Gnx0RxQ= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= +github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= -github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0E= -github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= -github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= -github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= +github.com/cosmos/cosmos-db v1.1.1 h1:FezFSU37AlBC8S98NlSagL76oqBRWq/prTPvFcEJNCM= +github.com/cosmos/cosmos-db v1.1.1/go.mod h1:AghjcIPqdhSLP/2Z0yha5xPH3nLnskz81pBx3tcVSAw= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoKuI= -github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= -github.com/cosmos/iavl v1.0.0-beta.2 h1:XOsIM80Yyml/KifCXEYOy9tWCXwMAbLa91n6pReW07Y= -github.com/cosmos/iavl v1.0.0-beta.2/go.mod h1:EA97dJ07TBktRlG/iGzK6g1eCXNj1q3MGoFYkVzrwHE= -github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= -github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= +github.com/cosmos/iavl v1.2.2 h1:qHhKW3I70w+04g5KdsdVSHRbFLgt3yY3qTMd4Xa4rC8= +github.com/cosmos/iavl v1.2.2/go.mod h1:GiM43q0pB+uG53mLxLDzimxM9l/5N9UuSY3/D0huuVw= +github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= +github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= -github.com/cosmos/ledger-cosmos-go v0.13.0 h1:ex0CvCxToSR7j5WjrghPu2Bu9sSXKikjnVvUryNnx4s= -github.com/cosmos/ledger-cosmos-go v0.13.0/go.mod h1:ZcqYgnfNJ6lAXe4HPtWgarNEY+B74i+2/8MhZw4ziiI= -github.com/cosmos/rosetta-sdk-go v0.10.0 h1:E5RhTruuoA7KTIXUcMicL76cffyeoyvNybzUGSKFTcM= -github.com/cosmos/rosetta-sdk-go v0.10.0/go.mod h1:SImAZkb96YbwvoRkzSMQB6noNJXFgWl/ENIznEoYQI4= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/cosmos/ledger-cosmos-go v0.14.0 h1:WfCHricT3rPbkPSVKRH+L4fQGKYHuGOK9Edpel8TYpE= +github.com/cosmos/ledger-cosmos-go v0.14.0/go.mod h1:E07xCWSBl3mTGofZ2QnL4cIUzMbbGVyik84QYKbX3RA= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/creachadair/atomicfile v0.3.1 h1:yQORkHjSYySh/tv5th1dkKcn02NEW5JleB84sjt+W4Q= github.com/creachadair/atomicfile v0.3.1/go.mod h1:mwfrkRxFKwpNAflYZzytbSwxvbK6fdGRRlp0KEQc0qU= github.com/creachadair/tomledit v0.0.24 h1:5Xjr25R2esu1rKCbQEmjZYlrhFkDspoAbAKb6QKQDhQ= github.com/creachadair/tomledit v0.0.24/go.mod h1:9qHbShRWQzSCcn617cMzg4eab1vbLCOjOshAWSzWr8U= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= -github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/decred/dcrd/crypto/blake256 v1.1.0 h1:zPMNGQCm0g4QTY27fOCorQW7EryeQ/U0x++OzVrdms8= +github.com/decred/dcrd/crypto/blake256 v1.1.0/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 h1:NMZiJj8QnKe1LgsbDayM4UoHwbvwDRwnI3hwNaAHRnc= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0/go.mod h1:ZXNYxsqcloTdSy/rNShjYzMhyjf0LaoftYK0p+A3h40= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= -github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= -github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= -github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= -github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= +github.com/dgraph-io/badger/v4 v4.2.0 h1:kJrlajbXXL9DFTNuhhu9yCx7JJa4qpYWxtE8BzuWsEs= +github.com/dgraph-io/badger/v4 v4.2.0/go.mod h1:qfCqhPoWDFJRx1gp5QwwyGo8xk1lbHUxvK9nK0OGAak= github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= @@ -399,20 +423,21 @@ github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUn github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= 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/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= 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/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= -github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= +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/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= -github.com/emicklei/dot v1.4.2 h1:UbK6gX4yvrpHKlxuUQicwoAis4zl8Dzwit9SnbBAXWw= -github.com/emicklei/dot v1.4.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= +github.com/emicklei/dot v1.6.2 h1:08GN+DD79cy/tzN6uLCT84+2Wk9u+wvqP+Hkx/dIR8A= +github.com/emicklei/dot v1.6.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -423,48 +448,50 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.m github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= +github.com/envoyproxy/go-control-plane v0.13.4 h1:zEqyPVyku6IvWCFwux4x9RxkLOMUL+1vC9xUFv5l2/M= +github.com/envoyproxy/go-control-plane v0.13.4/go.mod h1:kDfuBlDVsSj2MjrLEtRWtHlsWIFcGyB2RMO44Dc5GZA= +github.com/envoyproxy/go-control-plane/envoy v1.32.4 h1:jb83lalDRZSpPWW2Z7Mck/8kXZ5CQAFYVjQcdVIr83A= +github.com/envoyproxy/go-control-plane/envoy v1.32.4/go.mod h1:Gzjc5k8JcJswLjAx1Zm+wSYE20UrLtt7JZMWiWQXQEw= +github.com/envoyproxy/go-control-plane/ratelimit v0.1.0 h1:/G9QYbddjL25KvtKTv3an9lx6VBE2cnb8wp1vEGNYGI= +github.com/envoyproxy/go-control-plane/ratelimit v0.1.0/go.mod h1:Wk+tMFAFbCXaJPzVVHnPgRKdUdwW/KdbRt94AzgRee4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= -github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= -github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= -github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= -github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= +github.com/envoyproxy/protoc-gen-validate v1.2.1 h1:DEo3O99U8j4hBFwbJfrz9VtgcDfUKS7KJ7spH3d86P8= +github.com/envoyproxy/protoc-gen-validate v1.2.1/go.mod h1:d/C80l/jxXLdfEIhX1W2TmLfsJ31lvEjwamM4DxlWXU= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= -github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= -github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= -github.com/getsentry/sentry-go v0.21.0 h1:c9l5F1nPF30JIppulk4veau90PK6Smu3abgVtVQWon4= -github.com/getsentry/sentry-go v0.21.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= +github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= +github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= +github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= +github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.9.0 h1:OjyFBKICoexlu99ctXNR2gg+c5pKrKMuyjgARg9qeY8= -github.com/gin-gonic/gin v1.9.0/go.mod h1:W1Me9+hsUSyj3CePGrd1/QrKJMSJ1Tu/0hFEH89961k= -github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= +github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= -github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= -github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= +github.com/go-kit/kit v0.13.0 h1:OoneCcHKHQ03LfBpoQCUfCluwd2Vt3ohz+kvbJneZAU= +github.com/go-kit/kit v0.13.0/go.mod h1:phqEHMMUbyrCFCTgH48JueqrM3md2HcAZ8N3XE4FKDg= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= @@ -473,29 +500,33 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +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-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU= -github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= +github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js= +github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= -github.com/goccy/go-json v0.10.0 h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA= -github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= +github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= -github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= 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= @@ -506,11 +537,9 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV 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/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= -github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= -github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= +github.com/golang/glog v1.2.4 h1:CNNw5U8lSiiBk7druxtSHHTsRWcxKoac6kZKm2peBBc= +github.com/golang/glog v1.2.4/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -545,17 +574,18 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -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/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= +github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= +github.com/google/flatbuffers v1.12.1 h1:MVlul7pQNoDzWRLTw5imwYsl+usrS1TXG2H4jg6ImGw= +github.com/google/flatbuffers v1.12.1/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 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= @@ -570,18 +600,20 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= -github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= +github.com/google/martian/v3 v3.3.3 h1:DIhPTQrbPkgs2yJYdXU/eNACCG5DVQjySNRNlflZ9Fc= +github.com/google/martian/v3 v3.3.3/go.mod h1:iEPrYcgCF7jA9OtScMFQyAlZZ4YXTKEtJ1E6RWzmBA0= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -593,24 +625,24 @@ github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/s2a-go v0.1.3 h1:FAgZmpLl/SXurPEZyCMPBIiiYeTbqfjlbdnCNTAkbGE= -github.com/google/s2a-go v0.1.3/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= +github.com/google/s2a-go v0.1.8 h1:zZDs9gcbt9ZPLV0ndSyQk6Kacx2g/X+SKYovpnz3SMM= +github.com/google/s2a-go v0.1.8/go.mod h1:6iNWHTpQ+nfNRN5E00MSdfDwVesa8hhS32PhPO8deJA= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= -github.com/googleapis/enterprise-certificate-proxy v0.2.3 h1:yk9/cqRKtT9wXZSsRH9aurXEpJX+U6FLtpYTdC3R06k= -github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= +github.com/googleapis/enterprise-certificate-proxy v0.3.4 h1:XYIDZApgAnrN1c855gTgghdIA6Stxb52D5RnLI1SLyw= +github.com/googleapis/enterprise-certificate-proxy v0.3.4/go.mod h1:YKe7cfqYXjKGpGvmSg28/fFvhNzinZQm8DGnaburhGA= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= @@ -620,22 +652,21 @@ github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99 github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= -github.com/googleapis/gax-go/v2 v2.8.0 h1:UBtEZqx1bjXtOQ5BVTkuYghXrr3N4V123VKJK67vJZc= -github.com/googleapis/gax-go/v2 v2.8.0/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= +github.com/googleapis/gax-go/v2 v2.14.1 h1:hb0FFeiPaQskmvakKu5EbCbpntQn48jyHuvrkurSS/Q= +github.com/googleapis/gax-go/v2 v2.14.1/go.mod h1:Hb/NubMaVM88SrNkvl8X/o8XWwDJEPqouaLeN2IUxoA= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= -github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= -github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= +github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE= +github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= @@ -653,17 +684,19 @@ github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-getter v1.7.1 h1:SWiSWN/42qdpR0MdhaOc/bLR48PLuP1ZQtYLRlM69uY= -github.com/hashicorp/go-getter v1.7.1/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= +github.com/hashicorp/go-getter v1.7.4 h1:3yQjWuxICvSpYwqSayAdKRFcvBl1y/vogCxczWSmix0= +github.com/hashicorp/go-getter v1.7.4/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-metrics v0.5.4 h1:8mmPiIJkTPPEbAiV97IxdAGNdRdaWwVap1BU6elejKY= +github.com/hashicorp/go-metrics v0.5.4/go.mod h1:CG5yz4NZ/AI/aQt9Ucm/vdBnbh7fvmv4lxZ350i+QQI= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-plugin v1.4.10 h1:xUbmA4jC6Dq163/fWcp8P3JuHilrHHMLNRxzGQJ9hNk= -github.com/hashicorp/go-plugin v1.4.10/go.mod h1:6/1TEzT0eQznvI/gV2CM29DLSkAK/e58mUWKVsPaph0= +github.com/hashicorp/go-plugin v1.5.2 h1:aWv8eimFqWlsEiMrYZdPYl+FdHaBJSN4AWwGWfT1G2Y= +github.com/hashicorp/go-plugin v1.5.2/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= @@ -679,42 +712,36 @@ github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= 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/hdevalence/ed25519consensus v0.2.0 h1:37ICyZqdyj0lAZ8P4D1d1id3HqbbG1N3iBb1Tb4rdcU= +github.com/hdevalence/ed25519consensus v0.2.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= 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= -github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw= -github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= +github.com/huandu/skiplist v1.2.1 h1:dTi93MgjwErA/8idWTzIw4Y1kZsMWx35fmI2c8Rij7w= +github.com/huandu/skiplist v1.2.1/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= -github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= -github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= -github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= +github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= -github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= -github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= -github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= -github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= -github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= +github.com/jhump/protoreflect v1.17.0 h1:qOEr613fac2lOuTgWN4tPAtLL7fUSbuJL5X5XumQh94= +github.com/jhump/protoreflect v1.17.0/go.mod h1:h9+vUUL38jiBzck8ck+6G/aeMX8Z4QUY/NiJPwPNi+8= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= 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= @@ -729,6 +756,7 @@ github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= @@ -736,88 +764,65 @@ github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/X github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= 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/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= -github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= -github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= -github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= -github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= 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/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI= -github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/klauspost/cpuid v1.2.1 h1:vJi+O/nMdFt0vqm8NZBI6wzALWdA2X+egi0ogNyrC/w= -github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= +github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= +github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= +github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE= +github.com/klauspost/cpuid/v2 v2.2.10/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0= +github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= 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.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= -github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= -github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= -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= -github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= +github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.0 h1:H4L/LhP7GOMf1j17oQAElHgVlbEje2h14A8Tz9cM2BE= -github.com/linxGnu/grocksdb v1.8.0/go.mod h1:09CeBborffXhXdNpEcOeZrLKEnRtrZFEpFdPNI9Zjjg= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= -github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/magiconair/properties v1.8.9 h1:nWcCbLq1N2v/cpNsy5WvQ37Fb+YElfq20WJ/a8RkpQM= +github.com/magiconair/properties v1.8.9/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.8/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= +github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= +github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= 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-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= -github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= -github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= +github.com/minio/highwayhash v1.0.3 h1:kbnuUMoHYyVl7szWjSxJnxw11k2U709jqFPPmIUyD6Q= +github.com/minio/highwayhash v1.0.3/go.mod h1:GGYsuwP/fPD6Y9hMiXuapVvlIUEhFhMTh0rxU3ik1LQ= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= @@ -829,8 +834,6 @@ github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS4 github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/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= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -838,9 +841,10 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= 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/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -855,8 +859,9 @@ github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OS github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= -github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce h1:/pEpMk55wH0X+E5zedGEMOdLuWmV8P4+4W3+LZaM6kg= -github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a h1:dlRvE5fWabOchtH7znfiFCcOvmIYgOeAS5ifBXBlh9Q= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= @@ -864,7 +869,6 @@ github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DV github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= @@ -872,10 +876,14 @@ github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1Cpa github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.26.0 h1:03cDLK28U6hWvCAns6NeydX3zIm4SF3ci69ulidS32Q= +github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= 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-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= -github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= +github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= +github.com/opencontainers/runc v1.1.12 h1:BOIssBaW1La0/qbNZHXOOa71dZfZEQOzW7dqQf3phss= +github.com/opencontainers/runc v1.1.12/go.mod h1:S+lQwSfncpBha7XTy/5lBwWgm5+y5Ma/O44Ekby9FK8= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -885,19 +893,18 @@ github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJ github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= +github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= -github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= +github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= +github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= -github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761 h1:W04oB3d0J01W5jgYRGKsV8LCM6g9EkCvPkZcmFuy0OE= -github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 h1:Dx7Ovyv/SFnMFw3fD4oEoeorXc6saIiQ23LrGLth0Gw= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= @@ -908,9 +915,11 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= @@ -918,103 +927,95 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.15.1 h1:8tXpTmJbyH5lydzFPoxSIJ0J46jdh3tylbvM1xCv0LI= -github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= +github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.21.1 h1:DOvXXTqVzvkIewV/CDPFdejpMCGeMcbGCQ8YOmu+Ibk= +github.com/prometheus/client_golang v1.21.1/go.mod h1:U9NM32ykUErtVBxdvD3zfi+EuFkkaBvMb09mIfe0Zgg= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= -github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= -github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io= +github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= -github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= 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/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= -github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= -github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= -github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.29.1 h1:cO+d60CHkknCbvzEWxP0S9K6KqyTjrCNUy1LdQLCGPc= -github.com/rs/zerolog v1.29.1/go.mod h1:Le6ESbR7hc+DP6Lt1THiV8CQSdkkNrd3R0XbEgp3ZBU= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= +github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/locafero v0.7.0 h1:5MqpDsTGNDhY8sGp0Aowyf0qKsPrhewaLSsFaodPcyo= +github.com/sagikazarmark/locafero v0.7.0/go.mod h1:2za3Cg5rMaTMoG/2Ulr9AwtFaIppKXTRYnozin4aB5k= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -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/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= +github.com/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb2NsU= +github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= -github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= -github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= -github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= +github.com/spf13/afero v1.12.0 h1:UcOPyRBYczmFn6yvphxkn9ZEOY65cpwGKb5mL36mrqs= +github.com/spf13/afero v1.12.0/go.mod h1:ZTlWwG4/ahT8W7T0WQ5uYmjI9duaLQGy3Q2OAl4sk/4= +github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= +github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo= +github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= -github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= +github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= +github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.20.0 h1:zrxIyR3RQIOsarIrgL8+sAvALXul9jeEPa06Y0Ph6vY= +github.com/spf13/viper v1.20.0/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -1025,62 +1026,43 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= -github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +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/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= -github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= +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/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= -github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/ugorji/go/codec v1.2.9 h1:rmenucSohSTiyL09Y+l2OCk+FrMxGMzho2+tjr5ticU= -github.com/ugorji/go/codec v1.2.9/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= +github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= +github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= 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.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= -github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= -github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= -github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= -github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= -github.com/zondax/ledger-go v0.14.1 h1:Pip65OOl4iJ84WTpA4BKChvOufMhhbxED3BaihoZN4c= -github.com/zondax/ledger-go v0.14.1/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2feOQv8K320= +github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= +github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= +github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= +github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ= -go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 h1:qxen9oVGzDdIRP6ejyAJc760RwW4SnVDiTYTzwnXuxo= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5/go.mod h1:eW0HG9/oHQhvRCvb1/pIXW4cOvtDqeQK+XSi3TnwaXY= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= @@ -1093,40 +1075,61 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= +go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= +go.opentelemetry.io/contrib/detectors/gcp v1.34.0 h1:JRxssobiPg23otYU5SbWtQC//snGVIM3Tx6QRzlQBao= +go.opentelemetry.io/contrib/detectors/gcp v1.34.0/go.mod h1:cV4BMFcscUR/ckqLkbfQmF0PRsq8w/lMGzdbCSveBHo= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 h1:r6I7RJCN86bpD/FQwedZ0vSixDpwuWREjW9oRMsmqDc= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0/go.mod h1:B9yO6b04uB80CzjedvewuqDhxJxi11s7/GtiGa8bAjI= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 h1:TT4fX+nBOA/+LUkobKGW1ydGcn+G3vRw9+g5HwCphpk= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0/go.mod h1:L7UH0GbB0p47T4Rri3uHjbpCFYrVrwc1I25QhNPiGK8= +go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY= +go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0 h1:WDdP9acbMYjbKIyJUhTvtzj601sVJOqgWdUxSdR/Ysc= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0/go.mod h1:BLbf7zbNIONBLPwvFnwNHGj4zge8uTCM/UPIVW1Mq2I= +go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ= +go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE= +go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A= +go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU= +go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk= +go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w= +go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k= +go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU= +go.uber.org/mock v0.5.0/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= +go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -golang.org/x/arch v0.0.0-20210923205945-b76863e36670 h1:18EFjUmQOcUvxNYSkA6jO9VAiXCnxFY6NyDX0bHDmkU= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +golang.org/x/arch v0.15.0 h1:QtOrQd0bTUnhNVNndMpLHNWrDmYzZ2KDqSrEymqInZw= +golang.org/x/arch v0.15.0/go.mod h1:JmwW7aLIoRUKgaTzhkiEFxvcEiQGyOg9BMonBJUS7EE= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= -golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= +golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= +golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34= +golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1138,8 +1141,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1166,7 +1169,9 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= +golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= 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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1178,7 +1183,6 @@ golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -1188,7 +1192,6 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1210,15 +1213,12 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= @@ -1231,10 +1231,11 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= +golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= 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= @@ -1260,8 +1261,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8= -golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= +golang.org/x/oauth2 v0.25.0 h1:CY4y7XT9v0cRI9oupztF8AgiIu99L/ksR/Xp/6jrZ70= +golang.org/x/oauth2 v0.25.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1276,8 +1277,9 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= -golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw= +golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= 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-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1286,10 +1288,7 @@ golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 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-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1297,9 +1296,7 @@ golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1335,17 +1332,16 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1356,7 +1352,6 @@ golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/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-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1374,24 +1369,27 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= +golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= 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= -golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= +golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y= +golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g= 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= @@ -1403,26 +1401,26 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= +golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 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= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg= +golang.org/x/time v0.8.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-20180828015842-6cd1fcedba52/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-20181221001348-537d06c36207/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-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -1469,7 +1467,6 @@ golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= @@ -1477,7 +1474,9 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg= +golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= 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= @@ -1485,7 +1484,6 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= @@ -1536,8 +1534,8 @@ google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= -google.golang.org/api v0.122.0 h1:zDobeejm3E7pEG1mNHvdxvjs5XJoCMzyNH+CmwL94Es= -google.golang.org/api v0.122.0/go.mod h1:gcitW0lvnyWjSp9nKxAbdHKIZ6vF4aajGueeslZOyms= +google.golang.org/api v0.215.0 h1:jdYF4qnyczlEz2ReWIsosNLDuzXyvFHJtI5gcr0J7t0= +google.golang.org/api v0.215.0/go.mod h1:fta3CVtuJYOEdugLNWm6WodzOS8KdFckABwN4I40hzY= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1545,9 +1543,7 @@ google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1586,10 +1582,8 @@ google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= @@ -1656,13 +1650,12 @@ google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqw google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20230525234025-438c736192d0 h1:x1vNwUhVOcsYoKyEGCZBH694SBmmBjA2EfauFVEI2+M= -google.golang.org/genproto v0.0.0-20230525234025-438c736192d0/go.mod h1:9ExIQyXL5hZrHzQceCwuSYwZZ5QZBazOcprJ5rgs3lY= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a h1:HiYVD+FGJkTo+9zj1gqz0anapsa1JxjiSrN+BJKyUmE= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a/go.mod h1:ts19tUU+Z0ZShN1y3aPyq2+O3d5FUNNgT6FtOzmrNn8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 h1:ToEetK57OidYuqD4Q5w+vfEnPvPpuTwedCNVohYJfNk= +google.golang.org/genproto v0.0.0-20241118233622-e639e219e697/go.mod h1:JJrvXBWRZaFMxBufik1a4RpFw4HhgVtBBWQeQgUj2cc= +google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a h1:nwKuGPlUAt+aR+pcrkfFRrTU1BVrSmYyYMxYbUIVHr0= +google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a/go.mod h1:3kWAYMk1I75K4vykHtKt2ycnOgpA6974V7bREqbsenU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a h1:51aaUVRocpvUOSQKM6Q7VuoaktNIaMCLuhZB6DKksq4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a/go.mod h1:uRxBH1mhmO8PGhU89cMcHaXKZqO+OfakD8QQO0oYwlQ= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1704,8 +1697,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= +google.golang.org/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg= +google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1722,8 +1715,9 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= +google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1736,10 +1730,6 @@ gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qS 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/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= -gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -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/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= @@ -1754,13 +1744,12 @@ gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 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= -gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= -gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= +gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q= +gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1771,13 +1760,14 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= -pgregory.net/rapid v0.6.2 h1:ErW5sL+UKtfBfUTsWHDCoeB+eZKLKMxrSd1VJY6W4bw= -pgregory.net/rapid v0.6.2/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= +nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= +pgregory.net/rapid v1.2.0 h1:keKAYRcjm+e1F0oAuU5F5+YPAWcyxNNRK2wud503Gnk= +pgregory.net/rapid v1.2.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/simapp/internal/testnet/cometrpc_test.go b/simapp/internal/testnet/cometrpc_test.go deleted file mode 100644 index fa463630f988..000000000000 --- a/simapp/internal/testnet/cometrpc_test.go +++ /dev/null @@ -1,167 +0,0 @@ -package testnet_test - -import ( - "context" - "testing" - "time" - - "cosmossdk.io/log" - "cosmossdk.io/simapp" - cmtcfg "github.com/cometbft/cometbft/config" - "github.com/cometbft/cometbft/rpc/client/http" - dbm "github.com/cosmos/cosmos-db" - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" - "github.com/cosmos/cosmos-sdk/testutil/testnet" - sdk "github.com/cosmos/cosmos-sdk/types" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/stretchr/testify/require" -) - -const memdb = "memdb" - -// A single comet server in a network runs an RPC server successfully. -func TestCometRPC_SingleRPCServer(t *testing.T) { - const nVals = 2 - - valPKs := testnet.NewValidatorPrivKeys(nVals) - cmtVals := valPKs.CometGenesisValidators() - stakingVals := cmtVals.StakingValidators() - - const chainID = "comet-rpc-singleton" - - b := testnet.DefaultGenesisBuilderOnlyValidators( - chainID, - stakingVals, - sdk.NewCoin(sdk.DefaultBondDenom, sdk.DefaultPowerReduction), - ) - - jGenesis := b.Encode() - - // Logs shouldn't be necessary here because we are exercising CometStarter, - // and only doing a very basic check that the RPC talks to the app. - logger := log.NewNopLogger() - - nodes, err := testnet.NewNetwork(nVals, func(idx int) *testnet.CometStarter { - rootDir := t.TempDir() - - app := simapp.NewSimApp( - logger, - dbm.NewMemDB(), - nil, - true, - simtestutil.NewAppOptionsWithFlagHome(rootDir), - baseapp.SetChainID(chainID), - ) - - cfg := cmtcfg.DefaultConfig() - cfg.BaseConfig.DBBackend = memdb - - cs := testnet.NewCometStarter( - app, - cfg, - valPKs[idx].Val, - jGenesis, - rootDir, - ) - - // Only enable the RPC on the first service. - if idx == 0 { - cs = cs.RPCListen() - } - - return cs - }) - defer nodes.StopAndWait() - require.NoError(t, err) - - // Once HTTP client to be shared across the following subtests. - c, err := http.New(nodes[0].Config().RPC.ListenAddress, "/websocket") - require.NoError(t, err) - - t.Run("status query", func(t *testing.T) { - ctx := context.Background() - st, err := c.Status(ctx) - require.NoError(t, err) - - // Simple assertion to ensure we have a functioning RPC. - require.Equal(t, chainID, st.NodeInfo.Network) - }) - - // Block until reported height is at least 1, - // otherwise we can't make transactions. - require.NoError(t, testnet.WaitForNodeHeight(nodes[0], 1, 10*time.Second)) - - t.Run("simple abci query", func(t *testing.T) { - res, err := c.ABCIQuery( - context.Background(), - "/cosmos.bank.v1beta1.Query/TotalSupply", - nil, - ) - require.NoError(t, err) - - registry := codectypes.NewInterfaceRegistry() - cdc := codec.NewProtoCodec(registry) - - var tsResp banktypes.QueryTotalSupplyResponse - require.NoError(t, cdc.Unmarshal(res.Response.Value, &tsResp)) - - // Just check that something is reported in the supply. - require.NotEmpty(t, tsResp.Supply) - }) -} - -// Starting two comet instances with an RPC server, -// fails with a predictable error. -func TestCometRPC_MultipleRPCError(t *testing.T) { - const nVals = 2 - - valPKs := testnet.NewValidatorPrivKeys(nVals) - cmtVals := valPKs.CometGenesisValidators() - stakingVals := cmtVals.StakingValidators() - - const chainID = "comet-rpc-multiple" - - b := testnet.DefaultGenesisBuilderOnlyValidators( - chainID, - stakingVals, - sdk.NewCoin(sdk.DefaultBondDenom, sdk.DefaultPowerReduction), - ) - - jGenesis := b.Encode() - - // Logs shouldn't be necessary here because we are exercising CometStarter. - logger := log.NewNopLogger() - - nodes, err := testnet.NewNetwork(nVals, func(idx int) *testnet.CometStarter { - rootDir := t.TempDir() - - app := simapp.NewSimApp( - logger, - dbm.NewMemDB(), - nil, - true, - simtestutil.NewAppOptionsWithFlagHome(rootDir), - baseapp.SetChainID(chainID), - ) - - cfg := cmtcfg.DefaultConfig() - cfg.BaseConfig.DBBackend = memdb - - return testnet.NewCometStarter( - app, - cfg, - valPKs[idx].Val, - jGenesis, - rootDir, - ).RPCListen() // Every node has RPCListen enabled, which will cause a failure. - }) - defer nodes.StopAndWait() - - // Returned error is convertible to CometRPCInUseError. - // We can't test the exact value because it includes a stack trace. - require.Error(t, err) - require.ErrorAs(t, err, new(testnet.CometRPCInUseError)) -} diff --git a/simapp/internal/testnet/cometstarter_test.go b/simapp/internal/testnet/cometstarter_test.go deleted file mode 100644 index 9e9d1d53c4ac..000000000000 --- a/simapp/internal/testnet/cometstarter_test.go +++ /dev/null @@ -1,134 +0,0 @@ -package testnet_test - -import ( - "fmt" - "math/rand" - "net" - "testing" - "time" - - "cosmossdk.io/log" - "cosmossdk.io/simapp" - cmtcfg "github.com/cometbft/cometbft/config" - dbm "github.com/cosmos/cosmos-db" - "github.com/cosmos/cosmos-sdk/baseapp" - simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" - "github.com/cosmos/cosmos-sdk/testutil/testnet" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" -) - -// Use a limited set of available ports to ensure that -// retries eventually land on a free port. -func TestCometStarter_PortContention(t *testing.T) { - if testing.Short() { - t.Skip("skipping long test in short mode") - } - - const nVals = 4 - - // Find n+1 addresses that should be free. - // Ephemeral port range should start at about 49k+ - // according to `sysctl net.inet.ip.portrange` on macOS, - // and at about 32k+ on Linux - // according to `sysctl net.ipv4.ip_local_port_range`. - // - // Because we attempt to find free addresses outside that range, - // it is unlikely that another process will claim a port - // we discover to be free, during the time this test runs. - const portSeekStart = 19000 - reuseAddrs := make([]string, 0, nVals+1) - for i := portSeekStart; i < portSeekStart+1000; i++ { - addr := fmt.Sprintf("127.0.0.1:%d", i) - ln, err := net.Listen("tcp", addr) - if err != nil { - // No need to log the failure. - continue - } - - // If the port was free, append it to our reusable addresses. - reuseAddrs = append(reuseAddrs, "tcp://"+addr) - _ = ln.Close() - - if len(reuseAddrs) == nVals+1 { - break - } - } - - if len(reuseAddrs) != nVals+1 { - t.Fatalf("needed %d free ports but only found %d", nVals+1, len(reuseAddrs)) - } - - // Now that we have one more port than the number of validators, - // there is a good chance that picking a random port will conflict with a previously chosen one. - // But since CometStarter retries several times, - // it should eventually land on a free port. - - valPKs := testnet.NewValidatorPrivKeys(nVals) - cmtVals := valPKs.CometGenesisValidators() - stakingVals := cmtVals.StakingValidators() - - const chainID = "simapp-cometstarter" - - b := testnet.DefaultGenesisBuilderOnlyValidators( - chainID, - stakingVals, - sdk.NewCoin(sdk.DefaultBondDenom, sdk.DefaultPowerReduction), - ) - - jGenesis := b.Encode() - - // Use an info-level logger, because the debug logs in comet are noisy - // and there is a data race in comet debug logs, - // due to be fixed in v0.37.1 which is not yet released: - // https://github.com/cometbft/cometbft/pull/532 - logger := log.NewTestLoggerInfo(t) - - const nRuns = 4 - for i := 0; i < nRuns; i++ { - t.Run(fmt.Sprintf("attempt %d", i), func(t *testing.T) { - nodes, err := testnet.NewNetwork(nVals, func(idx int) *testnet.CometStarter { - rootDir := t.TempDir() - - app := simapp.NewSimApp( - logger.With("instance", idx), - dbm.NewMemDB(), - nil, - true, - simtestutil.NewAppOptionsWithFlagHome(rootDir), - baseapp.SetChainID(chainID), - ) - - cfg := cmtcfg.DefaultConfig() - - // memdb is sufficient for this test. - cfg.BaseConfig.DBBackend = "memdb" - - return testnet.NewCometStarter( - app, - cfg, - valPKs[idx].Val, - jGenesis, - rootDir, - ). - Logger(logger.With("rootmodule", fmt.Sprintf("comet_node-%d", idx))). - TCPAddrChooser(func() string { - // This chooser function is the key of this test, - // where there is only one more available address than there are nodes. - // Therefore it is likely that an address will already be in use, - // thereby exercising the address-in-use retry. - return reuseAddrs[rand.Intn(len(reuseAddrs))] - }) - }) - - // Ensure nodes are stopped completely, - // so that we don't get t.Cleanup errors around directories not being empty. - defer nodes.StopAndWait() - require.NoError(t, err) - - // Ensure that the height advances. - // Looking for height 2 seems more meaningful than 1. - require.NoError(t, testnet.WaitForNodeHeight(nodes[0], 2, 10*time.Second)) - }) - } -} diff --git a/simapp/internal/testnet/doc.go b/simapp/internal/testnet/doc.go deleted file mode 100644 index 19064ddd0f45..000000000000 --- a/simapp/internal/testnet/doc.go +++ /dev/null @@ -1,10 +0,0 @@ -// Package testnet contains tests for -// [github.com/cosmos/cosmos-sdk/testutil/testnet]. -// -// Eventually all of these tests will move into that package, -// but that is currently blocked on having a minimal app defined -// in the root cosmos-sdk Go module. -// Once that app is available, the contents of this package -// will be moved to testutil/testnet, -// and references to SimApp will be replaced by the minimal app. -package testnet diff --git a/simapp/internal/testnet/example_basic_test.go b/simapp/internal/testnet/example_basic_test.go deleted file mode 100644 index 99f7ae362cca..000000000000 --- a/simapp/internal/testnet/example_basic_test.go +++ /dev/null @@ -1,112 +0,0 @@ -package testnet_test - -import ( - "fmt" - "os" - "path/filepath" - - "cosmossdk.io/log" - "cosmossdk.io/simapp" - cmtcfg "github.com/cometbft/cometbft/config" - dbm "github.com/cosmos/cosmos-db" - "github.com/cosmos/cosmos-sdk/baseapp" - simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" - "github.com/cosmos/cosmos-sdk/testutil/testnet" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -func Example_basicUsage() { - const nVals = 2 - - // Set up new private keys for the set of validators. - valPKs := testnet.NewValidatorPrivKeys(nVals) - - // Comet-style validators. - cmtVals := valPKs.CometGenesisValidators() - - // Cosmos SDK staking validators for genesis. - stakingVals := cmtVals.StakingValidators() - - const chainID = "example-basic" - - // Create a genesis builder that only requires validators, - // without any separate delegator accounts. - // - // If you need further customization, start with testnet.NewGenesisBuilder(). - b := testnet.DefaultGenesisBuilderOnlyValidators( - chainID, - stakingVals, - // The amount to use in each validator's account during gentx. - sdk.NewCoin(sdk.DefaultBondDenom, sdk.DefaultPowerReduction), - ) - - // JSON-formatted genesis. - jGenesis := b.Encode() - - // In this example, we have an outer root directory for the validators. - // Use t.TempDir() in tests. - rootDir, err := os.MkdirTemp("", "testnet-example-") - if err != nil { - panic(err) - } - defer os.RemoveAll(rootDir) - - // In tests, you probably want to use log.NewTestLoggerInfo(t). - logger := log.NewNopLogger() - - // The NewNetwork function creates a network of validators. - // We have to provide a callback to return CometStarter instances. - // NewNetwork will start all the comet instances concurrently - // and join the nodes together. - nodes, err := testnet.NewNetwork(nVals, func(idx int) *testnet.CometStarter { - // Make a new directory for the validator being created. - // In tests, this would be a simpler call to t.TempDir(). - dir := filepath.Join(rootDir, fmt.Sprintf("val-%d", idx)) - if err := os.Mkdir(dir, 0o755); err != nil { - panic(err) - } - - // TODO: use a different minimal app for this. - app := simapp.NewSimApp( - logger.With("instance", idx), - dbm.NewMemDB(), - nil, - true, - simtestutil.NewAppOptionsWithFlagHome(rootDir), - baseapp.SetChainID(chainID), - ) - - // Each CometStarter instance must be associated with - // a distinct comet Config object, - // as the CometStarter will automatically modify some fields, - // including P2P.ListenAddress. - cfg := cmtcfg.DefaultConfig() - - // No need to persist comet's DB to disk in this example. - cfg.BaseConfig.DBBackend = "memdb" - - return testnet.NewCometStarter( - app, - cfg, - valPKs[idx].Val, // Validator private key for this comet instance. - jGenesis, // Raw bytes of genesis file. - dir, // Where to put files on disk. - ).Logger(logger.With("root_module", fmt.Sprintf("comet_%d", idx))) - }) - // StopAndWait must be deferred before the error check, - // as the nodes value may contain some successfully started instances. - defer nodes.StopAndWait() - if err != nil { - panic(err) - } - - // Now you can begin interacting with the nodes. - // For the sake of this example, we'll just check - // a couple simple properties of one node. - fmt.Println(nodes[0].IsListening()) - fmt.Println(nodes[0].GenesisDoc().ChainID) - - // Output: - // true - // example-basic -} diff --git a/simapp/sim_bench_test.go b/simapp/sim_bench_test.go index b91372d56562..a0bf7f2fee0d 100644 --- a/simapp/sim_bench_test.go +++ b/simapp/sim_bench_test.go @@ -1,16 +1,14 @@ package simapp import ( - "fmt" "os" "testing" - "github.com/spf13/viper" - - cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" flag "github.com/spf13/pflag" + "github.com/spf13/viper" "github.com/stretchr/testify/require" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/server" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" @@ -61,7 +59,7 @@ func BenchmarkFullAppSimulation(b *testing.B) { appOptions.SetDefault(flags.FlagHome, DefaultNodeHome) appOptions.SetDefault(server.FlagInvCheckPeriod, simcli.FlagPeriodValue) - app := NewSimApp(logger, db, nil, true, appOptions, interBlockCacheOpt()) + app := NewSimApp(logger, db, nil, true, appOptions, interBlockCacheOpt(), baseapp.SetChainID(SimAppChainID)) // run randomized simulation _, simParams, simErr := simulation.SimulateFromSeed( @@ -116,7 +114,7 @@ func BenchmarkInvariants(b *testing.B) { appOptions[flags.FlagHome] = DefaultNodeHome appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue - app := NewSimApp(logger, db, nil, true, appOptions, interBlockCacheOpt()) + app := NewSimApp(logger, db, nil, true, appOptions, interBlockCacheOpt(), baseapp.SetChainID(SimAppChainID)) // run randomized simulation _, simParams, simErr := simulation.SimulateFromSeed( @@ -143,22 +141,4 @@ func BenchmarkInvariants(b *testing.B) { if config.Commit { simtestutil.PrintStats(db) } - - ctx := app.NewContextLegacy(true, cmtproto.Header{Height: app.LastBlockHeight() + 1}) - - // 3. Benchmark each invariant separately - // - // NOTE: We use the crisis keeper as it has all the invariants registered with - // their respective metadata which makes it useful for testing/benchmarking. - for _, cr := range app.CrisisKeeper.Routes() { - cr := cr - b.Run(fmt.Sprintf("%s/%s", cr.ModuleName, cr.Route), func(b *testing.B) { - if res, stop := cr.Invar(ctx); stop { - b.Fatalf( - "broken invariant at block %d of %d\n%s", - ctx.BlockHeight()-1, config.NumBlocks, res, - ) - } - }) - } } diff --git a/simapp/sim_test.go b/simapp/sim_test.go index 53599cafc6cc..2f4504cedf3e 100644 --- a/simapp/sim_test.go +++ b/simapp/sim_test.go @@ -76,6 +76,9 @@ func TestFullAppSimulation(t *testing.T) { appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue app := NewSimApp(logger, db, nil, true, appOptions, fauxMerkleModeOpt, baseapp.SetChainID(SimAppChainID)) + if !simcli.FlagSigverifyTxValue { + app.SetNotSigverifyTx() + } require.Equal(t, "SimApp", app.Name()) // run randomized simulation @@ -121,6 +124,9 @@ func TestAppImportExport(t *testing.T) { appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue app := NewSimApp(logger, db, nil, true, appOptions, fauxMerkleModeOpt, baseapp.SetChainID(SimAppChainID)) + if !simcli.FlagSigverifyTxValue { + app.SetNotSigverifyTx() + } require.Equal(t, "SimApp", app.Name()) // Run randomized simulation @@ -167,22 +173,21 @@ func TestAppImportExport(t *testing.T) { err = json.Unmarshal(exported.AppState, &genesisState) require.NoError(t, err) - defer func() { - if r := recover(); r != nil { - err := fmt.Sprintf("%v", r) - if !strings.Contains(err, "validator set is empty after InitGenesis") { - panic(r) - } + ctxA := app.NewContextLegacy(true, cmtproto.Header{Height: app.LastBlockHeight()}) + ctxB := newApp.NewContextLegacy(true, cmtproto.Header{Height: app.LastBlockHeight()}) + _, err = newApp.ModuleManager.InitGenesis(ctxB, app.AppCodec(), genesisState) + + if err != nil { + if strings.Contains(err.Error(), "validator set is empty after InitGenesis") { logger.Info("Skipping simulation as all validators have been unbonded") logger.Info("err", err, "stacktrace", string(debug.Stack())) + return } - }() - - ctxA := app.NewContextLegacy(true, cmtproto.Header{Height: app.LastBlockHeight()}) - ctxB := newApp.NewContextLegacy(true, cmtproto.Header{Height: app.LastBlockHeight()}) - newApp.ModuleManager.InitGenesis(ctxB, app.AppCodec(), genesisState) - newApp.StoreConsensusParams(ctxB, exported.ConsensusParams) + } + require.NoError(t, err) + err = newApp.StoreConsensusParams(ctxB, exported.ConsensusParams) + require.NoError(t, err) fmt.Printf("comparing stores...\n") // skip certain prefixes @@ -241,6 +246,9 @@ func TestAppSimulationAfterImport(t *testing.T) { appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue app := NewSimApp(logger, db, nil, true, appOptions, fauxMerkleModeOpt, baseapp.SetChainID(SimAppChainID)) + if !simcli.FlagSigverifyTxValue { + app.SetNotSigverifyTx() + } require.Equal(t, "SimApp", app.Name()) // Run randomized simulation @@ -363,6 +371,9 @@ func TestAppStateDeterminism(t *testing.T) { db := dbm.NewMemDB() app := NewSimApp(logger, db, nil, true, appOptions, interBlockCacheOpt(), baseapp.SetChainID(SimAppChainID)) + if !simcli.FlagSigverifyTxValue { + app.SetNotSigverifyTx() + } fmt.Printf( "running non-determinism simulation; seed %d: %d/%d, attempt: %d/%d\n", diff --git a/simapp/simd/cmd/root_v2.go b/simapp/simd/cmd/commands.go similarity index 55% rename from simapp/simd/cmd/root_v2.go rename to simapp/simd/cmd/commands.go index 3dd21f92b679..a38d398a1a66 100644 --- a/simapp/simd/cmd/root_v2.go +++ b/simapp/simd/cmd/commands.go @@ -1,134 +1,34 @@ -//go:build !app_v1 - package cmd import ( "errors" "io" - "os" cmtcfg "github.com/cometbft/cometbft/config" dbm "github.com/cosmos/cosmos-db" "github.com/spf13/cobra" "github.com/spf13/viper" - "cosmossdk.io/client/v2/autocli" - "cosmossdk.io/depinject" "cosmossdk.io/log" "cosmossdk.io/simapp" confixcmd "cosmossdk.io/tools/confix/cmd" - rosettaCmd "cosmossdk.io/tools/rosetta/cmd" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/config" "github.com/cosmos/cosmos-sdk/client/debug" - "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/keys" "github.com/cosmos/cosmos-sdk/client/pruning" "github.com/cosmos/cosmos-sdk/client/rpc" "github.com/cosmos/cosmos-sdk/client/snapshot" - "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/server" serverconfig "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/cosmos/cosmos-sdk/types/tx/signing" authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" - "github.com/cosmos/cosmos-sdk/x/auth/tx" - txmodule "github.com/cosmos/cosmos-sdk/x/auth/tx/config" - "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/cosmos/cosmos-sdk/x/crisis" genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" ) -// NewRootCmd creates a new root command for simd. It is called once in the main function. -func NewRootCmd() *cobra.Command { - var ( - interfaceRegistry codectypes.InterfaceRegistry - appCodec codec.Codec - txConfig client.TxConfig - legacyAmino *codec.LegacyAmino - autoCliOpts autocli.AppOptions - moduleBasicManager module.BasicManager - ) - - if err := depinject.Inject(depinject.Configs(simapp.AppConfig, depinject.Supply(log.NewNopLogger())), - &interfaceRegistry, - &appCodec, - &txConfig, - &legacyAmino, - &autoCliOpts, - &moduleBasicManager, - ); err != nil { - panic(err) - } - - initClientCtx := client.Context{}. - WithCodec(appCodec). - WithInterfaceRegistry(interfaceRegistry). - WithLegacyAmino(legacyAmino). - WithInput(os.Stdin). - WithAccountRetriever(types.AccountRetriever{}). - WithHomeDir(simapp.DefaultNodeHome). - WithViper("") // In simapp, we don't use any prefix for env variables. - - rootCmd := &cobra.Command{ - Use: "simd", - Short: "simulation app", - PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { - // set the default command outputs - cmd.SetOut(cmd.OutOrStdout()) - cmd.SetErr(cmd.ErrOrStderr()) - - initClientCtx = initClientCtx.WithCmdContext(cmd.Context()) - initClientCtx, err := client.ReadPersistentCommandFlags(initClientCtx, cmd.Flags()) - if err != nil { - return err - } - - initClientCtx, err = config.ReadFromClientConfig(initClientCtx) - if err != nil { - return err - } - - // This needs to go after ReadFromClientConfig, as that function - // sets the RPC client needed for SIGN_MODE_TEXTUAL. - enabledSignModes := append(tx.DefaultSignModes, signing.SignMode_SIGN_MODE_TEXTUAL) - txConfigOpts := tx.ConfigOptions{ - EnabledSignModes: enabledSignModes, - TextualCoinMetadataQueryFn: txmodule.NewGRPCCoinMetadataQueryFn(initClientCtx), - } - txConfigWithTextual, err := tx.NewTxConfigWithOptions( - codec.NewProtoCodec(interfaceRegistry), - txConfigOpts, - ) - if err != nil { - return err - } - initClientCtx = initClientCtx.WithTxConfig(txConfigWithTextual) - if err := client.SetCmdClientContextHandler(initClientCtx, cmd); err != nil { - return err - } - - customAppTemplate, customAppConfig := initAppConfig() - customCMTConfig := initCometBFTConfig() - - return server.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig, customCMTConfig) - }, - } - - initRootCmd(rootCmd, txConfig, interfaceRegistry, appCodec, moduleBasicManager) - - if err := autoCliOpts.EnhanceRootCommand(rootCmd); err != nil { - panic(err) - } - - return rootCmd -} - // initCometBFTConfig helps to override default CometBFT Config values. // return cmtcfg.DefaultConfig if no custom configuration is required for the application. func initCometBFTConfig() *cmtcfg.Config { @@ -146,19 +46,18 @@ func initCometBFTConfig() *cmtcfg.Config { func initAppConfig() (string, interface{}) { // The following code snippet is just for reference. - // WASMConfig defines configuration for the wasm module. - type WASMConfig struct { - // This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries - QueryGasLimit uint64 `mapstructure:"query_gas_limit"` - - // Address defines the gRPC-web server to listen on - LruSize uint64 `mapstructure:"lru_size"` + // CustomConfig defines an arbitrary custom config to extend app.toml. + // If you don't need it, you can remove it. + // If you wish to add fields that correspond to flags that aren't in the SDK server config, + // this custom config can as well help. + type CustomConfig struct { + CustomField string `mapstructure:"custom-field"` } type CustomAppConfig struct { - serverconfig.Config + serverconfig.Config `mapstructure:",squash"` - WASM WASMConfig `mapstructure:"wasm"` + Custom CustomConfig `mapstructure:"custom"` } // Optionally allow the chain developer to overwrite the SDK's default @@ -179,21 +78,22 @@ func initAppConfig() (string, interface{}) { srvCfg.MinGasPrices = "0stake" // srvCfg.BaseConfig.IAVLDisableFastNode = true // disable fastnode by default + // Now we set the custom config default values. customAppConfig := CustomAppConfig{ Config: *srvCfg, - WASM: WASMConfig{ - LruSize: 1, - QueryGasLimit: 300000, + Custom: CustomConfig{ + CustomField: "anything", }, } + // The default SDK app template is defined in serverconfig.DefaultConfigTemplate. + // We append the custom config template to the default one. + // And we set the default config to the custom app template. customAppTemplate := serverconfig.DefaultConfigTemplate + ` -[wasm] -# This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries -query_gas_limit = 300000 -# This is the number of wasm vm instances we keep cached in memory for speed-up -# Warning: this is currently unstable and may lead to crashes, best to keep for 0 unless testing locally -lru_size = 0` +[custom] +# That field will be parsed by server.InterceptConfigsPreRunHandler and held by viper. +# Do not forget to add quotes around the value if it is a string. +custom-field = "{{ .Custom.CustomField }}"` return customAppTemplate, customAppConfig } @@ -201,8 +101,6 @@ lru_size = 0` func initRootCmd( rootCmd *cobra.Command, txConfig client.TxConfig, - interfaceRegistry codectypes.InterfaceRegistry, - appCodec codec.Codec, basicManager module.BasicManager, ) { cfg := sdk.GetConfig() @@ -213,27 +111,23 @@ func initRootCmd( NewTestnetCmd(basicManager, banktypes.GenesisBalancesIterator{}), debug.Cmd(), confixcmd.ConfigCommand(), - pruning.Cmd(newApp), + pruning.Cmd(newApp, simapp.DefaultNodeHome), snapshot.Cmd(newApp), ) - server.AddCommands(rootCmd, simapp.DefaultNodeHome, newApp, appExport, addModuleInitFlags) + server.AddCommandsWithStartCmdOptions(rootCmd, simapp.DefaultNodeHome, newApp, appExport, server.StartCmdOptions{ + AddFlags: func(startCmd *cobra.Command) { + }, + }) // add keybase, auxiliary RPC, query, genesis, and tx child commands rootCmd.AddCommand( - rpc.StatusCommand(), + server.StatusCommand(), genesisCommand(txConfig, basicManager), queryCommand(), txCommand(), - keys.Commands(simapp.DefaultNodeHome), + keys.Commands(), ) - - // add rosetta - rootCmd.AddCommand(rosettaCmd.RosettaCommand(interfaceRegistry, appCodec)) -} - -func addModuleInitFlags(startCmd *cobra.Command) { - crisis.AddModuleInitFlags(startCmd) } // genesisCommand builds genesis-related `simd genesis` command. Users may provide application specific commands as a parameter @@ -257,11 +151,12 @@ func queryCommand() *cobra.Command { } cmd.AddCommand( - rpc.ValidatorCommand(), + rpc.WaitTxCmd(), server.QueryBlockCmd(), authcmd.QueryTxsByEventsCmd(), server.QueryBlocksCmd(), authcmd.QueryTxCmd(), + server.QueryBlockResultsCmd(), ) return cmd @@ -285,7 +180,7 @@ func txCommand() *cobra.Command { authcmd.GetBroadcastCommand(), authcmd.GetEncodeCommand(), authcmd.GetDecodeCommand(), - authcmd.GetAuxToFeeCommand(), + authcmd.GetSimulateCmd(), ) return cmd @@ -299,7 +194,6 @@ func newApp( appOpts servertypes.AppOptions, ) servertypes.Application { baseappOptions := server.DefaultBaseappOptions(appOpts) - return simapp.NewSimApp( logger, db, traceStore, true, appOpts, @@ -318,13 +212,6 @@ func appExport( appOpts servertypes.AppOptions, modulesToExport []string, ) (servertypes.ExportedApp, error) { - // this check is necessary as we use the flag in x/upgrade. - // we can exit more gracefully by checking the flag here. - homePath, ok := appOpts.Get(flags.FlagHome).(string) - if !ok || homePath == "" { - return servertypes.ExportedApp{}, errors.New("application home not set") - } - viperAppOpts, ok := appOpts.(*viper.Viper) if !ok { return servertypes.ExportedApp{}, errors.New("appOpts is not viper.Viper") diff --git a/simapp/simd/cmd/root.go b/simapp/simd/cmd/root.go index 2de3d5d5eccb..e14298dc1236 100644 --- a/simapp/simd/cmd/root.go +++ b/simapp/simd/cmd/root.go @@ -3,51 +3,30 @@ package cmd import ( - "errors" - "io" "os" "cosmossdk.io/log" "cosmossdk.io/simapp" "cosmossdk.io/simapp/params" - confixcmd "cosmossdk.io/tools/confix/cmd" - rosettaCmd "cosmossdk.io/tools/rosetta/cmd" - cmtcfg "github.com/cometbft/cometbft/config" dbm "github.com/cosmos/cosmos-db" "github.com/spf13/cobra" - "github.com/spf13/viper" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/config" - "github.com/cosmos/cosmos-sdk/client/debug" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/keys" - "github.com/cosmos/cosmos-sdk/client/pruning" - "github.com/cosmos/cosmos-sdk/client/rpc" - "github.com/cosmos/cosmos-sdk/client/snapshot" - "github.com/cosmos/cosmos-sdk/codec" + nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node" "github.com/cosmos/cosmos-sdk/server" - serverconfig "github.com/cosmos/cosmos-sdk/server/config" - servertypes "github.com/cosmos/cosmos-sdk/server/types" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/types/tx/signing" - authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" "github.com/cosmos/cosmos-sdk/x/auth/tx" - txmodule "github.com/cosmos/cosmos-sdk/x/auth/tx/config" + authtxconfig "github.com/cosmos/cosmos-sdk/x/auth/tx/config" "github.com/cosmos/cosmos-sdk/x/auth/types" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/cosmos/cosmos-sdk/x/crisis" - genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" ) // NewRootCmd creates a new root command for simd. It is called once in the // main function. func NewRootCmd() *cobra.Command { // 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 := simapp.NewSimApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, simtestutil.NewAppOptionsWithFlagHome(tempDir())) + tempApp := simapp.NewSimApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, simtestutil.NewAppOptionsWithFlagHome(simapp.DefaultNodeHome)) encodingConfig := params.EncodingConfig{ InterfaceRegistry: tempApp.InterfaceRegistry(), Codec: tempApp.AppCodec(), @@ -58,6 +37,7 @@ func NewRootCmd() *cobra.Command { initClientCtx := client.Context{}. WithCodec(encodingConfig.Codec). WithInterfaceRegistry(encodingConfig.InterfaceRegistry). + WithTxConfig(encodingConfig.TxConfig). WithLegacyAmino(encodingConfig.Amino). WithInput(os.Stdin). WithAccountRetriever(types.AccountRetriever{}). @@ -65,8 +45,9 @@ func NewRootCmd() *cobra.Command { WithViper("") // In simapp, we don't use any prefix for env variables. rootCmd := &cobra.Command{ - Use: "simd", - Short: "simulation app", + Use: "simd", + Short: "simulation app", + SilenceErrors: true, PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { // set the default command outputs cmd.SetOut(cmd.OutOrStdout()) @@ -84,20 +65,24 @@ func NewRootCmd() *cobra.Command { } // This needs to go after ReadFromClientConfig, as that function - // sets the RPC client needed for SIGN_MODE_TEXTUAL. - enabledSignModes := append(tx.DefaultSignModes, signing.SignMode_SIGN_MODE_TEXTUAL) - txConfigOpts := tx.ConfigOptions{ - EnabledSignModes: enabledSignModes, - TextualCoinMetadataQueryFn: txmodule.NewGRPCCoinMetadataQueryFn(initClientCtx), + // sets the RPC client needed for SIGN_MODE_TEXTUAL. This sign mode + // is only available if the client is online. + if !initClientCtx.Offline { + enabledSignModes := append(tx.DefaultSignModes, signing.SignMode_SIGN_MODE_TEXTUAL) + txConfigOpts := tx.ConfigOptions{ + EnabledSignModes: enabledSignModes, + TextualCoinMetadataQueryFn: authtxconfig.NewGRPCCoinMetadataQueryFn(initClientCtx), + } + txConfig, err := tx.NewTxConfigWithOptions( + initClientCtx.Codec, + txConfigOpts, + ) + if err != nil { + return err + } + + initClientCtx = initClientCtx.WithTxConfig(txConfig) } - txConfigWithTextual, err := tx.NewTxConfigWithOptions( - codec.NewProtoCodec(encodingConfig.InterfaceRegistry), - txConfigOpts, - ) - if err != nil { - return err - } - initClientCtx = initClientCtx.WithTxConfig(txConfigWithTextual) if err := client.SetCmdClientContextHandler(initClientCtx, cmd); err != nil { return err @@ -110,234 +95,18 @@ func NewRootCmd() *cobra.Command { }, } - initRootCmd(rootCmd, encodingConfig, tempApp.BasicModuleManager) - - if err := tempApp.AutoCliOpts().EnhanceRootCommand(rootCmd); err != nil { - panic(err) - } - - return rootCmd -} - -// initCometBFTConfig helps to override default CometBFT Config values. -// return cmtcfg.DefaultConfig if no custom configuration is required for the application. -func initCometBFTConfig() *cmtcfg.Config { - cfg := cmtcfg.DefaultConfig() - - // these values put a higher strain on node memory - // cfg.P2P.MaxNumInboundPeers = 100 - // cfg.P2P.MaxNumOutboundPeers = 40 - - return cfg -} - -// initAppConfig helps to override default appConfig template and configs. -// return "", nil if no custom configuration is required for the application. -func initAppConfig() (string, interface{}) { - // The following code snippet is just for reference. - - // WASMConfig defines configuration for the wasm module. - type WASMConfig struct { - // This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries - QueryGasLimit uint64 `mapstructure:"query_gas_limit"` - - // Address defines the gRPC-web server to listen on - LruSize uint64 `mapstructure:"lru_size"` - } - - type CustomAppConfig struct { - serverconfig.Config - - WASM WASMConfig `mapstructure:"wasm"` - } - - // Optionally allow the chain developer to overwrite the SDK's default - // server config. - srvCfg := serverconfig.DefaultConfig() - // The SDK's default minimum gas price is set to "" (empty value) inside - // app.toml. If left empty by validators, the node will halt on startup. - // However, the chain developer can set a default app.toml value for their - // validators here. - // - // In summary: - // - if you leave srvCfg.MinGasPrices = "", all validators MUST tweak their - // own app.toml config, - // - if you set srvCfg.MinGasPrices non-empty, validators CAN tweak their - // own app.toml to override, or use this default value. - // - // In simapp, we set the min gas prices to 0. - srvCfg.MinGasPrices = "0stake" - // srvCfg.BaseConfig.IAVLDisableFastNode = true // disable fastnode by default - - customAppConfig := CustomAppConfig{ - Config: *srvCfg, - WASM: WASMConfig{ - LruSize: 1, - QueryGasLimit: 300000, - }, - } - - customAppTemplate := serverconfig.DefaultConfigTemplate + ` -[wasm] -# This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries -query_gas_limit = 300000 -# This is the number of wasm vm instances we keep cached in memory for speed-up -# Warning: this is currently unstable and may lead to crashes, best to keep for 0 unless testing locally -lru_size = 0` - - return customAppTemplate, customAppConfig -} - -func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig, basicManager module.BasicManager) { - cfg := sdk.GetConfig() - cfg.Seal() + initRootCmd(rootCmd, encodingConfig.TxConfig, tempApp.BasicModuleManager) - rootCmd.AddCommand( - genutilcli.InitCmd(basicManager, simapp.DefaultNodeHome), - NewTestnetCmd(basicManager, banktypes.GenesisBalancesIterator{}), - debug.Cmd(), - confixcmd.ConfigCommand(), - pruning.Cmd(newApp), - snapshot.Cmd(newApp), - ) + // add keyring to autocli opts + autoCliOpts := tempApp.AutoCliOpts() + autoCliOpts.ClientCtx = initClientCtx - server.AddCommands(rootCmd, simapp.DefaultNodeHome, newApp, appExport, addModuleInitFlags) + nodeCmds := nodeservice.NewNodeCommands() + autoCliOpts.ModuleOptions[nodeCmds.Name()] = nodeCmds.AutoCLIOptions() - // add keybase, auxiliary RPC, query, genesis, and tx child commands - rootCmd.AddCommand( - rpc.StatusCommand(), - genesisCommand(encodingConfig, basicManager), - txCommand(), - queryCommand(), - keys.Commands(simapp.DefaultNodeHome), - ) - - rootCmd.AddCommand(rosettaCmd.RosettaCommand(encodingConfig.InterfaceRegistry, encodingConfig.Codec)) -} - -func addModuleInitFlags(startCmd *cobra.Command) { - crisis.AddModuleInitFlags(startCmd) -} - -// genesisCommand builds genesis-related `simd genesis` command. Users may provide application specific commands as a parameter -func genesisCommand(encodingConfig params.EncodingConfig, basicManager module.BasicManager, cmds ...*cobra.Command) *cobra.Command { - cmd := genutilcli.Commands(encodingConfig.TxConfig, basicManager, simapp.DefaultNodeHome) - - for _, subCmd := range cmds { - cmd.AddCommand(subCmd) - } - return cmd -} - -func queryCommand() *cobra.Command { - cmd := &cobra.Command{ - Use: "query", - Aliases: []string{"q"}, - Short: "Querying subcommands", - DisableFlagParsing: false, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - cmd.AddCommand( - rpc.ValidatorCommand(), - server.QueryBlockCmd(), - authcmd.QueryTxsByEventsCmd(), - server.QueryBlocksCmd(), - authcmd.QueryTxCmd(), - ) - - return cmd -} - -func txCommand() *cobra.Command { - cmd := &cobra.Command{ - Use: "tx", - Short: "Transactions subcommands", - DisableFlagParsing: false, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - cmd.AddCommand( - authcmd.GetSignCommand(), - authcmd.GetSignBatchCommand(), - authcmd.GetMultiSignCommand(), - authcmd.GetMultiSignBatchCmd(), - authcmd.GetValidateSignaturesCommand(), - authcmd.GetBroadcastCommand(), - authcmd.GetEncodeCommand(), - authcmd.GetDecodeCommand(), - authcmd.GetAuxToFeeCommand(), - ) - - return cmd -} - -// newApp creates the application -func newApp( - logger log.Logger, - db dbm.DB, - traceStore io.Writer, - appOpts servertypes.AppOptions, -) servertypes.Application { - baseappOptions := server.DefaultBaseappOptions(appOpts) - - return simapp.NewSimApp( - logger, db, traceStore, true, - appOpts, - baseappOptions..., - ) -} - -// appExport creates a new simapp (optionally at a given height) and exports state. -func appExport( - logger log.Logger, - db dbm.DB, - traceStore io.Writer, - height int64, - forZeroHeight bool, - jailAllowedAddrs []string, - appOpts servertypes.AppOptions, - modulesToExport []string, -) (servertypes.ExportedApp, error) { - var simApp *simapp.SimApp - - // this check is necessary as we use the flag in x/upgrade. - // we can exit more gracefully by checking the flag here. - homePath, ok := appOpts.Get(flags.FlagHome).(string) - if !ok || homePath == "" { - return servertypes.ExportedApp{}, errors.New("application home not set") - } - - viperAppOpts, ok := appOpts.(*viper.Viper) - if !ok { - return servertypes.ExportedApp{}, errors.New("appOpts is not viper.Viper") - } - - // overwrite the FlagInvCheckPeriod - viperAppOpts.Set(server.FlagInvCheckPeriod, 1) - appOpts = viperAppOpts - - if height != -1 { - simApp = simapp.NewSimApp(logger, db, traceStore, false, appOpts) - - if err := simApp.LoadHeight(height); err != nil { - return servertypes.ExportedApp{}, err - } - } else { - simApp = simapp.NewSimApp(logger, db, traceStore, true, appOpts) - } - - return simApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs, modulesToExport) -} - -var tempDir = func() string { - dir, err := os.MkdirTemp("", "simapp") - if err != nil { - dir = simapp.DefaultNodeHome + if err := autoCliOpts.EnhanceRootCommand(rootCmd); err != nil { + panic(err) } - defer os.RemoveAll(dir) - return dir + return rootCmd } diff --git a/simapp/simd/cmd/root_di.go b/simapp/simd/cmd/root_di.go new file mode 100644 index 000000000000..10a5438ebf63 --- /dev/null +++ b/simapp/simd/cmd/root_di.go @@ -0,0 +1,122 @@ +//go:build !app_v1 + +package cmd + +import ( + "os" + + "github.com/spf13/cobra" + + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + "cosmossdk.io/client/v2/autocli" + "cosmossdk.io/depinject" + "cosmossdk.io/log" + "cosmossdk.io/simapp" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/config" + nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/server" + "github.com/cosmos/cosmos-sdk/types/module" + "github.com/cosmos/cosmos-sdk/x/auth/tx" + authtxconfig "github.com/cosmos/cosmos-sdk/x/auth/tx/config" + "github.com/cosmos/cosmos-sdk/x/auth/types" +) + +// NewRootCmd creates a new root command for simd. It is called once in the main function. +func NewRootCmd() *cobra.Command { + var ( + autoCliOpts autocli.AppOptions + moduleBasicManager module.BasicManager + clientCtx client.Context + ) + + if err := depinject.Inject( + depinject.Configs(simapp.AppConfig, + depinject.Supply( + log.NewNopLogger(), + ), + depinject.Provide( + ProvideClientContext, + ), + ), + &autoCliOpts, + &moduleBasicManager, + &clientCtx, + ); err != nil { + panic(err) + } + + rootCmd := &cobra.Command{ + Use: "simd", + Short: "simulation app", + SilenceErrors: true, + PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { + // set the default command outputs + cmd.SetOut(cmd.OutOrStdout()) + cmd.SetErr(cmd.ErrOrStderr()) + + clientCtx = clientCtx.WithCmdContext(cmd.Context()).WithViper("") + clientCtx, err := client.ReadPersistentCommandFlags(clientCtx, cmd.Flags()) + if err != nil { + return err + } + + clientCtx, err = config.ReadFromClientConfig(clientCtx) + if err != nil { + return err + } + + if err := client.SetCmdClientContextHandler(clientCtx, cmd); err != nil { + return err + } + + customAppTemplate, customAppConfig := initAppConfig() + customCMTConfig := initCometBFTConfig() + + return server.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig, customCMTConfig) + }, + } + + initRootCmd(rootCmd, clientCtx.TxConfig, moduleBasicManager) + + nodeCmds := nodeservice.NewNodeCommands() + autoCliOpts.ModuleOptions = make(map[string]*autocliv1.ModuleOptions) + autoCliOpts.ModuleOptions[nodeCmds.Name()] = nodeCmds.AutoCLIOptions() + + if err := autoCliOpts.EnhanceRootCommand(rootCmd); err != nil { + panic(err) + } + + return rootCmd +} + +func ProvideClientContext( + appCodec codec.Codec, + interfaceRegistry codectypes.InterfaceRegistry, + txConfigOpts tx.ConfigOptions, + legacyAmino *codec.LegacyAmino, +) client.Context { + clientCtx := client.Context{}. + WithCodec(appCodec). + WithInterfaceRegistry(interfaceRegistry). + WithLegacyAmino(legacyAmino). + WithInput(os.Stdin). + WithAccountRetriever(types.AccountRetriever{}). + WithHomeDir(simapp.DefaultNodeHome). + WithViper("") // In simapp, we don't use any prefix for env variables. + + clientCtx, _ = config.ReadFromClientConfig(clientCtx) + + // textual is enabled by default, we need to re-create the tx config grpc instead of bank keeper. + txConfigOpts.TextualCoinMetadataQueryFn = authtxconfig.NewGRPCCoinMetadataQueryFn(clientCtx) + txConfig, err := tx.NewTxConfigWithOptions(clientCtx.Codec, txConfigOpts) + if err != nil { + panic(err) + } + clientCtx = clientCtx.WithTxConfig(txConfig) + + return clientCtx +} diff --git a/simapp/simd/cmd/cmd_test.go b/simapp/simd/cmd/root_test.go similarity index 99% rename from simapp/simd/cmd/cmd_test.go rename to simapp/simd/cmd/root_test.go index a9c2f8ba537c..5d80df267f55 100644 --- a/simapp/simd/cmd/cmd_test.go +++ b/simapp/simd/cmd/root_test.go @@ -8,6 +8,7 @@ import ( "cosmossdk.io/simapp" "cosmossdk.io/simapp/simd/cmd" + "github.com/cosmos/cosmos-sdk/client/flags" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" diff --git a/simapp/simd/cmd/testnet.go b/simapp/simd/cmd/testnet.go index cd539255b189..acfc2e59e661 100644 --- a/simapp/simd/cmd/testnet.go +++ b/simapp/simd/cmd/testnet.go @@ -7,6 +7,7 @@ import ( "net" "os" "path/filepath" + "time" cmtconfig "github.com/cometbft/cometbft/config" cmttime "github.com/cometbft/cometbft/types/time" @@ -17,6 +18,10 @@ import ( "cosmossdk.io/math/unsafe" "cosmossdk.io/simapp" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" @@ -29,24 +34,26 @@ import ( "github.com/cosmos/cosmos-sdk/testutil/network" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/cosmos/cosmos-sdk/version" "github.com/cosmos/cosmos-sdk/x/genutil" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) var ( flagNodeDirPrefix = "node-dir-prefix" - flagNumValidators = "v" + flagNumValidators = "validator-count" flagOutputDir = "output-dir" flagNodeDaemonHome = "node-daemon-home" flagStartingIPAddress = "starting-ip-address" + flagListenIPAddress = "listen-ip-address" flagEnableLogging = "enable-logging" flagGRPCAddress = "grpc.address" flagRPCAddress = "rpc.address" flagAPIAddress = "api.address" flagPrintMnemonic = "print-mnemonic" + flagStakingDenom = "staking-denom" + flagCommitTimeout = "commit-timeout" + flagSingleHost = "single-host" ) type initArgs struct { @@ -59,6 +66,9 @@ type initArgs struct { numValidators int outputDir string startingIPAddress string + listenIPAddress string + singleMachine bool + bondTokenDenom string } type startArgs struct { @@ -72,10 +82,11 @@ type startArgs struct { outputDir string printMnemonic bool rpcAddress string + timeoutCommit time.Duration } func addTestnetFlagsToCmd(cmd *cobra.Command) { - cmd.Flags().Int(flagNumValidators, 4, "Number of validators to initialize the testnet with") + cmd.Flags().IntP(flagNumValidators, "n", 4, "Number of validators to initialize the testnet with") cmd.Flags().StringP(flagOutputDir, "o", "./.testnets", "Directory to store initialization data for the testnet") cmd.Flags().String(flags.FlagChainID, "", "genesis file chain-id, if left blank will be randomly created") cmd.Flags().String(server.FlagMinGasPrices, fmt.Sprintf("0.000006%s", sdk.DefaultBondDenom), "Minimum gas prices to accept for transactions; All fees in a tx must meet this minimum (e.g. 0.01photino,0.001stake)") @@ -83,7 +94,7 @@ func addTestnetFlagsToCmd(cmd *cobra.Command) { // support old flags name for backwards compatibility cmd.Flags().SetNormalizeFunc(func(f *pflag.FlagSet, name string) pflag.NormalizedName { - if name == "algo" { + if name == flags.FlagKeyAlgorithm { name = flags.FlagKeyType } @@ -93,7 +104,7 @@ func addTestnetFlagsToCmd(cmd *cobra.Command) { // NewTestnetCmd creates a root testnet command with subcommands to run an in-process testnet or initialize // validator configuration files for running a multi-validator testnet in a separate process -func NewTestnetCmd(mbm module.BasicManager, genBalIterator banktypes.GenesisBalancesIterator) *cobra.Command { +func NewTestnetCmd(mm module.BasicManager, genBalIterator banktypes.GenesisBalancesIterator) *cobra.Command { testnetCmd := &cobra.Command{ Use: "testnet", Short: "subcommands for starting or configuring local testnets", @@ -103,18 +114,18 @@ func NewTestnetCmd(mbm module.BasicManager, genBalIterator banktypes.GenesisBala } testnetCmd.AddCommand(testnetStartCmd()) - testnetCmd.AddCommand(testnetInitFilesCmd(mbm, genBalIterator)) + testnetCmd.AddCommand(testnetInitFilesCmd(mm, genBalIterator)) return testnetCmd } // testnetInitFilesCmd returns a cmd to initialize all files for CometBFT testnet and application -func testnetInitFilesCmd(mbm module.BasicManager, genBalIterator banktypes.GenesisBalancesIterator) *cobra.Command { +func testnetInitFilesCmd(mm module.BasicManager, genBalIterator banktypes.GenesisBalancesIterator) *cobra.Command { cmd := &cobra.Command{ Use: "init-files", Short: "Initialize config directories & files for a multi-validator testnet running locally via separate processes (e.g. Docker Compose or similar)", - Long: `init-files will setup "v" number of directories and populate each with -necessary files (private validator, genesis, config, etc.) for running "v" validator nodes. + Long: fmt.Sprintf(`init-files will setup one directory per validator and populate each with +necessary files (private validator, genesis, config, etc.) for running validator nodes. Booting up a network with these validator folders is intended to be used with Docker Compose, or a similar setup where each node has a manually configurable IP address. @@ -122,8 +133,8 @@ or a similar setup where each node has a manually configurable IP address. Note, strict routability for addresses is turned off in the config file. Example: - simd testnet init-files --v 4 --output-dir ./.testnets --starting-ip-address 192.168.10.2 - `, + %s testnet init-files --validator-count 4 --output-dir ./.testnets --starting-ip-address 192.168.10.2 + `, version.AppName), RunE: func(cmd *cobra.Command, _ []string) error { clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { @@ -141,18 +152,29 @@ Example: args.nodeDirPrefix, _ = cmd.Flags().GetString(flagNodeDirPrefix) args.nodeDaemonHome, _ = cmd.Flags().GetString(flagNodeDaemonHome) args.startingIPAddress, _ = cmd.Flags().GetString(flagStartingIPAddress) + args.listenIPAddress, _ = cmd.Flags().GetString(flagListenIPAddress) args.numValidators, _ = cmd.Flags().GetInt(flagNumValidators) args.algo, _ = cmd.Flags().GetString(flags.FlagKeyType) + args.bondTokenDenom, _ = cmd.Flags().GetString(flagStakingDenom) + args.singleMachine, _ = cmd.Flags().GetBool(flagSingleHost) + config.Consensus.TimeoutCommit, err = cmd.Flags().GetDuration(flagCommitTimeout) + if err != nil { + return err + } - return initTestnetFiles(clientCtx, cmd, config, mbm, genBalIterator, args) + return initTestnetFiles(clientCtx, cmd, config, mm, genBalIterator, args) }, } addTestnetFlagsToCmd(cmd) - cmd.Flags().String(flagNodeDirPrefix, "node", "Prefix the directory name for each node with (node results in node0, node1, ...)") + cmd.Flags().String(flagNodeDirPrefix, "node", "Prefix for the name of per-validator subdirectories (to be number-suffixed like node0, node1, ...)") cmd.Flags().String(flagNodeDaemonHome, "simd", "Home directory of the node's daemon configuration") cmd.Flags().String(flagStartingIPAddress, "192.168.0.1", "Starting IP address (192.168.0.1 results in persistent peers list ID0@192.168.0.1:46656, ID1@192.168.0.2:46656, ...)") + cmd.Flags().String(flagListenIPAddress, "0.0.0.0", "TCP or UNIX socket IP address for the RPC server to listen on") cmd.Flags().String(flags.FlagKeyringBackend, flags.DefaultKeyringBackend, "Select keyring's backend (os|file|test)") + cmd.Flags().Duration(flagCommitTimeout, 5*time.Second, "Time to wait after a block commit before starting on the new height") + cmd.Flags().Bool(flagSingleHost, false, "Cluster runs on a single host machine with different ports") + cmd.Flags().String(flagStakingDenom, sdk.DefaultBondDenom, "Default staking token denominator") return cmd } @@ -162,14 +184,14 @@ func testnetStartCmd() *cobra.Command { cmd := &cobra.Command{ Use: "start", Short: "Launch an in-process multi-validator testnet", - Long: `testnet will launch an in-process multi-validator testnet, -and generate "v" directories, populated with necessary validator configuration files -(private validator, genesis, config, etc.). + Long: fmt.Sprintf(`testnet will launch an in-process multi-validator testnet, +and generate a directory for each validator populated with necessary +configuration files (private validator, genesis, config, etc.). Example: - simd testnet --v 4 --output-dir ./.testnets - `, - RunE: func(cmd *cobra.Command, _ []string) error { + %s testnet --validator-count 4 --output-dir ./.testnets + `, version.AppName), + RunE: func(cmd *cobra.Command, _ []string) (err error) { args := startArgs{} args.outputDir, _ = cmd.Flags().GetString(flagOutputDir) args.chainID, _ = cmd.Flags().GetString(flags.FlagChainID) @@ -202,7 +224,7 @@ func initTestnetFiles( clientCtx client.Context, cmd *cobra.Command, nodeConfig *cmtconfig.Config, - mbm module.BasicManager, + mm module.BasicManager, genBalIterator banktypes.GenesisBalancesIterator, args initArgs, ) error { @@ -212,40 +234,64 @@ func initTestnetFiles( nodeIDs := make([]string, args.numValidators) valPubKeys := make([]cryptotypes.PubKey, args.numValidators) - simappConfig := srvconfig.DefaultConfig() - simappConfig.MinGasPrices = args.minGasPrices - simappConfig.API.Enable = true - simappConfig.Telemetry.Enabled = true - simappConfig.Telemetry.PrometheusRetentionTime = 60 - simappConfig.Telemetry.EnableHostnameLabel = false - simappConfig.Telemetry.GlobalLabels = [][]string{{"chain_id", args.chainID}} + appConfig := srvconfig.DefaultConfig() + appConfig.MinGasPrices = args.minGasPrices + appConfig.API.Enable = true + appConfig.Telemetry.Enabled = true + appConfig.Telemetry.PrometheusRetentionTime = 60 + appConfig.Telemetry.EnableHostnameLabel = false + appConfig.Telemetry.GlobalLabels = [][]string{{"chain_id", args.chainID}} var ( genAccounts []authtypes.GenesisAccount genBalances []banktypes.Balance genFiles []string ) + const ( + rpcPort = 26657 + apiPort = 1317 + grpcPort = 9090 + ) + p2pPortStart := 26656 inBuf := bufio.NewReader(cmd.InOrStdin()) // generate private keys, node IDs, and initial transactions for i := 0; i < args.numValidators; i++ { + var portOffset int + if args.singleMachine { + portOffset = i + p2pPortStart = 16656 // use different start point to not conflict with rpc port + nodeConfig.P2P.AddrBookStrict = false + nodeConfig.P2P.PexReactor = false + nodeConfig.P2P.AllowDuplicateIP = true + appConfig.API.Address = fmt.Sprintf("tcp://0.0.0.0:%d", apiPort+portOffset) + appConfig.GRPC.Address = fmt.Sprintf("0.0.0.0:%d", grpcPort+portOffset) + } + nodeDirName := fmt.Sprintf("%s%d", args.nodeDirPrefix, i) nodeDir := filepath.Join(args.outputDir, nodeDirName, args.nodeDaemonHome) gentxsDir := filepath.Join(args.outputDir, "gentxs") nodeConfig.SetRoot(nodeDir) nodeConfig.Moniker = nodeDirName - nodeConfig.RPC.ListenAddress = "tcp://0.0.0.0:26657" + nodeConfig.RPC.ListenAddress = fmt.Sprintf("tcp://%s:%d", args.listenIPAddress, rpcPort+portOffset) if err := os.MkdirAll(filepath.Join(nodeDir, "config"), nodeDirPerm); err != nil { _ = os.RemoveAll(args.outputDir) return err } - - ip, err := getIP(i, args.startingIPAddress) - if err != nil { - _ = os.RemoveAll(args.outputDir) - return err + var ( + err error + ip string + ) + if args.singleMachine { + ip = "0.0.0.0" + } else { + ip, err = getIP(i, args.startingIPAddress) + if err != nil { + _ = os.RemoveAll(args.outputDir) + return err + } } nodeIDs[i], valPubKeys[i], err = genutil.InitializeNodeValidatorFiles(nodeConfig) @@ -254,7 +300,7 @@ func initTestnetFiles( return err } - memo := fmt.Sprintf("%s@%s:26656", nodeIDs[i], ip) + memo := fmt.Sprintf("%s@%s:%d", nodeIDs[i], ip, p2pPortStart+portOffset) genFiles = append(genFiles, nodeConfig.GenesisFile()) kb, err := keyring.New(sdk.KeyringServiceName(), args.keyringBackend, nodeDir, inBuf, clientCtx.Codec) @@ -290,17 +336,19 @@ func initTestnetFiles( accStakingTokens := sdk.TokensFromConsensusPower(500, sdk.DefaultPowerReduction) coins := sdk.Coins{ sdk.NewCoin("testtoken", accTokens), - sdk.NewCoin(sdk.DefaultBondDenom, accStakingTokens), + sdk.NewCoin(args.bondTokenDenom, accStakingTokens), } genBalances = append(genBalances, banktypes.Balance{Address: addr.String(), Coins: coins.Sort()}) genAccounts = append(genAccounts, authtypes.NewBaseAccount(addr, nil, 0, 0)) + valAddr := sdk.ValAddress(addr) + valStr := valAddr.String() valTokens := sdk.TokensFromConsensusPower(100, sdk.DefaultPowerReduction) createValMsg, err := stakingtypes.NewMsgCreateValidator( - sdk.ValAddress(addr), + valStr, valPubKeys[i], - sdk.NewCoin(sdk.DefaultBondDenom, valTokens), + sdk.NewCoin(args.bondTokenDenom, valTokens), stakingtypes.NewDescription(nodeDirName, "", "", "", ""), stakingtypes.NewCommissionRates(math.LegacyOneDec(), math.LegacyOneDec(), math.LegacyOneDec()), math.OneInt(), @@ -336,16 +384,19 @@ func initTestnetFiles( return err } - srvconfig.WriteConfigFile(filepath.Join(nodeDir, "config", "app.toml"), simappConfig) + srvconfig.SetConfigTemplate(srvconfig.DefaultConfigTemplate) + + srvconfig.WriteConfigFile(filepath.Join(nodeDir, "config", "app.toml"), appConfig) } - if err := initGenFiles(clientCtx, mbm, args.chainID, genAccounts, genBalances, genFiles, args.numValidators); err != nil { + if err := initGenFiles(clientCtx, mm, args.chainID, genAccounts, genBalances, genFiles, args.numValidators); err != nil { return err } err := collectGenFiles( clientCtx, nodeConfig, args.chainID, nodeIDs, valPubKeys, args.numValidators, args.outputDir, args.nodeDirPrefix, args.nodeDaemonHome, genBalIterator, + rpcPort, p2pPortStart, args.singleMachine, ) if err != nil { return err @@ -356,11 +407,11 @@ func initTestnetFiles( } func initGenFiles( - clientCtx client.Context, mbm module.BasicManager, chainID string, + clientCtx client.Context, mm module.BasicManager, chainID string, genAccounts []authtypes.GenesisAccount, genBalances []banktypes.Balance, genFiles []string, numValidators int, ) error { - appGenState := mbm.DefaultGenesis(clientCtx.Codec) + appGenState := mm.DefaultGenesis(clientCtx.Codec) // set the accounts in the genesis state var authGenState authtypes.GenesisState @@ -379,6 +430,7 @@ func initGenFiles( clientCtx.Codec.MustUnmarshalJSON(appGenState[banktypes.ModuleName], &bankGenState) bankGenState.Balances = banktypes.SanitizeGenesisBalances(genBalances) + for _, bal := range bankGenState.Balances { bankGenState.Supply = bankGenState.Supply.Add(bal.Coins...) } @@ -403,11 +455,19 @@ func collectGenFiles( clientCtx client.Context, nodeConfig *cmtconfig.Config, chainID string, nodeIDs []string, valPubKeys []cryptotypes.PubKey, numValidators int, outputDir, nodeDirPrefix, nodeDaemonHome string, genBalIterator banktypes.GenesisBalancesIterator, + rpcPortStart, p2pPortStart int, + singleMachine bool, ) error { var appState json.RawMessage genTime := cmttime.Now() for i := 0; i < numValidators; i++ { + if singleMachine { + portOffset := i + nodeConfig.RPC.ListenAddress = fmt.Sprintf("tcp://0.0.0.0:%d", rpcPortStart+portOffset) + nodeConfig.P2P.ListenAddress = fmt.Sprintf("tcp://0.0.0.0:%d", p2pPortStart+portOffset) + } + nodeDirName := fmt.Sprintf("%s%d", nodeDirPrefix, i) nodeDir := filepath.Join(outputDir, nodeDirName, nodeDaemonHome) gentxsDir := filepath.Join(outputDir, "gentxs") @@ -423,7 +483,16 @@ func collectGenFiles( return err } - nodeAppState, err := genutil.GenAppStateFromConfig(clientCtx.Codec, clientCtx.TxConfig, nodeConfig, initCfg, appGenesis, genBalIterator, genutiltypes.DefaultMessageValidator) + nodeAppState, err := genutil.GenAppStateFromConfig( + clientCtx.Codec, + clientCtx.TxConfig, + nodeConfig, + initCfg, + appGenesis, + genBalIterator, + genutiltypes.DefaultMessageValidator, + clientCtx.TxConfig.SigningContext().ValidatorAddressCodec(), + ) if err != nil { return err } @@ -499,6 +568,7 @@ func startTestnet(cmd *cobra.Command, args startArgs) error { networkConfig.APIAddress = args.apiAddress networkConfig.GRPCAddress = args.grpcAddress networkConfig.PrintMnemonic = args.printMnemonic + networkConfig.TimeoutCommit = args.timeoutCommit networkLogger := network.NewCLILogger(cmd) baseDir := fmt.Sprintf("%s/%s", args.outputDir, networkConfig.ChainID) diff --git a/simapp/simd/cmd/testnet_test.go b/simapp/simd/cmd/testnet_test.go index 71ef4d304618..6d697b0d0d12 100644 --- a/simapp/simd/cmd/testnet_test.go +++ b/simapp/simd/cmd/testnet_test.go @@ -9,6 +9,7 @@ import ( "github.com/stretchr/testify/require" "cosmossdk.io/log" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/server" @@ -23,7 +24,6 @@ import ( genutiltest "github.com/cosmos/cosmos-sdk/x/genutil/client/testutil" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" "github.com/cosmos/cosmos-sdk/x/mint" - "github.com/cosmos/cosmos-sdk/x/params" "github.com/cosmos/cosmos-sdk/x/staking" ) @@ -35,7 +35,6 @@ func Test_TestnetCmd(t *testing.T) { staking.AppModuleBasic{}, mint.AppModuleBasic{}, distribution.AppModuleBasic{}, - params.AppModuleBasic{}, consensus.AppModuleBasic{}, ) diff --git a/simapp/simd/main.go b/simapp/simd/main.go index 9890b4c0b0d5..4e7549b21411 100644 --- a/simapp/simd/main.go +++ b/simapp/simd/main.go @@ -1,18 +1,20 @@ package main import ( + "fmt" "os" - "cosmossdk.io/log" + clientv2helpers "cosmossdk.io/client/v2/helpers" "cosmossdk.io/simapp" "cosmossdk.io/simapp/simd/cmd" + svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" ) func main() { rootCmd := cmd.NewRootCmd() - if err := svrcmd.Execute(rootCmd, "", simapp.DefaultNodeHome); err != nil { - log.NewLogger(rootCmd.OutOrStderr()).Error("failure when running app", "err", err) + if err := svrcmd.Execute(rootCmd, clientv2helpers.EnvPrefix, simapp.DefaultNodeHome); err != nil { + fmt.Fprintln(rootCmd.OutOrStderr(), err) os.Exit(1) } } diff --git a/simapp/sonar-project.properties b/simapp/sonar-project.properties deleted file mode 100644 index 1da573f424c1..000000000000 --- a/simapp/sonar-project.properties +++ /dev/null @@ -1,14 +0,0 @@ -sonar.projectKey=cosmos-sdk-simapp -sonar.organization=cosmos - -sonar.projectName=Cosmos SDK - SimApp -sonar.project.monorepo.enabled=true - -sonar.sources=. -sonar.exclusions=**/*_test.go -sonar.tests=. -sonar.test.inclusions=**/*_test.go -sonar.go.coverage.reportPaths=coverage.out - -sonar.sourceEncoding=UTF-8 -sonar.scm.provider=git \ No newline at end of file diff --git a/simapp/test_helpers.go b/simapp/test_helpers.go index bb36b5ee2d5f..7043f2eba3bf 100644 --- a/simapp/test_helpers.go +++ b/simapp/test_helpers.go @@ -6,14 +6,14 @@ import ( "os" "testing" - "cosmossdk.io/log" - sdkmath "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" cmtjson "github.com/cometbft/cometbft/libs/json" cmttypes "github.com/cometbft/cometbft/types" dbm "github.com/cosmos/cosmos-db" "github.com/stretchr/testify/require" + "cosmossdk.io/log" + sdkmath "cosmossdk.io/math" pruningtypes "cosmossdk.io/store/pruning/types" bam "github.com/cosmos/cosmos-sdk/baseapp" @@ -190,8 +190,12 @@ func AddTestAddrsIncremental(app *SimApp, ctx sdk.Context, accNum int, accAmt sd func addTestAddrs(app *SimApp, ctx sdk.Context, accNum int, accAmt sdkmath.Int, strategy simtestutil.GenerateAccountStrategy) []sdk.AccAddress { testAddrs := strategy(accNum) + bondDenom, err := app.StakingKeeper.BondDenom(ctx) + if err != nil { + panic(err) + } - initCoins := sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), accAmt)) + initCoins := sdk.NewCoins(sdk.NewCoin(bondDenom, accAmt)) for _, addr := range testAddrs { initAccountWithCoins(app, ctx, addr, initCoins) diff --git a/simapp/testutil_network_test.go b/simapp/testutil_network_test.go index f12cbae39dfa..fad10ea95474 100644 --- a/simapp/testutil_network_test.go +++ b/simapp/testutil_network_test.go @@ -7,6 +7,7 @@ import ( "github.com/stretchr/testify/suite" "cosmossdk.io/simapp" + "github.com/cosmos/cosmos-sdk/testutil/network" ) diff --git a/simapp/upgrades.go b/simapp/upgrades.go index d59e78108d72..66c9fb87e7c0 100644 --- a/simapp/upgrades.go +++ b/simapp/upgrades.go @@ -4,6 +4,7 @@ import ( "context" storetypes "cosmossdk.io/store/types" + circuittypes "cosmossdk.io/x/circuit/types" upgradetypes "cosmossdk.io/x/upgrade/types" "github.com/cosmos/cosmos-sdk/types/module" @@ -31,7 +32,11 @@ func (app SimApp) RegisterUpgradeHandlers() { } if upgradeInfo.Name == UpgradeName && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { - storeUpgrades := storetypes.StoreUpgrades{} + storeUpgrades := storetypes.StoreUpgrades{ + Added: []string{ + circuittypes.ModuleName, + }, + } // configure store loader that checks if version == upgradeHeight and applies store upgrades app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) diff --git a/sonar-project.properties b/sonar-project.properties deleted file mode 100644 index b9090bd34e56..000000000000 --- a/sonar-project.properties +++ /dev/null @@ -1,20 +0,0 @@ -sonar.projectKey=cosmos_cosmos-sdk -sonar.organization=cosmos - -sonar.projectName=Cosmos SDK -sonar.project.monorepo.enabled=true - -sonar.sources=. -sonar.exclusions=**/*_test.go,tests/**,**/testutil/**,**/*.pb.go,**/*.pb.gw.go,**/*.pulsar.go,test_helpers.go,docs/**,**/*.java,client/docs/**, -sonar.tests=. -sonar.test.inclusions=**/*_test.go,tests/**,**/testutil/** -sonar.go.coverage.reportPaths=coverage.out,*profile.out - -sonar.python.version=3 -sonar.sourceEncoding=UTF-8 -sonar.scm.provider=git - -# Exclude C/C++/Objective-C files from analysis -sonar.c.file.suffixes=- -sonar.cpp.file.suffixes=- -sonar.objc.file.suffixes=- \ No newline at end of file diff --git a/store/CHANGELOG.md b/store/CHANGELOG.md index 2d0ab929b924..c7367084001e 100644 --- a/store/CHANGELOG.md +++ b/store/CHANGELOG.md @@ -23,27 +23,56 @@ Ref: https://keepachangelog.com/en/1.0.0/ # Changelog -## [Unreleased] +> **Disclaimer**: Numbers from v1.0.x to v1.9.x are reserved for the v0.50 line. +> cosmossdk.io/store compatible with the v0.50 line is tagged from release/v0.50.x +> Numbers from v1.10.x onwards are reserved for the 0.52+ line. +> With Cosmos SDK v2 (with store/v2), CometBFT has been pushed to the boundaries, so issues like this +> are not expected to happen again. + +## v1.1.1 (September 06, 2024) + +### Improvements + +* [#21574](https://github.com/cosmos/cosmos-sdk/pull/21574) Upgrade IVL to IAVL 1.2.0. + +## v1.1.0 (March 20, 2024) + +### Improvements + +* [#19770](https://github.com/cosmos/cosmos-sdk/pull/19770) Upgrade IAVL to IAVL v1.1.1. + +## v1.0.2 (January 10, 2024) + +### Bug Fixes + +* [#18897](https://github.com/cosmos/cosmos-sdk/pull/18897) Replace panic in pruning to avoid consensus halting. + +## v1.0.1 (November 28, 2023) + +### Bug Fixes + +* [#18563](https://github.com/cosmos/cosmos-sdk/pull/18563) `LastCommitID().Hash` will always return `sha256([]byte{})` if the store is empty. + +## v1.0.0 (October 31, 2023) ### Features +* [#17294](https://github.com/cosmos/cosmos-sdk/pull/17294) Add snapshot manager Close method. * [#15568](https://github.com/cosmos/cosmos-sdk/pull/15568) Migrate the `iavl` to the new key format. - * Remove `DeleteVersion`, `DeleteVersions`, `LazyLoadVersionForOverwriting` from `iavl` tree API. - * Add `DeleteVersionsTo` and `SaveChangeSet`, since it will keep versions sequentially like `fromVersion` to `toVersion`. - * Refactor the pruning manager to use `DeleteVersionsTo`. + * Remove `DeleteVersion`, `DeleteVersions`, `LazyLoadVersionForOverwriting` from `iavl` tree API. + * Add `DeleteVersionsTo` and `SaveChangeSet`, since it will keep versions sequentially like `fromVersion` to `toVersion`. + * Refactor the pruning manager to use `DeleteVersionsTo`. * [#15712](https://github.com/cosmos/cosmos-sdk/pull/15712) Add `WorkingHash` function to the store interface to get the current app hash before commit. - * [#14645](https://github.com/cosmos/cosmos-sdk/pull/14645) Add limit to the length of key and value. * [#15683](https://github.com/cosmos/cosmos-sdk/pull/15683) `rootmulti.Store.CacheMultiStoreWithVersion` now can handle loading archival states that don't persist any of the module stores the current state has. * [#16060](https://github.com/cosmos/cosmos-sdk/pull/16060) Support saving restoring snapshot locally. +* [#14746](https://github.com/cosmos/cosmos-sdk/pull/14746) The `store` module is extracted to have a separate go.mod file which allows it be a standalone module. +* [#14410](https://github.com/cosmos/cosmos-sdk/pull/14410) `rootmulti.Store.loadVersion` has validation to check if all the module stores' height is correct, it will error if any module store has incorrect height. -### API Breaking Changes - -* [#16321](https://github.com/cosmos/cosmos-sdk/pull/16321) QueryInterface defines its own request and response types instead of relying on comet/abci & returns an error +### Improvements -## [v0.1.0-alpha.1](https://github.com/cosmos/cosmos-sdk/releases/tag/store%2Fv0.1.0-alpha.1) - 2023-03-17 +* [#17158](https://github.com/cosmos/cosmos-sdk/pull/17158) Start the goroutine after need to create a snapshot. -### Features +### API Breaking Changes -* [#14746](https://github.com/cosmos/cosmos-sdk/pull/14746) The `store` module is extracted to have a separate go.mod file which allows it be a standalone module. -* [#14410](https://github.com/cosmos/cosmos-sdk/pull/14410) `rootmulti.Store.loadVersion` has validation to check if all the module stores' height is correct, it will error if any module store has incorrect height. +* [#16321](https://github.com/cosmos/cosmos-sdk/pull/16321) QueryInterface defines its own request and response types instead of relying on comet/abci & returns an error diff --git a/store/cache/cache.go b/store/cache/cache.go index 976b4525260c..98d17d0341ac 100644 --- a/store/cache/cache.go +++ b/store/cache/cache.go @@ -3,10 +3,10 @@ package cache import ( "fmt" + lru "github.com/hashicorp/golang-lru" + "cosmossdk.io/store/cachekv" "cosmossdk.io/store/types" - - lru "github.com/hashicorp/golang-lru" ) var ( diff --git a/store/cache/cache_test.go b/store/cache/cache_test.go index 0340f7ecbd8d..efbf22c8e18e 100644 --- a/store/cache/cache_test.go +++ b/store/cache/cache_test.go @@ -13,10 +13,11 @@ import ( "cosmossdk.io/store/cachekv" iavlstore "cosmossdk.io/store/iavl" "cosmossdk.io/store/types" + "cosmossdk.io/store/wrapper" ) func TestGetOrSetStoreCache(t *testing.T) { - db := dbm.NewMemDB() + db := wrapper.NewDBWrapper(dbm.NewMemDB()) mngr := cache.NewCommitKVStoreCacheManager(cache.DefaultCommitKVStoreCacheSize) sKey := types.NewKVStoreKey("test") @@ -29,7 +30,7 @@ func TestGetOrSetStoreCache(t *testing.T) { } func TestUnwrap(t *testing.T) { - db := dbm.NewMemDB() + db := wrapper.NewDBWrapper(dbm.NewMemDB()) mngr := cache.NewCommitKVStoreCacheManager(cache.DefaultCommitKVStoreCacheSize) sKey := types.NewKVStoreKey("test") @@ -42,7 +43,7 @@ func TestUnwrap(t *testing.T) { } func TestStoreCache(t *testing.T) { - db := dbm.NewMemDB() + db := wrapper.NewDBWrapper(dbm.NewMemDB()) mngr := cache.NewCommitKVStoreCacheManager(cache.DefaultCommitKVStoreCacheSize) sKey := types.NewKVStoreKey("test") @@ -68,7 +69,7 @@ func TestStoreCache(t *testing.T) { } func TestReset(t *testing.T) { - db := dbm.NewMemDB() + db := wrapper.NewDBWrapper(dbm.NewMemDB()) mngr := cache.NewCommitKVStoreCacheManager(cache.DefaultCommitKVStoreCacheSize) sKey := types.NewKVStoreKey("test") @@ -88,7 +89,7 @@ func TestReset(t *testing.T) { } func TestCacheWrap(t *testing.T) { - db := dbm.NewMemDB() + db := wrapper.NewDBWrapper(dbm.NewMemDB()) mngr := cache.NewCommitKVStoreCacheManager(cache.DefaultCommitKVStoreCacheSize) sKey := types.NewKVStoreKey("test") diff --git a/store/cachekv/benchmark_test.go b/store/cachekv/benchmark_test.go index 3f718e3a3741..158549b4bd3b 100644 --- a/store/cachekv/benchmark_test.go +++ b/store/cachekv/benchmark_test.go @@ -4,14 +4,16 @@ import ( fmt "fmt" "testing" + dbm "github.com/cosmos/cosmos-db" + "github.com/stretchr/testify/require" + "cosmossdk.io/store/cachekv" "cosmossdk.io/store/dbadapter" "cosmossdk.io/store/types" - dbm "github.com/cosmos/cosmos-db" - "github.com/stretchr/testify/require" ) func DoBenchmarkDeepCacheStack(b *testing.B, depth int) { + b.Helper() db := dbm.NewMemDB() initialStore := cachekv.NewStore(dbadapter.Store{DB: db}) diff --git a/store/cachekv/internal/btree.go b/store/cachekv/internal/btree.go index 1894db97a1fa..209f7e58c4dd 100644 --- a/store/cachekv/internal/btree.go +++ b/store/cachekv/internal/btree.go @@ -4,8 +4,9 @@ import ( "bytes" "errors" - "cosmossdk.io/store/types" "github.com/tidwall/btree" + + "cosmossdk.io/store/types" ) const ( diff --git a/store/cachekv/internal/btree_test.go b/store/cachekv/internal/btree_test.go index 4ee075d4cef6..06437997f636 100644 --- a/store/cachekv/internal/btree_test.go +++ b/store/cachekv/internal/btree_test.go @@ -3,8 +3,9 @@ package internal import ( "testing" - "cosmossdk.io/store/types" "github.com/stretchr/testify/require" + + "cosmossdk.io/store/types" ) func TestGetSetDelete(t *testing.T) { @@ -182,6 +183,7 @@ func TestDBIterator(t *testing.T) { } func verifyIterator(t *testing.T, itr types.Iterator, expected []int64, msg string) { + t.Helper() i := 0 for itr.Valid() { key := itr.Key() diff --git a/store/cachekv/internal/memiterator.go b/store/cachekv/internal/memiterator.go index 77e7c1eea4f3..9dbba7587071 100644 --- a/store/cachekv/internal/memiterator.go +++ b/store/cachekv/internal/memiterator.go @@ -4,8 +4,9 @@ import ( "bytes" "errors" - "cosmossdk.io/store/types" "github.com/tidwall/btree" + + "cosmossdk.io/store/types" ) var _ types.Iterator = (*memIterator)(nil) diff --git a/store/cachekv/store.go b/store/cachekv/store.go index f25a4c25f123..08cfc2b325f6 100644 --- a/store/cachekv/store.go +++ b/store/cachekv/store.go @@ -6,9 +6,9 @@ import ( "sort" "sync" - "cosmossdk.io/math" dbm "github.com/cosmos/cosmos-db" + "cosmossdk.io/math" "cosmossdk.io/store/cachekv/internal" "cosmossdk.io/store/internal/conv" "cosmossdk.io/store/internal/kv" diff --git a/store/cachekv/store_bench_test.go b/store/cachekv/store_bench_test.go index d047c4398c06..8f15855e0952 100644 --- a/store/cachekv/store_bench_test.go +++ b/store/cachekv/store_bench_test.go @@ -15,6 +15,7 @@ const defaultValueSizeBz = 1 << 12 // This benchmark measures the time of iterator.Next() when the parent store is blank func benchmarkBlankParentIteratorNext(b *testing.B, keysize int) { + b.Helper() mem := dbadapter.Store{DB: dbm.NewMemDB()} kvstore := cachekv.NewStore(mem) // Use a singleton for value, to not waste time computing it @@ -44,6 +45,7 @@ func benchmarkBlankParentIteratorNext(b *testing.B, keysize int) { // Benchmark setting New keys to a store, where the new keys are in sequence. func benchmarkBlankParentAppend(b *testing.B, keysize int) { + b.Helper() mem := dbadapter.Store{DB: dbm.NewMemDB()} kvstore := cachekv.NewStore(mem) @@ -66,6 +68,7 @@ func benchmarkBlankParentAppend(b *testing.B, keysize int) { // Benchmark setting New keys to a store, where the new keys are random. // the speed of this function does not depend on the values in the parent store func benchmarkRandomSet(b *testing.B, keysize int) { + b.Helper() mem := dbadapter.Store{DB: dbm.NewMemDB()} kvstore := cachekv.NewStore(mem) @@ -96,6 +99,7 @@ func benchmarkRandomSet(b *testing.B, keysize int) { // We essentially are benchmarking the cacheKV iterator creation & iteration times // with the number of entries deleted in the parent. func benchmarkIteratorOnParentWithManyDeletes(b *testing.B, numDeletes int) { + b.Helper() mem := dbadapter.Store{DB: dbm.NewMemDB()} // Use a singleton for value, to not waste time computing it diff --git a/store/cachekv/store_test.go b/store/cachekv/store_test.go index 3694726a7935..3c5622355403 100644 --- a/store/cachekv/store_test.go +++ b/store/cachekv/store_test.go @@ -4,10 +4,10 @@ import ( "fmt" "testing" - "cosmossdk.io/math/unsafe" dbm "github.com/cosmos/cosmos-db" "github.com/stretchr/testify/require" + "cosmossdk.io/math/unsafe" "cosmossdk.io/store/cachekv" "cosmossdk.io/store/dbadapter" "cosmossdk.io/store/types" @@ -466,6 +466,7 @@ func randInt(n int) int { // useful for replaying a error case if we find one func doOp(t *testing.T, st types.CacheKVStore, truth dbm.DB, op int, args ...int) { + t.Helper() switch op { case opSet: k := args[0] @@ -491,6 +492,7 @@ func doOp(t *testing.T, st types.CacheKVStore, truth dbm.DB, op int, args ...int } func doRandomOp(t *testing.T, st types.CacheKVStore, truth dbm.DB, maxKey int) { + t.Helper() r := randInt(totalOps) switch r { case opSet: @@ -520,6 +522,7 @@ func doRandomOp(t *testing.T, st types.CacheKVStore, truth dbm.DB, maxKey int) { // iterate over whole domain func assertIterateDomain(t *testing.T, st types.KVStore, expectedN int) { + t.Helper() itr := st.Iterator(nil, nil) i := 0 for ; itr.Valid(); itr.Next() { @@ -533,6 +536,7 @@ func assertIterateDomain(t *testing.T, st types.KVStore, expectedN int) { } func assertIterateDomainCheck(t *testing.T, st types.KVStore, mem dbm.DB, r []keyRange) { + t.Helper() // iterate over each and check they match the other itr := st.Iterator(nil, nil) itr2, err := mem.Iterator(nil, nil) // ground truth @@ -566,6 +570,7 @@ func assertIterateDomainCheck(t *testing.T, st types.KVStore, mem dbm.DB, r []ke } func assertIterateDomainCompare(t *testing.T, st types.KVStore, mem dbm.DB) { + t.Helper() // iterate over each and check they match the other itr := st.Iterator(nil, nil) itr2, err := mem.Iterator(nil, nil) // ground truth @@ -577,6 +582,7 @@ func assertIterateDomainCompare(t *testing.T, st types.KVStore, mem dbm.DB) { } func checkIterators(t *testing.T, itr, itr2 types.Iterator) { + t.Helper() for ; itr.Valid(); itr.Next() { require.True(t, itr2.Valid()) k, v := itr.Key(), itr.Value() @@ -592,6 +598,7 @@ func checkIterators(t *testing.T, itr, itr2 types.Iterator) { //-------------------------------------------------------- func setRange(t *testing.T, st types.KVStore, mem dbm.DB, start, end int) { + t.Helper() for i := start; i < end; i++ { st.Set(keyFmt(i), valFmt(i)) err := mem.Set(keyFmt(i), valFmt(i)) @@ -600,6 +607,7 @@ func setRange(t *testing.T, st types.KVStore, mem dbm.DB, start, end int) { } func deleteRange(t *testing.T, st types.KVStore, mem dbm.DB, start, end int) { + t.Helper() for i := start; i < end; i++ { st.Delete(keyFmt(i)) err := mem.Delete(keyFmt(i)) diff --git a/store/dbadapter/store.go b/store/dbadapter/store.go index 175f6ad18f96..013e26df2030 100644 --- a/store/dbadapter/store.go +++ b/store/dbadapter/store.go @@ -38,6 +38,7 @@ func (dsa Store) Has(key []byte) bool { // Set wraps the underlying DB's Set method panicing on error. func (dsa Store) Set(key, value []byte) { types.AssertValidKey(key) + types.AssertValidValue(value) if err := dsa.DB.Set(key, value); err != nil { panic(err) } diff --git a/store/dbadapter/store_test.go b/store/dbadapter/store_test.go index 75e7541b9f74..303170bde266 100644 --- a/store/dbadapter/store_test.go +++ b/store/dbadapter/store_test.go @@ -5,13 +5,13 @@ import ( "errors" "testing" + "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" + "cosmossdk.io/store/cachekv" "cosmossdk.io/store/dbadapter" "cosmossdk.io/store/mock" "cosmossdk.io/store/types" - - "github.com/golang/mock/gomock" - "github.com/stretchr/testify/require" ) var errFoo = errors.New("dummy") diff --git a/store/go.mod b/store/go.mod index f1dc7809a3a3..071baca663b6 100644 --- a/store/go.mod +++ b/store/go.mod @@ -1,78 +1,86 @@ module cosmossdk.io/store -go 1.20 +go 1.23.0 require ( - cosmossdk.io/errors v1.0.0-beta.7 - cosmossdk.io/log v1.1.0 - cosmossdk.io/math v1.0.1 - github.com/armon/go-metrics v0.4.1 - github.com/cometbft/cometbft v0.38.0-rc1 - github.com/cosmos/cosmos-db v1.0.0 - github.com/cosmos/gogoproto v1.4.10 - github.com/cosmos/iavl v1.0.0-beta.2 - github.com/cosmos/ics23/go v0.10.0 - github.com/golang/mock v1.6.0 - github.com/golang/protobuf v1.5.3 // indirect - github.com/hashicorp/go-hclog v1.5.0 - github.com/hashicorp/go-plugin v1.4.10 - github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d - github.com/spf13/cast v1.5.1 // indirect - github.com/stretchr/testify v1.8.4 - github.com/tidwall/btree v1.6.0 - golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 - google.golang.org/grpc v1.55.0 - google.golang.org/protobuf v1.30.0 - gotest.tools/v3 v3.4.0 + cosmossdk.io/errors v1.0.1 + cosmossdk.io/log v1.5.0 + cosmossdk.io/math v1.5.0 + github.com/cometbft/cometbft v0.38.17 + github.com/cosmos/cosmos-db v1.1.1 + github.com/cosmos/gogoproto v1.7.0 + github.com/cosmos/iavl v1.2.0 + github.com/cosmos/ics23/go v0.11.0 + github.com/golang/protobuf v1.5.4 // indirect + github.com/hashicorp/go-hclog v1.6.3 + github.com/hashicorp/go-metrics v0.5.4 + github.com/hashicorp/go-plugin v1.6.3 + github.com/hashicorp/golang-lru v1.0.2 + github.com/spf13/cast v1.7.1 // indirect + github.com/stretchr/testify v1.10.0 + github.com/tidwall/btree v1.7.0 + go.uber.org/mock v0.5.0 + golang.org/x/exp v0.0.0-20250218142911-aa4b98e5adaa // indirect + google.golang.org/grpc v1.71.0 + google.golang.org/protobuf v1.36.5 + gotest.tools/v3 v3.5.2 ) require ( - github.com/DataDog/zstd v1.5.5 // indirect + github.com/DataDog/zstd v1.5.6 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/cockroachdb/errors v1.9.1 // indirect + github.com/bytedance/sonic v1.12.3 // indirect + github.com/bytedance/sonic/loader v0.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/cloudwego/base64x v0.1.4 // indirect + github.com/cloudwego/iasm v0.2.0 // indirect + github.com/cockroachdb/apd/v3 v3.2.1 // indirect + github.com/cockroachdb/errors v1.11.3 // indirect + github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20230525220056-bb4fc9527b3b // indirect - github.com/cockroachdb/redact v1.1.4 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect - github.com/emicklei/dot v1.4.2 // indirect + github.com/cockroachdb/pebble v1.1.2 // indirect + github.com/cockroachdb/redact v1.1.5 // indirect + github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect + github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.15.0 // indirect - github.com/getsentry/sentry-go v0.21.0 // indirect + github.com/getsentry/sentry-go v0.27.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/snappy v0.0.4 // indirect - github.com/google/btree v1.1.2 // indirect - github.com/google/go-cmp v0.5.9 // indirect + github.com/google/btree v1.1.3 // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/hashicorp/go-immutable-radix v1.0.0 // indirect github.com/hashicorp/go-uuid v1.0.1 // indirect github.com/hashicorp/yamux v0.1.1 // indirect - github.com/jhump/protoreflect v1.15.1 // indirect - github.com/klauspost/compress v1.16.5 // indirect + github.com/jhump/protoreflect v1.15.3 // indirect + github.com/klauspost/compress v1.17.9 // indirect + github.com/klauspost/cpuid/v2 v2.0.9 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect - github.com/linxGnu/grocksdb v1.7.16 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.19 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/mitchellh/go-testing-interface v1.14.1 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20220708102147-0a8a51822cae // indirect github.com/oklog/run v1.1.0 // indirect - github.com/petermattis/goid v0.0.0-20221215004737-a150e88a970d // indirect + github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.15.1 // indirect - github.com/prometheus/client_model v0.4.0 // indirect - github.com/prometheus/common v0.44.0 // indirect - github.com/prometheus/procfs v0.10.0 // indirect - github.com/rogpeppe/go-internal v1.10.0 // indirect - github.com/rs/zerolog v1.29.1 // indirect - github.com/sasha-s/go-deadlock v0.3.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/prometheus/client_golang v1.20.5 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.62.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect + github.com/rs/zerolog v1.33.0 // indirect + github.com/sasha-s/go-deadlock v0.3.5 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect - golang.org/x/crypto v0.9.0 // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/text v0.9.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect + golang.org/x/crypto v0.32.0 // indirect + golang.org/x/net v0.34.0 // indirect + golang.org/x/sys v0.29.0 // indirect + golang.org/x/text v0.21.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/store/go.sum b/store/go.sum index 4632e20a8612..0d8422a2938e 100644 --- a/store/go.sum +++ b/store/go.sum @@ -1,134 +1,112 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= -cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= -cosmossdk.io/log v1.1.0 h1:v0ogPHYeTzPcBTcPR1A3j1hkei4pZama8kz8LKlCMv0= -cosmossdk.io/log v1.1.0/go.mod h1:6zjroETlcDs+mm62gd8Ig7mZ+N+fVOZS91V17H+M4N4= -cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= -cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= -github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= -github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= +cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= +cosmossdk.io/log v1.5.0 h1:dVdzPJW9kMrnAYyMf1duqacoidB9uZIl+7c6z0mnq0g= +cosmossdk.io/log v1.5.0/go.mod h1:Tr46PUJjiUthlwQ+hxYtUtPn4D/oCZXAkYevBeh5+FI= +cosmossdk.io/math v1.5.0 h1:sbOASxee9Zxdjd6OkzogvBZ25/hP929vdcYcBJQbkLc= +cosmossdk.io/math v1.5.0/go.mod h1:AAwwBmUhqtk2nlku174JwSll+/DepUXW3rWIXN5q+Nw= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= -github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= -github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= -github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= -github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= +github.com/DataDog/zstd v1.5.6 h1:LbEglqepa/ipmmQJUDnSsfvA8e8IStVcGaFWDuxvGOY= +github.com/DataDog/zstd v1.5.6/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= -github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= -github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= -github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= -github.com/bufbuild/protocompile v0.5.1 h1:mixz5lJX4Hiz4FpqFREJHIXLfaLBntfaJv1h+/jS+Qg= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/btcsuite/btcd/btcutil v1.1.6 h1:zFL2+c3Lb9gEgqKNzowKUPQNb8jV7v5Oaodi/AYFd6c= +github.com/btcsuite/btcd/btcutil v1.1.6/go.mod h1:9dFymx8HpuLqBnsPELrImQeTQfKBQqzqGbbV3jK55aE= +github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY= +github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE= +github.com/bytedance/sonic v1.12.3 h1:W2MGa7RCU1QTeYRTPE3+88mVC0yXmsRQRChiyVocVjU= +github.com/bytedance/sonic v1.12.3/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= +github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= +github.com/bytedance/sonic/loader v0.2.0 h1:zNprn+lsIP06C/IqCHs3gPQIvnvpKbbxyXQP1iU4kWM= +github.com/bytedance/sonic/loader v0.2.0/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -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/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/0Y= +github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= +github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg= +github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= +github.com/cockroachdb/apd/v3 v3.2.1 h1:U+8j7t0axsIgvQUqthuNm82HIrYXodOV2iWLWtEaIwg= +github.com/cockroachdb/apd/v3 v3.2.1/go.mod h1:klXJcjp+FffLTHlhIG69tezTDvdP065naDsHzKhYSqc= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= -github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= -github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= +github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce h1:giXvy4KSc/6g/esnpM7Geqxka4WSqI1SZc7sMJFd3y4= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/pebble v0.0.0-20230525220056-bb4fc9527b3b h1:LCs8gDhg6vt8A3dN7AEJxmCoETZ4qkySoVJVm3rcSJk= -github.com/cockroachdb/pebble v0.0.0-20230525220056-bb4fc9527b3b/go.mod h1:TkdVsGYRqtULUppt2RbC+YaKtTHnHoWa2apfFrSKABw= -github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/cockroachdb/redact v1.1.4 h1:Y0XrVI2FAyofNyGveodTN//qdpPtFKcKTeCBsK3AHAQ= -github.com/cockroachdb/redact v1.1.4/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= -github.com/cometbft/cometbft v0.38.0-rc1 h1:ph6smlqX82aH+d72KuxDHqu29M7LyusSp/obfGsGX/w= -github.com/cometbft/cometbft v0.38.0-rc1/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/cockroachdb/pebble v1.1.2 h1:CUh2IPtR4swHlEj48Rhfzw6l/d0qA31fItcIszQVIsA= +github.com/cockroachdb/pebble v1.1.2/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= +github.com/cometbft/cometbft v0.38.17 h1:FkrQNbAjiFqXydeAO81FUzriL4Bz0abYxN/eOHrQGOk= +github.com/cometbft/cometbft v0.38.17/go.mod h1:5l0SkgeLRXi6bBfQuevXjKqML1jjfJJlvI1Ulp02/o4= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0E= -github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= -github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoKuI= -github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= -github.com/cosmos/iavl v1.0.0-beta.2 h1:XOsIM80Yyml/KifCXEYOy9tWCXwMAbLa91n6pReW07Y= -github.com/cosmos/iavl v1.0.0-beta.2/go.mod h1:EA97dJ07TBktRlG/iGzK6g1eCXNj1q3MGoFYkVzrwHE= -github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= -github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/cosmos/cosmos-db v1.1.1 h1:FezFSU37AlBC8S98NlSagL76oqBRWq/prTPvFcEJNCM= +github.com/cosmos/cosmos-db v1.1.1/go.mod h1:AghjcIPqdhSLP/2Z0yha5xPH3nLnskz81pBx3tcVSAw= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= +github.com/cosmos/iavl v1.2.0 h1:kVxTmjTh4k0Dh1VNL046v6BXqKziqMDzxo93oh3kOfM= +github.com/cosmos/iavl v1.2.0/go.mod h1:HidWWLVAtODJqFD6Hbne2Y0q3SdxByJepHUOeoH4LiI= +github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= +github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= -github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= -github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= -github.com/emicklei/dot v1.4.2 h1:UbK6gX4yvrpHKlxuUQicwoAis4zl8Dzwit9SnbBAXWw= -github.com/emicklei/dot v1.4.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= -github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= +github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/emicklei/dot v1.6.2 h1:08GN+DD79cy/tzN6uLCT84+2Wk9u+wvqP+Hkx/dIR8A= +github.com/emicklei/dot v1.6.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= -github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= -github.com/getsentry/sentry-go v0.21.0 h1:c9l5F1nPF30JIppulk4veau90PK6Smu3abgVtVQWon4= -github.com/getsentry/sentry-go v0.21.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= -github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= -github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= -github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= +github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +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-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= -github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= -github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= -github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= -github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -139,128 +117,96 @@ github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:x github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= -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/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= +github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= 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= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= -github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= +github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0 h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-plugin v1.4.10 h1:xUbmA4jC6Dq163/fWcp8P3JuHilrHHMLNRxzGQJ9hNk= -github.com/hashicorp/go-plugin v1.4.10/go.mod h1:6/1TEzT0eQznvI/gV2CM29DLSkAK/e58mUWKVsPaph0= +github.com/hashicorp/go-metrics v0.5.4 h1:8mmPiIJkTPPEbAiV97IxdAGNdRdaWwVap1BU6elejKY= +github.com/hashicorp/go-metrics v0.5.4/go.mod h1:CG5yz4NZ/AI/aQt9Ucm/vdBnbh7fvmv4lxZ350i+QQI= +github.com/hashicorp/go-plugin v1.6.3 h1:xgHB+ZUSYeuJi96WtxEjzi23uh7YQpznjGh0U0UUrwg= +github.com/hashicorp/go-plugin v1.6.3/go.mod h1:MRobyh+Wc/nYy1V4KAXUiYfzxoYhs7V1mlH1Z7iY2h0= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= -github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= -github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= -github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= -github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= -github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= -github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= +github.com/jhump/protoreflect v1.15.3 h1:6SFRuqU45u9hIZPJAoZ8c28T3nK64BNdp9w6jFonzls= +github.com/jhump/protoreflect v1.15.3/go.mod h1:4ORHmSBmlCW8fh3xHmJMGyul1zNqZK4Elxc8qKP+p1k= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= -github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= -github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= -github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= -github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= 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/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI= -github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= 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.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= -github.com/linxGnu/grocksdb v1.7.16 h1:Q2co1xrpdkr5Hx3Fp+f+f7fRGhQFQhvi/+226dtLmA8= -github.com/linxGnu/grocksdb v1.7.16/go.mod h1:JkS7pl5qWpGpuVb3bPqTz8nC12X3YtPZT+Xq7+QfQo4= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= 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= -github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= +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/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= -github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -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/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= -github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= -github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= @@ -269,7 +215,6 @@ github.com/oasisprotocol/curve25519-voi v0.0.0-20220708102147-0a8a51822cae/go.mo github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= @@ -280,12 +225,11 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/onsi/gomega v1.26.0 h1:03cDLK28U6hWvCAns6NeydX3zIm4SF3ci69ulidS32Q= +github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20221215004737-a150e88a970d h1:htwtWgtQo8YS6JFWWi2DNgY0RwSGJ1ruMoxY6CUUclk= -github.com/petermattis/goid v0.0.0-20221215004737-a150e88a970d/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 h1:Dx7Ovyv/SFnMFw3fD4oEoeorXc6saIiQ23LrGLth0Gw= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= @@ -293,261 +237,198 @@ github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= -github.com/prometheus/client_golang v1.15.1 h1:8tXpTmJbyH5lydzFPoxSIJ0J46jdh3tylbvM1xCv0LI= -github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= +github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= -github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= -github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= -github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io= +github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.10.0 h1:UkG7GPYkO4UZyLnyXjaWYcgOSONqwdBqFUT95ugmt6I= -github.com/prometheus/procfs v0.10.0/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= -github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.29.1 h1:cO+d60CHkknCbvzEWxP0S9K6KqyTjrCNUy1LdQLCGPc= -github.com/rs/zerolog v1.29.1/go.mod h1:Le6ESbR7hc+DP6Lt1THiV8CQSdkkNrd3R0XbEgp3ZBU= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -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/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= +github.com/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb2NsU= +github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= -github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= +github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= -github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= -github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= +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= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= -github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= -github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= -github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= +github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= +go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= +go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY= +go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI= +go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ= +go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE= +go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A= +go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU= +go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk= +go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w= +go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k= +go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE= +go.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU= +go.uber.org/mock v0.5.0/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670 h1:18EFjUmQOcUvxNYSkA6jO9VAiXCnxFY6NyDX0bHDmkU= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/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-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= -golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= +golang.org/x/exp v0.0.0-20250218142911-aa4b98e5adaa h1:t2QcU6V556bFjYgu4L6C+6VrCPyJZ+eyRsABUPs1mz4= +golang.org/x/exp v0.0.0-20250218142911-aa4b98e5adaa/go.mod h1:BHOTPb3L19zxehTsLoJXVaTktb06DFgmdW6Wb9s8jqk= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= +golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 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-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-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181221001348-537d06c36207/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-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= 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= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f h1:OxYkA3wjPsZyBylwymxSHa7ViiW1Sml4ToBrncvFehI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f/go.mod h1:+2Yz8+CLJbIfL9z73EW45avw8Lmge3xVElCP9zEKi50= +google.golang.org/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg= +google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= +google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= -gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -555,15 +436,14 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -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= -gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= -gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= +gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q= +gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA= +nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= +pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= +pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/store/iavl/store.go b/store/iavl/store.go index f9e95fd6905b..7bdcb1df9177 100644 --- a/store/iavl/store.go +++ b/store/iavl/store.go @@ -18,6 +18,7 @@ import ( pruningtypes "cosmossdk.io/store/pruning/types" "cosmossdk.io/store/tracekv" "cosmossdk.io/store/types" + "cosmossdk.io/store/wrapper" ) const ( @@ -51,7 +52,7 @@ func LoadStore(db dbm.DB, logger log.Logger, key types.StoreKey, id types.Commit // provided DB. An error is returned if the version fails to load, or if called with a positive // version on an empty tree. func LoadStoreWithInitialVersion(db dbm.DB, logger log.Logger, key types.StoreKey, id types.CommitID, initialVersion uint64, cacheSize int, disableFastNode bool, metrics metrics.StoreMetrics) (types.CommitKVStore, error) { - tree := iavl.NewMutableTreeWithOpts(db, cacheSize, &iavl.Options{InitialVersion: initialVersion}, disableFastNode, logger) + tree := iavl.NewMutableTree(wrapper.NewDBWrapper(db), cacheSize, disableFastNode, logger, iavl.InitialVersionOption(initialVersion)) isUpgradeable, err := tree.IsUpgradeable() if err != nil { @@ -216,7 +217,10 @@ func (st *Store) Has(key []byte) (exists bool) { // Implements types.KVStore. func (st *Store) Delete(key []byte) { defer st.metrics.MeasureSince("store", "iavl", "delete") - st.tree.Remove(key) + _, _, err := st.tree.Remove(key) + if err != nil { + panic(err) + } } // DeleteVersionsTo deletes versions upto the given version from the MutableTree. An error @@ -360,7 +364,9 @@ func (st *Store) Query(req *types.RequestQuery) (res *types.ResponseQuery, err e for ; iterator.Valid(); iterator.Next() { pairs.Pairs = append(pairs.Pairs, kv.Pair{Key: iterator.Key(), Value: iterator.Value()}) } - iterator.Close() + if err := iterator.Close(); err != nil { + panic(fmt.Errorf("failed to close iterator: %w", err)) + } bz, err := pairs.Marshal() if err != nil { diff --git a/store/iavl/store_test.go b/store/iavl/store_test.go index 24f5ba9b8474..7ad24d7fe33d 100644 --- a/store/iavl/store_test.go +++ b/store/iavl/store_test.go @@ -4,18 +4,20 @@ import ( "bytes" crand "crypto/rand" "fmt" + "math" "sort" "testing" - "cosmossdk.io/log" dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/iavl" "github.com/stretchr/testify/require" + "cosmossdk.io/log" "cosmossdk.io/store/cachekv" "cosmossdk.io/store/internal/kv" "cosmossdk.io/store/metrics" "cosmossdk.io/store/types" + "cosmossdk.io/store/wrapper" ) var ( @@ -35,16 +37,19 @@ func randBytes(numBytes int) []byte { // make a tree with data from above and save it func newAlohaTree(t *testing.T, db dbm.DB) (*iavl.MutableTree, types.CommitID) { - tree := iavl.NewMutableTree(db, cacheSize, false, log.NewNopLogger()) + t.Helper() + tree := iavl.NewMutableTree(wrapper.NewDBWrapper(db), cacheSize, false, log.NewNopLogger()) for k, v := range treeData { - tree.Set([]byte(k), []byte(v)) + _, err := tree.Set([]byte(k), []byte(v)) + require.NoError(t, err) } for i := 0; i < nMoreData; i++ { key := randBytes(12) value := randBytes(50) - tree.Set(key, value) + _, err := tree.Set(key, value) + require.NoError(t, err) } hash, ver, err := tree.SaveVersion() @@ -281,7 +286,7 @@ func TestIAVLIterator(t *testing.T) { } func TestIAVLReverseIterator(t *testing.T) { - db := dbm.NewMemDB() + db := wrapper.NewDBWrapper(dbm.NewMemDB()) tree := iavl.NewMutableTree(db, cacheSize, false, log.NewNopLogger()) @@ -294,6 +299,7 @@ func TestIAVLReverseIterator(t *testing.T) { iavlStore.Set([]byte{0x01}, []byte("1")) testReverseIterator := func(t *testing.T, start, end []byte, expected []string) { + t.Helper() iter := iavlStore.ReverseIterator(start, end) var i int for i = 0; iter.Valid(); iter.Next() { @@ -314,7 +320,7 @@ func TestIAVLReverseIterator(t *testing.T) { } func TestIAVLPrefixIterator(t *testing.T) { - db := dbm.NewMemDB() + db := wrapper.NewDBWrapper(dbm.NewMemDB()) tree := iavl.NewMutableTree(db, cacheSize, false, log.NewNopLogger()) iavlStore := UnsafeNewStore(tree) @@ -377,7 +383,7 @@ func TestIAVLPrefixIterator(t *testing.T) { } func TestIAVLReversePrefixIterator(t *testing.T) { - db := dbm.NewMemDB() + db := wrapper.NewDBWrapper(dbm.NewMemDB()) tree := iavl.NewMutableTree(db, cacheSize, false, log.NewNopLogger()) iavlStore := UnsafeNewStore(tree) @@ -444,7 +450,7 @@ func nextVersion(iavl *Store) { } func TestIAVLNoPrune(t *testing.T) { - db := dbm.NewMemDB() + db := wrapper.NewDBWrapper(dbm.NewMemDB()) tree := iavl.NewMutableTree(db, cacheSize, false, log.NewNopLogger()) iavlStore := UnsafeNewStore(tree) @@ -462,7 +468,7 @@ func TestIAVLNoPrune(t *testing.T) { } func TestIAVLStoreQuery(t *testing.T) { - db := dbm.NewMemDB() + db := wrapper.NewDBWrapper(dbm.NewMemDB()) tree := iavl.NewMutableTree(db, cacheSize, false, log.NewNopLogger()) iavlStore := UnsafeNewStore(tree) @@ -574,14 +580,15 @@ func TestIAVLStoreQuery(t *testing.T) { func BenchmarkIAVLIteratorNext(b *testing.B) { b.ReportAllocs() - db := dbm.NewMemDB() + db := wrapper.NewDBWrapper(dbm.NewMemDB()) treeSize := 1000 tree := iavl.NewMutableTree(db, cacheSize, false, log.NewNopLogger()) for i := 0; i < treeSize; i++ { key := randBytes(4) value := randBytes(50) - tree.Set(key, value) + _, err := tree.Set(key, value) + require.NoError(b, err) } iavlStore := UnsafeNewStore(tree) @@ -609,7 +616,7 @@ func TestSetInitialVersion(t *testing.T) { { "works with a mutable tree", func(db *dbm.MemDB) *Store { - tree := iavl.NewMutableTree(db, cacheSize, false, log.NewNopLogger()) + tree := iavl.NewMutableTree(wrapper.NewDBWrapper(db), cacheSize, false, log.NewNopLogger()) store := UnsafeNewStore(tree) return store @@ -618,7 +625,7 @@ func TestSetInitialVersion(t *testing.T) { { "throws error on immutable tree", func(db *dbm.MemDB) *Store { - tree := iavl.NewMutableTree(db, cacheSize, false, log.NewNopLogger()) + tree := iavl.NewMutableTree(wrapper.NewDBWrapper(db), cacheSize, false, log.NewNopLogger()) store := UnsafeNewStore(tree) _, version, err := store.tree.SaveVersion() require.NoError(t, err) @@ -666,7 +673,7 @@ func TestChangeSets(t *testing.T) { treeSize := 1000 treeVersion := int64(10) targetVersion := int64(6) - tree := iavl.NewMutableTree(db, cacheSize, false, log.NewNopLogger()) + tree := iavl.NewMutableTree(wrapper.NewDBWrapper(db), cacheSize, false, log.NewNopLogger(), iavl.FlushThresholdOption(math.MaxInt)) for j := int64(0); j < treeVersion; j++ { keys := [][]byte{} diff --git a/store/iavl/tree.go b/store/iavl/tree.go index 2a8577f8f01d..889fc1d5a07f 100644 --- a/store/iavl/tree.go +++ b/store/iavl/tree.go @@ -3,8 +3,8 @@ package iavl import ( "fmt" - "cosmossdk.io/store/types" "github.com/cosmos/iavl" + idb "github.com/cosmos/iavl/db" ) var ( @@ -31,7 +31,7 @@ type ( GetVersioned(key []byte, version int64) ([]byte, error) GetImmutable(version int64) (*iavl.ImmutableTree, error) SetInitialVersion(version uint64) - Iterator(start, end []byte, ascending bool) (types.Iterator, error) + Iterator(start, end []byte, ascending bool) (idb.Iterator, error) AvailableVersions() []int LoadVersionForOverwriting(targetVersion int64) error TraverseStateChanges(startVersion, endVersion int64, fn func(version int64, changeSet *iavl.ChangeSet) error) error @@ -93,10 +93,6 @@ func (it *immutableTree) LoadVersionForOverwriting(targetVersion int64) error { panic("cannot call 'LoadVersionForOverwriting' on an immutable IAVL tree") } -func (it *immutableTree) LazyLoadVersionForOverwriting(targetVersion int64) (int64, error) { - panic("cannot call 'LazyLoadVersionForOverwriting' on an immutable IAVL tree") -} - func (it *immutableTree) WorkingHash() []byte { panic("cannot call 'WorkingHash' on an immutable IAVL tree") } diff --git a/store/iavl/tree_test.go b/store/iavl/tree_test.go index 0fdaf17de5b0..243355e42e08 100644 --- a/store/iavl/tree_test.go +++ b/store/iavl/tree_test.go @@ -3,21 +3,33 @@ package iavl import ( "testing" - "cosmossdk.io/log" dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/iavl" "github.com/stretchr/testify/require" + + "cosmossdk.io/log" + "cosmossdk.io/store/wrapper" ) func TestImmutableTreePanics(t *testing.T) { t.Parallel() - immTree := iavl.NewImmutableTree(dbm.NewMemDB(), 100, false, log.NewNopLogger()) + immTree := iavl.NewImmutableTree(wrapper.NewDBWrapper(dbm.NewMemDB()), 100, false, log.NewNopLogger()) it := &immutableTree{immTree} - require.Panics(t, func() { it.Set([]byte{}, []byte{}) }) - require.Panics(t, func() { it.Remove([]byte{}) }) + require.Panics(t, func() { + _, err := it.Set([]byte{}, []byte{}) + require.NoError(t, err) + }) + require.Panics(t, func() { + _, _, err := it.Remove([]byte{}) + require.NoError(t, err) + }) require.Panics(t, func() { _, _, _ = it.SaveVersion() }) require.Panics(t, func() { _ = it.DeleteVersionsTo(int64(1)) }) + val, err := it.GetVersioned(nil, 1) + require.Error(t, err) + require.Nil(t, val) + imm, err := it.GetImmutable(1) require.Error(t, err) require.Nil(t, imm) diff --git a/store/internal/conv/string.go b/store/internal/conv/string.go index ab2b7f44b38a..96d89c3a5fff 100644 --- a/store/internal/conv/string.go +++ b/store/internal/conv/string.go @@ -1,20 +1,13 @@ package conv import ( - "reflect" "unsafe" ) // UnsafeStrToBytes uses unsafe to convert string into byte array. Returned bytes // must not be altered after this function is called as it will cause a segmentation fault. func UnsafeStrToBytes(s string) []byte { - var buf []byte - sHdr := (*reflect.StringHeader)(unsafe.Pointer(&s)) - bufHdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) - bufHdr.Data = sHdr.Data - bufHdr.Cap = sHdr.Len - bufHdr.Len = sHdr.Len - return buf + return unsafe.Slice(unsafe.StringData(s), len(s)) // ref https://github.com/golang/go/issues/53003#issuecomment-1140276077 } // UnsafeBytesToStr is meant to make a zero allocation conversion diff --git a/store/internal/proofs/helpers.go b/store/internal/proofs/helpers.go index cad3acd5dc70..5dd1b54448c5 100644 --- a/store/internal/proofs/helpers.go +++ b/store/internal/proofs/helpers.go @@ -1,12 +1,12 @@ package proofs import ( - "sort" + "maps" + "slices" - "cosmossdk.io/math/unsafe" cmtprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" - "golang.org/x/exp/maps" + "cosmossdk.io/math/unsafe" sdkmaps "cosmossdk.io/store/internal/maps" ) @@ -47,9 +47,7 @@ const ( ) func SortedKeys(data map[string][]byte) []string { - keys := maps.Keys(data) - sort.Strings(keys) - return keys + return slices.Sorted(maps.Keys(data)) } func CalcRoot(data map[string][]byte) []byte { diff --git a/store/listenkv/store_test.go b/store/listenkv/store_test.go index 9a56ffedbc34..51b88912c2e1 100644 --- a/store/listenkv/store_test.go +++ b/store/listenkv/store_test.go @@ -4,15 +4,14 @@ import ( "fmt" "testing" + dbm "github.com/cosmos/cosmos-db" + "github.com/stretchr/testify/require" + "cosmossdk.io/store/dbadapter" "cosmossdk.io/store/internal/kv" "cosmossdk.io/store/listenkv" "cosmossdk.io/store/prefix" "cosmossdk.io/store/types" - - "github.com/stretchr/testify/require" - - dbm "github.com/cosmos/cosmos-db" ) func bz(s string) []byte { return []byte(s) } diff --git a/store/mem/mem_test.go b/store/mem/mem_test.go index 254193192b8f..6595b45dce17 100644 --- a/store/mem/mem_test.go +++ b/store/mem/mem_test.go @@ -3,12 +3,11 @@ package mem_test import ( "testing" - "cosmossdk.io/store/cachekv" - pruningtypes "cosmossdk.io/store/pruning/types" - "github.com/stretchr/testify/require" + "cosmossdk.io/store/cachekv" "cosmossdk.io/store/mem" + pruningtypes "cosmossdk.io/store/pruning/types" "cosmossdk.io/store/types" ) diff --git a/store/metrics/telemetry.go b/store/metrics/telemetry.go index bdea79ffd0f0..d5bc55c45b9b 100644 --- a/store/metrics/telemetry.go +++ b/store/metrics/telemetry.go @@ -3,7 +3,7 @@ package metrics import ( "time" - "github.com/armon/go-metrics" + "github.com/hashicorp/go-metrics" ) // StoreMetrics defines the set of metrics for the store package @@ -37,7 +37,7 @@ func NewMetrics(labels [][]string) Metrics { return gatherer } -// MeasureSince provides a wrapper functionality for emitting a a time measure +// MeasureSince provides a wrapper functionality for emitting a time measure // metric with global labels (if any). func (m Metrics) MeasureSince(keys ...string) { start := time.Now() diff --git a/store/mock/cosmos_cosmos_db_DB.go b/store/mock/cosmos_cosmos_db_DB.go index 4a79ee7956d4..29a6709b39ae 100644 --- a/store/mock/cosmos_cosmos_db_DB.go +++ b/store/mock/cosmos_cosmos_db_DB.go @@ -8,7 +8,7 @@ import ( reflect "reflect" db "github.com/cosmos/cosmos-db" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockDB is a mock of DB interface. diff --git a/store/prefix/store_test.go b/store/prefix/store_test.go index 3f03614b7c67..738835770425 100644 --- a/store/prefix/store_test.go +++ b/store/prefix/store_test.go @@ -4,18 +4,17 @@ import ( "crypto/rand" "testing" - "cosmossdk.io/store/cachekv" - dbm "github.com/cosmos/cosmos-db" - "github.com/stretchr/testify/require" - tiavl "github.com/cosmos/iavl" + "github.com/stretchr/testify/require" "cosmossdk.io/log" + "cosmossdk.io/store/cachekv" "cosmossdk.io/store/dbadapter" "cosmossdk.io/store/gaskv" "cosmossdk.io/store/iavl" "cosmossdk.io/store/types" + "cosmossdk.io/store/wrapper" ) // copied from iavl/store_test.go @@ -31,6 +30,7 @@ type kvpair struct { } func genRandomKVPairs(t *testing.T) []kvpair { + t.Helper() kvps := make([]kvpair, 20) for i := 0; i < 20; i++ { @@ -46,6 +46,7 @@ func genRandomKVPairs(t *testing.T) []kvpair { } func setRandomKVPairs(t *testing.T, store types.KVStore) []kvpair { + t.Helper() kvps := genRandomKVPairs(t) for _, kvp := range kvps { store.Set(kvp.key, kvp.value) @@ -54,6 +55,7 @@ func setRandomKVPairs(t *testing.T, store types.KVStore) []kvpair { } func testPrefixStore(t *testing.T, baseStore types.KVStore, prefix []byte) { + t.Helper() prefixStore := NewStore(baseStore, prefix) prefixPrefixStore := NewStore(prefixStore, []byte("prefix")) @@ -89,7 +91,7 @@ func testPrefixStore(t *testing.T, baseStore types.KVStore, prefix []byte) { } func TestIAVLStorePrefix(t *testing.T) { - db := dbm.NewMemDB() + db := wrapper.NewDBWrapper(dbm.NewMemDB()) tree := tiavl.NewMutableTree(db, cacheSize, false, log.NewNopLogger()) iavlStore := iavl.UnsafeNewStore(tree) @@ -254,33 +256,39 @@ func mockStoreWithStuff() types.KVStore { } func checkValue(t *testing.T, store types.KVStore, key, expected []byte) { + t.Helper() bz := store.Get(key) require.Equal(t, expected, bz) } func checkValid(t *testing.T, itr types.Iterator, expected bool) { + t.Helper() valid := itr.Valid() require.Equal(t, expected, valid) } func checkNext(t *testing.T, itr types.Iterator, expected bool) { + t.Helper() itr.Next() valid := itr.Valid() require.Equal(t, expected, valid) } func checkDomain(t *testing.T, itr types.Iterator, start, end []byte) { + t.Helper() ds, de := itr.Domain() require.Equal(t, start, ds) require.Equal(t, end, de) } func checkItem(t *testing.T, itr types.Iterator, key, value []byte) { + t.Helper() require.Exactly(t, key, itr.Key()) require.Exactly(t, value, itr.Value()) } func checkInvalid(t *testing.T, itr types.Iterator) { + t.Helper() checkValid(t, itr, false) checkKeyPanics(t, itr) checkValuePanics(t, itr) @@ -288,14 +296,17 @@ func checkInvalid(t *testing.T, itr types.Iterator) { } func checkKeyPanics(t *testing.T, itr types.Iterator) { + t.Helper() require.Panics(t, func() { itr.Key() }) } func checkValuePanics(t *testing.T, itr types.Iterator) { + t.Helper() require.Panics(t, func() { itr.Value() }) } func checkNextPanics(t *testing.T, itr types.Iterator) { + t.Helper() require.Panics(t, func() { itr.Next() }) } diff --git a/store/pruning/manager.go b/store/pruning/manager.go index cd85319e5a66..9a99e4915136 100644 --- a/store/pruning/manager.go +++ b/store/pruning/manager.go @@ -6,9 +6,9 @@ import ( "sort" "sync" - "cosmossdk.io/log" dbm "github.com/cosmos/cosmos-db" + "cosmossdk.io/log" "cosmossdk.io/store/pruning/types" ) @@ -21,7 +21,7 @@ type Manager struct { opts types.PruningOptions snapshotInterval uint64 // Snapshots are taken in a separate goroutine from the regular execution - // and can be delivered asynchrounously via HandleHeightSnapshot. + // and can be delivered asynchrounously via HandleSnapshotHeight. // Therefore, we sync access to pruneSnapshotHeights with this mutex. pruneSnapshotHeightsMx sync.RWMutex // These are the heights that are multiples of snapshotInterval and kept for state sync snapshots. @@ -65,11 +65,11 @@ func (m *Manager) GetOptions() types.PruningOptions { return m.opts } -// HandleHeightSnapshot persists the snapshot height to be pruned at the next appropriate -// height defined by the pruning strategy. Flushes the update to disk and panics if the flush fails. -// The input height must be greater than 0 and pruning strategy any but pruning nothing. -// If one of these conditions is not met, this function does nothing. -func (m *Manager) HandleHeightSnapshot(height int64) { +// HandleSnapshotHeight persists the snapshot height to be pruned at the next appropriate +// height defined by the pruning strategy. It flushes the update to disk and panics if the flush fails. +// The input height must be greater than 0, and the pruning strategy must not be set to pruning nothing. +// If either of these conditions is not met, this function does nothing. +func (m *Manager) HandleSnapshotHeight(height int64) { if m.opts.GetPruningStrategy() == types.PruningNothing || height <= 0 { return } @@ -77,7 +77,7 @@ func (m *Manager) HandleHeightSnapshot(height int64) { m.pruneSnapshotHeightsMx.Lock() defer m.pruneSnapshotHeightsMx.Unlock() - m.logger.Debug("HandleHeightSnapshot", "height", height) + m.logger.Debug("HandleSnapshotHeight", "height", height) m.pruneSnapshotHeights = append(m.pruneSnapshotHeights, height) sort.Slice(m.pruneSnapshotHeights, func(i, j int) bool { return m.pruneSnapshotHeights[i] < m.pruneSnapshotHeights[j] }) k := 1 @@ -118,7 +118,7 @@ func (m *Manager) GetPruningHeight(height int64) int64 { m.pruneSnapshotHeightsMx.RLock() defer m.pruneSnapshotHeightsMx.RUnlock() - // - snapshotInterval is zero as that means that all heights can be pruned. + // snapshotInterval is zero, indicating that all heights can be pruned if m.snapshotInterval <= 0 { return pruneHeight } diff --git a/store/pruning/manager_test.go b/store/pruning/manager_test.go index aa307725dc1a..d25f22c61931 100644 --- a/store/pruning/manager_test.go +++ b/store/pruning/manager_test.go @@ -5,11 +5,11 @@ import ( "fmt" "testing" - "cosmossdk.io/log" db "github.com/cosmos/cosmos-db" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" + "cosmossdk.io/log" "cosmossdk.io/store/mock" "cosmossdk.io/store/pruning" "cosmossdk.io/store/pruning/types" @@ -111,7 +111,7 @@ func TestStrategies(t *testing.T) { for curHeight := int64(0); curHeight < 110000; curHeight++ { if tc.snapshotInterval != 0 { if curHeight > int64(tc.snapshotInterval) && curHeight%int64(tc.snapshotInterval) == int64(tc.snapshotInterval)-1 { - manager.HandleHeightSnapshot(curHeight - int64(tc.snapshotInterval) + 1) + manager.HandleSnapshotHeight(curHeight - int64(tc.snapshotInterval) + 1) snHeight = curHeight } } @@ -214,10 +214,10 @@ func TestHandleSnapshotHeight_DbErr_Panic(t *testing.T) { } }() - manager.HandleHeightSnapshot(10) + manager.HandleSnapshotHeight(10) } -func TestHandleHeightSnapshot_LoadFromDisk(t *testing.T) { +func TestHandleSnapshotHeight_LoadFromDisk(t *testing.T) { snapshotInterval := uint64(10) // Setup @@ -233,7 +233,7 @@ func TestHandleHeightSnapshot_LoadFromDisk(t *testing.T) { snapshotHeightStr := fmt.Sprintf("snaphost height: %d", snapshotHeight) if snapshotHeight > int64(snapshotInterval) && snapshotHeight%int64(snapshotInterval) == 1 { // Test flush - manager.HandleHeightSnapshot(snapshotHeight - 1) + manager.HandleSnapshotHeight(snapshotHeight - 1) expected = 1 } @@ -251,27 +251,6 @@ func TestHandleHeightSnapshot_LoadFromDisk(t *testing.T) { } } -func TestHandleHeightSnapshot_DbErr_Panic(t *testing.T) { - ctrl := gomock.NewController(t) - - // Setup - dbMock := mock.NewMockDB(ctrl) - - dbMock.EXPECT().SetSync(gomock.Any(), gomock.Any()).Return(errors.New(dbErr)).Times(1) - - manager := pruning.NewManager(dbMock, log.NewNopLogger()) - manager.SetOptions(types.NewPruningOptions(types.PruningEverything)) - require.NotNil(t, manager) - - defer func() { - if r := recover(); r == nil { - t.Fail() - } - }() - - manager.HandleHeightSnapshot(10) -} - func TestLoadPruningSnapshotHeights(t *testing.T) { var ( manager = pruning.NewManager(db.NewMemDB(), log.NewNopLogger()) diff --git a/store/rootmulti/dbadapter.go b/store/rootmulti/dbadapter.go index 4f32ada4e9ff..65cd41c66a28 100644 --- a/store/rootmulti/dbadapter.go +++ b/store/rootmulti/dbadapter.go @@ -2,9 +2,8 @@ package rootmulti import ( "cosmossdk.io/store/dbadapter" - "cosmossdk.io/store/types" - pruningtypes "cosmossdk.io/store/pruning/types" + "cosmossdk.io/store/types" ) var commithash = []byte("FAKE_HASH") diff --git a/store/rootmulti/proof_test.go b/store/rootmulti/proof_test.go index e92a6c5b50d1..d573937c3d08 100644 --- a/store/rootmulti/proof_test.go +++ b/store/rootmulti/proof_test.go @@ -3,12 +3,13 @@ package rootmulti import ( "testing" + dbm "github.com/cosmos/cosmos-db" + "github.com/stretchr/testify/require" + "cosmossdk.io/log" "cosmossdk.io/store/iavl" "cosmossdk.io/store/metrics" "cosmossdk.io/store/types" - dbm "github.com/cosmos/cosmos-db" - "github.com/stretchr/testify/require" ) func TestVerifyIAVLStoreQueryProof(t *testing.T) { diff --git a/store/rootmulti/snapshot_test.go b/store/rootmulti/snapshot_test.go index cecb61202f0d..635be92970a3 100644 --- a/store/rootmulti/snapshot_test.go +++ b/store/rootmulti/snapshot_test.go @@ -10,17 +10,17 @@ import ( "math/rand" "testing" - "cosmossdk.io/log" + dbm "github.com/cosmos/cosmos-db" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "cosmossdk.io/log" "cosmossdk.io/store/iavl" "cosmossdk.io/store/metrics" "cosmossdk.io/store/rootmulti" "cosmossdk.io/store/snapshots" snapshottypes "cosmossdk.io/store/snapshots/types" "cosmossdk.io/store/types" - dbm "github.com/cosmos/cosmos-db" ) func newMultiStoreWithGeneratedData(db dbm.DB, stores uint8, storeKeys uint64) *rootmulti.Store { @@ -33,7 +33,10 @@ func newMultiStoreWithGeneratedData(db dbm.DB, stores uint8, storeKeys uint64) * multiStore.MountStoreWithDB(key, types.StoreTypeIAVL, nil) keys = append(keys, key) } - multiStore.LoadLatestVersion() + err := multiStore.LoadLatestVersion() + if err != nil { + panic(err) + } for _, key := range keys { store := multiStore.GetCommitKVStore(key).(*iavl.Store) @@ -50,7 +53,10 @@ func newMultiStoreWithGeneratedData(db dbm.DB, stores uint8, storeKeys uint64) * } multiStore.Commit() - multiStore.LoadLatestVersion() + err = multiStore.LoadLatestVersion() + if err != nil { + panic(err) + } return multiStore } @@ -61,8 +67,9 @@ func newMultiStoreWithMixedMounts(db dbm.DB) *rootmulti.Store { store.MountStoreWithDB(types.NewKVStoreKey("iavl2"), types.StoreTypeIAVL, nil) store.MountStoreWithDB(types.NewKVStoreKey("iavl3"), types.StoreTypeIAVL, nil) store.MountStoreWithDB(types.NewTransientStoreKey("trans1"), types.StoreTypeTransient, nil) - store.LoadLatestVersion() - + if err := store.LoadLatestVersion(); err != nil { + panic(err) + } return store } @@ -93,6 +100,7 @@ func newMultiStoreWithMixedMountsAndBasicData(db dbm.DB) *rootmulti.Store { } func assertStoresEqual(t *testing.T, expect, actual types.CommitKVStore, msgAndArgs ...interface{}) { + t.Helper() assert.Equal(t, expect.LastCommitID(), actual.LastCommitID()) expectIter := expect.Iterator(nil, nil) expectMap := map[string][]byte{} @@ -226,6 +234,7 @@ func TestMultistoreSnapshotRestore(t *testing.T) { } func benchmarkMultistoreSnapshot(b *testing.B, stores uint8, storeKeys uint64) { + b.Helper() b.Skip("Noisy with slow setup time, please see https://github.com/cosmos/cosmos-sdk/issues/8855.") b.ReportAllocs() @@ -261,6 +270,7 @@ func benchmarkMultistoreSnapshot(b *testing.B, stores uint8, storeKeys uint64) { } func benchmarkMultistoreSnapshotRestore(b *testing.B, stores uint8, storeKeys uint64) { + b.Helper() b.Skip("Noisy with slow setup time, please see https://github.com/cosmos/cosmos-sdk/issues/8855.") b.ReportAllocs() diff --git a/store/rootmulti/store.go b/store/rootmulti/store.go index 473c8bc3f715..94336bc5faa8 100644 --- a/store/rootmulti/store.go +++ b/store/rootmulti/store.go @@ -1,6 +1,7 @@ package rootmulti import ( + "crypto/sha256" "errors" "fmt" "io" @@ -9,7 +10,6 @@ import ( "strings" "sync" - "cosmossdk.io/log" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" dbm "github.com/cosmos/cosmos-db" protoio "github.com/cosmos/gogoproto/io" @@ -17,6 +17,7 @@ import ( iavltree "github.com/cosmos/iavl" errorsmod "cosmossdk.io/errors" + "cosmossdk.io/log" "cosmossdk.io/store/cachemulti" "cosmossdk.io/store/dbadapter" "cosmossdk.io/store/iavl" @@ -314,7 +315,9 @@ func deleteKVStore(kv types.KVStore) error { keys = append(keys, itr.Key()) itr.Next() } - itr.Close() + if err := itr.Close(); err != nil { + return err + } for _, k := range keys { kv.Delete(k) @@ -330,17 +333,19 @@ func moveKVStoreData(oldDB, newDB types.KVStore) error { newDB.Set(itr.Key(), itr.Value()) itr.Next() } - itr.Close() + if err := itr.Close(); err != nil { + return err + } // then delete the old store return deleteKVStore(oldDB) } // PruneSnapshotHeight prunes the given height according to the prune strategy. -// If PruneNothing, this is a no-op. -// If other strategy, this height is persisted until the snapshot is operated. +// If the strategy is PruneNothing, this is a no-op. +// For other strategies, this height is persisted until the snapshot is operated. func (rs *Store) PruneSnapshotHeight(height int64) { - rs.pruningManager.HandleHeightSnapshot(height) + rs.pruningManager.HandleSnapshotHeight(height) } // SetInterBlockCache sets the Store's internal inter-block (persistent) cache. @@ -434,8 +439,19 @@ func (rs *Store) LatestVersion() int64 { // LastCommitID implements Committer/CommitStore. func (rs *Store) LastCommitID() types.CommitID { if rs.lastCommitInfo == nil { + emptyHash := sha256.Sum256([]byte{}) + appHash := emptyHash[:] return types.CommitID{ Version: GetLatestVersion(rs.db), + Hash: appHash, // set empty apphash to sha256([]byte{}) if info is nil + } + } + if len(rs.lastCommitInfo.CommitID().Hash) == 0 { + emptyHash := sha256.Sum256([]byte{}) + appHash := emptyHash[:] + return types.CommitID{ + Version: rs.lastCommitInfo.Version, + Hash: appHash, // set empty apphash to sha256([]byte{}) if hash is nil } } @@ -480,7 +496,10 @@ func (rs *Store) Commit() types.CommitID { rs.removalMap = make(map[types.StoreKey]bool) if err := rs.handlePruning(version); err != nil { - panic(err) + rs.logger.Error( + "failed to prune store, please check your pruning configuration", + "err", err, + ) } return types.CommitID{ @@ -646,15 +665,15 @@ func (rs *Store) GetKVStore(key types.StoreKey) types.KVStore { func (rs *Store) handlePruning(version int64) error { pruneHeight := rs.pruningManager.GetPruningHeight(version) - rs.logger.Info("prune start", "height", version) - defer rs.logger.Info("prune end", "height", version) + rs.logger.Debug("prune start", "height", version) + defer rs.logger.Debug("prune end", "height", version) return rs.PruneStores(pruneHeight) } // PruneStores prunes all history upto the specific height of the multi store. func (rs *Store) PruneStores(pruningHeight int64) (err error) { if pruningHeight <= 0 { - rs.logger.Debug("pruning skipped, height is smaller than 0") + rs.logger.Debug("pruning skipped, height is less than or equal to 0") return nil } @@ -676,9 +695,11 @@ func (rs *Store) PruneStores(pruningHeight int64) (err error) { continue } - if errors.Is(err, iavltree.ErrVersionDoesNotExist) && err != nil { + if errors.Is(err, iavltree.ErrVersionDoesNotExist) { return err } + + rs.logger.Error("failed to prune store", "key", key, "err", err) } return nil } @@ -1037,7 +1058,8 @@ func (rs *Store) buildCommitInfo(version int64) *types.CommitInfo { storeInfos := []types.StoreInfo{} for _, key := range keys { store := rs.stores[key] - if store.GetStoreType() == types.StoreTypeTransient { + storeType := store.GetStoreType() + if storeType == types.StoreTypeTransient || storeType == types.StoreTypeMemory { continue } storeInfos = append(storeInfos, types.StoreInfo{ @@ -1103,7 +1125,9 @@ func (rs *Store) GetCommitInfo(ver int64) (*types.CommitInfo, error) { func (rs *Store) flushMetadata(db dbm.DB, version int64, cInfo *types.CommitInfo) { rs.logger.Debug("flushing metadata", "height", version) batch := db.NewBatch() - defer batch.Close() + defer func() { + _ = batch.Close() + }() if cInfo != nil { flushCommitInfo(batch, version, cInfo) @@ -1202,7 +1226,10 @@ func flushCommitInfo(batch dbm.Batch, version int64, cInfo *types.CommitInfo) { } cInfoKey := fmt.Sprintf(commitInfoKeyFmt, version) - batch.Set([]byte(cInfoKey), bz) + err = batch.Set([]byte(cInfoKey), bz) + if err != nil { + panic(err) + } } func flushLatestVersion(batch dbm.Batch, version int64) { @@ -1211,5 +1238,8 @@ func flushLatestVersion(batch dbm.Batch, version int64) { panic(err) } - batch.Set([]byte(latestVersionKey), bz) + err = batch.Set([]byte(latestVersionKey), bz) + if err != nil { + panic(err) + } } diff --git a/store/rootmulti/store_test.go b/store/rootmulti/store_test.go index f8845ad1d164..2702f3e08623 100644 --- a/store/rootmulti/store_test.go +++ b/store/rootmulti/store_test.go @@ -2,15 +2,16 @@ package rootmulti import ( "bytes" + "crypto/sha256" "fmt" "testing" "time" - "cosmossdk.io/errors" - "cosmossdk.io/log" dbm "github.com/cosmos/cosmos-db" "github.com/stretchr/testify/require" + "cosmossdk.io/errors" + "cosmossdk.io/log" "cosmossdk.io/store/cachemulti" "cosmossdk.io/store/iavl" sdkmaps "cosmossdk.io/store/internal/maps" @@ -72,7 +73,9 @@ func TestCacheMultiStoreWithVersion(t *testing.T) { err := ms.LoadLatestVersion() require.Nil(t, err) - commitID := types.CommitID{} + emptyHash := sha256.Sum256([]byte{}) + appHash := emptyHash[:] + commitID := types.CommitID{Hash: appHash} checkStore(t, ms, commitID, commitID) k, v := []byte("wind"), []byte("blows") @@ -120,7 +123,9 @@ func TestHashStableWithEmptyCommit(t *testing.T) { err := ms.LoadLatestVersion() require.Nil(t, err) - commitID := types.CommitID{} + emptyHash := sha256.Sum256([]byte{}) + appHash := emptyHash[:] + commitID := types.CommitID{Hash: appHash} checkStore(t, ms, commitID, commitID) k, v := []byte("wind"), []byte("blows") @@ -148,8 +153,10 @@ func TestMultistoreCommitLoad(t *testing.T) { err := store.LoadLatestVersion() require.Nil(t, err) + emptyHash := sha256.Sum256([]byte{}) + appHash := emptyHash[:] // New store has empty last commit. - commitID := types.CommitID{} + commitID := types.CommitID{Hash: appHash} checkStore(t, store, commitID, commitID) // Make sure we can get stores by name. @@ -648,7 +655,8 @@ func TestSetInitialVersion(t *testing.T) { require.NoError(t, multi.LoadLatestVersion()) - multi.SetInitialVersion(5) + err := multi.SetInitialVersion(5) + require.NoError(t, err) require.Equal(t, int64(5), multi.initialVersion) multi.Commit() @@ -743,7 +751,9 @@ func TestCommitOrdered(t *testing.T) { err := multi.LoadLatestVersion() require.Nil(t, err) - commitID := types.CommitID{} + emptyHash := sha256.Sum256([]byte{}) + appHash := emptyHash[:] + commitID := types.CommitID{Hash: appHash} checkStore(t, multi, commitID, commitID) k, v := []byte("wind"), []byte("blows") @@ -820,26 +830,27 @@ func unmountStore(rootStore *Store, storeKeyName string) { } func checkStore(t *testing.T, store *Store, expect, got types.CommitID) { + t.Helper() require.Equal(t, expect, got) require.Equal(t, expect, store.LastCommitID()) } -func checkContains(t testing.TB, info []types.StoreInfo, wanted []string) { - t.Helper() +func checkContains(tb testing.TB, info []types.StoreInfo, wanted []string) { + tb.Helper() for _, want := range wanted { - checkHas(t, info, want) + checkHas(tb, info, want) } } -func checkHas(t testing.TB, info []types.StoreInfo, want string) { - t.Helper() +func checkHas(tb testing.TB, info []types.StoreInfo, want string) { + tb.Helper() for _, i := range info { if i.Name == want { return } } - t.Fatalf("storeInfo doesn't contain %s", want) + tb.Fatalf("storeInfo doesn't contain %s", want) } func getExpectedCommitID(store *Store, ver int64) types.CommitID { @@ -915,13 +926,15 @@ func (stub *commitKVStoreStub) Commit() types.CommitID { return commitID } -func prepareStoreMap() map[types.StoreKey]types.CommitKVStore { +func prepareStoreMap() (map[types.StoreKey]types.CommitKVStore, error) { var db dbm.DB = dbm.NewMemDB() store := NewStore(db, log.NewNopLogger(), metrics.NewNoOpMetrics()) store.MountStoreWithDB(types.NewKVStoreKey("iavl1"), types.StoreTypeIAVL, nil) store.MountStoreWithDB(types.NewKVStoreKey("iavl2"), types.StoreTypeIAVL, nil) store.MountStoreWithDB(types.NewTransientStoreKey("trans1"), types.StoreTypeTransient, nil) - store.LoadLatestVersion() + if err := store.LoadLatestVersion(); err != nil { + return nil, err + } return map[types.StoreKey]types.CommitKVStore{ testStoreKey1: &commitKVStoreStub{ CommitKVStore: store.GetStoreByName("iavl1").(types.CommitKVStore), @@ -932,7 +945,7 @@ func prepareStoreMap() map[types.StoreKey]types.CommitKVStore { testStoreKey3: &commitKVStoreStub{ CommitKVStore: store.GetStoreByName("trans1").(types.CommitKVStore), }, - } + }, nil } func TestCommitStores(t *testing.T) { @@ -959,7 +972,8 @@ func TestCommitStores(t *testing.T) { } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - storeMap := prepareStoreMap() + storeMap, err := prepareStoreMap() + require.NoError(t, err) store := storeMap[testStoreKey1].(*commitKVStoreStub) for i := tc.committed; i > 0; i-- { store.Commit() diff --git a/store/snapshots/chunk.go b/store/snapshots/chunk.go index 7cfce6330219..fdf8cbd4b9a5 100644 --- a/store/snapshots/chunk.go +++ b/store/snapshots/chunk.go @@ -59,11 +59,13 @@ func (w *ChunkWriter) Close() error { // CloseWithError closes the writer and sends an error to the reader. func (w *ChunkWriter) CloseWithError(err error) { if !w.closed { + if w.pipe == nil { + // create a dummy pipe just to propagate the error to the reader, it always returns nil + _ = w.chunk() + } w.closed = true close(w.ch) - if w.pipe != nil { - _ = w.pipe.CloseWithError(err) // CloseWithError always returns nil - } + _ = w.pipe.CloseWithError(err) // CloseWithError always returns nil } } diff --git a/store/snapshots/helpers_test.go b/store/snapshots/helpers_test.go index 0cb307642a0c..d337b53ab79b 100644 --- a/store/snapshots/helpers_test.go +++ b/store/snapshots/helpers_test.go @@ -11,12 +11,12 @@ import ( "testing" "time" - "cosmossdk.io/log" db "github.com/cosmos/cosmos-db" protoio "github.com/cosmos/gogoproto/io" "github.com/stretchr/testify/require" errorsmod "cosmossdk.io/errors" + "cosmossdk.io/log" "cosmossdk.io/store/snapshots" snapshottypes "cosmossdk.io/store/snapshots/types" "cosmossdk.io/store/types" @@ -171,9 +171,42 @@ func (m *mockSnapshotter) SetSnapshotInterval(snapshotInterval uint64) { m.snapshotInterval = snapshotInterval } +type mockErrorSnapshotter struct{} + +var _ snapshottypes.Snapshotter = (*mockErrorSnapshotter)(nil) + +func (m *mockErrorSnapshotter) Snapshot(height uint64, protoWriter protoio.Writer) error { + return errors.New("mock snapshot error") +} + +func (m *mockErrorSnapshotter) Restore( + height uint64, format uint32, protoReader protoio.Reader, +) (snapshottypes.SnapshotItem, error) { + return snapshottypes.SnapshotItem{}, errors.New("mock restore error") +} + +func (m *mockErrorSnapshotter) SnapshotFormat() uint32 { + return snapshottypes.CurrentFormat +} + +func (m *mockErrorSnapshotter) SupportedFormats() []uint32 { + return []uint32{snapshottypes.CurrentFormat} +} + +func (m *mockErrorSnapshotter) PruneSnapshotHeight(height int64) { +} + +func (m *mockErrorSnapshotter) GetSnapshotInterval() uint64 { + return 0 +} + +func (m *mockErrorSnapshotter) SetSnapshotInterval(snapshotInterval uint64) { +} + // setupBusyManager creates a manager with an empty store that is busy creating a snapshot at height 1. // The snapshot will complete when the returned closer is called. func setupBusyManager(t *testing.T) *snapshots.Manager { + t.Helper() store, err := snapshots.NewStore(db.NewMemDB(), t.TempDir()) require.NoError(t, err) hung := newHungSnapshotter() @@ -291,14 +324,14 @@ func (s *extSnapshotter) RestoreExtension(height uint64, format uint32, payloadR } // GetTempDir returns a writable temporary director for the test to use. -func GetTempDir(t testing.TB) string { - t.Helper() +func GetTempDir(tb testing.TB) string { + tb.Helper() // os.MkDir() is used instead of testing.T.TempDir() // see https://github.com/cosmos/cosmos-sdk/pull/8475 and // https://github.com/cosmos/cosmos-sdk/pull/10341 for // this change's rationale. tempdir, err := os.MkdirTemp("", "") - require.NoError(t, err) - t.Cleanup(func() { _ = os.RemoveAll(tempdir) }) + require.NoError(tb, err) + tb.Cleanup(func() { _ = os.RemoveAll(tempdir) }) return tempdir } diff --git a/store/snapshots/manager.go b/store/snapshots/manager.go index 57e6a8f18af5..3bedcd3ae001 100644 --- a/store/snapshots/manager.go +++ b/store/snapshots/manager.go @@ -11,9 +11,8 @@ import ( "sort" "sync" - "cosmossdk.io/log" - errorsmod "cosmossdk.io/errors" + "cosmossdk.io/log" "cosmossdk.io/store/snapshots/types" storetypes "cosmossdk.io/store/types" ) @@ -515,7 +514,8 @@ func (m *Manager) SnapshotIfApplicable(height int64) { m.logger.Debug("snapshot is skipped", "height", height) return } - m.snapshot(height) + // start the routine after need to create a snapshot + go m.snapshot(height) } // shouldTakeSnapshot returns true is snapshot should be taken at height. @@ -551,3 +551,8 @@ func (m *Manager) snapshot(height int64) { m.logger.Debug("pruned state snapshots", "pruned", pruned) } } + +// Close the snapshot database. +func (m *Manager) Close() error { + return m.store.db.Close() +} diff --git a/store/snapshots/manager_test.go b/store/snapshots/manager_test.go index d18696d12855..49f31e86272b 100644 --- a/store/snapshots/manager_test.go +++ b/store/snapshots/manager_test.go @@ -4,6 +4,7 @@ import ( "errors" "testing" + db "github.com/cosmos/cosmos-db" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -34,6 +35,8 @@ func TestManager_List(t *testing.T) { list, err := manager.List() require.NoError(t, err) assert.Equal(t, []*types.Snapshot{}, list) + + require.NoError(t, manager.Close()) } func TestManager_LoadChunk(t *testing.T) { @@ -243,3 +246,13 @@ func TestManager_Restore(t *testing.T) { }) require.NoError(t, err) } + +func TestManager_TakeError(t *testing.T) { + snapshotter := &mockErrorSnapshotter{} + store, err := snapshots.NewStore(db.NewMemDB(), GetTempDir(t)) + require.NoError(t, err) + manager := snapshots.NewManager(store, opts, snapshotter, nil, log.NewNopLogger()) + + _, err = manager.Create(1) + require.Error(t, err) +} diff --git a/store/snapshots/store_test.go b/store/snapshots/store_test.go index 2fe1d656d8a3..f4ff0ef74df2 100644 --- a/store/snapshots/store_test.go +++ b/store/snapshots/store_test.go @@ -16,6 +16,7 @@ import ( ) func setupStore(t *testing.T) *snapshots.Store { + t.Helper() store, err := snapshots.NewStore(db.NewMemDB(), GetTempDir(t)) require.NoError(t, err) diff --git a/store/snapshots/stream.go b/store/snapshots/stream.go index 9c4c8a9412b5..e010f9224468 100644 --- a/store/snapshots/stream.go +++ b/store/snapshots/stream.go @@ -5,9 +5,10 @@ import ( "compress/zlib" "io" - "cosmossdk.io/errors" protoio "github.com/cosmos/gogoproto/io" "github.com/cosmos/gogoproto/proto" + + "cosmossdk.io/errors" ) const ( diff --git a/store/snapshots/types/convert.go b/store/snapshots/types/convert.go index 71b3d0642b3b..90deead3bfa8 100644 --- a/store/snapshots/types/convert.go +++ b/store/snapshots/types/convert.go @@ -1,9 +1,10 @@ package types import ( - "cosmossdk.io/errors" abci "github.com/cometbft/cometbft/abci/types" proto "github.com/cosmos/gogoproto/proto" + + "cosmossdk.io/errors" ) // Converts an ABCI snapshot to a snapshot. Mainly to decode the SDK metadata. diff --git a/store/sonar-project.properties b/store/sonar-project.properties deleted file mode 100644 index 666c3c9c0d22..000000000000 --- a/store/sonar-project.properties +++ /dev/null @@ -1,14 +0,0 @@ -sonar.projectKey=cosmos-sdk-store -sonar.organization=cosmos - -sonar.projectName=Cosmos SDK - Store -sonar.project.monorepo.enabled=true - -sonar.sources=. -sonar.exclusions=**/*_test.go -sonar.tests=. -sonar.test.inclusions=**/*_test.go -sonar.go.coverage.reportPaths=coverage.out - -sonar.sourceEncoding=UTF-8 -sonar.scm.provider=git \ No newline at end of file diff --git a/store/streaming/abci/grpc.pb.go b/store/streaming/abci/grpc.pb.go index 77ae842ad4d5..358bcaa7dcd4 100644 --- a/store/streaming/abci/grpc.pb.go +++ b/store/streaming/abci/grpc.pb.go @@ -362,6 +362,7 @@ func _ABCIListenerService_ListenCommit_Handler(srv interface{}, ctx context.Cont return interceptor(ctx, in, info, handler) } +var ABCIListenerService_serviceDesc = _ABCIListenerService_serviceDesc var _ABCIListenerService_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.store.streaming.abci.ABCIListenerService", HandlerType: (*ABCIListenerServiceServer)(nil), diff --git a/store/streaming/streaming_test.go b/store/streaming/streaming_test.go index c00c6021e5c1..e6124838b57e 100644 --- a/store/streaming/streaming_test.go +++ b/store/streaming/streaming_test.go @@ -8,16 +8,15 @@ import ( "testing" "time" - "cosmossdk.io/log" abci "github.com/cometbft/cometbft/abci/types" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/gogoproto/proto" - - storetypes "cosmossdk.io/store/types" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" + + "cosmossdk.io/log" + storetypes "cosmossdk.io/store/types" ) type PluginTestSuite struct { diff --git a/store/tracekv/store.go b/store/tracekv/store.go index 9ab124aa0e48..ba6df431da16 100644 --- a/store/tracekv/store.go +++ b/store/tracekv/store.go @@ -6,7 +6,6 @@ import ( "io" "cosmossdk.io/errors" - "cosmossdk.io/store/types" ) @@ -196,5 +195,8 @@ func writeOperation(w io.Writer, op operation, tc types.TraceContext, key, value panic(errors.Wrap(err, "failed to write trace operation")) } - io.WriteString(w, "\n") + _, err = io.WriteString(w, "\n") + if err != nil { + panic(errors.Wrap(err, "failed to write newline")) + } } diff --git a/store/tracekv/store_test.go b/store/tracekv/store_test.go index dc04302a3bbf..2c42734baefd 100644 --- a/store/tracekv/store_test.go +++ b/store/tracekv/store_test.go @@ -6,9 +6,8 @@ import ( "io" "testing" - "github.com/stretchr/testify/require" - dbm "github.com/cosmos/cosmos-db" + "github.com/stretchr/testify/require" "cosmossdk.io/store/dbadapter" "cosmossdk.io/store/internal/kv" diff --git a/store/types/commit_info.go b/store/types/commit_info.go index 125111a0c228..249d0986d403 100644 --- a/store/types/commit_info.go +++ b/store/types/commit_info.go @@ -1,6 +1,8 @@ package types import ( + "crypto/sha256" + cmtprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" "cosmossdk.io/store/internal/maps" @@ -30,10 +32,17 @@ func (ci CommitInfo) toMap() map[string][]byte { func (ci CommitInfo) Hash() []byte { // we need a special case for empty set, as SimpleProofsFromMap requires at least one entry if len(ci.StoreInfos) == 0 { - return nil + emptyHash := sha256.Sum256([]byte{}) + return emptyHash[:] } rootHash, _, _ := maps.ProofsFromMap(ci.toMap()) + + if len(rootHash) == 0 { + emptyHash := sha256.Sum256([]byte{}) + return emptyHash[:] + } + return rootHash } diff --git a/store/types/iterator_test.go b/store/types/iterator_test.go index c9c33b556237..a804b092c8ea 100644 --- a/store/types/iterator_test.go +++ b/store/types/iterator_test.go @@ -3,16 +3,17 @@ package types_test import ( "testing" - "cosmossdk.io/log" dbm "github.com/cosmos/cosmos-db" "github.com/stretchr/testify/require" + "cosmossdk.io/log" "cosmossdk.io/store/iavl" "cosmossdk.io/store/metrics" "cosmossdk.io/store/types" ) func newMemTestKVStore(t *testing.T) types.KVStore { + t.Helper() db := dbm.NewMemDB() store, err := iavl.LoadStore(db, log.NewNopLogger(), types.NewKVStoreKey("test"), types.CommitID{}, iavl.DefaultIAVLCacheSize, false, metrics.NewNoOpMetrics()) require.NoError(t, err) diff --git a/store/types/store.go b/store/types/store.go index 8980179950e2..c2ee3b8e7fe8 100644 --- a/store/types/store.go +++ b/store/types/store.go @@ -3,6 +3,7 @@ package types import ( "fmt" "io" + "slices" "github.com/cometbft/cometbft/proto/tendermint/crypto" dbm "github.com/cosmos/cosmos-db" @@ -85,12 +86,7 @@ func (s *StoreUpgrades) IsAdded(key string) bool { if s == nil { return false } - for _, added := range s.Added { - if key == added { - return true - } - } - return false + return slices.Contains(s.Added, key) } // IsDeleted returns true if the given key should be deleted @@ -98,12 +94,7 @@ func (s *StoreUpgrades) IsDeleted(key string) bool { if s == nil { return false } - for _, d := range s.Deleted { - if d == key { - return true - } - } - return false + return slices.Contains(s.Deleted, key) } // RenamedFrom returns the oldKey if it was renamed diff --git a/store/wrapper/wrapper.go b/store/wrapper/wrapper.go new file mode 100644 index 000000000000..5ccb4aef4698 --- /dev/null +++ b/store/wrapper/wrapper.go @@ -0,0 +1,34 @@ +package wrapper + +import ( + dbm "github.com/cosmos/cosmos-db" + idb "github.com/cosmos/iavl/db" +) + +var _ idb.DB = &DBWrapper{} + +// DBwrapper is a simple wrapper of dbm.DB that implements the iavl.DB interface. +type DBWrapper struct { + dbm.DB +} + +// NewDBWrapper creates a new DBWrapper instance. +func NewDBWrapper(db dbm.DB) *DBWrapper { + return &DBWrapper{db} +} + +func (dbw *DBWrapper) NewBatch() idb.Batch { + return dbw.DB.NewBatch() +} + +func (dbw *DBWrapper) NewBatchWithSize(size int) idb.Batch { + return dbw.DB.NewBatchWithSize(size) +} + +func (dbw *DBWrapper) Iterator(start, end []byte) (idb.Iterator, error) { + return dbw.DB.Iterator(start, end) +} + +func (dbw *DBWrapper) ReverseIterator(start, end []byte) (idb.Iterator, error) { + return dbw.DB.ReverseIterator(start, end) +} diff --git a/systemtests/CHANGELOG.md b/systemtests/CHANGELOG.md new file mode 100644 index 000000000000..9054829bc404 --- /dev/null +++ b/systemtests/CHANGELOG.md @@ -0,0 +1,61 @@ + + +# Changelog + +## [Unreleased] + +## [v1.1.0] - 2025-01-05 + +* [#23359](https://github.com/cosmos/cosmos-sdk/pull/23359) Add `RunCommandWithInputAndArgs` on CLIWrapper. + +## [v1.0.0] - 2024-12-19 + +* [#22849](https://github.com/cosmos/cosmos-sdk/pull/22849) Avoid telemetry server conflicts on port 7180 + +## [v1.0.0-rc.4] - 2024-12-10 + +* [#22810](https://github.com/cosmos/cosmos-sdk/pull/22810) Avoid HTTP server conflicts on port 8080 + +## [v1.0.0-rc.3] - 2024-12-05 + +* [#22774](https://github.com/cosmos/cosmos-sdk/pull/22774) Add greater than or equal support in Rest test suite + +## [v1.0.0-rc.2] - 2024-11-26 + +* [#22577](https://github.com/cosmos/cosmos-sdk/pull/22577) Support invalid RPC response for CometBFT v1 + +## [v1.0.0-rc.1] - 2024-11-26 + +* [#22578](https://github.com/cosmos/cosmos-sdk/pull/22578) Extract system test framework diff --git a/systemtests/README.md b/systemtests/README.md new file mode 100644 index 000000000000..f58e6cb5472e --- /dev/null +++ b/systemtests/README.md @@ -0,0 +1,63 @@ +# System Tests + +This package contains the testing framework for black-box system tests. It includes a test runner that sets up a +multi-node blockchain locally for use in tests. The framework provides utilities and helpers for easy access and +setup in tests. + +## Components + +- **CLI**: Command-line interface wrapper for interacting with the chain or keyring +- **Servers**: Server instances to run the blockchain environment. +- **Events**: Event listeners +- **RPC**: Remote Procedure Call setup for communication. + +## Dependencies + +- **testify**: Testing toolkit. +- **gjson**: JSON parser. +- **sjson**: JSON modifier. + +Server and client-side operations are executed on the host machine. + +## Developer + +### Test strategy + +System tests cover the full stack via cli and a running (multi node) network. They are more expensive (in terms of time/ cpu) +to run compared to unit or integration tests. +Therefore, we focus on the **critical path** and do not cover every condition. + +## How to use + +Read the [getting_started.md](../systemtests/getting_started.md) guide to get started. + +### Execute a single test + +```sh +go test -tags system_test -count=1 -v . --run TestStakeUnstake -verbose +``` + +Test cli parameters + +* `-verbose` verbose output +* `-wait-time` duration - time to wait for chain events (default 30s) +* `-nodes-count` int - number of nodes in the cluster (default 4) + +# Port ranges + +With *n* nodes: + +* `26657` - `26657+n` - RPC +* `1317` - `1317+n` - API +* `9090` - `9090+n` - GRPC +* `16656` - `16656+n` - P2P + +For example Node *3* listens on `26660` for RPC calls + +## Resources + +* [gjson query syntax](https://github.com/tidwall/gjson#path-syntax) + +## Disclaimer + +This is based on the system test framework in [wasmd](https://github.com/CosmWasm/wasmd) built by Confio. diff --git a/systemtests/cli.go b/systemtests/cli.go new file mode 100644 index 000000000000..0fae8a0f75e1 --- /dev/null +++ b/systemtests/cli.go @@ -0,0 +1,530 @@ +package systemtests + +import ( + "fmt" + "io" + "os" + "os/exec" + "path/filepath" + "slices" + "strings" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/tidwall/gjson" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +type ( + // blocks until next block is minted + awaitNextBlock func(t *testing.T, timeout ...time.Duration) int64 + // RunErrorAssert is custom type that is satisfies by testify matchers as well + RunErrorAssert func(t assert.TestingT, err error, msgAndArgs ...interface{}) (ok bool) +) + +// CLIWrapper provides a more convenient way to interact with the CLI binary from the Go tests +type CLIWrapper struct { + t *testing.T + nodeAddress string + chainID string + homeDir string + fees string + Debug bool + assertErrorFn RunErrorAssert + awaitNextBlock awaitNextBlock + expTXCommitted bool + execBinary string + nodesCount int + runSingleOutput bool +} + +// NewCLIWrapper constructor +func NewCLIWrapper(t *testing.T, sut *SystemUnderTest, verbose bool) *CLIWrapper { + t.Helper() + return NewCLIWrapperX( + t, + sut.execBinary, + sut.rpcAddr, + sut.chainID, + sut.AwaitNextBlock, + sut.nodesCount, + filepath.Join(WorkDir, sut.outputDir), + "1"+sdk.DefaultBondDenom, + verbose, + assert.NoError, + false, + true, + ) +} + +// NewCLIWrapperX extended constructor +func NewCLIWrapperX( + t *testing.T, + execBinary string, + nodeAddress string, + chainID string, + awaiter awaitNextBlock, + nodesCount int, + homeDir string, + fees string, + debug bool, + assertErrorFn RunErrorAssert, + runSingleOutput bool, + expTXCommitted bool, +) *CLIWrapper { + t.Helper() + if strings.TrimSpace(execBinary) == "" { + t.Fatal("name of executable binary must not be empty") + } + return &CLIWrapper{ + t: t, + execBinary: execBinary, + nodeAddress: nodeAddress, + chainID: chainID, + homeDir: homeDir, + Debug: debug, + awaitNextBlock: awaiter, + nodesCount: nodesCount, + fees: fees, + assertErrorFn: assertErrorFn, + runSingleOutput: runSingleOutput, + expTXCommitted: expTXCommitted, + } +} + +// WithRunErrorsIgnored does not fail on any error +func (c CLIWrapper) WithRunErrorsIgnored() CLIWrapper { + return c.WithRunErrorMatcher(func(t assert.TestingT, err error, msgAndArgs ...interface{}) bool { + return true + }) +} + +// WithRunErrorMatcher assert function to ensure run command error value +func (c CLIWrapper) WithRunErrorMatcher(f RunErrorAssert) CLIWrapper { + return c.clone(func(r *CLIWrapper) { + r.assertErrorFn = f + }) +} + +func (c CLIWrapper) WithRunSingleOutput() CLIWrapper { + return c.clone(func(r *CLIWrapper) { + r.runSingleOutput = true + }) +} + +func (c CLIWrapper) WithNodeAddress(nodeAddr string) CLIWrapper { + return c.clone(func(r *CLIWrapper) { + r.nodeAddress = nodeAddr + }) +} + +func (c CLIWrapper) WithAssertTXUncommitted() CLIWrapper { + return c.clone(func(r *CLIWrapper) { + r.expTXCommitted = false + }) +} + +func (c CLIWrapper) WithChainID(newChainID string) CLIWrapper { + return c.clone(func(r *CLIWrapper) { + r.chainID = newChainID + }) +} + +func (c CLIWrapper) clone(mutator ...func(r *CLIWrapper)) CLIWrapper { + r := NewCLIWrapperX( + c.t, + c.execBinary, + c.nodeAddress, + c.chainID, + c.awaitNextBlock, + c.nodesCount, + c.homeDir, + c.fees, + c.Debug, + c.assertErrorFn, + c.runSingleOutput, + c.expTXCommitted, + ) + for _, m := range mutator { + m(r) + } + return *r +} + +// RunOnly just runs the command, returns the output. and does nothing else +func (c CLIWrapper) RunOnly(args ...string) (string, bool) { + c.t.Helper() + args = c.WithTXFlags(args...) + output, ok := c.run(args) + return output, ok +} + +// Run main entry for executing cli commands. +// When configured, method blocks until tx is committed. +func (c CLIWrapper) Run(args ...string) string { + c.t.Helper() + if c.fees != "" && !slices.ContainsFunc(args, func(s string) bool { + return strings.HasPrefix(s, "--fees") + }) { + args = append(args, "--fees="+c.fees) // add default fee + } + args = c.WithTXFlags(args...) + execOutput, ok := c.run(args) + if !ok { + return execOutput + } + rsp, committed := c.AwaitTxCommitted(execOutput, DefaultWaitTime) + c.t.Logf("tx committed: %v", committed) + require.Equal(c.t, c.expTXCommitted, committed, "expected tx committed: %v", c.expTXCommitted) + return rsp +} + +// RunAndWait runs a cli command and waits for the server result when the TX is executed +// It returns the result of the transaction. +func (c CLIWrapper) RunAndWait(args ...string) string { + rsp := c.Run(args...) + RequireTxSuccess(c.t, rsp) + txResult, found := c.AwaitTxCommitted(rsp) + require.True(c.t, found) + return txResult +} + +// RunCommandWithArgs use for run cli command, not tx +func (c CLIWrapper) RunCommandWithArgs(args ...string) string { + c.t.Helper() + execOutput, _ := c.run(args) + return execOutput +} + +// RunCommandWithInputAndArgs use for run cli command, not tx +// Takes input as io.Reader for the command +func (c CLIWrapper) RunCommandWithInputAndArgs(input io.Reader, args ...string) string { + c.t.Helper() + execOutput, _ := c.runWithInput(args, input) + return execOutput +} + +// AwaitTxCommitted wait for tx committed on chain +// returns the server execution result and true when found within 3 blocks. +func (c CLIWrapper) AwaitTxCommitted(submitResp string, timeout ...time.Duration) (string, bool) { + c.t.Helper() + RequireTxSuccess(c.t, submitResp) + txHash := gjson.Get(submitResp, "txhash") + require.True(c.t, txHash.Exists()) + var txResult string + for i := 0; i < 3; i++ { // max blocks to wait for a commit + txResult = c.WithRunErrorsIgnored().CustomQuery("q", "tx", txHash.String()) + if code := gjson.Get(txResult, "code"); code.Exists() { + if code.Int() != 0 { // 0 = success code + c.t.Logf("+++ got error response code: %s\n", txResult) + } + return txResult, true + } + c.awaitNextBlock(c.t, timeout...) + } + return "", false +} + +// Keys wasmd keys CLI command +func (c CLIWrapper) Keys(args ...string) string { + args = c.WithKeyringFlags(args...) + out, _ := c.run(args) + return out +} + +// CustomQuery main entrypoint for wasmd CLI queries +func (c CLIWrapper) CustomQuery(args ...string) string { + args = c.WithQueryFlags(args...) + out, _ := c.run(args) + return out +} + +// execute shell command +func (c CLIWrapper) run(args []string) (output string, ok bool) { + c.t.Helper() + return c.runWithInput(args, nil) +} + +func (c CLIWrapper) runWithInput(args []string, input io.Reader) (output string, ok bool) { + c.t.Helper() + if c.Debug { + c.t.Logf("+++ running `%s %s`", c.execBinary, strings.Join(args, " ")) + } + gotOut, gotErr := func() (out []byte, err error) { + defer func() { + if r := recover(); r != nil { + err = fmt.Errorf("recovered from panic: %v", r) + } + }() + cmd := exec.Command(locateExecutable(c.execBinary), args...) //nolint:gosec // test code only + cmd.Dir = WorkDir + cmd.Stdin = input + + if c.runSingleOutput { + return cmd.Output() + } + + return cmd.CombinedOutput() + }() + + if c.Debug { + if gotErr != nil { + c.t.Logf("+++ ERROR output: %s - %s", gotOut, gotErr) + } else { + c.t.Logf("+++ output: %s", gotOut) + } + } + + ok = c.assertErrorFn(c.t, gotErr, string(gotOut)) + return strings.TrimSpace(string(gotOut)), ok +} + +// WithQueryFlags append the test default query flags to the given args +func (c CLIWrapper) WithQueryFlags(args ...string) []string { + args = append(args, "--output", "json") + return c.WithTargetNodeFlags(args...) +} + +// WithTXFlags append the test default TX flags to the given args. +// This includes +// - broadcast-mode: sync +// - output: json +// - chain-id +// - keyring flags +// - target-node +func (c CLIWrapper) WithTXFlags(args ...string) []string { + args = append(args, + "--broadcast-mode", "sync", + "--output", "json", + "--yes", + "--chain-id", c.chainID, + ) + args = c.WithKeyringFlags(args...) + return c.WithTargetNodeFlags(args...) +} + +// WithKeyringFlags append the test default keyring flags to the given args +func (c CLIWrapper) WithKeyringFlags(args ...string) []string { + r := append(args, + "--home", c.homeDir, + "--keyring-backend", "test", + ) + for _, v := range args { + if v == "-a" || v == "--address" { // show address only + return r + } + } + return append(r, "--output", "json") +} + +// WithTargetNodeFlags append the test default target node address flags to the given args +func (c CLIWrapper) WithTargetNodeFlags(args ...string) []string { + return append(args, + "--node", c.nodeAddress, + ) +} + +// WasmExecute send MsgExecute to a contract +func (c CLIWrapper) WasmExecute(contractAddr, msg, from string, args ...string) string { + cmd := append([]string{"tx", "wasm", "execute", contractAddr, msg, "--from", from}, args...) + return c.Run(cmd...) +} + +// AddKey add key to default keyring. Returns address +func (c CLIWrapper) AddKey(name string) string { + cmd := c.WithKeyringFlags("keys", "add", name, "--no-backup") + out, _ := c.run(cmd) + addr := gjson.Get(out, "address").String() + require.NotEmpty(c.t, addr, "got %q", out) + return addr +} + +// AddKeyFromSeed recovers the key from given seed and add it to default keyring. Returns address +func (c CLIWrapper) AddKeyFromSeed(name, mnemoic string) string { + cmd := c.WithKeyringFlags("keys", "add", name, "--recover") + out, _ := c.runWithInput(cmd, strings.NewReader(mnemoic)) + addr := gjson.Get(out, "address").String() + require.NotEmpty(c.t, addr, "got %q", out) + return addr +} + +// GetKeyAddr returns Acc address +func (c CLIWrapper) GetKeyAddr(name string) string { + cmd := c.WithKeyringFlags("keys", "show", name, "-a") + out, _ := c.run(cmd) + addr := strings.Trim(out, "\n") + require.NotEmpty(c.t, addr, "got %q", out) + return addr +} + +// GetKeyAddrPrefix returns key address with Beach32 prefix encoding for a key (acc|val|cons) +func (c CLIWrapper) GetKeyAddrPrefix(name, prefix string) string { + cmd := c.WithKeyringFlags("keys", "show", name, "-a", "--bech="+prefix) + out, _ := c.run(cmd) + addr := strings.Trim(out, "\n") + require.NotEmpty(c.t, addr, "got %q", out) + return addr +} + +// GetPubKeyByCustomField returns pubkey in base64 by custom field +func (c CLIWrapper) GetPubKeyByCustomField(addr, field string) string { + keysListOutput := c.Keys("keys", "list") + keysList := gjson.Parse(keysListOutput) + + var pubKeyValue string + keysList.ForEach(func(_, value gjson.Result) bool { + if value.Get(field).String() == addr { + pubKeyJSON := gjson.Parse(value.Get("pubkey").String()) + pubKeyValue = pubKeyJSON.Get("key").String() + return false + } + return true + }) + return pubKeyValue +} + +const defaultSrcAddr = "node0" + +// FundAddress sends the token amount to the destination address +func (c CLIWrapper) FundAddress(destAddr, amount string) string { + require.NotEmpty(c.t, destAddr) + require.NotEmpty(c.t, amount) + cmd := []string{"tx", "bank", "send", defaultSrcAddr, destAddr, amount} + rsp := c.Run(cmd...) + RequireTxSuccess(c.t, rsp) + return rsp +} + +// QueryBalances queries all balances for an account. Returns json response +// Example:`{"balances":[{"denom":"node0token","amount":"1000000000"},{"denom":"stake","amount":"400000003"}],"pagination":{}}` +func (c CLIWrapper) QueryBalances(addr string) string { + return c.CustomQuery("q", "bank", "balances", addr) +} + +// QueryBalance returns balance amount for given denom. +// 0 when not found +func (c CLIWrapper) QueryBalance(addr, denom string) int64 { + raw := c.CustomQuery("q", "bank", "balance", addr, denom) + require.Contains(c.t, raw, "amount", raw) + return gjson.Get(raw, "balance.amount").Int() +} + +// QueryTotalSupply returns total amount of tokens for a given denom. +// 0 when not found +func (c CLIWrapper) QueryTotalSupply(denom string) int64 { + raw := c.CustomQuery("q", "bank", "total-supply") + require.Contains(c.t, raw, "amount", raw) + return gjson.Get(raw, fmt.Sprintf("supply.#(denom==%q).amount", denom)).Int() +} + +// SubmitGovProposal submit a gov v1 proposal +func (c CLIWrapper) SubmitGovProposal(proposalJson string, args ...string) string { + if len(args) == 0 { + args = []string{"--from=" + defaultSrcAddr} + } + + pathToProposal := filepath.Join(c.t.TempDir(), "proposal.json") + err := os.WriteFile(pathToProposal, []byte(proposalJson), os.FileMode(0o744)) + require.NoError(c.t, err) + c.t.Log("Submit upgrade proposal") + return c.Run(append([]string{"tx", "gov", "submit-proposal", pathToProposal}, args...)...) +} + +// SubmitAndVoteGovProposal submit proposal, let all validators vote yes and return proposal id +func (c CLIWrapper) SubmitAndVoteGovProposal(proposalJson string, args ...string) string { + rsp := c.SubmitGovProposal(proposalJson, args...) + RequireTxSuccess(c.t, rsp) + raw := c.CustomQuery("q", "gov", "proposals", "--depositor", c.GetKeyAddr(defaultSrcAddr)) + proposals := gjson.Get(raw, "proposals.#.id").Array() + require.NotEmpty(c.t, proposals, raw) + ourProposalID := proposals[len(proposals)-1].String() // last is ours + for i := 0; i < c.nodesCount; i++ { + go func(i int) { // do parallel + c.t.Logf("Voting: validator %d\n", i) + rsp = c.Run("tx", "gov", "vote", ourProposalID, "yes", "--from", c.GetKeyAddr(fmt.Sprintf("node%d", i))) + RequireTxSuccess(c.t, rsp) + }(i) + } + return ourProposalID +} + +func (c CLIWrapper) ChainID() string { + return c.chainID +} + +// Version returns the current version of the client binary +func (c CLIWrapper) Version() string { + v, ok := c.run([]string{"version"}) + require.True(c.t, ok) + return v +} + +// RequireTxSuccess require the received response to contain the success code +func RequireTxSuccess(t *testing.T, got string) { + t.Helper() + code, details := parseResultCode(t, got) + require.Equal(t, int64(0), code, "non success tx code : %s", details) +} + +// RequireTxFailure require the received response to contain any failure code and the passed msgs +// From CometBFT v1, an RPC error won't return ABCI response, and error must be parsed +func RequireTxFailure(t *testing.T, got string, containsMsgs ...string) { + t.Helper() + if strings.Contains(got, "broadcast error on transaction validation") { + return // tx is invalid, no need to parse + } + + code, details := parseResultCode(t, got) + require.NotEqual(t, int64(0), code, details) + for _, msg := range containsMsgs { + require.Contains(t, details, msg) + } +} + +func parseResultCode(t *testing.T, got string) (int64, string) { + t.Helper() + code := gjson.Get(got, "code") + require.True(t, code.Exists(), "got response: %q", got) + + details := got + if log := gjson.Get(got, "raw_log"); log.Exists() && len(log.String()) != 0 { + details = log.String() + } + return code.Int(), details +} + +var ( + // ErrOutOfGasMatcher requires error with "out of gas" message + ErrOutOfGasMatcher RunErrorAssert = func(t assert.TestingT, err error, args ...interface{}) bool { + const oogMsg = "out of gas" + return expErrWithMsg(t, err, args, oogMsg) + } + // ErrTimeoutMatcher requires time out message + ErrTimeoutMatcher RunErrorAssert = func(t assert.TestingT, err error, args ...interface{}) bool { + const expMsg = "timed out waiting for tx to be included in a block" + return expErrWithMsg(t, err, args, expMsg) + } + // ErrPostFailedMatcher requires post failed + ErrPostFailedMatcher RunErrorAssert = func(t assert.TestingT, err error, args ...interface{}) bool { + const expMsg = "post failed" + return expErrWithMsg(t, err, args, expMsg) + } +) + +func expErrWithMsg(t assert.TestingT, err error, args []interface{}, expMsg string) bool { + if ok := assert.Error(t, err, args); !ok { + return false + } + var found bool + for _, v := range args { + if strings.Contains(fmt.Sprintf("%s", v), expMsg) { + found = true + break + } + } + assert.True(t, found, "expected %q but got: %s", expMsg, args) + return false // always abort +} diff --git a/systemtests/genesis_io.go b/systemtests/genesis_io.go new file mode 100644 index 000000000000..f3a61e54a2dd --- /dev/null +++ b/systemtests/genesis_io.go @@ -0,0 +1,55 @@ +package systemtests + +import ( + "fmt" + "testing" + "time" + + "github.com/stretchr/testify/require" + "github.com/tidwall/gjson" + "github.com/tidwall/sjson" + + sdkmath "cosmossdk.io/math" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// SetConsensusMaxGas max gas that can be consumed in a block +func SetConsensusMaxGas(t *testing.T, max int) GenesisMutator { + t.Helper() + return func(genesis []byte) []byte { + state, err := sjson.SetRawBytes(genesis, "consensus.params.block.max_gas", []byte(fmt.Sprintf(`"%d"`, max))) + require.NoError(t, err) + return state + } +} + +func SetGovVotingPeriod(t *testing.T, period time.Duration) GenesisMutator { + t.Helper() + return func(genesis []byte) []byte { + state, err := sjson.SetRawBytes(genesis, "app_state.gov.params.voting_period", []byte(fmt.Sprintf("%q", period.String()))) + require.NoError(t, err) + return state + } +} + +func SetGovExpeditedVotingPeriod(t *testing.T, period time.Duration) GenesisMutator { + t.Helper() + return func(genesis []byte) []byte { + state, err := sjson.SetRawBytes(genesis, "app_state.gov.params.expedited_voting_period", []byte(fmt.Sprintf("%q", period.String()))) + require.NoError(t, err) + return state + } +} + +// GetGenesisBalance return the balance amount for an address from the given genesis json +func GetGenesisBalance(rawGenesis []byte, addr string) sdk.Coins { + var r []sdk.Coin + balances := gjson.GetBytes(rawGenesis, fmt.Sprintf(`app_state.bank.balances.#[address==%q]#.coins`, addr)).Array() + for _, coins := range balances { + for _, coin := range coins.Array() { + r = append(r, sdk.NewCoin(coin.Get("denom").String(), sdkmath.NewInt(coin.Get("amount").Int()))) + } + } + return r +} diff --git a/systemtests/getting_started.md b/systemtests/getting_started.md new file mode 100644 index 000000000000..e9b5ad01539e --- /dev/null +++ b/systemtests/getting_started.md @@ -0,0 +1,215 @@ +# Getting started with a new system test + +## Preparation + +Build a new binary from current branch and copy it to the `tests/systemtests/binaries` folder by running system tests. +In project root: + +```shell +make test-system +``` + +Or via manual steps + +```shell +make build +mkdir -p ./tests/systemtests/binaries +cp ./build/simd ./tests/systemtests/binaries/ +``` + +## Part 1: Writing the first system test + +Switch to the `tests/systemtests` folder to work from here. + +If there is no test file matching your use case, start a new test file here. +for example `bank_test.go` to begin with: + +```go +//go:build system_test + +package systemtests + +import ( + "testing" +) + +func TestQueryTotalSupply(t *testing.T) { + sut.ResetChain(t) + sut.StartChain(t) + + cli := NewCLIWrapper(t, sut, verbose) + raw := cli.CustomQuery("q", "bank", "total-supply") + t.Log("### got: " + raw) +} +``` + +The file begins with a Go build tag to exclude it from regular go test runs. +All tests in the `systemtests` folder build upon the *test runner* initialized in `main_test.go`. +This gives you a multi node chain started on your box. +It is a good practice to reset state in the beginning so that you have a stable base. + +The system tests framework comes with a CLI wrapper that makes it easier to interact or parse results. +In this example we want to execute `simd q bank total-supply --output json --node tcp://localhost:26657` which queries +the bank module. +Then print the result to for the next steps + +### Run the test + +```shell +go test -mod=readonly -tags='system_test' -v ./... --run TestQueryTotalSupply --verbose +``` + +This give very verbose output. You would see all simd CLI commands used for starting the server or by the client to interact. +In the example code, we just log the output. Watch out for + +```shell + bank_test.go:15: ### got: { + "supply": [ + { + "denom": "stake", + "amount": "2000000190" + }, + { + "denom": "testtoken", + "amount": "4000000000" + } + ], + "pagination": { + "total": "2" + } + } +``` + +At the end is a tail from the server log printed. This can sometimes be handy when debugging issues. + + +### Tips + +* Passing `--nodes-count=1` overwrites the default node count and can speed up your test for local runs + +## Part 2: Working with json + +When we have a json response, the [gjson](https://github.com/tidwall/gjson) lib can shine. It comes with jquery like +syntax that makes it easy to navigation within the document. + +For example `gjson.Get(raw, "supply").Array()` gives us all the children to `supply` as an array. +Or `gjson.Get("supply.#(denom==stake).amount").Int()` for the amount of the stake token as int64 type. + +In order to test our assumptions in the system test, we modify the code to use `gjson` to fetch the data: + +```go + raw := cli.CustomQuery("q", "bank", "total-supply") + + exp := map[string]int64{ + "stake": int64(500000000 * sut.nodesCount), + "testtoken": int64(1000000000 * sut.nodesCount), + } + require.Len(t, gjson.Get(raw, "supply").Array(), len(exp), raw) + + for k, v := range exp { + got := gjson.Get(raw, fmt.Sprintf("supply.#(denom==%q).amount", k)).Int() + assert.Equal(t, v, got, raw) + } +``` + +The assumption on the staking token usually fails due to inflation minted on the staking token. Let's fix this in the next step + +### Run the test + +```shell +go test -mod=readonly -tags='system_test' -v ./... --run TestQueryTotalSupply --verbose +``` + +### Tips + +* Putting the `raw` json response to the assert/require statements helps with debugging on failures. You are usually lacking + context when you look at the values only. + + +## Part 3: Setting state via genesis + +First step is to disable inflation. This can be done via the `ModifyGenesisJSON` helper. But to add some complexity, +we also introduce a new token and update the balance of the account for key `node0`. +The setup code looks quite big and unreadable now. Usually a good time to think about extracting helper functions for +common operations. The `genesis_io.go` file contains some examples already. I would skip this and take this to showcase the mix +of `gjson`, `sjson` and stdlib json operations. + +```go + sut.ResetChain(t) + cli := NewCLIWrapper(t, sut, verbose) + + sut.ModifyGenesisJSON(t, func(genesis []byte) []byte { + // disable inflation + genesis, err := sjson.SetRawBytes(genesis, "app_state.mint.minter.inflation", []byte(`"0.000000000000000000"`)) + require.NoError(t, err) + + // add new token to supply + var supply []json.RawMessage + rawSupply := gjson.Get(string(genesis), "app_state.bank.supply").String() + require.NoError(t, json.Unmarshal([]byte(rawSupply), &supply)) + supply = append(supply, json.RawMessage(`{"denom": "mytoken","amount": "1000000"}`)) + newSupply, err := json.Marshal(supply) + require.NoError(t, err) + genesis, err = sjson.SetRawBytes(genesis, "app_state.bank.supply", newSupply) + require.NoError(t, err) + + // add amount to any balance + anyAddr := cli.GetKeyAddr("node0") + newBalances := GetGenesisBalance(genesis, anyAddr).Add(sdk.NewInt64Coin("mytoken", 1000000)) + newBalancesBz, err := newBalances.MarshalJSON() + require.NoError(t, err) + newState, err := sjson.SetRawBytes(genesis, fmt.Sprintf("app_state.bank.balances.#[address==%q]#.coins", anyAddr), newBalancesBz) + require.NoError(t, err) + return newState + }) + sut.StartChain(t) +``` + +Next step is to add the new token to the assert map. But we can also make it more resilient to different node counts. + +```go + exp := map[string]int64{ + "stake": int64(500000000 * sut.nodesCount), + "testtoken": int64(1000000000 * sut.nodesCount), + "mytoken": 1000000, + } +``` + +```shell +go test -mod=readonly -tags='system_test' -v ./... --run TestQueryTotalSupply --verbose --nodes-count=1 +``` + +## Part 4: Set state via TX + +Complexer workflows and tests require modifying state on a running chain. This works only with builtin logic and operations. +If we want to burn some of our new tokens, we need to submit a bank burn message to do this. +The CLI wrapper works similar to the query. Just pass the parameters. It uses the `node0` key as *default*: + +```go + // and when + txHash := cli.Run("tx", "bank", "burn", "node0", "400000mytoken") + RequireTxSuccess(t, txHash) +``` + +`RequireTxSuccess` or `RequireTxFailure` can be used to ensure the expected result of the operation. +Next, check that the changes are applied. + +```go + exp["mytoken"] = 600_000 // update expected state + raw = cli.CustomQuery("q", "bank", "total-supply") + for k, v := range exp { + got := gjson.Get(raw, fmt.Sprintf("supply.#(denom==%q).amount", k)).Int() + assert.Equal(t, v, got, raw) + } + assert.Equal(t, int64(600_000), cli.QueryBalance(cli.GetKeyAddr("node0"), "mytoken")) +``` + +While tests are still more or less readable, it can gets harder the longer they are. I found it helpful to add +some comments at the beginning to describe what the intention is. For example: + +```go + // scenario: + // given a chain with a custom token on genesis + // when an amount is burned + // then this is reflected in the total supply +``` diff --git a/systemtests/go.mod b/systemtests/go.mod new file mode 100644 index 000000000000..01f5319e611e --- /dev/null +++ b/systemtests/go.mod @@ -0,0 +1,166 @@ +module cosmossdk.io/systemtests + +go 1.23.0 + +require ( + cosmossdk.io/math v1.5.0 + github.com/cometbft/cometbft v0.38.17 + github.com/cosmos/cosmos-sdk v0.50.13 + github.com/creachadair/tomledit v0.0.27 + github.com/stretchr/testify v1.10.0 + github.com/tidwall/gjson v1.18.0 + github.com/tidwall/sjson v1.2.5 + google.golang.org/grpc v1.71.0 +) + +require ( + buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.36.4-20241120201313-68e42a58b301.1 // indirect + buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.36.4-20240130113600-88ef6483f90f.1 // indirect + cosmossdk.io/api v0.8.2 // indirect + cosmossdk.io/collections v0.4.0 // indirect + cosmossdk.io/core v0.11.0 // indirect + cosmossdk.io/depinject v1.1.0 // indirect + cosmossdk.io/errors v1.0.1 // indirect + cosmossdk.io/log v1.5.0 // indirect + cosmossdk.io/store v1.1.1 // indirect + cosmossdk.io/x/tx v1.1.0 // indirect + filippo.io/edwards25519 v1.1.0 // 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.6 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/bgentry/speakeasy v0.2.0 // indirect + github.com/bytedance/sonic v1.12.8 // indirect + github.com/bytedance/sonic/loader v0.2.3 // indirect + github.com/cenkalti/backoff/v4 v4.1.3 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/cloudwego/base64x v0.1.5 // indirect + github.com/cockroachdb/apd/v3 v3.2.1 // indirect + github.com/cockroachdb/errors v1.11.3 // indirect + github.com/cockroachdb/fifo v0.0.0-20240816210425-c5d0cb0b6fc0 // indirect + github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506 // indirect + github.com/cockroachdb/pebble v1.1.2 // indirect + github.com/cockroachdb/redact v1.1.5 // indirect + github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect + github.com/cometbft/cometbft-db v0.14.1 // indirect + github.com/cosmos/btcutil v1.0.5 // indirect + github.com/cosmos/cosmos-db v1.1.1 // indirect + github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect + github.com/cosmos/go-bip39 v1.0.0 // indirect + github.com/cosmos/gogogateway v1.2.0 // indirect + github.com/cosmos/gogoproto v1.7.0 // indirect + github.com/cosmos/iavl v1.2.2 // indirect + github.com/cosmos/ics23/go v0.11.0 // indirect + github.com/cosmos/ledger-cosmos-go v0.14.0 // indirect + github.com/danieljoos/wincred v1.1.2 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect + github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect + github.com/dgraph-io/badger/v4 v4.2.0 // indirect + github.com/dgraph-io/ristretto v0.1.1 // indirect + github.com/dustin/go-humanize v1.0.1 // indirect + github.com/dvsekhvalnov/jose2go v1.6.0 // indirect + github.com/emicklei/dot v1.6.2 // indirect + github.com/fatih/color v1.18.0 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect + github.com/getsentry/sentry-go v0.30.0 // indirect + github.com/go-kit/kit v0.13.0 // indirect + github.com/go-kit/log v0.2.1 // indirect + github.com/go-logfmt/logfmt v0.6.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // indirect + github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect + github.com/gogo/googleapis v1.4.1 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/glog v1.2.4 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/golang/protobuf v1.5.4 // indirect + github.com/golang/snappy v0.0.4 // indirect + github.com/google/btree v1.1.3 // indirect + github.com/google/flatbuffers v1.12.1 // indirect + github.com/google/go-cmp v0.6.0 // indirect + github.com/google/orderedcode v0.0.1 // indirect + github.com/gorilla/handlers v1.5.1 // indirect + github.com/gorilla/mux v1.8.0 // indirect + github.com/gorilla/websocket v1.5.3 // indirect + github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect + github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect + github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect + github.com/hashicorp/go-hclog v1.6.3 // indirect + github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-metrics v0.5.4 // indirect + github.com/hashicorp/go-plugin v1.6.2 // indirect + github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect + github.com/hashicorp/yamux v0.1.2 // indirect + github.com/hdevalence/ed25519consensus v0.1.0 // indirect + github.com/huandu/skiplist v1.2.1 // 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/jmhodges/levigo v1.0.0 // indirect + github.com/klauspost/compress v1.17.11 // indirect + github.com/klauspost/cpuid/v2 v2.2.9 // indirect + github.com/kr/pretty v0.3.1 // indirect + github.com/kr/text v0.2.0 // indirect + github.com/lib/pq v1.10.9 // indirect + github.com/linxGnu/grocksdb v1.9.7 // indirect + github.com/magiconair/properties v1.8.9 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/minio/highwayhash v1.0.3 // indirect + github.com/mtibben/percent v0.2.1 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect + github.com/oklog/run v1.1.0 // indirect + github.com/pelletier/go-toml/v2 v2.2.3 // indirect + github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/prometheus/client_golang v1.20.5 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.62.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect + github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect + github.com/rogpeppe/go-internal v1.13.1 // indirect + github.com/rs/cors v1.11.1 // indirect + github.com/rs/zerolog v1.33.0 // indirect + github.com/sagikazarmark/locafero v0.7.0 // indirect + github.com/sasha-s/go-deadlock v0.3.5 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.12.0 // indirect + github.com/spf13/cast v1.7.1 // indirect + github.com/spf13/cobra v1.8.1 // indirect + github.com/spf13/pflag v1.0.6 // indirect + github.com/spf13/viper v1.20.0 // indirect + 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/tidwall/btree v1.7.0 // indirect + github.com/tidwall/match v1.1.1 // indirect + github.com/tidwall/pretty v1.2.0 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + github.com/zondax/hid v0.9.2 // indirect + github.com/zondax/ledger-go v0.14.3 // indirect + go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 // indirect + go.opencensus.io v0.24.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + golang.org/x/arch v0.13.0 // indirect + golang.org/x/crypto v0.35.0 // indirect + golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8 // indirect + golang.org/x/net v0.34.0 // indirect + golang.org/x/sync v0.11.0 // indirect + golang.org/x/sys v0.30.0 // indirect + golang.org/x/term v0.29.0 // indirect + golang.org/x/text v0.22.0 // indirect + google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20250106144421-5f5ef82da422 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250122153221-138b5a5a4fd4 // indirect + google.golang.org/protobuf v1.36.4 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + gotest.tools/v3 v3.5.1 // indirect + nhooyr.io/websocket v1.8.6 // indirect + pgregory.net/rapid v1.1.0 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect +) diff --git a/tools/rosetta/go.sum b/systemtests/go.sum similarity index 55% rename from tools/rosetta/go.sum rename to systemtests/go.sum index 957de466ae3c..221e55816e8c 100644 --- a/tools/rosetta/go.sum +++ b/systemtests/go.sum @@ -1,85 +1,54 @@ +buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.36.4-20241120201313-68e42a58b301.1 h1:lcvKfPJ0GTMLh1Ib9n9b3Hx/U2lXj27rb5pujo3EKko= +buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.36.4-20241120201313-68e42a58b301.1/go.mod h1:dW1kItnxv+SgI6SBjokdyIZqKl2uhOJahkOqIXDNDC8= +buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.36.4-20240130113600-88ef6483f90f.1 h1:xn+yVpC5XMvaSQWjfRWmitcYemPznXR7Y65rIMTxoiU= +buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.36.4-20240130113600-88ef6483f90f.1/go.mod h1:9oTVKh0Ppx5zXStsybi9Zb//6TuLreQxSZqBDE25JGo= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= -cosmossdk.io/api v0.4.2 h1:lQBMl4xINnMnBOR/tQLtjlDnR4exr4e6/SfHR8PILE0= -cosmossdk.io/api v0.4.2/go.mod h1:qrVgOp7DIeAXa+Tt5dDjOC47bZCDrwx8ZHxrmy7STNE= -cosmossdk.io/collections v0.2.0 h1:CgMfLtE16+qox3zBYrGh60i4yKV8SeExLnIdOS2sbQs= -cosmossdk.io/collections v0.2.0/go.mod h1:Oc1FK0vlmxJZsgUn9/o3ldE6zNyWKvobVzaLhWknZJE= -cosmossdk.io/core v0.8.0 h1:LcJnu52E1a8f8E317VfQ1xK/RZe+IuhMNQAjnDLh25M= -cosmossdk.io/core v0.8.0/go.mod h1:LF6VLOv2DdCiaHxYVmr0MZcZpaSM9ZgvyrQSYTeg6D0= -cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw= -cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= -cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 h1:BCRz06fvddw7cKGiEGDiSox3qMsjQ97f92K+PDZDHdc= -cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741/go.mod h1:TB05o6YXkZkzsc+6bZFAV5kZRBtoCU9tUkbeMIqEg0w= -cosmossdk.io/log v1.1.0 h1:v0ogPHYeTzPcBTcPR1A3j1hkei4pZama8kz8LKlCMv0= -cosmossdk.io/log v1.1.0/go.mod h1:6zjroETlcDs+mm62gd8Ig7mZ+N+fVOZS91V17H+M4N4= -cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= -cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= -cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c h1:A+FMPW9GtfcPBDQNtFeDFN27h1SAP6OVjnGgPLlYXmI= -cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c/go.mod h1:RbYGvXCbz8uNBCXrwS9Z8SyydeWi+W5x5MZ33muyzMw= -cosmossdk.io/x/tx v0.8.0 h1:gLiGRL/Fy7fs6dd0IX8jOf0PrVr56/SG6XVMGQjyvJU= -cosmossdk.io/x/tx v0.8.0/go.mod h1:T9uEumGNgKU61gJYRv1t3uzQwLnASpJGmSE229HM3xA= +cosmossdk.io/api v0.8.2 h1:klzA1RODd9tTawJ2CbBd/34RV/cB9qtd9oJN6rcRqqg= +cosmossdk.io/api v0.8.2/go.mod h1:XJUwQrihIDjErzs3+jm1zO/9KRzKf4HMjRzXC+l+Cio= +cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= +cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= +cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= +cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= +cosmossdk.io/depinject v1.1.0 h1:wLan7LG35VM7Yo6ov0jId3RHWCGRhe8E8bsuARorl5E= +cosmossdk.io/depinject v1.1.0/go.mod h1:kkI5H9jCGHeKeYWXTqYdruogYrEeWvBQCw1Pj4/eCFI= +cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= +cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= +cosmossdk.io/log v1.5.0 h1:dVdzPJW9kMrnAYyMf1duqacoidB9uZIl+7c6z0mnq0g= +cosmossdk.io/log v1.5.0/go.mod h1:Tr46PUJjiUthlwQ+hxYtUtPn4D/oCZXAkYevBeh5+FI= +cosmossdk.io/math v1.5.0 h1:sbOASxee9Zxdjd6OkzogvBZ25/hP929vdcYcBJQbkLc= +cosmossdk.io/math v1.5.0/go.mod h1:AAwwBmUhqtk2nlku174JwSll+/DepUXW3rWIXN5q+Nw= +cosmossdk.io/store v1.1.1 h1:NA3PioJtWDVU7cHHeyvdva5J/ggyLDkyH0hGHl2804Y= +cosmossdk.io/store v1.1.1/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM= +cosmossdk.io/x/tx v1.1.0 h1:5C5XGNGYzbOTKbcf47oBI/VLObb5bmcMqH/C6H/sp1E= +cosmossdk.io/x/tx v1.1.0/go.mod h1:QF15QyTcGH4wfKawfRdSihWwutf4OhgiA+HIwWhjle0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= -filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= +filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= +filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= 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/99designs/keyring v1.2.1 h1:tYLp1ULvO7i3fI5vE21ReQuj99QFSs7lGm0xWyJo87o= github.com/99designs/keyring v1.2.1/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= -github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= -github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= +github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= -github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= -github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= +github.com/DataDog/zstd v1.5.6 h1:LbEglqepa/ipmmQJUDnSsfvA8e8IStVcGaFWDuxvGOY= +github.com/DataDog/zstd v1.5.6/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= +github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= +github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= 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/adlio/schema v1.3.6 h1:k1/zc2jNfeiZBA5aFTRy37jlBIuCkXCm0XmvpzCKI9I= +github.com/adlio/schema v1.3.6/go.mod h1:qkxwLgPBd1FgLRHYVCmQT/rrBr3JH38J9LjmVzWNudg= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= -github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= -github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -89,199 +58,198 @@ github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kd github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= 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/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= -github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= -github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= -github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= -github.com/bufbuild/protocompile v0.5.1 h1:mixz5lJX4Hiz4FpqFREJHIXLfaLBntfaJv1h+/jS+Qg= +github.com/bgentry/speakeasy v0.2.0 h1:tgObeVOf8WAvtuAX6DhJ4xks4CFNwPDZiqzGqIHE51E= +github.com/bgentry/speakeasy v0.2.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bits-and-blooms/bitset v1.8.0 h1:FD+XqgOZDUxxZ8hzoBFuV9+cGWY9CslN6d5MS5JVb4c= +github.com/bits-and-blooms/bitset v1.8.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= +github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= +github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/btcutil v1.1.6 h1:zFL2+c3Lb9gEgqKNzowKUPQNb8jV7v5Oaodi/AYFd6c= +github.com/btcsuite/btcd/btcutil v1.1.6/go.mod h1:9dFymx8HpuLqBnsPELrImQeTQfKBQqzqGbbV3jK55aE= +github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY= +github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE= +github.com/bytedance/sonic v1.12.8 h1:4xYRVRlXIgvSZ4e8iVTlMF5szgpXd4AfvuWgA8I8lgs= +github.com/bytedance/sonic v1.12.8/go.mod h1:uVvFidNmlt9+wa31S1urfwwthTWteBgG0hWuoKAXTx8= +github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= +github.com/bytedance/sonic/loader v0.2.3 h1:yctD0Q3v2NOGfSWPLPvG2ggA2kV6TS6s4wioyEqssH0= +github.com/bytedance/sonic/loader v0.2.3/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= +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= github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -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/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI= +github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudwego/base64x v0.1.5 h1:XPciSp1xaq2VCSt6lF0phncD4koWyULpl5bUxbfCyP4= +github.com/cloudwego/base64x v0.1.5/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= +github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= +github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= +github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= +github.com/cockroachdb/apd/v3 v3.2.1 h1:U+8j7t0axsIgvQUqthuNm82HIrYXodOV2iWLWtEaIwg= +github.com/cockroachdb/apd/v3 v3.2.1/go.mod h1:klXJcjp+FffLTHlhIG69tezTDvdP065naDsHzKhYSqc= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= -github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= -github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= -github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/pebble v0.0.0-20230606152911-c4be581b807f h1:qQW3qCVRpjYsV4YNaUOjm6YLeliAD2jpgex9+D9tqU4= -github.com/cockroachdb/pebble v0.0.0-20230606152911-c4be581b807f/go.mod h1:TkdVsGYRqtULUppt2RbC+YaKtTHnHoWa2apfFrSKABw= -github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/cockroachdb/redact v1.1.4 h1:Y0XrVI2FAyofNyGveodTN//qdpPtFKcKTeCBsK3AHAQ= -github.com/cockroachdb/redact v1.1.4/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= +github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8= +github.com/cockroachdb/fifo v0.0.0-20240816210425-c5d0cb0b6fc0 h1:pU88SPhIFid6/k0egdR5V6eALQYq2qbSmukrkgIh/0A= +github.com/cockroachdb/fifo v0.0.0-20240816210425-c5d0cb0b6fc0/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= +github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506 h1:ASDL+UJcILMqgNeV5jiqR4j+sTuvQNHdf2chuKj1M5k= +github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506/go.mod h1:Mw7HqKr2kdtu6aYGn3tPmAftiP3QPX63LdK/zcariIo= +github.com/cockroachdb/pebble v1.1.2 h1:CUh2IPtR4swHlEj48Rhfzw6l/d0qA31fItcIszQVIsA= +github.com/cockroachdb/pebble v1.1.2/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= -github.com/coinbase/rosetta-sdk-go/types v1.0.0 h1:jpVIwLcPoOeCR6o1tU+Xv7r5bMONNbHU7MuEHboiFuA= -github.com/coinbase/rosetta-sdk-go/types v1.0.0/go.mod h1:eq7W2TMRH22GTW0N0beDnN931DW0/WOI1R2sdHNHG4c= -github.com/cometbft/cometbft v0.38.0-rc1 h1:ph6smlqX82aH+d72KuxDHqu29M7LyusSp/obfGsGX/w= -github.com/cometbft/cometbft v0.38.0-rc1/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= -github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= -github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= +github.com/cometbft/cometbft v0.38.17 h1:FkrQNbAjiFqXydeAO81FUzriL4Bz0abYxN/eOHrQGOk= +github.com/cometbft/cometbft v0.38.17/go.mod h1:5l0SkgeLRXi6bBfQuevXjKqML1jjfJJlvI1Ulp02/o4= +github.com/cometbft/cometbft-db v0.14.1 h1:SxoamPghqICBAIcGpleHbmoPqy+crij/++eZz3DlerQ= +github.com/cometbft/cometbft-db v0.14.1/go.mod h1:KHP1YghilyGV/xjD5DP3+2hyigWx0WTp9X+0Gnx0RxQ= +github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= +github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= -github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0E= -github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= -github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= -github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= +github.com/cosmos/cosmos-db v1.1.1 h1:FezFSU37AlBC8S98NlSagL76oqBRWq/prTPvFcEJNCM= +github.com/cosmos/cosmos-db v1.1.1/go.mod h1:AghjcIPqdhSLP/2Z0yha5xPH3nLnskz81pBx3tcVSAw= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= +github.com/cosmos/cosmos-sdk v0.50.13 h1:xQ32hhzVy7agEe7behMdZN0ezWhPss3KoLZsF9KoBnw= +github.com/cosmos/cosmos-sdk v0.50.13/go.mod h1:hrWEFMU1eoXqLJeE6VVESpJDQH67FS1nnMrQIjO2daw= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoKuI= -github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= -github.com/cosmos/iavl v1.0.0-beta.2 h1:XOsIM80Yyml/KifCXEYOy9tWCXwMAbLa91n6pReW07Y= -github.com/cosmos/iavl v1.0.0-beta.2/go.mod h1:EA97dJ07TBktRlG/iGzK6g1eCXNj1q3MGoFYkVzrwHE= -github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= -github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= -github.com/cosmos/ledger-cosmos-go v0.13.0 h1:ex0CvCxToSR7j5WjrghPu2Bu9sSXKikjnVvUryNnx4s= -github.com/cosmos/ledger-cosmos-go v0.13.0/go.mod h1:ZcqYgnfNJ6lAXe4HPtWgarNEY+B74i+2/8MhZw4ziiI= -github.com/cosmos/rosetta-sdk-go v0.10.0 h1:E5RhTruuoA7KTIXUcMicL76cffyeoyvNybzUGSKFTcM= -github.com/cosmos/rosetta-sdk-go v0.10.0/go.mod h1:SImAZkb96YbwvoRkzSMQB6noNJXFgWl/ENIznEoYQI4= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= +github.com/cosmos/iavl v1.2.2 h1:qHhKW3I70w+04g5KdsdVSHRbFLgt3yY3qTMd4Xa4rC8= +github.com/cosmos/iavl v1.2.2/go.mod h1:GiM43q0pB+uG53mLxLDzimxM9l/5N9UuSY3/D0huuVw= +github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= +github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= +github.com/cosmos/ledger-cosmos-go v0.14.0 h1:WfCHricT3rPbkPSVKRH+L4fQGKYHuGOK9Edpel8TYpE= +github.com/cosmos/ledger-cosmos-go v0.14.0/go.mod h1:E07xCWSBl3mTGofZ2QnL4cIUzMbbGVyik84QYKbX3RA= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creachadair/tomledit v0.0.27 h1:6xOpEnkKmcpT/gmKhabN0JXrqNX065lyje1/mXTSSIE= +github.com/creachadair/tomledit v0.0.27/go.mod h1:v1EWpgCisD3ct1kO8Gq4o4pdgX5JXD0rBI2PJ4UnPoA= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= -github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= -github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= -github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= -github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= -github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= +github.com/dgraph-io/badger/v4 v4.2.0 h1:kJrlajbXXL9DFTNuhhu9yCx7JJa4qpYWxtE8BzuWsEs= +github.com/dgraph-io/badger/v4 v4.2.0/go.mod h1:qfCqhPoWDFJRx1gp5QwwyGo8xk1lbHUxvK9nK0OGAak= github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= +github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +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/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= 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/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= -github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= +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/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= -github.com/emicklei/dot v1.4.2 h1:UbK6gX4yvrpHKlxuUQicwoAis4zl8Dzwit9SnbBAXWw= -github.com/emicklei/dot v1.4.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= +github.com/emicklei/dot v1.6.2 h1:08GN+DD79cy/tzN6uLCT84+2Wk9u+wvqP+Hkx/dIR8A= +github.com/emicklei/dot v1.6.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= -github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= -github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= -github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= -github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= -github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= +github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= -github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= -github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= -github.com/getsentry/sentry-go v0.21.0 h1:c9l5F1nPF30JIppulk4veau90PK6Smu3abgVtVQWon4= -github.com/getsentry/sentry-go v0.21.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= +github.com/getsentry/sentry-go v0.30.0 h1:lWUwDnY7sKHaVIoZ9wYqRHJ5iEmoc0pqcRqFkosKzBo= +github.com/getsentry/sentry-go v0.30.0/go.mod h1:WU9B9/1/sHDqeV8T+3VwwbjeR5MSXs/6aqG3mqZrezA= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= -github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= -github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= -github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= +github.com/go-kit/kit v0.13.0 h1:OoneCcHKHQ03LfBpoQCUfCluwd2Vt3ohz+kvbJneZAU= +github.com/go-kit/kit v0.13.0/go.mod h1:phqEHMMUbyrCFCTgH48JueqrM3md2HcAZ8N3XE4FKDg= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= @@ -290,17 +258,25 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= +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-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= +github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= +github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= +github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= @@ -308,11 +284,10 @@ github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6Wezm github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= +github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= -github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= 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= @@ -323,29 +298,22 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV 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/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= -github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= -github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= +github.com/golang/glog v1.2.4 h1:CNNw5U8lSiiBk7druxtSHHTsRWcxKoac6kZKm2peBBc= +github.com/golang/glog v1.2.4/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= @@ -357,55 +325,41 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -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/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= +github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= +github.com/google/flatbuffers v1.12.1 h1:MVlul7pQNoDzWRLTw5imwYsl+usrS1TXG2H4jg6ImGw= +github.com/google/flatbuffers v1.12.1/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 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= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= @@ -416,8 +370,8 @@ github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= @@ -433,15 +387,17 @@ github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyN github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= -github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= +github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-metrics v0.5.4 h1:8mmPiIJkTPPEbAiV97IxdAGNdRdaWwVap1BU6elejKY= +github.com/hashicorp/go-metrics v0.5.4/go.mod h1:CG5yz4NZ/AI/aQt9Ucm/vdBnbh7fvmv4lxZ350i+QQI= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-plugin v1.4.10 h1:xUbmA4jC6Dq163/fWcp8P3JuHilrHHMLNRxzGQJ9hNk= -github.com/hashicorp/go-plugin v1.4.10/go.mod h1:6/1TEzT0eQznvI/gV2CM29DLSkAK/e58mUWKVsPaph0= +github.com/hashicorp/go-plugin v1.6.2 h1:zdGAEd0V1lCaU0u+MxWQhtSDQmahpkwOun8U8EiRVog= +github.com/hashicorp/go-plugin v1.6.2/go.mod h1:CkgLQ5CZqNmdL9U9JzM532t8ZiYQ35+pj3b1FD37R0Q= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= @@ -453,42 +409,35 @@ github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= -github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= +github.com/hashicorp/yamux v0.1.2 h1:XtB8kyFOyHXYVFnwT5C3+Bdo8gArse7j2AQ0DA0Uey8= +github.com/hashicorp/yamux v0.1.2/go.mod h1:C+zze2n6e/7wshOZep2A70/aQU6QBRWJO/G6FT1wIns= github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= 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= -github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw= -github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= +github.com/huandu/skiplist v1.2.1 h1:dTi93MgjwErA/8idWTzIw4Y1kZsMWx35fmI2c8Rij7w= +github.com/huandu/skiplist v1.2.1/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= -github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= -github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= -github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= -github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= -github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= -github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= -github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= -github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= +github.com/jhump/protoreflect v1.15.3 h1:6SFRuqU45u9hIZPJAoZ8c28T3nK64BNdp9w6jFonzls= +github.com/jhump/protoreflect v1.15.3/go.mod h1:4ORHmSBmlCW8fh3xHmJMGyul1zNqZK4Elxc8qKP+p1k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= @@ -499,106 +448,86 @@ github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= 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/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= -github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= -github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= -github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= -github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= 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/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI= -github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= +github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.9 h1:66ze0taIn2H33fBvCkXuv9BmCwDfafmiIVpKV9kKGuY= +github.com/klauspost/cpuid/v2 v2.2.9/go.mod h1:rqkxqrZ1EhYM9G+hXH7YdowN5R5RGN6NK4QwQ3WMXF8= +github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= 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.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= -github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= -github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= -github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.0 h1:H4L/LhP7GOMf1j17oQAElHgVlbEje2h14A8Tz9cM2BE= -github.com/linxGnu/grocksdb v1.8.0/go.mod h1:09CeBborffXhXdNpEcOeZrLKEnRtrZFEpFdPNI9Zjjg= +github.com/linxGnu/grocksdb v1.9.7 h1:Bp2r1Yti/IXxEobZZnDooXAui/Q+5gVqgQMenLWyDUw= +github.com/linxGnu/grocksdb v1.9.7/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= -github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/magiconair/properties v1.8.9 h1:nWcCbLq1N2v/cpNsy5WvQ37Fb+YElfq20WJ/a8RkpQM= +github.com/magiconair/properties v1.8.9/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= +github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.8/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= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= 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-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= -github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= +github.com/minio/highwayhash v1.0.3 h1:kbnuUMoHYyVl7szWjSxJnxw11k2U709jqFPPmIUyD6Q= +github.com/minio/highwayhash v1.0.3/go.mod h1:GGYsuwP/fPD6Y9hMiXuapVvlIUEhFhMTh0rxU3ik1LQ= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -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/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/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= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= 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/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -612,10 +541,11 @@ github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce h1:/pEpMk55wH0X+E5zedGEMOdLuWmV8P4+4W3+LZaM6kg= -github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= +github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY= +github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a h1:dlRvE5fWabOchtH7znfiFCcOvmIYgOeAS5ifBXBlh9Q= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= @@ -623,7 +553,6 @@ github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DV github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= @@ -635,7 +564,14 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/onsi/gomega v1.26.0 h1:03cDLK28U6hWvCAns6NeydX3zIm4SF3ci69ulidS32Q= +github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= +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-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= +github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= +github.com/opencontainers/runc v1.1.12 h1:BOIssBaW1La0/qbNZHXOOa71dZfZEQOzW7dqQf3phss= +github.com/opencontainers/runc v1.1.12/go.mod h1:S+lQwSfncpBha7XTy/5lBwWgm5+y5Ma/O44Ekby9FK8= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -644,18 +580,18 @@ github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxS github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= +github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= -github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= +github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= +github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= -github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761 h1:W04oB3d0J01W5jgYRGKsV8LCM6g9EkCvPkZcmFuy0OE= -github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 h1:Dx7Ovyv/SFnMFw3fD4oEoeorXc6saIiQ23LrGLth0Gw= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= @@ -666,9 +602,9 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= @@ -676,101 +612,94 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.15.1 h1:8tXpTmJbyH5lydzFPoxSIJ0J46jdh3tylbvM1xCv0LI= -github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= +github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= +github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= -github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= -github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io= +github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= -github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= 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/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= -github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= -github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.29.1 h1:cO+d60CHkknCbvzEWxP0S9K6KqyTjrCNUy1LdQLCGPc= -github.com/rs/zerolog v1.29.1/go.mod h1:Le6ESbR7hc+DP6Lt1THiV8CQSdkkNrd3R0XbEgp3ZBU= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= +github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/locafero v0.7.0 h1:5MqpDsTGNDhY8sGp0Aowyf0qKsPrhewaLSsFaodPcyo= +github.com/sagikazarmark/locafero v0.7.0/go.mod h1:2za3Cg5rMaTMoG/2Ulr9AwtFaIppKXTRYnozin4aB5k= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -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/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= +github.com/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb2NsU= +github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= -github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= -github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= -github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= +github.com/spf13/afero v1.12.0 h1:UcOPyRBYczmFn6yvphxkn9ZEOY65cpwGKb5mL36mrqs= +github.com/spf13/afero v1.12.0/go.mod h1:ZTlWwG4/ahT8W7T0WQ5uYmjI9duaLQGy3Q2OAl4sk/4= +github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= +github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= -github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= +github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= +github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.20.0 h1:zrxIyR3RQIOsarIrgL8+sAvALXul9jeEPa06Y0Ph6vY= +github.com/spf13/viper v1.20.0/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -780,65 +709,65 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= -github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +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.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= -github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= +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/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY= +github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= +github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= +github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= +github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= +github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY= +github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= +github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= -github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= -github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= -github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= -github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= -github.com/zondax/ledger-go v0.14.1 h1:Pip65OOl4iJ84WTpA4BKChvOufMhhbxED3BaihoZN4c= -github.com/zondax/ledger-go v0.14.1/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2feOQv8K320= +github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= +github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= +github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= +github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= -go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 h1:qxen9oVGzDdIRP6ejyAJc760RwW4SnVDiTYTzwnXuxo= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5/go.mod h1:eW0HG9/oHQhvRCvb1/pIXW4cOvtDqeQK+XSi3TnwaXY= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= +go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= +go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY= +go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI= +go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ= +go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE= +go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A= +go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU= +go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk= +go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w= +go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k= +go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -848,65 +777,44 @@ go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= +golang.org/x/arch v0.13.0 h1:KCkqVVV1kGg0X87TFysjCJ8MxtZEIU4Ja/yXGeoECdA= +golang.org/x/arch v0.13.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= -golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= +golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs= +golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8 h1:yqrTHse8TCMW1M1ZCP+VAR/l0kKxwaAIqN/il7x4voA= +golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8/go.mod h1:tujkw807nyEEAamNbDrEGzRav+ilXA7PCRAd6xsmwiU= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= +golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= 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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -918,68 +826,38 @@ golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= 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= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= +golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= +golang.org/x/sync v0.11.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-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -988,19 +866,12 @@ golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 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-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= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1009,252 +880,123 @@ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/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-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220315194320-039c03cc5b86/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= +golang.org/x/sys v0.30.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.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU= +golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s= 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= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= +golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -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= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/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-20181221001348-537d06c36207/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-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.29.0 h1:Xx0h3TtM9rzQpQuR4dKLrdglAmCEN5Oi+P74JdhdzXE= +golang.org/x/tools v0.29.0/go.mod h1:KMQVMRsVxU6nHCFXrBPhDB8XncLNLM0lIy/F14RP588= 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= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -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-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= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20230525234025-438c736192d0 h1:x1vNwUhVOcsYoKyEGCZBH694SBmmBjA2EfauFVEI2+M= -google.golang.org/genproto v0.0.0-20230525234025-438c736192d0/go.mod h1:9ExIQyXL5hZrHzQceCwuSYwZZ5QZBazOcprJ5rgs3lY= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a h1:HiYVD+FGJkTo+9zj1gqz0anapsa1JxjiSrN+BJKyUmE= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a/go.mod h1:ts19tUU+Z0ZShN1y3aPyq2+O3d5FUNNgT6FtOzmrNn8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 h1:ToEetK57OidYuqD4Q5w+vfEnPvPpuTwedCNVohYJfNk= +google.golang.org/genproto v0.0.0-20241118233622-e639e219e697/go.mod h1:JJrvXBWRZaFMxBufik1a4RpFw4HhgVtBBWQeQgUj2cc= +google.golang.org/genproto/googleapis/api v0.0.0-20250106144421-5f5ef82da422 h1:GVIKPyP/kLIyVOgOnTwFOrvQaQUzOzGMCxgFUOEmm24= +google.golang.org/genproto/googleapis/api v0.0.0-20250106144421-5f5ef82da422/go.mod h1:b6h1vNKhxaSoEI+5jc3PJUCustfli/mRab7295pY7rw= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250122153221-138b5a5a4fd4 h1:yrTuav+chrF0zF/joFGICKTzYv7mh/gr9AgEXrVU8ao= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250122153221-138b5a5a4fd4/go.mod h1:+2Yz8+CLJbIfL9z73EW45avw8Lmge3xVElCP9zEKi50= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= +google.golang.org/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg= +google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1269,24 +1011,19 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.36.4 h1:6A3ZDJHn/eNqc1i+IdefRzy/9PokBTPvcqMySR7NNIM= +google.golang.org/protobuf v1.36.4/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 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.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= 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/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= -gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= -gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -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/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= @@ -1301,29 +1038,22 @@ gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 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= -gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= -gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= +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-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -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= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= -pgregory.net/rapid v0.6.2 h1:ErW5sL+UKtfBfUTsWHDCoeB+eZKLKMxrSd1VJY6W4bw= -pgregory.net/rapid v0.6.2/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= +pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= +pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/systemtests/io_utils.go b/systemtests/io_utils.go new file mode 100644 index 000000000000..a9cd1094fba6 --- /dev/null +++ b/systemtests/io_utils.go @@ -0,0 +1,65 @@ +package systemtests + +import ( + "bytes" + "fmt" + "io" + "os" + "path/filepath" + "testing" + + "github.com/stretchr/testify/require" +) + +// MustCopyFile copies the file from the source path `src` to the destination path `dest` and returns an open file handle to `dest`. +func MustCopyFile(src, dest string) *os.File { + in, err := os.Open(src) + if err != nil { + panic(fmt.Sprintf("failed to open %q: %v", src, err)) + } + defer in.Close() + + out, err := os.Create(dest) + if err != nil { + panic(fmt.Sprintf("failed to create %q: %v", dest, err)) + } + defer out.Close() + + _, err = io.Copy(out, in) + if err != nil { + panic(fmt.Sprintf("failed to copy from %q to %q: %v", src, dest, err)) + } + return out +} + +// MustCopyFilesInDir copies all files (excluding directories) from the source directory `src` to the destination directory `dest`. +func MustCopyFilesInDir(src, dest string) { + err := os.MkdirAll(dest, 0o750) + if err != nil { + panic(fmt.Sprintf("failed to create %q: %v", dest, err)) + } + + fs, err := os.ReadDir(src) + if err != nil { + panic(fmt.Sprintf("failed to read dir %q: %v", src, err)) + } + + for _, f := range fs { + if f.IsDir() { + continue + } + _ = MustCopyFile(filepath.Join(src, f.Name()), filepath.Join(dest, f.Name())) + } +} + +// StoreTempFile creates a temporary file in the test's temporary directory with the provided content. +// It returns a pointer to the created file. Errors during the process are handled with test assertions. +func StoreTempFile(t *testing.T, content []byte) *os.File { + t.Helper() + out, err := os.CreateTemp(t.TempDir(), "") + require.NoError(t, err) + _, err = io.Copy(out, bytes.NewReader(content)) + require.NoError(t, err) + require.NoError(t, out.Close()) + return out +} diff --git a/systemtests/node_utils.go b/systemtests/node_utils.go new file mode 100644 index 000000000000..f503a0f390ad --- /dev/null +++ b/systemtests/node_utils.go @@ -0,0 +1,46 @@ +package systemtests + +import ( + "bytes" + "path/filepath" + "testing" + + "github.com/cometbft/cometbft/privval" + "github.com/stretchr/testify/require" + + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" +) + +// LoadValidatorPubKeyForNode load validator nodes consensus pub key for given node number +func LoadValidatorPubKeyForNode(t *testing.T, sut *SystemUnderTest, nodeNumber int) cryptotypes.PubKey { + t.Helper() + return LoadValidatorPubKey(t, filepath.Join(WorkDir, sut.nodePath(nodeNumber), "config", "priv_validator_key.json")) +} + +// LoadValidatorPubKey load validator nodes consensus pub key from disk +func LoadValidatorPubKey(t *testing.T, keyFile string) cryptotypes.PubKey { + t.Helper() + filePV := privval.LoadFilePVEmptyState(keyFile, "") + pubKey, err := filePV.GetPubKey() + require.NoError(t, err) + valPubKey, err := cryptocodec.FromCmtPubKeyInterface(pubKey) + require.NoError(t, err) + return valPubKey +} + +// QueryCometValidatorPowerForNode returns the validator's power from tendermint RPC endpoint. 0 when not found +func QueryCometValidatorPowerForNode(t *testing.T, sut *SystemUnderTest, nodeNumber int) int64 { + t.Helper() + pubKebBz := LoadValidatorPubKeyForNode(t, sut, nodeNumber).Bytes() + return QueryCometValidatorPower(sut.RPCClient(t), pubKebBz) +} + +func QueryCometValidatorPower(c RPCClient, pubKebBz []byte) int64 { + for _, v := range c.Validators() { + if bytes.Equal(v.PubKey.Bytes(), pubKebBz) { + return v.VotingPower + } + } + return 0 +} diff --git a/systemtests/rest_support.go b/systemtests/rest_support.go new file mode 100644 index 000000000000..b2615fc2aed6 --- /dev/null +++ b/systemtests/rest_support.go @@ -0,0 +1,146 @@ +package systemtests + +import ( + "io" + "net/http" + "regexp" + "testing" + + "github.com/stretchr/testify/require" +) + +type RestTestCase struct { + Name string + Url string + ExpCode int + ExpCodeGTE int + ExpOut string +} + +// RunRestQueries runs given Rest testcases by making requests and +// checking response with expected output +func RunRestQueries(t *testing.T, testCases ...RestTestCase) { + t.Helper() + + for _, tc := range testCases { + t.Run(tc.Name, func(t *testing.T) { + if tc.ExpCodeGTE > 0 && tc.ExpCode > 0 { + require.Fail(t, "only one of ExpCode or ExpCodeGTE should be set") + } + + var resp []byte + if tc.ExpCodeGTE > 0 { + resp = GetRequestWithHeadersGreaterThanOrEqual(t, tc.Url, nil, tc.ExpCodeGTE) + } else { + resp = GetRequestWithHeaders(t, tc.Url, nil, tc.ExpCode) + } + require.JSONEq(t, tc.ExpOut, string(resp)) + }) + } +} + +// RunRestQueriesIgnoreNumbers runs given rest testcases by making requests and +// checking response with expected output ignoring number values +// This method is used when number values in response are non-deterministic +func RunRestQueriesIgnoreNumbers(t *testing.T, testCases ...RestTestCase) { + t.Helper() + + // regex for standalone quoted numbers (e.g., "-3" or "0.02") + standaloneQuotedNumberRegex := regexp.MustCompile(`"(-?\d+(\.\d+)?)"`) + // regex for numbers in escaped strings (e.g., \"-3\") + escapedNumberRegex := regexp.MustCompile(`\\\"(-?\d+(\.\d+)?)\\\"`) + // regex for unquoted numbers (e.g., 2, -1, 0.02,) + unquotedNumberRegex := regexp.MustCompile(`\b-?\d+(\.\d+)?\b,`) + + replaceNumber := func(input string) string { + // handle numbers in escaped strings + result := escapedNumberRegex.ReplaceAllStringFunc(input, func(match string) string { + // replace with escaped "NUMBER" + return `\"NUMBER\"` + }) + + // handle standalone quoted numbers + result = standaloneQuotedNumberRegex.ReplaceAllStringFunc(result, func(match string) string { + // replace with "NUMBER" (quotes preserved) + return `"NUMBER"` + }) + + // handle unquoted numbers + result = unquotedNumberRegex.ReplaceAllStringFunc(result, func(match string) string { + // replace with "NUMBER" (add quotes to ensure json validity) + return `"NUMBER",` + }) + + return result + } + + for _, tc := range testCases { + t.Run(tc.Name, func(t *testing.T) { + if tc.ExpCodeGTE > 0 && tc.ExpCode > 0 { + require.Fail(t, "only one of ExpCode or ExpCodeGTE should be set") + } + + var resp []byte + if tc.ExpCodeGTE > 0 { + resp = GetRequestWithHeadersGreaterThanOrEqual(t, tc.Url, nil, tc.ExpCodeGTE) + } else { + resp = GetRequestWithHeaders(t, tc.Url, nil, tc.ExpCode) + } + + expectedJSON := replaceNumber(tc.ExpOut) + actualJSON := replaceNumber(string(resp)) + + // compare two jsons + require.JSONEq(t, expectedJSON, actualJSON) + }) + } +} + +func GetRequest(t *testing.T, url string) []byte { + t.Helper() + return GetRequestWithHeaders(t, url, nil, http.StatusOK) +} + +func GetRequestWithHeaders(t *testing.T, url string, headers map[string]string, expCode int) []byte { + t.Helper() + req, err := http.NewRequest("GET", url, nil) + require.NoError(t, err) + + for key, value := range headers { + req.Header.Set(key, value) + } + + httpClient := &http.Client{} + res, err := httpClient.Do(req) + require.NoError(t, err) + defer func() { + _ = res.Body.Close() + }() + body, err := io.ReadAll(res.Body) + require.NoError(t, err) + require.Equal(t, expCode, res.StatusCode, "status code should be %d, got: %d, %s", expCode, res.StatusCode, body) + + return body +} + +func GetRequestWithHeadersGreaterThanOrEqual(t *testing.T, url string, headers map[string]string, expCode int) []byte { + t.Helper() + req, err := http.NewRequest("GET", url, nil) + require.NoError(t, err) + + for key, value := range headers { + req.Header.Set(key, value) + } + + httpClient := &http.Client{} + res, err := httpClient.Do(req) + require.NoError(t, err) + defer func() { + _ = res.Body.Close() + }() + body, err := io.ReadAll(res.Body) + require.NoError(t, err) + require.GreaterOrEqual(t, res.StatusCode, expCode, "status code should be greater or equal to %d, got: %d, %s", expCode, res.StatusCode, body) + + return body +} diff --git a/systemtests/rpc_client.go b/systemtests/rpc_client.go new file mode 100644 index 000000000000..a1f1af9f3473 --- /dev/null +++ b/systemtests/rpc_client.go @@ -0,0 +1,113 @@ +package systemtests + +import ( + "context" + "errors" + "reflect" + "strconv" + "testing" + + abci "github.com/cometbft/cometbft/abci/types" + rpcclient "github.com/cometbft/cometbft/rpc/client" + client "github.com/cometbft/cometbft/rpc/client/http" + cmtypes "github.com/cometbft/cometbft/types" + "github.com/stretchr/testify/require" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + grpctypes "github.com/cosmos/cosmos-sdk/types/grpc" +) + +// RPCClient is a test helper to interact with a node via the RPC endpoint. +type RPCClient struct { + client *client.HTTP + t *testing.T +} + +// NewRPCClient constructor +func NewRPCClient(t *testing.T, addr string) RPCClient { + t.Helper() + httpClient, err := client.New(addr, "/websocket") + require.NoError(t, err) + require.NoError(t, httpClient.Start()) + t.Cleanup(func() { _ = httpClient.Stop() }) + return RPCClient{client: httpClient, t: t} +} + +// Validators returns list of validators +func (r RPCClient) Validators() []*cmtypes.Validator { + v, err := r.client.Validators(context.Background(), nil, nil, nil) + require.NoError(r.t, err) + return v.Validators +} + +func (r RPCClient) Invoke(ctx context.Context, method string, req, reply interface{}, opts ...grpc.CallOption) error { + if reflect.ValueOf(req).IsNil() { + return errors.New("request cannot be nil") + } + + ir := types.NewInterfaceRegistry() + cryptocodec.RegisterInterfaces(ir) + cdc := codec.NewProtoCodec(ir).GRPCCodec() + + reqBz, err := cdc.Marshal(req) + if err != nil { + return err + } + + var height int64 + md, _ := metadata.FromOutgoingContext(ctx) + if heights := md.Get(grpctypes.GRPCBlockHeightHeader); len(heights) > 0 { + height, err := strconv.ParseInt(heights[0], 10, 64) + if err != nil { + return err + } + if height < 0 { + return errors.New("height must be greater than or equal to 0") + } + } + + abciReq := abci.RequestQuery{ + Path: method, + Data: reqBz, + Height: height, + } + + abciOpts := rpcclient.ABCIQueryOptions{ + Height: height, + Prove: abciReq.Prove, + } + + result, err := r.client.ABCIQueryWithOptions(ctx, abciReq.Path, abciReq.Data, abciOpts) + if err != nil { + return err + } + + if !result.Response.IsOK() { + return errors.New(result.Response.String()) + } + + err = cdc.Unmarshal(result.Response.Value, reply) + if err != nil { + return err + } + + md = metadata.Pairs(grpctypes.GRPCBlockHeightHeader, strconv.FormatInt(result.Response.Height, 10)) + for _, callOpt := range opts { + header, ok := callOpt.(grpc.HeaderCallOption) + if !ok { + continue + } + + *header.HeaderAddr = md + } + + return types.UnpackInterfaces(reply, ir) +} + +func (r RPCClient) NewStream(ctx context.Context, desc *grpc.StreamDesc, method string, opts ...grpc.CallOption) (grpc.ClientStream, error) { + return nil, errors.New("not implemented") +} diff --git a/systemtests/system.go b/systemtests/system.go new file mode 100644 index 000000000000..599e58b5eb4f --- /dev/null +++ b/systemtests/system.go @@ -0,0 +1,977 @@ +package systemtests + +import ( + "bufio" + "bytes" + "container/ring" + "context" + "fmt" + "io" + "maps" + "os" + "os/exec" + "path/filepath" + "regexp" + "strings" + "sync/atomic" + "syscall" + "testing" + "time" + + "github.com/cometbft/cometbft/libs/sync" + client "github.com/cometbft/cometbft/rpc/client/http" + ctypes "github.com/cometbft/cometbft/rpc/core/types" + tmtypes "github.com/cometbft/cometbft/types" + "github.com/stretchr/testify/require" + "github.com/tidwall/sjson" + + "github.com/cosmos/cosmos-sdk/server" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var ( + // WorkDir is the directory where tests are executed. Path should be relative to this dir + WorkDir string + + // ExecBinaryUnversionedRegExp regular expression to extract the unversioned binary name + ExecBinaryUnversionedRegExp = regexp.MustCompile(`^(\w+)-?.*$`) + + MaxGas = 10_000_000 + // DefaultApiPort is the port for the node to interact with + DefaultApiPort = 1317 + DefaultRpcPort = 26657 + DefaultTelemetryPort = 7180 + DefaultRestPort = 8080 + DefaultGrpcPort = 9090 + DefaultP2PPort = 16656 +) + +type TestnetInitializer interface { + Initialize() +} + +// SystemUnderTest blockchain provisioning +type SystemUnderTest struct { + execBinary string + blockListener *EventListener + currentHeight atomic.Int64 + outputDir string + testnetInitializer TestnetInitializer + + // blockTime is the expected/desired block time. This is not going to be very precise + // since Tendermint consensus does not allow specifying it directly. + blockTime time.Duration + rpcAddr string + apiAddr string + initialNodesCount int + nodesCount int + minGasPrice string + cleanupFn []CleanupFn + outBuff *ring.Ring + errBuff *ring.Ring + out io.Writer + verbose bool + ChainStarted bool + projectName string + dirty bool // requires full reset when marked dirty + + pidsLock sync.RWMutex + pids map[int]struct{} + chainID string +} + +func NewSystemUnderTest(execBinary string, verbose bool, nodesCount int, blockTime time.Duration, initer ...TestnetInitializer) *SystemUnderTest { + if execBinary == "" { + panic("executable binary name must not be empty") + } + nameTokens := ExecBinaryUnversionedRegExp.FindAllString(execBinary, 1) + if len(nameTokens) == 0 || nameTokens[0] == "" { + panic("failed to parse project name from binary: " + execBinary) + } + execBinary = filepath.Join(WorkDir, "binaries", execBinary) + s := &SystemUnderTest{ + chainID: "testing", + execBinary: execBinary, + outputDir: "./testnet", + blockTime: blockTime, + rpcAddr: "tcp://localhost:26657", + apiAddr: fmt.Sprintf("http://localhost:%d", DefaultApiPort), + initialNodesCount: nodesCount, + outBuff: ring.New(100), + errBuff: ring.New(100), + out: os.Stdout, + verbose: verbose, + minGasPrice: fmt.Sprintf("0.000001%s", sdk.DefaultBondDenom), + projectName: nameTokens[0], + pids: make(map[int]struct{}, nodesCount), + } + if len(initer) > 0 { + s.testnetInitializer = initer[0] + } else { + s.testnetInitializer = NewSingleHostTestnetCmdInitializer(execBinary, WorkDir, s.chainID, s.outputDir, s.initialNodesCount, s.minGasPrice, s.CommitTimeout(), s.Log) + } + return s +} + +// SetExecBinary sets the executable binary for the system under test. +func (s *SystemUnderTest) SetExecBinary(binary string) { + s.execBinary = binary +} + +// ExecBinary returns the path of the binary executable associated with the SystemUnderTest instance. +func (s *SystemUnderTest) ExecBinary() string { + return s.execBinary +} + +// SetTestnetInitializer sets the initializer for the testnet configuration. +func (s *SystemUnderTest) SetTestnetInitializer(testnetInitializer TestnetInitializer) { + s.testnetInitializer = testnetInitializer +} + +// TestnetInitializer returns the testnet initializer associated with the SystemUnderTest. +func (s *SystemUnderTest) TestnetInitializer() TestnetInitializer { + return s.testnetInitializer +} + +// CommitTimeout returns the max time to wait for a commit. Default to 90% of block time +func (s *SystemUnderTest) CommitTimeout() time.Duration { + // The commit timeout is a lower bound for the block time. We try to set it to a level that allows us to reach the expected block time. + return time.Duration((int64(s.blockTime) * 90) / 100) // leave 10% for all other operations +} + +func (s *SystemUnderTest) SetupChain() { + s.Logf("Setup chain: %s\n", s.outputDir) + if err := os.RemoveAll(filepath.Join(WorkDir, s.outputDir)); err != nil { + panic(err.Error()) + } + s.testnetInitializer.Initialize() + s.nodesCount = s.initialNodesCount + + // modify genesis with system test defaults + src := filepath.Join(WorkDir, s.nodePath(0), "config", "genesis.json") + genesisBz, err := os.ReadFile(src) // #nosec G304 + if err != nil { + panic(fmt.Sprintf("failed to load genesis: %s", err)) + } + + genesisBz, err = sjson.SetRawBytes(genesisBz, "consensus.params.block.max_gas", []byte(fmt.Sprintf(`"%d"`, MaxGas))) + if err != nil { + panic(fmt.Sprintf("failed to set block max gas: %s", err)) + } + s.withEachNodeHome(func(i int, home string) { + if err := saveGenesis(home, genesisBz); err != nil { + panic(err) + } + }) + + // backup genesis + dest := filepath.Join(WorkDir, s.nodePath(0), "config", "genesis.json.orig") + MustCopyFile(src, dest) + // backup keyring + src = filepath.Join(WorkDir, s.nodePath(0), "keyring-test") + dest = filepath.Join(WorkDir, s.outputDir, "keyring-test") + MustCopyFilesInDir(src, dest) +} + +func (s *SystemUnderTest) StartChain(t *testing.T, xargs ...string) { + t.Helper() + s.Log("Start chain\n") + s.ChainStarted = true + s.startNodesAsync(t, append([]string{"start", "--log_level=info", "--log_no_color"}, xargs...)...) + + s.AwaitNodeUp(t, s.rpcAddr) + + t.Log("Start new block listener") + s.blockListener = NewEventListener(t, s.rpcAddr) + s.cleanupFn = append(s.cleanupFn, + s.blockListener.Subscribe("tm.event='NewBlock'", func(e ctypes.ResultEvent) (more bool) { + newBlock, ok := e.Data.(tmtypes.EventDataNewBlock) + require.True(t, ok, "unexpected type %T", e.Data) + s.currentHeight.Store(newBlock.Block.Height) + return true + }), + ) + s.AwaitNextBlock(t, 10e9) +} + +// MarkDirty whole chain will be reset when marked dirty +func (s *SystemUnderTest) MarkDirty() { + s.dirty = true +} + +// IsDirty true when non default genesis or other state modification were applied that might create incompatibility for tests +func (s *SystemUnderTest) IsDirty() bool { + return s.dirty +} + +// watchLogs stores stdout/stderr in a file and in a ring buffer to output the last n lines on test error +func (s *SystemUnderTest) watchLogs(node int, cmd *exec.Cmd) { + logfile, err := os.Create(filepath.Join(WorkDir, s.outputDir, fmt.Sprintf("node%d.out", node))) + if err != nil { + panic(fmt.Sprintf("open logfile error %#+v", err)) + } + + errReader, err := cmd.StderrPipe() + if err != nil { + panic(fmt.Sprintf("stderr reader error %#+v", err)) + } + stopRingBuffer := make(chan struct{}) + go appendToBuf(io.TeeReader(errReader, logfile), s.errBuff, stopRingBuffer) + + outReader, err := cmd.StdoutPipe() + if err != nil { + panic(fmt.Sprintf("stdout reader error %#+v", err)) + } + go appendToBuf(io.TeeReader(outReader, logfile), s.outBuff, stopRingBuffer) + s.cleanupFn = append(s.cleanupFn, func() { + close(stopRingBuffer) + _ = logfile.Close() + }) +} + +func appendToBuf(r io.Reader, b *ring.Ring, stop <-chan struct{}) { + scanner := bufio.NewScanner(r) + for scanner.Scan() { + select { + case <-stop: + return + default: + } + text := scanner.Text() + // filter out noise + if isLogNoise(text) { + continue + } + b.Value = text + b = b.Next() + } +} + +func isLogNoise(text string) bool { + for _, v := range []string{ + "\x1b[36mmodule=\x1b[0mrpc-server", // "module=rpc-server", + } { + if strings.Contains(text, v) { + return true + } + } + return false +} + +// AwaitUpgradeInfo blocks util an upgrade info file is persisted to disk +func (s *SystemUnderTest) AwaitUpgradeInfo(t *testing.T) { + t.Helper() + var found bool + for !found { + s.withEachNodeHome(func(i int, home string) { + _, err := os.Stat(filepath.Join(s.nodePath(0), "data", "upgrade-info.json")) + switch { + case err == nil: + found = true + case !os.IsNotExist(err): + t.Fatal(err.Error()) + } + }) + time.Sleep(s.blockTime / 2) + } +} + +func (s *SystemUnderTest) AwaitChainStopped() { + for s.anyNodeRunning() { + time.Sleep(s.blockTime) + } +} + +// AwaitNodeUp ensures the node is running +func (s *SystemUnderTest) AwaitNodeUp(t *testing.T, rpcAddr string) { + t.Helper() + t.Logf("Await node is up: %s", rpcAddr) + timeout := DefaultWaitTime + ctx, done := context.WithTimeout(context.Background(), timeout) + defer done() + + started := make(chan struct{}) + go func() { // query for a non empty block on status page + t.Logf("Checking node status: %s\n", rpcAddr) + for { + con, err := client.New(rpcAddr, "/websocket") + if err != nil || con.Start() != nil { + time.Sleep(time.Second) + continue + } + result, err := con.Status(ctx) + if err != nil || result.SyncInfo.LatestBlockHeight < 1 { + _ = con.Stop() + continue + } + t.Logf("Node started. Current block: %d\n", result.SyncInfo.LatestBlockHeight) + _ = con.Stop() + started <- struct{}{} + } + }() + select { + case <-started: + case <-ctx.Done(): + require.NoError(t, ctx.Err()) + case <-time.NewTimer(timeout).C: + t.Fatalf("timeout waiting for node start: %s", timeout) + } +} + +// StopChain stops the system under test and executes all registered cleanup callbacks +func (s *SystemUnderTest) StopChain() { + s.Log("Stop chain\n") + if !s.ChainStarted { + return + } + + for _, c := range s.cleanupFn { + c() + } + s.cleanupFn = nil + // send SIGTERM + s.withEachPid(func(p *os.Process) { + go func() { + if err := p.Signal(syscall.SIGTERM); err != nil { + s.Logf("failed to stop node with pid %d: %s\n", p.Pid, err) + } + }() + }) + // give some final time to shut down + s.withEachPid(func(p *os.Process) { + time.Sleep(200 * time.Millisecond) + }) + // goodbye + for ; s.anyNodeRunning(); time.Sleep(100 * time.Millisecond) { + s.withEachPid(func(p *os.Process) { + s.Logf("killing node %d\n", p.Pid) + if err := p.Kill(); err != nil { + s.Logf("failed to kill node with pid %d: %s\n", p.Pid, err) + } + }) + } + s.ChainStarted = false +} + +func (s *SystemUnderTest) withEachPid(cb func(p *os.Process)) { + s.pidsLock.RLock() + pids := maps.Keys(s.pids) + s.pidsLock.RUnlock() + + for pid := range pids { + p, err := os.FindProcess(pid) + if err != nil { + continue + } + cb(p) + } +} + +// PrintBuffer prints the chain logs to the console +func (s *SystemUnderTest) PrintBuffer() { + s.outBuff.Do(func(v interface{}) { + if v != nil { + _, _ = fmt.Fprintf(s.out, "out> %s\n", v) + } + }) + fmt.Fprint(s.out, "8< chain err -----------------------------------------\n") + s.errBuff.Do(func(v interface{}) { + if v != nil { + _, _ = fmt.Fprintf(s.out, "err> %s\n", v) + } + }) +} + +// AwaitNBlocks blocks until the current height + n block is reached. An optional timeout parameter can be passed to abort early +func (s *SystemUnderTest) AwaitNBlocks(t *testing.T, n int64, timeout ...time.Duration) { + t.Helper() + s.AwaitBlockHeight(t, s.CurrentHeight()+n, timeout...) +} + +// AwaitBlockHeight blocks until the target height is reached. An optional timeout parameter can be passed to abort early +func (s *SystemUnderTest) AwaitBlockHeight(t *testing.T, targetHeight int64, timeout ...time.Duration) { + t.Helper() + require.Greater(t, targetHeight, s.currentHeight.Load()) + var maxWaitTime time.Duration + if len(timeout) != 0 { + maxWaitTime = timeout[0] + } else { + maxWaitTime = time.Duration(targetHeight-s.currentHeight.Load()+3) * s.blockTime + } + abort := time.NewTimer(maxWaitTime).C + for { + select { + case <-abort: + t.Fatalf("Timeout - block %d not reached within %s", targetHeight, maxWaitTime) + return + default: + if current := s.AwaitNextBlock(t); current >= targetHeight { + return + } + } + } +} + +// AwaitNextBlock is a first class function that any caller can use to ensure a new block was minted. +// Returns the new height +func (s *SystemUnderTest) AwaitNextBlock(t *testing.T, timeout ...time.Duration) int64 { + t.Helper() + maxWaitTime := s.blockTime * 3 + if len(timeout) != 0 { // optional argument to overwrite default timeout + maxWaitTime = timeout[0] + } + done := make(chan int64) + go func() { + for start, current := s.currentHeight.Load(), s.currentHeight.Load(); current == start; current = s.currentHeight.Load() { + time.Sleep(s.blockTime) + } + done <- s.currentHeight.Load() + close(done) + }() + select { + case v := <-done: + return v + case <-time.NewTimer(maxWaitTime).C: + t.Fatalf("Timeout - no block within %s", maxWaitTime) + return -1 + } +} + +// ResetDirtyChain reset chain when non default setup or state (dirty) +func (s *SystemUnderTest) ResetDirtyChain(t *testing.T) { + t.Helper() + if s.IsDirty() { + s.ResetChain(t) + } +} + +// ResetChain stops and clears all nodes state via 'unsafe-reset-all' +func (s *SystemUnderTest) ResetChain(t *testing.T) { + t.Helper() + t.Log("Reset chain") + s.StopChain() + restoreOriginalGenesis(t, s) + restoreOriginalKeyring(t, s) + s.resetBuffers() + + // remove all additional nodes + for i := s.initialNodesCount; i < s.nodesCount; i++ { + _ = os.RemoveAll(filepath.Join(WorkDir, s.nodePath(i))) + _ = os.Remove(filepath.Join(WorkDir, s.outputDir, fmt.Sprintf("node%d.out", i))) + } + s.nodesCount = s.initialNodesCount + + // reset all validator nodes + s.ForEachNodeExecAndWait(t, []string{"comet", "unsafe-reset-all"}) + s.currentHeight.Store(0) + s.dirty = false +} + +// ModifyGenesisCLI executes the CLI commands to modify the genesis +func (s *SystemUnderTest) ModifyGenesisCLI(t *testing.T, cmds ...[]string) { + t.Helper() + s.ForEachNodeExecAndWait(t, cmds...) + s.MarkDirty() +} + +type GenesisMutator func([]byte) []byte + +// ModifyGenesisJSON resets the chain and executes the callbacks to update the json representation +// The mutator callbacks after each other receive the genesis as raw bytes and return the updated genesis for the next. +// example: +// +// return func(genesis []byte) []byte { +// val, _ := json.Marshal(sdk.NewDecCoins(fees...)) +// state, _ := sjson.SetRawBytes(genesis, "app_state.globalfee.params.minimum_gas_prices", val) +// return state +// } +func (s *SystemUnderTest) ModifyGenesisJSON(t *testing.T, mutators ...GenesisMutator) { + t.Helper() + s.ResetChain(t) + s.modifyGenesisJSON(t, mutators...) +} + +// modify json without enforcing a reset +func (s *SystemUnderTest) modifyGenesisJSON(t *testing.T, mutators ...GenesisMutator) { + t.Helper() + require.Empty(t, s.currentHeight.Load(), "forced chain reset required") + current, err := os.ReadFile(filepath.Join(WorkDir, s.nodePath(0), "config", "genesis.json")) + require.NoError(t, err) + for _, m := range mutators { + current = m(current) + } + out := StoreTempFile(t, current) + defer os.Remove(out.Name()) + s.setGenesis(t, out.Name()) + s.MarkDirty() +} + +// ReadGenesisJSON returns current genesis.json content as raw string +func (s *SystemUnderTest) ReadGenesisJSON(t *testing.T) string { + t.Helper() + content, err := os.ReadFile(filepath.Join(WorkDir, s.nodePath(0), "config", "genesis.json")) + require.NoError(t, err) + return string(content) +} + +// setGenesis copy genesis file to all nodes +func (s *SystemUnderTest) setGenesis(t *testing.T, srcPath string) { + t.Helper() + in, err := os.Open(srcPath) + require.NoError(t, err) + defer in.Close() + var buf bytes.Buffer + + _, err = io.Copy(&buf, in) + require.NoError(t, err) + + s.withEachNodeHome(func(i int, home string) { + require.NoError(t, saveGenesis(home, buf.Bytes())) + }) +} + +func saveGenesis(home string, content []byte) error { + out, err := os.Create(filepath.Join(WorkDir, home, "config", "genesis.json")) + if err != nil { + return fmt.Errorf("out file: %w", err) + } + defer out.Close() + + if _, err = io.Copy(out, bytes.NewReader(content)); err != nil { + return fmt.Errorf("write out file: %w", err) + } + + if err = out.Close(); err != nil { + return fmt.Errorf("close out file: %w", err) + } + return nil +} + +// ForEachNodeExecAndWait runs the given app executable commands for all cluster nodes synchronously +// The commands output is returned for each node. +func (s *SystemUnderTest) ForEachNodeExecAndWait(t *testing.T, cmds ...[]string) [][]string { + t.Helper() + result := make([][]string, s.nodesCount) + s.withEachNodeHome(func(i int, home string) { + result[i] = make([]string, len(cmds)) + for j, xargs := range cmds { + xargs = append(xargs, "--home", home) + s.Logf("Execute `%s %s`\n", s.execBinary, strings.Join(xargs, " ")) + out := MustRunShellCmd(t, s.execBinary, xargs...) + s.Logf("Result: %s\n", out) + result[i][j] = out + } + }) + return result +} + +func MustRunShellCmd(t *testing.T, cmd string, args ...string) string { + t.Helper() + out, err := RunShellCmd(cmd, args...) + require.NoError(t, err, out) + return out +} + +func RunShellCmd(cmd string, args ...string) (string, error) { + c := exec.Command( //nolint:gosec // used by tests only + locateExecutable(cmd), + args..., + ) + c.Dir = WorkDir + out, err := c.CombinedOutput() + if err != nil { + return string(out), fmt.Errorf("run `%s %s`: out: %s: %w", cmd, strings.Join(args, " "), string(out), err) + } + return string(out), nil +} + +// startNodesAsync runs the given app cli command for all cluster nodes and returns without waiting +func (s *SystemUnderTest) startNodesAsync(t *testing.T, xargs ...string) { + t.Helper() + s.withEachNodeHome(func(i int, home string) { + args := append(xargs, "--home="+home) + s.Logf("Execute `%s %s`\n", s.execBinary, strings.Join(args, " ")) + cmd := exec.Command( //nolint:gosec // used by tests only + locateExecutable(s.execBinary), + args..., + ) + cmd.Dir = WorkDir + s.watchLogs(i, cmd) + require.NoError(t, cmd.Start(), "node %d", i) + s.Logf("Node started: %d\n", cmd.Process.Pid) + + // cleanup when stopped + s.awaitProcessCleanup(cmd) + }) +} + +// tracks the PID in state with a go routine waiting for the shutdown completion to unregister +func (s *SystemUnderTest) awaitProcessCleanup(cmd *exec.Cmd) { + pid := cmd.Process.Pid + s.pidsLock.Lock() + s.pids[pid] = struct{}{} + s.pidsLock.Unlock() + go func() { + _ = cmd.Wait() // blocks until shutdown + s.Logf("Node stopped: %d\n", pid) + s.pidsLock.Lock() + delete(s.pids, pid) + s.pidsLock.Unlock() + }() +} + +func (s *SystemUnderTest) withEachNodeHome(cb func(i int, home string)) { + for i := 0; i < s.nodesCount; i++ { + cb(i, s.nodePath(i)) + } +} + +// NodeDir returns the workdir and path to the node home folder. +func (s *SystemUnderTest) NodeDir(i int) string { + return filepath.Join(WorkDir, s.nodePath(i)) +} + +// nodePath returns the path of the node within the work dir. not absolute +func (s *SystemUnderTest) nodePath(i int) string { + return NodePath(i, s.outputDir, s.projectName) +} + +func NodePath(n int, outputDir, name string) string { + return fmt.Sprintf("%s/node%d/%s", outputDir, n, name) +} + +func (s *SystemUnderTest) Log(msg string) { + if s.verbose { + _, _ = fmt.Fprint(s.out, msg) + } +} + +func (s *SystemUnderTest) Logf(msg string, args ...interface{}) { + s.Log(fmt.Sprintf(msg, args...)) +} + +func (s *SystemUnderTest) RPCClient(t *testing.T) RPCClient { + t.Helper() + return NewRPCClient(t, s.rpcAddr) +} + +func (s *SystemUnderTest) APIAddress() string { + return s.apiAddr +} + +func (s *SystemUnderTest) AllPeers(t *testing.T) []string { + t.Helper() + result := make([]string, s.nodesCount) + for i, n := range s.AllNodes(t) { + result[i] = n.PeerAddr() + } + return result +} + +func (s *SystemUnderTest) AllNodes(t *testing.T) []Node { + t.Helper() + return AllNodes(t, s) +} + +func AllNodes(t *testing.T, s *SystemUnderTest) []Node { + t.Helper() + result := make([]Node, s.nodesCount) + outs := s.ForEachNodeExecAndWait(t, []string{"comet", "show-node-id"}) + ip := "127.0.0.1" + if false { // is there still a use case for external ip? + var err error + ip, err = server.ExternalIP() + require.NoError(t, err) + } + for i, out := range outs { + result[i] = Node{ + ID: strings.TrimSpace(out[0]), + IP: ip, + RPCPort: 26657 + i, // as defined in testnet command + P2PPort: 16656 + i, // as defined in testnet command + } + } + return result +} + +func (s *SystemUnderTest) resetBuffers() { + s.outBuff = ring.New(100) + s.errBuff = ring.New(100) +} + +// AddFullnode starts a new fullnode that connects to the existing chain but is not a validator. +func (s *SystemUnderTest) AddFullnode(t *testing.T, beforeStart ...func(nodeNumber int, nodePath string)) Node { + t.Helper() + s.MarkDirty() + s.nodesCount++ + nodeNumber := s.nodesCount - 1 + nodePath := s.nodePath(nodeNumber) + _ = os.RemoveAll(nodePath) // drop any legacy path, just in case + + // prepare new node + moniker := fmt.Sprintf("node%d", nodeNumber) + args := []string{"init", moniker, "--home=" + nodePath, "--overwrite"} + s.Logf("Execute `%s %s`\n", s.execBinary, strings.Join(args, " ")) + cmd := exec.Command( //nolint:gosec // used by tests only + locateExecutable(s.execBinary), + args..., + ) + cmd.Dir = WorkDir + s.watchLogs(nodeNumber, cmd) + require.NoError(t, cmd.Run(), "failed to start node with id %d", nodeNumber) + require.NoError(t, saveGenesis(nodePath, []byte(s.ReadGenesisJSON(t)))) + + configPath := filepath.Join(WorkDir, nodePath, "config") + + // start node + allNodes := s.AllNodes(t) + node := allNodes[len(allNodes)-1] + // quick hack: copy config and overwrite by start params + for _, tomlFile := range []string{"config.toml", "app.toml"} { + configFile := filepath.Join(configPath, tomlFile) + _ = os.Remove(configFile) + _ = MustCopyFile(filepath.Join(WorkDir, s.nodePath(0), "config", tomlFile), configFile) + } + peers := make([]string, len(allNodes)-1) + for i, n := range allNodes[0 : len(allNodes)-1] { + peers[i] = n.PeerAddr() + } + for _, c := range beforeStart { + c(nodeNumber, nodePath) + } + args = []string{ + "start", + "--p2p.persistent_peers=" + strings.Join(peers, ","), + fmt.Sprintf("--p2p.laddr=tcp://localhost:%d", node.P2PPort), + fmt.Sprintf("--rpc.laddr=tcp://localhost:%d", node.RPCPort), + fmt.Sprintf("--grpc.address=localhost:%d", DefaultGrpcPort+nodeNumber), + "--p2p.pex=false", + "--moniker=" + moniker, + "--log_level=info", + "--log_no_color", + "--home", nodePath, + } + s.Logf("Execute `%s %s`\n", s.execBinary, strings.Join(args, " ")) + cmd = exec.Command( //nolint:gosec // used by tests only + locateExecutable(s.execBinary), + args..., + ) + cmd.Dir = WorkDir + s.watchLogs(nodeNumber, cmd) + require.NoError(t, cmd.Start(), "node %d", nodeNumber) + s.awaitProcessCleanup(cmd) + return node +} + +// NewEventListener constructor for Eventlistener with system rpc address +func (s *SystemUnderTest) NewEventListener(t *testing.T) *EventListener { + t.Helper() + return NewEventListener(t, s.rpcAddr) +} + +// is any process let running? +func (s *SystemUnderTest) anyNodeRunning() bool { + s.pidsLock.RLock() + defer s.pidsLock.RUnlock() + return len(s.pids) != 0 +} + +func (s *SystemUnderTest) CurrentHeight() int64 { + return s.currentHeight.Load() +} + +// NodesCount returns the number of node instances used +func (s *SystemUnderTest) NodesCount() int { + return s.nodesCount +} + +func (s *SystemUnderTest) BlockTime() time.Duration { + return s.blockTime +} + +type Node struct { + ID string + IP string + RPCPort int + P2PPort int +} + +func (n Node) PeerAddr() string { + return fmt.Sprintf("%s@%s:%d", n.ID, n.IP, n.P2PPort) +} + +func (n Node) RPCAddr() string { + return fmt.Sprintf("tcp://%s:%d", n.IP, n.RPCPort) +} + +// locateExecutable looks up the binary on the OS path. +func locateExecutable(file string) string { + if strings.TrimSpace(file) == "" { + panic("executable binary name must not be empty") + } + path, err := exec.LookPath(file) + if err != nil { + panic(fmt.Sprintf("unexpected error with file %q: %s", file, err.Error())) + } + if path == "" { + panic(fmt.Sprintf("%q not found", file)) + } + return path +} + +// EventListener watches for events on the chain +type EventListener struct { + t *testing.T + client *client.HTTP +} + +// NewEventListener event listener +func NewEventListener(t *testing.T, rpcAddr string) *EventListener { + t.Helper() + httpClient, err := client.New(rpcAddr, "/websocket") + require.NoError(t, err) + require.NoError(t, httpClient.Start()) + return &EventListener{client: httpClient, t: t} +} + +var DefaultWaitTime = 30 * time.Second + +type ( + CleanupFn func() + EventConsumer func(e ctypes.ResultEvent) (more bool) +) + +// Subscribe to receive events for a topic. Does not block. +// For query syntax See https://docs.cosmos.network/master/core/events.html#subscribing-to-events +func (l *EventListener) Subscribe(query string, cb EventConsumer) func() { + ctx, done := context.WithCancel(context.Background()) + l.t.Cleanup(done) + eventsChan, err := l.client.WSEvents.Subscribe(ctx, "testing", query) + require.NoError(l.t, err) + cleanup := func() { + ctx, _ := context.WithTimeout(ctx, DefaultWaitTime) //nolint:govet // used in cleanup only + go l.client.WSEvents.Unsubscribe(ctx, "testing", query) //nolint:errcheck // used by tests only + done() + } + go func() { + for e := range eventsChan { + if !cb(e) { + return + } + } + }() + return cleanup +} + +// AwaitQuery blocks and waits for a single result or timeout. This can be used with `broadcast-mode=async`. +// For query syntax See https://docs.cosmos.network/master/core/events.html#subscribing-to-events +func (l *EventListener) AwaitQuery(query string, optMaxWaitTime ...time.Duration) *ctypes.ResultEvent { + c, result := CaptureSingleEventConsumer() + maxWaitTime := DefaultWaitTime + if len(optMaxWaitTime) != 0 { + maxWaitTime = optMaxWaitTime[0] + } + cleanupFn := l.Subscribe(query, TimeoutConsumer(l.t, maxWaitTime, c)) + l.t.Cleanup(cleanupFn) + return result +} + +// TimeoutConsumer is an event consumer decorator with a max wait time. Panics when wait time exceeded without +// a result returned +func TimeoutConsumer(t *testing.T, maxWaitTime time.Duration, next EventConsumer) EventConsumer { + t.Helper() + ctx, done := context.WithCancel(context.Background()) + t.Cleanup(done) + timeout := time.NewTimer(maxWaitTime) + timedOut := make(chan struct{}, 1) + go func() { + select { + case <-ctx.Done(): + case <-timeout.C: + timedOut <- struct{}{} + close(timedOut) + } + }() + return func(e ctypes.ResultEvent) (more bool) { + select { + case <-timedOut: + t.Fatalf("Timeout waiting for new events %s", maxWaitTime) + return false + default: + timeout.Reset(maxWaitTime) + result := next(e) + if !result { + done() + } + return result + } + } +} + +// CaptureSingleEventConsumer consumes one event. No timeout +func CaptureSingleEventConsumer() (EventConsumer, *ctypes.ResultEvent) { + var result ctypes.ResultEvent + return func(e ctypes.ResultEvent) (more bool) { + return false + }, &result +} + +// CaptureAllEventsConsumer is an `EventConsumer` that captures all events until `done()` is called to stop or timeout happens. +// The consumer works async in the background and returns all the captured events when `done()` is called. +// This can be used to verify that certain events have happened. +// Example usage: +// +// c, done := CaptureAllEventsConsumer(t) +// query := `tm.event='Tx'` +// cleanupFn := l.Subscribe(query, c) +// t.Cleanup(cleanupFn) +// +// // do something in your test that create events +// +// assert.Len(t, done(), 1) // then verify your assumption +func CaptureAllEventsConsumer(t *testing.T, optMaxWaitTime ...time.Duration) (c EventConsumer, done func() []ctypes.ResultEvent) { + t.Helper() + maxWaitTime := DefaultWaitTime + if len(optMaxWaitTime) != 0 { + maxWaitTime = optMaxWaitTime[0] + } + var ( + mu sync.Mutex + capturedEvents []ctypes.ResultEvent + exit bool + ) + collectEventsConsumer := func(e ctypes.ResultEvent) (more bool) { + mu.Lock() + defer mu.Unlock() + if exit { + return false + } + capturedEvents = append(capturedEvents, e) + return true + } + + return TimeoutConsumer(t, maxWaitTime, collectEventsConsumer), func() []ctypes.ResultEvent { + mu.Lock() + defer mu.Unlock() + exit = true + return capturedEvents + } +} + +// restoreOriginalGenesis replace nodes genesis by the one created on setup +func restoreOriginalGenesis(t *testing.T, s *SystemUnderTest) { + t.Helper() + src := filepath.Join(WorkDir, s.nodePath(0), "config", "genesis.json.orig") + s.setGenesis(t, src) +} + +// restoreOriginalKeyring replaces test keyring with original +func restoreOriginalKeyring(t *testing.T, s *SystemUnderTest) { + t.Helper() + dest := filepath.Join(WorkDir, s.outputDir, "keyring-test") + require.NoError(t, os.RemoveAll(dest)) + for i := 0; i < s.initialNodesCount; i++ { + src := filepath.Join(WorkDir, s.nodePath(i), "keyring-test") + MustCopyFilesInDir(src, dest) + } +} diff --git a/systemtests/test_runner.go b/systemtests/test_runner.go new file mode 100644 index 000000000000..2cd4fefbf4b2 --- /dev/null +++ b/systemtests/test_runner.go @@ -0,0 +1,129 @@ +package systemtests + +import ( + "flag" + "fmt" + "os" + "os/exec" + "strconv" + "strings" + "testing" + "time" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var ( + Sut *SystemUnderTest + Verbose bool + execBinaryName string +) + +func RunTests(m *testing.M) { + waitTime := flag.Duration("wait-time", DefaultWaitTime, "time to wait for chain events") + nodesCount := flag.Int("nodes-count", 4, "number of nodes in the cluster") + blockTime := flag.Duration("block-time", 1000*time.Millisecond, "block creation time") + execBinary := flag.String("binary", "simd", "executable binary for server/ client side") + bech32Prefix := flag.String("bech32", "cosmos", "bech32 prefix to be used with addresses") + flag.BoolVar(&Verbose, "verbose", false, "verbose output") + flag.Parse() + + // fail fast on most common setup issue + requireEnoughFileHandlers(*nodesCount + 1) // +1 as tests may start another node + + dir, err := os.Getwd() + if err != nil { + panic(err) + } + WorkDir = dir + if Verbose { + println("Work dir: ", WorkDir) + } + initSDKConfig(*bech32Prefix) + + DefaultWaitTime = *waitTime + if *execBinary == "" { + panic("executable binary name must not be empty") + } + execBinaryName = *execBinary + + Sut = NewSystemUnderTest(*execBinary, Verbose, *nodesCount, *blockTime) + Sut.SetupChain() // setup chain and keyring + + // run tests + exitCode := m.Run() + + // postprocess + Sut.StopChain() + if Verbose || exitCode != 0 { + Sut.PrintBuffer() + printResultFlag(exitCode == 0) + } + + os.Exit(exitCode) +} + +func GetSystemUnderTest() *SystemUnderTest { + return Sut +} + +func IsVerbose() bool { + return Verbose +} + +func GetExecutableName() string { + return execBinaryName +} + +// requireEnoughFileHandlers uses `ulimit` +func requireEnoughFileHandlers(nodesCount int) { + ulimit, err := exec.LookPath("ulimit") + if err != nil || ulimit == "" { // skip when not available + return + } + + cmd := exec.Command(ulimit, "-n") + cmd.Dir = WorkDir + out, err := cmd.CombinedOutput() + if err != nil { + panic(fmt.Sprintf("unexpected error :%#+v, output: %s", err, string(out))) + } + fileDescrCount, err := strconv.Atoi(strings.Trim(string(out), " \t\n")) + if err != nil { + panic(fmt.Sprintf("unexpected error :%#+v, output: %s", err, string(out))) + } + expFH := nodesCount * 260 // random number that worked on my box + if fileDescrCount < expFH { + panic(fmt.Sprintf("Fail fast. Insufficient setup. Run 'ulimit -n %d'", expFH)) + } +} + +func initSDKConfig(bech32Prefix string) { + config := sdk.GetConfig() + config.SetBech32PrefixForAccount(bech32Prefix, bech32Prefix+sdk.PrefixPublic) + config.SetBech32PrefixForValidator(bech32Prefix+sdk.PrefixValidator+sdk.PrefixOperator, bech32Prefix+sdk.PrefixValidator+sdk.PrefixOperator+sdk.PrefixPublic) + config.SetBech32PrefixForConsensusNode(bech32Prefix+sdk.PrefixValidator+sdk.PrefixConsensus, bech32Prefix+sdk.PrefixValidator+sdk.PrefixConsensus+sdk.PrefixPublic) +} + +const ( + successFlag = ` + ___ _ _ ___ ___ ___ ___ ___ +/ __| | | |/ __/ __/ _ \/ __/ __| +\__ \ |_| | (_| (_| __/\__ \__ \ +|___/\__,_|\___\___\___||___/___/` + failureFlag = ` + __ _ _ _ + / _| (_) | | | +| |_ __ _ _| | ___ __| | +| _/ _| | | |/ _ \/ _| | +| || (_| | | | __/ (_| | +|_| \__,_|_|_|\___|\__,_|` +) + +func printResultFlag(ok bool) { + if ok { + fmt.Println(successFlag) + } else { + fmt.Println(failureFlag) + } +} diff --git a/systemtests/testnet_init.go b/systemtests/testnet_init.go new file mode 100644 index 000000000000..d64d26c433d7 --- /dev/null +++ b/systemtests/testnet_init.go @@ -0,0 +1,260 @@ +package systemtests + +import ( + "fmt" + "os" + "path/filepath" + "strconv" + "strings" + "time" + + "github.com/cometbft/cometbft/p2p" + "github.com/creachadair/tomledit" + "github.com/creachadair/tomledit/parser" +) + +type LegacySingleNode struct { + execBinary string + workDir string + chainID string + outputDir string + minGasPrice string + log func(string) +} + +// NewLegacySingleNodeInitializer constructor +func NewLegacySingleNodeInitializer( + execBinary, workDir, chainID, outputDir string, + minGasPrice string, + log func(string), +) *LegacySingleNode { + return &LegacySingleNode{ + execBinary: execBinary, + workDir: workDir, + chainID: chainID, + outputDir: outputDir, + minGasPrice: minGasPrice, + log: log, + } +} + +func (s LegacySingleNode) Initialize() { + args := []string{ + "testnet", + "init-files", + "--chain-id=" + s.chainID, + "--output-dir=" + s.outputDir, + "--v=1", + "--keyring-backend=test", + "--minimum-gas-prices=" + s.minGasPrice, + } + + s.log(fmt.Sprintf("+++ %s %s\n", s.execBinary, strings.Join(args, " "))) + out, err := RunShellCmd(s.execBinary, args...) + if err != nil { + panic(err) + } + s.log(out) +} + +// SingleHostTestnetCmdInitializer default testnet cmd that supports the --single-host param +type SingleHostTestnetCmdInitializer struct { + execBinary string + workDir string + chainID string + outputDir string + initialNodesCount int + minGasPrice string + commitTimeout time.Duration + log func(string) +} + +// NewSingleHostTestnetCmdInitializer constructor +func NewSingleHostTestnetCmdInitializer( + execBinary, workDir, chainID, outputDir string, + initialNodesCount int, + minGasPrice string, + commitTimeout time.Duration, + log func(string), +) *SingleHostTestnetCmdInitializer { + return &SingleHostTestnetCmdInitializer{ + execBinary: execBinary, + workDir: workDir, + chainID: chainID, + outputDir: outputDir, + initialNodesCount: initialNodesCount, + minGasPrice: minGasPrice, + commitTimeout: commitTimeout, + log: log, + } +} + +func LegacyInitializerWithBinary(binary string, sut *SystemUnderTest) TestnetInitializer { + return NewLegacySingleNodeInitializer(binary, WorkDir, sut.chainID, sut.outputDir, sut.minGasPrice, sut.Log) +} + +// InitializerWithBinary creates new SingleHostTestnetCmdInitializer from sut with given binary +func InitializerWithBinary(binary string, sut *SystemUnderTest) TestnetInitializer { + return NewSingleHostTestnetCmdInitializer( + binary, + WorkDir, + sut.chainID, + sut.outputDir, + sut.initialNodesCount, + sut.minGasPrice, + sut.CommitTimeout(), + sut.Log, + ) +} + +func (s SingleHostTestnetCmdInitializer) Initialize() { + args := []string{ + "testnet", + "init-files", + "--chain-id=" + s.chainID, + "--output-dir=" + s.outputDir, + "--validator-count=" + strconv.Itoa(s.initialNodesCount), + "--keyring-backend=test", + "--commit-timeout=" + s.commitTimeout.String(), + "--single-host", + "--minimum-gas-prices=" + s.minGasPrice, + } + + s.log(fmt.Sprintf("+++ %s %s\n", s.execBinary, strings.Join(args, " "))) + out, err := RunShellCmd(s.execBinary, args...) + if err != nil { + panic(err) + } + s.log(out) +} + +// ModifyConfigYamlInitializer testnet cmd prior to --single-host param. Modifies the toml files. +type ModifyConfigYamlInitializer struct { + execBinary string + workDir string + chainID string + outputDir string + initialNodesCount int + minGasPrice string + commitTimeout time.Duration + log func(string) + projectName string +} + +func NewModifyConfigYamlInitializer(exec string, s *SystemUnderTest) *ModifyConfigYamlInitializer { + return &ModifyConfigYamlInitializer{ + execBinary: exec, + workDir: WorkDir, + chainID: s.chainID, + outputDir: s.outputDir, + initialNodesCount: s.initialNodesCount, + minGasPrice: s.minGasPrice, + commitTimeout: s.CommitTimeout(), + log: s.Log, + projectName: s.projectName, + } +} + +func (s ModifyConfigYamlInitializer) Initialize() { + // init with legacy testnet command + args := []string{ + "testnet", + "init-files", + "--chain-id=" + s.chainID, + "--output-dir=" + s.outputDir, + "--v=" + strconv.Itoa(s.initialNodesCount), + "--keyring-backend=test", + "--minimum-gas-prices=" + s.minGasPrice, + } + + s.log(fmt.Sprintf("+++ %s %s\n", s.execBinary, strings.Join(args, " "))) + + out, err := RunShellCmd(s.execBinary, args...) + if err != nil { + panic(err) + } + s.log(out) + + nodeAddresses := make([]string, s.initialNodesCount) + for i := 0; i < s.initialNodesCount; i++ { + nodeDir := filepath.Join(WorkDir, NodePath(i, s.outputDir, s.projectName), "config") + id := string(mustV(p2p.LoadNodeKey(filepath.Join(nodeDir, "node_key.json"))).ID()) + nodeAddresses[i] = fmt.Sprintf("%s@127.0.0.1:%d", id, DefaultP2PPort+i) + } + + // then update configs + for i := 0; i < s.initialNodesCount; i++ { + nodeDir := filepath.Join(WorkDir, NodePath(i, s.outputDir, s.projectName), "config") + nodeNumber := i + EditToml(filepath.Join(nodeDir, "config.toml"), func(doc *tomledit.Document) { + UpdatePort(doc, DefaultRpcPort+i, "rpc", "laddr") + UpdatePort(doc, DefaultP2PPort+i, "p2p", "laddr") + SetBool(doc, false, "p2p", "addr_book_strict") + SetBool(doc, false, "p2p", "pex") + SetBool(doc, true, "p2p", "allow_duplicate_ip") + peers := make([]string, s.initialNodesCount) + copy(peers, nodeAddresses[0:nodeNumber]) + copy(peers[nodeNumber:], nodeAddresses[nodeNumber+1:]) + SetValue(doc, strings.Join(peers, ","), "p2p", "persistent_peers") + SetValue(doc, s.commitTimeout.String(), "consensus", "timeout_commit") + SetValue(doc, "goleveldb", "db_backend") + }) + EditToml(filepath.Join(nodeDir, "app.toml"), func(doc *tomledit.Document) { + UpdatePort(doc, DefaultApiPort+i, "api", "address") + UpdatePort(doc, DefaultGrpcPort+i, "grpc", "address") + }) + } +} + +func EditToml(filename string, f func(doc *tomledit.Document)) { + tomlFile := mustV(os.OpenFile(filename, os.O_RDWR, 0o600)) + defer tomlFile.Close() + doc := mustV(tomledit.Parse(tomlFile)) + f(doc) + mustV(tomlFile.Seek(0, 0)) // reset the cursor to the beginning of the file + must(tomlFile.Truncate(0)) + must(tomledit.Format(tomlFile, doc)) +} + +func SetBool(doc *tomledit.Document, newVal bool, xpath ...string) { + e := doc.First(xpath...) + if e == nil { + panic(fmt.Sprintf("not found: %v", xpath)) + } + e.Value = parser.MustValue(strconv.FormatBool(newVal)) +} + +func SetValue(doc *tomledit.Document, newVal string, xpath ...string) { + e := doc.First(xpath...) + if e == nil { + panic(fmt.Sprintf("not found: %v", xpath)) + } + e.Value = parser.MustValue(fmt.Sprintf("%q", newVal)) +} + +func UpdatePort(doc *tomledit.Document, newPort int, xpath ...string) { + e := doc.First(xpath...) + if e == nil { + panic(fmt.Sprintf("not found: %v", xpath)) + } + data := e.Value.X.String() + pos := strings.LastIndexAny(data, ":") + if pos == -1 { + panic("column not found") + } + data = data[0:pos+1] + strconv.Itoa(newPort) + e.Value = parser.MustValue(data + "\"") +} + +// mustV same as must but with value returned +func mustV[T any](r T, err error) T { + must(err) + return r +} + +// must simple panic on error for fluent calls +func must(err error) { + if err != nil { + panic(err) + } +} diff --git a/telemetry/metrics.go b/telemetry/metrics.go index a0cb15b11fa1..67ace50c53ec 100644 --- a/telemetry/metrics.go +++ b/telemetry/metrics.go @@ -3,15 +3,32 @@ package telemetry import ( "bytes" "encoding/json" + "errors" "fmt" + "net/http" "time" - "github.com/armon/go-metrics" - metricsprom "github.com/armon/go-metrics/prometheus" + "github.com/hashicorp/go-metrics" + "github.com/hashicorp/go-metrics/datadog" + metricsprom "github.com/hashicorp/go-metrics/prometheus" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/expfmt" ) +// globalTelemetryEnabled is a private variable that stores the telemetry enabled state. +// It is set on initialization and does not change for the lifetime of the program. +var globalTelemetryEnabled bool + +// IsTelemetryEnabled provides controlled access to check if telemetry is enabled. +func IsTelemetryEnabled() bool { + return globalTelemetryEnabled +} + +// EnableTelemetry allows for the global telemetry enabled state to be set. +func EnableTelemetry() { + globalTelemetryEnabled = true +} + // globalLabels defines the set of global labels that will be applied to all // metrics emitted using the telemetry package function wrappers. var globalLabels = []metrics.Label{} @@ -21,8 +38,18 @@ const ( FormatDefault = "" FormatPrometheus = "prometheus" FormatText = "text" + ContentTypeText = `text/plain; version=` + expfmt.TextVersion + `; charset=utf-8` + + MetricSinkInMem = "mem" + MetricSinkStatsd = "statsd" + MetricSinkDogsStatsd = "dogstatsd" ) +// DisplayableSink is an interface that defines a method for displaying metrics. +type DisplayableSink interface { + DisplayMetrics(resp http.ResponseWriter, req *http.Request) (any, error) +} + // Config defines the configuration options for application telemetry. type Config struct { // Prefixed with keys to separate services @@ -52,6 +79,17 @@ type Config struct { // Example: // [["chain_id", "cosmoshub-1"]] GlobalLabels [][]string `mapstructure:"global-labels"` + + // MetricsSink defines the type of metrics backend to use. + MetricsSink string `mapstructure:"metrics-sink" default:"mem"` + + // StatsdAddr defines the address of a statsd server to send metrics to. + // Only utilized if MetricsSink is set to "statsd" or "dogstatsd". + StatsdAddr string `mapstructure:"statsd-addr"` + + // DatadogHostname defines the hostname to use when emitting metrics to + // Datadog. Only utilized if MetricsSink is set to "dogstatsd". + DatadogHostname string `mapstructure:"datadog-hostname"` } // Metrics defines a wrapper around application telemetry functionality. It allows @@ -60,7 +98,7 @@ type Config struct { // by the operator. In addition to the sinks, when a process gets a SIGUSR1, a // dump of formatted recent metrics will be sent to STDERR. type Metrics struct { - memSink *metrics.InmemSink + sink metrics.MetricSink prometheusEnabled bool } @@ -72,16 +110,16 @@ type GatherResponse struct { // New creates a new instance of Metrics func New(cfg Config) (_ *Metrics, rerr error) { + globalTelemetryEnabled = cfg.Enabled if !cfg.Enabled { return nil, nil } - if numGlobalLables := len(cfg.GlobalLabels); numGlobalLables > 0 { - parsedGlobalLabels := make([]metrics.Label, numGlobalLables) + if numGlobalLabels := len(cfg.GlobalLabels); numGlobalLabels > 0 { + parsedGlobalLabels := make([]metrics.Label, numGlobalLabels) for i, gl := range cfg.GlobalLabels { parsedGlobalLabels[i] = NewLabel(gl[0], gl[1]) } - globalLabels = parsedGlobalLabels } @@ -89,16 +127,32 @@ func New(cfg Config) (_ *Metrics, rerr error) { metricsConf.EnableHostname = cfg.EnableHostname metricsConf.EnableHostnameLabel = cfg.EnableHostnameLabel - memSink := metrics.NewInmemSink(10*time.Second, time.Minute) - inMemSig := metrics.DefaultInmemSignal(memSink) - defer func() { - if rerr != nil { - inMemSig.Stop() - } - }() + var ( + sink metrics.MetricSink + err error + ) + switch cfg.MetricsSink { + case MetricSinkStatsd: + sink, err = metrics.NewStatsdSink(cfg.StatsdAddr) + case MetricSinkDogsStatsd: + sink, err = datadog.NewDogStatsdSink(cfg.StatsdAddr, cfg.DatadogHostname) + default: + memSink := metrics.NewInmemSink(10*time.Second, time.Minute) + sink = memSink + inMemSig := metrics.DefaultInmemSignal(memSink) + defer func() { + if rerr != nil { + inMemSig.Stop() + } + }() + } - m := &Metrics{memSink: memSink} - fanout := metrics.FanoutSink{memSink} + if err != nil { + return nil, err + } + + m := &Metrics{sink: sink} + fanout := metrics.FanoutSink{sink} if cfg.PrometheusRetentionTime > 0 { m.prometheusEnabled = true @@ -140,9 +194,11 @@ func (m *Metrics) Gather(format string) (GatherResponse, error) { } } +// gatherPrometheus collects Prometheus metrics and returns a GatherResponse. +// If Prometheus metrics are not enabled, it returns an error. func (m *Metrics) gatherPrometheus() (GatherResponse, error) { if !m.prometheusEnabled { - return GatherResponse{}, fmt.Errorf("prometheus metrics are not enabled") + return GatherResponse{}, errors.New("prometheus metrics are not enabled") } metricsFamilies, err := prometheus.DefaultGatherer.Gather() @@ -153,18 +209,25 @@ func (m *Metrics) gatherPrometheus() (GatherResponse, error) { buf := &bytes.Buffer{} defer buf.Reset() - e := expfmt.NewEncoder(buf, expfmt.FmtText) + e := expfmt.NewEncoder(buf, expfmt.NewFormat(expfmt.TypeTextPlain)) + for _, mf := range metricsFamilies { if err := e.Encode(mf); err != nil { return GatherResponse{}, fmt.Errorf("failed to encode prometheus metrics: %w", err) } } - return GatherResponse{ContentType: string(expfmt.FmtText), Metrics: buf.Bytes()}, nil + return GatherResponse{ContentType: ContentTypeText, Metrics: buf.Bytes()}, nil } +// gatherGeneric collects generic metrics and returns a GatherResponse. func (m *Metrics) gatherGeneric() (GatherResponse, error) { - summary, err := m.memSink.DisplayMetrics(nil, nil) + gm, ok := m.sink.(DisplayableSink) + if !ok { + return GatherResponse{}, errors.New("non in-memory metrics sink does not support generic format") + } + + summary, err := gm.DisplayMetrics(nil, nil) if err != nil { return GatherResponse{}, fmt.Errorf("failed to gather in-memory metrics: %w", err) } diff --git a/telemetry/metrics_test.go b/telemetry/metrics_test.go index aa4c934bfb58..b18c33cac63e 100644 --- a/telemetry/metrics_test.go +++ b/telemetry/metrics_test.go @@ -6,8 +6,7 @@ import ( "testing" "time" - "github.com/armon/go-metrics" - "github.com/prometheus/common/expfmt" + "github.com/hashicorp/go-metrics" "github.com/stretchr/testify/require" ) @@ -19,6 +18,7 @@ func TestMetrics_Disabled(t *testing.T) { func TestMetrics_InMem(t *testing.T) { m, err := New(Config{ + MetricsSink: MetricSinkInMem, Enabled: true, EnableHostname: false, ServiceName: "test", @@ -42,6 +42,7 @@ func TestMetrics_InMem(t *testing.T) { func TestMetrics_Prom(t *testing.T) { m, err := New(Config{ + MetricsSink: MetricSinkInMem, Enabled: true, EnableHostname: false, ServiceName: "test", @@ -56,7 +57,7 @@ func TestMetrics_Prom(t *testing.T) { gr, err := m.Gather(FormatPrometheus) require.NoError(t, err) - require.Equal(t, gr.ContentType, string(expfmt.FmtText)) + require.Equal(t, gr.ContentType, string(ContentTypeText)) require.True(t, strings.Contains(string(gr.Metrics), "test_dummy_counter 30")) } diff --git a/telemetry/wrapper.go b/telemetry/wrapper.go index c669c816a964..4362c46a4413 100644 --- a/telemetry/wrapper.go +++ b/telemetry/wrapper.go @@ -3,16 +3,14 @@ package telemetry import ( "time" - "github.com/armon/go-metrics" + "github.com/hashicorp/go-metrics" ) // Common metric key constants const ( - MetricKeyBeginBlocker = "begin_blocker" - MetricKeyEndBlocker = "end_blocker" - MetricKeyPrepareCheckStater = "prepare_check_stater" - MetricKeyPrecommiter = "precommiter" - MetricLabelNameModule = "module" + MetricKeyBeginBlocker = "begin_blocker" + MetricKeyEndBlocker = "end_blocker" + MetricLabelNameModule = "module" ) // NewLabel creates a new instance of Label with name and value @@ -24,6 +22,10 @@ func NewLabel(name, value string) metrics.Label { // metric for a module with a given set of keys. If any global labels are defined, // they will be added to the module label. func ModuleMeasureSince(module string, start time.Time, keys ...string) { + if !IsTelemetryEnabled() { + return + } + metrics.MeasureSinceWithLabels( keys, start.UTC(), @@ -35,6 +37,10 @@ func ModuleMeasureSince(module string, start time.Time, keys ...string) { // module with a given set of keys. If any global labels are defined, they will // be added to the module label. func ModuleSetGauge(module string, val float32, keys ...string) { + if !IsTelemetryEnabled() { + return + } + metrics.SetGaugeWithLabels( keys, val, @@ -45,29 +51,58 @@ func ModuleSetGauge(module string, val float32, keys ...string) { // IncrCounter provides a wrapper functionality for emitting a counter metric with // global labels (if any). func IncrCounter(val float32, keys ...string) { + if !IsTelemetryEnabled() { + return + } + metrics.IncrCounterWithLabels(keys, val, globalLabels) } // IncrCounterWithLabels provides a wrapper functionality for emitting a counter // metric with global labels (if any) along with the provided labels. func IncrCounterWithLabels(keys []string, val float32, labels []metrics.Label) { + if !IsTelemetryEnabled() { + return + } + metrics.IncrCounterWithLabels(keys, val, append(labels, globalLabels...)) } // SetGauge provides a wrapper functionality for emitting a gauge metric with // global labels (if any). func SetGauge(val float32, keys ...string) { + if !IsTelemetryEnabled() { + return + } + metrics.SetGaugeWithLabels(keys, val, globalLabels) } // SetGaugeWithLabels provides a wrapper functionality for emitting a gauge // metric with global labels (if any) along with the provided labels. func SetGaugeWithLabels(keys []string, val float32, labels []metrics.Label) { + if !IsTelemetryEnabled() { + return + } + metrics.SetGaugeWithLabels(keys, val, append(labels, globalLabels...)) } -// MeasureSince provides a wrapper functionality for emitting a a time measure +// MeasureSince provides a wrapper functionality for emitting a time measure // metric with global labels (if any). func MeasureSince(start time.Time, keys ...string) { + if !IsTelemetryEnabled() { + return + } + metrics.MeasureSinceWithLabels(keys, start.UTC(), globalLabels) } + +// Now return the current time if telemetry is enabled or a zero time if it's not +func Now() time.Time { + if !IsTelemetryEnabled() { + return time.Time{} + } + + return time.Now() +} diff --git a/telemetry/wrapper_test.go b/telemetry/wrapper_test.go new file mode 100644 index 000000000000..5388839874bc --- /dev/null +++ b/telemetry/wrapper_test.go @@ -0,0 +1,51 @@ +package telemetry + +import ( + "sync" + "testing" + "time" + + "github.com/stretchr/testify/assert" +) + +var mu sync.Mutex + +func initTelemetry(v bool) { + globalTelemetryEnabled = v +} + +// Reset the global state to a known disabled state before each test. +func setupTest(t *testing.T) { + t.Helper() + mu.Lock() // Ensure no other test can modify global state at the same time. + defer mu.Unlock() + initTelemetry(false) +} + +// TestNow tests the Now function when telemetry is enabled and disabled. +func TestNow(t *testing.T) { + setupTest(t) // Locks the mutex to avoid race condition. + + initTelemetry(true) + telemetryTime := Now() + assert.NotEqual(t, time.Time{}, telemetryTime, "Now() should not return zero time when telemetry is enabled") + + setupTest(t) // Reset the global state and lock the mutex again. + + initTelemetry(false) + telemetryTime = Now() + assert.Equal(t, time.Time{}, telemetryTime, "Now() should return zero time when telemetry is disabled") +} + +// TestIsTelemetryEnabled tests the IsTelemetryEnabled function. +func TestIsTelemetryEnabled(t *testing.T) { + setupTest(t) // Locks the mutex to avoid race condition. + + initTelemetry(true) + assert.True(t, IsTelemetryEnabled(), "IsTelemetryEnabled() should return true when globalTelemetryEnabled is set to true") + + setupTest(t) // Reset the global state and lock the mutex again. + + initTelemetry(false) + assert.False(t, IsTelemetryEnabled(), "IsTelemetryEnabled() should return false when globalTelemetryEnabled is set to false") +} diff --git a/tests/e2e/auth/suite.go b/tests/e2e/auth/suite.go index e6a1fc2963b4..fd12683c485d 100644 --- a/tests/e2e/auth/suite.go +++ b/tests/e2e/auth/suite.go @@ -7,12 +7,13 @@ import ( "strings" "testing" - "cosmossdk.io/depinject" - "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" + "cosmossdk.io/depinject" + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" addresscodec "github.com/cosmos/cosmos-sdk/codec/address" @@ -30,7 +31,6 @@ import ( authcli "github.com/cosmos/cosmos-sdk/x/auth/client/cli" authclitestutil "github.com/cosmos/cosmos-sdk/x/auth/client/testutil" authtestutil "github.com/cosmos/cosmos-sdk/x/auth/testutil" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" bank "github.com/cosmos/cosmos-sdk/x/bank/client/cli" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" @@ -98,7 +98,7 @@ func (s *E2ETestSuite) TestCLISignGenOnly() { account, err := val.ClientCtx.AccountRetriever.GetAccount(val.ClientCtx, addr) s.Require().NoError(err) - sendTokens := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))) + sendTokens := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(10))) args := []string{ keyName, // from keyname val2.Address.String(), @@ -204,8 +204,8 @@ func (s *E2ETestSuite) TestCLISignGenOnly() { func (s *E2ETestSuite) TestCLISignBatch() { val := s.network.Validators[0] sendTokens := sdk.NewCoins( - sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), sdk.NewInt(10)), - sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10)), + sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), math.NewInt(10)), + sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10)), ) generatedStd, err := s.createBankMsg(val, val.Address, @@ -288,50 +288,6 @@ func (s *E2ETestSuite) TestCLISignBatch() { s.Require().Equal(sigs[0].Sequence, seq1) } -func (s *E2ETestSuite) TestCliGetAccountAddressByID() { - require := s.Require() - val1 := s.network.Validators[0] - testCases := []struct { - name string - args []string - expectErr bool - }{ - { - "not enough args", - []string{fmt.Sprintf("--%s=json", flags.FlagOutput)}, - true, - }, - { - "invalid account id", - []string{fmt.Sprint(-1), fmt.Sprintf("--%s=json", flags.FlagOutput)}, - true, - }, - { - "valid account id", - []string{fmt.Sprint(0), fmt.Sprintf("--%s=json", flags.FlagOutput)}, - false, - }, - } - - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - cmd := authcli.GetAccountAddressByIDCmd() - clientCtx := val1.ClientCtx - - queryResJSON, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - var res authtypes.QueryAccountAddressByIDResponse - require.NoError(val1.ClientCtx.Codec.UnmarshalJSON(queryResJSON.Bytes(), &res)) - require.NotNil(res.GetAccountAddress()) - } - }) - } -} - func (s *E2ETestSuite) TestCLIQueryTxCmdByHash() { val := s.network.Validators[0] @@ -572,7 +528,7 @@ func (s *E2ETestSuite) TestCLIQueryTxsCmdByEvents() { []string{ fmt.Sprintf( "--query=tx.fee='%s'", - sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String(), + sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String(), ), fmt.Sprintf("--%s=json", flags.FlagOutput), }, @@ -583,7 +539,7 @@ func (s *E2ETestSuite) TestCLIQueryTxsCmdByEvents() { []string{ fmt.Sprintf( "--query=tx.fee='%s'", - sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(0))).String(), + sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(0))).String(), ), fmt.Sprintf("--%s=json", flags.FlagOutput), }, @@ -656,11 +612,11 @@ func (s *E2ETestSuite) TestCLISendGenerateSignAndBroadcast() { s.Require().NoError(err) s.Require().Equal(0, len(sigs)) - resp, err := clitestutil.QueryBalancesExec(val1.ClientCtx, val1.Address, addresscodec.NewBech32Codec("cosmos")) + resp, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/bank/v1beta1/balances/%s", val1.APIAddress, val1.Address)) s.Require().NoError(err) var balRes banktypes.QueryAllBalancesResponse - err = val1.ClientCtx.Codec.UnmarshalJSON(resp.Bytes(), &balRes) + err = val1.ClientCtx.Codec.UnmarshalJSON(resp, &balRes) s.Require().NoError(err) startTokens := balRes.Balances.AmountOf(s.cfg.BondDenom) @@ -723,10 +679,9 @@ func (s *E2ETestSuite) TestCLISendGenerateSignAndBroadcast() { s.Require().NoError(s.network.WaitForNextBlock()) // Ensure foo has right amount of funds - resp, err = clitestutil.QueryBalancesExec(val1.ClientCtx, val1.Address, addresscodec.NewBech32Codec("cosmos")) + resp, err = testutil.GetRequest(fmt.Sprintf("%s/cosmos/bank/v1beta1/balances/%s", val1.APIAddress, val1.Address)) s.Require().NoError(err) - - err = val1.ClientCtx.Codec.UnmarshalJSON(resp.Bytes(), &balRes) + err = val1.ClientCtx.Codec.UnmarshalJSON(resp, &balRes) s.Require().NoError(err) s.Require().Equal(startTokens, balRes.Balances.AmountOf(s.cfg.BondDenom)) @@ -745,20 +700,20 @@ func (s *E2ETestSuite) TestCLISendGenerateSignAndBroadcast() { // Ensure destiny account state err = s.network.RetryForBlocks(func() error { - resp, err = clitestutil.QueryBalancesExec(val1.ClientCtx, addr, addresscodec.NewBech32Codec("cosmos")) + resp, err = testutil.GetRequest(fmt.Sprintf("%s/cosmos/bank/v1beta1/balances/%s", val1.APIAddress, addr)) + s.Require().NoError(err) return err }, 3) s.Require().NoError(err) - err = val1.ClientCtx.Codec.UnmarshalJSON(resp.Bytes(), &balRes) + err = val1.ClientCtx.Codec.UnmarshalJSON(resp, &balRes) s.Require().NoError(err) s.Require().Equal(sendTokens.Amount, balRes.Balances.AmountOf(s.cfg.BondDenom)) // Ensure origin account state - resp, err = clitestutil.QueryBalancesExec(val1.ClientCtx, val1.Address, addresscodec.NewBech32Codec("cosmos")) + resp, err = testutil.GetRequest(fmt.Sprintf("%s/cosmos/bank/v1beta1/balances/%s", val1.APIAddress, val1.Address)) s.Require().NoError(err) - - err = val1.ClientCtx.Codec.UnmarshalJSON(resp.Bytes(), &balRes) + err = val1.ClientCtx.Codec.UnmarshalJSON(resp, &balRes) s.Require().NoError(err) } @@ -796,7 +751,7 @@ func (s *E2ETestSuite) TestCLIMultisignInsufficientCosigners() { addresscodec.NewBech32Codec("cosmos"), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=true", flags.FlagGenerateOnly), ) s.Require().NoError(err) @@ -877,11 +832,11 @@ func (s *E2ETestSuite) TestCLIMultisignSortSignatures() { addr, err := multisigRecord.GetAddress() s.Require().NoError(err) - resp, err := clitestutil.QueryBalancesExec(val1.ClientCtx, addr, addresscodec.NewBech32Codec("cosmos")) + resp, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/bank/v1beta1/balances/%s", val1.APIAddress, addr)) s.Require().NoError(err) var balRes banktypes.QueryAllBalancesResponse - err = val1.ClientCtx.Codec.UnmarshalJSON(resp.Bytes(), &balRes) + err = val1.ClientCtx.Codec.UnmarshalJSON(resp, &balRes) s.Require().NoError(err) intialCoins := balRes.Balances @@ -895,10 +850,9 @@ func (s *E2ETestSuite) TestCLIMultisignSortSignatures() { s.Require().NoError(err) s.Require().NoError(s.network.WaitForNextBlock()) - resp, err = clitestutil.QueryBalancesExec(val1.ClientCtx, addr, addresscodec.NewBech32Codec("cosmos")) + resp, err = testutil.GetRequest(fmt.Sprintf("%s/cosmos/bank/v1beta1/balances/%s", val1.APIAddress, addr)) s.Require().NoError(err) - - err = val1.ClientCtx.Codec.UnmarshalJSON(resp.Bytes(), &balRes) + err = val1.ClientCtx.Codec.UnmarshalJSON(resp, &balRes) s.Require().NoError(err) diff, _ := balRes.Balances.SafeSub(intialCoins...) s.Require().Equal(sendTokens.Amount, diff.AmountOf(s.cfg.BondDenom)) @@ -914,7 +868,7 @@ func (s *E2ETestSuite) TestCLIMultisignSortSignatures() { addresscodec.NewBech32Codec("cosmos"), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=true", flags.FlagGenerateOnly), ) s.Require().NoError(err) @@ -992,7 +946,7 @@ func (s *E2ETestSuite) TestSignWithMultisig() { addresscodec.NewBech32Codec("cosmos"), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=true", flags.FlagGenerateOnly), ) s.Require().NoError(err) @@ -1037,11 +991,11 @@ func (s *E2ETestSuite) TestCLIMultisign() { var balRes banktypes.QueryAllBalancesResponse err = s.network.RetryForBlocks(func() error { - resp, err := clitestutil.QueryBalancesExec(val1.ClientCtx, addr, addresscodec.NewBech32Codec("cosmos")) + resp, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/bank/v1beta1/balances/%s", val1.APIAddress, addr)) if err != nil { return err } - return val1.ClientCtx.Codec.UnmarshalJSON(resp.Bytes(), &balRes) + return val1.ClientCtx.Codec.UnmarshalJSON(resp, &balRes) }, 3) s.Require().NoError(err) s.Require().True(sendTokens.Amount.Equal(balRes.Balances.AmountOf(s.cfg.BondDenom))) @@ -1057,7 +1011,7 @@ func (s *E2ETestSuite) TestCLIMultisign() { addresscodec.NewBech32Codec("cosmos"), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=true", flags.FlagGenerateOnly), ) s.Require().NoError(err) @@ -1146,12 +1100,12 @@ func (s *E2ETestSuite) TestSignBatchMultisig() { addr, val.Address, sdk.NewCoins( - sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(1)), + sdk.NewCoin(s.cfg.BondDenom, math.NewInt(1)), ), addresscodec.NewBech32Codec("cosmos"), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=true", flags.FlagGenerateOnly), ) s.Require().NoError(err) @@ -1212,12 +1166,12 @@ func (s *E2ETestSuite) TestMultisignBatch() { addr, val.Address, sdk.NewCoins( - sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(1)), + sdk.NewCoin(s.cfg.BondDenom, math.NewInt(1)), ), addresscodec.NewBech32Codec("cosmos"), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=true", flags.FlagGenerateOnly), ) s.Require().NoError(err) @@ -1227,10 +1181,8 @@ func (s *E2ETestSuite) TestMultisignBatch() { defer filename.Close() val.ClientCtx.HomeDir = strings.Replace(val.ClientCtx.HomeDir, "simd", "simcli", 1) - queryResJSON, err := authclitestutil.QueryAccountExec(val.ClientCtx, addr, addresscodec.NewBech32Codec("cosmos")) + account, err := val.ClientCtx.AccountRetriever.GetAccount(val.ClientCtx, addr) s.Require().NoError(err) - var account sdk.AccountI - s.Require().NoError(val.ClientCtx.Codec.UnmarshalInterfaceJSON(queryResJSON.Bytes(), &account)) // sign-batch file addr1, err := account1.GetAddress() @@ -1269,121 +1221,6 @@ func (s *E2ETestSuite) TestMultisignBatch() { } } -func (s *E2ETestSuite) TestGetAccountCmd() { - val := s.network.Validators[0] - _, _, addr1 := testdata.KeyTestPubAddr() - - testCases := []struct { - name string - address sdk.AccAddress - expectErr bool - }{ - { - "invalid address", - addr1, - true, - }, - { - "valid address", - val.Address, - false, - }, - } - - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - clientCtx := val.ClientCtx - - out, err := authclitestutil.QueryAccountExec(clientCtx, tc.address, addresscodec.NewBech32Codec("cosmos")) - if tc.expectErr { - s.Require().Error(err) - s.Require().NotEqual("internal", err.Error()) - } else { - var acc sdk.AccountI - s.Require().NoError(val.ClientCtx.Codec.UnmarshalInterfaceJSON(out.Bytes(), &acc)) - s.Require().Equal(val.Address, acc.GetAddress()) - } - }) - } -} - -func (s *E2ETestSuite) TestGetAccountsCmd() { - val := s.network.Validators[0] - clientCtx := val.ClientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, authcli.GetAccountsCmd(), []string{ - fmt.Sprintf("--%s=json", flags.FlagOutput), - }) - s.Require().NoError(err) - - var res authtypes.QueryAccountsResponse - s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &res)) - s.Require().NotEmpty(res.Accounts) -} - -func (s *E2ETestSuite) TestQueryModuleAccountByNameCmd() { - val := s.network.Validators[0] - - testCases := []struct { - name string - moduleName string - expectErr bool - }{ - { - "invalid module name", - "gover", - true, - }, - { - "valid module name", - "mint", - false, - }, - } - - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - clientCtx := val.ClientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, authcli.QueryModuleAccountByNameCmd(), []string{ - tc.moduleName, - fmt.Sprintf("--%s=json", flags.FlagOutput), - }) - if tc.expectErr { - s.Require().Error(err) - s.Require().NotEqual("internal", err.Error()) - } else { - var res authtypes.QueryModuleAccountByNameResponse - s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &res)) - - var account sdk.AccountI - err := val.ClientCtx.InterfaceRegistry.UnpackAny(res.Account, &account) - s.Require().NoError(err) - - moduleAccount, ok := account.(sdk.ModuleAccountI) - s.Require().True(ok) - s.Require().Equal(tc.moduleName, moduleAccount.GetName()) - } - }) - } -} - -func (s *E2ETestSuite) TestQueryModuleAccountsCmd() { - val := s.network.Validators[0] - clientCtx := val.ClientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, authcli.QueryModuleAccountsCmd(), []string{ - fmt.Sprintf("--%s=json", flags.FlagOutput), - }) - s.Require().NoError(err) - - var res authtypes.QueryModuleAccountsResponse - s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &res)) - s.Require().NotEmpty(res.Accounts) -} - func TestGetBroadcastCommandOfflineFlag(t *testing.T) { cmd := authcli.GetBroadcastCommand() _ = testutil.ApplyMockIODiscardOutErr(cmd) @@ -1426,45 +1263,6 @@ func TestGetBroadcastCommandWithoutOfflineFlag(t *testing.T) { require.Contains(t, out.String(), "connect: connection refused") } -func (s *E2ETestSuite) TestQueryParamsCmd() { - val := s.network.Validators[0] - - testCases := []struct { - name string - args []string - expectErr bool - }{ - { - "happy case", - []string{fmt.Sprintf("--%s=json", flags.FlagOutput)}, - false, - }, - { - "with specific height", - []string{fmt.Sprintf("--%s=1", flags.FlagHeight), fmt.Sprintf("--%s=json", flags.FlagOutput)}, - false, - }, - } - - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - cmd := authcli.QueryParamsCmd() - clientCtx := val.ClientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - s.Require().NotEqual("internal", err.Error()) - } else { - var authParams authtypes.Params - s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &authParams)) - s.Require().NotNil(authParams.MaxMemoCharacters) - } - }) - } -} - // TestTxWithoutPublicKey makes sure sending a proto tx message without the // public key doesn't cause any error in the RPC layer (broadcast). // See https://github.com/cosmos/cosmos-sdk/issues/7585 for more details. @@ -1475,11 +1273,11 @@ func (s *E2ETestSuite) TestTxWithoutPublicKey() { // Create a txBuilder with an unsigned tx. txBuilder := txCfg.NewTxBuilder() msg := banktypes.NewMsgSend(val1.Address, val1.Address, sdk.NewCoins( - sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10)), + sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10)), )) err := txBuilder.SetMsgs(msg) s.Require().NoError(err) - txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(150)))) + txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(150)))) txBuilder.SetGasLimit(testdata.NewTestGasLimit()) // Set empty signature to set signer infos. sigV2 := signing.SignatureV2{ @@ -1532,8 +1330,8 @@ func (s *E2ETestSuite) TestTxWithoutPublicKey() { func (s *E2ETestSuite) TestSignWithMultiSignersAminoJSON() { require := s.Require() val0, val1 := s.network.Validators[0], s.network.Validators[1] - val0Coin := sdk.NewCoin(fmt.Sprintf("%stoken", val0.Moniker), sdk.NewInt(10)) - val1Coin := sdk.NewCoin(fmt.Sprintf("%stoken", val1.Moniker), sdk.NewInt(10)) + val0Coin := sdk.NewCoin(fmt.Sprintf("%stoken", val0.Moniker), math.NewInt(10)) + val1Coin := sdk.NewCoin(fmt.Sprintf("%stoken", val1.Moniker), math.NewInt(10)) _, _, addr1 := testdata.KeyTestPubAddr() // Creating a tx with 2 msgs from 2 signers: val0 and val1. @@ -1545,7 +1343,7 @@ func (s *E2ETestSuite) TestSignWithMultiSignersAminoJSON() { banktypes.NewMsgSend(val0.Address, addr1, sdk.NewCoins(val0Coin)), banktypes.NewMsgSend(val1.Address, addr1, sdk.NewCoins(val1Coin)), ) - txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10)))) + txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10)))) txBuilder.SetGasLimit(testdata.NewTestGasLimit() * 2) signers, err := txBuilder.GetTx().GetSigners() require.NoError(err) @@ -1593,10 +1391,10 @@ func (s *E2ETestSuite) TestSignWithMultiSignersAminoJSON() { require.Equal(uint32(0), txRes.Code, txRes.RawLog) // Make sure the addr1's balance got funded. - queryResJSON, err := clitestutil.QueryBalancesExec(val0.ClientCtx, addr1, addresscodec.NewBech32Codec("cosmos")) - require.NoError(err) + resp, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/bank/v1beta1/balances/%s", val0.APIAddress, addr1)) + s.Require().NoError(err) var queryRes banktypes.QueryAllBalancesResponse - err = val0.ClientCtx.Codec.UnmarshalJSON(queryResJSON.Bytes(), &queryRes) + err = val0.ClientCtx.Codec.UnmarshalJSON(resp, &queryRes) require.NoError(err) require.Equal(sdk.NewCoins(val0Coin, val1Coin), queryRes.Balances) } @@ -1604,7 +1402,7 @@ func (s *E2ETestSuite) TestSignWithMultiSignersAminoJSON() { func (s *E2ETestSuite) TestAuxSigner() { require := s.Require() val := s.network.Validators[0] - val0Coin := sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), sdk.NewInt(10)) + val0Coin := sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), math.NewInt(10)) testCases := []struct { name string @@ -1670,11 +1468,11 @@ func (s *E2ETestSuite) TestAuxToFeeWithTips() { tipper, err := acc.GetAddress() require.NoError(err) - tipperInitialBal := sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), sdk.NewInt(10000)) + tipperInitialBal := sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), math.NewInt(10000)) feePayer := val.Address - fee := sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(1000)) - tip := sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), sdk.NewInt(1000)) + fee := sdk.NewCoin(s.cfg.BondDenom, math.NewInt(1000)) + tip := sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), math.NewInt(1000)) require.NoError(s.network.WaitForNextBlock()) _, err = s.createBankMsg(val, tipper, sdk.NewCoins(tipperInitialBal)) @@ -1753,7 +1551,7 @@ func (s *E2ETestSuite) TestAuxToFeeWithTips() { name: "--tip flag unset: no error", tipper: tipper, feePayer: feePayer, - tip: sdk.Coin{Denom: fmt.Sprintf("%stoken", val.Moniker), Amount: sdk.NewInt(0)}, + tip: sdk.Coin{Denom: fmt.Sprintf("%stoken", val.Moniker), Amount: math.NewInt(0)}, tipperArgs: []string{ fmt.Sprintf("--%s=%s", flags.FlagSignMode, flags.SignModeDirectAux), fmt.Sprintf("--%s=true", flags.FlagAux), @@ -1824,7 +1622,7 @@ func (s *E2ETestSuite) TestAuxToFeeWithTips() { name: "wrong denom in tip: error", tipper: tipper, feePayer: feePayer, - tip: sdk.Coin{Denom: fmt.Sprintf("%stoken", val.Moniker), Amount: sdk.NewInt(0)}, + tip: sdk.Coin{Denom: fmt.Sprintf("%stoken", val.Moniker), Amount: math.NewInt(0)}, tipperArgs: []string{ fmt.Sprintf("--%s=%s", flags.FlagTip, "1000wrongDenom"), fmt.Sprintf("--%s=%s", flags.FlagSignMode, flags.SignModeDirectAux), @@ -1843,7 +1641,7 @@ func (s *E2ETestSuite) TestAuxToFeeWithTips() { name: "insufficient fees: error", tipper: tipper, feePayer: feePayer, - tip: sdk.Coin{Denom: fmt.Sprintf("%stoken", val.Moniker), Amount: sdk.NewInt(0)}, + tip: sdk.Coin{Denom: fmt.Sprintf("%stoken", val.Moniker), Amount: math.NewInt(0)}, tipperArgs: []string{ fmt.Sprintf("--%s=%s", flags.FlagTip, tip), fmt.Sprintf("--%s=%s", flags.FlagSignMode, flags.SignModeDirectAux), @@ -1878,12 +1676,6 @@ func (s *E2ETestSuite) TestAuxToFeeWithTips() { genTxFile := testutil.WriteToNewTempFile(s.T(), string(res.Bytes())) defer genTxFile.Close() - // broadcast the tx - res, err = authclitestutil.TxAuxToFeeExec( - val.ClientCtx, - genTxFile.Name(), - tc.feePayerArgs..., - ) s.Require().NoError(s.network.WaitForNextBlock()) switch { @@ -1921,7 +1713,7 @@ func (s *E2ETestSuite) createBankMsg(val *network.Validator, toAddr sdk.AccAddre fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%s", flags.FlagFees, - sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), } flags = append(flags, extraFlags...) @@ -1929,11 +1721,11 @@ func (s *E2ETestSuite) createBankMsg(val *network.Validator, toAddr sdk.AccAddre } func (s *E2ETestSuite) getBalances(clientCtx client.Context, addr sdk.AccAddress, denom string) math.Int { - resp, err := clitestutil.QueryBalancesExec(clientCtx, addr, addresscodec.NewBech32Codec("cosmos")) + resp, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/bank/v1beta1/balances/%s/by_denom?denom=%s", s.cfg.APIAddress, addr.String(), denom)) s.Require().NoError(err) var balRes banktypes.QueryAllBalancesResponse - err = clientCtx.Codec.UnmarshalJSON(resp.Bytes(), &balRes) + err = clientCtx.Codec.UnmarshalJSON(resp, &balRes) s.Require().NoError(err) startTokens := balRes.Balances.AmountOf(denom) return startTokens diff --git a/tests/e2e/authz/grpc.go b/tests/e2e/authz/grpc.go index 72de28813cba..24dd529b27a8 100644 --- a/tests/e2e/authz/grpc.go +++ b/tests/e2e/authz/grpc.go @@ -4,6 +4,8 @@ import ( "fmt" "time" + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" @@ -116,7 +118,7 @@ func (s *E2ETestSuite) TestQueryGrantsGRPC() { fmt.Sprintf("--%s=%s", cli.FlagMsgType, typeMsgVote), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=%d", cli.FlagExpiration, time.Now().Add(time.Minute*time.Duration(120)).Unix()), }) s.Require().NoError(err) @@ -197,7 +199,7 @@ func (s *E2ETestSuite) TestQueryGranterGrantsGRPC() { fmt.Sprintf("%s/cosmos/authz/v1beta1/grants/granter/%s", val.APIAddress, val.Address.String()), false, "", - 7, + 6, }, } for _, tc := range testCases { diff --git a/tests/e2e/authz/query.go b/tests/e2e/authz/query.go deleted file mode 100644 index e4e0f94073b8..000000000000 --- a/tests/e2e/authz/query.go +++ /dev/null @@ -1,267 +0,0 @@ -package authz - -import ( - "fmt" - "strings" - "time" - - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/codec/address" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/authz" - "github.com/cosmos/cosmos-sdk/x/authz/client/cli" - authzclitestutil "github.com/cosmos/cosmos-sdk/x/authz/client/testutil" -) - -func (s *E2ETestSuite) TestQueryAuthorizations() { - val := s.network.Validators[0] - - grantee := s.grantee[0] - twoHours := time.Now().Add(time.Minute * time.Duration(120)).Unix() - - _, err := authzclitestutil.CreateGrant( - val.ClientCtx, - []string{ - grantee.String(), - "send", - fmt.Sprintf("--%s=100stake", cli.FlagSpendLimit), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%d", cli.FlagExpiration, twoHours), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), - }, - ) - s.Require().NoError(err) - s.Require().NoError(s.network.WaitForNextBlock()) - - testCases := []struct { - name string - args []string - expectErr bool - expErrMsg string - }{ - { - "Error: Invalid grantee", - []string{ - val.Address.String(), - "invalid grantee", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - "decoding bech32 failed: invalid character in string: ' '", - }, - { - "Error: Invalid granter", - []string{ - "invalid granter", - grantee.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - "decoding bech32 failed: invalid character in string: ' '", - }, - { - "Valid txn (json)", - []string{ - val.Address.String(), - grantee.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - ``, - }, - } - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryGrants(address.NewBech32Codec("cosmos")) - clientCtx := val.ClientCtx - resp, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - s.Require().Contains(string(resp.Bytes()), tc.expErrMsg) - } else { - s.Require().NoError(err) - var grants authz.QueryGrantsResponse - err = val.ClientCtx.Codec.UnmarshalJSON(resp.Bytes(), &grants) - s.Require().NoError(err) - } - }) - } -} - -func (s *E2ETestSuite) TestQueryAuthorization() { - val := s.network.Validators[0] - - grantee := s.grantee[0] - twoHours := time.Now().Add(time.Minute * time.Duration(120)).Unix() - - _, err := authzclitestutil.CreateGrant( - val.ClientCtx, - []string{ - grantee.String(), - "send", - fmt.Sprintf("--%s=100stake", cli.FlagSpendLimit), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%d", cli.FlagExpiration, twoHours), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), - }, - ) - s.Require().NoError(err) - s.Require().NoError(s.network.WaitForNextBlock()) - - testCases := []struct { - name string - args []string - expectErr bool - expectedOutput string - }{ - { - "Error: Invalid grantee", - []string{ - val.Address.String(), - "invalid grantee", - typeMsgSend, - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - "", - }, - { - "Error: Invalid granter", - []string{ - "invalid granter", - grantee.String(), - typeMsgSend, - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - "", - }, - { - "no authorization found", - []string{ - val.Address.String(), - grantee.String(), - "typeMsgSend", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - "", - }, - { - "Valid txn (json)", - []string{ - val.Address.String(), - grantee.String(), - typeMsgSend, - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - `{"@type":"/cosmos.bank.v1beta1.SendAuthorization","spend_limit":[{"denom":"stake","amount":"100"}],"allow_list":[]}`, - }, - { - "Valid txn with allowed list (json)", - []string{ - val.Address.String(), - s.grantee[3].String(), - typeMsgSend, - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - fmt.Sprintf(`{"@type":"/cosmos.bank.v1beta1.SendAuthorization","spend_limit":[{"denom":"stake","amount":"88"}],"allow_list":["%s"]}`, s.grantee[4]), - }, - } - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryGrants(address.NewBech32Codec("cosmos")) - clientCtx := val.ClientCtx - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - s.Require().Contains(strings.TrimSpace(out.String()), tc.expectedOutput) - } - }) - } -} - -func (s *E2ETestSuite) TestQueryGranterGrants() { - val := s.network.Validators[0] - grantee := s.grantee[0] - require := s.Require() - - testCases := []struct { - name string - args []string - expectErr bool - expectedErr string - expItems int - }{ - { - "invalid address", - []string{ - "invalid-address", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - "decoding bech32 failed", - 0, - }, - { - "no authorization found", - []string{ - grantee.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - "", - 0, - }, - { - "valid case", - []string{ - val.Address.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - "", - 7, - }, - { - "valid case with pagination", - []string{ - val.Address.String(), - "--limit=2", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - "", - 2, - }, - } - for _, tc := range testCases { - s.Run(tc.name, func() { - cmd := cli.GetQueryGranterGrants(address.NewBech32Codec("cosmos")) - clientCtx := val.ClientCtx - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - if tc.expectErr { - require.Error(err) - require.Contains(out.String(), tc.expectedErr) - } else { - require.NoError(err) - var grants authz.QueryGranterGrantsResponse - require.NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &grants)) - require.Len(grants.Grants, tc.expItems) - } - }) - } -} diff --git a/tests/e2e/authz/tx.go b/tests/e2e/authz/tx.go index cb4e7671553b..225a8332e8ad 100644 --- a/tests/e2e/authz/tx.go +++ b/tests/e2e/authz/tx.go @@ -9,6 +9,8 @@ import ( // without this import amino json encoding will fail when resolving any types _ "cosmossdk.io/api/cosmos/authz/v1beta1" + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/client/flags" addresscodec "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/crypto/hd" @@ -76,7 +78,7 @@ func (s *E2ETestSuite) SetupSuite() { fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=%d", cli.FlagExpiration, time.Now().Add(time.Minute*time.Duration(120)).Unix()), }) s.Require().NoError(err) @@ -96,7 +98,7 @@ func (s *E2ETestSuite) SetupSuite() { fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=%d", cli.FlagExpiration, time.Now().Add(time.Minute*time.Duration(120)).Unix()), }) s.Require().NoError(err) @@ -119,7 +121,7 @@ func (s *E2ETestSuite) SetupSuite() { fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%d", cli.FlagExpiration, time.Now().Add(time.Minute*time.Duration(120)).Unix()), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=%s", cli.FlagAllowList, s.grantee[4]), }, ) @@ -149,9 +151,9 @@ func (s *E2ETestSuite) msgSendExec(grantee sdk.AccAddress) { val.ClientCtx, val.Address, grantee, - sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(200))), addresscodec.NewBech32Codec("cosmos"), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(200))), addresscodec.NewBech32Codec("cosmos"), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), ) s.Require().NoError(err) s.Require().Contains(out.String(), `"code":0`) @@ -170,7 +172,7 @@ var ( ) func execDelegate(val *network.Validator, args []string) (testutil.BufferWriter, error) { - cmd := stakingcli.NewDelegateCmd() + cmd := stakingcli.NewDelegateCmd(addresscodec.NewBech32Codec("cosmosvaloper"), addresscodec.NewBech32Codec("cosmos")) clientCtx := val.ClientCtx return clitestutil.ExecTestCLICmd(clientCtx, cmd, args) } @@ -192,7 +194,7 @@ func (s *E2ETestSuite) TestCmdRevokeAuthorizations() { fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%d", cli.FlagExpiration, twoHours), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, ) s.Require().NoError(err) @@ -209,7 +211,7 @@ func (s *E2ETestSuite) TestCmdRevokeAuthorizations() { fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%d", cli.FlagExpiration, twoHours), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, ) s.Require().NoError(err) @@ -226,7 +228,7 @@ func (s *E2ETestSuite) TestCmdRevokeAuthorizations() { fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%d", cli.FlagExpiration, twoHours), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=%s", flags.FlagSignMode, flags.SignModeLegacyAminoJSON), }, ) @@ -272,7 +274,7 @@ func (s *E2ETestSuite) TestCmdRevokeAuthorizations() { fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, &sdk.TxResponse{}, 0, false, @@ -285,7 +287,7 @@ func (s *E2ETestSuite) TestCmdRevokeAuthorizations() { fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, &sdk.TxResponse{}, 0, false, @@ -298,7 +300,7 @@ func (s *E2ETestSuite) TestCmdRevokeAuthorizations() { fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=%s", flags.FlagSignMode, flags.SignModeLegacyAminoJSON), }, &sdk.TxResponse{}, 0, @@ -340,7 +342,7 @@ func (s *E2ETestSuite) TestExecAuthorizationWithExpiration() { fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%d", cli.FlagExpiration, tenSeconds), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, ) s.Require().NoError(err) @@ -359,7 +361,7 @@ func (s *E2ETestSuite) TestExecAuthorizationWithExpiration() { execMsg.Name(), fmt.Sprintf("--%s=%s", flags.FlagFrom, grantee.String()), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), }) s.Require().NoError(err) @@ -383,7 +385,7 @@ func (s *E2ETestSuite) TestNewExecGenericAuthorized() { fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%d", cli.FlagExpiration, twoHours), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, ) s.Require().NoError(err) @@ -430,7 +432,7 @@ func (s *E2ETestSuite) TestNewExecGenericAuthorized() { execMsg.Name(), fmt.Sprintf("--%s=%s", flags.FlagFrom, grantee.String()), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), }, &sdk.TxResponse{}, @@ -443,7 +445,7 @@ func (s *E2ETestSuite) TestNewExecGenericAuthorized() { execMsg.Name(), fmt.Sprintf("--%s=%s", flags.FlagFrom, grantee.String()), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagSignMode, flags.SignModeLegacyAminoJSON), }, @@ -487,14 +489,14 @@ func (s *E2ETestSuite) TestNewExecGrantAuthorized() { fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%d", cli.FlagExpiration, twoHours), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, ) s.Require().NoError(err) s.Require().NoError(s.network.WaitForNextBlock()) tokens := sdk.NewCoins( - sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), sdk.NewInt(12)), + sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), math.NewInt(12)), ) normalGeneratedTx, err := clitestutil.MsgSendExec( val.ClientCtx, @@ -504,7 +506,7 @@ func (s *E2ETestSuite) TestNewExecGrantAuthorized() { addresscodec.NewBech32Codec("cosmos"), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=true", flags.FlagGenerateOnly), ) s.Require().NoError(err) @@ -523,7 +525,7 @@ func (s *E2ETestSuite) TestNewExecGrantAuthorized() { execMsg.Name(), fmt.Sprintf("--%s=%s", flags.FlagFrom, grantee.String()), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), }, 0, @@ -536,7 +538,7 @@ func (s *E2ETestSuite) TestNewExecGrantAuthorized() { execMsg.Name(), fmt.Sprintf("--%s=%s", flags.FlagFrom, grantee1.String()), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), }, 0, @@ -549,7 +551,7 @@ func (s *E2ETestSuite) TestNewExecGrantAuthorized() { execMsg.Name(), fmt.Sprintf("--%s=%s", flags.FlagFrom, grantee.String()), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), }, authz.ErrNoAuthorizationFound.ABCICode(), @@ -600,7 +602,7 @@ func (s *E2ETestSuite) TestExecSendAuthzWithAllowList() { fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%d", cli.FlagExpiration, twoHours), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=%s", cli.FlagAllowList, allowedAddr), }, ) @@ -608,7 +610,7 @@ func (s *E2ETestSuite) TestExecSendAuthzWithAllowList() { s.Require().NoError(s.network.WaitForNextBlock()) tokens := sdk.NewCoins( - sdk.NewCoin("stake", sdk.NewInt(12)), + sdk.NewCoin("stake", math.NewInt(12)), ) validGeneratedTx, err := clitestutil.MsgSendExec( @@ -619,7 +621,7 @@ func (s *E2ETestSuite) TestExecSendAuthzWithAllowList() { addresscodec.NewBech32Codec("cosmos"), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=true", flags.FlagGenerateOnly), ) s.Require().NoError(err) @@ -634,7 +636,7 @@ func (s *E2ETestSuite) TestExecSendAuthzWithAllowList() { addresscodec.NewBech32Codec("cosmos"), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=true", flags.FlagGenerateOnly), ) s.Require().NoError(err) @@ -646,7 +648,7 @@ func (s *E2ETestSuite) TestExecSendAuthzWithAllowList() { execMsg.Name(), fmt.Sprintf("--%s=%s", flags.FlagFrom, grantee.String()), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), } var response sdk.TxResponse @@ -661,7 +663,7 @@ func (s *E2ETestSuite) TestExecSendAuthzWithAllowList() { execMsg1.Name(), fmt.Sprintf("--%s=%s", flags.FlagFrom, grantee.String()), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), } out, err = clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, args) @@ -694,14 +696,14 @@ func (s *E2ETestSuite) TestExecDelegateAuthorization() { fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%d", cli.FlagExpiration, twoHours), fmt.Sprintf("--%s=%s", cli.FlagAllowedValidators, val.ValAddress.String()), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, ) s.Require().NoError(err) s.Require().NoError(s.network.WaitForNextBlock()) tokens := sdk.NewCoins( - sdk.NewCoin("stake", sdk.NewInt(50)), + sdk.NewCoin("stake", math.NewInt(50)), ) delegateTx := fmt.Sprintf(`{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgDelegate","delegator_address":"%s","validator_address":"%s","amount":{"denom":"%s","amount":"%s"}}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}`, val.Address.String(), val.ValAddress.String(), @@ -722,7 +724,7 @@ func (s *E2ETestSuite) TestExecDelegateAuthorization() { execMsg.Name(), fmt.Sprintf("--%s=%s", flags.FlagFrom, grantee.String()), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), }, 0, @@ -735,7 +737,7 @@ func (s *E2ETestSuite) TestExecDelegateAuthorization() { execMsg.Name(), fmt.Sprintf("--%s=%s", flags.FlagFrom, grantee.String()), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), }, 0, @@ -748,7 +750,7 @@ func (s *E2ETestSuite) TestExecDelegateAuthorization() { execMsg.Name(), fmt.Sprintf("--%s=%s", flags.FlagFrom, grantee.String()), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), }, authz.ErrNoAuthorizationFound.ABCICode(), @@ -787,14 +789,14 @@ func (s *E2ETestSuite) TestExecDelegateAuthorization() { fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%d", cli.FlagExpiration, twoHours), fmt.Sprintf("--%s=%s", cli.FlagAllowedValidators, val.ValAddress.String()), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, ) s.Require().NoError(err) s.Require().NoError(s.network.WaitForNextBlock()) tokens = sdk.NewCoins( - sdk.NewCoin("stake", sdk.NewInt(50)), + sdk.NewCoin("stake", math.NewInt(50)), ) delegateTx = fmt.Sprintf(`{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgDelegate","delegator_address":"%s","validator_address":"%s","amount":{"denom":"%s","amount":"%s"}}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}`, val.Address.String(), val.ValAddress.String(), @@ -815,7 +817,7 @@ func (s *E2ETestSuite) TestExecDelegateAuthorization() { execMsg.Name(), fmt.Sprintf("--%s=%s", flags.FlagFrom, grantee.String()), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), }, 0, @@ -855,7 +857,7 @@ func (s *E2ETestSuite) TestExecDelegateAuthorization() { fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%d", cli.FlagExpiration, twoHours), fmt.Sprintf("--%s=%s", cli.FlagDenyValidators, val.ValAddress.String()), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, ) s.Require().NoError(err) @@ -865,7 +867,7 @@ func (s *E2ETestSuite) TestExecDelegateAuthorization() { execMsg.Name(), fmt.Sprintf("--%s=%s", flags.FlagFrom, grantee.String()), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), } cmd := cli.NewCmdExecAuthorization() @@ -902,7 +904,7 @@ func (s *E2ETestSuite) TestExecUndelegateAuthorization() { fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%d", cli.FlagExpiration, twoHours), fmt.Sprintf("--%s=%s", cli.FlagAllowedValidators, val.ValAddress.String()), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, ) s.Require().NoError(err) @@ -917,13 +919,13 @@ func (s *E2ETestSuite) TestExecUndelegateAuthorization() { fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, ) s.Require().NoError(err) tokens := sdk.NewCoins( - sdk.NewCoin("stake", sdk.NewInt(50)), + sdk.NewCoin("stake", math.NewInt(50)), ) undelegateTx := fmt.Sprintf(`{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgUndelegate","delegator_address":"%s","validator_address":"%s","amount":{"denom":"%s","amount":"%s"}}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}`, val.Address.String(), val.ValAddress.String(), @@ -945,7 +947,7 @@ func (s *E2ETestSuite) TestExecUndelegateAuthorization() { fmt.Sprintf("--%s=%s", flags.FlagGas, "250000"), fmt.Sprintf("--%s=%s", flags.FlagFrom, grantee.String()), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), }, 0, @@ -959,7 +961,7 @@ func (s *E2ETestSuite) TestExecUndelegateAuthorization() { fmt.Sprintf("--%s=%s", flags.FlagGas, "250000"), fmt.Sprintf("--%s=%s", flags.FlagFrom, grantee.String()), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), }, 0, @@ -973,7 +975,7 @@ func (s *E2ETestSuite) TestExecUndelegateAuthorization() { fmt.Sprintf("--%s=%s", flags.FlagGas, "250000"), fmt.Sprintf("--%s=%s", flags.FlagFrom, grantee.String()), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), }, authz.ErrNoAuthorizationFound.ABCICode(), @@ -1012,14 +1014,14 @@ func (s *E2ETestSuite) TestExecUndelegateAuthorization() { fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%d", cli.FlagExpiration, twoHours), fmt.Sprintf("--%s=%s", cli.FlagAllowedValidators, val.ValAddress.String()), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, ) s.Require().NoError(err) s.Require().NoError(s.network.WaitForNextBlock()) tokens = sdk.NewCoins( - sdk.NewCoin("stake", sdk.NewInt(50)), + sdk.NewCoin("stake", math.NewInt(50)), ) undelegateTx = fmt.Sprintf(`{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgUndelegate","delegator_address":"%s","validator_address":"%s","amount":{"denom":"%s","amount":"%s"}}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}`, val.Address.String(), val.ValAddress.String(), @@ -1041,7 +1043,7 @@ func (s *E2ETestSuite) TestExecUndelegateAuthorization() { fmt.Sprintf("--%s=%s", flags.FlagGas, "250000"), fmt.Sprintf("--%s=%s", flags.FlagFrom, grantee.String()), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), }, 0, diff --git a/tests/e2e/bank/grpc.go b/tests/e2e/bank/grpc.go index 8bc393d306d1..d60c6a203b39 100644 --- a/tests/e2e/bank/grpc.go +++ b/tests/e2e/bank/grpc.go @@ -35,7 +35,7 @@ func (s *E2ETestSuite) TestTotalSupplyGRPCHandler() { &types.QueryTotalSupplyResponse{ Supply: sdk.NewCoins( sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), s.cfg.AccountTokens), - sdk.NewCoin(s.cfg.BondDenom, s.cfg.StakingTokens.Add(sdk.NewInt(10))), + sdk.NewCoin(s.cfg.BondDenom, s.cfg.StakingTokens.Add(math.NewInt(10))), ), Pagination: &query.PageResponse{ Total: 2, @@ -50,7 +50,7 @@ func (s *E2ETestSuite) TestTotalSupplyGRPCHandler() { }, &types.QuerySupplyOfResponse{}, &types.QuerySupplyOfResponse{ - Amount: sdk.NewCoin(s.cfg.BondDenom, s.cfg.StakingTokens.Add(sdk.NewInt(10))), + Amount: sdk.NewCoin(s.cfg.BondDenom, s.cfg.StakingTokens.Add(math.NewInt(10))), }, }, { @@ -61,7 +61,7 @@ func (s *E2ETestSuite) TestTotalSupplyGRPCHandler() { }, &types.QuerySupplyOfResponse{}, &types.QuerySupplyOfResponse{ - Amount: sdk.NewCoin(s.cfg.BondDenom, s.cfg.StakingTokens.Add(sdk.NewInt(20))), + Amount: sdk.NewCoin(s.cfg.BondDenom, s.cfg.StakingTokens.Add(math.NewInt(20))), }, }, { @@ -72,7 +72,7 @@ func (s *E2ETestSuite) TestTotalSupplyGRPCHandler() { }, &types.QuerySupplyOfResponse{}, &types.QuerySupplyOfResponse{ - Amount: sdk.NewCoin(s.cfg.BondDenom, s.cfg.StakingTokens.Add(sdk.NewInt(10))), + Amount: sdk.NewCoin(s.cfg.BondDenom, s.cfg.StakingTokens.Add(math.NewInt(10))), }, }, { @@ -267,7 +267,7 @@ func (s *E2ETestSuite) TestBalancesGRPCHandler() { &types.QueryBalanceResponse{ Balance: &sdk.Coin{ Denom: "foobar", - Amount: sdk.NewInt(0), + Amount: math.NewInt(0), }, }, }, diff --git a/tests/e2e/bank/suite.go b/tests/e2e/bank/suite.go index d319676fdb71..48b34f12b483 100644 --- a/tests/e2e/bank/suite.go +++ b/tests/e2e/bank/suite.go @@ -11,15 +11,13 @@ import ( "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/testutil" - "github.com/cosmos/cosmos-sdk/client/flags" addresscodec "github.com/cosmos/cosmos-sdk/codec/address" + "github.com/cosmos/cosmos-sdk/testutil" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/cosmos/cosmos-sdk/testutil/network" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/cosmos-sdk/types/query" "github.com/cosmos/cosmos-sdk/x/bank/client/cli" "github.com/cosmos/cosmos-sdk/x/bank/types" ) @@ -97,276 +95,6 @@ func (s *E2ETestSuite) TearDownSuite() { s.network.Cleanup() } -func (s *E2ETestSuite) TestGetBalancesCmd() { - val := s.network.Validators[0] - - testCases := []struct { - name string - args []string - expectErr bool - respType proto.Message - expected proto.Message - }{ - {"no address provided", []string{}, true, nil, nil}, - { - "total account balance", - []string{ - val.Address.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - fmt.Sprintf("--%s=1", flags.FlagHeight), - }, - false, - &types.QueryAllBalancesResponse{}, - &types.QueryAllBalancesResponse{ - Balances: sdk.NewCoins( - sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), s.cfg.AccountTokens), - sdk.NewCoin(s.cfg.BondDenom, s.cfg.StakingTokens.Sub(s.cfg.BondedTokens)), - ), - Pagination: &query.PageResponse{}, - }, - }, - { - "total account balance of a specific denom", - []string{ - val.Address.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - fmt.Sprintf("--%s=%s", cli.FlagDenom, s.cfg.BondDenom), - fmt.Sprintf("--%s=1", flags.FlagHeight), - }, - false, - &sdk.Coin{}, - NewCoin(s.cfg.BondDenom, s.cfg.StakingTokens.Sub(s.cfg.BondedTokens)), - }, - { - "total account balance of a bogus denom", - []string{ - val.Address.String(), - fmt.Sprintf("--%s=foobar", cli.FlagDenom), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - &sdk.Coin{}, - NewCoin("foobar", math.ZeroInt()), - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetBalancesCmd(addresscodec.NewBech32Codec("cosmos")) - out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, tc.args) - - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), tc.respType)) - s.Require().Equal(tc.expected.String(), tc.respType.String()) - } - }) - } -} - -func (s *E2ETestSuite) TestGetCmdQueryTotalSupply() { - val := s.network.Validators[0] - - testCases := []struct { - name string - args []string - expectErr bool - respType proto.Message - expected proto.Message - }{ - { - name: "total supply", - args: []string{ - fmt.Sprintf("--%s=1", flags.FlagHeight), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - respType: &types.QueryTotalSupplyResponse{}, - expected: &types.QueryTotalSupplyResponse{ - Supply: sdk.NewCoins( - sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), s.cfg.AccountTokens), - sdk.NewCoin(s.cfg.BondDenom, s.cfg.StakingTokens.Add(sdk.NewInt(10))), - ), - Pagination: &query.PageResponse{Total: 0}, - }, - }, - { - name: "total supply of a specific denomination", - args: []string{ - fmt.Sprintf("--%s=1", flags.FlagHeight), - fmt.Sprintf("--%s=%s", cli.FlagDenom, s.cfg.BondDenom), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - respType: &sdk.Coin{}, - expected: &sdk.Coin{ - Denom: s.cfg.BondDenom, - Amount: s.cfg.StakingTokens.Add(sdk.NewInt(10)), - }, - }, - { - name: "total supply of a bogus denom", - args: []string{ - fmt.Sprintf("--%s=1", flags.FlagHeight), - fmt.Sprintf("--%s=foobar", cli.FlagDenom), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - respType: &sdk.Coin{}, - expected: &sdk.Coin{ - Denom: "foobar", - Amount: math.ZeroInt(), - }, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryTotalSupply() - clientCtx := val.ClientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), tc.respType)) - s.Require().Equal(tc.expected, tc.respType) - } - }) - } -} - -func (s *E2ETestSuite) TestGetCmdQueryDenomsMetadata() { - val := s.network.Validators[0] - - testCases := []struct { - name string - args []string - expectErr bool - respType proto.Message - expected proto.Message - }{ - { - name: "all denoms client metadata", - args: []string{ - fmt.Sprintf("--%s=1", flags.FlagHeight), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - respType: &types.QueryDenomsMetadataResponse{}, - expected: &types.QueryDenomsMetadataResponse{ - Metadatas: []types.Metadata{ - { - Name: "Cosmos Hub Atom", - Symbol: "ATOM", - Description: "The native staking token of the Cosmos Hub.", - DenomUnits: []*types.DenomUnit{ - { - Denom: "uatom", - Exponent: 0, - Aliases: []string{"microatom"}, - }, - { - Denom: "atom", - Exponent: 6, - Aliases: []string{"ATOM"}, - }, - }, - Base: "uatom", - Display: "atom", - }, - { - Name: "Ethereum", - Symbol: "ETH", - Description: "Ethereum mainnet token", - DenomUnits: []*types.DenomUnit{ - { - Denom: "wei", - Exponent: 0, - Aliases: []string{}, - }, - { - Denom: "eth", - Exponent: 6, - Aliases: []string{"ETH"}, - }, - }, - Base: "wei", - Display: "eth", - }, - }, - Pagination: &query.PageResponse{Total: 2}, - }, - }, - { - name: "client metadata of a specific denomination", - args: []string{ - fmt.Sprintf("--%s=1", flags.FlagHeight), - fmt.Sprintf("--%s=%s", cli.FlagDenom, "uatom"), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - respType: &types.QueryDenomMetadataResponse{}, - expected: &types.QueryDenomMetadataResponse{ - Metadata: types.Metadata{ - Name: "Cosmos Hub Atom", - Symbol: "ATOM", - Description: "The native staking token of the Cosmos Hub.", - DenomUnits: []*types.DenomUnit{ - { - Denom: "uatom", - Exponent: 0, - Aliases: []string{"microatom"}, - }, - { - Denom: "atom", - Exponent: 6, - Aliases: []string{"ATOM"}, - }, - }, - Base: "uatom", - Display: "atom", - }, - }, - }, - { - name: "client metadata of a bogus denom", - args: []string{ - fmt.Sprintf("--%s=1", flags.FlagHeight), - fmt.Sprintf("--%s=foobar", cli.FlagDenom), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - expectErr: true, - respType: &types.QueryDenomMetadataResponse{}, - expected: &types.QueryDenomMetadataResponse{ - Metadata: types.Metadata{ - DenomUnits: []*types.DenomUnit{}, - }, - }, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdDenomsMetadata() - clientCtx := val.ClientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), tc.respType)) - s.Require().Equal(tc.expected, tc.respType) - } - }) - } -} - func (s *E2ETestSuite) TestNewSendTxCmdGenOnly() { val := s.network.Validators[0] @@ -375,13 +103,13 @@ func (s *E2ETestSuite) TestNewSendTxCmdGenOnly() { from := val.Address to := val.Address amount := sdk.NewCoins( - sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), sdk.NewInt(10)), - sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10)), + sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), math.NewInt(10)), + sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10)), ) args := []string{ fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=true", flags.FlagGenerateOnly), } @@ -400,13 +128,13 @@ func (s *E2ETestSuite) TestNewSendTxCmdDryRun() { from := val.Address to := val.Address amount := sdk.NewCoins( - sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), sdk.NewInt(10)), - sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10)), + sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), math.NewInt(10)), + sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10)), ) args := []string{ fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=true", flags.FlagDryRun), } @@ -441,13 +169,13 @@ func (s *E2ETestSuite) TestNewSendTxCmd() { val.Address, val.Address, sdk.NewCoins( - sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), sdk.NewInt(10)), - sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10)), + sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), math.NewInt(10)), + sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10)), ), []string{ fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, false, 0, &sdk.TxResponse{}, }, @@ -456,13 +184,13 @@ func (s *E2ETestSuite) TestNewSendTxCmd() { val.Address, val.Address, sdk.NewCoins( - sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), sdk.NewInt(10)), - sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10)), + sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), math.NewInt(10)), + sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10)), ), []string{ fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=true", flags.FlagOffline), fmt.Sprintf("--%s=true", flags.FlagGenerateOnly), }, @@ -473,13 +201,13 @@ func (s *E2ETestSuite) TestNewSendTxCmd() { val.Address, val.Address, sdk.NewCoins( - sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), sdk.NewInt(10)), - sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10)), + sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), math.NewInt(10)), + sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10)), ), []string{ fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(1))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(1))).String()), }, false, sdkerrors.ErrInsufficientFee.ABCICode(), @@ -490,13 +218,13 @@ func (s *E2ETestSuite) TestNewSendTxCmd() { val.Address, val.Address, sdk.NewCoins( - sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), sdk.NewInt(10)), - sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10)), + sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), math.NewInt(10)), + sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10)), ), []string{ fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), "--gas=10", }, false, @@ -545,13 +273,13 @@ func (s *E2ETestSuite) TestNewMultiSendTxCmd() { val.Address, []sdk.AccAddress{val.Address, testAddr}, sdk.NewCoins( - sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), sdk.NewInt(10)), - sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10)), + sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), math.NewInt(10)), + sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10)), ), []string{ fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, false, 0, &sdk.TxResponse{}, }, @@ -560,14 +288,14 @@ func (s *E2ETestSuite) TestNewMultiSendTxCmd() { val.Address, []sdk.AccAddress{val.Address, testAddr}, sdk.NewCoins( - sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), sdk.NewInt(10)), - sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10)), + sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), math.NewInt(10)), + sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10)), ), []string{ fmt.Sprintf("--%s=true", cli.FlagSplit), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, false, 0, &sdk.TxResponse{}, }, @@ -576,13 +304,13 @@ func (s *E2ETestSuite) TestNewMultiSendTxCmd() { val.Address, []sdk.AccAddress{val.Address}, sdk.NewCoins( - sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), sdk.NewInt(10)), - sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10)), + sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), math.NewInt(10)), + sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10)), ), []string{ fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, true, 0, &sdk.TxResponse{}, }, @@ -591,13 +319,13 @@ func (s *E2ETestSuite) TestNewMultiSendTxCmd() { val.Address, []sdk.AccAddress{val.Address, testAddr}, sdk.NewCoins( - sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), sdk.NewInt(10)), - sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10)), + sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), math.NewInt(10)), + sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10)), ), []string{ fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=true", flags.FlagOffline), fmt.Sprintf("--%s=true", flags.FlagGenerateOnly), }, @@ -608,13 +336,13 @@ func (s *E2ETestSuite) TestNewMultiSendTxCmd() { val.Address, []sdk.AccAddress{val.Address, testAddr}, sdk.NewCoins( - sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), sdk.NewInt(10)), - sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10)), + sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), math.NewInt(10)), + sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10)), ), []string{ fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(1))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(1))).String()), }, false, sdkerrors.ErrInsufficientFee.ABCICode(), @@ -625,13 +353,13 @@ func (s *E2ETestSuite) TestNewMultiSendTxCmd() { val.Address, []sdk.AccAddress{val.Address, testAddr}, sdk.NewCoins( - sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), sdk.NewInt(10)), - sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10)), + sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), math.NewInt(10)), + sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10)), ), []string{ fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), "--gas=10", }, false, diff --git a/tests/e2e/distribution/grpc_query_suite.go b/tests/e2e/distribution/grpc_query_suite.go index c9765fbb8ae5..6d40625d7e57 100644 --- a/tests/e2e/distribution/grpc_query_suite.go +++ b/tests/e2e/distribution/grpc_query_suite.go @@ -3,10 +3,11 @@ package distribution import ( "fmt" - "cosmossdk.io/simapp" "github.com/cosmos/gogoproto/proto" "github.com/stretchr/testify/suite" + "cosmossdk.io/simapp" + sdktestutil "github.com/cosmos/cosmos-sdk/testutil" "github.com/cosmos/cosmos-sdk/testutil/network" sdk "github.com/cosmos/cosmos-sdk/types" @@ -311,7 +312,7 @@ func (s *GRPCQueryTestSuite) TestQueryDelegatorRewardsGRPC() { &types.QueryDelegationTotalRewardsResponse{}, &types.QueryDelegationTotalRewardsResponse{ Rewards: []types.DelegationDelegatorReward{ - types.NewDelegationDelegatorReward(val.ValAddress, rewards), + types.NewDelegationDelegatorReward(val.ValAddress.String(), rewards), }, Total: rewards, }, diff --git a/tests/e2e/distribution/suite.go b/tests/e2e/distribution/suite.go index f4d6e3dbf59b..54d02961f747 100644 --- a/tests/e2e/distribution/suite.go +++ b/tests/e2e/distribution/suite.go @@ -4,14 +4,14 @@ import ( "context" "encoding/hex" "fmt" - "strings" "time" - "cosmossdk.io/math" - "cosmossdk.io/simapp" "github.com/cosmos/gogoproto/proto" "github.com/stretchr/testify/suite" + "cosmossdk.io/math" + "cosmossdk.io/simapp" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/codec/address" @@ -50,7 +50,7 @@ func (s *E2ETestSuite) SetupSuite() { var mintData minttypes.GenesisState s.Require().NoError(s.cfg.Codec.UnmarshalJSON(genesisState[minttypes.ModuleName], &mintData)) - inflation := sdk.MustNewDecFromStr("1.0") + inflation := math.LegacyMustNewDecFromStr("1.0") mintData.Minter.Inflation = inflation mintData.Params.InflationMin = inflation mintData.Params.InflationMax = inflation @@ -72,430 +72,6 @@ func (s *E2ETestSuite) TearDownSuite() { s.network.Cleanup() } -func (s *E2ETestSuite) TestGetCmdQueryParams() { - val := s.network.Validators[0] - - testCases := []struct { - name string - args []string - expectedOutput string - }{ - { - "json output", - []string{fmt.Sprintf("--%s=json", flags.FlagOutput)}, - `{"community_tax":"0.020000000000000000","base_proposer_reward":"0.000000000000000000","bonus_proposer_reward":"0.000000000000000000","withdraw_addr_enabled":true}`, - }, - { - "text output", - []string{fmt.Sprintf("--%s=text", flags.FlagOutput)}, - `base_proposer_reward: "0.000000000000000000" -bonus_proposer_reward: "0.000000000000000000" -community_tax: "0.020000000000000000" -withdraw_addr_enabled: true`, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryParams() - clientCtx := val.ClientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - s.Require().NoError(err) - s.Require().Equal(tc.expectedOutput, strings.TrimSpace(out.String())) - }) - } -} - -func (s *E2ETestSuite) TestGetCmdQueryValidatorDistributionInfo() { - val := s.network.Validators[0] - - testCases := []struct { - name string - args []string - expErr bool - }{ - { - "invalid val address", - []string{"invalid address", fmt.Sprintf("--%s=json", flags.FlagOutput)}, - true, - }, - { - "json output", - []string{val.ValAddress.String(), fmt.Sprintf("--%s=json", flags.FlagOutput)}, - false, - }, - { - "text output", - []string{val.ValAddress.String(), fmt.Sprintf("--%s=text", flags.FlagOutput)}, - false, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryValidatorDistributionInfo() - clientCtx := val.ClientCtx - - _, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - if tc.expErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - } - }) - } -} - -func (s *E2ETestSuite) TestGetCmdQueryValidatorOutstandingRewards() { - val := s.network.Validators[0] - - _, err := s.network.WaitForHeight(4) - s.Require().NoError(err) - - testCases := []struct { - name string - args []string - expectErr bool - expectedOutput string - }{ - { - "invalid validator address", - []string{ - fmt.Sprintf("--%s=3", flags.FlagHeight), - "foo", - }, - true, - "", - }, - { - "json output", - []string{ - fmt.Sprintf("--%s=3", flags.FlagHeight), - sdk.ValAddress(val.Address).String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - `{"rewards":[{"denom":"stake","amount":"232.260000000000000000"}]}`, - }, - { - "text output", - []string{ - fmt.Sprintf("--%s=text", flags.FlagOutput), - fmt.Sprintf("--%s=3", flags.FlagHeight), - sdk.ValAddress(val.Address).String(), - }, - false, - `rewards: -- amount: "232.260000000000000000" - denom: stake`, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryValidatorOutstandingRewards() - clientCtx := val.ClientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - s.Require().Equal(tc.expectedOutput, strings.TrimSpace(out.String())) - } - }) - } -} - -func (s *E2ETestSuite) TestGetCmdQueryValidatorCommission() { - val := s.network.Validators[0] - - _, err := s.network.WaitForHeight(4) - s.Require().NoError(err) - - testCases := []struct { - name string - args []string - expectErr bool - expectedOutput string - }{ - { - "invalid validator address", - []string{ - fmt.Sprintf("--%s=3", flags.FlagHeight), - "foo", - }, - true, - "", - }, - { - "json output", - []string{ - fmt.Sprintf("--%s=3", flags.FlagHeight), - sdk.ValAddress(val.Address).String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - `{"commission":[{"denom":"stake","amount":"116.130000000000000000"}]}`, - }, - { - "text output", - []string{ - fmt.Sprintf("--%s=text", flags.FlagOutput), - fmt.Sprintf("--%s=3", flags.FlagHeight), - sdk.ValAddress(val.Address).String(), - }, - false, - `commission: -- amount: "116.130000000000000000" - denom: stake`, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryValidatorCommission() - clientCtx := val.ClientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - s.Require().Equal(tc.expectedOutput, strings.TrimSpace(out.String())) - } - }) - } -} - -func (s *E2ETestSuite) TestGetCmdQueryValidatorSlashes() { - val := s.network.Validators[0] - - _, err := s.network.WaitForHeight(4) - s.Require().NoError(err) - - testCases := []struct { - name string - args []string - expectErr bool - expectedOutput string - }{ - { - "invalid validator address", - []string{ - fmt.Sprintf("--%s=3", flags.FlagHeight), - "foo", "1", "3", - }, - true, - "", - }, - { - "invalid start height", - []string{ - fmt.Sprintf("--%s=3", flags.FlagHeight), - sdk.ValAddress(val.Address).String(), "-1", "3", - }, - true, - "", - }, - { - "invalid end height", - []string{ - fmt.Sprintf("--%s=3", flags.FlagHeight), - sdk.ValAddress(val.Address).String(), "1", "-3", - }, - true, - "", - }, - { - "json output", - []string{ - fmt.Sprintf("--%s=3", flags.FlagHeight), - sdk.ValAddress(val.Address).String(), "1", "3", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - "{\"slashes\":[],\"pagination\":{\"next_key\":null,\"total\":\"0\"}}", - }, - { - "text output", - []string{ - fmt.Sprintf("--%s=text", flags.FlagOutput), - fmt.Sprintf("--%s=3", flags.FlagHeight), - sdk.ValAddress(val.Address).String(), "1", "3", - }, - false, - "pagination:\n next_key: null\n total: \"0\"\nslashes: []", - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryValidatorSlashes() - clientCtx := val.ClientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - s.Require().Equal(tc.expectedOutput, strings.TrimSpace(out.String())) - } - }) - } -} - -func (s *E2ETestSuite) TestGetCmdQueryDelegatorRewards() { - val := s.network.Validators[0] - addr := val.Address - valAddr := sdk.ValAddress(addr) - - _, err := s.network.WaitForHeightWithTimeout(11, time.Minute) - s.Require().NoError(err) - - testCases := []struct { - name string - args []string - expectErr bool - expectedOutput string - }{ - { - "invalid delegator address", - []string{ - fmt.Sprintf("--%s=5", flags.FlagHeight), - "foo", valAddr.String(), - }, - true, - "", - }, - { - "invalid validator address", - []string{ - fmt.Sprintf("--%s=5", flags.FlagHeight), - addr.String(), "foo", - }, - true, - "", - }, - { - "json output", - []string{ - fmt.Sprintf("--%s=5", flags.FlagHeight), - addr.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - fmt.Sprintf(`{"rewards":[{"validator_address":"%s","reward":[{"denom":"stake","amount":"193.550000000000000000"}]}],"total":[{"denom":"stake","amount":"193.550000000000000000"}]}`, valAddr.String()), - }, - { - "json output (specific validator)", - []string{ - fmt.Sprintf("--%s=5", flags.FlagHeight), - addr.String(), valAddr.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - `{"rewards":[{"denom":"stake","amount":"193.550000000000000000"}]}`, - }, - { - "text output", - []string{ - fmt.Sprintf("--%s=text", flags.FlagOutput), - fmt.Sprintf("--%s=5", flags.FlagHeight), - addr.String(), - }, - false, - fmt.Sprintf(`rewards: -- reward: - - amount: "193.550000000000000000" - denom: stake - validator_address: %s -total: -- amount: "193.550000000000000000" - denom: stake`, valAddr.String()), - }, - { - "text output (specific validator)", - []string{ - fmt.Sprintf("--%s=text", flags.FlagOutput), - fmt.Sprintf("--%s=5", flags.FlagHeight), - addr.String(), valAddr.String(), - }, - false, - `rewards: -- amount: "193.550000000000000000" - denom: stake`, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryDelegatorRewards(address.NewBech32Codec("cosmos")) - clientCtx := val.ClientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - s.Require().Equal(tc.expectedOutput, strings.TrimSpace(out.String())) - } - }) - } -} - -func (s *E2ETestSuite) TestGetCmdQueryCommunityPool() { - val := s.network.Validators[0] - - _, err := s.network.WaitForHeight(4) - s.Require().NoError(err) - - testCases := []struct { - name string - args []string - expectedOutput string - }{ - { - "json output", - []string{fmt.Sprintf("--%s=3", flags.FlagHeight), fmt.Sprintf("--%s=json", flags.FlagOutput)}, - `{"pool":[{"denom":"stake","amount":"4.740000000000000000"}]}`, - }, - { - "text output", - []string{fmt.Sprintf("--%s=text", flags.FlagOutput), fmt.Sprintf("--%s=3", flags.FlagHeight)}, - `pool: -- amount: "4.740000000000000000" - denom: stake`, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryCommunityPool() - clientCtx := val.ClientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - s.Require().NoError(err) - s.Require().Equal(tc.expectedOutput, strings.TrimSpace(out.String())) - }) - } -} - func (s *E2ETestSuite) TestNewWithdrawRewardsCmd() { val := s.network.Validators[0] @@ -515,7 +91,7 @@ func (s *E2ETestSuite) TestNewWithdrawRewardsCmd() { fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, true, 0, nil, []string{}, @@ -527,7 +103,7 @@ func (s *E2ETestSuite) TestNewWithdrawRewardsCmd() { fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, false, 0, &sdk.TxResponse{}, []string{ @@ -542,7 +118,7 @@ func (s *E2ETestSuite) TestNewWithdrawRewardsCmd() { fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=true", cli.FlagCommission), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, false, 0, &sdk.TxResponse{}, []string{ @@ -563,7 +139,7 @@ func (s *E2ETestSuite) TestNewWithdrawRewardsCmd() { _, _ = s.network.WaitForHeightWithTimeout(10, time.Minute) ctx := svrcmd.CreateExecuteContext(context.Background()) - cmd := cli.NewWithdrawRewardsCmd() + cmd := cli.NewWithdrawRewardsCmd(address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmos")) cmd.SetContext(ctx) cmd.SetArgs(args) s.Require().NoError(client.SetCmdClientContextHandler(clientCtx, cmd)) @@ -627,7 +203,7 @@ func (s *E2ETestSuite) TestNewWithdrawAllRewardsCmd() { fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagOffline), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, true, 0, nil, []string{}, @@ -638,7 +214,7 @@ func (s *E2ETestSuite) TestNewWithdrawAllRewardsCmd() { fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, false, 0, &sdk.TxResponse{}, []string{ @@ -651,7 +227,7 @@ func (s *E2ETestSuite) TestNewWithdrawAllRewardsCmd() { tc := tc s.Run(tc.name, func() { - cmd := cli.NewWithdrawAllRewardsCmd() + cmd := cli.NewWithdrawAllRewardsCmd(address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmos")) clientCtx := val.ClientCtx _, _ = s.network.WaitForHeightWithTimeout(10, time.Minute) @@ -715,7 +291,7 @@ func (s *E2ETestSuite) TestNewSetWithdrawAddrCmd() { fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, true, 0, nil, }, @@ -726,7 +302,7 @@ func (s *E2ETestSuite) TestNewSetWithdrawAddrCmd() { fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, false, 0, &sdk.TxResponse{}, }, @@ -770,18 +346,18 @@ func (s *E2ETestSuite) TestNewFundCommunityPoolCmd() { fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, true, 0, nil, }, { "valid transaction", []string{ - sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(5431))).String(), + sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(5431))).String(), fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, false, 0, &sdk.TxResponse{}, }, @@ -791,7 +367,7 @@ func (s *E2ETestSuite) TestNewFundCommunityPoolCmd() { tc := tc s.Run(tc.name, func() { - cmd := cli.NewFundCommunityPoolCmd() + cmd := cli.NewFundCommunityPoolCmd(address.NewBech32Codec("cosmos")) clientCtx := val.ClientCtx out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) diff --git a/tests/e2e/distribution/withdraw_all_suite.go b/tests/e2e/distribution/withdraw_all_suite.go index 803d92c0cf1e..18a7a5b11555 100644 --- a/tests/e2e/distribution/withdraw_all_suite.go +++ b/tests/e2e/distribution/withdraw_all_suite.go @@ -4,11 +4,13 @@ import ( "fmt" "strings" - "cosmossdk.io/simapp" "github.com/stretchr/testify/suite" + "cosmossdk.io/math" + "cosmossdk.io/simapp" + "github.com/cosmos/cosmos-sdk/client/flags" - addresscodec "github.com/cosmos/cosmos-sdk/codec/address" + "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/crypto/hd" "github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/cosmos/cosmos-sdk/testutil" @@ -64,9 +66,9 @@ func (s *WithdrawAllTestSuite) TestNewWithdrawAllRewardsGenerateOnly() { val.ClientCtx, val.Address, newAddr, - sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(2000))), addresscodec.NewBech32Codec("cosmos"), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(2000))), address.NewBech32Codec("cosmos"), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), ) require.NoError(err) require.NoError(s.network.WaitForNextBlock()) @@ -74,13 +76,13 @@ func (s *WithdrawAllTestSuite) TestNewWithdrawAllRewardsGenerateOnly() { // delegate 500 tokens to validator1 args := []string{ val.ValAddress.String(), - sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(500)).String(), + sdk.NewCoin(s.cfg.BondDenom, math.NewInt(500)).String(), fmt.Sprintf("--%s=%s", flags.FlagFrom, newAddr.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), } - cmd := stakingcli.NewDelegateCmd() + cmd := stakingcli.NewDelegateCmd(clientCtx.InterfaceRegistry.SigningContext().ValidatorAddressCodec(), clientCtx.InterfaceRegistry.SigningContext().AddressCodec()) _, err = clitestutil.ExecTestCLICmd(clientCtx, cmd, args) require.NoError(err) require.NoError(s.network.WaitForNextBlock()) @@ -88,11 +90,11 @@ func (s *WithdrawAllTestSuite) TestNewWithdrawAllRewardsGenerateOnly() { // delegate 500 tokens to validator2 args = []string{ val1.ValAddress.String(), - sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(500)).String(), + sdk.NewCoin(s.cfg.BondDenom, math.NewInt(500)).String(), fmt.Sprintf("--%s=%s", flags.FlagFrom, newAddr.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), } _, err = clitestutil.ExecTestCLICmd(clientCtx, cmd, args) require.NoError(err) @@ -105,9 +107,9 @@ func (s *WithdrawAllTestSuite) TestNewWithdrawAllRewardsGenerateOnly() { fmt.Sprintf("--%s=true", flags.FlagGenerateOnly), fmt.Sprintf("--%s=1", cli.FlagMaxMessagesPerTx), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), } - cmd = cli.NewWithdrawAllRewardsCmd() + cmd = cli.NewWithdrawAllRewardsCmd(address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmos")) out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, args) if err != nil { return err @@ -128,9 +130,9 @@ func (s *WithdrawAllTestSuite) TestNewWithdrawAllRewardsGenerateOnly() { fmt.Sprintf("--%s=true", flags.FlagGenerateOnly), fmt.Sprintf("--%s=2", cli.FlagMaxMessagesPerTx), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), } - cmd = cli.NewWithdrawAllRewardsCmd() + cmd = cli.NewWithdrawAllRewardsCmd(address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmos")) out, err = clitestutil.ExecTestCLICmd(clientCtx, cmd, args) require.NoError(err) // expect 1 transaction in the generated file when --max-msgs in a tx set 2, since there are only delegations. diff --git a/tests/e2e/gov/deposits.go b/tests/e2e/gov/deposits.go index 4b433aef26de..9a4a1b34a888 100644 --- a/tests/e2e/gov/deposits.go +++ b/tests/e2e/gov/deposits.go @@ -7,10 +7,9 @@ import ( "github.com/stretchr/testify/suite" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/codec/address" + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/testutil" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/cosmos/cosmos-sdk/testutil/network" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/client/cli" @@ -57,14 +56,12 @@ func (s *DepositTestSuite) submitProposal(val *network.Validator, initialDeposit s.Require().NoError(s.network.WaitForNextBlock()) // query proposals, return the last's id - cmd := cli.GetCmdQueryProposals(address.NewBech32Codec("cosmos")) - args := []string{fmt.Sprintf("--%s=json", flags.FlagOutput)} - res, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, args) + res, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/gov/v1/proposals", val.APIAddress)) s.Require().NoError(err) - var proposals v1.QueryProposalsResponse - err = s.cfg.Codec.UnmarshalJSON(res.Bytes(), &proposals) + err = s.cfg.Codec.UnmarshalJSON(res, &proposals) s.Require().NoError(err) + s.Require().GreaterOrEqual(len(proposals.Proposals), 1) return proposals.Proposals[len(proposals.Proposals)-1].Id } @@ -74,33 +71,6 @@ func (s *DepositTestSuite) TearDownSuite() { s.network.Cleanup() } -func (s *DepositTestSuite) TestQueryDepositsWithoutInitialDeposit() { - val := s.network.Validators[0] - clientCtx := val.ClientCtx - - // submit proposal without initial deposit - id := s.submitProposal(val, sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(0)), "TestQueryDepositsWithoutInitialDeposit") - proposalID := strconv.FormatUint(id, 10) - - // deposit amount - depositAmount := sdk.NewCoin(s.cfg.BondDenom, v1.DefaultMinDepositTokens.Add(sdk.NewInt(50))).String() - _, err := govclitestutil.MsgDeposit(clientCtx, val.Address.String(), proposalID, depositAmount) - s.Require().NoError(err) - s.Require().NoError(s.network.WaitForNextBlock()) - - // query deposit - deposit := s.queryDeposit(val, proposalID, false, "") - s.Require().NotNil(deposit) - s.Require().Equal(sdk.Coins(deposit.Amount).String(), depositAmount) - - // query deposits - deposits := s.queryDeposits(val, proposalID, false, "") - s.Require().NotNil(deposits) - s.Require().Len(deposits.Deposits, 1) - // verify initial deposit - s.Require().Equal(sdk.Coins(deposits.Deposits[0].Amount).String(), depositAmount) -} - func (s *DepositTestSuite) TestQueryDepositsWithInitialDeposit() { val := s.network.Validators[0] depositAmount := sdk.NewCoin(s.cfg.BondDenom, v1.DefaultMinDepositTokens) @@ -112,98 +82,83 @@ func (s *DepositTestSuite) TestQueryDepositsWithInitialDeposit() { // query deposit deposit := s.queryDeposit(val, proposalID, false, "") s.Require().NotNil(deposit) - s.Require().Equal(sdk.Coins(deposit.Amount).String(), depositAmount.String()) + s.Require().Equal(depositAmount.String(), sdk.Coins(deposit.Deposit.Amount).String()) // query deposits deposits := s.queryDeposits(val, proposalID, false, "") s.Require().NotNil(deposits) s.Require().Len(deposits.Deposits, 1) // verify initial deposit - s.Require().Equal(sdk.Coins(deposits.Deposits[0].Amount).String(), depositAmount.String()) + s.Require().Equal(depositAmount.String(), sdk.Coins(deposits.Deposits[0].Amount).String()) } func (s *DepositTestSuite) TestQueryProposalAfterVotingPeriod() { val := s.network.Validators[0] - depositAmount := sdk.NewCoin(s.cfg.BondDenom, v1.DefaultMinDepositTokens.Sub(sdk.NewInt(50))) + depositAmount := sdk.NewCoin(s.cfg.BondDenom, v1.DefaultMinDepositTokens.Sub(math.NewInt(50))) // submit proposal with an initial deposit id := s.submitProposal(val, depositAmount, "TestQueryProposalAfterVotingPeriod") proposalID := strconv.FormatUint(id, 10) - args := []string{fmt.Sprintf("--%s=json", flags.FlagOutput)} - cmd := cli.GetCmdQueryProposals(address.NewBech32Codec("cosmos")) - _, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, args) + resp, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/gov/v1/proposals", val.APIAddress)) + s.Require().NoError(err) + var proposals v1.QueryProposalsResponse + err = s.cfg.Codec.UnmarshalJSON(resp, &proposals) s.Require().NoError(err) + s.Require().GreaterOrEqual(len(proposals.Proposals), 1) // query proposal - args = []string{proposalID, fmt.Sprintf("--%s=json", flags.FlagOutput)} - cmd = cli.GetCmdQueryProposal() - _, err = clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, args) + resp, err = testutil.GetRequest(fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s", val.APIAddress, proposalID)) + s.Require().NoError(err) + var proposal v1.QueryProposalResponse + err = s.cfg.Codec.UnmarshalJSON(resp, &proposal) s.Require().NoError(err) // waiting for deposit and voting period to end time.Sleep(25 * time.Second) // query proposal - _, err = clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, args) - s.Require().Error(err) - s.Require().Contains(err.Error(), fmt.Sprintf("proposal %s doesn't exist", proposalID)) + resp, err = testutil.GetRequest(fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s", val.APIAddress, proposalID)) + s.Require().NoError(err) + s.Require().Contains(string(resp), fmt.Sprintf("proposal %s doesn't exist", proposalID)) // query deposits - deposits := s.queryDeposits(val, proposalID, true, "proposal 3 doesn't exist") - s.Require().Nil(deposits) + deposits := s.queryDeposits(val, proposalID, false, "") + s.Require().Len(deposits.Deposits, 0) } func (s *DepositTestSuite) queryDeposits(val *network.Validator, proposalID string, exceptErr bool, message string) *v1.QueryDepositsResponse { - args := []string{proposalID, fmt.Sprintf("--%s=json", flags.FlagOutput)} - var depositsRes *v1.QueryDepositsResponse - cmd := cli.GetCmdQueryDeposits() - - var ( - out testutil.BufferWriter - err error - ) + s.Require().NoError(s.network.WaitForNextBlock()) - err = s.network.RetryForBlocks(func() error { - out, err = clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, args) - if err == nil { - err = val.ClientCtx.LegacyAmino.UnmarshalJSON(out.Bytes(), &depositsRes) - return err - } - return err - }, 3) + resp, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/deposits", val.APIAddress, proposalID)) + s.Require().NoError(err) if exceptErr { - s.Require().Error(err) - s.Require().Contains(err.Error(), message) + s.Require().Contains(string(resp), message) return nil } + var depositsRes v1.QueryDepositsResponse + err = val.ClientCtx.Codec.UnmarshalJSON(resp, &depositsRes) s.Require().NoError(err) - return depositsRes + + return &depositsRes } -func (s *DepositTestSuite) queryDeposit(val *network.Validator, proposalID string, exceptErr bool, message string) *v1.Deposit { - args := []string{proposalID, val.Address.String(), fmt.Sprintf("--%s=json", flags.FlagOutput)} - var depositRes *v1.Deposit - cmd := cli.GetCmdQueryDeposit() - var ( - out testutil.BufferWriter - err error - ) +func (s *DepositTestSuite) queryDeposit(val *network.Validator, proposalID string, exceptErr bool, message string) *v1.QueryDepositResponse { + s.Require().NoError(s.network.WaitForNextBlock()) - err = s.network.RetryForBlocks(func() error { - out, err = clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, args) - return err - }, 3) + resp, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/deposits/%s", val.APIAddress, proposalID, val.Address.String())) + s.Require().NoError(err) if exceptErr { - s.Require().Error(err) - s.Require().Contains(err.Error(), message) + s.Require().Contains(string(resp), message) return nil } + + var depositRes v1.QueryDepositResponse + err = val.ClientCtx.Codec.UnmarshalJSON(resp, &depositRes) s.Require().NoError(err) - s.Require().NoError(val.ClientCtx.LegacyAmino.UnmarshalJSON(out.Bytes(), &depositRes)) - return depositRes + return &depositRes } diff --git a/tests/e2e/gov/grpc.go b/tests/e2e/gov/grpc.go index 633281b38ca0..77560ba3a40c 100644 --- a/tests/e2e/gov/grpc.go +++ b/tests/e2e/gov/grpc.go @@ -3,11 +3,13 @@ package gov import ( "fmt" + "github.com/cosmos/gogoproto/proto" + + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/testutil" - sdk "github.com/cosmos/cosmos-sdk/types" grpctypes "github.com/cosmos/cosmos-sdk/types/grpc" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" - "github.com/cosmos/gogoproto/proto" ) func (s *E2ETestSuite) TestGetProposalGRPC() { @@ -148,10 +150,10 @@ func (s *E2ETestSuite) TestGetProposalVoteGRPC() { fmt.Sprintf("%s/cosmos/gov/v1/proposals/%s/votes/%s", val.APIAddress, "3", voterAddressBech32), false, v1.WeightedVoteOptions{ - &v1.WeightedVoteOption{Option: v1.OptionYes, Weight: sdk.NewDecWithPrec(60, 2).String()}, - &v1.WeightedVoteOption{Option: v1.OptionNo, Weight: sdk.NewDecWithPrec(30, 2).String()}, - &v1.WeightedVoteOption{Option: v1.OptionAbstain, Weight: sdk.NewDecWithPrec(5, 2).String()}, - &v1.WeightedVoteOption{Option: v1.OptionNoWithVeto, Weight: sdk.NewDecWithPrec(5, 2).String()}, + &v1.WeightedVoteOption{Option: v1.OptionYes, Weight: math.LegacyNewDecWithPrec(60, 2).String()}, + &v1.WeightedVoteOption{Option: v1.OptionNo, Weight: math.LegacyNewDecWithPrec(30, 2).String()}, + &v1.WeightedVoteOption{Option: v1.OptionAbstain, Weight: math.LegacyNewDecWithPrec(5, 2).String()}, + &v1.WeightedVoteOption{Option: v1.OptionNoWithVeto, Weight: math.LegacyNewDecWithPrec(5, 2).String()}, }, }, } diff --git a/tests/e2e/gov/query.go b/tests/e2e/gov/query.go deleted file mode 100644 index 23b7c67f564a..000000000000 --- a/tests/e2e/gov/query.go +++ /dev/null @@ -1,556 +0,0 @@ -package gov - -import ( - "fmt" - "strings" - - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/codec/address" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/gov/client/cli" - v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" -) - -func (s *E2ETestSuite) TestCmdParams() { - val := s.network.Validators[0] - - testCases := []struct { - name string - args []string - expectedOutput string - }{ - { - "json output", - []string{fmt.Sprintf("--%s=json", flags.FlagOutput)}, - `{"voting_params":{"voting_period":"172800s"},"deposit_params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800s"},"tally_params":{"quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000"},"params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800s","voting_period":"172800s","quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000","min_initial_deposit_ratio":"0.000000000000000000","proposal_cancel_ratio":"0.500000000000000000","proposal_cancel_dest":"","expedited_voting_period":"86400s","expedited_threshold":"0.667000000000000000","expedited_min_deposit":[{"denom":"stake","amount":"50000000"}],"burn_vote_quorum":false,"burn_proposal_deposit_prevote":false,"burn_vote_veto":true}}`, - }, - { - "text output", - []string{}, - ` -deposit_params: - max_deposit_period: 172800s - min_deposit: - - amount: "10000000" - denom: stake -params: - burn_proposal_deposit_prevote: false - burn_vote_quorum: false - burn_vote_veto: true - expedited_min_deposit: - - amount: "50000000" - denom: stake - expedited_threshold: "0.667000000000000000" - expedited_voting_period: 86400s - max_deposit_period: 172800s - min_deposit: - - amount: "10000000" - denom: stake - min_initial_deposit_ratio: "0.000000000000000000" - proposal_cancel_dest: "" - proposal_cancel_ratio: "0.500000000000000000" - quorum: "0.334000000000000000" - threshold: "0.500000000000000000" - veto_threshold: "0.334000000000000000" - voting_period: 172800s -tally_params: - quorum: "0.334000000000000000" - threshold: "0.500000000000000000" - veto_threshold: "0.334000000000000000" -voting_params: - voting_period: 172800s - `, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryParams() - clientCtx := val.ClientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - s.Require().NoError(err) - s.Require().Equal(strings.TrimSpace(tc.expectedOutput), strings.TrimSpace(out.String())) - }) - } -} - -func (s *E2ETestSuite) TestCmdParam() { - val := s.network.Validators[0] - - testCases := []struct { - name string - args []string - expectedOutput string - }{ - { - "voting params", - []string{ - "voting", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - `{"voting_period":"172800000000000"}`, - }, - { - "tally params", - []string{ - "tallying", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - `{"quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000"}`, - }, - { - "deposit params", - []string{ - "deposit", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - `{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800000000000"}`, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryParam() - clientCtx := val.ClientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - s.Require().NoError(err) - s.Require().Equal(strings.TrimSpace(tc.expectedOutput), strings.TrimSpace(out.String())) - }) - } -} - -func (s *E2ETestSuite) TestCmdProposer() { - val := s.network.Validators[0] - - testCases := []struct { - name string - args []string - expectErr bool - expectedOutput string - }{ - { - "without proposal id", - []string{ - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - ``, - }, - { - "json output", - []string{ - "1", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - fmt.Sprintf("{\"proposal_id\":\"%s\",\"proposer\":\"%s\"}", "1", val.Address.String()), - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryProposer() - clientCtx := val.ClientCtx - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - s.Require().Equal(strings.TrimSpace(tc.expectedOutput), strings.TrimSpace(out.String())) - } - }) - } -} - -func (s *E2ETestSuite) TestCmdTally() { - val := s.network.Validators[0] - - testCases := []struct { - name string - args []string - expectErr bool - expectedOutput v1.TallyResult - }{ - { - "without proposal id", - []string{ - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - v1.TallyResult{}, - }, - { - "json output", - []string{ - "2", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - v1.NewTallyResult(sdk.NewInt(0), sdk.NewInt(0), sdk.NewInt(0), sdk.NewInt(0)), - }, - { - "json output", - []string{ - "1", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - v1.NewTallyResult(s.cfg.BondedTokens, sdk.NewInt(0), sdk.NewInt(0), sdk.NewInt(0)), - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryTally() - clientCtx := val.ClientCtx - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - - if tc.expectErr { - s.Require().Error(err) - } else { - var tally v1.TallyResult - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &tally), out.String()) - s.Require().Equal(tally, tc.expectedOutput) - } - }) - } -} - -func (s *E2ETestSuite) TestCmdGetProposal() { - val := s.network.Validators[0] - - title := "Text Proposal 1" - - testCases := []struct { - name string - args []string - expectErr bool - }{ - { - "get non existing proposal", - []string{ - "10", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - }, - { - "get proposal with json response", - []string{ - "1", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryProposal() - clientCtx := val.ClientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - var proposal v1.Proposal - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &proposal), out.String()) - s.Require().Equal(title, proposal.Messages[0].GetCachedValue().(*v1.MsgExecLegacyContent).Content.GetCachedValue().(v1beta1.Content).GetTitle()) - } - }) - } -} - -func (s *E2ETestSuite) TestCmdGetProposals() { - val := s.network.Validators[0] - - testCases := []struct { - name string - args []string - expectErr bool - }{ - { - "get proposals as json response", - []string{ - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - }, - { - "get proposals with invalid status", - []string{ - "--status=unknown", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryProposals(address.NewBech32Codec("cosmos")) - clientCtx := val.ClientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - var proposals v1.QueryProposalsResponse - - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &proposals), out.String()) - s.Require().Greater(len(proposals.Proposals), 0) - } - }) - } -} - -func (s *E2ETestSuite) TestCmdQueryDeposits() { - val := s.network.Validators[0] - - testCases := []struct { - name string - args []string - expectErr bool - }{ - { - "get deposits of non existing proposal", - []string{ - "10", - }, - true, - }, - { - "get deposits(valid req)", - []string{ - "1", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - }, - } - - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryDeposits() - clientCtx := val.ClientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - - var deposits v1.QueryDepositsResponse - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &deposits), out.String()) - s.Require().Len(deposits.Deposits, 1) - } - }) - } -} - -func (s *E2ETestSuite) TestCmdQueryDeposit() { - val := s.network.Validators[0] - depositAmount := sdk.NewCoin(s.cfg.BondDenom, v1.DefaultMinDepositTokens) - - testCases := []struct { - name string - args []string - expectErr bool - }{ - { - "get deposit with no depositer", - []string{ - "1", - }, - true, - }, - { - "get deposit with wrong deposit address", - []string{ - "1", - "wrong address", - }, - true, - }, - { - "get deposit (valid req)", - []string{ - "1", - val.Address.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - }, - } - - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryDeposit() - clientCtx := val.ClientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - - var deposit v1.Deposit - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &deposit), out.String()) - s.Require().Equal(depositAmount.String(), sdk.Coins(deposit.Amount).String()) - } - }) - } -} - -func (s *E2ETestSuite) TestCmdQueryVotes() { - val := s.network.Validators[0] - - testCases := []struct { - name string - args []string - expectErr bool - }{ - { - "get votes with no proposal id", - []string{}, - true, - }, - { - "get votes of non existed proposal", - []string{ - "10", - }, - true, - }, - { - "vote for invalid proposal", - []string{ - "1", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - }, - } - - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryVotes() - clientCtx := val.ClientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - - var votes v1.QueryVotesResponse - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &votes), out.String()) - s.Require().Len(votes.Votes, 1) - } - }) - } -} - -func (s *E2ETestSuite) TestCmdQueryVote() { - val := s.network.Validators[0] - - testCases := []struct { - name string - args []string - expectErr bool - expVoteOptions v1.WeightedVoteOptions - }{ - { - "get vote of non existing proposal", - []string{ - "10", - val.Address.String(), - }, - true, - v1.NewNonSplitVoteOption(v1.OptionYes), - }, - { - "get vote by wrong voter", - []string{ - "1", - "wrong address", - }, - true, - v1.NewNonSplitVoteOption(v1.OptionYes), - }, - { - "vote for valid proposal", - []string{ - "1", - val.Address.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - v1.NewNonSplitVoteOption(v1.OptionYes), - }, - { - "split vote for valid proposal", - []string{ - "3", - val.Address.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - v1.WeightedVoteOptions{ - &v1.WeightedVoteOption{Option: v1.OptionYes, Weight: sdk.NewDecWithPrec(60, 2).String()}, - &v1.WeightedVoteOption{Option: v1.OptionNo, Weight: sdk.NewDecWithPrec(30, 2).String()}, - &v1.WeightedVoteOption{Option: v1.OptionAbstain, Weight: sdk.NewDecWithPrec(5, 2).String()}, - &v1.WeightedVoteOption{Option: v1.OptionNoWithVeto, Weight: sdk.NewDecWithPrec(5, 2).String()}, - }, - }, - } - - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryVote(address.NewBech32Codec("cosmos")) - clientCtx := val.ClientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - - var vote v1.Vote - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &vote), out.String()) - s.Require().Equal(len(vote.Options), len(tc.expVoteOptions)) - for i, option := range tc.expVoteOptions { - s.Require().Equal(option.Option, vote.Options[i].Option) - s.Require().Equal(option.Weight, vote.Options[i].Weight) - } - } - }) - } -} diff --git a/tests/e2e/gov/tx.go b/tests/e2e/gov/tx.go index 33cddd26115f..5bcff679372d 100644 --- a/tests/e2e/gov/tx.go +++ b/tests/e2e/gov/tx.go @@ -4,14 +4,13 @@ import ( "encoding/base64" "fmt" - "cosmossdk.io/math" - "github.com/cosmos/cosmos-sdk/testutil" - "github.com/cosmos/gogoproto/proto" "github.com/stretchr/testify/suite" + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/client/flags" - addresscodec "github.com/cosmos/cosmos-sdk/codec/address" + "github.com/cosmos/cosmos-sdk/testutil" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/cosmos/cosmos-sdk/testutil/network" sdk "github.com/cosmos/cosmos-sdk/types" @@ -61,9 +60,12 @@ func (s *E2ETestSuite) SetupSuite() { s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &resp), out.String()) s.Require().NoError(clitestutil.CheckTxCode(s.network, clientCtx, resp.TxHash, 0)) - // create a proposal without deposit + // create a proposal with a small deposit + minimumAcceptedDep := v1.DefaultMinDepositTokens.ToLegacyDec().Mul(v1.DefaultMinDepositRatio).Ceil().TruncateInt() out, err = govclitestutil.MsgSubmitLegacyProposal(val.ClientCtx, val.Address.String(), - "Text Proposal 2", "Where is the title!?", v1beta1.ProposalTypeText) + "Text Proposal 2", "Where is the title!?", v1beta1.ProposalTypeText, + fmt.Sprintf("--%s=%s", cli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, minimumAcceptedDep).String())) + s.Require().NoError(err) s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &resp), out.String()) s.Require().NoError(clitestutil.CheckTxCode(s.network, clientCtx, resp.TxHash, 0)) @@ -129,7 +131,7 @@ func (s *E2ETestSuite) TestNewCmdSubmitProposal() { "summary": "My awesome description", "metadata": "%s", "deposit": "%s" -}`, authtypes.NewModuleAddress(types.ModuleName), base64.StdEncoding.EncodeToString(propMetadata), sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(5431))) +}`, authtypes.NewModuleAddress(types.ModuleName), base64.StdEncoding.EncodeToString(propMetadata), sdk.NewCoin(s.cfg.BondDenom, math.NewInt(100000))) validPropFile := testutil.WriteToNewTempFile(s.T(), validProp) defer validPropFile.Close() @@ -145,7 +147,7 @@ func (s *E2ETestSuite) TestNewCmdSubmitProposal() { []string{ invalidPropFile.Name(), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, true, 0, nil, }, @@ -156,7 +158,7 @@ func (s *E2ETestSuite) TestNewCmdSubmitProposal() { fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, false, 0, &sdk.TxResponse{}, }, @@ -197,7 +199,7 @@ func (s *E2ETestSuite) TestNewCmdSubmitLegacyProposal() { "description": "Hello, World!", "type": "Text", "deposit": "%s" - }`, sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(5431))) + }`, sdk.NewCoin(s.cfg.BondDenom, math.NewInt(154310))) validPropFile := testutil.WriteToNewTempFile(s.T(), validProp) defer validPropFile.Close() @@ -214,7 +216,7 @@ func (s *E2ETestSuite) TestNewCmdSubmitLegacyProposal() { fmt.Sprintf("--%s=%s", cli.FlagProposal, invalidPropFile.Name()), //nolint:staticcheck // we are intentionally using a deprecated flag here. fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, true, 0, nil, }, @@ -223,10 +225,10 @@ func (s *E2ETestSuite) TestNewCmdSubmitLegacyProposal() { []string{ fmt.Sprintf("--%s='Where is the title!?'", cli.FlagDescription), //nolint:staticcheck // we are intentionally using a deprecated flag here. fmt.Sprintf("--%s=%s", cli.FlagProposalType, v1beta1.ProposalTypeText), //nolint:staticcheck // we are intentionally using a deprecated flag here. - fmt.Sprintf("--%s=%s", cli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(5431)).String()), + fmt.Sprintf("--%s=%s", cli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10000)).String()), fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, true, 0, nil, }, @@ -238,7 +240,7 @@ func (s *E2ETestSuite) TestNewCmdSubmitLegacyProposal() { fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, false, 0, &sdk.TxResponse{}, }, @@ -248,11 +250,11 @@ func (s *E2ETestSuite) TestNewCmdSubmitLegacyProposal() { fmt.Sprintf("--%s='Text Proposal'", cli.FlagTitle), fmt.Sprintf("--%s='Where is the title!?'", cli.FlagDescription), //nolint:staticcheck // we are intentionally using a deprecated flag here. fmt.Sprintf("--%s=%s", cli.FlagProposalType, v1beta1.ProposalTypeText), //nolint:staticcheck // we are intentionally using a deprecated flag here. - fmt.Sprintf("--%s=%s", cli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(5431)).String()), + fmt.Sprintf("--%s=%s", cli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, math.NewInt(100000)).String()), fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, false, 0, &sdk.TxResponse{}, }, @@ -294,7 +296,7 @@ func (s *E2ETestSuite) TestNewCmdCancelProposal() { fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, true, 0, }, @@ -305,7 +307,7 @@ func (s *E2ETestSuite) TestNewCmdCancelProposal() { fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, true, 0, }, @@ -316,7 +318,7 @@ func (s *E2ETestSuite) TestNewCmdCancelProposal() { fmt.Sprintf("--%s=%s", flags.FlagFrom, val2), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, true, 0, }, @@ -327,7 +329,7 @@ func (s *E2ETestSuite) TestNewCmdCancelProposal() { fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, false, 0, }, @@ -338,7 +340,7 @@ func (s *E2ETestSuite) TestNewCmdCancelProposal() { fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, false, 1, }, @@ -353,9 +355,9 @@ func (s *E2ETestSuite) TestNewCmdCancelProposal() { var balRes banktypes.QueryAllBalancesResponse var newBalance banktypes.QueryAllBalancesResponse if !tc.expectErr && tc.expectedCode == 0 { - resp, err := clitestutil.QueryBalancesExec(clientCtx, val.Address, addresscodec.NewBech32Codec("cosmos")) + resp, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/bank/v1beta1/balances/%s", val.APIAddress, val.Address.String())) s.Require().NoError(err) - err = val.ClientCtx.Codec.UnmarshalJSON(resp.Bytes(), &balRes) + err = val.ClientCtx.Codec.UnmarshalJSON(resp, &balRes) s.Require().NoError(err) } @@ -364,21 +366,20 @@ func (s *E2ETestSuite) TestNewCmdCancelProposal() { s.Require().Error(err) } else { s.Require().NoError(err) - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &resp), out.String()) s.Require().NoError(clitestutil.CheckTxCode(s.network, clientCtx, resp.TxHash, tc.expectedCode)) if !tc.expectErr && tc.expectedCode == 0 { - resp, err := clitestutil.QueryBalancesExec(clientCtx, val.Address, addresscodec.NewBech32Codec("cosmos")) + resp, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/bank/v1beta1/balances/%s", val.APIAddress, val.Address.String())) s.Require().NoError(err) - err = val.ClientCtx.Codec.UnmarshalJSON(resp.Bytes(), &newBalance) + err = val.ClientCtx.Codec.UnmarshalJSON(resp, &newBalance) s.Require().NoError(err) remainingAmount := v1.DefaultMinDepositTokens.Mul( - v1.DefaultProposalCancelRatio.Mul(sdk.MustNewDecFromStr("100")).TruncateInt(), + v1.DefaultProposalCancelRatio.Mul(math.LegacyMustNewDecFromStr("100")).TruncateInt(), ).Quo(math.NewIntFromUint64(100)) // new balance = old balance + remaining amount from proposal deposit - txFee (cancel proposal) - txFee := sdk.NewInt(10) + txFee := math.NewInt(10) s.Require().True( newBalance.Balances.AmountOf(s.network.Config.BondDenom).Equal( balRes.Balances.AmountOf(s.network.Config.BondDenom).Add(remainingAmount).Sub(txFee), @@ -390,84 +391,6 @@ func (s *E2ETestSuite) TestNewCmdCancelProposal() { } } -func (s *E2ETestSuite) TestNewCmdDeposit() { - val := s.network.Validators[0] - - testCases := []struct { - name string - args []string - expectErr bool - expectedCode uint32 - }{ - { - "without proposal id", - []string{ - sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10)).String(), // 10stake - fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), - }, - true, 0, - }, - { - "without deposit amount", - []string{ - "1", - fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), - }, - true, 0, - }, - { - "deposit on non existing proposal", - []string{ - "10", - sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10)).String(), // 10stake - fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), - }, - false, 1, - }, - { - "deposit on existing proposal", - []string{ - "1", - sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10)).String(), // 10stake - fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), - }, - false, 0, - }, - } - - for _, tc := range testCases { - tc := tc - var resp sdk.TxResponse - - s.Run(tc.name, func() { - cmd := cli.NewCmdDeposit() - clientCtx := val.ClientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &resp), out.String()) - s.Require().NoError(clitestutil.CheckTxCode(s.network, clientCtx, resp.TxHash, tc.expectedCode)) - } - }) - } -} - func (s *E2ETestSuite) TestNewCmdVote() { val := s.network.Validators[0] @@ -491,7 +414,7 @@ func (s *E2ETestSuite) TestNewCmdVote() { fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--metadata=%s", "AQ=="), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, false, 3, }, @@ -503,7 +426,7 @@ func (s *E2ETestSuite) TestNewCmdVote() { fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, false, 0, }, @@ -516,7 +439,7 @@ func (s *E2ETestSuite) TestNewCmdVote() { fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--metadata=%s", "AQ=="), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, false, 0, }, @@ -564,7 +487,7 @@ func (s *E2ETestSuite) TestNewCmdWeightedVote() { fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, false, 3, }, @@ -576,7 +499,7 @@ func (s *E2ETestSuite) TestNewCmdWeightedVote() { fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, false, 0, }, @@ -589,7 +512,7 @@ func (s *E2ETestSuite) TestNewCmdWeightedVote() { fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--metadata=%s", "AQ=="), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, false, 0, }, @@ -601,7 +524,7 @@ func (s *E2ETestSuite) TestNewCmdWeightedVote() { fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, true, 0, }, @@ -613,7 +536,7 @@ func (s *E2ETestSuite) TestNewCmdWeightedVote() { fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }, false, 0, }, diff --git a/tests/e2e/group/query.go b/tests/e2e/group/query.go deleted file mode 100644 index 293b8f046d18..000000000000 --- a/tests/e2e/group/query.go +++ /dev/null @@ -1,113 +0,0 @@ -package group - -import ( - "fmt" - - "github.com/cosmos/cosmos-sdk/client/flags" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/group" - client "github.com/cosmos/cosmos-sdk/x/group/client/cli" -) - -func (s *E2ETestSuite) TestTallyResult() { - val := s.network.Validators[0] - clientCtx := val.ClientCtx - - member := s.voter - - // create a proposal - out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, client.MsgSubmitProposalCmd(), - append( - []string{ - s.createCLIProposal( - s.groupPolicies[0].Address, val.Address.String(), - s.groupPolicies[0].Address, val.Address.String(), - "", "title", "summary"), - }, - s.commonFlags..., - ), - ) - s.Require().NoError(err, out.String()) - - var txResp sdk.TxResponse - s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &txResp), out.String()) - txResp, err = clitestutil.GetTxResponse(s.network, clientCtx, txResp.TxHash) - s.Require().NoError(err) - s.Require().Equal(txResp.Code, uint32(0), out.String()) - - proposalID := s.getProposalIDFromTxResponse(txResp) - - testCases := []struct { - name string - args []string - expectErr bool - expTallyResult group.TallyResult - expectErrMsg string - }{ - { - "not found", - []string{ - "12345", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - group.TallyResult{}, - "not found", - }, - { - "invalid proposal id", - []string{ - "", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - group.TallyResult{}, - "strconv.ParseUint: parsing \"\": invalid syntax", - }, - { - "valid proposal id with no votes", - []string{ - proposalID, - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - group.DefaultTallyResult(), - "", - }, - { - "valid proposal id", - []string{ - "1", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - group.TallyResult{ - YesCount: member.Weight, - AbstainCount: "0", - NoCount: "0", - NoWithVetoCount: "0", - }, - "", - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := client.QueryTallyResultCmd() - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - if tc.expectErr { - s.Require().Contains(out.String(), tc.expectErrMsg) - } else { - s.Require().NoError(err, out.String()) - var tallyResultRes group.QueryTallyResultResponse - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &tallyResultRes)) - s.Require().NotNil(tallyResultRes) - s.Require().Equal(tc.expTallyResult, tallyResultRes.Tally) - } - }) - } -} diff --git a/tests/e2e/group/suite.go b/tests/e2e/group/suite.go index 1de710d17463..6d1525e543aa 100644 --- a/tests/e2e/group/suite.go +++ b/tests/e2e/group/suite.go @@ -4,12 +4,12 @@ import ( "encoding/base64" "encoding/json" "fmt" - "strings" "github.com/stretchr/testify/suite" // without this import amino json encoding will fail when resolving any types _ "cosmossdk.io/api/cosmos/group/v1" + "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/codec/address" @@ -50,7 +50,7 @@ func (s *E2ETestSuite) SetupSuite() { s.commonFlags = []string{ fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), } var err error @@ -72,11 +72,11 @@ func (s *E2ETestSuite) SetupSuite() { val.ClientCtx, val.Address, account, - sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(2000))), + sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(2000))), address.NewBech32Codec("cosmos"), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), ) s.Require().NoError(err) s.Require().NoError(s.network.WaitForNextBlock()) @@ -119,9 +119,13 @@ func (s *E2ETestSuite) SetupSuite() { } s.createGroupThresholdPolicyWithBalance(val.Address.String(), "1", threshold, 1000) - out, err = clitestutil.ExecTestCLICmd(val.ClientCtx, client.QueryGroupPoliciesByGroupCmd(), []string{"1", fmt.Sprintf("--%s=json", flags.FlagOutput)}) - s.Require().NoError(err, out.String()) s.Require().NoError(s.network.WaitForNextBlock()) + resp, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/group/v1/group_policies_by_group/1", val.APIAddress)) + s.Require().NoError(err) + + var groupPoliciesResp group.QueryGroupPoliciesByGroupResponse + s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(resp, &groupPoliciesResp)) + s.Require().Len(groupPoliciesResp.GroupPolicies, i+1) } // create group policy with percentage decision policy out, err = clitestutil.ExecTestCLICmd(val.ClientCtx, client.MsgCreateGroupPolicyCmd(), @@ -139,13 +143,13 @@ func (s *E2ETestSuite) SetupSuite() { s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &txResp), out.String()) s.Require().NoError(clitestutil.CheckTxCode(s.network, val.ClientCtx, txResp.TxHash, 0)) - out, err = clitestutil.ExecTestCLICmd(val.ClientCtx, client.QueryGroupPoliciesByGroupCmd(), []string{"1", fmt.Sprintf("--%s=json", flags.FlagOutput)}) - s.Require().NoError(err, out.String()) + resp, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/group/v1/group_policies_by_group/1", val.APIAddress)) + s.Require().NoError(err) - var res group.QueryGroupPoliciesByGroupResponse - s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &res)) - s.Require().Equal(len(res.GroupPolicies), 6) - s.groupPolicies = res.GroupPolicies + var groupPoliciesResp group.QueryGroupPoliciesByGroupResponse + s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(resp, &groupPoliciesResp)) + s.Require().Equal(len(groupPoliciesResp.GroupPolicies), 6) + s.groupPolicies = groupPoliciesResp.GroupPolicies // create a proposal out, err = clitestutil.ExecTestCLICmd(val.ClientCtx, client.MsgSubmitProposalCmd(), @@ -179,18 +183,18 @@ func (s *E2ETestSuite) SetupSuite() { s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &txResp), out.String()) s.Require().NoError(clitestutil.CheckTxCode(s.network, val.ClientCtx, txResp.TxHash, 0)) - out, err = clitestutil.ExecTestCLICmd(val.ClientCtx, client.QueryProposalCmd(), []string{"1", fmt.Sprintf("--%s=json", flags.FlagOutput)}) - s.Require().NoError(err, out.String()) + resp, err = testutil.GetRequest(fmt.Sprintf("%s/cosmos/group/v1/proposal/1", val.APIAddress)) + s.Require().NoError(err) var proposalRes group.QueryProposalResponse - s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &proposalRes)) + s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(resp, &proposalRes)) s.proposal = proposalRes.Proposal - out, err = clitestutil.ExecTestCLICmd(val.ClientCtx, client.QueryVoteByProposalVoterCmd(), []string{"1", val.Address.String(), fmt.Sprintf("--%s=json", flags.FlagOutput)}) - s.Require().NoError(err, out.String()) + resp, err = testutil.GetRequest(fmt.Sprintf("%s/cosmos/group/v1/vote_by_proposal_voter/1/%s", val.APIAddress, val.Address.String())) + s.Require().NoError(err) var voteRes group.QueryVoteByProposalVoterResponse - s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &voteRes)) + s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(resp, &voteRes)) s.vote = voteRes.Vote s.voter = &group.Member{ @@ -205,21 +209,6 @@ func (s *E2ETestSuite) TearDownSuite() { s.network.Cleanup() } -func (s *E2ETestSuite) getProposalIDFromTxResponse(txResp sdk.TxResponse) string { - s.Require().Greater(len(txResp.Events), 0) - s.Require().NotNil(txResp.Events[0]) - events := txResp.Events - createProposalEvent, _ := sdk.TypedEventToEvent(&group.EventSubmitProposal{}) - - for _, e := range events { - if e.Type == createProposalEvent.Type { - return strings.ReplaceAll(e.Attributes[0].Value, "\"", "") - } - } - - return "" -} - // createCLIProposal writes a CLI proposal with a MsgSend to a file. Returns // the path to the JSON file. func (s *E2ETestSuite) createCLIProposal(groupPolicyAddress, proposer, sendFrom, sendTo, metadata, title, summary string) string { @@ -229,7 +218,7 @@ func (s *E2ETestSuite) createCLIProposal(groupPolicyAddress, proposer, sendFrom, msg := banktypes.MsgSend{ FromAddress: sendFrom, ToAddress: sendTo, - Amount: sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(20))), + Amount: sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(20))), } msgJSON, err := s.cfg.Codec.MarshalInterfaceJSON(&msg) s.Require().NoError(err) @@ -271,17 +260,17 @@ func (s *E2ETestSuite) createGroupThresholdPolicyWithBalance(adminAddress, group s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &txResp), out.String()) s.Require().NoError(clitestutil.CheckTxCode(s.network, val.ClientCtx, txResp.TxHash, 0)) - out, err = clitestutil.ExecTestCLICmd(val.ClientCtx, client.QueryGroupPoliciesByGroupCmd(), []string{groupID, fmt.Sprintf("--%s=json", flags.FlagOutput)}) - s.Require().NoError(err, out.String()) + resp, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/group/v1/group_policies_by_group/%s", val.APIAddress, groupID)) + s.Require().NoError(err) var res group.QueryGroupPoliciesByGroupResponse - s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &res)) + s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(resp, &res)) groupPolicyAddress := res.GroupPolicies[0].Address addr, err := sdk.AccAddressFromBech32(groupPolicyAddress) s.Require().NoError(err) _, err = clitestutil.MsgSendExec(clientCtx, val.Address, addr, - sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(tokens))), + sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(tokens))), address.NewBech32Codec("cosmos"), s.commonFlags..., ) diff --git a/tests/e2e/mint/grpc.go b/tests/e2e/mint/grpc.go index ed7824f4777c..fc513b5073cf 100644 --- a/tests/e2e/mint/grpc.go +++ b/tests/e2e/mint/grpc.go @@ -3,13 +3,12 @@ package mint import ( "fmt" + "github.com/cosmos/gogoproto/proto" + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/testutil" - sdk "github.com/cosmos/cosmos-sdk/types" grpctypes "github.com/cosmos/cosmos-sdk/types/grpc" - - "github.com/cosmos/gogoproto/proto" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" ) @@ -29,8 +28,8 @@ func (s *E2ETestSuite) TestQueryGRPC() { map[string]string{}, &minttypes.QueryParamsResponse{}, &minttypes.QueryParamsResponse{ - Params: minttypes.NewParams("stake", sdk.NewDecWithPrec(13, 2), sdk.NewDecWithPrec(100, 2), - math.LegacyNewDec(1), sdk.NewDecWithPrec(67, 2), (60 * 60 * 8766 / 5)), + Params: minttypes.NewParams("stake", math.LegacyNewDecWithPrec(13, 2), math.LegacyNewDecWithPrec(100, 2), + math.LegacyNewDec(1), math.LegacyNewDecWithPrec(67, 2), (60 * 60 * 8766 / 5)), }, }, { diff --git a/tests/e2e/mint/suite.go b/tests/e2e/mint/suite.go index da83fed2d0a2..808052c855f4 100644 --- a/tests/e2e/mint/suite.go +++ b/tests/e2e/mint/suite.go @@ -1,16 +1,11 @@ package mint import ( - "fmt" - "strings" - "github.com/stretchr/testify/suite" - "github.com/cosmos/cosmos-sdk/client/flags" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/testutil/network" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/mint/client/cli" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" ) @@ -33,7 +28,7 @@ func (s *E2ETestSuite) SetupSuite() { var mintData minttypes.GenesisState s.Require().NoError(s.cfg.Codec.UnmarshalJSON(genesisState[minttypes.ModuleName], &mintData)) - inflation := sdk.MustNewDecFromStr("1.0") + inflation := math.LegacyMustNewDecFromStr("1.0") mintData.Minter.Inflation = inflation mintData.Params.InflationMin = inflation mintData.Params.InflationMax = inflation @@ -53,110 +48,3 @@ func (s *E2ETestSuite) TearDownSuite() { s.T().Log("tearing down e2e test suite") s.network.Cleanup() } - -func (s *E2ETestSuite) TestGetCmdQueryParams() { - val := s.network.Validators[0] - - testCases := []struct { - name string - args []string - expectedOutput string - }{ - { - "json output", - []string{fmt.Sprintf("--%s=1", flags.FlagHeight), fmt.Sprintf("--%s=json", flags.FlagOutput)}, - `{"mint_denom":"stake","inflation_rate_change":"0.130000000000000000","inflation_max":"1.000000000000000000","inflation_min":"1.000000000000000000","goal_bonded":"0.670000000000000000","blocks_per_year":"6311520"}`, - }, - { - "text output", - []string{fmt.Sprintf("--%s=1", flags.FlagHeight), fmt.Sprintf("--%s=text", flags.FlagOutput)}, - `blocks_per_year: "6311520" -goal_bonded: "0.670000000000000000" -inflation_max: "1.000000000000000000" -inflation_min: "1.000000000000000000" -inflation_rate_change: "0.130000000000000000" -mint_denom: stake`, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryParams() - clientCtx := val.ClientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - s.Require().NoError(err) - s.Require().Equal(tc.expectedOutput, strings.TrimSpace(out.String())) - }) - } -} - -func (s *E2ETestSuite) TestGetCmdQueryInflation() { - val := s.network.Validators[0] - - testCases := []struct { - name string - args []string - expectedOutput string - }{ - { - "json output", - []string{fmt.Sprintf("--%s=1", flags.FlagHeight), fmt.Sprintf("--%s=json", flags.FlagOutput)}, - `1.000000000000000000`, - }, - { - "text output", - []string{fmt.Sprintf("--%s=1", flags.FlagHeight), fmt.Sprintf("--%s=text", flags.FlagOutput)}, - `1.000000000000000000`, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryInflation() - clientCtx := val.ClientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - s.Require().NoError(err) - s.Require().Equal(tc.expectedOutput, strings.TrimSpace(out.String())) - }) - } -} - -func (s *E2ETestSuite) TestGetCmdQueryAnnualProvisions() { - val := s.network.Validators[0] - - testCases := []struct { - name string - args []string - expectedOutput string - }{ - { - "json output", - []string{fmt.Sprintf("--%s=1", flags.FlagHeight), fmt.Sprintf("--%s=json", flags.FlagOutput)}, - `500000000.000000000000000000`, - }, - { - "text output", - []string{fmt.Sprintf("--%s=1", flags.FlagHeight), fmt.Sprintf("--%s=text", flags.FlagOutput)}, - `500000000.000000000000000000`, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryAnnualProvisions() - clientCtx := val.ClientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - s.Require().NoError(err) - s.Require().Equal(tc.expectedOutput, strings.TrimSpace(out.String())) - }) - } -} diff --git a/tests/e2e/params/app_config.go b/tests/e2e/params/app_config.go deleted file mode 100644 index 415c01e0553f..000000000000 --- a/tests/e2e/params/app_config.go +++ /dev/null @@ -1,23 +0,0 @@ -package testutil - -import ( - "github.com/cosmos/cosmos-sdk/testutil/configurator" - - _ "github.com/cosmos/cosmos-sdk/x/auth" // import as blank for app wiring - _ "github.com/cosmos/cosmos-sdk/x/auth/tx/config" // import as blank for app wiring - _ "github.com/cosmos/cosmos-sdk/x/bank" // import as blank for app wiring - _ "github.com/cosmos/cosmos-sdk/x/consensus" // import as blank for app wiring - _ "github.com/cosmos/cosmos-sdk/x/genutil" // import as blank for app wiring - _ "github.com/cosmos/cosmos-sdk/x/params" // import as blank for app wiring - _ "github.com/cosmos/cosmos-sdk/x/staking" // import as blank for app wiring -) - -var AppConfig = configurator.NewAppConfig( - configurator.AuthModule(), - configurator.BankModule(), - configurator.StakingModule(), - configurator.TxModule(), - configurator.ConsensusModule(), - configurator.ParamsModule(), - configurator.GenutilModule(), -) diff --git a/tests/e2e/params/cli_test.go b/tests/e2e/params/cli_test.go deleted file mode 100644 index 80081e2bcaf8..000000000000 --- a/tests/e2e/params/cli_test.go +++ /dev/null @@ -1,19 +0,0 @@ -//go:build e2e -// +build e2e - -package testutil - -import ( - "testing" - - "github.com/stretchr/testify/suite" - - "cosmossdk.io/simapp" - "github.com/cosmos/cosmos-sdk/testutil/network" -) - -func TestE2ETestSuite(t *testing.T) { - cfg := network.DefaultConfig(simapp.NewTestNetworkFixture) - cfg.NumValidators = 1 - suite.Run(t, NewE2ETestSuite(cfg)) -} diff --git a/tests/e2e/params/grpc.go b/tests/e2e/params/grpc.go deleted file mode 100644 index 99c1b603a609..000000000000 --- a/tests/e2e/params/grpc.go +++ /dev/null @@ -1,85 +0,0 @@ -package testutil - -import ( - "fmt" - - "github.com/cosmos/gogoproto/proto" - - "github.com/cosmos/cosmos-sdk/testutil" - "github.com/cosmos/cosmos-sdk/x/params/types/proposal" -) - -func (s *E2ETestSuite) TestQueryParamsGRPC() { - val := s.network.Validators[0] - baseURL := val.APIAddress - - testCases := []struct { - name string - url string - headers map[string]string - expErr bool - respType proto.Message - expected proto.Message - }{ - { - "with no subspace, key", - fmt.Sprintf("%s/cosmos/params/v1beta1/params?subspace=%s&key=%s", baseURL, "", ""), - map[string]string{}, - true, - &proposal.QueryParamsResponse{}, - nil, - }, - { - "with wrong subspace", - fmt.Sprintf("%s/cosmos/params/v1beta1/params?subspace=%s&key=%s", baseURL, "wrongSubspace", "foo"), - map[string]string{}, - true, - &proposal.QueryParamsResponse{}, - nil, - }, - { - "with wrong key", - fmt.Sprintf("%s/cosmos/params/v1beta1/params?subspace=%s&key=%s", baseURL, mySubspace, "wrongKey"), - map[string]string{}, - false, - &proposal.QueryParamsResponse{}, - &proposal.QueryParamsResponse{ - Param: proposal.ParamChange{ - Subspace: mySubspace, - Key: "wrongKey", - }, - }, - }, - { - "params", - fmt.Sprintf("%s/cosmos/params/v1beta1/params?subspace=%s&key=%s", baseURL, mySubspace, "bar"), - map[string]string{}, - false, - &proposal.QueryParamsResponse{}, - &proposal.QueryParamsResponse{ - Param: proposal.ParamChange{ - Subspace: mySubspace, - Key: "bar", - Value: `"1234"`, - }, - }, - }, - } - - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - resp, err := testutil.GetRequestWithHeaders(tc.url, tc.headers) - s.Require().NoError(err) - - err = val.ClientCtx.Codec.UnmarshalJSON(resp, tc.respType) - - if tc.expErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - s.Require().Equal(tc.expected.String(), tc.respType.String()) - } - }) - } -} diff --git a/tests/e2e/params/suite.go b/tests/e2e/params/suite.go deleted file mode 100644 index 89c8618440f6..000000000000 --- a/tests/e2e/params/suite.go +++ /dev/null @@ -1,148 +0,0 @@ -package testutil - -import ( - "fmt" - "strings" - - abci "github.com/cometbft/cometbft/abci/types" - dbm "github.com/cosmos/cosmos-db" - "github.com/stretchr/testify/suite" - - "cosmossdk.io/depinject" - pruningtypes "cosmossdk.io/store/pruning/types" - - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/runtime" - servertypes "github.com/cosmos/cosmos-sdk/server/types" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - "github.com/cosmos/cosmos-sdk/testutil/network" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/params/client/cli" - "github.com/cosmos/cosmos-sdk/x/params/keeper" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" -) - -// mySubspace is a x/params subspace created for the purpose of this -// test suite. -const mySubspace = "foo" - -// myParams defines some params in the `mySubspace` subspace. -type myParams struct{} - -func (p *myParams) ParamSetPairs() paramtypes.ParamSetPairs { - return paramtypes.ParamSetPairs{ - paramtypes.NewParamSetPair([]byte("bar"), 1234, func(value interface{}) error { return nil }), - } -} - -type E2ETestSuite struct { - suite.Suite - - cfg network.Config - network *network.Network -} - -func NewE2ETestSuite(cfg network.Config) *E2ETestSuite { - return &E2ETestSuite{cfg: cfg} -} - -func (s *E2ETestSuite) SetupSuite() { - s.T().Log("setting up e2e test suite") - - // Create a new AppConstructor for this test suite, where we manually - // add a subspace and `myParams` to the x/params store. - s.cfg.AppConstructor = func(val network.ValidatorI) servertypes.Application { - var ( - appBuilder *runtime.AppBuilder - paramsKeeper keeper.Keeper - ) - if err := depinject.Inject( - depinject.Configs( - AppConfig, - depinject.Supply(val.GetCtx().Logger), - ), - &appBuilder, ¶msKeeper); err != nil { - panic(err) - } - - // Add this test's `myParams` to the x/params store. - paramSet := myParams{} - subspace := paramsKeeper.Subspace(mySubspace).WithKeyTable(paramtypes.NewKeyTable().RegisterParamSet(¶mSet)) - - app := appBuilder.Build( - dbm.NewMemDB(), - nil, - baseapp.SetPruning(pruningtypes.NewPruningOptionsFromString(val.GetAppConfig().Pruning)), - baseapp.SetMinGasPrices(val.GetAppConfig().MinGasPrices), - baseapp.SetChainID(s.cfg.ChainID), - ) - - s.Require().NoError(app.Load(false)) - - // Make sure not to forget to persist `myParams` into the actual store, - // this is done in InitChain. - app.SetInitChainer(func(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error) { - subspace.SetParamSet(ctx, ¶mSet) - - return app.InitChainer(ctx, req) - }) - - s.Require().NoError(app.LoadLatestVersion()) - - return app - } - - var err error - s.network, err = network.New(s.T(), s.T().TempDir(), s.cfg) - s.Require().NoError(err) - - s.Require().NoError(s.network.WaitForNextBlock()) -} - -func (s *E2ETestSuite) TearDownSuite() { - s.T().Log("tearing down e2e test suite") - s.network.Cleanup() -} - -func (s *E2ETestSuite) TestNewQuerySubspaceParamsCmd() { - val := s.network.Validators[0] - - testCases := []struct { - name string - args []string - expectedOutput string - }{ - { - "json output", - []string{ - "foo", "bar", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - `{"subspace":"foo","key":"bar","value":"\"1234\""}`, - }, - { - "text output", - []string{ - "foo", "bar", - fmt.Sprintf("--%s=text", flags.FlagOutput), - }, - `key: bar -subspace: foo -value: '"1234"'`, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.NewQuerySubspaceParamsCmd() - clientCtx := val.ClientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - s.Require().NoError(err) - s.Require().Equal(tc.expectedOutput, strings.TrimSpace(out.String())) - }) - } -} diff --git a/tests/e2e/staking/suite.go b/tests/e2e/staking/suite.go index e74bcaaff9a0..5852446f21f3 100644 --- a/tests/e2e/staking/suite.go +++ b/tests/e2e/staking/suite.go @@ -10,6 +10,8 @@ import ( "github.com/cometbft/cometbft/rpc/client/http" "github.com/stretchr/testify/suite" + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/client/flags" addresscodec "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/crypto/hd" @@ -63,7 +65,7 @@ func (s *E2ETestSuite) SetupSuite() { s.Require().Equal(uint32(0), txRes.Code) s.Require().NoError(s.network.WaitForNextBlock()) - unbondingAmount := sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(5)) + unbondingAmount := sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(5)) // unbonding the amount out, err = MsgUnbondExec(val.ClientCtx, val.Address, val.ValAddress, unbondingAmount) @@ -105,22 +107,22 @@ func (s *E2ETestSuite) TestBlockResults() { val.ClientCtx, val.Address, newAddr, - sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(200))), addresscodec.NewBech32Codec("cosmos"), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(200))), addresscodec.NewBech32Codec("cosmos"), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), ) require.NoError(err) require.NoError(s.network.WaitForNextBlock()) // Use CLI to create a delegation from the new account to validator `val`. - cmd := cli.NewDelegateCmd() + cmd := cli.NewDelegateCmd(addresscodec.NewBech32Codec("cosmosvaloper"), addresscodec.NewBech32Codec("cosmos")) _, err = clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, []string{ val.ValAddress.String(), - sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(150)).String(), + sdk.NewCoin(s.cfg.BondDenom, math.NewInt(150)).String(), fmt.Sprintf("--%s=%s", flags.FlagFrom, newAddr.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), }) require.NoError(err) require.NoError(s.network.WaitForNextBlock()) diff --git a/tests/e2e/staking/test_helpers.go b/tests/e2e/staking/test_helpers.go index 787080dcd897..6605dc867dae 100644 --- a/tests/e2e/staking/test_helpers.go +++ b/tests/e2e/staking/test_helpers.go @@ -3,8 +3,11 @@ package testutil import ( "fmt" + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/testutil" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" sdk "github.com/cosmos/cosmos-sdk/types" @@ -14,7 +17,7 @@ import ( var commonArgs = []string{ fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(10))).String()), } // MsgRedelegateExec creates a redelegate message. @@ -29,7 +32,7 @@ func MsgRedelegateExec(clientCtx client.Context, from, src, dst, amount fmt.Stri args = append(args, extraArgs...) args = append(args, commonArgs...) - return clitestutil.ExecTestCLICmd(clientCtx, stakingcli.NewRedelegateCmd(), args) + return clitestutil.ExecTestCLICmd(clientCtx, stakingcli.NewRedelegateCmd(addresscodec.NewBech32Codec("cosmosvaloper"), addresscodec.NewBech32Codec("cosmos")), args) } // MsgUnbondExec creates a unbond message. @@ -45,5 +48,5 @@ func MsgUnbondExec(clientCtx client.Context, from, valAddress, args = append(args, commonArgs...) args = append(args, extraArgs...) - return clitestutil.ExecTestCLICmd(clientCtx, stakingcli.NewUnbondCmd(), args) + return clitestutil.ExecTestCLICmd(clientCtx, stakingcli.NewUnbondCmd(addresscodec.NewBech32Codec("cosmosvaloper"), addresscodec.NewBech32Codec("cosmos")), args) } diff --git a/tests/e2e/tx/service_test.go b/tests/e2e/tx/service_test.go index 24e407969c2f..cee50c6a5a62 100644 --- a/tests/e2e/tx/service_test.go +++ b/tests/e2e/tx/service_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/suite" errorsmod "cosmossdk.io/errors" - + "cosmossdk.io/math" "cosmossdk.io/simapp" "github.com/cosmos/cosmos-sdk/client" @@ -73,12 +73,12 @@ func (s *E2ETestSuite) SetupSuite() { val.Address, val.Address, sdk.NewCoins( - sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10)), + sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10)), ), addresscodec.NewBech32Codec("cosmos"), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--gas=%d", flags.DefaultGasLimit), fmt.Sprintf("--%s=foobar", flags.FlagNote), ) @@ -91,7 +91,7 @@ func (s *E2ETestSuite) SetupSuite() { val.Address, val.Address, sdk.NewCoins( - sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(1)), + sdk.NewCoin(s.cfg.BondDenom, math.NewInt(1)), ), addresscodec.NewBech32Codec("cosmos"), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), @@ -99,7 +99,7 @@ func (s *E2ETestSuite) SetupSuite() { fmt.Sprintf("--%s=0", flags.FlagAccountNumber), fmt.Sprintf("--%s=2", flags.FlagSequence), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--gas=%d", flags.DefaultGasLimit), fmt.Sprintf("--%s=foobar", flags.FlagNote), ) @@ -603,7 +603,7 @@ func (s *E2ETestSuite) TestSimMultiSigTx() { addresscodec.NewBech32Codec("cosmos"), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--gas=%d", flags.DefaultGasLimit), ) s.Require().NoError(err) @@ -624,7 +624,7 @@ func (s *E2ETestSuite) TestSimMultiSigTx() { addresscodec.NewBech32Codec("cosmos"), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), fmt.Sprintf("--%s=true", flags.FlagGenerateOnly), fmt.Sprintf("--%s=foobar", flags.FlagNote), ) diff --git a/tests/e2e/upgrade/cli_test.go b/tests/e2e/upgrade/cli_test.go deleted file mode 100644 index fee20ee5541a..000000000000 --- a/tests/e2e/upgrade/cli_test.go +++ /dev/null @@ -1,26 +0,0 @@ -//go:build e2e -// +build e2e - -package upgrade - -import ( - "testing" - - "github.com/stretchr/testify/suite" - - "cosmossdk.io/simapp" - "github.com/cosmos/cosmos-sdk/testutil/network" -) - -func TestE2ETestSuite(t *testing.T) { - cfg := network.DefaultConfig(simapp.NewTestNetworkFixture) - cfg.NumValidators = 1 - - app := simapp.Setup(t, false) - ctx := app.BaseApp.NewContext(false) - - app.UpgradeKeeper.SetVersionSetter(app.BaseApp) - app.UpgradeKeeper.SetModuleVersionMap(ctx, app.ModuleManager.GetVersionMap()) - - suite.Run(t, NewE2ETestSuite(cfg, app.UpgradeKeeper, ctx)) -} diff --git a/tests/e2e/upgrade/suite.go b/tests/e2e/upgrade/suite.go deleted file mode 100644 index 620071329093..000000000000 --- a/tests/e2e/upgrade/suite.go +++ /dev/null @@ -1,115 +0,0 @@ -package upgrade - -import ( - "fmt" - - "github.com/stretchr/testify/suite" - - "cosmossdk.io/x/upgrade/client/cli" - "cosmossdk.io/x/upgrade/keeper" - "cosmossdk.io/x/upgrade/types" - - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - "github.com/cosmos/cosmos-sdk/testutil/network" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -func NewE2ETestSuite(cfg network.Config, keeper *keeper.Keeper, ctx sdk.Context) *E2ETestSuite { - return &E2ETestSuite{ - cfg: cfg, - upgradeKeeper: keeper, - ctx: ctx, - } -} - -type E2ETestSuite struct { - suite.Suite - - upgradeKeeper *keeper.Keeper - cfg network.Config - network *network.Network - ctx sdk.Context -} - -func (s *E2ETestSuite) SetupSuite() { - s.T().Log("setting up e2e test suite") - - var err error - s.network, err = network.New(s.T(), s.T().TempDir(), s.cfg) - s.Require().NoError(err) -} - -func (s *E2ETestSuite) TearDownSuite() { - s.T().Log("tearing down e2e test suite") - s.network.Cleanup() -} - -func (s *E2ETestSuite) TestModuleVersionsCLI() { - testCases := []struct { - msg string - req types.QueryModuleVersionsRequest - single bool - expPass bool - }{ - { - msg: "test full query", - req: types.QueryModuleVersionsRequest{ModuleName: ""}, - single: false, - expPass: true, - }, - { - msg: "test single module", - req: types.QueryModuleVersionsRequest{ModuleName: "bank"}, - single: true, - expPass: true, - }, - { - msg: "test non-existent module", - req: types.QueryModuleVersionsRequest{ModuleName: "abcdefg"}, - single: true, - expPass: false, - }, - } - - val := s.network.Validators[0] - clientCtx := val.ClientCtx - // avoid printing as yaml from CLI command - clientCtx.OutputFormat = "JSON" - - vm, err := s.upgradeKeeper.GetModuleVersionMap(s.ctx) - s.Require().NoError(err) - s.Require().NotEmpty(vm) - - mv, err := s.upgradeKeeper.GetModuleVersions(s.ctx) - s.Require().NoError(err) - - for _, tc := range testCases { - s.Run(fmt.Sprintf("Case %s", tc.msg), func() { - expect := mv - if tc.expPass { - if tc.single { - expect = []*types.ModuleVersion{{Name: tc.req.ModuleName, Version: vm[tc.req.ModuleName]}} - } - // setup expected response - pm := types.QueryModuleVersionsResponse{ - ModuleVersions: expect, - } - jsonVM, _ := clientCtx.Codec.MarshalJSON(&pm) - expectedRes := string(jsonVM) - // append new line to match behavior of PrintProto - expectedRes += "\n" - - // get actual module versions list response from cli - cmd := cli.GetModuleVersionsCmd() - outVM, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{tc.req.ModuleName}) - s.Require().NoError(err) - - s.Require().Equal(expectedRes, outVM.String()) - } else { - cmd := cli.GetModuleVersionsCmd() - _, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{tc.req.ModuleName}) - s.Require().Error(err) - } - }) - } -} diff --git a/fuzz/README.md b/tests/fuzz/README.md similarity index 68% rename from fuzz/README.md rename to tests/fuzz/README.md index f93a91c52ef0..f6c6952cc2ad 100644 --- a/fuzz/README.md +++ b/tests/fuzz/README.md @@ -7,8 +7,4 @@ To run a fuzz test, use the `-fuzz` flag to `go test`. For example: ```shell go test -fuzz FuzzCryptoHDNewParamsFromPath ./tests -``` - -## oss-fuzz build status - -https://oss-fuzz-build-logs.storage.googleapis.com/index.html#cosmos-sdk +``` \ No newline at end of file diff --git a/fuzz/tests/crypto_hd_deriveprivatekeyforpath_test.go b/tests/fuzz/tests/crypto_hd_deriveprivatekeyforpath_test.go similarity index 99% rename from fuzz/tests/crypto_hd_deriveprivatekeyforpath_test.go rename to tests/fuzz/tests/crypto_hd_deriveprivatekeyforpath_test.go index b4be816440fc..0f235262c628 100644 --- a/fuzz/tests/crypto_hd_deriveprivatekeyforpath_test.go +++ b/tests/fuzz/tests/crypto_hd_deriveprivatekeyforpath_test.go @@ -6,8 +6,9 @@ import ( "bytes" "testing" - "github.com/cosmos/cosmos-sdk/crypto/hd" bip39 "github.com/cosmos/go-bip39" + + "github.com/cosmos/cosmos-sdk/crypto/hd" ) func mnemonicToSeed(mnemonic string) []byte { diff --git a/fuzz/tests/crypto_hd_newparamsfrompath_test.go b/tests/fuzz/tests/crypto_hd_newparamsfrompath_test.go similarity index 100% rename from fuzz/tests/crypto_hd_newparamsfrompath_test.go rename to tests/fuzz/tests/crypto_hd_newparamsfrompath_test.go diff --git a/fuzz/tests/crypto_types_compactbitarray_marshalunmarshal_test.go b/tests/fuzz/tests/crypto_types_compactbitarray_marshalunmarshal_test.go similarity index 100% rename from fuzz/tests/crypto_types_compactbitarray_marshalunmarshal_test.go rename to tests/fuzz/tests/crypto_types_compactbitarray_marshalunmarshal_test.go diff --git a/fuzz/tests/tendermint_amino_decodetime_test.go b/tests/fuzz/tests/tendermint_amino_decodetime_test.go similarity index 100% rename from fuzz/tests/tendermint_amino_decodetime_test.go rename to tests/fuzz/tests/tendermint_amino_decodetime_test.go diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/0016ef3664364bf98829d8fca4bedfc661134217fce116696a3c03998f02b837 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/0016ef3664364bf98829d8fca4bedfc661134217fce116696a3c03998f02b837 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/0016ef3664364bf98829d8fca4bedfc661134217fce116696a3c03998f02b837 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/0016ef3664364bf98829d8fca4bedfc661134217fce116696a3c03998f02b837 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/005bb317f2c5acfe89e7dd4a1320be3a2b07854172d8e8f6753152e92dacdf86 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/005bb317f2c5acfe89e7dd4a1320be3a2b07854172d8e8f6753152e92dacdf86 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/005bb317f2c5acfe89e7dd4a1320be3a2b07854172d8e8f6753152e92dacdf86 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/005bb317f2c5acfe89e7dd4a1320be3a2b07854172d8e8f6753152e92dacdf86 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/0064c3809bf008bfd5506869a55575ff16103e5953a0d7e76706232dea5c287c b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/0064c3809bf008bfd5506869a55575ff16103e5953a0d7e76706232dea5c287c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/0064c3809bf008bfd5506869a55575ff16103e5953a0d7e76706232dea5c287c rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/0064c3809bf008bfd5506869a55575ff16103e5953a0d7e76706232dea5c287c diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/06d096d0255501e69f54673bca6e9deb9c45dea56cb8ddce86b35ed359ea426d b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/06d096d0255501e69f54673bca6e9deb9c45dea56cb8ddce86b35ed359ea426d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/06d096d0255501e69f54673bca6e9deb9c45dea56cb8ddce86b35ed359ea426d rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/06d096d0255501e69f54673bca6e9deb9c45dea56cb8ddce86b35ed359ea426d diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/06d3023295426cc2df9a8068c84fedbe71d9852291c00c2e8ba1158334124bf2 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/06d3023295426cc2df9a8068c84fedbe71d9852291c00c2e8ba1158334124bf2 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/06d3023295426cc2df9a8068c84fedbe71d9852291c00c2e8ba1158334124bf2 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/06d3023295426cc2df9a8068c84fedbe71d9852291c00c2e8ba1158334124bf2 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/112ad8b16d175a382d43410d568ffe2e556b972b164572a4f5e2532773397e69 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/112ad8b16d175a382d43410d568ffe2e556b972b164572a4f5e2532773397e69 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/112ad8b16d175a382d43410d568ffe2e556b972b164572a4f5e2532773397e69 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/112ad8b16d175a382d43410d568ffe2e556b972b164572a4f5e2532773397e69 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/14d44ae1fbad68dc536aa58d6e190fda9157c2638a56f9890f4c0596de03f68b b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/14d44ae1fbad68dc536aa58d6e190fda9157c2638a56f9890f4c0596de03f68b similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/14d44ae1fbad68dc536aa58d6e190fda9157c2638a56f9890f4c0596de03f68b rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/14d44ae1fbad68dc536aa58d6e190fda9157c2638a56f9890f4c0596de03f68b diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/17eacf7e1e380ff3dfb4bcbcc8ab0358bb38fd6b1082794f8ecfb8d7579906ac b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/17eacf7e1e380ff3dfb4bcbcc8ab0358bb38fd6b1082794f8ecfb8d7579906ac similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/17eacf7e1e380ff3dfb4bcbcc8ab0358bb38fd6b1082794f8ecfb8d7579906ac rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/17eacf7e1e380ff3dfb4bcbcc8ab0358bb38fd6b1082794f8ecfb8d7579906ac diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/20c9d3462a1ab90b199593496f1cf02206e99e4b97e419120b78e541df133e19 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/20c9d3462a1ab90b199593496f1cf02206e99e4b97e419120b78e541df133e19 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/20c9d3462a1ab90b199593496f1cf02206e99e4b97e419120b78e541df133e19 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/20c9d3462a1ab90b199593496f1cf02206e99e4b97e419120b78e541df133e19 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/2132a0b2256acdfe8a65a8906605d71ac84abe98f30f6fae72ee59da4451ada6 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/2132a0b2256acdfe8a65a8906605d71ac84abe98f30f6fae72ee59da4451ada6 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/2132a0b2256acdfe8a65a8906605d71ac84abe98f30f6fae72ee59da4451ada6 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/2132a0b2256acdfe8a65a8906605d71ac84abe98f30f6fae72ee59da4451ada6 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/23883606fbab1173888c3174574a998eb6464eb772fa4fb8686144778fc9e878 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/23883606fbab1173888c3174574a998eb6464eb772fa4fb8686144778fc9e878 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/23883606fbab1173888c3174574a998eb6464eb772fa4fb8686144778fc9e878 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/23883606fbab1173888c3174574a998eb6464eb772fa4fb8686144778fc9e878 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/2678424facde46ebf9de8438bccdd3a91efae7d5d82ee945c45d7a22ebb3cf47 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/2678424facde46ebf9de8438bccdd3a91efae7d5d82ee945c45d7a22ebb3cf47 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/2678424facde46ebf9de8438bccdd3a91efae7d5d82ee945c45d7a22ebb3cf47 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/2678424facde46ebf9de8438bccdd3a91efae7d5d82ee945c45d7a22ebb3cf47 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/2803f3473d5843b609a9a6c1181da67c84e9fede335e714e16e3d30d61671759 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/2803f3473d5843b609a9a6c1181da67c84e9fede335e714e16e3d30d61671759 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/2803f3473d5843b609a9a6c1181da67c84e9fede335e714e16e3d30d61671759 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/2803f3473d5843b609a9a6c1181da67c84e9fede335e714e16e3d30d61671759 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/2a4f814f310660c0fe8d1f2168e34e46e5192d0012a70bfe8f27025ff530ce30 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/2a4f814f310660c0fe8d1f2168e34e46e5192d0012a70bfe8f27025ff530ce30 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/2a4f814f310660c0fe8d1f2168e34e46e5192d0012a70bfe8f27025ff530ce30 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/2a4f814f310660c0fe8d1f2168e34e46e5192d0012a70bfe8f27025ff530ce30 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/2e92dbaae15e2cb582d75e2471bf280e21f16705b369e031af3d93cc5fb56c28 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/2e92dbaae15e2cb582d75e2471bf280e21f16705b369e031af3d93cc5fb56c28 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/2e92dbaae15e2cb582d75e2471bf280e21f16705b369e031af3d93cc5fb56c28 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/2e92dbaae15e2cb582d75e2471bf280e21f16705b369e031af3d93cc5fb56c28 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/2fad261a22ef449d9adb31753967c31ce09eb6da61694811c63b53d72afe5833 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/2fad261a22ef449d9adb31753967c31ce09eb6da61694811c63b53d72afe5833 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/2fad261a22ef449d9adb31753967c31ce09eb6da61694811c63b53d72afe5833 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/2fad261a22ef449d9adb31753967c31ce09eb6da61694811c63b53d72afe5833 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/2fd96acb3f292b403506794c21626fb48a097ea8d4e4c1c1c702abce3da20491 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/2fd96acb3f292b403506794c21626fb48a097ea8d4e4c1c1c702abce3da20491 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/2fd96acb3f292b403506794c21626fb48a097ea8d4e4c1c1c702abce3da20491 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/2fd96acb3f292b403506794c21626fb48a097ea8d4e4c1c1c702abce3da20491 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/324395ebcc2ee064d69e18f9623682c9f924a684b8588da167bceb324437432a b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/324395ebcc2ee064d69e18f9623682c9f924a684b8588da167bceb324437432a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/324395ebcc2ee064d69e18f9623682c9f924a684b8588da167bceb324437432a rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/324395ebcc2ee064d69e18f9623682c9f924a684b8588da167bceb324437432a diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/3360c9439c98cc32decf20f58566d51487c1ee837d9883c79e09fd67639bf168 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/3360c9439c98cc32decf20f58566d51487c1ee837d9883c79e09fd67639bf168 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/3360c9439c98cc32decf20f58566d51487c1ee837d9883c79e09fd67639bf168 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/3360c9439c98cc32decf20f58566d51487c1ee837d9883c79e09fd67639bf168 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/33ff7c6bb3f8526b80e9ba3864ee004cbb8dc95be88ce6252359531743e8eb6e b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/33ff7c6bb3f8526b80e9ba3864ee004cbb8dc95be88ce6252359531743e8eb6e similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/33ff7c6bb3f8526b80e9ba3864ee004cbb8dc95be88ce6252359531743e8eb6e rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/33ff7c6bb3f8526b80e9ba3864ee004cbb8dc95be88ce6252359531743e8eb6e diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/3693bca3b52a3ba81a72b4b500bf38c185687475becab7c3ba1ca4649ed01904 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/3693bca3b52a3ba81a72b4b500bf38c185687475becab7c3ba1ca4649ed01904 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/3693bca3b52a3ba81a72b4b500bf38c185687475becab7c3ba1ca4649ed01904 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/3693bca3b52a3ba81a72b4b500bf38c185687475becab7c3ba1ca4649ed01904 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/39261a60cc5fb8a371da5ff15c69e3e00829123f74b7bbca62cb04f1d36863f1 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/39261a60cc5fb8a371da5ff15c69e3e00829123f74b7bbca62cb04f1d36863f1 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/39261a60cc5fb8a371da5ff15c69e3e00829123f74b7bbca62cb04f1d36863f1 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/39261a60cc5fb8a371da5ff15c69e3e00829123f74b7bbca62cb04f1d36863f1 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/3c8f208f5518e6773db9cbea5fabeae0e6887f2c8c6920af2f51a04bb94cf832 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/3c8f208f5518e6773db9cbea5fabeae0e6887f2c8c6920af2f51a04bb94cf832 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/3c8f208f5518e6773db9cbea5fabeae0e6887f2c8c6920af2f51a04bb94cf832 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/3c8f208f5518e6773db9cbea5fabeae0e6887f2c8c6920af2f51a04bb94cf832 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/3fcb8a3e1127b991eb78170c072f1c76f983cf5ed519db6c3d26d30655906376 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/3fcb8a3e1127b991eb78170c072f1c76f983cf5ed519db6c3d26d30655906376 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/3fcb8a3e1127b991eb78170c072f1c76f983cf5ed519db6c3d26d30655906376 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/3fcb8a3e1127b991eb78170c072f1c76f983cf5ed519db6c3d26d30655906376 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/402d7b24db7a06035b96883fd70879767132b2b8dfc4c0abaf900ab6d9392ee2 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/402d7b24db7a06035b96883fd70879767132b2b8dfc4c0abaf900ab6d9392ee2 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/402d7b24db7a06035b96883fd70879767132b2b8dfc4c0abaf900ab6d9392ee2 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/402d7b24db7a06035b96883fd70879767132b2b8dfc4c0abaf900ab6d9392ee2 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/404765be1503c25873897ac6dc10d74bc01d04b8a02e1ef73885b2472a62a870 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/404765be1503c25873897ac6dc10d74bc01d04b8a02e1ef73885b2472a62a870 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/404765be1503c25873897ac6dc10d74bc01d04b8a02e1ef73885b2472a62a870 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/404765be1503c25873897ac6dc10d74bc01d04b8a02e1ef73885b2472a62a870 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/41e89f675daa9ab293d6bb78fc355354992b121304c8608cc5f0f39d073e3289 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/41e89f675daa9ab293d6bb78fc355354992b121304c8608cc5f0f39d073e3289 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/41e89f675daa9ab293d6bb78fc355354992b121304c8608cc5f0f39d073e3289 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/41e89f675daa9ab293d6bb78fc355354992b121304c8608cc5f0f39d073e3289 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/4323ce2a044c42e41bd6766480b40b6ebb70cc6d740dbc89790844a8394bf047 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/4323ce2a044c42e41bd6766480b40b6ebb70cc6d740dbc89790844a8394bf047 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/4323ce2a044c42e41bd6766480b40b6ebb70cc6d740dbc89790844a8394bf047 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/4323ce2a044c42e41bd6766480b40b6ebb70cc6d740dbc89790844a8394bf047 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/43485c5ffdda2b7156669d28f5aa209c8500e3d2b79131b707aa6310682f5501 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/43485c5ffdda2b7156669d28f5aa209c8500e3d2b79131b707aa6310682f5501 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/43485c5ffdda2b7156669d28f5aa209c8500e3d2b79131b707aa6310682f5501 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/43485c5ffdda2b7156669d28f5aa209c8500e3d2b79131b707aa6310682f5501 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/45d6a6bb7c9eb3867c58559d3390f9fe4425acc432311499c9475ebc2da81924 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/45d6a6bb7c9eb3867c58559d3390f9fe4425acc432311499c9475ebc2da81924 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/45d6a6bb7c9eb3867c58559d3390f9fe4425acc432311499c9475ebc2da81924 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/45d6a6bb7c9eb3867c58559d3390f9fe4425acc432311499c9475ebc2da81924 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/46cfef6c632a29067c20a10e21dd6be180f137acc6a2696b27ffa3e4b346891a b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/46cfef6c632a29067c20a10e21dd6be180f137acc6a2696b27ffa3e4b346891a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/46cfef6c632a29067c20a10e21dd6be180f137acc6a2696b27ffa3e4b346891a rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/46cfef6c632a29067c20a10e21dd6be180f137acc6a2696b27ffa3e4b346891a diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/4a2c8fa1506c4f5c06dd29ef7c47f5104f5e9f9933429470489d25e3e6746301 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/4a2c8fa1506c4f5c06dd29ef7c47f5104f5e9f9933429470489d25e3e6746301 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/4a2c8fa1506c4f5c06dd29ef7c47f5104f5e9f9933429470489d25e3e6746301 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/4a2c8fa1506c4f5c06dd29ef7c47f5104f5e9f9933429470489d25e3e6746301 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/4abda79b79ecdc224b1a205fb6d9c7f9d5bcbdfdd6ab61b2eb2d9aff006f2861 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/4abda79b79ecdc224b1a205fb6d9c7f9d5bcbdfdd6ab61b2eb2d9aff006f2861 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/4abda79b79ecdc224b1a205fb6d9c7f9d5bcbdfdd6ab61b2eb2d9aff006f2861 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/4abda79b79ecdc224b1a205fb6d9c7f9d5bcbdfdd6ab61b2eb2d9aff006f2861 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/4b2495adba26551aba1e3ff9e749c4b826f03835bf7c8f53e0aeebb20e659af1 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/4b2495adba26551aba1e3ff9e749c4b826f03835bf7c8f53e0aeebb20e659af1 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/4b2495adba26551aba1e3ff9e749c4b826f03835bf7c8f53e0aeebb20e659af1 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/4b2495adba26551aba1e3ff9e749c4b826f03835bf7c8f53e0aeebb20e659af1 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/4d28598882e962c787f5b8222d5058476e7f9dee98ed0ff73b63f1d680b99f9f b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/4d28598882e962c787f5b8222d5058476e7f9dee98ed0ff73b63f1d680b99f9f similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/4d28598882e962c787f5b8222d5058476e7f9dee98ed0ff73b63f1d680b99f9f rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/4d28598882e962c787f5b8222d5058476e7f9dee98ed0ff73b63f1d680b99f9f diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/50262c6b6ff61917d5322130f3a1e2cb4825d4bb787a9e8c22e842a9d2a100f2 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/50262c6b6ff61917d5322130f3a1e2cb4825d4bb787a9e8c22e842a9d2a100f2 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/50262c6b6ff61917d5322130f3a1e2cb4825d4bb787a9e8c22e842a9d2a100f2 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/50262c6b6ff61917d5322130f3a1e2cb4825d4bb787a9e8c22e842a9d2a100f2 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/552348558a9980c8ab2f8f6f22aa04784ab4833385a4dbe74dbe54d06c731eb4 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/552348558a9980c8ab2f8f6f22aa04784ab4833385a4dbe74dbe54d06c731eb4 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/552348558a9980c8ab2f8f6f22aa04784ab4833385a4dbe74dbe54d06c731eb4 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/552348558a9980c8ab2f8f6f22aa04784ab4833385a4dbe74dbe54d06c731eb4 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/5726c47aa61e569915995910dba598abe883864e764493e14ac21617696f965a b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/5726c47aa61e569915995910dba598abe883864e764493e14ac21617696f965a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/5726c47aa61e569915995910dba598abe883864e764493e14ac21617696f965a rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/5726c47aa61e569915995910dba598abe883864e764493e14ac21617696f965a diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/588d3573a8eb099c357698299c9148c0fafd33881d0bbc934efe61ec6fd3a560 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/588d3573a8eb099c357698299c9148c0fafd33881d0bbc934efe61ec6fd3a560 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/588d3573a8eb099c357698299c9148c0fafd33881d0bbc934efe61ec6fd3a560 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/588d3573a8eb099c357698299c9148c0fafd33881d0bbc934efe61ec6fd3a560 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/59d08548ef77b559ba8cb48facfb9fec324399c54b70344eb8cc0197bbe87174 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/59d08548ef77b559ba8cb48facfb9fec324399c54b70344eb8cc0197bbe87174 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/59d08548ef77b559ba8cb48facfb9fec324399c54b70344eb8cc0197bbe87174 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/59d08548ef77b559ba8cb48facfb9fec324399c54b70344eb8cc0197bbe87174 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/5abdd611a52f03f01554e8d3bbc2f41d9ca5a7f242b8c91955a3f9c4177fa877 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/5abdd611a52f03f01554e8d3bbc2f41d9ca5a7f242b8c91955a3f9c4177fa877 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/5abdd611a52f03f01554e8d3bbc2f41d9ca5a7f242b8c91955a3f9c4177fa877 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/5abdd611a52f03f01554e8d3bbc2f41d9ca5a7f242b8c91955a3f9c4177fa877 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/5b53624fc1ce7b6f94a8a3fd9a3967ffa5e6f0e1ac45ddbaeab960f9395816f7 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/5b53624fc1ce7b6f94a8a3fd9a3967ffa5e6f0e1ac45ddbaeab960f9395816f7 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/5b53624fc1ce7b6f94a8a3fd9a3967ffa5e6f0e1ac45ddbaeab960f9395816f7 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/5b53624fc1ce7b6f94a8a3fd9a3967ffa5e6f0e1ac45ddbaeab960f9395816f7 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/5b7d1e3268ba9afa76a092487d69984dc5f75246abed7fd5bc02ab3487ffd0a8 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/5b7d1e3268ba9afa76a092487d69984dc5f75246abed7fd5bc02ab3487ffd0a8 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/5b7d1e3268ba9afa76a092487d69984dc5f75246abed7fd5bc02ab3487ffd0a8 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/5b7d1e3268ba9afa76a092487d69984dc5f75246abed7fd5bc02ab3487ffd0a8 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/6173801150b4ee6765e32c100a583d54cfef3be365cf42b28ddb28fddff2eb51 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/6173801150b4ee6765e32c100a583d54cfef3be365cf42b28ddb28fddff2eb51 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/6173801150b4ee6765e32c100a583d54cfef3be365cf42b28ddb28fddff2eb51 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/6173801150b4ee6765e32c100a583d54cfef3be365cf42b28ddb28fddff2eb51 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/619d398c492ea1367d6abc748256a8ec2a085c81e9e75c633385b8ff6dd9a4b2 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/619d398c492ea1367d6abc748256a8ec2a085c81e9e75c633385b8ff6dd9a4b2 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/619d398c492ea1367d6abc748256a8ec2a085c81e9e75c633385b8ff6dd9a4b2 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/619d398c492ea1367d6abc748256a8ec2a085c81e9e75c633385b8ff6dd9a4b2 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/66bbaa2e2742850822d4e156df0ab380c14f76788ec704b9ddc23fdb9265cb36 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/66bbaa2e2742850822d4e156df0ab380c14f76788ec704b9ddc23fdb9265cb36 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/66bbaa2e2742850822d4e156df0ab380c14f76788ec704b9ddc23fdb9265cb36 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/66bbaa2e2742850822d4e156df0ab380c14f76788ec704b9ddc23fdb9265cb36 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/6817f8fbff539f95557037a76e989454bbd53d255166bd81fb9d5c3283d5768d b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/6817f8fbff539f95557037a76e989454bbd53d255166bd81fb9d5c3283d5768d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/6817f8fbff539f95557037a76e989454bbd53d255166bd81fb9d5c3283d5768d rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/6817f8fbff539f95557037a76e989454bbd53d255166bd81fb9d5c3283d5768d diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/68c11116330af8eda646c8173e9f78a6008aa39f321b347e59a763759ac469dc b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/68c11116330af8eda646c8173e9f78a6008aa39f321b347e59a763759ac469dc similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/68c11116330af8eda646c8173e9f78a6008aa39f321b347e59a763759ac469dc rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/68c11116330af8eda646c8173e9f78a6008aa39f321b347e59a763759ac469dc diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/6a5375ced24c43086ec194871b9a2a5ae7eb6b1c05ca97bf7b7208dca0f17e4e b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/6a5375ced24c43086ec194871b9a2a5ae7eb6b1c05ca97bf7b7208dca0f17e4e similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/6a5375ced24c43086ec194871b9a2a5ae7eb6b1c05ca97bf7b7208dca0f17e4e rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/6a5375ced24c43086ec194871b9a2a5ae7eb6b1c05ca97bf7b7208dca0f17e4e diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/6bfc5bf08835973695568d97d379c5d4897326982258ba6b014c0b97fefb22ed b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/6bfc5bf08835973695568d97d379c5d4897326982258ba6b014c0b97fefb22ed similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/6bfc5bf08835973695568d97d379c5d4897326982258ba6b014c0b97fefb22ed rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/6bfc5bf08835973695568d97d379c5d4897326982258ba6b014c0b97fefb22ed diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/6e568042093cd26c3507362f048cc7a84a0775e8b2582dba399d1cacb0810c0c b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/6e568042093cd26c3507362f048cc7a84a0775e8b2582dba399d1cacb0810c0c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/6e568042093cd26c3507362f048cc7a84a0775e8b2582dba399d1cacb0810c0c rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/6e568042093cd26c3507362f048cc7a84a0775e8b2582dba399d1cacb0810c0c diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/6f2f91da13a75048bbe610d59c990227ec5219fadad06b6254a41aa3375c342d b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/6f2f91da13a75048bbe610d59c990227ec5219fadad06b6254a41aa3375c342d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/6f2f91da13a75048bbe610d59c990227ec5219fadad06b6254a41aa3375c342d rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/6f2f91da13a75048bbe610d59c990227ec5219fadad06b6254a41aa3375c342d diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/6ff8f34df384a6c6cca00fed8c60fcdcc798db02442f5a508dc13293b91465ca b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/6ff8f34df384a6c6cca00fed8c60fcdcc798db02442f5a508dc13293b91465ca similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/6ff8f34df384a6c6cca00fed8c60fcdcc798db02442f5a508dc13293b91465ca rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/6ff8f34df384a6c6cca00fed8c60fcdcc798db02442f5a508dc13293b91465ca diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/7053d09810718e347329255b448dce53b71360fe3286e57e50b2e221f0586cf3 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/7053d09810718e347329255b448dce53b71360fe3286e57e50b2e221f0586cf3 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/7053d09810718e347329255b448dce53b71360fe3286e57e50b2e221f0586cf3 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/7053d09810718e347329255b448dce53b71360fe3286e57e50b2e221f0586cf3 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/71aca3cbba182d2c01fc4ace82c43e63f1afe1e8dd868ff98cabd1a6ce5c9881 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/71aca3cbba182d2c01fc4ace82c43e63f1afe1e8dd868ff98cabd1a6ce5c9881 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/71aca3cbba182d2c01fc4ace82c43e63f1afe1e8dd868ff98cabd1a6ce5c9881 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/71aca3cbba182d2c01fc4ace82c43e63f1afe1e8dd868ff98cabd1a6ce5c9881 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/7203f0eb4655fdecef714cdc0fd55b3c9bb03ef6062b2f335f6a43a062186ce0 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/7203f0eb4655fdecef714cdc0fd55b3c9bb03ef6062b2f335f6a43a062186ce0 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/7203f0eb4655fdecef714cdc0fd55b3c9bb03ef6062b2f335f6a43a062186ce0 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/7203f0eb4655fdecef714cdc0fd55b3c9bb03ef6062b2f335f6a43a062186ce0 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/7233e232aece1eb6247be69af53abbcc8fe2932462b5835e658475a6b6aef488 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/7233e232aece1eb6247be69af53abbcc8fe2932462b5835e658475a6b6aef488 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/7233e232aece1eb6247be69af53abbcc8fe2932462b5835e658475a6b6aef488 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/7233e232aece1eb6247be69af53abbcc8fe2932462b5835e658475a6b6aef488 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/726adb26d4218bf178b7b3bcbab6242232302aede2f36345b284c41e27d1cb67 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/726adb26d4218bf178b7b3bcbab6242232302aede2f36345b284c41e27d1cb67 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/726adb26d4218bf178b7b3bcbab6242232302aede2f36345b284c41e27d1cb67 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/726adb26d4218bf178b7b3bcbab6242232302aede2f36345b284c41e27d1cb67 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/746e6efe7e9105dd956fbba769922cd2af92aa3e83ea2ce78c601d5dca39b14c b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/746e6efe7e9105dd956fbba769922cd2af92aa3e83ea2ce78c601d5dca39b14c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/746e6efe7e9105dd956fbba769922cd2af92aa3e83ea2ce78c601d5dca39b14c rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/746e6efe7e9105dd956fbba769922cd2af92aa3e83ea2ce78c601d5dca39b14c diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/753a972ea289844a53fbbf72046e85588d2d750b9028f74b96e88badb91a4e20 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/753a972ea289844a53fbbf72046e85588d2d750b9028f74b96e88badb91a4e20 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/753a972ea289844a53fbbf72046e85588d2d750b9028f74b96e88badb91a4e20 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/753a972ea289844a53fbbf72046e85588d2d750b9028f74b96e88badb91a4e20 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/75dd6c5fe9f60d82b565e3373882b357025b2de27d3b5b6f9ff9cff45a6e503f b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/75dd6c5fe9f60d82b565e3373882b357025b2de27d3b5b6f9ff9cff45a6e503f similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/75dd6c5fe9f60d82b565e3373882b357025b2de27d3b5b6f9ff9cff45a6e503f rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/75dd6c5fe9f60d82b565e3373882b357025b2de27d3b5b6f9ff9cff45a6e503f diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/77001eb66e99204baa49fc9212b592a771ae3beab3ea6d99d80179f03d658215 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/77001eb66e99204baa49fc9212b592a771ae3beab3ea6d99d80179f03d658215 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/77001eb66e99204baa49fc9212b592a771ae3beab3ea6d99d80179f03d658215 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/77001eb66e99204baa49fc9212b592a771ae3beab3ea6d99d80179f03d658215 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/7712cbb2f40d4ea95316d096ffb9d40441aa21d19a2adef06d1487a1492be0f5 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/7712cbb2f40d4ea95316d096ffb9d40441aa21d19a2adef06d1487a1492be0f5 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/7712cbb2f40d4ea95316d096ffb9d40441aa21d19a2adef06d1487a1492be0f5 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/7712cbb2f40d4ea95316d096ffb9d40441aa21d19a2adef06d1487a1492be0f5 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/7e957a57e4ccd4e966962bf155f574a50860740bfdf74a85e29c01a66d02f643 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/7e957a57e4ccd4e966962bf155f574a50860740bfdf74a85e29c01a66d02f643 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/7e957a57e4ccd4e966962bf155f574a50860740bfdf74a85e29c01a66d02f643 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/7e957a57e4ccd4e966962bf155f574a50860740bfdf74a85e29c01a66d02f643 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/7faba699cde0c72153462060b6649a8723591a3845c4b2f8a10acb69790af6dc b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/7faba699cde0c72153462060b6649a8723591a3845c4b2f8a10acb69790af6dc similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/7faba699cde0c72153462060b6649a8723591a3845c4b2f8a10acb69790af6dc rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/7faba699cde0c72153462060b6649a8723591a3845c4b2f8a10acb69790af6dc diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/7fe48ffe81c6e2a4df0c0cf927a8df493d310d4771b67c9c039b87f67f06c9a9 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/7fe48ffe81c6e2a4df0c0cf927a8df493d310d4771b67c9c039b87f67f06c9a9 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/7fe48ffe81c6e2a4df0c0cf927a8df493d310d4771b67c9c039b87f67f06c9a9 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/7fe48ffe81c6e2a4df0c0cf927a8df493d310d4771b67c9c039b87f67f06c9a9 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/861805c1fd68ad68f6e669f0a9296a86c5dd607d3702e578e00666ba945c8402 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/861805c1fd68ad68f6e669f0a9296a86c5dd607d3702e578e00666ba945c8402 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/861805c1fd68ad68f6e669f0a9296a86c5dd607d3702e578e00666ba945c8402 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/861805c1fd68ad68f6e669f0a9296a86c5dd607d3702e578e00666ba945c8402 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/86e4930b506464670bbb3144503435ea326187182c69fd436f1607b52e6d95b5 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/86e4930b506464670bbb3144503435ea326187182c69fd436f1607b52e6d95b5 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/86e4930b506464670bbb3144503435ea326187182c69fd436f1607b52e6d95b5 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/86e4930b506464670bbb3144503435ea326187182c69fd436f1607b52e6d95b5 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/88d26f033f93e586b283fb187d9163fcd4eeaa9b17dc3646fa52921e9b05c1c5 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/88d26f033f93e586b283fb187d9163fcd4eeaa9b17dc3646fa52921e9b05c1c5 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/88d26f033f93e586b283fb187d9163fcd4eeaa9b17dc3646fa52921e9b05c1c5 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/88d26f033f93e586b283fb187d9163fcd4eeaa9b17dc3646fa52921e9b05c1c5 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/8df4aee73d574091d2504215dda66ef39b0af987cb460c8bc39c4ddea7af283b b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/8df4aee73d574091d2504215dda66ef39b0af987cb460c8bc39c4ddea7af283b similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/8df4aee73d574091d2504215dda66ef39b0af987cb460c8bc39c4ddea7af283b rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/8df4aee73d574091d2504215dda66ef39b0af987cb460c8bc39c4ddea7af283b diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/8e0457a8f9ec9f006406cb7b33c07b5e53b03ebad8dcb2040cb0a137acae8f12 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/8e0457a8f9ec9f006406cb7b33c07b5e53b03ebad8dcb2040cb0a137acae8f12 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/8e0457a8f9ec9f006406cb7b33c07b5e53b03ebad8dcb2040cb0a137acae8f12 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/8e0457a8f9ec9f006406cb7b33c07b5e53b03ebad8dcb2040cb0a137acae8f12 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/91b52b4d7f1a24a41ab475f9993a7163c9a156d6f56b57cc23a2c09dabd7096c b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/91b52b4d7f1a24a41ab475f9993a7163c9a156d6f56b57cc23a2c09dabd7096c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/91b52b4d7f1a24a41ab475f9993a7163c9a156d6f56b57cc23a2c09dabd7096c rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/91b52b4d7f1a24a41ab475f9993a7163c9a156d6f56b57cc23a2c09dabd7096c diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/92ac60b28444ed58cc9d9e71de44db6f6c503744a87a30c2f2ddecb4fd980ac5 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/92ac60b28444ed58cc9d9e71de44db6f6c503744a87a30c2f2ddecb4fd980ac5 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/92ac60b28444ed58cc9d9e71de44db6f6c503744a87a30c2f2ddecb4fd980ac5 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/92ac60b28444ed58cc9d9e71de44db6f6c503744a87a30c2f2ddecb4fd980ac5 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/93956c538f69de52006876d1cd82894a341fe3b4e54a12df68afbaf0a80a5237 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/93956c538f69de52006876d1cd82894a341fe3b4e54a12df68afbaf0a80a5237 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/93956c538f69de52006876d1cd82894a341fe3b4e54a12df68afbaf0a80a5237 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/93956c538f69de52006876d1cd82894a341fe3b4e54a12df68afbaf0a80a5237 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/958c9d736e9e7b0a2c8f3b0b4ecd54ecb29cd2e92a987e92da3ec5ac1f6ba1f6 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/958c9d736e9e7b0a2c8f3b0b4ecd54ecb29cd2e92a987e92da3ec5ac1f6ba1f6 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/958c9d736e9e7b0a2c8f3b0b4ecd54ecb29cd2e92a987e92da3ec5ac1f6ba1f6 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/958c9d736e9e7b0a2c8f3b0b4ecd54ecb29cd2e92a987e92da3ec5ac1f6ba1f6 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/97753cd0be1d2f0c6baf966b63a0bb50fd0b296cae8758b0eae21e5f08455e12 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/97753cd0be1d2f0c6baf966b63a0bb50fd0b296cae8758b0eae21e5f08455e12 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/97753cd0be1d2f0c6baf966b63a0bb50fd0b296cae8758b0eae21e5f08455e12 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/97753cd0be1d2f0c6baf966b63a0bb50fd0b296cae8758b0eae21e5f08455e12 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/9f1eaa8920993fec8b29355e3088d4ae4f7b5c4008076d81f28cdeaae42d54c5 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/9f1eaa8920993fec8b29355e3088d4ae4f7b5c4008076d81f28cdeaae42d54c5 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/9f1eaa8920993fec8b29355e3088d4ae4f7b5c4008076d81f28cdeaae42d54c5 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/9f1eaa8920993fec8b29355e3088d4ae4f7b5c4008076d81f28cdeaae42d54c5 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/a14699cf8be5d08ef3072956b43b8ff0c2092237f4551a06a7a4ffa911cc6860 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/a14699cf8be5d08ef3072956b43b8ff0c2092237f4551a06a7a4ffa911cc6860 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/a14699cf8be5d08ef3072956b43b8ff0c2092237f4551a06a7a4ffa911cc6860 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/a14699cf8be5d08ef3072956b43b8ff0c2092237f4551a06a7a4ffa911cc6860 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/a1550fb6ab294f772801aeb628863bf5ff4ae10d85c8a611d41ad0391eb94fa5 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/a1550fb6ab294f772801aeb628863bf5ff4ae10d85c8a611d41ad0391eb94fa5 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/a1550fb6ab294f772801aeb628863bf5ff4ae10d85c8a611d41ad0391eb94fa5 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/a1550fb6ab294f772801aeb628863bf5ff4ae10d85c8a611d41ad0391eb94fa5 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/a2d46d15252876ab7bcddb649fc062efcdf6531929885b8c5d48f90976c36863 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/a2d46d15252876ab7bcddb649fc062efcdf6531929885b8c5d48f90976c36863 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/a2d46d15252876ab7bcddb649fc062efcdf6531929885b8c5d48f90976c36863 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/a2d46d15252876ab7bcddb649fc062efcdf6531929885b8c5d48f90976c36863 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/a49dabc56b2dbb4c087a3be3b948f98c2373789e6b68c8181f79bf1558b5f371 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/a49dabc56b2dbb4c087a3be3b948f98c2373789e6b68c8181f79bf1558b5f371 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/a49dabc56b2dbb4c087a3be3b948f98c2373789e6b68c8181f79bf1558b5f371 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/a49dabc56b2dbb4c087a3be3b948f98c2373789e6b68c8181f79bf1558b5f371 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/aa5b8192bf5dafc16e0852fc952332d78cc8b30fc6222ed3c148dcd9b95ee6b9 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/aa5b8192bf5dafc16e0852fc952332d78cc8b30fc6222ed3c148dcd9b95ee6b9 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/aa5b8192bf5dafc16e0852fc952332d78cc8b30fc6222ed3c148dcd9b95ee6b9 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/aa5b8192bf5dafc16e0852fc952332d78cc8b30fc6222ed3c148dcd9b95ee6b9 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/afd1966f04a6ce888dbf2838852b6f27ed08fdbd431e5f1c0fb3cad9f971e08d b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/afd1966f04a6ce888dbf2838852b6f27ed08fdbd431e5f1c0fb3cad9f971e08d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/afd1966f04a6ce888dbf2838852b6f27ed08fdbd431e5f1c0fb3cad9f971e08d rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/afd1966f04a6ce888dbf2838852b6f27ed08fdbd431e5f1c0fb3cad9f971e08d diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/b3003637e76098394a23fda39dacef84e7bc7477077843cfaf15984c91df2998 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/b3003637e76098394a23fda39dacef84e7bc7477077843cfaf15984c91df2998 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/b3003637e76098394a23fda39dacef84e7bc7477077843cfaf15984c91df2998 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/b3003637e76098394a23fda39dacef84e7bc7477077843cfaf15984c91df2998 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/b488a8ace3816465a2dde786e3e3223d099d7e5ddf437f294a0383ec761a0d0e b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/b488a8ace3816465a2dde786e3e3223d099d7e5ddf437f294a0383ec761a0d0e similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/b488a8ace3816465a2dde786e3e3223d099d7e5ddf437f294a0383ec761a0d0e rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/b488a8ace3816465a2dde786e3e3223d099d7e5ddf437f294a0383ec761a0d0e diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/b5280cfcc70e218298fa71dd60f119c2c8d2881021ac9681e60d5c38ffd73589 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/b5280cfcc70e218298fa71dd60f119c2c8d2881021ac9681e60d5c38ffd73589 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/b5280cfcc70e218298fa71dd60f119c2c8d2881021ac9681e60d5c38ffd73589 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/b5280cfcc70e218298fa71dd60f119c2c8d2881021ac9681e60d5c38ffd73589 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/b6908f3d7cbbf70079d57d02777fc249c818c398c436ef7aa37086ecf8f71dc2 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/b6908f3d7cbbf70079d57d02777fc249c818c398c436ef7aa37086ecf8f71dc2 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/b6908f3d7cbbf70079d57d02777fc249c818c398c436ef7aa37086ecf8f71dc2 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/b6908f3d7cbbf70079d57d02777fc249c818c398c436ef7aa37086ecf8f71dc2 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/b6bdbc415fcca2621a0aa125e22d0f607c86e562b67587f7b04bdfdfed130827 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/b6bdbc415fcca2621a0aa125e22d0f607c86e562b67587f7b04bdfdfed130827 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/b6bdbc415fcca2621a0aa125e22d0f607c86e562b67587f7b04bdfdfed130827 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/b6bdbc415fcca2621a0aa125e22d0f607c86e562b67587f7b04bdfdfed130827 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/bf06e4d147578b592b3a88a26e01f1c1a92971ba889b542d493c76fed0b610b0 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/bf06e4d147578b592b3a88a26e01f1c1a92971ba889b542d493c76fed0b610b0 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/bf06e4d147578b592b3a88a26e01f1c1a92971ba889b542d493c76fed0b610b0 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/bf06e4d147578b592b3a88a26e01f1c1a92971ba889b542d493c76fed0b610b0 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/c1a7fd2e2d1724db1cfcd983724566e9a463466e4015a39fd24689d933c4b52d b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/c1a7fd2e2d1724db1cfcd983724566e9a463466e4015a39fd24689d933c4b52d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/c1a7fd2e2d1724db1cfcd983724566e9a463466e4015a39fd24689d933c4b52d rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/c1a7fd2e2d1724db1cfcd983724566e9a463466e4015a39fd24689d933c4b52d diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/c5d51562cd7994c30651e98dec7c7cbfbc265fb201560d8cca4f4f53abbecfa7 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/c5d51562cd7994c30651e98dec7c7cbfbc265fb201560d8cca4f4f53abbecfa7 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/c5d51562cd7994c30651e98dec7c7cbfbc265fb201560d8cca4f4f53abbecfa7 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/c5d51562cd7994c30651e98dec7c7cbfbc265fb201560d8cca4f4f53abbecfa7 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/cccb4ab60c9da0b65ca6bda5d0f305bbbb904115e56e6c3cdbf02de612b9c84c b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/cccb4ab60c9da0b65ca6bda5d0f305bbbb904115e56e6c3cdbf02de612b9c84c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/cccb4ab60c9da0b65ca6bda5d0f305bbbb904115e56e6c3cdbf02de612b9c84c rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/cccb4ab60c9da0b65ca6bda5d0f305bbbb904115e56e6c3cdbf02de612b9c84c diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/ce60953cb15935ce555f0bb770585befc2cc233951654a21e34f5131af3be67a b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/ce60953cb15935ce555f0bb770585befc2cc233951654a21e34f5131af3be67a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/ce60953cb15935ce555f0bb770585befc2cc233951654a21e34f5131af3be67a rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/ce60953cb15935ce555f0bb770585befc2cc233951654a21e34f5131af3be67a diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/d25ec5ac6d2fbdd698b8593aef7d835b3a3c2d1fb9ddec1760179bbd96ec109a b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/d25ec5ac6d2fbdd698b8593aef7d835b3a3c2d1fb9ddec1760179bbd96ec109a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/d25ec5ac6d2fbdd698b8593aef7d835b3a3c2d1fb9ddec1760179bbd96ec109a rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/d25ec5ac6d2fbdd698b8593aef7d835b3a3c2d1fb9ddec1760179bbd96ec109a diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/d296fb46bd14acc6f08527bee19d58007a95efdd098adc625e9d6a973c4176e9 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/d296fb46bd14acc6f08527bee19d58007a95efdd098adc625e9d6a973c4176e9 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/d296fb46bd14acc6f08527bee19d58007a95efdd098adc625e9d6a973c4176e9 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/d296fb46bd14acc6f08527bee19d58007a95efdd098adc625e9d6a973c4176e9 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/d2c382a1b36ce1d108686c77a6f87e382ff511f1e0ce8c982554e924c4ffce5d b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/d2c382a1b36ce1d108686c77a6f87e382ff511f1e0ce8c982554e924c4ffce5d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/d2c382a1b36ce1d108686c77a6f87e382ff511f1e0ce8c982554e924c4ffce5d rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/d2c382a1b36ce1d108686c77a6f87e382ff511f1e0ce8c982554e924c4ffce5d diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/d3fc5e23e9891eea1b774dbef3ffe64f272a42fd6c160e47b0a8e30d77dd58f8 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/d3fc5e23e9891eea1b774dbef3ffe64f272a42fd6c160e47b0a8e30d77dd58f8 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/d3fc5e23e9891eea1b774dbef3ffe64f272a42fd6c160e47b0a8e30d77dd58f8 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/d3fc5e23e9891eea1b774dbef3ffe64f272a42fd6c160e47b0a8e30d77dd58f8 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/d95a0f1a4c38aee8028ff54ea139366b8e2fb1a872234d68dfec6a04c19b6703 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/d95a0f1a4c38aee8028ff54ea139366b8e2fb1a872234d68dfec6a04c19b6703 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/d95a0f1a4c38aee8028ff54ea139366b8e2fb1a872234d68dfec6a04c19b6703 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/d95a0f1a4c38aee8028ff54ea139366b8e2fb1a872234d68dfec6a04c19b6703 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/df23694b87a2dd4e8ec3ee3de3637d6493b8a7e2b183b965e1522600daa9f7f9 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/df23694b87a2dd4e8ec3ee3de3637d6493b8a7e2b183b965e1522600daa9f7f9 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/df23694b87a2dd4e8ec3ee3de3637d6493b8a7e2b183b965e1522600daa9f7f9 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/df23694b87a2dd4e8ec3ee3de3637d6493b8a7e2b183b965e1522600daa9f7f9 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/e518b4cf7d0691dd09e7a1a97146c58a315864697d1fa0e1c505b5e7880195e0 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/e518b4cf7d0691dd09e7a1a97146c58a315864697d1fa0e1c505b5e7880195e0 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/e518b4cf7d0691dd09e7a1a97146c58a315864697d1fa0e1c505b5e7880195e0 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/e518b4cf7d0691dd09e7a1a97146c58a315864697d1fa0e1c505b5e7880195e0 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/e8e214ad308b2611a6dcf8f5d338298b425ad74ae50131f357a697f8d8e030f4 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/e8e214ad308b2611a6dcf8f5d338298b425ad74ae50131f357a697f8d8e030f4 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/e8e214ad308b2611a6dcf8f5d338298b425ad74ae50131f357a697f8d8e030f4 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/e8e214ad308b2611a6dcf8f5d338298b425ad74ae50131f357a697f8d8e030f4 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/e93b946220bcd219ceb554621fa6ff82439053e60ac7a4d9a664b6f98330baac b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/e93b946220bcd219ceb554621fa6ff82439053e60ac7a4d9a664b6f98330baac similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/e93b946220bcd219ceb554621fa6ff82439053e60ac7a4d9a664b6f98330baac rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/e93b946220bcd219ceb554621fa6ff82439053e60ac7a4d9a664b6f98330baac diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/e9dc97bbc6fb1946b563ac1eedbeaf3ee38b94f98c655db3f3dddeda76b58186 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/e9dc97bbc6fb1946b563ac1eedbeaf3ee38b94f98c655db3f3dddeda76b58186 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/e9dc97bbc6fb1946b563ac1eedbeaf3ee38b94f98c655db3f3dddeda76b58186 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/e9dc97bbc6fb1946b563ac1eedbeaf3ee38b94f98c655db3f3dddeda76b58186 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/f570571bd51aef39f508f73b772459fcbae6196c39f8a7f2c4636463682e5b58 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/f570571bd51aef39f508f73b772459fcbae6196c39f8a7f2c4636463682e5b58 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/f570571bd51aef39f508f73b772459fcbae6196c39f8a7f2c4636463682e5b58 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/f570571bd51aef39f508f73b772459fcbae6196c39f8a7f2c4636463682e5b58 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/f693d62642d076480f7227eb387579598af17820443dcdfc43436742678dd037 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/f693d62642d076480f7227eb387579598af17820443dcdfc43436742678dd037 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/f693d62642d076480f7227eb387579598af17820443dcdfc43436742678dd037 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/f693d62642d076480f7227eb387579598af17820443dcdfc43436742678dd037 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/f8279a08078b41aceab7ab9bf09464d90a2b4cb1ffdcdc68f521536215355701 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/f8279a08078b41aceab7ab9bf09464d90a2b4cb1ffdcdc68f521536215355701 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/f8279a08078b41aceab7ab9bf09464d90a2b4cb1ffdcdc68f521536215355701 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/f8279a08078b41aceab7ab9bf09464d90a2b4cb1ffdcdc68f521536215355701 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/f8f57c09722a272a97ea6fd9f1e3e568f1214165bb3fffe8dbd391b5f4e42a4c b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/f8f57c09722a272a97ea6fd9f1e3e568f1214165bb3fffe8dbd391b5f4e42a4c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/f8f57c09722a272a97ea6fd9f1e3e568f1214165bb3fffe8dbd391b5f4e42a4c rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/f8f57c09722a272a97ea6fd9f1e3e568f1214165bb3fffe8dbd391b5f4e42a4c diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/f930c0f547575d82eed705ea0baa904d6a5fe8756570c368262f475e5d03a30e b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/f930c0f547575d82eed705ea0baa904d6a5fe8756570c368262f475e5d03a30e similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/f930c0f547575d82eed705ea0baa904d6a5fe8756570c368262f475e5d03a30e rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/f930c0f547575d82eed705ea0baa904d6a5fe8756570c368262f475e5d03a30e diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/fbc715ff6b44eb3b4183d610cf322276339af2eae9c0e9b684df416b999740d8 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/fbc715ff6b44eb3b4183d610cf322276339af2eae9c0e9b684df416b999740d8 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/fbc715ff6b44eb3b4183d610cf322276339af2eae9c0e9b684df416b999740d8 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/fbc715ff6b44eb3b4183d610cf322276339af2eae9c0e9b684df416b999740d8 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/ffe898cd5f560969c2d747f8c30396dbbf7a18d312176d41a4224ba2a54d7353 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/ffe898cd5f560969c2d747f8c30396dbbf7a18d312176d41a4224ba2a54d7353 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/ffe898cd5f560969c2d747f8c30396dbbf7a18d312176d41a4224ba2a54d7353 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDDerivePrivateKeyForPath/ffe898cd5f560969c2d747f8c30396dbbf7a18d312176d41a4224ba2a54d7353 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/0064615b0820b730093bf928b4b64d2168edb92278100802c8b66ef3e6c1fcd9 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/0064615b0820b730093bf928b4b64d2168edb92278100802c8b66ef3e6c1fcd9 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/0064615b0820b730093bf928b4b64d2168edb92278100802c8b66ef3e6c1fcd9 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/0064615b0820b730093bf928b4b64d2168edb92278100802c8b66ef3e6c1fcd9 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/01a6ddd2774f2be8973eda6a15cee2bda9c5a4bdc9c30b1e6fe809d32a99fb4d b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/01a6ddd2774f2be8973eda6a15cee2bda9c5a4bdc9c30b1e6fe809d32a99fb4d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/01a6ddd2774f2be8973eda6a15cee2bda9c5a4bdc9c30b1e6fe809d32a99fb4d rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/01a6ddd2774f2be8973eda6a15cee2bda9c5a4bdc9c30b1e6fe809d32a99fb4d diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/01f8a5dee921f32850cef2164f7bb04af98ed16e63660e7ddbac1f16ff70b009 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/01f8a5dee921f32850cef2164f7bb04af98ed16e63660e7ddbac1f16ff70b009 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/01f8a5dee921f32850cef2164f7bb04af98ed16e63660e7ddbac1f16ff70b009 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/01f8a5dee921f32850cef2164f7bb04af98ed16e63660e7ddbac1f16ff70b009 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/057bc411396241745baa78b344b5d7934fcef75e6a1987b3a868eea8c3b7f8c3 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/057bc411396241745baa78b344b5d7934fcef75e6a1987b3a868eea8c3b7f8c3 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/057bc411396241745baa78b344b5d7934fcef75e6a1987b3a868eea8c3b7f8c3 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/057bc411396241745baa78b344b5d7934fcef75e6a1987b3a868eea8c3b7f8c3 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/05e698548f112735735eb1a49257ed6e44efd09a014386b9f5b0a467e164a526 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/05e698548f112735735eb1a49257ed6e44efd09a014386b9f5b0a467e164a526 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/05e698548f112735735eb1a49257ed6e44efd09a014386b9f5b0a467e164a526 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/05e698548f112735735eb1a49257ed6e44efd09a014386b9f5b0a467e164a526 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/06429d163aa1061754a82ef83f210452f9ad2ff8f83236bfc18bbb9e1ce760c4 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/06429d163aa1061754a82ef83f210452f9ad2ff8f83236bfc18bbb9e1ce760c4 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/06429d163aa1061754a82ef83f210452f9ad2ff8f83236bfc18bbb9e1ce760c4 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/06429d163aa1061754a82ef83f210452f9ad2ff8f83236bfc18bbb9e1ce760c4 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/0704623a692dbf72c377c409e34cc76d04cf7ff3b64f8d64b1dc12ad495dddb7 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/0704623a692dbf72c377c409e34cc76d04cf7ff3b64f8d64b1dc12ad495dddb7 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/0704623a692dbf72c377c409e34cc76d04cf7ff3b64f8d64b1dc12ad495dddb7 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/0704623a692dbf72c377c409e34cc76d04cf7ff3b64f8d64b1dc12ad495dddb7 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/09c3bd98326e34dfc57027c7be5ab4f02b0afd9dc2cfe9bfca6399bd3f602b4c b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/09c3bd98326e34dfc57027c7be5ab4f02b0afd9dc2cfe9bfca6399bd3f602b4c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/09c3bd98326e34dfc57027c7be5ab4f02b0afd9dc2cfe9bfca6399bd3f602b4c rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/09c3bd98326e34dfc57027c7be5ab4f02b0afd9dc2cfe9bfca6399bd3f602b4c diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/09ca1234970b95b87224159194253689f5030b4d62564b61016f538c84ef8f04 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/09ca1234970b95b87224159194253689f5030b4d62564b61016f538c84ef8f04 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/09ca1234970b95b87224159194253689f5030b4d62564b61016f538c84ef8f04 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/09ca1234970b95b87224159194253689f5030b4d62564b61016f538c84ef8f04 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/0a29f58a3ea8dda0ce92fee85fe2bc4d7b453d07a18c79d704758eaec4d698ac b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/0a29f58a3ea8dda0ce92fee85fe2bc4d7b453d07a18c79d704758eaec4d698ac similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/0a29f58a3ea8dda0ce92fee85fe2bc4d7b453d07a18c79d704758eaec4d698ac rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/0a29f58a3ea8dda0ce92fee85fe2bc4d7b453d07a18c79d704758eaec4d698ac diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/0ae46129e6b7a5d4d99fb0e7869b91228427e2776cf15e5720c065857de74231 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/0ae46129e6b7a5d4d99fb0e7869b91228427e2776cf15e5720c065857de74231 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/0ae46129e6b7a5d4d99fb0e7869b91228427e2776cf15e5720c065857de74231 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/0ae46129e6b7a5d4d99fb0e7869b91228427e2776cf15e5720c065857de74231 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/0c7551d17ec82664166e98051296e94bf9a78789b9db9fa1c9f35dc99df05e65 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/0c7551d17ec82664166e98051296e94bf9a78789b9db9fa1c9f35dc99df05e65 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/0c7551d17ec82664166e98051296e94bf9a78789b9db9fa1c9f35dc99df05e65 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/0c7551d17ec82664166e98051296e94bf9a78789b9db9fa1c9f35dc99df05e65 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/0e1ac4f69177c95a4b9af984a0695d79e35710f66028373851efff49e4e50af8 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/0e1ac4f69177c95a4b9af984a0695d79e35710f66028373851efff49e4e50af8 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/0e1ac4f69177c95a4b9af984a0695d79e35710f66028373851efff49e4e50af8 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/0e1ac4f69177c95a4b9af984a0695d79e35710f66028373851efff49e4e50af8 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/0e8d07ad22337d06495ab38dcf49cbb40af80e3ad41cff64605e870d69bd0152 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/0e8d07ad22337d06495ab38dcf49cbb40af80e3ad41cff64605e870d69bd0152 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/0e8d07ad22337d06495ab38dcf49cbb40af80e3ad41cff64605e870d69bd0152 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/0e8d07ad22337d06495ab38dcf49cbb40af80e3ad41cff64605e870d69bd0152 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/1002bccd8bc99d5c32080690407a12a846fbbec8a5fbd382845c0b849a0c1196 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/1002bccd8bc99d5c32080690407a12a846fbbec8a5fbd382845c0b849a0c1196 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/1002bccd8bc99d5c32080690407a12a846fbbec8a5fbd382845c0b849a0c1196 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/1002bccd8bc99d5c32080690407a12a846fbbec8a5fbd382845c0b849a0c1196 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/10c43c64da9d18cd41e7edc10abca9a2b96aa0a01990c95a62cc7e44c3ba7765 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/10c43c64da9d18cd41e7edc10abca9a2b96aa0a01990c95a62cc7e44c3ba7765 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/10c43c64da9d18cd41e7edc10abca9a2b96aa0a01990c95a62cc7e44c3ba7765 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/10c43c64da9d18cd41e7edc10abca9a2b96aa0a01990c95a62cc7e44c3ba7765 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/11dc3f9298d7ae1aeb84ee14ba3125ae35de7fdb05b2f28d190cb1d9dd2a3358 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/11dc3f9298d7ae1aeb84ee14ba3125ae35de7fdb05b2f28d190cb1d9dd2a3358 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/11dc3f9298d7ae1aeb84ee14ba3125ae35de7fdb05b2f28d190cb1d9dd2a3358 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/11dc3f9298d7ae1aeb84ee14ba3125ae35de7fdb05b2f28d190cb1d9dd2a3358 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/145e3cb8f77942e8cec7f128719eb87bc2de11ddcf0c1e2e2cc1f28f7be79986 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/145e3cb8f77942e8cec7f128719eb87bc2de11ddcf0c1e2e2cc1f28f7be79986 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/145e3cb8f77942e8cec7f128719eb87bc2de11ddcf0c1e2e2cc1f28f7be79986 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/145e3cb8f77942e8cec7f128719eb87bc2de11ddcf0c1e2e2cc1f28f7be79986 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/146a3dfbfbfcb413758e02ab2a41b3a2b265a33a7bc90679d946267a215c9327 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/146a3dfbfbfcb413758e02ab2a41b3a2b265a33a7bc90679d946267a215c9327 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/146a3dfbfbfcb413758e02ab2a41b3a2b265a33a7bc90679d946267a215c9327 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/146a3dfbfbfcb413758e02ab2a41b3a2b265a33a7bc90679d946267a215c9327 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/16d14bdec571fe5169048d188a1d01b4562180cb07adc296de24ab45c9c44e7f b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/16d14bdec571fe5169048d188a1d01b4562180cb07adc296de24ab45c9c44e7f similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/16d14bdec571fe5169048d188a1d01b4562180cb07adc296de24ab45c9c44e7f rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/16d14bdec571fe5169048d188a1d01b4562180cb07adc296de24ab45c9c44e7f diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/18ecc0f3e38e99e89d74c4fb60634f674fd274aaf6a740d8fea0e0cd4397e361 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/18ecc0f3e38e99e89d74c4fb60634f674fd274aaf6a740d8fea0e0cd4397e361 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/18ecc0f3e38e99e89d74c4fb60634f674fd274aaf6a740d8fea0e0cd4397e361 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/18ecc0f3e38e99e89d74c4fb60634f674fd274aaf6a740d8fea0e0cd4397e361 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/1a4c99a1055afc41b3f1219ec3f9b7297bfa4d2aeeaeb3af2bf960a2e022dbe7 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/1a4c99a1055afc41b3f1219ec3f9b7297bfa4d2aeeaeb3af2bf960a2e022dbe7 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/1a4c99a1055afc41b3f1219ec3f9b7297bfa4d2aeeaeb3af2bf960a2e022dbe7 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/1a4c99a1055afc41b3f1219ec3f9b7297bfa4d2aeeaeb3af2bf960a2e022dbe7 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/1bf8b5c14fc23994847edcb474d83ca334ba2af971cc73a1c8a53785d979fc6b b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/1bf8b5c14fc23994847edcb474d83ca334ba2af971cc73a1c8a53785d979fc6b similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/1bf8b5c14fc23994847edcb474d83ca334ba2af971cc73a1c8a53785d979fc6b rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/1bf8b5c14fc23994847edcb474d83ca334ba2af971cc73a1c8a53785d979fc6b diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/1c4ab8ca9c619f9df205270769b9bee3c10791cc8bec1404eb8de1ce9ec8d845 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/1c4ab8ca9c619f9df205270769b9bee3c10791cc8bec1404eb8de1ce9ec8d845 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/1c4ab8ca9c619f9df205270769b9bee3c10791cc8bec1404eb8de1ce9ec8d845 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/1c4ab8ca9c619f9df205270769b9bee3c10791cc8bec1404eb8de1ce9ec8d845 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/1dfd52e02b3b0533e44eaa22d7b3198dbe232720585da3411ded9cf08b632282 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/1dfd52e02b3b0533e44eaa22d7b3198dbe232720585da3411ded9cf08b632282 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/1dfd52e02b3b0533e44eaa22d7b3198dbe232720585da3411ded9cf08b632282 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/1dfd52e02b3b0533e44eaa22d7b3198dbe232720585da3411ded9cf08b632282 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/210956595d920c2c76ef4c59b8f6e2e90f1d6b33fec709a7a42d4e6d54daa430 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/210956595d920c2c76ef4c59b8f6e2e90f1d6b33fec709a7a42d4e6d54daa430 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/210956595d920c2c76ef4c59b8f6e2e90f1d6b33fec709a7a42d4e6d54daa430 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/210956595d920c2c76ef4c59b8f6e2e90f1d6b33fec709a7a42d4e6d54daa430 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/2111de3d00f838271e95233bfd30b4ba8c49cc70253d3b91089b5cdeb52adb62 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/2111de3d00f838271e95233bfd30b4ba8c49cc70253d3b91089b5cdeb52adb62 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/2111de3d00f838271e95233bfd30b4ba8c49cc70253d3b91089b5cdeb52adb62 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/2111de3d00f838271e95233bfd30b4ba8c49cc70253d3b91089b5cdeb52adb62 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/23db36d2f6756228e09ce89cbaa17b2b58d0046ce5aaecd5742af495478b34d4 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/23db36d2f6756228e09ce89cbaa17b2b58d0046ce5aaecd5742af495478b34d4 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/23db36d2f6756228e09ce89cbaa17b2b58d0046ce5aaecd5742af495478b34d4 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/23db36d2f6756228e09ce89cbaa17b2b58d0046ce5aaecd5742af495478b34d4 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/2426c7d1ffac935e5ba79b3450771ae6faa3c3e2087ca53d6db05522644e4d35 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/2426c7d1ffac935e5ba79b3450771ae6faa3c3e2087ca53d6db05522644e4d35 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/2426c7d1ffac935e5ba79b3450771ae6faa3c3e2087ca53d6db05522644e4d35 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/2426c7d1ffac935e5ba79b3450771ae6faa3c3e2087ca53d6db05522644e4d35 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/243c44aa63a444a077c6ac42da6fe2403006be414854ebed67b59d4cfd3669b6 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/243c44aa63a444a077c6ac42da6fe2403006be414854ebed67b59d4cfd3669b6 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/243c44aa63a444a077c6ac42da6fe2403006be414854ebed67b59d4cfd3669b6 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/243c44aa63a444a077c6ac42da6fe2403006be414854ebed67b59d4cfd3669b6 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/254ecfb766901da907b8a8a7efd6a6ca69540aff4cf0512e3c7bab0ffdf36f7b b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/254ecfb766901da907b8a8a7efd6a6ca69540aff4cf0512e3c7bab0ffdf36f7b similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/254ecfb766901da907b8a8a7efd6a6ca69540aff4cf0512e3c7bab0ffdf36f7b rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/254ecfb766901da907b8a8a7efd6a6ca69540aff4cf0512e3c7bab0ffdf36f7b diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/2581f8fef06bdbd005af045f8ea2e5486487b2dfa86550f62ecc27b208234b6d b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/2581f8fef06bdbd005af045f8ea2e5486487b2dfa86550f62ecc27b208234b6d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/2581f8fef06bdbd005af045f8ea2e5486487b2dfa86550f62ecc27b208234b6d rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/2581f8fef06bdbd005af045f8ea2e5486487b2dfa86550f62ecc27b208234b6d diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/27669f05292066eb5b62dd8b0a7f30c6ebaa0364f2819a4bade14b6a0eb4355b b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/27669f05292066eb5b62dd8b0a7f30c6ebaa0364f2819a4bade14b6a0eb4355b similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/27669f05292066eb5b62dd8b0a7f30c6ebaa0364f2819a4bade14b6a0eb4355b rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/27669f05292066eb5b62dd8b0a7f30c6ebaa0364f2819a4bade14b6a0eb4355b diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/2800ae49ae94b6ba6a5d0af8807d7d39e7661fa0ae9833e997ab003d5328ae7e b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/2800ae49ae94b6ba6a5d0af8807d7d39e7661fa0ae9833e997ab003d5328ae7e similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/2800ae49ae94b6ba6a5d0af8807d7d39e7661fa0ae9833e997ab003d5328ae7e rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/2800ae49ae94b6ba6a5d0af8807d7d39e7661fa0ae9833e997ab003d5328ae7e diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/29a08579f371bb285c629045f5a7d7aeb68dee8ae38314ce622dfb975d54c647 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/29a08579f371bb285c629045f5a7d7aeb68dee8ae38314ce622dfb975d54c647 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/29a08579f371bb285c629045f5a7d7aeb68dee8ae38314ce622dfb975d54c647 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/29a08579f371bb285c629045f5a7d7aeb68dee8ae38314ce622dfb975d54c647 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/29e61e4e7ec2ecf05066550c007206d75dd2676baf29444a9c4dc7c6860251a0 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/29e61e4e7ec2ecf05066550c007206d75dd2676baf29444a9c4dc7c6860251a0 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/29e61e4e7ec2ecf05066550c007206d75dd2676baf29444a9c4dc7c6860251a0 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/29e61e4e7ec2ecf05066550c007206d75dd2676baf29444a9c4dc7c6860251a0 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/29eb4131f9dab41dbb28579cf58f72bc9e4f50f9b39b07ed1279eaab531c25b3 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/29eb4131f9dab41dbb28579cf58f72bc9e4f50f9b39b07ed1279eaab531c25b3 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/29eb4131f9dab41dbb28579cf58f72bc9e4f50f9b39b07ed1279eaab531c25b3 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/29eb4131f9dab41dbb28579cf58f72bc9e4f50f9b39b07ed1279eaab531c25b3 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/2a704245b556395158c04c73ef2d318d378f4941a3eccd7bcbe1538f23136dda b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/2a704245b556395158c04c73ef2d318d378f4941a3eccd7bcbe1538f23136dda similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/2a704245b556395158c04c73ef2d318d378f4941a3eccd7bcbe1538f23136dda rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/2a704245b556395158c04c73ef2d318d378f4941a3eccd7bcbe1538f23136dda diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/2c499b89e5631bb319ca7ebd4fc0ba4b65bb9b13e64a8966b875686a2d19a4be b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/2c499b89e5631bb319ca7ebd4fc0ba4b65bb9b13e64a8966b875686a2d19a4be similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/2c499b89e5631bb319ca7ebd4fc0ba4b65bb9b13e64a8966b875686a2d19a4be rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/2c499b89e5631bb319ca7ebd4fc0ba4b65bb9b13e64a8966b875686a2d19a4be diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/2cc4490f0b6cbf431857fa36d4a268dc55e17519b5a8937958c5035a0128b0c7 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/2cc4490f0b6cbf431857fa36d4a268dc55e17519b5a8937958c5035a0128b0c7 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/2cc4490f0b6cbf431857fa36d4a268dc55e17519b5a8937958c5035a0128b0c7 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/2cc4490f0b6cbf431857fa36d4a268dc55e17519b5a8937958c5035a0128b0c7 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/2d2f3c95ecdd129522abc5192bb79cabb49846350bbfc4f7fd1690999424518a b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/2d2f3c95ecdd129522abc5192bb79cabb49846350bbfc4f7fd1690999424518a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/2d2f3c95ecdd129522abc5192bb79cabb49846350bbfc4f7fd1690999424518a rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/2d2f3c95ecdd129522abc5192bb79cabb49846350bbfc4f7fd1690999424518a diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/2d5c45117b0ef8d6df3ffced04a23d98728d71ca179356e56f58a8d18df194e5 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/2d5c45117b0ef8d6df3ffced04a23d98728d71ca179356e56f58a8d18df194e5 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/2d5c45117b0ef8d6df3ffced04a23d98728d71ca179356e56f58a8d18df194e5 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/2d5c45117b0ef8d6df3ffced04a23d98728d71ca179356e56f58a8d18df194e5 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/303d5d16e49b041537e53ebfb4cd7949f242baacbc0833e82046a1aadd0e4f8e b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/303d5d16e49b041537e53ebfb4cd7949f242baacbc0833e82046a1aadd0e4f8e similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/303d5d16e49b041537e53ebfb4cd7949f242baacbc0833e82046a1aadd0e4f8e rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/303d5d16e49b041537e53ebfb4cd7949f242baacbc0833e82046a1aadd0e4f8e diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/32ddab95afab116c1387bc292e9b292b955be28b70a06ad1f52bb89ec540cfcc b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/32ddab95afab116c1387bc292e9b292b955be28b70a06ad1f52bb89ec540cfcc similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/32ddab95afab116c1387bc292e9b292b955be28b70a06ad1f52bb89ec540cfcc rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/32ddab95afab116c1387bc292e9b292b955be28b70a06ad1f52bb89ec540cfcc diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/34e308265c0490e0c346b2abb79c66c33d4391d378600e49c0feaf136a99c7b8 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/34e308265c0490e0c346b2abb79c66c33d4391d378600e49c0feaf136a99c7b8 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/34e308265c0490e0c346b2abb79c66c33d4391d378600e49c0feaf136a99c7b8 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/34e308265c0490e0c346b2abb79c66c33d4391d378600e49c0feaf136a99c7b8 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/34e7986c170afae74ca2468d9a0fbe2769208ab02a4f9c1b736dc4e22cd0bcac b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/34e7986c170afae74ca2468d9a0fbe2769208ab02a4f9c1b736dc4e22cd0bcac similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/34e7986c170afae74ca2468d9a0fbe2769208ab02a4f9c1b736dc4e22cd0bcac rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/34e7986c170afae74ca2468d9a0fbe2769208ab02a4f9c1b736dc4e22cd0bcac diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/3686faabfef961a660f6f00e713e94cfaeb703ee36f0ecaebf021367020b4662 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/3686faabfef961a660f6f00e713e94cfaeb703ee36f0ecaebf021367020b4662 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/3686faabfef961a660f6f00e713e94cfaeb703ee36f0ecaebf021367020b4662 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/3686faabfef961a660f6f00e713e94cfaeb703ee36f0ecaebf021367020b4662 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/37176203dc20a47abc63d6b047c68e509e9405c8ea0d919b46398af516724e9a b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/37176203dc20a47abc63d6b047c68e509e9405c8ea0d919b46398af516724e9a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/37176203dc20a47abc63d6b047c68e509e9405c8ea0d919b46398af516724e9a rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/37176203dc20a47abc63d6b047c68e509e9405c8ea0d919b46398af516724e9a diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/37808c2d2e60bd3ff4904ddb5d542f6d202348754e9988642fb520e91dec5c5b b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/37808c2d2e60bd3ff4904ddb5d542f6d202348754e9988642fb520e91dec5c5b similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/37808c2d2e60bd3ff4904ddb5d542f6d202348754e9988642fb520e91dec5c5b rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/37808c2d2e60bd3ff4904ddb5d542f6d202348754e9988642fb520e91dec5c5b diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/3863a9552d42e74daee67d5a86f2484a7d18ed46576708876810ff036bb3d4b8 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/3863a9552d42e74daee67d5a86f2484a7d18ed46576708876810ff036bb3d4b8 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/3863a9552d42e74daee67d5a86f2484a7d18ed46576708876810ff036bb3d4b8 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/3863a9552d42e74daee67d5a86f2484a7d18ed46576708876810ff036bb3d4b8 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/389f11003196f338bbb6a8147ae1cca89319fd93df381427c92b72b3aa8109d1 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/389f11003196f338bbb6a8147ae1cca89319fd93df381427c92b72b3aa8109d1 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/389f11003196f338bbb6a8147ae1cca89319fd93df381427c92b72b3aa8109d1 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/389f11003196f338bbb6a8147ae1cca89319fd93df381427c92b72b3aa8109d1 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/38fcf14845e36eed5b7ffde6baf09afbdb16117f1076dc6c19201a3576be1cff b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/38fcf14845e36eed5b7ffde6baf09afbdb16117f1076dc6c19201a3576be1cff similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/38fcf14845e36eed5b7ffde6baf09afbdb16117f1076dc6c19201a3576be1cff rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/38fcf14845e36eed5b7ffde6baf09afbdb16117f1076dc6c19201a3576be1cff diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/3d3bc58b6178cc90ea55ce2d0266b715d6dce64994d90beaadc44053efeea9f5 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/3d3bc58b6178cc90ea55ce2d0266b715d6dce64994d90beaadc44053efeea9f5 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/3d3bc58b6178cc90ea55ce2d0266b715d6dce64994d90beaadc44053efeea9f5 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/3d3bc58b6178cc90ea55ce2d0266b715d6dce64994d90beaadc44053efeea9f5 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/3d8692c8ae6174600dd698cd0ce757aad1a61dba220b91488d0cee90f476a868 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/3d8692c8ae6174600dd698cd0ce757aad1a61dba220b91488d0cee90f476a868 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/3d8692c8ae6174600dd698cd0ce757aad1a61dba220b91488d0cee90f476a868 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/3d8692c8ae6174600dd698cd0ce757aad1a61dba220b91488d0cee90f476a868 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/3e6843f7ad1ffe3ef5132482212b04d7a55a786b16999e462e2d71ad012cdbfc b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/3e6843f7ad1ffe3ef5132482212b04d7a55a786b16999e462e2d71ad012cdbfc similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/3e6843f7ad1ffe3ef5132482212b04d7a55a786b16999e462e2d71ad012cdbfc rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/3e6843f7ad1ffe3ef5132482212b04d7a55a786b16999e462e2d71ad012cdbfc diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/3f91ec8a124c6942ef8b69c5e6b63dd6c60b26368a9629d9c2b3531417769960 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/3f91ec8a124c6942ef8b69c5e6b63dd6c60b26368a9629d9c2b3531417769960 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/3f91ec8a124c6942ef8b69c5e6b63dd6c60b26368a9629d9c2b3531417769960 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/3f91ec8a124c6942ef8b69c5e6b63dd6c60b26368a9629d9c2b3531417769960 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/3fec9dae9b71d645b8d0a6274fd040a8628f3f2d016220b195282359edfee80a b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/3fec9dae9b71d645b8d0a6274fd040a8628f3f2d016220b195282359edfee80a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/3fec9dae9b71d645b8d0a6274fd040a8628f3f2d016220b195282359edfee80a rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/3fec9dae9b71d645b8d0a6274fd040a8628f3f2d016220b195282359edfee80a diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4055839ecf36d691a5c8e1d3ad9c9f000695c5824b6240f98cc0fef896a66dad b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4055839ecf36d691a5c8e1d3ad9c9f000695c5824b6240f98cc0fef896a66dad similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4055839ecf36d691a5c8e1d3ad9c9f000695c5824b6240f98cc0fef896a66dad rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4055839ecf36d691a5c8e1d3ad9c9f000695c5824b6240f98cc0fef896a66dad diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4103bf987facd0014348b3caf5eaeda8137911924d6dc62af2cd150dc287f07b b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4103bf987facd0014348b3caf5eaeda8137911924d6dc62af2cd150dc287f07b similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4103bf987facd0014348b3caf5eaeda8137911924d6dc62af2cd150dc287f07b rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4103bf987facd0014348b3caf5eaeda8137911924d6dc62af2cd150dc287f07b diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/417cbccd9c92b1be8a2e3621a2e5ceb184d5614b7e355c9c0b408182d0401ed6 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/417cbccd9c92b1be8a2e3621a2e5ceb184d5614b7e355c9c0b408182d0401ed6 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/417cbccd9c92b1be8a2e3621a2e5ceb184d5614b7e355c9c0b408182d0401ed6 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/417cbccd9c92b1be8a2e3621a2e5ceb184d5614b7e355c9c0b408182d0401ed6 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/41d5b42230ee106e199afdc3a3befb33013237ab1617d91a8b85f4d6bd962cdc b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/41d5b42230ee106e199afdc3a3befb33013237ab1617d91a8b85f4d6bd962cdc similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/41d5b42230ee106e199afdc3a3befb33013237ab1617d91a8b85f4d6bd962cdc rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/41d5b42230ee106e199afdc3a3befb33013237ab1617d91a8b85f4d6bd962cdc diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4207b0d778812832e5a0caba372a8970f34324a12f0192e69dafbf3433379405 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4207b0d778812832e5a0caba372a8970f34324a12f0192e69dafbf3433379405 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4207b0d778812832e5a0caba372a8970f34324a12f0192e69dafbf3433379405 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4207b0d778812832e5a0caba372a8970f34324a12f0192e69dafbf3433379405 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/423b3e30a2808e04ebd142979d1c427616d282653510a15aead9b1205d21aba8 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/423b3e30a2808e04ebd142979d1c427616d282653510a15aead9b1205d21aba8 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/423b3e30a2808e04ebd142979d1c427616d282653510a15aead9b1205d21aba8 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/423b3e30a2808e04ebd142979d1c427616d282653510a15aead9b1205d21aba8 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4262009df38dac28badcaa28be2db445b16d18d8ccb9a06b54a79fc0a2f7ed4b b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4262009df38dac28badcaa28be2db445b16d18d8ccb9a06b54a79fc0a2f7ed4b similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4262009df38dac28badcaa28be2db445b16d18d8ccb9a06b54a79fc0a2f7ed4b rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4262009df38dac28badcaa28be2db445b16d18d8ccb9a06b54a79fc0a2f7ed4b diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/43581b7a3cfd6c1cf00943291cc2899b46c3efbca6d2f6e77939825a46064b86 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/43581b7a3cfd6c1cf00943291cc2899b46c3efbca6d2f6e77939825a46064b86 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/43581b7a3cfd6c1cf00943291cc2899b46c3efbca6d2f6e77939825a46064b86 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/43581b7a3cfd6c1cf00943291cc2899b46c3efbca6d2f6e77939825a46064b86 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/436a3a5c38ba81148544345a17804f2e6b891c76de03e731a2f8df03e6b2cc36 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/436a3a5c38ba81148544345a17804f2e6b891c76de03e731a2f8df03e6b2cc36 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/436a3a5c38ba81148544345a17804f2e6b891c76de03e731a2f8df03e6b2cc36 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/436a3a5c38ba81148544345a17804f2e6b891c76de03e731a2f8df03e6b2cc36 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4506c4d3fe7c297926024278b4794a4588c48551c3ef5783b231b0f4fc47a35c b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4506c4d3fe7c297926024278b4794a4588c48551c3ef5783b231b0f4fc47a35c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4506c4d3fe7c297926024278b4794a4588c48551c3ef5783b231b0f4fc47a35c rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4506c4d3fe7c297926024278b4794a4588c48551c3ef5783b231b0f4fc47a35c diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/462d8cb3bed8f450f0ae1b17e18292419338a9519356f5fc26db3d8075ed43be b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/462d8cb3bed8f450f0ae1b17e18292419338a9519356f5fc26db3d8075ed43be similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/462d8cb3bed8f450f0ae1b17e18292419338a9519356f5fc26db3d8075ed43be rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/462d8cb3bed8f450f0ae1b17e18292419338a9519356f5fc26db3d8075ed43be diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/463e4809547612cff0a65a7e9df2c730d5b3c43052f77b94f5268a6d9170a763 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/463e4809547612cff0a65a7e9df2c730d5b3c43052f77b94f5268a6d9170a763 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/463e4809547612cff0a65a7e9df2c730d5b3c43052f77b94f5268a6d9170a763 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/463e4809547612cff0a65a7e9df2c730d5b3c43052f77b94f5268a6d9170a763 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4782608d08eafbc7b8361d1397c488c0cfe4df2512c9cb25997d4d73c49022f3 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4782608d08eafbc7b8361d1397c488c0cfe4df2512c9cb25997d4d73c49022f3 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4782608d08eafbc7b8361d1397c488c0cfe4df2512c9cb25997d4d73c49022f3 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4782608d08eafbc7b8361d1397c488c0cfe4df2512c9cb25997d4d73c49022f3 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/48480e0b720b65c10ab9ffa76db9ddc112d2e4e9da58033ab9165d70b9825045 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/48480e0b720b65c10ab9ffa76db9ddc112d2e4e9da58033ab9165d70b9825045 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/48480e0b720b65c10ab9ffa76db9ddc112d2e4e9da58033ab9165d70b9825045 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/48480e0b720b65c10ab9ffa76db9ddc112d2e4e9da58033ab9165d70b9825045 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/485f29607e354e30e0e89d92a05499bb3fabff09c89a0d97b583fde93771a17d b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/485f29607e354e30e0e89d92a05499bb3fabff09c89a0d97b583fde93771a17d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/485f29607e354e30e0e89d92a05499bb3fabff09c89a0d97b583fde93771a17d rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/485f29607e354e30e0e89d92a05499bb3fabff09c89a0d97b583fde93771a17d diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/497415418f93ed0620f893685a462244d3b0317fecc12df587535432a7718d6f b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/497415418f93ed0620f893685a462244d3b0317fecc12df587535432a7718d6f similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/497415418f93ed0620f893685a462244d3b0317fecc12df587535432a7718d6f rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/497415418f93ed0620f893685a462244d3b0317fecc12df587535432a7718d6f diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4aa4d71c504422a8819b93ffef8fbb277a32a44f00e6fb004ed6dc92cdcab995 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4aa4d71c504422a8819b93ffef8fbb277a32a44f00e6fb004ed6dc92cdcab995 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4aa4d71c504422a8819b93ffef8fbb277a32a44f00e6fb004ed6dc92cdcab995 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4aa4d71c504422a8819b93ffef8fbb277a32a44f00e6fb004ed6dc92cdcab995 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4b6e9a617f45f821c7ce3b0e1ce450719e669e134da59b99de708d27afbdeded b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4b6e9a617f45f821c7ce3b0e1ce450719e669e134da59b99de708d27afbdeded similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4b6e9a617f45f821c7ce3b0e1ce450719e669e134da59b99de708d27afbdeded rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4b6e9a617f45f821c7ce3b0e1ce450719e669e134da59b99de708d27afbdeded diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4d7f9071025faf0d6b778171e6bc644c7c81cbd770c7bd2e1cc59340ea475667 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4d7f9071025faf0d6b778171e6bc644c7c81cbd770c7bd2e1cc59340ea475667 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4d7f9071025faf0d6b778171e6bc644c7c81cbd770c7bd2e1cc59340ea475667 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4d7f9071025faf0d6b778171e6bc644c7c81cbd770c7bd2e1cc59340ea475667 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4d8fb99ab9b6cded4ac69f46c378db96be55cc9233bbd9f2fce97c6a367dcac5 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4d8fb99ab9b6cded4ac69f46c378db96be55cc9233bbd9f2fce97c6a367dcac5 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4d8fb99ab9b6cded4ac69f46c378db96be55cc9233bbd9f2fce97c6a367dcac5 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4d8fb99ab9b6cded4ac69f46c378db96be55cc9233bbd9f2fce97c6a367dcac5 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4f14372b9b11ad15d5c600ea0345b32c15553fd36a1c632fd4084da77e6b3ea8 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4f14372b9b11ad15d5c600ea0345b32c15553fd36a1c632fd4084da77e6b3ea8 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4f14372b9b11ad15d5c600ea0345b32c15553fd36a1c632fd4084da77e6b3ea8 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/4f14372b9b11ad15d5c600ea0345b32c15553fd36a1c632fd4084da77e6b3ea8 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/507ee0939e02c526ce1c905760ba11a5bf9e1ecb20833878faee46aa51b68495 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/507ee0939e02c526ce1c905760ba11a5bf9e1ecb20833878faee46aa51b68495 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/507ee0939e02c526ce1c905760ba11a5bf9e1ecb20833878faee46aa51b68495 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/507ee0939e02c526ce1c905760ba11a5bf9e1ecb20833878faee46aa51b68495 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/52c694204a815c2fca4ffebfc4d46dc3bcce46ff97dd8868153098bcb5b6fd1f b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/52c694204a815c2fca4ffebfc4d46dc3bcce46ff97dd8868153098bcb5b6fd1f similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/52c694204a815c2fca4ffebfc4d46dc3bcce46ff97dd8868153098bcb5b6fd1f rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/52c694204a815c2fca4ffebfc4d46dc3bcce46ff97dd8868153098bcb5b6fd1f diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/534a9398edc1f6901fd5c1c8a79aef85f86ac4726709d7add8376ccb91f3fbbe b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/534a9398edc1f6901fd5c1c8a79aef85f86ac4726709d7add8376ccb91f3fbbe similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/534a9398edc1f6901fd5c1c8a79aef85f86ac4726709d7add8376ccb91f3fbbe rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/534a9398edc1f6901fd5c1c8a79aef85f86ac4726709d7add8376ccb91f3fbbe diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/549432496157c8df35e5f97d596ca515bc5c599fcf60d8402ec949a764f42391 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/549432496157c8df35e5f97d596ca515bc5c599fcf60d8402ec949a764f42391 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/549432496157c8df35e5f97d596ca515bc5c599fcf60d8402ec949a764f42391 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/549432496157c8df35e5f97d596ca515bc5c599fcf60d8402ec949a764f42391 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5573d7d8c66d30a08f09a7fd63763a0f0f0e0568e65b467d083d14aac4fff55c b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5573d7d8c66d30a08f09a7fd63763a0f0f0e0568e65b467d083d14aac4fff55c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5573d7d8c66d30a08f09a7fd63763a0f0f0e0568e65b467d083d14aac4fff55c rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5573d7d8c66d30a08f09a7fd63763a0f0f0e0568e65b467d083d14aac4fff55c diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/56cca86f06992568c6322fa13c0fc4a5586ad2068ae36ae79d1415cb08e21df2 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/56cca86f06992568c6322fa13c0fc4a5586ad2068ae36ae79d1415cb08e21df2 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/56cca86f06992568c6322fa13c0fc4a5586ad2068ae36ae79d1415cb08e21df2 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/56cca86f06992568c6322fa13c0fc4a5586ad2068ae36ae79d1415cb08e21df2 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5818a66acbb8fef3dbafcef9528ebf526911573546289eb1cefdc649cbde643a b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5818a66acbb8fef3dbafcef9528ebf526911573546289eb1cefdc649cbde643a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5818a66acbb8fef3dbafcef9528ebf526911573546289eb1cefdc649cbde643a rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5818a66acbb8fef3dbafcef9528ebf526911573546289eb1cefdc649cbde643a diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/58a4b49d1bab6025de299a8d0df2ace09bbc7c1df4e61a47af4605610fcaa256 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/58a4b49d1bab6025de299a8d0df2ace09bbc7c1df4e61a47af4605610fcaa256 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/58a4b49d1bab6025de299a8d0df2ace09bbc7c1df4e61a47af4605610fcaa256 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/58a4b49d1bab6025de299a8d0df2ace09bbc7c1df4e61a47af4605610fcaa256 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/590e6d172a9fad00bce82a4137292eaab09d04ce138999a3ff7e02bea668f619 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/590e6d172a9fad00bce82a4137292eaab09d04ce138999a3ff7e02bea668f619 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/590e6d172a9fad00bce82a4137292eaab09d04ce138999a3ff7e02bea668f619 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/590e6d172a9fad00bce82a4137292eaab09d04ce138999a3ff7e02bea668f619 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5911346c2dde47dba87b61ab050ab89c298f45aacc9894664071008285708dd4 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5911346c2dde47dba87b61ab050ab89c298f45aacc9894664071008285708dd4 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5911346c2dde47dba87b61ab050ab89c298f45aacc9894664071008285708dd4 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5911346c2dde47dba87b61ab050ab89c298f45aacc9894664071008285708dd4 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5a4654d1b54ac0ef301e31a55b2a0eb48a083ecca2c6efa6883cd568b5e801f7 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5a4654d1b54ac0ef301e31a55b2a0eb48a083ecca2c6efa6883cd568b5e801f7 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5a4654d1b54ac0ef301e31a55b2a0eb48a083ecca2c6efa6883cd568b5e801f7 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5a4654d1b54ac0ef301e31a55b2a0eb48a083ecca2c6efa6883cd568b5e801f7 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5c6c711a03e4fccdc36881cc1105c6e630f64f9d801c46623c0f73a3aa0948ce b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5c6c711a03e4fccdc36881cc1105c6e630f64f9d801c46623c0f73a3aa0948ce similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5c6c711a03e4fccdc36881cc1105c6e630f64f9d801c46623c0f73a3aa0948ce rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5c6c711a03e4fccdc36881cc1105c6e630f64f9d801c46623c0f73a3aa0948ce diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5c6fd6771982cb21d2ee6d2f3a4dd19bd527ef9857ad3f1ef6c53cdd1a1b7a22 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5c6fd6771982cb21d2ee6d2f3a4dd19bd527ef9857ad3f1ef6c53cdd1a1b7a22 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5c6fd6771982cb21d2ee6d2f3a4dd19bd527ef9857ad3f1ef6c53cdd1a1b7a22 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5c6fd6771982cb21d2ee6d2f3a4dd19bd527ef9857ad3f1ef6c53cdd1a1b7a22 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5db4f23e9be019c797ef8cdc2a27eb88cdf29c1a91cf096418658ce8f741b800 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5db4f23e9be019c797ef8cdc2a27eb88cdf29c1a91cf096418658ce8f741b800 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5db4f23e9be019c797ef8cdc2a27eb88cdf29c1a91cf096418658ce8f741b800 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5db4f23e9be019c797ef8cdc2a27eb88cdf29c1a91cf096418658ce8f741b800 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5e5dfaf4867c6471ddb3ae38daa47af0455b022b085be0f1eea8445e306fe40d b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5e5dfaf4867c6471ddb3ae38daa47af0455b022b085be0f1eea8445e306fe40d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5e5dfaf4867c6471ddb3ae38daa47af0455b022b085be0f1eea8445e306fe40d rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5e5dfaf4867c6471ddb3ae38daa47af0455b022b085be0f1eea8445e306fe40d diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5e97a615e984fabfc8f2a741b1cd3d5ab2d50f9fa74ee9263d59e87d7e230cef b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5e97a615e984fabfc8f2a741b1cd3d5ab2d50f9fa74ee9263d59e87d7e230cef similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5e97a615e984fabfc8f2a741b1cd3d5ab2d50f9fa74ee9263d59e87d7e230cef rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5e97a615e984fabfc8f2a741b1cd3d5ab2d50f9fa74ee9263d59e87d7e230cef diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5f85a57176e66de9b5609ada9c96e57d511d0d0a8da47b448d7f436ce3cecc59 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5f85a57176e66de9b5609ada9c96e57d511d0d0a8da47b448d7f436ce3cecc59 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5f85a57176e66de9b5609ada9c96e57d511d0d0a8da47b448d7f436ce3cecc59 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5f85a57176e66de9b5609ada9c96e57d511d0d0a8da47b448d7f436ce3cecc59 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5fc0794b27807cc806512fd006e8c2a6ad3d028350eaaf8229197df5164c473b b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5fc0794b27807cc806512fd006e8c2a6ad3d028350eaaf8229197df5164c473b similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5fc0794b27807cc806512fd006e8c2a6ad3d028350eaaf8229197df5164c473b rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5fc0794b27807cc806512fd006e8c2a6ad3d028350eaaf8229197df5164c473b diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5fe655923677eb9ae41deb35401536f20588e3b2cf115b8062984a1b0bb7a895 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5fe655923677eb9ae41deb35401536f20588e3b2cf115b8062984a1b0bb7a895 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5fe655923677eb9ae41deb35401536f20588e3b2cf115b8062984a1b0bb7a895 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/5fe655923677eb9ae41deb35401536f20588e3b2cf115b8062984a1b0bb7a895 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/6166e91bbcf5dbfb6c4c10eca6194e09e513e0b1b49f64fa4e127340fbe119ee b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/6166e91bbcf5dbfb6c4c10eca6194e09e513e0b1b49f64fa4e127340fbe119ee similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/6166e91bbcf5dbfb6c4c10eca6194e09e513e0b1b49f64fa4e127340fbe119ee rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/6166e91bbcf5dbfb6c4c10eca6194e09e513e0b1b49f64fa4e127340fbe119ee diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/617c56b6a1823b29ba467e34c5f0d6567b035694532323c5c4cabb789c77bc15 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/617c56b6a1823b29ba467e34c5f0d6567b035694532323c5c4cabb789c77bc15 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/617c56b6a1823b29ba467e34c5f0d6567b035694532323c5c4cabb789c77bc15 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/617c56b6a1823b29ba467e34c5f0d6567b035694532323c5c4cabb789c77bc15 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/61a3582baac5cee2e5738d46091495fdd634ba76a7c690b90a21db7c4d1567ba b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/61a3582baac5cee2e5738d46091495fdd634ba76a7c690b90a21db7c4d1567ba similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/61a3582baac5cee2e5738d46091495fdd634ba76a7c690b90a21db7c4d1567ba rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/61a3582baac5cee2e5738d46091495fdd634ba76a7c690b90a21db7c4d1567ba diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/623429a82cef55498b36f16eccf995a3609da5588595f058ce7f912d874ed316 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/623429a82cef55498b36f16eccf995a3609da5588595f058ce7f912d874ed316 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/623429a82cef55498b36f16eccf995a3609da5588595f058ce7f912d874ed316 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/623429a82cef55498b36f16eccf995a3609da5588595f058ce7f912d874ed316 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/62daf71058c43f59f7eac835d34445bd7769facae3507bf928f191d60349f234 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/62daf71058c43f59f7eac835d34445bd7769facae3507bf928f191d60349f234 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/62daf71058c43f59f7eac835d34445bd7769facae3507bf928f191d60349f234 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/62daf71058c43f59f7eac835d34445bd7769facae3507bf928f191d60349f234 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/62dfd8fec76ea0bcc25dc5d376f142dbd8dd3991d7792a8a304af431488e45c4 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/62dfd8fec76ea0bcc25dc5d376f142dbd8dd3991d7792a8a304af431488e45c4 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/62dfd8fec76ea0bcc25dc5d376f142dbd8dd3991d7792a8a304af431488e45c4 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/62dfd8fec76ea0bcc25dc5d376f142dbd8dd3991d7792a8a304af431488e45c4 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/63f44506e76d53f351a77971334cc4f866b61e45535ccb8f6c83f11e83018b19 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/63f44506e76d53f351a77971334cc4f866b61e45535ccb8f6c83f11e83018b19 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/63f44506e76d53f351a77971334cc4f866b61e45535ccb8f6c83f11e83018b19 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/63f44506e76d53f351a77971334cc4f866b61e45535ccb8f6c83f11e83018b19 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/64c2a5ea2eaf4f6996248d98fb9b85b0a136d202a3e896c4d1daaa44c2cda303 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/64c2a5ea2eaf4f6996248d98fb9b85b0a136d202a3e896c4d1daaa44c2cda303 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/64c2a5ea2eaf4f6996248d98fb9b85b0a136d202a3e896c4d1daaa44c2cda303 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/64c2a5ea2eaf4f6996248d98fb9b85b0a136d202a3e896c4d1daaa44c2cda303 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/64e99354dcaf086e94cf786dbf7e9a56d5b1195cddb5503581e706b41b26378c b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/64e99354dcaf086e94cf786dbf7e9a56d5b1195cddb5503581e706b41b26378c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/64e99354dcaf086e94cf786dbf7e9a56d5b1195cddb5503581e706b41b26378c rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/64e99354dcaf086e94cf786dbf7e9a56d5b1195cddb5503581e706b41b26378c diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/653af5304b2082919075527e07eebf1d9ae0a592739bcc93492330224bef55b5 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/653af5304b2082919075527e07eebf1d9ae0a592739bcc93492330224bef55b5 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/653af5304b2082919075527e07eebf1d9ae0a592739bcc93492330224bef55b5 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/653af5304b2082919075527e07eebf1d9ae0a592739bcc93492330224bef55b5 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/659bda0a0ea238ba229459f525a0d4f1286dadb9a77dc4e26798f1ccdf4e48b2 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/659bda0a0ea238ba229459f525a0d4f1286dadb9a77dc4e26798f1ccdf4e48b2 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/659bda0a0ea238ba229459f525a0d4f1286dadb9a77dc4e26798f1ccdf4e48b2 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/659bda0a0ea238ba229459f525a0d4f1286dadb9a77dc4e26798f1ccdf4e48b2 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/66c1f5fd084450d9a2254d19c823ad9ac6061e45e174f7ad7a5b75f20312d2f9 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/66c1f5fd084450d9a2254d19c823ad9ac6061e45e174f7ad7a5b75f20312d2f9 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/66c1f5fd084450d9a2254d19c823ad9ac6061e45e174f7ad7a5b75f20312d2f9 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/66c1f5fd084450d9a2254d19c823ad9ac6061e45e174f7ad7a5b75f20312d2f9 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/678bc5495b809b2cee8bfcd17d788768f6044c501859c34ef30e94d49fcf1434 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/678bc5495b809b2cee8bfcd17d788768f6044c501859c34ef30e94d49fcf1434 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/678bc5495b809b2cee8bfcd17d788768f6044c501859c34ef30e94d49fcf1434 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/678bc5495b809b2cee8bfcd17d788768f6044c501859c34ef30e94d49fcf1434 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/681dbf23ca20a96e90f956ed6219d5aeb809c9faf9f38ab711dea4a7c66bc27a b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/681dbf23ca20a96e90f956ed6219d5aeb809c9faf9f38ab711dea4a7c66bc27a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/681dbf23ca20a96e90f956ed6219d5aeb809c9faf9f38ab711dea4a7c66bc27a rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/681dbf23ca20a96e90f956ed6219d5aeb809c9faf9f38ab711dea4a7c66bc27a diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/6c40048a474cb34ae5d70e0da4cb7357fc70665bccdbd637b81649fd5d48e227 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/6c40048a474cb34ae5d70e0da4cb7357fc70665bccdbd637b81649fd5d48e227 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/6c40048a474cb34ae5d70e0da4cb7357fc70665bccdbd637b81649fd5d48e227 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/6c40048a474cb34ae5d70e0da4cb7357fc70665bccdbd637b81649fd5d48e227 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/6c51e168172a32e96977842419de54e3fb4c8d89bebf2da993d820f75feaa14e b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/6c51e168172a32e96977842419de54e3fb4c8d89bebf2da993d820f75feaa14e similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/6c51e168172a32e96977842419de54e3fb4c8d89bebf2da993d820f75feaa14e rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/6c51e168172a32e96977842419de54e3fb4c8d89bebf2da993d820f75feaa14e diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/6d76ec31514e064e9c301d9909f701d8600bad022a9734d9fd916be093b7939c b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/6d76ec31514e064e9c301d9909f701d8600bad022a9734d9fd916be093b7939c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/6d76ec31514e064e9c301d9909f701d8600bad022a9734d9fd916be093b7939c rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/6d76ec31514e064e9c301d9909f701d8600bad022a9734d9fd916be093b7939c diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/6ef7bdadce526db1ab0472b130f1270c3c548ae198351838e7bfdb3067d56ebb b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/6ef7bdadce526db1ab0472b130f1270c3c548ae198351838e7bfdb3067d56ebb similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/6ef7bdadce526db1ab0472b130f1270c3c548ae198351838e7bfdb3067d56ebb rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/6ef7bdadce526db1ab0472b130f1270c3c548ae198351838e7bfdb3067d56ebb diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/7130be83c3129ca052ae2d8c357a7f58738cc16de5c3914b2199099c18d9be81 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/7130be83c3129ca052ae2d8c357a7f58738cc16de5c3914b2199099c18d9be81 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/7130be83c3129ca052ae2d8c357a7f58738cc16de5c3914b2199099c18d9be81 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/7130be83c3129ca052ae2d8c357a7f58738cc16de5c3914b2199099c18d9be81 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/71a81957912c7687a3f7a2f02a363429cfb601e280ee3ca3495b20b97be7bcad b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/71a81957912c7687a3f7a2f02a363429cfb601e280ee3ca3495b20b97be7bcad similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/71a81957912c7687a3f7a2f02a363429cfb601e280ee3ca3495b20b97be7bcad rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/71a81957912c7687a3f7a2f02a363429cfb601e280ee3ca3495b20b97be7bcad diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/7596a6c934a99dc1ef8256092ed79ce80d491c441f14d907e71526943bc0c0e6 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/7596a6c934a99dc1ef8256092ed79ce80d491c441f14d907e71526943bc0c0e6 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/7596a6c934a99dc1ef8256092ed79ce80d491c441f14d907e71526943bc0c0e6 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/7596a6c934a99dc1ef8256092ed79ce80d491c441f14d907e71526943bc0c0e6 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/787133ff9fd9f36aba8767a22c454a34cf0241e83b172380e7af3ff79ec126c4 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/787133ff9fd9f36aba8767a22c454a34cf0241e83b172380e7af3ff79ec126c4 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/787133ff9fd9f36aba8767a22c454a34cf0241e83b172380e7af3ff79ec126c4 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/787133ff9fd9f36aba8767a22c454a34cf0241e83b172380e7af3ff79ec126c4 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/78ae309e3b6bc5e920dffa3b3d481df1ff50090df9506610d34b491139e0edf8 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/78ae309e3b6bc5e920dffa3b3d481df1ff50090df9506610d34b491139e0edf8 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/78ae309e3b6bc5e920dffa3b3d481df1ff50090df9506610d34b491139e0edf8 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/78ae309e3b6bc5e920dffa3b3d481df1ff50090df9506610d34b491139e0edf8 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/7b10ac4f18a908fc862a9aa37bc1d290b6684c8f5012dbd2abf1ebd358a9404e b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/7b10ac4f18a908fc862a9aa37bc1d290b6684c8f5012dbd2abf1ebd358a9404e similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/7b10ac4f18a908fc862a9aa37bc1d290b6684c8f5012dbd2abf1ebd358a9404e rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/7b10ac4f18a908fc862a9aa37bc1d290b6684c8f5012dbd2abf1ebd358a9404e diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/7bfc581354cbcafaaf75930d272721401c0d87de8a0bcca68b2fbdee27e87186 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/7bfc581354cbcafaaf75930d272721401c0d87de8a0bcca68b2fbdee27e87186 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/7bfc581354cbcafaaf75930d272721401c0d87de8a0bcca68b2fbdee27e87186 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/7bfc581354cbcafaaf75930d272721401c0d87de8a0bcca68b2fbdee27e87186 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/7c9b2a6799da455d42a27d8a4d7d7079925505bd17ff80c4b4dd15235d238ac9 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/7c9b2a6799da455d42a27d8a4d7d7079925505bd17ff80c4b4dd15235d238ac9 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/7c9b2a6799da455d42a27d8a4d7d7079925505bd17ff80c4b4dd15235d238ac9 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/7c9b2a6799da455d42a27d8a4d7d7079925505bd17ff80c4b4dd15235d238ac9 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/7d10bd375f5c36e5c6a047ddc21bef779abaa90658e6ee232eeec68620790730 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/7d10bd375f5c36e5c6a047ddc21bef779abaa90658e6ee232eeec68620790730 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/7d10bd375f5c36e5c6a047ddc21bef779abaa90658e6ee232eeec68620790730 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/7d10bd375f5c36e5c6a047ddc21bef779abaa90658e6ee232eeec68620790730 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/7d3a3639eb94b54a224454a7a56b6bf14ec228e67ca48bc384ab1f6e1ec61b0e b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/7d3a3639eb94b54a224454a7a56b6bf14ec228e67ca48bc384ab1f6e1ec61b0e similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/7d3a3639eb94b54a224454a7a56b6bf14ec228e67ca48bc384ab1f6e1ec61b0e rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/7d3a3639eb94b54a224454a7a56b6bf14ec228e67ca48bc384ab1f6e1ec61b0e diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/7d8ac07b254d1164b162a9ca710fc8a0d02c89818b8b5249346606510dd7ce41 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/7d8ac07b254d1164b162a9ca710fc8a0d02c89818b8b5249346606510dd7ce41 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/7d8ac07b254d1164b162a9ca710fc8a0d02c89818b8b5249346606510dd7ce41 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/7d8ac07b254d1164b162a9ca710fc8a0d02c89818b8b5249346606510dd7ce41 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/7ec2f36122c43c9ddafc169cd820ca07d57d1e8e269af98252d7a7dedde4dee0 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/7ec2f36122c43c9ddafc169cd820ca07d57d1e8e269af98252d7a7dedde4dee0 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/7ec2f36122c43c9ddafc169cd820ca07d57d1e8e269af98252d7a7dedde4dee0 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/7ec2f36122c43c9ddafc169cd820ca07d57d1e8e269af98252d7a7dedde4dee0 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/813c067ac33b929199b53ed37578bbebb5dfd4a6abf17b594cbfda4820ece1ee b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/813c067ac33b929199b53ed37578bbebb5dfd4a6abf17b594cbfda4820ece1ee similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/813c067ac33b929199b53ed37578bbebb5dfd4a6abf17b594cbfda4820ece1ee rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/813c067ac33b929199b53ed37578bbebb5dfd4a6abf17b594cbfda4820ece1ee diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/824492f4453f3c719f55b6a5508d74905a3ef217c1ee603ed32d679aee2adea1 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/824492f4453f3c719f55b6a5508d74905a3ef217c1ee603ed32d679aee2adea1 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/824492f4453f3c719f55b6a5508d74905a3ef217c1ee603ed32d679aee2adea1 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/824492f4453f3c719f55b6a5508d74905a3ef217c1ee603ed32d679aee2adea1 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/82b38c666d877a4393830f51382b36198d23b5592160448eb0e39fe01fc28423 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/82b38c666d877a4393830f51382b36198d23b5592160448eb0e39fe01fc28423 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/82b38c666d877a4393830f51382b36198d23b5592160448eb0e39fe01fc28423 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/82b38c666d877a4393830f51382b36198d23b5592160448eb0e39fe01fc28423 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/82c53c614151bc2b228cca18de7dd0414d67c75ee8926b0c1cd6a2bf01e55f86 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/82c53c614151bc2b228cca18de7dd0414d67c75ee8926b0c1cd6a2bf01e55f86 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/82c53c614151bc2b228cca18de7dd0414d67c75ee8926b0c1cd6a2bf01e55f86 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/82c53c614151bc2b228cca18de7dd0414d67c75ee8926b0c1cd6a2bf01e55f86 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/837a687b09f612fd002ead1794fc634aedbb5bfcf8f4a7cd4b6c424b9f1acab8 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/837a687b09f612fd002ead1794fc634aedbb5bfcf8f4a7cd4b6c424b9f1acab8 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/837a687b09f612fd002ead1794fc634aedbb5bfcf8f4a7cd4b6c424b9f1acab8 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/837a687b09f612fd002ead1794fc634aedbb5bfcf8f4a7cd4b6c424b9f1acab8 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/843067cbc7c2bbf96e439b2d48c04525eddf253b20214876d9d97a0c1d14e178 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/843067cbc7c2bbf96e439b2d48c04525eddf253b20214876d9d97a0c1d14e178 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/843067cbc7c2bbf96e439b2d48c04525eddf253b20214876d9d97a0c1d14e178 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/843067cbc7c2bbf96e439b2d48c04525eddf253b20214876d9d97a0c1d14e178 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/85d529312b9b9a05fd3ae7303268820c21c6423c02febe6fded78a7fa97bd9b0 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/85d529312b9b9a05fd3ae7303268820c21c6423c02febe6fded78a7fa97bd9b0 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/85d529312b9b9a05fd3ae7303268820c21c6423c02febe6fded78a7fa97bd9b0 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/85d529312b9b9a05fd3ae7303268820c21c6423c02febe6fded78a7fa97bd9b0 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/8663ed8083deeba2ca515d4b010d983a4092df9086a95b260e9e3413b324fa1c b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/8663ed8083deeba2ca515d4b010d983a4092df9086a95b260e9e3413b324fa1c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/8663ed8083deeba2ca515d4b010d983a4092df9086a95b260e9e3413b324fa1c rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/8663ed8083deeba2ca515d4b010d983a4092df9086a95b260e9e3413b324fa1c diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/87210149da5b2a4058747fb66643962702aeaa0ede1bdbfb72461dbe238864f8 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/87210149da5b2a4058747fb66643962702aeaa0ede1bdbfb72461dbe238864f8 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/87210149da5b2a4058747fb66643962702aeaa0ede1bdbfb72461dbe238864f8 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/87210149da5b2a4058747fb66643962702aeaa0ede1bdbfb72461dbe238864f8 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/875d48f45d52df6d43dca83845f1b2518f8d31cd2955946012d16bd9e6005285 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/875d48f45d52df6d43dca83845f1b2518f8d31cd2955946012d16bd9e6005285 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/875d48f45d52df6d43dca83845f1b2518f8d31cd2955946012d16bd9e6005285 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/875d48f45d52df6d43dca83845f1b2518f8d31cd2955946012d16bd9e6005285 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/896728ba1506ae2dcf2772a7c9a8fdd999e63a89abd204a51a6f5fcc00780030 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/896728ba1506ae2dcf2772a7c9a8fdd999e63a89abd204a51a6f5fcc00780030 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/896728ba1506ae2dcf2772a7c9a8fdd999e63a89abd204a51a6f5fcc00780030 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/896728ba1506ae2dcf2772a7c9a8fdd999e63a89abd204a51a6f5fcc00780030 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/8aa5b354c12d6285a05082b57148c9324f284ba4b6617fdcf3b5f17b4ed52cb0 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/8aa5b354c12d6285a05082b57148c9324f284ba4b6617fdcf3b5f17b4ed52cb0 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/8aa5b354c12d6285a05082b57148c9324f284ba4b6617fdcf3b5f17b4ed52cb0 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/8aa5b354c12d6285a05082b57148c9324f284ba4b6617fdcf3b5f17b4ed52cb0 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/8b0fda376eca60fd70fd71a4bec59e83481e55da06e9a6c679c9ff8f29a067df b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/8b0fda376eca60fd70fd71a4bec59e83481e55da06e9a6c679c9ff8f29a067df similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/8b0fda376eca60fd70fd71a4bec59e83481e55da06e9a6c679c9ff8f29a067df rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/8b0fda376eca60fd70fd71a4bec59e83481e55da06e9a6c679c9ff8f29a067df diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/8b9246a5e23645f90163bbbf66acdec8084ea383f1548e25d5e36771086cd570 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/8b9246a5e23645f90163bbbf66acdec8084ea383f1548e25d5e36771086cd570 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/8b9246a5e23645f90163bbbf66acdec8084ea383f1548e25d5e36771086cd570 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/8b9246a5e23645f90163bbbf66acdec8084ea383f1548e25d5e36771086cd570 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/8d15a054665d3e01e4528ee2c6540cfebc8fa579d96ab9d266163fb9c3daeaa6 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/8d15a054665d3e01e4528ee2c6540cfebc8fa579d96ab9d266163fb9c3daeaa6 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/8d15a054665d3e01e4528ee2c6540cfebc8fa579d96ab9d266163fb9c3daeaa6 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/8d15a054665d3e01e4528ee2c6540cfebc8fa579d96ab9d266163fb9c3daeaa6 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/8dc844fbb5aca4a7e91b4ea8be3d79c56542927fe5a02ef1f280a302d4ad76c8 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/8dc844fbb5aca4a7e91b4ea8be3d79c56542927fe5a02ef1f280a302d4ad76c8 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/8dc844fbb5aca4a7e91b4ea8be3d79c56542927fe5a02ef1f280a302d4ad76c8 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/8dc844fbb5aca4a7e91b4ea8be3d79c56542927fe5a02ef1f280a302d4ad76c8 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/8e729a6e9a10481c81e1d5c62b5086297ba9274b73414330d1d1ee176dc233f7 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/8e729a6e9a10481c81e1d5c62b5086297ba9274b73414330d1d1ee176dc233f7 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/8e729a6e9a10481c81e1d5c62b5086297ba9274b73414330d1d1ee176dc233f7 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/8e729a6e9a10481c81e1d5c62b5086297ba9274b73414330d1d1ee176dc233f7 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/8ef4260969186bf61a7d456af0495c93d92630ba8f4fbe5b4d8e87659245f5f5 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/8ef4260969186bf61a7d456af0495c93d92630ba8f4fbe5b4d8e87659245f5f5 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/8ef4260969186bf61a7d456af0495c93d92630ba8f4fbe5b4d8e87659245f5f5 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/8ef4260969186bf61a7d456af0495c93d92630ba8f4fbe5b4d8e87659245f5f5 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/9056d9a1a71ba588e94f242ebdc5f0e8ea03a903a8aee07b8c162978a9efb8b9 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/9056d9a1a71ba588e94f242ebdc5f0e8ea03a903a8aee07b8c162978a9efb8b9 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/9056d9a1a71ba588e94f242ebdc5f0e8ea03a903a8aee07b8c162978a9efb8b9 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/9056d9a1a71ba588e94f242ebdc5f0e8ea03a903a8aee07b8c162978a9efb8b9 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/9281944ec6e43d5be59192ae6cf85df0d558e5e64c8bca628f159eb7f65fdf1d b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/9281944ec6e43d5be59192ae6cf85df0d558e5e64c8bca628f159eb7f65fdf1d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/9281944ec6e43d5be59192ae6cf85df0d558e5e64c8bca628f159eb7f65fdf1d rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/9281944ec6e43d5be59192ae6cf85df0d558e5e64c8bca628f159eb7f65fdf1d diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/9301bbdcf9da8418e770d01a5e101f2f3a1ab6854f98cb8c11baef199c9b5d48 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/9301bbdcf9da8418e770d01a5e101f2f3a1ab6854f98cb8c11baef199c9b5d48 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/9301bbdcf9da8418e770d01a5e101f2f3a1ab6854f98cb8c11baef199c9b5d48 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/9301bbdcf9da8418e770d01a5e101f2f3a1ab6854f98cb8c11baef199c9b5d48 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/936baf46d3235d0800ae53403186dbf90f538f59874780c3346f74b7e928c170 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/936baf46d3235d0800ae53403186dbf90f538f59874780c3346f74b7e928c170 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/936baf46d3235d0800ae53403186dbf90f538f59874780c3346f74b7e928c170 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/936baf46d3235d0800ae53403186dbf90f538f59874780c3346f74b7e928c170 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/93eacbcb4935a9e4f587179ad6e73bbc6893ee1d7ce1f8d252e27697dcf16a4d b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/93eacbcb4935a9e4f587179ad6e73bbc6893ee1d7ce1f8d252e27697dcf16a4d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/93eacbcb4935a9e4f587179ad6e73bbc6893ee1d7ce1f8d252e27697dcf16a4d rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/93eacbcb4935a9e4f587179ad6e73bbc6893ee1d7ce1f8d252e27697dcf16a4d diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/94cefa866cd67b2f40aab79605ec28bcdc97029c94d78a3ff9fb97ecec1efc7c b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/94cefa866cd67b2f40aab79605ec28bcdc97029c94d78a3ff9fb97ecec1efc7c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/94cefa866cd67b2f40aab79605ec28bcdc97029c94d78a3ff9fb97ecec1efc7c rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/94cefa866cd67b2f40aab79605ec28bcdc97029c94d78a3ff9fb97ecec1efc7c diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/954b922c77738f9864c8aff4b04f3a59544a86f0d8566978a0e135cf36f92df2 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/954b922c77738f9864c8aff4b04f3a59544a86f0d8566978a0e135cf36f92df2 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/954b922c77738f9864c8aff4b04f3a59544a86f0d8566978a0e135cf36f92df2 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/954b922c77738f9864c8aff4b04f3a59544a86f0d8566978a0e135cf36f92df2 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/9a30cca142c30eea28872e2e89af24532ef35eaf00e069c238f475a006b7a492 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/9a30cca142c30eea28872e2e89af24532ef35eaf00e069c238f475a006b7a492 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/9a30cca142c30eea28872e2e89af24532ef35eaf00e069c238f475a006b7a492 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/9a30cca142c30eea28872e2e89af24532ef35eaf00e069c238f475a006b7a492 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/9a335c36ff4c95bca1c05a6616a1dfeb30c74174ab185568ed7b38728ace8494 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/9a335c36ff4c95bca1c05a6616a1dfeb30c74174ab185568ed7b38728ace8494 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/9a335c36ff4c95bca1c05a6616a1dfeb30c74174ab185568ed7b38728ace8494 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/9a335c36ff4c95bca1c05a6616a1dfeb30c74174ab185568ed7b38728ace8494 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/9ab1cdb342c20ab2e55ea8741933b2beac97d98058608550d3919c1547f845c4 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/9ab1cdb342c20ab2e55ea8741933b2beac97d98058608550d3919c1547f845c4 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/9ab1cdb342c20ab2e55ea8741933b2beac97d98058608550d3919c1547f845c4 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/9ab1cdb342c20ab2e55ea8741933b2beac97d98058608550d3919c1547f845c4 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/9ab468d4dfd2e78e211b1dbc168ef65be180c47d0092066277149ac99c5b7d25 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/9ab468d4dfd2e78e211b1dbc168ef65be180c47d0092066277149ac99c5b7d25 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/9ab468d4dfd2e78e211b1dbc168ef65be180c47d0092066277149ac99c5b7d25 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/9ab468d4dfd2e78e211b1dbc168ef65be180c47d0092066277149ac99c5b7d25 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/9c8f4f7693d0375dea1c3267e509ee5d8e70e13122ce4f54e2437a10b8f6a17e b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/9c8f4f7693d0375dea1c3267e509ee5d8e70e13122ce4f54e2437a10b8f6a17e similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/9c8f4f7693d0375dea1c3267e509ee5d8e70e13122ce4f54e2437a10b8f6a17e rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/9c8f4f7693d0375dea1c3267e509ee5d8e70e13122ce4f54e2437a10b8f6a17e diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/a09c7b16586b3555ab07cd6cd6650113f5ee01262475cd8919fec68f14172494 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/a09c7b16586b3555ab07cd6cd6650113f5ee01262475cd8919fec68f14172494 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/a09c7b16586b3555ab07cd6cd6650113f5ee01262475cd8919fec68f14172494 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/a09c7b16586b3555ab07cd6cd6650113f5ee01262475cd8919fec68f14172494 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/a116b23b36e3785ea7a8125166bfa57cd61809b2c06bdad5593da616ce397f44 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/a116b23b36e3785ea7a8125166bfa57cd61809b2c06bdad5593da616ce397f44 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/a116b23b36e3785ea7a8125166bfa57cd61809b2c06bdad5593da616ce397f44 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/a116b23b36e3785ea7a8125166bfa57cd61809b2c06bdad5593da616ce397f44 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/a4da856ae0ed35e1c2aceae198d154a1ca4310d616d7361dd8c46a826ab9e397 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/a4da856ae0ed35e1c2aceae198d154a1ca4310d616d7361dd8c46a826ab9e397 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/a4da856ae0ed35e1c2aceae198d154a1ca4310d616d7361dd8c46a826ab9e397 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/a4da856ae0ed35e1c2aceae198d154a1ca4310d616d7361dd8c46a826ab9e397 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/a5600b686fb93bbc844682842728d0475f00bb3f46d382e6a7cb512d6b264df1 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/a5600b686fb93bbc844682842728d0475f00bb3f46d382e6a7cb512d6b264df1 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/a5600b686fb93bbc844682842728d0475f00bb3f46d382e6a7cb512d6b264df1 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/a5600b686fb93bbc844682842728d0475f00bb3f46d382e6a7cb512d6b264df1 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/a5dbe650d215d7a855a7faa08645c197776171f60752fac78b583e71a5511811 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/a5dbe650d215d7a855a7faa08645c197776171f60752fac78b583e71a5511811 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/a5dbe650d215d7a855a7faa08645c197776171f60752fac78b583e71a5511811 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/a5dbe650d215d7a855a7faa08645c197776171f60752fac78b583e71a5511811 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/a85172ed32cb9920fb7d86ed97919a0c9f8d73c4d9b6affdea889ede19499c9f b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/a85172ed32cb9920fb7d86ed97919a0c9f8d73c4d9b6affdea889ede19499c9f similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/a85172ed32cb9920fb7d86ed97919a0c9f8d73c4d9b6affdea889ede19499c9f rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/a85172ed32cb9920fb7d86ed97919a0c9f8d73c4d9b6affdea889ede19499c9f diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/a8b3b57b2691a472c7593a1b871c17a9f28e23c8f34341870d994a820671cc4d b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/a8b3b57b2691a472c7593a1b871c17a9f28e23c8f34341870d994a820671cc4d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/a8b3b57b2691a472c7593a1b871c17a9f28e23c8f34341870d994a820671cc4d rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/a8b3b57b2691a472c7593a1b871c17a9f28e23c8f34341870d994a820671cc4d diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/a8d8ebde0f02e7343a26b49280948863364865d9229ac48f32764b47c1e3af3d b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/a8d8ebde0f02e7343a26b49280948863364865d9229ac48f32764b47c1e3af3d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/a8d8ebde0f02e7343a26b49280948863364865d9229ac48f32764b47c1e3af3d rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/a8d8ebde0f02e7343a26b49280948863364865d9229ac48f32764b47c1e3af3d diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/aac9473e911eee30fd568a352471a603ac335ac265d794d83850498a822287ab b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/aac9473e911eee30fd568a352471a603ac335ac265d794d83850498a822287ab similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/aac9473e911eee30fd568a352471a603ac335ac265d794d83850498a822287ab rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/aac9473e911eee30fd568a352471a603ac335ac265d794d83850498a822287ab diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/acda985afba50deaa11a1fff4fd2d8e7c5af9996d49c0182a442ec45f830ad95 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/acda985afba50deaa11a1fff4fd2d8e7c5af9996d49c0182a442ec45f830ad95 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/acda985afba50deaa11a1fff4fd2d8e7c5af9996d49c0182a442ec45f830ad95 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/acda985afba50deaa11a1fff4fd2d8e7c5af9996d49c0182a442ec45f830ad95 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b0376a4bd0a6cd9bbdb668748cfb1a8665b5f862aefc3fb87cc4296499029bee b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b0376a4bd0a6cd9bbdb668748cfb1a8665b5f862aefc3fb87cc4296499029bee similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b0376a4bd0a6cd9bbdb668748cfb1a8665b5f862aefc3fb87cc4296499029bee rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b0376a4bd0a6cd9bbdb668748cfb1a8665b5f862aefc3fb87cc4296499029bee diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b0dd4002480ffebee16455509cfd680bb4e2a554e980c9a1f9db0466931a9140 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b0dd4002480ffebee16455509cfd680bb4e2a554e980c9a1f9db0466931a9140 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b0dd4002480ffebee16455509cfd680bb4e2a554e980c9a1f9db0466931a9140 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b0dd4002480ffebee16455509cfd680bb4e2a554e980c9a1f9db0466931a9140 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b183a9491f0d4f40917d8152f442f03d35943fc1810d6e71acec7e52d90fd4fa b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b183a9491f0d4f40917d8152f442f03d35943fc1810d6e71acec7e52d90fd4fa similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b183a9491f0d4f40917d8152f442f03d35943fc1810d6e71acec7e52d90fd4fa rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b183a9491f0d4f40917d8152f442f03d35943fc1810d6e71acec7e52d90fd4fa diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b1b39a0ef8589dfe7ded0c949e968864ed727e0ac582b5087861f95e67f344b9 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b1b39a0ef8589dfe7ded0c949e968864ed727e0ac582b5087861f95e67f344b9 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b1b39a0ef8589dfe7ded0c949e968864ed727e0ac582b5087861f95e67f344b9 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b1b39a0ef8589dfe7ded0c949e968864ed727e0ac582b5087861f95e67f344b9 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b225284f11be24c1a2bfb674d31b269983dadbf55dcf21517d5ce9f70fdf2a28 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b225284f11be24c1a2bfb674d31b269983dadbf55dcf21517d5ce9f70fdf2a28 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b225284f11be24c1a2bfb674d31b269983dadbf55dcf21517d5ce9f70fdf2a28 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b225284f11be24c1a2bfb674d31b269983dadbf55dcf21517d5ce9f70fdf2a28 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b23dd1d88221bdeb6cfafaf52fb21c254e9a1a3a31a2dbda3959bf0c4ba62de1 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b23dd1d88221bdeb6cfafaf52fb21c254e9a1a3a31a2dbda3959bf0c4ba62de1 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b23dd1d88221bdeb6cfafaf52fb21c254e9a1a3a31a2dbda3959bf0c4ba62de1 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b23dd1d88221bdeb6cfafaf52fb21c254e9a1a3a31a2dbda3959bf0c4ba62de1 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b3339f09ff7e058d8fff7f47463617725a7fb50fb8cc8e42287f252dfbdacdc7 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b3339f09ff7e058d8fff7f47463617725a7fb50fb8cc8e42287f252dfbdacdc7 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b3339f09ff7e058d8fff7f47463617725a7fb50fb8cc8e42287f252dfbdacdc7 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b3339f09ff7e058d8fff7f47463617725a7fb50fb8cc8e42287f252dfbdacdc7 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b37ab4551cbeb989239c1a1be7ce27486c39d58b12a0619f828833558ac2a3bc b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b37ab4551cbeb989239c1a1be7ce27486c39d58b12a0619f828833558ac2a3bc similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b37ab4551cbeb989239c1a1be7ce27486c39d58b12a0619f828833558ac2a3bc rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b37ab4551cbeb989239c1a1be7ce27486c39d58b12a0619f828833558ac2a3bc diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b38330199882217b955d0ca1f3caf6bdb7b9061c515888c1d0b8b513ccac3d6d b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b38330199882217b955d0ca1f3caf6bdb7b9061c515888c1d0b8b513ccac3d6d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b38330199882217b955d0ca1f3caf6bdb7b9061c515888c1d0b8b513ccac3d6d rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b38330199882217b955d0ca1f3caf6bdb7b9061c515888c1d0b8b513ccac3d6d diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b3d79a1480be486b055ee7e5c80b378bc3a6c7e7d11fcf002347bddaaf49f5c2 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b3d79a1480be486b055ee7e5c80b378bc3a6c7e7d11fcf002347bddaaf49f5c2 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b3d79a1480be486b055ee7e5c80b378bc3a6c7e7d11fcf002347bddaaf49f5c2 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b3d79a1480be486b055ee7e5c80b378bc3a6c7e7d11fcf002347bddaaf49f5c2 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b535928c3b1056a4005f3d34239ec093ba81e039633dc057392a82a80b745ae3 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b535928c3b1056a4005f3d34239ec093ba81e039633dc057392a82a80b745ae3 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b535928c3b1056a4005f3d34239ec093ba81e039633dc057392a82a80b745ae3 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b535928c3b1056a4005f3d34239ec093ba81e039633dc057392a82a80b745ae3 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b5a2524de82378c9634bac2969fc2362f691694bd42069606461aa7b10e13701 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b5a2524de82378c9634bac2969fc2362f691694bd42069606461aa7b10e13701 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b5a2524de82378c9634bac2969fc2362f691694bd42069606461aa7b10e13701 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b5a2524de82378c9634bac2969fc2362f691694bd42069606461aa7b10e13701 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b82026ff8be287c76554128d2207ea1f477bef88f11464d1df768bdea0dfa7a1 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b82026ff8be287c76554128d2207ea1f477bef88f11464d1df768bdea0dfa7a1 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b82026ff8be287c76554128d2207ea1f477bef88f11464d1df768bdea0dfa7a1 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b82026ff8be287c76554128d2207ea1f477bef88f11464d1df768bdea0dfa7a1 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b8d21148bd96a245deec2137d9f0e97325b45bc6ae939f520a5008e2d3107cc7 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b8d21148bd96a245deec2137d9f0e97325b45bc6ae939f520a5008e2d3107cc7 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b8d21148bd96a245deec2137d9f0e97325b45bc6ae939f520a5008e2d3107cc7 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b8d21148bd96a245deec2137d9f0e97325b45bc6ae939f520a5008e2d3107cc7 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b92f533f8696148791a4d6fbe4182d6b1147e4045d6340f0d1674bed9593300e b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b92f533f8696148791a4d6fbe4182d6b1147e4045d6340f0d1674bed9593300e similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b92f533f8696148791a4d6fbe4182d6b1147e4045d6340f0d1674bed9593300e rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b92f533f8696148791a4d6fbe4182d6b1147e4045d6340f0d1674bed9593300e diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b9b8ad6bb4ce6e344698125accaf610a6e31537b9d8c963c9e72722354bfd729 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b9b8ad6bb4ce6e344698125accaf610a6e31537b9d8c963c9e72722354bfd729 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b9b8ad6bb4ce6e344698125accaf610a6e31537b9d8c963c9e72722354bfd729 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/b9b8ad6bb4ce6e344698125accaf610a6e31537b9d8c963c9e72722354bfd729 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/bae72e2d0939b7fe6ed41a27a07327b1e55a6c57b6064f2d85bbeb516fafa399 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/bae72e2d0939b7fe6ed41a27a07327b1e55a6c57b6064f2d85bbeb516fafa399 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/bae72e2d0939b7fe6ed41a27a07327b1e55a6c57b6064f2d85bbeb516fafa399 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/bae72e2d0939b7fe6ed41a27a07327b1e55a6c57b6064f2d85bbeb516fafa399 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/bb32c2f4e21b7ff418dc30ee02a0d2e8acee613ece2044d799b153cd61fe2257 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/bb32c2f4e21b7ff418dc30ee02a0d2e8acee613ece2044d799b153cd61fe2257 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/bb32c2f4e21b7ff418dc30ee02a0d2e8acee613ece2044d799b153cd61fe2257 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/bb32c2f4e21b7ff418dc30ee02a0d2e8acee613ece2044d799b153cd61fe2257 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/bb9bc9e5925b54bf978b49c910e3b3f485758895f7f5595d7ee0177a9bdf431f b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/bb9bc9e5925b54bf978b49c910e3b3f485758895f7f5595d7ee0177a9bdf431f similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/bb9bc9e5925b54bf978b49c910e3b3f485758895f7f5595d7ee0177a9bdf431f rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/bb9bc9e5925b54bf978b49c910e3b3f485758895f7f5595d7ee0177a9bdf431f diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/bc1afc3e38b64dd795b13d2dd7feb2fe5829ae80efd9dccf05a8f5afc999069f b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/bc1afc3e38b64dd795b13d2dd7feb2fe5829ae80efd9dccf05a8f5afc999069f similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/bc1afc3e38b64dd795b13d2dd7feb2fe5829ae80efd9dccf05a8f5afc999069f rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/bc1afc3e38b64dd795b13d2dd7feb2fe5829ae80efd9dccf05a8f5afc999069f diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/bd758679882f17e21173c0838989b14c5a0c8c07848656bf380e2bc41ed0605d b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/bd758679882f17e21173c0838989b14c5a0c8c07848656bf380e2bc41ed0605d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/bd758679882f17e21173c0838989b14c5a0c8c07848656bf380e2bc41ed0605d rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/bd758679882f17e21173c0838989b14c5a0c8c07848656bf380e2bc41ed0605d diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/bdaf1e2b06aae84fe67d04049bc0eb0067a57fe4f41c73377af2b22119894bd2 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/bdaf1e2b06aae84fe67d04049bc0eb0067a57fe4f41c73377af2b22119894bd2 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/bdaf1e2b06aae84fe67d04049bc0eb0067a57fe4f41c73377af2b22119894bd2 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/bdaf1e2b06aae84fe67d04049bc0eb0067a57fe4f41c73377af2b22119894bd2 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/be47bd8e63202041d982c6aaeeade9e9f1c379325d7d08e964b02b6033a3d2e6 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/be47bd8e63202041d982c6aaeeade9e9f1c379325d7d08e964b02b6033a3d2e6 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/be47bd8e63202041d982c6aaeeade9e9f1c379325d7d08e964b02b6033a3d2e6 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/be47bd8e63202041d982c6aaeeade9e9f1c379325d7d08e964b02b6033a3d2e6 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/bf84e2e961e7b1b92afa454a6deaca9b29593c9e5af8d30682372543f3fc8063 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/bf84e2e961e7b1b92afa454a6deaca9b29593c9e5af8d30682372543f3fc8063 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/bf84e2e961e7b1b92afa454a6deaca9b29593c9e5af8d30682372543f3fc8063 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/bf84e2e961e7b1b92afa454a6deaca9b29593c9e5af8d30682372543f3fc8063 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/bf9f4e1b7ed8ecb6f60ae08feca18236df030df63c3d945deee73c1f12c01d5c b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/bf9f4e1b7ed8ecb6f60ae08feca18236df030df63c3d945deee73c1f12c01d5c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/bf9f4e1b7ed8ecb6f60ae08feca18236df030df63c3d945deee73c1f12c01d5c rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/bf9f4e1b7ed8ecb6f60ae08feca18236df030df63c3d945deee73c1f12c01d5c diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/bfcf07019c888b926c6573df5d7364640c73b8cc8d55204b9a1ced52d225c25e b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/bfcf07019c888b926c6573df5d7364640c73b8cc8d55204b9a1ced52d225c25e similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/bfcf07019c888b926c6573df5d7364640c73b8cc8d55204b9a1ced52d225c25e rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/bfcf07019c888b926c6573df5d7364640c73b8cc8d55204b9a1ced52d225c25e diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/c142879420a90732e2f408b75dd7474ebae396a3ec3eaa216fd299292964d71f b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/c142879420a90732e2f408b75dd7474ebae396a3ec3eaa216fd299292964d71f similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/c142879420a90732e2f408b75dd7474ebae396a3ec3eaa216fd299292964d71f rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/c142879420a90732e2f408b75dd7474ebae396a3ec3eaa216fd299292964d71f diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/c2656c4878eda46355b8aaef086358b68b4753ba9405fc6a12ee8d8017e5fb0e b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/c2656c4878eda46355b8aaef086358b68b4753ba9405fc6a12ee8d8017e5fb0e similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/c2656c4878eda46355b8aaef086358b68b4753ba9405fc6a12ee8d8017e5fb0e rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/c2656c4878eda46355b8aaef086358b68b4753ba9405fc6a12ee8d8017e5fb0e diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/c26c9f9092252d10f7d3f0b3455a21a70d9454e877b131371630c2d6a820e91b b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/c26c9f9092252d10f7d3f0b3455a21a70d9454e877b131371630c2d6a820e91b similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/c26c9f9092252d10f7d3f0b3455a21a70d9454e877b131371630c2d6a820e91b rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/c26c9f9092252d10f7d3f0b3455a21a70d9454e877b131371630c2d6a820e91b diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/c28263cb9293c7b6bb06dec0f072905286fb8e384af1e3338bdf2b4ff491be37 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/c28263cb9293c7b6bb06dec0f072905286fb8e384af1e3338bdf2b4ff491be37 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/c28263cb9293c7b6bb06dec0f072905286fb8e384af1e3338bdf2b4ff491be37 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/c28263cb9293c7b6bb06dec0f072905286fb8e384af1e3338bdf2b4ff491be37 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/c2e5f776dd2f68ddb34ebc0d787a78fa28cca62bb2f9acc345ba97db2ba6fccf b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/c2e5f776dd2f68ddb34ebc0d787a78fa28cca62bb2f9acc345ba97db2ba6fccf similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/c2e5f776dd2f68ddb34ebc0d787a78fa28cca62bb2f9acc345ba97db2ba6fccf rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/c2e5f776dd2f68ddb34ebc0d787a78fa28cca62bb2f9acc345ba97db2ba6fccf diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/c5190b749e2edd2220eebed5ea2474243aeb1b82d3853ebfb7b8c626fc42d4af b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/c5190b749e2edd2220eebed5ea2474243aeb1b82d3853ebfb7b8c626fc42d4af similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/c5190b749e2edd2220eebed5ea2474243aeb1b82d3853ebfb7b8c626fc42d4af rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/c5190b749e2edd2220eebed5ea2474243aeb1b82d3853ebfb7b8c626fc42d4af diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/c7b49b0120e3a76ac8149de9d8878370b1f5ac8d9f5cd8a92d7af1f1c8d2b3b3 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/c7b49b0120e3a76ac8149de9d8878370b1f5ac8d9f5cd8a92d7af1f1c8d2b3b3 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/c7b49b0120e3a76ac8149de9d8878370b1f5ac8d9f5cd8a92d7af1f1c8d2b3b3 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/c7b49b0120e3a76ac8149de9d8878370b1f5ac8d9f5cd8a92d7af1f1c8d2b3b3 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/c7bcdfcdb9e011410faabfe9148396607a088ac44683391a0486ace92a48b868 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/c7bcdfcdb9e011410faabfe9148396607a088ac44683391a0486ace92a48b868 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/c7bcdfcdb9e011410faabfe9148396607a088ac44683391a0486ace92a48b868 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/c7bcdfcdb9e011410faabfe9148396607a088ac44683391a0486ace92a48b868 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/cb42020a41ac83ecdfad3058744b69b4260f6d07dd62e3c31dc493c6c9660016 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/cb42020a41ac83ecdfad3058744b69b4260f6d07dd62e3c31dc493c6c9660016 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/cb42020a41ac83ecdfad3058744b69b4260f6d07dd62e3c31dc493c6c9660016 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/cb42020a41ac83ecdfad3058744b69b4260f6d07dd62e3c31dc493c6c9660016 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/cbf2cb875e0e03549dd8766a514434aab347ddde4a0637a8d8355afd6325eaa1 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/cbf2cb875e0e03549dd8766a514434aab347ddde4a0637a8d8355afd6325eaa1 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/cbf2cb875e0e03549dd8766a514434aab347ddde4a0637a8d8355afd6325eaa1 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/cbf2cb875e0e03549dd8766a514434aab347ddde4a0637a8d8355afd6325eaa1 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/ccf8fda42e5692ac11fb68aaa741b9d8ef6d172646bc85438d3ab521a297238d b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/ccf8fda42e5692ac11fb68aaa741b9d8ef6d172646bc85438d3ab521a297238d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/ccf8fda42e5692ac11fb68aaa741b9d8ef6d172646bc85438d3ab521a297238d rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/ccf8fda42e5692ac11fb68aaa741b9d8ef6d172646bc85438d3ab521a297238d diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/cddcd9c9430688fc0a653f08bc792fde8d2ed215722e6ce68cad5aeff65dcc71 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/cddcd9c9430688fc0a653f08bc792fde8d2ed215722e6ce68cad5aeff65dcc71 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/cddcd9c9430688fc0a653f08bc792fde8d2ed215722e6ce68cad5aeff65dcc71 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/cddcd9c9430688fc0a653f08bc792fde8d2ed215722e6ce68cad5aeff65dcc71 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d0575375ed3237862ad9eaae0973b15c8a333eff4be236ad845e227fad0bb01a b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d0575375ed3237862ad9eaae0973b15c8a333eff4be236ad845e227fad0bb01a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d0575375ed3237862ad9eaae0973b15c8a333eff4be236ad845e227fad0bb01a rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d0575375ed3237862ad9eaae0973b15c8a333eff4be236ad845e227fad0bb01a diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d0616e8b9f30faea1fb50033524b78e36697d3057e8f6914f1670c5e6eedd1a0 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d0616e8b9f30faea1fb50033524b78e36697d3057e8f6914f1670c5e6eedd1a0 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d0616e8b9f30faea1fb50033524b78e36697d3057e8f6914f1670c5e6eedd1a0 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d0616e8b9f30faea1fb50033524b78e36697d3057e8f6914f1670c5e6eedd1a0 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d28fb04694da3db5f947c358ba846273571b12732099b18473d857e355b1b7d6 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d28fb04694da3db5f947c358ba846273571b12732099b18473d857e355b1b7d6 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d28fb04694da3db5f947c358ba846273571b12732099b18473d857e355b1b7d6 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d28fb04694da3db5f947c358ba846273571b12732099b18473d857e355b1b7d6 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d40a98862ed393eb712e47a91bcef18e6f24cf368bb4bd248c7a7101ef8e178d b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d40a98862ed393eb712e47a91bcef18e6f24cf368bb4bd248c7a7101ef8e178d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d40a98862ed393eb712e47a91bcef18e6f24cf368bb4bd248c7a7101ef8e178d rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d40a98862ed393eb712e47a91bcef18e6f24cf368bb4bd248c7a7101ef8e178d diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d6291dae28a9258235611f5dfd1da5c542413b580c5427eaaed0e4276ee60bf2 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d6291dae28a9258235611f5dfd1da5c542413b580c5427eaaed0e4276ee60bf2 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d6291dae28a9258235611f5dfd1da5c542413b580c5427eaaed0e4276ee60bf2 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d6291dae28a9258235611f5dfd1da5c542413b580c5427eaaed0e4276ee60bf2 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d6a32d21b19c90ddf9ade565c8f1ab80bfc3f8588bb83419cb945b005bd634f3 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d6a32d21b19c90ddf9ade565c8f1ab80bfc3f8588bb83419cb945b005bd634f3 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d6a32d21b19c90ddf9ade565c8f1ab80bfc3f8588bb83419cb945b005bd634f3 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d6a32d21b19c90ddf9ade565c8f1ab80bfc3f8588bb83419cb945b005bd634f3 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d6d80ae108c494972c58f93cc4cbcb089820f184bb9bdca5bde8dfebd779c6ef b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d6d80ae108c494972c58f93cc4cbcb089820f184bb9bdca5bde8dfebd779c6ef similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d6d80ae108c494972c58f93cc4cbcb089820f184bb9bdca5bde8dfebd779c6ef rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d6d80ae108c494972c58f93cc4cbcb089820f184bb9bdca5bde8dfebd779c6ef diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d6e0c45d5b0509df39300438ea8baff5a09810efc45a40e3add651935db55098 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d6e0c45d5b0509df39300438ea8baff5a09810efc45a40e3add651935db55098 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d6e0c45d5b0509df39300438ea8baff5a09810efc45a40e3add651935db55098 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d6e0c45d5b0509df39300438ea8baff5a09810efc45a40e3add651935db55098 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d7f76650eb5911c3f2e9af396d195f30db71712fcb64720da40aa5269d30c9bd b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d7f76650eb5911c3f2e9af396d195f30db71712fcb64720da40aa5269d30c9bd similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d7f76650eb5911c3f2e9af396d195f30db71712fcb64720da40aa5269d30c9bd rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d7f76650eb5911c3f2e9af396d195f30db71712fcb64720da40aa5269d30c9bd diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d87fdfd7afc54b797f9bca8b67b95d07f3cad5e31b1ce1f466894bb6ea36aa96 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d87fdfd7afc54b797f9bca8b67b95d07f3cad5e31b1ce1f466894bb6ea36aa96 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d87fdfd7afc54b797f9bca8b67b95d07f3cad5e31b1ce1f466894bb6ea36aa96 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d87fdfd7afc54b797f9bca8b67b95d07f3cad5e31b1ce1f466894bb6ea36aa96 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d93b5237b31728d7cc19cd7e517cfa5126a0e0f19de4144dcdab89da7195e31c b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d93b5237b31728d7cc19cd7e517cfa5126a0e0f19de4144dcdab89da7195e31c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d93b5237b31728d7cc19cd7e517cfa5126a0e0f19de4144dcdab89da7195e31c rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d93b5237b31728d7cc19cd7e517cfa5126a0e0f19de4144dcdab89da7195e31c diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d9480bd11c34125ba4203adac8956359c38d0e5e068b4c6d49e81f7c90dc3ed7 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d9480bd11c34125ba4203adac8956359c38d0e5e068b4c6d49e81f7c90dc3ed7 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d9480bd11c34125ba4203adac8956359c38d0e5e068b4c6d49e81f7c90dc3ed7 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/d9480bd11c34125ba4203adac8956359c38d0e5e068b4c6d49e81f7c90dc3ed7 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/da53a724f3b34f349554e42f7e01e09e7962044b4d5a958744eaba288a0253af b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/da53a724f3b34f349554e42f7e01e09e7962044b4d5a958744eaba288a0253af similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/da53a724f3b34f349554e42f7e01e09e7962044b4d5a958744eaba288a0253af rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/da53a724f3b34f349554e42f7e01e09e7962044b4d5a958744eaba288a0253af diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/dafa63ad780d7ab4d42783987c1c1fec4e42c65240f3c339245710beb3887645 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/dafa63ad780d7ab4d42783987c1c1fec4e42c65240f3c339245710beb3887645 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/dafa63ad780d7ab4d42783987c1c1fec4e42c65240f3c339245710beb3887645 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/dafa63ad780d7ab4d42783987c1c1fec4e42c65240f3c339245710beb3887645 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/dbd8a246c2cffc54f339d5d37f4a235138c3553841b541bfdae437ac939261ad b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/dbd8a246c2cffc54f339d5d37f4a235138c3553841b541bfdae437ac939261ad similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/dbd8a246c2cffc54f339d5d37f4a235138c3553841b541bfdae437ac939261ad rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/dbd8a246c2cffc54f339d5d37f4a235138c3553841b541bfdae437ac939261ad diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/dc1f1329a99359eaf408eedbed109aa5281c21fafa58ceaf8a3030b4b6976b1f b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/dc1f1329a99359eaf408eedbed109aa5281c21fafa58ceaf8a3030b4b6976b1f similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/dc1f1329a99359eaf408eedbed109aa5281c21fafa58ceaf8a3030b4b6976b1f rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/dc1f1329a99359eaf408eedbed109aa5281c21fafa58ceaf8a3030b4b6976b1f diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/dddb65cc3d733f68227e22780460513ee438a69e0bb37e423d1a907964ee6afc b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/dddb65cc3d733f68227e22780460513ee438a69e0bb37e423d1a907964ee6afc similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/dddb65cc3d733f68227e22780460513ee438a69e0bb37e423d1a907964ee6afc rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/dddb65cc3d733f68227e22780460513ee438a69e0bb37e423d1a907964ee6afc diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/dfcb9e179a16275ed3a047ee25186ccb9ad8bafd2e5c47cab862954cac100298 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/dfcb9e179a16275ed3a047ee25186ccb9ad8bafd2e5c47cab862954cac100298 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/dfcb9e179a16275ed3a047ee25186ccb9ad8bafd2e5c47cab862954cac100298 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/dfcb9e179a16275ed3a047ee25186ccb9ad8bafd2e5c47cab862954cac100298 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/dff21c090f4ece73ec02a12059ba942390de4023e42a914fd05d7e10bddd6254 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/dff21c090f4ece73ec02a12059ba942390de4023e42a914fd05d7e10bddd6254 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/dff21c090f4ece73ec02a12059ba942390de4023e42a914fd05d7e10bddd6254 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/dff21c090f4ece73ec02a12059ba942390de4023e42a914fd05d7e10bddd6254 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e0b98d563ada8af6c813823756c5c043b988b6001fc77cad827393ceb25c9c84 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e0b98d563ada8af6c813823756c5c043b988b6001fc77cad827393ceb25c9c84 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e0b98d563ada8af6c813823756c5c043b988b6001fc77cad827393ceb25c9c84 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e0b98d563ada8af6c813823756c5c043b988b6001fc77cad827393ceb25c9c84 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e19d3cf353ae9c747a9379cb643ef6cf8f1dc543f8c37d168581c489124a8ec5 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e19d3cf353ae9c747a9379cb643ef6cf8f1dc543f8c37d168581c489124a8ec5 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e19d3cf353ae9c747a9379cb643ef6cf8f1dc543f8c37d168581c489124a8ec5 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e19d3cf353ae9c747a9379cb643ef6cf8f1dc543f8c37d168581c489124a8ec5 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e1a27059b7dc340bd5d846720078f8ea00d3ac0de8fce9d869ceb81f5f5aa002 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e1a27059b7dc340bd5d846720078f8ea00d3ac0de8fce9d869ceb81f5f5aa002 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e1a27059b7dc340bd5d846720078f8ea00d3ac0de8fce9d869ceb81f5f5aa002 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e1a27059b7dc340bd5d846720078f8ea00d3ac0de8fce9d869ceb81f5f5aa002 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e1c255461588ad5455ec96853a4e9b47f9c6f917022fce58931ffd9e741bb17c b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e1c255461588ad5455ec96853a4e9b47f9c6f917022fce58931ffd9e741bb17c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e1c255461588ad5455ec96853a4e9b47f9c6f917022fce58931ffd9e741bb17c rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e1c255461588ad5455ec96853a4e9b47f9c6f917022fce58931ffd9e741bb17c diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e2d5f2ad7bbe3b9b8f0774f7b6e16798fdb9256683ee021eac10aad467a9f226 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e2d5f2ad7bbe3b9b8f0774f7b6e16798fdb9256683ee021eac10aad467a9f226 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e2d5f2ad7bbe3b9b8f0774f7b6e16798fdb9256683ee021eac10aad467a9f226 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e2d5f2ad7bbe3b9b8f0774f7b6e16798fdb9256683ee021eac10aad467a9f226 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e32be3a9a00cb831bc7a17f458f0e2535c5d76d9faa20282950e369ef3019717 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e32be3a9a00cb831bc7a17f458f0e2535c5d76d9faa20282950e369ef3019717 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e32be3a9a00cb831bc7a17f458f0e2535c5d76d9faa20282950e369ef3019717 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e32be3a9a00cb831bc7a17f458f0e2535c5d76d9faa20282950e369ef3019717 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e368480fcee764052b7d837aed14e38bf4e75d7d3008125ebefae1a548f8484c b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e368480fcee764052b7d837aed14e38bf4e75d7d3008125ebefae1a548f8484c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e368480fcee764052b7d837aed14e38bf4e75d7d3008125ebefae1a548f8484c rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e368480fcee764052b7d837aed14e38bf4e75d7d3008125ebefae1a548f8484c diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e36ecc840cfff9573602f53dbec0e77c6862a79a536ccab5b5031b926e0d03df b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e36ecc840cfff9573602f53dbec0e77c6862a79a536ccab5b5031b926e0d03df similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e36ecc840cfff9573602f53dbec0e77c6862a79a536ccab5b5031b926e0d03df rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e36ecc840cfff9573602f53dbec0e77c6862a79a536ccab5b5031b926e0d03df diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e391875677af83adce78a43e3086cb52aaed79711828ee4c6c1f56a7811c8c02 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e391875677af83adce78a43e3086cb52aaed79711828ee4c6c1f56a7811c8c02 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e391875677af83adce78a43e3086cb52aaed79711828ee4c6c1f56a7811c8c02 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e391875677af83adce78a43e3086cb52aaed79711828ee4c6c1f56a7811c8c02 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e627f8b422642e748e79094953a674dfa2481bc84f64dbeecd0ce38747d58a2d b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e627f8b422642e748e79094953a674dfa2481bc84f64dbeecd0ce38747d58a2d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e627f8b422642e748e79094953a674dfa2481bc84f64dbeecd0ce38747d58a2d rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e627f8b422642e748e79094953a674dfa2481bc84f64dbeecd0ce38747d58a2d diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e71ba214792e2b084b9050679dcdf03f53b564cb57eb32e2082923a5bd92c973 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e71ba214792e2b084b9050679dcdf03f53b564cb57eb32e2082923a5bd92c973 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e71ba214792e2b084b9050679dcdf03f53b564cb57eb32e2082923a5bd92c973 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e71ba214792e2b084b9050679dcdf03f53b564cb57eb32e2082923a5bd92c973 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e7b9e705f9e7c7e83152333e74c884d8fc54289f2ffe36f320e830255558c2d4 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e7b9e705f9e7c7e83152333e74c884d8fc54289f2ffe36f320e830255558c2d4 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e7b9e705f9e7c7e83152333e74c884d8fc54289f2ffe36f320e830255558c2d4 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/e7b9e705f9e7c7e83152333e74c884d8fc54289f2ffe36f320e830255558c2d4 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/ea9506c42e3b39c1d966ec0aae629d883fb99975064045f8e3d2f0d9501f27b9 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/ea9506c42e3b39c1d966ec0aae629d883fb99975064045f8e3d2f0d9501f27b9 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/ea9506c42e3b39c1d966ec0aae629d883fb99975064045f8e3d2f0d9501f27b9 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/ea9506c42e3b39c1d966ec0aae629d883fb99975064045f8e3d2f0d9501f27b9 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/ea9ffd04d8486c9e077d68c014302efe708280c5410d1f214f07f4affff599a5 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/ea9ffd04d8486c9e077d68c014302efe708280c5410d1f214f07f4affff599a5 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/ea9ffd04d8486c9e077d68c014302efe708280c5410d1f214f07f4affff599a5 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/ea9ffd04d8486c9e077d68c014302efe708280c5410d1f214f07f4affff599a5 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/ebc593c2ff7ddc890cf485eee1dea6b688e90b215919d9966db1b354dad564bd b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/ebc593c2ff7ddc890cf485eee1dea6b688e90b215919d9966db1b354dad564bd similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/ebc593c2ff7ddc890cf485eee1dea6b688e90b215919d9966db1b354dad564bd rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/ebc593c2ff7ddc890cf485eee1dea6b688e90b215919d9966db1b354dad564bd diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/ebd71a75db1024efc46fa3fa096e7d5869026a38f7f282180f0121213027bbe4 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/ebd71a75db1024efc46fa3fa096e7d5869026a38f7f282180f0121213027bbe4 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/ebd71a75db1024efc46fa3fa096e7d5869026a38f7f282180f0121213027bbe4 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/ebd71a75db1024efc46fa3fa096e7d5869026a38f7f282180f0121213027bbe4 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/ecc74430084c410e8ddadcce463e7182bb8fad6d10fbe6ebcf5b8dac88d17439 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/ecc74430084c410e8ddadcce463e7182bb8fad6d10fbe6ebcf5b8dac88d17439 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/ecc74430084c410e8ddadcce463e7182bb8fad6d10fbe6ebcf5b8dac88d17439 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/ecc74430084c410e8ddadcce463e7182bb8fad6d10fbe6ebcf5b8dac88d17439 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/edc19243679aea22567477941f16929cf425a5f048b52aba2b6f2723f7b765e1 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/edc19243679aea22567477941f16929cf425a5f048b52aba2b6f2723f7b765e1 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/edc19243679aea22567477941f16929cf425a5f048b52aba2b6f2723f7b765e1 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/edc19243679aea22567477941f16929cf425a5f048b52aba2b6f2723f7b765e1 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/ef7629c7d8acc3a13c19ea5f5aeafd2731e2dd25b486609aa470aeaa2a8879d4 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/ef7629c7d8acc3a13c19ea5f5aeafd2731e2dd25b486609aa470aeaa2a8879d4 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/ef7629c7d8acc3a13c19ea5f5aeafd2731e2dd25b486609aa470aeaa2a8879d4 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/ef7629c7d8acc3a13c19ea5f5aeafd2731e2dd25b486609aa470aeaa2a8879d4 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f1258b13cac0f34312023ed01b9e7a2510b490366a32b87f9d83f60bb079c141 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f1258b13cac0f34312023ed01b9e7a2510b490366a32b87f9d83f60bb079c141 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f1258b13cac0f34312023ed01b9e7a2510b490366a32b87f9d83f60bb079c141 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f1258b13cac0f34312023ed01b9e7a2510b490366a32b87f9d83f60bb079c141 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f2245f4c31dfcae61f237dd1f0e33127caa05517960dbb01bbf14b04bda96d36 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f2245f4c31dfcae61f237dd1f0e33127caa05517960dbb01bbf14b04bda96d36 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f2245f4c31dfcae61f237dd1f0e33127caa05517960dbb01bbf14b04bda96d36 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f2245f4c31dfcae61f237dd1f0e33127caa05517960dbb01bbf14b04bda96d36 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f22afedbc51b2c5cc0701d585af0dae83e2e3b6943d80e086e2b660f201619b4 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f22afedbc51b2c5cc0701d585af0dae83e2e3b6943d80e086e2b660f201619b4 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f22afedbc51b2c5cc0701d585af0dae83e2e3b6943d80e086e2b660f201619b4 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f22afedbc51b2c5cc0701d585af0dae83e2e3b6943d80e086e2b660f201619b4 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f2a4e838c73a6084f6ff2e9ea08b0c4699309b0c2a1cea1b0c37732c5811ee07 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f2a4e838c73a6084f6ff2e9ea08b0c4699309b0c2a1cea1b0c37732c5811ee07 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f2a4e838c73a6084f6ff2e9ea08b0c4699309b0c2a1cea1b0c37732c5811ee07 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f2a4e838c73a6084f6ff2e9ea08b0c4699309b0c2a1cea1b0c37732c5811ee07 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f3a559f0cbba1ffe2817a099c3c936e90b0f8b3aee1ffeb951ea6fbb727107b0 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f3a559f0cbba1ffe2817a099c3c936e90b0f8b3aee1ffeb951ea6fbb727107b0 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f3a559f0cbba1ffe2817a099c3c936e90b0f8b3aee1ffeb951ea6fbb727107b0 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f3a559f0cbba1ffe2817a099c3c936e90b0f8b3aee1ffeb951ea6fbb727107b0 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f458a52f9a4ec95958e134c42685f4f33403103965722a8766dd04c35146eba0 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f458a52f9a4ec95958e134c42685f4f33403103965722a8766dd04c35146eba0 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f458a52f9a4ec95958e134c42685f4f33403103965722a8766dd04c35146eba0 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f458a52f9a4ec95958e134c42685f4f33403103965722a8766dd04c35146eba0 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f47d5b39d0280a412af55f8358cf5c8d6d401e009000f268ee5251d4afc7ec55 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f47d5b39d0280a412af55f8358cf5c8d6d401e009000f268ee5251d4afc7ec55 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f47d5b39d0280a412af55f8358cf5c8d6d401e009000f268ee5251d4afc7ec55 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f47d5b39d0280a412af55f8358cf5c8d6d401e009000f268ee5251d4afc7ec55 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f4b2d86b922af33b69d7e03f982082bdecbf81986bdf41169e5bb0b2dec79795 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f4b2d86b922af33b69d7e03f982082bdecbf81986bdf41169e5bb0b2dec79795 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f4b2d86b922af33b69d7e03f982082bdecbf81986bdf41169e5bb0b2dec79795 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f4b2d86b922af33b69d7e03f982082bdecbf81986bdf41169e5bb0b2dec79795 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f4c40d979e6651c5e9087524a2217f4204b1a30f1277fb8b3ba5da91c7dc5fd3 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f4c40d979e6651c5e9087524a2217f4204b1a30f1277fb8b3ba5da91c7dc5fd3 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f4c40d979e6651c5e9087524a2217f4204b1a30f1277fb8b3ba5da91c7dc5fd3 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f4c40d979e6651c5e9087524a2217f4204b1a30f1277fb8b3ba5da91c7dc5fd3 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f52a05c0c6cca0ba62d7c1a4e84fe2071aa220def12c6199d0c0a5e62f8f184c b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f52a05c0c6cca0ba62d7c1a4e84fe2071aa220def12c6199d0c0a5e62f8f184c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f52a05c0c6cca0ba62d7c1a4e84fe2071aa220def12c6199d0c0a5e62f8f184c rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f52a05c0c6cca0ba62d7c1a4e84fe2071aa220def12c6199d0c0a5e62f8f184c diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f658193f17966b6c8af9fdaaf2ee4e077cf7df565dad2b599a57d00b6e74a688 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f658193f17966b6c8af9fdaaf2ee4e077cf7df565dad2b599a57d00b6e74a688 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f658193f17966b6c8af9fdaaf2ee4e077cf7df565dad2b599a57d00b6e74a688 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f658193f17966b6c8af9fdaaf2ee4e077cf7df565dad2b599a57d00b6e74a688 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f857c707f431949f12a5d834e519603394b735910dd06abc8e6da58a0364d63d b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f857c707f431949f12a5d834e519603394b735910dd06abc8e6da58a0364d63d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f857c707f431949f12a5d834e519603394b735910dd06abc8e6da58a0364d63d rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f857c707f431949f12a5d834e519603394b735910dd06abc8e6da58a0364d63d diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f8593031ab9f30c6d4db9a5988bdc0129d7b82d7937b70ee7ebd0c3c9fc48d16 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f8593031ab9f30c6d4db9a5988bdc0129d7b82d7937b70ee7ebd0c3c9fc48d16 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f8593031ab9f30c6d4db9a5988bdc0129d7b82d7937b70ee7ebd0c3c9fc48d16 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/f8593031ab9f30c6d4db9a5988bdc0129d7b82d7937b70ee7ebd0c3c9fc48d16 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/fb97eae80186b37adefe64bcf72c4525851b12d515a77b12e1d2ff26ef2a1075 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/fb97eae80186b37adefe64bcf72c4525851b12d515a77b12e1d2ff26ef2a1075 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/fb97eae80186b37adefe64bcf72c4525851b12d515a77b12e1d2ff26ef2a1075 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/fb97eae80186b37adefe64bcf72c4525851b12d515a77b12e1d2ff26ef2a1075 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/fd6590cf4b38f02830a92d68d32413d9b879c72a3e884121aa9a5fa2f6b5c77c b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/fd6590cf4b38f02830a92d68d32413d9b879c72a3e884121aa9a5fa2f6b5c77c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/fd6590cf4b38f02830a92d68d32413d9b879c72a3e884121aa9a5fa2f6b5c77c rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/fd6590cf4b38f02830a92d68d32413d9b879c72a3e884121aa9a5fa2f6b5c77c diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/fe3b0a44aada74df8547828f410d3f066e438b92a87c6106d3d6bd596bc7cb60 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/fe3b0a44aada74df8547828f410d3f066e438b92a87c6106d3d6bd596bc7cb60 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/fe3b0a44aada74df8547828f410d3f066e438b92a87c6106d3d6bd596bc7cb60 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/fe3b0a44aada74df8547828f410d3f066e438b92a87c6106d3d6bd596bc7cb60 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/ff2251ed0e6ac5129a6b2023d696b9c28e7bcf76555d5b917f010ab192430293 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/ff2251ed0e6ac5129a6b2023d696b9c28e7bcf76555d5b917f010ab192430293 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/ff2251ed0e6ac5129a6b2023d696b9c28e7bcf76555d5b917f010ab192430293 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/ff2251ed0e6ac5129a6b2023d696b9c28e7bcf76555d5b917f010ab192430293 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/ff6f69a3a32954ce2090053d3289ba8f4f4169dac4805de1f758961021f92ee1 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/ff6f69a3a32954ce2090053d3289ba8f4f4169dac4805de1f758961021f92ee1 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/ff6f69a3a32954ce2090053d3289ba8f4f4169dac4805de1f758961021f92ee1 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoHDNewParamsFromPath/ff6f69a3a32954ce2090053d3289ba8f4f4169dac4805de1f758961021f92ee1 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/050f4b2d17cdd133693cb4b022df80c5b0f35c75cd1105bbcb321687556b6296 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/050f4b2d17cdd133693cb4b022df80c5b0f35c75cd1105bbcb321687556b6296 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/050f4b2d17cdd133693cb4b022df80c5b0f35c75cd1105bbcb321687556b6296 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/050f4b2d17cdd133693cb4b022df80c5b0f35c75cd1105bbcb321687556b6296 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/1d055c834a02e0ce80c17ecdffdb1f2a3c5fa2c2acb2e823e2cde9b607b42c9f b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/1d055c834a02e0ce80c17ecdffdb1f2a3c5fa2c2acb2e823e2cde9b607b42c9f similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/1d055c834a02e0ce80c17ecdffdb1f2a3c5fa2c2acb2e823e2cde9b607b42c9f rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/1d055c834a02e0ce80c17ecdffdb1f2a3c5fa2c2acb2e823e2cde9b607b42c9f diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/2fc5e11ceea148f40ce2e265a20ffd0d4cf1e5e9fa0473c02ac80821c5f0aeeb b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/2fc5e11ceea148f40ce2e265a20ffd0d4cf1e5e9fa0473c02ac80821c5f0aeeb similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/2fc5e11ceea148f40ce2e265a20ffd0d4cf1e5e9fa0473c02ac80821c5f0aeeb rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/2fc5e11ceea148f40ce2e265a20ffd0d4cf1e5e9fa0473c02ac80821c5f0aeeb diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/4f313315a1921a9c72e16ae69332b48ae0bb6313ea51991a0aa68cd4788c374b b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/4f313315a1921a9c72e16ae69332b48ae0bb6313ea51991a0aa68cd4788c374b similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/4f313315a1921a9c72e16ae69332b48ae0bb6313ea51991a0aa68cd4788c374b rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/4f313315a1921a9c72e16ae69332b48ae0bb6313ea51991a0aa68cd4788c374b diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/4f7dd0d0442b0938244e61bb29e904fae0bc52b541f909e35ffe16b1105fc606 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/4f7dd0d0442b0938244e61bb29e904fae0bc52b541f909e35ffe16b1105fc606 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/4f7dd0d0442b0938244e61bb29e904fae0bc52b541f909e35ffe16b1105fc606 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/4f7dd0d0442b0938244e61bb29e904fae0bc52b541f909e35ffe16b1105fc606 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/521cc51047cffbddb9289df9ae071872ab44bb6122cfc2066808e4d6ccefcf77 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/521cc51047cffbddb9289df9ae071872ab44bb6122cfc2066808e4d6ccefcf77 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/521cc51047cffbddb9289df9ae071872ab44bb6122cfc2066808e4d6ccefcf77 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/521cc51047cffbddb9289df9ae071872ab44bb6122cfc2066808e4d6ccefcf77 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/6ae6b4a7bf44f9987214a7ffadadb4abdeae85aee20328f4db1eeab89f55a7f2 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/6ae6b4a7bf44f9987214a7ffadadb4abdeae85aee20328f4db1eeab89f55a7f2 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/6ae6b4a7bf44f9987214a7ffadadb4abdeae85aee20328f4db1eeab89f55a7f2 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/6ae6b4a7bf44f9987214a7ffadadb4abdeae85aee20328f4db1eeab89f55a7f2 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/6b94c29a3536d5e66daf95e4ffa238697684c09341da75a7bcedb5cd89e9e226 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/6b94c29a3536d5e66daf95e4ffa238697684c09341da75a7bcedb5cd89e9e226 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/6b94c29a3536d5e66daf95e4ffa238697684c09341da75a7bcedb5cd89e9e226 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/6b94c29a3536d5e66daf95e4ffa238697684c09341da75a7bcedb5cd89e9e226 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/6e092e7e4371083dc3641983e113072a853576040f1c0d53aadd44df4e74adfc b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/6e092e7e4371083dc3641983e113072a853576040f1c0d53aadd44df4e74adfc similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/6e092e7e4371083dc3641983e113072a853576040f1c0d53aadd44df4e74adfc rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/6e092e7e4371083dc3641983e113072a853576040f1c0d53aadd44df4e74adfc diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/7b802fa115afbde7d3ba8ac9494607c9cc72fc097ddbeaa7eee8db4f6e0a86ee b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/7b802fa115afbde7d3ba8ac9494607c9cc72fc097ddbeaa7eee8db4f6e0a86ee similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/7b802fa115afbde7d3ba8ac9494607c9cc72fc097ddbeaa7eee8db4f6e0a86ee rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/7b802fa115afbde7d3ba8ac9494607c9cc72fc097ddbeaa7eee8db4f6e0a86ee diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/7e1e350beaae2ede7344caae5ba1f05d290f55b23462575b62769f167ae0f628 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/7e1e350beaae2ede7344caae5ba1f05d290f55b23462575b62769f167ae0f628 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/7e1e350beaae2ede7344caae5ba1f05d290f55b23462575b62769f167ae0f628 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/7e1e350beaae2ede7344caae5ba1f05d290f55b23462575b62769f167ae0f628 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/b7fa1f199669c7928404af0d598f8e34911400913afafe8a64c592a96b3ce56a b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/b7fa1f199669c7928404af0d598f8e34911400913afafe8a64c592a96b3ce56a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/b7fa1f199669c7928404af0d598f8e34911400913afafe8a64c592a96b3ce56a rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/b7fa1f199669c7928404af0d598f8e34911400913afafe8a64c592a96b3ce56a diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/bff2c9ad3af26e24892c9a7eb3617efab1d7b69f7801a3d54903694f0aa80703 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/bff2c9ad3af26e24892c9a7eb3617efab1d7b69f7801a3d54903694f0aa80703 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/bff2c9ad3af26e24892c9a7eb3617efab1d7b69f7801a3d54903694f0aa80703 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/bff2c9ad3af26e24892c9a7eb3617efab1d7b69f7801a3d54903694f0aa80703 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/c99f299d74abb39dad842a0b827a033426a56230b57164b879af20ed3dfd43ba b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/c99f299d74abb39dad842a0b827a033426a56230b57164b879af20ed3dfd43ba similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/c99f299d74abb39dad842a0b827a033426a56230b57164b879af20ed3dfd43ba rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/c99f299d74abb39dad842a0b827a033426a56230b57164b879af20ed3dfd43ba diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/cb751c5ebf4284fb9710ac5ea3cd779edacc46a8caf4a3935aed091b7843602d b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/cb751c5ebf4284fb9710ac5ea3cd779edacc46a8caf4a3935aed091b7843602d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/cb751c5ebf4284fb9710ac5ea3cd779edacc46a8caf4a3935aed091b7843602d rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/cb751c5ebf4284fb9710ac5ea3cd779edacc46a8caf4a3935aed091b7843602d diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/d40a98862ed393eb712e47a91bcef18e6f24cf368bb4bd248c7a7101ef8e178d b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/d40a98862ed393eb712e47a91bcef18e6f24cf368bb4bd248c7a7101ef8e178d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/d40a98862ed393eb712e47a91bcef18e6f24cf368bb4bd248c7a7101ef8e178d rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/d40a98862ed393eb712e47a91bcef18e6f24cf368bb4bd248c7a7101ef8e178d diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/da4549117b5857c425d7c965c021eacd437cac40fd9f62cfc8eb5892bb65cc97 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/da4549117b5857c425d7c965c021eacd437cac40fd9f62cfc8eb5892bb65cc97 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/da4549117b5857c425d7c965c021eacd437cac40fd9f62cfc8eb5892bb65cc97 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/da4549117b5857c425d7c965c021eacd437cac40fd9f62cfc8eb5892bb65cc97 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/e1c52a0edb40ea5f16558fd44c7273bf3bd4a9d6005143e2221d801360746a49 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/e1c52a0edb40ea5f16558fd44c7273bf3bd4a9d6005143e2221d801360746a49 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/e1c52a0edb40ea5f16558fd44c7273bf3bd4a9d6005143e2221d801360746a49 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/e1c52a0edb40ea5f16558fd44c7273bf3bd4a9d6005143e2221d801360746a49 diff --git a/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/f9d7a758b11682242715e4916bceb9e90b16d131607273ca1647325ecd74d5b6 b/tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/f9d7a758b11682242715e4916bceb9e90b16d131607273ca1647325ecd74d5b6 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/f9d7a758b11682242715e4916bceb9e90b16d131607273ca1647325ecd74d5b6 rename to tests/fuzz/tests/testdata/fuzz/FuzzCryptoTypesCompactbitarrayMarshalUnmarshal/f9d7a758b11682242715e4916bceb9e90b16d131607273ca1647325ecd74d5b6 diff --git a/fuzz/tests/testdata/fuzz/FuzzStoreInternalProofsCreateNonmembershipProof/08c0d81622e8884bc3da70f49175b92d5b74742ff0d650646c7f751a54c6522c b/tests/fuzz/tests/testdata/fuzz/FuzzStoreInternalProofsCreateNonmembershipProof/08c0d81622e8884bc3da70f49175b92d5b74742ff0d650646c7f751a54c6522c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzStoreInternalProofsCreateNonmembershipProof/08c0d81622e8884bc3da70f49175b92d5b74742ff0d650646c7f751a54c6522c rename to tests/fuzz/tests/testdata/fuzz/FuzzStoreInternalProofsCreateNonmembershipProof/08c0d81622e8884bc3da70f49175b92d5b74742ff0d650646c7f751a54c6522c diff --git a/fuzz/tests/testdata/fuzz/FuzzStoreInternalProofsCreateNonmembershipProof/13fd84e8d1574b1f1834b6551f512ca7e73dc9a551028e25ca5ae265d2aab885 b/tests/fuzz/tests/testdata/fuzz/FuzzStoreInternalProofsCreateNonmembershipProof/13fd84e8d1574b1f1834b6551f512ca7e73dc9a551028e25ca5ae265d2aab885 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzStoreInternalProofsCreateNonmembershipProof/13fd84e8d1574b1f1834b6551f512ca7e73dc9a551028e25ca5ae265d2aab885 rename to tests/fuzz/tests/testdata/fuzz/FuzzStoreInternalProofsCreateNonmembershipProof/13fd84e8d1574b1f1834b6551f512ca7e73dc9a551028e25ca5ae265d2aab885 diff --git a/fuzz/tests/testdata/fuzz/FuzzStoreInternalProofsCreateNonmembershipProof/4d7a407caeaf7dd7f63631817d3e1e308761afb8cbb0900e392e8f391533c01d b/tests/fuzz/tests/testdata/fuzz/FuzzStoreInternalProofsCreateNonmembershipProof/4d7a407caeaf7dd7f63631817d3e1e308761afb8cbb0900e392e8f391533c01d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzStoreInternalProofsCreateNonmembershipProof/4d7a407caeaf7dd7f63631817d3e1e308761afb8cbb0900e392e8f391533c01d rename to tests/fuzz/tests/testdata/fuzz/FuzzStoreInternalProofsCreateNonmembershipProof/4d7a407caeaf7dd7f63631817d3e1e308761afb8cbb0900e392e8f391533c01d diff --git a/fuzz/tests/testdata/fuzz/FuzzStoreInternalProofsCreateNonmembershipProof/58da2357b6cb693e2a86059a85972092e07424bfddbe4c82ca9ab2b7baf7d162 b/tests/fuzz/tests/testdata/fuzz/FuzzStoreInternalProofsCreateNonmembershipProof/58da2357b6cb693e2a86059a85972092e07424bfddbe4c82ca9ab2b7baf7d162 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzStoreInternalProofsCreateNonmembershipProof/58da2357b6cb693e2a86059a85972092e07424bfddbe4c82ca9ab2b7baf7d162 rename to tests/fuzz/tests/testdata/fuzz/FuzzStoreInternalProofsCreateNonmembershipProof/58da2357b6cb693e2a86059a85972092e07424bfddbe4c82ca9ab2b7baf7d162 diff --git a/fuzz/tests/testdata/fuzz/FuzzStoreInternalProofsCreateNonmembershipProof/88a4f1757459b6fd93c036b38dfd69565a2e7121543d356d209504dce8b1c528 b/tests/fuzz/tests/testdata/fuzz/FuzzStoreInternalProofsCreateNonmembershipProof/88a4f1757459b6fd93c036b38dfd69565a2e7121543d356d209504dce8b1c528 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzStoreInternalProofsCreateNonmembershipProof/88a4f1757459b6fd93c036b38dfd69565a2e7121543d356d209504dce8b1c528 rename to tests/fuzz/tests/testdata/fuzz/FuzzStoreInternalProofsCreateNonmembershipProof/88a4f1757459b6fd93c036b38dfd69565a2e7121543d356d209504dce8b1c528 diff --git a/fuzz/tests/testdata/fuzz/FuzzStoreInternalProofsCreateNonmembershipProof/c051f53001c70ffeda1f3158edce1432e8e2a73d25f5476ed8119f1b9ac331dd b/tests/fuzz/tests/testdata/fuzz/FuzzStoreInternalProofsCreateNonmembershipProof/c051f53001c70ffeda1f3158edce1432e8e2a73d25f5476ed8119f1b9ac331dd similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzStoreInternalProofsCreateNonmembershipProof/c051f53001c70ffeda1f3158edce1432e8e2a73d25f5476ed8119f1b9ac331dd rename to tests/fuzz/tests/testdata/fuzz/FuzzStoreInternalProofsCreateNonmembershipProof/c051f53001c70ffeda1f3158edce1432e8e2a73d25f5476ed8119f1b9ac331dd diff --git a/fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/032a49387d4ed424cd1111a6acaa3534b5b54283cc966e3e6024c2575d67f141 b/tests/fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/032a49387d4ed424cd1111a6acaa3534b5b54283cc966e3e6024c2575d67f141 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/032a49387d4ed424cd1111a6acaa3534b5b54283cc966e3e6024c2575d67f141 rename to tests/fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/032a49387d4ed424cd1111a6acaa3534b5b54283cc966e3e6024c2575d67f141 diff --git a/fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/1aa3d53343156d06837a34f81e99f773fbb3862f804d1f8d1ad3b79121419e60 b/tests/fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/1aa3d53343156d06837a34f81e99f773fbb3862f804d1f8d1ad3b79121419e60 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/1aa3d53343156d06837a34f81e99f773fbb3862f804d1f8d1ad3b79121419e60 rename to tests/fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/1aa3d53343156d06837a34f81e99f773fbb3862f804d1f8d1ad3b79121419e60 diff --git a/fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/1f0b795ec9ed68c6d97b345b76910b362fe7a0f38be363d6ef6ca06a9e01c3f6 b/tests/fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/1f0b795ec9ed68c6d97b345b76910b362fe7a0f38be363d6ef6ca06a9e01c3f6 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/1f0b795ec9ed68c6d97b345b76910b362fe7a0f38be363d6ef6ca06a9e01c3f6 rename to tests/fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/1f0b795ec9ed68c6d97b345b76910b362fe7a0f38be363d6ef6ca06a9e01c3f6 diff --git a/fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/2cc8c872efdfee0b40c4522ca980a4d407b27d93626621df3015758476f9594f b/tests/fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/2cc8c872efdfee0b40c4522ca980a4d407b27d93626621df3015758476f9594f similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/2cc8c872efdfee0b40c4522ca980a4d407b27d93626621df3015758476f9594f rename to tests/fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/2cc8c872efdfee0b40c4522ca980a4d407b27d93626621df3015758476f9594f diff --git a/fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/53925b4a6a51118078cb5259662c168d1c7d21adc12fb224d46033367213f620 b/tests/fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/53925b4a6a51118078cb5259662c168d1c7d21adc12fb224d46033367213f620 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/53925b4a6a51118078cb5259662c168d1c7d21adc12fb224d46033367213f620 rename to tests/fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/53925b4a6a51118078cb5259662c168d1c7d21adc12fb224d46033367213f620 diff --git a/fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/68de7fc294bd8f590af4c19ce6de247b2e92c59351c948baf883598b4dac4836 b/tests/fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/68de7fc294bd8f590af4c19ce6de247b2e92c59351c948baf883598b4dac4836 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/68de7fc294bd8f590af4c19ce6de247b2e92c59351c948baf883598b4dac4836 rename to tests/fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/68de7fc294bd8f590af4c19ce6de247b2e92c59351c948baf883598b4dac4836 diff --git a/fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/7ece4397f03ed3dc3dd0f253ed004da0fd7482657396c2f1d8928c4b692ed0f5 b/tests/fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/7ece4397f03ed3dc3dd0f253ed004da0fd7482657396c2f1d8928c4b692ed0f5 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/7ece4397f03ed3dc3dd0f253ed004da0fd7482657396c2f1d8928c4b692ed0f5 rename to tests/fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/7ece4397f03ed3dc3dd0f253ed004da0fd7482657396c2f1d8928c4b692ed0f5 diff --git a/fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/89463bd9558fdd2baf6d979376d60bdcad4812f60c46b49ea2928deab49f1b88 b/tests/fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/89463bd9558fdd2baf6d979376d60bdcad4812f60c46b49ea2928deab49f1b88 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/89463bd9558fdd2baf6d979376d60bdcad4812f60c46b49ea2928deab49f1b88 rename to tests/fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/89463bd9558fdd2baf6d979376d60bdcad4812f60c46b49ea2928deab49f1b88 diff --git a/fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/bfd006f5d82b7e754771094092355f6744ff822a3fa2e04fc27fffa04ff7d02c b/tests/fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/bfd006f5d82b7e754771094092355f6744ff822a3fa2e04fc27fffa04ff7d02c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/bfd006f5d82b7e754771094092355f6744ff822a3fa2e04fc27fffa04ff7d02c rename to tests/fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/bfd006f5d82b7e754771094092355f6744ff822a3fa2e04fc27fffa04ff7d02c diff --git a/fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/d40a98862ed393eb712e47a91bcef18e6f24cf368bb4bd248c7a7101ef8e178d b/tests/fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/d40a98862ed393eb712e47a91bcef18e6f24cf368bb4bd248c7a7101ef8e178d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/d40a98862ed393eb712e47a91bcef18e6f24cf368bb4bd248c7a7101ef8e178d rename to tests/fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/d40a98862ed393eb712e47a91bcef18e6f24cf368bb4bd248c7a7101ef8e178d diff --git a/fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/e6371d04f4239fa010a7d02770d05da5fe80bee69e160a5cbf7f7b63d1ec67b5 b/tests/fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/e6371d04f4239fa010a7d02770d05da5fe80bee69e160a5cbf7f7b63d1ec67b5 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/e6371d04f4239fa010a7d02770d05da5fe80bee69e160a5cbf7f7b63d1ec67b5 rename to tests/fuzz/tests/testdata/fuzz/FuzzTendermintAminoDecodeTime/e6371d04f4239fa010a7d02770d05da5fe80bee69e160a5cbf7f7b63d1ec67b5 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/02e29430bbb5c494adc0c6bb37a576fa2932a5540cad61592790c842c19491b8 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/02e29430bbb5c494adc0c6bb37a576fa2932a5540cad61592790c842c19491b8 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/02e29430bbb5c494adc0c6bb37a576fa2932a5540cad61592790c842c19491b8 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/02e29430bbb5c494adc0c6bb37a576fa2932a5540cad61592790c842c19491b8 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/03975f36f3be226dc54a7472f3fdda1c46da06fdd10cf5f597eaa977c7d121f0 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/03975f36f3be226dc54a7472f3fdda1c46da06fdd10cf5f597eaa977c7d121f0 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/03975f36f3be226dc54a7472f3fdda1c46da06fdd10cf5f597eaa977c7d121f0 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/03975f36f3be226dc54a7472f3fdda1c46da06fdd10cf5f597eaa977c7d121f0 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/0689139cc054e3260de071c5748588b9501a93ab8122a09cd2f97f171609b85f b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/0689139cc054e3260de071c5748588b9501a93ab8122a09cd2f97f171609b85f similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/0689139cc054e3260de071c5748588b9501a93ab8122a09cd2f97f171609b85f rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/0689139cc054e3260de071c5748588b9501a93ab8122a09cd2f97f171609b85f diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/12339ba8e4d6c336f3f28eba27204523355009242d6bf083f845ca8bd4ad9b56 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/12339ba8e4d6c336f3f28eba27204523355009242d6bf083f845ca8bd4ad9b56 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/12339ba8e4d6c336f3f28eba27204523355009242d6bf083f845ca8bd4ad9b56 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/12339ba8e4d6c336f3f28eba27204523355009242d6bf083f845ca8bd4ad9b56 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/13e348fb99a69e297654eb182d4cb0e55cf5a5bcd6265949a63bcd0bf2651e0c b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/13e348fb99a69e297654eb182d4cb0e55cf5a5bcd6265949a63bcd0bf2651e0c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/13e348fb99a69e297654eb182d4cb0e55cf5a5bcd6265949a63bcd0bf2651e0c rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/13e348fb99a69e297654eb182d4cb0e55cf5a5bcd6265949a63bcd0bf2651e0c diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/16539c8e19931f0a4a966a3dad5038ec72093b6528625ae641c6b21ce8716c4f b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/16539c8e19931f0a4a966a3dad5038ec72093b6528625ae641c6b21ce8716c4f similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/16539c8e19931f0a4a966a3dad5038ec72093b6528625ae641c6b21ce8716c4f rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/16539c8e19931f0a4a966a3dad5038ec72093b6528625ae641c6b21ce8716c4f diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/18ea91f5d341517685acce4847b150b1b5309d651373ecd8c18830e25cc193fb b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/18ea91f5d341517685acce4847b150b1b5309d651373ecd8c18830e25cc193fb similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/18ea91f5d341517685acce4847b150b1b5309d651373ecd8c18830e25cc193fb rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/18ea91f5d341517685acce4847b150b1b5309d651373ecd8c18830e25cc193fb diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/1aae12d1dfbef7602d05ba4944b621af134372886dea15b3ec77401963545b93 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/1aae12d1dfbef7602d05ba4944b621af134372886dea15b3ec77401963545b93 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/1aae12d1dfbef7602d05ba4944b621af134372886dea15b3ec77401963545b93 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/1aae12d1dfbef7602d05ba4944b621af134372886dea15b3ec77401963545b93 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/1bba1aa478111cb9c16642dfe18d83d02c68a36f08fa15509ac78543d591d21f b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/1bba1aa478111cb9c16642dfe18d83d02c68a36f08fa15509ac78543d591d21f similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/1bba1aa478111cb9c16642dfe18d83d02c68a36f08fa15509ac78543d591d21f rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/1bba1aa478111cb9c16642dfe18d83d02c68a36f08fa15509ac78543d591d21f diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/23267ca1b9cdb299c3647ac813ed36d35154bdcb9b6e9c917a3e3da8ba2143c3 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/23267ca1b9cdb299c3647ac813ed36d35154bdcb9b6e9c917a3e3da8ba2143c3 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/23267ca1b9cdb299c3647ac813ed36d35154bdcb9b6e9c917a3e3da8ba2143c3 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/23267ca1b9cdb299c3647ac813ed36d35154bdcb9b6e9c917a3e3da8ba2143c3 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/249d28d0c6119ac8e89ebda444ab4385160ed93783ef33dfb6647a38fb6f3bcc b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/249d28d0c6119ac8e89ebda444ab4385160ed93783ef33dfb6647a38fb6f3bcc similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/249d28d0c6119ac8e89ebda444ab4385160ed93783ef33dfb6647a38fb6f3bcc rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/249d28d0c6119ac8e89ebda444ab4385160ed93783ef33dfb6647a38fb6f3bcc diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/2bef9b901a1bd70a6884ef2b57422cd7a04f420d192161b6f5ec0b22c304c8cf b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/2bef9b901a1bd70a6884ef2b57422cd7a04f420d192161b6f5ec0b22c304c8cf similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/2bef9b901a1bd70a6884ef2b57422cd7a04f420d192161b6f5ec0b22c304c8cf rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/2bef9b901a1bd70a6884ef2b57422cd7a04f420d192161b6f5ec0b22c304c8cf diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/2f82caf3108a3e865c251b8c4b37fc6ec9ce21262262f7c8ae91f9dce8f7842d b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/2f82caf3108a3e865c251b8c4b37fc6ec9ce21262262f7c8ae91f9dce8f7842d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/2f82caf3108a3e865c251b8c4b37fc6ec9ce21262262f7c8ae91f9dce8f7842d rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/2f82caf3108a3e865c251b8c4b37fc6ec9ce21262262f7c8ae91f9dce8f7842d diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/3023e1aa0b8666500f42b4d41455d94c97e288547558d780ca45fdffc42843a3 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/3023e1aa0b8666500f42b4d41455d94c97e288547558d780ca45fdffc42843a3 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/3023e1aa0b8666500f42b4d41455d94c97e288547558d780ca45fdffc42843a3 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/3023e1aa0b8666500f42b4d41455d94c97e288547558d780ca45fdffc42843a3 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/3137056a6e48e6407bf2b9465f825ef493404b03f9623c959d9c308348ddc361 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/3137056a6e48e6407bf2b9465f825ef493404b03f9623c959d9c308348ddc361 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/3137056a6e48e6407bf2b9465f825ef493404b03f9623c959d9c308348ddc361 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/3137056a6e48e6407bf2b9465f825ef493404b03f9623c959d9c308348ddc361 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/31a4fe5cf0921d06d57608e30ace3a2473fdd75c5f27916c35fb206499cc6fd2 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/31a4fe5cf0921d06d57608e30ace3a2473fdd75c5f27916c35fb206499cc6fd2 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/31a4fe5cf0921d06d57608e30ace3a2473fdd75c5f27916c35fb206499cc6fd2 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/31a4fe5cf0921d06d57608e30ace3a2473fdd75c5f27916c35fb206499cc6fd2 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/31df89fdf858be72b33d6b321ffd7186494671ca7f3977fda65893dcecbe2620 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/31df89fdf858be72b33d6b321ffd7186494671ca7f3977fda65893dcecbe2620 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/31df89fdf858be72b33d6b321ffd7186494671ca7f3977fda65893dcecbe2620 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/31df89fdf858be72b33d6b321ffd7186494671ca7f3977fda65893dcecbe2620 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/350bd186f6f06608fb39ad8dcdfd2230efc358d79727daa37b890c4aec4dec65 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/350bd186f6f06608fb39ad8dcdfd2230efc358d79727daa37b890c4aec4dec65 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/350bd186f6f06608fb39ad8dcdfd2230efc358d79727daa37b890c4aec4dec65 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/350bd186f6f06608fb39ad8dcdfd2230efc358d79727daa37b890c4aec4dec65 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/3552fd0f4b87fd982da8227fae96acde53b3f920ef4ea20317ebf0a1a7410262 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/3552fd0f4b87fd982da8227fae96acde53b3f920ef4ea20317ebf0a1a7410262 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/3552fd0f4b87fd982da8227fae96acde53b3f920ef4ea20317ebf0a1a7410262 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/3552fd0f4b87fd982da8227fae96acde53b3f920ef4ea20317ebf0a1a7410262 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/3a33f844bc5f618fb6488661c1544a4dd7967770e7767d26bfdbbec9a1b96f22 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/3a33f844bc5f618fb6488661c1544a4dd7967770e7767d26bfdbbec9a1b96f22 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/3a33f844bc5f618fb6488661c1544a4dd7967770e7767d26bfdbbec9a1b96f22 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/3a33f844bc5f618fb6488661c1544a4dd7967770e7767d26bfdbbec9a1b96f22 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/3df27bb4c54918c3e5853d0eb4c019e7d0db669fb5577ae5b3fce41748705684 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/3df27bb4c54918c3e5853d0eb4c019e7d0db669fb5577ae5b3fce41748705684 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/3df27bb4c54918c3e5853d0eb4c019e7d0db669fb5577ae5b3fce41748705684 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/3df27bb4c54918c3e5853d0eb4c019e7d0db669fb5577ae5b3fce41748705684 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/44fc104bebb63e88774ed8158f2287e0d1e6111d3dc173db5b2c86e79d83e976 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/44fc104bebb63e88774ed8158f2287e0d1e6111d3dc173db5b2c86e79d83e976 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/44fc104bebb63e88774ed8158f2287e0d1e6111d3dc173db5b2c86e79d83e976 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/44fc104bebb63e88774ed8158f2287e0d1e6111d3dc173db5b2c86e79d83e976 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/4532c37a5b3fed281a3bb736103c095ba6a21b9942027901767b197502539f1d b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/4532c37a5b3fed281a3bb736103c095ba6a21b9942027901767b197502539f1d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/4532c37a5b3fed281a3bb736103c095ba6a21b9942027901767b197502539f1d rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/4532c37a5b3fed281a3bb736103c095ba6a21b9942027901767b197502539f1d diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/4685b97f49fbd568dff98afd08ab051290f27e6beca56ba22dba30f9a8cd0222 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/4685b97f49fbd568dff98afd08ab051290f27e6beca56ba22dba30f9a8cd0222 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/4685b97f49fbd568dff98afd08ab051290f27e6beca56ba22dba30f9a8cd0222 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/4685b97f49fbd568dff98afd08ab051290f27e6beca56ba22dba30f9a8cd0222 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/5102bbe7c5ba1c08df55524c2e0ce5d65d7066d730e87ccc17438005ae40b9a7 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/5102bbe7c5ba1c08df55524c2e0ce5d65d7066d730e87ccc17438005ae40b9a7 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/5102bbe7c5ba1c08df55524c2e0ce5d65d7066d730e87ccc17438005ae40b9a7 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/5102bbe7c5ba1c08df55524c2e0ce5d65d7066d730e87ccc17438005ae40b9a7 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/510faca29944e59996668b3ed873c6f7ca337f8dbf66574c15ac9b332b31dd51 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/510faca29944e59996668b3ed873c6f7ca337f8dbf66574c15ac9b332b31dd51 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/510faca29944e59996668b3ed873c6f7ca337f8dbf66574c15ac9b332b31dd51 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/510faca29944e59996668b3ed873c6f7ca337f8dbf66574c15ac9b332b31dd51 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/519d77029487b1b7db5e464c40ecc5fa6743c248d6137f5a113083e82d557f24 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/519d77029487b1b7db5e464c40ecc5fa6743c248d6137f5a113083e82d557f24 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/519d77029487b1b7db5e464c40ecc5fa6743c248d6137f5a113083e82d557f24 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/519d77029487b1b7db5e464c40ecc5fa6743c248d6137f5a113083e82d557f24 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/54743693f36870746a2007a68975f42fb28e5b071cc3de0752ff8f552c162e7f b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/54743693f36870746a2007a68975f42fb28e5b071cc3de0752ff8f552c162e7f similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/54743693f36870746a2007a68975f42fb28e5b071cc3de0752ff8f552c162e7f rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/54743693f36870746a2007a68975f42fb28e5b071cc3de0752ff8f552c162e7f diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/56ba0c2a466aa51b9f0f3ad75f7e57159cb77cdd1a133fe646919918d4bf3e37 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/56ba0c2a466aa51b9f0f3ad75f7e57159cb77cdd1a133fe646919918d4bf3e37 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/56ba0c2a466aa51b9f0f3ad75f7e57159cb77cdd1a133fe646919918d4bf3e37 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/56ba0c2a466aa51b9f0f3ad75f7e57159cb77cdd1a133fe646919918d4bf3e37 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/5a1f1d9c4dea8a7792e3881e28c780236ac30a57f9c009f51d560c9e91c71e32 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/5a1f1d9c4dea8a7792e3881e28c780236ac30a57f9c009f51d560c9e91c71e32 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/5a1f1d9c4dea8a7792e3881e28c780236ac30a57f9c009f51d560c9e91c71e32 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/5a1f1d9c4dea8a7792e3881e28c780236ac30a57f9c009f51d560c9e91c71e32 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/5edb69eb6969d03e35e389faef5ace364f6b84e129c90e385beb468c28beee35 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/5edb69eb6969d03e35e389faef5ace364f6b84e129c90e385beb468c28beee35 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/5edb69eb6969d03e35e389faef5ace364f6b84e129c90e385beb468c28beee35 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/5edb69eb6969d03e35e389faef5ace364f6b84e129c90e385beb468c28beee35 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/62c1bf7c7497667ca76336813eca38dc4020821e73868a5e8be553b945e5e7be b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/62c1bf7c7497667ca76336813eca38dc4020821e73868a5e8be553b945e5e7be similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/62c1bf7c7497667ca76336813eca38dc4020821e73868a5e8be553b945e5e7be rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/62c1bf7c7497667ca76336813eca38dc4020821e73868a5e8be553b945e5e7be diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/66120e0535ada7c7ad056af9e5db7b96ae8b4078fbb19644246ad486f47af78e b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/66120e0535ada7c7ad056af9e5db7b96ae8b4078fbb19644246ad486f47af78e similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/66120e0535ada7c7ad056af9e5db7b96ae8b4078fbb19644246ad486f47af78e rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/66120e0535ada7c7ad056af9e5db7b96ae8b4078fbb19644246ad486f47af78e diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/6e23af2deb2f90eaeb956d8dfe9f79ab5d7c528b0dbb48fd3904a71cb1051f19 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/6e23af2deb2f90eaeb956d8dfe9f79ab5d7c528b0dbb48fd3904a71cb1051f19 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/6e23af2deb2f90eaeb956d8dfe9f79ab5d7c528b0dbb48fd3904a71cb1051f19 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/6e23af2deb2f90eaeb956d8dfe9f79ab5d7c528b0dbb48fd3904a71cb1051f19 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/75c4b5184d9cc525cde97143a24e6b4a1db4758ba37db8c467cea170b20acf9d b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/75c4b5184d9cc525cde97143a24e6b4a1db4758ba37db8c467cea170b20acf9d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/75c4b5184d9cc525cde97143a24e6b4a1db4758ba37db8c467cea170b20acf9d rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/75c4b5184d9cc525cde97143a24e6b4a1db4758ba37db8c467cea170b20acf9d diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/76eaeaf54248d1cedea5896e467c37450f2a73c4dc3105e0bb9d6c68d98e449a b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/76eaeaf54248d1cedea5896e467c37450f2a73c4dc3105e0bb9d6c68d98e449a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/76eaeaf54248d1cedea5896e467c37450f2a73c4dc3105e0bb9d6c68d98e449a rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/76eaeaf54248d1cedea5896e467c37450f2a73c4dc3105e0bb9d6c68d98e449a diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/7b5f1cfb890a00c2504224d0e0689371663b32f4d42b899be9aac1541c225422 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/7b5f1cfb890a00c2504224d0e0689371663b32f4d42b899be9aac1541c225422 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/7b5f1cfb890a00c2504224d0e0689371663b32f4d42b899be9aac1541c225422 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/7b5f1cfb890a00c2504224d0e0689371663b32f4d42b899be9aac1541c225422 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/7c4ba0c82883a6b09dc1b588437a9414001cdc8d8bcea2489c118aa5d31c3ece b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/7c4ba0c82883a6b09dc1b588437a9414001cdc8d8bcea2489c118aa5d31c3ece similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/7c4ba0c82883a6b09dc1b588437a9414001cdc8d8bcea2489c118aa5d31c3ece rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/7c4ba0c82883a6b09dc1b588437a9414001cdc8d8bcea2489c118aa5d31c3ece diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/7c72438c68d7c8c65dd044f397a342467cca19f2f9f1192df415f4d7be9581a9 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/7c72438c68d7c8c65dd044f397a342467cca19f2f9f1192df415f4d7be9581a9 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/7c72438c68d7c8c65dd044f397a342467cca19f2f9f1192df415f4d7be9581a9 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/7c72438c68d7c8c65dd044f397a342467cca19f2f9f1192df415f4d7be9581a9 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/7ec272a5be1143f0aab5676715c959e96317da648d6ce8ec3c3d05cc22ae611d b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/7ec272a5be1143f0aab5676715c959e96317da648d6ce8ec3c3d05cc22ae611d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/7ec272a5be1143f0aab5676715c959e96317da648d6ce8ec3c3d05cc22ae611d rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/7ec272a5be1143f0aab5676715c959e96317da648d6ce8ec3c3d05cc22ae611d diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/7f01df9849b8d46ba837cd52d28a331bd95fc928ace02079edc7f99402198fcc b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/7f01df9849b8d46ba837cd52d28a331bd95fc928ace02079edc7f99402198fcc similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/7f01df9849b8d46ba837cd52d28a331bd95fc928ace02079edc7f99402198fcc rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/7f01df9849b8d46ba837cd52d28a331bd95fc928ace02079edc7f99402198fcc diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/8dc818bc7cade25f1e585cbc2369e5ab5ed42dc5685daf0b43f8f8f5129473d0 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/8dc818bc7cade25f1e585cbc2369e5ab5ed42dc5685daf0b43f8f8f5129473d0 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/8dc818bc7cade25f1e585cbc2369e5ab5ed42dc5685daf0b43f8f8f5129473d0 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/8dc818bc7cade25f1e585cbc2369e5ab5ed42dc5685daf0b43f8f8f5129473d0 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/8f4dcc3274e9333b31c1ddf1ee9ac09de9dfa71b147cf9e79af53ca792a657e0 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/8f4dcc3274e9333b31c1ddf1ee9ac09de9dfa71b147cf9e79af53ca792a657e0 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/8f4dcc3274e9333b31c1ddf1ee9ac09de9dfa71b147cf9e79af53ca792a657e0 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/8f4dcc3274e9333b31c1ddf1ee9ac09de9dfa71b147cf9e79af53ca792a657e0 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/96f9667574da21f1c9dfce114a4b09fb1c840153e2a9ce6e4269283725c95bf0 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/96f9667574da21f1c9dfce114a4b09fb1c840153e2a9ce6e4269283725c95bf0 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/96f9667574da21f1c9dfce114a4b09fb1c840153e2a9ce6e4269283725c95bf0 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/96f9667574da21f1c9dfce114a4b09fb1c840153e2a9ce6e4269283725c95bf0 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/9765f4a1996ff3324bb9a9c8ccc1c4f45d9168ec2576d0f3318e625693520485 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/9765f4a1996ff3324bb9a9c8ccc1c4f45d9168ec2576d0f3318e625693520485 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/9765f4a1996ff3324bb9a9c8ccc1c4f45d9168ec2576d0f3318e625693520485 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/9765f4a1996ff3324bb9a9c8ccc1c4f45d9168ec2576d0f3318e625693520485 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/9f54b5526c8e19bd63a610c9a1d6358f21847bb68a92e902f34495b107c2da34 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/9f54b5526c8e19bd63a610c9a1d6358f21847bb68a92e902f34495b107c2da34 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/9f54b5526c8e19bd63a610c9a1d6358f21847bb68a92e902f34495b107c2da34 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/9f54b5526c8e19bd63a610c9a1d6358f21847bb68a92e902f34495b107c2da34 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/a23cc841abb4c42bb2e99962305966f01b8a29173b3d677479ad6666dad0ef4b b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/a23cc841abb4c42bb2e99962305966f01b8a29173b3d677479ad6666dad0ef4b similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/a23cc841abb4c42bb2e99962305966f01b8a29173b3d677479ad6666dad0ef4b rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/a23cc841abb4c42bb2e99962305966f01b8a29173b3d677479ad6666dad0ef4b diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/a2b419e79734a0d9481b80cd10a1d4d072db6703de1525bd1969c8fffe02a918 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/a2b419e79734a0d9481b80cd10a1d4d072db6703de1525bd1969c8fffe02a918 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/a2b419e79734a0d9481b80cd10a1d4d072db6703de1525bd1969c8fffe02a918 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/a2b419e79734a0d9481b80cd10a1d4d072db6703de1525bd1969c8fffe02a918 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/a69881d2a080a346e392355e92e9a13910335c696eebb76f32ecc638dd05068e b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/a69881d2a080a346e392355e92e9a13910335c696eebb76f32ecc638dd05068e similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/a69881d2a080a346e392355e92e9a13910335c696eebb76f32ecc638dd05068e rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/a69881d2a080a346e392355e92e9a13910335c696eebb76f32ecc638dd05068e diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/a6f61aa57636349fa0e917bbc9495101a6a7b2f45f7d7f4bd5ec4df44790696a b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/a6f61aa57636349fa0e917bbc9495101a6a7b2f45f7d7f4bd5ec4df44790696a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/a6f61aa57636349fa0e917bbc9495101a6a7b2f45f7d7f4bd5ec4df44790696a rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/a6f61aa57636349fa0e917bbc9495101a6a7b2f45f7d7f4bd5ec4df44790696a diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/a9a2950adf3572db3f74ebc3e895300830da93f10667bf305843ef374a30ac10 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/a9a2950adf3572db3f74ebc3e895300830da93f10667bf305843ef374a30ac10 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/a9a2950adf3572db3f74ebc3e895300830da93f10667bf305843ef374a30ac10 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/a9a2950adf3572db3f74ebc3e895300830da93f10667bf305843ef374a30ac10 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/ab2455faebe5a4e884d38ffbe1d7497616c151a7dd1ce0006bc8f75c3082f079 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/ab2455faebe5a4e884d38ffbe1d7497616c151a7dd1ce0006bc8f75c3082f079 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/ab2455faebe5a4e884d38ffbe1d7497616c151a7dd1ce0006bc8f75c3082f079 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/ab2455faebe5a4e884d38ffbe1d7497616c151a7dd1ce0006bc8f75c3082f079 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/aef58a980af90c024b3d66672275d87626e2fce945f92f031af079aeb2527cf9 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/aef58a980af90c024b3d66672275d87626e2fce945f92f031af079aeb2527cf9 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/aef58a980af90c024b3d66672275d87626e2fce945f92f031af079aeb2527cf9 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/aef58a980af90c024b3d66672275d87626e2fce945f92f031af079aeb2527cf9 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/b3107af7efce9168ba9e5a9444e5536fef5091c7d1b521dfaa28616bdefd2753 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/b3107af7efce9168ba9e5a9444e5536fef5091c7d1b521dfaa28616bdefd2753 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/b3107af7efce9168ba9e5a9444e5536fef5091c7d1b521dfaa28616bdefd2753 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/b3107af7efce9168ba9e5a9444e5536fef5091c7d1b521dfaa28616bdefd2753 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/b6d37f70eb74ce73df5b8fb559bf3c9de1ef9dea7f5ac768b485d6faaaea5b9d b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/b6d37f70eb74ce73df5b8fb559bf3c9de1ef9dea7f5ac768b485d6faaaea5b9d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/b6d37f70eb74ce73df5b8fb559bf3c9de1ef9dea7f5ac768b485d6faaaea5b9d rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/b6d37f70eb74ce73df5b8fb559bf3c9de1ef9dea7f5ac768b485d6faaaea5b9d diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/b6e0ed461575dfbcb88f449ca90cfba62ca5d709385c7fa01e30afdf8d73f9db b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/b6e0ed461575dfbcb88f449ca90cfba62ca5d709385c7fa01e30afdf8d73f9db similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/b6e0ed461575dfbcb88f449ca90cfba62ca5d709385c7fa01e30afdf8d73f9db rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/b6e0ed461575dfbcb88f449ca90cfba62ca5d709385c7fa01e30afdf8d73f9db diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/b7761a4189a7cd4e179dabaefacb039e81475182eaa6d55168387eaff366b8b5 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/b7761a4189a7cd4e179dabaefacb039e81475182eaa6d55168387eaff366b8b5 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/b7761a4189a7cd4e179dabaefacb039e81475182eaa6d55168387eaff366b8b5 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/b7761a4189a7cd4e179dabaefacb039e81475182eaa6d55168387eaff366b8b5 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/b8df1d6f635a74a2b287cda23a562e45e39f17f2ab5c6a3ec61eed8d3ad2b28a b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/b8df1d6f635a74a2b287cda23a562e45e39f17f2ab5c6a3ec61eed8d3ad2b28a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/b8df1d6f635a74a2b287cda23a562e45e39f17f2ab5c6a3ec61eed8d3ad2b28a rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/b8df1d6f635a74a2b287cda23a562e45e39f17f2ab5c6a3ec61eed8d3ad2b28a diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/ba9b36b363992a6c920af6dd0acff6cc0e55f093dfef5388accd28931d651b7e b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/ba9b36b363992a6c920af6dd0acff6cc0e55f093dfef5388accd28931d651b7e similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/ba9b36b363992a6c920af6dd0acff6cc0e55f093dfef5388accd28931d651b7e rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/ba9b36b363992a6c920af6dd0acff6cc0e55f093dfef5388accd28931d651b7e diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/c29a6cf30615028c1afc84bba47e0ace6aaa0a1f7ae85bb51918fd8f9828ae86 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/c29a6cf30615028c1afc84bba47e0ace6aaa0a1f7ae85bb51918fd8f9828ae86 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/c29a6cf30615028c1afc84bba47e0ace6aaa0a1f7ae85bb51918fd8f9828ae86 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/c29a6cf30615028c1afc84bba47e0ace6aaa0a1f7ae85bb51918fd8f9828ae86 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/c9777a9e1b77509440cfe569fe20545f94e85b628e55248585f1d54fe83d2bc3 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/c9777a9e1b77509440cfe569fe20545f94e85b628e55248585f1d54fe83d2bc3 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/c9777a9e1b77509440cfe569fe20545f94e85b628e55248585f1d54fe83d2bc3 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/c9777a9e1b77509440cfe569fe20545f94e85b628e55248585f1d54fe83d2bc3 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/cf8ed7b226e55d48e0356ec4d6c9884d93ac997cffaf61c9f332082f276d0513 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/cf8ed7b226e55d48e0356ec4d6c9884d93ac997cffaf61c9f332082f276d0513 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/cf8ed7b226e55d48e0356ec4d6c9884d93ac997cffaf61c9f332082f276d0513 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/cf8ed7b226e55d48e0356ec4d6c9884d93ac997cffaf61c9f332082f276d0513 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/d3f83b5bfe7e0abbdb0277a95d60488d9244acccd71d6f80f9b72db0dfbb09c1 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/d3f83b5bfe7e0abbdb0277a95d60488d9244acccd71d6f80f9b72db0dfbb09c1 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/d3f83b5bfe7e0abbdb0277a95d60488d9244acccd71d6f80f9b72db0dfbb09c1 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/d3f83b5bfe7e0abbdb0277a95d60488d9244acccd71d6f80f9b72db0dfbb09c1 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/d40a98862ed393eb712e47a91bcef18e6f24cf368bb4bd248c7a7101ef8e178d b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/d40a98862ed393eb712e47a91bcef18e6f24cf368bb4bd248c7a7101ef8e178d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/d40a98862ed393eb712e47a91bcef18e6f24cf368bb4bd248c7a7101ef8e178d rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/d40a98862ed393eb712e47a91bcef18e6f24cf368bb4bd248c7a7101ef8e178d diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/d71899c7d1ae3146be038893ea9bff3ba8092779d24982bff1687a44d066c23a b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/d71899c7d1ae3146be038893ea9bff3ba8092779d24982bff1687a44d066c23a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/d71899c7d1ae3146be038893ea9bff3ba8092779d24982bff1687a44d066c23a rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/d71899c7d1ae3146be038893ea9bff3ba8092779d24982bff1687a44d066c23a diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/d9aa6daa4561747a3169548d5242361d23e68fff23e41e27c745a4f36d8b0312 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/d9aa6daa4561747a3169548d5242361d23e68fff23e41e27c745a4f36d8b0312 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/d9aa6daa4561747a3169548d5242361d23e68fff23e41e27c745a4f36d8b0312 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/d9aa6daa4561747a3169548d5242361d23e68fff23e41e27c745a4f36d8b0312 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/e177df610f0f7deb30132a564c76a8924e0492d646fbfd757f5a6e946d08c0e5 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/e177df610f0f7deb30132a564c76a8924e0492d646fbfd757f5a6e946d08c0e5 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/e177df610f0f7deb30132a564c76a8924e0492d646fbfd757f5a6e946d08c0e5 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/e177df610f0f7deb30132a564c76a8924e0492d646fbfd757f5a6e946d08c0e5 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/e1d5a0aca2ba9af4ab11ab9e3d1fbced8e1323d70c7be080dda8c0fa23228bea b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/e1d5a0aca2ba9af4ab11ab9e3d1fbced8e1323d70c7be080dda8c0fa23228bea similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/e1d5a0aca2ba9af4ab11ab9e3d1fbced8e1323d70c7be080dda8c0fa23228bea rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/e1d5a0aca2ba9af4ab11ab9e3d1fbced8e1323d70c7be080dda8c0fa23228bea diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/e3006d3f1655206600f653a2c994ccc2b1fb6a1a0361962952ea2bd625fb0c6e b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/e3006d3f1655206600f653a2c994ccc2b1fb6a1a0361962952ea2bd625fb0c6e similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/e3006d3f1655206600f653a2c994ccc2b1fb6a1a0361962952ea2bd625fb0c6e rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/e3006d3f1655206600f653a2c994ccc2b1fb6a1a0361962952ea2bd625fb0c6e diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/e32de704c5c749d803fc212bdaf437654503c5e92c8e366f43e3d6bf0c183743 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/e32de704c5c749d803fc212bdaf437654503c5e92c8e366f43e3d6bf0c183743 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/e32de704c5c749d803fc212bdaf437654503c5e92c8e366f43e3d6bf0c183743 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/e32de704c5c749d803fc212bdaf437654503c5e92c8e366f43e3d6bf0c183743 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/e74b3843e3015358643f2ff6ea1e4ee8875e67877eb5a2b4e9f074006256958f b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/e74b3843e3015358643f2ff6ea1e4ee8875e67877eb5a2b4e9f074006256958f similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/e74b3843e3015358643f2ff6ea1e4ee8875e67877eb5a2b4e9f074006256958f rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/e74b3843e3015358643f2ff6ea1e4ee8875e67877eb5a2b4e9f074006256958f diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/e8f03811691ac25d11d882b545bcf7a87e5dc88e36dd95c72d9059767f868348 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/e8f03811691ac25d11d882b545bcf7a87e5dc88e36dd95c72d9059767f868348 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/e8f03811691ac25d11d882b545bcf7a87e5dc88e36dd95c72d9059767f868348 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/e8f03811691ac25d11d882b545bcf7a87e5dc88e36dd95c72d9059767f868348 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/eeff8e0a9e119cafa8f8fa28127c3ffee0de2a1a034be5b83c5870be611ba5a5 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/eeff8e0a9e119cafa8f8fa28127c3ffee0de2a1a034be5b83c5870be611ba5a5 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/eeff8e0a9e119cafa8f8fa28127c3ffee0de2a1a034be5b83c5870be611ba5a5 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/eeff8e0a9e119cafa8f8fa28127c3ffee0de2a1a034be5b83c5870be611ba5a5 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/f4392607b06c4fc3b86e867ecdf74a06d121d127a8f06adabd48e3177225e2fe b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/f4392607b06c4fc3b86e867ecdf74a06d121d127a8f06adabd48e3177225e2fe similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/f4392607b06c4fc3b86e867ecdf74a06d121d127a8f06adabd48e3177225e2fe rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/f4392607b06c4fc3b86e867ecdf74a06d121d127a8f06adabd48e3177225e2fe diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/f74d1a15fdb781f0587e2dc677a3cdeb4eb04f0f14b4e7e7606f2be4013d90f9 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/f74d1a15fdb781f0587e2dc677a3cdeb4eb04f0f14b4e7e7606f2be4013d90f9 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/f74d1a15fdb781f0587e2dc677a3cdeb4eb04f0f14b4e7e7606f2be4013d90f9 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesDecSetString/f74d1a15fdb781f0587e2dc677a3cdeb4eb04f0f14b4e7e7606f2be4013d90f9 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/01da271c7a0b93ca9cb0caf8abe8377667d1c6850fc02996511b78c478cb1a6a b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/01da271c7a0b93ca9cb0caf8abe8377667d1c6850fc02996511b78c478cb1a6a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/01da271c7a0b93ca9cb0caf8abe8377667d1c6850fc02996511b78c478cb1a6a rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/01da271c7a0b93ca9cb0caf8abe8377667d1c6850fc02996511b78c478cb1a6a diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/04481996c13b28523f5c7eafbce379a04545702fa1fb593516a5d5b5d3e4faab b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/04481996c13b28523f5c7eafbce379a04545702fa1fb593516a5d5b5d3e4faab similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/04481996c13b28523f5c7eafbce379a04545702fa1fb593516a5d5b5d3e4faab rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/04481996c13b28523f5c7eafbce379a04545702fa1fb593516a5d5b5d3e4faab diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/0567f9b805cf1df225946686a513e994f0b7b773968299767f73719cb3cb8679 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/0567f9b805cf1df225946686a513e994f0b7b773968299767f73719cb3cb8679 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/0567f9b805cf1df225946686a513e994f0b7b773968299767f73719cb3cb8679 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/0567f9b805cf1df225946686a513e994f0b7b773968299767f73719cb3cb8679 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/0995d31a8f5edfa788ee987b853f63a0d2a55fd0f63abe686059ca0035c32b6d b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/0995d31a8f5edfa788ee987b853f63a0d2a55fd0f63abe686059ca0035c32b6d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/0995d31a8f5edfa788ee987b853f63a0d2a55fd0f63abe686059ca0035c32b6d rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/0995d31a8f5edfa788ee987b853f63a0d2a55fd0f63abe686059ca0035c32b6d diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/0a2eb83f3eb72f92d88ed9f83604c3b9ae978627f1be6aa3560c1db00674f1a7 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/0a2eb83f3eb72f92d88ed9f83604c3b9ae978627f1be6aa3560c1db00674f1a7 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/0a2eb83f3eb72f92d88ed9f83604c3b9ae978627f1be6aa3560c1db00674f1a7 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/0a2eb83f3eb72f92d88ed9f83604c3b9ae978627f1be6aa3560c1db00674f1a7 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/1011f7553b700c8055f7b33ef0e9e3e91468fcc81f299a1bc2e28a3e76e54e69 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/1011f7553b700c8055f7b33ef0e9e3e91468fcc81f299a1bc2e28a3e76e54e69 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/1011f7553b700c8055f7b33ef0e9e3e91468fcc81f299a1bc2e28a3e76e54e69 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/1011f7553b700c8055f7b33ef0e9e3e91468fcc81f299a1bc2e28a3e76e54e69 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/11ebc342f5cd0ac6f5737675baba9884c161a9c3d6aec5e5f29f2d314e4b7ca1 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/11ebc342f5cd0ac6f5737675baba9884c161a9c3d6aec5e5f29f2d314e4b7ca1 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/11ebc342f5cd0ac6f5737675baba9884c161a9c3d6aec5e5f29f2d314e4b7ca1 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/11ebc342f5cd0ac6f5737675baba9884c161a9c3d6aec5e5f29f2d314e4b7ca1 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/145cb150e92fa3f85afa5107e75a3864d6cb3b9aa893f72dc2e7eab465b75de1 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/145cb150e92fa3f85afa5107e75a3864d6cb3b9aa893f72dc2e7eab465b75de1 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/145cb150e92fa3f85afa5107e75a3864d6cb3b9aa893f72dc2e7eab465b75de1 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/145cb150e92fa3f85afa5107e75a3864d6cb3b9aa893f72dc2e7eab465b75de1 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/151f48f592afc01dbbbc426b4555ae8a20dd09d35a328c286496efd0061af47c b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/151f48f592afc01dbbbc426b4555ae8a20dd09d35a328c286496efd0061af47c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/151f48f592afc01dbbbc426b4555ae8a20dd09d35a328c286496efd0061af47c rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/151f48f592afc01dbbbc426b4555ae8a20dd09d35a328c286496efd0061af47c diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/156df3316672a8cccab3152154e2ba3caabe0c17afaa76bc3e931360c3581252 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/156df3316672a8cccab3152154e2ba3caabe0c17afaa76bc3e931360c3581252 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/156df3316672a8cccab3152154e2ba3caabe0c17afaa76bc3e931360c3581252 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/156df3316672a8cccab3152154e2ba3caabe0c17afaa76bc3e931360c3581252 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/164581d177f7cace45d665273813973b75c07fb2c9ba95b74578686ace117738 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/164581d177f7cace45d665273813973b75c07fb2c9ba95b74578686ace117738 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/164581d177f7cace45d665273813973b75c07fb2c9ba95b74578686ace117738 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/164581d177f7cace45d665273813973b75c07fb2c9ba95b74578686ace117738 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/168863aa3ddd1e0b17a4c04dfcdfba65e223f35d79075176a4f48348f429cfb3 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/168863aa3ddd1e0b17a4c04dfcdfba65e223f35d79075176a4f48348f429cfb3 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/168863aa3ddd1e0b17a4c04dfcdfba65e223f35d79075176a4f48348f429cfb3 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/168863aa3ddd1e0b17a4c04dfcdfba65e223f35d79075176a4f48348f429cfb3 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/17c79de85cc2e1c7ca1162609ad9ee82aa837691df84697095971b5b4b648d65 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/17c79de85cc2e1c7ca1162609ad9ee82aa837691df84697095971b5b4b648d65 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/17c79de85cc2e1c7ca1162609ad9ee82aa837691df84697095971b5b4b648d65 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/17c79de85cc2e1c7ca1162609ad9ee82aa837691df84697095971b5b4b648d65 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/18369e68421d82464354e28014d774e5975866a6087f48e1c8453cee783a44ff b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/18369e68421d82464354e28014d774e5975866a6087f48e1c8453cee783a44ff similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/18369e68421d82464354e28014d774e5975866a6087f48e1c8453cee783a44ff rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/18369e68421d82464354e28014d774e5975866a6087f48e1c8453cee783a44ff diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/1963b53e7360431597947bcc8e026df4f4ca29f8457a6e0753059c70c5a98b4b b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/1963b53e7360431597947bcc8e026df4f4ca29f8457a6e0753059c70c5a98b4b similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/1963b53e7360431597947bcc8e026df4f4ca29f8457a6e0753059c70c5a98b4b rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/1963b53e7360431597947bcc8e026df4f4ca29f8457a6e0753059c70c5a98b4b diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/1b6b4ae1d037157f7967de5810af61a50f0fe3fa54492cf6ea879bf6c72bf17f b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/1b6b4ae1d037157f7967de5810af61a50f0fe3fa54492cf6ea879bf6c72bf17f similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/1b6b4ae1d037157f7967de5810af61a50f0fe3fa54492cf6ea879bf6c72bf17f rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/1b6b4ae1d037157f7967de5810af61a50f0fe3fa54492cf6ea879bf6c72bf17f diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/1b76486219666486928528b3bf7f8dc870ffce6ca9ca355890616a01e1036b8a b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/1b76486219666486928528b3bf7f8dc870ffce6ca9ca355890616a01e1036b8a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/1b76486219666486928528b3bf7f8dc870ffce6ca9ca355890616a01e1036b8a rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/1b76486219666486928528b3bf7f8dc870ffce6ca9ca355890616a01e1036b8a diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/1d253d1de52a2be948dc176094e773f8d7c9d8420ea6b3170504b40ed83a60de b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/1d253d1de52a2be948dc176094e773f8d7c9d8420ea6b3170504b40ed83a60de similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/1d253d1de52a2be948dc176094e773f8d7c9d8420ea6b3170504b40ed83a60de rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/1d253d1de52a2be948dc176094e773f8d7c9d8420ea6b3170504b40ed83a60de diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/1eff058a5aceb56db2a86397ad77767014eb2b35312194a3193fd0ea12320d32 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/1eff058a5aceb56db2a86397ad77767014eb2b35312194a3193fd0ea12320d32 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/1eff058a5aceb56db2a86397ad77767014eb2b35312194a3193fd0ea12320d32 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/1eff058a5aceb56db2a86397ad77767014eb2b35312194a3193fd0ea12320d32 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/20bbed74d9d809f4dfa2443abcaad25279400e36fcc3e7ba5d0dacedc026631c b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/20bbed74d9d809f4dfa2443abcaad25279400e36fcc3e7ba5d0dacedc026631c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/20bbed74d9d809f4dfa2443abcaad25279400e36fcc3e7ba5d0dacedc026631c rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/20bbed74d9d809f4dfa2443abcaad25279400e36fcc3e7ba5d0dacedc026631c diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/259ea4a2270da7542d794cf63937d27be366a58cf3caa6cbf08981a83b61f1d7 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/259ea4a2270da7542d794cf63937d27be366a58cf3caa6cbf08981a83b61f1d7 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/259ea4a2270da7542d794cf63937d27be366a58cf3caa6cbf08981a83b61f1d7 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/259ea4a2270da7542d794cf63937d27be366a58cf3caa6cbf08981a83b61f1d7 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/2c38d658e1b4dff6038d0923946a54cd20fc3b01ed4049484592b7b570e67631 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/2c38d658e1b4dff6038d0923946a54cd20fc3b01ed4049484592b7b570e67631 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/2c38d658e1b4dff6038d0923946a54cd20fc3b01ed4049484592b7b570e67631 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/2c38d658e1b4dff6038d0923946a54cd20fc3b01ed4049484592b7b570e67631 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/2ce3820243b16e815b7a57bef9bf92699e12a37779dc6007e2df46069affa4c5 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/2ce3820243b16e815b7a57bef9bf92699e12a37779dc6007e2df46069affa4c5 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/2ce3820243b16e815b7a57bef9bf92699e12a37779dc6007e2df46069affa4c5 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/2ce3820243b16e815b7a57bef9bf92699e12a37779dc6007e2df46069affa4c5 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/30704dc220318447dcfc39ea0962b8391b6bae46a2d1c810679c6fed4b70b1c2 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/30704dc220318447dcfc39ea0962b8391b6bae46a2d1c810679c6fed4b70b1c2 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/30704dc220318447dcfc39ea0962b8391b6bae46a2d1c810679c6fed4b70b1c2 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/30704dc220318447dcfc39ea0962b8391b6bae46a2d1c810679c6fed4b70b1c2 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/31a6368215e81ef307b7cce7655aee9abdaefc46c2d923ab505267dcc6db0e14 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/31a6368215e81ef307b7cce7655aee9abdaefc46c2d923ab505267dcc6db0e14 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/31a6368215e81ef307b7cce7655aee9abdaefc46c2d923ab505267dcc6db0e14 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/31a6368215e81ef307b7cce7655aee9abdaefc46c2d923ab505267dcc6db0e14 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/36f86bacbbef2eadcf3f4db09b27a512551bcf74438cca80d98614372c1debee b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/36f86bacbbef2eadcf3f4db09b27a512551bcf74438cca80d98614372c1debee similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/36f86bacbbef2eadcf3f4db09b27a512551bcf74438cca80d98614372c1debee rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/36f86bacbbef2eadcf3f4db09b27a512551bcf74438cca80d98614372c1debee diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/3962699cf310049be073666edf57d46e84b9f7a8e836ddc82518595aaaa3e44a b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/3962699cf310049be073666edf57d46e84b9f7a8e836ddc82518595aaaa3e44a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/3962699cf310049be073666edf57d46e84b9f7a8e836ddc82518595aaaa3e44a rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/3962699cf310049be073666edf57d46e84b9f7a8e836ddc82518595aaaa3e44a diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/3ab60cee43601f90b7cdc839ffd539d01821ca30faddd688440d234f1e0eaa49 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/3ab60cee43601f90b7cdc839ffd539d01821ca30faddd688440d234f1e0eaa49 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/3ab60cee43601f90b7cdc839ffd539d01821ca30faddd688440d234f1e0eaa49 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/3ab60cee43601f90b7cdc839ffd539d01821ca30faddd688440d234f1e0eaa49 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/3fca1bc9ec600d545ea506e65537f7a6396522df70ef37166a3ba08b9ee7c956 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/3fca1bc9ec600d545ea506e65537f7a6396522df70ef37166a3ba08b9ee7c956 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/3fca1bc9ec600d545ea506e65537f7a6396522df70ef37166a3ba08b9ee7c956 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/3fca1bc9ec600d545ea506e65537f7a6396522df70ef37166a3ba08b9ee7c956 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/401a59b8b628172db7f4a977cda8a59faa150a38527f70bab106263b0470646a b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/401a59b8b628172db7f4a977cda8a59faa150a38527f70bab106263b0470646a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/401a59b8b628172db7f4a977cda8a59faa150a38527f70bab106263b0470646a rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/401a59b8b628172db7f4a977cda8a59faa150a38527f70bab106263b0470646a diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/42ecebfa70304030e1ef66a397e508e06b696d57ce1589dafb3a297a6c457d3d b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/42ecebfa70304030e1ef66a397e508e06b696d57ce1589dafb3a297a6c457d3d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/42ecebfa70304030e1ef66a397e508e06b696d57ce1589dafb3a297a6c457d3d rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/42ecebfa70304030e1ef66a397e508e06b696d57ce1589dafb3a297a6c457d3d diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/43c52ef27cd03f820d912009a5b86999528ab3a235fa119cdf3673ef40522e9a b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/43c52ef27cd03f820d912009a5b86999528ab3a235fa119cdf3673ef40522e9a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/43c52ef27cd03f820d912009a5b86999528ab3a235fa119cdf3673ef40522e9a rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/43c52ef27cd03f820d912009a5b86999528ab3a235fa119cdf3673ef40522e9a diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/465760495efa925c37044ab590593192cc867a9aa91800567c0416a5269a22ff b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/465760495efa925c37044ab590593192cc867a9aa91800567c0416a5269a22ff similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/465760495efa925c37044ab590593192cc867a9aa91800567c0416a5269a22ff rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/465760495efa925c37044ab590593192cc867a9aa91800567c0416a5269a22ff diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/4663926796b6fd55d81068c27416d8fbcd2720298def1927781cefaf18f3ed05 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/4663926796b6fd55d81068c27416d8fbcd2720298def1927781cefaf18f3ed05 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/4663926796b6fd55d81068c27416d8fbcd2720298def1927781cefaf18f3ed05 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/4663926796b6fd55d81068c27416d8fbcd2720298def1927781cefaf18f3ed05 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/4bbea5d442b40647c4d10528a67765a246c375048970c22cd86316c8bc7438ec b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/4bbea5d442b40647c4d10528a67765a246c375048970c22cd86316c8bc7438ec similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/4bbea5d442b40647c4d10528a67765a246c375048970c22cd86316c8bc7438ec rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/4bbea5d442b40647c4d10528a67765a246c375048970c22cd86316c8bc7438ec diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/4cb45e0218bd5e6780e88aba194563f6451e941b4f4b3e196e84f53aba43fd6e b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/4cb45e0218bd5e6780e88aba194563f6451e941b4f4b3e196e84f53aba43fd6e similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/4cb45e0218bd5e6780e88aba194563f6451e941b4f4b3e196e84f53aba43fd6e rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/4cb45e0218bd5e6780e88aba194563f6451e941b4f4b3e196e84f53aba43fd6e diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/4dbcc1da43bd4d3cf0c3d54938318c0d498ffa9de9df4b198572234636dfbd2d b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/4dbcc1da43bd4d3cf0c3d54938318c0d498ffa9de9df4b198572234636dfbd2d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/4dbcc1da43bd4d3cf0c3d54938318c0d498ffa9de9df4b198572234636dfbd2d rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/4dbcc1da43bd4d3cf0c3d54938318c0d498ffa9de9df4b198572234636dfbd2d diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/515a98f4302cf9514a55ad1e869fb24820b8e430f454a674b07015f4825fd37e b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/515a98f4302cf9514a55ad1e869fb24820b8e430f454a674b07015f4825fd37e similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/515a98f4302cf9514a55ad1e869fb24820b8e430f454a674b07015f4825fd37e rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/515a98f4302cf9514a55ad1e869fb24820b8e430f454a674b07015f4825fd37e diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/5b2682ef7a312cefb277b6b01e0c4f3b132b0d749f8e4cae7713c5c1df913ab2 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/5b2682ef7a312cefb277b6b01e0c4f3b132b0d749f8e4cae7713c5c1df913ab2 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/5b2682ef7a312cefb277b6b01e0c4f3b132b0d749f8e4cae7713c5c1df913ab2 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/5b2682ef7a312cefb277b6b01e0c4f3b132b0d749f8e4cae7713c5c1df913ab2 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/5e8678c263204e4264edbf13052cda0b9fc0a15552012d91c8bfecb398e9b394 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/5e8678c263204e4264edbf13052cda0b9fc0a15552012d91c8bfecb398e9b394 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/5e8678c263204e4264edbf13052cda0b9fc0a15552012d91c8bfecb398e9b394 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/5e8678c263204e4264edbf13052cda0b9fc0a15552012d91c8bfecb398e9b394 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/619e638e9263a45ae992afff7f603691262870d5fb1bc929b52c89cac56927df b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/619e638e9263a45ae992afff7f603691262870d5fb1bc929b52c89cac56927df similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/619e638e9263a45ae992afff7f603691262870d5fb1bc929b52c89cac56927df rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/619e638e9263a45ae992afff7f603691262870d5fb1bc929b52c89cac56927df diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/61aa53f3c79a4cc756f33e609e3147dbdcd27f8daff78109f417f21cabdf38a1 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/61aa53f3c79a4cc756f33e609e3147dbdcd27f8daff78109f417f21cabdf38a1 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/61aa53f3c79a4cc756f33e609e3147dbdcd27f8daff78109f417f21cabdf38a1 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/61aa53f3c79a4cc756f33e609e3147dbdcd27f8daff78109f417f21cabdf38a1 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/64bc5db8d2c44c1e1fe15243edf2f6e0e62154ccb90be1f754a9a1c4e102f358 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/64bc5db8d2c44c1e1fe15243edf2f6e0e62154ccb90be1f754a9a1c4e102f358 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/64bc5db8d2c44c1e1fe15243edf2f6e0e62154ccb90be1f754a9a1c4e102f358 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/64bc5db8d2c44c1e1fe15243edf2f6e0e62154ccb90be1f754a9a1c4e102f358 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/66215713a9e9a6032a8b0b0bbfd061cd274fb55a9d3fde5dc896cb456ca24d59 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/66215713a9e9a6032a8b0b0bbfd061cd274fb55a9d3fde5dc896cb456ca24d59 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/66215713a9e9a6032a8b0b0bbfd061cd274fb55a9d3fde5dc896cb456ca24d59 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/66215713a9e9a6032a8b0b0bbfd061cd274fb55a9d3fde5dc896cb456ca24d59 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/6e661041611b33724f921eeb2230c186e2e95e7c7294a96be1828c3ce32341df b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/6e661041611b33724f921eeb2230c186e2e95e7c7294a96be1828c3ce32341df similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/6e661041611b33724f921eeb2230c186e2e95e7c7294a96be1828c3ce32341df rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/6e661041611b33724f921eeb2230c186e2e95e7c7294a96be1828c3ce32341df diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/723aaf8521adeb0d537cd4353cde1e950075d1208d464986b6b93936e89db092 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/723aaf8521adeb0d537cd4353cde1e950075d1208d464986b6b93936e89db092 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/723aaf8521adeb0d537cd4353cde1e950075d1208d464986b6b93936e89db092 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/723aaf8521adeb0d537cd4353cde1e950075d1208d464986b6b93936e89db092 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/75e4b43988a21242fb533d02c74aa4d2313e098f34a065e7d52d5ae627b1e99d b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/75e4b43988a21242fb533d02c74aa4d2313e098f34a065e7d52d5ae627b1e99d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/75e4b43988a21242fb533d02c74aa4d2313e098f34a065e7d52d5ae627b1e99d rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/75e4b43988a21242fb533d02c74aa4d2313e098f34a065e7d52d5ae627b1e99d diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/7a3af776718a9b3ab398a3ef31e082d0130a26ef2d60aab9d5259fedb64e176a b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/7a3af776718a9b3ab398a3ef31e082d0130a26ef2d60aab9d5259fedb64e176a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/7a3af776718a9b3ab398a3ef31e082d0130a26ef2d60aab9d5259fedb64e176a rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/7a3af776718a9b3ab398a3ef31e082d0130a26ef2d60aab9d5259fedb64e176a diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/7bc5a0909ce15fd7b5e30164343e71071d90c74e3b8af24120b03c0b7dca8c15 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/7bc5a0909ce15fd7b5e30164343e71071d90c74e3b8af24120b03c0b7dca8c15 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/7bc5a0909ce15fd7b5e30164343e71071d90c74e3b8af24120b03c0b7dca8c15 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/7bc5a0909ce15fd7b5e30164343e71071d90c74e3b8af24120b03c0b7dca8c15 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/7cdcc9bca20b80277512147e57dabb738d17575a4731f1f3b5c01436e9674d20 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/7cdcc9bca20b80277512147e57dabb738d17575a4731f1f3b5c01436e9674d20 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/7cdcc9bca20b80277512147e57dabb738d17575a4731f1f3b5c01436e9674d20 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/7cdcc9bca20b80277512147e57dabb738d17575a4731f1f3b5c01436e9674d20 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/7d391449135a17f1f8c0d6b9c352e88230169b9b5349422284d201b43cbb4962 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/7d391449135a17f1f8c0d6b9c352e88230169b9b5349422284d201b43cbb4962 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/7d391449135a17f1f8c0d6b9c352e88230169b9b5349422284d201b43cbb4962 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/7d391449135a17f1f8c0d6b9c352e88230169b9b5349422284d201b43cbb4962 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/7e2e4ddb2031a2ec8ac3d061e20422ae1622af2bd63410c209abf57422db0b44 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/7e2e4ddb2031a2ec8ac3d061e20422ae1622af2bd63410c209abf57422db0b44 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/7e2e4ddb2031a2ec8ac3d061e20422ae1622af2bd63410c209abf57422db0b44 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/7e2e4ddb2031a2ec8ac3d061e20422ae1622af2bd63410c209abf57422db0b44 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/7eeaa5fe08234da6b57df9fd4557494fe7ef03e3dd22894dbeb41447c99c7f2c b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/7eeaa5fe08234da6b57df9fd4557494fe7ef03e3dd22894dbeb41447c99c7f2c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/7eeaa5fe08234da6b57df9fd4557494fe7ef03e3dd22894dbeb41447c99c7f2c rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/7eeaa5fe08234da6b57df9fd4557494fe7ef03e3dd22894dbeb41447c99c7f2c diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/7f0ab9f2b2ddcb325ce7a624b6a700a343522df261b155d76b3b2424057a562a b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/7f0ab9f2b2ddcb325ce7a624b6a700a343522df261b155d76b3b2424057a562a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/7f0ab9f2b2ddcb325ce7a624b6a700a343522df261b155d76b3b2424057a562a rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/7f0ab9f2b2ddcb325ce7a624b6a700a343522df261b155d76b3b2424057a562a diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/856e80628a5c842ff5aee91437d71b3e7f4164e4c7d804762ebf9ee68096b32f b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/856e80628a5c842ff5aee91437d71b3e7f4164e4c7d804762ebf9ee68096b32f similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/856e80628a5c842ff5aee91437d71b3e7f4164e4c7d804762ebf9ee68096b32f rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/856e80628a5c842ff5aee91437d71b3e7f4164e4c7d804762ebf9ee68096b32f diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/8790cbb7e02bd96ba97093af71c371d831f3ceb6e1c5818ceb136ef8fbd4dea4 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/8790cbb7e02bd96ba97093af71c371d831f3ceb6e1c5818ceb136ef8fbd4dea4 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/8790cbb7e02bd96ba97093af71c371d831f3ceb6e1c5818ceb136ef8fbd4dea4 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/8790cbb7e02bd96ba97093af71c371d831f3ceb6e1c5818ceb136ef8fbd4dea4 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/8817bafde0eacf6e05deae4058cd2cbe36e04f7acfe780056d2851b07ecce090 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/8817bafde0eacf6e05deae4058cd2cbe36e04f7acfe780056d2851b07ecce090 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/8817bafde0eacf6e05deae4058cd2cbe36e04f7acfe780056d2851b07ecce090 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/8817bafde0eacf6e05deae4058cd2cbe36e04f7acfe780056d2851b07ecce090 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/8c28ffe165b14833ac8d0178b903b5afe11eaed0e0ac2b7d1079009a1074b380 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/8c28ffe165b14833ac8d0178b903b5afe11eaed0e0ac2b7d1079009a1074b380 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/8c28ffe165b14833ac8d0178b903b5afe11eaed0e0ac2b7d1079009a1074b380 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/8c28ffe165b14833ac8d0178b903b5afe11eaed0e0ac2b7d1079009a1074b380 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/8ce9812bf95d9435831bab6f1a2a30b26a26a6458197301bc09b09df46148310 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/8ce9812bf95d9435831bab6f1a2a30b26a26a6458197301bc09b09df46148310 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/8ce9812bf95d9435831bab6f1a2a30b26a26a6458197301bc09b09df46148310 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/8ce9812bf95d9435831bab6f1a2a30b26a26a6458197301bc09b09df46148310 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/91b302fa8897fbf1824dad4dde2e69fa12b291dd93c57a2e65b0bef64e44cf0a b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/91b302fa8897fbf1824dad4dde2e69fa12b291dd93c57a2e65b0bef64e44cf0a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/91b302fa8897fbf1824dad4dde2e69fa12b291dd93c57a2e65b0bef64e44cf0a rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/91b302fa8897fbf1824dad4dde2e69fa12b291dd93c57a2e65b0bef64e44cf0a diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/92c46305750d74fd6134268c7d8979bca39a2a07408e9ecf5099ea19da168da1 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/92c46305750d74fd6134268c7d8979bca39a2a07408e9ecf5099ea19da168da1 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/92c46305750d74fd6134268c7d8979bca39a2a07408e9ecf5099ea19da168da1 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/92c46305750d74fd6134268c7d8979bca39a2a07408e9ecf5099ea19da168da1 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/93ddca4c2cae163c4d167e8be1dbb49074116268f9efaf65442ba1fb51cd3e4c b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/93ddca4c2cae163c4d167e8be1dbb49074116268f9efaf65442ba1fb51cd3e4c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/93ddca4c2cae163c4d167e8be1dbb49074116268f9efaf65442ba1fb51cd3e4c rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/93ddca4c2cae163c4d167e8be1dbb49074116268f9efaf65442ba1fb51cd3e4c diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/9558c90b6462a2936f884f12dfa7fc66fc409282bfd3699bea1834c2212055fd b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/9558c90b6462a2936f884f12dfa7fc66fc409282bfd3699bea1834c2212055fd similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/9558c90b6462a2936f884f12dfa7fc66fc409282bfd3699bea1834c2212055fd rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/9558c90b6462a2936f884f12dfa7fc66fc409282bfd3699bea1834c2212055fd diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/961731ae66741fd3dca316c0943bb8fb442af4d9b87ae1174f02e068f9eb9683 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/961731ae66741fd3dca316c0943bb8fb442af4d9b87ae1174f02e068f9eb9683 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/961731ae66741fd3dca316c0943bb8fb442af4d9b87ae1174f02e068f9eb9683 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/961731ae66741fd3dca316c0943bb8fb442af4d9b87ae1174f02e068f9eb9683 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/981769b3fb714a042765cee566e45c1b52817610c16c3287878c2b60833310d8 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/981769b3fb714a042765cee566e45c1b52817610c16c3287878c2b60833310d8 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/981769b3fb714a042765cee566e45c1b52817610c16c3287878c2b60833310d8 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/981769b3fb714a042765cee566e45c1b52817610c16c3287878c2b60833310d8 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/99260594003a489b9af230d274acd653b6316d444667641cb6bf75b6337905a2 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/99260594003a489b9af230d274acd653b6316d444667641cb6bf75b6337905a2 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/99260594003a489b9af230d274acd653b6316d444667641cb6bf75b6337905a2 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/99260594003a489b9af230d274acd653b6316d444667641cb6bf75b6337905a2 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/9dbeaba86d11888ea2f72431e823d8b055577a19583730a0e5e473159be82753 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/9dbeaba86d11888ea2f72431e823d8b055577a19583730a0e5e473159be82753 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/9dbeaba86d11888ea2f72431e823d8b055577a19583730a0e5e473159be82753 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/9dbeaba86d11888ea2f72431e823d8b055577a19583730a0e5e473159be82753 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/a22a7a2277f0d69abc39ac9cfb802bcaedc83e41eba650d9f036fe4591320bf7 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/a22a7a2277f0d69abc39ac9cfb802bcaedc83e41eba650d9f036fe4591320bf7 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/a22a7a2277f0d69abc39ac9cfb802bcaedc83e41eba650d9f036fe4591320bf7 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/a22a7a2277f0d69abc39ac9cfb802bcaedc83e41eba650d9f036fe4591320bf7 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/a2fc8a5a5a394422401adebf61b87500a82ff99da8d64c011d30b2acd1f66fb4 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/a2fc8a5a5a394422401adebf61b87500a82ff99da8d64c011d30b2acd1f66fb4 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/a2fc8a5a5a394422401adebf61b87500a82ff99da8d64c011d30b2acd1f66fb4 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/a2fc8a5a5a394422401adebf61b87500a82ff99da8d64c011d30b2acd1f66fb4 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/a4d44b95174298d52739ade653ec95a7ad4da87405493c78aa02c60269bfe0fc b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/a4d44b95174298d52739ade653ec95a7ad4da87405493c78aa02c60269bfe0fc similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/a4d44b95174298d52739ade653ec95a7ad4da87405493c78aa02c60269bfe0fc rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/a4d44b95174298d52739ade653ec95a7ad4da87405493c78aa02c60269bfe0fc diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/a695b6110d65e51ae84d758dd36f3a7355478b8809ef88f10df8c01201ac0dcc b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/a695b6110d65e51ae84d758dd36f3a7355478b8809ef88f10df8c01201ac0dcc similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/a695b6110d65e51ae84d758dd36f3a7355478b8809ef88f10df8c01201ac0dcc rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/a695b6110d65e51ae84d758dd36f3a7355478b8809ef88f10df8c01201ac0dcc diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/ab02d405970751e42625207be26ecbef04203a5361c0534199cead41af3ef2f4 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/ab02d405970751e42625207be26ecbef04203a5361c0534199cead41af3ef2f4 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/ab02d405970751e42625207be26ecbef04203a5361c0534199cead41af3ef2f4 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/ab02d405970751e42625207be26ecbef04203a5361c0534199cead41af3ef2f4 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/ad23b7b6df5cbb5401b18950b42ac5b7033eebbcf5d173d8810efaab1a7e739f b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/ad23b7b6df5cbb5401b18950b42ac5b7033eebbcf5d173d8810efaab1a7e739f similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/ad23b7b6df5cbb5401b18950b42ac5b7033eebbcf5d173d8810efaab1a7e739f rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/ad23b7b6df5cbb5401b18950b42ac5b7033eebbcf5d173d8810efaab1a7e739f diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/ad5c2357e26fbf281d2b5b698813c005404e87a09a962ae34e2982163ad3afb4 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/ad5c2357e26fbf281d2b5b698813c005404e87a09a962ae34e2982163ad3afb4 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/ad5c2357e26fbf281d2b5b698813c005404e87a09a962ae34e2982163ad3afb4 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/ad5c2357e26fbf281d2b5b698813c005404e87a09a962ae34e2982163ad3afb4 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/ae621a7bd5b21329a1d73e9b4ee6bc9542f5ba3a39a00d62952d6ced252c65c2 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/ae621a7bd5b21329a1d73e9b4ee6bc9542f5ba3a39a00d62952d6ced252c65c2 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/ae621a7bd5b21329a1d73e9b4ee6bc9542f5ba3a39a00d62952d6ced252c65c2 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/ae621a7bd5b21329a1d73e9b4ee6bc9542f5ba3a39a00d62952d6ced252c65c2 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/b5e30ab2064468448b9be739a0c9b1fe7b771e7ffa371b1731c1abfee80ab4fa b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/b5e30ab2064468448b9be739a0c9b1fe7b771e7ffa371b1731c1abfee80ab4fa similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/b5e30ab2064468448b9be739a0c9b1fe7b771e7ffa371b1731c1abfee80ab4fa rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/b5e30ab2064468448b9be739a0c9b1fe7b771e7ffa371b1731c1abfee80ab4fa diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/c0371ba1fd0e227f6c7d56c1799e6fb06b97b7d0bd699c41694e4f2303f65c81 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/c0371ba1fd0e227f6c7d56c1799e6fb06b97b7d0bd699c41694e4f2303f65c81 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/c0371ba1fd0e227f6c7d56c1799e6fb06b97b7d0bd699c41694e4f2303f65c81 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/c0371ba1fd0e227f6c7d56c1799e6fb06b97b7d0bd699c41694e4f2303f65c81 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/c0b55f44bd076a4217cdb3ff5525a2f76750be3a8947f95c4cce52f726ac1791 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/c0b55f44bd076a4217cdb3ff5525a2f76750be3a8947f95c4cce52f726ac1791 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/c0b55f44bd076a4217cdb3ff5525a2f76750be3a8947f95c4cce52f726ac1791 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/c0b55f44bd076a4217cdb3ff5525a2f76750be3a8947f95c4cce52f726ac1791 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/c100165774438513093b1cfe2cc5dae62df7aa1837adbc698315c13b8b74108d b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/c100165774438513093b1cfe2cc5dae62df7aa1837adbc698315c13b8b74108d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/c100165774438513093b1cfe2cc5dae62df7aa1837adbc698315c13b8b74108d rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/c100165774438513093b1cfe2cc5dae62df7aa1837adbc698315c13b8b74108d diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/c5f90d312a285b4447df0aeba88c849dc5434feb6a1f0b4b67887725a43c8ac4 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/c5f90d312a285b4447df0aeba88c849dc5434feb6a1f0b4b67887725a43c8ac4 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/c5f90d312a285b4447df0aeba88c849dc5434feb6a1f0b4b67887725a43c8ac4 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/c5f90d312a285b4447df0aeba88c849dc5434feb6a1f0b4b67887725a43c8ac4 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/cab86d6bcd47c74de370c1205cbd07f006d235876da5be258519d62f7b01b285 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/cab86d6bcd47c74de370c1205cbd07f006d235876da5be258519d62f7b01b285 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/cab86d6bcd47c74de370c1205cbd07f006d235876da5be258519d62f7b01b285 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/cab86d6bcd47c74de370c1205cbd07f006d235876da5be258519d62f7b01b285 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/cae4038811b3220342c5e33eaea301a36453f458de74de5aec3f82aa3fa5e495 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/cae4038811b3220342c5e33eaea301a36453f458de74de5aec3f82aa3fa5e495 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/cae4038811b3220342c5e33eaea301a36453f458de74de5aec3f82aa3fa5e495 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/cae4038811b3220342c5e33eaea301a36453f458de74de5aec3f82aa3fa5e495 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/cb7f2d62ebe3e6f5e466fde7a5408f89d3b4a94e48b2480e3ff479a9f2f4191c b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/cb7f2d62ebe3e6f5e466fde7a5408f89d3b4a94e48b2480e3ff479a9f2f4191c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/cb7f2d62ebe3e6f5e466fde7a5408f89d3b4a94e48b2480e3ff479a9f2f4191c rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/cb7f2d62ebe3e6f5e466fde7a5408f89d3b4a94e48b2480e3ff479a9f2f4191c diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/cc8477b4f64a23e4831f95a7030c651521ec1323620a68012d04b8610520b657 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/cc8477b4f64a23e4831f95a7030c651521ec1323620a68012d04b8610520b657 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/cc8477b4f64a23e4831f95a7030c651521ec1323620a68012d04b8610520b657 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/cc8477b4f64a23e4831f95a7030c651521ec1323620a68012d04b8610520b657 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/cfd8088061d6ac7ae897e193282468c827dba67bc70b515b02d7ab7cb7a4ee9d b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/cfd8088061d6ac7ae897e193282468c827dba67bc70b515b02d7ab7cb7a4ee9d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/cfd8088061d6ac7ae897e193282468c827dba67bc70b515b02d7ab7cb7a4ee9d rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/cfd8088061d6ac7ae897e193282468c827dba67bc70b515b02d7ab7cb7a4ee9d diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/d09cd0b0b3efc76cffa01ff0b9321be4362eab020e83125cdcb7584c37a1cdf4 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/d09cd0b0b3efc76cffa01ff0b9321be4362eab020e83125cdcb7584c37a1cdf4 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/d09cd0b0b3efc76cffa01ff0b9321be4362eab020e83125cdcb7584c37a1cdf4 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/d09cd0b0b3efc76cffa01ff0b9321be4362eab020e83125cdcb7584c37a1cdf4 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/d1671ebffa7dcbb296c1dc03ef2b96c004af482939dea784422fce32f57e28e5 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/d1671ebffa7dcbb296c1dc03ef2b96c004af482939dea784422fce32f57e28e5 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/d1671ebffa7dcbb296c1dc03ef2b96c004af482939dea784422fce32f57e28e5 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/d1671ebffa7dcbb296c1dc03ef2b96c004af482939dea784422fce32f57e28e5 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/d355098922d2526d86cb9e6e7ff1e6833a610c71dd4a8a94897c7b37961f440e b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/d355098922d2526d86cb9e6e7ff1e6833a610c71dd4a8a94897c7b37961f440e similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/d355098922d2526d86cb9e6e7ff1e6833a610c71dd4a8a94897c7b37961f440e rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/d355098922d2526d86cb9e6e7ff1e6833a610c71dd4a8a94897c7b37961f440e diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/d358b717c063d1a8ec415b20d598e14447b78dc32e06c49e6f83646f37f83728 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/d358b717c063d1a8ec415b20d598e14447b78dc32e06c49e6f83646f37f83728 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/d358b717c063d1a8ec415b20d598e14447b78dc32e06c49e6f83646f37f83728 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/d358b717c063d1a8ec415b20d598e14447b78dc32e06c49e6f83646f37f83728 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/d40a98862ed393eb712e47a91bcef18e6f24cf368bb4bd248c7a7101ef8e178d b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/d40a98862ed393eb712e47a91bcef18e6f24cf368bb4bd248c7a7101ef8e178d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/d40a98862ed393eb712e47a91bcef18e6f24cf368bb4bd248c7a7101ef8e178d rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/d40a98862ed393eb712e47a91bcef18e6f24cf368bb4bd248c7a7101ef8e178d diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/d62b359a29f1b6a1be1864f84249b203a9f36d5e44a6600e2f57d7da22a34a8c b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/d62b359a29f1b6a1be1864f84249b203a9f36d5e44a6600e2f57d7da22a34a8c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/d62b359a29f1b6a1be1864f84249b203a9f36d5e44a6600e2f57d7da22a34a8c rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/d62b359a29f1b6a1be1864f84249b203a9f36d5e44a6600e2f57d7da22a34a8c diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/d65f6e55cc7a0053ff7980931bd3901bb6d95a1300abc0770111cb55c92cab00 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/d65f6e55cc7a0053ff7980931bd3901bb6d95a1300abc0770111cb55c92cab00 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/d65f6e55cc7a0053ff7980931bd3901bb6d95a1300abc0770111cb55c92cab00 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/d65f6e55cc7a0053ff7980931bd3901bb6d95a1300abc0770111cb55c92cab00 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/d7d7f42440f1d6c7b520cb8d52d56690f81047d931bf90953e0f7b1b5dfee17d b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/d7d7f42440f1d6c7b520cb8d52d56690f81047d931bf90953e0f7b1b5dfee17d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/d7d7f42440f1d6c7b520cb8d52d56690f81047d931bf90953e0f7b1b5dfee17d rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/d7d7f42440f1d6c7b520cb8d52d56690f81047d931bf90953e0f7b1b5dfee17d diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/d8b78f71f1110ca8ba2cc0d36446b41e530261a529accc4633797bc74356c05b b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/d8b78f71f1110ca8ba2cc0d36446b41e530261a529accc4633797bc74356c05b similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/d8b78f71f1110ca8ba2cc0d36446b41e530261a529accc4633797bc74356c05b rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/d8b78f71f1110ca8ba2cc0d36446b41e530261a529accc4633797bc74356c05b diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/dae006ed46219290fbf6462e7c0c62eb4f814c32bce6066c24c7b3432c0ba55b b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/dae006ed46219290fbf6462e7c0c62eb4f814c32bce6066c24c7b3432c0ba55b similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/dae006ed46219290fbf6462e7c0c62eb4f814c32bce6066c24c7b3432c0ba55b rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/dae006ed46219290fbf6462e7c0c62eb4f814c32bce6066c24c7b3432c0ba55b diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/dd27d9eff367005ddaf4ed4da8dad855f848921f166297de0494a220bb3f0558 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/dd27d9eff367005ddaf4ed4da8dad855f848921f166297de0494a220bb3f0558 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/dd27d9eff367005ddaf4ed4da8dad855f848921f166297de0494a220bb3f0558 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/dd27d9eff367005ddaf4ed4da8dad855f848921f166297de0494a220bb3f0558 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/de16b68fb638d6d9af8d1b7bf5a4224c4e0d17a9bd67f01cd26f21aa9f09e31b b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/de16b68fb638d6d9af8d1b7bf5a4224c4e0d17a9bd67f01cd26f21aa9f09e31b similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/de16b68fb638d6d9af8d1b7bf5a4224c4e0d17a9bd67f01cd26f21aa9f09e31b rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/de16b68fb638d6d9af8d1b7bf5a4224c4e0d17a9bd67f01cd26f21aa9f09e31b diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/de74372e9568272e458dd0db42712a6131461f4ead22c1e5df793b62ff295da7 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/de74372e9568272e458dd0db42712a6131461f4ead22c1e5df793b62ff295da7 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/de74372e9568272e458dd0db42712a6131461f4ead22c1e5df793b62ff295da7 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/de74372e9568272e458dd0db42712a6131461f4ead22c1e5df793b62ff295da7 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/e06dc0792445efa87addeeca3f61f5fd97b9adfff237b349212c0d99a95c260b b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/e06dc0792445efa87addeeca3f61f5fd97b9adfff237b349212c0d99a95c260b similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/e06dc0792445efa87addeeca3f61f5fd97b9adfff237b349212c0d99a95c260b rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/e06dc0792445efa87addeeca3f61f5fd97b9adfff237b349212c0d99a95c260b diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/e09a091511f567e64105712cf3bfb093193254b5b20bf502ca651f9522c0e8b3 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/e09a091511f567e64105712cf3bfb093193254b5b20bf502ca651f9522c0e8b3 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/e09a091511f567e64105712cf3bfb093193254b5b20bf502ca651f9522c0e8b3 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/e09a091511f567e64105712cf3bfb093193254b5b20bf502ca651f9522c0e8b3 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/e134f958c410a5d1c4621be4315765096bb8d165717c38d2679687a0bd81004a b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/e134f958c410a5d1c4621be4315765096bb8d165717c38d2679687a0bd81004a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/e134f958c410a5d1c4621be4315765096bb8d165717c38d2679687a0bd81004a rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/e134f958c410a5d1c4621be4315765096bb8d165717c38d2679687a0bd81004a diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/e1fe049b43b7e5f63a37a5cf87123180ab39584fc0f10850ba1785cceadd368a b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/e1fe049b43b7e5f63a37a5cf87123180ab39584fc0f10850ba1785cceadd368a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/e1fe049b43b7e5f63a37a5cf87123180ab39584fc0f10850ba1785cceadd368a rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/e1fe049b43b7e5f63a37a5cf87123180ab39584fc0f10850ba1785cceadd368a diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/e4e8f76c256e51ba6a13db64fc454c9f2b5f35ec98501c92e22d13c76a07d860 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/e4e8f76c256e51ba6a13db64fc454c9f2b5f35ec98501c92e22d13c76a07d860 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/e4e8f76c256e51ba6a13db64fc454c9f2b5f35ec98501c92e22d13c76a07d860 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/e4e8f76c256e51ba6a13db64fc454c9f2b5f35ec98501c92e22d13c76a07d860 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/e8f54327b788efddbe244685ce3d33d2225eb40a7d8b6df8853388420cffd669 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/e8f54327b788efddbe244685ce3d33d2225eb40a7d8b6df8853388420cffd669 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/e8f54327b788efddbe244685ce3d33d2225eb40a7d8b6df8853388420cffd669 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/e8f54327b788efddbe244685ce3d33d2225eb40a7d8b6df8853388420cffd669 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/eab0f9f31aa8b6bb7dda20997ddae8dc3e5659147f60a1251d90d1cb098b8ce0 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/eab0f9f31aa8b6bb7dda20997ddae8dc3e5659147f60a1251d90d1cb098b8ce0 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/eab0f9f31aa8b6bb7dda20997ddae8dc3e5659147f60a1251d90d1cb098b8ce0 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/eab0f9f31aa8b6bb7dda20997ddae8dc3e5659147f60a1251d90d1cb098b8ce0 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/eba1c57b048f2d081497f9fcd1bc41c5fafabc0ba2f86f81702277f61b6f5bb1 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/eba1c57b048f2d081497f9fcd1bc41c5fafabc0ba2f86f81702277f61b6f5bb1 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/eba1c57b048f2d081497f9fcd1bc41c5fafabc0ba2f86f81702277f61b6f5bb1 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/eba1c57b048f2d081497f9fcd1bc41c5fafabc0ba2f86f81702277f61b6f5bb1 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/edd635115b948f31ef995806897c0f4f72d26ef934bca9de2093874ee88b687a b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/edd635115b948f31ef995806897c0f4f72d26ef934bca9de2093874ee88b687a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/edd635115b948f31ef995806897c0f4f72d26ef934bca9de2093874ee88b687a rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/edd635115b948f31ef995806897c0f4f72d26ef934bca9de2093874ee88b687a diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/f4e2f15687358e3b39a81e447a977c2485a8036195204b94fdf2eaab496fc259 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/f4e2f15687358e3b39a81e447a977c2485a8036195204b94fdf2eaab496fc259 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/f4e2f15687358e3b39a81e447a977c2485a8036195204b94fdf2eaab496fc259 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/f4e2f15687358e3b39a81e447a977c2485a8036195204b94fdf2eaab496fc259 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/f63165dc9815532813779e5bb35e0bbacad6cc56b8f60bcfdac8950d5b87c27d b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/f63165dc9815532813779e5bb35e0bbacad6cc56b8f60bcfdac8950d5b87c27d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/f63165dc9815532813779e5bb35e0bbacad6cc56b8f60bcfdac8950d5b87c27d rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/f63165dc9815532813779e5bb35e0bbacad6cc56b8f60bcfdac8950d5b87c27d diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/f6b062f7f73ece1eec5dee382a1a24027e09d4e1dab77d2f0ddfb1fe3ca72a60 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/f6b062f7f73ece1eec5dee382a1a24027e09d4e1dab77d2f0ddfb1fe3ca72a60 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/f6b062f7f73ece1eec5dee382a1a24027e09d4e1dab77d2f0ddfb1fe3ca72a60 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/f6b062f7f73ece1eec5dee382a1a24027e09d4e1dab77d2f0ddfb1fe3ca72a60 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/f7b33d6fba42d564f20306b4ce8e737769a5bde5e444c0001a28235ac0ecaf9b b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/f7b33d6fba42d564f20306b4ce8e737769a5bde5e444c0001a28235ac0ecaf9b similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/f7b33d6fba42d564f20306b4ce8e737769a5bde5e444c0001a28235ac0ecaf9b rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/f7b33d6fba42d564f20306b4ce8e737769a5bde5e444c0001a28235ac0ecaf9b diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/f8dc6ac368b88f9786d1de85725ac090b7d8bc953ecc4dd0fed67172470ef605 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/f8dc6ac368b88f9786d1de85725ac090b7d8bc953ecc4dd0fed67172470ef605 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/f8dc6ac368b88f9786d1de85725ac090b7d8bc953ecc4dd0fed67172470ef605 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/f8dc6ac368b88f9786d1de85725ac090b7d8bc953ecc4dd0fed67172470ef605 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/fbbf3be50843c31412f972f0f853fd8f0fca523ccafae0d83ab00f8563040d47 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/fbbf3be50843c31412f972f0f853fd8f0fca523ccafae0d83ab00f8563040d47 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/fbbf3be50843c31412f972f0f853fd8f0fca523ccafae0d83ab00f8563040d47 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/fbbf3be50843c31412f972f0f853fd8f0fca523ccafae0d83ab00f8563040d47 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/fd6a7cf2c06cd8e63fd5d32a85e1e3d8d3c044b59b8051aaf52e57e15f6773c6 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/fd6a7cf2c06cd8e63fd5d32a85e1e3d8d3c044b59b8051aaf52e57e15f6773c6 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/fd6a7cf2c06cd8e63fd5d32a85e1e3d8d3c044b59b8051aaf52e57e15f6773c6 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/fd6a7cf2c06cd8e63fd5d32a85e1e3d8d3c044b59b8051aaf52e57e15f6773c6 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/ff84c9432bd0c097d3a9087d2095239b3962dec7d7d8e1fd3d8d9650c218dce0 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/ff84c9432bd0c097d3a9087d2095239b3962dec7d7d8e1fd3d8d9650c218dce0 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/ff84c9432bd0c097d3a9087d2095239b3962dec7d7d8e1fd3d8d9650c218dce0 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseCoin/ff84c9432bd0c097d3a9087d2095239b3962dec7d7d8e1fd3d8d9650c218dce0 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/04647ede5c3a758d0bf7ca64b0418c402481fa0fa332a876beb49771e3cc3aad b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/04647ede5c3a758d0bf7ca64b0418c402481fa0fa332a876beb49771e3cc3aad similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/04647ede5c3a758d0bf7ca64b0418c402481fa0fa332a876beb49771e3cc3aad rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/04647ede5c3a758d0bf7ca64b0418c402481fa0fa332a876beb49771e3cc3aad diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/075c5ea68f7f044109992e1790a9739f35c22c9facaaf776a9805b9f5ec0beaf b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/075c5ea68f7f044109992e1790a9739f35c22c9facaaf776a9805b9f5ec0beaf similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/075c5ea68f7f044109992e1790a9739f35c22c9facaaf776a9805b9f5ec0beaf rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/075c5ea68f7f044109992e1790a9739f35c22c9facaaf776a9805b9f5ec0beaf diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/0b61bf2002f13e8ff68b67f2d81c379ecd088ef859eea13d4d87c935bdd61093 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/0b61bf2002f13e8ff68b67f2d81c379ecd088ef859eea13d4d87c935bdd61093 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/0b61bf2002f13e8ff68b67f2d81c379ecd088ef859eea13d4d87c935bdd61093 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/0b61bf2002f13e8ff68b67f2d81c379ecd088ef859eea13d4d87c935bdd61093 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/0fbd4dd0648f5ee3647af3647df44bbdbae29cc325c77f22e917f92b5c05fc3a b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/0fbd4dd0648f5ee3647af3647df44bbdbae29cc325c77f22e917f92b5c05fc3a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/0fbd4dd0648f5ee3647af3647df44bbdbae29cc325c77f22e917f92b5c05fc3a rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/0fbd4dd0648f5ee3647af3647df44bbdbae29cc325c77f22e917f92b5c05fc3a diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/1342922545138266797b1752b3a00f908c31c788fc12ff752c8ee680eb483907 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/1342922545138266797b1752b3a00f908c31c788fc12ff752c8ee680eb483907 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/1342922545138266797b1752b3a00f908c31c788fc12ff752c8ee680eb483907 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/1342922545138266797b1752b3a00f908c31c788fc12ff752c8ee680eb483907 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/13b0c6c2dd02e0fa324a09490265ce04cc7f4da8887c09961a237cf1f2f0bf5c b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/13b0c6c2dd02e0fa324a09490265ce04cc7f4da8887c09961a237cf1f2f0bf5c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/13b0c6c2dd02e0fa324a09490265ce04cc7f4da8887c09961a237cf1f2f0bf5c rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/13b0c6c2dd02e0fa324a09490265ce04cc7f4da8887c09961a237cf1f2f0bf5c diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/151f48f592afc01dbbbc426b4555ae8a20dd09d35a328c286496efd0061af47c b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/151f48f592afc01dbbbc426b4555ae8a20dd09d35a328c286496efd0061af47c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/151f48f592afc01dbbbc426b4555ae8a20dd09d35a328c286496efd0061af47c rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/151f48f592afc01dbbbc426b4555ae8a20dd09d35a328c286496efd0061af47c diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/16ba986d83ceb60f50ea890e493cf451b2f68ace01dd975a65ad61c0540ed201 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/16ba986d83ceb60f50ea890e493cf451b2f68ace01dd975a65ad61c0540ed201 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/16ba986d83ceb60f50ea890e493cf451b2f68ace01dd975a65ad61c0540ed201 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/16ba986d83ceb60f50ea890e493cf451b2f68ace01dd975a65ad61c0540ed201 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/1873311f9002e4d4951fd5f7e0643d11672375772fe510bd464b46e0fd7ae51f b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/1873311f9002e4d4951fd5f7e0643d11672375772fe510bd464b46e0fd7ae51f similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/1873311f9002e4d4951fd5f7e0643d11672375772fe510bd464b46e0fd7ae51f rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/1873311f9002e4d4951fd5f7e0643d11672375772fe510bd464b46e0fd7ae51f diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/18ec9fe05605dd64d0d1f8d7d028906949ab8e6317fa54feedab37ffd5f17da5 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/18ec9fe05605dd64d0d1f8d7d028906949ab8e6317fa54feedab37ffd5f17da5 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/18ec9fe05605dd64d0d1f8d7d028906949ab8e6317fa54feedab37ffd5f17da5 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/18ec9fe05605dd64d0d1f8d7d028906949ab8e6317fa54feedab37ffd5f17da5 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/19d0f30e5c0f6de05f8b460afbc0426adaa48588ddee8c20acdf9bd5977942d5 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/19d0f30e5c0f6de05f8b460afbc0426adaa48588ddee8c20acdf9bd5977942d5 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/19d0f30e5c0f6de05f8b460afbc0426adaa48588ddee8c20acdf9bd5977942d5 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/19d0f30e5c0f6de05f8b460afbc0426adaa48588ddee8c20acdf9bd5977942d5 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/1a5c03401900f51ca7e383dca5870f03453df845299b75747a8efb80bee344ba b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/1a5c03401900f51ca7e383dca5870f03453df845299b75747a8efb80bee344ba similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/1a5c03401900f51ca7e383dca5870f03453df845299b75747a8efb80bee344ba rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/1a5c03401900f51ca7e383dca5870f03453df845299b75747a8efb80bee344ba diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/1a6b511bfcadf5745bd7a12b8806cabe48898d62d97205abc9e108d0cc51b932 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/1a6b511bfcadf5745bd7a12b8806cabe48898d62d97205abc9e108d0cc51b932 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/1a6b511bfcadf5745bd7a12b8806cabe48898d62d97205abc9e108d0cc51b932 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/1a6b511bfcadf5745bd7a12b8806cabe48898d62d97205abc9e108d0cc51b932 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/1b370014fb6385958b5d0e4ffbda66716d4e96e007f455837ca36f6653055b4c b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/1b370014fb6385958b5d0e4ffbda66716d4e96e007f455837ca36f6653055b4c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/1b370014fb6385958b5d0e4ffbda66716d4e96e007f455837ca36f6653055b4c rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/1b370014fb6385958b5d0e4ffbda66716d4e96e007f455837ca36f6653055b4c diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/1c9a20fc3f8d48286f50c35fdc4b1c48a47543d923aaa9607a9a088620724cd4 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/1c9a20fc3f8d48286f50c35fdc4b1c48a47543d923aaa9607a9a088620724cd4 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/1c9a20fc3f8d48286f50c35fdc4b1c48a47543d923aaa9607a9a088620724cd4 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/1c9a20fc3f8d48286f50c35fdc4b1c48a47543d923aaa9607a9a088620724cd4 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/216c57661359efa4fedd42d7c587ef5d34eba3a408daa333acaf6e661c717c6c b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/216c57661359efa4fedd42d7c587ef5d34eba3a408daa333acaf6e661c717c6c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/216c57661359efa4fedd42d7c587ef5d34eba3a408daa333acaf6e661c717c6c rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/216c57661359efa4fedd42d7c587ef5d34eba3a408daa333acaf6e661c717c6c diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/23352fb8dad6fc8c098f0034898c58714f58c06d48ca639ef3537514a7cf68fd b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/23352fb8dad6fc8c098f0034898c58714f58c06d48ca639ef3537514a7cf68fd similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/23352fb8dad6fc8c098f0034898c58714f58c06d48ca639ef3537514a7cf68fd rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/23352fb8dad6fc8c098f0034898c58714f58c06d48ca639ef3537514a7cf68fd diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/25d4372c335d44b4e7e34270bac19b3737640144b33af31b27e3ee7699397012 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/25d4372c335d44b4e7e34270bac19b3737640144b33af31b27e3ee7699397012 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/25d4372c335d44b4e7e34270bac19b3737640144b33af31b27e3ee7699397012 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/25d4372c335d44b4e7e34270bac19b3737640144b33af31b27e3ee7699397012 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/2984a5d58751278cc512da3ffd124db6853b91121e9911d2313eb55833dda26b b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/2984a5d58751278cc512da3ffd124db6853b91121e9911d2313eb55833dda26b similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/2984a5d58751278cc512da3ffd124db6853b91121e9911d2313eb55833dda26b rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/2984a5d58751278cc512da3ffd124db6853b91121e9911d2313eb55833dda26b diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/2a8952efa316bbc754dd0420e1b3f4e3f874ce08657bd412e007165b449aef57 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/2a8952efa316bbc754dd0420e1b3f4e3f874ce08657bd412e007165b449aef57 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/2a8952efa316bbc754dd0420e1b3f4e3f874ce08657bd412e007165b449aef57 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/2a8952efa316bbc754dd0420e1b3f4e3f874ce08657bd412e007165b449aef57 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/2cd5b6bcd95ceccd48bfbdaade86d9ae72f5c93b65e98fab76b416ceb15886f0 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/2cd5b6bcd95ceccd48bfbdaade86d9ae72f5c93b65e98fab76b416ceb15886f0 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/2cd5b6bcd95ceccd48bfbdaade86d9ae72f5c93b65e98fab76b416ceb15886f0 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/2cd5b6bcd95ceccd48bfbdaade86d9ae72f5c93b65e98fab76b416ceb15886f0 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/2d83b5ebc8d98b412d1c62bd3d86ad2dc31ea3b7d92060d2b5516a730b5bf313 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/2d83b5ebc8d98b412d1c62bd3d86ad2dc31ea3b7d92060d2b5516a730b5bf313 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/2d83b5ebc8d98b412d1c62bd3d86ad2dc31ea3b7d92060d2b5516a730b5bf313 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/2d83b5ebc8d98b412d1c62bd3d86ad2dc31ea3b7d92060d2b5516a730b5bf313 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/31e5da337c1bb3c14e939b02fe0f4f8a62f9ce4abaae764f8bf7cc4366807c4f b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/31e5da337c1bb3c14e939b02fe0f4f8a62f9ce4abaae764f8bf7cc4366807c4f similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/31e5da337c1bb3c14e939b02fe0f4f8a62f9ce4abaae764f8bf7cc4366807c4f rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/31e5da337c1bb3c14e939b02fe0f4f8a62f9ce4abaae764f8bf7cc4366807c4f diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/327a976d8e41774023e8e3209e1aebd9e95a0b48280d3787c62a51e6ed5f7880 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/327a976d8e41774023e8e3209e1aebd9e95a0b48280d3787c62a51e6ed5f7880 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/327a976d8e41774023e8e3209e1aebd9e95a0b48280d3787c62a51e6ed5f7880 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/327a976d8e41774023e8e3209e1aebd9e95a0b48280d3787c62a51e6ed5f7880 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/33f03c88c654fbf0a0ba0dfc4b6aa179b6a87a0a5bf81ef3128d02470f126e66 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/33f03c88c654fbf0a0ba0dfc4b6aa179b6a87a0a5bf81ef3128d02470f126e66 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/33f03c88c654fbf0a0ba0dfc4b6aa179b6a87a0a5bf81ef3128d02470f126e66 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/33f03c88c654fbf0a0ba0dfc4b6aa179b6a87a0a5bf81ef3128d02470f126e66 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/35e3544cc0b561528f69711a1b4de170968f9ef7b2e576b0141511b1cc26f0af b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/35e3544cc0b561528f69711a1b4de170968f9ef7b2e576b0141511b1cc26f0af similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/35e3544cc0b561528f69711a1b4de170968f9ef7b2e576b0141511b1cc26f0af rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/35e3544cc0b561528f69711a1b4de170968f9ef7b2e576b0141511b1cc26f0af diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/362cb7ced36f976ea86fee30597de7d1714b4a04160c90e09310a935a807a8cf b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/362cb7ced36f976ea86fee30597de7d1714b4a04160c90e09310a935a807a8cf similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/362cb7ced36f976ea86fee30597de7d1714b4a04160c90e09310a935a807a8cf rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/362cb7ced36f976ea86fee30597de7d1714b4a04160c90e09310a935a807a8cf diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/3661fc3dbb654628f98a14a3fdef1f836bf61635af5dbe82ed678cbf86b7ffb8 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/3661fc3dbb654628f98a14a3fdef1f836bf61635af5dbe82ed678cbf86b7ffb8 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/3661fc3dbb654628f98a14a3fdef1f836bf61635af5dbe82ed678cbf86b7ffb8 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/3661fc3dbb654628f98a14a3fdef1f836bf61635af5dbe82ed678cbf86b7ffb8 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/37f2f2e91745ca13608ce19ed612285f5d7a2efab8dd2c147520274fc500c78a b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/37f2f2e91745ca13608ce19ed612285f5d7a2efab8dd2c147520274fc500c78a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/37f2f2e91745ca13608ce19ed612285f5d7a2efab8dd2c147520274fc500c78a rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/37f2f2e91745ca13608ce19ed612285f5d7a2efab8dd2c147520274fc500c78a diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/38fb266a5cbd15839637dd30d90a64294ee179c03ebcd3a0a80ea6f4d451429e b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/38fb266a5cbd15839637dd30d90a64294ee179c03ebcd3a0a80ea6f4d451429e similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/38fb266a5cbd15839637dd30d90a64294ee179c03ebcd3a0a80ea6f4d451429e rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/38fb266a5cbd15839637dd30d90a64294ee179c03ebcd3a0a80ea6f4d451429e diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/3d33732150c81072d88d84c52f0bdfb63ca9b1b7b5072b682053e530f7da05f4 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/3d33732150c81072d88d84c52f0bdfb63ca9b1b7b5072b682053e530f7da05f4 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/3d33732150c81072d88d84c52f0bdfb63ca9b1b7b5072b682053e530f7da05f4 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/3d33732150c81072d88d84c52f0bdfb63ca9b1b7b5072b682053e530f7da05f4 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/3d3aa91be9928367c17f11c7be56cc644d12c2902a7b7d84a8302b1a3aea3823 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/3d3aa91be9928367c17f11c7be56cc644d12c2902a7b7d84a8302b1a3aea3823 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/3d3aa91be9928367c17f11c7be56cc644d12c2902a7b7d84a8302b1a3aea3823 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/3d3aa91be9928367c17f11c7be56cc644d12c2902a7b7d84a8302b1a3aea3823 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/3d80549771ce32c1478dcdb232223337d9d26920067f7dcf871629beb60b196a b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/3d80549771ce32c1478dcdb232223337d9d26920067f7dcf871629beb60b196a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/3d80549771ce32c1478dcdb232223337d9d26920067f7dcf871629beb60b196a rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/3d80549771ce32c1478dcdb232223337d9d26920067f7dcf871629beb60b196a diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/3db3646581bb8883d8ccb79265d8502a7dbe0427d52802e7d5972d97f8d5fca4 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/3db3646581bb8883d8ccb79265d8502a7dbe0427d52802e7d5972d97f8d5fca4 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/3db3646581bb8883d8ccb79265d8502a7dbe0427d52802e7d5972d97f8d5fca4 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/3db3646581bb8883d8ccb79265d8502a7dbe0427d52802e7d5972d97f8d5fca4 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/3e348ea8c43b5acf2d934946592842d6125070c86e31393cff4a8e1aafd9d69d b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/3e348ea8c43b5acf2d934946592842d6125070c86e31393cff4a8e1aafd9d69d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/3e348ea8c43b5acf2d934946592842d6125070c86e31393cff4a8e1aafd9d69d rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/3e348ea8c43b5acf2d934946592842d6125070c86e31393cff4a8e1aafd9d69d diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/413b0fbbc70f274bdffb85ca6e0f9debb159e711a7f96461a5ead57a3ae1892e b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/413b0fbbc70f274bdffb85ca6e0f9debb159e711a7f96461a5ead57a3ae1892e similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/413b0fbbc70f274bdffb85ca6e0f9debb159e711a7f96461a5ead57a3ae1892e rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/413b0fbbc70f274bdffb85ca6e0f9debb159e711a7f96461a5ead57a3ae1892e diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/419d7c64de1f9fcc2bb52ec313924f7998a8456bd72bda60fffacfe52dce2445 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/419d7c64de1f9fcc2bb52ec313924f7998a8456bd72bda60fffacfe52dce2445 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/419d7c64de1f9fcc2bb52ec313924f7998a8456bd72bda60fffacfe52dce2445 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/419d7c64de1f9fcc2bb52ec313924f7998a8456bd72bda60fffacfe52dce2445 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/426bf51c6ce75081c3d67105fde63b4b8475f64dc21b17a6373a13832425b870 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/426bf51c6ce75081c3d67105fde63b4b8475f64dc21b17a6373a13832425b870 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/426bf51c6ce75081c3d67105fde63b4b8475f64dc21b17a6373a13832425b870 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/426bf51c6ce75081c3d67105fde63b4b8475f64dc21b17a6373a13832425b870 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/435f4ba274a8ce6a552474d3054799966eb5a54f96b3b9be4bde5146ee850d52 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/435f4ba274a8ce6a552474d3054799966eb5a54f96b3b9be4bde5146ee850d52 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/435f4ba274a8ce6a552474d3054799966eb5a54f96b3b9be4bde5146ee850d52 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/435f4ba274a8ce6a552474d3054799966eb5a54f96b3b9be4bde5146ee850d52 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/452dac1ff79093ec5a49f06c11c6118293db6fb00010547fcd9e2937776752f0 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/452dac1ff79093ec5a49f06c11c6118293db6fb00010547fcd9e2937776752f0 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/452dac1ff79093ec5a49f06c11c6118293db6fb00010547fcd9e2937776752f0 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/452dac1ff79093ec5a49f06c11c6118293db6fb00010547fcd9e2937776752f0 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/47b90356d2e2dd4e5015316c5c270c48b2b6a3956feaba572d0de9537121023d b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/47b90356d2e2dd4e5015316c5c270c48b2b6a3956feaba572d0de9537121023d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/47b90356d2e2dd4e5015316c5c270c48b2b6a3956feaba572d0de9537121023d rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/47b90356d2e2dd4e5015316c5c270c48b2b6a3956feaba572d0de9537121023d diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/487ad84c5a500666f55b0750ccb18a527a42a5bef2f59eb585b7bd6f60c61405 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/487ad84c5a500666f55b0750ccb18a527a42a5bef2f59eb585b7bd6f60c61405 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/487ad84c5a500666f55b0750ccb18a527a42a5bef2f59eb585b7bd6f60c61405 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/487ad84c5a500666f55b0750ccb18a527a42a5bef2f59eb585b7bd6f60c61405 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/48ae23f5ae600b494bb2b556ff981d6b8807513dba93af4c5f515fdddb005622 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/48ae23f5ae600b494bb2b556ff981d6b8807513dba93af4c5f515fdddb005622 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/48ae23f5ae600b494bb2b556ff981d6b8807513dba93af4c5f515fdddb005622 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/48ae23f5ae600b494bb2b556ff981d6b8807513dba93af4c5f515fdddb005622 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/4a1bb791f0a9109c4262ae1556777c967921a027e2570328b49d286b2bd03b7b b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/4a1bb791f0a9109c4262ae1556777c967921a027e2570328b49d286b2bd03b7b similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/4a1bb791f0a9109c4262ae1556777c967921a027e2570328b49d286b2bd03b7b rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/4a1bb791f0a9109c4262ae1556777c967921a027e2570328b49d286b2bd03b7b diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/4ab9aad8851d1a3a77c01b6fcccba495f40cce0cb8e1ebcae1f5ebe5edcbe22f b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/4ab9aad8851d1a3a77c01b6fcccba495f40cce0cb8e1ebcae1f5ebe5edcbe22f similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/4ab9aad8851d1a3a77c01b6fcccba495f40cce0cb8e1ebcae1f5ebe5edcbe22f rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/4ab9aad8851d1a3a77c01b6fcccba495f40cce0cb8e1ebcae1f5ebe5edcbe22f diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/4f7eee72e261b948c0c6b5cd7720d2d6c9c3aa4dab8aee72cca7589891f768f0 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/4f7eee72e261b948c0c6b5cd7720d2d6c9c3aa4dab8aee72cca7589891f768f0 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/4f7eee72e261b948c0c6b5cd7720d2d6c9c3aa4dab8aee72cca7589891f768f0 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/4f7eee72e261b948c0c6b5cd7720d2d6c9c3aa4dab8aee72cca7589891f768f0 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/50cb7f3de95f66f2cbffedb0ccb20d3a1ec0aa0e92f4ff1d872c993e298ca058 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/50cb7f3de95f66f2cbffedb0ccb20d3a1ec0aa0e92f4ff1d872c993e298ca058 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/50cb7f3de95f66f2cbffedb0ccb20d3a1ec0aa0e92f4ff1d872c993e298ca058 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/50cb7f3de95f66f2cbffedb0ccb20d3a1ec0aa0e92f4ff1d872c993e298ca058 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/543126c16e0f3c6858fbd3bb36707510f0380f11f98a65188d18df1a0f96fc2c b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/543126c16e0f3c6858fbd3bb36707510f0380f11f98a65188d18df1a0f96fc2c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/543126c16e0f3c6858fbd3bb36707510f0380f11f98a65188d18df1a0f96fc2c rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/543126c16e0f3c6858fbd3bb36707510f0380f11f98a65188d18df1a0f96fc2c diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/573243386cee8a34930e9b2ed47b0e0a9840a12588d8eab6359dba3fa0fb1bb0 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/573243386cee8a34930e9b2ed47b0e0a9840a12588d8eab6359dba3fa0fb1bb0 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/573243386cee8a34930e9b2ed47b0e0a9840a12588d8eab6359dba3fa0fb1bb0 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/573243386cee8a34930e9b2ed47b0e0a9840a12588d8eab6359dba3fa0fb1bb0 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/581c5670591d8fcc77f4327b80e6a203a354dc2e3f6aaeed28f3f169e39fbc30 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/581c5670591d8fcc77f4327b80e6a203a354dc2e3f6aaeed28f3f169e39fbc30 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/581c5670591d8fcc77f4327b80e6a203a354dc2e3f6aaeed28f3f169e39fbc30 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/581c5670591d8fcc77f4327b80e6a203a354dc2e3f6aaeed28f3f169e39fbc30 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/5e63f04887d53763f13c0c696547ffffc429a936531cc4a25347c29ebc55abac b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/5e63f04887d53763f13c0c696547ffffc429a936531cc4a25347c29ebc55abac similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/5e63f04887d53763f13c0c696547ffffc429a936531cc4a25347c29ebc55abac rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/5e63f04887d53763f13c0c696547ffffc429a936531cc4a25347c29ebc55abac diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/618be06bc02dc5a2e13fe0a4c3687192848b702ee978321da63e0d6eda2bdd8f b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/618be06bc02dc5a2e13fe0a4c3687192848b702ee978321da63e0d6eda2bdd8f similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/618be06bc02dc5a2e13fe0a4c3687192848b702ee978321da63e0d6eda2bdd8f rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/618be06bc02dc5a2e13fe0a4c3687192848b702ee978321da63e0d6eda2bdd8f diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/62fba6640670c8a8f729f7544809bb7bdc70e43b128a0d0fe69e98bbaed043d1 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/62fba6640670c8a8f729f7544809bb7bdc70e43b128a0d0fe69e98bbaed043d1 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/62fba6640670c8a8f729f7544809bb7bdc70e43b128a0d0fe69e98bbaed043d1 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/62fba6640670c8a8f729f7544809bb7bdc70e43b128a0d0fe69e98bbaed043d1 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/648ce49d4a4b976ea69b2dc8f211725a91b9acb047ac1738ca9d93cfef3196c7 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/648ce49d4a4b976ea69b2dc8f211725a91b9acb047ac1738ca9d93cfef3196c7 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/648ce49d4a4b976ea69b2dc8f211725a91b9acb047ac1738ca9d93cfef3196c7 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/648ce49d4a4b976ea69b2dc8f211725a91b9acb047ac1738ca9d93cfef3196c7 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/66c41bd2a041069b89fcd3ca60eca2299d6bebf99de8e5ec481ca18d2fd3e17c b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/66c41bd2a041069b89fcd3ca60eca2299d6bebf99de8e5ec481ca18d2fd3e17c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/66c41bd2a041069b89fcd3ca60eca2299d6bebf99de8e5ec481ca18d2fd3e17c rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/66c41bd2a041069b89fcd3ca60eca2299d6bebf99de8e5ec481ca18d2fd3e17c diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/66db09464ebb727edcf041edac4e24cfb60faf8f49ea556d43701dc255a6dfcc b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/66db09464ebb727edcf041edac4e24cfb60faf8f49ea556d43701dc255a6dfcc similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/66db09464ebb727edcf041edac4e24cfb60faf8f49ea556d43701dc255a6dfcc rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/66db09464ebb727edcf041edac4e24cfb60faf8f49ea556d43701dc255a6dfcc diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/6b404e14d281d28e1aa9bcd8ecab994f45459483c631a3ff5cff79e653918a85 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/6b404e14d281d28e1aa9bcd8ecab994f45459483c631a3ff5cff79e653918a85 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/6b404e14d281d28e1aa9bcd8ecab994f45459483c631a3ff5cff79e653918a85 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/6b404e14d281d28e1aa9bcd8ecab994f45459483c631a3ff5cff79e653918a85 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/73ad18df4697da4bfbd30e3706cd5753eda1d590d156cebb4bd8a1e417b55e1e b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/73ad18df4697da4bfbd30e3706cd5753eda1d590d156cebb4bd8a1e417b55e1e similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/73ad18df4697da4bfbd30e3706cd5753eda1d590d156cebb4bd8a1e417b55e1e rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/73ad18df4697da4bfbd30e3706cd5753eda1d590d156cebb4bd8a1e417b55e1e diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/74f482691092d1785566ee8f4aec23d1b833487bf38623660059c04d22fa30d0 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/74f482691092d1785566ee8f4aec23d1b833487bf38623660059c04d22fa30d0 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/74f482691092d1785566ee8f4aec23d1b833487bf38623660059c04d22fa30d0 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/74f482691092d1785566ee8f4aec23d1b833487bf38623660059c04d22fa30d0 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/7689256a5cb02353ec2c5cdb50cc72194ec9500c20aefe01aaf48748319c5645 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/7689256a5cb02353ec2c5cdb50cc72194ec9500c20aefe01aaf48748319c5645 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/7689256a5cb02353ec2c5cdb50cc72194ec9500c20aefe01aaf48748319c5645 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/7689256a5cb02353ec2c5cdb50cc72194ec9500c20aefe01aaf48748319c5645 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/7800a4f457b26b910e532dcce56ab65f98367c05c9dc9de3c258fa861175b4ab b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/7800a4f457b26b910e532dcce56ab65f98367c05c9dc9de3c258fa861175b4ab similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/7800a4f457b26b910e532dcce56ab65f98367c05c9dc9de3c258fa861175b4ab rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/7800a4f457b26b910e532dcce56ab65f98367c05c9dc9de3c258fa861175b4ab diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/79008a394206825d854870b976bc96cf95eada5a67b363005c9eecc397fbb2d6 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/79008a394206825d854870b976bc96cf95eada5a67b363005c9eecc397fbb2d6 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/79008a394206825d854870b976bc96cf95eada5a67b363005c9eecc397fbb2d6 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/79008a394206825d854870b976bc96cf95eada5a67b363005c9eecc397fbb2d6 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/7aa90c842d28bf53d23e7bd6eb15cf01d81170461960eb913245ce158a4d1193 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/7aa90c842d28bf53d23e7bd6eb15cf01d81170461960eb913245ce158a4d1193 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/7aa90c842d28bf53d23e7bd6eb15cf01d81170461960eb913245ce158a4d1193 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/7aa90c842d28bf53d23e7bd6eb15cf01d81170461960eb913245ce158a4d1193 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/7b00f043f83b692621f02bb805f2d6540a024307bbd8910120bd293aabb755b4 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/7b00f043f83b692621f02bb805f2d6540a024307bbd8910120bd293aabb755b4 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/7b00f043f83b692621f02bb805f2d6540a024307bbd8910120bd293aabb755b4 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/7b00f043f83b692621f02bb805f2d6540a024307bbd8910120bd293aabb755b4 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/7d557dcebdcdd330e321a58eac60b34e49b4039457948e1672a0056b032f01aa b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/7d557dcebdcdd330e321a58eac60b34e49b4039457948e1672a0056b032f01aa similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/7d557dcebdcdd330e321a58eac60b34e49b4039457948e1672a0056b032f01aa rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/7d557dcebdcdd330e321a58eac60b34e49b4039457948e1672a0056b032f01aa diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/7d5bef183e24e378f067f541497febc9a4593c8a069c80e321022419290ca54c b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/7d5bef183e24e378f067f541497febc9a4593c8a069c80e321022419290ca54c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/7d5bef183e24e378f067f541497febc9a4593c8a069c80e321022419290ca54c rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/7d5bef183e24e378f067f541497febc9a4593c8a069c80e321022419290ca54c diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/7d6b860da720039cae33a2f4f7e3cf07860355d3804a6c946684ff5252841158 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/7d6b860da720039cae33a2f4f7e3cf07860355d3804a6c946684ff5252841158 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/7d6b860da720039cae33a2f4f7e3cf07860355d3804a6c946684ff5252841158 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/7d6b860da720039cae33a2f4f7e3cf07860355d3804a6c946684ff5252841158 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/7d9b9dc62f60e2e99ecdad198f8ddc56a917a6485990ca9d0227fe5352fcd287 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/7d9b9dc62f60e2e99ecdad198f8ddc56a917a6485990ca9d0227fe5352fcd287 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/7d9b9dc62f60e2e99ecdad198f8ddc56a917a6485990ca9d0227fe5352fcd287 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/7d9b9dc62f60e2e99ecdad198f8ddc56a917a6485990ca9d0227fe5352fcd287 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/814465532a89eb51711a5f316a50a474b5aac1d7327b03b093d83195b9c6c43d b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/814465532a89eb51711a5f316a50a474b5aac1d7327b03b093d83195b9c6c43d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/814465532a89eb51711a5f316a50a474b5aac1d7327b03b093d83195b9c6c43d rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/814465532a89eb51711a5f316a50a474b5aac1d7327b03b093d83195b9c6c43d diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/822457c9478a56a6792cf8eab591f502db630539f9b429623d9c28ea242dd59a b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/822457c9478a56a6792cf8eab591f502db630539f9b429623d9c28ea242dd59a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/822457c9478a56a6792cf8eab591f502db630539f9b429623d9c28ea242dd59a rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/822457c9478a56a6792cf8eab591f502db630539f9b429623d9c28ea242dd59a diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/82a0370d6e8ba30785bfa6968b9a62a60d5db21b289a28a4a730a9fcbacb9133 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/82a0370d6e8ba30785bfa6968b9a62a60d5db21b289a28a4a730a9fcbacb9133 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/82a0370d6e8ba30785bfa6968b9a62a60d5db21b289a28a4a730a9fcbacb9133 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/82a0370d6e8ba30785bfa6968b9a62a60d5db21b289a28a4a730a9fcbacb9133 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/8503f6c11c16636152a88e4f444b06b310b7b2d41f8c3108ff93a63f45e85ed8 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/8503f6c11c16636152a88e4f444b06b310b7b2d41f8c3108ff93a63f45e85ed8 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/8503f6c11c16636152a88e4f444b06b310b7b2d41f8c3108ff93a63f45e85ed8 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/8503f6c11c16636152a88e4f444b06b310b7b2d41f8c3108ff93a63f45e85ed8 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/85545313de8c5770996dd973e9a30123a0fce12f9890544ef0f1ef5e9791e1bb b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/85545313de8c5770996dd973e9a30123a0fce12f9890544ef0f1ef5e9791e1bb similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/85545313de8c5770996dd973e9a30123a0fce12f9890544ef0f1ef5e9791e1bb rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/85545313de8c5770996dd973e9a30123a0fce12f9890544ef0f1ef5e9791e1bb diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/8b7b7b8b1f2bba443f8acbb1d238a0cfcee5f08af8d84ea36d6e9f1527cd7fe4 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/8b7b7b8b1f2bba443f8acbb1d238a0cfcee5f08af8d84ea36d6e9f1527cd7fe4 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/8b7b7b8b1f2bba443f8acbb1d238a0cfcee5f08af8d84ea36d6e9f1527cd7fe4 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/8b7b7b8b1f2bba443f8acbb1d238a0cfcee5f08af8d84ea36d6e9f1527cd7fe4 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/8b7ba095eb01bc3817784743b08a9f6170ee7c2e10099807a993b2d6aa8aacac b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/8b7ba095eb01bc3817784743b08a9f6170ee7c2e10099807a993b2d6aa8aacac similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/8b7ba095eb01bc3817784743b08a9f6170ee7c2e10099807a993b2d6aa8aacac rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/8b7ba095eb01bc3817784743b08a9f6170ee7c2e10099807a993b2d6aa8aacac diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/8d2418deee244161864f3e7e253d000144474bd726d1612da5aea763b00d568d b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/8d2418deee244161864f3e7e253d000144474bd726d1612da5aea763b00d568d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/8d2418deee244161864f3e7e253d000144474bd726d1612da5aea763b00d568d rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/8d2418deee244161864f3e7e253d000144474bd726d1612da5aea763b00d568d diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/90c28f26bf7fb47a208af3e9102168523144b23a12f66e705aab7304a3ed23d0 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/90c28f26bf7fb47a208af3e9102168523144b23a12f66e705aab7304a3ed23d0 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/90c28f26bf7fb47a208af3e9102168523144b23a12f66e705aab7304a3ed23d0 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/90c28f26bf7fb47a208af3e9102168523144b23a12f66e705aab7304a3ed23d0 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/92c46305750d74fd6134268c7d8979bca39a2a07408e9ecf5099ea19da168da1 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/92c46305750d74fd6134268c7d8979bca39a2a07408e9ecf5099ea19da168da1 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/92c46305750d74fd6134268c7d8979bca39a2a07408e9ecf5099ea19da168da1 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/92c46305750d74fd6134268c7d8979bca39a2a07408e9ecf5099ea19da168da1 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/93e2a9a66ea46364d15692ccf27f502e85f250bcf183bbbf16b4cb5bd04e2610 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/93e2a9a66ea46364d15692ccf27f502e85f250bcf183bbbf16b4cb5bd04e2610 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/93e2a9a66ea46364d15692ccf27f502e85f250bcf183bbbf16b4cb5bd04e2610 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/93e2a9a66ea46364d15692ccf27f502e85f250bcf183bbbf16b4cb5bd04e2610 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/9528a924335c9608e0c6639c07f57797074df68023ab667bbf32b23e926edee8 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/9528a924335c9608e0c6639c07f57797074df68023ab667bbf32b23e926edee8 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/9528a924335c9608e0c6639c07f57797074df68023ab667bbf32b23e926edee8 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/9528a924335c9608e0c6639c07f57797074df68023ab667bbf32b23e926edee8 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/955ba0330f84c11181bd2017387c4c173fb6aed5e8fcbb452609ddcfb2873209 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/955ba0330f84c11181bd2017387c4c173fb6aed5e8fcbb452609ddcfb2873209 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/955ba0330f84c11181bd2017387c4c173fb6aed5e8fcbb452609ddcfb2873209 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/955ba0330f84c11181bd2017387c4c173fb6aed5e8fcbb452609ddcfb2873209 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/9622a7a0a5baf571ded678338683459c893a5d3177c5bedacc467c2d838f6905 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/9622a7a0a5baf571ded678338683459c893a5d3177c5bedacc467c2d838f6905 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/9622a7a0a5baf571ded678338683459c893a5d3177c5bedacc467c2d838f6905 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/9622a7a0a5baf571ded678338683459c893a5d3177c5bedacc467c2d838f6905 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/9638437096a6d6e9bda93cbea3846b5a24fd025f1f130f64a8696623b52346cf b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/9638437096a6d6e9bda93cbea3846b5a24fd025f1f130f64a8696623b52346cf similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/9638437096a6d6e9bda93cbea3846b5a24fd025f1f130f64a8696623b52346cf rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/9638437096a6d6e9bda93cbea3846b5a24fd025f1f130f64a8696623b52346cf diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/972c38dfd2f64c7db228365c3187329f9ffce47014e76de691bde87ff5f16889 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/972c38dfd2f64c7db228365c3187329f9ffce47014e76de691bde87ff5f16889 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/972c38dfd2f64c7db228365c3187329f9ffce47014e76de691bde87ff5f16889 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/972c38dfd2f64c7db228365c3187329f9ffce47014e76de691bde87ff5f16889 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/98b0b13f36417a7a439d605f3bf96c96ffd4b38f281a7a68aba75872e5c47f84 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/98b0b13f36417a7a439d605f3bf96c96ffd4b38f281a7a68aba75872e5c47f84 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/98b0b13f36417a7a439d605f3bf96c96ffd4b38f281a7a68aba75872e5c47f84 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/98b0b13f36417a7a439d605f3bf96c96ffd4b38f281a7a68aba75872e5c47f84 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/98b4c57ab61125d7419d808655499b6bfc2e9d7e16b4a62da7c361368a9d8a5e b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/98b4c57ab61125d7419d808655499b6bfc2e9d7e16b4a62da7c361368a9d8a5e similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/98b4c57ab61125d7419d808655499b6bfc2e9d7e16b4a62da7c361368a9d8a5e rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/98b4c57ab61125d7419d808655499b6bfc2e9d7e16b4a62da7c361368a9d8a5e diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/9a3852422ebb614383964f28ab5f1481c72a658df52e6a20da3ccbb3265c1981 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/9a3852422ebb614383964f28ab5f1481c72a658df52e6a20da3ccbb3265c1981 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/9a3852422ebb614383964f28ab5f1481c72a658df52e6a20da3ccbb3265c1981 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/9a3852422ebb614383964f28ab5f1481c72a658df52e6a20da3ccbb3265c1981 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/9ce26d08d18e060c146ba43d7c00d81829d80a01b837f5b6cafc1b37dd5c7abd b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/9ce26d08d18e060c146ba43d7c00d81829d80a01b837f5b6cafc1b37dd5c7abd similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/9ce26d08d18e060c146ba43d7c00d81829d80a01b837f5b6cafc1b37dd5c7abd rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/9ce26d08d18e060c146ba43d7c00d81829d80a01b837f5b6cafc1b37dd5c7abd diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/9d995b593c560e40858a97283848d4394171b0de99b3b9c872ebb08e1225af6c b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/9d995b593c560e40858a97283848d4394171b0de99b3b9c872ebb08e1225af6c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/9d995b593c560e40858a97283848d4394171b0de99b3b9c872ebb08e1225af6c rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/9d995b593c560e40858a97283848d4394171b0de99b3b9c872ebb08e1225af6c diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/a22bb4c79b8568d6a1c271e5f6c7d629555e3bd71e2a6cf1a6d6b0c403d1bb18 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/a22bb4c79b8568d6a1c271e5f6c7d629555e3bd71e2a6cf1a6d6b0c403d1bb18 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/a22bb4c79b8568d6a1c271e5f6c7d629555e3bd71e2a6cf1a6d6b0c403d1bb18 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/a22bb4c79b8568d6a1c271e5f6c7d629555e3bd71e2a6cf1a6d6b0c403d1bb18 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/a2fc8a5a5a394422401adebf61b87500a82ff99da8d64c011d30b2acd1f66fb4 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/a2fc8a5a5a394422401adebf61b87500a82ff99da8d64c011d30b2acd1f66fb4 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/a2fc8a5a5a394422401adebf61b87500a82ff99da8d64c011d30b2acd1f66fb4 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/a2fc8a5a5a394422401adebf61b87500a82ff99da8d64c011d30b2acd1f66fb4 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/a3c9e63a3ea315987e2a99a44d22a07a6733a7ac2837d72cfeb60311f817072c b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/a3c9e63a3ea315987e2a99a44d22a07a6733a7ac2837d72cfeb60311f817072c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/a3c9e63a3ea315987e2a99a44d22a07a6733a7ac2837d72cfeb60311f817072c rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/a3c9e63a3ea315987e2a99a44d22a07a6733a7ac2837d72cfeb60311f817072c diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/a50a132cc33a05beb0c3e57b0c705ac6e27b5a20b6e5ffd563f041d14dabf854 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/a50a132cc33a05beb0c3e57b0c705ac6e27b5a20b6e5ffd563f041d14dabf854 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/a50a132cc33a05beb0c3e57b0c705ac6e27b5a20b6e5ffd563f041d14dabf854 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/a50a132cc33a05beb0c3e57b0c705ac6e27b5a20b6e5ffd563f041d14dabf854 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/ab241493d09e70a01597f5fefcbb5589af4a4f8f154cfaf75c6dfb7c200d37f9 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/ab241493d09e70a01597f5fefcbb5589af4a4f8f154cfaf75c6dfb7c200d37f9 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/ab241493d09e70a01597f5fefcbb5589af4a4f8f154cfaf75c6dfb7c200d37f9 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/ab241493d09e70a01597f5fefcbb5589af4a4f8f154cfaf75c6dfb7c200d37f9 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/abafa4046d0dea743fad41ad9f3230e43952548c2b5252c7a58ff4695ab8c666 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/abafa4046d0dea743fad41ad9f3230e43952548c2b5252c7a58ff4695ab8c666 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/abafa4046d0dea743fad41ad9f3230e43952548c2b5252c7a58ff4695ab8c666 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/abafa4046d0dea743fad41ad9f3230e43952548c2b5252c7a58ff4695ab8c666 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/aca0b2042975f7ae20ec416418f5cef6715501f58fb8b50acbe460db2cd22838 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/aca0b2042975f7ae20ec416418f5cef6715501f58fb8b50acbe460db2cd22838 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/aca0b2042975f7ae20ec416418f5cef6715501f58fb8b50acbe460db2cd22838 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/aca0b2042975f7ae20ec416418f5cef6715501f58fb8b50acbe460db2cd22838 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/acb837a03e28930270e23ea0d39040ef43d75b29556c5ebc9b34bb16200c2d00 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/acb837a03e28930270e23ea0d39040ef43d75b29556c5ebc9b34bb16200c2d00 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/acb837a03e28930270e23ea0d39040ef43d75b29556c5ebc9b34bb16200c2d00 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/acb837a03e28930270e23ea0d39040ef43d75b29556c5ebc9b34bb16200c2d00 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/adc0974c6ac8e0e2b83d216adb0722757626aff0d45c662e3842960a9d242d67 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/adc0974c6ac8e0e2b83d216adb0722757626aff0d45c662e3842960a9d242d67 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/adc0974c6ac8e0e2b83d216adb0722757626aff0d45c662e3842960a9d242d67 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/adc0974c6ac8e0e2b83d216adb0722757626aff0d45c662e3842960a9d242d67 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/b06605e6663e1be42baff272def15a132cbcf03435cd0ca6b68a236c199cd31e b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/b06605e6663e1be42baff272def15a132cbcf03435cd0ca6b68a236c199cd31e similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/b06605e6663e1be42baff272def15a132cbcf03435cd0ca6b68a236c199cd31e rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/b06605e6663e1be42baff272def15a132cbcf03435cd0ca6b68a236c199cd31e diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/b15a916ad769c8bf6b9dd212bd71d65cbfd2a0c6e89e9a46ef6b00f162bc7762 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/b15a916ad769c8bf6b9dd212bd71d65cbfd2a0c6e89e9a46ef6b00f162bc7762 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/b15a916ad769c8bf6b9dd212bd71d65cbfd2a0c6e89e9a46ef6b00f162bc7762 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/b15a916ad769c8bf6b9dd212bd71d65cbfd2a0c6e89e9a46ef6b00f162bc7762 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/b399d304a52a16c6387b4ca92d784da2206f0bcc04737e7cf8d2f0fdc70a718d b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/b399d304a52a16c6387b4ca92d784da2206f0bcc04737e7cf8d2f0fdc70a718d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/b399d304a52a16c6387b4ca92d784da2206f0bcc04737e7cf8d2f0fdc70a718d rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/b399d304a52a16c6387b4ca92d784da2206f0bcc04737e7cf8d2f0fdc70a718d diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/b6dc121a66d6a471d5776d22c962ebeecd6b7b01bb5eee032ceeff778fdc7a00 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/b6dc121a66d6a471d5776d22c962ebeecd6b7b01bb5eee032ceeff778fdc7a00 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/b6dc121a66d6a471d5776d22c962ebeecd6b7b01bb5eee032ceeff778fdc7a00 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/b6dc121a66d6a471d5776d22c962ebeecd6b7b01bb5eee032ceeff778fdc7a00 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/b8688c983a57cfd39e9880475e91129138c8c7aabc94c1a0fa8636364c8025cb b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/b8688c983a57cfd39e9880475e91129138c8c7aabc94c1a0fa8636364c8025cb similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/b8688c983a57cfd39e9880475e91129138c8c7aabc94c1a0fa8636364c8025cb rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/b8688c983a57cfd39e9880475e91129138c8c7aabc94c1a0fa8636364c8025cb diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/be50d5357cbbd7347227d095c680ff0e7b5af866b32cda8c6f939cb199001838 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/be50d5357cbbd7347227d095c680ff0e7b5af866b32cda8c6f939cb199001838 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/be50d5357cbbd7347227d095c680ff0e7b5af866b32cda8c6f939cb199001838 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/be50d5357cbbd7347227d095c680ff0e7b5af866b32cda8c6f939cb199001838 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/be91d1281013072368f7859e593b19ca5b4f171967de454834a2a82c24d6270d b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/be91d1281013072368f7859e593b19ca5b4f171967de454834a2a82c24d6270d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/be91d1281013072368f7859e593b19ca5b4f171967de454834a2a82c24d6270d rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/be91d1281013072368f7859e593b19ca5b4f171967de454834a2a82c24d6270d diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/bf2acaba06f0818266a1133ef8f3160592e511e91e84d15d0a536fd0e27d9390 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/bf2acaba06f0818266a1133ef8f3160592e511e91e84d15d0a536fd0e27d9390 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/bf2acaba06f0818266a1133ef8f3160592e511e91e84d15d0a536fd0e27d9390 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/bf2acaba06f0818266a1133ef8f3160592e511e91e84d15d0a536fd0e27d9390 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/bfd2528db1ae8d92351ef18e453ce99af1082edffb8b82d5768b290f2a2e72ce b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/bfd2528db1ae8d92351ef18e453ce99af1082edffb8b82d5768b290f2a2e72ce similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/bfd2528db1ae8d92351ef18e453ce99af1082edffb8b82d5768b290f2a2e72ce rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/bfd2528db1ae8d92351ef18e453ce99af1082edffb8b82d5768b290f2a2e72ce diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/c22ca42cf15cb41d218f9b729ecea4cf009e1e3fbe5fe99f6de1a8a17a892402 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/c22ca42cf15cb41d218f9b729ecea4cf009e1e3fbe5fe99f6de1a8a17a892402 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/c22ca42cf15cb41d218f9b729ecea4cf009e1e3fbe5fe99f6de1a8a17a892402 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/c22ca42cf15cb41d218f9b729ecea4cf009e1e3fbe5fe99f6de1a8a17a892402 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/c2f15aa1072efe498b4c26b86ff13d3eb753cba6ead42aaa7e2c9ea28baf43eb b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/c2f15aa1072efe498b4c26b86ff13d3eb753cba6ead42aaa7e2c9ea28baf43eb similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/c2f15aa1072efe498b4c26b86ff13d3eb753cba6ead42aaa7e2c9ea28baf43eb rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/c2f15aa1072efe498b4c26b86ff13d3eb753cba6ead42aaa7e2c9ea28baf43eb diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/ce590ba99614916026e4cab2cfc8f12ebb208cad08c1362e75a4003e238f10fe b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/ce590ba99614916026e4cab2cfc8f12ebb208cad08c1362e75a4003e238f10fe similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/ce590ba99614916026e4cab2cfc8f12ebb208cad08c1362e75a4003e238f10fe rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/ce590ba99614916026e4cab2cfc8f12ebb208cad08c1362e75a4003e238f10fe diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/cf833ce84f9d1f47640b05625709aa12ad0df246c2eb9d3535821b097e0c8456 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/cf833ce84f9d1f47640b05625709aa12ad0df246c2eb9d3535821b097e0c8456 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/cf833ce84f9d1f47640b05625709aa12ad0df246c2eb9d3535821b097e0c8456 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/cf833ce84f9d1f47640b05625709aa12ad0df246c2eb9d3535821b097e0c8456 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/d09fb1c5e280122bbeac183e623038dc93aee066a40f7c12c0818fb84ce03f6e b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/d09fb1c5e280122bbeac183e623038dc93aee066a40f7c12c0818fb84ce03f6e similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/d09fb1c5e280122bbeac183e623038dc93aee066a40f7c12c0818fb84ce03f6e rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/d09fb1c5e280122bbeac183e623038dc93aee066a40f7c12c0818fb84ce03f6e diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/d1c43b0c9a57b8546855a3cf3cdce9f7d4c2412131e35c4528d567e7420886b2 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/d1c43b0c9a57b8546855a3cf3cdce9f7d4c2412131e35c4528d567e7420886b2 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/d1c43b0c9a57b8546855a3cf3cdce9f7d4c2412131e35c4528d567e7420886b2 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/d1c43b0c9a57b8546855a3cf3cdce9f7d4c2412131e35c4528d567e7420886b2 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/d20400b9a677f80fc3fa85e6c6652e6c9a7ecd31481c860dc5c91db4c7c1a84e b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/d20400b9a677f80fc3fa85e6c6652e6c9a7ecd31481c860dc5c91db4c7c1a84e similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/d20400b9a677f80fc3fa85e6c6652e6c9a7ecd31481c860dc5c91db4c7c1a84e rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/d20400b9a677f80fc3fa85e6c6652e6c9a7ecd31481c860dc5c91db4c7c1a84e diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/d2636c5dbc22e2600fc2977b6c9be0629eb3e1a3cb67571c56a916255ce18583 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/d2636c5dbc22e2600fc2977b6c9be0629eb3e1a3cb67571c56a916255ce18583 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/d2636c5dbc22e2600fc2977b6c9be0629eb3e1a3cb67571c56a916255ce18583 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/d2636c5dbc22e2600fc2977b6c9be0629eb3e1a3cb67571c56a916255ce18583 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/d40a98862ed393eb712e47a91bcef18e6f24cf368bb4bd248c7a7101ef8e178d b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/d40a98862ed393eb712e47a91bcef18e6f24cf368bb4bd248c7a7101ef8e178d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/d40a98862ed393eb712e47a91bcef18e6f24cf368bb4bd248c7a7101ef8e178d rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/d40a98862ed393eb712e47a91bcef18e6f24cf368bb4bd248c7a7101ef8e178d diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/d504b150305f660c41b077891f44bbcfce718a37b150ec9d1896d52055105f7f b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/d504b150305f660c41b077891f44bbcfce718a37b150ec9d1896d52055105f7f similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/d504b150305f660c41b077891f44bbcfce718a37b150ec9d1896d52055105f7f rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/d504b150305f660c41b077891f44bbcfce718a37b150ec9d1896d52055105f7f diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/d652c20384928803729ef0511c9daf76c9783decf688dddd3b4b535535b12601 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/d652c20384928803729ef0511c9daf76c9783decf688dddd3b4b535535b12601 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/d652c20384928803729ef0511c9daf76c9783decf688dddd3b4b535535b12601 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/d652c20384928803729ef0511c9daf76c9783decf688dddd3b4b535535b12601 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/d6c46b33652c26bc14fdbc540a27323c885c67ac8a263d75f403dc7d63ddba38 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/d6c46b33652c26bc14fdbc540a27323c885c67ac8a263d75f403dc7d63ddba38 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/d6c46b33652c26bc14fdbc540a27323c885c67ac8a263d75f403dc7d63ddba38 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/d6c46b33652c26bc14fdbc540a27323c885c67ac8a263d75f403dc7d63ddba38 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/d81e313b730df6333d76b9044e43d5cfea20a6df1782d5ef6ef93bd2bf3c2044 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/d81e313b730df6333d76b9044e43d5cfea20a6df1782d5ef6ef93bd2bf3c2044 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/d81e313b730df6333d76b9044e43d5cfea20a6df1782d5ef6ef93bd2bf3c2044 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/d81e313b730df6333d76b9044e43d5cfea20a6df1782d5ef6ef93bd2bf3c2044 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/da7f1b93f8fa05e8f586530efa0e083248f7f1150d98f0198deb45c280b34901 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/da7f1b93f8fa05e8f586530efa0e083248f7f1150d98f0198deb45c280b34901 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/da7f1b93f8fa05e8f586530efa0e083248f7f1150d98f0198deb45c280b34901 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/da7f1b93f8fa05e8f586530efa0e083248f7f1150d98f0198deb45c280b34901 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/dba4df35247c9300ad8919c140eacfa570073bd46aa24cbb2370a15ac20e157e b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/dba4df35247c9300ad8919c140eacfa570073bd46aa24cbb2370a15ac20e157e similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/dba4df35247c9300ad8919c140eacfa570073bd46aa24cbb2370a15ac20e157e rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/dba4df35247c9300ad8919c140eacfa570073bd46aa24cbb2370a15ac20e157e diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/dca14bd50b9222849cbc36d9603b42a1a262e0da6c05b0a0e5f92f27d74bb65d b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/dca14bd50b9222849cbc36d9603b42a1a262e0da6c05b0a0e5f92f27d74bb65d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/dca14bd50b9222849cbc36d9603b42a1a262e0da6c05b0a0e5f92f27d74bb65d rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/dca14bd50b9222849cbc36d9603b42a1a262e0da6c05b0a0e5f92f27d74bb65d diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/de16b68fb638d6d9af8d1b7bf5a4224c4e0d17a9bd67f01cd26f21aa9f09e31b b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/de16b68fb638d6d9af8d1b7bf5a4224c4e0d17a9bd67f01cd26f21aa9f09e31b similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/de16b68fb638d6d9af8d1b7bf5a4224c4e0d17a9bd67f01cd26f21aa9f09e31b rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/de16b68fb638d6d9af8d1b7bf5a4224c4e0d17a9bd67f01cd26f21aa9f09e31b diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/e1403c8c7b9479917b306b2d679102b19b9c4e123b86cbba53a15d6ac373a785 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/e1403c8c7b9479917b306b2d679102b19b9c4e123b86cbba53a15d6ac373a785 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/e1403c8c7b9479917b306b2d679102b19b9c4e123b86cbba53a15d6ac373a785 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/e1403c8c7b9479917b306b2d679102b19b9c4e123b86cbba53a15d6ac373a785 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/e2a4c47306869d4c9856b4fa53fe7a9855b8f0b724954752f3cc27cf3420cfa4 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/e2a4c47306869d4c9856b4fa53fe7a9855b8f0b724954752f3cc27cf3420cfa4 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/e2a4c47306869d4c9856b4fa53fe7a9855b8f0b724954752f3cc27cf3420cfa4 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/e2a4c47306869d4c9856b4fa53fe7a9855b8f0b724954752f3cc27cf3420cfa4 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/e41af38785ee06386966ef84a314bfe019a48318277cb27d6d335cef23d8ab48 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/e41af38785ee06386966ef84a314bfe019a48318277cb27d6d335cef23d8ab48 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/e41af38785ee06386966ef84a314bfe019a48318277cb27d6d335cef23d8ab48 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/e41af38785ee06386966ef84a314bfe019a48318277cb27d6d335cef23d8ab48 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/e502e1d09fd2dc23176f3ad601c8c1888fc13f6c08b70555c12148b27267217d b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/e502e1d09fd2dc23176f3ad601c8c1888fc13f6c08b70555c12148b27267217d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/e502e1d09fd2dc23176f3ad601c8c1888fc13f6c08b70555c12148b27267217d rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/e502e1d09fd2dc23176f3ad601c8c1888fc13f6c08b70555c12148b27267217d diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/e652efe61d2f92d83f8e62961dd522f1c0bf475005405a39dc7a01c74f2097b5 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/e652efe61d2f92d83f8e62961dd522f1c0bf475005405a39dc7a01c74f2097b5 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/e652efe61d2f92d83f8e62961dd522f1c0bf475005405a39dc7a01c74f2097b5 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/e652efe61d2f92d83f8e62961dd522f1c0bf475005405a39dc7a01c74f2097b5 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/e7cca78935811cad34a052a429e3a0d5c646a9868a9888bbf8e6ea57a2e77144 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/e7cca78935811cad34a052a429e3a0d5c646a9868a9888bbf8e6ea57a2e77144 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/e7cca78935811cad34a052a429e3a0d5c646a9868a9888bbf8e6ea57a2e77144 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/e7cca78935811cad34a052a429e3a0d5c646a9868a9888bbf8e6ea57a2e77144 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/e80727547dc039b3ccf1f291ee6f11d16671bf3dada42d27f2da87dc1eac298e b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/e80727547dc039b3ccf1f291ee6f11d16671bf3dada42d27f2da87dc1eac298e similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/e80727547dc039b3ccf1f291ee6f11d16671bf3dada42d27f2da87dc1eac298e rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/e80727547dc039b3ccf1f291ee6f11d16671bf3dada42d27f2da87dc1eac298e diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/ea6ea0e31e7cc2ecf6b686cc67ae33cded51b0625cbae8c7bbaa9c2fe4966874 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/ea6ea0e31e7cc2ecf6b686cc67ae33cded51b0625cbae8c7bbaa9c2fe4966874 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/ea6ea0e31e7cc2ecf6b686cc67ae33cded51b0625cbae8c7bbaa9c2fe4966874 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/ea6ea0e31e7cc2ecf6b686cc67ae33cded51b0625cbae8c7bbaa9c2fe4966874 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/f0cda2caa9193dfc2c3bbba385df864f4e69dd8b1f1f611497bb4bb21afe4432 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/f0cda2caa9193dfc2c3bbba385df864f4e69dd8b1f1f611497bb4bb21afe4432 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/f0cda2caa9193dfc2c3bbba385df864f4e69dd8b1f1f611497bb4bb21afe4432 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/f0cda2caa9193dfc2c3bbba385df864f4e69dd8b1f1f611497bb4bb21afe4432 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/f10c596138f8ad6b5fc18c84f291f9b3542bbaa54b3d2c64a4e0bec512ac2d74 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/f10c596138f8ad6b5fc18c84f291f9b3542bbaa54b3d2c64a4e0bec512ac2d74 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/f10c596138f8ad6b5fc18c84f291f9b3542bbaa54b3d2c64a4e0bec512ac2d74 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/f10c596138f8ad6b5fc18c84f291f9b3542bbaa54b3d2c64a4e0bec512ac2d74 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/f15472e77e1f1cb413e495310e0628d349160f7a9c2de799e504e1de82998d91 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/f15472e77e1f1cb413e495310e0628d349160f7a9c2de799e504e1de82998d91 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/f15472e77e1f1cb413e495310e0628d349160f7a9c2de799e504e1de82998d91 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/f15472e77e1f1cb413e495310e0628d349160f7a9c2de799e504e1de82998d91 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/f308f0ef99b57b53b2c398ffca1fa545e1a6704a2192467cf8a9645c3b4c7969 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/f308f0ef99b57b53b2c398ffca1fa545e1a6704a2192467cf8a9645c3b4c7969 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/f308f0ef99b57b53b2c398ffca1fa545e1a6704a2192467cf8a9645c3b4c7969 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/f308f0ef99b57b53b2c398ffca1fa545e1a6704a2192467cf8a9645c3b4c7969 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/f4e2f15687358e3b39a81e447a977c2485a8036195204b94fdf2eaab496fc259 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/f4e2f15687358e3b39a81e447a977c2485a8036195204b94fdf2eaab496fc259 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/f4e2f15687358e3b39a81e447a977c2485a8036195204b94fdf2eaab496fc259 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/f4e2f15687358e3b39a81e447a977c2485a8036195204b94fdf2eaab496fc259 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/f76884f94561dc491e0e6a1d9ad1a2bf9f12191eb2eb3e47597406a9368b462c b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/f76884f94561dc491e0e6a1d9ad1a2bf9f12191eb2eb3e47597406a9368b462c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/f76884f94561dc491e0e6a1d9ad1a2bf9f12191eb2eb3e47597406a9368b462c rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/f76884f94561dc491e0e6a1d9ad1a2bf9f12191eb2eb3e47597406a9368b462c diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/f79c25372d77fff02d3cc6ee328390d94bcb67b7ad2340f2503712d5be479dae b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/f79c25372d77fff02d3cc6ee328390d94bcb67b7ad2340f2503712d5be479dae similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/f79c25372d77fff02d3cc6ee328390d94bcb67b7ad2340f2503712d5be479dae rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/f79c25372d77fff02d3cc6ee328390d94bcb67b7ad2340f2503712d5be479dae diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/f99b2fd0cb9017fb0b14bae40677276ffd3fafce5b019d81aa7759727bf92fb6 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/f99b2fd0cb9017fb0b14bae40677276ffd3fafce5b019d81aa7759727bf92fb6 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/f99b2fd0cb9017fb0b14bae40677276ffd3fafce5b019d81aa7759727bf92fb6 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/f99b2fd0cb9017fb0b14bae40677276ffd3fafce5b019d81aa7759727bf92fb6 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/f9aee4c2eddf91f1388dd81ec29f4ae20d6e1ac78ee2d3e1d6aadc03df708efe b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/f9aee4c2eddf91f1388dd81ec29f4ae20d6e1ac78ee2d3e1d6aadc03df708efe similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/f9aee4c2eddf91f1388dd81ec29f4ae20d6e1ac78ee2d3e1d6aadc03df708efe rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/f9aee4c2eddf91f1388dd81ec29f4ae20d6e1ac78ee2d3e1d6aadc03df708efe diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/fa8904d3521899f38f753262047e7e69d6c49544e4c7d6bc5fc937d2c6e15357 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/fa8904d3521899f38f753262047e7e69d6c49544e4c7d6bc5fc937d2c6e15357 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/fa8904d3521899f38f753262047e7e69d6c49544e4c7d6bc5fc937d2c6e15357 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/fa8904d3521899f38f753262047e7e69d6c49544e4c7d6bc5fc937d2c6e15357 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/faa3e2cef71ce8407f4ebe8db25c5824dce467b61b4079ce240530a23e3b89f9 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/faa3e2cef71ce8407f4ebe8db25c5824dce467b61b4079ce240530a23e3b89f9 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/faa3e2cef71ce8407f4ebe8db25c5824dce467b61b4079ce240530a23e3b89f9 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/faa3e2cef71ce8407f4ebe8db25c5824dce467b61b4079ce240530a23e3b89f9 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/fffb6e9f0dbf6cdf70cf755a8a01392b024eeb3bd761d5f8ccc11fcc27394302 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/fffb6e9f0dbf6cdf70cf755a8a01392b024eeb3bd761d5f8ccc11fcc27394302 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/fffb6e9f0dbf6cdf70cf755a8a01392b024eeb3bd761d5f8ccc11fcc27394302 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseDecCoin/fffb6e9f0dbf6cdf70cf755a8a01392b024eeb3bd761d5f8ccc11fcc27394302 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/048f42302bc75a46982109b72b13d5fe50a99a1b945f9d1ccc2adb5e0b48e018 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/048f42302bc75a46982109b72b13d5fe50a99a1b945f9d1ccc2adb5e0b48e018 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/048f42302bc75a46982109b72b13d5fe50a99a1b945f9d1ccc2adb5e0b48e018 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/048f42302bc75a46982109b72b13d5fe50a99a1b945f9d1ccc2adb5e0b48e018 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/0898820010779b12bae4009a4479b8a44bebd97ce57a76a080dc5ee7e6ae8e24 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/0898820010779b12bae4009a4479b8a44bebd97ce57a76a080dc5ee7e6ae8e24 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/0898820010779b12bae4009a4479b8a44bebd97ce57a76a080dc5ee7e6ae8e24 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/0898820010779b12bae4009a4479b8a44bebd97ce57a76a080dc5ee7e6ae8e24 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/09a40dabeb9bd1e1ad706728ab0bc94860930de51e0e5a83afcba8a642d890b0 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/09a40dabeb9bd1e1ad706728ab0bc94860930de51e0e5a83afcba8a642d890b0 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/09a40dabeb9bd1e1ad706728ab0bc94860930de51e0e5a83afcba8a642d890b0 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/09a40dabeb9bd1e1ad706728ab0bc94860930de51e0e5a83afcba8a642d890b0 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/0ec0d202211e5b01b66bbbc2cdd73211d1d2b2d0b49ca3eb9e635c99309b2bc3 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/0ec0d202211e5b01b66bbbc2cdd73211d1d2b2d0b49ca3eb9e635c99309b2bc3 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/0ec0d202211e5b01b66bbbc2cdd73211d1d2b2d0b49ca3eb9e635c99309b2bc3 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/0ec0d202211e5b01b66bbbc2cdd73211d1d2b2d0b49ca3eb9e635c99309b2bc3 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/0fafe3da1c6cf414fd2a13e51e75bc35d2191c3dc95cd1d72dae986d4f1d79a0 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/0fafe3da1c6cf414fd2a13e51e75bc35d2191c3dc95cd1d72dae986d4f1d79a0 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/0fafe3da1c6cf414fd2a13e51e75bc35d2191c3dc95cd1d72dae986d4f1d79a0 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/0fafe3da1c6cf414fd2a13e51e75bc35d2191c3dc95cd1d72dae986d4f1d79a0 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/1a447e487dbe85cc0b0a35b5100911aeaff22597cbb7d82aa3321e05ffe71634 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/1a447e487dbe85cc0b0a35b5100911aeaff22597cbb7d82aa3321e05ffe71634 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/1a447e487dbe85cc0b0a35b5100911aeaff22597cbb7d82aa3321e05ffe71634 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/1a447e487dbe85cc0b0a35b5100911aeaff22597cbb7d82aa3321e05ffe71634 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/1ac3797cf374191f555fae0d1463548e83cbe8326821e8e10b9a4bea13a83e3d b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/1ac3797cf374191f555fae0d1463548e83cbe8326821e8e10b9a4bea13a83e3d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/1ac3797cf374191f555fae0d1463548e83cbe8326821e8e10b9a4bea13a83e3d rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/1ac3797cf374191f555fae0d1463548e83cbe8326821e8e10b9a4bea13a83e3d diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/1b2fd1aae1992eca9552e89ee4cff58dbba35739cbaa922e08db24c86bef367c b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/1b2fd1aae1992eca9552e89ee4cff58dbba35739cbaa922e08db24c86bef367c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/1b2fd1aae1992eca9552e89ee4cff58dbba35739cbaa922e08db24c86bef367c rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/1b2fd1aae1992eca9552e89ee4cff58dbba35739cbaa922e08db24c86bef367c diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/22a1d1de7d18b62b10ec3cd218d8f1a2a7f96478d15a476439a7a86ff7f9b786 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/22a1d1de7d18b62b10ec3cd218d8f1a2a7f96478d15a476439a7a86ff7f9b786 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/22a1d1de7d18b62b10ec3cd218d8f1a2a7f96478d15a476439a7a86ff7f9b786 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/22a1d1de7d18b62b10ec3cd218d8f1a2a7f96478d15a476439a7a86ff7f9b786 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/27b80e704489baee21440595bb3fa0abea0b80e2508fc03a2b2ed554fe958bfc b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/27b80e704489baee21440595bb3fa0abea0b80e2508fc03a2b2ed554fe958bfc similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/27b80e704489baee21440595bb3fa0abea0b80e2508fc03a2b2ed554fe958bfc rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/27b80e704489baee21440595bb3fa0abea0b80e2508fc03a2b2ed554fe958bfc diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/2821caf91bfd138dbdb65a3e581b4d77ea4ccde44c73c5e87373cfcb711a6eca b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/2821caf91bfd138dbdb65a3e581b4d77ea4ccde44c73c5e87373cfcb711a6eca similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/2821caf91bfd138dbdb65a3e581b4d77ea4ccde44c73c5e87373cfcb711a6eca rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/2821caf91bfd138dbdb65a3e581b4d77ea4ccde44c73c5e87373cfcb711a6eca diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/28cd2af22faf838701864720ba397c9a1f0b4d0a47c553354b4a16029edeeb2f b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/28cd2af22faf838701864720ba397c9a1f0b4d0a47c553354b4a16029edeeb2f similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/28cd2af22faf838701864720ba397c9a1f0b4d0a47c553354b4a16029edeeb2f rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/28cd2af22faf838701864720ba397c9a1f0b4d0a47c553354b4a16029edeeb2f diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/29a61ef5098a6326b52da6b847d377e6ecfd6168446c8c91c53988388969a20b b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/29a61ef5098a6326b52da6b847d377e6ecfd6168446c8c91c53988388969a20b similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/29a61ef5098a6326b52da6b847d377e6ecfd6168446c8c91c53988388969a20b rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/29a61ef5098a6326b52da6b847d377e6ecfd6168446c8c91c53988388969a20b diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/29d4758fd78d1b0e1e20001273bf3d2f03cb8d35ef810ac86476312584dbe79a b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/29d4758fd78d1b0e1e20001273bf3d2f03cb8d35ef810ac86476312584dbe79a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/29d4758fd78d1b0e1e20001273bf3d2f03cb8d35ef810ac86476312584dbe79a rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/29d4758fd78d1b0e1e20001273bf3d2f03cb8d35ef810ac86476312584dbe79a diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/2b7e5fe25f927c5d8257ba1c5e484cfb93c60710cda1581ccc174c17eb9d8fc8 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/2b7e5fe25f927c5d8257ba1c5e484cfb93c60710cda1581ccc174c17eb9d8fc8 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/2b7e5fe25f927c5d8257ba1c5e484cfb93c60710cda1581ccc174c17eb9d8fc8 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/2b7e5fe25f927c5d8257ba1c5e484cfb93c60710cda1581ccc174c17eb9d8fc8 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/3abc64346057f3301366ffffe8c3fb973b9851937d787feceb59cabe592b68da b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/3abc64346057f3301366ffffe8c3fb973b9851937d787feceb59cabe592b68da similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/3abc64346057f3301366ffffe8c3fb973b9851937d787feceb59cabe592b68da rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/3abc64346057f3301366ffffe8c3fb973b9851937d787feceb59cabe592b68da diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/449f2018cdaf89ffa6293f9829a15843990edb848760895c43aa5d14b19a2c4e b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/449f2018cdaf89ffa6293f9829a15843990edb848760895c43aa5d14b19a2c4e similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/449f2018cdaf89ffa6293f9829a15843990edb848760895c43aa5d14b19a2c4e rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/449f2018cdaf89ffa6293f9829a15843990edb848760895c43aa5d14b19a2c4e diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/4888a5effeb0b54ff240128142ebe5be00752d8bb89006815701142668545a15 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/4888a5effeb0b54ff240128142ebe5be00752d8bb89006815701142668545a15 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/4888a5effeb0b54ff240128142ebe5be00752d8bb89006815701142668545a15 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/4888a5effeb0b54ff240128142ebe5be00752d8bb89006815701142668545a15 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/4b4d146a1c52ee7c26f49779b0a76734dcee4d62babf2ad6e2ec09857dc32b07 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/4b4d146a1c52ee7c26f49779b0a76734dcee4d62babf2ad6e2ec09857dc32b07 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/4b4d146a1c52ee7c26f49779b0a76734dcee4d62babf2ad6e2ec09857dc32b07 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/4b4d146a1c52ee7c26f49779b0a76734dcee4d62babf2ad6e2ec09857dc32b07 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/4f36a800e7a511b1fffafd598824764f6f11016c67f62603383b76fb9ae05c73 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/4f36a800e7a511b1fffafd598824764f6f11016c67f62603383b76fb9ae05c73 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/4f36a800e7a511b1fffafd598824764f6f11016c67f62603383b76fb9ae05c73 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/4f36a800e7a511b1fffafd598824764f6f11016c67f62603383b76fb9ae05c73 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/59a4f0100da0759d0bc35395692691046ea90a6e708a18b442b5d4d11393a887 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/59a4f0100da0759d0bc35395692691046ea90a6e708a18b442b5d4d11393a887 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/59a4f0100da0759d0bc35395692691046ea90a6e708a18b442b5d4d11393a887 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/59a4f0100da0759d0bc35395692691046ea90a6e708a18b442b5d4d11393a887 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/5a3b93318ba157a4696e54b558d0d1cf60f616abbd959de027145a882571e824 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/5a3b93318ba157a4696e54b558d0d1cf60f616abbd959de027145a882571e824 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/5a3b93318ba157a4696e54b558d0d1cf60f616abbd959de027145a882571e824 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/5a3b93318ba157a4696e54b558d0d1cf60f616abbd959de027145a882571e824 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/62847c8141aa032b68ea357b673eedd8d809c86578b16373aa849cbd93059cd4 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/62847c8141aa032b68ea357b673eedd8d809c86578b16373aa849cbd93059cd4 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/62847c8141aa032b68ea357b673eedd8d809c86578b16373aa849cbd93059cd4 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/62847c8141aa032b68ea357b673eedd8d809c86578b16373aa849cbd93059cd4 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/6659184808cdf668804e5dc12f4f63e7b2126b2d330ba0e37ecd2e758ad988b7 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/6659184808cdf668804e5dc12f4f63e7b2126b2d330ba0e37ecd2e758ad988b7 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/6659184808cdf668804e5dc12f4f63e7b2126b2d330ba0e37ecd2e758ad988b7 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/6659184808cdf668804e5dc12f4f63e7b2126b2d330ba0e37ecd2e758ad988b7 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/6cfe9acc9f871524964106c3bbc634d68e1b2fa15e8f977e2414a35adc80be98 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/6cfe9acc9f871524964106c3bbc634d68e1b2fa15e8f977e2414a35adc80be98 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/6cfe9acc9f871524964106c3bbc634d68e1b2fa15e8f977e2414a35adc80be98 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/6cfe9acc9f871524964106c3bbc634d68e1b2fa15e8f977e2414a35adc80be98 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/72165df2fdde3d8837c6e2d327c5b368b11a65a07a8d0cca6253539ac4b0db00 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/72165df2fdde3d8837c6e2d327c5b368b11a65a07a8d0cca6253539ac4b0db00 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/72165df2fdde3d8837c6e2d327c5b368b11a65a07a8d0cca6253539ac4b0db00 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/72165df2fdde3d8837c6e2d327c5b368b11a65a07a8d0cca6253539ac4b0db00 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/7c024fac75c474b302f0084ef7d53af92179b4bc1843b7d109861f747c3d2364 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/7c024fac75c474b302f0084ef7d53af92179b4bc1843b7d109861f747c3d2364 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/7c024fac75c474b302f0084ef7d53af92179b4bc1843b7d109861f747c3d2364 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/7c024fac75c474b302f0084ef7d53af92179b4bc1843b7d109861f747c3d2364 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/7d20c1af5dfe6544759bd29f3826388a743ae89f4b01e3d5e684c81d00f67df0 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/7d20c1af5dfe6544759bd29f3826388a743ae89f4b01e3d5e684c81d00f67df0 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/7d20c1af5dfe6544759bd29f3826388a743ae89f4b01e3d5e684c81d00f67df0 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/7d20c1af5dfe6544759bd29f3826388a743ae89f4b01e3d5e684c81d00f67df0 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/89ae902d9ced06556d7327e76f873aa58f3503e79b9f9ae18066d99f5e8ede26 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/89ae902d9ced06556d7327e76f873aa58f3503e79b9f9ae18066d99f5e8ede26 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/89ae902d9ced06556d7327e76f873aa58f3503e79b9f9ae18066d99f5e8ede26 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/89ae902d9ced06556d7327e76f873aa58f3503e79b9f9ae18066d99f5e8ede26 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/8b5142d26faab82f7801f27eaec59262124118459b7e02c3117363a6eedfd1bf b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/8b5142d26faab82f7801f27eaec59262124118459b7e02c3117363a6eedfd1bf similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/8b5142d26faab82f7801f27eaec59262124118459b7e02c3117363a6eedfd1bf rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/8b5142d26faab82f7801f27eaec59262124118459b7e02c3117363a6eedfd1bf diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/9084c93284786d7f3e9e8b49abbc4bf788430c2eaf0999966840c9a66bc4bd96 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/9084c93284786d7f3e9e8b49abbc4bf788430c2eaf0999966840c9a66bc4bd96 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/9084c93284786d7f3e9e8b49abbc4bf788430c2eaf0999966840c9a66bc4bd96 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/9084c93284786d7f3e9e8b49abbc4bf788430c2eaf0999966840c9a66bc4bd96 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/972e2f6b79ae8947d628b27edd658953eeef5b930537877208b78cdab2936009 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/972e2f6b79ae8947d628b27edd658953eeef5b930537877208b78cdab2936009 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/972e2f6b79ae8947d628b27edd658953eeef5b930537877208b78cdab2936009 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/972e2f6b79ae8947d628b27edd658953eeef5b930537877208b78cdab2936009 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/9f93afb2ade5da384d592505130ea9bde24787f301929e8cdbc83b770cf95239 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/9f93afb2ade5da384d592505130ea9bde24787f301929e8cdbc83b770cf95239 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/9f93afb2ade5da384d592505130ea9bde24787f301929e8cdbc83b770cf95239 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/9f93afb2ade5da384d592505130ea9bde24787f301929e8cdbc83b770cf95239 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/a087f0125582858ca0e4cc0306b5a3379175c8252b1a85567c74c2a9231e3624 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/a087f0125582858ca0e4cc0306b5a3379175c8252b1a85567c74c2a9231e3624 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/a087f0125582858ca0e4cc0306b5a3379175c8252b1a85567c74c2a9231e3624 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/a087f0125582858ca0e4cc0306b5a3379175c8252b1a85567c74c2a9231e3624 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/a3f8ae20b2eac34ca01933b65388b63cbe841bc948dce6dd03c322463930eca9 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/a3f8ae20b2eac34ca01933b65388b63cbe841bc948dce6dd03c322463930eca9 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/a3f8ae20b2eac34ca01933b65388b63cbe841bc948dce6dd03c322463930eca9 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/a3f8ae20b2eac34ca01933b65388b63cbe841bc948dce6dd03c322463930eca9 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/ac38ede1c02226588c4cf9be64f46a7c03aac480fab976100c20b54410a4443b b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/ac38ede1c02226588c4cf9be64f46a7c03aac480fab976100c20b54410a4443b similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/ac38ede1c02226588c4cf9be64f46a7c03aac480fab976100c20b54410a4443b rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/ac38ede1c02226588c4cf9be64f46a7c03aac480fab976100c20b54410a4443b diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/b00d29a942a455785934b03a1f91728e47fcf00728b994c60021b8840824248a b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/b00d29a942a455785934b03a1f91728e47fcf00728b994c60021b8840824248a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/b00d29a942a455785934b03a1f91728e47fcf00728b994c60021b8840824248a rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/b00d29a942a455785934b03a1f91728e47fcf00728b994c60021b8840824248a diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/b27e2c6397d4d84c82eda916a09cecf84ece55aef49502fe7042a9564d4988f7 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/b27e2c6397d4d84c82eda916a09cecf84ece55aef49502fe7042a9564d4988f7 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/b27e2c6397d4d84c82eda916a09cecf84ece55aef49502fe7042a9564d4988f7 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/b27e2c6397d4d84c82eda916a09cecf84ece55aef49502fe7042a9564d4988f7 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/bd3ee245cf64cf4bba80f6825abab17564ede2fc799fd61c2382e41e5b20dea0 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/bd3ee245cf64cf4bba80f6825abab17564ede2fc799fd61c2382e41e5b20dea0 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/bd3ee245cf64cf4bba80f6825abab17564ede2fc799fd61c2382e41e5b20dea0 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/bd3ee245cf64cf4bba80f6825abab17564ede2fc799fd61c2382e41e5b20dea0 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/bd58d15953a74b0bba4aa4ee120beebc066aa6cb40c40a92f6d7b053ccd6135a b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/bd58d15953a74b0bba4aa4ee120beebc066aa6cb40c40a92f6d7b053ccd6135a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/bd58d15953a74b0bba4aa4ee120beebc066aa6cb40c40a92f6d7b053ccd6135a rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/bd58d15953a74b0bba4aa4ee120beebc066aa6cb40c40a92f6d7b053ccd6135a diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/c3f108b3c84a78d77bc2e9440fdd292ded0f1a1980b846cf02a4d6f990585458 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/c3f108b3c84a78d77bc2e9440fdd292ded0f1a1980b846cf02a4d6f990585458 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/c3f108b3c84a78d77bc2e9440fdd292ded0f1a1980b846cf02a4d6f990585458 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/c3f108b3c84a78d77bc2e9440fdd292ded0f1a1980b846cf02a4d6f990585458 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/c9a5b494228a7938ed3a9c24b16b86e1950e62aa951a831153d815e5ca3547b2 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/c9a5b494228a7938ed3a9c24b16b86e1950e62aa951a831153d815e5ca3547b2 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/c9a5b494228a7938ed3a9c24b16b86e1950e62aa951a831153d815e5ca3547b2 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/c9a5b494228a7938ed3a9c24b16b86e1950e62aa951a831153d815e5ca3547b2 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/ccbf73799273f9872461d8b6fe130830609fbdcf1ef80b48d4a1eff77fc01570 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/ccbf73799273f9872461d8b6fe130830609fbdcf1ef80b48d4a1eff77fc01570 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/ccbf73799273f9872461d8b6fe130830609fbdcf1ef80b48d4a1eff77fc01570 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/ccbf73799273f9872461d8b6fe130830609fbdcf1ef80b48d4a1eff77fc01570 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/d1654d34507951a337b99736bb043a6cd2a1430629773c390e2af1324f3b9983 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/d1654d34507951a337b99736bb043a6cd2a1430629773c390e2af1324f3b9983 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/d1654d34507951a337b99736bb043a6cd2a1430629773c390e2af1324f3b9983 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/d1654d34507951a337b99736bb043a6cd2a1430629773c390e2af1324f3b9983 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/d483ce7dbf3d7336cf49d954dd695319c3bf5672ad38bc88cf6ae87c204d4169 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/d483ce7dbf3d7336cf49d954dd695319c3bf5672ad38bc88cf6ae87c204d4169 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/d483ce7dbf3d7336cf49d954dd695319c3bf5672ad38bc88cf6ae87c204d4169 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/d483ce7dbf3d7336cf49d954dd695319c3bf5672ad38bc88cf6ae87c204d4169 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/d5f00647a3cd250fa2e89f9c104c0016aa237edb650ce82babb8a6e709d26d1c b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/d5f00647a3cd250fa2e89f9c104c0016aa237edb650ce82babb8a6e709d26d1c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/d5f00647a3cd250fa2e89f9c104c0016aa237edb650ce82babb8a6e709d26d1c rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/d5f00647a3cd250fa2e89f9c104c0016aa237edb650ce82babb8a6e709d26d1c diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/e9927b51dc4d4a111460249477d5714d9666f00c51781ec0c8a15031abf19e26 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/e9927b51dc4d4a111460249477d5714d9666f00c51781ec0c8a15031abf19e26 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/e9927b51dc4d4a111460249477d5714d9666f00c51781ec0c8a15031abf19e26 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/e9927b51dc4d4a111460249477d5714d9666f00c51781ec0c8a15031abf19e26 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/f55324388f4642fe4b5b9c42764abaaed9a11373912201e6c27c9865dd66c259 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/f55324388f4642fe4b5b9c42764abaaed9a11373912201e6c27c9865dd66c259 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/f55324388f4642fe4b5b9c42764abaaed9a11373912201e6c27c9865dd66c259 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/f55324388f4642fe4b5b9c42764abaaed9a11373912201e6c27c9865dd66c259 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/f7b88c09b04bbd705daad6b1cb21012bf0377c2a077a294cd2cf8211702c884a b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/f7b88c09b04bbd705daad6b1cb21012bf0377c2a077a294cd2cf8211702c884a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/f7b88c09b04bbd705daad6b1cb21012bf0377c2a077a294cd2cf8211702c884a rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/f7b88c09b04bbd705daad6b1cb21012bf0377c2a077a294cd2cf8211702c884a diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/fbf81105dd904e3f312fc48a0f9fcea26533777ab1d63683969c817fc453a29a b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/fbf81105dd904e3f312fc48a0f9fcea26533777ab1d63683969c817fc453a29a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/fbf81105dd904e3f312fc48a0f9fcea26533777ab1d63683969c817fc453a29a rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/fbf81105dd904e3f312fc48a0f9fcea26533777ab1d63683969c817fc453a29a diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/fe2d115f15f7f15109a1f56b1767166d46ab17cc2ee2f0f0a4c20c3baf8f9df5 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/fe2d115f15f7f15109a1f56b1767166d46ab17cc2ee2f0f0a4c20c3baf8f9df5 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/fe2d115f15f7f15109a1f56b1767166d46ab17cc2ee2f0f0a4c20c3baf8f9df5 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesParseTimeBytes/fe2d115f15f7f15109a1f56b1767166d46ab17cc2ee2f0f0a4c20c3baf8f9df5 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesVerifyAddressFormat/2fb4325c748985455e325c152a6c1e1605fdce71a6d2223873248ee64f784175 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesVerifyAddressFormat/2fb4325c748985455e325c152a6c1e1605fdce71a6d2223873248ee64f784175 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesVerifyAddressFormat/2fb4325c748985455e325c152a6c1e1605fdce71a6d2223873248ee64f784175 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesVerifyAddressFormat/2fb4325c748985455e325c152a6c1e1605fdce71a6d2223873248ee64f784175 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesVerifyAddressFormat/68d2846508f5d87d432c21795e19aad17d72bd470438b0b9cd8ff8bc1cc750de b/tests/fuzz/tests/testdata/fuzz/FuzzTypesVerifyAddressFormat/68d2846508f5d87d432c21795e19aad17d72bd470438b0b9cd8ff8bc1cc750de similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesVerifyAddressFormat/68d2846508f5d87d432c21795e19aad17d72bd470438b0b9cd8ff8bc1cc750de rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesVerifyAddressFormat/68d2846508f5d87d432c21795e19aad17d72bd470438b0b9cd8ff8bc1cc750de diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesVerifyAddressFormat/6ed9b389ed23f3db546e2e83b7a3478559b49a8186c4bb91f3b742c9e694cb21 b/tests/fuzz/tests/testdata/fuzz/FuzzTypesVerifyAddressFormat/6ed9b389ed23f3db546e2e83b7a3478559b49a8186c4bb91f3b742c9e694cb21 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesVerifyAddressFormat/6ed9b389ed23f3db546e2e83b7a3478559b49a8186c4bb91f3b742c9e694cb21 rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesVerifyAddressFormat/6ed9b389ed23f3db546e2e83b7a3478559b49a8186c4bb91f3b742c9e694cb21 diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesVerifyAddressFormat/6ee6788cb9b4259b7c348b213a942dec0258a6757e4cecf0a8159ca7a7cb4c9e b/tests/fuzz/tests/testdata/fuzz/FuzzTypesVerifyAddressFormat/6ee6788cb9b4259b7c348b213a942dec0258a6757e4cecf0a8159ca7a7cb4c9e similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesVerifyAddressFormat/6ee6788cb9b4259b7c348b213a942dec0258a6757e4cecf0a8159ca7a7cb4c9e rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesVerifyAddressFormat/6ee6788cb9b4259b7c348b213a942dec0258a6757e4cecf0a8159ca7a7cb4c9e diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesVerifyAddressFormat/d40a98862ed393eb712e47a91bcef18e6f24cf368bb4bd248c7a7101ef8e178d b/tests/fuzz/tests/testdata/fuzz/FuzzTypesVerifyAddressFormat/d40a98862ed393eb712e47a91bcef18e6f24cf368bb4bd248c7a7101ef8e178d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesVerifyAddressFormat/d40a98862ed393eb712e47a91bcef18e6f24cf368bb4bd248c7a7101ef8e178d rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesVerifyAddressFormat/d40a98862ed393eb712e47a91bcef18e6f24cf368bb4bd248c7a7101ef8e178d diff --git a/fuzz/tests/testdata/fuzz/FuzzTypesVerifyAddressFormat/db8e9f2206ae44680c336b23c57ce5032ec22eef7383aee09fa3b0e6392855ba b/tests/fuzz/tests/testdata/fuzz/FuzzTypesVerifyAddressFormat/db8e9f2206ae44680c336b23c57ce5032ec22eef7383aee09fa3b0e6392855ba similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzTypesVerifyAddressFormat/db8e9f2206ae44680c336b23c57ce5032ec22eef7383aee09fa3b0e6392855ba rename to tests/fuzz/tests/testdata/fuzz/FuzzTypesVerifyAddressFormat/db8e9f2206ae44680c336b23c57ce5032ec22eef7383aee09fa3b0e6392855ba diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/01b3f42919599faa79401b4d96ed847371a8ddf71dbfaaf9f79003d43b07062d b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/01b3f42919599faa79401b4d96ed847371a8ddf71dbfaaf9f79003d43b07062d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/01b3f42919599faa79401b4d96ed847371a8ddf71dbfaaf9f79003d43b07062d rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/01b3f42919599faa79401b4d96ed847371a8ddf71dbfaaf9f79003d43b07062d diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/09119ab9da36a69e271635abdb27f23fe9791621a7b759975cc8ce296ceb9443 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/09119ab9da36a69e271635abdb27f23fe9791621a7b759975cc8ce296ceb9443 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/09119ab9da36a69e271635abdb27f23fe9791621a7b759975cc8ce296ceb9443 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/09119ab9da36a69e271635abdb27f23fe9791621a7b759975cc8ce296ceb9443 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/0aa6f90772751d6eade91adaee248cbeb939977604422bc70b86b4f1d3b17be7 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/0aa6f90772751d6eade91adaee248cbeb939977604422bc70b86b4f1d3b17be7 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/0aa6f90772751d6eade91adaee248cbeb939977604422bc70b86b4f1d3b17be7 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/0aa6f90772751d6eade91adaee248cbeb939977604422bc70b86b4f1d3b17be7 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/0b11eed28451ed3db765b39be261c38d3c495278ddbfa8b2d835591844335f46 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/0b11eed28451ed3db765b39be261c38d3c495278ddbfa8b2d835591844335f46 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/0b11eed28451ed3db765b39be261c38d3c495278ddbfa8b2d835591844335f46 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/0b11eed28451ed3db765b39be261c38d3c495278ddbfa8b2d835591844335f46 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/0b2ad34d28e1217f5d3e974a18bd30198981e0769d7404620f47e7ef0ced1a91 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/0b2ad34d28e1217f5d3e974a18bd30198981e0769d7404620f47e7ef0ced1a91 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/0b2ad34d28e1217f5d3e974a18bd30198981e0769d7404620f47e7ef0ced1a91 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/0b2ad34d28e1217f5d3e974a18bd30198981e0769d7404620f47e7ef0ced1a91 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/0d31356d84044d2fab2a9287940fed0db6d7ae5ce49d4dcd744b0973cca73784 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/0d31356d84044d2fab2a9287940fed0db6d7ae5ce49d4dcd744b0973cca73784 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/0d31356d84044d2fab2a9287940fed0db6d7ae5ce49d4dcd744b0973cca73784 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/0d31356d84044d2fab2a9287940fed0db6d7ae5ce49d4dcd744b0973cca73784 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/0fb365df9341b18e4c6a99295fadf20bec32a2da11951d4e4b118fe4bf6bb658 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/0fb365df9341b18e4c6a99295fadf20bec32a2da11951d4e4b118fe4bf6bb658 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/0fb365df9341b18e4c6a99295fadf20bec32a2da11951d4e4b118fe4bf6bb658 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/0fb365df9341b18e4c6a99295fadf20bec32a2da11951d4e4b118fe4bf6bb658 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/109c005b740a9c46f90951c78ee81f277649f6946d110b0e860870f5b25597ef b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/109c005b740a9c46f90951c78ee81f277649f6946d110b0e860870f5b25597ef similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/109c005b740a9c46f90951c78ee81f277649f6946d110b0e860870f5b25597ef rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/109c005b740a9c46f90951c78ee81f277649f6946d110b0e860870f5b25597ef diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/12d485cb4dfe7b6e989161d860ddc2b4df74dbbe0281dd713ed87188faa218a3 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/12d485cb4dfe7b6e989161d860ddc2b4df74dbbe0281dd713ed87188faa218a3 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/12d485cb4dfe7b6e989161d860ddc2b4df74dbbe0281dd713ed87188faa218a3 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/12d485cb4dfe7b6e989161d860ddc2b4df74dbbe0281dd713ed87188faa218a3 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/1617c1ca7d5748488084cf78fd4103b3942a405dae8d5294217c6a74679a5422 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/1617c1ca7d5748488084cf78fd4103b3942a405dae8d5294217c6a74679a5422 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/1617c1ca7d5748488084cf78fd4103b3942a405dae8d5294217c6a74679a5422 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/1617c1ca7d5748488084cf78fd4103b3942a405dae8d5294217c6a74679a5422 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/16e00e6fae35f8d5fd0ee019d19be4e6a2bc43c69155c84ba5a3bfe138bf20e2 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/16e00e6fae35f8d5fd0ee019d19be4e6a2bc43c69155c84ba5a3bfe138bf20e2 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/16e00e6fae35f8d5fd0ee019d19be4e6a2bc43c69155c84ba5a3bfe138bf20e2 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/16e00e6fae35f8d5fd0ee019d19be4e6a2bc43c69155c84ba5a3bfe138bf20e2 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/17339660a82016d7d30260fbd86717741073efc1c0e83d1ffdb8307055b6544c b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/17339660a82016d7d30260fbd86717741073efc1c0e83d1ffdb8307055b6544c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/17339660a82016d7d30260fbd86717741073efc1c0e83d1ffdb8307055b6544c rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/17339660a82016d7d30260fbd86717741073efc1c0e83d1ffdb8307055b6544c diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/18780692c7ed9b0e9149cd82a30e00bea2e91b1d96c0a0c8282ead1c0e9e58f3 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/18780692c7ed9b0e9149cd82a30e00bea2e91b1d96c0a0c8282ead1c0e9e58f3 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/18780692c7ed9b0e9149cd82a30e00bea2e91b1d96c0a0c8282ead1c0e9e58f3 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/18780692c7ed9b0e9149cd82a30e00bea2e91b1d96c0a0c8282ead1c0e9e58f3 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/1af2fb04fb97d44a55178cfe4f39a6c00e0b17c14c2e65dfbb2bc754a99142bd b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/1af2fb04fb97d44a55178cfe4f39a6c00e0b17c14c2e65dfbb2bc754a99142bd similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/1af2fb04fb97d44a55178cfe4f39a6c00e0b17c14c2e65dfbb2bc754a99142bd rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/1af2fb04fb97d44a55178cfe4f39a6c00e0b17c14c2e65dfbb2bc754a99142bd diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/1d68d2965b17b09bb4bf17b06b5b145f5e786cf32aba272de1b739a19a2d7f5b b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/1d68d2965b17b09bb4bf17b06b5b145f5e786cf32aba272de1b739a19a2d7f5b similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/1d68d2965b17b09bb4bf17b06b5b145f5e786cf32aba272de1b739a19a2d7f5b rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/1d68d2965b17b09bb4bf17b06b5b145f5e786cf32aba272de1b739a19a2d7f5b diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/21a91143546d16ace814261cf4ed63d453d4b64881438f717514ae05cfae6b89 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/21a91143546d16ace814261cf4ed63d453d4b64881438f717514ae05cfae6b89 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/21a91143546d16ace814261cf4ed63d453d4b64881438f717514ae05cfae6b89 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/21a91143546d16ace814261cf4ed63d453d4b64881438f717514ae05cfae6b89 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/27abca1a0604db774fbd6658bc14057e851a8228bddbf601d034cf70fb279334 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/27abca1a0604db774fbd6658bc14057e851a8228bddbf601d034cf70fb279334 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/27abca1a0604db774fbd6658bc14057e851a8228bddbf601d034cf70fb279334 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/27abca1a0604db774fbd6658bc14057e851a8228bddbf601d034cf70fb279334 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/28222e20c4f90d92f3c2fae8812894bca7d9ab925c8637804809ff69f9040bef b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/28222e20c4f90d92f3c2fae8812894bca7d9ab925c8637804809ff69f9040bef similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/28222e20c4f90d92f3c2fae8812894bca7d9ab925c8637804809ff69f9040bef rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/28222e20c4f90d92f3c2fae8812894bca7d9ab925c8637804809ff69f9040bef diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/29adf4a2c69ff719ca779acd32ec0a1fc21120d916935e19bcd6e39ca71b1fb9 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/29adf4a2c69ff719ca779acd32ec0a1fc21120d916935e19bcd6e39ca71b1fb9 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/29adf4a2c69ff719ca779acd32ec0a1fc21120d916935e19bcd6e39ca71b1fb9 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/29adf4a2c69ff719ca779acd32ec0a1fc21120d916935e19bcd6e39ca71b1fb9 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/2d5f5d7fbea0239b4c2e3accf8aa9eb8f8216d53df6b57dfa4d207704bb76886 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/2d5f5d7fbea0239b4c2e3accf8aa9eb8f8216d53df6b57dfa4d207704bb76886 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/2d5f5d7fbea0239b4c2e3accf8aa9eb8f8216d53df6b57dfa4d207704bb76886 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/2d5f5d7fbea0239b4c2e3accf8aa9eb8f8216d53df6b57dfa4d207704bb76886 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/2f189788d0f75da30c18fdaa05e6e6a32826cb5ed942fcec7dfe9a2972823f7a b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/2f189788d0f75da30c18fdaa05e6e6a32826cb5ed942fcec7dfe9a2972823f7a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/2f189788d0f75da30c18fdaa05e6e6a32826cb5ed942fcec7dfe9a2972823f7a rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/2f189788d0f75da30c18fdaa05e6e6a32826cb5ed942fcec7dfe9a2972823f7a diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/2f6f3db05519056d8a42323da3145837d05be562435337e0b93784648800ba05 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/2f6f3db05519056d8a42323da3145837d05be562435337e0b93784648800ba05 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/2f6f3db05519056d8a42323da3145837d05be562435337e0b93784648800ba05 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/2f6f3db05519056d8a42323da3145837d05be562435337e0b93784648800ba05 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/30d127639037a3bba588caf5ea29da4883b8bfc122fc5f3bb898d7a428c1cf64 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/30d127639037a3bba588caf5ea29da4883b8bfc122fc5f3bb898d7a428c1cf64 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/30d127639037a3bba588caf5ea29da4883b8bfc122fc5f3bb898d7a428c1cf64 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/30d127639037a3bba588caf5ea29da4883b8bfc122fc5f3bb898d7a428c1cf64 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/3136959310e853125d29ab57d78047e6ed6a7993ce5e98bcfb325d2b2a54b36a b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/3136959310e853125d29ab57d78047e6ed6a7993ce5e98bcfb325d2b2a54b36a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/3136959310e853125d29ab57d78047e6ed6a7993ce5e98bcfb325d2b2a54b36a rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/3136959310e853125d29ab57d78047e6ed6a7993ce5e98bcfb325d2b2a54b36a diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/339981b0b2c87130b38fdf2b5d2d1e6021604bd5e42088c0fc0d21f6e7323c1f b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/339981b0b2c87130b38fdf2b5d2d1e6021604bd5e42088c0fc0d21f6e7323c1f similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/339981b0b2c87130b38fdf2b5d2d1e6021604bd5e42088c0fc0d21f6e7323c1f rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/339981b0b2c87130b38fdf2b5d2d1e6021604bd5e42088c0fc0d21f6e7323c1f diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/34798c78e7b3924dbf1bbc4846960b0ddc028d3a8d0bddd1504eac850493f29d b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/34798c78e7b3924dbf1bbc4846960b0ddc028d3a8d0bddd1504eac850493f29d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/34798c78e7b3924dbf1bbc4846960b0ddc028d3a8d0bddd1504eac850493f29d rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/34798c78e7b3924dbf1bbc4846960b0ddc028d3a8d0bddd1504eac850493f29d diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/34cd9b737481c5572f649f8c59fa9eae97ff87a7ea7cbdebdd536632a6f842d0 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/34cd9b737481c5572f649f8c59fa9eae97ff87a7ea7cbdebdd536632a6f842d0 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/34cd9b737481c5572f649f8c59fa9eae97ff87a7ea7cbdebdd536632a6f842d0 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/34cd9b737481c5572f649f8c59fa9eae97ff87a7ea7cbdebdd536632a6f842d0 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/358d7e671eb57aada0e72324ca7d90af2fcc6d37a15f31819baee3c93be748e6 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/358d7e671eb57aada0e72324ca7d90af2fcc6d37a15f31819baee3c93be748e6 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/358d7e671eb57aada0e72324ca7d90af2fcc6d37a15f31819baee3c93be748e6 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/358d7e671eb57aada0e72324ca7d90af2fcc6d37a15f31819baee3c93be748e6 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/36d885eb98ba3e8ff7fa5a2b92630009ef0582d4c3e4d9baadead98b639fb179 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/36d885eb98ba3e8ff7fa5a2b92630009ef0582d4c3e4d9baadead98b639fb179 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/36d885eb98ba3e8ff7fa5a2b92630009ef0582d4c3e4d9baadead98b639fb179 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/36d885eb98ba3e8ff7fa5a2b92630009ef0582d4c3e4d9baadead98b639fb179 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/36e7663a613e1fda0e7864f0eb8d2746220fef0b5b2d1b86d3c29241363c1baf b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/36e7663a613e1fda0e7864f0eb8d2746220fef0b5b2d1b86d3c29241363c1baf similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/36e7663a613e1fda0e7864f0eb8d2746220fef0b5b2d1b86d3c29241363c1baf rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/36e7663a613e1fda0e7864f0eb8d2746220fef0b5b2d1b86d3c29241363c1baf diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/386696da68b5ca920eca048a556b533db7a44eec501a91ff40368edc0ee27f46 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/386696da68b5ca920eca048a556b533db7a44eec501a91ff40368edc0ee27f46 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/386696da68b5ca920eca048a556b533db7a44eec501a91ff40368edc0ee27f46 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/386696da68b5ca920eca048a556b533db7a44eec501a91ff40368edc0ee27f46 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/3966bbcf5b916a843e30fe08701a32dc1269fde778cf9c0de1e8a82209fdc4df b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/3966bbcf5b916a843e30fe08701a32dc1269fde778cf9c0de1e8a82209fdc4df similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/3966bbcf5b916a843e30fe08701a32dc1269fde778cf9c0de1e8a82209fdc4df rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/3966bbcf5b916a843e30fe08701a32dc1269fde778cf9c0de1e8a82209fdc4df diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/3d6d4667fa3eb9dfc67abda990b1c4153b7a5603f90b3c87976f0ece7ab03252 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/3d6d4667fa3eb9dfc67abda990b1c4153b7a5603f90b3c87976f0ece7ab03252 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/3d6d4667fa3eb9dfc67abda990b1c4153b7a5603f90b3c87976f0ece7ab03252 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/3d6d4667fa3eb9dfc67abda990b1c4153b7a5603f90b3c87976f0ece7ab03252 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/406ab42996411602dd627ac23e5b7cdded13770a5df35de6e5a9cc10634bec16 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/406ab42996411602dd627ac23e5b7cdded13770a5df35de6e5a9cc10634bec16 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/406ab42996411602dd627ac23e5b7cdded13770a5df35de6e5a9cc10634bec16 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/406ab42996411602dd627ac23e5b7cdded13770a5df35de6e5a9cc10634bec16 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/47756611856361e5f49beb59887b19c0a5caedb063ddc3ccf4637ffaf5fd0e9c b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/47756611856361e5f49beb59887b19c0a5caedb063ddc3ccf4637ffaf5fd0e9c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/47756611856361e5f49beb59887b19c0a5caedb063ddc3ccf4637ffaf5fd0e9c rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/47756611856361e5f49beb59887b19c0a5caedb063ddc3ccf4637ffaf5fd0e9c diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/49843d73881cdaa969df573f31b996ca304dcf59d0900acb16c422d858da8558 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/49843d73881cdaa969df573f31b996ca304dcf59d0900acb16c422d858da8558 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/49843d73881cdaa969df573f31b996ca304dcf59d0900acb16c422d858da8558 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/49843d73881cdaa969df573f31b996ca304dcf59d0900acb16c422d858da8558 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/4aa279f8587979ff599bd5ca016ddf204716340ec0c4d34eb754ed963cc361cd b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/4aa279f8587979ff599bd5ca016ddf204716340ec0c4d34eb754ed963cc361cd similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/4aa279f8587979ff599bd5ca016ddf204716340ec0c4d34eb754ed963cc361cd rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/4aa279f8587979ff599bd5ca016ddf204716340ec0c4d34eb754ed963cc361cd diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/4ad90ef26f7402525bf70e67bdb747ac72df961e70981809cea286602645df5f b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/4ad90ef26f7402525bf70e67bdb747ac72df961e70981809cea286602645df5f similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/4ad90ef26f7402525bf70e67bdb747ac72df961e70981809cea286602645df5f rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/4ad90ef26f7402525bf70e67bdb747ac72df961e70981809cea286602645df5f diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/5029131965759979d49a4ab66a7dee62e53a42aa43227d5bfc184997e83fe146 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/5029131965759979d49a4ab66a7dee62e53a42aa43227d5bfc184997e83fe146 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/5029131965759979d49a4ab66a7dee62e53a42aa43227d5bfc184997e83fe146 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/5029131965759979d49a4ab66a7dee62e53a42aa43227d5bfc184997e83fe146 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/50763b2ae3d0f56a13c53d99d37ac2d1d8e5bfc6c70f11e5b1a8a4d7c7119eaa b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/50763b2ae3d0f56a13c53d99d37ac2d1d8e5bfc6c70f11e5b1a8a4d7c7119eaa similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/50763b2ae3d0f56a13c53d99d37ac2d1d8e5bfc6c70f11e5b1a8a4d7c7119eaa rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/50763b2ae3d0f56a13c53d99d37ac2d1d8e5bfc6c70f11e5b1a8a4d7c7119eaa diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/5284d7c15b372cb6f8263bcaba998eb0f520b5aade68b4b1d23aac7b27f27405 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/5284d7c15b372cb6f8263bcaba998eb0f520b5aade68b4b1d23aac7b27f27405 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/5284d7c15b372cb6f8263bcaba998eb0f520b5aade68b4b1d23aac7b27f27405 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/5284d7c15b372cb6f8263bcaba998eb0f520b5aade68b4b1d23aac7b27f27405 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/54648fd6e9eab698c9f3b953ec86a663f36e881a7cd7d383306805966bfb373a b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/54648fd6e9eab698c9f3b953ec86a663f36e881a7cd7d383306805966bfb373a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/54648fd6e9eab698c9f3b953ec86a663f36e881a7cd7d383306805966bfb373a rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/54648fd6e9eab698c9f3b953ec86a663f36e881a7cd7d383306805966bfb373a diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/550b9d8b194aa409df8d05c40723dfbb50211ec7435498bde6f2ab07f5613d62 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/550b9d8b194aa409df8d05c40723dfbb50211ec7435498bde6f2ab07f5613d62 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/550b9d8b194aa409df8d05c40723dfbb50211ec7435498bde6f2ab07f5613d62 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/550b9d8b194aa409df8d05c40723dfbb50211ec7435498bde6f2ab07f5613d62 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/5622b4ddd13cd056ef4942149b1b454d5624cde6f44a70523c38384e2667895b b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/5622b4ddd13cd056ef4942149b1b454d5624cde6f44a70523c38384e2667895b similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/5622b4ddd13cd056ef4942149b1b454d5624cde6f44a70523c38384e2667895b rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/5622b4ddd13cd056ef4942149b1b454d5624cde6f44a70523c38384e2667895b diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/581aa48ee773a472f45360d12593fdd48a8fa2eb5699763f39f40c1d186f00be b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/581aa48ee773a472f45360d12593fdd48a8fa2eb5699763f39f40c1d186f00be similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/581aa48ee773a472f45360d12593fdd48a8fa2eb5699763f39f40c1d186f00be rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/581aa48ee773a472f45360d12593fdd48a8fa2eb5699763f39f40c1d186f00be diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/5aedb62af767261bdbdf55f8782c067ba2970b44493dd904481e853e19f7a1dc b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/5aedb62af767261bdbdf55f8782c067ba2970b44493dd904481e853e19f7a1dc similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/5aedb62af767261bdbdf55f8782c067ba2970b44493dd904481e853e19f7a1dc rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/5aedb62af767261bdbdf55f8782c067ba2970b44493dd904481e853e19f7a1dc diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/5b483e01d9b7573996039fb363e63b996acd58d1b331bf86ac3394abf634ae29 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/5b483e01d9b7573996039fb363e63b996acd58d1b331bf86ac3394abf634ae29 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/5b483e01d9b7573996039fb363e63b996acd58d1b331bf86ac3394abf634ae29 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/5b483e01d9b7573996039fb363e63b996acd58d1b331bf86ac3394abf634ae29 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/5c4a255d8553207fc3bcff526ea47f2e208dbeeb667b109a9b18d95d9e1dfbd3 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/5c4a255d8553207fc3bcff526ea47f2e208dbeeb667b109a9b18d95d9e1dfbd3 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/5c4a255d8553207fc3bcff526ea47f2e208dbeeb667b109a9b18d95d9e1dfbd3 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/5c4a255d8553207fc3bcff526ea47f2e208dbeeb667b109a9b18d95d9e1dfbd3 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/5c4d6999cc9220a5ad4f5091aa52d6c12e6a7cfd93e6de9564d4c561a5c188d0 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/5c4d6999cc9220a5ad4f5091aa52d6c12e6a7cfd93e6de9564d4c561a5c188d0 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/5c4d6999cc9220a5ad4f5091aa52d6c12e6a7cfd93e6de9564d4c561a5c188d0 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/5c4d6999cc9220a5ad4f5091aa52d6c12e6a7cfd93e6de9564d4c561a5c188d0 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/5ebad892ca420a465fea06a4a53884fef956d644829f368e43ca64089f9eba7e b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/5ebad892ca420a465fea06a4a53884fef956d644829f368e43ca64089f9eba7e similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/5ebad892ca420a465fea06a4a53884fef956d644829f368e43ca64089f9eba7e rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/5ebad892ca420a465fea06a4a53884fef956d644829f368e43ca64089f9eba7e diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/66867508cc2259c855d1f9267f68248445200738a1558f8f3b3db4b490f85891 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/66867508cc2259c855d1f9267f68248445200738a1558f8f3b3db4b490f85891 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/66867508cc2259c855d1f9267f68248445200738a1558f8f3b3db4b490f85891 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/66867508cc2259c855d1f9267f68248445200738a1558f8f3b3db4b490f85891 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/67e7c04f183e5365619ec3c68bac7a72e53a194074fc4b6d00dd0e5048b66132 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/67e7c04f183e5365619ec3c68bac7a72e53a194074fc4b6d00dd0e5048b66132 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/67e7c04f183e5365619ec3c68bac7a72e53a194074fc4b6d00dd0e5048b66132 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/67e7c04f183e5365619ec3c68bac7a72e53a194074fc4b6d00dd0e5048b66132 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/690ba07d8701b7c1c10dbb26003e5c91e9313d521a88b24c6c0ba3c2aa41a16b b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/690ba07d8701b7c1c10dbb26003e5c91e9313d521a88b24c6c0ba3c2aa41a16b similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/690ba07d8701b7c1c10dbb26003e5c91e9313d521a88b24c6c0ba3c2aa41a16b rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/690ba07d8701b7c1c10dbb26003e5c91e9313d521a88b24c6c0ba3c2aa41a16b diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/699fdef7a4b008c2598eadc45e0ac8215f20df697ea1af8ce0aed02c7f931a4b b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/699fdef7a4b008c2598eadc45e0ac8215f20df697ea1af8ce0aed02c7f931a4b similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/699fdef7a4b008c2598eadc45e0ac8215f20df697ea1af8ce0aed02c7f931a4b rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/699fdef7a4b008c2598eadc45e0ac8215f20df697ea1af8ce0aed02c7f931a4b diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/6a18942a8a74c9388db13175c459a6ca5ee92c00b467b152aea75644bba4921c b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/6a18942a8a74c9388db13175c459a6ca5ee92c00b467b152aea75644bba4921c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/6a18942a8a74c9388db13175c459a6ca5ee92c00b467b152aea75644bba4921c rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/6a18942a8a74c9388db13175c459a6ca5ee92c00b467b152aea75644bba4921c diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/6ca3473a5deee82cf5784ed58377f4dbfe835830209ebd3dee6c7091bf464140 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/6ca3473a5deee82cf5784ed58377f4dbfe835830209ebd3dee6c7091bf464140 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/6ca3473a5deee82cf5784ed58377f4dbfe835830209ebd3dee6c7091bf464140 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/6ca3473a5deee82cf5784ed58377f4dbfe835830209ebd3dee6c7091bf464140 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/6dff156fc5d1c59ec0dc99ec574db7bb4cefe87a11cc4bdaad492e8326ecf709 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/6dff156fc5d1c59ec0dc99ec574db7bb4cefe87a11cc4bdaad492e8326ecf709 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/6dff156fc5d1c59ec0dc99ec574db7bb4cefe87a11cc4bdaad492e8326ecf709 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/6dff156fc5d1c59ec0dc99ec574db7bb4cefe87a11cc4bdaad492e8326ecf709 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/6e55ad3de22a11ed02e45c93ea279a12c77e155733b99ed92aa1ebdfaac02f62 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/6e55ad3de22a11ed02e45c93ea279a12c77e155733b99ed92aa1ebdfaac02f62 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/6e55ad3de22a11ed02e45c93ea279a12c77e155733b99ed92aa1ebdfaac02f62 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/6e55ad3de22a11ed02e45c93ea279a12c77e155733b99ed92aa1ebdfaac02f62 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/71cadbd0b0142c6a0902738d16cf1139a89cd70fe0f58f82985deac73ca3b648 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/71cadbd0b0142c6a0902738d16cf1139a89cd70fe0f58f82985deac73ca3b648 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/71cadbd0b0142c6a0902738d16cf1139a89cd70fe0f58f82985deac73ca3b648 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/71cadbd0b0142c6a0902738d16cf1139a89cd70fe0f58f82985deac73ca3b648 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/71f8a4fe87ce4f824a8387d3b9c2c121ca5452b5731508dae6b88642a260f516 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/71f8a4fe87ce4f824a8387d3b9c2c121ca5452b5731508dae6b88642a260f516 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/71f8a4fe87ce4f824a8387d3b9c2c121ca5452b5731508dae6b88642a260f516 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/71f8a4fe87ce4f824a8387d3b9c2c121ca5452b5731508dae6b88642a260f516 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/72365de986660a69ab4ddd767c6a2200395b4ea3c965061f8c591c342af7db4d b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/72365de986660a69ab4ddd767c6a2200395b4ea3c965061f8c591c342af7db4d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/72365de986660a69ab4ddd767c6a2200395b4ea3c965061f8c591c342af7db4d rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/72365de986660a69ab4ddd767c6a2200395b4ea3c965061f8c591c342af7db4d diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/72551a780afb8d31516d807d66c6de86727224a244a0c1636c216351015547bc b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/72551a780afb8d31516d807d66c6de86727224a244a0c1636c216351015547bc similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/72551a780afb8d31516d807d66c6de86727224a244a0c1636c216351015547bc rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/72551a780afb8d31516d807d66c6de86727224a244a0c1636c216351015547bc diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/740194dc88625830e2fe41894f07dfb51b29df3c34c3eff2e0afe24b94665714 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/740194dc88625830e2fe41894f07dfb51b29df3c34c3eff2e0afe24b94665714 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/740194dc88625830e2fe41894f07dfb51b29df3c34c3eff2e0afe24b94665714 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/740194dc88625830e2fe41894f07dfb51b29df3c34c3eff2e0afe24b94665714 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/754510a3961c28f2f1b3aa91be0fd2123a9bd13f5fdb2574eaf37f842b95d8b4 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/754510a3961c28f2f1b3aa91be0fd2123a9bd13f5fdb2574eaf37f842b95d8b4 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/754510a3961c28f2f1b3aa91be0fd2123a9bd13f5fdb2574eaf37f842b95d8b4 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/754510a3961c28f2f1b3aa91be0fd2123a9bd13f5fdb2574eaf37f842b95d8b4 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/7547cf52cdb8153fd527e9aeede7c517478d47b98b429da3ac5c3dc177d1a64a b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/7547cf52cdb8153fd527e9aeede7c517478d47b98b429da3ac5c3dc177d1a64a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/7547cf52cdb8153fd527e9aeede7c517478d47b98b429da3ac5c3dc177d1a64a rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/7547cf52cdb8153fd527e9aeede7c517478d47b98b429da3ac5c3dc177d1a64a diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/76c8f4fceae2c135fa4d4e6d5232d813244d5633602dd300d18b7caedfb9c031 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/76c8f4fceae2c135fa4d4e6d5232d813244d5633602dd300d18b7caedfb9c031 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/76c8f4fceae2c135fa4d4e6d5232d813244d5633602dd300d18b7caedfb9c031 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/76c8f4fceae2c135fa4d4e6d5232d813244d5633602dd300d18b7caedfb9c031 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/777d8202e5137836d28499f4baba13f1b7d8ecf7bf48903f5b2d66cf03590c57 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/777d8202e5137836d28499f4baba13f1b7d8ecf7bf48903f5b2d66cf03590c57 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/777d8202e5137836d28499f4baba13f1b7d8ecf7bf48903f5b2d66cf03590c57 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/777d8202e5137836d28499f4baba13f1b7d8ecf7bf48903f5b2d66cf03590c57 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/7941b2dfb9960d2584d434e3efa28896a77a70a2b206f2836b853cef59580252 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/7941b2dfb9960d2584d434e3efa28896a77a70a2b206f2836b853cef59580252 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/7941b2dfb9960d2584d434e3efa28896a77a70a2b206f2836b853cef59580252 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/7941b2dfb9960d2584d434e3efa28896a77a70a2b206f2836b853cef59580252 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/7a6b20101958bceada4c81ff2a26a43da76853ff7e2eec15ec8881be31ac8ca5 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/7a6b20101958bceada4c81ff2a26a43da76853ff7e2eec15ec8881be31ac8ca5 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/7a6b20101958bceada4c81ff2a26a43da76853ff7e2eec15ec8881be31ac8ca5 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/7a6b20101958bceada4c81ff2a26a43da76853ff7e2eec15ec8881be31ac8ca5 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/7a8416d7831104be83323eed78548676f5d781eebc7e2f590c6db3065a027db6 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/7a8416d7831104be83323eed78548676f5d781eebc7e2f590c6db3065a027db6 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/7a8416d7831104be83323eed78548676f5d781eebc7e2f590c6db3065a027db6 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/7a8416d7831104be83323eed78548676f5d781eebc7e2f590c6db3065a027db6 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/7ad3613c3bffe6a8eee8ecaca759b9e0c695f46654555b6701e165bed8065b97 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/7ad3613c3bffe6a8eee8ecaca759b9e0c695f46654555b6701e165bed8065b97 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/7ad3613c3bffe6a8eee8ecaca759b9e0c695f46654555b6701e165bed8065b97 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/7ad3613c3bffe6a8eee8ecaca759b9e0c695f46654555b6701e165bed8065b97 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/7bb3d2f32f8b4bd0a0bda3022c098a8903a710f2f964d1596db201f48f3d8bae b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/7bb3d2f32f8b4bd0a0bda3022c098a8903a710f2f964d1596db201f48f3d8bae similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/7bb3d2f32f8b4bd0a0bda3022c098a8903a710f2f964d1596db201f48f3d8bae rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/7bb3d2f32f8b4bd0a0bda3022c098a8903a710f2f964d1596db201f48f3d8bae diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/7c02bbe8106731d8954c0a040566c6d39462b3e97594fb6e891579b9dec9ba4f b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/7c02bbe8106731d8954c0a040566c6d39462b3e97594fb6e891579b9dec9ba4f similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/7c02bbe8106731d8954c0a040566c6d39462b3e97594fb6e891579b9dec9ba4f rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/7c02bbe8106731d8954c0a040566c6d39462b3e97594fb6e891579b9dec9ba4f diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/80b1397330d5897a14f41e5950304bd2e1345abe806e8f7780db159cd5cbfcf0 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/80b1397330d5897a14f41e5950304bd2e1345abe806e8f7780db159cd5cbfcf0 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/80b1397330d5897a14f41e5950304bd2e1345abe806e8f7780db159cd5cbfcf0 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/80b1397330d5897a14f41e5950304bd2e1345abe806e8f7780db159cd5cbfcf0 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/87e39bb8a08d88fa8321e98605c5f1f924a4912a5f543de912bdbea0f04ad949 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/87e39bb8a08d88fa8321e98605c5f1f924a4912a5f543de912bdbea0f04ad949 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/87e39bb8a08d88fa8321e98605c5f1f924a4912a5f543de912bdbea0f04ad949 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/87e39bb8a08d88fa8321e98605c5f1f924a4912a5f543de912bdbea0f04ad949 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/883c71df8b2a7e1bc714352bc93510bd9c510e4a0c2113737a2561d2127c78af b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/883c71df8b2a7e1bc714352bc93510bd9c510e4a0c2113737a2561d2127c78af similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/883c71df8b2a7e1bc714352bc93510bd9c510e4a0c2113737a2561d2127c78af rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/883c71df8b2a7e1bc714352bc93510bd9c510e4a0c2113737a2561d2127c78af diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/8a080ccdfd8a6487d5912387c1219eed9e668188fd798aac8d515562a960c292 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/8a080ccdfd8a6487d5912387c1219eed9e668188fd798aac8d515562a960c292 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/8a080ccdfd8a6487d5912387c1219eed9e668188fd798aac8d515562a960c292 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/8a080ccdfd8a6487d5912387c1219eed9e668188fd798aac8d515562a960c292 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/8b79a6b77b94613f8832a643acca0a5c06026cbbd2508b196860efd1c2fe107a b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/8b79a6b77b94613f8832a643acca0a5c06026cbbd2508b196860efd1c2fe107a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/8b79a6b77b94613f8832a643acca0a5c06026cbbd2508b196860efd1c2fe107a rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/8b79a6b77b94613f8832a643acca0a5c06026cbbd2508b196860efd1c2fe107a diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/8c1e487474a60f7541c604770d97a13454e30d8f1853912b63f9f798e8208021 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/8c1e487474a60f7541c604770d97a13454e30d8f1853912b63f9f798e8208021 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/8c1e487474a60f7541c604770d97a13454e30d8f1853912b63f9f798e8208021 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/8c1e487474a60f7541c604770d97a13454e30d8f1853912b63f9f798e8208021 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/8c6e08504d85c8c56129700bdfc37e08c51bbcae22d985e51e28a4a29f8ce9b0 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/8c6e08504d85c8c56129700bdfc37e08c51bbcae22d985e51e28a4a29f8ce9b0 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/8c6e08504d85c8c56129700bdfc37e08c51bbcae22d985e51e28a4a29f8ce9b0 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/8c6e08504d85c8c56129700bdfc37e08c51bbcae22d985e51e28a4a29f8ce9b0 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/9334520ea67a62f6aa00b10e749193aad75758209b1e6b7e17b22623f7d36966 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/9334520ea67a62f6aa00b10e749193aad75758209b1e6b7e17b22623f7d36966 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/9334520ea67a62f6aa00b10e749193aad75758209b1e6b7e17b22623f7d36966 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/9334520ea67a62f6aa00b10e749193aad75758209b1e6b7e17b22623f7d36966 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/984abb68940259af350e55d4a017aa6366d3ea0d602a6b29172b03514ee870e8 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/984abb68940259af350e55d4a017aa6366d3ea0d602a6b29172b03514ee870e8 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/984abb68940259af350e55d4a017aa6366d3ea0d602a6b29172b03514ee870e8 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/984abb68940259af350e55d4a017aa6366d3ea0d602a6b29172b03514ee870e8 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/997ba1be1d4dfdce9b568b9b664694425be35ad5954dc898eb2d3263a2e13668 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/997ba1be1d4dfdce9b568b9b664694425be35ad5954dc898eb2d3263a2e13668 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/997ba1be1d4dfdce9b568b9b664694425be35ad5954dc898eb2d3263a2e13668 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/997ba1be1d4dfdce9b568b9b664694425be35ad5954dc898eb2d3263a2e13668 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/9bf97aac7fd774fa7b9494c8c9a8614e6e611ab4e8923b7d1b2b7a78ec55c5a9 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/9bf97aac7fd774fa7b9494c8c9a8614e6e611ab4e8923b7d1b2b7a78ec55c5a9 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/9bf97aac7fd774fa7b9494c8c9a8614e6e611ab4e8923b7d1b2b7a78ec55c5a9 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/9bf97aac7fd774fa7b9494c8c9a8614e6e611ab4e8923b7d1b2b7a78ec55c5a9 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/9c6df4914f7c2aa3aff3292747a89bcd112dc7528964b6fa62f8bab4ac851fb1 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/9c6df4914f7c2aa3aff3292747a89bcd112dc7528964b6fa62f8bab4ac851fb1 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/9c6df4914f7c2aa3aff3292747a89bcd112dc7528964b6fa62f8bab4ac851fb1 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/9c6df4914f7c2aa3aff3292747a89bcd112dc7528964b6fa62f8bab4ac851fb1 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/9cbac0a354096e533988fd3fb7190e4adca0de0f516d36c3b857f6196f85a777 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/9cbac0a354096e533988fd3fb7190e4adca0de0f516d36c3b857f6196f85a777 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/9cbac0a354096e533988fd3fb7190e4adca0de0f516d36c3b857f6196f85a777 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/9cbac0a354096e533988fd3fb7190e4adca0de0f516d36c3b857f6196f85a777 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/9d10821613d6a7b1fd53066a2d5e9757f2c19e1a006fd6490685041d18bfeba2 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/9d10821613d6a7b1fd53066a2d5e9757f2c19e1a006fd6490685041d18bfeba2 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/9d10821613d6a7b1fd53066a2d5e9757f2c19e1a006fd6490685041d18bfeba2 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/9d10821613d6a7b1fd53066a2d5e9757f2c19e1a006fd6490685041d18bfeba2 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/9e420256bbb162ad7197addcfdcf9e913705fe58aa0858badd7592d20e8610de b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/9e420256bbb162ad7197addcfdcf9e913705fe58aa0858badd7592d20e8610de similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/9e420256bbb162ad7197addcfdcf9e913705fe58aa0858badd7592d20e8610de rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/9e420256bbb162ad7197addcfdcf9e913705fe58aa0858badd7592d20e8610de diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/9eb912b68af4372636377e8d8d3121a2fbdcb115689778e13945fcc698d4e7d2 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/9eb912b68af4372636377e8d8d3121a2fbdcb115689778e13945fcc698d4e7d2 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/9eb912b68af4372636377e8d8d3121a2fbdcb115689778e13945fcc698d4e7d2 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/9eb912b68af4372636377e8d8d3121a2fbdcb115689778e13945fcc698d4e7d2 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/a0c06e7a336e507e0417e83ee7ca197eb5954ed6c9f6f210e6fc8c433cb8679c b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/a0c06e7a336e507e0417e83ee7ca197eb5954ed6c9f6f210e6fc8c433cb8679c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/a0c06e7a336e507e0417e83ee7ca197eb5954ed6c9f6f210e6fc8c433cb8679c rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/a0c06e7a336e507e0417e83ee7ca197eb5954ed6c9f6f210e6fc8c433cb8679c diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/a15cd11e35c129e0a37647e49479292d075a3b87ff6498a6f879d093db7774e5 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/a15cd11e35c129e0a37647e49479292d075a3b87ff6498a6f879d093db7774e5 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/a15cd11e35c129e0a37647e49479292d075a3b87ff6498a6f879d093db7774e5 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/a15cd11e35c129e0a37647e49479292d075a3b87ff6498a6f879d093db7774e5 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/a2163836f963e6af006cf8206a7c4f2dd458103dda56fffeffed691744e128e5 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/a2163836f963e6af006cf8206a7c4f2dd458103dda56fffeffed691744e128e5 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/a2163836f963e6af006cf8206a7c4f2dd458103dda56fffeffed691744e128e5 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/a2163836f963e6af006cf8206a7c4f2dd458103dda56fffeffed691744e128e5 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/a3bea3768ac34503ccf80824f160a0b5736c35cb03ca263026100cadd7810751 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/a3bea3768ac34503ccf80824f160a0b5736c35cb03ca263026100cadd7810751 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/a3bea3768ac34503ccf80824f160a0b5736c35cb03ca263026100cadd7810751 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/a3bea3768ac34503ccf80824f160a0b5736c35cb03ca263026100cadd7810751 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/a3fc486c34a02718f380172056d7ee1e7af56ed783b707dee2f8eaa2af91784c b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/a3fc486c34a02718f380172056d7ee1e7af56ed783b707dee2f8eaa2af91784c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/a3fc486c34a02718f380172056d7ee1e7af56ed783b707dee2f8eaa2af91784c rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/a3fc486c34a02718f380172056d7ee1e7af56ed783b707dee2f8eaa2af91784c diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/a4eba0a1e35d1958ee8a44dcfccc831245b09c920b0335c8ab35beb6b11a44d9 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/a4eba0a1e35d1958ee8a44dcfccc831245b09c920b0335c8ab35beb6b11a44d9 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/a4eba0a1e35d1958ee8a44dcfccc831245b09c920b0335c8ab35beb6b11a44d9 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/a4eba0a1e35d1958ee8a44dcfccc831245b09c920b0335c8ab35beb6b11a44d9 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/a745406ae15db0ba2293acc1556caeb0f5738644bd979f653ae5ee53b9f4d91d b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/a745406ae15db0ba2293acc1556caeb0f5738644bd979f653ae5ee53b9f4d91d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/a745406ae15db0ba2293acc1556caeb0f5738644bd979f653ae5ee53b9f4d91d rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/a745406ae15db0ba2293acc1556caeb0f5738644bd979f653ae5ee53b9f4d91d diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/a959c8f719a9962580d209945c6b75ac14cbf36ef3daa299ccb2f1cf52ba512b b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/a959c8f719a9962580d209945c6b75ac14cbf36ef3daa299ccb2f1cf52ba512b similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/a959c8f719a9962580d209945c6b75ac14cbf36ef3daa299ccb2f1cf52ba512b rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/a959c8f719a9962580d209945c6b75ac14cbf36ef3daa299ccb2f1cf52ba512b diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/a9b9f312959dc078a59dcc095cf1421635ab32ecfa016d53ed136e91f1dd719a b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/a9b9f312959dc078a59dcc095cf1421635ab32ecfa016d53ed136e91f1dd719a similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/a9b9f312959dc078a59dcc095cf1421635ab32ecfa016d53ed136e91f1dd719a rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/a9b9f312959dc078a59dcc095cf1421635ab32ecfa016d53ed136e91f1dd719a diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/a9bf6e421306a5528818f413cedd0ae1caa153f4a040d8a6ccb34667ad64b51c b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/a9bf6e421306a5528818f413cedd0ae1caa153f4a040d8a6ccb34667ad64b51c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/a9bf6e421306a5528818f413cedd0ae1caa153f4a040d8a6ccb34667ad64b51c rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/a9bf6e421306a5528818f413cedd0ae1caa153f4a040d8a6ccb34667ad64b51c diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/ae325cea68b7dbf16e91089b1478b230ca5e90673c2030e81b94bcf7a8756696 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/ae325cea68b7dbf16e91089b1478b230ca5e90673c2030e81b94bcf7a8756696 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/ae325cea68b7dbf16e91089b1478b230ca5e90673c2030e81b94bcf7a8756696 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/ae325cea68b7dbf16e91089b1478b230ca5e90673c2030e81b94bcf7a8756696 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/b0340ff45d8096a48faf8cdb13856061d597a1c0772a96dbb8ce0f5ee9d27863 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/b0340ff45d8096a48faf8cdb13856061d597a1c0772a96dbb8ce0f5ee9d27863 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/b0340ff45d8096a48faf8cdb13856061d597a1c0772a96dbb8ce0f5ee9d27863 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/b0340ff45d8096a48faf8cdb13856061d597a1c0772a96dbb8ce0f5ee9d27863 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/b0547053c889653febbe8ea5f6021d8c6fe433d737c4a1b3ff1fd995b51033e3 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/b0547053c889653febbe8ea5f6021d8c6fe433d737c4a1b3ff1fd995b51033e3 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/b0547053c889653febbe8ea5f6021d8c6fe433d737c4a1b3ff1fd995b51033e3 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/b0547053c889653febbe8ea5f6021d8c6fe433d737c4a1b3ff1fd995b51033e3 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/b18c75427ba825705aa41da09e58553ece389dc3b077fa50d44dd30702cb919c b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/b18c75427ba825705aa41da09e58553ece389dc3b077fa50d44dd30702cb919c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/b18c75427ba825705aa41da09e58553ece389dc3b077fa50d44dd30702cb919c rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/b18c75427ba825705aa41da09e58553ece389dc3b077fa50d44dd30702cb919c diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/b19384c6de9607956aa7835c1ce65d3e88d455001470b93fda873d1b28fb77c4 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/b19384c6de9607956aa7835c1ce65d3e88d455001470b93fda873d1b28fb77c4 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/b19384c6de9607956aa7835c1ce65d3e88d455001470b93fda873d1b28fb77c4 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/b19384c6de9607956aa7835c1ce65d3e88d455001470b93fda873d1b28fb77c4 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/b3600f208c5854dc121a557e43a8f80dbd50bd49be1443977395ca949c4721c4 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/b3600f208c5854dc121a557e43a8f80dbd50bd49be1443977395ca949c4721c4 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/b3600f208c5854dc121a557e43a8f80dbd50bd49be1443977395ca949c4721c4 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/b3600f208c5854dc121a557e43a8f80dbd50bd49be1443977395ca949c4721c4 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/b4edcb50b3086a590d22ebf30e064e2024f0ca468212a6502fae5daf68a7f673 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/b4edcb50b3086a590d22ebf30e064e2024f0ca468212a6502fae5daf68a7f673 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/b4edcb50b3086a590d22ebf30e064e2024f0ca468212a6502fae5daf68a7f673 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/b4edcb50b3086a590d22ebf30e064e2024f0ca468212a6502fae5daf68a7f673 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/b77f919cea1528b8360188c16a9d3b4c2167923c2c9962ada88362255f3dd71f b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/b77f919cea1528b8360188c16a9d3b4c2167923c2c9962ada88362255f3dd71f similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/b77f919cea1528b8360188c16a9d3b4c2167923c2c9962ada88362255f3dd71f rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/b77f919cea1528b8360188c16a9d3b4c2167923c2c9962ada88362255f3dd71f diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/b7a795660875e5e1344f5d26f41ddffbb0916d3c9f9d676b1698a1c975575419 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/b7a795660875e5e1344f5d26f41ddffbb0916d3c9f9d676b1698a1c975575419 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/b7a795660875e5e1344f5d26f41ddffbb0916d3c9f9d676b1698a1c975575419 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/b7a795660875e5e1344f5d26f41ddffbb0916d3c9f9d676b1698a1c975575419 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/bb31aeb879ce9be5e9c01154120dca95470afaa0ab5cde4423f87dd6709df11e b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/bb31aeb879ce9be5e9c01154120dca95470afaa0ab5cde4423f87dd6709df11e similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/bb31aeb879ce9be5e9c01154120dca95470afaa0ab5cde4423f87dd6709df11e rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/bb31aeb879ce9be5e9c01154120dca95470afaa0ab5cde4423f87dd6709df11e diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/bc896a7a924f3a8afa58e312ac7afe1b7b8872b2f2a3eb5150581dd3c7bb7a96 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/bc896a7a924f3a8afa58e312ac7afe1b7b8872b2f2a3eb5150581dd3c7bb7a96 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/bc896a7a924f3a8afa58e312ac7afe1b7b8872b2f2a3eb5150581dd3c7bb7a96 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/bc896a7a924f3a8afa58e312ac7afe1b7b8872b2f2a3eb5150581dd3c7bb7a96 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/bceda40c3561d267772822c8eaa213807eee5fe25e20930acd5d18b8a205dae0 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/bceda40c3561d267772822c8eaa213807eee5fe25e20930acd5d18b8a205dae0 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/bceda40c3561d267772822c8eaa213807eee5fe25e20930acd5d18b8a205dae0 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/bceda40c3561d267772822c8eaa213807eee5fe25e20930acd5d18b8a205dae0 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/c479841b2975286a5e8daff3f84f102221fbe128427ed0bbb90c56212c5b4307 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/c479841b2975286a5e8daff3f84f102221fbe128427ed0bbb90c56212c5b4307 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/c479841b2975286a5e8daff3f84f102221fbe128427ed0bbb90c56212c5b4307 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/c479841b2975286a5e8daff3f84f102221fbe128427ed0bbb90c56212c5b4307 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/c499471740345e6ed88bd59135f348538c54765df9537b661eb1754a31ae1b72 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/c499471740345e6ed88bd59135f348538c54765df9537b661eb1754a31ae1b72 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/c499471740345e6ed88bd59135f348538c54765df9537b661eb1754a31ae1b72 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/c499471740345e6ed88bd59135f348538c54765df9537b661eb1754a31ae1b72 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/c6a7d2e99c6d9cbf49fbc7fe2058e6fd40402b0a39acdecdfc4a14d9707da400 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/c6a7d2e99c6d9cbf49fbc7fe2058e6fd40402b0a39acdecdfc4a14d9707da400 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/c6a7d2e99c6d9cbf49fbc7fe2058e6fd40402b0a39acdecdfc4a14d9707da400 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/c6a7d2e99c6d9cbf49fbc7fe2058e6fd40402b0a39acdecdfc4a14d9707da400 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/c6c5e28f713554f741b6223d659f28c1ef86a432182c17264656fc9eece6d29e b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/c6c5e28f713554f741b6223d659f28c1ef86a432182c17264656fc9eece6d29e similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/c6c5e28f713554f741b6223d659f28c1ef86a432182c17264656fc9eece6d29e rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/c6c5e28f713554f741b6223d659f28c1ef86a432182c17264656fc9eece6d29e diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/c7ad3d2fc0e03d92a21e9f22e6ef53357d3a3ccdadf37515f57e917118c303f2 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/c7ad3d2fc0e03d92a21e9f22e6ef53357d3a3ccdadf37515f57e917118c303f2 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/c7ad3d2fc0e03d92a21e9f22e6ef53357d3a3ccdadf37515f57e917118c303f2 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/c7ad3d2fc0e03d92a21e9f22e6ef53357d3a3ccdadf37515f57e917118c303f2 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/c7ff7655b171048d9a1e5fcceb93fc3ceac1e8ad6622e7d74ee9cd5f881f3275 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/c7ff7655b171048d9a1e5fcceb93fc3ceac1e8ad6622e7d74ee9cd5f881f3275 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/c7ff7655b171048d9a1e5fcceb93fc3ceac1e8ad6622e7d74ee9cd5f881f3275 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/c7ff7655b171048d9a1e5fcceb93fc3ceac1e8ad6622e7d74ee9cd5f881f3275 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/cabb568b8eb23c82a0a1efb3bd0c747ea17c8d971765b5656facbf404c363880 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/cabb568b8eb23c82a0a1efb3bd0c747ea17c8d971765b5656facbf404c363880 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/cabb568b8eb23c82a0a1efb3bd0c747ea17c8d971765b5656facbf404c363880 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/cabb568b8eb23c82a0a1efb3bd0c747ea17c8d971765b5656facbf404c363880 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/cb0dd58fbf9ba15a77465843a7fb74ce6f3008e9e40b9e513908c044d2da3b11 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/cb0dd58fbf9ba15a77465843a7fb74ce6f3008e9e40b9e513908c044d2da3b11 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/cb0dd58fbf9ba15a77465843a7fb74ce6f3008e9e40b9e513908c044d2da3b11 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/cb0dd58fbf9ba15a77465843a7fb74ce6f3008e9e40b9e513908c044d2da3b11 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/cd0ea0636ff76c8bfa1b4284d59c89fdc63dbae716bc2736c4a2f1da693050ff b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/cd0ea0636ff76c8bfa1b4284d59c89fdc63dbae716bc2736c4a2f1da693050ff similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/cd0ea0636ff76c8bfa1b4284d59c89fdc63dbae716bc2736c4a2f1da693050ff rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/cd0ea0636ff76c8bfa1b4284d59c89fdc63dbae716bc2736c4a2f1da693050ff diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/ce192a1767f0ac3d549bebad5f6695103f11cfce45543458a5c0749f14c3a89c b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/ce192a1767f0ac3d549bebad5f6695103f11cfce45543458a5c0749f14c3a89c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/ce192a1767f0ac3d549bebad5f6695103f11cfce45543458a5c0749f14c3a89c rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/ce192a1767f0ac3d549bebad5f6695103f11cfce45543458a5c0749f14c3a89c diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/ce244cf144e6c981a515ea198e189fea258b0d8615ed7f118c1f976a7e2d1984 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/ce244cf144e6c981a515ea198e189fea258b0d8615ed7f118c1f976a7e2d1984 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/ce244cf144e6c981a515ea198e189fea258b0d8615ed7f118c1f976a7e2d1984 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/ce244cf144e6c981a515ea198e189fea258b0d8615ed7f118c1f976a7e2d1984 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/d0aeb689e81d7324b710058d7f7c38dce9175fa59648c256a1a07640788e276c b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/d0aeb689e81d7324b710058d7f7c38dce9175fa59648c256a1a07640788e276c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/d0aeb689e81d7324b710058d7f7c38dce9175fa59648c256a1a07640788e276c rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/d0aeb689e81d7324b710058d7f7c38dce9175fa59648c256a1a07640788e276c diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/d36534a9480ffeb8627baebdd4eca4cd41ad70752490793193a231dcd35a30b1 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/d36534a9480ffeb8627baebdd4eca4cd41ad70752490793193a231dcd35a30b1 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/d36534a9480ffeb8627baebdd4eca4cd41ad70752490793193a231dcd35a30b1 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/d36534a9480ffeb8627baebdd4eca4cd41ad70752490793193a231dcd35a30b1 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/d3913151c5f78057d1234bec7ae40cb424fa1a08dd16baae85d4585832340a12 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/d3913151c5f78057d1234bec7ae40cb424fa1a08dd16baae85d4585832340a12 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/d3913151c5f78057d1234bec7ae40cb424fa1a08dd16baae85d4585832340a12 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/d3913151c5f78057d1234bec7ae40cb424fa1a08dd16baae85d4585832340a12 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/d69c190644e87ea6d7b4c7a751d256f8ec3eb81fa2d1663b8def0a51233dafad b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/d69c190644e87ea6d7b4c7a751d256f8ec3eb81fa2d1663b8def0a51233dafad similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/d69c190644e87ea6d7b4c7a751d256f8ec3eb81fa2d1663b8def0a51233dafad rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/d69c190644e87ea6d7b4c7a751d256f8ec3eb81fa2d1663b8def0a51233dafad diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/d806d9debbaa65bdc7e3b42b25443cfc5b345d42a764ff7e310c6abbeca6b3fb b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/d806d9debbaa65bdc7e3b42b25443cfc5b345d42a764ff7e310c6abbeca6b3fb similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/d806d9debbaa65bdc7e3b42b25443cfc5b345d42a764ff7e310c6abbeca6b3fb rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/d806d9debbaa65bdc7e3b42b25443cfc5b345d42a764ff7e310c6abbeca6b3fb diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/daf3f4647ca3391cd3e579f178cdff3b8fd5289cd1d04a3196651fddffc50051 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/daf3f4647ca3391cd3e579f178cdff3b8fd5289cd1d04a3196651fddffc50051 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/daf3f4647ca3391cd3e579f178cdff3b8fd5289cd1d04a3196651fddffc50051 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/daf3f4647ca3391cd3e579f178cdff3b8fd5289cd1d04a3196651fddffc50051 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/dc5432f99201741e3cd6e21103255f3b8e7c21964c99f76a9d12a08be7579b6f b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/dc5432f99201741e3cd6e21103255f3b8e7c21964c99f76a9d12a08be7579b6f similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/dc5432f99201741e3cd6e21103255f3b8e7c21964c99f76a9d12a08be7579b6f rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/dc5432f99201741e3cd6e21103255f3b8e7c21964c99f76a9d12a08be7579b6f diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/dca9a04a0666558e8aa9fba811373d790229f4c838699f719322905235285eea b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/dca9a04a0666558e8aa9fba811373d790229f4c838699f719322905235285eea similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/dca9a04a0666558e8aa9fba811373d790229f4c838699f719322905235285eea rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/dca9a04a0666558e8aa9fba811373d790229f4c838699f719322905235285eea diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/de4505923c15dfcc9e5612c2440f49211e5aa5b243e9f54d99532445b8dad14c b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/de4505923c15dfcc9e5612c2440f49211e5aa5b243e9f54d99532445b8dad14c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/de4505923c15dfcc9e5612c2440f49211e5aa5b243e9f54d99532445b8dad14c rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/de4505923c15dfcc9e5612c2440f49211e5aa5b243e9f54d99532445b8dad14c diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/e1046e5d3a72d7916d4239658377fc41c0df2b060cf5462247d4203760f83428 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/e1046e5d3a72d7916d4239658377fc41c0df2b060cf5462247d4203760f83428 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/e1046e5d3a72d7916d4239658377fc41c0df2b060cf5462247d4203760f83428 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/e1046e5d3a72d7916d4239658377fc41c0df2b060cf5462247d4203760f83428 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/e106d242613268e7ea1d4935efabb7e94faaf330e0c8f9338bfd4b43ce05d6fa b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/e106d242613268e7ea1d4935efabb7e94faaf330e0c8f9338bfd4b43ce05d6fa similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/e106d242613268e7ea1d4935efabb7e94faaf330e0c8f9338bfd4b43ce05d6fa rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/e106d242613268e7ea1d4935efabb7e94faaf330e0c8f9338bfd4b43ce05d6fa diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/e2ef0e2485b35d238b817f208c63dee7e6e38855e1e03e417dbc1885e5edd22f b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/e2ef0e2485b35d238b817f208c63dee7e6e38855e1e03e417dbc1885e5edd22f similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/e2ef0e2485b35d238b817f208c63dee7e6e38855e1e03e417dbc1885e5edd22f rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/e2ef0e2485b35d238b817f208c63dee7e6e38855e1e03e417dbc1885e5edd22f diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/e6a7bc3eccb6359800e4624598bb432fd0e6fc43ad3b31be85d5d96bb98e6370 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/e6a7bc3eccb6359800e4624598bb432fd0e6fc43ad3b31be85d5d96bb98e6370 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/e6a7bc3eccb6359800e4624598bb432fd0e6fc43ad3b31be85d5d96bb98e6370 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/e6a7bc3eccb6359800e4624598bb432fd0e6fc43ad3b31be85d5d96bb98e6370 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/e72bafbf3674258711ad8c9e0359b3929ddf989da0f6e11b76cc0c9ef8185ec0 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/e72bafbf3674258711ad8c9e0359b3929ddf989da0f6e11b76cc0c9ef8185ec0 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/e72bafbf3674258711ad8c9e0359b3929ddf989da0f6e11b76cc0c9ef8185ec0 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/e72bafbf3674258711ad8c9e0359b3929ddf989da0f6e11b76cc0c9ef8185ec0 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/e7ebbb7c0d4e4e75578aace81f374bd2580a78f66ea033871dbfc513ff731cb5 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/e7ebbb7c0d4e4e75578aace81f374bd2580a78f66ea033871dbfc513ff731cb5 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/e7ebbb7c0d4e4e75578aace81f374bd2580a78f66ea033871dbfc513ff731cb5 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/e7ebbb7c0d4e4e75578aace81f374bd2580a78f66ea033871dbfc513ff731cb5 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/e9dd5a15ff2ca881f35ef4a16b20cbf321a372f537bfa928b4eb50ae5b3538eb b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/e9dd5a15ff2ca881f35ef4a16b20cbf321a372f537bfa928b4eb50ae5b3538eb similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/e9dd5a15ff2ca881f35ef4a16b20cbf321a372f537bfa928b4eb50ae5b3538eb rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/e9dd5a15ff2ca881f35ef4a16b20cbf321a372f537bfa928b4eb50ae5b3538eb diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/eb9f063094761bd3e6d4c5941b655d70454d22f034fa91372918d0bb83d1bc9c b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/eb9f063094761bd3e6d4c5941b655d70454d22f034fa91372918d0bb83d1bc9c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/eb9f063094761bd3e6d4c5941b655d70454d22f034fa91372918d0bb83d1bc9c rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/eb9f063094761bd3e6d4c5941b655d70454d22f034fa91372918d0bb83d1bc9c diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/ebf9aa767ed4bb59c98c68393eb52455bd84410545de2a984ca5d5a290a8b666 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/ebf9aa767ed4bb59c98c68393eb52455bd84410545de2a984ca5d5a290a8b666 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/ebf9aa767ed4bb59c98c68393eb52455bd84410545de2a984ca5d5a290a8b666 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/ebf9aa767ed4bb59c98c68393eb52455bd84410545de2a984ca5d5a290a8b666 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/ece915d22a1d06ffaa9091e8c38050bf5bad3e162e551e4046dee7d884c61629 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/ece915d22a1d06ffaa9091e8c38050bf5bad3e162e551e4046dee7d884c61629 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/ece915d22a1d06ffaa9091e8c38050bf5bad3e162e551e4046dee7d884c61629 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/ece915d22a1d06ffaa9091e8c38050bf5bad3e162e551e4046dee7d884c61629 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/ed9496cde6a97226fdc513a36f598384aaf3d4cb88168ff9d8976d0c249430eb b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/ed9496cde6a97226fdc513a36f598384aaf3d4cb88168ff9d8976d0c249430eb similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/ed9496cde6a97226fdc513a36f598384aaf3d4cb88168ff9d8976d0c249430eb rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/ed9496cde6a97226fdc513a36f598384aaf3d4cb88168ff9d8976d0c249430eb diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/ee1821d028959904e2cfb3c6c53a9a563546899ff947f6920846b5ae2a3a1fa8 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/ee1821d028959904e2cfb3c6c53a9a563546899ff947f6920846b5ae2a3a1fa8 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/ee1821d028959904e2cfb3c6c53a9a563546899ff947f6920846b5ae2a3a1fa8 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/ee1821d028959904e2cfb3c6c53a9a563546899ff947f6920846b5ae2a3a1fa8 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/ef4b61c2a28deb6e5fa438f89ac670b58c0ee6935e5db6ad73e3c5c8b2375c66 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/ef4b61c2a28deb6e5fa438f89ac670b58c0ee6935e5db6ad73e3c5c8b2375c66 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/ef4b61c2a28deb6e5fa438f89ac670b58c0ee6935e5db6ad73e3c5c8b2375c66 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/ef4b61c2a28deb6e5fa438f89ac670b58c0ee6935e5db6ad73e3c5c8b2375c66 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/f46040e134268546ba23673326956e69a895ea1e7a3ff1fc8992dccf853b54e1 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/f46040e134268546ba23673326956e69a895ea1e7a3ff1fc8992dccf853b54e1 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/f46040e134268546ba23673326956e69a895ea1e7a3ff1fc8992dccf853b54e1 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/f46040e134268546ba23673326956e69a895ea1e7a3ff1fc8992dccf853b54e1 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/f4681fa03a68e28892e555729b7c536401ac252117ea530094f2e8e6eafa5e73 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/f4681fa03a68e28892e555729b7c536401ac252117ea530094f2e8e6eafa5e73 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/f4681fa03a68e28892e555729b7c536401ac252117ea530094f2e8e6eafa5e73 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/f4681fa03a68e28892e555729b7c536401ac252117ea530094f2e8e6eafa5e73 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/f6247303fd80b563537e1a8f2dc096b0679a9f722bda98d414a418ec762743af b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/f6247303fd80b563537e1a8f2dc096b0679a9f722bda98d414a418ec762743af similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/f6247303fd80b563537e1a8f2dc096b0679a9f722bda98d414a418ec762743af rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/f6247303fd80b563537e1a8f2dc096b0679a9f722bda98d414a418ec762743af diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/f7da908d36b5c6683b15e343c37e79fa43a1b0741634a7738203de0e7c37076b b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/f7da908d36b5c6683b15e343c37e79fa43a1b0741634a7738203de0e7c37076b similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/f7da908d36b5c6683b15e343c37e79fa43a1b0741634a7738203de0e7c37076b rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/f7da908d36b5c6683b15e343c37e79fa43a1b0741634a7738203de0e7c37076b diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/f89847b981fbd9b834b6f2e1392270c65c5f398eab1c1d3335137b4d4ed8edce b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/f89847b981fbd9b834b6f2e1392270c65c5f398eab1c1d3335137b4d4ed8edce similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/f89847b981fbd9b834b6f2e1392270c65c5f398eab1c1d3335137b4d4ed8edce rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/f89847b981fbd9b834b6f2e1392270c65c5f398eab1c1d3335137b4d4ed8edce diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/f8baf4341f0a4113738e87582f86414f69a4659e93a1c43ae668e0f225bfbc06 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/f8baf4341f0a4113738e87582f86414f69a4659e93a1c43ae668e0f225bfbc06 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/f8baf4341f0a4113738e87582f86414f69a4659e93a1c43ae668e0f225bfbc06 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/f8baf4341f0a4113738e87582f86414f69a4659e93a1c43ae668e0f225bfbc06 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/f9dd3d7a25ed9bc2a22081ae520419164e43b0acc52e0106e2d4a78e7d20b4d2 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/f9dd3d7a25ed9bc2a22081ae520419164e43b0acc52e0106e2d4a78e7d20b4d2 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/f9dd3d7a25ed9bc2a22081ae520419164e43b0acc52e0106e2d4a78e7d20b4d2 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/f9dd3d7a25ed9bc2a22081ae520419164e43b0acc52e0106e2d4a78e7d20b4d2 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/f9f7377e834ab9d6bea9781dc34d73061bd6832754986a4d2fa5842087891501 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/f9f7377e834ab9d6bea9781dc34d73061bd6832754986a4d2fa5842087891501 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/f9f7377e834ab9d6bea9781dc34d73061bd6832754986a4d2fa5842087891501 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/f9f7377e834ab9d6bea9781dc34d73061bd6832754986a4d2fa5842087891501 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/faa205db933bfb0ff79babc04aa6275e292594712a45f373d6f2c8f80d5e37e1 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/faa205db933bfb0ff79babc04aa6275e292594712a45f373d6f2c8f80d5e37e1 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/faa205db933bfb0ff79babc04aa6275e292594712a45f373d6f2c8f80d5e37e1 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/faa205db933bfb0ff79babc04aa6275e292594712a45f373d6f2c8f80d5e37e1 diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/faf843ffbdbaf46debeb17f64edfd16951b1595e5deeafa3737e0a07fe1e284c b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/faf843ffbdbaf46debeb17f64edfd16951b1595e5deeafa3737e0a07fe1e284c similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/faf843ffbdbaf46debeb17f64edfd16951b1595e5deeafa3737e0a07fe1e284c rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/faf843ffbdbaf46debeb17f64edfd16951b1595e5deeafa3737e0a07fe1e284c diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/fb42275c1cfe645763056b534b46f4fb51bb581db944690c93cb70155266472e b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/fb42275c1cfe645763056b534b46f4fb51bb581db944690c93cb70155266472e similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/fb42275c1cfe645763056b534b46f4fb51bb581db944690c93cb70155266472e rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/fb42275c1cfe645763056b534b46f4fb51bb581db944690c93cb70155266472e diff --git a/fuzz/tests/testdata/fuzz/FuzzUnknownProto/fbb78f1235211fb3a25453cc069cb907128e8a202696c9b963fd0d3e9d698848 b/tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/fbb78f1235211fb3a25453cc069cb907128e8a202696c9b963fd0d3e9d698848 similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzUnknownProto/fbb78f1235211fb3a25453cc069cb907128e8a202696c9b963fd0d3e9d698848 rename to tests/fuzz/tests/testdata/fuzz/FuzzUnknownProto/fbb78f1235211fb3a25453cc069cb907128e8a202696c9b963fd0d3e9d698848 diff --git a/fuzz/tests/testdata/fuzz/FuzzXBankTypesAddressFromBalancesStore/3a4038d10aa18fdccea61248aa8e0f0520f8ebcc6a9e563bcfa0f0e205bdc35b b/tests/fuzz/tests/testdata/fuzz/FuzzXBankTypesAddressFromBalancesStore/3a4038d10aa18fdccea61248aa8e0f0520f8ebcc6a9e563bcfa0f0e205bdc35b similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzXBankTypesAddressFromBalancesStore/3a4038d10aa18fdccea61248aa8e0f0520f8ebcc6a9e563bcfa0f0e205bdc35b rename to tests/fuzz/tests/testdata/fuzz/FuzzXBankTypesAddressFromBalancesStore/3a4038d10aa18fdccea61248aa8e0f0520f8ebcc6a9e563bcfa0f0e205bdc35b diff --git a/fuzz/tests/testdata/fuzz/FuzzXBankTypesAddressFromBalancesStore/8e6ea662465ec827c48dc4f40931e4c02eb76fd66f97b979132d662b4a610edb b/tests/fuzz/tests/testdata/fuzz/FuzzXBankTypesAddressFromBalancesStore/8e6ea662465ec827c48dc4f40931e4c02eb76fd66f97b979132d662b4a610edb similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzXBankTypesAddressFromBalancesStore/8e6ea662465ec827c48dc4f40931e4c02eb76fd66f97b979132d662b4a610edb rename to tests/fuzz/tests/testdata/fuzz/FuzzXBankTypesAddressFromBalancesStore/8e6ea662465ec827c48dc4f40931e4c02eb76fd66f97b979132d662b4a610edb diff --git a/fuzz/tests/testdata/fuzz/FuzzXBankTypesAddressFromBalancesStore/d40a98862ed393eb712e47a91bcef18e6f24cf368bb4bd248c7a7101ef8e178d b/tests/fuzz/tests/testdata/fuzz/FuzzXBankTypesAddressFromBalancesStore/d40a98862ed393eb712e47a91bcef18e6f24cf368bb4bd248c7a7101ef8e178d similarity index 100% rename from fuzz/tests/testdata/fuzz/FuzzXBankTypesAddressFromBalancesStore/d40a98862ed393eb712e47a91bcef18e6f24cf368bb4bd248c7a7101ef8e178d rename to tests/fuzz/tests/testdata/fuzz/FuzzXBankTypesAddressFromBalancesStore/d40a98862ed393eb712e47a91bcef18e6f24cf368bb4bd248c7a7101ef8e178d diff --git a/fuzz/tests/types_dec_setstring_test.go b/tests/fuzz/tests/types_dec_setstring_test.go similarity index 100% rename from fuzz/tests/types_dec_setstring_test.go rename to tests/fuzz/tests/types_dec_setstring_test.go diff --git a/fuzz/tests/types_parsecoin_test.go b/tests/fuzz/tests/types_parsecoin_test.go similarity index 100% rename from fuzz/tests/types_parsecoin_test.go rename to tests/fuzz/tests/types_parsecoin_test.go diff --git a/fuzz/tests/types_parsedeccoin_test.go b/tests/fuzz/tests/types_parsedeccoin_test.go similarity index 100% rename from fuzz/tests/types_parsedeccoin_test.go rename to tests/fuzz/tests/types_parsedeccoin_test.go diff --git a/fuzz/tests/types_parsetimebytes_test.go b/tests/fuzz/tests/types_parsetimebytes_test.go similarity index 100% rename from fuzz/tests/types_parsetimebytes_test.go rename to tests/fuzz/tests/types_parsetimebytes_test.go diff --git a/fuzz/tests/types_verifyaddressformat_test.go b/tests/fuzz/tests/types_verifyaddressformat_test.go similarity index 100% rename from fuzz/tests/types_verifyaddressformat_test.go rename to tests/fuzz/tests/types_verifyaddressformat_test.go diff --git a/fuzz/tests/unknownproto_test.go b/tests/fuzz/tests/unknownproto_test.go similarity index 100% rename from fuzz/tests/unknownproto_test.go rename to tests/fuzz/tests/unknownproto_test.go diff --git a/tests/go.mod b/tests/go.mod index 44dc4de73c2a..95d8e72c6b68 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -1,208 +1,227 @@ module github.com/cosmos/cosmos-sdk/tests -go 1.20 +go 1.23.0 require ( - cosmossdk.io/api v0.4.2 - cosmossdk.io/core v0.8.0 - cosmossdk.io/depinject v1.0.0-alpha.3 - cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 - cosmossdk.io/log v1.1.0 - cosmossdk.io/math v1.0.1 - cosmossdk.io/simapp v0.0.0-20230309163709-87da587416ba - cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c - cosmossdk.io/x/evidence v0.1.0 - cosmossdk.io/x/feegrant v0.0.0-20230117113717-50e7c4a4ceff - cosmossdk.io/x/nft v0.0.0-20230113085233-fae3332d62fc // indirect - cosmossdk.io/x/tx v0.8.0 - cosmossdk.io/x/upgrade v0.0.0-20230127052425-54c8e1568335 - github.com/cometbft/cometbft v0.38.0-rc1 - github.com/cosmos/cosmos-db v1.0.0 - github.com/cosmos/cosmos-proto v1.0.0-beta.3 + cosmossdk.io/api v0.7.6 + cosmossdk.io/core v0.11.1 + cosmossdk.io/depinject v1.1.0 + cosmossdk.io/errors v1.0.1 + cosmossdk.io/log v1.5.0 + cosmossdk.io/math v1.5.0 + cosmossdk.io/simapp v0.0.0-20230620040119-e078f1a49e8b + cosmossdk.io/store v1.1.1 + cosmossdk.io/x/evidence v0.1.1 + cosmossdk.io/x/feegrant v0.1.1 + cosmossdk.io/x/nft v0.1.1 // indirect + cosmossdk.io/x/tx v0.13.7 + cosmossdk.io/x/upgrade v0.1.4 + github.com/cometbft/cometbft v0.38.17 + github.com/cosmos/cosmos-db v1.1.1 + github.com/cosmos/cosmos-proto v1.0.0-beta.5 // this version is not used as it is always replaced by the latest Cosmos SDK version - github.com/cosmos/cosmos-sdk v0.50.0 - github.com/cosmos/gogoproto v1.4.10 - github.com/golang/mock v1.6.0 - github.com/spf13/cobra v1.7.0 - github.com/stretchr/testify v1.8.4 - google.golang.org/grpc v1.55.0 - google.golang.org/protobuf v1.30.0 - gotest.tools/v3 v3.4.0 - pgregory.net/rapid v0.6.2 + github.com/cosmos/cosmos-sdk v0.50.13 + github.com/cosmos/go-bip39 v1.0.0 + github.com/cosmos/gogoproto v1.7.0 + github.com/spf13/cobra v1.9.1 + github.com/stretchr/testify v1.10.0 + github.com/tendermint/go-amino v0.16.0 + go.uber.org/mock v0.5.0 + google.golang.org/grpc v1.71.0 + google.golang.org/protobuf v1.36.5 + gotest.tools/v3 v3.5.2 + pgregory.net/rapid v1.2.0 ) require ( - cloud.google.com/go v0.110.0 // indirect - cloud.google.com/go/compute v1.19.0 // indirect - cloud.google.com/go/compute/metadata v0.2.3 // indirect - cloud.google.com/go/iam v0.13.0 // indirect - cloud.google.com/go/storage v1.30.0 // indirect - cosmossdk.io/client/v2 v2.0.0-20230309163709-87da587416ba // indirect - cosmossdk.io/collections v0.2.0 // indirect - cosmossdk.io/x/circuit v0.0.0-20230220112800-f69b9ff58fbe // indirect - filippo.io/edwards25519 v1.0.0 // indirect + cel.dev/expr v0.19.1 // indirect + cloud.google.com/go v0.116.0 // indirect + cloud.google.com/go/auth v0.13.0 // indirect + cloud.google.com/go/auth/oauth2adapt v0.2.6 // indirect + cloud.google.com/go/compute/metadata v0.6.0 // indirect + cloud.google.com/go/iam v1.2.2 // indirect + cloud.google.com/go/monitoring v1.21.2 // indirect + cloud.google.com/go/storage v1.49.0 // indirect + cosmossdk.io/client/v2 v2.0.0-beta.5.0.20241121152743-3dad36d9a29e // indirect + cosmossdk.io/collections v0.4.0 // indirect + cosmossdk.io/x/circuit v0.1.1 // indirect + filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect - github.com/DataDog/zstd v1.5.5 // indirect - github.com/armon/go-metrics v0.4.1 // indirect + github.com/DataDog/datadog-go v3.2.0+incompatible // indirect + github.com/DataDog/zstd v1.5.6 // indirect + github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0 // indirect + github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.48.1 // indirect + github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.48.1 // indirect github.com/aws/aws-sdk-go v1.44.224 // 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 - github.com/bits-and-blooms/bitset v1.7.0 // indirect - github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect + github.com/bgentry/speakeasy v0.2.0 // indirect + github.com/bits-and-blooms/bitset v1.22.0 // indirect + github.com/bytedance/sonic v1.13.1 // indirect + github.com/bytedance/sonic/loader v0.2.4 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // indirect - github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chzyer/readline v1.5.1 // indirect + github.com/cloudwego/base64x v0.1.5 // indirect + github.com/cncf/xds/go v0.0.0-20241223141626-cff3c89139a3 // indirect github.com/cockroachdb/apd/v2 v2.0.2 // indirect - github.com/cockroachdb/errors v1.9.1 // indirect + github.com/cockroachdb/apd/v3 v3.2.1 // indirect + github.com/cockroachdb/errors v1.11.3 // indirect + github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20230606202032-d96868fd481e // indirect - github.com/cockroachdb/redact v1.1.4 // indirect - github.com/cometbft/cometbft-db v0.7.0 // indirect + github.com/cockroachdb/pebble v1.1.2 // indirect + github.com/cockroachdb/redact v1.1.5 // indirect + github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect + github.com/cometbft/cometbft-db v0.14.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.0.0-beta.2 // indirect - github.com/cosmos/ics23/go v0.10.0 // indirect - github.com/cosmos/ledger-cosmos-go v0.13.0 // indirect + github.com/cosmos/iavl v1.2.2 // indirect + github.com/cosmos/ics23/go v0.11.0 // indirect + github.com/cosmos/ledger-cosmos-go v0.14.0 // indirect github.com/danieljoos/wincred v1.1.2 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect - github.com/dgraph-io/badger/v2 v2.2007.4 // indirect + github.com/dgraph-io/badger/v4 v4.2.0 // indirect 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/dvsekhvalnov/jose2go v1.5.0 // indirect - github.com/emicklei/dot v1.4.2 // indirect + github.com/dvsekhvalnov/jose2go v1.6.0 // indirect + github.com/emicklei/dot v1.6.2 // indirect + github.com/envoyproxy/go-control-plane/envoy v1.32.4 // indirect + github.com/envoyproxy/protoc-gen-validate v1.2.1 // indirect github.com/fatih/color v1.15.0 // indirect - github.com/felixge/httpsnoop v1.0.2 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/getsentry/sentry-go v0.21.0 // indirect - github.com/go-kit/kit v0.12.0 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect + github.com/getsentry/sentry-go v0.27.0 // indirect + github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect + github.com/go-logr/logr v1.4.2 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/googleapis v1.4.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/glog v1.1.0 // indirect + github.com/golang/glog v1.2.4 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.4 // indirect - github.com/google/btree v1.1.2 // indirect - github.com/google/go-cmp v0.5.9 // indirect + github.com/google/btree v1.1.3 // indirect + github.com/google/flatbuffers v1.12.1 // indirect + github.com/google/go-cmp v0.7.0 // indirect github.com/google/orderedcode v0.0.1 // indirect - github.com/google/s2a-go v0.1.3 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect - github.com/googleapis/gax-go/v2 v2.8.0 // indirect - github.com/gorilla/handlers v1.5.1 // indirect - github.com/gorilla/mux v1.8.0 // indirect - github.com/gorilla/websocket v1.5.0 // indirect + github.com/google/s2a-go v0.1.8 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect + github.com/googleapis/gax-go/v2 v2.14.1 // 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/grpc-ecosystem/grpc-gateway v1.16.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-getter v1.7.1 // indirect + github.com/hashicorp/go-getter v1.7.4 // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/go-plugin v1.4.10 // indirect + github.com/hashicorp/go-metrics v0.5.4 // indirect + github.com/hashicorp/go-plugin v1.5.2 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-version v1.6.0 // indirect - github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect - github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/yamux v0.1.1 // indirect - github.com/hdevalence/ed25519consensus v0.1.0 // indirect - github.com/huandu/skiplist v1.2.0 // indirect - github.com/iancoleman/strcase v0.2.0 // indirect + github.com/hdevalence/ed25519consensus v0.2.0 // indirect + github.com/huandu/skiplist v1.2.1 // 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/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.16.5 // indirect + github.com/klauspost/compress v1.17.11 // indirect + github.com/klauspost/cpuid/v2 v2.2.10 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect - github.com/lib/pq v1.10.7 // indirect - github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.0 // indirect - github.com/magiconair/properties v1.8.7 // indirect + github.com/lib/pq v1.10.9 // indirect + github.com/linxGnu/grocksdb v1.8.14 // 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.19 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/minio/highwayhash v1.0.2 // indirect + github.com/mattn/go-colorable v0.1.14 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/minio/highwayhash v1.0.3 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect - github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect - github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.0.8 // indirect - github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761 // indirect + github.com/pelletier/go-toml/v2 v2.2.3 // indirect + github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.15.1 // indirect - github.com/prometheus/client_model v0.4.0 // indirect - github.com/prometheus/common v0.44.0 // indirect - github.com/prometheus/procfs v0.10.1 // indirect + github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/prometheus/client_golang v1.21.1 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.62.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.10.0 // indirect - github.com/rs/cors v1.8.3 // indirect - github.com/rs/zerolog v1.29.1 // indirect - github.com/sasha-s/go-deadlock v0.3.1 // indirect - github.com/spf13/afero v1.9.5 // indirect - github.com/spf13/cast v1.5.1 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/spf13/pflag v1.0.5 // indirect - github.com/spf13/viper v1.16.0 // indirect - github.com/subosito/gotenv v1.4.2 // indirect + github.com/rogpeppe/go-internal v1.13.1 // indirect + github.com/rs/cors v1.11.1 // indirect + github.com/rs/zerolog v1.33.0 // indirect + github.com/sagikazarmark/locafero v0.7.0 // indirect + github.com/sasha-s/go-deadlock v0.3.5 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.12.0 // indirect + github.com/spf13/cast v1.7.1 // indirect + github.com/spf13/pflag v1.0.6 // indirect + github.com/spf13/viper v1.20.0 // indirect + github.com/subosito/gotenv v1.6.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect - github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect - github.com/tendermint/go-amino v0.16.0 // indirect - github.com/tidwall/btree v1.6.0 // indirect + github.com/tidwall/btree v1.7.0 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ulikunitz/xz v0.5.11 // indirect - github.com/zondax/hid v0.9.1 // indirect - github.com/zondax/ledger-go v0.14.1 // indirect - go.etcd.io/bbolt v1.3.7 // indirect + github.com/zondax/hid v0.9.2 // indirect + github.com/zondax/ledger-go v0.14.3 // indirect + go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 // indirect go.opencensus.io v0.24.0 // indirect - golang.org/x/crypto v0.9.0 // indirect - golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/oauth2 v0.8.0 // indirect - golang.org/x/sync v0.2.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/term v0.8.0 // indirect - golang.org/x/text v0.9.0 // indirect - golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect - google.golang.org/api v0.122.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20230525234025-438c736192d0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect - gopkg.in/ini.v1 v1.67.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect + go.opentelemetry.io/auto/sdk v1.1.0 // indirect + go.opentelemetry.io/contrib/detectors/gcp v1.34.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect + go.opentelemetry.io/otel v1.34.0 // indirect + go.opentelemetry.io/otel/metric v1.34.0 // indirect + go.opentelemetry.io/otel/sdk v1.34.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.34.0 // indirect + go.opentelemetry.io/otel/trace v1.34.0 // indirect + go.uber.org/multierr v1.10.0 // indirect + golang.org/x/arch v0.15.0 // indirect + golang.org/x/crypto v0.36.0 // indirect + golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect + golang.org/x/net v0.35.0 // indirect + golang.org/x/oauth2 v0.25.0 // indirect + golang.org/x/sync v0.12.0 // indirect + golang.org/x/sys v0.31.0 // indirect + golang.org/x/term v0.30.0 // indirect + golang.org/x/text v0.23.0 // indirect + golang.org/x/time v0.8.0 // indirect + google.golang.org/api v0.215.0 // indirect + google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.6 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect ) -// Here are the short-lived replace for tests -// Replace here are pending PRs, or version to be tagged. -// It must be in sync with SimApp temporary replaces -replace ( - // TODO tag all extracted modules after SDK refactor - cosmossdk.io/x/circuit => ../x/circuit - cosmossdk.io/x/evidence => ../x/evidence - cosmossdk.io/x/feegrant => ../x/feegrant - cosmossdk.io/x/nft => ../x/nft - cosmossdk.io/x/tx => ../x/tx - cosmossdk.io/x/upgrade => ../x/upgrade -) +// Here are the short-lived replace from the SimApp +// Replace here are pending PRs, or version to be tagged +// replace ( +// +// ) // Below are the long-lived replace for tests. replace ( + cosmossdk.io/api => ../api // We always want to test against the latest version of the simapp. cosmossdk.io/simapp => ../simapp github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 @@ -210,5 +229,5 @@ replace ( github.com/cosmos/cosmos-sdk => ../. // Fix upstream GHSA-h395-qcrw-5vmq and GHSA-3vp4-m3rf-835h vulnerabilities. // TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 - github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0 + github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.1 ) diff --git a/tests/go.sum b/tests/go.sum index 80a5348dd4b3..952f48d91cd8 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -1,9 +1,10 @@ +cel.dev/expr v0.19.1 h1:NciYrtDRIR0lNCnH1LFJegdjspNx9fI59O7TWcua/W4= +cel.dev/expr v0.19.1/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= @@ -16,7 +17,6 @@ cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOY cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= @@ -32,8 +32,8 @@ cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w9 cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= -cloud.google.com/go v0.110.0 h1:Zc8gqp3+a9/Eyph2KDmcGaPtbKRIoqq4YTlL4NMD0Ys= -cloud.google.com/go v0.110.0/go.mod h1:SJnCLqQ0FCFGSZMUNUf84MV3Aia54kn7pi8st7tMzaY= +cloud.google.com/go v0.116.0 h1:B3fRrSDkLRt5qSHWe40ERJvhvnQwdZiHu0bJOpldweE= +cloud.google.com/go v0.116.0/go.mod h1:cEPSRWPzZEswwdr9BxE6ChEn01dWlTaF05LiC2Xs70U= cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= @@ -48,6 +48,10 @@ cloud.google.com/go/asset v1.8.0/go.mod h1:mUNGKhiqIdbr8X7KNayoYvyc4HbbFO9URsjby cloud.google.com/go/assuredworkloads v1.5.0/go.mod h1:n8HOZ6pff6re5KYfBXcFvSViQjDwxFkAkmUFffJRbbY= cloud.google.com/go/assuredworkloads v1.6.0/go.mod h1:yo2YOk37Yc89Rsd5QMVECvjaMKymF9OP+QXWlKXUkXw= cloud.google.com/go/assuredworkloads v1.7.0/go.mod h1:z/736/oNmtGAyU47reJgGN+KVoYoxeLBoj4XkKYscNI= +cloud.google.com/go/auth v0.13.0 h1:8Fu8TZy167JkW8Tj3q7dIkr2v4cndv41ouecJx0PAHs= +cloud.google.com/go/auth v0.13.0/go.mod h1:COOjD9gwfKNKz+IIduatIhYJQIc0mG3H102r/EMxX6Q= +cloud.google.com/go/auth/oauth2adapt v0.2.6 h1:V6a6XDu2lTwPZWOawrAa9HUK+DB2zfJyTuciBG5hFkU= +cloud.google.com/go/auth/oauth2adapt v0.2.6/go.mod h1:AlmsELtlEBnaNTL7jCj8VQFLy6mbZv0s4Q7NGBeQ5E8= cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0= cloud.google.com/go/automl v1.6.0/go.mod h1:ugf8a6Fx+zP0D59WLhqgTDsQI9w07o64uf/Is3Nh5p8= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= @@ -70,10 +74,8 @@ cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= -cloud.google.com/go/compute v1.19.0 h1:+9zda3WGgW1ZSTlVppLCYFIr48Pa35q1uG2N1itbCEQ= -cloud.google.com/go/compute v1.19.0/go.mod h1:rikpw2y+UMidAe9tISo04EHNOIf42RLYF/q8Bs93scU= -cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= -cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +cloud.google.com/go/compute/metadata v0.6.0 h1:A6hENjEsCDtC1k8byVsgwvVcioamEHvZ4j01OwKxG9I= +cloud.google.com/go/compute/metadata v0.6.0/go.mod h1:FjyFAW1MW0C203CEOMDTu3Dk1FlqW3Rga40jzHL4hfg= cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0= @@ -111,19 +113,24 @@ cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y97 cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= -cloud.google.com/go/iam v0.13.0 h1:+CmB+K0J/33d0zSQ9SlFWUeCCEn5XJA0ZMZ3pHE9u8k= -cloud.google.com/go/iam v0.13.0/go.mod h1:ljOg+rcNfzZ5d6f1nAUJ8ZIxOaZUVoS14bKCtaLZ/D0= +cloud.google.com/go/iam v1.2.2 h1:ozUSofHUGf/F4tCNy/mu9tHLTaxZFLOUiKzjcgWHGIA= +cloud.google.com/go/iam v1.2.2/go.mod h1:0Ys8ccaZHdI1dEUilwzqng/6ps2YB6vRsjIe00/+6JY= cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08= -cloud.google.com/go/longrunning v0.4.1 h1:v+yFJOfKC3yZdY6ZUI933pIYdhyhV8S3NpWrXWmg7jM= +cloud.google.com/go/logging v1.12.0 h1:ex1igYcGFd4S/RZWOCU51StlIEuey5bjqwH9ZYjHibk= +cloud.google.com/go/logging v1.12.0/go.mod h1:wwYBt5HlYP1InnrtYI0wtwttpVU1rifnMT7RejksUAM= +cloud.google.com/go/longrunning v0.6.2 h1:xjDfh1pQcWPEvnfjZmwjKQEcHnpz6lHjfy7Fo0MK+hc= +cloud.google.com/go/longrunning v0.6.2/go.mod h1:k/vIs83RN4bE3YCswdXC5PFfWVILjm3hpEUlSko4PiI= cloud.google.com/go/mediatranslation v0.5.0/go.mod h1:jGPUhGTybqsPQn91pNXw0xVHfuJ3leR1wj37oU3y1f4= cloud.google.com/go/mediatranslation v0.6.0/go.mod h1:hHdBCTYNigsBxshbznuIMFNe5QXEowAuNmmC7h8pu5w= cloud.google.com/go/memcache v1.4.0/go.mod h1:rTOfiGZtJX1AaFUrOgsMHX5kAzaTQ8azHiuDoTPzNsE= cloud.google.com/go/memcache v1.5.0/go.mod h1:dk3fCK7dVo0cUU2c36jKb4VqKPS22BTkf81Xq617aWM= cloud.google.com/go/metastore v1.5.0/go.mod h1:2ZNrDcQwghfdtCwJ33nM0+GrBGlVuh8rakL3vdPY3XY= cloud.google.com/go/metastore v1.6.0/go.mod h1:6cyQTls8CWXzk45G55x57DVQ9gWg7RiH65+YgPsNh9s= +cloud.google.com/go/monitoring v1.21.2 h1:FChwVtClH19E7pJ+e0xUhJPGksctZNVOk2UhMmblmdU= +cloud.google.com/go/monitoring v1.21.2/go.mod h1:hS3pXvaG8KgWTSz+dAdyzPrGUYmi2Q+WFX8g2hqVEZU= cloud.google.com/go/networkconnectivity v1.4.0/go.mod h1:nOl7YL8odKyAOtzNX73/M5/mGZgqqMeryi6UPZTk/rA= cloud.google.com/go/networkconnectivity v1.5.0/go.mod h1:3GzqJx7uhtlM3kln0+x5wyFvuVH1pIBJjhCpjzSt75o= cloud.google.com/go/networksecurity v0.5.0/go.mod h1:xS6fOCoqpVC5zx15Z/MqkfDwH4+m/61A3ODiDV1xmiQ= @@ -171,14 +178,15 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= -cloud.google.com/go/storage v1.30.0 h1:g1yrbxAWOrvg/594228pETWkOi00MLTrOWfh56veU5o= -cloud.google.com/go/storage v1.30.0/go.mod h1:xAVretHSROm1BQX4IIsoVgJqw0LqOyX+I/O2GzRAzdE= +cloud.google.com/go/storage v1.49.0 h1:zenOPBOWHCnojRd9aJZAyQXBYqkJkdQS42dxL55CIMw= +cloud.google.com/go/storage v1.49.0/go.mod h1:k1eHhhpLvrPjVGfo0mOUPEJ4Y2+a/Hv5PiwehZI9qGU= cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= +cloud.google.com/go/trace v1.11.2 h1:4ZmaBdL8Ng/ajrgKqY5jfvzqMXbrDcBsUGXOT9aqTtI= +cloud.google.com/go/trace v1.11.2/go.mod h1:bn7OwXd4pd5rFuAnTrzBuoZ4ax2XQeG3qNgYmfCy0Io= cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= cloud.google.com/go/videointelligence v1.7.0/go.mod h1:k8pI/1wAhjznARtVT9U1llUaFNPh7muw8QyOUpavru4= cloud.google.com/go/vision v1.2.0/go.mod h1:SmNwgObm5DpFBme2xpyOyasvBc1aPdjvMk2bBk0tKD0= @@ -188,53 +196,68 @@ cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xX cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= -cosmossdk.io/api v0.4.2 h1:lQBMl4xINnMnBOR/tQLtjlDnR4exr4e6/SfHR8PILE0= -cosmossdk.io/api v0.4.2/go.mod h1:qrVgOp7DIeAXa+Tt5dDjOC47bZCDrwx8ZHxrmy7STNE= -cosmossdk.io/client/v2 v2.0.0-20230309163709-87da587416ba h1:LuPHCncU2KLMNPItFECs709uo46I9wSu2fAWYVCx+/U= -cosmossdk.io/client/v2 v2.0.0-20230309163709-87da587416ba/go.mod h1:SXdwqO7cN5htalh/lhXWP8V4zKtBrhhcSTU+ytuEtmM= -cosmossdk.io/collections v0.2.0 h1:CgMfLtE16+qox3zBYrGh60i4yKV8SeExLnIdOS2sbQs= -cosmossdk.io/collections v0.2.0/go.mod h1:Oc1FK0vlmxJZsgUn9/o3ldE6zNyWKvobVzaLhWknZJE= -cosmossdk.io/core v0.8.0 h1:LcJnu52E1a8f8E317VfQ1xK/RZe+IuhMNQAjnDLh25M= -cosmossdk.io/core v0.8.0/go.mod h1:LF6VLOv2DdCiaHxYVmr0MZcZpaSM9ZgvyrQSYTeg6D0= -cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw= -cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= -cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 h1:BCRz06fvddw7cKGiEGDiSox3qMsjQ97f92K+PDZDHdc= -cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741/go.mod h1:TB05o6YXkZkzsc+6bZFAV5kZRBtoCU9tUkbeMIqEg0w= -cosmossdk.io/log v1.1.0 h1:v0ogPHYeTzPcBTcPR1A3j1hkei4pZama8kz8LKlCMv0= -cosmossdk.io/log v1.1.0/go.mod h1:6zjroETlcDs+mm62gd8Ig7mZ+N+fVOZS91V17H+M4N4= -cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= -cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= -cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c h1:A+FMPW9GtfcPBDQNtFeDFN27h1SAP6OVjnGgPLlYXmI= -cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c/go.mod h1:RbYGvXCbz8uNBCXrwS9Z8SyydeWi+W5x5MZ33muyzMw= +cosmossdk.io/client/v2 v2.0.0-beta.5.0.20241121152743-3dad36d9a29e h1:NqQEVIjRqSdsAfTI9uDRZ1oU/cQuCoAbUuIkndQM+Bo= +cosmossdk.io/client/v2 v2.0.0-beta.5.0.20241121152743-3dad36d9a29e/go.mod h1:4p0P6o0ro+FizakJUYS9SeM94RNbv0thLmkHRw5o5as= +cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= +cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= +cosmossdk.io/core v0.11.1 h1:h9WfBey7NAiFfIcUhDVNS503I2P2HdZLebJlUIs8LPA= +cosmossdk.io/core v0.11.1/go.mod h1:OJzxcdC+RPrgGF8NJZR2uoQr56tc7gfBKhiKeDO7hH0= +cosmossdk.io/depinject v1.1.0 h1:wLan7LG35VM7Yo6ov0jId3RHWCGRhe8E8bsuARorl5E= +cosmossdk.io/depinject v1.1.0/go.mod h1:kkI5H9jCGHeKeYWXTqYdruogYrEeWvBQCw1Pj4/eCFI= +cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= +cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= +cosmossdk.io/log v1.5.0 h1:dVdzPJW9kMrnAYyMf1duqacoidB9uZIl+7c6z0mnq0g= +cosmossdk.io/log v1.5.0/go.mod h1:Tr46PUJjiUthlwQ+hxYtUtPn4D/oCZXAkYevBeh5+FI= +cosmossdk.io/math v1.5.0 h1:sbOASxee9Zxdjd6OkzogvBZ25/hP929vdcYcBJQbkLc= +cosmossdk.io/math v1.5.0/go.mod h1:AAwwBmUhqtk2nlku174JwSll+/DepUXW3rWIXN5q+Nw= +cosmossdk.io/store v1.1.1 h1:NA3PioJtWDVU7cHHeyvdva5J/ggyLDkyH0hGHl2804Y= +cosmossdk.io/store v1.1.1/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM= +cosmossdk.io/x/circuit v0.1.1 h1:KPJCnLChWrxD4jLwUiuQaf5mFD/1m7Omyo7oooefBVQ= +cosmossdk.io/x/circuit v0.1.1/go.mod h1:B6f/urRuQH8gjt4eLIXfZJucrbreuYrKh5CSjaOxr+Q= +cosmossdk.io/x/evidence v0.1.1 h1:Ks+BLTa3uftFpElLTDp9L76t2b58htjVbSZ86aoK/E4= +cosmossdk.io/x/evidence v0.1.1/go.mod h1:OoDsWlbtuyqS70LY51aX8FBTvguQqvFrt78qL7UzeNc= +cosmossdk.io/x/feegrant v0.1.1 h1:EKFWOeo/pup0yF0svDisWWKAA9Zags6Zd0P3nRvVvw8= +cosmossdk.io/x/feegrant v0.1.1/go.mod h1:2GjVVxX6G2fta8LWj7pC/ytHjryA6MHAJroBWHFNiEQ= +cosmossdk.io/x/nft v0.1.1 h1:pslAVS8P5NkW080+LWOamInjDcq+v2GSCo+BjN9sxZ8= +cosmossdk.io/x/nft v0.1.1/go.mod h1:Kac6F6y2gsKvoxU+fy8uvxRTi4BIhLOor2zgCNQwVgY= +cosmossdk.io/x/tx v0.13.7 h1:8WSk6B/OHJLYjiZeMKhq7DK7lHDMyK0UfDbBMxVmeOI= +cosmossdk.io/x/tx v0.13.7/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w= +cosmossdk.io/x/upgrade v0.1.4 h1:/BWJim24QHoXde8Bc64/2BSEB6W4eTydq0X/2f8+g38= +cosmossdk.io/x/upgrade v0.1.4/go.mod h1:9v0Aj+fs97O+Ztw+tG3/tp5JSlrmT7IcFhAebQHmOPo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= -filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= +filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= +filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= 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-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= -github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= +github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= -github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= -github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= +github.com/DataDog/zstd v1.5.6 h1:LbEglqepa/ipmmQJUDnSsfvA8e8IStVcGaFWDuxvGOY= +github.com/DataDog/zstd v1.5.6/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0 h1:3c8yed4lgqTt+oTQ+JNMDo+F4xprBf+O/il4ZC0nRLw= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0/go.mod h1:obipzmGjfSjam60XLwGfqUkJsfiheAl+TUjG+4yzyPM= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.48.1 h1:UQ0AhxogsIRZDkElkblfnwjc3IaltCm2HUMvezQaL7s= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.48.1/go.mod h1:jyqM3eLpJ3IbIFDTKVz2rF9T/xWGW0rIriGwnz8l9Tk= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.48.1 h1:oTX4vsorBZo/Zdum6OKPA4o7544hm6smoRv1QjpTwGo= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.48.1/go.mod h1:0wEl7vrAD8mehJyohS9HZy+WyEOaQO2mJx86Cvh93kM= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.48.1 h1:8nn+rsCvTq9axyEh382S0PFLBeaFwNsT43IrPWzctRU= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.48.1/go.mod h1:viRWSEhtMZqz1rhwmOVKkWl6SwmVowfL9O2YR5gI2PE= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= -github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= +github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= 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/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= +github.com/adlio/schema v1.3.6 h1:k1/zc2jNfeiZBA5aFTRy37jlBIuCkXCm0XmvpzCKI9I= +github.com/adlio/schema v1.3.6/go.mod h1:qkxwLgPBd1FgLRHYVCmQT/rrBr3JH38J9LjmVzWNudg= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= -github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= -github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -244,9 +267,7 @@ github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kd github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= 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/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= @@ -256,7 +277,6 @@ github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX 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/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -265,18 +285,23 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= -github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bits-and-blooms/bitset v1.7.0 h1:YjAGVd3XmtK9ktAbX8Zg2g2PwLIMjGREZJHlV4j7NEo= -github.com/bits-and-blooms/bitset v1.7.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= -github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= -github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= -github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= -github.com/bufbuild/protocompile v0.5.1 h1:mixz5lJX4Hiz4FpqFREJHIXLfaLBntfaJv1h+/jS+Qg= +github.com/bgentry/speakeasy v0.2.0 h1:tgObeVOf8WAvtuAX6DhJ4xks4CFNwPDZiqzGqIHE51E= +github.com/bgentry/speakeasy v0.2.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bits-and-blooms/bitset v1.22.0 h1:Tquv9S8+SGaS3EhyA+up3FXzmkhxPGjQQCkcs2uw7w4= +github.com/bits-and-blooms/bitset v1.22.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= +github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= +github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/btcutil v1.1.6 h1:zFL2+c3Lb9gEgqKNzowKUPQNb8jV7v5Oaodi/AYFd6c= +github.com/btcsuite/btcd/btcutil v1.1.6/go.mod h1:9dFymx8HpuLqBnsPELrImQeTQfKBQqzqGbbV3jK55aE= +github.com/bufbuild/protocompile v0.14.1 h1:iA73zAf/fyljNjQKwYzUHD6AD4R8KMasmwa/FBatYVw= +github.com/bufbuild/protocompile v0.14.1/go.mod h1:ppVdAIhbr2H8asPk6k4pY7t9zB1OU5DoEw9xY/FUi1c= github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= -github.com/bytedance/sonic v1.8.0 h1:ea0Xadu+sHlu7x5O3gKhRpQ1IKiMrSiHttPF0ybECuA= -github.com/bytedance/sonic v1.8.0/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= +github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= +github.com/bytedance/sonic v1.13.1 h1:Jyd5CIvdFnkOWuKXr+wm4Nyk2h0yAFsr8ucJgEasO3g= +github.com/bytedance/sonic v1.13.1/go.mod h1:o68xyaF9u2gvVBuGHPlUVCy+ZfmNNO5ETf1+KgkJhz4= +github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= +github.com/bytedance/sonic/loader v0.2.4 h1:ZWCw4stuXUsn1/+zQDqeE7JKP+QO47tz7QCNan80NzY= +github.com/bytedance/sonic/loader v0.2.4/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= @@ -284,14 +309,12 @@ github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInq github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -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/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= -github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM= @@ -306,6 +329,9 @@ github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6D github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudwego/base64x v0.1.5 h1:XPciSp1xaq2VCSt6lF0phncD4koWyULpl5bUxbfCyP4= +github.com/cloudwego/base64x v0.1.5/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= +github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -315,77 +341,77 @@ github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20241223141626-cff3c89139a3 h1:boJj011Hh+874zpIySeApCX4GeOjPl9qhRF3QuIZq+Q= +github.com/cncf/xds/go v0.0.0-20241223141626-cff3c89139a3/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8= github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= -github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= +github.com/cockroachdb/apd/v3 v3.2.1 h1:U+8j7t0axsIgvQUqthuNm82HIrYXodOV2iWLWtEaIwg= +github.com/cockroachdb/apd/v3 v3.2.1/go.mod h1:klXJcjp+FffLTHlhIG69tezTDvdP065naDsHzKhYSqc= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= -github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= -github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= +github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce h1:giXvy4KSc/6g/esnpM7Geqxka4WSqI1SZc7sMJFd3y4= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/pebble v0.0.0-20230606202032-d96868fd481e h1:6QuLTQCQZueVNzoYYUuFfaRgBOpj6gIwQA1PZT2rfWM= -github.com/cockroachdb/pebble v0.0.0-20230606202032-d96868fd481e/go.mod h1:TkdVsGYRqtULUppt2RbC+YaKtTHnHoWa2apfFrSKABw= -github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/cockroachdb/redact v1.1.4 h1:Y0XrVI2FAyofNyGveodTN//qdpPtFKcKTeCBsK3AHAQ= -github.com/cockroachdb/redact v1.1.4/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/pebble v1.1.2 h1:CUh2IPtR4swHlEj48Rhfzw6l/d0qA31fItcIszQVIsA= +github.com/cockroachdb/pebble v1.1.2/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= -github.com/cometbft/cometbft v0.38.0-rc1 h1:ph6smlqX82aH+d72KuxDHqu29M7LyusSp/obfGsGX/w= -github.com/cometbft/cometbft v0.38.0-rc1/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= -github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= -github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= +github.com/cometbft/cometbft v0.38.17 h1:FkrQNbAjiFqXydeAO81FUzriL4Bz0abYxN/eOHrQGOk= +github.com/cometbft/cometbft v0.38.17/go.mod h1:5l0SkgeLRXi6bBfQuevXjKqML1jjfJJlvI1Ulp02/o4= +github.com/cometbft/cometbft-db v0.14.1 h1:SxoamPghqICBAIcGpleHbmoPqy+crij/++eZz3DlerQ= +github.com/cometbft/cometbft-db v0.14.1/go.mod h1:KHP1YghilyGV/xjD5DP3+2hyigWx0WTp9X+0Gnx0RxQ= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= +github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= -github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0E= -github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= -github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= -github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= +github.com/cosmos/cosmos-db v1.1.1 h1:FezFSU37AlBC8S98NlSagL76oqBRWq/prTPvFcEJNCM= +github.com/cosmos/cosmos-db v1.1.1/go.mod h1:AghjcIPqdhSLP/2Z0yha5xPH3nLnskz81pBx3tcVSAw= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoKuI= -github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= -github.com/cosmos/iavl v1.0.0-beta.2 h1:XOsIM80Yyml/KifCXEYOy9tWCXwMAbLa91n6pReW07Y= -github.com/cosmos/iavl v1.0.0-beta.2/go.mod h1:EA97dJ07TBktRlG/iGzK6g1eCXNj1q3MGoFYkVzrwHE= -github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= -github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= +github.com/cosmos/iavl v1.2.2 h1:qHhKW3I70w+04g5KdsdVSHRbFLgt3yY3qTMd4Xa4rC8= +github.com/cosmos/iavl v1.2.2/go.mod h1:GiM43q0pB+uG53mLxLDzimxM9l/5N9UuSY3/D0huuVw= +github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= +github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= -github.com/cosmos/ledger-cosmos-go v0.13.0 h1:ex0CvCxToSR7j5WjrghPu2Bu9sSXKikjnVvUryNnx4s= -github.com/cosmos/ledger-cosmos-go v0.13.0/go.mod h1:ZcqYgnfNJ6lAXe4HPtWgarNEY+B74i+2/8MhZw4ziiI= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/cosmos/ledger-cosmos-go v0.14.0 h1:WfCHricT3rPbkPSVKRH+L4fQGKYHuGOK9Edpel8TYpE= +github.com/cosmos/ledger-cosmos-go v0.14.0/go.mod h1:E07xCWSBl3mTGofZ2QnL4cIUzMbbGVyik84QYKbX3RA= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= -github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/decred/dcrd/crypto/blake256 v1.1.0 h1:zPMNGQCm0g4QTY27fOCorQW7EryeQ/U0x++OzVrdms8= +github.com/decred/dcrd/crypto/blake256 v1.1.0/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 h1:NMZiJj8QnKe1LgsbDayM4UoHwbvwDRwnI3hwNaAHRnc= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0/go.mod h1:ZXNYxsqcloTdSy/rNShjYzMhyjf0LaoftYK0p+A3h40= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= -github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= -github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= -github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= -github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= +github.com/dgraph-io/badger/v4 v4.2.0 h1:kJrlajbXXL9DFTNuhhu9yCx7JJa4qpYWxtE8BzuWsEs= +github.com/dgraph-io/badger/v4 v4.2.0/go.mod h1:qfCqhPoWDFJRx1gp5QwwyGo8xk1lbHUxvK9nK0OGAak= github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= @@ -393,20 +419,21 @@ github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUn github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= 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/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= 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/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= -github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= +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/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= -github.com/emicklei/dot v1.4.2 h1:UbK6gX4yvrpHKlxuUQicwoAis4zl8Dzwit9SnbBAXWw= -github.com/emicklei/dot v1.4.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= +github.com/emicklei/dot v1.6.2 h1:08GN+DD79cy/tzN6uLCT84+2Wk9u+wvqP+Hkx/dIR8A= +github.com/emicklei/dot v1.6.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -417,49 +444,51 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.m github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= +github.com/envoyproxy/go-control-plane v0.13.4 h1:zEqyPVyku6IvWCFwux4x9RxkLOMUL+1vC9xUFv5l2/M= +github.com/envoyproxy/go-control-plane v0.13.4/go.mod h1:kDfuBlDVsSj2MjrLEtRWtHlsWIFcGyB2RMO44Dc5GZA= +github.com/envoyproxy/go-control-plane/envoy v1.32.4 h1:jb83lalDRZSpPWW2Z7Mck/8kXZ5CQAFYVjQcdVIr83A= +github.com/envoyproxy/go-control-plane/envoy v1.32.4/go.mod h1:Gzjc5k8JcJswLjAx1Zm+wSYE20UrLtt7JZMWiWQXQEw= +github.com/envoyproxy/go-control-plane/ratelimit v0.1.0 h1:/G9QYbddjL25KvtKTv3an9lx6VBE2cnb8wp1vEGNYGI= +github.com/envoyproxy/go-control-plane/ratelimit v0.1.0/go.mod h1:Wk+tMFAFbCXaJPzVVHnPgRKdUdwW/KdbRt94AzgRee4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= -github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= -github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= -github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= -github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= +github.com/envoyproxy/protoc-gen-validate v1.2.1 h1:DEo3O99U8j4hBFwbJfrz9VtgcDfUKS7KJ7spH3d86P8= +github.com/envoyproxy/protoc-gen-validate v1.2.1/go.mod h1:d/C80l/jxXLdfEIhX1W2TmLfsJ31lvEjwamM4DxlWXU= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= -github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= -github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= -github.com/getsentry/sentry-go v0.21.0 h1:c9l5F1nPF30JIppulk4veau90PK6Smu3abgVtVQWon4= -github.com/getsentry/sentry-go v0.21.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= +github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= +github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= +github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= +github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.9.0 h1:OjyFBKICoexlu99ctXNR2gg+c5pKrKMuyjgARg9qeY8= -github.com/gin-gonic/gin v1.9.0/go.mod h1:W1Me9+hsUSyj3CePGrd1/QrKJMSJ1Tu/0hFEH89961k= -github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= +github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= -github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= -github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= +github.com/go-kit/kit v0.13.0 h1:OoneCcHKHQ03LfBpoQCUfCluwd2Vt3ohz+kvbJneZAU= +github.com/go-kit/kit v0.13.0/go.mod h1:phqEHMMUbyrCFCTgH48JueqrM3md2HcAZ8N3XE4FKDg= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= @@ -468,30 +497,34 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +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-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU= -github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= +github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js= +github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= -github.com/goccy/go-json v0.10.0 h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA= -github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= +github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= -github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= 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= @@ -502,11 +535,9 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV 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/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= -github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= -github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= +github.com/golang/glog v1.2.4 h1:CNNw5U8lSiiBk7druxtSHHTsRWcxKoac6kZKm2peBBc= +github.com/golang/glog v1.2.4/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -541,17 +572,18 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -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/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= +github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= +github.com/google/flatbuffers v1.12.1 h1:MVlul7pQNoDzWRLTw5imwYsl+usrS1TXG2H4jg6ImGw= +github.com/google/flatbuffers v1.12.1/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 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= @@ -566,18 +598,20 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= -github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= +github.com/google/martian/v3 v3.3.3 h1:DIhPTQrbPkgs2yJYdXU/eNACCG5DVQjySNRNlflZ9Fc= +github.com/google/martian/v3 v3.3.3/go.mod h1:iEPrYcgCF7jA9OtScMFQyAlZZ4YXTKEtJ1E6RWzmBA0= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -589,7 +623,6 @@ github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= @@ -597,17 +630,18 @@ github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/s2a-go v0.1.3 h1:FAgZmpLl/SXurPEZyCMPBIiiYeTbqfjlbdnCNTAkbGE= -github.com/google/s2a-go v0.1.3/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= +github.com/google/s2a-go v0.1.8 h1:zZDs9gcbt9ZPLV0ndSyQk6Kacx2g/X+SKYovpnz3SMM= +github.com/google/s2a-go v0.1.8/go.mod h1:6iNWHTpQ+nfNRN5E00MSdfDwVesa8hhS32PhPO8deJA= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= -github.com/googleapis/enterprise-certificate-proxy v0.2.3 h1:yk9/cqRKtT9wXZSsRH9aurXEpJX+U6FLtpYTdC3R06k= -github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= +github.com/googleapis/enterprise-certificate-proxy v0.3.4 h1:XYIDZApgAnrN1c855gTgghdIA6Stxb52D5RnLI1SLyw= +github.com/googleapis/enterprise-certificate-proxy v0.3.4/go.mod h1:YKe7cfqYXjKGpGvmSg28/fFvhNzinZQm8DGnaburhGA= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= @@ -617,22 +651,21 @@ github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99 github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= -github.com/googleapis/gax-go/v2 v2.8.0 h1:UBtEZqx1bjXtOQ5BVTkuYghXrr3N4V123VKJK67vJZc= -github.com/googleapis/gax-go/v2 v2.8.0/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= +github.com/googleapis/gax-go/v2 v2.14.1 h1:hb0FFeiPaQskmvakKu5EbCbpntQn48jyHuvrkurSS/Q= +github.com/googleapis/gax-go/v2 v2.14.1/go.mod h1:Hb/NubMaVM88SrNkvl8X/o8XWwDJEPqouaLeN2IUxoA= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= -github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= -github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= +github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE= +github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= @@ -650,17 +683,19 @@ github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-getter v1.7.1 h1:SWiSWN/42qdpR0MdhaOc/bLR48PLuP1ZQtYLRlM69uY= -github.com/hashicorp/go-getter v1.7.1/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= +github.com/hashicorp/go-getter v1.7.4 h1:3yQjWuxICvSpYwqSayAdKRFcvBl1y/vogCxczWSmix0= +github.com/hashicorp/go-getter v1.7.4/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-metrics v0.5.4 h1:8mmPiIJkTPPEbAiV97IxdAGNdRdaWwVap1BU6elejKY= +github.com/hashicorp/go-metrics v0.5.4/go.mod h1:CG5yz4NZ/AI/aQt9Ucm/vdBnbh7fvmv4lxZ350i+QQI= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-plugin v1.4.10 h1:xUbmA4jC6Dq163/fWcp8P3JuHilrHHMLNRxzGQJ9hNk= -github.com/hashicorp/go-plugin v1.4.10/go.mod h1:6/1TEzT0eQznvI/gV2CM29DLSkAK/e58mUWKVsPaph0= +github.com/hashicorp/go-plugin v1.5.2 h1:aWv8eimFqWlsEiMrYZdPYl+FdHaBJSN4AWwGWfT1G2Y= +github.com/hashicorp/go-plugin v1.5.2/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= @@ -676,42 +711,36 @@ github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= 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/hdevalence/ed25519consensus v0.2.0 h1:37ICyZqdyj0lAZ8P4D1d1id3HqbbG1N3iBb1Tb4rdcU= +github.com/hdevalence/ed25519consensus v0.2.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= 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= -github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw= -github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= +github.com/huandu/skiplist v1.2.1 h1:dTi93MgjwErA/8idWTzIw4Y1kZsMWx35fmI2c8Rij7w= +github.com/huandu/skiplist v1.2.1/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= -github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= -github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= -github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= +github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= -github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= -github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= -github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= -github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= -github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= +github.com/jhump/protoreflect v1.17.0 h1:qOEr613fac2lOuTgWN4tPAtLL7fUSbuJL5X5XumQh94= +github.com/jhump/protoreflect v1.17.0/go.mod h1:h9+vUUL38jiBzck8ck+6G/aeMX8Z4QUY/NiJPwPNi+8= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= 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= @@ -726,6 +755,7 @@ github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= @@ -733,88 +763,65 @@ github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/X github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= 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/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= -github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= -github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= -github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= -github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= 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/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI= -github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/klauspost/cpuid v1.2.1 h1:vJi+O/nMdFt0vqm8NZBI6wzALWdA2X+egi0ogNyrC/w= -github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= +github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= +github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= +github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE= +github.com/klauspost/cpuid/v2 v2.2.10/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0= +github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= 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.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= -github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= -github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= -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= -github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= +github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.0 h1:H4L/LhP7GOMf1j17oQAElHgVlbEje2h14A8Tz9cM2BE= -github.com/linxGnu/grocksdb v1.8.0/go.mod h1:09CeBborffXhXdNpEcOeZrLKEnRtrZFEpFdPNI9Zjjg= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= -github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/magiconair/properties v1.8.9 h1:nWcCbLq1N2v/cpNsy5WvQ37Fb+YElfq20WJ/a8RkpQM= +github.com/magiconair/properties v1.8.9/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.8/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= +github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= +github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= 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-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= -github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= -github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= +github.com/minio/highwayhash v1.0.3 h1:kbnuUMoHYyVl7szWjSxJnxw11k2U709jqFPPmIUyD6Q= +github.com/minio/highwayhash v1.0.3/go.mod h1:GGYsuwP/fPD6Y9hMiXuapVvlIUEhFhMTh0rxU3ik1LQ= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= @@ -826,8 +833,6 @@ github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS4 github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/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= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -835,9 +840,10 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= 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/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -853,8 +859,8 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce h1:/pEpMk55wH0X+E5zedGEMOdLuWmV8P4+4W3+LZaM6kg= -github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a h1:dlRvE5fWabOchtH7znfiFCcOvmIYgOeAS5ifBXBlh9Q= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= @@ -862,7 +868,6 @@ github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DV github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= @@ -874,10 +879,14 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/onsi/gomega v1.26.0 h1:03cDLK28U6hWvCAns6NeydX3zIm4SF3ci69ulidS32Q= +github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= 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-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= -github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= +github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= +github.com/opencontainers/runc v1.1.12 h1:BOIssBaW1La0/qbNZHXOOa71dZfZEQOzW7dqQf3phss= +github.com/opencontainers/runc v1.1.12/go.mod h1:S+lQwSfncpBha7XTy/5lBwWgm5+y5Ma/O44Ekby9FK8= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -887,19 +896,18 @@ github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJ github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= +github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= -github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= +github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= +github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= -github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761 h1:W04oB3d0J01W5jgYRGKsV8LCM6g9EkCvPkZcmFuy0OE= -github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 h1:Dx7Ovyv/SFnMFw3fD4oEoeorXc6saIiQ23LrGLth0Gw= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= @@ -910,9 +918,11 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= @@ -920,103 +930,95 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.15.1 h1:8tXpTmJbyH5lydzFPoxSIJ0J46jdh3tylbvM1xCv0LI= -github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= +github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.21.1 h1:DOvXXTqVzvkIewV/CDPFdejpMCGeMcbGCQ8YOmu+Ibk= +github.com/prometheus/client_golang v1.21.1/go.mod h1:U9NM32ykUErtVBxdvD3zfi+EuFkkaBvMb09mIfe0Zgg= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= -github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= -github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io= +github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= -github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= 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/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= -github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= -github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= -github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.29.1 h1:cO+d60CHkknCbvzEWxP0S9K6KqyTjrCNUy1LdQLCGPc= -github.com/rs/zerolog v1.29.1/go.mod h1:Le6ESbR7hc+DP6Lt1THiV8CQSdkkNrd3R0XbEgp3ZBU= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= +github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/locafero v0.7.0 h1:5MqpDsTGNDhY8sGp0Aowyf0qKsPrhewaLSsFaodPcyo= +github.com/sagikazarmark/locafero v0.7.0/go.mod h1:2za3Cg5rMaTMoG/2Ulr9AwtFaIppKXTRYnozin4aB5k= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -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/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= +github.com/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb2NsU= +github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= -github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= -github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= -github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= +github.com/spf13/afero v1.12.0 h1:UcOPyRBYczmFn6yvphxkn9ZEOY65cpwGKb5mL36mrqs= +github.com/spf13/afero v1.12.0/go.mod h1:ZTlWwG4/ahT8W7T0WQ5uYmjI9duaLQGy3Q2OAl4sk/4= +github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= +github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo= +github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= -github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= +github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= +github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.20.0 h1:zrxIyR3RQIOsarIrgL8+sAvALXul9jeEPa06Y0Ph6vY= +github.com/spf13/viper v1.20.0/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -1027,62 +1029,43 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= -github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +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.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= -github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= +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/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= -github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/ugorji/go/codec v1.2.9 h1:rmenucSohSTiyL09Y+l2OCk+FrMxGMzho2+tjr5ticU= -github.com/ugorji/go/codec v1.2.9/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= +github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= +github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= 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.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= -github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= -github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= -github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= -github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= -github.com/zondax/ledger-go v0.14.1 h1:Pip65OOl4iJ84WTpA4BKChvOufMhhbxED3BaihoZN4c= -github.com/zondax/ledger-go v0.14.1/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2feOQv8K320= +github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= +github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= +github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= +github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ= -go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 h1:qxen9oVGzDdIRP6ejyAJc760RwW4SnVDiTYTzwnXuxo= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5/go.mod h1:eW0HG9/oHQhvRCvb1/pIXW4cOvtDqeQK+XSi3TnwaXY= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= @@ -1095,40 +1078,61 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= +go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= +go.opentelemetry.io/contrib/detectors/gcp v1.34.0 h1:JRxssobiPg23otYU5SbWtQC//snGVIM3Tx6QRzlQBao= +go.opentelemetry.io/contrib/detectors/gcp v1.34.0/go.mod h1:cV4BMFcscUR/ckqLkbfQmF0PRsq8w/lMGzdbCSveBHo= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 h1:r6I7RJCN86bpD/FQwedZ0vSixDpwuWREjW9oRMsmqDc= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0/go.mod h1:B9yO6b04uB80CzjedvewuqDhxJxi11s7/GtiGa8bAjI= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 h1:TT4fX+nBOA/+LUkobKGW1ydGcn+G3vRw9+g5HwCphpk= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0/go.mod h1:L7UH0GbB0p47T4Rri3uHjbpCFYrVrwc1I25QhNPiGK8= +go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY= +go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0 h1:WDdP9acbMYjbKIyJUhTvtzj601sVJOqgWdUxSdR/Ysc= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0/go.mod h1:BLbf7zbNIONBLPwvFnwNHGj4zge8uTCM/UPIVW1Mq2I= +go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ= +go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE= +go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A= +go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU= +go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk= +go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w= +go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k= +go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU= +go.uber.org/mock v0.5.0/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= +go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -golang.org/x/arch v0.0.0-20210923205945-b76863e36670 h1:18EFjUmQOcUvxNYSkA6jO9VAiXCnxFY6NyDX0bHDmkU= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +golang.org/x/arch v0.15.0 h1:QtOrQd0bTUnhNVNndMpLHNWrDmYzZ2KDqSrEymqInZw= +golang.org/x/arch v0.15.0/go.mod h1:JmwW7aLIoRUKgaTzhkiEFxvcEiQGyOg9BMonBJUS7EE= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= -golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= +golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= +golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34= +golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1140,8 +1144,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1168,7 +1172,9 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= +golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= 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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1180,7 +1186,6 @@ golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -1190,7 +1195,6 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1211,7 +1215,6 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= @@ -1219,8 +1222,6 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= @@ -1233,10 +1234,11 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= +golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= 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= @@ -1262,8 +1264,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8= -golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= +golang.org/x/oauth2 v0.25.0 h1:CY4y7XT9v0cRI9oupztF8AgiIu99L/ksR/Xp/6jrZ70= +golang.org/x/oauth2 v0.25.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1278,8 +1280,9 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= -golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw= +golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= 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-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1288,10 +1291,7 @@ golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 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-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1299,9 +1299,7 @@ golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1336,17 +1334,16 @@ golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1357,7 +1354,6 @@ golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/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-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1375,24 +1371,27 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= +golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= 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= -golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= +golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y= +golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g= 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= @@ -1404,26 +1403,26 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= +golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 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= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg= +golang.org/x/time v0.8.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-20180828015842-6cd1fcedba52/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-20181221001348-537d06c36207/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-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -1471,7 +1470,6 @@ golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= @@ -1479,7 +1477,9 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg= +golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= 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= @@ -1487,7 +1487,6 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= @@ -1538,8 +1537,8 @@ google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= -google.golang.org/api v0.122.0 h1:zDobeejm3E7pEG1mNHvdxvjs5XJoCMzyNH+CmwL94Es= -google.golang.org/api v0.122.0/go.mod h1:gcitW0lvnyWjSp9nKxAbdHKIZ6vF4aajGueeslZOyms= +google.golang.org/api v0.215.0 h1:jdYF4qnyczlEz2ReWIsosNLDuzXyvFHJtI5gcr0J7t0= +google.golang.org/api v0.215.0/go.mod h1:fta3CVtuJYOEdugLNWm6WodzOS8KdFckABwN4I40hzY= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1547,9 +1546,7 @@ google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1588,10 +1585,8 @@ google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= @@ -1658,13 +1653,12 @@ google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqw google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20230525234025-438c736192d0 h1:x1vNwUhVOcsYoKyEGCZBH694SBmmBjA2EfauFVEI2+M= -google.golang.org/genproto v0.0.0-20230525234025-438c736192d0/go.mod h1:9ExIQyXL5hZrHzQceCwuSYwZZ5QZBazOcprJ5rgs3lY= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a h1:HiYVD+FGJkTo+9zj1gqz0anapsa1JxjiSrN+BJKyUmE= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a/go.mod h1:ts19tUU+Z0ZShN1y3aPyq2+O3d5FUNNgT6FtOzmrNn8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 h1:ToEetK57OidYuqD4Q5w+vfEnPvPpuTwedCNVohYJfNk= +google.golang.org/genproto v0.0.0-20241118233622-e639e219e697/go.mod h1:JJrvXBWRZaFMxBufik1a4RpFw4HhgVtBBWQeQgUj2cc= +google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a h1:nwKuGPlUAt+aR+pcrkfFRrTU1BVrSmYyYMxYbUIVHr0= +google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a/go.mod h1:3kWAYMk1I75K4vykHtKt2ycnOgpA6974V7bREqbsenU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a h1:51aaUVRocpvUOSQKM6Q7VuoaktNIaMCLuhZB6DKksq4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a/go.mod h1:uRxBH1mhmO8PGhU89cMcHaXKZqO+OfakD8QQO0oYwlQ= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1706,8 +1700,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= +google.golang.org/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg= +google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1724,8 +1718,9 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= +google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1738,10 +1733,6 @@ gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qS 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/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= -gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -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/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= @@ -1756,13 +1747,12 @@ gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 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= -gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= -gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= +gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q= +gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1773,13 +1763,14 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= -pgregory.net/rapid v0.6.2 h1:ErW5sL+UKtfBfUTsWHDCoeB+eZKLKMxrSd1VJY6W4bw= -pgregory.net/rapid v0.6.2/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= +nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= +pgregory.net/rapid v1.2.0 h1:keKAYRcjm+e1F0oAuU5F5+YPAWcyxNNRK2wud503Gnk= +pgregory.net/rapid v1.2.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/tests/integration/auth/client/cli/suite_test.go b/tests/integration/auth/client/cli/suite_test.go index 64a5b6e7ae30..290568b705f5 100644 --- a/tests/integration/auth/client/cli/suite_test.go +++ b/tests/integration/auth/client/cli/suite_test.go @@ -7,12 +7,12 @@ import ( "strings" "testing" - "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" rpcclientmock "github.com/cometbft/cometbft/rpc/client/mock" "github.com/stretchr/testify/suite" "cosmossdk.io/core/address" + "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" @@ -30,7 +30,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth" authcli "github.com/cosmos/cosmos-sdk/x/auth/client/cli" authtestutil "github.com/cosmos/cosmos-sdk/x/auth/client/testutil" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/bank" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" @@ -169,6 +168,65 @@ func (s *CLITestSuite) TestCLISignBatch() { s.Require().EqualError(err, "required flag(s) \"sequence\" not set") } +func (s *CLITestSuite) TestCLISignBatchTotalFees() { + txCfg := s.clientCtx.TxConfig + s.clientCtx.HomeDir = strings.Replace(s.clientCtx.HomeDir, "simd", "simcli", 1) + + testCases := []struct { + name string + args []string + numTransactions int + denom string + }{ + { + "Offline batch-sign one transaction", + []string{"--offline", "--account-number", "1", "--sequence", "1", "--append"}, + 1, + "stake", + }, + { + "Offline batch-sign two transactions", + []string{"--offline", "--account-number", "1", "--sequence", "1", "--append"}, + 2, + "stake", + }, + } + + for _, tc := range testCases { + s.Run(tc.name, func() { + // Create multiple transactions and write them to separate files + sendTokens := sdk.NewCoin(tc.denom, sdk.TokensFromConsensusPower(10, sdk.DefaultPowerReduction)) + expectedBatchedTotalFee := int64(0) + txFiles := make([]string, tc.numTransactions) + for i := 0; i < tc.numTransactions; i++ { + tx, err := s.createBankMsg(s.clientCtx, s.val, + sdk.NewCoins(sendTokens), fmt.Sprintf("--%s=true", flags.FlagGenerateOnly)) + s.Require().NoError(err) + txFile := testutil.WriteToNewTempFile(s.T(), tx.String()) + defer txFile.Close() + txFiles[i] = txFile.Name() + + unsignedTx, err := txCfg.TxJSONDecoder()(tx.Bytes()) + s.Require().NoError(err) + txBuilder, err := txCfg.WrapTxBuilder(unsignedTx) + s.Require().NoError(err) + expectedBatchedTotalFee += txBuilder.GetTx().GetFee().AmountOf(tc.denom).Int64() + } + + // Test batch sign + batchSignArgs := append([]string{fmt.Sprintf("--from=%s", s.val.String())}, append(txFiles, tc.args...)...) + signedTx, err := clitestutil.ExecTestCLICmd(s.clientCtx, authcli.GetSignBatchCommand(), batchSignArgs) + s.Require().NoError(err) + signedFinalTx, err := txCfg.TxJSONDecoder()(signedTx.Bytes()) + s.Require().NoError(err) + txBuilder, err := txCfg.WrapTxBuilder(signedFinalTx) + s.Require().NoError(err) + finalTotalFee := txBuilder.GetTx().GetFee() + s.Require().Equal(expectedBatchedTotalFee, finalTotalFee.AmountOf(tc.denom).Int64()) + }) + } +} + func (s *CLITestSuite) TestCLIQueryTxCmdByHash() { sendTokens := sdk.NewInt64Coin("stake", 10) @@ -818,43 +876,6 @@ func (s *CLITestSuite) TestGetBroadcastCommandWithoutOfflineFlag() { s.Require().Contains(out.String(), "connect: connection refused") } -func (s *CLITestSuite) TestQueryParamsCmd() { - testCases := []struct { - name string - args []string - expectErr bool - }{ - { - "happy case", - []string{fmt.Sprintf("--%s=json", flags.FlagOutput)}, - false, - }, - { - "with specific height", - []string{fmt.Sprintf("--%s=1", flags.FlagHeight), fmt.Sprintf("--%s=json", flags.FlagOutput)}, - false, - }, - } - - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - cmd := authcli.QueryParamsCmd() - clientCtx := s.clientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - s.Require().NotEqual("internal", err.Error()) - } else { - var authParams authtypes.Params - s.Require().NoError(s.clientCtx.Codec.UnmarshalJSON(out.Bytes(), &authParams)) - s.Require().NotNil(authParams.MaxMemoCharacters) - } - }) - } -} - // TestTxWithoutPublicKey makes sure sending a proto tx message without the // public key doesn't cause any error in the RPC layer (broadcast). // See https://github.com/cosmos/cosmos-sdk/issues/7585 for more details. @@ -1242,13 +1263,6 @@ func (s *CLITestSuite) TestAuxToFeeWithTips() { genTxFile := testutil.WriteToNewTempFile(s.T(), string(res.Bytes())) defer genTxFile.Close() - // broadcast the tx - res, err = authtestutil.TxAuxToFeeExec( - s.clientCtx, - genTxFile.Name(), - tc.feePayerArgs..., - ) - switch { case tc.expectErrBroadCast: require.Error(err) @@ -1280,11 +1294,11 @@ func (s *CLITestSuite) TestAuxToFeeWithTips() { } func (s *CLITestSuite) getBalances(clientCtx client.Context, addr sdk.AccAddress, denom string) math.Int { - resp, err := clitestutil.QueryBalancesExec(clientCtx, addr, s.ac) + resp, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/bank/v1beta1/balances/%s/by_denom?denom=%s", s.baseCtx.NodeURI, addr.String(), denom)) s.Require().NoError(err) var balRes banktypes.QueryAllBalancesResponse - err = clientCtx.Codec.UnmarshalJSON(resp.Bytes(), &balRes) + err = clientCtx.Codec.UnmarshalJSON(resp, &balRes) s.Require().NoError(err) startTokens := balRes.Balances.AmountOf(denom) return startTokens diff --git a/tests/integration/bank/keeper/deterministic_test.go b/tests/integration/bank/keeper/deterministic_test.go index 92e7c03cef41..86bce291117c 100644 --- a/tests/integration/bank/keeper/deterministic_test.go +++ b/tests/integration/bank/keeper/deterministic_test.go @@ -7,9 +7,12 @@ import ( "gotest.tools/v3/assert" "pgregory.net/rapid" + "cosmossdk.io/core/appmodule" "cosmossdk.io/log" + "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/testutil/integration" "github.com/cosmos/cosmos-sdk/testutil/testdata" @@ -18,15 +21,14 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation" + _ "github.com/cosmos/cosmos-sdk/x/auth/tx/config" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/bank" "github.com/cosmos/cosmos-sdk/x/bank/keeper" banktestutil "github.com/cosmos/cosmos-sdk/x/bank/testutil" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - - _ "github.com/cosmos/cosmos-sdk/x/auth/tx/config" _ "github.com/cosmos/cosmos-sdk/x/consensus" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" _ "github.com/cosmos/cosmos-sdk/x/params" _ "github.com/cosmos/cosmos-sdk/x/staking" ) @@ -34,7 +36,7 @@ import ( var ( denomRegex = sdk.DefaultCoinDenomRegex() addr1 = sdk.MustAccAddressFromBech32("cosmos139f7kncmglres2nf3h4hc4tade85ekfr8sulz5") - coin1 = sdk.NewCoin("denom", sdk.NewInt(10)) + coin1 = sdk.NewCoin("denom", math.NewInt(10)) metadataAtom = banktypes.Metadata{ Description: "The native staking token of the Cosmos Hub.", DenomUnits: []*banktypes.DenomUnit{ @@ -80,6 +82,7 @@ func initDeterministicFixture(t *testing.T) *deterministicFixture { runtime.NewKVStoreService(keys[authtypes.StoreKey]), authtypes.ProtoBaseAccount, maccPerms, + addresscodec.NewBech32Codec(sdk.Bech32MainPrefix), sdk.Bech32MainPrefix, authority.String(), ) @@ -99,7 +102,10 @@ func initDeterministicFixture(t *testing.T) *deterministicFixture { authModule := auth.NewAppModule(cdc, accountKeeper, authsims.RandomGenesisAccounts, nil) bankModule := bank.NewAppModule(cdc, bankKeeper, accountKeeper, nil) - integrationApp := integration.NewIntegrationApp(newCtx, logger, keys, cdc, authModule, bankModule) + integrationApp := integration.NewIntegrationApp(newCtx, logger, keys, cdc, map[string]appmodule.AppModule{ + authtypes.ModuleName: authModule, + banktypes.ModuleName: bankModule, + }) sdkCtx := sdk.UnwrapSDKContext(integrationApp.Context()) @@ -127,7 +133,7 @@ func fundAccount(f *deterministicFixture, addr sdk.AccAddress, coin ...sdk.Coin) func getCoin(rt *rapid.T) sdk.Coin { return sdk.NewCoin( rapid.StringMatching(denomRegex).Draw(rt, "denom"), - sdk.NewInt(rapid.Int64Min(1).Draw(rt, "amount")), + math.NewInt(rapid.Int64Min(1).Draw(rt, "amount")), ) } @@ -173,8 +179,8 @@ func TestGRPCQueryAllBalances(t *testing.T) { }) coins := sdk.NewCoins( - sdk.NewCoin("stake", sdk.NewInt(10)), - sdk.NewCoin("denom", sdk.NewInt(100)), + sdk.NewCoin("stake", math.NewInt(10)), + sdk.NewCoin("denom", math.NewInt(100)), ) fundAccount(f, addr1, coins...) @@ -196,7 +202,7 @@ func TestGRPCQuerySpendableBalances(t *testing.T) { for _, denom := range denoms { coin := sdk.NewCoin( denom, - sdk.NewInt(rapid.Int64Min(1).Draw(rt, "amount")), + math.NewInt(rapid.Int64Min(1).Draw(rt, "amount")), ) // NewCoins sorts the denoms @@ -211,8 +217,8 @@ func TestGRPCQuerySpendableBalances(t *testing.T) { }) coins := sdk.NewCoins( - sdk.NewCoin("stake", sdk.NewInt(10)), - sdk.NewCoin("denom", sdk.NewInt(100)), + sdk.NewCoin("stake", math.NewInt(10)), + sdk.NewCoin("denom", math.NewInt(100)), ) err := banktestutil.FundAccount(f.ctx, f.bankKeeper, addr1, coins) @@ -237,7 +243,7 @@ func TestGRPCQueryTotalSupply(t *testing.T) { for i := 0; i < numCoins; i++ { coin := sdk.NewCoin( rapid.StringMatching(denomRegex).Draw(rt, "denom"), - sdk.NewInt(rapid.Int64Min(1).Draw(rt, "amount")), + math.NewInt(rapid.Int64Min(1).Draw(rt, "amount")), ) coins = coins.Add(coin) @@ -257,8 +263,8 @@ func TestGRPCQueryTotalSupply(t *testing.T) { f = initDeterministicFixture(t) // reset coins := sdk.NewCoins( - sdk.NewCoin("foo", sdk.NewInt(10)), - sdk.NewCoin("bar", sdk.NewInt(100)), + sdk.NewCoin("foo", math.NewInt(10)), + sdk.NewCoin("bar", math.NewInt(100)), ) assert.NilError(t, f.bankKeeper.MintCoins(f.ctx, minttypes.ModuleName, coins)) @@ -274,7 +280,7 @@ func TestGRPCQueryTotalSupplyOf(t *testing.T) { rapid.Check(t, func(rt *rapid.T) { coin := sdk.NewCoin( rapid.StringMatching(denomRegex).Draw(rt, "denom"), - sdk.NewInt(rapid.Int64Min(1).Draw(rt, "amount")), + math.NewInt(rapid.Int64Min(1).Draw(rt, "amount")), ) assert.NilError(t, f.bankKeeper.MintCoins(f.ctx, minttypes.ModuleName, sdk.NewCoins(coin))) @@ -283,7 +289,7 @@ func TestGRPCQueryTotalSupplyOf(t *testing.T) { testdata.DeterministicIterations(f.ctx, t, req, f.queryClient.SupplyOf, 0, true) }) - coin := sdk.NewCoin("bar", sdk.NewInt(100)) + coin := sdk.NewCoin("bar", math.NewInt(100)) assert.NilError(t, f.bankKeeper.MintCoins(f.ctx, minttypes.ModuleName, sdk.NewCoins(coin))) req := &banktypes.QuerySupplyOfRequest{Denom: coin.GetDenom()} @@ -476,7 +482,7 @@ func TestGRPCDenomOwners(t *testing.T) { coin := sdk.NewCoin( denom, - sdk.NewInt(rapid.Int64Min(1).Draw(rt, "amount")), + math.NewInt(rapid.Int64Min(1).Draw(rt, "amount")), ) err := banktestutil.FundAccount(f.ctx, f.bankKeeper, addr, sdk.NewCoins(coin)) diff --git a/tests/integration/distribution/keeper/grpc_query_test.go b/tests/integration/distribution/keeper/grpc_query_test.go index 61799034ac6e..a12dedfd2d3a 100644 --- a/tests/integration/distribution/keeper/grpc_query_test.go +++ b/tests/integration/distribution/keeper/grpc_query_test.go @@ -4,9 +4,10 @@ import ( "fmt" "testing" - "cosmossdk.io/math" "gotest.tools/v3/assert" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" "github.com/cosmos/cosmos-sdk/x/distribution/types" @@ -45,7 +46,7 @@ func TestGRPCParams(t *testing.T) { name: "valid request", malleate: func() { params = types.Params{ - CommunityTax: sdk.NewDecWithPrec(3, 1), + CommunityTax: math.LegacyNewDecWithPrec(3, 1), BaseProposerReward: math.LegacyZeroDec(), BonusProposerReward: math.LegacyZeroDec(), WithdrawAddrEnabled: true, @@ -96,8 +97,8 @@ func TestGRPCValidatorOutstandingRewards(t *testing.T) { initialStake := int64(10) tstaking := stakingtestutil.NewHelper(t, f.sdkCtx, f.stakingKeeper) - tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), math.LegacyNewDec(0)) - tstaking.CreateValidator(f.valAddr, valConsPk0, sdk.NewInt(initialStake), true) + tstaking.Commission = stakingtypes.NewCommissionRates(math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDec(0)) + tstaking.CreateValidator(f.valAddr, valConsPk0, math.NewInt(initialStake), true) // set outstanding rewards err := f.distrKeeper.SetValidatorOutstandingRewards(f.sdkCtx, f.valAddr, types.ValidatorOutstandingRewards{Rewards: valCommission}) @@ -168,8 +169,8 @@ func TestGRPCValidatorCommission(t *testing.T) { initialStake := int64(10) tstaking := stakingtestutil.NewHelper(t, f.sdkCtx, f.stakingKeeper) - tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), math.LegacyNewDec(0)) - tstaking.CreateValidator(f.valAddr, valConsPk0, sdk.NewInt(initialStake), true) + tstaking.Commission = stakingtypes.NewCommissionRates(math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDec(0)) + tstaking.CreateValidator(f.valAddr, valConsPk0, math.NewInt(initialStake), true) commission := sdk.DecCoins{sdk.DecCoin{Denom: "token1", Amount: math.LegacyNewDec(4)}, {Denom: "token2", Amount: math.LegacyNewDec(2)}} assert.NilError(t, f.distrKeeper.SetValidatorAccumulatedCommission(f.sdkCtx, f.valAddr, types.ValidatorAccumulatedCommission{Commission: commission})) @@ -227,10 +228,10 @@ func TestGRPCValidatorSlashes(t *testing.T) { valAddr2 := sdk.ValAddress(addr2) slashes := []types.ValidatorSlashEvent{ - types.NewValidatorSlashEvent(3, sdk.NewDecWithPrec(5, 1)), - types.NewValidatorSlashEvent(5, sdk.NewDecWithPrec(5, 1)), - types.NewValidatorSlashEvent(7, sdk.NewDecWithPrec(5, 1)), - types.NewValidatorSlashEvent(9, sdk.NewDecWithPrec(5, 1)), + types.NewValidatorSlashEvent(3, math.LegacyNewDecWithPrec(5, 1)), + types.NewValidatorSlashEvent(5, math.LegacyNewDecWithPrec(5, 1)), + types.NewValidatorSlashEvent(7, math.LegacyNewDecWithPrec(5, 1)), + types.NewValidatorSlashEvent(9, math.LegacyNewDecWithPrec(5, 1)), } for i, slash := range slashes { @@ -498,8 +499,8 @@ func TestGRPCDelegationRewards(t *testing.T) { initialStake := int64(10) tstaking := stakingtestutil.NewHelper(t, f.sdkCtx, f.stakingKeeper) - tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), math.LegacyNewDec(0)) - tstaking.CreateValidator(f.valAddr, valConsPk0, sdk.NewInt(initialStake), true) + tstaking.Commission = stakingtypes.NewCommissionRates(math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDec(0)) + tstaking.CreateValidator(f.valAddr, valConsPk0, math.NewInt(initialStake), true) val, found := f.stakingKeeper.GetValidator(f.sdkCtx, f.valAddr) assert.Assert(t, found) @@ -507,14 +508,16 @@ func TestGRPCDelegationRewards(t *testing.T) { // setup delegation delTokens := sdk.TokensFromConsensusPower(2, sdk.DefaultPowerReduction) validator, issuedShares := val.AddTokensFromDel(delTokens) - delegation := stakingtypes.NewDelegation(delAddr, f.valAddr, issuedShares) - f.stakingKeeper.SetDelegation(f.sdkCtx, delegation) - assert.NilError(t, f.distrKeeper.SetDelegatorStartingInfo(f.sdkCtx, validator.GetOperator(), delAddr, types.NewDelegatorStartingInfo(2, math.LegacyNewDec(initialStake), 20))) + delegation := stakingtypes.NewDelegation(delAddr.String(), f.valAddr.String(), issuedShares) + assert.NilError(t, f.stakingKeeper.SetDelegation(f.sdkCtx, delegation)) + valBz, err := f.stakingKeeper.ValidatorAddressCodec().StringToBytes(validator.GetOperator()) + assert.NilError(t, err) + assert.NilError(t, f.distrKeeper.SetDelegatorStartingInfo(f.sdkCtx, valBz, delAddr, types.NewDelegatorStartingInfo(2, math.LegacyNewDec(initialStake), 20))) // setup validator rewards decCoins := sdk.DecCoins{sdk.NewDecCoinFromDec(sdk.DefaultBondDenom, math.LegacyOneDec())} historicalRewards := types.NewValidatorHistoricalRewards(decCoins, 2) - assert.NilError(t, f.distrKeeper.SetValidatorHistoricalRewards(f.sdkCtx, validator.GetOperator(), 2, historicalRewards)) + assert.NilError(t, f.distrKeeper.SetValidatorHistoricalRewards(f.sdkCtx, valBz, 2, historicalRewards)) // setup current rewards and outstanding rewards currentRewards := types.NewValidatorCurrentRewards(decCoins, 3) assert.NilError(t, f.distrKeeper.SetValidatorCurrentRewards(f.sdkCtx, f.valAddr, currentRewards)) diff --git a/tests/integration/distribution/keeper/msg_server_test.go b/tests/integration/distribution/keeper/msg_server_test.go index b13c708263c6..fbb883da63bc 100644 --- a/tests/integration/distribution/keeper/msg_server_test.go +++ b/tests/integration/distribution/keeper/msg_server_test.go @@ -4,16 +4,18 @@ import ( "fmt" "testing" - "cosmossdk.io/log" - "cosmossdk.io/math" - storetypes "cosmossdk.io/store/types" - "github.com/stretchr/testify/require" - cmtabcitypes "github.com/cometbft/cometbft/abci/types" "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/stretchr/testify/require" "gotest.tools/v3/assert" + "cosmossdk.io/core/appmodule" + "cosmossdk.io/log" + "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/codec" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/testutil/integration" sdk "github.com/cosmos/cosmos-sdk/types" @@ -79,6 +81,7 @@ func initFixture(t testing.TB) *fixture { runtime.NewKVStoreService(keys[authtypes.StoreKey]), authtypes.ProtoBaseAccount, maccPerms, + addresscodec.NewBech32Codec(sdk.Bech32MainPrefix), sdk.Bech32MainPrefix, authority.String(), ) @@ -95,7 +98,7 @@ func initFixture(t testing.TB) *fixture { log.NewNopLogger(), ) - stakingKeeper := stakingkeeper.NewKeeper(cdc, keys[stakingtypes.StoreKey], accountKeeper, bankKeeper, authority.String()) + stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), accountKeeper, bankKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr)) distrKeeper := distrkeeper.NewKeeper( cdc, runtime.NewKVStoreService(keys[distrtypes.StoreKey]), accountKeeper, bankKeeper, stakingKeeper, distrtypes.ModuleName, authority.String(), @@ -121,7 +124,12 @@ func initFixture(t testing.TB) *fixture { }, }) - integrationApp := integration.NewIntegrationApp(ctx, logger, keys, cdc, authModule, bankModule, stakingModule, distrModule) + integrationApp := integration.NewIntegrationApp(ctx, logger, keys, cdc, map[string]appmodule.AppModule{ + authtypes.ModuleName: authModule, + banktypes.ModuleName: bankModule, + stakingtypes.ModuleName: stakingModule, + distrtypes.ModuleName: distrModule, + }) sdkCtx := sdk.UnwrapSDKContext(integrationApp.Context()) @@ -164,14 +172,14 @@ func TestMsgWithdrawDelegatorReward(t *testing.T) { } // setup staking validator - validator, err := stakingtypes.NewValidator(f.valAddr, PKS[0], stakingtypes.Description{}) + validator, err := stakingtypes.NewValidator(f.valAddr.String(), PKS[0], stakingtypes.Description{}) assert.NilError(t, err) commission := stakingtypes.NewCommission(math.LegacyZeroDec(), math.LegacyOneDec(), math.LegacyOneDec()) validator, err = validator.SetInitialCommission(commission) assert.NilError(t, err) validator.DelegatorShares = math.LegacyNewDec(100) - validator.Tokens = sdk.NewInt(1000000) - f.stakingKeeper.SetValidator(f.sdkCtx, validator) + validator.Tokens = math.NewInt(1000000) + assert.NilError(t, f.stakingKeeper.SetValidator(f.sdkCtx, validator)) // set module account coins initTokens := f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, int64(1000)) @@ -186,14 +194,16 @@ func TestMsgWithdrawDelegatorReward(t *testing.T) { // setup delegation delTokens := sdk.TokensFromConsensusPower(2, sdk.DefaultPowerReduction) validator, issuedShares := validator.AddTokensFromDel(delTokens) - delegation := stakingtypes.NewDelegation(delAddr, validator.GetOperator(), issuedShares) - f.stakingKeeper.SetDelegation(f.sdkCtx, delegation) - err = f.distrKeeper.SetDelegatorStartingInfo(f.sdkCtx, validator.GetOperator(), delAddr, distrtypes.NewDelegatorStartingInfo(2, math.LegacyOneDec(), 20)) + + valBz, err := f.stakingKeeper.ValidatorAddressCodec().StringToBytes(validator.GetOperator()) require.NoError(t, err) + delegation := stakingtypes.NewDelegation(delAddr.String(), validator.GetOperator(), issuedShares) + require.NoError(t, f.stakingKeeper.SetDelegation(f.sdkCtx, delegation)) + require.NoError(t, f.distrKeeper.SetDelegatorStartingInfo(f.sdkCtx, valBz, delAddr, distrtypes.NewDelegatorStartingInfo(2, math.LegacyOneDec(), 20))) // setup validator rewards decCoins := sdk.DecCoins{sdk.NewDecCoinFromDec(sdk.DefaultBondDenom, math.LegacyOneDec())} historicalRewards := distrtypes.NewValidatorHistoricalRewards(decCoins, 2) - err = f.distrKeeper.SetValidatorHistoricalRewards(f.sdkCtx, validator.GetOperator(), 2, historicalRewards) + err = f.distrKeeper.SetValidatorHistoricalRewards(f.sdkCtx, valBz, 2, historicalRewards) require.NoError(t, err) // setup current rewards and outstanding rewards currentRewards := distrtypes.NewValidatorCurrentRewards(decCoins, 3) @@ -244,7 +254,7 @@ func TestMsgWithdrawDelegatorReward(t *testing.T) { ValidatorAddress: f.valAddr.String(), }, expErr: true, - expErrMsg: "no delegation distribution info", + expErrMsg: "no delegation for (address, validator) tuple", }, { name: "validator with no delegations", @@ -253,7 +263,7 @@ func TestMsgWithdrawDelegatorReward(t *testing.T) { ValidatorAddress: sdk.ValAddress(sdk.AccAddress(PKS[2].Address())).String(), }, expErr: true, - expErrMsg: "no validator distribution info", + expErrMsg: "validator does not exist", }, { name: "valid msg", @@ -266,8 +276,8 @@ func TestMsgWithdrawDelegatorReward(t *testing.T) { } height := f.app.LastBlockHeight() - _, err = f.distrKeeper.GetPreviousProposerConsAddr(f.sdkCtx) - assert.Error(t, err, "previous proposer not set") + proposerAddr, _ := f.distrKeeper.GetPreviousProposerConsAddr(f.sdkCtx) + assert.Equal(t, proposerAddr.Empty(), true) for _, tc := range testCases { tc := tc @@ -465,7 +475,7 @@ func TestMsgWithdrawValidatorCommission(t *testing.T) { // send funds to val addr err = f.bankKeeper.SendCoinsFromModuleToAccount(f.sdkCtx, distrtypes.ModuleName, sdk.AccAddress(f.valAddr), sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, initTokens))) require.NoError(t, err) - coins := sdk.NewCoins(sdk.NewCoin("mytoken", sdk.NewInt(2)), sdk.NewCoin("stake", sdk.NewInt(2))) + coins := sdk.NewCoins(sdk.NewCoin("mytoken", math.NewInt(2)), sdk.NewCoin("stake", math.NewInt(2))) err = f.bankKeeper.MintCoins(f.sdkCtx, distrtypes.ModuleName, coins) require.NoError(t, err) @@ -536,7 +546,7 @@ func TestMsgWithdrawValidatorCommission(t *testing.T) { // check balance increase balance = f.bankKeeper.GetAllBalances(f.sdkCtx, sdk.AccAddress(f.valAddr)) assert.DeepEqual(t, sdk.NewCoins( - sdk.NewCoin("mytoken", sdk.NewInt(1)), + sdk.NewCoin("mytoken", math.NewInt(1)), sdk.NewCoin("stake", expTokens.AddRaw(1)), ), balance) @@ -583,7 +593,7 @@ func TestMsgFundCommunityPool(t *testing.T) { { name: "no depositor address", msg: &distrtypes.MsgFundCommunityPool{ - Amount: sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(100))), + Amount: sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(100))), Depositor: emptyDelAddr.String(), }, expErr: true, @@ -601,7 +611,7 @@ func TestMsgFundCommunityPool(t *testing.T) { { name: "depositor address with no funds", msg: &distrtypes.MsgFundCommunityPool{ - Amount: sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(100))), + Amount: sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(100))), Depositor: addr2.String(), }, expErr: true, @@ -610,7 +620,7 @@ func TestMsgFundCommunityPool(t *testing.T) { { name: "valid message", msg: &distrtypes.MsgFundCommunityPool{ - Amount: sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(100))), + Amount: sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(100))), Depositor: addr.String(), }, expErr: false, @@ -650,7 +660,7 @@ func TestMsgUpdateParams(t *testing.T) { f := initFixture(t) // default params - communityTax := sdk.NewDecWithPrec(2, 2) // 2% + communityTax := math.LegacyNewDecWithPrec(2, 2) // 2% withdrawAddrEnabled := true testCases := []struct { @@ -664,7 +674,7 @@ func TestMsgUpdateParams(t *testing.T) { msg: &distrtypes.MsgUpdateParams{ Authority: "invalid", Params: distrtypes.Params{ - CommunityTax: sdk.NewDecWithPrec(2, 0), + CommunityTax: math.LegacyNewDecWithPrec(2, 0), WithdrawAddrEnabled: withdrawAddrEnabled, BaseProposerReward: math.LegacyZeroDec(), BonusProposerReward: math.LegacyZeroDec(), @@ -673,33 +683,47 @@ func TestMsgUpdateParams(t *testing.T) { expErr: true, expErrMsg: "invalid authority", }, + { + name: "community tax is nil", + msg: &distrtypes.MsgUpdateParams{ + Authority: f.distrKeeper.GetAuthority(), + Params: distrtypes.Params{ + CommunityTax: math.LegacyDec{}, + WithdrawAddrEnabled: withdrawAddrEnabled, + BaseProposerReward: math.LegacyZeroDec(), + BonusProposerReward: math.LegacyZeroDec(), + }, + }, + expErr: true, + expErrMsg: "community tax must be not nil", + }, { name: "community tax > 1", msg: &distrtypes.MsgUpdateParams{ Authority: f.distrKeeper.GetAuthority(), Params: distrtypes.Params{ - CommunityTax: sdk.NewDecWithPrec(2, 0), + CommunityTax: math.LegacyNewDecWithPrec(2, 0), WithdrawAddrEnabled: withdrawAddrEnabled, BaseProposerReward: math.LegacyZeroDec(), BonusProposerReward: math.LegacyZeroDec(), }, }, expErr: true, - expErrMsg: "community tax should be non-negative and less than one", + expErrMsg: "community tax too large: 2.000000000000000000", }, { name: "negative community tax", msg: &distrtypes.MsgUpdateParams{ Authority: f.distrKeeper.GetAuthority(), Params: distrtypes.Params{ - CommunityTax: sdk.NewDecWithPrec(-2, 1), + CommunityTax: math.LegacyNewDecWithPrec(-2, 1), WithdrawAddrEnabled: withdrawAddrEnabled, BaseProposerReward: math.LegacyZeroDec(), BonusProposerReward: math.LegacyZeroDec(), }, }, expErr: true, - expErrMsg: "community tax should be non-negative and less than one", + expErrMsg: "community tax must be positive: -0.200000000000000000", }, { name: "base proposer reward set", @@ -707,7 +731,7 @@ func TestMsgUpdateParams(t *testing.T) { Authority: f.distrKeeper.GetAuthority(), Params: distrtypes.Params{ CommunityTax: communityTax, - BaseProposerReward: sdk.NewDecWithPrec(1, 2), + BaseProposerReward: math.LegacyNewDecWithPrec(1, 2), BonusProposerReward: math.LegacyZeroDec(), WithdrawAddrEnabled: withdrawAddrEnabled, }, @@ -722,7 +746,7 @@ func TestMsgUpdateParams(t *testing.T) { Params: distrtypes.Params{ CommunityTax: communityTax, BaseProposerReward: math.LegacyZeroDec(), - BonusProposerReward: sdk.NewDecWithPrec(1, 2), + BonusProposerReward: math.LegacyNewDecWithPrec(1, 2), WithdrawAddrEnabled: withdrawAddrEnabled, }, }, @@ -798,7 +822,7 @@ func TestMsgCommunityPoolSpend(t *testing.T) { msg: &distrtypes.MsgCommunityPoolSpend{ Authority: "invalid", Recipient: recipient.String(), - Amount: sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(100))), + Amount: sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(100))), }, expErr: true, expErrMsg: "invalid authority", @@ -808,7 +832,7 @@ func TestMsgCommunityPoolSpend(t *testing.T) { msg: &distrtypes.MsgCommunityPoolSpend{ Authority: f.distrKeeper.GetAuthority(), Recipient: "invalid", - Amount: sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(100))), + Amount: sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(100))), }, expErr: true, expErrMsg: "decoding bech32 failed", @@ -818,7 +842,7 @@ func TestMsgCommunityPoolSpend(t *testing.T) { msg: &distrtypes.MsgCommunityPoolSpend{ Authority: f.distrKeeper.GetAuthority(), Recipient: recipient.String(), - Amount: sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(100))), + Amount: sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(100))), }, expErr: false, }, @@ -880,13 +904,16 @@ func TestMsgDepositValidatorRewardsPool(t *testing.T) { err = f.bankKeeper.SendCoinsFromModuleToAccount(f.sdkCtx, distrtypes.ModuleName, addr, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, tokens))) require.NoError(t, err) tstaking := stakingtestutil.NewHelper(t, f.sdkCtx, f.stakingKeeper) - tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), math.LegacyNewDec(0)) - tstaking.CreateValidator(valAddr1, valConsPk0, sdk.NewInt(100), true) + tstaking.Commission = stakingtypes.NewCommissionRates(math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDec(0)) + tstaking.CreateValidator(valAddr1, valConsPk0, math.NewInt(100), true) // mint a non-staking token and send to an account amt := sdk.NewCoins(sdk.NewInt64Coin("foo", 500)) - f.bankKeeper.MintCoins(f.sdkCtx, distrtypes.ModuleName, amt) - f.bankKeeper.SendCoinsFromModuleToAccount(f.sdkCtx, distrtypes.ModuleName, addr, amt) + require.NoError(t, f.bankKeeper.MintCoins(f.sdkCtx, distrtypes.ModuleName, amt)) + require.NoError(t, f.bankKeeper.SendCoinsFromModuleToAccount(f.sdkCtx, distrtypes.ModuleName, addr, amt)) + + bondDenom, err := f.stakingKeeper.BondDenom(f.sdkCtx) + require.NoError(t, err) testCases := []struct { name string @@ -899,7 +926,7 @@ func TestMsgDepositValidatorRewardsPool(t *testing.T) { msg: &distrtypes.MsgDepositValidatorRewardsPool{ Depositor: addr.String(), ValidatorAddress: valAddr1.String(), - Amount: sdk.NewCoins(sdk.NewCoin(f.stakingKeeper.BondDenom(f.sdkCtx), sdk.NewInt(100))), + Amount: sdk.NewCoins(sdk.NewCoin(bondDenom, math.NewInt(100))), }, }, { @@ -915,7 +942,7 @@ func TestMsgDepositValidatorRewardsPool(t *testing.T) { msg: &distrtypes.MsgDepositValidatorRewardsPool{ Depositor: addr.String(), ValidatorAddress: sdk.ValAddress([]byte("addr1_______________")).String(), - Amount: sdk.NewCoins(sdk.NewCoin(f.stakingKeeper.BondDenom(f.sdkCtx), sdk.NewInt(100))), + Amount: sdk.NewCoins(sdk.NewCoin(bondDenom, math.NewInt(100))), }, expErr: true, expErrMsg: "validator does not exist", @@ -948,7 +975,7 @@ func TestMsgDepositValidatorRewardsPool(t *testing.T) { outstandingRewards, _ := f.distrKeeper.GetValidatorOutstandingRewards(f.sdkCtx, val) for _, c := range tc.msg.Amount { x := outstandingRewards.Rewards.AmountOf(c.Denom) - assert.DeepEqual(t, x, sdk.NewDecFromInt(c.Amount)) + assert.DeepEqual(t, x, math.LegacyNewDecFromInt(c.Amount)) } } diff --git a/tests/integration/distribution/module_test.go b/tests/integration/distribution/module_test.go index 974ad21d2832..8da05004b1b2 100644 --- a/tests/integration/distribution/module_test.go +++ b/tests/integration/distribution/module_test.go @@ -3,9 +3,10 @@ package distribution_test import ( "testing" + "gotest.tools/v3/assert" + "cosmossdk.io/depinject" "cosmossdk.io/log" - "gotest.tools/v3/assert" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" diff --git a/tests/integration/evidence/keeper/infraction_test.go b/tests/integration/evidence/keeper/infraction_test.go index 13816e90ad8d..fc72d14c6052 100644 --- a/tests/integration/evidence/keeper/infraction_test.go +++ b/tests/integration/evidence/keeper/infraction_test.go @@ -7,6 +7,11 @@ import ( "testing" "time" + abci "github.com/cometbft/cometbft/abci/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + "gotest.tools/v3/assert" + + "cosmossdk.io/core/appmodule" "cosmossdk.io/core/comet" "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" @@ -14,12 +19,9 @@ import ( "cosmossdk.io/x/evidence/exported" "cosmossdk.io/x/evidence/keeper" evidencetypes "cosmossdk.io/x/evidence/types" - abci "github.com/cometbft/cometbft/abci/types" - cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" - "gotest.tools/v3/assert" "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/codec/address" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/runtime" @@ -36,7 +38,6 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/cosmos/cosmos-sdk/x/slashing" slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" "github.com/cosmos/cosmos-sdk/x/slashing/testutil" @@ -79,7 +80,7 @@ type fixture struct { func initFixture(t testing.TB) *fixture { keys := storetypes.NewKVStoreKeys( - authtypes.StoreKey, banktypes.StoreKey, paramtypes.StoreKey, consensusparamtypes.StoreKey, evidencetypes.StoreKey, stakingtypes.StoreKey, slashingtypes.StoreKey, + authtypes.StoreKey, banktypes.StoreKey, consensusparamtypes.StoreKey, evidencetypes.StoreKey, stakingtypes.StoreKey, slashingtypes.StoreKey, ) cdc := moduletestutil.MakeTestEncodingConfig(auth.AppModuleBasic{}, evidence.AppModuleBasic{}).Codec @@ -101,6 +102,7 @@ func initFixture(t testing.TB) *fixture { runtime.NewKVStoreService(keys[authtypes.StoreKey]), authtypes.ProtoBaseAccount, maccPerms, + addresscodec.NewBech32Codec(sdk.Bech32MainPrefix), sdk.Bech32MainPrefix, authority.String(), ) @@ -117,11 +119,11 @@ func initFixture(t testing.TB) *fixture { log.NewNopLogger(), ) - stakingKeeper := stakingkeeper.NewKeeper(cdc, keys[stakingtypes.StoreKey], accountKeeper, bankKeeper, authority.String()) + stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), accountKeeper, bankKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr)) slashingKeeper := slashingkeeper.NewKeeper(cdc, codec.NewLegacyAmino(), runtime.NewKVStoreService(keys[slashingtypes.StoreKey]), stakingKeeper, authority.String()) - evidenceKeeper := keeper.NewKeeper(cdc, runtime.NewKVStoreService(keys[evidencetypes.StoreKey]), stakingKeeper, slashingKeeper, address.NewBech32Codec("cosmos"), runtime.ProvideCometInfoService()) + evidenceKeeper := keeper.NewKeeper(cdc, runtime.NewKVStoreService(keys[evidencetypes.StoreKey]), stakingKeeper, slashingKeeper, addresscodec.NewBech32Codec("cosmos"), runtime.ProvideCometInfoService()) router := evidencetypes.NewRouter() router = router.AddRoute(evidencetypes.RouteEquivocation, testEquivocationHandler(evidenceKeeper)) evidenceKeeper.SetRouter(router) @@ -132,7 +134,13 @@ func initFixture(t testing.TB) *fixture { slashingModule := slashing.NewAppModule(cdc, slashingKeeper, accountKeeper, bankKeeper, stakingKeeper, nil, cdc.InterfaceRegistry()) evidenceModule := evidence.NewAppModule(*evidenceKeeper) - integrationApp := integration.NewIntegrationApp(newCtx, logger, keys, cdc, authModule, bankModule, stakingModule, slashingModule, evidenceModule) + integrationApp := integration.NewIntegrationApp(newCtx, logger, keys, cdc, map[string]appmodule.AppModule{ + authtypes.ModuleName: authModule, + banktypes.ModuleName: bankModule, + stakingtypes.ModuleName: stakingModule, + slashingtypes.ModuleName: slashingModule, + evidencetypes.ModuleName: evidenceModule, + }) sdkCtx := sdk.UnwrapSDKContext(integrationApp.Context()) @@ -164,35 +172,40 @@ func TestHandleDoubleSign(t *testing.T) { populateValidators(t, f) power := int64(100) - stakingParams := f.stakingKeeper.GetParams(ctx) - operatorAddr, val := valAddresses[0], pubkeys[0] + stakingParams, err := f.stakingKeeper.GetParams(ctx) + assert.NilError(t, err) + operatorAddr, valpubkey := valAddresses[0], pubkeys[0] tstaking := stakingtestutil.NewHelper(t, ctx, f.stakingKeeper) - selfDelegation := tstaking.CreateValidatorWithValPower(operatorAddr, val, power, true) + selfDelegation := tstaking.CreateValidatorWithValPower(operatorAddr, valpubkey, power, true) // execute end-blocker and verify validator attributes - _, err := f.stakingKeeper.EndBlocker(f.sdkCtx) + _, err = f.stakingKeeper.EndBlocker(f.sdkCtx) assert.NilError(t, err) assert.DeepEqual(t, f.bankKeeper.GetAllBalances(ctx, sdk.AccAddress(operatorAddr)).String(), sdk.NewCoins(sdk.NewCoin(stakingParams.BondDenom, initAmt.Sub(selfDelegation))).String(), ) - assert.DeepEqual(t, selfDelegation, f.stakingKeeper.Validator(ctx, operatorAddr).GetBondedTokens()) + val, err := f.stakingKeeper.Validator(ctx, operatorAddr) + assert.NilError(t, err) + assert.DeepEqual(t, selfDelegation, val.GetBondedTokens()) - assert.NilError(t, f.slashingKeeper.AddPubkey(f.sdkCtx, val)) + assert.NilError(t, f.slashingKeeper.AddPubkey(f.sdkCtx, valpubkey)) - info := slashingtypes.NewValidatorSigningInfo(sdk.ConsAddress(val.Address()), f.sdkCtx.BlockHeight(), int64(0), time.Unix(0, 0), false, int64(0)) - f.slashingKeeper.SetValidatorSigningInfo(f.sdkCtx, sdk.ConsAddress(val.Address()), info) + info := slashingtypes.NewValidatorSigningInfo(sdk.ConsAddress(valpubkey.Address()), f.sdkCtx.BlockHeight(), int64(0), time.Unix(0, 0), false, int64(0)) + f.slashingKeeper.SetValidatorSigningInfo(f.sdkCtx, sdk.ConsAddress(valpubkey.Address()), info) // handle a signature to set signing info - f.slashingKeeper.HandleValidatorSignature(ctx, val.Address(), selfDelegation.Int64(), comet.BlockIDFlagCommit) + f.slashingKeeper.HandleValidatorSignature(ctx, valpubkey.Address(), selfDelegation.Int64(), comet.BlockIDFlagCommit) // double sign less than max age - oldTokens := f.stakingKeeper.Validator(ctx, operatorAddr).GetTokens() + val, err = f.stakingKeeper.Validator(ctx, operatorAddr) + assert.NilError(t, err) + oldTokens := val.GetTokens() nci := NewCometInfo(abci.RequestFinalizeBlock{ Misbehavior: []abci.Misbehavior{{ - Validator: abci.Validator{Address: val.Address(), Power: power}, + Validator: abci.Validator{Address: valpubkey.Address(), Power: power}, Type: abci.MisbehaviorType_DUPLICATE_VOTE, Time: time.Now().UTC(), Height: 1, @@ -203,18 +216,22 @@ func TestHandleDoubleSign(t *testing.T) { assert.NilError(t, f.evidenceKeeper.BeginBlocker(ctx.WithCometInfo(nci))) // should be jailed and tombstoned - assert.Assert(t, f.stakingKeeper.Validator(ctx, operatorAddr).IsJailed()) - assert.Assert(t, f.slashingKeeper.IsTombstoned(ctx, sdk.ConsAddress(val.Address()))) + val, err = f.stakingKeeper.Validator(ctx, operatorAddr) + assert.NilError(t, err) + assert.Assert(t, val.IsJailed()) + assert.Assert(t, f.slashingKeeper.IsTombstoned(ctx, sdk.ConsAddress(valpubkey.Address()))) // tokens should be decreased - newTokens := f.stakingKeeper.Validator(ctx, operatorAddr).GetTokens() + newTokens := val.GetTokens() assert.Assert(t, newTokens.LT(oldTokens)) // submit duplicate evidence assert.NilError(t, f.evidenceKeeper.BeginBlocker(ctx)) // tokens should be the same (capped slash) - assert.Assert(t, f.stakingKeeper.Validator(ctx, operatorAddr).GetTokens().Equal(newTokens)) + val, err = f.stakingKeeper.Validator(ctx, operatorAddr) + assert.NilError(t, err) + assert.Assert(t, val.GetTokens().Equal(newTokens)) // jump to past the unbonding period ctx = ctx.WithBlockTime(time.Unix(1, 0).Add(stakingParams.UnbondingTime)) @@ -247,25 +264,28 @@ func TestHandleDoubleSign_TooOld(t *testing.T) { populateValidators(t, f) power := int64(100) - stakingParams := f.stakingKeeper.GetParams(ctx) - operatorAddr, val := valAddresses[0], pubkeys[0] + stakingParams, err := f.stakingKeeper.GetParams(ctx) + assert.NilError(t, err) + operatorAddr, valpubkey := valAddresses[0], pubkeys[0] tstaking := stakingtestutil.NewHelper(t, ctx, f.stakingKeeper) - amt := tstaking.CreateValidatorWithValPower(operatorAddr, val, power, true) + amt := tstaking.CreateValidatorWithValPower(operatorAddr, valpubkey, power, true) // execute end-blocker and verify validator attributes - _, err := f.stakingKeeper.EndBlocker(f.sdkCtx) + _, err = f.stakingKeeper.EndBlocker(f.sdkCtx) assert.NilError(t, err) assert.DeepEqual(t, f.bankKeeper.GetAllBalances(ctx, sdk.AccAddress(operatorAddr)), sdk.NewCoins(sdk.NewCoin(stakingParams.BondDenom, initAmt.Sub(amt))), ) - assert.DeepEqual(t, amt, f.stakingKeeper.Validator(ctx, operatorAddr).GetBondedTokens()) + val, err := f.stakingKeeper.Validator(ctx, operatorAddr) + assert.NilError(t, err) + assert.DeepEqual(t, amt, val.GetBondedTokens()) nci := NewCometInfo(abci.RequestFinalizeBlock{ Misbehavior: []abci.Misbehavior{{ - Validator: abci.Validator{Address: val.Address(), Power: power}, + Validator: abci.Validator{Address: valpubkey.Address(), Power: power}, Type: abci.MisbehaviorType_DUPLICATE_VOTE, Time: ctx.BlockTime(), Height: 0, @@ -282,8 +302,10 @@ func TestHandleDoubleSign_TooOld(t *testing.T) { assert.NilError(t, f.evidenceKeeper.BeginBlocker(ctx)) - assert.Assert(t, f.stakingKeeper.Validator(ctx, operatorAddr).IsJailed() == false) - assert.Assert(t, f.slashingKeeper.IsTombstoned(ctx, sdk.ConsAddress(val.Address())) == false) + val, err = f.stakingKeeper.Validator(ctx, operatorAddr) + assert.NilError(t, err) + assert.Assert(t, val.IsJailed() == false) + assert.Assert(t, f.slashingKeeper.IsTombstoned(ctx, sdk.ConsAddress(valpubkey.Address())) == false) } func populateValidators(t assert.TestingT, f *fixture) { diff --git a/tests/integration/gov/common_test.go b/tests/integration/gov/common_test.go index c730fdc90ef3..3ade7cde3cae 100644 --- a/tests/integration/gov/common_test.go +++ b/tests/integration/gov/common_test.go @@ -3,9 +3,10 @@ package gov_test import ( "testing" - "cosmossdk.io/math" "gotest.tools/v3/assert" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/gov/types" diff --git a/tests/integration/gov/genesis_test.go b/tests/integration/gov/genesis_test.go index bcd8963420f3..ecf82c02f842 100644 --- a/tests/integration/gov/genesis_test.go +++ b/tests/integration/gov/genesis_test.go @@ -4,9 +4,8 @@ import ( "encoding/json" "testing" - dbm "github.com/cosmos/cosmos-db" - abci "github.com/cometbft/cometbft/abci/types" + dbm "github.com/cosmos/cosmos-db" "gotest.tools/v3/assert" "cosmossdk.io/depinject" diff --git a/tests/integration/gov/keeper/common_test.go b/tests/integration/gov/keeper/common_test.go index db294d5c33cd..9e1bca0b4532 100644 --- a/tests/integration/gov/keeper/common_test.go +++ b/tests/integration/gov/keeper/common_test.go @@ -5,6 +5,8 @@ import ( "gotest.tools/v3/assert" + "cosmossdk.io/math" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -34,15 +36,15 @@ func getTestProposal() []sdk.Msg { } func createValidators(t *testing.T, f *fixture, powers []int64) ([]sdk.AccAddress, []sdk.ValAddress) { - addrs := simtestutil.AddTestAddrsIncremental(f.bankKeeper, f.stakingKeeper, f.ctx, 5, sdk.NewInt(30000000)) + addrs := simtestutil.AddTestAddrsIncremental(f.bankKeeper, f.stakingKeeper, f.ctx, 5, math.NewInt(30000000)) valAddrs := simtestutil.ConvertAddrsToValAddrs(addrs) pks := simtestutil.CreateTestPubKeys(5) - val1, err := stakingtypes.NewValidator(valAddrs[0], pks[0], stakingtypes.Description{}) + val1, err := stakingtypes.NewValidator(valAddrs[0].String(), pks[0], stakingtypes.Description{}) assert.NilError(t, err) - val2, err := stakingtypes.NewValidator(valAddrs[1], pks[1], stakingtypes.Description{}) + val2, err := stakingtypes.NewValidator(valAddrs[1].String(), pks[1], stakingtypes.Description{}) assert.NilError(t, err) - val3, err := stakingtypes.NewValidator(valAddrs[2], pks[2], stakingtypes.Description{}) + val3, err := stakingtypes.NewValidator(valAddrs[2].String(), pks[2], stakingtypes.Description{}) assert.NilError(t, err) f.stakingKeeper.SetValidator(f.ctx, val1) diff --git a/tests/integration/gov/keeper/grpc_query_test.go b/tests/integration/gov/keeper/grpc_query_test.go index e8793b8cc3a7..87ff8868300c 100644 --- a/tests/integration/gov/keeper/grpc_query_test.go +++ b/tests/integration/gov/keeper/grpc_query_test.go @@ -5,10 +5,10 @@ import ( "fmt" "testing" - "cosmossdk.io/math" "gotest.tools/v3/assert" - sdk "github.com/cosmos/cosmos-sdk/types" + "cosmossdk.io/math" + v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) @@ -89,7 +89,7 @@ func TestGRPCQueryTally(t *testing.T) { expRes = &v1.QueryTallyResultResponse{ Tally: &v1.TallyResult{ - YesCount: sdk.NewInt(3 * 5 * 1000000).String(), + YesCount: math.NewInt(3 * 5 * 1000000).String(), NoCount: "0", AbstainCount: "0", NoWithVetoCount: "0", @@ -211,10 +211,10 @@ func TestLegacyGRPCQueryTally(t *testing.T) { expRes = &v1beta1.QueryTallyResultResponse{ Tally: v1beta1.TallyResult{ - Yes: sdk.NewInt(3 * 5 * 1000000), - No: sdk.NewInt(0), - Abstain: sdk.NewInt(0), - NoWithVeto: sdk.NewInt(0), + Yes: math.NewInt(3 * 5 * 1000000), + No: math.NewInt(0), + Abstain: math.NewInt(0), + NoWithVeto: math.NewInt(0), }, } }, diff --git a/tests/integration/gov/keeper/keeper_test.go b/tests/integration/gov/keeper/keeper_test.go index 0a4455b93d35..4e385e8f0d70 100644 --- a/tests/integration/gov/keeper/keeper_test.go +++ b/tests/integration/gov/keeper/keeper_test.go @@ -3,12 +3,15 @@ package keeper_test import ( "testing" - "cosmossdk.io/log" - storetypes "cosmossdk.io/store/types" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "gotest.tools/v3/assert" + "cosmossdk.io/core/appmodule" + "cosmossdk.io/log" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/baseapp" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/testutil/integration" sdk "github.com/cosmos/cosmos-sdk/types" @@ -71,6 +74,7 @@ func initFixture(t testing.TB) *fixture { runtime.NewKVStoreService(keys[authtypes.StoreKey]), authtypes.ProtoBaseAccount, maccPerms, + addresscodec.NewBech32Codec(sdk.Bech32MainPrefix), sdk.Bech32MainPrefix, authority.String(), ) @@ -87,7 +91,7 @@ func initFixture(t testing.TB) *fixture { log.NewNopLogger(), ) - stakingKeeper := stakingkeeper.NewKeeper(cdc, keys[stakingtypes.StoreKey], accountKeeper, bankKeeper, authority.String()) + stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), accountKeeper, bankKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr)) // set default staking params stakingKeeper.SetParams(newCtx, stakingtypes.DefaultParams()) @@ -126,7 +130,13 @@ func initFixture(t testing.TB) *fixture { distrModule := distribution.NewAppModule(cdc, distrKeeper, accountKeeper, bankKeeper, stakingKeeper, nil) govModule := gov.NewAppModule(cdc, govKeeper, accountKeeper, bankKeeper, nil) - integrationApp := integration.NewIntegrationApp(newCtx, logger, keys, cdc, authModule, bankModule, stakingModule, distrModule, govModule) + integrationApp := integration.NewIntegrationApp(newCtx, logger, keys, cdc, map[string]appmodule.AppModule{ + authtypes.ModuleName: authModule, + banktypes.ModuleName: bankModule, + distrtypes.ModuleName: distrModule, + stakingtypes.ModuleName: stakingModule, + types.ModuleName: govModule, + }) sdkCtx := sdk.UnwrapSDKContext(integrationApp.Context()) diff --git a/tests/integration/gov/keeper/tally_test.go b/tests/integration/gov/keeper/tally_test.go index ad705b7c9a14..8f77b5db182e 100644 --- a/tests/integration/gov/keeper/tally_test.go +++ b/tests/integration/gov/keeper/tally_test.go @@ -5,6 +5,8 @@ import ( "gotest.tools/v3/assert" + "cosmossdk.io/math" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" @@ -44,7 +46,7 @@ func TestTallyNoQuorum(t *testing.T) { createValidators(t, f, []int64{2, 5, 0}) - addrs := simtestutil.AddTestAddrsIncremental(f.bankKeeper, f.stakingKeeper, ctx, 1, sdk.NewInt(10000000)) + addrs := simtestutil.AddTestAddrsIncremental(f.bankKeeper, f.stakingKeeper, ctx, 1, math.NewInt(10000000)) tp := TestProposal proposal, err := f.govKeeper.SubmitProposal(ctx, tp, "", "test", "description", addrs[0], false) @@ -451,7 +453,7 @@ func TestTallyJailedValidator(t *testing.T) { consAddr, err := val2.GetConsAddr() assert.NilError(t, err) - f.stakingKeeper.Jail(ctx, sdk.ConsAddress(consAddr.Bytes())) + f.stakingKeeper.Jail(ctx, sdk.ConsAddress(consAddr)) tp := TestProposal proposal, err := f.govKeeper.SubmitProposal(ctx, tp, "", "test", "description", addrs[0], false) diff --git a/tests/integration/gov/module_test.go b/tests/integration/gov/module_test.go index f4a99c0b44ad..7853a51da6d3 100644 --- a/tests/integration/gov/module_test.go +++ b/tests/integration/gov/module_test.go @@ -3,9 +3,10 @@ package gov_test import ( "testing" + "gotest.tools/v3/assert" + "cosmossdk.io/depinject" "cosmossdk.io/log" - "gotest.tools/v3/assert" "github.com/cosmos/cosmos-sdk/testutil/configurator" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" diff --git a/tests/integration/rapidgen/rapidgen.go b/tests/integration/rapidgen/rapidgen.go index 607ebaed253b..ec37e51dddcd 100644 --- a/tests/integration/rapidgen/rapidgen.go +++ b/tests/integration/rapidgen/rapidgen.go @@ -11,7 +11,6 @@ import ( "google.golang.org/protobuf/reflect/protoregistry" "pgregory.net/rapid" - "cosmossdk.io/api/amino" authapi "cosmossdk.io/api/cosmos/auth/v1beta1" authzapi "cosmossdk.io/api/cosmos/authz/v1beta1" bankapi "cosmossdk.io/api/cosmos/bank/v1beta1" @@ -34,6 +33,7 @@ import ( evidencetypes "cosmossdk.io/x/evidence/types" feegranttypes "cosmossdk.io/x/feegrant" upgradetypes "cosmossdk.io/x/upgrade/types" + "github.com/cosmos/cosmos-sdk/crypto/keys/multisig" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" @@ -76,22 +76,18 @@ func WithDecisionPolicy(opts rapidproto.GeneratorOptions) rapidproto.GeneratorOp func GeneratorFieldMapper(t *rapid.T, field protoreflect.FieldDescriptor, name string) (protoreflect.Value, bool) { opts := field.Options() - switch { - case proto.HasExtension(opts, cosmos_proto.E_Scalar): + if proto.HasExtension(opts, cosmos_proto.E_Scalar) { scalar := proto.GetExtension(opts, cosmos_proto.E_Scalar).(string) switch scalar { case "cosmos.Int": i32 := rapid.Int32().Draw(t, name) return protoreflect.ValueOfString(fmt.Sprintf("%d", i32)), true case "cosmos.Dec": - return protoreflect.ValueOfString(""), true - } - case field.Kind() == protoreflect.BytesKind: - if proto.HasExtension(opts, amino.E_Encoding) { - encoding := proto.GetExtension(opts, amino.E_Encoding).(string) - if encoding == "cosmos_dec_bytes" { + if field.Kind() == protoreflect.BytesKind { return protoreflect.ValueOfBytes([]byte{}), true } + + return protoreflect.ValueOfString(""), true } } @@ -133,9 +129,9 @@ var ( GenType(&disttypes.MsgWithdrawDelegatorReward{}, &distapi.MsgWithdrawDelegatorReward{}, GenOpts), GenType(&disttypes.MsgWithdrawValidatorCommission{}, &distapi.MsgWithdrawValidatorCommission{}, GenOpts), GenType(&disttypes.MsgSetWithdrawAddress{}, &distapi.MsgSetWithdrawAddress{}, GenOpts), - GenType(&disttypes.MsgFundCommunityPool{}, &distapi.MsgFundCommunityPool{}, GenOpts), + GenType(&disttypes.MsgFundCommunityPool{}, &distapi.MsgFundCommunityPool{}, GenOpts), // nolint:staticcheck // testing legacy code path GenType(&disttypes.MsgUpdateParams{}, &distapi.MsgUpdateParams{}, GenOpts.WithDisallowNil()), - GenType(&disttypes.MsgCommunityPoolSpend{}, &distapi.MsgCommunityPoolSpend{}, GenOpts), + GenType(&disttypes.MsgCommunityPoolSpend{}, &distapi.MsgCommunityPoolSpend{}, GenOpts), // nolint:staticcheck // testing legacy code path GenType(&disttypes.MsgDepositValidatorRewardsPool{}, &distapi.MsgDepositValidatorRewardsPool{}, GenOpts), // evidence @@ -235,7 +231,6 @@ var ( NonsignableTypes = []GeneratedType{ GenType(&authtypes.Params{}, &authapi.Params{}, GenOpts), GenType(&authtypes.BaseAccount{}, &authapi.BaseAccount{}, GenOpts.WithAnyTypes(&ed25519.PubKey{})), - GenType(&authtypes.ModuleAccount{}, &authapi.ModuleAccount{}, GenOpts.WithAnyTypes(&ed25519.PubKey{})), GenType(&authtypes.ModuleCredential{}, &authapi.ModuleCredential{}, GenOpts), GenType(&authztypes.GenericAuthorization{}, &authzapi.GenericAuthorization{}, GenOpts), diff --git a/tests/integration/runtime/query_test.go b/tests/integration/runtime/query_test.go index 22f2a1d8623c..3ae7a2835f59 100644 --- a/tests/integration/runtime/query_test.go +++ b/tests/integration/runtime/query_test.go @@ -3,7 +3,6 @@ package runtime import ( "testing" - reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" "github.com/cosmos/gogoproto/proto" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" @@ -12,6 +11,7 @@ import ( appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" "cosmossdk.io/depinject" "cosmossdk.io/log" @@ -20,7 +20,6 @@ import ( "github.com/cosmos/cosmos-sdk/testutil/configurator" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/cosmos-sdk/x/auth" _ "github.com/cosmos/cosmos-sdk/x/auth/tx/config" _ "github.com/cosmos/cosmos-sdk/x/bank" diff --git a/tests/integration/slashing/keeper/keeper_test.go b/tests/integration/slashing/keeper/keeper_test.go index c7eb5f36631a..d43c07f1df85 100644 --- a/tests/integration/slashing/keeper/keeper_test.go +++ b/tests/integration/slashing/keeper/keeper_test.go @@ -4,15 +4,17 @@ import ( "testing" "time" - "cosmossdk.io/core/comet" - "cosmossdk.io/log" - storetypes "cosmossdk.io/store/types" - cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" "gotest.tools/v3/assert" + "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/comet" + "cosmossdk.io/log" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/codec" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/testutil/integration" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" @@ -72,6 +74,7 @@ func initFixture(t testing.TB) *fixture { runtime.NewKVStoreService(keys[authtypes.StoreKey]), authtypes.ProtoBaseAccount, maccPerms, + addresscodec.NewBech32Codec(sdk.Bech32MainPrefix), sdk.Bech32MainPrefix, authority.String(), ) @@ -88,7 +91,7 @@ func initFixture(t testing.TB) *fixture { log.NewNopLogger(), ) - stakingKeeper := stakingkeeper.NewKeeper(cdc, keys[stakingtypes.StoreKey], accountKeeper, bankKeeper, authority.String()) + stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), accountKeeper, bankKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr)) slashingKeeper := slashingkeeper.NewKeeper(cdc, &codec.LegacyAmino{}, runtime.NewKVStoreService(keys[slashingtypes.StoreKey]), stakingKeeper, authority.String()) @@ -96,7 +99,11 @@ func initFixture(t testing.TB) *fixture { stakingModule := staking.NewAppModule(cdc, stakingKeeper, accountKeeper, bankKeeper, nil) slashingModule := slashing.NewAppModule(cdc, slashingKeeper, accountKeeper, bankKeeper, stakingKeeper, nil, cdc.InterfaceRegistry()) - integrationApp := integration.NewIntegrationApp(newCtx, logger, keys, cdc, bankModule, stakingModule, slashingModule) + integrationApp := integration.NewIntegrationApp(newCtx, logger, keys, cdc, map[string]appmodule.AppModule{ + banktypes.ModuleName: bankModule, + stakingtypes.ModuleName: stakingModule, + slashingtypes.ModuleName: slashingModule, + }) sdkCtx := sdk.UnwrapSDKContext(integrationApp.Context()) @@ -133,7 +140,8 @@ func TestUnJailNotBonded(t *testing.T) { t.Parallel() f := initFixture(t) - p := f.stakingKeeper.GetParams(f.ctx) + p, err := f.stakingKeeper.GetParams(f.ctx) + assert.NilError(t, err) p.MaxValidators = 5 f.stakingKeeper.SetParams(f.ctx, p) @@ -212,7 +220,7 @@ func TestHandleNewValidator(t *testing.T) { f := initFixture(t) pks := simtestutil.CreateTestPubKeys(1) - addr, val := f.valAddrs[0], pks[0] + addr, valpubkey := f.valAddrs[0], pks[0] tstaking := stakingtestutil.NewHelper(t, f.ctx, f.stakingKeeper) signedBlocksWindow, err := f.slashingKeeper.SignedBlocksWindow(f.ctx) assert.NilError(t, err) @@ -220,27 +228,33 @@ func TestHandleNewValidator(t *testing.T) { assert.NilError(t, f.slashingKeeper.AddPubkey(f.ctx, pks[0])) - info := slashingtypes.NewValidatorSigningInfo(sdk.ConsAddress(val.Address()), f.ctx.BlockHeight(), int64(0), time.Unix(0, 0), false, int64(0)) - err = f.slashingKeeper.SetValidatorSigningInfo(f.ctx, sdk.ConsAddress(val.Address()), info) - assert.NilError(t, err) + info := slashingtypes.NewValidatorSigningInfo(sdk.ConsAddress(valpubkey.Address()), f.ctx.BlockHeight(), int64(0), time.Unix(0, 0), false, int64(0)) + assert.NilError(t, f.slashingKeeper.SetValidatorSigningInfo(f.ctx, sdk.ConsAddress(valpubkey.Address()), info)) // Validator created - amt := tstaking.CreateValidatorWithValPower(addr, val, 100, true) + amt := tstaking.CreateValidatorWithValPower(addr, valpubkey, 100, true) _, err = f.stakingKeeper.EndBlocker(f.ctx) - assert.NilError(t, err) + require.NoError(t, err) + + bondDenom, err := f.stakingKeeper.BondDenom(f.ctx) + require.NoError(t, err) + assert.DeepEqual( t, f.bankKeeper.GetAllBalances(f.ctx, sdk.AccAddress(addr)), - sdk.NewCoins(sdk.NewCoin(f.stakingKeeper.GetParams(f.ctx).BondDenom, testutil.InitTokens.Sub(amt))), + sdk.NewCoins(sdk.NewCoin(bondDenom, testutil.InitTokens.Sub(amt))), ) - assert.DeepEqual(t, amt, f.stakingKeeper.Validator(f.ctx, addr).GetBondedTokens()) + + val, err := f.stakingKeeper.Validator(f.ctx, addr) + require.NoError(t, err) + assert.DeepEqual(t, amt, val.GetBondedTokens()) // Now a validator, for two blocks - assert.NilError(t, f.slashingKeeper.HandleValidatorSignature(f.ctx, val.Address(), 100, comet.BlockIDFlagCommit)) + assert.NilError(t, f.slashingKeeper.HandleValidatorSignature(f.ctx, valpubkey.Address(), 100, comet.BlockIDFlagCommit)) f.ctx = f.ctx.WithBlockHeight(signedBlocksWindow + 2) - assert.NilError(t, f.slashingKeeper.HandleValidatorSignature(f.ctx, val.Address(), 100, comet.BlockIDFlagAbsent)) + assert.NilError(t, f.slashingKeeper.HandleValidatorSignature(f.ctx, valpubkey.Address(), 100, comet.BlockIDFlagAbsent)) - info, found := f.slashingKeeper.GetValidatorSigningInfo(f.ctx, sdk.ConsAddress(val.Address())) + info, found := f.slashingKeeper.GetValidatorSigningInfo(f.ctx, sdk.ConsAddress(valpubkey.Address())) assert.Assert(t, found) assert.Equal(t, signedBlocksWindow+1, info.StartHeight) assert.Equal(t, int64(2), info.IndexOffset) @@ -248,11 +262,11 @@ func TestHandleNewValidator(t *testing.T) { assert.Equal(t, time.Unix(0, 0).UTC(), info.JailedUntil) // validator should be bonded still, should not have been jailed or slashed - validator, _ := f.stakingKeeper.GetValidatorByConsAddr(f.ctx, sdk.GetConsAddress(val)) + validator, _ := f.stakingKeeper.GetValidatorByConsAddr(f.ctx, sdk.GetConsAddress(valpubkey)) assert.Equal(t, stakingtypes.Bonded, validator.GetStatus()) bondPool := f.stakingKeeper.GetBondedPool(f.ctx) expTokens := f.stakingKeeper.TokensFromConsensusPower(f.ctx, 100) - assert.Assert(t, expTokens.Equal(f.bankKeeper.GetBalance(f.ctx, bondPool.GetAddress(), f.stakingKeeper.BondDenom(f.ctx)).Amount)) + assert.Assert(t, expTokens.Equal(f.bankKeeper.GetBalance(f.ctx, bondPool.GetAddress(), bondDenom).Amount)) } // Test a jailed validator being "down" twice @@ -326,7 +340,8 @@ func TestValidatorDippingInAndOut(t *testing.T) { t.Parallel() f := initFixture(t) - params := f.stakingKeeper.GetParams(f.ctx) + params, err := f.stakingKeeper.GetParams(f.ctx) + require.NoError(t, err) params.MaxValidators = 1 f.stakingKeeper.SetParams(f.ctx, params) power := int64(100) diff --git a/tests/integration/staking/keeper/common_test.go b/tests/integration/staking/keeper/common_test.go index 853a506810e3..f4958b1b86da 100644 --- a/tests/integration/staking/keeper/common_test.go +++ b/tests/integration/staking/keeper/common_test.go @@ -4,14 +4,16 @@ import ( "math/big" "testing" + cmtprototypes "github.com/cometbft/cometbft/proto/tendermint/types" + "gotest.tools/v3/assert" + + "cosmossdk.io/core/appmodule" "cosmossdk.io/log" "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" - "gotest.tools/v3/assert" - - cmtprototypes "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/codec" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/testutil/integration" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" @@ -56,7 +58,7 @@ func ValEq(t *testing.T, exp, got types.Validator) (*testing.T, bool, string, ty // generateAddresses generates numAddrs of normal AccAddrs and ValAddrs func generateAddresses(f *fixture, numAddrs int) ([]sdk.AccAddress, []sdk.ValAddress) { - addrDels := simtestutil.AddTestAddrsIncremental(f.bankKeeper, f.stakingKeeper, f.sdkCtx, numAddrs, sdk.NewInt(10000)) + addrDels := simtestutil.AddTestAddrsIncremental(f.bankKeeper, f.stakingKeeper, f.sdkCtx, numAddrs, math.NewInt(10000)) addrVals := simtestutil.ConvertAddrsToValAddrs(addrDels) return addrDels, addrVals @@ -71,12 +73,12 @@ func createValidators(t *testing.T, f *fixture, powers []int64) ([]sdk.AccAddres val2 := testutil.NewValidator(t, valAddrs[1], pks[1]) vals := []types.Validator{val1, val2} - f.stakingKeeper.SetValidator(f.sdkCtx, val1) - f.stakingKeeper.SetValidator(f.sdkCtx, val2) - f.stakingKeeper.SetValidatorByConsAddr(f.sdkCtx, val1) - f.stakingKeeper.SetValidatorByConsAddr(f.sdkCtx, val2) - f.stakingKeeper.SetNewValidatorByPowerIndex(f.sdkCtx, val1) - f.stakingKeeper.SetNewValidatorByPowerIndex(f.sdkCtx, val2) + assert.NilError(t, f.stakingKeeper.SetValidator(f.sdkCtx, val1)) + assert.NilError(t, f.stakingKeeper.SetValidator(f.sdkCtx, val2)) + assert.NilError(t, f.stakingKeeper.SetValidatorByConsAddr(f.sdkCtx, val1)) + assert.NilError(t, f.stakingKeeper.SetValidatorByConsAddr(f.sdkCtx, val2)) + assert.NilError(t, f.stakingKeeper.SetNewValidatorByPowerIndex(f.sdkCtx, val1)) + assert.NilError(t, f.stakingKeeper.SetNewValidatorByPowerIndex(f.sdkCtx, val2)) _, err := f.stakingKeeper.Delegate(f.sdkCtx, addrs[0], f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, powers[0]), types.Unbonded, val1, true) assert.NilError(t, err) @@ -114,6 +116,7 @@ func initFixture(t testing.TB) *fixture { runtime.NewKVStoreService(keys[authtypes.StoreKey]), authtypes.ProtoBaseAccount, maccPerms, + addresscodec.NewBech32Codec(sdk.Bech32MainPrefix), sdk.Bech32MainPrefix, authority.String(), ) @@ -130,13 +133,17 @@ func initFixture(t testing.TB) *fixture { log.NewNopLogger(), ) - stakingKeeper := stakingkeeper.NewKeeper(cdc, keys[types.StoreKey], accountKeeper, bankKeeper, authority.String()) + stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewKVStoreService(keys[types.StoreKey]), accountKeeper, bankKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr)) authModule := auth.NewAppModule(cdc, accountKeeper, authsims.RandomGenesisAccounts, nil) bankModule := bank.NewAppModule(cdc, bankKeeper, accountKeeper, nil) stakingModule := staking.NewAppModule(cdc, stakingKeeper, accountKeeper, bankKeeper, nil) - integrationApp := integration.NewIntegrationApp(newCtx, logger, keys, cdc, authModule, bankModule, stakingModule) + integrationApp := integration.NewIntegrationApp(newCtx, logger, keys, cdc, map[string]appmodule.AppModule{ + authtypes.ModuleName: authModule, + banktypes.ModuleName: bankModule, + types.ModuleName: stakingModule, + }) sdkCtx := sdk.UnwrapSDKContext(integrationApp.Context()) @@ -145,7 +152,7 @@ func initFixture(t testing.TB) *fixture { types.RegisterQueryServer(integrationApp.QueryHelper(), stakingkeeper.NewQuerier(stakingKeeper)) // set default staking params - stakingKeeper.SetParams(sdkCtx, types.DefaultParams()) + assert.NilError(t, stakingKeeper.SetParams(sdkCtx, types.DefaultParams())) f := fixture{ app: integrationApp, diff --git a/tests/integration/staking/keeper/delegation_test.go b/tests/integration/staking/keeper/delegation_test.go index 3d30da540d41..a68c68ee13e9 100644 --- a/tests/integration/staking/keeper/delegation_test.go +++ b/tests/integration/staking/keeper/delegation_test.go @@ -4,9 +4,10 @@ import ( "testing" "time" - "cosmossdk.io/math" "gotest.tools/v3/assert" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" banktestutil "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/staking/keeper" @@ -21,23 +22,20 @@ func TestUnbondingDelegationsMaxEntries(t *testing.T) { ctx := f.sdkCtx initTokens := f.stakingKeeper.TokensFromConsensusPower(ctx, int64(1000)) - f.bankKeeper.MintCoins(ctx, types.ModuleName, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, initTokens))) + assert.NilError(t, f.bankKeeper.MintCoins(ctx, types.ModuleName, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, initTokens)))) addrDel := sdk.AccAddress([]byte("addr")) - accAmt := sdk.NewInt(10000) - initCoins := sdk.NewCoins(sdk.NewCoin(f.stakingKeeper.BondDenom(ctx), accAmt)) - if err := f.bankKeeper.MintCoins(ctx, types.ModuleName, initCoins); err != nil { - panic(err) - } + accAmt := math.NewInt(10000) + bondDenom, err := f.stakingKeeper.BondDenom(ctx) + assert.NilError(t, err) - if err := f.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, addrDel, initCoins); err != nil { - panic(err) - } + initCoins := sdk.NewCoins(sdk.NewCoin(bondDenom, accAmt)) + assert.NilError(t, f.bankKeeper.MintCoins(ctx, types.ModuleName, initCoins)) + assert.NilError(t, f.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, addrDel, initCoins)) addrVal := sdk.ValAddress(addrDel) startTokens := f.stakingKeeper.TokensFromConsensusPower(ctx, 10) - bondDenom := f.stakingKeeper.BondDenom(ctx) notBondedPool := f.stakingKeeper.GetNotBondedPool(ctx) assert.NilError(t, banktestutil.FundModuleAccount(ctx, f.bankKeeper, notBondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(bondDenom, startTokens)))) @@ -53,10 +51,11 @@ func TestUnbondingDelegationsMaxEntries(t *testing.T) { assert.Assert(math.IntEq(t, startTokens, validator.BondedTokens())) assert.Assert(t, validator.IsBonded()) - delegation := types.NewDelegation(addrDel, addrVal, issuedShares) - f.stakingKeeper.SetDelegation(ctx, delegation) + delegation := types.NewDelegation(addrDel.String(), addrVal.String(), issuedShares) + assert.NilError(t, f.stakingKeeper.SetDelegation(ctx, delegation)) - maxEntries := f.stakingKeeper.MaxEntries(ctx) + maxEntries, err := f.stakingKeeper.MaxEntries(ctx) + assert.NilError(t, err) oldBonded := f.bankKeeper.GetBalance(ctx, f.stakingKeeper.GetBondedPool(ctx).GetAddress(), bondDenom).Amount oldNotBonded := f.bankKeeper.GetBalance(ctx, f.stakingKeeper.GetNotBondedPool(ctx).GetAddress(), bondDenom).Amount @@ -69,8 +68,8 @@ func TestUnbondingDelegationsMaxEntries(t *testing.T) { ctx = ctx.WithBlockHeight(i) var amount math.Int completionTime, amount, err = f.stakingKeeper.Undelegate(ctx, addrDel, addrVal, math.LegacyNewDec(1)) - totalUnbonded = totalUnbonded.Add(amount) assert.NilError(t, err) + totalUnbonded = totalUnbonded.Add(amount) } newBonded := f.bankKeeper.GetBalance(ctx, f.stakingKeeper.GetBondedPool(ctx).GetAddress(), bondDenom).Amount @@ -84,7 +83,7 @@ func TestUnbondingDelegationsMaxEntries(t *testing.T) { oldNotBonded = f.bankKeeper.GetBalance(ctx, f.stakingKeeper.GetNotBondedPool(ctx).GetAddress(), bondDenom).Amount // an additional unbond should fail due to max entries - _, _, err := f.stakingKeeper.Undelegate(ctx, addrDel, addrVal, math.LegacyNewDec(1)) + _, _, err = f.stakingKeeper.Undelegate(ctx, addrDel, addrVal, math.LegacyNewDec(1)) assert.Error(t, err, "too many unbonding delegation entries for (delegator, validator) tuple") newBonded = f.bankKeeper.GetBalance(ctx, f.stakingKeeper.GetBondedPool(ctx).GetAddress(), bondDenom).Amount diff --git a/tests/integration/staking/keeper/determinstic_test.go b/tests/integration/staking/keeper/determinstic_test.go index cd0ab10e216f..c6c0f6377d37 100644 --- a/tests/integration/staking/keeper/determinstic_test.go +++ b/tests/integration/staking/keeper/determinstic_test.go @@ -4,14 +4,17 @@ import ( "testing" "time" - "cosmossdk.io/log" - "cosmossdk.io/math" - storetypes "cosmossdk.io/store/types" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "gotest.tools/v3/assert" "pgregory.net/rapid" + "cosmossdk.io/core/appmodule" + "cosmossdk.io/log" + "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/codec" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" "github.com/cosmos/cosmos-sdk/runtime" @@ -86,6 +89,7 @@ func initDeterministicFixture(t *testing.T) *deterministicFixture { runtime.NewKVStoreService(keys[authtypes.StoreKey]), authtypes.ProtoBaseAccount, maccPerms, + addresscodec.NewBech32Codec(sdk.Bech32MainPrefix), sdk.Bech32MainPrefix, authority.String(), ) @@ -102,42 +106,47 @@ func initDeterministicFixture(t *testing.T) *deterministicFixture { log.NewNopLogger(), ) - stakingKeeper := stakingkeeper.NewKeeper(cdc, keys[stakingtypes.StoreKey], accountKeeper, bankKeeper, authority.String()) + stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), accountKeeper, bankKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr)) authModule := auth.NewAppModule(cdc, accountKeeper, authsims.RandomGenesisAccounts, nil) bankModule := bank.NewAppModule(cdc, bankKeeper, accountKeeper, nil) stakingModule := staking.NewAppModule(cdc, stakingKeeper, accountKeeper, bankKeeper, nil) - integrationApp := integration.NewIntegrationApp(newCtx, logger, keys, cdc, authModule, bankModule, stakingModule) + integrationApp := integration.NewIntegrationApp(newCtx, logger, keys, cdc, map[string]appmodule.AppModule{ + authtypes.ModuleName: authModule, + banktypes.ModuleName: bankModule, + stakingtypes.ModuleName: stakingModule, + }) - sdkCtx := sdk.UnwrapSDKContext(integrationApp.Context()) + ctx := integrationApp.Context() // Register MsgServer and QueryServer stakingtypes.RegisterMsgServer(integrationApp.MsgServiceRouter(), stakingkeeper.NewMsgServerImpl(stakingKeeper)) stakingtypes.RegisterQueryServer(integrationApp.QueryHelper(), stakingkeeper.NewQuerier(stakingKeeper)) // set default staking params - stakingKeeper.SetParams(sdkCtx, stakingtypes.DefaultParams()) + assert.NilError(t, stakingKeeper.SetParams(ctx, stakingtypes.DefaultParams())) // set pools - startTokens := stakingKeeper.TokensFromConsensusPower(sdkCtx, 10) - bondDenom := stakingKeeper.BondDenom(sdkCtx) - notBondedPool := stakingKeeper.GetNotBondedPool(sdkCtx) - assert.NilError(t, banktestutil.FundModuleAccount(sdkCtx, bankKeeper, notBondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(bondDenom, startTokens)))) - accountKeeper.SetModuleAccount(sdkCtx, notBondedPool) - bondedPool := stakingKeeper.GetBondedPool(sdkCtx) - assert.NilError(t, banktestutil.FundModuleAccount(sdkCtx, bankKeeper, bondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(bondDenom, startTokens)))) - accountKeeper.SetModuleAccount(sdkCtx, bondedPool) + startTokens := stakingKeeper.TokensFromConsensusPower(ctx, 10) + bondDenom, err := stakingKeeper.BondDenom(ctx) + assert.NilError(t, err) + notBondedPool := stakingKeeper.GetNotBondedPool(ctx) + assert.NilError(t, banktestutil.FundModuleAccount(ctx, bankKeeper, notBondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(bondDenom, startTokens)))) + accountKeeper.SetModuleAccount(ctx, notBondedPool) + bondedPool := stakingKeeper.GetBondedPool(ctx) + assert.NilError(t, banktestutil.FundModuleAccount(ctx, bankKeeper, bondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(bondDenom, startTokens)))) + accountKeeper.SetModuleAccount(ctx, bondedPool) qr := integrationApp.QueryHelper() queryClient := stakingtypes.NewQueryClient(qr) - amt1 := stakingKeeper.TokensFromConsensusPower(sdkCtx, 101) - amt2 := stakingKeeper.TokensFromConsensusPower(sdkCtx, 102) + amt1 := stakingKeeper.TokensFromConsensusPower(ctx, 101) + amt2 := stakingKeeper.TokensFromConsensusPower(ctx, 102) f := deterministicFixture{ app: integrationApp, - ctx: sdkCtx, + ctx: sdk.UnwrapSDKContext(ctx), cdc: cdc, keys: keys, accountKeeper: accountKeeper, @@ -184,8 +193,8 @@ func createValidator(rt *rapid.T, f *deterministicFixture, t *testing.T) staking ConsensusPubkey: pubkeyAny, Jailed: rapid.Bool().Draw(rt, "jailed"), Status: bondTypeGenerator().Draw(rt, "bond-status"), - Tokens: sdk.NewInt(rapid.Int64Min(10000).Draw(rt, "tokens")), - DelegatorShares: sdk.NewDecWithPrec(rapid.Int64Range(1, 100).Draw(rt, "commission"), 2), + Tokens: math.NewInt(rapid.Int64Min(10000).Draw(rt, "tokens")), + DelegatorShares: math.LegacyNewDecWithPrec(rapid.Int64Range(1, 100).Draw(rt, "commission"), 2), Description: stakingtypes.NewDescription( rapid.StringN(5, 250, 255).Draw(rt, "moniker"), rapid.StringN(5, 250, 255).Draw(rt, "identity"), @@ -196,11 +205,11 @@ func createValidator(rt *rapid.T, f *deterministicFixture, t *testing.T) staking UnbondingHeight: rapid.Int64Min(1).Draw(rt, "unbonding-height"), UnbondingTime: time.Now().Add(durationGenerator().Draw(rt, "duration")), Commission: stakingtypes.NewCommission( - sdk.NewDecWithPrec(rapid.Int64Range(0, 100).Draw(rt, "rate"), 2), - sdk.NewDecWithPrec(rapid.Int64Range(0, 100).Draw(rt, "max-rate"), 2), - sdk.NewDecWithPrec(rapid.Int64Range(0, 100).Draw(rt, "max-change-rate"), 2), + math.LegacyNewDecWithPrec(rapid.Int64Range(0, 100).Draw(rt, "rate"), 2), + math.LegacyNewDecWithPrec(rapid.Int64Range(0, 100).Draw(rt, "max-rate"), 2), + math.LegacyNewDecWithPrec(rapid.Int64Range(0, 100).Draw(rt, "max-change-rate"), 2), ), - MinSelfDelegation: sdk.NewInt(rapid.Int64Min(1).Draw(rt, "tokens")), + MinSelfDelegation: math.NewInt(rapid.Int64Min(1).Draw(rt, "tokens")), } } @@ -220,16 +229,19 @@ func createAndSetValidator(rt *rapid.T, f *deterministicFixture, t *testing.T) s } func setValidator(f *deterministicFixture, t *testing.T, validator stakingtypes.Validator) { - f.stakingKeeper.SetValidator(f.ctx, validator) - f.stakingKeeper.SetValidatorByPowerIndex(f.ctx, validator) - f.stakingKeeper.SetValidatorByConsAddr(f.ctx, validator) - assert.NilError(t, f.stakingKeeper.Hooks().AfterValidatorCreated(f.ctx, validator.GetOperator())) + assert.NilError(t, f.stakingKeeper.SetValidator(f.ctx, validator)) + assert.NilError(t, f.stakingKeeper.SetValidatorByPowerIndex(f.ctx, validator)) + assert.NilError(t, f.stakingKeeper.SetValidatorByConsAddr(f.ctx, validator)) + valbz, err := f.stakingKeeper.ValidatorAddressCodec().StringToBytes(validator.GetOperator()) + assert.NilError(t, err) + + assert.NilError(t, f.stakingKeeper.Hooks().AfterValidatorCreated(f.ctx, valbz)) - delegatorAddress := sdk.AccAddress(validator.GetOperator()) + delegatorAddress := sdk.AccAddress(valbz) coins := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, validator.BondedTokens())) - banktestutil.FundAccount(f.ctx, f.bankKeeper, delegatorAddress, coins) + assert.NilError(t, banktestutil.FundAccount(f.ctx, f.bankKeeper, delegatorAddress, coins)) - _, err := f.stakingKeeper.Delegate(f.ctx, delegatorAddress, validator.BondedTokens(), stakingtypes.Unbonded, validator, true) + _, err = f.stakingKeeper.Delegate(f.ctx, delegatorAddress, validator.BondedTokens(), stakingtypes.Unbonded, validator, true) assert.NilError(t, err) } @@ -244,8 +256,8 @@ func getStaticValidator(f *deterministicFixture, t *testing.T) stakingtypes.Vali ConsensusPubkey: pubkeyAny, Jailed: false, Status: stakingtypes.Bonded, - Tokens: sdk.NewInt(100), - DelegatorShares: sdk.NewDecWithPrec(5, 2), + Tokens: math.NewInt(100), + DelegatorShares: math.LegacyNewDecWithPrec(5, 2), Description: stakingtypes.NewDescription( "moniker", "identity", @@ -256,11 +268,11 @@ func getStaticValidator(f *deterministicFixture, t *testing.T) stakingtypes.Vali UnbondingHeight: 10, UnbondingTime: time.Date(2022, 10, 1, 0, 0, 0, 0, time.UTC), Commission: stakingtypes.NewCommission( - sdk.NewDecWithPrec(5, 2), - sdk.NewDecWithPrec(5, 2), - sdk.NewDecWithPrec(5, 2), + math.LegacyNewDecWithPrec(5, 2), + math.LegacyNewDecWithPrec(5, 2), + math.LegacyNewDecWithPrec(5, 2), ), - MinSelfDelegation: sdk.NewInt(10), + MinSelfDelegation: math.NewInt(10), } setValidator(f, t, validator) @@ -278,8 +290,8 @@ func getStaticValidator2(f *deterministicFixture, t *testing.T) stakingtypes.Val ConsensusPubkey: pubkeyAny, Jailed: true, Status: stakingtypes.Bonded, - Tokens: sdk.NewInt(10012), - DelegatorShares: sdk.NewDecWithPrec(96, 2), + Tokens: math.NewInt(10012), + DelegatorShares: math.LegacyNewDecWithPrec(96, 2), Description: stakingtypes.NewDescription( "moniker", "identity", @@ -290,11 +302,11 @@ func getStaticValidator2(f *deterministicFixture, t *testing.T) stakingtypes.Val UnbondingHeight: 100132, UnbondingTime: time.Date(2025, 10, 1, 0, 0, 0, 0, time.UTC), Commission: stakingtypes.NewCommission( - sdk.NewDecWithPrec(15, 2), - sdk.NewDecWithPrec(59, 2), - sdk.NewDecWithPrec(51, 2), + math.LegacyNewDecWithPrec(15, 2), + math.LegacyNewDecWithPrec(59, 2), + math.LegacyNewDecWithPrec(51, 2), ), - MinSelfDelegation: sdk.NewInt(1), + MinSelfDelegation: math.NewInt(1), } setValidator(f, t, validator) @@ -312,7 +324,7 @@ func fundAccountAndDelegate(f *deterministicFixture, t *testing.T, delegator sdk coins := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, amt)) assert.NilError(t, f.bankKeeper.MintCoins(f.ctx, minttypes.ModuleName, coins)) - banktestutil.FundAccount(f.ctx, f.bankKeeper, delegator, coins) + assert.NilError(t, banktestutil.FundAccount(f.ctx, f.bankKeeper, delegator, coins)) shares, err := f.stakingKeeper.Delegate(f.ctx, delegator, amt, stakingtypes.Unbonded, validator, true) return shares, err @@ -417,8 +429,9 @@ func TestGRPCValidatorUnbondingDelegations(t *testing.T) { delegator := testdata.AddressGenerator(rt).Draw(rt, "delegator") shares, err := createDelegationAndDelegate(rt, f, t, delegator, validator) assert.NilError(t, err) - - _, _, err = f.stakingKeeper.Undelegate(f.ctx, delegator, validator.GetOperator(), shares) + valbz, err := f.stakingKeeper.ValidatorAddressCodec().StringToBytes(validator.GetOperator()) + assert.NilError(t, err) + _, _, err = f.stakingKeeper.Undelegate(f.ctx, delegator, valbz, shares) assert.NilError(t, err) } @@ -494,7 +507,9 @@ func TestGRPCUnbondingDelegation(t *testing.T) { shares, err := createDelegationAndDelegate(rt, f, t, delegator, validator) assert.NilError(t, err) - _, _, err = f.stakingKeeper.Undelegate(f.ctx, delegator, validator.GetOperator(), shares) + valbz, err := f.stakingKeeper.ValidatorAddressCodec().StringToBytes(validator.GetOperator()) + assert.NilError(t, err) + _, _, err = f.stakingKeeper.Undelegate(f.ctx, delegator, valbz, shares) assert.NilError(t, err) req := &stakingtypes.QueryUnbondingDelegationRequest{ @@ -603,8 +618,9 @@ func TestGRPCDelegatorUnbondingDelegations(t *testing.T) { validator := createAndSetValidatorWithStatus(rt, f, t, stakingtypes.Bonded) shares, err := createDelegationAndDelegate(rt, f, t, delegator, validator) assert.NilError(t, err) - - _, _, err = f.stakingKeeper.Undelegate(f.ctx, delegator, validator.GetOperator(), shares) + valbz, err := f.stakingKeeper.ValidatorAddressCodec().StringToBytes(validator.GetOperator()) + assert.NilError(t, err) + _, _, err = f.stakingKeeper.Undelegate(f.ctx, delegator, valbz, shares) assert.NilError(t, err) } @@ -638,24 +654,24 @@ func TestGRPCHistoricalInfo(t *testing.T) { rapid.Check(t, func(rt *rapid.T) { numVals := rapid.IntRange(1, 5).Draw(rt, "num-vals") - vals := make(stakingtypes.Validators, 0, numVals) + vals := stakingtypes.Validators{} for i := 0; i < numVals; i++ { validator := createAndSetValidatorWithStatus(rt, f, t, stakingtypes.Bonded) - vals = append(vals, validator) + vals.Validators = append(vals.Validators, validator) } historicalInfo := stakingtypes.HistoricalInfo{ Header: cmtproto.Header{}, - Valset: vals, + Valset: vals.Validators, } height := rapid.Int64Min(0).Draw(rt, "height") - f.stakingKeeper.SetHistoricalInfo( + assert.NilError(t, f.stakingKeeper.SetHistoricalInfo( f.ctx, height, &historicalInfo, - ) + )) req := &stakingtypes.QueryHistoricalInfoRequest{ Height: height, @@ -675,11 +691,11 @@ func TestGRPCHistoricalInfo(t *testing.T) { height := int64(127) - f.stakingKeeper.SetHistoricalInfo( + assert.NilError(t, f.stakingKeeper.SetHistoricalInfo( f.ctx, height, &historicalInfo, - ) + )) req := &stakingtypes.QueryHistoricalInfoRequest{ Height: height, @@ -812,7 +828,7 @@ func TestGRPCParams(t *testing.T) { MaxValidators: rapid.Uint32Min(1).Draw(rt, "max-validators"), MaxEntries: rapid.Uint32Min(1).Draw(rt, "max-entries"), HistoricalEntries: rapid.Uint32Min(1).Draw(rt, "historical-entries"), - MinCommissionRate: sdk.NewDecWithPrec(rapid.Int64Range(0, 100).Draw(rt, "commission"), 2), + MinCommissionRate: math.LegacyNewDecWithPrec(rapid.Int64Range(0, 100).Draw(rt, "commission"), 2), } err := f.stakingKeeper.SetParams(f.ctx, params) @@ -827,7 +843,7 @@ func TestGRPCParams(t *testing.T) { MaxValidators: 85, MaxEntries: 5, HistoricalEntries: 5, - MinCommissionRate: sdk.NewDecWithPrec(5, 2), + MinCommissionRate: math.LegacyNewDecWithPrec(5, 2), } err := f.stakingKeeper.SetParams(f.ctx, params) diff --git a/tests/integration/staking/keeper/genesis_test.go b/tests/integration/staking/keeper/genesis_test.go index 68be2c93e5e4..78e830dc822e 100644 --- a/tests/integration/staking/keeper/genesis_test.go +++ b/tests/integration/staking/keeper/genesis_test.go @@ -4,11 +4,12 @@ import ( "fmt" "testing" - "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" "github.com/stretchr/testify/require" "gotest.tools/v3/assert" + "cosmossdk.io/math" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" banktestutil "github.com/cosmos/cosmos-sdk/x/bank/testutil" @@ -37,13 +38,17 @@ func TestInitGenesis(t *testing.T) { ConsensusPubkey: pk0, Status: types.Bonded, Tokens: valTokens, - DelegatorShares: sdk.NewDecFromInt(valTokens), + DelegatorShares: math.LegacyNewDecFromInt(valTokens), Description: types.NewDescription("hoop", "", "", "", ""), } - f.stakingKeeper.SetValidator(f.sdkCtx, bondedVal) + assert.NilError(t, f.stakingKeeper.SetValidator(f.sdkCtx, bondedVal)) + + params, err := f.stakingKeeper.GetParams(f.sdkCtx) + assert.NilError(t, err) + + validators, err := f.stakingKeeper.GetAllValidators(f.sdkCtx) + assert.NilError(t, err) - params := (f.stakingKeeper.GetParams(f.sdkCtx)) - validators := (f.stakingKeeper.GetAllValidators(f.sdkCtx)) assert.Assert(t, len(validators) == 1) var delegations []types.Delegation @@ -59,7 +64,7 @@ func TestInitGenesis(t *testing.T) { ConsensusPubkey: pk1, Status: types.Bonded, Tokens: valTokens, - DelegatorShares: sdk.NewDecFromInt(valTokens), + DelegatorShares: math.LegacyNewDecFromInt(valTokens), Description: types.NewDescription("hoop", "", "", "", ""), } bondedVal2 := types.Validator{ @@ -67,7 +72,7 @@ func TestInitGenesis(t *testing.T) { ConsensusPubkey: pk2, Status: types.Bonded, Tokens: valTokens, - DelegatorShares: sdk.NewDecFromInt(valTokens), + DelegatorShares: math.LegacyNewDecFromInt(valTokens), Description: types.NewDescription("bloop", "", "", "", ""), } @@ -87,7 +92,8 @@ func TestInitGenesis(t *testing.T) { ), ) - genesisDelegations := (f.stakingKeeper.GetAllDelegations(f.sdkCtx)) + genesisDelegations, err := f.stakingKeeper.GetAllDelegations(f.sdkCtx) + assert.NilError(t, err) delegations = append(delegations, genesisDelegations...) genesisState := types.NewGenesisState(params, validators, delegations) @@ -96,7 +102,10 @@ func TestInitGenesis(t *testing.T) { actualGenesis := (f.stakingKeeper.ExportGenesis(f.sdkCtx)) assert.DeepEqual(t, genesisState.Params, actualGenesis.Params) assert.DeepEqual(t, genesisState.Delegations, actualGenesis.Delegations) - assert.DeepEqual(t, (f.stakingKeeper.GetAllValidators(f.sdkCtx)), actualGenesis.Validators) + + allvals, err := f.stakingKeeper.GetAllValidators(f.sdkCtx) + assert.NilError(t, err) + assert.DeepEqual(t, allvals, actualGenesis.Validators) // Ensure validators have addresses. vals2, err := staking.WriteValidators(f.sdkCtx, (f.stakingKeeper)) @@ -135,8 +144,8 @@ func TestInitGenesis_PoolsBalanceMismatch(t *testing.T) { OperatorAddress: sdk.ValAddress("12345678901234567890").String(), ConsensusPubkey: consPub, Jailed: false, - Tokens: sdk.NewInt(10), - DelegatorShares: sdk.NewDecFromInt(sdk.NewInt(10)), + Tokens: math.NewInt(10), + DelegatorShares: math.LegacyNewDecFromInt(math.NewInt(10)), Description: types.NewDescription("bloop", "", "", "", ""), } @@ -175,18 +184,18 @@ func TestInitGenesisLargeValidatorSet(t *testing.T) { assert.Assert(t, size > 100) f, addrs := bootstrapGenesisTest(t, 200) - genesisValidators := f.stakingKeeper.GetAllValidators(f.sdkCtx) + genesisValidators, err := f.stakingKeeper.GetAllValidators(f.sdkCtx) + assert.NilError(t, err) - params := f.stakingKeeper.GetParams(f.sdkCtx) + params, err := f.stakingKeeper.GetParams(f.sdkCtx) + assert.NilError(t, err) delegations := []types.Delegation{} validators := make([]types.Validator, size) - var err error - bondedPoolAmt := math.ZeroInt() for i := range validators { validators[i], err = types.NewValidator( - sdk.ValAddress(addrs[i]), + sdk.ValAddress(addrs[i]).String(), PKs[i], types.NewDescription(fmt.Sprintf("#%d", i), "", "", "", ""), ) @@ -199,7 +208,7 @@ func TestInitGenesisLargeValidatorSet(t *testing.T) { } validators[i].Tokens = tokens - validators[i].DelegatorShares = sdk.NewDecFromInt(tokens) + validators[i].DelegatorShares = math.LegacyNewDecFromInt(tokens) // add bonded coins bondedPoolAmt = bondedPoolAmt.Add(tokens) diff --git a/tests/integration/staking/keeper/grpc_query_test.go b/tests/integration/staking/keeper/grpc_query_test.go index de9b774a5ab4..54d77dc67f56 100644 --- a/tests/integration/staking/keeper/grpc_query_test.go +++ b/tests/integration/staking/keeper/grpc_query_test.go @@ -5,9 +5,10 @@ import ( "fmt" "testing" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "gotest.tools/v3/assert" - cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + "cosmossdk.io/math" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" @@ -26,8 +27,8 @@ func createValidatorAccs(t *testing.T, f *fixture) ([]sdk.AccAddress, []types.Va // have its order changed sortedVals := make([]types.Validator, len(validators)) copy(sortedVals, validators) - hi := types.NewHistoricalInfo(header, sortedVals, f.stakingKeeper.PowerReduction(f.sdkCtx)) - f.stakingKeeper.SetHistoricalInfo(f.sdkCtx, 5, &hi) + hi := types.NewHistoricalInfo(header, types.Validators{Validators: sortedVals}, f.stakingKeeper.PowerReduction(f.sdkCtx)) + assert.NilError(t, f.stakingKeeper.SetHistoricalInfo(f.sdkCtx, 5, &hi)) return addrs, validators } @@ -126,8 +127,10 @@ func TestGRPCQueryDelegatorValidators(t *testing.T) { qr := f.app.QueryHelper() queryClient := types.NewQueryClient(qr) - params := f.stakingKeeper.GetParams(ctx) - delValidators := f.stakingKeeper.GetDelegatorValidators(ctx, addrs[0], params.MaxValidators) + params, err := f.stakingKeeper.GetParams(ctx) + assert.NilError(t, err) + delValidators, err := f.stakingKeeper.GetDelegatorValidators(ctx, addrs[0], params.MaxValidators) + assert.NilError(t, err) var req *types.QueryDelegatorValidatorsRequest testCases := []struct { msg string @@ -175,7 +178,7 @@ func TestGRPCQueryDelegatorValidators(t *testing.T) { assert.NilError(t, err) assert.Equal(t, 1, len(res.Validators)) assert.Assert(t, res.Pagination.NextKey != nil) - assert.Equal(t, uint64(len(delValidators)), res.Pagination.Total) + assert.Equal(t, uint64(len(delValidators.Validators)), res.Pagination.Total) } else { assert.ErrorContains(t, err, tc.expErrMsg) assert.Assert(t, res == nil) @@ -516,7 +519,7 @@ func TestGRPCQueryUnbondingDelegation(t *testing.T) { unbondingTokens := f.stakingKeeper.TokensFromConsensusPower(ctx, 2) valAddr, err1 := sdk.ValAddressFromBech32(addrVal2) assert.NilError(t, err1) - _, _, err := f.stakingKeeper.Undelegate(ctx, addrAcc2, valAddr, sdk.NewDecFromInt(unbondingTokens)) + _, _, err := f.stakingKeeper.Undelegate(ctx, addrAcc2, valAddr, math.LegacyNewDecFromInt(unbondingTokens)) assert.NilError(t, err) unbond, found := f.stakingKeeper.GetUnbondingDelegation(ctx, addrAcc2, valAddr) @@ -564,7 +567,7 @@ func TestGRPCQueryUnbondingDelegation(t *testing.T) { } }, false, - "invalid Bech32", + "hrp does not match bech32 prefix", }, { "delegation not found for validator", @@ -619,11 +622,11 @@ func TestGRPCQueryDelegatorUnbondingDelegations(t *testing.T) { unbondingTokens := f.stakingKeeper.TokensFromConsensusPower(ctx, 2) valAddr1, err1 := sdk.ValAddressFromBech32(addrVal) assert.NilError(t, err1) - _, _, err := f.stakingKeeper.Undelegate(ctx, addrAcc, valAddr1, sdk.NewDecFromInt(unbondingTokens)) + _, _, err := f.stakingKeeper.Undelegate(ctx, addrAcc, valAddr1, math.LegacyNewDecFromInt(unbondingTokens)) assert.NilError(t, err) valAddr2, err1 := sdk.ValAddressFromBech32(addrVal2) assert.NilError(t, err1) - _, _, err = f.stakingKeeper.Undelegate(ctx, addrAcc, valAddr2, sdk.NewDecFromInt(unbondingTokens)) + _, _, err = f.stakingKeeper.Undelegate(ctx, addrAcc, valAddr2, math.LegacyNewDecFromInt(unbondingTokens)) assert.NilError(t, err) unbond, found := f.stakingKeeper.GetUnbondingDelegation(ctx, addrAcc, valAddr1) @@ -712,7 +715,9 @@ func TestGRPCQueryPoolParameters(t *testing.T) { // Query Params resp, err := queryClient.Params(gocontext.Background(), &types.QueryParamsRequest{}) assert.NilError(t, err) - assert.DeepEqual(t, f.stakingKeeper.GetParams(ctx), resp.Params) + params, err := f.stakingKeeper.GetParams(ctx) + assert.NilError(t, err) + assert.DeepEqual(t, params, resp.Params) } func TestGRPCQueryHistoricalInfo(t *testing.T) { @@ -804,11 +809,16 @@ func TestGRPCQueryRedelegations(t *testing.T) { applyValidatorSetUpdates(t, ctx, f.stakingKeeper, -1) rdAmount := f.stakingKeeper.TokensFromConsensusPower(ctx, 1) - _, err = f.stakingKeeper.BeginRedelegation(ctx, addrAcc1, val1.GetOperator(), val2.GetOperator(), sdk.NewDecFromInt(rdAmount)) + val1bz, err := f.stakingKeeper.ValidatorAddressCodec().StringToBytes(val1.GetOperator()) + assert.NilError(t, err) + val2bz, err := f.stakingKeeper.ValidatorAddressCodec().StringToBytes(val2.GetOperator()) + assert.NilError(t, err) + + _, err = f.stakingKeeper.BeginRedelegation(ctx, addrAcc1, val1bz, val2bz, math.LegacyNewDecFromInt(rdAmount)) assert.NilError(t, err) applyValidatorSetUpdates(t, ctx, f.stakingKeeper, -1) - redel, found := f.stakingKeeper.GetRedelegation(ctx, addrAcc1, val1.GetOperator(), val2.GetOperator()) + redel, found := f.stakingKeeper.GetRedelegation(ctx, addrAcc1, val1bz, val2bz) assert.Assert(t, found) var req *types.QueryRedelegationsRequest @@ -869,7 +879,7 @@ func TestGRPCQueryRedelegations(t *testing.T) { "query redelegations with sourceValAddr only", func() { req = &types.QueryRedelegationsRequest{ - SrcValidatorAddr: val1.GetOperator().String(), + SrcValidatorAddr: val1.GetOperator(), Pagination: &query.PageRequest{Limit: 1, CountTotal: true}, } }, @@ -917,7 +927,9 @@ func TestGRPCQueryValidatorUnbondingDelegations(t *testing.T) { // undelegate undelAmount := f.stakingKeeper.TokensFromConsensusPower(ctx, 2) - _, _, err := f.stakingKeeper.Undelegate(ctx, addrAcc1, val1.GetOperator(), sdk.NewDecFromInt(undelAmount)) + valbz, err := f.stakingKeeper.ValidatorAddressCodec().StringToBytes(val1.GetOperator()) + assert.NilError(t, err) + _, _, err = f.stakingKeeper.Undelegate(ctx, addrAcc1, valbz, math.LegacyNewDecFromInt(undelAmount)) assert.NilError(t, err) applyValidatorSetUpdates(t, ctx, f.stakingKeeper, -1) @@ -951,7 +963,7 @@ func TestGRPCQueryValidatorUnbondingDelegations(t *testing.T) { "valid request", func() { req = &types.QueryValidatorUnbondingDelegationsRequest{ - ValidatorAddr: val1.GetOperator().String(), + ValidatorAddr: val1.GetOperator(), Pagination: &query.PageRequest{Limit: 1, CountTotal: true}, } }, diff --git a/tests/integration/staking/keeper/msg_server_test.go b/tests/integration/staking/keeper/msg_server_test.go index 9c08804f577c..f84c305795dc 100644 --- a/tests/integration/staking/keeper/msg_server_test.go +++ b/tests/integration/staking/keeper/msg_server_test.go @@ -6,6 +6,9 @@ import ( "gotest.tools/v3/assert" + "cosmossdk.io/math" + + "github.com/cosmos/cosmos-sdk/codec/address" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/bank/testutil" @@ -19,43 +22,45 @@ func TestCancelUnbondingDelegation(t *testing.T) { ctx := f.sdkCtx msgServer := keeper.NewMsgServerImpl(f.stakingKeeper) - bondDenom := f.stakingKeeper.BondDenom(ctx) + bondDenom, err := f.stakingKeeper.BondDenom(ctx) + assert.NilError(t, err) // set the not bonded pool module account notBondedPool := f.stakingKeeper.GetNotBondedPool(ctx) startTokens := f.stakingKeeper.TokensFromConsensusPower(ctx, 5) - assert.NilError(t, testutil.FundModuleAccount(ctx, f.bankKeeper, notBondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(f.stakingKeeper.BondDenom(ctx), startTokens)))) + assert.NilError(t, testutil.FundModuleAccount(ctx, f.bankKeeper, notBondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(bondDenom, startTokens)))) f.accountKeeper.SetModuleAccount(ctx, notBondedPool) - moduleBalance := f.bankKeeper.GetBalance(ctx, notBondedPool.GetAddress(), f.stakingKeeper.BondDenom(ctx)) + moduleBalance := f.bankKeeper.GetBalance(ctx, notBondedPool.GetAddress(), bondDenom) assert.DeepEqual(t, sdk.NewInt64Coin(bondDenom, startTokens.Int64()), moduleBalance) // accounts - addrs := simtestutil.AddTestAddrsIncremental(f.bankKeeper, f.stakingKeeper, ctx, 2, sdk.NewInt(10000)) + addrs := simtestutil.AddTestAddrsIncremental(f.bankKeeper, f.stakingKeeper, ctx, 2, math.NewInt(10000)) valAddr := sdk.ValAddress(addrs[0]) delegatorAddr := addrs[1] // setup a new validator with bonded status - validator, err := types.NewValidator(valAddr, PKs[0], types.NewDescription("Validator", "", "", "", "")) + validator, err := types.NewValidator(valAddr.String(), PKs[0], types.NewDescription("Validator", "", "", "", "")) validator.Status = types.Bonded assert.NilError(t, err) - f.stakingKeeper.SetValidator(ctx, validator) + assert.NilError(t, f.stakingKeeper.SetValidator(ctx, validator)) validatorAddr, err := sdk.ValAddressFromBech32(validator.OperatorAddress) assert.NilError(t, err) // setting the ubd entry - unbondingAmount := sdk.NewInt64Coin(f.stakingKeeper.BondDenom(ctx), 5) + unbondingAmount := sdk.NewInt64Coin(bondDenom, 5) ubd := types.NewUnbondingDelegation( delegatorAddr, validatorAddr, 10, ctx.BlockTime().Add(time.Minute*10), unbondingAmount.Amount, 0, + address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmos"), ) // set and retrieve a record - f.stakingKeeper.SetUnbondingDelegation(ctx, ubd) + assert.NilError(t, f.stakingKeeper.SetUnbondingDelegation(ctx, ubd)) resUnbond, found := f.stakingKeeper.GetUnbondingDelegation(ctx, delegatorAddr, validatorAddr) assert.Assert(t, found) assert.DeepEqual(t, ubd, resUnbond) @@ -72,7 +77,7 @@ func TestCancelUnbondingDelegation(t *testing.T) { req: types.MsgCancelUnbondingDelegation{ DelegatorAddress: resUnbond.DelegatorAddress, ValidatorAddress: resUnbond.ValidatorAddress, - Amount: sdk.NewCoin(f.stakingKeeper.BondDenom(ctx), sdk.NewInt(4)), + Amount: sdk.NewCoin(bondDenom, math.NewInt(4)), CreationHeight: 11, }, expErrMsg: "unbonding delegation entry is not found at block height", @@ -83,7 +88,7 @@ func TestCancelUnbondingDelegation(t *testing.T) { req: types.MsgCancelUnbondingDelegation{ DelegatorAddress: resUnbond.DelegatorAddress, ValidatorAddress: resUnbond.ValidatorAddress, - Amount: sdk.NewCoin(f.stakingKeeper.BondDenom(ctx), sdk.NewInt(4)), + Amount: sdk.NewCoin(bondDenom, math.NewInt(4)), CreationHeight: 0, }, expErrMsg: "invalid height", @@ -94,7 +99,7 @@ func TestCancelUnbondingDelegation(t *testing.T) { req: types.MsgCancelUnbondingDelegation{ DelegatorAddress: resUnbond.DelegatorAddress, ValidatorAddress: resUnbond.ValidatorAddress, - Amount: sdk.NewCoin("dump_coin", sdk.NewInt(4)), + Amount: sdk.NewCoin("dump_coin", math.NewInt(4)), CreationHeight: 10, }, expErrMsg: "invalid coin denomination", diff --git a/tests/integration/staking/keeper/slash_test.go b/tests/integration/staking/keeper/slash_test.go index 6beea0b0b3e9..9397814b1a72 100644 --- a/tests/integration/staking/keeper/slash_test.go +++ b/tests/integration/staking/keeper/slash_test.go @@ -4,11 +4,13 @@ import ( "testing" "time" - "cosmossdk.io/math" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" "gotest.tools/v3/assert" + "cosmossdk.io/math" + + "github.com/cosmos/cosmos-sdk/codec/address" sdk "github.com/cosmos/cosmos-sdk/types" banktestutil "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/staking/keeper" @@ -24,7 +26,9 @@ func bootstrapSlashTest(t *testing.T, power int64) (*fixture, []sdk.AccAddress, addrDels, addrVals := generateAddresses(f, 100) amt := f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, power) - totalSupply := sdk.NewCoins(sdk.NewCoin(f.stakingKeeper.BondDenom(f.sdkCtx), amt.MulRaw(int64(len(addrDels))))) + bondDenom, err := f.stakingKeeper.BondDenom(f.sdkCtx) + require.NoError(t, err) + totalSupply := sdk.NewCoins(sdk.NewCoin(bondDenom, amt.MulRaw(int64(len(addrDels))))) notBondedPool := f.stakingKeeper.GetNotBondedPool(f.sdkCtx) assert.NilError(t, banktestutil.FundModuleAccount(f.sdkCtx, f.bankKeeper, notBondedPool.GetName(), totalSupply)) @@ -32,7 +36,7 @@ func bootstrapSlashTest(t *testing.T, power int64) (*fixture, []sdk.AccAddress, f.accountKeeper.SetModuleAccount(f.sdkCtx, notBondedPool) numVals := int64(3) - bondedCoins := sdk.NewCoins(sdk.NewCoin(f.stakingKeeper.BondDenom(f.sdkCtx), amt.MulRaw(numVals))) + bondedCoins := sdk.NewCoins(sdk.NewCoin(bondDenom, amt.MulRaw(numVals))) bondedPool := f.stakingKeeper.GetBondedPool(f.sdkCtx) // set bonded pool balance @@ -43,7 +47,7 @@ func bootstrapSlashTest(t *testing.T, power int64) (*fixture, []sdk.AccAddress, validator := testutil.NewValidator(t, addrVals[i], PKs[i]) validator, _ = validator.AddTokensFromDel(amt) validator = keeper.TestingUpdateValidator(f.stakingKeeper, f.sdkCtx, validator, true) - f.stakingKeeper.SetValidatorByConsAddr(f.sdkCtx, validator) + assert.NilError(t, f.stakingKeeper.SetValidatorByConsAddr(f.sdkCtx, validator)) } return f, addrDels, addrVals @@ -53,53 +57,61 @@ func bootstrapSlashTest(t *testing.T, power int64) (*fixture, []sdk.AccAddress, func TestSlashUnbondingDelegation(t *testing.T) { f, addrDels, addrVals := bootstrapSlashTest(t, 10) - fraction := sdk.NewDecWithPrec(5, 1) + fraction := math.LegacyNewDecWithPrec(5, 1) // set an unbonding delegation with expiration timestamp (beyond which the // unbonding delegation shouldn't be slashed) ubd := types.NewUnbondingDelegation(addrDels[0], addrVals[0], 0, - time.Unix(5, 0), sdk.NewInt(10), 0) + time.Unix(5, 0), math.NewInt(10), 0, address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmos")) - f.stakingKeeper.SetUnbondingDelegation(f.sdkCtx, ubd) + assert.NilError(t, f.stakingKeeper.SetUnbondingDelegation(f.sdkCtx, ubd)) // unbonding started prior to the infraction height, stakw didn't contribute - slashAmount := f.stakingKeeper.SlashUnbondingDelegation(f.sdkCtx, ubd, 1, fraction) - assert.Assert(t, slashAmount.Equal(sdk.NewInt(0))) + slashAmount, err := f.stakingKeeper.SlashUnbondingDelegation(f.sdkCtx, ubd, 1, fraction) + assert.NilError(t, err) + assert.Assert(t, slashAmount.Equal(math.NewInt(0))) // after the expiration time, no longer eligible for slashing f.sdkCtx = f.sdkCtx.WithBlockHeader(cmtproto.Header{Time: time.Unix(10, 0)}) - f.stakingKeeper.SetUnbondingDelegation(f.sdkCtx, ubd) - slashAmount = f.stakingKeeper.SlashUnbondingDelegation(f.sdkCtx, ubd, 0, fraction) - assert.Assert(t, slashAmount.Equal(sdk.NewInt(0))) + assert.NilError(t, f.stakingKeeper.SetUnbondingDelegation(f.sdkCtx, ubd)) + slashAmount, err = f.stakingKeeper.SlashUnbondingDelegation(f.sdkCtx, ubd, 0, fraction) + assert.NilError(t, err) + assert.Assert(t, slashAmount.Equal(math.NewInt(0))) // test valid slash, before expiration timestamp and to which stake contributed notBondedPool := f.stakingKeeper.GetNotBondedPool(f.sdkCtx) oldUnbondedPoolBalances := f.bankKeeper.GetAllBalances(f.sdkCtx, notBondedPool.GetAddress()) f.sdkCtx = f.sdkCtx.WithBlockHeader(cmtproto.Header{Time: time.Unix(0, 0)}) - f.stakingKeeper.SetUnbondingDelegation(f.sdkCtx, ubd) - slashAmount = f.stakingKeeper.SlashUnbondingDelegation(f.sdkCtx, ubd, 0, fraction) - assert.Assert(t, slashAmount.Equal(sdk.NewInt(5))) + assert.NilError(t, f.stakingKeeper.SetUnbondingDelegation(f.sdkCtx, ubd)) + slashAmount, err = f.stakingKeeper.SlashUnbondingDelegation(f.sdkCtx, ubd, 0, fraction) + assert.NilError(t, err) + assert.Assert(t, slashAmount.Equal(math.NewInt(5))) ubd, found := f.stakingKeeper.GetUnbondingDelegation(f.sdkCtx, addrDels[0], addrVals[0]) assert.Assert(t, found) assert.Assert(t, len(ubd.Entries) == 1) // initial balance unchanged - assert.DeepEqual(t, sdk.NewInt(10), ubd.Entries[0].InitialBalance) + assert.DeepEqual(t, math.NewInt(10), ubd.Entries[0].InitialBalance) // balance decreased - assert.DeepEqual(t, sdk.NewInt(5), ubd.Entries[0].Balance) + assert.DeepEqual(t, math.NewInt(5), ubd.Entries[0].Balance) newUnbondedPoolBalances := f.bankKeeper.GetAllBalances(f.sdkCtx, notBondedPool.GetAddress()) diffTokens := oldUnbondedPoolBalances.Sub(newUnbondedPoolBalances...) - assert.Assert(t, diffTokens.AmountOf(f.stakingKeeper.BondDenom(f.sdkCtx)).Equal(sdk.NewInt(5))) + bondDenom, err := f.stakingKeeper.BondDenom(f.sdkCtx) + assert.NilError(t, err) + assert.Assert(t, diffTokens.AmountOf(bondDenom).Equal(math.NewInt(5))) } // tests slashRedelegation func TestSlashRedelegation(t *testing.T) { f, addrDels, addrVals := bootstrapSlashTest(t, 10) - fraction := sdk.NewDecWithPrec(5, 1) + fraction := math.LegacyNewDecWithPrec(5, 1) + + bondDenom, err := f.stakingKeeper.BondDenom(f.sdkCtx) + assert.NilError(t, err) // add bonded tokens to pool for (re)delegations - startCoins := sdk.NewCoins(sdk.NewInt64Coin(f.stakingKeeper.BondDenom(f.sdkCtx), 15)) + startCoins := sdk.NewCoins(sdk.NewInt64Coin(bondDenom, 15)) bondedPool := f.stakingKeeper.GetBondedPool(f.sdkCtx) _ = f.bankKeeper.GetAllBalances(f.sdkCtx, bondedPool.GetAddress()) @@ -109,37 +121,40 @@ func TestSlashRedelegation(t *testing.T) { // set a redelegation with an expiration timestamp beyond which the // redelegation shouldn't be slashed rd := types.NewRedelegation(addrDels[0], addrVals[0], addrVals[1], 0, - time.Unix(5, 0), sdk.NewInt(10), math.LegacyNewDec(10), 0) + time.Unix(5, 0), math.NewInt(10), math.LegacyNewDec(10), 0, address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmos")) - f.stakingKeeper.SetRedelegation(f.sdkCtx, rd) + assert.NilError(t, f.stakingKeeper.SetRedelegation(f.sdkCtx, rd)) // set the associated delegation - del := types.NewDelegation(addrDels[0], addrVals[1], math.LegacyNewDec(10)) - f.stakingKeeper.SetDelegation(f.sdkCtx, del) + del := types.NewDelegation(addrDels[0].String(), addrVals[1].String(), math.LegacyNewDec(10)) + assert.NilError(t, f.stakingKeeper.SetDelegation(f.sdkCtx, del)) // started redelegating prior to the current height, stake didn't contribute to infraction validator, found := f.stakingKeeper.GetValidator(f.sdkCtx, addrVals[1]) assert.Assert(t, found) - slashAmount := f.stakingKeeper.SlashRedelegation(f.sdkCtx, validator, rd, 1, fraction) - assert.Assert(t, slashAmount.Equal(sdk.NewInt(0))) + slashAmount, err := f.stakingKeeper.SlashRedelegation(f.sdkCtx, validator, rd, 1, fraction) + assert.NilError(t, err) + assert.Assert(t, slashAmount.Equal(math.NewInt(0))) // after the expiration time, no longer eligible for slashing f.sdkCtx = f.sdkCtx.WithBlockHeader(cmtproto.Header{Time: time.Unix(10, 0)}) - f.stakingKeeper.SetRedelegation(f.sdkCtx, rd) + assert.NilError(t, f.stakingKeeper.SetRedelegation(f.sdkCtx, rd)) validator, found = f.stakingKeeper.GetValidator(f.sdkCtx, addrVals[1]) assert.Assert(t, found) - slashAmount = f.stakingKeeper.SlashRedelegation(f.sdkCtx, validator, rd, 0, fraction) - assert.Assert(t, slashAmount.Equal(sdk.NewInt(0))) + slashAmount, err = f.stakingKeeper.SlashRedelegation(f.sdkCtx, validator, rd, 0, fraction) + assert.NilError(t, err) + assert.Assert(t, slashAmount.Equal(math.NewInt(0))) balances := f.bankKeeper.GetAllBalances(f.sdkCtx, bondedPool.GetAddress()) // test valid slash, before expiration timestamp and to which stake contributed f.sdkCtx = f.sdkCtx.WithBlockHeader(cmtproto.Header{Time: time.Unix(0, 0)}) - f.stakingKeeper.SetRedelegation(f.sdkCtx, rd) + assert.NilError(t, f.stakingKeeper.SetRedelegation(f.sdkCtx, rd)) validator, found = f.stakingKeeper.GetValidator(f.sdkCtx, addrVals[1]) assert.Assert(t, found) - slashAmount = f.stakingKeeper.SlashRedelegation(f.sdkCtx, validator, rd, 0, fraction) - assert.Assert(t, slashAmount.Equal(sdk.NewInt(5))) + slashAmount, err = f.stakingKeeper.SlashRedelegation(f.sdkCtx, validator, rd, 0, fraction) + assert.NilError(t, err) + assert.Assert(t, slashAmount.Equal(math.NewInt(5))) rd, found = f.stakingKeeper.GetRedelegation(f.sdkCtx, addrDels[0], addrVals[0], addrVals[1]) assert.Assert(t, found) assert.Assert(t, len(rd.Entries) == 1) @@ -148,7 +163,7 @@ func TestSlashRedelegation(t *testing.T) { applyValidatorSetUpdates(t, f.sdkCtx, f.stakingKeeper, 1) // initialbalance unchanged - assert.DeepEqual(t, sdk.NewInt(10), rd.Entries[0].InitialBalance) + assert.DeepEqual(t, math.NewInt(10), rd.Entries[0].InitialBalance) // shares decreased del, found = f.stakingKeeper.GetDelegation(f.sdkCtx, addrDels[0], addrVals[1]) @@ -156,7 +171,7 @@ func TestSlashRedelegation(t *testing.T) { assert.Equal(t, int64(5), del.Shares.RoundInt64()) // pool bonded tokens should decrease - burnedCoins := sdk.NewCoins(sdk.NewCoin(f.stakingKeeper.BondDenom(f.sdkCtx), slashAmount)) + burnedCoins := sdk.NewCoins(sdk.NewCoin(bondDenom, slashAmount)) assert.DeepEqual(t, balances.Sub(burnedCoins...), f.bankKeeper.GetAllBalances(f.sdkCtx, bondedPool.GetAddress())) } @@ -165,14 +180,15 @@ func TestSlashRedelegation(t *testing.T) { func TestSlashAtNegativeHeight(t *testing.T) { f, _, _ := bootstrapSlashTest(t, 10) consAddr := sdk.ConsAddress(PKs[0].Address()) - fraction := sdk.NewDecWithPrec(5, 1) + fraction := math.LegacyNewDecWithPrec(5, 1) bondedPool := f.stakingKeeper.GetBondedPool(f.sdkCtx) oldBondedPoolBalances := f.bankKeeper.GetAllBalances(f.sdkCtx, bondedPool.GetAddress()) _, found := f.stakingKeeper.GetValidatorByConsAddr(f.sdkCtx, consAddr) assert.Assert(t, found) - f.stakingKeeper.Slash(f.sdkCtx, consAddr, -2, 10, fraction) + _, err := f.stakingKeeper.Slash(f.sdkCtx, consAddr, -2, 10, fraction) + assert.NilError(t, err) // read updated state validator, found := f.stakingKeeper.GetValidatorByConsAddr(f.sdkCtx, consAddr) @@ -181,14 +197,20 @@ func TestSlashAtNegativeHeight(t *testing.T) { // end block applyValidatorSetUpdates(t, f.sdkCtx, f.stakingKeeper, 1) - validator, found = f.stakingKeeper.GetValidator(f.sdkCtx, validator.GetOperator()) + valbz, err := f.stakingKeeper.ValidatorAddressCodec().StringToBytes(validator.GetOperator()) + assert.NilError(t, err) + + validator, found = f.stakingKeeper.GetValidator(f.sdkCtx, valbz) assert.Assert(t, found) // power decreased assert.Equal(t, int64(5), validator.GetConsensusPower(f.stakingKeeper.PowerReduction(f.sdkCtx))) + bondDenom, err := f.stakingKeeper.BondDenom(f.sdkCtx) + assert.NilError(t, err) + // pool bonded shares decreased newBondedPoolBalances := f.bankKeeper.GetAllBalances(f.sdkCtx, bondedPool.GetAddress()) - diffTokens := oldBondedPoolBalances.Sub(newBondedPoolBalances...).AmountOf(f.stakingKeeper.BondDenom(f.sdkCtx)) + diffTokens := oldBondedPoolBalances.Sub(newBondedPoolBalances...).AmountOf(bondDenom) assert.DeepEqual(t, f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, 5).String(), diffTokens.String()) } @@ -196,14 +218,18 @@ func TestSlashAtNegativeHeight(t *testing.T) { func TestSlashValidatorAtCurrentHeight(t *testing.T) { f, _, _ := bootstrapSlashTest(t, 10) consAddr := sdk.ConsAddress(PKs[0].Address()) - fraction := sdk.NewDecWithPrec(5, 1) + fraction := math.LegacyNewDecWithPrec(5, 1) + + bondDenom, err := f.stakingKeeper.BondDenom(f.sdkCtx) + assert.NilError(t, err) bondedPool := f.stakingKeeper.GetBondedPool(f.sdkCtx) oldBondedPoolBalances := f.bankKeeper.GetAllBalances(f.sdkCtx, bondedPool.GetAddress()) _, found := f.stakingKeeper.GetValidatorByConsAddr(f.sdkCtx, consAddr) assert.Assert(t, found) - f.stakingKeeper.Slash(f.sdkCtx, consAddr, f.sdkCtx.BlockHeight(), 10, fraction) + _, err = f.stakingKeeper.Slash(f.sdkCtx, consAddr, f.sdkCtx.BlockHeight(), 10, fraction) + assert.NilError(t, err) // read updated state validator, found := f.stakingKeeper.GetValidatorByConsAddr(f.sdkCtx, consAddr) @@ -212,14 +238,17 @@ func TestSlashValidatorAtCurrentHeight(t *testing.T) { // end block applyValidatorSetUpdates(t, f.sdkCtx, f.stakingKeeper, 1) - validator, found = f.stakingKeeper.GetValidator(f.sdkCtx, validator.GetOperator()) + valbz, err := f.stakingKeeper.ValidatorAddressCodec().StringToBytes(validator.GetOperator()) + assert.NilError(t, err) + + validator, found = f.stakingKeeper.GetValidator(f.sdkCtx, valbz) assert.Assert(t, found) // power decreased assert.Equal(t, int64(5), validator.GetConsensusPower(f.stakingKeeper.PowerReduction(f.sdkCtx))) // pool bonded shares decreased newBondedPoolBalances := f.bankKeeper.GetAllBalances(f.sdkCtx, bondedPool.GetAddress()) - diffTokens := oldBondedPoolBalances.Sub(newBondedPoolBalances...).AmountOf(f.stakingKeeper.BondDenom(f.sdkCtx)) + diffTokens := oldBondedPoolBalances.Sub(newBondedPoolBalances...).AmountOf(bondDenom) assert.DeepEqual(t, f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, 5).String(), diffTokens.String()) } @@ -228,13 +257,16 @@ func TestSlashWithUnbondingDelegation(t *testing.T) { f, addrDels, addrVals := bootstrapSlashTest(t, 10) consAddr := sdk.ConsAddress(PKs[0].Address()) - fraction := sdk.NewDecWithPrec(5, 1) + fraction := math.LegacyNewDecWithPrec(5, 1) + + bondDenom, err := f.stakingKeeper.BondDenom(f.sdkCtx) + assert.NilError(t, err) // set an unbonding delegation with expiration timestamp beyond which the // unbonding delegation shouldn't be slashed ubdTokens := f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, 4) - ubd := types.NewUnbondingDelegation(addrDels[0], addrVals[0], 11, time.Unix(0, 0), ubdTokens, 0) - f.stakingKeeper.SetUnbondingDelegation(f.sdkCtx, ubd) + ubd := types.NewUnbondingDelegation(addrDels[0], addrVals[0], 11, time.Unix(0, 0), ubdTokens, 0, address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmos")) + assert.NilError(t, f.stakingKeeper.SetUnbondingDelegation(f.sdkCtx, ubd)) // slash validator for the first time f.sdkCtx = f.sdkCtx.WithBlockHeight(12) @@ -243,7 +275,8 @@ func TestSlashWithUnbondingDelegation(t *testing.T) { _, found := f.stakingKeeper.GetValidatorByConsAddr(f.sdkCtx, consAddr) assert.Assert(t, found) - f.stakingKeeper.Slash(f.sdkCtx, consAddr, 10, 10, fraction) + _, err = f.stakingKeeper.Slash(f.sdkCtx, consAddr, 10, 10, fraction) + assert.NilError(t, err) // end block applyValidatorSetUpdates(t, f.sdkCtx, f.stakingKeeper, 1) @@ -258,7 +291,7 @@ func TestSlashWithUnbondingDelegation(t *testing.T) { // bonded tokens burned newBondedPoolBalances := f.bankKeeper.GetAllBalances(f.sdkCtx, bondedPool.GetAddress()) - diffTokens := oldBondedPoolBalances.Sub(newBondedPoolBalances...).AmountOf(f.stakingKeeper.BondDenom(f.sdkCtx)) + diffTokens := oldBondedPoolBalances.Sub(newBondedPoolBalances...).AmountOf(bondDenom) assert.DeepEqual(t, f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, 3), diffTokens) // read updated validator @@ -273,18 +306,19 @@ func TestSlashWithUnbondingDelegation(t *testing.T) { // slash validator again f.sdkCtx = f.sdkCtx.WithBlockHeight(13) - f.stakingKeeper.Slash(f.sdkCtx, consAddr, 9, 10, fraction) + _, err = f.stakingKeeper.Slash(f.sdkCtx, consAddr, 9, 10, fraction) + assert.NilError(t, err) ubd, found = f.stakingKeeper.GetUnbondingDelegation(f.sdkCtx, addrDels[0], addrVals[0]) assert.Assert(t, found) assert.Assert(t, len(ubd.Entries) == 1) // balance decreased again - assert.DeepEqual(t, sdk.NewInt(0), ubd.Entries[0].Balance) + assert.DeepEqual(t, math.NewInt(0), ubd.Entries[0].Balance) // bonded tokens burned again newBondedPoolBalances = f.bankKeeper.GetAllBalances(f.sdkCtx, bondedPool.GetAddress()) - diffTokens = oldBondedPoolBalances.Sub(newBondedPoolBalances...).AmountOf(f.stakingKeeper.BondDenom(f.sdkCtx)) + diffTokens = oldBondedPoolBalances.Sub(newBondedPoolBalances...).AmountOf(bondDenom) assert.DeepEqual(t, f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, 6), diffTokens) // read updated validator @@ -299,18 +333,19 @@ func TestSlashWithUnbondingDelegation(t *testing.T) { // on the unbonding delegation, but it will slash stake bonded since the infraction // this may not be the desirable behavior, ref https://github.com/cosmos/cosmos-sdk/issues/1440 f.sdkCtx = f.sdkCtx.WithBlockHeight(13) - f.stakingKeeper.Slash(f.sdkCtx, consAddr, 9, 10, fraction) + _, err = f.stakingKeeper.Slash(f.sdkCtx, consAddr, 9, 10, fraction) + assert.NilError(t, err) ubd, found = f.stakingKeeper.GetUnbondingDelegation(f.sdkCtx, addrDels[0], addrVals[0]) assert.Assert(t, found) assert.Assert(t, len(ubd.Entries) == 1) // balance unchanged - assert.DeepEqual(t, sdk.NewInt(0), ubd.Entries[0].Balance) + assert.DeepEqual(t, math.NewInt(0), ubd.Entries[0].Balance) // bonded tokens burned again newBondedPoolBalances = f.bankKeeper.GetAllBalances(f.sdkCtx, bondedPool.GetAddress()) - diffTokens = oldBondedPoolBalances.Sub(newBondedPoolBalances...).AmountOf(f.stakingKeeper.BondDenom(f.sdkCtx)) + diffTokens = oldBondedPoolBalances.Sub(newBondedPoolBalances...).AmountOf(bondDenom) assert.DeepEqual(t, f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, 9), diffTokens) // read updated validator @@ -325,18 +360,19 @@ func TestSlashWithUnbondingDelegation(t *testing.T) { // on the unbonding delegation, but it will slash stake bonded since the infraction // this may not be the desirable behavior, ref https://github.com/cosmos/cosmos-sdk/issues/1440 f.sdkCtx = f.sdkCtx.WithBlockHeight(13) - f.stakingKeeper.Slash(f.sdkCtx, consAddr, 9, 10, fraction) + _, err = f.stakingKeeper.Slash(f.sdkCtx, consAddr, 9, 10, fraction) + assert.NilError(t, err) ubd, found = f.stakingKeeper.GetUnbondingDelegation(f.sdkCtx, addrDels[0], addrVals[0]) assert.Assert(t, found) assert.Assert(t, len(ubd.Entries) == 1) // balance unchanged - assert.DeepEqual(t, sdk.NewInt(0), ubd.Entries[0].Balance) + assert.DeepEqual(t, math.NewInt(0), ubd.Entries[0].Balance) // just 1 bonded token burned again since that's all the validator now has newBondedPoolBalances = f.bankKeeper.GetAllBalances(f.sdkCtx, bondedPool.GetAddress()) - diffTokens = oldBondedPoolBalances.Sub(newBondedPoolBalances...).AmountOf(f.stakingKeeper.BondDenom(f.sdkCtx)) + diffTokens = oldBondedPoolBalances.Sub(newBondedPoolBalances...).AmountOf(bondDenom) assert.DeepEqual(t, f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, 10), diffTokens) // apply TM updates @@ -353,17 +389,18 @@ func TestSlashWithUnbondingDelegation(t *testing.T) { func TestSlashWithRedelegation(t *testing.T) { f, addrDels, addrVals := bootstrapSlashTest(t, 10) consAddr := sdk.ConsAddress(PKs[0].Address()) - fraction := sdk.NewDecWithPrec(5, 1) - bondDenom := f.stakingKeeper.BondDenom(f.sdkCtx) + fraction := math.LegacyNewDecWithPrec(5, 1) + bondDenom, err := f.stakingKeeper.BondDenom(f.sdkCtx) + assert.NilError(t, err) // set a redelegation rdTokens := f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, 6) - rd := types.NewRedelegation(addrDels[0], addrVals[0], addrVals[1], 11, time.Unix(0, 0), rdTokens, sdk.NewDecFromInt(rdTokens), 0) - f.stakingKeeper.SetRedelegation(f.sdkCtx, rd) + rd := types.NewRedelegation(addrDels[0], addrVals[0], addrVals[1], 11, time.Unix(0, 0), rdTokens, math.LegacyNewDecFromInt(rdTokens), 0, address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmos")) + assert.NilError(t, f.stakingKeeper.SetRedelegation(f.sdkCtx, rd)) // set the associated delegation - del := types.NewDelegation(addrDels[0], addrVals[1], sdk.NewDecFromInt(rdTokens)) - f.stakingKeeper.SetDelegation(f.sdkCtx, del) + del := types.NewDelegation(addrDels[0].String(), addrVals[1].String(), math.LegacyNewDecFromInt(rdTokens)) + assert.NilError(t, f.stakingKeeper.SetDelegation(f.sdkCtx, del)) // update bonded tokens bondedPool := f.stakingKeeper.GetBondedPool(f.sdkCtx) @@ -382,10 +419,10 @@ func TestSlashWithRedelegation(t *testing.T) { _, found := f.stakingKeeper.GetValidatorByConsAddr(f.sdkCtx, consAddr) assert.Assert(t, found) - require.NotPanics(t, func() { - f.stakingKeeper.Slash(f.sdkCtx, consAddr, 10, 10, fraction) - }) - burnAmount := sdk.NewDecFromInt(f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, 10)).Mul(fraction).TruncateInt() + _, err = f.stakingKeeper.Slash(f.sdkCtx, consAddr, 10, 10, fraction) + assert.NilError(t, err) + + burnAmount := math.LegacyNewDecFromInt(f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, 10)).Mul(fraction).TruncateInt() bondedPool = f.stakingKeeper.GetBondedPool(f.sdkCtx) notBondedPool = f.stakingKeeper.GetNotBondedPool(f.sdkCtx) @@ -415,9 +452,8 @@ func TestSlashWithRedelegation(t *testing.T) { _, found = f.stakingKeeper.GetValidatorByConsAddr(f.sdkCtx, consAddr) assert.Assert(t, found) - require.NotPanics(t, func() { - f.stakingKeeper.Slash(f.sdkCtx, consAddr, 10, 10, math.LegacyOneDec()) - }) + _, err = f.stakingKeeper.Slash(f.sdkCtx, consAddr, 10, 10, math.LegacyOneDec()) + assert.NilError(t, err) burnAmount = f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, 7) // read updated pool @@ -451,11 +487,10 @@ func TestSlashWithRedelegation(t *testing.T) { _, found = f.stakingKeeper.GetValidatorByConsAddr(f.sdkCtx, consAddr) assert.Assert(t, found) - require.NotPanics(t, func() { - f.stakingKeeper.Slash(f.sdkCtx, consAddr, 10, 10, math.LegacyOneDec()) - }) + _, err = f.stakingKeeper.Slash(f.sdkCtx, consAddr, 10, 10, math.LegacyOneDec()) + assert.NilError(t, err) - burnAmount = sdk.NewDecFromInt(f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, 10)).Mul(math.LegacyOneDec()).TruncateInt() + burnAmount = math.LegacyNewDecFromInt(f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, 10)).Mul(math.LegacyOneDec()).TruncateInt() burnAmount = burnAmount.Sub(math.LegacyOneDec().MulInt(rdTokens).TruncateInt()) // read updated pool @@ -486,9 +521,8 @@ func TestSlashWithRedelegation(t *testing.T) { validator, _ = f.stakingKeeper.GetValidatorByConsAddr(f.sdkCtx, consAddr) assert.Equal(t, validator.GetStatus(), types.Unbonding) - require.NotPanics(t, func() { - f.stakingKeeper.Slash(f.sdkCtx, consAddr, 10, 10, math.LegacyOneDec()) - }) + _, err = f.stakingKeeper.Slash(f.sdkCtx, consAddr, 10, 10, math.LegacyOneDec()) + assert.NilError(t, err) // read updated pool bondedPool = f.stakingKeeper.GetBondedPool(f.sdkCtx) @@ -512,25 +546,26 @@ func TestSlashWithRedelegation(t *testing.T) { // tests Slash at a previous height with both an unbonding delegation and a redelegation func TestSlashBoth(t *testing.T) { f, addrDels, addrVals := bootstrapSlashTest(t, 10) - fraction := sdk.NewDecWithPrec(5, 1) - bondDenom := f.stakingKeeper.BondDenom(f.sdkCtx) + fraction := math.LegacyNewDecWithPrec(5, 1) + bondDenom, err := f.stakingKeeper.BondDenom(f.sdkCtx) + assert.NilError(t, err) // set a redelegation with expiration timestamp beyond which the // redelegation shouldn't be slashed rdATokens := f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, 6) - rdA := types.NewRedelegation(addrDels[0], addrVals[0], addrVals[1], 11, time.Unix(0, 0), rdATokens, sdk.NewDecFromInt(rdATokens), 0) - f.stakingKeeper.SetRedelegation(f.sdkCtx, rdA) + rdA := types.NewRedelegation(addrDels[0], addrVals[0], addrVals[1], 11, time.Unix(0, 0), rdATokens, math.LegacyNewDecFromInt(rdATokens), 0, address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmos")) + assert.NilError(t, f.stakingKeeper.SetRedelegation(f.sdkCtx, rdA)) // set the associated delegation - delA := types.NewDelegation(addrDels[0], addrVals[1], sdk.NewDecFromInt(rdATokens)) - f.stakingKeeper.SetDelegation(f.sdkCtx, delA) + delA := types.NewDelegation(addrDels[0].String(), addrVals[1].String(), math.LegacyNewDecFromInt(rdATokens)) + assert.NilError(t, f.stakingKeeper.SetDelegation(f.sdkCtx, delA)) // set an unbonding delegation with expiration timestamp (beyond which the // unbonding delegation shouldn't be slashed) ubdATokens := f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, 4) ubdA := types.NewUnbondingDelegation(addrDels[0], addrVals[0], 11, - time.Unix(0, 0), ubdATokens, 0) - f.stakingKeeper.SetUnbondingDelegation(f.sdkCtx, ubdA) + time.Unix(0, 0), ubdATokens, 0, address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmos")) + assert.NilError(t, f.stakingKeeper.SetUnbondingDelegation(f.sdkCtx, ubdA)) bondedCoins := sdk.NewCoins(sdk.NewCoin(bondDenom, rdATokens.MulRaw(2))) notBondedCoins := sdk.NewCoins(sdk.NewCoin(bondDenom, ubdATokens)) @@ -552,10 +587,11 @@ func TestSlashBoth(t *testing.T) { _, found := f.stakingKeeper.GetValidatorByConsAddr(f.sdkCtx, sdk.GetConsAddress(PKs[0])) assert.Assert(t, found) consAddr0 := sdk.ConsAddress(PKs[0].Address()) - f.stakingKeeper.Slash(f.sdkCtx, consAddr0, 10, 10, fraction) + _, err = f.stakingKeeper.Slash(f.sdkCtx, consAddr0, 10, 10, fraction) + assert.NilError(t, err) burnedNotBondedAmount := fraction.MulInt(ubdATokens).TruncateInt() - burnedBondAmount := sdk.NewDecFromInt(f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, 10)).Mul(fraction).TruncateInt() + burnedBondAmount := math.LegacyNewDecFromInt(f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, 10)).Mul(fraction).TruncateInt() burnedBondAmount = burnedBondAmount.Sub(burnedNotBondedAmount) // read updated pool @@ -582,12 +618,14 @@ func TestSlashBoth(t *testing.T) { func TestSlashAmount(t *testing.T) { f, _, _ := bootstrapSlashTest(t, 10) consAddr := sdk.ConsAddress(PKs[0].Address()) - fraction := sdk.NewDecWithPrec(5, 1) - burnedCoins := f.stakingKeeper.Slash(f.sdkCtx, consAddr, f.sdkCtx.BlockHeight(), 10, fraction) + fraction := math.LegacyNewDecWithPrec(5, 1) + burnedCoins, err := f.stakingKeeper.Slash(f.sdkCtx, consAddr, f.sdkCtx.BlockHeight(), 10, fraction) + assert.NilError(t, err) assert.Assert(t, burnedCoins.GT(math.ZeroInt())) // test the case where the validator was not found, which should return no coins _, addrVals := generateAddresses(f, 100) - noBurned := f.stakingKeeper.Slash(f.sdkCtx, sdk.ConsAddress(addrVals[0]), f.sdkCtx.BlockHeight(), 10, fraction) - assert.Assert(t, sdk.NewInt(0).Equal(noBurned)) + noBurned, err := f.stakingKeeper.Slash(f.sdkCtx, sdk.ConsAddress(addrVals[0]), f.sdkCtx.BlockHeight(), 10, fraction) + assert.NilError(t, err) + assert.Assert(t, math.NewInt(0).Equal(noBurned)) } diff --git a/tests/integration/staking/keeper/unbonding_test.go b/tests/integration/staking/keeper/unbonding_test.go index b61fc93653ac..c3a43049cd79 100644 --- a/tests/integration/staking/keeper/unbonding_test.go +++ b/tests/integration/staking/keeper/unbonding_test.go @@ -4,10 +4,11 @@ import ( "testing" "time" - "cosmossdk.io/math" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" "gotest.tools/v3/assert" + "cosmossdk.io/math" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" banktestutil "github.com/cosmos/cosmos-sdk/x/bank/testutil" @@ -49,11 +50,11 @@ func SetupUnbondingTests(t *testing.T, f *fixture, hookCalled *bool, ubdeID *uin valTokens := f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, 10) startTokens := f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, 20) - bondDenom = f.stakingKeeper.BondDenom(f.sdkCtx) + bondDenom, err := f.stakingKeeper.BondDenom(f.sdkCtx) + assert.NilError(t, err) notBondedPool := f.stakingKeeper.GetNotBondedPool(f.sdkCtx) assert.NilError(t, banktestutil.FundModuleAccount(f.sdkCtx, f.bankKeeper, notBondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(bondDenom, startTokens)))) - f.bankKeeper.SendCoinsFromModuleToModule(f.sdkCtx, types.BondedPoolName, types.NotBondedPoolName, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, startTokens))) f.accountKeeper.SetModuleAccount(f.sdkCtx, notBondedPool) // Create a validator @@ -66,8 +67,8 @@ func SetupUnbondingTests(t *testing.T, f *fixture, hookCalled *bool, ubdeID *uin assert.Assert(t, validator1.IsBonded()) // Create a delegator - delegation := types.NewDelegation(addrDels[0], addrVals[0], issuedShares1) - f.stakingKeeper.SetDelegation(f.sdkCtx, delegation) + delegation := types.NewDelegation(addrDels[0].String(), addrVals[0].String(), issuedShares1) + assert.NilError(t, f.stakingKeeper.SetDelegation(f.sdkCtx, delegation)) // Create a validator to redelegate to validator2 := testutil.NewValidator(t, addrVals[1], PKs[1]) @@ -110,7 +111,8 @@ func doUnbondingDelegation( assert.Assert(math.IntEq(t, notBondedAmt1.AddRaw(1), notBondedAmt2)) // Check that the unbonding happened- we look up the entry and see that it has the correct number of shares - unbondingDelegations := stakingKeeper.GetUnbondingDelegationsFromValidator(ctx, addrVals[0]) + unbondingDelegations, err := stakingKeeper.GetUnbondingDelegationsFromValidator(ctx, addrVals[0]) + assert.NilError(t, err) assert.DeepEqual(t, math.NewInt(1), unbondingDelegations[0].Entries[0].Balance) // check that our hook was called @@ -132,7 +134,8 @@ func doRedelegation( assert.NilError(t, err) // Check that the redelegation happened- we look up the entry and see that it has the correct number of shares - redelegations := stakingKeeper.GetRedelegationsFromSrcValidator(ctx, addrVals[0]) + redelegations, err := stakingKeeper.GetRedelegationsFromSrcValidator(ctx, addrVals[0]) + assert.NilError(t, err) assert.Equal(t, 1, len(redelegations)) assert.DeepEqual(t, math.LegacyNewDec(1), redelegations[0].Entries[0].SharesDst) @@ -188,26 +191,28 @@ func TestValidatorUnbondingOnHold1(t *testing.T) { assert.NilError(t, err) // Try to unbond validator - f.stakingKeeper.UnbondAllMatureValidators(f.sdkCtx) + assert.NilError(t, f.stakingKeeper.UnbondAllMatureValidators(f.sdkCtx)) // Check that validator unbonding is not complete (is not mature yet) validator, found := f.stakingKeeper.GetValidator(f.sdkCtx, addrVals[0]) assert.Assert(t, found) assert.Equal(t, types.Unbonding, validator.Status) - unbondingVals := f.stakingKeeper.GetUnbondingValidators(f.sdkCtx, completionTime, completionHeight) + unbondingVals, err := f.stakingKeeper.GetUnbondingValidators(f.sdkCtx, completionTime, completionHeight) + assert.NilError(t, err) assert.Equal(t, 1, len(unbondingVals)) assert.Equal(t, validator.OperatorAddress, unbondingVals[0]) // PROVIDER CHAIN'S UNBONDING PERIOD ENDS - BUT UNBONDING CANNOT COMPLETE f.sdkCtx = f.sdkCtx.WithBlockTime(completionTime.Add(time.Duration(1))) f.sdkCtx = f.sdkCtx.WithBlockHeight(completionHeight + 1) - f.stakingKeeper.UnbondAllMatureValidators(f.sdkCtx) + assert.NilError(t, f.stakingKeeper.UnbondAllMatureValidators(f.sdkCtx)) // Check that validator unbonding is complete validator, found = f.stakingKeeper.GetValidator(f.sdkCtx, addrVals[0]) assert.Assert(t, found) assert.Equal(t, types.Unbonded, validator.Status) - unbondingVals = f.stakingKeeper.GetUnbondingValidators(f.sdkCtx, completionTime, completionHeight) + unbondingVals, err = f.stakingKeeper.GetUnbondingValidators(f.sdkCtx, completionTime, completionHeight) + assert.NilError(t, err) assert.Equal(t, 0, len(unbondingVals)) } @@ -246,7 +251,7 @@ func TestValidatorUnbondingOnHold2(t *testing.T) { // PROVIDER CHAIN'S UNBONDING PERIOD ENDS - BUT UNBONDING CANNOT COMPLETE f.sdkCtx = f.sdkCtx.WithBlockTime(completionTime.Add(time.Duration(1))) f.sdkCtx = f.sdkCtx.WithBlockHeight(completionHeight + 1) - f.stakingKeeper.UnbondAllMatureValidators(f.sdkCtx) + assert.NilError(t, f.stakingKeeper.UnbondAllMatureValidators(f.sdkCtx)) // Check that unbonding is not complete for both validators validator1, found := f.stakingKeeper.GetValidator(f.sdkCtx, addrVals[0]) @@ -255,17 +260,18 @@ func TestValidatorUnbondingOnHold2(t *testing.T) { validator2, found = f.stakingKeeper.GetValidator(f.sdkCtx, addrVals[1]) assert.Assert(t, found) assert.Equal(t, types.Unbonding, validator2.Status) - unbondingVals := f.stakingKeeper.GetUnbondingValidators(f.sdkCtx, completionTime, completionHeight) + unbondingVals, err := f.stakingKeeper.GetUnbondingValidators(f.sdkCtx, completionTime, completionHeight) + assert.NilError(t, err) assert.Equal(t, 2, len(unbondingVals)) assert.Equal(t, validator1.OperatorAddress, unbondingVals[0]) assert.Equal(t, validator2.OperatorAddress, unbondingVals[1]) // CONSUMER CHAIN'S UNBONDING PERIOD ENDS - STOPPED UNBONDING CAN NOW COMPLETE - err := f.stakingKeeper.UnbondingCanComplete(f.sdkCtx, ubdeIDs[0]) + err = f.stakingKeeper.UnbondingCanComplete(f.sdkCtx, ubdeIDs[0]) assert.NilError(t, err) // Try again to unbond validators - f.stakingKeeper.UnbondAllMatureValidators(f.sdkCtx) + assert.NilError(t, f.stakingKeeper.UnbondAllMatureValidators(f.sdkCtx)) // Check that unbonding is complete for validator1, but not for validator2 validator1, found = f.stakingKeeper.GetValidator(f.sdkCtx, addrVals[0]) @@ -274,7 +280,8 @@ func TestValidatorUnbondingOnHold2(t *testing.T) { validator2, found = f.stakingKeeper.GetValidator(f.sdkCtx, addrVals[1]) assert.Assert(t, found) assert.Equal(t, types.Unbonding, validator2.Status) - unbondingVals = f.stakingKeeper.GetUnbondingValidators(f.sdkCtx, completionTime, completionHeight) + unbondingVals, err = f.stakingKeeper.GetUnbondingValidators(f.sdkCtx, completionTime, completionHeight) + assert.NilError(t, err) assert.Equal(t, 1, len(unbondingVals)) assert.Equal(t, validator2.OperatorAddress, unbondingVals[0]) @@ -283,13 +290,14 @@ func TestValidatorUnbondingOnHold2(t *testing.T) { assert.NilError(t, err) // Try again to unbond validators - f.stakingKeeper.UnbondAllMatureValidators(f.sdkCtx) + assert.NilError(t, f.stakingKeeper.UnbondAllMatureValidators(f.sdkCtx)) // Check that unbonding is complete for validator2 validator2, found = f.stakingKeeper.GetValidator(f.sdkCtx, addrVals[1]) assert.Assert(t, found) assert.Equal(t, types.Unbonded, validator2.Status) - unbondingVals = f.stakingKeeper.GetUnbondingValidators(f.sdkCtx, completionTime, completionHeight) + unbondingVals, err = f.stakingKeeper.GetUnbondingValidators(f.sdkCtx, completionTime, completionHeight) + assert.NilError(t, err) assert.Equal(t, 0, len(unbondingVals)) } @@ -311,7 +319,8 @@ func TestRedelegationOnHold1(t *testing.T) { assert.NilError(t, err) // Redelegation is not complete - still exists - redelegations := f.stakingKeeper.GetRedelegationsFromSrcValidator(f.sdkCtx, addrVals[0]) + redelegations, err := f.stakingKeeper.GetRedelegationsFromSrcValidator(f.sdkCtx, addrVals[0]) + assert.NilError(t, err) assert.Equal(t, 1, len(redelegations)) // PROVIDER CHAIN'S UNBONDING PERIOD ENDS - STOPPED UNBONDING CAN NOW COMPLETE @@ -320,7 +329,8 @@ func TestRedelegationOnHold1(t *testing.T) { assert.NilError(t, err) // Redelegation is complete and record is gone - redelegations = f.stakingKeeper.GetRedelegationsFromSrcValidator(f.sdkCtx, addrVals[0]) + redelegations, err = f.stakingKeeper.GetRedelegationsFromSrcValidator(f.sdkCtx, addrVals[0]) + assert.NilError(t, err) assert.Equal(t, 0, len(redelegations)) } @@ -343,7 +353,8 @@ func TestRedelegationOnHold2(t *testing.T) { assert.NilError(t, err) // Redelegation is not complete - still exists - redelegations := f.stakingKeeper.GetRedelegationsFromSrcValidator(f.sdkCtx, addrVals[0]) + redelegations, err := f.stakingKeeper.GetRedelegationsFromSrcValidator(f.sdkCtx, addrVals[0]) + assert.NilError(t, err) assert.Equal(t, 1, len(redelegations)) // CONSUMER CHAIN'S UNBONDING PERIOD ENDS - STOPPED UNBONDING CAN NOW COMPLETE @@ -351,7 +362,8 @@ func TestRedelegationOnHold2(t *testing.T) { assert.NilError(t, err) // Redelegation is complete and record is gone - redelegations = f.stakingKeeper.GetRedelegationsFromSrcValidator(f.sdkCtx, addrVals[0]) + redelegations, err = f.stakingKeeper.GetRedelegationsFromSrcValidator(f.sdkCtx, addrVals[0]) + assert.NilError(t, err) assert.Equal(t, 0, len(redelegations)) } diff --git a/tests/integration/staking/keeper/validator_bench_test.go b/tests/integration/staking/keeper/validator_bench_test.go index b63e0d4f0710..d69d6fe4f329 100644 --- a/tests/integration/staking/keeper/validator_bench_test.go +++ b/tests/integration/staking/keeper/validator_bench_test.go @@ -1,6 +1,7 @@ package keeper_test import ( + "bytes" "fmt" "testing" @@ -58,9 +59,12 @@ func BenchmarkGetValidatorDelegations(b *testing.B) { for i := 0; i < delegationsNum; i++ { delegator := sdk.AccAddress(fmt.Sprintf("address%d", i)) banktestutil.FundAccount(f.sdkCtx, f.bankKeeper, delegator, - sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(int64(i))))) - NewDel := types.NewDelegation(delegator, val, math.LegacyNewDec(int64(i))) - f.stakingKeeper.SetDelegation(f.sdkCtx, NewDel) + sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(int64(i))))) + NewDel := types.NewDelegation(delegator.String(), val.String(), math.LegacyNewDec(int64(i))) + + if err := f.stakingKeeper.SetDelegation(f.sdkCtx, NewDel); err != nil { + panic(err) + } } } @@ -90,10 +94,11 @@ func BenchmarkGetValidatorDelegationsLegacy(b *testing.B) { for _, val := range valAddrs { for i := 0; i < delegationsNum; i++ { delegator := sdk.AccAddress(fmt.Sprintf("address%d", i)) - banktestutil.FundAccount(f.sdkCtx, f.bankKeeper, delegator, - sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(int64(i))))) - NewDel := types.NewDelegation(delegator, val, math.LegacyNewDec(int64(i))) - f.stakingKeeper.SetDelegation(f.sdkCtx, NewDel) + banktestutil.FundAccount(f.sdkCtx, f.bankKeeper, delegator, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(int64(i))))) + NewDel := types.NewDelegation(delegator.String(), val.String(), math.LegacyNewDec(int64(i))) + if err := f.stakingKeeper.SetDelegation(f.sdkCtx, NewDel); err != nil { + panic(err) + } } } @@ -114,8 +119,15 @@ func updateValidatorDelegationsLegacy(f *fixture, existingValAddr, newValAddr sd for ; iterator.Valid(); iterator.Next() { delegation := types.MustUnmarshalDelegation(cdc, iterator.Value()) - if delegation.GetValidatorAddr().Equals(existingValAddr) { - k.RemoveDelegation(f.sdkCtx, delegation) + valAddr, err := k.ValidatorAddressCodec().StringToBytes(delegation.GetValidatorAddr()) + if err != nil { + panic(err) + } + + if bytes.EqualFold(valAddr, existingValAddr) { + if err := k.RemoveDelegation(f.sdkCtx, delegation); err != nil { + panic(err) + } delegation.ValidatorAddress = newValAddr.String() k.SetDelegation(f.sdkCtx, delegation) } diff --git a/tests/integration/staking/keeper/validator_test.go b/tests/integration/staking/keeper/validator_test.go index 3cf24ad300ed..06b8f8d38123 100644 --- a/tests/integration/staking/keeper/validator_test.go +++ b/tests/integration/staking/keeper/validator_test.go @@ -4,10 +4,11 @@ import ( "fmt" "testing" - "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" "gotest.tools/v3/assert" + "cosmossdk.io/math" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" @@ -17,9 +18,10 @@ import ( "github.com/cosmos/cosmos-sdk/x/staking/types" ) -func newMonikerValidator(t testing.TB, operator sdk.ValAddress, pubKey cryptotypes.PubKey, moniker string) types.Validator { - v, err := types.NewValidator(operator, pubKey, types.Description{Moniker: moniker}) - assert.NilError(t, err) +func newMonikerValidator(tb testing.TB, operator sdk.ValAddress, pubKey cryptotypes.PubKey, moniker string) types.Validator { + tb.Helper() + v, err := types.NewValidator(operator.String(), pubKey, types.Description{Moniker: moniker}) + assert.NilError(tb, err) return v } @@ -28,8 +30,11 @@ func bootstrapValidatorTest(t testing.TB, power int64, numAddrs int) (*fixture, addrDels, addrVals := generateAddresses(f, numAddrs) + bondDenom, err := f.stakingKeeper.BondDenom(f.sdkCtx) + assert.NilError(t, err) + amt := f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, power) - totalSupply := sdk.NewCoins(sdk.NewCoin(f.stakingKeeper.BondDenom(f.sdkCtx), amt.MulRaw(int64(len(addrDels))))) + totalSupply := sdk.NewCoins(sdk.NewCoin(bondDenom, amt.MulRaw(int64(len(addrDels))))) notBondedPool := f.stakingKeeper.GetNotBondedPool(f.sdkCtx) @@ -65,13 +70,17 @@ func TestUpdateBondedValidatorsDecreaseCliff(t *testing.T) { notBondedPool := f.stakingKeeper.GetNotBondedPool(f.sdkCtx) // create keeper parameters - params := f.stakingKeeper.GetParams(f.sdkCtx) + params, err := f.stakingKeeper.GetParams(f.sdkCtx) + assert.NilError(t, err) params.MaxValidators = uint32(maxVals) - f.stakingKeeper.SetParams(f.sdkCtx, params) + assert.NilError(t, f.stakingKeeper.SetParams(f.sdkCtx, params)) + + bondDenom, err := f.stakingKeeper.BondDenom(f.sdkCtx) + assert.NilError(t, err) // create a random pool - assert.NilError(t, banktestutil.FundModuleAccount(f.sdkCtx, f.bankKeeper, bondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(f.stakingKeeper.BondDenom(f.sdkCtx), f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, 1234))))) - assert.NilError(t, banktestutil.FundModuleAccount(f.sdkCtx, f.bankKeeper, notBondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(f.stakingKeeper.BondDenom(f.sdkCtx), f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, 10000))))) + assert.NilError(t, banktestutil.FundModuleAccount(f.sdkCtx, f.bankKeeper, bondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(bondDenom, f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, 1234))))) + assert.NilError(t, banktestutil.FundModuleAccount(f.sdkCtx, f.bankKeeper, notBondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(bondDenom, f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, 10000))))) f.accountKeeper.SetModuleAccount(f.sdkCtx, bondedPool) f.accountKeeper.SetModuleAccount(f.sdkCtx, notBondedPool) @@ -93,7 +102,7 @@ func TestUpdateBondedValidatorsDecreaseCliff(t *testing.T) { // validator and next in line cliff validator f.stakingKeeper.DeleteValidatorByPowerIndex(f.sdkCtx, nextCliffVal) shares := f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, 21) - nextCliffVal, _ = nextCliffVal.RemoveDelShares(sdk.NewDecFromInt(shares)) + nextCliffVal, _ = nextCliffVal.RemoveDelShares(math.LegacyNewDecFromInt(shares)) _ = keeper.TestingUpdateValidator(f.stakingKeeper, f.sdkCtx, nextCliffVal, true) expectedValStatus := map[int]types.BondStatus{ @@ -124,8 +133,9 @@ func TestSlashToZeroPowerRemoved(t *testing.T) { valTokens := f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, 100) bondedPool := f.stakingKeeper.GetBondedPool(f.sdkCtx) - - assert.NilError(t, banktestutil.FundModuleAccount(f.sdkCtx, f.bankKeeper, bondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(f.stakingKeeper.BondDenom(f.sdkCtx), valTokens)))) + bondDenom, err := f.stakingKeeper.BondDenom(f.sdkCtx) + assert.NilError(t, err) + assert.NilError(t, banktestutil.FundModuleAccount(f.sdkCtx, f.bankKeeper, bondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(bondDenom, valTokens)))) f.accountKeeper.SetModuleAccount(f.sdkCtx, bondedPool) @@ -163,18 +173,19 @@ func TestGetValidatorSortingUnmixed(t *testing.T) { validators[i] = testutil.NewValidator(t, sdk.ValAddress(addrs[i]), PKs[i]) validators[i].Status = types.Bonded validators[i].Tokens = amt - validators[i].DelegatorShares = sdk.NewDecFromInt(amt) + validators[i].DelegatorShares = math.LegacyNewDecFromInt(amt) keeper.TestingUpdateValidator(f.stakingKeeper, f.sdkCtx, validators[i], true) } // first make sure everything made it in to the gotValidator group - resValidators := f.stakingKeeper.GetBondedValidatorsByPower(f.sdkCtx) + resValidators, err := f.stakingKeeper.GetBondedValidatorsByPower(f.sdkCtx) + assert.NilError(t, err) assert.Equal(t, n, len(resValidators)) - assert.DeepEqual(t, sdk.NewInt(400).Mul(f.stakingKeeper.PowerReduction(f.sdkCtx)), resValidators[0].BondedTokens()) - assert.DeepEqual(t, sdk.NewInt(200).Mul(f.stakingKeeper.PowerReduction(f.sdkCtx)), resValidators[1].BondedTokens()) - assert.DeepEqual(t, sdk.NewInt(100).Mul(f.stakingKeeper.PowerReduction(f.sdkCtx)), resValidators[2].BondedTokens()) - assert.DeepEqual(t, sdk.NewInt(1).Mul(f.stakingKeeper.PowerReduction(f.sdkCtx)), resValidators[3].BondedTokens()) - assert.DeepEqual(t, sdk.NewInt(0), resValidators[4].BondedTokens()) + assert.DeepEqual(t, math.NewInt(400).Mul(f.stakingKeeper.PowerReduction(f.sdkCtx)), resValidators[0].BondedTokens()) + assert.DeepEqual(t, math.NewInt(200).Mul(f.stakingKeeper.PowerReduction(f.sdkCtx)), resValidators[1].BondedTokens()) + assert.DeepEqual(t, math.NewInt(100).Mul(f.stakingKeeper.PowerReduction(f.sdkCtx)), resValidators[2].BondedTokens()) + assert.DeepEqual(t, math.NewInt(1).Mul(f.stakingKeeper.PowerReduction(f.sdkCtx)), resValidators[3].BondedTokens()) + assert.DeepEqual(t, math.NewInt(0), resValidators[4].BondedTokens()) assert.Equal(t, validators[3].OperatorAddress, resValidators[0].OperatorAddress, "%v", resValidators) assert.Equal(t, validators[4].OperatorAddress, resValidators[1].OperatorAddress, "%v", resValidators) assert.Equal(t, validators[1].OperatorAddress, resValidators[2].OperatorAddress, "%v", resValidators) @@ -182,25 +193,28 @@ func TestGetValidatorSortingUnmixed(t *testing.T) { assert.Equal(t, validators[0].OperatorAddress, resValidators[4].OperatorAddress, "%v", resValidators) // test a basic increase in voting power - validators[3].Tokens = sdk.NewInt(500).Mul(f.stakingKeeper.PowerReduction(f.sdkCtx)) + validators[3].Tokens = math.NewInt(500).Mul(f.stakingKeeper.PowerReduction(f.sdkCtx)) keeper.TestingUpdateValidator(f.stakingKeeper, f.sdkCtx, validators[3], true) - resValidators = f.stakingKeeper.GetBondedValidatorsByPower(f.sdkCtx) + resValidators, err = f.stakingKeeper.GetBondedValidatorsByPower(f.sdkCtx) + assert.NilError(t, err) assert.Equal(t, len(resValidators), n) assert.Assert(ValEq(t, validators[3], resValidators[0])) // test a decrease in voting power - validators[3].Tokens = sdk.NewInt(300).Mul(f.stakingKeeper.PowerReduction(f.sdkCtx)) + validators[3].Tokens = math.NewInt(300).Mul(f.stakingKeeper.PowerReduction(f.sdkCtx)) keeper.TestingUpdateValidator(f.stakingKeeper, f.sdkCtx, validators[3], true) - resValidators = f.stakingKeeper.GetBondedValidatorsByPower(f.sdkCtx) + resValidators, err = f.stakingKeeper.GetBondedValidatorsByPower(f.sdkCtx) + assert.NilError(t, err) assert.Equal(t, len(resValidators), n) assert.Assert(ValEq(t, validators[3], resValidators[0])) assert.Assert(ValEq(t, validators[4], resValidators[1])) // test equal voting power, different age - validators[3].Tokens = sdk.NewInt(200).Mul(f.stakingKeeper.PowerReduction(f.sdkCtx)) + validators[3].Tokens = math.NewInt(200).Mul(f.stakingKeeper.PowerReduction(f.sdkCtx)) f.sdkCtx = f.sdkCtx.WithBlockHeight(10) keeper.TestingUpdateValidator(f.stakingKeeper, f.sdkCtx, validators[3], true) - resValidators = f.stakingKeeper.GetBondedValidatorsByPower(f.sdkCtx) + resValidators, err = f.stakingKeeper.GetBondedValidatorsByPower(f.sdkCtx) + assert.NilError(t, err) assert.Equal(t, len(resValidators), n) assert.Assert(ValEq(t, validators[3], resValidators[0])) assert.Assert(ValEq(t, validators[4], resValidators[1])) @@ -208,20 +222,23 @@ func TestGetValidatorSortingUnmixed(t *testing.T) { // no change in voting power - no change in sort f.sdkCtx = f.sdkCtx.WithBlockHeight(20) keeper.TestingUpdateValidator(f.stakingKeeper, f.sdkCtx, validators[4], true) - resValidators = f.stakingKeeper.GetBondedValidatorsByPower(f.sdkCtx) + resValidators, err = f.stakingKeeper.GetBondedValidatorsByPower(f.sdkCtx) + assert.NilError(t, err) assert.Equal(t, len(resValidators), n) assert.Assert(ValEq(t, validators[3], resValidators[0])) assert.Assert(ValEq(t, validators[4], resValidators[1])) // change in voting power of both validators, both still in v-set, no age change - validators[3].Tokens = sdk.NewInt(300).Mul(f.stakingKeeper.PowerReduction(f.sdkCtx)) - validators[4].Tokens = sdk.NewInt(300).Mul(f.stakingKeeper.PowerReduction(f.sdkCtx)) + validators[3].Tokens = math.NewInt(300).Mul(f.stakingKeeper.PowerReduction(f.sdkCtx)) + validators[4].Tokens = math.NewInt(300).Mul(f.stakingKeeper.PowerReduction(f.sdkCtx)) keeper.TestingUpdateValidator(f.stakingKeeper, f.sdkCtx, validators[3], true) - resValidators = f.stakingKeeper.GetBondedValidatorsByPower(f.sdkCtx) + resValidators, err = f.stakingKeeper.GetBondedValidatorsByPower(f.sdkCtx) + assert.NilError(t, err) assert.Equal(t, len(resValidators), n) f.sdkCtx = f.sdkCtx.WithBlockHeight(30) keeper.TestingUpdateValidator(f.stakingKeeper, f.sdkCtx, validators[4], true) - resValidators = f.stakingKeeper.GetBondedValidatorsByPower(f.sdkCtx) + resValidators, err = f.stakingKeeper.GetBondedValidatorsByPower(f.sdkCtx) + assert.NilError(t, err) assert.Equal(t, len(resValidators), n, "%v", resValidators) assert.Assert(ValEq(t, validators[3], resValidators[0])) assert.Assert(ValEq(t, validators[4], resValidators[1])) @@ -232,16 +249,20 @@ func TestGetValidatorSortingMixed(t *testing.T) { bondedPool := f.stakingKeeper.GetBondedPool(f.sdkCtx) notBondedPool := f.stakingKeeper.GetNotBondedPool(f.sdkCtx) - assert.NilError(t, banktestutil.FundModuleAccount(f.sdkCtx, f.bankKeeper, bondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(f.stakingKeeper.BondDenom(f.sdkCtx), f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, 501))))) - assert.NilError(t, banktestutil.FundModuleAccount(f.sdkCtx, f.bankKeeper, notBondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(f.stakingKeeper.BondDenom(f.sdkCtx), f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, 0))))) + bondDenom, err := f.stakingKeeper.BondDenom(f.sdkCtx) + assert.NilError(t, err) + + assert.NilError(t, banktestutil.FundModuleAccount(f.sdkCtx, f.bankKeeper, bondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(bondDenom, f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, 501))))) + assert.NilError(t, banktestutil.FundModuleAccount(f.sdkCtx, f.bankKeeper, notBondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(bondDenom, f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, 0))))) f.accountKeeper.SetModuleAccount(f.sdkCtx, notBondedPool) f.accountKeeper.SetModuleAccount(f.sdkCtx, bondedPool) // now 2 max resValidators - params := f.stakingKeeper.GetParams(f.sdkCtx) + params, err := f.stakingKeeper.GetParams(f.sdkCtx) + assert.NilError(t, err) params.MaxValidators = 2 - f.stakingKeeper.SetParams(f.sdkCtx, params) + assert.NilError(t, f.stakingKeeper.SetParams(f.sdkCtx, params)) // initialize some validators into the state amts := []math.Int{ @@ -255,7 +276,7 @@ func TestGetValidatorSortingMixed(t *testing.T) { var validators [5]types.Validator for i, amt := range amts { validators[i] = testutil.NewValidator(t, sdk.ValAddress(addrs[i]), PKs[i]) - validators[i].DelegatorShares = sdk.NewDecFromInt(amt) + validators[i].DelegatorShares = math.LegacyNewDecFromInt(amt) validators[i].Status = types.Bonded validators[i].Tokens = amt keeper.TestingUpdateValidator(f.stakingKeeper, f.sdkCtx, validators[i], true) @@ -278,11 +299,12 @@ func TestGetValidatorSortingMixed(t *testing.T) { assert.Equal(t, types.Bonded, val4.Status) // first make sure everything made it in to the gotValidator group - resValidators := f.stakingKeeper.GetBondedValidatorsByPower(f.sdkCtx) + resValidators, err := f.stakingKeeper.GetBondedValidatorsByPower(f.sdkCtx) + assert.NilError(t, err) // The validators returned should match the max validators assert.Equal(t, 2, len(resValidators)) - assert.DeepEqual(t, sdk.NewInt(400).Mul(f.stakingKeeper.PowerReduction(f.sdkCtx)), resValidators[0].BondedTokens()) - assert.DeepEqual(t, sdk.NewInt(200).Mul(f.stakingKeeper.PowerReduction(f.sdkCtx)), resValidators[1].BondedTokens()) + assert.DeepEqual(t, math.NewInt(400).Mul(f.stakingKeeper.PowerReduction(f.sdkCtx)), resValidators[0].BondedTokens()) + assert.DeepEqual(t, math.NewInt(200).Mul(f.stakingKeeper.PowerReduction(f.sdkCtx)), resValidators[1].BondedTokens()) assert.Equal(t, validators[3].OperatorAddress, resValidators[0].OperatorAddress, "%v", resValidators) assert.Equal(t, validators[4].OperatorAddress, resValidators[1].OperatorAddress, "%v", resValidators) } @@ -292,7 +314,8 @@ func TestGetValidatorsEdgeCases(t *testing.T) { f, addrs, _ := bootstrapValidatorTest(t, 1000, 20) // set max validators to 2 - params := f.stakingKeeper.GetParams(f.sdkCtx) + params, err := f.stakingKeeper.GetParams(f.sdkCtx) + assert.NilError(t, err) nMax := uint32(2) params.MaxValidators = nMax f.stakingKeeper.SetParams(f.sdkCtx, params) @@ -314,7 +337,8 @@ func TestGetValidatorsEdgeCases(t *testing.T) { } // ensure that the first two bonded validators are the largest validators - resValidators := f.stakingKeeper.GetBondedValidatorsByPower(f.sdkCtx) + resValidators, err := f.stakingKeeper.GetBondedValidatorsByPower(f.sdkCtx) + assert.NilError(t, err) assert.Equal(t, nMax, uint32(len(resValidators))) assert.Assert(ValEq(t, validators[2], resValidators[0])) assert.Assert(ValEq(t, validators[3], resValidators[1])) @@ -334,7 +358,8 @@ func TestGetValidatorsEdgeCases(t *testing.T) { // a) validator 0 with 500 tokens // b) validator 2 with 400 tokens (delegated before validator 3) validators[0] = keeper.TestingUpdateValidator(f.stakingKeeper, f.sdkCtx, validators[0], true) - resValidators = f.stakingKeeper.GetBondedValidatorsByPower(f.sdkCtx) + resValidators, err = f.stakingKeeper.GetBondedValidatorsByPower(f.sdkCtx) + assert.NilError(t, err) assert.Equal(t, nMax, uint32(len(resValidators))) assert.Assert(ValEq(t, validators[0], resValidators[0])) assert.Assert(ValEq(t, validators[2], resValidators[1])) @@ -351,9 +376,11 @@ func TestGetValidatorsEdgeCases(t *testing.T) { // validator 3 enters bonded validator set f.sdkCtx = f.sdkCtx.WithBlockHeight(40) - var found bool - validators[3], found = f.stakingKeeper.GetValidator(f.sdkCtx, validators[3].GetOperator()) - assert.Assert(t, found) + valbz, err := f.stakingKeeper.ValidatorAddressCodec().StringToBytes(validators[3].GetOperator()) + assert.NilError(t, err) + + validators[3], err = f.stakingKeeper.GetValidator(f.sdkCtx, valbz) + assert.NilError(t, err) f.stakingKeeper.DeleteValidatorByPowerIndex(f.sdkCtx, validators[3]) validators[3], _ = validators[3].AddTokensFromDel(f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, 1)) @@ -363,7 +390,8 @@ func TestGetValidatorsEdgeCases(t *testing.T) { f.accountKeeper.SetModuleAccount(f.sdkCtx, notBondedPool) validators[3] = keeper.TestingUpdateValidator(f.stakingKeeper, f.sdkCtx, validators[3], true) - resValidators = f.stakingKeeper.GetBondedValidatorsByPower(f.sdkCtx) + resValidators, err = f.stakingKeeper.GetBondedValidatorsByPower(f.sdkCtx) + assert.NilError(t, err) assert.Equal(t, nMax, uint32(len(resValidators))) assert.Assert(ValEq(t, validators[0], resValidators[0])) assert.Assert(ValEq(t, validators[3], resValidators[1])) @@ -378,25 +406,27 @@ func TestGetValidatorsEdgeCases(t *testing.T) { f.accountKeeper.SetModuleAccount(f.sdkCtx, bondedPool) validators[3] = keeper.TestingUpdateValidator(f.stakingKeeper, f.sdkCtx, validators[3], true) - resValidators = f.stakingKeeper.GetBondedValidatorsByPower(f.sdkCtx) + resValidators, err = f.stakingKeeper.GetBondedValidatorsByPower(f.sdkCtx) + assert.NilError(t, err) assert.Equal(t, nMax, uint32(len(resValidators))) assert.Assert(ValEq(t, validators[0], resValidators[0])) assert.Assert(ValEq(t, validators[2], resValidators[1])) // validator 3 does not get spot back f.stakingKeeper.DeleteValidatorByPowerIndex(f.sdkCtx, validators[3]) - validators[3], _ = validators[3].AddTokensFromDel(sdk.NewInt(200)) + validators[3], _ = validators[3].AddTokensFromDel(math.NewInt(200)) notBondedPool = f.stakingKeeper.GetNotBondedPool(f.sdkCtx) - assert.NilError(t, banktestutil.FundModuleAccount(f.sdkCtx, f.bankKeeper, notBondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(params.BondDenom, sdk.NewInt(200))))) + assert.NilError(t, banktestutil.FundModuleAccount(f.sdkCtx, f.bankKeeper, notBondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(params.BondDenom, math.NewInt(200))))) f.accountKeeper.SetModuleAccount(f.sdkCtx, notBondedPool) validators[3] = keeper.TestingUpdateValidator(f.stakingKeeper, f.sdkCtx, validators[3], true) - resValidators = f.stakingKeeper.GetBondedValidatorsByPower(f.sdkCtx) + resValidators, err = f.stakingKeeper.GetBondedValidatorsByPower(f.sdkCtx) + assert.NilError(t, err) assert.Equal(t, nMax, uint32(len(resValidators))) assert.Assert(ValEq(t, validators[0], resValidators[0])) assert.Assert(ValEq(t, validators[2], resValidators[1])) - _, exists := f.stakingKeeper.GetValidator(f.sdkCtx, validators[3].GetOperator()) + _, exists := f.stakingKeeper.GetValidator(f.sdkCtx, valbz) assert.Assert(t, exists) } @@ -404,7 +434,8 @@ func TestValidatorBondHeight(t *testing.T) { f, addrs, _ := bootstrapValidatorTest(t, 1000, 20) // now 2 max resValidators - params := f.stakingKeeper.GetParams(f.sdkCtx) + params, err := f.stakingKeeper.GetParams(f.sdkCtx) + assert.NilError(t, err) params.MaxValidators = 2 f.stakingKeeper.SetParams(f.sdkCtx, params) @@ -429,7 +460,8 @@ func TestValidatorBondHeight(t *testing.T) { validators[1] = keeper.TestingUpdateValidator(f.stakingKeeper, f.sdkCtx, validators[1], true) validators[2] = keeper.TestingUpdateValidator(f.stakingKeeper, f.sdkCtx, validators[2], true) - resValidators := f.stakingKeeper.GetBondedValidatorsByPower(f.sdkCtx) + resValidators, err := f.stakingKeeper.GetBondedValidatorsByPower(f.sdkCtx) + assert.NilError(t, err) assert.Equal(t, uint32(len(resValidators)), params.MaxValidators) assert.Assert(ValEq(t, validators[0], resValidators[0])) @@ -440,7 +472,8 @@ func TestValidatorBondHeight(t *testing.T) { validators[1], _ = validators[1].AddTokensFromDel(delTokens) validators[2], _ = validators[2].AddTokensFromDel(delTokens) validators[2] = keeper.TestingUpdateValidator(f.stakingKeeper, f.sdkCtx, validators[2], true) - resValidators = f.stakingKeeper.GetBondedValidatorsByPower(f.sdkCtx) + resValidators, err = f.stakingKeeper.GetBondedValidatorsByPower(f.sdkCtx) + assert.NilError(t, err) assert.Equal(t, params.MaxValidators, uint32(len(resValidators))) validators[1] = keeper.TestingUpdateValidator(f.stakingKeeper, f.sdkCtx, validators[1], true) assert.Assert(ValEq(t, validators[0], resValidators[0])) @@ -449,10 +482,11 @@ func TestValidatorBondHeight(t *testing.T) { func TestFullValidatorSetPowerChange(t *testing.T) { f, addrs, _ := bootstrapValidatorTest(t, 1000, 20) - params := f.stakingKeeper.GetParams(f.sdkCtx) + params, err := f.stakingKeeper.GetParams(f.sdkCtx) + assert.NilError(t, err) max := 2 params.MaxValidators = uint32(2) - f.stakingKeeper.SetParams(f.sdkCtx, params) + assert.NilError(t, f.stakingKeeper.SetParams(f.sdkCtx, params)) // initialize some validators into the state powers := []int64{0, 100, 400, 400, 200} @@ -464,16 +498,19 @@ func TestFullValidatorSetPowerChange(t *testing.T) { keeper.TestingUpdateValidator(f.stakingKeeper, f.sdkCtx, validators[i], true) } for i := range powers { - var found bool - validators[i], found = f.stakingKeeper.GetValidator(f.sdkCtx, validators[i].GetOperator()) - assert.Assert(t, found) + valbz, err := f.stakingKeeper.ValidatorAddressCodec().StringToBytes(validators[i].GetOperator()) + assert.NilError(t, err) + + validators[i], err = f.stakingKeeper.GetValidator(f.sdkCtx, valbz) + assert.NilError(t, err) } assert.Equal(t, types.Unbonded, validators[0].Status) assert.Equal(t, types.Unbonding, validators[1].Status) assert.Equal(t, types.Bonded, validators[2].Status) assert.Equal(t, types.Bonded, validators[3].Status) assert.Equal(t, types.Unbonded, validators[4].Status) - resValidators := f.stakingKeeper.GetBondedValidatorsByPower(f.sdkCtx) + resValidators, err := f.stakingKeeper.GetBondedValidatorsByPower(f.sdkCtx) + assert.NilError(t, err) assert.Equal(t, max, len(resValidators)) assert.Assert(ValEq(t, validators[2], resValidators[0])) // in the order of txs assert.Assert(ValEq(t, validators[3], resValidators[1])) @@ -483,7 +520,8 @@ func TestFullValidatorSetPowerChange(t *testing.T) { tokens := f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, 600) validators[0], _ = validators[0].AddTokensFromDel(tokens) validators[0] = keeper.TestingUpdateValidator(f.stakingKeeper, f.sdkCtx, validators[0], true) - resValidators = f.stakingKeeper.GetBondedValidatorsByPower(f.sdkCtx) + resValidators, err = f.stakingKeeper.GetBondedValidatorsByPower(f.sdkCtx) + assert.NilError(t, err) assert.Equal(t, max, len(resValidators)) assert.Assert(ValEq(t, validators[0], resValidators[0])) assert.Assert(ValEq(t, validators[2], resValidators[1])) @@ -512,8 +550,12 @@ func TestApplyAndReturnValidatorSetUpdatesAllNone(t *testing.T) { f.stakingKeeper.SetValidatorByPowerIndex(f.sdkCtx, validators[1]) updates := applyValidatorSetUpdates(t, f.sdkCtx, f.stakingKeeper, 2) - validators[0], _ = f.stakingKeeper.GetValidator(f.sdkCtx, validators[0].GetOperator()) - validators[1], _ = f.stakingKeeper.GetValidator(f.sdkCtx, validators[1].GetOperator()) + val0bz, err := f.stakingKeeper.ValidatorAddressCodec().StringToBytes(validators[0].GetOperator()) + assert.NilError(t, err) + val1bz, err := f.stakingKeeper.ValidatorAddressCodec().StringToBytes(validators[1].GetOperator()) + assert.NilError(t, err) + validators[0], _ = f.stakingKeeper.GetValidator(f.sdkCtx, val0bz) + validators[1], _ = f.stakingKeeper.GetValidator(f.sdkCtx, val1bz) assert.DeepEqual(t, validators[0].ABCIValidatorUpdate(f.stakingKeeper.PowerReduction(f.sdkCtx)), updates[1]) assert.DeepEqual(t, validators[1].ABCIValidatorUpdate(f.stakingKeeper.PowerReduction(f.sdkCtx)), updates[0]) } @@ -603,7 +645,9 @@ func TestApplyAndReturnValidatorSetUpdatesInserted(t *testing.T) { f.stakingKeeper.SetValidator(f.sdkCtx, validators[2]) f.stakingKeeper.SetValidatorByPowerIndex(f.sdkCtx, validators[2]) updates := applyValidatorSetUpdates(t, f.sdkCtx, f.stakingKeeper, 1) - validators[2], _ = f.stakingKeeper.GetValidator(f.sdkCtx, validators[2].GetOperator()) + val2bz, err := f.stakingKeeper.ValidatorAddressCodec().StringToBytes(validators[2].GetOperator()) + assert.NilError(t, err) + validators[2], _ = f.stakingKeeper.GetValidator(f.sdkCtx, val2bz) assert.DeepEqual(t, validators[2].ABCIValidatorUpdate(f.stakingKeeper.PowerReduction(f.sdkCtx)), updates[0]) // test validtor added at the beginning @@ -611,7 +655,9 @@ func TestApplyAndReturnValidatorSetUpdatesInserted(t *testing.T) { f.stakingKeeper.SetValidator(f.sdkCtx, validators[3]) f.stakingKeeper.SetValidatorByPowerIndex(f.sdkCtx, validators[3]) updates = applyValidatorSetUpdates(t, f.sdkCtx, f.stakingKeeper, 1) - validators[3], _ = f.stakingKeeper.GetValidator(f.sdkCtx, validators[3].GetOperator()) + val3bz, err := f.stakingKeeper.ValidatorAddressCodec().StringToBytes(validators[3].GetOperator()) + assert.NilError(t, err) + validators[3], _ = f.stakingKeeper.GetValidator(f.sdkCtx, val3bz) assert.DeepEqual(t, validators[3].ABCIValidatorUpdate(f.stakingKeeper.PowerReduction(f.sdkCtx)), updates[0]) // test validtor added at the end @@ -619,7 +665,9 @@ func TestApplyAndReturnValidatorSetUpdatesInserted(t *testing.T) { f.stakingKeeper.SetValidator(f.sdkCtx, validators[4]) f.stakingKeeper.SetValidatorByPowerIndex(f.sdkCtx, validators[4]) updates = applyValidatorSetUpdates(t, f.sdkCtx, f.stakingKeeper, 1) - validators[4], _ = f.stakingKeeper.GetValidator(f.sdkCtx, validators[4].GetOperator()) + val4bz, err := f.stakingKeeper.ValidatorAddressCodec().StringToBytes(validators[4].GetOperator()) + assert.NilError(t, err) + validators[4], _ = f.stakingKeeper.GetValidator(f.sdkCtx, val4bz) assert.DeepEqual(t, validators[4].ABCIValidatorUpdate(f.stakingKeeper.PowerReduction(f.sdkCtx)), updates[0]) } @@ -654,17 +702,20 @@ func TestApplyAndReturnValidatorSetUpdatesWithCliffValidator(t *testing.T) { f.stakingKeeper.SetValidator(f.sdkCtx, validators[2]) f.stakingKeeper.SetValidatorByPowerIndex(f.sdkCtx, validators[2]) updates := applyValidatorSetUpdates(t, f.sdkCtx, f.stakingKeeper, 2) - validators[2], _ = f.stakingKeeper.GetValidator(f.sdkCtx, validators[2].GetOperator()) + val2bz, err := f.stakingKeeper.ValidatorAddressCodec().StringToBytes(validators[2].GetOperator()) + assert.NilError(t, err) + validators[2], _ = f.stakingKeeper.GetValidator(f.sdkCtx, val2bz) assert.DeepEqual(t, validators[0].ABCIValidatorUpdateZero(), updates[1]) assert.DeepEqual(t, validators[2].ABCIValidatorUpdate(f.stakingKeeper.PowerReduction(f.sdkCtx)), updates[0]) } func TestApplyAndReturnValidatorSetUpdatesNewValidator(t *testing.T) { f, _, _ := bootstrapValidatorTest(t, 1000, 20) - params := f.stakingKeeper.GetParams(f.sdkCtx) + params, err := f.stakingKeeper.GetParams(f.sdkCtx) + assert.NilError(t, err) params.MaxValidators = uint32(3) - f.stakingKeeper.SetParams(f.sdkCtx, params) + assert.NilError(t, f.stakingKeeper.SetParams(f.sdkCtx, params)) powers := []int64{100, 100} var validators [2]types.Validator @@ -684,8 +735,13 @@ func TestApplyAndReturnValidatorSetUpdatesNewValidator(t *testing.T) { // verify initial CometBFT updates are correct updates := applyValidatorSetUpdates(t, f.sdkCtx, f.stakingKeeper, len(validators)) - validators[0], _ = f.stakingKeeper.GetValidator(f.sdkCtx, validators[0].GetOperator()) - validators[1], _ = f.stakingKeeper.GetValidator(f.sdkCtx, validators[1].GetOperator()) + + val0bz, err := f.stakingKeeper.ValidatorAddressCodec().StringToBytes(validators[0].GetOperator()) + assert.NilError(t, err) + val1bz, err := f.stakingKeeper.ValidatorAddressCodec().StringToBytes(validators[1].GetOperator()) + assert.NilError(t, err) + validators[0], _ = f.stakingKeeper.GetValidator(f.sdkCtx, val0bz) + validators[1], _ = f.stakingKeeper.GetValidator(f.sdkCtx, val1bz) assert.DeepEqual(t, validators[0].ABCIValidatorUpdate(f.stakingKeeper.PowerReduction(f.sdkCtx)), updates[0]) assert.DeepEqual(t, validators[1].ABCIValidatorUpdate(f.stakingKeeper.PowerReduction(f.sdkCtx)), updates[1]) @@ -706,14 +762,14 @@ func TestApplyAndReturnValidatorSetUpdatesNewValidator(t *testing.T) { // zero power valPubKey := PKs[len(validators)+1] valAddr := sdk.ValAddress(valPubKey.Address().Bytes()) - amt := sdk.NewInt(100) + amt := math.NewInt(100) validator := testutil.NewValidator(t, valAddr, valPubKey) validator, _ = validator.AddTokensFromDel(amt) f.stakingKeeper.SetValidator(f.sdkCtx, validator) - validator, _ = validator.RemoveDelShares(sdk.NewDecFromInt(amt)) + validator, _ = validator.RemoveDelShares(math.LegacyNewDecFromInt(amt)) f.stakingKeeper.SetValidator(f.sdkCtx, validator) f.stakingKeeper.SetValidatorByPowerIndex(f.sdkCtx, validator) @@ -729,9 +785,11 @@ func TestApplyAndReturnValidatorSetUpdatesNewValidator(t *testing.T) { // verify initial CometBFT updates are correct updates = applyValidatorSetUpdates(t, f.sdkCtx, f.stakingKeeper, len(validators)+1) - validator, _ = f.stakingKeeper.GetValidator(f.sdkCtx, validator.GetOperator()) - validators[0], _ = f.stakingKeeper.GetValidator(f.sdkCtx, validators[0].GetOperator()) - validators[1], _ = f.stakingKeeper.GetValidator(f.sdkCtx, validators[1].GetOperator()) + valbz, err := f.stakingKeeper.ValidatorAddressCodec().StringToBytes(validator.GetOperator()) + assert.NilError(t, err) + validator, _ = f.stakingKeeper.GetValidator(f.sdkCtx, valbz) + validators[0], _ = f.stakingKeeper.GetValidator(f.sdkCtx, val0bz) + validators[1], _ = f.stakingKeeper.GetValidator(f.sdkCtx, val1bz) assert.DeepEqual(t, validator.ABCIValidatorUpdate(f.stakingKeeper.PowerReduction(f.sdkCtx)), updates[0]) assert.DeepEqual(t, validators[0].ABCIValidatorUpdate(f.stakingKeeper.PowerReduction(f.sdkCtx)), updates[1]) assert.DeepEqual(t, validators[1].ABCIValidatorUpdate(f.stakingKeeper.PowerReduction(f.sdkCtx)), updates[2]) @@ -739,10 +797,11 @@ func TestApplyAndReturnValidatorSetUpdatesNewValidator(t *testing.T) { func TestApplyAndReturnValidatorSetUpdatesBondTransition(t *testing.T) { f, _, _ := bootstrapValidatorTest(t, 1000, 20) - params := f.stakingKeeper.GetParams(f.sdkCtx) + params, err := f.stakingKeeper.GetParams(f.sdkCtx) + assert.NilError(t, err) params.MaxValidators = uint32(2) - f.stakingKeeper.SetParams(f.sdkCtx, params) + assert.NilError(t, f.stakingKeeper.SetParams(f.sdkCtx, params)) powers := []int64{100, 200, 300} var validators [3]types.Validator @@ -762,8 +821,12 @@ func TestApplyAndReturnValidatorSetUpdatesBondTransition(t *testing.T) { // verify initial CometBFT updates are correct updates := applyValidatorSetUpdates(t, f.sdkCtx, f.stakingKeeper, 2) - validators[2], _ = f.stakingKeeper.GetValidator(f.sdkCtx, validators[2].GetOperator()) - validators[1], _ = f.stakingKeeper.GetValidator(f.sdkCtx, validators[1].GetOperator()) + val1bz, err := f.stakingKeeper.ValidatorAddressCodec().StringToBytes(validators[1].GetOperator()) + assert.NilError(t, err) + val2bz, err := f.stakingKeeper.ValidatorAddressCodec().StringToBytes(validators[2].GetOperator()) + assert.NilError(t, err) + validators[2], _ = f.stakingKeeper.GetValidator(f.sdkCtx, val2bz) + validators[1], _ = f.stakingKeeper.GetValidator(f.sdkCtx, val1bz) assert.DeepEqual(t, validators[2].ABCIValidatorUpdate(f.stakingKeeper.PowerReduction(f.sdkCtx)), updates[0]) assert.DeepEqual(t, validators[1].ABCIValidatorUpdate(f.stakingKeeper.PowerReduction(f.sdkCtx)), updates[1]) @@ -772,9 +835,10 @@ func TestApplyAndReturnValidatorSetUpdatesBondTransition(t *testing.T) { // delegate to validator with lowest power but not enough to bond f.sdkCtx = f.sdkCtx.WithBlockHeight(1) - var found bool - validators[0], found = f.stakingKeeper.GetValidator(f.sdkCtx, validators[0].GetOperator()) - assert.Assert(t, found) + val0bz, err := f.stakingKeeper.ValidatorAddressCodec().StringToBytes(validators[0].GetOperator()) + assert.NilError(t, err) + validators[0], err = f.stakingKeeper.GetValidator(f.sdkCtx, val0bz) + assert.NilError(t, err) f.stakingKeeper.DeleteValidatorByPowerIndex(f.sdkCtx, validators[0]) tokens := f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, 1) @@ -789,8 +853,8 @@ func TestApplyAndReturnValidatorSetUpdatesBondTransition(t *testing.T) { // lowest power in a single block context (height) f.sdkCtx = f.sdkCtx.WithBlockHeight(2) - validators[1], found = f.stakingKeeper.GetValidator(f.sdkCtx, validators[1].GetOperator()) - assert.Assert(t, found) + validators[1], err = f.stakingKeeper.GetValidator(f.sdkCtx, val1bz) + assert.NilError(t, err) f.stakingKeeper.DeleteValidatorByPowerIndex(f.sdkCtx, validators[0]) validators[0], _ = validators[0].RemoveDelShares(validators[0].DelegatorShares) diff --git a/tests/integration/staking/keeper/vote_extensions_test.go b/tests/integration/staking/keeper/vote_extensions_test.go new file mode 100644 index 000000000000..8b6e3d355e9a --- /dev/null +++ b/tests/integration/staking/keeper/vote_extensions_test.go @@ -0,0 +1,148 @@ +package keeper_test + +import ( + "bytes" + "sort" + "testing" + + abci "github.com/cometbft/cometbft/abci/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + protoio "github.com/cosmos/gogoproto/io" + "github.com/cosmos/gogoproto/proto" + "gotest.tools/v3/assert" + + "cosmossdk.io/core/comet" + "cosmossdk.io/core/header" + "cosmossdk.io/math" + + "github.com/cosmos/cosmos-sdk/baseapp" + ed25519 "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/staking/testutil" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" +) + +const chainID = "chain-id-123" + +// TestValidateVoteExtensions is a unit test function that tests the validation of vote extensions. +// It sets up the necessary fixtures and validators, generates vote extensions for each validator, +// and validates the vote extensions using the baseapp.ValidateVoteExtensions function. +func TestValidateVoteExtensions(t *testing.T) { + t.Parallel() + f := initFixture(t) + + // enable vote extensions + cp := simtestutil.DefaultConsensusParams + cp.Abci = &cmtproto.ABCIParams{VoteExtensionsEnableHeight: 1} + f.sdkCtx = f.sdkCtx.WithConsensusParams(*cp).WithHeaderInfo(header.Info{Height: 2, ChainID: chainID}) + + // setup the validators + numVals := 1 + privKeys := []cryptotypes.PrivKey{} + for i := 0; i < numVals; i++ { + privKeys = append(privKeys, ed25519.GenPrivKey()) + } + + vals := []stakingtypes.Validator{} + for _, v := range privKeys { + valAddr := sdk.ValAddress(v.PubKey().Address()) + simtestutil.AddTestAddrsFromPubKeys(f.bankKeeper, f.stakingKeeper, f.sdkCtx, []cryptotypes.PubKey{v.PubKey()}, math.NewInt(100000000000)) + vals = append(vals, testutil.NewValidator(t, valAddr, v.PubKey())) + } + + votes := []abci.ExtendedVoteInfo{} + + for i, v := range vals { + v.Tokens = math.NewInt(1000000) + v.Status = stakingtypes.Bonded + assert.NilError(t, f.stakingKeeper.SetValidator(f.sdkCtx, v)) + assert.NilError(t, f.stakingKeeper.SetValidatorByConsAddr(f.sdkCtx, v)) + assert.NilError(t, f.stakingKeeper.SetNewValidatorByPowerIndex(f.sdkCtx, v)) + _, err := f.stakingKeeper.Delegate(f.sdkCtx, sdk.AccAddress(privKeys[i].PubKey().Address()), v.Tokens, stakingtypes.Unbonded, v, true) + assert.NilError(t, err) + + // each val produces a vote + voteExt := []byte("something" + v.OperatorAddress) + cve := cmtproto.CanonicalVoteExtension{ + Extension: voteExt, + Height: f.sdkCtx.HeaderInfo().Height - 1, // the vote extension was signed in the previous height + Round: 0, + ChainId: chainID, + } + + extSignBytes, err := mashalVoteExt(&cve) + assert.NilError(t, err) + + sig, err := privKeys[i].Sign(extSignBytes) + assert.NilError(t, err) + + valbz, err := f.stakingKeeper.ValidatorAddressCodec().StringToBytes(v.GetOperator()) + assert.NilError(t, err) + ve := abci.ExtendedVoteInfo{ + Validator: abci.Validator{ + Address: valbz, + Power: 1000, + }, + VoteExtension: voteExt, + ExtensionSignature: sig, + BlockIdFlag: cmtproto.BlockIDFlagCommit, + } + votes = append(votes, ve) + } + + eci, ci := extendedCommitToLastCommit(abci.ExtendedCommitInfo{Round: 0, Votes: votes}) + f.sdkCtx = f.sdkCtx.WithCometInfo(ci) + + err := baseapp.ValidateVoteExtensions(f.sdkCtx, f.stakingKeeper, 0, "", eci) + assert.NilError(t, err) +} + +func mashalVoteExt(msg proto.Message) ([]byte, error) { + var buf bytes.Buffer + if err := protoio.NewDelimitedWriter(&buf).WriteMsg(msg); err != nil { + return nil, err + } + + return buf.Bytes(), nil +} + +func extendedCommitToLastCommit(ec abci.ExtendedCommitInfo) (abci.ExtendedCommitInfo, comet.BlockInfo) { + // sort the extended commit info + sort.Sort(extendedVoteInfos(ec.Votes)) + + // convert the extended commit info to last commit info + lastCommit := abci.CommitInfo{ + Round: ec.Round, + Votes: make([]abci.VoteInfo, len(ec.Votes)), + } + + for i, vote := range ec.Votes { + lastCommit.Votes[i] = abci.VoteInfo{ + Validator: abci.Validator{ + Address: vote.Validator.Address, + Power: vote.Validator.Power, + }, + } + } + + return ec, baseapp.NewBlockInfo(nil, nil, nil, lastCommit) +} + +type extendedVoteInfos []abci.ExtendedVoteInfo + +func (v extendedVoteInfos) Len() int { + return len(v) +} + +func (v extendedVoteInfos) Less(i, j int) bool { + if v[i].Validator.Power == v[j].Validator.Power { + return bytes.Compare(v[i].Validator.Address, v[j].Validator.Address) == -1 + } + return v[i].Validator.Power > v[j].Validator.Power +} + +func (v extendedVoteInfos) Swap(i, j int) { + v[i], v[j] = v[j], v[i] +} diff --git a/tests/integration/store/rootmulti/rollback_test.go b/tests/integration/store/rootmulti/rollback_test.go index 947a41ab9e97..9e4454bdcb1b 100644 --- a/tests/integration/store/rootmulti/rollback_test.go +++ b/tests/integration/store/rootmulti/rollback_test.go @@ -4,13 +4,14 @@ import ( "fmt" "testing" - "cosmossdk.io/log" - "cosmossdk.io/simapp" abci "github.com/cometbft/cometbft/abci/types" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" dbm "github.com/cosmos/cosmos-db" "gotest.tools/v3/assert" + "cosmossdk.io/log" + "cosmossdk.io/simapp" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" ) diff --git a/tests/integration/tx/aminojson/aminojson_test.go b/tests/integration/tx/aminojson/aminojson_test.go index 9c7a0ce06e61..8d4c32e7b666 100644 --- a/tests/integration/tx/aminojson/aminojson_test.go +++ b/tests/integration/tx/aminojson/aminojson_test.go @@ -2,13 +2,14 @@ package aminojson import ( "context" + "encoding/json" "fmt" "reflect" "testing" "time" - gov_v1_api "cosmossdk.io/api/cosmos/gov/v1" - msgv1 "cosmossdk.io/api/cosmos/msg/v1" + "github.com/cosmos/cosmos-proto/rapidproto" + gogoproto "github.com/cosmos/gogoproto/proto" "github.com/stretchr/testify/require" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/known/anypb" @@ -16,9 +17,6 @@ import ( "google.golang.org/protobuf/types/known/timestamppb" "pgregory.net/rapid" - "github.com/cosmos/cosmos-proto/rapidproto" - gogoproto "github.com/cosmos/gogoproto/proto" - authapi "cosmossdk.io/api/cosmos/auth/v1beta1" authzapi "cosmossdk.io/api/cosmos/authz/v1beta1" bankapi "cosmossdk.io/api/cosmos/bank/v1beta1" @@ -27,7 +25,9 @@ import ( multisigapi "cosmossdk.io/api/cosmos/crypto/multisig" "cosmossdk.io/api/cosmos/crypto/secp256k1" distapi "cosmossdk.io/api/cosmos/distribution/v1beta1" + gov_v1_api "cosmossdk.io/api/cosmos/gov/v1" gov_v1beta1_api "cosmossdk.io/api/cosmos/gov/v1beta1" + msgv1 "cosmossdk.io/api/cosmos/msg/v1" slashingapi "cosmossdk.io/api/cosmos/slashing/v1beta1" stakingapi "cosmossdk.io/api/cosmos/staking/v1beta1" txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" @@ -50,7 +50,6 @@ import ( "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/bech32" "github.com/cosmos/cosmos-sdk/types/module/testutil" - txtypes "github.com/cosmos/cosmos-sdk/types/tx" signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/x/auth" "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" @@ -99,7 +98,7 @@ func TestAminoJSON_Equivalence(t *testing.T) { gov.AppModuleBasic{}, groupmodule.AppModuleBasic{}, mint.AppModuleBasic{}, params.AppModuleBasic{}, slashing.AppModuleBasic{}, staking.AppModuleBasic{}, upgrade.AppModuleBasic{}, vesting.AppModuleBasic{}) legacytx.RegressionTestingAminoCodec = encCfg.Amino - aj := aminojson.NewEncoder(aminojson.EncoderOptions{DoNotSortFields: true}) + aj := aminojson.NewEncoder(aminojson.EncoderOptions{}) for _, tt := range rapidgen.DefaultGeneratedTypes { desc := tt.Pulsar.ProtoReflect().Descriptor() @@ -133,6 +132,7 @@ func TestAminoJSON_Equivalence(t *testing.T) { legacyAminoJSON, err := encCfg.Amino.MarshalJSON(gogo) require.NoError(t, err) + legacyAminoJSON = sortJSON(t, legacyAminoJSON) aminoJSON, err := aj.Marshal(msg) require.NoError(t, err) require.Equal(t, string(legacyAminoJSON), string(aminoJSON)) @@ -150,10 +150,6 @@ func TestAminoJSON_Equivalence(t *testing.T) { AccNum: 1, AccSeq: 2, SignerAddress: "signerAddress", - Tip: &txv1beta1.Tip{ - Tipper: "tipper", - Amount: []*v1beta1.Coin{{Denom: "uatom", Amount: "1000"}}, - }, Fee: &txv1beta1.Fee{ Amount: []*v1beta1.Coin{{Denom: "uatom", Amount: "1000"}}, }, @@ -171,10 +167,6 @@ func TestAminoJSON_Equivalence(t *testing.T) { require.NoError(t, txBuilder.SetMsgs([]types.Msg{tt.Gogo}...)) txBuilder.SetMemo(handlerOptions.Memo) txBuilder.SetFeeAmount(types.Coins{types.NewInt64Coin("uatom", 1000)}) - txBuilder.SetTip(&txtypes.Tip{ - Amount: types.Coins{types.NewInt64Coin("uatom", 1000)}, - Tipper: "tipper", - }) theTx := txBuilder.GetTx() legacySigningData := signing.SignerData{ @@ -218,7 +210,7 @@ func TestAminoJSON_LegacyParity(t *testing.T) { pubkeyAny, _ := codectypes.NewAnyWithValue(&secp256k1types.PubKey{Key: []byte("foo")}) pubkeyAnyPulsar := newAny(t, &secp256k1.PubKey{Key: []byte("foo")}) dec10bz, _ := math.LegacyNewDec(10).Marshal() - int123bz, _ := types.NewInt(123).Marshal() + int123bz, _ := math.NewInt(123).Marshal() cases := map[string]struct { gogo gogoproto.Message @@ -229,19 +221,21 @@ func TestAminoJSON_LegacyParity(t *testing.T) { // represent the array as nil, and a subsequent marshal to JSON represent the array as null instead of empty. roundTripUnequal bool - // pulsar does not support marshaling a math.Dec as anything except a string. Therefore, we cannot unmarshal - // a pulsar encoded Math.dec (the string representation of a Decimal) into a gogo Math.dec (expecting an int64). - protoUnmarshalFails bool + // sort JSON bytes before comparison. for certain types (like ModuleAccount) x/tx is not able to provide an + // unsorted version. note that the legacy amino signer always sorted JSON bytes by round tripping them to/from + // JSON before signing over them. + sortJSON bool }{ "auth/params": {gogo: &authtypes.Params{TxSigLimit: 10}, pulsar: &authapi.Params{TxSigLimit: 10}}, "auth/module_account": { gogo: &authtypes.ModuleAccount{ - BaseAccount: authtypes.NewBaseAccountWithAddress(addr1), Permissions: []string{}, + BaseAccount: authtypes.NewBaseAccountWithAddress(addr1), }, pulsar: &authapi.ModuleAccount{ - BaseAccount: &authapi.BaseAccount{Address: addr1.String()}, Permissions: []string{}, + BaseAccount: &authapi.BaseAccount{Address: addr1.String()}, }, roundTripUnequal: true, + sortJSON: true, }, "auth/base_account": { gogo: &authtypes.BaseAccount{Address: addr1.String(), PubKey: pubkeyAny}, @@ -268,9 +262,8 @@ func TestAminoJSON_LegacyParity(t *testing.T) { pulsar: &distapi.DelegatorStartingInfo{}, }, "distribution/delegator_starting_info/non_zero_dec": { - gogo: &disttypes.DelegatorStartingInfo{Stake: math.LegacyNewDec(10)}, - pulsar: &distapi.DelegatorStartingInfo{Stake: "10.000000000000000000"}, - protoUnmarshalFails: true, + gogo: &disttypes.DelegatorStartingInfo{Stake: math.LegacyNewDec(10)}, + pulsar: &distapi.DelegatorStartingInfo{Stake: string(dec10bz)}, }, "distribution/delegation_delegator_reward": { gogo: &disttypes.DelegationDelegatorReward{}, @@ -278,7 +271,7 @@ func TestAminoJSON_LegacyParity(t *testing.T) { }, "distribution/community_pool_spend_proposal_with_deposit": { gogo: &disttypes.CommunityPoolSpendProposalWithDeposit{}, - pulsar: &distapi.CommunityPoolSpendProposalWithDeposit{}, + pulsar: &distapi.CommunityPoolSpendProposalWithDeposit{}, //nolint:staticcheck // keep test as is testing legacy parity }, "distribution/msg_withdraw_delegator_reward": { gogo: &disttypes.MsgWithdrawDelegatorReward{DelegatorAddress: "foo"}, @@ -292,13 +285,17 @@ func TestAminoJSON_LegacyParity(t *testing.T) { gogo: &secp256k1types.PubKey{Key: []byte("key")}, pulsar: &secp256k1.PubKey{Key: []byte("key")}, }, - "crypto/legacy_amino_pubkey": { - gogo: &multisig.LegacyAminoPubKey{PubKeys: []*codectypes.Any{pubkeyAny}}, - pulsar: &multisigapi.LegacyAminoPubKey{PublicKeys: []*anypb.Any{pubkeyAnyPulsar}}, + "crypto/legacy_amino_pubkey/filled": { + gogo: &multisig.LegacyAminoPubKey{PubKeys: []*codectypes.Any{pubkeyAny}}, + pulsar: &multisigapi.LegacyAminoPubKey{PublicKeys: []*anypb.Any{pubkeyAnyPulsar}}, + sortJSON: true, + roundTripUnequal: true, }, "crypto/legacy_amino_pubkey/empty": { - gogo: &multisig.LegacyAminoPubKey{}, - pulsar: &multisigapi.LegacyAminoPubKey{}, + gogo: &multisig.LegacyAminoPubKey{}, + pulsar: &multisigapi.LegacyAminoPubKey{}, + sortJSON: true, + roundTripUnequal: true, }, "consensus/evidence_params/duration": { gogo: &gov_v1beta1_types.VotingParams{VotingPeriod: 1e9 + 7}, @@ -349,6 +346,14 @@ func TestAminoJSON_LegacyParity(t *testing.T) { // This test cases demonstrates the expected contract and proper way to set a cosmos.Dec field represented // as bytes in protobuf message, namely: // dec10bz, _ := types.NewDec(10).Marshal() + "gov/v1_params": { + gogo: &gov_v1_types.Params{ + Quorum: math.LegacyMustNewDecFromStr("0.33").String(), + }, + pulsar: &gov_v1_api.Params{ + Quorum: math.LegacyMustNewDecFromStr("0.33").String(), + }, + }, "slashing/params/dec": { gogo: &slashingtypes.Params{ DowntimeJailDuration: 1e9 + 7, @@ -397,7 +402,7 @@ func TestAminoJSON_LegacyParity(t *testing.T) { pulsar: &vestingapi.BaseVestingAccount{BaseAccount: &authapi.BaseAccount{PubKey: pubkeyAnyPulsar}}, }, "math/int_as_string": { - gogo: &gogo_testpb.IntAsString{IntAsString: types.NewInt(123)}, + gogo: &gogo_testpb.IntAsString{IntAsString: math.NewInt(123)}, pulsar: &pulsar_testpb.IntAsString{IntAsString: "123"}, }, "math/int_as_string/empty": { @@ -405,7 +410,7 @@ func TestAminoJSON_LegacyParity(t *testing.T) { pulsar: &pulsar_testpb.IntAsString{}, }, "math/int_as_bytes": { - gogo: &gogo_testpb.IntAsBytes{IntAsBytes: types.NewInt(123)}, + gogo: &gogo_testpb.IntAsBytes{IntAsBytes: math.NewInt(123)}, pulsar: &pulsar_testpb.IntAsBytes{IntAsBytes: int123bz}, }, "math/int_as_bytes/empty": { @@ -417,6 +422,9 @@ func TestAminoJSON_LegacyParity(t *testing.T) { t.Run(name, func(t *testing.T) { gogoBytes, err := encCfg.Amino.MarshalJSON(tc.gogo) require.NoError(t, err) + if tc.sortJSON { + gogoBytes = sortJSON(t, gogoBytes) + } pulsarBytes, err := aj.Marshal(tc.pulsar) if tc.pulsarMarshalFails { @@ -436,10 +444,6 @@ func TestAminoJSON_LegacyParity(t *testing.T) { newGogo := reflect.New(gogoType).Interface().(gogoproto.Message) err = encCfg.Codec.Unmarshal(pulsarProtoBytes, newGogo) - if tc.protoUnmarshalFails { - require.Error(t, err) - return - } require.NoError(t, err) newGogoBytes, err := encCfg.Amino.MarshalJSON(newGogo) @@ -583,3 +587,12 @@ func postFixPulsarMessage(msg proto.Message) { } } } + +func sortJSON(t require.TestingT, bz []byte) []byte { + var c interface{} + err := json.Unmarshal(bz, &c) + require.NoError(t, err) + bz, err = json.Marshal(c) + require.NoError(t, err) + return bz +} diff --git a/tests/integration/tx/aminojson/repeated_test.go b/tests/integration/tx/aminojson/repeated_test.go index 081d43c172b9..41a335e2e699 100644 --- a/tests/integration/tx/aminojson/repeated_test.go +++ b/tests/integration/tx/aminojson/repeated_test.go @@ -5,9 +5,8 @@ import ( "testing" gogoproto "github.com/cosmos/gogoproto/proto" - "google.golang.org/protobuf/proto" - "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" "cosmossdk.io/x/tx/signing/aminojson" diff --git a/tests/integration/tx/context_test.go b/tests/integration/tx/context_test.go index 62daad659ded..2210c9c934fd 100644 --- a/tests/integration/tx/context_test.go +++ b/tests/integration/tx/context_test.go @@ -3,11 +3,12 @@ package tx import ( "testing" + "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" + "cosmossdk.io/depinject" "cosmossdk.io/log" "cosmossdk.io/x/tx/signing" - "github.com/stretchr/testify/require" - "google.golang.org/protobuf/proto" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/tests/integration/tx/internal/pulsar/testpb" diff --git a/tests/integration/tx/decode_test.go b/tests/integration/tx/decode_test.go index 0e601a7e97d3..f22123e79732 100644 --- a/tests/integration/tx/decode_test.go +++ b/tests/integration/tx/decode_test.go @@ -3,13 +3,14 @@ package tx import ( "testing" - msgv1 "cosmossdk.io/api/cosmos/msg/v1" "github.com/cosmos/cosmos-proto/rapidproto" gogoproto "github.com/cosmos/gogoproto/proto" "github.com/stretchr/testify/require" "google.golang.org/protobuf/proto" "pgregory.net/rapid" + msgv1 "cosmossdk.io/api/cosmos/msg/v1" + "cosmossdk.io/math" "cosmossdk.io/x/evidence" feegrantmodule "cosmossdk.io/x/feegrant/module" "cosmossdk.io/x/tx/decode" @@ -48,7 +49,7 @@ func TestDecode(t *testing.T) { slashing.AppModuleBasic{}, staking.AppModuleBasic{}, upgrade.AppModuleBasic{}, vesting.AppModuleBasic{}) legacytx.RegressionTestingAminoCodec = encCfg.Amino - fee := sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(100))) + fee := sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(100))) gas := uint64(200) memo := "memo" accSeq := uint64(2) diff --git a/tests/integration/tx/internal/buf.lock b/tests/integration/tx/internal/buf.lock index 88709c98ef99..6cfbc809c3f1 100644 --- a/tests/integration/tx/internal/buf.lock +++ b/tests/integration/tx/internal/buf.lock @@ -5,7 +5,15 @@ deps: owner: cosmos repository: cosmos-proto commit: 1935555c206d4afb9e94615dfd0fad31 + - remote: buf.build + owner: cosmos + repository: cosmos-sdk + commit: 4067d92aa6344f549e84824ab7f22d4f - remote: buf.build owner: cosmos repository: gogo-proto - commit: 34d970b699f84aa382f3c29773a60836 + commit: 5e5b9fdd01804356895f8f79a6f1ddc1 + - remote: buf.build + owner: googleapis + repository: googleapis + commit: cc916c31859748a68fd229a3c8d7a2e8 diff --git a/tests/integration/tx/internal/buf.yaml b/tests/integration/tx/internal/buf.yaml index 5aee45ac2b4f..02f98c15634b 100644 --- a/tests/integration/tx/internal/buf.yaml +++ b/tests/integration/tx/internal/buf.yaml @@ -1,5 +1,6 @@ version: v1 deps: + - buf.build/cosmos/cosmos-sdk - buf.build/cosmos/cosmos-proto - buf.build/cosmos/gogo-proto lint: diff --git a/tests/integration/tx/internal/gogo/testpb/test.pb.go b/tests/integration/tx/internal/gogo/testpb/test.pb.go index 9ae36d6492cd..a9bcb1000c80 100644 --- a/tests/integration/tx/internal/gogo/testpb/test.pb.go +++ b/tests/integration/tx/internal/gogo/testpb/test.pb.go @@ -5,9 +5,9 @@ package testpb import ( context "context" + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-proto" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" @@ -222,7 +222,7 @@ func (m *TestNullableFields) GetNonNullableDontOmitempty() Streng { } type IntAsString struct { - IntAsString github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=int_as_string,json=intAsString,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"int_as_string"` + IntAsString cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=int_as_string,json=intAsString,proto3,customtype=cosmossdk.io/math.Int" json:"int_as_string"` } func (m *IntAsString) Reset() { *m = IntAsString{} } @@ -259,7 +259,7 @@ func (m *IntAsString) XXX_DiscardUnknown() { var xxx_messageInfo_IntAsString proto.InternalMessageInfo type IntAsBytes struct { - IntAsBytes github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=int_as_bytes,json=intAsBytes,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"int_as_bytes"` + IntAsBytes cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=int_as_bytes,json=intAsBytes,proto3,customtype=cosmossdk.io/math.Int" json:"int_as_bytes"` } func (m *IntAsBytes) Reset() { *m = IntAsBytes{} } @@ -306,37 +306,37 @@ func init() { func init() { proto.RegisterFile("testpb/test.proto", fileDescriptor_41c67e33ca9d1f26) } var fileDescriptor_41c67e33ca9d1f26 = []byte{ - // 473 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x4f, 0x6b, 0x13, 0x41, - 0x14, 0xdf, 0x69, 0x9b, 0x40, 0x5f, 0xaa, 0x90, 0x21, 0xda, 0xb8, 0xc2, 0xb6, 0xe4, 0x20, 0x45, - 0xe8, 0x2e, 0xd6, 0xb3, 0x87, 0x06, 0x29, 0x44, 0xa8, 0xc2, 0xda, 0x83, 0xb7, 0x65, 0x37, 0x19, - 0xd6, 0xc1, 0xdd, 0x37, 0x6b, 0xe6, 0xa5, 0x98, 0x9b, 0x1f, 0xc1, 0x8f, 0xe1, 0xd1, 0x83, 0x1f, - 0x22, 0xc7, 0xe2, 0x49, 0x3c, 0x14, 0x49, 0x0e, 0x7e, 0x0d, 0x99, 0x9d, 0xdd, 0xb4, 0xb5, 0x41, - 0x41, 0x72, 0xd9, 0x79, 0xff, 0xe6, 0xf7, 0xfb, 0xf1, 0xe3, 0xcd, 0x42, 0x9b, 0x84, 0xa6, 0x22, - 0x09, 0xcc, 0xe1, 0x17, 0x63, 0x45, 0x8a, 0x37, 0x6d, 0xc9, 0xdd, 0x1d, 0x2a, 0x9d, 0x2b, 0x1d, - 0xe4, 0x3a, 0x0d, 0xce, 0x9f, 0x98, 0xc3, 0x0e, 0xb8, 0x9d, 0x54, 0xa5, 0xaa, 0x0c, 0x03, 0x13, - 0x55, 0xd5, 0x76, 0x9c, 0x4b, 0x54, 0x41, 0xf9, 0xad, 0x4a, 0x0f, 0x2c, 0x42, 0x64, 0x67, 0x6d, - 0x62, 0x5b, 0x3d, 0x0f, 0x9a, 0x9a, 0xc6, 0x02, 0x53, 0xde, 0x81, 0xc6, 0x79, 0x9c, 0x4d, 0x44, - 0x97, 0xed, 0xb3, 0x83, 0xed, 0xd0, 0x26, 0xbd, 0xd9, 0x06, 0xf0, 0x33, 0xa1, 0x29, 0x14, 0x85, - 0x88, 0x49, 0x8c, 0x4e, 0xa4, 0xc8, 0x46, 0x9a, 0x3f, 0x03, 0x8e, 0x93, 0x2c, 0x8b, 0x93, 0x4c, - 0x44, 0x2a, 0x97, 0x24, 0xf2, 0x82, 0xa6, 0x5d, 0xb6, 0xbf, 0x79, 0xd0, 0x3a, 0xba, 0xeb, 0x5b, - 0xe1, 0xbe, 0x05, 0x0e, 0xdb, 0xf5, 0xe4, 0xab, 0x7a, 0x90, 0x9f, 0xc2, 0xee, 0xf2, 0xfa, 0x48, - 0x21, 0x5d, 0xc3, 0xd8, 0x58, 0x85, 0xd1, 0x6f, 0x7c, 0xfe, 0xf5, 0xe5, 0x31, 0x0b, 0xef, 0xd5, - 0xb7, 0x9e, 0x2b, 0xa4, 0x2b, 0xb8, 0x17, 0x70, 0x1f, 0x15, 0x46, 0x2b, 0x14, 0x6d, 0xae, 0x44, - 0xdb, 0x9a, 0x5d, 0xee, 0x39, 0x61, 0x07, 0x15, 0xbe, 0xbc, 0x25, 0xed, 0x0d, 0x3c, 0xbc, 0x81, - 0xf5, 0x87, 0xbc, 0xad, 0x95, 0x80, 0xdb, 0x06, 0xd0, 0x4a, 0xec, 0x5e, 0x43, 0xbd, 0xa1, 0x72, - 0x69, 0x65, 0xdd, 0xfd, 0x87, 0x95, 0x6c, 0x0d, 0x56, 0xb2, 0xb5, 0x5a, 0xc9, 0xd6, 0x6d, 0x25, - 0xfb, 0x5f, 0x2b, 0x09, 0x5a, 0x03, 0xa4, 0x63, 0xfd, 0x9a, 0xc6, 0x12, 0x53, 0x2e, 0xe0, 0x8e, - 0x44, 0x8a, 0x62, 0x1d, 0xe9, 0xb2, 0x60, 0x57, 0xb8, 0x7f, 0x6c, 0xa0, 0x7e, 0x5c, 0xee, 0x3d, - 0x4a, 0x25, 0xbd, 0x9d, 0x24, 0xfe, 0x50, 0xe5, 0xd5, 0xf2, 0x57, 0xc7, 0xa1, 0x1e, 0xbd, 0x0b, - 0x68, 0x5a, 0x08, 0xed, 0x0f, 0x90, 0xbe, 0x7d, 0x3d, 0x84, 0xea, 0x6d, 0x0c, 0x90, 0xac, 0x84, - 0x96, 0xbc, 0xa2, 0xe9, 0xbd, 0x07, 0x28, 0x59, 0xfb, 0x53, 0x12, 0x9a, 0x0f, 0x61, 0xa7, 0x22, - 0x4d, 0x4c, 0x5e, 0x72, 0xee, 0xac, 0x83, 0x13, 0xe4, 0x92, 0xe4, 0x48, 0x40, 0x67, 0x80, 0x24, - 0xd2, 0x71, 0x4c, 0x52, 0xe1, 0xd9, 0x07, 0xb3, 0x3f, 0xa7, 0x3a, 0xe5, 0x27, 0x00, 0x26, 0xac, - 0x56, 0xc8, 0xad, 0x3d, 0xbc, 0xfd, 0x52, 0xdd, 0xbf, 0xf4, 0x7a, 0x8e, 0xdb, 0xf8, 0x68, 0x28, - 0xfb, 0xdd, 0xd9, 0xdc, 0x63, 0x17, 0x73, 0x8f, 0xfd, 0x9c, 0x7b, 0xec, 0xd3, 0xc2, 0x73, 0x2e, - 0x16, 0x9e, 0xf3, 0x7d, 0xe1, 0x39, 0x49, 0xb3, 0xfc, 0x4d, 0x3c, 0xfd, 0x1d, 0x00, 0x00, 0xff, - 0xff, 0xde, 0xf7, 0xd7, 0x03, 0xa0, 0x04, 0x00, 0x00, + // 466 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0x41, 0x6b, 0xd4, 0x40, + 0x14, 0xc7, 0x33, 0x6d, 0x77, 0xa1, 0x6f, 0xab, 0xb0, 0xc3, 0xd6, 0xae, 0x11, 0xd2, 0xb2, 0xa7, + 0x22, 0x98, 0x68, 0x3d, 0x7b, 0x70, 0x91, 0xc2, 0x0a, 0x55, 0x88, 0x7b, 0xf0, 0x16, 0xb3, 0xdd, + 0x21, 0x0e, 0x26, 0x6f, 0x42, 0xe6, 0xb5, 0xd8, 0x9b, 0x1f, 0xc1, 0x8f, 0xe1, 0xd1, 0x83, 0x1f, + 0x62, 0x8f, 0xc5, 0x93, 0x78, 0x28, 0xb2, 0x7b, 0xf0, 0x6b, 0xc8, 0x64, 0x92, 0x6d, 0x6b, 0x83, + 0x42, 0xd9, 0x4b, 0x66, 0xe6, 0xbd, 0x37, 0xbf, 0xf7, 0xe7, 0xcf, 0x9b, 0x40, 0x97, 0x84, 0xa6, + 0x7c, 0x12, 0x98, 0xc5, 0xcf, 0x0b, 0x45, 0x8a, 0xb7, 0x6d, 0xc8, 0xdd, 0x39, 0x56, 0x3a, 0x53, + 0x3a, 0xc8, 0x74, 0x12, 0x9c, 0x3e, 0x31, 0x8b, 0x2d, 0x70, 0x7b, 0x89, 0x4a, 0x54, 0xb9, 0x0d, + 0xcc, 0xae, 0x8a, 0x76, 0xe3, 0x4c, 0xa2, 0x0a, 0xca, 0x6f, 0x15, 0xba, 0x6f, 0x09, 0x91, 0xad, + 0xb5, 0x07, 0x9b, 0x1a, 0x78, 0xd0, 0xd6, 0x54, 0x08, 0x4c, 0x78, 0x0f, 0x5a, 0xa7, 0x71, 0x7a, + 0x22, 0xfa, 0x6c, 0x8f, 0xed, 0x6f, 0x86, 0xf6, 0x30, 0x98, 0xad, 0x01, 0x1f, 0x0b, 0x4d, 0xa1, + 0xc8, 0x45, 0x4c, 0x62, 0x7a, 0x28, 0x45, 0x3a, 0xd5, 0xfc, 0x19, 0x70, 0x3c, 0x49, 0xd3, 0x78, + 0x92, 0x8a, 0x48, 0x65, 0x92, 0x44, 0x96, 0xd3, 0x59, 0x9f, 0xed, 0xad, 0xef, 0x77, 0x0e, 0xee, + 0xfa, 0x56, 0xb8, 0x6f, 0xc1, 0x61, 0xb7, 0xae, 0x7c, 0x5d, 0x17, 0xf2, 0x23, 0xd8, 0x59, 0x5e, + 0x9f, 0x2a, 0xa4, 0x2b, 0x8c, 0xb5, 0x26, 0xc6, 0xb0, 0xf5, 0xe5, 0xf7, 0xd7, 0x87, 0x2c, 0xdc, + 0xae, 0x6f, 0xbd, 0x50, 0x48, 0x97, 0xb8, 0x97, 0x70, 0x0f, 0x15, 0x46, 0x0d, 0x8a, 0xd6, 0x1b, + 0x69, 0x1b, 0xb3, 0x8b, 0x5d, 0x27, 0xec, 0xa1, 0xc2, 0x57, 0x37, 0xa4, 0xbd, 0x85, 0x07, 0xd7, + 0x58, 0x7f, 0xc9, 0xdb, 0x68, 0x04, 0x6e, 0x1a, 0xa0, 0x95, 0xd8, 0xbf, 0x42, 0xbd, 0xa6, 0x72, + 0x69, 0x65, 0x9d, 0xfd, 0x8f, 0x95, 0x6c, 0x05, 0x56, 0xb2, 0x95, 0x5a, 0xc9, 0x56, 0x6d, 0x25, + 0xbb, 0xad, 0x95, 0xc7, 0xd0, 0x19, 0x21, 0x3d, 0xd7, 0x6f, 0xa8, 0x90, 0x98, 0xf0, 0x31, 0xdc, + 0x91, 0x48, 0x51, 0xac, 0x23, 0x5d, 0x06, 0xec, 0x08, 0x0f, 0x1f, 0x1b, 0xd4, 0xcf, 0x8b, 0xdd, + 0x6d, 0x3b, 0xf1, 0x7a, 0xfa, 0xc1, 0x97, 0x2a, 0xc8, 0x62, 0x7a, 0xef, 0x8f, 0x90, 0xbe, 0x7f, + 0x7b, 0x04, 0xd5, 0x53, 0x18, 0x21, 0xd9, 0x8e, 0x1d, 0x79, 0x49, 0x1d, 0xbc, 0x03, 0x28, 0x9b, + 0x0c, 0xcf, 0x48, 0x68, 0x1e, 0xc2, 0x56, 0xd5, 0x63, 0x62, 0xce, 0x65, 0x8b, 0xad, 0x5b, 0xb4, + 0x00, 0xb9, 0x64, 0x1e, 0x08, 0xe8, 0x8d, 0x90, 0x44, 0x52, 0xc4, 0x24, 0x15, 0x8e, 0x3f, 0x9a, + 0xe9, 0x38, 0xd2, 0x09, 0x3f, 0x04, 0x30, 0xdb, 0x6a, 0x40, 0xdc, 0xda, 0xa1, 0x9b, 0xef, 0xd0, + 0xfd, 0x47, 0x6e, 0xe0, 0xb8, 0xad, 0x4f, 0xa6, 0xe5, 0xb0, 0x3f, 0x9b, 0x7b, 0xec, 0x7c, 0xee, + 0xb1, 0x5f, 0x73, 0x8f, 0x7d, 0x5e, 0x78, 0xce, 0xf9, 0xc2, 0x73, 0x7e, 0x2c, 0x3c, 0x67, 0xd2, + 0x2e, 0x7f, 0x02, 0x4f, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x5e, 0x48, 0xa0, 0x81, 0x7e, 0x04, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -406,6 +406,7 @@ func _IntegrationTxTestMsg_TestFields_Handler(srv interface{}, ctx context.Conte return interceptor(ctx, in, info, handler) } +var IntegrationTxTestMsg_serviceDesc = _IntegrationTxTestMsg_serviceDesc var _IntegrationTxTestMsg_serviceDesc = grpc.ServiceDesc{ ServiceName: "testpb.IntegrationTxTestMsg", HandlerType: (*IntegrationTxTestMsgServer)(nil), diff --git a/tests/integration/tx/internal/pulsar/testpb/test.pulsar.go b/tests/integration/tx/internal/pulsar/testpb/test.pulsar.go index c42b16edf217..9e5118b48666 100644 --- a/tests/integration/tx/internal/pulsar/testpb/test.pulsar.go +++ b/tests/integration/tx/internal/pulsar/testpb/test.pulsar.go @@ -3156,39 +3156,37 @@ var file_testpb_test_proto_rawDesc = []byte{ 0x70, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x6e, 0x67, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x18, 0x6e, 0x6f, 0x6e, 0x4e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, - 0x65, 0x44, 0x6f, 0x6e, 0x74, 0x4f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x74, - 0x0a, 0x0b, 0x49, 0x6e, 0x74, 0x41, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x65, 0x0a, + 0x65, 0x44, 0x6f, 0x6e, 0x74, 0x4f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x63, + 0x0a, 0x0b, 0x49, 0x6e, 0x74, 0x41, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x54, 0x0a, 0x0d, 0x69, 0x6e, 0x74, 0x5f, 0x61, 0x73, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x41, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x26, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, - 0x6e, 0x74, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0b, 0x69, 0x6e, 0x74, 0x41, 0x73, 0x53, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x22, 0x71, 0x0a, 0x0a, 0x49, 0x6e, 0x74, 0x41, 0x73, 0x42, 0x79, 0x74, - 0x65, 0x73, 0x12, 0x63, 0x0a, 0x0c, 0x69, 0x6e, 0x74, 0x5f, 0x61, 0x73, 0x5f, 0x62, 0x79, 0x74, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x41, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, - 0x1f, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x69, 0x6e, 0x74, - 0x41, 0x73, 0x42, 0x79, 0x74, 0x65, 0x73, 0x32, 0x65, 0x0a, 0x14, 0x49, 0x6e, 0x74, 0x65, 0x67, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x78, 0x54, 0x65, 0x73, 0x74, 0x4d, 0x73, 0x67, 0x12, - 0x46, 0x0a, 0x0a, 0x54, 0x65, 0x73, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x1a, 0x2e, - 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x70, 0x65, 0x61, - 0x74, 0x65, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x1a, 0x1a, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x70, 0x62, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x46, - 0x69, 0x65, 0x6c, 0x64, 0x73, 0x22, 0x00, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xa7, - 0x01, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x42, 0x09, 0x54, - 0x65, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x56, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x73, 0x2f, 0x69, - 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, - 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, - 0x73, 0x74, 0x70, 0x62, 0x2f, 0x70, 0x75, 0x6c, 0x73, 0x61, 0x72, 0x2f, 0x74, 0x65, 0x73, 0x74, - 0x70, 0x62, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, - 0x62, 0xca, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xe2, 0x02, 0x12, 0x54, 0x65, 0x73, - 0x74, 0x70, 0x62, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, + 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, + 0x74, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0b, 0x69, 0x6e, 0x74, 0x41, 0x73, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x22, 0x60, 0x0a, 0x0a, 0x49, 0x6e, 0x74, 0x41, 0x73, 0x42, 0x79, 0x74, 0x65, + 0x73, 0x12, 0x52, 0x0a, 0x0c, 0x69, 0x6e, 0x74, 0x5f, 0x61, 0x73, 0x5f, 0x62, 0x79, 0x74, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, + 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, + 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x49, 0x6e, 0x74, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x41, 0x73, + 0x42, 0x79, 0x74, 0x65, 0x73, 0x32, 0x65, 0x0a, 0x14, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x78, 0x54, 0x65, 0x73, 0x74, 0x4d, 0x73, 0x67, 0x12, 0x46, 0x0a, + 0x0a, 0x54, 0x65, 0x73, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x1a, 0x2e, 0x74, 0x65, + 0x73, 0x74, 0x70, 0x62, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x1a, 0x1a, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, + 0x2e, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x46, 0x69, 0x65, + 0x6c, 0x64, 0x73, 0x22, 0x00, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xa7, 0x01, 0x0a, + 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x42, 0x09, 0x54, 0x65, 0x73, + 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x56, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x73, 0x2f, 0x69, 0x6e, 0x74, + 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x6a, 0x73, + 0x6f, 0x6e, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, + 0x70, 0x62, 0x2f, 0x70, 0x75, 0x6c, 0x73, 0x61, 0x72, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, + 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xca, + 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xe2, 0x02, 0x12, 0x54, 0x65, 0x73, 0x74, 0x70, + 0x62, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, + 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/tests/integration/tx/internal/testpb/test.proto b/tests/integration/tx/internal/testpb/test.proto index e20d6996a5ab..d25ff40e5f2e 100644 --- a/tests/integration/tx/internal/testpb/test.proto +++ b/tests/integration/tx/internal/testpb/test.proto @@ -43,7 +43,7 @@ message TestNullableFields { message IntAsString { string int_as_string = 1 [ (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (amino.dont_omitempty) = true, (gogoproto.nullable) = false ]; @@ -52,7 +52,7 @@ message IntAsString { message IntAsBytes { bytes int_as_bytes = 1 [ (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (amino.dont_omitempty) = true, (gogoproto.nullable) = false ]; diff --git a/tests/systemtests/.gitignore b/tests/systemtests/.gitignore new file mode 100644 index 000000000000..1769c53afc59 --- /dev/null +++ b/tests/systemtests/.gitignore @@ -0,0 +1,3 @@ +/testnet +/binaries +foo/ diff --git a/tests/systemtests/Makefile b/tests/systemtests/Makefile new file mode 100644 index 000000000000..6680e826ce60 --- /dev/null +++ b/tests/systemtests/Makefile @@ -0,0 +1,15 @@ +#!/usr/bin/make -f + +WAIT_TIME ?= 45s + +all: test format + +test: + go test -mod=readonly -failfast -timeout=15m -tags='system_test' ./... --wait-time=$(WAIT_TIME) --verbose + +format: + find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gofumpt -w + find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs misspell -w + find . -name '*.go' -type f -not -path "./vendor*" -not -path "./tests/system/vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gci write --skip-generated -s standard -s default -s "prefix(cosmossdk.io)" -s "prefix(github.com/cosmos/cosmos-sdk)" --custom-order + +.PHONY: all test format diff --git a/tests/systemtests/README.md b/tests/systemtests/README.md new file mode 100644 index 000000000000..d2aa7112d5be --- /dev/null +++ b/tests/systemtests/README.md @@ -0,0 +1,48 @@ +# System tests + +Go black box tests that setup and interact with a local blockchain. The system test [framework](../../systemtests) +works with the compiled binary of the chain artifact only. +To get up to speed, checkout the [getting started guide](../../systemtests/getting_started.md). + +Beside the Go tests and testdata files, this directory can contain the following directories: + +* `binaries` - cache for binary +* `testnet` - node files + +Please make sure to not add or push them to git. + +## Execution + +Build a new binary from current branch and copy it to the `tests/systemtests/binaries` folder by running system tests. +In project root: + +```shell +make test-system +``` + +Or via manual steps + +```shell +make build +mkdir -p ./tests/systemtests/binaries +cp ./build/simd ./tests/systemtests/binaries/ +``` + +### Manual test run + +```shell +go test -v -mod=readonly -failfast -tags='system_test' --run TestStakeUnstake ./... --verbose +``` + +### Working with macOS + +Most tests should function seamlessly. However, the file [upgrade_test.go](upgrade_test.go) includes a **build annotation** for Linux only. + +For the system upgrade test, an older version of the binary is utilized to perform a chain upgrade. This artifact is retrieved from a Docker container built for Linux. + +To circumvent this limitation locally: +1. Checkout and build the older version of the artifact from a specific tag for your OS. +2. Place the built artifact into the `binaries` folder. +3. Ensure that the filename, including the version, is correct. + +With the cached artifact in place, the test will use this file instead of attempting to pull it from Docker. \ No newline at end of file diff --git a/tests/systemtests/go.mod b/tests/systemtests/go.mod new file mode 100644 index 000000000000..c896077ffc84 --- /dev/null +++ b/tests/systemtests/go.mod @@ -0,0 +1,171 @@ +module cosmossdk.io/tests/systemtests + +go 1.23.0 + +replace ( + cosmossdk.io/api => ../../api + cosmossdk.io/log => ../../log + cosmossdk.io/systemtests => ../../systemtests + github.com/cosmos/cosmos-sdk => ../.. +) + +require ( + cosmossdk.io/systemtests v0.0.0-00010101000000-000000000000 + github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect + github.com/cosmos/cosmos-sdk v0.50.13 // indirect + github.com/cosmos/gogogateway v1.2.0 // indirect + github.com/cosmos/gogoproto v1.7.0 // indirect + github.com/cosmos/iavl v1.2.2 // indirect + github.com/dvsekhvalnov/jose2go v1.6.0 // indirect + github.com/golang/protobuf v1.5.4 // indirect + github.com/gorilla/mux v1.8.1 // indirect + github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/prometheus/client_golang v1.21.1 // indirect + github.com/spf13/cast v1.7.1 // indirect + github.com/spf13/cobra v1.9.1 // indirect + github.com/spf13/pflag v1.0.6 // indirect + github.com/stretchr/testify v1.10.0 + github.com/tidwall/gjson v1.18.0 +) + +require ( + cosmossdk.io/api v0.8.2 // indirect + cosmossdk.io/collections v0.4.0 // indirect + cosmossdk.io/core v0.11.0 // indirect + cosmossdk.io/depinject v1.1.0 // indirect + cosmossdk.io/errors v1.0.1 // indirect + cosmossdk.io/log v1.5.0 // indirect + cosmossdk.io/math v1.5.0 // indirect + cosmossdk.io/store v1.1.1 // indirect + cosmossdk.io/x/tx v1.1.0 // indirect + filippo.io/edwards25519 v1.1.0 // indirect + github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect + github.com/99designs/keyring v1.2.2 // indirect + github.com/DataDog/datadog-go v3.2.0+incompatible // indirect + github.com/DataDog/zstd v1.5.6 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/bgentry/speakeasy v0.2.0 // indirect + github.com/bytedance/sonic v1.13.1 // indirect + github.com/bytedance/sonic/loader v0.2.4 // indirect + github.com/cenkalti/backoff/v4 v4.3.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/cloudwego/base64x v0.1.5 // indirect + github.com/cockroachdb/apd/v3 v3.2.1 // indirect + github.com/cockroachdb/errors v1.11.3 // indirect + github.com/cockroachdb/fifo v0.0.0-20240816210425-c5d0cb0b6fc0 // indirect + github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506 // indirect + github.com/cockroachdb/pebble v1.1.2 // indirect + github.com/cockroachdb/redact v1.1.5 // indirect + github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect + github.com/cometbft/cometbft v0.38.17 // indirect + github.com/cometbft/cometbft-db v0.14.1 // indirect + github.com/cosmos/btcutil v1.0.5 // indirect + github.com/cosmos/cosmos-db v1.1.1 // indirect + github.com/cosmos/go-bip39 v1.0.0 // indirect + github.com/cosmos/ics23/go v0.11.0 // indirect + github.com/cosmos/ledger-cosmos-go v0.14.0 // indirect + github.com/creachadair/tomledit v0.0.27 // indirect + github.com/danieljoos/wincred v1.1.2 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect + github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect + github.com/dgraph-io/badger/v4 v4.2.0 // indirect + github.com/dgraph-io/ristretto v0.1.1 // indirect + github.com/dustin/go-humanize v1.0.1 // indirect + github.com/emicklei/dot v1.6.2 // indirect + github.com/fatih/color v1.18.0 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect + github.com/getsentry/sentry-go v0.30.0 // indirect + github.com/go-kit/kit v0.13.0 // indirect + github.com/go-kit/log v0.2.1 // indirect + github.com/go-logfmt/logfmt v0.6.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // indirect + github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect + github.com/gogo/googleapis v1.4.1 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/glog v1.2.4 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/golang/snappy v0.0.4 // indirect + github.com/google/btree v1.1.3 // indirect + github.com/google/flatbuffers v1.12.1 // indirect + github.com/google/go-cmp v0.7.0 // indirect + github.com/google/orderedcode v0.0.1 // indirect + github.com/gorilla/handlers v1.5.2 // 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/hashicorp/go-hclog v1.6.3 // indirect + github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-metrics v0.5.4 // indirect + github.com/hashicorp/go-plugin v1.6.2 // indirect + github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect + github.com/hashicorp/yamux v0.1.2 // indirect + github.com/hdevalence/ed25519consensus v0.2.0 // indirect + github.com/huandu/skiplist v1.2.1 // 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/jmhodges/levigo v1.0.0 // indirect + github.com/klauspost/compress v1.17.11 // indirect + github.com/klauspost/cpuid/v2 v2.2.10 // indirect + github.com/kr/pretty v0.3.1 // indirect + github.com/kr/text v0.2.0 // indirect + github.com/lib/pq v1.10.9 // indirect + github.com/linxGnu/grocksdb v1.9.7 // indirect + github.com/mattn/go-colorable v0.1.14 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/minio/highwayhash v1.0.3 // indirect + github.com/mtibben/percent v0.2.1 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect + github.com/oklog/run v1.1.0 // indirect + github.com/pelletier/go-toml/v2 v2.2.3 // indirect + github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.62.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect + github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect + github.com/rogpeppe/go-internal v1.13.1 // indirect + github.com/rs/cors v1.11.1 // indirect + github.com/rs/zerolog v1.33.0 // indirect + github.com/sagikazarmark/locafero v0.7.0 // indirect + github.com/sasha-s/go-deadlock v0.3.5 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.12.0 // indirect + github.com/spf13/viper v1.20.0 // indirect + 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/tidwall/btree v1.7.0 // indirect + github.com/tidwall/match v1.1.1 // indirect + github.com/tidwall/pretty v1.2.0 // indirect + github.com/tidwall/sjson v1.2.5 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + github.com/zondax/hid v0.9.2 // indirect + github.com/zondax/ledger-go v0.14.3 // indirect + go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 // indirect + go.opencensus.io v0.24.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + golang.org/x/arch v0.15.0 // indirect + golang.org/x/crypto v0.36.0 // indirect + golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8 // indirect + golang.org/x/net v0.35.0 // indirect + golang.org/x/sync v0.12.0 // indirect + golang.org/x/sys v0.31.0 // indirect + golang.org/x/term v0.30.0 // indirect + golang.org/x/text v0.23.0 // indirect + google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a // indirect + google.golang.org/grpc v1.71.0 // indirect + google.golang.org/protobuf v1.36.5 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + gotest.tools/v3 v3.5.2 // indirect + nhooyr.io/websocket v1.8.6 // indirect + pgregory.net/rapid v1.2.0 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect +) diff --git a/tests/systemtests/go.sum b/tests/systemtests/go.sum new file mode 100644 index 000000000000..c9cc9210e9ed --- /dev/null +++ b/tests/systemtests/go.sum @@ -0,0 +1,1051 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= +cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= +cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= +cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= +cosmossdk.io/depinject v1.1.0 h1:wLan7LG35VM7Yo6ov0jId3RHWCGRhe8E8bsuARorl5E= +cosmossdk.io/depinject v1.1.0/go.mod h1:kkI5H9jCGHeKeYWXTqYdruogYrEeWvBQCw1Pj4/eCFI= +cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= +cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= +cosmossdk.io/math v1.5.0 h1:sbOASxee9Zxdjd6OkzogvBZ25/hP929vdcYcBJQbkLc= +cosmossdk.io/math v1.5.0/go.mod h1:AAwwBmUhqtk2nlku174JwSll+/DepUXW3rWIXN5q+Nw= +cosmossdk.io/store v1.1.1 h1:NA3PioJtWDVU7cHHeyvdva5J/ggyLDkyH0hGHl2804Y= +cosmossdk.io/store v1.1.1/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM= +cosmossdk.io/x/tx v1.1.0 h1:5C5XGNGYzbOTKbcf47oBI/VLObb5bmcMqH/C6H/sp1E= +cosmossdk.io/x/tx v1.1.0/go.mod h1:QF15QyTcGH4wfKawfRdSihWwutf4OhgiA+HIwWhjle0= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= +filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= +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/99designs/keyring v1.2.2 h1:pZd3neh/EmUzWONb35LxQfvuY7kiSXAq3HQd97+XBn0= +github.com/99designs/keyring v1.2.2/go.mod h1:wes/FrByc8j7lFOAGLGSNEg8f/PaI3cgTBqhFkHUrPk= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= +github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= +github.com/DataDog/zstd v1.5.6 h1:LbEglqepa/ipmmQJUDnSsfvA8e8IStVcGaFWDuxvGOY= +github.com/DataDog/zstd v1.5.6/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= +github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= +github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= +github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= +github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +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/adlio/schema v1.3.6 h1:k1/zc2jNfeiZBA5aFTRy37jlBIuCkXCm0XmvpzCKI9I= +github.com/adlio/schema v1.3.6/go.mod h1:qkxwLgPBd1FgLRHYVCmQT/rrBr3JH38J9LjmVzWNudg= +github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +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/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= +github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= +github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bgentry/speakeasy v0.2.0 h1:tgObeVOf8WAvtuAX6DhJ4xks4CFNwPDZiqzGqIHE51E= +github.com/bgentry/speakeasy v0.2.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bits-and-blooms/bitset v1.22.0 h1:Tquv9S8+SGaS3EhyA+up3FXzmkhxPGjQQCkcs2uw7w4= +github.com/bits-and-blooms/bitset v1.22.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= +github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= +github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/btcutil v1.1.6 h1:zFL2+c3Lb9gEgqKNzowKUPQNb8jV7v5Oaodi/AYFd6c= +github.com/btcsuite/btcd/btcutil v1.1.6/go.mod h1:9dFymx8HpuLqBnsPELrImQeTQfKBQqzqGbbV3jK55aE= +github.com/bufbuild/protocompile v0.14.1 h1:iA73zAf/fyljNjQKwYzUHD6AD4R8KMasmwa/FBatYVw= +github.com/bufbuild/protocompile v0.14.1/go.mod h1:ppVdAIhbr2H8asPk6k4pY7t9zB1OU5DoEw9xY/FUi1c= +github.com/bytedance/sonic v1.13.1 h1:Jyd5CIvdFnkOWuKXr+wm4Nyk2h0yAFsr8ucJgEasO3g= +github.com/bytedance/sonic v1.13.1/go.mod h1:o68xyaF9u2gvVBuGHPlUVCy+ZfmNNO5ETf1+KgkJhz4= +github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= +github.com/bytedance/sonic/loader v0.2.4 h1:ZWCw4stuXUsn1/+zQDqeE7JKP+QO47tz7QCNan80NzY= +github.com/bytedance/sonic/loader v0.2.4/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI= +github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= +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= +github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= +github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.1.1/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/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI= +github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= +github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= +github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudwego/base64x v0.1.5 h1:XPciSp1xaq2VCSt6lF0phncD4koWyULpl5bUxbfCyP4= +github.com/cloudwego/base64x v0.1.5/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= +github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= +github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= +github.com/cockroachdb/apd/v3 v3.2.1 h1:U+8j7t0axsIgvQUqthuNm82HIrYXodOV2iWLWtEaIwg= +github.com/cockroachdb/apd/v3 v3.2.1/go.mod h1:klXJcjp+FffLTHlhIG69tezTDvdP065naDsHzKhYSqc= +github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= +github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= +github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8= +github.com/cockroachdb/fifo v0.0.0-20240816210425-c5d0cb0b6fc0 h1:pU88SPhIFid6/k0egdR5V6eALQYq2qbSmukrkgIh/0A= +github.com/cockroachdb/fifo v0.0.0-20240816210425-c5d0cb0b6fc0/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= +github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506 h1:ASDL+UJcILMqgNeV5jiqR4j+sTuvQNHdf2chuKj1M5k= +github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506/go.mod h1:Mw7HqKr2kdtu6aYGn3tPmAftiP3QPX63LdK/zcariIo= +github.com/cockroachdb/pebble v1.1.2 h1:CUh2IPtR4swHlEj48Rhfzw6l/d0qA31fItcIszQVIsA= +github.com/cockroachdb/pebble v1.1.2/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= +github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= +github.com/cometbft/cometbft v0.38.17 h1:FkrQNbAjiFqXydeAO81FUzriL4Bz0abYxN/eOHrQGOk= +github.com/cometbft/cometbft v0.38.17/go.mod h1:5l0SkgeLRXi6bBfQuevXjKqML1jjfJJlvI1Ulp02/o4= +github.com/cometbft/cometbft-db v0.14.1 h1:SxoamPghqICBAIcGpleHbmoPqy+crij/++eZz3DlerQ= +github.com/cometbft/cometbft-db v0.14.1/go.mod h1:KHP1YghilyGV/xjD5DP3+2hyigWx0WTp9X+0Gnx0RxQ= +github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= +github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= +github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= +github.com/cosmos/cosmos-db v1.1.1 h1:FezFSU37AlBC8S98NlSagL76oqBRWq/prTPvFcEJNCM= +github.com/cosmos/cosmos-db v1.1.1/go.mod h1:AghjcIPqdhSLP/2Z0yha5xPH3nLnskz81pBx3tcVSAw= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= +github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= +github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= +github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= +github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= +github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= +github.com/cosmos/iavl v1.2.2 h1:qHhKW3I70w+04g5KdsdVSHRbFLgt3yY3qTMd4Xa4rC8= +github.com/cosmos/iavl v1.2.2/go.mod h1:GiM43q0pB+uG53mLxLDzimxM9l/5N9UuSY3/D0huuVw= +github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= +github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= +github.com/cosmos/ledger-cosmos-go v0.14.0 h1:WfCHricT3rPbkPSVKRH+L4fQGKYHuGOK9Edpel8TYpE= +github.com/cosmos/ledger-cosmos-go v0.14.0/go.mod h1:E07xCWSBl3mTGofZ2QnL4cIUzMbbGVyik84QYKbX3RA= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= +github.com/creachadair/tomledit v0.0.27 h1:6xOpEnkKmcpT/gmKhabN0JXrqNX065lyje1/mXTSSIE= +github.com/creachadair/tomledit v0.0.27/go.mod h1:v1EWpgCisD3ct1kO8Gq4o4pdgX5JXD0rBI2PJ4UnPoA= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= +github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/decred/dcrd/crypto/blake256 v1.1.0 h1:zPMNGQCm0g4QTY27fOCorQW7EryeQ/U0x++OzVrdms8= +github.com/decred/dcrd/crypto/blake256 v1.1.0/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 h1:NMZiJj8QnKe1LgsbDayM4UoHwbvwDRwnI3hwNaAHRnc= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0/go.mod h1:ZXNYxsqcloTdSy/rNShjYzMhyjf0LaoftYK0p+A3h40= +github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= +github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= +github.com/dgraph-io/badger/v4 v4.2.0 h1:kJrlajbXXL9DFTNuhhu9yCx7JJa4qpYWxtE8BzuWsEs= +github.com/dgraph-io/badger/v4 v4.2.0/go.mod h1:qfCqhPoWDFJRx1gp5QwwyGo8xk1lbHUxvK9nK0OGAak= +github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= +github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= +github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= +github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= +github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +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/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +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/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/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/emicklei/dot v1.6.2 h1:08GN+DD79cy/tzN6uLCT84+2Wk9u+wvqP+Hkx/dIR8A= +github.com/emicklei/dot v1.6.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= +github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= +github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= +github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= +github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= +github.com/getsentry/sentry-go v0.30.0 h1:lWUwDnY7sKHaVIoZ9wYqRHJ5iEmoc0pqcRqFkosKzBo= +github.com/getsentry/sentry-go v0.30.0/go.mod h1:WU9B9/1/sHDqeV8T+3VwwbjeR5MSXs/6aqG3mqZrezA= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= +github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= +github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= +github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= +github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= +github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= +github.com/go-kit/kit v0.13.0 h1:OoneCcHKHQ03LfBpoQCUfCluwd2Vt3ohz+kvbJneZAU= +github.com/go-kit/kit v0.13.0/go.mod h1:phqEHMMUbyrCFCTgH48JueqrM3md2HcAZ8N3XE4FKDg= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= +github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= +github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +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-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= +github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= +github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= +github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= +github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= +github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= +github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= +github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= +github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= +github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= +github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= +github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= +github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= +github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= +github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= +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.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +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/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.2.4 h1:CNNw5U8lSiiBk7druxtSHHTsRWcxKoac6kZKm2peBBc= +github.com/golang/glog v1.2.4/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= +github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= +github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= +github.com/google/flatbuffers v1.12.1 h1:MVlul7pQNoDzWRLTw5imwYsl+usrS1TXG2H4jg6ImGw= +github.com/google/flatbuffers v1.12.1/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +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= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= +github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE= +github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w= +github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= +github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +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/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= +github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= +github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= +github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-metrics v0.5.4 h1:8mmPiIJkTPPEbAiV97IxdAGNdRdaWwVap1BU6elejKY= +github.com/hashicorp/go-metrics v0.5.4/go.mod h1:CG5yz4NZ/AI/aQt9Ucm/vdBnbh7fvmv4lxZ350i+QQI= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-plugin v1.6.2 h1:zdGAEd0V1lCaU0u+MxWQhtSDQmahpkwOun8U8EiRVog= +github.com/hashicorp/go-plugin v1.6.2/go.mod h1:CkgLQ5CZqNmdL9U9JzM532t8ZiYQ35+pj3b1FD37R0Q= +github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= +github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/yamux v0.1.2 h1:XtB8kyFOyHXYVFnwT5C3+Bdo8gArse7j2AQ0DA0Uey8= +github.com/hashicorp/yamux v0.1.2/go.mod h1:C+zze2n6e/7wshOZep2A70/aQU6QBRWJO/G6FT1wIns= +github.com/hdevalence/ed25519consensus v0.2.0 h1:37ICyZqdyj0lAZ8P4D1d1id3HqbbG1N3iBb1Tb4rdcU= +github.com/hdevalence/ed25519consensus v0.2.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= +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= +github.com/huandu/skiplist v1.2.1 h1:dTi93MgjwErA/8idWTzIw4Y1kZsMWx35fmI2c8Rij7w= +github.com/huandu/skiplist v1.2.1/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= +github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= +github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= +github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/jhump/protoreflect v1.17.0 h1:qOEr613fac2lOuTgWN4tPAtLL7fUSbuJL5X5XumQh94= +github.com/jhump/protoreflect v1.17.0/go.mod h1:h9+vUUL38jiBzck8ck+6G/aeMX8Z4QUY/NiJPwPNi+8= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= +github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +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/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/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= +github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE= +github.com/klauspost/cpuid/v2 v2.2.10/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0= +github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +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/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= +github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= +github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= +github.com/linxGnu/grocksdb v1.9.7 h1:Bp2r1Yti/IXxEobZZnDooXAui/Q+5gVqgQMenLWyDUw= +github.com/linxGnu/grocksdb v1.9.7/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= +github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= +github.com/magiconair/properties v1.8.9 h1:nWcCbLq1N2v/cpNsy5WvQ37Fb+YElfq20WJ/a8RkpQM= +github.com/magiconair/properties v1.8.9/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= +github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= +github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +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-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/minio/highwayhash v1.0.3 h1:kbnuUMoHYyVl7szWjSxJnxw11k2U709jqFPPmIUyD6Q= +github.com/minio/highwayhash v1.0.3/go.mod h1:GGYsuwP/fPD6Y9hMiXuapVvlIUEhFhMTh0rxU3ik1LQ= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +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/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/grpc-proxy v0.0.0-20181017164139-0f1106ef9c76/go.mod h1:x5OoJHDHqxHS801UIuhqGl6QdSAEJvtausosHSdazIo= +github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= +github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= +github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= +github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= +github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +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= +github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a h1:dlRvE5fWabOchtH7znfiFCcOvmIYgOeAS5ifBXBlh9Q= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= +github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= +github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= +github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= +github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= +github.com/onsi/gomega v1.26.0 h1:03cDLK28U6hWvCAns6NeydX3zIm4SF3ci69ulidS32Q= +github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= +github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= +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-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= +github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= +github.com/opencontainers/runc v1.1.12 h1:BOIssBaW1La0/qbNZHXOOa71dZfZEQOzW7dqQf3phss= +github.com/opencontainers/runc v1.1.12/go.mod h1:S+lQwSfncpBha7XTy/5lBwWgm5+y5Ma/O44Ekby9FK8= +github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= +github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= +github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= +github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= +github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= +github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= +github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= +github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= +github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= +github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= +github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 h1:Dx7Ovyv/SFnMFw3fD4oEoeorXc6saIiQ23LrGLth0Gw= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= +github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= +github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.21.1 h1:DOvXXTqVzvkIewV/CDPFdejpMCGeMcbGCQ8YOmu+Ibk= +github.com/prometheus/client_golang v1.21.1/go.mod h1:U9NM32ykUErtVBxdvD3zfi+EuFkkaBvMb09mIfe0Zgg= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= +github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= +github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io= +github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= +github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +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.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= +github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= +github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= +github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/locafero v0.7.0 h1:5MqpDsTGNDhY8sGp0Aowyf0qKsPrhewaLSsFaodPcyo= +github.com/sagikazarmark/locafero v0.7.0/go.mod h1:2za3Cg5rMaTMoG/2Ulr9AwtFaIppKXTRYnozin4aB5k= +github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= +github.com/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb2NsU= +github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= +github.com/spf13/afero v1.12.0 h1:UcOPyRBYczmFn6yvphxkn9ZEOY65cpwGKb5mL36mrqs= +github.com/spf13/afero v1.12.0/go.mod h1:ZTlWwG4/ahT8W7T0WQ5uYmjI9duaLQGy3Q2OAl4sk/4= +github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= +github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo= +github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= +github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= +github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.20.0 h1:zrxIyR3RQIOsarIrgL8+sAvALXul9jeEPa06Y0Ph6vY= +github.com/spf13/viper v1.20.0/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4= +github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +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.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= +github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= +github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= +github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= +github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= +github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= +github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY= +github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= +github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= +github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= +github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= +github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY= +github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28= +github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= +github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= +github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= +github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= +github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= +github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= +github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= +github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= +github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= +github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= +github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= +go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 h1:qxen9oVGzDdIRP6ejyAJc760RwW4SnVDiTYTzwnXuxo= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5/go.mod h1:eW0HG9/oHQhvRCvb1/pIXW4cOvtDqeQK+XSi3TnwaXY= +go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= +go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= +go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= +go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY= +go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI= +go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ= +go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE= +go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A= +go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU= +go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk= +go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w= +go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k= +go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU= +go.uber.org/mock v0.5.0/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= +golang.org/x/arch v0.15.0 h1:QtOrQd0bTUnhNVNndMpLHNWrDmYzZ2KDqSrEymqInZw= +golang.org/x/arch v0.15.0/go.mod h1:JmwW7aLIoRUKgaTzhkiEFxvcEiQGyOg9BMonBJUS7EE= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34= +golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= +golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8 h1:yqrTHse8TCMW1M1ZCP+VAR/l0kKxwaAIqN/il7x4voA= +golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8/go.mod h1:tujkw807nyEEAamNbDrEGzRav+ilXA7PCRAd6xsmwiU= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= +golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= +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= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= +golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= +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-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw= +golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +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-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/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-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= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/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-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220315194320-039c03cc5b86/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= +golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +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.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y= +golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= +golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= +golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/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-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.29.0 h1:Xx0h3TtM9rzQpQuR4dKLrdglAmCEN5Oi+P74JdhdzXE= +golang.org/x/tools v0.29.0/go.mod h1:KMQVMRsVxU6nHCFXrBPhDB8XncLNLM0lIy/F14RP588= +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= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= +google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 h1:ToEetK57OidYuqD4Q5w+vfEnPvPpuTwedCNVohYJfNk= +google.golang.org/genproto v0.0.0-20241118233622-e639e219e697/go.mod h1:JJrvXBWRZaFMxBufik1a4RpFw4HhgVtBBWQeQgUj2cc= +google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a h1:nwKuGPlUAt+aR+pcrkfFRrTU1BVrSmYyYMxYbUIVHr0= +google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a/go.mod h1:3kWAYMk1I75K4vykHtKt2ycnOgpA6974V7bREqbsenU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a h1:51aaUVRocpvUOSQKM6Q7VuoaktNIaMCLuhZB6DKksq4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a/go.mod h1:uRxBH1mhmO8PGhU89cMcHaXKZqO+OfakD8QQO0oYwlQ= +google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= +google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg= +google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= +google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +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.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +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/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +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= +gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q= +gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA= +honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= +nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= +nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= +pgregory.net/rapid v1.2.0 h1:keKAYRcjm+e1F0oAuU5F5+YPAWcyxNNRK2wud503Gnk= +pgregory.net/rapid v1.2.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= +sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= +sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/tests/systemtests/main_test.go b/tests/systemtests/main_test.go new file mode 100644 index 000000000000..9bb4b2277083 --- /dev/null +++ b/tests/systemtests/main_test.go @@ -0,0 +1,13 @@ +//go:build system_test + +package systemtests + +import ( + "testing" + + "cosmossdk.io/systemtests" +) + +func TestMain(m *testing.M) { + systemtests.RunTests(m) +} diff --git a/tests/systemtests/staking_test.go b/tests/systemtests/staking_test.go new file mode 100644 index 000000000000..4e07bf220fa3 --- /dev/null +++ b/tests/systemtests/staking_test.go @@ -0,0 +1,56 @@ +//go:build system_test + +package systemtests + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/tidwall/gjson" + + "cosmossdk.io/systemtests" +) + +func TestStakeUnstake(t *testing.T) { + // Scenario: + // delegate tokens to validator + // undelegate some tokens + sut := systemtests.Sut + sut.ResetChain(t) + + cli := systemtests.NewCLIWrapper(t, sut, systemtests.Verbose) + + // add genesis account with some tokens + account1Addr := cli.AddKey("account1") + sut.ModifyGenesisCLI(t, + []string{"genesis", "add-genesis-account", account1Addr, "10000000stake"}, + ) + + sut.StartChain(t) + + // query validator address to delegate tokens + rsp := cli.CustomQuery("q", "staking", "validators") + valAddr := gjson.Get(rsp, "validators.#.operator_address").Array()[0].String() + + // stake tokens + rsp = cli.Run("tx", "staking", "delegate", valAddr, "10000stake", "--from="+account1Addr, "--fees=1stake") + systemtests.RequireTxSuccess(t, rsp) + + t.Log(cli.QueryBalance(account1Addr, "stake")) + assert.Equal(t, int64(9989999), cli.QueryBalance(account1Addr, "stake")) + + rsp = cli.CustomQuery("q", "staking", "delegation", account1Addr, valAddr) + assert.Equal(t, "10000", gjson.Get(rsp, "delegation_response.balance.amount").String(), rsp) + assert.Equal(t, "stake", gjson.Get(rsp, "delegation_response.balance.denom").String(), rsp) + + // unstake tokens + rsp = cli.Run("tx", "staking", "unbond", valAddr, "5000stake", "--from="+account1Addr, "--fees=1stake") + systemtests.RequireTxSuccess(t, rsp) + + rsp = cli.CustomQuery("q", "staking", "delegation", account1Addr, valAddr) + assert.Equal(t, "5000", gjson.Get(rsp, "delegation_response.balance.amount").String(), rsp) + assert.Equal(t, "stake", gjson.Get(rsp, "delegation_response.balance.denom").String(), rsp) + + rsp = cli.CustomQuery("q", "staking", "unbonding-delegation", account1Addr, valAddr) + assert.Equal(t, "5000", gjson.Get(rsp, "unbond.entries.#.balance").Array()[0].String(), rsp) +} diff --git a/tests/systemtests/unordered_tx_test.go b/tests/systemtests/unordered_tx_test.go new file mode 100644 index 000000000000..da8aab0d2b2c --- /dev/null +++ b/tests/systemtests/unordered_tx_test.go @@ -0,0 +1,134 @@ +//go:build system_test + +package systemtests + +import ( + "fmt" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/tidwall/gjson" + + systest "cosmossdk.io/systemtests" +) + +func TestUnorderedTXDuplicate(t *testing.T) { + // scenario: test unordered tx duplicate + // given a running chain with a tx in the unordered tx pool + // when a new tx with the same hash is broadcasted + // then the new tx should be rejected + + systest.Sut.ResetChain(t) + cli := systest.NewCLIWrapper(t, systest.Sut, systest.Verbose) + // add genesis account with some tokens + account1Addr := cli.AddKey("account1") + account2Addr := cli.AddKey("account2") + systest.Sut.ModifyGenesisCLI(t, + []string{"genesis", "add-genesis-account", account1Addr, "10000000stake"}, + ) + + systest.Sut.StartChain(t) + + timeoutTimestamp := time.Now().Add(time.Minute) + // send tokens + cmd := []string{"tx", "bank", "send", account1Addr, account2Addr, "5000stake", "--from=" + account1Addr, "--fees=1stake", fmt.Sprintf("--timeout-timestamp=%v", timeoutTimestamp.Unix()), "--unordered", "--sequence=1", "--note=1"} + rsp1 := cli.Run(cmd...) + systest.RequireTxSuccess(t, rsp1) + + assertDuplicateErr := func(xt assert.TestingT, gotErr error, gotOutputs ...interface{}) bool { + require.Len(t, gotOutputs, 1) + output := gotOutputs[0].(string) + code := gjson.Get(output, "code") + require.True(t, code.Exists()) + require.Equal(t, int64(19), code.Int()) // 19 == already in mempool. + return false // always abort + } + rsp2 := cli.WithRunErrorMatcher(assertDuplicateErr).Run(cmd...) + systest.RequireTxFailure(t, rsp2) + + require.Eventually(t, func() bool { + return cli.QueryBalance(account2Addr, "stake") == 5000 + }, 10*systest.Sut.BlockTime(), 200*time.Millisecond, "TX was not executed before timeout") +} + +func TestTxBackwardsCompatability(t *testing.T) { + // Scenario: + // A transaction generated from a v0.53 chain without unordered and timeout_timestamp flags set should succeed. + // Conversely, a transaction generated from a v0.53 chain with unordered and timeout_timestamp flags set should fail. + var ( + denom = "stake" + transferAmount int64 = 1000 + testSeed = "scene learn remember glide apple expand quality spawn property shoe lamp carry upset blossom draft reject aim file trash miss script joy only measure" + ) + systest.Sut.ResetChain(t) + + v53CLI := systest.NewCLIWrapper(t, systest.Sut, systest.Verbose) + // we just get val addr for an address to send things to. + valAddr := v53CLI.GetKeyAddr("node0") + require.NotEmpty(t, valAddr) + + // generate a deterministic account. we'll use this seed again later in the v50 chain. + senderAddr := v53CLI.AddKeyFromSeed("account1", testSeed) + + //// Now we're going to switch to a v.50 chain. + legacyBinary := systest.WorkDir + "/binaries/v0.50/simd" + + // setup the v50 chain. v53 made some changes to testnet command, so we'll have to adjust here. + // this only uses 1 node. + legacySut := systest.NewSystemUnderTest("simd", systest.Verbose, 1, 1*time.Second) + // we need to explicitly set this here as the constructor infers the exec binary is in the "binaries" directory. + legacySut.SetExecBinary(legacyBinary) + legacySut.SetTestnetInitializer(systest.LegacyInitializerWithBinary(legacyBinary, legacySut)) + legacySut.SetupChain() + v50CLI := systest.NewCLIWrapper(t, legacySut, systest.Verbose) + v50CLI.AddKeyFromSeed("account1", testSeed) + legacySut.ModifyGenesisCLI(t, + // add some bogus accounts because the v53 chain had 4 nodes which takes account numbers 1-4. + []string{"genesis", "add-genesis-account", v50CLI.AddKey("foo"), "10000000000stake"}, + []string{"genesis", "add-genesis-account", v50CLI.AddKey("bar"), "10000000000stake"}, + []string{"genesis", "add-genesis-account", v50CLI.AddKey("baz"), "10000000000stake"}, + // we need our sender to be account 5 because that's how it was signed in the v53 scenario. + []string{"genesis", "add-genesis-account", senderAddr, "10000000000stake"}, + ) + + legacySut.StartChain(t) + + bankSendCmdArgs := []string{"tx", "bank", "send", senderAddr, valAddr, fmt.Sprintf("%d%s", transferAmount, denom), "--chain-id=" + v50CLI.ChainID(), "--fees=10stake", "--sign-mode=direct"} + res, ok := v53CLI.RunOnly(bankSendCmdArgs...) + require.True(t, ok) + + response, ok := v50CLI.AwaitTxCommitted(res, 15*time.Second) + require.True(t, ok) + code := gjson.Get(response, "code").Int() + require.Equal(t, int64(0), code) + + bankSendCmdArgs = []string{"tx", "bank", "send", senderAddr, valAddr, fmt.Sprintf("%d%s", transferAmount, denom), "--chain-id=" + v50CLI.ChainID(), "--fees=10stake", "--sign-mode=direct", "--unordered", "--timeout-timestamp=10000"} + res, ok = v53CLI.RunOnly(bankSendCmdArgs...) + require.True(t, ok) + + code = gjson.Get(res, "code").Int() + require.Equal(t, int64(2), code) + require.Contains(t, res, "errUnknownField") + legacySut.StopChain() + + // Now start a v53 chain, and send a transaction from a v50 client. + // generate a deterministic account. we'll use this seed again later in the v50 chain. + systest.Sut.SetupChain() + systest.Sut.ModifyGenesisCLI(t, + // we need our sender to be account 5 because that's how it was signed in the v53 scenario. + []string{"genesis", "add-genesis-account", senderAddr, "10000000000stake"}, + ) + systest.Sut.StartChain(t) + + senderAddr = v50CLI.AddKeyFromSeed("account1", testSeed) + bankSendCmdArgs = []string{"tx", "bank", "send", senderAddr, valAddr, fmt.Sprintf("%d%s", transferAmount, denom), "--chain-id=" + v50CLI.ChainID(), "--fees=10stake", "--sign-mode=direct"} + res, ok = v50CLI.RunOnly(bankSendCmdArgs...) + require.True(t, ok) + + response, ok = v53CLI.AwaitTxCommitted(res, 15*time.Second) + require.True(t, ok) + code = gjson.Get(response, "code").Int() + require.Equal(t, int64(0), code) +} diff --git a/testutil/account.go b/testutil/account.go index 8a1ba33681b2..a50890e89b2e 100644 --- a/testutil/account.go +++ b/testutil/account.go @@ -17,6 +17,7 @@ type TestAccount struct { } func CreateKeyringAccounts(t *testing.T, kr keyring.Keyring, num int) []TestAccount { + t.Helper() accounts := make([]TestAccount, num) for i := range accounts { record, _, err := kr.NewMnemonic( diff --git a/testutil/cli/cmd.go b/testutil/cli/cmd.go index 6e36bc2c6622..57b5b11ee6e5 100644 --- a/testutil/cli/cmd.go +++ b/testutil/cli/cmd.go @@ -4,11 +4,11 @@ import ( "context" "fmt" - "cosmossdk.io/core/address" "github.com/spf13/cobra" + "cosmossdk.io/core/address" + "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/testutil" "github.com/cosmos/cosmos-sdk/x/bank/client/cli" ) @@ -36,10 +36,3 @@ func MsgSendExec(clientCtx client.Context, from, to, amount fmt.Stringer, ac add return ExecTestCLICmd(clientCtx, cli.NewSendTxCmd(ac), args) } - -func QueryBalancesExec(clientCtx client.Context, address fmt.Stringer, ac address.Codec, extraArgs ...string) (testutil.BufferWriter, error) { - args := []string{address.String(), fmt.Sprintf("--%s=json", flags.FlagOutput)} - args = append(args, extraArgs...) - - return ExecTestCLICmd(clientCtx, cli.GetBalancesCmd(ac), args) -} diff --git a/testutil/collections.go b/testutil/collections.go new file mode 100644 index 000000000000..82ef1858d3bd --- /dev/null +++ b/testutil/collections.go @@ -0,0 +1,75 @@ +package testutil + +import ( + "crypto/sha256" + "encoding/hex" + "fmt" + + storetypes "cosmossdk.io/store/types" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// DiffCollectionsMigration is meant to aid in the migration from the previous store +// solution to collections. It takes a few steps to use it: +// 1. Write a test function that writes elements using the old store solution. +// 2. Run the test function and copy the hash that it outputs (run it a couple +// of times to make sure no non-deterministic data is being used). +// 3. Change the code to use collections and run the test function again to make +// sure the hash didn't change. +// +// First we write it as such: +// +// func TestMigrateStore(t *testing.T) { +// DiffCollectionsMigration( +// ctx, +// storeKey, +// 100, +// func(i int64) { +// err := SetPreviousProposerConsAddr(ctx, addrs[i]) +// require.NoError(t, err) +// }, +// "abcdef0123456789", +// ) +// } +// +// Then after we change the code to use collections, we modify the writeElem function: +// +// func TestMigrateStore(t *testing.T) { +// DiffCollectionsMigration( +// ctx, +// storeKey, +// 100, +// func(i int64) { +// err := keeper.PreviousProposer.Set(ctx, addrs[i]) +// require.NoError(t, err) +// }, +// "abcdef0123456789", +// ) +// } +func DiffCollectionsMigration( + ctx sdk.Context, + storeKey *storetypes.KVStoreKey, + iterations int, + writeElem func(int64), + targetHash string, +) error { + for i := int64(0); i < int64(iterations); i++ { + writeElem(i) + } + + h := sha256.New() + it := ctx.KVStore(storeKey).Iterator(nil, nil) + defer it.Close() + for ; it.Valid(); it.Next() { + h.Write(it.Key()) + h.Write(it.Value()) + } + + hash := h.Sum(nil) + if hex.EncodeToString(hash) != targetHash { + return fmt.Errorf("hashes don't match: %s != %s", hex.EncodeToString(hash), targetHash) + } + + return nil +} diff --git a/testutil/collections_test.go b/testutil/collections_test.go new file mode 100644 index 000000000000..a35533539efc --- /dev/null +++ b/testutil/collections_test.go @@ -0,0 +1,54 @@ +package testutil_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + storetypes "cosmossdk.io/store/types" + + "github.com/cosmos/cosmos-sdk/testutil" +) + +func TestDiffCollectionsMigration(t *testing.T) { + key := storetypes.NewKVStoreKey("test") + ctx := testutil.DefaultContext(key, storetypes.NewTransientStoreKey("transient")) + + // First try with some invalid hash + err := testutil.DiffCollectionsMigration( + ctx, + key, + 5, + func(i int64) { + ctx.KVStore(key).Set([]byte{byte(i)}, []byte{byte(i)}) + }, + "abcdef0123456789", + ) + require.Error(t, err) + + // Now reset and try with the correct hash + ctx = testutil.DefaultContext(key, storetypes.NewTransientStoreKey("transient")) + err = testutil.DiffCollectionsMigration( + ctx, + key, + 5, + func(i int64) { + ctx.KVStore(key).Set([]byte{byte(i)}, []byte{byte(i)}) + }, + "79541ed9da9c16cb7a1d43d5a3d5f6ee31a873c85a6cb4334fb99e021ee0e556", + ) + require.NoError(t, err) + + // Change the data a little and it will result in an error + ctx = testutil.DefaultContext(key, storetypes.NewTransientStoreKey("transient")) + err = testutil.DiffCollectionsMigration( + ctx, + key, + 5, + func(i int64) { + ctx.KVStore(key).Set([]byte{byte(i)}, []byte{byte(i + 1)}) + }, + "79541ed9da9c16cb7a1d43d5a3d5f6ee31a873c85a6cb4334fb99e021ee0e556", + ) + require.Error(t, err) +} diff --git a/testutil/configurator/configurator.go b/testutil/configurator/configurator.go index e96d05971bb2..4359b57a5dff 100644 --- a/testutil/configurator/configurator.go +++ b/testutil/configurator/configurator.go @@ -25,82 +25,114 @@ import ( "cosmossdk.io/depinject" ) -var beginBlockOrder = []string{ - "upgrade", - "mint", - "distribution", - "slashing", - "evidence", - "staking", - "auth", - "bank", - "gov", - "crisis", - "genutil", - "authz", - "feegrant", - "nft", - "group", - "params", - "consensus", - "vesting", - "circuit", +// Config should never need to be instantiated manually and is solely used for ModuleOption. +type Config struct { + ModuleConfigs map[string]*appv1alpha1.ModuleConfig + PreBlockersOrder []string + BeginBlockersOrder []string + EndBlockersOrder []string + InitGenesisOrder []string + setInitGenesis bool } -var endBlockersOrder = []string{ - "crisis", - "gov", - "staking", - "auth", - "bank", - "distribution", - "slashing", - "mint", - "genutil", - "evidence", - "authz", - "feegrant", - "nft", - "group", - "params", - "consensus", - "upgrade", - "vesting", - "circuit", +func defaultConfig() *Config { + return &Config{ + ModuleConfigs: make(map[string]*appv1alpha1.ModuleConfig), + PreBlockersOrder: []string{ + "upgrade", + }, + BeginBlockersOrder: []string{ + "mint", + "distribution", + "slashing", + "evidence", + "staking", + "auth", + "bank", + "gov", + "genutil", + "authz", + "feegrant", + "nft", + "group", + "params", + "consensus", + "vesting", + "circuit", + }, + EndBlockersOrder: []string{ + "gov", + "staking", + "auth", + "bank", + "distribution", + "slashing", + "mint", + "genutil", + "evidence", + "authz", + "feegrant", + "nft", + "group", + "params", + "consensus", + "upgrade", + "vesting", + "circuit", + }, + InitGenesisOrder: []string{ + "auth", + "bank", + "distribution", + "staking", + "slashing", + "gov", + "mint", + "genutil", + "evidence", + "authz", + "feegrant", + "nft", + "group", + "params", + "consensus", + "upgrade", + "vesting", + "circuit", + }, + setInitGenesis: true, + } } -var initGenesisOrder = []string{ - "auth", - "bank", - "distribution", - "staking", - "slashing", - "gov", - "mint", - "crisis", - "genutil", - "evidence", - "authz", - "feegrant", - "nft", - "group", - "params", - "consensus", - "upgrade", - "vesting", - "circuit", +type ModuleOption func(config *Config) + +func WithCustomPreBlockersOrder(preBlockOrder ...string) ModuleOption { + return func(config *Config) { + config.PreBlockersOrder = preBlockOrder + } } -type appConfig struct { - moduleConfigs map[string]*appv1alpha1.ModuleConfig - setInitGenesis bool +func WithCustomBeginBlockersOrder(beginBlockOrder ...string) ModuleOption { + return func(config *Config) { + config.BeginBlockersOrder = beginBlockOrder + } } -type ModuleOption func(config *appConfig) +func WithCustomEndBlockersOrder(endBlockersOrder ...string) ModuleOption { + return func(config *Config) { + config.EndBlockersOrder = endBlockersOrder + } +} + +func WithCustomInitGenesisOrder(initGenesisOrder ...string) ModuleOption { + return func(config *Config) { + config.InitGenesisOrder = initGenesisOrder + } +} func BankModule() ModuleOption { - return func(config *appConfig) { - config.moduleConfigs["bank"] = &appv1alpha1.ModuleConfig{ + return func(config *Config) { + config.ModuleConfigs["bank"] = &appv1alpha1.ModuleConfig{ Name: "bank", Config: appconfig.WrapAny(&bankmodulev1.Module{}), } @@ -108,8 +140,8 @@ func BankModule() ModuleOption { } func AuthModule() ModuleOption { - return func(config *appConfig) { - config.moduleConfigs["auth"] = &appv1alpha1.ModuleConfig{ + return func(config *Config) { + config.ModuleConfigs["auth"] = &appv1alpha1.ModuleConfig{ Name: "auth", Config: appconfig.WrapAny(&authmodulev1.Module{ Bech32Prefix: "cosmos", @@ -128,8 +160,8 @@ func AuthModule() ModuleOption { } func ParamsModule() ModuleOption { - return func(config *appConfig) { - config.moduleConfigs["params"] = &appv1alpha1.ModuleConfig{ + return func(config *Config) { + config.ModuleConfigs["params"] = &appv1alpha1.ModuleConfig{ Name: "params", Config: appconfig.WrapAny(¶msmodulev1.Module{}), } @@ -137,8 +169,8 @@ func ParamsModule() ModuleOption { } func TxModule() ModuleOption { - return func(config *appConfig) { - config.moduleConfigs["tx"] = &appv1alpha1.ModuleConfig{ + return func(config *Config) { + config.ModuleConfigs["tx"] = &appv1alpha1.ModuleConfig{ Name: "tx", Config: appconfig.WrapAny(&txconfigv1.Config{}), } @@ -146,8 +178,8 @@ func TxModule() ModuleOption { } func StakingModule() ModuleOption { - return func(config *appConfig) { - config.moduleConfigs["staking"] = &appv1alpha1.ModuleConfig{ + return func(config *Config) { + config.ModuleConfigs["staking"] = &appv1alpha1.ModuleConfig{ Name: "staking", Config: appconfig.WrapAny(&stakingmodulev1.Module{}), } @@ -155,8 +187,8 @@ func StakingModule() ModuleOption { } func SlashingModule() ModuleOption { - return func(config *appConfig) { - config.moduleConfigs["slashing"] = &appv1alpha1.ModuleConfig{ + return func(config *Config) { + config.ModuleConfigs["slashing"] = &appv1alpha1.ModuleConfig{ Name: "slashing", Config: appconfig.WrapAny(&slashingmodulev1.Module{}), } @@ -164,8 +196,8 @@ func SlashingModule() ModuleOption { } func GenutilModule() ModuleOption { - return func(config *appConfig) { - config.moduleConfigs["genutil"] = &appv1alpha1.ModuleConfig{ + return func(config *Config) { + config.ModuleConfigs["genutil"] = &appv1alpha1.ModuleConfig{ Name: "genutil", Config: appconfig.WrapAny(&genutilmodulev1.Module{}), } @@ -173,8 +205,8 @@ func GenutilModule() ModuleOption { } func DistributionModule() ModuleOption { - return func(config *appConfig) { - config.moduleConfigs["distribution"] = &appv1alpha1.ModuleConfig{ + return func(config *Config) { + config.ModuleConfigs["distribution"] = &appv1alpha1.ModuleConfig{ Name: "distribution", Config: appconfig.WrapAny(&distrmodulev1.Module{}), } @@ -182,8 +214,8 @@ func DistributionModule() ModuleOption { } func FeegrantModule() ModuleOption { - return func(config *appConfig) { - config.moduleConfigs["feegrant"] = &appv1alpha1.ModuleConfig{ + return func(config *Config) { + config.ModuleConfigs["feegrant"] = &appv1alpha1.ModuleConfig{ Name: "feegrant", Config: appconfig.WrapAny(&feegrantmodulev1.Module{}), } @@ -191,8 +223,8 @@ func FeegrantModule() ModuleOption { } func VestingModule() ModuleOption { - return func(config *appConfig) { - config.moduleConfigs["vesting"] = &appv1alpha1.ModuleConfig{ + return func(config *Config) { + config.ModuleConfigs["vesting"] = &appv1alpha1.ModuleConfig{ Name: "vesting", Config: appconfig.WrapAny(&vestingmodulev1.Module{}), } @@ -200,8 +232,8 @@ func VestingModule() ModuleOption { } func GovModule() ModuleOption { - return func(config *appConfig) { - config.moduleConfigs["gov"] = &appv1alpha1.ModuleConfig{ + return func(config *Config) { + config.ModuleConfigs["gov"] = &appv1alpha1.ModuleConfig{ Name: "gov", Config: appconfig.WrapAny(&govmodulev1.Module{}), } @@ -209,8 +241,8 @@ func GovModule() ModuleOption { } func ConsensusModule() ModuleOption { - return func(config *appConfig) { - config.moduleConfigs["consensus"] = &appv1alpha1.ModuleConfig{ + return func(config *Config) { + config.ModuleConfigs["consensus"] = &appv1alpha1.ModuleConfig{ Name: "consensus", Config: appconfig.WrapAny(&consensusmodulev1.Module{}), } @@ -218,8 +250,8 @@ func ConsensusModule() ModuleOption { } func MintModule() ModuleOption { - return func(config *appConfig) { - config.moduleConfigs["mint"] = &appv1alpha1.ModuleConfig{ + return func(config *Config) { + config.ModuleConfigs["mint"] = &appv1alpha1.ModuleConfig{ Name: "mint", Config: appconfig.WrapAny(&mintmodulev1.Module{}), GolangBindings: []*appv1alpha1.GolangBinding{ @@ -233,8 +265,8 @@ func MintModule() ModuleOption { } func EvidenceModule() ModuleOption { - return func(config *appConfig) { - config.moduleConfigs["evidence"] = &appv1alpha1.ModuleConfig{ + return func(config *Config) { + config.ModuleConfigs["evidence"] = &appv1alpha1.ModuleConfig{ Name: "evidence", Config: appconfig.WrapAny(&evidencemodulev1.Module{}), } @@ -242,8 +274,8 @@ func EvidenceModule() ModuleOption { } func AuthzModule() ModuleOption { - return func(config *appConfig) { - config.moduleConfigs["authz"] = &appv1alpha1.ModuleConfig{ + return func(config *Config) { + config.ModuleConfigs["authz"] = &appv1alpha1.ModuleConfig{ Name: "authz", Config: appconfig.WrapAny(&authzmodulev1.Module{}), } @@ -251,8 +283,8 @@ func AuthzModule() ModuleOption { } func GroupModule() ModuleOption { - return func(config *appConfig) { - config.moduleConfigs["group"] = &appv1alpha1.ModuleConfig{ + return func(config *Config) { + config.ModuleConfigs["group"] = &appv1alpha1.ModuleConfig{ Name: "group", Config: appconfig.WrapAny(&groupmodulev1.Module{}), } @@ -260,8 +292,8 @@ func GroupModule() ModuleOption { } func NFTModule() ModuleOption { - return func(config *appConfig) { - config.moduleConfigs["nft"] = &appv1alpha1.ModuleConfig{ + return func(config *Config) { + config.ModuleConfigs["nft"] = &appv1alpha1.ModuleConfig{ Name: "nft", Config: appconfig.WrapAny(&nftmodulev1.Module{}), } @@ -269,8 +301,8 @@ func NFTModule() ModuleOption { } func CircuitModule() ModuleOption { - return func(config *appConfig) { - config.moduleConfigs["circuit"] = &appv1alpha1.ModuleConfig{ + return func(config *Config) { + config.ModuleConfigs["circuit"] = &appv1alpha1.ModuleConfig{ Name: "circuit", Config: appconfig.WrapAny(&circuitmodulev1.Module{}), } @@ -278,49 +310,54 @@ func CircuitModule() ModuleOption { } func OmitInitGenesis() ModuleOption { - return func(config *appConfig) { + return func(config *Config) { config.setInitGenesis = false } } func NewAppConfig(opts ...ModuleOption) depinject.Config { - cfg := &appConfig{ - moduleConfigs: make(map[string]*appv1alpha1.ModuleConfig), - setInitGenesis: true, - } + cfg := defaultConfig() for _, opt := range opts { opt(cfg) } + preBlockers := make([]string, 0) beginBlockers := make([]string, 0) endBlockers := make([]string, 0) initGenesis := make([]string, 0) overrides := make([]*runtimev1alpha1.StoreKeyConfig, 0) - for _, s := range beginBlockOrder { - if _, ok := cfg.moduleConfigs[s]; ok { + for _, s := range cfg.PreBlockersOrder { + if _, ok := cfg.ModuleConfigs[s]; ok { + preBlockers = append(preBlockers, s) + } + } + + for _, s := range cfg.BeginBlockersOrder { + if _, ok := cfg.ModuleConfigs[s]; ok { beginBlockers = append(beginBlockers, s) } } - for _, s := range endBlockersOrder { - if _, ok := cfg.moduleConfigs[s]; ok { + for _, s := range cfg.EndBlockersOrder { + if _, ok := cfg.ModuleConfigs[s]; ok { endBlockers = append(endBlockers, s) } } - for _, s := range initGenesisOrder { - if _, ok := cfg.moduleConfigs[s]; ok { + for _, s := range cfg.InitGenesisOrder { + if _, ok := cfg.ModuleConfigs[s]; ok { initGenesis = append(initGenesis, s) } } - if _, ok := cfg.moduleConfigs["auth"]; ok { + if _, ok := cfg.ModuleConfigs["auth"]; ok { overrides = append(overrides, &runtimev1alpha1.StoreKeyConfig{ModuleName: "auth", KvStoreKey: "acc"}) } runtimeConfig := &runtimev1alpha1.Module{ AppName: "TestApp", + PreBlockers: preBlockers, BeginBlockers: beginBlockers, EndBlockers: endBlockers, OverrideStoreKeys: overrides, @@ -334,7 +371,7 @@ func NewAppConfig(opts ...ModuleOption) depinject.Config { Config: appconfig.WrapAny(runtimeConfig), }} - for _, m := range cfg.moduleConfigs { + for _, m := range cfg.ModuleConfigs { modules = append(modules, m) } diff --git a/testutil/context.go b/testutil/context.go index f2a9bdaf922f..288f7fc55bcd 100644 --- a/testutil/context.go +++ b/testutil/context.go @@ -4,11 +4,11 @@ import ( "testing" "time" - "cosmossdk.io/log" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" dbm "github.com/cosmos/cosmos-db" "github.com/stretchr/testify/assert" + "cosmossdk.io/log" "cosmossdk.io/store" "cosmossdk.io/store/metrics" storetypes "cosmossdk.io/store/types" @@ -31,19 +31,50 @@ func DefaultContext(key, tkey storetypes.StoreKey) sdk.Context { return ctx } +// DefaultContextWithKeys creates a sdk.Context with a fresh MemDB, mounting the providing keys for usage in the multistore. +// This function is intended to be used for testing purposes only. +func DefaultContextWithKeys( + keys map[string]*storetypes.KVStoreKey, + transKeys map[string]*storetypes.TransientStoreKey, + memKeys map[string]*storetypes.MemoryStoreKey, +) sdk.Context { + db := dbm.NewMemDB() + cms := store.NewCommitMultiStore(db, log.NewNopLogger(), metrics.NewNoOpMetrics()) + + for _, key := range keys { + cms.MountStoreWithDB(key, storetypes.StoreTypeIAVL, db) + } + + for _, tKey := range transKeys { + cms.MountStoreWithDB(tKey, storetypes.StoreTypeTransient, db) + } + + for _, memkey := range memKeys { + cms.MountStoreWithDB(memkey, storetypes.StoreTypeMemory, db) + } + + err := cms.LoadLatestVersion() + if err != nil { + panic(err) + } + + return sdk.NewContext(cms, cmtproto.Header{}, false, log.NewNopLogger()) +} + type TestContext struct { Ctx sdk.Context - DB *dbm.MemDB + DB dbm.DB CMS store.CommitMultiStore } -func DefaultContextWithDB(t testing.TB, key, tkey storetypes.StoreKey) TestContext { +func DefaultContextWithDB(tb testing.TB, key, tkey storetypes.StoreKey) TestContext { + tb.Helper() db := dbm.NewMemDB() cms := store.NewCommitMultiStore(db, log.NewNopLogger(), metrics.NewNoOpMetrics()) cms.MountStoreWithDB(key, storetypes.StoreTypeIAVL, db) cms.MountStoreWithDB(tkey, storetypes.StoreTypeTransient, db) err := cms.LoadLatestVersion() - assert.NoError(t, err) + assert.NoError(tb, err) ctx := sdk.NewContext(cms, cmtproto.Header{Time: time.Now()}, false, log.NewNopLogger()) diff --git a/testutil/integration/example_test.go b/testutil/integration/example_test.go index 549b2cc12005..b395324c1917 100644 --- a/testutil/integration/example_test.go +++ b/testutil/integration/example_test.go @@ -4,13 +4,14 @@ import ( "fmt" "io" - "cosmossdk.io/log" - storetypes "cosmossdk.io/store/types" - cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" - "github.com/google/go-cmp/cmp" + "cosmossdk.io/core/appmodule" + "cosmossdk.io/log" + storetypes "cosmossdk.io/store/types" + + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/testutil/integration" sdk "github.com/cosmos/cosmos-sdk/types" @@ -44,6 +45,7 @@ func Example() { runtime.NewKVStoreService(keys[authtypes.StoreKey]), authtypes.ProtoBaseAccount, map[string][]string{minttypes.ModuleName: {authtypes.Minter}}, + addresscodec.NewBech32Codec("cosmos"), "cosmos", authority, ) @@ -62,7 +64,10 @@ func Example() { logger, keys, encodingCfg.Codec, - authModule, mintModule, + map[string]appmodule.AppModule{ + authtypes.ModuleName: authModule, + minttypes.ModuleName: mintModule, + }, ) // register the message and query servers @@ -129,6 +134,7 @@ func Example_oneModule() { runtime.NewKVStoreService(keys[authtypes.StoreKey]), authtypes.ProtoBaseAccount, map[string][]string{minttypes.ModuleName: {authtypes.Minter}}, + addresscodec.NewBech32Codec("cosmos"), "cosmos", authority, ) @@ -142,7 +148,9 @@ func Example_oneModule() { logger, keys, encodingCfg.Codec, - authModule, + map[string]appmodule.AppModule{ + authtypes.ModuleName: authModule, + }, ) // register the message and query servers diff --git a/testutil/integration/router.go b/testutil/integration/router.go index fc4cebee89fc..0bb9d6e7921c 100644 --- a/testutil/integration/router.go +++ b/testutil/integration/router.go @@ -4,13 +4,15 @@ import ( "context" "fmt" + cmtabcitypes "github.com/cometbft/cometbft/abci/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + dbm "github.com/cosmos/cosmos-db" + + "cosmossdk.io/core/appmodule" "cosmossdk.io/log" "cosmossdk.io/store" "cosmossdk.io/store/metrics" storetypes "cosmossdk.io/store/types" - cmtabcitypes "github.com/cometbft/cometbft/abci/types" - cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" - dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" @@ -44,30 +46,30 @@ func NewIntegrationApp( logger log.Logger, keys map[string]*storetypes.KVStoreKey, appCodec codec.Codec, - modules ...module.AppModule, + modules map[string]appmodule.AppModule, + baseAppOptions ...func(*baseapp.BaseApp), ) *App { db := dbm.NewMemDB() interfaceRegistry := codectypes.NewInterfaceRegistry() - for _, module := range modules { - module.RegisterInterfaces(interfaceRegistry) - } + moduleManager := module.NewManagerFromMap(modules) + basicModuleManager := module.NewBasicManagerFromManager(moduleManager, nil) + basicModuleManager.RegisterInterfaces(interfaceRegistry) txConfig := authtx.NewTxConfig(codec.NewProtoCodec(interfaceRegistry), authtx.DefaultSignModes) - bApp := baseapp.NewBaseApp(appName, logger, db, txConfig.TxDecoder(), baseapp.SetChainID(appName)) + bApp := baseapp.NewBaseApp(appName, logger, db, txConfig.TxDecoder(), append(baseAppOptions, baseapp.SetChainID(appName))...) bApp.MountKVStores(keys) - bApp.SetInitChainer(func(ctx sdk.Context, _ *cmtabcitypes.RequestInitChain) (*cmtabcitypes.ResponseInitChain, error) { + bApp.SetInitChainer(func(_ sdk.Context, _ *cmtabcitypes.RequestInitChain) (*cmtabcitypes.ResponseInitChain, error) { for _, mod := range modules { if m, ok := mod.(module.HasGenesis); ok { - m.InitGenesis(ctx, appCodec, m.DefaultGenesis(appCodec)) + m.InitGenesis(sdkCtx, appCodec, m.DefaultGenesis(appCodec)) } } return &cmtabcitypes.ResponseInitChain{}, nil }) - moduleManager := module.NewManager(modules...) bApp.SetBeginBlocker(func(_ sdk.Context) (sdk.BeginBlock, error) { return moduleManager.BeginBlock(sdkCtx) }) diff --git a/testutil/ioutil.go b/testutil/ioutil.go index ef33eaa4411e..e786dd4fbaf2 100644 --- a/testutil/ioutil.go +++ b/testutil/ioutil.go @@ -38,7 +38,7 @@ func ApplyMockIO(c *cobra.Command) (BufferReader, BufferWriter) { return mockIn, mockOut } -// ApplyMockIODiscardOutputs replaces a cobra.Command output and error streams with a dummy io.Writer. +// ApplyMockIODiscardOutErr replaces a cobra.Command output and error streams with a dummy io.Writer. // Replaces and returns the io.Reader associated to the cobra.Command input stream. func ApplyMockIODiscardOutErr(c *cobra.Command) BufferReader { mockIn := strings.NewReader("") @@ -52,36 +52,36 @@ func ApplyMockIODiscardOutErr(c *cobra.Command) BufferReader { // Write the given string to a new temporary file. // Returns an open file for the test to use. -func WriteToNewTempFile(t testing.TB, s string) *os.File { - t.Helper() +func WriteToNewTempFile(tb testing.TB, s string) *os.File { + tb.Helper() - fp := TempFile(t) + fp := TempFile(tb) _, err := fp.WriteString(s) - require.Nil(t, err) + require.Nil(tb, err) return fp } // TempFile returns a writable temporary file for the test to use. -func TempFile(t testing.TB) *os.File { - t.Helper() +func TempFile(tb testing.TB) *os.File { + tb.Helper() - fp, err := os.CreateTemp(GetTempDir(t), "") - require.NoError(t, err) + fp, err := os.CreateTemp(GetTempDir(tb), "") + require.NoError(tb, err) return fp } // GetTempDir returns a writable temporary director for the test to use. -func GetTempDir(t testing.TB) string { - t.Helper() +func GetTempDir(tb testing.TB) string { + tb.Helper() // os.MkDir() is used instead of testing.T.TempDir() // see https://github.com/cosmos/cosmos-sdk/pull/8475 and // https://github.com/cosmos/cosmos-sdk/pull/10341 for // this change's rationale. tempdir, err := os.MkdirTemp("", "") - require.NoError(t, err) - t.Cleanup(func() { _ = os.RemoveAll(tempdir) }) + require.NoError(tb, err) + tb.Cleanup(func() { _ = os.RemoveAll(tempdir) }) return tempdir } diff --git a/testutil/key.go b/testutil/key.go index a82a822567f3..69df40c46ed5 100644 --- a/testutil/key.go +++ b/testutil/key.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -// GenerateCoinKey generates a new key mnemonic along with its addrress. +// GenerateCoinKey generates a new key mnemonic along with its address. func GenerateCoinKey(algo keyring.SignatureAlgo, cdc codec.Codec) (sdk.AccAddress, string, error) { // generate a private key, with mnemonic info, secret, err := keyring.NewInMemory(cdc).NewMnemonic( @@ -28,7 +28,7 @@ func GenerateCoinKey(algo keyring.SignatureAlgo, cdc codec.Codec) (sdk.AccAddres return addr, secret, nil } -// GenerateSaveCoinKey generates a new key mnemonic with its addrress. +// GenerateSaveCoinKey generates a new key mnemonic with its address. // If mnemonic is provided then it's used for key generation. // The key is saved in the keyring. The function returns error if overwrite=true and the key // already exists. diff --git a/testutil/key_test.go b/testutil/key_test.go index 799e2a0629f9..10d427652c9a 100644 --- a/testutil/key_test.go +++ b/testutil/key_test.go @@ -18,7 +18,7 @@ func TestGenerateCoinKey(t *testing.T) { require.NoError(t, err) // Test creation - k, err := keyring.NewInMemory(cdc).NewAccount("xxx", mnemonic, "", hd.NewFundraiserParams(0, types.GetConfig().GetCoinType(), 0).String(), hd.Secp256k1) + k, err := keyring.NewInMemory(cdc).NewAccount("xxx", mnemonic, "", hd.NewFundraiserParams(0, types.CoinType, 0).String(), hd.Secp256k1) require.NoError(t, err) addr1, err := k.GetAddress() require.NoError(t, err) @@ -43,7 +43,7 @@ func TestGenerateSaveCoinKey(t *testing.T) { require.Equal(t, addr, addr1) // Test in-memory recovery - k, err = keyring.NewInMemory(encCfg.Codec).NewAccount("xxx", mnemonic, "", hd.NewFundraiserParams(0, types.GetConfig().GetCoinType(), 0).String(), hd.Secp256k1) + k, err = keyring.NewInMemory(encCfg.Codec).NewAccount("xxx", mnemonic, "", hd.NewFundraiserParams(0, types.CoinType, 0).String(), hd.Secp256k1) require.NoError(t, err) addr1, err = k.GetAddress() require.NoError(t, err) diff --git a/testutil/list.go b/testutil/list.go index ab6e04e2e774..ff9c4994a784 100644 --- a/testutil/list.go +++ b/testutil/list.go @@ -1,6 +1,8 @@ package testutil -import "math/rand" +import ( + "math/rand" +) func RandSliceElem[E any](r *rand.Rand, elems []E) (E, bool) { if len(elems) == 0 { diff --git a/testutil/mock/account_retriever.go b/testutil/mock/account_retriever.go index f1a104e649ca..90c98ca1140c 100644 --- a/testutil/mock/account_retriever.go +++ b/testutil/mock/account_retriever.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: client/account_retriever.go +// +// Generated by this command: +// +// mockgen -source=client/account_retriever.go -package mock -destination testutil/mock/account_retriever.go +// // Package mock is a generated GoMock package. package mock @@ -10,13 +15,14 @@ import ( client "github.com/cosmos/cosmos-sdk/client" types "github.com/cosmos/cosmos-sdk/crypto/types" types0 "github.com/cosmos/cosmos-sdk/types" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockAccount is a mock of Account interface. type MockAccount struct { ctrl *gomock.Controller recorder *MockAccountMockRecorder + isgomock struct{} } // MockAccountMockRecorder is the mock recorder for MockAccount. @@ -96,6 +102,7 @@ func (mr *MockAccountMockRecorder) GetSequence() *gomock.Call { type MockAccountRetriever struct { ctrl *gomock.Controller recorder *MockAccountRetrieverMockRecorder + isgomock struct{} } // MockAccountRetrieverMockRecorder is the mock recorder for MockAccountRetriever. @@ -124,7 +131,7 @@ func (m *MockAccountRetriever) EnsureExists(clientCtx client.Context, addr types } // EnsureExists indicates an expected call of EnsureExists. -func (mr *MockAccountRetrieverMockRecorder) EnsureExists(clientCtx, addr interface{}) *gomock.Call { +func (mr *MockAccountRetrieverMockRecorder) EnsureExists(clientCtx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EnsureExists", reflect.TypeOf((*MockAccountRetriever)(nil).EnsureExists), clientCtx, addr) } @@ -139,7 +146,7 @@ func (m *MockAccountRetriever) GetAccount(clientCtx client.Context, addr types0. } // GetAccount indicates an expected call of GetAccount. -func (mr *MockAccountRetrieverMockRecorder) GetAccount(clientCtx, addr interface{}) *gomock.Call { +func (mr *MockAccountRetrieverMockRecorder) GetAccount(clientCtx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccount", reflect.TypeOf((*MockAccountRetriever)(nil).GetAccount), clientCtx, addr) } @@ -155,7 +162,7 @@ func (m *MockAccountRetriever) GetAccountNumberSequence(clientCtx client.Context } // GetAccountNumberSequence indicates an expected call of GetAccountNumberSequence. -func (mr *MockAccountRetrieverMockRecorder) GetAccountNumberSequence(clientCtx, addr interface{}) *gomock.Call { +func (mr *MockAccountRetrieverMockRecorder) GetAccountNumberSequence(clientCtx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccountNumberSequence", reflect.TypeOf((*MockAccountRetriever)(nil).GetAccountNumberSequence), clientCtx, addr) } @@ -171,7 +178,7 @@ func (m *MockAccountRetriever) GetAccountWithHeight(clientCtx client.Context, ad } // GetAccountWithHeight indicates an expected call of GetAccountWithHeight. -func (mr *MockAccountRetrieverMockRecorder) GetAccountWithHeight(clientCtx, addr interface{}) *gomock.Call { +func (mr *MockAccountRetrieverMockRecorder) GetAccountWithHeight(clientCtx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccountWithHeight", reflect.TypeOf((*MockAccountRetriever)(nil).GetAccountWithHeight), clientCtx, addr) } diff --git a/testutil/mock/db/types.go b/testutil/mock/db/types.go deleted file mode 100644 index 40deb6e7a6f0..000000000000 --- a/testutil/mock/db/types.go +++ /dev/null @@ -1,745 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: db/types.go - -// Package mock is a generated GoMock package. -package mock - -import ( - reflect "reflect" - - db "github.com/cosmos/cosmos-sdk/db" - gomock "github.com/golang/mock/gomock" -) - -// MockConnection is a mock of Connection interface. -type MockConnection struct { - ctrl *gomock.Controller - recorder *MockConnectionMockRecorder -} - -// MockConnectionMockRecorder is the mock recorder for MockConnection. -type MockConnectionMockRecorder struct { - mock *MockConnection -} - -// NewMockConnection creates a new mock instance. -func NewMockConnection(ctrl *gomock.Controller) *MockConnection { - mock := &MockConnection{ctrl: ctrl} - mock.recorder = &MockConnectionMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockConnection) EXPECT() *MockConnectionMockRecorder { - return m.recorder -} - -// Close mocks base method. -func (m *MockConnection) Close() error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Close") - ret0, _ := ret[0].(error) - return ret0 -} - -// Close indicates an expected call of Close. -func (mr *MockConnectionMockRecorder) Close() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockConnection)(nil).Close)) -} - -// DeleteVersion mocks base method. -func (m *MockConnection) DeleteVersion(arg0 uint64) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "DeleteVersion", arg0) - ret0, _ := ret[0].(error) - return ret0 -} - -// DeleteVersion indicates an expected call of DeleteVersion. -func (mr *MockConnectionMockRecorder) DeleteVersion(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteVersion", reflect.TypeOf((*MockConnection)(nil).DeleteVersion), arg0) -} - -// ReadWriter mocks base method. -func (m *MockConnection) ReadWriter() db.ReadWriter { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ReadWriter") - ret0, _ := ret[0].(db.ReadWriter) - return ret0 -} - -// ReadWriter indicates an expected call of ReadWriter. -func (mr *MockConnectionMockRecorder) ReadWriter() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadWriter", reflect.TypeOf((*MockConnection)(nil).ReadWriter)) -} - -// Reader mocks base method. -func (m *MockConnection) Reader() db.Reader { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Reader") - ret0, _ := ret[0].(db.Reader) - return ret0 -} - -// Reader indicates an expected call of Reader. -func (mr *MockConnectionMockRecorder) Reader() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Reader", reflect.TypeOf((*MockConnection)(nil).Reader)) -} - -// ReaderAt mocks base method. -func (m *MockConnection) ReaderAt(arg0 uint64) (db.Reader, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ReaderAt", arg0) - ret0, _ := ret[0].(db.Reader) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ReaderAt indicates an expected call of ReaderAt. -func (mr *MockConnectionMockRecorder) ReaderAt(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReaderAt", reflect.TypeOf((*MockConnection)(nil).ReaderAt), arg0) -} - -// Revert mocks base method. -func (m *MockConnection) Revert() error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Revert") - ret0, _ := ret[0].(error) - return ret0 -} - -// Revert indicates an expected call of Revert. -func (mr *MockConnectionMockRecorder) Revert() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Revert", reflect.TypeOf((*MockConnection)(nil).Revert)) -} - -// SaveNextVersion mocks base method. -func (m *MockConnection) SaveNextVersion() (uint64, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SaveNextVersion") - ret0, _ := ret[0].(uint64) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// SaveNextVersion indicates an expected call of SaveNextVersion. -func (mr *MockConnectionMockRecorder) SaveNextVersion() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SaveNextVersion", reflect.TypeOf((*MockConnection)(nil).SaveNextVersion)) -} - -// SaveVersion mocks base method. -func (m *MockConnection) SaveVersion(arg0 uint64) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SaveVersion", arg0) - ret0, _ := ret[0].(error) - return ret0 -} - -// SaveVersion indicates an expected call of SaveVersion. -func (mr *MockConnectionMockRecorder) SaveVersion(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SaveVersion", reflect.TypeOf((*MockConnection)(nil).SaveVersion), arg0) -} - -// Versions mocks base method. -func (m *MockConnection) Versions() (db.VersionSet, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Versions") - ret0, _ := ret[0].(db.VersionSet) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Versions indicates an expected call of Versions. -func (mr *MockConnectionMockRecorder) Versions() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Versions", reflect.TypeOf((*MockConnection)(nil).Versions)) -} - -// Writer mocks base method. -func (m *MockConnection) Writer() db.Writer { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Writer") - ret0, _ := ret[0].(db.Writer) - return ret0 -} - -// Writer indicates an expected call of Writer. -func (mr *MockConnectionMockRecorder) Writer() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Writer", reflect.TypeOf((*MockConnection)(nil).Writer)) -} - -// MockReader is a mock of Reader interface. -type MockReader struct { - ctrl *gomock.Controller - recorder *MockReaderMockRecorder -} - -// MockReaderMockRecorder is the mock recorder for MockReader. -type MockReaderMockRecorder struct { - mock *MockReader -} - -// NewMockReader creates a new mock instance. -func NewMockReader(ctrl *gomock.Controller) *MockReader { - mock := &MockReader{ctrl: ctrl} - mock.recorder = &MockReaderMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockReader) EXPECT() *MockReaderMockRecorder { - return m.recorder -} - -// Discard mocks base method. -func (m *MockReader) Discard() error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Discard") - ret0, _ := ret[0].(error) - return ret0 -} - -// Discard indicates an expected call of Discard. -func (mr *MockReaderMockRecorder) Discard() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Discard", reflect.TypeOf((*MockReader)(nil).Discard)) -} - -// Get mocks base method. -func (m *MockReader) Get(arg0 []byte) ([]byte, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Get", arg0) - ret0, _ := ret[0].([]byte) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Get indicates an expected call of Get. -func (mr *MockReaderMockRecorder) Get(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockReader)(nil).Get), arg0) -} - -// Has mocks base method. -func (m *MockReader) Has(key []byte) (bool, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Has", key) - ret0, _ := ret[0].(bool) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Has indicates an expected call of Has. -func (mr *MockReaderMockRecorder) Has(key interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Has", reflect.TypeOf((*MockReader)(nil).Has), key) -} - -// Iterator mocks base method. -func (m *MockReader) Iterator(start, end []byte) (db.Iterator, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Iterator", start, end) - ret0, _ := ret[0].(db.Iterator) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Iterator indicates an expected call of Iterator. -func (mr *MockReaderMockRecorder) Iterator(start, end interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Iterator", reflect.TypeOf((*MockReader)(nil).Iterator), start, end) -} - -// ReverseIterator mocks base method. -func (m *MockReader) ReverseIterator(start, end []byte) (db.Iterator, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ReverseIterator", start, end) - ret0, _ := ret[0].(db.Iterator) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ReverseIterator indicates an expected call of ReverseIterator. -func (mr *MockReaderMockRecorder) ReverseIterator(start, end interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReverseIterator", reflect.TypeOf((*MockReader)(nil).ReverseIterator), start, end) -} - -// MockWriter is a mock of Writer interface. -type MockWriter struct { - ctrl *gomock.Controller - recorder *MockWriterMockRecorder -} - -// MockWriterMockRecorder is the mock recorder for MockWriter. -type MockWriterMockRecorder struct { - mock *MockWriter -} - -// NewMockWriter creates a new mock instance. -func NewMockWriter(ctrl *gomock.Controller) *MockWriter { - mock := &MockWriter{ctrl: ctrl} - mock.recorder = &MockWriterMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockWriter) EXPECT() *MockWriterMockRecorder { - return m.recorder -} - -// Commit mocks base method. -func (m *MockWriter) Commit() error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Commit") - ret0, _ := ret[0].(error) - return ret0 -} - -// Commit indicates an expected call of Commit. -func (mr *MockWriterMockRecorder) Commit() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Commit", reflect.TypeOf((*MockWriter)(nil).Commit)) -} - -// Delete mocks base method. -func (m *MockWriter) Delete(arg0 []byte) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Delete", arg0) - ret0, _ := ret[0].(error) - return ret0 -} - -// Delete indicates an expected call of Delete. -func (mr *MockWriterMockRecorder) Delete(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockWriter)(nil).Delete), arg0) -} - -// Discard mocks base method. -func (m *MockWriter) Discard() error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Discard") - ret0, _ := ret[0].(error) - return ret0 -} - -// Discard indicates an expected call of Discard. -func (mr *MockWriterMockRecorder) Discard() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Discard", reflect.TypeOf((*MockWriter)(nil).Discard)) -} - -// Set mocks base method. -func (m *MockWriter) Set(arg0, arg1 []byte) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Set", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Set indicates an expected call of Set. -func (mr *MockWriterMockRecorder) Set(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Set", reflect.TypeOf((*MockWriter)(nil).Set), arg0, arg1) -} - -// MockReadWriter is a mock of ReadWriter interface. -type MockReadWriter struct { - ctrl *gomock.Controller - recorder *MockReadWriterMockRecorder -} - -// MockReadWriterMockRecorder is the mock recorder for MockReadWriter. -type MockReadWriterMockRecorder struct { - mock *MockReadWriter -} - -// NewMockReadWriter creates a new mock instance. -func NewMockReadWriter(ctrl *gomock.Controller) *MockReadWriter { - mock := &MockReadWriter{ctrl: ctrl} - mock.recorder = &MockReadWriterMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockReadWriter) EXPECT() *MockReadWriterMockRecorder { - return m.recorder -} - -// Commit mocks base method. -func (m *MockReadWriter) Commit() error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Commit") - ret0, _ := ret[0].(error) - return ret0 -} - -// Commit indicates an expected call of Commit. -func (mr *MockReadWriterMockRecorder) Commit() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Commit", reflect.TypeOf((*MockReadWriter)(nil).Commit)) -} - -// Delete mocks base method. -func (m *MockReadWriter) Delete(arg0 []byte) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Delete", arg0) - ret0, _ := ret[0].(error) - return ret0 -} - -// Delete indicates an expected call of Delete. -func (mr *MockReadWriterMockRecorder) Delete(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockReadWriter)(nil).Delete), arg0) -} - -// Discard mocks base method. -func (m *MockReadWriter) Discard() error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Discard") - ret0, _ := ret[0].(error) - return ret0 -} - -// Discard indicates an expected call of Discard. -func (mr *MockReadWriterMockRecorder) Discard() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Discard", reflect.TypeOf((*MockReadWriter)(nil).Discard)) -} - -// Get mocks base method. -func (m *MockReadWriter) Get(arg0 []byte) ([]byte, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Get", arg0) - ret0, _ := ret[0].([]byte) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Get indicates an expected call of Get. -func (mr *MockReadWriterMockRecorder) Get(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockReadWriter)(nil).Get), arg0) -} - -// Has mocks base method. -func (m *MockReadWriter) Has(key []byte) (bool, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Has", key) - ret0, _ := ret[0].(bool) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Has indicates an expected call of Has. -func (mr *MockReadWriterMockRecorder) Has(key interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Has", reflect.TypeOf((*MockReadWriter)(nil).Has), key) -} - -// Iterator mocks base method. -func (m *MockReadWriter) Iterator(start, end []byte) (db.Iterator, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Iterator", start, end) - ret0, _ := ret[0].(db.Iterator) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Iterator indicates an expected call of Iterator. -func (mr *MockReadWriterMockRecorder) Iterator(start, end interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Iterator", reflect.TypeOf((*MockReadWriter)(nil).Iterator), start, end) -} - -// ReverseIterator mocks base method. -func (m *MockReadWriter) ReverseIterator(start, end []byte) (db.Iterator, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ReverseIterator", start, end) - ret0, _ := ret[0].(db.Iterator) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ReverseIterator indicates an expected call of ReverseIterator. -func (mr *MockReadWriterMockRecorder) ReverseIterator(start, end interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReverseIterator", reflect.TypeOf((*MockReadWriter)(nil).ReverseIterator), start, end) -} - -// Set mocks base method. -func (m *MockReadWriter) Set(arg0, arg1 []byte) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Set", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Set indicates an expected call of Set. -func (mr *MockReadWriterMockRecorder) Set(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Set", reflect.TypeOf((*MockReadWriter)(nil).Set), arg0, arg1) -} - -// MockIterator is a mock of Iterator interface. -type MockIterator struct { - ctrl *gomock.Controller - recorder *MockIteratorMockRecorder -} - -// MockIteratorMockRecorder is the mock recorder for MockIterator. -type MockIteratorMockRecorder struct { - mock *MockIterator -} - -// NewMockIterator creates a new mock instance. -func NewMockIterator(ctrl *gomock.Controller) *MockIterator { - mock := &MockIterator{ctrl: ctrl} - mock.recorder = &MockIteratorMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockIterator) EXPECT() *MockIteratorMockRecorder { - return m.recorder -} - -// Close mocks base method. -func (m *MockIterator) Close() error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Close") - ret0, _ := ret[0].(error) - return ret0 -} - -// Close indicates an expected call of Close. -func (mr *MockIteratorMockRecorder) Close() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockIterator)(nil).Close)) -} - -// Domain mocks base method. -func (m *MockIterator) Domain() ([]byte, []byte) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Domain") - ret0, _ := ret[0].([]byte) - ret1, _ := ret[1].([]byte) - return ret0, ret1 -} - -// Domain indicates an expected call of Domain. -func (mr *MockIteratorMockRecorder) Domain() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Domain", reflect.TypeOf((*MockIterator)(nil).Domain)) -} - -// Error mocks base method. -func (m *MockIterator) Error() error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Error") - ret0, _ := ret[0].(error) - return ret0 -} - -// Error indicates an expected call of Error. -func (mr *MockIteratorMockRecorder) Error() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Error", reflect.TypeOf((*MockIterator)(nil).Error)) -} - -// Key mocks base method. -func (m *MockIterator) Key() []byte { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Key") - ret0, _ := ret[0].([]byte) - return ret0 -} - -// Key indicates an expected call of Key. -func (mr *MockIteratorMockRecorder) Key() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Key", reflect.TypeOf((*MockIterator)(nil).Key)) -} - -// Next mocks base method. -func (m *MockIterator) Next() bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Next") - ret0, _ := ret[0].(bool) - return ret0 -} - -// Next indicates an expected call of Next. -func (mr *MockIteratorMockRecorder) Next() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Next", reflect.TypeOf((*MockIterator)(nil).Next)) -} - -// Value mocks base method. -func (m *MockIterator) Value() []byte { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Value") - ret0, _ := ret[0].([]byte) - return ret0 -} - -// Value indicates an expected call of Value. -func (mr *MockIteratorMockRecorder) Value() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Value", reflect.TypeOf((*MockIterator)(nil).Value)) -} - -// MockVersionSet is a mock of VersionSet interface. -type MockVersionSet struct { - ctrl *gomock.Controller - recorder *MockVersionSetMockRecorder -} - -// MockVersionSetMockRecorder is the mock recorder for MockVersionSet. -type MockVersionSetMockRecorder struct { - mock *MockVersionSet -} - -// NewMockVersionSet creates a new mock instance. -func NewMockVersionSet(ctrl *gomock.Controller) *MockVersionSet { - mock := &MockVersionSet{ctrl: ctrl} - mock.recorder = &MockVersionSetMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockVersionSet) EXPECT() *MockVersionSetMockRecorder { - return m.recorder -} - -// Count mocks base method. -func (m *MockVersionSet) Count() int { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Count") - ret0, _ := ret[0].(int) - return ret0 -} - -// Count indicates an expected call of Count. -func (mr *MockVersionSetMockRecorder) Count() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Count", reflect.TypeOf((*MockVersionSet)(nil).Count)) -} - -// Equal mocks base method. -func (m *MockVersionSet) Equal(arg0 db.VersionSet) bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Equal", arg0) - ret0, _ := ret[0].(bool) - return ret0 -} - -// Equal indicates an expected call of Equal. -func (mr *MockVersionSetMockRecorder) Equal(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Equal", reflect.TypeOf((*MockVersionSet)(nil).Equal), arg0) -} - -// Exists mocks base method. -func (m *MockVersionSet) Exists(arg0 uint64) bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Exists", arg0) - ret0, _ := ret[0].(bool) - return ret0 -} - -// Exists indicates an expected call of Exists. -func (mr *MockVersionSetMockRecorder) Exists(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Exists", reflect.TypeOf((*MockVersionSet)(nil).Exists), arg0) -} - -// Iterator mocks base method. -func (m *MockVersionSet) Iterator() db.VersionIterator { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Iterator") - ret0, _ := ret[0].(db.VersionIterator) - return ret0 -} - -// Iterator indicates an expected call of Iterator. -func (mr *MockVersionSetMockRecorder) Iterator() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Iterator", reflect.TypeOf((*MockVersionSet)(nil).Iterator)) -} - -// Last mocks base method. -func (m *MockVersionSet) Last() uint64 { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Last") - ret0, _ := ret[0].(uint64) - return ret0 -} - -// Last indicates an expected call of Last. -func (mr *MockVersionSetMockRecorder) Last() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Last", reflect.TypeOf((*MockVersionSet)(nil).Last)) -} - -// MockVersionIterator is a mock of VersionIterator interface. -type MockVersionIterator struct { - ctrl *gomock.Controller - recorder *MockVersionIteratorMockRecorder -} - -// MockVersionIteratorMockRecorder is the mock recorder for MockVersionIterator. -type MockVersionIteratorMockRecorder struct { - mock *MockVersionIterator -} - -// NewMockVersionIterator creates a new mock instance. -func NewMockVersionIterator(ctrl *gomock.Controller) *MockVersionIterator { - mock := &MockVersionIterator{ctrl: ctrl} - mock.recorder = &MockVersionIteratorMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockVersionIterator) EXPECT() *MockVersionIteratorMockRecorder { - return m.recorder -} - -// Next mocks base method. -func (m *MockVersionIterator) Next() bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Next") - ret0, _ := ret[0].(bool) - return ret0 -} - -// Next indicates an expected call of Next. -func (mr *MockVersionIteratorMockRecorder) Next() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Next", reflect.TypeOf((*MockVersionIterator)(nil).Next)) -} - -// Value mocks base method. -func (m *MockVersionIterator) Value() uint64 { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Value") - ret0, _ := ret[0].(uint64) - return ret0 -} - -// Value indicates an expected call of Value. -func (mr *MockVersionIteratorMockRecorder) Value() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Value", reflect.TypeOf((*MockVersionIterator)(nil).Value)) -} diff --git a/testutil/mock/grpc_server.go b/testutil/mock/grpc_server.go index 7959051080d4..6afab1ee092f 100644 --- a/testutil/mock/grpc_server.go +++ b/testutil/mock/grpc_server.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/cosmos/gogoproto/grpc (interfaces: Server) +// +// Generated by this command: +// +// mockgen -package mock -destination testutil/mock/grpc_server.go github.com/cosmos/gogoproto/grpc Server +// // Package mock is a generated GoMock package. package mock @@ -7,7 +12,7 @@ package mock import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" grpc "google.golang.org/grpc" ) @@ -15,6 +20,7 @@ import ( type MockServer struct { ctrl *gomock.Controller recorder *MockServerMockRecorder + isgomock struct{} } // MockServerMockRecorder is the mock recorder for MockServer. @@ -35,13 +41,13 @@ func (m *MockServer) EXPECT() *MockServerMockRecorder { } // RegisterService mocks base method. -func (m *MockServer) RegisterService(arg0 *grpc.ServiceDesc, arg1 interface{}) { +func (m *MockServer) RegisterService(sd *grpc.ServiceDesc, ss any) { m.ctrl.T.Helper() - m.ctrl.Call(m, "RegisterService", arg0, arg1) + m.ctrl.Call(m, "RegisterService", sd, ss) } // RegisterService indicates an expected call of RegisterService. -func (mr *MockServerMockRecorder) RegisterService(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockServerMockRecorder) RegisterService(sd, ss any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterService", reflect.TypeOf((*MockServer)(nil).RegisterService), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterService", reflect.TypeOf((*MockServer)(nil).RegisterService), sd, ss) } diff --git a/testutil/mock/logger.go b/testutil/mock/logger.go index b17f076d0255..75b87274306e 100644 --- a/testutil/mock/logger.go +++ b/testutil/mock/logger.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: cosmossdk.io/log (interfaces: Logger) +// +// Generated by this command: +// +// mockgen -package mock -destination testutil/mock/logger.go cosmossdk.io/log Logger +// // Package mock is a generated GoMock package. package mock @@ -8,13 +13,14 @@ import ( reflect "reflect" log "cosmossdk.io/log" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockLogger is a mock of Logger interface. type MockLogger struct { ctrl *gomock.Controller recorder *MockLoggerMockRecorder + isgomock struct{} } // MockLoggerMockRecorder is the mock recorder for MockLogger. @@ -35,44 +41,44 @@ func (m *MockLogger) EXPECT() *MockLoggerMockRecorder { } // Debug mocks base method. -func (m *MockLogger) Debug(arg0 string, arg1 ...interface{}) { +func (m *MockLogger) Debug(msg string, keyVals ...any) { m.ctrl.T.Helper() - varargs := []interface{}{arg0} - for _, a := range arg1 { + varargs := []any{msg} + for _, a := range keyVals { varargs = append(varargs, a) } m.ctrl.Call(m, "Debug", varargs...) } // Debug indicates an expected call of Debug. -func (mr *MockLoggerMockRecorder) Debug(arg0 interface{}, arg1 ...interface{}) *gomock.Call { +func (mr *MockLoggerMockRecorder) Debug(msg any, keyVals ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0}, arg1...) + varargs := append([]any{msg}, keyVals...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Debug", reflect.TypeOf((*MockLogger)(nil).Debug), varargs...) } // Error mocks base method. -func (m *MockLogger) Error(arg0 string, arg1 ...interface{}) { +func (m *MockLogger) Error(msg string, keyVals ...any) { m.ctrl.T.Helper() - varargs := []interface{}{arg0} - for _, a := range arg1 { + varargs := []any{msg} + for _, a := range keyVals { varargs = append(varargs, a) } m.ctrl.Call(m, "Error", varargs...) } // Error indicates an expected call of Error. -func (mr *MockLoggerMockRecorder) Error(arg0 interface{}, arg1 ...interface{}) *gomock.Call { +func (mr *MockLoggerMockRecorder) Error(msg any, keyVals ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0}, arg1...) + varargs := append([]any{msg}, keyVals...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Error", reflect.TypeOf((*MockLogger)(nil).Error), varargs...) } // Impl mocks base method. -func (m *MockLogger) Impl() interface{} { +func (m *MockLogger) Impl() any { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Impl") - ret0, _ := ret[0].(interface{}) + ret0, _ := ret[0].(any) return ret0 } @@ -83,27 +89,44 @@ func (mr *MockLoggerMockRecorder) Impl() *gomock.Call { } // Info mocks base method. -func (m *MockLogger) Info(arg0 string, arg1 ...interface{}) { +func (m *MockLogger) Info(msg string, keyVals ...any) { m.ctrl.T.Helper() - varargs := []interface{}{arg0} - for _, a := range arg1 { + varargs := []any{msg} + for _, a := range keyVals { varargs = append(varargs, a) } m.ctrl.Call(m, "Info", varargs...) } // Info indicates an expected call of Info. -func (mr *MockLoggerMockRecorder) Info(arg0 interface{}, arg1 ...interface{}) *gomock.Call { +func (mr *MockLoggerMockRecorder) Info(msg any, keyVals ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0}, arg1...) + varargs := append([]any{msg}, keyVals...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Info", reflect.TypeOf((*MockLogger)(nil).Info), varargs...) } +// Warn mocks base method. +func (m *MockLogger) Warn(msg string, keyVals ...any) { + m.ctrl.T.Helper() + varargs := []any{msg} + for _, a := range keyVals { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "Warn", varargs...) +} + +// Warn indicates an expected call of Warn. +func (mr *MockLoggerMockRecorder) Warn(msg any, keyVals ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{msg}, keyVals...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Warn", reflect.TypeOf((*MockLogger)(nil).Warn), varargs...) +} + // With mocks base method. -func (m *MockLogger) With(arg0 ...interface{}) log.Logger { +func (m *MockLogger) With(keyVals ...any) log.Logger { m.ctrl.T.Helper() - varargs := []interface{}{} - for _, a := range arg0 { + varargs := []any{} + for _, a := range keyVals { varargs = append(varargs, a) } ret := m.ctrl.Call(m, "With", varargs...) @@ -112,7 +135,7 @@ func (m *MockLogger) With(arg0 ...interface{}) log.Logger { } // With indicates an expected call of With. -func (mr *MockLoggerMockRecorder) With(arg0 ...interface{}) *gomock.Call { +func (mr *MockLoggerMockRecorder) With(keyVals ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "With", reflect.TypeOf((*MockLogger)(nil).With), arg0...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "With", reflect.TypeOf((*MockLogger)(nil).With), keyVals...) } diff --git a/testutil/mock/privval.go b/testutil/mock/privval.go index 66a9859af8cf..f49a96622ce9 100644 --- a/testutil/mock/privval.go +++ b/testutil/mock/privval.go @@ -48,3 +48,7 @@ func (pv PV) SignProposal(chainID string, proposal *cmtproto.Proposal) error { proposal.Signature = sig return nil } + +func (pv PV) SignBytes(bytes []byte) ([]byte, error) { + return pv.PrivKey.Sign(bytes) +} diff --git a/testutil/mock/types_handler.go b/testutil/mock/types_handler.go index c3a59d0362b2..06f603719297 100644 --- a/testutil/mock/types_handler.go +++ b/testutil/mock/types_handler.go @@ -8,11 +8,11 @@ package mock import ( - reflect "reflect" + "reflect" - gomock "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" - types "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types" ) // MockAnteDecorator is a mock of AnteDecorator interface. diff --git a/testutil/mock/types_invariant.go b/testutil/mock/types_invariant.go index 7846a9dd9de3..04d8cfa6db61 100644 --- a/testutil/mock/types_invariant.go +++ b/testutil/mock/types_invariant.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: types/invariant.go +// +// Generated by this command: +// +// mockgen -source=types/invariant.go -package mock -destination testutil/mock/types_invariant.go +// // Package mock is a generated GoMock package. package mock @@ -8,13 +13,14 @@ import ( reflect "reflect" types "github.com/cosmos/cosmos-sdk/types" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockInvariantRegistry is a mock of InvariantRegistry interface. type MockInvariantRegistry struct { ctrl *gomock.Controller recorder *MockInvariantRegistryMockRecorder + isgomock struct{} } // MockInvariantRegistryMockRecorder is the mock recorder for MockInvariantRegistry. @@ -41,7 +47,7 @@ func (m *MockInvariantRegistry) RegisterRoute(moduleName, route string, invar ty } // RegisterRoute indicates an expected call of RegisterRoute. -func (mr *MockInvariantRegistryMockRecorder) RegisterRoute(moduleName, route, invar interface{}) *gomock.Call { +func (mr *MockInvariantRegistryMockRecorder) RegisterRoute(moduleName, route, invar any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterRoute", reflect.TypeOf((*MockInvariantRegistry)(nil).RegisterRoute), moduleName, route, invar) } diff --git a/testutil/mock/types_mock_appmodule.go b/testutil/mock/types_mock_appmodule.go index dd31281640ad..8cab68282a9c 100644 --- a/testutil/mock/types_mock_appmodule.go +++ b/testutil/mock/types_mock_appmodule.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: types/module/mock_appmodule_test.go +// +// Generated by this command: +// +// mockgen -source=types/module/mock_appmodule_test.go -package mock -destination testutil/mock/types_mock_appmodule.go +// // Package mock is a generated GoMock package. package mock @@ -16,15 +21,15 @@ import ( types0 "github.com/cosmos/cosmos-sdk/codec/types" types1 "github.com/cosmos/cosmos-sdk/types" module "github.com/cosmos/cosmos-sdk/types/module" - gomock "github.com/golang/mock/gomock" runtime "github.com/grpc-ecosystem/grpc-gateway/runtime" - cobra "github.com/spf13/cobra" + gomock "go.uber.org/mock/gomock" ) // MockAppModuleWithAllExtensions is a mock of AppModuleWithAllExtensions interface. type MockAppModuleWithAllExtensions struct { ctrl *gomock.Controller recorder *MockAppModuleWithAllExtensionsMockRecorder + isgomock struct{} } // MockAppModuleWithAllExtensionsMockRecorder is the mock recorder for MockAppModuleWithAllExtensions. @@ -67,7 +72,7 @@ func (m *MockAppModuleWithAllExtensions) DefaultGenesis(arg0 codec.JSONCodec) js } // DefaultGenesis indicates an expected call of DefaultGenesis. -func (mr *MockAppModuleWithAllExtensionsMockRecorder) DefaultGenesis(arg0 interface{}) *gomock.Call { +func (mr *MockAppModuleWithAllExtensionsMockRecorder) DefaultGenesis(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DefaultGenesis", reflect.TypeOf((*MockAppModuleWithAllExtensions)(nil).DefaultGenesis), arg0) } @@ -82,7 +87,7 @@ func (m *MockAppModuleWithAllExtensions) EndBlock(arg0 context.Context) ([]types } // EndBlock indicates an expected call of EndBlock. -func (mr *MockAppModuleWithAllExtensionsMockRecorder) EndBlock(arg0 interface{}) *gomock.Call { +func (mr *MockAppModuleWithAllExtensionsMockRecorder) EndBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EndBlock", reflect.TypeOf((*MockAppModuleWithAllExtensions)(nil).EndBlock), arg0) } @@ -96,51 +101,45 @@ func (m *MockAppModuleWithAllExtensions) ExportGenesis(arg0 types1.Context, arg1 } // ExportGenesis indicates an expected call of ExportGenesis. -func (mr *MockAppModuleWithAllExtensionsMockRecorder) ExportGenesis(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockAppModuleWithAllExtensionsMockRecorder) ExportGenesis(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExportGenesis", reflect.TypeOf((*MockAppModuleWithAllExtensions)(nil).ExportGenesis), arg0, arg1) } -// GetQueryCmd mocks base method. -func (m *MockAppModuleWithAllExtensions) GetQueryCmd() *cobra.Command { +// InitGenesis mocks base method. +func (m *MockAppModuleWithAllExtensions) InitGenesis(arg0 types1.Context, arg1 codec.JSONCodec, arg2 json.RawMessage) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetQueryCmd") - ret0, _ := ret[0].(*cobra.Command) - return ret0 + m.ctrl.Call(m, "InitGenesis", arg0, arg1, arg2) } -// GetQueryCmd indicates an expected call of GetQueryCmd. -func (mr *MockAppModuleWithAllExtensionsMockRecorder) GetQueryCmd() *gomock.Call { +// InitGenesis indicates an expected call of InitGenesis. +func (mr *MockAppModuleWithAllExtensionsMockRecorder) InitGenesis(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQueryCmd", reflect.TypeOf((*MockAppModuleWithAllExtensions)(nil).GetQueryCmd)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitGenesis", reflect.TypeOf((*MockAppModuleWithAllExtensions)(nil).InitGenesis), arg0, arg1, arg2) } -// GetTxCmd mocks base method. -func (m *MockAppModuleWithAllExtensions) GetTxCmd() *cobra.Command { +// IsAppModule mocks base method. +func (m *MockAppModuleWithAllExtensions) IsAppModule() { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetTxCmd") - ret0, _ := ret[0].(*cobra.Command) - return ret0 + m.ctrl.Call(m, "IsAppModule") } -// GetTxCmd indicates an expected call of GetTxCmd. -func (mr *MockAppModuleWithAllExtensionsMockRecorder) GetTxCmd() *gomock.Call { +// IsAppModule indicates an expected call of IsAppModule. +func (mr *MockAppModuleWithAllExtensionsMockRecorder) IsAppModule() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTxCmd", reflect.TypeOf((*MockAppModuleWithAllExtensions)(nil).GetTxCmd)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsAppModule", reflect.TypeOf((*MockAppModuleWithAllExtensions)(nil).IsAppModule)) } -// InitGenesis mocks base method. -func (m *MockAppModuleWithAllExtensions) InitGenesis(arg0 types1.Context, arg1 codec.JSONCodec, arg2 json.RawMessage) []types.ValidatorUpdate { +// IsOnePerModuleType mocks base method. +func (m *MockAppModuleWithAllExtensions) IsOnePerModuleType() { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "InitGenesis", arg0, arg1, arg2) - ret0, _ := ret[0].([]types.ValidatorUpdate) - return ret0 + m.ctrl.Call(m, "IsOnePerModuleType") } -// InitGenesis indicates an expected call of InitGenesis. -func (mr *MockAppModuleWithAllExtensionsMockRecorder) InitGenesis(arg0, arg1, arg2 interface{}) *gomock.Call { +// IsOnePerModuleType indicates an expected call of IsOnePerModuleType. +func (mr *MockAppModuleWithAllExtensionsMockRecorder) IsOnePerModuleType() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitGenesis", reflect.TypeOf((*MockAppModuleWithAllExtensions)(nil).InitGenesis), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsOnePerModuleType", reflect.TypeOf((*MockAppModuleWithAllExtensions)(nil).IsOnePerModuleType)) } // Name mocks base method. @@ -164,7 +163,7 @@ func (m *MockAppModuleWithAllExtensions) RegisterGRPCGatewayRoutes(arg0 client.C } // RegisterGRPCGatewayRoutes indicates an expected call of RegisterGRPCGatewayRoutes. -func (mr *MockAppModuleWithAllExtensionsMockRecorder) RegisterGRPCGatewayRoutes(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockAppModuleWithAllExtensionsMockRecorder) RegisterGRPCGatewayRoutes(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterGRPCGatewayRoutes", reflect.TypeOf((*MockAppModuleWithAllExtensions)(nil).RegisterGRPCGatewayRoutes), arg0, arg1) } @@ -176,7 +175,7 @@ func (m *MockAppModuleWithAllExtensions) RegisterInterfaces(arg0 types0.Interfac } // RegisterInterfaces indicates an expected call of RegisterInterfaces. -func (mr *MockAppModuleWithAllExtensionsMockRecorder) RegisterInterfaces(arg0 interface{}) *gomock.Call { +func (mr *MockAppModuleWithAllExtensionsMockRecorder) RegisterInterfaces(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterInterfaces", reflect.TypeOf((*MockAppModuleWithAllExtensions)(nil).RegisterInterfaces), arg0) } @@ -188,7 +187,7 @@ func (m *MockAppModuleWithAllExtensions) RegisterInvariants(arg0 types1.Invarian } // RegisterInvariants indicates an expected call of RegisterInvariants. -func (mr *MockAppModuleWithAllExtensionsMockRecorder) RegisterInvariants(arg0 interface{}) *gomock.Call { +func (mr *MockAppModuleWithAllExtensionsMockRecorder) RegisterInvariants(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterInvariants", reflect.TypeOf((*MockAppModuleWithAllExtensions)(nil).RegisterInvariants), arg0) } @@ -200,7 +199,7 @@ func (m *MockAppModuleWithAllExtensions) RegisterLegacyAminoCodec(arg0 *codec.Le } // RegisterLegacyAminoCodec indicates an expected call of RegisterLegacyAminoCodec. -func (mr *MockAppModuleWithAllExtensionsMockRecorder) RegisterLegacyAminoCodec(arg0 interface{}) *gomock.Call { +func (mr *MockAppModuleWithAllExtensionsMockRecorder) RegisterLegacyAminoCodec(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterLegacyAminoCodec", reflect.TypeOf((*MockAppModuleWithAllExtensions)(nil).RegisterLegacyAminoCodec), arg0) } @@ -212,7 +211,7 @@ func (m *MockAppModuleWithAllExtensions) RegisterServices(arg0 module.Configurat } // RegisterServices indicates an expected call of RegisterServices. -func (mr *MockAppModuleWithAllExtensionsMockRecorder) RegisterServices(arg0 interface{}) *gomock.Call { +func (mr *MockAppModuleWithAllExtensionsMockRecorder) RegisterServices(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterServices", reflect.TypeOf((*MockAppModuleWithAllExtensions)(nil).RegisterServices), arg0) } @@ -226,15 +225,223 @@ func (m *MockAppModuleWithAllExtensions) ValidateGenesis(arg0 codec.JSONCodec, a } // ValidateGenesis indicates an expected call of ValidateGenesis. -func (mr *MockAppModuleWithAllExtensionsMockRecorder) ValidateGenesis(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockAppModuleWithAllExtensionsMockRecorder) ValidateGenesis(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateGenesis", reflect.TypeOf((*MockAppModuleWithAllExtensions)(nil).ValidateGenesis), arg0, arg1, arg2) } +// MockAppModuleWithAllExtensionsABCI is a mock of AppModuleWithAllExtensionsABCI interface. +type MockAppModuleWithAllExtensionsABCI struct { + ctrl *gomock.Controller + recorder *MockAppModuleWithAllExtensionsABCIMockRecorder + isgomock struct{} +} + +// MockAppModuleWithAllExtensionsABCIMockRecorder is the mock recorder for MockAppModuleWithAllExtensionsABCI. +type MockAppModuleWithAllExtensionsABCIMockRecorder struct { + mock *MockAppModuleWithAllExtensionsABCI +} + +// NewMockAppModuleWithAllExtensionsABCI creates a new mock instance. +func NewMockAppModuleWithAllExtensionsABCI(ctrl *gomock.Controller) *MockAppModuleWithAllExtensionsABCI { + mock := &MockAppModuleWithAllExtensionsABCI{ctrl: ctrl} + mock.recorder = &MockAppModuleWithAllExtensionsABCIMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockAppModuleWithAllExtensionsABCI) EXPECT() *MockAppModuleWithAllExtensionsABCIMockRecorder { + return m.recorder +} + +// ConsensusVersion mocks base method. +func (m *MockAppModuleWithAllExtensionsABCI) ConsensusVersion() uint64 { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ConsensusVersion") + ret0, _ := ret[0].(uint64) + return ret0 +} + +// ConsensusVersion indicates an expected call of ConsensusVersion. +func (mr *MockAppModuleWithAllExtensionsABCIMockRecorder) ConsensusVersion() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConsensusVersion", reflect.TypeOf((*MockAppModuleWithAllExtensionsABCI)(nil).ConsensusVersion)) +} + +// DefaultGenesis mocks base method. +func (m *MockAppModuleWithAllExtensionsABCI) DefaultGenesis(arg0 codec.JSONCodec) json.RawMessage { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DefaultGenesis", arg0) + ret0, _ := ret[0].(json.RawMessage) + return ret0 +} + +// DefaultGenesis indicates an expected call of DefaultGenesis. +func (mr *MockAppModuleWithAllExtensionsABCIMockRecorder) DefaultGenesis(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DefaultGenesis", reflect.TypeOf((*MockAppModuleWithAllExtensionsABCI)(nil).DefaultGenesis), arg0) +} + +// EndBlock mocks base method. +func (m *MockAppModuleWithAllExtensionsABCI) EndBlock(arg0 context.Context) ([]types.ValidatorUpdate, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "EndBlock", arg0) + ret0, _ := ret[0].([]types.ValidatorUpdate) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// EndBlock indicates an expected call of EndBlock. +func (mr *MockAppModuleWithAllExtensionsABCIMockRecorder) EndBlock(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EndBlock", reflect.TypeOf((*MockAppModuleWithAllExtensionsABCI)(nil).EndBlock), arg0) +} + +// ExportGenesis mocks base method. +func (m *MockAppModuleWithAllExtensionsABCI) ExportGenesis(arg0 types1.Context, arg1 codec.JSONCodec) json.RawMessage { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ExportGenesis", arg0, arg1) + ret0, _ := ret[0].(json.RawMessage) + return ret0 +} + +// ExportGenesis indicates an expected call of ExportGenesis. +func (mr *MockAppModuleWithAllExtensionsABCIMockRecorder) ExportGenesis(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExportGenesis", reflect.TypeOf((*MockAppModuleWithAllExtensionsABCI)(nil).ExportGenesis), arg0, arg1) +} + +// InitGenesis mocks base method. +func (m *MockAppModuleWithAllExtensionsABCI) InitGenesis(arg0 types1.Context, arg1 codec.JSONCodec, arg2 json.RawMessage) []types.ValidatorUpdate { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "InitGenesis", arg0, arg1, arg2) + ret0, _ := ret[0].([]types.ValidatorUpdate) + return ret0 +} + +// InitGenesis indicates an expected call of InitGenesis. +func (mr *MockAppModuleWithAllExtensionsABCIMockRecorder) InitGenesis(arg0, arg1, arg2 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitGenesis", reflect.TypeOf((*MockAppModuleWithAllExtensionsABCI)(nil).InitGenesis), arg0, arg1, arg2) +} + +// IsAppModule mocks base method. +func (m *MockAppModuleWithAllExtensionsABCI) IsAppModule() { + m.ctrl.T.Helper() + m.ctrl.Call(m, "IsAppModule") +} + +// IsAppModule indicates an expected call of IsAppModule. +func (mr *MockAppModuleWithAllExtensionsABCIMockRecorder) IsAppModule() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsAppModule", reflect.TypeOf((*MockAppModuleWithAllExtensionsABCI)(nil).IsAppModule)) +} + +// IsOnePerModuleType mocks base method. +func (m *MockAppModuleWithAllExtensionsABCI) IsOnePerModuleType() { + m.ctrl.T.Helper() + m.ctrl.Call(m, "IsOnePerModuleType") +} + +// IsOnePerModuleType indicates an expected call of IsOnePerModuleType. +func (mr *MockAppModuleWithAllExtensionsABCIMockRecorder) IsOnePerModuleType() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsOnePerModuleType", reflect.TypeOf((*MockAppModuleWithAllExtensionsABCI)(nil).IsOnePerModuleType)) +} + +// Name mocks base method. +func (m *MockAppModuleWithAllExtensionsABCI) Name() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Name") + ret0, _ := ret[0].(string) + return ret0 +} + +// Name indicates an expected call of Name. +func (mr *MockAppModuleWithAllExtensionsABCIMockRecorder) Name() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Name", reflect.TypeOf((*MockAppModuleWithAllExtensionsABCI)(nil).Name)) +} + +// RegisterGRPCGatewayRoutes mocks base method. +func (m *MockAppModuleWithAllExtensionsABCI) RegisterGRPCGatewayRoutes(arg0 client.Context, arg1 *runtime.ServeMux) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "RegisterGRPCGatewayRoutes", arg0, arg1) +} + +// RegisterGRPCGatewayRoutes indicates an expected call of RegisterGRPCGatewayRoutes. +func (mr *MockAppModuleWithAllExtensionsABCIMockRecorder) RegisterGRPCGatewayRoutes(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterGRPCGatewayRoutes", reflect.TypeOf((*MockAppModuleWithAllExtensionsABCI)(nil).RegisterGRPCGatewayRoutes), arg0, arg1) +} + +// RegisterInterfaces mocks base method. +func (m *MockAppModuleWithAllExtensionsABCI) RegisterInterfaces(arg0 types0.InterfaceRegistry) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "RegisterInterfaces", arg0) +} + +// RegisterInterfaces indicates an expected call of RegisterInterfaces. +func (mr *MockAppModuleWithAllExtensionsABCIMockRecorder) RegisterInterfaces(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterInterfaces", reflect.TypeOf((*MockAppModuleWithAllExtensionsABCI)(nil).RegisterInterfaces), arg0) +} + +// RegisterInvariants mocks base method. +func (m *MockAppModuleWithAllExtensionsABCI) RegisterInvariants(arg0 types1.InvariantRegistry) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "RegisterInvariants", arg0) +} + +// RegisterInvariants indicates an expected call of RegisterInvariants. +func (mr *MockAppModuleWithAllExtensionsABCIMockRecorder) RegisterInvariants(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterInvariants", reflect.TypeOf((*MockAppModuleWithAllExtensionsABCI)(nil).RegisterInvariants), arg0) +} + +// RegisterLegacyAminoCodec mocks base method. +func (m *MockAppModuleWithAllExtensionsABCI) RegisterLegacyAminoCodec(arg0 *codec.LegacyAmino) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "RegisterLegacyAminoCodec", arg0) +} + +// RegisterLegacyAminoCodec indicates an expected call of RegisterLegacyAminoCodec. +func (mr *MockAppModuleWithAllExtensionsABCIMockRecorder) RegisterLegacyAminoCodec(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterLegacyAminoCodec", reflect.TypeOf((*MockAppModuleWithAllExtensionsABCI)(nil).RegisterLegacyAminoCodec), arg0) +} + +// RegisterServices mocks base method. +func (m *MockAppModuleWithAllExtensionsABCI) RegisterServices(arg0 module.Configurator) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "RegisterServices", arg0) +} + +// RegisterServices indicates an expected call of RegisterServices. +func (mr *MockAppModuleWithAllExtensionsABCIMockRecorder) RegisterServices(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterServices", reflect.TypeOf((*MockAppModuleWithAllExtensionsABCI)(nil).RegisterServices), arg0) +} + +// ValidateGenesis mocks base method. +func (m *MockAppModuleWithAllExtensionsABCI) ValidateGenesis(arg0 codec.JSONCodec, arg1 client.TxEncodingConfig, arg2 json.RawMessage) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ValidateGenesis", arg0, arg1, arg2) + ret0, _ := ret[0].(error) + return ret0 +} + +// ValidateGenesis indicates an expected call of ValidateGenesis. +func (mr *MockAppModuleWithAllExtensionsABCIMockRecorder) ValidateGenesis(arg0, arg1, arg2 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateGenesis", reflect.TypeOf((*MockAppModuleWithAllExtensionsABCI)(nil).ValidateGenesis), arg0, arg1, arg2) +} + // MockCoreAppModule is a mock of CoreAppModule interface. type MockCoreAppModule struct { ctrl *gomock.Controller recorder *MockCoreAppModuleMockRecorder + isgomock struct{} } // MockCoreAppModuleMockRecorder is the mock recorder for MockCoreAppModule. @@ -263,7 +470,7 @@ func (m *MockCoreAppModule) BeginBlock(arg0 context.Context) error { } // BeginBlock indicates an expected call of BeginBlock. -func (mr *MockCoreAppModuleMockRecorder) BeginBlock(arg0 interface{}) *gomock.Call { +func (mr *MockCoreAppModuleMockRecorder) BeginBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeginBlock", reflect.TypeOf((*MockCoreAppModule)(nil).BeginBlock), arg0) } @@ -277,7 +484,7 @@ func (m *MockCoreAppModule) DefaultGenesis(arg0 appmodule.GenesisTarget) error { } // DefaultGenesis indicates an expected call of DefaultGenesis. -func (mr *MockCoreAppModuleMockRecorder) DefaultGenesis(arg0 interface{}) *gomock.Call { +func (mr *MockCoreAppModuleMockRecorder) DefaultGenesis(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DefaultGenesis", reflect.TypeOf((*MockCoreAppModule)(nil).DefaultGenesis), arg0) } @@ -291,7 +498,7 @@ func (m *MockCoreAppModule) EndBlock(arg0 context.Context) error { } // EndBlock indicates an expected call of EndBlock. -func (mr *MockCoreAppModuleMockRecorder) EndBlock(arg0 interface{}) *gomock.Call { +func (mr *MockCoreAppModuleMockRecorder) EndBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EndBlock", reflect.TypeOf((*MockCoreAppModule)(nil).EndBlock), arg0) } @@ -305,7 +512,7 @@ func (m *MockCoreAppModule) ExportGenesis(arg0 context.Context, arg1 appmodule.G } // ExportGenesis indicates an expected call of ExportGenesis. -func (mr *MockCoreAppModuleMockRecorder) ExportGenesis(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockCoreAppModuleMockRecorder) ExportGenesis(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExportGenesis", reflect.TypeOf((*MockCoreAppModule)(nil).ExportGenesis), arg0, arg1) } @@ -319,7 +526,7 @@ func (m *MockCoreAppModule) InitGenesis(arg0 context.Context, arg1 appmodule.Gen } // InitGenesis indicates an expected call of InitGenesis. -func (mr *MockCoreAppModuleMockRecorder) InitGenesis(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockCoreAppModuleMockRecorder) InitGenesis(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitGenesis", reflect.TypeOf((*MockCoreAppModule)(nil).InitGenesis), arg0, arg1) } @@ -357,7 +564,7 @@ func (m *MockCoreAppModule) Precommit(arg0 context.Context) error { } // Precommit indicates an expected call of Precommit. -func (mr *MockCoreAppModuleMockRecorder) Precommit(arg0 interface{}) *gomock.Call { +func (mr *MockCoreAppModuleMockRecorder) Precommit(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Precommit", reflect.TypeOf((*MockCoreAppModule)(nil).Precommit), arg0) } @@ -371,7 +578,7 @@ func (m *MockCoreAppModule) PrepareCheckState(arg0 context.Context) error { } // PrepareCheckState indicates an expected call of PrepareCheckState. -func (mr *MockCoreAppModuleMockRecorder) PrepareCheckState(arg0 interface{}) *gomock.Call { +func (mr *MockCoreAppModuleMockRecorder) PrepareCheckState(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PrepareCheckState", reflect.TypeOf((*MockCoreAppModule)(nil).PrepareCheckState), arg0) } @@ -385,7 +592,182 @@ func (m *MockCoreAppModule) ValidateGenesis(arg0 appmodule.GenesisSource) error } // ValidateGenesis indicates an expected call of ValidateGenesis. -func (mr *MockCoreAppModuleMockRecorder) ValidateGenesis(arg0 interface{}) *gomock.Call { +func (mr *MockCoreAppModuleMockRecorder) ValidateGenesis(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateGenesis", reflect.TypeOf((*MockCoreAppModule)(nil).ValidateGenesis), arg0) } + +// MockCoreAppModuleWithPreBlock is a mock of CoreAppModuleWithPreBlock interface. +type MockCoreAppModuleWithPreBlock struct { + ctrl *gomock.Controller + recorder *MockCoreAppModuleWithPreBlockMockRecorder + isgomock struct{} +} + +// MockCoreAppModuleWithPreBlockMockRecorder is the mock recorder for MockCoreAppModuleWithPreBlock. +type MockCoreAppModuleWithPreBlockMockRecorder struct { + mock *MockCoreAppModuleWithPreBlock +} + +// NewMockCoreAppModuleWithPreBlock creates a new mock instance. +func NewMockCoreAppModuleWithPreBlock(ctrl *gomock.Controller) *MockCoreAppModuleWithPreBlock { + mock := &MockCoreAppModuleWithPreBlock{ctrl: ctrl} + mock.recorder = &MockCoreAppModuleWithPreBlockMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockCoreAppModuleWithPreBlock) EXPECT() *MockCoreAppModuleWithPreBlockMockRecorder { + return m.recorder +} + +// BeginBlock mocks base method. +func (m *MockCoreAppModuleWithPreBlock) BeginBlock(arg0 context.Context) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "BeginBlock", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// BeginBlock indicates an expected call of BeginBlock. +func (mr *MockCoreAppModuleWithPreBlockMockRecorder) BeginBlock(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeginBlock", reflect.TypeOf((*MockCoreAppModuleWithPreBlock)(nil).BeginBlock), arg0) +} + +// DefaultGenesis mocks base method. +func (m *MockCoreAppModuleWithPreBlock) DefaultGenesis(arg0 appmodule.GenesisTarget) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DefaultGenesis", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// DefaultGenesis indicates an expected call of DefaultGenesis. +func (mr *MockCoreAppModuleWithPreBlockMockRecorder) DefaultGenesis(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DefaultGenesis", reflect.TypeOf((*MockCoreAppModuleWithPreBlock)(nil).DefaultGenesis), arg0) +} + +// EndBlock mocks base method. +func (m *MockCoreAppModuleWithPreBlock) EndBlock(arg0 context.Context) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "EndBlock", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// EndBlock indicates an expected call of EndBlock. +func (mr *MockCoreAppModuleWithPreBlockMockRecorder) EndBlock(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EndBlock", reflect.TypeOf((*MockCoreAppModuleWithPreBlock)(nil).EndBlock), arg0) +} + +// ExportGenesis mocks base method. +func (m *MockCoreAppModuleWithPreBlock) ExportGenesis(arg0 context.Context, arg1 appmodule.GenesisTarget) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ExportGenesis", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// ExportGenesis indicates an expected call of ExportGenesis. +func (mr *MockCoreAppModuleWithPreBlockMockRecorder) ExportGenesis(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExportGenesis", reflect.TypeOf((*MockCoreAppModuleWithPreBlock)(nil).ExportGenesis), arg0, arg1) +} + +// InitGenesis mocks base method. +func (m *MockCoreAppModuleWithPreBlock) InitGenesis(arg0 context.Context, arg1 appmodule.GenesisSource) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "InitGenesis", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// InitGenesis indicates an expected call of InitGenesis. +func (mr *MockCoreAppModuleWithPreBlockMockRecorder) InitGenesis(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitGenesis", reflect.TypeOf((*MockCoreAppModuleWithPreBlock)(nil).InitGenesis), arg0, arg1) +} + +// IsAppModule mocks base method. +func (m *MockCoreAppModuleWithPreBlock) IsAppModule() { + m.ctrl.T.Helper() + m.ctrl.Call(m, "IsAppModule") +} + +// IsAppModule indicates an expected call of IsAppModule. +func (mr *MockCoreAppModuleWithPreBlockMockRecorder) IsAppModule() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsAppModule", reflect.TypeOf((*MockCoreAppModuleWithPreBlock)(nil).IsAppModule)) +} + +// IsOnePerModuleType mocks base method. +func (m *MockCoreAppModuleWithPreBlock) IsOnePerModuleType() { + m.ctrl.T.Helper() + m.ctrl.Call(m, "IsOnePerModuleType") +} + +// IsOnePerModuleType indicates an expected call of IsOnePerModuleType. +func (mr *MockCoreAppModuleWithPreBlockMockRecorder) IsOnePerModuleType() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsOnePerModuleType", reflect.TypeOf((*MockCoreAppModuleWithPreBlock)(nil).IsOnePerModuleType)) +} + +// PreBlock mocks base method. +func (m *MockCoreAppModuleWithPreBlock) PreBlock(arg0 context.Context) (appmodule.ResponsePreBlock, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "PreBlock", arg0) + ret0, _ := ret[0].(appmodule.ResponsePreBlock) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// PreBlock indicates an expected call of PreBlock. +func (mr *MockCoreAppModuleWithPreBlockMockRecorder) PreBlock(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PreBlock", reflect.TypeOf((*MockCoreAppModuleWithPreBlock)(nil).PreBlock), arg0) +} + +// Precommit mocks base method. +func (m *MockCoreAppModuleWithPreBlock) Precommit(arg0 context.Context) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Precommit", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// Precommit indicates an expected call of Precommit. +func (mr *MockCoreAppModuleWithPreBlockMockRecorder) Precommit(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Precommit", reflect.TypeOf((*MockCoreAppModuleWithPreBlock)(nil).Precommit), arg0) +} + +// PrepareCheckState mocks base method. +func (m *MockCoreAppModuleWithPreBlock) PrepareCheckState(arg0 context.Context) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "PrepareCheckState", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// PrepareCheckState indicates an expected call of PrepareCheckState. +func (mr *MockCoreAppModuleWithPreBlockMockRecorder) PrepareCheckState(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PrepareCheckState", reflect.TypeOf((*MockCoreAppModuleWithPreBlock)(nil).PrepareCheckState), arg0) +} + +// ValidateGenesis mocks base method. +func (m *MockCoreAppModuleWithPreBlock) ValidateGenesis(arg0 appmodule.GenesisSource) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ValidateGenesis", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// ValidateGenesis indicates an expected call of ValidateGenesis. +func (mr *MockCoreAppModuleWithPreBlockMockRecorder) ValidateGenesis(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateGenesis", reflect.TypeOf((*MockCoreAppModuleWithPreBlock)(nil).ValidateGenesis), arg0) +} diff --git a/testutil/mock/types_module_module.go b/testutil/mock/types_module_module.go index 550628701c8e..a85e9111047a 100644 --- a/testutil/mock/types_module_module.go +++ b/testutil/mock/types_module_module.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: types/module/module.go +// +// Generated by this command: +// +// mockgen -source=types/module/module.go -package mock -destination testutil/mock/types_module_module.go +// // Package mock is a generated GoMock package. package mock @@ -15,15 +20,15 @@ import ( types0 "github.com/cosmos/cosmos-sdk/codec/types" types1 "github.com/cosmos/cosmos-sdk/types" module "github.com/cosmos/cosmos-sdk/types/module" - gomock "github.com/golang/mock/gomock" runtime "github.com/grpc-ecosystem/grpc-gateway/runtime" - cobra "github.com/spf13/cobra" + gomock "go.uber.org/mock/gomock" ) // MockAppModuleBasic is a mock of AppModuleBasic interface. type MockAppModuleBasic struct { ctrl *gomock.Controller recorder *MockAppModuleBasicMockRecorder + isgomock struct{} } // MockAppModuleBasicMockRecorder is the mock recorder for MockAppModuleBasic. @@ -43,34 +48,6 @@ func (m *MockAppModuleBasic) EXPECT() *MockAppModuleBasicMockRecorder { return m.recorder } -// GetQueryCmd mocks base method. -func (m *MockAppModuleBasic) GetQueryCmd() *cobra.Command { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetQueryCmd") - ret0, _ := ret[0].(*cobra.Command) - return ret0 -} - -// GetQueryCmd indicates an expected call of GetQueryCmd. -func (mr *MockAppModuleBasicMockRecorder) GetQueryCmd() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQueryCmd", reflect.TypeOf((*MockAppModuleBasic)(nil).GetQueryCmd)) -} - -// GetTxCmd mocks base method. -func (m *MockAppModuleBasic) GetTxCmd() *cobra.Command { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetTxCmd") - ret0, _ := ret[0].(*cobra.Command) - return ret0 -} - -// GetTxCmd indicates an expected call of GetTxCmd. -func (mr *MockAppModuleBasicMockRecorder) GetTxCmd() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTxCmd", reflect.TypeOf((*MockAppModuleBasic)(nil).GetTxCmd)) -} - // Name mocks base method. func (m *MockAppModuleBasic) Name() string { m.ctrl.T.Helper() @@ -92,7 +69,7 @@ func (m *MockAppModuleBasic) RegisterGRPCGatewayRoutes(arg0 client.Context, arg1 } // RegisterGRPCGatewayRoutes indicates an expected call of RegisterGRPCGatewayRoutes. -func (mr *MockAppModuleBasicMockRecorder) RegisterGRPCGatewayRoutes(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockAppModuleBasicMockRecorder) RegisterGRPCGatewayRoutes(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterGRPCGatewayRoutes", reflect.TypeOf((*MockAppModuleBasic)(nil).RegisterGRPCGatewayRoutes), arg0, arg1) } @@ -104,7 +81,7 @@ func (m *MockAppModuleBasic) RegisterInterfaces(arg0 types0.InterfaceRegistry) { } // RegisterInterfaces indicates an expected call of RegisterInterfaces. -func (mr *MockAppModuleBasicMockRecorder) RegisterInterfaces(arg0 interface{}) *gomock.Call { +func (mr *MockAppModuleBasicMockRecorder) RegisterInterfaces(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterInterfaces", reflect.TypeOf((*MockAppModuleBasic)(nil).RegisterInterfaces), arg0) } @@ -116,7 +93,7 @@ func (m *MockAppModuleBasic) RegisterLegacyAminoCodec(arg0 *codec.LegacyAmino) { } // RegisterLegacyAminoCodec indicates an expected call of RegisterLegacyAminoCodec. -func (mr *MockAppModuleBasicMockRecorder) RegisterLegacyAminoCodec(arg0 interface{}) *gomock.Call { +func (mr *MockAppModuleBasicMockRecorder) RegisterLegacyAminoCodec(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterLegacyAminoCodec", reflect.TypeOf((*MockAppModuleBasic)(nil).RegisterLegacyAminoCodec), arg0) } @@ -125,6 +102,7 @@ func (mr *MockAppModuleBasicMockRecorder) RegisterLegacyAminoCodec(arg0 interfac type MockHasName struct { ctrl *gomock.Controller recorder *MockHasNameMockRecorder + isgomock struct{} } // MockHasNameMockRecorder is the mock recorder for MockHasName. @@ -162,6 +140,7 @@ func (mr *MockHasNameMockRecorder) Name() *gomock.Call { type MockHasGenesisBasics struct { ctrl *gomock.Controller recorder *MockHasGenesisBasicsMockRecorder + isgomock struct{} } // MockHasGenesisBasicsMockRecorder is the mock recorder for MockHasGenesisBasics. @@ -190,7 +169,7 @@ func (m *MockHasGenesisBasics) DefaultGenesis(arg0 codec.JSONCodec) json.RawMess } // DefaultGenesis indicates an expected call of DefaultGenesis. -func (mr *MockHasGenesisBasicsMockRecorder) DefaultGenesis(arg0 interface{}) *gomock.Call { +func (mr *MockHasGenesisBasicsMockRecorder) DefaultGenesis(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DefaultGenesis", reflect.TypeOf((*MockHasGenesisBasics)(nil).DefaultGenesis), arg0) } @@ -204,36 +183,37 @@ func (m *MockHasGenesisBasics) ValidateGenesis(arg0 codec.JSONCodec, arg1 client } // ValidateGenesis indicates an expected call of ValidateGenesis. -func (mr *MockHasGenesisBasicsMockRecorder) ValidateGenesis(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockHasGenesisBasicsMockRecorder) ValidateGenesis(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateGenesis", reflect.TypeOf((*MockHasGenesisBasics)(nil).ValidateGenesis), arg0, arg1, arg2) } -// MockAppModuleGenesis is a mock of AppModuleGenesis interface. -type MockAppModuleGenesis struct { +// MockHasGenesis is a mock of HasGenesis interface. +type MockHasGenesis struct { ctrl *gomock.Controller - recorder *MockAppModuleGenesisMockRecorder + recorder *MockHasGenesisMockRecorder + isgomock struct{} } -// MockAppModuleGenesisMockRecorder is the mock recorder for MockAppModuleGenesis. -type MockAppModuleGenesisMockRecorder struct { - mock *MockAppModuleGenesis +// MockHasGenesisMockRecorder is the mock recorder for MockHasGenesis. +type MockHasGenesisMockRecorder struct { + mock *MockHasGenesis } -// NewMockAppModuleGenesis creates a new mock instance. -func NewMockAppModuleGenesis(ctrl *gomock.Controller) *MockAppModuleGenesis { - mock := &MockAppModuleGenesis{ctrl: ctrl} - mock.recorder = &MockAppModuleGenesisMockRecorder{mock} +// NewMockHasGenesis creates a new mock instance. +func NewMockHasGenesis(ctrl *gomock.Controller) *MockHasGenesis { + mock := &MockHasGenesis{ctrl: ctrl} + mock.recorder = &MockHasGenesisMockRecorder{mock} return mock } // EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockAppModuleGenesis) EXPECT() *MockAppModuleGenesisMockRecorder { +func (m *MockHasGenesis) EXPECT() *MockHasGenesisMockRecorder { return m.recorder } // DefaultGenesis mocks base method. -func (m *MockAppModuleGenesis) DefaultGenesis(arg0 codec.JSONCodec) json.RawMessage { +func (m *MockHasGenesis) DefaultGenesis(arg0 codec.JSONCodec) json.RawMessage { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DefaultGenesis", arg0) ret0, _ := ret[0].(json.RawMessage) @@ -241,13 +221,13 @@ func (m *MockAppModuleGenesis) DefaultGenesis(arg0 codec.JSONCodec) json.RawMess } // DefaultGenesis indicates an expected call of DefaultGenesis. -func (mr *MockAppModuleGenesisMockRecorder) DefaultGenesis(arg0 interface{}) *gomock.Call { +func (mr *MockHasGenesisMockRecorder) DefaultGenesis(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DefaultGenesis", reflect.TypeOf((*MockAppModuleGenesis)(nil).DefaultGenesis), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DefaultGenesis", reflect.TypeOf((*MockHasGenesis)(nil).DefaultGenesis), arg0) } // ExportGenesis mocks base method. -func (m *MockAppModuleGenesis) ExportGenesis(arg0 types1.Context, arg1 codec.JSONCodec) json.RawMessage { +func (m *MockHasGenesis) ExportGenesis(arg0 types1.Context, arg1 codec.JSONCodec) json.RawMessage { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ExportGenesis", arg0, arg1) ret0, _ := ret[0].(json.RawMessage) @@ -255,105 +235,25 @@ func (m *MockAppModuleGenesis) ExportGenesis(arg0 types1.Context, arg1 codec.JSO } // ExportGenesis indicates an expected call of ExportGenesis. -func (mr *MockAppModuleGenesisMockRecorder) ExportGenesis(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExportGenesis", reflect.TypeOf((*MockAppModuleGenesis)(nil).ExportGenesis), arg0, arg1) -} - -// GetQueryCmd mocks base method. -func (m *MockAppModuleGenesis) GetQueryCmd() *cobra.Command { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetQueryCmd") - ret0, _ := ret[0].(*cobra.Command) - return ret0 -} - -// GetQueryCmd indicates an expected call of GetQueryCmd. -func (mr *MockAppModuleGenesisMockRecorder) GetQueryCmd() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQueryCmd", reflect.TypeOf((*MockAppModuleGenesis)(nil).GetQueryCmd)) -} - -// GetTxCmd mocks base method. -func (m *MockAppModuleGenesis) GetTxCmd() *cobra.Command { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetTxCmd") - ret0, _ := ret[0].(*cobra.Command) - return ret0 -} - -// GetTxCmd indicates an expected call of GetTxCmd. -func (mr *MockAppModuleGenesisMockRecorder) GetTxCmd() *gomock.Call { +func (mr *MockHasGenesisMockRecorder) ExportGenesis(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTxCmd", reflect.TypeOf((*MockAppModuleGenesis)(nil).GetTxCmd)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExportGenesis", reflect.TypeOf((*MockHasGenesis)(nil).ExportGenesis), arg0, arg1) } // InitGenesis mocks base method. -func (m *MockAppModuleGenesis) InitGenesis(arg0 types1.Context, arg1 codec.JSONCodec, arg2 json.RawMessage) []types.ValidatorUpdate { +func (m *MockHasGenesis) InitGenesis(arg0 types1.Context, arg1 codec.JSONCodec, arg2 json.RawMessage) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "InitGenesis", arg0, arg1, arg2) - ret0, _ := ret[0].([]types.ValidatorUpdate) - return ret0 + m.ctrl.Call(m, "InitGenesis", arg0, arg1, arg2) } // InitGenesis indicates an expected call of InitGenesis. -func (mr *MockAppModuleGenesisMockRecorder) InitGenesis(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitGenesis", reflect.TypeOf((*MockAppModuleGenesis)(nil).InitGenesis), arg0, arg1, arg2) -} - -// Name mocks base method. -func (m *MockAppModuleGenesis) Name() string { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Name") - ret0, _ := ret[0].(string) - return ret0 -} - -// Name indicates an expected call of Name. -func (mr *MockAppModuleGenesisMockRecorder) Name() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Name", reflect.TypeOf((*MockAppModuleGenesis)(nil).Name)) -} - -// RegisterGRPCGatewayRoutes mocks base method. -func (m *MockAppModuleGenesis) RegisterGRPCGatewayRoutes(arg0 client.Context, arg1 *runtime.ServeMux) { - m.ctrl.T.Helper() - m.ctrl.Call(m, "RegisterGRPCGatewayRoutes", arg0, arg1) -} - -// RegisterGRPCGatewayRoutes indicates an expected call of RegisterGRPCGatewayRoutes. -func (mr *MockAppModuleGenesisMockRecorder) RegisterGRPCGatewayRoutes(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterGRPCGatewayRoutes", reflect.TypeOf((*MockAppModuleGenesis)(nil).RegisterGRPCGatewayRoutes), arg0, arg1) -} - -// RegisterInterfaces mocks base method. -func (m *MockAppModuleGenesis) RegisterInterfaces(arg0 types0.InterfaceRegistry) { - m.ctrl.T.Helper() - m.ctrl.Call(m, "RegisterInterfaces", arg0) -} - -// RegisterInterfaces indicates an expected call of RegisterInterfaces. -func (mr *MockAppModuleGenesisMockRecorder) RegisterInterfaces(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterInterfaces", reflect.TypeOf((*MockAppModuleGenesis)(nil).RegisterInterfaces), arg0) -} - -// RegisterLegacyAminoCodec mocks base method. -func (m *MockAppModuleGenesis) RegisterLegacyAminoCodec(arg0 *codec.LegacyAmino) { - m.ctrl.T.Helper() - m.ctrl.Call(m, "RegisterLegacyAminoCodec", arg0) -} - -// RegisterLegacyAminoCodec indicates an expected call of RegisterLegacyAminoCodec. -func (mr *MockAppModuleGenesisMockRecorder) RegisterLegacyAminoCodec(arg0 interface{}) *gomock.Call { +func (mr *MockHasGenesisMockRecorder) InitGenesis(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterLegacyAminoCodec", reflect.TypeOf((*MockAppModuleGenesis)(nil).RegisterLegacyAminoCodec), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitGenesis", reflect.TypeOf((*MockHasGenesis)(nil).InitGenesis), arg0, arg1, arg2) } // ValidateGenesis mocks base method. -func (m *MockAppModuleGenesis) ValidateGenesis(arg0 codec.JSONCodec, arg1 client.TxEncodingConfig, arg2 json.RawMessage) error { +func (m *MockHasGenesis) ValidateGenesis(arg0 codec.JSONCodec, arg1 client.TxEncodingConfig, arg2 json.RawMessage) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ValidateGenesis", arg0, arg1, arg2) ret0, _ := ret[0].(error) @@ -361,36 +261,37 @@ func (m *MockAppModuleGenesis) ValidateGenesis(arg0 codec.JSONCodec, arg1 client } // ValidateGenesis indicates an expected call of ValidateGenesis. -func (mr *MockAppModuleGenesisMockRecorder) ValidateGenesis(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockHasGenesisMockRecorder) ValidateGenesis(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateGenesis", reflect.TypeOf((*MockAppModuleGenesis)(nil).ValidateGenesis), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateGenesis", reflect.TypeOf((*MockHasGenesis)(nil).ValidateGenesis), arg0, arg1, arg2) } -// MockHasGenesis is a mock of HasGenesis interface. -type MockHasGenesis struct { +// MockHasABCIGenesis is a mock of HasABCIGenesis interface. +type MockHasABCIGenesis struct { ctrl *gomock.Controller - recorder *MockHasGenesisMockRecorder + recorder *MockHasABCIGenesisMockRecorder + isgomock struct{} } -// MockHasGenesisMockRecorder is the mock recorder for MockHasGenesis. -type MockHasGenesisMockRecorder struct { - mock *MockHasGenesis +// MockHasABCIGenesisMockRecorder is the mock recorder for MockHasABCIGenesis. +type MockHasABCIGenesisMockRecorder struct { + mock *MockHasABCIGenesis } -// NewMockHasGenesis creates a new mock instance. -func NewMockHasGenesis(ctrl *gomock.Controller) *MockHasGenesis { - mock := &MockHasGenesis{ctrl: ctrl} - mock.recorder = &MockHasGenesisMockRecorder{mock} +// NewMockHasABCIGenesis creates a new mock instance. +func NewMockHasABCIGenesis(ctrl *gomock.Controller) *MockHasABCIGenesis { + mock := &MockHasABCIGenesis{ctrl: ctrl} + mock.recorder = &MockHasABCIGenesisMockRecorder{mock} return mock } // EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockHasGenesis) EXPECT() *MockHasGenesisMockRecorder { +func (m *MockHasABCIGenesis) EXPECT() *MockHasABCIGenesisMockRecorder { return m.recorder } // DefaultGenesis mocks base method. -func (m *MockHasGenesis) DefaultGenesis(arg0 codec.JSONCodec) json.RawMessage { +func (m *MockHasABCIGenesis) DefaultGenesis(arg0 codec.JSONCodec) json.RawMessage { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DefaultGenesis", arg0) ret0, _ := ret[0].(json.RawMessage) @@ -398,13 +299,13 @@ func (m *MockHasGenesis) DefaultGenesis(arg0 codec.JSONCodec) json.RawMessage { } // DefaultGenesis indicates an expected call of DefaultGenesis. -func (mr *MockHasGenesisMockRecorder) DefaultGenesis(arg0 interface{}) *gomock.Call { +func (mr *MockHasABCIGenesisMockRecorder) DefaultGenesis(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DefaultGenesis", reflect.TypeOf((*MockHasGenesis)(nil).DefaultGenesis), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DefaultGenesis", reflect.TypeOf((*MockHasABCIGenesis)(nil).DefaultGenesis), arg0) } // ExportGenesis mocks base method. -func (m *MockHasGenesis) ExportGenesis(arg0 types1.Context, arg1 codec.JSONCodec) json.RawMessage { +func (m *MockHasABCIGenesis) ExportGenesis(arg0 types1.Context, arg1 codec.JSONCodec) json.RawMessage { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ExportGenesis", arg0, arg1) ret0, _ := ret[0].(json.RawMessage) @@ -412,13 +313,13 @@ func (m *MockHasGenesis) ExportGenesis(arg0 types1.Context, arg1 codec.JSONCodec } // ExportGenesis indicates an expected call of ExportGenesis. -func (mr *MockHasGenesisMockRecorder) ExportGenesis(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockHasABCIGenesisMockRecorder) ExportGenesis(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExportGenesis", reflect.TypeOf((*MockHasGenesis)(nil).ExportGenesis), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExportGenesis", reflect.TypeOf((*MockHasABCIGenesis)(nil).ExportGenesis), arg0, arg1) } // InitGenesis mocks base method. -func (m *MockHasGenesis) InitGenesis(arg0 types1.Context, arg1 codec.JSONCodec, arg2 json.RawMessage) []types.ValidatorUpdate { +func (m *MockHasABCIGenesis) InitGenesis(arg0 types1.Context, arg1 codec.JSONCodec, arg2 json.RawMessage) []types.ValidatorUpdate { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "InitGenesis", arg0, arg1, arg2) ret0, _ := ret[0].([]types.ValidatorUpdate) @@ -426,13 +327,13 @@ func (m *MockHasGenesis) InitGenesis(arg0 types1.Context, arg1 codec.JSONCodec, } // InitGenesis indicates an expected call of InitGenesis. -func (mr *MockHasGenesisMockRecorder) InitGenesis(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockHasABCIGenesisMockRecorder) InitGenesis(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitGenesis", reflect.TypeOf((*MockHasGenesis)(nil).InitGenesis), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitGenesis", reflect.TypeOf((*MockHasABCIGenesis)(nil).InitGenesis), arg0, arg1, arg2) } // ValidateGenesis mocks base method. -func (m *MockHasGenesis) ValidateGenesis(arg0 codec.JSONCodec, arg1 client.TxEncodingConfig, arg2 json.RawMessage) error { +func (m *MockHasABCIGenesis) ValidateGenesis(arg0 codec.JSONCodec, arg1 client.TxEncodingConfig, arg2 json.RawMessage) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ValidateGenesis", arg0, arg1, arg2) ret0, _ := ret[0].(error) @@ -440,15 +341,16 @@ func (m *MockHasGenesis) ValidateGenesis(arg0 codec.JSONCodec, arg1 client.TxEnc } // ValidateGenesis indicates an expected call of ValidateGenesis. -func (mr *MockHasGenesisMockRecorder) ValidateGenesis(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockHasABCIGenesisMockRecorder) ValidateGenesis(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateGenesis", reflect.TypeOf((*MockHasGenesis)(nil).ValidateGenesis), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateGenesis", reflect.TypeOf((*MockHasABCIGenesis)(nil).ValidateGenesis), arg0, arg1, arg2) } // MockAppModule is a mock of AppModule interface. type MockAppModule struct { ctrl *gomock.Controller recorder *MockAppModuleMockRecorder + isgomock struct{} } // MockAppModuleMockRecorder is the mock recorder for MockAppModule. @@ -468,32 +370,28 @@ func (m *MockAppModule) EXPECT() *MockAppModuleMockRecorder { return m.recorder } -// GetQueryCmd mocks base method. -func (m *MockAppModule) GetQueryCmd() *cobra.Command { +// IsAppModule mocks base method. +func (m *MockAppModule) IsAppModule() { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetQueryCmd") - ret0, _ := ret[0].(*cobra.Command) - return ret0 + m.ctrl.Call(m, "IsAppModule") } -// GetQueryCmd indicates an expected call of GetQueryCmd. -func (mr *MockAppModuleMockRecorder) GetQueryCmd() *gomock.Call { +// IsAppModule indicates an expected call of IsAppModule. +func (mr *MockAppModuleMockRecorder) IsAppModule() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQueryCmd", reflect.TypeOf((*MockAppModule)(nil).GetQueryCmd)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsAppModule", reflect.TypeOf((*MockAppModule)(nil).IsAppModule)) } -// GetTxCmd mocks base method. -func (m *MockAppModule) GetTxCmd() *cobra.Command { +// IsOnePerModuleType mocks base method. +func (m *MockAppModule) IsOnePerModuleType() { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetTxCmd") - ret0, _ := ret[0].(*cobra.Command) - return ret0 + m.ctrl.Call(m, "IsOnePerModuleType") } -// GetTxCmd indicates an expected call of GetTxCmd. -func (mr *MockAppModuleMockRecorder) GetTxCmd() *gomock.Call { +// IsOnePerModuleType indicates an expected call of IsOnePerModuleType. +func (mr *MockAppModuleMockRecorder) IsOnePerModuleType() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTxCmd", reflect.TypeOf((*MockAppModule)(nil).GetTxCmd)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsOnePerModuleType", reflect.TypeOf((*MockAppModule)(nil).IsOnePerModuleType)) } // Name mocks base method. @@ -517,7 +415,7 @@ func (m *MockAppModule) RegisterGRPCGatewayRoutes(arg0 client.Context, arg1 *run } // RegisterGRPCGatewayRoutes indicates an expected call of RegisterGRPCGatewayRoutes. -func (mr *MockAppModuleMockRecorder) RegisterGRPCGatewayRoutes(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockAppModuleMockRecorder) RegisterGRPCGatewayRoutes(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterGRPCGatewayRoutes", reflect.TypeOf((*MockAppModule)(nil).RegisterGRPCGatewayRoutes), arg0, arg1) } @@ -529,7 +427,7 @@ func (m *MockAppModule) RegisterInterfaces(arg0 types0.InterfaceRegistry) { } // RegisterInterfaces indicates an expected call of RegisterInterfaces. -func (mr *MockAppModuleMockRecorder) RegisterInterfaces(arg0 interface{}) *gomock.Call { +func (mr *MockAppModuleMockRecorder) RegisterInterfaces(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterInterfaces", reflect.TypeOf((*MockAppModule)(nil).RegisterInterfaces), arg0) } @@ -541,7 +439,7 @@ func (m *MockAppModule) RegisterLegacyAminoCodec(arg0 *codec.LegacyAmino) { } // RegisterLegacyAminoCodec indicates an expected call of RegisterLegacyAminoCodec. -func (mr *MockAppModuleMockRecorder) RegisterLegacyAminoCodec(arg0 interface{}) *gomock.Call { +func (mr *MockAppModuleMockRecorder) RegisterLegacyAminoCodec(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterLegacyAminoCodec", reflect.TypeOf((*MockAppModule)(nil).RegisterLegacyAminoCodec), arg0) } @@ -550,6 +448,7 @@ func (mr *MockAppModuleMockRecorder) RegisterLegacyAminoCodec(arg0 interface{}) type MockHasInvariants struct { ctrl *gomock.Controller recorder *MockHasInvariantsMockRecorder + isgomock struct{} } // MockHasInvariantsMockRecorder is the mock recorder for MockHasInvariants. @@ -576,7 +475,7 @@ func (m *MockHasInvariants) RegisterInvariants(arg0 types1.InvariantRegistry) { } // RegisterInvariants indicates an expected call of RegisterInvariants. -func (mr *MockHasInvariantsMockRecorder) RegisterInvariants(arg0 interface{}) *gomock.Call { +func (mr *MockHasInvariantsMockRecorder) RegisterInvariants(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterInvariants", reflect.TypeOf((*MockHasInvariants)(nil).RegisterInvariants), arg0) } @@ -585,6 +484,7 @@ func (mr *MockHasInvariantsMockRecorder) RegisterInvariants(arg0 interface{}) *g type MockHasServices struct { ctrl *gomock.Controller recorder *MockHasServicesMockRecorder + isgomock struct{} } // MockHasServicesMockRecorder is the mock recorder for MockHasServices. @@ -611,7 +511,7 @@ func (m *MockHasServices) RegisterServices(arg0 module.Configurator) { } // RegisterServices indicates an expected call of RegisterServices. -func (mr *MockHasServicesMockRecorder) RegisterServices(arg0 interface{}) *gomock.Call { +func (mr *MockHasServicesMockRecorder) RegisterServices(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterServices", reflect.TypeOf((*MockHasServices)(nil).RegisterServices), arg0) } @@ -620,6 +520,7 @@ func (mr *MockHasServicesMockRecorder) RegisterServices(arg0 interface{}) *gomoc type MockHasConsensusVersion struct { ctrl *gomock.Controller recorder *MockHasConsensusVersionMockRecorder + isgomock struct{} } // MockHasConsensusVersionMockRecorder is the mock recorder for MockHasConsensusVersion. @@ -653,31 +554,32 @@ func (mr *MockHasConsensusVersionMockRecorder) ConsensusVersion() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConsensusVersion", reflect.TypeOf((*MockHasConsensusVersion)(nil).ConsensusVersion)) } -// MockHasABCIEndblock is a mock of HasABCIEndblock interface. -type MockHasABCIEndblock struct { +// MockHasABCIEndBlock is a mock of HasABCIEndBlock interface. +type MockHasABCIEndBlock struct { ctrl *gomock.Controller - recorder *MockHasABCIEndblockMockRecorder + recorder *MockHasABCIEndBlockMockRecorder + isgomock struct{} } -// MockHasABCIEndblockMockRecorder is the mock recorder for MockHasABCIEndblock. -type MockHasABCIEndblockMockRecorder struct { - mock *MockHasABCIEndblock +// MockHasABCIEndBlockMockRecorder is the mock recorder for MockHasABCIEndBlock. +type MockHasABCIEndBlockMockRecorder struct { + mock *MockHasABCIEndBlock } -// NewMockHasABCIEndblock creates a new mock instance. -func NewMockHasABCIEndblock(ctrl *gomock.Controller) *MockHasABCIEndblock { - mock := &MockHasABCIEndblock{ctrl: ctrl} - mock.recorder = &MockHasABCIEndblockMockRecorder{mock} +// NewMockHasABCIEndBlock creates a new mock instance. +func NewMockHasABCIEndBlock(ctrl *gomock.Controller) *MockHasABCIEndBlock { + mock := &MockHasABCIEndBlock{ctrl: ctrl} + mock.recorder = &MockHasABCIEndBlockMockRecorder{mock} return mock } // EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockHasABCIEndblock) EXPECT() *MockHasABCIEndblockMockRecorder { +func (m *MockHasABCIEndBlock) EXPECT() *MockHasABCIEndBlockMockRecorder { return m.recorder } // EndBlock mocks base method. -func (m *MockHasABCIEndblock) EndBlock(arg0 context.Context) ([]types.ValidatorUpdate, error) { +func (m *MockHasABCIEndBlock) EndBlock(arg0 context.Context) ([]types.ValidatorUpdate, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "EndBlock", arg0) ret0, _ := ret[0].([]types.ValidatorUpdate) @@ -686,41 +588,153 @@ func (m *MockHasABCIEndblock) EndBlock(arg0 context.Context) ([]types.ValidatorU } // EndBlock indicates an expected call of EndBlock. -func (mr *MockHasABCIEndblockMockRecorder) EndBlock(arg0 interface{}) *gomock.Call { +func (mr *MockHasABCIEndBlockMockRecorder) EndBlock(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EndBlock", reflect.TypeOf((*MockHasABCIEndBlock)(nil).EndBlock), arg0) +} + +// IsAppModule mocks base method. +func (m *MockHasABCIEndBlock) IsAppModule() { + m.ctrl.T.Helper() + m.ctrl.Call(m, "IsAppModule") +} + +// IsAppModule indicates an expected call of IsAppModule. +func (mr *MockHasABCIEndBlockMockRecorder) IsAppModule() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsAppModule", reflect.TypeOf((*MockHasABCIEndBlock)(nil).IsAppModule)) +} + +// IsOnePerModuleType mocks base method. +func (m *MockHasABCIEndBlock) IsOnePerModuleType() { + m.ctrl.T.Helper() + m.ctrl.Call(m, "IsOnePerModuleType") +} + +// IsOnePerModuleType indicates an expected call of IsOnePerModuleType. +func (mr *MockHasABCIEndBlockMockRecorder) IsOnePerModuleType() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EndBlock", reflect.TypeOf((*MockHasABCIEndblock)(nil).EndBlock), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsOnePerModuleType", reflect.TypeOf((*MockHasABCIEndBlock)(nil).IsOnePerModuleType)) } -// GetQueryCmd mocks base method. -func (m *MockHasABCIEndblock) GetQueryCmd() *cobra.Command { +// Name mocks base method. +func (m *MockHasABCIEndBlock) Name() string { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetQueryCmd") - ret0, _ := ret[0].(*cobra.Command) + ret := m.ctrl.Call(m, "Name") + ret0, _ := ret[0].(string) return ret0 } -// GetQueryCmd indicates an expected call of GetQueryCmd. -func (mr *MockHasABCIEndblockMockRecorder) GetQueryCmd() *gomock.Call { +// Name indicates an expected call of Name. +func (mr *MockHasABCIEndBlockMockRecorder) Name() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Name", reflect.TypeOf((*MockHasABCIEndBlock)(nil).Name)) +} + +// RegisterGRPCGatewayRoutes mocks base method. +func (m *MockHasABCIEndBlock) RegisterGRPCGatewayRoutes(arg0 client.Context, arg1 *runtime.ServeMux) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "RegisterGRPCGatewayRoutes", arg0, arg1) +} + +// RegisterGRPCGatewayRoutes indicates an expected call of RegisterGRPCGatewayRoutes. +func (mr *MockHasABCIEndBlockMockRecorder) RegisterGRPCGatewayRoutes(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterGRPCGatewayRoutes", reflect.TypeOf((*MockHasABCIEndBlock)(nil).RegisterGRPCGatewayRoutes), arg0, arg1) +} + +// RegisterInterfaces mocks base method. +func (m *MockHasABCIEndBlock) RegisterInterfaces(arg0 types0.InterfaceRegistry) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "RegisterInterfaces", arg0) +} + +// RegisterInterfaces indicates an expected call of RegisterInterfaces. +func (mr *MockHasABCIEndBlockMockRecorder) RegisterInterfaces(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQueryCmd", reflect.TypeOf((*MockHasABCIEndblock)(nil).GetQueryCmd)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterInterfaces", reflect.TypeOf((*MockHasABCIEndBlock)(nil).RegisterInterfaces), arg0) } -// GetTxCmd mocks base method. -func (m *MockHasABCIEndblock) GetTxCmd() *cobra.Command { +// RegisterLegacyAminoCodec mocks base method. +func (m *MockHasABCIEndBlock) RegisterLegacyAminoCodec(arg0 *codec.LegacyAmino) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetTxCmd") - ret0, _ := ret[0].(*cobra.Command) + m.ctrl.Call(m, "RegisterLegacyAminoCodec", arg0) +} + +// RegisterLegacyAminoCodec indicates an expected call of RegisterLegacyAminoCodec. +func (mr *MockHasABCIEndBlockMockRecorder) RegisterLegacyAminoCodec(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterLegacyAminoCodec", reflect.TypeOf((*MockHasABCIEndBlock)(nil).RegisterLegacyAminoCodec), arg0) +} + +// MockAppModuleGenesis is a mock of AppModuleGenesis interface. +type MockAppModuleGenesis struct { + ctrl *gomock.Controller + recorder *MockAppModuleGenesisMockRecorder + isgomock struct{} +} + +// MockAppModuleGenesisMockRecorder is the mock recorder for MockAppModuleGenesis. +type MockAppModuleGenesisMockRecorder struct { + mock *MockAppModuleGenesis +} + +// NewMockAppModuleGenesis creates a new mock instance. +func NewMockAppModuleGenesis(ctrl *gomock.Controller) *MockAppModuleGenesis { + mock := &MockAppModuleGenesis{ctrl: ctrl} + mock.recorder = &MockAppModuleGenesisMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockAppModuleGenesis) EXPECT() *MockAppModuleGenesisMockRecorder { + return m.recorder +} + +// DefaultGenesis mocks base method. +func (m *MockAppModuleGenesis) DefaultGenesis(arg0 codec.JSONCodec) json.RawMessage { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DefaultGenesis", arg0) + ret0, _ := ret[0].(json.RawMessage) + return ret0 +} + +// DefaultGenesis indicates an expected call of DefaultGenesis. +func (mr *MockAppModuleGenesisMockRecorder) DefaultGenesis(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DefaultGenesis", reflect.TypeOf((*MockAppModuleGenesis)(nil).DefaultGenesis), arg0) +} + +// ExportGenesis mocks base method. +func (m *MockAppModuleGenesis) ExportGenesis(arg0 types1.Context, arg1 codec.JSONCodec) json.RawMessage { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ExportGenesis", arg0, arg1) + ret0, _ := ret[0].(json.RawMessage) return ret0 } -// GetTxCmd indicates an expected call of GetTxCmd. -func (mr *MockHasABCIEndblockMockRecorder) GetTxCmd() *gomock.Call { +// ExportGenesis indicates an expected call of ExportGenesis. +func (mr *MockAppModuleGenesisMockRecorder) ExportGenesis(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTxCmd", reflect.TypeOf((*MockHasABCIEndblock)(nil).GetTxCmd)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExportGenesis", reflect.TypeOf((*MockAppModuleGenesis)(nil).ExportGenesis), arg0, arg1) +} + +// InitGenesis mocks base method. +func (m *MockAppModuleGenesis) InitGenesis(arg0 types1.Context, arg1 codec.JSONCodec, arg2 json.RawMessage) []types.ValidatorUpdate { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "InitGenesis", arg0, arg1, arg2) + ret0, _ := ret[0].([]types.ValidatorUpdate) + return ret0 +} + +// InitGenesis indicates an expected call of InitGenesis. +func (mr *MockAppModuleGenesisMockRecorder) InitGenesis(arg0, arg1, arg2 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitGenesis", reflect.TypeOf((*MockAppModuleGenesis)(nil).InitGenesis), arg0, arg1, arg2) } // Name mocks base method. -func (m *MockHasABCIEndblock) Name() string { +func (m *MockAppModuleGenesis) Name() string { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Name") ret0, _ := ret[0].(string) @@ -728,43 +742,57 @@ func (m *MockHasABCIEndblock) Name() string { } // Name indicates an expected call of Name. -func (mr *MockHasABCIEndblockMockRecorder) Name() *gomock.Call { +func (mr *MockAppModuleGenesisMockRecorder) Name() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Name", reflect.TypeOf((*MockHasABCIEndblock)(nil).Name)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Name", reflect.TypeOf((*MockAppModuleGenesis)(nil).Name)) } // RegisterGRPCGatewayRoutes mocks base method. -func (m *MockHasABCIEndblock) RegisterGRPCGatewayRoutes(arg0 client.Context, arg1 *runtime.ServeMux) { +func (m *MockAppModuleGenesis) RegisterGRPCGatewayRoutes(arg0 client.Context, arg1 *runtime.ServeMux) { m.ctrl.T.Helper() m.ctrl.Call(m, "RegisterGRPCGatewayRoutes", arg0, arg1) } // RegisterGRPCGatewayRoutes indicates an expected call of RegisterGRPCGatewayRoutes. -func (mr *MockHasABCIEndblockMockRecorder) RegisterGRPCGatewayRoutes(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockAppModuleGenesisMockRecorder) RegisterGRPCGatewayRoutes(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterGRPCGatewayRoutes", reflect.TypeOf((*MockHasABCIEndblock)(nil).RegisterGRPCGatewayRoutes), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterGRPCGatewayRoutes", reflect.TypeOf((*MockAppModuleGenesis)(nil).RegisterGRPCGatewayRoutes), arg0, arg1) } // RegisterInterfaces mocks base method. -func (m *MockHasABCIEndblock) RegisterInterfaces(arg0 types0.InterfaceRegistry) { +func (m *MockAppModuleGenesis) RegisterInterfaces(arg0 types0.InterfaceRegistry) { m.ctrl.T.Helper() m.ctrl.Call(m, "RegisterInterfaces", arg0) } // RegisterInterfaces indicates an expected call of RegisterInterfaces. -func (mr *MockHasABCIEndblockMockRecorder) RegisterInterfaces(arg0 interface{}) *gomock.Call { +func (mr *MockAppModuleGenesisMockRecorder) RegisterInterfaces(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterInterfaces", reflect.TypeOf((*MockHasABCIEndblock)(nil).RegisterInterfaces), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterInterfaces", reflect.TypeOf((*MockAppModuleGenesis)(nil).RegisterInterfaces), arg0) } // RegisterLegacyAminoCodec mocks base method. -func (m *MockHasABCIEndblock) RegisterLegacyAminoCodec(arg0 *codec.LegacyAmino) { +func (m *MockAppModuleGenesis) RegisterLegacyAminoCodec(arg0 *codec.LegacyAmino) { m.ctrl.T.Helper() m.ctrl.Call(m, "RegisterLegacyAminoCodec", arg0) } // RegisterLegacyAminoCodec indicates an expected call of RegisterLegacyAminoCodec. -func (mr *MockHasABCIEndblockMockRecorder) RegisterLegacyAminoCodec(arg0 interface{}) *gomock.Call { +func (mr *MockAppModuleGenesisMockRecorder) RegisterLegacyAminoCodec(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterLegacyAminoCodec", reflect.TypeOf((*MockHasABCIEndblock)(nil).RegisterLegacyAminoCodec), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterLegacyAminoCodec", reflect.TypeOf((*MockAppModuleGenesis)(nil).RegisterLegacyAminoCodec), arg0) +} + +// ValidateGenesis mocks base method. +func (m *MockAppModuleGenesis) ValidateGenesis(arg0 codec.JSONCodec, arg1 client.TxEncodingConfig, arg2 json.RawMessage) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ValidateGenesis", arg0, arg1, arg2) + ret0, _ := ret[0].(error) + return ret0 +} + +// ValidateGenesis indicates an expected call of ValidateGenesis. +func (mr *MockAppModuleGenesisMockRecorder) ValidateGenesis(arg0, arg1, arg2 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateGenesis", reflect.TypeOf((*MockAppModuleGenesis)(nil).ValidateGenesis), arg0, arg1, arg2) } diff --git a/testutil/network/network.go b/testutil/network/network.go index ae6eaf454c08..1d9f60019642 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -17,11 +17,6 @@ import ( "testing" "time" - "cosmossdk.io/depinject" - "cosmossdk.io/log" - sdkmath "cosmossdk.io/math" - "cosmossdk.io/math/unsafe" - pruningtypes "cosmossdk.io/store/pruning/types" "github.com/cometbft/cometbft/node" cmtclient "github.com/cometbft/cometbft/rpc/client" dbm "github.com/cosmos/cosmos-db" @@ -29,6 +24,12 @@ import ( "golang.org/x/sync/errgroup" "google.golang.org/grpc" + "cosmossdk.io/depinject" + "cosmossdk.io/log" + sdkmath "cosmossdk.io/math" + "cosmossdk.io/math/unsafe" + pruningtypes "cosmossdk.io/store/pruning/types" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" @@ -272,6 +273,7 @@ type ( ValAddress sdk.ValAddress RPCClient cmtclient.Client + app servertypes.Application tmNode *node.Node api *api.Server grpc *grpc.Server @@ -520,7 +522,7 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { } createValMsg, err := stakingtypes.NewMsgCreateValidator( - sdk.ValAddress(addr), + sdk.ValAddress(addr).String(), valPubKeys[i], sdk.NewCoin(cfg.BondDenom, cfg.BondedTokens), stakingtypes.NewDescription(nodeDirName, "", "", "", ""), @@ -578,7 +580,8 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { WithCodec(cfg.Codec). WithLegacyAmino(cfg.LegacyAmino). WithTxConfig(cfg.TxConfig). - WithAccountRetriever(cfg.AccountRetriever) + WithAccountRetriever(cfg.AccountRetriever). + WithNodeURI(cmtCfg.RPC.ListenAddress) // Provide ChainID here since we can't modify it in the Comet config. ctx.Viper.Set(flags.FlagChainID, cfg.ChainID) @@ -610,8 +613,7 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { l.Log("starting test network...") for idx, v := range network.Validators { - err := startInProcess(cfg, v) - if err != nil { + if err := startInProcess(cfg, v); err != nil { return nil, err } l.Log("started validator", idx) @@ -701,7 +703,7 @@ func (n *Network) LatestHeight() (int64, error) { // committed after a given block. If that height is not reached within a timeout, // an error is returned. Regardless, the latest height queried is returned. func (n *Network) WaitForHeight(h int64) (int64, error) { - return n.WaitForHeightWithTimeout(h, 10*time.Second) + return n.WaitForHeightWithTimeout(h, 20*time.Second) } // WaitForHeightWithTimeout is the same as WaitForHeight except the caller can @@ -743,7 +745,7 @@ func (n *Network) WaitForHeightWithTimeout(h int64, t time.Duration) (int64, err // blocks has been reached. func (n *Network) RetryForBlocks(retryFunc func() error, blocks int) error { for i := 0; i < blocks; i++ { - n.WaitForNextBlock() + _ = n.WaitForNextBlock() // ignore the error as we use the retry for validation err := retryFunc() if err == nil { return nil @@ -802,6 +804,12 @@ func (n *Network) Cleanup() { if v.grpcWeb != nil { _ = v.grpcWeb.Close() } + + if v.app != nil { + if err := v.app.Close(); err != nil { + n.Logger.Log("failed to stop validator ABCI application", "err", err) + } + } } time.Sleep(100 * time.Millisecond) diff --git a/testutil/network/util.go b/testutil/network/util.go index c70108535c74..072184cea25d 100644 --- a/testutil/network/util.go +++ b/testutil/network/util.go @@ -18,6 +18,8 @@ import ( cmttime "github.com/cometbft/cometbft/types/time" "golang.org/x/sync/errgroup" + "cosmossdk.io/log" + "github.com/cosmos/cosmos-sdk/server" "github.com/cosmos/cosmos-sdk/server/api" servergrpc "github.com/cosmos/cosmos-sdk/server/grpc" @@ -43,6 +45,8 @@ func startInProcess(cfg Config, val *Validator) error { } app := cfg.AppConstructor(*val) + val.app = app + appGenesisProvider := func() (*cmttypes.GenesisDoc, error) { appGenesis, err := genutiltypes.AppGenesisFromFile(cmtCfg.GenesisFile()) if err != nil { @@ -101,14 +105,14 @@ func startInProcess(cfg Config, val *Validator) error { // Start the gRPC server in a goroutine. Note, the provided ctx will ensure // that the server is gracefully shut down. val.errGroup.Go(func() error { - return servergrpc.StartGRPCServer(ctx, logger.With("module", "grpc-server"), grpcCfg, grpcSrv) + return servergrpc.StartGRPCServer(ctx, logger.With(log.ModuleKey, "grpc-server"), grpcCfg, grpcSrv) }) val.grpc = grpcSrv } if val.APIAddress != "" { - apiSrv := api.New(val.ClientCtx, logger.With("module", "api-server"), val.grpc) + apiSrv := api.New(val.ClientCtx, logger.With(log.ModuleKey, "api-server"), val.grpc) app.RegisterAPIRoutes(apiSrv, val.AppConfig.API) val.errGroup.Go(func() error { @@ -142,7 +146,7 @@ func collectGenFiles(cfg Config, vals []*Validator, outputDir string) error { } appState, err := genutil.GenAppStateFromConfig(cfg.Codec, cfg.TxConfig, - cmtCfg, initCfg, appGenesis, banktypes.GenesisBalancesIterator{}, genutiltypes.DefaultMessageValidator) + cmtCfg, initCfg, appGenesis, banktypes.GenesisBalancesIterator{}, genutiltypes.DefaultMessageValidator, cfg.TxConfig.SigningContext().ValidatorAddressCodec()) if err != nil { return err } @@ -216,7 +220,7 @@ func writeFile(name, dir string, contents []byte) error { // Get a free address for a test CometBFT server // protocol is either tcp, http, etc func FreeTCPAddr() (addr, port string, closeFn func() error, err error) { - l, err := net.Listen("tcp", "localhost:0") + l, err := net.Listen("tcp", "127.0.0.1:0") if err != nil { return "", "", nil, err } diff --git a/testutil/rest.go b/testutil/rest.go index 6b8066aafbb9..6dc1c5792ff9 100644 --- a/testutil/rest.go +++ b/testutil/rest.go @@ -42,15 +42,15 @@ func GetRequestWithHeaders(url string, headers map[string]string) ([]byte, error // GetRequest defines a wrapper around an HTTP GET request with a provided URL. // An error is returned if the request or reading the body fails. func GetRequest(url string) ([]byte, error) { - res, err := http.Get(url) //nolint:gosec // only used for testing + resp, err := http.Get(url) if err != nil { return nil, err } defer func() { - _ = res.Body.Close() + _ = resp.Body.Close() }() - body, err := io.ReadAll(res.Body) + body, err := io.ReadAll(resp.Body) if err != nil { return nil, err } @@ -61,15 +61,15 @@ func GetRequest(url string) ([]byte, error) { // PostRequest defines a wrapper around an HTTP POST request with a provided URL and data. // An error is returned if the request or reading the body fails. func PostRequest(url, contentType string, data []byte) ([]byte, error) { - res, err := http.Post(url, contentType, bytes.NewBuffer(data)) //nolint:gosec // only used for testing + resp, err := http.Post(url, contentType, bytes.NewBuffer(data)) if err != nil { return nil, fmt.Errorf("error while sending post request: %w", err) } defer func() { - _ = res.Body.Close() + _ = resp.Body.Close() }() - bz, err := io.ReadAll(res.Body) + bz, err := io.ReadAll(resp.Body) if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } diff --git a/testutil/sims/address_helpers.go b/testutil/sims/address_helpers.go index 52f1db8faffe..4bd7ef65e415 100644 --- a/testutil/sims/address_helpers.go +++ b/testutil/sims/address_helpers.go @@ -2,6 +2,7 @@ package sims import ( "bytes" + "context" "encoding/hex" "fmt" "strconv" @@ -23,12 +24,16 @@ type GenerateAccountStrategy func(int) []sdk.AccAddress // provides the staking bond denom. It is used in arguments in this package's // functions so that a mock staking keeper can be passed instead of the real one. type BondDenomProvider interface { - BondDenom(ctx sdk.Context) string + BondDenom(ctx context.Context) (string, error) } // AddTestAddrsFromPubKeys adds the addresses into the SimApp providing only the public keys. func AddTestAddrsFromPubKeys(bankKeeper bankkeeper.Keeper, stakingKeeper BondDenomProvider, ctx sdk.Context, pubKeys []cryptotypes.PubKey, accAmt math.Int) { - initCoins := sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), accAmt)) + bondDenom, err := stakingKeeper.BondDenom(ctx) + if err != nil { + panic(err) + } + initCoins := sdk.NewCoins(sdk.NewCoin(bondDenom, accAmt)) for _, pk := range pubKeys { initAccountWithCoins(bankKeeper, ctx, sdk.AccAddress(pk.Address()), initCoins) @@ -48,7 +53,11 @@ func AddTestAddrsIncremental(bankKeeper bankkeeper.Keeper, stakingKeeper BondDen func addTestAddrs(bankKeeper bankkeeper.Keeper, stakingKeeper BondDenomProvider, ctx sdk.Context, accNum int, accAmt math.Int, strategy GenerateAccountStrategy) []sdk.AccAddress { testAddrs := strategy(accNum) - initCoins := sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), accAmt)) + bondDenom, err := stakingKeeper.BondDenom(ctx) + if err != nil { + panic(err) + } + initCoins := sdk.NewCoins(sdk.NewCoin(bondDenom, accAmt)) for _, addr := range testAddrs { initAccountWithCoins(bankKeeper, ctx, addr, initCoins) diff --git a/testutil/sims/app_helpers.go b/testutil/sims/app_helpers.go index 6fdbec1f5b71..7c7e6c942f1b 100644 --- a/testutil/sims/app_helpers.go +++ b/testutil/sims/app_helpers.go @@ -5,14 +5,16 @@ import ( "fmt" "time" - "cosmossdk.io/depinject" - sdkmath "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" cmtjson "github.com/cometbft/cometbft/libs/json" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" cmttypes "github.com/cometbft/cometbft/types" dbm "github.com/cosmos/cosmos-db" + coreheader "cosmossdk.io/core/header" + "cosmossdk.io/depinject" + sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -34,7 +36,7 @@ const DefaultGenTxGas = 10000000 var DefaultConsensusParams = &cmtproto.ConsensusParams{ Block: &cmtproto.BlockParams{ MaxBytes: 200000, - MaxGas: 2000000, + MaxGas: 100_000_000, }, Evidence: &cmtproto.EvidenceParams{ MaxAgeNumBlocks: 302400, @@ -106,6 +108,35 @@ func SetupAtGenesis(appConfig depinject.Config, extraOutputs ...interface{}) (*r return SetupWithConfiguration(appConfig, cfg, extraOutputs...) } +// NextBlock starts a new block. +func NextBlock(app *runtime.App, ctx sdk.Context, jumpTime time.Duration) (sdk.Context, error) { + _, err := app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: ctx.BlockHeight(), Time: ctx.BlockTime()}) + if err != nil { + return sdk.Context{}, err + } + _, err = app.Commit() + if err != nil { + return sdk.Context{}, err + } + + newBlockTime := ctx.BlockTime().Add(jumpTime) + + header := ctx.BlockHeader() + header.Time = newBlockTime + header.Height++ + + newCtx := app.BaseApp.NewUncachedContext(false, header).WithHeaderInfo(coreheader.Info{ + Height: header.Height, + Time: header.Time, + }) + + if err != nil { + return sdk.Context{}, err + } + + return newCtx, err +} + // SetupWithConfiguration initializes a new runtime.App. A Nop logger is set in runtime.App. // appConfig defines the application configuration (f.e. app_config.go). // extraOutputs defines the extra outputs to be assigned by the dependency injector (depinject). @@ -222,7 +253,7 @@ func GenesisStateWithValSet( MinSelfDelegation: sdkmath.ZeroInt(), } validators = append(validators, validator) - delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress(), val.Address.Bytes(), sdkmath.LegacyOneDec())) + delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress().String(), sdk.ValAddress(val.Address).String(), sdkmath.LegacyOneDec())) } diff --git a/testutil/sims/expected_keepers.go b/testutil/sims/expected_keepers.go new file mode 100644 index 000000000000..5a6d9c9f0f5d --- /dev/null +++ b/testutil/sims/expected_keepers.go @@ -0,0 +1,19 @@ +package sims + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +type BankKeeper interface { + SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error + MintCoins(ctx context.Context, moduleName string, amt sdk.Coins) error +} + +// StakingKeeper is a subset of the staking keeper's public interface that +// provides the staking bond denom. It is used in arguments in this package's +// functions so that a mock staking keeper can be passed instead of the real one. +type StakingKeeper interface { + BondDenom(ctx context.Context) (string, error) +} diff --git a/testutil/sims/state_helpers.go b/testutil/sims/state_helpers.go index e0d643a90fb2..d1a320e983ef 100644 --- a/testutil/sims/state_helpers.go +++ b/testutil/sims/state_helpers.go @@ -1,11 +1,13 @@ package sims import ( + "bufio" "encoding/json" "fmt" "io" "math/rand" "os" + "path/filepath" "time" "github.com/cosmos/gogoproto/proto" @@ -13,6 +15,7 @@ import ( "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" @@ -205,11 +208,11 @@ func AppStateRandomizedFn( ) appParams.GetOrGenerate( StakePerAccount, &initialStake, r, - func(r *rand.Rand) { initialStake = math.NewInt(r.Int63n(1e12)) }, + func(r *rand.Rand) { initialStake = sdk.DefaultPowerReduction.AddRaw(r.Int63n(1e12)) }, ) appParams.GetOrGenerate( InitiallyBondedValidators, &numInitiallyBonded, r, - func(r *rand.Rand) { numInitiallyBonded = int64(r.Intn(300)) }, + func(r *rand.Rand) { numInitiallyBonded = int64(r.Intn(299) + 1) }, ) if numInitiallyBonded > numAccs { @@ -222,7 +225,7 @@ func AppStateRandomizedFn( stake_per_account: "%d", initially_bonded_validators: "%d" } -`, initialStake, numInitiallyBonded, +`, initialStake.Uint64(), numInitiallyBonded, ) simState := &module.SimulationState{ @@ -250,19 +253,23 @@ func AppStateRandomizedFn( // AppStateFromGenesisFileFn util function to generate the genesis AppState // from a genesis.json file. func AppStateFromGenesisFileFn(r io.Reader, cdc codec.JSONCodec, genesisFile string) (genutiltypes.AppGenesis, []simtypes.Account, error) { - bytes, err := os.ReadFile(genesisFile) + file, err := os.Open(filepath.Clean(genesisFile)) if err != nil { panic(err) } - var genesis genutiltypes.AppGenesis - if err = json.Unmarshal(bytes, &genesis); err != nil { - return genesis, nil, err + genesis, err := genutiltypes.AppGenesisFromReader(bufio.NewReader(file)) + if err != nil { + return *genesis, nil, err + } + + if err := file.Close(); err != nil { + return *genesis, nil, err } var appState map[string]json.RawMessage if err = json.Unmarshal(genesis.AppState, &appState); err != nil { - return genesis, nil, err + return *genesis, nil, err } var authGenesis authtypes.GenesisState @@ -284,13 +291,13 @@ func AppStateFromGenesisFileFn(r io.Reader, cdc codec.JSONCodec, genesisFile str a, ok := acc.GetCachedValue().(sdk.AccountI) if !ok { - return genesis, nil, fmt.Errorf("expected account") + return *genesis, nil, fmt.Errorf("expected account") } // create simulator accounts - simAcc := simtypes.Account{PrivKey: privKey, PubKey: privKey.PubKey(), Address: a.GetAddress()} + simAcc := simtypes.Account{PrivKey: privKey, PubKey: privKey.PubKey(), Address: a.GetAddress(), ConsKey: ed25519.GenPrivKeyFromSecret(privkeySeed)} newAccs[i] = simAcc } - return genesis, newAccs, nil + return *genesis, newAccs, nil } diff --git a/testutil/sims/tx_helpers.go b/testutil/sims/tx_helpers.go index 56c42bfc551d..0557e6b647b1 100644 --- a/testutil/sims/tx_helpers.go +++ b/testutil/sims/tx_helpers.go @@ -6,11 +6,12 @@ import ( "testing" "time" - "cosmossdk.io/errors" types2 "github.com/cometbft/cometbft/abci/types" "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" + "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" @@ -78,10 +79,10 @@ func GenSignedMockTx(r *rand.Rand, txConfig client.TxConfig, msgs []sdk.Msg, fee panic(err) } sigs[i].Data.(*signing.SingleSignatureData).Signature = sig - err = tx.SetSignatures(sigs...) - if err != nil { - panic(err) - } + } + err = tx.SetSignatures(sigs...) + if err != nil { + panic(err) } return tx.GetTx(), nil diff --git a/testutil/testdata/buf.gen.gogo.yaml b/testutil/testdata/buf.gen.gogo.yaml new file mode 100644 index 000000000000..6b06e51321b3 --- /dev/null +++ b/testutil/testdata/buf.gen.gogo.yaml @@ -0,0 +1,6 @@ +version: v1 +plugins: + - name: gocosmos + out: ../.. + opt: + - plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any diff --git a/testutil/testdata/query.pb.go b/testutil/testdata/query.pb.go index d104840c5dce..315e4103282c 100644 --- a/testutil/testdata/query.pb.go +++ b/testutil/testdata/query.pb.go @@ -461,6 +461,7 @@ func _Query_TestAny_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "testpb.Query", HandlerType: (*QueryServer)(nil), diff --git a/testutil/testdata/testpb/query_grpc.pb.go b/testutil/testdata/testpb/query_grpc.pb.go index 565a93499d4b..386b2e21a3d3 100644 --- a/testutil/testdata/testpb/query_grpc.pb.go +++ b/testutil/testdata/testpb/query_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: testpb/query.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Query_Echo_FullMethodName = "/testpb.Query/Echo" @@ -27,6 +27,9 @@ const ( // QueryClient is the client API for Query service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Query tests the protobuf Query service as defined in +// https://github.com/cosmos/cosmos-sdk/issues/5921. type QueryClient interface { Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error) SayHello(ctx context.Context, in *SayHelloRequest, opts ...grpc.CallOption) (*SayHelloResponse, error) @@ -42,8 +45,9 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { } func (c *queryClient) Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(EchoResponse) - err := c.cc.Invoke(ctx, Query_Echo_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Echo_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -51,8 +55,9 @@ func (c *queryClient) Echo(ctx context.Context, in *EchoRequest, opts ...grpc.Ca } func (c *queryClient) SayHello(ctx context.Context, in *SayHelloRequest, opts ...grpc.CallOption) (*SayHelloResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(SayHelloResponse) - err := c.cc.Invoke(ctx, Query_SayHello_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_SayHello_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -60,8 +65,9 @@ func (c *queryClient) SayHello(ctx context.Context, in *SayHelloRequest, opts .. } func (c *queryClient) TestAny(ctx context.Context, in *TestAnyRequest, opts ...grpc.CallOption) (*TestAnyResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(TestAnyResponse) - err := c.cc.Invoke(ctx, Query_TestAny_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_TestAny_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -70,7 +76,10 @@ func (c *queryClient) TestAny(ctx context.Context, in *TestAnyRequest, opts ...g // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer -// for forward compatibility +// for forward compatibility. +// +// Query tests the protobuf Query service as defined in +// https://github.com/cosmos/cosmos-sdk/issues/5921. type QueryServer interface { Echo(context.Context, *EchoRequest) (*EchoResponse, error) SayHello(context.Context, *SayHelloRequest) (*SayHelloResponse, error) @@ -78,9 +87,12 @@ type QueryServer interface { mustEmbedUnimplementedQueryServer() } -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} +// UnimplementedQueryServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedQueryServer struct{} func (UnimplementedQueryServer) Echo(context.Context, *EchoRequest) (*EchoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Echo not implemented") @@ -92,6 +104,7 @@ func (UnimplementedQueryServer) TestAny(context.Context, *TestAnyRequest) (*Test return nil, status.Errorf(codes.Unimplemented, "method TestAny not implemented") } func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} +func (UnimplementedQueryServer) testEmbeddedByValue() {} // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to QueryServer will @@ -101,6 +114,13 @@ type UnsafeQueryServer interface { } func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + // If the following call pancis, it indicates UnimplementedQueryServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Query_ServiceDesc, srv) } diff --git a/testutil/testdata/testpb/tx.proto b/testutil/testdata/testpb/tx.proto index 13e48c7702a7..d3b97193acf7 100644 --- a/testutil/testdata/testpb/tx.proto +++ b/testutil/testdata/testpb/tx.proto @@ -19,8 +19,8 @@ service Msg { message MsgCreateDog { option (cosmos.msg.v1.signer) = "owner"; - testpb.Dog dog = 1; - string owner = 2; + testpb.Dog dog = 1; + string owner = 2; } message MsgCreateDogResponse { @@ -30,9 +30,9 @@ message MsgCreateDogResponse { // TestMsg is msg type for testing protobuf message using any, as defined in // https://github.com/cosmos/cosmos-sdk/issues/6213. message TestMsg { - option (cosmos.msg.v1.signer) = "signers"; + option (cosmos.msg.v1.signer) = "signers"; option (gogoproto.goproto_getters) = false; - option (amino.name) = "testpb/TestMsg"; + option (amino.name) = "testpb/TestMsg"; - repeated string signers = 1; + repeated string signers = 1; } diff --git a/testutil/testdata/testpb/tx_grpc.pb.go b/testutil/testdata/testpb/tx_grpc.pb.go index 3971c84d770a..357c72b368e9 100644 --- a/testutil/testdata/testpb/tx_grpc.pb.go +++ b/testutil/testdata/testpb/tx_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: testpb/tx.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Msg_CreateDog_FullMethodName = "/testpb.Msg/CreateDog" @@ -25,6 +25,9 @@ const ( // MsgClient is the client API for Msg service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Msg tests the Protobuf message service as defined in +// https://github.com/cosmos/cosmos-sdk/issues/7500. type MsgClient interface { CreateDog(ctx context.Context, in *MsgCreateDog, opts ...grpc.CallOption) (*MsgCreateDogResponse, error) } @@ -38,8 +41,9 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { } func (c *msgClient) CreateDog(ctx context.Context, in *MsgCreateDog, opts ...grpc.CallOption) (*MsgCreateDogResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgCreateDogResponse) - err := c.cc.Invoke(ctx, Msg_CreateDog_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_CreateDog_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -48,20 +52,27 @@ func (c *msgClient) CreateDog(ctx context.Context, in *MsgCreateDog, opts ...grp // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer -// for forward compatibility +// for forward compatibility. +// +// Msg tests the Protobuf message service as defined in +// https://github.com/cosmos/cosmos-sdk/issues/7500. type MsgServer interface { CreateDog(context.Context, *MsgCreateDog) (*MsgCreateDogResponse, error) mustEmbedUnimplementedMsgServer() } -// UnimplementedMsgServer must be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} +// UnimplementedMsgServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedMsgServer struct{} func (UnimplementedMsgServer) CreateDog(context.Context, *MsgCreateDog) (*MsgCreateDogResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateDog not implemented") } func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} +func (UnimplementedMsgServer) testEmbeddedByValue() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to MsgServer will @@ -71,6 +82,13 @@ type UnsafeMsgServer interface { } func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + // If the following call pancis, it indicates UnimplementedMsgServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Msg_ServiceDesc, srv) } diff --git a/testutil/testdata/testpb/unknonwnproto.proto b/testutil/testdata/testpb/unknonwnproto.proto index ac91b9e2a662..94037635ec17 100644 --- a/testutil/testdata/testpb/unknonwnproto.proto +++ b/testutil/testdata/testpb/unknonwnproto.proto @@ -290,7 +290,7 @@ message TestUpdatedTxBody { repeated google.protobuf.Any messages = 1; string memo = 2; int64 timeout_height = 3; - uint64 some_new_field = 4; + uint64 some_new_field = 5; string some_new_field_non_critical_field = 1050; repeated google.protobuf.Any extension_options = 1023; repeated google.protobuf.Any non_critical_extension_options = 2047; diff --git a/testutil/testdata/testpb/unknonwnproto.pulsar.go b/testutil/testdata/testpb/unknonwnproto.pulsar.go index 84dbe6fbdb53..e8a5d52c8529 100644 --- a/testutil/testdata/testpb/unknonwnproto.pulsar.go +++ b/testutil/testdata/testpb/unknonwnproto.pulsar.go @@ -23036,7 +23036,7 @@ func (x *fastReflection_TestUpdatedTxBody) ProtoMethods() *protoiface.Methods { if x.SomeNewField != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.SomeNewField)) i-- - dAtA[i] = 0x20 + dAtA[i] = 0x28 } if x.TimeoutHeight != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.TimeoutHeight)) @@ -23200,7 +23200,7 @@ func (x *fastReflection_TestUpdatedTxBody) ProtoMethods() *protoiface.Methods { break } } - case 4: + case 5: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SomeNewField", wireType) } @@ -26508,7 +26508,7 @@ type TestUpdatedTxBody struct { Messages []*anypb.Any `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` Memo string `protobuf:"bytes,2,opt,name=memo,proto3" json:"memo,omitempty"` TimeoutHeight int64 `protobuf:"varint,3,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height,omitempty"` - SomeNewField uint64 `protobuf:"varint,4,opt,name=some_new_field,json=someNewField,proto3" json:"some_new_field,omitempty"` + SomeNewField uint64 `protobuf:"varint,5,opt,name=some_new_field,json=someNewField,proto3" json:"some_new_field,omitempty"` SomeNewFieldNonCriticalField string `protobuf:"bytes,1050,opt,name=some_new_field_non_critical_field,json=someNewFieldNonCriticalField,proto3" json:"some_new_field_non_critical_field,omitempty"` ExtensionOptions []*anypb.Any `protobuf:"bytes,1023,rep,name=extension_options,json=extensionOptions,proto3" json:"extension_options,omitempty"` NonCriticalExtensionOptions []*anypb.Any `protobuf:"bytes,2047,rep,name=non_critical_extension_options,json=nonCriticalExtensionOptions,proto3" json:"non_critical_extension_options,omitempty"` @@ -27410,7 +27410,7 @@ var file_testpb_unknonwnproto_proto_rawDesc = []byte{ 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x73, 0x6f, 0x6d, 0x65, 0x5f, 0x6e, 0x65, 0x77, 0x5f, 0x66, 0x69, - 0x65, 0x6c, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x73, 0x6f, 0x6d, 0x65, 0x4e, + 0x65, 0x6c, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x73, 0x6f, 0x6d, 0x65, 0x4e, 0x65, 0x77, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x48, 0x0a, 0x21, 0x73, 0x6f, 0x6d, 0x65, 0x5f, 0x6e, 0x65, 0x77, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6e, 0x6f, 0x6e, 0x5f, 0x63, 0x72, 0x69, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x9a, 0x08, 0x20, diff --git a/testutil/testdata/tx.pb.go b/testutil/testdata/tx.pb.go index e2d416faa41e..904eb4037ec3 100644 --- a/testutil/testdata/tx.pb.go +++ b/testutil/testdata/tx.pb.go @@ -266,6 +266,7 @@ func _Msg_CreateDog_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "testpb.Msg", HandlerType: (*MsgServer)(nil), diff --git a/testutil/testdata/unknonwnproto.pb.go b/testutil/testdata/unknonwnproto.pb.go index 3522a7253598..406d624a3c24 100644 --- a/testutil/testdata/unknonwnproto.pb.go +++ b/testutil/testdata/unknonwnproto.pb.go @@ -2578,7 +2578,7 @@ type TestUpdatedTxBody struct { Messages []*types.Any `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` Memo string `protobuf:"bytes,2,opt,name=memo,proto3" json:"memo,omitempty"` TimeoutHeight int64 `protobuf:"varint,3,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height,omitempty"` - SomeNewField uint64 `protobuf:"varint,4,opt,name=some_new_field,json=someNewField,proto3" json:"some_new_field,omitempty"` + SomeNewField uint64 `protobuf:"varint,5,opt,name=some_new_field,json=someNewField,proto3" json:"some_new_field,omitempty"` SomeNewFieldNonCriticalField string `protobuf:"bytes,1050,opt,name=some_new_field_non_critical_field,json=someNewFieldNonCriticalField,proto3" json:"some_new_field_non_critical_field,omitempty"` ExtensionOptions []*types.Any `protobuf:"bytes,1023,rep,name=extension_options,json=extensionOptions,proto3" json:"extension_options,omitempty"` NonCriticalExtensionOptions []*types.Any `protobuf:"bytes,2047,rep,name=non_critical_extension_options,json=nonCriticalExtensionOptions,proto3" json:"non_critical_extension_options,omitempty"` @@ -2906,7 +2906,7 @@ var fileDescriptor_fe4560133be9209a = []byte{ 0x1a, 0x5f, 0x6a, 0x70, 0x6d, 0xc5, 0x85, 0x3e, 0x73, 0x17, 0xf8, 0x0e, 0x14, 0x66, 0x84, 0x73, 0x7b, 0xac, 0x3c, 0xd0, 0x36, 0xa6, 0x56, 0x82, 0x92, 0xd5, 0x3c, 0x23, 0x33, 0x16, 0x57, 0xb3, 0x1c, 0x4b, 0x13, 0x84, 0x37, 0x23, 0x2c, 0x10, 0x83, 0x09, 0xf1, 0xc6, 0x13, 0x11, 0xf1, 0x78, - 0x25, 0x92, 0x1e, 0x2a, 0x21, 0x7e, 0x1f, 0xca, 0x9c, 0xcd, 0xc8, 0x60, 0x79, 0x6d, 0xca, 0xaa, + 0x25, 0x92, 0x1e, 0x2a, 0x21, 0x7e, 0x1f, 0xca, 0x9c, 0xcd, 0xc8, 0x60, 0x79, 0x6d, 0xca, 0xa9, 0x6b, 0x53, 0x49, 0x4a, 0x8f, 0x22, 0x63, 0xf1, 0x21, 0xfc, 0x60, 0x15, 0x35, 0x58, 0xd3, 0x82, 0x7f, 0x17, 0xb6, 0xe0, 0xf7, 0xd2, 0x3b, 0x8f, 0x5e, 0x6f, 0xc7, 0x7d, 0xb8, 0x46, 0xe6, 0x82, 0x50, 0x99, 0x23, 0x03, 0xa6, 0x3e, 0xe5, 0x72, 0xfd, 0xdf, 0xbb, 0xe7, 0xb8, 0x59, 0x49, 0xf0, @@ -2921,7 +2921,7 @@ var fileDescriptor_fe4560133be9209a = []byte{ 0x3c, 0x7f, 0x55, 0xdb, 0xf9, 0xeb, 0xab, 0xda, 0xce, 0x67, 0xcd, 0xb1, 0x27, 0x26, 0xc1, 0xb0, 0xe9, 0xb0, 0x59, 0x2b, 0xfa, 0xc8, 0x1f, 0xfe, 0xdd, 0xe6, 0xee, 0x71, 0x4b, 0x56, 0x7d, 0x20, 0xbc, 0xa9, 0x1a, 0xb8, 0xb6, 0xb0, 0x87, 0x79, 0x45, 0x74, 0xe7, 0x3f, 0x01, 0x00, 0x00, 0xff, - 0xff, 0x3a, 0xea, 0x0d, 0xa7, 0x67, 0x18, 0x00, 0x00, + 0xff, 0x33, 0x3d, 0xcf, 0x3a, 0x67, 0x18, 0x00, 0x00, } func (m *Customer1) Marshal() (dAtA []byte, err error) { @@ -5261,7 +5261,7 @@ func (m *TestUpdatedTxBody) MarshalToSizedBuffer(dAtA []byte) (int, error) { if m.SomeNewField != 0 { i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.SomeNewField)) i-- - dAtA[i] = 0x20 + dAtA[i] = 0x28 } if m.TimeoutHeight != 0 { i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.TimeoutHeight)) @@ -12602,7 +12602,7 @@ func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error { break } } - case 4: + case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field SomeNewField", wireType) } diff --git a/testutil/testnet/cometrpclock.go b/testutil/testnet/cometrpclock.go deleted file mode 100644 index 17c05440d3e4..000000000000 --- a/testutil/testnet/cometrpclock.go +++ /dev/null @@ -1,100 +0,0 @@ -package testnet - -import ( - "fmt" - "runtime/debug" - "sync" - - "github.com/cometbft/cometbft/node" -) - -// CometBFT v0.37 uses a singleton to manage the RPC "environment". -// v0.38 will not have that restriction, which was removed in commit: -// https://github.com/cometbft/cometbft/commit/3324f49fb7e7b40189726746493e83b82a61b558 -// -// We manage a corresponding global lock to ensure -// we don't attempt to use multiple active RPC servers in one process, -// which would result in unpredictable or incorrect behavior. -// Once the SDK adopts Comet v0.38+, we can remove this global lock mechanism. - -// Our singleton complementing Comet's global RPC state. -var globalCometMu = new(cometRPCMutex) - -type cometRPCMutex struct { - mu sync.Mutex - - prevLockStack []byte -} - -// CometRPCInUseError is returned on a failure to acquire -// the global comet RPC lock. -// -// This type will be removed once the Cosmos SDK adopts CometBFT v0.38 or newer. -type CometRPCInUseError struct { - prevStack []byte -} - -func (e CometRPCInUseError) Error() string { - return fmt.Sprintf(`Failed to acquire global lock for Comet RPC servers. - -If this in a test using t.Parallel(), remove the call to t.Parallel(). - -If this is in a test NOT using t.Parallel, -ensure that other callers call both Stop() and Wait() on the nodes. - -If there are multiple comet instances in one test using RPC servers, -ensure that only one instance has the RPC listener enabled. - -These restrictions will be loosened once cosmos-sdk adopts comet-bft v0.38 or newer. - -Stack where lock was previously acquired: -%s -`, e.prevStack) -} - -// Acquire attempts to acquire the underlying mutex. -// If it cannot be acquired on the first attempt, -// Acquire returns a [CometRPCInUseError] value. -func (m *cometRPCMutex) Acquire() error { - if !m.mu.TryLock() { - // If we can't acquire the lock, - // there is another active comet node using RPC. - // - // This was initially going to be a panic, - // but we can't easily write tests against that since - // the panic occurs in a separate goroutine - // when called through NewNetwork. - // - // Note, reading m.prevLockStack without holding m.mu - // is technically a data race, - // since it is possible that the previous caller was about to unlock. - // Nonetheless, the programmer is responsible for avoiding that situation, - // and a data race during a failure isn't particularly concerning. - return CometRPCInUseError{prevStack: m.prevLockStack} - } - - // Now we hold the lock, so first record the stack when the lock was taken. - m.prevLockStack = debug.Stack() - - return nil -} - -// Release unlocks m depending on n. -// If n is nil, m is unlocked immediately. -// If n is not nil, a new goroutine is created -// and n is released after the node has finished running. -func (m *cometRPCMutex) Release(n *node.Node) { - if n == nil { - m.prevLockStack = nil - m.mu.Unlock() - return - } - - go m.releaseAfterWait(n) -} - -func (m *cometRPCMutex) releaseAfterWait(n *node.Node) { - n.Wait() - m.prevLockStack = nil - m.mu.Unlock() -} diff --git a/testutil/testnet/cometstarter.go b/testutil/testnet/cometstarter.go deleted file mode 100644 index 993e5b447528..000000000000 --- a/testutil/testnet/cometstarter.go +++ /dev/null @@ -1,247 +0,0 @@ -package testnet - -import ( - "errors" - "fmt" - "net" - "os" - "path/filepath" - "syscall" - - "cosmossdk.io/log" - cmtcfg "github.com/cometbft/cometbft/config" - cmted25519 "github.com/cometbft/cometbft/crypto/ed25519" - "github.com/cometbft/cometbft/node" - "github.com/cometbft/cometbft/p2p" - "github.com/cometbft/cometbft/privval" - "github.com/cometbft/cometbft/proxy" - cmttypes "github.com/cometbft/cometbft/types" - - "github.com/cosmos/cosmos-sdk/server" - servercmtlog "github.com/cosmos/cosmos-sdk/server/log" - servertypes "github.com/cosmos/cosmos-sdk/server/types" - genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" -) - -// CometStarter offers a builder-pattern interface to -// starting a Comet instance with an ABCI application running alongside. -// -// As CometStart is more broadly used in the codebase, -// the number of available methods on CometStarter will grow. -type CometStarter struct { - logger log.Logger - app servertypes.ABCI - cfg *cmtcfg.Config - valPrivKey cmted25519.PrivKey - genesis []byte - rootDir string - rpcListen bool - tcpAddrChooser func() string - startTries int -} - -// NewCometStarter accepts a minimal set of arguments to start comet with an ABCI app. -// For further configuration, chain other CometStarter methods before calling Start: -// -// NewCometStarter(...).Logger(...).Start() -func NewCometStarter( - app servertypes.ABCI, - cfg *cmtcfg.Config, - valPrivKey cmted25519.PrivKey, - genesis []byte, - rootDir string, -) *CometStarter { - cfg.SetRoot(rootDir) - - // CometStarter won't work without these settings, - // so set them unconditionally. - cfg.P2P.AllowDuplicateIP = true - cfg.P2P.AddrBookStrict = false - - // For now, we disallow RPC listening. - // Comet v0.37 uses a global value such that multiple comet nodes in one process - // end up contending over one "rpc environment" and only the last-started validator - // will control the RPC service. - // - // The "rpc environment" was removed as a global in - // https://github.com/cometbft/cometbft/commit/3324f49fb7e7b40189726746493e83b82a61b558 - // which is due to land in v0.38. - // - // At that point, we should keep the default as RPC off, - // but we should add a RPCListen method to opt in to enabling it. - - // If RPC.ListenAddress is the default value, clear it. - const defaultRPCListenAddr = "tcp://127.0.0.1:26657" - if cfg.RPC.ListenAddress == defaultRPCListenAddr { - cfg.RPC.ListenAddress = "" - } - - // Then if it was set to anything other than empty or the default value, - // fail with a clear explanation on how to enable RPC. - // The RPCListen method must be used in order to correctly pick an available listen address. - if cfg.RPC.ListenAddress != "" { - panic(fmt.Errorf("NewCometStarter: cfg.RPC.ListenAddress must be empty (but was %q); use (*CometStarter).RPCListen() instead", cfg.RPC.ListenAddress)) - } - - // defaultStartTries is somewhat arbitrary. - // Occasionally TestCometStarter_PortContention would fail with 10 tries, - // and bumping it up to 12 makes it almost never fail. - const defaultStartTries = 12 - return &CometStarter{ - logger: log.NewNopLogger(), - app: app, - cfg: cfg, - genesis: genesis, - valPrivKey: valPrivKey, - rootDir: rootDir, - startTries: defaultStartTries, - } -} - -// Logger sets the logger for s and for the eventual started comet instance. -func (s *CometStarter) Logger(logger log.Logger) *CometStarter { - s.logger = logger - return s -} - -// RPCListen enables the RPC listener service on the underlying Comet node. -// The RPC service must be enabled this way so that s can choose a dynamic port, -// retrying if necessary. -// -// Note that there is a limitation in CometBFT v0.37 that -// prevents more than one RPC server running at a time. -// Once the Cosmos SDK has adopted CometBFT v0.38 or newer, -// that limitation will be removed. -func (s *CometStarter) RPCListen() *CometStarter { - s.rpcListen = true - return s -} - -// Start returns a started Comet node. -func (s *CometStarter) Start() (n *node.Node, err error) { - if s.rpcListen { - if err := globalCometMu.Acquire(); err != nil { - return nil, err - } - - // Wrap this defer in an anonymous function so we don't immediately evaluate - // n, which would always be nil at this point. - defer func() { - globalCometMu.Release(n) - }() - } - - fpv, nodeKey, err := s.initDisk() - if err != nil { - return nil, err - } - - appGenesisProvider := func() (*cmttypes.GenesisDoc, error) { - appGenesis, err := genutiltypes.AppGenesisFromFile(s.cfg.GenesisFile()) - if err != nil { - return nil, err - } - - return appGenesis.ToGenesisDoc() - } - - cmtApp := server.NewCometABCIWrapper(s.app) - for i := 0; i < s.startTries; i++ { - s.cfg.P2P.ListenAddress = s.likelyAvailableAddress() - if s.rpcListen { - s.cfg.RPC.ListenAddress = s.likelyAvailableAddress() - } - - n, err := node.NewNode( - s.cfg, - fpv, - nodeKey, - proxy.NewLocalClientCreator(cmtApp), - appGenesisProvider, - cmtcfg.DefaultDBProvider, - node.DefaultMetricsProvider(s.cfg.Instrumentation), - servercmtlog.CometLoggerWrapper{Logger: s.logger}, - ) - if err != nil { - return nil, fmt.Errorf("failed to create comet node: %w", err) - } - - err = n.Start() - if err == nil { - return n, nil - } - - // Error isn't nil -- if it is EADDRINUSE then we can try again. - if errors.Is(err, syscall.EADDRINUSE) { - continue - } - - // Non-nil error that isn't EADDRINUSE, just return the error. - return nil, err - } - - // If we didn't return a node from inside the loop, - // then we must have exhausted our try limit. - return nil, fmt.Errorf("failed to start a comet node within %d tries", s.startTries) -} - -// initDisk creates the config and data directories on disk, -// and other required files, so that comet and the validator work correctly. -// It also generates a node key for validators. -func (s *CometStarter) initDisk() (cmttypes.PrivValidator, *p2p.NodeKey, error) { - if err := os.MkdirAll(filepath.Join(s.rootDir, "config"), 0o750); err != nil { - return nil, nil, fmt.Errorf("failed to make config directory: %w", err) - } - if err := os.MkdirAll(filepath.Join(s.rootDir, "data"), 0o750); err != nil { - return nil, nil, fmt.Errorf("failed to make data directory: %w", err) - } - - fpv := privval.NewFilePV(s.valPrivKey, s.cfg.PrivValidatorKeyFile(), s.cfg.PrivValidatorStateFile()) - fpv.Save() - - if err := os.WriteFile(s.cfg.GenesisFile(), s.genesis, 0o600); err != nil { - return nil, nil, fmt.Errorf("failed to write genesis file: %w", err) - } - - nodeKey, err := p2p.LoadOrGenNodeKey(s.cfg.NodeKeyFile()) - if err != nil { - return nil, nil, err - } - - return fpv, nodeKey, nil -} - -// TCPAddrChooser sets the function to use when selecting a (likely to be free) -// TCP address for comet's P2P port. -// -// This should only be used when testing CometStarter. -// -// It must return a string in format "tcp://IP:PORT". -func (s *CometStarter) TCPAddrChooser(fn func() string) *CometStarter { - s.tcpAddrChooser = fn - return s -} - -// likelyAvailableAddress provides a TCP address that is likely to be available -// for comet or other processes to listen on. -// -// Generally, it is better to directly provide a net.Listener that is already bound to an address, -// but unfortunately comet does not offer that as part of its API. -// Instead, we locally bind to :0 and then report that as a "likely available" port. -// If another process steals that port before our comet instance can bind to it, -// the Start method handles retries. -func (s *CometStarter) likelyAvailableAddress() string { - // If s.TCPAddrChooser was called, use that implementation. - if s.tcpAddrChooser != nil { - return s.tcpAddrChooser() - } - - // Fall back to attempting a random port. - ln, err := net.Listen("tcp", "127.0.0.1:0") - if err != nil { - panic(fmt.Errorf("failed to bind to random port: %w", err)) - } - - defer ln.Close() - return "tcp://" + ln.Addr().String() -} diff --git a/testutil/testnet/delegator.go b/testutil/testnet/delegator.go deleted file mode 100644 index 5ed8ef0ed6d5..000000000000 --- a/testutil/testnet/delegator.go +++ /dev/null @@ -1,59 +0,0 @@ -package testnet - -import ( - "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" -) - -// DelegatorPrivKeys is a slice of secp256k1.PrivKey. -type DelegatorPrivKeys []*secp256k1.PrivKey - -// NewDelegatorPrivKeysreturns a DelegatorPrivKeys of length n, -// where each set of keys is dynamically generated. -func NewDelegatorPrivKeys(n int) DelegatorPrivKeys { - dpk := make(DelegatorPrivKeys, n) - - for i := range dpk { - dpk[i] = secp256k1.GenPrivKey() - } - - return dpk -} - -// BaseAccounts returns the base accounts corresponding to the delegators' public keys. -func (dpk DelegatorPrivKeys) BaseAccounts() BaseAccounts { - ba := make(BaseAccounts, len(dpk)) - - for i, pk := range dpk { - pubKey := pk.PubKey() - - const accountNumber = 0 - const sequenceNumber = 0 - - ba[i] = authtypes.NewBaseAccount( - pubKey.Address().Bytes(), pubKey, accountNumber, sequenceNumber, - ) - } - - return ba -} - -// BaseAccounts is a slice of [*authtypes.BaseAccount]. -type BaseAccounts []*authtypes.BaseAccount - -// Balances creates a slice of [banktypes.Balance] for each account in ba, -// where each balance has an identical Coins value of the singleBalance argument. -func (ba BaseAccounts) Balances(singleBalance sdk.Coins) []banktypes.Balance { - balances := make([]banktypes.Balance, len(ba)) - - for i, b := range ba { - balances[i] = banktypes.Balance{ - Address: b.GetAddress().String(), - Coins: singleBalance, - } - } - - return balances -} diff --git a/testutil/testnet/doc.go b/testutil/testnet/doc.go deleted file mode 100644 index 55d4dbe441d4..000000000000 --- a/testutil/testnet/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Package testnet provides APIs for easily create and configure -// validators, genesis files, and comet instances, -// to support testing app chain instances in-process. -package testnet diff --git a/testutil/testnet/genesis.go b/testutil/testnet/genesis.go deleted file mode 100644 index c4c6eb3578b4..000000000000 --- a/testutil/testnet/genesis.go +++ /dev/null @@ -1,527 +0,0 @@ -package testnet - -import ( - "context" - "encoding/json" - "fmt" - "strconv" - "time" - - "cosmossdk.io/math" - cmttypes "github.com/cometbft/cometbft/types" - - "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" - "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/tx/signing" - authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" - - authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" - distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" -) - -// GenesisBuilder enables constructing a genesis file, -// following a builder pattern. -// -// None of the methods on GenesisBuilder return an error, -// choosing instead to panic. -// GenesisBuilder is only intended for use in tests, -// where inputs are predetermined and expected to succeed. -type GenesisBuilder struct { - amino *codec.LegacyAmino - codec *codec.ProtoCodec - - // The value used in ChainID. - // Some other require this value, - // so store it as a field instead of re-parsing it from JSON. - chainID string - - // The outer JSON object. - // Most data goes into app_state, but there are some top-level fields. - outer map[string]json.RawMessage - - // Many of GenesisBuilder's methods operate on the app_state JSON object, - // so we track that separately and nest it inside outer upon a call to JSON(). - appState map[string]json.RawMessage - - gentxs []sdk.Tx -} - -// NewGenesisBuilder returns an initialized GenesisBuilder. -// -// The returned GenesisBuilder has an initial height of 1 -// and a genesis_time of the current time when the function was called. -func NewGenesisBuilder() *GenesisBuilder { - ir := codectypes.NewInterfaceRegistry() - cryptocodec.RegisterInterfaces(ir) - stakingtypes.RegisterInterfaces(ir) - banktypes.RegisterInterfaces(ir) - authtypes.RegisterInterfaces(ir) - pCodec := codec.NewProtoCodec(ir) - - return &GenesisBuilder{ - amino: codec.NewLegacyAmino(), - codec: pCodec, - - outer: map[string]json.RawMessage{ - "initial_height": json.RawMessage(`"1"`), - "genesis_time": json.RawMessage( - strconv.AppendQuote(nil, time.Now().UTC().Format(time.RFC3339Nano)), - ), - }, - appState: map[string]json.RawMessage{}, - } -} - -// GenTx emulates the gentx CLI, creating a message to create a validator -// represented by val, with "amount" self delegation, -// and signed by privVal. -func (b *GenesisBuilder) GenTx(privVal secp256k1.PrivKey, val cmttypes.GenesisValidator, amount sdk.Coin) *GenesisBuilder { - if b.chainID == "" { - panic(fmt.Errorf("(*GenesisBuilder).GenTx must not be called before (*GenesisBuilder).ChainID")) - } - - pubKey, err := cryptocodec.FromCmtPubKeyInterface(val.PubKey) - if err != nil { - panic(err) - } - - // Produce the create validator message. - msg, err := stakingtypes.NewMsgCreateValidator( - privVal.PubKey().Address().Bytes(), - pubKey, - amount, - stakingtypes.Description{ - Moniker: "TODO", - }, - stakingtypes.CommissionRates{ - Rate: sdk.MustNewDecFromStr("0.1"), - MaxRate: sdk.MustNewDecFromStr("0.2"), - MaxChangeRate: sdk.MustNewDecFromStr("0.01"), - }, - math.OneInt(), - ) - if err != nil { - panic(err) - } - - if err := msg.Validate(); err != nil { - panic(err) - } - - txConf := authtx.NewTxConfig(b.codec, authtx.DefaultSignModes) - - txb := txConf.NewTxBuilder() - if err := txb.SetMsgs(msg); err != nil { - panic(err) - } - - const signMode = signing.SignMode_SIGN_MODE_DIRECT - - // Need to set the signature object on the tx builder first, - // otherwise we end up signing a different total message - // compared to what gets eventually verified. - if err := txb.SetSignatures( - signing.SignatureV2{ - PubKey: privVal.PubKey(), - Data: &signing.SingleSignatureData{ - SignMode: signMode, - }, - }, - ); err != nil { - panic(err) - } - - // Generate bytes to be signed. - bytesToSign, err := authsigning.GetSignBytesAdapter( - context.Background(), - txConf.SignModeHandler(), - signing.SignMode_SIGN_MODE_DIRECT, - authsigning.SignerData{ - ChainID: b.chainID, - PubKey: privVal.PubKey(), - Address: sdk.MustBech32ifyAddressBytes("cosmos", privVal.PubKey().Address()), // TODO: don't hardcode cosmos1! - - // No account or sequence number for gentx. - }, - txb.GetTx(), - ) - if err != nil { - panic(err) - } - - // Produce the signature. - signed, err := privVal.Sign(bytesToSign) - if err != nil { - panic(err) - } - - // Set the signature on the builder. - if err := txb.SetSignatures( - signing.SignatureV2{ - PubKey: privVal.PubKey(), - Data: &signing.SingleSignatureData{ - SignMode: signMode, - Signature: signed, - }, - }, - ); err != nil { - panic(err) - } - - b.gentxs = append(b.gentxs, txb.GetTx()) - - return b -} - -// ChainID sets the genesis's "chain_id" field. -func (b *GenesisBuilder) ChainID(id string) *GenesisBuilder { - b.chainID = id - - var err error - b.outer["chain_id"], err = json.Marshal(id) - if err != nil { - panic(err) - } - - return b -} - -// GenesisTime sets the genesis's "genesis_time" field. -// Note that [NewGenesisBuilder] sets the genesis time to the current time by default. -func (b *GenesisBuilder) GenesisTime(t time.Time) *GenesisBuilder { - var err error - b.outer["genesis_time"], err = json.Marshal(t.Format(time.RFC3339Nano)) - if err != nil { - panic(err) - } - return b -} - -// InitialHeight sets the genesis's "initial_height" field to h. -// Note that [NewGenesisBuilder] sets the initial height to 1 by default. -func (b *GenesisBuilder) InitialHeight(h int64) *GenesisBuilder { - var err error - b.outer["initial_height"], err = json.Marshal(strconv.FormatInt(h, 10)) - if err != nil { - panic(err) - } - return b -} - -// AuthParams sets the auth params on the genesis. -func (b *GenesisBuilder) AuthParams(params authtypes.Params) *GenesisBuilder { - var err error - b.appState[authtypes.ModuleName], err = json.Marshal(map[string]any{ - "params": params, - }) - if err != nil { - panic(err) - } - - return b -} - -// DefaultAuthParams calls b.AuthParams with [authtypes.DefaultParams], -// as a convenience so that callers do not have to import the authtypes package. -func (b *GenesisBuilder) DefaultAuthParams() *GenesisBuilder { - return b.AuthParams(authtypes.DefaultParams()) -} - -// Consensus sets the consensus parameters and initial validators. -// -// If params is nil, [cmttypes.DefaultConsensusParams] is used. -func (b *GenesisBuilder) Consensus(params *cmttypes.ConsensusParams, vals CometGenesisValidators) *GenesisBuilder { - if params == nil { - params = cmttypes.DefaultConsensusParams() - } - - var err error - b.outer[consensusparamtypes.ModuleName], err = (&genutiltypes.ConsensusGenesis{ - Params: params, - Validators: vals.ToComet(), - }).MarshalJSON() - if err != nil { - panic(err) - } - - return b -} - -// Staking sets the staking parameters, validators, and delegations on the genesis. -// -// This also modifies the bank state's balances to include the bonded pool balance. -func (b *GenesisBuilder) Staking( - params stakingtypes.Params, - vals StakingValidators, - delegations []stakingtypes.Delegation, -) *GenesisBuilder { - var err error - b.appState[stakingtypes.ModuleName], err = b.codec.MarshalJSON( - stakingtypes.NewGenesisState(params, vals.ToStakingType(), delegations), - ) - if err != nil { - panic(err) - } - - // Modify bank state for bonded pool. - - var coins sdk.Coins - for _, v := range vals { - coins = coins.Add(sdk.NewCoin(sdk.DefaultBondDenom, v.V.Tokens)) - } - - bondedPoolBalance := banktypes.Balance{ - Address: authtypes.NewModuleAddress(stakingtypes.BondedPoolName).String(), - Coins: coins, - } - - // get bank types genesis, add account - - bankGenesis := banktypes.GetGenesisStateFromAppState(b.codec, b.appState) - bankGenesis.Balances = append(bankGenesis.Balances, bondedPoolBalance) - - b.appState[banktypes.ModuleName], err = b.codec.MarshalJSON(bankGenesis) - if err != nil { - panic(err) - } - - return b -} - -// StakingWithDefaultParams calls b.Staking, providing [stakingtypes.DefaultParams] -// so that callers don't necessarily have to import [stakingtypes]. -func (b *GenesisBuilder) StakingWithDefaultParams(vals StakingValidators, delegations []stakingtypes.Delegation) *GenesisBuilder { - return b.Staking(stakingtypes.DefaultParams(), vals, delegations) -} - -// DefaultStaking is shorthand for b.StakingWithDefaultParams with nil validators and delegations. -func (b *GenesisBuilder) DefaultStaking() *GenesisBuilder { - return b.StakingWithDefaultParams(nil, nil) -} - -// Banking sets the banking genesis state. -func (b *GenesisBuilder) Banking( - params banktypes.Params, - balances []banktypes.Balance, - totalSupply sdk.Coins, - denomMetadata []banktypes.Metadata, - sendEnabled []banktypes.SendEnabled, -) *GenesisBuilder { - var err error - b.appState[banktypes.ModuleName], err = b.codec.MarshalJSON( - banktypes.NewGenesisState( - params, - balances, - totalSupply, - denomMetadata, - sendEnabled, - ), - ) - if err != nil { - panic(err) - } - return b -} - -// BankingWithDefaultParams calls b.Banking with [banktypes.DefaultParams], -// so that callers don't necessarily have to import [banktypes]. -func (b *GenesisBuilder) BankingWithDefaultParams( - balances []banktypes.Balance, - totalSupply sdk.Coins, - denomMetadata []banktypes.Metadata, - sendEnabled []banktypes.SendEnabled, -) *GenesisBuilder { - return b.Banking( - banktypes.DefaultParams(), - balances, - totalSupply, - denomMetadata, - sendEnabled, - ) -} - -// Mint sets the mint genesis state. -func (b *GenesisBuilder) Mint(m minttypes.Minter, p minttypes.Params) *GenesisBuilder { - var err error - b.appState[minttypes.ModuleName], err = b.codec.MarshalJSON( - minttypes.NewGenesisState(m, p), - ) - if err != nil { - panic(err) - } - return b -} - -// DefaultMint calls b.Mint with [minttypes.DefaultInitialMinter] and [minttypes.DefaultParams]. -func (b *GenesisBuilder) DefaultMint() *GenesisBuilder { - return b.Mint(minttypes.DefaultInitialMinter(), minttypes.DefaultParams()) -} - -// Slashing sets the slashing genesis state. -func (b *GenesisBuilder) Slashing( - params slashingtypes.Params, - si []slashingtypes.SigningInfo, - mb []slashingtypes.ValidatorMissedBlocks, -) *GenesisBuilder { - var err error - b.appState[slashingtypes.ModuleName], err = b.codec.MarshalJSON( - slashingtypes.NewGenesisState(params, si, mb), - ) - if err != nil { - panic(err) - } - return b -} - -// SlashingWithDefaultParams calls b.Slashing with [slashingtypes.DefaultParams], -// so that callers don't necessarily have to import [slashingtypes]. -func (b *GenesisBuilder) SlashingWithDefaultParams( - si []slashingtypes.SigningInfo, - mb []slashingtypes.ValidatorMissedBlocks, -) *GenesisBuilder { - return b.Slashing(slashingtypes.DefaultParams(), si, mb) -} - -// DefaultSlashing is shorthand for b.SlashingWithDefaultParams -// with nil signing info and validator missed blocks. -func (b *GenesisBuilder) DefaultSlashing() *GenesisBuilder { - return b.SlashingWithDefaultParams(nil, nil) -} - -// BaseAccounts sets the initial base accounts and balances. -func (b *GenesisBuilder) BaseAccounts(ba BaseAccounts, balances []banktypes.Balance) *GenesisBuilder { - // Logic mostly copied from AddGenesisAccount. - - authGenState := authtypes.GetGenesisStateFromAppState(b.codec, b.appState) - bankGenState := banktypes.GetGenesisStateFromAppState(b.codec, b.appState) - - accs, err := authtypes.UnpackAccounts(authGenState.Accounts) - if err != nil { - panic(err) - } - - for _, a := range ba { - accs = append(accs, a) - } - accs = authtypes.SanitizeGenesisAccounts(accs) - - genAccs, err := authtypes.PackAccounts(accs) - if err != nil { - panic(err) - } - - authGenState.Accounts = genAccs - jAuthGenState, err := b.codec.MarshalJSON(&authGenState) - if err != nil { - panic(err) - } - b.appState[authtypes.ModuleName] = jAuthGenState - - bankGenState.Balances = append(bankGenState.Balances, balances...) - bankGenState.Balances = banktypes.SanitizeGenesisBalances(bankGenState.Balances) - - jBankState, err := b.codec.MarshalJSON(bankGenState) - if err != nil { - panic(err) - } - b.appState[banktypes.ModuleName] = jBankState - return b -} - -func (b *GenesisBuilder) Distribution(g *distributiontypes.GenesisState) *GenesisBuilder { - j, err := b.codec.MarshalJSON(g) - if err != nil { - panic(err) - } - - b.appState[distributiontypes.ModuleName] = j - return b -} - -func (b *GenesisBuilder) DefaultDistribution() *GenesisBuilder { - return b.Distribution(distributiontypes.DefaultGenesisState()) -} - -// JSON returns the map of the genesis after applying some final transformations. -func (b *GenesisBuilder) JSON() map[string]json.RawMessage { - gentxGenesisState := genutiltypes.NewGenesisStateFromTx( - authtx.NewTxConfig(b.codec, authtx.DefaultSignModes).TxJSONEncoder(), - b.gentxs, - ) - - if err := genutiltypes.ValidateGenesis( - gentxGenesisState, - authtx.NewTxConfig(b.codec, authtx.DefaultSignModes).TxJSONDecoder(), - genutiltypes.DefaultMessageValidator, - ); err != nil { - panic(err) - } - - b.appState = genutiltypes.SetGenesisStateInAppState( - b.codec, b.appState, gentxGenesisState, - ) - - appState, err := b.amino.MarshalJSON(b.appState) - if err != nil { - panic(err) - } - - b.outer["app_state"] = appState - - return b.outer -} - -// Encode returns the JSON-encoded, finalized genesis. -func (b *GenesisBuilder) Encode() []byte { - j, err := b.amino.MarshalJSON(b.JSON()) - if err != nil { - panic(err) - } - - return j -} - -// DefaultGenesisBuilderOnlyValidators returns a GenesisBuilder configured only with the given StakingValidators, -// with default parameters everywhere else. -// validatorAmount is the amount to give each validator during gentx. -// -// This is a convenience for the common case of nothing special in the genesis. -// For anything outside of the defaults, -// the longhand form of NewGenesisBuilder().ChainID(chainID)... should be used. -func DefaultGenesisBuilderOnlyValidators( - chainID string, - sv StakingValidators, - validatorAmount sdk.Coin, -) *GenesisBuilder { - cmtVals := make(CometGenesisValidators, len(sv)) - for i := range sv { - cmtVals[i] = sv[i].C - } - - b := NewGenesisBuilder(). - ChainID(chainID). - DefaultAuthParams(). - Consensus(nil, cmtVals). - BaseAccounts(sv.BaseAccounts(), nil). - StakingWithDefaultParams(nil, nil). - BankingWithDefaultParams(sv.Balances(), nil, nil, nil). - DefaultDistribution(). - DefaultMint(). - SlashingWithDefaultParams(nil, nil) - - for _, v := range sv { - b.GenTx(*v.PK.Del, v.C.V, sdk.NewCoin(sdk.DefaultBondDenom, sdk.DefaultPowerReduction)) - } - - return b -} diff --git a/testutil/testnet/genesis_test.go b/testutil/testnet/genesis_test.go deleted file mode 100644 index 0947d86d3bd5..000000000000 --- a/testutil/testnet/genesis_test.go +++ /dev/null @@ -1,244 +0,0 @@ -package testnet_test - -import ( - "encoding/base64" - "encoding/json" - "testing" - "time" - - cmted25519 "github.com/cometbft/cometbft/crypto/ed25519" - "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - "github.com/cosmos/cosmos-sdk/testutil/testnet" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/bech32" - "github.com/stretchr/testify/require" -) - -func TestGenesisBuilder_GenesisTime(t *testing.T) { - t.Run("defaults to current time", func(t *testing.T) { - before := time.Now() - time.Sleep(time.Millisecond) // So that the genesis time will be strictly after "before". - gb := testnet.NewGenesisBuilder() - time.Sleep(time.Millisecond) // So that the genesis time will be strictly before "after". - after := time.Now() - - var gts string - require.NoError(t, json.Unmarshal(gb.JSON()["genesis_time"], >s)) - - gt, err := time.Parse(time.RFC3339Nano, gts) - require.NoError(t, err) - - require.True(t, gt.After(before)) - require.True(t, after.After(gt)) - }) - - t.Run("can be set to arbitrary time", func(t *testing.T) { - want := time.Date(2023, 3, 27, 9, 50, 23, 0, time.UTC) - - gb := testnet.NewGenesisBuilder().GenesisTime(want) - - var gts string - require.NoError(t, json.Unmarshal(gb.JSON()["genesis_time"], >s)) - - gt, err := time.Parse(time.RFC3339Nano, gts) - require.NoError(t, err) - - require.True(t, gt.Equal(want)) - }) -} - -func TestGenesisBuilder_InitialHeight(t *testing.T) { - t.Run("defaults to 1", func(t *testing.T) { - var ih string - require.NoError( - t, - json.Unmarshal( - testnet.NewGenesisBuilder().JSON()["initial_height"], - &ih, - ), - ) - - require.Equal(t, ih, "1") - }) - - t.Run("can be set to arbitrary value", func(t *testing.T) { - var ih string - require.NoError( - t, - json.Unmarshal( - testnet.NewGenesisBuilder().InitialHeight(12345).JSON()["initial_height"], - &ih, - ), - ) - - require.Equal(t, ih, "12345") - }) -} - -func TestGenesisBuilder_ChainID(t *testing.T) { - // No default. - gb := testnet.NewGenesisBuilder() - m := gb.JSON() - _, ok := m["chain_id"] - require.False(t, ok) - - var id string - require.NoError( - t, - json.Unmarshal( - gb.ChainID("my-chain").JSON()["chain_id"], - &id, - ), - ) - require.Equal(t, id, "my-chain") -} - -// Use known keys and addresses to assert that correct validator and delegator keys -// occur in the expected locations (i.e. we didn't mistakenly swap the keys anywhere). -func TestGenesisBuilder_GentxAddresses(t *testing.T) { - const valSecret0 = "val-secret-0" - const valAddr0 = "3F3B076353767F046477A6E0982F808C24D1870A" - const valPubKey0 = "ZhVhrOUHnUwYw/GlBSBrw/0X6A261gchCRYkAxGF2jk=" - valKey0 := cmted25519.GenPrivKeyFromSecret([]byte(valSecret0)) - if addr := valKey0.PubKey().Address().String(); addr != valAddr0 { - t.Fatalf("unexpected address %q for validator key 0 (expected %q)", addr, valAddr0) - } - if pub := base64.StdEncoding.EncodeToString(valKey0.PubKey().Bytes()); pub != valPubKey0 { - t.Fatalf("unexpected public key %q for validator key 0 (expected %q)", pub, valAddr0) - } - - const delSecret0 = "del-secret-0" - const delAddr0 = "30D7E04DA313C31B59A46408494B4272F0A9A256" - const delPubKey0 = "Aol+ZF9xBuZmYJrT1QFLpZBvSfr/zEKifWyg0Xi1tsFV" - const delAccAddr0 = "cosmos1xrt7qndrz0p3kkdyvsyyjj6zwtc2ngjky8dcpe" - delKey0 := secp256k1.GenPrivKeyFromSecret([]byte(delSecret0)) - if addr := delKey0.PubKey().Address().String(); addr != delAddr0 { - t.Fatalf("unexpected address %q for delegator key 0 (expected %q)", addr, delAddr0) - } - if pub := base64.StdEncoding.EncodeToString(delKey0.PubKey().Bytes()); pub != delPubKey0 { - t.Fatalf("unexpected public key %q for delegator key 0 (expected %q)", pub, delAddr0) - } - da, err := bech32.ConvertAndEncode("cosmos", delKey0.PubKey().Address().Bytes()) - require.NoError(t, err) - if da != delAccAddr0 { - t.Fatalf("unexpected account address %q for delegator key 0 (expected %q)", da, delAccAddr0) - } - - valPKs := testnet.ValidatorPrivKeys{ - &testnet.ValidatorPrivKey{ - Val: valKey0, - Del: delKey0, - }, - } - cmtVals := valPKs.CometGenesisValidators() - stakingVals := cmtVals.StakingValidators() - valBaseAccounts := stakingVals.BaseAccounts() - - b := testnet.NewGenesisBuilder(). - ChainID("my-test-chain"). - DefaultAuthParams(). - Consensus(nil, cmtVals). - BaseAccounts(valBaseAccounts, nil). - StakingWithDefaultParams(stakingVals, nil) - - for i, v := range valPKs { - b.GenTx(*v.Del, cmtVals[i].V, sdk.NewCoin(sdk.DefaultBondDenom, sdk.DefaultPowerReduction)) - } - - var g struct { - Consensus struct { - Validators []struct { - Address string `json:"address"` - PubKey struct { - Value string `json:"value"` - } `json:"pub_key"` - } `json:"validators"` - } `json:"consensus"` - - AppState struct { - Genutil struct { - GenTxs []struct { - Body struct { - Messages []struct { - Type string `json:"@type"` - DelegatorAddress string `json:"delegator_address"` - ValidatorAddress string `json:"validator_address"` - PubKey struct { - Key string `json:"key"` - } `json:"pubkey"` - } `json:"messages"` - } `json:"body"` - AuthInfo struct { - SignerInfos []struct { - PublicKey struct { - Key string `json:"key"` - } `json:"public_key"` - } `json:"signer_infos"` - } `json:"auth_info"` - } `json:"gen_txs"` - } `json:"genutil"` - - Auth struct { - Accounts []struct { - Address string `json:"address"` - PubKey struct { - Key string `json:"key"` - } `json:"pub_key"` - } `json:"accounts"` - } `json:"auth"` - } `json:"app_state"` - } - if err := json.Unmarshal(b.Encode(), &g); err != nil { - t.Fatal(err) - } - - // Validator encoded as expected. - vals := g.Consensus.Validators - require.Equal(t, vals[0].Address, valAddr0) - require.Equal(t, vals[0].PubKey.Value, valPubKey0) - - // Public keys on gentx message match correct keys (no ed25519/secp256k1 mismatch). - gentxs := g.AppState.Genutil.GenTxs - require.Equal(t, gentxs[0].Body.Messages[0].PubKey.Key, valPubKey0) - require.Equal(t, gentxs[0].AuthInfo.SignerInfos[0].PublicKey.Key, delPubKey0) - - // The only base account in this genesis, matches the secp256k1 key. - acct := g.AppState.Auth.Accounts[0] - require.Equal(t, acct.Address, delAccAddr0) - require.Equal(t, acct.PubKey.Key, delPubKey0) -} - -func ExampleGenesisBuilder() { - const nVals = 4 - - // Generate random private keys for validators. - valPKs := testnet.NewValidatorPrivKeys(nVals) - - // Produce the comet representation of those validators. - cmtVals := valPKs.CometGenesisValidators() - - stakingVals := cmtVals.StakingValidators() - - // Configure a new genesis builder - // with a fairly thorough set of defaults. - // - // If you only ever need defaults, you can use DefaultGenesisBuilderOnlyValidators(). - b := testnet.NewGenesisBuilder(). - ChainID("my-chain-id"). - DefaultAuthParams(). - Consensus(nil, cmtVals). - BaseAccounts(stakingVals.BaseAccounts(), nil). - DefaultStaking(). - BankingWithDefaultParams(stakingVals.Balances(), nil, nil, nil). - DefaultDistribution(). - DefaultMint(). - DefaultSlashing() - - for i := range stakingVals { - b.GenTx(*valPKs[i].Del, cmtVals[i].V, sdk.NewCoin(sdk.DefaultBondDenom, sdk.DefaultPowerReduction)) - } - - // Now, you can access b.JSON() if you need to make further modifications - // not (yet) supported by the GenesisBuilder API, - // or you can use b.Encode() for the serialzed JSON of the genesis. -} diff --git a/testutil/testnet/network.go b/testutil/testnet/network.go deleted file mode 100644 index ecba45fa0580..000000000000 --- a/testutil/testnet/network.go +++ /dev/null @@ -1,116 +0,0 @@ -package testnet - -import ( - "errors" - "fmt" - "sync" - - "github.com/cometbft/cometbft/p2p" -) - -// NewNetwork concurrently calls createCometStarter, nVals times; -// then it returns a slice of started comet nodes, -// in order corresponding with the number passed to createCometStarter. -// The returned nodes will all be peered together, -// by dialing each node's [github.com/cometbft/cometbft/p2p/pex.Reactor] to each other. -// -// Every node is attempted to be started, -// and any errors collected are joined together and returned. -// -// In the event of errors, a non-nil Nodes slice may still be returned -// and some elements may be nil. -// Callers should call [Nodes.Stop] and [Nodes.Wait] to perform cleanup, -// regardless of the returned error. -func NewNetwork(nVals int, createCometStarter func(int) *CometStarter) (Nodes, error) { - // The ordered slice of nodes; correct indexing is important. - // The creator goroutines will write directly into this slice. - nodes := make(Nodes, nVals) - - // Every node will be started in its own goroutine. - // We collect the switches so that each node can dial every other node. - switchCh := make(chan *p2p.Switch, nVals) - errCh := make(chan error, nVals) - - var wg sync.WaitGroup - // Start goroutines to populate nodes slice and notify as each node is available. - for i := 0; i < nVals; i++ { - wg.Add(1) - go func(i int) { - defer wg.Done() - - n, err := createCometStarter(i).Start() - if err != nil { - errCh <- fmt.Errorf("failed to start node %d: %w", i, err) - return - } - - // Notify that the new node's switch is available, so this node can be - // peered with the other nodes. - switchCh <- n.Switch() - - // And assign the node into its correct index in the ordered slice. - nodes[i] = n - }(i) - } - - // Once all the creation goroutines are complete, close the channels, - // to signal to the collection goroutines. - go func() { - wg.Wait() - close(errCh) - close(switchCh) - }() - - joinPeersDone := make(chan struct{}) - go joinPeers(switchCh, joinPeersDone) - - finalErrCh := make(chan error, 1) - go collectErrors(errCh, finalErrCh) - - // If there were any errors, return them. - // And return any set nodes, so that they can be cleaned up properly. - if err := <-finalErrCh; err != nil { - return nodes, err - } - - // No errors, so wait for peer joining to complete - // before returning the ordered nodes. - <-joinPeersDone - return nodes, nil -} - -// collectErrors collects all errors that arrive on the in channel, -// joins them, then sends the joined final error on the out channel. -func collectErrors(in <-chan error, out chan<- error) { - var errs []error - for err := range in { - errs = append(errs, err) - } - - var res error - if len(errs) > 0 { - res = errors.Join(errs...) - } - out <- res -} - -// joinPeers collects each switch arriving on newSwitches; -// each time a new switch arrives, it dials every previously seen switch. -// -// This allows each node to be started independently and concurrently -// without predetermined p2p ports. -func joinPeers(newSwitches <-chan *p2p.Switch, done chan<- struct{}) { - defer close(done) - - var readySwitches []*p2p.Switch - for newSwitch := range newSwitches { - newNetAddr := newSwitch.NetAddress() - for _, s := range readySwitches { - // For every new switch, connect with all the previously seen switches. - // It might not be necessary to dial in both directions, but it shouldn't hurt. - _ = s.DialPeerWithAddress(newNetAddr) - _ = newSwitch.DialPeerWithAddress(s.NetAddress()) - } - readySwitches = append(readySwitches, newSwitch) - } -} diff --git a/testutil/testnet/nodehelpers.go b/testutil/testnet/nodehelpers.go deleted file mode 100644 index dee10aeb7f30..000000000000 --- a/testutil/testnet/nodehelpers.go +++ /dev/null @@ -1,43 +0,0 @@ -package testnet - -import ( - "fmt" - "time" - - "github.com/cometbft/cometbft/node" -) - -// WaitForNodeHeight blocks until the node's consensus state reports -// a last height equal to or greater than desiredHeight. -// If totalWait has elapsed and the desired height has not been reached, -// an error is returned. -func WaitForNodeHeight(n *node.Node, desiredHeight int64, totalWait time.Duration) error { - const backOff = 100 * time.Millisecond - attempts := int64(totalWait / backOff) - - // In Comet 0.37, the consensus state was exposed directly on the Node. - // As of 0.38, the node no longer exposes consensus state, - // but the consensus state is available as a field on the RPC environment. - // - // Luckily, in 0.38 the RPC environment is no longer a package-level singleton, - // so retrieving the RPC environment for a single node should be safe. - env, err := n.ConfigureRPC() - if err != nil { - return fmt.Errorf("failed to configure RPC to reach into consensus state: %w", err) - } - - curHeight := int64(-1) - for i := int64(0); i < attempts; i++ { - curHeight = env.ConsensusState.GetState().LastBlockHeight - - if curHeight < desiredHeight { - time.Sleep(backOff) - continue - } - - // Met or exceeded target height. - return nil - } - - return fmt.Errorf("node did not reach desired height %d in %s; only reached height %d", desiredHeight, totalWait, curHeight) -} diff --git a/testutil/testnet/nodes.go b/testutil/testnet/nodes.go deleted file mode 100644 index d47699fc6fe2..000000000000 --- a/testutil/testnet/nodes.go +++ /dev/null @@ -1,70 +0,0 @@ -package testnet - -import ( - "errors" - "fmt" - "time" - - "github.com/cometbft/cometbft/node" -) - -// Nodes is a slice of comet nodes, -// with some additional convenience methods. -// -// Nodes may contain nil elements, -// so that a partially failed call to NewNetwork -// can still be properly cleaned up. -type Nodes []*node.Node - -// Stop stops each node sequentially. -// All errors occurring during stop are returned as a joined error. -// -// Nil elements in ns are skipped. -func (ns Nodes) Stop() error { - var errs []error - for i, n := range ns { - if n == nil { - continue - } - if err := n.Stop(); err != nil { - errs = append(errs, fmt.Errorf("failed to stop node %d: %w", i, err)) - } - } - - if len(errs) > 0 { - return errors.Join(errs...) - } - - return nil -} - -// Wait blocks until every node in ns has completely stopped. -// -// Nil elements in ns are skipped. -func (ns Nodes) Wait() { - for _, n := range ns { - if n == nil { - continue - } - n.Wait() - } -} - -// StopAndWait is shorthand for calling both Stop() and Wait(), -// useful as a deferred call in tests. -func (ns Nodes) StopAndWait() error { - err := ns.Stop() - ns.Wait() - - // TODO(mr): remove this sleep call after we are using a version of Comet - // that includes a fix for https://github.com/cometbft/cometbft/issues/646. - // - // On my machine, this sleep appears to completely eliminate the late file write. - // It also almost always works around https://github.com/cometbft/cometbft/issues/652. - // - // Presumably the fix for those two issues will be included in a v0.37.1 release. - // If not, I assume they will be part of the first v0.38 series release. - time.Sleep(250 * time.Millisecond) - - return err -} diff --git a/testutil/testnet/nodes_test.go b/testutil/testnet/nodes_test.go deleted file mode 100644 index 55fd3f4b8e98..000000000000 --- a/testutil/testnet/nodes_test.go +++ /dev/null @@ -1,29 +0,0 @@ -package testnet_test - -import ( - "testing" - - "github.com/cometbft/cometbft/node" - "github.com/cosmos/cosmos-sdk/testutil/testnet" - "github.com/stretchr/testify/require" -) - -// Nil entries in a Nodes slice don't fail Stop or Wait. -func TestNodes_StopWaitNil(t *testing.T) { - for _, tc := range []struct { - Name string - Nodes []*node.Node - }{ - {Name: "nil slice", Nodes: nil}, - {Name: "slice with nil elements", Nodes: []*node.Node{nil}}, - } { - ns := testnet.Nodes(tc.Nodes) - t.Run(tc.Name, func(t *testing.T) { - require.NoError(t, ns.Stop()) - - // Nothing special to assert about Wait(). - // It should return immediately, without panicking. - ns.Wait() - }) - } -} diff --git a/testutil/testnet/validator.go b/testutil/testnet/validator.go deleted file mode 100644 index 2e795393a5d3..000000000000 --- a/testutil/testnet/validator.go +++ /dev/null @@ -1,187 +0,0 @@ -package testnet - -import ( - "fmt" - - sdkmath "cosmossdk.io/math" - cmted25519 "github.com/cometbft/cometbft/crypto/ed25519" - cmttypes "github.com/cometbft/cometbft/types" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" - "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/bech32" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" -) - -// ValidatorPrivKeys is a slice of [*ValidatorPrivKey]. -type ValidatorPrivKeys []*ValidatorPrivKey - -// ValidatorPrivKey holds a validator key (a comet ed25519 key) -// and the validator's delegator or account key (a Cosmos SDK secp256k1 key). -type ValidatorPrivKey struct { - Val cmted25519.PrivKey - Del *secp256k1.PrivKey -} - -// NewValidatorPrivKeys returns a ValidatorPrivKeys of length n, -// where each set of keys is dynamically generated. -// -// If writing a test where deterministic keys are required, -// the caller should manually construct a slice and assign each key as needed. -func NewValidatorPrivKeys(n int) ValidatorPrivKeys { - vpk := make(ValidatorPrivKeys, n) - - for i := range vpk { - vpk[i] = &ValidatorPrivKey{ - Val: cmted25519.GenPrivKey(), - Del: secp256k1.GenPrivKey(), - } - } - - return vpk -} - -// CometGenesisValidators derives the CometGenesisValidators belonging to vpk. -func (vpk ValidatorPrivKeys) CometGenesisValidators() CometGenesisValidators { - cgv := make(CometGenesisValidators, len(vpk)) - - for i, pk := range vpk { - pubKey := pk.Val.PubKey() - - const votingPower = 1 - cmtVal := cmttypes.NewValidator(pubKey, votingPower) - - cgv[i] = &CometGenesisValidator{ - V: cmttypes.GenesisValidator{ - Address: cmtVal.Address, - PubKey: cmtVal.PubKey, - Power: cmtVal.VotingPower, - Name: fmt.Sprintf("val-%d", i), - }, - PK: pk, - } - } - - return cgv -} - -// CometGenesisValidators is a slice of [*CometGenesisValidator]. -type CometGenesisValidators []*CometGenesisValidator - -// CometGenesisValidator holds a comet GenesisValidator -// and a reference to the ValidatorPrivKey from which the CometGenesisValidator was derived. -type CometGenesisValidator struct { - V cmttypes.GenesisValidator - PK *ValidatorPrivKey -} - -// ToComet returns a new slice of [cmttypes.GenesisValidator], -// useful for some interactions. -func (cgv CometGenesisValidators) ToComet() []cmttypes.GenesisValidator { - vs := make([]cmttypes.GenesisValidator, len(cgv)) - for i, v := range cgv { - vs[i] = v.V - } - return vs -} - -// StakingValidators derives the StakingValidators belonging to cgv. -func (cgv CometGenesisValidators) StakingValidators() StakingValidators { - vals := make(StakingValidators, len(cgv)) - for i, v := range cgv { - pk, err := cryptocodec.FromCmtPubKeyInterface(v.V.PubKey) - if err != nil { - panic(fmt.Errorf("failed to extract comet pub key: %w", err)) - } - - pkAny, err := codectypes.NewAnyWithValue(pk) - if err != nil { - panic(fmt.Errorf("failed to wrap pub key in any type: %w", err)) - } - - vals[i] = &StakingValidator{ - V: stakingtypes.Validator{ - OperatorAddress: sdk.ValAddress(v.V.Address).String(), // TODO: this relies on global bech32 config. - ConsensusPubkey: pkAny, - Status: stakingtypes.Bonded, - Tokens: sdk.DefaultPowerReduction, - DelegatorShares: sdkmath.LegacyOneDec(), - MinSelfDelegation: sdkmath.ZeroInt(), - - // more fields uncopied from testutil/sims/app_helpers.go:220 - }, - C: v, - PK: v.PK, - } - } - - return vals -} - -// StakingValidators is a slice of [*StakingValidator]. -type StakingValidators []*StakingValidator - -// StakingValidator holds a [stakingtypes.Validator], -// and the CometGenesisValidator and ValidatorPrivKey required to derive the StakingValidator. -type StakingValidator struct { - V stakingtypes.Validator - C *CometGenesisValidator - PK *ValidatorPrivKey -} - -// ToStakingType returns a new slice of [stakingtypes.Validator], -// useful for some interactions. -func (sv StakingValidators) ToStakingType() []stakingtypes.Validator { - vs := make([]stakingtypes.Validator, len(sv)) - for i, v := range sv { - vs[i] = v.V - } - return vs -} - -// BaseAccounts returns the BaseAccounts for this set of StakingValidators. -// The base accounts are important for [*GenesisBuilder.BaseAccounts]. -func (sv StakingValidators) BaseAccounts() BaseAccounts { - ba := make(BaseAccounts, len(sv)) - - for i, v := range sv { - const accountNumber = 0 - const sequenceNumber = 0 - - pubKey := v.PK.Del.PubKey() - bech, err := bech32.ConvertAndEncode("cosmos", pubKey.Address().Bytes()) // TODO: this shouldn't be hardcoded to cosmos! - if err != nil { - panic(err) - } - accAddr, err := sdk.AccAddressFromBech32(bech) - if err != nil { - panic(err) - } - ba[i] = authtypes.NewBaseAccount( - accAddr, pubKey, accountNumber, sequenceNumber, - ) - } - - return ba -} - -// Balances returns the balances held by this set of StakingValidators. -func (sv StakingValidators) Balances() []banktypes.Balance { - bals := make([]banktypes.Balance, len(sv)) - - for i, v := range sv { - addr, err := bech32.ConvertAndEncode("cosmos", v.PK.Del.PubKey().Address().Bytes()) // TODO: this shouldn't be hardcoded to cosmos! - if err != nil { - panic(err) - } - bals[i] = banktypes.Balance{ - Address: addr, - Coins: sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, v.V.Tokens)}, - } - } - - return bals -} diff --git a/testutil/types.go b/testutil/types.go new file mode 100644 index 000000000000..2e2637ff3a1a --- /dev/null +++ b/testutil/types.go @@ -0,0 +1,25 @@ +package testutil + +// This file contains the list of module names are that maintained by the SDK team. +// Those constants are defined here to be used in the SDK without importing those modules. + +const ( + AuthModuleName = "auth" + AuthzModuleName = "authz" + BankModuleName = "bank" + CircuitModuleName = "circuit" + DistributionModuleName = "distribution" + EvidenceModuleName = "evidence" + FeegrantModuleName = "feegrant" + GovModuleName = "gov" + GroupModuleName = "group" + MintModuleName = "mint" + NFTModuleName = "nft" + ParamsModuleName = "params" + ProtocolPoolModuleName = "protocolpool" + SlashingModuleName = "slashing" + StakingModuleName = "staking" + AuthTxConfigDepinjectModuleName = "tx" + UpgradeModuleName = "upgrade" + EpochsModuleName = "epochs" +) diff --git a/testutil/x/counter/README.md b/testutil/x/counter/README.md new file mode 100644 index 000000000000..82c1941336dc --- /dev/null +++ b/testutil/x/counter/README.md @@ -0,0 +1,7 @@ +--- +sidebar_position: 1 +--- + +# `x/counter` + +Counter is a module used for testing purposes within the Cosmos SDK. diff --git a/testutil/x/counter/autocli.go b/testutil/x/counter/autocli.go new file mode 100644 index 000000000000..572ec584e773 --- /dev/null +++ b/testutil/x/counter/autocli.go @@ -0,0 +1,34 @@ +package counter + +import ( + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + counterv1 "cosmossdk.io/api/cosmos/counter/v1" +) + +// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. +func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { + return &autocliv1.ModuleOptions{ + Query: &autocliv1.ServiceCommandDescriptor{ + Service: counterv1.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "GetCount", + Use: "count", + Short: "Query the current counter value", + }, + }, + }, + Tx: &autocliv1.ServiceCommandDescriptor{ + Service: counterv1.Msg_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "IncreaseCount", + Use: "increase-count ", + Alias: []string{"increase-counter", "increase", "inc", "bump"}, + Short: "Increase the counter by the specified amount", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "count"}}, + }, + }, + }, + } +} diff --git a/testutil/x/counter/depinject.go b/testutil/x/counter/depinject.go new file mode 100644 index 000000000000..f0c5b67643d5 --- /dev/null +++ b/testutil/x/counter/depinject.go @@ -0,0 +1,76 @@ +package counter + +import ( + "fmt" + "maps" + "slices" + + "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/store" + "cosmossdk.io/depinject" + "cosmossdk.io/depinject/appconfig" + + "github.com/cosmos/cosmos-sdk/testutil/x/counter/keeper" + "github.com/cosmos/cosmos-sdk/testutil/x/counter/types" +) + +var _ depinject.OnePerModuleType = AppModule{} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} + +func init() { + appconfig.RegisterModule( + &types.Module{}, + appconfig.Provide(ProvideModule), + appconfig.Invoke(InvokeSetHooks), + ) +} + +type ModuleInputs struct { + depinject.In + + Config *types.Module + StoreService store.KVStoreService +} + +type ModuleOutputs struct { + depinject.Out + + Keeper *keeper.Keeper + Module appmodule.AppModule +} + +func ProvideModule(in ModuleInputs) ModuleOutputs { + k := keeper.NewKeeper(in.StoreService) + m := NewAppModule(k) + + return ModuleOutputs{ + Keeper: k, + Module: m, + } +} + +func InvokeSetHooks(keeper *keeper.Keeper, counterHooks map[string]types.CounterHooksWrapper) error { + if keeper == nil { + return fmt.Errorf("keeper is nil") + } + if counterHooks == nil { + return fmt.Errorf("counterHooks is nil") + } + + // Default ordering is lexical by module name. + // Explicit ordering can be added to the module config if required. + modNames := slices.Sorted(maps.Keys(counterHooks)) + var multiHooks types.MultiCounterHooks + for _, modName := range modNames { + hook, ok := counterHooks[modName] + if !ok { + return fmt.Errorf("can't find hooks for module %s", modName) + } + multiHooks = append(multiHooks, hook) + } + + keeper.SetHooks(multiHooks) + return nil +} diff --git a/testutil/x/counter/keeper/hooks.go b/testutil/x/counter/keeper/hooks.go new file mode 100644 index 000000000000..5b847bf95c6b --- /dev/null +++ b/testutil/x/counter/keeper/hooks.go @@ -0,0 +1,14 @@ +package keeper + +import ( + "context" +) + +type Hooks struct { + AfterCounterIncreased bool +} + +func (h *Hooks) AfterIncreaseCount(ctx context.Context, n int64) error { + h.AfterCounterIncreased = true + return nil +} diff --git a/testutil/x/counter/keeper/keeper.go b/testutil/x/counter/keeper/keeper.go new file mode 100644 index 000000000000..52d8c226c9d0 --- /dev/null +++ b/testutil/x/counter/keeper/keeper.go @@ -0,0 +1,106 @@ +package keeper + +import ( + "context" + "errors" + "fmt" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "cosmossdk.io/collections" + "cosmossdk.io/core/store" + + "github.com/cosmos/cosmos-sdk/testutil/x/counter/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +type Keeper struct { + storeService store.KVStoreService + + CountStore collections.Item[int64] + + hooks types.CounterHooks +} + +func NewKeeper(storeService store.KVStoreService) *Keeper { + sb := collections.NewSchemaBuilder(storeService) + return &Keeper{ + storeService: storeService, + CountStore: collections.NewItem(sb, collections.NewPrefix(0), "count", collections.Int64Value), + } +} + +// Querier + +var _ types.QueryServer = Keeper{} + +// GetCount queries the x/counter count +func (k Keeper) GetCount(ctx context.Context, _ *types.QueryGetCountRequest) (*types.QueryGetCountResponse, error) { + count, err := k.CountStore.Get(ctx) + if err != nil { + if errors.Is(err, collections.ErrNotFound) { + return &types.QueryGetCountResponse{TotalCount: 0}, nil + } else { + return nil, status.Error(codes.Internal, err.Error()) + } + } + + return &types.QueryGetCountResponse{TotalCount: count}, nil +} + +// MsgServer + +var _ types.MsgServer = Keeper{} + +func (k Keeper) IncreaseCount(ctx context.Context, msg *types.MsgIncreaseCounter) (*types.MsgIncreaseCountResponse, error) { + var num int64 + num, err := k.CountStore.Get(ctx) + if err != nil { + if errors.Is(err, collections.ErrNotFound) { + num = 0 + } else { + return nil, err + } + } + + sdkCtx := sdk.UnwrapSDKContext(ctx) + + if err := k.CountStore.Set(sdkCtx, num+msg.Count); err != nil { + return nil, err + } + + if err := k.Hooks().AfterIncreaseCount(sdkCtx, num+msg.Count); err != nil { + return nil, err + } + + sdkCtx.EventManager().EmitEvent(sdk.NewEvent( + "increase_counter", + sdk.NewAttribute("signer", msg.Signer), + sdk.NewAttribute("new count", fmt.Sprint(num+msg.Count))), + ) + + return &types.MsgIncreaseCountResponse{ + NewCount: num + msg.Count, + }, nil +} + +// Hooks gets the hooks for counter Keeper +func (k *Keeper) Hooks() types.CounterHooks { + if k.hooks == nil { + // return a no-op implementation if no hooks are set + return types.MultiCounterHooks{} + } + + return k.hooks +} + +// SetHooks sets the hooks for counter +func (k *Keeper) SetHooks(gh types.CounterHooks) *Keeper { + if k.hooks != nil { + panic("cannot set governance hooks twice") + } + + k.hooks = gh + return k +} diff --git a/testutil/x/counter/module.go b/testutil/x/counter/module.go new file mode 100644 index 000000000000..54b0123a1aea --- /dev/null +++ b/testutil/x/counter/module.go @@ -0,0 +1,47 @@ +package counter + +import ( + "google.golang.org/grpc" + + "cosmossdk.io/core/appmodule" + + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/testutil/x/counter/keeper" + "github.com/cosmos/cosmos-sdk/testutil/x/counter/types" +) + +var _ appmodule.AppModule = AppModule{} + +// AppModule implements an application module +type AppModule struct { + keeper *keeper.Keeper +} + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// RegisterServices registers module services. +func (am AppModule) RegisterServices(registrar grpc.ServiceRegistrar) error { + types.RegisterMsgServer(registrar, am.keeper) + types.RegisterQueryServer(registrar, am.keeper) + return nil +} + +// NewAppModule creates a new AppModule object +func NewAppModule(keeper *keeper.Keeper) AppModule { + return AppModule{ + keeper: keeper, + } +} + +// ConsensusVersion implements HasConsensusVersion +func (AppModule) ConsensusVersion() uint64 { return 1 } + +// Name returns the module's name. +// Deprecated: kept for legacy reasons. +func (AppModule) Name() string { return types.ModuleName } + +// RegisterInterfaces registers interfaces and implementations of the bank module. +func (AppModule) RegisterInterfaces(registrar codectypes.InterfaceRegistry) { + types.RegisterInterfaces(registrar) +} diff --git a/testutil/x/counter/testutil/expected_keepers_mocks.go b/testutil/x/counter/testutil/expected_keepers_mocks.go new file mode 100644 index 000000000000..9d59980a087f --- /dev/null +++ b/testutil/x/counter/testutil/expected_keepers_mocks.go @@ -0,0 +1,229 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: x/bank/types/expected_keepers.go + +// Package testutil is a generated GoMock package. +package testutil + +import ( + reflect "reflect" + + types0 "github.com/cosmos/cosmos-sdk/x/auth/types" + + types "github.com/cosmos/cosmos-sdk/types" + gomock "go.uber.org/mock/gomock" +) + +// MockAccountKeeper is a mock of AccountKeeper interface. +type MockAccountKeeper struct { + ctrl *gomock.Controller + recorder *MockAccountKeeperMockRecorder +} + +// MockAccountKeeperMockRecorder is the mock recorder for MockAccountKeeper. +type MockAccountKeeperMockRecorder struct { + mock *MockAccountKeeper +} + +// NewMockAccountKeeper creates a new mock instance. +func NewMockAccountKeeper(ctrl *gomock.Controller) *MockAccountKeeper { + mock := &MockAccountKeeper{ctrl: ctrl} + mock.recorder = &MockAccountKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockAccountKeeper) EXPECT() *MockAccountKeeperMockRecorder { + return m.recorder +} + +// GetAccount mocks base method. +func (m *MockAccountKeeper) GetAccount(ctx types.Context, addr types.AccAddress) types.AccountI { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAccount", ctx, addr) + ret0, _ := ret[0].(types.AccountI) + return ret0 +} + +// GetAccount indicates an expected call of GetAccount. +func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetAccount), ctx, addr) +} + +// GetAllAccounts mocks base method. +func (m *MockAccountKeeper) GetAllAccounts(ctx types.Context) []types.AccountI { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAllAccounts", ctx) + ret0, _ := ret[0].([]types.AccountI) + return ret0 +} + +// GetAllAccounts indicates an expected call of GetAllAccounts. +func (mr *MockAccountKeeperMockRecorder) GetAllAccounts(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllAccounts", reflect.TypeOf((*MockAccountKeeper)(nil).GetAllAccounts), ctx) +} + +// GetModuleAccount mocks base method. +func (m *MockAccountKeeper) GetModuleAccount(ctx types.Context, moduleName string) types0.ModuleAccountI { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetModuleAccount", ctx, moduleName) + ret0, _ := ret[0].(types0.ModuleAccountI) + return ret0 +} + +// GetModuleAccount indicates an expected call of GetModuleAccount. +func (mr *MockAccountKeeperMockRecorder) GetModuleAccount(ctx, moduleName interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAccount), ctx, moduleName) +} + +// GetModuleAccountAndPermissions mocks base method. +func (m *MockAccountKeeper) GetModuleAccountAndPermissions(ctx types.Context, moduleName string) (types0.ModuleAccountI, []string) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetModuleAccountAndPermissions", ctx, moduleName) + ret0, _ := ret[0].(types0.ModuleAccountI) + ret1, _ := ret[1].([]string) + return ret0, ret1 +} + +// GetModuleAccountAndPermissions indicates an expected call of GetModuleAccountAndPermissions. +func (mr *MockAccountKeeperMockRecorder) GetModuleAccountAndPermissions(ctx, moduleName interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAccountAndPermissions", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAccountAndPermissions), ctx, moduleName) +} + +// GetModuleAddress mocks base method. +func (m *MockAccountKeeper) GetModuleAddress(moduleName string) types.AccAddress { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetModuleAddress", moduleName) + ret0, _ := ret[0].(types.AccAddress) + return ret0 +} + +// GetModuleAddress indicates an expected call of GetModuleAddress. +func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(moduleName interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAddress", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAddress), moduleName) +} + +// GetModuleAddressAndPermissions mocks base method. +func (m *MockAccountKeeper) GetModuleAddressAndPermissions(moduleName string) (types.AccAddress, []string) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetModuleAddressAndPermissions", moduleName) + ret0, _ := ret[0].(types.AccAddress) + ret1, _ := ret[1].([]string) + return ret0, ret1 +} + +// GetModuleAddressAndPermissions indicates an expected call of GetModuleAddressAndPermissions. +func (mr *MockAccountKeeperMockRecorder) GetModuleAddressAndPermissions(moduleName interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAddressAndPermissions", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAddressAndPermissions), moduleName) +} + +// GetModulePermissions mocks base method. +func (m *MockAccountKeeper) GetModulePermissions() map[string]types0.PermissionsForAddress { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetModulePermissions") + ret0, _ := ret[0].(map[string]types0.PermissionsForAddress) + return ret0 +} + +// GetModulePermissions indicates an expected call of GetModulePermissions. +func (mr *MockAccountKeeperMockRecorder) GetModulePermissions() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModulePermissions", reflect.TypeOf((*MockAccountKeeper)(nil).GetModulePermissions)) +} + +// HasAccount mocks base method. +func (m *MockAccountKeeper) HasAccount(ctx types.Context, addr types.AccAddress) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "HasAccount", ctx, addr) + ret0, _ := ret[0].(bool) + return ret0 +} + +// HasAccount indicates an expected call of HasAccount. +func (mr *MockAccountKeeperMockRecorder) HasAccount(ctx, addr interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HasAccount", reflect.TypeOf((*MockAccountKeeper)(nil).HasAccount), ctx, addr) +} + +// IterateAccounts mocks base method. +func (m *MockAccountKeeper) IterateAccounts(ctx types.Context, process func(types.AccountI) bool) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "IterateAccounts", ctx, process) +} + +// IterateAccounts indicates an expected call of IterateAccounts. +func (mr *MockAccountKeeperMockRecorder) IterateAccounts(ctx, process interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateAccounts", reflect.TypeOf((*MockAccountKeeper)(nil).IterateAccounts), ctx, process) +} + +// NewAccount mocks base method. +func (m *MockAccountKeeper) NewAccount(arg0 types.Context, arg1 types.AccountI) types.AccountI { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "NewAccount", arg0, arg1) + ret0, _ := ret[0].(types.AccountI) + return ret0 +} + +// NewAccount indicates an expected call of NewAccount. +func (mr *MockAccountKeeperMockRecorder) NewAccount(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewAccount", reflect.TypeOf((*MockAccountKeeper)(nil).NewAccount), arg0, arg1) +} + +// NewAccountWithAddress mocks base method. +func (m *MockAccountKeeper) NewAccountWithAddress(ctx types.Context, addr types.AccAddress) types.AccountI { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "NewAccountWithAddress", ctx, addr) + ret0, _ := ret[0].(types.AccountI) + return ret0 +} + +// NewAccountWithAddress indicates an expected call of NewAccountWithAddress. +func (mr *MockAccountKeeperMockRecorder) NewAccountWithAddress(ctx, addr interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewAccountWithAddress", reflect.TypeOf((*MockAccountKeeper)(nil).NewAccountWithAddress), ctx, addr) +} + +// SetAccount mocks base method. +func (m *MockAccountKeeper) SetAccount(ctx types.Context, acc types.AccountI) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetAccount", ctx, acc) +} + +// SetAccount indicates an expected call of SetAccount. +func (mr *MockAccountKeeperMockRecorder) SetAccount(ctx, acc interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetAccount", reflect.TypeOf((*MockAccountKeeper)(nil).SetAccount), ctx, acc) +} + +// SetModuleAccount mocks base method. +func (m *MockAccountKeeper) SetModuleAccount(ctx types.Context, macc types0.ModuleAccountI) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetModuleAccount", ctx, macc) +} + +// SetModuleAccount indicates an expected call of SetModuleAccount. +func (mr *MockAccountKeeperMockRecorder) SetModuleAccount(ctx, macc interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetModuleAccount", reflect.TypeOf((*MockAccountKeeper)(nil).SetModuleAccount), ctx, macc) +} + +// ValidatePermissions mocks base method. +func (m *MockAccountKeeper) ValidatePermissions(macc types0.ModuleAccountI) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ValidatePermissions", macc) + ret0, _ := ret[0].(error) + return ret0 +} + +// ValidatePermissions indicates an expected call of ValidatePermissions. +func (mr *MockAccountKeeperMockRecorder) ValidatePermissions(macc interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatePermissions", reflect.TypeOf((*MockAccountKeeper)(nil).ValidatePermissions), macc) +} diff --git a/testutil/x/counter/types/codec.go b/testutil/x/counter/types/codec.go new file mode 100644 index 000000000000..e843f46b452c --- /dev/null +++ b/testutil/x/counter/types/codec.go @@ -0,0 +1,16 @@ +package types + +import ( + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" +) + +func RegisterInterfaces(registrar codectypes.InterfaceRegistry) { + registrar.RegisterImplementations( + (*sdk.Msg)(nil), + &MsgIncreaseCounter{}, + ) + + msgservice.RegisterMsgServiceDesc(registrar, &_Msg_serviceDesc) +} diff --git a/testutil/x/counter/types/expected_keepers.go b/testutil/x/counter/types/expected_keepers.go new file mode 100644 index 000000000000..d4bc4e5dc218 --- /dev/null +++ b/testutil/x/counter/types/expected_keepers.go @@ -0,0 +1,12 @@ +package types + +import "context" + +type CounterHooks interface { + AfterIncreaseCount(ctx context.Context, newCount int64) error +} + +type CounterHooksWrapper struct{ CounterHooks } + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (CounterHooksWrapper) IsOnePerModuleType() {} diff --git a/testutil/x/counter/types/hooks.go b/testutil/x/counter/types/hooks.go new file mode 100644 index 000000000000..5d5e475188c3 --- /dev/null +++ b/testutil/x/counter/types/hooks.go @@ -0,0 +1,26 @@ +package types + +import ( + "context" + "errors" +) + +var _ CounterHooks = MultiCounterHooks{} + +// MultiCounterHooks is a slice of hooks to be called in sequence. +type MultiCounterHooks []CounterHooks + +// NewMultiCounterHooks returns a MultiCounterHooks from a list of CounterHooks +func NewMultiCounterHooks(hooks ...CounterHooks) MultiCounterHooks { + return hooks +} + +// AfterIncreaseCount calls AfterIncreaseCount on all hooks and collects the errors if any. +func (ch MultiCounterHooks) AfterIncreaseCount(ctx context.Context, newCount int64) error { + var errs error + for i := range ch { + errs = errors.Join(errs, ch[i].AfterIncreaseCount(ctx, newCount)) + } + + return errs +} diff --git a/testutil/x/counter/types/keys.go b/testutil/x/counter/types/keys.go new file mode 100644 index 000000000000..a1a1cbc2fbf9 --- /dev/null +++ b/testutil/x/counter/types/keys.go @@ -0,0 +1,9 @@ +package types + +const ( + // ModuleName defines the name of the x/consensus module. + ModuleName = "counter" + + // StoreKey defines the module's store key. + StoreKey = ModuleName +) diff --git a/testutil/x/counter/types/module.pb.go b/testutil/x/counter/types/module.pb.go new file mode 100644 index 000000000000..37b734e319bc --- /dev/null +++ b/testutil/x/counter/types/module.pb.go @@ -0,0 +1,322 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/counter/module/v1/module.proto + +package types + +import ( + _ "cosmossdk.io/depinject/appconfig/v1alpha1" + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Module is the config object of the counter module. +type Module struct { + // authority defines the custom module authority. If not set, defaults to the governance module. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` +} + +func (m *Module) Reset() { *m = Module{} } +func (m *Module) String() string { return proto.CompactTextString(m) } +func (*Module) ProtoMessage() {} +func (*Module) Descriptor() ([]byte, []int) { + return fileDescriptor_917f5b05718fd5a3, []int{0} +} +func (m *Module) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Module) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Module.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 *Module) XXX_Merge(src proto.Message) { + xxx_messageInfo_Module.Merge(m, src) +} +func (m *Module) XXX_Size() int { + return m.Size() +} +func (m *Module) XXX_DiscardUnknown() { + xxx_messageInfo_Module.DiscardUnknown(m) +} + +var xxx_messageInfo_Module proto.InternalMessageInfo + +func (m *Module) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func init() { + proto.RegisterType((*Module)(nil), "cosmos.counter.module.v1.Module") +} + +func init() { + proto.RegisterFile("cosmos/counter/module/v1/module.proto", fileDescriptor_917f5b05718fd5a3) +} + +var fileDescriptor_917f5b05718fd5a3 = []byte{ + // 201 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4d, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0xce, 0x2f, 0xcd, 0x2b, 0x49, 0x2d, 0xd2, 0xcf, 0xcd, 0x4f, 0x29, 0xcd, + 0x49, 0xd5, 0x2f, 0x33, 0x84, 0xb2, 0xf4, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0x24, 0x20, 0xca, + 0xf4, 0xa0, 0xca, 0xf4, 0xa0, 0x92, 0x65, 0x86, 0x52, 0x0a, 0x50, 0x03, 0x12, 0x0b, 0x0a, 0xf4, + 0xcb, 0x0c, 0x13, 0x73, 0x0a, 0x32, 0x12, 0x51, 0xf5, 0x2a, 0xc5, 0x73, 0xb1, 0xf9, 0x82, 0xf9, + 0x42, 0x32, 0x5c, 0x9c, 0x89, 0xa5, 0x25, 0x19, 0xf9, 0x45, 0x99, 0x25, 0x95, 0x12, 0x8c, 0x0a, + 0x8c, 0x1a, 0x9c, 0x41, 0x08, 0x01, 0x2b, 0xf3, 0x5d, 0x07, 0xa6, 0xdd, 0x62, 0x34, 0xe4, 0xd2, + 0x4f, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x87, 0xbb, 0x0e, 0x44, 0xe9, + 0x16, 0xa7, 0x64, 0xeb, 0x97, 0xa4, 0x16, 0x97, 0x94, 0x96, 0x64, 0xe6, 0xe8, 0x57, 0xc0, 0xdc, + 0xec, 0xe4, 0x7f, 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, 0xa6, 0x24, 0x1a, + 0xa5, 0x5f, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x76, 0xb8, 0x31, 0x20, 0x00, 0x00, 0xff, + 0xff, 0x76, 0xab, 0xc7, 0x18, 0x1d, 0x01, 0x00, 0x00, +} + +func (m *Module) 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 *Module) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Module) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintModule(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintModule(dAtA []byte, offset int, v uint64) int { + offset -= sovModule(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Module) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovModule(uint64(l)) + } + return n +} + +func sovModule(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozModule(x uint64) (n int) { + return sovModule(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Module) 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 ErrIntOverflowModule + } + 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: Module: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Module: 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 ErrIntOverflowModule + } + 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 ErrInvalidLengthModule + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModule(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModule + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipModule(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, ErrIntOverflowModule + } + 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, ErrIntOverflowModule + } + 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, ErrIntOverflowModule + } + 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, ErrInvalidLengthModule + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupModule + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthModule + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthModule = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowModule = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupModule = fmt.Errorf("proto: unexpected end of group") +) diff --git a/testutil/x/counter/types/query.pb.go b/testutil/x/counter/types/query.pb.go new file mode 100644 index 000000000000..963fc6804ab9 --- /dev/null +++ b/testutil/x/counter/types/query.pb.go @@ -0,0 +1,511 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/counter/v1/query.proto + +package types + +import ( + context "context" + fmt "fmt" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// QueryGetCountRequest defines the request type for querying x/mock count. +type QueryGetCountRequest struct { +} + +func (m *QueryGetCountRequest) Reset() { *m = QueryGetCountRequest{} } +func (m *QueryGetCountRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetCountRequest) ProtoMessage() {} +func (*QueryGetCountRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_bd21727562626c9f, []int{0} +} +func (m *QueryGetCountRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetCountRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetCountRequest.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 *QueryGetCountRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetCountRequest.Merge(m, src) +} +func (m *QueryGetCountRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetCountRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetCountRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetCountRequest proto.InternalMessageInfo + +// QueryGetCountResponse defines the response type for querying x/mock count. +type QueryGetCountResponse struct { + TotalCount int64 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` +} + +func (m *QueryGetCountResponse) Reset() { *m = QueryGetCountResponse{} } +func (m *QueryGetCountResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetCountResponse) ProtoMessage() {} +func (*QueryGetCountResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bd21727562626c9f, []int{1} +} +func (m *QueryGetCountResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetCountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetCountResponse.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 *QueryGetCountResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetCountResponse.Merge(m, src) +} +func (m *QueryGetCountResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetCountResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetCountResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetCountResponse proto.InternalMessageInfo + +func (m *QueryGetCountResponse) GetTotalCount() int64 { + if m != nil { + return m.TotalCount + } + return 0 +} + +func init() { + proto.RegisterType((*QueryGetCountRequest)(nil), "cosmos.counter.v1.QueryGetCountRequest") + proto.RegisterType((*QueryGetCountResponse)(nil), "cosmos.counter.v1.QueryGetCountResponse") +} + +func init() { proto.RegisterFile("cosmos/counter/v1/query.proto", fileDescriptor_bd21727562626c9f) } + +var fileDescriptor_bd21727562626c9f = []byte{ + // 220 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4d, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0xce, 0x2f, 0xcd, 0x2b, 0x49, 0x2d, 0xd2, 0x2f, 0x33, 0xd4, 0x2f, 0x2c, + 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x84, 0x48, 0xeb, 0x41, 0xa5, + 0xf5, 0xca, 0x0c, 0x95, 0xc4, 0xb8, 0x44, 0x02, 0x41, 0x2a, 0xdc, 0x53, 0x4b, 0x9c, 0x41, 0xa2, + 0x41, 0xa9, 0x85, 0xa5, 0xa9, 0xc5, 0x25, 0x4a, 0x16, 0x5c, 0xa2, 0x68, 0xe2, 0xc5, 0x05, 0xf9, + 0x79, 0xc5, 0xa9, 0x42, 0xf2, 0x5c, 0xdc, 0x25, 0xf9, 0x25, 0x89, 0x39, 0xf1, 0x60, 0x43, 0x24, + 0x18, 0x15, 0x18, 0x35, 0x98, 0x83, 0xb8, 0xc0, 0x42, 0x60, 0x85, 0x46, 0x69, 0x5c, 0xac, 0x60, + 0x9d, 0x42, 0xb1, 0x5c, 0x1c, 0x30, 0xdd, 0x42, 0xea, 0x7a, 0x18, 0x56, 0xeb, 0x61, 0xb3, 0x57, + 0x4a, 0x83, 0xb0, 0x42, 0x88, 0x43, 0x9c, 0xfc, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, + 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, + 0x8e, 0x21, 0xca, 0x34, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, 0x1e, + 0x20, 0x20, 0x4a, 0xb7, 0x38, 0x25, 0x5b, 0xbf, 0x24, 0xb5, 0xb8, 0xa4, 0xb4, 0x24, 0x33, 0x47, + 0xbf, 0x02, 0x1e, 0x4c, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0xe0, 0x40, 0x32, 0x06, 0x04, + 0x00, 0x00, 0xff, 0xff, 0x26, 0xa6, 0xde, 0x58, 0x45, 0x01, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // GetCount queries the parameters of x/Counter module. + GetCount(ctx context.Context, in *QueryGetCountRequest, opts ...grpc.CallOption) (*QueryGetCountResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) GetCount(ctx context.Context, in *QueryGetCountRequest, opts ...grpc.CallOption) (*QueryGetCountResponse, error) { + out := new(QueryGetCountResponse) + err := c.cc.Invoke(ctx, "/cosmos.counter.v1.Query/GetCount", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // GetCount queries the parameters of x/Counter module. + GetCount(context.Context, *QueryGetCountRequest) (*QueryGetCountResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) GetCount(ctx context.Context, req *QueryGetCountRequest) (*QueryGetCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetCount not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_GetCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetCountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).GetCount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.counter.v1.Query/GetCount", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).GetCount(ctx, req.(*QueryGetCountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var Query_serviceDesc = _Query_serviceDesc +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.counter.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetCount", + Handler: _Query_GetCount_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/counter/v1/query.proto", +} + +func (m *QueryGetCountRequest) 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 *QueryGetCountRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetCountRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryGetCountResponse) 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 *QueryGetCountResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetCountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.TotalCount != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.TotalCount)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryGetCountRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryGetCountResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TotalCount != 0 { + n += 1 + sovQuery(uint64(m.TotalCount)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryGetCountRequest) 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: QueryGetCountRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetCountRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGetCountResponse) 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: QueryGetCountResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetCountResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalCount", wireType) + } + m.TotalCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalCount |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/testutil/x/counter/types/tx.pb.go b/testutil/x/counter/types/tx.pb.go new file mode 100644 index 000000000000..0c7295ed9cf8 --- /dev/null +++ b/testutil/x/counter/types/tx.pb.go @@ -0,0 +1,611 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/counter/v1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// MsgIncreaseCounter defines a count Msg service counter. +type MsgIncreaseCounter struct { + // signer is the address that controls the module (defaults to x/gov unless overwritten). + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` + // count is the number of times to increment the counter. + Count int64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` +} + +func (m *MsgIncreaseCounter) Reset() { *m = MsgIncreaseCounter{} } +func (m *MsgIncreaseCounter) String() string { return proto.CompactTextString(m) } +func (*MsgIncreaseCounter) ProtoMessage() {} +func (*MsgIncreaseCounter) Descriptor() ([]byte, []int) { + return fileDescriptor_16b86a09a73a7eb5, []int{0} +} +func (m *MsgIncreaseCounter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgIncreaseCounter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgIncreaseCounter.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 *MsgIncreaseCounter) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgIncreaseCounter.Merge(m, src) +} +func (m *MsgIncreaseCounter) XXX_Size() int { + return m.Size() +} +func (m *MsgIncreaseCounter) XXX_DiscardUnknown() { + xxx_messageInfo_MsgIncreaseCounter.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgIncreaseCounter proto.InternalMessageInfo + +func (m *MsgIncreaseCounter) GetSigner() string { + if m != nil { + return m.Signer + } + return "" +} + +func (m *MsgIncreaseCounter) GetCount() int64 { + if m != nil { + return m.Count + } + return 0 +} + +// MsgIncreaseCountResponse is the Msg/Counter response type. +type MsgIncreaseCountResponse struct { + // new_count is the number of times the counter was incremented. + NewCount int64 `protobuf:"varint,1,opt,name=new_count,json=newCount,proto3" json:"new_count,omitempty"` +} + +func (m *MsgIncreaseCountResponse) Reset() { *m = MsgIncreaseCountResponse{} } +func (m *MsgIncreaseCountResponse) String() string { return proto.CompactTextString(m) } +func (*MsgIncreaseCountResponse) ProtoMessage() {} +func (*MsgIncreaseCountResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_16b86a09a73a7eb5, []int{1} +} +func (m *MsgIncreaseCountResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgIncreaseCountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgIncreaseCountResponse.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 *MsgIncreaseCountResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgIncreaseCountResponse.Merge(m, src) +} +func (m *MsgIncreaseCountResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgIncreaseCountResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgIncreaseCountResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgIncreaseCountResponse proto.InternalMessageInfo + +func (m *MsgIncreaseCountResponse) GetNewCount() int64 { + if m != nil { + return m.NewCount + } + return 0 +} + +func init() { + proto.RegisterType((*MsgIncreaseCounter)(nil), "cosmos.counter.v1.MsgIncreaseCounter") + proto.RegisterType((*MsgIncreaseCountResponse)(nil), "cosmos.counter.v1.MsgIncreaseCountResponse") +} + +func init() { proto.RegisterFile("cosmos/counter/v1/tx.proto", fileDescriptor_16b86a09a73a7eb5) } + +var fileDescriptor_16b86a09a73a7eb5 = []byte{ + // 337 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4a, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0xce, 0x2f, 0xcd, 0x2b, 0x49, 0x2d, 0xd2, 0x2f, 0x33, 0xd4, 0x2f, 0xa9, + 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x84, 0xc8, 0xe9, 0x41, 0xe5, 0xf4, 0xca, 0x0c, + 0xa5, 0x24, 0x21, 0x42, 0xf1, 0x60, 0x05, 0xfa, 0x50, 0x79, 0x30, 0x47, 0x4a, 0x1c, 0x6a, 0x52, + 0x6e, 0x71, 0x3a, 0xc8, 0x94, 0xdc, 0xe2, 0x74, 0xa8, 0x84, 0x60, 0x62, 0x6e, 0x66, 0x5e, 0xbe, + 0x3e, 0x98, 0x84, 0x08, 0x29, 0x75, 0x32, 0x72, 0x09, 0xf9, 0x16, 0xa7, 0x7b, 0xe6, 0x25, 0x17, + 0xa5, 0x26, 0x16, 0xa7, 0x3a, 0x43, 0x2c, 0x10, 0x32, 0xe0, 0x62, 0x2b, 0xce, 0x4c, 0xcf, 0x4b, + 0x2d, 0x92, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x74, 0x92, 0xb8, 0xb4, 0x45, 0x57, 0x04, 0x6a, 0x89, + 0x63, 0x4a, 0x4a, 0x51, 0x6a, 0x71, 0x71, 0x70, 0x49, 0x51, 0x66, 0x5e, 0x7a, 0x10, 0x54, 0x9d, + 0x90, 0x08, 0x17, 0x2b, 0xd8, 0x75, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0xcc, 0x41, 0x10, 0x8e, 0x95, + 0x76, 0xd3, 0xf3, 0x0d, 0x5a, 0x50, 0x25, 0x5d, 0xcf, 0x37, 0x68, 0x49, 0x43, 0xcc, 0xd0, 0x2d, + 0x4e, 0xc9, 0xd6, 0xcf, 0x84, 0xda, 0x19, 0x0f, 0xf5, 0x95, 0x92, 0x39, 0x97, 0x04, 0xba, 0x53, + 0x82, 0x52, 0x8b, 0x0b, 0xf2, 0xf3, 0x8a, 0x53, 0x85, 0xa4, 0xb9, 0x38, 0xf3, 0x52, 0xcb, 0x21, + 0x4a, 0xc1, 0x6e, 0x62, 0x0e, 0xe2, 0xc8, 0x4b, 0x2d, 0x07, 0x2b, 0x32, 0x2a, 0xe4, 0x62, 0xf6, + 0x2d, 0x4e, 0x17, 0x4a, 0xe6, 0xe2, 0x45, 0xd1, 0x2c, 0xa4, 0xaa, 0x87, 0x11, 0x6e, 0x7a, 0x98, + 0x9e, 0x95, 0xd2, 0x26, 0x42, 0x19, 0xcc, 0x21, 0x52, 0xac, 0x0d, 0xcf, 0x37, 0x68, 0x31, 0x3a, + 0xf9, 0x9f, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, + 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x69, 0x7a, 0x66, 0x49, + 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0x3c, 0x4a, 0xe1, 0x9e, 0x2e, 0x49, 0x2d, 0x2e, + 0x29, 0x2d, 0xc9, 0xcc, 0xd1, 0xaf, 0x80, 0x47, 0x74, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, + 0x38, 0x3e, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x95, 0x33, 0x6d, 0xbf, 0x07, 0x02, 0x00, + 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // IncreaseCount increments the counter by the specified amount. + IncreaseCount(ctx context.Context, in *MsgIncreaseCounter, opts ...grpc.CallOption) (*MsgIncreaseCountResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) IncreaseCount(ctx context.Context, in *MsgIncreaseCounter, opts ...grpc.CallOption) (*MsgIncreaseCountResponse, error) { + out := new(MsgIncreaseCountResponse) + err := c.cc.Invoke(ctx, "/cosmos.counter.v1.Msg/IncreaseCount", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // IncreaseCount increments the counter by the specified amount. + IncreaseCount(context.Context, *MsgIncreaseCounter) (*MsgIncreaseCountResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) IncreaseCount(ctx context.Context, req *MsgIncreaseCounter) (*MsgIncreaseCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method IncreaseCount not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_IncreaseCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgIncreaseCounter) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).IncreaseCount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.counter.v1.Msg/IncreaseCount", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).IncreaseCount(ctx, req.(*MsgIncreaseCounter)) + } + return interceptor(ctx, in, info, handler) +} + +var Msg_serviceDesc = _Msg_serviceDesc +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.counter.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "IncreaseCount", + Handler: _Msg_IncreaseCount_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/counter/v1/tx.proto", +} + +func (m *MsgIncreaseCounter) 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 *MsgIncreaseCounter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgIncreaseCounter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Count != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Count)) + i-- + dAtA[i] = 0x10 + } + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgIncreaseCountResponse) 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 *MsgIncreaseCountResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgIncreaseCountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.NewCount != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.NewCount)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgIncreaseCounter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Count != 0 { + n += 1 + sovTx(uint64(m.Count)) + } + return n +} + +func (m *MsgIncreaseCountResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.NewCount != 0 { + n += 1 + sovTx(uint64(m.NewCount)) + } + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgIncreaseCounter) 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: MsgIncreaseCounter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgIncreaseCounter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", 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.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + 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 ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Count |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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 *MsgIncreaseCountResponse) 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: MsgIncreaseCountResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgIncreaseCountResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NewCount", wireType) + } + m.NewCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NewCount |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/tools/confix/CHANGELOG.md b/tools/confix/CHANGELOG.md index 902c1f7f60b6..00ee9f0eb810 100644 --- a/tools/confix/CHANGELOG.md +++ b/tools/confix/CHANGELOG.md @@ -31,5 +31,24 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +## [v0.2.0-rc.2](https://github.com/cosmos/cosmos-sdk/releases/tag/tools/confix/v0.2.0-rc.2) - 2025-01-16 + +* [#23238](https://github.com/cosmos/cosmos-sdk/pull/23238) Loosen `app.toml` validation for consistency between baseapp chains and v2 chains. + +## [v0.2.0-rc.1](https://github.com/cosmos/cosmos-sdk/releases/tag/tools/confix/v0.2.0-rc.1) - 2024-12-18 + +* [#21052](https://github.com/cosmos/cosmos-sdk/pull/21052) Add a migration to v2 config. + +## [v0.1.2](https://github.com/cosmos/cosmos-sdk/releases/tag/tools/confix/v0.1.2) - 2024-08-13 + +* [#21202](https://github.com/cosmos/cosmos-sdk/pull/21202) Allow customization of migration `PlanBuilder`. + +## [v0.1.1](https://github.com/cosmos/cosmos-sdk/releases/tag/tools/confix/v0.1.1) - 2023-12-11 + +* [#18496](https://github.com/cosmos/cosmos-sdk/pull/18496) Remove invalid non SDK config from app.toml migration templates. + +## [v0.1.0](https://github.com/cosmos/cosmos-sdk/releases/tag/tools/confix/v0.1.0) - 2023-11-07 + +* [#17904](https://github.com/cosmos/cosmos-sdk/pull/17904) Add `view` command. * [#14568](https://github.com/cosmos/cosmos-sdk/pull/14568) Add `diff` and `home` commands. * [#14342](https://github.com/cosmos/cosmos-sdk/pull/14342) Add `confix` tool to manage configuration files. diff --git a/tools/confix/Makefile b/tools/confix/Makefile index 417b7a7c4933..5c29441e29de 100644 --- a/tools/confix/Makefile +++ b/tools/confix/Makefile @@ -4,9 +4,11 @@ all: confix condiff test confix: go build -mod=readonly ./cmd/confix + @echo "confix binary has been successfully built in tools/confix/confix" condiff: go build -mod=readonly ./cmd/condiff + @echo "condiff binary has been successfully built in tools/confix/condiff" test: go test -mod=readonly -race ./... diff --git a/tools/confix/README.md b/tools/confix/README.md index 19c637ba90b6..00851ede1923 100644 --- a/tools/confix/README.md +++ b/tools/confix/README.md @@ -12,7 +12,7 @@ It is based on the [CometBFT RFC 019](https://github.com/cometbft/cometbft/blob/ ### Add Config Command -To add the confix tool, it's required to add the `ConfigCommand` to your application's root command file (e.g. `simd/cmd/root.go`). +To add the confix tool, it's required to add the `ConfigCommand` to your application's root command file (e.g. `/cmd/root.go`). Import the `confixCmd` package: @@ -23,7 +23,7 @@ import "cosmossdk.io/tools/confix/cmd" Find the following line: ```go -initRootCmd(rootCmd, encodingConfig) +initRootCmd(rootCmd, moduleManager) ``` After that line, add the following: @@ -39,6 +39,11 @@ An implementation example can be found in `simapp`. The command will be available as `simd config`. +:::tip +Using confix directly in the application can have less features than using it standalone. +This is because confix is versioned with the SDK, while `latest` is the standalone version. +::: + ### Using Confix Standalone To use Confix standalone, without having to add it in your application, install it with the following command: @@ -47,11 +52,6 @@ To use Confix standalone, without having to add it in your application, install go install cosmossdk.io/tools/confix/cmd/confix@latest ``` -:::warning -Currently, due to the replace directive in the Confix go.mod, it is not possible to use `go install`. -Building from source or importing in an application is required until that replace directive is removed. -::: - Alternatively, for building from source, simply run `make confix`. The binary will be located in `tools/confix`. ## Usage @@ -98,14 +98,16 @@ confix set ~/.simapp/config/client.toml chain-id "foo-1" # sets the value chain- ### Migrate -Migrate a configuration file to a new version, e.g.: +Migrate a configuration file to a new version, config type defaults to `app.toml`, if you want to change it to `client.toml`, please indicate it by adding the optional parameter, e.g.: ```shell -simd config migrate v0.47 # migrates defaultHome/config/app.toml to the latest v0.47 config +simd config migrate v0.50 # migrates defaultHome/config/app.toml to the latest v0.50 config +simd config migrate v0.50 --client # migrates defaultHome/config/client.toml to the latest v0.50 config ``` ```shell -confix migrate v0.47 ~/.simapp/config/app.toml # migrate ~/.simapp/config/app.toml to the latest v0.47 config +confix migrate v0.50 ~/.simapp/config/app.toml # migrate ~/.simapp/config/app.toml to the latest v0.50 config +confix migrate v0.50 ~/.simapp/config/client.toml --client # migrate ~/.simapp/config/client.toml to the latest v0.50 config ``` ### Diff @@ -114,17 +116,41 @@ Get the diff between a given configuration file and the default configuration fi ```shell simd config diff v0.47 # gets the diff between defaultHome/config/app.toml and the latest v0.47 config +simd config diff v0.47 --client # gets the diff between defaultHome/config/client.toml and the latest v0.47 config ``` ```shell confix diff v0.47 ~/.simapp/config/app.toml # gets the diff between ~/.simapp/config/app.toml and the latest v0.47 config +confix diff v0.47 ~/.simapp/config/client.toml --client # gets the diff between ~/.simapp/config/client.toml and the latest v0.47 config +``` + +### View + +View a configuration file, e.g: + +```shell +simd config view client # views the current app client config +``` + +```shell +confix view ~/.simapp/config/client.toml # views the current app client conf ``` ### Maintainer -At each SDK modification of the default configuration, add the default SDK config under `data/v0.XX-app.toml`. +At each SDK modification of the default configuration, add the default SDK config under `data/vXX-app.toml`. This allows users to use the tool standalone. +### Compatibility + +The recommended standalone version is `latest`, which is using the latest development version of the Confix. + +| SDK Version | Confix Version | +| ----------- | -------------- | +| v0.50 | v0.1.x | +| v0.52 | v0.2.x | +| v2 | v0.2.x | + ## Credits -This project is based on the [CometBFT RFC 019](https://github.com/cometbft/cometbft/blob/5013bc3f4a6d64dcc2bf02ccc002ebc9881c62e4/docs/rfc/rfc-019-config-version.md) and their own implementation of [confix](https://github.com/cometbft/cometbft/blob/v0.36.x/scripts/confix/confix.go). +This project is based on the [CometBFT RFC 019](https://github.com/cometbft/cometbft/blob/5013bc3f4a6d64dcc2bf02ccc002ebc9881c62e4/docs/rfc/rfc-019-config-version.md) and their never released own implementation of [confix](https://github.com/cometbft/cometbft/blob/v0.36.x/scripts/confix/confix.go). diff --git a/tools/confix/cmd/condiff/main.go b/tools/confix/cmd/condiff/main.go index 19fb2769dfb5..5e364d448a09 100644 --- a/tools/confix/cmd/condiff/main.go +++ b/tools/confix/cmd/condiff/main.go @@ -3,8 +3,9 @@ package main import ( "os" - "cosmossdk.io/tools/confix" "github.com/spf13/cobra" + + "cosmossdk.io/tools/confix" ) func main() { diff --git a/tools/confix/cmd/config.go b/tools/confix/cmd/config.go index 8ee2e371a992..2a75ae7e3226 100644 --- a/tools/confix/cmd/config.go +++ b/tools/confix/cmd/config.go @@ -4,7 +4,11 @@ import ( "github.com/spf13/cobra" ) -// ConfigComamnd contains all the confix commands +const ( + tomlSuffix = ".toml" +) + +// ConfigCommand contains all the confix commands // These command can be used to interactively update an application config value. func ConfigCommand() *cobra.Command { cmd := &cobra.Command{ @@ -17,6 +21,7 @@ func ConfigCommand() *cobra.Command { DiffCommand(), GetCommand(), SetCommand(), + ViewCommand(), HomeCommand(), ) diff --git a/tools/confix/cmd/diff.go b/tools/confix/cmd/diff.go index 4dc86dbf16b1..89226a112236 100644 --- a/tools/confix/cmd/diff.go +++ b/tools/confix/cmd/diff.go @@ -1,45 +1,60 @@ package cmd import ( + "errors" "fmt" + "maps" + "path/filepath" + "slices" + "strings" + + "github.com/spf13/cobra" "cosmossdk.io/tools/confix" + "github.com/cosmos/cosmos-sdk/client" - "github.com/spf13/cobra" - "golang.org/x/exp/maps" ) +// DiffCommand creates a new command for comparing configuration files func DiffCommand() *cobra.Command { - return &cobra.Command{ - Use: "diff [target-version] ", - Short: "Outputs all config values that are different from the app.toml defaults.", + cmd := &cobra.Command{ + Use: "diff [target-version] ", + Short: "Outputs all config values that are different from the default.", + Long: "This command compares the specified configuration file (app.toml or client.toml) with the defaults and outputs any differences.", Args: cobra.MinimumNArgs(1), RunE: func(cmd *cobra.Command, args []string) error { - var filename string + var configPath string clientCtx := client.GetClientContextFromCmd(cmd) switch { - case len(args) > 1: - filename = args[1] + configPath = args[1] case clientCtx.HomeDir != "": - filename = fmt.Sprintf("%s/config/app.toml", clientCtx.HomeDir) + configPath = filepath.Join(clientCtx.HomeDir, "config", "app.toml") default: - return fmt.Errorf("must provide a path to the app.toml file") + return errors.New("must provide a path to the app.toml or client.toml") + } + + configType := confix.AppConfigType + if ok, _ := cmd.Flags().GetBool(confix.ClientConfigType); ok { + configPath = strings.ReplaceAll(configPath, "app.toml", "client.toml") // for the case we are using the home dir of client ctx + configType = confix.ClientConfigType + } else if strings.HasSuffix(configPath, "client.toml") { + return errors.New("app.toml file expected, got client.toml, use --client flag to diff client.toml") } targetVersion := args[0] if _, ok := confix.Migrations[targetVersion]; !ok { - return fmt.Errorf("unknown version %q, supported versions are: %q", targetVersion, maps.Keys(confix.Migrations)) + return fmt.Errorf("unknown version %q, supported versions are: %q", targetVersion, slices.Collect(maps.Keys(confix.Migrations))) } - targetVersionFile, err := confix.LoadLocalConfig(targetVersion) + targetVersionFile, err := confix.LoadLocalConfig(targetVersion, configType) if err != nil { - panic(fmt.Errorf("failed to load internal config: %w", err)) + return fmt.Errorf("failed to load internal config: %w", err) } - rawFile, err := confix.LoadConfig(filename) + rawFile, err := confix.LoadConfig(configPath) if err != nil { - return fmt.Errorf("failed to load config: %v", err) + return fmt.Errorf("failed to load config: %w", err) } diff := confix.DiffValues(rawFile, targetVersionFile) @@ -55,4 +70,8 @@ func DiffCommand() *cobra.Command { return nil }, } + + cmd.Flags().Bool(confix.ClientConfigType, false, "diff client.toml instead of app.toml") + + return cmd } diff --git a/tools/confix/cmd/home.go b/tools/confix/cmd/home.go index 21ecdb388498..1210303a1cc4 100644 --- a/tools/confix/cmd/home.go +++ b/tools/confix/cmd/home.go @@ -1,14 +1,16 @@ package cmd import ( - "github.com/cosmos/cosmos-sdk/client" "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" ) func HomeCommand() *cobra.Command { return &cobra.Command{ Use: "home", - Short: "Outputs the string being used as the home path. No home directory is set when using the tool standalone.", + Short: "Outputs the folder used as the binary home. No home directory is set when using the `confix` tool standalone.", + Long: `Outputs the folder used as the binary home. In order to change the home directory path, set the $APPD_HOME environment variable, or use the "--home" flag.`, Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { clientCtx := client.GetClientContextFromCmd(cmd) diff --git a/tools/confix/cmd/migrate.go b/tools/confix/cmd/migrate.go index 18546b200f8a..7e6c01e03401 100644 --- a/tools/confix/cmd/migrate.go +++ b/tools/confix/cmd/migrate.go @@ -2,12 +2,18 @@ package cmd import ( "context" + "errors" "fmt" + "maps" + "path/filepath" + "slices" + "strings" + + "github.com/spf13/cobra" "cosmossdk.io/tools/confix" + "github.com/cosmos/cosmos-sdk/client" - "github.com/spf13/cobra" - "golang.org/x/exp/maps" ) var ( @@ -18,33 +24,49 @@ var ( func MigrateCommand() *cobra.Command { cmd := &cobra.Command{ - Use: "migrate [target-version] (options)", - Short: "Migrate Cosmos SDK app configuration file to the specified version", - Long: `Migrate the contents of the Cosmos SDK app configuration (app.toml) to the specified version. + Use: "migrate [target-version] ", + Short: "Migrate Cosmos SDK configuration file to the specified version", + Long: `Migrate the contents of the Cosmos SDK configuration (app.toml or client.toml) to the specified version. Configuration type is app by default. The output is written in-place unless --stdout is provided. In case of any error in updating the file, no output is written.`, Args: cobra.MinimumNArgs(1), RunE: func(cmd *cobra.Command, args []string) error { - var filename string + var configPath string clientCtx := client.GetClientContextFromCmd(cmd) + + configType := confix.AppConfigType + isClient, _ := cmd.Flags().GetBool(confix.ClientConfigType) + + if isClient { + configType = confix.ClientConfigType + } + switch { case len(args) > 1: - filename = args[1] + configPath = args[1] case clientCtx.HomeDir != "": - filename = fmt.Sprintf("%s/config/app.toml", clientCtx.HomeDir) + suffix := "app.toml" + if isClient { + suffix = "client.toml" + } + configPath = filepath.Join(clientCtx.HomeDir, "config", suffix) default: - return fmt.Errorf("must provide a path to the app.toml file") + return errors.New("must provide a path to the app.toml or client.toml") + } + + if strings.HasSuffix(configPath, "client.toml") && !isClient { + return errors.New("app.toml file expected, got client.toml, use --client flag to migrate client.toml") } targetVersion := args[0] plan, ok := confix.Migrations[targetVersion] if !ok { - return fmt.Errorf("unknown version %q, supported versions are: %q", targetVersion, maps.Keys(confix.Migrations)) + return fmt.Errorf("unknown version %q, supported versions are: %q", targetVersion, slices.Collect(maps.Keys(confix.Migrations))) } - rawFile, err := confix.LoadConfig(filename) + rawFile, err := confix.LoadConfig(configPath) if err != nil { - return fmt.Errorf("failed to load config: %v", err) + return fmt.Errorf("failed to load config: %w", err) } ctx := context.Background() @@ -52,12 +74,15 @@ In case of any error in updating the file, no output is written.`, ctx = confix.WithLogWriter(ctx, cmd.ErrOrStderr()) } - outputPath := filename + outputPath := configPath if FlagStdOut { outputPath = "" } - if err := confix.Upgrade(ctx, plan(rawFile, targetVersion), filename, outputPath, FlagSkipValidate); err != nil { + // get transformation steps and formatDoc in which plan need to be applied + steps, formatDoc := plan(rawFile, targetVersion, configType) + + if err := confix.Upgrade(ctx, steps, formatDoc, configPath, outputPath, FlagSkipValidate); err != nil { return fmt.Errorf("failed to migrate config: %w", err) } @@ -68,6 +93,7 @@ In case of any error in updating the file, no output is written.`, cmd.Flags().BoolVar(&FlagStdOut, "stdout", false, "print the updated config to stdout") cmd.Flags().BoolVar(&FlagVerbose, "verbose", false, "log changes to stderr") cmd.Flags().BoolVar(&FlagSkipValidate, "skip-validate", false, "skip configuration validation (allows to migrate unknown configurations)") + cmd.Flags().Bool(confix.ClientConfigType, false, "migrate client.toml instead of app.toml") return cmd } diff --git a/tools/confix/cmd/migrate_test.go b/tools/confix/cmd/migrate_test.go index 344527c94d66..733f784b73ce 100644 --- a/tools/confix/cmd/migrate_test.go +++ b/tools/confix/cmd/migrate_test.go @@ -1,36 +1,39 @@ package cmd_test import ( - "fmt" + "path/filepath" "strings" "testing" + "gotest.tools/v3/assert" + "cosmossdk.io/tools/confix/cmd" - "github.com/cosmos/cosmos-sdk/client" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - "gotest.tools/v3/assert" ) -func TestMigradeCmd(t *testing.T) { +func TestMigrateCmd(t *testing.T) { clientCtx, cleanup := initClientContext(t) defer cleanup() - _, err := clitestutil.ExecTestCLICmd(client.Context{}, cmd.MigrateCommand(), []string{"v0.0"}) - assert.ErrorContains(t, err, "must provide a path to the app.toml file") - - _, err = clitestutil.ExecTestCLICmd(clientCtx, cmd.MigrateCommand(), []string{"v0.0"}) + _, err := clitestutil.ExecTestCLICmd(clientCtx, cmd.MigrateCommand(), []string{"v0.0"}) assert.ErrorContains(t, err, "unknown version") // clientCtx does not create app.toml, so this should fail _, err = clitestutil.ExecTestCLICmd(clientCtx, cmd.MigrateCommand(), []string{"v0.45"}) assert.ErrorContains(t, err, "no such file or directory") - // try to migrate from client.toml it should fail without --skip-validate - _, err = clitestutil.ExecTestCLICmd(clientCtx, cmd.MigrateCommand(), []string{"v0.46", fmt.Sprintf("%s/config/client.toml", clientCtx.HomeDir)}) + // try to migrate from unsupported.toml it should fail without --skip-validate + _, err = clitestutil.ExecTestCLICmd(clientCtx, cmd.MigrateCommand(), []string{"v0.46", filepath.Join(clientCtx.HomeDir, "config", "unsupported.toml")}) assert.ErrorContains(t, err, "failed to migrate config") - // try to migrate from client.toml - it should work and give us a big diff - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd.MigrateCommand(), []string{"v0.46", fmt.Sprintf("%s/config/client.toml", clientCtx.HomeDir), "--skip-validate", "--verbose"}) + // try to migrate from unsupported.toml - it should work and give us a big diff + out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd.MigrateCommand(), []string{"v0.46", filepath.Join(clientCtx.HomeDir, "config", "unsupported.toml"), "--skip-validate", "--verbose"}) assert.NilError(t, err) assert.Assert(t, strings.Contains(out.String(), "add app-db-backend key")) + + // this should work + out, err = clitestutil.ExecTestCLICmd(clientCtx, cmd.MigrateCommand(), []string{"v0.52", filepath.Join(clientCtx.HomeDir, "config", "client.toml"), "--client", "--verbose"}) + assert.NilError(t, err) + assert.Assert(t, strings.Contains(out.String(), "add keyring-default-keyname key")) } diff --git a/tools/confix/cmd/mutate.go b/tools/confix/cmd/mutate.go index cf3d37454026..9dd4a34ff08f 100644 --- a/tools/confix/cmd/mutate.go +++ b/tools/confix/cmd/mutate.go @@ -4,23 +4,25 @@ import ( "context" "errors" "fmt" + "path/filepath" "strings" - "cosmossdk.io/tools/confix" "github.com/creachadair/tomledit" "github.com/creachadair/tomledit/parser" "github.com/creachadair/tomledit/transform" "github.com/spf13/cobra" + "cosmossdk.io/tools/confix" + "github.com/cosmos/cosmos-sdk/client" ) // SetCommand returns a CLI command to interactively update an application config value. func SetCommand() *cobra.Command { cmd := &cobra.Command{ - Use: "set [config] [key] [value]", + Use: "set ", Short: "Set an application config value", - Long: "Set an application config value. The [config] argument must be the path of the file when using the tool standalone, otherwise it must be the name of the config file without the .toml extension.", + Long: "Set an application config value. The [config] argument must be the path of the file when using the `confix` tool standalone, otherwise it must be the name of the config file without the .toml extension.", Args: cobra.ExactArgs(3), RunE: func(cmd *cobra.Command, args []string) error { filename, inputValue := args[0], args[2] @@ -29,7 +31,7 @@ func SetCommand() *cobra.Command { clientCtx := client.GetClientContextFromCmd(cmd) if clientCtx.HomeDir != "" { - filename = fmt.Sprintf("%s/config/%s.toml", clientCtx.HomeDir, filename) + filename = filepath.Join(clientCtx.HomeDir, "config", filename+tomlSuffix) } plan := transform.Plan{ @@ -71,13 +73,18 @@ func SetCommand() *cobra.Command { ctx = confix.WithLogWriter(ctx, cmd.ErrOrStderr()) } - return confix.Upgrade(ctx, plan, filename, outputPath, FlagSkipValidate) + doc, err := confix.LoadConfig(filename) + if err != nil { + return err + } + + return confix.Upgrade(ctx, plan, doc, filename, outputPath, FlagSkipValidate) }, } cmd.Flags().BoolVar(&FlagStdOut, "stdout", false, "print the updated config to stdout") - cmd.Flags().BoolVar(&FlagVerbose, "verbose", false, "log changes to stderr") - cmd.Flags().BoolVar(&FlagSkipValidate, "skip-validate", false, "skip configuration validation (allows to mutate unknown configurations)") + cmd.Flags().BoolVarP(&FlagVerbose, "verbose", "v", false, "log changes to stderr") + cmd.Flags().BoolVarP(&FlagSkipValidate, "skip-validate", "s", false, "skip configuration validation (allows to mutate unknown configurations)") return cmd } @@ -85,9 +92,9 @@ func SetCommand() *cobra.Command { // GetCommand returns a CLI command to interactively get an application config value. func GetCommand() *cobra.Command { cmd := &cobra.Command{ - Use: "get [config] [key]", + Use: "get ", Short: "Get an application config value", - Long: "Get an application config value. The [config] argument must be the path of the file when using the too standalone, otherwise it must be the name of the config file without the .toml extension.", + Long: "Get an application config value. The [config] argument must be the path of the file when using the `confix` tool standalone, otherwise it must be the name of the config file without the .toml extension.", Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { filename, key := args[0], args[1] @@ -96,7 +103,7 @@ func GetCommand() *cobra.Command { clientCtx := client.GetClientContextFromCmd(cmd) if clientCtx.HomeDir != "" { - filename = fmt.Sprintf("%s/config/%s.toml", clientCtx.HomeDir, filename) + filename = filepath.Join(clientCtx.HomeDir, "config", filename+tomlSuffix) } doc, err := confix.LoadConfig(filename) diff --git a/tools/confix/cmd/mutate_test.go b/tools/confix/cmd/mutate_test.go index 214af6254959..7565b6102d3e 100644 --- a/tools/confix/cmd/mutate_test.go +++ b/tools/confix/cmd/mutate_test.go @@ -3,18 +3,22 @@ package cmd_test import ( "fmt" "os" + "path/filepath" "strings" "testing" + "gotest.tools/v3/assert" + "cosmossdk.io/tools/confix/cmd" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/config" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - "gotest.tools/v3/assert" ) // initClientContext initiates client Context for tests func initClientContext(t *testing.T) (client.Context, func()) { + t.Helper() home := t.TempDir() chainID := "test-chain" clientCtx := client.Context{}. @@ -24,6 +28,8 @@ func initClientContext(t *testing.T) (client.Context, func()) { clientCtx, err := config.ReadFromClientConfig(clientCtx) assert.NilError(t, err) assert.Equal(t, clientCtx.ChainID, chainID) + + _ = os.Link(filepath.Join(home, "config", "client.toml"), filepath.Join(home, "config", "unsupported.toml")) return clientCtx, func() { _ = os.RemoveAll(home) } } diff --git a/tools/confix/cmd/view.go b/tools/confix/cmd/view.go new file mode 100644 index 000000000000..d88c68574057 --- /dev/null +++ b/tools/confix/cmd/view.go @@ -0,0 +1,56 @@ +package cmd + +import ( + "encoding/json" + "fmt" + "os" + "path/filepath" + + "github.com/pelletier/go-toml/v2" + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" +) + +func ViewCommand() *cobra.Command { + flagOutputFormat := "output-format" + + cmd := &cobra.Command{ + Use: "view ", + Short: "View the config file", + Long: "View the config file. The [config] argument must be the path of the file when using the `confix` tool standalone, otherwise it must be the name of the config file without the .toml extension.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + filename := args[0] + + clientCtx := client.GetClientContextFromCmd(cmd) + if clientCtx.HomeDir != "" { + filename = filepath.Join(clientCtx.HomeDir, "config", filename+tomlSuffix) + } + + file, err := os.ReadFile(filename) + if err != nil { + return err + } + + if format, _ := cmd.Flags().GetString(flagOutputFormat); format == "toml" { + cmd.Println(string(file)) + return nil + } + + var v interface{} + if err := toml.Unmarshal(file, &v); err != nil { + return fmt.Errorf("failed to decode config file: %w", err) + } + + e := json.NewEncoder(cmd.OutOrStdout()) + e.SetIndent("", " ") + return e.Encode(v) + }, + } + + // output flag + cmd.Flags().String(flagOutputFormat, "toml", "Output format (json|toml)") + + return cmd +} diff --git a/tools/confix/cmd/view_test.go b/tools/confix/cmd/view_test.go new file mode 100644 index 000000000000..c022af1576ed --- /dev/null +++ b/tools/confix/cmd/view_test.go @@ -0,0 +1,39 @@ +package cmd_test + +import ( + "fmt" + "os" + "strings" + "testing" + + "gotest.tools/v3/assert" + + "cosmossdk.io/tools/confix/cmd" + + "github.com/cosmos/cosmos-sdk/client" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" +) + +func TestViewCmd(t *testing.T) { + clientCtx, cleanup := initClientContext(t) + defer cleanup() + + _, err := clitestutil.ExecTestCLICmd(clientCtx, cmd.ViewCommand(), []string{"unexisting"}) + assert.ErrorContains(t, err, "no such file or directory") + + expectedCfg := fmt.Sprintf("%s/config/client.toml", clientCtx.HomeDir) + bz, err := os.ReadFile(expectedCfg) + assert.NilError(t, err) + + out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd.ViewCommand(), []string{"client"}) + assert.NilError(t, err) + assert.DeepEqual(t, strings.TrimSpace(out.String()), strings.TrimSpace(string(bz))) + + out, err = clitestutil.ExecTestCLICmd(client.Context{}, cmd.ViewCommand(), []string{fmt.Sprintf("%s/config/client.toml", clientCtx.HomeDir)}) + assert.NilError(t, err) + assert.DeepEqual(t, strings.TrimSpace(out.String()), strings.TrimSpace(string(bz))) + + out, err = clitestutil.ExecTestCLICmd(clientCtx, cmd.ViewCommand(), []string{"client", "--output-format", "json"}) + assert.NilError(t, err) + assert.Assert(t, strings.Contains(out.String(), `"chain-id": "test-chain"`)) +} diff --git a/tools/confix/data/v0.45-app.toml b/tools/confix/data/v0.45-app.toml index e6f15079c8cd..7bf5f724f13a 100644 --- a/tools/confix/data/v0.45-app.toml +++ b/tools/confix/data/v0.45-app.toml @@ -44,7 +44,7 @@ halt-time = 0 # It has no bearing on application state pruning which is determined by the # "pruning-*" configurations. # -# Note: Tendermint block pruning is dependant on this parameter in conjunction +# Note: Tendermint block pruning is dependent on this parameter in conjunction # with the unbonding (safety threshold) period, state pruning and state sync # snapshot parameters to determine the correct minimum value of # ResponseCommit.RetainHeight. @@ -99,8 +99,7 @@ prometheus-retention-time = 0 # # Example: # [["chain_id", "cosmoshub-1"]] -global-labels = [ -] +global-labels = [] ############################################################################### ### API Configuration ### @@ -208,7 +207,7 @@ streamers = [] [streamers] [streamers.file] -keys = ["*", ] +keys = ["*"] write_dir = "" prefix = "" @@ -221,10 +220,3 @@ stop-node-on-error = "true" # fsync specifies if call fsync after writing the files. fsync = "false" - -[wasm] -# This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries -query_gas_limit = 300000 -# This is the number of wasm vm instances we keep cached in memory for speed-up -# Warning: this is currently unstable and may lead to crashes, best to keep for 0 unless testing locally -lru_size = 0 diff --git a/tools/confix/data/v0.46-app.toml b/tools/confix/data/v0.46-app.toml index 6dd5e64fbfeb..1274a12543c1 100644 --- a/tools/confix/data/v0.46-app.toml +++ b/tools/confix/data/v0.46-app.toml @@ -43,7 +43,7 @@ halt-time = 0 # It has no bearing on application state pruning which is determined by the # "pruning-*" configurations. # -# Note: Tendermint block pruning is dependant on this parameter in conjunction +# Note: Tendermint block pruning is dependent on this parameter in conjunction # with the unbonding (safety threshold) period, state pruning and state sync # snapshot parameters to determine the correct minimum value of # ResponseCommit.RetainHeight. @@ -108,8 +108,7 @@ prometheus-retention-time = 0 # # Example: # [["chain_id", "cosmoshub-1"]] -global-labels = [ -] +global-labels = [] ############################################################################### ### API Configuration ### @@ -173,7 +172,7 @@ enable-fee-suggestion = false # GasToSuggest defines gas limit when calculating the fee gas-to-suggest = 200000 -# DenomToSuggest defines the defult denom for fee suggestion. +# DenomToSuggest defines the default denom for fee suggestion. # Price must be in minimum-gas-prices. denom-to-suggest = "uatom" @@ -237,7 +236,7 @@ streamers = [] [streamers] [streamers.file] -keys = ["*", ] +keys = ["*"] write_dir = "" prefix = "" @@ -250,10 +249,3 @@ stop-node-on-error = "true" # fsync specifies if call fsync after writing the files. fsync = "false" - -[wasm] -# This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries -query_gas_limit = 300000 -# This is the number of wasm vm instances we keep cached in memory for speed-up -# Warning: this is currently unstable and may lead to crashes, best to keep for 0 unless testing locally -lru_size = 0 diff --git a/tools/confix/data/v0.47-app.toml b/tools/confix/data/v0.47-app.toml index 6f26abc13c09..f06945af069f 100644 --- a/tools/confix/data/v0.47-app.toml +++ b/tools/confix/data/v0.47-app.toml @@ -7,7 +7,7 @@ # The minimum gas prices a validator is willing to accept for processing a # transaction. A transaction's fees must meet the minimum of any denomination -# specified in this config (e.g. 0.25token1;0.0001token2). +# specified in this config (e.g. 0.25token1,0.0001token2). minimum-gas-prices = "0stake" # default: the last 362880 states are kept, pruning at 10 block intervals @@ -43,7 +43,7 @@ halt-time = 0 # It has no bearing on application state pruning which is determined by the # "pruning-*" configurations. # -# Note: Tendermint block pruning is dependant on this parameter in conjunction +# Note: Tendermint block pruning is dependent on this parameter in conjunction # with the unbonding (safety threshold) period, state pruning and state sync # snapshot parameters to determine the correct minimum value of # ResponseCommit.RetainHeight. @@ -59,8 +59,7 @@ inter-block-cache = true # ["message.sender", "message.recipient"] index-events = [] -# IavlCacheSize set the size of the iavl tree cache. -# Default cache size is 50mb. +# IavlCacheSize set the size of the iavl tree cache (in number of nodes). iavl-cache-size = 781250 # IAVLDisableFastNode enables or disables the fast node feature of IAVL. @@ -73,8 +72,7 @@ iavl-lazy-loading = false # AppDBBackend defines the database backend type to use for the application and snapshots DBs. # An empty string indicates that a fallback will be used. -# First fallback is the deprecated compile-time types.DBBackend value. -# Second fallback (if the types.DBBackend also isn't set), is the db-backend value set in Tendermint's config.toml. +# The fallback is the db_backend value set in Tendermint's config.toml. app-db-backend = "" ############################################################################### @@ -108,8 +106,7 @@ prometheus-retention-time = 0 # # Example: # [["chain_id", "cosmoshub-1"]] -global-labels = [ -] +global-labels = [] ############################################################################### ### API Configuration ### @@ -141,6 +138,42 @@ rpc-max-body-bytes = 1000000 # EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk). enabled-unsafe-cors = false +############################################################################### +### Rosetta Configuration ### +############################################################################### + +[rosetta] + +# Enable defines if the Rosetta API server should be enabled. +enable = false + +# Address defines the Rosetta API server to listen on. +address = ":8080" + +# Network defines the name of the blockchain that will be returned by Rosetta. +blockchain = "app" + +# Network defines the name of the network that will be returned by Rosetta. +network = "network" + +# Retries defines the number of retries when connecting to the node before failing. +retries = 3 + +# Offline defines if Rosetta server should run in offline mode. +offline = false + +# EnableDefaultSuggestedFee defines if the server should suggest fee by default. +# If 'construction/medata' is called without gas limit and gas price, +# suggested fee based on gas-to-suggest and denom-to-suggest will be given. +enable-fee-suggestion = false + +# GasToSuggest defines gas limit when calculating the fee +gas-to-suggest = 200000 + +# DenomToSuggest defines the default denom for fee suggestion. +# Price must be in minimum-gas-prices. +denom-to-suggest = "uatom" + ############################################################################### ### gRPC Configuration ### ############################################################################### @@ -201,7 +234,7 @@ streamers = [] [streamers] [streamers.file] -keys = ["*", ] +keys = ["*"] write_dir = "" prefix = "" @@ -226,11 +259,4 @@ fsync = "false" # # Note, this configuration only applies to SDK built-in app-side mempool # implementations. -max-txs = "5000" - -[wasm] -# This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries -query_gas_limit = 300000 -# This is the number of wasm vm instances we keep cached in memory for speed-up -# Warning: this is currently unstable and may lead to crashes, best to keep for 0 unless testing locally -lru_size = 0 +max-txs = 5000 diff --git a/tools/confix/data/v0.47-client.toml b/tools/confix/data/v0.47-client.toml new file mode 100644 index 000000000000..d91250aebe78 --- /dev/null +++ b/tools/confix/data/v0.47-client.toml @@ -0,0 +1,17 @@ +# This is a TOML config file. +# For more information, see https://github.com/toml-lang/toml + +############################################################################### +### Client Configuration ### +############################################################################### + +# The network chain ID +chain-id = "demo" +# The keyring's backend, where the keys are stored (os|file|kwallet|pass|test|memory) +keyring-backend = "os" +# CLI output format (text|json) +output = "text" +# : to Tendermint RPC interface for this chain +node = "tcp://localhost:26657" +# Transaction broadcasting mode (sync|async|block) +broadcast-mode = "sync" \ No newline at end of file diff --git a/tools/confix/data/v0.48-app.toml b/tools/confix/data/v0.50-app.toml similarity index 90% rename from tools/confix/data/v0.48-app.toml rename to tools/confix/data/v0.50-app.toml index 4b997ab00cf8..058f43ec4be1 100644 --- a/tools/confix/data/v0.48-app.toml +++ b/tools/confix/data/v0.50-app.toml @@ -7,9 +7,13 @@ # The minimum gas prices a validator is willing to accept for processing a # transaction. A transaction's fees must meet the minimum of any denomination -# specified in this config (e.g. 0.25token1;0.0001token2). +# specified in this config (e.g. 0.25token1,0.0001token2). minimum-gas-prices = "0stake" +# The maximum gas a query coming over rest/grpc may consume. +# If this is set to zero, the query can consume an unbounded amount of gas. +query-gas-limit = "0" + # default: the last 362880 states are kept, pruning at 10 block intervals # nothing: all historic states will be saved, nothing will be deleted (i.e. archiving node) # everything: 2 latest states will be kept; pruning at 10 block intervals. @@ -43,7 +47,7 @@ halt-time = 0 # It has no bearing on application state pruning which is determined by the # "pruning-*" configurations. # -# Note: CometBFT block pruning is dependant on this parameter in conjunction +# Note: CometBFT block pruning is dependent on this parameter in conjunction # with the unbonding (safety threshold) period, state pruning and state sync # snapshot parameters to determine the correct minimum value of # ResponseCommit.RetainHeight. @@ -66,14 +70,9 @@ iavl-cache-size = 781250 # Default is false. iavl-disable-fastnode = false -# IAVLLazyLoading enable/disable the lazy loading of iavl store. -# Default is false. -iavl-lazy-loading = false - # AppDBBackend defines the database backend type to use for the application and snapshots DBs. # An empty string indicates that a fallback will be used. -# First fallback is the deprecated compile-time types.DBBackend value. -# Second fallback (if the types.DBBackend also isn't set), is the db-backend value set in CometBFT's config.toml. +# The fallback is the db_backend value set in CometBFT's config.toml. app-db-backend = "" ############################################################################### @@ -107,8 +106,18 @@ prometheus-retention-time = 0 # # Example: # [["chain_id", "cosmoshub-1"]] -global-labels = [ -] +global-labels = [] + +# MetricsSink defines the type of metrics sink to use. +metrics-sink = "mem" + +# StatsdAddr defines the address of a statsd server to send metrics to. +# Only utilized if MetricsSink is set to "statsd" or "dogstatsd". +statsd-addr = "" + +# DatadogHostname defines the hostname to use when emitting metrics to +# Datadog. Only utilized if MetricsSink is set to "dogstatsd". +datadog-hostname = "" ############################################################################### ### API Configuration ### @@ -218,16 +227,9 @@ stop-node-on-err = true [mempool] # Setting max-txs to 0 will allow for a unbounded amount of transactions in the mempool. -# Setting max_txs to negative 1 (-1) will disable transactions from being inserted into the mempool. +# Setting max_txs to negative 1 (-1) will disable transactions from being inserted into the mempool (no-op mempool). # Setting max_txs to a positive number (> 0) will limit the number of transactions in the mempool, by the specified amount. # # Note, this configuration only applies to SDK built-in app-side mempool # implementations. -max-txs = "5000" - -[wasm] -# This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries -query_gas_limit = 300000 -# This is the number of wasm vm instances we keep cached in memory for speed-up -# Warning: this is currently unstable and may lead to crashes, best to keep for 0 unless testing locally -lru_size = 0 \ No newline at end of file +max-txs = -1 diff --git a/tools/confix/data/v0.50-client.toml b/tools/confix/data/v0.50-client.toml new file mode 100644 index 000000000000..d91250aebe78 --- /dev/null +++ b/tools/confix/data/v0.50-client.toml @@ -0,0 +1,17 @@ +# This is a TOML config file. +# For more information, see https://github.com/toml-lang/toml + +############################################################################### +### Client Configuration ### +############################################################################### + +# The network chain ID +chain-id = "demo" +# The keyring's backend, where the keys are stored (os|file|kwallet|pass|test|memory) +keyring-backend = "os" +# CLI output format (text|json) +output = "text" +# : to Tendermint RPC interface for this chain +node = "tcp://localhost:26657" +# Transaction broadcasting mode (sync|async|block) +broadcast-mode = "sync" \ No newline at end of file diff --git a/tools/confix/data/v0.52-app.toml b/tools/confix/data/v0.52-app.toml new file mode 100644 index 000000000000..5c1d5646c5d5 --- /dev/null +++ b/tools/confix/data/v0.52-app.toml @@ -0,0 +1,228 @@ +# This is a TOML config file. +# For more information, see https://github.com/toml-lang/toml + +############################################################################### +### Base Configuration ### +############################################################################### + +# The minimum gas prices a validator is willing to accept for processing a +# transaction. A transaction's fees must meet the minimum of any denomination +# specified in this config (e.g. 0.25token1,0.0001token2). +minimum-gas-prices = "0stake" + +# The maximum gas a query coming over rest/grpc may consume. +# If this is set to zero, the query can consume an unbounded amount of gas. +query-gas-limit = "0" + +# default: the last 362880 states are kept, pruning at 10 block intervals +# nothing: all historic states will be saved, nothing will be deleted (i.e. archiving node) +# everything: 2 latest states will be kept; pruning at 10 block intervals. +# custom: allow pruning options to be manually specified through 'pruning-keep-recent', and 'pruning-interval' +pruning = "default" + +# These are applied if and only if the pruning strategy is custom. +pruning-keep-recent = "0" +pruning-interval = "0" + +# HaltHeight contains a non-zero block height at which a node will gracefully +# halt and shutdown that can be used to assist upgrades and testing. +# +# Note: Commitment of state will be attempted on the corresponding block. +halt-height = 0 + +# HaltTime contains a non-zero minimum block time (in Unix seconds) at which +# a node will gracefully halt and shutdown that can be used to assist upgrades +# and testing. +# +# Note: Commitment of state will be attempted on the corresponding block. +halt-time = 0 + +# MinRetainBlocks defines the minimum block height offset from the current +# block being committed, such that all blocks past this offset are pruned +# from CometBFT. It is used as part of the process of determining the +# ResponseCommit.RetainHeight value during ABCI Commit. A value of 0 indicates +# that no blocks should be pruned. +# +# This configuration value is only responsible for pruning CometBFT blocks. +# It has no bearing on application state pruning which is determined by the +# "pruning-*" configurations. +# +# Note: CometBFT block pruning is dependent on this parameter in conjunction +# with the unbonding (safety threshold) period, state pruning and state sync +# snapshot parameters to determine the correct minimum value of +# ResponseCommit.RetainHeight. +min-retain-blocks = 0 + +# InterBlockCache enables inter-block caching. +inter-block-cache = true + +# IndexEvents defines the set of events in the form {eventType}.{attributeKey}, +# which informs CometBFT what to index. If empty, all events will be indexed. +# +# Example: +# ["message.sender", "message.recipient"] +index-events = [] + +# IavlCacheSize set the size of the iavl tree cache (in number of nodes). +iavl-cache-size = 781250 + +# IAVLDisableFastNode enables or disables the fast node feature of IAVL. +# Default is false. +iavl-disable-fastnode = false + +# AppDBBackend defines the database backend type to use for the application and snapshots DBs. +# An empty string indicates that a fallback will be used. +# The fallback is the db_backend value set in CometBFT's config.toml. +app-db-backend = "" + +############################################################################### +### Telemetry Configuration ### +############################################################################### + +[telemetry] + +# Prefixed with keys to separate services. +service-name = "" + +# Enabled enables the application telemetry functionality. When enabled, +# an in-memory sink is also enabled by default. Operators may also enabled +# other sinks such as Prometheus. +enabled = false + +# Enable prefixing gauge values with hostname. +enable-hostname = false + +# Enable adding hostname to labels. +enable-hostname-label = false + +# Enable adding service to labels. +enable-service-label = false + +# PrometheusRetentionTime, when positive, enables a Prometheus metrics sink. +prometheus-retention-time = 0 + +# GlobalLabels defines a global set of name/value label tuples applied to all +# metrics emitted using the wrapper functions defined in telemetry package. +# +# Example: +# [["chain_id", "cosmoshub-1"]] +global-labels = [] + +# MetricsSink defines the type of metrics sink to use. +metrics-sink = "mem" + +# StatsdAddr defines the address of a statsd server to send metrics to. +# Only utilized if MetricsSink is set to "statsd" or "dogstatsd". +statsd-addr = "" + +# DatadogHostname defines the hostname to use when emitting metrics to +# Datadog. Only utilized if MetricsSink is set to "dogstatsd". +datadog-hostname = "" + +############################################################################### +### API Configuration ### +############################################################################### + +[api] + +# Enable defines if the API server should be enabled. +enable = false + +# Swagger defines if swagger documentation should automatically be registered. +swagger = false + +# Address defines the API server to listen on. +address = "tcp://localhost:1317" + +# MaxOpenConnections defines the number of maximum open connections. +max-open-connections = 1000 + +# RPCReadTimeout defines the CometBFT RPC read timeout (in seconds). +rpc-read-timeout = 10 + +# RPCWriteTimeout defines the CometBFT RPC write timeout (in seconds). +rpc-write-timeout = 0 + +# RPCMaxBodyBytes defines the CometBFT maximum request body (in bytes). +rpc-max-body-bytes = 1000000 + +# EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk). +enabled-unsafe-cors = false + +############################################################################### +### gRPC Configuration ### +############################################################################### + +[grpc] + +# Enable defines if the gRPC server should be enabled. +enable = true + +# Address defines the gRPC server address to bind to. +address = "localhost:9090" + +# MaxRecvMsgSize defines the max message size in bytes the server can receive. +# The default value is 10MB. +max-recv-msg-size = "10485760" + +# MaxSendMsgSize defines the max message size in bytes the server can send. +# The default value is math.MaxInt32. +max-send-msg-size = "2147483647" + +# SkipCheckHeader defines if the gRPC server should bypass check header. +skip-check-header = false + +############################################################################### +### State Sync Configuration ### +############################################################################### + +# State sync snapshots allow other nodes to rapidly join the network without replaying historical +# blocks, instead downloading and applying a snapshot of the application state at a given height. +[state-sync] + +# snapshot-interval specifies the block interval at which local state sync snapshots are +# taken (0 to disable). +snapshot-interval = 0 + +# snapshot-keep-recent specifies the number of recent snapshots to keep and serve (0 to keep all). +snapshot-keep-recent = 2 + +############################################################################### +### State Streaming ### +############################################################################### + +# Streaming allows nodes to stream state to external systems. +[streaming] + +# streaming.abci specifies the configuration for the ABCI Listener streaming service. +[streaming.abci] + +# List of kv store keys to stream out via gRPC. +# The store key names MUST match the module's StoreKey name. +# +# Example: +# ["acc", "bank", "gov", "staking", "mint"[,...]] +# ["*"] to expose all keys. +keys = [] + +# The plugin name used for streaming via gRPC. +# Streaming is only enabled if this is set. +# Supported plugins: abci +plugin = "" + +# stop-node-on-err specifies whether to stop the node on message delivery error. +stop-node-on-err = true + +############################################################################### +### Mempool ### +############################################################################### + +[mempool] + +# Setting max-txs to 0 will allow for a unbounded amount of transactions in the mempool. +# Setting max_txs to negative 1 (-1) will disable transactions from being inserted into the mempool (no-op mempool). +# Setting max_txs to a positive number (> 0) will limit the number of transactions in the mempool, by the specified amount. +# +# Note, this configuration only applies to SDK built-in app-side mempool +# implementations. +max-txs = -1 diff --git a/tools/confix/data/v0.52-client.toml b/tools/confix/data/v0.52-client.toml new file mode 100644 index 000000000000..785ecf499cde --- /dev/null +++ b/tools/confix/data/v0.52-client.toml @@ -0,0 +1,27 @@ +# This is a TOML config file. +# For more information, see https://github.com/toml-lang/toml + +############################################################################### +### Client Configuration ### +############################################################################### + +# The network chain ID +chain-id = "demo" +# The keyring's backend, where the keys are stored (os|file|kwallet|pass|test|memory) +keyring-backend = "test" +# Default key name, if set, defines the default key to use for signing transaction when the --from flag is not specified +keyring-default-keyname = "" +# CLI output format (text|json) +output = "text" +# : to CometBFT RPC interface for this chain +node = "tcp://localhost:26657" +# Transaction broadcasting mode (sync|async) +broadcast-mode = "sync" + +# gRPC server endpoint to which the client will connect. +# It can be overwritten by the --grpc-addr flag in each command. +grpc-address = "" + +# Allow the gRPC client to connect over insecure channels. +# It can be overwritten by the --grpc-insecure flag in each command. +grpc-insecure = false diff --git a/tools/confix/data/v2-app.toml b/tools/confix/data/v2-app.toml new file mode 100644 index 000000000000..a94c44d487e2 --- /dev/null +++ b/tools/confix/data/v2-app.toml @@ -0,0 +1,178 @@ +[comet] + +# min-retain-blocks defines the minimum block height offset from the current block being committed, such that all blocks past this offset are pruned from CometBFT. A value of 0 indicates that no blocks should be pruned. +min-retain-blocks = 0 + +# halt-height contains a non-zero block height at which a node will gracefully halt and shutdown that can be used to assist upgrades and testing. +halt-height = 0 + +# halt-time contains a non-zero minimum block time (in Unix seconds) at which a node will gracefully halt and shutdown that can be used to assist upgrades and testing. +halt-time = 0 + +# address defines the CometBFT RPC server address to bind to. +address = 'tcp://127.0.0.1:26658' + +# transport defines the CometBFT RPC server transport protocol: socket, grpc +transport = 'socket' + +# trace enables the CometBFT RPC server to output trace information about its internal operations. +trace = false + +# standalone starts the application without the CometBFT node. The node should be started separately. +standalone = false + +# index-abci-events defines the set of events in the form {eventType}.{attributeKey}, which informs CometBFT what to index. If empty, all events will be indexed. +index-abci-events = [] + +# disable-index-abci-events disables the ABCI event indexing done by CometBFT. Useful when relying on the SDK indexer for event indexing, but still want events to be included in FinalizeBlockResponse. +disable-index-abci-events = false + +# disable-abci-events disables all ABCI events. Useful when relying on the SDK indexer for event indexing. +disable-abci-events = false + +# mempool defines the configuration for the SDK built-in app-side mempool implementations. +[comet.mempool] + +# max-txs defines the maximum number of transactions that can be in the mempool. A value of 0 indicates an unbounded mempool, a negative value disables the app-side mempool. +max-txs = -1 + +# indexer defines the configuration for the SDK built-in indexer implementation. +[comet.indexer] + +# Buffer size of the channels used for buffering data sent to indexer go routines. +channel_buffer_size = 1024 + +# Target is a map of named indexer targets to their configuration. +[comet.indexer.target] + +[grpc] + +# Enable defines if the gRPC server should be enabled. +enable = true + +# Address defines the gRPC server address to bind to. +address = 'localhost:9090' + +# MaxRecvMsgSize defines the max message size in bytes the server can receive. +# The default value is 10MB. +max-recv-msg-size = 10485760 + +# MaxSendMsgSize defines the max message size in bytes the server can send. +# The default value is math.MaxInt32. +max-send-msg-size = 2147483647 + +[grpc-gateway] + +# Enable defines if the gRPC-Gateway should be enabled. +enable = true + +# Address defines the address the gRPC-Gateway server binds to. +address = 'localhost:1317' + +[rest] + +# Enable defines if the REST server should be enabled. +enable = true + +# Address defines the REST server address to bind to. +address = 'localhost:8080' + +[server] + +# minimum-gas-prices defines the price which a validator is willing to accept for processing a transaction. A transaction's fees must meet the minimum of any denomination specified in this config (e.g. 0.25token1;0.0001token2). +minimum-gas-prices = '0stake' + +[store] + +# The type of database for application and snapshots databases. +app-db-backend = 'goleveldb' + +[store.options] + +# State commitment database type. Currently we support: "iavl" and "iavl-v2" +sc-type = 'iavl' + +# Pruning options for state commitment +[store.options.sc-pruning-option] + +# Number of recent heights to keep on disk. +keep-recent = 2 + +# Height interval at which pruned heights are removed from disk. +interval = 100 + +[store.options.iavl-config] + +# CacheSize set the size of the iavl tree cache. +cache-size = 500000 + +# If true, the tree will work like no fast storage and always not upgrade fast storage. +skip-fast-storage-upgrade = true + +[store.options.iavl-v2-config] + +# CheckpointInterval set the interval of the checkpoint. +checkpoint-interval = 0 + +# CheckpointMemory set the memory of the checkpoint. +checkpoint-memory = 0 + +# StateStorage set the state storage. +state-storage = false + +# HeightFilter set the height filter. +height-filter = 0 + +# EvictionDepth set the eviction depth. +eviction-depth = 0 + +# PruneRatio set the prune ratio. +prune-ratio = 0.0 + +# MinimumKeepVersions set the minimum keep versions. +minimum-keep-versions = 0 + +[swagger] + +# Enable enables/disables the Swagger UI server +enable = true + +# Address defines the server address to bind to +address = 'localhost:8090' + +[telemetry] + +# Enable enables the application telemetry functionality. When enabled, an in-memory sink is also enabled by default. Operators may also enabled other sinks such as Prometheus. +enable = true + +# Address defines the metrics server address to bind to. +address = 'localhost:7180' + +# Prefixed with keys to separate services. +service-name = '' + +# Enable prefixing gauge values with hostname. +enable-hostname = false + +# Enable adding hostname to labels. +enable-hostname-label = false + +# Enable adding service to labels. +enable-service-label = false + +# PrometheusRetentionTime, when positive, enables a Prometheus metrics sink. It defines the retention duration in seconds. +prometheus-retention-time = 600 + +# GlobalLabels defines a global set of name/value label tuples applied to all metrics emitted using the wrapper functions defined in telemetry package. +# Example: +# [["chain_id", "cosmoshub-1"]] +global-labels = [] + +# MetricsSink defines the type of metrics backend to use. Default is in memory +metrics-sink = '' + +# StatsdAddr defines the address of a statsd server to send metrics to. Only utilized if MetricsSink is set to "statsd" or "dogstatsd". +stats-addr = '' + +# DatadogHostname defines the hostname to use when emitting metrics to Datadog. Only utilized if MetricsSink is set to "dogstatsd". +data-dog-hostname = '' diff --git a/tools/confix/data/v2-client.toml b/tools/confix/data/v2-client.toml new file mode 100644 index 000000000000..04fa4067a280 --- /dev/null +++ b/tools/confix/data/v2-client.toml @@ -0,0 +1,27 @@ +# This is a TOML config file. +# For more information, see https://github.com/toml-lang/toml + +############################################################################### +### Client Configuration ### +############################################################################### + +# The network chain ID +chain-id = "" +# The keyring's backend, where the keys are stored (os|file|kwallet|pass|test|memory) +keyring-backend = "test" +# Default key name, if set, defines the default key to use for signing transaction when the --from flag is not specified +keyring-default-keyname = "" +# CLI output format (text|json) +output = "text" +# : to CometBFT RPC interface for this chain +node = "tcp://localhost:26657" +# Transaction broadcasting mode (sync|async) +broadcast-mode = "sync" + +# gRPC server endpoint to which the client will connect. +# It can be overwritten by the --grpc-addr flag in each command. +grpc-address = "" + +# Allow the gRPC client to connect over insecure channels. +# It can be overwritten by the --grpc-insecure flag in each command. +grpc-insecure = false diff --git a/tools/confix/diff.go b/tools/confix/diff.go index 9abc4cd87aff..db26e7e262f4 100644 --- a/tools/confix/diff.go +++ b/tools/confix/diff.go @@ -10,9 +10,11 @@ import ( "github.com/creachadair/tomledit/transform" ) +type DiffType string + const ( - Section = "S" - Mapping = "M" + Section DiffType = "S" + Mapping DiffType = "M" ) type KV struct { @@ -22,7 +24,7 @@ type KV struct { } type Diff struct { - Type string // "section" or "mapping" + Type DiffType Deleted bool KV KV @@ -41,7 +43,6 @@ func DiffKeys(lhs, rhs *tomledit.Document) []Diff { i, j := 0, 0 for i < len(lsec) && j < len(rsec) { switch { - case lsec[i].Name.Before(rsec[j].Name): diff = append(diff, Diff{Type: Section, Deleted: true, KV: KV{Key: lsec[i].Name.String()}}) for _, kv := range allKVs(lsec[i]) { @@ -76,7 +77,7 @@ func DiffKeys(lhs, rhs *tomledit.Document) []Diff { return diff } -// DiffKeys diffs the keyspaces with different values of the TOML documents in files lhs and rhs. +// DiffValues diffs the keyspaces with different values of the TOML documents in files lhs and rhs. func DiffValues(lhs, rhs *tomledit.Document) []Diff { diff := diffDocs(allKVs(lhs.Global), allKVs(rhs.Global), true) diff --git a/tools/confix/file.go b/tools/confix/file.go index 4b4695711062..dcd3ab35ba77 100644 --- a/tools/confix/file.go +++ b/tools/confix/file.go @@ -4,6 +4,8 @@ import ( "embed" "fmt" "os" + "path/filepath" + "strings" "github.com/creachadair/tomledit" ) @@ -11,11 +13,16 @@ import ( //go:embed data var data embed.FS -// LoadConfig loads and parses the TOML document from confix data -func LoadLocalConfig(name string) (*tomledit.Document, error) { - f, err := data.Open(fmt.Sprintf("data/%s-app.toml", name)) +// LoadLocalConfig loads and parses the TOML document from confix data +func LoadLocalConfig(name, configType string) (*tomledit.Document, error) { + fileName, err := getFileName(name, configType) if err != nil { - panic(fmt.Errorf("failed to read file: %w. This file should have been included in confix", err)) + return nil, err + } + + f, err := data.Open(filepath.Join("data", fileName)) + if err != nil { + return nil, fmt.Errorf("failed to read file: %w. This file should have been included in confix", err) } defer f.Close() @@ -26,9 +33,21 @@ func LoadLocalConfig(name string) (*tomledit.Document, error) { func LoadConfig(path string) (*tomledit.Document, error) { f, err := os.Open(path) if err != nil { - return nil, fmt.Errorf("failed to open %q: %v", path, err) + return nil, fmt.Errorf("failed to open %q: %w", path, err) } defer f.Close() return tomledit.Parse(f) } + +// getFileName constructs the filename based on the type of configuration (app or client) +func getFileName(name, configType string) (string, error) { + switch strings.ToLower(configType) { + case "app": + return fmt.Sprintf("%s-app.toml", name), nil + case "client": + return fmt.Sprintf("%s-client.toml", name), nil + default: + return "", fmt.Errorf("unsupported config type: %q", configType) + } +} diff --git a/tools/confix/go.mod b/tools/confix/go.mod index 426046d108f0..4af15fcbf343 100644 --- a/tools/confix/go.mod +++ b/tools/confix/go.mod @@ -1,162 +1,163 @@ module cosmossdk.io/tools/confix -go 1.20 +go 1.23 require ( - github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230607182757-cfeb10287d61 - github.com/creachadair/atomicfile v0.3.1 - github.com/creachadair/tomledit v0.0.24 - github.com/spf13/cobra v1.7.0 - github.com/spf13/viper v1.16.0 - golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 - gotest.tools/v3 v3.4.0 + github.com/cosmos/cosmos-sdk v0.50.13 + github.com/creachadair/atomicfile v0.3.7 + github.com/creachadair/tomledit v0.0.27 + github.com/pelletier/go-toml/v2 v2.2.3 + github.com/spf13/cobra v1.9.1 + github.com/spf13/viper v1.20.0 + gotest.tools/v3 v3.5.2 ) +require github.com/go-viper/mapstructure/v2 v2.2.1 // indirect + require ( - cosmossdk.io/api v0.4.2 // indirect - cosmossdk.io/collections v0.2.0 // indirect - cosmossdk.io/core v0.8.0 // indirect - cosmossdk.io/depinject v1.0.0-alpha.3 // indirect - cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 // indirect - cosmossdk.io/log v1.1.0 // indirect - cosmossdk.io/math v1.0.1 // indirect - cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c // indirect - cosmossdk.io/x/tx v0.8.0 // indirect - filippo.io/edwards25519 v1.0.0 // indirect + cosmossdk.io/api v0.7.6 // indirect + cosmossdk.io/collections v0.4.0 // indirect + cosmossdk.io/core v0.11.1 // indirect + cosmossdk.io/depinject v1.1.0 // indirect + cosmossdk.io/errors v1.0.1 // indirect + cosmossdk.io/log v1.5.0 // indirect + cosmossdk.io/math v1.5.0 // indirect + cosmossdk.io/store v1.1.1 // indirect + cosmossdk.io/x/tx v1.0.0-alpha.3 // indirect + filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect - github.com/DataDog/zstd v1.5.5 // indirect - github.com/armon/go-metrics v0.4.1 // indirect + github.com/DataDog/datadog-go v3.2.0+incompatible // indirect + github.com/DataDog/zstd v1.5.6 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect - github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect + github.com/bgentry/speakeasy v0.2.0 // indirect + github.com/bytedance/sonic v1.12.8 // indirect + github.com/bytedance/sonic/loader v0.2.3 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // indirect - github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/cockroachdb/errors v1.9.1 // indirect - github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20230606152911-c4be581b807f // indirect - github.com/cockroachdb/redact v1.1.4 // indirect - github.com/cometbft/cometbft v0.38.0-rc1 // indirect - github.com/cometbft/cometbft-db v0.7.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/cloudwego/base64x v0.1.5 // indirect + github.com/cockroachdb/apd/v3 v3.2.1 // indirect + github.com/cockroachdb/errors v1.11.3 // indirect + github.com/cockroachdb/fifo v0.0.0-20240816210425-c5d0cb0b6fc0 // indirect + github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506 // indirect + github.com/cockroachdb/pebble v1.1.2 // indirect + github.com/cockroachdb/redact v1.1.5 // indirect + github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect + github.com/cometbft/cometbft v0.38.17 // indirect + github.com/cometbft/cometbft-db v0.14.1 // indirect github.com/cosmos/btcutil v1.0.5 // indirect - github.com/cosmos/cosmos-db v1.0.0 // indirect - github.com/cosmos/cosmos-proto v1.0.0-beta.3 // indirect + github.com/cosmos/cosmos-db v1.1.1 // indirect + github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/gogoproto v1.4.10 // indirect - github.com/cosmos/iavl v1.0.0-beta.2 // indirect - github.com/cosmos/ics23/go v0.10.0 // indirect - github.com/cosmos/ledger-cosmos-go v0.13.0 // indirect + github.com/cosmos/gogoproto v1.7.0 // indirect + github.com/cosmos/iavl v1.2.2 // indirect + github.com/cosmos/ics23/go v0.11.0 // indirect + github.com/cosmos/ledger-cosmos-go v0.14.0 // indirect github.com/danieljoos/wincred v1.1.2 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect - github.com/dgraph-io/badger/v2 v2.2007.4 // indirect + github.com/dgraph-io/badger/v4 v4.2.0 // indirect 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/dvsekhvalnov/jose2go v1.5.0 // indirect - github.com/emicklei/dot v1.4.2 // indirect - github.com/fatih/color v1.15.0 // indirect - github.com/felixge/httpsnoop v1.0.2 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/getsentry/sentry-go v0.21.0 // indirect - github.com/go-kit/kit v0.12.0 // indirect + github.com/dvsekhvalnov/jose2go v1.6.0 // indirect + github.com/emicklei/dot v1.6.2 // indirect + github.com/fatih/color v1.18.0 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect + github.com/getsentry/sentry-go v0.30.0 // indirect + github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/googleapis v1.4.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/glog v1.1.0 // indirect + github.com/golang/glog v1.2.4 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/mock v1.6.0 // indirect - github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.4 // indirect - github.com/google/btree v1.1.2 // indirect - github.com/google/go-cmp v0.5.9 // indirect + github.com/google/btree v1.1.3 // indirect + github.com/google/flatbuffers v1.12.1 // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/google/orderedcode v0.0.1 // indirect - github.com/gorilla/handlers v1.5.1 // indirect - github.com/gorilla/mux v1.8.0 // indirect - github.com/gorilla/websocket v1.5.0 // 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/grpc-ecosystem/grpc-gateway v1.16.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect - github.com/hashicorp/go-hclog v1.5.0 // indirect + github.com/hashicorp/go-hclog v1.6.3 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/go-plugin v1.4.10 // indirect - github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect - 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/huandu/skiplist v1.2.0 // indirect - github.com/iancoleman/strcase v0.2.0 // indirect + github.com/hashicorp/go-metrics v0.5.4 // indirect + github.com/hashicorp/go-plugin v1.6.2 // indirect + github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect + github.com/hashicorp/yamux v0.1.2 // indirect + github.com/hdevalence/ed25519consensus v0.2.0 // indirect + github.com/huandu/skiplist v1.2.1 // 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/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.16.5 // indirect + github.com/klauspost/compress v1.17.11 // indirect + github.com/klauspost/cpuid/v2 v2.2.9 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect - github.com/lib/pq v1.10.7 // indirect - github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.0 // indirect - github.com/magiconair/properties v1.8.7 // indirect + github.com/lib/pq v1.10.9 // indirect + github.com/linxGnu/grocksdb v1.9.7 // indirect + github.com/magiconair/properties v1.8.9 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.19 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/minio/highwayhash v1.0.2 // indirect - github.com/mitchellh/go-testing-interface v1.14.1 // indirect - github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/minio/highwayhash v1.0.3 // indirect github.com/mtibben/percent v0.2.1 // indirect - github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.0.8 // indirect - github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761 // indirect + github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.15.1 // indirect - github.com/prometheus/client_model v0.4.0 // indirect - github.com/prometheus/common v0.44.0 // indirect - github.com/prometheus/procfs v0.10.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/prometheus/client_golang v1.20.5 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.62.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.10.0 // indirect - github.com/rs/cors v1.8.3 // indirect - github.com/rs/zerolog v1.29.1 // indirect - github.com/sasha-s/go-deadlock v0.3.1 // indirect - github.com/spf13/afero v1.9.5 // indirect - github.com/spf13/cast v1.5.1 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/spf13/pflag v1.0.5 // indirect - github.com/stretchr/testify v1.8.4 // indirect - github.com/subosito/gotenv v1.4.2 // indirect + github.com/rogpeppe/go-internal v1.13.1 // indirect + github.com/rs/cors v1.11.1 // indirect + github.com/rs/zerolog v1.33.0 // indirect + github.com/sagikazarmark/locafero v0.7.0 // indirect + github.com/sasha-s/go-deadlock v0.3.5 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.12.0 // indirect + github.com/spf13/cast v1.7.1 // indirect + github.com/spf13/pflag v1.0.6 // indirect + github.com/stretchr/testify v1.10.0 // indirect + github.com/subosito/gotenv v1.6.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect - github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect github.com/tendermint/go-amino v0.16.0 // indirect - github.com/tidwall/btree v1.6.0 // indirect - github.com/zondax/hid v0.9.1 // indirect - github.com/zondax/ledger-go v0.14.1 // indirect - go.etcd.io/bbolt v1.3.6 // indirect - golang.org/x/crypto v0.9.0 // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/sync v0.2.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/term v0.8.0 // indirect - golang.org/x/text v0.9.0 // indirect - google.golang.org/genproto v0.0.0-20230525234025-438c736192d0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect - google.golang.org/grpc v1.55.0 // indirect - google.golang.org/protobuf v1.30.0 // indirect - gopkg.in/ini.v1 v1.67.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect + github.com/tidwall/btree v1.7.0 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + github.com/zondax/hid v0.9.2 // indirect + github.com/zondax/ledger-go v0.14.3 // indirect; indirectÎ + go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 // indirect + go.opencensus.io v0.24.0 // indirect + go.uber.org/multierr v1.10.0 // indirect + golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect + golang.org/x/crypto v0.32.0 // indirect + golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect + golang.org/x/net v0.34.0 // indirect + golang.org/x/sync v0.10.0 // indirect + golang.org/x/sys v0.30.0 // indirect + golang.org/x/term v0.29.0 // indirect + golang.org/x/text v0.21.0 // indirect + google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250122153221-138b5a5a4fd4 // indirect + google.golang.org/grpc v1.70.0 // indirect + google.golang.org/protobuf v1.36.4 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.6 // indirect - pgregory.net/rapid v0.6.2 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect + pgregory.net/rapid v1.1.0 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect ) - -// Fix upstream GHSA-h395-qcrw-5vmq and GHSA-3vp4-m3rf-835h vulnerabilities. -// TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 -// TODO investigate if we can outright delete this dependency, otherwise go install won't work :( -replace github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0 - -replace github.com/cosmos/cosmos-sdk => ../../ diff --git a/tools/confix/go.sum b/tools/confix/go.sum index bdaf35b6dbbb..f43cb1aaa3d5 100644 --- a/tools/confix/go.sum +++ b/tools/confix/go.sum @@ -1,89 +1,50 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= -cosmossdk.io/api v0.4.2 h1:lQBMl4xINnMnBOR/tQLtjlDnR4exr4e6/SfHR8PILE0= -cosmossdk.io/api v0.4.2/go.mod h1:qrVgOp7DIeAXa+Tt5dDjOC47bZCDrwx8ZHxrmy7STNE= -cosmossdk.io/collections v0.2.0 h1:CgMfLtE16+qox3zBYrGh60i4yKV8SeExLnIdOS2sbQs= -cosmossdk.io/collections v0.2.0/go.mod h1:Oc1FK0vlmxJZsgUn9/o3ldE6zNyWKvobVzaLhWknZJE= -cosmossdk.io/core v0.8.0 h1:LcJnu52E1a8f8E317VfQ1xK/RZe+IuhMNQAjnDLh25M= -cosmossdk.io/core v0.8.0/go.mod h1:LF6VLOv2DdCiaHxYVmr0MZcZpaSM9ZgvyrQSYTeg6D0= -cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw= -cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= -cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 h1:BCRz06fvddw7cKGiEGDiSox3qMsjQ97f92K+PDZDHdc= -cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741/go.mod h1:TB05o6YXkZkzsc+6bZFAV5kZRBtoCU9tUkbeMIqEg0w= -cosmossdk.io/log v1.1.0 h1:v0ogPHYeTzPcBTcPR1A3j1hkei4pZama8kz8LKlCMv0= -cosmossdk.io/log v1.1.0/go.mod h1:6zjroETlcDs+mm62gd8Ig7mZ+N+fVOZS91V17H+M4N4= -cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= -cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= -cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c h1:A+FMPW9GtfcPBDQNtFeDFN27h1SAP6OVjnGgPLlYXmI= -cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c/go.mod h1:RbYGvXCbz8uNBCXrwS9Z8SyydeWi+W5x5MZ33muyzMw= -cosmossdk.io/x/tx v0.8.0 h1:gLiGRL/Fy7fs6dd0IX8jOf0PrVr56/SG6XVMGQjyvJU= -cosmossdk.io/x/tx v0.8.0/go.mod h1:T9uEumGNgKU61gJYRv1t3uzQwLnASpJGmSE229HM3xA= +cosmossdk.io/api v0.7.6 h1:PC20PcXy1xYKH2KU4RMurVoFjjKkCgYRbVAD4PdqUuY= +cosmossdk.io/api v0.7.6/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= +cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= +cosmossdk.io/core v0.11.1 h1:h9WfBey7NAiFfIcUhDVNS503I2P2HdZLebJlUIs8LPA= +cosmossdk.io/core v0.11.1/go.mod h1:OJzxcdC+RPrgGF8NJZR2uoQr56tc7gfBKhiKeDO7hH0= +cosmossdk.io/depinject v1.1.0 h1:wLan7LG35VM7Yo6ov0jId3RHWCGRhe8E8bsuARorl5E= +cosmossdk.io/depinject v1.1.0/go.mod h1:kkI5H9jCGHeKeYWXTqYdruogYrEeWvBQCw1Pj4/eCFI= +cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= +cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= +cosmossdk.io/log v1.5.0 h1:dVdzPJW9kMrnAYyMf1duqacoidB9uZIl+7c6z0mnq0g= +cosmossdk.io/log v1.5.0/go.mod h1:Tr46PUJjiUthlwQ+hxYtUtPn4D/oCZXAkYevBeh5+FI= +cosmossdk.io/math v1.5.0 h1:sbOASxee9Zxdjd6OkzogvBZ25/hP929vdcYcBJQbkLc= +cosmossdk.io/math v1.5.0/go.mod h1:AAwwBmUhqtk2nlku174JwSll+/DepUXW3rWIXN5q+Nw= +cosmossdk.io/store v1.1.1 h1:NA3PioJtWDVU7cHHeyvdva5J/ggyLDkyH0hGHl2804Y= +cosmossdk.io/store v1.1.1/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM= +cosmossdk.io/x/tx v1.0.0-alpha.3 h1:+55/JFH5QRqnFhOI2heH3DKsaNL0RpXcJOQNzUvHiaQ= +cosmossdk.io/x/tx v1.0.0-alpha.3/go.mod h1:h4pQ/j6Gfu8goB1R3Jbl4qY4RjYVNAsoylcleTXdSRg= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= -filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= +filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= +filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= 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/99designs/keyring v1.2.1 h1:tYLp1ULvO7i3fI5vE21ReQuj99QFSs7lGm0xWyJo87o= github.com/99designs/keyring v1.2.1/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= -github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= -github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= +github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= -github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= -github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= +github.com/DataDog/zstd v1.5.6 h1:LbEglqepa/ipmmQJUDnSsfvA8e8IStVcGaFWDuxvGOY= +github.com/DataDog/zstd v1.5.6/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= -github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= +github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= 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/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= +github.com/adlio/schema v1.3.6 h1:k1/zc2jNfeiZBA5aFTRy37jlBIuCkXCm0XmvpzCKI9I= +github.com/adlio/schema v1.3.6/go.mod h1:qkxwLgPBd1FgLRHYVCmQT/rrBr3JH38J9LjmVzWNudg= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= -github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= -github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -93,33 +54,34 @@ github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kd github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= 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/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= -github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bits-and-blooms/bitset v1.7.0 h1:YjAGVd3XmtK9ktAbX8Zg2g2PwLIMjGREZJHlV4j7NEo= -github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= -github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= -github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= -github.com/bufbuild/protocompile v0.5.1 h1:mixz5lJX4Hiz4FpqFREJHIXLfaLBntfaJv1h+/jS+Qg= -github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= -github.com/bytedance/sonic v1.8.0 h1:ea0Xadu+sHlu7x5O3gKhRpQ1IKiMrSiHttPF0ybECuA= -github.com/bytedance/sonic v1.8.0/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= +github.com/bgentry/speakeasy v0.2.0 h1:tgObeVOf8WAvtuAX6DhJ4xks4CFNwPDZiqzGqIHE51E= +github.com/bgentry/speakeasy v0.2.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bits-and-blooms/bitset v1.8.0 h1:FD+XqgOZDUxxZ8hzoBFuV9+cGWY9CslN6d5MS5JVb4c= +github.com/bits-and-blooms/bitset v1.8.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= +github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= +github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/btcutil v1.1.6 h1:zFL2+c3Lb9gEgqKNzowKUPQNb8jV7v5Oaodi/AYFd6c= +github.com/btcsuite/btcd/btcutil v1.1.6/go.mod h1:9dFymx8HpuLqBnsPELrImQeTQfKBQqzqGbbV3jK55aE= +github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY= +github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE= +github.com/bytedance/sonic v1.12.8 h1:4xYRVRlXIgvSZ4e8iVTlMF5szgpXd4AfvuWgA8I8lgs= +github.com/bytedance/sonic v1.12.8/go.mod h1:uVvFidNmlt9+wa31S1urfwwthTWteBgG0hWuoKAXTx8= +github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= +github.com/bytedance/sonic/loader v0.2.3 h1:yctD0Q3v2NOGfSWPLPvG2ggA2kV6TS6s4wioyEqssH0= +github.com/bytedance/sonic/loader v0.2.3/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= @@ -127,24 +89,22 @@ github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInq github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= -github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= -github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= +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/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI= +github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudwego/base64x v0.1.5 h1:XPciSp1xaq2VCSt6lF0phncD4koWyULpl5bUxbfCyP4= +github.com/cloudwego/base64x v0.1.5/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= +github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= @@ -152,77 +112,80 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= -github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= +github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= +github.com/cockroachdb/apd/v3 v3.2.1 h1:U+8j7t0axsIgvQUqthuNm82HIrYXodOV2iWLWtEaIwg= +github.com/cockroachdb/apd/v3 v3.2.1/go.mod h1:klXJcjp+FffLTHlhIG69tezTDvdP065naDsHzKhYSqc= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= -github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= -github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= -github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/pebble v0.0.0-20230606152911-c4be581b807f h1:qQW3qCVRpjYsV4YNaUOjm6YLeliAD2jpgex9+D9tqU4= -github.com/cockroachdb/pebble v0.0.0-20230606152911-c4be581b807f/go.mod h1:TkdVsGYRqtULUppt2RbC+YaKtTHnHoWa2apfFrSKABw= -github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/cockroachdb/redact v1.1.4 h1:Y0XrVI2FAyofNyGveodTN//qdpPtFKcKTeCBsK3AHAQ= -github.com/cockroachdb/redact v1.1.4/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= +github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8= +github.com/cockroachdb/fifo v0.0.0-20240816210425-c5d0cb0b6fc0 h1:pU88SPhIFid6/k0egdR5V6eALQYq2qbSmukrkgIh/0A= +github.com/cockroachdb/fifo v0.0.0-20240816210425-c5d0cb0b6fc0/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= +github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506 h1:ASDL+UJcILMqgNeV5jiqR4j+sTuvQNHdf2chuKj1M5k= +github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506/go.mod h1:Mw7HqKr2kdtu6aYGn3tPmAftiP3QPX63LdK/zcariIo= +github.com/cockroachdb/pebble v1.1.2 h1:CUh2IPtR4swHlEj48Rhfzw6l/d0qA31fItcIszQVIsA= +github.com/cockroachdb/pebble v1.1.2/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= -github.com/cometbft/cometbft v0.38.0-rc1 h1:ph6smlqX82aH+d72KuxDHqu29M7LyusSp/obfGsGX/w= -github.com/cometbft/cometbft v0.38.0-rc1/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= -github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= -github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= +github.com/cometbft/cometbft v0.38.17 h1:FkrQNbAjiFqXydeAO81FUzriL4Bz0abYxN/eOHrQGOk= +github.com/cometbft/cometbft v0.38.17/go.mod h1:5l0SkgeLRXi6bBfQuevXjKqML1jjfJJlvI1Ulp02/o4= +github.com/cometbft/cometbft-db v0.14.1 h1:SxoamPghqICBAIcGpleHbmoPqy+crij/++eZz3DlerQ= +github.com/cometbft/cometbft-db v0.14.1/go.mod h1:KHP1YghilyGV/xjD5DP3+2hyigWx0WTp9X+0Gnx0RxQ= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= +github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= -github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0E= -github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= -github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= -github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= +github.com/cosmos/cosmos-db v1.1.1 h1:FezFSU37AlBC8S98NlSagL76oqBRWq/prTPvFcEJNCM= +github.com/cosmos/cosmos-db v1.1.1/go.mod h1:AghjcIPqdhSLP/2Z0yha5xPH3nLnskz81pBx3tcVSAw= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= +github.com/cosmos/cosmos-sdk v0.50.13 h1:xQ32hhzVy7agEe7behMdZN0ezWhPss3KoLZsF9KoBnw= +github.com/cosmos/cosmos-sdk v0.50.13/go.mod h1:hrWEFMU1eoXqLJeE6VVESpJDQH67FS1nnMrQIjO2daw= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoKuI= -github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= -github.com/cosmos/iavl v1.0.0-beta.2 h1:XOsIM80Yyml/KifCXEYOy9tWCXwMAbLa91n6pReW07Y= -github.com/cosmos/iavl v1.0.0-beta.2/go.mod h1:EA97dJ07TBktRlG/iGzK6g1eCXNj1q3MGoFYkVzrwHE= -github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= -github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= -github.com/cosmos/ledger-cosmos-go v0.13.0 h1:ex0CvCxToSR7j5WjrghPu2Bu9sSXKikjnVvUryNnx4s= -github.com/cosmos/ledger-cosmos-go v0.13.0/go.mod h1:ZcqYgnfNJ6lAXe4HPtWgarNEY+B74i+2/8MhZw4ziiI= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= +github.com/cosmos/iavl v1.2.2 h1:qHhKW3I70w+04g5KdsdVSHRbFLgt3yY3qTMd4Xa4rC8= +github.com/cosmos/iavl v1.2.2/go.mod h1:GiM43q0pB+uG53mLxLDzimxM9l/5N9UuSY3/D0huuVw= +github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= +github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= +github.com/cosmos/ledger-cosmos-go v0.14.0 h1:WfCHricT3rPbkPSVKRH+L4fQGKYHuGOK9Edpel8TYpE= +github.com/cosmos/ledger-cosmos-go v0.14.0/go.mod h1:E07xCWSBl3mTGofZ2QnL4cIUzMbbGVyik84QYKbX3RA= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creachadair/atomicfile v0.3.1 h1:yQORkHjSYySh/tv5th1dkKcn02NEW5JleB84sjt+W4Q= -github.com/creachadair/atomicfile v0.3.1/go.mod h1:mwfrkRxFKwpNAflYZzytbSwxvbK6fdGRRlp0KEQc0qU= -github.com/creachadair/tomledit v0.0.24 h1:5Xjr25R2esu1rKCbQEmjZYlrhFkDspoAbAKb6QKQDhQ= -github.com/creachadair/tomledit v0.0.24/go.mod h1:9qHbShRWQzSCcn617cMzg4eab1vbLCOjOshAWSzWr8U= +github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= +github.com/creachadair/atomicfile v0.3.7 h1:wdg8+Isz07NDMi2yZQAoI1EKB9SxuDhvo5MUii/ZqlM= +github.com/creachadair/atomicfile v0.3.7/go.mod h1:lUrZrE/XjMA7rJY/n8dF7/sSpy6KjtPaxPbrDambthA= +github.com/creachadair/mds v0.22.1 h1:Wink9jeYR7brBbOkOTVZVrd6vyb5W4ZBRhlZd96TSgU= +github.com/creachadair/mds v0.22.1/go.mod h1:ArfS0vPHoLV/SzuIzoqTEZfoYmac7n9Cj8XPANHocvw= +github.com/creachadair/tomledit v0.0.27 h1:6xOpEnkKmcpT/gmKhabN0JXrqNX065lyje1/mXTSSIE= +github.com/creachadair/tomledit v0.0.27/go.mod h1:v1EWpgCisD3ct1kO8Gq4o4pdgX5JXD0rBI2PJ4UnPoA= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= -github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= -github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= -github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= -github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= -github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= +github.com/dgraph-io/badger/v4 v4.2.0 h1:kJrlajbXXL9DFTNuhhu9yCx7JJa4qpYWxtE8BzuWsEs= +github.com/dgraph-io/badger/v4 v4.2.0/go.mod h1:qfCqhPoWDFJRx1gp5QwwyGo8xk1lbHUxvK9nK0OGAak= github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= @@ -230,72 +193,62 @@ github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUn github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= 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/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= 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/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= -github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= +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/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= -github.com/emicklei/dot v1.4.2 h1:UbK6gX4yvrpHKlxuUQicwoAis4zl8Dzwit9SnbBAXWw= -github.com/emicklei/dot v1.4.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= +github.com/emicklei/dot v1.6.2 h1:08GN+DD79cy/tzN6uLCT84+2Wk9u+wvqP+Hkx/dIR8A= +github.com/emicklei/dot v1.6.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= -github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= -github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= -github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= -github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= -github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= -github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= +github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= -github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= -github.com/getsentry/sentry-go v0.21.0 h1:c9l5F1nPF30JIppulk4veau90PK6Smu3abgVtVQWon4= -github.com/getsentry/sentry-go v0.21.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= +github.com/getsentry/sentry-go v0.30.0 h1:lWUwDnY7sKHaVIoZ9wYqRHJ5iEmoc0pqcRqFkosKzBo= +github.com/getsentry/sentry-go v0.30.0/go.mod h1:WU9B9/1/sHDqeV8T+3VwwbjeR5MSXs/6aqG3mqZrezA= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.9.0 h1:OjyFBKICoexlu99ctXNR2gg+c5pKrKMuyjgARg9qeY8= -github.com/gin-gonic/gin v1.9.0/go.mod h1:W1Me9+hsUSyj3CePGrd1/QrKJMSJ1Tu/0hFEH89961k= -github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= +github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= +github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= -github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= -github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= +github.com/go-kit/kit v0.13.0 h1:OoneCcHKHQ03LfBpoQCUfCluwd2Vt3ohz+kvbJneZAU= +github.com/go-kit/kit v0.13.0/go.mod h1:phqEHMMUbyrCFCTgH48JueqrM3md2HcAZ8N3XE4FKDg= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= @@ -304,30 +257,36 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= -github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= -github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= -github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= -github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU= -github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= +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-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= +github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= +github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= +github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= +github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= +github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= -github.com/goccy/go-json v0.10.0 h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA= -github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= +github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= -github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= 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= @@ -338,22 +297,15 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV 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/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= -github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= -github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= +github.com/golang/glog v1.2.4 h1:CNNw5U8lSiiBk7druxtSHHTsRWcxKoac6kZKm2peBBc= +github.com/golang/glog v1.2.4/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -361,7 +313,6 @@ github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= @@ -373,68 +324,53 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -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/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= +github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= +github.com/google/flatbuffers v1.12.1 h1:MVlul7pQNoDzWRLTw5imwYsl+usrS1TXG2H4jg6ImGw= +github.com/google/flatbuffers v1.12.1/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 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= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= -github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= +github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE= +github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= @@ -450,15 +386,17 @@ github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyN github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= -github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= +github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-metrics v0.5.4 h1:8mmPiIJkTPPEbAiV97IxdAGNdRdaWwVap1BU6elejKY= +github.com/hashicorp/go-metrics v0.5.4/go.mod h1:CG5yz4NZ/AI/aQt9Ucm/vdBnbh7fvmv4lxZ350i+QQI= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-plugin v1.4.10 h1:xUbmA4jC6Dq163/fWcp8P3JuHilrHHMLNRxzGQJ9hNk= -github.com/hashicorp/go-plugin v1.4.10/go.mod h1:6/1TEzT0eQznvI/gV2CM29DLSkAK/e58mUWKVsPaph0= +github.com/hashicorp/go-plugin v1.6.2 h1:zdGAEd0V1lCaU0u+MxWQhtSDQmahpkwOun8U8EiRVog= +github.com/hashicorp/go-plugin v1.6.2/go.mod h1:CkgLQ5CZqNmdL9U9JzM532t8ZiYQ35+pj3b1FD37R0Q= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= @@ -470,42 +408,35 @@ github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -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/hashicorp/yamux v0.1.2 h1:XtB8kyFOyHXYVFnwT5C3+Bdo8gArse7j2AQ0DA0Uey8= +github.com/hashicorp/yamux v0.1.2/go.mod h1:C+zze2n6e/7wshOZep2A70/aQU6QBRWJO/G6FT1wIns= +github.com/hdevalence/ed25519consensus v0.2.0 h1:37ICyZqdyj0lAZ8P4D1d1id3HqbbG1N3iBb1Tb4rdcU= +github.com/hdevalence/ed25519consensus v0.2.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= 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= -github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw= -github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= +github.com/huandu/skiplist v1.2.1 h1:dTi93MgjwErA/8idWTzIw4Y1kZsMWx35fmI2c8Rij7w= +github.com/huandu/skiplist v1.2.1/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= -github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= -github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= -github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= -github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= -github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= -github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= -github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= -github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= +github.com/jhump/protoreflect v1.15.3 h1:6SFRuqU45u9hIZPJAoZ8c28T3nK64BNdp9w6jFonzls= +github.com/jhump/protoreflect v1.15.3/go.mod h1:4ORHmSBmlCW8fh3xHmJMGyul1zNqZK4Elxc8qKP+p1k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= @@ -516,104 +447,75 @@ github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= 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/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= -github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= -github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= -github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= -github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= 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/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI= -github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/klauspost/cpuid v1.2.1 h1:vJi+O/nMdFt0vqm8NZBI6wzALWdA2X+egi0ogNyrC/w= -github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= +github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= +github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.9 h1:66ze0taIn2H33fBvCkXuv9BmCwDfafmiIVpKV9kKGuY= +github.com/klauspost/cpuid/v2 v2.2.9/go.mod h1:rqkxqrZ1EhYM9G+hXH7YdowN5R5RGN6NK4QwQ3WMXF8= +github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= 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.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= -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= -github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.0 h1:H4L/LhP7GOMf1j17oQAElHgVlbEje2h14A8Tz9cM2BE= -github.com/linxGnu/grocksdb v1.8.0/go.mod h1:09CeBborffXhXdNpEcOeZrLKEnRtrZFEpFdPNI9Zjjg= +github.com/linxGnu/grocksdb v1.9.7 h1:Bp2r1Yti/IXxEobZZnDooXAui/Q+5gVqgQMenLWyDUw= +github.com/linxGnu/grocksdb v1.9.7/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= -github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/magiconair/properties v1.8.9 h1:nWcCbLq1N2v/cpNsy5WvQ37Fb+YElfq20WJ/a8RkpQM= +github.com/magiconair/properties v1.8.9/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= +github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.8/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= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= 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-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= -github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= -github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= +github.com/minio/highwayhash v1.0.3 h1:kbnuUMoHYyVl7szWjSxJnxw11k2U709jqFPPmIUyD6Q= +github.com/minio/highwayhash v1.0.3/go.mod h1:GGYsuwP/fPD6Y9hMiXuapVvlIUEhFhMTh0rxU3ik1LQ= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -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/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/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= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -621,9 +523,10 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= 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/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -637,10 +540,11 @@ github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce h1:/pEpMk55wH0X+E5zedGEMOdLuWmV8P4+4W3+LZaM6kg= -github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= +github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY= +github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a h1:dlRvE5fWabOchtH7znfiFCcOvmIYgOeAS5ifBXBlh9Q= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= @@ -648,7 +552,6 @@ github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DV github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= @@ -660,10 +563,14 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/onsi/gomega v1.26.0 h1:03cDLK28U6hWvCAns6NeydX3zIm4SF3ci69ulidS32Q= +github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= 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-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= -github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= +github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= +github.com/opencontainers/runc v1.1.12 h1:BOIssBaW1La0/qbNZHXOOa71dZfZEQOzW7dqQf3phss= +github.com/opencontainers/runc v1.1.12/go.mod h1:S+lQwSfncpBha7XTy/5lBwWgm5+y5Ma/O44Ekby9FK8= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -673,19 +580,17 @@ github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJ github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= +github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= -github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= -github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= +github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= +github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= -github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761 h1:W04oB3d0J01W5jgYRGKsV8LCM6g9EkCvPkZcmFuy0OE= -github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 h1:Dx7Ovyv/SFnMFw3fD4oEoeorXc6saIiQ23LrGLth0Gw= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= @@ -696,9 +601,9 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= @@ -706,103 +611,94 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.15.1 h1:8tXpTmJbyH5lydzFPoxSIJ0J46jdh3tylbvM1xCv0LI= -github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= +github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= +github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= -github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= -github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io= +github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= -github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= 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/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= -github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= -github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= -github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.29.1 h1:cO+d60CHkknCbvzEWxP0S9K6KqyTjrCNUy1LdQLCGPc= -github.com/rs/zerolog v1.29.1/go.mod h1:Le6ESbR7hc+DP6Lt1THiV8CQSdkkNrd3R0XbEgp3ZBU= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= +github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/locafero v0.7.0 h1:5MqpDsTGNDhY8sGp0Aowyf0qKsPrhewaLSsFaodPcyo= +github.com/sagikazarmark/locafero v0.7.0/go.mod h1:2za3Cg5rMaTMoG/2Ulr9AwtFaIppKXTRYnozin4aB5k= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -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/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= +github.com/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb2NsU= +github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= -github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= -github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= -github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= +github.com/spf13/afero v1.12.0 h1:UcOPyRBYczmFn6yvphxkn9ZEOY65cpwGKb5mL36mrqs= +github.com/spf13/afero v1.12.0/go.mod h1:ZTlWwG4/ahT8W7T0WQ5uYmjI9duaLQGy3Q2OAl4sk/4= +github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= +github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo= +github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= -github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= +github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= +github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.20.0 h1:zrxIyR3RQIOsarIrgL8+sAvALXul9jeEPa06Y0Ph6vY= +github.com/spf13/viper v1.20.0/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -813,68 +709,54 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= -github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +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.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= -github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= +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/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/ugorji/go/codec v1.2.9 h1:rmenucSohSTiyL09Y+l2OCk+FrMxGMzho2+tjr5ticU= -github.com/ugorji/go/codec v1.2.9/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= +github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= +github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= -github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= -github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= -github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= -github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= -github.com/zondax/ledger-go v0.14.1 h1:Pip65OOl4iJ84WTpA4BKChvOufMhhbxED3BaihoZN4c= -github.com/zondax/ledger-go v0.14.1/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2feOQv8K320= +github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= +github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= +github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= +github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= -go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 h1:qxen9oVGzDdIRP6ejyAJc760RwW4SnVDiTYTzwnXuxo= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5/go.mod h1:eW0HG9/oHQhvRCvb1/pIXW4cOvtDqeQK+XSi3TnwaXY= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U= +go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg= +go.opentelemetry.io/otel/metric v1.32.0 h1:xV2umtmNcThh2/a/aCP+h64Xx5wsj8qqnkYZktzNa0M= +go.opentelemetry.io/otel/metric v1.32.0/go.mod h1:jH7CIbbK6SH2V2wE16W05BHCtIDzauciCRLoc/SyMv8= +go.opentelemetry.io/otel/sdk v1.32.0 h1:RNxepc9vK59A8XsgZQouW8ue8Gkb4jpWtJm9ge5lEG4= +go.opentelemetry.io/otel/sdk v1.32.0/go.mod h1:LqgegDBjKMmb2GC6/PrTnteJG39I8/vJCAP9LlJXEjU= +go.opentelemetry.io/otel/sdk/metric v1.32.0 h1:rZvFnvmvawYb0alrYkjraqJq0Z4ZUJAiyYCU9snn1CU= +go.opentelemetry.io/otel/sdk/metric v1.32.0/go.mod h1:PWeZlq0zt9YkYAp3gjKZ0eicRYvOh1Gd+X99x6GHpCQ= +go.opentelemetry.io/otel/trace v1.32.0 h1:WIC9mYrXf8TmY/EXuULKc8hR17vE+Hjv2cssQDe03fM= +go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L+V8e9a7YvhT8= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -884,6 +766,8 @@ go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= +go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= @@ -892,62 +776,35 @@ golang.org/x/arch v0.0.0-20210923205945-b76863e36670 h1:18EFjUmQOcUvxNYSkA6jO9VA golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= -golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= -golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= +golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= +golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= +golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= +golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= 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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -959,73 +816,39 @@ golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= 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= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= -golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.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-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1034,20 +857,12 @@ golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 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-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= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1056,263 +871,124 @@ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/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-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220315194320-039c03cc5b86/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= +golang.org/x/sys v0.30.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.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU= +golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s= 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= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -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= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/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-20181221001348-537d06c36207/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-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= +golang.org/x/tools v0.27.0 h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o= +golang.org/x/tools v0.27.0/go.mod h1:sUi0ZgbwW9ZPAq26Ekut+weQPR5eIM6GQLQ1Yjm1H0Q= 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= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -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-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= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20230525234025-438c736192d0 h1:x1vNwUhVOcsYoKyEGCZBH694SBmmBjA2EfauFVEI2+M= -google.golang.org/genproto v0.0.0-20230525234025-438c736192d0/go.mod h1:9ExIQyXL5hZrHzQceCwuSYwZZ5QZBazOcprJ5rgs3lY= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a h1:HiYVD+FGJkTo+9zj1gqz0anapsa1JxjiSrN+BJKyUmE= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a/go.mod h1:ts19tUU+Z0ZShN1y3aPyq2+O3d5FUNNgT6FtOzmrNn8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 h1:ToEetK57OidYuqD4Q5w+vfEnPvPpuTwedCNVohYJfNk= +google.golang.org/genproto v0.0.0-20241118233622-e639e219e697/go.mod h1:JJrvXBWRZaFMxBufik1a4RpFw4HhgVtBBWQeQgUj2cc= +google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 h1:CkkIfIt50+lT6NHAVoRYEyAvQGFM7xEwXUUywFvEb3Q= +google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576/go.mod h1:1R3kvZ1dtP3+4p4d3G8uJ8rFk/fWlScl38vanWACI08= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250122153221-138b5a5a4fd4 h1:yrTuav+chrF0zF/joFGICKTzYv7mh/gr9AgEXrVU8ao= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250122153221-138b5a5a4fd4/go.mod h1:+2Yz8+CLJbIfL9z73EW45avw8Lmge3xVElCP9zEKi50= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= +google.golang.org/grpc v1.70.0 h1:pWFv03aZoHzlRKHWicjsZytKAiYCtNS0dHbXnIdq7jQ= +google.golang.org/grpc v1.70.0/go.mod h1:ofIJqVKDXx/JiXrwr2IG4/zwdH9txy3IlF40RmcJSQw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1327,8 +1003,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.36.4 h1:6A3ZDJHn/eNqc1i+IdefRzy/9PokBTPvcqMySR7NNIM= +google.golang.org/protobuf v1.36.4/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1340,10 +1016,6 @@ gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qS 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/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= -gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -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/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= @@ -1358,30 +1030,22 @@ gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 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= -gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= -gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= +gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q= +gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -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= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= -pgregory.net/rapid v0.6.2 h1:ErW5sL+UKtfBfUTsWHDCoeB+eZKLKMxrSd1VJY6W4bw= -pgregory.net/rapid v0.6.2/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= +pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= +pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/tools/confix/match.go b/tools/confix/match.go new file mode 100644 index 000000000000..9e05d5f02192 --- /dev/null +++ b/tools/confix/match.go @@ -0,0 +1,63 @@ +package confix + +import ( + "sort" + + "github.com/creachadair/tomledit" + "github.com/creachadair/tomledit/transform" +) + +// MatchKeys diffs the keyspaces of the TOML documents in files lhs and rhs. +// Comments, order, and values are ignored for comparison purposes. +// It will return in the format of map[oldKey]newKey +func MatchKeys(lhs, rhs *tomledit.Document) map[string]string { + matches := matchDocs(map[string]string{}, allKVs(lhs.Global), allKVs(rhs.Global)) + + lsec, rsec := lhs.Sections, rhs.Sections + transform.SortSectionsByName(lsec) + transform.SortSectionsByName(rsec) + + i, j := 0, 0 + for i < len(lsec) && j < len(rsec) { + switch { + case lsec[i].Name.Before(rsec[j].Name): + i++ + case rsec[j].Name.Before(lsec[i].Name): + j++ + default: + matches = matchDocs(matches, allKVs(lsec[i]), allKVs(rsec[j])) + i++ + j++ + } + } + + return matches +} + +// matchDocs get all the keys matching in lhs and rhs. +// value of keys are ignored +func matchDocs(matchesMap map[string]string, lhs, rhs []KV) map[string]string { + sort.Slice(lhs, func(i, j int) bool { + return lhs[i].Key < lhs[j].Key + }) + sort.Slice(rhs, func(i, j int) bool { + return rhs[i].Key < rhs[j].Key + }) + + i, j := 0, 0 + for i < len(lhs) && j < len(rhs) { + switch { + case lhs[i].Key < rhs[j].Key: + i++ + case lhs[i].Key > rhs[j].Key: + j++ + default: + // key exists in both lhs and rhs + matchesMap[lhs[i].Key] = rhs[j].Key + i++ + j++ + } + } + + return matchesMap +} diff --git a/tools/confix/migrations.go b/tools/confix/migrations.go index 254fb9fa2dc4..cc34ffadf38d 100644 --- a/tools/confix/migrations.go +++ b/tools/confix/migrations.go @@ -11,35 +11,69 @@ import ( ) const ( - AppConfig = "app.toml" - ClientConfig = "client.toml" - CMTConfig = "config.toml" + AppConfig = "app.toml" + AppConfigType = "app" + ClientConfig = "client.toml" + ClientConfigType = "client" + CMTConfig = "config.toml" ) // MigrationMap defines a mapping from a version to a transformation plan. -type MigrationMap map[string]func(from *tomledit.Document, to string) transform.Plan +type MigrationMap map[string]func(from *tomledit.Document, to, planType string) (transform.Plan, *tomledit.Document) + +// loadDestConfigFile is the function signature to load the destination version +// configuration toml file. +type loadDestConfigFile func(to, planType string) (*tomledit.Document, error) var Migrations = MigrationMap{ "v0.45": NoPlan, // Confix supports only the current supported SDK version. So we do not support v0.44 -> v0.45. - "v0.46": PlanBuilder, - "v0.47": PlanBuilder, - "v0.50": PlanBuilder, - // "v0.xx.x": PlanBuilder, // add specific migration in case of configuration changes in minor versions + "v0.46": defaultPlanBuilder, + "v0.47": defaultPlanBuilder, + "v0.50": defaultPlanBuilder, + "v0.52": defaultPlanBuilder, + "v2": V2PlanBuilder, + // "v0.xx.x": defaultPlanBuilder, // add specific migration in case of configuration changes in minor versions +} + +type v2KeyChangesMap map[string][]string + +// list all the keys which are need to be modified in v2 +var v2KeyChanges = v2KeyChangesMap{ + "minimum-gas-prices": []string{"server.minimum-gas-prices"}, + "min-retain-blocks": []string{"comet.min-retain-blocks"}, + "index-events": []string{"comet.index-abci-events"}, + "halt-height": []string{"comet.halt-height"}, + "halt-time": []string{"comet.halt-time"}, + "app-db-backend": []string{"store.app-db-backend"}, + "pruning-keep-recent": []string{ + "store.options.sc-pruning-option.keep-recent", + }, + "pruning-interval": []string{ + "store.options.sc-pruning-option.interval", + }, + "iavl-cache-size": []string{"store.options.iavl-config.cache-size"}, + "iavl-disable-fastnode": []string{"store.options.iavl-config.skip-fast-storage-upgrade"}, + "telemetry.enabled": []string{"telemetry.enable"}, + "mempool.max-txs": []string{"comet.mempool.max-txs"}, + // Add other key mappings as needed +} + +func defaultPlanBuilder(from *tomledit.Document, to, planType string) (transform.Plan, *tomledit.Document) { + return PlanBuilder(from, to, planType, LoadLocalConfig) } // PlanBuilder is a function that returns a transformation plan for a given diff between two files. -func PlanBuilder(from *tomledit.Document, to string) transform.Plan { +func PlanBuilder(from *tomledit.Document, to, planType string, loadFn loadDestConfigFile) (transform.Plan, *tomledit.Document) { plan := transform.Plan{} deletedSections := map[string]bool{} - target, err := LoadLocalConfig(to) + target, err := loadFn(to, planType) if err != nil { panic(fmt.Errorf("failed to parse file: %w. This file should have been valid", err)) } diffs := DiffKeys(from, target) for _, diff := range diffs { - diff := diff kv := diff.KV var step transform.Step @@ -51,12 +85,13 @@ func PlanBuilder(from *tomledit.Document, to string) transform.Plan { step = transform.Step{ Desc: fmt.Sprintf("add %s section", kv.Key), T: transform.Func(func(_ context.Context, doc *tomledit.Document) error { + title := fmt.Sprintf("### %s Configuration ###", strings.Title(kv.Key)) doc.Sections = append(doc.Sections, &tomledit.Section{ Heading: &parser.Heading{ Block: parser.Comments{ - "###############################################################################", - fmt.Sprintf("### %s Configuration ###", strings.Title(kv.Key)), - "###############################################################################", + strings.Repeat("#", len(title)), + title, + strings.Repeat("#", len(title)), }, Name: keys, }, @@ -77,9 +112,9 @@ func PlanBuilder(from *tomledit.Document, to string) transform.Plan { } else if len(keys) > 1 { step = transform.Step{ Desc: fmt.Sprintf("add %s key", kv.Key), - T: transform.EnsureKey(parser.Key{keys[0]}, &parser.KeyValue{ + T: transform.EnsureKey(keys[0:len(keys)-1], &parser.KeyValue{ Block: kv.Block, - Name: parser.Key{keys[1]}, + Name: parser.Key{keys[len(keys)-1]}, Value: parser.MustValue(kv.Value), }), } @@ -90,27 +125,125 @@ func PlanBuilder(from *tomledit.Document, to string) transform.Plan { } else { if diff.Type == Section { deletedSections[kv.Key] = true - } - - // when the whole section is deleted we don't need to remove the keys - if len(keys) > 1 && deletedSections[keys[0]] { - continue - } + step = transform.Step{ + Desc: fmt.Sprintf("remove %s section", kv.Key), + T: transform.Remove(keys), + } + } else { + // when the whole section is deleted we don't need to remove the keys + if len(keys) > 1 && deletedSections[keys[0]] { + continue + } - step = transform.Step{ - Desc: fmt.Sprintf("remove %s key", kv.Key), - T: transform.Remove(keys), + step = transform.Step{ + Desc: fmt.Sprintf("remove %s key", kv.Key), + T: transform.Remove(keys), + } } } plan = append(plan, step) } - return plan + return plan, from } // NoPlan returns a no-op plan. -func NoPlan(_ *tomledit.Document, to string) transform.Plan { +func NoPlan(from *tomledit.Document, to, planType string) (transform.Plan, *tomledit.Document) { fmt.Printf("no migration needed to %s\n", to) - return transform.Plan{} + return transform.Plan{}, from +} + +// V2PlanBuilder is a function that returns a transformation plan to convert to v2 config +func V2PlanBuilder(from *tomledit.Document, to, planType string) (transform.Plan, *tomledit.Document) { + target, err := LoadLocalConfig(to, planType) + if err != nil { + panic(fmt.Errorf("failed to parse file: %w. This file should have been valid", err)) + } + + plan := transform.Plan{} + plan = updateMatchedKeysPlan(from, target, plan) + plan = applyKeyChangesPlan(from, plan) + + return plan, target +} + +// updateMatchedKeysPlan updates all matched keys with old key values +func updateMatchedKeysPlan(from, target *tomledit.Document, plan transform.Plan) transform.Plan { + matches := MatchKeys(from, target) + for oldKey, newKey := range matches { + oldEntry := getEntry(from, oldKey) + if oldEntry == nil { + continue + } + + // check if the key "app-db-backend" exists and if its value is empty in the existing config + // If the value is empty, update the key value with the default value + // of v2 i.e., goleveldb to prevent network failures. + if isAppDBBackend(newKey, oldEntry) { + continue // lets keep app-db-backend with v2 default value + } + + // update newKey value with old entry value + step := createUpdateStep(oldKey, newKey, oldEntry) + plan = append(plan, step) + } + return plan +} + +// applyKeyChangesPlan checks if key changes are needed with the "to" version and applies them +func applyKeyChangesPlan(from *tomledit.Document, plan transform.Plan) transform.Plan { + changes := v2KeyChanges + for oldKey, newKeys := range changes { + oldEntry := getEntry(from, oldKey) + if oldEntry == nil { + continue + } + + for _, newKey := range newKeys { + // check if the key "app-db-backend" exists and if its value is empty in the existing config + // If the value is empty, update the key value with the default value + // of v2 i.e., goleveldb to prevent network failures. + if isAppDBBackend(newKey, oldEntry) { + continue // lets keep app-db-backend with v2 default value + } + + // update newKey value with old entry value + step := createUpdateStep(oldKey, newKey, oldEntry) + plan = append(plan, step) + } + } + return plan +} + +// getEntry retrieves the first entry for the given key from the document +func getEntry(doc *tomledit.Document, key string) *parser.KeyValue { + splitKeys := strings.Split(key, ".") + entry := doc.First(splitKeys...) + if entry == nil || entry.KeyValue == nil { + return nil + } + return entry.KeyValue +} + +// isAppDBBackend checks if the key is "store.app-db-backend" and the value is empty +func isAppDBBackend(key string, entry *parser.KeyValue) bool { + return key == "store.app-db-backend" && entry.Value.String() == `""` +} + +// createUpdateStep creates a transformation step to update a key with a new key value +func createUpdateStep(oldKey, newKey string, oldEntry *parser.KeyValue) transform.Step { + return transform.Step{ + Desc: fmt.Sprintf("updating %s key with %s key", oldKey, newKey), + T: transform.Func(func(_ context.Context, doc *tomledit.Document) error { + splitNewKeys := strings.Split(newKey, ".") + newEntry := doc.First(splitNewKeys...) + if newEntry == nil || newEntry.KeyValue == nil { + return nil + } + + newEntry.KeyValue.Value = oldEntry.Value + return nil + }), + } } diff --git a/tools/confix/sonar-project.properties b/tools/confix/sonar-project.properties deleted file mode 100644 index cb3df0b72d2f..000000000000 --- a/tools/confix/sonar-project.properties +++ /dev/null @@ -1,14 +0,0 @@ -sonar.projectKey=cosmos-sdk-tools-confix -sonar.organization=cosmos - -sonar.projectName=Cosmos SDK - Confix -sonar.project.monorepo.enabled=true - -sonar.sources=. -sonar.exclusions=**/*_test.go -sonar.tests=. -sonar.test.inclusions=**/*_test.go -sonar.go.coverage.reportPaths=coverage.out - -sonar.sourceEncoding=UTF-8 -sonar.scm.provider=git \ No newline at end of file diff --git a/tools/confix/upgrade.go b/tools/confix/upgrade.go index 203410d163e5..29fdb51111e1 100644 --- a/tools/confix/upgrade.go +++ b/tools/confix/upgrade.go @@ -14,7 +14,6 @@ import ( "github.com/spf13/viper" clientcfg "github.com/cosmos/cosmos-sdk/client/config" - srvcfg "github.com/cosmos/cosmos-sdk/server/config" ) // Upgrade reads the configuration file at configPath and applies any @@ -28,34 +27,30 @@ import ( // Upgrade is a convenience wrapper for calls to LoadConfig, ApplyFixes, and // CheckValid. If the caller requires more control over the behavior of the // Upgrade, call those functions directly. -func Upgrade(ctx context.Context, plan transform.Plan, configPath, outputPath string, skipValidate bool) error { +func Upgrade(ctx context.Context, plan transform.Plan, doc *tomledit.Document, configPath, outputPath string, skipValidate bool) error { if configPath == "" { return errors.New("empty input configuration path") } - doc, err := LoadConfig(configPath) - if err != nil { - return fmt.Errorf("loading config: %v", err) - } - // transforms doc and reports whether it succeeded. if err := plan.Apply(ctx, doc); err != nil { - return fmt.Errorf("updating %q: %v", configPath, err) + return fmt.Errorf("updating %q: %w", configPath, err) } var buf bytes.Buffer if err := tomledit.Format(&buf, doc); err != nil { - return fmt.Errorf("formatting config: %v", err) + return fmt.Errorf("formatting config: %w", err) } // allow to skip validation if !skipValidate { // verify that file is valid after applying fixes if err := CheckValid(configPath, buf.Bytes()); err != nil { - return fmt.Errorf("updated config is invalid: %v", err) + return fmt.Errorf("updated config is invalid: %w", err) } } + var err error if outputPath == "" { _, err = os.Stdout.Write(buf.Bytes()) } else { @@ -77,14 +72,8 @@ func CheckValid(fileName string, data []byte) error { switch { case strings.HasSuffix(fileName, AppConfig): - var cfg srvcfg.Config - if err := v.Unmarshal(&cfg); err != nil { - return fmt.Errorf("failed to unmarshal as server config: %w", err) - } - - if err := cfg.ValidateBasic(); err != nil { - return fmt.Errorf("server config invalid : %w", err) - } + // no validation of server config as v1 and v2 configs are both valid. + // any app.toml is simply considered as a server config. case strings.HasSuffix(fileName, ClientConfig): var cfg clientcfg.ClientConfig if err := v.Unmarshal(&cfg); err != nil { diff --git a/tools/confix/upgrade_test.go b/tools/confix/upgrade_test.go index 557345469cb0..6583e41bc67a 100644 --- a/tools/confix/upgrade_test.go +++ b/tools/confix/upgrade_test.go @@ -4,11 +4,13 @@ import ( "os" "testing" - "cosmossdk.io/tools/confix" "gotest.tools/v3/assert" + + "cosmossdk.io/tools/confix" ) func mustReadConfig(t *testing.T, path string) []byte { + t.Helper() f, err := os.ReadFile(path) if err != nil { t.Fatalf("failed to open file: %v", err) @@ -17,10 +19,6 @@ func mustReadConfig(t *testing.T, path string) []byte { return f } -func TestUpgrade(t *testing.T) { - // TODO: add more test cases -} - func TestCheckValid(t *testing.T) { err := confix.CheckValid("foo", []byte{}) assert.ErrorContains(t, err, "unknown config") @@ -37,9 +35,6 @@ func TestCheckValid(t *testing.T) { err = confix.CheckValid("client.toml", []byte{}) assert.Error(t, err, "client config invalid: chain-id is empty") - err = confix.CheckValid("app.toml", []byte{}) - assert.ErrorContains(t, err, "server config invalid") - err = confix.CheckValid("app.toml", mustReadConfig(t, "data/v0.45-app.toml")) assert.NilError(t, err) diff --git a/tools/cosmovisor/CHANGELOG.md b/tools/cosmovisor/CHANGELOG.md index 59b93c7ce318..6746a0512628 100644 --- a/tools/cosmovisor/CHANGELOG.md +++ b/tools/cosmovisor/CHANGELOG.md @@ -36,28 +36,72 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] -## Features +## v1.7.1 - 2025-01-12 -* [#12457](https://github.com/cosmos/cosmos-sdk/issues/12457) Add `cosmovisor pre-upgrade` command to manually add an upgrade to cosmovisor. -* [#15361](https://github.com/cosmos/cosmos-sdk/pull/15361) Add `cosmovisor config` command to display the configuration used by cosmovisor. +### Bug Fixes + +* [#23652](https://github.com/cosmos/cosmos-sdk/pull/23652) Fix issue with wrong directory placement when using `prepare-upgrade` for non archive. +* [#23653](https://github.com/cosmos/cosmos-sdk/pull/23653) Remove duplicate binary downloads during auto-download process + +## v1.7.0 - 2024-11-18 + +### Features + +* [#21790](https://github.com/cosmos/cosmos-sdk/pull/21790) Add `add-batch-upgrade` command. +* [#21972](https://github.com/cosmos/cosmos-sdk/pull/21972) Add `prepare-upgrade` command +* [#21932](https://github.com/cosmos/cosmos-sdk/pull/21932) Add `cosmovisor show-upgrade-info` command to display the upgrade-info.json into stdout. + +### Improvements + +* [#21891](https://github.com/cosmos/cosmos-sdk/pull/21891) create `current` symlink as relative +* [#21462](https://github.com/cosmos/cosmos-sdk/pull/21462) Pass `stdin` to binary. + +### Bug Fixes + +* [#22528](https://github.com/cosmos/cosmos-sdk/pull/22528) Fix premature upgrades on restarting cosmovisor. + +## v1.6.0 - 2024-08-12 + +## Improvements + +* Bump `cosmossdk.io/x/upgrade` to v0.1.4 (including go-getter vulnerability fix) +* [#19995](https://github.com/cosmos/cosmos-sdk/pull/19995): + * `init command` writes the configuration to the config file only at the default path `DAEMON_HOME/cosmovisor/config.toml`. + * Provide `--cosmovisor-config` flag with value as args to provide the path to the configuration file in the `run` command. `run --cosmovisor-config (other cmds with flags) ...`. + * Add `--cosmovisor-config` flag to provide `config.toml` path to the configuration file in root command used by `add-upgrade` and `config` subcommands. + * `config command` now displays the configuration from the config file if it is provided. If the config file is not provided, it will display the configuration from the environment variables. -## Client Breaking Changes +## Bug Fixes -* [#14881](https://github.com/cosmos/cosmos-sdk/pull/14881) Cosmovisor supports only upgrade plan with a checksum. This is enforced by the `x/upgrade` module for better security. +* [#20062](https://github.com/cosmos/cosmos-sdk/pull/20062) Fixed cosmovisor add-upgrade permissions +* [#20585](https://github.com/cosmos/cosmos-sdk/pull/20585) Always parse stdout and stderr +* [#20585](https://github.com/cosmos/cosmos-sdk/pull/20585) Pass right home to command `status` +* [#20585](https://github.com/cosmos/cosmos-sdk/pull/20585) Fix upgrades applied automatically (check two casing of sync_info) + +## v1.5.0 - 2023-07-17 + +## Features + +* [#16413](https://github.com/cosmos/cosmos-sdk/issues/16413) Add `cosmovisor add-upgrade` command to manually add an upgrade to cosmovisor. +* [#16573](https://github.com/cosmos/cosmos-sdk/pull/16573) Extend `cosmovisor` configuration with new log format options. +* [#16550](https://github.com/cosmos/cosmos-sdk/pull/16550) Add COSMOVISOR_CUSTOM_PREUPGRADE to cosmovisor to execute custom pre-upgrade scripts (separate from daemon `pre-upgrade` command). +* [#16963](https://github.com/cosmos/cosmos-sdk/pull/16963) Add DAEMON_SHUTDOWN_GRACE to send interrupt and wait before sending kill. +* [#15361](https://github.com/cosmos/cosmos-sdk/pull/15361) Add `cosmovisor config` command to display the configuration used by cosmovisor. ## Improvements +* [#16919](https://github.com/cosmos/cosmos-sdk/pull/16919) Add COSMOVISOR_DISABLE_RECASE to cosmovisor to disable automatic case change for plan name. * [#14881](https://github.com/cosmos/cosmos-sdk/pull/14881) Refactor Cosmovisor to use `x/upgrade` validation logic. * [#14881](https://github.com/cosmos/cosmos-sdk/pull/14881) Refactor Cosmovisor to depend only on the `x/upgrade` module. -* [#15362](https://github.com/cosmos/cosmos-sdk/pull/15362) Allow disabling Cosmovisor logs +* [#15362](https://github.com/cosmos/cosmos-sdk/pull/15362) Allow disabling Cosmovisor logs. -## v1.4.0 2022-10-23 +## v1.4.0 - 2022-10-23 ### API Breaking Changes -* [#13603](https://github.com/cosmos-sdk/pull/13603) Rename cosmovisor package to `cosmossdk.io/tools/cosmovisor`. +* [#13603](https://github.com/cosmos/cosmos-sdk/pull/13603) Rename cosmovisor package to `cosmossdk.io/tools/cosmovisor`. -## v1.3.0 2022-09-11 +## v1.3.0 - 2022-09-11 ### Improvements @@ -68,7 +112,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#13221](https://github.com/cosmos/cosmos-sdk/pull/13221) Fix `go install`. -## v1.2.0 2022-07-26 +## v1.2.0 - 2022-07-26 ### Features @@ -85,7 +129,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [\#12188](https://github.com/cosmos/cosmos-sdk/pull/12188) Remove the possibility to set a time with only a number. `DAEMON_POLL_INTERVAL` env variable now only supports a duration (e.g. `100ms`, `30s`, `20m`). -## v1.1.0 2022-02-10 +## v1.1.0 - 2022-02-10 ### Features @@ -100,7 +144,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [\#10458](https://github.com/cosmos/cosmos-sdk/pull/10458) Fix version when using 'go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@v1.0.0' to install cosmovisor. -## v1.0.0 2021-09-30 +## v1.0.0 - 2021-09-30 ### Features @@ -119,7 +163,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [\#10128](https://github.com/cosmos/cosmos-sdk/pull/10128) Change default value of `DAEMON_RESTART_AFTER_UPGRADE` to `true`. -## v0.1 2021-08-06 +## v0.1.0 - 2021-08-06 This is the first release and we started this changelog on 2021-07-01. See the [README](https://github.com/cosmos/cosmos-sdk/blob/release/cosmovisor/v0.1.x/cosmovisor/CHANGELOG.md) file for the full list of features. diff --git a/tools/cosmovisor/Makefile b/tools/cosmovisor/Makefile index b5a7be601e9c..94a02976acf3 100644 --- a/tools/cosmovisor/Makefile +++ b/tools/cosmovisor/Makefile @@ -4,6 +4,7 @@ all: cosmovisor test cosmovisor: go build -mod=readonly ./cmd/cosmovisor + @echo "cosmovisor binary has been successfully built in tools/cosmovisor/cosmovisor" test: go test -mod=readonly -race ./... diff --git a/tools/cosmovisor/README.md b/tools/cosmovisor/README.md index be2aded5dbaf..3b5f722c5d1b 100644 --- a/tools/cosmovisor/README.md +++ b/tools/cosmovisor/README.md @@ -4,7 +4,8 @@ sidebar_position: 1 # Cosmovisor -`cosmovisor` is a small process manager for Cosmos SDK application binaries that monitors the governance module for incoming chain upgrade proposals. If it sees a proposal that gets approved, `cosmovisor` can automatically download the new binary, stop the current binary, switch from the old binary to the new one, and finally restart the node with the new binary. +`cosmovisor` is a process manager for Cosmos SDK application binaries that automates application binary switch at chain upgrades. +It polls the `upgrade-info.json` file that is created by the x/upgrade module at upgrade height, and then can automatically download the new binary, stop the current binary, switch from the old binary to the new one, and finally restart the node with the new binary. * [Design](#design) * [Contributing](#contributing) @@ -15,11 +16,13 @@ sidebar_position: 1 * [Usage](#usage) * [Initialization](#initialization) * [Detecting Upgrades](#detecting-upgrades) + * [Adding Upgrade Binary](#adding-upgrade-binary) * [Auto-Download](#auto-download) + * [Preparing for an Upgrade](#preparing-for-an-upgrade) * [Example: SimApp Upgrade](#example-simapp-upgrade) * [Chain Setup](#chain-setup) * [Prepare Cosmovisor and Start the Chain](#prepare-cosmovisor-and-start-the-chain) - * [Update App](#update-app) + * [Update App](#update-app) ## Design @@ -32,7 +35,13 @@ Cosmovisor is designed to be used as a wrapper for a `Cosmos SDK` app: *Note: If new versions of the application are not set up to run in-place store migrations, migrations will need to be run manually before restarting `cosmovisor` with the new binary. For this reason, we recommend applications adopt in-place store migrations.* -*Note: If validators would like to enable the auto-download option (which [we don't recommend](#auto-download)), and they are currently running an application using Cosmos SDK `v0.42`, they will need to use Cosmovisor [`v0.1`](https://github.com/cosmos/cosmos-sdk/releases/tag/cosmovisor%2Fv0.1.0). Later versions of Cosmovisor do not support Cosmos SDK `v0.44.3` or earlier if the auto-download option is enabled.* +:::tip +Only the latest version of cosmovisor is actively developed/maintained. +::: + +:::warning +Versions prior to v1.0.0 have a vulnerability that could lead to a DOS. Please upgrade to the latest version. +::: ## Contributing @@ -44,7 +53,7 @@ Release branches have the following format `release/cosmovisor/vA.B.x`, where A ### Installation -You can download Cosmovisor from the [GitHub releases](https://github.com/cosmos/cosmos-sdk/releases/tag/cosmovisor%2Fv1.3.0). +You can download Cosmovisor from the [GitHub releases](https://github.com/cosmos/cosmos-sdk/releases/tag/cosmovisor%2Fv1.5.0). To install the latest version of `cosmovisor`, run the following command: @@ -52,10 +61,10 @@ To install the latest version of `cosmovisor`, run the following command: go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest ``` -To install a previous version, you can specify the version. IMPORTANT: Chains that use Cosmos SDK v0.44.3 or earlier (eg v0.44.2) and want to use auto-download feature MUST use `cosmovisor v0.1.0` +To install a specific version, you can specify the version: ```shell -go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@v0.1.0 +go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.5.0 ``` Run `cosmovisor version` to check the cosmovisor version. @@ -63,7 +72,8 @@ Run `cosmovisor version` to check the cosmovisor version. Alternatively, for building from source, simply run `make cosmovisor`. The binary will be located in `tools/cosmovisor`. :::warning -Building from source using `make cosmovisor` won't display the correct `cosmovisor` version. +Installing cosmovisor using `go install` will display the correct `cosmovisor` version. +Building from source (`make cosmovisor`) or installing `cosmovisor` by other means won't display the correct version. ::: ### Command Line Arguments And Environment Variables @@ -74,26 +84,28 @@ The first argument passed to `cosmovisor` is the action for `cosmovisor` to take * `run` - Run the configured binary using the rest of the provided arguments. * `version` - Output the `cosmovisor` version and also run the binary with the `version` argument. * `config` - Display the current `cosmovisor` configuration, that means displaying the environment variables value that `cosmovisor` is using. -* `add-upgrade` - Add an upgrade manually to `cosmovisor`. +* `add-upgrade` - Add an upgrade manually to `cosmovisor`. This command allow you to easily add the binary corresponding to an upgrade in cosmovisor. All arguments passed to `cosmovisor run` will be passed to the application binary (as a subprocess). `cosmovisor` will return `/dev/stdout` and `/dev/stderr` of the subprocess as its own. For this reason, `cosmovisor run` cannot accept any command-line arguments other than those available to the application binary. -:::warning -Use of `cosmovisor` without one of the action arguments is deprecated. For backwards compatibility, if the first argument is not an action argument, `run` is assumed. However, this fallback might be removed in future versions, so it is recommended that you always provide `run`. -::: - -`cosmovisor` reads its configuration from environment variables: +`cosmovisor` reads its configuration from environment variables, or its configuration file (use `--cosmovisor-config `): * `DAEMON_HOME` is the location where the `cosmovisor/` directory is kept that contains the genesis binary, the upgrade binaries, and any additional auxiliary files associated with each binary (e.g. `$HOME/.gaiad`, `$HOME/.regend`, `$HOME/.simd`, etc.). * `DAEMON_NAME` is the name of the binary itself (e.g. `gaiad`, `regend`, `simd`, etc.). * `DAEMON_ALLOW_DOWNLOAD_BINARIES` (*optional*), if set to `true`, will enable auto-downloading of new binaries (for security reasons, this is intended for full nodes rather than validators). By default, `cosmovisor` will not auto-download new binaries. +* `DAEMON_DOWNLOAD_MUST_HAVE_CHECKSUM` (*optional*, default = `false`), if `true` cosmovisor will require that a checksum is provided in the upgrade plan for the binary to be downloaded. If `false`, cosmovisor will not require a checksum to be provided, but still check the checksum if one is provided. * `DAEMON_RESTART_AFTER_UPGRADE` (*optional*, default = `true`), if `true`, restarts the subprocess with the same command-line arguments and flags (but with the new binary) after a successful upgrade. Otherwise (`false`), `cosmovisor` stops running after an upgrade and requires the system administrator to manually restart it. Note restart is only after the upgrade and does not auto-restart the subprocess after an error occurs. * `DAEMON_RESTART_DELAY` (*optional*, default none), allow a node operator to define a delay between the node halt (for upgrade) and backup by the specified time. The value must be a duration (e.g. `1s`). +* `DAEMON_SHUTDOWN_GRACE` (*optional*, default none), if set, send interrupt to binary and wait the specified time to allow for cleanup/cache flush to disk before sending the kill signal. The value must be a duration (e.g. `1s`). * `DAEMON_POLL_INTERVAL` (*optional*, default 300 milliseconds), is the interval length for polling the upgrade plan file. The value must be a duration (e.g. `1s`). * `DAEMON_DATA_BACKUP_DIR` option to set a custom backup directory. If not set, `DAEMON_HOME` is used. * `UNSAFE_SKIP_BACKUP` (defaults to `false`), if set to `true`, upgrades directly without performing a backup. Otherwise (`false`, default) backs up the data before trying the upgrade. The default value of false is useful and recommended in case of failures and when a backup needed to rollback. We recommend using the default backup option `UNSAFE_SKIP_BACKUP=false`. -* `DAEMON_PREUPGRADE_MAX_RETRIES` (defaults to `0`). The maximum number of times to call [`pre-upgrade`](https://docs.cosmos.network/main/building-apps/app-upgrade#pre-upgrade-handling) in the application after exit status of `31`. After the maximum number of retries, Cosmovisor fails the upgrade. +* `DAEMON_PREUPGRADE_MAX_RETRIES` (defaults to `0`). The maximum number of times to call [`pre-upgrade`](https://docs.cosmos.network/main/build/building-apps/app-upgrade#pre-upgrade-handling) in the application after exit status of `31`. After the maximum number of retries, Cosmovisor fails the upgrade. * `COSMOVISOR_DISABLE_LOGS` (defaults to `false`). If set to true, this will disable Cosmovisor logs (but not the underlying process) completely. This may be useful, for example, when a Cosmovisor subcommand you are executing returns a valid JSON you are then parsing, as logs added by Cosmovisor make this output not a valid JSON. +* `COSMOVISOR_COLOR_LOGS` (defaults to `true`). If set to true, this will colorise Cosmovisor logs (but not the underlying process). +* `COSMOVISOR_TIMEFORMAT_LOGS` (defaults to `kitchen`). If set to a value (`layout|ansic|unixdate|rubydate|rfc822|rfc822z|rfc850|rfc1123|rfc1123z|rfc3339|rfc3339nano|kitchen`), this will add timestamp prefix to Cosmovisor logs (but not the underlying process). +* `COSMOVISOR_CUSTOM_PREUPGRADE` (defaults to ``). If set, this will run $DAEMON_HOME/cosmovisor/$COSMOVISOR_CUSTOM_PREUPGRADE prior to upgrade with the arguments [ upgrade.Name, upgrade.Height ]. Executes a custom script (separate and prior to the chain daemon pre-upgrade command) +* `COSMOVISOR_DISABLE_RECASE` (defaults to `false`). If set to true, the upgrade directory will expected to match the upgrade plan name without any case changes ### Folder Layout @@ -106,18 +118,19 @@ Use of `cosmovisor` without one of the action arguments is deprecated. For backw │   └── bin │   └── $DAEMON_NAME └── upgrades - └── - ├── bin - │   └── $DAEMON_NAME - └── upgrade-info.json +│ └── +│ ├── bin +│ │   └── $DAEMON_NAME +│ └── upgrade-info.json +└── preupgrade.sh (optional) ``` -The `cosmovisor/` directory incudes a subdirectory for each version of the application (i.e. `genesis` or `upgrades/`). Within each subdirectory is the application binary (i.e. `bin/$DAEMON_NAME`) and any additional auxiliary files associated with each binary. `current` is a symbolic link to the currently active directory (i.e. `genesis` or `upgrades/`). The `name` variable in `upgrades/` is the lowercased URI-encoded name of the upgrade as specified in the upgrade module plan. Note that the upgrade name path are normalized to be lowercased: for instance, `MyUpgrade` is normalized to `myupgrade`, and its path is `upgrades/myupgrade`. +The `cosmovisor/` directory includes a subdirectory for each version of the application (i.e. `genesis` or `upgrades/`). Within each subdirectory is the application binary (i.e. `bin/$DAEMON_NAME`) and any additional auxiliary files associated with each binary. `current` is a symbolic link to the currently active directory (i.e. `genesis` or `upgrades/`). The `name` variable in `upgrades/` is the lowercased URI-encoded name of the upgrade as specified in the upgrade module plan. Note that the upgrade name path are normalized to be lowercased: for instance, `MyUpgrade` is normalized to `myupgrade`, and its path is `upgrades/myupgrade`. -Please note that `$DAEMON_HOME/cosmovisor` only stores the *application binaries*. The `cosmovisor` binary itself can be stored in any typical location (e.g. `/usr/local/bin`). The application will continue to store its data in the default data directory (e.g. `$HOME/.gaiad`) or the data directory specified with the `--home` flag. `$DAEMON_HOME` is independent of the data directory and can be set to any location. If you set `$DAEMON_HOME` to the same directory as the data directory, you will end up with a configuation like the following: +Please note that `$DAEMON_HOME/cosmovisor` only stores the *application binaries*. The `cosmovisor` binary itself can be stored in any typical location (e.g. `/usr/local/bin`). The application will continue to store its data in the default data directory (e.g. `$HOME/.simapp`) or the data directory specified with the `--home` flag. `$DAEMON_HOME` is dependent of the data directory and must be set to the same directory as the data directory, you will end up with a configuration like the following: ```text -.gaiad +.simapp ├── config ├── data └── cosmovisor @@ -171,6 +184,18 @@ When the upgrade mechanism is triggered, `cosmovisor` will: 1. if `DAEMON_ALLOW_DOWNLOAD_BINARIES` is enabled, start by auto-downloading a new binary into `cosmovisor//bin` (where `` is the `upgrade-info.json:name` attribute); 2. update the `current` symbolic link to point to the new directory and save `data/upgrade-info.json` to `cosmovisor/current/upgrade-info.json`. +### Adding Upgrade Binary + +`cosmovisor` has an `add-upgrade` command that allows to easily link a binary to an upgrade. It creates a new folder in `cosmovisor/upgrades/` and copies the provided executable file to `cosmovisor/upgrades//bin/`. + +Using the `--upgrade-height` flag allows to specify at which height the binary should be switched, without going via a gorvernance proposal. +This enables support for an emergency coordinated upgrades where the binary must be switched at a specific height, but there is no time to go through a governance proposal. + +:::warning +`--upgrade-height` creates an `upgrade-info.json` file. This means if a chain upgrade via governance proposal is executed before the specified height with `--upgrade-height`, the governance proposal will overwrite the `upgrade-info.json` plan created by `add-upgrade --upgrade-height `. +Take this into consideration when using `--upgrade-height`. +::: + ### Auto-Download Generally, `cosmovisor` requires that the system administrator place all relevant binaries on disk before the upgrade happens. However, for people who don't need such control and want an automated setup (maybe they are syncing a non-validating fullnode and want to do little maintenance), there is another option. @@ -238,51 +263,75 @@ The result will look something like the following: `29139e1381b8177aec909fab9a75 You can also use `sha512sum` if you would prefer to use longer hashes, or `md5sum` if you would prefer to use broken hashes. Whichever you choose, make sure to set the hash algorithm properly in the checksum argument to the URL. +### Preparing for an Upgrade + +To prepare for an upgrade, use the `prepare-upgrade` command: + +```shell +cosmovisor prepare-upgrade +``` + +This command performs the following actions: + +1. Retrieves upgrade information directly from the blockchain about the next scheduled upgrade. +2. Downloads the new binary specified in the upgrade plan. +3. Verifies the binary's checksum (if required by configuration). +4. Places the new binary in the appropriate directory for Cosmovisor to use during the upgrade. + +The `prepare-upgrade` command provides detailed logging throughout the process, including: + +* The name and height of the upcoming upgrade +* The URL from which the new binary is being downloaded +* Confirmation of successful download and verification +* The path where the new binary has been placed + +Example output: + +```bash +INFO Preparing for upgrade name=v1.0.0 height=1000000 +INFO Downloading upgrade binary url=https://example.com/binary/v1.0.0?checksum=sha256:339911508de5e20b573ce902c500ee670589073485216bee8b045e853f24bce8 +INFO Upgrade preparation complete name=v1.0.0 height=1000000 +``` + +*Note: The current way of downloading manually and placing the binary at the right place would still work.* + ## Example: SimApp Upgrade The following instructions provide a demonstration of `cosmovisor` using the simulation application (`simapp`) shipped with the Cosmos SDK's source code. The following commands are to be run from within the `cosmos-sdk` repository. ### Chain Setup -Let's create a new chain using the `v0.44` version of simapp (the Cosmos SDK demo app): +Let's create a new chain using the `v0.47.4` version of simapp (the Cosmos SDK demo app): ```shell -git checkout v0.44.6 +git checkout v0.47.4 make build ``` Clean `~/.simapp` (never do this in a production environment): ```shell -./build/simd unsafe-reset-all +./build/simd tendermint unsafe-reset-all ``` Set up app config: ```shell -./build/simd config set client chain-id test -./build/simd config set client keyring-backend test -./build/simd config set client broadcast-mode sync +./build/simd config chain-id test +./build/simd config keyring-backend test +./build/simd config broadcast-mode sync ``` Initialize the node and overwrite any previous genesis file (never do this in a production environment): - - ```shell ./build/simd init test --chain-id test --overwrite ``` -Set the minimum gas price to `0stake` in `~/.simapp/config/app.toml`: - -```shell -minimum-gas-prices = "0stake" -``` - For the sake of this demonstration, amend `voting_period` in `genesis.json` to a reduced time of 20 seconds (`20s`): ```shell -cat <<< $(jq '.app_state.gov.voting_params.voting_period = "20s"' $HOME/.simapp/config/genesis.json) > $HOME/.simapp/config/genesis.json +cat <<< $(jq '.app_state.gov.params.voting_period = "20s"' $HOME/.simapp/config/genesis.json) > $HOME/.simapp/config/genesis.json ``` Create a validator, and setup genesis transaction: @@ -309,60 +358,52 @@ Set the optional environment variable to trigger an automatic app restart: export DAEMON_RESTART_AFTER_UPGRADE=true ``` -Create the folder for the genesis binary and copy the `simd` binary: +Initialize cosmovisor with the current binary: ```shell -mkdir -p $DAEMON_HOME/cosmovisor/genesis/bin -cp ./build/simd $DAEMON_HOME/cosmovisor/genesis/bin +cosmovisor init ./build/simd ``` -Now you can run cosmovisor with simapp v0.44: +Now you can run cosmovisor with simapp v0.47.4: ```shell cosmovisor run start ``` -#### Update App +### Update App -Update app to the latest version (e.g. v0.45). +Update app to the latest version (e.g. v0.50.0). -Next, we can add a migration - which is defined using `x/upgrade` [upgrade plan](https://github.com/cosmos/cosmos-sdk/blob/main/docs/core/upgrade.md) (you may refer to a past version if you are using an older Cosmos SDK release). In a migration we can do any deterministic state change. +:::note -Build the new version `simd` binary: +Migration plans are defined using the `x/upgrade` module and described in [In-Place Store Migrations](https://github.com/cosmos/cosmos-sdk/blob/main/docs/learn/advanced/15-upgrade.md). Migrations can perform any deterministic state change. -```shell -make build -``` +The migration plan to upgrade the simapp from v0.47 to v0.50 is defined in `simapp/upgrade.go`. + +::: -Create the folder for the upgrade binary and copy the `simd` binary: +Build the new version `simd` binary: ```shell -mkdir -p $DAEMON_HOME/cosmovisor/upgrades/test1/bin -cp ./build/simd $DAEMON_HOME/cosmovisor/upgrades/test1/bin +make build ``` -Open a new terminal window and submit an upgrade proposal along with a deposit and a vote (these commands must be run within 20 seconds of each other): +Add the new `simd` binary and the upgrade name: -**<= v0.45**: +:::warning -```shell -./build/simd tx gov submit-proposal software-upgrade test1 --title upgrade --description upgrade --upgrade-height 200 --from validator --yes -./build/simd tx gov deposit 1 10000000stake --from validator --yes -./build/simd tx gov vote 1 yes --from validator --yes -``` +The migration name must match the one defined in the migration plan. -**v0.46, v0.47**: +::: ```shell -./build/simd tx gov submit-legacy-proposal software-upgrade test1 --title upgrade --description upgrade --upgrade-height 200 --from validator --yes -./build/simd tx gov deposit 1 10000000stake --from validator --yes -./build/simd tx gov vote 1 yes --from validator --yes +cosmovisor add-upgrade v047-to-v050 ./build/simd ``` -**>= v0.50+**: +Open a new terminal window and submit an upgrade proposal along with a deposit and a vote (these commands must be run within 20 seconds of each other): ```shell -./build/simd tx upgrade software-upgrade test1 --title upgrade --summary upgrade --upgrade-height 200 --from validator --yes +./build/simd tx upgrade software-upgrade v047-to-v050 --title upgrade --summary upgrade --upgrade-height 200 --upgrade-info "{}" --no-validate --from validator --yes ./build/simd tx gov deposit 1 10000000stake --from validator --yes ./build/simd tx gov vote 1 yes --from validator --yes ``` diff --git a/tools/cosmovisor/RELEASE_NOTES.md b/tools/cosmovisor/RELEASE_NOTES.md index edd56731a36f..e840af68b7cb 100644 --- a/tools/cosmovisor/RELEASE_NOTES.md +++ b/tools/cosmovisor/RELEASE_NOTES.md @@ -1,7 +1,9 @@ -# Cosmovisor v1.4.0 Release Notes +# Cosmovisor v1.5.0 Release Notes -* Rename cosmovisor package to `cosmossdk.io/tools/cosmovisor`. +See the [CHANGELOG](https://github.com/cosmos/cosmos-sdk/blob/tools/cosmovisor/v1.5.0/tools/cosmovisor/CHANGELOG.md) for details on the changes in v1.5.0. -## Changelog +## Installation instructions -For more details, please see the [CHANGELOG](https://github.com/cosmos/cosmos-sdk/blob/tools/cosmovisor/v1.4.0/tools/cosmovisor/CHANGELOG.md). +```go +go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest +``` diff --git a/tools/cosmovisor/args.go b/tools/cosmovisor/args.go index 3d8c33a1e161..733f561faf1a 100644 --- a/tools/cosmovisor/args.go +++ b/tools/cosmovisor/args.go @@ -2,7 +2,9 @@ package cosmovisor import ( "encoding/json" + "errors" "fmt" + "io" "net/url" "os" "path/filepath" @@ -10,24 +12,33 @@ import ( "strings" "time" + "github.com/pelletier/go-toml/v2" + "github.com/spf13/viper" + "cosmossdk.io/log" - cverrors "cosmossdk.io/tools/cosmovisor/errors" "cosmossdk.io/x/upgrade/plan" upgradetypes "cosmossdk.io/x/upgrade/types" ) // environment variable names const ( - EnvHome = "DAEMON_HOME" - EnvName = "DAEMON_NAME" - EnvDownloadBin = "DAEMON_ALLOW_DOWNLOAD_BINARIES" - EnvRestartUpgrade = "DAEMON_RESTART_AFTER_UPGRADE" - EnvRestartDelay = "DAEMON_RESTART_DELAY" - EnvSkipBackup = "UNSAFE_SKIP_BACKUP" - EnvDataBackupPath = "DAEMON_DATA_BACKUP_DIR" - EnvInterval = "DAEMON_POLL_INTERVAL" - EnvPreupgradeMaxRetries = "DAEMON_PREUPGRADE_MAX_RETRIES" - EnvDisableLogs = "COSMOVISOR_DISABLE_LOGS" + EnvHome = "DAEMON_HOME" + EnvName = "DAEMON_NAME" + EnvDownloadBin = "DAEMON_ALLOW_DOWNLOAD_BINARIES" + EnvDownloadMustHaveChecksum = "DAEMON_DOWNLOAD_MUST_HAVE_CHECKSUM" + EnvRestartUpgrade = "DAEMON_RESTART_AFTER_UPGRADE" + EnvRestartDelay = "DAEMON_RESTART_DELAY" + EnvShutdownGrace = "DAEMON_SHUTDOWN_GRACE" + EnvSkipBackup = "UNSAFE_SKIP_BACKUP" + EnvDataBackupPath = "DAEMON_DATA_BACKUP_DIR" + EnvInterval = "DAEMON_POLL_INTERVAL" + EnvPreupgradeMaxRetries = "DAEMON_PREUPGRADE_MAX_RETRIES" + EnvGRPCAddress = "DAEMON_GRPC_ADDRESS" + EnvDisableLogs = "COSMOVISOR_DISABLE_LOGS" + EnvColorLogs = "COSMOVISOR_COLOR_LOGS" + EnvTimeFormatLogs = "COSMOVISOR_TIMEFORMAT_LOGS" + EnvCustomPreupgrade = "COSMOVISOR_CUSTOM_PREUPGRADE" + EnvDisableRecase = "COSMOVISOR_DISABLE_RECASE" ) const ( @@ -35,23 +46,30 @@ const ( genesisDir = "genesis" upgradesDir = "upgrades" currentLink = "current" -) -// must be the same as x/upgrade/types.UpgradeInfoFilename -const defaultFilename = "upgrade-info.json" + cfgFileName = "config" + cfgExtension = "toml" +) // Config is the information passed in to control the daemon type Config struct { - Home string - Name string - AllowDownloadBinaries bool - RestartAfterUpgrade bool - RestartDelay time.Duration - PollInterval time.Duration - UnsafeSkipBackup bool - DataBackupPath string - PreupgradeMaxRetries int - DisableLogs bool + Home string `toml:"daemon_home" mapstructure:"daemon_home"` + Name string `toml:"daemon_name" mapstructure:"daemon_name"` + AllowDownloadBinaries bool `toml:"daemon_allow_download_binaries" mapstructure:"daemon_allow_download_binaries" default:"false"` + DownloadMustHaveChecksum bool `toml:"daemon_download_must_have_checksum" mapstructure:"daemon_download_must_have_checksum" default:"false"` + RestartAfterUpgrade bool `toml:"daemon_restart_after_upgrade" mapstructure:"daemon_restart_after_upgrade" default:"true"` + RestartDelay time.Duration `toml:"daemon_restart_delay" mapstructure:"daemon_restart_delay"` + ShutdownGrace time.Duration `toml:"daemon_shutdown_grace" mapstructure:"daemon_shutdown_grace"` + PollInterval time.Duration `toml:"daemon_poll_interval" mapstructure:"daemon_poll_interval" default:"300ms"` + UnsafeSkipBackup bool `toml:"unsafe_skip_backup" mapstructure:"unsafe_skip_backup" default:"false"` + DataBackupPath string `toml:"daemon_data_backup_dir" mapstructure:"daemon_data_backup_dir"` + PreUpgradeMaxRetries int `toml:"daemon_preupgrade_max_retries" mapstructure:"daemon_preupgrade_max_retries" default:"0"` + GRPCAddress string `toml:"daemon_grpc_address" mapstructure:"daemon_grpc_address"` + DisableLogs bool `toml:"cosmovisor_disable_logs" mapstructure:"cosmovisor_disable_logs" default:"false"` + ColorLogs bool `toml:"cosmovisor_color_logs" mapstructure:"cosmovisor_color_logs" default:"true"` + TimeFormatLogs string `toml:"cosmovisor_timeformat_logs" mapstructure:"cosmovisor_timeformat_logs" default:"kitchen"` + CustomPreUpgrade string `toml:"cosmovisor_custom_preupgrade" mapstructure:"cosmovisor_custom_preupgrade" default:""` + DisableRecase bool `toml:"cosmovisor_disable_recase" mapstructure:"cosmovisor_disable_recase" default:"false"` // currently running upgrade currentUpgrade upgradetypes.Plan @@ -62,6 +80,11 @@ func (cfg *Config) Root() string { return filepath.Join(cfg.Home, rootName) } +// DefaultCfgPath returns the default path to the configuration file. +func (cfg *Config) DefaultCfgPath() string { + return filepath.Join(cfg.Root(), cfgFileName+"."+cfgExtension) +} + // GenesisBin is the path to the genesis binary - must be in place to start manager func (cfg *Config) GenesisBin() string { return filepath.Join(cfg.Root(), genesisDir, "bin", cfg.Name) @@ -85,19 +108,29 @@ func (cfg *Config) BaseUpgradeDir() string { // UpgradeInfoFilePath is the expected upgrade-info filename created by `x/upgrade/keeper`. func (cfg *Config) UpgradeInfoFilePath() string { - return filepath.Join(cfg.Home, "data", defaultFilename) + return filepath.Join(cfg.Home, "data", upgradetypes.UpgradeInfoFilename) +} + +// UpgradeInfoBatchFilePath is the same as UpgradeInfoFilePath but with a batch suffix. +func (cfg *Config) UpgradeInfoBatchFilePath() string { + return cfg.UpgradeInfoFilePath() + ".batch" } // SymLinkToGenesis creates a symbolic link from "./current" to the genesis directory. func (cfg *Config) SymLinkToGenesis() (string, error) { - genesis := filepath.Join(cfg.Root(), genesisDir) - link := filepath.Join(cfg.Root(), currentLink) + // workdir is set to cosmovisor directory so relative + // symlinks are getting resolved correctly + if err := os.Symlink(genesisDir, currentLink); err != nil { + return "", err + } - if err := os.Symlink(genesis, link); err != nil { + res, err := filepath.EvalSymlinks(cfg.GenesisBin()) + if err != nil { return "", err } + // and return the genesis binary - return cfg.GenesisBin(), nil + return res, nil } // WaitRestartDelay will block and wait until the RestartDelay has elapsed. @@ -111,38 +144,82 @@ func (cfg *Config) WaitRestartDelay() { // This will resolve the symlink to the underlying directory to make it easier to debug func (cfg *Config) CurrentBin() (string, error) { cur := filepath.Join(cfg.Root(), currentLink) + // if nothing here, fallback to genesis - info, err := os.Lstat(cur) - if err != nil { - // Create symlink to the genesis - return cfg.SymLinkToGenesis() - } // if it is there, ensure it is a symlink - if info.Mode()&os.ModeSymlink == 0 { + info, err := os.Lstat(cur) + if err != nil || (info.Mode()&os.ModeSymlink == 0) { // Create symlink to the genesis return cfg.SymLinkToGenesis() } - // resolve it - dest, err := os.Readlink(cur) + res, err := filepath.EvalSymlinks(cur) if err != nil { // Create symlink to the genesis return cfg.SymLinkToGenesis() } // and return the binary - binpath := filepath.Join(dest, "bin", cfg.Name) + binpath := filepath.Join(res, "bin", cfg.Name) + return binpath, nil } +// GetConfigFromFile will read the configuration from the config file at the given path. +// If the file path is not provided, it will read the configuration from the ENV variables. +// If a file path is provided and ENV variables are set, they will override the values in the file. +func GetConfigFromFile(filePath string) (*Config, error) { + if filePath == "" { + return GetConfigFromEnv(false) + } + + // ensure the file exist + if _, err := os.Stat(filePath); err != nil { + return nil, fmt.Errorf("config not found: at %s : %w", filePath, err) + } + + v := viper.New() + // read the configuration from the file + v.SetConfigFile(filePath) + // load the env variables + // if the env variable is set, it will override the value provided by the config + v.AutomaticEnv() + + if err := v.ReadInConfig(); err != nil { + return nil, fmt.Errorf("failed to read config file: %w", err) + } + + cfg := &Config{} + if err := v.Unmarshal(cfg); err != nil { + return nil, fmt.Errorf("failed to unmarshal configuration: %w", err) + } + + var ( + err error + errs []error + ) + + if cfg.TimeFormatLogs, err = getTimeFormatOption(cfg.TimeFormatLogs); err != nil { + errs = append(errs, err) + } + + errs = append(errs, cfg.validate()...) + if len(errs) > 0 { + return nil, errors.Join(errs...) + } + + return cfg, nil +} + // GetConfigFromEnv will read the environmental variables into a config // and then validate it is reasonable -func GetConfigFromEnv() (*Config, error) { +func GetConfigFromEnv(skipValidate bool) (*Config, error) { var errs []error cfg := &Config{ - Home: os.Getenv(EnvHome), - Name: os.Getenv(EnvName), - DataBackupPath: os.Getenv(EnvDataBackupPath), + Home: os.Getenv(EnvHome), + Name: os.Getenv(EnvName), + DataBackupPath: os.Getenv(EnvDataBackupPath), + CustomPreUpgrade: os.Getenv(EnvCustomPreupgrade), } if cfg.DataBackupPath == "" { @@ -150,16 +227,28 @@ func GetConfigFromEnv() (*Config, error) { } var err error - if cfg.AllowDownloadBinaries, err = booleanOption(EnvDownloadBin, false); err != nil { + if cfg.AllowDownloadBinaries, err = BooleanOption(EnvDownloadBin, false); err != nil { + errs = append(errs, err) + } + if cfg.DownloadMustHaveChecksum, err = BooleanOption(EnvDownloadMustHaveChecksum, false); err != nil { + errs = append(errs, err) + } + if cfg.RestartAfterUpgrade, err = BooleanOption(EnvRestartUpgrade, true); err != nil { + errs = append(errs, err) + } + if cfg.UnsafeSkipBackup, err = BooleanOption(EnvSkipBackup, false); err != nil { + errs = append(errs, err) + } + if cfg.DisableLogs, err = BooleanOption(EnvDisableLogs, false); err != nil { errs = append(errs, err) } - if cfg.RestartAfterUpgrade, err = booleanOption(EnvRestartUpgrade, true); err != nil { + if cfg.ColorLogs, err = BooleanOption(EnvColorLogs, true); err != nil { errs = append(errs, err) } - if cfg.UnsafeSkipBackup, err = booleanOption(EnvSkipBackup, false); err != nil { + if cfg.TimeFormatLogs, err = TimeFormatOptionFromEnv(EnvTimeFormatLogs, time.Kitchen); err != nil { errs = append(errs, err) } - if cfg.DisableLogs, err = booleanOption(EnvDisableLogs, false); err != nil { + if cfg.DisableRecase, err = BooleanOption(EnvDisableRecase, false); err != nil { errs = append(errs, err) } @@ -186,19 +275,51 @@ func GetConfigFromEnv() (*Config, error) { } } - envPreupgradeMaxRetriesVal := os.Getenv(EnvPreupgradeMaxRetries) - if cfg.PreupgradeMaxRetries, err = strconv.Atoi(envPreupgradeMaxRetriesVal); err != nil && envPreupgradeMaxRetriesVal != "" { + cfg.ShutdownGrace = 0 // default value but makes it explicit + shutdownGrace := os.Getenv(EnvShutdownGrace) + if shutdownGrace != "" { + val, err := parseEnvDuration(shutdownGrace) + if err != nil { + errs = append(errs, fmt.Errorf("invalid: %s: %w", EnvShutdownGrace, err)) + } else { + cfg.ShutdownGrace = val + } + } + + envPreUpgradeMaxRetriesVal := os.Getenv(EnvPreupgradeMaxRetries) + if cfg.PreUpgradeMaxRetries, err = strconv.Atoi(envPreUpgradeMaxRetriesVal); err != nil && envPreUpgradeMaxRetriesVal != "" { errs = append(errs, fmt.Errorf("%s could not be parsed to int: %w", EnvPreupgradeMaxRetries, err)) } - errs = append(errs, cfg.validate()...) + cfg.GRPCAddress = os.Getenv(EnvGRPCAddress) + if cfg.GRPCAddress == "" { + cfg.GRPCAddress = "localhost:9090" + } - if len(errs) > 0 { - return nil, cverrors.FlattenErrors(errs...) + if !skipValidate { + errs = append(errs, cfg.validate()...) + if len(errs) > 0 { + return nil, errors.Join(errs...) + } } + return cfg, nil } +func (cfg *Config) Logger(dst io.Writer) log.Logger { + var logger log.Logger + + if cfg.DisableLogs { + logger = log.NewNopLogger() + } else { + logger = log.NewLogger(dst, + log.ColorOption(cfg.ColorLogs), + log.TimeFormatOption(cfg.TimeFormatLogs)).With(log.ModuleKey, "cosmovisor") + } + + return logger +} + func parseEnvDuration(input string) (time.Duration, error) { duration, err := time.ParseDuration(input) if err != nil { @@ -206,26 +327,12 @@ func parseEnvDuration(input string) (time.Duration, error) { } if duration <= 0 { - return 0, fmt.Errorf("must be greater than 0") + return 0, errors.New("must be greater than 0") } return duration, nil } -// LogConfigOrError logs either the config details or the error. -func LogConfigOrError(logger log.Logger, cfg *Config, err error) { - if cfg == nil && err == nil { - return - } - logger.Info("configuration:") - switch { - case err != nil: - cverrors.LogErrors(logger, "configuration errors found", err) - case cfg != nil: - logger.Info(cfg.DetailString()) - } -} - // validate returns an error if this config is invalid. // it enforces Home/cosmovisor is a valid directory and exists, // and that Name is set @@ -285,24 +392,23 @@ func (cfg *Config) SetCurrentUpgrade(u upgradetypes.Plan) (rerr error) { } // set a symbolic link - link := filepath.Join(cfg.Root(), currentLink) safeName := url.PathEscape(u.Name) - upgrade := filepath.Join(cfg.Root(), upgradesDir, safeName) + upgrade := filepath.Join(upgradesDir, safeName) // remove link if it exists - if _, err := os.Stat(link); err == nil { - if err := os.Remove(link); err != nil { + if _, err := os.Stat(currentLink); err == nil { + if err := os.Remove(currentLink); err != nil { return fmt.Errorf("failed to remove existing link: %w", err) } } // point to the new directory - if err := os.Symlink(upgrade, link); err != nil { + if err := os.Symlink(upgrade, currentLink); err != nil { return fmt.Errorf("creating current symlink: %w", err) } cfg.currentUpgrade = u - f, err := os.Create(filepath.Join(upgrade, upgradetypes.UpgradeInfoFilename)) + f, err := os.Create(filepath.Join(cfg.Root(), upgrade, upgradetypes.UpgradeInfoFilename)) if err != nil { return err } @@ -321,6 +427,7 @@ func (cfg *Config) SetCurrentUpgrade(u upgradetypes.Plan) (rerr error) { return err } +// UpgradeInfo returns the current upgrade info func (cfg *Config) UpgradeInfo() (upgradetypes.Plan, error) { if cfg.currentUpgrade.Name != "" { return cfg.currentUpgrade, nil @@ -347,8 +454,8 @@ returnError: return cfg.currentUpgrade, fmt.Errorf("failed to read %q: %w", filename, err) } -// checks and validates env option -func booleanOption(name string, defaultVal bool) (bool, error) { +// BooleanOption checks and validate env option +func BooleanOption(name string, defaultVal bool) (bool, error) { p := strings.ToLower(os.Getenv(name)) switch p { case "": @@ -361,19 +468,99 @@ func booleanOption(name string, defaultVal bool) (bool, error) { return false, fmt.Errorf("env variable %q must have a boolean value (\"true\" or \"false\"), got %q", name, p) } +// TimeFormatOptionFromEnv checks and validates the time format option +func TimeFormatOptionFromEnv(env, defaultVal string) (string, error) { + val, set := os.LookupEnv(env) + if !set { + return defaultVal, nil + } + + return getTimeFormatOption(val) +} + +func getTimeFormatOption(val string) (string, error) { + switch val { + case "layout": + return time.Layout, nil + case "ansic": + return time.ANSIC, nil + case "unixdate": + return time.UnixDate, nil + case "rubydate": + return time.RubyDate, nil + case "rfc822": + return time.RFC822, nil + case "rfc822z": + return time.RFC822Z, nil + case "rfc850": + return time.RFC850, nil + case "rfc1123": + return time.RFC1123, nil + case "rfc1123z": + return time.RFC1123Z, nil + case "rfc3339": + return time.RFC3339, nil + case "rfc3339nano": + return time.RFC3339Nano, nil + case "kitchen": + return time.Kitchen, nil + case "": + return "", nil + } + return "", fmt.Errorf("env variable %q must have a timeformat value (\"layout|ansic|unixdate|rubydate|rfc822|rfc822z|rfc850|rfc1123|rfc1123z|rfc3339|rfc3339nano|kitchen\"), got %q", EnvTimeFormatLogs, val) +} + +// ValueToTimeFormatOption converts the time format option to the env value +func ValueToTimeFormatOption(format string) string { + switch format { + case time.Layout: + return "layout" + case time.ANSIC: + return "ansic" + case time.UnixDate: + return "unixdate" + case time.RubyDate: + return "rubydate" + case time.RFC822: + return "rfc822" + case time.RFC822Z: + return "rfc822z" + case time.RFC850: + return "rfc850" + case time.RFC1123: + return "rfc1123" + case time.RFC1123Z: + return "rfc1123z" + case time.RFC3339: + return "rfc3339" + case time.RFC3339Nano: + return "rfc3339nano" + case time.Kitchen: + return "kitchen" + default: + return "" + } +} + // DetailString returns a multi-line string with details about this config. func (cfg Config) DetailString() string { configEntries := []struct{ name, value string }{ {EnvHome, cfg.Home}, {EnvName, cfg.Name}, {EnvDownloadBin, fmt.Sprintf("%t", cfg.AllowDownloadBinaries)}, + {EnvDownloadMustHaveChecksum, fmt.Sprintf("%t", cfg.DownloadMustHaveChecksum)}, {EnvRestartUpgrade, fmt.Sprintf("%t", cfg.RestartAfterUpgrade)}, {EnvRestartDelay, cfg.RestartDelay.String()}, + {EnvShutdownGrace, cfg.ShutdownGrace.String()}, {EnvInterval, cfg.PollInterval.String()}, {EnvSkipBackup, fmt.Sprintf("%t", cfg.UnsafeSkipBackup)}, {EnvDataBackupPath, cfg.DataBackupPath}, - {EnvPreupgradeMaxRetries, fmt.Sprintf("%d", cfg.PreupgradeMaxRetries)}, + {EnvPreupgradeMaxRetries, fmt.Sprintf("%d", cfg.PreUpgradeMaxRetries)}, {EnvDisableLogs, fmt.Sprintf("%t", cfg.DisableLogs)}, + {EnvColorLogs, fmt.Sprintf("%t", cfg.ColorLogs)}, + {EnvTimeFormatLogs, cfg.TimeFormatLogs}, + {EnvCustomPreupgrade, cfg.CustomPreUpgrade}, + {EnvDisableRecase, fmt.Sprintf("%t", cfg.DisableRecase)}, } derivedEntries := []struct{ name, value string }{ @@ -402,3 +589,48 @@ func (cfg Config) DetailString() string { } return sb.String() } + +// Export exports the configuration to a file at the cosmovisor root directory. +func (cfg Config) Export() (string, error) { + // always use the default path + path := filepath.Clean(cfg.DefaultCfgPath()) + + // check if config file already exists ask user if they want to overwrite it + if _, err := os.Stat(path); err == nil { + // ask user if they want to overwrite the file + if !askForConfirmation(fmt.Sprintf("file %s already exists, do you want to overwrite it?", path)) { + cfg.Logger(os.Stdout).Info("file already exists, not overriding") + return path, nil + } + } + + // create the file + file, err := os.Create(filepath.Clean(path)) + if err != nil { + return "", fmt.Errorf("failed to create configuration file: %w", err) + } + + // convert the time value to its format option + cfg.TimeFormatLogs = ValueToTimeFormatOption(cfg.TimeFormatLogs) + + defer file.Close() + + // write the configuration to the file + err = toml.NewEncoder(file).Encode(cfg) + if err != nil { + return "", fmt.Errorf("failed to encode configuration: %w", err) + } + + return path, nil +} + +func askForConfirmation(str string) bool { + var response string + fmt.Printf("%s [y/n]: ", str) + _, err := fmt.Scanln(&response) + if err != nil { + return false + } + + return strings.ToLower(response) == "y" +} diff --git a/tools/cosmovisor/args_test.go b/tools/cosmovisor/args_test.go index 4651c387af34..12c28b8e7952 100644 --- a/tools/cosmovisor/args_test.go +++ b/tools/cosmovisor/args_test.go @@ -1,21 +1,17 @@ package cosmovisor import ( - "bytes" "fmt" - "io" "os" "path/filepath" "testing" "time" - "github.com/rs/zerolog" + "github.com/pelletier/go-toml/v2" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - "cosmossdk.io/log" - "cosmossdk.io/tools/cosmovisor/errors" "cosmossdk.io/x/upgrade/plan" ) @@ -29,31 +25,48 @@ func TestArgsTestSuite(t *testing.T) { // cosmovisorEnv are the string values of environment variables used to configure Cosmovisor. type cosmovisorEnv struct { - Home string - Name string - DownloadBin string - RestartUpgrade string - RestartDelay string - SkipBackup string - DataBackupPath string - Interval string - PreupgradeMaxRetries string - DisableLogs string + Home string + Name string + DownloadBin string + DownloadMustHaveChecksum string + RestartUpgrade string + RestartDelay string + SkipBackup string + DataBackupPath string + Interval string + PreupgradeMaxRetries string + DisableLogs string + ColorLogs string + TimeFormatLogs string + CustomPreupgrade string + DisableRecase string + ShutdownGrace string +} + +type envMap struct { + val string + allowEmpty bool } // ToMap creates a map of the cosmovisorEnv where the keys are the env var names. -func (c cosmovisorEnv) ToMap() map[string]string { - return map[string]string{ - EnvHome: c.Home, - EnvName: c.Name, - EnvDownloadBin: c.DownloadBin, - EnvRestartUpgrade: c.RestartUpgrade, - EnvRestartDelay: c.RestartDelay, - EnvSkipBackup: c.SkipBackup, - EnvDataBackupPath: c.DataBackupPath, - EnvInterval: c.Interval, - EnvPreupgradeMaxRetries: c.PreupgradeMaxRetries, - EnvDisableLogs: c.DisableLogs, +func (c cosmovisorEnv) ToMap() map[string]envMap { + return map[string]envMap{ + EnvHome: {val: c.Home, allowEmpty: false}, + EnvName: {val: c.Name, allowEmpty: false}, + EnvDownloadBin: {val: c.DownloadBin, allowEmpty: false}, + EnvDownloadMustHaveChecksum: {val: c.DownloadMustHaveChecksum, allowEmpty: false}, + EnvRestartUpgrade: {val: c.RestartUpgrade, allowEmpty: false}, + EnvRestartDelay: {val: c.RestartDelay, allowEmpty: false}, + EnvShutdownGrace: {val: c.ShutdownGrace, allowEmpty: false}, + EnvSkipBackup: {val: c.SkipBackup, allowEmpty: false}, + EnvDataBackupPath: {val: c.DataBackupPath, allowEmpty: false}, + EnvInterval: {val: c.Interval, allowEmpty: false}, + EnvPreupgradeMaxRetries: {val: c.PreupgradeMaxRetries, allowEmpty: false}, + EnvDisableLogs: {val: c.DisableLogs, allowEmpty: false}, + EnvColorLogs: {val: c.ColorLogs, allowEmpty: false}, + EnvTimeFormatLogs: {val: c.TimeFormatLogs, allowEmpty: true}, + EnvCustomPreupgrade: {val: c.CustomPreupgrade, allowEmpty: true}, + EnvDisableRecase: {val: c.DisableRecase, allowEmpty: true}, } } @@ -66,10 +79,14 @@ func (c *cosmovisorEnv) Set(envVar, envVal string) { c.Name = envVal case EnvDownloadBin: c.DownloadBin = envVal + case EnvDownloadMustHaveChecksum: + c.DownloadMustHaveChecksum = envVal case EnvRestartUpgrade: c.RestartUpgrade = envVal case EnvRestartDelay: c.RestartDelay = envVal + case EnvShutdownGrace: + c.ShutdownGrace = envVal case EnvSkipBackup: c.SkipBackup = envVal case EnvDataBackupPath: @@ -80,8 +97,16 @@ func (c *cosmovisorEnv) Set(envVar, envVal string) { c.PreupgradeMaxRetries = envVal case EnvDisableLogs: c.DisableLogs = envVal + case EnvColorLogs: + c.ColorLogs = envVal + case EnvTimeFormatLogs: + c.TimeFormatLogs = envVal + case EnvCustomPreupgrade: + c.CustomPreupgrade = envVal + case EnvDisableRecase: + c.DisableRecase = envVal default: - panic(fmt.Errorf("Unknown environment variable [%s]. Ccannot set field to [%s]. ", envVar, envVal)) + panic(fmt.Errorf("Unknown environment variable [%s]. Cannot set field to [%s]. ", envVar, envVal)) } } @@ -103,16 +128,16 @@ func (s *argsTestSuite) clearEnv() *cosmovisorEnv { // setEnv sets environment variables to the values provided. // If t is not nil, and there's a problem, the test will fail immediately. // If t is nil, problems will just be logged using s.T(). -func (s *argsTestSuite) setEnv(t *testing.T, env *cosmovisorEnv) { +func (s *argsTestSuite) setEnv(t *testing.T, env *cosmovisorEnv) { //nolint:thelper // false positive if t == nil { s.T().Logf("Restoring environment variables.") } for envVar, envVal := range env.ToMap() { var err error var msg string - if len(envVal) != 0 { - err = os.Setenv(envVar, envVal) - msg = fmt.Sprintf("setting %s to %s", envVar, envVal) + if len(envVal.val) != 0 || envVal.allowEmpty { + err = os.Setenv(envVar, envVal.val) + msg = fmt.Sprintf("setting %s to %s", envVar, envVal.val) } else { err = os.Unsetenv(envVar) msg = fmt.Sprintf("unsetting %s", envVar) @@ -284,7 +309,7 @@ func (s *argsTestSuite) TestBooleanOption() { name := "COSMOVISOR_TEST_VAL" check := func(def, expected, isErr bool, msg string) { - v, err := booleanOption(name, def) + v, err := BooleanOption(name, def) if isErr { s.Require().Error(err) return @@ -318,24 +343,77 @@ func (s *argsTestSuite) TestBooleanOption() { check(false, true, false, "should handle true value case not sensitive") } +func (s *argsTestSuite) TestTimeFormat() { + initialEnv := s.clearEnv() + defer s.setEnv(nil, initialEnv) + + name := "COSMOVISOR_TEST_VAL" + + check := func(def, expected string, isErr bool, msg string) { + v, err := TimeFormatOptionFromEnv(name, def) + if isErr { + s.Require().Error(err) + return + } + s.Require().NoError(err) + s.Require().Equal(expected, v, msg) + } + + os.Unsetenv(name) + check(time.Kitchen, time.Kitchen, false, "should correctly set default value") + + os.Setenv(name, "") + check(time.Kitchen, "", false, "should correctly set to a none") + + os.Setenv(name, "wrong") + check(time.Kitchen, "", true, "should error on wrong value") + + os.Setenv(name, "layout") + check(time.Kitchen, time.Layout, false, "should handle layout value") + os.Setenv(name, "ansic") + check(time.Kitchen, time.ANSIC, false, "should handle ansic value") + os.Setenv(name, "unixdate") + check(time.Kitchen, time.UnixDate, false, "should handle unixdate value") + os.Setenv(name, "rubydate") + check(time.Kitchen, time.RubyDate, false, "should handle rubydate value") + os.Setenv(name, "rfc822") + check(time.Kitchen, time.RFC822, false, "should handle rfc822 value") + os.Setenv(name, "rfc822z") + check(time.Kitchen, time.RFC822Z, false, "should handle rfc822z value") + os.Setenv(name, "rfc850") + check(time.Kitchen, time.RFC850, false, "should handle rfc850 value") + os.Setenv(name, "rfc1123") + check(time.Kitchen, time.RFC1123, false, "should handle rfc1123 value") + os.Setenv(name, "rfc1123z") + check(time.Kitchen, time.RFC1123Z, false, "should handle rfc1123z value") + os.Setenv(name, "rfc3339") + check(time.Kitchen, time.RFC3339, false, "should handle rfc3339 value") + os.Setenv(name, "rfc3339nano") + check(time.Kitchen, time.RFC3339Nano, false, "should handle rfc3339nano value") + os.Setenv(name, "kitchen") + check(time.Kitchen, time.Kitchen, false, "should handle kitchen value") +} + func (s *argsTestSuite) TestDetailString() { home := "/home" name := "test-name" allowDownloadBinaries := true + downloadMustHaveChecksum := true restartAfterUpgrade := true pollInterval := 406 * time.Millisecond unsafeSkipBackup := false dataBackupPath := "/home" preupgradeMaxRetries := 8 cfg := &Config{ - Home: home, - Name: name, - AllowDownloadBinaries: allowDownloadBinaries, - RestartAfterUpgrade: restartAfterUpgrade, - PollInterval: pollInterval, - UnsafeSkipBackup: unsafeSkipBackup, - DataBackupPath: dataBackupPath, - PreupgradeMaxRetries: preupgradeMaxRetries, + Home: home, + Name: name, + AllowDownloadBinaries: allowDownloadBinaries, + DownloadMustHaveChecksum: downloadMustHaveChecksum, + RestartAfterUpgrade: restartAfterUpgrade, + PollInterval: pollInterval, + UnsafeSkipBackup: unsafeSkipBackup, + DataBackupPath: dataBackupPath, + PreUpgradeMaxRetries: preupgradeMaxRetries, } expectedPieces := []string{ @@ -343,11 +421,15 @@ func (s *argsTestSuite) TestDetailString() { fmt.Sprintf("%s: %s", EnvHome, home), fmt.Sprintf("%s: %s", EnvName, name), fmt.Sprintf("%s: %t", EnvDownloadBin, allowDownloadBinaries), + fmt.Sprintf("%s: %t", EnvDownloadMustHaveChecksum, downloadMustHaveChecksum), fmt.Sprintf("%s: %t", EnvRestartUpgrade, restartAfterUpgrade), fmt.Sprintf("%s: %s", EnvInterval, pollInterval), fmt.Sprintf("%s: %t", EnvSkipBackup, unsafeSkipBackup), fmt.Sprintf("%s: %s", EnvDataBackupPath, home), fmt.Sprintf("%s: %d", EnvPreupgradeMaxRetries, preupgradeMaxRetries), + fmt.Sprintf("%s: %t", EnvDisableLogs, cfg.DisableLogs), + fmt.Sprintf("%s: %t", EnvColorLogs, cfg.ColorLogs), + fmt.Sprintf("%s: %s", EnvTimeFormatLogs, cfg.TimeFormatLogs), "Derived Values:", fmt.Sprintf("Root Dir: %s", home), fmt.Sprintf("Upgrade Dir: %s", home), @@ -363,6 +445,43 @@ func (s *argsTestSuite) TestDetailString() { } } +var newConfig = func( + home, name string, + downloadBin bool, + downloadMustHaveChecksum bool, + restartUpgrade bool, + restartDelay int, + skipBackup bool, + dataBackupPath string, + interval, preupgradeMaxRetries int, + grpcAddress string, + disableLogs, colorLogs bool, + timeFormatLogs string, + customPreUpgrade string, + disableRecase bool, + shutdownGrace int, +) *Config { + return &Config{ + Home: home, + Name: name, + AllowDownloadBinaries: downloadBin, + DownloadMustHaveChecksum: downloadMustHaveChecksum, + RestartAfterUpgrade: restartUpgrade, + RestartDelay: time.Millisecond * time.Duration(restartDelay), + PollInterval: time.Millisecond * time.Duration(interval), + UnsafeSkipBackup: skipBackup, + DataBackupPath: dataBackupPath, + GRPCAddress: grpcAddress, + PreUpgradeMaxRetries: preupgradeMaxRetries, + DisableLogs: disableLogs, + ColorLogs: colorLogs, + TimeFormatLogs: timeFormatLogs, + CustomPreUpgrade: customPreUpgrade, + DisableRecase: disableRecase, + ShutdownGrace: time.Duration(shutdownGrace), + } +} + func (s *argsTestSuite) TestGetConfigFromEnv() { initialEnv := s.clearEnv() defer s.setEnv(nil, initialEnv) @@ -371,21 +490,6 @@ func (s *argsTestSuite) TestGetConfigFromEnv() { absPath, perr := filepath.Abs(relPath) s.Require().NoError(perr) - newConfig := func(home, name string, downloadBin, restartUpgrade bool, restartDelay int, skipBackup bool, dataBackupPath string, interval, preupgradeMaxRetries int, disableLogs bool) *Config { - return &Config{ - Home: home, - Name: name, - AllowDownloadBinaries: downloadBin, - RestartAfterUpgrade: restartUpgrade, - RestartDelay: time.Millisecond * time.Duration(restartDelay), - PollInterval: time.Millisecond * time.Duration(interval), - UnsafeSkipBackup: skipBackup, - DataBackupPath: dataBackupPath, - PreupgradeMaxRetries: preupgradeMaxRetries, - DisableLogs: disableLogs, - } - } - tests := []struct { name string envVals cosmovisorEnv @@ -395,210 +499,269 @@ func (s *argsTestSuite) TestGetConfigFromEnv() { { name: "all bad", envVals: cosmovisorEnv{ - Home: "", - Name: "", - DownloadBin: "bad", - RestartUpgrade: "bad", - RestartDelay: "bad", - SkipBackup: "bad", - DataBackupPath: "bad", - Interval: "bad", - PreupgradeMaxRetries: "bad", + Home: "", + Name: "", + DownloadBin: "bad", + DownloadMustHaveChecksum: "bad", + RestartUpgrade: "bad", + RestartDelay: "bad", + SkipBackup: "bad", + DataBackupPath: "bad", + Interval: "bad", + PreupgradeMaxRetries: "bad", + TimeFormatLogs: "bad", + CustomPreupgrade: "", + DisableRecase: "bad", + ShutdownGrace: "bad", }, expectedCfg: nil, - expectedErrCount: 9, + expectedErrCount: 13, }, { name: "all good", - envVals: cosmovisorEnv{absPath, "testname", "true", "false", "600ms", "true", "", "303ms", "1", "false"}, - expectedCfg: newConfig(absPath, "testname", true, false, 600, true, absPath, 303, 1, false), + envVals: cosmovisorEnv{absPath, "testname", "true", "true", "false", "600ms", "true", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", "true", "10s"}, + expectedCfg: newConfig(absPath, "testname", true, true, false, 600, true, absPath, 303, 1, "localhost:9090", false, true, time.Kitchen, "preupgrade.sh", true, 10000000000), expectedErrCount: 0, }, { name: "nothing set", - envVals: cosmovisorEnv{"", "", "", "", "", "", "", "", "", "false"}, + envVals: cosmovisorEnv{"", "", "", "", "", "", "", "", "", "", "false", "false", "", "", "", ""}, expectedCfg: nil, expectedErrCount: 3, }, // Note: Home and Name tests are done in TestValidate + // timeformat tests are done in the TestTimeFormat { name: "download bin bad", - envVals: cosmovisorEnv{absPath, "testname", "bad", "false", "600ms", "true", "", "303ms", "1", "false"}, + envVals: cosmovisorEnv{absPath, "testname", "bad", "true", "false", "600ms", "true", "", "303ms", "1", "false", "true", "kitchen", "", "", ""}, expectedCfg: nil, expectedErrCount: 1, }, { name: "download bin not set", - envVals: cosmovisorEnv{absPath, "testname", "", "false", "600ms", "true", "", "303ms", "1", "false"}, - expectedCfg: newConfig(absPath, "testname", false, false, 600, true, absPath, 303, 1, false), + envVals: cosmovisorEnv{absPath, "testname", "", "true", "false", "600ms", "true", "", "303ms", "1", "false", "true", "kitchen", "", "", ""}, + expectedCfg: newConfig(absPath, "testname", false, true, false, 600, true, absPath, 303, 1, "localhost:9090", false, true, time.Kitchen, "", false, 0), expectedErrCount: 0, }, { name: "download bin true", - envVals: cosmovisorEnv{absPath, "testname", "true", "false", "600ms", "true", "", "303ms", "1", "false"}, - expectedCfg: newConfig(absPath, "testname", true, false, 600, true, absPath, 303, 1, false), + envVals: cosmovisorEnv{absPath, "testname", "true", "true", "false", "600ms", "true", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", true, true, false, 600, true, absPath, 303, 1, "localhost:9090", false, true, time.Kitchen, "preupgrade.sh", false, 0), expectedErrCount: 0, }, { name: "download bin false", - envVals: cosmovisorEnv{absPath, "testname", "false", "false", "600ms", "true", "", "303ms", "1", "false"}, - expectedCfg: newConfig(absPath, "testname", false, false, 600, true, absPath, 303, 1, false), + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "true", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", false, true, false, 600, true, absPath, 303, 1, "localhost:9090", false, true, time.Kitchen, "preupgrade.sh", false, 0), + expectedErrCount: 0, + }, + { + name: "download ensure checksum true", + envVals: cosmovisorEnv{absPath, "testname", "true", "false", "false", "600ms", "true", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", true, false, false, 600, true, absPath, 303, 1, "localhost:9090", false, true, time.Kitchen, "preupgrade.sh", false, 0), expectedErrCount: 0, }, { name: "restart upgrade bad", - envVals: cosmovisorEnv{absPath, "testname", "true", "bad", "600ms", "true", "", "303ms", "1", "false"}, + envVals: cosmovisorEnv{absPath, "testname", "true", "true", "bad", "600ms", "true", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, expectedCfg: nil, expectedErrCount: 1, }, { name: "restart upgrade not set", - envVals: cosmovisorEnv{absPath, "testname", "true", "", "600ms", "true", "", "303ms", "1", "false"}, - expectedCfg: newConfig(absPath, "testname", true, true, 600, true, absPath, 303, 1, false), + envVals: cosmovisorEnv{absPath, "testname", "true", "true", "", "600ms", "true", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", true, true, true, 600, true, absPath, 303, 1, "localhost:9090", false, true, time.Kitchen, "preupgrade.sh", false, 0), expectedErrCount: 0, }, { name: "restart upgrade true", - envVals: cosmovisorEnv{absPath, "testname", "true", "true", "600ms", "true", "", "303ms", "1", "false"}, - expectedCfg: newConfig(absPath, "testname", true, true, 600, true, absPath, 303, 1, false), + envVals: cosmovisorEnv{absPath, "testname", "true", "true", "true", "600ms", "true", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", true, true, true, 600, true, absPath, 303, 1, "localhost:9090", false, true, time.Kitchen, "preupgrade.sh", false, 0), expectedErrCount: 0, }, { name: "restart upgrade true", - envVals: cosmovisorEnv{absPath, "testname", "true", "false", "600ms", "true", "", "303ms", "1", "false"}, - expectedCfg: newConfig(absPath, "testname", true, false, 600, true, absPath, 303, 1, false), + envVals: cosmovisorEnv{absPath, "testname", "true", "true", "false", "600ms", "true", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", true, true, false, 600, true, absPath, 303, 1, "localhost:9090", false, true, time.Kitchen, "preupgrade.sh", false, 0), expectedErrCount: 0, }, { name: "skip unsafe backups bad", - envVals: cosmovisorEnv{absPath, "testname", "true", "false", "600ms", "bad", "", "303ms", "1", "false"}, + envVals: cosmovisorEnv{absPath, "testname", "true", "true", "false", "600ms", "bad", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, expectedCfg: nil, expectedErrCount: 1, }, { name: "skip unsafe backups not set", - envVals: cosmovisorEnv{absPath, "testname", "true", "false", "600ms", "", "", "303ms", "1", "false"}, - expectedCfg: newConfig(absPath, "testname", true, false, 600, false, absPath, 303, 1, false), + envVals: cosmovisorEnv{absPath, "testname", "true", "true", "false", "600ms", "", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", true, true, false, 600, false, absPath, 303, 1, "localhost:9090", false, true, time.Kitchen, "preupgrade.sh", false, 0), expectedErrCount: 0, }, { name: "skip unsafe backups true", - envVals: cosmovisorEnv{absPath, "testname", "true", "false", "600ms", "true", "", "303ms", "1", "false"}, - expectedCfg: newConfig(absPath, "testname", true, false, 600, true, absPath, 303, 1, false), + envVals: cosmovisorEnv{absPath, "testname", "true", "true", "false", "600ms", "true", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", true, true, false, 600, true, absPath, 303, 1, "localhost:9090", false, true, time.Kitchen, "preupgrade.sh", false, 0), expectedErrCount: 0, }, { name: "skip unsafe backups false", - envVals: cosmovisorEnv{absPath, "testname", "true", "false", "600ms", "false", "", "303ms", "1", "false"}, - expectedCfg: newConfig(absPath, "testname", true, false, 600, false, absPath, 303, 1, false), + envVals: cosmovisorEnv{absPath, "testname", "true", "true", "false", "600ms", "false", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", true, true, false, 600, false, absPath, 303, 1, "localhost:9090", false, true, time.Kitchen, "preupgrade.sh", false, 0), expectedErrCount: 0, }, { name: "poll interval bad", - envVals: cosmovisorEnv{absPath, "testname", "false", "false", "600ms", "false", "", "bad", "1", "false"}, + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "bad", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, expectedCfg: nil, expectedErrCount: 1, }, { name: "poll interval 0", - envVals: cosmovisorEnv{absPath, "testname", "false", "false", "600ms", "false", "", "0", "1", "false"}, + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "0", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, expectedCfg: nil, expectedErrCount: 1, }, { name: "poll interval not set", - envVals: cosmovisorEnv{absPath, "testname", "false", "false", "600ms", "false", "", "", "1", "false"}, - expectedCfg: newConfig(absPath, "testname", false, false, 600, false, absPath, 300, 1, false), + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "", "1", "false", "false", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", false, true, false, 600, false, absPath, 300, 1, "localhost:9090", false, false, time.Kitchen, "preupgrade.sh", false, 0), expectedErrCount: 0, }, { name: "poll interval 600", - envVals: cosmovisorEnv{absPath, "testname", "false", "false", "600ms", "false", "", "600", "1", "false"}, + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "600", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, expectedCfg: nil, expectedErrCount: 1, }, { name: "poll interval 1s", - envVals: cosmovisorEnv{absPath, "testname", "false", "false", "600ms", "false", "", "1s", "1", "false"}, - expectedCfg: newConfig(absPath, "testname", false, false, 600, false, absPath, 1000, 1, false), + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "1s", "1", "false", "false", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", false, true, false, 600, false, absPath, 1000, 1, "localhost:9090", false, false, time.Kitchen, "preupgrade.sh", false, 0), expectedErrCount: 0, }, { name: "poll interval -3m", - envVals: cosmovisorEnv{absPath, "testname", "false", "false", "600ms", "false", "", "-3m", "1", "false"}, + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "-3m", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, expectedCfg: nil, expectedErrCount: 1, }, { name: "restart delay bad", - envVals: cosmovisorEnv{absPath, "testname", "false", "false", "bad", "false", "", "303ms", "1", "false"}, + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "bad", "false", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, expectedCfg: nil, expectedErrCount: 1, }, { name: "restart delay 0", - envVals: cosmovisorEnv{absPath, "testname", "false", "false", "0", "false", "", "303ms", "1", "false"}, + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "0", "false", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, expectedCfg: nil, expectedErrCount: 1, }, { name: "restart delay not set", - envVals: cosmovisorEnv{absPath, "testname", "false", "false", "", "false", "", "303ms", "1", "false"}, - expectedCfg: newConfig(absPath, "testname", false, false, 0, false, absPath, 303, 1, false), + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "", "false", "", "303ms", "1", "false", "false", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", false, true, false, 0, false, absPath, 303, 1, "localhost:9090", false, false, time.Kitchen, "preupgrade.sh", false, 0), expectedErrCount: 0, }, { name: "restart delay 600", - envVals: cosmovisorEnv{absPath, "testname", "false", "false", "600", "false", "", "300ms", "1", "false"}, + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600", "false", "", "300ms", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, expectedCfg: nil, expectedErrCount: 1, }, { name: "restart delay 1s", - envVals: cosmovisorEnv{absPath, "testname", "false", "false", "1s", "false", "", "303ms", "1", "false"}, - expectedCfg: newConfig(absPath, "testname", false, false, 1000, false, absPath, 303, 1, false), + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "1s", "false", "", "303ms", "1", "false", "false", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", false, true, false, 1000, false, absPath, 303, 1, "localhost:9090", false, false, time.Kitchen, "preupgrade.sh", false, 0), expectedErrCount: 0, }, { name: "restart delay -3m", - envVals: cosmovisorEnv{absPath, "testname", "false", "false", "-3m", "false", "", "303ms", "1", "false"}, + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "-3m", "false", "", "303ms", "1", "false", "true", "kitchen", "preupgrade.sh", "", ""}, expectedCfg: nil, expectedErrCount: 1, }, { name: "prepupgrade max retries bad", - envVals: cosmovisorEnv{absPath, "testname", "false", "false", "600ms", "false", "", "406ms", "bad", "false"}, + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "bad", "false", "true", "kitchen", "preupgrade.sh", "", ""}, expectedCfg: nil, expectedErrCount: 1, }, { name: "prepupgrade max retries 0", - envVals: cosmovisorEnv{absPath, "testname", "false", "false", "600ms", "false", "", "406ms", "0", "false"}, - expectedCfg: newConfig(absPath, "testname", false, false, 600, false, absPath, 406, 0, false), + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "0", "false", "false", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", false, true, false, 600, false, absPath, 406, 0, "localhost:9090", false, false, time.Kitchen, "preupgrade.sh", false, 0), expectedErrCount: 0, }, { name: "prepupgrade max retries not set", - envVals: cosmovisorEnv{absPath, "testname", "false", "false", "600ms", "false", "", "406ms", "", "false"}, - expectedCfg: newConfig(absPath, "testname", false, false, 600, false, absPath, 406, 0, false), + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "", "false", "false", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", false, true, false, 600, false, absPath, 406, 0, "localhost:9090", false, false, time.Kitchen, "preupgrade.sh", false, 0), expectedErrCount: 0, }, { name: "prepupgrade max retries 5", - envVals: cosmovisorEnv{absPath, "testname", "false", "false", "600ms", "false", "", "406ms", "5", "false"}, - expectedCfg: newConfig(absPath, "testname", false, false, 600, false, absPath, 406, 5, false), + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "5", "false", "false", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", false, true, false, 600, false, absPath, 406, 5, "localhost:9090", false, false, time.Kitchen, "preupgrade.sh", false, 0), expectedErrCount: 0, }, { name: "disable logs bad", - envVals: cosmovisorEnv{absPath, "testname", "false", "false", "600ms", "false", "", "406ms", "5", "bad"}, + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "5", "bad", "true", "kitchen", "preupgrade.sh", "", ""}, expectedCfg: nil, expectedErrCount: 1, }, { name: "disable logs good", - envVals: cosmovisorEnv{absPath, "testname", "false", "false", "600ms", "false", "", "406ms", "", "true"}, - expectedCfg: newConfig(absPath, "testname", false, false, 600, false, absPath, 406, 0, true), + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "", "true", "false", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", false, true, false, 600, false, absPath, 406, 0, "localhost:9090", true, false, time.Kitchen, "preupgrade.sh", false, 0), + expectedErrCount: 0, + }, + { + name: "disable logs color bad", + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "5", "true", "bad", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: nil, + expectedErrCount: 1, + }, + { + name: "disable logs color good", + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "", "true", "false", "kitchen", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", false, true, false, 600, false, absPath, 406, 0, "localhost:9090", true, false, time.Kitchen, "preupgrade.sh", false, 0), + expectedErrCount: 0, + }, + { + name: "disable logs timestamp", + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "", "true", "false", "", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", false, true, false, 600, false, absPath, 406, 0, "localhost:9090", true, false, "", "preupgrade.sh", false, 0), + expectedErrCount: 0, + }, + { + name: "enable rf3339 logs timestamp", + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "", "true", "true", "rfc3339", "preupgrade.sh", "", ""}, + expectedCfg: newConfig(absPath, "testname", false, true, false, 600, false, absPath, 406, 0, "localhost:9090", true, true, time.RFC3339, "preupgrade.sh", false, 0), + expectedErrCount: 0, + }, + { + name: "invalid logs timestamp format", + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "", "true", "true", "invalid", "preupgrade.sh", "", ""}, + expectedCfg: nil, + expectedErrCount: 1, + }, + { + name: "disable recase good", + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "", "true", "true", "rfc3339", "preupgrade.sh", "true", ""}, + expectedCfg: newConfig(absPath, "testname", false, true, false, 600, false, absPath, 406, 0, "localhost:9090", true, true, time.RFC3339, "preupgrade.sh", true, 0), + expectedErrCount: 0, + }, + { + name: "disable recase bad", + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "", "true", "true", "rfc3339", "preupgrade.sh", "bad", ""}, + expectedErrCount: 1, + }, + { + name: "shutdown grace good", + envVals: cosmovisorEnv{absPath, "testname", "false", "true", "false", "600ms", "false", "", "406ms", "", "true", "true", "rfc3339", "preupgrade.sh", "true", "15s"}, + expectedCfg: newConfig(absPath, "testname", false, true, false, 600, false, absPath, 406, 0, "localhost:9090", true, true, time.RFC3339, "preupgrade.sh", true, 15000000000), expectedErrCount: 0, }, } @@ -606,13 +769,13 @@ func (s *argsTestSuite) TestGetConfigFromEnv() { for _, tc := range tests { s.T().Run(tc.name, func(t *testing.T) { s.setEnv(t, &tc.envVals) - cfg, err := GetConfigFromEnv() + cfg, err := GetConfigFromEnv(false) if tc.expectedErrCount == 0 { assert.NoError(t, err) } else if assert.Error(t, err) { errCount := 1 - if multi, isMulti := err.(*errors.MultiError); isMulti { - errCount = multi.Len() + if errMulti, ok := err.(interface{ Unwrap() []error }); ok { + errCount = len(errMulti.Unwrap()) } assert.Equal(t, tc.expectedErrCount, errCount, "error count") } @@ -621,87 +784,91 @@ func (s *argsTestSuite) TestGetConfigFromEnv() { } } -func (s *argsTestSuite) TestLogConfigOrError() { - cfg := &Config{ - Home: "/no/place/like/it", - Name: "cosmotestvisor", - AllowDownloadBinaries: true, - RestartAfterUpgrade: true, - PollInterval: 999, - UnsafeSkipBackup: false, - DataBackupPath: "/no/place/like/it", - PreupgradeMaxRetries: 20, - } - errNormal := fmt.Errorf("this is a single error") - errs := []error{ - fmt.Errorf("multi-error error 1"), - fmt.Errorf("multi-error error 2"), - fmt.Errorf("multi-error error 3"), - } - errMulti := errors.FlattenErrors(errs...) +func (s *argsTestSuite) setUpDir() string { + s.T().Helper() - makeTestLogger := func(testName string, out io.Writer) log.Logger { - output := zerolog.ConsoleWriter{Out: out, TimeFormat: time.Kitchen, NoColor: true} - logger := zerolog.New(output).With().Str("test", testName).Timestamp().Logger() - return log.NewCustomLogger(logger) - } + home := s.T().TempDir() + err := os.MkdirAll(filepath.Join(home, rootName), 0o755) + s.Require().NoError(err) + return home +} - tests := []struct { - name string - cfg *Config - err error - contains []string - notcontains []string +func (s *argsTestSuite) setupConfig(home string) string { + s.T().Helper() + + cfg := newConfig(home, "test", true, true, true, 406, false, home, 8, 0, "localhost:9090", false, true, "kitchen", "", true, 10000000000) + path := filepath.Join(home, rootName, "config.toml") + f, err := os.Create(path) + s.Require().NoError(err) + + enc := toml.NewEncoder(f) + s.Require().NoError(enc.Encode(&cfg)) + + err = f.Close() + s.Require().NoError(err) + + return path +} + +func (s *argsTestSuite) TestConfigFromFile() { + home := s.setUpDir() + // create a config file + cfgFilePath := s.setupConfig(home) + + testCases := []struct { + name string + config *Config + expectedCfg func() *Config + filePath string + expectedError string + malleate func() }{ { - name: "normal error", - cfg: nil, - err: errNormal, - contains: []string{"configuration error", errNormal.Error()}, // TODO: Fix this. - notcontains: nil, - }, - { - name: "multi error", - cfg: nil, - err: errMulti, - contains: []string{"configuration errors found", errs[0].Error(), errs[1].Error(), errs[2].Error()}, - notcontains: nil, - }, - { - name: "config", - cfg: cfg, - err: nil, - contains: []string{"Configurable Values", cfg.DetailString()}, - notcontains: nil, + name: "valid config", + expectedCfg: func() *Config { + return newConfig(home, "test", true, true, true, 406, false, home, 8, 0, "localhost:9090", false, true, time.Kitchen, "", true, 10000000000) + }, + filePath: cfgFilePath, + expectedError: "", + malleate: func() {}, }, { - name: "error and config - no config details", - cfg: cfg, - err: errNormal, - contains: []string{"error"}, - notcontains: []string{"Configuration is valid", EnvName, cfg.Home}, // Just some spot checks. + name: "env variable will override config file fields", + filePath: cfgFilePath, + expectedError: "", + malleate: func() { + // set env variable different from the config file + os.Setenv(EnvName, "env-name") + }, + expectedCfg: func() *Config { + return newConfig(home, "env-name", true, true, true, 406, false, home, 8, 0, "localhost:9090", false, true, time.Kitchen, "", true, 10000000000) + }, }, { - name: "nil nil - no output", - cfg: nil, - err: nil, - contains: nil, - notcontains: []string{" "}, + name: "empty config file path will load config from ENV variables", + expectedCfg: func() *Config { + return newConfig(home, "test", true, true, true, 406, false, home, 8, 0, "localhost:9090", false, true, time.Kitchen, "", true, 10000000000) + }, + filePath: "", + expectedError: "", + malleate: func() { + s.setEnv(s.T(), &cosmovisorEnv{home, "test", "true", "true", "true", "406ms", "false", home, "8ms", "0", "false", "true", "kitchen", "", "true", "10s"}) + }, }, } - for _, tc := range tests { + for _, tc := range testCases { s.T().Run(tc.name, func(t *testing.T) { - var b bytes.Buffer - logger := makeTestLogger(tc.name, &b) - LogConfigOrError(logger, tc.cfg, tc.err) - output := b.String() - for _, expected := range tc.contains { - assert.Contains(t, output, expected) - } - for _, unexpected := range tc.notcontains { - assert.NotContains(t, output, unexpected) + tc.malleate() + actualCfg, err := GetConfigFromFile(tc.filePath) + if tc.expectedError != "" { + s.Require().NoError(err) + s.Require().Contains(err.Error(), tc.expectedError) + return } + + s.Require().NoError(err) + s.Require().EqualValues(tc.expectedCfg(), actualCfg) }) } } @@ -714,7 +881,7 @@ func BenchmarkDetailString(b *testing.B) { AllowDownloadBinaries: true, UnsafeSkipBackup: true, PollInterval: 450 * time.Second, - PreupgradeMaxRetries: 1e7, + PreUpgradeMaxRetries: 1e7, } b.ReportAllocs() diff --git a/tools/cosmovisor/cmd/cosmovisor/add_upgrade.go b/tools/cosmovisor/cmd/cosmovisor/add_upgrade.go index a7b90eb0dc0a..3832efa05e81 100644 --- a/tools/cosmovisor/cmd/cosmovisor/add_upgrade.go +++ b/tools/cosmovisor/cmd/cosmovisor/add_upgrade.go @@ -1,48 +1,41 @@ package main import ( + "encoding/json" "fmt" "os" "path" + "strings" - "cosmossdk.io/log" - "cosmossdk.io/tools/cosmovisor" - "github.com/rs/zerolog" "github.com/spf13/cobra" + + "cosmossdk.io/tools/cosmovisor" + upgradetypes "cosmossdk.io/x/upgrade/types" ) func NewAddUpgradeCmd() *cobra.Command { addUpgrade := &cobra.Command{ - Use: "add-upgrade [upgrade-name] [path to executable]", - Short: "Manually add upgrade binary to Cosmovisor", + Use: "add-upgrade ", + Short: "Add APP upgrade binary to cosmovisor", SilenceUsage: true, Args: cobra.ExactArgs(2), - RunE: AddUpgrade, + RunE: addUpgradeCmd, } - addUpgrade.Flags().Bool(cosmovisor.FlagForce, false, "overwrite existing upgrade binary") + addUpgrade.Flags().Bool(cosmovisor.FlagForce, false, "overwrite existing upgrade binary / upgrade-info.json file") + addUpgrade.Flags().Int64(cosmovisor.FlagUpgradeHeight, 0, "define a height at which to upgrade the binary automatically (without governance proposal)") return addUpgrade } -// AddUpgrade adds upgrade info to manifest -func AddUpgrade(cmd *cobra.Command, args []string) error { - cfg, err := cosmovisor.GetConfigFromEnv() - if err != nil { - return err - } - - logger := cmd.Context().Value(log.ContextKey).(log.Logger) - if cfg.DisableLogs { - logger = log.NewCustomLogger(zerolog.Nop()) - } +// addUpgrade adds upgrade info to manifest +func addUpgrade(cfg *cosmovisor.Config, force bool, upgradeHeight int64, upgradeName, executablePath, upgradeInfoPath string) error { + logger := cfg.Logger(os.Stdout) - upgradeName := args[0] - if len(upgradeName) == 0 { - return fmt.Errorf("upgrade name cannot be empty") + if !cfg.DisableRecase { + upgradeName = strings.ToLower(upgradeName) } - executablePath := args[1] if _, err := os.Stat(executablePath); err != nil { if os.IsNotExist(err) { return fmt.Errorf("invalid executable path: %w", err) @@ -53,7 +46,7 @@ func AddUpgrade(cmd *cobra.Command, args []string) error { // create upgrade dir upgradeLocation := cfg.UpgradeDir(upgradeName) - if err := os.MkdirAll(path.Join(upgradeLocation, "bin"), 0o750); err != nil { + if err := os.MkdirAll(path.Join(upgradeLocation, "bin"), 0o755); err != nil { return fmt.Errorf("failed to create upgrade directory: %w", err) } @@ -63,22 +56,85 @@ func AddUpgrade(cmd *cobra.Command, args []string) error { return fmt.Errorf("failed to read binary: %w", err) } - if _, err := os.Stat(cfg.UpgradeBin(upgradeName)); err == nil { - if force, _ := cmd.Flags().GetBool(cosmovisor.FlagForce); !force { - return fmt.Errorf("upgrade binary already exists at %s", cfg.UpgradeBin(upgradeName)) + if err := saveOrAbort(cfg.UpgradeBin(upgradeName), executableData, force); err != nil { + return err + } + + logger.Info(fmt.Sprintf("Using %s for %s upgrade", executablePath, upgradeName)) + logger.Info(fmt.Sprintf("Upgrade binary located at %s", cfg.UpgradeBin(upgradeName))) + + if upgradeHeight > 0 { + plan := upgradetypes.Plan{Name: upgradeName, Height: upgradeHeight} + if err := plan.ValidateBasic(); err != nil { + panic(fmt.Errorf("something is wrong with cosmovisor: %w", err)) + } + + // create upgrade-info.json file + planData, err := json.Marshal(plan) + if err != nil { + return fmt.Errorf("failed to marshal upgrade plan: %w", err) + } + + if err := saveOrAbort(upgradeInfoPath, planData, force); err != nil { + return err } - logger.Info(fmt.Sprintf("Overwriting %s for %s upgrade", executablePath, upgradeName)) + logger.Info(fmt.Sprintf("%s created, %s upgrade binary will switch at height %d", upgradeInfoPath, upgradeName, upgradeHeight)) + } + + return nil +} + +// GetConfig returns a Config using passed-in flag +func getConfigFromCmd(cmd *cobra.Command) (*cosmovisor.Config, error) { + configPath, err := cmd.Flags().GetString(cosmovisor.FlagCosmovisorConfig) + if err != nil { + return nil, fmt.Errorf("failed to get config flag: %w", err) + } + + cfg, err := cosmovisor.GetConfigFromFile(configPath) + if err != nil { + return nil, err + } + return cfg, nil +} + +// addUpgradeCmd parses input flags and adds upgrade info to manifest +func addUpgradeCmd(cmd *cobra.Command, args []string) error { + cfg, err := getConfigFromCmd(cmd) + if err != nil { + return err + } + + upgradeName, executablePath := args[0], args[1] + + force, err := cmd.Flags().GetBool(cosmovisor.FlagForce) + if err != nil { + return fmt.Errorf("failed to get force flag: %w", err) + } + + upgradeHeight, err := cmd.Flags().GetInt64(cosmovisor.FlagUpgradeHeight) + if err != nil { + return fmt.Errorf("failed to get upgrade-height flag: %w", err) + } + + return addUpgrade(cfg, force, upgradeHeight, upgradeName, executablePath, cfg.UpgradeInfoFilePath()) +} + +// saveOrAbort saves data to path or aborts if file exists and force is false +func saveOrAbort(path string, data []byte, force bool) error { + if _, err := os.Stat(path); err == nil { + if !force { + return fmt.Errorf("file already exists at %s", path) + } } else if !os.IsNotExist(err) { - return fmt.Errorf("failed to check if upgrade binary exists: %w", err) + return fmt.Errorf("failed to check if file exists: %w", err) } - if err := os.WriteFile(cfg.UpgradeBin(upgradeName), executableData, 0o600); err != nil { + //nolint:gosec // We need broader permissions to make it executable + if err := os.WriteFile(path, data, 0o755); err != nil { return fmt.Errorf("failed to write binary to location: %w", err) } - logger.Info(fmt.Sprintf("Using %s for %s upgrade", executablePath, upgradeName)) - logger.Info(fmt.Sprintf("Upgrade binary located at %s", cfg.UpgradeBin(upgradeName))) - return nil } diff --git a/tools/cosmovisor/cmd/cosmovisor/batch_upgrade.go b/tools/cosmovisor/cmd/cosmovisor/batch_upgrade.go new file mode 100644 index 000000000000..a66f65b406ab --- /dev/null +++ b/tools/cosmovisor/cmd/cosmovisor/batch_upgrade.go @@ -0,0 +1,143 @@ +package main + +import ( + "encoding/csv" + "encoding/json" + "fmt" + "os" + "path/filepath" + "strconv" + "strings" + + "github.com/spf13/cobra" + + "cosmossdk.io/tools/cosmovisor" +) + +func NewBatchAddUpgradeCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "add-batch-upgrade [flags]", + Short: "Add multiple upgrade binaries at specified heights to cosmovisor", + Long: `This command allows you to specify multiple upgrades at once at specific heights, copying or creating a batch upgrade file that's actively watched during 'cosmovisor run'. +You can provide upgrades in two ways: + +1. Using --upgrade-file: Specify a path to a headerless CSV batch upgrade file in the format: + upgrade-name,path-to-exec,upgrade-height + +2. Using --upgrade-list: Provide a comma-separated list of upgrades. + Each upgrade is defined by three colon-separated values: + a. upgrade-name: A unique identifier for the upgrade + b. path-to-exec: The file path to the upgrade's executable binary + c. upgrade-height: The block height at which the upgrade should occur + This creates a batch upgrade JSON file with the upgrade-info objects in the upgrade directory. + +Note: You must provide either --upgrade-file or --upgrade-list.`, + Example: `cosmovisor add-batch-upgrade --upgrade-list upgrade_v2:/path/to/v2/binary:1000000,upgrade_v3:/path/to/v3/binary:2000000 + +cosmovisor add-batch-upgrade --upgrade-file /path/to/batch_upgrade.csv`, + SilenceUsage: true, + Args: cobra.NoArgs, + RunE: addBatchUpgrade, + } + + cmd.Flags().String("upgrade-file", "", "Path to a batch upgrade file which is a JSON array of upgrade-info objects") + cmd.Flags().StringSlice("upgrade-list", []string{}, "List of comma-separated upgrades in the format 'name:path/to/binary:height'") + cmd.MarkFlagsMutuallyExclusive("upgrade-file", "upgrade-list") + + return cmd +} + +// addBatchUpgrade takes in multiple specified upgrades and creates a single +// batch upgrade file out of them +func addBatchUpgrade(cmd *cobra.Command, args []string) error { + cfg, err := getConfigFromCmd(cmd) + if err != nil { + return err + } + upgradeFile, err := cmd.Flags().GetString("upgrade-file") + if err == nil && upgradeFile != "" { + return processUpgradeFile(cfg, upgradeFile) + } + upgradeList, err := cmd.Flags().GetStringSlice("upgrade-list") + if err != nil || len(upgradeList) == 0 { + return fmt.Errorf("either --upgrade-file or --upgrade-list must be provided") + } + var splitUpgrades [][]string + for _, upgrade := range upgradeList { + splitUpgrades = append(splitUpgrades, strings.Split(upgrade, ":")) + } + return processUpgradeList(cfg, splitUpgrades) +} + +// processUpgradeList takes in a list of upgrades and creates a batch upgrade file +func processUpgradeList(cfg *cosmovisor.Config, upgradeList [][]string) error { + upgradeInfoPaths := []string{} + for i, upgrade := range upgradeList { + if len(upgrade) != 3 { + return fmt.Errorf("argument at position %d (%s) is invalid", i, upgrade) + } + upgradeName := filepath.Base(upgrade[0]) + upgradePath := upgrade[1] + upgradeHeight, err := strconv.ParseInt(upgrade[2], 10, 64) + if err != nil { + return fmt.Errorf("upgrade height at position %d (%s) is invalid", i, upgrade[2]) + } + upgradeInfoPath := cfg.UpgradeInfoFilePath() + "." + upgradeName + upgradeInfoPaths = append(upgradeInfoPaths, upgradeInfoPath) + if err := addUpgrade(cfg, true, upgradeHeight, upgradeName, upgradePath, upgradeInfoPath); err != nil { + return err + } + } + + var allData []json.RawMessage + for _, uip := range upgradeInfoPaths { + fileData, err := os.ReadFile(uip) + if err != nil { + return fmt.Errorf("error reading file %s: %w", uip, err) + } + + // Verify it's valid JSON + var jsonData json.RawMessage + if err := json.Unmarshal(fileData, &jsonData); err != nil { + return fmt.Errorf("error parsing JSON from file %s: %w", uip, err) + } + + // Add to our slice + allData = append(allData, jsonData) + } + + // Marshal the combined data + batchData, err := json.MarshalIndent(allData, "", " ") + if err != nil { + return fmt.Errorf("error marshaling combined JSON: %w", err) + } + + // Write to output file + err = os.WriteFile(cfg.UpgradeInfoBatchFilePath(), batchData, 0o600) + if err != nil { + return fmt.Errorf("error writing combined JSON to file: %w", err) + } + + return nil +} + +// processUpgradeFile takes in a CSV batch upgrade file, parses it and calls processUpgradeList +func processUpgradeFile(cfg *cosmovisor.Config, upgradeFile string) error { + file, err := os.Open(upgradeFile) + if err != nil { + return fmt.Errorf("error opening upgrade CSV file %s: %w", upgradeFile, err) + } + defer file.Close() + + r := csv.NewReader(file) + r.FieldsPerRecord = 3 + r.TrimLeadingSpace = true + records, err := r.ReadAll() + if err != nil { + return fmt.Errorf("error parsing upgrade CSV file %s: %w", upgradeFile, err) + } + if err := processUpgradeList(cfg, records); err != nil { + return err + } + return nil +} diff --git a/tools/cosmovisor/cmd/cosmovisor/config.go b/tools/cosmovisor/cmd/cosmovisor/config.go index c6ef7af28a82..d651e5fb3839 100644 --- a/tools/cosmovisor/cmd/cosmovisor/config.go +++ b/tools/cosmovisor/cmd/cosmovisor/config.go @@ -1,16 +1,19 @@ package main import ( - "cosmossdk.io/tools/cosmovisor" "github.com/spf13/cobra" + + "cosmossdk.io/tools/cosmovisor" ) var configCmd = &cobra.Command{ - Use: "config", - Short: "Display cosmovisor config (prints environment variables used by cosmovisor).", + Use: "config", + Short: "Display cosmovisor config.", + Long: `Display cosmovisor config. If a config file is provided, it will display the config from the file, +otherwise it will display the config from the environment variables.`, SilenceUsage: true, RunE: func(cmd *cobra.Command, args []string) error { - cfg, err := cosmovisor.GetConfigFromEnv() + cfg, err := cosmovisor.GetConfigFromFile(cmd.Flag(cosmovisor.FlagCosmovisorConfig).Value.String()) if err != nil { return err } diff --git a/tools/cosmovisor/cmd/cosmovisor/help.go b/tools/cosmovisor/cmd/cosmovisor/help.go index ba9c32afcbb5..6d6df59cef7b 100644 --- a/tools/cosmovisor/cmd/cosmovisor/help.go +++ b/tools/cosmovisor/cmd/cosmovisor/help.go @@ -18,7 +18,7 @@ the proposal. Cosmovisor interprets that data to perform an update: switch a cur and restart the App. Configuration of Cosmovisor is done through environment variables, which are -documented in: https://docs.cosmos.network/main/tooling/cosmovisor`, +documented in: https://docs.cosmos.network/main/build/tooling/cosmovisor`, cosmovisor.EnvName, cosmovisor.EnvHome, ) } diff --git a/tools/cosmovisor/cmd/cosmovisor/help_test.go b/tools/cosmovisor/cmd/cosmovisor/help_test.go index fe4e5d78c93b..48d7aa148436 100644 --- a/tools/cosmovisor/cmd/cosmovisor/help_test.go +++ b/tools/cosmovisor/cmd/cosmovisor/help_test.go @@ -12,7 +12,7 @@ func TestGetHelpText(t *testing.T) { expectedPieces := []string{ "Cosmovisor", cosmovisor.EnvName, cosmovisor.EnvHome, - "https://docs.cosmos.network/main/tooling/cosmovisor", + "https://docs.cosmos.network/main/build/tooling/cosmovisor", } actual := GetHelpText() diff --git a/tools/cosmovisor/cmd/cosmovisor/init.go b/tools/cosmovisor/cmd/cosmovisor/init.go index da5da92ec0b8..90a35ca286fa 100644 --- a/tools/cosmovisor/cmd/cosmovisor/init.go +++ b/tools/cosmovisor/cmd/cosmovisor/init.go @@ -11,18 +11,23 @@ import ( "cosmossdk.io/log" "cosmossdk.io/tools/cosmovisor" - cverrors "cosmossdk.io/tools/cosmovisor/errors" "cosmossdk.io/x/upgrade/plan" ) -var initCmd = &cobra.Command{ - Use: "init ", - Short: "Initialize a cosmovisor daemon home directory.", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - logger := cmd.Context().Value(log.ContextKey).(log.Logger) - return InitializeCosmovisor(logger, args) - }, +func NewInitCmd() *cobra.Command { + initCmd := &cobra.Command{ + Use: "init ", + Short: "Initialize a cosmovisor daemon home directory.", + Long: `Initialize a cosmovisor daemon home directory with the provided executable. +Configuration file is initialized at the default path (<-home->/cosmovisor/config.toml).`, + Args: cobra.ExactArgs(1), + SilenceUsage: true, + RunE: func(cmd *cobra.Command, args []string) error { + return InitializeCosmovisor(nil, args) + }, + } + + return initCmd } // InitializeCosmovisor initializes the cosmovisor directories, current link, and initial executable. @@ -39,11 +44,22 @@ func InitializeCosmovisor(logger log.Logger, args []string) error { case exeInfo.IsDir(): return errors.New("invalid path to executable: must not be a directory") } - cfg, err := getConfigForInitCmd() + + // skipping validation to not check if directories exist + cfg, err := cosmovisor.GetConfigFromEnv(true) if err != nil { return err } + // process to minimal validation + if err := minConfigValidate(cfg); err != nil { + return err + } + + if logger == nil { + logger = cfg.Logger(os.Stdout) + } + logger.Info("checking on the genesis/bin directory") genBinExe := cfg.GenesisBin() genBinDir, _ := filepath.Split(genBinExe) @@ -77,6 +93,12 @@ func InitializeCosmovisor(logger log.Logger, args []string) error { return err } + // set current working directory to $DAEMON_NAME/cosmosvisor + // to allow current symlink to be relative + if err = os.Chdir(cfg.Root()); err != nil { + return fmt.Errorf("failed to change directory to %s: %w", cfg.Root(), err) + } + logger.Info("checking on the current symlink and creating it if needed") cur, curErr := cfg.CurrentBin() if curErr != nil { @@ -84,31 +106,29 @@ func InitializeCosmovisor(logger log.Logger, args []string) error { } logger.Info(fmt.Sprintf("the current symlink points to: %q", cur)) + filePath, err := cfg.Export() + if err != nil { + return fmt.Errorf("failed to export configuration: %w", err) + } + logger.Info(fmt.Sprintf("cosmovisor config.toml created at: %s", filePath)) + return nil } -// getConfigForInitCmd gets just the configuration elements needed to initialize cosmovisor. -func getConfigForInitCmd() (*cosmovisor.Config, error) { +func minConfigValidate(cfg *cosmovisor.Config) error { var errs []error - // Note: Not using GetConfigFromEnv here because that checks that the directories already exist. - // We also don't care about the rest of the configuration stuff in here. - cfg := &cosmovisor.Config{ - Home: os.Getenv(cosmovisor.EnvHome), - Name: os.Getenv(cosmovisor.EnvName), - } if len(cfg.Name) == 0 { errs = append(errs, fmt.Errorf("%s is not set", cosmovisor.EnvName)) } + switch { case len(cfg.Home) == 0: errs = append(errs, fmt.Errorf("%s is not set", cosmovisor.EnvHome)) case !filepath.IsAbs(cfg.Home): errs = append(errs, fmt.Errorf("%s must be an absolute path", cosmovisor.EnvHome)) } - if len(errs) > 0 { - return nil, cverrors.FlattenErrors(errs...) - } - return cfg, nil + + return errors.Join(errs...) } // copyFile copies the file at the given source to the given destination. diff --git a/tools/cosmovisor/cmd/cosmovisor/init_test.go b/tools/cosmovisor/cmd/cosmovisor/init_test.go index be943263d41e..35a73348cc39 100644 --- a/tools/cosmovisor/cmd/cosmovisor/init_test.go +++ b/tools/cosmovisor/cmd/cosmovisor/init_test.go @@ -9,7 +9,8 @@ import ( "testing" "time" - "github.com/rs/zerolog" + "github.com/pelletier/go-toml/v2" + "github.com/spf13/viper" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" @@ -18,6 +19,13 @@ import ( "cosmossdk.io/tools/cosmovisor" ) +const ( + notset = " is not set" + cosmovisorDirName = "cosmovisor" + + cfgFileWithExt = "config.toml" +) + type InitTestSuite struct { suite.Suite } @@ -28,15 +36,24 @@ func TestInitTestSuite(t *testing.T) { // cosmovisorInitEnv are some string values of environment variables used to configure Cosmovisor, and used by the init command. type cosmovisorInitEnv struct { - Home string - Name string + Home string + Name string + ColorLogs string + TimeFormatLogs string +} + +type envMap struct { + val string + allowEmpty bool } // ToMap creates a map of the cosmovisorInitEnv where the keys are the env var names. -func (c cosmovisorInitEnv) ToMap() map[string]string { - return map[string]string{ - cosmovisor.EnvHome: c.Home, - cosmovisor.EnvName: c.Name, +func (c cosmovisorInitEnv) ToMap() map[string]envMap { + return map[string]envMap{ + cosmovisor.EnvHome: {val: c.Home, allowEmpty: false}, + cosmovisor.EnvName: {val: c.Name, allowEmpty: false}, + cosmovisor.EnvColorLogs: {val: c.ColorLogs, allowEmpty: false}, + cosmovisor.EnvTimeFormatLogs: {val: c.TimeFormatLogs, allowEmpty: true}, } } @@ -47,6 +64,10 @@ func (c *cosmovisorInitEnv) Set(envVar, envVal string) { c.Home = envVal case cosmovisor.EnvName: c.Name = envVal + case cosmovisor.EnvColorLogs: + c.Name = envVal + case cosmovisor.EnvTimeFormatLogs: + c.Name = envVal default: panic(fmt.Errorf("Unknown environment variable [%s]. Cannot set field to [%s]. ", envVar, envVal)) } @@ -63,6 +84,7 @@ func (s *InitTestSuite) clearEnv() *cosmovisorInitEnv { for envVar := range rv.ToMap() { rv.Set(envVar, os.Getenv(envVar)) s.Require().NoError(os.Unsetenv(envVar)) + viper.Reset() } return &rv } @@ -70,16 +92,16 @@ func (s *InitTestSuite) clearEnv() *cosmovisorInitEnv { // setEnv sets environment variables to the values provided. // If t is not nil, and there's a problem, the test will fail immediately. // If t is nil, problems will just be logged using s.T(). -func (s *InitTestSuite) setEnv(t *testing.T, env *cosmovisorInitEnv) { +func (s *InitTestSuite) setEnv(t *testing.T, env *cosmovisorInitEnv) { //nolint:thelper // false psotive if t == nil { s.T().Logf("Restoring environment variables.") } for envVar, envVal := range env.ToMap() { var err error var msg string - if len(envVal) != 0 { - err = os.Setenv(envVar, envVal) - msg = fmt.Sprintf("setting %s to %s", envVar, envVal) + if len(envVal.val) != 0 || envVal.allowEmpty { + err = os.Setenv(envVar, envVal.val) + msg = fmt.Sprintf("setting %s to %s", envVar, envVal.val) } else { err = os.Unsetenv(envVar) msg = fmt.Sprintf("unsetting %s", envVar) @@ -95,9 +117,29 @@ func (s *InitTestSuite) setEnv(t *testing.T, env *cosmovisorInitEnv) { } } +// readStdInpFromFile reads the provided data as if it were a standard input. +func (s *InitTestSuite) readStdInpFromFile(data []byte) { + // Create a temporary file and write the test input into it + tmpfile, err := os.CreateTemp("", "test") + if err != nil { + s.T().Fatal(err) + } + + // write the test input into the temporary file + if _, err := tmpfile.Write(data); err != nil { + s.T().Fatal(err) + } + + if _, err := tmpfile.Seek(0, 0); err != nil { + s.T().Fatal(err) + } + + os.Stdin = tmpfile +} + var ( - _ io.Reader = BufferedPipe{} - _ io.Writer = BufferedPipe{} + _ io.Reader = &BufferedPipe{} + _ io.Writer = &BufferedPipe{} ) // BufferedPipe contains a connected read/write pair of files (a pipe), @@ -125,8 +167,8 @@ type BufferedPipe struct { // NewBufferedPipe creates a new BufferedPipe with the given name. // Files must be closed once you are done with them (e.g. with .Close()). // Once ready, buffering must be started using .Start(). See also StartNewBufferedPipe. -func NewBufferedPipe(name string, replicateTo ...io.Writer) (BufferedPipe, error) { - p := BufferedPipe{Name: name} +func NewBufferedPipe(name string, replicateTo ...io.Writer) (*BufferedPipe, error) { + p := &BufferedPipe{Name: name} p.Reader, p.Writer, p.Error = os.Pipe() if p.Error != nil { return p, p.Error @@ -142,7 +184,7 @@ func NewBufferedPipe(name string, replicateTo ...io.Writer) (BufferedPipe, error // // p, _ := NewBufferedPipe(name, replicateTo...) // p.Start() -func StartNewBufferedPipe(name string, replicateTo ...io.Writer) (BufferedPipe, error) { +func StartNewBufferedPipe(name string, replicateTo ...io.Writer) (*BufferedPipe, error) { p, err := NewBufferedPipe(name, replicateTo...) if err != nil { return p, err @@ -172,6 +214,7 @@ func (p *BufferedPipe) Start() { if _, p.Error = io.Copy(&b, p.BufferReader); p.Error != nil { b.WriteString("buffer error: " + p.Error.Error()) } + p.buffer <- b.Bytes() }() p.started = true @@ -196,6 +239,7 @@ func (p *BufferedPipe) Collect() []byte { panic("buffered pipe " + p.Name + " has not been started: cannot collect") } _ = p.Writer.Close() + if p.buffer == nil { return []byte{} } @@ -205,12 +249,12 @@ func (p *BufferedPipe) Collect() []byte { } // Read implements the io.Reader interface on this BufferedPipe. -func (p BufferedPipe) Read(bz []byte) (n int, err error) { +func (p *BufferedPipe) Read(bz []byte) (n int, err error) { return p.Reader.Read(bz) } // Write implements the io.Writer interface on this BufferedPipe. -func (p BufferedPipe) Write(bz []byte) (n int, err error) { +func (p *BufferedPipe) Write(bz []byte) (n int, err error) { return p.Writer.Write(bz) } @@ -231,9 +275,8 @@ func (p *BufferedPipe) panicIfStarted(msg string) { func (s *InitTestSuite) NewCapturingLogger() (*BufferedPipe, log.Logger) { bufferedStdOut, err := StartNewBufferedPipe("stdout", os.Stdout) s.Require().NoError(err, "creating stdout buffered pipe") - output := zerolog.ConsoleWriter{Out: bufferedStdOut, TimeFormat: time.RFC3339Nano} - logger := log.NewCustomLogger(zerolog.New(output).With().Str("module", "cosmovisor").Timestamp().Logger()) - return &bufferedStdOut, logger + logger := log.NewLogger(bufferedStdOut, log.ColorOption(false), log.TimeFormatOption(time.RFC3339Nano)).With(log.ModuleKey, cosmovisorDirName) + return bufferedStdOut, logger } // CreateHelloWorld creates a shell script that outputs HELLO WORLD. @@ -291,13 +334,13 @@ func (s *InitTestSuite) TestInitializeCosmovisorNegativeValidation() { name: "no name", env: cosmovisorInitEnv{Home: "/example", Name: ""}, args: []string{tmpExe}, - inErr: []string{cosmovisor.EnvName + " is not set"}, + inErr: []string{cosmovisor.EnvName + notset}, }, { name: "no home", env: cosmovisorInitEnv{Home: "", Name: "foo"}, args: []string{tmpExe}, - inErr: []string{cosmovisor.EnvHome + " is not set"}, + inErr: []string{cosmovisor.EnvHome + notset}, }, { name: "home is relative", @@ -309,7 +352,7 @@ func (s *InitTestSuite) TestInitializeCosmovisorNegativeValidation() { name: "no name and no home", env: cosmovisorInitEnv{Home: "", Name: ""}, args: []string{tmpExe}, - inErr: []string{cosmovisor.EnvName + " is not set", cosmovisor.EnvHome + " is not set"}, + inErr: []string{cosmovisor.EnvName + notset, cosmovisor.EnvHome + notset}, }, } @@ -343,7 +386,7 @@ func (s *InitTestSuite) TestInitializeCosmovisorInvalidExisting() { Home: filepath.Join(testDir, "home"), Name: "pear", } - genDir := filepath.Join(env.Home, "cosmovisor", "genesis") + genDir := filepath.Join(env.Home, cosmovisorDirName, "genesis") genBin := filepath.Join(genDir, "bin") require.NoError(t, os.MkdirAll(genDir, 0o755), "creating genesis directory") require.NoError(t, copyFile(hwExe, genBin), "copying exe to genesis/bin") @@ -363,7 +406,7 @@ func (s *InitTestSuite) TestInitializeCosmovisorInvalidExisting() { } // Create the genesis bin executable path fully as a directory (instead of a file). // That should get through all the other stuff, but error when EnsureBinary is called. - genBinExe := filepath.Join(env.Home, "cosmovisor", "genesis", "bin", env.Name) + genBinExe := filepath.Join(env.Home, cosmovisorDirName, "genesis", "bin", env.Name) require.NoError(t, os.MkdirAll(genBinExe, 0o755)) expErr := fmt.Sprintf("%s is not a regular file", env.Name) // Check the log messages just to make sure it's erroring where expecting. @@ -399,18 +442,16 @@ func (s *InitTestSuite) TestInitializeCosmovisorInvalidExisting() { Home: filepath.Join(testDir, "home"), Name: "orange", } - rootDir := filepath.Join(env.Home, "cosmovisor") + rootDir := filepath.Join(env.Home, cosmovisorDirName) require.NoError(t, os.MkdirAll(rootDir, 0o755)) curLn := filepath.Join(rootDir, "current") - genDir := filepath.Join(rootDir, "genesis") require.NoError(t, copyFile(hwExe, curLn)) - expErr := fmt.Sprintf("symlink %s %s: file exists", genDir, curLn) s.setEnv(t, env) buffer, logger := s.NewCapturingLogger() logger.Info(fmt.Sprintf("Calling InitializeCosmovisor: %s", t.Name())) err := InitializeCosmovisor(logger, []string{hwExe}) - require.EqualError(t, err, expErr, "calling InitializeCosmovisor") + require.EqualError(t, err, "symlink genesis current: file exists", "calling InitializeCosmovisor") bufferBz := buffer.Collect() bufferStr := string(bufferBz) assert.Contains(t, bufferStr, "checking on the current symlink and creating it if needed") @@ -443,36 +484,43 @@ func (s *InitTestSuite) TestInitializeCosmovisorValid() { hwExe := s.CreateHelloWorld(0o755) s.T().Run("starting with blank slate", func(t *testing.T) { - testDir := s.T().TempDir() - env := &cosmovisorInitEnv{ - Home: filepath.Join(testDir, "home"), + env := s.prepareConfig(s.T(), cosmovisorInitEnv{ Name: "blank", - } - curLn := filepath.Join(env.Home, "cosmovisor", "current") - genBinDir := filepath.Join(env.Home, "cosmovisor", "genesis", "bin") - genBinExe := filepath.Join(genBinDir, env.Name) + }) + + curLn := filepath.Join(env.Home, cosmovisorDirName, "current") + + s.setEnv(s.T(), env) + buffer, logger := s.NewCapturingLogger() + logger.Info(fmt.Sprintf("Calling InitializeCosmovisor: %s", t.Name())) + err := InitializeCosmovisor(logger, []string{hwNonExe}) + require.NoError(t, err, "calling InitializeCosmovisor") + + genDir := filepath.Join(env.Home, cosmovisorDirName, "genesis", "bin") + genBinExe := filepath.Join(genDir, env.Name) + + genBinDirEval, err := filepath.EvalSymlinks(genDir) + require.NoError(t, err) + + genBinEvalExe := filepath.Join(genBinDirEval, env.Name) + expInLog := []string{ "checking on the genesis/bin directory", - fmt.Sprintf("creating directory (and any parents): %q", genBinDir), + fmt.Sprintf("creating directory (and any parents): %q", genDir), "checking on the genesis/bin executable", fmt.Sprintf("copying executable into place: %q", genBinExe), fmt.Sprintf("making sure %q is executable", genBinExe), "checking on the current symlink and creating it if needed", - fmt.Sprintf("the current symlink points to: %q", genBinExe), + fmt.Sprintf("the current symlink points to: %q", genBinEvalExe), + fmt.Sprintf("cosmovisor config.toml created at: %s", filepath.Join(env.Home, cosmovisorDirName, cfgFileWithExt)), } - s.setEnv(s.T(), env) - buffer, logger := s.NewCapturingLogger() - logger.Info(fmt.Sprintf("Calling InitializeCosmovisor: %s", t.Name())) - err := InitializeCosmovisor(logger, []string{hwNonExe}) - require.NoError(t, err, "calling InitializeCosmovisor") - - _, err = os.Stat(genBinDir) - assert.NoErrorf(t, err, "statting the genesis bin dir: %q", genBinDir) + _, err = os.Stat(genBinDirEval) + assert.NoErrorf(t, err, "statting the genesis bin dir: %q", genBinDirEval) _, err = os.Stat(curLn) assert.NoError(t, err, "statting the current link: %q", curLn) - exeInfo, exeErr := os.Stat(genBinExe) - if assert.NoError(t, exeErr, "statting the executable: %q", genBinExe) { + exeInfo, exeErr := os.Stat(genBinEvalExe) + if assert.NoError(t, exeErr, "statting the executable: %q", genBinEvalExe) { assert.True(t, exeInfo.Mode().IsRegular(), "executable is regular file") // Check if the world-executable bit is set. exePermMask := exeInfo.Mode().Perm() & 0o001 @@ -491,11 +539,19 @@ func (s *InitTestSuite) TestInitializeCosmovisorValid() { Home: filepath.Join(testDir, "home"), Name: "nocur", } - rootDir := filepath.Join(env.Home, "cosmovisor") + rootDir := filepath.Join(env.Home, cosmovisorDirName) + genBinDir := filepath.Join(rootDir, "genesis", "bin") genBinDirExe := filepath.Join(genBinDir, env.Name) + require.NoError(t, os.MkdirAll(genBinDir, 0o755), "making genesis bin dir") require.NoError(t, copyFile(hwExe, genBinDirExe), "copying executable to genesis") + + genBinDirEval, err := filepath.EvalSymlinks(genBinDir) + require.NoError(t, err) + + genBinEvalExe := filepath.Join(genBinDirEval, env.Name) + upgradesDir := filepath.Join(rootDir, "upgrades") for i := 1; i <= 5; i++ { upgradeBinDir := filepath.Join(upgradesDir, fmt.Sprintf("upgrade-%02d", i), "bin") @@ -510,13 +566,14 @@ func (s *InitTestSuite) TestInitializeCosmovisorValid() { "checking on the genesis/bin executable", fmt.Sprintf("the %q file already exists", genBinDirExe), fmt.Sprintf("making sure %q is executable", genBinDirExe), - fmt.Sprintf("the current symlink points to: %q", genBinDirExe), + fmt.Sprintf("the current symlink points to: %q", genBinEvalExe), + fmt.Sprintf("cosmovisor config.toml created at: %s", filepath.Join(env.Home, cosmovisorDirName, cfgFileWithExt)), } s.setEnv(t, env) buffer, logger := s.NewCapturingLogger() logger.Info(fmt.Sprintf("Calling InitializeCosmovisor: %s", t.Name())) - err := InitializeCosmovisor(logger, []string{hwExe}) + err = InitializeCosmovisor(logger, []string{hwExe}) require.NoError(t, err, "calling InitializeCosmovisor") bufferBz := buffer.Collect() bufferStr := string(bufferBz) @@ -531,18 +588,47 @@ func (s *InitTestSuite) TestInitializeCosmovisorValid() { Home: filepath.Join(testDir, "home"), Name: "emptygen", } - rootDir := filepath.Join(env.Home, "cosmovisor") + rootDir := filepath.Join(env.Home, cosmovisorDirName) genBinDir := filepath.Join(rootDir, "genesis", "bin") genBinExe := filepath.Join(genBinDir, env.Name) require.NoError(t, os.MkdirAll(genBinDir, 0o755), "making genesis bin dir") + s.setEnv(t, env) + buffer, logger := s.NewCapturingLogger() + logger.Info(fmt.Sprintf("Calling InitializeCosmovisor: %s", t.Name())) + err := InitializeCosmovisor(logger, []string{hwExe}) + require.NoError(t, err, "calling InitializeCosmovisor") + + genBinDirEval, err := filepath.EvalSymlinks(genBinDir) + require.NoError(t, err) + + genBinEvalExe := filepath.Join(genBinDirEval, env.Name) + expInLog := []string{ "checking on the genesis/bin directory", fmt.Sprintf("the %q directory already exists", genBinDir), "checking on the genesis/bin executable", fmt.Sprintf("copying executable into place: %q", genBinExe), fmt.Sprintf("making sure %q is executable", genBinExe), - fmt.Sprintf("the current symlink points to: %q", genBinExe), + fmt.Sprintf("the current symlink points to: %q", genBinEvalExe), + fmt.Sprintf("cosmovisor config.toml created at: %s", filepath.Join(env.Home, cosmovisorDirName, cfgFileWithExt)), + } + + bufferBz := buffer.Collect() + bufferStr := string(bufferBz) + for _, exp := range expInLog { + assert.Contains(t, bufferStr, exp) + } + }) + + s.T().Run("ask to override (y/n) the existing config file", func(t *testing.T) { + }) + + s.T().Run("init command exports configs to default path", func(t *testing.T) { + testDir := s.T().TempDir() + env := &cosmovisorInitEnv{ + Home: filepath.Join(testDir, "home"), + Name: "emptygen", } s.setEnv(t, env) @@ -552,8 +638,106 @@ func (s *InitTestSuite) TestInitializeCosmovisorValid() { require.NoError(t, err, "calling InitializeCosmovisor") bufferBz := buffer.Collect() bufferStr := string(bufferBz) - for _, exp := range expInLog { - assert.Contains(t, bufferStr, exp) - } + assert.Contains(t, bufferStr, fmt.Sprintf("cosmovisor config.toml created at: %s", filepath.Join(env.Home, cosmovisorDirName, cfgFileWithExt))) }) } + +func (s *InitTestSuite) TestInitializeCosmovisorWithOverrideCfg() { + initEnv := s.clearEnv() + defer s.setEnv(nil, initEnv) + + tmpExe := s.CreateHelloWorld(0o755) + testDir := s.T().TempDir() + homePath := filepath.Join(testDir, "backup") + testCases := []struct { + name string + input string + cfg *cosmovisor.Config + override bool + }{ + { + name: "yes override", + input: "y\n", + cfg: &cosmovisor.Config{ + Home: homePath, + Name: "old_test", + DataBackupPath: homePath, + }, + override: true, + }, + { + name: "no override", + input: "n\n", + cfg: &cosmovisor.Config{ + Home: homePath, + Name: "old_test", + DataBackupPath: homePath, + }, + override: false, + }, + } + + for _, tc := range testCases { + s.T().Run(tc.name, func(t *testing.T) { + // create a root cosmovisor directory + require.NoError(t, os.MkdirAll(tc.cfg.Root(), 0o755), "making root dir") + + // create a config file in the default location + file, err := os.Create(tc.cfg.DefaultCfgPath()) + require.NoError(t, err) + + // write the config to the file + err = toml.NewEncoder(file).Encode(tc.cfg) + require.NoError(t, err) + + err = file.Close() + require.NoError(t, err) + + s.readStdInpFromFile([]byte(tc.input)) + + _, logger := s.NewCapturingLogger() + logger.Info(fmt.Sprintf("Calling InitializeCosmovisor: %s", t.Name())) + + // override the daemon name in environment file + // if override is true (y), then the name should be updated in the config file + // otherwise (n), the name should not be updated in the config file + s.setEnv(t, &cosmovisorInitEnv{ + Home: tc.cfg.Home, + Name: "update_name", + }) + + err = InitializeCosmovisor(logger, []string{tmpExe}) + require.NoError(t, err, "calling InitializeCosmovisor") + + cfg := &cosmovisor.Config{} + // read the config file + cfgFile, err := os.Open(tc.cfg.DefaultCfgPath()) + require.NoError(t, err) + defer func() { + _ = cfgFile.Close() + }() + + err = toml.NewDecoder(cfgFile).Decode(cfg) + require.NoError(t, err) + if tc.override { + // check if the name is updated + // basically, override the existing config file + assert.Equal(t, "update_name", cfg.Name) + } else { + // daemon name should not be updated + assert.Equal(t, tc.cfg.Name, cfg.Name) + } + }) + } +} + +func (s *InitTestSuite) prepareConfig(t *testing.T, config cosmovisorInitEnv) *cosmovisorInitEnv { + t.Helper() + + config.Home = s.T().TempDir() + + err := os.Chdir(config.Home) + require.NoError(t, err) + + return &config +} diff --git a/tools/cosmovisor/cmd/cosmovisor/main.go b/tools/cosmovisor/cmd/cosmovisor/main.go index 206802ac19e3..294dd66f7165 100644 --- a/tools/cosmovisor/cmd/cosmovisor/main.go +++ b/tools/cosmovisor/cmd/cosmovisor/main.go @@ -3,17 +3,10 @@ package main import ( "context" "os" - - "cosmossdk.io/log" - cverrors "cosmossdk.io/tools/cosmovisor/errors" ) func main() { - logger := log.NewLogger(os.Stdout).With(log.ModuleKey, "cosmovisor") - ctx := context.WithValue(context.Background(), log.ContextKey, logger) - - if err := NewRootCmd().ExecuteContext(ctx); err != nil { - cverrors.LogErrors(logger, "", err) + if err := NewRootCmd().ExecuteContext(context.Background()); err != nil { os.Exit(1) } } diff --git a/tools/cosmovisor/cmd/cosmovisor/prepare_upgrade.go b/tools/cosmovisor/cmd/cosmovisor/prepare_upgrade.go new file mode 100644 index 000000000000..f3a5acc071d4 --- /dev/null +++ b/tools/cosmovisor/cmd/cosmovisor/prepare_upgrade.go @@ -0,0 +1,124 @@ +package main + +import ( + "context" + "crypto/tls" + "fmt" + "strings" + "time" + + "github.com/spf13/cobra" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/credentials/insecure" + + "cosmossdk.io/tools/cosmovisor" + "cosmossdk.io/x/upgrade/plan" + upgradetypes "cosmossdk.io/x/upgrade/types" +) + +func NewPrepareUpgradeCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "prepare-upgrade", + Short: "Prepare for the next upgrade", + Long: `Prepare for the next upgrade by downloading and verifying the upgrade binary. +This command will query the chain for the current upgrade plan and download the specified binary. +gRPC must be enabled on the node for this command to work.`, + RunE: prepareUpgradeHandler, + SilenceUsage: false, + Args: cobra.NoArgs, + } + + return cmd +} + +func prepareUpgradeHandler(cmd *cobra.Command, _ []string) error { + configPath, err := cmd.Flags().GetString(cosmovisor.FlagCosmovisorConfig) + if err != nil { + return fmt.Errorf("failed to get config flag: %w", err) + } + + cfg, err := cosmovisor.GetConfigFromFile(configPath) + if err != nil { + return fmt.Errorf("failed to get config: %w", err) + } + + logger := cfg.Logger(cmd.OutOrStdout()) + + grpcAddress := cfg.GRPCAddress + logger.Info("Using gRPC address", "address", grpcAddress) + + upgradeInfo, err := queryUpgradeInfoFromChain(grpcAddress) + if err != nil { + return fmt.Errorf("failed to query upgrade info: %w", err) + } + + if upgradeInfo == nil { + logger.Info("No active upgrade plan found") + return nil + } + + logger.Info("Preparing for upgrade", "name", upgradeInfo.Name, "height", upgradeInfo.Height) + + upgradeInfoParsed, err := plan.ParseInfo(upgradeInfo.Info, plan.ParseOptionEnforceChecksum(cfg.DownloadMustHaveChecksum)) + if err != nil { + return fmt.Errorf("failed to parse upgrade info: %w", err) + } + + binaryURL, err := cosmovisor.GetBinaryURL(upgradeInfoParsed.Binaries) + if err != nil { + return fmt.Errorf("binary URL not found in upgrade plan. Cannot prepare for upgrade: %w", err) + } + + logger.Info("Downloading upgrade binary", "url", binaryURL) + + if err := plan.DownloadUpgrade(cfg.UpgradeDir(upgradeInfo.Name), binaryURL, cfg.Name); err != nil { + return fmt.Errorf("failed to download and verify binary: %w", err) + } + + logger.Info("Upgrade preparation complete", "name", upgradeInfo.Name, "height", upgradeInfo.Height) + + return nil +} + +func queryUpgradeInfoFromChain(grpcAddress string) (*upgradetypes.Plan, error) { + if grpcAddress == "" { + return nil, fmt.Errorf("gRPC address is empty") + } + + grpcConn, err := getClient(grpcAddress) + if err != nil { + return nil, fmt.Errorf("failed to open gRPC client: %w", err) + } + defer grpcConn.Close() + + queryClient := upgradetypes.NewQueryClient(grpcConn) + + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + res, err := queryClient.CurrentPlan(ctx, &upgradetypes.QueryCurrentPlanRequest{}) + if err != nil { + return nil, fmt.Errorf("failed to query current upgrade plan: %w", err) + } + + return res.Plan, nil +} + +func getClient(endpoint string) (*grpc.ClientConn, error) { + var creds credentials.TransportCredentials + if strings.HasPrefix(endpoint, "https://") { + tlsConfig := &tls.Config{ + MinVersion: tls.VersionTLS12, + } + creds = credentials.NewTLS(tlsConfig) + } else { + creds = insecure.NewCredentials() + } + + opts := []grpc.DialOption{ + grpc.WithTransportCredentials(creds), + } + + return grpc.NewClient(endpoint, opts...) +} diff --git a/tools/cosmovisor/cmd/cosmovisor/root.go b/tools/cosmovisor/cmd/cosmovisor/root.go index 4d87d9867c2d..92b1af2e11cf 100644 --- a/tools/cosmovisor/cmd/cosmovisor/root.go +++ b/tools/cosmovisor/cmd/cosmovisor/root.go @@ -2,6 +2,8 @@ package main import ( "github.com/spf13/cobra" + + "cosmossdk.io/tools/cosmovisor" ) func NewRootCmd() *cobra.Command { @@ -12,12 +14,16 @@ func NewRootCmd() *cobra.Command { } rootCmd.AddCommand( - initCmd, + NewInitCmd(), runCmd, configCmd, NewVersionCmd(), NewAddUpgradeCmd(), + NewShowUpgradeInfoCmd(), + NewBatchAddUpgradeCmd(), + NewPrepareUpgradeCmd(), ) + rootCmd.PersistentFlags().StringP(cosmovisor.FlagCosmovisorConfig, "c", "", "path to cosmovisor config file") return rootCmd } diff --git a/tools/cosmovisor/cmd/cosmovisor/run.go b/tools/cosmovisor/cmd/cosmovisor/run.go index fe300d58fa62..4da2ac24d846 100644 --- a/tools/cosmovisor/cmd/cosmovisor/run.go +++ b/tools/cosmovisor/cmd/cosmovisor/run.go @@ -1,50 +1,62 @@ package main import ( - "cosmossdk.io/log" - "cosmossdk.io/tools/cosmovisor" - "github.com/rs/zerolog" + "fmt" + "os" + "strings" + "github.com/spf13/cobra" + + "cosmossdk.io/tools/cosmovisor" ) var runCmd = &cobra.Command{ - Use: "run", - Short: "Run an APP command.", + Use: "run", + Short: "Run an APP command.", + Long: `Run an APP command. This command is intended to be used by the cosmovisor binary. +Provide '--cosmovisor-config' file path in command args or set env variables to load configuration. +`, SilenceUsage: true, DisableFlagParsing: true, - RunE: func(cmd *cobra.Command, args []string) error { - return Run(cmd, args) + RunE: func(_ *cobra.Command, args []string) error { + cfgPath, args, err := parseCosmovisorConfig(args) + if err != nil { + return fmt.Errorf("failed to parse cosmovisor config: %w", err) + } + + return run(cfgPath, args) }, } -// Run runs the configured program with the given args and monitors it for upgrades. -func Run(cmd *cobra.Command, args []string, options ...RunOption) error { - cfg, err := cosmovisor.GetConfigFromEnv() +// run runs the configured program with the given args and monitors it for upgrades. +func run(cfgPath string, args []string, options ...RunOption) error { + cfg, err := cosmovisor.GetConfigFromFile(cfgPath) if err != nil { return err } - logger := cmd.Context().Value(log.ContextKey).(log.Logger) - - if cfg.DisableLogs { - logger = log.NewCustomLogger(zerolog.Nop()) - } - runCfg := DefaultRunConfig for _, opt := range options { opt(&runCfg) } + // set current working directory to $DAEMON_NAME/cosmosvisor + // to allow current symlink to be relative + if err = os.Chdir(cfg.Root()); err != nil { + return err + } + + logger := cfg.Logger(runCfg.StdOut) launcher, err := cosmovisor.NewLauncher(logger, cfg) if err != nil { return err } - doUpgrade, err := launcher.Run(args, runCfg.StdOut, runCfg.StdErr) + doUpgrade, err := launcher.Run(args, runCfg.StdIn, runCfg.StdOut, runCfg.StdErr) // if RestartAfterUpgrade, we launch after a successful upgrade (given that condition launcher.Run returns nil) for cfg.RestartAfterUpgrade && err == nil && doUpgrade { logger.Info("upgrade detected, relaunching", "app", cfg.Name) - doUpgrade, err = launcher.Run(args, runCfg.StdOut, runCfg.StdErr) + doUpgrade, err = launcher.Run(args, runCfg.StdIn, runCfg.StdOut, runCfg.StdErr) } if doUpgrade && err == nil { @@ -53,3 +65,24 @@ func Run(cmd *cobra.Command, args []string, options ...RunOption) error { return err } + +func parseCosmovisorConfig(args []string) (string, []string, error) { + var configFilePath string + for i, arg := range args { + // Check if the argument is the config flag + if strings.EqualFold(arg, fmt.Sprintf("--%s", cosmovisor.FlagCosmovisorConfig)) || + strings.EqualFold(arg, fmt.Sprintf("-%s", cosmovisor.FlagCosmovisorConfig)) { + // Check if there is an argument after the flag which should be the config file path + if i+1 >= len(args) { + return "", nil, fmt.Errorf("--%s requires an argument", cosmovisor.FlagCosmovisorConfig) + } + + configFilePath = args[i+1] + // Remove the flag and its value from the arguments + args = append(args[:i], args[i+2:]...) + break + } + } + + return configFilePath, args, nil +} diff --git a/tools/cosmovisor/cmd/cosmovisor/run_config.go b/tools/cosmovisor/cmd/cosmovisor/run_config.go index 5a77e30b4186..f025b06eb619 100644 --- a/tools/cosmovisor/cmd/cosmovisor/run_config.go +++ b/tools/cosmovisor/cmd/cosmovisor/run_config.go @@ -7,18 +7,27 @@ import ( // DefaultRunConfig defintes a default RunConfig that writes to os.Stdout and os.Stderr var DefaultRunConfig = RunConfig{ + StdIn: os.Stdin, StdOut: os.Stdout, StdErr: os.Stderr, } // RunConfig defines the configuration for running a command type RunConfig struct { + StdIn io.Reader StdOut io.Writer StdErr io.Writer } type RunOption func(*RunConfig) +// StdInRunOption sets the StdIn reader for the Run command +func StdInRunOption(r io.Reader) RunOption { + return func(cfg *RunConfig) { + cfg.StdIn = r + } +} + // StdOutRunOption sets the StdOut writer for the Run command func StdOutRunOption(w io.Writer) RunOption { return func(cfg *RunConfig) { @@ -26,7 +35,7 @@ func StdOutRunOption(w io.Writer) RunOption { } } -// SdErrRunOption sets the StdErr writer for the Run command +// StdErrRunOption sets the StdErr writer for the Run command func StdErrRunOption(w io.Writer) RunOption { return func(cfg *RunConfig) { cfg.StdErr = w diff --git a/tools/cosmovisor/cmd/cosmovisor/show_upgrade.go b/tools/cosmovisor/cmd/cosmovisor/show_upgrade.go new file mode 100644 index 000000000000..aa37fa36d4e7 --- /dev/null +++ b/tools/cosmovisor/cmd/cosmovisor/show_upgrade.go @@ -0,0 +1,42 @@ +package main + +import ( + "fmt" + "os" + + "github.com/spf13/cobra" + + "cosmossdk.io/tools/cosmovisor" +) + +func NewShowUpgradeInfoCmd() *cobra.Command { + return &cobra.Command{ + Use: "show-upgrade-info", + Short: "Display current upgrade-info.json from data directory", + SilenceUsage: false, + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) error { + configPath, err := cmd.Flags().GetString(cosmovisor.FlagCosmovisorConfig) + if err != nil { + return fmt.Errorf("failed to get config flag: %w", err) + } + + cfg, err := cosmovisor.GetConfigFromFile(configPath) + if err != nil { + return err + } + + data, err := os.ReadFile(cfg.UpgradeInfoFilePath()) + if err != nil { + if os.IsNotExist(err) { + cmd.Printf("No upgrade info found at %s\n", cfg.UpgradeInfoFilePath()) + return nil + } + return fmt.Errorf("failed to read upgrade-info.json: %w", err) + } + + cmd.Println(string(data)) + return nil + }, + } +} diff --git a/tools/cosmovisor/cmd/cosmovisor/version.go b/tools/cosmovisor/cmd/cosmovisor/version.go index a1c8e1bcb3c9..a51b376355af 100644 --- a/tools/cosmovisor/cmd/cosmovisor/version.go +++ b/tools/cosmovisor/cmd/cosmovisor/version.go @@ -6,16 +6,18 @@ import ( "runtime/debug" "strings" - "cosmossdk.io/tools/cosmovisor" "github.com/spf13/cobra" + + "cosmossdk.io/tools/cosmovisor" ) func NewVersionCmd() *cobra.Command { versionCmd := &cobra.Command{ - Use: "version", - Short: "Display cosmovisor and APP version.", + Use: "version", + Short: "Display cosmovisor and APP version.", + SilenceUsage: true, RunE: func(cmd *cobra.Command, args []string) error { - noAppVersion, _ := cmd.Flags().GetBool(cosmovisor.FlagNoAppVersion) + noAppVersion, _ := cmd.Flags().GetBool(cosmovisor.FlagCosmovisorOnly) if val, err := cmd.Flags().GetString(cosmovisor.FlagOutput); val == "json" && err == nil { return printVersionJSON(cmd, args, noAppVersion) } @@ -25,7 +27,7 @@ func NewVersionCmd() *cobra.Command { } versionCmd.Flags().StringP(cosmovisor.FlagOutput, "o", "text", "Output format (text|json)") - versionCmd.Flags().Bool(cosmovisor.FlagNoAppVersion, false, "Don't print APP version") + versionCmd.Flags().Bool(cosmovisor.FlagCosmovisorOnly, false, "Print cosmovisor version only") return versionCmd } @@ -45,7 +47,7 @@ func printVersion(cmd *cobra.Command, args []string, noAppVersion bool) error { return nil } - if err := Run(cmd, append([]string{"version"}, args...)); err != nil { + if err := run("", append([]string{"version"}, args...)); err != nil { return fmt.Errorf("failed to run version command: %w", err) } @@ -59,8 +61,8 @@ func printVersionJSON(cmd *cobra.Command, args []string, noAppVersion bool) erro } buf := new(strings.Builder) - if err := Run( - cmd, + if err := run( + "", []string{"version", "--long", "--output", "json"}, StdOutRunOption(buf), ); err != nil { diff --git a/tools/cosmovisor/cmd/cosmovisor/version_test.go b/tools/cosmovisor/cmd/cosmovisor/version_test.go index 0a7d9e586846..8f51ea47dafb 100644 --- a/tools/cosmovisor/cmd/cosmovisor/version_test.go +++ b/tools/cosmovisor/cmd/cosmovisor/version_test.go @@ -5,8 +5,9 @@ import ( "context" "testing" - "cosmossdk.io/log" "github.com/stretchr/testify/require" + + "cosmossdk.io/log" ) func TestVersionCommand_Error(t *testing.T) { diff --git a/tools/cosmovisor/errors/multi.go b/tools/cosmovisor/errors/multi.go deleted file mode 100644 index efa3d5a9c269..000000000000 --- a/tools/cosmovisor/errors/multi.go +++ /dev/null @@ -1,85 +0,0 @@ -package errors - -import ( - "fmt" - "strings" - - "cosmossdk.io/log" -) - -// MultiError is an error combining multiple other errors. -// It will never have 0 or 1 errors. It will always have two or more. -type MultiError struct { - errs []error -} - -// FlattenErrors possibly creates a MultiError. -// Nil entries are ignored. -// If all provided errors are nil (or nothing is provided), nil is returned. -// If only one non-nil error is provided, it is returned unchanged. -// If two or more non-nil errors are provided, the returned error will be of type *MultiError -// and it will contain each non-nil error. -func FlattenErrors(errs ...error) error { - rv := MultiError{} - for _, err := range errs { - if err != nil { - if merr, isMerr := err.(*MultiError); isMerr { - rv.errs = append(rv.errs, merr.errs...) - } else { - rv.errs = append(rv.errs, err) - } - } - } - switch rv.Len() { - case 0: - return nil - case 1: - return rv.errs[0] - } - return &rv -} - -// GetErrors gets all the errors that make up this MultiError. -func (e MultiError) GetErrors() []error { - // Return a copy of the errs slice to prevent alteration of the original slice. - rv := make([]error, e.Len()) - copy(rv, e.errs) - return rv -} - -// Len gets the number of errors in this MultiError. -func (e MultiError) Len() int { - return len(e.errs) -} - -// Error implements the error interface for a MultiError. -func (e *MultiError) Error() string { - var sb strings.Builder - fmt.Fprintf(&sb, "%d errors: ", len(e.errs)) - for i, err := range e.errs { - if i != 0 { - sb.WriteString(", ") - } - fmt.Fprintf(&sb, "%d: %v", i+1, err) - } - return sb.String() -} - -// String implements the string interface for a MultiError. -func (e MultiError) String() string { - return e.Error() -} - -func LogErrors(logger log.Logger, msg string, err error) { - switch err := err.(type) { - case *MultiError: - if msg != "" { - logger.Error(msg) - } - for i, e := range err.GetErrors() { - logger.Error(fmt.Sprintf(" %d:", i+1), "error", e) - } - default: - logger.Error(msg, "error", err) - } -} diff --git a/tools/cosmovisor/errors/multi_test.go b/tools/cosmovisor/errors/multi_test.go deleted file mode 100644 index 83454b2cfb4f..000000000000 --- a/tools/cosmovisor/errors/multi_test.go +++ /dev/null @@ -1,190 +0,0 @@ -package errors - -import ( - "errors" - "fmt" - "testing" - - "github.com/stretchr/testify/require" - "github.com/stretchr/testify/suite" -) - -type MultiErrorTestSuite struct { - suite.Suite - - err1 error - err2 error - err3 error - err4 error -} - -func TestMultiErrorTestSuite(t *testing.T) { - suite.Run(t, new(MultiErrorTestSuite)) -} - -func (s *MultiErrorTestSuite) SetupTest() { - s.err1 = errors.New("expected error one") - s.err2 = errors.New("expected error two") - s.err3 = errors.New("expected error three") - s.err3 = errors.New("expected error four") -} - -func (s *MultiErrorTestSuite) TestFlattenErrors() { - tests := []struct { - name string - input []error - expected error - }{ - { - name: "none in nil out", - input: []error{}, - expected: nil, - }, - { - name: "nil in nil out", - input: []error{nil}, - expected: nil, - }, - { - name: "nils in nil out", - input: []error{nil, nil, nil}, - expected: nil, - }, - { - name: "one in same out", - input: []error{s.err1}, - expected: s.err1, - }, - { - name: "nils and one in that one out", - input: []error{nil, s.err2, nil}, - expected: s.err2, - }, - { - name: "two in multi out with both", - input: []error{s.err1, s.err2}, - expected: &MultiError{errs: []error{s.err1, s.err2}}, - }, - { - name: "two and nils in multi out with both", - input: []error{nil, s.err1, nil, s.err2, nil}, - expected: &MultiError{errs: []error{s.err1, s.err2}}, - }, - { - name: "lots in multi out", - input: []error{s.err1, s.err2, s.err3, s.err2, s.err1}, - expected: &MultiError{errs: []error{s.err1, s.err2, s.err3, s.err2, s.err1}}, - }, - { - name: "multi and non in one multi out with all", - input: []error{&MultiError{errs: []error{s.err1, s.err2}}, s.err3}, - expected: &MultiError{errs: []error{s.err1, s.err2, s.err3}}, - }, - { - name: "non and multi in one multi out with all", - input: []error{s.err1, &MultiError{errs: []error{s.err2, s.err3}}}, - expected: &MultiError{errs: []error{s.err1, s.err2, s.err3}}, - }, - { - name: "two multi in one multi out with all", - input: []error{&MultiError{errs: []error{s.err1, s.err2}}, &MultiError{errs: []error{s.err3, s.err4}}}, - expected: &MultiError{errs: []error{s.err1, s.err2, s.err3, s.err4}}, - }, - } - - for _, tc := range tests { - s.T().Run(tc.name, func(t *testing.T) { - actual := FlattenErrors(tc.input...) - require.Equal(t, tc.expected, actual) - }) - } -} - -func (s *MultiErrorTestSuite) TestGetErrors() { - tests := []struct { - name string - multi MultiError - expected []error - }{ - { - name: "two", - multi: MultiError{errs: []error{s.err3, s.err1}}, - expected: []error{s.err3, s.err1}, - }, - { - name: "three", - multi: MultiError{errs: []error{s.err3, s.err1, s.err2}}, - expected: []error{s.err3, s.err1, s.err2}, - }, - } - - for _, tc := range tests { - s.T().Run(tc.name, func(t *testing.T) { - // Make sure it's getting what's expected. - actual1 := tc.multi.GetErrors() - require.NotSame(t, tc.expected, actual1) - require.Equal(t, tc.expected, actual1) - // Make sure that changing what was given back doesn't alter the original. - actual1[0] = errors.New("unexpected error") - actual2 := tc.multi.GetErrors() - require.NotEqual(t, actual1, actual2) - require.Equal(t, tc.expected, actual2) - }) - } -} - -func (s *MultiErrorTestSuite) TestLen() { - tests := []struct { - name string - multi MultiError - expected int - }{ - { - name: "two", - multi: MultiError{errs: []error{s.err3, s.err1}}, - expected: 2, - }, - { - name: "three", - multi: MultiError{errs: []error{s.err3, s.err1, s.err2}}, - expected: 3, - }, - } - - for _, tc := range tests { - s.T().Run(tc.name, func(t *testing.T) { - actual := tc.multi.Len() - require.Equal(t, tc.expected, actual) - }) - } -} - -func (s *MultiErrorTestSuite) TestErrorAndString() { - tests := []struct { - name string - multi MultiError - expected string - }{ - { - name: "two", - multi: MultiError{errs: []error{s.err1, s.err2}}, - expected: fmt.Sprintf("2 errors: 1: %s, 2: %s", s.err1, s.err2), - }, - { - name: "three", - multi: MultiError{errs: []error{s.err1, s.err2, s.err3}}, - expected: fmt.Sprintf("3 errors: 1: %s, 2: %s, 3: %s", s.err1, s.err2, s.err3), - }, - } - - for _, tc := range tests { - s.T().Run(tc.name+" Error", func(t *testing.T) { - actual := tc.multi.Error() - require.Equal(t, tc.expected, actual) - }) - s.T().Run(tc.name+" String", func(t *testing.T) { - actual := tc.multi.String() - require.Equal(t, tc.expected, actual) - }) - } -} diff --git a/tools/cosmovisor/flags.go b/tools/cosmovisor/flags.go index 76a48d20dad2..7c0db36bee66 100644 --- a/tools/cosmovisor/flags.go +++ b/tools/cosmovisor/flags.go @@ -3,6 +3,8 @@ package cosmovisor const ( FlagOutput = "output" FlagSkipUpgradeHeight = "unsafe-skip-upgrades" - FlagNoAppVersion = "no-app-version" + FlagCosmovisorOnly = "cosmovisor-only" FlagForce = "force" + FlagUpgradeHeight = "upgrade-height" + FlagCosmovisorConfig = "cosmovisor-config" ) diff --git a/tools/cosmovisor/go.mod b/tools/cosmovisor/go.mod index 3decf8853b88..b8c2c5a4d2e8 100644 --- a/tools/cosmovisor/go.mod +++ b/tools/cosmovisor/go.mod @@ -1,174 +1,202 @@ module cosmossdk.io/tools/cosmovisor -go 1.20 +go 1.23.0 require ( - cosmossdk.io/log v1.1.0 - cosmossdk.io/x/upgrade v0.0.0-20230607190716-2877190997a2 - github.com/otiai10/copy v1.11.0 - github.com/rs/zerolog v1.29.1 - github.com/spf13/cobra v1.7.0 - github.com/stretchr/testify v1.8.4 + cosmossdk.io/log v1.5.0 + cosmossdk.io/x/upgrade v0.1.4 + github.com/cosmos/cosmos-sdk v0.50.13 + github.com/fsnotify/fsnotify v1.8.0 + github.com/otiai10/copy v1.14.1 + github.com/pelletier/go-toml/v2 v2.2.3 + github.com/spf13/cobra v1.9.1 + github.com/spf13/viper v1.20.0 + github.com/stretchr/testify v1.10.0 + google.golang.org/grpc v1.71.0 ) require ( - cloud.google.com/go v0.110.0 // indirect - cloud.google.com/go/compute v1.19.0 // indirect - cloud.google.com/go/compute/metadata v0.2.3 // indirect - cloud.google.com/go/iam v0.13.0 // indirect - cloud.google.com/go/storage v1.30.0 // indirect - cosmossdk.io/api v0.4.2 // indirect - cosmossdk.io/collections v0.2.0 // indirect - cosmossdk.io/core v0.8.0 // indirect - cosmossdk.io/depinject v1.0.0-alpha.3 // indirect - cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 // indirect - cosmossdk.io/math v1.0.1 // indirect - cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c // indirect - cosmossdk.io/x/tx v0.8.0 // indirect - filippo.io/edwards25519 v1.0.0 // indirect + cel.dev/expr v0.19.1 // indirect + cloud.google.com/go v0.118.0 // indirect + cloud.google.com/go/auth v0.14.0 // indirect + cloud.google.com/go/auth/oauth2adapt v0.2.7 // indirect + cloud.google.com/go/compute/metadata v0.6.0 // indirect + cloud.google.com/go/iam v1.3.1 // indirect + cloud.google.com/go/monitoring v1.22.1 // indirect + cloud.google.com/go/storage v1.50.0 // indirect + cosmossdk.io/api v0.7.6 // indirect + cosmossdk.io/collections v0.4.0 // indirect + cosmossdk.io/core v0.11.1 // indirect + cosmossdk.io/depinject v1.1.0 // indirect + cosmossdk.io/errors v1.0.1 // indirect + cosmossdk.io/math v1.5.0 // indirect + cosmossdk.io/store v1.1.1 // indirect + cosmossdk.io/x/tx v1.0.0-alpha.3 // indirect + filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect - github.com/99designs/keyring v1.2.1 // indirect - github.com/DataDog/zstd v1.5.5 // indirect - github.com/armon/go-metrics v0.4.1 // indirect - github.com/aws/aws-sdk-go v1.44.224 // indirect + github.com/99designs/keyring v1.2.2 // indirect + github.com/DataDog/datadog-go v4.8.3+incompatible // indirect + github.com/DataDog/zstd v1.5.6 // indirect + github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0 // indirect + github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.49.0 // indirect + github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.49.0 // indirect + github.com/Microsoft/go-winio v0.6.2 // indirect + github.com/aws/aws-sdk-go v1.55.5 // 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 - github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect - github.com/cenkalti/backoff/v4 v4.1.3 // indirect - github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/cockroachdb/errors v1.9.1 // indirect - github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20230606152911-c4be581b807f // indirect - github.com/cockroachdb/redact v1.1.4 // indirect - github.com/cometbft/cometbft v0.38.0-rc1 // indirect - github.com/cometbft/cometbft-db v0.7.0 // indirect + github.com/bgentry/speakeasy v0.2.0 // indirect + github.com/bytedance/sonic v1.12.8 // indirect + github.com/bytedance/sonic/loader v0.2.3 // indirect + github.com/cenkalti/backoff/v4 v4.3.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/cloudwego/base64x v0.1.5 // indirect + github.com/cncf/xds/go v0.0.0-20241223141626-cff3c89139a3 // indirect + github.com/cockroachdb/apd/v3 v3.2.1 // indirect + github.com/cockroachdb/errors v1.11.3 // indirect + github.com/cockroachdb/fifo v0.0.0-20240816210425-c5d0cb0b6fc0 // indirect + github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506 // indirect + github.com/cockroachdb/pebble v1.1.2 // indirect + github.com/cockroachdb/redact v1.1.5 // indirect + github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect + github.com/cometbft/cometbft v0.38.17 // indirect + github.com/cometbft/cometbft-db v0.14.1 // indirect github.com/cosmos/btcutil v1.0.5 // indirect - github.com/cosmos/cosmos-db v1.0.0 // indirect - github.com/cosmos/cosmos-proto v1.0.0-beta.3 // indirect - github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230607182757-cfeb10287d61 // indirect + github.com/cosmos/cosmos-db v1.1.1 // indirect + github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/gogoproto v1.4.10 // indirect - github.com/cosmos/iavl v1.0.0-beta.2 // indirect - github.com/cosmos/ics23/go v0.10.0 // indirect - github.com/cosmos/ledger-cosmos-go v0.13.0 // indirect - github.com/danieljoos/wincred v1.1.2 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/cosmos/gogoproto v1.7.0 // indirect + github.com/cosmos/iavl v1.2.2 // indirect + github.com/cosmos/ics23/go v0.11.0 // indirect + github.com/cosmos/ledger-cosmos-go v0.14.0 // indirect + github.com/danieljoos/wincred v1.2.1 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect - github.com/dgraph-io/badger/v2 v2.2007.4 // indirect + github.com/dgraph-io/badger/v4 v4.2.0 // indirect 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/dvsekhvalnov/jose2go v1.5.0 // indirect - github.com/emicklei/dot v1.4.2 // indirect - github.com/fatih/color v1.15.0 // indirect - github.com/felixge/httpsnoop v1.0.2 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/getsentry/sentry-go v0.21.0 // indirect - github.com/go-kit/kit v0.12.0 // indirect + github.com/dvsekhvalnov/jose2go v1.7.0 // indirect + github.com/emicklei/dot v1.6.2 // indirect + github.com/envoyproxy/go-control-plane/envoy v1.32.4 // indirect + github.com/envoyproxy/protoc-gen-validate v1.2.1 // indirect + github.com/fatih/color v1.18.0 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/getsentry/sentry-go v0.30.0 // indirect + github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect + github.com/go-logr/logr v1.4.2 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/googleapis v1.4.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/glog v1.1.0 // indirect - github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/glog v1.2.4 // indirect + github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.4 // indirect - github.com/google/btree v1.1.2 // indirect - github.com/google/go-cmp v0.5.9 // indirect - github.com/google/s2a-go v0.1.3 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect - github.com/googleapis/gax-go/v2 v2.8.0 // indirect - github.com/gorilla/handlers v1.5.1 // indirect - github.com/gorilla/mux v1.8.0 // indirect - github.com/gorilla/websocket v1.5.0 // indirect + github.com/google/btree v1.1.3 // indirect + github.com/google/flatbuffers v24.3.25+incompatible // indirect + github.com/google/go-cmp v0.6.0 // indirect + github.com/google/s2a-go v0.1.9 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect + github.com/googleapis/gax-go/v2 v2.14.1 // 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/grpc-ecosystem/grpc-gateway v1.16.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-getter v1.7.1 // indirect - github.com/hashicorp/go-hclog v1.5.0 // indirect + github.com/hashicorp/go-getter v1.7.7 // indirect + github.com/hashicorp/go-hclog v1.6.3 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/go-plugin v1.4.10 // indirect + github.com/hashicorp/go-metrics v0.5.4 // indirect + github.com/hashicorp/go-plugin v1.6.2 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect - github.com/hashicorp/go-version v1.6.0 // indirect - github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect - 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/huandu/skiplist v1.2.0 // indirect - github.com/iancoleman/strcase v0.2.0 // indirect + github.com/hashicorp/go-version v1.7.0 // indirect + github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/hashicorp/yamux v0.1.2 // indirect + github.com/hdevalence/ed25519consensus v0.2.0 // indirect + github.com/huandu/skiplist v1.2.1 // 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/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.16.5 // indirect + github.com/klauspost/compress v1.17.11 // indirect + github.com/klauspost/cpuid/v2 v2.2.9 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect - github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.0 // indirect - github.com/magiconair/properties v1.8.7 // indirect + github.com/linxGnu/grocksdb v1.9.7 // indirect + github.com/magiconair/properties v1.8.9 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.19 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect - github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect - github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.0.8 // indirect - github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761 // indirect + github.com/otiai10/mint v1.6.3 // indirect + github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.15.1 // indirect - github.com/prometheus/client_model v0.4.0 // indirect - github.com/prometheus/common v0.44.0 // indirect - github.com/prometheus/procfs v0.10.1 // indirect + github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/prometheus/client_golang v1.20.5 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.62.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.10.0 // indirect - github.com/rs/cors v1.8.3 // indirect - github.com/sasha-s/go-deadlock v0.3.1 // indirect - github.com/spf13/afero v1.9.5 // indirect - github.com/spf13/cast v1.5.1 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/spf13/pflag v1.0.5 // indirect - github.com/spf13/viper v1.16.0 // indirect - github.com/subosito/gotenv v1.4.2 // indirect + github.com/rogpeppe/go-internal v1.13.1 // indirect + github.com/rs/cors v1.11.1 // indirect + github.com/rs/zerolog v1.33.0 // indirect + github.com/sagikazarmark/locafero v0.7.0 // indirect + github.com/sasha-s/go-deadlock v0.3.5 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.12.0 // indirect + github.com/spf13/cast v1.7.1 // indirect + github.com/spf13/pflag v1.0.6 // indirect + github.com/subosito/gotenv v1.6.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect - github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect github.com/tendermint/go-amino v0.16.0 // indirect - github.com/tidwall/btree v1.6.0 // indirect - github.com/ulikunitz/xz v0.5.11 // indirect - github.com/zondax/hid v0.9.1 // indirect - github.com/zondax/ledger-go v0.14.1 // indirect - go.etcd.io/bbolt v1.3.6 // indirect + github.com/tidwall/btree v1.7.0 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + github.com/ulikunitz/xz v0.5.12 // indirect + github.com/zondax/hid v0.9.2 // indirect + github.com/zondax/ledger-go v0.14.3 // indirect + go.etcd.io/bbolt v1.4.0-alpha.1 // indirect go.opencensus.io v0.24.0 // indirect - golang.org/x/crypto v0.9.0 // indirect - golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/oauth2 v0.8.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/term v0.8.0 // indirect - golang.org/x/text v0.9.0 // indirect - golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect - google.golang.org/api v0.122.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20230525234025-438c736192d0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect - google.golang.org/grpc v1.55.0 // indirect - google.golang.org/protobuf v1.30.0 // indirect - gopkg.in/ini.v1 v1.67.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect + go.opentelemetry.io/auto/sdk v1.1.0 // indirect + go.opentelemetry.io/contrib/detectors/gcp v1.34.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.58.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 // indirect + go.opentelemetry.io/otel v1.34.0 // indirect + go.opentelemetry.io/otel/metric v1.34.0 // indirect + go.opentelemetry.io/otel/sdk v1.34.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.34.0 // indirect + go.opentelemetry.io/otel/trace v1.34.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + golang.org/x/arch v0.13.0 // indirect + golang.org/x/crypto v0.35.0 // indirect + golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8 // indirect + golang.org/x/net v0.34.0 // indirect + golang.org/x/oauth2 v0.25.0 // indirect + golang.org/x/sync v0.11.0 // indirect + golang.org/x/sys v0.30.0 // indirect + golang.org/x/term v0.29.0 // indirect + golang.org/x/text v0.22.0 // indirect + golang.org/x/time v0.9.0 // indirect + google.golang.org/api v0.216.0 // indirect + google.golang.org/genproto v0.0.0-20250106144421-5f5ef82da422 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20250106144421-5f5ef82da422 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250122153221-138b5a5a4fd4 // indirect + google.golang.org/protobuf v1.36.4 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - gotest.tools/v3 v3.4.0 // indirect - nhooyr.io/websocket v1.8.6 // indirect - pgregory.net/rapid v0.6.2 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect + gotest.tools/v3 v3.5.1 // indirect + nhooyr.io/websocket v1.8.11 // indirect + pgregory.net/rapid v1.1.0 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect ) diff --git a/tools/cosmovisor/go.sum b/tools/cosmovisor/go.sum index 8501adc4b5a9..62d679908933 100644 --- a/tools/cosmovisor/go.sum +++ b/tools/cosmovisor/go.sum @@ -1,3 +1,5 @@ +cel.dev/expr v0.19.1 h1:NciYrtDRIR0lNCnH1LFJegdjspNx9fI59O7TWcua/W4= +cel.dev/expr v0.19.1/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= @@ -28,28 +30,96 @@ cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+Y cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= +cloud.google.com/go v0.100.1/go.mod h1:fs4QogzfH5n2pBXBP9vRiU+eCny7lD2vmFZy79Iuw1U= cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= -cloud.google.com/go v0.110.0 h1:Zc8gqp3+a9/Eyph2KDmcGaPtbKRIoqq4YTlL4NMD0Ys= +cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM= +cloud.google.com/go v0.107.0/go.mod h1:wpc2eNrD7hXUTy8EKS10jkxpZBjASrORK7goS+3YX2I= cloud.google.com/go v0.110.0/go.mod h1:SJnCLqQ0FCFGSZMUNUf84MV3Aia54kn7pi8st7tMzaY= +cloud.google.com/go v0.118.0 h1:tvZe1mgqRxpiVa3XlIGMiPcEUbP1gNXELgD4y/IXmeQ= +cloud.google.com/go v0.118.0/go.mod h1:zIt2pkedt/mo+DQjcT4/L3NDxzHPR29j5HcclNH+9PM= +cloud.google.com/go/accessapproval v1.4.0/go.mod h1:zybIuC3KpDOvotz59lFe5qxRZx6C75OtwbisN56xYB4= +cloud.google.com/go/accessapproval v1.5.0/go.mod h1:HFy3tuiGvMdcd/u+Cu5b9NkO1pEICJ46IR82PoUdplw= +cloud.google.com/go/accessapproval v1.6.0/go.mod h1:R0EiYnwV5fsRFiKZkPHr6mwyk2wxUJ30nL4j2pcFY2E= +cloud.google.com/go/accesscontextmanager v1.3.0/go.mod h1:TgCBehyr5gNMz7ZaH9xubp+CE8dkrszb4oK9CWyvD4o= +cloud.google.com/go/accesscontextmanager v1.4.0/go.mod h1:/Kjh7BBu/Gh83sv+K60vN9QE5NJcd80sU33vIe2IFPE= +cloud.google.com/go/accesscontextmanager v1.6.0/go.mod h1:8XCvZWfYw3K/ji0iVnp+6pu7huxoQTLmxAbVjbloTtM= +cloud.google.com/go/accesscontextmanager v1.7.0/go.mod h1:CEGLewx8dwa33aDAZQujl7Dx+uYhS0eay198wB/VumQ= cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= +cloud.google.com/go/aiplatform v1.27.0/go.mod h1:Bvxqtl40l0WImSb04d0hXFU7gDOiq9jQmorivIiWcKg= +cloud.google.com/go/aiplatform v1.35.0/go.mod h1:7MFT/vCaOyZT/4IIFfxH4ErVg/4ku6lKv3w0+tFTgXQ= +cloud.google.com/go/aiplatform v1.36.1/go.mod h1:WTm12vJRPARNvJ+v6P52RDHCNe4AhvjcIZ/9/RRHy/k= +cloud.google.com/go/aiplatform v1.37.0/go.mod h1:IU2Cv29Lv9oCn/9LkFiiuKfwrRTq+QQMbW+hPCxJGZw= cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= cloud.google.com/go/analytics v0.12.0/go.mod h1:gkfj9h6XRf9+TS4bmuhPEShsh3hH8PAZzm/41OOhQd4= +cloud.google.com/go/analytics v0.17.0/go.mod h1:WXFa3WSym4IZ+JiKmavYdJwGG/CvpqiqczmL59bTD9M= +cloud.google.com/go/analytics v0.18.0/go.mod h1:ZkeHGQlcIPkw0R/GW+boWHhCOR43xz9RN/jn7WcqfIE= +cloud.google.com/go/analytics v0.19.0/go.mod h1:k8liqf5/HCnOUkbawNtrWWc+UAzyDlW89doe8TtoDsE= +cloud.google.com/go/apigateway v1.3.0/go.mod h1:89Z8Bhpmxu6AmUxuVRg/ECRGReEdiP3vQtk4Z1J9rJk= +cloud.google.com/go/apigateway v1.4.0/go.mod h1:pHVY9MKGaH9PQ3pJ4YLzoj6U5FUDeDFBllIz7WmzJoc= +cloud.google.com/go/apigateway v1.5.0/go.mod h1:GpnZR3Q4rR7LVu5951qfXPJCHquZt02jf7xQx7kpqN8= +cloud.google.com/go/apigeeconnect v1.3.0/go.mod h1:G/AwXFAKo0gIXkPTVfZDd2qA1TxBXJ3MgMRBQkIi9jc= +cloud.google.com/go/apigeeconnect v1.4.0/go.mod h1:kV4NwOKqjvt2JYR0AoIWo2QGfoRtn/pkS3QlHp0Ni04= +cloud.google.com/go/apigeeconnect v1.5.0/go.mod h1:KFaCqvBRU6idyhSNyn3vlHXc8VMDJdRmwDF6JyFRqZ8= +cloud.google.com/go/apigeeregistry v0.4.0/go.mod h1:EUG4PGcsZvxOXAdyEghIdXwAEi/4MEaoqLMLDMIwKXY= +cloud.google.com/go/apigeeregistry v0.5.0/go.mod h1:YR5+s0BVNZfVOUkMa5pAR2xGd0A473vA5M7j247o1wM= +cloud.google.com/go/apigeeregistry v0.6.0/go.mod h1:BFNzW7yQVLZ3yj0TKcwzb8n25CFBri51GVGOEUcgQsc= +cloud.google.com/go/apikeys v0.4.0/go.mod h1:XATS/yqZbaBK0HOssf+ALHp8jAlNHUgyfprvNcBIszU= +cloud.google.com/go/apikeys v0.5.0/go.mod h1:5aQfwY4D+ewMMWScd3hm2en3hCj+BROlyrt3ytS7KLI= +cloud.google.com/go/apikeys v0.6.0/go.mod h1:kbpXu5upyiAlGkKrJgQl8A0rKNNJ7dQ377pdroRSSi8= +cloud.google.com/go/appengine v1.4.0/go.mod h1:CS2NhuBuDXM9f+qscZ6V86m1MIIqPj3WC/UoEuR1Sno= +cloud.google.com/go/appengine v1.5.0/go.mod h1:TfasSozdkFI0zeoxW3PTBLiNqRmzraodCWatWI9Dmak= +cloud.google.com/go/appengine v1.6.0/go.mod h1:hg6i0J/BD2cKmDJbaFSYHFyZkgBEfQrDg/X0V5fJn84= +cloud.google.com/go/appengine v1.7.0/go.mod h1:eZqpbHFCqRGa2aCdope7eC0SWLV1j0neb/QnMJVWx6A= +cloud.google.com/go/appengine v1.7.1/go.mod h1:IHLToyb/3fKutRysUlFO0BPt5j7RiQ45nrzEJmKTo6E= cloud.google.com/go/area120 v0.5.0/go.mod h1:DE/n4mp+iqVyvxHN41Vf1CR602GiHQjFPusMFW6bGR4= cloud.google.com/go/area120 v0.6.0/go.mod h1:39yFJqWVgm0UZqWTOdqkLhjoC7uFfgXRC8g/ZegeAh0= +cloud.google.com/go/area120 v0.7.0/go.mod h1:a3+8EUD1SX5RUcCs3MY5YasiO1z6yLiNLRiFrykbynY= +cloud.google.com/go/area120 v0.7.1/go.mod h1:j84i4E1RboTWjKtZVWXPqvK5VHQFJRF2c1Nm69pWm9k= cloud.google.com/go/artifactregistry v1.6.0/go.mod h1:IYt0oBPSAGYj/kprzsBjZ/4LnG/zOcHyFHjWPCi6SAQ= cloud.google.com/go/artifactregistry v1.7.0/go.mod h1:mqTOFOnGZx8EtSqK/ZWcsm/4U8B77rbcLP6ruDU2Ixk= +cloud.google.com/go/artifactregistry v1.8.0/go.mod h1:w3GQXkJX8hiKN0v+at4b0qotwijQbYUqF2GWkZzAhC0= +cloud.google.com/go/artifactregistry v1.9.0/go.mod h1:2K2RqvA2CYvAeARHRkLDhMDJ3OXy26h3XW+3/Jh2uYc= +cloud.google.com/go/artifactregistry v1.11.1/go.mod h1:lLYghw+Itq9SONbCa1YWBoWs1nOucMH0pwXN1rOBZFI= +cloud.google.com/go/artifactregistry v1.11.2/go.mod h1:nLZns771ZGAwVLzTX/7Al6R9ehma4WUEhZGWV6CeQNQ= +cloud.google.com/go/artifactregistry v1.12.0/go.mod h1:o6P3MIvtzTOnmvGagO9v/rOjjA0HmhJ+/6KAXrmYDCI= +cloud.google.com/go/artifactregistry v1.13.0/go.mod h1:uy/LNfoOIivepGhooAUpL1i30Hgee3Cu0l4VTWHUC08= cloud.google.com/go/asset v1.5.0/go.mod h1:5mfs8UvcM5wHhqtSv8J1CtxxaQq3AdBxxQi2jGW/K4o= cloud.google.com/go/asset v1.7.0/go.mod h1:YbENsRK4+xTiL+Ofoj5Ckf+O17kJtgp3Y3nn4uzZz5s= cloud.google.com/go/asset v1.8.0/go.mod h1:mUNGKhiqIdbr8X7KNayoYvyc4HbbFO9URsjbytpUaW0= +cloud.google.com/go/asset v1.9.0/go.mod h1:83MOE6jEJBMqFKadM9NLRcs80Gdw76qGuHn8m3h8oHQ= +cloud.google.com/go/asset v1.10.0/go.mod h1:pLz7uokL80qKhzKr4xXGvBQXnzHn5evJAEAtZiIb0wY= +cloud.google.com/go/asset v1.11.1/go.mod h1:fSwLhbRvC9p9CXQHJ3BgFeQNM4c9x10lqlrdEUYXlJo= +cloud.google.com/go/asset v1.12.0/go.mod h1:h9/sFOa4eDIyKmH6QMpm4eUK3pDojWnUhTgJlk762Hg= +cloud.google.com/go/asset v1.13.0/go.mod h1:WQAMyYek/b7NBpYq/K4KJWcRqzoalEsxz/t/dTk4THw= cloud.google.com/go/assuredworkloads v1.5.0/go.mod h1:n8HOZ6pff6re5KYfBXcFvSViQjDwxFkAkmUFffJRbbY= cloud.google.com/go/assuredworkloads v1.6.0/go.mod h1:yo2YOk37Yc89Rsd5QMVECvjaMKymF9OP+QXWlKXUkXw= cloud.google.com/go/assuredworkloads v1.7.0/go.mod h1:z/736/oNmtGAyU47reJgGN+KVoYoxeLBoj4XkKYscNI= +cloud.google.com/go/assuredworkloads v1.8.0/go.mod h1:AsX2cqyNCOvEQC8RMPnoc0yEarXQk6WEKkxYfL6kGIo= +cloud.google.com/go/assuredworkloads v1.9.0/go.mod h1:kFuI1P78bplYtT77Tb1hi0FMxM0vVpRC7VVoJC3ZoT0= +cloud.google.com/go/assuredworkloads v1.10.0/go.mod h1:kwdUQuXcedVdsIaKgKTp9t0UJkE5+PAVNhdQm4ZVq2E= +cloud.google.com/go/auth v0.14.0 h1:A5C4dKV/Spdvxcl0ggWwWEzzP7AZMJSEIgrkngwhGYM= +cloud.google.com/go/auth v0.14.0/go.mod h1:CYsoRL1PdiDuqeQpZE0bP2pnPrGqFcOkI0nldEQis+A= +cloud.google.com/go/auth/oauth2adapt v0.2.7 h1:/Lc7xODdqcEw8IrZ9SvwnlLX6j9FHQM74z6cBk9Rw6M= +cloud.google.com/go/auth/oauth2adapt v0.2.7/go.mod h1:NTbTTzfvPl1Y3V1nPpOgl2w6d/FjO7NNUQaWSox6ZMc= cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0= cloud.google.com/go/automl v1.6.0/go.mod h1:ugf8a6Fx+zP0D59WLhqgTDsQI9w07o64uf/Is3Nh5p8= +cloud.google.com/go/automl v1.7.0/go.mod h1:RL9MYCCsJEOmt0Wf3z9uzG0a7adTT1fe+aObgSpkCt8= +cloud.google.com/go/automl v1.8.0/go.mod h1:xWx7G/aPEe/NP+qzYXktoBSDfjO+vnKMGgsApGJJquM= +cloud.google.com/go/automl v1.12.0/go.mod h1:tWDcHDp86aMIuHmyvjuKeeHEGq76lD7ZqfGLN6B0NuU= +cloud.google.com/go/baremetalsolution v0.3.0/go.mod h1:XOrocE+pvK1xFfleEnShBlNAXf+j5blPPxrhjKgnIFc= +cloud.google.com/go/baremetalsolution v0.4.0/go.mod h1:BymplhAadOO/eBa7KewQ0Ppg4A4Wplbn+PsFKRLo0uI= +cloud.google.com/go/baremetalsolution v0.5.0/go.mod h1:dXGxEkmR9BMwxhzBhV0AioD0ULBmuLZI8CdwalUxuss= +cloud.google.com/go/batch v0.3.0/go.mod h1:TR18ZoAekj1GuirsUsR1ZTKN3FC/4UDnScjT8NXImFE= +cloud.google.com/go/batch v0.4.0/go.mod h1:WZkHnP43R/QCGQsZ+0JyG4i79ranE2u8xvjq/9+STPE= +cloud.google.com/go/batch v0.7.0/go.mod h1:vLZN95s6teRUqRQ4s3RLDsH8PvboqBK+rn1oevL159g= +cloud.google.com/go/beyondcorp v0.2.0/go.mod h1:TB7Bd+EEtcw9PCPQhCJtJGjk/7TC6ckmnSFS+xwTfm4= +cloud.google.com/go/beyondcorp v0.3.0/go.mod h1:E5U5lcrcXMsCuoDNyGrpyTm/hn7ne941Jz2vmksAxW8= +cloud.google.com/go/beyondcorp v0.4.0/go.mod h1:3ApA0mbhHx6YImmuubf5pyW8srKnCEPON32/5hj+RmM= +cloud.google.com/go/beyondcorp v0.5.0/go.mod h1:uFqj9X+dSfrheVp7ssLTaRHd2EHqSL4QZmH4e8WXGGU= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -57,12 +127,44 @@ cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUM cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/bigquery v1.42.0/go.mod h1:8dRTJxhtG+vwBKzE5OseQn/hiydoQN3EedCaOdYmxRA= +cloud.google.com/go/bigquery v1.43.0/go.mod h1:ZMQcXHsl+xmU1z36G2jNGZmKp9zNY5BUua5wDgmNCfw= +cloud.google.com/go/bigquery v1.44.0/go.mod h1:0Y33VqXTEsbamHJvJHdFmtqHvMIY28aK1+dFsvaChGc= +cloud.google.com/go/bigquery v1.47.0/go.mod h1:sA9XOgy0A8vQK9+MWhEQTY6Tix87M/ZurWFIxmF9I/E= +cloud.google.com/go/bigquery v1.48.0/go.mod h1:QAwSz+ipNgfL5jxiaK7weyOhzdoAy1zFm0Nf1fysJac= +cloud.google.com/go/bigquery v1.49.0/go.mod h1:Sv8hMmTFFYBlt/ftw2uN6dFdQPzBlREY9yBh7Oy7/4Q= +cloud.google.com/go/bigquery v1.50.0/go.mod h1:YrleYEh2pSEbgTBZYMJ5SuSr0ML3ypjRB1zgf7pvQLU= cloud.google.com/go/billing v1.4.0/go.mod h1:g9IdKBEFlItS8bTtlrZdVLWSSdSyFUZKXNS02zKMOZY= cloud.google.com/go/billing v1.5.0/go.mod h1:mztb1tBc3QekhjSgmpf/CV4LzWXLzCArwpLmP2Gm88s= +cloud.google.com/go/billing v1.6.0/go.mod h1:WoXzguj+BeHXPbKfNWkqVtDdzORazmCjraY+vrxcyvI= +cloud.google.com/go/billing v1.7.0/go.mod h1:q457N3Hbj9lYwwRbnlD7vUpyjq6u5U1RAOArInEiD5Y= +cloud.google.com/go/billing v1.12.0/go.mod h1:yKrZio/eu+okO/2McZEbch17O5CB5NpZhhXG6Z766ss= +cloud.google.com/go/billing v1.13.0/go.mod h1:7kB2W9Xf98hP9Sr12KfECgfGclsH3CQR0R08tnRlRbc= cloud.google.com/go/binaryauthorization v1.1.0/go.mod h1:xwnoWu3Y84jbuHa0zd526MJYmtnVXn0syOjaJgy4+dM= cloud.google.com/go/binaryauthorization v1.2.0/go.mod h1:86WKkJHtRcv5ViNABtYMhhNWRrD1Vpi//uKEy7aYEfI= +cloud.google.com/go/binaryauthorization v1.3.0/go.mod h1:lRZbKgjDIIQvzYQS1p99A7/U1JqvqeZg0wiI5tp6tg0= +cloud.google.com/go/binaryauthorization v1.4.0/go.mod h1:tsSPQrBd77VLplV70GUhBf/Zm3FsKmgSqgm4UmiDItk= +cloud.google.com/go/binaryauthorization v1.5.0/go.mod h1:OSe4OU1nN/VswXKRBmciKpo9LulY41gch5c68htf3/Q= +cloud.google.com/go/certificatemanager v1.3.0/go.mod h1:n6twGDvcUBFu9uBgt4eYvvf3sQ6My8jADcOVwHmzadg= +cloud.google.com/go/certificatemanager v1.4.0/go.mod h1:vowpercVFyqs8ABSmrdV+GiFf2H/ch3KyudYQEMM590= +cloud.google.com/go/certificatemanager v1.6.0/go.mod h1:3Hh64rCKjRAX8dXgRAyOcY5vQ/fE1sh8o+Mdd6KPgY8= +cloud.google.com/go/channel v1.8.0/go.mod h1:W5SwCXDJsq/rg3tn3oG0LOxpAo6IMxNa09ngphpSlnk= +cloud.google.com/go/channel v1.9.0/go.mod h1:jcu05W0my9Vx4mt3/rEHpfxc9eKi9XwsdDL8yBMbKUk= +cloud.google.com/go/channel v1.11.0/go.mod h1:IdtI0uWGqhEeatSB62VOoJ8FSUhJ9/+iGkJVqp74CGE= +cloud.google.com/go/channel v1.12.0/go.mod h1:VkxCGKASi4Cq7TbXxlaBezonAYpp1GCnKMY6tnMQnLU= +cloud.google.com/go/cloudbuild v1.3.0/go.mod h1:WequR4ULxlqvMsjDEEEFnOG5ZSRSgWOywXYDb1vPE6U= +cloud.google.com/go/cloudbuild v1.4.0/go.mod h1:5Qwa40LHiOXmz3386FrjrYM93rM/hdRr7b53sySrTqA= +cloud.google.com/go/cloudbuild v1.6.0/go.mod h1:UIbc/w9QCbH12xX+ezUsgblrWv+Cv4Tw83GiSMHOn9M= +cloud.google.com/go/cloudbuild v1.7.0/go.mod h1:zb5tWh2XI6lR9zQmsm1VRA+7OCuve5d8S+zJUul8KTg= +cloud.google.com/go/cloudbuild v1.9.0/go.mod h1:qK1d7s4QlO0VwfYn5YuClDGg2hfmLZEb4wQGAbIgL1s= +cloud.google.com/go/clouddms v1.3.0/go.mod h1:oK6XsCDdW4Ib3jCCBugx+gVjevp2TMXFtgxvPSee3OM= +cloud.google.com/go/clouddms v1.4.0/go.mod h1:Eh7sUGCC+aKry14O1NRljhjyrr0NFC0G2cjwX0cByRk= +cloud.google.com/go/clouddms v1.5.0/go.mod h1:QSxQnhikCLUw13iAbffF2CZxAER3xDGNHjsTAkQJcQA= cloud.google.com/go/cloudtasks v1.5.0/go.mod h1:fD92REy1x5woxkKEkLdvavGnPJGEn8Uic9nWuLzqCpY= cloud.google.com/go/cloudtasks v1.6.0/go.mod h1:C6Io+sxuke9/KNRkbQpihnW93SWDU3uXt92nu85HkYI= +cloud.google.com/go/cloudtasks v1.7.0/go.mod h1:ImsfdYWwlWNJbdgPIIGJWC+gemEGTBK/SunNQQNCAb4= +cloud.google.com/go/cloudtasks v1.8.0/go.mod h1:gQXUIwCSOI4yPVK7DgTVFiiP0ZW/eQkydWzwVMdHxrI= +cloud.google.com/go/cloudtasks v1.9.0/go.mod h1:w+EyLsVkLWHcOaqNEyvcKAsWp9p29dL6uL9Nst1cI7Y= +cloud.google.com/go/cloudtasks v1.10.0/go.mod h1:NDSoTLkZ3+vExFEWu2UJV1arUyzVDAiZtdWcsUyNwBs= cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= @@ -70,102 +172,368 @@ cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= -cloud.google.com/go/compute v1.19.0 h1:+9zda3WGgW1ZSTlVppLCYFIr48Pa35q1uG2N1itbCEQ= +cloud.google.com/go/compute v1.12.0/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= +cloud.google.com/go/compute v1.12.1/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= +cloud.google.com/go/compute v1.13.0/go.mod h1:5aPTS0cUNMIc1CE546K+Th6weJUNQErARyZtRXDJ8GE= +cloud.google.com/go/compute v1.14.0/go.mod h1:YfLtxrj9sU4Yxv+sXzZkyPjEyPBZfXHUvjxega5vAdo= +cloud.google.com/go/compute v1.15.1/go.mod h1:bjjoF/NtFUrkD/urWfdHaKuOPDR5nWIs63rR+SXhcpA= +cloud.google.com/go/compute v1.18.0/go.mod h1:1X7yHxec2Ga+Ss6jPyjxRxpu2uu7PLgsOVXvgU0yacs= cloud.google.com/go/compute v1.19.0/go.mod h1:rikpw2y+UMidAe9tISo04EHNOIf42RLYF/q8Bs93scU= -cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= +cloud.google.com/go/compute v1.19.1/go.mod h1:6ylj3a05WF8leseCdIf77NK0g1ey+nj5IKd5/kvShxE= +cloud.google.com/go/compute/metadata v0.1.0/go.mod h1:Z1VN+bulIf6bt4P/C37K4DyZYZEXYonfTBHHFPO/4UU= +cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +cloud.google.com/go/compute/metadata v0.6.0 h1:A6hENjEsCDtC1k8byVsgwvVcioamEHvZ4j01OwKxG9I= +cloud.google.com/go/compute/metadata v0.6.0/go.mod h1:FjyFAW1MW0C203CEOMDTu3Dk1FlqW3Rga40jzHL4hfg= +cloud.google.com/go/contactcenterinsights v1.3.0/go.mod h1:Eu2oemoePuEFc/xKFPjbTuPSj0fYJcPls9TFlPNnHHY= +cloud.google.com/go/contactcenterinsights v1.4.0/go.mod h1:L2YzkGbPsv+vMQMCADxJoT9YiTTnSEd6fEvCeHTYVck= +cloud.google.com/go/contactcenterinsights v1.6.0/go.mod h1:IIDlT6CLcDoyv79kDv8iWxMSTZhLxSCofVV5W6YFM/w= +cloud.google.com/go/container v1.6.0/go.mod h1:Xazp7GjJSeUYo688S+6J5V+n/t+G5sKBTFkKNudGRxg= +cloud.google.com/go/container v1.7.0/go.mod h1:Dp5AHtmothHGX3DwwIHPgq45Y8KmNsgN3amoYfxVkLo= +cloud.google.com/go/container v1.13.1/go.mod h1:6wgbMPeQRw9rSnKBCAJXnds3Pzj03C4JHamr8asWKy4= +cloud.google.com/go/container v1.14.0/go.mod h1:3AoJMPhHfLDxLvrlVWaK57IXzaPnLaZq63WX59aQBfM= +cloud.google.com/go/container v1.15.0/go.mod h1:ft+9S0WGjAyjDggg5S06DXj+fHJICWg8L7isCQe9pQA= cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= +cloud.google.com/go/containeranalysis v0.7.0/go.mod h1:9aUL+/vZ55P2CXfuZjS4UjQ9AgXoSw8Ts6lemfmxBxI= +cloud.google.com/go/containeranalysis v0.9.0/go.mod h1:orbOANbwk5Ejoom+s+DUCTTJ7IBdBQJDcSylAx/on9s= cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0= cloud.google.com/go/datacatalog v1.5.0/go.mod h1:M7GPLNQeLfWqeIm3iuiruhPzkt65+Bx8dAKvScX8jvs= cloud.google.com/go/datacatalog v1.6.0/go.mod h1:+aEyF8JKg+uXcIdAmmaMUmZ3q1b/lKLtXCmXdnc0lbc= +cloud.google.com/go/datacatalog v1.7.0/go.mod h1:9mEl4AuDYWw81UGc41HonIHH7/sn52H0/tc8f8ZbZIE= +cloud.google.com/go/datacatalog v1.8.0/go.mod h1:KYuoVOv9BM8EYz/4eMFxrr4DUKhGIOXxZoKYF5wdISM= +cloud.google.com/go/datacatalog v1.8.1/go.mod h1:RJ58z4rMp3gvETA465Vg+ag8BGgBdnRPEMMSTr5Uv+M= +cloud.google.com/go/datacatalog v1.12.0/go.mod h1:CWae8rFkfp6LzLumKOnmVh4+Zle4A3NXLzVJ1d1mRm0= +cloud.google.com/go/datacatalog v1.13.0/go.mod h1:E4Rj9a5ZtAxcQJlEBTLgMTphfP11/lNaAshpoBgemX8= cloud.google.com/go/dataflow v0.6.0/go.mod h1:9QwV89cGoxjjSR9/r7eFDqqjtvbKxAK2BaYU6PVk9UM= cloud.google.com/go/dataflow v0.7.0/go.mod h1:PX526vb4ijFMesO1o202EaUmouZKBpjHsTlCtB4parQ= +cloud.google.com/go/dataflow v0.8.0/go.mod h1:Rcf5YgTKPtQyYz8bLYhFoIV/vP39eL7fWNcSOyFfLJE= cloud.google.com/go/dataform v0.3.0/go.mod h1:cj8uNliRlHpa6L3yVhDOBrUXH+BPAO1+KFMQQNSThKo= cloud.google.com/go/dataform v0.4.0/go.mod h1:fwV6Y4Ty2yIFL89huYlEkwUPtS7YZinZbzzj5S9FzCE= +cloud.google.com/go/dataform v0.5.0/go.mod h1:GFUYRe8IBa2hcomWplodVmUx/iTL0FrsauObOM3Ipr0= +cloud.google.com/go/dataform v0.6.0/go.mod h1:QPflImQy33e29VuapFdf19oPbE4aYTJxr31OAPV+ulA= +cloud.google.com/go/dataform v0.7.0/go.mod h1:7NulqnVozfHvWUBpMDfKMUESr+85aJsC/2O0o3jWPDE= +cloud.google.com/go/datafusion v1.4.0/go.mod h1:1Zb6VN+W6ALo85cXnM1IKiPw+yQMKMhB9TsTSRDo/38= +cloud.google.com/go/datafusion v1.5.0/go.mod h1:Kz+l1FGHB0J+4XF2fud96WMmRiq/wj8N9u007vyXZ2w= +cloud.google.com/go/datafusion v1.6.0/go.mod h1:WBsMF8F1RhSXvVM8rCV3AeyWVxcC2xY6vith3iw3S+8= cloud.google.com/go/datalabeling v0.5.0/go.mod h1:TGcJ0G2NzcsXSE/97yWjIZO0bXj0KbVlINXMG9ud42I= cloud.google.com/go/datalabeling v0.6.0/go.mod h1:WqdISuk/+WIGeMkpw/1q7bK/tFEZxsrFJOJdY2bXvTQ= +cloud.google.com/go/datalabeling v0.7.0/go.mod h1:WPQb1y08RJbmpM3ww0CSUAGweL0SxByuW2E+FU+wXcM= +cloud.google.com/go/dataplex v1.3.0/go.mod h1:hQuRtDg+fCiFgC8j0zV222HvzFQdRd+SVX8gdmFcZzA= +cloud.google.com/go/dataplex v1.4.0/go.mod h1:X51GfLXEMVJ6UN47ESVqvlsRplbLhcsAt0kZCCKsU0A= +cloud.google.com/go/dataplex v1.5.2/go.mod h1:cVMgQHsmfRoI5KFYq4JtIBEUbYwc3c7tXmIDhRmNNVQ= +cloud.google.com/go/dataplex v1.6.0/go.mod h1:bMsomC/aEJOSpHXdFKFGQ1b0TDPIeL28nJObeO1ppRs= +cloud.google.com/go/dataproc v1.7.0/go.mod h1:CKAlMjII9H90RXaMpSxQ8EU6dQx6iAYNPcYPOkSbi8s= +cloud.google.com/go/dataproc v1.8.0/go.mod h1:5OW+zNAH0pMpw14JVrPONsxMQYMBqJuzORhIBfBn9uI= +cloud.google.com/go/dataproc v1.12.0/go.mod h1:zrF3aX0uV3ikkMz6z4uBbIKyhRITnxvr4i3IjKsKrw4= cloud.google.com/go/dataqna v0.5.0/go.mod h1:90Hyk596ft3zUQ8NkFfvICSIfHFh1Bc7C4cK3vbhkeo= cloud.google.com/go/dataqna v0.6.0/go.mod h1:1lqNpM7rqNLVgWBJyk5NF6Uen2PHym0jtVJonplVsDA= +cloud.google.com/go/dataqna v0.7.0/go.mod h1:Lx9OcIIeqCrw1a6KdO3/5KMP1wAmTc0slZWwP12Qq3c= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/datastore v1.10.0/go.mod h1:PC5UzAmDEkAmkfaknstTYbNpgE49HAgW2J1gcgUfmdM= +cloud.google.com/go/datastore v1.11.0/go.mod h1:TvGxBIHCS50u8jzG+AW/ppf87v1of8nwzFNgEZU1D3c= cloud.google.com/go/datastream v1.2.0/go.mod h1:i/uTP8/fZwgATHS/XFu0TcNUhuA0twZxxQ3EyCUQMwo= cloud.google.com/go/datastream v1.3.0/go.mod h1:cqlOX8xlyYF/uxhiKn6Hbv6WjwPPuI9W2M9SAXwaLLQ= +cloud.google.com/go/datastream v1.4.0/go.mod h1:h9dpzScPhDTs5noEMQVWP8Wx8AFBRyS0s8KWPx/9r0g= +cloud.google.com/go/datastream v1.5.0/go.mod h1:6TZMMNPwjUqZHBKPQ1wwXpb0d5VDVPl2/XoS5yi88q4= +cloud.google.com/go/datastream v1.6.0/go.mod h1:6LQSuswqLa7S4rPAOZFVjHIG3wJIjZcZrw8JDEDJuIs= +cloud.google.com/go/datastream v1.7.0/go.mod h1:uxVRMm2elUSPuh65IbZpzJNMbuzkcvu5CjMqVIUHrww= +cloud.google.com/go/deploy v1.4.0/go.mod h1:5Xghikd4VrmMLNaF6FiRFDlHb59VM59YoDQnOUdsH/c= +cloud.google.com/go/deploy v1.5.0/go.mod h1:ffgdD0B89tToyW/U/D2eL0jN2+IEV/3EMuXHA0l4r+s= +cloud.google.com/go/deploy v1.6.0/go.mod h1:f9PTHehG/DjCom3QH0cntOVRm93uGBDt2vKzAPwpXQI= +cloud.google.com/go/deploy v1.8.0/go.mod h1:z3myEJnA/2wnB4sgjqdMfgxCA0EqC3RBTNcVPs93mtQ= cloud.google.com/go/dialogflow v1.15.0/go.mod h1:HbHDWs33WOGJgn6rfzBW1Kv807BE3O1+xGbn59zZWI4= cloud.google.com/go/dialogflow v1.16.1/go.mod h1:po6LlzGfK+smoSmTBnbkIZY2w8ffjz/RcGSS+sh1el0= cloud.google.com/go/dialogflow v1.17.0/go.mod h1:YNP09C/kXA1aZdBgC/VtXX74G/TKn7XVCcVumTflA+8= +cloud.google.com/go/dialogflow v1.18.0/go.mod h1:trO7Zu5YdyEuR+BhSNOqJezyFQ3aUzz0njv7sMx/iek= +cloud.google.com/go/dialogflow v1.19.0/go.mod h1:JVmlG1TwykZDtxtTXujec4tQ+D8SBFMoosgy+6Gn0s0= +cloud.google.com/go/dialogflow v1.29.0/go.mod h1:b+2bzMe+k1s9V+F2jbJwpHPzrnIyHihAdRFMtn2WXuM= +cloud.google.com/go/dialogflow v1.31.0/go.mod h1:cuoUccuL1Z+HADhyIA7dci3N5zUssgpBJmCzI6fNRB4= +cloud.google.com/go/dialogflow v1.32.0/go.mod h1:jG9TRJl8CKrDhMEcvfcfFkkpp8ZhgPz3sBGmAUYJ2qE= +cloud.google.com/go/dlp v1.6.0/go.mod h1:9eyB2xIhpU0sVwUixfBubDoRwP+GjeUoxxeueZmqvmM= +cloud.google.com/go/dlp v1.7.0/go.mod h1:68ak9vCiMBjbasxeVD17hVPxDEck+ExiHavX8kiHG+Q= +cloud.google.com/go/dlp v1.9.0/go.mod h1:qdgmqgTyReTz5/YNSSuueR8pl7hO0o9bQ39ZhtgkWp4= cloud.google.com/go/documentai v1.7.0/go.mod h1:lJvftZB5NRiFSX4moiye1SMxHx0Bc3x1+p9e/RfXYiU= cloud.google.com/go/documentai v1.8.0/go.mod h1:xGHNEB7CtsnySCNrCFdCyyMz44RhFEEX2Q7UD0c5IhU= +cloud.google.com/go/documentai v1.9.0/go.mod h1:FS5485S8R00U10GhgBC0aNGrJxBP8ZVpEeJ7PQDZd6k= +cloud.google.com/go/documentai v1.10.0/go.mod h1:vod47hKQIPeCfN2QS/jULIvQTugbmdc0ZvxxfQY1bg4= +cloud.google.com/go/documentai v1.16.0/go.mod h1:o0o0DLTEZ+YnJZ+J4wNfTxmDVyrkzFvttBXXtYRMHkM= +cloud.google.com/go/documentai v1.18.0/go.mod h1:F6CK6iUH8J81FehpskRmhLq/3VlwQvb7TvwOceQ2tbs= cloud.google.com/go/domains v0.6.0/go.mod h1:T9Rz3GasrpYk6mEGHh4rymIhjlnIuB4ofT1wTxDeT4Y= cloud.google.com/go/domains v0.7.0/go.mod h1:PtZeqS1xjnXuRPKE/88Iru/LdfoRyEHYA9nFQf4UKpg= +cloud.google.com/go/domains v0.8.0/go.mod h1:M9i3MMDzGFXsydri9/vW+EWz9sWb4I6WyHqdlAk0idE= cloud.google.com/go/edgecontainer v0.1.0/go.mod h1:WgkZ9tp10bFxqO8BLPqv2LlfmQF1X8lZqwW4r1BTajk= cloud.google.com/go/edgecontainer v0.2.0/go.mod h1:RTmLijy+lGpQ7BXuTDa4C4ssxyXT34NIuHIgKuP4s5w= +cloud.google.com/go/edgecontainer v0.3.0/go.mod h1:FLDpP4nykgwwIfcLt6zInhprzw0lEi2P1fjO6Ie0qbc= +cloud.google.com/go/edgecontainer v1.0.0/go.mod h1:cttArqZpBB2q58W/upSG++ooo6EsblxDIolxa3jSjbY= +cloud.google.com/go/errorreporting v0.3.0/go.mod h1:xsP2yaAp+OAW4OIm60An2bbLpqIhKXdWR/tawvl7QzU= +cloud.google.com/go/essentialcontacts v1.3.0/go.mod h1:r+OnHa5jfj90qIfZDO/VztSFqbQan7HV75p8sA+mdGI= +cloud.google.com/go/essentialcontacts v1.4.0/go.mod h1:8tRldvHYsmnBCHdFpvU+GL75oWiBKl80BiqlFh9tp+8= +cloud.google.com/go/essentialcontacts v1.5.0/go.mod h1:ay29Z4zODTuwliK7SnX8E86aUF2CTzdNtvv42niCX0M= +cloud.google.com/go/eventarc v1.7.0/go.mod h1:6ctpF3zTnaQCxUjHUdcfgcA1A2T309+omHZth7gDfmc= +cloud.google.com/go/eventarc v1.8.0/go.mod h1:imbzxkyAU4ubfsaKYdQg04WS1NvncblHEup4kvF+4gw= +cloud.google.com/go/eventarc v1.10.0/go.mod h1:u3R35tmZ9HvswGRBnF48IlYgYeBcPUCjkr4BTdem2Kw= +cloud.google.com/go/eventarc v1.11.0/go.mod h1:PyUjsUKPWoRBCHeOxZd/lbOOjahV41icXyUY5kSTvVY= +cloud.google.com/go/filestore v1.3.0/go.mod h1:+qbvHGvXU1HaKX2nD0WEPo92TP/8AQuCVEBXNY9z0+w= +cloud.google.com/go/filestore v1.4.0/go.mod h1:PaG5oDfo9r224f8OYXURtAsY+Fbyq/bLYoINEK8XQAI= +cloud.google.com/go/filestore v1.5.0/go.mod h1:FqBXDWBp4YLHqRnVGveOkHDf8svj9r5+mUDLupOWEDs= +cloud.google.com/go/filestore v1.6.0/go.mod h1:di5unNuss/qfZTw2U9nhFqo8/ZDSc466dre85Kydllg= +cloud.google.com/go/firestore v1.9.0/go.mod h1:HMkjKHNTtRyZNiMzu7YAsLr9K3X2udY2AMwDaMEQiiE= cloud.google.com/go/functions v1.6.0/go.mod h1:3H1UA3qiIPRWD7PeZKLvHZ9SaQhR26XIJcC0A5GbvAk= cloud.google.com/go/functions v1.7.0/go.mod h1:+d+QBcWM+RsrgZfV9xo6KfA1GlzJfxcfZcRPEhDDfzg= +cloud.google.com/go/functions v1.8.0/go.mod h1:RTZ4/HsQjIqIYP9a9YPbU+QFoQsAlYgrwOXJWHn1POY= +cloud.google.com/go/functions v1.9.0/go.mod h1:Y+Dz8yGguzO3PpIjhLTbnqV1CWmgQ5UwtlpzoyquQ08= +cloud.google.com/go/functions v1.10.0/go.mod h1:0D3hEOe3DbEvCXtYOZHQZmD+SzYsi1YbI7dGvHfldXw= +cloud.google.com/go/functions v1.12.0/go.mod h1:AXWGrF3e2C/5ehvwYo/GH6O5s09tOPksiKhz+hH8WkA= +cloud.google.com/go/functions v1.13.0/go.mod h1:EU4O007sQm6Ef/PwRsI8N2umygGqPBS/IZQKBQBcJ3c= cloud.google.com/go/gaming v1.5.0/go.mod h1:ol7rGcxP/qHTRQE/RO4bxkXq+Fix0j6D4LFPzYTIrDM= cloud.google.com/go/gaming v1.6.0/go.mod h1:YMU1GEvA39Qt3zWGyAVA9bpYz/yAhTvaQ1t2sK4KPUA= +cloud.google.com/go/gaming v1.7.0/go.mod h1:LrB8U7MHdGgFG851iHAfqUdLcKBdQ55hzXy9xBJz0+w= +cloud.google.com/go/gaming v1.8.0/go.mod h1:xAqjS8b7jAVW0KFYeRUxngo9My3f33kFmua++Pi+ggM= +cloud.google.com/go/gaming v1.9.0/go.mod h1:Fc7kEmCObylSWLO334NcO+O9QMDyz+TKC4v1D7X+Bc0= +cloud.google.com/go/gkebackup v0.2.0/go.mod h1:XKvv/4LfG829/B8B7xRkk8zRrOEbKtEam6yNfuQNH60= +cloud.google.com/go/gkebackup v0.3.0/go.mod h1:n/E671i1aOQvUxT541aTkCwExO/bTer2HDlj4TsBRAo= +cloud.google.com/go/gkebackup v0.4.0/go.mod h1:byAyBGUwYGEEww7xsbnUTBHIYcOPy/PgUWUtOeRm9Vg= cloud.google.com/go/gkeconnect v0.5.0/go.mod h1:c5lsNAg5EwAy7fkqX/+goqFsU1Da/jQFqArp+wGNr/o= cloud.google.com/go/gkeconnect v0.6.0/go.mod h1:Mln67KyU/sHJEBY8kFZ0xTeyPtzbq9StAVvEULYK16A= +cloud.google.com/go/gkeconnect v0.7.0/go.mod h1:SNfmVqPkaEi3bF/B3CNZOAYPYdg7sU+obZ+QTky2Myw= cloud.google.com/go/gkehub v0.9.0/go.mod h1:WYHN6WG8w9bXU0hqNxt8rm5uxnk8IH+lPY9J2TV7BK0= cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y977wO+hBH0= +cloud.google.com/go/gkehub v0.11.0/go.mod h1:JOWHlmN+GHyIbuWQPl47/C2RFhnFKH38jH9Ascu3n0E= +cloud.google.com/go/gkehub v0.12.0/go.mod h1:djiIwwzTTBrF5NaXCGv3mf7klpEMcST17VBTVVDcuaw= +cloud.google.com/go/gkemulticloud v0.3.0/go.mod h1:7orzy7O0S+5kq95e4Hpn7RysVA7dPs8W/GgfUtsPbrA= +cloud.google.com/go/gkemulticloud v0.4.0/go.mod h1:E9gxVBnseLWCk24ch+P9+B2CoDFJZTyIgLKSalC7tuI= +cloud.google.com/go/gkemulticloud v0.5.0/go.mod h1:W0JDkiyi3Tqh0TJr//y19wyb1yf8llHVto2Htf2Ja3Y= cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= +cloud.google.com/go/gsuiteaddons v1.3.0/go.mod h1:EUNK/J1lZEZO8yPtykKxLXI6JSVN2rg9bN8SXOa0bgM= +cloud.google.com/go/gsuiteaddons v1.4.0/go.mod h1:rZK5I8hht7u7HxFQcFei0+AtfS9uSushomRlg+3ua1o= +cloud.google.com/go/gsuiteaddons v1.5.0/go.mod h1:TFCClYLd64Eaa12sFVmUyG62tk4mdIsI7pAnSXRkcFo= +cloud.google.com/go/iam v0.1.0/go.mod h1:vcUNEa0pEm0qRVpmWepWaFMIAI8/hjB9mO8rNCJtF6c= cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= -cloud.google.com/go/iam v0.13.0 h1:+CmB+K0J/33d0zSQ9SlFWUeCCEn5XJA0ZMZ3pHE9u8k= +cloud.google.com/go/iam v0.6.0/go.mod h1:+1AH33ueBne5MzYccyMHtEKqLE4/kJOibtffMHDMFMc= +cloud.google.com/go/iam v0.7.0/go.mod h1:H5Br8wRaDGNc8XP3keLc4unfUUZeyH3Sfl9XpQEYOeg= +cloud.google.com/go/iam v0.8.0/go.mod h1:lga0/y3iH6CX7sYqypWJ33hf7kkfXJag67naqGESjkE= +cloud.google.com/go/iam v0.11.0/go.mod h1:9PiLDanza5D+oWFZiH1uG+RnRCfEGKoyl6yo4cgWZGY= +cloud.google.com/go/iam v0.12.0/go.mod h1:knyHGviacl11zrtZUoDuYpDgLjvr28sLQaG0YB2GYAY= cloud.google.com/go/iam v0.13.0/go.mod h1:ljOg+rcNfzZ5d6f1nAUJ8ZIxOaZUVoS14bKCtaLZ/D0= +cloud.google.com/go/iam v1.3.1 h1:KFf8SaT71yYq+sQtRISn90Gyhyf4X8RGgeAVC8XGf3E= +cloud.google.com/go/iam v1.3.1/go.mod h1:3wMtuyT4NcbnYNPLMBzYRFiEfjKfJlLVLrisE7bwm34= +cloud.google.com/go/iap v1.4.0/go.mod h1:RGFwRJdihTINIe4wZ2iCP0zF/qu18ZwyKxrhMhygBEc= +cloud.google.com/go/iap v1.5.0/go.mod h1:UH/CGgKd4KyohZL5Pt0jSKE4m3FR51qg6FKQ/z/Ix9A= +cloud.google.com/go/iap v1.6.0/go.mod h1:NSuvI9C/j7UdjGjIde7t7HBz+QTwBcapPE07+sSRcLk= +cloud.google.com/go/iap v1.7.0/go.mod h1:beqQx56T9O1G1yNPph+spKpNibDlYIiIixiqsQXxLIo= +cloud.google.com/go/iap v1.7.1/go.mod h1:WapEwPc7ZxGt2jFGB/C/bm+hP0Y6NXzOYGjpPnmMS74= +cloud.google.com/go/ids v1.1.0/go.mod h1:WIuwCaYVOzHIj2OhN9HAwvW+DBdmUAdcWlFxRl+KubM= +cloud.google.com/go/ids v1.2.0/go.mod h1:5WXvp4n25S0rA/mQWAg1YEEBBq6/s+7ml1RDCW1IrcY= +cloud.google.com/go/ids v1.3.0/go.mod h1:JBdTYwANikFKaDP6LtW5JAi4gubs57SVNQjemdt6xV4= +cloud.google.com/go/iot v1.3.0/go.mod h1:r7RGh2B61+B8oz0AGE+J72AhA0G7tdXItODWsaA2oLs= +cloud.google.com/go/iot v1.4.0/go.mod h1:dIDxPOn0UvNDUMD8Ger7FIaTuvMkj+aGk94RPP0iV+g= +cloud.google.com/go/iot v1.5.0/go.mod h1:mpz5259PDl3XJthEmh9+ap0affn/MqNSP4My77Qql9o= +cloud.google.com/go/iot v1.6.0/go.mod h1:IqdAsmE2cTYYNO1Fvjfzo9po179rAtJeVGUvkLN3rLE= +cloud.google.com/go/kms v1.4.0/go.mod h1:fajBHndQ+6ubNw6Ss2sSd+SWvjL26RNo/dr7uxsnnOA= +cloud.google.com/go/kms v1.5.0/go.mod h1:QJS2YY0eJGBg3mnDfuaCyLauWwBJiHRboYxJ++1xJNg= +cloud.google.com/go/kms v1.6.0/go.mod h1:Jjy850yySiasBUDi6KFUwUv2n1+o7QZFyuUJg6OgjA0= +cloud.google.com/go/kms v1.8.0/go.mod h1:4xFEhYFqvW+4VMELtZyxomGSYtSQKzM178ylFW4jMAg= +cloud.google.com/go/kms v1.9.0/go.mod h1:qb1tPTgfF9RQP8e1wq4cLFErVuTJv7UsSC915J8dh3w= +cloud.google.com/go/kms v1.10.0/go.mod h1:ng3KTUtQQU9bPX3+QGLsflZIHlkbn8amFAMY63m8d24= +cloud.google.com/go/kms v1.10.1/go.mod h1:rIWk/TryCkR59GMC3YtHtXeLzd634lBbKenvyySAyYI= cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= +cloud.google.com/go/language v1.7.0/go.mod h1:DJ6dYN/W+SQOjF8e1hLQXMF21AkH2w9wiPzPCJa2MIE= +cloud.google.com/go/language v1.8.0/go.mod h1:qYPVHf7SPoNNiCL2Dr0FfEFNil1qi3pQEyygwpgVKB8= +cloud.google.com/go/language v1.9.0/go.mod h1:Ns15WooPM5Ad/5no/0n81yUetis74g3zrbeJBE+ptUY= cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08= -cloud.google.com/go/longrunning v0.4.1 h1:v+yFJOfKC3yZdY6ZUI933pIYdhyhV8S3NpWrXWmg7jM= +cloud.google.com/go/lifesciences v0.8.0/go.mod h1:lFxiEOMqII6XggGbOnKiyZ7IBwoIqA84ClvoezaA/bo= +cloud.google.com/go/logging v1.6.1/go.mod h1:5ZO0mHHbvm8gEmeEUHrmDlTDSu5imF6MUP9OfilNXBw= +cloud.google.com/go/logging v1.7.0/go.mod h1:3xjP2CjkM3ZkO73aj4ASA5wRPGGCRrPIAeNqVNkzY8M= +cloud.google.com/go/logging v1.13.0 h1:7j0HgAp0B94o1YRDqiqm26w4q1rDMH7XNRU34lJXHYc= +cloud.google.com/go/logging v1.13.0/go.mod h1:36CoKh6KA/M0PbhPKMq6/qety2DCAErbhXT62TuXALA= +cloud.google.com/go/longrunning v0.1.1/go.mod h1:UUFxuDWkv22EuY93jjmDMFT5GPQKeFVJBIF6QlTqdsE= +cloud.google.com/go/longrunning v0.3.0/go.mod h1:qth9Y41RRSUE69rDcOn6DdK3HfQfsUI0YSmW3iIlLJc= +cloud.google.com/go/longrunning v0.4.1/go.mod h1:4iWDqhBZ70CvZ6BfETbvam3T8FMvLK+eFj0E6AaRQTo= +cloud.google.com/go/longrunning v0.6.4 h1:3tyw9rO3E2XVXzSApn1gyEEnH2K9SynNQjMlBi3uHLg= +cloud.google.com/go/longrunning v0.6.4/go.mod h1:ttZpLCe6e7EXvn9OxpBRx7kZEB0efv8yBO6YnVMfhJs= +cloud.google.com/go/managedidentities v1.3.0/go.mod h1:UzlW3cBOiPrzucO5qWkNkh0w33KFtBJU281hacNvsdE= +cloud.google.com/go/managedidentities v1.4.0/go.mod h1:NWSBYbEMgqmbZsLIyKvxrYbtqOsxY1ZrGM+9RgDqInM= +cloud.google.com/go/managedidentities v1.5.0/go.mod h1:+dWcZ0JlUmpuxpIDfyP5pP5y0bLdRwOS4Lp7gMni/LA= +cloud.google.com/go/maps v0.1.0/go.mod h1:BQM97WGyfw9FWEmQMpZ5T6cpovXXSd1cGmFma94eubI= +cloud.google.com/go/maps v0.6.0/go.mod h1:o6DAMMfb+aINHz/p/jbcY+mYeXBoZoxTfdSQ8VAJaCw= +cloud.google.com/go/maps v0.7.0/go.mod h1:3GnvVl3cqeSvgMcpRlQidXsPYuDGQ8naBis7MVzpXsY= cloud.google.com/go/mediatranslation v0.5.0/go.mod h1:jGPUhGTybqsPQn91pNXw0xVHfuJ3leR1wj37oU3y1f4= cloud.google.com/go/mediatranslation v0.6.0/go.mod h1:hHdBCTYNigsBxshbznuIMFNe5QXEowAuNmmC7h8pu5w= +cloud.google.com/go/mediatranslation v0.7.0/go.mod h1:LCnB/gZr90ONOIQLgSXagp8XUW1ODs2UmUMvcgMfI2I= cloud.google.com/go/memcache v1.4.0/go.mod h1:rTOfiGZtJX1AaFUrOgsMHX5kAzaTQ8azHiuDoTPzNsE= cloud.google.com/go/memcache v1.5.0/go.mod h1:dk3fCK7dVo0cUU2c36jKb4VqKPS22BTkf81Xq617aWM= +cloud.google.com/go/memcache v1.6.0/go.mod h1:XS5xB0eQZdHtTuTF9Hf8eJkKtR3pVRCcvJwtm68T3rA= +cloud.google.com/go/memcache v1.7.0/go.mod h1:ywMKfjWhNtkQTxrWxCkCFkoPjLHPW6A7WOTVI8xy3LY= +cloud.google.com/go/memcache v1.9.0/go.mod h1:8oEyzXCu+zo9RzlEaEjHl4KkgjlNDaXbCQeQWlzNFJM= cloud.google.com/go/metastore v1.5.0/go.mod h1:2ZNrDcQwghfdtCwJ33nM0+GrBGlVuh8rakL3vdPY3XY= cloud.google.com/go/metastore v1.6.0/go.mod h1:6cyQTls8CWXzk45G55x57DVQ9gWg7RiH65+YgPsNh9s= +cloud.google.com/go/metastore v1.7.0/go.mod h1:s45D0B4IlsINu87/AsWiEVYbLaIMeUSoxlKKDqBGFS8= +cloud.google.com/go/metastore v1.8.0/go.mod h1:zHiMc4ZUpBiM7twCIFQmJ9JMEkDSyZS9U12uf7wHqSI= +cloud.google.com/go/metastore v1.10.0/go.mod h1:fPEnH3g4JJAk+gMRnrAnoqyv2lpUCqJPWOodSaf45Eo= +cloud.google.com/go/monitoring v1.7.0/go.mod h1:HpYse6kkGo//7p6sT0wsIC6IBDET0RhIsnmlA53dvEk= +cloud.google.com/go/monitoring v1.8.0/go.mod h1:E7PtoMJ1kQXWxPjB6mv2fhC5/15jInuulFdYYtlcvT4= +cloud.google.com/go/monitoring v1.12.0/go.mod h1:yx8Jj2fZNEkL/GYZyTLS4ZtZEZN8WtDEiEqG4kLK50w= +cloud.google.com/go/monitoring v1.13.0/go.mod h1:k2yMBAB1H9JT/QETjNkgdCGD9bPF712XiLTVr+cBrpw= +cloud.google.com/go/monitoring v1.22.1 h1:KQbnAC4IAH+5x3iWuPZT5iN9VXqKMzzOgqcYB6fqPDE= +cloud.google.com/go/monitoring v1.22.1/go.mod h1:AuZZXAoN0WWWfsSvET1Cpc4/1D8LXq8KRDU87fMS6XY= cloud.google.com/go/networkconnectivity v1.4.0/go.mod h1:nOl7YL8odKyAOtzNX73/M5/mGZgqqMeryi6UPZTk/rA= cloud.google.com/go/networkconnectivity v1.5.0/go.mod h1:3GzqJx7uhtlM3kln0+x5wyFvuVH1pIBJjhCpjzSt75o= +cloud.google.com/go/networkconnectivity v1.6.0/go.mod h1:OJOoEXW+0LAxHh89nXd64uGG+FbQoeH8DtxCHVOMlaM= +cloud.google.com/go/networkconnectivity v1.7.0/go.mod h1:RMuSbkdbPwNMQjB5HBWD5MpTBnNm39iAVpC3TmsExt8= +cloud.google.com/go/networkconnectivity v1.10.0/go.mod h1:UP4O4sWXJG13AqrTdQCD9TnLGEbtNRqjuaaA7bNjF5E= +cloud.google.com/go/networkconnectivity v1.11.0/go.mod h1:iWmDD4QF16VCDLXUqvyspJjIEtBR/4zq5hwnY2X3scM= +cloud.google.com/go/networkmanagement v1.4.0/go.mod h1:Q9mdLLRn60AsOrPc8rs8iNV6OHXaGcDdsIQe1ohekq8= +cloud.google.com/go/networkmanagement v1.5.0/go.mod h1:ZnOeZ/evzUdUsnvRt792H0uYEnHQEMaz+REhhzJRcf4= +cloud.google.com/go/networkmanagement v1.6.0/go.mod h1:5pKPqyXjB/sgtvB5xqOemumoQNB7y95Q7S+4rjSOPYY= cloud.google.com/go/networksecurity v0.5.0/go.mod h1:xS6fOCoqpVC5zx15Z/MqkfDwH4+m/61A3ODiDV1xmiQ= cloud.google.com/go/networksecurity v0.6.0/go.mod h1:Q5fjhTr9WMI5mbpRYEbiexTzROf7ZbDzvzCrNl14nyU= +cloud.google.com/go/networksecurity v0.7.0/go.mod h1:mAnzoxx/8TBSyXEeESMy9OOYwo1v+gZ5eMRnsT5bC8k= +cloud.google.com/go/networksecurity v0.8.0/go.mod h1:B78DkqsxFG5zRSVuwYFRZ9Xz8IcQ5iECsNrPn74hKHU= cloud.google.com/go/notebooks v1.2.0/go.mod h1:9+wtppMfVPUeJ8fIWPOq1UnATHISkGXGqTkxeieQ6UY= cloud.google.com/go/notebooks v1.3.0/go.mod h1:bFR5lj07DtCPC7YAAJ//vHskFBxA5JzYlH68kXVdk34= +cloud.google.com/go/notebooks v1.4.0/go.mod h1:4QPMngcwmgb6uw7Po99B2xv5ufVoIQ7nOGDyL4P8AgA= +cloud.google.com/go/notebooks v1.5.0/go.mod h1:q8mwhnP9aR8Hpfnrc5iN5IBhrXUy8S2vuYs+kBJ/gu0= +cloud.google.com/go/notebooks v1.7.0/go.mod h1:PVlaDGfJgj1fl1S3dUwhFMXFgfYGhYQt2164xOMONmE= +cloud.google.com/go/notebooks v1.8.0/go.mod h1:Lq6dYKOYOWUCTvw5t2q1gp1lAp0zxAxRycayS0iJcqQ= +cloud.google.com/go/optimization v1.1.0/go.mod h1:5po+wfvX5AQlPznyVEZjGJTMr4+CAkJf2XSTQOOl9l4= +cloud.google.com/go/optimization v1.2.0/go.mod h1:Lr7SOHdRDENsh+WXVmQhQTrzdu9ybg0NecjHidBq6xs= +cloud.google.com/go/optimization v1.3.1/go.mod h1:IvUSefKiwd1a5p0RgHDbWCIbDFgKuEdB+fPPuP0IDLI= +cloud.google.com/go/orchestration v1.3.0/go.mod h1:Sj5tq/JpWiB//X/q3Ngwdl5K7B7Y0KZ7bfv0wL6fqVA= +cloud.google.com/go/orchestration v1.4.0/go.mod h1:6W5NLFWs2TlniBphAViZEVhrXRSMgUGDfW7vrWKvsBk= +cloud.google.com/go/orchestration v1.6.0/go.mod h1:M62Bevp7pkxStDfFfTuCOaXgaaqRAga1yKyoMtEoWPQ= +cloud.google.com/go/orgpolicy v1.4.0/go.mod h1:xrSLIV4RePWmP9P3tBl8S93lTmlAxjm06NSm2UTmKvE= +cloud.google.com/go/orgpolicy v1.5.0/go.mod h1:hZEc5q3wzwXJaKrsx5+Ewg0u1LxJ51nNFlext7Tanwc= +cloud.google.com/go/orgpolicy v1.10.0/go.mod h1:w1fo8b7rRqlXlIJbVhOMPrwVljyuW5mqssvBtU18ONc= cloud.google.com/go/osconfig v1.7.0/go.mod h1:oVHeCeZELfJP7XLxcBGTMBvRO+1nQ5tFG9VQTmYS2Fs= cloud.google.com/go/osconfig v1.8.0/go.mod h1:EQqZLu5w5XA7eKizepumcvWx+m8mJUhEwiPqWiZeEdg= +cloud.google.com/go/osconfig v1.9.0/go.mod h1:Yx+IeIZJ3bdWmzbQU4fxNl8xsZ4amB+dygAwFPlvnNo= +cloud.google.com/go/osconfig v1.10.0/go.mod h1:uMhCzqC5I8zfD9zDEAfvgVhDS8oIjySWh+l4WK6GnWw= +cloud.google.com/go/osconfig v1.11.0/go.mod h1:aDICxrur2ogRd9zY5ytBLV89KEgT2MKB2L/n6x1ooPw= cloud.google.com/go/oslogin v1.4.0/go.mod h1:YdgMXWRaElXz/lDk1Na6Fh5orF7gvmJ0FGLIs9LId4E= cloud.google.com/go/oslogin v1.5.0/go.mod h1:D260Qj11W2qx/HVF29zBg+0fd6YCSjSqLUkY/qEenQU= +cloud.google.com/go/oslogin v1.6.0/go.mod h1:zOJ1O3+dTU8WPlGEkFSh7qeHPPSoxrcMbbK1Nm2iX70= +cloud.google.com/go/oslogin v1.7.0/go.mod h1:e04SN0xO1UNJ1M5GP0vzVBFicIe4O53FOfcixIqTyXo= +cloud.google.com/go/oslogin v1.9.0/go.mod h1:HNavntnH8nzrn8JCTT5fj18FuJLFJc4NaZJtBnQtKFs= cloud.google.com/go/phishingprotection v0.5.0/go.mod h1:Y3HZknsK9bc9dMi+oE8Bim0lczMU6hrX0UpADuMefr0= cloud.google.com/go/phishingprotection v0.6.0/go.mod h1:9Y3LBLgy0kDTcYET8ZH3bq/7qni15yVUoAxiFxnlSUA= +cloud.google.com/go/phishingprotection v0.7.0/go.mod h1:8qJI4QKHoda/sb/7/YmMQ2omRLSLYSu9bU0EKCNI+Lk= +cloud.google.com/go/policytroubleshooter v1.3.0/go.mod h1:qy0+VwANja+kKrjlQuOzmlvscn4RNsAc0e15GGqfMxg= +cloud.google.com/go/policytroubleshooter v1.4.0/go.mod h1:DZT4BcRw3QoO8ota9xw/LKtPa8lKeCByYeKTIf/vxdE= +cloud.google.com/go/policytroubleshooter v1.5.0/go.mod h1:Rz1WfV+1oIpPdN2VvvuboLVRsB1Hclg3CKQ53j9l8vw= +cloud.google.com/go/policytroubleshooter v1.6.0/go.mod h1:zYqaPTsmfvpjm5ULxAyD/lINQxJ0DDsnWOP/GZ7xzBc= cloud.google.com/go/privatecatalog v0.5.0/go.mod h1:XgosMUvvPyxDjAVNDYxJ7wBW8//hLDDYmnsNcMGq1K0= cloud.google.com/go/privatecatalog v0.6.0/go.mod h1:i/fbkZR0hLN29eEWiiwue8Pb+GforiEIBnV9yrRUOKI= +cloud.google.com/go/privatecatalog v0.7.0/go.mod h1:2s5ssIFO69F5csTXcwBP7NPFTZvps26xGzvQ2PQaBYg= +cloud.google.com/go/privatecatalog v0.8.0/go.mod h1:nQ6pfaegeDAq/Q5lrfCQzQLhubPiZhSaNhIgfJlnIXs= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/pubsub v1.26.0/go.mod h1:QgBH3U/jdJy/ftjPhTkyXNj543Tin1pRYcdcPRnFIRI= +cloud.google.com/go/pubsub v1.27.1/go.mod h1:hQN39ymbV9geqBnfQq6Xf63yNhUAhv9CZhzp5O6qsW0= +cloud.google.com/go/pubsub v1.28.0/go.mod h1:vuXFpwaVoIPQMGXqRyUQigu/AX1S3IWugR9xznmcXX8= +cloud.google.com/go/pubsub v1.30.0/go.mod h1:qWi1OPS0B+b5L+Sg6Gmc9zD1Y+HaM0MdUr7LsupY1P4= +cloud.google.com/go/pubsublite v1.5.0/go.mod h1:xapqNQ1CuLfGi23Yda/9l4bBCKz/wC3KIJ5gKcxveZg= +cloud.google.com/go/pubsublite v1.6.0/go.mod h1:1eFCS0U11xlOuMFV/0iBqw3zP12kddMeCbj/F3FSj9k= +cloud.google.com/go/pubsublite v1.7.0/go.mod h1:8hVMwRXfDfvGm3fahVbtDbiLePT3gpoiJYJY+vxWxVM= cloud.google.com/go/recaptchaenterprise v1.3.1/go.mod h1:OdD+q+y4XGeAlxRaMn1Y7/GveP6zmq76byL6tjPE7d4= cloud.google.com/go/recaptchaenterprise/v2 v2.1.0/go.mod h1:w9yVqajwroDNTfGuhmOjPDN//rZGySaf6PtFVcSCa7o= cloud.google.com/go/recaptchaenterprise/v2 v2.2.0/go.mod h1:/Zu5jisWGeERrd5HnlS3EUGb/D335f9k51B/FVil0jk= cloud.google.com/go/recaptchaenterprise/v2 v2.3.0/go.mod h1:O9LwGCjrhGHBQET5CA7dd5NwwNQUErSgEDit1DLNTdo= +cloud.google.com/go/recaptchaenterprise/v2 v2.4.0/go.mod h1:Am3LHfOuBstrLrNCBrlI5sbwx9LBg3te2N6hGvHn2mE= +cloud.google.com/go/recaptchaenterprise/v2 v2.5.0/go.mod h1:O8LzcHXN3rz0j+LBC91jrwI3R+1ZSZEWrfL7XHgNo9U= +cloud.google.com/go/recaptchaenterprise/v2 v2.6.0/go.mod h1:RPauz9jeLtB3JVzg6nCbe12qNoaa8pXc4d/YukAmcnA= +cloud.google.com/go/recaptchaenterprise/v2 v2.7.0/go.mod h1:19wVj/fs5RtYtynAPJdDTb69oW0vNHYDBTbB4NvMD9c= cloud.google.com/go/recommendationengine v0.5.0/go.mod h1:E5756pJcVFeVgaQv3WNpImkFP8a+RptV6dDLGPILjvg= cloud.google.com/go/recommendationengine v0.6.0/go.mod h1:08mq2umu9oIqc7tDy8sx+MNJdLG0fUi3vaSVbztHgJ4= +cloud.google.com/go/recommendationengine v0.7.0/go.mod h1:1reUcE3GIu6MeBz/h5xZJqNLuuVjNg1lmWMPyjatzac= cloud.google.com/go/recommender v1.5.0/go.mod h1:jdoeiBIVrJe9gQjwd759ecLJbxCDED4A6p+mqoqDvTg= cloud.google.com/go/recommender v1.6.0/go.mod h1:+yETpm25mcoiECKh9DEScGzIRyDKpZ0cEhWGo+8bo+c= +cloud.google.com/go/recommender v1.7.0/go.mod h1:XLHs/W+T8olwlGOgfQenXBTbIseGclClff6lhFVe9Bs= +cloud.google.com/go/recommender v1.8.0/go.mod h1:PkjXrTT05BFKwxaUxQmtIlrtj0kph108r02ZZQ5FE70= +cloud.google.com/go/recommender v1.9.0/go.mod h1:PnSsnZY7q+VL1uax2JWkt/UegHssxjUVVCrX52CuEmQ= cloud.google.com/go/redis v1.7.0/go.mod h1:V3x5Jq1jzUcg+UNsRvdmsfuFnit1cfe3Z/PGyq/lm4Y= cloud.google.com/go/redis v1.8.0/go.mod h1:Fm2szCDavWzBk2cDKxrkmWBqoCiL1+Ctwq7EyqBCA/A= +cloud.google.com/go/redis v1.9.0/go.mod h1:HMYQuajvb2D0LvMgZmLDZW8V5aOC/WxstZHiy4g8OiA= +cloud.google.com/go/redis v1.10.0/go.mod h1:ThJf3mMBQtW18JzGgh41/Wld6vnDDc/F/F35UolRZPM= +cloud.google.com/go/redis v1.11.0/go.mod h1:/X6eicana+BWcUda5PpwZC48o37SiFVTFSs0fWAJ7uQ= +cloud.google.com/go/resourcemanager v1.3.0/go.mod h1:bAtrTjZQFJkiWTPDb1WBjzvc6/kifjj4QBYuKCCoqKA= +cloud.google.com/go/resourcemanager v1.4.0/go.mod h1:MwxuzkumyTX7/a3n37gmsT3py7LIXwrShilPh3P1tR0= +cloud.google.com/go/resourcemanager v1.5.0/go.mod h1:eQoXNAiAvCf5PXxWxXjhKQoTMaUSNrEfg+6qdf/wots= +cloud.google.com/go/resourcemanager v1.6.0/go.mod h1:YcpXGRs8fDzcUl1Xw8uOVmI8JEadvhRIkoXXUNVYcVo= +cloud.google.com/go/resourcemanager v1.7.0/go.mod h1:HlD3m6+bwhzj9XCouqmeiGuni95NTrExfhoSrkC/3EI= +cloud.google.com/go/resourcesettings v1.3.0/go.mod h1:lzew8VfESA5DQ8gdlHwMrqZs1S9V87v3oCnKCWoOuQU= +cloud.google.com/go/resourcesettings v1.4.0/go.mod h1:ldiH9IJpcrlC3VSuCGvjR5of/ezRrOxFtpJoJo5SmXg= +cloud.google.com/go/resourcesettings v1.5.0/go.mod h1:+xJF7QSG6undsQDfsCJyqWXyBwUoJLhetkRMDRnIoXA= cloud.google.com/go/retail v1.8.0/go.mod h1:QblKS8waDmNUhghY2TI9O3JLlFk8jybHeV4BF19FrE4= cloud.google.com/go/retail v1.9.0/go.mod h1:g6jb6mKuCS1QKnH/dpu7isX253absFl6iE92nHwlBUY= +cloud.google.com/go/retail v1.10.0/go.mod h1:2gDk9HsL4HMS4oZwz6daui2/jmKvqShXKQuB2RZ+cCc= +cloud.google.com/go/retail v1.11.0/go.mod h1:MBLk1NaWPmh6iVFSz9MeKG/Psyd7TAgm6y/9L2B4x9Y= +cloud.google.com/go/retail v1.12.0/go.mod h1:UMkelN/0Z8XvKymXFbD4EhFJlYKRx1FGhQkVPU5kF14= +cloud.google.com/go/run v0.2.0/go.mod h1:CNtKsTA1sDcnqqIFR3Pb5Tq0usWxJJvsWOCPldRU3Do= +cloud.google.com/go/run v0.3.0/go.mod h1:TuyY1+taHxTjrD0ZFk2iAR+xyOXEA0ztb7U3UNA0zBo= +cloud.google.com/go/run v0.8.0/go.mod h1:VniEnuBwqjigv0A7ONfQUaEItaiCRVujlMqerPPiktM= +cloud.google.com/go/run v0.9.0/go.mod h1:Wwu+/vvg8Y+JUApMwEDfVfhetv30hCG4ZwDR/IXl2Qg= cloud.google.com/go/scheduler v1.4.0/go.mod h1:drcJBmxF3aqZJRhmkHQ9b3uSSpQoltBPGPxGAWROx6s= cloud.google.com/go/scheduler v1.5.0/go.mod h1:ri073ym49NW3AfT6DZi21vLZrG07GXr5p3H1KxN5QlI= +cloud.google.com/go/scheduler v1.6.0/go.mod h1:SgeKVM7MIwPn3BqtcBntpLyrIJftQISRrYB5ZtT+KOk= +cloud.google.com/go/scheduler v1.7.0/go.mod h1:jyCiBqWW956uBjjPMMuX09n3x37mtyPJegEWKxRsn44= +cloud.google.com/go/scheduler v1.8.0/go.mod h1:TCET+Y5Gp1YgHT8py4nlg2Sew8nUHMqcpousDgXJVQc= +cloud.google.com/go/scheduler v1.9.0/go.mod h1:yexg5t+KSmqu+njTIh3b7oYPheFtBWGcbVUYF1GGMIc= cloud.google.com/go/secretmanager v1.6.0/go.mod h1:awVa/OXF6IiyaU1wQ34inzQNc4ISIDIrId8qE5QGgKA= +cloud.google.com/go/secretmanager v1.8.0/go.mod h1:hnVgi/bN5MYHd3Gt0SPuTPPp5ENina1/LxM+2W9U9J4= +cloud.google.com/go/secretmanager v1.9.0/go.mod h1:b71qH2l1yHmWQHt9LC80akm86mX8AL6X1MA01dW8ht4= +cloud.google.com/go/secretmanager v1.10.0/go.mod h1:MfnrdvKMPNra9aZtQFvBcvRU54hbPD8/HayQdlUgJpU= cloud.google.com/go/security v1.5.0/go.mod h1:lgxGdyOKKjHL4YG3/YwIL2zLqMFCKs0UbQwgyZmfJl4= cloud.google.com/go/security v1.7.0/go.mod h1:mZklORHl6Bg7CNnnjLH//0UlAlaXqiG7Lb9PsPXLfD0= cloud.google.com/go/security v1.8.0/go.mod h1:hAQOwgmaHhztFhiQ41CjDODdWP0+AE1B3sX4OFlq+GU= +cloud.google.com/go/security v1.9.0/go.mod h1:6Ta1bO8LXI89nZnmnsZGp9lVoVWXqsVbIq/t9dzI+2Q= +cloud.google.com/go/security v1.10.0/go.mod h1:QtOMZByJVlibUT2h9afNDWRZ1G96gVywH8T5GUSb9IA= +cloud.google.com/go/security v1.12.0/go.mod h1:rV6EhrpbNHrrxqlvW0BWAIawFWq3X90SduMJdFwtLB8= +cloud.google.com/go/security v1.13.0/go.mod h1:Q1Nvxl1PAgmeW0y3HTt54JYIvUdtcpYKVfIB8AOMZ+0= cloud.google.com/go/securitycenter v1.13.0/go.mod h1:cv5qNAqjY84FCN6Y9z28WlkKXyWsgLO832YiWwkCWcU= cloud.google.com/go/securitycenter v1.14.0/go.mod h1:gZLAhtyKv85n52XYWt6RmeBdydyxfPeTrpToDPw4Auc= +cloud.google.com/go/securitycenter v1.15.0/go.mod h1:PeKJ0t8MoFmmXLXWm41JidyzI3PJjd8sXWaVqg43WWk= +cloud.google.com/go/securitycenter v1.16.0/go.mod h1:Q9GMaLQFUD+5ZTabrbujNWLtSLZIZF7SAR0wWECrjdk= +cloud.google.com/go/securitycenter v1.18.1/go.mod h1:0/25gAzCM/9OL9vVx4ChPeM/+DlfGQJDwBy/UC8AKK0= +cloud.google.com/go/securitycenter v1.19.0/go.mod h1:LVLmSg8ZkkyaNy4u7HCIshAngSQ8EcIRREP3xBnyfag= +cloud.google.com/go/servicecontrol v1.4.0/go.mod h1:o0hUSJ1TXJAmi/7fLJAedOovnujSEvjKCAFNXPQ1RaU= +cloud.google.com/go/servicecontrol v1.5.0/go.mod h1:qM0CnXHhyqKVuiZnGKrIurvVImCs8gmqWsDoqe9sU1s= +cloud.google.com/go/servicecontrol v1.10.0/go.mod h1:pQvyvSRh7YzUF2efw7H87V92mxU8FnFDawMClGCNuAA= +cloud.google.com/go/servicecontrol v1.11.0/go.mod h1:kFmTzYzTUIuZs0ycVqRHNaNhgR+UMUpw9n02l/pY+mc= +cloud.google.com/go/servicecontrol v1.11.1/go.mod h1:aSnNNlwEFBY+PWGQ2DoM0JJ/QUXqV5/ZD9DOLB7SnUk= cloud.google.com/go/servicedirectory v1.4.0/go.mod h1:gH1MUaZCgtP7qQiI+F+A+OpeKF/HQWgtAddhTbhL2bs= cloud.google.com/go/servicedirectory v1.5.0/go.mod h1:QMKFL0NUySbpZJ1UZs3oFAmdvVxhhxB6eJ/Vlp73dfg= +cloud.google.com/go/servicedirectory v1.6.0/go.mod h1:pUlbnWsLH9c13yGkxCmfumWEPjsRs1RlmJ4pqiNjVL4= +cloud.google.com/go/servicedirectory v1.7.0/go.mod h1:5p/U5oyvgYGYejufvxhgwjL8UVXjkuw7q5XcG10wx1U= +cloud.google.com/go/servicedirectory v1.8.0/go.mod h1:srXodfhY1GFIPvltunswqXpVxFPpZjf8nkKQT7XcXaY= +cloud.google.com/go/servicedirectory v1.9.0/go.mod h1:29je5JjiygNYlmsGz8k6o+OZ8vd4f//bQLtvzkPPT/s= +cloud.google.com/go/servicemanagement v1.4.0/go.mod h1:d8t8MDbezI7Z2R1O/wu8oTggo3BI2GKYbdG4y/SJTco= +cloud.google.com/go/servicemanagement v1.5.0/go.mod h1:XGaCRe57kfqu4+lRxaFEAuqmjzF0r+gWHjWqKqBvKFo= +cloud.google.com/go/servicemanagement v1.6.0/go.mod h1:aWns7EeeCOtGEX4OvZUWCCJONRZeFKiptqKf1D0l/Jc= +cloud.google.com/go/servicemanagement v1.8.0/go.mod h1:MSS2TDlIEQD/fzsSGfCdJItQveu9NXnUniTrq/L8LK4= +cloud.google.com/go/serviceusage v1.3.0/go.mod h1:Hya1cozXM4SeSKTAgGXgj97GlqUvF5JaoXacR1JTP/E= +cloud.google.com/go/serviceusage v1.4.0/go.mod h1:SB4yxXSaYVuUBYUml6qklyONXNLt83U0Rb+CXyhjEeU= +cloud.google.com/go/serviceusage v1.5.0/go.mod h1:w8U1JvqUqwJNPEOTQjrMHkw3IaIFLoLsPLvsE3xueec= +cloud.google.com/go/serviceusage v1.6.0/go.mod h1:R5wwQcbOWsyuOfbP9tGdAnCAc6B9DRwPG1xtWMDeuPA= +cloud.google.com/go/shell v1.3.0/go.mod h1:VZ9HmRjZBsjLGXusm7K5Q5lzzByZmJHf1d0IWHEN5X4= +cloud.google.com/go/shell v1.4.0/go.mod h1:HDxPzZf3GkDdhExzD/gs8Grqk+dmYcEjGShZgYa9URw= +cloud.google.com/go/shell v1.6.0/go.mod h1:oHO8QACS90luWgxP3N9iZVuEiSF84zNyLytb+qE2f9A= +cloud.google.com/go/spanner v1.41.0/go.mod h1:MLYDBJR/dY4Wt7ZaMIQ7rXOTLjYrmxLE/5ve9vFfWos= +cloud.google.com/go/spanner v1.44.0/go.mod h1:G8XIgYdOK+Fbcpbs7p2fiprDw4CaZX63whnSMLVBxjk= +cloud.google.com/go/spanner v1.45.0/go.mod h1:FIws5LowYz8YAE1J8fOS7DJup8ff7xJeetWEo5REA2M= cloud.google.com/go/speech v1.6.0/go.mod h1:79tcr4FHCimOp56lwC01xnt/WPJZc4v3gzyT7FoBkCM= cloud.google.com/go/speech v1.7.0/go.mod h1:KptqL+BAQIhMsj1kOP2la5DSEEerPDuOP/2mmkhHhZQ= +cloud.google.com/go/speech v1.8.0/go.mod h1:9bYIl1/tjsAnMgKGHKmBZzXKEkGgtU+MpdDPTE9f7y0= +cloud.google.com/go/speech v1.9.0/go.mod h1:xQ0jTcmnRFFM2RfX/U+rk6FQNUF6DQlydUSyoooSpco= +cloud.google.com/go/speech v1.14.1/go.mod h1:gEosVRPJ9waG7zqqnsHpYTOoAS4KouMRLDFMekpJ0J0= +cloud.google.com/go/speech v1.15.0/go.mod h1:y6oH7GhqCaZANH7+Oe0BhgIogsNInLlz542tg3VqeYI= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= @@ -175,88 +543,158 @@ cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3f cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= -cloud.google.com/go/storage v1.30.0 h1:g1yrbxAWOrvg/594228pETWkOi00MLTrOWfh56veU5o= -cloud.google.com/go/storage v1.30.0/go.mod h1:xAVretHSROm1BQX4IIsoVgJqw0LqOyX+I/O2GzRAzdE= +cloud.google.com/go/storage v1.28.1/go.mod h1:Qnisd4CqDdo6BGs2AD5LLnEsmSQ80wQ5ogcBBKhU86Y= +cloud.google.com/go/storage v1.29.0/go.mod h1:4puEjyTKnku6gfKoTfNOU/W+a9JyuVNxjpS5GBrB8h4= +cloud.google.com/go/storage v1.50.0 h1:3TbVkzTooBvnZsk7WaAQfOsNrdoM8QHusXA1cpk6QJs= +cloud.google.com/go/storage v1.50.0/go.mod h1:l7XeiD//vx5lfqE3RavfmU9yvk5Pp0Zhcv482poyafY= +cloud.google.com/go/storagetransfer v1.5.0/go.mod h1:dxNzUopWy7RQevYFHewchb29POFv3/AaBgnhqzqiK0w= +cloud.google.com/go/storagetransfer v1.6.0/go.mod h1:y77xm4CQV/ZhFZH75PLEXY0ROiS7Gh6pSKrM8dJyg6I= +cloud.google.com/go/storagetransfer v1.7.0/go.mod h1:8Giuj1QNb1kfLAiWM1bN6dHzfdlDAVC9rv9abHot2W4= +cloud.google.com/go/storagetransfer v1.8.0/go.mod h1:JpegsHHU1eXg7lMHkvf+KE5XDJ7EQu0GwNJbbVGanEw= cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= +cloud.google.com/go/talent v1.3.0/go.mod h1:CmcxwJ/PKfRgd1pBjQgU6W3YBwiewmUzQYH5HHmSCmM= +cloud.google.com/go/talent v1.4.0/go.mod h1:ezFtAgVuRf8jRsvyE6EwmbTK5LKciD4KVnHuDEFmOOA= +cloud.google.com/go/talent v1.5.0/go.mod h1:G+ODMj9bsasAEJkQSzO2uHQWXHHXUomArjWQQYkqK6c= +cloud.google.com/go/texttospeech v1.4.0/go.mod h1:FX8HQHA6sEpJ7rCMSfXuzBcysDAuWusNNNvN9FELDd8= +cloud.google.com/go/texttospeech v1.5.0/go.mod h1:oKPLhR4n4ZdQqWKURdwxMy0uiTS1xU161C8W57Wkea4= +cloud.google.com/go/texttospeech v1.6.0/go.mod h1:YmwmFT8pj1aBblQOI3TfKmwibnsfvhIBzPXcW4EBovc= +cloud.google.com/go/tpu v1.3.0/go.mod h1:aJIManG0o20tfDQlRIej44FcwGGl/cD0oiRyMKG19IQ= +cloud.google.com/go/tpu v1.4.0/go.mod h1:mjZaX8p0VBgllCzF6wcU2ovUXN9TONFLd7iz227X2Xg= +cloud.google.com/go/tpu v1.5.0/go.mod h1:8zVo1rYDFuW2l4yZVY0R0fb/v44xLh3llq7RuV61fPM= +cloud.google.com/go/trace v1.3.0/go.mod h1:FFUE83d9Ca57C+K8rDl/Ih8LwOzWIV1krKgxg6N0G28= +cloud.google.com/go/trace v1.4.0/go.mod h1:UG0v8UBqzusp+z63o7FK74SdFE+AXpCLdFb1rshXG+Y= +cloud.google.com/go/trace v1.8.0/go.mod h1:zH7vcsbAhklH8hWFig58HvxcxyQbaIqMarMg9hn5ECA= +cloud.google.com/go/trace v1.9.0/go.mod h1:lOQqpE5IaWY0Ixg7/r2SjixMuc6lfTFeO4QGM4dQWOk= +cloud.google.com/go/trace v1.11.3 h1:c+I4YFjxRQjvAhRmSsmjpASUKq88chOX854ied0K/pE= +cloud.google.com/go/trace v1.11.3/go.mod h1:pt7zCYiDSQjC9Y2oqCsh9jF4GStB/hmjrYLsxRR27q8= +cloud.google.com/go/translate v1.3.0/go.mod h1:gzMUwRjvOqj5i69y/LYLd8RrNQk+hOmIXTi9+nb3Djs= +cloud.google.com/go/translate v1.4.0/go.mod h1:06Dn/ppvLD6WvA5Rhdp029IX2Mi3Mn7fpMRLPvXT5Wg= +cloud.google.com/go/translate v1.5.0/go.mod h1:29YDSYveqqpA1CQFD7NQuP49xymq17RXNaUDdc0mNu0= +cloud.google.com/go/translate v1.6.0/go.mod h1:lMGRudH1pu7I3n3PETiOB2507gf3HnfLV8qlkHZEyos= +cloud.google.com/go/translate v1.7.0/go.mod h1:lMGRudH1pu7I3n3PETiOB2507gf3HnfLV8qlkHZEyos= +cloud.google.com/go/video v1.8.0/go.mod h1:sTzKFc0bUSByE8Yoh8X0mn8bMymItVGPfTuUBUyRgxk= +cloud.google.com/go/video v1.9.0/go.mod h1:0RhNKFRF5v92f8dQt0yhaHrEuH95m068JYOvLZYnJSw= +cloud.google.com/go/video v1.12.0/go.mod h1:MLQew95eTuaNDEGriQdcYn0dTwf9oWiA4uYebxM5kdg= +cloud.google.com/go/video v1.13.0/go.mod h1:ulzkYlYgCp15N2AokzKjy7MQ9ejuynOJdf1tR5lGthk= +cloud.google.com/go/video v1.14.0/go.mod h1:SkgaXwT+lIIAKqWAJfktHT/RbgjSuY6DobxEp0C5yTQ= +cloud.google.com/go/video v1.15.0/go.mod h1:SkgaXwT+lIIAKqWAJfktHT/RbgjSuY6DobxEp0C5yTQ= cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= cloud.google.com/go/videointelligence v1.7.0/go.mod h1:k8pI/1wAhjznARtVT9U1llUaFNPh7muw8QyOUpavru4= +cloud.google.com/go/videointelligence v1.8.0/go.mod h1:dIcCn4gVDdS7yte/w+koiXn5dWVplOZkE+xwG9FgK+M= +cloud.google.com/go/videointelligence v1.9.0/go.mod h1:29lVRMPDYHikk3v8EdPSaL8Ku+eMzDljjuvRs105XoU= +cloud.google.com/go/videointelligence v1.10.0/go.mod h1:LHZngX1liVtUhZvi2uNS0VQuOzNi2TkY1OakiuoUOjU= cloud.google.com/go/vision v1.2.0/go.mod h1:SmNwgObm5DpFBme2xpyOyasvBc1aPdjvMk2bBk0tKD0= cloud.google.com/go/vision/v2 v2.2.0/go.mod h1:uCdV4PpN1S0jyCyq8sIM42v2Y6zOLkZs+4R9LrGYwFo= cloud.google.com/go/vision/v2 v2.3.0/go.mod h1:UO61abBx9QRMFkNBbf1D8B1LXdS2cGiiCRx0vSpZoUo= +cloud.google.com/go/vision/v2 v2.4.0/go.mod h1:VtI579ll9RpVTrdKdkMzckdnwMyX2JILb+MhPqRbPsY= +cloud.google.com/go/vision/v2 v2.5.0/go.mod h1:MmaezXOOE+IWa+cS7OhRRLK2cNv1ZL98zhqFFZaaH2E= +cloud.google.com/go/vision/v2 v2.6.0/go.mod h1:158Hes0MvOS9Z/bDMSFpjwsUrZ5fPrdwuyyvKSGAGMY= +cloud.google.com/go/vision/v2 v2.7.0/go.mod h1:H89VysHy21avemp6xcf9b9JvZHVehWbET0uT/bcuY/0= +cloud.google.com/go/vmmigration v1.2.0/go.mod h1:IRf0o7myyWFSmVR1ItrBSFLFD/rJkfDCUTO4vLlJvsE= +cloud.google.com/go/vmmigration v1.3.0/go.mod h1:oGJ6ZgGPQOFdjHuocGcLqX4lc98YQ7Ygq8YQwHh9A7g= +cloud.google.com/go/vmmigration v1.5.0/go.mod h1:E4YQ8q7/4W9gobHjQg4JJSgXXSgY21nA5r8swQV+Xxc= +cloud.google.com/go/vmmigration v1.6.0/go.mod h1:bopQ/g4z+8qXzichC7GW1w2MjbErL54rk3/C843CjfY= +cloud.google.com/go/vmwareengine v0.1.0/go.mod h1:RsdNEf/8UDvKllXhMz5J40XxDrNJNN4sagiox+OI208= +cloud.google.com/go/vmwareengine v0.2.2/go.mod h1:sKdctNJxb3KLZkE/6Oui94iw/xs9PRNC2wnNLXsHvH8= +cloud.google.com/go/vmwareengine v0.3.0/go.mod h1:wvoyMvNWdIzxMYSpH/R7y2h5h3WFkx6d+1TIsP39WGY= +cloud.google.com/go/vpcaccess v1.4.0/go.mod h1:aQHVbTWDYUR1EbTApSVvMq1EnT57ppDmQzZ3imqIk4w= +cloud.google.com/go/vpcaccess v1.5.0/go.mod h1:drmg4HLk9NkZpGfCmZ3Tz0Bwnm2+DKqViEpeEpOq0m8= +cloud.google.com/go/vpcaccess v1.6.0/go.mod h1:wX2ILaNhe7TlVa4vC5xce1bCnqE3AeH27RV31lnmZes= cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xXZmFiHmGE= cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= +cloud.google.com/go/webrisk v1.6.0/go.mod h1:65sW9V9rOosnc9ZY7A7jsy1zoHS5W9IAXv6dGqhMQMc= +cloud.google.com/go/webrisk v1.7.0/go.mod h1:mVMHgEYH0r337nmt1JyLthzMr6YxwN1aAIEc2fTcq7A= +cloud.google.com/go/webrisk v1.8.0/go.mod h1:oJPDuamzHXgUc+b8SiHRcVInZQuybnvEW72PqTc7sSg= +cloud.google.com/go/websecurityscanner v1.3.0/go.mod h1:uImdKm2wyeXQevQJXeh8Uun/Ym1VqworNDlBXQevGMo= +cloud.google.com/go/websecurityscanner v1.4.0/go.mod h1:ebit/Fp0a+FWu5j4JOmJEV8S8CzdTkAS77oDsiSqYWQ= +cloud.google.com/go/websecurityscanner v1.5.0/go.mod h1:Y6xdCPy81yi0SQnDY1xdNTNpfY1oAgXUlcfN3B3eSng= cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= -cosmossdk.io/api v0.4.2 h1:lQBMl4xINnMnBOR/tQLtjlDnR4exr4e6/SfHR8PILE0= -cosmossdk.io/api v0.4.2/go.mod h1:qrVgOp7DIeAXa+Tt5dDjOC47bZCDrwx8ZHxrmy7STNE= -cosmossdk.io/collections v0.2.0 h1:CgMfLtE16+qox3zBYrGh60i4yKV8SeExLnIdOS2sbQs= -cosmossdk.io/collections v0.2.0/go.mod h1:Oc1FK0vlmxJZsgUn9/o3ldE6zNyWKvobVzaLhWknZJE= -cosmossdk.io/core v0.8.0 h1:LcJnu52E1a8f8E317VfQ1xK/RZe+IuhMNQAjnDLh25M= -cosmossdk.io/core v0.8.0/go.mod h1:LF6VLOv2DdCiaHxYVmr0MZcZpaSM9ZgvyrQSYTeg6D0= -cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw= -cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= -cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 h1:BCRz06fvddw7cKGiEGDiSox3qMsjQ97f92K+PDZDHdc= -cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741/go.mod h1:TB05o6YXkZkzsc+6bZFAV5kZRBtoCU9tUkbeMIqEg0w= -cosmossdk.io/log v1.1.0 h1:v0ogPHYeTzPcBTcPR1A3j1hkei4pZama8kz8LKlCMv0= -cosmossdk.io/log v1.1.0/go.mod h1:6zjroETlcDs+mm62gd8Ig7mZ+N+fVOZS91V17H+M4N4= -cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= -cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= -cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c h1:A+FMPW9GtfcPBDQNtFeDFN27h1SAP6OVjnGgPLlYXmI= -cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c/go.mod h1:RbYGvXCbz8uNBCXrwS9Z8SyydeWi+W5x5MZ33muyzMw= -cosmossdk.io/x/tx v0.8.0 h1:gLiGRL/Fy7fs6dd0IX8jOf0PrVr56/SG6XVMGQjyvJU= -cosmossdk.io/x/tx v0.8.0/go.mod h1:T9uEumGNgKU61gJYRv1t3uzQwLnASpJGmSE229HM3xA= -cosmossdk.io/x/upgrade v0.0.0-20230607190716-2877190997a2 h1:84kBxTNfeRkBUhzhiuZdo5uym9B+wffX8ehRpOREucA= -cosmossdk.io/x/upgrade v0.0.0-20230607190716-2877190997a2/go.mod h1:CTz9FMom9siXKVeb9PKhexmqlixRH2xtXfxIuCWqMIM= +cloud.google.com/go/workflows v1.8.0/go.mod h1:ysGhmEajwZxGn1OhGOGKsTXc5PyxOc0vfKf5Af+to4M= +cloud.google.com/go/workflows v1.9.0/go.mod h1:ZGkj1aFIOd9c8Gerkjjq7OW7I5+l6cSvT3ujaO/WwSA= +cloud.google.com/go/workflows v1.10.0/go.mod h1:fZ8LmRmZQWacon9UCX1r/g/DfAXx5VcPALq2CxzdePw= +cosmossdk.io/api v0.7.6 h1:PC20PcXy1xYKH2KU4RMurVoFjjKkCgYRbVAD4PdqUuY= +cosmossdk.io/api v0.7.6/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= +cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= +cosmossdk.io/core v0.11.1 h1:h9WfBey7NAiFfIcUhDVNS503I2P2HdZLebJlUIs8LPA= +cosmossdk.io/core v0.11.1/go.mod h1:OJzxcdC+RPrgGF8NJZR2uoQr56tc7gfBKhiKeDO7hH0= +cosmossdk.io/depinject v1.1.0 h1:wLan7LG35VM7Yo6ov0jId3RHWCGRhe8E8bsuARorl5E= +cosmossdk.io/depinject v1.1.0/go.mod h1:kkI5H9jCGHeKeYWXTqYdruogYrEeWvBQCw1Pj4/eCFI= +cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= +cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= +cosmossdk.io/log v1.5.0 h1:dVdzPJW9kMrnAYyMf1duqacoidB9uZIl+7c6z0mnq0g= +cosmossdk.io/log v1.5.0/go.mod h1:Tr46PUJjiUthlwQ+hxYtUtPn4D/oCZXAkYevBeh5+FI= +cosmossdk.io/math v1.5.0 h1:sbOASxee9Zxdjd6OkzogvBZ25/hP929vdcYcBJQbkLc= +cosmossdk.io/math v1.5.0/go.mod h1:AAwwBmUhqtk2nlku174JwSll+/DepUXW3rWIXN5q+Nw= +cosmossdk.io/store v1.1.1 h1:NA3PioJtWDVU7cHHeyvdva5J/ggyLDkyH0hGHl2804Y= +cosmossdk.io/store v1.1.1/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM= +cosmossdk.io/x/tx v1.0.0-alpha.3 h1:+55/JFH5QRqnFhOI2heH3DKsaNL0RpXcJOQNzUvHiaQ= +cosmossdk.io/x/tx v1.0.0-alpha.3/go.mod h1:h4pQ/j6Gfu8goB1R3Jbl4qY4RjYVNAsoylcleTXdSRg= +cosmossdk.io/x/upgrade v0.1.4 h1:/BWJim24QHoXde8Bc64/2BSEB6W4eTydq0X/2f8+g38= +cosmossdk.io/x/upgrade v0.1.4/go.mod h1:9v0Aj+fs97O+Ztw+tG3/tp5JSlrmT7IcFhAebQHmOPo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= -filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= +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= 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/99designs/keyring v1.2.1 h1:tYLp1ULvO7i3fI5vE21ReQuj99QFSs7lGm0xWyJo87o= -github.com/99designs/keyring v1.2.1/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= -github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= +github.com/99designs/keyring v1.2.2 h1:pZd3neh/EmUzWONb35LxQfvuY7kiSXAq3HQd97+XBn0= +github.com/99designs/keyring v1.2.2/go.mod h1:wes/FrByc8j7lFOAGLGSNEg8f/PaI3cgTBqhFkHUrPk= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= -github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= -github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= -github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= +github.com/DataDog/datadog-go v4.8.3+incompatible h1:fNGaYSuObuQb5nzeTQqowRAd9bpDIRRV4/gUtIBjh8Q= +github.com/DataDog/datadog-go v4.8.3+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= +github.com/DataDog/zstd v1.5.6 h1:LbEglqepa/ipmmQJUDnSsfvA8e8IStVcGaFWDuxvGOY= +github.com/DataDog/zstd v1.5.6/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0 h1:3c8yed4lgqTt+oTQ+JNMDo+F4xprBf+O/il4ZC0nRLw= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0/go.mod h1:obipzmGjfSjam60XLwGfqUkJsfiheAl+TUjG+4yzyPM= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.49.0 h1:o90wcURuxekmXrtxmYWTyNla0+ZEHhud6DI1ZTxd1vI= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.49.0/go.mod h1:6fTWu4m3jocfUZLYF5KsZC1TUfRvEjs7lM4crme/irw= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.49.0 h1:jJKWl98inONJAr/IZrdFQUWcwUO95DLY1XMD1ZIut+g= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.49.0/go.mod h1:l2fIqmwB+FKSfvn3bAD/0i+AXAxhIZjTK2svT/mgUXs= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.49.0 h1:GYUJLfvd++4DMuMhCFLgLXvFwofIxh/qOwoGuS/LTew= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.49.0/go.mod h1:wRbFgBQUVm1YXrvWKofAEmq9HNJTDphbAaJSSX01KUI= +github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= +github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= +github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= 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/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= -github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= -github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c= +github.com/ajstarks/deck v0.0.0-20200831202436-30c9fc6549a9/go.mod h1:JynElWSGnm/4RlzPXRlREEwqTHAN3T56Bv2ITsFT3gY= +github.com/ajstarks/deck/generate v0.0.0-20210309230005-c3f852c02e19/go.mod h1:T13YZdzov6OU0A1+RfKZiZN9ca6VeKdBdyDV+BY97Tk= +github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= +github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/apache/arrow/go/v10 v10.0.1/go.mod h1:YvhnlEePVnBS4+0z3fhPfUy7W1Ikj0Ih0vcRo/gZ1M0= +github.com/apache/arrow/go/v11 v11.0.0/go.mod h1:Eg5OsL5H+e299f7u5ssuXsuHQVEGC4xei5aX110hRiI= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= 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/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= 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/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU= +github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -265,130 +703,148 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= -github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bits-and-blooms/bitset v1.7.0 h1:YjAGVd3XmtK9ktAbX8Zg2g2PwLIMjGREZJHlV4j7NEo= -github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= -github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= -github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= -github.com/bufbuild/protocompile v0.5.1 h1:mixz5lJX4Hiz4FpqFREJHIXLfaLBntfaJv1h+/jS+Qg= +github.com/bgentry/speakeasy v0.2.0 h1:tgObeVOf8WAvtuAX6DhJ4xks4CFNwPDZiqzGqIHE51E= +github.com/bgentry/speakeasy v0.2.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bits-and-blooms/bitset v1.8.0 h1:FD+XqgOZDUxxZ8hzoBFuV9+cGWY9CslN6d5MS5JVb4c= +github.com/bits-and-blooms/bitset v1.8.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= +github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= +github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= +github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= +github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/btcutil v1.1.6 h1:zFL2+c3Lb9gEgqKNzowKUPQNb8jV7v5Oaodi/AYFd6c= +github.com/btcsuite/btcd/btcutil v1.1.6/go.mod h1:9dFymx8HpuLqBnsPELrImQeTQfKBQqzqGbbV3jK55aE= +github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY= +github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE= +github.com/bytedance/sonic v1.12.8 h1:4xYRVRlXIgvSZ4e8iVTlMF5szgpXd4AfvuWgA8I8lgs= +github.com/bytedance/sonic v1.12.8/go.mod h1:uVvFidNmlt9+wa31S1urfwwthTWteBgG0hWuoKAXTx8= +github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= +github.com/bytedance/sonic/loader v0.2.3 h1:yctD0Q3v2NOGfSWPLPvG2ggA2kV6TS6s4wioyEqssH0= +github.com/bytedance/sonic/loader v0.2.3/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= 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= -github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= -github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= +github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= +github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= +github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= 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/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/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI= +github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudwego/base64x v0.1.5 h1:XPciSp1xaq2VCSt6lF0phncD4koWyULpl5bUxbfCyP4= +github.com/cloudwego/base64x v0.1.5/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= +github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= +github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20241223141626-cff3c89139a3 h1:boJj011Hh+874zpIySeApCX4GeOjPl9qhRF3QuIZq+Q= +github.com/cncf/xds/go v0.0.0-20241223141626-cff3c89139a3/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8= +github.com/cockroachdb/apd/v3 v3.2.1 h1:U+8j7t0axsIgvQUqthuNm82HIrYXodOV2iWLWtEaIwg= +github.com/cockroachdb/apd/v3 v3.2.1/go.mod h1:klXJcjp+FffLTHlhIG69tezTDvdP065naDsHzKhYSqc= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= -github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= -github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= -github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/pebble v0.0.0-20230606152911-c4be581b807f h1:qQW3qCVRpjYsV4YNaUOjm6YLeliAD2jpgex9+D9tqU4= -github.com/cockroachdb/pebble v0.0.0-20230606152911-c4be581b807f/go.mod h1:TkdVsGYRqtULUppt2RbC+YaKtTHnHoWa2apfFrSKABw= -github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/cockroachdb/redact v1.1.4 h1:Y0XrVI2FAyofNyGveodTN//qdpPtFKcKTeCBsK3AHAQ= -github.com/cockroachdb/redact v1.1.4/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= +github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8= +github.com/cockroachdb/fifo v0.0.0-20240816210425-c5d0cb0b6fc0 h1:pU88SPhIFid6/k0egdR5V6eALQYq2qbSmukrkgIh/0A= +github.com/cockroachdb/fifo v0.0.0-20240816210425-c5d0cb0b6fc0/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= +github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506 h1:ASDL+UJcILMqgNeV5jiqR4j+sTuvQNHdf2chuKj1M5k= +github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506/go.mod h1:Mw7HqKr2kdtu6aYGn3tPmAftiP3QPX63LdK/zcariIo= +github.com/cockroachdb/pebble v1.1.2 h1:CUh2IPtR4swHlEj48Rhfzw6l/d0qA31fItcIszQVIsA= +github.com/cockroachdb/pebble v1.1.2/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= -github.com/cometbft/cometbft v0.38.0-rc1 h1:ph6smlqX82aH+d72KuxDHqu29M7LyusSp/obfGsGX/w= -github.com/cometbft/cometbft v0.38.0-rc1/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= -github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= -github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= +github.com/cometbft/cometbft v0.38.17 h1:FkrQNbAjiFqXydeAO81FUzriL4Bz0abYxN/eOHrQGOk= +github.com/cometbft/cometbft v0.38.17/go.mod h1:5l0SkgeLRXi6bBfQuevXjKqML1jjfJJlvI1Ulp02/o4= +github.com/cometbft/cometbft-db v0.14.1 h1:SxoamPghqICBAIcGpleHbmoPqy+crij/++eZz3DlerQ= +github.com/cometbft/cometbft-db v0.14.1/go.mod h1:KHP1YghilyGV/xjD5DP3+2hyigWx0WTp9X+0Gnx0RxQ= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= -github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0E= -github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= -github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= -github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230607182757-cfeb10287d61 h1:FmBV5mLQ23Aohuted9rOaklAiTHD1WasYGSbwMWoM+A= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230607182757-cfeb10287d61/go.mod h1:/gEylJiGxJatYuGnb+WGnj5jNQ/ysxLZZNqwtoGFJyA= +github.com/cosmos/cosmos-db v1.1.1 h1:FezFSU37AlBC8S98NlSagL76oqBRWq/prTPvFcEJNCM= +github.com/cosmos/cosmos-db v1.1.1/go.mod h1:AghjcIPqdhSLP/2Z0yha5xPH3nLnskz81pBx3tcVSAw= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= +github.com/cosmos/cosmos-sdk v0.50.13 h1:xQ32hhzVy7agEe7behMdZN0ezWhPss3KoLZsF9KoBnw= +github.com/cosmos/cosmos-sdk v0.50.13/go.mod h1:hrWEFMU1eoXqLJeE6VVESpJDQH67FS1nnMrQIjO2daw= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoKuI= -github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= -github.com/cosmos/iavl v1.0.0-beta.2 h1:XOsIM80Yyml/KifCXEYOy9tWCXwMAbLa91n6pReW07Y= -github.com/cosmos/iavl v1.0.0-beta.2/go.mod h1:EA97dJ07TBktRlG/iGzK6g1eCXNj1q3MGoFYkVzrwHE= -github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= -github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= -github.com/cosmos/ledger-cosmos-go v0.13.0 h1:ex0CvCxToSR7j5WjrghPu2Bu9sSXKikjnVvUryNnx4s= -github.com/cosmos/ledger-cosmos-go v0.13.0/go.mod h1:ZcqYgnfNJ6lAXe4HPtWgarNEY+B74i+2/8MhZw4ziiI= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= +github.com/cosmos/iavl v1.2.2 h1:qHhKW3I70w+04g5KdsdVSHRbFLgt3yY3qTMd4Xa4rC8= +github.com/cosmos/iavl v1.2.2/go.mod h1:GiM43q0pB+uG53mLxLDzimxM9l/5N9UuSY3/D0huuVw= +github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= +github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= +github.com/cosmos/ledger-cosmos-go v0.14.0 h1:WfCHricT3rPbkPSVKRH+L4fQGKYHuGOK9Edpel8TYpE= +github.com/cosmos/ledger-cosmos-go v0.14.0/go.mod h1:E07xCWSBl3mTGofZ2QnL4cIUzMbbGVyik84QYKbX3RA= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= -github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= -github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= -github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= +github.com/danieljoos/wincred v1.2.1 h1:dl9cBrupW8+r5250DYkYxocLeZ1Y4vB1kxgtjxw8GQs= +github.com/danieljoos/wincred v1.2.1/go.mod h1:uGaFL9fDn3OLTvzCGulzE+SzjEe5NGlh5FdCcyfPwps= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= -github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= -github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= -github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= -github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= +github.com/dgraph-io/badger/v4 v4.2.0 h1:kJrlajbXXL9DFTNuhhu9yCx7JJa4qpYWxtE8BzuWsEs= +github.com/dgraph-io/badger/v4 v4.2.0/go.mod h1:qfCqhPoWDFJRx1gp5QwwyGo8xk1lbHUxvK9nK0OGAak= github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= +github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= 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/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= -github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= +github.com/dvsekhvalnov/jose2go v1.7.0 h1:bnQc8+GMnidJZA8zc6lLEAb4xNrIqHwO+9TzqvtQZPo= +github.com/dvsekhvalnov/jose2go v1.7.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= -github.com/emicklei/dot v1.4.2 h1:UbK6gX4yvrpHKlxuUQicwoAis4zl8Dzwit9SnbBAXWw= -github.com/emicklei/dot v1.4.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= +github.com/emicklei/dot v1.6.2 h1:08GN+DD79cy/tzN6uLCT84+2Wk9u+wvqP+Hkx/dIR8A= +github.com/emicklei/dot v1.6.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -399,82 +855,92 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.m github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= +github.com/envoyproxy/go-control-plane v0.10.3/go.mod h1:fJJn/j26vwOu972OllsvAgJJM//w9BV6Fxbg2LuVd34= +github.com/envoyproxy/go-control-plane v0.11.1-0.20230524094728-9239064ad72f/go.mod h1:sfYdkwUW4BA3PbKjySwjJy+O4Pu0h62rlqCMHNk+K+Q= +github.com/envoyproxy/go-control-plane v0.13.4 h1:zEqyPVyku6IvWCFwux4x9RxkLOMUL+1vC9xUFv5l2/M= +github.com/envoyproxy/go-control-plane v0.13.4/go.mod h1:kDfuBlDVsSj2MjrLEtRWtHlsWIFcGyB2RMO44Dc5GZA= +github.com/envoyproxy/go-control-plane/envoy v1.32.4 h1:jb83lalDRZSpPWW2Z7Mck/8kXZ5CQAFYVjQcdVIr83A= +github.com/envoyproxy/go-control-plane/envoy v1.32.4/go.mod h1:Gzjc5k8JcJswLjAx1Zm+wSYE20UrLtt7JZMWiWQXQEw= +github.com/envoyproxy/go-control-plane/ratelimit v0.1.0 h1:/G9QYbddjL25KvtKTv3an9lx6VBE2cnb8wp1vEGNYGI= +github.com/envoyproxy/go-control-plane/ratelimit v0.1.0/go.mod h1:Wk+tMFAFbCXaJPzVVHnPgRKdUdwW/KdbRt94AzgRee4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= -github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= -github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= -github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= -github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= +github.com/envoyproxy/protoc-gen-validate v0.6.7/go.mod h1:dyJXwwfPK2VSqiB9Klm1J6romD608Ba7Hij42vrOBCo= +github.com/envoyproxy/protoc-gen-validate v0.9.1/go.mod h1:OKNgG7TCp5pF4d6XftA0++PMirau2/yoOwVac3AbF2w= +github.com/envoyproxy/protoc-gen-validate v0.10.1/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss= +github.com/envoyproxy/protoc-gen-validate v1.2.1 h1:DEo3O99U8j4hBFwbJfrz9VtgcDfUKS7KJ7spH3d86P8= +github.com/envoyproxy/protoc-gen-validate v1.2.1/go.mod h1:d/C80l/jxXLdfEIhX1W2TmLfsJ31lvEjwamM4DxlWXU= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= -github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= -github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= +github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= +github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= -github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= -github.com/getsentry/sentry-go v0.21.0 h1:c9l5F1nPF30JIppulk4veau90PK6Smu3abgVtVQWon4= -github.com/getsentry/sentry-go v0.21.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= +github.com/getsentry/sentry-go v0.30.0 h1:lWUwDnY7sKHaVIoZ9wYqRHJ5iEmoc0pqcRqFkosKzBo= +github.com/getsentry/sentry-go v0.30.0/go.mod h1:WU9B9/1/sHDqeV8T+3VwwbjeR5MSXs/6aqG3mqZrezA= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= -github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= -github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= -github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= +github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g= +github.com/go-fonts/latin-modern v0.2.0/go.mod h1:rQVLdDMK+mK1xscDwsqM5J8U2jrRa3T0ecnM9pNujks= +github.com/go-fonts/liberation v0.1.1/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= +github.com/go-fonts/liberation v0.2.0/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= +github.com/go-fonts/stix v0.1.0/go.mod h1:w/c1f0ldAUlJmLBvlbkvVXLAD+tAMqobIIQpmnUIzUY= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= -github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= -github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= +github.com/go-kit/kit v0.13.0 h1:OoneCcHKHQ03LfBpoQCUfCluwd2Vt3ohz+kvbJneZAU= +github.com/go-kit/kit v0.13.0/go.mod h1:phqEHMMUbyrCFCTgH48JueqrM3md2HcAZ8N3XE4FKDg= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= +github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07/go.mod h1:CO1AlKB2CSIqUrmQPqA0gdRIlnLEY0gK5JGjh37zN5U= +github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81/go.mod h1:SX0U8uGpxhq9o2S/CELCSUxEWWAuoCUcVCQWv7G2OCk= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +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-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= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= -github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= -github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= -github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= -github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= +github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= -github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= 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= @@ -485,17 +951,19 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV 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/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= -github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= +github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= +github.com/golang/glog v1.2.4 h1:CNNw5U8lSiiBk7druxtSHHTsRWcxKoac6kZKm2peBBc= +github.com/golang/glog v1.2.4/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 h1:f+oWsMOmNPc8JmEHVZIycC7hBoQxHH9pNKQORJNozsQ= +github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8/go.mod h1:wcDNUvekVysuuOpQKo3191zZyTpiI6se1N1ULghS0sw= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= @@ -524,17 +992,20 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -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/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= +github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= +github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= +github.com/google/flatbuffers v24.3.25+incompatible h1:CX395cjN9Kke9mmalRoL3d81AtFUxJM+yDthflgJGkI= +github.com/google/flatbuffers v24.3.25+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 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= @@ -549,19 +1020,23 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= -github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= +github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/martian/v3 v3.3.3 h1:DIhPTQrbPkgs2yJYdXU/eNACCG5DVQjySNRNlflZ9Fc= +github.com/google/martian/v3 v3.3.3/go.mod h1:iEPrYcgCF7jA9OtScMFQyAlZZ4YXTKEtJ1E6RWzmBA0= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= +github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= @@ -579,17 +1054,20 @@ github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/s2a-go v0.1.3 h1:FAgZmpLl/SXurPEZyCMPBIiiYeTbqfjlbdnCNTAkbGE= -github.com/google/s2a-go v0.1.3/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= +github.com/google/s2a-go v0.1.9 h1:LGD7gtMgezd8a/Xak7mEWL0PjoTQFvpRudN895yqKW0= +github.com/google/s2a-go v0.1.9/go.mod h1:YA0Ei2ZQL3acow2O62kdp9UlnvMmU7kA6Eutn0dXayM= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= -github.com/googleapis/enterprise-certificate-proxy v0.2.3 h1:yk9/cqRKtT9wXZSsRH9aurXEpJX+U6FLtpYTdC3R06k= +github.com/googleapis/enterprise-certificate-proxy v0.2.1/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= +github.com/googleapis/enterprise-certificate-proxy v0.3.4 h1:XYIDZApgAnrN1c855gTgghdIA6Stxb52D5RnLI1SLyw= +github.com/googleapis/enterprise-certificate-proxy v0.3.4/go.mod h1:YKe7cfqYXjKGpGvmSg28/fFvhNzinZQm8DGnaburhGA= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= @@ -599,22 +1077,24 @@ github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99 github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= -github.com/googleapis/gax-go/v2 v2.8.0 h1:UBtEZqx1bjXtOQ5BVTkuYghXrr3N4V123VKJK67vJZc= -github.com/googleapis/gax-go/v2 v2.8.0/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= +github.com/googleapis/gax-go/v2 v2.7.0/go.mod h1:TEop28CZZQ2y+c0VxMUmu1lV+fQx57QpBWsYpwqHJx8= +github.com/googleapis/gax-go/v2 v2.7.1/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= +github.com/googleapis/gax-go/v2 v2.14.1 h1:hb0FFeiPaQskmvakKu5EbCbpntQn48jyHuvrkurSS/Q= +github.com/googleapis/gax-go/v2 v2.14.1/go.mod h1:Hb/NubMaVM88SrNkvl8X/o8XWwDJEPqouaLeN2IUxoA= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= -github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= +github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE= +github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= @@ -623,6 +1103,8 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgf github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w= 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/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= @@ -632,17 +1114,19 @@ github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-getter v1.7.1 h1:SWiSWN/42qdpR0MdhaOc/bLR48PLuP1ZQtYLRlM69uY= -github.com/hashicorp/go-getter v1.7.1/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= -github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= -github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-getter v1.7.7 h1:vvjtrrTFctNCxytDWukhMOHYXn+UQVbtgkbE3P7UCe0= +github.com/hashicorp/go-getter v1.7.7/go.mod h1:2c6CboOEb9jG6YvmC9xdD+tyAFsrUaJPedwXDGr0TM4= +github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= +github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-metrics v0.5.4 h1:8mmPiIJkTPPEbAiV97IxdAGNdRdaWwVap1BU6elejKY= +github.com/hashicorp/go-metrics v0.5.4/go.mod h1:CG5yz4NZ/AI/aQt9Ucm/vdBnbh7fvmv4lxZ350i+QQI= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-plugin v1.4.10 h1:xUbmA4jC6Dq163/fWcp8P3JuHilrHHMLNRxzGQJ9hNk= -github.com/hashicorp/go-plugin v1.4.10/go.mod h1:6/1TEzT0eQznvI/gV2CM29DLSkAK/e58mUWKVsPaph0= +github.com/hashicorp/go-plugin v1.6.2 h1:zdGAEd0V1lCaU0u+MxWQhtSDQmahpkwOun8U8EiRVog= +github.com/hashicorp/go-plugin v1.6.2/go.mod h1:CkgLQ5CZqNmdL9U9JzM532t8ZiYQ35+pj3b1FD37R0Q= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= @@ -653,47 +1137,43 @@ github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= +github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -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/hashicorp/yamux v0.1.2 h1:XtB8kyFOyHXYVFnwT5C3+Bdo8gArse7j2AQ0DA0Uey8= +github.com/hashicorp/yamux v0.1.2/go.mod h1:C+zze2n6e/7wshOZep2A70/aQU6QBRWJO/G6FT1wIns= +github.com/hdevalence/ed25519consensus v0.2.0 h1:37ICyZqdyj0lAZ8P4D1d1id3HqbbG1N3iBb1Tb4rdcU= +github.com/hdevalence/ed25519consensus v0.2.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= 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= -github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw= -github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= +github.com/huandu/skiplist v1.2.1 h1:dTi93MgjwErA/8idWTzIw4Y1kZsMWx35fmI2c8Rij7w= +github.com/huandu/skiplist v1.2.1/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= -github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= -github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= +github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= -github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= -github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= -github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= -github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= -github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= +github.com/jhump/protoreflect v1.15.3 h1:6SFRuqU45u9hIZPJAoZ8c28T3nK64BNdp9w6jFonzls= +github.com/jhump/protoreflect v1.15.3/go.mod h1:4ORHmSBmlCW8fh3xHmJMGyul1zNqZK4Elxc8qKP+p1k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= 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= @@ -708,36 +1188,36 @@ github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= 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/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= -github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= -github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= -github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= -github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= +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/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= +github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI= -github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= +github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.9 h1:66ze0taIn2H33fBvCkXuv9BmCwDfafmiIVpKV9kKGuY= +github.com/klauspost/cpuid/v2 v2.2.9/go.mod h1:rqkxqrZ1EhYM9G+hXH7YdowN5R5RGN6NK4QwQ3WMXF8= +github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= @@ -745,50 +1225,43 @@ 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.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= -github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= -github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= -github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.0 h1:H4L/LhP7GOMf1j17oQAElHgVlbEje2h14A8Tz9cM2BE= -github.com/linxGnu/grocksdb v1.8.0/go.mod h1:09CeBborffXhXdNpEcOeZrLKEnRtrZFEpFdPNI9Zjjg= +github.com/linxGnu/grocksdb v1.9.7 h1:Bp2r1Yti/IXxEobZZnDooXAui/Q+5gVqgQMenLWyDUw= +github.com/linxGnu/grocksdb v1.9.7/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= +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= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= -github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/magiconair/properties v1.8.9 h1:nWcCbLq1N2v/cpNsy5WvQ37Fb+YElfq20WJ/a8RkpQM= +github.com/magiconair/properties v1.8.9/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= +github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.8/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= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= 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-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= +github.com/mattn/go-sqlite3 v1.14.14/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= -github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= +github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY= +github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE= +github.com/minio/highwayhash v1.0.3 h1:kbnuUMoHYyVl7szWjSxJnxw11k2U709jqFPPmIUyD6Q= +github.com/minio/highwayhash v1.0.3/go.mod h1:GGYsuwP/fPD6Y9hMiXuapVvlIUEhFhMTh0rxU3ik1LQ= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= @@ -800,17 +1273,14 @@ github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS4 github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/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= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= 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/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -824,10 +1294,11 @@ github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce h1:/pEpMk55wH0X+E5zedGEMOdLuWmV8P4+4W3+LZaM6kg= -github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= +github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY= +github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a h1:dlRvE5fWabOchtH7znfiFCcOvmIYgOeAS5ifBXBlh9Q= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= @@ -835,7 +1306,6 @@ github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DV github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= @@ -847,6 +1317,7 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/onsi/gomega v1.26.0 h1:03cDLK28U6hWvCAns6NeydX3zIm4SF3ci69ulidS32Q= +github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= @@ -856,23 +1327,26 @@ github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxS github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/otiai10/copy v1.11.0 h1:OKBD80J/mLBrwnzXqGtFCzprFSGioo30JcmR4APsNwc= -github.com/otiai10/copy v1.11.0/go.mod h1:rSaLseMUsZFFbsFGc7wCJnnkTAvdc5L6VWxPE4308Ww= -github.com/otiai10/mint v1.5.1 h1:XaPLeE+9vGbuyEHem1JNk3bYc7KKqyI/na0/mLd/Kks= +github.com/otiai10/copy v1.14.1 h1:5/7E6qsUMBaH5AnQ0sSLzzTg1oTECmcCmT6lvF45Na8= +github.com/otiai10/copy v1.14.1/go.mod h1:oQwrEDDOci3IM8dJF0d8+jnbfPDllW6vUjNc3DoZm9I= +github.com/otiai10/mint v1.6.3 h1:87qsV/aw1F5as1eH1zS/yqHY85ANKVMgkDrf9rcxbQs= +github.com/otiai10/mint v1.6.3/go.mod h1:MJm72SBthJjz8qhefc4z1PYEieWmy8Bku7CjcAqyUSM= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= -github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= +github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= +github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= -github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761 h1:W04oB3d0J01W5jgYRGKsV8LCM6g9EkCvPkZcmFuy0OE= -github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 h1:Dx7Ovyv/SFnMFw3fD4oEoeorXc6saIiQ23LrGLth0Gw= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2dXMnm1mY= +github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= +github.com/phpdave11/gofpdi v1.0.13/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= @@ -881,9 +1355,13 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= @@ -891,61 +1369,64 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.15.1 h1:8tXpTmJbyH5lydzFPoxSIJ0J46jdh3tylbvM1xCv0LI= -github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= +github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= +github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= -github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= -github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io= +github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= -github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= 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/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= 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= -github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= -github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.29.1 h1:cO+d60CHkknCbvzEWxP0S9K6KqyTjrCNUy1LdQLCGPc= -github.com/rs/zerolog v1.29.1/go.mod h1:Le6ESbR7hc+DP6Lt1THiV8CQSdkkNrd3R0XbEgp3ZBU= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= +github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= +github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/locafero v0.7.0 h1:5MqpDsTGNDhY8sGp0Aowyf0qKsPrhewaLSsFaodPcyo= +github.com/sagikazarmark/locafero v0.7.0/go.mod h1:2za3Cg5rMaTMoG/2Ulr9AwtFaIppKXTRYnozin4aB5k= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -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/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= +github.com/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb2NsU= +github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -955,37 +1436,34 @@ github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1 github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= -github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= -github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= -github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= +github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= +github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= +github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= +github.com/spf13/afero v1.12.0 h1:UcOPyRBYczmFn6yvphxkn9ZEOY65cpwGKb5mL36mrqs= +github.com/spf13/afero v1.12.0/go.mod h1:ZTlWwG4/ahT8W7T0WQ5uYmjI9duaLQGy3Q2OAl4sk/4= +github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= +github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo= +github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= -github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= +github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= +github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.20.0 h1:zrxIyR3RQIOsarIrgL8+sAvALXul9jeEPa06Y0Ph6vY= +github.com/spf13/viper v1.20.0/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -997,59 +1475,44 @@ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1F github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= -github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +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.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= -github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= +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/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= +github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= -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/ulikunitz/xz v0.5.12 h1:37Nm15o69RwBkXM0J6A5OlE67RZTfzUxTj8fB3dfcsc= +github.com/ulikunitz/xz v0.5.12/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= -github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= -github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= -github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= -github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= -github.com/zondax/ledger-go v0.14.1 h1:Pip65OOl4iJ84WTpA4BKChvOufMhhbxED3BaihoZN4c= -github.com/zondax/ledger-go v0.14.1/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2feOQv8K320= +github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= +github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= +github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= +github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= +github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= +github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= -go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= +go.etcd.io/bbolt v1.4.0-alpha.1 h1:3yrqQzbRRPFPdOMWS/QQIVxVnzSkAZQYeWlZFv1kbj4= +go.etcd.io/bbolt v1.4.0-alpha.1/go.mod h1:S/Z/Nm3iuOnyO1W4XuFfPci51Gj6F1Hv0z8hisyYYOw= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= @@ -1062,7 +1525,29 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= +go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= +go.opentelemetry.io/contrib/detectors/gcp v1.34.0 h1:JRxssobiPg23otYU5SbWtQC//snGVIM3Tx6QRzlQBao= +go.opentelemetry.io/contrib/detectors/gcp v1.34.0/go.mod h1:cV4BMFcscUR/ckqLkbfQmF0PRsq8w/lMGzdbCSveBHo= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.58.0 h1:PS8wXpbyaDJQ2VDHHncMe9Vct0Zn1fEjpsjrLxGJoSc= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.58.0/go.mod h1:HDBUsEjOuRC0EzKZ1bSaRGZWUBAzo+MhAcUUORSr4D0= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 h1:yd02MEjBdJkG3uabWP9apV+OuWRIXGDuJEUJbOHmCFU= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0/go.mod h1:umTcuxiv1n/s/S6/c2AT/g2CQ7u5C59sHDNmfSwgz7Q= +go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY= +go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0 h1:WDdP9acbMYjbKIyJUhTvtzj601sVJOqgWdUxSdR/Ysc= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0/go.mod h1:BLbf7zbNIONBLPwvFnwNHGj4zge8uTCM/UPIVW1Mq2I= +go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ= +go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE= +go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A= +go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU= +go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk= +go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w= +go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k= +go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= +go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -1071,32 +1556,41 @@ go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= +golang.org/x/arch v0.13.0 h1:KCkqVVV1kGg0X87TFysjCJ8MxtZEIU4Ja/yXGeoECdA= +golang.org/x/arch v0.13.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= -golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= +golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= +golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= +golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs= +golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ= +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= +golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3/go.mod h1:NOZ3BPKG0ec/BKJQgnvsSFpcKLM5xXVWnvZS97DWHgE= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= @@ -1104,10 +1598,22 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/exp v0.0.0-20220827204233-334a2380cb91/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= +golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8 h1:yqrTHse8TCMW1M1ZCP+VAR/l0kKxwaAIqN/il7x4voA= +golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8/go.mod h1:tujkw807nyEEAamNbDrEGzRav+ilXA7PCRAd6xsmwiU= +golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20210216034530-4410531fe030/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= +golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= +golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= +golang.org/x/image v0.0.0-20220302094943-723b81ca9867/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1131,7 +1637,15 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= 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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1143,7 +1657,6 @@ golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -1153,7 +1666,6 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1182,8 +1694,8 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= @@ -1194,10 +1706,21 @@ golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.0.0-20221012135044-0b7e1fb9d458/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= +golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= 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= @@ -1221,10 +1744,14 @@ golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7Lm golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= -golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8= -golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= +golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec= +golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I= +golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= +golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= +golang.org/x/oauth2 v0.25.0 h1:CY4y7XT9v0cRI9oupztF8AgiIu99L/ksR/Xp/6jrZ70= +golang.org/x/oauth2 v0.25.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1238,8 +1765,15 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= +golang.org/x/sync v0.1.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.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= +golang.org/x/sync v0.11.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-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1248,9 +1782,7 @@ golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 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-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1258,9 +1790,7 @@ golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1289,35 +1819,37 @@ golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210304124612-50617c2ba197/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 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-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1337,17 +1869,37 @@ golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= +golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= 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= -golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= +golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= +golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= +golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= +golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= +golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU= +golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s= 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= @@ -1359,24 +1911,37 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= +golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +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.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= +golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= +golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 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= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20220922220347-f3bd1da661af/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +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.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY= +golang.org/x/time v0.9.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-20180828015842-6cd1fcedba52/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-20181221001348-537d06c36207/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= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -1386,6 +1951,7 @@ golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1419,6 +1985,7 @@ golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -1431,7 +1998,13 @@ golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= 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= @@ -1439,8 +2012,15 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= +gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= +gonum.org/v1/gonum v0.9.3/go.mod h1:TZumC3NeyVQskjXqmyWt4S3bINhy7B4eYwW69EbyX+0= +gonum.org/v1/gonum v0.11.0/go.mod h1:fSG4YDCxxUZQJ7rKsQrj0gMOg00Il0Z96/qMA4bVQhA= +gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= +gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= +gonum.org/v1/plot v0.9.0/go.mod h1:3Pcqqmp6RHvJI72kgb8fThyUnav364FOsdDo2aGW5lY= +gonum.org/v1/plot v0.10.1/go.mod h1:VZW5OlhkL1mysU9vaqNHnsy86inf6Ot+jB3r+BczCEo= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= @@ -1489,9 +2069,18 @@ google.golang.org/api v0.95.0/go.mod h1:eADj+UBuxkh5zlrSntJghuNeg8HwQ1w5lTKkuqaE google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= +google.golang.org/api v0.99.0/go.mod h1:1YOf74vkVndF7pG6hIHuINsM7eWwpVTAfNMNiL91A08= google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= -google.golang.org/api v0.122.0 h1:zDobeejm3E7pEG1mNHvdxvjs5XJoCMzyNH+CmwL94Es= -google.golang.org/api v0.122.0/go.mod h1:gcitW0lvnyWjSp9nKxAbdHKIZ6vF4aajGueeslZOyms= +google.golang.org/api v0.102.0/go.mod h1:3VFl6/fzoA+qNuS1N1/VfXY4LjoXN/wzeIp7TweWwGo= +google.golang.org/api v0.103.0/go.mod h1:hGtW6nK1AC+d9si/UBhw8Xli+QMOf6xyNAyJw4qU9w0= +google.golang.org/api v0.106.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= +google.golang.org/api v0.107.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= +google.golang.org/api v0.108.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= +google.golang.org/api v0.110.0/go.mod h1:7FC4Vvx1Mooxh8C5HWjzZHcavuS2f6pmJpZx60ca7iI= +google.golang.org/api v0.111.0/go.mod h1:qtFHvU9mhgTJegR31csQ+rwxyUTHOKFqCKWp1J0fdw0= +google.golang.org/api v0.114.0/go.mod h1:ifYI2ZsFK6/uGddGfAD5BMxlnkBqCmqHSDUVi45N5Yg= +google.golang.org/api v0.216.0 h1:xnEHy+xWFrtYInWPy8OdGFsyIfWJjtVnO39g7pz2BFY= +google.golang.org/api v0.216.0/go.mod h1:K9wzQMvWi47Z9IU7OgdOofvZuw75Ge3PPITImZR/UyI= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1499,9 +2088,7 @@ google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1577,6 +2164,7 @@ google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2 google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= +google.golang.org/genproto v0.0.0-20220329172620-7be39ac1afc7/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= @@ -1609,14 +2197,41 @@ google.golang.org/genproto v0.0.0-20220926220553-6981cbe3cfce/go.mod h1:woMGP53B google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqwhZAwq4wsRUaVG555sVgsNmIjRtO7t/JH29U= google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= -google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20230525234025-438c736192d0 h1:x1vNwUhVOcsYoKyEGCZBH694SBmmBjA2EfauFVEI2+M= -google.golang.org/genproto v0.0.0-20230525234025-438c736192d0/go.mod h1:9ExIQyXL5hZrHzQceCwuSYwZZ5QZBazOcprJ5rgs3lY= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a h1:HiYVD+FGJkTo+9zj1gqz0anapsa1JxjiSrN+BJKyUmE= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a/go.mod h1:ts19tUU+Z0ZShN1y3aPyq2+O3d5FUNNgT6FtOzmrNn8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/genproto v0.0.0-20221024153911-1573dae28c9c/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= +google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= +google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c/go.mod h1:CGI5F/G+E5bKwmfYo09AXuVN4dD894kIKUFmVbP2/Fo= +google.golang.org/genproto v0.0.0-20221109142239-94d6d90a7d66/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221114212237-e4508ebdbee1/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221117204609-8f9c96812029/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221201164419-0e50fba7f41c/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221201204527-e3fa12d562f3/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd/go.mod h1:cTsE614GARnxrLsqKREzmNYJACSWWpAWdNMwnD7c2BE= +google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230112194545-e10362b5ecf9/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230113154510-dbe35b8444a5/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230123190316-2c411cf9d197/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230124163310-31e0e69b6fc2/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230125152338-dcaf20b6aeaa/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230127162408-596548ed4efa/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230209215440-0dfe4f8abfcc/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230216225411-c8e22ba71e44/go.mod h1:8B0gmkoRebU8ukX6HP+4wrVQUY1+6PkQ44BSyIlflHA= +google.golang.org/genproto v0.0.0-20230222225845-10f96fb3dbec/go.mod h1:3Dl5ZL0q0isWJt+FVcfpQyirqemEuLAK/iFvg1UP1Hw= +google.golang.org/genproto v0.0.0-20230223222841-637eb2293923/go.mod h1:3Dl5ZL0q0isWJt+FVcfpQyirqemEuLAK/iFvg1UP1Hw= +google.golang.org/genproto v0.0.0-20230303212802-e74f57abe488/go.mod h1:TvhZT5f700eVlTNwND1xoEZQeWTB2RY/65kplwl/bFA= +google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= +google.golang.org/genproto v0.0.0-20230320184635-7606e756e683/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= +google.golang.org/genproto v0.0.0-20230323212658-478b75c54725/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= +google.golang.org/genproto v0.0.0-20230330154414-c0448cd141ea/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= +google.golang.org/genproto v0.0.0-20230331144136-dcfb400f0633/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= +google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= +google.golang.org/genproto v0.0.0-20250106144421-5f5ef82da422 h1:6GUHKGv2huWOHKmDXLMNE94q3fBDlEHI+oTRIZSebK0= +google.golang.org/genproto v0.0.0-20250106144421-5f5ef82da422/go.mod h1:1NPAxoesyw/SgLPqaUp9u1f9PWCLAk/jVmhx7gJZStg= +google.golang.org/genproto/googleapis/api v0.0.0-20250106144421-5f5ef82da422 h1:GVIKPyP/kLIyVOgOnTwFOrvQaQUzOzGMCxgFUOEmm24= +google.golang.org/genproto/googleapis/api v0.0.0-20250106144421-5f5ef82da422/go.mod h1:b6h1vNKhxaSoEI+5jc3PJUCustfli/mRab7295pY7rw= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250122153221-138b5a5a4fd4 h1:yrTuav+chrF0zF/joFGICKTzYv7mh/gr9AgEXrVU8ao= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250122153221-138b5a5a4fd4/go.mod h1:+2Yz8+CLJbIfL9z73EW45avw8Lmge3xVElCP9zEKi50= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1649,6 +2264,7 @@ google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnD google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= @@ -1658,8 +2274,13 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= +google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= +google.golang.org/grpc v1.52.3/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= +google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= +google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g= +google.golang.org/grpc v1.56.3/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= +google.golang.org/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg= +google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1676,25 +2297,23 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= +google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.36.4 h1:6A3ZDJHn/eNqc1i+IdefRzy/9PokBTPvcqMySR7NNIM= +google.golang.org/protobuf v1.36.4/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 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.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= 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/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= -gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= -gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -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/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= @@ -1709,13 +2328,12 @@ gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 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= -gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= -gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= +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-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1724,14 +2342,52 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= 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= -nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= +honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= +lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= +lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= +modernc.org/cc/v3 v3.36.0/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= +modernc.org/cc/v3 v3.36.2/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= +modernc.org/cc/v3 v3.36.3/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= +modernc.org/ccgo/v3 v3.0.0-20220428102840-41399a37e894/go.mod h1:eI31LL8EwEBKPpNpA4bU1/i+sKOwOrQy8D87zWUcRZc= +modernc.org/ccgo/v3 v3.0.0-20220430103911-bc99d88307be/go.mod h1:bwdAnOoaIt8Ax9YdWGjxWsdkPcZyRPHqrOvJxaKAKGw= +modernc.org/ccgo/v3 v3.16.4/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ= +modernc.org/ccgo/v3 v3.16.6/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ= +modernc.org/ccgo/v3 v3.16.8/go.mod h1:zNjwkizS+fIFDrDjIAgBSCLkWbJuHF+ar3QRn+Z9aws= +modernc.org/ccgo/v3 v3.16.9/go.mod h1:zNMzC9A9xeNUepy6KuZBbugn3c0Mc9TeiJO4lgvkJDo= +modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= +modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= +modernc.org/libc v0.0.0-20220428101251-2d5f3daf273b/go.mod h1:p7Mg4+koNjc8jkqwcoFBJx7tXkpj00G77X7A72jXPXA= +modernc.org/libc v1.16.0/go.mod h1:N4LD6DBE9cf+Dzf9buBlzVJndKr/iJHG97vGLHYnb5A= +modernc.org/libc v1.16.1/go.mod h1:JjJE0eu4yeK7tab2n4S1w8tlWd9MxXLRzheaRnAKymU= +modernc.org/libc v1.16.17/go.mod h1:hYIV5VZczAmGZAnG15Vdngn5HSF5cSkbvfz2B7GRuVU= +modernc.org/libc v1.16.19/go.mod h1:p7Mg4+koNjc8jkqwcoFBJx7tXkpj00G77X7A72jXPXA= +modernc.org/libc v1.17.0/go.mod h1:XsgLldpP4aWlPlsjqKRdHPqCxCjISdHfM/yeWC5GyW0= +modernc.org/libc v1.17.1/go.mod h1:FZ23b+8LjxZs7XtFMbSzL/EhPxNbfZbErxEHc7cbD9s= +modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/mathutil v1.4.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/memory v1.1.1/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= +modernc.org/memory v1.2.0/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= +modernc.org/memory v1.2.1/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= +modernc.org/opt v0.1.1/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/sqlite v1.18.1/go.mod h1:6ho+Gow7oX5V+OiOQ6Tr4xeqbx13UZ6t+Fw9IRUG4d4= +modernc.org/strutil v1.1.1/go.mod h1:DE+MQQ/hjKBZS2zNInV5hhcipt5rLPWkmpbGeW5mmdw= +modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= +modernc.org/tcl v1.13.1/go.mod h1:XOLfOwzhkljL4itZkK6T72ckMgvj0BDsnKNdZVUOecw= +modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= +modernc.org/z v1.5.1/go.mod h1:eWFB510QWW5Th9YGZT81s+LwvaAs3Q2yr4sP0rmLkv8= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= -pgregory.net/rapid v0.6.2 h1:ErW5sL+UKtfBfUTsWHDCoeB+eZKLKMxrSd1VJY6W4bw= -pgregory.net/rapid v0.6.2/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= +nhooyr.io/websocket v1.8.11 h1:f/qXNc2/3DpoSZkHt1DQu6rj4zGC8JmkkLkWss0MgN0= +nhooyr.io/websocket v1.8.11/go.mod h1:rN9OFWIUwuxg4fR5tELlYC04bXYowCP9GX47ivo2l+c= +nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= +pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= +pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/tools/cosmovisor/process.go b/tools/cosmovisor/process.go index eff28e41d1a8..8658c4011667 100644 --- a/tools/cosmovisor/process.go +++ b/tools/cosmovisor/process.go @@ -1,46 +1,191 @@ package cosmovisor import ( + "context" "encoding/json" + "errors" "fmt" "io" "os" "os/exec" "os/signal" "path/filepath" + "sort" "strconv" "strings" + "sync" "syscall" "time" + "github.com/fsnotify/fsnotify" "github.com/otiai10/copy" - "github.com/rs/zerolog" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" "cosmossdk.io/log" "cosmossdk.io/x/upgrade/plan" upgradetypes "cosmossdk.io/x/upgrade/types" + + "github.com/cosmos/cosmos-sdk/client/grpc/cmtservice" ) type Launcher struct { - logger *zerolog.Logger + logger log.Logger cfg *Config fw *fileWatcher } func NewLauncher(logger log.Logger, cfg *Config) (Launcher, error) { - fw, err := newUpgradeFileWatcher(logger, cfg.UpgradeInfoFilePath(), cfg.PollInterval) + fw, err := newUpgradeFileWatcher(cfg) if err != nil { return Launcher{}, err } - zl := logger.Impl().(*zerolog.Logger) - return Launcher{logger: zl, cfg: cfg, fw: fw}, nil + return Launcher{logger: logger, cfg: cfg, fw: fw}, nil +} + +// loadBatchUpgradeFile loads the batch upgrade file into memory, sorted by +// their upgrade heights +func loadBatchUpgradeFile(cfg *Config) ([]upgradetypes.Plan, error) { + var uInfos []upgradetypes.Plan + upgradeInfoFile, err := os.ReadFile(cfg.UpgradeInfoBatchFilePath()) + if os.IsNotExist(err) { + return uInfos, nil + } else if err != nil { + return nil, fmt.Errorf("error while reading %s: %w", cfg.UpgradeInfoBatchFilePath(), err) + } + + if err = json.Unmarshal(upgradeInfoFile, &uInfos); err != nil { + return nil, err + } + sort.Slice(uInfos, func(i, j int) bool { + return uInfos[i].Height < uInfos[j].Height + }) + return uInfos, nil +} + +// BatchUpgradeWatcher starts a watcher loop that swaps upgrade manifests at the correct +// height, given the batch upgrade file. It watches the current state of the chain +// via the websocket API. +func BatchUpgradeWatcher(ctx context.Context, cfg *Config, logger log.Logger) { + // load batch file in memory + uInfos, err := loadBatchUpgradeFile(cfg) + if err != nil { + logger.Warn("failed to load batch upgrade file", "error", err) + uInfos = []upgradetypes.Plan{} + } + + watcher, err := fsnotify.NewWatcher() + if err != nil { + logger.Warn("failed to init watcher", "error", err) + return + } + defer watcher.Close() + err = watcher.Add(filepath.Dir(cfg.UpgradeInfoBatchFilePath())) + if err != nil { + logger.Warn("watcher failed to add upgrade directory", "error", err) + return + } + + var conn *grpc.ClientConn + var grpcErr error + + defer func() { + if conn != nil { + if err := conn.Close(); err != nil { + logger.Warn("couldn't stop gRPC client", "error", err) + } + } + }() + + // Wait for the chain process to be ready +pollLoop: + for { + select { + case <-ctx.Done(): + return + default: + conn, grpcErr = grpc.NewClient(cfg.GRPCAddress, grpc.WithTransportCredentials(insecure.NewCredentials())) + if grpcErr == nil { + break pollLoop + } + time.Sleep(time.Second) + } + } + + client := cmtservice.NewServiceClient(conn) + + var prevUpgradeHeight int64 = -1 + + logger.Info("starting the batch watcher loop") + for { + select { + case event := <-watcher.Events: + if event.Op&(fsnotify.Write|fsnotify.Create) != 0 { + uInfos, err = loadBatchUpgradeFile(cfg) + if err != nil { + logger.Warn("failed to load batch upgrade file", "error", err) + continue + } + } + case <-ctx.Done(): + return + default: + if len(uInfos) == 0 { + // prevent spending extra CPU cycles + time.Sleep(time.Second) + continue + } + resp, err := client.GetLatestBlock(ctx, &cmtservice.GetLatestBlockRequest{}) + if err != nil { + logger.Warn("error getting latest block", "error", err) + time.Sleep(time.Second) + continue + } + + h := resp.SdkBlock.Header.Height + upcomingUpgrade := uInfos[0].Height + // replace upgrade-info and upgrade-info batch file + if h > prevUpgradeHeight && h < upcomingUpgrade { + jsonBytes, err := json.Marshal(uInfos[0]) + if err != nil { + logger.Warn("error marshaling JSON for upgrade-info.json", "error", err, "upgrade", uInfos[0]) + continue + } + if err := os.WriteFile(cfg.UpgradeInfoFilePath(), jsonBytes, 0o600); err != nil { + logger.Warn("error writing upgrade-info.json", "error", err) + continue + } + uInfos = uInfos[1:] + + jsonBytes, err = json.Marshal(uInfos) + if err != nil { + logger.Warn("error marshaling JSON for upgrade-info.json.batch", "error", err, "upgrades", uInfos) + continue + } + if err := os.WriteFile(cfg.UpgradeInfoBatchFilePath(), jsonBytes, 0o600); err != nil { + logger.Warn("error writing upgrade-info.json.batch", "error", err) + // remove the upgrade-info.json.batch file to avoid non-deterministic behavior + err := os.Remove(cfg.UpgradeInfoBatchFilePath()) + if err != nil && !os.IsNotExist(err) { + logger.Warn("error removing upgrade-info.json.batch", "error", err) + return + } + continue + } + prevUpgradeHeight = upcomingUpgrade + } + + // Add a small delay to avoid hammering the gRPC endpoint + time.Sleep(time.Second) + } + } } // Run launches the app in a subprocess and returns when the subprocess (app) // exits (either when it dies, or *after* a successful upgrade.) and upgrade finished. // Returns true if the upgrade request was detected and the upgrade process started. -func (l Launcher) Run(args []string, stdout, stderr io.Writer) (bool, error) { +func (l Launcher) Run(args []string, stdin io.Reader, stdout, stderr io.Writer) (bool, error) { bin, err := l.cfg.CurrentBin() if err != nil { return false, fmt.Errorf("error creating symlink to genesis: %w", err) @@ -50,20 +195,32 @@ func (l Launcher) Run(args []string, stdout, stderr io.Writer) (bool, error) { return false, fmt.Errorf("current binary is invalid: %w", err) } - l.logger.Info().Str("path", bin).Strs("args", args).Msg("running app") + l.logger.Info("running app", "path", bin, "args", args) cmd := exec.Command(bin, args...) + cmd.Stdin = stdin cmd.Stdout = stdout cmd.Stderr = stderr if err := cmd.Start(); err != nil { return false, fmt.Errorf("launching process %s %s failed: %w", bin, strings.Join(args, " "), err) } + ctx, cancel := context.WithCancel(context.Background()) + var wg sync.WaitGroup + wg.Add(1) + go func() { + defer wg.Done() + BatchUpgradeWatcher(ctx, l.cfg, l.logger) + }() + sigs := make(chan os.Signal, 1) signal.Notify(sigs, syscall.SIGQUIT, syscall.SIGTERM) go func() { sig := <-sigs + cancel() + wg.Wait() if err := cmd.Process.Signal(sig); err != nil { - l.logger.Fatal().Err(err).Str("bin", bin).Msg("terminated") + l.logger.Error("terminated", "error", err, "bin", bin) + os.Exit(1) } }() @@ -78,7 +235,11 @@ func (l Launcher) Run(args []string, stdout, stderr io.Writer) (bool, error) { return false, err } - if err := UpgradeBinary(log.NewCustomLogger(*l.logger), l.cfg, l.fw.currentInfo); err != nil { + if err := l.doCustomPreUpgrade(); err != nil { + return false, err + } + + if err := UpgradeBinary(l.logger, l.cfg, l.fw.currentInfo); err != nil { return false, err } @@ -89,6 +250,9 @@ func (l Launcher) Run(args []string, stdout, stderr io.Writer) (bool, error) { return true, nil } + cancel() + wg.Wait() + return false, nil } @@ -96,13 +260,14 @@ func (l Launcher) Run(args []string, stdout, stderr io.Writer) (bool, error) { // When it returns, the process (app) is finished. // // It returns (true, nil) if an upgrade should be initiated (and we killed the process) -// It returns (false, err) if the process died by itself, or there was an issue reading the upgrade-info file. +// It returns (false, err) if the process died by itself // It returns (false, nil) if the process exited normally without triggering an upgrade. This is very unlikely -// to happened with "start" but may happened with short-lived commands like `gaiad export ...` +// to happen with "start" but may happen with short-lived commands like `simd genesis export ...` func (l Launcher) WaitForUpgradeOrExit(cmd *exec.Cmd) (bool, error) { currentUpgrade, err := l.cfg.UpgradeInfo() if err != nil { - l.logger.Error().Err(err) + // upgrade info not found do nothing + currentUpgrade = upgradetypes.Plan{} } cmdDone := make(chan error) @@ -113,8 +278,34 @@ func (l Launcher) WaitForUpgradeOrExit(cmd *exec.Cmd) (bool, error) { select { case <-l.fw.MonitorUpdate(currentUpgrade): // upgrade - kill the process and restart - l.logger.Info().Msg("daemon shutting down in an attempt to restart") - _ = cmd.Process.Kill() + l.logger.Info("daemon shutting down in an attempt to restart") + + if l.cfg.ShutdownGrace > 0 { + // Interrupt signal + l.logger.Info("sent interrupt to app, waiting for exit") + _ = cmd.Process.Signal(os.Interrupt) + + // Wait app exit + psChan := make(chan *os.ProcessState) + go func() { + pstate, _ := cmd.Process.Wait() + psChan <- pstate + }() + + // Timeout and kill + select { + case <-psChan: + // Normal Exit + l.logger.Info("app exited normally") + case <-time.After(l.cfg.ShutdownGrace): + l.logger.Info("DAEMON_SHUTDOWN_GRACE exceeded, killing app") + // Kill after grace period + _ = cmd.Process.Kill() + } + } else { + // Default: Immediate app kill + _ = cmd.Process.Kill() + } case err := <-cmdDone: l.fw.Stop() // no error -> command exits normally (eg. short command like `gaiad version`) @@ -135,7 +326,7 @@ func (l Launcher) doBackup() error { if !l.cfg.UnsafeSkipBackup { // check if upgrade-info.json is not empty. var uInfo upgradetypes.Plan - upgradeInfoFile, err := os.ReadFile(filepath.Join(l.cfg.Home, "data", "upgrade-info.json")) + upgradeInfoFile, err := os.ReadFile(l.cfg.UpgradeInfoFilePath()) if err != nil { return fmt.Errorf("error while reading upgrade-info.json: %w", err) } @@ -145,15 +336,15 @@ func (l Launcher) doBackup() error { } if uInfo.Name == "" { - return fmt.Errorf("upgrade-info.json is empty") + return errors.New("upgrade-info.json is empty") } // a destination directory, Format YYYY-MM-DD st := time.Now() - stStr := fmt.Sprintf("%d-%d-%d", st.Year(), st.Month(), st.Day()) - dst := filepath.Join(l.cfg.DataBackupPath, fmt.Sprintf("data"+"-backup-%s", stStr)) + ymd := fmt.Sprintf("%d-%d-%d", st.Year(), st.Month(), st.Day()) + dst := filepath.Join(l.cfg.DataBackupPath, fmt.Sprintf("data"+"-backup-%s", ymd)) - l.logger.Info().Time("backup start time", st).Msg("starting to take backup of data directory") + l.logger.Info("starting to take backup of data directory", "backup start time", st) // copy the $DAEMON_HOME/data to a backup dir if err = copy.Copy(filepath.Join(l.cfg.Home, "data"), dst); err != nil { @@ -162,38 +353,100 @@ func (l Launcher) doBackup() error { // backup is done, lets check endtime to calculate total time taken for backup process et := time.Now() - l.logger.Info().Str("backup saved at", dst).Time("backup completion time", et).TimeDiff("time taken to complete backup", et, st).Msg("backup completed") + l.logger.Info("backup completed", "backup saved at", dst, "backup completion time", et, "time taken to complete backup", et.Sub(st)) } return nil } +// doCustomPreUpgrade executes the custom preupgrade script if provided. +func (l Launcher) doCustomPreUpgrade() error { + if l.cfg.CustomPreUpgrade == "" { + return nil + } + + // check if upgrade-info.json is not empty. + var upgradePlan upgradetypes.Plan + upgradeInfoFile, err := os.ReadFile(l.cfg.UpgradeInfoFilePath()) + if err != nil { + return fmt.Errorf("error while reading upgrade-info.json: %w", err) + } + + if err = json.Unmarshal(upgradeInfoFile, &upgradePlan); err != nil { + return err + } + + if err = upgradePlan.ValidateBasic(); err != nil { + return fmt.Errorf("invalid upgrade plan: %w", err) + } + + // check if preupgradeFile is executable file + preupgradeFile := filepath.Join(l.cfg.Home, "cosmovisor", l.cfg.CustomPreUpgrade) + l.logger.Info("looking for COSMOVISOR_CUSTOM_PREUPGRADE file", "file", preupgradeFile) + info, err := os.Stat(preupgradeFile) + if err != nil { + l.logger.Error("COSMOVISOR_CUSTOM_PREUPGRADE file missing", "file", preupgradeFile) + return err + } + if !info.Mode().IsRegular() { + _, f := filepath.Split(preupgradeFile) + return fmt.Errorf("COSMOVISOR_CUSTOM_PREUPGRADE: %s is not a regular file", f) + } + + // Set the execute bit for only the current user + // Given: Current user - Group - Everyone + // 0o RWX - RWX - RWX + oldMode := info.Mode().Perm() + newMode := oldMode | 0o100 + if oldMode != newMode { + if err := os.Chmod(preupgradeFile, newMode); err != nil { + l.logger.Info("COSMOVISOR_CUSTOM_PREUPGRADE could not add execute permission") + return errors.New("COSMOVISOR_CUSTOM_PREUPGRADE could not add execute permission") + } + } + + // Run preupgradeFile + cmd := exec.Command(preupgradeFile, upgradePlan.Name, fmt.Sprintf("%d", upgradePlan.Height)) + cmd.Dir = l.cfg.Home + result, err := cmd.Output() + if err != nil { + return err + } + + l.logger.Info("COSMOVISOR_CUSTOM_PREUPGRADE result", "command", preupgradeFile, "argv1", upgradePlan.Name, "argv2", fmt.Sprintf("%d", upgradePlan.Height), "result", result) + + return nil +} + // doPreUpgrade runs the pre-upgrade command defined by the application and handles respective error codes. // cfg contains the cosmovisor config from env var. // doPreUpgrade runs the new APP binary in order to process the upgrade (post-upgrade for cosmovisor). func (l *Launcher) doPreUpgrade() error { counter := 0 for { - if counter > l.cfg.PreupgradeMaxRetries { - return fmt.Errorf("pre-upgrade command failed. reached max attempt of retries - %d", l.cfg.PreupgradeMaxRetries) + if counter > l.cfg.PreUpgradeMaxRetries { + return fmt.Errorf("pre-upgrade command failed. reached max attempt of retries - %d", l.cfg.PreUpgradeMaxRetries) } if err := l.executePreUpgradeCmd(); err != nil { counter++ - switch err.(*exec.ExitError).ProcessState.ExitCode() { - case 1: - l.logger.Info().Msg("pre-upgrade command does not exist. continuing the upgrade.") - return nil - case 30: - return fmt.Errorf("pre-upgrade command failed : %w", err) - case 31: - l.logger.Error().Err(err).Int("attempt", counter).Msg("pre-upgrade command failed. retrying") - continue + var exitErr *exec.ExitError + if errors.As(err, &exitErr) { + switch exitErr.ProcessState.ExitCode() { + case 1: + l.logger.Info("pre-upgrade command does not exist. continuing the upgrade.") + return nil + case 30: + return fmt.Errorf("pre-upgrade command failed : %w", err) + case 31: + l.logger.Error("pre-upgrade command failed. retrying", "error", err, "attempt", counter) + continue + } } } - l.logger.Info().Msg("pre-upgrade successful. continuing the upgrade.") + l.logger.Info("pre-upgrade successful. continuing the upgrade.") return nil } } @@ -211,7 +464,7 @@ func (l *Launcher) executePreUpgradeCmd() error { return err } - l.logger.Info().Bytes("result", result).Msg("pre-upgrade result") + l.logger.Info("pre-upgrade result", "result", result) return nil } diff --git a/tools/cosmovisor/process_test.go b/tools/cosmovisor/process_test.go index d071c480e619..26ef82900fe6 100644 --- a/tools/cosmovisor/process_test.go +++ b/tools/cosmovisor/process_test.go @@ -1,171 +1,468 @@ -//go:build linux -// +build linux +//go:build linux || darwin package cosmovisor_test import ( "bytes" "fmt" + "io/fs" "os" + "path/filepath" "sync" "testing" "time" "github.com/stretchr/testify/require" - "github.com/stretchr/testify/suite" "cosmossdk.io/log" "cosmossdk.io/tools/cosmovisor" upgradetypes "cosmossdk.io/x/upgrade/types" ) -type processTestSuite struct { - suite.Suite -} +var workDir string -func TestProcessTestSuite(t *testing.T) { - suite.Run(t, new(processTestSuite)) +func init() { + workDir, _ = os.Getwd() } // TestLaunchProcess will try running the script a few times and watch upgrades work properly // and args are passed through -func (s *processTestSuite) TestLaunchProcess() { +func TestLaunchProcess(t *testing.T) { // binaries from testdata/validate directory - require := s.Require() - home := copyTestData(s.T(), "validate") - cfg := &cosmovisor.Config{Home: home, Name: "dummyd", PollInterval: 20, UnsafeSkipBackup: true} - logger := log.NewTestLogger(s.T()).With(log.ModuleKey, "cosmosvisor") + cfg := prepareConfig( + t, + fmt.Sprintf("%s/%s", workDir, "testdata/validate"), + cosmovisor.Config{ + Name: "dummyd", + PollInterval: 15, + UnsafeSkipBackup: true, + }, + ) + + logger := log.NewTestLogger(t).With(log.ModuleKey, "cosmosvisor") // should run the genesis binary and produce expected output + stdin, _ := os.Open(os.DevNull) stdout, stderr := newBuffer(), newBuffer() currentBin, err := cfg.CurrentBin() - require.NoError(err) - require.Equal(cfg.GenesisBin(), currentBin) + require.NoError(t, err) + + rPath, err := filepath.EvalSymlinks(cfg.GenesisBin()) + require.NoError(t, err) + + require.Equal(t, rPath, currentBin) launcher, err := cosmovisor.NewLauncher(logger, cfg) - require.NoError(err) + require.NoError(t, err) upgradeFile := cfg.UpgradeInfoFilePath() args := []string{"foo", "bar", "1234", upgradeFile} - doUpgrade, err := launcher.Run(args, stdout, stderr) - require.NoError(err) - require.True(doUpgrade) - require.Equal("", stderr.String()) - require.Equal(fmt.Sprintf("Genesis foo bar 1234 %s\nUPGRADE \"chain2\" NEEDED at height: 49: {}\n", upgradeFile), stdout.String()) + doUpgrade, err := launcher.Run(args, stdin, stdout, stderr) + require.NoError(t, err) + require.True(t, doUpgrade) + require.Empty(t, stderr.String()) + require.Equal(t, fmt.Sprintf("Genesis foo bar 1234 %s\nUPGRADE \"chain2\" NEEDED at height: 49: {}\n", upgradeFile), stdout.String()) // ensure this is upgraded now and produces new output currentBin, err = cfg.CurrentBin() - require.NoError(err) + require.NoError(t, err) + + rPath, err = filepath.EvalSymlinks(cfg.UpgradeBin("chain2")) + require.NoError(t, err) - require.Equal(cfg.UpgradeBin("chain2"), currentBin) + require.Equal(t, rPath, currentBin) args = []string{"second", "run", "--verbose"} stdout.Reset() stderr.Reset() - doUpgrade, err = launcher.Run(args, stdout, stderr) - require.NoError(err) - require.False(doUpgrade) - require.Equal("", stderr.String()) - require.Equal("Chain 2 is live!\nArgs: second run --verbose\nFinished successfully\n", stdout.String()) + doUpgrade, err = launcher.Run(args, stdin, stdout, stderr) + require.NoError(t, err) + require.False(t, doUpgrade) + require.Empty(t, stderr.String()) + require.Equal(t, "Chain 2 is live!\nArgs: second run --verbose\nFinished successfully\n", stdout.String()) // ended without other upgrade - require.Equal(cfg.UpgradeBin("chain2"), currentBin) + rPath, err = filepath.EvalSymlinks(cfg.UpgradeBin("chain2")) + require.NoError(t, err) + + require.Equal(t, rPath, currentBin) } -func (s *processTestSuite) TestLaunchProcessWithRestartDelay() { +// TestPlanDisableRecase will test upgrades without lower case plan names +func TestPlanDisableRecase(t *testing.T) { // binaries from testdata/validate directory - require := s.Require() - home := copyTestData(s.T(), "validate") - cfg := &cosmovisor.Config{Home: home, Name: "dummyd", RestartDelay: 5 * time.Second, PollInterval: 20, UnsafeSkipBackup: true} - logger := log.NewTestLogger(s.T()).With(log.ModuleKey, "cosmosvisor") + cfg := prepareConfig( + t, + fmt.Sprintf("%s/%s", workDir, "testdata/norecase"), + cosmovisor.Config{ + Name: "dummyd", + PollInterval: 20, + UnsafeSkipBackup: true, + DisableRecase: true, + }, + ) + + logger := log.NewTestLogger(t).With(log.ModuleKey, "cosmosvisor") // should run the genesis binary and produce expected output + stdin, _ := os.Open(os.DevNull) stdout, stderr := newBuffer(), newBuffer() currentBin, err := cfg.CurrentBin() - require.NoError(err) - require.Equal(cfg.GenesisBin(), currentBin) + require.NoError(t, err) + + rPath, err := filepath.EvalSymlinks(cfg.GenesisBin()) + require.NoError(t, err) + + require.Equal(t, rPath, currentBin) launcher, err := cosmovisor.NewLauncher(logger, cfg) - require.NoError(err) + require.NoError(t, err) upgradeFile := cfg.UpgradeInfoFilePath() - start := time.Now() + args := []string{"foo", "bar", "1234", upgradeFile} + doUpgrade, err := launcher.Run(args, stdin, stdout, stderr) + require.NoError(t, err) + require.True(t, doUpgrade) + require.Empty(t, stderr.String()) + require.Equal(t, fmt.Sprintf("Genesis foo bar 1234 %s\nUPGRADE \"Chain2\" NEEDED at height: 49: {}\n", upgradeFile), stdout.String()) + + // ensure this is upgraded now and produces new output + currentBin, err = cfg.CurrentBin() + require.NoError(t, err) + + rPath, err = filepath.EvalSymlinks(cfg.UpgradeBin("Chain2")) + require.NoError(t, err) + require.Equal(t, rPath, currentBin) + args = []string{"second", "run", "--verbose"} + stdout.Reset() + stderr.Reset() + + doUpgrade, err = launcher.Run(args, stdin, stdout, stderr) + require.NoError(t, err) + require.False(t, doUpgrade) + require.Empty(t, stderr.String()) + require.Equal(t, "Chain 2 is live!\nArgs: second run --verbose\nFinished successfully\n", stdout.String()) + + // ended without other upgrade + rPath, err = filepath.EvalSymlinks(cfg.UpgradeBin("Chain2")) + require.NoError(t, err) + require.Equal(t, rPath, currentBin) +} + +func TestLaunchProcessWithRestartDelay(t *testing.T) { + // binaries from testdata/validate directory + cfg := prepareConfig( + t, + fmt.Sprintf("%s/%s", workDir, "testdata/validate"), + cosmovisor.Config{ + Name: "dummyd", + RestartDelay: 5 * time.Second, + PollInterval: 20, + UnsafeSkipBackup: true, + }, + ) + + logger := log.NewTestLogger(t).With(log.ModuleKey, "cosmosvisor") + + // should run the genesis binary and produce expected output + stdin, _ := os.Open(os.DevNull) + stdout, stderr := newBuffer(), newBuffer() + currentBin, err := cfg.CurrentBin() + require.NoError(t, err) + + rPath, err := filepath.EvalSymlinks(cfg.GenesisBin()) + require.NoError(t, err) + require.Equal(t, rPath, currentBin) - doUpgrade, err := launcher.Run([]string{"foo", "bar", "1234", upgradeFile}, stdout, stderr) - require.NoError(err) - require.True(doUpgrade) + launcher, err := cosmovisor.NewLauncher(logger, cfg) + require.NoError(t, err) + + upgradeFile := cfg.UpgradeInfoFilePath() + + start := time.Now() + doUpgrade, err := launcher.Run([]string{"foo", "bar", "1234", upgradeFile}, stdin, stdout, stderr) + require.NoError(t, err) + require.True(t, doUpgrade) // may not be the best way but the fastest way to check we meet the delay // in addition to comparing both the runtime of this test and TestLaunchProcess in addition if time.Since(start) < cfg.RestartDelay { - require.FailNow("restart delay not met") + require.FailNow(t, "restart delay not met") } } +// TestPlanShutdownGrace will test upgrades without lower case plan names +func TestPlanShutdownGrace(t *testing.T) { + // binaries from testdata/validate directory + cfg := prepareConfig( + t, + fmt.Sprintf("%s/%s", workDir, "testdata/dontdie"), + cosmovisor.Config{ + Name: "dummyd", + PollInterval: 15, + UnsafeSkipBackup: true, + ShutdownGrace: 2 * time.Second, + }, + ) + + logger := log.NewTestLogger(t).With(log.ModuleKey, "cosmosvisor") + + // should run the genesis binary and produce expected output + stdin, _ := os.Open(os.DevNull) + stdout, stderr := newBuffer(), newBuffer() + currentBin, err := cfg.CurrentBin() + require.NoError(t, err) + rPath, err := filepath.EvalSymlinks(cfg.GenesisBin()) + require.NoError(t, err) + require.Equal(t, rPath, currentBin) + + launcher, err := cosmovisor.NewLauncher(logger, cfg) + require.NoError(t, err) + + upgradeFile := cfg.UpgradeInfoFilePath() + + args := []string{"foo", "bar", "1234", upgradeFile} + doUpgrade, err := launcher.Run(args, stdin, stdout, stderr) + require.NoError(t, err) + require.True(t, doUpgrade) + require.Empty(t, stderr.String()) + require.Equal(t, fmt.Sprintf("Genesis foo bar 1234 %s\nUPGRADE \"Chain2\" NEEDED at height: 49: {}\nWARN Need Flush\nFlushed\n", upgradeFile), stdout.String()) + + // ensure this is upgraded now and produces new output + currentBin, err = cfg.CurrentBin() + require.NoError(t, err) + + rPath, err = filepath.EvalSymlinks(cfg.UpgradeBin("chain2")) + require.NoError(t, err) + require.Equal(t, rPath, currentBin) + args = []string{"second", "run", "--verbose"} + stdout.Reset() + stderr.Reset() + + doUpgrade, err = launcher.Run(args, stdin, stdout, stderr) + require.NoError(t, err) + require.False(t, doUpgrade) + require.Empty(t, stderr.String()) + require.Equal(t, "Chain 2 is live!\nArgs: second run --verbose\nFinished successfully\n", stdout.String()) + + // ended without other upgrade + rPath, err = filepath.EvalSymlinks(cfg.UpgradeBin("chain2")) + require.NoError(t, err) + require.Equal(t, rPath, currentBin) +} + // TestLaunchProcess will try running the script a few times and watch upgrades work properly // and args are passed through -func (s *processTestSuite) TestLaunchProcessWithDownloads() { +func TestLaunchProcessWithDownloads(t *testing.T) { + // test case upgrade path (binaries from testdata/download directory): + // genesis -> chain2-zip_bin + // chain2-zip_bin -> ref_to_chain3-zip_dir.json = (json for the next download instructions) -> chain3-zip_dir + // chain3-zip_dir - doesn't upgrade + cfg := prepareConfig( + t, + fmt.Sprintf("%s/%s", workDir, "testdata/download"), + cosmovisor.Config{ + Name: "autod", + AllowDownloadBinaries: true, + PollInterval: 100, + UnsafeSkipBackup: true, + }, + ) + + logger := log.NewTestLogger(t).With(log.ModuleKey, "cosmovisor") + upgradeFilename := cfg.UpgradeInfoFilePath() + + // should run the genesis binary and produce expected output + currentBin, err := cfg.CurrentBin() + require.NoError(t, err) + rPath, err := filepath.EvalSymlinks(cfg.GenesisBin()) + require.NoError(t, err) + require.Equal(t, rPath, currentBin) + + launcher, err := cosmovisor.NewLauncher(logger, cfg) + require.NoError(t, err) + + stdin, _ := os.Open(os.DevNull) + stdout, stderr := newBuffer(), newBuffer() + args := []string{"some", "args", upgradeFilename} + doUpgrade, err := launcher.Run(args, stdin, stdout, stderr) + require.NoError(t, err) + require.True(t, doUpgrade) + require.Empty(t, stderr.String()) + require.Equal(t, "Genesis autod. Args: some args "+upgradeFilename+"\n"+`ERROR: UPGRADE "chain2" NEEDED at height: 49: zip_binary`+"\n", stdout.String()) + currentBin, err = cfg.CurrentBin() + require.NoError(t, err) + + rPath, err = filepath.EvalSymlinks(cfg.UpgradeBin("chain2")) + require.NoError(t, err) + require.Equal(t, rPath, currentBin) + + // start chain2 + stdout.Reset() + stderr.Reset() + args = []string{"run", "--fast", upgradeFilename} + doUpgrade, err = launcher.Run(args, stdin, stdout, stderr) + require.NoError(t, err) + + require.Empty(t, stderr.String()) + require.Equal(t, "Chain 2 from zipped binary\nArgs: run --fast "+upgradeFilename+"\n"+`ERROR: UPGRADE "chain3" NEEDED at height: 936: ref_to_chain3-zip_dir.json module=main`+"\n", stdout.String()) + // ended with one more upgrade + require.True(t, doUpgrade) + currentBin, err = cfg.CurrentBin() + require.NoError(t, err) + rPath, err = filepath.EvalSymlinks(cfg.UpgradeBin("chain3")) + require.NoError(t, err) + require.Equal(t, rPath, currentBin) + + // run the last chain + args = []string{"end", "--halt", upgradeFilename} + stdout.Reset() + stderr.Reset() + doUpgrade, err = launcher.Run(args, stdin, stdout, stderr) + require.NoError(t, err) + require.False(t, doUpgrade) + require.Empty(t, stderr.String()) + require.Equal(t, "Chain 3 from zipped directory\nArgs: end --halt "+upgradeFilename+"\n", stdout.String()) + + // and this doesn't upgrade + currentBin, err = cfg.CurrentBin() + require.NoError(t, err) + rPath, err = filepath.EvalSymlinks(cfg.UpgradeBin("chain3")) + require.NoError(t, err) + require.Equal(t, rPath, currentBin) +} + +// TestLaunchProcessWithDownloadsAndMissingPreupgrade will try running the script a few times and watch upgrades work properly +// and args are passed through +func TestLaunchProcessWithDownloadsAndMissingPreupgrade(t *testing.T) { // test case upgrade path (binaries from testdata/download directory): // genesis -> chain2-zip_bin // chain2-zip_bin -> ref_to_chain3-zip_dir.json = (json for the next download instructions) -> chain3-zip_dir // chain3-zip_dir - doesn't upgrade - require := s.Require() - home := copyTestData(s.T(), "download") - cfg := &cosmovisor.Config{Home: home, Name: "autod", AllowDownloadBinaries: true, PollInterval: 100, UnsafeSkipBackup: true} - logger := log.NewLogger(os.Stdout).With(log.ModuleKey, "cosmovisor") + cfg := prepareConfig( + t, + fmt.Sprintf("%s/%s", workDir, "testdata/download"), + cosmovisor.Config{ + Name: "autod", + AllowDownloadBinaries: true, + PollInterval: 100, + UnsafeSkipBackup: true, + CustomPreUpgrade: "missing.sh", + }, + ) + + logger := log.NewTestLogger(t).With(log.ModuleKey, "cosmovisor") upgradeFilename := cfg.UpgradeInfoFilePath() // should run the genesis binary and produce expected output currentBin, err := cfg.CurrentBin() - require.NoError(err) - require.Equal(cfg.GenesisBin(), currentBin) + require.NoError(t, err) + rPath, err := filepath.EvalSymlinks(cfg.GenesisBin()) + require.NoError(t, err) + require.Equal(t, rPath, currentBin) launcher, err := cosmovisor.NewLauncher(logger, cfg) - require.NoError(err) + require.NoError(t, err) + // Missing Preupgrade Script + stdin, _ := os.Open(os.DevNull) stdout, stderr := newBuffer(), newBuffer() args := []string{"some", "args", upgradeFilename} - doUpgrade, err := launcher.Run(args, stdout, stderr) + _, err = launcher.Run(args, stdin, stdout, stderr) + + require.ErrorContains(t, err, "missing.sh") + require.ErrorIs(t, err, fs.ErrNotExist) +} - require.NoError(err) - require.True(doUpgrade) - require.Equal("", stderr.String()) - require.Equal("Genesis autod. Args: some args "+upgradeFilename+"\n"+`ERROR: UPGRADE "chain2" NEEDED at height: 49: zip_binary`+"\n", stdout.String()) +// TestLaunchProcessWithDownloadsAndPreupgrade will try running the script a few times and watch upgrades work properly +// and args are passed through +func TestLaunchProcessWithDownloadsAndPreupgrade(t *testing.T) { + // test case upgrade path (binaries from testdata/download directory): + // genesis -> chain2-zip_bin + // chain2-zip_bin -> ref_to_chain3-zip_dir.json = (json for the next download instructions) -> chain3-zip_dir + // chain3-zip_dir - doesn't upgrade + cfg := prepareConfig( + t, + fmt.Sprintf("%s/%s", workDir, "testdata/download"), + cosmovisor.Config{ + Name: "autod", + AllowDownloadBinaries: true, + PollInterval: 100, + UnsafeSkipBackup: true, + CustomPreUpgrade: "preupgrade.sh", + }, + ) + + buf := newBuffer() // inspect output using buf.String() + logger := log.NewLogger(buf).With(log.ModuleKey, "cosmovisor") + upgradeFilename := cfg.UpgradeInfoFilePath() + + // should run the genesis binary and produce expected output + currentBin, err := cfg.CurrentBin() + require.NoError(t, err) + rPath, err := filepath.EvalSymlinks(cfg.GenesisBin()) + require.NoError(t, err) + require.Equal(t, rPath, currentBin) + launcher, err := cosmovisor.NewLauncher(logger, cfg) + require.NoError(t, err) + + stdin, _ := os.Open(os.DevNull) + stdout, stderr := newBuffer(), newBuffer() + args := []string{"some", "args", upgradeFilename} + doUpgrade, err := launcher.Run(args, stdin, stdout, stderr) + + require.NoError(t, err) + require.True(t, doUpgrade) + require.Empty(t, stderr.String()) + require.Equal(t, "Genesis autod. Args: some args "+upgradeFilename+"\n"+`ERROR: UPGRADE "chain2" NEEDED at height: 49: zip_binary`+"\n", stdout.String()) currentBin, err = cfg.CurrentBin() - require.NoError(err) - require.Equal(cfg.UpgradeBin("chain2"), currentBin) + require.NoError(t, err) + + rPath, err = filepath.EvalSymlinks(cfg.UpgradeBin("chain2")) + require.NoError(t, err) + require.Equal(t, rPath, currentBin) + + // should have preupgrade.sh results + require.FileExists(t, filepath.Join(cfg.Home, "upgrade_name_chain2_height_49")) // start chain2 stdout.Reset() stderr.Reset() args = []string{"run", "--fast", upgradeFilename} - doUpgrade, err = launcher.Run(args, stdout, stderr) - require.NoError(err) + doUpgrade, err = launcher.Run(args, stdin, stdout, stderr) + require.NoError(t, err) - require.Equal("", stderr.String()) - require.Equal("Chain 2 from zipped binary\nArgs: run --fast "+upgradeFilename+"\n"+`ERROR: UPGRADE "chain3" NEEDED at height: 936: ref_to_chain3-zip_dir.json module=main`+"\n", stdout.String()) + require.Empty(t, stderr.String()) + require.Equal(t, "Chain 2 from zipped binary\nArgs: run --fast "+upgradeFilename+"\n"+`ERROR: UPGRADE "chain3" NEEDED at height: 936: ref_to_chain3-zip_dir.json module=main`+"\n", stdout.String()) // ended with one more upgrade - require.True(doUpgrade) + require.True(t, doUpgrade) currentBin, err = cfg.CurrentBin() - require.NoError(err) - require.Equal(cfg.UpgradeBin("chain3"), currentBin) + require.NoError(t, err) + rPath, err = filepath.EvalSymlinks(cfg.UpgradeBin("chain3")) + require.NoError(t, err) + require.Equal(t, rPath, currentBin) + + // should have preupgrade.sh results + require.FileExists(t, filepath.Join(cfg.Home, "upgrade_name_chain3_height_936")) // run the last chain args = []string{"end", "--halt", upgradeFilename} stdout.Reset() stderr.Reset() - doUpgrade, err = launcher.Run(args, stdout, stderr) - require.NoError(err) - require.False(doUpgrade) - require.Equal("", stderr.String()) - require.Equal("Chain 3 from zipped directory\nArgs: end --halt "+upgradeFilename+"\n", stdout.String()) + doUpgrade, err = launcher.Run(args, stdin, stdout, stderr) + require.NoError(t, err) + require.False(t, doUpgrade) + require.Empty(t, stderr.String()) + require.Equal(t, "Chain 3 from zipped directory\nArgs: end --halt "+upgradeFilename+"\n", stdout.String()) // and this doesn't upgrade currentBin, err = cfg.CurrentBin() - require.NoError(err) - require.Equal(cfg.UpgradeBin("chain3"), currentBin) + require.NoError(t, err) + rPath, err = filepath.EvalSymlinks(cfg.UpgradeBin("chain3")) + require.NoError(t, err) + require.Equal(t, rPath, currentBin) } // TestSkipUpgrade tests heights that are identified to be skipped and return if upgrade height matches the skip heights diff --git a/tools/cosmovisor/scanner.go b/tools/cosmovisor/scanner.go index 506e993de379..008c57357075 100644 --- a/tools/cosmovisor/scanner.go +++ b/tools/cosmovisor/scanner.go @@ -5,68 +5,78 @@ import ( "errors" "fmt" "os" + "os/exec" "path/filepath" + "strconv" "strings" + "testing" "time" - "cosmossdk.io/log" upgradetypes "cosmossdk.io/x/upgrade/types" - "github.com/rs/zerolog" ) -type fileWatcher struct { - logger log.Logger +var errUntestAble = errors.New("untestable") - // full path to a watched file - filename string - interval time.Duration +type fileWatcher struct { + daemonHome string + filename string // full path to a watched file + interval time.Duration + currentBin string currentInfo upgradetypes.Plan lastModTime time.Time cancel chan bool ticker *time.Ticker - needsUpdate bool - initialized bool + needsUpdate bool + initialized bool + disableRecase bool } -func newUpgradeFileWatcher(logger log.Logger, filename string, interval time.Duration) (*fileWatcher, error) { +func newUpgradeFileWatcher(cfg *Config) (*fileWatcher, error) { + filename := cfg.UpgradeInfoFilePath() if filename == "" { return nil, errors.New("filename undefined") } filenameAbs, err := filepath.Abs(filename) if err != nil { - return nil, - fmt.Errorf("invalid path; %s must be a valid file path: %w", filename, err) + return nil, fmt.Errorf("invalid path: %s must be a valid file path: %w", filename, err) } dirname := filepath.Dir(filename) - info, err := os.Stat(dirname) - if err != nil || !info.IsDir() { - return nil, fmt.Errorf("invalid path; %s must be an existing directory: %w", dirname, err) + if info, err := os.Stat(dirname); err != nil || !info.IsDir() { + return nil, fmt.Errorf("invalid path: %s must be an existing directory: %w", dirname, err) + } + + bin, err := cfg.CurrentBin() + if err != nil { + return nil, fmt.Errorf("error creating symlink to genesis: %w", err) } return &fileWatcher{ - logger: logger, - filename: filenameAbs, - interval: interval, - currentInfo: upgradetypes.Plan{}, - lastModTime: time.Time{}, - cancel: make(chan bool), - ticker: time.NewTicker(interval), - needsUpdate: false, - initialized: false, + daemonHome: cfg.Home, + currentBin: bin, + filename: filenameAbs, + interval: cfg.PollInterval, + currentInfo: upgradetypes.Plan{}, + lastModTime: time.Time{}, + cancel: make(chan bool), + ticker: time.NewTicker(cfg.PollInterval), + needsUpdate: false, + initialized: false, + disableRecase: cfg.DisableRecase, }, nil } func (fw *fileWatcher) Stop() { close(fw.cancel) + fw.ticker.Stop() } -// pools the filesystem to check for new upgrade currentInfo. currentName is the name -// of currently running upgrade. The check is rejected if it finds an upgrade with the same -// name. +// MonitorUpdate pools the filesystem to check for new upgrade currentInfo. +// currentName is the name of currently running upgrade. The check is rejected if it finds +// an upgrade with the same name. func (fw *fileWatcher) MonitorUpdate(currentUpgrade upgradetypes.Plan) <-chan struct{} { fw.ticker.Reset(fw.interval) done := make(chan struct{}) @@ -101,18 +111,48 @@ func (fw *fileWatcher) CheckUpdate(currentUpgrade upgradetypes.Plan) bool { stat, err := os.Stat(fw.filename) if err != nil { - // file doesn't exists + if os.IsNotExist(err) { + return false + } else { + panic(fmt.Errorf("failed to stat upgrade info file: %w", err)) + } + } + + // check https://github.com/cosmos/cosmos-sdk/issues/21086 + // If new file is still empty, wait a small amount of time for write to complete + if stat.Size() == 0 { + for range 10 { + time.Sleep(2 * time.Millisecond) + stat, err = os.Stat(fw.filename) + if err != nil { + if os.IsNotExist(err) { + return false + } else { + panic(fmt.Errorf("failed to stat upgrade info file: %w", err)) + } + } + if stat.Size() == 0 { + break + } + } + } + if stat.Size() == 0 { return false } + // no update if the file already exists and has not been modified if !stat.ModTime().After(fw.lastModTime) { return false } - info, err := parseUpgradeInfoFile(fw.filename) + info, err := parseUpgradeInfoFile(fw.filename, fw.disableRecase) if err != nil { - zl := fw.logger.Impl().(*zerolog.Logger) - zl.Fatal().Err(err).Msg("failed to parse upgrade info file") + panic(fmt.Errorf("failed to parse upgrade info file: %w", err)) + } + + // file exist but too early in height + currentHeight, err := fw.checkHeight() + if (err != nil || currentHeight < info.Height) && !errors.Is(err, errUntestAble) { // ignore this check for tests return false } @@ -122,7 +162,7 @@ func (fw *fileWatcher) CheckUpdate(currentUpgrade upgradetypes.Plan) bool { fw.currentInfo = info fw.lastModTime = stat.ModTime() - // Heuristic: Deamon has restarted, so we don't know if we successfully + // Heuristic: Daemon has restarted, so we don't know if we successfully // downloaded the upgrade or not. So we try to compare the running upgrade // name (read from the cosmovisor file) with the upgrade info. if !strings.EqualFold(currentUpgrade.Name, fw.currentInfo.Name) { @@ -141,27 +181,64 @@ func (fw *fileWatcher) CheckUpdate(currentUpgrade upgradetypes.Plan) bool { return false } -func parseUpgradeInfoFile(filename string) (upgradetypes.Plan, error) { - var ui upgradetypes.Plan +// checkHeight checks if the current block height +func (fw *fileWatcher) checkHeight() (int64, error) { + if testing.Testing() { // we cannot test the command in the test environment + return 0, errUntestAble + } - f, err := os.Open(filename) + result, err := exec.Command(fw.currentBin, "status", "--home", fw.daemonHome).CombinedOutput() //nolint:gosec // we want to execute the status command + if err != nil { + return 0, err + } + + type response struct { + SyncInfo struct { + LatestBlockHeight string `json:"latest_block_height"` + } `json:"sync_info"` + AnotherCasingSyncInfo struct { + LatestBlockHeight string `json:"latest_block_height"` + } `json:"SyncInfo"` + } + + var resp response + if err := json.Unmarshal(result, &resp); err != nil { + return 0, err + } + + if resp.SyncInfo.LatestBlockHeight != "" { + return strconv.ParseInt(resp.SyncInfo.LatestBlockHeight, 10, 64) + } else if resp.AnotherCasingSyncInfo.LatestBlockHeight != "" { + return strconv.ParseInt(resp.AnotherCasingSyncInfo.LatestBlockHeight, 10, 64) + } + + return 0, errors.New("latest block height is empty") +} + +func parseUpgradeInfoFile(filename string, disableRecase bool) (upgradetypes.Plan, error) { + f, err := os.ReadFile(filename) if err != nil { return upgradetypes.Plan{}, err } - defer f.Close() - d := json.NewDecoder(f) - if err := d.Decode(&ui); err != nil { + if len(f) == 0 { + return upgradetypes.Plan{}, fmt.Errorf("empty upgrade-info.json in %q", filename) + } + + var upgradePlan upgradetypes.Plan + if err := json.Unmarshal(f, &upgradePlan); err != nil { return upgradetypes.Plan{}, err } // required values must be set - if ui.Height <= 0 || ui.Name == "" { - return upgradetypes.Plan{}, fmt.Errorf("invalid upgrade-info.json content; name and height must be not empty; got: %v", ui) + if err := upgradePlan.ValidateBasic(); err != nil { + return upgradetypes.Plan{}, fmt.Errorf("invalid upgrade-info.json content: %w, got: %v", err, upgradePlan) } // normalize name to prevent operator error in upgrade name case sensitivity errors. - ui.Name = strings.ToLower(ui.Name) + if !disableRecase { + upgradePlan.Name = strings.ToLower(upgradePlan.Name) + } - return ui, err + return upgradePlan, nil } diff --git a/tools/cosmovisor/scanner_test.go b/tools/cosmovisor/scanner_test.go index 5e3ac9333773..3f110703a0a0 100644 --- a/tools/cosmovisor/scanner_test.go +++ b/tools/cosmovisor/scanner_test.go @@ -13,52 +13,65 @@ func TestParseUpgradeInfoFile(t *testing.T) { cases := []struct { filename string expectUpgrade upgradetypes.Plan - expectErr bool + disableRecase bool + expectErr string }{ { filename: "f1-good.json", + disableRecase: false, expectUpgrade: upgradetypes.Plan{Name: "upgrade1", Info: "some info", Height: 123}, - expectErr: false, }, { filename: "f2-normalized-name.json", + disableRecase: false, expectUpgrade: upgradetypes.Plan{Name: "upgrade2", Info: "some info", Height: 125}, - expectErr: false, + }, + { + filename: "f2-normalized-name.json", + disableRecase: true, + expectUpgrade: upgradetypes.Plan{Name: "Upgrade2", Info: "some info", Height: 125}, }, { filename: "f2-bad-type.json", + disableRecase: false, expectUpgrade: upgradetypes.Plan{}, - expectErr: true, + expectErr: "cannot unmarshal number into Go struct", }, { filename: "f2-bad-type-2.json", + disableRecase: false, expectUpgrade: upgradetypes.Plan{}, - expectErr: true, + expectErr: "height must be greater than 0: invalid request", }, { filename: "f3-empty.json", + disableRecase: false, expectUpgrade: upgradetypes.Plan{}, - expectErr: true, + expectErr: "empty upgrade-info.json in", }, { filename: "f4-empty-obj.json", + disableRecase: false, expectUpgrade: upgradetypes.Plan{}, - expectErr: true, + expectErr: "invalid upgrade-info.json content: name cannot be empty", }, { filename: "f5-partial-obj-1.json", + disableRecase: false, expectUpgrade: upgradetypes.Plan{}, - expectErr: true, + expectErr: "height must be greater than 0", }, { filename: "f5-partial-obj-2.json", + disableRecase: false, expectUpgrade: upgradetypes.Plan{}, - expectErr: true, + expectErr: "name cannot be empty: invalid request", }, { - filename: "unknown.json", + filename: "non-existent.json", + disableRecase: false, expectUpgrade: upgradetypes.Plan{}, - expectErr: true, + expectErr: "no such file or directory", }, } @@ -66,9 +79,10 @@ func TestParseUpgradeInfoFile(t *testing.T) { tc := cases[i] t.Run(tc.filename, func(t *testing.T) { require := require.New(t) - ui, err := parseUpgradeInfoFile(filepath.Join(".", "testdata", "upgrade-files", tc.filename)) - if tc.expectErr { + ui, err := parseUpgradeInfoFile(filepath.Join(".", "testdata", "upgrade-files", tc.filename), tc.disableRecase) + if tc.expectErr != "" { require.Error(err) + require.Contains(err.Error(), tc.expectErr) } else { require.NoError(err) require.Equal(tc.expectUpgrade, ui) diff --git a/tools/cosmovisor/sonar-project.properties b/tools/cosmovisor/sonar-project.properties deleted file mode 100644 index 6b3ea0666a08..000000000000 --- a/tools/cosmovisor/sonar-project.properties +++ /dev/null @@ -1,14 +0,0 @@ -sonar.projectKey=cosmos-sdk-tools-cosmovisor -sonar.organization=cosmos - -sonar.projectName=Cosmos SDK - Cosmovisor -sonar.project.monorepo.enabled=true - -sonar.sources=. -sonar.exclusions=**/*_test.go -sonar.tests=. -sonar.test.inclusions=**/*_test.go -sonar.go.coverage.reportPaths=coverage.out - -sonar.sourceEncoding=UTF-8 -sonar.scm.provider=git \ No newline at end of file diff --git a/tools/cosmovisor/testdata/dontdie/cosmovisor/genesis/bin/dummyd b/tools/cosmovisor/testdata/dontdie/cosmovisor/genesis/bin/dummyd new file mode 100755 index 000000000000..8694ec8e8e0d --- /dev/null +++ b/tools/cosmovisor/testdata/dontdie/cosmovisor/genesis/bin/dummyd @@ -0,0 +1,20 @@ +#!/bin/sh + + +warn() { + echo "WARN Need Flush" +} + +trap warn INT +echo Genesis $@ +sleep 1 +test -z $4 && exit 1001 +echo 'UPGRADE "Chain2" NEEDED at height: 49: {}' +echo '{"name":"Chain2","height":49,"info":""}' > $4 +# Shutdown grace test waits 2 seconds for flush +# Flush within 1 second +sleep 1 +echo 'Flushed' +# Now chain is halted for shutdown grace test. +sleep 2 +echo Did not kill in time. Never should be printed!!! diff --git a/tools/cosmovisor/testdata/dontdie/cosmovisor/upgrades/chain2/bin/dummyd b/tools/cosmovisor/testdata/dontdie/cosmovisor/upgrades/chain2/bin/dummyd new file mode 100755 index 000000000000..0022b84af292 --- /dev/null +++ b/tools/cosmovisor/testdata/dontdie/cosmovisor/upgrades/chain2/bin/dummyd @@ -0,0 +1,6 @@ +#!/bin/sh + +echo Chain 2 is live! +echo Args: $@ +sleep 1 +echo Finished successfully diff --git a/tools/cosmovisor/testdata/dontdie/data/.gitkeep b/tools/cosmovisor/testdata/dontdie/data/.gitkeep new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tools/cosmovisor/testdata/download/cosmovisor/genesis/bin/autod b/tools/cosmovisor/testdata/download/cosmovisor/genesis/bin/autod index f2573651ad3f..c8d7e1e30fa7 100755 --- a/tools/cosmovisor/testdata/download/cosmovisor/genesis/bin/autod +++ b/tools/cosmovisor/testdata/download/cosmovisor/genesis/bin/autod @@ -6,7 +6,13 @@ echo 'ERROR: UPGRADE "chain2" NEEDED at height: 49: zip_binary' # create upgrade info # this info contains directly information about binaries (in chain2->chain3 update we test with info containing a link to the file with an address for the new chain binary) -echo '{"name":"chain2","height":49,"info":"{\"binaries\":{\"linux/amd64\":\"https://github.com/cosmos/cosmos-sdk/raw/main/tools/cosmovisor/testdata/repo/chain2-zip_bin/autod.zip?checksum=sha256:13767eb0b57bf51a0f43d49f6277d5df97d4dec672dc39822d23a82fb8e70a7b\"}}"}' >$3 +cat > "$3" < upgrade_name_$1_height_$2 +echo PWD=`pwd` +echo upgrade_name_$1_height_$2 diff --git a/tools/cosmovisor/testdata/norecase/cosmovisor/genesis/bin/dummyd b/tools/cosmovisor/testdata/norecase/cosmovisor/genesis/bin/dummyd new file mode 100755 index 000000000000..832cee8f62cb --- /dev/null +++ b/tools/cosmovisor/testdata/norecase/cosmovisor/genesis/bin/dummyd @@ -0,0 +1,9 @@ +#!/bin/sh + +echo Genesis $@ +sleep 1 +test -z $4 && exit 1001 +echo 'UPGRADE "Chain2" NEEDED at height: 49: {}' +echo '{"name":"Chain2","height":49,"info":""}' > $4 +sleep 2 +echo Never should be printed!!! diff --git a/tools/cosmovisor/testdata/norecase/cosmovisor/upgrades/Chain2/bin/dummyd b/tools/cosmovisor/testdata/norecase/cosmovisor/upgrades/Chain2/bin/dummyd new file mode 100755 index 000000000000..0022b84af292 --- /dev/null +++ b/tools/cosmovisor/testdata/norecase/cosmovisor/upgrades/Chain2/bin/dummyd @@ -0,0 +1,6 @@ +#!/bin/sh + +echo Chain 2 is live! +echo Args: $@ +sleep 1 +echo Finished successfully diff --git a/tools/cosmovisor/testdata/norecase/data/.gitkeep b/tools/cosmovisor/testdata/norecase/data/.gitkeep new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tools/cosmovisor/testdata/repo/chain2-zip_bin/autod b/tools/cosmovisor/testdata/repo/chain2-zip_bin/autod index 9cad54f4b9b7..f4bcccccc5a8 100755 --- a/tools/cosmovisor/testdata/repo/chain2-zip_bin/autod +++ b/tools/cosmovisor/testdata/repo/chain2-zip_bin/autod @@ -6,8 +6,13 @@ echo Args: $@ echo 'ERROR: UPGRADE "chain3" NEEDED at height: 936: ref_to_chain3-zip_dir.json module=main' # this update info doesn't contain binaries, instead it is a reference for further download instructions. -# echo '{"name":"chain3","height":936,"info":"{\"binaries\":{\"linux/amd64\":\"https://github.com/cosmos/cosmos-sdk/raw/main/tools/cosmovisor/testdata/repo/ref_to_chain3-zip_dir.json?checksum=sha256:a95075f4dd83bc9f0f556ef73e64ce000f9bf3a6beeb9d4ae32f594b1417ef7a\"}}"}' > $3 -echo '{"name":"chain3","height":936,"info":"https://github.com/cosmos/cosmos-sdk/raw/main/tools/cosmovisor/testdata/repo/ref_to_chain3-zip_dir.json?checksum=sha256:a95075f4dd83bc9f0f556ef73e64ce000f9bf3a6beeb9d4ae32f594b1417ef7a"}' >$3 +cat > "$3" <) [#] Changelog message. - -Types of changes (Stanzas): - -"Features" for new features. -"Improvements" for changes in existing functionality. -"Deprecated" for soon-to-be removed features. -"Bug Fixes" for any bug fixes. -"API Breaking" for breaking exported APIs used by developers building on SDK. -Ref: https://keepachangelog.com/en/1.0.0/ ---> - -# Changelog - -## [Unreleased] diff --git a/tools/hubl/Makefile b/tools/hubl/Makefile deleted file mode 100644 index a329b93e383c..000000000000 --- a/tools/hubl/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/make -f - -all: hubl test - -hubl: - go build -mod=readonly ./cmd/hubl - -test: - go test -mod=readonly -race ./... - -.PHONY: all hubl test diff --git a/tools/hubl/README.md b/tools/hubl/README.md deleted file mode 100644 index 97d02921ddbe..000000000000 --- a/tools/hubl/README.md +++ /dev/null @@ -1,73 +0,0 @@ ---- -sidebar_position: 1 ---- - -# Hubl - -`Hubl` is a tool that allows you to query any Cosmos SDK based blockchain. -It takes advantage of the new [AutoCLI](https://pkg.go.dev/github.com/cosmos/cosmos-sdk/client/v2@v2.0.0-20220916140313-c5245716b516/cli) feature of the Cosmos SDK. - -## Installation - -Hubl can be installed using `go install`: - -```shell -go install cosmossdk.io/tools/hubl/cmd/hubl@latest -``` - -Or build from source: - -```shell -git clone --depth=1 https://github.com/cosmos/cosmos-sdk -make hubl -``` - -The binary will be located in `tools/hubl`. - -## Usage - -```shell -hubl --help -``` - -### Add chain - -To configure a new chain just run this command using the --init flag and the name of the chain as it's listed in the chain registry (). - -If the chain is not listed in the chain registry, you can use any unique name. - -```shell -hubl init [chain-name] -hubl init regen -``` - -The chain configuration is stored in `~/.hubl/config.toml`. - -:::tip - -When using an unsecure gRPC endpoint, change the `insecure` field to `true` in the config file. - -```toml -[chains] -[chains.regen] -[[chains.regen.trusted-grpc-endpoints]] -endpoint = 'localhost:9090' -insecure = true -``` - -Or use the `--insecure` flag: - -```shell -hubl init regen --insecure -``` - -::: - -### Query - -To query a chain, you can use the `query` command. -Then specify which module you want to query and the query itself. - -```shell -hubl regen query auth module-accounts -``` diff --git a/tools/hubl/cmd/hubl/main.go b/tools/hubl/cmd/hubl/main.go deleted file mode 100644 index 61aaaad6e657..000000000000 --- a/tools/hubl/cmd/hubl/main.go +++ /dev/null @@ -1,16 +0,0 @@ -package main - -import ( - "cosmossdk.io/tools/hubl/internal" -) - -func main() { - cmd, err := internal.RootCommand() - if err != nil { - panic(err) - } - - if err = cmd.Execute(); err != nil { - panic(err) - } -} diff --git a/tools/hubl/go.mod b/tools/hubl/go.mod deleted file mode 100644 index 43b0af8c80d5..000000000000 --- a/tools/hubl/go.mod +++ /dev/null @@ -1,133 +0,0 @@ -module cosmossdk.io/tools/hubl - -go 1.20 - -require ( - cosmossdk.io/api v0.4.2 - cosmossdk.io/client/v2 v2.0.0-20230607190716-2877190997a2 - cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 - github.com/cockroachdb/errors v1.9.1 - github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230607190716-2877190997a2 - github.com/manifoldco/promptui v0.9.0 - github.com/pelletier/go-toml/v2 v2.0.8 - github.com/spf13/cobra v1.7.0 - google.golang.org/grpc v1.55.0 - google.golang.org/protobuf v1.30.0 -) - -require ( - cosmossdk.io/collections v0.2.0 // indirect - cosmossdk.io/core v0.8.0 // indirect - cosmossdk.io/depinject v1.0.0-alpha.3 // indirect - cosmossdk.io/log v1.1.0 // indirect - cosmossdk.io/math v1.0.1 // indirect - cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c // indirect - cosmossdk.io/x/tx v0.8.0 // indirect - filippo.io/edwards25519 v1.0.0 // indirect - github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect - github.com/99designs/keyring v1.2.1 // indirect - github.com/DataDog/zstd v1.5.5 // indirect - github.com/armon/go-metrics v0.4.1 // indirect - github.com/beorn7/perks v1.0.1 // indirect - github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect - github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect - github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/chzyer/readline v1.5.1 // indirect - github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20230606202032-d96868fd481e // indirect - github.com/cockroachdb/redact v1.1.4 // indirect - github.com/cometbft/cometbft v0.38.0-rc1 // indirect - github.com/cometbft/cometbft-db v0.7.0 // indirect - github.com/cosmos/btcutil v1.0.5 // indirect - github.com/cosmos/cosmos-db v1.0.0 // indirect - github.com/cosmos/cosmos-proto v1.0.0-beta.3 // indirect - github.com/cosmos/go-bip39 v1.0.0 // indirect - github.com/cosmos/gogoproto v1.4.10 // indirect - github.com/cosmos/iavl v1.0.0-beta.2 // indirect - github.com/cosmos/ics23/go v0.10.0 // indirect - github.com/cosmos/ledger-cosmos-go v0.13.0 // indirect - github.com/danieljoos/wincred v1.1.2 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect - github.com/dgraph-io/badger/v2 v2.2007.4 // indirect - 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/dvsekhvalnov/jose2go v1.5.0 // indirect - github.com/emicklei/dot v1.4.2 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/getsentry/sentry-go v0.21.0 // indirect - github.com/go-kit/kit v0.12.0 // indirect - github.com/go-kit/log v0.2.1 // indirect - github.com/go-logfmt/logfmt v0.6.0 // indirect - github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect - github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/glog v1.1.0 // indirect - github.com/golang/protobuf v1.5.3 // indirect - github.com/golang/snappy v0.0.4 // indirect - github.com/google/btree v1.1.2 // indirect - github.com/google/go-cmp v0.5.9 // indirect - github.com/gorilla/websocket v1.5.0 // indirect - github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect - github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect - github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect - github.com/hashicorp/hcl v1.0.0 // indirect - github.com/hdevalence/ed25519consensus v0.1.0 // indirect - github.com/iancoleman/strcase v0.2.0 // indirect - github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.16.5 // indirect - github.com/kr/pretty v0.3.1 // indirect - github.com/kr/text v0.2.0 // indirect - github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.0 // indirect - github.com/magiconair/properties v1.8.7 // indirect - github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.19 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/mitchellh/mapstructure v1.5.0 // indirect - github.com/mtibben/percent v0.2.1 // indirect - github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce // indirect - github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761 // indirect - github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.15.1 // indirect - github.com/prometheus/client_model v0.4.0 // indirect - github.com/prometheus/common v0.44.0 // indirect - github.com/prometheus/procfs v0.10.1 // indirect - github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.10.0 // indirect - github.com/rs/zerolog v1.29.1 // indirect - github.com/sasha-s/go-deadlock v0.3.1 // indirect - github.com/spf13/afero v1.9.5 // indirect - github.com/spf13/cast v1.5.1 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/spf13/pflag v1.0.5 // indirect - github.com/spf13/viper v1.16.0 // indirect - github.com/stretchr/testify v1.8.4 // indirect - github.com/subosito/gotenv v1.4.2 // indirect - github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect - github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect - github.com/tendermint/go-amino v0.16.0 // indirect - github.com/tidwall/btree v1.6.0 // indirect - github.com/zondax/hid v0.9.1 // indirect - github.com/zondax/ledger-go v0.14.1 // indirect - go.etcd.io/bbolt v1.3.6 // indirect - golang.org/x/crypto v0.9.0 // indirect - golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/term v0.8.0 // indirect - golang.org/x/text v0.9.0 // indirect - google.golang.org/genproto v0.0.0-20230525234025-438c736192d0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // 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.4.0 // indirect - pgregory.net/rapid v0.6.2 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect -) diff --git a/tools/hubl/go.sum b/tools/hubl/go.sum deleted file mode 100644 index a805d6da81cc..000000000000 --- a/tools/hubl/go.sum +++ /dev/null @@ -1,1050 +0,0 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= -cosmossdk.io/api v0.4.2 h1:lQBMl4xINnMnBOR/tQLtjlDnR4exr4e6/SfHR8PILE0= -cosmossdk.io/api v0.4.2/go.mod h1:qrVgOp7DIeAXa+Tt5dDjOC47bZCDrwx8ZHxrmy7STNE= -cosmossdk.io/client/v2 v2.0.0-20230607190716-2877190997a2 h1:x4eu8xjihip1U+WCuOrK3rcyMSe28HS9D8ZPyoONrcE= -cosmossdk.io/client/v2 v2.0.0-20230607190716-2877190997a2/go.mod h1:Khq/WZqGHSgFlwPI6Ui47UE9RzblIze7iMX+s3nu3eM= -cosmossdk.io/collections v0.2.0 h1:CgMfLtE16+qox3zBYrGh60i4yKV8SeExLnIdOS2sbQs= -cosmossdk.io/collections v0.2.0/go.mod h1:Oc1FK0vlmxJZsgUn9/o3ldE6zNyWKvobVzaLhWknZJE= -cosmossdk.io/core v0.8.0 h1:LcJnu52E1a8f8E317VfQ1xK/RZe+IuhMNQAjnDLh25M= -cosmossdk.io/core v0.8.0/go.mod h1:LF6VLOv2DdCiaHxYVmr0MZcZpaSM9ZgvyrQSYTeg6D0= -cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw= -cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= -cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 h1:BCRz06fvddw7cKGiEGDiSox3qMsjQ97f92K+PDZDHdc= -cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741/go.mod h1:TB05o6YXkZkzsc+6bZFAV5kZRBtoCU9tUkbeMIqEg0w= -cosmossdk.io/log v1.1.0 h1:v0ogPHYeTzPcBTcPR1A3j1hkei4pZama8kz8LKlCMv0= -cosmossdk.io/log v1.1.0/go.mod h1:6zjroETlcDs+mm62gd8Ig7mZ+N+fVOZS91V17H+M4N4= -cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= -cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= -cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c h1:A+FMPW9GtfcPBDQNtFeDFN27h1SAP6OVjnGgPLlYXmI= -cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c/go.mod h1:RbYGvXCbz8uNBCXrwS9Z8SyydeWi+W5x5MZ33muyzMw= -cosmossdk.io/x/tx v0.8.0 h1:gLiGRL/Fy7fs6dd0IX8jOf0PrVr56/SG6XVMGQjyvJU= -cosmossdk.io/x/tx v0.8.0/go.mod h1:T9uEumGNgKU61gJYRv1t3uzQwLnASpJGmSE229HM3xA= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= -filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= -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/99designs/keyring v1.2.1 h1:tYLp1ULvO7i3fI5vE21ReQuj99QFSs7lGm0xWyJo87o= -github.com/99designs/keyring v1.2.1/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= -github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= -github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= -github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= -github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= -github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= -github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= -github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= -github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= -github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= -github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= -github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= -github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= -github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= -github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= -github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= -github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM= -github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI= -github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/chzyer/test v1.0.0 h1:p3BQDXSxOhOG0P9z6/hGnII4LGiEPOYBhs8asl/fC04= -github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8= -github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= -github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= -github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= -github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= -github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= -github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/pebble v0.0.0-20230606202032-d96868fd481e h1:6QuLTQCQZueVNzoYYUuFfaRgBOpj6gIwQA1PZT2rfWM= -github.com/cockroachdb/pebble v0.0.0-20230606202032-d96868fd481e/go.mod h1:TkdVsGYRqtULUppt2RbC+YaKtTHnHoWa2apfFrSKABw= -github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/cockroachdb/redact v1.1.4 h1:Y0XrVI2FAyofNyGveodTN//qdpPtFKcKTeCBsK3AHAQ= -github.com/cockroachdb/redact v1.1.4/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= -github.com/cometbft/cometbft v0.38.0-rc1 h1:ph6smlqX82aH+d72KuxDHqu29M7LyusSp/obfGsGX/w= -github.com/cometbft/cometbft v0.38.0-rc1/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= -github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= -github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= -github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= -github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0E= -github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= -github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= -github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230607190716-2877190997a2 h1:upDBxuP9BfUz5DtMJGh1mj9YZ2M+mBOrBvsv7ufb7gI= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230607190716-2877190997a2/go.mod h1:H194vsGW6Qo0RVp5inetgU31+s2rk7RKgeztTnxChgM= -github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= -github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= -github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= -github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoKuI= -github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= -github.com/cosmos/iavl v1.0.0-beta.2 h1:XOsIM80Yyml/KifCXEYOy9tWCXwMAbLa91n6pReW07Y= -github.com/cosmos/iavl v1.0.0-beta.2/go.mod h1:EA97dJ07TBktRlG/iGzK6g1eCXNj1q3MGoFYkVzrwHE= -github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= -github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= -github.com/cosmos/ledger-cosmos-go v0.13.0 h1:ex0CvCxToSR7j5WjrghPu2Bu9sSXKikjnVvUryNnx4s= -github.com/cosmos/ledger-cosmos-go v0.13.0/go.mod h1:ZcqYgnfNJ6lAXe4HPtWgarNEY+B74i+2/8MhZw4ziiI= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= -github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= -github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= -github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= -github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= -github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= -github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= -github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= -github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= -github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= -github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= -github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= -github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -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/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= -github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= -github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= -github.com/emicklei/dot v1.4.2 h1:UbK6gX4yvrpHKlxuUQicwoAis4zl8Dzwit9SnbBAXWw= -github.com/emicklei/dot v1.4.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= -github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= -github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= -github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= -github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= -github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= -github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= -github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= -github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= -github.com/getsentry/sentry-go v0.21.0 h1:c9l5F1nPF30JIppulk4veau90PK6Smu3abgVtVQWon4= -github.com/getsentry/sentry-go v0.21.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= -github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= -github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= -github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= -github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= -github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= -github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= -github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= -github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= -github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= -github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= -github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= -github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= -github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= -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.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= -github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= -github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= -github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -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/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -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= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= -github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= -github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= -github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= -github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -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/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= -github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-plugin v1.4.10 h1:xUbmA4jC6Dq163/fWcp8P3JuHilrHHMLNRxzGQJ9hNk= -github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= -github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= -github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= -github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw= -github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= -github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= -github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= -github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= -github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= -github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= -github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= -github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= -github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= -github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= -github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= -github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= -github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= -github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= -github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= -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/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI= -github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= -github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -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.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= -github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= -github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= -github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= -github.com/linxGnu/grocksdb v1.8.0 h1:H4L/LhP7GOMf1j17oQAElHgVlbEje2h14A8Tz9cM2BE= -github.com/linxGnu/grocksdb v1.8.0/go.mod h1:09CeBborffXhXdNpEcOeZrLKEnRtrZFEpFdPNI9Zjjg= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= -github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= -github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= -github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.8/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= -github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= -github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= -github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= -github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= -github.com/mitchellh/mapstructure v1.1.2/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= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= -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/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= -github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= -github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= -github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce h1:/pEpMk55wH0X+E5zedGEMOdLuWmV8P4+4W3+LZaM6kg= -github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= -github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= -github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= -github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= -github.com/onsi/gomega v1.26.0 h1:03cDLK28U6hWvCAns6NeydX3zIm4SF3ci69ulidS32Q= -github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= -github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= -github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= -github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761 h1:W04oB3d0J01W5jgYRGKsV8LCM6g9EkCvPkZcmFuy0OE= -github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= -github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= -github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= -github.com/prometheus/client_golang v1.15.1 h1:8tXpTmJbyH5lydzFPoxSIJ0J46jdh3tylbvM1xCv0LI= -github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= -github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= -github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= -github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= -github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= -github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= -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/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= -github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= -github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= -github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.29.1 h1:cO+d60CHkknCbvzEWxP0S9K6KqyTjrCNUy1LdQLCGPc= -github.com/rs/zerolog v1.29.1/go.mod h1:Le6ESbR7hc+DP6Lt1THiV8CQSdkkNrd3R0XbEgp3ZBU= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -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/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= -github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= -github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= -github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= -github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= -github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= -github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= -github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= -github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= -github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= -github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= -github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= -github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= -github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= -github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= -github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= -github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= -github.com/zondax/ledger-go v0.14.1 h1:Pip65OOl4iJ84WTpA4BKChvOufMhhbxED3BaihoZN4c= -github.com/zondax/ledger-go v0.14.1/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2feOQv8K320= -go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= -go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= -golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -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= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -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= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -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-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= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -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.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -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= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -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= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181221001348-537d06c36207/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-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -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= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -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-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20230525234025-438c736192d0 h1:x1vNwUhVOcsYoKyEGCZBH694SBmmBjA2EfauFVEI2+M= -google.golang.org/genproto v0.0.0-20230525234025-438c736192d0/go.mod h1:9ExIQyXL5hZrHzQceCwuSYwZZ5QZBazOcprJ5rgs3lY= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a h1:HiYVD+FGJkTo+9zj1gqz0anapsa1JxjiSrN+BJKyUmE= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a/go.mod h1:ts19tUU+Z0ZShN1y3aPyq2+O3d5FUNNgT6FtOzmrNn8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -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/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= -gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -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/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -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= -gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= -gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -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= -nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= -pgregory.net/rapid v0.6.2 h1:ErW5sL+UKtfBfUTsWHDCoeB+eZKLKMxrSd1VJY6W4bw= -pgregory.net/rapid v0.6.2/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/tools/hubl/internal/compat.go b/tools/hubl/internal/compat.go deleted file mode 100644 index 8ef10f5524bb..000000000000 --- a/tools/hubl/internal/compat.go +++ /dev/null @@ -1,279 +0,0 @@ -package internal - -import ( - "context" - "fmt" - "io" - "strings" - - autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" - reflectionv1beta1 "cosmossdk.io/api/cosmos/base/reflection/v1beta1" - "google.golang.org/grpc" - "google.golang.org/grpc/reflection/grpc_reflection_v1" - "google.golang.org/protobuf/proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" - "google.golang.org/protobuf/types/descriptorpb" -) - -// loadFileDescriptorsGRPCReflection attempts to load the file descriptor set using gRPC reflection when cosmos.reflection.v1 -// is unavailable. -func loadFileDescriptorsGRPCReflection(ctx context.Context, client *grpc.ClientConn) (*descriptorpb.FileDescriptorSet, error) { - fmt.Printf("This chain does not support cosmos.reflection.v1 yet... attempting to use a fallback. Some features may be unsupported and it may not be possible to read all data.\n") - - var interfaceImplNames []string - cosmosReflectBetaClient := reflectionv1beta1.NewReflectionServiceClient(client) - interfacesRes, err := cosmosReflectBetaClient.ListAllInterfaces(ctx, &reflectionv1beta1.ListAllInterfacesRequest{}) - if err == nil { - for _, iface := range interfacesRes.InterfaceNames { - implRes, err := cosmosReflectBetaClient.ListImplementations(ctx, &reflectionv1beta1.ListImplementationsRequest{ - InterfaceName: iface, - }) - if err == nil { - interfaceImplNames = append(interfaceImplNames, implRes.ImplementationMessageNames...) - } - } - } - - reflectClient, err := grpc_reflection_v1.NewServerReflectionClient(client).ServerReflectionInfo(ctx) - if err != nil { - return nil, err - } - - fdMap := map[string]*descriptorpb.FileDescriptorProto{} - waitListServiceRes := make(chan *grpc_reflection_v1.ListServiceResponse) - waitc := make(chan struct{}) - go func() { - for { - in, err := reflectClient.Recv() - if err == io.EOF { - // read done. - close(waitc) - return - } - if err != nil { - panic(err) - } - - switch res := in.MessageResponse.(type) { - case *grpc_reflection_v1.ServerReflectionResponse_ListServicesResponse: - waitListServiceRes <- res.ListServicesResponse - case *grpc_reflection_v1.ServerReflectionResponse_FileDescriptorResponse: - processFileDescriptorsResponse(res, fdMap) - } - } - }() - - if err = reflectClient.Send(&grpc_reflection_v1.ServerReflectionRequest{ - MessageRequest: &grpc_reflection_v1.ServerReflectionRequest_ListServices{}, - }); err != nil { - return nil, err - } - - listServiceRes := <-waitListServiceRes - - for _, response := range listServiceRes.Service { - err = reflectClient.Send(&grpc_reflection_v1.ServerReflectionRequest{ - MessageRequest: &grpc_reflection_v1.ServerReflectionRequest_FileContainingSymbol{ - FileContainingSymbol: response.Name, - }, - }) - if err != nil { - return nil, err - } - } - - for _, msgName := range interfaceImplNames { - err = reflectClient.Send(&grpc_reflection_v1.ServerReflectionRequest{ - MessageRequest: &grpc_reflection_v1.ServerReflectionRequest_FileContainingSymbol{ - FileContainingSymbol: msgName, - }, - }) - if err != nil { - return nil, err - } - } - - if err = reflectClient.CloseSend(); err != nil { - return nil, err - } - - <-waitc - - // we loop through all the file descriptor dependencies to capture any file descriptors we haven't loaded yet - cantFind := map[string]bool{} - for { - missing := missingFileDescriptors(fdMap, cantFind) - if len(missing) == 0 { - break - } - - err = addMissingFileDescriptors(ctx, client, fdMap, missing) - if err != nil { - return nil, err - } - - // mark all deps that we aren't able to resolve as can't find, so we don't keep looping and get a 429 error - for _, dep := range missing { - if fdMap[dep] == nil { - cantFind[dep] = true - } - } - } - - for dep := range cantFind { - fmt.Printf("Warning: can't find %s.\n", dep) - } - - fdSet := &descriptorpb.FileDescriptorSet{} - for _, descriptorProto := range fdMap { - fdSet.File = append(fdSet.File, descriptorProto) - } - - return fdSet, nil -} - -func processFileDescriptorsResponse(res *grpc_reflection_v1.ServerReflectionResponse_FileDescriptorResponse, fdMap map[string]*descriptorpb.FileDescriptorProto) { - for _, bz := range res.FileDescriptorResponse.FileDescriptorProto { - fd := &descriptorpb.FileDescriptorProto{} - err := proto.Unmarshal(bz, fd) - if err != nil { - panic(err) - } - - fdMap[fd.GetName()] = fd - } -} - -func missingFileDescriptors(fdMap map[string]*descriptorpb.FileDescriptorProto, cantFind map[string]bool) []string { - var missing []string - for _, descriptorProto := range fdMap { - for _, dep := range descriptorProto.Dependency { - if fdMap[dep] == nil && !cantFind[dep] /* skip deps we've marked as can't find */ { - missing = append(missing, dep) - } - } - } - return missing -} - -func addMissingFileDescriptors(ctx context.Context, client *grpc.ClientConn, fdMap map[string]*descriptorpb.FileDescriptorProto, missingFiles []string) error { - reflectClient, err := grpc_reflection_v1.NewServerReflectionClient(client).ServerReflectionInfo(ctx) - if err != nil { - return err - } - - waitc := make(chan struct{}) - go func() { - for { - in, err := reflectClient.Recv() - if err == io.EOF { - // read done. - close(waitc) - return - } - if err != nil { - panic(err) - } - - if res, ok := in.MessageResponse.(*grpc_reflection_v1.ServerReflectionResponse_FileDescriptorResponse); ok { - processFileDescriptorsResponse(res, fdMap) - } - } - }() - - for _, file := range missingFiles { - err = reflectClient.Send(&grpc_reflection_v1.ServerReflectionRequest{ - MessageRequest: &grpc_reflection_v1.ServerReflectionRequest_FileByFilename{ - FileByFilename: file, - }, - }) - if err != nil { - return err - } - } - - err = reflectClient.CloseSend() - if err != nil { - return err - } - - <-waitc - return nil -} - -func guessAutocli(files *protoregistry.Files) *autocliv1.AppOptionsResponse { - fmt.Printf("This chain does not support autocli directly yet. Using some default mappings in the meantime to support a subset of the available services.\n") - res := map[string]*autocliv1.ModuleOptions{} - files.RangeFiles(func(descriptor protoreflect.FileDescriptor) bool { - services := descriptor.Services() - n := services.Len() - for i := 0; i < n; i++ { - service := services.Get(i) - serviceName := service.FullName() - mapping, ok := defaultAutocliMappings[serviceName] - if ok { - parts := strings.Split(mapping, " ") - numParts := len(parts) - if numParts < 2 || numParts > 3 { - fmt.Printf("Warning: bad mapping %q found for %q\n", mapping, serviceName) - continue - } - - modOpts := res[parts[0]] - if modOpts == nil { - modOpts = &autocliv1.ModuleOptions{} - res[parts[0]] = modOpts - } - - switch parts[1] { - case "query": - if modOpts.Query == nil { - modOpts.Query = &autocliv1.ServiceCommandDescriptor{ - SubCommands: map[string]*autocliv1.ServiceCommandDescriptor{}, - } - } - if numParts == 3 { - modOpts.Query.SubCommands[parts[2]] = &autocliv1.ServiceCommandDescriptor{Service: string(serviceName)} - } else { - modOpts.Query.Service = string(serviceName) - } - case "tx": - if modOpts.Tx == nil { - modOpts.Tx = &autocliv1.ServiceCommandDescriptor{ - SubCommands: map[string]*autocliv1.ServiceCommandDescriptor{}, - } - } - if numParts == 3 { - modOpts.Tx.SubCommands[parts[2]] = &autocliv1.ServiceCommandDescriptor{Service: string(serviceName)} - } else { - modOpts.Tx.Service = string(serviceName) - } - default: - fmt.Printf("Warning: bad mapping %q found for %q\n", mapping, serviceName) - continue - } - } - } - return true - }) - - return &autocliv1.AppOptionsResponse{ModuleOptions: res} -} - -var defaultAutocliMappings = map[protoreflect.FullName]string{ - "cosmos.auth.v1beta1.Query": "auth query", - "cosmos.authz.v1beta1.Query": "authz query", - "cosmos.bank.v1beta1.Query": "bank query", - "cosmos.distribution.v1beta1.Query": "distribution query", - "cosmos.evidence.v1.Query": "evidence query", - "cosmos.feegrant.v1beta1.Query": "feegrant query", - "cosmos.gov.v1.Query": "gov query", - "cosmos.gov.v1beta1.Query": "gov query v1beta1", - "cosmos.group.v1.Query": "group query", - "cosmos.mint.v1beta1.Query": "mint query", - "cosmos.params.v1beta1.Query": "params query", - "cosmos.slashing.v1beta1.Query": "slashing query", - "cosmos.staking.v1beta1.Query": "staking query", - "cosmos.upgrade.v1.Query": "upgrade query", -} diff --git a/tools/hubl/internal/config.go b/tools/hubl/internal/config.go deleted file mode 100644 index 136c6e7f6068..000000000000 --- a/tools/hubl/internal/config.go +++ /dev/null @@ -1,67 +0,0 @@ -package internal - -import ( - "bytes" - "os" - "path" - - "cosmossdk.io/errors" - "github.com/pelletier/go-toml/v2" -) - -type Config struct { - Chains map[string]*ChainConfig `toml:"chains"` -} - -type ChainConfig struct { - GRPCEndpoints []GRPCEndpoint `toml:"trusted-grpc-endpoints"` - Bech32Prefix string `toml:"bech32-prefix"` -} - -type GRPCEndpoint struct { - Endpoint string `toml:"endpoint"` - Insecure bool `toml:"insecure"` -} - -func LoadConfig(configDir string) (*Config, error) { - configPath := configFilename(configDir) - - if _, err := os.Stat(configPath); os.IsNotExist(err) { - return &Config{Chains: map[string]*ChainConfig{}}, nil - } - - bz, err := os.ReadFile(configPath) - if err != nil { - return nil, errors.Wrapf(err, "can't read config file: %s", configPath) - } - - config := &Config{} - if err = toml.Unmarshal(bz, config); err != nil { - return nil, errors.Wrapf(err, "can't load config file: %s", configPath) - } - - return config, err -} - -func SaveConfig(configDir string, config *Config) error { - buf := &bytes.Buffer{} - enc := toml.NewEncoder(buf) - if err := enc.Encode(config); err != nil { - return err - } - - if err := os.MkdirAll(configDir, 0o755); err != nil { - return err - } - - configPath := configFilename(configDir) - if err := os.WriteFile(configPath, buf.Bytes(), 0o600); err != nil { - return err - } - - return nil -} - -func configFilename(configDir string) string { - return path.Join(configDir, "config.toml") -} diff --git a/tools/hubl/internal/load.go b/tools/hubl/internal/load.go deleted file mode 100644 index 6572beafa746..000000000000 --- a/tools/hubl/internal/load.go +++ /dev/null @@ -1,203 +0,0 @@ -package internal - -import ( - "context" - "crypto/tls" - "errors" - "fmt" - "os" - "path" - - cockroachdberrors "github.com/cockroachdb/errors" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials" - "google.golang.org/grpc/credentials/insecure" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protodesc" - "google.golang.org/protobuf/reflect/protoregistry" - "google.golang.org/protobuf/types/descriptorpb" - - autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" - reflectionv2alpha1 "cosmossdk.io/api/cosmos/base/reflection/v2alpha1" - reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" -) - -const DefaultConfigDirName = ".hubl" - -type ChainInfo struct { - client *grpc.ClientConn - - Context context.Context - ConfigDir string - Chain string - Config *ChainConfig - - ProtoFiles *protoregistry.Files - ModuleOptions map[string]*autocliv1.ModuleOptions -} - -func NewChainInfo(configDir, chain string, config *ChainConfig) *ChainInfo { - return &ChainInfo{ - Context: context.Background(), - Config: config, - Chain: chain, - ConfigDir: configDir, - } -} - -func (c *ChainInfo) getCacheDir() (string, error) { - cacheDir := path.Join(c.ConfigDir, "cache") - return cacheDir, os.MkdirAll(cacheDir, 0o755) -} - -func (c *ChainInfo) fdsCacheFilename() (string, error) { - cacheDir, err := c.getCacheDir() - if err != nil { - return "", err - } - return path.Join(cacheDir, fmt.Sprintf("%s.fds", c.Chain)), nil -} - -func (c *ChainInfo) appOptsCacheFilename() (string, error) { - cacheDir, err := c.getCacheDir() - if err != nil { - return "", err - } - return path.Join(cacheDir, fmt.Sprintf("%s.autocli", c.Chain)), nil -} - -func (c *ChainInfo) Load(reload bool) error { - fdSet := &descriptorpb.FileDescriptorSet{} - fdsFilename, err := c.fdsCacheFilename() - if err != nil { - return err - } - - if _, err := os.Stat(fdsFilename); os.IsNotExist(err) || reload { - client, err := c.OpenClient() - if err != nil { - return err - } - - reflectionClient := reflectionv1.NewReflectionServiceClient(client) - fdRes, err := reflectionClient.FileDescriptors(c.Context, &reflectionv1.FileDescriptorsRequest{}) - if err != nil { - fdSet, err = loadFileDescriptorsGRPCReflection(c.Context, client) - if err != nil { - return err - } - } else { - fdSet = &descriptorpb.FileDescriptorSet{File: fdRes.Files} - } - - bz, err := proto.Marshal(fdSet) - if err != nil { - return err - } - - if err = os.WriteFile(fdsFilename, bz, 0o600); err != nil { - return err - } - } else { - bz, err := os.ReadFile(fdsFilename) - if err != nil { - return err - } - - if err = proto.Unmarshal(bz, fdSet); err != nil { - return err - } - } - - c.ProtoFiles, err = protodesc.FileOptions{AllowUnresolvable: true}.NewFiles(fdSet) - if err != nil { - return fmt.Errorf("error building protoregistry.Files: %w", err) - } - - appOptsFilename, err := c.appOptsCacheFilename() - if err != nil { - return err - } - - if _, err := os.Stat(appOptsFilename); os.IsNotExist(err) || reload { - client, err := c.OpenClient() - if err != nil { - return err - } - - autocliQueryClient := autocliv1.NewQueryClient(client) - appOptsRes, err := autocliQueryClient.AppOptions(c.Context, &autocliv1.AppOptionsRequest{}) - if err != nil { - appOptsRes = guessAutocli(c.ProtoFiles) - } - - bz, err := proto.Marshal(appOptsRes) - if err != nil { - return err - } - - if err := os.WriteFile(appOptsFilename, bz, 0o600); err != nil { - return err - } - - c.ModuleOptions = appOptsRes.ModuleOptions - } else { - bz, err := os.ReadFile(appOptsFilename) - if err != nil { - return err - } - - var appOptsRes autocliv1.AppOptionsResponse - if err := proto.Unmarshal(bz, &appOptsRes); err != nil { - return err - } - - c.ModuleOptions = appOptsRes.ModuleOptions - } - - return nil -} - -func (c *ChainInfo) OpenClient() (*grpc.ClientConn, error) { - if c.client != nil { - return c.client, nil - } - - var res error - for _, endpoint := range c.Config.GRPCEndpoints { - var creds credentials.TransportCredentials - if endpoint.Insecure { - creds = insecure.NewCredentials() - } else { - creds = credentials.NewTLS(&tls.Config{ - MinVersion: tls.VersionTLS12, - }) - } - - var err error - c.client, err = grpc.Dial(endpoint.Endpoint, grpc.WithTransportCredentials(creds)) - if err != nil { - res = errors.Join(res, err) - continue - } - - return c.client, nil - } - - return nil, cockroachdberrors.Wrapf(res, "error loading gRPC client") -} - -// getAddressPrefix returns the address prefix of the chain. -func getAddressPrefix(ctx context.Context, conn grpc.ClientConnInterface) (string, error) { - reflectionClient := reflectionv2alpha1.NewReflectionServiceClient(conn) - resp, err := reflectionClient.GetConfigurationDescriptor(ctx, &reflectionv2alpha1.GetConfigurationDescriptorRequest{}) - if err != nil { - return "", err - } - - if resp == nil || resp.Config == nil || resp.Config.Bech32AccountAddressPrefix == "" { - return "", cockroachdberrors.New("bech32 account address prefix is not set") - } - - return resp.Config.Bech32AccountAddressPrefix, nil -} diff --git a/tools/hubl/internal/registry.go b/tools/hubl/internal/registry.go deleted file mode 100644 index eb170d731980..000000000000 --- a/tools/hubl/internal/registry.go +++ /dev/null @@ -1,101 +0,0 @@ -package internal - -import ( - "encoding/json" - "fmt" - "io" - "net/http" - "strings" - - "github.com/manifoldco/promptui" -) - -type ChainRegistryEntry struct { - APIs ChainRegistryAPIs `json:"apis"` -} - -type ChainRegistryAPIs struct { - GRPC []*APIEntry `json:"grpc"` -} - -type APIEntry struct { - Address string - Provider string -} - -func GetChainRegistryEntry(chain string) (*ChainRegistryEntry, error) { - res, err := http.Get(fmt.Sprintf("https://raw.githubusercontent.com/cosmos/chain-registry/master/%v/chain.json", chain)) - if err != nil { - return nil, err - } - - bz, err := io.ReadAll(res.Body) - if err != nil { - return nil, err - } - - data := &ChainRegistryEntry{} - if err = json.Unmarshal(bz, data); err != nil { - return nil, err - } - - // clean-up the URL - cleanEntries := make([]*APIEntry, 0) - for i, apiEntry := range data.APIs.GRPC { - // clean-up the http(s):// prefix - if strings.Contains(apiEntry.Address, "https://") { - data.APIs.GRPC[i].Address = strings.Replace(apiEntry.Address, "https://", "", 1) - } else if strings.Contains(apiEntry.Address, "http://") { - data.APIs.GRPC[i].Address = strings.Replace(apiEntry.Address, "http://", "", 1) - } - - // remove trailing slashes - data.APIs.GRPC[i].Address = strings.TrimSuffix(data.APIs.GRPC[i].Address, "/") - - // remove addresses without a port - if !strings.Contains(data.APIs.GRPC[i].Address, ":") { - continue - } - - cleanEntries = append(cleanEntries, data.APIs.GRPC[i]) - } - - data.APIs.GRPC = cleanEntries - fmt.Printf("Found data for %s in the chain registry\n", chain) - return data, nil -} - -func SelectGRPCEndpoints(chain string) (string, error) { - entry, err := GetChainRegistryEntry(chain) - if err != nil { - fmt.Printf("Unable to load data for %s in the chain registry. Specify a custom gRPC endpoint manually.\n", chain) - prompt := &promptui.Prompt{ - Label: "Enter a gRPC endpoint that you trust", - } - return prompt.Run() - } - - var items []string - if entry != nil { - for _, apiEntry := range entry.APIs.GRPC { - items = append(items, fmt.Sprintf("%s: %s", apiEntry.Provider, apiEntry.Address)) - } - } - prompt := promptui.SelectWithAdd{ - Label: fmt.Sprintf("Select a gRPC endpoint that you trust for the %s network", chain), - Items: items, - AddLabel: "Custom endpoint:", - } - - i, ep, err := prompt.Run() - if err != nil { - return "", err - } - - // user selected a custom endpoint - if i == -1 { - return ep, nil - } - - return entry.APIs.GRPC[i].Address, nil -} diff --git a/tools/hubl/internal/remote.go b/tools/hubl/internal/remote.go deleted file mode 100644 index 0f4ef0684f83..000000000000 --- a/tools/hubl/internal/remote.go +++ /dev/null @@ -1,256 +0,0 @@ -package internal - -import ( - "context" - "fmt" - "os" - "path" - "strings" - - "github.com/spf13/cobra" - "google.golang.org/grpc" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" - "google.golang.org/protobuf/types/dynamicpb" - - addresscodec "github.com/cosmos/cosmos-sdk/codec/address" - - "cosmossdk.io/client/v2/autocli" - "cosmossdk.io/client/v2/autocli/flag" -) - -var ( - flagInsecure = "insecure" - flagUpdate = "update" - flagConfig = "config" -) - -func RootCommand() (*cobra.Command, error) { - homeDir, err := os.UserHomeDir() - if err != nil { - return nil, err - } - - configDir := path.Join(homeDir, DefaultConfigDirName) - config, err := LoadConfig(configDir) - if err != nil { - return nil, err - } - - cmd := &cobra.Command{ - Use: "hubl", - Short: "Hubl is a CLI for interacting with Cosmos SDK chains", - Long: "Hubl is a CLI for interacting with Cosmos SDK chains", - } - - // add commands - commands, err := RemoteCommand(config, configDir) - if err != nil { - return nil, err - } - commands = append(commands, InitCommand(config, configDir)) - - cmd.AddCommand(commands...) - return cmd, nil -} - -func InitCommand(config *Config, configDir string) *cobra.Command { - var insecure bool - - cmd := &cobra.Command{ - Use: "init [foochain]", - Short: "Initialize a new chain", - Long: `To configure a new chain just run this command using the --init flag and the name of the chain as it's listed in the chain registry (https://github.com/cosmos/chain-registry). -If the chain is not listed in the chain registry, you can use any unique name.`, - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - chainName := strings.ToLower(args[0]) - - return reconfigure(cmd, config, configDir, chainName) - }, - } - - cmd.Flags().BoolVar(&insecure, flagInsecure, false, "allow setting up insecure gRPC connection") - - return cmd -} - -func RemoteCommand(config *Config, configDir string) ([]*cobra.Command, error) { - commands := []*cobra.Command{} - - for chain, chainConfig := range config.Chains { - chain, chainConfig := chain, chainConfig - - // load chain info - chainInfo := NewChainInfo(configDir, chain, chainConfig) - if err := chainInfo.Load(false); err != nil { - commands = append(commands, RemoteErrorCommand(config, configDir, chain, chainConfig, err)) - continue - } - - appOpts := autocli.AppOptions{ - ModuleOptions: chainInfo.ModuleOptions, - } - - builder := &autocli.Builder{ - Builder: flag.Builder{ - AddressCodec: addresscodec.NewBech32Codec(chainConfig.Bech32Prefix), - TypeResolver: &dynamicTypeResolver{chainInfo}, - FileResolver: chainInfo.ProtoFiles, - }, - GetClientConn: func(command *cobra.Command) (grpc.ClientConnInterface, error) { - return chainInfo.OpenClient() - }, - AddQueryConnFlags: func(command *cobra.Command) {}, - } - - var ( - update bool - reconfig bool - insecure bool - ) - - chainCmd := &cobra.Command{ - Use: chain, - Short: fmt.Sprintf("Commands for the %s chain", chain), - RunE: func(cmd *cobra.Command, args []string) error { - switch { - case reconfig: - return reconfigure(cmd, config, configDir, chain) - case update: - cmd.Printf("Updating autocli data for %s\n", chain) - return chainInfo.Load(true) - default: - return cmd.Help() - } - }, - } - chainCmd.Flags().BoolVar(&update, flagUpdate, false, "update the CLI commands for the selected chain (should be used after every chain upgrade)") - chainCmd.Flags().BoolVar(&reconfig, flagConfig, false, "re-configure the selected chain (allows choosing a new gRPC endpoint and refreshes data") - chainCmd.Flags().BoolVar(&insecure, flagInsecure, false, "allow re-configuring the selected chain using an insecure gRPC connection") - - if err := appOpts.EnhanceRootCommandWithBuilder(chainCmd, builder); err != nil { - return nil, err - } - - commands = append(commands, chainCmd) - } - - return commands, nil -} - -func RemoteErrorCommand(config *Config, configDir, chain string, chainConfig *ChainConfig, err error) *cobra.Command { - cmd := &cobra.Command{ - Use: chain, - Short: "Unable to load data", - Long: "Unable to load data, reconfiguration needed.", - RunE: func(cmd *cobra.Command, args []string) error { - cmd.Printf("Error loading chain data for %s: %+v\n", chain, err) - - return reconfigure(cmd, config, configDir, chain) - }, - } - - cmd.Flags().Bool(flagInsecure, chainConfig.GRPCEndpoints[0].Insecure, "allow setting up insecure gRPC connection") - - return cmd -} - -func reconfigure(cmd *cobra.Command, config *Config, configDir, chain string) error { - insecure, _ := cmd.Flags().GetBool(flagInsecure) - - cmd.Printf("Configuring %s\n", chain) - endpoint, err := SelectGRPCEndpoints(chain) - if err != nil { - return err - } - - cmd.Printf("%s endpoint selected\n", endpoint) - chainConfig := &ChainConfig{ - GRPCEndpoints: []GRPCEndpoint{ - { - Endpoint: endpoint, - Insecure: insecure, - }, - }, - } - - chainInfo := NewChainInfo(configDir, chain, chainConfig) - if err = chainInfo.Load(true); err != nil { - return err - } - - client, err := chainInfo.OpenClient() - if err != nil { - return err - } - - addressPrefix, err := getAddressPrefix(context.Background(), client) - if err != nil { - return err - } - - chainConfig.Bech32Prefix = addressPrefix - config.Chains[chain] = chainConfig - - if err := SaveConfig(configDir, config); err != nil { - return err - } - - cmd.Printf("Configuration saved to %s\n", configDir) - return nil -} - -type dynamicTypeResolver struct { - *ChainInfo -} - -var ( - _ protoregistry.MessageTypeResolver = dynamicTypeResolver{} - _ protoregistry.ExtensionTypeResolver = dynamicTypeResolver{} -) - -func (d dynamicTypeResolver) FindMessageByName(message protoreflect.FullName) (protoreflect.MessageType, error) { - desc, err := d.ProtoFiles.FindDescriptorByName(message) - if err != nil { - return nil, err - } - - return dynamicpb.NewMessageType(desc.(protoreflect.MessageDescriptor)), nil -} - -func (d dynamicTypeResolver) FindMessageByURL(url string) (protoreflect.MessageType, error) { - if i := strings.LastIndexByte(url, '/'); i >= 0 { - url = url[i+len("/"):] - } - - return d.FindMessageByName(protoreflect.FullName(url)) -} - -func (d dynamicTypeResolver) FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error) { - desc, err := d.ProtoFiles.FindDescriptorByName(field) - if err != nil { - return nil, err - } - - return dynamicpb.NewExtensionType(desc.(protoreflect.ExtensionTypeDescriptor)), nil -} - -func (d dynamicTypeResolver) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) { - desc, err := d.ProtoFiles.FindDescriptorByName(message) - if err != nil { - return nil, err - } - - messageDesc := desc.(protoreflect.MessageDescriptor) - exts := messageDesc.Extensions() - n := exts.Len() - for i := 0; i < n; i++ { - ext := exts.Get(i) - if ext.Number() == field { - return dynamicpb.NewExtensionType(ext), nil - } - } - - return nil, protoregistry.NotFound -} diff --git a/tools/hubl/sonar-project.properties b/tools/hubl/sonar-project.properties deleted file mode 100644 index 87b389a5412f..000000000000 --- a/tools/hubl/sonar-project.properties +++ /dev/null @@ -1,14 +0,0 @@ -sonar.projectKey=cosmos-sdk-tools-hubl -sonar.organization=cosmos - -sonar.projectName=Cosmos SDK - Hubl -sonar.project.monorepo.enabled=true - -sonar.sources=. -sonar.exclusions=**/*_test.go -sonar.tests=. -sonar.test.inclusions=**/*_test.go -sonar.go.coverage.reportPaths=coverage.out - -sonar.sourceEncoding=UTF-8 -sonar.scm.provider=git \ No newline at end of file diff --git a/tools/rosetta/.gitignore b/tools/rosetta/.gitignore deleted file mode 100644 index 97a2f457a395..000000000000 --- a/tools/rosetta/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/rosetta \ No newline at end of file diff --git a/tools/rosetta/.goreleaser.yml b/tools/rosetta/.goreleaser.yml deleted file mode 100644 index 6604952837e1..000000000000 --- a/tools/rosetta/.goreleaser.yml +++ /dev/null @@ -1,34 +0,0 @@ -project_name: rosetta - -release: - disable: false - name_template: "{{.Tag}}" - -before: - hooks: - - go mod tidy - -builds: - - main: ./cmd/rosetta - goos: - - linux - - windows - - darwin - goarch: - - amd64 - - arm64 - env: - - CGO_ENABLED=0 - -archives: - - name_template: '{{ replace .Version "rosetta/" "rosetta-" }}-{{ .Os }}-{{ .Arch }}' - format_overrides: - - goos: windows - format: zip - -checksum: - name_template: 'SHA256SUMS-{{ replace .Version "rosetta/" "rosetta-" }}.txt' - algorithm: sha256 - -changelog: - skip: false diff --git a/tools/rosetta/CHANGELOG.md b/tools/rosetta/CHANGELOG.md deleted file mode 100644 index 3e8c6b13e1dd..000000000000 --- a/tools/rosetta/CHANGELOG.md +++ /dev/null @@ -1,65 +0,0 @@ - - -# Changelog - -## [Unreleased] - -### Improvements - -* [#14272](https://github.com/cosmos/cosmos-sdk/pull/14272) Use `coinbase/rosetta-sdk-go/types` packages instead of comsos fork. - -### Bug Fixes - -* [#14285](https://github.com/cosmos/cosmos-sdk/pull/14285) Sets tendermint errors status codes to 500 - -## v0.2.0 2022-12-07 - -### Improvements - -* [#14118](https://github.com/cosmos/cosmos-sdk/pull/14118) Allow rosetta to be installed as a standalone application. -* [#14061](https://github.com/cosmos/cosmos-sdk/pull/14061) Adds openapi specification. -* [#13832](https://github.com/cosmos/cosmos-sdk/pull/13832) Correctly populates rosetta's `/network/status` endpoint response. Rosetta's data api is divided into its own go files (account, block, mempool, network). - -### Bug Fixes - -* [#13832](https://github.com/cosmos/cosmos-sdk/pull/13832) Wrap tendermint RPC errors to rosetta errors. - -## v0.1.0 2022-11-04 - -**From `v0.1.0` the minimum version of Tendermint is `v0.37+`, due event type changes.** - -### Improvements - -* [#13583](https://github.com/cosmos/cosmos-sdk/pull/13583) Extract rosetta to its own go.mod. diff --git a/tools/rosetta/Makefile b/tools/rosetta/Makefile deleted file mode 100644 index 60a59993ba83..000000000000 --- a/tools/rosetta/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/make -f - -all: build - -rosetta: - go build -mod=readonly ./cmd/rosetta - -build: - go build ./cmd/rosetta.go - -test: - go test -mod=readonly -race ./... - -.PHONY: all build rosetta test \ No newline at end of file diff --git a/tools/rosetta/README.md b/tools/rosetta/README.md deleted file mode 100644 index 3d8467aea892..000000000000 --- a/tools/rosetta/README.md +++ /dev/null @@ -1,122 +0,0 @@ ---- -sidebar_position: 1 ---- - -# Rosetta - -The `rosetta` package implements Coinbase's [Rosetta API](https://www.rosetta-api.org). This document provides instructions on how to use the Rosetta API integration. For information about the motivation and design choices, refer to [ADR 035](https://docs.cosmos.network/main/architecture/adr-035-rosetta-api-support). - -## Add Rosetta Command - -The Rosetta API server is a stand-alone server that connects to a node of a chain developed with Cosmos SDK. - -To enable Rosetta API support, it's required to add the `RosettaCommand` to your application's root command file (e.g. `simd/cmd/root.go`). - -Import the `rosettaCmd` package: - -```go -import "cosmossdk.io/tools/rosetta/cmd" -``` - -Find the following line: - -```go -initRootCmd(rootCmd, encodingConfig) -``` - -After that line, add the following: - -```go -rootCmd.AddCommand( - rosettaCmd.RosettaCommand(encodingConfig.InterfaceRegistry, encodingConfig.Codec) -) -``` - -The `RosettaCommand` function builds the `rosetta` root command and is defined in the `rosettaCmd` package (`cosmossdk.io/tools/rosetta/cmd`). - -Since we’ve updated the Cosmos SDK to work with the Rosetta API, updating the application's root command file is all you need to do. - -An implementation example can be found in `simapp` package. - -## Use Rosetta Command - -To run Rosetta in your application CLI, use the following command: - -```shell -simd rosetta --help -``` - -To test and run Rosetta API endpoints for applications that are running and exposed, use the following command: - -```shell -simd rosetta - --blockchain "your application name (ex: gaia)" - --network "your chain identifier (ex: testnet-1)" - --tendermint "tendermint endpoint (ex: localhost:26657)" - --grpc "gRPC endpoint (ex: localhost:9090)" - --addr "rosetta binding address (ex: :8080)" -``` - -## Use Rosetta Standalone - -To use Rosetta standalone, without having to add it in your application, install it with the following command: - -```bash -go install cosmossdk.io/tools/rosetta/cmd/rosetta -``` - -Alternatively, for building from source, simply run `make rosetta`. The binary will be located in `tools/rosetta`. - -## Extensions - -There are two ways in which you can customize and extend the implementation with your custom settings. - -### Message extension - -In order to make an `sdk.Msg` understandable by rosetta the only thing which is required is adding the methods to your messages that satisfy the `rosetta.Msg` interface. Examples on how to do so can be found in the staking types such as `MsgDelegate`, or in bank types such as `MsgSend`. - -### Client interface override - -In case more customization is required, it's possible to embed the Client type and override the methods which require customizations. - -Example: - -```go -package custom_client -import ( - -"context" -"github.com/coinbase/rosetta-sdk-go/types" -"cosmossdk.io/tools/rosetta/lib" -) - -// CustomClient embeds the standard cosmos client -// which means that it implements the cosmos-rosetta-gateway Client -// interface while at the same time allowing to customize certain methods -type CustomClient struct { - *rosetta.Client -} - -func (c *CustomClient) ConstructionPayload(_ context.Context, request *types.ConstructionPayloadsRequest) (resp *types.ConstructionPayloadsResponse, err error) { - // provide custom signature bytes - panic("implement me") -} -``` - -NOTE: when using a customized client, the command cannot be used as the constructors required **may** differ, so it's required to create a new one. We intend to provide a way to init a customized client without writing extra code in the future. - -### Error extension - -Since rosetta requires to provide 'returned' errors to network options. In order to declare a new rosetta error, we use the `errors` package in cosmos-rosetta-gateway. - -Example: - -```go -package custom_errors -import crgerrs "cosmossdk.io/tools/rosetta/lib/errors" - -var customErrRetriable = true -var CustomError = crgerrs.RegisterError(100, "custom message", customErrRetriable, "description") -``` - -Note: errors must be registered before cosmos-rosetta-gateway's `Server`.`Start` method is called. Otherwise the registration will be ignored. Errors with same code will be ignored too. diff --git a/tools/rosetta/RELEASE_NOTES.md b/tools/rosetta/RELEASE_NOTES.md deleted file mode 100644 index 4f21a49207dc..000000000000 --- a/tools/rosetta/RELEASE_NOTES.md +++ /dev/null @@ -1,5 +0,0 @@ -# Rosetta v0.2.0 Release Notes - -## Changelog - -For more details, please see the [CHANGELOG](https://github.com/cosmos/cosmos-sdk/blob/tools/rosetta/v0.2.0/tools/rosetta/CHANGELOG.md). diff --git a/tools/rosetta/client_offline.go b/tools/rosetta/client_offline.go deleted file mode 100644 index ef01d69a113f..000000000000 --- a/tools/rosetta/client_offline.go +++ /dev/null @@ -1,143 +0,0 @@ -package rosetta - -import ( - "context" - "encoding/hex" - - "github.com/coinbase/rosetta-sdk-go/types" - - crgerrs "cosmossdk.io/tools/rosetta/lib/errors" - - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// ---------- cosmos-rosetta-gateway.types.NetworkInformationProvider implementation ------------ // - -func (c *Client) OperationStatuses() []*types.OperationStatus { - return []*types.OperationStatus{ - { - Status: StatusTxSuccess, - Successful: true, - }, - { - Status: StatusTxReverted, - Successful: false, - }, - } -} - -func (c *Client) Version() string { - return c.version -} - -func (c *Client) SupportedOperations() []string { - return c.supportedOperations -} - -// ---------- cosmos-rosetta-gateway.types.OfflineClient implementation ------------ // - -func (c *Client) SignedTx(_ context.Context, txBytes []byte, signatures []*types.Signature) (signedTxBytes []byte, err error) { - return c.converter.ToSDK().SignedTx(txBytes, signatures) -} - -func (c *Client) ConstructionPayload(_ context.Context, request *types.ConstructionPayloadsRequest) (resp *types.ConstructionPayloadsResponse, err error) { - // check if there is at least one operation - if len(request.Operations) < 1 { - return nil, crgerrs.WrapError(crgerrs.ErrInvalidOperation, "expected at least one operation") - } - - tx, err := c.converter.ToSDK().UnsignedTx(request.Operations) - if err != nil { - return nil, crgerrs.WrapError(crgerrs.ErrInvalidOperation, err.Error()) - } - - metadata := new(ConstructionMetadata) - if err = metadata.FromMetadata(request.Metadata); err != nil { - return nil, err - } - - txBytes, payloads, err := c.converter.ToRosetta().SigningComponents(tx, metadata, request.PublicKeys) - if err != nil { - return nil, err - } - - return &types.ConstructionPayloadsResponse{ - UnsignedTransaction: hex.EncodeToString(txBytes), - Payloads: payloads, - }, nil -} - -func (c *Client) PreprocessOperationsToOptions(_ context.Context, req *types.ConstructionPreprocessRequest) (response *types.ConstructionPreprocessResponse, err error) { - if len(req.Operations) == 0 { - return nil, crgerrs.WrapError(crgerrs.ErrBadArgument, "no operations") - } - - // now we need to parse the operations to cosmos sdk messages - tx, err := c.converter.ToSDK().UnsignedTx(req.Operations) - if err != nil { - return nil, err - } - - // get the signers - signers, err := tx.GetSigners() - if err != nil { - return nil, err - } - - signersStr := make([]string, len(signers)) - accountIdentifiers := make([]*types.AccountIdentifier, len(signers)) - - for i, sig := range signers { - addr, err := c.config.InterfaceRegistry.SigningContext().AddressCodec().BytesToString(sig) - if err != nil { - return nil, err - } - - signersStr[i] = addr - accountIdentifiers[i] = &types.AccountIdentifier{ - Address: addr, - } - } - // get the metadata request information - meta := new(ConstructionPreprocessMetadata) - err = meta.FromMetadata(req.Metadata) - if err != nil { - return nil, err - } - - if meta.GasPrice == "" { - return nil, crgerrs.WrapError(crgerrs.ErrBadArgument, "no gas prices") - } - - if meta.GasLimit == 0 { - return nil, crgerrs.WrapError(crgerrs.ErrBadArgument, "no gas limit") - } - - // prepare the options to return - options := &PreprocessOperationsOptionsResponse{ - ExpectedSigners: signersStr, - Memo: meta.Memo, - GasLimit: meta.GasLimit, - GasPrice: meta.GasPrice, - } - - metaOptions, err := options.ToMetadata() - if err != nil { - return nil, err - } - return &types.ConstructionPreprocessResponse{ - Options: metaOptions, - RequiredPublicKeys: accountIdentifiers, - }, nil -} - -func (c *Client) AccountIdentifierFromPublicKey(pubKey *types.PublicKey) (*types.AccountIdentifier, error) { - pk, err := c.converter.ToSDK().PubKey(pubKey) - if err != nil { - return nil, err - } - - return &types.AccountIdentifier{ - Address: sdk.AccAddress(pk.Address()).String(), - }, nil -} diff --git a/tools/rosetta/client_online.go b/tools/rosetta/client_online.go deleted file mode 100644 index 73b52af3e6f0..000000000000 --- a/tools/rosetta/client_online.go +++ /dev/null @@ -1,559 +0,0 @@ -package rosetta - -import ( - "bytes" - "context" - "encoding/base64" - "encoding/hex" - "errors" - "fmt" - "regexp" - "strconv" - "time" - - "github.com/cosmos/cosmos-sdk/version" - - abcitypes "github.com/cometbft/cometbft/abci/types" - - rosettatypes "github.com/coinbase/rosetta-sdk-go/types" - "google.golang.org/grpc/credentials/insecure" - "google.golang.org/grpc/metadata" - - "github.com/cometbft/cometbft/rpc/client/http" - "google.golang.org/grpc" - - crgerrs "cosmossdk.io/tools/rosetta/lib/errors" - crgtypes "cosmossdk.io/tools/rosetta/lib/types" - - sdk "github.com/cosmos/cosmos-sdk/types" - grpctypes "github.com/cosmos/cosmos-sdk/types/grpc" - authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" - auth "github.com/cosmos/cosmos-sdk/x/auth/types" - bank "github.com/cosmos/cosmos-sdk/x/bank/types" - - tmrpc "github.com/cometbft/cometbft/rpc/client" - - "github.com/cosmos/cosmos-sdk/types/query" -) - -// interface assertion -var _ crgtypes.Client = (*Client)(nil) - -const ( - defaultNodeTimeout = time.Minute - tmWebsocketPath = "/websocket" -) - -// Client implements a single network client to interact with cosmos based chains -type Client struct { - supportedOperations []string - - config *Config - - auth auth.QueryClient - bank bank.QueryClient - tmRPC tmrpc.Client - - version string - - converter Converter -} - -// NewClient instantiates a new online servicer -func NewClient(cfg *Config) (*Client, error) { - info := version.NewInfo() - - v := info.Version - if v == "" { - v = "unknown" - } - - txConfig := authtx.NewTxConfig(cfg.Codec, authtx.DefaultSignModes) - - var supportedOperations []string - for _, ii := range cfg.InterfaceRegistry.ListImplementations(sdk.MsgInterfaceProtoName) { - _, err := cfg.InterfaceRegistry.Resolve(ii) - if err != nil { - continue - } - - supportedOperations = append(supportedOperations, ii) - } - - supportedOperations = append( - supportedOperations, - bank.EventTypeCoinSpent, - bank.EventTypeCoinReceived, - bank.EventTypeCoinBurn, - ) - - return &Client{ - supportedOperations: supportedOperations, - config: cfg, - auth: nil, - bank: nil, - tmRPC: nil, - version: fmt.Sprintf("%s/%s", info.AppName, v), - converter: NewConverter(cfg.Codec, cfg.InterfaceRegistry, txConfig), - }, nil -} - -// ---------- cosmos-rosetta-gateway.types.Client implementation ------------ // - -// Bootstrap is gonna connect the client to the endpoints -func (c *Client) Bootstrap() error { - grpcConn, err := grpc.Dial(c.config.GRPCEndpoint, grpc.WithTransportCredentials(insecure.NewCredentials())) - if err != nil { - return err - } - - tmRPC, err := http.New(c.config.TendermintRPC, tmWebsocketPath) - if err != nil { - return err - } - - authClient := auth.NewQueryClient(grpcConn) - bankClient := bank.NewQueryClient(grpcConn) - - c.auth = authClient - c.bank = bankClient - c.tmRPC = tmRPC - - return nil -} - -// Ready performs a health check and returns an error if the client is not ready. -func (c *Client) Ready() error { - ctx, cancel := context.WithTimeout(context.Background(), defaultNodeTimeout) - defer cancel() - _, err := c.tmRPC.Health(ctx) - if err != nil { - return err - } - - _, err = c.tmRPC.Status(ctx) - if err != nil { - return err - } - - _, err = c.bank.TotalSupply(ctx, &bank.QueryTotalSupplyRequest{}) - if err != nil { - return err - } - return nil -} - -func (c *Client) GenesisBlock(ctx context.Context) (crgtypes.BlockResponse, error) { - var genesisHeight int64 = 1 - return c.BlockByHeight(ctx, &genesisHeight) -} - -func (c *Client) InitialHeightBlock(ctx context.Context) (crgtypes.BlockResponse, error) { - genesisChunk, err := c.tmRPC.GenesisChunked(ctx, 0) - if err != nil { - return crgtypes.BlockResponse{}, err - } - heightNum, err := extractInitialHeightFromGenesisChunk(genesisChunk.Data) - if err != nil { - return crgtypes.BlockResponse{}, err - } - return c.BlockByHeight(ctx, &heightNum) -} - -func (c *Client) OldestBlock(ctx context.Context) (crgtypes.BlockResponse, error) { - status, err := c.tmRPC.Status(ctx) - if err != nil { - return crgtypes.BlockResponse{}, err - } - return c.BlockByHeight(ctx, &status.SyncInfo.EarliestBlockHeight) -} - -func (c *Client) accountInfo(ctx context.Context, addr string, height *int64) (*SignerData, error) { - if height != nil { - strHeight := strconv.FormatInt(*height, 10) - ctx = metadata.AppendToOutgoingContext(ctx, grpctypes.GRPCBlockHeightHeader, strHeight) - } - - accountInfo, err := c.auth.Account(ctx, &auth.QueryAccountRequest{ - Address: addr, - }) - if err != nil { - return nil, crgerrs.FromGRPCToRosettaError(err) - } - - signerData, err := c.converter.ToRosetta().SignerData(accountInfo.Account) - if err != nil { - return nil, err - } - return signerData, nil -} - -func (c *Client) Balances(ctx context.Context, addr string, height *int64) ([]*rosettatypes.Amount, error) { - if height != nil { - strHeight := strconv.FormatInt(*height, 10) - ctx = metadata.AppendToOutgoingContext(ctx, grpctypes.GRPCBlockHeightHeader, strHeight) - } - - balance, err := c.bank.AllBalances(ctx, &bank.QueryAllBalancesRequest{ - Address: addr, - }) - if err != nil { - return nil, crgerrs.FromGRPCToRosettaError(err) - } - - availableCoins, err := c.coins(ctx) - if err != nil { - return nil, err - } - - return c.converter.ToRosetta().Amounts(balance.Balances, availableCoins), nil -} - -func (c *Client) BlockByHash(ctx context.Context, hash string) (crgtypes.BlockResponse, error) { - bHash, err := hex.DecodeString(hash) - if err != nil { - return crgtypes.BlockResponse{}, fmt.Errorf("invalid block hash: %s", err) - } - - block, err := c.tmRPC.BlockByHash(ctx, bHash) - if err != nil { - return crgtypes.BlockResponse{}, crgerrs.WrapError(crgerrs.ErrBadGateway, err.Error()) - } - - return c.converter.ToRosetta().BlockResponse(block), nil -} - -func (c *Client) BlockByHeight(ctx context.Context, height *int64) (crgtypes.BlockResponse, error) { - block, err := c.tmRPC.Block(ctx, height) - if err != nil { - return crgtypes.BlockResponse{}, crgerrs.WrapError(crgerrs.ErrInternal, err.Error()) - } - - return c.converter.ToRosetta().BlockResponse(block), nil -} - -func (c *Client) BlockTransactionsByHash(ctx context.Context, hash string) (crgtypes.BlockTransactionsResponse, error) { - // TODO(fdymylja): use a faster path, by searching the block by hash, instead of doing a double query operation - blockResp, err := c.BlockByHash(ctx, hash) - if err != nil { - return crgtypes.BlockTransactionsResponse{}, err - } - - return c.blockTxs(ctx, &blockResp.Block.Index) -} - -func (c *Client) BlockTransactionsByHeight(ctx context.Context, height *int64) (crgtypes.BlockTransactionsResponse, error) { - blockTxResp, err := c.blockTxs(ctx, height) - if err != nil { - return crgtypes.BlockTransactionsResponse{}, err - } - return blockTxResp, nil -} - -// Coins fetches the existing coins in the application -func (c *Client) coins(ctx context.Context) (sdk.Coins, error) { - var result sdk.Coins - - supply, err := c.bank.TotalSupply(ctx, &bank.QueryTotalSupplyRequest{}) - if err != nil { - return nil, crgerrs.FromGRPCToRosettaError(err) - } - - pages := supply.GetPagination().GetTotal() - for i := uint64(0); i < pages; i++ { - // get next key - page := supply.GetPagination() - if page == nil { - return nil, crgerrs.WrapError(crgerrs.ErrCodec, "error pagination") - } - nextKey := page.GetNextKey() - - supply, err = c.bank.TotalSupply(ctx, &bank.QueryTotalSupplyRequest{Pagination: &query.PageRequest{Key: nextKey}}) - if err != nil { - return nil, crgerrs.FromGRPCToRosettaError(err) - } - - result = append(result[:0], supply.Supply[:]...) - } - - return result, nil -} - -func (c *Client) TxOperationsAndSignersAccountIdentifiers(signed bool, txBytes []byte) (ops []*rosettatypes.Operation, signers []*rosettatypes.AccountIdentifier, err error) { - switch signed { - case false: - rosTx, err := c.converter.ToRosetta().Tx(txBytes, nil) - if err != nil { - return nil, nil, err - } - return rosTx.Operations, nil, err - default: - ops, signers, err = c.converter.ToRosetta().OpsAndSigners(txBytes) - return - } -} - -// GetTx returns a transaction given its hash. For Rosetta we make a synthetic transaction for BeginBlock -// -// and EndBlock to adhere to balance tracking rules. -func (c *Client) GetTx(ctx context.Context, hash string) (*rosettatypes.Transaction, error) { - hashBytes, err := hex.DecodeString(hash) - if err != nil { - return nil, crgerrs.WrapError(crgerrs.ErrCodec, fmt.Sprintf("bad tx hash: %s", err)) - } - - // get tx type and hash - txType, hashBytes := c.converter.ToSDK().HashToTxType(hashBytes) - - // construct rosetta tx - switch txType { - // handle begin block hash - case BeginBlockTx: - // get block height by hash - block, err := c.tmRPC.BlockByHash(ctx, hashBytes) - if err != nil { - return nil, crgerrs.WrapError(crgerrs.ErrUnknown, err.Error()) - } - - // get block txs - fullBlock, err := c.blockTxs(ctx, &block.Block.Height) - if err != nil { - return nil, err - } - - return fullBlock.Transactions[0], nil - // handle deliver tx hash - case DeliverTxTx: - rawTx, err := c.tmRPC.Tx(ctx, hashBytes, true) - if err != nil { - return nil, crgerrs.WrapError(crgerrs.ErrUnknown, err.Error()) - } - return c.converter.ToRosetta().Tx(rawTx.Tx, &rawTx.TxResult) - // handle end block hash - case EndBlockTx: - // get block height by hash - block, err := c.tmRPC.BlockByHash(ctx, hashBytes) - if err != nil { - return nil, crgerrs.WrapError(crgerrs.ErrUnknown, err.Error()) - } - - // get block txs - fullBlock, err := c.blockTxs(ctx, &block.Block.Height) - if err != nil { - return nil, err - } - - // get last tx - return fullBlock.Transactions[len(fullBlock.Transactions)-1], nil - // unrecognized tx - default: - return nil, crgerrs.WrapError(crgerrs.ErrBadArgument, fmt.Sprintf("invalid tx hash provided: %s", hash)) - } -} - -// GetUnconfirmedTx gets an unconfirmed transaction given its hash -func (c *Client) GetUnconfirmedTx(ctx context.Context, hash string) (*rosettatypes.Transaction, error) { - res, err := c.tmRPC.UnconfirmedTxs(ctx, nil) - if err != nil { - return nil, crgerrs.WrapError(crgerrs.ErrNotFound, "unconfirmed tx not found") - } - - hashAsBytes, err := hex.DecodeString(hash) - if err != nil { - return nil, crgerrs.WrapError(crgerrs.ErrInterpreting, "invalid hash") - } - - // assert that correct tx length is provided - switch len(hashAsBytes) { - default: - return nil, crgerrs.WrapError(crgerrs.ErrBadArgument, fmt.Sprintf("unrecognized tx size: %d", len(hashAsBytes))) - case BeginEndBlockTxSize: - return nil, crgerrs.WrapError(crgerrs.ErrBadArgument, "endblock and begin block txs cannot be unconfirmed") - case DeliverTxSize: - break - } - - // iterate over unconfirmed txs to find the one with matching hash - for _, unconfirmedTx := range res.Txs { - if !bytes.Equal(unconfirmedTx.Hash(), hashAsBytes) { - continue - } - - return c.converter.ToRosetta().Tx(unconfirmedTx, nil) - } - return nil, crgerrs.WrapError(crgerrs.ErrNotFound, "transaction not found in mempool: "+hash) -} - -// Mempool returns the unconfirmed transactions in the mempool -func (c *Client) Mempool(ctx context.Context) ([]*rosettatypes.TransactionIdentifier, error) { - txs, err := c.tmRPC.UnconfirmedTxs(ctx, nil) - if err != nil { - return nil, err - } - - return c.converter.ToRosetta().TxIdentifiers(txs.Txs), nil -} - -// Peers gets the number of peers -func (c *Client) Peers(ctx context.Context) ([]*rosettatypes.Peer, error) { - netInfo, err := c.tmRPC.NetInfo(ctx) - if err != nil { - return nil, crgerrs.WrapError(crgerrs.ErrUnknown, err.Error()) - } - return c.converter.ToRosetta().Peers(netInfo.Peers), nil -} - -func (c *Client) Status(ctx context.Context) (*rosettatypes.SyncStatus, error) { - status, err := c.tmRPC.Status(ctx) - if err != nil { - return nil, crgerrs.WrapError(crgerrs.ErrUnknown, err.Error()) - } - return c.converter.ToRosetta().SyncStatus(status), err -} - -func (c *Client) PostTx(txBytes []byte) (*rosettatypes.TransactionIdentifier, map[string]interface{}, error) { - // sync ensures it will go through checkTx - res, err := c.tmRPC.BroadcastTxSync(context.Background(), txBytes) - if err != nil { - return nil, nil, crgerrs.WrapError(crgerrs.ErrUnknown, err.Error()) - } - // check if tx was broadcast successfully - if res.Code != abcitypes.CodeTypeOK { - return nil, nil, crgerrs.WrapError( - crgerrs.ErrUnknown, - fmt.Sprintf("transaction broadcast failure: (%d) %s ", res.Code, res.Log), - ) - } - - return &rosettatypes.TransactionIdentifier{ - Hash: fmt.Sprintf("%X", res.Hash), - }, - map[string]interface{}{ - Log: res.Log, - }, nil -} - -// construction endpoints - -// ConstructionMetadataFromOptions builds the metadata given the options -func (c *Client) ConstructionMetadataFromOptions(ctx context.Context, options map[string]interface{}) (meta map[string]interface{}, err error) { - if len(options) == 0 { - return nil, crgerrs.ErrBadArgument - } - - constructionOptions := new(PreprocessOperationsOptionsResponse) - - err = constructionOptions.FromMetadata(options) - if err != nil { - return nil, err - } - - // if default fees suggestion is enabled and gas limit or price is unset, use default - if c.config.EnableFeeSuggestion { - if constructionOptions.GasLimit <= 0 { - constructionOptions.GasLimit = uint64(c.config.GasToSuggest) - } - if constructionOptions.GasPrice == "" { - denom := c.config.DenomToSuggest - constructionOptions.GasPrice = c.config.GasPrices.AmountOf(denom).String() + denom - } - } - - if constructionOptions.GasLimit > 0 && constructionOptions.GasPrice != "" { - gasPrice, err := sdk.ParseDecCoin(constructionOptions.GasPrice) - if err != nil { - return nil, err - } - if !gasPrice.IsPositive() { - return nil, crgerrs.WrapError(crgerrs.ErrBadArgument, "gas price must be positive") - } - } - - signersData := make([]*SignerData, len(constructionOptions.ExpectedSigners)) - - for i, signer := range constructionOptions.ExpectedSigners { - accountInfo, err := c.accountInfo(ctx, signer, nil) - if err != nil { - return nil, err - } - - signersData[i] = accountInfo - } - - status, err := c.tmRPC.Status(ctx) - if err != nil { - return nil, err - } - - metadataResp := ConstructionMetadata{ - ChainID: status.NodeInfo.Network, - SignersData: signersData, - GasLimit: constructionOptions.GasLimit, - GasPrice: constructionOptions.GasPrice, - Memo: constructionOptions.Memo, - } - - return metadataResp.ToMetadata() -} - -func (c *Client) blockTxs(ctx context.Context, height *int64) (crgtypes.BlockTransactionsResponse, error) { - // get block info - blockInfo, err := c.tmRPC.Block(ctx, height) - if err != nil { - return crgtypes.BlockTransactionsResponse{}, err - } - // get block events - blockResults, err := c.tmRPC.BlockResults(ctx, height) - if err != nil { - return crgtypes.BlockTransactionsResponse{}, err - } - - if len(blockResults.TxsResults) != len(blockInfo.Block.Txs) { - // wtf? - panic("block results transactions do now match block transactions") - } - // process begin and end block txs - finalizeBlockTx := &rosettatypes.Transaction{ - TransactionIdentifier: &rosettatypes.TransactionIdentifier{Hash: c.converter.ToRosetta().BeginBlockTxHash(blockInfo.BlockID.Hash)}, - Operations: AddOperationIndexes( - nil, - c.converter.ToRosetta().BalanceOps(StatusTxSuccess, blockResults.FinalizeBlockEvents), - ), - } - - deliverTx := make([]*rosettatypes.Transaction, len(blockInfo.Block.Txs)) - // process normal txs - for i, tx := range blockInfo.Block.Txs { - rosTx, err := c.converter.ToRosetta().Tx(tx, blockResults.TxsResults[i]) - if err != nil { - return crgtypes.BlockTransactionsResponse{}, err - } - deliverTx[i] = rosTx - } - - finalTxs := make([]*rosettatypes.Transaction, 0, 2+len(deliverTx)) - finalTxs = append(finalTxs, deliverTx...) - finalTxs = append(finalTxs, finalizeBlockTx) - - return crgtypes.BlockTransactionsResponse{ - BlockResponse: c.converter.ToRosetta().BlockResponse(blockInfo), - Transactions: finalTxs, - }, nil -} - -var initialHeightRE = regexp.MustCompile(`"initial_height":"(\d+)"`) - -func extractInitialHeightFromGenesisChunk(genesisChunk string) (int64, error) { - firstChunk, err := base64.StdEncoding.DecodeString(genesisChunk) - if err != nil { - return 0, err - } - - matches := initialHeightRE.FindStringSubmatch(string(firstChunk)) - if len(matches) != 2 { - return 0, errors.New("failed to fetch initial_height") - } - - heightStr := matches[1] - return strconv.ParseInt(heightStr, 10, 64) -} diff --git a/tools/rosetta/client_online_test.go b/tools/rosetta/client_online_test.go deleted file mode 100644 index 9aa8965cf6e9..000000000000 --- a/tools/rosetta/client_online_test.go +++ /dev/null @@ -1,15 +0,0 @@ -package rosetta - -import ( - "encoding/base64" - "testing" - - "github.com/stretchr/testify/require" -) - -func TestRegex(t *testing.T) { - genesisChuck := base64.StdEncoding.EncodeToString([]byte(`"genesis_time":"2021-09-28T09:00:00Z","chain_id":"bombay-12","initial_height":"5900001","consensus_params":{"block":{"max_bytes":"5000000","max_gas":"1000000000","time_iota_ms":"1000"},"evidence":{"max_age_num_blocks":"100000","max_age_duration":"172800000000000","max_bytes":"50000"},"validator":{"pub_key_types":["ed25519"]},"version":{}},"validators":[{"address":"EEA4891F5F8D523A6B4B3EAC84B5C08655A00409","pub_key":{"type":"tendermint/PubKeyEd25519","value":"UX71gTBNumQq42qRd6j/K8XN/y3/HAcuAJxj97utawI="},"power":"60612","name":"BTC.Secure"},{"address":"973F589DE1CC8A54ABE2ABE0E0A4ABF13A9EBAE4","pub_key":{"type":"tendermint/PubKeyEd25519","value":"AmGQvQSAAXzSIscx/6o4rVdRMT9QvairQHaCXsWhY+c="},"power":"835","name":"MoonletWallet"},{"address":"831F402BDA0C9A3F260D4F221780BC22A4C3FB23","pub_key":{"type":"tendermint/PubKeyEd25519","value":"Tw8yKbPNEo113ZNbJJ8joeXokoMdBoazRTwb1NQ77WA="},"power":"102842","name":"BlockNgine"},{"address":"F2683F267D2B4C8714B44D68612DB37A8DD2EED7","pub_key":{"type":"tendermint/PubKeyEd25519","value":"PVE4IcWDE6QEqJSEkx55IDkg5zxBo8tVRzKFMJXYFSQ="},"power":"23200","name":"Luna Station 88"},{"address":"9D2428CBAC68C654BE11BE405344C560E6A0F626","pub_key":{"type":"tendermint/PubKeyEd25519","value":"93hzGmZjPRqOnQkb8BULjqanW3M2p1qIcLVTGkf1Zhk="},"power":"35420","name":"Terra-India"},{"address":"DC9897F22E74BF1B66E2640FA461F785F9BA7627","pub_key":{"type":"tendermint/PubKeyEd25519","value":"mlYb/Dzqwh0YJjfH59OZ4vtp+Zhdq5Oj5MNaGHq1X0E="},"power":"25163","name":"SolidStake"},{"address":"AA1A027E270A2BD7AF154999E6DE9D39C5711DE7","pub_key":{"type":"tendermint/PubKeyEd25519","value":"28z8FlpbC7sR0f1Q8OWFASDNi0FAmdldzetwQ07JJzg="},"power":"34529","name":"syncnode"},{"address":"E548735750DC5015ADDE3B0E7A1294C3B868680B","pub_key":{"type":"tendermint/PubKeyEd25519","value":"BTDtLSKp4wpQrWBwmGvp9isWC5jXaAtX1nrJtsCEWew="},"power":"36082","name":"OneStar"}`)) - height, err := extractInitialHeightFromGenesisChunk(genesisChuck) - require.NoError(t, err) - require.Equal(t, height, int64(5900001)) -} diff --git a/tools/rosetta/cmd/rosetta.go b/tools/rosetta/cmd/rosetta.go deleted file mode 100644 index 9ed7935f5b97..000000000000 --- a/tools/rosetta/cmd/rosetta.go +++ /dev/null @@ -1,42 +0,0 @@ -package cmd - -import ( - "fmt" - - "github.com/spf13/cobra" - - "cosmossdk.io/tools/rosetta" - "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" -) - -// RosettaCommand builds the rosetta root command given -// a protocol buffers serializer/deserializer -func RosettaCommand(ir codectypes.InterfaceRegistry, cdc codec.Codec) *cobra.Command { - cmd := &cobra.Command{ - Use: "rosetta", - Short: "spin up a rosetta server", - RunE: func(cmd *cobra.Command, args []string) error { - conf, err := rosetta.FromFlags(cmd.Flags()) - if err != nil { - return err - } - - protoCodec, ok := cdc.(*codec.ProtoCodec) - if !ok { - return fmt.Errorf("exoected *codec.ProtoMarshaler, got: %T", cdc) - } - conf.WithCodec(ir, protoCodec) - - rosettaSrv, err := rosetta.ServerFromConfig(conf) - if err != nil { - fmt.Printf("[Rosetta]- Error while creating server: %s", err.Error()) - return err - } - return rosettaSrv.Start() - }, - } - rosetta.SetFlags(cmd.Flags()) - - return cmd -} diff --git a/tools/rosetta/cmd/rosetta/main.go b/tools/rosetta/cmd/rosetta/main.go deleted file mode 100644 index b5454f2f5490..000000000000 --- a/tools/rosetta/cmd/rosetta/main.go +++ /dev/null @@ -1,23 +0,0 @@ -package main - -import ( - "os" - - "cosmossdk.io/log" - rosettaCmd "cosmossdk.io/tools/rosetta/cmd" - "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" -) - -func main() { - var ( - logger = log.NewLogger(os.Stdout).With(log.ModuleKey, "rosetta") - interfaceRegistry = codectypes.NewInterfaceRegistry() - cdc = codec.NewProtoCodec(interfaceRegistry) - ) - - if err := rosettaCmd.RosettaCommand(interfaceRegistry, cdc).Execute(); err != nil { - logger.Error("failed to run rosetta", "error", err) - os.Exit(1) - } -} diff --git a/tools/rosetta/codec.go b/tools/rosetta/codec.go deleted file mode 100644 index 7f284186574e..000000000000 --- a/tools/rosetta/codec.go +++ /dev/null @@ -1,42 +0,0 @@ -package rosetta - -import ( - "cosmossdk.io/x/tx/signing" - "github.com/cosmos/gogoproto/proto" - - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/codec/address" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - authcodec "github.com/cosmos/cosmos-sdk/x/auth/types" - bankcodec "github.com/cosmos/cosmos-sdk/x/bank/types" -) - -// MakeCodec generates the codec required to interact -// with the cosmos APIs used by the rosetta gateway -func MakeCodec() (*codec.ProtoCodec, codectypes.InterfaceRegistry) { - ir, err := codectypes.NewInterfaceRegistryWithOptions( - codectypes.InterfaceRegistryOptions{ - ProtoFiles: proto.HybridResolver, - SigningOptions: signing.Options{ - AddressCodec: address.Bech32Codec{ - Bech32Prefix: sdk.GetConfig().GetBech32AccountAddrPrefix(), - }, - ValidatorAddressCodec: address.Bech32Codec{ - Bech32Prefix: sdk.GetConfig().GetBech32ValidatorAddrPrefix(), - }, - }, - }, - ) - if err != nil { - panic(err) - } - cdc := codec.NewProtoCodec(ir) - - authcodec.RegisterInterfaces(ir) - bankcodec.RegisterInterfaces(ir) - cryptocodec.RegisterInterfaces(ir) - - return cdc, ir -} diff --git a/tools/rosetta/config.go b/tools/rosetta/config.go deleted file mode 100644 index a6c0d61a88e1..000000000000 --- a/tools/rosetta/config.go +++ /dev/null @@ -1,269 +0,0 @@ -package rosetta - -import ( - "fmt" - "strings" - "time" - - "github.com/coinbase/rosetta-sdk-go/types" - "github.com/spf13/pflag" - - crg "cosmossdk.io/tools/rosetta/lib/server" - - clientflags "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// configuration defaults constants -const ( - // DefaultBlockchain defines the default blockchain identifier name - DefaultBlockchain = "app" - // DefaultAddr defines the default rosetta binding address - DefaultAddr = ":8080" - // DefaultRetries is the default number of retries - DefaultRetries = 5 - // DefaultCometEndpoint is the default value for the CometBFT endpoint - DefaultCometEndpoint = "localhost:26657" - // DefaultGRPCEndpoint is the default value for the gRPC endpoint - DefaultGRPCEndpoint = "localhost:9090" - // DefaultNetwork defines the default network name - DefaultNetwork = "network" - // DefaultOffline defines the default offline value - DefaultOffline = false - // DefaultEnableFeeSuggestion indicates to use fee suggestion if `construction/metadata` is called without gas limit and price - DefaultEnableFeeSuggestion = false - // DenomToSuggest defines the default denom for fee suggestion - DenomToSuggest = "uatom" - // DefaultPrices defines the default list of prices to suggest - DefaultPrices = "1uatom,1stake" -) - -// configuration flags -const ( - FlagBlockchain = "blockchain" - FlagNetwork = "network" - FlagTendermintEndpoint = "tendermint" - FlagGRPCEndpoint = "grpc" - FlagAddr = "addr" - FlagRetries = "retries" - FlagOffline = "offline" - FlagEnableFeeSuggestion = "enable-fee-suggestion" - FlagGasToSuggest = "gas-to-suggest" - FlagDenomToSuggest = "denom-to-suggest" - FlagPricesToSuggest = "prices-to-suggest" -) - -// Config defines the configuration of the rosetta server -type Config struct { - // Blockchain defines the blockchain name - // defaults to DefaultBlockchain - Blockchain string - // Network defines the network name - Network string - // TendermintRPC defines the endpoint to connect to - // CometBFT RPC, specifying 'tcp://' before is not - // required, usually it's at port 26657 of the - TendermintRPC string - // GRPCEndpoint defines the cosmos application gRPC endpoint - // usually it is located at 9090 port - GRPCEndpoint string - // Addr defines the default address to bind the rosetta server to - // defaults to DefaultAddr - Addr string - // Retries defines the maximum number of retries - // rosetta will do before quitting - Retries int - // Offline defines if the server must be run in offline mode - Offline bool - // EnableFeeSuggestion indicates to use fee suggestion when `construction/metadata` is called without gas limit and price - EnableFeeSuggestion bool - // GasToSuggest defines the gas limit for fee suggestion - GasToSuggest int - // DenomToSuggest defines the default denom for fee suggestion - DenomToSuggest string - // GasPrices defines the gas prices for fee suggestion - GasPrices sdk.DecCoins - // Codec overrides the default data and construction api client codecs - Codec *codec.ProtoCodec - // InterfaceRegistry overrides the default data and construction api interface registry - InterfaceRegistry codectypes.InterfaceRegistry -} - -// NetworkIdentifier returns the network identifier given the configuration -func (c *Config) NetworkIdentifier() *types.NetworkIdentifier { - return &types.NetworkIdentifier{ - Blockchain: c.Blockchain, - Network: c.Network, - } -} - -// validate validates a configuration and sets -// its defaults in case they were not provided -func (c *Config) validate() error { - if (c.Codec == nil) != (c.InterfaceRegistry == nil) { - return fmt.Errorf("codec and interface registry must be both different from nil or nil") - } - - if c.Addr == "" { - c.Addr = DefaultAddr - } - if c.Blockchain == "" { - c.Blockchain = DefaultBlockchain - } - if c.Retries == 0 { - c.Retries = DefaultRetries - } - // these are must - if c.Network == "" { - return fmt.Errorf("network not provided") - } - if c.GasToSuggest <= 0 { - return fmt.Errorf("gas to suggest must be positive") - } - if c.EnableFeeSuggestion { - found := false - for i := 0; i < c.GasPrices.Len(); i++ { - if c.GasPrices.GetDenomByIndex(i) == c.DenomToSuggest { - found = true - break - } - } - if !found { - return fmt.Errorf("default suggest denom is not found in prices to suggest") - } - } - - // these are optional but it must be online - if c.GRPCEndpoint == "" { - return fmt.Errorf("grpc endpoint not provided") - } - if c.TendermintRPC == "" { - return fmt.Errorf("cometbft rpc not provided") - } - if !strings.HasPrefix(c.TendermintRPC, "tcp://") { - c.TendermintRPC = fmt.Sprintf("tcp://%s", c.TendermintRPC) - } - - return nil -} - -// WithCodec extends the configuration with a predefined Codec -func (c *Config) WithCodec(ir codectypes.InterfaceRegistry, cdc *codec.ProtoCodec) { - c.Codec = cdc - c.InterfaceRegistry = ir -} - -// FromFlags gets the configuration from flags -func FromFlags(flags *pflag.FlagSet) (*Config, error) { - blockchain, err := flags.GetString(FlagBlockchain) - if err != nil { - return nil, err - } - network, err := flags.GetString(FlagNetwork) - if err != nil { - return nil, err - } - tendermintRPC, err := flags.GetString(FlagTendermintEndpoint) - if err != nil { - return nil, err - } - gRPCEndpoint, err := flags.GetString(FlagGRPCEndpoint) - if err != nil { - return nil, err - } - addr, err := flags.GetString(FlagAddr) - if err != nil { - return nil, err - } - retries, err := flags.GetInt(FlagRetries) - if err != nil { - return nil, err - } - offline, err := flags.GetBool(FlagOffline) - if err != nil { - return nil, err - } - enableDefaultFeeSuggestion, err := flags.GetBool(FlagEnableFeeSuggestion) - if err != nil { - return nil, err - } - gasToSuggest, err := flags.GetInt(FlagGasToSuggest) - if err != nil { - return nil, err - } - denomToSuggest, err := flags.GetString(FlagDenomToSuggest) - if err != nil { - return nil, err - } - - var prices sdk.DecCoins - if enableDefaultFeeSuggestion { - pricesToSuggest, err := flags.GetString(FlagPricesToSuggest) - if err != nil { - return nil, err - } - prices, err = sdk.ParseDecCoins(pricesToSuggest) - if err != nil { - return nil, err - } - } - - conf := &Config{ - Blockchain: blockchain, - Network: network, - TendermintRPC: tendermintRPC, - GRPCEndpoint: gRPCEndpoint, - Addr: addr, - Retries: retries, - Offline: offline, - EnableFeeSuggestion: enableDefaultFeeSuggestion, - GasToSuggest: gasToSuggest, - DenomToSuggest: denomToSuggest, - GasPrices: prices, - } - err = conf.validate() - if err != nil { - return nil, err - } - return conf, nil -} - -func ServerFromConfig(conf *Config) (crg.Server, error) { - err := conf.validate() - if err != nil { - return crg.Server{}, err - } - client, err := NewClient(conf) - if err != nil { - return crg.Server{}, err - } - return crg.NewServer( - crg.Settings{ - Network: &types.NetworkIdentifier{ - Blockchain: conf.Blockchain, - Network: conf.Network, - }, - Client: client, - Listen: conf.Addr, - Offline: conf.Offline, - Retries: conf.Retries, - RetryWait: 15 * time.Second, - }) -} - -// SetFlags sets the configuration flags to the given flagset -func SetFlags(flags *pflag.FlagSet) { - flags.String(FlagBlockchain, DefaultBlockchain, "the blockchain type") - flags.String(FlagNetwork, DefaultNetwork, "the network name") - flags.String(FlagTendermintEndpoint, DefaultCometEndpoint, "the CometBFT rpc endpoint, without tcp://") - flags.String(FlagGRPCEndpoint, DefaultGRPCEndpoint, "the app gRPC endpoint") - flags.String(FlagAddr, DefaultAddr, "the address rosetta will bind to") - flags.Int(FlagRetries, DefaultRetries, "the number of retries that will be done before quitting") - flags.Bool(FlagOffline, DefaultOffline, "run rosetta only with construction API") - flags.Bool(FlagEnableFeeSuggestion, DefaultEnableFeeSuggestion, "enable default fee suggestion") - flags.Int(FlagGasToSuggest, clientflags.DefaultGasLimit, "default gas for fee suggestion") - flags.String(FlagDenomToSuggest, DenomToSuggest, "default denom for fee suggestion") - flags.String(FlagPricesToSuggest, DefaultPrices, "default prices for fee suggestion") -} diff --git a/tools/rosetta/converter.go b/tools/rosetta/converter.go deleted file mode 100644 index 317225c2c44f..000000000000 --- a/tools/rosetta/converter.go +++ /dev/null @@ -1,804 +0,0 @@ -package rosetta - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "reflect" - - rosettatypes "github.com/coinbase/rosetta-sdk-go/types" - abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/crypto" - tmcoretypes "github.com/cometbft/cometbft/rpc/core/types" - cmttypes "github.com/cometbft/cometbft/types" - secp "github.com/decred/dcrd/dcrec/secp256k1/v4" - - sdkmath "cosmossdk.io/math" - - crgerrs "cosmossdk.io/tools/rosetta/lib/errors" - crgtypes "cosmossdk.io/tools/rosetta/lib/types" - - sdkclient "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/tx/signing" - authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" -) - -// Converter is a utility that can be used to convert -// back and forth from rosetta to sdk and CometBFT types. -// IMPORTANT NOTES: -// - IT SHOULD BE USED ONLY TO DEAL WITH THINGS -// IN A STATELESS WAY! IT SHOULD NEVER INTERACT DIRECTLY -// WITH COMETBFT RPC AND COSMOS GRPC -// -// - IT SHOULD RETURN cosmos rosetta gateway error types! -type Converter interface { - // ToSDK exposes the methods that convert - // rosetta types to cosmos sdk and CometBFT types - ToSDK() ToSDKConverter - // ToRosetta exposes the methods that convert - // sdk and CometBFT types to rosetta types - ToRosetta() ToRosettaConverter -} - -// ToRosettaConverter is an interface that exposes -// all the functions used to convert sdk and -// CometBFT types to rosetta known types -type ToRosettaConverter interface { - // BlockResponse returns a block response given a result block - BlockResponse(block *tmcoretypes.ResultBlock) crgtypes.BlockResponse - // BeginBlockToTx converts the given begin block hash to rosetta transaction hash - BeginBlockTxHash(blockHash []byte) string - // EndBlockTxHash converts the given endblock hash to rosetta transaction hash - EndBlockTxHash(blockHash []byte) string - // Amounts converts sdk.Coins to rosetta.Amounts - Amounts(ownedCoins []sdk.Coin, availableCoins sdk.Coins) []*rosettatypes.Amount - // Ops converts an sdk.Msg to rosetta operations - Ops(status string, msg sdk.Msg) ([]*rosettatypes.Operation, error) - // OpsAndSigners takes raw transaction bytes and returns rosetta operations and the expected signers - OpsAndSigners(txBytes []byte) (ops []*rosettatypes.Operation, signers []*rosettatypes.AccountIdentifier, err error) - // Meta converts an sdk.Msg to rosetta metadata - Meta(msg sdk.Msg) (meta map[string]interface{}, err error) - // SignerData returns account signing data from a queried any account - SignerData(anyAccount *codectypes.Any) (*SignerData, error) - // SigningComponents returns rosetta's components required to build a signable transaction - SigningComponents(tx authsigning.Tx, metadata *ConstructionMetadata, rosPubKeys []*rosettatypes.PublicKey) (txBytes []byte, payloadsToSign []*rosettatypes.SigningPayload, err error) - // Tx converts a CometBFT transaction and tx result if provided to a rosetta tx - Tx(rawTx cmttypes.Tx, txResult *abci.ExecTxResult) (*rosettatypes.Transaction, error) - // TxIdentifiers converts a CometBFT tx to transaction identifiers - TxIdentifiers(txs []cmttypes.Tx) []*rosettatypes.TransactionIdentifier - // BalanceOps converts events to balance operations - BalanceOps(status string, events []abci.Event) []*rosettatypes.Operation - // SyncStatus converts a CometBFT status to sync status - SyncStatus(status *tmcoretypes.ResultStatus) *rosettatypes.SyncStatus - // Peers converts CometBFT peers to rosetta - Peers(peers []tmcoretypes.Peer) []*rosettatypes.Peer -} - -// ToSDKConverter is an interface that exposes -// all the functions used to convert rosetta types -// to CometBFT and sdk types -type ToSDKConverter interface { - // UnsignedTx converts rosetta operations to an unsigned cosmos sdk transactions - UnsignedTx(ops []*rosettatypes.Operation) (tx authsigning.Tx, err error) - // SignedTx adds the provided signatures after decoding the unsigned transaction raw bytes - // and returns the signed tx bytes - SignedTx(txBytes []byte, signatures []*rosettatypes.Signature) (signedTxBytes []byte, err error) - // Msg converts metadata to an sdk message - Msg(meta map[string]interface{}, msg sdk.Msg) (err error) - // HashToTxType returns the transaction type (end block, begin block or deliver tx) - // and the real hash to query in order to get information - HashToTxType(hashBytes []byte) (txType TransactionType, realHash []byte) - // PubKey attempts to convert a rosetta public key to cosmos sdk one - PubKey(pk *rosettatypes.PublicKey) (cryptotypes.PubKey, error) -} - -type converter struct { - newTxBuilder func() sdkclient.TxBuilder - txBuilderFromTx func(tx sdk.Tx) (sdkclient.TxBuilder, error) - txDecode sdk.TxDecoder - txEncode sdk.TxEncoder - bytesToSign func(tx authsigning.Tx, signerData authsigning.SignerData) (b []byte, err error) - ir codectypes.InterfaceRegistry - cdc *codec.ProtoCodec -} - -func NewConverter(cdc *codec.ProtoCodec, ir codectypes.InterfaceRegistry, cfg sdkclient.TxConfig) Converter { - return converter{ - newTxBuilder: cfg.NewTxBuilder, - txBuilderFromTx: cfg.WrapTxBuilder, - txDecode: cfg.TxDecoder(), - txEncode: cfg.TxEncoder(), - bytesToSign: func(tx authsigning.Tx, signerData authsigning.SignerData) (b []byte, err error) { - bytesToSign, err := authsigning.GetSignBytesAdapter( - context.Background(), cfg.SignModeHandler(), - signing.SignMode_SIGN_MODE_LEGACY_AMINO_JSON, signerData, tx) - if err != nil { - return nil, err - } - - return crypto.Sha256(bytesToSign), nil - }, - ir: ir, - cdc: cdc, - } -} - -func (c converter) ToSDK() ToSDKConverter { - return c -} - -func (c converter) ToRosetta() ToRosettaConverter { - return c -} - -// OpsToUnsignedTx returns all the sdk.Msgs given the operations -func (c converter) UnsignedTx(ops []*rosettatypes.Operation) (tx authsigning.Tx, err error) { - builder := c.newTxBuilder() - - var msgs []sdk.Msg - - for i := 0; i < len(ops); i++ { - op := ops[i] - - msg, err := c.ir.Resolve(op.Type) - if err != nil { - return nil, crgerrs.WrapError(crgerrs.ErrBadArgument, "operation not found: "+op.Type) - } - - err = c.Msg(op.Metadata, msg) - if err != nil { - return nil, crgerrs.WrapError(crgerrs.ErrCodec, err.Error()) - } - - // verify message correctness - if m, ok := msg.(sdk.HasValidateBasic); ok { - if err = m.ValidateBasic(); err != nil { - return nil, crgerrs.WrapError( - crgerrs.ErrBadArgument, - fmt.Sprintf("validation of operation at index %d failed: %s", op.OperationIdentifier.Index, err), - ) - } - } - - signers, _, err := c.cdc.GetMsgV1Signers(msg) - if err != nil { - return nil, crgerrs.WrapError(crgerrs.ErrBadArgument, err.Error()) - } - - // check if there are enough signers - if len(signers) == 0 { - return nil, crgerrs.WrapError(crgerrs.ErrBadArgument, fmt.Sprintf("operation at index %d got no signers", op.OperationIdentifier.Index)) - } - // append the msg - msgs = append(msgs, msg) - // if there's only one signer then simply continue - if len(signers) == 1 { - continue - } - // after we have got the msg, we need to verify if the message has multiple signers - // if it has got multiple signers, then we need to fetch all the related operations - // which involve the other signers of the msg, we expect to find them in order - // so if the msg is named "v1.test.Send" and it expects 3 signers, the next 3 operations - // must be with the same name "v1.test.Send" and contain the other signers - // then we can just skip their processing - for j := 0; j < len(signers)-1; j++ { - skipOp := ops[i+j] // get the next index - // verify that the operation is equal to the new one - if skipOp.Type != op.Type { - return nil, crgerrs.WrapError( - crgerrs.ErrBadArgument, - fmt.Sprintf("operation at index %d should have had type %s got: %s", i+j, op.Type, skipOp.Type), - ) - } - - if !reflect.DeepEqual(op.Metadata, skipOp.Metadata) { - return nil, crgerrs.WrapError( - crgerrs.ErrBadArgument, - fmt.Sprintf("operation at index %d should have had metadata equal to %#v, got: %#v", i+j, op.Metadata, skipOp.Metadata)) - } - - i++ // increase so we skip it - } - } - - if err := builder.SetMsgs(msgs...); err != nil { - return nil, crgerrs.WrapError(crgerrs.ErrBadArgument, err.Error()) - } - - return builder.GetTx(), nil -} - -// Msg unmarshals the rosetta metadata to the given sdk.Msg -func (c converter) Msg(meta map[string]interface{}, msg sdk.Msg) error { - metaBytes, err := json.Marshal(meta) - if err != nil { - return err - } - return c.cdc.UnmarshalJSON(metaBytes, msg) -} - -func (c converter) Meta(msg sdk.Msg) (meta map[string]interface{}, err error) { - b, err := c.cdc.MarshalJSON(msg) - if err != nil { - return nil, crgerrs.WrapError(crgerrs.ErrCodec, err.Error()) - } - - err = json.Unmarshal(b, &meta) - if err != nil { - return nil, crgerrs.WrapError(crgerrs.ErrCodec, err.Error()) - } - - return -} - -// Ops will create an operation for each msg signer -// with the message proto name as type, and the raw fields -// as metadata -func (c converter) Ops(status string, msg sdk.Msg) ([]*rosettatypes.Operation, error) { - opName := sdk.MsgTypeURL(msg) - - meta, err := c.Meta(msg) - if err != nil { - return nil, err - } - - signers, _, err := c.cdc.GetMsgV1Signers(msg) - if err != nil { - return nil, err - } - - ops := make([]*rosettatypes.Operation, len(signers)) - for i, signer := range signers { - signerStr, err := c.ir.SigningContext().AddressCodec().BytesToString(signer) - if err != nil { - return nil, err - } - - op := &rosettatypes.Operation{ - Type: opName, - Status: &status, - Account: &rosettatypes.AccountIdentifier{Address: signerStr}, - Metadata: meta, - } - - ops[i] = op - } - - return ops, nil -} - -// Tx converts a CometBFT raw transaction and its result (if provided) to a rosetta transaction -func (c converter) Tx(rawTx cmttypes.Tx, txResult *abci.ExecTxResult) (*rosettatypes.Transaction, error) { - // decode tx - tx, err := c.txDecode(rawTx) - if err != nil { - return nil, crgerrs.WrapError(crgerrs.ErrCodec, err.Error()) - } - // get initial status, as per sdk design, if one msg fails - // the whole TX will be considered failing, so we can't have - // 1 msg being success and 1 msg being reverted - status := StatusTxSuccess - switch txResult { - // if nil, we're probably checking an unconfirmed tx - // or trying to build a new transaction, so status - // is not put inside - case nil: - status = "" - // set the status - default: - if txResult.Code != abci.CodeTypeOK { - status = StatusTxReverted - } - } - // get operations from msgs - msgs := tx.GetMsgs() - var rawTxOps []*rosettatypes.Operation - - for _, msg := range msgs { - ops, err := c.Ops(status, msg) - if err != nil { - return nil, err - } - rawTxOps = append(rawTxOps, ops...) - } - - // now get balance events from response deliver tx - var balanceOps []*rosettatypes.Operation - // tx result might be nil, in case we're querying an unconfirmed tx from the mempool - if txResult != nil { - balanceOps = c.BalanceOps(StatusTxSuccess, txResult.Events) // force set to success because no events for failed tx - } - - // now normalize indexes - totalOps := AddOperationIndexes(rawTxOps, balanceOps) - - return &rosettatypes.Transaction{ - TransactionIdentifier: &rosettatypes.TransactionIdentifier{Hash: fmt.Sprintf("%X", rawTx.Hash())}, - Operations: totalOps, - }, nil -} - -func (c converter) BalanceOps(status string, events []abci.Event) []*rosettatypes.Operation { - var ops []*rosettatypes.Operation - - for _, e := range events { - balanceOps, ok := sdkEventToBalanceOperations(status, e) - if !ok { - continue - } - ops = append(ops, balanceOps...) - } - - return ops -} - -// sdkEventToBalanceOperations converts an event to a rosetta balance operation -// it will panic if the event is malformed because it might mean the sdk spec -// has changed and rosetta needs to reflect those changes too. -// The balance operations are multiple, one for each denom. -func sdkEventToBalanceOperations(status string, event abci.Event) (operations []*rosettatypes.Operation, isBalanceEvent bool) { - var ( - accountIdentifier string - coinChange sdk.Coins - isSub bool - ) - - switch event.Type { - default: - return nil, false - case banktypes.EventTypeCoinSpent: - spender := sdk.MustAccAddressFromBech32(event.Attributes[0].Value) - coins, err := sdk.ParseCoinsNormalized(event.Attributes[1].Value) - if err != nil { - panic(err) - } - - isSub = true - coinChange = coins - accountIdentifier = spender.String() - - case banktypes.EventTypeCoinReceived: - receiver := sdk.MustAccAddressFromBech32(event.Attributes[0].Value) - coins, err := sdk.ParseCoinsNormalized(event.Attributes[1].Value) - if err != nil { - panic(err) - } - - isSub = false - coinChange = coins - accountIdentifier = receiver.String() - - // rosetta does not have the concept of burning coins, so we need to mock - // the burn as a send to an address that cannot be resolved to anything - case banktypes.EventTypeCoinBurn: - coins, err := sdk.ParseCoinsNormalized(event.Attributes[1].Value) - if err != nil { - panic(err) - } - - coinChange = coins - accountIdentifier = BurnerAddressIdentifier - } - - operations = make([]*rosettatypes.Operation, len(coinChange)) - - for i, coin := range coinChange { - - value := coin.Amount.String() - // in case the event is a subtract balance one the rewrite value with - // the negative coin identifier - if isSub { - value = "-" + value - } - - op := &rosettatypes.Operation{ - Type: event.Type, - Status: &status, - Account: &rosettatypes.AccountIdentifier{Address: accountIdentifier}, - Amount: &rosettatypes.Amount{ - Value: value, - Currency: &rosettatypes.Currency{ - Symbol: coin.Denom, - Decimals: 0, - }, - }, - } - - operations[i] = op - } - return operations, true -} - -// Amounts converts []sdk.Coin to rosetta amounts -func (c converter) Amounts(ownedCoins []sdk.Coin, availableCoins sdk.Coins) []*rosettatypes.Amount { - amounts := make([]*rosettatypes.Amount, len(availableCoins)) - ownedCoinsMap := make(map[string]sdkmath.Int, len(availableCoins)) - - for _, ownedCoin := range ownedCoins { - ownedCoinsMap[ownedCoin.Denom] = ownedCoin.Amount - } - - for i, coin := range availableCoins { - value, owned := ownedCoinsMap[coin.Denom] - if !owned { - amounts[i] = &rosettatypes.Amount{ - Value: sdkmath.NewInt(0).String(), - Currency: &rosettatypes.Currency{ - Symbol: coin.Denom, - }, - } - continue - } - amounts[i] = &rosettatypes.Amount{ - Value: value.String(), - Currency: &rosettatypes.Currency{ - Symbol: coin.Denom, - }, - } - } - - return amounts -} - -// AddOperationIndexes adds the indexes to operations adhering to specific rules: -// operations related to messages will be always before than the balance ones -func AddOperationIndexes(msgOps, balanceOps []*rosettatypes.Operation) (finalOps []*rosettatypes.Operation) { - lenMsgOps := len(msgOps) - lenBalanceOps := len(balanceOps) - finalOps = make([]*rosettatypes.Operation, 0, lenMsgOps+lenBalanceOps) - - var currentIndex int64 - // add indexes to msg ops - for _, op := range msgOps { - op.OperationIdentifier = &rosettatypes.OperationIdentifier{ - Index: currentIndex, - } - - finalOps = append(finalOps, op) - currentIndex++ - } - - // add indexes to balance ops - for _, op := range balanceOps { - op.OperationIdentifier = &rosettatypes.OperationIdentifier{ - Index: currentIndex, - } - - finalOps = append(finalOps, op) - currentIndex++ - } - - return finalOps -} - -// EndBlockTxHash produces a mock endblock hash that rosetta can query -// for endblock operations, it also serves the purpose of representing -// part of the state changes happening at endblock level (balance ones) -func (c converter) EndBlockTxHash(hash []byte) string { - final := append([]byte{EndBlockHashStart}, hash...) - return fmt.Sprintf("%X", final) -} - -// BeginBlockTxHash produces a mock beginblock hash that rosetta can query -// for beginblock operations, it also serves the purpose of representing -// part of the state changes happening at beginblock level (balance ones) -func (c converter) BeginBlockTxHash(hash []byte) string { - final := append([]byte{BeginBlockHashStart}, hash...) - return fmt.Sprintf("%X", final) -} - -// HashToTxType takes the provided hash bytes from rosetta and discerns if they are -// a deliver tx type or endblock/begin block hash, returning the real hash afterwards -func (c converter) HashToTxType(hashBytes []byte) (txType TransactionType, realHash []byte) { - switch len(hashBytes) { - case DeliverTxSize: - return DeliverTxTx, hashBytes - - case BeginEndBlockTxSize: - switch hashBytes[0] { - case BeginBlockHashStart: - return BeginBlockTx, hashBytes[1:] - case EndBlockHashStart: - return EndBlockTx, hashBytes[1:] - default: - return UnrecognizedTx, nil - } - - default: - return UnrecognizedTx, nil - } -} - -// StatusToSyncStatus converts a CometBFT status to rosetta sync status -func (c converter) SyncStatus(status *tmcoretypes.ResultStatus) *rosettatypes.SyncStatus { - // determine sync status - stage := StatusPeerSynced - if status.SyncInfo.CatchingUp { - stage = StatusPeerSyncing - } - - return &rosettatypes.SyncStatus{ - CurrentIndex: &status.SyncInfo.LatestBlockHeight, - TargetIndex: nil, // sync info does not allow us to get target height - Stage: &stage, - } -} - -// TxIdentifiers converts a CometBFT raw transactions into an array of rosetta tx identifiers -func (c converter) TxIdentifiers(txs []cmttypes.Tx) []*rosettatypes.TransactionIdentifier { - converted := make([]*rosettatypes.TransactionIdentifier, len(txs)) - for i, tx := range txs { - converted[i] = &rosettatypes.TransactionIdentifier{Hash: fmt.Sprintf("%X", tx.Hash())} - } - - return converted -} - -// tmResultBlockToRosettaBlockResponse converts a CometBFT result block to block response -func (c converter) BlockResponse(block *tmcoretypes.ResultBlock) crgtypes.BlockResponse { - var parentBlock *rosettatypes.BlockIdentifier - - switch block.Block.Height { - case 1: - parentBlock = &rosettatypes.BlockIdentifier{ - Index: 1, - Hash: fmt.Sprintf("%X", block.BlockID.Hash.Bytes()), - } - default: - parentBlock = &rosettatypes.BlockIdentifier{ - Index: block.Block.Height - 1, - Hash: fmt.Sprintf("%X", block.Block.LastBlockID.Hash.Bytes()), - } - } - return crgtypes.BlockResponse{ - Block: &rosettatypes.BlockIdentifier{ - Index: block.Block.Height, - Hash: block.Block.Hash().String(), - }, - ParentBlock: parentBlock, - MillisecondTimestamp: timeToMilliseconds(block.Block.Time), - TxCount: int64(len(block.Block.Txs)), - } -} - -// Peers converts tm peers to rosetta peers -func (c converter) Peers(peers []tmcoretypes.Peer) []*rosettatypes.Peer { - converted := make([]*rosettatypes.Peer, len(peers)) - - for i, peer := range peers { - converted[i] = &rosettatypes.Peer{ - PeerID: peer.NodeInfo.Moniker, - Metadata: map[string]interface{}{ - "addr": peer.NodeInfo.ListenAddr, - }, - } - } - - return converted -} - -// OpsAndSigners takes transactions bytes and returns the operation, is signed is true it will return -// the account identifiers which have signed the transaction -func (c converter) OpsAndSigners(txBytes []byte) (ops []*rosettatypes.Operation, signers []*rosettatypes.AccountIdentifier, err error) { - rosTx, err := c.ToRosetta().Tx(txBytes, nil) - if err != nil { - return nil, nil, err - } - ops = rosTx.Operations - - // get the signers - sdkTx, err := c.txDecode(txBytes) - if err != nil { - return nil, nil, crgerrs.WrapError(crgerrs.ErrCodec, err.Error()) - } - - txBuilder, err := c.txBuilderFromTx(sdkTx) - if err != nil { - return nil, nil, crgerrs.WrapError(crgerrs.ErrCodec, err.Error()) - } - - signerAddrs, err := txBuilder.GetTx().GetSigners() - if err != nil { - return nil, nil, crgerrs.WrapError(crgerrs.ErrBadArgument, err.Error()) - } - - for _, signer := range signerAddrs { - var signerStr string - signerStr, err = c.ir.SigningContext().AddressCodec().BytesToString(signer) - if err != nil { - return - } - - signers = append(signers, &rosettatypes.AccountIdentifier{ - Address: signerStr, - }) - } - - return ops, signers, nil -} - -func (c converter) SignedTx(txBytes []byte, signatures []*rosettatypes.Signature) (signedTxBytes []byte, err error) { - rawTx, err := c.txDecode(txBytes) - if err != nil { - return nil, err - } - - txBuilder, err := c.txBuilderFromTx(rawTx) - if err != nil { - return nil, err - } - - notSignedSigs, err := txBuilder.GetTx().GetSignaturesV2() // - if err != nil { - return nil, crgerrs.WrapError(crgerrs.ErrCodec, err.Error()) - } - - if len(notSignedSigs) != len(signatures) { - return nil, crgerrs.WrapError( - crgerrs.ErrInvalidTransaction, - fmt.Sprintf("expected transaction to have signers data matching the provided signatures: %d <-> %d", len(notSignedSigs), len(signatures))) - } - - signedSigs := make([]signing.SignatureV2, len(notSignedSigs)) - for i, signature := range signatures { - // TODO(fdymylja): here we should check that the public key matches... - signedSigs[i] = signing.SignatureV2{ - PubKey: notSignedSigs[i].PubKey, - Data: &signing.SingleSignatureData{ - SignMode: signing.SignMode_SIGN_MODE_LEGACY_AMINO_JSON, - Signature: signature.Bytes, - }, - Sequence: notSignedSigs[i].Sequence, - } - } - - if err = txBuilder.SetSignatures(signedSigs...); err != nil { - return nil, err - } - - txBytes, err = c.txEncode(txBuilder.GetTx()) - if err != nil { - return nil, err - } - - return txBytes, nil -} - -func (c converter) PubKey(pubKey *rosettatypes.PublicKey) (cryptotypes.PubKey, error) { - if pubKey.CurveType != "secp256k1" { - return nil, crgerrs.WrapError(crgerrs.ErrUnsupportedCurve, "only secp256k1 supported") - } - - cmp, err := secp.ParsePubKey(pubKey.Bytes) - if err != nil { - return nil, crgerrs.WrapError(crgerrs.ErrBadArgument, err.Error()) - } - - compressedPublicKey := make([]byte, secp256k1.PubKeySize) - copy(compressedPublicKey, cmp.SerializeCompressed()) - - pk := &secp256k1.PubKey{Key: compressedPublicKey} - - return pk, nil -} - -// SigningComponents takes a sdk tx and construction metadata and returns signable components -func (c converter) SigningComponents(tx authsigning.Tx, metadata *ConstructionMetadata, rosPubKeys []*rosettatypes.PublicKey) (txBytes []byte, payloadsToSign []*rosettatypes.SigningPayload, err error) { - // verify metadata correctness - feeAmount, err := sdk.ParseCoinsNormalized(metadata.GasPrice) - if err != nil { - return nil, nil, crgerrs.WrapError(crgerrs.ErrBadArgument, err.Error()) - } - - signers, err := tx.GetSigners() - if err != nil { - return nil, nil, crgerrs.WrapError(crgerrs.ErrBadArgument, err.Error()) - } - - // assert the signers data provided in options are the same as the expected signing accounts - // and that the number of rosetta provided public keys equals the one of the signers - if len(metadata.SignersData) != len(signers) || len(signers) != len(rosPubKeys) { - return nil, nil, crgerrs.WrapError(crgerrs.ErrBadArgument, "signers data and account identifiers mismatch") - } - - // add transaction metadata - builder, err := c.txBuilderFromTx(tx) - if err != nil { - return nil, nil, crgerrs.WrapError(crgerrs.ErrCodec, err.Error()) - } - builder.SetFeeAmount(feeAmount) - builder.SetGasLimit(metadata.GasLimit) - builder.SetMemo(metadata.Memo) - - // build signatures - partialSignatures := make([]signing.SignatureV2, len(signers)) - payloadsToSign = make([]*rosettatypes.SigningPayload, len(signers)) - - // pub key ordering matters, in a future release this check might be relaxed - for i, signer := range signers { - // assert that the provided public keys are correctly ordered - // by checking if the signer at index i matches the pubkey at index - pubKey, err := c.ToSDK().PubKey(rosPubKeys[0]) - if err != nil { - return nil, nil, err - } - if !bytes.Equal(pubKey.Address().Bytes(), signer) { - return nil, nil, crgerrs.WrapError( - crgerrs.ErrBadArgument, - fmt.Sprintf("public key at index %d does not match the expected transaction signer: %X <-> %X", i, rosPubKeys[i].Bytes, signer), - ) - } - - signerStr, err := c.ir.SigningContext().AddressCodec().BytesToString(signer) - if err != nil { - return nil, nil, crgerrs.WrapError(crgerrs.ErrBadArgument, err.Error()) - } - - // set the signer data - signerData := authsigning.SignerData{ - Address: signerStr, - ChainID: metadata.ChainID, - AccountNumber: metadata.SignersData[i].AccountNumber, - Sequence: metadata.SignersData[i].Sequence, - PubKey: pubKey, - } - - // get signature bytes - signBytes, err := c.bytesToSign(tx, signerData) - if err != nil { - return nil, nil, crgerrs.WrapError(crgerrs.ErrUnknown, fmt.Sprintf("unable to sign tx: %s", err.Error())) - } - - // set payload - payloadsToSign[i] = &rosettatypes.SigningPayload{ - AccountIdentifier: &rosettatypes.AccountIdentifier{Address: signerStr}, - Bytes: signBytes, - SignatureType: rosettatypes.Ecdsa, - } - - // set partial signature - partialSignatures[i] = signing.SignatureV2{ - PubKey: pubKey, - Data: &signing.SingleSignatureData{}, // needs to be set to empty otherwise the codec will cry - Sequence: metadata.SignersData[i].Sequence, - } - - } - - // now we set the partial signatures in the tx - // because we will need to decode the sequence - // information of each account in a stateless way - err = builder.SetSignatures(partialSignatures...) - if err != nil { - return nil, nil, crgerrs.WrapError(crgerrs.ErrCodec, err.Error()) - } - - // finally encode the tx - txBytes, err = c.txEncode(builder.GetTx()) - if err != nil { - return nil, nil, crgerrs.WrapError(crgerrs.ErrCodec, err.Error()) - } - - return txBytes, payloadsToSign, nil -} - -// SignerData converts the given any account to signer data -func (c converter) SignerData(anyAccount *codectypes.Any) (*SignerData, error) { - var acc sdk.AccountI - err := c.ir.UnpackAny(anyAccount, &acc) - if err != nil { - return nil, crgerrs.WrapError(crgerrs.ErrCodec, err.Error()) - } - - return &SignerData{ - AccountNumber: acc.GetAccountNumber(), - Sequence: acc.GetSequence(), - }, nil -} diff --git a/tools/rosetta/converter_test.go b/tools/rosetta/converter_test.go deleted file mode 100644 index 7eba1fde67b1..000000000000 --- a/tools/rosetta/converter_test.go +++ /dev/null @@ -1,341 +0,0 @@ -package rosetta_test - -import ( - "encoding/hex" - "encoding/json" - "testing" - - "cosmossdk.io/tools/rosetta" - crgerrs "cosmossdk.io/tools/rosetta/lib/errors" - - rosettatypes "github.com/coinbase/rosetta-sdk-go/types" - abci "github.com/cometbft/cometbft/abci/types" - "github.com/stretchr/testify/suite" - - "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" - authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" - authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" - bank "github.com/cosmos/cosmos-sdk/x/bank/types" -) - -type ConverterTestSuite struct { - suite.Suite - - c rosetta.Converter - unsignedTxBytes []byte - unsignedTx authsigning.Tx - - ir codectypes.InterfaceRegistry - cdc *codec.ProtoCodec - txConf client.TxConfig -} - -func (s *ConverterTestSuite) SetupTest() { - // create an unsigned tx - const unsignedTxHex = "0a8e010a8b010a1c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e64126b0a2d636f736d6f733134376b6c68377468356a6b6a793361616a736a3272717668747668396d666465333777713567122d636f736d6f73316d6e7670386c786b616679346c787777617175356561653764787630647a36687767797436331a0b0a057374616b651202313612600a4c0a460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a21034c92046950c876f4a5cb6c7797d6eeb9ef80d67ced4d45fb62b1e859240ba9ad12020a0012100a0a0a057374616b651201311090a10f1a00" - unsignedTxBytes, err := hex.DecodeString(unsignedTxHex) - s.Require().NoError(err) - s.unsignedTxBytes = unsignedTxBytes - // instantiate converter - cdc, ir := rosetta.MakeCodec() - txConfig := authtx.NewTxConfig(cdc, authtx.DefaultSignModes) - s.c = rosetta.NewConverter(cdc, ir, txConfig) - // add utils - s.ir = ir - s.cdc = cdc - s.txConf = txConfig - // add authsigning tx - sdkTx, err := txConfig.TxDecoder()(unsignedTxBytes) - s.Require().NoError(err) - builder, err := txConfig.WrapTxBuilder(sdkTx) - s.Require().NoError(err) - - s.unsignedTx = builder.GetTx() -} - -func (s *ConverterTestSuite) TestFromRosettaOpsToTxSuccess() { - addr1 := sdk.AccAddress("address1").String() - addr2 := sdk.AccAddress("address2").String() - - msg1 := &bank.MsgSend{ - FromAddress: addr1, - ToAddress: addr2, - Amount: sdk.NewCoins(sdk.NewInt64Coin("test", 10)), - } - - msg2 := &bank.MsgSend{ - FromAddress: addr2, - ToAddress: addr1, - Amount: sdk.NewCoins(sdk.NewInt64Coin("utxo", 10)), - } - - ops, err := s.c.ToRosetta().Ops("", msg1) - s.Require().NoError(err) - - ops2, err := s.c.ToRosetta().Ops("", msg2) - s.Require().NoError(err) - - ops = append(ops, ops2...) - - tx, err := s.c.ToSDK().UnsignedTx(ops) - s.Require().NoError(err) - - getMsgs := tx.GetMsgs() - - s.Require().Equal(2, len(getMsgs)) - - s.Require().Equal(getMsgs[0], msg1) - s.Require().Equal(getMsgs[1], msg2) -} - -func (s *ConverterTestSuite) TestFromRosettaOpsToTxErrors() { - s.Run("unrecognized op", func() { - op := &rosettatypes.Operation{ - Type: "non-existent", - } - - _, err := s.c.ToSDK().UnsignedTx([]*rosettatypes.Operation{op}) - - s.Require().ErrorIs(err, crgerrs.ErrBadArgument) - }) - - s.Run("codec type but not sdk.Msg", func() { - op := &rosettatypes.Operation{ - Type: "cosmos.crypto.ed25519.PubKey", - } - - _, err := s.c.ToSDK().UnsignedTx([]*rosettatypes.Operation{op}) - - s.Require().ErrorIs(err, crgerrs.ErrBadArgument) - }) -} - -func (s *ConverterTestSuite) TestMsgToMetaMetaToMsg() { - msg := &bank.MsgSend{ - FromAddress: "addr1", - ToAddress: "addr2", - Amount: sdk.NewCoins(sdk.NewInt64Coin("test", 10)), - } - - meta, err := s.c.ToRosetta().Meta(msg) - s.Require().NoError(err) - - copyMsg := new(bank.MsgSend) - err = s.c.ToSDK().Msg(meta, copyMsg) - s.Require().NoError(err) - s.Require().Equal(msg, copyMsg) -} - -func (s *ConverterTestSuite) TestSignedTx() { - s.Run("success", func() { - const payloadsJSON = `[{"hex_bytes":"82ccce81a3e4a7272249f0e25c3037a316ee2acce76eb0c25db00ef6634a4d57303b2420edfdb4c9a635ad8851fe5c7a9379b7bc2baadc7d74f7e76ac97459b5","signing_payload":{"address":"cosmos147klh7th5jkjy3aajsj2rqvhtvh9mfde37wq5g","hex_bytes":"ed574d84b095250280de38bf8c254e4a1f8755e5bd300b1f6ca2671688136ecc","account_identifier":{"address":"cosmos147klh7th5jkjy3aajsj2rqvhtvh9mfde37wq5g"},"signature_type":"ecdsa"},"public_key":{"hex_bytes":"034c92046950c876f4a5cb6c7797d6eeb9ef80d67ced4d45fb62b1e859240ba9ad","curve_type":"secp256k1"},"signature_type":"ecdsa"}]` - const expectedSignedTxHex = "0a8e010a8b010a1c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e64126b0a2d636f736d6f733134376b6c68377468356a6b6a793361616a736a3272717668747668396d666465333777713567122d636f736d6f73316d6e7670386c786b616679346c787777617175356561653764787630647a36687767797436331a0b0a057374616b651202313612620a4e0a460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a21034c92046950c876f4a5cb6c7797d6eeb9ef80d67ced4d45fb62b1e859240ba9ad12040a02087f12100a0a0a057374616b651201311090a10f1a4082ccce81a3e4a7272249f0e25c3037a316ee2acce76eb0c25db00ef6634a4d57303b2420edfdb4c9a635ad8851fe5c7a9379b7bc2baadc7d74f7e76ac97459b5" - - var payloads []*rosettatypes.Signature - s.Require().NoError(json.Unmarshal([]byte(payloadsJSON), &payloads)) - - signedTx, err := s.c.ToSDK().SignedTx(s.unsignedTxBytes, payloads) - s.Require().NoError(err) - - signedTxHex := hex.EncodeToString(signedTx) - - s.Require().Equal(signedTxHex, expectedSignedTxHex) - }) - - s.Run("signers data and signing payloads mismatch", func() { - _, err := s.c.ToSDK().SignedTx(s.unsignedTxBytes, nil) - s.Require().ErrorIs(err, crgerrs.ErrInvalidTransaction) - }) -} - -func (s *ConverterTestSuite) TestOpsAndSigners() { - s.Run("success", func() { - addr1 := sdk.AccAddress("address1").String() - addr2 := sdk.AccAddress("address2").String() - - msg := &bank.MsgSend{ - FromAddress: addr1, - ToAddress: addr2, - Amount: sdk.NewCoins(sdk.NewInt64Coin("test", 10)), - } - - builder := s.txConf.NewTxBuilder() - s.Require().NoError(builder.SetMsgs(msg)) - - sdkTx := builder.GetTx() - txBytes, err := s.txConf.TxEncoder()(sdkTx) - s.Require().NoError(err) - - ops, signers, err := s.c.ToRosetta().OpsAndSigners(txBytes) - s.Require().NoError(err) - - signerAddrs, err := sdkTx.GetSigners() - s.Require().NoError(err) - s.Require().Equal(len(ops), len(sdkTx.GetMsgs())*len(signerAddrs), "operation number mismatch") - - s.Require().Equal(len(signers), len(signerAddrs), "signers number mismatch") - }) -} - -func (s *ConverterTestSuite) TestBeginEndBlockAndHashToTxType() { - const deliverTxHex = "5229A67AA008B5C5F1A0AEA77D4DEBE146297A30AAEF01777AF10FAD62DD36AB" - - deliverTxBytes, err := hex.DecodeString(deliverTxHex) - s.Require().NoError(err) - - endBlockTxHex := s.c.ToRosetta().EndBlockTxHash(deliverTxBytes) - beginBlockTxHex := s.c.ToRosetta().BeginBlockTxHash(deliverTxBytes) - - txType, hash := s.c.ToSDK().HashToTxType(deliverTxBytes) - - s.Require().Equal(rosetta.DeliverTxTx, txType) - s.Require().Equal(deliverTxBytes, hash, "deliver tx hash should not change") - - endBlockTxBytes, err := hex.DecodeString(endBlockTxHex) - s.Require().NoError(err) - - txType, hash = s.c.ToSDK().HashToTxType(endBlockTxBytes) - - s.Require().Equal(rosetta.EndBlockTx, txType) - s.Require().Equal(deliverTxBytes, hash, "end block tx hash should be equal to a block hash") - - beginBlockTxBytes, err := hex.DecodeString(beginBlockTxHex) - s.Require().NoError(err) - - txType, hash = s.c.ToSDK().HashToTxType(beginBlockTxBytes) - - s.Require().Equal(rosetta.BeginBlockTx, txType) - s.Require().Equal(deliverTxBytes, hash, "begin block tx hash should be equal to a block hash") - - txType, hash = s.c.ToSDK().HashToTxType([]byte("invalid")) - - s.Require().Equal(rosetta.UnrecognizedTx, txType) - s.Require().Nil(hash) - - txType, hash = s.c.ToSDK().HashToTxType(append([]byte{0x3}, deliverTxBytes...)) - s.Require().Equal(rosetta.UnrecognizedTx, txType) - s.Require().Nil(hash) -} - -func (s *ConverterTestSuite) TestSigningComponents() { - s.Run("invalid metadata coins", func() { - _, _, err := s.c.ToRosetta().SigningComponents(nil, &rosetta.ConstructionMetadata{GasPrice: "invalid"}, nil) - s.Require().ErrorIs(err, crgerrs.ErrBadArgument) - }) - - s.Run("length signers data does not match signers", func() { - _, _, err := s.c.ToRosetta().SigningComponents(s.unsignedTx, &rosetta.ConstructionMetadata{GasPrice: "10stake"}, nil) - s.Require().ErrorIs(err, crgerrs.ErrBadArgument) - }) - - s.Run("length pub keys does not match signers", func() { - _, _, err := s.c.ToRosetta().SigningComponents( - s.unsignedTx, - &rosetta.ConstructionMetadata{GasPrice: "10stake", SignersData: []*rosetta.SignerData{ - { - AccountNumber: 0, - Sequence: 0, - }, - }}, - nil) - s.Require().ErrorIs(err, crgerrs.ErrBadArgument) - }) - - s.Run("ros pub key is valid but not the one we expect", func() { - validButUnexpected, err := hex.DecodeString("030da9096a40eb1d6c25f1e26e9cbf8941fc84b8f4dc509c8df5e62a29ab8f2415") - s.Require().NoError(err) - - _, _, err = s.c.ToRosetta().SigningComponents( - s.unsignedTx, - &rosetta.ConstructionMetadata{GasPrice: "10stake", SignersData: []*rosetta.SignerData{ - { - AccountNumber: 0, - Sequence: 0, - }, - }}, - []*rosettatypes.PublicKey{ - { - Bytes: validButUnexpected, - CurveType: rosettatypes.Secp256k1, - }, - }) - s.Require().ErrorIs(err, crgerrs.ErrBadArgument) - }) - - s.Run("success", func() { - expectedPubKey, err := hex.DecodeString("034c92046950c876f4a5cb6c7797d6eeb9ef80d67ced4d45fb62b1e859240ba9ad") - s.Require().NoError(err) - - _, _, err = s.c.ToRosetta().SigningComponents( - s.unsignedTx, - &rosetta.ConstructionMetadata{GasPrice: "10stake", SignersData: []*rosetta.SignerData{ - { - AccountNumber: 0, - Sequence: 0, - }, - }}, - []*rosettatypes.PublicKey{ - { - Bytes: expectedPubKey, - CurveType: rosettatypes.Secp256k1, - }, - }) - s.Require().NoError(err) - }) -} - -func (s *ConverterTestSuite) TestBalanceOps() { - s.Run("not a balance op", func() { - notBalanceOp := abci.Event{ - Type: "not-a-balance-op", - } - - ops := s.c.ToRosetta().BalanceOps("", []abci.Event{notBalanceOp}) - s.Len(ops, 0, "expected no balance ops") - }) - - s.Run("multiple balance ops from 2 multicoins event", func() { - subBalanceOp := bank.NewCoinSpentEvent( - sdk.AccAddress("test"), - sdk.NewCoins(sdk.NewInt64Coin("test", 10), sdk.NewInt64Coin("utxo", 10)), - ) - - addBalanceOp := bank.NewCoinReceivedEvent( - sdk.AccAddress("test"), - sdk.NewCoins(sdk.NewInt64Coin("test", 10), sdk.NewInt64Coin("utxo", 10)), - ) - - ops := s.c.ToRosetta().BalanceOps("", []abci.Event{(abci.Event)(subBalanceOp), (abci.Event)(addBalanceOp)}) - s.Len(ops, 4) - }) - - s.Run("spec broken", func() { - s.Require().Panics(func() { - specBrokenSub := abci.Event{ - Type: bank.EventTypeCoinSpent, - } - _ = s.c.ToRosetta().BalanceOps("", []abci.Event{specBrokenSub}) - }) - - s.Require().Panics(func() { - specBrokenSub := abci.Event{ - Type: bank.EventTypeCoinBurn, - } - _ = s.c.ToRosetta().BalanceOps("", []abci.Event{specBrokenSub}) - }) - - s.Require().Panics(func() { - specBrokenSub := abci.Event{ - Type: bank.EventTypeCoinReceived, - } - _ = s.c.ToRosetta().BalanceOps("", []abci.Event{specBrokenSub}) - }) - }) -} - -func TestConverterTestSuite(t *testing.T) { - suite.Run(t, new(ConverterTestSuite)) -} diff --git a/tools/rosetta/go.mod b/tools/rosetta/go.mod deleted file mode 100644 index d21810d97c48..000000000000 --- a/tools/rosetta/go.mod +++ /dev/null @@ -1,152 +0,0 @@ -module cosmossdk.io/tools/rosetta - -go 1.20 - -require ( - cosmossdk.io/log v1.1.0 - cosmossdk.io/math v1.0.1 - cosmossdk.io/x/tx v0.8.0 - github.com/coinbase/rosetta-sdk-go/types v1.0.0 - github.com/cometbft/cometbft v0.38.0-rc1 - github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230607182757-cfeb10287d61 - github.com/cosmos/gogoproto v1.4.10 - github.com/cosmos/rosetta-sdk-go v0.10.0 - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 - github.com/spf13/cobra v1.7.0 - github.com/spf13/pflag v1.0.5 - github.com/stretchr/testify v1.8.4 - google.golang.org/grpc v1.55.0 -) - -require ( - cosmossdk.io/api v0.4.2 // indirect - cosmossdk.io/collections v0.2.0 // indirect - cosmossdk.io/core v0.8.0 // indirect - cosmossdk.io/depinject v1.0.0-alpha.3 // indirect - cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 // indirect - cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c // indirect - filippo.io/edwards25519 v1.0.0 // indirect - github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect - github.com/99designs/keyring v1.2.1 // indirect - github.com/DataDog/zstd v1.5.5 // indirect - github.com/armon/go-metrics v0.4.1 // indirect - github.com/beorn7/perks v1.0.1 // indirect - github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect - github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect - github.com/cenkalti/backoff/v4 v4.1.3 // indirect - github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/cockroachdb/errors v1.9.1 // indirect - github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20230606152911-c4be581b807f // indirect - github.com/cockroachdb/redact v1.1.4 // indirect - github.com/cometbft/cometbft-db v0.7.0 // indirect - github.com/cosmos/btcutil v1.0.5 // indirect - github.com/cosmos/cosmos-db v1.0.0 // indirect - github.com/cosmos/cosmos-proto v1.0.0-beta.3 // indirect - github.com/cosmos/go-bip39 v1.0.0 // indirect - github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.0.0-beta.2 // indirect - github.com/cosmos/ics23/go v0.10.0 // indirect - github.com/cosmos/ledger-cosmos-go v0.13.0 // indirect - github.com/danieljoos/wincred v1.1.2 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect - github.com/dgraph-io/badger/v2 v2.2007.4 // indirect - 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/dvsekhvalnov/jose2go v1.5.0 // indirect - github.com/emicklei/dot v1.4.2 // indirect - github.com/fatih/color v1.15.0 // indirect - github.com/felixge/httpsnoop v1.0.2 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/getsentry/sentry-go v0.21.0 // indirect - github.com/go-kit/kit v0.12.0 // indirect - github.com/go-kit/log v0.2.1 // indirect - github.com/go-logfmt/logfmt v0.6.0 // indirect - github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect - github.com/gogo/googleapis v1.4.1 // indirect - github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/glog v1.1.0 // indirect - github.com/golang/protobuf v1.5.3 // indirect - github.com/golang/snappy v0.0.4 // indirect - github.com/google/btree v1.1.2 // indirect - github.com/google/go-cmp v0.5.9 // indirect - github.com/gorilla/handlers v1.5.1 // indirect - github.com/gorilla/mux v1.8.0 // indirect - github.com/gorilla/websocket v1.5.0 // indirect - github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect - github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect - github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect - github.com/hashicorp/go-hclog v1.5.0 // indirect - github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/go-plugin v1.4.10 // indirect - github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect - 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/huandu/skiplist v1.2.0 // indirect - github.com/iancoleman/strcase v0.2.0 // indirect - github.com/improbable-eng/grpc-web v0.15.0 // indirect - github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.16.5 // indirect - github.com/kr/pretty v0.3.1 // indirect - github.com/kr/text v0.2.0 // indirect - github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.0 // indirect - github.com/magiconair/properties v1.8.7 // indirect - github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.19 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/mitchellh/go-testing-interface v1.14.1 // indirect - github.com/mitchellh/mapstructure v1.5.0 // indirect - github.com/mtibben/percent v0.2.1 // indirect - github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce // indirect - github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.0.8 // indirect - github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761 // indirect - github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.15.1 // indirect - github.com/prometheus/client_model v0.4.0 // indirect - github.com/prometheus/common v0.44.0 // indirect - github.com/prometheus/procfs v0.10.1 // indirect - github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.10.0 // indirect - github.com/rs/cors v1.8.3 // indirect - github.com/rs/zerolog v1.29.1 // indirect - github.com/sasha-s/go-deadlock v0.3.1 // indirect - github.com/spf13/afero v1.9.5 // indirect - github.com/spf13/cast v1.5.1 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/spf13/viper v1.16.0 // indirect - github.com/subosito/gotenv v1.4.2 // indirect - github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect - github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect - github.com/tendermint/go-amino v0.16.0 // indirect - github.com/tidwall/btree v1.6.0 // indirect - github.com/zondax/hid v0.9.1 // indirect - github.com/zondax/ledger-go v0.14.1 // indirect - go.etcd.io/bbolt v1.3.6 // indirect - golang.org/x/crypto v0.9.0 // indirect - golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/term v0.8.0 // indirect - golang.org/x/text v0.9.0 // indirect - google.golang.org/genproto v0.0.0-20230525234025-438c736192d0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect - google.golang.org/protobuf v1.30.0 // 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.4.0 // indirect - nhooyr.io/websocket v1.8.6 // indirect - pgregory.net/rapid v0.6.2 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect -) - -replace github.com/cosmos/cosmos-sdk => ../.. diff --git a/tools/rosetta/lib/errors/errors.go b/tools/rosetta/lib/errors/errors.go deleted file mode 100644 index 4ad034fc3d9a..000000000000 --- a/tools/rosetta/lib/errors/errors.go +++ /dev/null @@ -1,163 +0,0 @@ -package errors - -// errors.go contains all the errors returned by the adapter implementation -// plus some extra utilities to parse those errors - -import ( - "fmt" - "net/http" - - grpccodes "google.golang.org/grpc/codes" - grpcstatus "google.golang.org/grpc/status" - - "github.com/coinbase/rosetta-sdk-go/types" - cmttypes "github.com/cometbft/cometbft/rpc/jsonrpc/types" -) - -// ListErrors lists all the registered errors -func ListErrors() []*types.Error { - return registry.list() -} - -// SealAndListErrors seals the registry and lists its errors -func SealAndListErrors() []*types.Error { - registry.seal() - return registry.list() -} - -// Error defines an error that can be converted to a Rosetta API error. -type Error struct { - rosErr *types.Error -} - -func (e *Error) Error() string { - if e.rosErr == nil { - return ErrUnknown.Error() - } - return fmt.Sprintf("rosetta: (%d) %s", e.rosErr.Code, e.rosErr.Message) -} - -// Is implements errors.Is for *Error, two errors are considered equal -// if their error codes are identical -func (e *Error) Is(err error) bool { - // assert it can be casted - rosErr, ok := err.(*Error) - if rosErr == nil || !ok { - return false - } - // check that both *Error's are correctly initialized to avoid dereference panics - if rosErr.rosErr == nil || e.rosErr == nil { - return false - } - // messages are equal if their error codes match - return rosErr.rosErr.Code == e.rosErr.Code -} - -// WrapError wraps the rosetta error with additional context -func WrapError(err *Error, msg string) *Error { - return &Error{rosErr: &types.Error{ - Code: err.rosErr.Code, - Message: err.rosErr.Message, - Description: err.rosErr.Description, - Retriable: err.rosErr.Retriable, - Details: map[string]interface{}{ - "info": msg, - }, - }} -} - -// ToRosetta attempts to converting an error into a rosetta -// error, if the error cannot be converted it will be parsed as unknown -func ToRosetta(err error) *types.Error { - // if it's null or not known - rosErr, ok := err.(*Error) - if rosErr == nil || !ok { - tmErr, ok := err.(*cmttypes.RPCError) - if tmErr != nil && ok { - return fromCometToRosettaError(tmErr).rosErr - } - return ToRosetta(WrapError(ErrUnknown, ErrUnknown.Error())) - } - return rosErr.rosErr -} - -// fromCometToRosettaError converts a CometBFT jsonrpc error to rosetta error -func fromCometToRosettaError(err *cmttypes.RPCError) *Error { - return &Error{rosErr: &types.Error{ - Code: http.StatusInternalServerError, - Message: err.Message, - Details: map[string]interface{}{ - "info": err.Data, - }, - }} -} - -// FromGRPCToRosettaError converts a gRPC error to rosetta error -func FromGRPCToRosettaError(err error) *Error { - status, ok := grpcstatus.FromError(err) - if !ok { - return WrapError(ErrUnknown, err.Error()) - } - switch status.Code() { - case grpccodes.NotFound: - return WrapError(ErrNotFound, status.Message()) - case grpccodes.FailedPrecondition: - return WrapError(ErrBadArgument, status.Message()) - case grpccodes.InvalidArgument: - return WrapError(ErrBadArgument, status.Message()) - case grpccodes.Internal: - return WrapError(ErrInternal, status.Message()) - default: - return WrapError(ErrUnknown, status.Message()) - } -} - -func RegisterError(code int32, message string, retryable bool, description string) *Error { - e := &Error{rosErr: &types.Error{ - Code: code, - Message: message, - Description: &description, - Retriable: retryable, - Details: nil, - }} - registry.add(e) - return e -} - -// Default error list -var ( - // ErrUnknown defines an unknown error, if this is returned it means - // the library is ignoring an error - ErrUnknown = RegisterError(0, "unknown", false, "unknown error") - // ErrOffline is returned when there is an attempt to query an endpoint in offline mode - ErrOffline = RegisterError(1, "cannot query endpoint in offline mode", false, "returned when querying an online endpoint in offline mode") - // ErrNetworkNotSupported is returned when there is an attempt to query a network which is not supported - ErrNetworkNotSupported = RegisterError(2, "network is not supported", false, "returned when querying a non supported network") - // ErrCodec is returned when there's an error while marshaling or unmarshalling data - ErrCodec = RegisterError(3, "encode/decode error", true, "returned when there are errors encoding or decoding information to and from the node") - // ErrInvalidOperation is returned when the operation supplied to rosetta is not a valid one - ErrInvalidOperation = RegisterError(4, "invalid operation", false, "returned when the operation is not valid") - // ErrInvalidTransaction is returned when the provided hex bytes of a TX are not valid - ErrInvalidTransaction = RegisterError(5, "invalid transaction", false, "returned when the transaction is invalid") - // ErrInvalidAddress is returned when the byte of the address are bad - ErrInvalidAddress = RegisterError(7, "invalid address", false, "returned when the address is malformed") - // ErrInvalidPubkey is returned when the public key is invalid - ErrInvalidPubkey = RegisterError(8, "invalid pubkey", false, "returned when the public key is invalid") - // ErrInterpreting is returned when there are errors interpreting the data from the node, most likely related to breaking changes, version incompatibilities - ErrInterpreting = RegisterError(9, "error interpreting data from node", false, "returned when there are issues interpreting requests or response from node") - ErrInvalidMemo = RegisterError(11, "invalid memo", false, "returned when the memo is invalid") - // ErrBadArgument is returned when the request is malformed - ErrBadArgument = RegisterError(400, "bad argument", false, "request is malformed") - // ErrNotFound is returned when the required object was not found - // retry is set to true because something that is not found now - // might be found later, example: a TX - ErrNotFound = RegisterError(404, "not found", true, "returned when the node does not find what the client is asking for") - // ErrInternal is returned when the node is experiencing internal errors - ErrInternal = RegisterError(500, "internal error", false, "returned when the node experiences internal errors") - // ErrBadGateway is returned when there are problems interacting with the nodes - ErrBadGateway = RegisterError(502, "bad gateway", true, "return when the node is unreachable") - // ErrNotImplemented is returned when a method is not implemented yet - ErrNotImplemented = RegisterError(14, "not implemented", false, "returned when querying an endpoint which is not implemented") - // ErrUnsupportedCurve is returned when the curve specified is not supported - ErrUnsupportedCurve = RegisterError(15, "unsupported curve, expected secp256k1", false, "returned when using an unsupported crypto curve") -) diff --git a/tools/rosetta/lib/errors/errors_test.go b/tools/rosetta/lib/errors/errors_test.go deleted file mode 100644 index 9782c654db6e..000000000000 --- a/tools/rosetta/lib/errors/errors_test.go +++ /dev/null @@ -1,73 +0,0 @@ -package errors - -import ( - "testing" - - cmttypes "github.com/cometbft/cometbft/rpc/jsonrpc/types" - "github.com/stretchr/testify/assert" -) - -func TestRegisterError(t *testing.T) { - var error *Error - // this is the number of errors registered by default in errors.go - registeredErrorsCount := 16 - assert.Equal(t, len(registry.list()), registeredErrorsCount) - assert.ElementsMatch(t, registry.list(), ListErrors()) - // add a new Error - error = RegisterError(69, "nice!", false, "nice!") - assert.NotNil(t, error) - // now we have a new error - registeredErrorsCount++ - assert.Equal(t, len(ListErrors()), registeredErrorsCount) - // re-register an error should not change anything - RegisterError(69, "nice!", false, "nice!") - assert.Equal(t, len(ListErrors()), registeredErrorsCount) - - // test sealing - assert.Equal(t, registry.sealed, false) - errors := SealAndListErrors() - assert.Equal(t, registry.sealed, true) - assert.Equal(t, len(errors), registeredErrorsCount) - // add a new error on a sealed registry - error = RegisterError(1024, "bytes", false, "bytes") - assert.NotNil(t, error) -} - -func TestError_Error(t *testing.T) { - var error *Error - // nil cases - assert.False(t, ErrOffline.Is(error)) - error = &Error{} - assert.False(t, ErrOffline.Is(error)) - // wrong type - assert.False(t, ErrOffline.Is(&MyError{})) - // test with wrapping an error - error = WrapError(ErrOffline, "offline") - assert.True(t, ErrOffline.Is(error)) - - // test equality - assert.False(t, ErrOffline.Is(ErrBadGateway)) - assert.True(t, ErrBadGateway.Is(ErrBadGateway)) -} - -func TestToRosetta(t *testing.T) { - var error *Error - // nil case - assert.NotNil(t, ToRosetta(error)) - // wrong type - assert.NotNil(t, ToRosetta(&MyError{})) - - tmErr := &cmttypes.RPCError{} - // RpcError case - assert.NotNil(t, ToRosetta(tmErr)) -} - -type MyError struct{} - -func (e *MyError) Error() string { - return "" -} - -func (e *MyError) Is(err error) bool { - return true -} diff --git a/tools/rosetta/lib/errors/registry.go b/tools/rosetta/lib/errors/registry.go deleted file mode 100644 index 9cbafcacf7dc..000000000000 --- a/tools/rosetta/lib/errors/registry.go +++ /dev/null @@ -1,48 +0,0 @@ -package errors - -import ( - "fmt" - "os" - "sync" - - "github.com/coinbase/rosetta-sdk-go/types" -) - -type errorRegistry struct { - mu *sync.RWMutex - sealed bool - errors map[int32]*types.Error -} - -func (r *errorRegistry) add(err *Error) { - r.mu.Lock() - defer r.mu.Unlock() - if r.sealed { - _, _ = fmt.Fprintln(os.Stderr, "[ROSETTA] WARNING: attempts to register errors after seal will be ignored") - } - if _, ok := r.errors[err.rosErr.Code]; ok { - _, _ = fmt.Fprintln(os.Stderr, "[ROSETTA] WARNING: attempts to register an already registered error will be ignored, code: ", err.rosErr.Code) - } - r.errors[err.rosErr.Code] = err.rosErr -} - -func (r errorRegistry) list() []*types.Error { - r.mu.RLock() - defer r.mu.RUnlock() - rosErrs := make([]*types.Error, 0, len(registry.errors)) - for _, v := range r.errors { - rosErrs = append(rosErrs, v) - } - return rosErrs -} - -func (r *errorRegistry) seal() { - r.mu.Lock() - defer r.mu.Unlock() - r.sealed = true -} - -var registry = errorRegistry{ - mu: new(sync.RWMutex), - errors: make(map[int32]*types.Error), -} diff --git a/tools/rosetta/lib/internal/service/account.go b/tools/rosetta/lib/internal/service/account.go deleted file mode 100644 index 5636a35b0261..000000000000 --- a/tools/rosetta/lib/internal/service/account.go +++ /dev/null @@ -1,60 +0,0 @@ -package service - -import ( - "context" - - "cosmossdk.io/tools/rosetta/lib/errors" - crgtypes "cosmossdk.io/tools/rosetta/lib/types" - "github.com/coinbase/rosetta-sdk-go/types" -) - -// AccountBalance retrieves the account balance of an address -// rosetta requires us to fetch the block information too -func (on OnlineNetwork) AccountBalance(ctx context.Context, request *types.AccountBalanceRequest) (*types.AccountBalanceResponse, *types.Error) { - var ( - height int64 - block crgtypes.BlockResponse - err error - ) - - switch { - case request.BlockIdentifier == nil: - syncStatus, err := on.client.Status(ctx) - if err != nil { - return nil, errors.ToRosetta(err) - } - block, err = on.client.BlockByHeight(ctx, syncStatus.CurrentIndex) - if err != nil { - return nil, errors.ToRosetta(err) - } - case request.BlockIdentifier.Hash != nil: - block, err = on.client.BlockByHash(ctx, *request.BlockIdentifier.Hash) - if err != nil { - return nil, errors.ToRosetta(err) - } - height = block.Block.Index - case request.BlockIdentifier.Index != nil: - height = *request.BlockIdentifier.Index - block, err = on.client.BlockByHeight(ctx, &height) - if err != nil { - return nil, errors.ToRosetta(err) - } - } - - accountCoins, err := on.client.Balances(ctx, request.AccountIdentifier.Address, &height) - if err != nil { - return nil, errors.ToRosetta(err) - } - - return &types.AccountBalanceResponse{ - BlockIdentifier: block.Block, - Balances: accountCoins, - Metadata: nil, - }, nil -} - -// AccountsCoins - relevant only for UTXO based chain -// see https://www.rosetta-api.org/docs/AccountApi.html#accountcoins -func (on OnlineNetwork) AccountCoins(_ context.Context, _ *types.AccountCoinsRequest) (*types.AccountCoinsResponse, *types.Error) { - return nil, errors.ToRosetta(errors.ErrOffline) -} diff --git a/tools/rosetta/lib/internal/service/block.go b/tools/rosetta/lib/internal/service/block.go deleted file mode 100644 index 2e489dff74f5..000000000000 --- a/tools/rosetta/lib/internal/service/block.go +++ /dev/null @@ -1,78 +0,0 @@ -package service - -import ( - "context" - - "cosmossdk.io/tools/rosetta/lib/errors" - crgtypes "cosmossdk.io/tools/rosetta/lib/types" - "github.com/coinbase/rosetta-sdk-go/types" -) - -// Block gets the transactions in the given block -func (on OnlineNetwork) Block(ctx context.Context, request *types.BlockRequest) (*types.BlockResponse, *types.Error) { - var ( - blockResponse crgtypes.BlockTransactionsResponse - err error - ) - - // When fetching data by BlockIdentifier, it may be possible to only specify the index or hash. - // If neither property is specified, it is assumed that the client is making a request at the current block. - switch { - case request.BlockIdentifier == nil: // unlike AccountBalance(), BlockIdentifer is mandatory by spec 1.4.10. - err := errors.WrapError(errors.ErrBadArgument, "block identifier needs to be specified") - return nil, errors.ToRosetta(err) - - case request.BlockIdentifier.Hash != nil: - blockResponse, err = on.client.BlockTransactionsByHash(ctx, *request.BlockIdentifier.Hash) - if err != nil { - return nil, errors.ToRosetta(err) - } - case request.BlockIdentifier.Index != nil: - blockResponse, err = on.client.BlockTransactionsByHeight(ctx, request.BlockIdentifier.Index) - if err != nil { - return nil, errors.ToRosetta(err) - } - - default: - // both empty - blockResponse, err = on.client.BlockTransactionsByHeight(ctx, nil) - if err != nil { - return nil, errors.ToRosetta(err) - } - } - - // Both of index and hash can be specified in reuqest, so make sure they are not mismatching. - if request.BlockIdentifier.Index != nil && *request.BlockIdentifier.Index != blockResponse.Block.Index { - err := errors.WrapError(errors.ErrBadArgument, "mismatching index") - return nil, errors.ToRosetta(err) - } - - if request.BlockIdentifier.Hash != nil && *request.BlockIdentifier.Hash != blockResponse.Block.Hash { - err := errors.WrapError(errors.ErrBadArgument, "mismatching hash") - return nil, errors.ToRosetta(err) - } - - return &types.BlockResponse{ - Block: &types.Block{ - BlockIdentifier: blockResponse.Block, - ParentBlockIdentifier: blockResponse.ParentBlock, - Timestamp: blockResponse.MillisecondTimestamp, - Transactions: blockResponse.Transactions, - Metadata: nil, - }, - OtherTransactions: nil, - }, nil -} - -// BlockTransaction gets the given transaction in the specified block, we do not need to check the block itself too -// due to the fact that CometBFT achieves instant finality -func (on OnlineNetwork) BlockTransaction(ctx context.Context, request *types.BlockTransactionRequest) (*types.BlockTransactionResponse, *types.Error) { - tx, err := on.client.GetTx(ctx, request.TransactionIdentifier.Hash) - if err != nil { - return nil, errors.ToRosetta(err) - } - - return &types.BlockTransactionResponse{ - Transaction: tx, - }, nil -} diff --git a/tools/rosetta/lib/internal/service/construction.go b/tools/rosetta/lib/internal/service/construction.go deleted file mode 100644 index f338442d4cf7..000000000000 --- a/tools/rosetta/lib/internal/service/construction.go +++ /dev/null @@ -1,174 +0,0 @@ -package service - -import ( - "context" - "crypto/sha256" - "encoding/hex" - "strconv" - "strings" - - sdkmath "cosmossdk.io/math" - "cosmossdk.io/tools/rosetta/lib/errors" - "github.com/coinbase/rosetta-sdk-go/types" - - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// ConstructionCombine Combine creates a network-specific transaction from an unsigned transaction -// and an array of provided signatures. The signed transaction returned from this method will be -// sent to the /construction/submit endpoint by the caller. -func (on OnlineNetwork) ConstructionCombine(ctx context.Context, request *types.ConstructionCombineRequest) (*types.ConstructionCombineResponse, *types.Error) { - txBytes, err := hex.DecodeString(request.UnsignedTransaction) - if err != nil { - return nil, errors.ToRosetta(err) - } - - signedTx, err := on.client.SignedTx(ctx, txBytes, request.Signatures) - if err != nil { - return nil, errors.ToRosetta(err) - } - - return &types.ConstructionCombineResponse{ - SignedTransaction: hex.EncodeToString(signedTx), - }, nil -} - -// ConstructionDerive Derive returns the AccountIdentifier associated with a public key. -func (on OnlineNetwork) ConstructionDerive(_ context.Context, request *types.ConstructionDeriveRequest) (*types.ConstructionDeriveResponse, *types.Error) { - account, err := on.client.AccountIdentifierFromPublicKey(request.PublicKey) - if err != nil { - return nil, errors.ToRosetta(err) - } - return &types.ConstructionDeriveResponse{ - AccountIdentifier: account, - Metadata: nil, - }, nil -} - -// ConstructionHash TransactionHash returns the network-specific transaction hash for a signed -// transaction. -func (on OnlineNetwork) ConstructionHash(ctx context.Context, request *types.ConstructionHashRequest) (*types.TransactionIdentifierResponse, *types.Error) { - bz, err := hex.DecodeString(request.SignedTransaction) - if err != nil { - return nil, errors.ToRosetta(errors.WrapError(errors.ErrInvalidTransaction, "error decoding tx")) - } - - hash := sha256.Sum256(bz) - bzHash := hash[:] - hashString := hex.EncodeToString(bzHash) - - return &types.TransactionIdentifierResponse{ - TransactionIdentifier: &types.TransactionIdentifier{ - Hash: strings.ToUpper(hashString), - }, - }, nil -} - -// ConstructionMetadata Get any information required to construct a transaction for a specific -// network (i.e. ChainID, Gas, Memo, ...). -func (on OnlineNetwork) ConstructionMetadata(ctx context.Context, request *types.ConstructionMetadataRequest) (*types.ConstructionMetadataResponse, *types.Error) { - metadata, err := on.client.ConstructionMetadataFromOptions(ctx, request.Options) - if err != nil { - return nil, errors.ToRosetta(err) - } - - response := &types.ConstructionMetadataResponse{ - Metadata: metadata, - } - - if metadata["gas_price"] != nil && metadata["gas_limit"] != nil { - gasPrice, ok := metadata["gas_price"].(string) - if !ok { - return nil, errors.ToRosetta(errors.WrapError(errors.ErrBadArgument, "invalid gas_price")) - } - if gasPrice == "" { // gas_price is unset. skip fee suggestion - return response, nil - } - price, err := sdk.ParseDecCoin(gasPrice) - if err != nil { - return nil, errors.ToRosetta(err) - } - - gasLimit, ok := metadata["gas_limit"].(float64) - if !ok { - return nil, errors.ToRosetta(errors.WrapError(errors.ErrBadArgument, "invalid gas_limit")) - } - if gasLimit == 0 { // gas_limit is unset. skip fee suggestion - return response, nil - } - gas := sdkmath.NewIntFromUint64(uint64(gasLimit)) - - suggestedFee := types.Amount{ - Value: strconv.FormatInt(price.Amount.MulInt64(gas.Int64()).Ceil().TruncateInt64(), 10), - Currency: &(types.Currency{ - Symbol: price.Denom, - Decimals: 0, - }), - } - response.SuggestedFee = []*types.Amount{&suggestedFee} - } - - return response, nil -} - -// ConstructionParse Parse is called on both unsigned and signed transactions to understand the -// intent of the formulated transaction. This is run as a sanity check before signing (after -// /construction/payloads) and before broadcast (after /construction/combine). -func (on OnlineNetwork) ConstructionParse(ctx context.Context, request *types.ConstructionParseRequest) (*types.ConstructionParseResponse, *types.Error) { - txBytes, err := hex.DecodeString(request.Transaction) - if err != nil { - err := errors.WrapError(errors.ErrInvalidTransaction, err.Error()) - return nil, errors.ToRosetta(err) - } - ops, signers, err := on.client.TxOperationsAndSignersAccountIdentifiers(request.Signed, txBytes) - if err != nil { - return nil, errors.ToRosetta(err) - } - return &types.ConstructionParseResponse{ - Operations: ops, - AccountIdentifierSigners: signers, - Metadata: nil, - }, nil -} - -// ConstructionPayloads Payloads is called with an array of operations and the response from -// /construction/metadata. It returns an unsigned transaction blob and a collection of payloads that -// must be signed by particular AccountIdentifiers using a certain SignatureType. -func (on OnlineNetwork) ConstructionPayloads(ctx context.Context, request *types.ConstructionPayloadsRequest) (*types.ConstructionPayloadsResponse, *types.Error) { - payload, err := on.client.ConstructionPayload(ctx, request) - if err != nil { - return nil, errors.ToRosetta(err) - } - return payload, nil -} - -// ConstructionPreprocess Preprocess is called prior to /construction/payloads to construct a -// request for any metadata that is needed for transaction construction given (i.e. account nonce). -func (on OnlineNetwork) ConstructionPreprocess(ctx context.Context, request *types.ConstructionPreprocessRequest) (*types.ConstructionPreprocessResponse, *types.Error) { - options, err := on.client.PreprocessOperationsToOptions(ctx, request) - if err != nil { - return nil, errors.ToRosetta(err) - } - - return options, nil -} - -// ConstructionSubmit Submit a pre-signed transaction to the node. This call does not block on the -// transaction being included in a block. Rather, it returns immediately with an indication of -// whether or not the transaction was included in the mempool. -func (on OnlineNetwork) ConstructionSubmit(ctx context.Context, request *types.ConstructionSubmitRequest) (*types.TransactionIdentifierResponse, *types.Error) { - txBytes, err := hex.DecodeString(request.SignedTransaction) - if err != nil { - return nil, errors.ToRosetta(err) - } - - res, meta, err := on.client.PostTx(txBytes) - if err != nil { - return nil, errors.ToRosetta(err) - } - - return &types.TransactionIdentifierResponse{ - TransactionIdentifier: res, - Metadata: meta, - }, nil -} diff --git a/tools/rosetta/lib/internal/service/mempool.go b/tools/rosetta/lib/internal/service/mempool.go deleted file mode 100644 index 9e93085bc090..000000000000 --- a/tools/rosetta/lib/internal/service/mempool.go +++ /dev/null @@ -1,33 +0,0 @@ -package service - -import ( - "context" - - "cosmossdk.io/tools/rosetta/lib/errors" - "github.com/coinbase/rosetta-sdk-go/types" -) - -// Mempool fetches the transactions contained in the mempool -func (on OnlineNetwork) Mempool(ctx context.Context, _ *types.NetworkRequest) (*types.MempoolResponse, *types.Error) { - txs, err := on.client.Mempool(ctx) - if err != nil { - return nil, errors.ToRosetta(err) - } - - return &types.MempoolResponse{ - TransactionIdentifiers: txs, - }, nil -} - -// MempoolTransaction fetches a single transaction in the mempool -// NOTE: it is not implemented yet -func (on OnlineNetwork) MempoolTransaction(ctx context.Context, request *types.MempoolTransactionRequest) (*types.MempoolTransactionResponse, *types.Error) { - tx, err := on.client.GetUnconfirmedTx(ctx, request.TransactionIdentifier.Hash) - if err != nil { - return nil, errors.ToRosetta(err) - } - - return &types.MempoolTransactionResponse{ - Transaction: tx, - }, nil -} diff --git a/tools/rosetta/lib/internal/service/network.go b/tools/rosetta/lib/internal/service/network.go deleted file mode 100644 index a5fd13f8e655..000000000000 --- a/tools/rosetta/lib/internal/service/network.go +++ /dev/null @@ -1,55 +0,0 @@ -package service - -import ( - "context" - - "cosmossdk.io/tools/rosetta/lib/errors" - "github.com/coinbase/rosetta-sdk-go/types" -) - -func (on OnlineNetwork) NetworkList(_ context.Context, _ *types.MetadataRequest) (*types.NetworkListResponse, *types.Error) { - return &types.NetworkListResponse{NetworkIdentifiers: []*types.NetworkIdentifier{on.network}}, nil -} - -func (on OnlineNetwork) NetworkOptions(_ context.Context, _ *types.NetworkRequest) (*types.NetworkOptionsResponse, *types.Error) { - return on.networkOptions, nil -} - -func (on OnlineNetwork) NetworkStatus(ctx context.Context, _ *types.NetworkRequest) (*types.NetworkStatusResponse, *types.Error) { - syncStatus, err := on.client.Status(ctx) - if err != nil { - return nil, errors.ToRosetta(err) - } - - block, err := on.client.BlockByHeight(ctx, syncStatus.CurrentIndex) - if err != nil { - return nil, errors.ToRosetta(err) - } - - oldestBlockIdentifier, err := on.client.OldestBlock(ctx) - if err != nil { - return nil, errors.ToRosetta(err) - } - - genesisBlock, err := on.client.GenesisBlock(ctx) - if err != nil { - genesisBlock, err = on.client.InitialHeightBlock(ctx) - if err != nil { - genesisBlock = oldestBlockIdentifier - } - } - - peers, err := on.client.Peers(ctx) - if err != nil { - return nil, errors.ToRosetta(err) - } - - return &types.NetworkStatusResponse{ - CurrentBlockIdentifier: block.Block, - CurrentBlockTimestamp: block.MillisecondTimestamp, - GenesisBlockIdentifier: genesisBlock.Block, - OldestBlockIdentifier: oldestBlockIdentifier.Block, - SyncStatus: syncStatus, - Peers: peers, - }, nil -} diff --git a/tools/rosetta/lib/internal/service/offline.go b/tools/rosetta/lib/internal/service/offline.go deleted file mode 100644 index 7f4a19bb0b2b..000000000000 --- a/tools/rosetta/lib/internal/service/offline.go +++ /dev/null @@ -1,63 +0,0 @@ -package service - -import ( - "context" - - "github.com/coinbase/rosetta-sdk-go/types" - - crgerrs "cosmossdk.io/tools/rosetta/lib/errors" - crgtypes "cosmossdk.io/tools/rosetta/lib/types" -) - -// NewOffline instantiates the instance of an offline network -// whilst the offline network does not support the DataAPI, -// it supports a subset of the construction API. -func NewOffline(network *types.NetworkIdentifier, client crgtypes.Client) (crgtypes.API, error) { - return OfflineNetwork{ - OnlineNetwork{ - client: client, - network: network, - networkOptions: networkOptionsFromClient(client, nil), - }, - }, nil -} - -// OfflineNetwork implements an offline data API -// which is basically a data API that constantly -// returns errors, because it cannot be used if offline -type OfflineNetwork struct { - OnlineNetwork -} - -// Implement DataAPI in offline mode, which means no method is available -func (o OfflineNetwork) AccountBalance(_ context.Context, _ *types.AccountBalanceRequest) (*types.AccountBalanceResponse, *types.Error) { - return nil, crgerrs.ToRosetta(crgerrs.ErrOffline) -} - -func (o OfflineNetwork) Block(_ context.Context, _ *types.BlockRequest) (*types.BlockResponse, *types.Error) { - return nil, crgerrs.ToRosetta(crgerrs.ErrOffline) -} - -func (o OfflineNetwork) BlockTransaction(_ context.Context, _ *types.BlockTransactionRequest) (*types.BlockTransactionResponse, *types.Error) { - return nil, crgerrs.ToRosetta(crgerrs.ErrOffline) -} - -func (o OfflineNetwork) Mempool(_ context.Context, _ *types.NetworkRequest) (*types.MempoolResponse, *types.Error) { - return nil, crgerrs.ToRosetta(crgerrs.ErrOffline) -} - -func (o OfflineNetwork) MempoolTransaction(_ context.Context, _ *types.MempoolTransactionRequest) (*types.MempoolTransactionResponse, *types.Error) { - return nil, crgerrs.ToRosetta(crgerrs.ErrOffline) -} - -func (o OfflineNetwork) NetworkStatus(_ context.Context, _ *types.NetworkRequest) (*types.NetworkStatusResponse, *types.Error) { - return nil, crgerrs.ToRosetta(crgerrs.ErrOffline) -} - -func (o OfflineNetwork) ConstructionSubmit(_ context.Context, _ *types.ConstructionSubmitRequest) (*types.TransactionIdentifierResponse, *types.Error) { - return nil, crgerrs.ToRosetta(crgerrs.ErrOffline) -} - -func (o OfflineNetwork) ConstructionMetadata(_ context.Context, _ *types.ConstructionMetadataRequest) (*types.ConstructionMetadataResponse, *types.Error) { - return nil, crgerrs.ToRosetta(crgerrs.ErrOffline) -} diff --git a/tools/rosetta/lib/internal/service/online.go b/tools/rosetta/lib/internal/service/online.go deleted file mode 100644 index 213ebe2747bb..000000000000 --- a/tools/rosetta/lib/internal/service/online.go +++ /dev/null @@ -1,65 +0,0 @@ -package service - -import ( - "context" - "time" - - "github.com/coinbase/rosetta-sdk-go/types" - - "cosmossdk.io/log" - crgerrs "cosmossdk.io/tools/rosetta/lib/errors" - crgtypes "cosmossdk.io/tools/rosetta/lib/types" -) - -// genesisBlockFetchTimeout defines a timeout to fetch the genesis block -const ( - genesisBlockFetchTimeout = 15 * time.Second -) - -// NewOnlineNetwork builds a single network adapter. -// It will get the Genesis block on the beginning to avoid calling it everytime. -func NewOnlineNetwork(network *types.NetworkIdentifier, client crgtypes.Client, logger log.Logger) (crgtypes.API, error) { - ctx, cancel := context.WithTimeout(context.Background(), genesisBlockFetchTimeout) - defer cancel() - - var genesisHeight int64 = 1 // to get genesis block height - genesisBlock, err := client.BlockByHeight(ctx, &genesisHeight) - if err != nil { - logger.Error("failed to get genesis block height", "err", err) - } - - return OnlineNetwork{ - client: client, - network: network, - networkOptions: networkOptionsFromClient(client, genesisBlock.Block), - }, nil -} - -// OnlineNetwork groups together all the components required for the full rosetta implementation -type OnlineNetwork struct { - client crgtypes.Client // used to query Cosmos app + CometBFT - - network *types.NetworkIdentifier // identifies the network, it's static - networkOptions *types.NetworkOptionsResponse // identifies the network options, it's static -} - -// networkOptionsFromClient builds network options given the client -func networkOptionsFromClient(client crgtypes.Client, genesisBlock *types.BlockIdentifier) *types.NetworkOptionsResponse { - var tsi *int64 - if genesisBlock != nil { - tsi = &(genesisBlock.Index) - } - return &types.NetworkOptionsResponse{ - Version: &types.Version{ - RosettaVersion: crgtypes.SpecVersion, - NodeVersion: client.Version(), - }, - Allow: &types.Allow{ - OperationStatuses: client.OperationStatuses(), - OperationTypes: client.SupportedOperations(), - Errors: crgerrs.SealAndListErrors(), - HistoricalBalanceLookup: true, - TimestampStartIndex: tsi, - }, - } -} diff --git a/tools/rosetta/lib/server/server.go b/tools/rosetta/lib/server/server.go deleted file mode 100644 index a0809fa8fe59..000000000000 --- a/tools/rosetta/lib/server/server.go +++ /dev/null @@ -1,125 +0,0 @@ -package server - -import ( - "fmt" - "net/http" - "os" - "time" - - "github.com/coinbase/rosetta-sdk-go/types" - assert "github.com/cosmos/rosetta-sdk-go/asserter" - "github.com/cosmos/rosetta-sdk-go/server" - - "cosmossdk.io/log" - "cosmossdk.io/tools/rosetta/lib/internal/service" - crgtypes "cosmossdk.io/tools/rosetta/lib/types" -) - -const ( - DefaultRetries = 5 - DefaultRetryWait = 5 * time.Second -) - -// Settings define the rosetta server settings -type Settings struct { - // Network contains the information regarding the network - Network *types.NetworkIdentifier - // Client is the online API handler - Client crgtypes.Client - // Listen is the address the handler will listen at - Listen string - // Offline defines if the rosetta service should be exposed in offline mode - Offline bool - // Retries is the number of readiness checks that will be attempted when instantiating the handler - // valid only for online API - Retries int - // RetryWait is the time that will be waited between retries - RetryWait time.Duration -} - -type Server struct { - h http.Handler - addr string - logger log.Logger -} - -func (h Server) Start() error { - h.logger.Info(fmt.Sprintf("Rosetta server listening on add %s", h.addr)) - return http.ListenAndServe(h.addr, h.h) //nolint:gosec // users are recommended to operate a proxy in front of this server -} - -func NewServer(settings Settings) (Server, error) { - asserter, err := assert.NewServer( - settings.Client.SupportedOperations(), - true, - []*types.NetworkIdentifier{settings.Network}, - nil, - false, - "", - ) - if err != nil { - return Server{}, fmt.Errorf("cannot build asserter: %w", err) - } - - logger := log.NewLogger(os.Stdout).With(log.ModuleKey, "rosetta") - - var adapter crgtypes.API - switch settings.Offline { - case true: - adapter, err = newOfflineAdapter(settings) - case false: - adapter, err = newOnlineAdapter(settings, logger) - } - if err != nil { - return Server{}, err - } - h := server.NewRouter( - server.NewAccountAPIController(adapter, asserter), - server.NewBlockAPIController(adapter, asserter), - server.NewNetworkAPIController(adapter, asserter), - server.NewMempoolAPIController(adapter, asserter), - server.NewConstructionAPIController(adapter, asserter), - ) - - return Server{ - h: h, - addr: settings.Listen, - logger: logger, - }, nil -} - -func newOfflineAdapter(settings Settings) (crgtypes.API, error) { - if settings.Client == nil { - return nil, fmt.Errorf("client is nil") - } - return service.NewOffline(settings.Network, settings.Client) -} - -func newOnlineAdapter(settings Settings, logger log.Logger) (crgtypes.API, error) { - if settings.Client == nil { - return nil, fmt.Errorf("client is nil") - } - if settings.Retries <= 0 { - settings.Retries = DefaultRetries - } - if settings.RetryWait == 0 { - settings.RetryWait = DefaultRetryWait - } - - var err error - err = settings.Client.Bootstrap() - if err != nil { - return nil, err - } - - for i := 0; i < settings.Retries; i++ { - err = settings.Client.Ready() - if err != nil { - logger.Error("[Rosetta]- Client is not ready. Retrying ...", "error", err) - time.Sleep(settings.RetryWait) - continue - } - return service.NewOnlineNetwork(settings.Network, settings.Client, logger) - } - return nil, fmt.Errorf("maximum number of retries exceeded, last error: %w", err) -} diff --git a/tools/rosetta/lib/types/types.go b/tools/rosetta/lib/types/types.go deleted file mode 100644 index 00711b5bfcf7..000000000000 --- a/tools/rosetta/lib/types/types.go +++ /dev/null @@ -1,171 +0,0 @@ -package types - -import ( - "context" - - "github.com/coinbase/rosetta-sdk-go/types" - "github.com/cosmos/rosetta-sdk-go/server" -) - -// SpecVersion defines the specification of rosetta -const SpecVersion = "" - -// NetworkInformationProvider defines the interface used to provide information regarding -// the network and the version of the cosmos sdk used -type NetworkInformationProvider interface { - // SupportedOperations lists the operations supported by the implementation - SupportedOperations() []string - // OperationStatuses returns the list of statuses supported by the implementation - OperationStatuses() []*types.OperationStatus - // Version returns the version of the node - Version() string -} - -// Client defines the API the client implementation should provide. -type Client interface { - // Bootstrap Needed if the client needs to perform some action before connecting. - Bootstrap() error - // Ready checks if the servicer constraints for queries are satisfied - // for example the node might still not be ready, it's useful in process - // when the rosetta instance might come up before the node itself - // the servicer must return nil if the node is ready - Ready() error - // GenesisBlock gets the genesis block of the chain - GenesisBlock(ctx context.Context) (BlockResponse, error) - // InitialHeightBlock gets block with height InitialHeight - // from GenesisDoc by downloading the blob - InitialHeightBlock(ctx context.Context) (BlockResponse, error) - // OldestBlock gets block with height EarliestBlockHeight from syncStatus - OldestBlock(ctx context.Context) (BlockResponse, error) - - // Data API - - // Balances fetches the balance of the given address - // if height is not nil, then the balance will be displayed - // at the provided height, otherwise last block balance will be returned - Balances(ctx context.Context, addr string, height *int64) ([]*types.Amount, error) - // BlockByHash gets a block and its transaction at the provided height - BlockByHash(ctx context.Context, hash string) (BlockResponse, error) - // BlockByHeight gets a block given its height, if height is nil then last block is returned - BlockByHeight(ctx context.Context, height *int64) (BlockResponse, error) - // BlockTransactionsByHash gets the block, parent block and transactions - // given the block hash. - BlockTransactionsByHash(ctx context.Context, hash string) (BlockTransactionsResponse, error) - // BlockTransactionsByHeight gets the block, parent block and transactions - // given the block hash. - BlockTransactionsByHeight(ctx context.Context, height *int64) (BlockTransactionsResponse, error) - // GetTx gets a transaction given its hash - GetTx(ctx context.Context, hash string) (*types.Transaction, error) - // GetUnconfirmedTx gets an unconfirmed Tx given its hash - // NOTE(fdymylja): NOT IMPLEMENTED YET! - GetUnconfirmedTx(ctx context.Context, hash string) (*types.Transaction, error) - // Mempool returns the list of the current non confirmed transactions - Mempool(ctx context.Context) ([]*types.TransactionIdentifier, error) - // Peers gets the peers currently connected to the node - Peers(ctx context.Context) ([]*types.Peer, error) - // Status returns the node status, such as sync data, version etc - Status(ctx context.Context) (*types.SyncStatus, error) - - // Construction API - - // PostTx posts txBytes to the node and returns the transaction identifier plus metadata related - // to the transaction itself. - PostTx(txBytes []byte) (res *types.TransactionIdentifier, meta map[string]interface{}, err error) - // ConstructionMetadataFromOptions builds metadata map from an option map - ConstructionMetadataFromOptions(ctx context.Context, options map[string]interface{}) (meta map[string]interface{}, err error) - OfflineClient -} - -// OfflineClient defines the functionalities supported without having access to the node -type OfflineClient interface { - NetworkInformationProvider - // SignedTx returns the signed transaction given the tx bytes (msgs) plus the signatures - SignedTx(ctx context.Context, txBytes []byte, sigs []*types.Signature) (signedTxBytes []byte, err error) - // TxOperationsAndSignersAccountIdentifiers returns the operations related to a transaction and the account - // identifiers if the transaction is signed - TxOperationsAndSignersAccountIdentifiers(signed bool, hexBytes []byte) (ops []*types.Operation, signers []*types.AccountIdentifier, err error) - // ConstructionPayload returns the construction payload given the request - ConstructionPayload(ctx context.Context, req *types.ConstructionPayloadsRequest) (resp *types.ConstructionPayloadsResponse, err error) - // PreprocessOperationsToOptions returns the options given the preprocess operations - PreprocessOperationsToOptions(ctx context.Context, req *types.ConstructionPreprocessRequest) (resp *types.ConstructionPreprocessResponse, err error) - // AccountIdentifierFromPublicKey returns the account identifier given the public key - AccountIdentifierFromPublicKey(pubKey *types.PublicKey) (*types.AccountIdentifier, error) -} - -type BlockTransactionsResponse struct { - BlockResponse - Transactions []*types.Transaction -} - -type BlockResponse struct { - Block *types.BlockIdentifier - ParentBlock *types.BlockIdentifier - MillisecondTimestamp int64 - TxCount int64 -} - -// API defines the exposed APIs -// if the service is online -type API interface { - DataAPI - ConstructionAPI -} - -// DataAPI defines the full data API implementation -type DataAPI interface { - server.NetworkAPIServicer - server.AccountAPIServicer - server.BlockAPIServicer - server.MempoolAPIServicer -} - -var _ server.ConstructionAPIServicer = ConstructionAPI(nil) - -// ConstructionAPI defines the full construction API with -// the online and offline endpoints -type ConstructionAPI interface { - ConstructionOnlineAPI - ConstructionOfflineAPI -} - -// ConstructionOnlineAPI defines the construction methods -// allowed in an online implementation -type ConstructionOnlineAPI interface { - ConstructionMetadata( - context.Context, - *types.ConstructionMetadataRequest, - ) (*types.ConstructionMetadataResponse, *types.Error) - ConstructionSubmit( - context.Context, - *types.ConstructionSubmitRequest, - ) (*types.TransactionIdentifierResponse, *types.Error) -} - -// ConstructionOfflineAPI defines the construction methods -// allowed -type ConstructionOfflineAPI interface { - ConstructionCombine( - context.Context, - *types.ConstructionCombineRequest, - ) (*types.ConstructionCombineResponse, *types.Error) - ConstructionDerive( - context.Context, - *types.ConstructionDeriveRequest, - ) (*types.ConstructionDeriveResponse, *types.Error) - ConstructionHash( - context.Context, - *types.ConstructionHashRequest, - ) (*types.TransactionIdentifierResponse, *types.Error) - ConstructionParse( - context.Context, - *types.ConstructionParseRequest, - ) (*types.ConstructionParseResponse, *types.Error) - ConstructionPayloads( - context.Context, - *types.ConstructionPayloadsRequest, - ) (*types.ConstructionPayloadsResponse, *types.Error) - ConstructionPreprocess( - context.Context, - *types.ConstructionPreprocessRequest, - ) (*types.ConstructionPreprocessResponse, *types.Error) -} diff --git a/tools/rosetta/openapi/index.html b/tools/rosetta/openapi/index.html deleted file mode 100644 index d87ae1996fb9..000000000000 --- a/tools/rosetta/openapi/index.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - Rosetta API - - - - - - -
- - - - diff --git a/tools/rosetta/openapi/openapi.yaml b/tools/rosetta/openapi/openapi.yaml deleted file mode 100644 index 57e39563dea6..000000000000 --- a/tools/rosetta/openapi/openapi.yaml +++ /dev/null @@ -1,1227 +0,0 @@ -openapi: 3.0.0 -info: - title: Rosetta API - description: | - version: "main" - license: - name: Apache 2.0 - url: https://github.com/cosmos/cosmos-sdk/blob/main/LICENSE -servers: - - url: http://localhost:8080 - description: Interact with the rosetta API locally on your device -tags: - - name: Account - description: Account endpoints are used to fetch the state of an account. - - name: Block - description: Block endpoints are used to access any data stored in a block - - name: Construction - description: Construction endpoints are used to create and broadcast transactions. - - name: Mempool - description: Mempool endpoints are used to fetch any data stored in the mempool. - - name: Network - description: Network endpoints are used when first connecting to a Rosetta endpoint to determine which network and sub-networks are supported. -paths: - /account/balance: - post: - summary: Get an array of all AccountBalances for an AccountIdentifier and the BlockIdentifier at which the balance lookup was performed. - tags: - - Account - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/AccountBalanceRequest" - responses: - "200": - description: Empty - content: - application/json: - schema: - $ref: "#/components/schemas/AccountBalanceResponse" - "500": - description: Error - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - /account/coins: - post: - summary: Get an array of all unspent coins for an AccountIdentifier and the BlockIdentifier at which the lookup was performed. - tags: - - Account - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/AccountCoinsRequest" - responses: - "200": - description: Empty - content: - application/json: - schema: - $ref: "#/components/schemas/AccountCoinsRequest" - "500": - description: Error - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - /block: - post: - summary: Get a block by its Block Identifier. - tags: - - Block - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/BlockRequest" - responses: - "200": - description: Empty - content: - application/json: - schema: - $ref: "#/components/schemas/BlockResponse" - "500": - description: Error - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - /block/transaction: - post: - summary: Get a transaction in a block by its Transaction Identifier. - tags: - - Block - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/BlockTransactionRequest" - responses: - "200": - description: Empty - content: - application/json: - schema: - $ref: "#/components/schemas/BlockTransactionResponse" - "500": - description: Error - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - /mempool: - post: - summary: Get all Transaction Identifiers in the mempool - tags: - - Mempool - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/MempoolRequest" - responses: - "200": - description: Empty - content: - application/json: - schema: - $ref: "#/components/schemas/MempoolResponse" - "500": - description: Error - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - /mempool/transaction: - post: - summary: Get a transaction in the mempool by its Transaction Identifier. - tags: - - Mempool - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/MempoolTransactionRequest" - responses: - "200": - description: Empty - content: - application/json: - schema: - $ref: "#/components/schemas/MempoolTransactionResponse" - "500": - description: Error - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - /network/list: - post: - summary: Returns a list of NetworkIdentifiers that the Rosetta server supports. - tags: - - Network - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/NetworkListRequest" - responses: - "200": - description: Empty - content: - application/json: - schema: - $ref: "#/components/schemas/NetworkListResponse" - "500": - description: Error - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - /network/options: - post: - summary: Returns the version information and allowed network-specific types for a NetworkIdentifier. - tags: - - Network - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/NetworkOptionsRequest" - responses: - "200": - description: Empty - content: - application/json: - schema: - $ref: "#/components/schemas/NetworkOptionsResponse" - "500": - description: Error - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - /network/status: - post: - summary: Returns the current status of the network requested. - tags: - - Network - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/NetworkStatusRequest" - responses: - "200": - description: Empty - content: - application/json: - schema: - $ref: "#/components/schemas/NetworkStatusResponse" - "500": - description: Error - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - /construction/combine: - post: - summary: Combine creates a network-specific transaction from an unsigned transaction and an array of provided signatures. - tags: - - Construction - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/ConstructionCombineRequest" - responses: - "200": - description: Empty - content: - application/json: - schema: - $ref: "#/components/schemas/ConstructionCombineResponse" - "500": - description: Error - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - /construction/derive: - post: - summary: Derive returns the AccountIdentifier associated with a public key. - tags: - - Construction - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/ConstructionDeriveRequest" - responses: - "200": - description: Empty - content: - application/json: - schema: - $ref: "#/components/schemas/ConstructionDeriveResponse" - "500": - description: Error - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - /construction/hash: - post: - summary: Derive returns the AccountIdentifier associated with a public key. - tags: - - Construction - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/ConstructionHashRequest" - responses: - "200": - description: Empty - content: - application/json: - schema: - $ref: "#/components/schemas/ConstructionHashResponse" - "500": - description: Error - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - /construction/metadata: - post: - summary: Get any information required to construct a transaction for a specific network. - tags: - - Construction - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/ConstructionMetadataRequest" - responses: - "200": - description: Empty - content: - application/json: - schema: - $ref: "#/components/schemas/ConstructionMetadataResponse" - "500": - description: Error - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - /construction/parse: - post: - summary: Parse is called on both unsigned and signed transactions to understand the intent of the formulated transaction. - tags: - - Construction - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/ConstructionParseRequest" - responses: - "200": - description: Empty - content: - application/json: - schema: - $ref: "#/components/schemas/ConstructionParseResponse" - "500": - description: Error - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - /construction/payloads: - post: - summary: Payloads is called with an array of operations and the response from `/construction/metadata`. - tags: - - Construction - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/ConstructionPayloadsRequest" - responses: - "200": - description: Empty - content: - application/json: - schema: - $ref: "#/components/schemas/ConstructionPayloadsResponse" - "500": - description: Error - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - /construction/preprocess: - post: - summary: Preprocess is called prior to /construction/payloads to construct a request for any metadata that is needed for transaction construction given. - tags: - - Construction - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/ConstructionPreprocessRequest" - responses: - "200": - description: Empty - content: - application/json: - schema: - $ref: "#/components/schemas/ConstructionPreprocessResponse" - "500": - description: Error - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - /construction/submit: - post: - summary: Submit a pre-signed transaction to the node. This call should not block on the transaction being included in a block. - tags: - - Construction - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/ConstructionSubmitRequest" - responses: - "200": - description: Empty - content: - application/json: - schema: - $ref: "#/components/schemas/ConstructionSubmitResponse" - "500": - description: Error - content: - application/json: - schema: - $ref: "#/components/schemas/Error" -components: - schemas: - Error: - type: object - required: - - code - - message - - retriable - properties: - code: - type: integer - example: 12 - message: - type: string - example: "" - description: - type: string - example: "" - retriable: - type: boolean - example: true - details: - type: object - - BlockIdentifier: - type: object - required: - - index - - hash - properties: - index: - type: integer - example: 13342095 - hash: - type: string - example: "F7EB233A45FCB1B42457F1ACF50C2574AE14731D0B31BBD5D6B199868023119D" - PartialBlockIdentifier: - type: object - properties: - index: - type: integer - example: 13342095 - hash: - type: string - example: "F7EB233A45FCB1B42457F1ACF50C2574AE14731D0B31BBD5D6B199868023119D" - Block: - type: object - required: - - block_identifier - - parent_block_identifier - - timestamp - - transactions - properties: - block_identifier: - $ref: "#/components/schemas/BlockIdentifier" - parent_block_identifier: - $ref: "#/components/schemas/BlockIdentifier" - timestamp: - type: integer - transactions: - type: array - items: - $ref: "#/components/schemas/Transaction" - metadata: - type: object - - OperationStatus: - type: object - required: - - status - - successful - properties: - status: - type: string - successful: - type: boolean - OperationIdentifier: - type: object - required: - - index - properties: - index: - type: integer - network_index: - type: integer - Operation: - type: object - required: - - operation_identifier - - type - properties: - operation_identifier: - $ref: "#/components/schemas/OperationIdentifier" - related_operations: - type: array - items: - $ref: "#/components/schemas/OperationIdentifier" - type: - type: string - status: - type: string - account: - $ref: "#/components/schemas/AccountIdentifier" - amount: - $ref: "#/components/schemas/Amount" - coin_change: - $ref: "#/components/schemas/CoinChange" - metadata: - type: object - - Direction: - type: string - enum: - - forward - - backward - TransactionIdentifier: - type: object - required: - - hash - properties: - hash: - type: string - RelatedTransaction: - type: object - required: - - transaction_identifier - - direction - properties: - network_identifier: - $ref: "#/components/schemas/NetworkIdentifier" - transaction_identifier: - $ref: "#/components/schemas/TransactionIdentifier" - direction: - $ref: "#/components/schemas/Direction" - - Transaction: - type: object - required: - - transaction_identifier - - operations - properties: - transaction_identifier: - $ref: "#/components/schemas/TransactionIdentifier" - operations: - type: array - items: - $ref: "#/components/schemas/Operation" - related_transactions: - type: array - items: - $ref: "#/components/schemas/RelatedTransaction" - metadata: - type: object - - ExemptionType: - type: string - enum: - - greater_or_equal - - less_or_equal - - dynamic - BalanceExemption: - type: object - properties: - sub_account_address: - type: string - currency: - $ref: "#/components/schemas/Currency" - exemption_type: - $ref: "#/components/schemas/ExemptionType" - Currency: - type: object - required: - - symbol - - decimals - properties: - symbol: - type: string - example: "ATOM" - decimals: - type: integer - example: 8 - metadata: - type: object - Amount: - type: object - required: - - value - - currency - properties: - value: - type: string - currency: - $ref: "#/components/schemas/Currency" - metadata: - type: object - - SubNetworkIdentifier: - type: object - required: - - network - properties: - network: - type: string - metadata: - type: object - NetworkIdentifier: - type: object - required: - - blockchain - - network - properties: - blockchain: - type: string - example: "Cosmos" - network: - type: string - example: "cosmoshub-4" - sub_network_identifier: - $ref: "#/components/schemas/SubNetworkIdentifier" - - SubAccount: - type: object - required: - - address - properties: - address: - type: string - example: "cosmos149hrsy9sze6635a29p7tp33sep35zxqfaknypj" - metadata: - type: object - AccountIdentifier: - type: object - required: - - address - properties: - address: - type: string - sub_account: - $ref: "#/components/schemas/SubAccount" - metadata: - type: object - - CoinAction: - type: string - enum: - - coin_created - - coin_spent - CoinChange: - type: object - required: - - coin_action - - coin_identifier - properties: - coin_identifier: - $ref: "#/components/schemas/CoinIdentifier" - coin_action: - $ref: "#/components/schemas/CoinAction" - CoinIdentifier: - type: object - required: - - identifier - properties: - identifier: - type: string - Coin: - type: object - properties: - coin_identifier: - $ref: "#/components/schemas/CoinIdentifier" - amount: - $ref: "#/components/schemas/Amount" - - Case: - type: string - enum: - - upper_case - - lower_case - - case_sensitive - - null - Version: - type: object - required: - - rosetta_version - - node_version - properties: - rosetta_version: - type: string - node_version: - type: string - middleware_version: - type: string - metadata: - type: object - Allow: - type: object - required: - - operation_statuses - - operation_types - - errors - - historical_balance_lookup - - call_methods - - balance_exemptions - - mempool_coins - properties: - operation_statuses: - type: array - items: - $ref: "#/components/schemas/OperationStatus" - operation_types: - type: array - items: - type: string - errors: - type: array - items: - $ref: "#/components/schemas/Error" - historical_balance_lookup: - type: boolean - timestamp_start_index: - type: integer - call_methods: - type: array - items: - type: string - balance_exemptions: - $ref: "#/components/schemas/BalanceExemption" - mempool_coins: - type: boolean - block_hash_case: - $ref: "#/components/schemas/Case" - transaction_hash_case: - $ref: "#/components/schemas/Case" - - SyncStatus: - type: object - properties: - current_index: - type: integer - target_index: - type: integer - stage: - type: string - synced: - type: boolean - - Peer: - type: object - required: - - peer_id - properties: - peer_id: - type: string - metadata: - type: object - - CurveType: - type: string - enum: - - secp256k1 - - secp256r1 - - edwards25519 - - tweedle - - pallas - PublicKey: - type: object - required: - - hex_bytes - - curve_type - properties: - hex_bytes: - type: string - curve_type: - $ref: "#/components/schemas/CurveType" - SignatureType: - type: string - enum: - - ecdsa - - ecdsa_recovery - - ed25519 - - schnorr_1 - - schnorr_poseidon - SigningPayload: - type: object - required: - - hex_bytes - properties: - address: - type: string - account_identifier: - $ref: "#/components/schemas/AccountIdentifier" - hex_bytes: - type: string - signature_type: - $ref: "#/components/schemas/SignatureType" - Signature: - type: object - required: - - signing_payload - - public_key - - signature_type - - hex_bytes - properties: - signing_payload: - $ref: "#/components/schemas/SigningPayload" - public_key: - $ref: "#/components/schemas/PublicKey" - signature_type: - $ref: "#/components/schemas/SignatureType" - hex_bytes: - type: string - - - AccountBalanceRequest: - type: object - required: - - network_identifier - - account_identifier - properties: - network_identifier: - $ref: "#/components/schemas/NetworkIdentifier" - account_identifier: - $ref: "#/components/schemas/AccountIdentifier" - block_identifier: - $ref: "#/components/schemas/PartialBlockIdentifier" - currency: - $ref: "#/components/schemas/Currency" - AccountBalanceResponse: - type: object - required: - - block_identifier - - balances - properties: - block_identifier: - $ref: "#/components/schemas/BlockIdentifier" - balances: - type: array - items: - $ref: "#/components/schemas/Amount" - metadata: - type: object - AccountCoinsRequest: - type: object - required: - - network_identifier - - account_identifier - - include_mempool - properties: - network_identifier: - $ref: "#/components/schemas/NetworkIdentifier" - account_identifier: - $ref: "#/components/schemas/AccountIdentifier" - include_mempool: - type: boolean - currencies: - type: array - items: - $ref: "#/components/schemas/Currency" - AccountCoinsResponse: - type: object - required: - - block_identifier - - coins - properties: - block_identifier: - $ref: "#/components/schemas/BlockIdentifier" - coins: - type: array - items: - $ref: "#/components/schemas/Coin" - metadata: - type: object - - BlockRequest: - type: object - required: - - network_identifier - - block_identifier - properties: - network_identifier: - $ref: "#/components/schemas/NetworkIdentifier" - block_identifier: - $ref: "#/components/schemas/PartialBlockIdentifier" - BlockResponse: - type: object - properties: - block: - $ref: "#/components/schemas/Block" - other_transactions: - type: array - items: - $ref: "#/components/schemas/TransactionIdentifier" - BlockTransactionRequest: - type: object - required: - - network_identifier - - block_identifier - - transaction_identifier - properties: - network_identifier: - $ref: "#/components/schemas/NetworkIdentifier" - block_identifier: - $ref: "#/components/schemas/BlockIdentifier" - transaction_identifier: - $ref: "#/components/schemas/TransactionIdentifier" - BlockTransactionResponse: - type: object - required: - - transaction - properties: - transaction: - $ref: "#/components/schemas/Transaction" - - MempoolRequest: - type: object - required: - - network_identifier - properties: - network_identifier: - $ref: "#/components/schemas/NetworkIdentifier" - metadata: - type: object - MempoolResponse: - type: object - required: - - transaction_identifiers - properties: - transaction_identifiers: - type: array - items: - $ref: "#/components/schemas/TransactionIdentifier" - MempoolTransactionRequest: - type: object - required: - - network_identifier - - transaction_identifier - properties: - network_identifier: - $ref: "#/components/schemas/NetworkIdentifier" - transaction_identifier: - $ref: "#/components/schemas/TransactionIdentifier" - MempoolTransactionResponse: - type: object - required: - - transaction - properties: - transaction: - $ref: "#/components/schemas/TransactionIdentifier" - metadata: - type: object - - NetworkListRequest: - type: object - properties: - metadata: - type: object - NetworkListResponse: - type: object - required: - - network_identifiers - properties: - network_identifiers: - type: array - items: - $ref: "#/components/schemas/NetworkIdentifier" - NetworkOptionsRequest: - type: object - required: - - network_identifier - properties: - network_identifier: - $ref: "#/components/schemas/NetworkIdentifier" - metadata: - type: object - NetworkOptionsResponse: - type: object - required: - - version - - allow - properties: - version: - $ref: "#/components/schemas/Version" - allow: - $ref: "#/components/schemas/Allow" - NetworkStatusRequest: - type: object - required: - - network_identifier - properties: - network_identifier: - $ref: "#/components/schemas/NetworkIdentifier" - metadata: - type: object - NetworkStatusResponse: - type: object - required: - - current_block_identifier - - current_block_timestamp - - genesis_block_identifier - properties: - current_block_identifier: - $ref: "#/components/schemas/BlockIdentifier" - current_block_timestamp: - type: integer - genesis_block_identifier: - $ref: "#/components/schemas/BlockIdentifier" - oldest_block_identifier: - $ref: "#/components/schemas/BlockIdentifier" - sync_status: - $ref: "#/components/schemas/SyncStatus" - peers: - type: array - items: - $ref: "#/components/schemas/Peer" - ConstructionCombineRequest: - type: object - required: - - network_identifier - - unsigned_transaction - - signatures - properties: - network_identifier: - $ref: "#/components/schemas/NetworkIdentifier" - unsigned_transaction: - type: string - signatures: - type: array - items: - $ref: "#/components/schemas/Signature" - ConstructionCombineResponse: - type: object - required: - - signed_transaction - properties: - signed_transaction: - type: string - ConstructionDeriveRequest: - type: object - required: - - network_identifier - - public_key - properties: - network_identifier: - $ref: "#/components/schemas/NetworkIdentifier" - public_key: - $ref: "#/components/schemas/PublicKey" - metadata: - type: object - ConstructionDeriveResponse: - type: object - properties: - address: - type: string - account_identifier: - $ref: "#/components/schemas/AccountIdentifier" - metadata: - type: object - ConstructionHashRequest: - type: object - required: - - network_identifier - - signed_transaction - properties: - network_identifier: - $ref: "#/components/schemas/NetworkIdentifier" - signed_transaction: - type: string - ConstructionHashResponse: - type: object - required: - - transaction_identifier - properties: - transaction_identifier: - $ref: "#/components/schemas/TransactionIdentifier" - metadata: - type: object - ConstructionMetadataRequest: - type: object - required: - - network_identifier - properties: - network_identifier: - $ref: "#/components/schemas/NetworkIdentifier" - options: - type: object - public_keys: - type: array - items: - $ref: "#/components/schemas/PublicKey" - ConstructionMetadataResponse: - type: object - properties: - metadata: - type: object - suggested_fee: - type: array - items: - $ref: "#/components/schemas/Amount" - ConstructionParseRequest: - type: object - required: - - network_identifier - - signed - - transaction - properties: - network_identifier: - $ref: "#/components/schemas/NetworkIdentifier" - signed: - type: boolean - transaction: - type: string - ConstructionParseResponse: - type: object - required: - - operations - properties: - operations: - type: array - items: - $ref: "#/components/schemas/Operation" - signers: - type: array - items: - type: string - account_identifier_signers: - type: array - items: - $ref: "#/components/schemas/AccountIdentifier" - metadata: - type: object - ConstructionPayloadsRequest: - type: object - required: - - network_identifier - - operations - properties: - network_identifier: - $ref: "#/components/schemas/NetworkIdentifier" - operations: - type: array - items: - $ref: "#/components/schemas/Operation" - metadata.: - type: object - public_keys: - type: array - items: - $ref: "#/components/schemas/PublicKey" - ConstructionPayloadsResponse: - type: object - required: - - unsigned_transaction - - payloads - properties: - unsigned_transaction: - type: string - payloads: - type: array - items: - $ref: "#/components/schemas/SigningPayload" - ConstructionPreprocessRequest: - type: object - required: - - network_identifier - - operations - properties: - network_identifier: - $ref: "#/components/schemas/NetworkIdentifier" - operations: - type: array - items: - $ref: "#/components/schemas/Operation" - metadata: - type: object - ConstructionPreprocessResponse: - type: object - properties: - options: - type: object - required_public_keys: - type: array - items: - $ref: "#/components/schemas/AccountIdentifier" - ConstructionSubmitRequest: - type: object - required: - - network_identifier - - signed_transaction - properties: - network_identifier: - $ref: "#/components/schemas/NetworkIdentifier" - signed_transaction: - type: string - - ConstructionSubmitResponse: - type: object - required: - - transaction_identifier - properties: - transaction_identifier: - $ref: "#/components/schemas/TransactionIdentifier" - metadata: - type: object - - - - - - - - diff --git a/tools/rosetta/sonar-project.properties b/tools/rosetta/sonar-project.properties deleted file mode 100644 index ec76cff28048..000000000000 --- a/tools/rosetta/sonar-project.properties +++ /dev/null @@ -1,14 +0,0 @@ -sonar.projectKey=cosmos-sdk-tools-rosetta -sonar.organization=cosmos - -sonar.projectName=Cosmos SDK - Rosetta -sonar.project.monorepo.enabled=true - -sonar.sources=. -sonar.exclusions=**/*_test.go -sonar.tests=. -sonar.test.inclusions=**/*_test.go -sonar.go.coverage.reportPaths=coverage.out - -sonar.sourceEncoding=UTF-8 -sonar.scm.provider=git \ No newline at end of file diff --git a/tools/rosetta/types.go b/tools/rosetta/types.go deleted file mode 100644 index fbc7f13fa488..000000000000 --- a/tools/rosetta/types.go +++ /dev/null @@ -1,104 +0,0 @@ -package rosetta - -import ( - "crypto/sha256" -) - -// statuses -const ( - StatusTxSuccess = "Success" - StatusTxReverted = "Reverted" - StatusPeerSynced = "synced" - StatusPeerSyncing = "syncing" -) - -// In rosetta all state transitions must be represented as transactions -// since in CometBFT begin block and end block are state transitions -// which are not represented as transactions we mock only the balance changes -// happening at those levels as transactions. (check BeginBlockTxHash for more info) -const ( - DeliverTxSize = sha256.Size - BeginEndBlockTxSize = DeliverTxSize + 1 - EndBlockHashStart = 0x0 - BeginBlockHashStart = 0x1 -) - -const ( - // BurnerAddressIdentifier mocks the account identifier of a burner address - // all coins burned in the sdk will be sent to this identifier, which per sdk.AccAddress - // design we will never be able to query (as of now). - // Rosetta does not understand supply contraction. - BurnerAddressIdentifier = "burner" -) - -// TransactionType is used to distinguish if a rosetta provided hash -// represents endblock, beginblock or deliver tx -type TransactionType int - -const ( - UnrecognizedTx TransactionType = iota - BeginBlockTx - EndBlockTx - DeliverTxTx -) - -// metadata options - -// misc -const ( - Log = "log" -) - -// ConstructionPreprocessMetadata is used to represent -// the metadata rosetta can provide during preprocess options -type ConstructionPreprocessMetadata struct { - Memo string `json:"memo"` - GasLimit uint64 `json:"gas_limit"` - GasPrice string `json:"gas_price"` -} - -func (c *ConstructionPreprocessMetadata) FromMetadata(meta map[string]interface{}) error { - return unmarshalMetadata(meta, c) -} - -// PreprocessOperationsOptionsResponse is the structured metadata options returned by the preprocess operations endpoint -type PreprocessOperationsOptionsResponse struct { - ExpectedSigners []string `json:"expected_signers"` - Memo string `json:"memo"` - GasLimit uint64 `json:"gas_limit"` - GasPrice string `json:"gas_price"` -} - -func (c PreprocessOperationsOptionsResponse) ToMetadata() (map[string]interface{}, error) { - return marshalMetadata(c) -} - -func (c *PreprocessOperationsOptionsResponse) FromMetadata(meta map[string]interface{}) error { - return unmarshalMetadata(meta, c) -} - -// SignerData contains information on the signers when the request -// is being created, used to populate the account information -type SignerData struct { - AccountNumber uint64 `json:"account_number"` - Sequence uint64 `json:"sequence"` -} - -// ConstructionMetadata are the metadata options used to -// construct a transaction. It is returned by ConstructionMetadataFromOptions -// and fed to ConstructionPayload to process the bytes to sign. -type ConstructionMetadata struct { - ChainID string `json:"chain_id"` - SignersData []*SignerData `json:"signer_data"` - GasLimit uint64 `json:"gas_limit"` - GasPrice string `json:"gas_price"` - Memo string `json:"memo"` -} - -func (c ConstructionMetadata) ToMetadata() (map[string]interface{}, error) { - return marshalMetadata(c) -} - -func (c *ConstructionMetadata) FromMetadata(meta map[string]interface{}) error { - return unmarshalMetadata(meta, c) -} diff --git a/tools/rosetta/util.go b/tools/rosetta/util.go deleted file mode 100644 index 5d1bee870eb1..000000000000 --- a/tools/rosetta/util.go +++ /dev/null @@ -1,43 +0,0 @@ -package rosetta - -import ( - "encoding/json" - "time" - - crgerrs "cosmossdk.io/tools/rosetta/lib/errors" -) - -// timeToMilliseconds converts time to milliseconds timestamp -func timeToMilliseconds(t time.Time) int64 { - return t.UnixNano() / (int64(time.Millisecond) / int64(time.Nanosecond)) -} - -// unmarshalMetadata unmarshals the given meta to the target -func unmarshalMetadata(meta map[string]interface{}, target interface{}) error { - b, err := json.Marshal(meta) - if err != nil { - return crgerrs.WrapError(crgerrs.ErrCodec, err.Error()) - } - - err = json.Unmarshal(b, target) - if err != nil { - return crgerrs.WrapError(crgerrs.ErrCodec, err.Error()) - } - - return nil -} - -// marshalMetadata marshals the given interface to map[string]interface{} -func marshalMetadata(o interface{}) (meta map[string]interface{}, err error) { - b, err := json.Marshal(o) - if err != nil { - return nil, crgerrs.WrapError(crgerrs.ErrCodec, err.Error()) - } - meta = make(map[string]interface{}) - err = json.Unmarshal(b, &meta) - if err != nil { - return nil, err - } - - return -} diff --git a/types/abci.go b/types/abci.go index 39e6637cd049..8325f5dadf0c 100644 --- a/types/abci.go +++ b/types/abci.go @@ -30,6 +30,14 @@ type ExtendVoteHandler func(Context, *abci.RequestExtendVote) (*abci.ResponseExt // pre-commit vote extension. type VerifyVoteExtensionHandler func(Context, *abci.RequestVerifyVoteExtension) (*abci.ResponseVerifyVoteExtension, error) +// PreBlocker runs code before the `BeginBlocker` and defines a function type alias for executing logic right +// before FinalizeBlock is called (but after its context has been set up). It is +// intended to allow applications to perform computation on vote extensions and +// persist their results in state. +// +// Note: returning an error will make FinalizeBlock fail. +type PreBlocker func(Context, *abci.RequestFinalizeBlock) (*ResponsePreBlock, error) + // BeginBlocker defines a function type alias for executing application // business logic before transactions are executed. // @@ -58,3 +66,11 @@ type EndBlock struct { type BeginBlock struct { Events []abci.Event } + +type ResponsePreBlock struct { + ConsensusParamsChanged bool +} + +func (r ResponsePreBlock) IsConsensusParamsChanged() bool { + return r.ConsensusParamsChanged +} diff --git a/types/address.go b/types/address.go index d0cb2b04d542..ed725103c34c 100644 --- a/types/address.go +++ b/types/address.go @@ -363,6 +363,16 @@ func ValAddressFromBech32(address string) (addr ValAddress, err error) { return ValAddress(bz), nil } +// MustValAddressFromBech32 calls ValAddressFromBech32 and panics on error. +func MustValAddressFromBech32(address string) ValAddress { + addr, err := ValAddressFromBech32(address) + if err != nil { + panic(err) + } + + return addr +} + // Returns boolean for whether two ValAddresses are Equal func (va ValAddress) Equals(va2 Address) bool { if va.Empty() && va2.Empty() { @@ -372,7 +382,7 @@ func (va ValAddress) Equals(va2 Address) bool { return bytes.Equal(va.Bytes(), va2.Bytes()) } -// Returns boolean for whether an AccAddress is empty +// Returns boolean for whether an ValAddress is empty func (va ValAddress) Empty() bool { return len(va) == 0 } @@ -491,6 +501,7 @@ func (va ValAddress) Format(s fmt.State, verb rune) { type ConsAddress []byte // ConsAddressFromHex creates a ConsAddress from a hex string. +// Deprecated: use ConsensusAddressCodec from Staking keeper func ConsAddressFromHex(address string) (addr ConsAddress, err error) { bz, err := addressBytesFromHexString(address) return ConsAddress(bz), err diff --git a/types/address_test.go b/types/address_test.go index b95d4f4148b0..230b1a16f1a2 100644 --- a/types/address_test.go +++ b/types/address_test.go @@ -558,3 +558,16 @@ func (s *addressTestSuite) TestGetFromBech32() { s.Require().Error(err) s.Require().Equal("invalid Bech32 prefix; expected x, got cosmos", err.Error()) } + +func (s *addressTestSuite) TestMustAccAddressFromBech32() { + bech32PrefixValAddr := types.GetConfig().GetBech32ValidatorAddrPrefix() + addr20byte := []byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19} + address := types.MustBech32ifyAddressBytes(bech32PrefixValAddr, addr20byte) + + valAddress1, err := types.ValAddressFromBech32(address) + s.Require().Nil(err) + + valAddress2 := types.MustValAddressFromBech32(address) + + s.Require().Equal(valAddress1, valAddress2) +} diff --git a/types/bech32/bech32.go b/types/bech32/bech32.go index 59bd8b9541df..8356fa92d3e9 100644 --- a/types/bech32/bech32.go +++ b/types/bech32/bech32.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/btcutil/bech32" ) -// ConvertAndEncode converts from a base64 encoded byte string to base32 encoded byte string and then to bech32. +// ConvertAndEncode converts from a base256 encoded byte string to base32 encoded byte string and then to bech32. func ConvertAndEncode(hrp string, data []byte) (string, error) { converted, err := bech32.ConvertBits(data, 8, 5, true) if err != nil { @@ -16,7 +16,7 @@ func ConvertAndEncode(hrp string, data []byte) (string, error) { return bech32.Encode(hrp, converted) } -// DecodeAndConvert decodes a bech32 encoded string and converts to base64 encoded bytes. +// DecodeAndConvert decodes a bech32 encoded string and converts to base256 encoded bytes. func DecodeAndConvert(bech string) (string, []byte, error) { hrp, data, err := bech32.Decode(bech, 1023) if err != nil { diff --git a/types/codec_test.go b/types/codec_test.go index 4a7ac9cc9769..b4b01c23ecd9 100644 --- a/types/codec_test.go +++ b/types/codec_test.go @@ -4,8 +4,9 @@ import ( "testing" "cosmossdk.io/collections/colltest" + "cosmossdk.io/math" ) func TestIntValue(t *testing.T) { - colltest.TestValueCodec(t, IntValue, NewInt(10005994859)) + colltest.TestValueCodec(t, IntValue, math.NewInt(10005994859)) } diff --git a/types/coin.go b/types/coin.go index c624f4b2bd61..136295eed295 100644 --- a/types/coin.go +++ b/types/coin.go @@ -7,6 +7,8 @@ import ( "regexp" "sort" "strings" + + "cosmossdk.io/math" ) //----------------------------------------------------------------------------- @@ -14,7 +16,7 @@ import ( // NewCoin returns a new coin with a denomination and amount. It will panic if // the amount is negative or if the denomination is invalid. -func NewCoin(denom string, amount Int) Coin { +func NewCoin(denom string, amount math.Int) Coin { coin := Coin{ Denom: denom, Amount: amount, @@ -30,7 +32,7 @@ func NewCoin(denom string, amount Int) Coin { // NewInt64Coin returns a new coin with a denomination and amount. It will panic // if the amount is negative. func NewInt64Coin(denom string, amount int64) Coin { - return NewCoin(denom, NewInt(amount)) + return NewCoin(denom, math.NewInt(amount)) } // String provides a human-readable representation of a coin @@ -113,7 +115,7 @@ func (coin Coin) Add(coinB Coin) Coin { } // AddAmount adds an amount to the Coin. -func (coin Coin) AddAmount(amount Int) Coin { +func (coin Coin) AddAmount(amount math.Int) Coin { return Coin{coin.Denom, coin.Amount.Add(amount)} } @@ -143,7 +145,7 @@ func (coin Coin) SafeSub(coinB Coin) (Coin, error) { } // SubAmount subtracts an amount from the Coin. -func (coin Coin) SubAmount(amount Int) Coin { +func (coin Coin) SubAmount(amount math.Int) Coin { res := Coin{coin.Denom, coin.Amount.Sub(amount)} if res.IsNegative() { panic("negative coin amount") @@ -337,7 +339,7 @@ func (coins Coins) safeAdd(coinsB Coins) (coalesced Coins) { } for denom, cL := range uniqCoins { //#nosec - comboCoin := Coin{Denom: denom, Amount: NewInt(0)} + comboCoin := Coin{Denom: denom, Amount: math.NewInt(0)} for _, c := range cL { comboCoin = comboCoin.Add(c) } @@ -400,7 +402,7 @@ func (coins Coins) SafeSub(coinsB ...Coin) (Coins, bool) { // {2A, 3B} * 2 = {4A, 6B} // {2A} * 0 panics // Note, if IsValid was true on Coins, IsValid stays true. -func (coins Coins) MulInt(x Int) Coins { +func (coins Coins) MulInt(x math.Int) Coins { coins, ok := coins.SafeMulInt(x) if !ok { panic("multiplying by zero is an invalid operation on coins") @@ -411,7 +413,7 @@ func (coins Coins) MulInt(x Int) Coins { // SafeMulInt performs the same arithmetic as MulInt but returns false // if the `multiplier` is zero because it makes IsValid return false. -func (coins Coins) SafeMulInt(x Int) (Coins, bool) { +func (coins Coins) SafeMulInt(x math.Int) (Coins, bool) { if x.IsZero() { return nil, false } @@ -434,7 +436,7 @@ func (coins Coins) SafeMulInt(x Int) (Coins, bool) { // {2A} / 0 = panics // Note, if IsValid was true on Coins, IsValid stays true, // unless the `divisor` is greater than the smallest coin amount. -func (coins Coins) QuoInt(x Int) Coins { +func (coins Coins) QuoInt(x math.Int) Coins { coins, ok := coins.SafeQuoInt(x) if !ok { panic("dividing by zero is an invalid operation on coins") @@ -445,7 +447,7 @@ func (coins Coins) QuoInt(x Int) Coins { // SafeQuoInt performs the same arithmetic as QuoInt but returns an error // if the division cannot be done. -func (coins Coins) SafeQuoInt(x Int) (Coins, bool) { +func (coins Coins) SafeQuoInt(x math.Int) (Coins, bool) { if x.IsZero() { return nil, false } @@ -681,18 +683,18 @@ func (coins Coins) Empty() bool { } // AmountOf returns the amount of a denom from coins -func (coins Coins) AmountOf(denom string) Int { +func (coins Coins) AmountOf(denom string) math.Int { mustValidateDenom(denom) return coins.AmountOfNoDenomValidation(denom) } // AmountOfNoDenomValidation returns the amount of a denom from coins // without validating the denomination. -func (coins Coins) AmountOfNoDenomValidation(denom string) Int { +func (coins Coins) AmountOfNoDenomValidation(denom string) math.Int { if ok, c := coins.Find(denom); ok { return c.Amount } - return ZeroInt() + return math.ZeroInt() } // Find returns true and coin if the denom exists in coins. Otherwise it returns false @@ -818,7 +820,12 @@ var _ sort.Interface = Coins{} // Sort is a helper function to sort the set of coins in-place func (coins Coins) Sort() Coins { - sort.Sort(coins) + // sort.Sort(coins) does a costly runtime copy as part of `runtime.convTSlice` + // So we avoid this heap allocation if len(coins) <= 1. In the future, we should hopefully find + // a strategy to always avoid this. + if len(coins) > 1 { + sort.Sort(coins) + } return coins } diff --git a/types/coin.pb.go b/types/coin.pb.go index 28b017a81459..b1674eb8f70e 100644 --- a/types/coin.pb.go +++ b/types/coin.pb.go @@ -4,6 +4,7 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-proto" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" @@ -30,8 +31,8 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // NOTE: The amount field is an Int which implements the custom method // signatures required by gogoproto. type Coin struct { - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` - Amount Int `protobuf:"bytes,2,opt,name=amount,proto3,customtype=Int" json:"amount"` + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + Amount cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=amount,proto3,customtype=cosmossdk.io/math.Int" json:"amount"` } func (m *Coin) Reset() { *m = Coin{} } @@ -78,8 +79,8 @@ func (m *Coin) GetDenom() string { // NOTE: The amount field is an Dec which implements the custom method // signatures required by gogoproto. type DecCoin struct { - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` - Amount Dec `protobuf:"bytes,2,opt,name=amount,proto3,customtype=Dec" json:"amount"` + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + Amount cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=amount,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"amount"` } func (m *DecCoin) Reset() { *m = DecCoin{} } @@ -122,8 +123,9 @@ func (m *DecCoin) GetDenom() string { } // IntProto defines a Protobuf wrapper around an Int object. +// Deprecated: Prefer to use math.Int directly. It supports binary Marshal and Unmarshal. type IntProto struct { - Int Int `protobuf:"bytes,1,opt,name=int,proto3,customtype=Int" json:"int"` + Int cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=int,proto3,customtype=cosmossdk.io/math.Int" json:"int"` } func (m *IntProto) Reset() { *m = IntProto{} } @@ -159,8 +161,9 @@ func (m *IntProto) XXX_DiscardUnknown() { var xxx_messageInfo_IntProto proto.InternalMessageInfo // DecProto defines a Protobuf wrapper around a Dec object. +// Deprecated: Prefer to use math.LegacyDec directly. It supports binary Marshal and Unmarshal. type DecProto struct { - Dec Dec `protobuf:"bytes,1,opt,name=dec,proto3,customtype=Dec" json:"dec"` + Dec cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=dec,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"dec"` } func (m *DecProto) Reset() { *m = DecProto{} } @@ -205,27 +208,29 @@ func init() { func init() { proto.RegisterFile("cosmos/base/v1beta1/coin.proto", fileDescriptor_189a96714eafc2df) } var fileDescriptor_189a96714eafc2df = []byte{ - // 312 bytes of a gzipped FileDescriptorProto + // 341 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0xd6, 0x4f, 0x4a, 0x2c, 0x4e, 0xd5, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x4f, 0xce, 0xcf, 0xcc, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, 0xc8, 0xeb, 0x81, 0xe4, 0xf5, 0xa0, 0xf2, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0x79, 0x7d, 0x10, 0x0b, 0xa2, 0x54, 0x4a, 0x12, 0xa2, 0x34, 0x1e, 0x22, 0x01, 0xd5, 0x07, 0x91, 0x12, 0x4c, 0xcc, 0xcd, 0xcc, - 0xcb, 0xd7, 0x07, 0x93, 0x10, 0x21, 0xa5, 0x28, 0x2e, 0x16, 0xe7, 0xfc, 0xcc, 0x3c, 0x21, 0x11, + 0xcb, 0xd7, 0x07, 0x93, 0x10, 0x21, 0xa5, 0x1c, 0x2e, 0x16, 0xe7, 0xfc, 0xcc, 0x3c, 0x21, 0x11, 0x2e, 0xd6, 0x94, 0xd4, 0xbc, 0xfc, 0x5c, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xce, 0x20, 0x08, 0x47, - 0xc8, 0x8c, 0x8b, 0x2d, 0x31, 0x37, 0xbf, 0x34, 0xaf, 0x44, 0x82, 0x09, 0x24, 0xec, 0x24, 0x77, - 0xe2, 0x9e, 0x3c, 0xc3, 0xad, 0x7b, 0xf2, 0xcc, 0x9e, 0x79, 0x25, 0x97, 0xb6, 0xe8, 0x72, 0x41, - 0x4d, 0xf7, 0xcc, 0x2b, 0x59, 0xf1, 0x7c, 0x83, 0x16, 0x63, 0x10, 0x54, 0xb5, 0x15, 0xcb, 0x8b, - 0x05, 0xf2, 0x8c, 0x4a, 0x11, 0x5c, 0xec, 0x2e, 0xa9, 0xc9, 0x78, 0x8c, 0x37, 0x44, 0x33, 0x5e, - 0x12, 0x66, 0xbc, 0x4b, 0x6a, 0x32, 0x92, 0xf1, 0x2e, 0xa9, 0xc9, 0x68, 0x26, 0x9b, 0x73, 0x71, - 0x78, 0xe6, 0x95, 0x04, 0x80, 0x83, 0x46, 0x9b, 0x8b, 0x39, 0x33, 0xaf, 0x04, 0x62, 0x30, 0xc2, - 0x04, 0x0c, 0x07, 0x06, 0x81, 0x54, 0x81, 0x34, 0xba, 0xa4, 0x26, 0xc3, 0x35, 0xa6, 0xa4, 0x26, - 0xa3, 0x6b, 0xc4, 0xb4, 0x1a, 0xa4, 0xca, 0xc9, 0xe5, 0xc6, 0x43, 0x39, 0x86, 0x86, 0x47, 0x72, - 0x0c, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, - 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x94, 0x9e, 0x59, 0x92, - 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0x0b, 0x0d, 0x75, 0x28, 0xa5, 0x5b, 0x9c, 0x92, 0xad, 0x5f, - 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x0e, 0x74, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, - 0x33, 0xcc, 0xd5, 0x87, 0xef, 0x01, 0x00, 0x00, + 0xc8, 0x83, 0x8b, 0x2d, 0x31, 0x37, 0xbf, 0x34, 0xaf, 0x44, 0x82, 0x09, 0x24, 0xec, 0x64, 0x70, + 0xe2, 0x9e, 0x3c, 0xc3, 0xad, 0x7b, 0xf2, 0xa2, 0x10, 0x63, 0x8b, 0x53, 0xb2, 0xf5, 0x32, 0xf3, + 0xf5, 0x73, 0x13, 0x4b, 0x32, 0xf4, 0x3c, 0xf3, 0x4a, 0x2e, 0x6d, 0xd1, 0xe5, 0x82, 0xda, 0xe7, + 0x99, 0x57, 0xb2, 0xe2, 0xf9, 0x06, 0x2d, 0xc6, 0x20, 0xa8, 0x7e, 0x2b, 0x96, 0x17, 0x0b, 0xe4, + 0x19, 0x95, 0x0a, 0xb8, 0xd8, 0x5d, 0x52, 0x93, 0xf1, 0x58, 0xe8, 0x89, 0x66, 0xa1, 0x21, 0xd4, + 0x42, 0x69, 0x4c, 0x0b, 0x7d, 0x52, 0xd3, 0x13, 0x93, 0x2b, 0x5d, 0x52, 0x93, 0x91, 0xac, 0x75, + 0x49, 0x4d, 0x46, 0xb3, 0xd1, 0x93, 0x8b, 0xc3, 0x33, 0xaf, 0x24, 0x00, 0x1c, 0x88, 0xb6, 0x5c, + 0xcc, 0x99, 0x79, 0x25, 0x10, 0x0b, 0x9d, 0xb4, 0x49, 0xf0, 0x4a, 0x10, 0x48, 0x9f, 0x92, 0x3f, + 0x17, 0x87, 0x4b, 0x6a, 0x32, 0xc4, 0x28, 0x67, 0x2e, 0xe6, 0x94, 0xd4, 0x64, 0xa8, 0x51, 0x64, + 0x38, 0x12, 0xa4, 0xdb, 0xc9, 0xe5, 0xc6, 0x43, 0x39, 0x86, 0x86, 0x47, 0x72, 0x0c, 0x27, 0x1e, + 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, + 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x94, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, + 0x97, 0x9c, 0x9f, 0x0b, 0x8d, 0x49, 0x28, 0xa5, 0x5b, 0x9c, 0x92, 0xad, 0x5f, 0x52, 0x59, 0x90, + 0x5a, 0x9c, 0xc4, 0x06, 0x8e, 0x48, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd2, 0x0a, 0x5e, + 0xb8, 0x43, 0x02, 0x00, 0x00, } func (this *Coin) Equal(that interface{}) bool { diff --git a/types/coin_benchmark_test.go b/types/coin_benchmark_test.go index 5bb3f843f288..955578cf67a6 100644 --- a/types/coin_benchmark_test.go +++ b/types/coin_benchmark_test.go @@ -3,6 +3,8 @@ package types import ( "fmt" "testing" + + "cosmossdk.io/math" ) func coinName(suffix int) string { @@ -18,10 +20,10 @@ func BenchmarkCoinsAdditionIntersect(b *testing.B) { coinsB := Coins(make([]Coin, numCoinsB)) for i := 0; i < numCoinsA; i++ { - coinsA[i] = NewCoin(coinName(i), NewInt(int64(i))) + coinsA[i] = NewCoin(coinName(i), math.NewInt(int64(i))) } for i := 0; i < numCoinsB; i++ { - coinsB[i] = NewCoin(coinName(i), NewInt(int64(i))) + coinsB[i] = NewCoin(coinName(i), math.NewInt(int64(i))) } b.ResetTimer() @@ -49,10 +51,10 @@ func BenchmarkCoinsAdditionNoIntersect(b *testing.B) { coinsB := Coins(make([]Coin, numCoinsB)) for i := 0; i < numCoinsA; i++ { - coinsA[i] = NewCoin(coinName(numCoinsB+i), NewInt(int64(i))) + coinsA[i] = NewCoin(coinName(numCoinsB+i), math.NewInt(int64(i))) } for i := 0; i < numCoinsB; i++ { - coinsB[i] = NewCoin(coinName(i), NewInt(int64(i))) + coinsB[i] = NewCoin(coinName(i), math.NewInt(int64(i))) } b.ResetTimer() @@ -84,7 +86,7 @@ func BenchmarkSumOfCoinAdds(b *testing.B) { for i := 0; i < numAdds; i++ { intersectCoins := make([]Coin, numIntersectingCoins) - num := NewInt(int64(i)) + num := math.NewInt(int64(i)) for j := 0; j < numIntersectingCoins; j++ { intersectCoins[j] = NewCoin(coinName(j+1_000_000_000), num) } diff --git a/types/coin_internal_test.go b/types/coin_internal_test.go index 709683795c37..0da746852a02 100644 --- a/types/coin_internal_test.go +++ b/types/coin_internal_test.go @@ -4,6 +4,8 @@ import ( "testing" "github.com/stretchr/testify/suite" + + "cosmossdk.io/math" ) func TestCoinTestSuite(t *testing.T) { @@ -15,7 +17,7 @@ type coinInternalSuite struct { } func (s *coinInternalSuite) TestIsSorted() { - v := NewInt(1) + v := math.NewInt(1) cases := []struct { coins Coins expected bool diff --git a/types/coin_test.go b/types/coin_test.go index 536937c1e613..bce1eb8bd84e 100644 --- a/types/coin_test.go +++ b/types/coin_test.go @@ -5,10 +5,11 @@ import ( "strings" "testing" - "cosmossdk.io/math" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" ) diff --git a/types/collections.go b/types/collections.go index 91d5fb7dcd5a..4d2c84ca8299 100644 --- a/types/collections.go +++ b/types/collections.go @@ -32,6 +32,9 @@ var ( // IntValue represents a collections.ValueCodec to work with Int. IntValue collcodec.ValueCodec[math.Int] = intValueCodec{} + // LegacyDecValue represents a collections.ValueCodec to work with LegacyDec. + LegacyDecValue collcodec.ValueCodec[math.LegacyDec] = legacyDecValueCodec{} + // TimeKey represents a collections.KeyCodec to work with time.Time // Deprecated: exists only for state compatibility reasons, should not // be used for new storage keys using time. Please use the time KeyCodec @@ -39,6 +42,10 @@ var ( TimeKey collcodec.KeyCodec[time.Time] = timeKeyCodec{} ) +const ( + LegacyDec string = "math.LegacyDec" +) + type addressUnion interface { AccAddress | ValAddress | ConsAddress String() string @@ -94,26 +101,26 @@ func (a genericAddressKey[T]) SizeNonTerminal(key T) int { return collections.BytesKey.SizeNonTerminal(key) } -// Deprecated: genericAddressIndexKey is a special key codec used to retain state backwards compatibility +// Deprecated: lengthPrefixedAddressKey is a special key codec used to retain state backwards compatibility // when a generic address key (be: AccAddress, ValAddress, ConsAddress), is used as an index key. -// More docs can be found in the AddressKeyAsIndexKey function. -type genericAddressIndexKey[T addressUnion] struct { +// More docs can be found in the LengthPrefixedAddressKey function. +type lengthPrefixedAddressKey[T addressUnion] struct { collcodec.KeyCodec[T] } -func (g genericAddressIndexKey[T]) Encode(buffer []byte, key T) (int, error) { +func (g lengthPrefixedAddressKey[T]) Encode(buffer []byte, key T) (int, error) { return g.EncodeNonTerminal(buffer, key) } -func (g genericAddressIndexKey[T]) Decode(buffer []byte) (int, T, error) { +func (g lengthPrefixedAddressKey[T]) Decode(buffer []byte) (int, T, error) { return g.DecodeNonTerminal(buffer) } -func (g genericAddressIndexKey[T]) Size(key T) int { return g.SizeNonTerminal(key) } +func (g lengthPrefixedAddressKey[T]) Size(key T) int { return g.SizeNonTerminal(key) } -func (g genericAddressIndexKey[T]) KeyType() string { return "index_key/" + g.KeyCodec.KeyType() } +func (g lengthPrefixedAddressKey[T]) KeyType() string { return "index_key/" + g.KeyCodec.KeyType() } -// Deprecated: AddressKeyAsIndexKey implements an SDK backwards compatible indexing key encoder +// Deprecated: LengthPrefixedAddressKey implements an SDK backwards compatible indexing key encoder // for addresses. // The status quo in the SDK is that address keys are length prefixed even when they're the // last part of a composite key. This should never be used unless to retain state compatibility. @@ -122,8 +129,8 @@ func (g genericAddressIndexKey[T]) KeyType() string { return "index_key/" + g.Ke // byte to the string, then when you know when the string part finishes, it's logical that the // part which remains is the address key. In the SDK instead we prepend to the address key its // length too. -func AddressKeyAsIndexKey[T addressUnion](keyCodec collcodec.KeyCodec[T]) collcodec.KeyCodec[T] { - return genericAddressIndexKey[T]{ +func LengthPrefixedAddressKey[T addressUnion](keyCodec collcodec.KeyCodec[T]) collcodec.KeyCodec[T] { + return lengthPrefixedAddressKey[T]{ keyCodec, } } @@ -137,10 +144,10 @@ func (i intValueCodec) Encode(value math.Int) ([]byte, error) { } func (i intValueCodec) Decode(b []byte) (math.Int, error) { - v := new(Int) + v := new(math.Int) err := v.Unmarshal(b) if err != nil { - return Int{}, err + return math.Int{}, err } return *v, nil } @@ -149,16 +156,16 @@ func (i intValueCodec) EncodeJSON(value math.Int) ([]byte, error) { return value.MarshalJSON() } -func (i intValueCodec) DecodeJSON(b []byte) (Int, error) { - v := new(Int) +func (i intValueCodec) DecodeJSON(b []byte) (math.Int, error) { + v := new(math.Int) err := v.UnmarshalJSON(b) if err != nil { - return Int{}, err + return math.Int{}, err } return *v, nil } -func (i intValueCodec) Stringify(value Int) string { +func (i intValueCodec) Stringify(value math.Int) string { return value.String() } @@ -166,6 +173,42 @@ func (i intValueCodec) ValueType() string { return "math.Int" } +type legacyDecValueCodec struct{} + +func (i legacyDecValueCodec) Encode(value math.LegacyDec) ([]byte, error) { + return value.Marshal() +} + +func (i legacyDecValueCodec) Decode(b []byte) (math.LegacyDec, error) { + v := new(math.LegacyDec) + err := v.Unmarshal(b) + if err != nil { + return math.LegacyDec{}, err + } + return *v, nil +} + +func (i legacyDecValueCodec) EncodeJSON(value math.LegacyDec) ([]byte, error) { + return value.MarshalJSON() +} + +func (i legacyDecValueCodec) DecodeJSON(b []byte) (math.LegacyDec, error) { + v := new(math.LegacyDec) + err := v.UnmarshalJSON(b) + if err != nil { + return math.LegacyDec{}, err + } + return *v, nil +} + +func (i legacyDecValueCodec) Stringify(value math.LegacyDec) string { + return value.String() +} + +func (i legacyDecValueCodec) ValueType() string { + return LegacyDec +} + type timeKeyCodec struct{} func (timeKeyCodec) Encode(buffer []byte, key time.Time) (int, error) { diff --git a/types/collections_test.go b/types/collections_test.go index 222566c27eb0..e6a15608f6b7 100644 --- a/types/collections_test.go +++ b/types/collections_test.go @@ -21,7 +21,7 @@ func TestCollectionsCorrectness(t *testing.T) { }) t.Run("AddressIndexingKey", func(t *testing.T) { - colltest.TestKeyCodec(t, AddressKeyAsIndexKey(AccAddressKey), AccAddress{0x2, 0x5, 0x8}) + colltest.TestKeyCodec(t, LengthPrefixedAddressKey(AccAddressKey), AccAddress{0x2, 0x5, 0x8}) }) t.Run("Time", func(t *testing.T) { diff --git a/types/context.go b/types/context.go index 13f5a09c51fa..a6e304e8d148 100644 --- a/types/context.go +++ b/types/context.go @@ -4,16 +4,15 @@ import ( "context" "time" - "cosmossdk.io/log" abci "github.com/cometbft/cometbft/abci/types" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/gogoproto/proto" - "cosmossdk.io/store/gaskv" - storetypes "cosmossdk.io/store/types" - "cosmossdk.io/core/comet" "cosmossdk.io/core/header" + "cosmossdk.io/log" + "cosmossdk.io/store/gaskv" + storetypes "cosmossdk.io/store/types" ) // ExecMode defines the execution mode which can be set on a Context. @@ -27,6 +26,7 @@ const ( ExecModePrepareProposal ExecModeProcessProposal ExecModeVoteExtension + ExecModeVerifyVoteExtension ExecModeFinalize ) @@ -54,6 +54,7 @@ type Context struct { blockGasMeter storetypes.GasMeter checkTx bool recheckTx bool // if recheckTx == true, then checkTx must also be true + sigverifyTx bool // when run simulation, because the private key corresponding to the account in the genesis.json randomly generated, we must skip the sigverify. execMode ExecMode minGasPrice DecCoins consParams cmtproto.ConsensusParams @@ -82,6 +83,7 @@ func (c Context) GasMeter() storetypes.GasMeter { return c.gasMe func (c Context) BlockGasMeter() storetypes.GasMeter { return c.blockGasMeter } func (c Context) IsCheckTx() bool { return c.checkTx } func (c Context) IsReCheckTx() bool { return c.recheckTx } +func (c Context) IsSigverifyTx() bool { return c.sigverifyTx } func (c Context) ExecMode() ExecMode { return c.execMode } func (c Context) MinGasPrices() DecCoins { return c.minGasPrice } func (c Context) EventManager() EventManagerI { return c.eventManager } @@ -131,6 +133,7 @@ func NewContext(ms storetypes.MultiStore, header cmtproto.Header, isCheckTx bool header: header, chainID: header.ChainID, checkTx: isCheckTx, + sigverifyTx: true, logger: logger, gasMeter: storetypes.NewInfiniteGasMeter(), minGasPrice: DecCoins{}, @@ -260,6 +263,12 @@ func (c Context) WithIsReCheckTx(isRecheckTx bool) Context { return c } +// WithIsSigverifyTx called with true will sigverify in auth module +func (c Context) WithIsSigverifyTx(isSigverifyTx bool) Context { + c.sigverifyTx = isSigverifyTx + return c +} + // WithExecMode returns a Context with an updated ExecMode. func (c Context) WithExecMode(m ExecMode) Context { c.execMode = m diff --git a/types/context_test.go b/types/context_test.go index 926f28dba193..e57c7f0d09e5 100644 --- a/types/context_test.go +++ b/types/context_test.go @@ -8,8 +8,8 @@ import ( abci "github.com/cometbft/cometbft/abci/types" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" cmttime "github.com/cometbft/cometbft/types/time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" + "go.uber.org/mock/gomock" storetypes "cosmossdk.io/store/types" diff --git a/types/dec_coin.go b/types/dec_coin.go index 2e56d5f5fb72..14c40bd329b1 100644 --- a/types/dec_coin.go +++ b/types/dec_coin.go @@ -13,17 +13,17 @@ import ( // Decimal Coin // NewDecCoin creates a new DecCoin instance from an Int. -func NewDecCoin(denom string, amount Int) DecCoin { +func NewDecCoin(denom string, amount math.Int) DecCoin { coin := NewCoin(denom, amount) return DecCoin{ Denom: coin.Denom, - Amount: NewDecFromInt(coin.Amount), + Amount: math.LegacyNewDecFromInt(coin.Amount), } } // NewDecCoinFromDec creates a new DecCoin instance from a Dec. -func NewDecCoinFromDec(denom string, amount Dec) DecCoin { +func NewDecCoinFromDec(denom string, amount math.LegacyDec) DecCoin { mustValidateDenom(denom) if amount.IsNegative() { @@ -44,14 +44,14 @@ func NewDecCoinFromCoin(coin Coin) DecCoin { return DecCoin{ Denom: coin.Denom, - Amount: NewDecFromInt(coin.Amount), + Amount: math.LegacyNewDecFromInt(coin.Amount), } } // NewInt64DecCoin returns a new DecCoin with a denomination and amount. It will // panic if the amount is negative or denom is invalid. func NewInt64DecCoin(denom string, amount int64) DecCoin { - return NewDecCoin(denom, NewInt(amount)) + return NewDecCoin(denom, math.NewInt(amount)) } // IsZero returns if the DecCoin amount is zero. @@ -109,7 +109,7 @@ func (coin DecCoin) Sub(coinB DecCoin) DecCoin { // change. Note, the change may be zero. func (coin DecCoin) TruncateDecimal() (Coin, DecCoin) { truncated := coin.Amount.TruncateInt() - change := coin.Amount.Sub(NewDecFromInt(truncated)) + change := coin.Amount.Sub(math.LegacyNewDecFromInt(truncated)) return NewCoin(coin.Denom, truncated), NewDecCoinFromDec(coin.Denom, change) } @@ -359,7 +359,7 @@ func (coins DecCoins) IsAnyNegative() bool { // MulDec multiplies all the coins by a decimal. // // CONTRACT: No zero coins will be returned. -func (coins DecCoins) MulDec(d Dec) DecCoins { +func (coins DecCoins) MulDec(d math.LegacyDec) DecCoins { var res DecCoins for _, coin := range coins { product := DecCoin{ @@ -379,7 +379,7 @@ func (coins DecCoins) MulDec(d Dec) DecCoins { // returns nil DecCoins if d is zero. // // CONTRACT: No zero coins will be returned. -func (coins DecCoins) MulDecTruncate(d Dec) DecCoins { +func (coins DecCoins) MulDecTruncate(d math.LegacyDec) DecCoins { if d.IsZero() { return DecCoins{} } @@ -402,7 +402,7 @@ func (coins DecCoins) MulDecTruncate(d Dec) DecCoins { // QuoDec divides all the decimal coins by a decimal. It panics if d is zero. // // CONTRACT: No zero coins will be returned. -func (coins DecCoins) QuoDec(d Dec) DecCoins { +func (coins DecCoins) QuoDec(d math.LegacyDec) DecCoins { if d.IsZero() { panic("invalid zero decimal") } @@ -426,7 +426,7 @@ func (coins DecCoins) QuoDec(d Dec) DecCoins { // panics if d is zero. // // CONTRACT: No zero coins will be returned. -func (coins DecCoins) QuoDecTruncate(d Dec) DecCoins { +func (coins DecCoins) QuoDecTruncate(d math.LegacyDec) DecCoins { if d.IsZero() { panic("invalid zero decimal") } @@ -452,7 +452,7 @@ func (coins DecCoins) Empty() bool { } // AmountOf returns the amount of a denom from deccoins -func (coins DecCoins) AmountOf(denom string) Dec { +func (coins DecCoins) AmountOf(denom string) math.LegacyDec { mustValidateDenom(denom) switch len(coins) { @@ -491,7 +491,7 @@ func (coins DecCoins) Equal(coinsB DecCoins) bool { coinsB = coinsB.Sort() for i := 0; i < len(coins); i++ { - if !coins[i].IsEqual(coinsB[i]) { + if !coins[i].Equal(coinsB[i]) { return false } } @@ -609,7 +609,12 @@ func (coins DecCoins) Swap(i, j int) { coins[i], coins[j] = coins[j], coins[i] } // Sort is a helper function to sort the set of decimal coins in-place. func (coins DecCoins) Sort() DecCoins { - sort.Sort(coins) + // sort.Sort(coins) does a costly runtime copy as part of `runtime.convTSlice` + // So we avoid this heap allocation if len(coins) <= 1. In the future, we should hopefully find + // a strategy to always avoid this. + if len(coins) > 1 { + sort.Sort(coins) + } return coins } @@ -628,7 +633,7 @@ func ParseDecCoin(coinStr string) (coin DecCoin, err error) { amountStr, denomStr := matches[1], matches[2] - amount, err := NewDecFromStr(amountStr) + amount, err := math.LegacyNewDecFromStr(amountStr) if err != nil { return DecCoin{}, errors.Wrap(err, fmt.Sprintf("failed to parse decimal coin amount: %s", amountStr)) } diff --git a/types/dec_coin_test.go b/types/dec_coin_test.go index ddd78ed61c00..0d88621933c9 100644 --- a/types/dec_coin_test.go +++ b/types/dec_coin_test.go @@ -4,9 +4,10 @@ import ( "strings" "testing" - "cosmossdk.io/math" "github.com/stretchr/testify/suite" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -72,9 +73,9 @@ func (s *decCoinTestSuite) TestDecCoinIsPositive() { } func (s *decCoinTestSuite) TestAddDecCoin() { - decCoinA1 := sdk.NewDecCoinFromDec(testDenom1, sdk.NewDecWithPrec(11, 1)) - decCoinA2 := sdk.NewDecCoinFromDec(testDenom1, sdk.NewDecWithPrec(22, 1)) - decCoinB1 := sdk.NewDecCoinFromDec(testDenom2, sdk.NewDecWithPrec(11, 1)) + decCoinA1 := sdk.NewDecCoinFromDec(testDenom1, math.LegacyNewDecWithPrec(11, 1)) + decCoinA2 := sdk.NewDecCoinFromDec(testDenom1, math.LegacyNewDecWithPrec(22, 1)) + decCoinB1 := sdk.NewDecCoinFromDec(testDenom2, math.LegacyNewDecWithPrec(11, 1)) // regular add res := decCoinA1.Add(decCoinA1) @@ -375,36 +376,36 @@ func (s *decCoinTestSuite) TestParseDecCoins() { expectedErr bool }{ {"", nil, false}, - {"4stake", sdk.DecCoins{sdk.NewDecCoinFromDec("stake", sdk.NewDecFromInt(math.NewInt(4)))}, false}, + {"4stake", sdk.DecCoins{sdk.NewDecCoinFromDec("stake", math.LegacyNewDecFromInt(math.NewInt(4)))}, false}, {"5.5atom,4stake", sdk.DecCoins{ - sdk.NewDecCoinFromDec("atom", sdk.NewDecWithPrec(5500000000000000000, math.LegacyPrecision)), + sdk.NewDecCoinFromDec("atom", math.LegacyNewDecWithPrec(5500000000000000000, math.LegacyPrecision)), sdk.NewDecCoinFromDec("stake", math.LegacyNewDec(4)), }, false}, {"0.0stake", sdk.DecCoins{}, false}, // remove zero coins {"10.0btc,1.0atom,20.0btc", nil, true}, { "0.004STAKE", - sdk.DecCoins{sdk.NewDecCoinFromDec("STAKE", sdk.NewDecWithPrec(4000000000000000, math.LegacyPrecision))}, + sdk.DecCoins{sdk.NewDecCoinFromDec("STAKE", math.LegacyNewDecWithPrec(4000000000000000, math.LegacyPrecision))}, false, }, { "0.004stake", - sdk.DecCoins{sdk.NewDecCoinFromDec("stake", sdk.NewDecWithPrec(4000000000000000, math.LegacyPrecision))}, + sdk.DecCoins{sdk.NewDecCoinFromDec("stake", math.LegacyNewDecWithPrec(4000000000000000, math.LegacyPrecision))}, false, }, { "5.04atom,0.004stake", sdk.DecCoins{ - sdk.NewDecCoinFromDec("atom", sdk.NewDecWithPrec(5040000000000000000, math.LegacyPrecision)), - sdk.NewDecCoinFromDec("stake", sdk.NewDecWithPrec(4000000000000000, math.LegacyPrecision)), + sdk.NewDecCoinFromDec("atom", math.LegacyNewDecWithPrec(5040000000000000000, math.LegacyPrecision)), + sdk.NewDecCoinFromDec("stake", math.LegacyNewDecWithPrec(4000000000000000, math.LegacyPrecision)), }, false, }, { "0.0stake,0.004stake,5.04atom", // remove zero coins sdk.DecCoins{ - sdk.NewDecCoinFromDec("atom", sdk.NewDecWithPrec(5040000000000000000, math.LegacyPrecision)), - sdk.NewDecCoinFromDec("stake", sdk.NewDecWithPrec(4000000000000000, math.LegacyPrecision)), + sdk.NewDecCoinFromDec("atom", math.LegacyNewDecWithPrec(5040000000000000000, math.LegacyPrecision)), + sdk.NewDecCoinFromDec("stake", math.LegacyNewDecWithPrec(4000000000000000, math.LegacyPrecision)), }, false, }, @@ -429,8 +430,8 @@ func (s *decCoinTestSuite) TestDecCoinsString() { {sdk.DecCoins{}, ""}, { sdk.DecCoins{ - sdk.NewDecCoinFromDec("atom", sdk.NewDecWithPrec(5040000000000000000, math.LegacyPrecision)), - sdk.NewDecCoinFromDec("stake", sdk.NewDecWithPrec(4000000000000000, math.LegacyPrecision)), + sdk.NewDecCoinFromDec("atom", math.LegacyNewDecWithPrec(5040000000000000000, math.LegacyPrecision)), + sdk.NewDecCoinFromDec("stake", math.LegacyNewDecWithPrec(4000000000000000, math.LegacyPrecision)), }, "5.040000000000000000atom,0.004000000000000000stake", }, @@ -473,8 +474,8 @@ func (s *decCoinTestSuite) TestDecCoinsIntersect() { } func (s *decCoinTestSuite) TestDecCoinsTruncateDecimal() { - decCoinA := sdk.NewDecCoinFromDec("bar", sdk.MustNewDecFromStr("5.41")) - decCoinB := sdk.NewDecCoinFromDec("foo", sdk.MustNewDecFromStr("6.00")) + decCoinA := sdk.NewDecCoinFromDec("bar", math.LegacyMustNewDecFromStr("5.41")) + decCoinB := sdk.NewDecCoinFromDec("foo", math.LegacyMustNewDecFromStr("6.00")) testCases := []struct { input sdk.DecCoins @@ -485,7 +486,7 @@ func (s *decCoinTestSuite) TestDecCoinsTruncateDecimal() { { sdk.DecCoins{decCoinA, decCoinB}, sdk.Coins{sdk.NewInt64Coin(decCoinA.Denom, 5), sdk.NewInt64Coin(decCoinB.Denom, 6)}, - sdk.DecCoins{sdk.NewDecCoinFromDec(decCoinA.Denom, sdk.MustNewDecFromStr("0.41"))}, + sdk.DecCoins{sdk.NewDecCoinFromDec(decCoinA.Denom, math.LegacyMustNewDecFromStr("0.41"))}, }, { sdk.DecCoins{decCoinB}, @@ -508,8 +509,8 @@ func (s *decCoinTestSuite) TestDecCoinsTruncateDecimal() { } func (s *decCoinTestSuite) TestDecCoinsQuoDecTruncate() { - x := sdk.MustNewDecFromStr("1.00") - y := sdk.MustNewDecFromStr("10000000000000000000.00") + x := math.LegacyMustNewDecFromStr("1.00") + y := math.LegacyMustNewDecFromStr("10000000000000000000.00") testCases := []struct { coins sdk.DecCoins @@ -519,7 +520,7 @@ func (s *decCoinTestSuite) TestDecCoinsQuoDecTruncate() { }{ {sdk.DecCoins{}, math.LegacyZeroDec(), sdk.DecCoins(nil), true}, {sdk.DecCoins{sdk.NewDecCoinFromDec("foo", x)}, y, sdk.DecCoins(nil), false}, - {sdk.DecCoins{sdk.NewInt64DecCoin("foo", 5)}, math.LegacyNewDec(2), sdk.DecCoins{sdk.NewDecCoinFromDec("foo", sdk.MustNewDecFromStr("2.5"))}, false}, + {sdk.DecCoins{sdk.NewInt64DecCoin("foo", 5)}, math.LegacyNewDec(2), sdk.DecCoins{sdk.NewDecCoinFromDec("foo", math.LegacyMustNewDecFromStr("2.5"))}, false}, } for i, tc := range testCases { @@ -846,7 +847,7 @@ func (s *decCoinTestSuite) TestDecCoins_MulDec() { testCases := []struct { name string coins sdk.DecCoins - multiplier sdk.Dec + multiplier math.LegacyDec expectedResult sdk.DecCoins }{ {"No Coins", sdk.DecCoins{}, math.LegacyNewDec(1), sdk.DecCoins(nil)}, @@ -898,39 +899,39 @@ func (s *decCoinTestSuite) TestDecCoins_MulDecTruncate() { testCases := []struct { name string coins sdk.DecCoins - multiplier sdk.Dec + multiplier math.LegacyDec expectedResult sdk.DecCoins expectedPanic bool }{ {"No Coins", sdk.DecCoins{}, math.LegacyNewDec(1), sdk.DecCoins(nil), false}, {"Multiple coins - zero multiplier", sdk.DecCoins{ - sdk.DecCoin{testDenom1, sdk.NewDecWithPrec(10, 3)}, - sdk.DecCoin{testDenom1, sdk.NewDecWithPrec(30, 2)}, + sdk.DecCoin{testDenom1, math.LegacyNewDecWithPrec(10, 3)}, + sdk.DecCoin{testDenom1, math.LegacyNewDecWithPrec(30, 2)}, }, math.LegacyNewDec(0), sdk.DecCoins{}, false}, {"Multiple coins - positive multiplier", sdk.DecCoins{ - sdk.DecCoin{testDenom1, sdk.NewDecWithPrec(15, 1)}, - sdk.DecCoin{testDenom1, sdk.NewDecWithPrec(15, 1)}, + sdk.DecCoin{testDenom1, math.LegacyNewDecWithPrec(15, 1)}, + sdk.DecCoin{testDenom1, math.LegacyNewDecWithPrec(15, 1)}, }, math.LegacyNewDec(1), sdk.DecCoins{ - sdk.DecCoin{testDenom1, sdk.NewDecWithPrec(3, 0)}, + sdk.DecCoin{testDenom1, math.LegacyNewDecWithPrec(3, 0)}, }, false}, {"Multiple coins - positive multiplier", sdk.DecCoins{ - sdk.DecCoin{testDenom1, sdk.NewDecWithPrec(15, 1)}, - sdk.DecCoin{testDenom1, sdk.NewDecWithPrec(15, 1)}, + sdk.DecCoin{testDenom1, math.LegacyNewDecWithPrec(15, 1)}, + sdk.DecCoin{testDenom1, math.LegacyNewDecWithPrec(15, 1)}, }, math.LegacyNewDec(-2), sdk.DecCoins{ - sdk.DecCoin{testDenom1, sdk.NewDecWithPrec(-6, 0)}, + sdk.DecCoin{testDenom1, math.LegacyNewDecWithPrec(-6, 0)}, }, false}, {"Multiple coins - Different denom", sdk.DecCoins{ - sdk.DecCoin{testDenom1, sdk.NewDecWithPrec(15, 1)}, - sdk.DecCoin{testDenom2, sdk.NewDecWithPrec(3333, 4)}, - sdk.DecCoin{testDenom1, sdk.NewDecWithPrec(15, 1)}, - sdk.DecCoin{testDenom2, sdk.NewDecWithPrec(333, 4)}, + sdk.DecCoin{testDenom1, math.LegacyNewDecWithPrec(15, 1)}, + sdk.DecCoin{testDenom2, math.LegacyNewDecWithPrec(3333, 4)}, + sdk.DecCoin{testDenom1, math.LegacyNewDecWithPrec(15, 1)}, + sdk.DecCoin{testDenom2, math.LegacyNewDecWithPrec(333, 4)}, }, math.LegacyNewDec(10), sdk.DecCoins{ - sdk.DecCoin{testDenom1, sdk.NewDecWithPrec(30, 0)}, - sdk.DecCoin{testDenom2, sdk.NewDecWithPrec(3666, 3)}, + sdk.DecCoin{testDenom1, math.LegacyNewDecWithPrec(30, 0)}, + sdk.DecCoin{testDenom2, math.LegacyNewDecWithPrec(3666, 3)}, }, false}, } @@ -951,7 +952,7 @@ func (s *decCoinTestSuite) TestDecCoins_QuoDec() { testCases := []struct { name string coins sdk.DecCoins - input sdk.Dec + input math.LegacyDec expectedResult sdk.DecCoins panics bool }{ @@ -966,14 +967,14 @@ func (s *decCoinTestSuite) TestDecCoins_QuoDec() { sdk.DecCoin{testDenom1, math.LegacyNewDec(3)}, sdk.DecCoin{testDenom1, math.LegacyNewDec(4)}, }, math.LegacyNewDec(2), sdk.DecCoins{ - sdk.DecCoin{testDenom1, sdk.NewDecWithPrec(35, 1)}, + sdk.DecCoin{testDenom1, math.LegacyNewDecWithPrec(35, 1)}, }, false}, {"Multiple coins - negative input", sdk.DecCoins{ sdk.DecCoin{testDenom1, math.LegacyNewDec(3)}, sdk.DecCoin{testDenom1, math.LegacyNewDec(4)}, }, math.LegacyNewDec(-2), sdk.DecCoins{ - sdk.DecCoin{testDenom1, sdk.NewDecWithPrec(-35, 1)}, + sdk.DecCoin{testDenom1, math.LegacyNewDecWithPrec(-35, 1)}, }, false}, {"Multiple coins - Different input", sdk.DecCoins{ @@ -1143,11 +1144,11 @@ func (s *decCoinTestSuite) TestDecCoin_ParseDecCoin() { {"Precision over limit", "9.11111111111111111111stake", empty, true}, - {"Valid upper case denom", "9.3STAKE", sdk.DecCoin{"STAKE", sdk.NewDecWithPrec(93, 1)}, false}, + {"Valid upper case denom", "9.3STAKE", sdk.DecCoin{"STAKE", math.LegacyNewDecWithPrec(93, 1)}, false}, - {"Valid input - amount and denom separated by space", "9.3 stake", sdk.DecCoin{"stake", sdk.NewDecWithPrec(93, 1)}, false}, + {"Valid input - amount and denom separated by space", "9.3 stake", sdk.DecCoin{"stake", math.LegacyNewDecWithPrec(93, 1)}, false}, - {"Valid input - amount and denom concatenated", "9.3stake", sdk.DecCoin{"stake", sdk.NewDecWithPrec(93, 1)}, false}, + {"Valid input - amount and denom concatenated", "9.3stake", sdk.DecCoin{"stake", math.LegacyNewDecWithPrec(93, 1)}, false}, } for i, tc := range testCases { diff --git a/types/denom.go b/types/denom.go index c87a150f5988..5cd0910ad44f 100644 --- a/types/denom.go +++ b/types/denom.go @@ -8,14 +8,14 @@ import ( // denomUnits contains a mapping of denomination mapped to their respective unit // multipliers (e.g. 1atom = 10^-6uatom). -var denomUnits = map[string]Dec{} +var denomUnits = map[string]math.LegacyDec{} // baseDenom is the denom of smallest unit registered var baseDenom string // RegisterDenom registers a denomination with a corresponding unit. If the // denomination is already registered, an error will be returned. -func RegisterDenom(denom string, unit Dec) error { +func RegisterDenom(denom string, unit math.LegacyDec) error { if err := ValidateDenom(denom); err != nil { return err } @@ -34,7 +34,7 @@ func RegisterDenom(denom string, unit Dec) error { // GetDenomUnit returns a unit for a given denomination if it exists. A boolean // is returned if the denomination is registered. -func GetDenomUnit(denom string) (Dec, bool) { +func GetDenomUnit(denom string) (math.LegacyDec, bool) { if err := ValidateDenom(denom); err != nil { return math.LegacyZeroDec(), false } @@ -88,7 +88,7 @@ func ConvertCoin(coin Coin, denom string) (Coin, error) { return NewCoin(denom, coin.Amount), nil } - return NewCoin(denom, NewDecFromInt(coin.Amount).Mul(srcUnit).Quo(dstUnit).TruncateInt()), nil + return NewCoin(denom, math.LegacyNewDecFromInt(coin.Amount).Mul(srcUnit).Quo(dstUnit).TruncateInt()), nil } // ConvertDecCoin attempts to convert a decimal coin to a given denomination. If the given diff --git a/types/denom_internal_test.go b/types/denom_internal_test.go index bb76d80fb9a2..a22c3a211540 100644 --- a/types/denom_internal_test.go +++ b/types/denom_internal_test.go @@ -3,8 +3,9 @@ package types import ( "testing" - "cosmossdk.io/math" "github.com/stretchr/testify/suite" + + "cosmossdk.io/math" ) var ( @@ -45,35 +46,35 @@ func (s *internalDenomTestSuite) TestRegisterDenom() { // reset registration baseDenom = "" - denomUnits = map[string]Dec{} + denomUnits = map[string]math.LegacyDec{} } func (s *internalDenomTestSuite) TestConvertCoins() { atomUnit := math.LegacyOneDec() // 1 (base denom unit) s.Require().NoError(RegisterDenom(atom, atomUnit)) - matomUnit := NewDecWithPrec(1, 3) // 10^-3 (milli) + matomUnit := math.LegacyNewDecWithPrec(1, 3) // 10^-3 (milli) s.Require().NoError(RegisterDenom(matom, matomUnit)) - uatomUnit := NewDecWithPrec(1, 6) // 10^-6 (micro) + uatomUnit := math.LegacyNewDecWithPrec(1, 6) // 10^-6 (micro) s.Require().NoError(RegisterDenom(uatom, uatomUnit)) - natomUnit := NewDecWithPrec(1, 9) // 10^-9 (nano) + natomUnit := math.LegacyNewDecWithPrec(1, 9) // 10^-9 (nano) s.Require().NoError(RegisterDenom(natom, natomUnit)) res, err := GetBaseDenom() s.Require().NoError(err) s.Require().Equal(res, natom) - s.Require().Equal(NormalizeCoin(NewCoin(uatom, NewInt(1))), NewCoin(natom, NewInt(1000))) - s.Require().Equal(NormalizeCoin(NewCoin(matom, NewInt(1))), NewCoin(natom, NewInt(1000000))) - s.Require().Equal(NormalizeCoin(NewCoin(atom, NewInt(1))), NewCoin(natom, NewInt(1000000000))) + s.Require().Equal(NormalizeCoin(NewCoin(uatom, math.NewInt(1))), NewCoin(natom, math.NewInt(1000))) + s.Require().Equal(NormalizeCoin(NewCoin(matom, math.NewInt(1))), NewCoin(natom, math.NewInt(1000000))) + s.Require().Equal(NormalizeCoin(NewCoin(atom, math.NewInt(1))), NewCoin(natom, math.NewInt(1000000000))) coins, err := ParseCoinsNormalized("1atom,1matom,1uatom") s.Require().NoError(err) s.Require().Equal(coins, Coins{ - Coin{natom, NewInt(1000000000)}, - Coin{natom, NewInt(1000000)}, - Coin{natom, NewInt(1000)}, + Coin{natom, math.NewInt(1000000000)}, + Coin{natom, math.NewInt(1000000)}, + Coin{natom, math.NewInt(1000)}, }) testCases := []struct { @@ -82,20 +83,20 @@ func (s *internalDenomTestSuite) TestConvertCoins() { result Coin expErr bool }{ - {NewCoin("foo", ZeroInt()), atom, Coin{}, true}, - {NewCoin(atom, ZeroInt()), "foo", Coin{}, true}, - {NewCoin(atom, ZeroInt()), "FOO", Coin{}, true}, + {NewCoin("foo", math.ZeroInt()), atom, Coin{}, true}, + {NewCoin(atom, math.ZeroInt()), "foo", Coin{}, true}, + {NewCoin(atom, math.ZeroInt()), "FOO", Coin{}, true}, - {NewCoin(atom, NewInt(5)), matom, NewCoin(matom, NewInt(5000)), false}, // atom => matom - {NewCoin(atom, NewInt(5)), uatom, NewCoin(uatom, NewInt(5000000)), false}, // atom => uatom - {NewCoin(atom, NewInt(5)), natom, NewCoin(natom, NewInt(5000000000)), false}, // atom => natom + {NewCoin(atom, math.NewInt(5)), matom, NewCoin(matom, math.NewInt(5000)), false}, // atom => matom + {NewCoin(atom, math.NewInt(5)), uatom, NewCoin(uatom, math.NewInt(5000000)), false}, // atom => uatom + {NewCoin(atom, math.NewInt(5)), natom, NewCoin(natom, math.NewInt(5000000000)), false}, // atom => natom - {NewCoin(uatom, NewInt(5000000)), matom, NewCoin(matom, NewInt(5000)), false}, // uatom => matom - {NewCoin(uatom, NewInt(5000000)), natom, NewCoin(natom, NewInt(5000000000)), false}, // uatom => natom - {NewCoin(uatom, NewInt(5000000)), atom, NewCoin(atom, NewInt(5)), false}, // uatom => atom + {NewCoin(uatom, math.NewInt(5000000)), matom, NewCoin(matom, math.NewInt(5000)), false}, // uatom => matom + {NewCoin(uatom, math.NewInt(5000000)), natom, NewCoin(natom, math.NewInt(5000000000)), false}, // uatom => natom + {NewCoin(uatom, math.NewInt(5000000)), atom, NewCoin(atom, math.NewInt(5)), false}, // uatom => atom - {NewCoin(matom, NewInt(5000)), natom, NewCoin(natom, NewInt(5000000000)), false}, // matom => natom - {NewCoin(matom, NewInt(5000)), uatom, NewCoin(uatom, NewInt(5000000)), false}, // matom => uatom + {NewCoin(matom, math.NewInt(5000)), natom, NewCoin(natom, math.NewInt(5000000000)), false}, // matom => natom + {NewCoin(matom, math.NewInt(5000)), uatom, NewCoin(uatom, math.NewInt(5000000)), false}, // matom => uatom } for i, tc := range testCases { @@ -112,35 +113,35 @@ func (s *internalDenomTestSuite) TestConvertCoins() { // reset registration baseDenom = "" - denomUnits = map[string]Dec{} + denomUnits = map[string]math.LegacyDec{} } func (s *internalDenomTestSuite) TestConvertDecCoins() { atomUnit := math.LegacyOneDec() // 1 (base denom unit) s.Require().NoError(RegisterDenom(atom, atomUnit)) - matomUnit := NewDecWithPrec(1, 3) // 10^-3 (milli) + matomUnit := math.LegacyNewDecWithPrec(1, 3) // 10^-3 (milli) s.Require().NoError(RegisterDenom(matom, matomUnit)) - uatomUnit := NewDecWithPrec(1, 6) // 10^-6 (micro) + uatomUnit := math.LegacyNewDecWithPrec(1, 6) // 10^-6 (micro) s.Require().NoError(RegisterDenom(uatom, uatomUnit)) - natomUnit := NewDecWithPrec(1, 9) // 10^-9 (nano) + natomUnit := math.LegacyNewDecWithPrec(1, 9) // 10^-9 (nano) s.Require().NoError(RegisterDenom(natom, natomUnit)) res, err := GetBaseDenom() s.Require().NoError(err) s.Require().Equal(res, natom) - s.Require().Equal(NormalizeDecCoin(NewDecCoin(uatom, NewInt(1))), NewDecCoin(natom, NewInt(1000))) - s.Require().Equal(NormalizeDecCoin(NewDecCoin(matom, NewInt(1))), NewDecCoin(natom, NewInt(1000000))) - s.Require().Equal(NormalizeDecCoin(NewDecCoin(atom, NewInt(1))), NewDecCoin(natom, NewInt(1000000000))) + s.Require().Equal(NormalizeDecCoin(NewDecCoin(uatom, math.NewInt(1))), NewDecCoin(natom, math.NewInt(1000))) + s.Require().Equal(NormalizeDecCoin(NewDecCoin(matom, math.NewInt(1))), NewDecCoin(natom, math.NewInt(1000000))) + s.Require().Equal(NormalizeDecCoin(NewDecCoin(atom, math.NewInt(1))), NewDecCoin(natom, math.NewInt(1000000000))) coins, err := ParseCoinsNormalized("0.1atom,0.1matom,0.1uatom") s.Require().NoError(err) s.Require().Equal(coins, Coins{ - Coin{natom, NewInt(100000000)}, - Coin{natom, NewInt(100000)}, - Coin{natom, NewInt(100)}, + Coin{natom, math.NewInt(100000000)}, + Coin{natom, math.NewInt(100000)}, + Coin{natom, math.NewInt(100)}, }) testCases := []struct { @@ -149,21 +150,21 @@ func (s *internalDenomTestSuite) TestConvertDecCoins() { result DecCoin expErr bool }{ - {NewDecCoin("foo", ZeroInt()), atom, DecCoin{}, true}, - {NewDecCoin(atom, ZeroInt()), "foo", DecCoin{}, true}, - {NewDecCoin(atom, ZeroInt()), "FOO", DecCoin{}, true}, + {NewDecCoin("foo", math.ZeroInt()), atom, DecCoin{}, true}, + {NewDecCoin(atom, math.ZeroInt()), "foo", DecCoin{}, true}, + {NewDecCoin(atom, math.ZeroInt()), "FOO", DecCoin{}, true}, // 0.5atom - {NewDecCoinFromDec(atom, NewDecWithPrec(5, 1)), matom, NewDecCoin(matom, NewInt(500)), false}, // atom => matom - {NewDecCoinFromDec(atom, NewDecWithPrec(5, 1)), uatom, NewDecCoin(uatom, NewInt(500000)), false}, // atom => uatom - {NewDecCoinFromDec(atom, NewDecWithPrec(5, 1)), natom, NewDecCoin(natom, NewInt(500000000)), false}, // atom => natom + {NewDecCoinFromDec(atom, math.LegacyNewDecWithPrec(5, 1)), matom, NewDecCoin(matom, math.NewInt(500)), false}, // atom => matom + {NewDecCoinFromDec(atom, math.LegacyNewDecWithPrec(5, 1)), uatom, NewDecCoin(uatom, math.NewInt(500000)), false}, // atom => uatom + {NewDecCoinFromDec(atom, math.LegacyNewDecWithPrec(5, 1)), natom, NewDecCoin(natom, math.NewInt(500000000)), false}, // atom => natom - {NewDecCoin(uatom, NewInt(5000000)), matom, NewDecCoin(matom, NewInt(5000)), false}, // uatom => matom - {NewDecCoin(uatom, NewInt(5000000)), natom, NewDecCoin(natom, NewInt(5000000000)), false}, // uatom => natom - {NewDecCoin(uatom, NewInt(5000000)), atom, NewDecCoin(atom, NewInt(5)), false}, // uatom => atom + {NewDecCoin(uatom, math.NewInt(5000000)), matom, NewDecCoin(matom, math.NewInt(5000)), false}, // uatom => matom + {NewDecCoin(uatom, math.NewInt(5000000)), natom, NewDecCoin(natom, math.NewInt(5000000000)), false}, // uatom => natom + {NewDecCoin(uatom, math.NewInt(5000000)), atom, NewDecCoin(atom, math.NewInt(5)), false}, // uatom => atom - {NewDecCoin(matom, NewInt(5000)), natom, NewDecCoin(natom, NewInt(5000000000)), false}, // matom => natom - {NewDecCoin(matom, NewInt(5000)), uatom, NewDecCoin(uatom, NewInt(5000000)), false}, // matom => uatom + {NewDecCoin(matom, math.NewInt(5000)), natom, NewDecCoin(natom, math.NewInt(5000000000)), false}, // matom => natom + {NewDecCoin(matom, math.NewInt(5000)), uatom, NewDecCoin(uatom, math.NewInt(5000000)), false}, // matom => uatom } for i, tc := range testCases { @@ -180,24 +181,24 @@ func (s *internalDenomTestSuite) TestConvertDecCoins() { // reset registration baseDenom = "" - denomUnits = map[string]Dec{} + denomUnits = map[string]math.LegacyDec{} } func (s *internalDenomTestSuite) TestDecOperationOrder() { - dec, err := NewDecFromStr("11") + dec, err := math.LegacyNewDecFromStr("11") s.Require().NoError(err) s.Require().NoError(RegisterDenom("unit1", dec)) - dec, err = NewDecFromStr("100000011") + dec, err = math.LegacyNewDecFromStr("100000011") s.Require().NoError(err) s.Require().NoError(RegisterDenom("unit2", dec)) - coin, err := ConvertCoin(NewCoin("unit1", NewInt(100000011)), "unit2") + coin, err := ConvertCoin(NewCoin("unit1", math.NewInt(100000011)), "unit2") s.Require().NoError(err) - s.Require().Equal(coin, NewCoin("unit2", NewInt(11))) + s.Require().Equal(coin, NewCoin("unit2", math.NewInt(11))) // reset registration baseDenom = "" - denomUnits = map[string]Dec{} + denomUnits = map[string]math.LegacyDec{} } func (s *internalDenomTestSuite) TestSetBaseDenomError() { @@ -206,5 +207,5 @@ func (s *internalDenomTestSuite) TestSetBaseDenomError() { // reset registration baseDenom = "" - denomUnits = map[string]Dec{} + denomUnits = map[string]math.LegacyDec{} } diff --git a/types/errors/abci.go b/types/errors/abci.go index 819b9f3a7069..47accd62d847 100644 --- a/types/errors/abci.go +++ b/types/errors/abci.go @@ -1,8 +1,9 @@ package errors import ( - errorsmod "cosmossdk.io/errors" abci "github.com/cometbft/cometbft/abci/types" + + errorsmod "cosmossdk.io/errors" ) // ResponseCheckTxWithEvents returns an ABCI ResponseCheckTx object with fields filled in diff --git a/types/errors/errors.go b/types/errors/errors.go index 5e17f2df481a..36bb82ffd957 100644 --- a/types/errors/errors.go +++ b/types/errors/errors.go @@ -142,4 +142,8 @@ var ( // ErrPanic should only be set when we recovering from a panic ErrPanic = errorsmod.ErrPanic + + // ErrTxTimeout defines an error for when a tx is rejected out due to an + // explicitly set timeout timestamp. + ErrTxTimeout = errorsmod.Register(RootCodespace, 42, "tx timeout") ) diff --git a/types/events.go b/types/events.go index 0ac28b046186..a6e22df739de 100644 --- a/types/events.go +++ b/types/events.go @@ -3,12 +3,11 @@ package types import ( "encoding/json" "fmt" + "maps" "reflect" + "slices" "strings" - "golang.org/x/exp/maps" - "golang.org/x/exp/slices" - abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/gogoproto/jsonpb" proto "github.com/cosmos/gogoproto/proto" @@ -101,8 +100,7 @@ func TypedEventToEvent(tev proto.Message) (Event, error) { } // sort the keys to ensure the order is always the same - keys := maps.Keys(attrMap) - slices.Sort(keys) + keys := slices.Sorted(maps.Keys(attrMap)) attrs := make([]abci.EventAttribute, 0, len(attrMap)) for _, k := range keys { diff --git a/types/events_test.go b/types/events_test.go index 0650af9b1b3a..a5280f0a1730 100644 --- a/types/events_test.go +++ b/types/events_test.go @@ -8,6 +8,8 @@ import ( abci "github.com/cometbft/cometbft/abci/types" "github.com/stretchr/testify/suite" + "cosmossdk.io/math" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" testdata "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" @@ -90,7 +92,7 @@ func (s *eventsTestSuite) TestEmitTypedEvent() { s.Run("deterministic key-value order", func() { for i := 0; i < 10; i++ { em := sdk.NewEventManager() - coin := sdk.NewCoin("fakedenom", sdk.NewInt(1999999)) + coin := sdk.NewCoin("fakedenom", math.NewInt(1999999)) s.Require().NoError(em.EmitTypedEvent(&coin)) s.Require().Len(em.Events(), 1) attrs := em.Events()[0].Attributes @@ -104,7 +106,7 @@ func (s *eventsTestSuite) TestEmitTypedEvent() { func (s *eventsTestSuite) TestEventManagerTypedEvents() { em := sdk.NewEventManager() - coin := sdk.NewCoin("fakedenom", sdk.NewInt(1999999)) + coin := sdk.NewCoin("fakedenom", math.NewInt(1999999)) cat := testdata.Cat{ Moniker: "Garfield", Lives: 6, diff --git a/types/handler.go b/types/handler.go index 7b57dd52f599..456c3904e43c 100644 --- a/types/handler.go +++ b/types/handler.go @@ -1,8 +1,5 @@ package types -// Handler defines the core of the state transition function of an application. -type Handler func(ctx Context, msg Msg) (*Result, error) - // AnteHandler authenticates transactions, before their internal messages are handled. // If newCtx.IsZero(), ctx is used instead. type AnteHandler func(ctx Context, tx Tx, simulate bool) (newCtx Context, err error) @@ -100,6 +97,8 @@ func ChainPostDecorators(chain ...PostDecorator) PostHandler { // \ '\ / \ | | _/ / // \ \ \ | | / / // snd \ \ \ / +// +// Deprecated: Terminator is retired (ref https://github.com/cosmos/cosmos-sdk/pull/16076). type Terminator struct{} // AnteHandle returns the provided Context and nil error diff --git a/types/handler_test.go b/types/handler_test.go index 3d20d3023d2d..86022530d584 100644 --- a/types/handler_test.go +++ b/types/handler_test.go @@ -3,8 +3,8 @@ package types_test import ( "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "github.com/cosmos/cosmos-sdk/testutil/mock" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/types/mapcoins.go b/types/mapcoins.go index 46e9adcd1383..cbebf9691af2 100644 --- a/types/mapcoins.go +++ b/types/mapcoins.go @@ -1,9 +1,11 @@ package types +import "cosmossdk.io/math" + // map coins is a map representation of sdk.Coins // intended solely for use in bulk additions. // All serialization and iteration should be done after conversion to sdk.Coins. -type MapCoins map[string]Int +type MapCoins map[string]math.Int func NewMapCoins(coins Coins) MapCoins { m := make(MapCoins, len(coins)) diff --git a/types/mapcoins_test.go b/types/mapcoins_test.go index 68fd74994c72..d58808910378 100644 --- a/types/mapcoins_test.go +++ b/types/mapcoins_test.go @@ -1,8 +1,9 @@ package types_test import ( - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func (s *coinTestSuite) TestMapCoinsAdd() { diff --git a/types/math.go b/types/math.go index 430039f27cb6..b8c4d275c024 100644 --- a/types/math.go +++ b/types/math.go @@ -1,41 +1,9 @@ package types -import ( - sdkmath "cosmossdk.io/math" -) - -// Type aliases to the SDK's math sub-module -// -// Deprecated: Functionality of this package has been moved to it's own module: -// cosmossdk.io/math -// -// Please use the above module instead of this package. -type ( - Int = sdkmath.Int -) - -var ( - NewInt = sdkmath.NewInt - ZeroInt = sdkmath.ZeroInt -) - func (ip IntProto) String() string { return ip.Int.String() } -type ( - Dec = sdkmath.LegacyDec -) - -var ( - NewDecWithPrec = sdkmath.LegacyNewDecWithPrec - NewDecFromInt = sdkmath.LegacyNewDecFromInt - NewDecFromStr = sdkmath.LegacyNewDecFromStr - MustNewDecFromStr = sdkmath.LegacyMustNewDecFromStr -) - -var _ CustomProtobufType = (*Dec)(nil) - func (dp DecProto) String() string { return dp.Dec.String() } diff --git a/types/mempool/mempool.go b/types/mempool/mempool.go index 37f94d8f4d9f..968f2d947666 100644 --- a/types/mempool/mempool.go +++ b/types/mempool/mempool.go @@ -13,8 +13,7 @@ type Mempool interface { Insert(context.Context, sdk.Tx) error // Select returns an Iterator over the app-side mempool. If txs are specified, - // then they shall be incorporated into the Iterator. The Iterator must - // closed by the caller. + // then they shall be incorporated into the Iterator. The Iterator is not thread-safe to use. Select(context.Context, [][]byte) Iterator // CountTx returns the number of transactions currently in the mempool. @@ -25,6 +24,16 @@ type Mempool interface { Remove(sdk.Tx) error } +// ExtMempool is a extension of Mempool interface introduced in v0.50 +// for not be breaking in a patch release. +// In v0.52+, this interface will be merged into Mempool interface. +type ExtMempool interface { + Mempool + + // SelectBy use callback to iterate over the mempool, it's thread-safe to use. + SelectBy(context.Context, [][]byte, func(sdk.Tx) bool) +} + // Iterator defines an app-side mempool iterator interface that is as minimal as // possible. The order of iteration is determined by the app-side mempool // implementation. @@ -41,3 +50,18 @@ var ( ErrTxNotFound = errors.New("tx not found in mempool") ErrMempoolTxMaxCapacity = errors.New("pool reached max tx capacity") ) + +// SelectBy is compatible with old interface to avoid breaking api. +// In v0.52+, this function is removed and SelectBy is merged into Mempool interface. +func SelectBy(ctx context.Context, mempool Mempool, txs [][]byte, callback func(sdk.Tx) bool) { + if ext, ok := mempool.(ExtMempool); ok { + ext.SelectBy(ctx, txs, callback) + return + } + + // fallback to old behavior, without holding the lock while iteration. + iter := mempool.Select(ctx, txs) + for iter != nil && callback(iter.Tx()) { + iter = iter.Next() + } +} diff --git a/types/mempool/mempool_test.go b/types/mempool/mempool_test.go index 9ed3b4d596a9..e27ba8dcac0b 100644 --- a/types/mempool/mempool_test.go +++ b/types/mempool/mempool_test.go @@ -4,6 +4,7 @@ import ( "fmt" "math/rand" "testing" + "time" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" @@ -52,6 +53,21 @@ type testTx struct { address sdk.AccAddress // useful for debugging strAddress string + unordered bool + timeout *time.Time +} + +// GetTimeoutTimeStamp implements types.TxWithUnordered. +func (tx testTx) GetTimeoutTimeStamp() time.Time { + if tx.timeout == nil { + return time.Time{} + } + return *tx.timeout +} + +// GetUnordered implements types.TxWithUnordered. +func (tx testTx) GetUnordered() bool { + return tx.unordered } func (tx testTx) GetSigners() ([][]byte, error) { panic("not implemented") } @@ -210,7 +226,7 @@ type MempoolTestSuite struct { func (s *MempoolTestSuite) resetMempool() { s.iterations = 0 - s.mempool = mempool.NewSenderNonceMempool() + s.mempool = mempool.NewSenderNonceMempool(mempool.SenderNonceMaxTxOpt(5000)) } func (s *MempoolTestSuite) SetupTest() { diff --git a/types/mempool/noop.go b/types/mempool/noop.go index 73c12639d1d6..0a8fdec6f566 100644 --- a/types/mempool/noop.go +++ b/types/mempool/noop.go @@ -6,7 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -var _ Mempool = (*NoOpMempool)(nil) +var _ ExtMempool = (*NoOpMempool)(nil) // NoOpMempool defines a no-op mempool. Transactions are completely discarded and // ignored when BaseApp interacts with the mempool. @@ -16,7 +16,8 @@ var _ Mempool = (*NoOpMempool)(nil) // is FIFO-ordered by default. type NoOpMempool struct{} -func (NoOpMempool) Insert(context.Context, sdk.Tx) error { return nil } -func (NoOpMempool) Select(context.Context, [][]byte) Iterator { return nil } -func (NoOpMempool) CountTx() int { return 0 } -func (NoOpMempool) Remove(sdk.Tx) error { return nil } +func (NoOpMempool) Insert(context.Context, sdk.Tx) error { return nil } +func (NoOpMempool) Select(context.Context, [][]byte) Iterator { return nil } +func (NoOpMempool) SelectBy(context.Context, [][]byte, func(sdk.Tx) bool) {} +func (NoOpMempool) CountTx() int { return 0 } +func (NoOpMempool) Remove(sdk.Tx) error { return nil } diff --git a/types/mempool/priority_nonce.go b/types/mempool/priority_nonce.go index 401526b7b254..4d0735cfd8dc 100644 --- a/types/mempool/priority_nonce.go +++ b/types/mempool/priority_nonce.go @@ -2,18 +2,19 @@ package mempool import ( "context" + "errors" "fmt" "math" + "sync" "github.com/huandu/skiplist" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/signing" ) var ( - _ Mempool = (*PriorityNonceMempool[int64])(nil) - _ Iterator = (*PriorityNonceIterator[int64])(nil) + _ ExtMempool = (*PriorityNonceMempool[int64])(nil) + _ Iterator = (*PriorityNonceIterator[int64])(nil) ) type ( @@ -39,6 +40,9 @@ type ( // (sequence number) when evicting transactions. // - if MaxTx < 0, `Insert` is a no-op. MaxTx int + + // SignerExtractor is an implementation which retrieves signer data from a sdk.Tx + SignerExtractor SignerExtractionAdapter } // PriorityNonceMempool is a mempool implementation that stores txs @@ -49,6 +53,7 @@ type ( // priority to other sender txs and must be partially ordered by both sender-nonce // and priority. PriorityNonceMempool[C comparable] struct { + mtx sync.Mutex priorityIndex *skiplist.SkipList priorityCounts map[C]int senderIndices map[string]*skiplist.SkipList @@ -114,7 +119,8 @@ func NewDefaultTxPriority() TxPriority[int64] { func DefaultPriorityNonceMempoolConfig() PriorityNonceMempoolConfig[int64] { return PriorityNonceMempoolConfig[int64]{ - TxPriority: NewDefaultTxPriority(), + TxPriority: NewDefaultTxPriority(), + SignerExtractor: NewDefaultSignerExtractionAdapter(), } } @@ -155,6 +161,9 @@ func skiplistComparable[C comparable](txPriority TxPriority[C]) skiplist.Compara // NewPriorityMempool returns the SDK's default mempool implementation which // returns txs in a partial order by 2 dimensions; priority, and sender-nonce. func NewPriorityMempool[C comparable](cfg PriorityNonceMempoolConfig[C]) *PriorityNonceMempool[C] { + if cfg.SignerExtractor == nil { + cfg.SignerExtractor = NewDefaultSignerExtractionAdapter() + } mp := &PriorityNonceMempool[C]{ priorityIndex: skiplist.New(skiplistComparable(cfg.TxPriority)), priorityCounts: make(map[C]int), @@ -194,13 +203,15 @@ func (mp *PriorityNonceMempool[C]) NextSenderTx(sender string) sdk.Tx { // Inserting a duplicate tx with a different priority overwrites the existing tx, // changing the total order of the mempool. func (mp *PriorityNonceMempool[C]) Insert(ctx context.Context, tx sdk.Tx) error { - if mp.cfg.MaxTx > 0 && mp.CountTx() >= mp.cfg.MaxTx { + mp.mtx.Lock() + defer mp.mtx.Unlock() + if mp.cfg.MaxTx > 0 && mp.priorityIndex.Len() >= mp.cfg.MaxTx { return ErrMempoolTxMaxCapacity } else if mp.cfg.MaxTx < 0 { return nil } - sigs, err := tx.(signing.SigVerifiableTx).GetSignaturesV2() + sigs, err := mp.cfg.SignerExtractor.GetSigners(tx) if err != nil { return err } @@ -209,9 +220,19 @@ func (mp *PriorityNonceMempool[C]) Insert(ctx context.Context, tx sdk.Tx) error } sig := sigs[0] - sender := sdk.AccAddress(sig.PubKey.Address()).String() + sender := sig.Signer.String() priority := mp.cfg.TxPriority.GetTxPriority(ctx, tx) nonce := sig.Sequence + + // if it's an unordered tx, we use the timeout timestamp instead of the nonce + if unordered, ok := tx.(sdk.TxWithUnordered); ok && unordered.GetUnordered() { + timestamp := unordered.GetTimeoutTimeStamp().Unix() + if timestamp < 0 { + return errors.New("invalid timestamp value") + } + nonce = uint64(timestamp) + } + key := txMeta[C]{nonce: nonce, priority: priority, sender: sender} senderIndex, ok := mp.senderIndices[sender] @@ -314,7 +335,7 @@ func (i *PriorityNonceIterator[C]) Next() Iterator { // priority in the pool. if i.mempool.cfg.TxPriority.Compare(key.priority, i.nextPriority) < 0 { return i.iteratePriority() - } else if i.mempool.cfg.TxPriority.Compare(key.priority, i.nextPriority) == 0 { + } else if i.priorityNode.Next() != nil && i.mempool.cfg.TxPriority.Compare(key.priority, i.nextPriority) == 0 { // Weight is incorporated into the priority index key only (not sender index) // so we must fetch it here from the scores map. weight := i.mempool.scores[txMeta[C]{nonce: key.nonce, sender: key.sender}].weight @@ -340,7 +361,13 @@ func (i *PriorityNonceIterator[C]) Tx() sdk.Tx { // // NOTE: It is not safe to use this iterator while removing transactions from // the underlying mempool. -func (mp *PriorityNonceMempool[C]) Select(_ context.Context, _ [][]byte) Iterator { +func (mp *PriorityNonceMempool[C]) Select(ctx context.Context, txs [][]byte) Iterator { + mp.mtx.Lock() + defer mp.mtx.Unlock() + return mp.doSelect(ctx, txs) +} + +func (mp *PriorityNonceMempool[C]) doSelect(_ context.Context, _ [][]byte) Iterator { if mp.priorityIndex.Len() == 0 { return nil } @@ -355,6 +382,17 @@ func (mp *PriorityNonceMempool[C]) Select(_ context.Context, _ [][]byte) Iterato return iterator.iteratePriority() } +// SelectBy will hold the mutex during the iteration, callback returns if continue. +func (mp *PriorityNonceMempool[C]) SelectBy(ctx context.Context, txs [][]byte, callback func(sdk.Tx) bool) { + mp.mtx.Lock() + defer mp.mtx.Unlock() + + iter := mp.doSelect(ctx, txs) + for iter != nil && callback(iter.Tx()) { + iter = iter.Next() + } +} + type reorderKey[C comparable] struct { deleteKey txMeta[C] insertKey txMeta[C] @@ -409,13 +447,17 @@ func senderWeight[C comparable](txPriority TxPriority[C], senderCursor *skiplist // CountTx returns the number of transactions in the mempool. func (mp *PriorityNonceMempool[C]) CountTx() int { + mp.mtx.Lock() + defer mp.mtx.Unlock() return mp.priorityIndex.Len() } // Remove removes a transaction from the mempool in O(log n) time, returning an // error if unsuccessful. func (mp *PriorityNonceMempool[C]) Remove(tx sdk.Tx) error { - sigs, err := tx.(signing.SigVerifiableTx).GetSignaturesV2() + mp.mtx.Lock() + defer mp.mtx.Unlock() + sigs, err := mp.cfg.SignerExtractor.GetSigners(tx) if err != nil { return err } @@ -424,9 +466,18 @@ func (mp *PriorityNonceMempool[C]) Remove(tx sdk.Tx) error { } sig := sigs[0] - sender := sdk.AccAddress(sig.PubKey.Address()).String() + sender := sig.Signer.String() nonce := sig.Sequence + // if it's an unordered tx, we use the timeout timestamp instead of the nonce + if unordered, ok := tx.(sdk.TxWithUnordered); ok && unordered.GetUnordered() { + timestamp := unordered.GetTimeoutTimeStamp().Unix() + if timestamp < 0 { + return errors.New("invalid timestamp value") + } + nonce = uint64(timestamp) + } + scoreKey := txMeta[C]{nonce: nonce, sender: sender} score, ok := mp.scores[scoreKey] if !ok { diff --git a/types/mempool/priority_nonce_test.go b/types/mempool/priority_nonce_test.go index 6a3a62e13d86..1a0fd657f297 100644 --- a/types/mempool/priority_nonce_test.go +++ b/types/mempool/priority_nonce_test.go @@ -1,16 +1,19 @@ package mempool_test import ( + "context" "fmt" "math" "math/rand" + "sync" "testing" "time" - "cosmossdk.io/log" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" + "cosmossdk.io/log" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/mempool" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" @@ -59,6 +62,87 @@ func TestOutOfOrder(t *testing.T) { require.Error(t, validateOrder(rmtxs)) } +type signerExtractionAdapter struct { + UseOld bool +} + +func (a signerExtractionAdapter) GetSigners(tx sdk.Tx) ([]mempool.SignerData, error) { + if !a.UseOld { + return mempool.NewDefaultSignerExtractionAdapter().GetSigners(tx) + } + sigs, err := tx.(signing.SigVerifiableTx).GetSignaturesV2() + if err != nil { + return nil, err + } + signerData := make([]mempool.SignerData, 0, len(sigs)) + for _, sig := range sigs { + signerData = append(signerData, mempool.SignerData{ + Signer: sig.PubKey.Address().Bytes(), + Sequence: sig.Sequence, + }) + } + return signerData, nil +} + +func (s *MempoolTestSuite) TestPriorityNonceTxOrderWithAdapter() { + t := s.T() + ctx := sdk.NewContext(nil, cmtproto.Header{}, false, log.NewNopLogger()) + accounts := simtypes.RandomAccounts(rand.New(rand.NewSource(0)), 5) + sa := accounts[0].Address + sb := accounts[1].Address + + tests := []struct { + txs []txSpec + order []int + fail bool + }{ + { + txs: []txSpec{ + {p: 21, n: 4, a: sa}, + {p: 8, n: 3, a: sa}, + {p: 6, n: 2, a: sa}, + {p: 15, n: 1, a: sb}, + {p: 20, n: 1, a: sa}, + }, + order: []int{4, 3, 2, 1, 0}, + }, + } + for i, tt := range tests { + t.Run(fmt.Sprintf("case %d", i), func(t *testing.T) { + adapter := signerExtractionAdapter{} + pool := mempool.NewPriorityMempool(mempool.PriorityNonceMempoolConfig[int64]{ + TxPriority: mempool.NewDefaultTxPriority(), + SignerExtractor: adapter, + }) + + // create test txs and insert into mempool + for i, ts := range tt.txs { + tx := testTx{id: i, priority: int64(ts.p), nonce: uint64(ts.n), address: ts.a} + c := ctx.WithPriority(tx.priority) + err := pool.Insert(c, tx) + require.NoError(t, err) + } + + orderedTxs := fetchTxs(pool.Select(ctx, nil), 1000) + + var txOrder []int + for _, tx := range orderedTxs { + txOrder = append(txOrder, tx.(testTx).id) + } + + require.Equal(t, tt.order, txOrder) + require.NoError(t, validateOrder(orderedTxs)) + + adapter.UseOld = true + for _, tx := range orderedTxs { + require.NoError(t, pool.Remove(tx)) + } + + require.NoError(t, mempool.IsEmpty[int64](pool)) + }) + } +} + func (s *MempoolTestSuite) TestPriorityNonceTxOrder() { t := s.T() ctx := sdk.NewContext(nil, cmtproto.Header{}, false, log.NewNopLogger()) @@ -258,6 +342,145 @@ func (s *MempoolTestSuite) TestPriorityNonceTxOrder() { } } +func (s *MempoolTestSuite) TestIterator() { + t := s.T() + ctx := sdk.NewContext(nil, cmtproto.Header{}, false, log.NewNopLogger()) + accounts := simtypes.RandomAccounts(rand.New(rand.NewSource(0)), 2) + sa := accounts[0].Address + sb := accounts[1].Address + + tests := []struct { + txs []txSpec + fail bool + }{ + { + txs: []txSpec{ + {p: 20, n: 1, a: sa}, + {p: 15, n: 1, a: sb}, + {p: 6, n: 2, a: sa}, + {p: 21, n: 4, a: sa}, + {p: 8, n: 2, a: sb}, + }, + }, + { + txs: []txSpec{ + {p: 20, n: 1, a: sa}, + {p: 15, n: 1, a: sb}, + {p: 6, n: 2, a: sa}, + {p: 21, n: 4, a: sa}, + {p: math.MinInt64, n: 2, a: sb}, + }, + }, + } + + for i, tt := range tests { + t.Run(fmt.Sprintf("case %d", i), func(t *testing.T) { + pool := mempool.DefaultPriorityMempool() + + // create test txs and insert into mempool + for i, ts := range tt.txs { + tx := testTx{id: i, priority: int64(ts.p), nonce: uint64(ts.n), address: ts.a} + c := ctx.WithPriority(tx.priority) + err := pool.Insert(c, tx) + require.NoError(t, err) + } + + // iterate through txs + iterator := pool.Select(ctx, nil) + for iterator != nil { + tx := iterator.Tx().(testTx) + require.Equal(t, tt.txs[tx.id].p, int(tx.priority)) + require.Equal(t, tt.txs[tx.id].n, int(tx.nonce)) + require.Equal(t, tt.txs[tx.id].a, tx.address) + iterator = iterator.Next() + } + }) + } +} + +func (s *MempoolTestSuite) TestIteratorConcurrency() { + t := s.T() + ctx := sdk.NewContext(nil, cmtproto.Header{}, false, log.NewNopLogger()) + accounts := simtypes.RandomAccounts(rand.New(rand.NewSource(0)), 2) + sa := accounts[0].Address + sb := accounts[1].Address + + tests := []struct { + txs []txSpec + fail bool + }{ + { + txs: []txSpec{ + {p: 20, n: 1, a: sa}, + {p: 15, n: 1, a: sb}, + {p: 6, n: 2, a: sa}, + {p: 21, n: 4, a: sa}, + {p: 8, n: 2, a: sb}, + }, + }, + { + txs: []txSpec{ + {p: 20, n: 1, a: sa}, + {p: 15, n: 1, a: sb}, + {p: 6, n: 2, a: sa}, + {p: 21, n: 4, a: sa}, + {p: math.MinInt64, n: 2, a: sb}, + }, + }, + } + + for i, tt := range tests { + t.Run(fmt.Sprintf("case %d", i), func(t *testing.T) { + pool := mempool.DefaultPriorityMempool() + + // create test txs and insert into mempool + for i, ts := range tt.txs { + tx := testTx{id: i, priority: int64(ts.p), nonce: uint64(ts.n), address: ts.a} + c := ctx.WithPriority(tx.priority) + err := pool.Insert(c, tx) + require.NoError(t, err) + } + + // iterate through txs + stdCtx, cancel := context.WithCancel(context.Background()) + var wg sync.WaitGroup + wg.Add(1) + go func() { + defer wg.Done() + + id := len(tt.txs) + for { + select { + case <-stdCtx.Done(): + return + default: + id++ + tx := testTx{id: id, priority: int64(rand.Intn(100)), nonce: uint64(id), address: sa} + c := ctx.WithPriority(tx.priority) + err := pool.Insert(c, tx) + require.NoError(t, err) + } + } + }() + + var i int + pool.SelectBy(ctx, nil, func(memTx sdk.Tx) bool { + tx := memTx.(testTx) + if tx.id < len(tt.txs) { + require.Equal(t, tt.txs[tx.id].p, int(tx.priority)) + require.Equal(t, tt.txs[tx.id].n, int(tx.nonce)) + require.Equal(t, tt.txs[tx.id].a, tx.address) + i++ + } + return i < len(tt.txs) + }) + require.Equal(t, i, len(tt.txs)) + cancel() + wg.Wait() + }) + } +} + func (s *MempoolTestSuite) TestPriorityTies() { ctx := sdk.NewContext(nil, cmtproto.Header{}, false, log.NewNopLogger()) accounts := simtypes.RandomAccounts(rand.New(rand.NewSource(0)), 3) @@ -378,6 +601,7 @@ func (s *MempoolTestSuite) TestRandomGeneratedTxs() { OnRead: func(tx sdk.Tx) { s.iterations++ }, + SignerExtractor: mempool.NewDefaultSignerExtractionAdapter(), }, ) @@ -641,8 +865,9 @@ func TestNextSenderTx_TxLimit(t *testing.T) { // unlimited mp := mempool.NewPriorityMempool( mempool.PriorityNonceMempoolConfig[int64]{ - TxPriority: mempool.NewDefaultTxPriority(), - MaxTx: 0, + TxPriority: mempool.NewDefaultTxPriority(), + MaxTx: 0, + SignerExtractor: mempool.NewDefaultSignerExtractionAdapter(), }, ) for i, tx := range txs { @@ -661,8 +886,9 @@ func TestNextSenderTx_TxLimit(t *testing.T) { // limit: 3 mp = mempool.NewPriorityMempool( mempool.PriorityNonceMempoolConfig[int64]{ - TxPriority: mempool.NewDefaultTxPriority(), - MaxTx: 3, + TxPriority: mempool.NewDefaultTxPriority(), + MaxTx: 3, + SignerExtractor: mempool.NewDefaultSignerExtractionAdapter(), }, ) for i, tx := range txs { @@ -680,8 +906,9 @@ func TestNextSenderTx_TxLimit(t *testing.T) { // disabled mp = mempool.NewPriorityMempool( mempool.PriorityNonceMempoolConfig[int64]{ - TxPriority: mempool.NewDefaultTxPriority(), - MaxTx: -1, + TxPriority: mempool.NewDefaultTxPriority(), + MaxTx: -1, + SignerExtractor: mempool.NewDefaultSignerExtractionAdapter(), }, ) for _, tx := range txs { @@ -726,6 +953,7 @@ func TestNextSenderTx_TxReplacement(t *testing.T) { threshold := int64(100 + feeBump) return np >= op*threshold/100 }, + SignerExtractor: mempool.NewDefaultSignerExtractionAdapter(), }, ) @@ -748,3 +976,40 @@ func TestNextSenderTx_TxReplacement(t *testing.T) { iter := mp.Select(ctx, nil) require.Equal(t, txs[3], iter.Tx()) } + +func TestPriorityNonceMempool_UnorderedTx(t *testing.T) { + ctx := sdk.NewContext(nil, cmtproto.Header{}, false, log.NewNopLogger()) + accounts := simtypes.RandomAccounts(rand.New(rand.NewSource(0)), 2) + sa := accounts[0].Address + sb := accounts[1].Address + + mp := mempool.DefaultPriorityMempool() + + now := time.Now() + oneHour := now.Add(1 * time.Hour) + thirtyMin := now.Add(30 * time.Minute) + twoHours := now.Add(2 * time.Hour) + fifteenMin := now.Add(15 * time.Minute) + + txs := []testTx{ + {id: 1, priority: 0, address: sa, timeout: &thirtyMin, unordered: true}, + {id: 0, priority: 0, address: sa, timeout: &oneHour, unordered: true}, + {id: 3, priority: 0, address: sb, timeout: &fifteenMin, unordered: true}, + {id: 2, priority: 0, address: sb, timeout: &twoHours, unordered: true}, + } + + for _, tx := range txs { + c := ctx.WithPriority(tx.priority) + require.NoError(t, mp.Insert(c, tx)) + } + + require.Equal(t, 4, mp.CountTx()) + + orderedTxs := fetchTxs(mp.Select(ctx, nil), 100000) + require.Equal(t, len(txs), len(orderedTxs)) + + // check order + for i, tx := range orderedTxs { + require.Equal(t, txs[i].id, tx.(testTx).id) + } +} diff --git a/types/mempool/sender_nonce.go b/types/mempool/sender_nonce.go index c013072dfecd..68959970760e 100644 --- a/types/mempool/sender_nonce.go +++ b/types/mempool/sender_nonce.go @@ -4,8 +4,10 @@ import ( "context" crand "crypto/rand" // #nosec // crypto/rand is used for seed generation "encoding/binary" + "errors" "fmt" "math/rand" // #nosec // math/rand is used for random selection and seeded from crypto/rand + "sync" "github.com/huandu/skiplist" @@ -14,11 +16,11 @@ import ( ) var ( - _ Mempool = (*SenderNonceMempool)(nil) - _ Iterator = (*senderNonceMempoolIterator)(nil) + _ ExtMempool = (*SenderNonceMempool)(nil) + _ Iterator = (*senderNonceMempoolIterator)(nil) ) -var DefaultMaxTx = 0 +var DefaultMaxTx = -1 // SenderNonceMempool is a mempool that prioritizes transactions within a sender // by nonce, the lowest first, but selects a random sender on each iteration. @@ -31,6 +33,7 @@ var DefaultMaxTx = 0 // Note that PrepareProposal could choose to stop iteration before reaching the // end if maxBytes is reached. type SenderNonceMempool struct { + mtx sync.Mutex senders map[string]*skiplist.SkipList rnd *rand.Rand maxTx int @@ -116,7 +119,9 @@ func (snm *SenderNonceMempool) NextSenderTx(sender string) sdk.Tx { // Insert adds a tx to the mempool. It returns an error if the tx does not have // at least one signer. Note, priority is ignored. func (snm *SenderNonceMempool) Insert(_ context.Context, tx sdk.Tx) error { - if snm.maxTx > 0 && snm.CountTx() >= snm.maxTx { + snm.mtx.Lock() + defer snm.mtx.Unlock() + if snm.maxTx > 0 && len(snm.existingTx) >= snm.maxTx { return ErrMempoolTxMaxCapacity } if snm.maxTx < 0 { @@ -135,6 +140,15 @@ func (snm *SenderNonceMempool) Insert(_ context.Context, tx sdk.Tx) error { sender := sdk.AccAddress(sig.PubKey.Address()).String() nonce := sig.Sequence + // if it's an unordered tx, we use the timeout timestamp instead of the nonce + if unordered, ok := tx.(sdk.TxWithUnordered); ok && unordered.GetUnordered() { + timestamp := unordered.GetTimeoutTimeStamp().Unix() + if timestamp < 0 { + return errors.New("invalid timestamp value") + } + nonce = uint64(timestamp) + } + senderTxs, found := snm.senders[sender] if !found { senderTxs = skiplist.New(skiplist.Uint64) @@ -154,7 +168,13 @@ func (snm *SenderNonceMempool) Insert(_ context.Context, tx sdk.Tx) error { // // NOTE: It is not safe to use this iterator while removing transactions from // the underlying mempool. -func (snm *SenderNonceMempool) Select(_ context.Context, _ [][]byte) Iterator { +func (snm *SenderNonceMempool) Select(ctx context.Context, txs [][]byte) Iterator { + snm.mtx.Lock() + defer snm.mtx.Unlock() + return snm.doSelect(ctx, txs) +} + +func (snm *SenderNonceMempool) doSelect(_ context.Context, _ [][]byte) Iterator { var senders []string senderCursors := make(map[string]*skiplist.Element) @@ -182,14 +202,29 @@ func (snm *SenderNonceMempool) Select(_ context.Context, _ [][]byte) Iterator { return iter.Next() } +// SelectBy will hold the mutex during the iteration, callback returns if continue. +func (snm *SenderNonceMempool) SelectBy(ctx context.Context, txs [][]byte, callback func(sdk.Tx) bool) { + snm.mtx.Lock() + defer snm.mtx.Unlock() + + iter := snm.doSelect(ctx, txs) + for iter != nil && callback(iter.Tx()) { + iter = iter.Next() + } +} + // CountTx returns the total count of txs in the mempool. func (snm *SenderNonceMempool) CountTx() int { + snm.mtx.Lock() + defer snm.mtx.Unlock() return len(snm.existingTx) } // Remove removes a tx from the mempool. It returns an error if the tx does not // have at least one signer or the tx was not found in the pool. func (snm *SenderNonceMempool) Remove(tx sdk.Tx) error { + snm.mtx.Lock() + defer snm.mtx.Unlock() sigs, err := tx.(signing.SigVerifiableTx).GetSignaturesV2() if err != nil { return err @@ -202,6 +237,15 @@ func (snm *SenderNonceMempool) Remove(tx sdk.Tx) error { sender := sdk.AccAddress(sig.PubKey.Address()).String() nonce := sig.Sequence + // if it's an unordered tx, we use the timeout timestamp instead of the nonce + if unordered, ok := tx.(sdk.TxWithUnordered); ok && unordered.GetUnordered() { + timestamp := unordered.GetTimeoutTimeStamp().Unix() + if timestamp < 0 { + return errors.New("invalid timestamp value") + } + nonce = uint64(timestamp) + } + senderTxs, found := snm.senders[sender] if !found { return ErrTxNotFound diff --git a/types/mempool/sender_nonce_property_test.go b/types/mempool/sender_nonce_property_test.go index 5ae29eb31bd1..baaaa4abe9a2 100644 --- a/types/mempool/sender_nonce_property_test.go +++ b/types/mempool/sender_nonce_property_test.go @@ -3,11 +3,11 @@ package mempool_test import ( "sort" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/stretchr/testify/require" "pgregory.net/rapid" "cosmossdk.io/log" - cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" - "github.com/stretchr/testify/require" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/types/mempool/sender_nonce_test.go b/types/mempool/sender_nonce_test.go index bcaca96529b6..cf39de452f72 100644 --- a/types/mempool/sender_nonce_test.go +++ b/types/mempool/sender_nonce_test.go @@ -4,11 +4,13 @@ import ( "fmt" "math/rand" "testing" + "time" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" "cosmossdk.io/log" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/mempool" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" @@ -114,7 +116,7 @@ func (s *MempoolTestSuite) TestTxOrder() { } for i, tt := range tests { t.Run(fmt.Sprintf("case %d", i), func(t *testing.T) { - pool := mempool.NewSenderNonceMempool(mempool.SenderNonceSeedOpt(tt.seed)) + pool := mempool.NewSenderNonceMempool(mempool.SenderNonceMaxTxOpt(5000), mempool.SenderNonceSeedOpt(tt.seed)) // create test txs and insert into mempool for i, ts := range tt.txs { tx := testTx{id: i, priority: int64(ts.p), nonce: uint64(ts.n), address: ts.a} @@ -172,7 +174,7 @@ func (s *MempoolTestSuite) TestTxNotFoundOnSender() { t := s.T() ctx := sdk.NewContext(nil, cmtproto.Header{}, false, log.NewNopLogger()) accounts := simtypes.RandomAccounts(rand.New(rand.NewSource(0)), 1) - mp := mempool.NewSenderNonceMempool() + mp := mempool.NewSenderNonceMempool(mempool.SenderNonceMaxTxOpt(5000)) txSender := testTx{ nonce: 0, @@ -192,3 +194,67 @@ func (s *MempoolTestSuite) TestTxNotFoundOnSender() { err = mp.Remove(tx) require.Equal(t, mempool.ErrTxNotFound, err) } + +func (s *MempoolTestSuite) TestUnorderedTx() { + t := s.T() + + ctx := sdk.NewContext(nil, cmtproto.Header{}, false, log.NewNopLogger()) + accounts := simtypes.RandomAccounts(rand.New(rand.NewSource(0)), 2) + sa := accounts[0].Address + sb := accounts[1].Address + + mp := mempool.NewSenderNonceMempool(mempool.SenderNonceMaxTxOpt(5000)) + + now := time.Now() + oneHour := now.Add(1 * time.Hour) + thirtyMin := now.Add(30 * time.Minute) + twoHours := now.Add(2 * time.Hour) + fifteenMin := now.Add(15 * time.Minute) + + txs := []testTx{ + {id: 0, address: sa, timeout: &oneHour, unordered: true}, + {id: 1, address: sa, timeout: &thirtyMin, unordered: true}, + {id: 2, address: sb, timeout: &twoHours, unordered: true}, + {id: 3, address: sb, timeout: &fifteenMin, unordered: true}, + } + + for _, tx := range txs { + c := ctx.WithPriority(tx.priority) + require.NoError(t, mp.Insert(c, tx)) + } + + require.Equal(t, 4, mp.CountTx()) + + orderedTxs := fetchTxs(mp.Select(ctx, nil), 100000) + require.Equal(t, len(txs), len(orderedTxs)) + + // Because the sender is selected randomly it can be any of these options + acceptableOptions := [][]int{ + {3, 1, 2, 0}, + {3, 1, 0, 2}, + {3, 2, 1, 0}, + {1, 3, 0, 2}, + {1, 3, 2, 0}, + {1, 0, 3, 2}, + } + + orderedTxsIds := make([]int, len(orderedTxs)) + for i, tx := range orderedTxs { + orderedTxsIds[i] = tx.(testTx).id + } + + anyAcceptableOrder := false + for _, option := range acceptableOptions { + for i, tx := range orderedTxs { + if tx.(testTx).id != txs[option[i]].id { + break + } + + if i == len(orderedTxs)-1 { + anyAcceptableOrder = true + } + } + } + + require.True(t, anyAcceptableOrder, "expected any of %v but got %v", acceptableOptions, orderedTxsIds) +} diff --git a/types/mempool/signer_extraction_adapater_test.go b/types/mempool/signer_extraction_adapater_test.go new file mode 100644 index 000000000000..b2218dc8e511 --- /dev/null +++ b/types/mempool/signer_extraction_adapater_test.go @@ -0,0 +1,58 @@ +package mempool_test + +import ( + "fmt" + "math/rand" + "testing" + + "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/mempool" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + txsigning "github.com/cosmos/cosmos-sdk/types/tx/signing" +) + +type nonVerifiableTx struct{} + +func (n nonVerifiableTx) GetMsgs() []sdk.Msg { + panic("not implemented") +} + +func (n nonVerifiableTx) GetMsgsV2() ([]proto.Message, error) { + panic("not implemented") +} + +func TestDefaultSignerExtractor(t *testing.T) { + accounts := simtypes.RandomAccounts(rand.New(rand.NewSource(0)), 1) + sa := accounts[0].Address + ext := mempool.NewDefaultSignerExtractionAdapter() + goodTx := testTx{id: 0, priority: 0, nonce: 0, address: sa} + badTx := &sigErrTx{getSigs: func() ([]txsigning.SignatureV2, error) { + return nil, fmt.Errorf("error") + }} + nonSigVerify := nonVerifiableTx{} + + tests := []struct { + name string + tx sdk.Tx + sea mempool.SignerExtractionAdapter + err error + }{ + {name: "valid tx extracts sigs", tx: goodTx, sea: ext, err: nil}, + {name: "invalid tx fails on sig", tx: badTx, sea: ext, err: fmt.Errorf("err")}, + {name: "non-verifiable tx fails on conversion", tx: nonSigVerify, sea: ext, err: fmt.Errorf("tx of type %T does not implement SigVerifiableTx", nonSigVerify)}, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + sigs, err := test.sea.GetSigners(test.tx) + if test.err != nil { + require.Error(t, err) + return + } + require.NoError(t, err) + require.Equal(t, sigs[0].String(), mempool.SignerData{Signer: sa, Sequence: 0}.String()) + }) + } +} diff --git a/types/mempool/signer_extraction_adapter.go b/types/mempool/signer_extraction_adapter.go new file mode 100644 index 000000000000..10718cb9dddd --- /dev/null +++ b/types/mempool/signer_extraction_adapter.go @@ -0,0 +1,67 @@ +package mempool + +import ( + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/auth/signing" +) + +// SignerData contains canonical useful information about the signer of a transaction +type SignerData struct { + Signer sdk.AccAddress + Sequence uint64 +} + +// NewSignerData returns a new SignerData instance. +func NewSignerData(signer sdk.AccAddress, sequence uint64) SignerData { + return SignerData{ + Signer: signer, + Sequence: sequence, + } +} + +// String implements the fmt.Stringer interface. +func (s SignerData) String() string { + return fmt.Sprintf("SignerData{Signer: %s, Sequence: %d}", s.Signer, s.Sequence) +} + +// SignerExtractionAdapter is an interface used to determine how the signers of a transaction should be extracted +// from the transaction. +type SignerExtractionAdapter interface { + GetSigners(sdk.Tx) ([]SignerData, error) +} + +var _ SignerExtractionAdapter = DefaultSignerExtractionAdapter{} + +// DefaultSignerExtractionAdapter is the default implementation of SignerExtractionAdapter. It extracts the signers +// from a cosmos-sdk tx via GetSignaturesV2. +type DefaultSignerExtractionAdapter struct{} + +// NewDefaultSignerExtractionAdapter constructs a new DefaultSignerExtractionAdapter instance +func NewDefaultSignerExtractionAdapter() DefaultSignerExtractionAdapter { + return DefaultSignerExtractionAdapter{} +} + +// GetSigners implements the Adapter interface +func (DefaultSignerExtractionAdapter) GetSigners(tx sdk.Tx) ([]SignerData, error) { + sigTx, ok := tx.(signing.SigVerifiableTx) + if !ok { + return nil, fmt.Errorf("tx of type %T does not implement SigVerifiableTx", tx) + } + + sigs, err := sigTx.GetSignaturesV2() + if err != nil { + return nil, err + } + + signers := make([]SignerData, len(sigs)) + for i, sig := range sigs { + signers[i] = NewSignerData( + sig.PubKey.Address().Bytes(), + sig.Sequence, + ) + } + + return signers, nil +} diff --git a/types/module/configurator.go b/types/module/configurator.go index 3024ce1801cd..970f868b3697 100644 --- a/types/module/configurator.go +++ b/types/module/configurator.go @@ -3,13 +3,14 @@ package module import ( "fmt" - cosmosmsg "cosmossdk.io/api/cosmos/msg/v1" - errorsmod "cosmossdk.io/errors" "github.com/cosmos/gogoproto/grpc" googlegrpc "google.golang.org/grpc" protobuf "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" + cosmosmsg "cosmossdk.io/api/cosmos/msg/v1" + errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" diff --git a/types/module/core_module.go b/types/module/core_module.go index d4330ecb5e45..c02943e99c04 100644 --- a/types/module/core_module.go +++ b/types/module/core_module.go @@ -3,12 +3,12 @@ package module import ( "encoding/json" - "cosmossdk.io/core/appmodule" - "cosmossdk.io/core/genesis" abci "github.com/cometbft/cometbft/abci/types" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" + "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/genesis" storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/client" @@ -18,27 +18,33 @@ import ( ) var ( - _ AppModuleBasic = coreAppModuleBasicAdapator{} - _ HasGenesis = coreAppModuleBasicAdapator{} - _ HasServices = coreAppModuleBasicAdapator{} + _ appmodule.AppModule = coreAppModuleBasicAdaptor{} + + _ AppModuleBasic = coreAppModuleBasicAdaptor{} + _ HasABCIGenesis = coreAppModuleBasicAdaptor{} + _ HasServices = coreAppModuleBasicAdaptor{} ) -// CoreAppModuleBasicAdaptor wraps the core API module as an AppModule that this version -// of the SDK can use. -func CoreAppModuleBasicAdaptor(name string, module appmodule.AppModule) AppModuleBasic { - return coreAppModuleBasicAdapator{ +// CoreAppModuleAdaptor wraps the core API module as an AppModule that this version of the SDK can use. +func CoreAppModuleAdaptor(name string, module appmodule.AppModule) AppModule { + return coreAppModuleBasicAdaptor{ name: name, module: module, } } -type coreAppModuleBasicAdapator struct { +// CoreAppModuleBasicAdaptor wraps the core API module as an AppModule that this version of the SDK can use. +func CoreAppModuleBasicAdaptor(name string, module appmodule.AppModule) AppModule { + return CoreAppModuleAdaptor(name, module) +} + +type coreAppModuleBasicAdaptor struct { name string module appmodule.AppModule } // DefaultGenesis implements HasGenesis -func (c coreAppModuleBasicAdapator) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { +func (c coreAppModuleBasicAdaptor) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { if mod, ok := c.module.(appmodule.HasGenesis); ok { target := genesis.RawJSONTarget{} err := mod.DefaultGenesis(target.Target()) @@ -62,7 +68,7 @@ func (c coreAppModuleBasicAdapator) DefaultGenesis(cdc codec.JSONCodec) json.Raw } // ValidateGenesis implements HasGenesis -func (c coreAppModuleBasicAdapator) ValidateGenesis(cdc codec.JSONCodec, txConfig client.TxEncodingConfig, bz json.RawMessage) error { +func (c coreAppModuleBasicAdaptor) ValidateGenesis(cdc codec.JSONCodec, txConfig client.TxEncodingConfig, bz json.RawMessage) error { if mod, ok := c.module.(appmodule.HasGenesis); ok { source, err := genesis.SourceFromRawJSON(bz) if err != nil { @@ -82,7 +88,7 @@ func (c coreAppModuleBasicAdapator) ValidateGenesis(cdc codec.JSONCodec, txConfi } // ExportGenesis implements HasGenesis -func (c coreAppModuleBasicAdapator) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { +func (c coreAppModuleBasicAdaptor) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { if module, ok := c.module.(appmodule.HasGenesis); ok { ctx := ctx.WithGasMeter(storetypes.NewInfiniteGasMeter()) // avoid race conditions target := genesis.RawJSONTarget{} @@ -103,11 +109,15 @@ func (c coreAppModuleBasicAdapator) ExportGenesis(ctx sdk.Context, cdc codec.JSO return mod.ExportGenesis(ctx, cdc) } + if mod, ok := c.module.(HasABCIGenesis); ok { + return mod.ExportGenesis(ctx, cdc) + } + return nil } // InitGenesis implements HasGenesis -func (c coreAppModuleBasicAdapator) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, bz json.RawMessage) []abci.ValidatorUpdate { +func (c coreAppModuleBasicAdaptor) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, bz json.RawMessage) []abci.ValidatorUpdate { if module, ok := c.module.(appmodule.HasGenesis); ok { // core API genesis source, err := genesis.SourceFromRawJSON(bz) @@ -122,19 +132,22 @@ func (c coreAppModuleBasicAdapator) InitGenesis(ctx sdk.Context, cdc codec.JSONC } if mod, ok := c.module.(HasGenesis); ok { + mod.InitGenesis(ctx, cdc, bz) + return nil + } + if mod, ok := c.module.(HasABCIGenesis); ok { return mod.InitGenesis(ctx, cdc, bz) } - return nil } // Name implements AppModuleBasic -func (c coreAppModuleBasicAdapator) Name() string { +func (c coreAppModuleBasicAdaptor) Name() string { return c.name } // GetQueryCmd implements AppModuleBasic -func (c coreAppModuleBasicAdapator) GetQueryCmd() *cobra.Command { +func (c coreAppModuleBasicAdaptor) GetQueryCmd() *cobra.Command { if mod, ok := c.module.(interface { GetQueryCmd() *cobra.Command }); ok { @@ -145,7 +158,7 @@ func (c coreAppModuleBasicAdapator) GetQueryCmd() *cobra.Command { } // GetTxCmd implements AppModuleBasic -func (c coreAppModuleBasicAdapator) GetTxCmd() *cobra.Command { +func (c coreAppModuleBasicAdaptor) GetTxCmd() *cobra.Command { if mod, ok := c.module.(interface { GetTxCmd() *cobra.Command }); ok { @@ -156,7 +169,7 @@ func (c coreAppModuleBasicAdapator) GetTxCmd() *cobra.Command { } // RegisterGRPCGatewayRoutes implements AppModuleBasic -func (c coreAppModuleBasicAdapator) RegisterGRPCGatewayRoutes(ctx client.Context, mux *runtime.ServeMux) { +func (c coreAppModuleBasicAdaptor) RegisterGRPCGatewayRoutes(ctx client.Context, mux *runtime.ServeMux) { if mod, ok := c.module.(interface { RegisterGRPCGatewayRoutes(context client.Context, mux *runtime.ServeMux) }); ok { @@ -165,7 +178,7 @@ func (c coreAppModuleBasicAdapator) RegisterGRPCGatewayRoutes(ctx client.Context } // RegisterInterfaces implements AppModuleBasic -func (c coreAppModuleBasicAdapator) RegisterInterfaces(registry codectypes.InterfaceRegistry) { +func (c coreAppModuleBasicAdaptor) RegisterInterfaces(registry codectypes.InterfaceRegistry) { if mod, ok := c.module.(interface { RegisterInterfaces(registry codectypes.InterfaceRegistry) }); ok { @@ -174,7 +187,7 @@ func (c coreAppModuleBasicAdapator) RegisterInterfaces(registry codectypes.Inter } // RegisterLegacyAminoCodec implements AppModuleBasic -func (c coreAppModuleBasicAdapator) RegisterLegacyAminoCodec(amino *codec.LegacyAmino) { +func (c coreAppModuleBasicAdaptor) RegisterLegacyAminoCodec(amino *codec.LegacyAmino) { if mod, ok := c.module.(interface { RegisterLegacyAminoCodec(amino *codec.LegacyAmino) }); ok { @@ -183,7 +196,7 @@ func (c coreAppModuleBasicAdapator) RegisterLegacyAminoCodec(amino *codec.Legacy } // RegisterServices implements HasServices -func (c coreAppModuleBasicAdapator) RegisterServices(cfg Configurator) { +func (c coreAppModuleBasicAdaptor) RegisterServices(cfg Configurator) { if module, ok := c.module.(appmodule.HasServices); ok { err := module.RegisterServices(cfg) if err != nil { @@ -191,3 +204,7 @@ func (c coreAppModuleBasicAdapator) RegisterServices(cfg Configurator) { } } } + +func (c coreAppModuleBasicAdaptor) IsOnePerModuleType() {} + +func (c coreAppModuleBasicAdaptor) IsAppModule() {} diff --git a/types/module/genesis.go b/types/module/genesis.go deleted file mode 100644 index b0b78bfd7a25..000000000000 --- a/types/module/genesis.go +++ /dev/null @@ -1 +0,0 @@ -package module diff --git a/types/module/mock_appmodule_test.go b/types/module/mock_appmodule_test.go index 486ae24ed067..07c9c6389f51 100644 --- a/types/module/mock_appmodule_test.go +++ b/types/module/mock_appmodule_test.go @@ -14,7 +14,19 @@ type AppModuleWithAllExtensions interface { module.HasGenesis module.HasInvariants module.HasConsensusVersion - module.HasABCIEndblock + module.HasABCIEndBlock + module.HasName +} + +// mocks to be used in module tests. +type AppModuleWithAllExtensionsABCI interface { + module.AppModule + module.HasServices + module.HasABCIGenesis + module.HasInvariants + module.HasConsensusVersion + module.HasABCIEndBlock + module.HasName } // CoreAppModule is solely here for the purpose of generating @@ -27,3 +39,8 @@ type CoreAppModule interface { appmodule.HasPrecommit appmodule.HasPrepareCheckState } + +type CoreAppModuleWithPreBlock interface { + CoreAppModule + appmodule.HasPreBlocker +} diff --git a/types/module/module.go b/types/module/module.go index 9fc87d700900..506f4393b6cc 100644 --- a/types/module/module.go +++ b/types/module/module.go @@ -2,7 +2,6 @@ Package module contains application module patterns and associated "manager" functionality. The module pattern has been broken down by: - independent module functionality (AppModuleBasic) - - inter-dependent module genesis functionality (AppModuleGenesis) - inter-dependent module simulation functionality (AppModuleSimulation) - inter-dependent module full functionality (AppModule) @@ -21,7 +20,7 @@ have to manually register all of the codecs for all the modules. This basic procedure as well as other basic patterns are handled through the use of BasicManager. -Lastly the interface for genesis functionality (AppModuleGenesis) has been +Lastly the interface for genesis functionality (HasGenesis & HasABCIGenesis) has been separated out from full module functionality (AppModule) so that modules which are only used for genesis can take advantage of the Module patterns without needlessly defining many placeholder functions @@ -33,18 +32,18 @@ import ( "encoding/json" "errors" "fmt" + "maps" + "slices" "sort" - "cosmossdk.io/core/appmodule" - "cosmossdk.io/core/genesis" abci "github.com/cometbft/cometbft/abci/types" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" - "golang.org/x/exp/maps" - - storetypes "cosmossdk.io/store/types" + "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/genesis" errorsmod "cosmossdk.io/errors" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" @@ -58,11 +57,7 @@ type AppModuleBasic interface { HasName RegisterLegacyAminoCodec(*codec.LegacyAmino) RegisterInterfaces(types.InterfaceRegistry) - - // client functionality RegisterGRPCGatewayRoutes(client.Context, *runtime.ServeMux) - GetTxCmd() *cobra.Command - GetQueryCmd() *cobra.Command } // HasName allows the module to provide its own name for legacy purposes. @@ -164,8 +159,12 @@ func (bm BasicManager) RegisterGRPCGatewayRoutes(clientCtx client.Context, rtr * // AddTxCommands adds all tx commands to the rootTxCmd. func (bm BasicManager) AddTxCommands(rootTxCmd *cobra.Command) { for _, b := range bm { - if cmd := b.GetTxCmd(); cmd != nil { - rootTxCmd.AddCommand(cmd) + if mod, ok := b.(interface { + GetTxCmd() *cobra.Command + }); ok { + if cmd := mod.GetTxCmd(); cmd != nil { + rootTxCmd.AddCommand(cmd) + } } } } @@ -173,20 +172,25 @@ func (bm BasicManager) AddTxCommands(rootTxCmd *cobra.Command) { // AddQueryCommands adds all query commands to the rootQueryCmd. func (bm BasicManager) AddQueryCommands(rootQueryCmd *cobra.Command) { for _, b := range bm { - if cmd := b.GetQueryCmd(); cmd != nil { - rootQueryCmd.AddCommand(cmd) + if mod, ok := b.(interface { + GetQueryCmd() *cobra.Command + }); ok { + if cmd := mod.GetQueryCmd(); cmd != nil { + rootQueryCmd.AddCommand(cmd) + } } } } -// AppModuleGenesis is the standard form for an application module genesis functions -type AppModuleGenesis interface { - AppModuleBasic - HasGenesis -} - // HasGenesis is the extension interface for stateful genesis methods. type HasGenesis interface { + HasGenesisBasics + InitGenesis(sdk.Context, codec.JSONCodec, json.RawMessage) + ExportGenesis(sdk.Context, codec.JSONCodec) json.RawMessage +} + +// HasABCIGenesis is the extension interface for stateful genesis methods which returns validator updates. +type HasABCIGenesis interface { HasGenesisBasics InitGenesis(sdk.Context, codec.JSONCodec, json.RawMessage) []abci.ValidatorUpdate ExportGenesis(sdk.Context, codec.JSONCodec) json.RawMessage @@ -194,11 +198,16 @@ type HasGenesis interface { // AppModule is the form for an application module. Most of // its functionality has been moved to extension interfaces. +// Deprecated: use appmodule.AppModule with a combination of extension interfaes interfaces instead. type AppModule interface { + appmodule.AppModule + AppModuleBasic } // HasInvariants is the interface for registering invariants. +// +// Deprecated: this will be removed in the next Cosmos SDK release. type HasInvariants interface { // RegisterInvariants registers module invariants. RegisterInvariants(sdk.InvariantRegistry) @@ -219,11 +228,27 @@ type HasConsensusVersion interface { ConsensusVersion() uint64 } -type HasABCIEndblock interface { +// HasABCIEndblock is a released typo of HasABCIEndBlock. +// Deprecated: use HasABCIEndBlock instead. +type HasABCIEndblock HasABCIEndBlock + +// HasABCIEndBlock is the interface for modules that need to run code at the end of the block. +type HasABCIEndBlock interface { AppModule EndBlock(context.Context) ([]abci.ValidatorUpdate, error) } +var ( + _ appmodule.AppModule = (*GenesisOnlyAppModule)(nil) + _ AppModuleBasic = (*GenesisOnlyAppModule)(nil) +) + +// AppModuleGenesis is the standard form for an application module genesis functions +type AppModuleGenesis interface { + AppModuleBasic + HasABCIGenesis +} + // GenesisOnlyAppModule is an AppModule that only has import/export functionality type GenesisOnlyAppModule struct { AppModuleGenesis @@ -245,29 +270,16 @@ func (GenesisOnlyAppModule) IsAppModule() {} // RegisterInvariants is a placeholder function register no invariants func (GenesisOnlyAppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} -// QuerierRoute returns an empty module querier route -func (GenesisOnlyAppModule) QuerierRoute() string { return "" } - -// RegisterServices registers all services. -func (gam GenesisOnlyAppModule) RegisterServices(Configurator) {} - // ConsensusVersion implements AppModule/ConsensusVersion. func (gam GenesisOnlyAppModule) ConsensusVersion() uint64 { return 1 } -// BeginBlock returns an empty module begin-block -func (gam GenesisOnlyAppModule) BeginBlock(ctx sdk.Context) error { return nil } - -// EndBlock returns an empty module end-block -func (GenesisOnlyAppModule) EndBlock(sdk.Context) ([]abci.ValidatorUpdate, error) { - return []abci.ValidatorUpdate{}, nil -} - // Manager defines a module manager that provides the high level utility for managing and executing // operations for a group of modules type Manager struct { Modules map[string]interface{} // interface{} is used now to support the legacy AppModule as well as new core appmodule.AppModule. OrderInitGenesis []string OrderExportGenesis []string + OrderPreBlockers []string OrderBeginBlockers []string OrderEndBlockers []string OrderPrepareCheckStaters []string @@ -279,15 +291,24 @@ type Manager struct { func NewManager(modules ...AppModule) *Manager { moduleMap := make(map[string]interface{}) modulesStr := make([]string, 0, len(modules)) + preBlockModulesStr := make([]string, 0) for _, module := range modules { + if _, ok := module.(appmodule.AppModule); !ok { + panic(fmt.Sprintf("module %s does not implement appmodule.AppModule", module.Name())) + } + moduleMap[module.Name()] = module modulesStr = append(modulesStr, module.Name()) + if _, ok := module.(appmodule.HasPreBlocker); ok { + preBlockModulesStr = append(preBlockModulesStr, module.Name()) + } } return &Manager{ Modules: moduleMap, OrderInitGenesis: modulesStr, OrderExportGenesis: modulesStr, + OrderPreBlockers: preBlockModulesStr, OrderBeginBlockers: modulesStr, OrderPrepareCheckStaters: modulesStr, OrderPrecommiters: modulesStr, @@ -300,9 +321,13 @@ func NewManager(modules ...AppModule) *Manager { func NewManagerFromMap(moduleMap map[string]appmodule.AppModule) *Manager { simpleModuleMap := make(map[string]interface{}) modulesStr := make([]string, 0, len(simpleModuleMap)) + preBlockModulesStr := make([]string, 0) for name, module := range moduleMap { simpleModuleMap[name] = module modulesStr = append(modulesStr, name) + if _, ok := module.(appmodule.HasPreBlocker); ok { + preBlockModulesStr = append(preBlockModulesStr, name) + } } // Sort the modules by name. Given that we are using a map above we can't guarantee the order. @@ -312,6 +337,7 @@ func NewManagerFromMap(moduleMap map[string]appmodule.AppModule) *Manager { Modules: simpleModuleMap, OrderInitGenesis: modulesStr, OrderExportGenesis: modulesStr, + OrderPreBlockers: preBlockModulesStr, OrderBeginBlockers: modulesStr, OrderEndBlockers: modulesStr, OrderPrecommiters: modulesStr, @@ -327,6 +353,10 @@ func (m *Manager) SetOrderInitGenesis(moduleNames ...string) { return !hasGenesis } + if _, hasABCIGenesis := module.(HasABCIGenesis); hasABCIGenesis { + return !hasABCIGenesis + } + _, hasGenesis := module.(HasGenesis) return !hasGenesis }) @@ -341,12 +371,27 @@ func (m *Manager) SetOrderExportGenesis(moduleNames ...string) { return !hasGenesis } + if _, hasABCIGenesis := module.(HasABCIGenesis); hasABCIGenesis { + return !hasABCIGenesis + } + _, hasGenesis := module.(HasGenesis) return !hasGenesis }) m.OrderExportGenesis = moduleNames } +// SetOrderPreBlockers sets the order of set pre-blocker calls +func (m *Manager) SetOrderPreBlockers(moduleNames ...string) { + m.assertNoForgottenModules("SetOrderPreBlockers", moduleNames, + func(moduleName string) bool { + module := m.Modules[moduleName] + _, hasBlock := module.(appmodule.HasPreBlocker) + return !hasBlock + }) + m.OrderPreBlockers = moduleNames +} + // SetOrderBeginBlockers sets the order of set begin-blocker calls func (m *Manager) SetOrderBeginBlockers(moduleNames ...string) { m.assertNoForgottenModules("SetOrderBeginBlockers", moduleNames, @@ -363,8 +408,12 @@ func (m *Manager) SetOrderEndBlockers(moduleNames ...string) { m.assertNoForgottenModules("SetOrderEndBlockers", moduleNames, func(moduleName string) bool { module := m.Modules[moduleName] - _, hasEndBlock := module.(HasABCIEndblock) - return !hasEndBlock + if _, hasEndBlock := module.(appmodule.HasEndBlocker); hasEndBlock { + return !hasEndBlock + } + + _, hasABCIEndBlock := module.(HasABCIEndBlock) + return !hasABCIEndBlock }) m.OrderEndBlockers = moduleNames } @@ -399,13 +448,9 @@ func (m *Manager) SetOrderMigrations(moduleNames ...string) { } // RegisterInvariants registers all module invariants -func (m *Manager) RegisterInvariants(ir sdk.InvariantRegistry) { - for _, module := range m.Modules { - if module, ok := module.(HasInvariants); ok { - module.RegisterInvariants(ir) - } - } -} +// +// Deprecated: this function is a no-op and will be removed in the next release of the Cosmos SDK. +func (m *Manager) RegisterInvariants(_ sdk.InvariantRegistry) {} // RegisterServices registers all module services func (m *Manager) RegisterServices(cfg Configurator) error { @@ -455,6 +500,9 @@ func (m *Manager) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, genesisData return &abci.ResponseInitChain{}, err } } else if module, ok := mod.(HasGenesis); ok { + ctx.Logger().Debug("running initialization for module", "module", moduleName) + module.InitGenesis(ctx, cdc, genesisData[moduleName]) + } else if module, ok := mod.(HasABCIGenesis); ok { ctx.Logger().Debug("running initialization for module", "module", moduleName) moduleValUpdates := module.InitGenesis(ctx, cdc, genesisData[moduleName]) @@ -528,6 +576,12 @@ func (m *Manager) ExportGenesisForModules(ctx sdk.Context, cdc codec.JSONCodec, ctx := ctx.WithGasMeter(storetypes.NewInfiniteGasMeter()) // avoid race conditions ch <- genesisResult{module.ExportGenesis(ctx, cdc), nil} }(module, channels[moduleName]) + } else if module, ok := mod.(HasABCIGenesis); ok { + channels[moduleName] = make(chan genesisResult) + go func(module HasABCIGenesis, ch chan genesisResult) { + ctx := ctx.WithGasMeter(storetypes.NewInfiniteGasMeter()) // avoid race conditions + ch <- genesisResult{module.ExportGenesis(ctx, cdc), nil} + }(module, channels[moduleName]) } } @@ -535,7 +589,7 @@ func (m *Manager) ExportGenesisForModules(ctx sdk.Context, cdc codec.JSONCodec, for moduleName := range channels { res := <-channels[moduleName] if res.err != nil { - return nil, res.err + return nil, fmt.Errorf("genesis export error in %s: %w", moduleName, res.err) } genesisData[moduleName] = res.bz @@ -555,9 +609,9 @@ func (m *Manager) checkModulesExists(moduleName []string) error { return nil } -// assertNoForgottenModules checks that we didn't forget any modules in the -// SetOrder* functions. -// `pass` is a closure which allows one to omit modules from `moduleNames`. If you provide non-nil `pass` and it returns true, the module would not be subject of the assertion. +// assertNoForgottenModules checks that we didn't forget any modules in the SetOrder* functions. +// `pass` is a closure which allows one to omit modules from `moduleNames`. +// If you provide non-nil `pass` and it returns true, the module would not be subject of the assertion. func (m *Manager) assertNoForgottenModules(setOrderFnName string, moduleNames []string, pass func(moduleName string) bool) { ms := make(map[string]bool) for _, m := range moduleNames { @@ -674,6 +728,9 @@ func (m Manager) RunMigrations(ctx context.Context, cfg Configurator, fromVM Ver } else { sdkCtx.Logger().Info(fmt.Sprintf("adding a new module: %s", moduleName)) if module, ok := m.Modules[moduleName].(HasGenesis); ok { + module.InitGenesis(sdkCtx, c.cdc, module.DefaultGenesis(c.cdc)) + } + if module, ok := m.Modules[moduleName].(HasABCIGenesis); ok { moduleValUpdates := module.InitGenesis(sdkCtx, c.cdc, module.DefaultGenesis(c.cdc)) // The module manager assumes only one module will update the // validator set, and it can't be a new module. @@ -689,16 +746,35 @@ func (m Manager) RunMigrations(ctx context.Context, cfg Configurator, fromVM Ver return updatedVM, nil } +// PreBlock performs begin block functionality for upgrade module. +// It takes the current context as a parameter and returns a boolean value +// indicating whether the migration was successfully executed or not. +func (m *Manager) PreBlock(ctx sdk.Context) (*sdk.ResponsePreBlock, error) { + paramsChanged := false + for _, moduleName := range m.OrderPreBlockers { + if module, ok := m.Modules[moduleName].(appmodule.HasPreBlocker); ok { + rsp, err := module.PreBlock(ctx) + if err != nil { + return nil, err + } + if rsp.IsConsensusParamsChanged() { + paramsChanged = true + } + } + } + return &sdk.ResponsePreBlock{ + ConsensusParamsChanged: paramsChanged, + }, nil +} + // BeginBlock performs begin block functionality for all modules. It creates a // child context with an event manager to aggregate events emitted from all // modules. func (m *Manager) BeginBlock(ctx sdk.Context) (sdk.BeginBlock, error) { ctx = ctx.WithEventManager(sdk.NewEventManager()) - for _, moduleName := range m.OrderBeginBlockers { if module, ok := m.Modules[moduleName].(appmodule.HasBeginBlocker); ok { - err := module.BeginBlock(ctx) - if err != nil { + if err := module.BeginBlock(ctx); err != nil { return sdk.BeginBlock{}, err } } @@ -722,7 +798,7 @@ func (m *Manager) EndBlock(ctx sdk.Context) (sdk.EndBlock, error) { if err != nil { return sdk.EndBlock{}, err } - } else if module, ok := m.Modules[moduleName].(HasABCIEndblock); ok { + } else if module, ok := m.Modules[moduleName].(HasABCIEndBlock); ok { moduleValUpdates, err := module.EndBlock(ctx) if err != nil { return sdk.EndBlock{}, err @@ -794,7 +870,7 @@ func (m *Manager) GetVersionMap() VersionMap { // ModuleNames returns list of all module names, without any particular order. func (m *Manager) ModuleNames() []string { - return maps.Keys(m.Modules) + return slices.Collect(maps.Keys(m.Modules)) } // DefaultMigrationsOrder returns a default migrations order: ascending alphabetical by module name, diff --git a/types/module/module_test.go b/types/module/module_test.go index 48769cd325e7..263314da95c7 100644 --- a/types/module/module_test.go +++ b/types/module/module_test.go @@ -7,15 +7,16 @@ import ( "io" "testing" - "cosmossdk.io/core/appmodule" - "cosmossdk.io/log" abci "github.com/cometbft/cometbft/abci/types" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" - "github.com/golang/mock/gomock" "github.com/spf13/cobra" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "google.golang.org/grpc" + "cosmossdk.io/core/appmodule" + "cosmossdk.io/log" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/testutil/mock" @@ -26,6 +27,12 @@ import ( var errFoo = errors.New("dummy") +func (MockCoreAppModule) GetQueryCmd() *cobra.Command { + return &cobra.Command{ + Use: "foo", + } +} + func TestBasicManager(t *testing.T) { mockCtrl := gomock.NewController(t) t.Cleanup(mockCtrl.Finish) @@ -51,8 +58,6 @@ func TestBasicManager(t *testing.T) { mockAppModuleBasic1.EXPECT().ValidateGenesis(gomock.Eq(cdc), gomock.Eq(nil), gomock.Eq(expDefaultGenesis["mockAppModuleBasic1"])).AnyTimes().Return(nil) mockAppModuleBasic1.EXPECT().RegisterLegacyAminoCodec(gomock.Eq(legacyAmino)).Times(1) mockAppModuleBasic1.EXPECT().RegisterInterfaces(gomock.Eq(interfaceRegistry)).Times(1) - mockAppModuleBasic1.EXPECT().GetTxCmd().Times(1).Return(nil) - mockAppModuleBasic1.EXPECT().GetQueryCmd().Times(1).Return(nil) // mock core API module mockCoreAppModule2 := mock.NewMockCoreAppModule(mockCtrl) @@ -81,29 +86,17 @@ func TestBasicManager(t *testing.T) { mockCmd := &cobra.Command{Use: "root"} mm.AddTxCommands(mockCmd) - mm.AddQueryCommands(mockCmd) + require.Equal(t, 1, len(mockCmd.Commands())) // validate genesis returns nil require.Nil(t, module.NewBasicManager().ValidateGenesis(cdc, nil, expDefaultGenesis)) } -func TestGenesisOnlyAppModule(t *testing.T) { - mockCtrl := gomock.NewController(t) - t.Cleanup(mockCtrl.Finish) - - mockModule := mock.NewMockAppModuleGenesis(mockCtrl) - mockInvariantRegistry := mock.NewMockInvariantRegistry(mockCtrl) - goam := module.NewGenesisOnlyAppModule(mockModule) - - // no-op - goam.RegisterInvariants(mockInvariantRegistry) -} - func TestAssertNoForgottenModules(t *testing.T) { mockCtrl := gomock.NewController(t) t.Cleanup(mockCtrl.Finish) - mockAppModule1 := mock.NewMockHasABCIEndblock(mockCtrl) + mockAppModule1 := mock.NewMockHasABCIEndBlock(mockCtrl) mockAppModule3 := mock.NewMockCoreAppModule(mockCtrl) mockAppModule1.EXPECT().Name().Times(2).Return("module1") @@ -151,6 +144,10 @@ func TestManagerOrderSetters(t *testing.T) { mm.SetOrderExportGenesis("module2", "module1", "module3") require.Equal(t, []string{"module2", "module1", "module3"}, mm.OrderExportGenesis) + require.Equal(t, []string{}, mm.OrderPreBlockers) + mm.SetOrderPreBlockers("module2", "module1", "module3") + require.Equal(t, []string{"module2", "module1", "module3"}, mm.OrderPreBlockers) + require.Equal(t, []string{"module1", "module2", "module3"}, mm.OrderBeginBlockers) mm.SetOrderBeginBlockers("module2", "module1", "module3") require.Equal(t, []string{"module2", "module1", "module3"}, mm.OrderBeginBlockers) @@ -168,27 +165,6 @@ func TestManagerOrderSetters(t *testing.T) { require.Equal(t, []string{"module3", "module2", "module1"}, mm.OrderPrecommiters) } -func TestManager_RegisterInvariants(t *testing.T) { - mockCtrl := gomock.NewController(t) - t.Cleanup(mockCtrl.Finish) - - mockAppModule1 := mock.NewMockAppModuleWithAllExtensions(mockCtrl) - mockAppModule2 := mock.NewMockAppModuleWithAllExtensions(mockCtrl) - mockAppModule3 := mock.NewMockCoreAppModule(mockCtrl) - mockAppModule1.EXPECT().Name().Times(2).Return("module1") - mockAppModule2.EXPECT().Name().Times(2).Return("module2") - // TODO: This is not working for Core API modules yet - mm := module.NewManager(mockAppModule1, mockAppModule2, module.CoreAppModuleBasicAdaptor("mockAppModule3", mockAppModule3)) - require.NotNil(t, mm) - require.Equal(t, 3, len(mm.Modules)) - - // test RegisterInvariants - mockInvariantRegistry := mock.NewMockInvariantRegistry(mockCtrl) - mockAppModule1.EXPECT().RegisterInvariants(gomock.Eq(mockInvariantRegistry)).Times(1) - mockAppModule2.EXPECT().RegisterInvariants(gomock.Eq(mockInvariantRegistry)).Times(1) - mm.RegisterInvariants(mockInvariantRegistry) -} - func TestManager_RegisterQueryServices(t *testing.T) { mockCtrl := gomock.NewController(t) t.Cleanup(mockCtrl.Finish) @@ -225,7 +201,7 @@ func TestManager_InitGenesis(t *testing.T) { mockAppModule2 := mock.NewMockAppModuleWithAllExtensions(mockCtrl) mockAppModule3 := mock.NewMockCoreAppModule(mockCtrl) mockAppModule1.EXPECT().Name().Times(2).Return("module1") - mockAppModule2.EXPECT().Name().Times(2).Return("module2") + mockAppModule2.EXPECT().Name().Times(4).Return("module2") mm := module.NewManager(mockAppModule1, mockAppModule2, module.CoreAppModuleBasicAdaptor("module3", mockAppModule3)) require.NotNil(t, mm) require.Equal(t, 3, len(mm.Modules)) @@ -236,7 +212,7 @@ func TestManager_InitGenesis(t *testing.T) { genesisData := map[string]json.RawMessage{"module1": json.RawMessage(`{"key": "value"}`)} // this should panic since the validator set is empty even after init genesis - mockAppModule1.EXPECT().InitGenesis(gomock.Eq(ctx), gomock.Eq(cdc), gomock.Eq(genesisData["module1"])).Times(1).Return(nil) + mockAppModule1.EXPECT().InitGenesis(gomock.Eq(ctx), gomock.Eq(cdc), gomock.Eq(genesisData["module1"])).Times(1) _, err := mm.InitGenesis(ctx, cdc, genesisData) require.ErrorContains(t, err, "validator set is empty after InitGenesis") @@ -247,17 +223,24 @@ func TestManager_InitGenesis(t *testing.T) { "module3": json.RawMessage(`{"key": "value"}`), } + mockAppModuleABCI1 := mock.NewMockAppModuleWithAllExtensionsABCI(mockCtrl) + mockAppModuleABCI2 := mock.NewMockAppModuleWithAllExtensionsABCI(mockCtrl) + mockAppModuleABCI1.EXPECT().Name().Times(4).Return("module1") + mockAppModuleABCI2.EXPECT().Name().Times(2).Return("module2") + mmABCI := module.NewManager(mockAppModuleABCI1, mockAppModuleABCI2) // panic because more than one module returns validator set updates - mockAppModule1.EXPECT().InitGenesis(gomock.Eq(ctx), gomock.Eq(cdc), gomock.Eq(genesisData["module1"])).Times(1).Return([]abci.ValidatorUpdate{{}}) - mockAppModule2.EXPECT().InitGenesis(gomock.Eq(ctx), gomock.Eq(cdc), gomock.Eq(genesisData["module2"])).Times(1).Return([]abci.ValidatorUpdate{{}}) - _, err = mm.InitGenesis(ctx, cdc, genesisData) + mockAppModuleABCI1.EXPECT().InitGenesis(gomock.Eq(ctx), gomock.Eq(cdc), gomock.Eq(genesisData["module1"])).Times(1).Return([]abci.ValidatorUpdate{{}}) + mockAppModuleABCI2.EXPECT().InitGenesis(gomock.Eq(ctx), gomock.Eq(cdc), gomock.Eq(genesisData["module2"])).Times(1).Return([]abci.ValidatorUpdate{{}}) + _, err = mmABCI.InitGenesis(ctx, cdc, genesisData) require.ErrorContains(t, err, "validator InitGenesis updates already set by a previous module") // happy path - mockAppModule1.EXPECT().InitGenesis(gomock.Eq(ctx), gomock.Eq(cdc), gomock.Eq(genesisData["module1"])).Times(1).Return([]abci.ValidatorUpdate{{}}) - mockAppModule2.EXPECT().InitGenesis(gomock.Eq(ctx), gomock.Eq(cdc), gomock.Eq(genesisData["module2"])).Times(1).Return([]abci.ValidatorUpdate{}) + + mm2 := module.NewManager(mockAppModuleABCI1, mockAppModule2, module.CoreAppModuleBasicAdaptor("module3", mockAppModule3)) + mockAppModuleABCI1.EXPECT().InitGenesis(gomock.Eq(ctx), gomock.Eq(cdc), gomock.Eq(genesisData["module1"])).Times(1).Return([]abci.ValidatorUpdate{{}}) + mockAppModule2.EXPECT().InitGenesis(gomock.Eq(ctx), gomock.Eq(cdc), gomock.Eq(genesisData["module2"])).Times(1) mockAppModule3.EXPECT().InitGenesis(gomock.Eq(ctx), gomock.Any()).Times(1).Return(nil) - _, err = mm.InitGenesis(ctx, cdc, genesisData) + _, err = mm2.InitGenesis(ctx, cdc, genesisData) require.NoError(t, err) } @@ -312,8 +295,8 @@ func TestManager_EndBlock(t *testing.T) { mockCtrl := gomock.NewController(t) t.Cleanup(mockCtrl.Finish) - mockAppModule1 := mock.NewMockHasABCIEndblock(mockCtrl) - mockAppModule2 := mock.NewMockHasABCIEndblock(mockCtrl) + mockAppModule1 := mock.NewMockHasABCIEndBlock(mockCtrl) + mockAppModule2 := mock.NewMockHasABCIEndBlock(mockCtrl) mockAppModule3 := mock.NewMockAppModule(mockCtrl) mockAppModule1.EXPECT().Name().Times(2).Return("module1") mockAppModule2.EXPECT().Name().Times(2).Return("module2") @@ -440,6 +423,10 @@ func TestCoreAPIManagerOrderSetters(t *testing.T) { mm.SetOrderExportGenesis("module2", "module1", "module3") require.Equal(t, []string{"module2", "module1", "module3"}, mm.OrderExportGenesis) + require.Equal(t, []string{}, mm.OrderPreBlockers) + mm.SetOrderPreBlockers("module2", "module1", "module3") + require.Equal(t, []string{"module2", "module1", "module3"}, mm.OrderPreBlockers) + require.Equal(t, []string{"module1", "module2", "module3"}, mm.OrderBeginBlockers) mm.SetOrderBeginBlockers("module2", "module1", "module3") require.Equal(t, []string{"module2", "module1", "module3"}, mm.OrderBeginBlockers) @@ -457,6 +444,40 @@ func TestCoreAPIManagerOrderSetters(t *testing.T) { require.Equal(t, []string{"module3", "module2", "module1"}, mm.OrderPrecommiters) } +func TestCoreAPIManager_PreBlock(t *testing.T) { + mockCtrl := gomock.NewController(t) + t.Cleanup(mockCtrl.Finish) + + mockAppModule1 := mock.NewMockCoreAppModuleWithPreBlock(mockCtrl) + mm := module.NewManagerFromMap(map[string]appmodule.AppModule{ + "module1": mockAppModule1, + "module2": mock.NewMockCoreAppModule(mockCtrl), + }) + require.NotNil(t, mm) + require.Equal(t, 2, len(mm.Modules)) + require.Equal(t, 1, len(mm.OrderPreBlockers)) + + mockAppModule1.EXPECT().PreBlock(gomock.Any()).Times(1).Return(&sdk.ResponsePreBlock{ + ConsensusParamsChanged: true, + }, nil) + res, err := mm.PreBlock(sdk.Context{}) + require.NoError(t, err) + require.True(t, res.ConsensusParamsChanged) + + // test false + mockAppModule1.EXPECT().PreBlock(gomock.Any()).Times(1).Return(&sdk.ResponsePreBlock{ + ConsensusParamsChanged: false, + }, nil) + res, err = mm.PreBlock(sdk.Context{}) + require.NoError(t, err) + require.False(t, res.ConsensusParamsChanged) + + // test error + mockAppModule1.EXPECT().PreBlock(gomock.Any()).Times(1).Return(nil, errors.New("some error")) + _, err = mm.PreBlock(sdk.Context{}) + require.EqualError(t, err, "some error") +} + func TestCoreAPIManager_BeginBlock(t *testing.T) { mockCtrl := gomock.NewController(t) t.Cleanup(mockCtrl.Finish) diff --git a/types/module/simulation.go b/types/module/simulation.go index 79ac42c99d3a..657bbfa2c2eb 100644 --- a/types/module/simulation.go +++ b/types/module/simulation.go @@ -7,6 +7,7 @@ import ( "time" sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types/simulation" diff --git a/types/msgservice/validate.go b/types/msgservice/validate.go index 77f85193a810..49a183eb89ad 100644 --- a/types/msgservice/validate.go +++ b/types/msgservice/validate.go @@ -9,7 +9,6 @@ import ( "google.golang.org/protobuf/reflect/protoregistry" msg "cosmossdk.io/api/cosmos/msg/v1" - "cosmossdk.io/x/tx/signing" ) diff --git a/types/query/collections_pagination.go b/types/query/collections_pagination.go index 4ef389038dc6..1c9babcc6af1 100644 --- a/types/query/collections_pagination.go +++ b/types/query/collections_pagination.go @@ -35,24 +35,40 @@ type Collection[K, V any] interface { KeyCodec() collcodec.KeyCodec[K] } -// CollectionPaginate follows the same behavior as Paginate but works on a Collection. -func CollectionPaginate[K, V any, C Collection[K, V]]( +// CollectionPaginate follows the same logic as Paginate but for collection types. +// transformFunc is used to transform the result to a different type. +func CollectionPaginate[K, V any, C Collection[K, V], T any]( ctx context.Context, coll C, pageReq *PageRequest, -) ([]collections.KeyValue[K, V], *PageResponse, error) { - return CollectionFilteredPaginate[K, V](ctx, coll, pageReq, nil) + transformFunc func(key K, value V) (T, error), + opts ...func(opt *CollectionsPaginateOptions[K]), +) ([]T, *PageResponse, error) { + return CollectionFilteredPaginate( + ctx, + coll, + pageReq, + nil, + transformFunc, + opts..., + ) } -// CollectionFilteredPaginate works in the same way as FilteredPaginate but for collection types. +// CollectionFilteredPaginate works in the same way as CollectionPaginate but allows to filter +// results using a predicateFunc. // A nil predicateFunc means no filtering is applied and results are collected as is. -func CollectionFilteredPaginate[K, V any, C Collection[K, V]]( +// TransformFunc is applied only to results which are in range of the pagination and allow +// to convert the result to a different type. +// NOTE: do not collect results using the values/keys passed to predicateFunc as they are not +// guaranteed to be in the pagination range requested. +func CollectionFilteredPaginate[K, V any, C Collection[K, V], T any]( ctx context.Context, coll C, pageReq *PageRequest, predicateFunc func(key K, value V) (include bool, err error), + transformFunc func(key K, value V) (T, error), opts ...func(opt *CollectionsPaginateOptions[K]), -) ([]collections.KeyValue[K, V], *PageResponse, error) { +) (results []T, pageRes *PageResponse, err error) { pageReq = initPageRequestDefaults(pageReq) offset := pageReq.Offset @@ -65,12 +81,6 @@ func CollectionFilteredPaginate[K, V any, C Collection[K, V]]( return nil, nil, fmt.Errorf("invalid request, either offset or key is expected, got both") } - var ( - results []collections.KeyValue[K, V] - pageRes *PageResponse - err error - ) - opt := new(CollectionsPaginateOptions[K]) for _, o := range opts { o(opt) @@ -85,16 +95,16 @@ func CollectionFilteredPaginate[K, V any, C Collection[K, V]]( } if len(key) != 0 { - results, pageRes, err = collFilteredPaginateByKey(ctx, coll, prefix, key, reverse, limit, predicateFunc) + results, pageRes, err = collFilteredPaginateByKey(ctx, coll, prefix, key, reverse, limit, predicateFunc, transformFunc) } else { - results, pageRes, err = collFilteredPaginateNoKey(ctx, coll, prefix, reverse, offset, limit, countTotal, predicateFunc) + results, pageRes, err = collFilteredPaginateNoKey(ctx, coll, prefix, reverse, offset, limit, countTotal, predicateFunc, transformFunc) } // invalid iter error is ignored to retain Paginate behavior if errors.Is(err, collections.ErrInvalidIterator) { return results, new(PageResponse), nil } // strip the prefix from next key - if len(pageRes.NextKey) != 0 && prefix != nil { + if pageRes != nil && len(pageRes.NextKey) != 0 && prefix != nil { pageRes.NextKey = pageRes.NextKey[len(prefix):] } return results, pageRes, err @@ -102,7 +112,7 @@ func CollectionFilteredPaginate[K, V any, C Collection[K, V]]( // collFilteredPaginateNoKey applies the provided pagination on the collection when the starting key is not set. // If predicateFunc is nil no filtering is applied. -func collFilteredPaginateNoKey[K, V any, C Collection[K, V]]( +func collFilteredPaginateNoKey[K, V any, C Collection[K, V], T any]( ctx context.Context, coll C, prefix []byte, @@ -111,7 +121,8 @@ func collFilteredPaginateNoKey[K, V any, C Collection[K, V]]( limit uint64, countTotal bool, predicateFunc func(K, V) (bool, error), -) ([]collections.KeyValue[K, V], *PageResponse, error) { + transformFunc func(K, V) (T, error), +) ([]T, *PageResponse, error) { iterator, err := getCollIter[K, V](ctx, coll, prefix, nil, reverse) if err != nil { return nil, nil, err @@ -125,7 +136,7 @@ func collFilteredPaginateNoKey[K, V any, C Collection[K, V]]( var ( count uint64 nextKey []byte - results []collections.KeyValue[K, V] + results []T ) for ; iterator.Valid(); iterator.Next() { @@ -138,7 +149,13 @@ func collFilteredPaginateNoKey[K, V any, C Collection[K, V]]( } // if no predicate function is specified then we just include the result if predicateFunc == nil { - results = append(results, kv) + transformed, err := transformFunc(kv.Key, kv.Value) + if err != nil { + return nil, nil, err + } + results = append(results, transformed) + count++ + // if predicate function is defined we check if the result matches the filtering criteria } else { include, err := predicateFunc(kv.Key, kv.Value) @@ -146,10 +163,14 @@ func collFilteredPaginateNoKey[K, V any, C Collection[K, V]]( return nil, nil, err } if include { - results = append(results, kv) + transformed, err := transformFunc(kv.Key, kv.Value) + if err != nil { + return nil, nil, err + } + results = append(results, transformed) + count++ } } - count++ // second case, we found all the objects specified within the limit case count == limit: key, err := iterator.Key() @@ -172,12 +193,31 @@ func collFilteredPaginateNoKey[K, V any, C Collection[K, V]]( // but we need to count how many possible results exist in total. // so we keep increasing the count until the iterator is fully consumed. case count > limit: - count++ + if predicateFunc == nil { + count++ + + // if predicate function is defined we check if the result matches the filtering criteria + } else { + kv, err := iterator.KeyValue() + if err != nil { + return nil, nil, err + } + + include, err := predicateFunc(kv.Key, kv.Value) + if err != nil { + return nil, nil, err + } + if include { + count++ + } + } } } + resp := &PageResponse{ NextKey: nextKey, } + if countTotal { resp.Total = count + offset } @@ -200,15 +240,16 @@ func advanceIter[I interface { // collFilteredPaginateByKey paginates a collection when a starting key // is provided in the PageRequest. Predicate is applied only if not nil. -func collFilteredPaginateByKey[K, V any, C Collection[K, V]]( +func collFilteredPaginateByKey[K, V any, C Collection[K, V], T any]( ctx context.Context, coll C, prefix []byte, key []byte, reverse bool, limit uint64, - predicateFunc func(K, V) (bool, error), -) ([]collections.KeyValue[K, V], *PageResponse, error) { + predicateFunc func(key K, value V) (bool, error), + transformFunc func(key K, value V) (transformed T, err error), +) (results []T, pageRes *PageResponse, err error) { iterator, err := getCollIter[K, V](ctx, coll, prefix, key, reverse) if err != nil { return nil, nil, err @@ -216,46 +257,59 @@ func collFilteredPaginateByKey[K, V any, C Collection[K, V]]( defer iterator.Close() var ( - count uint64 - nextKey []byte - results []collections.KeyValue[K, V] + count uint64 + nextKey []byte + transformed T ) for ; iterator.Valid(); iterator.Next() { - // if we reached the specified limit - // then we get the next key, and we exit the iteration. - if count == limit { - concreteKey, err := iterator.Key() - if err != nil { - return nil, nil, err - } - - nextKey, err = encodeCollKey[K, V](coll, concreteKey) - if err != nil { - return nil, nil, err - } - break - } - kv, err := iterator.KeyValue() if err != nil { return nil, nil, err } + + include := false // if no predicate is specified then we just append the result if predicateFunc == nil { - results = append(results, kv) + transformed, err = transformFunc(kv.Key, kv.Value) + if err != nil { + return nil, nil, err + } + include = true // if predicate is applied we execute the predicate function // and append only if predicateFunc yields true. } else { - include, err := predicateFunc(kv.Key, kv.Value) + include, err = predicateFunc(kv.Key, kv.Value) if err != nil { return nil, nil, err } if include { - results = append(results, kv) + transformed, err = transformFunc(kv.Key, kv.Value) + if err != nil { + return nil, nil, err + } } } - count++ + + if include { + // if we reached the specified limit + // then we get the next key, and we exit the iteration. + if count == limit { + concreteKey, err := iterator.Key() + if err != nil { + return nil, nil, err + } + + nextKey, err = encodeCollKey[K, V](coll, concreteKey) + if err != nil { + return nil, nil, err + } + break + } + + results = append(results, transformed) + count++ + } } return results, &PageResponse{ @@ -273,11 +327,11 @@ func encodeCollKey[K, V any, C Collection[K, V]](coll C, key K) ([]byte, error) func getCollIter[K, V any, C Collection[K, V]](ctx context.Context, coll C, prefix, start []byte, reverse bool) (collections.Iterator[K, V], error) { // TODO: maybe can be simplified if reverse { - var end []byte - if prefix != nil { - start = storetypes.PrefixEndBytes(append(prefix, start...)) - end = prefix - } + // if we are in reverse mode, we need to increase the start key + // to include the start key in the iteration. + start = storetypes.PrefixEndBytes(append(prefix, start...)) + end := prefix + return coll.IterateRaw(ctx, end, start, collections.OrderDescending) } var end []byte diff --git a/types/query/collections_pagination_test.go b/types/query/collections_pagination_test.go index ebce41a4f22e..365b44cc68d4 100644 --- a/types/query/collections_pagination_test.go +++ b/types/query/collections_pagination_test.go @@ -2,18 +2,21 @@ package query import ( "context" + "errors" "testing" - "cosmossdk.io/collections" - "cosmossdk.io/core/store" db "github.com/cosmos/cosmos-db" "github.com/stretchr/testify/require" + + "cosmossdk.io/collections" + "cosmossdk.io/core/store" ) func TestCollectionPagination(t *testing.T) { sk, ctx := deps() sb := collections.NewSchemaBuilder(sk) m := collections.NewMap(sb, collections.NewPrefix(0), "_", collections.Uint64Key, collections.Uint64Value) + dummyErr := errors.New("dummy error") for i := uint64(0); i < 300; i++ { require.NoError(t, m.Set(ctx, i, i)) @@ -82,6 +85,16 @@ func TestCollectionPagination(t *testing.T) { }, expResults: createResults(299, 200), }, + "with key and reverse": { + req: &PageRequest{ + Key: encodeKey(199), + Reverse: true, + }, + expResp: &PageResponse{ + NextKey: encodeKey(99), + }, + expResults: createResults(199, 100), + }, "with offset and count total": { req: &PageRequest{ Offset: 50, @@ -99,7 +112,7 @@ func TestCollectionPagination(t *testing.T) { Limit: 3, }, expResp: &PageResponse{ - NextKey: encodeKey(3), + NextKey: encodeKey(5), }, filter: func(key, value uint64) (bool, error) { return key%2 == 0, nil @@ -107,6 +120,7 @@ func TestCollectionPagination(t *testing.T) { expResults: []collections.KeyValue[uint64, uint64]{ {Key: 0, Value: 0}, {Key: 2, Value: 2}, + {Key: 4, Value: 4}, }, }, "filtered with key": { @@ -115,7 +129,7 @@ func TestCollectionPagination(t *testing.T) { Limit: 3, }, expResp: &PageResponse{ - NextKey: encodeKey(5), + NextKey: encodeKey(8), }, filter: func(key, value uint64) (bool, error) { return key%2 == 0, nil @@ -123,14 +137,49 @@ func TestCollectionPagination(t *testing.T) { expResults: []collections.KeyValue[uint64, uint64]{ {Key: 2, Value: 2}, {Key: 4, Value: 4}, + {Key: 6, Value: 6}, + }, + }, + "filtered with key and empty next key in response": { + req: &PageRequest{ + Key: encodeKey(295), + }, + expResp: &PageResponse{ + NextKey: nil, + }, + filter: func(key, value uint64) (bool, error) { + return key%5 == 0, nil + }, + expResults: []collections.KeyValue[uint64, uint64]{ + {Key: 295, Value: 295}, + }, + }, + "filtered no key with error": { + req: &PageRequest{ + Limit: 3, + }, + expResp: &PageResponse{ + NextKey: encodeKey(5), + }, + filter: func(key, value uint64) (bool, error) { + return false, dummyErr }, + wantErr: dummyErr, }, } for name, tc := range tcs { tc := tc t.Run(name, func(t *testing.T) { - gotResults, gotResponse, err := CollectionFilteredPaginate(ctx, m, tc.req, tc.filter) + gotResults, gotResponse, err := CollectionFilteredPaginate( + ctx, + m, + tc.req, + tc.filter, + func(key, value uint64) (collections.KeyValue[uint64, uint64], error) { + return collections.KeyValue[uint64, uint64]{Key: key, Value: value}, nil + }, + ) if tc.wantErr != nil { require.ErrorIs(t, err, tc.wantErr) return diff --git a/types/query/filtered_pagination.go b/types/query/filtered_pagination.go index b5730693c25a..af2d2dd176e4 100644 --- a/types/query/filtered_pagination.go +++ b/types/query/filtered_pagination.go @@ -3,9 +3,10 @@ package query import ( "fmt" - "cosmossdk.io/store/types" proto "github.com/cosmos/gogoproto/proto" + "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/codec" ) diff --git a/types/query/fuzz_test.go b/types/query/fuzz_test.go index 2082e6e2a7fa..8df5f1a0201a 100644 --- a/types/query/fuzz_test.go +++ b/types/query/fuzz_test.go @@ -4,9 +4,9 @@ import ( "fmt" "testing" - "cosmossdk.io/math" fuzz "github.com/google/gofuzz" + "cosmossdk.io/math" "cosmossdk.io/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/types/query/pagination_test.go b/types/query/pagination_test.go index 7f3c5d846103..13fbe98efa8a 100644 --- a/types/query/pagination_test.go +++ b/types/query/pagination_test.go @@ -5,12 +5,12 @@ import ( "fmt" "testing" - "cosmossdk.io/depinject" - "cosmossdk.io/log" - "cosmossdk.io/math" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/suite" + "cosmossdk.io/depinject" + "cosmossdk.io/log" + "cosmossdk.io/math" "cosmossdk.io/store/prefix" "github.com/cosmos/cosmos-sdk/baseapp" diff --git a/types/result.go b/types/result.go index 46ff994f8295..ea3d491025fa 100644 --- a/types/result.go +++ b/types/result.go @@ -6,11 +6,10 @@ import ( "strings" abci "github.com/cometbft/cometbft/abci/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" coretypes "github.com/cometbft/cometbft/rpc/core/types" "github.com/cosmos/gogoproto/proto" - cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" ) diff --git a/types/result_test.go b/types/result_test.go index 210e85370b4b..5911bda5b972 100644 --- a/types/result_test.go +++ b/types/result_test.go @@ -8,13 +8,13 @@ import ( "time" abci "github.com/cometbft/cometbft/abci/types" + cmtt "github.com/cometbft/cometbft/proto/tendermint/types" coretypes "github.com/cometbft/cometbft/rpc/core/types" + cmt "github.com/cometbft/cometbft/types" "github.com/golang/protobuf/proto" //nolint:staticcheck // grpc-gateway uses deprecated golang/protobuf "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - cmtt "github.com/cometbft/cometbft/proto/tendermint/types" - cmt "github.com/cometbft/cometbft/types" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/types/simulation/collections_test.go b/types/simulation/collections_test.go index 8c2e2f6cf88d..3f94910d2eb9 100644 --- a/types/simulation/collections_test.go +++ b/types/simulation/collections_test.go @@ -3,10 +3,12 @@ package simulation import ( "testing" + "github.com/stretchr/testify/require" + "cosmossdk.io/collections" "cosmossdk.io/collections/colltest" + "github.com/cosmos/cosmos-sdk/types/kv" - "github.com/stretchr/testify/require" ) func TestNewStoreDecoderFuncFromCollectionsSchema(t *testing.T) { diff --git a/types/simulation/config.go b/types/simulation/config.go index 7f520004d478..4ed9530a92bc 100644 --- a/types/simulation/config.go +++ b/types/simulation/config.go @@ -22,5 +22,6 @@ type Config struct { OnOperation bool // run slow invariants every operation AllInvariants bool // print all failed invariants if a broken invariant is found - DBBackend string // custom db backend type + DBBackend string // custom db backend type + BlockMaxGas int64 // custom max gas for block } diff --git a/types/simulation/rand_util.go b/types/simulation/rand_util.go index 0f8fa11e432b..adacd90ad436 100644 --- a/types/simulation/rand_util.go +++ b/types/simulation/rand_util.go @@ -7,7 +7,7 @@ import ( "time" "unsafe" - sdkmath "cosmossdk.io/math" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -42,19 +42,19 @@ func RandStringOfLength(r *rand.Rand, n int) string { } // RandPositiveInt get a rand positive math.Int -func RandPositiveInt(r *rand.Rand, max sdkmath.Int) (sdkmath.Int, error) { - if !max.GTE(sdkmath.OneInt()) { - return sdkmath.Int{}, errors.New("max too small") +func RandPositiveInt(r *rand.Rand, max math.Int) (math.Int, error) { + if !max.GTE(math.OneInt()) { + return math.Int{}, errors.New("max too small") } - max = max.Sub(sdkmath.OneInt()) + max = max.Sub(math.OneInt()) - return sdkmath.NewIntFromBigInt(new(big.Int).Rand(r, max.BigInt())).Add(sdkmath.OneInt()), nil + return math.NewIntFromBigInt(new(big.Int).Rand(r, max.BigInt())).Add(math.OneInt()), nil } // RandomAmount generates a random amount // Note: The range of RandomAmount includes max, and is, in fact, biased to return max as well as 0. -func RandomAmount(r *rand.Rand, max sdkmath.Int) sdkmath.Int { +func RandomAmount(r *rand.Rand, max math.Int) math.Int { randInt := big.NewInt(0) switch r.Intn(10) { @@ -66,12 +66,12 @@ func RandomAmount(r *rand.Rand, max sdkmath.Int) sdkmath.Int { randInt = big.NewInt(0).Rand(r, max.BigInt()) // up to max - 1 } - return sdkmath.NewIntFromBigInt(randInt) + return math.NewIntFromBigInt(randInt) } // RandomDecAmount generates a random decimal amount // Note: The range of RandomDecAmount includes max, and is, in fact, biased to return max as well as 0. -func RandomDecAmount(r *rand.Rand, max sdkmath.LegacyDec) sdkmath.LegacyDec { +func RandomDecAmount(r *rand.Rand, max math.LegacyDec) math.LegacyDec { randInt := big.NewInt(0) switch r.Intn(10) { @@ -83,7 +83,7 @@ func RandomDecAmount(r *rand.Rand, max sdkmath.LegacyDec) sdkmath.LegacyDec { randInt = big.NewInt(0).Rand(r, max.BigInt()) } - return sdkmath.LegacyNewDecFromBigIntWithPrec(randInt, sdkmath.LegacyPrecision) + return math.LegacyNewDecFromBigIntWithPrec(randInt, math.LegacyPrecision) } // RandTimestamp generates a random timestamp diff --git a/types/staking_test.go b/types/staking_test.go index fe6c36bd991b..4a68df6b619f 100644 --- a/types/staking_test.go +++ b/types/staking_test.go @@ -5,6 +5,8 @@ import ( "github.com/stretchr/testify/suite" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -21,6 +23,6 @@ func (s *stakingTestSuite) SetupSuite() { } func (s *stakingTestSuite) TestTokensToConsensusPower() { - s.Require().Equal(int64(0), sdk.TokensToConsensusPower(sdk.NewInt(999_999), sdk.DefaultPowerReduction)) - s.Require().Equal(int64(1), sdk.TokensToConsensusPower(sdk.NewInt(1_000_000), sdk.DefaultPowerReduction)) + s.Require().Equal(int64(0), sdk.TokensToConsensusPower(math.NewInt(999_999), sdk.DefaultPowerReduction)) + s.Require().Equal(int64(1), sdk.TokensToConsensusPower(math.NewInt(1_000_000), sdk.DefaultPowerReduction)) } diff --git a/types/tx/direct_aux.go b/types/tx/direct_aux.go index 73189ff840c5..de6346fbf03c 100644 --- a/types/tx/direct_aux.go +++ b/types/tx/direct_aux.go @@ -17,12 +17,6 @@ func (s *SignDocDirectAux) ValidateBasic() error { return sdkerrors.ErrInvalidPubKey.Wrap("public key cannot be empty") } - if s.Tip != nil { - if s.Tip.Tipper == "" { - return sdkerrors.ErrInvalidRequest.Wrap("tipper cannot be empty") - } - } - return nil } diff --git a/types/tx/direct_aux_test.go b/types/tx/direct_aux_test.go index 5f8c7aefc335..f9e90b8e27e7 100644 --- a/types/tx/direct_aux_test.go +++ b/types/tx/direct_aux_test.go @@ -14,7 +14,7 @@ import ( func TestSignDocDirectAux(t *testing.T) { bodyBz := []byte{42} - _, pk, addr := testdata.KeyTestPubAddr() + _, pk, _ := testdata.KeyTestPubAddr() pkAny, err := codectypes.NewAnyWithValue(pk) require.NoError(t, err) @@ -25,12 +25,10 @@ func TestSignDocDirectAux(t *testing.T) { }{ {"empty bodyBz", tx.SignDocDirectAux{}, true}, {"empty pubkey", tx.SignDocDirectAux{BodyBytes: bodyBz}, true}, - {"empty tipper", tx.SignDocDirectAux{BodyBytes: bodyBz, PublicKey: pkAny, Tip: &tx.Tip{Amount: testdata.NewTestFeeAmount()}}, true}, {"happy case w/o tip", tx.SignDocDirectAux{BodyBytes: bodyBz, PublicKey: pkAny}, false}, {"happy case w/ tip", tx.SignDocDirectAux{ BodyBytes: bodyBz, PublicKey: pkAny, - Tip: &tx.Tip{Tipper: addr.String(), Amount: testdata.NewTestFeeAmount()}, }, false}, } diff --git a/types/tx/service.pb.go b/types/tx/service.pb.go index 03dccdd83a5c..84ae3d51c8ec 100644 --- a/types/tx/service.pb.go +++ b/types/tx/service.pb.go @@ -1589,6 +1589,7 @@ func _Service_TxDecodeAmino_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +var Service_serviceDesc = _Service_serviceDesc var _Service_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.tx.v1beta1.Service", HandlerType: (*ServiceServer)(nil), diff --git a/types/tx/signing/signing.pb.go b/types/tx/signing/signing.pb.go index 54beb1b1fbf7..6266b113ec9c 100644 --- a/types/tx/signing/signing.pb.go +++ b/types/tx/signing/signing.pb.go @@ -43,14 +43,13 @@ const ( SignMode_SIGN_MODE_DIRECT SignMode = 1 // SIGN_MODE_TEXTUAL is a future signing mode that will verify some // human-readable textual representation on top of the binary representation - // from SIGN_MODE_DIRECT. It is currently experimental, and should be used - // for testing purposes only, until Textual is fully released. Please follow - // the tracking issue https://github.com/cosmos/cosmos-sdk/issues/11970. + // from SIGN_MODE_DIRECT. + // + // Since: cosmos-sdk 0.50 SignMode_SIGN_MODE_TEXTUAL SignMode = 2 // SIGN_MODE_DIRECT_AUX specifies a signing mode which uses // SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not - // require signers signing over other signers' `signer_info`. It also allows - // for adding Tips in transactions. + // require signers signing over other signers' `signer_info`. // // Since: cosmos-sdk 0.46 SignMode_SIGN_MODE_DIRECT_AUX SignMode = 3 diff --git a/types/tx/tips.go b/types/tx/tips.go deleted file mode 100644 index ca8afb36d5ae..000000000000 --- a/types/tx/tips.go +++ /dev/null @@ -1,11 +0,0 @@ -package tx - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// TipTx defines the interface to be implemented by Txs that handle Tips. -type TipTx interface { - sdk.FeeTx - GetTip() *Tip -} diff --git a/types/tx/tx.pb.go b/types/tx/tx.pb.go index 6782890cc9e4..1dcd832b3d4c 100644 --- a/types/tx/tx.pb.go +++ b/types/tx/tx.pb.go @@ -14,15 +14,19 @@ import ( signing "github.com/cosmos/cosmos-sdk/types/tx/signing" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" + time "time" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +var _ = time.Kitchen // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -264,13 +268,8 @@ type SignDocDirectAux struct { AccountNumber uint64 `protobuf:"varint,4,opt,name=account_number,json=accountNumber,proto3" json:"account_number,omitempty"` // sequence is the sequence number of the signing account. Sequence uint64 `protobuf:"varint,5,opt,name=sequence,proto3" json:"sequence,omitempty"` - // Tip is the optional tip used for transactions fees paid in another denom. - // It should be left empty if the signer is not the tipper for this - // transaction. - // - // This field is ignored if the chain didn't enable tips, i.e. didn't add the - // `TipDecorator` in its posthandler. - Tip *Tip `protobuf:"bytes,6,opt,name=tip,proto3" json:"tip,omitempty"` + // tips have been depreacted and should not be used + Tip *Tip `protobuf:"bytes,6,opt,name=tip,proto3" json:"tip,omitempty"` // Deprecated: Do not use. } func (m *SignDocDirectAux) Reset() { *m = SignDocDirectAux{} } @@ -341,6 +340,7 @@ func (m *SignDocDirectAux) GetSequence() uint64 { return 0 } +// Deprecated: Do not use. func (m *SignDocDirectAux) GetTip() *Tip { if m != nil { return m.Tip @@ -360,11 +360,33 @@ type TxBody struct { Messages []*types.Any `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` // memo is any arbitrary note/comment to be added to the transaction. // WARNING: in clients, any publicly exposed text should not be called memo, - // but should be called `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122). + // but should be called `note` instead (see + // https://github.com/cosmos/cosmos-sdk/issues/9122). Memo string `protobuf:"bytes,2,opt,name=memo,proto3" json:"memo,omitempty"` - // timeout is the block height after which this transaction will not - // be processed by the chain + // timeout_height is the block height after which this transaction will not + // be processed by the chain. TimeoutHeight uint64 `protobuf:"varint,3,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height,omitempty"` + // unordered, when set to true, indicates that the transaction signer(s) + // intend for the transaction to be evaluated and executed in an un-ordered + // fashion. Specifically, the account's nonce will NOT be checked or + // incremented, which allows for fire-and-forget as well as concurrent + // transaction execution. + // + // Note, when set to true, the existing 'timeout_timestamp' value must + // be set and will be used to correspond to a timestamp in which the transaction is deemed + // valid. + // + // Since: cosmos-sdk 0.53 + Unordered bool `protobuf:"varint,4,opt,name=unordered,proto3" json:"unordered,omitempty"` + // timeout_timestamp is the block time after which this transaction will not + // be processed by the chain. + // + // Note, if unordered=true this value MUST be set + // and will act as a short-lived TTL in which the transaction is deemed valid + // and kept in memory to prevent duplicates. + // + // Since: cosmos-sdk 0.53 + TimeoutTimestamp *time.Time `protobuf:"bytes,5,opt,name=timeout_timestamp,json=timeoutTimestamp,proto3,stdtime" json:"timeout_timestamp,omitempty"` // extension_options are arbitrary options that can be added by chains // when the default options are not sufficient. If any of these are present // and can't be handled, the transaction will be rejected @@ -429,6 +451,20 @@ func (m *TxBody) GetTimeoutHeight() uint64 { return 0 } +func (m *TxBody) GetUnordered() bool { + if m != nil { + return m.Unordered + } + return false +} + +func (m *TxBody) GetTimeoutTimestamp() *time.Time { + if m != nil { + return m.TimeoutTimestamp + } + return nil +} + func (m *TxBody) GetExtensionOptions() []*types.Any { if m != nil { return m.ExtensionOptions @@ -462,7 +498,7 @@ type AuthInfo struct { // `TipDecorator` in its posthandler. // // Since: cosmos-sdk 0.46 - Tip *Tip `protobuf:"bytes,3,opt,name=tip,proto3" json:"tip,omitempty"` + Tip *Tip `protobuf:"bytes,3,opt,name=tip,proto3" json:"tip,omitempty"` // Deprecated: Do not use. } func (m *AuthInfo) Reset() { *m = AuthInfo{} } @@ -512,6 +548,7 @@ func (m *AuthInfo) GetFee() *Fee { return nil } +// Deprecated: Do not use. func (m *AuthInfo) GetTip() *Tip { if m != nil { return m.Tip @@ -792,13 +829,15 @@ type Fee struct { // gas_limit is the maximum gas that can be used in transaction processing // before an out of gas error occurs GasLimit uint64 `protobuf:"varint,2,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty"` - // if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees. - // the payer must be a tx signer (and thus have signed this field in AuthInfo). - // setting this field does *not* change the ordering of required signers for the transaction. + // if unset, the first signer is responsible for paying the fees. If set, the + // specified account must pay the fees. the payer must be a tx signer (and + // thus have signed this field in AuthInfo). setting this field does *not* + // change the ordering of required signers for the transaction. Payer string `protobuf:"bytes,3,opt,name=payer,proto3" json:"payer,omitempty"` - // if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used - // to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does - // not support fee grants, this will fail + // if set, the fee payer (either the first signer or the value of the payer + // field) requests that a fee grant be used to pay fees instead of the fee + // payer's own balance. If an appropriate fee grant does not exist or the + // chain does not support fee grants, this will fail Granter string `protobuf:"bytes,4,opt,name=granter,proto3" json:"granter,omitempty"` } @@ -866,6 +905,8 @@ func (m *Fee) GetGranter() string { // Tip is the tip used for meta-transactions. // // Since: cosmos-sdk 0.46 +// +// Deprecated: Do not use. type Tip struct { // amount is the amount of the tip Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` @@ -1021,73 +1062,77 @@ func init() { func init() { proto.RegisterFile("cosmos/tx/v1beta1/tx.proto", fileDescriptor_96d1575ffde80842) } var fileDescriptor_96d1575ffde80842 = []byte{ - // 1052 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x55, 0x41, 0x6f, 0x1b, 0xc5, - 0x17, 0xf7, 0x7a, 0x6d, 0xc7, 0x7e, 0x4d, 0xda, 0x64, 0x14, 0xfd, 0xe5, 0x38, 0xaa, 0x9b, 0xbf, - 0xab, 0x82, 0x55, 0x29, 0xbb, 0x6d, 0x7a, 0xa0, 0x20, 0x04, 0xd8, 0x0d, 0x51, 0xaa, 0x52, 0x90, - 0x36, 0x39, 0xf5, 0xb2, 0x1a, 0xaf, 0x27, 0xeb, 0x51, 0xbd, 0x33, 0xcb, 0xce, 0x2c, 0x78, 0x8f, - 0x7c, 0x00, 0xa4, 0x0a, 0x09, 0x21, 0x71, 0xe2, 0x88, 0x38, 0x55, 0x88, 0x0f, 0xd1, 0x13, 0xaa, - 0x38, 0x71, 0x82, 0x2a, 0x39, 0xf4, 0xc6, 0x57, 0x00, 0xcd, 0xec, 0xec, 0x26, 0x2d, 0xa9, 0x0d, - 0x02, 0x89, 0x8b, 0x3d, 0xf3, 0xf6, 0xf7, 0xde, 0xfc, 0xe6, 0xbd, 0xdf, 0xbc, 0x07, 0x9d, 0x80, - 0x8b, 0x88, 0x0b, 0x57, 0xce, 0xdc, 0x4f, 0x6e, 0x8e, 0x88, 0xc4, 0x37, 0x5d, 0x39, 0x73, 0xe2, - 0x84, 0x4b, 0x8e, 0xd6, 0xf2, 0x6f, 0x8e, 0x9c, 0x39, 0xe6, 0x5b, 0x67, 0x0d, 0x47, 0x94, 0x71, - 0x57, 0xff, 0xe6, 0xa8, 0xce, 0x7a, 0xc8, 0x43, 0xae, 0x97, 0xae, 0x5a, 0x19, 0xeb, 0xb6, 0x89, - 0x1b, 0x24, 0x59, 0x2c, 0xb9, 0x1b, 0xa5, 0x53, 0x49, 0x05, 0x0d, 0xcb, 0x43, 0x0a, 0x83, 0x81, - 0x77, 0x0d, 0x7c, 0x84, 0x05, 0x29, 0x31, 0x01, 0xa7, 0xcc, 0x7c, 0x7f, 0xfd, 0x94, 0xa6, 0xa0, - 0x21, 0xa3, 0xec, 0x34, 0x92, 0xd9, 0x1b, 0xe0, 0x46, 0xc8, 0x79, 0x38, 0x25, 0xae, 0xde, 0x8d, - 0xd2, 0x23, 0x17, 0xb3, 0xac, 0xf8, 0x94, 0xc7, 0xf0, 0x73, 0xae, 0xe6, 0x6e, 0x7a, 0xd3, 0xfb, - 0xdc, 0x82, 0xea, 0xe1, 0x0c, 0x6d, 0x43, 0x6d, 0xc4, 0xc7, 0x59, 0xdb, 0xda, 0xb2, 0xfa, 0x17, - 0x76, 0x36, 0x9c, 0x3f, 0xdd, 0xdf, 0x39, 0x9c, 0x0d, 0xf9, 0x38, 0xf3, 0x34, 0x0c, 0xdd, 0x86, - 0x16, 0x4e, 0xe5, 0xc4, 0xa7, 0xec, 0x88, 0xb7, 0xab, 0xda, 0x67, 0xf3, 0x1c, 0x9f, 0x41, 0x2a, - 0x27, 0x77, 0xd9, 0x11, 0xf7, 0x9a, 0xd8, 0xac, 0x50, 0x17, 0x40, 0xd1, 0xc6, 0x32, 0x4d, 0x88, - 0x68, 0xdb, 0x5b, 0x76, 0x7f, 0xd9, 0x3b, 0x63, 0xe9, 0x31, 0xa8, 0x1f, 0xce, 0x3c, 0xfc, 0x29, - 0xba, 0x0c, 0xa0, 0x8e, 0xf2, 0x47, 0x99, 0x24, 0x42, 0xf3, 0x5a, 0xf6, 0x5a, 0xca, 0x32, 0x54, - 0x06, 0xf4, 0x1a, 0x5c, 0x2a, 0x19, 0x18, 0x4c, 0x55, 0x63, 0x56, 0x8a, 0xa3, 0x72, 0xdc, 0xa2, - 0xf3, 0xbe, 0xb0, 0x60, 0xe9, 0x80, 0x86, 0x6c, 0x97, 0x07, 0xff, 0xd6, 0x91, 0x1b, 0xd0, 0x0c, - 0x26, 0x98, 0x32, 0x9f, 0x8e, 0xdb, 0xf6, 0x96, 0xd5, 0x6f, 0x79, 0x4b, 0x7a, 0x7f, 0x77, 0x8c, - 0xae, 0xc1, 0x45, 0x1c, 0x04, 0x3c, 0x65, 0xd2, 0x67, 0x69, 0x34, 0x22, 0x49, 0xbb, 0xb6, 0x65, - 0xf5, 0x6b, 0xde, 0x8a, 0xb1, 0x7e, 0xa8, 0x8d, 0xbd, 0xdf, 0x2c, 0x58, 0x35, 0xa4, 0x76, 0x69, - 0x42, 0x02, 0x39, 0x48, 0x67, 0x8b, 0xd8, 0xdd, 0x02, 0x88, 0xd3, 0xd1, 0x94, 0x06, 0xfe, 0x43, - 0x92, 0x99, 0x9a, 0xac, 0x3b, 0xb9, 0x26, 0x9c, 0x42, 0x13, 0xce, 0x80, 0x65, 0x5e, 0x2b, 0xc7, - 0xdd, 0x23, 0xd9, 0x3f, 0xa7, 0x8a, 0x3a, 0xd0, 0x14, 0xe4, 0xe3, 0x94, 0xb0, 0x80, 0xb4, 0xeb, - 0x1a, 0x50, 0xee, 0x51, 0x1f, 0x6c, 0x49, 0xe3, 0x76, 0x43, 0x73, 0xf9, 0xdf, 0x79, 0x9a, 0xa2, - 0xb1, 0xa7, 0x20, 0xbd, 0x2f, 0xab, 0xd0, 0xc8, 0x05, 0x86, 0x6e, 0x40, 0x33, 0x22, 0x42, 0xe0, - 0x50, 0x5f, 0xd2, 0x7e, 0xe5, 0x2d, 0x4a, 0x14, 0x42, 0x50, 0x8b, 0x48, 0x94, 0xeb, 0xb0, 0xe5, - 0xe9, 0xb5, 0x62, 0x2f, 0x69, 0x44, 0x78, 0x2a, 0xfd, 0x09, 0xa1, 0xe1, 0x44, 0xea, 0xeb, 0xd5, - 0xbc, 0x15, 0x63, 0xdd, 0xd7, 0x46, 0x34, 0x84, 0x35, 0x32, 0x93, 0x84, 0x09, 0xca, 0x99, 0xcf, - 0x63, 0x49, 0x39, 0x13, 0xed, 0xdf, 0x97, 0xe6, 0x1c, 0xbb, 0x5a, 0xe2, 0x3f, 0xca, 0xe1, 0xe8, - 0x01, 0x74, 0x19, 0x67, 0x7e, 0x90, 0x50, 0x49, 0x03, 0x3c, 0xf5, 0xcf, 0x09, 0x78, 0x69, 0x4e, - 0xc0, 0x4d, 0xc6, 0xd9, 0x1d, 0xe3, 0xfb, 0xfe, 0x4b, 0xb1, 0x7b, 0xdf, 0x58, 0xd0, 0x2c, 0x1e, - 0x11, 0x7a, 0x0f, 0x96, 0x95, 0x70, 0x49, 0xa2, 0x15, 0x58, 0x64, 0xe7, 0xf2, 0x39, 0x79, 0x3d, - 0xd0, 0x30, 0xfd, 0xf2, 0x2e, 0x88, 0x72, 0x2d, 0x54, 0x41, 0x8e, 0x08, 0x31, 0xe2, 0x38, 0xaf, - 0x20, 0x7b, 0x84, 0x78, 0x0a, 0x52, 0x94, 0xce, 0x5e, 0x5c, 0xba, 0xaf, 0x2c, 0x80, 0xd3, 0xf3, - 0x5e, 0x92, 0xa1, 0xf5, 0xd7, 0x64, 0x78, 0x1b, 0x5a, 0x11, 0x1f, 0x93, 0x45, 0xed, 0xe4, 0x3e, - 0x1f, 0x93, 0xbc, 0x9d, 0x44, 0x66, 0xf5, 0x82, 0xfc, 0xec, 0x17, 0xe5, 0xd7, 0x7b, 0x56, 0x85, - 0x66, 0xe1, 0x82, 0xde, 0x86, 0x86, 0xa0, 0x2c, 0x9c, 0x12, 0xc3, 0xa9, 0x37, 0x27, 0xbe, 0x73, - 0xa0, 0x91, 0xfb, 0x15, 0xcf, 0xf8, 0xa0, 0x37, 0xa1, 0xae, 0xdb, 0xb6, 0x21, 0xf7, 0xff, 0x79, - 0xce, 0xf7, 0x15, 0x70, 0xbf, 0xe2, 0xe5, 0x1e, 0x9d, 0x01, 0x34, 0xf2, 0x70, 0xe8, 0x0d, 0xa8, - 0x29, 0xde, 0x9a, 0xc0, 0xc5, 0x9d, 0xab, 0x67, 0x62, 0x14, 0x8d, 0xfc, 0x6c, 0xfd, 0x54, 0x3c, - 0x4f, 0x3b, 0x74, 0x1e, 0x59, 0x50, 0xd7, 0x51, 0xd1, 0x3d, 0x68, 0x8e, 0xa8, 0xc4, 0x49, 0x82, - 0x8b, 0xdc, 0xba, 0x45, 0x98, 0x7c, 0xdc, 0x38, 0xe5, 0x74, 0x29, 0x62, 0xdd, 0xe1, 0x51, 0x8c, - 0x03, 0x39, 0xa4, 0x72, 0xa0, 0xdc, 0xbc, 0x32, 0x00, 0x7a, 0x0b, 0xa0, 0xcc, 0xba, 0x6a, 0x65, - 0xf6, 0xa2, 0xb4, 0xb7, 0x8a, 0xb4, 0x8b, 0x61, 0x1d, 0x6c, 0x91, 0x46, 0xbd, 0xcf, 0xaa, 0x60, - 0xef, 0x11, 0x82, 0x32, 0x68, 0xe0, 0x48, 0x75, 0x05, 0x23, 0xca, 0x72, 0x80, 0xa8, 0xa9, 0x76, - 0x86, 0x0a, 0x65, 0xc3, 0xbd, 0x27, 0xbf, 0x5c, 0xa9, 0x7c, 0xf7, 0xeb, 0x95, 0x7e, 0x48, 0xe5, - 0x24, 0x1d, 0x39, 0x01, 0x8f, 0xdc, 0x62, 0x62, 0xea, 0xbf, 0x6d, 0x31, 0x7e, 0xe8, 0xca, 0x2c, - 0x26, 0x42, 0x3b, 0x88, 0xaf, 0x9f, 0x3f, 0xbe, 0xbe, 0x3c, 0x25, 0x21, 0x0e, 0x32, 0x5f, 0xcd, - 0x45, 0xf1, 0xed, 0xf3, 0xc7, 0xd7, 0x2d, 0xcf, 0x1c, 0x88, 0x36, 0xa1, 0x15, 0x62, 0xe1, 0x4f, - 0x69, 0x44, 0xa5, 0x2e, 0x4f, 0xcd, 0x6b, 0x86, 0x58, 0x7c, 0xa0, 0xf6, 0xc8, 0x81, 0x7a, 0x8c, - 0x33, 0x92, 0xe4, 0xcd, 0x6d, 0xd8, 0xfe, 0xe9, 0x87, 0xed, 0x75, 0xc3, 0x6c, 0x30, 0x1e, 0x27, - 0x44, 0x88, 0x03, 0x99, 0x50, 0x16, 0x7a, 0x39, 0x0c, 0xed, 0xc0, 0x52, 0x98, 0x60, 0x26, 0x4d, - 0xb7, 0x9b, 0xe7, 0x51, 0x00, 0x7b, 0xdf, 0x5b, 0x60, 0x1f, 0xd2, 0xf8, 0xbf, 0xcc, 0xc1, 0x0d, - 0x68, 0x48, 0x1a, 0xc7, 0x24, 0xc9, 0x7b, 0xe0, 0x1c, 0xd6, 0x06, 0xd7, 0xfb, 0xd1, 0x82, 0x95, - 0x41, 0x3a, 0xcb, 0x1f, 0xee, 0x2e, 0x96, 0x58, 0x5d, 0x1d, 0xe7, 0x50, 0xad, 0xac, 0xb9, 0x57, - 0x37, 0x40, 0xf4, 0x0e, 0x34, 0x95, 0x74, 0xfd, 0x31, 0x0f, 0xcc, 0xcb, 0xb8, 0xfa, 0x8a, 0x6e, - 0x74, 0x76, 0x92, 0x79, 0x4b, 0xc2, 0x0c, 0xdc, 0xe2, 0x45, 0xd8, 0x7f, 0xf3, 0x45, 0xa0, 0x55, - 0xb0, 0x05, 0x0d, 0x75, 0x8d, 0x96, 0x3d, 0xb5, 0x1c, 0xbe, 0xfb, 0xe4, 0xb8, 0x6b, 0x3d, 0x3d, - 0xee, 0x5a, 0xcf, 0x8e, 0xbb, 0xd6, 0xa3, 0x93, 0x6e, 0xe5, 0xe9, 0x49, 0xb7, 0xf2, 0xf3, 0x49, - 0xb7, 0xf2, 0xe0, 0xda, 0xe2, 0x24, 0xbb, 0x72, 0x36, 0x6a, 0xe8, 0xe6, 0x74, 0xeb, 0x8f, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x1f, 0x66, 0x4c, 0xda, 0x17, 0x0a, 0x00, 0x00, + // 1120 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x55, 0xc1, 0x6f, 0x1b, 0xc5, + 0x17, 0xf6, 0x7a, 0x6d, 0xc7, 0x7e, 0x4d, 0xda, 0x64, 0x54, 0xfd, 0xe4, 0x3a, 0xbf, 0x3a, 0xc1, + 0x55, 0xc1, 0xaa, 0xc8, 0x6e, 0x9b, 0x1e, 0x28, 0x15, 0x02, 0xec, 0x86, 0x28, 0x55, 0x29, 0x88, + 0x4d, 0x4e, 0xbd, 0xac, 0xc6, 0xbb, 0x93, 0xf5, 0xa8, 0xde, 0x99, 0x65, 0x67, 0x16, 0xbc, 0x47, + 0x2e, 0xdc, 0x90, 0x22, 0x2e, 0x48, 0x9c, 0x39, 0x20, 0x4e, 0x3d, 0x20, 0xfe, 0x86, 0x9c, 0x50, + 0xc5, 0x89, 0x53, 0x5b, 0x25, 0x87, 0xde, 0xf9, 0x07, 0x40, 0x3b, 0x3b, 0xbb, 0x49, 0xd3, 0xd4, + 0x29, 0x02, 0x89, 0x8b, 0x3d, 0xfb, 0xe6, 0x7b, 0x6f, 0xbe, 0x37, 0xf3, 0xbd, 0xf7, 0xa0, 0xe3, + 0x71, 0x11, 0x72, 0x61, 0xcb, 0xa9, 0xfd, 0xc5, 0x8d, 0x11, 0x91, 0xf8, 0x86, 0x2d, 0xa7, 0x56, + 0x14, 0x73, 0xc9, 0xd1, 0x52, 0xbe, 0x67, 0xc9, 0xa9, 0xa5, 0xf7, 0x3a, 0x4b, 0x38, 0xa4, 0x8c, + 0xdb, 0xea, 0x37, 0x47, 0x75, 0x2e, 0x06, 0x3c, 0xe0, 0x6a, 0x69, 0x67, 0x2b, 0x6d, 0x5d, 0xd3, + 0x71, 0xbd, 0x38, 0x8d, 0x24, 0xb7, 0xc3, 0x64, 0x22, 0xa9, 0xa0, 0x41, 0x79, 0x48, 0x61, 0xd0, + 0xf0, 0xae, 0x86, 0x8f, 0xb0, 0x20, 0x25, 0xc6, 0xe3, 0x94, 0xe9, 0xfd, 0xb7, 0x8e, 0x68, 0x0a, + 0x1a, 0x30, 0xca, 0x8e, 0x22, 0xe9, 0x6f, 0x0d, 0xbc, 0x14, 0x70, 0x1e, 0x4c, 0x88, 0xad, 0xbe, + 0x46, 0xc9, 0xae, 0x8d, 0x59, 0x5a, 0x6c, 0xe5, 0x31, 0xdc, 0x9c, 0xab, 0xce, 0x2d, 0xdf, 0x5a, + 0x39, 0xe9, 0x25, 0x69, 0x48, 0x84, 0xc4, 0x61, 0x94, 0x03, 0x7a, 0xdf, 0x18, 0x50, 0xdd, 0x99, + 0xa2, 0x35, 0xa8, 0x8d, 0xb8, 0x9f, 0xb6, 0x8d, 0x55, 0xa3, 0x7f, 0x6e, 0xfd, 0x92, 0xf5, 0xd2, + 0x05, 0x59, 0x3b, 0xd3, 0x21, 0xf7, 0x53, 0x47, 0xc1, 0xd0, 0x2d, 0x68, 0xe1, 0x44, 0x8e, 0x5d, + 0xca, 0x76, 0x79, 0xbb, 0xaa, 0x7c, 0x96, 0x4f, 0xf1, 0x19, 0x24, 0x72, 0x7c, 0x97, 0xed, 0x72, + 0xa7, 0x89, 0xf5, 0x0a, 0x75, 0x01, 0xb2, 0xbc, 0xb0, 0x4c, 0x62, 0x22, 0xda, 0xe6, 0xaa, 0xd9, + 0x9f, 0x77, 0x8e, 0x59, 0x7a, 0x0c, 0xea, 0x3b, 0x53, 0x07, 0x7f, 0x89, 0x2e, 0x03, 0x64, 0x47, + 0xb9, 0xa3, 0x54, 0x12, 0xa1, 0x78, 0xcd, 0x3b, 0xad, 0xcc, 0x32, 0xcc, 0x0c, 0xe8, 0x4d, 0xb8, + 0x50, 0x32, 0xd0, 0x98, 0xaa, 0xc2, 0x2c, 0x14, 0x47, 0xe5, 0xb8, 0xb3, 0xce, 0xfb, 0xd6, 0x80, + 0xb9, 0x6d, 0x1a, 0xb0, 0x0d, 0xee, 0xfd, 0x5b, 0x47, 0x5e, 0x82, 0xa6, 0x37, 0xc6, 0x94, 0xb9, + 0xd4, 0x6f, 0x9b, 0xab, 0x46, 0xbf, 0xe5, 0xcc, 0xa9, 0xef, 0xbb, 0x3e, 0xba, 0x0a, 0xe7, 0xb1, + 0xe7, 0xf1, 0x84, 0x49, 0x97, 0x25, 0xe1, 0x88, 0xc4, 0xed, 0xda, 0xaa, 0xd1, 0xaf, 0x39, 0x0b, + 0xda, 0xfa, 0x89, 0x32, 0xf6, 0xfe, 0x30, 0x60, 0x51, 0x93, 0xda, 0xa0, 0x31, 0xf1, 0xe4, 0x20, + 0x99, 0x9e, 0xc5, 0xee, 0x26, 0x40, 0x94, 0x8c, 0x26, 0xd4, 0x73, 0x1f, 0x92, 0x54, 0xbf, 0xc9, + 0x45, 0x2b, 0x7f, 0x7e, 0xab, 0x78, 0x7e, 0x6b, 0xc0, 0x52, 0xa7, 0x95, 0xe3, 0xee, 0x91, 0xf4, + 0x9f, 0x53, 0x45, 0x1d, 0x68, 0x0a, 0xf2, 0x79, 0x42, 0x98, 0x47, 0xda, 0x75, 0x05, 0x28, 0xbf, + 0xd1, 0xdb, 0x60, 0x4a, 0x1a, 0xb5, 0x1b, 0x8a, 0xcb, 0xff, 0x4e, 0xd3, 0x14, 0x8d, 0x86, 0xd5, + 0xb6, 0xe1, 0x64, 0xb0, 0xde, 0xd7, 0x26, 0x34, 0x72, 0x91, 0xa1, 0xeb, 0xd0, 0x0c, 0x89, 0x10, + 0x38, 0x50, 0x89, 0x9a, 0xaf, 0xcc, 0xa4, 0x44, 0x21, 0x04, 0xb5, 0x90, 0x84, 0xb9, 0x16, 0x5b, + 0x8e, 0x5a, 0x67, 0x19, 0x64, 0x6a, 0xe7, 0x89, 0x74, 0xc7, 0x84, 0x06, 0x63, 0xa9, 0x52, 0xac, + 0x39, 0x0b, 0xda, 0xba, 0xa5, 0x8c, 0xe8, 0xff, 0xd0, 0x4a, 0x18, 0x8f, 0x7d, 0x12, 0x13, 0x5f, + 0xe5, 0xd8, 0x74, 0x8e, 0x0c, 0xe8, 0x33, 0x58, 0x2a, 0x82, 0x94, 0xa5, 0xa3, 0x12, 0x3d, 0xb7, + 0xde, 0x79, 0x89, 0xd3, 0x4e, 0x81, 0x18, 0x36, 0xf7, 0x9f, 0xac, 0x18, 0x7b, 0x4f, 0x57, 0x0c, + 0x67, 0x51, 0xbb, 0x97, 0x7b, 0x68, 0x08, 0x4b, 0x64, 0x2a, 0x09, 0x13, 0x94, 0x33, 0x97, 0x47, + 0x92, 0x72, 0x26, 0xda, 0x7f, 0xce, 0xcd, 0xc8, 0x73, 0xb1, 0xc4, 0x7f, 0x9a, 0xc3, 0xd1, 0x03, + 0xe8, 0x32, 0xce, 0x5c, 0x2f, 0xa6, 0x92, 0x7a, 0x78, 0xe2, 0x9e, 0x12, 0xf0, 0xc2, 0x8c, 0x80, + 0xcb, 0x8c, 0xb3, 0x3b, 0xda, 0xf7, 0xa3, 0x13, 0xb1, 0x7b, 0x3f, 0x18, 0xd0, 0x2c, 0x2a, 0x17, + 0x7d, 0x08, 0xf3, 0x59, 0xb5, 0x90, 0x58, 0xc9, 0xbe, 0x78, 0x8e, 0xcb, 0xa7, 0x3c, 0xe6, 0xb6, + 0x82, 0xa9, 0x72, 0x3f, 0x27, 0xca, 0xb5, 0x40, 0x7d, 0x30, 0x77, 0x09, 0xd1, 0x8a, 0x3c, 0x4d, + 0x05, 0x9b, 0x84, 0x38, 0x19, 0xa4, 0xd0, 0x8b, 0xf9, 0x7a, 0x7a, 0xf9, 0xce, 0x00, 0x38, 0x3a, + 0xf3, 0x84, 0xfe, 0x8d, 0xd7, 0xd3, 0xff, 0x2d, 0x68, 0x85, 0xdc, 0x27, 0x67, 0xf5, 0xb1, 0xfb, + 0xdc, 0x27, 0x79, 0x1f, 0x0b, 0xf5, 0xea, 0x05, 0xdd, 0x9b, 0x2f, 0xea, 0xbe, 0xf7, 0xac, 0x0a, + 0xcd, 0xc2, 0x05, 0xbd, 0x07, 0x0d, 0x41, 0x59, 0x30, 0x21, 0x9a, 0x53, 0x6f, 0x46, 0x7c, 0x6b, + 0x5b, 0x21, 0xb7, 0x2a, 0x8e, 0xf6, 0x41, 0xef, 0x42, 0x5d, 0x0d, 0x14, 0x4d, 0xee, 0x8d, 0x59, + 0xce, 0xf7, 0x33, 0xe0, 0x56, 0xc5, 0xc9, 0x3d, 0x3a, 0x03, 0x68, 0xe4, 0xe1, 0xd0, 0x3b, 0x50, + 0xcb, 0x78, 0x2b, 0x02, 0xe7, 0xd7, 0xaf, 0x1c, 0x8b, 0x51, 0x8c, 0x98, 0xe3, 0x6f, 0x98, 0xc5, + 0x73, 0x94, 0x43, 0x67, 0xcf, 0x80, 0xba, 0x8a, 0x8a, 0xee, 0x41, 0x73, 0x44, 0x25, 0x8e, 0x63, + 0x5c, 0xdc, 0xad, 0x5d, 0x84, 0xc9, 0x07, 0xa1, 0x55, 0xce, 0xbd, 0x22, 0xd6, 0x1d, 0x1e, 0x46, + 0xd8, 0x93, 0x43, 0x2a, 0x07, 0x99, 0x9b, 0x53, 0x06, 0x40, 0xb7, 0x01, 0xca, 0x5b, 0xcf, 0x7a, + 0xa8, 0x79, 0xd6, 0xb5, 0xb7, 0x8a, 0x6b, 0x17, 0xc3, 0x3a, 0x98, 0x22, 0x09, 0x7b, 0x5f, 0x55, + 0xc1, 0xdc, 0x24, 0x04, 0xa5, 0xd0, 0xc0, 0x61, 0xd6, 0x8e, 0xb4, 0x30, 0xcb, 0xc9, 0x95, 0xcd, + 0xdb, 0x63, 0x54, 0x28, 0x1b, 0x6e, 0xee, 0x3f, 0x59, 0xa9, 0xfc, 0xf4, 0x74, 0xa5, 0x1f, 0x50, + 0x39, 0x4e, 0x46, 0x96, 0xc7, 0x43, 0xbb, 0x98, 0xe5, 0xea, 0x6f, 0x4d, 0xf8, 0x0f, 0x6d, 0x99, + 0x46, 0x44, 0x28, 0x07, 0xf1, 0xfd, 0xf3, 0x47, 0xd7, 0xe6, 0x27, 0x24, 0xc0, 0x5e, 0xea, 0x66, + 0x13, 0x5b, 0xfc, 0xf8, 0xfc, 0xd1, 0x35, 0xc3, 0xd1, 0x07, 0xa2, 0x65, 0x68, 0x05, 0x58, 0xb8, + 0x13, 0x1a, 0x52, 0xa9, 0x9e, 0xa7, 0xe6, 0x34, 0x03, 0x2c, 0x3e, 0xce, 0xbe, 0x91, 0x05, 0xf5, + 0x08, 0xa7, 0x24, 0xce, 0xbb, 0xea, 0xb0, 0xfd, 0xdb, 0xcf, 0x6b, 0x17, 0x35, 0xb3, 0x81, 0xef, + 0xc7, 0x44, 0x88, 0x6d, 0x19, 0x53, 0x16, 0x38, 0x39, 0x0c, 0xad, 0xc3, 0x5c, 0x10, 0x63, 0x26, + 0x75, 0x9b, 0x9d, 0xe5, 0x51, 0x00, 0x7b, 0xbf, 0x18, 0x60, 0xee, 0xd0, 0xe8, 0xbf, 0xbc, 0x83, + 0xeb, 0xd0, 0x90, 0x34, 0x8a, 0x48, 0x9c, 0x37, 0xde, 0x19, 0xac, 0x35, 0xee, 0x76, 0xb5, 0x6d, + 0xf4, 0x7e, 0x35, 0x60, 0x61, 0x90, 0x4c, 0xf3, 0xe2, 0xdd, 0xc0, 0x12, 0x67, 0xe9, 0xe3, 0x1c, + 0xae, 0xd4, 0x35, 0x33, 0x7d, 0x0d, 0x44, 0xef, 0x43, 0x33, 0x93, 0xaf, 0xeb, 0x73, 0x4f, 0x57, + 0xc7, 0x95, 0x57, 0x74, 0xa5, 0xe3, 0x63, 0xd4, 0x99, 0x13, 0x7a, 0xda, 0x17, 0x55, 0x61, 0xfe, + 0xcd, 0xaa, 0x40, 0x8b, 0x60, 0x0a, 0x1a, 0xa8, 0x77, 0x9a, 0x77, 0xb2, 0xe5, 0xf0, 0x83, 0xfd, + 0x83, 0xae, 0xf1, 0xf8, 0xa0, 0x6b, 0x3c, 0x3b, 0xe8, 0x1a, 0x7b, 0x87, 0xdd, 0xca, 0xe3, 0xc3, + 0x6e, 0xe5, 0xf7, 0xc3, 0x6e, 0xe5, 0xc1, 0xd5, 0xb3, 0x2f, 0xda, 0x96, 0xd3, 0x51, 0x43, 0x35, + 0xa8, 0x9b, 0x7f, 0x05, 0x00, 0x00, 0xff, 0xff, 0xc4, 0xae, 0x24, 0xf8, 0xb5, 0x0a, 0x00, 0x00, } func (m *Tx) Marshal() (dAtA []byte, err error) { @@ -1364,6 +1409,26 @@ func (m *TxBody) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0xfa } } + if m.TimeoutTimestamp != nil { + n5, err5 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.TimeoutTimestamp, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.TimeoutTimestamp):]) + if err5 != nil { + return 0, err5 + } + i -= n5 + i = encodeVarintTx(dAtA, i, uint64(n5)) + i-- + dAtA[i] = 0x2a + } + if m.Unordered { + i-- + if m.Unordered { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } if m.TimeoutHeight != 0 { i = encodeVarintTx(dAtA, i, uint64(m.TimeoutHeight)) i-- @@ -1942,6 +2007,13 @@ func (m *TxBody) Size() (n int) { if m.TimeoutHeight != 0 { n += 1 + sovTx(uint64(m.TimeoutHeight)) } + if m.Unordered { + n += 2 + } + if m.TimeoutTimestamp != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.TimeoutTimestamp) + n += 1 + l + sovTx(uint64(l)) + } if len(m.ExtensionOptions) > 0 { for _, e := range m.ExtensionOptions { l = e.Size() @@ -2955,6 +3027,62 @@ func (m *TxBody) Unmarshal(dAtA []byte) error { break } } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Unordered", 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.Unordered = bool(v != 0) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeoutTimestamp", 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.TimeoutTimestamp == nil { + m.TimeoutTimestamp = new(time.Time) + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.TimeoutTimestamp, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 1023: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ExtensionOptions", wireType) diff --git a/types/tx/types.go b/types/tx/types.go index 4df21dea7fc5..9e2c5c306688 100644 --- a/types/tx/types.go +++ b/types/tx/types.go @@ -3,9 +3,10 @@ package tx import ( "fmt" - errorsmod "cosmossdk.io/errors" protov2 "google.golang.org/protobuf/proto" + errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" @@ -161,10 +162,15 @@ func (t *Tx) FeePayer(cdc codec.Codec) []byte { return signers[0] } -func (t *Tx) FeeGranter() sdk.AccAddress { - feePayer := t.AuthInfo.Fee.Granter - if feePayer != "" { - return sdk.MustAccAddressFromBech32(feePayer) +func (t *Tx) FeeGranter(cdc codec.Codec) []byte { + feeGranter := t.AuthInfo.Fee.Granter + if feeGranter != "" { + feeGranterAddr, err := cdc.InterfaceRegistry().SigningContext().AddressCodec().StringToBytes(feeGranter) + if err != nil { + panic(err) + } + + return feeGranterAddr } return nil } diff --git a/types/tx_msg.go b/types/tx_msg.go index 898a8f6ea6d3..6e014f826574 100644 --- a/types/tx_msg.go +++ b/types/tx_msg.go @@ -4,11 +4,13 @@ import ( "encoding/json" fmt "fmt" strings "strings" + "time" "github.com/cosmos/gogoproto/proto" protov2 "google.golang.org/protobuf/proto" "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" ) @@ -61,7 +63,7 @@ type ( GetGas() uint64 GetFee() Coins FeePayer() []byte - FeeGranter() string + FeeGranter() []byte } // TxWithMemo must have GetMemo() method to use ValidateMemoDecorator @@ -70,6 +72,14 @@ type ( GetMemo() string } + // TxWithTimeoutTimeStamp extends the Tx interface by allowing a transaction to + // set a timeout timestamp. + TxWithTimeoutTimeStamp interface { + Tx + + GetTimeoutTimeStamp() time.Time + } + // TxWithTimeoutHeight extends the Tx interface by allowing a transaction to // set a height timeout. TxWithTimeoutHeight interface { @@ -78,6 +88,14 @@ type ( GetTimeoutHeight() uint64 } + // TxWithUnordered extends the Tx interface by allowing a transaction to set + // the unordered field, which implicitly relies on TxWithTimeoutTimeStamp. + TxWithUnordered interface { + TxWithTimeoutTimeStamp + + GetUnordered() bool + } + // HasValidateBasic defines a type that has a ValidateBasic method. // ValidateBasic is deprecated and now facultative. // Prefer validating messages directly in the msg server. @@ -95,13 +113,7 @@ type TxDecoder func(txBytes []byte) (Tx, error) type TxEncoder func(tx Tx) ([]byte, error) // MsgTypeURL returns the TypeURL of a `sdk.Msg`. -func MsgTypeURL(msg proto.Message) string { - if m, ok := msg.(protov2.Message); ok { - return "/" + string(m.ProtoReflect().Descriptor().FullName()) - } - - return "/" + proto.MessageName(msg) -} +var MsgTypeURL = codectypes.MsgTypeURL // GetMsgFromTypeURL returns a `sdk.Msg` message type from a type URL func GetMsgFromTypeURL(cdc codec.Codec, input string) (Msg, error) { diff --git a/types/utils.go b/types/utils.go index 02f022d1d402..b912be36f46a 100644 --- a/types/utils.go +++ b/types/utils.go @@ -16,6 +16,7 @@ import ( // This method can be used to canonicalize JSON to be returned by GetSignBytes, // e.g. for the ledger integration. // If the passed JSON isn't valid it will return an error. +// Deprecated: SortJSON was used for GetSignbytes, this is now automatic with amino signing func SortJSON(toSortJSON []byte) ([]byte, error) { var c interface{} err := json.Unmarshal(toSortJSON, &c) @@ -31,6 +32,7 @@ func SortJSON(toSortJSON []byte) ([]byte, error) { // MustSortJSON is like SortJSON but panic if an error occurs, e.g., if // the passed JSON isn't valid. +// Deprecated: SortJSON was used for GetSignbytes, this is now automatic with amino signing func MustSortJSON(toSortJSON []byte) []byte { js, err := SortJSON(toSortJSON) if err != nil { diff --git a/types/utils_test.go b/types/utils_test.go index 8bdba4082b35..22675a2c5990 100644 --- a/types/utils_test.go +++ b/types/utils_test.go @@ -23,53 +23,6 @@ func (s *utilsTestSuite) SetupSuite() { s.T().Parallel() } -func (s *utilsTestSuite) TestSortJSON() { - cases := []struct { - unsortedJSON string - want string - wantErr bool - }{ - // simple case - { - unsortedJSON: `{"cosmos":"foo", "atom":"bar", "tendermint":"foobar"}`, - want: `{"atom":"bar","cosmos":"foo","tendermint":"foobar"}`, wantErr: false, - }, - // failing case (invalid JSON): - { - unsortedJSON: `"cosmos":"foo",,,, "atom":"bar", "tendermint":"foobar"}`, - want: "", - wantErr: true, - }, - // genesis.json - { - unsortedJSON: `{"consensus_params":{"block_size_params":{"max_bytes":22020096,"max_txs":100000,"max_gas":-1},"tx_size_params":{"max_bytes":10240,"max_gas":-1},"block_gossip_params":{"block_part_size_bytes":65536},"evidence_params":{"max_age":100000}},"validators":[{"pub_key":{"type":"AC26791624DE60","value":"c7UMMAbjFuc5GhGPy0E5q5tefy12p9Tq0imXqdrKXwo="},"power":100,"name":""}],"app_hash":"","genesis_time":"2018-05-11T15:52:25.424795506Z","chain_id":"test-chain-Q6VeoW","app_state":{"accounts":[{"address":"718C9C23F98C9642569742ADDD9F9AB9743FBD5D","coins":[{"denom":"Token","amount":1000},{"denom":"stake","amount":50}]}],"stake":{"pool":{"total_supply":50,"bonded_shares":"0","unbonded_shares":"0","bonded_pool":0,"unbonded_pool":0,"inflation_last_time":0,"inflation":"7/100"},"params":{"inflation_rate_change":"13/100","inflation_max":"1/5","inflation_min":"7/100","goal_bonded":"67/100","max_validators":100,"bond_denom":"stake"},"candidates":null,"bonds":null}}}`, - want: `{"app_hash":"","app_state":{"accounts":[{"address":"718C9C23F98C9642569742ADDD9F9AB9743FBD5D","coins":[{"amount":1000,"denom":"Token"},{"amount":50,"denom":"stake"}]}],"stake":{"bonds":null,"candidates":null,"params":{"bond_denom":"stake","goal_bonded":"67/100","inflation_max":"1/5","inflation_min":"7/100","inflation_rate_change":"13/100","max_validators":100},"pool":{"bonded_pool":0,"bonded_shares":"0","inflation":"7/100","inflation_last_time":0,"total_supply":50,"unbonded_pool":0,"unbonded_shares":"0"}}},"chain_id":"test-chain-Q6VeoW","consensus_params":{"block_gossip_params":{"block_part_size_bytes":65536},"block_size_params":{"max_bytes":22020096,"max_gas":-1,"max_txs":100000},"evidence_params":{"max_age":100000},"tx_size_params":{"max_bytes":10240,"max_gas":-1}},"genesis_time":"2018-05-11T15:52:25.424795506Z","validators":[{"name":"","power":100,"pub_key":{"type":"AC26791624DE60","value":"c7UMMAbjFuc5GhGPy0E5q5tefy12p9Tq0imXqdrKXwo="}}]}`, - wantErr: false, - }, - // from the TXSpec: - { - unsortedJSON: `{"chain_id":"test-chain-1","sequence":1,"fee_bytes":{"amount":[{"amount":5,"denom":"photon"}],"gas":10000},"msg_bytes":{"inputs":[{"address":"696E707574","coins":[{"amount":10,"denom":"atom"}]}],"outputs":[{"address":"6F7574707574","coins":[{"amount":10,"denom":"atom"}]}]},"alt_bytes":null}`, - want: `{"alt_bytes":null,"chain_id":"test-chain-1","fee_bytes":{"amount":[{"amount":5,"denom":"photon"}],"gas":10000},"msg_bytes":{"inputs":[{"address":"696E707574","coins":[{"amount":10,"denom":"atom"}]}],"outputs":[{"address":"6F7574707574","coins":[{"amount":10,"denom":"atom"}]}]},"sequence":1}`, - wantErr: false, - }, - } - - for tcIndex, tc := range cases { - tc := tc - got, err := sdk.SortJSON([]byte(tc.unsortedJSON)) - if tc.wantErr { - s.Require().NotNil(err, "tc #%d", tcIndex) - s.Require().Panics(func() { sdk.MustSortJSON([]byte(tc.unsortedJSON)) }) - } else { - s.Require().Nil(err, "tc #%d, err=%s", tcIndex, err) - s.Require().NotPanics(func() { sdk.MustSortJSON([]byte(tc.unsortedJSON)) }) - s.Require().Equal(got, sdk.MustSortJSON([]byte(tc.unsortedJSON))) - } - - s.Require().Equal(string(got), tc.want) - } -} - func (s *utilsTestSuite) TestTimeFormatAndParse() { cases := []struct { RFC3339NanoStr string diff --git a/version/command.go b/version/command.go index 451173400c22..d52a69668685 100644 --- a/version/command.go +++ b/version/command.go @@ -15,6 +15,11 @@ const ( ) // NewVersionCommand returns a CLI command to interactively print the application binary version information. +// Note: When seeking to add the extra info to the context +// The below can be added to the initRootCmd to include the extraInfo field +// +// cmdContext := context.WithValue(context.Background(), version.ContextKey{}, extraInfo) +// rootCmd.SetContext(cmdContext) func NewVersionCommand() *cobra.Command { cmd := &cobra.Command{ Use: "version", @@ -28,6 +33,9 @@ func NewVersionCommand() *cobra.Command { return nil } + // Extract and set extra information from the context + verInfo.ExtraInfo = extraInfoFromContext(cmd) + var ( bz []byte err error @@ -56,3 +64,14 @@ func NewVersionCommand() *cobra.Command { return cmd } + +func extraInfoFromContext(cmd *cobra.Command) ExtraInfo { + ctx := cmd.Context() + if ctx != nil { + extraInfo, ok := ctx.Value(ContextKey{}).(ExtraInfo) + if ok { + return extraInfo + } + } + return nil +} diff --git a/version/version.go b/version/version.go index a41834e336c2..8f1f040d471c 100644 --- a/version/version.go +++ b/version/version.go @@ -23,6 +23,9 @@ import ( "runtime/debug" ) +// ContextKey is used to store the ExtraInfo in the context. +type ContextKey struct{} + var ( // application's name Name = "" @@ -44,13 +47,20 @@ func getSDKVersion() string { var sdkVersion string for _, dep := range deps.Deps { if dep.Path == "github.com/cosmos/cosmos-sdk" { - sdkVersion = dep.Version + if dep.Replace != nil && dep.Replace.Version != "(devel)" { + sdkVersion = dep.Replace.Version + } else { + sdkVersion = dep.Version + } } } return sdkVersion } +// ExtraInfo contains a set of extra information provided by apps +type ExtraInfo map[string]string + // Info defines the application version information. type Info struct { Name string `json:"name" yaml:"name"` @@ -61,6 +71,7 @@ type Info struct { GoVersion string `json:"go" yaml:"go"` BuildDeps []buildDep `json:"build_deps" yaml:"build_deps"` CosmosSdkVersion string `json:"cosmos_sdk_version" yaml:"cosmos_sdk_version"` + ExtraInfo ExtraInfo `json:"extra_info,omitempty" yaml:"extra_info,omitempty"` } func NewInfo() Info { diff --git a/version/version_test.go b/version/version_test.go index caf0a5fb6b60..75e52d8076cd 100644 --- a/version/version_test.go +++ b/version/version_test.go @@ -1,13 +1,13 @@ package version_test import ( + context "context" "encoding/json" "fmt" "runtime" "strings" "testing" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/client/flags" @@ -149,7 +149,7 @@ func Test_runVersionCmd(t *testing.T) { }) require.NoError(t, cmd.Execute()) - assert.Equal(t, "\n", mockOut.String()) + require.Equal(t, "\n", mockOut.String()) mockOut.Reset() cmd.SetArgs([]string{ @@ -158,7 +158,21 @@ func Test_runVersionCmd(t *testing.T) { info := version.NewInfo() stringInfo, err := json.Marshal(info) + + extraInfo := &version.ExtraInfo{"key1": "value1"} + ctx := context.WithValue(context.Background(), version.ContextKey{}, extraInfo) + require.NoError(t, err) require.NoError(t, cmd.Execute()) - assert.Equal(t, string(stringInfo)+"\n", mockOut.String()) + + extraInfoFromContext := ctx.Value(version.ContextKey{}) + require.NotNil(t, extraInfoFromContext) + + castedExtraInfo, ok := extraInfoFromContext.(*version.ExtraInfo) + require.True(t, ok) + + key1Value := (*castedExtraInfo)["key1"] + require.Equal(t, "value1", key1Value) + + require.Equal(t, string(stringInfo)+"\n", mockOut.String()) } diff --git a/x/README.md b/x/README.md index 157836977994..73ad4aa4c42f 100644 --- a/x/README.md +++ b/x/README.md @@ -1,29 +1,50 @@ --- sidebar_position: 0 -slug : /modules --- # List of Modules Here are some production-grade modules that can be used in Cosmos SDK applications, along with their respective documentation: +## Essential Modules + +Essential modules include functionality that _must_ be included in your Cosmos SDK blockchain. +These modules provide the core behaviors that are needed for users and operators such as balance tracking, +proof-of-stake capabilities and governance. + * [Auth](./auth/README.md) - Authentication of accounts and transactions for Cosmos SDK applications. -* [Authz](./authz/README.md) - Authorization for accounts to perform actions on behalf of other accounts. * [Bank](./bank/README.md) - Token transfer functionalities. -* [Crisis](./crisis/README.md) - Halting the blockchain under certain circumstances (e.g. if an invariant is broken). +* [Circuit](./circuit/README.md) - Circuit breaker module for pausing messages. +* [Consensus](./consensus/README.md) - Consensus module for modifying CometBFT's ABCI consensus params. * [Distribution](./distribution/README.md) - Fee distribution, and staking token provision distribution. * [Evidence](./evidence/README.md) - Evidence handling for double signing, misbehaviour, etc. -* [Feegrant](./feegrant/README.md) - Grant fee allowances for executing transactions. * [Governance](./gov/README.md) - On-chain proposals and voting. +* [Genutil](./genutil/README.md) - Genesis utilities for the Cosmos SDK. * [Mint](./mint/README.md) - Creation of new units of staking token. -* [Params](./params/README.md) - Globally available parameter store. * [Slashing](./slashing/README.md) - Validator punishment mechanisms. * [Staking](./staking/README.md) - Proof-of-Stake layer for public blockchains. * [Upgrade](./upgrade/README.md) - Software upgrades handling and coordination. + +## Supplementary Modules + +Supplementary modules are modules that are maintained in the Cosmos SDK but are not necessary for +the core functionality of your blockchain. They can be thought of as ways to extend the +capabilities of your blockchain or further specialize it. + +* [Authz](./authz/README.md) - Authorization for accounts to perform actions on behalf of other accounts. +* [Epochs](./epochs/README.md) - Registration so SDK modules can have logic to be executed at the timed tickers. +* [Feegrant](./feegrant/README.md) - Grant fee allowances for executing transactions. +* [Group](./group/README.md) - Allows for the creation and management of on-chain multisig accounts. * [NFT](./nft/README.md) - NFT module implemented based on [ADR43](https://docs.cosmos.network/main/architecture/adr-043-nft-module.html). -* [Consensus](./consensus/README.md) - Consensus module for modifying CometBFT's ABCI consensus params. -* [Circuit](./circuit/README.md) - Circuit breaker module for pausing messages. -* [Genutil](./genutil/README.md) - Genesis utilities for the Cosmos SDK. +* [ProtocolPool](./protocolpool/README.md) - Extended management of community pool functionality. + +## Deprecated Modules + +The following modules are deprecated. They will no longer be maintained and eventually will be removed +in an upcoming release of the Cosmos SDK per our [release process](../RELEASE_PROCESS.md). + +* [Crisis](./crisis/README.md) - *Deprecated* halting the blockchain under certain circumstances (e.g. if an invariant is broken). +* [Params](./params/README.md) - *Deprecated* Globally available parameter store. To learn more about the process of building modules, visit the [building modules reference documentation](https://docs.cosmos.network/main/building-modules/intro). diff --git a/x/auth/README.md b/x/auth/README.md index 4b5a2ad1f45b..c51d10634ad4 100644 --- a/x/auth/README.md +++ b/x/auth/README.md @@ -447,6 +447,22 @@ simd tx multisign transaction.json k1k2k3 k1sig.json k2sig.json k3sig.json Where `k1k2k3` is the multisig account address, `k1sig.json` is the signature of the first signer, `k2sig.json` is the signature of the second signer, and `k3sig.json` is the signature of the third signer. +##### Nested multisig transactions + +To allow transactions to be signed by nested multisigs, meaning that a participant of a multisig account can be another multisig account, the `--skip-signature-verification` flag must be used. + +```bash +# First aggregate signatures of the multisig participant +simd tx multi-sign transaction.json ms1 ms1p1sig.json ms1p2sig.json --signature-only --skip-signature-verification > ms1sig.json + +# Then use the aggregated signatures and the other signatures to sign the final transaction +simd tx multi-sign transaction.json k1ms1 k1sig.json ms1sig.json --skip-signature-verification +``` + +Where `ms1` is the nested multisig account address, `ms1p1sig.json` is the signature of the first participant of the nested multisig account, `ms1p2sig.json` is the signature of the second participant of the nested multisig account, and `ms1sig.json` is the aggregated signature of the nested multisig account. + +`k1ms1` is a multisig account comprised of an individual signer and another nested multisig account (`ms1`). `k1sig.json` is the signature of the first signer of the individual member. + More information about the `multi-sign` command can be found running `simd tx multi-sign --help`. #### `multisign-batch` @@ -481,17 +497,6 @@ simd tx broadcast tx.signed.json More information about the `broadcast` command can be found running `simd tx broadcast --help`. -#### `aux-to-fee` - -The `aux-to-fee` comamnds includes the aux signer data in the tx, broadcast the tx, and sends the tip amount to the broadcaster. -[Learn more about tip transaction](https://docs.cosmos.network/main/core/tips). - -```bash -# simd tx bank send --aux (optional: --tip --tipper ) -simd tx aux-to-fee tx.aux.signed.json -``` - -More information about the `aux-to-fee` command can be found running `simd tx aux-to-fee --help`. ### gRPC diff --git a/x/auth/ante/ante.go b/x/auth/ante/ante.go index 05c5eb102657..f414767233aa 100644 --- a/x/auth/ante/ante.go +++ b/x/auth/ante/ante.go @@ -1,14 +1,14 @@ package ante import ( + errorsmod "cosmossdk.io/errors" storetypes "cosmossdk.io/store/types" txsigning "cosmossdk.io/x/tx/signing" - errorsmod "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/tx/signing" + "github.com/cosmos/cosmos-sdk/x/auth/ante/unorderedtx" "github.com/cosmos/cosmos-sdk/x/auth/types" ) @@ -21,6 +21,7 @@ type HandlerOptions struct { SignModeHandler *txsigning.HandlerMap SigGasConsumer func(meter storetypes.GasMeter, sig signing.SignatureV2, params types.Params) error TxFeeChecker TxFeeChecker + UnorderedTxManager *unorderedtx.Manager } // NewAnteHandler returns an AnteHandler that checks and increments sequence @@ -54,5 +55,9 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { NewIncrementSequenceDecorator(options.AccountKeeper), } + if options.UnorderedTxManager != nil { + anteDecorators = append(anteDecorators, NewUnorderedTxDecorator(unorderedtx.DefaultMaxTimeoutDuration, options.UnorderedTxManager, DefaultSha256GasCost)) + } + return sdk.ChainAnteDecorators(anteDecorators...), nil } diff --git a/x/auth/ante/ante_test.go b/x/auth/ante/ante_test.go index 21a6d6bcb1dd..7588db63438a 100644 --- a/x/auth/ante/ante_test.go +++ b/x/auth/ante/ante_test.go @@ -6,14 +6,14 @@ import ( "fmt" "strings" "testing" + "time" - "cosmossdk.io/math" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" - - storetypes "cosmossdk.io/store/types" + "go.uber.org/mock/gomock" errorsmod "cosmossdk.io/errors" + "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" kmultisig "github.com/cosmos/cosmos-sdk/crypto/keys/multisig" @@ -1448,3 +1448,34 @@ func TestAnteHandlerReCheck(t *testing.T) { _, err = suite.anteHandler(suite.ctx, tx, false) require.NotNil(t, err, "antehandler on recheck did not fail once feePayer no longer has sufficient funds") } + +func TestAnteHandlerUnorderedTx(t *testing.T) { + suite := SetupTestSuite(t, false) + accs := suite.CreateTestAccounts(1) + msg := testdata.NewTestMsg(accs[0].acc.GetAddress()) + + // First send a normal sequential tx with sequence 0 + suite.bankKeeper.EXPECT().SendCoinsFromAccountToModule(gomock.Any(), accs[0].acc.GetAddress(), authtypes.FeeCollectorName, testdata.NewTestFeeAmount()).Return(nil).AnyTimes() + + privs, accNums, accSeqs := []cryptotypes.PrivKey{accs[0].priv}, []uint64{1000}, []uint64{0} + _, err := suite.DeliverMsgs(t, privs, []sdk.Msg{msg}, testdata.NewTestFeeAmount(), testdata.NewTestGasLimit(), accNums, accSeqs, suite.ctx.ChainID(), false) + require.NoError(t, err) + + // we try to send another tx with the same sequence, it will fail + _, err = suite.DeliverMsgs(t, privs, []sdk.Msg{msg}, testdata.NewTestFeeAmount(), testdata.NewTestGasLimit(), accNums, accSeqs, suite.ctx.ChainID(), false) + require.Error(t, err) + + // now we'll still use the same sequence but because it's unordered, it will be ignored and accepted anyway + msgs := []sdk.Msg{msg} + require.NoError(t, suite.txBuilder.SetMsgs(msgs...)) + suite.txBuilder.SetFeeAmount(testdata.NewTestFeeAmount()) + suite.txBuilder.SetGasLimit(testdata.NewTestGasLimit()) + + tx, txErr := suite.CreateTestUnorderedTx(suite.ctx, privs, accNums, accSeqs, suite.ctx.ChainID(), signing.SignMode_SIGN_MODE_DIRECT, true, time.Now().Add(time.Minute)) + require.NoError(t, txErr) + txBytes, err := suite.clientCtx.TxConfig.TxEncoder()(tx) + bytesCtx := suite.ctx.WithTxBytes(txBytes) + require.NoError(t, err) + _, err = suite.anteHandler(bytesCtx, tx, false) + require.NoError(t, err) +} diff --git a/x/auth/ante/basic.go b/x/auth/ante/basic.go index 750824570ac4..0137a9259cf1 100644 --- a/x/auth/ante/basic.go +++ b/x/auth/ante/basic.go @@ -1,9 +1,10 @@ package ante import ( - storetypes "cosmossdk.io/store/types" + "time" errorsmod "cosmossdk.io/errors" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec/legacy" "github.com/cosmos/cosmos-sdk/crypto/keys/multisig" @@ -188,6 +189,7 @@ type ( sdk.Tx GetTimeoutHeight() uint64 + GetTimeoutTimeStamp() time.Time } ) @@ -214,5 +216,13 @@ func (txh TxTimeoutHeightDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simul ) } + timeoutTimestamp := timeoutTx.GetTimeoutTimeStamp() + blockTime := ctx.BlockHeader().Time + if !timeoutTimestamp.IsZero() && timeoutTimestamp.Unix() != 0 && timeoutTimestamp.Before(blockTime) { + return ctx, errorsmod.Wrapf( + sdkerrors.ErrTxTimeout, "block time: %s, timeout timestamp: %s", blockTime, timeoutTimestamp.String(), + ) + } + return next(ctx, tx, simulate) } diff --git a/x/auth/ante/basic_test.go b/x/auth/ante/basic_test.go index 636061aff682..6bf20e08280e 100644 --- a/x/auth/ante/basic_test.go +++ b/x/auth/ante/basic_test.go @@ -3,10 +3,12 @@ package ante_test import ( "strings" "testing" + "time" - storetypes "cosmossdk.io/store/types" "github.com/stretchr/testify/require" + storetypes "cosmossdk.io/store/types" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/crypto/types/multisig" "github.com/cosmos/cosmos-sdk/testutil/testdata" @@ -185,21 +187,30 @@ func TestTxHeightTimeoutDecorator(t *testing.T) { // keys and addresses priv1, _, addr1 := testdata.KeyTestPubAddr() + currentTime := time.Now() + // msg and signatures msg := testdata.NewTestMsg(addr1) feeAmount := testdata.NewTestFeeAmount() gasLimit := testdata.NewTestGasLimit() testCases := []struct { - name string - timeout uint64 - height int64 - expectedErr error + name string + timeout uint64 + height int64 + timeoutTimestamp time.Time + timestamp time.Time + expectedErr error }{ - {"default value", 0, 10, nil}, - {"no timeout (greater height)", 15, 10, nil}, - {"no timeout (same height)", 10, 10, nil}, - {"timeout (smaller height)", 9, 10, sdkerrors.ErrTxTimeoutHeight}, + {"default value", 0, 10, time.Time{}, time.Time{}, nil}, + {"no timeout (greater height)", 15, 10, time.Time{}, time.Time{}, nil}, + {"no timeout (same height)", 10, 10, time.Time{}, time.Time{}, nil}, + {"timeout (smaller height)", 9, 10, time.Time{}, time.Time{}, sdkerrors.ErrTxTimeoutHeight}, + {"no timeout (timeout after timestamp)", 0, 20, currentTime.Add(time.Minute), currentTime, nil}, + {"no timeout (current time)", 0, 20, currentTime, currentTime, nil}, + {"timeout before timestamp", 0, 20, currentTime, currentTime.Add(time.Minute), sdkerrors.ErrTxTimeout}, + {"tx contain both timeouts, timeout (timeout before timestamp)", 15, 10, currentTime, currentTime.Add(time.Minute), sdkerrors.ErrTxTimeout}, + {"tx contain both timeout, no timeout", 15, 10, currentTime.Add(time.Minute), currentTime, nil}, } for _, tc := range testCases { @@ -214,12 +225,13 @@ func TestTxHeightTimeoutDecorator(t *testing.T) { suite.txBuilder.SetGasLimit(gasLimit) suite.txBuilder.SetMemo(strings.Repeat("01234567890", 10)) suite.txBuilder.SetTimeoutHeight(tc.timeout) + suite.txBuilder.SetTimeoutTimestamp(tc.timeoutTimestamp) privs, accNums, accSeqs := []cryptotypes.PrivKey{priv1}, []uint64{0}, []uint64{0} tx, err := suite.CreateTestTx(suite.ctx, privs, accNums, accSeqs, suite.ctx.ChainID(), signing.SignMode_SIGN_MODE_DIRECT) require.NoError(t, err) - ctx := suite.ctx.WithBlockHeight(tc.height) + ctx := suite.ctx.WithBlockHeight(tc.height).WithBlockTime(tc.timestamp) _, err = antehandler(ctx, tx, true) require.ErrorIs(t, err, tc.expectedErr) }) diff --git a/x/auth/ante/expected_keepers.go b/x/auth/ante/expected_keepers.go index 1fec5fdf1712..139204cedf78 100644 --- a/x/auth/ante/expected_keepers.go +++ b/x/auth/ante/expected_keepers.go @@ -4,6 +4,7 @@ import ( "context" "cosmossdk.io/core/address" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/types" ) diff --git a/x/auth/ante/ext_test.go b/x/auth/ante/ext_test.go index 8230b5205e75..9181c7664a78 100644 --- a/x/auth/ante/ext_test.go +++ b/x/auth/ante/ext_test.go @@ -3,12 +3,13 @@ package ante_test import ( "testing" + "github.com/stretchr/testify/require" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/ante" "github.com/cosmos/cosmos-sdk/x/auth/tx" - "github.com/stretchr/testify/require" ) func TestRejectExtensionOptionsDecorator(t *testing.T) { diff --git a/x/auth/ante/fee.go b/x/auth/ante/fee.go index b6131d59e1fc..7581765ecf7d 100644 --- a/x/auth/ante/fee.go +++ b/x/auth/ante/fee.go @@ -15,9 +15,9 @@ import ( // the effective fee should be deducted later, and the priority should be returned in abci response. type TxFeeChecker func(ctx sdk.Context, tx sdk.Tx) (sdk.Coins, int64, error) -// DeductFeeDecorator deducts fees from the first signer of the tx -// If the first signer does not have the funds to pay for the fees, return with InsufficientFunds error -// Call next AnteHandler if fees successfully deducted +// DeductFeeDecorator deducts fees from the fee payer. The fee payer is the fee granter (if specified) or first signer of the tx. +// If the fee payer does not have the funds to pay for the fees, return an InsufficientFunds error. +// Call next AnteHandler if fees successfully deducted. // CONTRACT: Tx must implement FeeTx interface to use DeductFeeDecorator type DeductFeeDecorator struct { accountKeeper AccountKeeper @@ -86,11 +86,8 @@ func (dfd DeductFeeDecorator) checkDeductFee(ctx sdk.Context, sdkTx sdk.Tx, fee // if feegranter set deduct fee from feegranter account. // this works with only when feegrant enabled. - if feeGranter != "" { - feeGranterAddr, err := sdk.AccAddressFromBech32(feeGranter) - if err != nil { - return err - } + if feeGranter != nil { + feeGranterAddr := sdk.AccAddress(feeGranter) if dfd.feegrantKeeper == nil { return sdkerrors.ErrInvalidRequest.Wrap("fee grants are not enabled") diff --git a/x/auth/ante/fee_test.go b/x/auth/ante/fee_test.go index 182e5ae8f0d2..4f772fb3d7e9 100644 --- a/x/auth/ante/fee_test.go +++ b/x/auth/ante/fee_test.go @@ -3,7 +3,11 @@ package ante_test import ( "testing" + "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" + "cosmossdk.io/math" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" @@ -11,8 +15,6 @@ import ( "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/x/auth/ante" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/golang/mock/gomock" - "github.com/stretchr/testify/require" ) func TestDeductFeeDecorator_ZeroGas(t *testing.T) { diff --git a/x/auth/ante/feegrant_test.go b/x/auth/ante/feegrant_test.go index ae680a9ebfbd..5a1c60cba274 100644 --- a/x/auth/ante/feegrant_test.go +++ b/x/auth/ante/feegrant_test.go @@ -8,8 +8,8 @@ import ( "time" "github.com/cometbft/cometbft/crypto" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" storetypes "cosmossdk.io/store/types" diff --git a/x/auth/ante/setup.go b/x/auth/ante/setup.go index 4b6e281ac394..35ba2dc36308 100644 --- a/x/auth/ante/setup.go +++ b/x/auth/ante/setup.go @@ -3,9 +3,8 @@ package ante import ( "fmt" - storetypes "cosmossdk.io/store/types" - errorsmod "cosmossdk.io/errors" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -40,6 +39,14 @@ func (sud SetUpContextDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate newCtx = SetGasMeter(simulate, ctx, gasTx.GetGas()) + if cp := ctx.ConsensusParams(); cp.Block != nil { + // If there exists a maximum block gas limit, we must ensure that the tx + // does not exceed it. + if cp.Block.MaxGas > 0 && gasTx.GetGas() > uint64(cp.Block.MaxGas) { + return newCtx, errorsmod.Wrapf(sdkerrors.ErrInvalidGasLimit, "tx gas limit %d exceeds block max gas %d", gasTx.GetGas(), cp.Block.MaxGas) + } + } + // Decorator will catch an OutOfGasPanic caused in the next antehandler // AnteHandlers must have their own defer/recover in order for the BaseApp // to know how much gas was used! This is because the GasMeter is created in diff --git a/x/auth/ante/setup_test.go b/x/auth/ante/setup_test.go index 67c408218af1..e806a9b24489 100644 --- a/x/auth/ante/setup_test.go +++ b/x/auth/ante/setup_test.go @@ -3,9 +3,11 @@ package ante_test import ( "testing" - storetypes "cosmossdk.io/store/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" + storetypes "cosmossdk.io/store/types" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" @@ -14,6 +16,40 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/ante" ) +func TestSetupDecorator_BlockMaxGas(t *testing.T) { + suite := SetupTestSuite(t, true) + suite.txBuilder = suite.clientCtx.TxConfig.NewTxBuilder() + + // keys and addresses + priv1, _, addr1 := testdata.KeyTestPubAddr() + + // msg and signatures + msg := testdata.NewTestMsg(addr1) + feeAmount := testdata.NewTestFeeAmount() + require.NoError(t, suite.txBuilder.SetMsgs(msg)) + suite.txBuilder.SetFeeAmount(feeAmount) + suite.txBuilder.SetGasLimit(101) + + privs, accNums, accSeqs := []cryptotypes.PrivKey{priv1}, []uint64{0}, []uint64{0} + tx, err := suite.CreateTestTx(suite.ctx, privs, accNums, accSeqs, suite.ctx.ChainID(), signing.SignMode_SIGN_MODE_DIRECT) + require.NoError(t, err) + + sud := ante.NewSetUpContextDecorator() + antehandler := sdk.ChainAnteDecorators(sud) + + suite.ctx = suite.ctx. + WithBlockHeight(1). + WithGasMeter(storetypes.NewGasMeter(0)). + WithConsensusParams(cmtproto.ConsensusParams{ + Block: &cmtproto.BlockParams{ + MaxGas: 100, + }, + }) + + _, err = antehandler(suite.ctx, tx, false) + require.Error(t, err) +} + func TestSetup(t *testing.T) { suite := SetupTestSuite(t, true) suite.txBuilder = suite.clientCtx.TxConfig.NewTxBuilder() diff --git a/x/auth/ante/sigverify.go b/x/auth/ante/sigverify.go index 7cd4e5cf2dce..cf4dffb9cf8e 100644 --- a/x/auth/ante/sigverify.go +++ b/x/auth/ante/sigverify.go @@ -9,12 +9,10 @@ import ( "google.golang.org/protobuf/types/known/anypb" errorsmod "cosmossdk.io/errors" - storetypes "cosmossdk.io/store/types" txsigning "cosmossdk.io/x/tx/signing" codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" kmultisig "github.com/cosmos/cosmos-sdk/crypto/keys/multisig" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" @@ -92,7 +90,7 @@ func (spkd SetPubKeyDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate b pk = simSecp256k1Pubkey } // Only make check if simulate=false - if !simulate && !bytes.Equal(pk.Address(), signers[i]) { + if !simulate && !bytes.Equal(pk.Address(), signers[i]) && ctx.IsSigverifyTx() { return ctx, errorsmod.Wrapf(sdkerrors.ErrInvalidPubKey, "pubKey does not match signer address %s with signer index: %d", signerStrs[i], i) } @@ -258,6 +256,9 @@ func (svd SigVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simul return ctx, errorsmod.Wrap(sdkerrors.ErrTxDecode, "invalid transaction type") } + utx, ok := tx.(sdk.TxWithUnordered) + isUnordered := ok && utx.GetUnordered() + // stdSigs contains the sequence number, account number, and signatures. // When simulating, this would just be a 0-length slice. sigs, err := sigTx.GetSignaturesV2() @@ -288,11 +289,13 @@ func (svd SigVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simul } // Check account sequence number. - if sig.Sequence != acc.GetSequence() { - return ctx, errorsmod.Wrapf( - sdkerrors.ErrWrongSequence, - "account sequence mismatch, expected %d, got %d", acc.GetSequence(), sig.Sequence, - ) + if !isUnordered { + if sig.Sequence != acc.GetSequence() { + return ctx, errorsmod.Wrapf( + sdkerrors.ErrWrongSequence, + "account sequence mismatch, expected %d, got %d", acc.GetSequence(), sig.Sequence, + ) + } } // retrieve signer data @@ -304,14 +307,14 @@ func (svd SigVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simul } // no need to verify signatures on recheck tx - if !simulate && !ctx.IsReCheckTx() { + if !simulate && !ctx.IsReCheckTx() && ctx.IsSigverifyTx() { anyPk, _ := codectypes.NewAnyWithValue(pubKey) signerData := txsigning.SignerData{ Address: acc.GetAddress().String(), ChainID: chainID, AccountNumber: accNum, - Sequence: acc.GetSequence(), + Sequence: sig.Sequence, PubKey: &anypb.Any{ TypeUrl: anyPk.TypeUrl, Value: anyPk.Value, @@ -361,6 +364,9 @@ func NewIncrementSequenceDecorator(ak AccountKeeper) IncrementSequenceDecorator } func (isd IncrementSequenceDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) { + if utx, ok := tx.(sdk.TxWithUnordered); ok && utx.GetUnordered() { + return next(ctx, tx, simulate) + } sigTx, ok := tx.(authsigning.SigVerifiableTx) if !ok { return ctx, errorsmod.Wrap(sdkerrors.ErrTxDecode, "invalid transaction type") diff --git a/x/auth/ante/sigverify_test.go b/x/auth/ante/sigverify_test.go index cd803f3fac32..b50dafa80a73 100644 --- a/x/auth/ante/sigverify_test.go +++ b/x/auth/ante/sigverify_test.go @@ -3,14 +3,13 @@ package ante_test import ( "fmt" "testing" + "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" storetypes "cosmossdk.io/store/types" - authsign "github.com/cosmos/cosmos-sdk/x/auth/signing" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" kmultisig "github.com/cosmos/cosmos-sdk/crypto/keys/multisig" @@ -23,6 +22,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/x/auth/ante" "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" + authsign "github.com/cosmos/cosmos-sdk/x/auth/signing" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" txmodule "github.com/cosmos/cosmos-sdk/x/auth/tx/config" "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -191,23 +191,26 @@ func TestSigVerification(t *testing.T) { accSeqs []uint64 invalidSigs bool // used for testing sigverify on RecheckTx recheck bool + sigverify bool shouldErr bool } validSigs := false testCases := []testCase{ - {"no signers", []cryptotypes.PrivKey{}, []uint64{}, []uint64{}, validSigs, false, true}, - {"not enough signers", []cryptotypes.PrivKey{priv1, priv2}, []uint64{accs[0].GetAccountNumber(), accs[1].GetAccountNumber()}, []uint64{0, 0}, validSigs, false, true}, - {"wrong order signers", []cryptotypes.PrivKey{priv3, priv2, priv1}, []uint64{accs[2].GetAccountNumber(), accs[1].GetAccountNumber(), accs[0].GetAccountNumber()}, []uint64{0, 0, 0}, validSigs, false, true}, - {"wrong accnums", []cryptotypes.PrivKey{priv1, priv2, priv3}, []uint64{7, 8, 9}, []uint64{0, 0, 0}, validSigs, false, true}, - {"wrong sequences", []cryptotypes.PrivKey{priv1, priv2, priv3}, []uint64{accs[0].GetAccountNumber(), accs[1].GetAccountNumber(), accs[2].GetAccountNumber()}, []uint64{3, 4, 5}, validSigs, false, true}, - {"valid tx", []cryptotypes.PrivKey{priv1, priv2, priv3}, []uint64{accs[0].GetAccountNumber(), accs[1].GetAccountNumber(), accs[2].GetAccountNumber()}, []uint64{0, 0, 0}, validSigs, false, false}, - {"no err on recheck", []cryptotypes.PrivKey{priv1, priv2, priv3}, []uint64{0, 0, 0}, []uint64{0, 0, 0}, !validSigs, true, false}, + {"no signers", []cryptotypes.PrivKey{}, []uint64{}, []uint64{}, validSigs, false, true, true}, + {"not enough signers", []cryptotypes.PrivKey{priv1, priv2}, []uint64{accs[0].GetAccountNumber(), accs[1].GetAccountNumber()}, []uint64{0, 0}, validSigs, false, true, true}, + {"wrong order signers", []cryptotypes.PrivKey{priv3, priv2, priv1}, []uint64{accs[2].GetAccountNumber(), accs[1].GetAccountNumber(), accs[0].GetAccountNumber()}, []uint64{0, 0, 0}, validSigs, false, true, true}, + {"wrong accnums", []cryptotypes.PrivKey{priv1, priv2, priv3}, []uint64{7, 8, 9}, []uint64{0, 0, 0}, validSigs, false, true, true}, + {"wrong sequences", []cryptotypes.PrivKey{priv1, priv2, priv3}, []uint64{accs[0].GetAccountNumber(), accs[1].GetAccountNumber(), accs[2].GetAccountNumber()}, []uint64{3, 4, 5}, validSigs, false, true, true}, + {"valid tx", []cryptotypes.PrivKey{priv1, priv2, priv3}, []uint64{accs[0].GetAccountNumber(), accs[1].GetAccountNumber(), accs[2].GetAccountNumber()}, []uint64{0, 0, 0}, validSigs, false, true, false}, + {"sigverify tx with wrong order signers", []cryptotypes.PrivKey{priv3, priv2, priv1}, []uint64{accs[0].GetAccountNumber(), accs[1].GetAccountNumber(), accs[2].GetAccountNumber()}, []uint64{0, 0, 0}, validSigs, false, true, true}, + {"skip sigverify tx with wrong order signers", []cryptotypes.PrivKey{priv3, priv2, priv1}, []uint64{accs[0].GetAccountNumber(), accs[1].GetAccountNumber(), accs[2].GetAccountNumber()}, []uint64{0, 0, 0}, validSigs, false, false, false}, + {"no err on recheck", []cryptotypes.PrivKey{priv1, priv2, priv3}, []uint64{0, 0, 0}, []uint64{0, 0, 0}, !validSigs, true, true, false}, } for i, tc := range testCases { for _, signMode := range enabledSignModes { t.Run(fmt.Sprintf("%s with %s", tc.name, signMode), func(t *testing.T) { - suite.ctx = suite.ctx.WithIsReCheckTx(tc.recheck) + suite.ctx = suite.ctx.WithIsReCheckTx(tc.recheck).WithIsSigverifyTx(tc.sigverify) suite.txBuilder = suite.clientCtx.TxConfig.NewTxBuilder() // Create new txBuilder for each test require.NoError(t, suite.txBuilder.SetMsgs(msgs...)) @@ -333,27 +336,76 @@ func TestIncrementSequenceDecorator(t *testing.T) { suite.txBuilder.SetFeeAmount(feeAmount) suite.txBuilder.SetGasLimit(gasLimit) - tx, err := suite.CreateTestTx(suite.ctx, privs, accNums, accSeqs, suite.ctx.ChainID(), signing.SignMode_SIGN_MODE_DIRECT) - require.NoError(t, err) - isd := ante.NewIncrementSequenceDecorator(suite.accountKeeper) antehandler := sdk.ChainAnteDecorators(isd) testCases := []struct { - ctx sdk.Context - simulate bool - expectedSeq uint64 + name string + ctx sdk.Context + simulate bool + createTx func() sdk.Tx + expectSeqInc bool }{ - {suite.ctx.WithIsReCheckTx(true), false, 1}, - {suite.ctx.WithIsCheckTx(true).WithIsReCheckTx(false), false, 2}, - {suite.ctx.WithIsReCheckTx(true), false, 3}, - {suite.ctx.WithIsReCheckTx(true), false, 4}, - {suite.ctx.WithIsReCheckTx(true), true, 5}, + { + "inc on recheck no sim", + suite.ctx.WithIsReCheckTx(true), + false, + func() sdk.Tx { + tx, err := suite.CreateTestTx(suite.ctx, privs, accNums, accSeqs, suite.ctx.ChainID(), signing.SignMode_SIGN_MODE_DIRECT) + require.NoError(t, err) + return tx + }, + true, + }, + { + "inc on no recheck, no sim", + suite.ctx.WithIsReCheckTx(false), + false, + func() sdk.Tx { + tx, err := suite.CreateTestTx(suite.ctx, privs, accNums, accSeqs, suite.ctx.ChainID(), signing.SignMode_SIGN_MODE_DIRECT) + require.NoError(t, err) + return tx + }, + true, + }, + { + "inc on recheck and sim", + suite.ctx.WithIsReCheckTx(true), + true, + func() sdk.Tx { + tx, err := suite.CreateTestTx(suite.ctx, privs, accNums, accSeqs, suite.ctx.ChainID(), signing.SignMode_SIGN_MODE_DIRECT) + require.NoError(t, err) + return tx + }, + true, + }, + { + "no inc on unordered", + suite.ctx.WithIsReCheckTx(true), + true, + func() sdk.Tx { + tx, err := suite.CreateTestUnorderedTx(suite.ctx, privs, accNums, accSeqs, suite.ctx.ChainID(), signing.SignMode_SIGN_MODE_DIRECT, true, time.Now().Add(time.Hour)) + require.NoError(t, err) + return tx + }, + false, + }, } for i, tc := range testCases { - _, err := antehandler(tc.ctx, tx, tc.simulate) - require.NoError(t, err, "unexpected error; tc #%d, %v", i, tc) - require.Equal(t, tc.expectedSeq, suite.accountKeeper.GetAccount(suite.ctx, addr).GetSequence()) + t.Run(tc.name, func(t *testing.T) { + beforeSeq := suite.accountKeeper.GetAccount(suite.ctx, addr).GetSequence() + + _, err := antehandler(tc.ctx, tc.createTx(), tc.simulate) + require.NoError(t, err, "unexpected error; tc #%d, %v", i, tc) + + afterSeq := suite.accountKeeper.GetAccount(suite.ctx, addr).GetSequence() + + if tc.expectSeqInc { + require.Equal(t, beforeSeq+1, afterSeq) + } else { + require.Equal(t, beforeSeq, afterSeq) + } + }) } } diff --git a/x/auth/ante/testutil/expected_keepers_mocks.go b/x/auth/ante/testutil/expected_keepers_mocks.go index f6c54d54179d..9eb2504fb0d8 100644 --- a/x/auth/ante/testutil/expected_keepers_mocks.go +++ b/x/auth/ante/testutil/expected_keepers_mocks.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: x/auth/ante/expected_keepers.go +// +// Generated by this command: +// +// mockgen -source=x/auth/ante/expected_keepers.go -package testutil -destination x/auth/ante/testutil/expected_keepers_mocks.go +// // Package testutil is a generated GoMock package. package testutil @@ -11,13 +16,14 @@ import ( address "cosmossdk.io/core/address" types "github.com/cosmos/cosmos-sdk/types" types0 "github.com/cosmos/cosmos-sdk/x/auth/types" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockAccountKeeper is a mock of AccountKeeper interface. type MockAccountKeeper struct { ctrl *gomock.Controller recorder *MockAccountKeeperMockRecorder + isgomock struct{} } // MockAccountKeeperMockRecorder is the mock recorder for MockAccountKeeper. @@ -60,7 +66,7 @@ func (m *MockAccountKeeper) GetAccount(ctx context.Context, addr types.AccAddres } // GetAccount indicates an expected call of GetAccount. -func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetAccount), ctx, addr) } @@ -74,7 +80,7 @@ func (m *MockAccountKeeper) GetModuleAddress(moduleName string) types.AccAddress } // GetModuleAddress indicates an expected call of GetModuleAddress. -func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(moduleName interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(moduleName any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAddress", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAddress), moduleName) } @@ -88,7 +94,7 @@ func (m *MockAccountKeeper) GetParams(ctx context.Context) types0.Params { } // GetParams indicates an expected call of GetParams. -func (mr *MockAccountKeeperMockRecorder) GetParams(ctx interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) GetParams(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetParams", reflect.TypeOf((*MockAccountKeeper)(nil).GetParams), ctx) } @@ -100,7 +106,7 @@ func (m *MockAccountKeeper) SetAccount(ctx context.Context, acc types.AccountI) } // SetAccount indicates an expected call of SetAccount. -func (mr *MockAccountKeeperMockRecorder) SetAccount(ctx, acc interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) SetAccount(ctx, acc any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetAccount", reflect.TypeOf((*MockAccountKeeper)(nil).SetAccount), ctx, acc) } @@ -109,6 +115,7 @@ func (mr *MockAccountKeeperMockRecorder) SetAccount(ctx, acc interface{}) *gomoc type MockFeegrantKeeper struct { ctrl *gomock.Controller recorder *MockFeegrantKeeperMockRecorder + isgomock struct{} } // MockFeegrantKeeperMockRecorder is the mock recorder for MockFeegrantKeeper. @@ -137,7 +144,7 @@ func (m *MockFeegrantKeeper) UseGrantedFees(ctx context.Context, granter, grante } // UseGrantedFees indicates an expected call of UseGrantedFees. -func (mr *MockFeegrantKeeperMockRecorder) UseGrantedFees(ctx, granter, grantee, fee, msgs interface{}) *gomock.Call { +func (mr *MockFeegrantKeeperMockRecorder) UseGrantedFees(ctx, granter, grantee, fee, msgs any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UseGrantedFees", reflect.TypeOf((*MockFeegrantKeeper)(nil).UseGrantedFees), ctx, granter, grantee, fee, msgs) } diff --git a/x/auth/ante/testutil_test.go b/x/auth/ante/testutil_test.go index c22c4b7bd71e..f04321a6e288 100644 --- a/x/auth/ante/testutil_test.go +++ b/x/auth/ante/testutil_test.go @@ -2,33 +2,33 @@ package ante_test import ( "testing" + "time" abci "github.com/cometbft/cometbft/abci/types" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" // TODO We don't need to import these API types if we use gogo's registry // ref: https://github.com/cosmos/cosmos-sdk/issues/14647 _ "cosmossdk.io/api/cosmos/bank/v1beta1" _ "cosmossdk.io/api/cosmos/crypto/secp256k1" - - "github.com/cosmos/cosmos-sdk/runtime" - _ "github.com/cosmos/cosmos-sdk/testutil/testdata/testpb" - storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/tx" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/testutil" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/cosmos/cosmos-sdk/testutil/testdata" + _ "github.com/cosmos/cosmos-sdk/testutil/testdata/testpb" sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/x/auth" "github.com/cosmos/cosmos-sdk/x/auth/ante" antetestutil "github.com/cosmos/cosmos-sdk/x/auth/ante/testutil" + authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec" "github.com/cosmos/cosmos-sdk/x/auth/keeper" xauthsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" authtestutil "github.com/cosmos/cosmos-sdk/x/auth/testutil" @@ -79,7 +79,8 @@ func SetupTestSuite(t *testing.T, isCheckTx bool) *AnteTestSuite { } suite.accountKeeper = keeper.NewAccountKeeper( - suite.encCfg.Codec, runtime.NewKVStoreService(key), types.ProtoBaseAccount, maccPerms, sdk.Bech32MainPrefix, types.NewModuleAddress("gov").String(), + suite.encCfg.Codec, runtime.NewKVStoreService(key), types.ProtoBaseAccount, maccPerms, authcodec.NewBech32Codec("cosmos"), + sdk.Bech32MainPrefix, types.NewModuleAddress("gov").String(), ) suite.accountKeeper.GetModuleAccount(suite.ctx, types.FeeCollectorName) err := suite.accountKeeper.Params.Set(suite.ctx, types.DefaultParams()) @@ -257,3 +258,59 @@ func (suite *AnteTestSuite) CreateTestTx( return suite.txBuilder.GetTx(), nil } + +func (suite *AnteTestSuite) CreateTestUnorderedTx( + ctx sdk.Context, privs []cryptotypes.PrivKey, + accNums, accSeqs []uint64, + chainID string, signMode signing.SignMode, + unordered bool, unorderedTimeout time.Time, +) (xauthsigning.Tx, error) { + suite.txBuilder.SetUnordered(unordered) + suite.txBuilder.SetTimeoutTimestamp(unorderedTimeout) + + // First round: we gather all the signer infos. We use the "set empty + // signature" hack to do that. + var sigsV2 []signing.SignatureV2 + for i, priv := range privs { + sigV2 := signing.SignatureV2{ + PubKey: priv.PubKey(), + Data: &signing.SingleSignatureData{ + SignMode: signMode, + Signature: nil, + }, + Sequence: accSeqs[i], + } + + sigsV2 = append(sigsV2, sigV2) + } + err := suite.txBuilder.SetSignatures(sigsV2...) + if err != nil { + return nil, err + } + + // Second round: all signer infos are set, so each signer can sign. + sigsV2 = []signing.SignatureV2{} + for i, priv := range privs { + signerData := xauthsigning.SignerData{ + Address: sdk.AccAddress(priv.PubKey().Address()).String(), + ChainID: chainID, + AccountNumber: accNums[i], + Sequence: accSeqs[i], + PubKey: priv.PubKey(), + } + sigV2, err := tx.SignWithPrivKey( + ctx, signMode, signerData, + suite.txBuilder, priv, suite.clientCtx.TxConfig, accSeqs[i]) + if err != nil { + return nil, err + } + + sigsV2 = append(sigsV2, sigV2) + } + err = suite.txBuilder.SetSignatures(sigsV2...) + if err != nil { + return nil, err + } + + return suite.txBuilder.GetTx(), nil +} diff --git a/x/auth/ante/unordered.go b/x/auth/ante/unordered.go new file mode 100644 index 000000000000..a97878959efa --- /dev/null +++ b/x/auth/ante/unordered.go @@ -0,0 +1,233 @@ +package ante + +import ( + "bytes" + "crypto/sha256" + "encoding/binary" + "fmt" + "sync" + "time" + + "github.com/cosmos/gogoproto/proto" + + errorsmod "cosmossdk.io/errors" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/types/tx/signing" + "github.com/cosmos/cosmos-sdk/x/auth/ante/unorderedtx" + authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" +) + +// bufPool is a pool of bytes.Buffer objects to reduce memory allocations. +var bufPool = sync.Pool{ + New: func() interface{} { + return new(bytes.Buffer) + }, +} + +// DefaultSha256GasCost is the suggested default gas cost for Sha256 operations in unordered transaction handling. +const DefaultSha256GasCost = 25 + +var _ sdk.AnteDecorator = (*UnorderedTxDecorator)(nil) + +// UnorderedTxDecorator defines an AnteHandler decorator that is responsible for +// checking if a transaction is intended to be unordered and if so, evaluates +// the transaction accordingly. An unordered transaction will bypass having its +// nonce incremented, which allows fire-and-forget along with possible parallel +// transaction processing, without having to deal with nonces. +// +// The transaction sender must ensure that unordered=true and a timeout_height +// is appropriately set. The AnteHandler will check that the transaction is not +// a duplicate and will evict it from memory when the timeout is reached. +// +// The UnorderedTxDecorator should be placed as early as possible in the AnteHandler +// chain to ensure that during DeliverTx, the transaction is added to the UnorderedTxManager. +type UnorderedTxDecorator struct { + // maxUnOrderedTTL defines the maximum TTL a transaction can define. + maxTimeoutDuration time.Duration + txManager *unorderedtx.Manager + sha256GasCost uint64 +} + +func NewUnorderedTxDecorator( + maxDuration time.Duration, + m *unorderedtx.Manager, + sha256GasCost uint64, +) *UnorderedTxDecorator { + return &UnorderedTxDecorator{ + maxTimeoutDuration: maxDuration, + txManager: m, + sha256GasCost: sha256GasCost, + } +} + +func (d *UnorderedTxDecorator) AnteHandle( + ctx sdk.Context, + tx sdk.Tx, + _ bool, + next sdk.AnteHandler, +) (sdk.Context, error) { + if err := d.ValidateTx(ctx, tx); err != nil { + return ctx, err + } + return next(ctx, tx, false) +} + +func (d *UnorderedTxDecorator) ValidateTx(ctx sdk.Context, tx sdk.Tx) error { + unorderedTx, ok := tx.(sdk.TxWithUnordered) + if !ok || !unorderedTx.GetUnordered() { + // If the transaction does not implement unordered capabilities or has the + // unordered value as false, we bypass. + return nil + } + + blockTime := ctx.BlockTime() + timeoutTimestamp := unorderedTx.GetTimeoutTimeStamp() + if timeoutTimestamp.IsZero() || timeoutTimestamp.Unix() == 0 { + return errorsmod.Wrap( + sdkerrors.ErrInvalidRequest, + "unordered transaction must have timeout_timestamp set", + ) + } + if timeoutTimestamp.Before(blockTime) { + return errorsmod.Wrap( + sdkerrors.ErrInvalidRequest, + "unordered transaction has a timeout_timestamp that has already passed", + ) + } + if timeoutTimestamp.After(blockTime.Add(d.maxTimeoutDuration)) { + return errorsmod.Wrapf( + sdkerrors.ErrInvalidRequest, + "unordered tx ttl exceeds %s", + d.maxTimeoutDuration.String(), + ) + } + + // consume gas in all exec modes to avoid gas estimation discrepancies + ctx.GasMeter().ConsumeGas(d.sha256GasCost, "consume gas for calculating tx hash") + + // Avoid checking for duplicates and creating the identifier in simulation mode + // This is done to avoid sha256 computation in simulation mode + if ctx.ExecMode() == sdk.ExecModeSimulate { + return nil + } + + // calculate the tx hash + txHash, err := TxHashFromTimeout(uint64(timeoutTimestamp.Unix()), tx) + if err != nil { + return err + } + + // check for duplicates + if d.txManager.Contains(txHash) { + return errorsmod.Wrap( + sdkerrors.ErrInvalidRequest, + "tx %X is duplicated", + ) + } + if ctx.ExecMode() == sdk.ExecModeFinalize { + // a new tx included in the block, add the hash to the unordered tx manager + d.txManager.Add(txHash, timeoutTimestamp) + } + + return nil +} + +// TxHashFromTimeout returns a TxHash for an unordered transaction. +func TxHashFromTimeout(timeout uint64, tx sdk.Tx) (unorderedtx.TxHash, error) { + sigTx, ok := tx.(authsigning.Tx) + if !ok { + return unorderedtx.TxHash{}, errorsmod.Wrap(sdkerrors.ErrTxDecode, "invalid transaction type") + } + + if sigTx.GetFee().IsZero() { + return unorderedtx.TxHash{}, errorsmod.Wrap( + sdkerrors.ErrInvalidRequest, + "unordered transaction must have a fee", + ) + } + + buf := bufPool.Get().(*bytes.Buffer) + // Make sure to reset the buffer + buf.Reset() + defer bufPool.Put(buf) + + // Add signatures to the transaction identifier + signatures, err := sigTx.GetSignaturesV2() + if err != nil { + return unorderedtx.TxHash{}, err + } + + for _, sig := range signatures { + if err := addSignatures(sig.Data, buf); err != nil { + return unorderedtx.TxHash{}, err + } + } + + // Use the buffer + for _, msg := range tx.GetMsgs() { + // loop through the messages and write them to the buffer + // encoding the msg to bytes makes it deterministic within the state machine. + // Malleability is not a concern here because the state machine will encode the transaction deterministically. + bz, err := proto.Marshal(msg) + if err != nil { + return unorderedtx.TxHash{}, errorsmod.Wrap( + sdkerrors.ErrInvalidRequest, + "failed to marshal message", + ) + } + + if _, err := buf.Write(bz); err != nil { + return unorderedtx.TxHash{}, errorsmod.Wrap( + sdkerrors.ErrInvalidRequest, + "failed to write message to buffer", + ) + } + } + + // write the timeout height to the buffer + if err := binary.Write(buf, binary.LittleEndian, timeout); err != nil { + return unorderedtx.TxHash{}, errorsmod.Wrap( + sdkerrors.ErrInvalidRequest, + "failed to write timeout_height to buffer", + ) + } + + // write gas to the buffer + if err := binary.Write(buf, binary.LittleEndian, sigTx.GetGas()); err != nil { + return unorderedtx.TxHash{}, errorsmod.Wrap( + sdkerrors.ErrInvalidRequest, + "failed to write unordered to buffer", + ) + } + + txHash := sha256.Sum256(buf.Bytes()) + + // Return the Buffer to the pool + return txHash, nil +} + +func addSignatures(sig signing.SignatureData, buf *bytes.Buffer) error { + switch data := sig.(type) { + case *signing.SingleSignatureData: + if _, err := buf.Write(data.Signature); err != nil { + return errorsmod.Wrap( + sdkerrors.ErrInvalidRequest, + "failed to write single signature to buffer", + ) + } + return nil + + case *signing.MultiSignatureData: + for _, sigdata := range data.Signatures { + if err := addSignatures(sigdata, buf); err != nil { + return err + } + } + default: + return fmt.Errorf("unexpected SignatureData %T", data) + } + + return nil +} diff --git a/x/auth/ante/unordered_test.go b/x/auth/ante/unordered_test.go new file mode 100644 index 000000000000..99d7c90f09c5 --- /dev/null +++ b/x/auth/ante/unordered_test.go @@ -0,0 +1,172 @@ +package ante_test + +import ( + "testing" + "time" + + "github.com/stretchr/testify/require" + + storetypes "cosmossdk.io/store/types" + + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + "github.com/cosmos/cosmos-sdk/testutil/testdata" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/tx/signing" + "github.com/cosmos/cosmos-sdk/x/auth/ante" + "github.com/cosmos/cosmos-sdk/x/auth/ante/unorderedtx" +) + +const gasConsumed = uint64(25) + +func TestUnorderedTxDecorator_OrderedTx(t *testing.T) { + txm := unorderedtx.NewManager(t.TempDir()) + defer func() { + require.NoError(t, txm.Close()) + }() + + txm.Start() + + SetupTestSuite(t, false) + + chain := sdk.ChainAnteDecorators(ante.NewUnorderedTxDecorator(unorderedtx.DefaultMaxTimeoutDuration, txm, ante.DefaultSha256GasCost)) + + tx, txBz := genUnorderedTx(t, false, time.Time{}) + ctx := sdk.Context{}.WithTxBytes(txBz) + + _, err := chain(ctx, tx, false) + require.NoError(t, err) +} + +func TestUnorderedTxDecorator_UnorderedTx_NoTTL(t *testing.T) { + txm := unorderedtx.NewManager(t.TempDir()) + defer func() { + require.NoError(t, txm.Close()) + }() + + txm.Start() + + SetupTestSuite(t, false) + + chain := sdk.ChainAnteDecorators(ante.NewUnorderedTxDecorator(unorderedtx.DefaultMaxTimeoutDuration, txm, ante.DefaultSha256GasCost)) + + tx, txBz := genUnorderedTx(t, true, time.Time{}) + ctx := sdk.Context{}.WithTxBytes(txBz) + + _, err := chain(ctx, tx, false) + require.Error(t, err) +} + +func TestUnorderedTxDecorator_UnorderedTx_InvalidTTL(t *testing.T) { + txm := unorderedtx.NewManager(t.TempDir()) + defer func() { + require.NoError(t, txm.Close()) + }() + + txm.Start() + + SetupTestSuite(t, false) + + chain := sdk.ChainAnteDecorators(ante.NewUnorderedTxDecorator(unorderedtx.DefaultMaxTimeoutDuration, txm, ante.DefaultSha256GasCost)) + + tx, txBz := genUnorderedTx(t, true, time.Now().Add(unorderedtx.DefaultMaxTimeoutDuration+time.Second)) + ctx := sdk.Context{}.WithTxBytes(txBz).WithBlockTime(time.Now()) + _, err := chain(ctx, tx, false) + require.Error(t, err) +} + +func TestUnorderedTxDecorator_UnorderedTx_AlreadyExists(t *testing.T) { + txm := unorderedtx.NewManager(t.TempDir()) + defer func() { + require.NoError(t, txm.Close()) + }() + + txm.Start() + + SetupTestSuite(t, false) + + chain := sdk.ChainAnteDecorators(ante.NewUnorderedTxDecorator(unorderedtx.DefaultMaxTimeoutDuration, txm, ante.DefaultSha256GasCost)) + + tx, txBz := genUnorderedTx(t, true, time.Now().Add(time.Minute)) + ctx := sdk.Context{}.WithTxBytes(txBz).WithBlockTime(time.Now()).WithGasMeter(storetypes.NewGasMeter(gasConsumed)) + + bz := [32]byte{} + copy(bz[:], txBz[:32]) + txm.Add(bz, time.Now().Add(time.Minute)) + + _, err := chain(ctx, tx, false) + require.Error(t, err) +} + +func TestUnorderedTxDecorator_UnorderedTx_ValidCheckTx(t *testing.T) { + txm := unorderedtx.NewManager(t.TempDir()) + defer func() { + require.NoError(t, txm.Close()) + }() + + txm.Start() + + SetupTestSuite(t, false) + + chain := sdk.ChainAnteDecorators(ante.NewUnorderedTxDecorator(unorderedtx.DefaultMaxTimeoutDuration, txm, ante.DefaultSha256GasCost)) + + tx, txBz := genUnorderedTx(t, true, time.Now().Add(time.Minute)) + ctx := sdk.Context{}.WithTxBytes(txBz).WithBlockTime(time.Now()).WithExecMode(sdk.ExecModeCheck).WithGasMeter(storetypes.NewGasMeter(gasConsumed)) + + _, err := chain(ctx, tx, false) + require.NoError(t, err) +} + +func TestUnorderedTxDecorator_UnorderedTx_ValidDeliverTx(t *testing.T) { + txm := unorderedtx.NewManager(t.TempDir()) + defer func() { + require.NoError(t, txm.Close()) + }() + + txm.Start() + + SetupTestSuite(t, false) + + chain := sdk.ChainAnteDecorators(ante.NewUnorderedTxDecorator(unorderedtx.DefaultMaxTimeoutDuration, txm, ante.DefaultSha256GasCost)) + + tx, txBz := genUnorderedTx(t, true, time.Now().Add(time.Minute)) + ctx := sdk.Context{}.WithTxBytes(txBz).WithBlockTime(time.Now()).WithExecMode(sdk.ExecModeFinalize).WithGasMeter(storetypes.NewGasMeter(gasConsumed)) + + _, err := chain(ctx, tx, false) + require.NoError(t, err) + + bz := [32]byte{} + copy(bz[:], txBz[:32]) + + require.True(t, txm.Contains(bz)) +} + +func genUnorderedTx(t *testing.T, unordered bool, timestamp time.Time) (sdk.Tx, []byte) { + t.Helper() + + s := SetupTestSuite(t, true) + s.txBuilder = s.clientCtx.TxConfig.NewTxBuilder() + + // keys and addresses + priv1, _, addr1 := testdata.KeyTestPubAddr() + + // msg and signatures + msg := testdata.NewTestMsg(addr1) + feeAmount := testdata.NewTestFeeAmount() + gasLimit := testdata.NewTestGasLimit() + require.NoError(t, s.txBuilder.SetMsgs(msg)) + + s.txBuilder.SetFeeAmount(feeAmount) + s.txBuilder.SetGasLimit(gasLimit) + s.txBuilder.SetUnordered(unordered) + s.txBuilder.SetTimeoutTimestamp(timestamp) + + privKeys, accNums, accSeqs := []cryptotypes.PrivKey{priv1}, []uint64{0}, []uint64{0} + tx, err := s.CreateTestTx(s.ctx, privKeys, accNums, accSeqs, s.ctx.ChainID(), signing.SignMode_SIGN_MODE_DIRECT) + require.NoError(t, err) + + txBz, err := ante.TxHashFromTimeout(uint64(timestamp.Unix()), tx) + + require.NoError(t, err) + + return tx, txBz[:] +} diff --git a/x/auth/ante/unorderedtx/manager.go b/x/auth/ante/unorderedtx/manager.go new file mode 100644 index 000000000000..d41399deca85 --- /dev/null +++ b/x/auth/ante/unorderedtx/manager.go @@ -0,0 +1,286 @@ +package unorderedtx + +import ( + "bufio" + "bytes" + "context" + "encoding/binary" + "errors" + "fmt" + "io" + "maps" + "os" + "path/filepath" + "slices" + "sync" + "time" +) + +const ( + // DefaultMaxTimeoutDuration defines the default maximum duration an un-ordered transaction + // can set. + DefaultMaxTimeoutDuration = time.Minute * 40 + + dirName = "unordered_txs" + fileName = "data" +) + +// TxHash defines a transaction hash type alias, which is a fixed array of 32 bytes. +type TxHash [32]byte + +// Manager contains the tx hash dictionary for duplicates checking, and expire +// them when block production progresses. +type Manager struct { + // blockTimeCh defines a channel to receive newly committed block time + blockTimeCh chan time.Time + // doneCh allows us to ensure the purgeLoop has gracefully terminated prior to closing + doneCh chan struct{} + + // dataDir defines the directory to store unexpired unordered transactions + // + // XXX: Note, ideally we avoid the need to store unexpired unordered transactions + // directly to file. However, store v1 does not allow such a primitive. But, + // once store v2 is fully integrated, we can remove manual file handling and + // store the unexpired unordered transactions directly to SS. + // + // Ref: https://github.com/cosmos/cosmos-sdk/issues/18467 + dataDir string + + mu sync.RWMutex + + // txHashes defines a map from tx hash -> TTL value defined as block time, which is used for duplicate + // checking and replay protection, as well as purging the map when the TTL is + // expired. + txHashes map[TxHash]time.Time +} + +func NewManager(dataDir string) *Manager { + path := filepath.Join(dataDir, dirName) + if _, err := os.Stat(path); errors.Is(err, os.ErrNotExist) { + if err = os.MkdirAll(path, os.ModePerm); err != nil { + panic(fmt.Errorf("failed to create unordered txs directory: %w", err)) + } + } + + m := &Manager{ + dataDir: dataDir, + blockTimeCh: make(chan time.Time, 16), + doneCh: make(chan struct{}), + txHashes: make(map[TxHash]time.Time), + } + + return m +} + +func (m *Manager) Start() { + go m.purgeLoop() +} + +// Close must be called when a node gracefully shuts down. Typically, this should +// be called in an application's Close() function, which is called by the server. +// Note, Start() must be called in order for Close() to not hang. +// +// It will free all necessary resources as well as writing all unexpired unordered +// transactions along with their TTL values to file. +func (m *Manager) Close() error { + close(m.blockTimeCh) + <-m.doneCh + m.blockTimeCh = nil + + return m.flushToFile() +} + +func (m *Manager) Contains(hash TxHash) bool { + m.mu.RLock() + defer m.mu.RUnlock() + _, ok := m.txHashes[hash] + return ok +} + +func (m *Manager) Size() int { + m.mu.RLock() + defer m.mu.RUnlock() + + return len(m.txHashes) +} + +func (m *Manager) Add(txHash TxHash, timestamp time.Time) { + m.mu.Lock() + defer m.mu.Unlock() + + m.txHashes[txHash] = timestamp +} + +// OnInit must be called when a node starts up. Typically, this should be called +// in an application's constructor, which is called by the server. +func (m *Manager) OnInit() error { + f, err := os.Open(filepath.Join(m.dataDir, dirName, fileName)) + if err != nil { + if errors.Is(err, os.ErrNotExist) { + // File does not exist, which we can assume that there are no unexpired + // unordered transactions. + return nil + } + + return fmt.Errorf("failed to open unconfirmed txs file: %w", err) + } + defer f.Close() + + var ( + r = bufio.NewReader(f) + buf = make([]byte, chunkSize) + ) + for { + n, err := io.ReadFull(r, buf) + if err != nil { + if errors.Is(err, io.EOF) { + break + } else { + return fmt.Errorf("failed to read unconfirmed txs file: %w", err) + } + } + if n != 32+8 { + return fmt.Errorf("read unexpected number of bytes from unconfirmed txs file: %d", n) + } + + var txHash TxHash + copy(txHash[:], buf[:txHashSize]) + + timeStamp := binary.BigEndian.Uint64(buf[txHashSize:]) + m.Add(txHash, time.Unix(int64(timeStamp), 0)) + } + + return nil +} + +// OnNewBlock sends the latest block time to the background purge loop, which +// should be called in ABCI Commit event. +func (m *Manager) OnNewBlock(blockTime time.Time) { + m.blockTimeCh <- blockTime +} + +func (m *Manager) exportSnapshot(_ uint64, snapshotWriter func([]byte) error) error { + var buf bytes.Buffer + w := bufio.NewWriter(&buf) + + keys := slices.SortedFunc(maps.Keys(m.txHashes), func(i, j TxHash) int { return bytes.Compare(i[:], j[:]) }) + for _, txHash := range keys { + timeoutTime := m.txHashes[txHash] + + // right now we dont have access block time at this flow, so we would just include the expired txs + // and let it be purge during purge loop + chunk := unorderedTxToBytes(txHash, uint64(timeoutTime.Unix())) + + if _, err := w.Write(chunk); err != nil { + return fmt.Errorf("failed to write unordered tx to buffer: %w", err) + } + } + + if err := w.Flush(); err != nil { + return fmt.Errorf("failed to flush unordered txs buffer: %w", err) + } + + return snapshotWriter(buf.Bytes()) +} + +// flushToFile writes all unordered transactions (including expired if not pruned yet) +// along with their TTL to file, overwriting the existing file if it exists. +func (m *Manager) flushToFile() error { + f, err := os.Create(filepath.Join(m.dataDir, dirName, fileName)) + if err != nil { + return fmt.Errorf("failed to create unordered txs file: %w", err) + } + defer f.Close() + + w := bufio.NewWriter(f) + for txHash, timestamp := range m.txHashes { + chunk := unorderedTxToBytes(txHash, uint64(timestamp.Unix())) + + if _, err = w.Write(chunk); err != nil { + return fmt.Errorf("failed to write unordered tx to buffer: %w", err) + } + } + + if err = w.Flush(); err != nil { + return fmt.Errorf("failed to flush unordered txs buffer: %w", err) + } + + return nil +} + +// expiredTxs returns expired tx hashes based on the provided block time. +func (m *Manager) expiredTxs(blockTime time.Time) []TxHash { + m.mu.RLock() + defer m.mu.RUnlock() + + var result []TxHash + for txHash, timestamp := range m.txHashes { + if blockTime.After(timestamp) { + result = append(result, txHash) + } + } + + return result +} + +func (m *Manager) purge(txHashes []TxHash) { + m.mu.Lock() + defer m.mu.Unlock() + + for _, txHash := range txHashes { + delete(m.txHashes, txHash) + } +} + +// purgeLoop removes expired tx hashes in the background +func (m *Manager) purgeLoop() { + for { + latestTime, ok := m.batchReceive() + if !ok { + // channel closed + m.doneCh <- struct{}{} + return + } + + hashes := m.expiredTxs(latestTime) + if len(hashes) > 0 { + m.purge(hashes) + } + } +} + +// batchReceive receives block time from the channel until the context is done +// or the channel is closed. +func (m *Manager) batchReceive() (time.Time, bool) { + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + defer cancel() + + var latestTime time.Time + for { + select { + case <-ctx.Done(): + return latestTime, true + + case blockTime, ok := <-m.blockTimeCh: + if !ok { + // channel is closed + return time.Time{}, false + } + + if blockTime.After(latestTime) { + latestTime = blockTime + } + } + } +} + +func unorderedTxToBytes(txHash TxHash, ttl uint64) []byte { + chunk := make([]byte, chunkSize) + copy(chunk[:txHashSize], txHash[:]) + + ttlBz := make([]byte, timeoutSize) + binary.BigEndian.PutUint64(ttlBz, ttl) + copy(chunk[txHashSize:], ttlBz) + + return chunk +} diff --git a/x/auth/ante/unorderedtx/manager_test.go b/x/auth/ante/unorderedtx/manager_test.go new file mode 100644 index 000000000000..271a2627d4ae --- /dev/null +++ b/x/auth/ante/unorderedtx/manager_test.go @@ -0,0 +1,145 @@ +package unorderedtx_test + +import ( + "testing" + "time" + + "github.com/stretchr/testify/require" + + "github.com/cosmos/cosmos-sdk/x/auth/ante/unorderedtx" +) + +func TestUnorderedTxManager_Close(t *testing.T) { + txm := unorderedtx.NewManager(t.TempDir()) + txm.Start() + + require.NoError(t, txm.Close()) + require.Panics(t, func() { txm.Close() }) +} + +func TestUnorderedTxManager_SimpleSize(t *testing.T) { + txm := unorderedtx.NewManager(t.TempDir()) + defer func() { + require.NoError(t, txm.Close()) + }() + + txm.Start() + + txm.Add(unorderedtx.TxHash{0xFF}, time.Now()) + txm.Add(unorderedtx.TxHash{0xAA}, time.Now()) + txm.Add(unorderedtx.TxHash{0xCC}, time.Now()) + + require.Equal(t, 3, txm.Size()) +} + +func TestUnorderedTxManager_SimpleContains(t *testing.T) { + txm := unorderedtx.NewManager(t.TempDir()) + defer func() { + require.NoError(t, txm.Close()) + }() + + txm.Start() + + for i := 0; i < 10; i++ { + txHash := unorderedtx.TxHash{byte(i)} + txm.Add(txHash, time.Now()) + require.True(t, txm.Contains(txHash)) + } + + for i := 10; i < 20; i++ { + txHash := unorderedtx.TxHash{byte(i)} + require.False(t, txm.Contains(txHash)) + } +} + +func TestUnorderedTxManager_InitEmpty(t *testing.T) { + txm := unorderedtx.NewManager(t.TempDir()) + defer func() { + require.NoError(t, txm.Close()) + }() + + txm.Start() + + require.NoError(t, txm.OnInit()) +} + +func TestUnorderedTxManager_CloseInit(t *testing.T) { + dataDir := t.TempDir() + txm := unorderedtx.NewManager(dataDir) + txm.Start() + + // add a handful of unordered txs + for i := 0; i < 100; i++ { + txm.Add(unorderedtx.TxHash{byte(i)}, time.Now()) + } + + // close the manager, which should flush all unexpired txs to file + require.NoError(t, txm.Close()) + + // create a new manager, start it + txm2 := unorderedtx.NewManager(dataDir) + defer func() { + require.NoError(t, txm2.Close()) + }() + + // start and execute OnInit, which should load the unexpired txs from file + txm2.Start() + require.NoError(t, txm2.OnInit()) + require.Equal(t, 100, txm2.Size()) + + for i := 0; i < 100; i++ { + require.True(t, txm2.Contains(unorderedtx.TxHash{byte(i)})) + } +} + +func TestUnorderedTxManager_Flow(t *testing.T) { + txm := unorderedtx.NewManager(t.TempDir()) + defer func() { + require.NoError(t, txm.Close()) + }() + + txm.Start() + + currentTime := time.Now() + + // Seed the manager with a txs, some of which should eventually be purged and + // the others will remain. Txs with TTL less than or equal to 50 should be purged. + for i := 1; i <= 100; i++ { + txHash := unorderedtx.TxHash{byte(i)} + + if i <= 50 { + txm.Add(txHash, currentTime.Add(time.Millisecond*500*time.Duration(i))) + } else { + txm.Add(txHash, currentTime.Add(time.Hour)) + } + } + + // start a goroutine that mimics new blocks being made every 500ms + doneBlockCh := make(chan bool) + go func() { + ticker := time.NewTicker(time.Millisecond * 500) + defer ticker.Stop() + + for t := range ticker.C { + txm.OnNewBlock(t) + + if t.After(currentTime.Add(time.Millisecond * 500 * time.Duration(50))) { + doneBlockCh <- true + return + } + } + }() + + // Eventually all the txs that should be expired by block 50 should be purged. + // The remaining txs should remain. + require.Eventually( + t, + func() bool { + return txm.Size() == 50 + }, + 2*time.Minute, + 5*time.Second, + ) + + <-doneBlockCh +} diff --git a/x/auth/ante/unorderedtx/snapshotter.go b/x/auth/ante/unorderedtx/snapshotter.go new file mode 100644 index 000000000000..4c855c9e3167 --- /dev/null +++ b/x/auth/ante/unorderedtx/snapshotter.go @@ -0,0 +1,94 @@ +package unorderedtx + +import ( + "encoding/binary" + "errors" + "io" + "time" + + snapshot "cosmossdk.io/store/snapshots/types" +) + +const ( + txHashSize = 32 + timeoutSize = 8 + chunkSize = txHashSize + timeoutSize +) + +var _ snapshot.ExtensionSnapshotter = &Snapshotter{} + +const ( + // SnapshotFormat defines the snapshot format of exported unordered transactions. + // No protobuf envelope, no metadata. + SnapshotFormat = 1 + + // SnapshotName defines the snapshot name of exported unordered transactions. + SnapshotName = "unordered_txs" +) + +type Snapshotter struct { + m *Manager +} + +func NewSnapshotter(m *Manager) *Snapshotter { + return &Snapshotter{m: m} +} + +func (s *Snapshotter) SnapshotName() string { + return SnapshotName +} + +func (s *Snapshotter) SnapshotFormat() uint32 { + return SnapshotFormat +} + +func (s *Snapshotter) SupportedFormats() []uint32 { + return []uint32{SnapshotFormat} +} + +func (s *Snapshotter) SnapshotExtension(height uint64, payloadWriter snapshot.ExtensionPayloadWriter) error { + // export all unordered transactions as a single blob + return s.m.exportSnapshot(height, payloadWriter) +} + +func (s *Snapshotter) RestoreExtension(height uint64, format uint32, payloadReader snapshot.ExtensionPayloadReader) error { + if format == SnapshotFormat { + return s.restore(height, payloadReader) + } + + return snapshot.ErrUnknownFormat +} + +func (s *Snapshotter) restore(height uint64, payloadReader snapshot.ExtensionPayloadReader) error { + // the payload should be the entire set of unordered transactions + payload, err := payloadReader() + if err != nil { + if errors.Is(err, io.EOF) { + return io.ErrUnexpectedEOF + } + + return err + } + + if len(payload)%chunkSize != 0 { + return errors.New("invalid unordered txs payload length") + } + + var i int + for i < len(payload) { + var txHash TxHash + copy(txHash[:], payload[i:i+txHashSize]) + + timestamp := binary.BigEndian.Uint64(payload[i+txHashSize : i+chunkSize]) + + // add all txs, we don't care at this point if they are expired, + // we'll let the purge loop handle that + if timestamp != 0 { + s.m.Add(txHash, time.Unix(int64(timestamp), 0)) + } + + i += chunkSize + } + + return nil +} diff --git a/x/auth/ante/unorderedtx/snapshotter_test.go b/x/auth/ante/unorderedtx/snapshotter_test.go new file mode 100644 index 000000000000..a912d69aea0c --- /dev/null +++ b/x/auth/ante/unorderedtx/snapshotter_test.go @@ -0,0 +1,66 @@ +package unorderedtx_test + +import ( + "testing" + "time" + + "github.com/stretchr/testify/require" + + "github.com/cosmos/cosmos-sdk/x/auth/ante/unorderedtx" +) + +func TestSnapshotter(t *testing.T) { + dataDir := t.TempDir() + txm := unorderedtx.NewManager(dataDir) + + currentTime := time.Now() + + // add a handful of unordered txs + for i := 0; i < 100; i++ { + txm.Add(unorderedtx.TxHash{byte(i)}, currentTime.Add(time.Second*100)) + } + + var unorderedTxBz []byte + s := unorderedtx.NewSnapshotter(txm) + w := func(bz []byte) error { + unorderedTxBz = bz + return nil + } + + err := s.SnapshotExtension(50, w) + require.NoError(t, err) + require.NotEmpty(t, unorderedTxBz) + + pr := func() ([]byte, error) { + return unorderedTxBz, nil + } + + // restore with an invalid format which should result in an error + err = s.RestoreExtension(50, 2, pr) + require.Error(t, err) + + // restore with timestamp > timeout time which should result in all unordered txs synced, + // even the ones that have timed out. + txm2 := unorderedtx.NewManager(dataDir) + s2 := unorderedtx.NewSnapshotter(txm2) + err = s2.RestoreExtension(1, unorderedtx.SnapshotFormat, pr) + require.NoError(t, err) + require.Equal(t, 100, txm2.Size()) + + // start the manager and wait a bit for the background purge loop to run + txm2.Start() + txm2.OnNewBlock(currentTime.Add(time.Second * 200)) // blocks until channel is read in purge loop + // the loop runs every 5 seconds, so we need to wait for that + require.Eventually(t, func() bool { return txm2.Size() == 0 }, 6*time.Second, 500*time.Millisecond) + + // restore with timestamp < timeout time which should result in all unordered txs synced + txm3 := unorderedtx.NewManager(dataDir) + s3 := unorderedtx.NewSnapshotter(txm3) + err = s3.RestoreExtension(uint64(currentTime.Add(time.Second*50).Unix()), unorderedtx.SnapshotFormat, pr) + require.NoError(t, err) + require.Equal(t, 100, txm3.Size()) + + for i := 0; i < 100; i++ { + require.True(t, txm3.Contains(unorderedtx.TxHash{byte(i)})) + } +} diff --git a/x/auth/autocli.go b/x/auth/autocli.go index 3eaa323cc70a..6d60e1d8becc 100644 --- a/x/auth/autocli.go +++ b/x/auth/autocli.go @@ -1,8 +1,14 @@ package auth import ( + "fmt" + authv1beta1 "cosmossdk.io/api/cosmos/auth/v1beta1" autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + _ "cosmossdk.io/api/cosmos/crypto/secp256k1" // register to that it shows up in protoregistry.GlobalTypes + _ "cosmossdk.io/api/cosmos/crypto/secp256r1" // register to that it shows up in protoregistry.GlobalTypes + + "github.com/cosmos/cosmos-sdk/version" ) // AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. @@ -11,20 +17,73 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { Query: &autocliv1.ServiceCommandDescriptor{ Service: authv1beta1.Query_ServiceDesc.ServiceName, RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Accounts", + Use: "accounts", + Short: "Query all the accounts", + }, { RpcMethod: "Account", Use: "account [address]", - Short: "query account by address", + Short: "Query account by address", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "address"}}, + }, + { + RpcMethod: "AccountInfo", + Use: "account-info [address]", + Short: "Query account info which is common to all account types.", PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "address"}}, }, { RpcMethod: "AccountAddressByID", Use: "address-by-acc-num [acc-num]", - Short: "query account address by account number", - PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "id"}}, + Short: "Query account address by account number", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "account_id"}}, + }, + { + RpcMethod: "ModuleAccounts", + Use: "module-accounts", + Short: "Query all module accounts", + }, + { + RpcMethod: "ModuleAccountByName", + Use: "module-account [module-name]", + Short: "Query module account info by module name", + Example: fmt.Sprintf("%s q auth module-account gov", version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "name"}}, + }, + { + RpcMethod: "AddressBytesToString", + Use: "address-bytes-to-string [address-bytes]", + Short: "Transform an address bytes to string", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "address_bytes"}}, + }, + { + RpcMethod: "AddressStringToBytes", + Use: "address-string-to-bytes [address-string]", + Short: "Transform an address string to bytes", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "address_string"}}, + }, + { + RpcMethod: "Bech32Prefix", + Use: "bech32-prefix", + Short: "Query the chain bech32 prefix (if applicable)", + }, + { + RpcMethod: "Params", + Use: "params", + Short: "Query the current auth parameters", + }, + }, + }, + Tx: &autocliv1.ServiceCommandDescriptor{ + Service: authv1beta1.Msg_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "UpdateParams", + Skip: true, // skipped because authority gated }, }, }, - // Tx is purposely left empty, as the only tx is MsgUpdateParams which is gov gated. } } diff --git a/x/auth/client/cli/decode.go b/x/auth/client/cli/decode.go index 72a8a600ce73..2d49806b1244 100644 --- a/x/auth/client/cli/decode.go +++ b/x/auth/client/cli/decode.go @@ -48,6 +48,7 @@ func GetDecodeCommand() *cobra.Command { cmd.Flags().BoolP(flagHex, "x", false, "Treat input as hexadecimal instead of base64") flags.AddTxFlagsToCmd(cmd) + _ = cmd.Flags().MarkHidden(flags.FlagOutput) // decoding makes sense to output only json return cmd } diff --git a/x/auth/client/cli/encode.go b/x/auth/client/cli/encode.go index 0a04c7c21665..65a13c6d1ae5 100644 --- a/x/auth/client/cli/encode.go +++ b/x/auth/client/cli/encode.go @@ -42,6 +42,7 @@ If you supply a dash (-) argument in place of an input filename, the command rea } flags.AddTxFlagsToCmd(cmd) + _ = cmd.Flags().MarkHidden(flags.FlagOutput) // encoding makes sense to output only json return cmd } diff --git a/x/auth/client/cli/query.go b/x/auth/client/cli/query.go index 1cc788a711d2..8d3ee8e793db 100644 --- a/x/auth/client/cli/query.go +++ b/x/auth/client/cli/query.go @@ -1,13 +1,9 @@ package cli import ( - "context" "fmt" - "strconv" "strings" - "cosmossdk.io/core/address" - errorsmod "cosmossdk.io/errors" "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" @@ -17,11 +13,9 @@ import ( querytypes "github.com/cosmos/cosmos-sdk/types/query" "github.com/cosmos/cosmos-sdk/version" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" - "github.com/cosmos/cosmos-sdk/x/auth/types" ) const ( - FlagEvents = "events" // TODO: Remove when #14758 is merged FlagQuery = "query" FlagType = "type" FlagOrderBy = "order_by" @@ -34,232 +28,6 @@ const ( EventFormat = "{eventType}.{eventAttribute}={value}" ) -// GetQueryCmd returns the transaction commands for this module -func GetQueryCmd(ac address.Codec) *cobra.Command { - cmd := &cobra.Command{ - Use: types.ModuleName, - Short: "Querying commands for the auth module", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - cmd.AddCommand( - GetAccountCmd(ac), - GetAccountAddressByIDCmd(), - GetAccountsCmd(), - QueryParamsCmd(), - QueryModuleAccountsCmd(), - QueryModuleAccountByNameCmd(), - ) - - return cmd -} - -// QueryParamsCmd returns the command handler for evidence parameter querying. -func QueryParamsCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "params", - Short: "Query the current auth parameters", - Args: cobra.NoArgs, - Long: strings.TrimSpace(`Query the current auth parameters: - -$ query auth params -`), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{}) - if err != nil { - return err - } - - return clientCtx.PrintProto(&res.Params) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetAccountCmd returns a query account that will display the state of the -// account at a given address. -func GetAccountCmd(ac address.Codec) *cobra.Command { - cmd := &cobra.Command{ - Use: "account [address]", - Short: "Query for account by address", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - _, err = ac.StringToBytes(args[0]) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.Account(cmd.Context(), &types.QueryAccountRequest{Address: args[0]}) - if err != nil { - node, err2 := clientCtx.GetNode() - if err2 != nil { - return err2 - } - status, err2 := node.Status(context.Background()) - if err2 != nil { - return err2 - } - catchingUp := status.SyncInfo.CatchingUp - if !catchingUp { - return errorsmod.Wrapf(err, "your node may be syncing, please check node status using `/status`") - } - return err - } - - return clientCtx.PrintProto(res.Account) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetAccountAddressByIDCmd returns a query account that will display the account address of a given account id. -func GetAccountAddressByIDCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "address-by-acc-num [acc-num]", - Aliases: []string{"address-by-id"}, - Short: "Query for an address by account number", - Args: cobra.ExactArgs(1), - Example: fmt.Sprintf("%s q auth address-by-acc-num 1", version.AppName), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - accNum, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.AccountAddressByID(cmd.Context(), &types.QueryAccountAddressByIDRequest{ - AccountId: accNum, - }) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetAccountsCmd returns a query command that will display a list of accounts -func GetAccountsCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "accounts", - Short: "Query all the accounts", - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.Accounts(cmd.Context(), &types.QueryAccountsRequest{Pagination: pageReq}) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "all-accounts") - - return cmd -} - -// QueryAllModuleAccountsCmd returns a list of all the existing module accounts with their account information and permissions -func QueryModuleAccountsCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "module-accounts", - Short: "Query all module accounts", - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - res, err := queryClient.ModuleAccounts(context.Background(), &types.QueryModuleAccountsRequest{}) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// QueryModuleAccountByNameCmd returns a command to -func QueryModuleAccountByNameCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "module-account [module-name]", - Short: "Query module account info by module name", - Args: cobra.ExactArgs(1), - Example: fmt.Sprintf("%s q auth module-account auth", version.AppName), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - moduleName := args[0] - if len(moduleName) == 0 { - return fmt.Errorf("module name should not be empty") - } - - queryClient := types.NewQueryClient(clientCtx) - - res, err := queryClient.ModuleAccountByName(context.Background(), &types.QueryModuleAccountByNameRequest{Name: moduleName}) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - // QueryTxsByEventsCmd returns a command to search through transactions by events. func QueryTxsByEventsCmd() *cobra.Command { cmd := &cobra.Command{ diff --git a/x/auth/client/cli/query_test.go b/x/auth/client/cli/query_test.go index 6258beed2e2d..58ee64fba217 100644 --- a/x/auth/client/cli/query_test.go +++ b/x/auth/client/cli/query_test.go @@ -3,8 +3,9 @@ package cli_test import ( "testing" - "github.com/cosmos/cosmos-sdk/x/auth/client/cli" "github.com/stretchr/testify/require" + + "github.com/cosmos/cosmos-sdk/x/auth/client/cli" ) func TestParseSigs(t *testing.T) { diff --git a/x/auth/client/cli/tips.go b/x/auth/client/cli/tips.go deleted file mode 100644 index 82904c6ab064..000000000000 --- a/x/auth/client/cli/tips.go +++ /dev/null @@ -1,93 +0,0 @@ -package cli - -import ( - "fmt" - "os" - - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - clienttx "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/types/tx" - authclient "github.com/cosmos/cosmos-sdk/x/auth/client" -) - -func GetAuxToFeeCommand() *cobra.Command { - cmd := &cobra.Command{ - Use: "aux-to-fee ", - Short: "Includes the aux signer data in the tx, broadcast the tx, and sends the tip amount to the broadcaster", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - auxSignerData := tx.AuxSignerData{} - err = readAuxSignerData(clientCtx.Codec, &auxSignerData, args[0]) - if err != nil { - return err - } - - if auxSignerData.SignDoc.ChainId != clientCtx.ChainID { - return fmt.Errorf("expected chain-id %s, got %s in aux signer data", clientCtx.ChainID, auxSignerData.SignDoc.ChainId) - } - - f, err := clienttx.NewFactoryCLI(clientCtx, cmd.Flags()) - if err != nil { - return err - } - - txBuilder := clientCtx.TxConfig.NewTxBuilder() - err = txBuilder.AddAuxSignerData(auxSignerData) - if err != nil { - return err - } - - txBuilder.SetFeePayer(clientCtx.FromAddress) - txBuilder.SetFeeAmount(f.Fees()) - txBuilder.SetGasLimit(f.Gas()) - - if clientCtx.GenerateOnly { - json, err := clientCtx.TxConfig.TxJSONEncoder()(txBuilder.GetTx()) - if err != nil { - return err - } - return clientCtx.PrintString(fmt.Sprintf("%s\n", json)) - } - - err = authclient.SignTx(f, clientCtx, clientCtx.FromName, txBuilder, clientCtx.Offline, false) - if err != nil { - return err - } - - txBytes, err := clientCtx.TxConfig.TxEncoder()(txBuilder.GetTx()) - if err != nil { - return err - } - - // broadcast to a CometBFT node - res, err := clientCtx.BroadcastTx(txBytes) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} - -func readAuxSignerData(cdc codec.Codec, auxSignerData *tx.AuxSignerData, filename string) error { - bytes, err := os.ReadFile(filename) - if err != nil { - return err - } - - return cdc.UnmarshalJSON(bytes, auxSignerData) -} diff --git a/x/auth/client/cli/tx_multisign.go b/x/auth/client/cli/tx_multisign.go index 6d03db5949e6..d4195585aa2b 100644 --- a/x/auth/client/cli/tx_multisign.go +++ b/x/auth/client/cli/tx_multisign.go @@ -10,8 +10,8 @@ import ( "google.golang.org/protobuf/types/known/anypb" errorsmod "cosmossdk.io/errors" - txsigning "cosmossdk.io/x/tx/signing" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" @@ -48,6 +48,10 @@ If the --offline flag is on, the client will not reach out to an external node. Account number or sequence number lookups are not performed so you must set these parameters manually. +If the --skip-signature-verification flag is on, the command will not verify the +signatures in the provided signature files. This is useful when the multisig +account is a signer in a nested multisig scenario. + The current multisig implementation defaults to amino-json sign mode. The SIGN_MODE_DIRECT sign mode is not supported.' `, @@ -58,9 +62,11 @@ The SIGN_MODE_DIRECT sign mode is not supported.' Args: cobra.MinimumNArgs(3), } + cmd.Flags().Bool(flagSkipSignatureVerification, false, "Skip signature verification") cmd.Flags().Bool(flagSigOnly, false, "Print only the generated signature, then exit") cmd.Flags().String(flags.FlagOutputDocument, "", "The document is written to the given file instead of STDOUT") flags.AddTxFlagsToCmd(cmd) + _ = cmd.Flags().MarkHidden(flags.FlagOutput) return cmd } @@ -104,6 +110,10 @@ func makeMultiSignCmd() func(cmd *cobra.Command, args []string) (err error) { return err } + // avoid signature verification if the sender of the tx is different than + // the multisig key (useful for nested multisigs). + skipSigVerify, _ := cmd.Flags().GetBool(flagSkipSignatureVerification) + multisigPub := pubKey.(*kmultisig.LegacyAminoPubKey) multisigSig := multisig.NewMultisig(len(multisigPub.PubKeys)) if !clientCtx.Offline { @@ -148,11 +158,13 @@ func makeMultiSignCmd() func(cmd *cobra.Command, args []string) (err error) { } txData := adaptableTx.GetSigningTxData() - err = signing.VerifySignature(cmd.Context(), sig.PubKey, txSignerData, sig.Data, - txCfg.SignModeHandler(), txData) - if err != nil { - addr, _ := sdk.AccAddressFromHexUnsafe(sig.PubKey.Address().String()) - return fmt.Errorf("couldn't verify signature for address %s", addr) + if !skipSigVerify { + err = signing.VerifySignature(cmd.Context(), sig.PubKey, txSignerData, sig.Data, + txCfg.SignModeHandler(), txData) + if err != nil { + addr, _ := sdk.AccAddressFromHexUnsafe(sig.PubKey.Address().String()) + return fmt.Errorf("couldn't verify signature for address %s %w", addr, err) + } } if err := multisig.AddSignatureV2(multisigSig, sig, multisigPub.GetPubKeys()); err != nil { @@ -180,27 +192,15 @@ func makeMultiSignCmd() func(cmd *cobra.Command, args []string) (err error) { return err } - outputDoc, _ := cmd.Flags().GetString(flags.FlagOutputDocument) - if outputDoc == "" { - cmd.Printf("%s\n", json) - return - } - - fp, err := os.OpenFile(outputDoc, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o644) + closeFunc, err := setOutputFile(cmd) if err != nil { return err } - defer func() { - err2 := fp.Close() - if err == nil { - err = err2 - } - }() - - err = clientCtx.PrintBytes(json) + defer closeFunc() - return + cmd.Printf("%s\n", json) + return nil } } @@ -235,6 +235,7 @@ The SIGN_MODE_DIRECT sign mode is not supported.' ) cmd.Flags().String(flags.FlagOutputDocument, "", "The document is written to the given file instead of STDOUT") flags.AddTxFlagsToCmd(cmd) + _ = cmd.Flags().MarkHidden(flags.FlagOutput) // signing makes sense to output only json return cmd } diff --git a/x/auth/client/cli/tx_sign.go b/x/auth/client/cli/tx_sign.go index 986ca95d6783..a5dec4d00fb7 100644 --- a/x/auth/client/cli/tx_sign.go +++ b/x/auth/client/cli/tx_sign.go @@ -10,17 +10,18 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" kmultisig "github.com/cosmos/cosmos-sdk/crypto/keys/multisig" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" - authclient "github.com/cosmos/cosmos-sdk/x/auth/client" ) const ( - flagMultisig = "multisig" - flagOverwrite = "overwrite" - flagSigOnly = "signature-only" - flagNoAutoIncrement = "no-auto-increment" - flagAppend = "append" + flagMultisig = "multisig" + flagOverwrite = "overwrite" + flagSigOnly = "signature-only" + flagSkipSignatureVerification = "skip-signature-verification" + flagNoAutoIncrement = "no-auto-increment" + flagAppend = "append" ) // GetSignBatchCommand returns the transaction sign-batch command. @@ -122,7 +123,8 @@ func makeSignBatchCmd() func(cmd *cobra.Command, args []string) error { appendMessagesToSingleTx, _ := cmd.Flags().GetBool(flagAppend) // Combines all tx msgs and create single signed transaction if appendMessagesToSingleTx { - txBuilder := clientCtx.TxConfig.NewTxBuilder() + var totalFees sdk.Coins + txBuilder := txCfg.NewTxBuilder() msgs := make([]sdk.Msg, 0) newGasLimit := uint64(0) @@ -134,6 +136,13 @@ func makeSignBatchCmd() func(cmd *cobra.Command, args []string) error { } // increment the gas newGasLimit += fe.GetTx().GetGas() + // Individual fee values from each transaction need to be + // aggregated to calculate the total fee for the batch of transactions. + // https://github.com/cosmos/cosmos-sdk/issues/18064 + unmergedFees := fe.GetTx().GetFee() + for _, fee := range unmergedFees { + totalFees = totalFees.Add(fee) + } // append messages msgs = append(msgs, unsignedStdTx.GetMsgs()...) } @@ -142,13 +151,15 @@ func makeSignBatchCmd() func(cmd *cobra.Command, args []string) error { // set the memo,fees,feeGranter,feePayer from cmd flags txBuilder.SetMemo(txFactory.Memo()) - txBuilder.SetFeeAmount(txFactory.Fees()) txBuilder.SetFeeGranter(clientCtx.FeeGranter) txBuilder.SetFeePayer(clientCtx.FeePayer) // set the gasLimit txBuilder.SetGasLimit(newGasLimit) + // set the feeAmount + txBuilder.SetFeeAmount(totalFees) + // sign the txs if ms == "" { from, _ := cmd.Flags().GetString(flags.FlagFrom) @@ -219,11 +230,40 @@ func sign(clientCtx client.Context, txBuilder client.TxBuilder, txFactory tx.Fac } func multisigSign(clientCtx client.Context, txBuilder client.TxBuilder, txFactory tx.Factory, multisig string) error { - multisigAddr, _, _, err := client.GetFromFields(clientCtx, txFactory.Keybase(), multisig) + multisigAddr, multisigName, _, err := client.GetFromFields(clientCtx, txFactory.Keybase(), multisig) + if err != nil { + return fmt.Errorf("error getting account from keybase: %w", err) + } + + fromRecord, err := clientCtx.Keyring.Key(clientCtx.FromName) if err != nil { return fmt.Errorf("error getting account from keybase: %w", err) } + fromPubKey, err := fromRecord.GetPubKey() + if err != nil { + return err + } + + multisigkey, err := clientCtx.Keyring.Key(multisigName) + if err != nil { + return err + } + + multisigPubKey, err := multisigkey.GetPubKey() + if err != nil { + return err + } + + isSigner, err := isMultisigSigner(clientCtx, multisigPubKey, fromPubKey) + if err != nil { + return err + } + + if !isSigner { + return fmt.Errorf("signing key is not a part of multisig key") + } + if err = authclient.SignTxWithSignerAddress( txFactory, clientCtx, @@ -239,6 +279,33 @@ func multisigSign(clientCtx client.Context, txBuilder client.TxBuilder, txFactor return nil } +// isMultisigSigner checks if the given pubkey is a signer in the multisig or in +// any of the nested multisig signers. +func isMultisigSigner(clientCtx client.Context, multisigPubKey, fromPubKey cryptotypes.PubKey) (bool, error) { + multisigLegacyPub := multisigPubKey.(*kmultisig.LegacyAminoPubKey) + + var found bool + for _, pubkey := range multisigLegacyPub.GetPubKeys() { + if pubkey.Equals(fromPubKey) { + found = true + break + } + + if nestedMultisig, ok := pubkey.(*kmultisig.LegacyAminoPubKey); ok { + var err error + found, err = isMultisigSigner(clientCtx, nestedMultisig, fromPubKey) + if err != nil { + return false, err + } + if found { + break + } + } + } + + return found, nil +} + func setOutputFile(cmd *cobra.Command) (func(), error) { outputDoc, _ := cmd.Flags().GetString(flags.FlagOutputDocument) if outputDoc == "" { @@ -364,7 +431,6 @@ func signTx(cmd *cobra.Command, clientCtx client.Context, txF tx.Factory, newTx if err != nil { return err } - multisigLegacyPub := multisigPubKey.(*kmultisig.LegacyAminoPubKey) fromRecord, err := clientCtx.Keyring.Key(fromName) if err != nil { @@ -375,15 +441,14 @@ func signTx(cmd *cobra.Command, clientCtx client.Context, txF tx.Factory, newTx return err } - var found bool - for _, pubkey := range multisigLegacyPub.GetPubKeys() { - if pubkey.Equals(fromPubKey) { - found = true - } + isSigner, err := isMultisigSigner(clientCtx, multisigPubKey, fromPubKey) + if err != nil { + return err } - if !found { + if !isSigner { return fmt.Errorf("signing key is not a part of multisig key") } + err = authclient.SignTxWithSignerAddress( txF, clientCtx, multisigAddr, fromName, txBuilder, clientCtx.Offline, overwrite) if err != nil { diff --git a/x/auth/client/cli/tx_simulate.go b/x/auth/client/cli/tx_simulate.go new file mode 100644 index 000000000000..9cb49e4778d6 --- /dev/null +++ b/x/auth/client/cli/tx_simulate.go @@ -0,0 +1,101 @@ +package cli + +import ( + "strings" + + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + authclient "github.com/cosmos/cosmos-sdk/x/auth/client" +) + +// GetSimulateCmd returns a command that simulates whether a transaction will be +// successful. +func GetSimulateCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "simulate /path/to/unsigned-tx.json --from keyname", + Short: "Simulate the gas usage of a transaction", + Long: strings.TrimSpace(`Simulate whether a transaction will be successful: + +- if successful, the simulation result is printed, which includes the gas + consumption, message response data, and events emitted; +- if unsuccessful, the error message is printed. + +The user must provide the path to a JSON-encoded unsigned transaction, typically +generated by any transaction command with the --generate-only flag. It should +look like below. Note that the "signer_infos" and "signatures" fields are left +empty; they will be auto-populated by dummy data for simulation purpose. + +{ + "body": { + "messages": [ + { + "@type": "/cosmos.bank.v1beta1.MsgSend", + "from_address": "cosmos1...", + "to_address": "cosmos1...", + "amount": [ + { + "denom": "utoken", + "amount": "12345" + } + ] + } + ], + "memo": "", + "timeout_height": "0", + "extension_options": [], + "non_critical_extension_options": [] + }, + "auth_info": { + "signer_infos": [], + "fee": { + "amount": [], + "gas_limit": "200000", + "payer": "", + "granter": "" + }, + "tip": null + }, + "signatures": [] +} + +The --from flag is mandatory, as the signer account's correct sequence number is +necessary for simulation. +`), + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + txf, err := tx.NewFactoryCLI(clientCtx, cmd.Flags()) + if err != nil { + return err + } + + txf, err = txf.Prepare(clientCtx) + if err != nil { + return err + } + + stdTx, err := authclient.ReadTxFromFile(clientCtx, args[0]) + if err != nil { + return err + } + + simRes, _, err := tx.CalculateGas(clientCtx, txf, stdTx.GetMsgs()...) + if err != nil { + return err + } + + return clientCtx.PrintProto(simRes) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/auth/client/cli/validate_sigs.go b/x/auth/client/cli/validate_sigs.go index 4d599218d378..f9c1fee0e1fe 100644 --- a/x/auth/client/cli/validate_sigs.go +++ b/x/auth/client/cli/validate_sigs.go @@ -8,6 +8,7 @@ import ( "google.golang.org/protobuf/types/known/anypb" txsigning "cosmossdk.io/x/tx/signing" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" diff --git a/x/auth/client/testutil/helpers.go b/x/auth/client/testutil/helpers.go index 5d53a35c09e8..092b061a83c2 100644 --- a/x/auth/client/testutil/helpers.go +++ b/x/auth/client/testutil/helpers.go @@ -4,7 +4,6 @@ import ( "fmt" "strings" - "cosmossdk.io/core/address" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/crypto/keyring" @@ -81,21 +80,6 @@ func TxDecodeExec(clientCtx client.Context, encodedTx string, extraArgs ...strin return clitestutil.ExecTestCLICmd(clientCtx, cli.GetDecodeCommand(), append(args, extraArgs...)) } -// TxAuxToFeeExec executes `GetAuxToFeeCommand` cli command with given args. -func TxAuxToFeeExec(clientCtx client.Context, filename string, extraArgs ...string) (testutil.BufferWriter, error) { - args := []string{ - filename, - } - - return clitestutil.ExecTestCLICmd(clientCtx, cli.GetAuxToFeeCommand(), append(args, extraArgs...)) -} - -func QueryAccountExec(clientCtx client.Context, address fmt.Stringer, ac address.Codec, extraArgs ...string) (testutil.BufferWriter, error) { - args := []string{address.String(), fmt.Sprintf("--%s=json", flags.FlagOutput)} - - return clitestutil.ExecTestCLICmd(clientCtx, cli.GetAccountCmd(ac), append(args, extraArgs...)) -} - func TxMultiSignBatchExec(clientCtx client.Context, filename, from, sigFile1, sigFile2 string, extraArgs ...string) (testutil.BufferWriter, error) { args := []string{ fmt.Sprintf("--%s=%s", flags.FlagKeyringBackend, keyring.BackendTest), diff --git a/x/auth/client/tx.go b/x/auth/client/tx.go index a2e829641f1f..027e27d3b05c 100644 --- a/x/auth/client/tx.go +++ b/x/auth/client/tx.go @@ -78,16 +78,6 @@ func SignTxWithSignerAddress(txFactory tx.Factory, clientCtx client.Context, add txFactory = txFactory.WithSignMode(signing.SignMode_SIGN_MODE_LEGACY_AMINO_JSON) } - // check whether the address is a signer - signers, err := txBuilder.GetTx().GetSigners() - if err != nil { - return err - } - - if !isTxSigner(addr, signers) { - return fmt.Errorf("%s: %s", errors.ErrorInvalidSigner, name) - } - if !offline { txFactory, err = populateAccountFromState(txFactory, clientCtx, addr) if err != nil { diff --git a/x/auth/keeper/deterministic_test.go b/x/auth/keeper/deterministic_test.go index 63fb8cc4d193..630fa173fd4c 100644 --- a/x/auth/keeper/deterministic_test.go +++ b/x/auth/keeper/deterministic_test.go @@ -21,6 +21,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" "github.com/cosmos/cosmos-sdk/x/auth" + authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec" "github.com/cosmos/cosmos-sdk/x/auth/keeper" "github.com/cosmos/cosmos-sdk/x/auth/types" ) @@ -72,6 +73,7 @@ func (suite *DeterministicTestSuite) SetupTest() { storeService, types.ProtoBaseAccount, maccPerms, + authcodec.NewBech32Codec("cosmos"), "cosmos", types.NewModuleAddress("gov").String(), ) @@ -291,6 +293,7 @@ func (suite *DeterministicTestSuite) TestGRPCQueryModuleAccounts() { suite.storeService, types.ProtoBaseAccount, maccPerms, + authcodec.NewBech32Codec("cosmos"), "cosmos", types.NewModuleAddress("gov").String(), ) @@ -337,6 +340,7 @@ func (suite *DeterministicTestSuite) TestGRPCQueryModuleAccountByName() { suite.storeService, types.ProtoBaseAccount, maccPerms, + authcodec.NewBech32Codec("cosmos"), "cosmos", types.NewModuleAddress("gov").String(), ) diff --git a/x/auth/keeper/grpc_query.go b/x/auth/keeper/grpc_query.go index 57e8b113a2c9..f480bb0a87d2 100644 --- a/x/auth/keeper/grpc_query.go +++ b/x/auth/keeper/grpc_query.go @@ -6,13 +6,12 @@ import ( "sort" "strings" - "github.com/cosmos/cosmos-sdk/types/query" - "google.golang.org/grpc/codes" "google.golang.org/grpc/status" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" "github.com/cosmos/cosmos-sdk/x/auth/types" ) @@ -37,7 +36,7 @@ func (s queryServer) AccountAddressByID(ctx context.Context, req *types.QueryAcc address, err := s.k.Accounts.Indexes.Number.MatchExact(ctx, accID) if err != nil { - return nil, status.Errorf(codes.NotFound, "account address not found with account number %d", req.Id) + return nil, status.Errorf(codes.NotFound, "account address not found with account number %d", accID) } return &types.QueryAccountAddressByIDResponse{AccountAddress: address.String()}, nil @@ -48,15 +47,14 @@ func (s queryServer) Accounts(ctx context.Context, req *types.QueryAccountsReque return nil, status.Error(codes.InvalidArgument, "empty request") } - var accounts []*codectypes.Any - _, pageRes, err := query.CollectionFilteredPaginate(ctx, s.k.Accounts, req.Pagination, func(_ sdk.AccAddress, value sdk.AccountI) (include bool, err error) { - accountAny, err := codectypes.NewAnyWithValue(value) - if err != nil { - return false, err - } - accounts = append(accounts, accountAny) - return false, nil // we don't include it since we're already appending the account - }) + accounts, pageRes, err := query.CollectionPaginate( + ctx, + s.k.Accounts, + req.Pagination, + func(_ sdk.AccAddress, value sdk.AccountI) (*codectypes.Any, error) { + return codectypes.NewAnyWithValue(value) + }, + ) return &types.QueryAccountsResponse{Accounts: accounts, Pagination: pageRes}, err } @@ -163,6 +161,10 @@ func (s queryServer) Bech32Prefix(ctx context.Context, req *types.Bech32PrefixRe return nil, err } + if bech32Prefix == "" { + return &types.Bech32PrefixResponse{Bech32Prefix: "bech32 is not used on this chain"}, nil + } + return &types.Bech32PrefixResponse{Bech32Prefix: bech32Prefix}, nil } @@ -224,9 +226,14 @@ func (s queryServer) AccountInfo(ctx context.Context, req *types.QueryAccountInf return nil, status.Errorf(codes.NotFound, "account %s not found", req.Address) } - pkAny, err := codectypes.NewAnyWithValue(account.GetPubKey()) - if err != nil { - return nil, status.Errorf(codes.Internal, err.Error()) + // if there is no public key, avoid serializing the nil value + pubKey := account.GetPubKey() + var pkAny *codectypes.Any + if pubKey != nil { + pkAny, err = codectypes.NewAnyWithValue(account.GetPubKey()) + if err != nil { + return nil, status.Errorf(codes.Internal, err.Error()) + } } return &types.QueryAccountInfoResponse{ diff --git a/x/auth/keeper/grpc_query_test.go b/x/auth/keeper/grpc_query_test.go index f2d0a766648c..82e9cfe573fc 100644 --- a/x/auth/keeper/grpc_query_test.go +++ b/x/auth/keeper/grpc_query_test.go @@ -222,7 +222,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryAccountAddressByID() { } } -func (suite *KeeperTestSuite) TestGRPCQueryParameters() { +func (suite *KeeperTestSuite) TestGRPCQueryParams() { var ( req *types.QueryParamsRequest expParams types.Params @@ -521,3 +521,17 @@ func (suite *KeeperTestSuite) TestQueryAccountInfo() { suite.Require().NoError(err) suite.Require().Equal(pkBz, res.Info.PubKey.Value) } + +func (suite *KeeperTestSuite) TestQueryAccountInfoWithoutPubKey() { + acc := suite.accountKeeper.NewAccountWithAddress(suite.ctx, addr) + suite.accountKeeper.SetAccount(suite.ctx, acc) + + res, err := suite.queryClient.AccountInfo(context.Background(), &types.QueryAccountInfoRequest{ + Address: addr.String(), + }) + + suite.Require().NoError(err) + suite.Require().NotNil(res.Info) + suite.Require().Equal(addr.String(), res.Info.Address) + suite.Require().Nil(res.Info.PubKey) +} diff --git a/x/auth/keeper/keeper.go b/x/auth/keeper/keeper.go index 5ef50152dda8..393ed99907d3 100644 --- a/x/auth/keeper/keeper.go +++ b/x/auth/keeper/keeper.go @@ -5,21 +5,17 @@ import ( "errors" "fmt" - "cosmossdk.io/collections/indexes" - "cosmossdk.io/collections" - - errorsmod "cosmossdk.io/errors" - "cosmossdk.io/log" - + "cosmossdk.io/collections/indexes" "cosmossdk.io/core/address" "cosmossdk.io/core/store" + errorsmod "cosmossdk.io/errors" + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/codec" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec" "github.com/cosmos/cosmos-sdk/x/auth/types" ) @@ -58,6 +54,7 @@ type AccountKeeperI interface { // GetModulePermissions fetches per-module account permissions GetModulePermissions() map[string]types.PermissionsForAddress + // AddressCodec returns the account address codec. AddressCodec() address.Codec } @@ -117,7 +114,7 @@ var _ AccountKeeperI = &AccountKeeper{} // may use auth.Keeper to access the accounts permissions map. func NewAccountKeeper( cdc codec.BinaryCodec, storeService store.KVStoreService, proto func() sdk.AccountI, - maccPerms map[string][]string, bech32Prefix, authority string, + maccPerms map[string][]string, ac address.Codec, bech32Prefix, authority string, ) AccountKeeper { permAddrs := make(map[string]types.PermissionsForAddress) for name, perms := range maccPerms { @@ -127,7 +124,7 @@ func NewAccountKeeper( sb := collections.NewSchemaBuilder(storeService) ak := AccountKeeper{ - addressCodec: authcodec.NewBech32Codec(bech32Prefix), + addressCodec: ac, bech32Prefix: bech32Prefix, storeService: storeService, proto: proto, @@ -151,7 +148,7 @@ func (ak AccountKeeper) GetAuthority() string { return ak.authority } -// AddressCodec returns the x/auth module's address. +// AddressCodec returns the x/auth account address codec. // x/auth is tied to bech32 encoded user accounts func (ak AccountKeeper) AddressCodec() address.Codec { return ak.addressCodec diff --git a/x/auth/keeper/keeper_bench_test.go b/x/auth/keeper/keeper_bench_test.go index 716afc2e0f34..55203dc99bd3 100644 --- a/x/auth/keeper/keeper_bench_test.go +++ b/x/auth/keeper/keeper_bench_test.go @@ -3,9 +3,10 @@ package keeper_test import ( "testing" + "github.com/stretchr/testify/require" + "cosmossdk.io/depinject" "cosmossdk.io/log" - "github.com/stretchr/testify/require" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/auth/keeper/keeper_test.go b/x/auth/keeper/keeper_test.go index 628bcdbc1640..8eff83d1dddb 100644 --- a/x/auth/keeper/keeper_test.go +++ b/x/auth/keeper/keeper_test.go @@ -3,8 +3,6 @@ package keeper_test import ( "testing" - "github.com/cosmos/cosmos-sdk/runtime" - "github.com/stretchr/testify/suite" "cosmossdk.io/core/header" @@ -13,10 +11,12 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" "github.com/cosmos/cosmos-sdk/x/auth" + authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec" "github.com/cosmos/cosmos-sdk/x/auth/keeper" "github.com/cosmos/cosmos-sdk/x/auth/types" ) @@ -65,6 +65,7 @@ func (suite *KeeperTestSuite) SetupTest() { storeService, types.ProtoBaseAccount, maccPerms, + authcodec.NewBech32Codec("cosmos"), "cosmos", types.NewModuleAddress("gov").String(), ) diff --git a/x/auth/migrations/legacytx/stdsign.go b/x/auth/migrations/legacytx/stdsign.go index c4ef01b9d69f..8a224ca6d707 100644 --- a/x/auth/migrations/legacytx/stdsign.go +++ b/x/auth/migrations/legacytx/stdsign.go @@ -14,7 +14,6 @@ import ( cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/crypto/types/multisig" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/tx" "github.com/cosmos/cosmos-sdk/types/tx/signing" ) @@ -41,30 +40,34 @@ type StdSignDoc struct { Memo string `json:"memo" yaml:"memo"` Fee json.RawMessage `json:"fee" yaml:"fee"` Msgs []json.RawMessage `json:"msgs" yaml:"msgs"` - Tip *StdTip `json:"tip,omitempty" yaml:"tip"` } var RegressionTestingAminoCodec *codec.LegacyAmino +// Deprecated: please delete this code eventually. +func mustSortJSON(bz []byte) []byte { + var c any + err := json.Unmarshal(bz, &c) + if err != nil { + panic(err) + } + js, err := json.Marshal(c) + if err != nil { + panic(err) + } + return js +} + // StdSignBytes returns the bytes to sign for a transaction. // Deprecated: Please use x/tx/signing/aminojson instead. -func StdSignBytes(chainID string, accnum, sequence, timeout uint64, fee StdFee, msgs []sdk.Msg, memo string, tip *tx.Tip) []byte { +func StdSignBytes(chainID string, accnum, sequence, timeout uint64, fee StdFee, msgs []sdk.Msg, memo string) []byte { if RegressionTestingAminoCodec == nil { panic(fmt.Errorf("must set RegressionTestingAminoCodec before calling StdSignBytes")) } msgsBytes := make([]json.RawMessage, 0, len(msgs)) for _, msg := range msgs { bz := RegressionTestingAminoCodec.MustMarshalJSON(msg) - msgsBytes = append(msgsBytes, sdk.MustSortJSON(bz)) - } - - var stdTip *StdTip - if tip != nil { - if tip.Tipper == "" { - panic(fmt.Errorf("tipper cannot be empty")) - } - - stdTip = &StdTip{Amount: tip.Amount, Tipper: tip.Tipper} + msgsBytes = append(msgsBytes, mustSortJSON(bz)) } bz, err := legacy.Cdc.MarshalJSON(StdSignDoc{ @@ -75,13 +78,12 @@ func StdSignBytes(chainID string, accnum, sequence, timeout uint64, fee StdFee, Msgs: msgsBytes, Sequence: sequence, TimeoutHeight: timeout, - Tip: stdTip, }) if err != nil { panic(err) } - return sdk.MustSortJSON(bz) + return mustSortJSON(bz) } // Deprecated: StdSignature represents a sig @@ -124,7 +126,7 @@ func (ss StdSignature) MarshalYAML() (interface{}, error) { return nil, err } - return string(bz), err + return string(bz), nil } func (ss StdSignature) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { diff --git a/x/auth/migrations/legacytx/stdtx.go b/x/auth/migrations/legacytx/stdtx.go index d2a16cfb0b14..900991c01450 100644 --- a/x/auth/migrations/legacytx/stdtx.go +++ b/x/auth/migrations/legacytx/stdtx.go @@ -8,7 +8,6 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/tx" "github.com/cosmos/cosmos-sdk/types/tx/signing" ) @@ -170,9 +169,6 @@ func (tx StdTx) FeeGranter() sdk.AccAddress { return nil } -// GetTip always returns nil for StdTx -func (tx StdTx) GetTip() *tx.Tip { return nil } - func (tx StdTx) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { for _, m := range tx.Msgs { err := codectypes.UnpackInterfaces(m, unpacker) diff --git a/x/auth/migrations/legacytx/stdtx_builder.go b/x/auth/migrations/legacytx/stdtx_builder.go index 80d3450a441b..3965c79cc723 100644 --- a/x/auth/migrations/legacytx/stdtx_builder.go +++ b/x/auth/migrations/legacytx/stdtx_builder.go @@ -45,10 +45,6 @@ func (s *StdTxBuilder) SetGasLimit(limit uint64) { s.StdTx.Fee.Gas = limit } -func (s *StdTxBuilder) SetTip(tip *tx.Tip) { - panic("StdTxBuilder does not support tips") -} - // SetMemo implements TxBuilder.SetMemo func (s *StdTxBuilder) SetMemo(memo string) { s.Memo = memo diff --git a/x/auth/migrations/legacytx/stdtx_test.go b/x/auth/migrations/legacytx/stdtx_test.go index f697f68ec04d..f49357ca6398 100644 --- a/x/auth/migrations/legacytx/stdtx_test.go +++ b/x/auth/migrations/legacytx/stdtx_test.go @@ -13,6 +13,7 @@ import ( txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" txsigning "cosmossdk.io/x/tx/signing" "cosmossdk.io/x/tx/signing/aminojson" + "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" @@ -38,16 +39,11 @@ func TestStdSignBytes(t *testing.T) { fee *txv1beta1.Fee msgs []sdk.Msg memo string - tip *txv1beta1.Tip } defaultFee := &txv1beta1.Fee{ Amount: []*basev1beta1.Coin{{Denom: "atom", Amount: "150"}}, GasLimit: 100000, } - defaultTip := &txv1beta1.Tip{ - Amount: []*basev1beta1.Coin{{Denom: "tiptoken", Amount: "150"}}, - Tipper: addr.String(), - } msgStr := fmt.Sprintf(`{"type":"testpb/TestMsg","value":{"signers":["%s"]}}`, addr) tests := []struct { name string @@ -56,54 +52,39 @@ func TestStdSignBytes(t *testing.T) { }{ { "with timeout height", - args{"1234", 3, 6, 10, defaultFee, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo", nil}, + args{"1234", 3, 6, 10, defaultFee, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo"}, fmt.Sprintf(`{"account_number":"3","chain_id":"1234","fee":{"amount":[{"amount":"150","denom":"atom"}],"gas":"100000"},"memo":"memo","msgs":[%s],"sequence":"6","timeout_height":"10"}`, msgStr), }, { "no timeout height (omitempty)", - args{"1234", 3, 6, 0, defaultFee, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo", nil}, + args{"1234", 3, 6, 0, defaultFee, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo"}, fmt.Sprintf(`{"account_number":"3","chain_id":"1234","fee":{"amount":[{"amount":"150","denom":"atom"}],"gas":"100000"},"memo":"memo","msgs":[%s],"sequence":"6"}`, msgStr), }, { "empty fee", - args{"1234", 3, 6, 0, &txv1beta1.Fee{}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo", nil}, + args{"1234", 3, 6, 0, &txv1beta1.Fee{}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo"}, fmt.Sprintf(`{"account_number":"3","chain_id":"1234","fee":{"amount":[],"gas":"0"},"memo":"memo","msgs":[%s],"sequence":"6"}`, msgStr), }, { "no fee payer and fee granter (both omitempty)", - args{"1234", 3, 6, 0, &txv1beta1.Fee{Amount: defaultFee.Amount, GasLimit: defaultFee.GasLimit}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo", nil}, + args{"1234", 3, 6, 0, &txv1beta1.Fee{Amount: defaultFee.Amount, GasLimit: defaultFee.GasLimit}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo"}, fmt.Sprintf(`{"account_number":"3","chain_id":"1234","fee":{"amount":[{"amount":"150","denom":"atom"}],"gas":"100000"},"memo":"memo","msgs":[%s],"sequence":"6"}`, msgStr), }, { "with fee granter, no fee payer (omitempty)", - args{"1234", 3, 6, 0, &txv1beta1.Fee{Amount: defaultFee.Amount, GasLimit: defaultFee.GasLimit, Granter: addr.String()}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo", nil}, + args{"1234", 3, 6, 0, &txv1beta1.Fee{Amount: defaultFee.Amount, GasLimit: defaultFee.GasLimit, Granter: addr.String()}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo"}, fmt.Sprintf(`{"account_number":"3","chain_id":"1234","fee":{"amount":[{"amount":"150","denom":"atom"}],"gas":"100000","granter":"%s"},"memo":"memo","msgs":[%s],"sequence":"6"}`, addr, msgStr), }, { "with fee payer, no fee granter (omitempty)", - args{"1234", 3, 6, 0, &txv1beta1.Fee{Amount: defaultFee.Amount, GasLimit: defaultFee.GasLimit, Payer: addr.String()}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo", nil}, + args{"1234", 3, 6, 0, &txv1beta1.Fee{Amount: defaultFee.Amount, GasLimit: defaultFee.GasLimit, Payer: addr.String()}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo"}, fmt.Sprintf(`{"account_number":"3","chain_id":"1234","fee":{"amount":[{"amount":"150","denom":"atom"}],"gas":"100000","payer":"%s"},"memo":"memo","msgs":[%s],"sequence":"6"}`, addr, msgStr), }, { "with fee payer and fee granter", - args{"1234", 3, 6, 0, &txv1beta1.Fee{Amount: defaultFee.Amount, GasLimit: defaultFee.GasLimit, Payer: addr.String(), Granter: addr.String()}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo", nil}, + args{"1234", 3, 6, 0, &txv1beta1.Fee{Amount: defaultFee.Amount, GasLimit: defaultFee.GasLimit, Payer: addr.String(), Granter: addr.String()}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo"}, fmt.Sprintf(`{"account_number":"3","chain_id":"1234","fee":{"amount":[{"amount":"150","denom":"atom"}],"gas":"100000","granter":"%s","payer":"%s"},"memo":"memo","msgs":[%s],"sequence":"6"}`, addr, addr, msgStr), }, - { - "no fee, with tip", - args{"1234", 3, 6, 0, &txv1beta1.Fee{}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo", defaultTip}, - fmt.Sprintf(`{"account_number":"3","chain_id":"1234","fee":{"amount":[],"gas":"0"},"memo":"memo","msgs":[%s],"sequence":"6","tip":{"amount":[{"amount":"150","denom":"tiptoken"}],"tipper":"%s"}}`, msgStr, addr), - }, - { - "with fee and with tip", - args{"1234", 3, 6, 0, &txv1beta1.Fee{Amount: defaultFee.Amount, GasLimit: defaultFee.GasLimit, Payer: addr.String()}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo", defaultTip}, - fmt.Sprintf(`{"account_number":"3","chain_id":"1234","fee":{"amount":[{"amount":"150","denom":"atom"}],"gas":"100000","payer":"%s"},"memo":"memo","msgs":[%s],"sequence":"6","tip":{"amount":[{"amount":"150","denom":"tiptoken"}],"tipper":"%s"}}`, addr, msgStr, addr), - }, - { - "with empty tip (but not nil), tipper cannot be empty", - args{"1234", 3, 6, 0, defaultFee, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo", &txv1beta1.Tip{Tipper: addr.String()}}, - fmt.Sprintf(`{"account_number":"3","chain_id":"1234","fee":{"amount":[{"amount":"150","denom":"atom"}],"gas":"100000"},"memo":"memo","msgs":[%s],"sequence":"6","tip":{"amount":[],"tipper":"%s"}}`, msgStr, addr), - }, } handler := aminojson.NewSignModeHandler(aminojson.SignModeHandlerOptions{ FileResolver: proto.HybridResolver, @@ -136,7 +117,6 @@ func TestStdSignBytes(t *testing.T) { }, AuthInfo: &txv1beta1.AuthInfo{ Fee: tc.args.fee, - Tip: tc.args.tip, }, }, ) diff --git a/x/auth/migrations/v2/store_test.go b/x/auth/migrations/v2/store_test.go index bcc3a29c18a1..83989a1c1756 100644 --- a/x/auth/migrations/v2/store_test.go +++ b/x/auth/migrations/v2/store_test.go @@ -95,12 +95,15 @@ func TestMigrateVestingAccounts(t *testing.T) { "delayed vesting has vested, multiple delegations less than the total account balance", func(ctx sdk.Context, validator stakingtypes.Validator, delegatorAddr sdk.AccAddress) { baseAccount := createBaseAccount(delegatorAddr) - vestedCoins := sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), sdkmath.NewInt(200))) - delayedAccount := types.NewDelayedVestingAccount(baseAccount, vestedCoins, ctx.BlockTime().Unix()) + bondDenom, err := stakingKeeper.BondDenom(ctx) + require.NoError(t, err) + vestedCoins := sdk.NewCoins(sdk.NewCoin(bondDenom, sdkmath.NewInt(200))) + delayedAccount, err := types.NewDelayedVestingAccount(baseAccount, vestedCoins, ctx.BlockTime().Unix()) + require.NoError(t, err) ctx = ctx.WithBlockTime(ctx.BlockTime().AddDate(1, 0, 0)) - err := accountKeeper.Params.Set(ctx, authtypes.DefaultParams()) + err = accountKeeper.Params.Set(ctx, authtypes.DefaultParams()) require.NoError(t, err) accountKeeper.SetAccount(ctx, delayedAccount) @@ -121,10 +124,12 @@ func TestMigrateVestingAccounts(t *testing.T) { { "delayed vesting has vested, single delegations which exceed the vested amount", func(ctx sdk.Context, validator stakingtypes.Validator, delegatorAddr sdk.AccAddress) { + bondDenom, err := stakingKeeper.BondDenom(ctx) require.NoError(t, err) baseAccount := createBaseAccount(delegatorAddr) - vestedCoins := sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), sdkmath.NewInt(200))) - delayedAccount := types.NewDelayedVestingAccount(baseAccount, vestedCoins, ctx.BlockTime().Unix()) + vestedCoins := sdk.NewCoins(sdk.NewCoin(bondDenom, sdkmath.NewInt(200))) + delayedAccount, err := types.NewDelayedVestingAccount(baseAccount, vestedCoins, ctx.BlockTime().Unix()) + require.NoError(t, err) ctx = ctx.WithBlockTime(ctx.BlockTime().AddDate(1, 0, 0)) @@ -143,8 +148,11 @@ func TestMigrateVestingAccounts(t *testing.T) { "delayed vesting has vested, multiple delegations which exceed the vested amount", func(ctx sdk.Context, validator stakingtypes.Validator, delegatorAddr sdk.AccAddress) { baseAccount := createBaseAccount(delegatorAddr) - vestedCoins := sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), sdkmath.NewInt(200))) - delayedAccount := types.NewDelayedVestingAccount(baseAccount, vestedCoins, ctx.BlockTime().Unix()) + bondDenom, err := stakingKeeper.BondDenom(ctx) + require.NoError(t, err) + vestedCoins := sdk.NewCoins(sdk.NewCoin(bondDenom, sdkmath.NewInt(200))) + delayedAccount, err := types.NewDelayedVestingAccount(baseAccount, vestedCoins, ctx.BlockTime().Unix()) + require.NoError(t, err) ctx = ctx.WithBlockTime(ctx.BlockTime().AddDate(1, 0, 0)) @@ -167,8 +175,11 @@ func TestMigrateVestingAccounts(t *testing.T) { "delayed vesting has not vested, single delegations which exceed the vested amount", func(ctx sdk.Context, validator stakingtypes.Validator, delegatorAddr sdk.AccAddress) { baseAccount := createBaseAccount(delegatorAddr) - vestedCoins := sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), sdkmath.NewInt(200))) - delayedAccount := types.NewDelayedVestingAccount(baseAccount, vestedCoins, ctx.BlockTime().AddDate(1, 0, 0).Unix()) + bondDenom, err := stakingKeeper.BondDenom(ctx) + require.NoError(t, err) + vestedCoins := sdk.NewCoins(sdk.NewCoin(bondDenom, sdkmath.NewInt(200))) + delayedAccount, err := types.NewDelayedVestingAccount(baseAccount, vestedCoins, ctx.BlockTime().AddDate(1, 0, 0).Unix()) + require.NoError(t, err) accountKeeper.SetAccount(ctx, delayedAccount) @@ -185,8 +196,11 @@ func TestMigrateVestingAccounts(t *testing.T) { "delayed vesting has not vested, multiple delegations which exceed the vested amount", func(ctx sdk.Context, validator stakingtypes.Validator, delegatorAddr sdk.AccAddress) { baseAccount := createBaseAccount(delegatorAddr) - vestedCoins := sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), sdkmath.NewInt(200))) - delayedAccount := types.NewDelayedVestingAccount(baseAccount, vestedCoins, ctx.BlockTime().AddDate(1, 0, 0).Unix()) + bondDenom, err := stakingKeeper.BondDenom(ctx) + require.NoError(t, err) + vestedCoins := sdk.NewCoins(sdk.NewCoin(bondDenom, sdkmath.NewInt(200))) + delayedAccount, err := types.NewDelayedVestingAccount(baseAccount, vestedCoins, ctx.BlockTime().AddDate(1, 0, 0).Unix()) + require.NoError(t, err) accountKeeper.SetAccount(ctx, delayedAccount) @@ -207,8 +221,11 @@ func TestMigrateVestingAccounts(t *testing.T) { "not end time", func(ctx sdk.Context, validator stakingtypes.Validator, delegatorAddr sdk.AccAddress) { baseAccount := createBaseAccount(delegatorAddr) - vestedCoins := sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), sdkmath.NewInt(300))) - delayedAccount := types.NewDelayedVestingAccount(baseAccount, vestedCoins, ctx.BlockTime().AddDate(1, 0, 0).Unix()) + bondDenom, err := stakingKeeper.BondDenom(ctx) + require.NoError(t, err) + vestedCoins := sdk.NewCoins(sdk.NewCoin(bondDenom, sdkmath.NewInt(300))) + delayedAccount, err := types.NewDelayedVestingAccount(baseAccount, vestedCoins, ctx.BlockTime().AddDate(1, 0, 0).Unix()) + require.NoError(t, err) accountKeeper.SetAccount(ctx, delayedAccount) @@ -229,8 +246,11 @@ func TestMigrateVestingAccounts(t *testing.T) { "delayed vesting has not vested, single delegation greater than the total account balance", func(ctx sdk.Context, validator stakingtypes.Validator, delegatorAddr sdk.AccAddress) { baseAccount := createBaseAccount(delegatorAddr) - vestedCoins := sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), sdkmath.NewInt(300))) - delayedAccount := types.NewDelayedVestingAccount(baseAccount, vestedCoins, ctx.BlockTime().AddDate(1, 0, 0).Unix()) + bondDenom, err := stakingKeeper.BondDenom(ctx) + require.NoError(t, err) + vestedCoins := sdk.NewCoins(sdk.NewCoin(bondDenom, sdkmath.NewInt(300))) + delayedAccount, err := types.NewDelayedVestingAccount(baseAccount, vestedCoins, ctx.BlockTime().AddDate(1, 0, 0).Unix()) + require.NoError(t, err) accountKeeper.SetAccount(ctx, delayedAccount) @@ -247,8 +267,11 @@ func TestMigrateVestingAccounts(t *testing.T) { "delayed vesting has vested, single delegation greater than the total account balance", func(ctx sdk.Context, validator stakingtypes.Validator, delegatorAddr sdk.AccAddress) { baseAccount := createBaseAccount(delegatorAddr) - vestedCoins := sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), sdkmath.NewInt(300))) - delayedAccount := types.NewDelayedVestingAccount(baseAccount, vestedCoins, ctx.BlockTime().Unix()) + bondDenom, err := stakingKeeper.BondDenom(ctx) + require.NoError(t, err) + vestedCoins := sdk.NewCoins(sdk.NewCoin(bondDenom, sdkmath.NewInt(300))) + delayedAccount, err := types.NewDelayedVestingAccount(baseAccount, vestedCoins, ctx.BlockTime().Unix()) + require.NoError(t, err) ctx = ctx.WithBlockTime(ctx.BlockTime().AddDate(1, 0, 0)) @@ -269,8 +292,11 @@ func TestMigrateVestingAccounts(t *testing.T) { startTime := ctx.BlockTime().AddDate(1, 0, 0).Unix() endTime := ctx.BlockTime().AddDate(2, 0, 0).Unix() baseAccount := createBaseAccount(delegatorAddr) - vestedCoins := sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), sdkmath.NewInt(300))) - delayedAccount := types.NewContinuousVestingAccount(baseAccount, vestedCoins, startTime, endTime) + bondDenom, err := stakingKeeper.BondDenom(ctx) + require.NoError(t, err) + vestedCoins := sdk.NewCoins(sdk.NewCoin(bondDenom, sdkmath.NewInt(300))) + delayedAccount, err := types.NewContinuousVestingAccount(baseAccount, vestedCoins, startTime, endTime) + require.NoError(t, err) ctx = ctx.WithBlockTime(ctx.BlockTime().AddDate(1, 0, 0)) @@ -291,8 +317,11 @@ func TestMigrateVestingAccounts(t *testing.T) { startTime := ctx.BlockTime().AddDate(-1, 0, 0).Unix() endTime := ctx.BlockTime().AddDate(2, 0, 0).Unix() baseAccount := createBaseAccount(delegatorAddr) - vestedCoins := sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), sdkmath.NewInt(300))) - delayedAccount := types.NewContinuousVestingAccount(baseAccount, vestedCoins, startTime, endTime) + bondDenom, err := stakingKeeper.BondDenom(ctx) + require.NoError(t, err) + vestedCoins := sdk.NewCoins(sdk.NewCoin(bondDenom, sdkmath.NewInt(300))) + delayedAccount, err := types.NewContinuousVestingAccount(baseAccount, vestedCoins, startTime, endTime) + require.NoError(t, err) ctx = ctx.WithBlockTime(ctx.BlockTime().AddDate(1, 0, 0)) @@ -313,8 +342,11 @@ func TestMigrateVestingAccounts(t *testing.T) { startTime := ctx.BlockTime().AddDate(-2, 0, 0).Unix() endTime := ctx.BlockTime().AddDate(-1, 0, 0).Unix() baseAccount := createBaseAccount(delegatorAddr) - vestedCoins := sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), sdkmath.NewInt(300))) - delayedAccount := types.NewContinuousVestingAccount(baseAccount, vestedCoins, startTime, endTime) + bondDenom, err := stakingKeeper.BondDenom(ctx) + require.NoError(t, err) + vestedCoins := sdk.NewCoins(sdk.NewCoin(bondDenom, sdkmath.NewInt(300))) + delayedAccount, err := types.NewContinuousVestingAccount(baseAccount, vestedCoins, startTime, endTime) + require.NoError(t, err) ctx = ctx.WithBlockTime(ctx.BlockTime().AddDate(1, 0, 0)) @@ -333,7 +365,9 @@ func TestMigrateVestingAccounts(t *testing.T) { "periodic vesting account, yet to be vested, some rewards delegated", func(ctx sdk.Context, validator stakingtypes.Validator, delegatorAddr sdk.AccAddress) { baseAccount := createBaseAccount(delegatorAddr) - vestedCoins := sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), sdkmath.NewInt(100))) + bondDenom, err := stakingKeeper.BondDenom(ctx) + require.NoError(t, err) + vestedCoins := sdk.NewCoins(sdk.NewCoin(bondDenom, sdkmath.NewInt(100))) start := ctx.BlockTime().Unix() + int64(time.Hour/time.Second) @@ -344,11 +378,12 @@ func TestMigrateVestingAccounts(t *testing.T) { }, } - account := types.NewPeriodicVestingAccount(baseAccount, vestedCoins, start, periods) + account, err := types.NewPeriodicVestingAccount(baseAccount, vestedCoins, start, periods) + require.NoError(t, err) accountKeeper.SetAccount(ctx, account) - _, err = stakingKeeper.Delegate(ctx, delegatorAddr, sdk.NewInt(150), stakingtypes.Unbonded, validator, true) + _, err = stakingKeeper.Delegate(ctx, delegatorAddr, sdkmath.NewInt(150), stakingtypes.Unbonded, validator, true) require.NoError(t, err) }, cleartTrackingFields, @@ -371,28 +406,31 @@ func TestMigrateVestingAccounts(t *testing.T) { */ startTime := int64(1601042400) baseAccount := createBaseAccount(delegatorAddr) - vestedCoins := sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), sdk.NewInt(3666666670000))) + bondDenom, err := stakingKeeper.BondDenom(ctx) + require.NoError(t, err) + vestedCoins := sdk.NewCoins(sdk.NewCoin(bondDenom, sdkmath.NewInt(3666666670000))) periods := []types.Period{ { Length: 31536000, - Amount: sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), sdk.NewInt(1833333335000))), + Amount: sdk.NewCoins(sdk.NewCoin(bondDenom, sdkmath.NewInt(1833333335000))), }, { Length: 15638400, - Amount: sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), sdk.NewInt(916666667500))), + Amount: sdk.NewCoins(sdk.NewCoin(bondDenom, sdkmath.NewInt(916666667500))), }, { Length: 15897600, - Amount: sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), sdk.NewInt(916666667500))), + Amount: sdk.NewCoins(sdk.NewCoin(bondDenom, sdkmath.NewInt(916666667500))), }, } - delayedAccount := types.NewPeriodicVestingAccount(baseAccount, vestedCoins, startTime, periods) + delayedAccount, err := types.NewPeriodicVestingAccount(baseAccount, vestedCoins, startTime, periods) + require.NoError(t, err) accountKeeper.SetAccount(ctx, delayedAccount) // delegation of the original vesting - _, err = stakingKeeper.Delegate(ctx, delegatorAddr, sdk.NewInt(3666666670000), stakingtypes.Unbonded, validator, true) + _, err = stakingKeeper.Delegate(ctx, delegatorAddr, sdkmath.NewInt(3666666670000), stakingtypes.Unbonded, validator, true) require.NoError(t, err) }, cleartTrackingFields, @@ -415,30 +453,33 @@ func TestMigrateVestingAccounts(t *testing.T) { */ startTime := int64(1601042400) baseAccount := createBaseAccount(delegatorAddr) - vestedCoins := sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), sdk.NewInt(3666666670000))) + bondDenom, err := stakingKeeper.BondDenom(ctx) + require.NoError(t, err) + vestedCoins := sdk.NewCoins(sdk.NewCoin(bondDenom, sdkmath.NewInt(3666666670000))) periods := []types.Period{ { Length: 31536000, - Amount: sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), sdk.NewInt(1833333335000))), + Amount: sdk.NewCoins(sdk.NewCoin(bondDenom, sdkmath.NewInt(1833333335000))), }, { Length: 15638400, - Amount: sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), sdk.NewInt(916666667500))), + Amount: sdk.NewCoins(sdk.NewCoin(bondDenom, sdkmath.NewInt(916666667500))), }, { Length: 15897600, - Amount: sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), sdk.NewInt(916666667500))), + Amount: sdk.NewCoins(sdk.NewCoin(bondDenom, sdkmath.NewInt(916666667500))), }, } - delayedAccount := types.NewPeriodicVestingAccount(baseAccount, vestedCoins, startTime, periods) + delayedAccount, err := types.NewPeriodicVestingAccount(baseAccount, vestedCoins, startTime, periods) + require.NoError(t, err) ctx = ctx.WithBlockTime(time.Unix(1601042400+31536000+15897600+15897600+1, 0)) accountKeeper.SetAccount(ctx, delayedAccount) // delegation of the original vesting - _, err = stakingKeeper.Delegate(ctx, delegatorAddr, sdk.NewInt(3666666670000), stakingtypes.Unbonded, validator, true) + _, err = stakingKeeper.Delegate(ctx, delegatorAddr, sdkmath.NewInt(3666666670000), stakingtypes.Unbonded, validator, true) require.NoError(t, err) }, cleartTrackingFields, @@ -461,30 +502,33 @@ func TestMigrateVestingAccounts(t *testing.T) { */ startTime := int64(1601042400) baseAccount := createBaseAccount(delegatorAddr) - vestedCoins := sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), sdk.NewInt(3666666670000))) + bondDenom, err := stakingKeeper.BondDenom(ctx) + require.NoError(t, err) + vestedCoins := sdk.NewCoins(sdk.NewCoin(bondDenom, sdkmath.NewInt(3666666670000))) periods := []types.Period{ { Length: 31536000, - Amount: sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), sdk.NewInt(1833333335000))), + Amount: sdk.NewCoins(sdk.NewCoin(bondDenom, sdkmath.NewInt(1833333335000))), }, { Length: 15638400, - Amount: sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), sdk.NewInt(916666667500))), + Amount: sdk.NewCoins(sdk.NewCoin(bondDenom, sdkmath.NewInt(916666667500))), }, { Length: 15897600, - Amount: sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), sdk.NewInt(916666667500))), + Amount: sdk.NewCoins(sdk.NewCoin(bondDenom, sdkmath.NewInt(916666667500))), }, } - delayedAccount := types.NewPeriodicVestingAccount(baseAccount, vestedCoins, startTime, periods) + delayedAccount, err := types.NewPeriodicVestingAccount(baseAccount, vestedCoins, startTime, periods) + require.NoError(t, err) ctx = ctx.WithBlockTime(time.Unix(1601042400+31536000+1, 0)) accountKeeper.SetAccount(ctx, delayedAccount) // delegation of the original vesting - _, err = stakingKeeper.Delegate(ctx, delegatorAddr, sdk.NewInt(3666666670000), stakingtypes.Unbonded, validator, true) + _, err = stakingKeeper.Delegate(ctx, delegatorAddr, sdkmath.NewInt(3666666670000), stakingtypes.Unbonded, validator, true) require.NoError(t, err) }, cleartTrackingFields, @@ -507,30 +551,33 @@ func TestMigrateVestingAccounts(t *testing.T) { */ startTime := int64(1601042400) baseAccount := createBaseAccount(delegatorAddr) - vestedCoins := sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), sdk.NewInt(3666666670000))) + bondDenom, err := stakingKeeper.BondDenom(ctx) + require.NoError(t, err) + vestedCoins := sdk.NewCoins(sdk.NewCoin(bondDenom, sdkmath.NewInt(3666666670000))) periods := []types.Period{ { Length: 31536000, - Amount: sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), sdk.NewInt(1833333335000))), + Amount: sdk.NewCoins(sdk.NewCoin(bondDenom, sdkmath.NewInt(1833333335000))), }, { Length: 15638400, - Amount: sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), sdk.NewInt(916666667500))), + Amount: sdk.NewCoins(sdk.NewCoin(bondDenom, sdkmath.NewInt(916666667500))), }, { Length: 15897600, - Amount: sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), sdk.NewInt(916666667500))), + Amount: sdk.NewCoins(sdk.NewCoin(bondDenom, sdkmath.NewInt(916666667500))), }, } - delayedAccount := types.NewPeriodicVestingAccount(baseAccount, vestedCoins, startTime, periods) + delayedAccount, err := types.NewPeriodicVestingAccount(baseAccount, vestedCoins, startTime, periods) + require.NoError(t, err) ctx = ctx.WithBlockTime(time.Unix(1601042400+31536000+15638400+1, 0)) accountKeeper.SetAccount(ctx, delayedAccount) // delegation of the original vesting - _, err = stakingKeeper.Delegate(ctx, delegatorAddr, sdk.NewInt(3666666670000), stakingtypes.Unbonded, validator, true) + _, err = stakingKeeper.Delegate(ctx, delegatorAddr, sdkmath.NewInt(3666666670000), stakingtypes.Unbonded, validator, true) require.NoError(t, err) }, cleartTrackingFields, @@ -543,14 +590,17 @@ func TestMigrateVestingAccounts(t *testing.T) { "vesting account has unbonding delegations in place", func(ctx sdk.Context, validator stakingtypes.Validator, delegatorAddr sdk.AccAddress) { baseAccount := createBaseAccount(delegatorAddr) - vestedCoins := sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), sdk.NewInt(300))) + bondDenom, err := stakingKeeper.BondDenom(ctx) + require.NoError(t, err) + vestedCoins := sdk.NewCoins(sdk.NewCoin(bondDenom, sdkmath.NewInt(300))) - delayedAccount := types.NewDelayedVestingAccount(baseAccount, vestedCoins, ctx.BlockTime().AddDate(10, 0, 0).Unix()) + delayedAccount, err := types.NewDelayedVestingAccount(baseAccount, vestedCoins, ctx.BlockTime().AddDate(10, 0, 0).Unix()) + require.NoError(t, err) accountKeeper.SetAccount(ctx, delayedAccount) // delegation of the original vesting - _, err = stakingKeeper.Delegate(ctx, delegatorAddr, sdk.NewInt(300), stakingtypes.Unbonded, validator, true) + _, err = stakingKeeper.Delegate(ctx, delegatorAddr, sdkmath.NewInt(300), stakingtypes.Unbonded, validator, true) require.NoError(t, err) ctx = ctx.WithBlockTime(ctx.BlockTime().AddDate(1, 0, 0)) @@ -559,7 +609,7 @@ func TestMigrateVestingAccounts(t *testing.T) { require.NoError(t, err) // un-delegation of the original vesting - _, _, err = stakingKeeper.Undelegate(ctx, delegatorAddr, valAddr, sdk.NewDecFromInt(sdk.NewInt(300))) + _, _, err = stakingKeeper.Undelegate(ctx, delegatorAddr, valAddr, sdkmath.LegacyNewDecFromInt(sdkmath.NewInt(300))) require.NoError(t, err) }, cleartTrackingFields, @@ -572,9 +622,12 @@ func TestMigrateVestingAccounts(t *testing.T) { "vesting account has never delegated anything", func(ctx sdk.Context, validator stakingtypes.Validator, delegatorAddr sdk.AccAddress) { baseAccount := createBaseAccount(delegatorAddr) - vestedCoins := sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), sdk.NewInt(300))) + bondDenom, err := stakingKeeper.BondDenom(ctx) + require.NoError(t, err) + vestedCoins := sdk.NewCoins(sdk.NewCoin(bondDenom, sdkmath.NewInt(300))) - delayedAccount := types.NewDelayedVestingAccount(baseAccount, vestedCoins, ctx.BlockTime().AddDate(10, 0, 0).Unix()) + delayedAccount, err := types.NewDelayedVestingAccount(baseAccount, vestedCoins, ctx.BlockTime().AddDate(10, 0, 0).Unix()) + require.NoError(t, err) accountKeeper.SetAccount(ctx, delayedAccount) }, @@ -588,9 +641,12 @@ func TestMigrateVestingAccounts(t *testing.T) { "vesting account has no delegation but dirty DelegatedFree and DelegatedVesting fields", func(ctx sdk.Context, validator stakingtypes.Validator, delegatorAddr sdk.AccAddress) { baseAccount := createBaseAccount(delegatorAddr) - vestedCoins := sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), sdk.NewInt(300))) + bondDenom, err := stakingKeeper.BondDenom(ctx) + require.NoError(t, err) + vestedCoins := sdk.NewCoins(sdk.NewCoin(bondDenom, sdkmath.NewInt(300))) - delayedAccount := types.NewDelayedVestingAccount(baseAccount, vestedCoins, ctx.BlockTime().AddDate(10, 0, 0).Unix()) + delayedAccount, err := types.NewDelayedVestingAccount(baseAccount, vestedCoins, ctx.BlockTime().AddDate(10, 0, 0).Unix()) + require.NoError(t, err) accountKeeper.SetAccount(ctx, delayedAccount) }, @@ -608,12 +664,12 @@ func TestMigrateVestingAccounts(t *testing.T) { err := accountKeeper.Params.Set(ctx, authtypes.DefaultParams()) require.NoError(t, err) - addrs := simtestutil.AddTestAddrs(bankKeeper, stakingKeeper, ctx, 1, sdk.NewInt(tc.tokenAmount)) + addrs := simtestutil.AddTestAddrs(bankKeeper, stakingKeeper, ctx, 1, sdkmath.NewInt(tc.tokenAmount)) delegatorAddr := addrs[0] _, valAddr := createValidator(t, ctx, bankKeeper, stakingKeeper, tc.tokenAmount*2) - validator, found := stakingKeeper.GetValidator(ctx, valAddr) - require.True(t, found) + validator, err := stakingKeeper.GetValidator(ctx, valAddr) + require.NoError(t, err) tc.prepareFunc(ctx, validator, delegatorAddr) @@ -633,12 +689,15 @@ func TestMigrateVestingAccounts(t *testing.T) { var expVested sdk.Coins var expFree sdk.Coins + bondDenom, err := stakingKeeper.BondDenom(ctx) + require.NoError(t, err) + if tc.expVested != 0 { - expVested = sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), sdk.NewInt(tc.expVested))) + expVested = sdk.NewCoins(sdk.NewCoin(bondDenom, sdkmath.NewInt(tc.expVested))) } if tc.expFree != 0 { - expFree = sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), sdk.NewInt(tc.expFree))) + expFree = sdk.NewCoins(sdk.NewCoin(bondDenom, sdkmath.NewInt(tc.expFree))) } trackingCorrected( @@ -715,7 +774,7 @@ func createValidator(t *testing.T, ctx sdk.Context, bankKeeper bankkeeper.Keeper valAddrs := simtestutil.ConvertAddrsToValAddrs(addrs) pks := simtestutil.CreateTestPubKeys(1) - val1, err := stakingtypes.NewValidator(valAddrs[0], pks[0], stakingtypes.Description{}) + val1, err := stakingtypes.NewValidator(valAddrs[0].String(), pks[0], stakingtypes.Description{}) require.NoError(t, err) stakingKeeper.SetValidator(ctx, val1) diff --git a/x/auth/migrations/v3/store_test.go b/x/auth/migrations/v3/store_test.go index 0b1939220dd1..5ff190ca23fa 100644 --- a/x/auth/migrations/v3/store_test.go +++ b/x/auth/migrations/v3/store_test.go @@ -5,11 +5,10 @@ import ( "testing" "time" - "cosmossdk.io/collections" - cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" + "cosmossdk.io/collections" "cosmossdk.io/depinject" "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" diff --git a/x/auth/migrations/v5/migrate.go b/x/auth/migrations/v5/migrate.go index ba1c32c769fa..44fcf970c359 100644 --- a/x/auth/migrations/v5/migrate.go +++ b/x/auth/migrations/v5/migrate.go @@ -3,9 +3,10 @@ package v5 import ( "context" + "github.com/cosmos/gogoproto/types" + "cosmossdk.io/collections" storetypes "cosmossdk.io/core/store" - "github.com/cosmos/gogoproto/types" ) var LegacyGlobalAccountNumberKey = []byte("globalAccountNumber") diff --git a/x/auth/migrations/v5/migrate_test.go b/x/auth/migrations/v5/migrate_test.go index 75e8b65ff042..c0c7113fb580 100644 --- a/x/auth/migrations/v5/migrate_test.go +++ b/x/auth/migrations/v5/migrate_test.go @@ -3,10 +3,11 @@ package v5 import ( "testing" - "cosmossdk.io/collections" - "cosmossdk.io/collections/colltest" "github.com/cosmos/gogoproto/types" "github.com/stretchr/testify/require" + + "cosmossdk.io/collections" + "cosmossdk.io/collections/colltest" ) func TestMigrate(t *testing.T) { diff --git a/x/auth/module.go b/x/auth/module.go index 40bd46896d63..c8f46a9efe58 100644 --- a/x/auth/module.go +++ b/x/auth/module.go @@ -5,20 +5,13 @@ import ( "encoding/json" "fmt" - abci "github.com/cometbft/cometbft/abci/types" gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" - - "cosmossdk.io/depinject" - - authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec" + modulev1 "cosmossdk.io/api/cosmos/auth/module/v1" "cosmossdk.io/core/address" "cosmossdk.io/core/appmodule" - - modulev1 "cosmossdk.io/api/cosmos/auth/module/v1" - "cosmossdk.io/core/store" + "cosmossdk.io/depinject" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" @@ -26,7 +19,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/auth/client/cli" "github.com/cosmos/cosmos-sdk/x/auth/exported" "github.com/cosmos/cosmos-sdk/x/auth/keeper" "github.com/cosmos/cosmos-sdk/x/auth/simulation" @@ -40,9 +32,12 @@ const ( ) var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleBasic = AppModule{} _ module.AppModuleSimulation = AppModule{} + _ module.HasGenesis = AppModule{} + _ module.HasServices = AppModule{} + + _ appmodule.AppModule = AppModule{} ) // AppModuleBasic defines the basic application module used by the auth module. @@ -83,16 +78,6 @@ func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *g } } -// GetTxCmd returns the root tx command for the auth module. -func (AppModuleBasic) GetTxCmd() *cobra.Command { - return nil -} - -// GetQueryCmd returns the root query command for the auth module. -func (ab AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd(ab.ac) -} - // RegisterInterfaces registers interfaces and implementations of the auth module. func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { types.RegisterInterfaces(registry) @@ -109,8 +94,6 @@ type AppModule struct { legacySubspace exported.Subspace } -var _ appmodule.AppModule = AppModule{} - // IsOnePerModuleType implements the depinject.OnePerModuleType interface. func (am AppModule) IsOnePerModuleType() {} @@ -127,11 +110,6 @@ func NewAppModule(cdc codec.Codec, accountKeeper keeper.AccountKeeper, randGenAc } } -// Name returns the auth module's name. -func (AppModule) Name() string { - return types.ModuleName -} - // RegisterServices registers a GRPC query service to respond to the // module-specific GRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { @@ -158,11 +136,10 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { // InitGenesis performs genesis initialization for the auth module. It returns // no validator updates. -func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate { +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) { var genesisState types.GenesisState cdc.MustUnmarshalJSON(data, &genesisState) am.accountKeeper.InitGenesis(ctx, genesisState) - return []abci.ValidatorUpdate{} } // ExportGenesis returns the exported genesis state as raw bytes for the auth @@ -203,17 +180,10 @@ func (AppModule) WeightedOperations(_ module.SimulationState) []simtypes.Weighte func init() { appmodule.Register(&modulev1.Module{}, - appmodule.Provide(ProvideAddressCodec), appmodule.Provide(ProvideModule), ) } -// ProvideAddressCodec provides an address.Codec to the container for any -// modules that want to do address string <> bytes conversion. -func ProvideAddressCodec(config *modulev1.Module) address.Codec { - return authcodec.NewBech32Codec(config.Bech32Prefix) -} - type ModuleInputs struct { depinject.In @@ -221,6 +191,7 @@ type ModuleInputs struct { StoreService store.KVStoreService Cdc codec.Codec + AddressCodec address.Codec RandomGenesisAccountsFn types.RandomGenesisAccountsFn `optional:"true"` AccountI func() sdk.AccountI `optional:"true"` @@ -255,7 +226,7 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { in.AccountI = types.ProtoBaseAccount } - k := keeper.NewAccountKeeper(in.Cdc, in.StoreService, in.AccountI, maccPerms, in.Config.Bech32Prefix, authority.String()) + k := keeper.NewAccountKeeper(in.Cdc, in.StoreService, in.AccountI, maccPerms, in.AddressCodec, in.Config.Bech32Prefix, authority.String()) m := NewAppModule(in.Cdc, k, in.RandomGenesisAccountsFn, in.LegacySubspace) return ModuleOutputs{AccountKeeper: k, Module: m} diff --git a/x/auth/module_test.go b/x/auth/module_test.go index 961dd362d6fa..742658e5caac 100644 --- a/x/auth/module_test.go +++ b/x/auth/module_test.go @@ -3,9 +3,10 @@ package auth_test import ( "testing" + "github.com/stretchr/testify/require" + "cosmossdk.io/depinject" "cosmossdk.io/log" - "github.com/stretchr/testify/require" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" "github.com/cosmos/cosmos-sdk/x/auth/keeper" diff --git a/x/auth/posthandler/tips.go b/x/auth/posthandler/tips.go deleted file mode 100644 index 33a5f69e9081..000000000000 --- a/x/auth/posthandler/tips.go +++ /dev/null @@ -1,58 +0,0 @@ -package posthandler - -import ( - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/tx" - "github.com/cosmos/cosmos-sdk/x/auth/types" -) - -// ValidateBasicDecorator will call tx.ValidateBasic and return any non-nil error. -// If ValidateBasic passes, decorator calls next AnteHandler in chain. Note, -// ValidateBasicDecorator decorator will not get executed on ReCheckTx since it -// is not dependent on application state. -type tipDecorator struct { - bankKeeper types.BankKeeper -} - -// NewTipDecorator returns a new decorator for handling transactions with -// tips. -// -// IMPORTANT: This decorator is still in beta, please use it at your own risk. -func NewTipDecorator(bankKeeper types.BankKeeper) sdk.AnteDecorator { - return tipDecorator{ - bankKeeper: bankKeeper, - } -} - -func (d tipDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) { - err := d.transferTip(ctx, tx) - if err != nil { - return ctx, err - } - - return next(ctx, tx, simulate) -} - -// transferTip transfers the tip from the tipper to the fee payer. -func (d tipDecorator) transferTip(ctx sdk.Context, sdkTx sdk.Tx) error { - tipTx, ok := sdkTx.(tx.TipTx) - - // No-op if the tx doesn't have tips. - if !ok || tipTx.GetTip() == nil { - return nil - } - - tipper, err := sdk.AccAddressFromBech32(tipTx.GetTip().Tipper) - if err != nil { - return err - } - - coins := tipTx.GetTip().Amount - if err := d.bankKeeper.IsSendEnabledCoins(ctx, coins...); err != nil { - return fmt.Errorf("cannot tip these coins: %w", err) - } - - return d.bankKeeper.SendCoins(ctx, tipper, tipTx.FeePayer(), coins) -} diff --git a/x/auth/signing/adapter.go b/x/auth/signing/adapter.go index db1bb5fc65c8..42b1b82fdc48 100644 --- a/x/auth/signing/adapter.go +++ b/x/auth/signing/adapter.go @@ -7,6 +7,7 @@ import ( "google.golang.org/protobuf/types/known/anypb" txsigning "cosmossdk.io/x/tx/signing" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/tx/signing" @@ -40,20 +41,24 @@ func GetSignBytesAdapter( return nil, err } - anyPk, err := codectypes.NewAnyWithValue(signerData.PubKey) - if err != nil { - return nil, err - } + var pubKey *anypb.Any + if signerData.PubKey != nil { + anyPk, err := codectypes.NewAnyWithValue(signerData.PubKey) + if err != nil { + return nil, err + } + pubKey = &anypb.Any{ + TypeUrl: anyPk.TypeUrl, + Value: anyPk.Value, + } + } txSignerData := txsigning.SignerData{ ChainID: signerData.ChainID, AccountNumber: signerData.AccountNumber, Sequence: signerData.Sequence, Address: signerData.Address, - PubKey: &anypb.Any{ - TypeUrl: anyPk.TypeUrl, - Value: anyPk.Value, - }, + PubKey: pubKey, } // Generate the bytes to be signed. return handlerMap.GetSignBytes(ctx, txSignMode, txSignerData, txData) diff --git a/x/auth/signing/adapter_test.go b/x/auth/signing/adapter_test.go new file mode 100644 index 000000000000..aa22ef0a35af --- /dev/null +++ b/x/auth/signing/adapter_test.go @@ -0,0 +1,33 @@ +package signing_test + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/cosmos/cosmos-sdk/testutil/testdata" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" + "github.com/cosmos/cosmos-sdk/types/tx/signing" + authsign "github.com/cosmos/cosmos-sdk/x/auth/signing" +) + +func TestGetSignBytesAdapterNoPublicKey(t *testing.T) { + encodingConfig := moduletestutil.MakeTestEncodingConfig() + txConfig := encodingConfig.TxConfig + _, _, addr := testdata.KeyTestPubAddr() + signerData := authsign.SignerData{ + Address: addr.String(), + ChainID: "test-chain", + AccountNumber: 11, + Sequence: 15, + } + w := txConfig.NewTxBuilder() + _, err := authsign.GetSignBytesAdapter( + context.Background(), + txConfig.SignModeHandler(), + signing.SignMode_SIGN_MODE_DIRECT, + signerData, + w.GetTx()) + require.NoError(t, err) +} diff --git a/x/auth/signing/handler_map.go b/x/auth/signing/handler_map.go index fcb935c4d586..3794e12f99d8 100644 --- a/x/auth/signing/handler_map.go +++ b/x/auth/signing/handler_map.go @@ -4,9 +4,8 @@ import ( "context" "fmt" - "github.com/cosmos/cosmos-sdk/types/tx/signing" - sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/tx/signing" ) // SignModeHandlerMap is SignModeHandler that aggregates multiple SignModeHandler's into diff --git a/x/auth/signing/sig_verifiable_tx.go b/x/auth/signing/sig_verifiable_tx.go index 7aa05219f1cd..54649a365eee 100644 --- a/x/auth/signing/sig_verifiable_tx.go +++ b/x/auth/signing/sig_verifiable_tx.go @@ -3,7 +3,6 @@ package signing import ( cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/tx" "github.com/cosmos/cosmos-sdk/types/tx/signing" ) @@ -17,13 +16,13 @@ type SigVerifiableTx interface { } // Tx defines a transaction interface that supports all standard message, signature -// fee, memo, tips, and auxiliary interfaces. +// fee, memo and auxiliary interfaces. type Tx interface { SigVerifiableTx types.TxWithMemo types.FeeTx - tx.TipTx types.TxWithTimeoutHeight + types.TxWithUnordered types.HasValidateBasic } diff --git a/x/auth/signing/verify.go b/x/auth/signing/verify.go index 6dbf7543a26e..a025687c1189 100644 --- a/x/auth/signing/verify.go +++ b/x/auth/signing/verify.go @@ -6,6 +6,7 @@ import ( signingv1beta1 "cosmossdk.io/api/cosmos/tx/signing/v1beta1" txsigning "cosmossdk.io/x/tx/signing" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/crypto/types/multisig" "github.com/cosmos/cosmos-sdk/types/tx/signing" diff --git a/x/auth/simulation/genesis.go b/x/auth/simulation/genesis.go index 1f9d45e55275..c6984cc355e8 100644 --- a/x/auth/simulation/genesis.go +++ b/x/auth/simulation/genesis.go @@ -47,7 +47,10 @@ func RandomGenesisAccounts(simState *module.SimulationState) types.GenesisAccoun endTime = int64(simulation.RandIntBetween(simState.Rand, int(startTime)+1, int(startTime+(60*60*12)))) } - bva := vestingtypes.NewBaseVestingAccount(bacc, initialVesting, endTime) + bva, err := vestingtypes.NewBaseVestingAccount(bacc, initialVesting, endTime) + if err != nil { + panic(err) + } if simState.Rand.Intn(100) < 50 { genesisAccs[i] = vestingtypes.NewContinuousVestingAccountRaw(bva, startTime) diff --git a/x/auth/simulation/genesis_test.go b/x/auth/simulation/genesis_test.go index 4b8f48ef76b0..1ad07afd32f8 100644 --- a/x/auth/simulation/genesis_test.go +++ b/x/auth/simulation/genesis_test.go @@ -8,6 +8,7 @@ import ( "github.com/stretchr/testify/require" sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/types/module" diff --git a/x/auth/testutil/app_config.go b/x/auth/testutil/app_config.go index ceeafe403b72..c8e88f2bc6b2 100644 --- a/x/auth/testutil/app_config.go +++ b/x/auth/testutil/app_config.go @@ -2,7 +2,6 @@ package testutil import ( "github.com/cosmos/cosmos-sdk/testutil/configurator" - _ "github.com/cosmos/cosmos-sdk/x/auth" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/auth/tx/config" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/auth/vesting" // import as blank for app wiring diff --git a/x/auth/testutil/expected_keepers_mocks.go b/x/auth/testutil/expected_keepers_mocks.go index 2d0e602a8cbc..4d8f3b40154e 100644 --- a/x/auth/testutil/expected_keepers_mocks.go +++ b/x/auth/testutil/expected_keepers_mocks.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: x/auth/types/expected_keepers.go +// +// Generated by this command: +// +// mockgen -source=x/auth/types/expected_keepers.go -package testutil -destination x/auth/testutil/expected_keepers_mocks.go +// // Package testutil is a generated GoMock package. package testutil @@ -9,13 +14,14 @@ import ( reflect "reflect" types "github.com/cosmos/cosmos-sdk/types" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockBankKeeper is a mock of BankKeeper interface. type MockBankKeeper struct { ctrl *gomock.Controller recorder *MockBankKeeperMockRecorder + isgomock struct{} } // MockBankKeeperMockRecorder is the mock recorder for MockBankKeeper. @@ -38,7 +44,7 @@ func (m *MockBankKeeper) EXPECT() *MockBankKeeperMockRecorder { // IsSendEnabledCoins mocks base method. func (m *MockBankKeeper) IsSendEnabledCoins(ctx context.Context, coins ...types.Coin) error { m.ctrl.T.Helper() - varargs := []interface{}{ctx} + varargs := []any{ctx} for _, a := range coins { varargs = append(varargs, a) } @@ -48,9 +54,9 @@ func (m *MockBankKeeper) IsSendEnabledCoins(ctx context.Context, coins ...types. } // IsSendEnabledCoins indicates an expected call of IsSendEnabledCoins. -func (mr *MockBankKeeperMockRecorder) IsSendEnabledCoins(ctx interface{}, coins ...interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) IsSendEnabledCoins(ctx any, coins ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{ctx}, coins...) + varargs := append([]any{ctx}, coins...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsSendEnabledCoins", reflect.TypeOf((*MockBankKeeper)(nil).IsSendEnabledCoins), varargs...) } @@ -63,7 +69,7 @@ func (m *MockBankKeeper) SendCoins(ctx context.Context, from, to types.AccAddres } // SendCoins indicates an expected call of SendCoins. -func (mr *MockBankKeeperMockRecorder) SendCoins(ctx, from, to, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SendCoins(ctx, from, to, amt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoins", reflect.TypeOf((*MockBankKeeper)(nil).SendCoins), ctx, from, to, amt) } @@ -77,7 +83,7 @@ func (m *MockBankKeeper) SendCoinsFromAccountToModule(ctx context.Context, sende } // SendCoinsFromAccountToModule indicates an expected call of SendCoinsFromAccountToModule. -func (mr *MockBankKeeperMockRecorder) SendCoinsFromAccountToModule(ctx, senderAddr, recipientModule, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SendCoinsFromAccountToModule(ctx, senderAddr, recipientModule, amt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromAccountToModule", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromAccountToModule), ctx, senderAddr, recipientModule, amt) } diff --git a/x/auth/tx/README.md b/x/auth/tx/README.md index 0460f69d8b6c..378b60e557f6 100644 --- a/x/auth/tx/README.md +++ b/x/auth/tx/README.md @@ -4,9 +4,7 @@ sidebar_position: 1 # `x/auth/tx` -:::note - -### Pre-requisite Readings +:::note Pre-requisite Readings * [Transactions](https://docs.cosmos.network/main/core/transactions#transaction-generation) * [Encoding](https://docs.cosmos.network/main/core/encoding#transaction-encoding) @@ -37,19 +35,19 @@ This package represents the Cosmos SDK implementation of the `client.TxConfig`, The interface defines a set of methods for creating a `client.TxBuilder`. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/client/tx_config.go#L25-L31 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/client/tx_config.go#L25-L31 ``` The default implementation of `client.TxConfig` is instantiated by `NewTxConfig` in `x/auth/tx` module. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/auth/tx/config.go#L22-L28 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/x/auth/tx/config.go#L22-L28 ``` ### `TxBuilder` ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/client/tx_config.go#L33-L50 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/client/tx_config.go#L33-L50 ``` The [`client.TxBuilder`](https://docs.cosmos.network/main/core/transactions#transaction-generation) interface is as well implemented by `x/auth/tx`. diff --git a/x/auth/tx/adapter.go b/x/auth/tx/adapter.go index 1c2f113a7b83..685e6eb9b72c 100644 --- a/x/auth/tx/adapter.go +++ b/x/auth/tx/adapter.go @@ -2,17 +2,22 @@ package tx import ( "google.golang.org/protobuf/types/known/anypb" + "google.golang.org/protobuf/types/known/timestamppb" basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" multisigv1beta1 "cosmossdk.io/api/cosmos/crypto/multisig/v1beta1" signingv1beta1 "cosmossdk.io/api/cosmos/tx/signing/v1beta1" txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" txsigning "cosmossdk.io/x/tx/signing" + "github.com/cosmos/cosmos-sdk/types/tx" ) // GetSigningTxData returns an x/tx/signing.TxData representation of a transaction for use in the signing -// API defined in x/tx. +// API defined in x/tx. The reason for all of this conversion is that x/tx depends on the protoreflect API +// defined in google.golang.org/protobuf while x/auth/tx depends on the legacy proto API defined in +// github.com/gogo/protobuf and the downstream SDK fork of that library, github.com/cosmos/gogoproto. +// Therefore we need to convert between the two APIs. func (w *wrapper) GetSigningTxData() txsigning.TxData { body := w.tx.Body authInfo := w.tx.AuthInfo @@ -50,23 +55,6 @@ func (w *wrapper) GetSigningTxData() txsigning.TxData { } } - var txTip *txv1beta1.Tip - tip := authInfo.Tip - if tip != nil { - tipCoins := tip.GetAmount() - tipAmount := make([]*basev1beta1.Coin, len(tipCoins)) - for i, coin := range tipCoins { - tipAmount[i] = &basev1beta1.Coin{ - Denom: coin.Denom, - Amount: coin.Amount.String(), - } - } - txTip = &txv1beta1.Tip{ - Amount: tipAmount, - Tipper: tip.Tipper, - } - } - txSignerInfos := make([]*txv1beta1.SignerInfo, len(authInfo.SignerInfos)) for i, signerInfo := range authInfo.SignerInfos { modeInfo := &txv1beta1.ModeInfo{} @@ -90,13 +78,22 @@ func (w *wrapper) GetSigningTxData() txsigning.TxData { Payer: authInfo.Fee.Payer, Granter: authInfo.Fee.Granter, }, - Tip: txTip, + } + + // Only set TimeoutTimestamp if we have a non-zero time.Time. + // Setting timestamppb.New() with a zero/default value time.Time results in a non-zero timestamppb.Timestamp, + // which causes the value to show up in the signature - breaking 0 { + w.tx.Body.TimeoutTimestamp = ×tamp + } +} + +func (w *wrapper) GetTimeoutTimeStamp() time.Time { + t := w.tx.Body.TimeoutTimestamp + if t == nil { + return time.Time{} + } + return *t +} + func (w *wrapper) ValidateBasic() error { if w.tx == nil { return fmt.Errorf("bad Tx") @@ -210,16 +226,8 @@ func (w *wrapper) FeePayer() []byte { return signers[0] } -func (w *wrapper) FeeGranter() string { - feeGranter := w.tx.AuthInfo.Fee.Granter - if feeGranter != "" { - return feeGranter - } - return "" -} - -func (w *wrapper) GetTip() *tx.Tip { - return w.tx.AuthInfo.Tip +func (w *wrapper) FeeGranter() []byte { + return w.tx.FeeGranter(w.cdc) } func (w *wrapper) GetMemo() string { @@ -231,6 +239,11 @@ func (w *wrapper) GetTimeoutHeight() uint64 { return w.tx.Body.TimeoutHeight } +// GetUnordered returns the transaction's unordered field (if set). +func (w *wrapper) GetUnordered() bool { + return w.tx.Body.Unordered +} + func (w *wrapper) GetSignaturesV2() ([]signing.SignatureV2, error) { signerInfos := w.tx.AuthInfo.SignerInfos sigs := w.tx.Signatures @@ -293,6 +306,13 @@ func (w *wrapper) SetTimeoutHeight(height uint64) { w.bodyBz = nil } +func (w *wrapper) SetUnordered(v bool) { + w.tx.Body.Unordered = v + + // set bodyBz to nil because the cached bodyBz no longer matches tx.Body + w.bodyBz = nil +} + func (w *wrapper) SetMemo(memo string) { w.tx.Body.Memo = memo @@ -322,13 +342,6 @@ func (w *wrapper) SetFeeAmount(coins sdk.Coins) { w.authInfoBz = nil } -func (w *wrapper) SetTip(tip *tx.Tip) { - w.tx.AuthInfo.Tip = tip - - // set authInfoBz to nil because the cached authInfoBz no longer matches tx.AuthInfo - w.authInfoBz = nil -} - func (w *wrapper) SetFeePayer(feePayer sdk.AccAddress) { if w.tx.AuthInfo.Fee == nil { w.tx.AuthInfo.Fee = &tx.Fee{} @@ -357,11 +370,17 @@ func (w *wrapper) SetSignatures(signatures ...signing.SignatureV2) error { rawSigs := make([][]byte, n) for i, sig := range signatures { - var modeInfo *tx.ModeInfo + var ( + modeInfo *tx.ModeInfo + pubKey *codectypes.Any + err error + ) modeInfo, rawSigs[i] = SignatureDataToModeInfoAndSig(sig.Data) - pubKey, err := codectypes.NewAnyWithValue(sig.PubKey) - if err != nil { - return err + if sig.PubKey != nil { + pubKey, err = codectypes.NewAnyWithValue(sig.PubKey) + if err != nil { + return err + } } signerInfos[i] = &tx.SignerInfo{ PublicKey: pubKey, @@ -503,14 +522,6 @@ func (w *wrapper) AddAuxSignerData(data tx.AuxSignerData) error { } } } - if w.tx.AuthInfo.Tip != nil && data.SignDoc.Tip != nil { - if !w.tx.AuthInfo.Tip.Amount.Equal(data.SignDoc.Tip.Amount) { - return sdkerrors.ErrInvalidRequest.Wrapf("TxBuilder has tip %+v, got %+v in AuxSignerData", w.tx.AuthInfo.Tip.Amount, data.SignDoc.Tip.Amount) - } - if w.tx.AuthInfo.Tip.Tipper != data.SignDoc.Tip.Tipper { - return sdkerrors.ErrInvalidRequest.Wrapf("TxBuilder has tipper %s, got %s in AuxSignerData", w.tx.AuthInfo.Tip.Tipper, data.SignDoc.Tip.Tipper) - } - } w.SetMemo(body.Memo) w.SetTimeoutHeight(body.TimeoutHeight) @@ -524,7 +535,6 @@ func (w *wrapper) AddAuxSignerData(data tx.AuxSignerData) error { if err != nil { return err } - w.SetTip(data.GetSignDoc().GetTip()) // Get the aux signer's index in GetSigners. signerIndex := -1 diff --git a/x/auth/tx/builder_test.go b/x/auth/tx/builder_test.go index c817b1718d80..2fb88905beb2 100644 --- a/x/auth/tx/builder_test.go +++ b/x/auth/tx/builder_test.go @@ -127,6 +127,20 @@ func TestTxBuilder(t *testing.T) { }) } +func TestSetSignaturesNoPublicKey(t *testing.T) { + _, pubkey, _ := testdata.KeyTestPubAddr() + txBuilder := newBuilder(nil) + sig2 := signing.SignatureV2{ + Data: &signing.SingleSignatureData{ + SignMode: signing.SignMode_SIGN_MODE_DIRECT, + Signature: legacy.Cdc.MustMarshal(pubkey), + }, + Sequence: 1, + } + err := txBuilder.SetSignatures(sig2) + require.NoError(t, err) +} + func TestBuilderValidateBasic(t *testing.T) { // keys and addresses _, pubKey1, addr1 := testdata.KeyTestPubAddr() @@ -307,7 +321,7 @@ func TestBuilderFeeGranter(t *testing.T) { feeAmount := testdata.NewTestFeeAmount() msgs := []sdk.Msg{msg1} - txBuilder := newBuilder(nil) + txBuilder := newBuilder(testutil.CodecOptions{}.NewCodec()) err := txBuilder.SetMsgs(msgs...) require.NoError(t, err) txBuilder.SetGasLimit(200000) @@ -317,5 +331,5 @@ func TestBuilderFeeGranter(t *testing.T) { // set fee granter txBuilder.SetFeeGranter(addr1) - require.Equal(t, addr1.String(), txBuilder.GetTx().FeeGranter()) + require.Equal(t, addr1.String(), sdk.AccAddress(txBuilder.GetTx().FeeGranter()).String()) } diff --git a/x/auth/tx/config.go b/x/auth/tx/config.go index 1f0a05f48dc6..8aab60c5192f 100644 --- a/x/auth/tx/config.go +++ b/x/auth/tx/config.go @@ -22,7 +22,7 @@ type config struct { encoder sdk.TxEncoder jsonDecoder sdk.TxDecoder jsonEncoder sdk.TxEncoder - protoCodec codec.ProtoCodecMarshaler + protoCodec codec.Codec signingContext *txsigning.Context } @@ -73,7 +73,7 @@ var DefaultSignModes = []signingtypes.SignMode{ // We prefer to use depinject to provide client.TxConfig, but we permit this constructor usage. Within the SDK, // this constructor is primarily used in tests, but also sees usage in app chains like: // https://github.com/evmos/evmos/blob/719363fbb92ff3ea9649694bd088e4c6fe9c195f/encoding/config.go#L37 -func NewTxConfig(protoCodec codec.ProtoCodecMarshaler, enabledSignModes []signingtypes.SignMode, +func NewTxConfig(protoCodec codec.Codec, enabledSignModes []signingtypes.SignMode, customSignModes ...txsigning.SignModeHandler, ) client.TxConfig { txConfig, err := NewTxConfigWithOptions(protoCodec, ConfigOptions{ @@ -99,9 +99,8 @@ func NewDefaultSigningOptions() (*txsigning.Options, error) { // NewSigningHandlerMap returns a new txsigning.HandlerMap using the provided ConfigOptions. // It is recommended to use types.InterfaceRegistry in the field ConfigOptions.FileResolver as shown in // NewTxConfigWithOptions but this fn does not enforce it. -func NewSigningHandlerMap(configOptions ConfigOptions) (*txsigning.HandlerMap, error) { +func NewSigningHandlerMap(configOpts ConfigOptions) (*txsigning.HandlerMap, error) { var err error - configOpts := &configOptions if configOpts.SigningOptions == nil { configOpts.SigningOptions, err = NewDefaultSigningOptions() if err != nil { @@ -165,9 +164,13 @@ func NewSigningHandlerMap(configOptions ConfigOptions) (*txsigning.HandlerMap, e // NewTxConfigWithOptions returns a new protobuf TxConfig using the provided ProtoCodec, ConfigOptions and // custom sign mode handlers. If ConfigOptions is an empty struct then default values will be used. -func NewTxConfigWithOptions(protoCodec codec.ProtoCodecMarshaler, configOptions ConfigOptions) (client.TxConfig, error) { +func NewTxConfigWithOptions(protoCodec codec.Codec, configOptions ConfigOptions) (client.TxConfig, error) { txConfig := &config{ - protoCodec: protoCodec, + protoCodec: protoCodec, + decoder: configOptions.ProtoDecoder, + encoder: configOptions.ProtoEncoder, + jsonDecoder: configOptions.JSONDecoder, + jsonEncoder: configOptions.JSONEncoder, } if configOptions.ProtoDecoder == nil { txConfig.decoder = DefaultTxDecoder(protoCodec) @@ -183,27 +186,25 @@ func NewTxConfigWithOptions(protoCodec codec.ProtoCodecMarshaler, configOptions } var err error - opts := &configOptions - if opts.SigningContext == nil { - signingOpts := configOptions.SigningOptions - if signingOpts == nil { - signingOpts, err = NewDefaultSigningOptions() + if configOptions.SigningContext == nil { + if configOptions.SigningOptions == nil { + configOptions.SigningOptions, err = NewDefaultSigningOptions() if err != nil { return nil, err } } - if signingOpts.FileResolver == nil { - signingOpts.FileResolver = protoCodec.InterfaceRegistry() + if configOptions.SigningOptions.FileResolver == nil { + configOptions.SigningOptions.FileResolver = protoCodec.InterfaceRegistry() } - opts.SigningContext, err = txsigning.NewContext(*signingOpts) + configOptions.SigningContext, err = txsigning.NewContext(*configOptions.SigningOptions) if err != nil { return nil, err } } - txConfig.signingContext = opts.SigningContext + txConfig.signingContext = configOptions.SigningContext - if opts.SigningHandler != nil { - txConfig.handler = opts.SigningHandler + if configOptions.SigningHandler != nil { + txConfig.handler = configOptions.SigningHandler return txConfig, nil } diff --git a/x/auth/tx/config/config.go b/x/auth/tx/config/config.go index b249dbf94390..1a6bba6b4da5 100644 --- a/x/auth/tx/config/config.go +++ b/x/auth/tx/config/config.go @@ -7,25 +7,23 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" grpcstatus "google.golang.org/grpc/status" + "google.golang.org/protobuf/reflect/protoreflect" bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" txconfigv1 "cosmossdk.io/api/cosmos/tx/config/v1" - "cosmossdk.io/depinject" - + "cosmossdk.io/core/address" "cosmossdk.io/core/appmodule" + "cosmossdk.io/depinject" txsigning "cosmossdk.io/x/tx/signing" "cosmossdk.io/x/tx/signing/textual" - signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing" - - authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec" - "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/runtime" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/registry" + signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/x/auth/ante" "github.com/cosmos/cosmos-sdk/x/auth/posthandler" "github.com/cosmos/cosmos-sdk/x/auth/tx" @@ -42,22 +40,27 @@ func init() { type ModuleInputs struct { depinject.In - Config *txconfigv1.Config - ProtoCodecMarshaler codec.ProtoCodecMarshaler - ProtoFileResolver txsigning.ProtoFileResolver + + Config *txconfigv1.Config + AddressCodec address.Codec + ValidatorAddressCodec runtime.ValidatorAddressCodec + Codec codec.Codec + ProtoFileResolver txsigning.ProtoFileResolver // BankKeeper is the expected bank keeper to be passed to AnteHandlers BankKeeper authtypes.BankKeeper `optional:"true"` MetadataBankKeeper BankKeeper `optional:"true"` AccountKeeper ante.AccountKeeper `optional:"true"` FeeGrantKeeper ante.FeegrantKeeper `optional:"true"` CustomSignModeHandlers func() []txsigning.SignModeHandler `optional:"true"` + CustomGetSigners []txsigning.CustomGetSigner `optional:"true"` } type ModuleOutputs struct { depinject.Out - TxConfig client.TxConfig - BaseAppOption runtime.BaseAppOption + TxConfig client.TxConfig + TxConfigOptions tx.ConfigOptions + BaseAppOption runtime.BaseAppOption } func ProvideProtoRegistry() txsigning.ProtoFileResolver { @@ -69,29 +72,29 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { if in.CustomSignModeHandlers != nil { customSignModeHandlers = in.CustomSignModeHandlers() } - sdkConfig := sdk.GetConfig() txConfigOptions := tx.ConfigOptions{ EnabledSignModes: tx.DefaultSignModes, SigningOptions: &txsigning.Options{ - FileResolver: in.ProtoFileResolver, - // From static config? But this is already in auth config. - // - Provide codecs there as types? - // - Provide static prefix there exported from config? - // - Just do as below? - AddressCodec: authcodec.NewBech32Codec(sdkConfig.GetBech32AccountAddrPrefix()), - ValidatorAddressCodec: authcodec.NewBech32Codec(sdkConfig.GetBech32ValidatorAddrPrefix()), + FileResolver: in.ProtoFileResolver, + AddressCodec: in.AddressCodec, + ValidatorAddressCodec: in.ValidatorAddressCodec, + CustomGetSigners: make(map[protoreflect.FullName]txsigning.GetSignersFunc), }, CustomSignModes: customSignModeHandlers, } + for _, mode := range in.CustomGetSigners { + txConfigOptions.SigningOptions.CustomGetSigners[mode.MsgType] = mode.Fn + } + // enable SIGN_MODE_TEXTUAL only if bank keeper is available if in.MetadataBankKeeper != nil { txConfigOptions.EnabledSignModes = append(txConfigOptions.EnabledSignModes, signingtypes.SignMode_SIGN_MODE_TEXTUAL) txConfigOptions.TextualCoinMetadataQueryFn = NewBankKeeperCoinMetadataQueryFn(in.MetadataBankKeeper) } - txConfig, err := tx.NewTxConfigWithOptions(in.ProtoCodecMarshaler, txConfigOptions) + txConfig, err := tx.NewTxConfigWithOptions(in.Codec, txConfigOptions) if err != nil { panic(err) } @@ -135,7 +138,7 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { app.SetTxEncoder(txConfig.TxEncoder()) } - return ModuleOutputs{TxConfig: txConfig, BaseAppOption: baseAppOption} + return ModuleOutputs{TxConfig: txConfig, TxConfigOptions: txConfigOptions, BaseAppOption: baseAppOption} } func newAnteHandler(txConfig client.TxConfig, in ModuleInputs) (sdk.AnteHandler, error) { @@ -162,9 +165,7 @@ func newAnteHandler(txConfig client.TxConfig, in ModuleInputs) (sdk.AnteHandler, // NewBankKeeperCoinMetadataQueryFn creates a new Textual struct using the given // BankKeeper to retrieve coin metadata. // -// Note: Once we switch to ADR-033, and keepers become ADR-033 clients to each -// other, this function could probably be deprecated in favor of -// `NewTextualWithGRPCConn`. +// This function should be used in the server (app.go) and is already injected thanks to app wiring for app_v2. func NewBankKeeperCoinMetadataQueryFn(bk BankKeeper) textual.CoinMetadataQueryFn { return func(ctx context.Context, denom string) (*bankv1beta1.Metadata, error) { res, err := bk.DenomMetadata(ctx, &types.QueryDenomMetadataRequest{Denom: denom}) @@ -203,7 +204,9 @@ func NewBankKeeperCoinMetadataQueryFn(bk BankKeeper) textual.CoinMetadataQueryFn // Example: // // clientCtx := client.GetClientContextFromCmd(cmd) -// txt := tx.NewTextualWithGRPCConn(clientCtxx) +// txt := tx.NewTextualWithGRPCConn(clientCtx) +// +// This should be used in the client (root.go) of an application. func NewGRPCCoinMetadataQueryFn(grpcConn grpc.ClientConnInterface) textual.CoinMetadataQueryFn { return func(ctx context.Context, denom string) (*bankv1beta1.Metadata, error) { bankQueryClient := bankv1beta1.NewQueryClient(grpcConn) diff --git a/x/auth/tx/config_test.go b/x/auth/tx/config_test.go index ebfb3d628977..c07b39b171b7 100644 --- a/x/auth/tx/config_test.go +++ b/x/auth/tx/config_test.go @@ -1,15 +1,18 @@ -package tx +package tx_test import ( "testing" + "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/testutil" + "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/std" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/auth/tx" txtestutil "github.com/cosmos/cosmos-sdk/x/auth/tx/testutil" ) @@ -18,5 +21,16 @@ func TestGenerator(t *testing.T) { std.RegisterInterfaces(interfaceRegistry) interfaceRegistry.RegisterImplementations((*sdk.Msg)(nil), &testdata.TestMsg{}) protoCodec := codec.NewProtoCodec(interfaceRegistry) - suite.Run(t, txtestutil.NewTxConfigTestSuite(NewTxConfig(protoCodec, DefaultSignModes))) + suite.Run(t, txtestutil.NewTxConfigTestSuite(tx.NewTxConfig(protoCodec, tx.DefaultSignModes))) +} + +func TestConfigOptions(t *testing.T) { + interfaceRegistry := types.NewInterfaceRegistry() + protoCodec := codec.NewProtoCodec(interfaceRegistry) + configOptions := tx.ConfigOptions{} + txConfig, err := tx.NewTxConfigWithOptions(protoCodec, configOptions) + require.NoError(t, err) + require.NotNil(t, txConfig) + handler := txConfig.SignModeHandler() + require.NotNil(t, handler) } diff --git a/x/auth/tx/decoder.go b/x/auth/tx/decoder.go index 16253a4ba154..d74c7f206597 100644 --- a/x/auth/tx/decoder.go +++ b/x/auth/tx/decoder.go @@ -15,7 +15,7 @@ import ( ) // DefaultTxDecoder returns a default protobuf TxDecoder using the provided Marshaler. -func DefaultTxDecoder(cdc codec.ProtoCodecMarshaler) sdk.TxDecoder { +func DefaultTxDecoder(cdc codec.Codec) sdk.TxDecoder { return func(txBytes []byte) (sdk.Tx, error) { // Make sure txBytes follow ADR-027. err := rejectNonADR027TxRaw(txBytes) @@ -79,7 +79,7 @@ func DefaultTxDecoder(cdc codec.ProtoCodecMarshaler) sdk.TxDecoder { } // DefaultJSONTxDecoder returns a default protobuf JSON TxDecoder using the provided Marshaler. -func DefaultJSONTxDecoder(cdc codec.ProtoCodecMarshaler) sdk.TxDecoder { +func DefaultJSONTxDecoder(cdc codec.Codec) sdk.TxDecoder { return func(txBytes []byte) (sdk.Tx, error) { var theTx tx.Tx err := cdc.UnmarshalJSON(txBytes, &theTx) diff --git a/x/auth/tx/direct.go b/x/auth/tx/direct.go index 4acc52a08dd6..f679e39d10ae 100644 --- a/x/auth/tx/direct.go +++ b/x/auth/tx/direct.go @@ -3,10 +3,9 @@ package tx import ( "fmt" - signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing" - sdk "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types/tx" + signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/x/auth/signing" ) diff --git a/x/auth/tx/direct_aux.go b/x/auth/tx/direct_aux.go index 75671a0fc409..31a3d9572384 100644 --- a/x/auth/tx/direct_aux.go +++ b/x/auth/tx/direct_aux.go @@ -1,8 +1,8 @@ package tx import ( - "bytes" "fmt" + "strings" errorsmod "cosmossdk.io/errors" @@ -56,13 +56,8 @@ func (signModeDirectAuxHandler) GetSignBytes( // Fee payer cannot use SIGN_MODE_DIRECT_AUX, because SIGN_MODE_DIRECT_AUX // does not sign over fees, which would create malleability issues. - addrBz, err := sdk.AccAddressFromBech32(data.Address) - if err != nil { - return nil, err - } - - if bytes.Equal(feePayer, addrBz) { - return nil, sdkerrors.ErrUnauthorized.Wrapf("fee payer %s cannot sign with %s", feePayer, signingtypes.SignMode_SIGN_MODE_DIRECT_AUX) + if strings.EqualFold(sdk.AccAddress(feePayer).String(), data.Address) { + return nil, sdkerrors.ErrUnauthorized.Wrapf("fee payer %s cannot sign with %s", sdk.AccAddress(feePayer).String(), signingtypes.SignMode_SIGN_MODE_DIRECT_AUX) } signDocDirectAux := types.SignDocDirectAux{ diff --git a/x/auth/tx/direct_aux_test.go b/x/auth/tx/direct_aux_test.go index 32f76b17fbb8..7492b43431eb 100644 --- a/x/auth/tx/direct_aux_test.go +++ b/x/auth/tx/direct_aux_test.go @@ -50,7 +50,6 @@ func TestDirectAuxHandler(t *testing.T) { } fee := txtypes.Fee{Amount: sdk.NewCoins(sdk.NewInt64Coin("atom", 150)), GasLimit: 20000} - tip := &txtypes.Tip{Amount: sdk.NewCoins(sdk.NewInt64Coin("tip-token", 10))} err = txBuilder.SetMsgs(msgs...) require.NoError(t, err) @@ -58,7 +57,6 @@ func TestDirectAuxHandler(t *testing.T) { txBuilder.SetFeeAmount(fee.Amount) txBuilder.SetFeePayer(feePayerAddr) txBuilder.SetGasLimit(fee.GasLimit) - txBuilder.SetTip(tip) err = txBuilder.SetSignatures(sig, feePayerSig) require.NoError(t, err) @@ -82,7 +80,7 @@ func TestDirectAuxHandler(t *testing.T) { t.Log("verify fee payer cannot use SIGN_MODE_DIRECT_AUX") _, err = modeHandler.GetSignBytes(signingtypes.SignMode_SIGN_MODE_DIRECT_AUX, feePayerSigningData, txBuilder.GetTx()) - require.EqualError(t, err, fmt.Sprintf("fee payer %s cannot sign with %s: unauthorized", []byte(feePayerAddr), signingtypes.SignMode_SIGN_MODE_DIRECT_AUX)) + require.EqualError(t, err, fmt.Sprintf("fee payer %s cannot sign with %s: unauthorized", feePayerAddr.String(), signingtypes.SignMode_SIGN_MODE_DIRECT_AUX)) t.Log("verify GetSignBytes with generating sign bytes by marshaling signDocDirectAux") signBytes, err := modeHandler.GetSignBytes(signingtypes.SignMode_SIGN_MODE_DIRECT_AUX, signingData, txBuilder.GetTx()) @@ -110,7 +108,6 @@ func TestDirectAuxHandler(t *testing.T) { ChainId: "test-chain", PublicKey: any, Sequence: accSeq, - Tip: tip, } expectedSignBytes, err := signDocDirectAux.Marshal() diff --git a/x/auth/tx/encode_decode_test.go b/x/auth/tx/encode_decode_test.go index f4297770959c..5329b3eadbd4 100644 --- a/x/auth/tx/encode_decode_test.go +++ b/x/auth/tx/encode_decode_test.go @@ -70,6 +70,8 @@ func TestUnknownFields(t *testing.T) { shouldAminoErr: fmt.Sprintf("%s: %s", aminoNonCriticalFieldsError, sdkerrors.ErrInvalidRequest.Error()), }, { + // If new fields are added to TxBody the number for some_new_field in the proto definition must be set to + // one that it's not used in TxBody. name: "critical fields in TxBody should error on decode", body: &testdata.TestUpdatedTxBody{ Memo: "foo", diff --git a/x/auth/tx/encoder.go b/x/auth/tx/encoder.go index e98106a89a82..fc60b6a04e06 100644 --- a/x/auth/tx/encoder.go +++ b/x/auth/tx/encoder.go @@ -29,7 +29,7 @@ func DefaultTxEncoder() sdk.TxEncoder { } // DefaultJSONTxEncoder returns a default protobuf JSON TxEncoder using the provided Marshaler. -func DefaultJSONTxEncoder(cdc codec.ProtoCodecMarshaler) sdk.TxEncoder { +func DefaultJSONTxEncoder(cdc codec.Codec) sdk.TxEncoder { return func(tx sdk.Tx) ([]byte, error) { txWrapper, ok := tx.(*wrapper) if ok { diff --git a/x/auth/tx/legacy_amino_json.go b/x/auth/tx/legacy_amino_json.go index 3d7f1efcae0c..0c76158e5d26 100644 --- a/x/auth/tx/legacy_amino_json.go +++ b/x/auth/tx/legacy_amino_json.go @@ -63,20 +63,6 @@ func (s signModeLegacyAminoJSONHandler) GetSignBytes(mode signingtypes.SignMode, return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "got empty address in %s handler", signingtypes.SignMode_SIGN_MODE_LEGACY_AMINO_JSON) } - tip := protoTx.GetTip() - isTipper := tip != nil && tip.Tipper == addr - - // We set a convention that if the tipper signs with LEGACY_AMINO_JSON, then - // they sign over empty fees and 0 gas. - if isTipper { - return legacytx.StdSignBytes( - data.ChainID, data.AccountNumber, data.Sequence, protoTx.GetTimeoutHeight(), - // The tipper signs over 0 fee and 0 gas, no feepayer, no feegranter by convention. - legacytx.StdFee{}, - tx.GetMsgs(), protoTx.GetMemo(), tip, - ), nil - } - return legacytx.StdSignBytes( data.ChainID, data.AccountNumber, data.Sequence, protoTx.GetTimeoutHeight(), legacytx.StdFee{ @@ -85,6 +71,6 @@ func (s signModeLegacyAminoJSONHandler) GetSignBytes(mode signingtypes.SignMode, Payer: protoTx.tx.AuthInfo.Fee.Payer, Granter: protoTx.tx.AuthInfo.Fee.Granter, }, - tx.GetMsgs(), protoTx.GetMemo(), tip, + tx.GetMsgs(), protoTx.GetMemo(), ), nil } diff --git a/x/auth/tx/legacy_amino_json_test.go b/x/auth/tx/legacy_amino_json_test.go index cdb7ee284d20..dcfbe319069f 100644 --- a/x/auth/tx/legacy_amino_json_test.go +++ b/x/auth/tx/legacy_amino_json_test.go @@ -4,16 +4,16 @@ import ( "context" "testing" + "github.com/stretchr/testify/require" + txsigning "cosmossdk.io/x/tx/signing" "cosmossdk.io/x/tx/signing/aminojson" - "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/legacy" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/tx" signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" "github.com/cosmos/cosmos-sdk/x/auth/signing" @@ -45,7 +45,6 @@ func TestLegacyAminoJSONHandler_GetSignBytes(t *testing.T) { chainID = "test-chain" accNum uint64 = 7 seqNum uint64 = 7 - tip = &tx.Tip{Tipper: addr1.String(), Amount: coins} ) testcases := []struct { @@ -57,22 +56,18 @@ func TestLegacyAminoJSONHandler_GetSignBytes(t *testing.T) { { "signer which is also fee payer (no tips)", addr1.String(), func(w *wrapper) {}, - legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas}, []sdk.Msg{msg}, memo, nil), - }, - { - "signer which is also fee payer (with tips)", addr2.String(), - func(w *wrapper) { w.SetTip(tip) }, - legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas}, []sdk.Msg{msg}, memo, tip), + legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas}, []sdk.Msg{msg}, memo), }, + { "explicit fee payer", addr1.String(), func(w *wrapper) { w.SetFeePayer(addr2) }, - legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Payer: addr2.String()}, []sdk.Msg{msg}, memo, nil), + legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Payer: addr2.String()}, []sdk.Msg{msg}, memo), }, { "explicit fee granter", addr1.String(), func(w *wrapper) { w.SetFeeGranter(addr2) }, - legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Granter: addr2.String()}, []sdk.Msg{msg}, memo, nil), + legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Granter: addr2.String()}, []sdk.Msg{msg}, memo), }, { "explicit fee payer and fee granter", addr1.String(), @@ -80,12 +75,7 @@ func TestLegacyAminoJSONHandler_GetSignBytes(t *testing.T) { w.SetFeePayer(addr2) w.SetFeeGranter(addr2) }, - legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Payer: addr2.String(), Granter: addr2.String()}, []sdk.Msg{msg}, memo, nil), - }, - { - "signer which is also tipper", addr1.String(), - func(w *wrapper) { w.SetTip(tip) }, - legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{}, []sdk.Msg{msg}, memo, tip), + legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Payer: addr2.String(), Granter: addr2.String()}, []sdk.Msg{msg}, memo), }, } @@ -150,7 +140,6 @@ func TestLegacyAminoJSONHandler_AllGetSignBytesComparison(t *testing.T) { chainID = "test-chain" accNum uint64 seqNum uint64 = 7 - tip = &tx.Tip{Tipper: addr1.String(), Amount: coins} ) modeHandler := aminojson.NewSignModeHandler(aminojson.SignModeHandlerOptions{}) @@ -168,22 +157,18 @@ func TestLegacyAminoJSONHandler_AllGetSignBytesComparison(t *testing.T) { { "signer which is also fee payer (no tips)", addr1.String(), func(w *wrapper) {}, - legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas}, []sdk.Msg{msg}, memo, nil), - }, - { - "signer which is also fee payer (with tips)", addr2.String(), - func(w *wrapper) { w.SetTip(tip) }, - legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas}, []sdk.Msg{msg}, memo, tip), + legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas}, []sdk.Msg{msg}, memo), }, + { "explicit fee payer", addr1.String(), func(w *wrapper) { w.SetFeePayer(addr2) }, - legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Payer: addr2.String()}, []sdk.Msg{msg}, memo, nil), + legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Payer: addr2.String()}, []sdk.Msg{msg}, memo), }, { "explicit fee granter", addr1.String(), func(w *wrapper) { w.SetFeeGranter(addr2) }, - legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Granter: addr2.String()}, []sdk.Msg{msg}, memo, nil), + legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Granter: addr2.String()}, []sdk.Msg{msg}, memo), }, { "explicit fee payer and fee granter", addr1.String(), @@ -191,12 +176,7 @@ func TestLegacyAminoJSONHandler_AllGetSignBytesComparison(t *testing.T) { w.SetFeePayer(addr2) w.SetFeeGranter(addr2) }, - legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Payer: addr2.String(), Granter: addr2.String()}, []sdk.Msg{msg}, memo, nil), - }, - { - "signer which is also tipper", addr1.String(), - func(w *wrapper) { w.SetTip(tip) }, - legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{}, []sdk.Msg{msg}, memo, tip), + legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Payer: addr2.String(), Granter: addr2.String()}, []sdk.Msg{msg}, memo), }, } diff --git a/x/auth/tx/service.go b/x/auth/tx/service.go index 9f4d56a93164..a96ac8cae0b4 100644 --- a/x/auth/tx/service.go +++ b/x/auth/tx/service.go @@ -97,7 +97,7 @@ func (s txServer) Simulate(ctx context.Context, req *txtypes.SimulateRequest) (* gasInfo, result, err := s.simulate(txBytes) if err != nil { - return nil, status.Errorf(codes.Unknown, "%v With gas wanted: '%d' and gas used: '%d' ", err, gasInfo.GasWanted, gasInfo.GasUsed) + return nil, status.Errorf(codes.Unknown, "%v with gas used: '%d'", err, gasInfo.GasUsed) } return &txtypes.SimulateResponse{ @@ -195,13 +195,13 @@ func (s txServer) GetBlockWithTxs(ctx context.Context, req *txtypes.GetBlockWith if req.Pagination != nil && req.Pagination.Reverse { for i, count := offset, uint64(0); i > 0 && count != limit; i, count = i-1, count+1 { if err = decodeTxAt(i); err != nil { - return nil, err + sdkCtx.Logger().Error("failed to decode tx", "error", err) } } } else { for i, count := offset, uint64(0); i < blockTxsLn && count != limit; i, count = i+1, count+1 { if err = decodeTxAt(i); err != nil { - return nil, err + sdkCtx.Logger().Error("failed to decode tx", "error", err) } } } diff --git a/x/auth/tx/sigs_test.go b/x/auth/tx/sigs_test.go index ab868db1cdef..75a2355b7558 100644 --- a/x/auth/tx/sigs_test.go +++ b/x/auth/tx/sigs_test.go @@ -6,7 +6,6 @@ import ( "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/crypto/types" - "github.com/cosmos/cosmos-sdk/testutil/testdata" ) diff --git a/x/auth/tx/testutil/expected_keepers_mocks.go b/x/auth/tx/testutil/expected_keepers_mocks.go index fada0426cf16..fa805e9836fb 100644 --- a/x/auth/tx/testutil/expected_keepers_mocks.go +++ b/x/auth/tx/testutil/expected_keepers_mocks.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: x/auth/tx/config/expected_keepers.go +// +// Generated by this command: +// +// mockgen -source=x/auth/tx/config/expected_keepers.go -package testutil -destination x/auth/tx/testutil/expected_keepers_mocks.go +// // Package testutil is a generated GoMock package. package testutil @@ -9,13 +14,14 @@ import ( reflect "reflect" types "github.com/cosmos/cosmos-sdk/x/bank/types" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockBankKeeper is a mock of BankKeeper interface. type MockBankKeeper struct { ctrl *gomock.Controller recorder *MockBankKeeperMockRecorder + isgomock struct{} } // MockBankKeeperMockRecorder is the mock recorder for MockBankKeeper. @@ -45,7 +51,7 @@ func (m *MockBankKeeper) DenomMetadata(c context.Context, req *types.QueryDenomM } // DenomMetadata indicates an expected call of DenomMetadata. -func (mr *MockBankKeeperMockRecorder) DenomMetadata(c, req interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) DenomMetadata(c, req any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DenomMetadata", reflect.TypeOf((*MockBankKeeper)(nil).DenomMetadata), c, req) } diff --git a/x/auth/tx/textual.go b/x/auth/tx/textual.go index a804280adfb5..028248d61958 100644 --- a/x/auth/tx/textual.go +++ b/x/auth/tx/textual.go @@ -4,17 +4,16 @@ import ( "context" "fmt" - txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" - "cosmossdk.io/x/tx/signing/textual" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/known/anypb" - signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing" - + txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" txsigning "cosmossdk.io/x/tx/signing" + "cosmossdk.io/x/tx/signing/textual" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" + signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/x/auth/signing" ) diff --git a/x/auth/types/account.go b/x/auth/types/account.go index 9345d819d240..b111cf0c1688 100644 --- a/x/auth/types/account.go +++ b/x/auth/types/account.go @@ -218,6 +218,10 @@ func (ma ModuleAccount) Validate() error { return errors.New("module account name cannot be blank") } + if ma.BaseAccount == nil { + return errors.New("uninitialized ModuleAccount: BaseAccount is nil") + } + if ma.Address != sdk.AccAddress(crypto.AddressHash([]byte(ma.Name))).String() { return fmt.Errorf("address %s cannot be derived from the module name '%s'", ma.Address, ma.Name) } diff --git a/x/auth/types/account_test.go b/x/auth/types/account_test.go index 545e3beef5d1..d29372dcd081 100644 --- a/x/auth/types/account_test.go +++ b/x/auth/types/account_test.go @@ -193,3 +193,8 @@ func TestNewModuleAddressOrBech32Address(t *testing.T) { require.Equal(t, input, types.NewModuleAddressOrBech32Address(input).String()) require.Equal(t, "cosmos1jv65s3grqf6v6jl3dp4t6c9t9rk99cd88lyufl", types.NewModuleAddressOrBech32Address("distribution").String()) } + +func TestModuleAccountValidateNilBaseAccount(t *testing.T) { + ma := &types.ModuleAccount{Name: "foo"} + _ = ma.Validate() +} diff --git a/x/auth/types/credentials_test.go b/x/auth/types/credentials_test.go index 4c3f1a5bf64d..1e5a0ce6d1e2 100644 --- a/x/auth/types/credentials_test.go +++ b/x/auth/types/credentials_test.go @@ -3,10 +3,11 @@ package types_test import ( "testing" + "github.com/stretchr/testify/require" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/stretchr/testify/require" ) func TestNewModuleCrendentials(t *testing.T) { diff --git a/x/auth/types/msgs.go b/x/auth/types/msgs.go deleted file mode 100644 index 8beea7684e68..000000000000 --- a/x/auth/types/msgs.go +++ /dev/null @@ -1,13 +0,0 @@ -package types - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" -) - -var _ sdk.Msg = &MsgUpdateParams{} - -// GetSigners returns the expected signers for a MsgUpdateParams message. -func (msg MsgUpdateParams) GetSigners() []sdk.AccAddress { - addr, _ := sdk.AccAddressFromBech32(msg.Authority) - return []sdk.AccAddress{addr} -} diff --git a/x/auth/types/query.pb.go b/x/auth/types/query.pb.go index 72910ef780ac..552a9efb1532 100644 --- a/x/auth/types/query.pb.go +++ b/x/auth/types/query.pb.go @@ -1467,6 +1467,7 @@ func _Query_AccountInfo_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.auth.v1beta1.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/auth/types/tx.pb.go b/x/auth/types/tx.pb.go index 7214842181cc..2ed8bf494810 100644 --- a/x/auth/types/tx.pb.go +++ b/x/auth/types/tx.pb.go @@ -238,6 +238,7 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.auth.v1beta1.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/auth/vesting/README.md b/x/auth/vesting/README.md index 62619ede0d20..892013065a45 100644 --- a/x/auth/vesting/README.md +++ b/x/auth/vesting/README.md @@ -73,25 +73,25 @@ type VestingAccount interface { ### BaseVestingAccount ```protobuf reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/vesting/v1beta1/vesting.proto#L11-L35 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/vesting/v1beta1/vesting.proto#L11-L35 ``` ### ContinuousVestingAccount ```protobuf reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/vesting/v1beta1/vesting.proto#L37-L46 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/vesting/v1beta1/vesting.proto#L37-L46 ``` ### DelayedVestingAccount ```protobuf reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/vesting/v1beta1/vesting.proto#L48-L57 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/vesting/v1beta1/vesting.proto#L48-L57 ``` ### Period ```protobuf reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/vesting/v1beta1/vesting.proto#L59-L69 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/vesting/v1beta1/vesting.proto#L59-L69 ``` ```go @@ -103,7 +103,7 @@ type Periods []Period ### PeriodicVestingAccount ```protobuf reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/vesting/v1beta1/vesting.proto#L71-L81 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/vesting/v1beta1/vesting.proto#L71-L81 ``` In order to facilitate less ad-hoc type checking and assertions and to support flexibility in account balance usage, the existing `x/bank` `ViewKeeper` interface is updated to contain the following: @@ -123,7 +123,7 @@ type ViewKeeper interface { ### PermanentLockedAccount ```protobuf reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/vesting/v1beta1/vesting.proto#L83-L94 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/vesting/v1beta1/vesting.proto#L83-L94 ``` ## Vesting Account Specification diff --git a/x/auth/vesting/autocli.go b/x/auth/vesting/autocli.go new file mode 100644 index 000000000000..2ff4585db1ae --- /dev/null +++ b/x/auth/vesting/autocli.go @@ -0,0 +1,47 @@ +package vesting + +import ( + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + vestingv1beta1 "cosmossdk.io/api/cosmos/vesting/v1beta1" +) + +// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. +func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { + return &autocliv1.ModuleOptions{ + Tx: &autocliv1.ServiceCommandDescriptor{ + Service: vestingv1beta1.Msg_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "CreateVestingAccount", + Use: "create-vesting-account [to_address] [end_time] [amount]", + Short: "Create a new vesting account funded with an allocation of tokens.", + Long: `Create a new vesting account funded with an allocation of tokens. The +account can either be a delayed or continuous vesting account, which is determined +by the '--delayed' flag. All vesting accounts created will have their start time +set by the committed block's time. The end_time must be provided as a UNIX epoch +timestamp.`, + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "to_address"}, + {ProtoField: "end_time"}, + {ProtoField: "amount", Varargs: true}, + }, + FlagOptions: map[string]*autocliv1.FlagOptions{ + "delayed": {Name: "delayed", Usage: "Create a delayed vesting account if true"}, + }, + }, + { + RpcMethod: "CreatePermanentLockedAccount", + Use: "create-permanent-locked-account [to_address] [amount]", + Short: "Create a new permanently locked account funded with an allocation of tokens.", + Long: `Create a new account funded with an allocation of permanently locked tokens. +These tokens may be used for staking but are non-transferable. Staking rewards will acrue as liquid and transferable tokens.`, + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "to_address"}, + {ProtoField: "amount", Varargs: true}, + }, + }, + }, + EnhanceCustomCommand: false, // use custom commands only until v0.51 + }, + } +} diff --git a/x/auth/vesting/client/cli/tx.go b/x/auth/vesting/client/cli/tx.go index fe983856e0d5..fe6a0c341f21 100644 --- a/x/auth/vesting/client/cli/tx.go +++ b/x/auth/vesting/client/cli/tx.go @@ -7,9 +7,10 @@ import ( "os" "strconv" - "cosmossdk.io/core/address" "github.com/spf13/cobra" + "cosmossdk.io/core/address" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" diff --git a/x/auth/vesting/client/cli/tx_test.go b/x/auth/vesting/client/cli/tx_test.go index f2591446034d..4df054f0e2f1 100644 --- a/x/auth/vesting/client/cli/tx_test.go +++ b/x/auth/vesting/client/cli/tx_test.go @@ -7,10 +7,11 @@ import ( "testing" "time" - sdkmath "cosmossdk.io/math" rpcclientmock "github.com/cometbft/cometbft/rpc/client/mock" "github.com/stretchr/testify/suite" + sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/codec/address" diff --git a/x/auth/vesting/module.go b/x/auth/vesting/module.go index 0a3dc9a8e75f..139efb1af0de 100644 --- a/x/auth/vesting/module.go +++ b/x/auth/vesting/module.go @@ -8,6 +8,9 @@ import ( "github.com/spf13/cobra" "google.golang.org/grpc" + modulev1 "cosmossdk.io/api/cosmos/vesting/module/v1" + "cosmossdk.io/core/address" + "cosmossdk.io/core/appmodule" "cosmossdk.io/depinject" "github.com/cosmos/cosmos-sdk/client" @@ -15,19 +18,16 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - - modulev1 "cosmossdk.io/api/cosmos/vesting/module/v1" - "cosmossdk.io/core/address" - "cosmossdk.io/core/appmodule" - "github.com/cosmos/cosmos-sdk/x/auth/keeper" "github.com/cosmos/cosmos-sdk/x/auth/vesting/client/cli" "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" ) var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleBasic = AppModule{} + + _ appmodule.AppModule = AppModule{} + _ appmodule.HasServices = AppModule{} ) // AppModuleBasic defines the basic application module used by the sub-vesting @@ -72,11 +72,6 @@ func (ab AppModuleBasic) GetTxCmd() *cobra.Command { return cli.GetTxCmd(ab.ac) } -// GetQueryCmd returns the module's root query command. Currently, this is a no-op. -func (AppModuleBasic) GetQueryCmd() *cobra.Command { - return nil -} - // AppModule extends the AppModuleBasic implementation by implementing the // AppModule interface. type AppModule struct { @@ -94,11 +89,6 @@ func NewAppModule(ak keeper.AccountKeeper, bk types.BankKeeper) AppModule { } } -var ( - _ appmodule.AppModule = AppModule{} - _ appmodule.HasServices = AppModule{} -) - // IsOnePerModuleType implements the depinject.OnePerModuleType interface. func (am AppModule) IsOnePerModuleType() {} diff --git a/x/auth/vesting/msg_server.go b/x/auth/vesting/msg_server.go index 27eb3e110b54..222fc262a291 100644 --- a/x/auth/vesting/msg_server.go +++ b/x/auth/vesting/msg_server.go @@ -3,7 +3,7 @@ package vesting import ( "context" - "github.com/armon/go-metrics" + "github.com/hashicorp/go-metrics" errorsmod "cosmossdk.io/errors" @@ -62,7 +62,10 @@ func (s msgServer) CreateVestingAccount(goCtx context.Context, msg *types.MsgCre baseAccount := authtypes.NewBaseAccountWithAddress(to) baseAccount = s.AccountKeeper.NewAccount(ctx, baseAccount).(*authtypes.BaseAccount) - baseVestingAccount := types.NewBaseVestingAccount(baseAccount, msg.Amount.Sort(), msg.EndTime) + baseVestingAccount, err := types.NewBaseVestingAccount(baseAccount, msg.Amount.Sort(), msg.EndTime) + if err != nil { + return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) + } var vestingAccount sdk.AccountI if msg.Delayed { @@ -124,7 +127,10 @@ func (s msgServer) CreatePermanentLockedAccount(goCtx context.Context, msg *type baseAccount := authtypes.NewBaseAccountWithAddress(to) baseAccount = s.AccountKeeper.NewAccount(ctx, baseAccount).(*authtypes.BaseAccount) - vestingAccount := types.NewPermanentLockedAccount(baseAccount, msg.Amount) + vestingAccount, err := types.NewPermanentLockedAccount(baseAccount, msg.Amount) + if err != nil { + return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) + } s.AccountKeeper.SetAccount(ctx, vestingAccount) @@ -170,9 +176,17 @@ func (s msgServer) CreatePeriodicVestingAccount(goCtx context.Context, msg *type return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "invalid period length of %d in period %d, length must be greater than 0", period.Length, i) } + if err := validateAmount(period.Amount); err != nil { + return nil, err + } + totalCoins = totalCoins.Add(period.Amount...) } + if s.BankKeeper.BlockedAddr(to) { + return nil, errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "%s is not allowed to receive funds", msg.ToAddress) + } + ctx := sdk.UnwrapSDKContext(goCtx) if acc := s.AccountKeeper.GetAccount(ctx, to); acc != nil { return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "account %s already exists", msg.ToAddress) @@ -184,7 +198,10 @@ func (s msgServer) CreatePeriodicVestingAccount(goCtx context.Context, msg *type baseAccount := authtypes.NewBaseAccountWithAddress(to) baseAccount = s.AccountKeeper.NewAccount(ctx, baseAccount).(*authtypes.BaseAccount) - vestingAccount := types.NewPeriodicVestingAccount(baseAccount, totalCoins.Sort(), msg.StartTime, msg.VestingPeriods) + vestingAccount, err := types.NewPeriodicVestingAccount(baseAccount, totalCoins.Sort(), msg.StartTime, msg.VestingPeriods) + if err != nil { + return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) + } s.AccountKeeper.SetAccount(ctx, vestingAccount) diff --git a/x/auth/vesting/msg_server_test.go b/x/auth/vesting/msg_server_test.go index 2a121271e10a..b54a73860396 100644 --- a/x/auth/vesting/msg_server_test.go +++ b/x/auth/vesting/msg_server_test.go @@ -6,15 +6,17 @@ import ( cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" cmttime "github.com/cometbft/cometbft/types/time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" + "go.uber.org/mock/gomock" + "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" + authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/auth/vesting" @@ -56,6 +58,7 @@ func (s *VestingTestSuite) SetupTest() { storeService, authtypes.ProtoBaseAccount, maccPerms, + authcodec.NewBech32Codec("cosmos"), "cosmos", authtypes.NewModuleAddress("gov").String(), ) @@ -94,7 +97,18 @@ func (s *VestingTestSuite) TestCreateVestingAccount() { expErr: true, expErrMsg: "invalid 'to' address", }, - "": { + "invalid coins": { + input: vestingtypes.NewMsgCreateVestingAccount( + fromAddr, + to1Addr, + sdk.Coins{sdk.Coin{Denom: "stake", Amount: math.NewInt(-1)}}, + time.Now().Unix(), + true, + ), + expErr: true, + expErrMsg: "-1stake: invalid coins", + }, + "invalid end time": { input: vestingtypes.NewMsgCreateVestingAccount( fromAddr, to1Addr, @@ -122,6 +136,21 @@ func (s *VestingTestSuite) TestCreateVestingAccount() { expErr: true, expErrMsg: "already exists", }, + "create for blocked account": { + preRun: func() { + s.bankKeeper.EXPECT().IsSendEnabledCoins(gomock.Any(), fooCoin).Return(nil) + s.bankKeeper.EXPECT().BlockedAddr(to1Addr).Return(true) + }, + input: vestingtypes.NewMsgCreateVestingAccount( + fromAddr, + to1Addr, + sdk.Coins{fooCoin}, + time.Now().Unix(), + true, + ), + expErr: true, + expErrMsg: "not allowed to receive funds", + }, "create a valid delayed vesting account": { preRun: func() { s.bankKeeper.EXPECT().IsSendEnabledCoins(gomock.Any(), fooCoin).Return(nil) @@ -197,6 +226,15 @@ func (s *VestingTestSuite) TestCreatePermanentLockedAccount() { expErr: true, expErrMsg: "invalid 'to' address", }, + "invalid coins": { + input: vestingtypes.NewMsgCreatePermanentLockedAccount( + fromAddr, + to1Addr, + sdk.Coins{sdk.Coin{Denom: "stake", Amount: math.NewInt(-1)}}, + ), + expErr: true, + expErrMsg: "-1stake: invalid coins", + }, "create for existing account": { preRun: func() { toAcc := s.accountKeeper.NewAccountWithAddress(s.ctx, to1Addr) @@ -212,6 +250,22 @@ func (s *VestingTestSuite) TestCreatePermanentLockedAccount() { expErr: true, expErrMsg: "already exists", }, + "create for blocked account": { + preRun: func() { + toAcc := s.accountKeeper.NewAccountWithAddress(s.ctx, to1Addr) + s.bankKeeper.EXPECT().IsSendEnabledCoins(gomock.Any(), fooCoin).Return(nil) + s.bankKeeper.EXPECT().BlockedAddr(to1Addr).Return(true) + s.accountKeeper.SetAccount(s.ctx, toAcc) + }, + input: vestingtypes.NewMsgCreatePermanentLockedAccount( + fromAddr, + to1Addr, + sdk.Coins{fooCoin}, + ), + expErr: true, + expErrMsg: "not allowed to receive funds", + }, + "create a valid permanent locked account": { preRun: func() { s.bankKeeper.EXPECT().IsSendEnabledCoins(gomock.Any(), fooCoin).Return(nil) @@ -317,9 +371,26 @@ func (s *VestingTestSuite) TestCreatePeriodicVestingAccount() { expErr: true, expErrMsg: "invalid period", }, + { + name: "invalid coins", + input: vestingtypes.NewMsgCreatePeriodicVestingAccount( + fromAddr, + to1Addr, + time.Now().Unix(), + []vestingtypes.Period{ + { + Length: 1, + Amount: sdk.Coins{sdk.Coin{Denom: "stake", Amount: math.NewInt(-1)}}, + }, + }, + ), + expErr: true, + expErrMsg: "-1stake: invalid coins", + }, { name: "create for existing account", preRun: func() { + s.bankKeeper.EXPECT().BlockedAddr(to1Addr).Return(false) toAcc := s.accountKeeper.NewAccountWithAddress(s.ctx, to1Addr) s.accountKeeper.SetAccount(s.ctx, toAcc) }, @@ -337,10 +408,34 @@ func (s *VestingTestSuite) TestCreatePeriodicVestingAccount() { expErr: true, expErrMsg: "already exists", }, + { + name: "create for blocked address", + preRun: func() { + s.bankKeeper.EXPECT().BlockedAddr(to2Addr).Return(true) + }, + input: vestingtypes.NewMsgCreatePeriodicVestingAccount( + fromAddr, + to2Addr, + time.Now().Unix(), + []vestingtypes.Period{ + { + Length: 10, + Amount: sdk.NewCoins(periodCoin), + }, + { + Length: 20, + Amount: sdk.NewCoins(fooCoin), + }, + }, + ), + expErr: true, + expErrMsg: "not allowed to receive funds", + }, { name: "create a valid periodic vesting account", preRun: func() { s.bankKeeper.EXPECT().IsSendEnabledCoins(gomock.Any(), periodCoin.Add(fooCoin)).Return(nil) + s.bankKeeper.EXPECT().BlockedAddr(to2Addr).Return(false) s.bankKeeper.EXPECT().SendCoins(gomock.Any(), fromAddr, to2Addr, gomock.Any()).Return(nil) }, input: vestingtypes.NewMsgCreatePeriodicVestingAccount( diff --git a/x/auth/vesting/testutil/expected_keepers_mocks.go b/x/auth/vesting/testutil/expected_keepers_mocks.go index 1df8f8ebbf2b..71ffdd5e3685 100644 --- a/x/auth/vesting/testutil/expected_keepers_mocks.go +++ b/x/auth/vesting/testutil/expected_keepers_mocks.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: x/auth/vesting/types/expected_keepers.go +// +// Generated by this command: +// +// mockgen -source=x/auth/vesting/types/expected_keepers.go -package testutil -destination x/auth/vesting/testutil/expected_keepers_mocks.go +// // Package testutil is a generated GoMock package. package testutil @@ -9,13 +14,14 @@ import ( reflect "reflect" types "github.com/cosmos/cosmos-sdk/types" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockBankKeeper is a mock of BankKeeper interface. type MockBankKeeper struct { ctrl *gomock.Controller recorder *MockBankKeeperMockRecorder + isgomock struct{} } // MockBankKeeperMockRecorder is the mock recorder for MockBankKeeper. @@ -44,7 +50,7 @@ func (m *MockBankKeeper) BlockedAddr(addr types.AccAddress) bool { } // BlockedAddr indicates an expected call of BlockedAddr. -func (mr *MockBankKeeperMockRecorder) BlockedAddr(addr interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) BlockedAddr(addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlockedAddr", reflect.TypeOf((*MockBankKeeper)(nil).BlockedAddr), addr) } @@ -52,7 +58,7 @@ func (mr *MockBankKeeperMockRecorder) BlockedAddr(addr interface{}) *gomock.Call // IsSendEnabledCoins mocks base method. func (m *MockBankKeeper) IsSendEnabledCoins(ctx context.Context, coins ...types.Coin) error { m.ctrl.T.Helper() - varargs := []interface{}{ctx} + varargs := []any{ctx} for _, a := range coins { varargs = append(varargs, a) } @@ -62,9 +68,9 @@ func (m *MockBankKeeper) IsSendEnabledCoins(ctx context.Context, coins ...types. } // IsSendEnabledCoins indicates an expected call of IsSendEnabledCoins. -func (mr *MockBankKeeperMockRecorder) IsSendEnabledCoins(ctx interface{}, coins ...interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) IsSendEnabledCoins(ctx any, coins ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{ctx}, coins...) + varargs := append([]any{ctx}, coins...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsSendEnabledCoins", reflect.TypeOf((*MockBankKeeper)(nil).IsSendEnabledCoins), varargs...) } @@ -77,7 +83,7 @@ func (m *MockBankKeeper) SendCoins(ctx context.Context, fromAddr, toAddr types.A } // SendCoins indicates an expected call of SendCoins. -func (mr *MockBankKeeperMockRecorder) SendCoins(ctx, fromAddr, toAddr, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SendCoins(ctx, fromAddr, toAddr, amt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoins", reflect.TypeOf((*MockBankKeeper)(nil).SendCoins), ctx, fromAddr, toAddr, amt) } diff --git a/x/auth/vesting/types/genesis_test.go b/x/auth/vesting/types/genesis_test.go index 98aabb15cfde..31971396dd8f 100644 --- a/x/auth/vesting/types/genesis_test.go +++ b/x/auth/vesting/types/genesis_test.go @@ -21,7 +21,8 @@ var ( func TestValidateGenesisInvalidAccounts(t *testing.T) { acc1 := authtypes.NewBaseAccountWithAddress(sdk.AccAddress(addr1)) acc1Balance := sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 150)) - baseVestingAcc := NewBaseVestingAccount(acc1, acc1Balance, 1548775410) + baseVestingAcc, err := NewBaseVestingAccount(acc1, acc1Balance, 1548775410) + require.NoError(t, err) // invalid delegated vesting baseVestingAcc.DelegatedVesting = acc1Balance.Add(acc1Balance...) diff --git a/x/auth/vesting/types/msgs.go b/x/auth/vesting/types/msgs.go index 3d31b05bb26d..296fa8845921 100644 --- a/x/auth/vesting/types/msgs.go +++ b/x/auth/vesting/types/msgs.go @@ -21,12 +21,6 @@ func NewMsgCreateVestingAccount(fromAddr, toAddr sdk.AccAddress, amount sdk.Coin } } -// GetSigners returns the expected signers for a MsgCreateVestingAccount. -func (msg MsgCreateVestingAccount) GetSigners() []sdk.AccAddress { - addr, _ := sdk.AccAddressFromBech32(msg.FromAddress) - return []sdk.AccAddress{addr} -} - // NewMsgCreatePermanentLockedAccount returns a reference to a new MsgCreatePermanentLockedAccount. func NewMsgCreatePermanentLockedAccount(fromAddr, toAddr sdk.AccAddress, amount sdk.Coins) *MsgCreatePermanentLockedAccount { return &MsgCreatePermanentLockedAccount{ @@ -36,12 +30,6 @@ func NewMsgCreatePermanentLockedAccount(fromAddr, toAddr sdk.AccAddress, amount } } -// GetSigners returns the expected signers for a MsgCreatePermanentLockedAccount. -func (msg MsgCreatePermanentLockedAccount) GetSigners() []sdk.AccAddress { - from, _ := sdk.AccAddressFromBech32(msg.FromAddress) - return []sdk.AccAddress{from} -} - // NewMsgCreatePeriodicVestingAccount returns a reference to a new MsgCreatePeriodicVestingAccount. func NewMsgCreatePeriodicVestingAccount(fromAddr, toAddr sdk.AccAddress, startTime int64, periods []Period) *MsgCreatePeriodicVestingAccount { return &MsgCreatePeriodicVestingAccount{ @@ -51,12 +39,3 @@ func NewMsgCreatePeriodicVestingAccount(fromAddr, toAddr sdk.AccAddress, startTi VestingPeriods: periods, } } - -// GetSigners returns the expected signers for a MsgCreatePeriodicVestingAccount. -func (msg MsgCreatePeriodicVestingAccount) GetSigners() []sdk.AccAddress { - from, err := sdk.AccAddressFromBech32(msg.FromAddress) - if err != nil { - panic(err) - } - return []sdk.AccAddress{from} -} diff --git a/x/auth/vesting/types/test_common.go b/x/auth/vesting/types/test_common.go index 0e22ea2352dd..fc29080d3e97 100644 --- a/x/auth/vesting/types/test_common.go +++ b/x/auth/vesting/types/test_common.go @@ -4,7 +4,6 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/testutil/testdata" - sdk "github.com/cosmos/cosmos-sdk/types" ) diff --git a/x/auth/vesting/types/tx.pb.go b/x/auth/vesting/types/tx.pb.go index 2d46bb32daca..146cd622a900 100644 --- a/x/auth/vesting/types/tx.pb.go +++ b/x/auth/vesting/types/tx.pb.go @@ -654,6 +654,7 @@ func _Msg_CreatePeriodicVestingAccount_Handler(srv interface{}, ctx context.Cont return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.vesting.v1beta1.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/auth/vesting/types/vesting_account.go b/x/auth/vesting/types/vesting_account.go index 8ecb1f420d76..868dc49588e7 100644 --- a/x/auth/vesting/types/vesting_account.go +++ b/x/auth/vesting/types/vesting_account.go @@ -2,6 +2,7 @@ package types import ( "errors" + "fmt" "time" "cosmossdk.io/math" @@ -24,14 +25,16 @@ var ( // NewBaseVestingAccount creates a new BaseVestingAccount object. It is the // callers responsibility to ensure the base account has sufficient funds with // regards to the original vesting amount. -func NewBaseVestingAccount(baseAccount *authtypes.BaseAccount, originalVesting sdk.Coins, endTime int64) *BaseVestingAccount { - return &BaseVestingAccount{ +func NewBaseVestingAccount(baseAccount *authtypes.BaseAccount, originalVesting sdk.Coins, endTime int64) (*BaseVestingAccount, error) { + baseVestingAccount := &BaseVestingAccount{ BaseAccount: baseAccount, OriginalVesting: originalVesting, DelegatedFree: sdk.NewCoins(), DelegatedVesting: sdk.NewCoins(), EndTime: endTime, } + + return baseVestingAccount, baseVestingAccount.Validate() } // LockedCoinsFromVesting returns all the coins that are not spendable (i.e. locked) @@ -144,9 +147,18 @@ func (bva BaseVestingAccount) GetEndTime() int64 { // Validate checks for errors on the account fields func (bva BaseVestingAccount) Validate() error { + if bva.EndTime < 0 { + return errors.New("end time cannot be negative") + } + + if !bva.OriginalVesting.IsValid() || !bva.OriginalVesting.IsAllPositive() { + return fmt.Errorf("invalid coins: %s", bva.OriginalVesting.String()) + } + if !(bva.DelegatedVesting.IsAllLTE(bva.OriginalVesting)) { return errors.New("delegated vesting amount cannot be greater than original vesting amount") } + return bva.BaseAccount.Validate() } @@ -166,17 +178,19 @@ func NewContinuousVestingAccountRaw(bva *BaseVestingAccount, startTime int64) *C } // NewContinuousVestingAccount returns a new ContinuousVestingAccount -func NewContinuousVestingAccount(baseAcc *authtypes.BaseAccount, originalVesting sdk.Coins, startTime, endTime int64) *ContinuousVestingAccount { +func NewContinuousVestingAccount(baseAcc *authtypes.BaseAccount, originalVesting sdk.Coins, startTime, endTime int64) (*ContinuousVestingAccount, error) { baseVestingAcc := &BaseVestingAccount{ BaseAccount: baseAcc, OriginalVesting: originalVesting, EndTime: endTime, } - return &ContinuousVestingAccount{ + continuousVestingAccount := &ContinuousVestingAccount{ StartTime: startTime, BaseVestingAccount: baseVestingAcc, } + + return continuousVestingAccount, continuousVestingAccount.Validate() } // GetVestedCoins returns the total number of vested coins. If no coins are vested, @@ -199,7 +213,7 @@ func (cva ContinuousVestingAccount) GetVestedCoins(blockTime time.Time) sdk.Coin s := math.LegacyNewDec(x).Quo(math.LegacyNewDec(y)) for _, ovc := range cva.OriginalVesting { - vestedAmt := sdk.NewDecFromInt(ovc.Amount).Mul(s).RoundInt() + vestedAmt := math.LegacyNewDecFromInt(ovc.Amount).Mul(s).RoundInt() vestedCoins = append(vestedCoins, sdk.NewCoin(ovc.Denom, vestedAmt)) } @@ -257,22 +271,25 @@ func NewPeriodicVestingAccountRaw(bva *BaseVestingAccount, startTime int64, peri } // NewPeriodicVestingAccount returns a new PeriodicVestingAccount -func NewPeriodicVestingAccount(baseAcc *authtypes.BaseAccount, originalVesting sdk.Coins, startTime int64, periods Periods) *PeriodicVestingAccount { +func NewPeriodicVestingAccount(baseAcc *authtypes.BaseAccount, originalVesting sdk.Coins, startTime int64, periods Periods) (*PeriodicVestingAccount, error) { endTime := startTime for _, p := range periods { endTime += p.Length } + baseVestingAcc := &BaseVestingAccount{ BaseAccount: baseAcc, OriginalVesting: originalVesting, EndTime: endTime, } - return &PeriodicVestingAccount{ + periodicVestingAccount := &PeriodicVestingAccount{ BaseVestingAccount: baseVestingAcc, StartTime: startTime, VestingPeriods: periods, } + + return periodicVestingAccount, periodicVestingAccount.Validate() } // GetVestedCoins returns the total number of vested coins. If no coins are vested, @@ -345,15 +362,26 @@ func (pva PeriodicVestingAccount) Validate() error { } endTime := pva.StartTime originalVesting := sdk.NewCoins() - for _, p := range pva.VestingPeriods { + for i, p := range pva.VestingPeriods { + if p.Length < 0 { + return fmt.Errorf("period #%d has a negative length: %d", i, p.Length) + } endTime += p.Length + + if !p.Amount.IsValid() || !p.Amount.IsAllPositive() { + return fmt.Errorf("period #%d has invalid coins: %s", i, p.Amount.String()) + } + originalVesting = originalVesting.Add(p.Amount...) } if endTime != pva.EndTime { return errors.New("vesting end time does not match length of all vesting periods") } + if endTime < pva.GetStartTime() { + return errors.New("cumulative endTime overflowed, and/or is less than startTime") + } if !originalVesting.Equal(pva.OriginalVesting) { - return errors.New("original vesting coins does not match the sum of all coins in vesting periods") + return fmt.Errorf("original vesting coins (%v) does not match the sum of all coins in vesting periods (%v)", pva.OriginalVesting, originalVesting) } return pva.BaseVestingAccount.Validate() @@ -374,14 +402,16 @@ func NewDelayedVestingAccountRaw(bva *BaseVestingAccount) *DelayedVestingAccount } // NewDelayedVestingAccount returns a DelayedVestingAccount -func NewDelayedVestingAccount(baseAcc *authtypes.BaseAccount, originalVesting sdk.Coins, endTime int64) *DelayedVestingAccount { +func NewDelayedVestingAccount(baseAcc *authtypes.BaseAccount, originalVesting sdk.Coins, endTime int64) (*DelayedVestingAccount, error) { baseVestingAcc := &BaseVestingAccount{ BaseAccount: baseAcc, OriginalVesting: originalVesting, EndTime: endTime, } - return &DelayedVestingAccount{baseVestingAcc} + delayedVestingAccount := &DelayedVestingAccount{baseVestingAcc} + + return delayedVestingAccount, delayedVestingAccount.Validate() } // GetVestedCoins returns the total amount of vested coins for a delayed vesting @@ -432,14 +462,16 @@ var ( ) // NewPermanentLockedAccount returns a PermanentLockedAccount -func NewPermanentLockedAccount(baseAcc *authtypes.BaseAccount, coins sdk.Coins) *PermanentLockedAccount { +func NewPermanentLockedAccount(baseAcc *authtypes.BaseAccount, coins sdk.Coins) (*PermanentLockedAccount, error) { baseVestingAcc := &BaseVestingAccount{ BaseAccount: baseAcc, OriginalVesting: coins, EndTime: 0, // ensure EndTime is set to 0, as PermanentLockedAccount's do not have an EndTime } - return &PermanentLockedAccount{baseVestingAcc} + permanentLockedAccount := &PermanentLockedAccount{baseVestingAcc} + + return permanentLockedAccount, permanentLockedAccount.Validate() } // GetVestedCoins returns the total amount of vested coins for a permanent locked vesting diff --git a/x/auth/vesting/types/vesting_account_test.go b/x/auth/vesting/types/vesting_account_test.go index dd60e2ae21a2..74cdfe59c5a5 100644 --- a/x/auth/vesting/types/vesting_account_test.go +++ b/x/auth/vesting/types/vesting_account_test.go @@ -17,6 +17,7 @@ import ( "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" + authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec" "github.com/cosmos/cosmos-sdk/x/auth/keeper" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/auth/vesting" @@ -58,6 +59,7 @@ func (s *VestingAccountTestSuite) SetupTest() { storeService, authtypes.ProtoBaseAccount, maccPerms, + authcodec.NewBech32Codec("cosmos"), "cosmos", authtypes.NewModuleAddress("gov").String(), ) @@ -68,7 +70,8 @@ func TestGetVestedCoinsContVestingAcc(t *testing.T) { endTime := now.Add(24 * time.Hour) bacc, origCoins := initBaseAccount() - cva := types.NewContinuousVestingAccount(bacc, origCoins, now.Unix(), endTime.Unix()) + cva, err := types.NewContinuousVestingAccount(bacc, origCoins, now.Unix(), endTime.Unix()) + require.NoError(t, err) // require no coins vested in the very beginning of the vesting schedule vestedCoins := cva.GetVestedCoins(now) @@ -92,7 +95,8 @@ func TestGetVestingCoinsContVestingAcc(t *testing.T) { endTime := now.Add(24 * time.Hour) bacc, origCoins := initBaseAccount() - cva := types.NewContinuousVestingAccount(bacc, origCoins, now.Unix(), endTime.Unix()) + cva, err := types.NewContinuousVestingAccount(bacc, origCoins, now.Unix(), endTime.Unix()) + require.NoError(t, err) // require all coins vesting in the beginning of the vesting schedule vestingCoins := cva.GetVestingCoins(now) @@ -112,7 +116,8 @@ func TestSpendableCoinsContVestingAcc(t *testing.T) { endTime := now.Add(24 * time.Hour) bacc, origCoins := initBaseAccount() - cva := types.NewContinuousVestingAccount(bacc, origCoins, now.Unix(), endTime.Unix()) + cva, err := types.NewContinuousVestingAccount(bacc, origCoins, now.Unix(), endTime.Unix()) + require.NoError(t, err) // require that all original coins are locked at the end of the vesting // schedule @@ -135,19 +140,22 @@ func TestTrackDelegationContVestingAcc(t *testing.T) { bacc, origCoins := initBaseAccount() // require the ability to delegate all vesting coins - cva := types.NewContinuousVestingAccount(bacc, origCoins, now.Unix(), endTime.Unix()) + cva, err := types.NewContinuousVestingAccount(bacc, origCoins, now.Unix(), endTime.Unix()) + require.NoError(t, err) cva.TrackDelegation(now, origCoins, origCoins) require.Equal(t, origCoins, cva.DelegatedVesting) require.Nil(t, cva.DelegatedFree) // require the ability to delegate all vested coins - cva = types.NewContinuousVestingAccount(bacc, origCoins, now.Unix(), endTime.Unix()) + cva, err = types.NewContinuousVestingAccount(bacc, origCoins, now.Unix(), endTime.Unix()) + require.NoError(t, err) cva.TrackDelegation(endTime, origCoins, origCoins) require.Nil(t, cva.DelegatedVesting) require.Equal(t, origCoins, cva.DelegatedFree) // require the ability to delegate all vesting coins (50%) and all vested coins (50%) - cva = types.NewContinuousVestingAccount(bacc, origCoins, now.Unix(), endTime.Unix()) + cva, err = types.NewContinuousVestingAccount(bacc, origCoins, now.Unix(), endTime.Unix()) + require.NoError(t, err) cva.TrackDelegation(now.Add(12*time.Hour), origCoins, sdk.Coins{sdk.NewInt64Coin(stakeDenom, 50)}) require.Equal(t, sdk.Coins{sdk.NewInt64Coin(stakeDenom, 50)}, cva.DelegatedVesting) require.Nil(t, cva.DelegatedFree) @@ -157,7 +165,8 @@ func TestTrackDelegationContVestingAcc(t *testing.T) { require.Equal(t, sdk.Coins{sdk.NewInt64Coin(stakeDenom, 50)}, cva.DelegatedFree) // require no modifications when delegation amount is zero or not enough funds - cva = types.NewContinuousVestingAccount(bacc, origCoins, now.Unix(), endTime.Unix()) + cva, err = types.NewContinuousVestingAccount(bacc, origCoins, now.Unix(), endTime.Unix()) + require.NoError(t, err) require.Panics(t, func() { cva.TrackDelegation(endTime, origCoins, sdk.Coins{sdk.NewInt64Coin(stakeDenom, 1000000)}) }) @@ -172,23 +181,24 @@ func TestTrackUndelegationContVestingAcc(t *testing.T) { bacc, origCoins := initBaseAccount() // require the ability to undelegate all vesting coins - cva := types.NewContinuousVestingAccount(bacc, origCoins, now.Unix(), endTime.Unix()) + cva, err := types.NewContinuousVestingAccount(bacc, origCoins, now.Unix(), endTime.Unix()) + require.NoError(t, err) cva.TrackDelegation(now, origCoins, origCoins) cva.TrackUndelegation(origCoins) require.Nil(t, cva.DelegatedFree) require.Equal(t, emptyCoins, cva.DelegatedVesting) // require the ability to undelegate all vested coins - cva = types.NewContinuousVestingAccount(bacc, origCoins, now.Unix(), endTime.Unix()) - + cva, err = types.NewContinuousVestingAccount(bacc, origCoins, now.Unix(), endTime.Unix()) + require.NoError(t, err) cva.TrackDelegation(endTime, origCoins, origCoins) cva.TrackUndelegation(origCoins) require.Equal(t, emptyCoins, cva.DelegatedFree) require.Nil(t, cva.DelegatedVesting) // require no modifications when the undelegation amount is zero - cva = types.NewContinuousVestingAccount(bacc, origCoins, now.Unix(), endTime.Unix()) - + cva, err = types.NewContinuousVestingAccount(bacc, origCoins, now.Unix(), endTime.Unix()) + require.NoError(t, err) require.Panics(t, func() { cva.TrackUndelegation(sdk.Coins{sdk.NewInt64Coin(stakeDenom, 0)}) }) @@ -196,7 +206,8 @@ func TestTrackUndelegationContVestingAcc(t *testing.T) { require.Nil(t, cva.DelegatedVesting) // vest 50% and delegate to two validators - cva = types.NewContinuousVestingAccount(bacc, origCoins, now.Unix(), endTime.Unix()) + cva, err = types.NewContinuousVestingAccount(bacc, origCoins, now.Unix(), endTime.Unix()) + require.NoError(t, err) cva.TrackDelegation(now.Add(12*time.Hour), origCoins, sdk.Coins{sdk.NewInt64Coin(stakeDenom, 50)}) cva.TrackDelegation(now.Add(12*time.Hour), origCoins, sdk.Coins{sdk.NewInt64Coin(stakeDenom, 50)}) @@ -218,7 +229,8 @@ func TestGetVestedCoinsDelVestingAcc(t *testing.T) { bacc, origCoins := initBaseAccount() // require no coins are vested until schedule maturation - dva := types.NewDelayedVestingAccount(bacc, origCoins, endTime.Unix()) + dva, err := types.NewDelayedVestingAccount(bacc, origCoins, endTime.Unix()) + require.NoError(t, err) vestedCoins := dva.GetVestedCoins(now) require.Nil(t, vestedCoins) @@ -234,7 +246,8 @@ func TestGetVestingCoinsDelVestingAcc(t *testing.T) { bacc, origCoins := initBaseAccount() // require all coins vesting at the beginning of the schedule - dva := types.NewDelayedVestingAccount(bacc, origCoins, endTime.Unix()) + dva, err := types.NewDelayedVestingAccount(bacc, origCoins, endTime.Unix()) + require.NoError(t, err) vestingCoins := dva.GetVestingCoins(now) require.Equal(t, origCoins, vestingCoins) @@ -251,7 +264,8 @@ func TestSpendableCoinsDelVestingAcc(t *testing.T) { // require that all coins are locked in the beginning of the vesting // schedule - dva := types.NewDelayedVestingAccount(bacc, origCoins, endTime.Unix()) + dva, err := types.NewDelayedVestingAccount(bacc, origCoins, endTime.Unix()) + require.NoError(t, err) lockedCoins := dva.LockedCoins(now) require.True(t, lockedCoins.Equal(origCoins)) @@ -279,27 +293,30 @@ func TestTrackDelegationDelVestingAcc(t *testing.T) { bacc, origCoins := initBaseAccount() // require the ability to delegate all vesting coins - dva := types.NewDelayedVestingAccount(bacc, origCoins, endTime.Unix()) + dva, err := types.NewDelayedVestingAccount(bacc, origCoins, endTime.Unix()) + require.NoError(t, err) dva.TrackDelegation(now, origCoins, origCoins) require.Equal(t, origCoins, dva.DelegatedVesting) require.Nil(t, dva.DelegatedFree) // require the ability to delegate all vested coins - dva = types.NewDelayedVestingAccount(bacc, origCoins, endTime.Unix()) + dva, err = types.NewDelayedVestingAccount(bacc, origCoins, endTime.Unix()) + require.NoError(t, err) dva.TrackDelegation(endTime, origCoins, origCoins) require.Nil(t, dva.DelegatedVesting) require.Equal(t, origCoins, dva.DelegatedFree) // require the ability to delegate all coins half way through the vesting // schedule - dva = types.NewDelayedVestingAccount(bacc, origCoins, endTime.Unix()) + dva, err = types.NewDelayedVestingAccount(bacc, origCoins, endTime.Unix()) + require.NoError(t, err) dva.TrackDelegation(now.Add(12*time.Hour), origCoins, origCoins) require.Equal(t, origCoins, dva.DelegatedVesting) require.Nil(t, dva.DelegatedFree) // require no modifications when delegation amount is zero or not enough funds - dva = types.NewDelayedVestingAccount(bacc, origCoins, endTime.Unix()) - + dva, err = types.NewDelayedVestingAccount(bacc, origCoins, endTime.Unix()) + require.NoError(t, err) require.Panics(t, func() { dva.TrackDelegation(endTime, origCoins, sdk.Coins{sdk.NewInt64Coin(stakeDenom, 1000000)}) }) @@ -314,22 +331,24 @@ func TestTrackUndelegationDelVestingAcc(t *testing.T) { bacc, origCoins := initBaseAccount() // require the ability to undelegate all vesting coins - dva := types.NewDelayedVestingAccount(bacc, origCoins, endTime.Unix()) + dva, err := types.NewDelayedVestingAccount(bacc, origCoins, endTime.Unix()) + require.NoError(t, err) dva.TrackDelegation(now, origCoins, origCoins) dva.TrackUndelegation(origCoins) require.Nil(t, dva.DelegatedFree) require.Equal(t, emptyCoins, dva.DelegatedVesting) // require the ability to undelegate all vested coins - dva = types.NewDelayedVestingAccount(bacc, origCoins, endTime.Unix()) + dva, err = types.NewDelayedVestingAccount(bacc, origCoins, endTime.Unix()) + require.NoError(t, err) dva.TrackDelegation(endTime, origCoins, origCoins) dva.TrackUndelegation(origCoins) require.Equal(t, emptyCoins, dva.DelegatedFree) require.Nil(t, dva.DelegatedVesting) // require no modifications when the undelegation amount is zero - dva = types.NewDelayedVestingAccount(bacc, origCoins, endTime.Unix()) - + dva, err = types.NewDelayedVestingAccount(bacc, origCoins, endTime.Unix()) + require.NoError(t, err) require.Panics(t, func() { dva.TrackUndelegation(sdk.Coins{sdk.NewInt64Coin(stakeDenom, 0)}) }) @@ -337,7 +356,8 @@ func TestTrackUndelegationDelVestingAcc(t *testing.T) { require.Nil(t, dva.DelegatedVesting) // vest 50% and delegate to two validators - dva = types.NewDelayedVestingAccount(bacc, origCoins, endTime.Unix()) + dva, err = types.NewDelayedVestingAccount(bacc, origCoins, endTime.Unix()) + require.NoError(t, err) dva.TrackDelegation(now.Add(12*time.Hour), origCoins, sdk.Coins{sdk.NewInt64Coin(stakeDenom, 50)}) dva.TrackDelegation(now.Add(12*time.Hour), origCoins, sdk.Coins{sdk.NewInt64Coin(stakeDenom, 50)}) @@ -363,7 +383,8 @@ func TestGetVestedCoinsPeriodicVestingAcc(t *testing.T) { } bacc, origCoins := initBaseAccount() - pva := types.NewPeriodicVestingAccount(bacc, origCoins, now.Unix(), periods) + pva, err := types.NewPeriodicVestingAccount(bacc, origCoins, now.Unix(), periods) + require.NoError(t, err) // require no coins vested at the beginning of the vesting schedule vestedCoins := pva.GetVestedCoins(now) @@ -397,6 +418,57 @@ func TestGetVestedCoinsPeriodicVestingAcc(t *testing.T) { require.Equal(t, origCoins, vestedCoins) } +func TestOverflowAndNegativeVestedCoinsPeriods(t *testing.T) { + now := tmtime.Now() + tests := []struct { + name string + periods []types.Period + wantErr string + }{ + { + "negative .Length", + types.Periods{ + types.Period{Length: -1, Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 500), sdk.NewInt64Coin(stakeDenom, 50)}}, + types.Period{Length: 6 * 60 * 60, Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}}, + }, + "period #0 has a negative length: -1", + }, + { + "overflow after .Length additions", + types.Periods{ + types.Period{Length: 9223372036854775108, Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 500), sdk.NewInt64Coin(stakeDenom, 50)}}, + types.Period{Length: 6 * 60 * 60, Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}}, + }, + "vesting start-time cannot be before end-time", // it overflow to a negative number, making start-time > end-time + }, + { + "good periods that are not negative nor overflow", + types.Periods{ + types.Period{Length: now.Unix() - 1000, Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 500), sdk.NewInt64Coin(stakeDenom, 50)}}, + types.Period{Length: 60, Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}}, + types.Period{Length: 30, Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}}, + }, + "", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + bacc, origCoins := initBaseAccount() + pva, err := types.NewPeriodicVestingAccount(bacc, origCoins, now.Unix(), tt.periods) + if tt.wantErr != "" { + require.ErrorContains(t, err, tt.wantErr) + return + } + + require.NoError(t, err) + if pbva := pva.BaseVestingAccount; pbva.EndTime < 0 { + t.Fatalf("Unfortunately we still have negative .EndTime :-(: %d", pbva.EndTime) + } + }) + } +} + func TestGetVestingCoinsPeriodicVestingAcc(t *testing.T) { now := tmtime.Now() endTime := now.Add(24 * time.Hour) @@ -407,7 +479,8 @@ func TestGetVestingCoinsPeriodicVestingAcc(t *testing.T) { } bacc, origCoins := initBaseAccount() - pva := types.NewPeriodicVestingAccount(bacc, origCoins, now.Unix(), periods) + pva, err := types.NewPeriodicVestingAccount(bacc, origCoins, now.Unix(), periods) + require.NoError(t, err) // require all coins vesting at the beginning of the vesting schedule vestingCoins := pva.GetVestingCoins(now) @@ -444,7 +517,8 @@ func TestSpendableCoinsPeriodicVestingAcc(t *testing.T) { } bacc, origCoins := initBaseAccount() - pva := types.NewPeriodicVestingAccount(bacc, origCoins, now.Unix(), periods) + pva, err := types.NewPeriodicVestingAccount(bacc, origCoins, now.Unix(), periods) + require.NoError(t, err) // require that there exist no spendable coins at the beginning of the // vesting schedule @@ -473,33 +547,38 @@ func TestTrackDelegationPeriodicVestingAcc(t *testing.T) { bacc, origCoins := initBaseAccount() // require the ability to delegate all vesting coins - pva := types.NewPeriodicVestingAccount(bacc, origCoins, now.Unix(), periods) + pva, err := types.NewPeriodicVestingAccount(bacc, origCoins, now.Unix(), periods) + require.NoError(t, err) pva.TrackDelegation(now, origCoins, origCoins) require.Equal(t, origCoins, pva.DelegatedVesting) require.Nil(t, pva.DelegatedFree) // require the ability to delegate all vested coins - pva = types.NewPeriodicVestingAccount(bacc, origCoins, now.Unix(), periods) + pva, err = types.NewPeriodicVestingAccount(bacc, origCoins, now.Unix(), periods) + require.NoError(t, err) pva.TrackDelegation(endTime, origCoins, origCoins) require.Nil(t, pva.DelegatedVesting) require.Equal(t, origCoins, pva.DelegatedFree) // delegate half of vesting coins - pva = types.NewPeriodicVestingAccount(bacc, origCoins, now.Unix(), periods) + pva, err = types.NewPeriodicVestingAccount(bacc, origCoins, now.Unix(), periods) + require.NoError(t, err) pva.TrackDelegation(now, origCoins, periods[0].Amount) // require that all delegated coins are delegated vesting require.Equal(t, pva.DelegatedVesting, periods[0].Amount) require.Nil(t, pva.DelegatedFree) // delegate 75% of coins, split between vested and vesting - pva = types.NewPeriodicVestingAccount(bacc, origCoins, now.Unix(), periods) + pva, err = types.NewPeriodicVestingAccount(bacc, origCoins, now.Unix(), periods) + require.NoError(t, err) pva.TrackDelegation(now.Add(12*time.Hour), origCoins, periods[0].Amount.Add(periods[1].Amount...)) // require that the maximum possible amount of vesting coins are chosen for delegation. require.Equal(t, pva.DelegatedFree, periods[1].Amount) require.Equal(t, pva.DelegatedVesting, periods[0].Amount) // require the ability to delegate all vesting coins (50%) and all vested coins (50%) - pva = types.NewPeriodicVestingAccount(bacc, origCoins, now.Unix(), periods) + pva, err = types.NewPeriodicVestingAccount(bacc, origCoins, now.Unix(), periods) + require.NoError(t, err) pva.TrackDelegation(now.Add(12*time.Hour), origCoins, sdk.Coins{sdk.NewInt64Coin(stakeDenom, 50)}) require.Equal(t, sdk.Coins{sdk.NewInt64Coin(stakeDenom, 50)}, pva.DelegatedVesting) require.Nil(t, pva.DelegatedFree) @@ -509,7 +588,8 @@ func TestTrackDelegationPeriodicVestingAcc(t *testing.T) { require.Equal(t, sdk.Coins{sdk.NewInt64Coin(stakeDenom, 50)}, pva.DelegatedFree) // require no modifications when delegation amount is zero or not enough funds - pva = types.NewPeriodicVestingAccount(bacc, origCoins, now.Unix(), periods) + pva, err = types.NewPeriodicVestingAccount(bacc, origCoins, now.Unix(), periods) + require.NoError(t, err) require.Panics(t, func() { pva.TrackDelegation(endTime, origCoins, sdk.Coins{sdk.NewInt64Coin(stakeDenom, 1000000)}) }) @@ -529,30 +609,32 @@ func TestTrackUndelegationPeriodicVestingAcc(t *testing.T) { bacc, origCoins := initBaseAccount() // require the ability to undelegate all vesting coins at the beginning of vesting - pva := types.NewPeriodicVestingAccount(bacc, origCoins, now.Unix(), periods) + pva, err := types.NewPeriodicVestingAccount(bacc, origCoins, now.Unix(), periods) + require.NoError(t, err) pva.TrackDelegation(now, origCoins, origCoins) pva.TrackUndelegation(origCoins) require.Nil(t, pva.DelegatedFree) require.Equal(t, emptyCoins, pva.DelegatedVesting) // require the ability to undelegate all vested coins at the end of vesting - pva = types.NewPeriodicVestingAccount(bacc, origCoins, now.Unix(), periods) - + pva, err = types.NewPeriodicVestingAccount(bacc, origCoins, now.Unix(), periods) + require.NoError(t, err) pva.TrackDelegation(endTime, origCoins, origCoins) pva.TrackUndelegation(origCoins) require.Equal(t, emptyCoins, pva.DelegatedFree) require.Nil(t, pva.DelegatedVesting) // require the ability to undelegate half of coins - pva = types.NewPeriodicVestingAccount(bacc, origCoins, now.Unix(), periods) + pva, err = types.NewPeriodicVestingAccount(bacc, origCoins, now.Unix(), periods) + require.NoError(t, err) pva.TrackDelegation(endTime, origCoins, periods[0].Amount) pva.TrackUndelegation(periods[0].Amount) require.Equal(t, emptyCoins, pva.DelegatedFree) require.Nil(t, pva.DelegatedVesting) // require no modifications when the undelegation amount is zero - pva = types.NewPeriodicVestingAccount(bacc, origCoins, now.Unix(), periods) - + pva, err = types.NewPeriodicVestingAccount(bacc, origCoins, now.Unix(), periods) + require.NoError(t, err) require.Panics(t, func() { pva.TrackUndelegation(sdk.Coins{sdk.NewInt64Coin(stakeDenom, 0)}) }) @@ -560,7 +642,8 @@ func TestTrackUndelegationPeriodicVestingAcc(t *testing.T) { require.Nil(t, pva.DelegatedVesting) // vest 50% and delegate to two validators - pva = types.NewPeriodicVestingAccount(bacc, origCoins, now.Unix(), periods) + pva, err = types.NewPeriodicVestingAccount(bacc, origCoins, now.Unix(), periods) + require.NoError(t, err) pva.TrackDelegation(now.Add(12*time.Hour), origCoins, sdk.Coins{sdk.NewInt64Coin(stakeDenom, 50)}) pva.TrackDelegation(now.Add(12*time.Hour), origCoins, sdk.Coins{sdk.NewInt64Coin(stakeDenom, 50)}) @@ -582,7 +665,8 @@ func TestGetVestedCoinsPermLockedVestingAcc(t *testing.T) { bacc, origCoins := initBaseAccount() // require no coins are vested - plva := types.NewPermanentLockedAccount(bacc, origCoins) + plva, err := types.NewPermanentLockedAccount(bacc, origCoins) + require.NoError(t, err) vestedCoins := plva.GetVestedCoins(now) require.Nil(t, vestedCoins) @@ -598,7 +682,8 @@ func TestGetVestingCoinsPermLockedVestingAcc(t *testing.T) { bacc, origCoins := initBaseAccount() // require all coins vesting at the beginning of the schedule - plva := types.NewPermanentLockedAccount(bacc, origCoins) + plva, err := types.NewPermanentLockedAccount(bacc, origCoins) + require.NoError(t, err) vestingCoins := plva.GetVestingCoins(now) require.Equal(t, origCoins, vestingCoins) @@ -615,7 +700,8 @@ func TestSpendableCoinsPermLockedVestingAcc(t *testing.T) { // require that all coins are locked in the beginning of the vesting // schedule - plva := types.NewPermanentLockedAccount(bacc, origCoins) + plva, err := types.NewPermanentLockedAccount(bacc, origCoins) + require.NoError(t, err) lockedCoins := plva.LockedCoins(now) require.True(t, lockedCoins.Equal(origCoins)) @@ -638,20 +724,22 @@ func TestTrackDelegationPermLockedVestingAcc(t *testing.T) { bacc, origCoins := initBaseAccount() // require the ability to delegate all vesting coins - plva := types.NewPermanentLockedAccount(bacc, origCoins) + plva, err := types.NewPermanentLockedAccount(bacc, origCoins) + require.NoError(t, err) plva.TrackDelegation(now, origCoins, origCoins) require.Equal(t, origCoins, plva.DelegatedVesting) require.Nil(t, plva.DelegatedFree) // require the ability to delegate all vested coins at endTime - plva = types.NewPermanentLockedAccount(bacc, origCoins) + plva, err = types.NewPermanentLockedAccount(bacc, origCoins) + require.NoError(t, err) plva.TrackDelegation(endTime, origCoins, origCoins) require.Equal(t, origCoins, plva.DelegatedVesting) require.Nil(t, plva.DelegatedFree) // require no modifications when delegation amount is zero or not enough funds - plva = types.NewPermanentLockedAccount(bacc, origCoins) - + plva, err = types.NewPermanentLockedAccount(bacc, origCoins) + require.NoError(t, err) require.Panics(t, func() { plva.TrackDelegation(endTime, origCoins, sdk.Coins{sdk.NewInt64Coin(stakeDenom, 1000000)}) }) @@ -666,21 +754,24 @@ func TestTrackUndelegationPermLockedVestingAcc(t *testing.T) { bacc, origCoins := initBaseAccount() // require the ability to undelegate all vesting coins - plva := types.NewPermanentLockedAccount(bacc, origCoins) + plva, err := types.NewPermanentLockedAccount(bacc, origCoins) + require.NoError(t, err) plva.TrackDelegation(now, origCoins, origCoins) plva.TrackUndelegation(origCoins) require.Nil(t, plva.DelegatedFree) require.Equal(t, emptyCoins, plva.DelegatedVesting) // require the ability to undelegate all vesting coins at endTime - plva = types.NewPermanentLockedAccount(bacc, origCoins) + plva, err = types.NewPermanentLockedAccount(bacc, origCoins) + require.NoError(t, err) plva.TrackDelegation(endTime, origCoins, origCoins) plva.TrackUndelegation(origCoins) require.Nil(t, plva.DelegatedFree) require.Equal(t, emptyCoins, plva.DelegatedVesting) // require no modifications when the undelegation amount is zero - plva = types.NewPermanentLockedAccount(bacc, origCoins) + plva, err = types.NewPermanentLockedAccount(bacc, origCoins) + require.NoError(t, err) require.Panics(t, func() { plva.TrackUndelegation(sdk.Coins{sdk.NewInt64Coin(stakeDenom, 0)}) }) @@ -688,7 +779,8 @@ func TestTrackUndelegationPermLockedVestingAcc(t *testing.T) { require.Nil(t, plva.DelegatedVesting) // delegate to two validators - plva = types.NewPermanentLockedAccount(bacc, origCoins) + plva, err = types.NewPermanentLockedAccount(bacc, origCoins) + require.NoError(t, err) plva.TrackDelegation(now, origCoins, sdk.Coins{sdk.NewInt64Coin(stakeDenom, 50)}) plva.TrackDelegation(now, origCoins, sdk.Coins{sdk.NewInt64Coin(stakeDenom, 50)}) @@ -709,7 +801,8 @@ func TestGenesisAccountValidate(t *testing.T) { addr := sdk.AccAddress(pubkey.Address()) baseAcc := authtypes.NewBaseAccount(addr, pubkey, 0, 0) initialVesting := sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 50)) - baseVestingWithCoins := types.NewBaseVestingAccount(baseAcc, initialVesting, 100) + baseVestingWithCoins, err := types.NewBaseVestingAccount(baseAcc, initialVesting, 100) + require.NoError(t, err) tests := []struct { name string acc authtypes.GenesisAccount @@ -732,17 +825,26 @@ func TestGenesisAccountValidate(t *testing.T) { }, { "valid continuous vesting account", - types.NewContinuousVestingAccount(baseAcc, initialVesting, 100, 200), + func() authtypes.GenesisAccount { + acc, _ := types.NewContinuousVestingAccount(baseAcc, initialVesting, 100, 200) + return acc + }(), false, }, { "invalid vesting times", - types.NewContinuousVestingAccount(baseAcc, initialVesting, 1654668078, 1554668078), + func() authtypes.GenesisAccount { + acc, _ := types.NewContinuousVestingAccount(baseAcc, initialVesting, 1654668078, 1554668078) + return acc + }(), true, }, { "valid periodic vesting account", - types.NewPeriodicVestingAccount(baseAcc, initialVesting, 0, types.Periods{types.Period{Length: int64(100), Amount: sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 50)}}}), + func() authtypes.GenesisAccount { + acc, _ := types.NewPeriodicVestingAccount(baseAcc, initialVesting, 0, types.Periods{types.Period{Length: int64(100), Amount: sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 50)}}}) + return acc + }(), false, }, { @@ -761,7 +863,10 @@ func TestGenesisAccountValidate(t *testing.T) { }, { "valid permanent locked vesting account", - types.NewPermanentLockedAccount(baseAcc, initialVesting), + func() authtypes.GenesisAccount { + acc, _ := types.NewPermanentLockedAccount(baseAcc, initialVesting) + return acc + }(), false, }, { diff --git a/x/authz/README.md b/x/authz/README.md index 2ab2dcba7c74..c58326aa21ee 100644 --- a/x/authz/README.md +++ b/x/authz/README.md @@ -82,7 +82,7 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/bank/types/send_authoriz #### StakeAuthorization -`StakeAuthorization` implements the `Authorization` interface for messages in the [staking module](https://docs.cosmos.network/v0.44/modules/staking/). It takes an `AuthorizationType` to specify whether you want to authorise delegating, undelegating or redelegating (i.e. these have to be authorised seperately). It also takes a required `MaxTokens` that keeps track of a limit to the amount of tokens that can be delegated/undelegated/redelegated. If left empty, the amount is unlimited. Additionally, this Msg takes an `AllowList` or a `DenyList`, which allows you to select which validators you allow or deny grantees to stake with. +`StakeAuthorization` implements the `Authorization` interface for messages in the [staking module](https://docs.cosmos.network/v0.50/build/modules/staking). It takes an `AuthorizationType` to specify whether you want to authorise delegating, undelegating or redelegating (i.e. these have to be authorised separately). It also takes an optional `MaxTokens` that keeps track of a limit to the amount of tokens that can be delegated/undelegated/redelegated. If left empty, the amount is unlimited. Additionally, this Msg takes an `AllowList` or a `DenyList`, which allows you to select which validators you allow or deny grantees to stake with. ```protobuf reference https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/staking/v1beta1/authz.proto#L11-L35 @@ -255,11 +255,28 @@ The `grant` command allows a granter to grant an authorization to a grantee. ```bash simd tx authz grant --from [flags] ``` +- The `send` authorization_type refers to the built-in `SendAuthorization` type. The custom flags available are `spend-limit` (required) and `allow-list` (optional) , documented [here](#SendAuthorization) Example: ```bash -simd tx authz grant cosmos1.. send --spend-limit=100stake --from=cosmos1.. + simd tx authz grant cosmos1.. send --spend-limit=100stake --allow-list=cosmos1...,cosmos2... --from=cosmos1.. +``` +- The `generic` authorization_type refers to the built-in `GenericAuthorization` type. The custom flag available is `msg-type` ( required) documented [here](#GenericAuthorization). + +> Note: `msg-type` is any valid Cosmos SDK `Msg` type url. + +Example: +```bash + simd tx authz grant cosmos1.. generic --msg-type=/cosmos.bank.v1beta1.MsgSend --from=cosmos1.. +``` +- The `delegate`,`unbond`,`redelegate` authorization_types refer to the built-in `StakeAuthorization` type. The custom flags available are `spend-limit` (optional), `allowed-validators` (optional) and `deny-validators` (optional) documented [here](#StakeAuthorization). +> Note: `allowed-validators` and `deny-validators` cannot both be empty. `spend-limit` represents the `MaxTokens` + +Example: + +```bash +simd tx authz grant cosmos1.. delegate --spend-limit=100stake --allowed-validators=cosmos...,cosmos... --deny-validators=cosmos... --from=cosmos1.. ``` ##### revoke diff --git a/x/authz/authorization_grant.go b/x/authz/authorization_grant.go index bc331885c930..cb2088316fc0 100644 --- a/x/authz/authorization_grant.go +++ b/x/authz/authorization_grant.go @@ -3,9 +3,10 @@ package authz import ( "time" - errorsmod "cosmossdk.io/errors" proto "github.com/cosmos/gogoproto/proto" + errorsmod "cosmossdk.io/errors" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) diff --git a/x/authz/client/cli/query.go b/x/authz/client/cli/query.go deleted file mode 100644 index 4e244c348aca..000000000000 --- a/x/authz/client/cli/query.go +++ /dev/null @@ -1,194 +0,0 @@ -package cli - -import ( - "fmt" - "strings" - - "cosmossdk.io/core/address" - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/version" - "github.com/cosmos/cosmos-sdk/x/authz" - bank "github.com/cosmos/cosmos-sdk/x/bank/types" -) - -// GetQueryCmd returns the cli query commands for this module -func GetQueryCmd(ac address.Codec) *cobra.Command { - authorizationQueryCmd := &cobra.Command{ - Use: authz.ModuleName, - Short: "Querying commands for the authz module", - Long: "", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - authorizationQueryCmd.AddCommand( - GetCmdQueryGrants(ac), - GetQueryGranterGrants(ac), - GetQueryGranteeGrants(ac), - ) - - return authorizationQueryCmd -} - -// GetCmdQueryGrants implements the query authorization command. -func GetCmdQueryGrants(ac address.Codec) *cobra.Command { - cmd := &cobra.Command{ - Use: "grants [granter-addr] [grantee-addr] [msg-type-url]?", - Args: cobra.RangeArgs(2, 3), - Short: "query grants for a granter-grantee pair and optionally a msg-type-url", - Long: strings.TrimSpace( - fmt.Sprintf(`Query authorization grants for a granter-grantee pair. If msg-type-url -is set, it will select grants only for that msg type. -Examples: -$ %s query %s grants cosmos1skj.. cosmos1skjwj.. -$ %s query %s grants cosmos1skjw.. cosmos1skjwj.. %s -`, - version.AppName, authz.ModuleName, - version.AppName, authz.ModuleName, bank.SendAuthorization{}.MsgTypeURL()), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := authz.NewQueryClient(clientCtx) - - _, err = ac.StringToBytes(args[0]) - if err != nil { - return err - } - _, err = ac.StringToBytes(args[1]) - if err != nil { - return err - } - msgAuthorized := "" - if len(args) >= 3 { - msgAuthorized = args[2] - } - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - res, err := queryClient.Grants( - cmd.Context(), - &authz.QueryGrantsRequest{ - Granter: args[0], - Grantee: args[1], - MsgTypeUrl: msgAuthorized, - Pagination: pageReq, - }, - ) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "grants") - return cmd -} - -// GetQueryGranterGrants returns cmd to query for all grants for a granter. -func GetQueryGranterGrants(ac address.Codec) *cobra.Command { - cmd := &cobra.Command{ - Use: "grants-by-granter [granter-addr]", - Args: cobra.ExactArgs(1), - Short: "query authorization grants granted by granter", - Long: strings.TrimSpace( - fmt.Sprintf(`Query authorization grants granted by granter. -Examples: -$ %s q %s grants-by-granter cosmos1skj.. -`, - version.AppName, authz.ModuleName), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - _, err = ac.StringToBytes(args[0]) - if err != nil { - return err - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - queryClient := authz.NewQueryClient(clientCtx) - res, err := queryClient.GranterGrants( - cmd.Context(), - &authz.QueryGranterGrantsRequest{ - Granter: args[0], - Pagination: pageReq, - }, - ) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "granter-grants") - return cmd -} - -// GetQueryGranteeGrants returns cmd to query for all grants for a grantee. -func GetQueryGranteeGrants(ac address.Codec) *cobra.Command { - cmd := &cobra.Command{ - Use: "grants-by-grantee [grantee-addr]", - Args: cobra.ExactArgs(1), - Short: "query authorization grants granted to a grantee", - Long: strings.TrimSpace( - fmt.Sprintf(`Query authorization grants granted to a grantee. -Examples: -$ %s q %s grants-by-grantee cosmos1skj.. -`, - version.AppName, authz.ModuleName), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - _, err = ac.StringToBytes(args[0]) - if err != nil { - return err - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - queryClient := authz.NewQueryClient(clientCtx) - res, err := queryClient.GranteeGrants( - cmd.Context(), - &authz.QueryGranteeGrantsRequest{ - Grantee: args[0], - Pagination: pageReq, - }, - ) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "grantee-grants") - return cmd -} diff --git a/x/authz/client/cli/query_test.go b/x/authz/client/cli/query_test.go deleted file mode 100644 index 8ee965101e68..000000000000 --- a/x/authz/client/cli/query_test.go +++ /dev/null @@ -1,242 +0,0 @@ -package cli_test - -import ( - "fmt" - "time" - - sdkmath "cosmossdk.io/math" - - "github.com/cosmos/cosmos-sdk/client/flags" - addresscodec "github.com/cosmos/cosmos-sdk/codec/address" - "github.com/cosmos/cosmos-sdk/testutil" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/authz" - "github.com/cosmos/cosmos-sdk/x/authz/client/cli" - authzclitestutil "github.com/cosmos/cosmos-sdk/x/authz/client/testutil" -) - -func (s *CLITestSuite) TestQueryAuthorizations() { - val := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) - - grantee := s.grantee[0] - twoHours := time.Now().Add(time.Minute * time.Duration(120)).Unix() - - _, err := authzclitestutil.CreateGrant( - s.clientCtx, - []string{ - grantee.String(), - "send", - fmt.Sprintf("--%s=100stake", cli.FlagSpendLimit), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%d", cli.FlagExpiration, twoHours), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(10))).String()), - }, - ) - s.Require().NoError(err) - - testCases := []struct { - name string - args []string - expectErr bool - expErrMsg string - }{ - { - "Error: Invalid grantee", - []string{ - val[0].Address.String(), - "invalid grantee", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - "decoding bech32 failed: invalid character in string: ' '", - }, - { - "Error: Invalid granter", - []string{ - "invalid granter", - grantee.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - "decoding bech32 failed: invalid character in string: ' '", - }, - { - "Valid txn (json)", - []string{ - val[0].Address.String(), - grantee.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - ``, - }, - } - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryGrants(addresscodec.NewBech32Codec("cosmos")) - resp, err := clitestutil.ExecTestCLICmd(s.clientCtx, cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - s.Require().Contains(string(resp.Bytes()), tc.expErrMsg) - } else { - s.Require().NoError(err) - var grants authz.QueryGrantsResponse - err = s.clientCtx.Codec.UnmarshalJSON(resp.Bytes(), &grants) - s.Require().NoError(err) - } - }) - } -} - -func (s *CLITestSuite) TestQueryAuthorization() { - val := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) - - grantee := s.grantee[0] - twoHours := time.Now().Add(time.Minute * time.Duration(120)).Unix() - - _, err := authzclitestutil.CreateGrant( - s.clientCtx, - []string{ - grantee.String(), - "send", - fmt.Sprintf("--%s=100stake", cli.FlagSpendLimit), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%d", cli.FlagExpiration, twoHours), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(10))).String()), - }, - ) - s.Require().NoError(err) - - testCases := []struct { - name string - args []string - expectErr bool - }{ - { - "Error: Invalid grantee", - []string{ - val[0].Address.String(), - "invalid grantee", - typeMsgSend, - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - }, - { - "Error: Invalid granter", - []string{ - "invalid granter", - grantee.String(), - typeMsgSend, - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - }, - { - "Valid txn (json)", - []string{ - val[0].Address.String(), - grantee.String(), - typeMsgSend, - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - }, - { - "Valid txn with allowed list (json)", - []string{ - val[0].Address.String(), - s.grantee[3].String(), - typeMsgSend, - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - }, - } - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryGrants(addresscodec.NewBech32Codec("cosmos")) - _, err := clitestutil.ExecTestCLICmd(s.clientCtx, cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - } - }) - } -} - -func (s *CLITestSuite) TestQueryGranterGrants() { - val := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) - - grantee := s.grantee[0] - require := s.Require() - - testCases := []struct { - name string - args []string - expectErr bool - expectedErr string - }{ - { - "invalid address", - []string{ - "invalid-address", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - "decoding bech32 failed", - }, - { - "no authorization found", - []string{ - grantee.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - "", - }, - { - "valid case", - []string{ - val[0].Address.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - "", - }, - { - "valid case with pagination", - []string{ - val[0].Address.String(), - "--limit=2", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - "", - }, - } - for _, tc := range testCases { - s.Run(tc.name, func() { - cmd := cli.GetQueryGranterGrants(addresscodec.NewBech32Codec("cosmos")) - out, err := clitestutil.ExecTestCLICmd(s.clientCtx, cmd, tc.args) - if tc.expectErr { - require.Error(err) - require.Contains(out.String(), tc.expectedErr) - } else { - require.NoError(err) - var grants authz.QueryGranterGrantsResponse - require.NoError(s.clientCtx.Codec.UnmarshalJSON(out.Bytes(), &grants)) - } - }) - } -} diff --git a/x/authz/client/cli/tx.go b/x/authz/client/cli/tx.go index 5f3e5a491aeb..78151eaa3d5c 100644 --- a/x/authz/client/cli/tx.go +++ b/x/authz/client/cli/tx.go @@ -6,9 +6,10 @@ import ( "strings" "time" - "cosmossdk.io/core/address" "github.com/spf13/cobra" + "cosmossdk.io/core/address" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" diff --git a/x/authz/client/cli/tx_test.go b/x/authz/client/cli/tx_test.go index 3124167d28c0..62dd9550689e 100644 --- a/x/authz/client/cli/tx_test.go +++ b/x/authz/client/cli/tx_test.go @@ -11,10 +11,10 @@ import ( "github.com/cosmos/gogoproto/proto" "github.com/stretchr/testify/suite" + _ "cosmossdk.io/api/cosmos/authz/v1beta1" "cosmossdk.io/core/address" sdkmath "cosmossdk.io/math" - _ "cosmossdk.io/api/cosmos/authz/v1beta1" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" addresscodec "github.com/cosmos/cosmos-sdk/codec/address" @@ -179,7 +179,7 @@ func (s *CLITestSuite) msgSendExec(grantee sdk.AccAddress) { s.clientCtx, val[0].Address, grantee, - sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(200))), + sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(200))), s.ac, fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), @@ -229,6 +229,19 @@ func (s *CLITestSuite) TestCLITxGrantAuthorization() { true, "invalid separator index", }, + { + "Invalid spend limit", + []string{ + grantee.String(), + "send", + fmt.Sprintf("--%s=0stake", cli.FlagSpendLimit), + fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address.String()), + fmt.Sprintf("--%s=true", flags.FlagGenerateOnly), + fmt.Sprintf("--%s=%d", cli.FlagExpiration, twoHours), + }, + true, + "spend-limit should be greater than zero", + }, { "Invalid expiration time", []string{ @@ -306,7 +319,7 @@ func (s *CLITestSuite) TestCLITxGrantAuthorization() { "invalid denom", }, { - "invalid bond denon for tx redelegate authorization", + "invalid bond denom for tx redelegate authorization", []string{ grantee.String(), "redelegate", @@ -337,6 +350,15 @@ func (s *CLITestSuite) TestCLITxGrantAuthorization() { true, "invalid decimal coin expression", }, + { + "invalid authorization type", + []string{ + grantee.String(), + "invalid authz type", + }, + true, + "invalid authorization type", + }, { "Valid tx send authorization", []string{ diff --git a/x/authz/expected_keepers.go b/x/authz/expected_keepers.go index 2db295aa7e52..c59837d2fc56 100644 --- a/x/authz/expected_keepers.go +++ b/x/authz/expected_keepers.go @@ -20,4 +20,5 @@ type AccountKeeper interface { type BankKeeper interface { SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins IsSendEnabledCoins(ctx context.Context, coins ...sdk.Coin) error + BlockedAddr(addr sdk.AccAddress) bool } diff --git a/x/authz/generic_authorization.go b/x/authz/generic_authorization.go index 688211a6928d..a7c790e02bf1 100644 --- a/x/authz/generic_authorization.go +++ b/x/authz/generic_authorization.go @@ -1,7 +1,8 @@ package authz import ( - context "context" + "context" + "errors" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -27,5 +28,8 @@ func (a GenericAuthorization) Accept(ctx context.Context, msg sdk.Msg) (AcceptRe // ValidateBasic implements Authorization.ValidateBasic. func (a GenericAuthorization) ValidateBasic() error { + if a.Msg == "" { + return errors.New("msg type cannot be empty") + } return nil } diff --git a/x/authz/genesis.go b/x/authz/genesis.go index d14bbbb18a8c..169684e0734f 100644 --- a/x/authz/genesis.go +++ b/x/authz/genesis.go @@ -1,6 +1,8 @@ package authz import ( + fmt "fmt" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" ) @@ -13,6 +15,15 @@ func NewGenesisState(entries []GrantAuthorization) *GenesisState { // ValidateGenesis check the given genesis state has no integrity issues func ValidateGenesis(data GenesisState) error { + for i, a := range data.Authorization { + if a.Grantee == "" { + return fmt.Errorf("authorization: %d, missing grantee", i) + } + if a.Granter == "" { + return fmt.Errorf("authorization: %d,missing granter", i) + } + + } return nil } diff --git a/x/authz/keeper/genesis.go b/x/authz/keeper/genesis.go index 91c99ac4ba37..08b84b8ed682 100644 --- a/x/authz/keeper/genesis.go +++ b/x/authz/keeper/genesis.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/authz" ) -// InitGenesis new authz genesis +// InitGenesis initializes new authz genesis func (k Keeper) InitGenesis(ctx sdk.Context, data *authz.GenesisState) { now := ctx.BlockTime() for _, entry := range data.Authorization { diff --git a/x/authz/keeper/genesis_test.go b/x/authz/keeper/genesis_test.go index 729d24e43b7b..fe0adcd22c09 100644 --- a/x/authz/keeper/genesis_test.go +++ b/x/authz/keeper/genesis_test.go @@ -4,13 +4,13 @@ import ( "testing" "time" - "cosmossdk.io/log" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/suite" + "go.uber.org/mock/gomock" + "cosmossdk.io/log" sdkmath "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" - "github.com/golang/mock/gomock" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec/address" @@ -83,9 +83,12 @@ func (suite *GenesisTestSuite) TestImportExportGenesis() { // TODO, recheck! // Clear keeper suite.keeper.DeleteGrant(suite.ctx, granteeAddr, granterAddr, grant.MsgTypeURL()) + newGenesis := suite.keeper.ExportGenesis(suite.ctx) + suite.Require().NotEqual(genesis, newGenesis) + suite.Require().Empty(newGenesis) suite.keeper.InitGenesis(suite.ctx, genesis) - newGenesis := suite.keeper.ExportGenesis(suite.ctx) + newGenesis = suite.keeper.ExportGenesis(suite.ctx) suite.Require().Equal(genesis, newGenesis) } diff --git a/x/authz/keeper/grpc_query_test.go b/x/authz/keeper/grpc_query_test.go index 1a26e170c586..00d16f96381a 100644 --- a/x/authz/keeper/grpc_query_test.go +++ b/x/authz/keeper/grpc_query_test.go @@ -57,7 +57,19 @@ func (suite *TestSuite) TestGRPCQueryAuthorization() { func(require *require.Assertions, res *authz.QueryGrantsResponse) {}, }, { - "Success", + "authorization not found", + func(require *require.Assertions) { + req = &authz.QueryGrantsRequest{ + Granter: addrs[1].String(), + Grantee: addrs[0].String(), + MsgTypeUrl: banktypes.SendAuthorization{}.MsgTypeURL(), + } + }, + "authorization not found for /cosmos.bank.v1beta1.MsgSend", + func(require *require.Assertions, res *authz.QueryGrantsResponse) {}, + }, + { + "success", func(require *require.Assertions) { expAuthorization = suite.createSendAuthorization(addrs[0], addrs[1]) req = &authz.QueryGrantsRequest{ @@ -76,6 +88,28 @@ func (suite *TestSuite) TestGRPCQueryAuthorization() { require.Equal(auth.String(), expAuthorization.String()) }, }, + { + "success with allow list", + func(require *require.Assertions) { + expAuthorization = suite.createSendAuthorizationWithAllowList(addrs[0], addrs[1]) + require.Len(expAuthorization.(*banktypes.SendAuthorization).GetAllowList(), 1) + req = &authz.QueryGrantsRequest{ + Granter: addrs[1].String(), + Grantee: addrs[0].String(), + MsgTypeUrl: expAuthorization.MsgTypeURL(), + } + }, + "", + func(require *require.Assertions, res *authz.QueryGrantsResponse) { + var auth authz.Authorization + require.Equal(1, len(res.Grants)) + err := suite.encCfg.InterfaceRegistry.UnpackAny(res.Grants[0].Authorization, &auth) + require.NoError(err) + require.NotNil(auth) + require.Equal(auth.String(), expAuthorization.String()) + require.Equal(auth.(*banktypes.SendAuthorization).GetAllowList(), expAuthorization.(*banktypes.SendAuthorization).GetAllowList()) + }, + }, } for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { @@ -93,70 +127,6 @@ func (suite *TestSuite) TestGRPCQueryAuthorization() { } } -func (suite *TestSuite) TestGRPCQueryAuthorizations() { - queryClient, addrs := suite.queryClient, suite.addrs - var ( - req *authz.QueryGrantsRequest - expAuthorization authz.Authorization - ) - testCases := []struct { - msg string - malleate func() - expPass bool - postTest func(res *authz.QueryGrantsResponse) - }{ - { - "fail invalid granter addr", - func() { - req = &authz.QueryGrantsRequest{} - }, - false, - func(res *authz.QueryGrantsResponse) {}, - }, - { - "fail invalid grantee addr", - func() { - req = &authz.QueryGrantsRequest{ - Granter: addrs[0].String(), - } - }, - false, - func(res *authz.QueryGrantsResponse) {}, - }, - { - "Success", - func() { - expAuthorization = suite.createSendAuthorization(addrs[0], addrs[1]) - req = &authz.QueryGrantsRequest{ - Granter: addrs[1].String(), - Grantee: addrs[0].String(), - } - }, - true, - func(res *authz.QueryGrantsResponse) { - var auth authz.Authorization - suite.Require().Equal(1, len(res.Grants)) - err := suite.encCfg.InterfaceRegistry.UnpackAny(res.Grants[0].Authorization, &auth) - suite.Require().NoError(err) - suite.Require().NotNil(auth) - suite.Require().Equal(auth.String(), expAuthorization.String()) - }, - }, - } - for _, testCase := range testCases { - suite.Run(fmt.Sprintf("Case %s", testCase.msg), func() { - testCase.malleate() - result, err := queryClient.Grants(gocontext.Background(), req) - if testCase.expPass { - suite.Require().NoError(err) - } else { - suite.Require().Error(err) - } - testCase.postTest(result) - }) - } -} - func (suite *TestSuite) TestGRPCQueryGranterGrants() { require := suite.Require() queryClient, addrs := suite.queryClient, suite.addrs @@ -312,3 +282,12 @@ func (suite *TestSuite) createSendAuthorization(grantee, granter sdk.AccAddress) suite.Require().NoError(err) return authorization } + +func (suite *TestSuite) createSendAuthorizationWithAllowList(grantee, granter sdk.AccAddress) authz.Authorization { + exp := suite.ctx.BlockHeader().Time.Add(time.Hour) + newCoins := sdk.NewCoins(sdk.NewInt64Coin("steak", 100)) + authorization := &banktypes.SendAuthorization{SpendLimit: newCoins, AllowList: []string{suite.addrs[5].String()}} + err := suite.authzKeeper.SaveGrant(suite.ctx, grantee, granter, authorization, &exp) + suite.Require().NoError(err) + return authorization +} diff --git a/x/authz/keeper/keeper.go b/x/authz/keeper/keeper.go index 8c1a11ec4851..974c18000e42 100644 --- a/x/authz/keeper/keeper.go +++ b/x/authz/keeper/keeper.go @@ -7,12 +7,12 @@ import ( "strconv" "time" - "cosmossdk.io/log" abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/gogoproto/proto" corestoretypes "cosmossdk.io/core/store" errorsmod "cosmossdk.io/errors" + "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/baseapp" @@ -34,6 +34,7 @@ type Keeper struct { cdc codec.Codec router baseapp.MessageRouter authKeeper authz.AccountKeeper + bankKeeper authz.BankKeeper } // NewKeeper constructs a message authorization Keeper @@ -46,6 +47,13 @@ func NewKeeper(storeService corestoretypes.KVStoreService, cdc codec.Codec, rout } } +// Super ugly hack to not be breaking in v0.50 and v0.47 +// DO NOT USE. +func (k Keeper) SetBankKeeper(bk authz.BankKeeper) Keeper { + k.bankKeeper = bk + return k +} + // Logger returns a module-specific logger. func (k Keeper) Logger(ctx context.Context) log.Logger { sdkCtx := sdk.UnwrapSDKContext(ctx) @@ -118,7 +126,8 @@ func (k Keeper) DispatchActions(ctx context.Context, grantee sdk.AccAddress, msg grant, found := k.getGrant(ctx, skey) if !found { - return nil, errorsmod.Wrapf(authz.ErrNoAuthorizationFound, "failed to update grant with key %s", string(skey)) + return nil, errorsmod.Wrapf(authz.ErrNoAuthorizationFound, + "failed to get grant with given granter: %s, grantee: %s & msgType: %s ", sdk.AccAddress(granter), grantee, sdk.MsgTypeURL(msg)) } if grant.Expiration != nil && grant.Expiration.Before(now) { @@ -263,9 +272,9 @@ func (k Keeper) GetAuthorizations(ctx context.Context, grantee, granter sdk.AccA iter := storetypes.KVStorePrefixIterator(store, key) defer iter.Close() - var authorization authz.Grant var authorizations []authz.Authorization for ; iter.Valid(); iter.Next() { + var authorization authz.Grant if err := k.cdc.Unmarshal(iter.Value(), &authorization); err != nil { return nil, err } diff --git a/x/authz/keeper/keeper_test.go b/x/authz/keeper/keeper_test.go index 165a47d48825..b760a85bdfb2 100644 --- a/x/authz/keeper/keeper_test.go +++ b/x/authz/keeper/keeper_test.go @@ -6,8 +6,8 @@ import ( cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" cmttime "github.com/cometbft/cometbft/types/time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" + "go.uber.org/mock/gomock" "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" @@ -68,14 +68,14 @@ func (s *TestSuite) SetupTest() { // gomock initializations ctrl := gomock.NewController(s.T()) s.accountKeeper = authztestutil.NewMockAccountKeeper(ctrl) - s.accountKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec("cosmos")).AnyTimes() s.bankKeeper = authztestutil.NewMockBankKeeper(ctrl) banktypes.RegisterInterfaces(s.encCfg.InterfaceRegistry) banktypes.RegisterMsgServer(s.baseApp.MsgServiceRouter(), s.bankKeeper) + s.bankKeeper.EXPECT().BlockedAddr(gomock.Any()).Return(false).AnyTimes() - s.authzKeeper = authzkeeper.NewKeeper(storeService, s.encCfg.Codec, s.baseApp.MsgServiceRouter(), s.accountKeeper) + s.authzKeeper = authzkeeper.NewKeeper(storeService, s.encCfg.Codec, s.baseApp.MsgServiceRouter(), s.accountKeeper).SetBankKeeper(s.bankKeeper) queryHelper := baseapp.NewQueryServerTestHelper(s.ctx, s.encCfg.InterfaceRegistry) authz.RegisterQueryServer(queryHelper, s.authzKeeper) @@ -478,6 +478,27 @@ func (s *TestSuite) TestGetAuthorization() { } } +func (s *TestSuite) TestGetAuthorizations() { + require := s.Require() + addr1 := s.addrs[1] + addr2 := s.addrs[2] + + genAuthMulti := authz.NewGenericAuthorization(sdk.MsgTypeURL(&banktypes.MsgMultiSend{})) + genAuthSend := authz.NewGenericAuthorization(sdk.MsgTypeURL(&banktypes.MsgSend{})) + + start := s.ctx.BlockHeader().Time + expired := start.Add(time.Duration(1) * time.Second) + + s.Require().NoError(s.authzKeeper.SaveGrant(s.ctx, addr1, addr2, genAuthMulti, &expired), "creating multi send grant 1->2") + s.Require().NoError(s.authzKeeper.SaveGrant(s.ctx, addr1, addr2, genAuthSend, &expired), "creating send grant 1->2") + + authzs, err := s.authzKeeper.GetAuthorizations(s.ctx, addr1, addr2) + require.NoError(err) + require.Len(authzs, 2) + require.Equal(sdk.MsgTypeURL(&banktypes.MsgMultiSend{}), authzs[0].MsgTypeURL()) + require.Equal(sdk.MsgTypeURL(&banktypes.MsgSend{}), authzs[1].MsgTypeURL()) +} + func TestTestSuite(t *testing.T) { suite.Run(t, new(TestSuite)) } diff --git a/x/authz/keeper/msg_server.go b/x/authz/keeper/msg_server.go index 8f5b0cb79373..98e24a44f2a2 100644 --- a/x/authz/keeper/msg_server.go +++ b/x/authz/keeper/msg_server.go @@ -6,6 +6,7 @@ import ( "strings" errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/authz" @@ -37,6 +38,10 @@ func (k Keeper) Grant(goCtx context.Context, msg *authz.MsgGrant) (*authz.MsgGra ctx := sdk.UnwrapSDKContext(goCtx) granteeAcc := k.authKeeper.GetAccount(ctx, grantee) if granteeAcc == nil { + if k.bankKeeper.BlockedAddr(grantee) { + return nil, sdkerrors.ErrUnauthorized.Wrapf("%s is not allowed to receive funds", grantee) + } + granteeAcc = k.authKeeper.NewAccountWithAddress(ctx, grantee) k.authKeeper.SetAccount(ctx, granteeAcc) } diff --git a/x/authz/keeper/msg_server_test.go b/x/authz/keeper/msg_server_test.go index 96e65fed4a53..ad843525c7b6 100644 --- a/x/authz/keeper/msg_server_test.go +++ b/x/authz/keeper/msg_server_test.go @@ -3,6 +3,8 @@ package keeper_test import ( "time" + "go.uber.org/mock/gomock" + sdkmath "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/codec/address" @@ -11,8 +13,6 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/authz" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - - "github.com/golang/mock/gomock" ) func (suite *TestSuite) createAccounts(accs int) []sdk.AccAddress { @@ -331,7 +331,7 @@ func (suite *TestSuite) TestExec() { errMsg: "empty address string is not allowed", }, { - name: "no existing grant", + name: "non existing grant", malleate: func() authz.MsgExec { return authz.NewMsgExec(grantee, []sdk.Msg{msg}) }, diff --git a/x/authz/migrations/v2/keys_test.go b/x/authz/migrations/v2/keys_test.go index 7553b01427b8..73b4873e3595 100644 --- a/x/authz/migrations/v2/keys_test.go +++ b/x/authz/migrations/v2/keys_test.go @@ -3,11 +3,12 @@ package v2 import ( "testing" + "github.com/stretchr/testify/require" + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/address" bank "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/stretchr/testify/require" ) var ( diff --git a/x/authz/migrations/v2/store_test.go b/x/authz/migrations/v2/store_test.go index 7e05f87b8080..cf71c4519ead 100644 --- a/x/authz/migrations/v2/store_test.go +++ b/x/authz/migrations/v2/store_test.go @@ -4,9 +4,10 @@ import ( "testing" "time" - storetypes "cosmossdk.io/store/types" "github.com/stretchr/testify/require" + storetypes "cosmossdk.io/store/types" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" "github.com/cosmos/cosmos-sdk/runtime" diff --git a/x/authz/module/abci_test.go b/x/authz/module/abci_test.go index 2d9b39536ea1..0e8857377fc3 100644 --- a/x/authz/module/abci_test.go +++ b/x/authz/module/abci_test.go @@ -4,11 +4,12 @@ import ( "testing" "time" - "cosmossdk.io/log" - storetypes "cosmossdk.io/store/types" "github.com/cometbft/cometbft/proto/tendermint/types" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" + + "cosmossdk.io/log" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec/address" diff --git a/x/authz/module/autocli.go b/x/authz/module/autocli.go new file mode 100644 index 000000000000..fc551183e475 --- /dev/null +++ b/x/authz/module/autocli.go @@ -0,0 +1,76 @@ +package authz + +import ( + "fmt" + + authzv1beta1 "cosmossdk.io/api/cosmos/authz/v1beta1" + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + + "github.com/cosmos/cosmos-sdk/version" + bank "github.com/cosmos/cosmos-sdk/x/bank/types" +) + +// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. +func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { + return &autocliv1.ModuleOptions{ + Query: &autocliv1.ServiceCommandDescriptor{ + Service: authzv1beta1.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Grants", + Use: "grants [granter-addr] [grantee-addr] ", + Short: "Query grants for a granter-grantee pair and optionally a msg-type-url", + Long: "Query authorization grants for a granter-grantee pair. If msg-type-url is set, it will select grants only for that msg type.", + Example: fmt.Sprintf("%s query authz grants cosmos1skj.. cosmos1skjwj.. %s", version.AppName, bank.SendAuthorization{}.MsgTypeURL()), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "granter"}, + {ProtoField: "grantee"}, + {ProtoField: "msg_type_url", Optional: true}, + }, + }, + { + RpcMethod: "GranterGrants", + Use: "grants-by-granter [granter-addr]", + Short: "Query authorization grants granted by granter", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "granter"}, + }, + }, + { + RpcMethod: "GranteeGrants", + Use: "grants-by-grantee [grantee-addr]", + Short: "Query authorization grants granted to a grantee", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "grantee"}, + }, + }, + }, + }, + Tx: &autocliv1.ServiceCommandDescriptor{ + Service: authzv1beta1.Msg_ServiceDesc.ServiceName, + EnhanceCustomCommand: false, // use custom commands only until v0.51 + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Exec", + Use: "exec [msg-json-file] --from [grantee]", + Short: "Execute tx on behalf of granter account", + Example: fmt.Sprintf("$ %s tx authz exec msg.json --from grantee\n $ %[1]s tx bank send [granter] [recipient] [amount] --generate-only | jq .body.messages > msg.json && %[1]s tx authz exec msg.json --from grantee", version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "msgs", Varargs: true}, + }, + }, + { + RpcMethod: "Revoke", + Use: "revoke [grantee] [msg-type-url] --from [granter]", + Short: `Revoke authorization from a granter to a grantee`, + Example: fmt.Sprintf(`%s tx authz revoke cosmos1skj.. %s --from=cosmos1skj..`, + version.AppName, bank.SendAuthorization{}.MsgTypeURL()), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "grantee"}, + {ProtoField: "msg_type_url"}, + }, + }, + }, + }, + } +} diff --git a/x/authz/module/module.go b/x/authz/module/module.go index bf398012f8f3..3c80d13c1420 100644 --- a/x/authz/module/module.go +++ b/x/authz/module/module.go @@ -5,17 +5,14 @@ import ( "encoding/json" "fmt" - abci "github.com/cometbft/cometbft/abci/types" gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" modulev1 "cosmossdk.io/api/cosmos/authz/module/v1" "cosmossdk.io/core/address" "cosmossdk.io/core/appmodule" - - "cosmossdk.io/depinject" - "cosmossdk.io/core/store" + "cosmossdk.io/depinject" "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/baseapp" @@ -32,8 +29,13 @@ import ( ) var ( - _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleBasic = AppModule{} _ module.AppModuleSimulation = AppModule{} + _ module.HasGenesis = AppModule{} + _ module.HasServices = AppModule{} + + _ appmodule.AppModule = AppModule{} + _ appmodule.HasBeginBlocker = AppModule{} ) // AppModuleBasic defines the basic application module used by the authz module. @@ -92,11 +94,6 @@ func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx sdkclient.Context, mux } } -// GetQueryCmd returns the cli query commands for the authz module -func (ab AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd(ab.ac) -} - // GetTxCmd returns the transaction commands for the authz module func (ab AppModuleBasic) GetTxCmd() *cobra.Command { return cli.GetTxCmd(ab.ac) @@ -105,6 +102,7 @@ func (ab AppModuleBasic) GetTxCmd() *cobra.Command { // AppModule implements the sdk.AppModule interface type AppModule struct { AppModuleBasic + keeper keeper.Keeper accountKeeper authz.AccountKeeper bankKeeper authz.BankKeeper @@ -115,36 +113,25 @@ type AppModule struct { func NewAppModule(cdc codec.Codec, keeper keeper.Keeper, ak authz.AccountKeeper, bk authz.BankKeeper, registry cdctypes.InterfaceRegistry) AppModule { return AppModule{ AppModuleBasic: AppModuleBasic{cdc: cdc, ac: ak.AddressCodec()}, - keeper: keeper, + keeper: keeper.SetBankKeeper(bk), // Super ugly hack to not be api breaking in v0.50 and v0.47 accountKeeper: ak, bankKeeper: bk, registry: registry, } } -var ( - _ appmodule.AppModule = AppModule{} - _ appmodule.HasBeginBlocker = AppModule{} -) - // IsOnePerModuleType implements the depinject.OnePerModuleType interface. func (am AppModule) IsOnePerModuleType() {} // IsAppModule implements the appmodule.AppModule interface. func (am AppModule) IsAppModule() {} -// Name returns the authz module's name. -func (AppModule) Name() string { - return authz.ModuleName -} - // InitGenesis performs genesis initialization for the authz module. It returns // no validator updates. -func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate { +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) { var genesisState authz.GenesisState cdc.MustUnmarshalJSON(data, &genesisState) am.keeper.InitGenesis(ctx, &genesisState) - return []abci.ValidatorUpdate{} } // ExportGenesis returns the exported genesis state as raw bytes for the authz @@ -191,7 +178,7 @@ type ModuleOutputs struct { func ProvideModule(in ModuleInputs) ModuleOutputs { k := keeper.NewKeeper(in.StoreService, in.Cdc, in.MsgServiceRouter, in.AccountKeeper) m := NewAppModule(in.Cdc, k, in.AccountKeeper, in.BankKeeper, in.Registry) - return ModuleOutputs{AuthzKeeper: k, Module: m} + return ModuleOutputs{AuthzKeeper: k.SetBankKeeper(in.BankKeeper) /* depinject ux improvement */, Module: m} } // ____________________________________________________________________________ diff --git a/x/authz/msgs.go b/x/authz/msgs.go index c0ed9c0eada3..1721c6c5347c 100644 --- a/x/authz/msgs.go +++ b/x/authz/msgs.go @@ -33,12 +33,6 @@ func NewMsgGrant(granter, grantee sdk.AccAddress, a Authorization, expiration *t return m, nil } -// GetSigners implements Msg -func (msg MsgGrant) GetSigners() []sdk.AccAddress { - granter, _ := sdk.AccAddressFromBech32(msg.Granter) - return []sdk.AccAddress{granter} -} - // GetAuthorization returns the cache value from the MsgGrant.Authorization if present. func (msg *MsgGrant) GetAuthorization() (Authorization, error) { return msg.Grant.GetAuthorization() @@ -85,12 +79,6 @@ func NewMsgRevoke(granter, grantee sdk.AccAddress, msgTypeURL string) MsgRevoke } } -// GetSigners implements Msg -func (msg MsgRevoke) GetSigners() []sdk.AccAddress { - granter, _ := sdk.AccAddressFromBech32(msg.Granter) - return []sdk.AccAddress{granter} -} - // NewMsgExec creates a new MsgExecAuthorized func NewMsgExec(grantee sdk.AccAddress, msgs []sdk.Msg) MsgExec { msgsAny := make([]*cdctypes.Any, len(msgs)) @@ -122,9 +110,3 @@ func (msg MsgExec) GetMessages() ([]sdk.Msg, error) { return msgs, nil } - -// GetSigners implements Msg -func (msg MsgExec) GetSigners() []sdk.AccAddress { - grantee, _ := sdk.AccAddressFromBech32(msg.Grantee) - return []sdk.AccAddress{grantee} -} diff --git a/x/authz/msgs_test.go b/x/authz/msgs_test.go index bcd17cf4d86a..ea634fd39526 100644 --- a/x/authz/msgs_test.go +++ b/x/authz/msgs_test.go @@ -7,23 +7,21 @@ import ( "time" "github.com/cosmos/gogoproto/proto" + "github.com/stretchr/testify/require" "google.golang.org/protobuf/types/known/anypb" txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" + sdkmath "cosmossdk.io/math" txsigning "cosmossdk.io/x/tx/signing" "cosmossdk.io/x/tx/signing/aminojson" - "github.com/cosmos/cosmos-sdk/codec" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - - "github.com/stretchr/testify/require" - - sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" "github.com/cosmos/cosmos-sdk/x/authz" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) func TestMsgGrantGetAuthorization(t *testing.T) { @@ -73,7 +71,7 @@ func TestAminoJSON(t *testing.T) { require.NoError(t, err) valAddr, err := sdk.ValAddressFromBech32("cosmosvaloper1xcy3els9ua75kdm783c3qu0rfa2eples6eavqq") require.NoError(t, err) - stakingAuth, err := stakingtypes.NewStakeAuthorization([]sdk.ValAddress{valAddr}, nil, stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_DELEGATE, &sdk.Coin{Denom: "stake", Amount: sdk.NewInt(1000)}) + stakingAuth, err := stakingtypes.NewStakeAuthorization([]sdk.ValAddress{valAddr}, nil, stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_DELEGATE, &sdk.Coin{Denom: "stake", Amount: sdkmath.NewInt(1000)}) require.NoError(t, err) delegateGrant, err := authz.NewGrant(blockTime, stakingAuth, nil) require.NoError(t, err) @@ -113,7 +111,7 @@ func TestAminoJSON(t *testing.T) { for i, tt := range tests { t.Run(fmt.Sprintf("case %d", i), func(t *testing.T) { tx.Msgs = []sdk.Msg{tt.msg} - legacyJSON := string(legacytx.StdSignBytes("foo", 1, 1, 1, legacytx.StdFee{}, []sdk.Msg{tt.msg}, "memo", nil)) + legacyJSON := string(legacytx.StdSignBytes("foo", 1, 1, 1, legacytx.StdFee{}, []sdk.Msg{tt.msg}, "memo")) require.Equal(t, tt.exp, legacyJSON) legacyAny, err := cdctypes.NewAnyWithValue(tt.msg) diff --git a/x/authz/query.pb.go b/x/authz/query.pb.go index c022c6e1893a..29507dc0dfba 100644 --- a/x/authz/query.pb.go +++ b/x/authz/query.pb.go @@ -265,7 +265,7 @@ func (m *QueryGranterGrantsResponse) GetPagination() *query.PageResponse { return nil } -// QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. +// QueryGranteeGrantsRequest is the request type for the Query/GranteeGrants RPC method. type QueryGranteeGrantsRequest struct { Grantee string `protobuf:"bytes,1,opt,name=grantee,proto3" json:"grantee,omitempty"` // pagination defines an pagination for the request. @@ -568,6 +568,7 @@ func _Query_GranteeGrants_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.authz.v1beta1.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/authz/simulation/decoder_test.go b/x/authz/simulation/decoder_test.go index 487deae31f18..ffaf441195f1 100644 --- a/x/authz/simulation/decoder_test.go +++ b/x/authz/simulation/decoder_test.go @@ -9,13 +9,12 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/kv" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" "github.com/cosmos/cosmos-sdk/x/authz" "github.com/cosmos/cosmos-sdk/x/authz/keeper" authzmodule "github.com/cosmos/cosmos-sdk/x/authz/module" "github.com/cosmos/cosmos-sdk/x/authz/simulation" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - - moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" ) func TestDecodeStore(t *testing.T) { diff --git a/x/authz/simulation/genesis_test.go b/x/authz/simulation/genesis_test.go index f0dd86fa4dbb..416381c94fb5 100644 --- a/x/authz/simulation/genesis_test.go +++ b/x/authz/simulation/genesis_test.go @@ -8,14 +8,14 @@ import ( "github.com/stretchr/testify/require" sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/types/module" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/authz" authzmodule "github.com/cosmos/cosmos-sdk/x/authz/module" "github.com/cosmos/cosmos-sdk/x/authz/simulation" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - - moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" ) func TestRandomizedGenState(t *testing.T) { diff --git a/x/authz/simulation/operations_test.go b/x/authz/simulation/operations_test.go index e6778c524711..8a6894dc2b07 100644 --- a/x/authz/simulation/operations_test.go +++ b/x/authz/simulation/operations_test.go @@ -5,12 +5,13 @@ import ( "testing" "time" - "cosmossdk.io/depinject" - "cosmossdk.io/log" abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/gogoproto/proto" "github.com/stretchr/testify/suite" + "cosmossdk.io/depinject" + "cosmossdk.io/log" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" diff --git a/x/authz/testutil/app_config.go b/x/authz/testutil/app_config.go index fb6924a08d26..f1e61c100bbb 100644 --- a/x/authz/testutil/app_config.go +++ b/x/authz/testutil/app_config.go @@ -2,7 +2,6 @@ package testutil import ( "github.com/cosmos/cosmos-sdk/testutil/configurator" - _ "github.com/cosmos/cosmos-sdk/x/auth" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/auth/tx/config" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/authz/module" // import as blank for app wiring diff --git a/x/authz/testutil/expected_keepers_mocks.go b/x/authz/testutil/expected_keepers_mocks.go index b9e8f521c327..15481c65e347 100644 --- a/x/authz/testutil/expected_keepers_mocks.go +++ b/x/authz/testutil/expected_keepers_mocks.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: x/authz/expected_keepers.go +// +// Generated by this command: +// +// mockgen -source=x/authz/expected_keepers.go -package testutil -destination x/authz/testutil/expected_keepers_mocks.go +// // Package testutil is a generated GoMock package. package testutil @@ -10,13 +15,14 @@ import ( address "cosmossdk.io/core/address" types "github.com/cosmos/cosmos-sdk/types" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockAccountKeeper is a mock of AccountKeeper interface. type MockAccountKeeper struct { ctrl *gomock.Controller recorder *MockAccountKeeperMockRecorder + isgomock struct{} } // MockAccountKeeperMockRecorder is the mock recorder for MockAccountKeeper. @@ -59,7 +65,7 @@ func (m *MockAccountKeeper) GetAccount(ctx context.Context, addr types.AccAddres } // GetAccount indicates an expected call of GetAccount. -func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetAccount), ctx, addr) } @@ -73,7 +79,7 @@ func (m *MockAccountKeeper) NewAccountWithAddress(ctx context.Context, addr type } // NewAccountWithAddress indicates an expected call of NewAccountWithAddress. -func (mr *MockAccountKeeperMockRecorder) NewAccountWithAddress(ctx, addr interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) NewAccountWithAddress(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewAccountWithAddress", reflect.TypeOf((*MockAccountKeeper)(nil).NewAccountWithAddress), ctx, addr) } @@ -85,7 +91,7 @@ func (m *MockAccountKeeper) SetAccount(ctx context.Context, acc types.AccountI) } // SetAccount indicates an expected call of SetAccount. -func (mr *MockAccountKeeperMockRecorder) SetAccount(ctx, acc interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) SetAccount(ctx, acc any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetAccount", reflect.TypeOf((*MockAccountKeeper)(nil).SetAccount), ctx, acc) } @@ -94,6 +100,7 @@ func (mr *MockAccountKeeperMockRecorder) SetAccount(ctx, acc interface{}) *gomoc type MockBankKeeper struct { ctrl *gomock.Controller recorder *MockBankKeeperMockRecorder + isgomock struct{} } // MockBankKeeperMockRecorder is the mock recorder for MockBankKeeper. @@ -113,10 +120,24 @@ func (m *MockBankKeeper) EXPECT() *MockBankKeeperMockRecorder { return m.recorder } +// BlockedAddr mocks base method. +func (m *MockBankKeeper) BlockedAddr(addr types.AccAddress) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "BlockedAddr", addr) + ret0, _ := ret[0].(bool) + return ret0 +} + +// BlockedAddr indicates an expected call of BlockedAddr. +func (mr *MockBankKeeperMockRecorder) BlockedAddr(addr any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlockedAddr", reflect.TypeOf((*MockBankKeeper)(nil).BlockedAddr), addr) +} + // IsSendEnabledCoins mocks base method. func (m *MockBankKeeper) IsSendEnabledCoins(ctx context.Context, coins ...types.Coin) error { m.ctrl.T.Helper() - varargs := []interface{}{ctx} + varargs := []any{ctx} for _, a := range coins { varargs = append(varargs, a) } @@ -126,9 +147,9 @@ func (m *MockBankKeeper) IsSendEnabledCoins(ctx context.Context, coins ...types. } // IsSendEnabledCoins indicates an expected call of IsSendEnabledCoins. -func (mr *MockBankKeeperMockRecorder) IsSendEnabledCoins(ctx interface{}, coins ...interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) IsSendEnabledCoins(ctx any, coins ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{ctx}, coins...) + varargs := append([]any{ctx}, coins...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsSendEnabledCoins", reflect.TypeOf((*MockBankKeeper)(nil).IsSendEnabledCoins), varargs...) } @@ -141,7 +162,7 @@ func (m *MockBankKeeper) SpendableCoins(ctx context.Context, addr types.AccAddre } // SpendableCoins indicates an expected call of SpendableCoins. -func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SpendableCoins", reflect.TypeOf((*MockBankKeeper)(nil).SpendableCoins), ctx, addr) } diff --git a/x/authz/tx.pb.go b/x/authz/tx.pb.go index 369d9283e46c..d27d3521cdb6 100644 --- a/x/authz/tx.pb.go +++ b/x/authz/tx.pb.go @@ -73,23 +73,22 @@ func (m *MsgGrant) XXX_DiscardUnknown() { var xxx_messageInfo_MsgGrant proto.InternalMessageInfo -// MsgExecResponse defines the Msg/MsgExecResponse response type. -type MsgExecResponse struct { - Results [][]byte `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` +// MsgGrantResponse defines the Msg/MsgGrant response type. +type MsgGrantResponse struct { } -func (m *MsgExecResponse) Reset() { *m = MsgExecResponse{} } -func (m *MsgExecResponse) String() string { return proto.CompactTextString(m) } -func (*MsgExecResponse) ProtoMessage() {} -func (*MsgExecResponse) Descriptor() ([]byte, []int) { +func (m *MsgGrantResponse) Reset() { *m = MsgGrantResponse{} } +func (m *MsgGrantResponse) String() string { return proto.CompactTextString(m) } +func (*MsgGrantResponse) ProtoMessage() {} +func (*MsgGrantResponse) Descriptor() ([]byte, []int) { return fileDescriptor_3ceddab7d8589ad1, []int{1} } -func (m *MsgExecResponse) XXX_Unmarshal(b []byte) error { +func (m *MsgGrantResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgExecResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgGrantResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgExecResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgGrantResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -99,17 +98,17 @@ func (m *MsgExecResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return b[:n], nil } } -func (m *MsgExecResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgExecResponse.Merge(m, src) +func (m *MsgGrantResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgGrantResponse.Merge(m, src) } -func (m *MsgExecResponse) XXX_Size() int { +func (m *MsgGrantResponse) XXX_Size() int { return m.Size() } -func (m *MsgExecResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgExecResponse.DiscardUnknown(m) +func (m *MsgGrantResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgGrantResponse.DiscardUnknown(m) } -var xxx_messageInfo_MsgExecResponse proto.InternalMessageInfo +var xxx_messageInfo_MsgGrantResponse proto.InternalMessageInfo // MsgExec attempts to execute the provided messages using // authorizations granted to the grantee. Each message should have only @@ -155,22 +154,23 @@ func (m *MsgExec) XXX_DiscardUnknown() { var xxx_messageInfo_MsgExec proto.InternalMessageInfo -// MsgGrantResponse defines the Msg/MsgGrant response type. -type MsgGrantResponse struct { +// MsgExecResponse defines the Msg/MsgExecResponse response type. +type MsgExecResponse struct { + Results [][]byte `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` } -func (m *MsgGrantResponse) Reset() { *m = MsgGrantResponse{} } -func (m *MsgGrantResponse) String() string { return proto.CompactTextString(m) } -func (*MsgGrantResponse) ProtoMessage() {} -func (*MsgGrantResponse) Descriptor() ([]byte, []int) { +func (m *MsgExecResponse) Reset() { *m = MsgExecResponse{} } +func (m *MsgExecResponse) String() string { return proto.CompactTextString(m) } +func (*MsgExecResponse) ProtoMessage() {} +func (*MsgExecResponse) Descriptor() ([]byte, []int) { return fileDescriptor_3ceddab7d8589ad1, []int{3} } -func (m *MsgGrantResponse) XXX_Unmarshal(b []byte) error { +func (m *MsgExecResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgGrantResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgExecResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgGrantResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgExecResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -180,17 +180,17 @@ func (m *MsgGrantResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return b[:n], nil } } -func (m *MsgGrantResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgGrantResponse.Merge(m, src) +func (m *MsgExecResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgExecResponse.Merge(m, src) } -func (m *MsgGrantResponse) XXX_Size() int { +func (m *MsgExecResponse) XXX_Size() int { return m.Size() } -func (m *MsgGrantResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgGrantResponse.DiscardUnknown(m) +func (m *MsgExecResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgExecResponse.DiscardUnknown(m) } -var xxx_messageInfo_MsgGrantResponse proto.InternalMessageInfo +var xxx_messageInfo_MsgExecResponse proto.InternalMessageInfo // MsgRevoke revokes any authorization with the provided sdk.Msg type on the // granter's account with that has been granted to the grantee. @@ -272,9 +272,9 @@ var xxx_messageInfo_MsgRevokeResponse proto.InternalMessageInfo func init() { proto.RegisterType((*MsgGrant)(nil), "cosmos.authz.v1beta1.MsgGrant") - proto.RegisterType((*MsgExecResponse)(nil), "cosmos.authz.v1beta1.MsgExecResponse") - proto.RegisterType((*MsgExec)(nil), "cosmos.authz.v1beta1.MsgExec") proto.RegisterType((*MsgGrantResponse)(nil), "cosmos.authz.v1beta1.MsgGrantResponse") + proto.RegisterType((*MsgExec)(nil), "cosmos.authz.v1beta1.MsgExec") + proto.RegisterType((*MsgExecResponse)(nil), "cosmos.authz.v1beta1.MsgExecResponse") proto.RegisterType((*MsgRevoke)(nil), "cosmos.authz.v1beta1.MsgRevoke") proto.RegisterType((*MsgRevokeResponse)(nil), "cosmos.authz.v1beta1.MsgRevokeResponse") } @@ -283,41 +283,41 @@ func init() { proto.RegisterFile("cosmos/authz/v1beta1/tx.proto", fileDescriptor var fileDescriptor_3ceddab7d8589ad1 = []byte{ // 555 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x54, 0x4f, 0x6f, 0x12, 0x4f, - 0x18, 0x66, 0x4a, 0x29, 0x3f, 0xa6, 0x4d, 0x7e, 0x76, 0x4b, 0xe2, 0x76, 0x9b, 0x6e, 0x37, 0x6b, - 0xab, 0x04, 0xc3, 0x4c, 0xc0, 0x1b, 0xf1, 0x52, 0x92, 0xc6, 0x8b, 0xc4, 0x64, 0xd5, 0x8b, 0x17, - 0xb2, 0xc0, 0x38, 0x25, 0x65, 0x77, 0xc8, 0xce, 0x42, 0xc0, 0x93, 0xf1, 0xe8, 0xc9, 0x8f, 0xa1, - 0x37, 0x0e, 0x3d, 0xfa, 0x01, 0x88, 0xa7, 0xc6, 0x83, 0xf1, 0x64, 0x14, 0x0e, 0x7c, 0x0c, 0xcd, - 0xce, 0x1f, 0xa4, 0x86, 0xd6, 0x9e, 0xbc, 0xc0, 0xbc, 0xef, 0xf3, 0xbc, 0xb3, 0xef, 0xf3, 0x3e, - 0x6f, 0x06, 0xee, 0xb7, 0x18, 0x0f, 0x18, 0xc7, 0x7e, 0x3f, 0x3e, 0x7d, 0x85, 0x07, 0xe5, 0x26, - 0x89, 0xfd, 0x32, 0x8e, 0x87, 0xa8, 0x17, 0xb1, 0x98, 0x19, 0x79, 0x09, 0x23, 0x01, 0x23, 0x05, - 0x5b, 0xbb, 0x32, 0xdb, 0x10, 0x1c, 0xac, 0x28, 0x22, 0xb0, 0xf2, 0x94, 0x51, 0x26, 0xf3, 0xc9, - 0x49, 0x65, 0x77, 0x29, 0x63, 0xb4, 0x4b, 0xb0, 0x88, 0x9a, 0xfd, 0x97, 0xd8, 0x0f, 0x47, 0x0a, - 0x72, 0x56, 0x36, 0x20, 0xbf, 0x27, 0x19, 0xb7, 0x15, 0x23, 0xe0, 0x14, 0x0f, 0xca, 0xc9, 0x9f, - 0x02, 0xb6, 0xfd, 0xa0, 0x13, 0x32, 0x2c, 0x7e, 0x65, 0xca, 0xfd, 0x02, 0xe0, 0x7f, 0x75, 0x4e, - 0x1f, 0x45, 0x7e, 0x18, 0x1b, 0x15, 0x98, 0xa5, 0xc9, 0x81, 0x44, 0x26, 0x70, 0x40, 0x21, 0x57, - 0x33, 0x3f, 0x9f, 0x97, 0xb4, 0xa2, 0xe3, 0x76, 0x3b, 0x22, 0x9c, 0x3f, 0x8d, 0xa3, 0x4e, 0x48, - 0x3d, 0x4d, 0xfc, 0x5d, 0x43, 0xcc, 0xb5, 0x9b, 0xd5, 0x10, 0xe3, 0x21, 0xcc, 0x88, 0xa3, 0x99, - 0x76, 0x40, 0x61, 0xb3, 0xb2, 0x87, 0x56, 0x0d, 0x0d, 0x89, 0x9e, 0x6a, 0xb9, 0xc9, 0xb7, 0x83, - 0xd4, 0xfb, 0xf9, 0xb8, 0x08, 0x3c, 0x59, 0x54, 0x3d, 0x7c, 0x33, 0x1f, 0x17, 0xf5, 0xf7, 0xdf, - 0xce, 0xc7, 0xc5, 0x1d, 0x59, 0x5e, 0xe2, 0xed, 0x33, 0xac, 0xb5, 0xb8, 0xf7, 0xe1, 0xff, 0x75, - 0x4e, 0x4f, 0x86, 0xa4, 0xe5, 0x11, 0xde, 0x63, 0x21, 0x27, 0x86, 0x09, 0xb3, 0x11, 0xe1, 0xfd, - 0x6e, 0xcc, 0x4d, 0xe0, 0xa4, 0x0b, 0x5b, 0x9e, 0x0e, 0xdd, 0x0f, 0x00, 0x66, 0x15, 0x7b, 0x59, - 0x10, 0xb8, 0xa9, 0xa0, 0x13, 0xb8, 0x1e, 0x70, 0xca, 0xcd, 0x35, 0x27, 0x5d, 0xd8, 0xac, 0xe4, - 0x91, 0x74, 0x0f, 0x69, 0xf7, 0xd0, 0x71, 0x38, 0xaa, 0xed, 0x7d, 0x3a, 0x2f, 0x29, 0x67, 0x50, - 0xd3, 0xe7, 0x64, 0xa1, 0xb3, 0xce, 0xa9, 0x27, 0xca, 0xab, 0x77, 0x96, 0x94, 0x91, 0x44, 0x99, - 0x71, 0x59, 0x59, 0xd2, 0x9f, 0x6b, 0xc0, 0x5b, 0x5a, 0xa4, 0x56, 0xe6, 0x7e, 0x04, 0x30, 0x97, - 0x5c, 0x43, 0x06, 0xec, 0x8c, 0xfc, 0x33, 0x1b, 0x1d, 0xb8, 0x15, 0x70, 0xda, 0x88, 0x47, 0x3d, - 0xd2, 0xe8, 0x47, 0x5d, 0xe1, 0x66, 0xce, 0x83, 0x01, 0xa7, 0xcf, 0x46, 0x3d, 0xf2, 0x3c, 0xea, - 0x56, 0x8f, 0xfe, 0xb4, 0x2a, 0x7f, 0x59, 0x90, 0x6c, 0xd8, 0xdd, 0x81, 0xdb, 0x8b, 0x40, 0x6b, - 0xaa, 0xfc, 0x04, 0x30, 0x5d, 0xe7, 0xd4, 0x78, 0x02, 0x33, 0x72, 0x3b, 0xed, 0xd5, 0x6b, 0xa2, - 0x87, 0x61, 0xdd, 0xbd, 0x1e, 0x5f, 0xac, 0xc1, 0x63, 0xb8, 0x2e, 0x8c, 0xde, 0xbf, 0x92, 0x9f, - 0xc0, 0xd6, 0xd1, 0xb5, 0xf0, 0xe2, 0x36, 0x0f, 0x6e, 0xa8, 0xb1, 0x1f, 0x5c, 0x59, 0x20, 0x09, - 0xd6, 0xbd, 0xbf, 0x10, 0xf4, 0x9d, 0x56, 0xe6, 0x75, 0xb2, 0xef, 0xb5, 0xda, 0xe4, 0x87, 0x9d, - 0x9a, 0x4c, 0x6d, 0x70, 0x31, 0xb5, 0xc1, 0xf7, 0xa9, 0x0d, 0xde, 0xcd, 0xec, 0xd4, 0xc5, 0xcc, - 0x4e, 0x7d, 0x9d, 0xd9, 0xa9, 0x17, 0x87, 0xb4, 0x13, 0x9f, 0xf6, 0x9b, 0xa8, 0xc5, 0x02, 0xf5, - 0xa2, 0xe0, 0xa5, 0xe1, 0x0e, 0xe5, 0x8b, 0xd0, 0xdc, 0x10, 0x3b, 0xf8, 0xe0, 0x57, 0x00, 0x00, - 0x00, 0xff, 0xff, 0xbb, 0x9d, 0x9d, 0x9e, 0xb7, 0x04, 0x00, 0x00, + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x54, 0xbf, 0x6e, 0x13, 0x4f, + 0x10, 0xf6, 0xc6, 0x71, 0xfc, 0xf3, 0x26, 0xd2, 0x8f, 0x5c, 0x2c, 0x71, 0xb9, 0x28, 0x97, 0xd3, + 0x91, 0x80, 0x65, 0xe4, 0x5d, 0xd9, 0x74, 0x16, 0x4d, 0x2c, 0x45, 0x34, 0x58, 0x48, 0x07, 0x34, + 0x34, 0xd6, 0xd9, 0x5e, 0x36, 0x56, 0x7c, 0xb7, 0xd6, 0xed, 0xd9, 0xb2, 0xa9, 0x10, 0x25, 0x15, + 0x8f, 0x01, 0x9d, 0x8b, 0x94, 0x3c, 0x80, 0x45, 0x15, 0x51, 0x20, 0x2a, 0x04, 0x76, 0xe1, 0xc7, + 0x00, 0xdd, 0xfe, 0x31, 0x0e, 0x72, 0x42, 0x2a, 0x9a, 0xbb, 0x99, 0xf9, 0xbe, 0xd9, 0x9d, 0x6f, + 0x66, 0xb4, 0x70, 0xbf, 0xc5, 0x78, 0xc0, 0x38, 0xf6, 0xfb, 0xf1, 0xe9, 0x2b, 0x3c, 0x28, 0x37, + 0x49, 0xec, 0x97, 0x71, 0x3c, 0x44, 0xbd, 0x88, 0xc5, 0xcc, 0xc8, 0x4b, 0x18, 0x09, 0x18, 0x29, + 0xd8, 0xda, 0x95, 0xd1, 0x86, 0xe0, 0x60, 0x45, 0x11, 0x8e, 0x95, 0xa7, 0x8c, 0x32, 0x19, 0x4f, + 0x2c, 0x15, 0xdd, 0xa5, 0x8c, 0xd1, 0x2e, 0xc1, 0xc2, 0x6b, 0xf6, 0x5f, 0x62, 0x3f, 0x1c, 0x29, + 0xc8, 0x59, 0x59, 0x80, 0xbc, 0x4f, 0x32, 0x6e, 0x2b, 0x46, 0xc0, 0x29, 0x1e, 0x94, 0x93, 0x9f, + 0x02, 0xb6, 0xfd, 0xa0, 0x13, 0x32, 0x2c, 0xbe, 0x32, 0xe4, 0x7e, 0x01, 0xf0, 0xbf, 0x3a, 0xa7, + 0x8f, 0x22, 0x3f, 0x8c, 0x8d, 0x0a, 0xcc, 0xd2, 0xc4, 0x20, 0x91, 0x09, 0x1c, 0x50, 0xc8, 0xd5, + 0xcc, 0xcf, 0xe7, 0x25, 0xad, 0xe8, 0xb8, 0xdd, 0x8e, 0x08, 0xe7, 0x4f, 0xe3, 0xa8, 0x13, 0x52, + 0x4f, 0x13, 0x7f, 0xe7, 0x10, 0x73, 0xed, 0x66, 0x39, 0xc4, 0x78, 0x08, 0x33, 0xc2, 0x34, 0xd3, + 0x0e, 0x28, 0x6c, 0x56, 0xf6, 0xd0, 0xaa, 0xa6, 0x21, 0x51, 0x53, 0x2d, 0x37, 0xf9, 0x76, 0x90, + 0x7a, 0x3f, 0x1f, 0x17, 0x81, 0x27, 0x93, 0xaa, 0x87, 0x6f, 0xe6, 0xe3, 0xa2, 0xbe, 0xff, 0xed, + 0x7c, 0x5c, 0xdc, 0x91, 0xe9, 0x25, 0xde, 0x3e, 0xc3, 0x5a, 0x8b, 0x6b, 0xc0, 0x5b, 0xda, 0xf6, + 0x08, 0xef, 0xb1, 0x90, 0x13, 0xf7, 0x03, 0x80, 0xd9, 0x3a, 0xa7, 0x27, 0x43, 0xd2, 0x5a, 0xae, + 0x1b, 0xdc, 0xb4, 0xee, 0x13, 0xb8, 0x1e, 0x70, 0xca, 0xcd, 0x35, 0x27, 0x5d, 0xd8, 0xac, 0xe4, + 0x91, 0x1c, 0x12, 0xd2, 0x43, 0x42, 0xc7, 0xe1, 0xa8, 0xb6, 0xf7, 0xe9, 0xbc, 0xa4, 0x06, 0x80, + 0x9a, 0x3e, 0x27, 0x0b, 0x39, 0x75, 0x4e, 0x3d, 0x91, 0x5e, 0xbd, 0xb3, 0x24, 0x80, 0x24, 0x02, + 0x8c, 0xcb, 0x02, 0x92, 0xfa, 0xdc, 0xfb, 0xf0, 0x7f, 0x65, 0xea, 0xf2, 0x0d, 0x13, 0x66, 0x23, + 0xc2, 0xfb, 0xdd, 0x98, 0x9b, 0xc0, 0x49, 0x17, 0xb6, 0x3c, 0xed, 0xba, 0x1f, 0x01, 0xcc, 0x25, + 0xe7, 0x93, 0x01, 0x3b, 0x23, 0xff, 0x6c, 0x8c, 0x0e, 0xdc, 0x0a, 0x38, 0x6d, 0xc4, 0xa3, 0x1e, + 0x69, 0xf4, 0xa3, 0xae, 0x98, 0x66, 0xce, 0x83, 0x01, 0xa7, 0xcf, 0x46, 0x3d, 0xf2, 0x3c, 0xea, + 0x56, 0x8f, 0xfe, 0x1c, 0x55, 0xfe, 0xb2, 0x52, 0x59, 0xb0, 0xbb, 0x03, 0xb7, 0x17, 0x8e, 0x56, + 0x5b, 0xf9, 0x09, 0x60, 0xba, 0xce, 0xa9, 0xf1, 0x04, 0x66, 0xe4, 0x76, 0xda, 0xab, 0xd7, 0x44, + 0x4f, 0xd9, 0xba, 0x7b, 0x3d, 0xbe, 0x68, 0xe3, 0x63, 0xb8, 0x2e, 0x36, 0x60, 0xff, 0x4a, 0x7e, + 0x02, 0x5b, 0x47, 0xd7, 0xc2, 0x8b, 0xd3, 0x3c, 0xb8, 0xa1, 0xda, 0x7e, 0x70, 0x65, 0x82, 0x24, + 0x58, 0xf7, 0xfe, 0x42, 0xd0, 0x67, 0x5a, 0x99, 0xd7, 0xc9, 0xbe, 0xd7, 0x6a, 0x93, 0x1f, 0x76, + 0x6a, 0x32, 0xb5, 0xc1, 0xc5, 0xd4, 0x06, 0xdf, 0xa7, 0x36, 0x78, 0x37, 0xb3, 0x53, 0x17, 0x33, + 0x3b, 0xf5, 0x75, 0x66, 0xa7, 0x5e, 0x1c, 0xd2, 0x4e, 0x7c, 0xda, 0x6f, 0xa2, 0x16, 0x0b, 0xd4, + 0x8b, 0x82, 0x97, 0x9a, 0x3b, 0x94, 0x2f, 0x42, 0x73, 0x43, 0x2c, 0xe7, 0x83, 0x5f, 0x01, 0x00, + 0x00, 0xff, 0xff, 0x13, 0x38, 0x6d, 0x34, 0xb7, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -469,6 +469,7 @@ func _Msg_Revoke_Handler(srv interface{}, ctx context.Context, dec func(interfac return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.authz.v1beta1.Msg", HandlerType: (*MsgServer)(nil), @@ -537,7 +538,7 @@ func (m *MsgGrant) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgExecResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgGrantResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -547,25 +548,16 @@ func (m *MsgExecResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgExecResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgGrantResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgExecResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgGrantResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Results) > 0 { - for iNdEx := len(m.Results) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Results[iNdEx]) - copy(dAtA[i:], m.Results[iNdEx]) - i = encodeVarintTx(dAtA, i, uint64(len(m.Results[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } return len(dAtA) - i, nil } @@ -613,7 +605,7 @@ func (m *MsgExec) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgGrantResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgExecResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -623,16 +615,25 @@ func (m *MsgGrantResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgGrantResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgExecResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgGrantResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgExecResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if len(m.Results) > 0 { + for iNdEx := len(m.Results) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Results[iNdEx]) + copy(dAtA[i:], m.Results[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.Results[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } return len(dAtA) - i, nil } @@ -733,18 +734,12 @@ func (m *MsgGrant) Size() (n int) { return n } -func (m *MsgExecResponse) Size() (n int) { +func (m *MsgGrantResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.Results) > 0 { - for _, b := range m.Results { - l = len(b) - n += 1 + l + sovTx(uint64(l)) - } - } return n } @@ -767,12 +762,18 @@ func (m *MsgExec) Size() (n int) { return n } -func (m *MsgGrantResponse) Size() (n int) { +func (m *MsgExecResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l + if len(m.Results) > 0 { + for _, b := range m.Results { + l = len(b) + n += 1 + l + sovTx(uint64(l)) + } + } return n } @@ -959,7 +960,7 @@ func (m *MsgGrant) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgExecResponse) Unmarshal(dAtA []byte) error { +func (m *MsgGrantResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -982,44 +983,12 @@ func (m *MsgExecResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgExecResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgGrantResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgExecResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgGrantResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Results", 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.Results = append(m.Results, make([]byte, postIndex-iNdEx)) - copy(m.Results[len(m.Results)-1], dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -1157,7 +1126,7 @@ func (m *MsgExec) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgGrantResponse) Unmarshal(dAtA []byte) error { +func (m *MsgExecResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1180,12 +1149,44 @@ func (m *MsgGrantResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgGrantResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgExecResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgGrantResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgExecResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Results", 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.Results = append(m.Results, make([]byte, postIndex-iNdEx)) + copy(m.Results[len(m.Results)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) diff --git a/x/bank/README.md b/x/bank/README.md index 340822aa38d6..885a9f1f6f1f 100644 --- a/x/bank/README.md +++ b/x/bank/README.md @@ -236,8 +236,12 @@ accounts. The send keeper does not alter the total supply (mint or burn coins). type SendKeeper interface { ViewKeeper - InputOutputCoins(ctx context.Context, inputs types.Input, outputs []types.Output) error - SendCoins(ctx context.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error + AppendSendRestriction(restriction SendRestrictionFn) + PrependSendRestriction(restriction SendRestrictionFn) + ClearSendRestriction() + + InputOutputCoins(ctx context.Context, input types.Input, outputs []types.Output) error + SendCoins(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error GetParams(ctx context.Context) types.Params SetParams(ctx context.Context, params types.Params) error @@ -256,6 +260,91 @@ type SendKeeper interface { } ``` +#### Send Restrictions + +The `SendKeeper` applies a `SendRestrictionFn` before each transfer of funds. + +```golang +// A SendRestrictionFn can restrict sends and/or provide a new receiver address. +type SendRestrictionFn func(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) (newToAddr sdk.AccAddress, err error) +``` + +After the `SendKeeper` (or `BaseKeeper`) has been created, send restrictions can be added to it using the `AppendSendRestriction` or `PrependSendRestriction` functions. +Both functions compose the provided restriction with any previously provided restrictions. +`AppendSendRestriction` adds the provided restriction to be run after any previously provided send restrictions. +`PrependSendRestriction` adds the restriction to be run before any previously provided send restrictions. +The composition will short-circuit when an error is encountered. I.e. if the first one returns an error, the second is not run. + +During `SendCoins`, the send restriction is applied after coins are removed from the from address, but before adding them to the to address. +During `InputOutputCoins`, the send restriction is applied after the input coins are removed and once for each output before the funds are added. + +A send restriction function should make use of a custom value in the context to allow bypassing that specific restriction. + +Send Restrictions are not placed on `ModuleToAccount` or `ModuleToModule` transfers. This is done due to modules needing to move funds to user accounts and other module accounts. This is a design decision to allow for more flexibility in the state machine. The state machine should be able to move funds between module accounts and user accounts without restrictions. + +Secondly this limitation would limit the usage of the state machine even for itself. users would not be able to receive rewards, not be able to move funds between module accounts. In the case that a user sends funds from a user account to the community pool and then a governance proposal is used to get those tokens into the users account this would fall under the discretion of the app chain developer to what they would like to do here. We can not make strong assumptions here. +Thirdly, this issue could lead into a chain halt if a token is disabled and the token is moved in the begin/endblock. This is the last reason we see the current change and more damaging then beneficial for users. + +For example, in your module's keeper package, you'd define the send restriction function: + +```golang +var _ banktypes.SendRestrictionFn = Keeper{}.SendRestrictionFn + +func (k Keeper) SendRestrictionFn(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) (sdk.AccAddress, error) { + // Bypass if the context says to. + if mymodule.HasBypass(ctx) { + return toAddr, nil + } + + // Your custom send restriction logic goes here. + return nil, errors.New("not implemented") +} +``` + +The bank keeper should be provided to your keeper's constructor so the send restriction can be added to it: + +```golang +func NewKeeper(cdc codec.BinaryCodec, storeKey storetypes.StoreKey, bankKeeper mymodule.BankKeeper) Keeper { + rv := Keeper{/*...*/} + bankKeeper.AppendSendRestriction(rv.SendRestrictionFn) + return rv +} +``` + +Then, in the `mymodule` package, define the context helpers: + +```golang +const bypassKey = "bypass-mymodule-restriction" + +// WithBypass returns a new context that will cause the mymodule bank send restriction to be skipped. +func WithBypass(ctx context.Context) context.Context { + return sdk.UnwrapSDKContext(ctx).WithValue(bypassKey, true) +} + +// WithoutBypass returns a new context that will cause the mymodule bank send restriction to not be skipped. +func WithoutBypass(ctx context.Context) context.Context { + return sdk.UnwrapSDKContext(ctx).WithValue(bypassKey, false) +} + +// HasBypass checks the context to see if the mymodule bank send restriction should be skipped. +func HasBypass(ctx context.Context) bool { + bypassValue := ctx.Value(bypassKey) + if bypassValue == nil { + return false + } + bypass, isBool := bypassValue.(bool) + return isBool && bypass +} +``` + +Now, anywhere where you want to use `SendCoins` or `InputOutputCoins`, but you don't want your send restriction applied: + +```golang +func (k Keeper) DoThing(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error { + return k.bankKeeper.SendCoins(mymodule.WithBypass(ctx), fromAddr, toAddr, amt) +} +``` + ### ViewKeeper The view keeper provides read-only access to account balances. The view keeper does not have balance alteration functionality. All balance lookups are `O(1)`. diff --git a/x/bank/app_test.go b/x/bank/app_test.go index 016a7434200d..2099b5981f83 100644 --- a/x/bank/app_test.go +++ b/x/bank/app_test.go @@ -3,14 +3,15 @@ package bank_test import ( "testing" - "cosmossdk.io/depinject" - "cosmossdk.io/log" - sdkmath "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "cosmossdk.io/depinject" + "cosmossdk.io/log" + sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" @@ -371,13 +372,14 @@ func TestMsgSetSendEnabled(t *testing.T) { ctx := s.App.BaseApp.NewContext(false) require.NoError(t, testutil.FundAccount(ctx, s.BankKeeper, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 101)))) + require.NoError(t, testutil.FundAccount(ctx, s.BankKeeper, addr1, sdk.NewCoins(sdk.NewInt64Coin("stake", 100000)))) addr1Str := addr1.String() govAddr := s.BankKeeper.GetAuthority() goodGovProp, err := govv1.NewMsgSubmitProposal( []sdk.Msg{ types.NewMsgSetSendEnabled(govAddr, nil, nil), }, - sdk.Coins{{Denom: "foocoin", Amount: sdkmath.NewInt(5)}}, + sdk.Coins{{Denom: "stake", Amount: sdkmath.NewInt(100000)}}, addr1Str, "set default send enabled to true", "Change send enabled", diff --git a/x/bank/autocli.go b/x/bank/autocli.go new file mode 100644 index 000000000000..6c421ab0aa42 --- /dev/null +++ b/x/bank/autocli.go @@ -0,0 +1,118 @@ +package bank + +import ( + "strings" + + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" +) + +// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. +func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { + return &autocliv1.ModuleOptions{ + Query: &autocliv1.ServiceCommandDescriptor{ + Service: bankv1beta1.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Balance", + Use: "balance [address] [denom]", + Short: "Query an account balance by address and denom", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "address"}, {ProtoField: "denom"}}, + }, + { + RpcMethod: "AllBalances", + Use: "balances [address]", + Short: "Query for account balances by address", + Long: "Query the total balance of an account or of a specific denomination.", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "address"}}, + }, + { + RpcMethod: "SpendableBalances", + Use: "spendable-balances [address]", + Short: "Query for account spendable balances by address", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "address"}}, + }, + { + RpcMethod: "SpendableBalanceByDenom", + Use: "spendable-balance [address] [denom]", + Short: "Query the spendable balance of a single denom for a single account.", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "address"}, {ProtoField: "denom"}}, + }, + { + RpcMethod: "TotalSupply", + Use: "total-supply", + Alias: []string{"total"}, + Short: "Query the total supply of coins of the chain", + Long: "Query total supply of coins that are held by accounts in the chain. To query for the total supply of a specific coin denomination use --denom flag.", + }, + { + RpcMethod: "SupplyOf", + Use: "total-supply-of [denom]", + Short: "Query the supply of a single coin denom", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "denom"}}, + }, + { + RpcMethod: "Params", + Use: "params", + Short: "Query the current bank parameters", + }, + { + RpcMethod: "DenomMetadata", + Use: "denom-metadata [denom]", + Short: "Query the client metadata of a given coin denomination", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "denom"}}, + }, + { + RpcMethod: "DenomsMetadata", + Use: "denoms-metadata", + Short: "Query the client metadata for all registered coin denominations", + }, + { + RpcMethod: "DenomOwners", + Use: "denom-owners [denom]", + Short: "Query for all account addresses that own a particular token denomination.", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "denom"}}, + }, + { + RpcMethod: "SendEnabled", + Use: "send-enabled [denom1 ...]", + Short: "Query for send enabled entries", + Long: strings.TrimSpace(`Query for send enabled entries that have been specifically set. + +To look up one or more specific denoms, supply them as arguments to this command. +To look up all denoms, do not provide any arguments.`, + ), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "denoms", Varargs: true}}, + }, + }, + }, + Tx: &autocliv1.ServiceCommandDescriptor{ + Service: bankv1beta1.Msg_ServiceDesc.ServiceName, + EnhanceCustomCommand: false, // use custom commands only until v0.51 + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Send", + Use: "send [from_key_or_address] [to_address] [amount]", + Short: "Send funds from one account to another.", + Long: `Send funds from one account to another. +Note, the '--from' flag is ignored as it is implied from [from_key_or_address]. +When using '--dry-run' a key name cannot be used, only a bech32 address. +Note: multiple coins can be send by space separated.`, + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "from_address"}, {ProtoField: "to_address"}, {ProtoField: "amount", Varargs: true}}, + }, + { + RpcMethod: "UpdateParams", + Skip: true, // skipped because authority gated + }, + { + RpcMethod: "SetSendEnabled", + Skip: true, // skipped because authority gated + }, + { + RpcMethod: "Burn", + Skip: true, // skipped because available from v0.51 + }, + }, + }, + } +} diff --git a/x/bank/client/cli/query.go b/x/bank/client/cli/query.go deleted file mode 100644 index 23facd68ff09..000000000000 --- a/x/bank/client/cli/query.go +++ /dev/null @@ -1,349 +0,0 @@ -package cli - -import ( - "fmt" - "strings" - - "cosmossdk.io/core/address" - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/version" - "github.com/cosmos/cosmos-sdk/x/bank/types" -) - -const ( - FlagDenom = "denom" - FlagResolveDenom = "resolve-denom" -) - -// GetQueryCmd returns the parent command for all x/bank CLi query commands. The -// provided clientCtx should have, at a minimum, a verifier, CometBFT RPC client, -// and marshaler set. -func GetQueryCmd(ac address.Codec) *cobra.Command { - cmd := &cobra.Command{ - Use: types.ModuleName, - Short: "Querying commands for the bank module", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - cmd.AddCommand( - GetBalancesCmd(ac), - GetSpendableBalancesCmd(ac), - GetCmdQueryTotalSupply(), - GetCmdDenomsMetadata(), - GetCmdQuerySendEnabled(), - ) - - return cmd -} - -func GetBalancesCmd(ac address.Codec) *cobra.Command { - cmd := &cobra.Command{ - Use: "balances [address]", - Short: "Query for account balances by address", - Long: strings.TrimSpace( - fmt.Sprintf(`Query the total balance of an account or of a specific denomination. - -Example: - $ %s query %s balances [address] - $ %s query %s balances [address] --denom=[denom] - $ %s query %s balances [address] --resolve-denom -`, - version.AppName, types.ModuleName, version.AppName, types.ModuleName, version.AppName, types.ModuleName, - ), - ), - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - denom, err := cmd.Flags().GetString(FlagDenom) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - addr, err := ac.StringToBytes(args[0]) - if err != nil { - return err - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - ctx := cmd.Context() - - if denom == "" { - resolveDenom, err := cmd.Flags().GetBool(FlagResolveDenom) - if err != nil { - return err - } - - params := types.NewQueryAllBalancesRequest(addr, pageReq, resolveDenom) - - res, err := queryClient.AllBalances(ctx, params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - } - - params := types.NewQueryBalanceRequest(addr, denom) - - res, err := queryClient.Balance(ctx, params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res.Balance) - }, - } - - cmd.Flags().String(FlagDenom, "", "The specific balance denomination to query for") - cmd.Flags().Bool(FlagResolveDenom, false, "Resolve denom to human-readable denom from metadata") - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "all balances") - - return cmd -} - -func GetSpendableBalancesCmd(ac address.Codec) *cobra.Command { - cmd := &cobra.Command{ - Use: "spendable-balances [address]", - Short: "Query for account spendable balances by address", - Example: fmt.Sprintf("$ %s query %s spendable-balances [address]", version.AppName, types.ModuleName), - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - denom, err := cmd.Flags().GetString(FlagDenom) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - addr, err := ac.StringToBytes(args[0]) - if err != nil { - return err - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - ctx := cmd.Context() - - if denom == "" { - params := types.NewQuerySpendableBalancesRequest(addr, pageReq) - - res, err := queryClient.SpendableBalances(ctx, params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - } - - params := types.NewQuerySpendableBalanceByDenomRequest(addr, denom) - - res, err := queryClient.SpendableBalanceByDenom(ctx, params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - cmd.Flags().String(FlagDenom, "", "The specific balance denomination to query for") - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "spendable balances") - - return cmd -} - -// GetCmdDenomsMetadata defines the cobra command to query client denomination metadata. -func GetCmdDenomsMetadata() *cobra.Command { - cmd := &cobra.Command{ - Use: "denom-metadata", - Short: "Query the client metadata for coin denominations", - Long: strings.TrimSpace( - fmt.Sprintf(`Query the client metadata for all the registered coin denominations - -Example: - To query for the client metadata of all coin denominations use: - $ %s query %s denom-metadata - -To query for the client metadata of a specific coin denomination use: - $ %s query %s denom-metadata --denom=[denom] -`, - version.AppName, types.ModuleName, version.AppName, types.ModuleName, - ), - ), - RunE: func(cmd *cobra.Command, _ []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - denom, err := cmd.Flags().GetString(FlagDenom) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - if denom == "" { - res, err := queryClient.DenomsMetadata(cmd.Context(), &types.QueryDenomsMetadataRequest{}) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - } - - res, err := queryClient.DenomMetadata(cmd.Context(), &types.QueryDenomMetadataRequest{Denom: denom}) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - cmd.Flags().String(FlagDenom, "", "The specific denomination to query client metadata for") - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -func GetCmdQueryTotalSupply() *cobra.Command { - cmd := &cobra.Command{ - Use: "total", - Short: "Query the total supply of coins of the chain", - Args: cobra.NoArgs, - Long: strings.TrimSpace( - fmt.Sprintf(`Query total supply of coins that are held by accounts in the chain. - -Example: - $ %s query %s total - -To query for the total supply of a specific coin denomination use: - $ %s query %s total --denom=[denom] -`, - version.AppName, types.ModuleName, version.AppName, types.ModuleName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - denom, err := cmd.Flags().GetString(FlagDenom) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - ctx := cmd.Context() - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - if denom == "" { - res, err := queryClient.TotalSupply(ctx, &types.QueryTotalSupplyRequest{Pagination: pageReq}) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - } - - res, err := queryClient.SupplyOf(ctx, &types.QuerySupplyOfRequest{Denom: denom}) - if err != nil { - return err - } - - return clientCtx.PrintProto(&res.Amount) - }, - } - - cmd.Flags().String(FlagDenom, "", "The specific balance denomination to query for") - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "all supply totals") - - return cmd -} - -func GetCmdQuerySendEnabled() *cobra.Command { - cmd := &cobra.Command{ - Use: "send-enabled [denom1 ...]", - Short: "Query for send enabled entries", - Long: strings.TrimSpace(`Query for send enabled entries that have been specifically set. - -To look up one or more specific denoms, supply them as arguments to this command. -To look up all denoms, do not provide any arguments. -`, - ), - Example: strings.TrimSpace( - fmt.Sprintf(`Getting one specific entry: - $ %[1]s query %[2]s send-enabled foocoin - -Getting two specific entries: - $ %[1]s query %[2]s send-enabled foocoin barcoin - -Getting all entries: - $ %[1]s query %[2]s send-enabled -`, - version.AppName, types.ModuleName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - reqPag, err := client.ReadPageRequest(client.MustFlagSetWithPageKeyDecoded(cmd.Flags())) - if err != nil { - return err - } - - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - req := &types.QuerySendEnabledRequest{ - Denoms: args, - Pagination: reqPag, - } - - res, err := queryClient.SendEnabled(cmd.Context(), req) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "send enabled entries") - - return cmd -} diff --git a/x/bank/client/cli/query_test.go b/x/bank/client/cli/query_test.go deleted file mode 100644 index 800530b53d18..000000000000 --- a/x/bank/client/cli/query_test.go +++ /dev/null @@ -1,428 +0,0 @@ -package cli_test - -import ( - "context" - "fmt" - "io" - - abci "github.com/cometbft/cometbft/abci/types" - "github.com/cosmos/gogoproto/proto" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/codec/address" - svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" - "github.com/cosmos/cosmos-sdk/testutil" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/bank/client/cli" - "github.com/cosmos/cosmos-sdk/x/bank/types" -) - -func (s *CLITestSuite) TestGetBalancesCmd() { - accounts := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) - cmd := cli.GetBalancesCmd(address.NewBech32Codec("cosmos")) - cmd.SetOutput(io.Discard) - - testCases := []struct { - name string - ctxGen func() client.Context - args []string - expectResult proto.Message - expectErr bool - }{ - { - "valid query", - func() client.Context { - bz, _ := s.encCfg.Codec.Marshal(&types.QueryAllBalancesResponse{}) - c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ - Value: bz, - }) - return s.baseCtx.WithClient(c) - }, - []string{ - accounts[0].Address.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - &types.QueryAllBalancesResponse{}, - false, - }, - { - "valid query with denom", - func() client.Context { - bz, _ := s.encCfg.Codec.Marshal(&types.QueryBalanceResponse{ - Balance: &sdk.Coin{}, - }) - c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ - Value: bz, - }) - return s.baseCtx.WithClient(c) - }, - []string{ - accounts[0].Address.String(), - fmt.Sprintf("--%s=photon", cli.FlagDenom), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - &sdk.Coin{}, - false, - }, - { - "invalid Address", - func() client.Context { - return s.baseCtx - }, - []string{ - "foo", - }, - nil, - true, - }, - { - "invalid denom", - func() client.Context { - c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ - Code: 1, - }) - return s.baseCtx.WithClient(c) - }, - []string{ - accounts[0].Address.String(), - fmt.Sprintf("--%s=foo", cli.FlagDenom), - }, - nil, - true, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - ctx := svrcmd.CreateExecuteContext(context.Background()) - - cmd.SetContext(ctx) - cmd.SetArgs(tc.args) - - s.Require().NoError(client.SetCmdClientContextHandler(tc.ctxGen(), cmd)) - - out, err := clitestutil.ExecTestCLICmd(tc.ctxGen(), cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(s.encCfg.Codec.UnmarshalJSON(out.Bytes(), tc.expectResult)) - s.Require().NoError(err) - } - }) - } -} - -func (s *CLITestSuite) TestGetSpendableBalancesCmd() { - accounts := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) - - cmd := cli.GetSpendableBalancesCmd(address.NewBech32Codec("cosmos")) - cmd.SetOutput(io.Discard) - - testCases := []struct { - name string - ctxGen func() client.Context - args []string - expectResult proto.Message - expectErr bool - }{ - { - "valid query", - func() client.Context { - bz, _ := s.encCfg.Codec.Marshal(&types.QuerySpendableBalancesResponse{}) - c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ - Value: bz, - }) - return s.baseCtx.WithClient(c) - }, - []string{ - accounts[0].Address.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - &types.QuerySpendableBalancesResponse{}, - false, - }, - { - "valid query with denom flag", - func() client.Context { - bz, _ := s.encCfg.Codec.Marshal(&types.QuerySpendableBalanceByDenomRequest{}) - c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ - Value: bz, - }) - return s.baseCtx.WithClient(c) - }, - []string{ - accounts[0].Address.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - fmt.Sprintf("--%s=photon", cli.FlagDenom), - }, - &types.QuerySpendableBalanceByDenomResponse{}, - false, - }, - { - "invalid Address", - func() client.Context { - return s.baseCtx - }, - []string{ - "foo", - }, - nil, - true, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - ctx := svrcmd.CreateExecuteContext(context.Background()) - cmd.SetContext(ctx) - cmd.SetArgs(tc.args) - s.Require().NoError(client.SetCmdClientContextHandler(tc.ctxGen(), cmd)) - - out, err := clitestutil.ExecTestCLICmd(tc.ctxGen(), cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(s.encCfg.Codec.UnmarshalJSON(out.Bytes(), tc.expectResult)) - s.Require().NoError(err) - } - }) - } -} - -func (s *CLITestSuite) TestGetCmdDenomsMetadata() { - cmd := cli.GetCmdDenomsMetadata() - cmd.SetOutput(io.Discard) - - testCases := []struct { - name string - ctxGen func() client.Context - args []string - expectResult proto.Message - expectErr bool - }{ - { - "valid query", - func() client.Context { - bz, _ := s.encCfg.Codec.Marshal(&types.QueryDenomsMetadataResponse{}) - c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ - Value: bz, - }) - return s.baseCtx.WithClient(c) - }, - []string{ - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - &types.QueryDenomsMetadataResponse{}, - false, - }, - { - "valid query with denom", - func() client.Context { - bz, _ := s.encCfg.Codec.Marshal(&types.QueryDenomMetadataResponse{}) - c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ - Value: bz, - }) - return s.baseCtx.WithClient(c) - }, - []string{ - fmt.Sprintf("--%s=photon", cli.FlagDenom), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - &types.QueryDenomMetadataResponse{}, - false, - }, - { - "invalid query with denom", - func() client.Context { - c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ - Code: 1, - }) - return s.baseCtx.WithClient(c) - }, - []string{ - fmt.Sprintf("--%s=foo", cli.FlagDenom), - }, - nil, - true, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - ctx := svrcmd.CreateExecuteContext(context.Background()) - - cmd.SetContext(ctx) - cmd.SetArgs(tc.args) - - s.Require().NoError(client.SetCmdClientContextHandler(tc.ctxGen(), cmd)) - - out, err := clitestutil.ExecTestCLICmd(tc.ctxGen(), cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(s.encCfg.Codec.UnmarshalJSON(out.Bytes(), tc.expectResult)) - s.Require().NoError(err) - } - }) - } -} - -func (s *CLITestSuite) TestGetCmdQueryTotalSupply() { - cmd := cli.GetCmdQueryTotalSupply() - cmd.SetOutput(io.Discard) - - testCases := []struct { - name string - ctxGen func() client.Context - args []string - expectResult proto.Message - expectErr bool - }{ - { - "valid query", - func() client.Context { - bz, _ := s.encCfg.Codec.Marshal(&types.QueryTotalSupplyResponse{}) - c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ - Value: bz, - }) - return s.baseCtx.WithClient(c) - }, - []string{ - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - &types.QueryTotalSupplyResponse{}, - false, - }, - { - "valid query with denom", - func() client.Context { - bz, _ := s.encCfg.Codec.Marshal(&types.QuerySupplyOfResponse{ - Amount: sdk.Coin{}, - }) - c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ - Value: bz, - }) - return s.baseCtx.WithClient(c) - }, - []string{ - fmt.Sprintf("--%s=photon", cli.FlagDenom), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - &sdk.Coin{}, - false, - }, - { - "invalid query with denom", - func() client.Context { - c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ - Code: 1, - }) - return s.baseCtx.WithClient(c) - }, - []string{ - fmt.Sprintf("--%s=foo", cli.FlagDenom), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - nil, - true, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - ctx := svrcmd.CreateExecuteContext(context.Background()) - cmd.SetContext(ctx) - cmd.SetArgs(tc.args) - s.Require().NoError(client.SetCmdClientContextHandler(tc.ctxGen(), cmd)) - - out, err := clitestutil.ExecTestCLICmd(tc.ctxGen(), cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(s.encCfg.Codec.UnmarshalJSON(out.Bytes(), tc.expectResult)) - s.Require().NoError(err) - } - }) - } -} - -func (s *CLITestSuite) TestGetCmdQuerySendEnabled() { - cmd := cli.GetCmdQuerySendEnabled() - cmd.SetOutput(io.Discard) - - testCases := []struct { - name string - ctxGen func() client.Context - args []string - expectResult proto.Message - expectErr bool - }{ - { - "valid query", - func() client.Context { - bz, _ := s.encCfg.Codec.Marshal(&types.QuerySendEnabledResponse{ - SendEnabled: []*types.SendEnabled{}, - }) - c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ - Value: bz, - }) - return s.baseCtx.WithClient(c) - }, - []string{ - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - &types.QuerySendEnabledResponse{}, - false, - }, - { - "valid query with denoms", - func() client.Context { - bz, _ := s.encCfg.Codec.Marshal(&types.QuerySendEnabledResponse{ - SendEnabled: []*types.SendEnabled{}, - }) - c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ - Value: bz, - }) - return s.baseCtx.WithClient(c) - }, - []string{ - "photon", - "stake", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - &types.QuerySendEnabledResponse{}, - false, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - ctx := svrcmd.CreateExecuteContext(context.Background()) - - cmd.SetContext(ctx) - cmd.SetArgs(tc.args) - - s.Require().NoError(client.SetCmdClientContextHandler(tc.ctxGen(), cmd)) - - out, err := clitestutil.ExecTestCLICmd(tc.ctxGen(), cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(s.encCfg.Codec.UnmarshalJSON(out.Bytes(), tc.expectResult)) - s.Require().NoError(err) - } - }) - } -} diff --git a/x/bank/client/cli/suite_test.go b/x/bank/client/cli/suite_test.go deleted file mode 100644 index cf68074bf59f..000000000000 --- a/x/bank/client/cli/suite_test.go +++ /dev/null @@ -1,39 +0,0 @@ -package cli_test - -import ( - "io" - "testing" - - rpcclientmock "github.com/cometbft/cometbft/rpc/client/mock" - "github.com/stretchr/testify/suite" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/crypto/keyring" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - testutilmod "github.com/cosmos/cosmos-sdk/types/module/testutil" - "github.com/cosmos/cosmos-sdk/x/bank" -) - -type CLITestSuite struct { - suite.Suite - - kr keyring.Keyring - encCfg testutilmod.TestEncodingConfig - baseCtx client.Context -} - -func TestMigrateTestSuite(t *testing.T) { - suite.Run(t, new(CLITestSuite)) -} - -func (s *CLITestSuite) SetupSuite() { - s.encCfg = testutilmod.MakeTestEncodingConfig(bank.AppModuleBasic{}) - s.kr = keyring.NewInMemory(s.encCfg.Codec) - s.baseCtx = client.Context{}. - WithKeyring(s.kr). - WithTxConfig(s.encCfg.TxConfig). - WithCodec(s.encCfg.Codec). - WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}). - WithAccountRetriever(client.MockAccountRetriever{}). - WithOutput(io.Discard) -} diff --git a/x/bank/client/cli/tx.go b/x/bank/client/cli/tx.go index 022cbbcf03ea..6b7e40554a06 100644 --- a/x/bank/client/cli/tx.go +++ b/x/bank/client/cli/tx.go @@ -3,14 +3,16 @@ package cli import ( "fmt" + "github.com/spf13/cobra" + "cosmossdk.io/core/address" sdkmath "cosmossdk.io/math" - "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/version" "github.com/cosmos/cosmos-sdk/x/bank/types" ) @@ -79,15 +81,16 @@ When using '--dry-run' a key name cannot be used, only a bech32 address. // For a better UX this command is limited to send funds from one account to two or more accounts. func NewMultiSendTxCmd(ac address.Codec) *cobra.Command { cmd := &cobra.Command{ - Use: "multi-send [from_key_or_address] [to_address_1, to_address_2, ...] [amount]", + Use: "multi-send [from_key_or_address] [to_address_1 to_address_2 ...] [amount]", Short: "Send funds from one account to two or more accounts.", Long: `Send funds from one account to two or more accounts. By default, sends the [amount] to each address of the list. Using the '--split' flag, the [amount] is split equally between the addresses. -Note, the '--from' flag is ignored as it is implied from [from_key_or_address]. -When using '--dry-run' a key name cannot be used, only a bech32 address. -`, - Args: cobra.MinimumNArgs(4), +Note, the '--from' flag is ignored as it is implied from [from_key_or_address] and +separate addresses with space. +When using '--dry-run' a key name cannot be used, only a bech32 address.`, + Example: fmt.Sprintf("%s tx bank multi-send cosmos1... cosmos1... cosmos1... cosmos1... 10stake", version.AppName), + Args: cobra.MinimumNArgs(4), RunE: func(cmd *cobra.Command, args []string) error { cmd.Flags().Set(flags.FlagFrom, args[0]) clientCtx, err := client.GetClientTxContext(cmd) diff --git a/x/bank/client/cli/tx_test.go b/x/bank/client/cli/tx_test.go index 1391ba835298..a9a5280f0bff 100644 --- a/x/bank/client/cli/tx_test.go +++ b/x/bank/client/cli/tx_test.go @@ -4,19 +4,50 @@ import ( "context" "fmt" "io" + "testing" + + rpcclientmock "github.com/cometbft/cometbft/rpc/client/mock" + "github.com/stretchr/testify/suite" sdkmath "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/codec/address" + "github.com/cosmos/cosmos-sdk/crypto/keyring" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" "github.com/cosmos/cosmos-sdk/testutil" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" sdk "github.com/cosmos/cosmos-sdk/types" + testutilmod "github.com/cosmos/cosmos-sdk/types/module/testutil" + "github.com/cosmos/cosmos-sdk/x/bank" "github.com/cosmos/cosmos-sdk/x/bank/client/cli" ) +type CLITestSuite struct { + suite.Suite + + kr keyring.Keyring + encCfg testutilmod.TestEncodingConfig + baseCtx client.Context +} + +func TestCLITestSuite(t *testing.T) { + suite.Run(t, new(CLITestSuite)) +} + +func (s *CLITestSuite) SetupSuite() { + s.encCfg = testutilmod.MakeTestEncodingConfig(bank.AppModuleBasic{}) + s.kr = keyring.NewInMemory(s.encCfg.Codec) + s.baseCtx = client.Context{}. + WithKeyring(s.kr). + WithTxConfig(s.encCfg.TxConfig). + WithCodec(s.encCfg.Codec). + WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}). + WithAccountRetriever(client.MockAccountRetriever{}). + WithOutput(io.Discard) +} + func (s *CLITestSuite) TestSendTxCmd() { accounts := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) cmd := cli.NewSendTxCmd(address.NewBech32Codec("cosmos")) diff --git a/x/bank/exported/exported.go b/x/bank/exported/exported.go index 60e6872e12c5..6ffabfe5831d 100644 --- a/x/bank/exported/exported.go +++ b/x/bank/exported/exported.go @@ -21,5 +21,6 @@ type ( // NOTE: This is used solely for migration of x/params managed parameters. Subspace interface { GetParamSet(ctx sdk.Context, ps ParamSet) + Get(ctx sdk.Context, key []byte, ptr any) } ) diff --git a/x/bank/keeper/collections_test.go b/x/bank/keeper/collections_test.go new file mode 100644 index 000000000000..97b5e3e8bca0 --- /dev/null +++ b/x/bank/keeper/collections_test.go @@ -0,0 +1,85 @@ +package keeper_test + +import ( + "testing" + + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmttime "github.com/cometbft/cometbft/types/time" + "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" + + "cosmossdk.io/collections" + "cosmossdk.io/log" + "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" + + "github.com/cosmos/cosmos-sdk/codec/address" + "github.com/cosmos/cosmos-sdk/runtime" + "github.com/cosmos/cosmos-sdk/testutil" + sdk "github.com/cosmos/cosmos-sdk/types" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/bank/keeper" + banktestutil "github.com/cosmos/cosmos-sdk/x/bank/testutil" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" +) + +func TestBankStateCompatibility(t *testing.T) { + key := storetypes.NewKVStoreKey(banktypes.StoreKey) + testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) + ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{Time: cmttime.Now()}) + encCfg := moduletestutil.MakeTestEncodingConfig() + + storeService := runtime.NewKVStoreService(key) + + // gomock initializations + ctrl := gomock.NewController(t) + authKeeper := banktestutil.NewMockAccountKeeper(ctrl) + authKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec("cosmos")).AnyTimes() + + k := keeper.NewBaseKeeper( + encCfg.Codec, + storeService, + authKeeper, + map[string]bool{accAddrs[4].String(): true}, + authtypes.NewModuleAddress("gov").String(), + log.NewNopLogger(), + ) + + // test we can decode balances without problems + // using the old value format of the denom to address index + bankDenomAddressLegacyIndexValue := []byte{0} // taken from: https://github.com/cosmos/cosmos-sdk/blob/v0.47.3/x/bank/keeper/send.go#L361 + rawKey, err := collections.EncodeKeyWithPrefix( + banktypes.DenomAddressPrefix, + k.Balances.Indexes.Denom.KeyCodec(), + collections.Join("atom", sdk.AccAddress("test")), + ) + require.NoError(t, err) + // we set the index key to the old value. + require.NoError(t, storeService.OpenKVStore(ctx).Set(rawKey, bankDenomAddressLegacyIndexValue)) + + // test walking is ok + err = k.Balances.Indexes.Denom.Walk(ctx, nil, func(indexingKey string, indexedKey sdk.AccAddress) (stop bool, err error) { + require.Equal(t, indexedKey, sdk.AccAddress("test")) + require.Equal(t, indexingKey, "atom") + return true, nil + }) + require.NoError(t, err) + + // test matching is also ok + iter, err := k.Balances.Indexes.Denom.MatchExact(ctx, "atom") + require.NoError(t, err) + defer iter.Close() + pks, err := iter.PrimaryKeys() + require.NoError(t, err) + require.Len(t, pks, 1) + require.Equal(t, pks[0], collections.Join(sdk.AccAddress("test"), "atom")) + + // assert the index value will be updated to the new format + err = k.Balances.Indexes.Denom.Reference(ctx, collections.Join(sdk.AccAddress("test"), "atom"), math.ZeroInt(), nil) + require.NoError(t, err) + + newRawValue, err := storeService.OpenKVStore(ctx).Get(rawKey) + require.NoError(t, err) + require.Equal(t, []byte{}, newRawValue) +} diff --git a/x/bank/keeper/export_test.go b/x/bank/keeper/export_test.go new file mode 100644 index 000000000000..91960e9a8a82 --- /dev/null +++ b/x/bank/keeper/export_test.go @@ -0,0 +1,14 @@ +package keeper + +import "github.com/cosmos/cosmos-sdk/x/bank/types" + +// This file exists in the keeper package to expose some private things +// for the purpose of testing in the keeper_test package. + +func (k BaseSendKeeper) SetSendRestriction(restriction types.SendRestrictionFn) { + k.sendRestriction.fn = restriction +} + +func (k BaseSendKeeper) GetSendRestrictionFn() types.SendRestrictionFn { + return k.sendRestriction.fn +} diff --git a/x/bank/keeper/grpc_query.go b/x/bank/keeper/grpc_query.go index ae2e6782766b..c172fb24e649 100644 --- a/x/bank/keeper/grpc_query.go +++ b/x/bank/keeper/grpc_query.go @@ -3,11 +3,11 @@ package keeper import ( "context" - "cosmossdk.io/collections" - "cosmossdk.io/math" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "cosmossdk.io/collections" + "cosmossdk.io/math" "cosmossdk.io/store/prefix" "github.com/cosmos/cosmos-sdk/runtime" @@ -59,19 +59,20 @@ func (k BaseKeeper) AllBalances(ctx context.Context, req *types.QueryAllBalances } sdkCtx := sdk.UnwrapSDKContext(ctx) - - balances := sdk.NewCoins() - - _, pageRes, err := query.CollectionFilteredPaginate(ctx, k.Balances, req.Pagination, func(key collections.Pair[sdk.AccAddress, string], value math.Int) (include bool, err error) { - denom := key.K2() - if req.ResolveDenom { - if metadata, ok := k.GetDenomMetaData(sdkCtx, denom); ok { - denom = metadata.Display + balances, pageRes, err := query.CollectionPaginate( + ctx, + k.Balances, + req.Pagination, + func(key collections.Pair[sdk.AccAddress, string], value math.Int) (sdk.Coin, error) { + if req.ResolveDenom { + if metadata, ok := k.GetDenomMetaData(sdkCtx, key.K2()); ok { + return sdk.NewCoin(metadata.Display, value), nil + } } - } - balances = append(balances, sdk.NewCoin(denom, value)) - return false, nil // we don't include results because we're appending them here. - }, query.WithCollectionPaginationPairPrefix[sdk.AccAddress, string](addr)) + return sdk.NewCoin(key.K2(), value), nil + }, + query.WithCollectionPaginationPairPrefix[sdk.AccAddress, string](addr), + ) if err != nil { return nil, status.Errorf(codes.InvalidArgument, "paginate: %v", err) } @@ -93,12 +94,10 @@ func (k BaseKeeper) SpendableBalances(ctx context.Context, req *types.QuerySpend sdkCtx := sdk.UnwrapSDKContext(ctx) - balances := sdk.NewCoins() zeroAmt := math.ZeroInt() - _, pageRes, err := query.CollectionFilteredPaginate(ctx, k.Balances, req.Pagination, func(key collections.Pair[sdk.AccAddress, string], _ math.Int) (include bool, err error) { - balances = append(balances, sdk.NewCoin(key.K2(), zeroAmt)) - return false, nil // not including results as they're appended here + balances, pageRes, err := query.CollectionPaginate(ctx, k.Balances, req.Pagination, func(key collections.Pair[sdk.AccAddress, string], _ math.Int) (coin sdk.Coin, err error) { + return sdk.NewCoin(key.K2(), zeroAmt), nil }, query.WithCollectionPaginationPairPrefix[sdk.AccAddress, string](addr)) if err != nil { return nil, status.Errorf(codes.InvalidArgument, "paginate: %v", err) @@ -224,8 +223,24 @@ func (k BaseKeeper) DenomMetadata(c context.Context, req *types.QueryDenomMetada }, nil } +// DenomMetadataByQueryString is identical to DenomMetadata query, but receives request via query string. +func (k BaseKeeper) DenomMetadataByQueryString(c context.Context, req *types.QueryDenomMetadataByQueryStringRequest) (*types.QueryDenomMetadataByQueryStringResponse, error) { + if req == nil { + return nil, status.Errorf(codes.InvalidArgument, "empty request") + } + + res, err := k.DenomMetadata(c, &types.QueryDenomMetadataRequest{ + Denom: req.Denom, + }) + if err != nil { + return nil, err + } + + return &types.QueryDenomMetadataByQueryStringResponse{Metadata: res.Metadata}, nil +} + func (k BaseKeeper) DenomOwners( - goCtx context.Context, + ctx context.Context, req *types.QueryDenomOwnersRequest, ) (*types.QueryDenomOwnersResponse, error) { if req == nil { @@ -236,19 +251,16 @@ func (k BaseKeeper) DenomOwners( return nil, status.Error(codes.InvalidArgument, err.Error()) } - var denomOwners []*types.DenomOwner - - _, pageRes, err := query.CollectionFilteredPaginate(goCtx, k.Balances.Indexes.Denom, req.Pagination, - func(key collections.Pair[string, sdk.AccAddress], value collections.NoValue) (include bool, err error) { - amt, err := k.Balances.Get(goCtx, collections.Join(key.K2(), req.Denom)) + denomOwners, pageRes, err := query.CollectionPaginate( + ctx, + k.Balances.Indexes.Denom, + req.Pagination, + func(key collections.Pair[string, sdk.AccAddress], value collections.NoValue) (*types.DenomOwner, error) { + amt, err := k.Balances.Get(ctx, collections.Join(key.K2(), req.Denom)) if err != nil { - return false, err + return nil, err } - denomOwners = append(denomOwners, &types.DenomOwner{ - Address: key.K2().String(), - Balance: sdk.NewCoin(req.Denom, amt), - }) - return false, nil + return &types.DenomOwner{Address: key.K2().String(), Balance: sdk.NewCoin(req.Denom, amt)}, nil }, query.WithCollectionPaginationPairPrefix[string, sdk.AccAddress](req.Denom), ) @@ -272,18 +284,35 @@ func (k BaseKeeper) SendEnabled(goCtx context.Context, req *types.QuerySendEnabl } } } else { - results, pageResp, err := query.CollectionPaginate[string, bool](ctx, k.BaseViewKeeper.SendEnabled, req.Pagination) + results, pageResp, err := query.CollectionPaginate( + ctx, + k.BaseViewKeeper.SendEnabled, + req.Pagination, func(key string, value bool) (*types.SendEnabled, error) { + return types.NewSendEnabled(key, value), nil + }, + ) if err != nil { return nil, status.Error(codes.Internal, err.Error()) } - for _, r := range results { - resp.SendEnabled = append(resp.SendEnabled, &types.SendEnabled{ - Denom: r.Key, - Enabled: r.Value, - }) - } + resp.SendEnabled = results resp.Pagination = pageResp } return resp, nil } + +// DenomOwnersByQuery is identical to DenomOwner query, but receives denom values via query string. +func (k BaseKeeper) DenomOwnersByQuery(ctx context.Context, req *types.QueryDenomOwnersByQueryRequest) (*types.QueryDenomOwnersByQueryResponse, error) { + if req == nil { + return nil, status.Errorf(codes.InvalidArgument, "empty request") + } + resp, err := k.DenomOwners(ctx, &types.QueryDenomOwnersRequest{ + Denom: req.Denom, + Pagination: req.Pagination, + }) + if err != nil { + return nil, err + } + + return &types.QueryDenomOwnersByQueryResponse{DenomOwners: resp.DenomOwners, Pagination: resp.Pagination}, nil +} diff --git a/x/bank/keeper/grpc_query_test.go b/x/bank/keeper/grpc_query_test.go index 1190ab522d99..b17111db01b0 100644 --- a/x/bank/keeper/grpc_query_test.go +++ b/x/bank/keeper/grpc_query_test.go @@ -19,31 +19,81 @@ func (suite *KeeperTestSuite) TestQueryBalance() { ctx, queryClient := suite.ctx, suite.queryClient _, _, addr := testdata.KeyTestPubAddr() - _, err := queryClient.Balance(gocontext.Background(), &types.QueryBalanceRequest{}) - suite.Require().Error(err) - - _, err = queryClient.Balance(gocontext.Background(), &types.QueryBalanceRequest{Address: addr.String()}) - suite.Require().Error(err) - - req := types.NewQueryBalanceRequest(addr, "0000") - _, err = queryClient.Balance(gocontext.Background(), req) - suite.Require().Error(err) + origCoins := sdk.NewCoins(newBarCoin(30)) + suite.mockFundAccount(addr) + suite.Require().NoError(testutil.FundAccount(ctx, suite.bankKeeper, addr, origCoins)) - req = types.NewQueryBalanceRequest(addr, fooDenom) - res, err := queryClient.Balance(gocontext.Background(), req) - suite.Require().NoError(err) - suite.Require().NotNil(res) - suite.True(res.Balance.IsZero()) + testCases := []struct { + name string + req *types.QueryBalanceRequest + expectErrMsg string + postFn func(res *types.QueryBalanceResponse) + }{ + { + "empty request", + &types.QueryBalanceRequest{}, + "invalid denom", + nil, + }, + { + "invalid denom", + types.NewQueryBalanceRequest(addr, "0000"), + "invalid denom", + nil, + }, + { + "empty address", + types.NewQueryBalanceRequest(sdk.AccAddress{}, barDenom), + "empty address string is not allowed", + nil, + }, + { + "invalid address", + &types.QueryBalanceRequest{Address: "foo", Denom: barDenom}, + "invalid address", + nil, + }, + { + "query missing denom", + &types.QueryBalanceRequest{Address: addr.String()}, + "invalid denom", + nil, + }, + { + "valid query empty result", + types.NewQueryBalanceRequest(addr, fooDenom), + "", + func(res *types.QueryBalanceResponse) { + suite.True(res.Balance.IsZero()) + }, + }, + { + "valid query", + types.NewQueryBalanceRequest(addr, barDenom), + "", + func(res *types.QueryBalanceResponse) { + suite.True(res.Balance.IsEqual(newBarCoin(30))) + }, + }, + } - origCoins := sdk.NewCoins(newFooCoin(50), newBarCoin(30)) + for _, tc := range testCases { + tc := tc - suite.mockFundAccount(addr) - suite.Require().NoError(testutil.FundAccount(ctx, suite.bankKeeper, addr, origCoins)) + suite.Run(tc.name, func() { + res, err := queryClient.Balance(gocontext.Background(), tc.req) + if tc.expectErrMsg == "" { + suite.Require().NoError(err) + suite.Require().NotNil(res) + } else { + suite.Require().ErrorContains(err, tc.expectErrMsg) + } - res, err = queryClient.Balance(gocontext.Background(), req) - suite.Require().NoError(err) - suite.Require().NotNil(res) - suite.True(res.Balance.IsEqual(newFooCoin(50))) + if tc.postFn != nil { + tc.postFn(res) + } + }) + } } func (suite *KeeperTestSuite) TestQueryAllBalances() { @@ -148,12 +198,13 @@ func (suite *KeeperTestSuite) TestSpendableBalances() { barCoins := newBarCoin(30) origCoins := sdk.NewCoins(fooCoins, barCoins) - vacc := vestingtypes.NewContinuousVestingAccount( + vacc, err := vestingtypes.NewContinuousVestingAccount( acc, sdk.NewCoins(fooCoins), ctx.BlockTime().Unix(), ctx.BlockTime().Add(time.Hour).Unix(), ) + suite.Require().NoError(err) suite.mockFundAccount(addr) suite.Require().NoError(testutil.FundAccount(suite.ctx, suite.bankKeeper, addr, origCoins)) @@ -195,12 +246,13 @@ func (suite *KeeperTestSuite) TestSpendableBalanceByDenom() { barCoins := newBarCoin(30) origCoins := sdk.NewCoins(fooCoins, barCoins) - vacc := vestingtypes.NewContinuousVestingAccount( + vacc, err := vestingtypes.NewContinuousVestingAccount( acc, sdk.NewCoins(fooCoins), ctx.BlockTime().Unix(), ctx.BlockTime().Add(time.Hour).Unix(), ) + suite.Require().NoError(err) suite.mockFundAccount(addr) suite.Require().NoError(testutil.FundAccount(suite.ctx, suite.bankKeeper, addr, origCoins)) @@ -229,13 +281,12 @@ func (suite *KeeperTestSuite) TestQueryTotalSupply() { ctx, queryClient := suite.ctx, suite.queryClient res, err := queryClient.TotalSupply(gocontext.Background(), &types.QueryTotalSupplyRequest{}) suite.Require().NoError(err) + suite.Require().NotNil(res) genesisSupply := res.Supply testCoins := sdk.NewCoins(sdk.NewInt64Coin("test", 400000000)) suite.mockMintCoins(mintAcc) - suite. - Require(). - NoError(suite.bankKeeper.MintCoins(ctx, minttypes.ModuleName, testCoins)) + suite.Require().NoError(suite.bankKeeper.MintCoins(ctx, minttypes.ModuleName, testCoins)) res, err = queryClient.TotalSupply(gocontext.Background(), &types.QueryTotalSupplyRequest{}) suite.Require().NoError(err) @@ -254,9 +305,7 @@ func (suite *KeeperTestSuite) TestQueryTotalSupplyOf() { expectedTotalSupply := sdk.NewCoins(test1Supply, test2Supply) suite.mockMintCoins(mintAcc) - suite. - Require(). - NoError(suite.bankKeeper.MintCoins(ctx, minttypes.ModuleName, expectedTotalSupply)) + suite.Require().NoError(suite.bankKeeper.MintCoins(ctx, minttypes.ModuleName, expectedTotalSupply)) _, err := queryClient.SupplyOf(gocontext.Background(), &types.QuerySupplyOfRequest{}) suite.Require().Error(err) @@ -264,8 +313,13 @@ func (suite *KeeperTestSuite) TestQueryTotalSupplyOf() { res, err := queryClient.SupplyOf(gocontext.Background(), &types.QuerySupplyOfRequest{Denom: test1Supply.Denom}) suite.Require().NoError(err) suite.Require().NotNil(res) - suite.Require().Equal(test1Supply, res.Amount) + + // total supply bogus denom + res, err = queryClient.SupplyOf(gocontext.Background(), &types.QuerySupplyOfRequest{Denom: "bogus"}) + suite.Require().NoError(err) + suite.Require().NotNil(res) + suite.Require().Equal(sdk.NewInt64Coin("bogus", 0), res.Amount) } func (suite *KeeperTestSuite) TestQueryParams() { @@ -275,10 +329,10 @@ func (suite *KeeperTestSuite) TestQueryParams() { suite.Require().Equal(suite.bankKeeper.GetParams(suite.ctx), res.GetParams()) } -func (suite *KeeperTestSuite) QueryDenomsMetadataRequest() { +func (suite *KeeperTestSuite) TestQueryDenomsMetadata() { var ( req *types.QueryDenomsMetadataRequest - expMetadata = []types.Metadata{} + expMetadata = []types.Metadata(nil) ) testCases := []struct { @@ -377,7 +431,7 @@ func (suite *KeeperTestSuite) QueryDenomsMetadataRequest() { } } -func (suite *KeeperTestSuite) QueryDenomMetadataRequest() { +func (suite *KeeperTestSuite) TestQueryDenomMetadata() { var ( req *types.QueryDenomMetadataRequest expMetadata = types.Metadata{} @@ -407,7 +461,7 @@ func (suite *KeeperTestSuite) QueryDenomMetadataRequest() { { "success", func() { - expMetadata := types.Metadata{ + expMetadata = types.Metadata{ Description: "The native staking token of the Cosmos Hub.", DenomUnits: []*types.DenomUnit{ { @@ -454,6 +508,83 @@ func (suite *KeeperTestSuite) QueryDenomMetadataRequest() { } } +func (suite *KeeperTestSuite) TestQueryDenomMetadataByQueryStringRequest() { + var ( + req *types.QueryDenomMetadataByQueryStringRequest + expMetadata = types.Metadata{} + ) + + testCases := []struct { + msg string + malleate func() + expPass bool + }{ + { + "empty denom", + func() { + req = &types.QueryDenomMetadataByQueryStringRequest{} + }, + false, + }, + { + "not found denom", + func() { + req = &types.QueryDenomMetadataByQueryStringRequest{ + Denom: "foo", + } + }, + false, + }, + { + "success", + func() { + expMetadata = types.Metadata{ + Description: "The native staking token of the Cosmos Hub.", + DenomUnits: []*types.DenomUnit{ + { + Denom: "uatom", + Exponent: 0, + Aliases: []string{"microatom"}, + }, + { + Denom: "atom", + Exponent: 6, + Aliases: []string{"ATOM"}, + }, + }, + Base: "uatom", + Display: "atom", + } + + suite.bankKeeper.SetDenomMetaData(suite.ctx, expMetadata) + req = &types.QueryDenomMetadataByQueryStringRequest{ + Denom: expMetadata.Base, + } + }, + true, + }, + } + + for _, tc := range testCases { + suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { + suite.SetupTest() // reset + + tc.malleate() + ctx := suite.ctx + + res, err := suite.queryClient.DenomMetadataByQueryString(ctx, req) + + if tc.expPass { + suite.Require().NoError(err) + suite.Require().NotNil(res) + suite.Require().Equal(expMetadata, res.Metadata) + } else { + suite.Require().Error(err) + } + }) + } +} + func (suite *KeeperTestSuite) TestGRPCDenomOwners() { ctx := suite.ctx @@ -674,3 +805,111 @@ func (suite *KeeperTestSuite) TestQuerySendEnabled() { }) } } + +func (suite *KeeperTestSuite) TestGRPCDenomOwnersByQuery() { + ctx := suite.ctx + + keeper := suite.bankKeeper + + suite.mockMintCoins(mintAcc) + suite.Require().NoError(keeper.MintCoins(ctx, minttypes.ModuleName, initCoins)) + denom := "ibc/123123213123" + newCoins := sdk.NewCoins(sdk.NewCoin(denom, initTokens)) + suite.mockMintCoins(mintAcc) + suite.Require().NoError(keeper.MintCoins(ctx, minttypes.ModuleName, newCoins)) + + for i := 0; i < 10; i++ { + addr := sdk.AccAddress(fmt.Sprintf("account-%d", i)) + + bal := sdk.NewCoins(sdk.NewCoin( + sdk.DefaultBondDenom, + sdk.TokensFromConsensusPower(initialPower/10, sdk.DefaultPowerReduction), + )) + suite.mockSendCoinsFromModuleToAccount(mintAcc, addr) + suite.Require().NoError(keeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, addr, bal)) + } + + testCases := map[string]struct { + req *types.QueryDenomOwnersByQueryRequest + expPass bool + numAddrs int + hasNext bool + total uint64 + }{ + "empty request": { + req: &types.QueryDenomOwnersByQueryRequest{}, + expPass: false, + }, + "invalid denom": { + req: &types.QueryDenomOwnersByQueryRequest{ + Denom: "foo", + }, + expPass: true, + numAddrs: 0, + hasNext: false, + total: 0, + }, + "valid request - page 1": { + req: &types.QueryDenomOwnersByQueryRequest{ + Denom: sdk.DefaultBondDenom, + Pagination: &query.PageRequest{ + Limit: 6, + CountTotal: true, + }, + }, + expPass: true, + numAddrs: 6, + hasNext: true, + total: 10, + }, + "valid request - page 2": { + req: &types.QueryDenomOwnersByQueryRequest{ + Denom: sdk.DefaultBondDenom, + Pagination: &query.PageRequest{ + Offset: 6, + Limit: 10, + CountTotal: true, + }, + }, + expPass: true, + numAddrs: 4, + hasNext: false, + total: 10, + }, + "valid request for query": { + req: &types.QueryDenomOwnersByQueryRequest{ + Denom: denom, + Pagination: &query.PageRequest{ + Limit: 6, + CountTotal: true, + }, + }, + expPass: true, + numAddrs: 1, + hasNext: false, + total: 1, + }, + } + + for name, tc := range testCases { + suite.Run(name, func() { + resp, err := suite.queryClient.DenomOwnersByQuery(gocontext.Background(), tc.req) + if tc.expPass { + suite.NoError(err) + suite.NotNil(resp) + suite.Len(resp.DenomOwners, tc.numAddrs) + suite.Equal(tc.total, resp.Pagination.Total) + + if tc.hasNext { + suite.NotNil(resp.Pagination.NextKey) + } else { + suite.Nil(resp.Pagination.NextKey) + } + } else { + suite.Require().Error(err) + } + }) + } + + suite.Require().True(true) +} diff --git a/x/bank/keeper/invariants.go b/x/bank/keeper/invariants.go deleted file mode 100644 index 72240a1ac387..000000000000 --- a/x/bank/keeper/invariants.go +++ /dev/null @@ -1,73 +0,0 @@ -package keeper - -import ( - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" - "github.com/cosmos/cosmos-sdk/x/bank/types" -) - -// RegisterInvariants registers the bank module invariants -func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper) { - ir.RegisterRoute(types.ModuleName, "nonnegative-outstanding", NonnegativeBalanceInvariant(k)) - ir.RegisterRoute(types.ModuleName, "total-supply", TotalSupply(k)) -} - -// AllInvariants runs all invariants of the X/bank module. -func AllInvariants(k Keeper) sdk.Invariant { - return func(ctx sdk.Context) (string, bool) { - return TotalSupply(k)(ctx) - } -} - -// NonnegativeBalanceInvariant checks that all accounts in the application have non-negative balances -func NonnegativeBalanceInvariant(k ViewKeeper) sdk.Invariant { - return func(ctx sdk.Context) (string, bool) { - var ( - msg string - count int - ) - - k.IterateAllBalances(ctx, func(addr sdk.AccAddress, balance sdk.Coin) bool { - if balance.IsNegative() { - count++ - msg += fmt.Sprintf("\t%s has a negative balance of %s\n", addr, balance) - } - - return false - }) - - broken := count != 0 - - return sdk.FormatInvariant( - types.ModuleName, "nonnegative-outstanding", - fmt.Sprintf("amount of negative balances found %d\n%s", count, msg), - ), broken - } -} - -// TotalSupply checks that the total supply reflects all the coins held in accounts -func TotalSupply(k Keeper) sdk.Invariant { - return func(ctx sdk.Context) (string, bool) { - expectedTotal := sdk.Coins{} - supply, _, err := k.GetPaginatedTotalSupply(ctx, &query.PageRequest{Limit: query.PaginationMaxLimit}) - if err != nil { - return sdk.FormatInvariant(types.ModuleName, "query supply", - fmt.Sprintf("error querying total supply %v", err)), false - } - - k.IterateAllBalances(ctx, func(_ sdk.AccAddress, balance sdk.Coin) bool { - expectedTotal = expectedTotal.Add(balance) - return false - }) - - broken := !expectedTotal.Equal(supply) - - return sdk.FormatInvariant(types.ModuleName, "total supply", - fmt.Sprintf( - "\tsum of accounts coins: %v\n"+ - "\tsupply.Total: %v\n", - expectedTotal, supply)), broken - } -} diff --git a/x/bank/keeper/keeper.go b/x/bank/keeper/keeper.go index 008e08e9a9cc..bfa45d23f64e 100644 --- a/x/bank/keeper/keeper.go +++ b/x/bank/keeper/keeper.go @@ -2,17 +2,13 @@ package keeper import ( "context" - "errors" "fmt" - "cosmossdk.io/collections" - "cosmossdk.io/core/store" + errorsmod "cosmossdk.io/errors" "cosmossdk.io/log" "cosmossdk.io/math" - errorsmod "cosmossdk.io/errors" - "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -27,7 +23,7 @@ var _ Keeper = (*BaseKeeper)(nil) // between accounts. type Keeper interface { SendKeeper - WithMintCoinsRestriction(MintingRestrictionFn) BaseKeeper + WithMintCoinsRestriction(types.MintingRestrictionFn) BaseKeeper InitGenesis(context.Context, *types.GenesisState) ExportGenesis(context.Context) *types.GenesisState @@ -63,22 +59,18 @@ type BaseKeeper struct { ak types.AccountKeeper cdc codec.BinaryCodec storeService store.KVStoreService - mintCoinsRestrictionFn MintingRestrictionFn + mintCoinsRestrictionFn types.MintingRestrictionFn logger log.Logger } -type MintingRestrictionFn func(ctx context.Context, coins sdk.Coins) error - // GetPaginatedTotalSupply queries for the supply, ignoring 0 coins, with a given pagination func (k BaseKeeper) GetPaginatedTotalSupply(ctx context.Context, pagination *query.PageRequest) (sdk.Coins, *query.PageResponse, error) { - results, pageResp, err := query.CollectionPaginate[string, math.Int](ctx, k.Supply, pagination) + coins, pageResp, err := query.CollectionPaginate(ctx, k.Supply, pagination, func(key string, value math.Int) (sdk.Coin, error) { + return sdk.NewCoin(key, value), nil + }) if err != nil { return nil, nil, err } - coins := sdk.NewCoins() - for _, res := range results { - coins = coins.Add(sdk.NewCoin(res.Key, res.Value)) - } return coins, pageResp, nil } @@ -109,7 +101,7 @@ func NewBaseKeeper( ak: ak, cdc: cdc, storeService: storeService, - mintCoinsRestrictionFn: func(ctx context.Context, coins sdk.Coins) error { return nil }, + mintCoinsRestrictionFn: types.NoOpMintingRestrictionFn, logger: logger, } } @@ -119,19 +111,8 @@ func NewBaseKeeper( // Previous restriction functions can be nested as such: // // bankKeeper.WithMintCoinsRestriction(restriction1).WithMintCoinsRestriction(restriction2) -func (k BaseKeeper) WithMintCoinsRestriction(check MintingRestrictionFn) BaseKeeper { - oldRestrictionFn := k.mintCoinsRestrictionFn - k.mintCoinsRestrictionFn = func(ctx context.Context, coins sdk.Coins) error { - err := check(ctx, coins) - if err != nil { - return err - } - err = oldRestrictionFn(ctx, coins) - if err != nil { - return err - } - return nil - } +func (k BaseKeeper) WithMintCoinsRestriction(check types.MintingRestrictionFn) BaseKeeper { + k.mintCoinsRestrictionFn = check.Then(k.mintCoinsRestrictionFn) return k } @@ -262,7 +243,7 @@ func (k BaseKeeper) IterateAllDenomMetaData(ctx context.Context, cb func(types.M err := k.BaseViewKeeper.DenomMetadata.Walk(ctx, nil, func(_ string, metadata types.Metadata) (stop bool, err error) { return cb(metadata), nil }) - if err != nil && !errors.Is(err, collections.ErrInvalidIterator) { + if err != nil { panic(err) } } @@ -483,7 +464,7 @@ func (k BaseViewKeeper) IterateTotalSupply(ctx context.Context, cb func(sdk.Coin err := k.Supply.Walk(ctx, nil, func(s string, m math.Int) (bool, error) { return cb(sdk.NewCoin(s, m)), nil }) - if err != nil && !errors.Is(err, collections.ErrInvalidIterator) { + if err != nil { panic(err) } } diff --git a/x/bank/keeper/keeper_test.go b/x/bank/keeper/keeper_test.go index f28346ea2925..38ab8aa3571a 100644 --- a/x/bank/keeper/keeper_test.go +++ b/x/bank/keeper/keeper_test.go @@ -4,19 +4,21 @@ import ( "context" "crypto/sha256" "encoding/hex" + "errors" "fmt" "strings" "testing" "time" - "cosmossdk.io/log" - "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" cmttime "github.com/cometbft/cometbft/types/time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" + "go.uber.org/mock/gomock" + errorsmod "cosmossdk.io/errors" + "cosmossdk.io/log" + "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/baseapp" @@ -24,6 +26,7 @@ import ( "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" "github.com/cosmos/cosmos-sdk/types/query" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -50,7 +53,7 @@ const ( var ( holderAcc = authtypes.NewEmptyModuleAccount(holder) - burnerAcc = authtypes.NewEmptyModuleAccount(authtypes.Burner, authtypes.Burner) + burnerAcc = authtypes.NewEmptyModuleAccount(authtypes.Burner, authtypes.Burner, authtypes.Staking) minterAcc = authtypes.NewEmptyModuleAccount(authtypes.Minter, authtypes.Minter) mintAcc = authtypes.NewEmptyModuleAccount(minttypes.ModuleName, authtypes.Minter) multiPermAcc = authtypes.NewEmptyModuleAccount(multiPerm, authtypes.Burner, authtypes.Minter, authtypes.Staking) @@ -220,6 +223,16 @@ func (suite *KeeperTestSuite) mockSpendableCoins(ctx sdk.Context, acc sdk.Accoun suite.authKeeper.EXPECT().GetAccount(ctx, acc.GetAddress()).Return(acc) } +func (suite *KeeperTestSuite) mockDelegateCoinsFromAccountToModule(acc *authtypes.BaseAccount, moduleAcc *authtypes.ModuleAccount) { + suite.authKeeper.EXPECT().GetModuleAccount(suite.ctx, moduleAcc.Name).Return(moduleAcc) + suite.mockDelegateCoins(suite.ctx, acc, moduleAcc) +} + +func (suite *KeeperTestSuite) mockUndelegateCoinsFromModuleToAccount(moduleAcc *authtypes.ModuleAccount, accAddr *authtypes.BaseAccount) { + suite.authKeeper.EXPECT().GetModuleAccount(suite.ctx, moduleAcc.Name).Return(moduleAcc) + suite.mockUnDelegateCoins(suite.ctx, accAddr, moduleAcc) +} + func (suite *KeeperTestSuite) mockDelegateCoins(ctx context.Context, acc, mAcc sdk.AccountI) { vacc, ok := acc.(banktypes.VestingAccount) if ok { @@ -239,6 +252,64 @@ func (suite *KeeperTestSuite) mockUnDelegateCoins(ctx context.Context, acc, mAcc suite.authKeeper.EXPECT().GetAccount(ctx, mAcc.GetAddress()).Return(mAcc) } +func (suite *KeeperTestSuite) TestAppendSendRestriction() { + var calls []int + testRestriction := func(index int) banktypes.SendRestrictionFn { + return func(_ context.Context, _, _ sdk.AccAddress, _ sdk.Coins) (sdk.AccAddress, error) { + calls = append(calls, index) + return nil, nil + } + } + + bk := suite.bankKeeper + + // Initial append of the test restriction. + bk.SetSendRestriction(nil) + bk.AppendSendRestriction(testRestriction(1)) + _, _ = bk.GetSendRestrictionFn()(suite.ctx, nil, nil, nil) + suite.Require().Equal([]int{1}, calls, "restriction calls after first append") + + // Append the test restriction again. + calls = nil + bk.AppendSendRestriction(testRestriction(2)) + _, _ = bk.GetSendRestrictionFn()(suite.ctx, nil, nil, nil) + suite.Require().Equal([]int{1, 2}, calls, "restriction calls after second append") + + // make sure the original bank keeper has the restrictions too. + calls = nil + _, _ = suite.bankKeeper.GetSendRestrictionFn()(suite.ctx, nil, nil, nil) + suite.Require().Equal([]int{1, 2}, calls, "restriction calls from original bank keeper") +} + +func (suite *KeeperTestSuite) TestPrependSendRestriction() { + var calls []int + testRestriction := func(index int) banktypes.SendRestrictionFn { + return func(_ context.Context, _, _ sdk.AccAddress, _ sdk.Coins) (sdk.AccAddress, error) { + calls = append(calls, index) + return nil, nil + } + } + + bk := suite.bankKeeper + + // Initial append of the test restriction. + bk.SetSendRestriction(nil) + bk.PrependSendRestriction(testRestriction(1)) + _, _ = bk.GetSendRestrictionFn()(suite.ctx, nil, nil, nil) + suite.Require().Equal([]int{1}, calls, "restriction calls after first append") + + // Append the test restriction again. + calls = nil + bk.PrependSendRestriction(testRestriction(2)) + _, _ = bk.GetSendRestrictionFn()(suite.ctx, nil, nil, nil) + suite.Require().Equal([]int{2, 1}, calls, "restriction calls after second append") + + // make sure the original bank keeper has the restrictions too. + calls = nil + _, _ = suite.bankKeeper.GetSendRestrictionFn()(suite.ctx, nil, nil, nil) + suite.Require().Equal([]int{2, 1}, calls, "restriction calls from original bank keeper") +} + func (suite *KeeperTestSuite) TestGetAuthority() { storeService := runtime.NewKVStoreService(storetypes.NewKVStoreKey(banktypes.StoreKey)) NewKeeperWithAuthority := func(authority string) keeper.BaseKeeper { @@ -316,6 +387,67 @@ func (suite *KeeperTestSuite) TestSendCoinsFromModuleToAccount_Blocklist() { )) } +func (suite *KeeperTestSuite) TestSupply_DelegateUndelegateCoins() { + ctx := suite.ctx + require := suite.Require() + authKeeper, keeper := suite.authKeeper, suite.bankKeeper + + // set initial balances + suite.mockMintCoins(mintAcc) + require.NoError(keeper.MintCoins(ctx, minttypes.ModuleName, initCoins)) + + suite.mockSendCoinsFromModuleToAccount(mintAcc, holderAcc.GetAddress()) + require.NoError(keeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, holderAcc.GetAddress(), initCoins)) + + authKeeper.EXPECT().GetModuleAddress("").Return(nil) + require.Panics(func() { + _ = keeper.SendCoinsFromModuleToAccount(ctx, "", holderAcc.GetAddress(), initCoins) //nolint:errcheck // we're testing for a panic, not an error + }) + + authKeeper.EXPECT().GetModuleAddress(burnerAcc.Name).Return(burnerAcc.GetAddress()) + authKeeper.EXPECT().GetModuleAccount(ctx, "").Return(nil) + require.Panics(func() { + _ = keeper.SendCoinsFromModuleToModule(ctx, authtypes.Burner, "", initCoins) //nolint:errcheck // we're testing for a panic, not an error + }) + + authKeeper.EXPECT().GetModuleAddress("").Return(nil) + require.Panics(func() { + _ = keeper.SendCoinsFromModuleToAccount(ctx, "", baseAcc.GetAddress(), initCoins) //nolint:errcheck // we're testing for a panic, not an error + }) + + authKeeper.EXPECT().GetModuleAddress(holderAcc.Name).Return(holderAcc.GetAddress()) + authKeeper.EXPECT().GetAccount(suite.ctx, holderAcc.GetAddress()).Return(holderAcc) + require.Error( + keeper.SendCoinsFromModuleToAccount(ctx, holderAcc.GetName(), baseAcc.GetAddress(), initCoins.Add(initCoins...)), + ) + suite.mockSendCoinsFromModuleToModule(holderAcc, burnerAcc) + require.NoError( + keeper.SendCoinsFromModuleToModule(ctx, holderAcc.GetName(), authtypes.Burner, initCoins), + ) + + require.Equal(sdk.NewCoins(), keeper.GetAllBalances(ctx, holderAcc.GetAddress())) + require.Equal(initCoins, keeper.GetAllBalances(ctx, burnerAcc.GetAddress())) + + suite.mockSendCoinsFromModuleToAccount(burnerAcc, baseAcc.GetAddress()) + require.NoError( + keeper.SendCoinsFromModuleToAccount(ctx, authtypes.Burner, baseAcc.GetAddress(), initCoins), + ) + require.Equal(sdk.NewCoins(), keeper.GetAllBalances(ctx, burnerAcc.GetAddress())) + require.Equal(initCoins, keeper.GetAllBalances(ctx, baseAcc.GetAddress())) + + suite.mockDelegateCoinsFromAccountToModule(baseAcc, burnerAcc) + + sdkCtx := sdk.UnwrapSDKContext(ctx) + require.NoError(keeper.DelegateCoinsFromAccountToModule(sdkCtx, baseAcc.GetAddress(), authtypes.Burner, initCoins)) + require.Equal(sdk.NewCoins(), keeper.GetAllBalances(ctx, baseAcc.GetAddress())) + require.Equal(initCoins, keeper.GetAllBalances(ctx, burnerAcc.GetAddress())) + + suite.mockUndelegateCoinsFromModuleToAccount(burnerAcc, baseAcc) + require.NoError(keeper.UndelegateCoinsFromModuleToAccount(sdkCtx, authtypes.Burner, baseAcc.GetAddress(), initCoins)) + require.Equal(sdk.NewCoins(), keeper.GetAllBalances(ctx, burnerAcc.GetAddress())) + require.Equal(initCoins, keeper.GetAllBalances(ctx, baseAcc.GetAddress())) +} + func (suite *KeeperTestSuite) TestSupply_SendCoins() { ctx := suite.ctx require := suite.Require() @@ -576,6 +708,294 @@ func (suite *KeeperTestSuite) TestInputOutputCoins() { require.Equal(expected, acc3Balances) } +func (suite *KeeperTestSuite) TestInputOutputCoinsWithRestrictions() { + type restrictionArgs struct { + ctx context.Context + fromAddr sdk.AccAddress + toAddr sdk.AccAddress + amt sdk.Coins + } + var actualRestrictionArgs []*restrictionArgs + restrictionError := func(messages ...string) banktypes.SendRestrictionFn { + i := -1 + return func(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) (sdk.AccAddress, error) { + actualRestrictionArgs = append(actualRestrictionArgs, &restrictionArgs{ + ctx: ctx, + fromAddr: fromAddr, + toAddr: toAddr, + amt: amt, + }) + i++ + if i < len(messages) { + if len(messages[i]) > 0 { + return nil, errors.New(messages[i]) + } + } + return toAddr, nil + } + } + restrictionPassthrough := func() banktypes.SendRestrictionFn { + return func(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) (sdk.AccAddress, error) { + actualRestrictionArgs = append(actualRestrictionArgs, &restrictionArgs{ + ctx: ctx, + fromAddr: fromAddr, + toAddr: toAddr, + amt: amt, + }) + return toAddr, nil + } + } + restrictionNewTo := func(newToAddrs ...sdk.AccAddress) banktypes.SendRestrictionFn { + i := -1 + return func(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) (sdk.AccAddress, error) { + actualRestrictionArgs = append(actualRestrictionArgs, &restrictionArgs{ + ctx: ctx, + fromAddr: fromAddr, + toAddr: toAddr, + amt: amt, + }) + i++ + if i < len(newToAddrs) { + if len(newToAddrs[i]) > 0 { + return newToAddrs[i], nil + } + } + return toAddr, nil + } + } + type expBals struct { + from sdk.Coins + to1 sdk.Coins + to2 sdk.Coins + } + + setupCtx := suite.ctx + balances := sdk.NewCoins(newFooCoin(1000), newBarCoin(500)) + fromAddr := accAddrs[0] + fromAcc := authtypes.NewBaseAccountWithAddress(fromAddr) + inputAccs := []sdk.AccountI{fromAcc} + toAddr1 := accAddrs[1] + toAddr2 := accAddrs[2] + + suite.mockFundAccount(accAddrs[0]) + suite.Require().NoError(banktestutil.FundAccount(setupCtx, suite.bankKeeper, accAddrs[0], balances)) + + tests := []struct { + name string + fn banktypes.SendRestrictionFn + inputCoins sdk.Coins + outputs []banktypes.Output + outputAddrs []sdk.AccAddress + expArgs []*restrictionArgs + expErr string + expBals expBals + }{ + { + name: "nil restriction", + fn: nil, + inputCoins: sdk.NewCoins(newFooCoin(5)), + outputs: []banktypes.Output{{Address: toAddr1.String(), Coins: sdk.NewCoins(newFooCoin(5))}}, + outputAddrs: []sdk.AccAddress{toAddr1}, + expBals: expBals{ + from: sdk.NewCoins(newFooCoin(995), newBarCoin(500)), + to1: sdk.NewCoins(newFooCoin(5)), + to2: sdk.Coins{}, + }, + }, + { + name: "passthrough restriction single output", + fn: restrictionPassthrough(), + inputCoins: sdk.NewCoins(newFooCoin(10)), + outputs: []banktypes.Output{{Address: toAddr1.String(), Coins: sdk.NewCoins(newFooCoin(10))}}, + outputAddrs: []sdk.AccAddress{toAddr1}, + expArgs: []*restrictionArgs{ + { + ctx: suite.ctx, + fromAddr: fromAddr, + toAddr: toAddr1, + amt: sdk.NewCoins(newFooCoin(10)), + }, + }, + expBals: expBals{ + from: sdk.NewCoins(newFooCoin(985), newBarCoin(500)), + to1: sdk.NewCoins(newFooCoin(15)), + to2: sdk.Coins{}, + }, + }, + { + name: "new to restriction single output", + fn: restrictionNewTo(toAddr2), + inputCoins: sdk.NewCoins(newFooCoin(26)), + outputs: []banktypes.Output{{Address: toAddr1.String(), Coins: sdk.NewCoins(newFooCoin(26))}}, + outputAddrs: []sdk.AccAddress{toAddr2}, + expArgs: []*restrictionArgs{ + { + ctx: suite.ctx, + fromAddr: fromAddr, + toAddr: toAddr1, + amt: sdk.NewCoins(newFooCoin(26)), + }, + }, + expBals: expBals{ + from: sdk.NewCoins(newFooCoin(959), newBarCoin(500)), + to1: sdk.NewCoins(newFooCoin(15)), + to2: sdk.NewCoins(newFooCoin(26)), + }, + }, + { + name: "error restriction single output", + fn: restrictionError("restriction test error"), + inputCoins: sdk.NewCoins(newBarCoin(88)), + outputs: []banktypes.Output{{Address: toAddr1.String(), Coins: sdk.NewCoins(newBarCoin(88))}}, + outputAddrs: []sdk.AccAddress{}, + expArgs: []*restrictionArgs{ + { + ctx: suite.ctx, + fromAddr: fromAddr, + toAddr: toAddr1, + amt: sdk.NewCoins(newBarCoin(88)), + }, + }, + expErr: "restriction test error", + expBals: expBals{ + from: sdk.NewCoins(newFooCoin(959), newBarCoin(412)), + to1: sdk.NewCoins(newFooCoin(15)), + to2: sdk.NewCoins(newFooCoin(26)), + }, + }, + { + name: "passthrough restriction two outputs", + fn: restrictionPassthrough(), + inputCoins: sdk.NewCoins(newFooCoin(11), newBarCoin(12)), + outputs: []banktypes.Output{ + {Address: toAddr1.String(), Coins: sdk.NewCoins(newFooCoin(11))}, + {Address: toAddr2.String(), Coins: sdk.NewCoins(newBarCoin(12))}, + }, + outputAddrs: []sdk.AccAddress{toAddr1, toAddr2}, + expArgs: []*restrictionArgs{ + { + ctx: suite.ctx, + fromAddr: fromAddr, + toAddr: toAddr1, + amt: sdk.NewCoins(newFooCoin(11)), + }, + { + ctx: suite.ctx, + fromAddr: fromAddr, + toAddr: toAddr2, + amt: sdk.NewCoins(newBarCoin(12)), + }, + }, + expBals: expBals{ + from: sdk.NewCoins(newFooCoin(948), newBarCoin(400)), + to1: sdk.NewCoins(newFooCoin(26)), + to2: sdk.NewCoins(newFooCoin(26), newBarCoin(12)), + }, + }, + { + name: "error restriction two outputs error on second", + fn: restrictionError("", "second restriction error"), + inputCoins: sdk.NewCoins(newFooCoin(44)), + outputs: []banktypes.Output{ + {Address: toAddr1.String(), Coins: sdk.NewCoins(newFooCoin(12))}, + {Address: toAddr2.String(), Coins: sdk.NewCoins(newFooCoin(32))}, + }, + outputAddrs: []sdk.AccAddress{toAddr1}, + expArgs: []*restrictionArgs{ + { + ctx: suite.ctx, + fromAddr: fromAddr, + toAddr: toAddr1, + amt: sdk.NewCoins(newFooCoin(12)), + }, + { + ctx: suite.ctx, + fromAddr: fromAddr, + toAddr: toAddr2, + amt: sdk.NewCoins(newFooCoin(32)), + }, + }, + expErr: "second restriction error", + expBals: expBals{ + from: sdk.NewCoins(newFooCoin(904), newBarCoin(400)), + to1: sdk.NewCoins(newFooCoin(38)), + to2: sdk.NewCoins(newFooCoin(26), newBarCoin(12)), + }, + }, + { + name: "new to restriction two outputs", + fn: restrictionNewTo(toAddr2, toAddr1), + inputCoins: sdk.NewCoins(newBarCoin(35)), + outputs: []banktypes.Output{ + {Address: toAddr1.String(), Coins: sdk.NewCoins(newBarCoin(10))}, + {Address: toAddr2.String(), Coins: sdk.NewCoins(newBarCoin(25))}, + }, + outputAddrs: []sdk.AccAddress{toAddr1, toAddr2}, + expArgs: []*restrictionArgs{ + { + ctx: suite.ctx, + fromAddr: fromAddr, + toAddr: toAddr1, + amt: sdk.NewCoins(newBarCoin(10)), + }, + { + ctx: suite.ctx, + fromAddr: fromAddr, + toAddr: toAddr2, + amt: sdk.NewCoins(newBarCoin(25)), + }, + }, + expBals: expBals{ + from: sdk.NewCoins(newFooCoin(904), newBarCoin(365)), + to1: sdk.NewCoins(newFooCoin(38), newBarCoin(25)), + to2: sdk.NewCoins(newFooCoin(26), newBarCoin(22)), + }, + }, + } + + for _, tc := range tests { + suite.Run(tc.name, func() { + existingSendRestrictionFn := suite.bankKeeper.GetSendRestrictionFn() + defer suite.bankKeeper.SetSendRestriction(existingSendRestrictionFn) + actualRestrictionArgs = nil + suite.bankKeeper.SetSendRestriction(tc.fn) + ctx := suite.ctx + suite.mockInputOutputCoins(inputAccs, tc.outputAddrs) + input := banktypes.Input{ + Address: fromAddr.String(), + Coins: tc.inputCoins, + } + + var err error + testFunc := func() { + err = suite.bankKeeper.InputOutputCoins(ctx, input, tc.outputs) + } + suite.Require().NotPanics(testFunc, "InputOutputCoins") + if len(tc.expErr) > 0 { + suite.Assert().EqualError(err, tc.expErr, "InputOutputCoins error") + } else { + suite.Assert().NoError(err, "InputOutputCoins error") + } + if len(tc.expArgs) > 0 { + for i, expArgs := range tc.expArgs { + suite.Assert().Equal(expArgs.ctx, actualRestrictionArgs[i].ctx, "[%d] ctx provided to restriction", i) + suite.Assert().Equal(expArgs.fromAddr, actualRestrictionArgs[i].fromAddr, "[%d] fromAddr provided to restriction", i) + suite.Assert().Equal(expArgs.toAddr, actualRestrictionArgs[i].toAddr, "[%d] toAddr provided to restriction", i) + suite.Assert().Equal(expArgs.amt.String(), actualRestrictionArgs[i].amt.String(), "[%d] amt provided to restriction", i) + } + } else { + suite.Assert().Nil(actualRestrictionArgs, "args provided to a restriction") + } + fromBal := suite.bankKeeper.GetAllBalances(ctx, fromAddr) + suite.Assert().Equal(tc.expBals.from.String(), fromBal.String(), "fromAddr balance") + to1Bal := suite.bankKeeper.GetAllBalances(ctx, toAddr1) + suite.Assert().Equal(tc.expBals.to1.String(), to1Bal.String(), "toAddr1 balance") + to2Bal := suite.bankKeeper.GetAllBalances(ctx, toAddr2) + suite.Assert().Equal(tc.expBals.to2.String(), to2Bal.String(), "toAddr2 balance") + }) + } +} + func (suite *KeeperTestSuite) TestSendCoins() { ctx := suite.ctx require := suite.Require() @@ -613,6 +1033,184 @@ func (suite *KeeperTestSuite) TestSendCoins() { require.Equal(newBarCoin(25), coins[0], "expected only bar coins in the account balance, got: %v", coins) } +func (suite *KeeperTestSuite) TestSendCoinsWithRestrictions() { + type restrictionArgs struct { + ctx context.Context + fromAddr sdk.AccAddress + toAddr sdk.AccAddress + amt sdk.Coins + } + var actualRestrictionArgs *restrictionArgs + restrictionError := func(message string) banktypes.SendRestrictionFn { + return func(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) (sdk.AccAddress, error) { + actualRestrictionArgs = &restrictionArgs{ + ctx: ctx, + fromAddr: fromAddr, + toAddr: toAddr, + amt: amt, + } + return nil, errors.New(message) + } + } + restrictionPassthrough := func() banktypes.SendRestrictionFn { + return func(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) (sdk.AccAddress, error) { + actualRestrictionArgs = &restrictionArgs{ + ctx: ctx, + fromAddr: fromAddr, + toAddr: toAddr, + amt: amt, + } + return toAddr, nil + } + } + restrictionNewTo := func(newToAddr sdk.AccAddress) banktypes.SendRestrictionFn { + return func(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) (sdk.AccAddress, error) { + actualRestrictionArgs = &restrictionArgs{ + ctx: ctx, + fromAddr: fromAddr, + toAddr: toAddr, + amt: amt, + } + return newToAddr, nil + } + } + type expBals struct { + from sdk.Coins + to1 sdk.Coins + to2 sdk.Coins + } + + setupCtx := suite.ctx + balances := sdk.NewCoins(newFooCoin(1000), newBarCoin(500)) + fromAddr := accAddrs[0] + fromAcc := authtypes.NewBaseAccountWithAddress(fromAddr) + toAddr1 := accAddrs[1] + toAddr2 := accAddrs[2] + + suite.mockFundAccount(accAddrs[0]) + suite.Require().NoError(banktestutil.FundAccount(setupCtx, suite.bankKeeper, accAddrs[0], balances)) + + tests := []struct { + name string + fn banktypes.SendRestrictionFn + toAddr sdk.AccAddress + finalAddr sdk.AccAddress + amt sdk.Coins + expArgs *restrictionArgs + expErr string + expBals expBals + }{ + { + name: "nil restriction", + fn: nil, + toAddr: toAddr1, + finalAddr: toAddr1, + amt: sdk.NewCoins(newFooCoin(5)), + expArgs: nil, + expBals: expBals{ + from: sdk.NewCoins(newFooCoin(995), newBarCoin(500)), + to1: sdk.NewCoins(newFooCoin(5)), + to2: sdk.Coins{}, + }, + }, + { + name: "passthrough restriction", + fn: restrictionPassthrough(), + toAddr: toAddr1, + finalAddr: toAddr1, + amt: sdk.NewCoins(newFooCoin(10)), + expArgs: &restrictionArgs{ + ctx: suite.ctx, + fromAddr: fromAddr, + toAddr: toAddr1, + amt: sdk.NewCoins(newFooCoin(10)), + }, + expBals: expBals{ + from: sdk.NewCoins(newFooCoin(985), newBarCoin(500)), + to1: sdk.NewCoins(newFooCoin(15)), + to2: sdk.Coins{}, + }, + }, + { + name: "new to addr restriction", + fn: restrictionNewTo(toAddr2), + toAddr: toAddr1, + finalAddr: toAddr2, + amt: sdk.NewCoins(newBarCoin(27)), + expArgs: &restrictionArgs{ + ctx: suite.ctx, + fromAddr: fromAddr, + toAddr: toAddr1, + amt: sdk.NewCoins(newBarCoin(27)), + }, + expBals: expBals{ + from: sdk.NewCoins(newFooCoin(985), newBarCoin(473)), + to1: sdk.NewCoins(newFooCoin(15)), + to2: sdk.NewCoins(newBarCoin(27)), + }, + }, + { + name: "restriction returns error", + fn: restrictionError("test restriction error"), + toAddr: toAddr1, + finalAddr: toAddr1, + amt: sdk.NewCoins(newFooCoin(100), newBarCoin(200)), + expArgs: &restrictionArgs{ + ctx: suite.ctx, + fromAddr: fromAddr, + toAddr: toAddr1, + amt: sdk.NewCoins(newFooCoin(100), newBarCoin(200)), + }, + expErr: "test restriction error", + expBals: expBals{ + from: sdk.NewCoins(newFooCoin(885), newBarCoin(273)), + to1: sdk.NewCoins(newFooCoin(15)), + to2: sdk.NewCoins(newBarCoin(27)), + }, + }, + } + + for _, tc := range tests { + suite.Run(tc.name, func() { + existingSendRestrictionFn := suite.bankKeeper.GetSendRestrictionFn() + defer suite.bankKeeper.SetSendRestriction(existingSendRestrictionFn) + actualRestrictionArgs = nil + suite.bankKeeper.SetSendRestriction(tc.fn) + ctx := suite.ctx + if len(tc.expErr) > 0 { + suite.authKeeper.EXPECT().GetAccount(ctx, fromAddr).Return(fromAcc) + } else { + suite.mockSendCoins(ctx, fromAcc, tc.finalAddr) + } + + var err error + testFunc := func() { + err = suite.bankKeeper.SendCoins(ctx, fromAddr, tc.toAddr, tc.amt) + } + suite.Require().NotPanics(testFunc, "SendCoins") + if len(tc.expErr) > 0 { + suite.Assert().EqualError(err, tc.expErr, "SendCoins error") + } else { + suite.Assert().NoError(err, "SendCoins error") + } + if tc.expArgs != nil { + suite.Assert().Equal(tc.expArgs.ctx, actualRestrictionArgs.ctx, "ctx provided to restriction") + suite.Assert().Equal(tc.expArgs.fromAddr, actualRestrictionArgs.fromAddr, "fromAddr provided to restriction") + suite.Assert().Equal(tc.expArgs.toAddr, actualRestrictionArgs.toAddr, "toAddr provided to restriction") + suite.Assert().Equal(tc.expArgs.amt.String(), actualRestrictionArgs.amt.String(), "amt provided to restriction") + } else { + suite.Assert().Nil(actualRestrictionArgs, "args provided to a restriction") + } + fromBal := suite.bankKeeper.GetAllBalances(ctx, fromAddr) + suite.Assert().Equal(tc.expBals.from.String(), fromBal.String(), "fromAddr balance") + to1Bal := suite.bankKeeper.GetAllBalances(ctx, toAddr1) + suite.Assert().Equal(tc.expBals.to1.String(), to1Bal.String(), "toAddr1 balance") + to2Bal := suite.bankKeeper.GetAllBalances(ctx, toAddr2) + suite.Assert().Equal(tc.expBals.to2.String(), to2Bal.String(), "toAddr2 balance") + }) + } +} + func (suite *KeeperTestSuite) TestSendCoins_Invalid_SendLockedCoins() { balances := sdk.NewCoins(newFooCoin(50)) @@ -623,7 +1221,8 @@ func (suite *KeeperTestSuite) TestSendCoins_Invalid_SendLockedCoins() { sendCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 50)) acc0 := authtypes.NewBaseAccountWithAddress(accAddrs[0]) - vacc := vesting.NewContinuousVestingAccount(acc0, origCoins, now.Unix(), endTime.Unix()) + vacc, err := vesting.NewContinuousVestingAccount(acc0, origCoins, now.Unix(), endTime.Unix()) + suite.Require().NoError(err) suite.mockFundAccount(accAddrs[1]) suite.Require().NoError(banktestutil.FundAccount(suite.ctx, suite.bankKeeper, accAddrs[1], balances)) @@ -632,6 +1231,32 @@ func (suite *KeeperTestSuite) TestSendCoins_Invalid_SendLockedCoins() { suite.Require().Error(suite.bankKeeper.SendCoins(suite.ctx, accAddrs[0], accAddrs[1], sendCoins)) } +func (suite *KeeperTestSuite) TestSendCoins_Invalid_NoSpendableCoins() { + coin := sdk.NewInt64Coin("stake", 10) + coins := sdk.NewCoins(coin) + balances := coins + + now := cmttime.Now() + endTime := now.Add(24 * time.Hour) + + origCoins := coins + sendCoins := coins + + acc0 := authtypes.NewBaseAccountWithAddress(accAddrs[0]) + suite.mockFundAccount(accAddrs[0]) + suite.Require().NoError(banktestutil.FundAccount(suite.ctx, suite.bankKeeper, accAddrs[0], balances)) + vacc, err := vesting.NewContinuousVestingAccount(acc0, origCoins, now.Unix(), endTime.Unix()) + suite.Require().NoError(err) + + suite.authKeeper.EXPECT().GetAccount(suite.ctx, accAddrs[0]).Return(vacc) + e := errorsmod.Wrapf( + sdkerrors.ErrInsufficientFunds, + "spendable balance 0stake is smaller than %s", + coin, + ) + suite.Require().EqualError(suite.bankKeeper.SendCoins(suite.ctx, accAddrs[0], accAddrs[1], sendCoins), e.Error()) +} + func (suite *KeeperTestSuite) TestValidateBalance() { ctx := suite.ctx require := suite.Require() @@ -650,7 +1275,8 @@ func (suite *KeeperTestSuite) TestValidateBalance() { require.NoError(suite.bankKeeper.ValidateBalance(ctx, accAddrs[0])) acc1 := authtypes.NewBaseAccountWithAddress(accAddrs[1]) - vacc := vesting.NewContinuousVestingAccount(acc1, balances.Add(balances...), now.Unix(), endTime.Unix()) + vacc, err := vesting.NewContinuousVestingAccount(acc1, balances.Add(balances...), now.Unix(), endTime.Unix()) + suite.Require().NoError(err) suite.mockFundAccount(accAddrs[1]) require.NoError(banktestutil.FundAccount(ctx, suite.bankKeeper, accAddrs[1], balances)) @@ -828,10 +1454,9 @@ func (suite *KeeperTestSuite) TestMsgMultiSendEvents() { event2.Attributes = append( event2.Attributes, abci.EventAttribute{Key: banktypes.AttributeKeyRecipient, Value: accAddrs[2].String()}, + abci.EventAttribute{Key: banktypes.AttributeKeySender, Value: accAddrs[0].String()}, + abci.EventAttribute{Key: sdk.AttributeKeyAmount, Value: newCoins.String()}, ) - event2.Attributes = append( - event2.Attributes, - abci.EventAttribute{Key: sdk.AttributeKeyAmount, Value: newCoins.String()}) event3 := sdk.Event{ Type: banktypes.EventTypeTransfer, Attributes: []abci.EventAttribute{}, @@ -839,9 +1464,7 @@ func (suite *KeeperTestSuite) TestMsgMultiSendEvents() { event3.Attributes = append( event3.Attributes, abci.EventAttribute{Key: banktypes.AttributeKeyRecipient, Value: accAddrs[3].String()}, - ) - event3.Attributes = append( - event3.Attributes, + abci.EventAttribute{Key: banktypes.AttributeKeySender, Value: accAddrs[0].String()}, abci.EventAttribute{Key: sdk.AttributeKeyAmount, Value: newCoins2.String()}, ) // events are shifted due to the funding account events @@ -861,7 +1484,8 @@ func (suite *KeeperTestSuite) TestSpendableCoins() { acc0 := authtypes.NewBaseAccountWithAddress(accAddrs[0]) acc1 := authtypes.NewBaseAccountWithAddress(accAddrs[1]) - vacc := vesting.NewContinuousVestingAccount(acc0, origCoins, ctx.BlockHeader().Time.Unix(), endTime.Unix()) + vacc, err := vesting.NewContinuousVestingAccount(acc0, origCoins, ctx.BlockHeader().Time.Unix(), endTime.Unix()) + suite.Require().NoError(err) suite.mockFundAccount(accAddrs[0]) require.NoError(banktestutil.FundAccount(ctx, suite.bankKeeper, accAddrs[0], origCoins)) @@ -893,7 +1517,8 @@ func (suite *KeeperTestSuite) TestVestingAccountSend() { sendCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 50)) acc0 := authtypes.NewBaseAccountWithAddress(accAddrs[0]) - vacc := vesting.NewContinuousVestingAccount(acc0, origCoins, now.Unix(), endTime.Unix()) + vacc, err := vesting.NewContinuousVestingAccount(acc0, origCoins, now.Unix(), endTime.Unix()) + suite.Require().NoError(err) suite.mockFundAccount(accAddrs[0]) require.NoError(banktestutil.FundAccount(ctx, suite.bankKeeper, accAddrs[0], origCoins)) @@ -926,7 +1551,8 @@ func (suite *KeeperTestSuite) TestPeriodicVestingAccountSend() { } acc0 := authtypes.NewBaseAccountWithAddress(accAddrs[0]) - vacc := vesting.NewPeriodicVestingAccount(acc0, origCoins, ctx.BlockHeader().Time.Unix(), periods) + vacc, err := vesting.NewPeriodicVestingAccount(acc0, origCoins, ctx.BlockHeader().Time.Unix(), periods) + suite.Require().NoError(err) suite.mockFundAccount(accAddrs[0]) require.NoError(banktestutil.FundAccount(ctx, suite.bankKeeper, accAddrs[0], origCoins)) @@ -957,7 +1583,8 @@ func (suite *KeeperTestSuite) TestVestingAccountReceive() { acc0 := authtypes.NewBaseAccountWithAddress(accAddrs[0]) acc1 := authtypes.NewBaseAccountWithAddress(accAddrs[1]) - vacc := vesting.NewContinuousVestingAccount(acc0, origCoins, ctx.BlockHeader().Time.Unix(), endTime.Unix()) + vacc, err := vesting.NewContinuousVestingAccount(acc0, origCoins, ctx.BlockHeader().Time.Unix(), endTime.Unix()) + suite.Require().NoError(err) suite.mockFundAccount(accAddrs[0]) require.NoError(banktestutil.FundAccount(ctx, suite.bankKeeper, accAddrs[0], origCoins)) @@ -994,7 +1621,8 @@ func (suite *KeeperTestSuite) TestPeriodicVestingAccountReceive() { vesting.Period{Length: int64(6 * 60 * 60), Amount: sdk.Coins{sdk.NewInt64Coin("stake", 25)}}, } - vacc := vesting.NewPeriodicVestingAccount(acc0, origCoins, ctx.BlockHeader().Time.Unix(), periods) + vacc, err := vesting.NewPeriodicVestingAccount(acc0, origCoins, ctx.BlockHeader().Time.Unix(), periods) + suite.Require().NoError(err) suite.mockFundAccount(accAddrs[0]) require.NoError(banktestutil.FundAccount(ctx, suite.bankKeeper, accAddrs[0], origCoins)) @@ -1026,7 +1654,8 @@ func (suite *KeeperTestSuite) TestDelegateCoins() { acc0 := authtypes.NewBaseAccountWithAddress(accAddrs[0]) acc1 := authtypes.NewBaseAccountWithAddress(accAddrs[1]) - vacc := vesting.NewContinuousVestingAccount(acc0, origCoins, ctx.BlockHeader().Time.Unix(), endTime.Unix()) + vacc, err := vesting.NewContinuousVestingAccount(acc0, origCoins, ctx.BlockHeader().Time.Unix(), endTime.Unix()) + suite.Require().NoError(err) suite.mockFundAccount(accAddrs[0]) require.NoError(banktestutil.FundAccount(ctx, suite.bankKeeper, accAddrs[0], origCoins)) @@ -1083,7 +1712,8 @@ func (suite *KeeperTestSuite) TestUndelegateCoins() { acc0 := authtypes.NewBaseAccountWithAddress(accAddrs[0]) acc1 := authtypes.NewBaseAccountWithAddress(accAddrs[1]) - vacc := vesting.NewContinuousVestingAccount(acc0, origCoins, ctx.BlockHeader().Time.Unix(), endTime.Unix()) + vacc, err := vesting.NewContinuousVestingAccount(acc0, origCoins, ctx.BlockHeader().Time.Unix(), endTime.Unix()) + suite.Require().NoError(err) suite.mockFundAccount(accAddrs[0]) require.NoError(banktestutil.FundAccount(ctx, suite.bankKeeper, accAddrs[0], origCoins)) @@ -1356,7 +1986,7 @@ func (suite *KeeperTestSuite) TestMintCoinRestrictions() { } for _, test := range tests { - keeper := suite.bankKeeper.WithMintCoinsRestriction(keeper.MintingRestrictionFn(test.restrictionFn)) + keeper := suite.bankKeeper.WithMintCoinsRestriction(banktypes.MintingRestrictionFn(test.restrictionFn)) for _, testCase := range test.testCases { if testCase.expectPass { suite.mockMintCoins(multiPermAcc) @@ -1743,6 +2373,8 @@ func (ms mockSubspace) GetParamSet(ctx sdk.Context, ps exported.ParamSet) { *ps.(*banktypes.Params) = ms.ps } +func (ms mockSubspace) Get(ctx sdk.Context, key []byte, ptr interface{}) {} + func (suite *KeeperTestSuite) TestMigrator_Migrate3to4() { bankKeeper := suite.bankKeeper ctx := sdk.UnwrapSDKContext(suite.ctx) diff --git a/x/bank/keeper/migrations.go b/x/bank/keeper/migrations.go index 4914f9480ce7..c083bfa975dd 100644 --- a/x/bank/keeper/migrations.go +++ b/x/bank/keeper/migrations.go @@ -6,6 +6,7 @@ import ( v2 "github.com/cosmos/cosmos-sdk/x/bank/migrations/v2" v3 "github.com/cosmos/cosmos-sdk/x/bank/migrations/v3" v4 "github.com/cosmos/cosmos-sdk/x/bank/migrations/v4" + "github.com/cosmos/cosmos-sdk/x/bank/types" ) // Migrator is a struct for handling in-place store migrations. @@ -31,5 +32,12 @@ func (m Migrator) Migrate2to3(ctx sdk.Context) error { // Migrate3to4 migrates x/bank storage from version 3 to 4. func (m Migrator) Migrate3to4(ctx sdk.Context) error { + m.MigrateSendEnabledParams(ctx) return v4.MigrateStore(ctx, m.keeper.storeService, m.legacySubspace, m.keeper.cdc) } + +// MigrateSendEnabledParams get params from x/params and update the bank params. +func (m Migrator) MigrateSendEnabledParams(ctx sdk.Context) { + sendEnabled := types.GetSendEnabledParams(ctx, m.legacySubspace) + m.keeper.SetAllSendEnabled(ctx, sendEnabled) +} diff --git a/x/bank/keeper/msg_server.go b/x/bank/keeper/msg_server.go index c6fbedf8369b..781b0796d8b8 100644 --- a/x/bank/keeper/msg_server.go +++ b/x/bank/keeper/msg_server.go @@ -3,7 +3,7 @@ package keeper import ( "context" - "github.com/armon/go-metrics" + "github.com/hashicorp/go-metrics" errorsmod "cosmossdk.io/errors" diff --git a/x/bank/keeper/send.go b/x/bank/keeper/send.go index 5219d2513553..7deedf473e3d 100644 --- a/x/bank/keeper/send.go +++ b/x/bank/keeper/send.go @@ -6,9 +6,9 @@ import ( "cosmossdk.io/collections" "cosmossdk.io/core/store" - "cosmossdk.io/log" - errorsmod "cosmossdk.io/errors" + "cosmossdk.io/log" + "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/telemetry" @@ -22,7 +22,11 @@ import ( type SendKeeper interface { ViewKeeper - InputOutputCoins(ctx context.Context, inputs types.Input, outputs []types.Output) error + AppendSendRestriction(restriction types.SendRestrictionFn) + PrependSendRestriction(restriction types.SendRestrictionFn) + ClearSendRestriction() + + InputOutputCoins(ctx context.Context, input types.Input, outputs []types.Output) error SendCoins(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error GetParams(ctx context.Context) types.Params @@ -63,6 +67,8 @@ type BaseSendKeeper struct { // the address capable of executing a MsgUpdateParams message. Typically, this // should be the x/gov module account. authority string + + sendRestriction *sendRestriction } func NewBaseSendKeeper( @@ -78,16 +84,32 @@ func NewBaseSendKeeper( } return BaseSendKeeper{ - BaseViewKeeper: NewBaseViewKeeper(cdc, storeService, ak, logger), - cdc: cdc, - ak: ak, - storeService: storeService, - blockedAddrs: blockedAddrs, - authority: authority, - logger: logger, + BaseViewKeeper: NewBaseViewKeeper(cdc, storeService, ak, logger), + cdc: cdc, + ak: ak, + storeService: storeService, + blockedAddrs: blockedAddrs, + authority: authority, + logger: logger, + sendRestriction: newSendRestriction(), } } +// AppendSendRestriction adds the provided SendRestrictionFn to run after previously provided restrictions. +func (k BaseSendKeeper) AppendSendRestriction(restriction types.SendRestrictionFn) { + k.sendRestriction.append(restriction) +} + +// PrependSendRestriction adds the provided SendRestrictionFn to run before previously provided restrictions. +func (k BaseSendKeeper) PrependSendRestriction(restriction types.SendRestrictionFn) { + k.sendRestriction.prepend(restriction) +} + +// ClearSendRestriction removes the send restriction (if there is one). +func (k BaseSendKeeper) ClearSendRestriction() { + k.sendRestriction.clear() +} + // GetAuthority returns the x/bank module's authority. func (k BaseSendKeeper) GetAuthority() string { return k.authority @@ -143,8 +165,14 @@ func (k BaseSendKeeper) InputOutputCoins(ctx context.Context, input types.Input, ), ) + var outAddress sdk.AccAddress for _, out := range outputs { - outAddress, err := k.ak.AddressCodec().StringToBytes(out.Address) + outAddress, err = k.ak.AddressCodec().StringToBytes(out.Address) + if err != nil { + return err + } + + outAddress, err = k.sendRestriction.apply(ctx, inAddress, outAddress, out.Coins) if err != nil { return err } @@ -156,7 +184,8 @@ func (k BaseSendKeeper) InputOutputCoins(ctx context.Context, input types.Input, sdkCtx.EventManager().EmitEvent( sdk.NewEvent( types.EventTypeTransfer, - sdk.NewAttribute(types.AttributeKeyRecipient, out.Address), + sdk.NewAttribute(types.AttributeKeyRecipient, outAddress.String()), + sdk.NewAttribute(types.AttributeKeySender, input.Address), sdk.NewAttribute(sdk.AttributeKeyAmount, out.Coins.String()), ), ) @@ -178,7 +207,13 @@ func (k BaseSendKeeper) InputOutputCoins(ctx context.Context, input types.Input, // SendCoins transfers amt coins from a sending account to a receiving account. // An error is returned upon failure. func (k BaseSendKeeper) SendCoins(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error { - err := k.subUnlockedCoins(ctx, fromAddr, amt) + var err error + err = k.subUnlockedCoins(ctx, fromAddr, amt) + if err != nil { + return err + } + + toAddr, err = k.sendRestriction.apply(ctx, fromAddr, toAddr, amt) if err != nil { return err } @@ -210,7 +245,7 @@ func (k BaseSendKeeper) SendCoins(ctx context.Context, fromAddr, toAddr sdk.AccA ), sdk.NewEvent( sdk.EventTypeMessage, - sdk.NewAttribute(types.AttributeKeySender, fromAddr.String()), + sdk.NewAttribute(types.AttributeKeySender, fromAddrString), ), }) @@ -238,6 +273,9 @@ func (k BaseSendKeeper) subUnlockedCoins(ctx context.Context, addr sdk.AccAddres } if _, hasNeg := spendable.SafeSub(coin); hasNeg { + if len(spendable) == 0 { + spendable = sdk.Coins{sdk.NewCoin(coin.Denom, math.ZeroInt())} + } return errorsmod.Wrapf( sdkerrors.ErrInsufficientFunds, "spendable balance %s is smaller than %s", @@ -379,7 +417,7 @@ func (k BaseSendKeeper) IterateSendEnabledEntries(ctx context.Context, cb func(d err := k.SendEnabled.Walk(ctx, nil, func(key string, value bool) (stop bool, err error) { return cb(key, value), nil }) - if err != nil && !errorsmod.IsOf(err, collections.ErrInvalidIterator) { + if err != nil { panic(err) } } @@ -430,3 +468,41 @@ func (k BaseSendKeeper) getSendEnabledOrDefault(ctx context.Context, denom strin return defaultVal } + +// sendRestriction is a struct that houses a SendRestrictionFn. +// It exists so that the SendRestrictionFn can be updated in the SendKeeper without needing to have a pointer receiver. +type sendRestriction struct { + fn types.SendRestrictionFn +} + +// newSendRestriction creates a new sendRestriction with nil send restriction. +func newSendRestriction() *sendRestriction { + return &sendRestriction{ + fn: nil, + } +} + +// append adds the provided restriction to this, to be run after the existing function. +func (r *sendRestriction) append(restriction types.SendRestrictionFn) { + r.fn = r.fn.Then(restriction) +} + +// prepend adds the provided restriction to this, to be run before the existing function. +func (r *sendRestriction) prepend(restriction types.SendRestrictionFn) { + r.fn = restriction.Then(r.fn) +} + +// clear removes the send restriction (sets it to nil). +func (r *sendRestriction) clear() { + r.fn = nil +} + +var _ types.SendRestrictionFn = (*sendRestriction)(nil).apply + +// apply applies the send restriction if there is one. If not, it's a no-op. +func (r *sendRestriction) apply(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) (sdk.AccAddress, error) { + if r == nil || r.fn == nil { + return toAddr, nil + } + return r.fn(ctx, fromAddr, toAddr, amt) +} diff --git a/x/bank/keeper/view.go b/x/bank/keeper/view.go index 732ac3d17a75..d4e2544bc796 100644 --- a/x/bank/keeper/view.go +++ b/x/bank/keeper/view.go @@ -4,18 +4,13 @@ import ( "context" "fmt" + "cosmossdk.io/collections" "cosmossdk.io/collections/indexes" "cosmossdk.io/core/store" + errorsmod "cosmossdk.io/errors" "cosmossdk.io/log" - - "github.com/cockroachdb/errors" - - "cosmossdk.io/collections" - "cosmossdk.io/math" - errorsmod "cosmossdk.io/errors" - "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -45,7 +40,8 @@ func newBalancesIndexes(sb *collections.SchemaBuilder) BalancesIndexes { return BalancesIndexes{ Denom: indexes.NewReversePair[math.Int]( sb, types.DenomAddressPrefix, "address_by_denom_index", - collections.PairKeyCodec(sdk.AddressKeyAsIndexKey(sdk.AccAddressKey), collections.StringKey), // nolint:staticcheck // Note: refer to the AddressKeyAsIndexKey docs to understand why we do this. + collections.PairKeyCodec(sdk.LengthPrefixedAddressKey(sdk.AccAddressKey), collections.StringKey), // nolint:staticcheck // Note: refer to the LengthPrefixedAddressKey docs to understand why we do this. + indexes.WithReversePairUncheckedValue(), // denom to address indexes were stored as Key: Join(denom, address) Value: []byte{0}, this will migrate the value to []byte{} in a lazy way. ), } } @@ -84,7 +80,7 @@ func NewBaseViewKeeper(cdc codec.BinaryCodec, storeService store.KVStoreService, Supply: collections.NewMap(sb, types.SupplyKey, "supply", collections.StringKey, sdk.IntValue), DenomMetadata: collections.NewMap(sb, types.DenomMetadataPrefix, "denom_metadata", collections.StringKey, codec.CollValue[types.Metadata](cdc)), SendEnabled: collections.NewMap(sb, types.SendEnabledPrefix, "send_enabled", collections.StringKey, codec.BoolValue), // NOTE: we use a bool value which uses protobuf to retain state backwards compat - Balances: collections.NewIndexedMap(sb, types.BalancesPrefix, "balances", collections.PairKeyCodec(sdk.AccAddressKey, collections.StringKey), types.NewBalanceCompatValueCodec(), newBalancesIndexes(sb)), + Balances: collections.NewIndexedMap(sb, types.BalancesPrefix, "balances", collections.PairKeyCodec(sdk.AccAddressKey, collections.StringKey), types.BalanceValueCodec, newBalancesIndexes(sb)), Params: collections.NewItem(sb, types.ParamsKey, "params", codec.CollValue[types.Params](cdc)), } @@ -148,7 +144,7 @@ func (k BaseViewKeeper) GetAccountsBalances(ctx context.Context) []types.Balance func (k BaseViewKeeper) GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin { amt, err := k.Balances.Get(ctx, collections.Join(addr, denom)) if err != nil { - return sdk.NewCoin(denom, sdk.ZeroInt()) + return sdk.NewCoin(denom, math.ZeroInt()) } return sdk.NewCoin(denom, amt) } @@ -160,7 +156,7 @@ func (k BaseViewKeeper) IterateAccountBalances(ctx context.Context, addr sdk.Acc err := k.Balances.Walk(ctx, collections.NewPrefixedPairRange[sdk.AccAddress, string](addr), func(key collections.Pair[sdk.AccAddress, string], value math.Int) (stop bool, err error) { return cb(sdk.NewCoin(key.K2(), value)), nil }) - if err != nil && !errors.Is(err, collections.ErrInvalidIterator) { + if err != nil { panic(err) } } @@ -172,7 +168,7 @@ func (k BaseViewKeeper) IterateAllBalances(ctx context.Context, cb func(sdk.AccA err := k.Balances.Walk(ctx, nil, func(key collections.Pair[sdk.AccAddress, string], value math.Int) (stop bool, err error) { return cb(key.K1(), sdk.NewCoin(key.K2(), value)), nil }) - if err != nil && !errors.Is(err, collections.ErrInvalidIterator) { + if err != nil { panic(err) } } diff --git a/x/bank/migrations/v1/types.go b/x/bank/migrations/v1/types.go index a584be926d3b..851f7e317a95 100644 --- a/x/bank/migrations/v1/types.go +++ b/x/bank/migrations/v1/types.go @@ -1,12 +1,13 @@ package v1 import ( + "github.com/golang/protobuf/proto" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/kv" v1auth "github.com/cosmos/cosmos-sdk/x/auth/migrations/v1" "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/golang/protobuf/proto" ) const ( diff --git a/x/bank/migrations/v2/json_test.go b/x/bank/migrations/v2/json_test.go index bdf20dacded0..99984fb9c956 100644 --- a/x/bank/migrations/v2/json_test.go +++ b/x/bank/migrations/v2/json_test.go @@ -4,9 +4,10 @@ import ( "encoding/json" "testing" - sdkmath "cosmossdk.io/math" "github.com/stretchr/testify/require" + sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/client" sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" diff --git a/x/bank/migrations/v2/store_test.go b/x/bank/migrations/v2/store_test.go index 017f4174f9a5..bb6c11900eb2 100644 --- a/x/bank/migrations/v2/store_test.go +++ b/x/bank/migrations/v2/store_test.go @@ -3,9 +3,9 @@ package v2_test import ( "testing" - "cosmossdk.io/math" "github.com/stretchr/testify/require" + "cosmossdk.io/math" "cosmossdk.io/store/prefix" storetypes "cosmossdk.io/store/types" diff --git a/x/bank/migrations/v3/store_test.go b/x/bank/migrations/v3/store_test.go index 35323cad5f7d..a8184f75b4a3 100644 --- a/x/bank/migrations/v3/store_test.go +++ b/x/bank/migrations/v3/store_test.go @@ -3,9 +3,9 @@ package v3_test import ( "testing" - "cosmossdk.io/math" "github.com/stretchr/testify/require" + "cosmossdk.io/math" "cosmossdk.io/store/prefix" storetypes "cosmossdk.io/store/types" diff --git a/x/bank/migrations/v4/gen_state_test.go b/x/bank/migrations/v4/gen_state_test.go index 324216e260a5..1283e65b7842 100644 --- a/x/bank/migrations/v4/gen_state_test.go +++ b/x/bank/migrations/v4/gen_state_test.go @@ -3,9 +3,10 @@ package v4_test import ( "testing" - sdkmath "cosmossdk.io/math" "github.com/stretchr/testify/assert" + sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" v4 "github.com/cosmos/cosmos-sdk/x/bank/migrations/v4" "github.com/cosmos/cosmos-sdk/x/bank/types" @@ -155,6 +156,6 @@ func TestMigrateGenState(t *testing.T) { }, } _ = v4.MigrateGenState(&origState) - assert.Len(t, origState.Params.SendEnabled, 2) + assert.Len(t, origState.Params.SendEnabled, 2) //nolint:staticcheck // keep for test (linter sometimes fails) }) } diff --git a/x/bank/migrations/v4/store.go b/x/bank/migrations/v4/store.go index f7327daab06e..675ff785a65c 100644 --- a/x/bank/migrations/v4/store.go +++ b/x/bank/migrations/v4/store.go @@ -21,6 +21,9 @@ func MigrateStore(ctx sdk.Context, storeService store.KVStoreService, legacySubs var currParams types.Params legacySubspace.GetParamSet(ctx, &currParams) + // SendEnabled is migrated to the x/bank module store, so delete from the params + currParams = types.NewParams(currParams.DefaultSendEnabled) + if err := currParams.Validate(); err != nil { return err } diff --git a/x/bank/migrations/v4/store_test.go b/x/bank/migrations/v4/store_test.go index 68f7bad4b3dc..6bc199f056c4 100644 --- a/x/bank/migrations/v4/store_test.go +++ b/x/bank/migrations/v4/store_test.go @@ -3,9 +3,10 @@ package v4_test import ( "testing" - storetypes "cosmossdk.io/store/types" "github.com/stretchr/testify/require" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" @@ -28,6 +29,8 @@ func (ms mockSubspace) GetParamSet(ctx sdk.Context, ps exported.ParamSet) { *ps.(*types.Params) = ms.ps } +func (ms mockSubspace) Get(ctx sdk.Context, key []byte, ptr interface{}) {} + func TestMigrate(t *testing.T) { encCfg := moduletestutil.MakeTestEncodingConfig(bank.AppModuleBasic{}) cdc := encCfg.Codec diff --git a/x/bank/module.go b/x/bank/module.go index ca201365d034..8f9e88b05920 100644 --- a/x/bank/module.go +++ b/x/bank/module.go @@ -4,23 +4,23 @@ import ( "context" "encoding/json" "fmt" - "time" + "maps" + "slices" + "sort" + + gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" modulev1 "cosmossdk.io/api/cosmos/bank/module/v1" "cosmossdk.io/core/address" "cosmossdk.io/core/appmodule" + corestore "cosmossdk.io/core/store" "cosmossdk.io/depinject" "cosmossdk.io/log" - abci "github.com/cometbft/cometbft/abci/types" - gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" - - corestore "cosmossdk.io/core/store" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" @@ -38,9 +38,13 @@ import ( const ConsensusVersion = 4 var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleBasic = AppModule{} _ module.AppModuleSimulation = AppModule{} + _ module.HasGenesis = AppModule{} + _ module.HasServices = AppModule{} + _ module.HasInvariants = AppModule{} + + _ appmodule.AppModule = AppModule{} ) // AppModuleBasic defines the basic application module used by the bank module. @@ -85,11 +89,6 @@ func (ab AppModuleBasic) GetTxCmd() *cobra.Command { return cli.NewTxCmd(ab.ac) } -// GetQueryCmd returns no root query command for the bank module. -func (ab AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd(ab.ac) -} - // RegisterInterfaces registers interfaces and implementations of the bank module. func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { types.RegisterInterfaces(registry) @@ -109,8 +108,6 @@ type AppModule struct { legacySubspace exported.Subspace } -var _ appmodule.AppModule = AppModule{} - // IsOnePerModuleType implements the depinject.OnePerModuleType interface. func (am AppModule) IsOnePerModuleType() {} @@ -146,27 +143,19 @@ func NewAppModule(cdc codec.Codec, keeper keeper.Keeper, accountKeeper types.Acc } } -// Name returns the bank module's name. -func (AppModule) Name() string { return types.ModuleName } - -// RegisterInvariants registers the bank module invariants. -func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) { - keeper.RegisterInvariants(ir, am.keeper) -} +// RegisterInvariants is deprecated and will be removed in the next Cosmos SDK release. +func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} // QuerierRoute returns the bank module's querier route name. func (AppModule) QuerierRoute() string { return types.RouterKey } // InitGenesis performs genesis initialization for the bank module. It returns // no validator updates. -func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate { - start := time.Now() +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) { var genesisState types.GenesisState cdc.MustUnmarshalJSON(data, &genesisState) - telemetry.MeasureSince(start, "InitGenesis", "crisis", "unmarshal") am.keeper.InitGenesis(ctx, &genesisState) - return []abci.ValidatorUpdate{} } // ExportGenesis returns the exported genesis state as raw bytes for the bank @@ -206,8 +195,10 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp // App Wiring Setup func init() { - appmodule.Register(&modulev1.Module{}, + appmodule.Register( + &modulev1.Module{}, appmodule.Provide(ProvideModule), + appmodule.Invoke(InvokeSetSendRestrictions), ) } @@ -266,3 +257,39 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { return ModuleOutputs{BankKeeper: bankKeeper, Module: m} } + +func InvokeSetSendRestrictions( + config *modulev1.Module, + keeper keeper.BaseKeeper, + restrictions map[string]types.SendRestrictionFn, +) error { + if config == nil { + return nil + } + + modules := slices.Collect(maps.Keys(restrictions)) + order := config.RestrictionsOrder + if len(order) == 0 { + order = modules + sort.Strings(order) + } + + if len(order) != len(modules) { + return fmt.Errorf("len(restrictions order: %v) != len(restriction modules: %v)", order, modules) + } + + if len(modules) == 0 { + return nil + } + + for _, module := range order { + restriction, ok := restrictions[module] + if !ok { + return fmt.Errorf("can't find send restriction for module %s", module) + } + + keeper.AppendSendRestriction(restriction) + } + + return nil +} diff --git a/x/bank/simulation/genesis_test.go b/x/bank/simulation/genesis_test.go index 3de14ad2c82b..de0ad2226d96 100644 --- a/x/bank/simulation/genesis_test.go +++ b/x/bank/simulation/genesis_test.go @@ -9,6 +9,7 @@ import ( "github.com/stretchr/testify/require" sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/bank/simulation/operations.go b/x/bank/simulation/operations.go index 33faddd5e853..76dd67f21350 100644 --- a/x/bank/simulation/operations.go +++ b/x/bank/simulation/operations.go @@ -347,7 +347,11 @@ func sendMsgMultiSend( accountNumbers := make([]uint64, len(msg.Inputs)) sequenceNumbers := make([]uint64, len(msg.Inputs)) for i := 0; i < len(msg.Inputs); i++ { - addr := sdk.MustAccAddressFromBech32(msg.Inputs[i].Address) + addr, err := ak.AddressCodec().StringToBytes(msg.Inputs[i].Address) + if err != nil { + panic(err) + } + acc := ak.GetAccount(ctx, addr) accountNumbers[i] = acc.GetAccountNumber() sequenceNumbers[i] = acc.GetSequence() @@ -356,7 +360,11 @@ func sendMsgMultiSend( fees sdk.Coins err error ) - addr := sdk.MustAccAddressFromBech32(msg.Inputs[0].Address) + + addr, err := ak.AddressCodec().StringToBytes(msg.Inputs[0].Address) + if err != nil { + panic(err) + } // feePayer is the first signer, i.e. first input address feePayer := ak.GetAccount(ctx, addr) spendable := bk.SpendableCoins(ctx, feePayer.GetAddress()) diff --git a/x/bank/simulation/operations_test.go b/x/bank/simulation/operations_test.go index 1697c1017a38..e4f5e03a8a03 100644 --- a/x/bank/simulation/operations_test.go +++ b/x/bank/simulation/operations_test.go @@ -4,12 +4,13 @@ import ( "math/rand" "testing" - "cosmossdk.io/depinject" - "cosmossdk.io/log" abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/gogoproto/proto" "github.com/stretchr/testify/suite" + "cosmossdk.io/depinject" + "cosmossdk.io/log" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/runtime" diff --git a/x/bank/testutil/expected_keepers_mocks.go b/x/bank/testutil/expected_keepers_mocks.go index fcdfd8a472e6..c0c01c06e45a 100644 --- a/x/bank/testutil/expected_keepers_mocks.go +++ b/x/bank/testutil/expected_keepers_mocks.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: x/bank/types/expected_keepers.go +// +// Generated by this command: +// +// mockgen -source=x/bank/types/expected_keepers.go -package testutil -destination x/bank/testutil/expected_keepers_mocks.go +// // Package testutil is a generated GoMock package. package testutil @@ -11,13 +16,14 @@ import ( address "cosmossdk.io/core/address" types "github.com/cosmos/cosmos-sdk/types" types0 "github.com/cosmos/cosmos-sdk/x/auth/types" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockAccountKeeper is a mock of AccountKeeper interface. type MockAccountKeeper struct { ctrl *gomock.Controller recorder *MockAccountKeeperMockRecorder + isgomock struct{} } // MockAccountKeeperMockRecorder is the mock recorder for MockAccountKeeper. @@ -60,7 +66,7 @@ func (m *MockAccountKeeper) GetAccount(ctx context.Context, addr types.AccAddres } // GetAccount indicates an expected call of GetAccount. -func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetAccount), ctx, addr) } @@ -74,7 +80,7 @@ func (m *MockAccountKeeper) GetAllAccounts(ctx context.Context) []types.AccountI } // GetAllAccounts indicates an expected call of GetAllAccounts. -func (mr *MockAccountKeeperMockRecorder) GetAllAccounts(ctx interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) GetAllAccounts(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllAccounts", reflect.TypeOf((*MockAccountKeeper)(nil).GetAllAccounts), ctx) } @@ -88,7 +94,7 @@ func (m *MockAccountKeeper) GetModuleAccount(ctx context.Context, moduleName str } // GetModuleAccount indicates an expected call of GetModuleAccount. -func (mr *MockAccountKeeperMockRecorder) GetModuleAccount(ctx, moduleName interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) GetModuleAccount(ctx, moduleName any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAccount), ctx, moduleName) } @@ -103,7 +109,7 @@ func (m *MockAccountKeeper) GetModuleAccountAndPermissions(ctx context.Context, } // GetModuleAccountAndPermissions indicates an expected call of GetModuleAccountAndPermissions. -func (mr *MockAccountKeeperMockRecorder) GetModuleAccountAndPermissions(ctx, moduleName interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) GetModuleAccountAndPermissions(ctx, moduleName any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAccountAndPermissions", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAccountAndPermissions), ctx, moduleName) } @@ -117,7 +123,7 @@ func (m *MockAccountKeeper) GetModuleAddress(moduleName string) types.AccAddress } // GetModuleAddress indicates an expected call of GetModuleAddress. -func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(moduleName interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(moduleName any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAddress", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAddress), moduleName) } @@ -132,7 +138,7 @@ func (m *MockAccountKeeper) GetModuleAddressAndPermissions(moduleName string) (t } // GetModuleAddressAndPermissions indicates an expected call of GetModuleAddressAndPermissions. -func (mr *MockAccountKeeperMockRecorder) GetModuleAddressAndPermissions(moduleName interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) GetModuleAddressAndPermissions(moduleName any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAddressAndPermissions", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAddressAndPermissions), moduleName) } @@ -160,7 +166,7 @@ func (m *MockAccountKeeper) HasAccount(ctx context.Context, addr types.AccAddres } // HasAccount indicates an expected call of HasAccount. -func (mr *MockAccountKeeperMockRecorder) HasAccount(ctx, addr interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) HasAccount(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HasAccount", reflect.TypeOf((*MockAccountKeeper)(nil).HasAccount), ctx, addr) } @@ -172,7 +178,7 @@ func (m *MockAccountKeeper) IterateAccounts(ctx context.Context, process func(ty } // IterateAccounts indicates an expected call of IterateAccounts. -func (mr *MockAccountKeeperMockRecorder) IterateAccounts(ctx, process interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) IterateAccounts(ctx, process any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateAccounts", reflect.TypeOf((*MockAccountKeeper)(nil).IterateAccounts), ctx, process) } @@ -186,7 +192,7 @@ func (m *MockAccountKeeper) NewAccount(arg0 context.Context, arg1 types.AccountI } // NewAccount indicates an expected call of NewAccount. -func (mr *MockAccountKeeperMockRecorder) NewAccount(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) NewAccount(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewAccount", reflect.TypeOf((*MockAccountKeeper)(nil).NewAccount), arg0, arg1) } @@ -200,7 +206,7 @@ func (m *MockAccountKeeper) NewAccountWithAddress(ctx context.Context, addr type } // NewAccountWithAddress indicates an expected call of NewAccountWithAddress. -func (mr *MockAccountKeeperMockRecorder) NewAccountWithAddress(ctx, addr interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) NewAccountWithAddress(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewAccountWithAddress", reflect.TypeOf((*MockAccountKeeper)(nil).NewAccountWithAddress), ctx, addr) } @@ -212,7 +218,7 @@ func (m *MockAccountKeeper) SetAccount(ctx context.Context, acc types.AccountI) } // SetAccount indicates an expected call of SetAccount. -func (mr *MockAccountKeeperMockRecorder) SetAccount(ctx, acc interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) SetAccount(ctx, acc any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetAccount", reflect.TypeOf((*MockAccountKeeper)(nil).SetAccount), ctx, acc) } @@ -224,7 +230,7 @@ func (m *MockAccountKeeper) SetModuleAccount(ctx context.Context, macc types.Mod } // SetModuleAccount indicates an expected call of SetModuleAccount. -func (mr *MockAccountKeeperMockRecorder) SetModuleAccount(ctx, macc interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) SetModuleAccount(ctx, macc any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetModuleAccount", reflect.TypeOf((*MockAccountKeeper)(nil).SetModuleAccount), ctx, macc) } @@ -238,7 +244,7 @@ func (m *MockAccountKeeper) ValidatePermissions(macc types.ModuleAccountI) error } // ValidatePermissions indicates an expected call of ValidatePermissions. -func (mr *MockAccountKeeperMockRecorder) ValidatePermissions(macc interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) ValidatePermissions(macc any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatePermissions", reflect.TypeOf((*MockAccountKeeper)(nil).ValidatePermissions), macc) } diff --git a/x/bank/types/balance_test.go b/x/bank/types/balance_test.go index 0be898e2b9cf..4f735e59545e 100644 --- a/x/bank/types/balance_test.go +++ b/x/bank/types/balance_test.go @@ -3,9 +3,10 @@ package types_test import ( "testing" - "cosmossdk.io/math" "github.com/stretchr/testify/require" + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" bank "github.com/cosmos/cosmos-sdk/x/bank/types" diff --git a/x/bank/types/expected_keepers.go b/x/bank/types/expected_keepers.go index 8e6e32301cd3..ebd5eb9a657e 100644 --- a/x/bank/types/expected_keepers.go +++ b/x/bank/types/expected_keepers.go @@ -4,6 +4,7 @@ import ( context "context" "cosmossdk.io/core/address" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/types" ) diff --git a/x/bank/types/genesis_test.go b/x/bank/types/genesis_test.go index 742691b6c7b0..93805ac84b57 100644 --- a/x/bank/types/genesis_test.go +++ b/x/bank/types/genesis_test.go @@ -3,10 +3,11 @@ package types import ( "testing" - "cosmossdk.io/math" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" ) diff --git a/x/bank/types/inputs_outputs.go b/x/bank/types/inputs_outputs.go index cca4c039887b..5d98f72a87de 100644 --- a/x/bank/types/inputs_outputs.go +++ b/x/bank/types/inputs_outputs.go @@ -2,6 +2,7 @@ package types import ( errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) diff --git a/x/bank/types/keys.go b/x/bank/types/keys.go index 33c14f5c3892..b4ea683d4b69 100644 --- a/x/bank/types/keys.go +++ b/x/bank/types/keys.go @@ -4,6 +4,7 @@ import ( "cosmossdk.io/collections" collcodec "cosmossdk.io/collections/codec" "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -33,27 +34,13 @@ var ( ParamsKey = collections.NewPrefix(5) ) -// NewBalanceCompatValueCodec is a codec for encoding Balances in a backwards compatible way -// with respect to the old format. -func NewBalanceCompatValueCodec() collcodec.ValueCodec[math.Int] { - return balanceCompatValueCodec{ - sdk.IntValue, - } -} - -type balanceCompatValueCodec struct { - collcodec.ValueCodec[math.Int] -} - -func (v balanceCompatValueCodec) Decode(b []byte) (math.Int, error) { - i, err := v.ValueCodec.Decode(b) - if err == nil { - return i, nil - } +// BalanceValueCodec is a codec for encoding bank balances in a backwards compatible way. +// Historically, balances were represented as Coin, now they're represented as a simple math.Int +var BalanceValueCodec = collcodec.NewAltValueCodec(sdk.IntValue, func(bytes []byte) (math.Int, error) { c := new(sdk.Coin) - err = c.Unmarshal(b) + err := c.Unmarshal(bytes) if err != nil { return math.Int{}, err } return c.Amount, nil -} +}) diff --git a/x/bank/types/keys_test.go b/x/bank/types/keys_test.go index 31aa8aa13e98..fa2c48669b61 100644 --- a/x/bank/types/keys_test.go +++ b/x/bank/types/keys_test.go @@ -3,23 +3,24 @@ package types import ( "testing" + "github.com/stretchr/testify/require" + "cosmossdk.io/collections/colltest" "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" ) func TestBalanceValueCodec(t *testing.T) { - c := NewBalanceCompatValueCodec() t.Run("value codec implementation", func(t *testing.T) { - colltest.TestValueCodec(t, c, math.NewInt(100)) + colltest.TestValueCodec(t, BalanceValueCodec, math.NewInt(100)) }) t.Run("legacy coin", func(t *testing.T) { coin := sdk.NewInt64Coin("coin", 1000) b, err := coin.Marshal() require.NoError(t, err) - amt, err := c.Decode(b) + amt, err := BalanceValueCodec.Decode(b) require.NoError(t, err) require.Equal(t, coin.Amount, amt) }) diff --git a/x/bank/types/msgs.go b/x/bank/types/msgs.go index a020fdd47ec9..05a23c280e2b 100644 --- a/x/bank/types/msgs.go +++ b/x/bank/types/msgs.go @@ -15,35 +15,11 @@ func NewMsgSend(fromAddr, toAddr sdk.AccAddress, amount sdk.Coins) *MsgSend { return &MsgSend{FromAddress: fromAddr.String(), ToAddress: toAddr.String(), Amount: amount} } -// GetSigners Implements Msg. -func (msg MsgSend) GetSigners() []sdk.AccAddress { - fromAddress, _ := sdk.AccAddressFromBech32(msg.FromAddress) - return []sdk.AccAddress{fromAddress} -} - // NewMsgMultiSend - construct arbitrary multi-in, multi-out send msg. func NewMsgMultiSend(in Input, out []Output) *MsgMultiSend { return &MsgMultiSend{Inputs: []Input{in}, Outputs: out} } -// GetSigners Implements Msg. -func (msg MsgMultiSend) GetSigners() []sdk.AccAddress { - // should not happen as ValidateBasic would have failed - if len(msg.Inputs) == 0 { - return nil - } - - addrs, _ := sdk.AccAddressFromBech32(msg.Inputs[0].Address) - return []sdk.AccAddress{addrs} -} - -// GetSigners returns the signer addresses that are expected to sign the result -// of GetSignBytes. -func (msg MsgUpdateParams) GetSigners() []sdk.AccAddress { - authority, _ := sdk.AccAddressFromBech32(msg.Authority) - return []sdk.AccAddress{authority} -} - // NewMsgSetSendEnabled Construct a message to set one or more SendEnabled entries. func NewMsgSetSendEnabled(authority string, sendEnabled []*SendEnabled, useDefaultFor []string) *MsgSetSendEnabled { return &MsgSetSendEnabled{ @@ -52,9 +28,3 @@ func NewMsgSetSendEnabled(authority string, sendEnabled []*SendEnabled, useDefau UseDefaultFor: useDefaultFor, } } - -// GetSigners returns the expected signers for MsgSoftwareUpgrade. -func (msg MsgSetSendEnabled) GetSigners() []sdk.AccAddress { - addr, _ := sdk.AccAddressFromBech32(msg.Authority) - return []sdk.AccAddress{addr} -} diff --git a/x/bank/types/msgs_test.go b/x/bank/types/msgs_test.go index 50c7a7f7aec7..98fc399b67c6 100644 --- a/x/bank/types/msgs_test.go +++ b/x/bank/types/msgs_test.go @@ -9,8 +9,6 @@ import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" ) func TestMsgSendGetSignBytes(t *testing.T) { @@ -122,16 +120,6 @@ func TestMsgMultiSendGetSignBytes(t *testing.T) { require.Equal(t, expected, string(res)) } -func TestMsgMultiSendGetSigners(t *testing.T) { - addr := sdk.AccAddress([]byte("input111111111111111")) - input := NewInput(addr, nil) - msg := NewMsgMultiSend(input, nil) - - res := msg.GetSigners() - require.Equal(t, 1, len(res)) - require.True(t, addr.Equals(res[0])) -} - func TestNewMsgSetSendEnabled(t *testing.T) { // Punt. Just setting one to all non-default values and making sure they're as expected. msg := NewMsgSetSendEnabled("milton", []*SendEnabled{{"barrycoin", true}}, []string{"billcoin"}) @@ -145,14 +133,6 @@ func TestNewMsgSetSendEnabled(t *testing.T) { } } -func TestMsgSendGetSigners(t *testing.T) { - from := sdk.AccAddress([]byte("input111111111111111")) - msg := NewMsgSend(from, sdk.AccAddress{}, sdk.NewCoins()) - res := msg.GetSigners() - require.Equal(t, 1, len(res)) - require.True(t, from.Equals(res[0])) -} - func TestMsgSetSendEnabledGetSignBytes(t *testing.T) { msg := NewMsgSetSendEnabled("cartman", []*SendEnabled{{"casafiestacoin", false}, {"kylecoin", true}}, nil) expected := `{"type":"cosmos-sdk/MsgSetSendEnabled","value":{"authority":"cartman","send_enabled":[{"denom":"casafiestacoin"},{"denom":"kylecoin","enabled":true}]}}` @@ -161,11 +141,3 @@ func TestMsgSetSendEnabledGetSignBytes(t *testing.T) { actual := string(actualBz) assert.Equal(t, expected, actual) } - -func TestMsgSetSendEnabledGetSigners(t *testing.T) { - govModuleAddr := authtypes.NewModuleAddress(govtypes.ModuleName) - msg := NewMsgSetSendEnabled(govModuleAddr.String(), nil, nil) - expected := []sdk.AccAddress{govModuleAddr} - actual := msg.GetSigners() - assert.Equal(t, expected, actual) -} diff --git a/x/bank/types/params_legacy.go b/x/bank/types/params_legacy.go index 668358b4df7a..6f6a25a06999 100644 --- a/x/bank/types/params_legacy.go +++ b/x/bank/types/params_legacy.go @@ -1,6 +1,12 @@ package types -import paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" +import ( + fmt "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/bank/exported" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" +) var ( // KeySendEnabled is store's key for SendEnabled Params @@ -18,6 +24,44 @@ func ParamKeyTable() paramtypes.KeyTable { // Deprecated: ParamSetPairs implements params.ParamSet func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { return paramtypes.ParamSetPairs{ + paramtypes.NewParamSetPair(KeySendEnabled, &p.SendEnabled, validateSendEnabledParams), paramtypes.NewParamSetPair(KeyDefaultSendEnabled, &p.DefaultSendEnabled, validateIsBool), } } + +// SendEnabledParams is a collection of parameters indicating if a coin denom is enabled for sending +type SendEnabledParams []*SendEnabled + +// GetSendEnabledParams retrieves the send enabled parameters from the provided context and legacy subspace. +func GetSendEnabledParams(ctx sdk.Context, legacySubspace exported.Subspace) []*SendEnabled { + var sendEnabled []*SendEnabled + legacySubspace.Get(ctx, KeySendEnabled, &sendEnabled) + return sendEnabled +} + +func validateSendEnabledParams(i interface{}) error { + params, ok := i.([]*SendEnabled) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + // ensure each denom is only registered one time. + registered := make(map[string]bool) + for _, p := range params { + if _, exists := registered[p.Denom]; exists { + return fmt.Errorf("duplicate send enabled parameter found: '%s'", p.Denom) + } + if err := validateSendEnabled(*p); err != nil { + return err + } + registered[p.Denom] = true + } + return nil +} + +func validateSendEnabled(i interface{}) error { + param, ok := i.(SendEnabled) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + return sdk.ValidateDenom(param.Denom) +} diff --git a/x/bank/types/query.pb.go b/x/bank/types/query.pb.go index 5c040434c93a..e9ef76ff6d0b 100644 --- a/x/bank/types/query.pb.go +++ b/x/bank/types/query.pb.go @@ -648,6 +648,7 @@ var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo // QueryParamsResponse defines the response type for querying x/bank parameters. type QueryParamsResponse struct { + // params provides the parameters of the bank module. Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` } @@ -886,6 +887,104 @@ func (m *QueryDenomMetadataResponse) GetMetadata() Metadata { return Metadata{} } +// QueryDenomMetadataByQueryStringRequest is the request type for the Query/DenomMetadata RPC method. +// Identical with QueryDenomMetadataRequest but receives denom as query string. +type QueryDenomMetadataByQueryStringRequest struct { + // denom is the coin denom to query the metadata for. + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` +} + +func (m *QueryDenomMetadataByQueryStringRequest) Reset() { + *m = QueryDenomMetadataByQueryStringRequest{} +} +func (m *QueryDenomMetadataByQueryStringRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDenomMetadataByQueryStringRequest) ProtoMessage() {} +func (*QueryDenomMetadataByQueryStringRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9c6fc1939682df13, []int{18} +} +func (m *QueryDenomMetadataByQueryStringRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDenomMetadataByQueryStringRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDenomMetadataByQueryStringRequest.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 *QueryDenomMetadataByQueryStringRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDenomMetadataByQueryStringRequest.Merge(m, src) +} +func (m *QueryDenomMetadataByQueryStringRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDenomMetadataByQueryStringRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDenomMetadataByQueryStringRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDenomMetadataByQueryStringRequest proto.InternalMessageInfo + +func (m *QueryDenomMetadataByQueryStringRequest) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +// QueryDenomMetadataByQueryStringResponse is the response type for the Query/DenomMetadata RPC +// method. Identical with QueryDenomMetadataResponse but receives denom as query string in request. +type QueryDenomMetadataByQueryStringResponse struct { + // metadata describes and provides all the client information for the requested token. + Metadata Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata"` +} + +func (m *QueryDenomMetadataByQueryStringResponse) Reset() { + *m = QueryDenomMetadataByQueryStringResponse{} +} +func (m *QueryDenomMetadataByQueryStringResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDenomMetadataByQueryStringResponse) ProtoMessage() {} +func (*QueryDenomMetadataByQueryStringResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9c6fc1939682df13, []int{19} +} +func (m *QueryDenomMetadataByQueryStringResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDenomMetadataByQueryStringResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDenomMetadataByQueryStringResponse.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 *QueryDenomMetadataByQueryStringResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDenomMetadataByQueryStringResponse.Merge(m, src) +} +func (m *QueryDenomMetadataByQueryStringResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDenomMetadataByQueryStringResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDenomMetadataByQueryStringResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDenomMetadataByQueryStringResponse proto.InternalMessageInfo + +func (m *QueryDenomMetadataByQueryStringResponse) GetMetadata() Metadata { + if m != nil { + return m.Metadata + } + return Metadata{} +} + // QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, // which queries for a paginated set of all account holders of a particular // denomination. @@ -900,7 +999,7 @@ func (m *QueryDenomOwnersRequest) Reset() { *m = QueryDenomOwnersRequest func (m *QueryDenomOwnersRequest) String() string { return proto.CompactTextString(m) } func (*QueryDenomOwnersRequest) ProtoMessage() {} func (*QueryDenomOwnersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{18} + return fileDescriptor_9c6fc1939682df13, []int{20} } func (m *QueryDenomOwnersRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -959,7 +1058,7 @@ func (m *DenomOwner) Reset() { *m = DenomOwner{} } func (m *DenomOwner) String() string { return proto.CompactTextString(m) } func (*DenomOwner) ProtoMessage() {} func (*DenomOwner) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{19} + return fileDescriptor_9c6fc1939682df13, []int{21} } func (m *DenomOwner) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1015,7 +1114,7 @@ func (m *QueryDenomOwnersResponse) Reset() { *m = QueryDenomOwnersRespon func (m *QueryDenomOwnersResponse) String() string { return proto.CompactTextString(m) } func (*QueryDenomOwnersResponse) ProtoMessage() {} func (*QueryDenomOwnersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{20} + return fileDescriptor_9c6fc1939682df13, []int{22} } func (m *QueryDenomOwnersResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1058,6 +1157,121 @@ func (m *QueryDenomOwnersResponse) GetPagination() *query.PageResponse { return nil } +// QueryDenomOwnersByQueryRequest defines the request type for the DenomOwnersByQuery RPC query, +// which queries for a paginated set of all account holders of a particular +// denomination. +// +// Since: cosmos-sdk 0.50.3 +type QueryDenomOwnersByQueryRequest struct { + // denom defines the coin denomination to query all account holders for. + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryDenomOwnersByQueryRequest) Reset() { *m = QueryDenomOwnersByQueryRequest{} } +func (m *QueryDenomOwnersByQueryRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDenomOwnersByQueryRequest) ProtoMessage() {} +func (*QueryDenomOwnersByQueryRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9c6fc1939682df13, []int{23} +} +func (m *QueryDenomOwnersByQueryRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDenomOwnersByQueryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDenomOwnersByQueryRequest.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 *QueryDenomOwnersByQueryRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDenomOwnersByQueryRequest.Merge(m, src) +} +func (m *QueryDenomOwnersByQueryRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDenomOwnersByQueryRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDenomOwnersByQueryRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDenomOwnersByQueryRequest proto.InternalMessageInfo + +func (m *QueryDenomOwnersByQueryRequest) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func (m *QueryDenomOwnersByQueryRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryDenomOwnersByQueryResponse defines the RPC response of a DenomOwnersByQuery RPC query. +// +// Since: cosmos-sdk 0.50.3 +type QueryDenomOwnersByQueryResponse struct { + DenomOwners []*DenomOwner `protobuf:"bytes,1,rep,name=denom_owners,json=denomOwners,proto3" json:"denom_owners,omitempty"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryDenomOwnersByQueryResponse) Reset() { *m = QueryDenomOwnersByQueryResponse{} } +func (m *QueryDenomOwnersByQueryResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDenomOwnersByQueryResponse) ProtoMessage() {} +func (*QueryDenomOwnersByQueryResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9c6fc1939682df13, []int{24} +} +func (m *QueryDenomOwnersByQueryResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDenomOwnersByQueryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDenomOwnersByQueryResponse.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 *QueryDenomOwnersByQueryResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDenomOwnersByQueryResponse.Merge(m, src) +} +func (m *QueryDenomOwnersByQueryResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDenomOwnersByQueryResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDenomOwnersByQueryResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDenomOwnersByQueryResponse proto.InternalMessageInfo + +func (m *QueryDenomOwnersByQueryResponse) GetDenomOwners() []*DenomOwner { + if m != nil { + return m.DenomOwners + } + return nil +} + +func (m *QueryDenomOwnersByQueryResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + // QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries. // // Since: cosmos-sdk 0.47 @@ -1073,7 +1287,7 @@ func (m *QuerySendEnabledRequest) Reset() { *m = QuerySendEnabledRequest func (m *QuerySendEnabledRequest) String() string { return proto.CompactTextString(m) } func (*QuerySendEnabledRequest) ProtoMessage() {} func (*QuerySendEnabledRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{21} + return fileDescriptor_9c6fc1939682df13, []int{25} } func (m *QuerySendEnabledRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1130,7 +1344,7 @@ func (m *QuerySendEnabledResponse) Reset() { *m = QuerySendEnabledRespon func (m *QuerySendEnabledResponse) String() string { return proto.CompactTextString(m) } func (*QuerySendEnabledResponse) ProtoMessage() {} func (*QuerySendEnabledResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{22} + return fileDescriptor_9c6fc1939682df13, []int{26} } func (m *QuerySendEnabledResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1192,9 +1406,13 @@ func init() { proto.RegisterType((*QueryDenomsMetadataResponse)(nil), "cosmos.bank.v1beta1.QueryDenomsMetadataResponse") proto.RegisterType((*QueryDenomMetadataRequest)(nil), "cosmos.bank.v1beta1.QueryDenomMetadataRequest") proto.RegisterType((*QueryDenomMetadataResponse)(nil), "cosmos.bank.v1beta1.QueryDenomMetadataResponse") + proto.RegisterType((*QueryDenomMetadataByQueryStringRequest)(nil), "cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest") + proto.RegisterType((*QueryDenomMetadataByQueryStringResponse)(nil), "cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse") proto.RegisterType((*QueryDenomOwnersRequest)(nil), "cosmos.bank.v1beta1.QueryDenomOwnersRequest") proto.RegisterType((*DenomOwner)(nil), "cosmos.bank.v1beta1.DenomOwner") proto.RegisterType((*QueryDenomOwnersResponse)(nil), "cosmos.bank.v1beta1.QueryDenomOwnersResponse") + proto.RegisterType((*QueryDenomOwnersByQueryRequest)(nil), "cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest") + proto.RegisterType((*QueryDenomOwnersByQueryResponse)(nil), "cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse") proto.RegisterType((*QuerySendEnabledRequest)(nil), "cosmos.bank.v1beta1.QuerySendEnabledRequest") proto.RegisterType((*QuerySendEnabledResponse)(nil), "cosmos.bank.v1beta1.QuerySendEnabledResponse") } @@ -1202,84 +1420,91 @@ func init() { func init() { proto.RegisterFile("cosmos/bank/v1beta1/query.proto", fileDescriptor_9c6fc1939682df13) } var fileDescriptor_9c6fc1939682df13 = []byte{ - // 1225 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xf6, 0xa4, 0xaa, 0x93, 0x3c, 0xa7, 0x95, 0x3a, 0x0d, 0x34, 0xd9, 0x10, 0x3b, 0x6c, 0xaa, - 0xc6, 0x09, 0xc9, 0x6e, 0xe3, 0x20, 0x44, 0xab, 0x12, 0xa9, 0x4e, 0x49, 0x0f, 0x08, 0xb5, 0x38, - 0xf4, 0x02, 0x07, 0x6b, 0xed, 0x1d, 0x8c, 0x15, 0x7b, 0xd7, 0xf5, 0xac, 0x5b, 0xac, 0x2a, 0x12, - 0x42, 0x42, 0xea, 0x11, 0x89, 0x9e, 0x2a, 0x21, 0x45, 0x48, 0x40, 0x05, 0x12, 0xaa, 0x10, 0x47, - 0x8e, 0x1c, 0x7a, 0xac, 0xe0, 0x00, 0xa7, 0x82, 0x12, 0xa4, 0xf6, 0xcf, 0x40, 0x9e, 0x1f, 0xde, - 0x5d, 0x7b, 0xbc, 0xd9, 0xa4, 0x06, 0x21, 0x2e, 0xad, 0x3d, 0xf3, 0xde, 0xbc, 0xef, 0x7d, 0xef, - 0xcd, 0xbc, 0xcf, 0x81, 0x4c, 0xd9, 0xa5, 0x75, 0x97, 0x9a, 0x25, 0xcb, 0xd9, 0x36, 0x6f, 0xad, - 0x96, 0x88, 0x67, 0xad, 0x9a, 0x37, 0x5b, 0xa4, 0xd9, 0x36, 0x1a, 0x4d, 0xd7, 0x73, 0xf1, 0x69, - 0x6e, 0x60, 0x74, 0x0c, 0x0c, 0x61, 0xa0, 0x2d, 0x75, 0xbd, 0x28, 0xe1, 0xd6, 0x5d, 0xdf, 0x86, - 0x55, 0xa9, 0x3a, 0x96, 0x57, 0x75, 0x1d, 0x7e, 0x80, 0x36, 0x59, 0x71, 0x2b, 0x2e, 0xfb, 0x68, - 0x76, 0x3e, 0x89, 0xd5, 0x97, 0x2a, 0xae, 0x5b, 0xa9, 0x11, 0xd3, 0x6a, 0x54, 0x4d, 0xcb, 0x71, - 0x5c, 0x8f, 0xb9, 0x50, 0xb1, 0x9b, 0x0e, 0x9e, 0x2f, 0x4f, 0x2e, 0xbb, 0x55, 0xa7, 0x6f, 0x3f, - 0x80, 0x9a, 0x21, 0xe4, 0xfb, 0xd3, 0x7c, 0xbf, 0xc8, 0xc3, 0x8a, 0x0c, 0xf8, 0xd6, 0x8c, 0x70, - 0x95, 0xa8, 0x83, 0xc9, 0x6a, 0xa7, 0xac, 0x7a, 0xd5, 0x71, 0x4d, 0xf6, 0x2f, 0x5f, 0xd2, 0xab, - 0x70, 0xfa, 0x9d, 0x8e, 0x45, 0xde, 0xaa, 0x59, 0x4e, 0x99, 0x14, 0xc8, 0xcd, 0x16, 0xa1, 0x1e, - 0xce, 0xc1, 0xa8, 0x65, 0xdb, 0x4d, 0x42, 0xe9, 0x14, 0x9a, 0x43, 0xd9, 0xf1, 0xfc, 0xd4, 0x2f, - 0x3f, 0xae, 0x4c, 0x8a, 0x48, 0x97, 0xf9, 0xce, 0x96, 0xd7, 0xac, 0x3a, 0x95, 0x82, 0x34, 0xc4, - 0x93, 0x70, 0xdc, 0x26, 0x8e, 0x5b, 0x9f, 0x1a, 0xe9, 0x78, 0x14, 0xf8, 0x97, 0x8b, 0x63, 0x77, - 0x77, 0x33, 0x89, 0x67, 0xbb, 0x99, 0x84, 0xfe, 0x16, 0x4c, 0x86, 0x43, 0xd1, 0x86, 0xeb, 0x50, - 0x82, 0xd7, 0x60, 0xb4, 0xc4, 0x97, 0x58, 0xac, 0x54, 0x6e, 0xda, 0xe8, 0x16, 0x85, 0x12, 0x59, - 0x14, 0x63, 0xc3, 0xad, 0x3a, 0x05, 0x69, 0xa9, 0xff, 0x8c, 0xe0, 0x0c, 0x3b, 0xed, 0x72, 0xad, - 0x26, 0x0e, 0xa4, 0xcf, 0x03, 0x7e, 0x13, 0xc0, 0x2f, 0x2d, 0xcb, 0x20, 0x95, 0x3b, 0x17, 0xc2, - 0xc1, 0x89, 0x94, 0x68, 0xae, 0x5b, 0x15, 0x49, 0x56, 0x21, 0xe0, 0x89, 0xe7, 0xe1, 0x44, 0x93, - 0x50, 0xb7, 0x76, 0x8b, 0x14, 0x39, 0x19, 0xc7, 0xe6, 0x50, 0x76, 0xac, 0x30, 0x21, 0x16, 0xaf, - 0xf4, 0x70, 0xb2, 0x87, 0x60, 0xaa, 0x3f, 0x0d, 0x41, 0xcc, 0x0e, 0x8c, 0x89, 0x74, 0x3b, 0x89, - 0x1c, 0x8b, 0x64, 0x26, 0xbf, 0xf9, 0xe8, 0x49, 0x26, 0xf1, 0xed, 0x1f, 0x99, 0x6c, 0xa5, 0xea, - 0x7d, 0xd8, 0x2a, 0x19, 0x65, 0xb7, 0x2e, 0x3a, 0x43, 0xfc, 0xb7, 0x42, 0xed, 0x6d, 0xd3, 0x6b, - 0x37, 0x08, 0x65, 0x0e, 0xf4, 0xfe, 0xd3, 0x87, 0x4b, 0x13, 0x35, 0x52, 0xb1, 0xca, 0xed, 0x62, - 0xa7, 0xf7, 0xe8, 0x83, 0xa7, 0x0f, 0x97, 0x50, 0xa1, 0x1b, 0x12, 0x5f, 0x55, 0x50, 0xb2, 0x70, - 0x20, 0x25, 0x1c, 0x7b, 0x90, 0x13, 0xfd, 0x2b, 0x04, 0xb3, 0x2c, 0xc9, 0xad, 0x06, 0x71, 0x6c, - 0xab, 0x54, 0x23, 0xff, 0xa1, 0x8a, 0x05, 0x8a, 0xf1, 0x0c, 0x41, 0x7a, 0x10, 0xce, 0xff, 0x59, - 0x49, 0xda, 0x30, 0xaf, 0xcc, 0x34, 0xdf, 0x66, 0x1d, 0xfa, 0x4f, 0x3e, 0x03, 0xef, 0xc3, 0xd9, - 0xe8, 0xd0, 0xcf, 0xf3, 0x2c, 0x6c, 0x8b, 0x57, 0xe1, 0x5d, 0xd7, 0xb3, 0x6a, 0x5b, 0xad, 0x46, - 0xa3, 0xd6, 0x96, 0xb9, 0x84, 0xfb, 0x05, 0x0d, 0xa1, 0x5f, 0x9e, 0xc8, 0xcb, 0x1b, 0x8a, 0x26, - 0xe0, 0xb7, 0x21, 0x49, 0xd9, 0xca, 0xbf, 0xd7, 0x27, 0x22, 0xe0, 0xf0, 0xba, 0x64, 0x59, 0xbc, - 0xd8, 0x3c, 0xb5, 0x6b, 0x1f, 0x48, 0x2a, 0xbb, 0x25, 0x46, 0x81, 0x12, 0xeb, 0x37, 0xe0, 0x85, - 0x1e, 0x6b, 0x41, 0xc5, 0x25, 0x48, 0x5a, 0x75, 0xb7, 0xe5, 0x78, 0x07, 0x16, 0x32, 0x3f, 0xde, - 0xa1, 0x42, 0x64, 0xc3, 0x7d, 0xf4, 0x49, 0xc0, 0xec, 0xd8, 0xeb, 0x56, 0xd3, 0xaa, 0xcb, 0x17, - 0x43, 0xbf, 0x21, 0xe6, 0x96, 0x5c, 0x15, 0xa1, 0xd6, 0x21, 0xd9, 0x60, 0x2b, 0x22, 0xd4, 0x8c, - 0xa1, 0x98, 0xef, 0x06, 0x77, 0x0a, 0x05, 0xe3, 0x5e, 0xba, 0x0d, 0x1a, 0x3b, 0x96, 0xb5, 0x22, - 0x7d, 0x9b, 0x78, 0x96, 0x6d, 0x79, 0xd6, 0x90, 0x5b, 0x48, 0xff, 0x1e, 0xc1, 0x8c, 0x32, 0x8c, - 0xc8, 0x62, 0x13, 0xc6, 0xeb, 0x62, 0x4d, 0x3e, 0x33, 0xb3, 0xca, 0x44, 0xa4, 0x67, 0x30, 0x15, - 0xdf, 0x75, 0x78, 0x8d, 0xb0, 0x0a, 0xd3, 0x3e, 0xde, 0x5e, 0x56, 0xd4, 0xdd, 0x50, 0x0a, 0x32, - 0xd9, 0x97, 0xe1, 0x15, 0x18, 0x93, 0x30, 0x05, 0x8f, 0xf1, 0x13, 0xec, 0x7a, 0xea, 0xb7, 0xc5, - 0x6d, 0x67, 0x31, 0xae, 0xdd, 0x76, 0x48, 0x93, 0x46, 0x82, 0x1a, 0xd6, 0xcc, 0xd0, 0x3f, 0x46, - 0x00, 0x7e, 0xd0, 0x23, 0x3d, 0x93, 0xeb, 0xfe, 0xf3, 0x36, 0x72, 0x88, 0x5b, 0xd1, 0x7d, 0xe9, - 0xbe, 0x91, 0x8f, 0x4f, 0x28, 0x79, 0x41, 0x6f, 0x1e, 0x26, 0x58, 0xc2, 0x45, 0x97, 0xad, 0x8b, - 0x1e, 0xca, 0x28, 0x29, 0xf6, 0xfd, 0x0b, 0x29, 0xdb, 0x3f, 0x6b, 0x98, 0xb3, 0x86, 0x57, 0x69, - 0x8b, 0x38, 0xf6, 0x9b, 0x4e, 0xe7, 0xc5, 0xb7, 0x65, 0x95, 0x5e, 0x84, 0x24, 0x0b, 0xc9, 0x11, - 0x8e, 0x17, 0xc4, 0xb7, 0x9e, 0x3a, 0x95, 0x8f, 0x5c, 0xa7, 0x07, 0x92, 0xa4, 0x50, 0x6c, 0x41, - 0xd2, 0x06, 0x4c, 0x50, 0xe2, 0xd8, 0x45, 0xc2, 0xd7, 0x05, 0x49, 0x73, 0x4a, 0x92, 0x82, 0xfe, - 0x29, 0xea, 0x7f, 0xe9, 0x61, 0xa9, 0x7c, 0x64, 0x96, 0x72, 0x3f, 0x9c, 0x84, 0xe3, 0x0c, 0x2a, - 0xfe, 0x02, 0xc1, 0xa8, 0x98, 0x89, 0x38, 0xab, 0x44, 0xa3, 0x50, 0xec, 0xda, 0x62, 0x0c, 0x4b, - 0x1e, 0x56, 0x7f, 0xe3, 0x6e, 0xa7, 0x95, 0x3e, 0xf9, 0xf5, 0xaf, 0xcf, 0x47, 0x72, 0xf8, 0xbc, - 0xa9, 0xfe, 0xb1, 0xc1, 0x15, 0x87, 0x79, 0x47, 0xf4, 0xeb, 0x8e, 0x59, 0x6a, 0x73, 0x45, 0x8b, - 0x77, 0x11, 0xa4, 0x02, 0x72, 0x15, 0x2f, 0x0f, 0x8e, 0xdc, 0x2f, 0xce, 0xb5, 0x95, 0x98, 0xd6, - 0x02, 0xeb, 0xab, 0x3e, 0xd6, 0x45, 0xbc, 0x10, 0x13, 0x2b, 0xfe, 0x09, 0xc1, 0xa9, 0x3e, 0x11, - 0x87, 0x73, 0x83, 0x43, 0x0f, 0x52, 0xa6, 0xda, 0xda, 0xa1, 0x7c, 0x04, 0xe8, 0x75, 0x1f, 0xf4, - 0x1a, 0x5e, 0x55, 0x82, 0xa6, 0xd2, 0xb9, 0xa8, 0x80, 0xff, 0x1b, 0x82, 0x33, 0x03, 0xe4, 0x11, - 0x7e, 0x3d, 0x3e, 0xa0, 0xb0, 0x98, 0xd3, 0x2e, 0x1c, 0xc1, 0x53, 0x24, 0x74, 0xd5, 0x4f, 0xe8, - 0x12, 0xbe, 0x78, 0xe8, 0x84, 0xfc, 0xde, 0xb9, 0x87, 0x20, 0x15, 0x50, 0x4b, 0x51, 0xbd, 0xd3, - 0x2f, 0xe1, 0xa2, 0x7a, 0x47, 0x21, 0xc1, 0xf4, 0xac, 0x8f, 0x7a, 0x16, 0xcf, 0xa8, 0x51, 0x73, - 0x18, 0xf7, 0x10, 0x8c, 0x49, 0xd9, 0x82, 0x23, 0x6e, 0x52, 0x8f, 0x10, 0xd2, 0x96, 0xe2, 0x98, - 0x0a, 0x34, 0xab, 0x3e, 0x9a, 0x73, 0xf8, 0x6c, 0x04, 0x1a, 0x9f, 0xad, 0x4f, 0x11, 0x24, 0xb9, - 0x56, 0xc1, 0x0b, 0x83, 0x23, 0x85, 0x84, 0x91, 0x96, 0x3d, 0xd8, 0x30, 0x3e, 0x3d, 0x5c, 0x15, - 0xe1, 0xef, 0x10, 0x9c, 0x08, 0xcd, 0x71, 0x6c, 0x0c, 0x8e, 0xa2, 0xd2, 0x08, 0x9a, 0x19, 0xdb, - 0x5e, 0x80, 0xbb, 0xe0, 0x83, 0x33, 0xf0, 0xb2, 0x12, 0x1c, 0x9f, 0x15, 0x45, 0xa9, 0x06, 0xcc, - 0x3b, 0x6c, 0x61, 0x07, 0x7f, 0x8d, 0xe0, 0x64, 0x58, 0x58, 0xe1, 0x83, 0xc2, 0xf7, 0x2a, 0x3d, - 0xed, 0x7c, 0x7c, 0x87, 0xf8, 0xe5, 0xed, 0x01, 0x8c, 0xbf, 0x44, 0x90, 0x0a, 0x4c, 0xef, 0xa8, - 0xcb, 0xd0, 0xaf, 0x70, 0xa2, 0x2e, 0x83, 0x42, 0x12, 0xe8, 0xaf, 0xf9, 0xf8, 0x5e, 0xc1, 0x8b, - 0x83, 0xf1, 0x09, 0xc9, 0xd0, 0x65, 0xf3, 0x3e, 0x82, 0x54, 0x60, 0xfa, 0x45, 0x81, 0xec, 0x1f, - 0xf0, 0x51, 0x20, 0x15, 0x23, 0x59, 0x37, 0x7c, 0x90, 0xf3, 0xf8, 0x65, 0xf5, 0x1d, 0x09, 0x8c, - 0xec, 0xfc, 0xc6, 0xa3, 0xbd, 0x34, 0x7a, 0xbc, 0x97, 0x46, 0x7f, 0xee, 0xa5, 0xd1, 0x67, 0xfb, - 0xe9, 0xc4, 0xe3, 0xfd, 0x74, 0xe2, 0xf7, 0xfd, 0x74, 0xe2, 0xbd, 0xc5, 0xc8, 0xdf, 0x52, 0x1f, - 0xf1, 0x33, 0xd9, 0x4f, 0xaa, 0x52, 0x92, 0xfd, 0x25, 0x6c, 0xed, 0xef, 0x00, 0x00, 0x00, 0xff, - 0xff, 0x71, 0x4c, 0x05, 0x91, 0x2c, 0x14, 0x00, 0x00, + // 1332 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0x41, 0x6f, 0x1b, 0x45, + 0x14, 0xf6, 0xb4, 0xaa, 0x9b, 0x3c, 0xa7, 0x48, 0x99, 0x06, 0x9a, 0x6c, 0x88, 0x1d, 0x36, 0x55, + 0xe2, 0x58, 0xc9, 0x6e, 0xed, 0x44, 0x40, 0x4b, 0x1a, 0x29, 0x4e, 0x49, 0x0f, 0x08, 0xb5, 0x38, + 0xf4, 0x02, 0x07, 0x6b, 0xed, 0x1d, 0x8c, 0x15, 0x7b, 0xd7, 0xf5, 0x6c, 0x5a, 0x56, 0x55, 0x10, + 0x42, 0x42, 0xea, 0x11, 0x89, 0x9e, 0x2a, 0x21, 0xe5, 0x52, 0xa8, 0x38, 0x44, 0x3d, 0x70, 0xe0, + 0xc0, 0x91, 0x43, 0x8f, 0x11, 0x1c, 0x40, 0x1c, 0x0a, 0x4a, 0x90, 0xda, 0x9f, 0x81, 0x3c, 0x33, + 0xeb, 0xdd, 0xb5, 0xd7, 0xeb, 0x4d, 0x6a, 0xaa, 0x8a, 0x4b, 0x62, 0xcf, 0xbc, 0x37, 0xef, 0x7b, + 0xdf, 0xbc, 0x79, 0xf3, 0x8d, 0x21, 0x55, 0x36, 0x69, 0xdd, 0xa4, 0x6a, 0x49, 0x33, 0xb6, 0xd4, + 0x5b, 0xd9, 0x12, 0xb1, 0xb4, 0xac, 0x7a, 0x73, 0x9b, 0x34, 0x6d, 0xa5, 0xd1, 0x34, 0x2d, 0x13, + 0x9f, 0xe5, 0x06, 0x4a, 0xcb, 0x40, 0x11, 0x06, 0x52, 0xa6, 0xed, 0x45, 0x09, 0xb7, 0x6e, 0xfb, + 0x36, 0xb4, 0x4a, 0xd5, 0xd0, 0xac, 0xaa, 0x69, 0xf0, 0x05, 0xa4, 0xb1, 0x8a, 0x59, 0x31, 0xd9, + 0x47, 0xb5, 0xf5, 0x49, 0x8c, 0xbe, 0x5e, 0x31, 0xcd, 0x4a, 0x8d, 0xa8, 0x5a, 0xa3, 0xaa, 0x6a, + 0x86, 0x61, 0x5a, 0xcc, 0x85, 0x8a, 0xd9, 0xa4, 0x77, 0x7d, 0x67, 0xe5, 0xb2, 0x59, 0x35, 0xba, + 0xe6, 0x3d, 0xa8, 0x19, 0x42, 0x3e, 0x3f, 0xc1, 0xe7, 0x8b, 0x3c, 0xac, 0xc8, 0x80, 0x4f, 0x4d, + 0x0a, 0x57, 0x07, 0xb5, 0x37, 0x59, 0x69, 0x54, 0xab, 0x57, 0x0d, 0x53, 0x65, 0x7f, 0xf9, 0x90, + 0x5c, 0x85, 0xb3, 0x1f, 0xb4, 0x2c, 0xf2, 0x5a, 0x4d, 0x33, 0xca, 0xa4, 0x40, 0x6e, 0x6e, 0x13, + 0x6a, 0xe1, 0x1c, 0x9c, 0xd6, 0x74, 0xbd, 0x49, 0x28, 0x1d, 0x47, 0xd3, 0x28, 0x3d, 0x9c, 0x1f, + 0xff, 0xf5, 0xc7, 0xc5, 0x31, 0x11, 0x69, 0x8d, 0xcf, 0x6c, 0x5a, 0xcd, 0xaa, 0x51, 0x29, 0x38, + 0x86, 0x78, 0x0c, 0x4e, 0xe9, 0xc4, 0x30, 0xeb, 0xe3, 0x27, 0x5a, 0x1e, 0x05, 0xfe, 0xe5, 0xd2, + 0xd0, 0xdd, 0xdd, 0x54, 0xec, 0xd9, 0x6e, 0x2a, 0x26, 0xbf, 0x07, 0x63, 0xfe, 0x50, 0xb4, 0x61, + 0x1a, 0x94, 0xe0, 0x25, 0x38, 0x5d, 0xe2, 0x43, 0x2c, 0x56, 0x22, 0x37, 0xa1, 0xb4, 0x37, 0x85, + 0x12, 0x67, 0x53, 0x94, 0x75, 0xb3, 0x6a, 0x14, 0x1c, 0x4b, 0xf9, 0x17, 0x04, 0xe7, 0xd8, 0x6a, + 0x6b, 0xb5, 0x9a, 0x58, 0x90, 0x3e, 0x0f, 0xf8, 0x0d, 0x00, 0x77, 0x6b, 0x59, 0x06, 0x89, 0xdc, + 0xac, 0x0f, 0x07, 0x27, 0xd2, 0x41, 0x73, 0x5d, 0xab, 0x38, 0x64, 0x15, 0x3c, 0x9e, 0x78, 0x06, + 0xce, 0x34, 0x09, 0x35, 0x6b, 0xb7, 0x48, 0x91, 0x93, 0x71, 0x72, 0x1a, 0xa5, 0x87, 0x0a, 0x23, + 0x62, 0xf0, 0x4a, 0x07, 0x27, 0x07, 0x08, 0xc6, 0xbb, 0xd3, 0x10, 0xc4, 0xec, 0xc0, 0x90, 0x48, + 0xb7, 0x95, 0xc8, 0xc9, 0x50, 0x66, 0xf2, 0x1b, 0x8f, 0x9f, 0xa4, 0x62, 0x3f, 0xfc, 0x95, 0x4a, + 0x57, 0xaa, 0xd6, 0xa7, 0xdb, 0x25, 0xa5, 0x6c, 0xd6, 0x45, 0x65, 0x88, 0x7f, 0x8b, 0x54, 0xdf, + 0x52, 0x2d, 0xbb, 0x41, 0x28, 0x73, 0xa0, 0xf7, 0x9f, 0x3e, 0xca, 0x8c, 0xd4, 0x48, 0x45, 0x2b, + 0xdb, 0xc5, 0x56, 0xed, 0xd1, 0x87, 0x4f, 0x1f, 0x65, 0x50, 0xa1, 0x1d, 0x12, 0x5f, 0x0d, 0xa0, + 0x64, 0xae, 0x2f, 0x25, 0x1c, 0xbb, 0x97, 0x13, 0xf9, 0x01, 0x82, 0x29, 0x96, 0xe4, 0x66, 0x83, + 0x18, 0xba, 0x56, 0xaa, 0x91, 0x97, 0x68, 0xc7, 0x3c, 0x9b, 0xf1, 0x0c, 0x41, 0xb2, 0x17, 0xce, + 0xff, 0xd9, 0x96, 0xd8, 0x30, 0x13, 0x98, 0x69, 0xde, 0x66, 0x15, 0xfa, 0x5f, 0xb6, 0x81, 0x8f, + 0xe1, 0x7c, 0x78, 0xe8, 0xe7, 0x69, 0x0b, 0x5b, 0xa2, 0x2b, 0x7c, 0x68, 0x5a, 0x5a, 0x6d, 0x73, + 0xbb, 0xd1, 0xa8, 0xd9, 0x4e, 0x2e, 0xfe, 0x7a, 0x41, 0x03, 0xa8, 0x97, 0x27, 0xce, 0xe1, 0xf5, + 0x45, 0x13, 0xf0, 0x6d, 0x88, 0x53, 0x36, 0xf2, 0xe2, 0xea, 0x44, 0x04, 0x1c, 0x5c, 0x95, 0x2c, + 0x88, 0x8e, 0xcd, 0x53, 0xbb, 0xf6, 0x89, 0x43, 0x65, 0x7b, 0x8b, 0x91, 0x67, 0x8b, 0xe5, 0x1b, + 0xf0, 0x6a, 0x87, 0xb5, 0xa0, 0x62, 0x05, 0xe2, 0x5a, 0xdd, 0xdc, 0x36, 0xac, 0xbe, 0x1b, 0x99, + 0x1f, 0x6e, 0x51, 0x21, 0xb2, 0xe1, 0x3e, 0xf2, 0x18, 0x60, 0xb6, 0xec, 0x75, 0xad, 0xa9, 0xd5, + 0x9d, 0x8e, 0x21, 0xdf, 0x10, 0xf7, 0x96, 0x33, 0x2a, 0x42, 0xad, 0x42, 0xbc, 0xc1, 0x46, 0x44, + 0xa8, 0x49, 0x25, 0xe0, 0x7e, 0x57, 0xb8, 0x93, 0x2f, 0x18, 0xf7, 0x92, 0x75, 0x90, 0xd8, 0xb2, + 0xac, 0x14, 0xe9, 0xfb, 0xc4, 0xd2, 0x74, 0xcd, 0xd2, 0x06, 0x5c, 0x42, 0xf2, 0x1e, 0x82, 0xc9, + 0xc0, 0x30, 0x22, 0x8b, 0x0d, 0x18, 0xae, 0x8b, 0x31, 0xa7, 0xcd, 0x4c, 0x05, 0x26, 0xe2, 0x78, + 0x7a, 0x53, 0x71, 0x5d, 0x07, 0x57, 0x08, 0x59, 0x98, 0x70, 0xf1, 0x76, 0xb2, 0x12, 0x5c, 0x0d, + 0x25, 0x2f, 0x93, 0x5d, 0x19, 0x5e, 0x81, 0x21, 0x07, 0xa6, 0xe0, 0x31, 0x7a, 0x82, 0x6d, 0x4f, + 0x79, 0x15, 0x66, 0xbb, 0x63, 0xe4, 0x6d, 0x5e, 0x85, 0xbc, 0x2d, 0x85, 0x62, 0x34, 0x61, 0xae, + 0xaf, 0xff, 0x40, 0x01, 0xdf, 0x16, 0xed, 0x89, 0x05, 0xbc, 0x76, 0xdb, 0x20, 0x4d, 0x1a, 0x8a, + 0x70, 0x50, 0x97, 0x9c, 0xfc, 0x05, 0x02, 0x70, 0x83, 0x1e, 0xab, 0xaf, 0xaf, 0xba, 0xfd, 0xf8, + 0xc4, 0x11, 0x8e, 0x71, 0xbb, 0x35, 0x7f, 0xef, 0x74, 0x4b, 0x5f, 0xf2, 0x82, 0xde, 0x3c, 0x8c, + 0xb0, 0x84, 0x8b, 0x26, 0x1b, 0x17, 0x45, 0x9f, 0x0a, 0xa4, 0xd8, 0xf5, 0x2f, 0x24, 0x74, 0x77, + 0xad, 0xc1, 0x55, 0xfb, 0xe7, 0x42, 0x06, 0x78, 0x80, 0x8a, 0xa2, 0x78, 0x31, 0x9b, 0xb5, 0x87, + 0x20, 0xd5, 0x13, 0xc0, 0xcb, 0x48, 0x98, 0x2d, 0xca, 0x7a, 0x93, 0x18, 0xfa, 0xbb, 0x46, 0xeb, + 0x4e, 0xd7, 0x1d, 0xa6, 0x5e, 0x83, 0x38, 0x0b, 0xc9, 0x11, 0x0e, 0x17, 0xc4, 0xb7, 0x0e, 0xae, + 0xca, 0xc7, 0xe6, 0xea, 0xa1, 0x53, 0x55, 0xbe, 0xd8, 0x82, 0xa4, 0x75, 0x18, 0xa1, 0xc4, 0xd0, + 0x8b, 0x84, 0x8f, 0x0b, 0x92, 0xa6, 0x03, 0x49, 0xf2, 0xfa, 0x27, 0xa8, 0xfb, 0xa5, 0x83, 0xa5, + 0xf2, 0xb1, 0x59, 0xca, 0xed, 0x8f, 0xc2, 0x29, 0x06, 0x15, 0x7f, 0x8b, 0xe0, 0xb4, 0x50, 0x3d, + 0x38, 0x1d, 0x88, 0x26, 0xe0, 0x4d, 0x26, 0xcd, 0x47, 0xb0, 0xe4, 0x61, 0xe5, 0xcb, 0x77, 0x5b, + 0x67, 0xef, 0xcb, 0xdf, 0xfe, 0xf9, 0xe6, 0x44, 0x0e, 0x5f, 0x50, 0x83, 0x9f, 0x93, 0x5c, 0x53, + 0xaa, 0x77, 0xc4, 0x01, 0xdf, 0x51, 0x4b, 0x36, 0x7f, 0xb3, 0xe0, 0x5d, 0x04, 0x09, 0xcf, 0x83, + 0x04, 0x2f, 0xf4, 0x8e, 0xdc, 0xfd, 0xfc, 0x92, 0x16, 0x23, 0x5a, 0x0b, 0xac, 0xcb, 0x2e, 0xd6, + 0x79, 0x3c, 0x17, 0x11, 0x2b, 0xfe, 0x19, 0xc1, 0x68, 0x97, 0x4c, 0xc7, 0xb9, 0xde, 0xa1, 0x7b, + 0xbd, 0x3d, 0xa4, 0xa5, 0x23, 0xf9, 0x08, 0xd0, 0xab, 0x2e, 0xe8, 0x25, 0x9c, 0x0d, 0x04, 0x4d, + 0x1d, 0xe7, 0x62, 0x00, 0xfc, 0xdf, 0x11, 0x9c, 0xeb, 0x21, 0x80, 0xf1, 0xdb, 0xd1, 0x01, 0xf9, + 0xe5, 0xba, 0x74, 0xf1, 0x18, 0x9e, 0x22, 0xa1, 0xab, 0x6e, 0x42, 0x2b, 0xf8, 0xd2, 0x91, 0x13, + 0x72, 0x6b, 0xe7, 0x1e, 0x82, 0x84, 0x47, 0x0f, 0x87, 0xd5, 0x4e, 0xb7, 0x48, 0x0f, 0xab, 0x9d, + 0x00, 0x91, 0x2d, 0xa7, 0x5d, 0xd4, 0x53, 0x78, 0x32, 0x18, 0x35, 0x87, 0x71, 0x0f, 0xc1, 0x90, + 0x23, 0x4c, 0x71, 0xc8, 0x49, 0xea, 0x90, 0xba, 0x52, 0x26, 0x8a, 0xa9, 0x40, 0x93, 0x75, 0xd1, + 0xcc, 0xe2, 0xf3, 0x21, 0x68, 0x5c, 0xb6, 0xbe, 0x42, 0x10, 0xe7, 0x6a, 0x14, 0xcf, 0xf5, 0x8e, + 0xe4, 0x93, 0xbe, 0x52, 0xba, 0xbf, 0x61, 0x74, 0x7a, 0xb8, 0xee, 0xc5, 0xdf, 0x21, 0x78, 0xc5, + 0x2f, 0x46, 0xb1, 0xda, 0x3b, 0x4c, 0xa0, 0x3a, 0x96, 0x2e, 0x44, 0x77, 0x88, 0x4e, 0x18, 0xbf, + 0x2e, 0x8a, 0x8e, 0x82, 0xc2, 0x7b, 0x08, 0xce, 0xf8, 0xe4, 0x1a, 0x56, 0xfa, 0x84, 0xed, 0x84, + 0xa9, 0x46, 0xb6, 0x17, 0x28, 0x57, 0x5c, 0x94, 0x59, 0xac, 0x46, 0x41, 0xa9, 0xde, 0x61, 0x03, + 0x97, 0x33, 0x99, 0x1d, 0xfc, 0x27, 0x02, 0xa9, 0xb7, 0xbe, 0xc4, 0xef, 0x44, 0x44, 0x13, 0xa4, + 0x6a, 0xa5, 0x95, 0xe3, 0x39, 0x8b, 0xbc, 0xd6, 0xdc, 0xbc, 0xde, 0xc4, 0xcb, 0x51, 0xf2, 0x2a, + 0x96, 0xec, 0x22, 0xbb, 0xec, 0x8a, 0x94, 0xa3, 0x7f, 0x80, 0x20, 0xe1, 0x11, 0x29, 0x61, 0x87, + 0xbd, 0x5b, 0xf2, 0x86, 0x1d, 0xf6, 0x00, 0x8d, 0x28, 0x5f, 0x74, 0xf1, 0x2a, 0x78, 0xa1, 0x37, + 0x5e, 0x21, 0x89, 0xbc, 0x9b, 0xf0, 0x13, 0x02, 0xdc, 0x2d, 0xa6, 0xf0, 0x52, 0x24, 0x00, 0x7e, + 0xed, 0x27, 0x2d, 0x1f, 0xcd, 0x49, 0x80, 0x7f, 0xcb, 0x05, 0xbf, 0x80, 0x33, 0x7d, 0xc1, 0xb7, + 0x99, 0xc6, 0xf7, 0x11, 0x24, 0x3c, 0xda, 0x24, 0x8c, 0xe2, 0x6e, 0xf9, 0x15, 0x46, 0x71, 0x80, + 0x60, 0x92, 0x15, 0x17, 0xe5, 0x0c, 0x7e, 0x23, 0xb8, 0x83, 0x79, 0x04, 0x55, 0x7e, 0xfd, 0xf1, + 0x41, 0x12, 0xed, 0x1f, 0x24, 0xd1, 0xdf, 0x07, 0x49, 0xf4, 0xf5, 0x61, 0x32, 0xb6, 0x7f, 0x98, + 0x8c, 0xfd, 0x71, 0x98, 0x8c, 0x7d, 0x34, 0x1f, 0xfa, 0x5b, 0xc6, 0x67, 0x7c, 0x4d, 0xf6, 0x93, + 0x46, 0x29, 0xce, 0x7e, 0x89, 0x5e, 0xfa, 0x37, 0x00, 0x00, 0xff, 0xff, 0xa0, 0x0d, 0x95, 0x98, + 0xac, 0x17, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1329,11 +1554,13 @@ type QueryClient interface { SupplyOf(ctx context.Context, in *QuerySupplyOfRequest, opts ...grpc.CallOption) (*QuerySupplyOfResponse, error) // Params queries the parameters of x/bank module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // DenomsMetadata queries the client metadata of a given coin denomination. - DenomMetadata(ctx context.Context, in *QueryDenomMetadataRequest, opts ...grpc.CallOption) (*QueryDenomMetadataResponse, error) // DenomsMetadata queries the client metadata for all registered coin // denominations. DenomsMetadata(ctx context.Context, in *QueryDenomsMetadataRequest, opts ...grpc.CallOption) (*QueryDenomsMetadataResponse, error) + // DenomMetadata queries the client metadata of a given coin denomination. + DenomMetadata(ctx context.Context, in *QueryDenomMetadataRequest, opts ...grpc.CallOption) (*QueryDenomMetadataResponse, error) + // DenomMetadataByQueryString queries the client metadata of a given coin denomination. + DenomMetadataByQueryString(ctx context.Context, in *QueryDenomMetadataByQueryStringRequest, opts ...grpc.CallOption) (*QueryDenomMetadataByQueryStringResponse, error) // DenomOwners queries for all account addresses that own a particular token // denomination. // @@ -1342,6 +1569,11 @@ type QueryClient interface { // // Since: cosmos-sdk 0.46 DenomOwners(ctx context.Context, in *QueryDenomOwnersRequest, opts ...grpc.CallOption) (*QueryDenomOwnersResponse, error) + // DenomOwnersByQuery queries for all account addresses that own a particular token + // denomination. + // + // Since: cosmos-sdk 0.50.3 + DenomOwnersByQuery(ctx context.Context, in *QueryDenomOwnersByQueryRequest, opts ...grpc.CallOption) (*QueryDenomOwnersByQueryResponse, error) // SendEnabled queries for SendEnabled entries. // // This query only returns denominations that have specific SendEnabled settings. @@ -1423,6 +1655,15 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . return out, nil } +func (c *queryClient) DenomsMetadata(ctx context.Context, in *QueryDenomsMetadataRequest, opts ...grpc.CallOption) (*QueryDenomsMetadataResponse, error) { + out := new(QueryDenomsMetadataResponse) + err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/DenomsMetadata", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) DenomMetadata(ctx context.Context, in *QueryDenomMetadataRequest, opts ...grpc.CallOption) (*QueryDenomMetadataResponse, error) { out := new(QueryDenomMetadataResponse) err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/DenomMetadata", in, out, opts...) @@ -1432,9 +1673,9 @@ func (c *queryClient) DenomMetadata(ctx context.Context, in *QueryDenomMetadataR return out, nil } -func (c *queryClient) DenomsMetadata(ctx context.Context, in *QueryDenomsMetadataRequest, opts ...grpc.CallOption) (*QueryDenomsMetadataResponse, error) { - out := new(QueryDenomsMetadataResponse) - err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/DenomsMetadata", in, out, opts...) +func (c *queryClient) DenomMetadataByQueryString(ctx context.Context, in *QueryDenomMetadataByQueryStringRequest, opts ...grpc.CallOption) (*QueryDenomMetadataByQueryStringResponse, error) { + out := new(QueryDenomMetadataByQueryStringResponse) + err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/DenomMetadataByQueryString", in, out, opts...) if err != nil { return nil, err } @@ -1450,6 +1691,15 @@ func (c *queryClient) DenomOwners(ctx context.Context, in *QueryDenomOwnersReque return out, nil } +func (c *queryClient) DenomOwnersByQuery(ctx context.Context, in *QueryDenomOwnersByQueryRequest, opts ...grpc.CallOption) (*QueryDenomOwnersByQueryResponse, error) { + out := new(QueryDenomOwnersByQueryResponse) + err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/DenomOwnersByQuery", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) SendEnabled(ctx context.Context, in *QuerySendEnabledRequest, opts ...grpc.CallOption) (*QuerySendEnabledResponse, error) { out := new(QuerySendEnabledResponse) err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/SendEnabled", in, out, opts...) @@ -1496,11 +1746,13 @@ type QueryServer interface { SupplyOf(context.Context, *QuerySupplyOfRequest) (*QuerySupplyOfResponse, error) // Params queries the parameters of x/bank module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // DenomsMetadata queries the client metadata of a given coin denomination. - DenomMetadata(context.Context, *QueryDenomMetadataRequest) (*QueryDenomMetadataResponse, error) // DenomsMetadata queries the client metadata for all registered coin // denominations. DenomsMetadata(context.Context, *QueryDenomsMetadataRequest) (*QueryDenomsMetadataResponse, error) + // DenomMetadata queries the client metadata of a given coin denomination. + DenomMetadata(context.Context, *QueryDenomMetadataRequest) (*QueryDenomMetadataResponse, error) + // DenomMetadataByQueryString queries the client metadata of a given coin denomination. + DenomMetadataByQueryString(context.Context, *QueryDenomMetadataByQueryStringRequest) (*QueryDenomMetadataByQueryStringResponse, error) // DenomOwners queries for all account addresses that own a particular token // denomination. // @@ -1509,6 +1761,11 @@ type QueryServer interface { // // Since: cosmos-sdk 0.46 DenomOwners(context.Context, *QueryDenomOwnersRequest) (*QueryDenomOwnersResponse, error) + // DenomOwnersByQuery queries for all account addresses that own a particular token + // denomination. + // + // Since: cosmos-sdk 0.50.3 + DenomOwnersByQuery(context.Context, *QueryDenomOwnersByQueryRequest) (*QueryDenomOwnersByQueryResponse, error) // SendEnabled queries for SendEnabled entries. // // This query only returns denominations that have specific SendEnabled settings. @@ -1544,15 +1801,21 @@ func (*UnimplementedQueryServer) SupplyOf(ctx context.Context, req *QuerySupplyO func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } +func (*UnimplementedQueryServer) DenomsMetadata(ctx context.Context, req *QueryDenomsMetadataRequest) (*QueryDenomsMetadataResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DenomsMetadata not implemented") +} func (*UnimplementedQueryServer) DenomMetadata(ctx context.Context, req *QueryDenomMetadataRequest) (*QueryDenomMetadataResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DenomMetadata not implemented") } -func (*UnimplementedQueryServer) DenomsMetadata(ctx context.Context, req *QueryDenomsMetadataRequest) (*QueryDenomsMetadataResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DenomsMetadata not implemented") +func (*UnimplementedQueryServer) DenomMetadataByQueryString(ctx context.Context, req *QueryDenomMetadataByQueryStringRequest) (*QueryDenomMetadataByQueryStringResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DenomMetadataByQueryString not implemented") } func (*UnimplementedQueryServer) DenomOwners(ctx context.Context, req *QueryDenomOwnersRequest) (*QueryDenomOwnersResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DenomOwners not implemented") } +func (*UnimplementedQueryServer) DenomOwnersByQuery(ctx context.Context, req *QueryDenomOwnersByQueryRequest) (*QueryDenomOwnersByQueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DenomOwnersByQuery not implemented") +} func (*UnimplementedQueryServer) SendEnabled(ctx context.Context, req *QuerySendEnabledRequest) (*QuerySendEnabledResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SendEnabled not implemented") } @@ -1687,6 +1950,24 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } +func _Query_DenomsMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDenomsMetadataRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).DenomsMetadata(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.bank.v1beta1.Query/DenomsMetadata", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).DenomsMetadata(ctx, req.(*QueryDenomsMetadataRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_DenomMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryDenomMetadataRequest) if err := dec(in); err != nil { @@ -1705,20 +1986,20 @@ func _Query_DenomMetadata_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } -func _Query_DenomsMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDenomsMetadataRequest) +func _Query_DenomMetadataByQueryString_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDenomMetadataByQueryStringRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).DenomsMetadata(ctx, in) + return srv.(QueryServer).DenomMetadataByQueryString(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.bank.v1beta1.Query/DenomsMetadata", + FullMethod: "/cosmos.bank.v1beta1.Query/DenomMetadataByQueryString", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).DenomsMetadata(ctx, req.(*QueryDenomsMetadataRequest)) + return srv.(QueryServer).DenomMetadataByQueryString(ctx, req.(*QueryDenomMetadataByQueryStringRequest)) } return interceptor(ctx, in, info, handler) } @@ -1741,6 +2022,24 @@ func _Query_DenomOwners_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } +func _Query_DenomOwnersByQuery_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDenomOwnersByQueryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).DenomOwnersByQuery(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.bank.v1beta1.Query/DenomOwnersByQuery", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).DenomOwnersByQuery(ctx, req.(*QueryDenomOwnersByQueryRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_SendEnabled_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QuerySendEnabledRequest) if err := dec(in); err != nil { @@ -1759,6 +2058,7 @@ func _Query_SendEnabled_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.bank.v1beta1.Query", HandlerType: (*QueryServer)(nil), @@ -1791,18 +2091,26 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "Params", Handler: _Query_Params_Handler, }, + { + MethodName: "DenomsMetadata", + Handler: _Query_DenomsMetadata_Handler, + }, { MethodName: "DenomMetadata", Handler: _Query_DenomMetadata_Handler, }, { - MethodName: "DenomsMetadata", - Handler: _Query_DenomsMetadata_Handler, + MethodName: "DenomMetadataByQueryString", + Handler: _Query_DenomMetadataByQueryString_Handler, }, { MethodName: "DenomOwners", Handler: _Query_DenomOwners_Handler, }, + { + MethodName: "DenomOwnersByQuery", + Handler: _Query_DenomOwnersByQuery_Handler, + }, { MethodName: "SendEnabled", Handler: _Query_SendEnabled_Handler, @@ -2498,7 +2806,7 @@ func (m *QueryDenomMetadataResponse) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } -func (m *QueryDenomOwnersRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryDenomMetadataByQueryStringRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2508,28 +2816,16 @@ func (m *QueryDenomOwnersRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryDenomOwnersRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryDenomMetadataByQueryStringRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryDenomOwnersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryDenomMetadataByQueryStringRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } if len(m.Denom) > 0 { i -= len(m.Denom) copy(dAtA[i:], m.Denom) @@ -2540,7 +2836,7 @@ func (m *QueryDenomOwnersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *DenomOwner) Marshal() (dAtA []byte, err error) { +func (m *QueryDenomMetadataByQueryStringResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2550,18 +2846,18 @@ func (m *DenomOwner) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *DenomOwner) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryDenomMetadataByQueryStringResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *DenomOwner) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryDenomMetadataByQueryStringResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l { - size, err := m.Balance.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -2569,18 +2865,11 @@ func (m *DenomOwner) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } + dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *QueryDenomOwnersResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryDenomOwnersRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2590,7 +2879,89 @@ func (m *QueryDenomOwnersResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryDenomOwnersResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryDenomOwnersRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDenomOwnersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DenomOwner) 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 *DenomOwner) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DenomOwner) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Balance.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryDenomOwnersResponse) 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 *QueryDenomOwnersResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } @@ -2629,6 +3000,97 @@ func (m *QueryDenomOwnersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } +func (m *QueryDenomOwnersByQueryRequest) 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 *QueryDenomOwnersByQueryRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDenomOwnersByQueryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryDenomOwnersByQueryResponse) 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 *QueryDenomOwnersByQueryResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDenomOwnersByQueryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.DenomOwners) > 0 { + for iNdEx := len(m.DenomOwners) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DenomOwners[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func (m *QuerySendEnabledRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -3004,6 +3466,30 @@ func (m *QueryDenomMetadataResponse) Size() (n int) { return n } +func (m *QueryDenomMetadataByQueryStringRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDenomMetadataByQueryStringResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Metadata.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + func (m *QueryDenomOwnersRequest) Size() (n int) { if m == nil { return 0 @@ -3055,6 +3541,42 @@ func (m *QueryDenomOwnersResponse) Size() (n int) { return n } +func (m *QueryDenomOwnersByQueryRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDenomOwnersByQueryResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.DenomOwners) > 0 { + for _, e := range m.DenomOwners { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + func (m *QuerySendEnabledRequest) Size() (n int) { if m == nil { return 0 @@ -4870,7 +5392,7 @@ func (m *QueryDenomMetadataResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryDenomOwnersRequest) Unmarshal(dAtA []byte) error { +func (m *QueryDenomMetadataByQueryStringRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4893,10 +5415,10 @@ func (m *QueryDenomOwnersRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryDenomOwnersRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryDenomMetadataByQueryStringRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDenomOwnersRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryDenomMetadataByQueryStringRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -4931,31 +5453,196 @@ func (m *QueryDenomOwnersRequest) Unmarshal(dAtA []byte) error { } m.Denom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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 - } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err } - if msglen < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDenomMetadataByQueryStringResponse) 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: QueryDenomMetadataByQueryStringResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDenomMetadataByQueryStringResponse: 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 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 err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDenomOwnersRequest) 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: QueryDenomOwnersRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDenomOwnersRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", 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.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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 @@ -5223,6 +5910,244 @@ func (m *QueryDenomOwnersResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryDenomOwnersByQueryRequest) 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: QueryDenomOwnersByQueryRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDenomOwnersByQueryRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", 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.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDenomOwnersByQueryResponse) 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: QueryDenomOwnersByQueryResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDenomOwnersByQueryResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DenomOwners", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DenomOwners = append(m.DenomOwners, &DenomOwner{}) + if err := m.DenomOwners[len(m.DenomOwners)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *QuerySendEnabledRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/bank/types/query.pb.gw.go b/x/bank/types/query.pb.gw.go index 982f53168300..dc225c9bbd6f 100644 --- a/x/bank/types/query.pb.gw.go +++ b/x/bank/types/query.pb.gw.go @@ -411,6 +411,42 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal } +var ( + filter_Query_DenomsMetadata_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_DenomsMetadata_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDenomsMetadataRequest + 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_DenomsMetadata_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DenomsMetadata(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_DenomsMetadata_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDenomsMetadataRequest + 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_DenomsMetadata_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DenomsMetadata(ctx, &protoReq) + return msg, metadata, err + +} + func request_Query_DenomMetadata_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryDenomMetadataRequest var metadata runtime.ServerMetadata @@ -466,37 +502,37 @@ func local_request_Query_DenomMetadata_0(ctx context.Context, marshaler runtime. } var ( - filter_Query_DenomsMetadata_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} + filter_Query_DenomMetadataByQueryString_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) -func request_Query_DenomsMetadata_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDenomsMetadataRequest +func request_Query_DenomMetadataByQueryString_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDenomMetadataByQueryStringRequest 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_DenomsMetadata_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_DenomMetadataByQueryString_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.DenomsMetadata(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.DenomMetadataByQueryString(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_DenomsMetadata_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDenomsMetadataRequest +func local_request_Query_DenomMetadataByQueryString_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDenomMetadataByQueryStringRequest 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_DenomsMetadata_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_DenomMetadataByQueryString_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.DenomsMetadata(ctx, &protoReq) + msg, err := server.DenomMetadataByQueryString(ctx, &protoReq) return msg, metadata, err } @@ -573,6 +609,42 @@ func local_request_Query_DenomOwners_0(ctx context.Context, marshaler runtime.Ma } +var ( + filter_Query_DenomOwnersByQuery_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_DenomOwnersByQuery_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDenomOwnersByQueryRequest + 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_DenomOwnersByQuery_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DenomOwnersByQuery(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_DenomOwnersByQuery_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDenomOwnersByQueryRequest + 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_DenomOwnersByQuery_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DenomOwnersByQuery(ctx, &protoReq) + return msg, metadata, err + +} + var ( filter_Query_SendEnabled_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) @@ -776,6 +848,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_DenomsMetadata_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_DenomsMetadata_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_DenomsMetadata_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_DenomMetadata_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -799,7 +894,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_DenomsMetadata_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_DenomMetadataByQueryString_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -810,7 +905,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_DenomsMetadata_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_DenomMetadataByQueryString_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 { @@ -818,7 +913,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_DenomsMetadata_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_DenomMetadataByQueryString_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -845,6 +940,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_DenomOwnersByQuery_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_DenomOwnersByQuery_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_DenomOwnersByQuery_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_SendEnabled_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1049,6 +1167,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_DenomsMetadata_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_DenomsMetadata_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_DenomsMetadata_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_DenomMetadata_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1069,7 +1207,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_DenomsMetadata_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_DenomMetadataByQueryString_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) @@ -1078,14 +1216,14 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_DenomsMetadata_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_DenomMetadataByQueryString_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_DenomsMetadata_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_DenomMetadataByQueryString_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -1109,6 +1247,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_DenomOwnersByQuery_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_DenomOwnersByQuery_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_DenomOwnersByQuery_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_SendEnabled_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1147,11 +1305,15 @@ var ( pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "bank", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_DenomMetadata_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "bank", "v1beta1", "denoms_metadata", "denom"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_DenomsMetadata_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "bank", "v1beta1", "denoms_metadata"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_DenomOwners_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "bank", "v1beta1", "denom_owners", "denom"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_DenomMetadata_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 3, 0, 4, 1, 5, 4}, []string{"cosmos", "bank", "v1beta1", "denoms_metadata", "denom"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_DenomMetadataByQueryString_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "bank", "v1beta1", "denoms_metadata_by_query_string"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_DenomOwners_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 3, 0, 4, 1, 5, 4}, []string{"cosmos", "bank", "v1beta1", "denom_owners", "denom"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_DenomOwnersByQuery_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "bank", "v1beta1", "denom_owners_by_query"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_SendEnabled_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "bank", "v1beta1", "send_enabled"}, "", runtime.AssumeColonVerbOpt(false))) ) @@ -1171,11 +1333,15 @@ var ( forward_Query_Params_0 = runtime.ForwardResponseMessage + forward_Query_DenomsMetadata_0 = runtime.ForwardResponseMessage + forward_Query_DenomMetadata_0 = runtime.ForwardResponseMessage - forward_Query_DenomsMetadata_0 = runtime.ForwardResponseMessage + forward_Query_DenomMetadataByQueryString_0 = runtime.ForwardResponseMessage forward_Query_DenomOwners_0 = runtime.ForwardResponseMessage + forward_Query_DenomOwnersByQuery_0 = runtime.ForwardResponseMessage + forward_Query_SendEnabled_0 = runtime.ForwardResponseMessage ) diff --git a/x/bank/types/restrictions.go b/x/bank/types/restrictions.go new file mode 100644 index 000000000000..2ec4489a0978 --- /dev/null +++ b/x/bank/types/restrictions.go @@ -0,0 +1,102 @@ +package types + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// A MintingRestrictionFn can restrict minting of coins. +type MintingRestrictionFn func(ctx context.Context, coins sdk.Coins) error + +var _ MintingRestrictionFn = NoOpMintingRestrictionFn + +// NoOpMintingRestrictionFn is a no-op MintingRestrictionFn. +func NoOpMintingRestrictionFn(_ context.Context, _ sdk.Coins) error { + return nil +} + +// Then creates a composite restriction that runs this one then the provided second one. +func (r MintingRestrictionFn) Then(second MintingRestrictionFn) MintingRestrictionFn { + return ComposeMintingRestrictions(r, second) +} + +// ComposeMintingRestrictions combines multiple MintingRestrictionFn into one. +// nil entries are ignored. +// If all entries are nil, nil is returned. +// If exactly one entry is not nil, it is returned. +// Otherwise, a new MintingRestrictionFn is returned that runs the non-nil restrictions in the order they are given. +// The composition runs each minting restriction until an error is encountered and returns that error. +func ComposeMintingRestrictions(restrictions ...MintingRestrictionFn) MintingRestrictionFn { + toRun := make([]MintingRestrictionFn, 0, len(restrictions)) + for _, r := range restrictions { + if r != nil { + toRun = append(toRun, r) + } + } + switch len(toRun) { + case 0: + return nil + case 1: + return toRun[0] + } + return func(ctx context.Context, coins sdk.Coins) error { + for _, r := range toRun { + err := r(ctx, coins) + if err != nil { + return err + } + } + return nil + } +} + +// A SendRestrictionFn can restrict sends and/or provide a new receiver address. +type SendRestrictionFn func(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) (newToAddr sdk.AccAddress, err error) + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (SendRestrictionFn) IsOnePerModuleType() {} + +var _ SendRestrictionFn = NoOpSendRestrictionFn + +// NoOpSendRestrictionFn is a no-op SendRestrictionFn. +func NoOpSendRestrictionFn(_ context.Context, _, toAddr sdk.AccAddress, _ sdk.Coins) (sdk.AccAddress, error) { + return toAddr, nil +} + +// Then creates a composite restriction that runs this one then the provided second one. +func (r SendRestrictionFn) Then(second SendRestrictionFn) SendRestrictionFn { + return ComposeSendRestrictions(r, second) +} + +// ComposeSendRestrictions combines multiple SendRestrictionFn into one. +// nil entries are ignored. +// If all entries are nil, nil is returned. +// If exactly one entry is not nil, it is returned. +// Otherwise, a new SendRestrictionFn is returned that runs the non-nil restrictions in the order they are given. +// The composition runs each send restriction until an error is encountered and returns that error, +// otherwise it returns the toAddr of the last send restriction. +func ComposeSendRestrictions(restrictions ...SendRestrictionFn) SendRestrictionFn { + toRun := make([]SendRestrictionFn, 0, len(restrictions)) + for _, r := range restrictions { + if r != nil { + toRun = append(toRun, r) + } + } + switch len(toRun) { + case 0: + return nil + case 1: + return toRun[0] + } + return func(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) (sdk.AccAddress, error) { + var err error + for _, r := range toRun { + toAddr, err = r(ctx, fromAddr, toAddr, amt) + if err != nil { + return toAddr, err + } + } + return toAddr, err + } +} diff --git a/x/bank/types/restrictions_test.go b/x/bank/types/restrictions_test.go new file mode 100644 index 000000000000..47cb047da9fc --- /dev/null +++ b/x/bank/types/restrictions_test.go @@ -0,0 +1,919 @@ +package types_test + +import ( + "context" + "errors" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/bank/types" +) + +// MintingRestrictionArgs are the args provided to a MintingRestrictionFn function. +type MintingRestrictionArgs struct { + Name string + Coins sdk.Coins +} + +// MintingRestrictionTestHelper is a struct with stuff helpful for testing the MintingRestrictionFn stuff. +type MintingRestrictionTestHelper struct { + Calls []*MintingRestrictionArgs +} + +func NewMintingRestrictionTestHelper() *MintingRestrictionTestHelper { + return &MintingRestrictionTestHelper{Calls: make([]*MintingRestrictionArgs, 0, 2)} +} + +// RecordCall makes note that the provided args were used as a funcion call. +func (s *MintingRestrictionTestHelper) RecordCall(name string, coins sdk.Coins) { + s.Calls = append(s.Calls, s.NewArgs(name, coins)) +} + +// NewCalls is just a shorter way to create a []*MintingRestrictionArgs. +func (s *MintingRestrictionTestHelper) NewCalls(args ...*MintingRestrictionArgs) []*MintingRestrictionArgs { + return args +} + +// NewArgs creates a new MintingRestrictionArgs. +func (s *MintingRestrictionTestHelper) NewArgs(name string, coins sdk.Coins) *MintingRestrictionArgs { + return &MintingRestrictionArgs{ + Name: name, + Coins: coins, + } +} + +// NamedRestriction creates a new MintingRestrictionFn function that records the arguments it's called with and returns nil. +func (s *MintingRestrictionTestHelper) NamedRestriction(name string) types.MintingRestrictionFn { + return func(_ context.Context, coins sdk.Coins) error { + s.RecordCall(name, coins) + return nil + } +} + +// ErrorRestriction creates a new MintingRestrictionFn function that returns an error. +func (s *MintingRestrictionTestHelper) ErrorRestriction(message string) types.MintingRestrictionFn { + return func(_ context.Context, coins sdk.Coins) error { + s.RecordCall(message, coins) + return errors.New(message) + } +} + +// MintingRestrictionTestParams are parameters to test regarding calling a MintingRestrictionFn. +type MintingRestrictionTestParams struct { + // ExpNil is whether to expect the provided MintingRestrictionFn to be nil. + // If it is true, the rest of these test params are ignored. + ExpNil bool + // Coins is the MintingRestrictionFn coins input. + Coins sdk.Coins + // ExpErr is the expected return error string. + ExpErr string + // ExpCalls is the args of all the MintingRestrictionFn calls that end up being made. + ExpCalls []*MintingRestrictionArgs +} + +// TestActual tests the provided MintingRestrictionFn using the provided test parameters. +func (s *MintingRestrictionTestHelper) TestActual(t *testing.T, tp *MintingRestrictionTestParams, actual types.MintingRestrictionFn) { + t.Helper() + if tp.ExpNil { + require.Nil(t, actual, "resulting MintingRestrictionFn") + } else { + require.NotNil(t, actual, "resulting MintingRestrictionFn") + s.Calls = s.Calls[:0] + err := actual(sdk.Context{}, tp.Coins) + if len(tp.ExpErr) != 0 { + assert.EqualError(t, err, tp.ExpErr, "composite MintingRestrictionFn output error") + } else { + assert.NoError(t, err, "composite MintingRestrictionFn output error") + } + assert.Equal(t, tp.ExpCalls, s.Calls, "args given to funcs in composite MintingRestrictionFn") + } +} + +func TestMintingRestriction_Then(t *testing.T) { + coins := sdk.NewCoins(sdk.NewInt64Coin("acoin", 2), sdk.NewInt64Coin("bcoin", 4)) + + h := NewMintingRestrictionTestHelper() + + tests := []struct { + name string + base types.MintingRestrictionFn + second types.MintingRestrictionFn + exp *MintingRestrictionTestParams + }{ + { + name: "nil nil", + base: nil, + second: nil, + exp: &MintingRestrictionTestParams{ + ExpNil: true, + }, + }, + { + name: "nil noop", + base: nil, + second: h.NamedRestriction("noop"), + exp: &MintingRestrictionTestParams{ + Coins: coins, + ExpCalls: h.NewCalls(h.NewArgs("noop", coins)), + }, + }, + { + name: "noop nil", + base: h.NamedRestriction("noop"), + second: nil, + exp: &MintingRestrictionTestParams{ + Coins: coins, + ExpCalls: h.NewCalls(h.NewArgs("noop", coins)), + }, + }, + { + name: "noop noop", + base: h.NamedRestriction("noop1"), + second: h.NamedRestriction("noop2"), + exp: &MintingRestrictionTestParams{ + Coins: coins, + ExpCalls: h.NewCalls(h.NewArgs("noop1", coins), h.NewArgs("noop2", coins)), + }, + }, + { + name: "noop error", + base: h.NamedRestriction("noop"), + second: h.ErrorRestriction("this is a test error"), + exp: &MintingRestrictionTestParams{ + Coins: coins, + ExpErr: "this is a test error", + ExpCalls: h.NewCalls(h.NewArgs("noop", coins), h.NewArgs("this is a test error", coins)), + }, + }, + { + name: "error noop", + base: h.ErrorRestriction("another test error"), + second: h.NamedRestriction("noop"), + exp: &MintingRestrictionTestParams{ + Coins: coins, + ExpErr: "another test error", + ExpCalls: h.NewCalls(h.NewArgs("another test error", coins)), + }, + }, + { + name: "error error", + base: h.ErrorRestriction("first test error"), + second: h.ErrorRestriction("second test error"), + exp: &MintingRestrictionTestParams{ + Coins: coins, + ExpErr: "first test error", + ExpCalls: h.NewCalls(h.NewArgs("first test error", coins)), + }, + }, + { + name: "double chain", + base: types.ComposeMintingRestrictions(h.NamedRestriction("r1"), h.NamedRestriction("r2")), + second: types.ComposeMintingRestrictions(h.NamedRestriction("r3"), h.NamedRestriction("r4")), + exp: &MintingRestrictionTestParams{ + Coins: coins, + ExpCalls: h.NewCalls( + h.NewArgs("r1", coins), + h.NewArgs("r2", coins), + h.NewArgs("r3", coins), + h.NewArgs("r4", coins), + ), + }, + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + var actual types.MintingRestrictionFn + testFunc := func() { + actual = tc.base.Then(tc.second) + } + require.NotPanics(t, testFunc, "MintingRestrictionFn.Then") + h.TestActual(t, tc.exp, actual) + }) + } +} + +func TestComposeMintingRestrictions(t *testing.T) { + rz := func(rs ...types.MintingRestrictionFn) []types.MintingRestrictionFn { + return rs + } + coins := sdk.NewCoins(sdk.NewInt64Coin("ccoin", 8), sdk.NewInt64Coin("dcoin", 16)) + + h := NewMintingRestrictionTestHelper() + + tests := []struct { + name string + input []types.MintingRestrictionFn + exp *MintingRestrictionTestParams + }{ + { + name: "nil list", + input: nil, + exp: &MintingRestrictionTestParams{ + ExpNil: true, + }, + }, + { + name: "empty list", + input: rz(), + exp: &MintingRestrictionTestParams{ + ExpNil: true, + }, + }, + { + name: "only nil entry", + input: rz(nil), + exp: &MintingRestrictionTestParams{ + ExpNil: true, + }, + }, + { + name: "five nil entries", + input: rz(nil, nil, nil, nil, nil), + exp: &MintingRestrictionTestParams{ + ExpNil: true, + }, + }, + { + name: "only noop entry", + input: rz(h.NamedRestriction("noop")), + exp: &MintingRestrictionTestParams{ + Coins: coins, + ExpCalls: h.NewCalls(h.NewArgs("noop", coins)), + }, + }, + { + name: "only error entry", + input: rz(h.ErrorRestriction("test error")), + exp: &MintingRestrictionTestParams{ + Coins: coins, + ExpErr: "test error", + ExpCalls: h.NewCalls(h.NewArgs("test error", coins)), + }, + }, + { + name: "noop nil nil", + input: rz(h.NamedRestriction("noop"), nil, nil), + exp: &MintingRestrictionTestParams{ + Coins: coins, + ExpCalls: h.NewCalls(h.NewArgs("noop", coins)), + }, + }, + { + name: "nil noop nil", + input: rz(nil, h.NamedRestriction("noop"), nil), + exp: &MintingRestrictionTestParams{ + Coins: coins, + ExpCalls: h.NewCalls(h.NewArgs("noop", coins)), + }, + }, + { + name: "nil nil noop", + input: rz(nil, nil, h.NamedRestriction("noop")), + exp: &MintingRestrictionTestParams{ + Coins: coins, + ExpCalls: h.NewCalls(h.NewArgs("noop", coins)), + }, + }, + { + name: "noop noop nil", + input: rz(h.NamedRestriction("r1"), h.NamedRestriction("r2"), nil), + exp: &MintingRestrictionTestParams{ + Coins: coins, + ExpCalls: h.NewCalls(h.NewArgs("r1", coins), h.NewArgs("r2", coins)), + }, + }, + { + name: "noop nil noop", + input: rz(h.NamedRestriction("r1"), nil, h.NamedRestriction("r2")), + exp: &MintingRestrictionTestParams{ + Coins: coins, + ExpCalls: h.NewCalls(h.NewArgs("r1", coins), h.NewArgs("r2", coins)), + }, + }, + { + name: "nil noop noop", + input: rz(nil, h.NamedRestriction("r1"), h.NamedRestriction("r2")), + exp: &MintingRestrictionTestParams{ + Coins: coins, + ExpCalls: h.NewCalls(h.NewArgs("r1", coins), h.NewArgs("r2", coins)), + }, + }, + { + name: "noop noop noop", + input: rz(h.NamedRestriction("r1"), h.NamedRestriction("r2"), h.NamedRestriction("r3")), + exp: &MintingRestrictionTestParams{ + Coins: coins, + ExpCalls: h.NewCalls(h.NewArgs("r1", coins), h.NewArgs("r2", coins), h.NewArgs("r3", coins)), + }, + }, + { + name: "err noop noop", + input: rz(h.ErrorRestriction("first error"), h.NamedRestriction("r2"), h.NamedRestriction("r3")), + exp: &MintingRestrictionTestParams{ + Coins: coins, + ExpErr: "first error", + ExpCalls: h.NewCalls(h.NewArgs("first error", coins)), + }, + }, + { + name: "noop err noop", + input: rz(h.NamedRestriction("r1"), h.ErrorRestriction("second error"), h.NamedRestriction("r3")), + exp: &MintingRestrictionTestParams{ + Coins: coins, + ExpErr: "second error", + ExpCalls: h.NewCalls(h.NewArgs("r1", coins), h.NewArgs("second error", coins)), + }, + }, + { + name: "noop noop err", + input: rz(h.NamedRestriction("r1"), h.NamedRestriction("r2"), h.ErrorRestriction("third error")), + exp: &MintingRestrictionTestParams{ + Coins: coins, + ExpErr: "third error", + ExpCalls: h.NewCalls(h.NewArgs("r1", coins), h.NewArgs("r2", coins), h.NewArgs("third error", coins)), + }, + }, + { + name: "noop err err", + input: rz(h.NamedRestriction("r1"), h.ErrorRestriction("second error"), h.ErrorRestriction("third error")), + exp: &MintingRestrictionTestParams{ + Coins: coins, + ExpErr: "second error", + ExpCalls: h.NewCalls(h.NewArgs("r1", coins), h.NewArgs("second error", coins)), + }, + }, + { + name: "big bang", + input: rz( + h.NamedRestriction("r1"), nil, h.NamedRestriction("r2"), nil, + h.NamedRestriction("r3"), h.NamedRestriction("r4"), h.NamedRestriction("r5"), + nil, h.NamedRestriction("r6"), h.NamedRestriction("r7"), nil, + h.NamedRestriction("r8"), nil, nil, h.ErrorRestriction("oops, an error"), + h.NamedRestriction("r9"), nil, h.NamedRestriction("ra"), // Not called. + ), + exp: &MintingRestrictionTestParams{ + Coins: coins, + ExpErr: "oops, an error", + ExpCalls: h.NewCalls( + h.NewArgs("r1", coins), + h.NewArgs("r2", coins), + h.NewArgs("r3", coins), + h.NewArgs("r4", coins), + h.NewArgs("r5", coins), + h.NewArgs("r6", coins), + h.NewArgs("r7", coins), + h.NewArgs("r8", coins), + h.NewArgs("oops, an error", coins), + ), + }, + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + var actual types.MintingRestrictionFn + testFunc := func() { + actual = types.ComposeMintingRestrictions(tc.input...) + } + require.NotPanics(t, testFunc, "ComposeMintingRestrictions") + h.TestActual(t, tc.exp, actual) + }) + } +} + +func TestNoOpMintingRestrictionFn(t *testing.T) { + var err error + testFunc := func() { + err = types.NoOpMintingRestrictionFn(sdk.Context{}, sdk.Coins{}) + } + require.NotPanics(t, testFunc, "NoOpMintingRestrictionFn") + assert.NoError(t, err, "NoOpSendRestrictionFn error") +} + +// SendRestrictionArgs are the args provided to a SendRestrictionFn function. +type SendRestrictionArgs struct { + Name string + FromAddr sdk.AccAddress + ToAddr sdk.AccAddress + Coins sdk.Coins +} + +// SendRestrictionTestHelper is a struct with stuff helpful for testing the SendRestrictionFn stuff. +type SendRestrictionTestHelper struct { + Calls []*SendRestrictionArgs +} + +func NewSendRestrictionTestHelper() *SendRestrictionTestHelper { + return &SendRestrictionTestHelper{Calls: make([]*SendRestrictionArgs, 0, 2)} +} + +// RecordCall makes note that the provided args were used as a funcion call. +func (s *SendRestrictionTestHelper) RecordCall(name string, fromAddr, toAddr sdk.AccAddress, coins sdk.Coins) { + s.Calls = append(s.Calls, s.NewArgs(name, fromAddr, toAddr, coins)) +} + +// NewCalls is just a shorter way to create a []*SendRestrictionArgs. +func (s *SendRestrictionTestHelper) NewCalls(args ...*SendRestrictionArgs) []*SendRestrictionArgs { + return args +} + +// NewArgs creates a new SendRestrictionArgs. +func (s *SendRestrictionTestHelper) NewArgs(name string, fromAddr, toAddr sdk.AccAddress, coins sdk.Coins) *SendRestrictionArgs { + return &SendRestrictionArgs{ + Name: name, + FromAddr: fromAddr, + ToAddr: toAddr, + Coins: coins, + } +} + +// NamedRestriction creates a new SendRestrictionFn function that records the arguments it's called with and returns the provided toAddr. +func (s *SendRestrictionTestHelper) NamedRestriction(name string) types.SendRestrictionFn { + return func(_ context.Context, fromAddr, toAddr sdk.AccAddress, coins sdk.Coins) (sdk.AccAddress, error) { + s.RecordCall(name, fromAddr, toAddr, coins) + return toAddr, nil + } +} + +// NewToRestriction creates a new SendRestrictionFn function that returns a different toAddr than provided. +func (s *SendRestrictionTestHelper) NewToRestriction(name string, addr sdk.AccAddress) types.SendRestrictionFn { + return func(_ context.Context, fromAddr, toAddr sdk.AccAddress, coins sdk.Coins) (sdk.AccAddress, error) { + s.RecordCall(name, fromAddr, toAddr, coins) + return addr, nil + } +} + +// ErrorRestriction creates a new SendRestrictionFn function that returns a nil toAddr and an error. +func (s *SendRestrictionTestHelper) ErrorRestriction(message string) types.SendRestrictionFn { + return func(_ context.Context, fromAddr, toAddr sdk.AccAddress, coins sdk.Coins) (sdk.AccAddress, error) { + s.RecordCall(message, fromAddr, toAddr, coins) + return nil, errors.New(message) + } +} + +// SendRestrictionTestParams are parameters to test regarding calling a SendRestrictionFn. +type SendRestrictionTestParams struct { + // ExpNil is whether to expect the provided SendRestrictionFn to be nil. + // If it is true, the rest of these test params are ignored. + ExpNil bool + // FromAddr is the SendRestrictionFn fromAddr input. + FromAddr sdk.AccAddress + // ToAddr is the SendRestrictionFn toAddr input. + ToAddr sdk.AccAddress + // Coins is the SendRestrictionFn coins input. + Coins sdk.Coins + // ExpAddr is the expected return address. + ExpAddr sdk.AccAddress + // ExpErr is the expected return error string. + ExpErr string + // ExpCalls is the args of all the SendRestrictionFn calls that end up being made. + ExpCalls []*SendRestrictionArgs +} + +// TestActual tests the provided SendRestrictionFn using the provided test parameters. +func (s *SendRestrictionTestHelper) TestActual(t *testing.T, tp *SendRestrictionTestParams, actual types.SendRestrictionFn) { + t.Helper() + if tp.ExpNil { + require.Nil(t, actual, "resulting SendRestrictionFn") + } else { + require.NotNil(t, actual, "resulting SendRestrictionFn") + s.Calls = s.Calls[:0] + addr, err := actual(sdk.Context{}, tp.FromAddr, tp.ToAddr, tp.Coins) + if len(tp.ExpErr) != 0 { + assert.EqualError(t, err, tp.ExpErr, "composite SendRestrictionFn output error") + } else { + assert.NoError(t, err, "composite SendRestrictionFn output error") + } + assert.Equal(t, tp.ExpAddr, addr, "composite SendRestrictionFn output address") + assert.Equal(t, tp.ExpCalls, s.Calls, "args given to funcs in composite SendRestrictionFn") + } +} + +func TestSendRestriction_Then(t *testing.T) { + fromAddr := sdk.AccAddress("fromaddr____________") + addr0 := sdk.AccAddress("0addr_______________") + addr1 := sdk.AccAddress("1addr_______________") + addr2 := sdk.AccAddress("2addr_______________") + addr3 := sdk.AccAddress("3addr_______________") + addr4 := sdk.AccAddress("4addr_______________") + coins := sdk.NewCoins(sdk.NewInt64Coin("ecoin", 32), sdk.NewInt64Coin("fcoin", 64)) + + h := NewSendRestrictionTestHelper() + + tests := []struct { + name string + base types.SendRestrictionFn + second types.SendRestrictionFn + exp *SendRestrictionTestParams + }{ + { + name: "nil nil", + base: nil, + second: nil, + exp: &SendRestrictionTestParams{ + ExpNil: true, + }, + }, + { + name: "nil noop", + base: nil, + second: h.NamedRestriction("noop"), + exp: &SendRestrictionTestParams{ + FromAddr: fromAddr, + ToAddr: addr1, + Coins: coins, + ExpAddr: addr1, + ExpCalls: h.NewCalls(h.NewArgs("noop", fromAddr, addr1, coins)), + }, + }, + { + name: "noop nil", + base: h.NamedRestriction("noop"), + second: nil, + exp: &SendRestrictionTestParams{ + FromAddr: fromAddr, + ToAddr: addr1, + Coins: coins, + ExpAddr: addr1, + ExpCalls: h.NewCalls(h.NewArgs("noop", fromAddr, addr1, coins)), + }, + }, + { + name: "noop noop", + base: h.NamedRestriction("noop1"), + second: h.NamedRestriction("noop2"), + exp: &SendRestrictionTestParams{ + FromAddr: fromAddr, + ToAddr: addr1, + Coins: coins, + ExpAddr: addr1, + ExpCalls: h.NewCalls( + h.NewArgs("noop1", fromAddr, addr1, coins), + h.NewArgs("noop2", fromAddr, addr1, coins), + ), + }, + }, + { + name: "setter setter", + base: h.NewToRestriction("r1", addr2), + second: h.NewToRestriction("r2", addr3), + exp: &SendRestrictionTestParams{ + FromAddr: fromAddr, + ToAddr: addr1, + Coins: coins, + ExpAddr: addr3, + ExpCalls: h.NewCalls( + h.NewArgs("r1", fromAddr, addr1, coins), + h.NewArgs("r2", fromAddr, addr2, coins), + ), + }, + }, + { + name: "setter error", + base: h.NewToRestriction("r1", addr2), + second: h.ErrorRestriction("this is a test error"), + exp: &SendRestrictionTestParams{ + FromAddr: fromAddr, + ToAddr: addr1, + Coins: coins, + ExpAddr: nil, + ExpErr: "this is a test error", + ExpCalls: h.NewCalls(h.NewArgs( + "r1", fromAddr, addr1, coins), + h.NewArgs("this is a test error", fromAddr, addr2, coins), + ), + }, + }, + { + name: "error setter", + base: h.ErrorRestriction("another test error"), + second: h.NewToRestriction("r2", addr3), + exp: &SendRestrictionTestParams{ + FromAddr: fromAddr, + ToAddr: addr1, + Coins: coins, + ExpAddr: nil, + ExpErr: "another test error", + ExpCalls: h.NewCalls(h.NewArgs("another test error", fromAddr, addr1, coins)), + }, + }, + { + name: "error error", + base: h.ErrorRestriction("first test error"), + second: h.ErrorRestriction("second test error"), + exp: &SendRestrictionTestParams{ + FromAddr: fromAddr, + ToAddr: addr1, + Coins: coins, + ExpAddr: nil, + ExpErr: "first test error", + ExpCalls: h.NewCalls(h.NewArgs("first test error", fromAddr, addr1, coins)), + }, + }, + { + name: "double chain", + base: types.ComposeSendRestrictions(h.NewToRestriction("r1", addr1), h.NewToRestriction("r2", addr2)), + second: types.ComposeSendRestrictions(h.NewToRestriction("r3", addr3), h.NewToRestriction("r4", addr4)), + exp: &SendRestrictionTestParams{ + FromAddr: fromAddr, + ToAddr: addr0, + Coins: coins, + ExpAddr: addr4, + ExpCalls: h.NewCalls( + h.NewArgs("r1", fromAddr, addr0, coins), + h.NewArgs("r2", fromAddr, addr1, coins), + h.NewArgs("r3", fromAddr, addr2, coins), + h.NewArgs("r4", fromAddr, addr3, coins), + ), + }, + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + var actual types.SendRestrictionFn + testFunc := func() { + actual = tc.base.Then(tc.second) + } + require.NotPanics(t, testFunc, "SendRestrictionFn.Then") + h.TestActual(t, tc.exp, actual) + }) + } +} + +func TestComposeSendRestrictions(t *testing.T) { + rz := func(rs ...types.SendRestrictionFn) []types.SendRestrictionFn { + return rs + } + fromAddr := sdk.AccAddress("fromaddr____________") + addr0 := sdk.AccAddress("0addr_______________") + addr1 := sdk.AccAddress("1addr_______________") + addr2 := sdk.AccAddress("2addr_______________") + addr3 := sdk.AccAddress("3addr_______________") + addr4 := sdk.AccAddress("4addr_______________") + coins := sdk.NewCoins(sdk.NewInt64Coin("gcoin", 128), sdk.NewInt64Coin("hcoin", 256)) + + h := NewSendRestrictionTestHelper() + + tests := []struct { + name string + input []types.SendRestrictionFn + exp *SendRestrictionTestParams + }{ + { + name: "nil list", + input: nil, + exp: &SendRestrictionTestParams{ + ExpNil: true, + }, + }, + { + name: "empty list", + input: rz(), + exp: &SendRestrictionTestParams{ + ExpNil: true, + }, + }, + { + name: "only nil entry", + input: rz(nil), + exp: &SendRestrictionTestParams{ + ExpNil: true, + }, + }, + { + name: "five nil entries", + input: rz(nil, nil, nil, nil, nil), + exp: &SendRestrictionTestParams{ + ExpNil: true, + }, + }, + { + name: "only noop entry", + input: rz(h.NamedRestriction("noop")), + exp: &SendRestrictionTestParams{ + FromAddr: fromAddr, + ToAddr: addr0, + Coins: coins, + ExpAddr: addr0, + ExpCalls: h.NewCalls(h.NewArgs("noop", fromAddr, addr0, coins)), + }, + }, + { + name: "only error entry", + input: rz(h.ErrorRestriction("test error")), + exp: &SendRestrictionTestParams{ + FromAddr: fromAddr, + ToAddr: addr0, + Coins: coins, + ExpAddr: nil, + ExpErr: "test error", + ExpCalls: h.NewCalls(h.NewArgs("test error", fromAddr, addr0, coins)), + }, + }, + { + name: "noop nil nil", + input: rz(h.NamedRestriction("noop"), nil, nil), + exp: &SendRestrictionTestParams{ + FromAddr: fromAddr, + ToAddr: addr0, + Coins: coins, + ExpAddr: addr0, + ExpCalls: h.NewCalls(h.NewArgs("noop", fromAddr, addr0, coins)), + }, + }, + { + name: "nil noop nil", + input: rz(nil, h.NamedRestriction("noop"), nil), + exp: &SendRestrictionTestParams{ + FromAddr: fromAddr, + ToAddr: addr1, + Coins: coins, + ExpAddr: addr1, + ExpCalls: h.NewCalls(h.NewArgs("noop", fromAddr, addr1, coins)), + }, + }, + { + name: "nil nil noop", + input: rz(nil, nil, h.NamedRestriction("noop")), + exp: &SendRestrictionTestParams{ + FromAddr: fromAddr, + ToAddr: addr2, + Coins: coins, + ExpAddr: addr2, + ExpCalls: h.NewCalls(h.NewArgs("noop", fromAddr, addr2, coins)), + }, + }, + { + name: "noop noop nil", + input: rz(h.NamedRestriction("r1"), h.NamedRestriction("r2"), nil), + exp: &SendRestrictionTestParams{ + FromAddr: fromAddr, + ToAddr: addr0, + Coins: coins, + ExpAddr: addr0, + ExpCalls: h.NewCalls( + h.NewArgs("r1", fromAddr, addr0, coins), + h.NewArgs("r2", fromAddr, addr0, coins), + ), + }, + }, + { + name: "noop nil noop", + input: rz(h.NamedRestriction("r1"), nil, h.NamedRestriction("r2")), + exp: &SendRestrictionTestParams{ + FromAddr: fromAddr, + ToAddr: addr1, + Coins: coins, + ExpAddr: addr1, + ExpCalls: h.NewCalls( + h.NewArgs("r1", fromAddr, addr1, coins), + h.NewArgs("r2", fromAddr, addr1, coins), + ), + }, + }, + { + name: "nil noop noop", + input: rz(nil, h.NamedRestriction("r1"), h.NamedRestriction("r2")), + exp: &SendRestrictionTestParams{ + FromAddr: fromAddr, + ToAddr: addr2, + Coins: coins, + ExpAddr: addr2, + ExpCalls: h.NewCalls( + h.NewArgs("r1", fromAddr, addr2, coins), + h.NewArgs("r2", fromAddr, addr2, coins), + ), + }, + }, + { + name: "noop noop noop", + input: rz(h.NamedRestriction("r1"), h.NamedRestriction("r2"), h.NamedRestriction("r3")), + exp: &SendRestrictionTestParams{ + FromAddr: fromAddr, + ToAddr: addr3, + Coins: coins, + ExpAddr: addr3, + ExpCalls: h.NewCalls( + h.NewArgs("r1", fromAddr, addr3, coins), + h.NewArgs("r2", fromAddr, addr3, coins), + h.NewArgs("r3", fromAddr, addr3, coins), + ), + }, + }, + { + name: "err noop noop", + input: rz(h.ErrorRestriction("first error"), h.NamedRestriction("r2"), h.NamedRestriction("r3")), + exp: &SendRestrictionTestParams{ + FromAddr: fromAddr, + ToAddr: addr4, + Coins: coins, + ExpAddr: nil, + ExpErr: "first error", + ExpCalls: h.NewCalls(h.NewArgs("first error", fromAddr, addr4, coins)), + }, + }, + { + name: "noop err noop", + input: rz(h.NamedRestriction("r1"), h.ErrorRestriction("second error"), h.NamedRestriction("r3")), + exp: &SendRestrictionTestParams{ + FromAddr: fromAddr, + ToAddr: addr4, + Coins: coins, + ExpAddr: nil, + ExpErr: "second error", + ExpCalls: h.NewCalls( + h.NewArgs("r1", fromAddr, addr4, coins), + h.NewArgs("second error", fromAddr, addr4, coins), + ), + }, + }, + { + name: "noop noop err", + input: rz(h.NamedRestriction("r1"), h.NamedRestriction("r2"), h.ErrorRestriction("third error")), + exp: &SendRestrictionTestParams{ + FromAddr: fromAddr, + ToAddr: addr4, + Coins: coins, + ExpAddr: nil, + ExpErr: "third error", + ExpCalls: h.NewCalls( + h.NewArgs("r1", fromAddr, addr4, coins), + h.NewArgs("r2", fromAddr, addr4, coins), + h.NewArgs("third error", fromAddr, addr4, coins), + ), + }, + }, + { + name: "new-to err err", + input: rz(h.NewToRestriction("r1", addr0), h.ErrorRestriction("second error"), h.ErrorRestriction("third error")), + exp: &SendRestrictionTestParams{ + FromAddr: fromAddr, + ToAddr: addr4, + Coins: coins, + ExpAddr: nil, + ExpErr: "second error", + ExpCalls: h.NewCalls( + h.NewArgs("r1", fromAddr, addr4, coins), + h.NewArgs("second error", fromAddr, addr0, coins), + ), + }, + }, + { + name: "big bang", + input: rz( + h.NamedRestriction("r1"), nil, h.NewToRestriction("r2", addr1), // Called with orig toAddr. + nil, h.NamedRestriction("r3"), h.NewToRestriction("r4", addr2), // Called with addr1 toAddr. + h.NewToRestriction("r5", addr3), // Called with addr2 toAddr. + nil, h.NamedRestriction("r6"), h.NewToRestriction("r7", addr4), // Called with addr3 toAddr. + nil, h.NamedRestriction("r8"), nil, nil, h.ErrorRestriction("oops, an error"), // Called with addr4 toAddr. + h.NewToRestriction("r9", addr0), nil, h.NamedRestriction("ra"), // Not called. + ), + exp: &SendRestrictionTestParams{ + FromAddr: fromAddr, + ToAddr: addr0, + Coins: coins, + ExpAddr: nil, + ExpErr: "oops, an error", + ExpCalls: h.NewCalls( + h.NewArgs("r1", fromAddr, addr0, coins), + h.NewArgs("r2", fromAddr, addr0, coins), + h.NewArgs("r3", fromAddr, addr1, coins), + h.NewArgs("r4", fromAddr, addr1, coins), + h.NewArgs("r5", fromAddr, addr2, coins), + h.NewArgs("r6", fromAddr, addr3, coins), + h.NewArgs("r7", fromAddr, addr3, coins), + h.NewArgs("r8", fromAddr, addr4, coins), + h.NewArgs("oops, an error", fromAddr, addr4, coins), + ), + }, + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + var actual types.SendRestrictionFn + testFunc := func() { + actual = types.ComposeSendRestrictions(tc.input...) + } + require.NotPanics(t, testFunc, "ComposeSendRestrictions") + h.TestActual(t, tc.exp, actual) + }) + } +} + +func TestNoOpSendRestrictionFn(t *testing.T) { + expAddr := sdk.AccAddress("__expectedaddr__") + var addr sdk.AccAddress + var err error + testFunc := func() { + addr, err = types.NoOpSendRestrictionFn(sdk.Context{}, sdk.AccAddress("first_addr"), expAddr, sdk.Coins{}) + } + require.NotPanics(t, testFunc, "NoOpSendRestrictionFn") + assert.NoError(t, err, "NoOpSendRestrictionFn error") + assert.Equal(t, expAddr, addr, "NoOpSendRestrictionFn addr") +} diff --git a/x/bank/types/tx.pb.go b/x/bank/types/tx.pb.go index 12b6b196116c..98bcf1334729 100644 --- a/x/bank/types/tx.pb.go +++ b/x/bank/types/tx.pb.go @@ -309,6 +309,7 @@ var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo // // Since: cosmos-sdk 0.47 type MsgSetSendEnabled struct { + // authority is the address that controls the module. Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` // send_enabled is the list of entries to add or update. SendEnabled []*SendEnabled `protobuf:"bytes,2,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled,omitempty"` @@ -660,6 +661,7 @@ func _Msg_SetSendEnabled_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.bank.v1beta1.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/circuit/CHANGELOG.md b/x/circuit/CHANGELOG.md index 63534e456362..f9c54ddab57d 100644 --- a/x/circuit/CHANGELOG.md +++ b/x/circuit/CHANGELOG.md @@ -29,4 +29,13 @@ Ref: https://keepachangelog.com/en/1.0.0/ # Changelog -## [Unreleased] \ No newline at end of file +## [v0.1.1](https://github.com/cosmos/cosmos-sdk/releases/tag/x/circuit/v0.1.1) - 2024-04-22 + +### Improvements + +* (deps) [#19810](https://github.com/cosmos/cosmos-sdk/pull/19810) Upgrade SDK version due to prometheus breaking change. +* (deps) [#19810](https://github.com/cosmos/cosmos-sdk/pull/19810) Bump `cosmossdk.io/store` to v1.1.0. + +## [v0.1.0](https://github.com/cosmos/cosmos-sdk/releases/tag/x/circuit/v0.1.0) - 2023-11-07 + +* Initial release of the standalone NFT module. diff --git a/x/circuit/README.md b/x/circuit/README.md index 348efb2cc46b..f3b753896300 100644 --- a/x/circuit/README.md +++ b/x/circuit/README.md @@ -6,6 +6,25 @@ Circuit Breaker is a module that is meant to avoid a chain needing to halt/shut Circuit Breaker works with the idea that an address or set of addresses have the right to block messages from being executed and/or included in the mempool. Any address with a permission is able to reset the circuit breaker for the message. +The transactions are checked and can be rejected at two points: + +* In `CircuitBreakerDecorator` [ante handler](https://docs.cosmos.network/main/learn/advanced/baseapp#antehandler): + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/x/circuit/v0.1.0/x/circuit/ante/circuit.go#L27-L41 +``` + +* With a [message router check](https://docs.cosmos.network/main/learn/advanced/baseapp#msg-service-router): + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.1/baseapp/msg_service_router.go#L104-L115 +``` + +:::note +The `CircuitBreakerDecorator` works for most use cases, but [does not check the inner messages of a transaction](https://docs.cosmos.network/main/learn/beginner/tx-lifecycle#antehandler). This some transactions (such as `x/authz` transactions or some `x/gov` transactions) may pass the ante handler. **This does not affect the circuit breaker** as the message router check will still fail the transaction. +This tradeoff is to avoid introducing more dependencies in the `x/circuit` module. Chains can re-define the `CircuitBreakerDecorator` to check for inner messages if they wish to do so. +::: + ## State ### Accounts @@ -59,7 +78,7 @@ Authorize, is called by the module authority (default governance module account) ### Trip -Trip, is called by an account to disable message execution for a specific msgURL. +Trip, is called by an authorized account to disable message execution for a specific msgURL. If empty, all the msgs will be disabled. ```protobuf // TripCircuitBreaker pauses processing of Msg's in the state machine. @@ -68,7 +87,7 @@ Trip, is called by an account to disable message execution for a specific msgURL ### Reset -Reset is called to enable execution of a previously disabled message. +Reset is called by an authorized account to enable execution for a specific msgURL of previously disabled message. If empty, all the disabled messages will be enabled. ```protobuf // ResetCircuitBreaker resumes processing of Msg's in the state machine that @@ -118,8 +137,8 @@ The circuit module emits the following events: | Type | Attribute Key | Attribute Value | |---------|---------------|---------------------------| -| string | granter | {granteeAddress} | -| string | grantee | {granterAddress} | +| string | granter | {granterAddress} | +| string | grantee | {granteeAddress} | | string | permission | {granteePermissions} | | message | module | circuit | | message | action | authorize_circuit_breaker | diff --git a/x/circuit/ante/circuit.go b/x/circuit/ante/circuit.go index 80ed8ce5f231..ab1876242b28 100644 --- a/x/circuit/ante/circuit.go +++ b/x/circuit/ante/circuit.go @@ -24,6 +24,10 @@ func NewCircuitBreakerDecorator(ck CircuitBreaker) CircuitBreakerDecorator { } } +// If you copy this as reference and your app has the authz module enabled, you must either: +// - recursively check for nested authz.Exec messages in this function. +// - or error early if a nested authz grant is found. +// The circuit AnteHandler handles this with baseapp's service router: https://github.com/cosmos/cosmos-sdk/issues/18632. func (cbd CircuitBreakerDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) { // loop through all the messages and check if the message type is allowed for _, msg := range tx.GetMsgs() { diff --git a/x/circuit/ante/circuit_test.go b/x/circuit/ante/circuit_test.go index 4f4610520c63..54fbbebeb41b 100644 --- a/x/circuit/ante/circuit_test.go +++ b/x/circuit/ante/circuit_test.go @@ -4,23 +4,22 @@ import ( "context" "testing" - storetypes "cosmossdk.io/store/types" - cbtypes "cosmossdk.io/x/circuit/types" abci "github.com/cometbft/cometbft/abci/types" cmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/stretchr/testify/require" + + storetypes "cosmossdk.io/store/types" + "cosmossdk.io/x/circuit/ante" + cbtypes "cosmossdk.io/x/circuit/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/testutil" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/cosmos/cosmos-sdk/testutil/testdata" + sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" "github.com/cosmos/cosmos-sdk/x/auth" "github.com/cosmos/cosmos-sdk/x/bank" - - "cosmossdk.io/x/circuit/ante" - "github.com/stretchr/testify/require" - - sdk "github.com/cosmos/cosmos-sdk/types" ) type fixture struct { diff --git a/x/circuit/autocli.go b/x/circuit/autocli.go new file mode 100644 index 000000000000..7e9a45b182e9 --- /dev/null +++ b/x/circuit/autocli.go @@ -0,0 +1,73 @@ +package circuit + +import ( + "fmt" + + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + circuitv1 "cosmossdk.io/api/cosmos/circuit/v1" + + "github.com/cosmos/cosmos-sdk/version" +) + +func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { + return &autocliv1.ModuleOptions{ + Query: &autocliv1.ServiceCommandDescriptor{ + Service: circuitv1.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Account", + Use: "account [address]", + Short: "Query a specific account's permissions", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "address"}}, + }, + { + RpcMethod: "Accounts", + Use: "accounts", + Short: "Query all account permissions", + }, + { + RpcMethod: "DisabledList", + Use: "disabled-list", + Short: "Query a list of all disabled message types", + }, + }, + }, + Tx: &autocliv1.ServiceCommandDescriptor{ + Service: circuitv1.Msg_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "AuthorizeCircuitBreaker", + Use: "authorize [grantee] [permissions_json] --from [granter]", + Short: "Authorize an account to trip the circuit breaker.", + Long: `Authorize an account to trip the circuit breaker. +"SOME_MSGS" = 1, +"ALL_MSGS" = 2, +"SUPER_ADMIN" = 3,`, + Example: fmt.Sprintf(`%s circuit authorize [address] '{"level":1,"limit_type_urls":["/cosmos.bank.v1beta1.MsgSend, /cosmos.bank.v1beta1.MsgMultiSend"]}'"`, version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "grantee"}, + {ProtoField: "permissions"}, // TODO(@julienrbrt) Support flattening msg for setting each field as a positional arg + }, + }, + { + RpcMethod: "TripCircuitBreaker", + Use: "disable [msg_type_urls]", + Short: "Disable a message from being executed", + Example: fmt.Sprintf(`%s circuit disable "/cosmos.bank.v1beta1.MsgSend /cosmos.bank.v1beta1.MsgMultiSend"`, version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "msg_type_urls", Varargs: true}, + }, + }, + { + RpcMethod: "ResetCircuitBreaker", + Use: "reset [msg_type_urls]", + Short: "Enable a message to be executed", + Example: fmt.Sprintf(`%s circuit reset "/cosmos.bank.v1beta1.MsgSend /cosmos.bank.v1beta1.MsgMultiSend"`, version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "msg_type_urls", Varargs: true}, + }, + }, + }, + }, + } +} diff --git a/x/circuit/client/cli/query.go b/x/circuit/client/cli/query.go deleted file mode 100644 index 95be5a575c08..000000000000 --- a/x/circuit/client/cli/query.go +++ /dev/null @@ -1,119 +0,0 @@ -package cli - -import ( - "cosmossdk.io/x/circuit/types" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/spf13/cobra" -) - -// GetQueryCmd returns the parent command for all circuit CLI query commands. -func GetQueryCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: types.ModuleName, - Short: "Querying commands for the circuit module", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - cmd.AddCommand( - GetDisabeListCmd(), - GetAccountCmd(), - GetAccountsCmd(), - ) - - return cmd -} - -func GetDisabeListCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "disabled-list", - Short: "Query for all disabled message types", - Args: cobra.ExactArgs(0), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - res, err := queryClient.DisabledList(cmd.Context(), &types.QueryDisabledListRequest{}) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -func GetAccountCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "account [address]", - Short: "Query for account permissions", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - addr, err := sdk.AccAddressFromBech32(args[0]) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - res, err := queryClient.Account(cmd.Context(), &types.QueryAccountRequest{Address: addr.String()}) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -func GetAccountsCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "accounts", - Short: "Query for all account permissions", - Args: cobra.ExactArgs(0), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - res, err := queryClient.Accounts(cmd.Context(), &types.QueryAccountsRequest{Pagination: pageReq}) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/circuit/client/cli/tx.go b/x/circuit/client/cli/tx.go deleted file mode 100644 index e787dfc028ef..000000000000 --- a/x/circuit/client/cli/tx.go +++ /dev/null @@ -1,129 +0,0 @@ -package cli - -import ( - "fmt" - "strings" - - "github.com/cosmos/cosmos-sdk/version" - - "cosmossdk.io/math" - "cosmossdk.io/x/circuit/types" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/tx" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/spf13/cobra" -) - -// NewTxCmd returns a root CLI command handler for all x/circuit transaction commands. -func NewTxCmd() *cobra.Command { - txCmd := &cobra.Command{ - Use: types.ModuleName, - Short: "Circuit transaction subcommands", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - txCmd.AddCommand( - AuthorizeCircuitBreakerCmd(), - TripCircuitBreakerCmd(), - ) - - return txCmd -} - -// AuthorizeCircuitBreakerCmd returns a CLI command handler for creating a MsgAuthorizeCircuitBreaker transaction. -func AuthorizeCircuitBreakerCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "authorize [grantee] [permission_level] [limit_type_urls] --from [granter]", - Short: "Authorize an account to trip the circuit breaker.", - Long: `Authorize an account to trip the circuit breaker. - "SOME_MSGS" = 1, - "ALL_MSGS" = 2, - "SUPER_ADMIN" = 3,`, - Example: fmt.Sprintf(`%s circuit authorize [address] 0 "cosmos.bank.v1beta1.MsgSend,cosmos.bank.v1beta1.MsgMultiSend"`, version.AppName), - Args: cobra.RangeArgs(3, 4), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - grantee, err := sdk.AccAddressFromBech32(args[0]) - if err != nil { - return err - } - - lvl, err := math.ParseUint(args[1]) - if err != nil { - return err - } - - var typeUrls []string - if len(args) == 4 { - typeUrls = strings.Split(args[2], ",") - } - - permission := types.Permissions{Level: types.Permissions_Level(lvl.Uint64()), LimitTypeUrls: typeUrls} - - msg := types.NewMsgAuthorizeCircuitBreaker(clientCtx.GetFromAddress().String(), grantee.String(), &permission) - - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} - -// TripCircuitBreakerCmd returns a CLI command handler for creating a MsgTripCircuitBreaker transaction. -func TripCircuitBreakerCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "disable [type_url]", - Short: "disable a message from being executed", - Example: fmt.Sprintf(`%s circuit disable "cosmos.bank.v1beta1.MsgSend,cosmos.bank.v1beta1.MsgMultiSend"`, version.AppName), - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - msg := types.NewMsgTripCircuitBreaker(clientCtx.GetFromAddress().String(), strings.Split(args[0], ",")) - - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} - -// ResetCircuitBreakerCmd returns a CLI command handler for creating a MsgRestCircuitBreaker transaction. -func ResetCircuitBreakerCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "reset [type_url]", - Short: "Enable a message to be executed", - Example: fmt.Sprintf(`%s circuit reset "cosmos.bank.v1beta1.MsgSend,cosmos.bank.v1beta1.MsgMultiSend"`, version.AppName), - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - msgTypeUrls := strings.Split(args[0], ",") - - msg := types.NewMsgResetCircuitBreaker(clientCtx.GetFromAddress().String(), msgTypeUrls) - - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} diff --git a/x/circuit/go.mod b/x/circuit/go.mod index 9e16351437df..ddd0a9e2562e 100644 --- a/x/circuit/go.mod +++ b/x/circuit/go.mod @@ -1,155 +1,161 @@ module cosmossdk.io/x/circuit -go 1.20 +go 1.23.0 require ( - cosmossdk.io/api v0.4.2 - cosmossdk.io/collections v0.2.0 - cosmossdk.io/core v0.8.0 - cosmossdk.io/depinject v1.0.0-alpha.3 - cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 - cosmossdk.io/math v1.0.1 - cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c - github.com/cockroachdb/errors v1.9.1 - github.com/cometbft/cometbft v0.38.0-rc1 - github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230524212735-6cabb6aa5741 - github.com/cosmos/gogoproto v1.4.10 - github.com/golang/protobuf v1.5.3 + cosmossdk.io/api v0.7.6 + cosmossdk.io/collections v0.4.0 + cosmossdk.io/core v0.11.0 + cosmossdk.io/depinject v1.1.0 + cosmossdk.io/errors v1.0.1 + cosmossdk.io/store v1.1.1 + github.com/cockroachdb/errors v1.11.3 + github.com/cometbft/cometbft v0.38.17 + github.com/cosmos/cosmos-sdk v0.50.13 + github.com/cosmos/gogoproto v1.7.0 + github.com/golang/protobuf v1.5.4 github.com/grpc-ecosystem/grpc-gateway v1.16.0 - github.com/spf13/cobra v1.7.0 - github.com/stretchr/testify v1.8.4 - google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a - google.golang.org/grpc v1.55.0 + github.com/stretchr/testify v1.10.0 + google.golang.org/genproto/googleapis/api v0.0.0-20250224174004-546df14abb99 + google.golang.org/grpc v1.71.0 ) require ( - cosmossdk.io/log v1.1.0 // indirect - cosmossdk.io/x/tx v0.8.0 // indirect + cosmossdk.io/log v1.5.0 // indirect + cosmossdk.io/math v1.5.0 // indirect + cosmossdk.io/x/tx v0.13.7 // indirect filippo.io/edwards25519 v1.0.0 // 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/armon/go-metrics v0.4.1 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect - github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect + github.com/bytedance/sonic v1.12.3 // indirect + github.com/bytedance/sonic/loader v0.2.0 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // indirect - github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/cloudwego/base64x v0.1.4 // indirect + github.com/cloudwego/iasm v0.2.0 // indirect + github.com/cockroachdb/apd/v3 v3.2.1 // indirect + github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20230606152911-c4be581b807f // indirect - github.com/cockroachdb/redact v1.1.4 // indirect - github.com/cometbft/cometbft-db v0.7.0 // indirect + github.com/cockroachdb/pebble v1.1.2 // indirect + github.com/cockroachdb/redact v1.1.5 // indirect + github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect + github.com/cometbft/cometbft-db v0.14.1 // indirect github.com/cosmos/btcutil v1.0.5 // indirect - github.com/cosmos/cosmos-db v1.0.0 // indirect - github.com/cosmos/cosmos-proto v1.0.0-beta.3 // indirect + github.com/cosmos/cosmos-db v1.1.1 // indirect + github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.0.0-beta.2 // indirect - github.com/cosmos/ics23/go v0.10.0 // indirect - github.com/cosmos/ledger-cosmos-go v0.13.0 // indirect + github.com/cosmos/iavl v1.2.2 // indirect + github.com/cosmos/ics23/go v0.11.0 // indirect + github.com/cosmos/ledger-cosmos-go v0.14.0 // indirect github.com/danieljoos/wincred v1.1.2 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect - github.com/dgraph-io/badger/v2 v2.2007.4 // indirect + github.com/dgraph-io/badger/v4 v4.2.0 // indirect 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/dvsekhvalnov/jose2go v1.5.0 // indirect - github.com/emicklei/dot v1.4.2 // indirect + github.com/dvsekhvalnov/jose2go v1.6.0 // indirect + github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.15.0 // indirect - github.com/felixge/httpsnoop v1.0.2 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/getsentry/sentry-go v0.21.0 // indirect - github.com/go-kit/kit v0.12.0 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect + github.com/getsentry/sentry-go v0.27.0 // indirect + github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/googleapis v1.4.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/glog v1.1.0 // indirect + github.com/golang/glog v1.2.4 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/mock v1.6.0 // indirect github.com/golang/snappy v0.0.4 // indirect - github.com/google/btree v1.1.2 // indirect - github.com/google/go-cmp v0.5.9 // indirect + github.com/google/btree v1.1.3 // indirect + github.com/google/flatbuffers v1.12.1 // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/google/orderedcode v0.0.1 // indirect github.com/gorilla/handlers v1.5.1 // indirect github.com/gorilla/mux v1.8.0 // indirect - github.com/gorilla/websocket v1.5.0 // 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/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/go-plugin v1.4.10 // indirect - github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect - github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/go-metrics v0.5.3 // indirect + github.com/hashicorp/go-plugin v1.5.2 // indirect + github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/yamux v0.1.1 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect github.com/huandu/skiplist v1.2.0 // indirect - github.com/iancoleman/strcase v0.2.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/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.16.5 // indirect + github.com/klauspost/compress v1.17.9 // indirect + github.com/klauspost/cpuid/v2 v2.0.9 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect - github.com/lib/pq v1.10.7 // indirect - github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.0 // indirect - github.com/magiconair/properties v1.8.7 // indirect + github.com/lib/pq v1.10.9 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.19 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/minio/highwayhash v1.0.2 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/minio/highwayhash v1.0.3 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect - github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect - github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.0.8 // indirect - github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761 // indirect + github.com/pelletier/go-toml/v2 v2.2.3 // indirect + github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.15.1 // indirect - github.com/prometheus/client_model v0.4.0 // indirect - github.com/prometheus/common v0.44.0 // indirect - github.com/prometheus/procfs v0.10.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/prometheus/client_golang v1.20.5 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.62.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.10.0 // indirect - github.com/rs/cors v1.8.3 // indirect - github.com/rs/zerolog v1.29.1 // indirect - github.com/sasha-s/go-deadlock v0.3.1 // indirect - github.com/spf13/afero v1.9.5 // indirect - github.com/spf13/cast v1.5.1 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/spf13/pflag v1.0.5 // indirect - github.com/spf13/viper v1.16.0 // indirect - github.com/subosito/gotenv v1.4.2 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect + github.com/rs/cors v1.11.1 // indirect + github.com/rs/zerolog v1.33.0 // indirect + github.com/sagikazarmark/locafero v0.7.0 // indirect + github.com/sasha-s/go-deadlock v0.3.5 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.12.0 // indirect + github.com/spf13/cast v1.7.1 // indirect + github.com/spf13/cobra v1.8.1 // indirect + github.com/spf13/pflag v1.0.6 // indirect + github.com/spf13/viper v1.20.0 // indirect + github.com/subosito/gotenv v1.6.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect - github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect github.com/tendermint/go-amino v0.16.0 // indirect - github.com/tidwall/btree v1.6.0 // indirect - github.com/zondax/hid v0.9.1 // indirect - github.com/zondax/ledger-go v0.14.1 // indirect - go.etcd.io/bbolt v1.3.6 // indirect - golang.org/x/crypto v0.9.0 // indirect - golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/sync v0.2.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/term v0.8.0 // indirect - golang.org/x/text v0.9.0 // indirect - google.golang.org/genproto v0.0.0-20230525234025-438c736192d0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect - google.golang.org/protobuf v1.30.0 // indirect - gopkg.in/ini.v1 v1.67.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect + github.com/tidwall/btree v1.7.0 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + github.com/zondax/hid v0.9.2 // indirect + github.com/zondax/ledger-go v0.14.3 // indirect + go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 // indirect + go.opencensus.io v0.24.0 // indirect + go.uber.org/multierr v1.10.0 // indirect + golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect + golang.org/x/crypto v0.35.0 // indirect + golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect + golang.org/x/net v0.34.0 // indirect + golang.org/x/sync v0.11.0 // indirect + golang.org/x/sys v0.30.0 // indirect + golang.org/x/term v0.29.0 // indirect + golang.org/x/text v0.22.0 // indirect + google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2 // indirect + google.golang.org/protobuf v1.36.5 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - gotest.tools/v3 v3.4.0 // indirect + gotest.tools/v3 v3.5.1 // indirect nhooyr.io/websocket v1.8.6 // indirect - pgregory.net/rapid v0.6.2 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect + pgregory.net/rapid v1.1.0 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect ) - -replace github.com/cosmos/cosmos-sdk => ../../. diff --git a/x/circuit/go.sum b/x/circuit/go.sum index 67018039c554..e3d3c5da69a3 100644 --- a/x/circuit/go.sum +++ b/x/circuit/go.sum @@ -1,58 +1,23 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= -cosmossdk.io/api v0.4.2 h1:lQBMl4xINnMnBOR/tQLtjlDnR4exr4e6/SfHR8PILE0= -cosmossdk.io/api v0.4.2/go.mod h1:qrVgOp7DIeAXa+Tt5dDjOC47bZCDrwx8ZHxrmy7STNE= -cosmossdk.io/collections v0.2.0 h1:CgMfLtE16+qox3zBYrGh60i4yKV8SeExLnIdOS2sbQs= -cosmossdk.io/collections v0.2.0/go.mod h1:Oc1FK0vlmxJZsgUn9/o3ldE6zNyWKvobVzaLhWknZJE= -cosmossdk.io/core v0.8.0 h1:LcJnu52E1a8f8E317VfQ1xK/RZe+IuhMNQAjnDLh25M= -cosmossdk.io/core v0.8.0/go.mod h1:LF6VLOv2DdCiaHxYVmr0MZcZpaSM9ZgvyrQSYTeg6D0= -cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw= -cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= -cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 h1:BCRz06fvddw7cKGiEGDiSox3qMsjQ97f92K+PDZDHdc= -cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741/go.mod h1:TB05o6YXkZkzsc+6bZFAV5kZRBtoCU9tUkbeMIqEg0w= -cosmossdk.io/log v1.1.0 h1:v0ogPHYeTzPcBTcPR1A3j1hkei4pZama8kz8LKlCMv0= -cosmossdk.io/log v1.1.0/go.mod h1:6zjroETlcDs+mm62gd8Ig7mZ+N+fVOZS91V17H+M4N4= -cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= -cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= -cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c h1:A+FMPW9GtfcPBDQNtFeDFN27h1SAP6OVjnGgPLlYXmI= -cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c/go.mod h1:RbYGvXCbz8uNBCXrwS9Z8SyydeWi+W5x5MZ33muyzMw= -cosmossdk.io/x/tx v0.8.0 h1:gLiGRL/Fy7fs6dd0IX8jOf0PrVr56/SG6XVMGQjyvJU= -cosmossdk.io/x/tx v0.8.0/go.mod h1:T9uEumGNgKU61gJYRv1t3uzQwLnASpJGmSE229HM3xA= +cosmossdk.io/api v0.7.6 h1:PC20PcXy1xYKH2KU4RMurVoFjjKkCgYRbVAD4PdqUuY= +cosmossdk.io/api v0.7.6/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= +cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= +cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= +cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= +cosmossdk.io/depinject v1.1.0 h1:wLan7LG35VM7Yo6ov0jId3RHWCGRhe8E8bsuARorl5E= +cosmossdk.io/depinject v1.1.0/go.mod h1:kkI5H9jCGHeKeYWXTqYdruogYrEeWvBQCw1Pj4/eCFI= +cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= +cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= +cosmossdk.io/log v1.5.0 h1:dVdzPJW9kMrnAYyMf1duqacoidB9uZIl+7c6z0mnq0g= +cosmossdk.io/log v1.5.0/go.mod h1:Tr46PUJjiUthlwQ+hxYtUtPn4D/oCZXAkYevBeh5+FI= +cosmossdk.io/math v1.5.0 h1:sbOASxee9Zxdjd6OkzogvBZ25/hP929vdcYcBJQbkLc= +cosmossdk.io/math v1.5.0/go.mod h1:AAwwBmUhqtk2nlku174JwSll+/DepUXW3rWIXN5q+Nw= +cosmossdk.io/store v1.1.1 h1:NA3PioJtWDVU7cHHeyvdva5J/ggyLDkyH0hGHl2804Y= +cosmossdk.io/store v1.1.1/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM= +cosmossdk.io/x/tx v0.13.7 h1:8WSk6B/OHJLYjiZeMKhq7DK7lHDMyK0UfDbBMxVmeOI= +cosmossdk.io/x/tx v0.13.7/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -60,30 +25,26 @@ github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMb github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= github.com/99designs/keyring v1.2.1 h1:tYLp1ULvO7i3fI5vE21ReQuj99QFSs7lGm0xWyJo87o= github.com/99designs/keyring v1.2.1/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= -github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= -github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= +github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= -github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= -github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= +github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= 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/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= +github.com/adlio/schema v1.3.6 h1:k1/zc2jNfeiZBA5aFTRy37jlBIuCkXCm0XmvpzCKI9I= +github.com/adlio/schema v1.3.6/go.mod h1:qkxwLgPBd1FgLRHYVCmQT/rrBr3JH38J9LjmVzWNudg= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= -github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= -github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -93,16 +54,12 @@ github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kd github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= -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/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -111,12 +68,19 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bits-and-blooms/bitset v1.7.0 h1:YjAGVd3XmtK9ktAbX8Zg2g2PwLIMjGREZJHlV4j7NEo= -github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= -github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= -github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= -github.com/bufbuild/protocompile v0.5.1 h1:mixz5lJX4Hiz4FpqFREJHIXLfaLBntfaJv1h+/jS+Qg= +github.com/bits-and-blooms/bitset v1.8.0 h1:FD+XqgOZDUxxZ8hzoBFuV9+cGWY9CslN6d5MS5JVb4c= +github.com/bits-and-blooms/bitset v1.8.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= +github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= +github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/btcutil v1.1.6 h1:zFL2+c3Lb9gEgqKNzowKUPQNb8jV7v5Oaodi/AYFd6c= +github.com/btcsuite/btcd/btcutil v1.1.6/go.mod h1:9dFymx8HpuLqBnsPELrImQeTQfKBQqzqGbbV3jK55aE= +github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY= +github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE= +github.com/bytedance/sonic v1.12.3 h1:W2MGa7RCU1QTeYRTPE3+88mVC0yXmsRQRChiyVocVjU= +github.com/bytedance/sonic v1.12.3/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= +github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= +github.com/bytedance/sonic/loader v0.2.0 h1:zNprn+lsIP06C/IqCHs3gPQIvnvpKbbxyXQP1iU4kWM= +github.com/bytedance/sonic/loader v0.2.0/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= @@ -124,21 +88,23 @@ github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInq github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -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/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI= +github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/0Y= +github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= +github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg= +github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= @@ -146,73 +112,74 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= -github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= +github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= +github.com/cockroachdb/apd/v3 v3.2.1 h1:U+8j7t0axsIgvQUqthuNm82HIrYXodOV2iWLWtEaIwg= +github.com/cockroachdb/apd/v3 v3.2.1/go.mod h1:klXJcjp+FffLTHlhIG69tezTDvdP065naDsHzKhYSqc= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= -github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= -github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= +github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce h1:giXvy4KSc/6g/esnpM7Geqxka4WSqI1SZc7sMJFd3y4= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/pebble v0.0.0-20230606152911-c4be581b807f h1:qQW3qCVRpjYsV4YNaUOjm6YLeliAD2jpgex9+D9tqU4= -github.com/cockroachdb/pebble v0.0.0-20230606152911-c4be581b807f/go.mod h1:TkdVsGYRqtULUppt2RbC+YaKtTHnHoWa2apfFrSKABw= -github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/cockroachdb/redact v1.1.4 h1:Y0XrVI2FAyofNyGveodTN//qdpPtFKcKTeCBsK3AHAQ= -github.com/cockroachdb/redact v1.1.4/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/pebble v1.1.2 h1:CUh2IPtR4swHlEj48Rhfzw6l/d0qA31fItcIszQVIsA= +github.com/cockroachdb/pebble v1.1.2/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= -github.com/cometbft/cometbft v0.38.0-rc1 h1:ph6smlqX82aH+d72KuxDHqu29M7LyusSp/obfGsGX/w= -github.com/cometbft/cometbft v0.38.0-rc1/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= -github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= -github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= +github.com/cometbft/cometbft v0.38.17 h1:FkrQNbAjiFqXydeAO81FUzriL4Bz0abYxN/eOHrQGOk= +github.com/cometbft/cometbft v0.38.17/go.mod h1:5l0SkgeLRXi6bBfQuevXjKqML1jjfJJlvI1Ulp02/o4= +github.com/cometbft/cometbft-db v0.14.1 h1:SxoamPghqICBAIcGpleHbmoPqy+crij/++eZz3DlerQ= +github.com/cometbft/cometbft-db v0.14.1/go.mod h1:KHP1YghilyGV/xjD5DP3+2hyigWx0WTp9X+0Gnx0RxQ= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= +github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= -github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0E= -github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= -github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= -github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= +github.com/cosmos/cosmos-db v1.1.1 h1:FezFSU37AlBC8S98NlSagL76oqBRWq/prTPvFcEJNCM= +github.com/cosmos/cosmos-db v1.1.1/go.mod h1:AghjcIPqdhSLP/2Z0yha5xPH3nLnskz81pBx3tcVSAw= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= +github.com/cosmos/cosmos-sdk v0.50.13 h1:xQ32hhzVy7agEe7behMdZN0ezWhPss3KoLZsF9KoBnw= +github.com/cosmos/cosmos-sdk v0.50.13/go.mod h1:hrWEFMU1eoXqLJeE6VVESpJDQH67FS1nnMrQIjO2daw= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoKuI= -github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= -github.com/cosmos/iavl v1.0.0-beta.2 h1:XOsIM80Yyml/KifCXEYOy9tWCXwMAbLa91n6pReW07Y= -github.com/cosmos/iavl v1.0.0-beta.2/go.mod h1:EA97dJ07TBktRlG/iGzK6g1eCXNj1q3MGoFYkVzrwHE= -github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= -github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= -github.com/cosmos/ledger-cosmos-go v0.13.0 h1:ex0CvCxToSR7j5WjrghPu2Bu9sSXKikjnVvUryNnx4s= -github.com/cosmos/ledger-cosmos-go v0.13.0/go.mod h1:ZcqYgnfNJ6lAXe4HPtWgarNEY+B74i+2/8MhZw4ziiI= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= +github.com/cosmos/iavl v1.2.2 h1:qHhKW3I70w+04g5KdsdVSHRbFLgt3yY3qTMd4Xa4rC8= +github.com/cosmos/iavl v1.2.2/go.mod h1:GiM43q0pB+uG53mLxLDzimxM9l/5N9UuSY3/D0huuVw= +github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= +github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= +github.com/cosmos/ledger-cosmos-go v0.14.0 h1:WfCHricT3rPbkPSVKRH+L4fQGKYHuGOK9Edpel8TYpE= +github.com/cosmos/ledger-cosmos-go v0.14.0/go.mod h1:E07xCWSBl3mTGofZ2QnL4cIUzMbbGVyik84QYKbX3RA= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= -github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= -github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= -github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= -github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= -github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= +github.com/dgraph-io/badger/v4 v4.2.0 h1:kJrlajbXXL9DFTNuhhu9yCx7JJa4qpYWxtE8BzuWsEs= +github.com/dgraph-io/badger/v4 v4.2.0/go.mod h1:qfCqhPoWDFJRx1gp5QwwyGo8xk1lbHUxvK9nK0OGAak= github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= @@ -220,74 +187,63 @@ github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUn github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= 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/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= 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/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= -github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= +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/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= -github.com/emicklei/dot v1.4.2 h1:UbK6gX4yvrpHKlxuUQicwoAis4zl8Dzwit9SnbBAXWw= -github.com/emicklei/dot v1.4.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= +github.com/emicklei/dot v1.6.2 h1:08GN+DD79cy/tzN6uLCT84+2Wk9u+wvqP+Hkx/dIR8A= +github.com/emicklei/dot v1.6.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= -github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= -github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= -github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= -github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= -github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= -github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= -github.com/getsentry/sentry-go v0.21.0 h1:c9l5F1nPF30JIppulk4veau90PK6Smu3abgVtVQWon4= -github.com/getsentry/sentry-go v0.21.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= +github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= +github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= -github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= -github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= -github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= +github.com/go-kit/kit v0.13.0 h1:OoneCcHKHQ03LfBpoQCUfCluwd2Vt3ohz+kvbJneZAU= +github.com/go-kit/kit v0.13.0/go.mod h1:phqEHMMUbyrCFCTgH48JueqrM3md2HcAZ8N3XE4FKDg= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= @@ -296,17 +252,25 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= +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-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= +github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= +github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= +github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= @@ -314,11 +278,10 @@ github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6Wezm github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= +github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= -github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= 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= @@ -329,22 +292,15 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV 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/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= -github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= -github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= +github.com/golang/glog v1.2.4 h1:CNNw5U8lSiiBk7druxtSHHTsRWcxKoac6kZKm2peBBc= +github.com/golang/glog v1.2.4/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -352,7 +308,6 @@ github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= @@ -364,56 +319,40 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -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/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= +github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= +github.com/google/flatbuffers v1.12.1 h1:MVlul7pQNoDzWRLTw5imwYsl+usrS1TXG2H4jg6ImGw= +github.com/google/flatbuffers v1.12.1/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 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= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= @@ -424,8 +363,8 @@ github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= @@ -446,10 +385,12 @@ github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVH github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-metrics v0.5.3 h1:M5uADWMOGCTUNU1YuC4hfknOeHNaX54LDm4oYSucoNE= +github.com/hashicorp/go-metrics v0.5.3/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-plugin v1.4.10 h1:xUbmA4jC6Dq163/fWcp8P3JuHilrHHMLNRxzGQJ9hNk= -github.com/hashicorp/go-plugin v1.4.10/go.mod h1:6/1TEzT0eQznvI/gV2CM29DLSkAK/e58mUWKVsPaph0= +github.com/hashicorp/go-plugin v1.5.2 h1:aWv8eimFqWlsEiMrYZdPYl+FdHaBJSN4AWwGWfT1G2Y= +github.com/hashicorp/go-plugin v1.5.2/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= @@ -461,10 +402,10 @@ github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= @@ -479,24 +420,17 @@ github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0Jr github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw= github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= -github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= -github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= -github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= -github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= -github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= -github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= -github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= -github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= +github.com/jhump/protoreflect v1.15.3 h1:6SFRuqU45u9hIZPJAoZ8c28T3nK64BNdp9w6jFonzls= +github.com/jhump/protoreflect v1.15.3/go.mod h1:4ORHmSBmlCW8fh3xHmJMGyul1zNqZK4Elxc8qKP+p1k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= @@ -508,89 +442,67 @@ github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= 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/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= -github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= -github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= -github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= -github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= 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/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI= -github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= 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.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= -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= -github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.0 h1:H4L/LhP7GOMf1j17oQAElHgVlbEje2h14A8Tz9cM2BE= -github.com/linxGnu/grocksdb v1.8.0/go.mod h1:09CeBborffXhXdNpEcOeZrLKEnRtrZFEpFdPNI9Zjjg= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= +github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.8/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= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= 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-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= -github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= -github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= +github.com/minio/highwayhash v1.0.3 h1:kbnuUMoHYyVl7szWjSxJnxw11k2U709jqFPPmIUyD6Q= +github.com/minio/highwayhash v1.0.3/go.mod h1:GGYsuwP/fPD6Y9hMiXuapVvlIUEhFhMTh0rxU3ik1LQ= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= @@ -598,17 +510,17 @@ github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS4 github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/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= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= 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/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -624,8 +536,8 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce h1:/pEpMk55wH0X+E5zedGEMOdLuWmV8P4+4W3+LZaM6kg= -github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a h1:dlRvE5fWabOchtH7znfiFCcOvmIYgOeAS5ifBXBlh9Q= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= @@ -633,7 +545,6 @@ github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DV github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= @@ -645,10 +556,14 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/onsi/gomega v1.26.0 h1:03cDLK28U6hWvCAns6NeydX3zIm4SF3ci69ulidS32Q= +github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= 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-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= -github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= +github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= +github.com/opencontainers/runc v1.1.12 h1:BOIssBaW1La0/qbNZHXOOa71dZfZEQOzW7dqQf3phss= +github.com/opencontainers/runc v1.1.12/go.mod h1:S+lQwSfncpBha7XTy/5lBwWgm5+y5Ma/O44Ekby9FK8= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -658,18 +573,17 @@ github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJ github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= +github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= -github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= +github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= +github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= -github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761 h1:W04oB3d0J01W5jgYRGKsV8LCM6g9EkCvPkZcmFuy0OE= -github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 h1:Dx7Ovyv/SFnMFw3fD4oEoeorXc6saIiQ23LrGLth0Gw= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= @@ -680,9 +594,9 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= @@ -690,102 +604,91 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.15.1 h1:8tXpTmJbyH5lydzFPoxSIJ0J46jdh3tylbvM1xCv0LI= -github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= +github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= +github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= -github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= -github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= +github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io= +github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= -github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= 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/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= -github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= -github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.29.1 h1:cO+d60CHkknCbvzEWxP0S9K6KqyTjrCNUy1LdQLCGPc= -github.com/rs/zerolog v1.29.1/go.mod h1:Le6ESbR7hc+DP6Lt1THiV8CQSdkkNrd3R0XbEgp3ZBU= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= +github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/locafero v0.7.0 h1:5MqpDsTGNDhY8sGp0Aowyf0qKsPrhewaLSsFaodPcyo= +github.com/sagikazarmark/locafero v0.7.0/go.mod h1:2za3Cg5rMaTMoG/2Ulr9AwtFaIppKXTRYnozin4aB5k= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -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/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= +github.com/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb2NsU= +github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= -github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= -github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= -github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= +github.com/spf13/afero v1.12.0 h1:UcOPyRBYczmFn6yvphxkn9ZEOY65cpwGKb5mL36mrqs= +github.com/spf13/afero v1.12.0/go.mod h1:ZTlWwG4/ahT8W7T0WQ5uYmjI9duaLQGy3Q2OAl4sk/4= +github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= +github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= -github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= +github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= +github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.20.0 h1:zrxIyR3RQIOsarIrgL8+sAvALXul9jeEPa06Y0Ph6vY= +github.com/spf13/viper v1.20.0/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -795,65 +698,57 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= -github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +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.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= -github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= +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/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= +github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= -github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= -github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= -github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= -github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= -github.com/zondax/ledger-go v0.14.1 h1:Pip65OOl4iJ84WTpA4BKChvOufMhhbxED3BaihoZN4c= -github.com/zondax/ledger-go v0.14.1/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2feOQv8K320= +github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= +github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= +github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= +github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= -go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 h1:qxen9oVGzDdIRP6ejyAJc760RwW4SnVDiTYTzwnXuxo= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5/go.mod h1:eW0HG9/oHQhvRCvb1/pIXW4cOvtDqeQK+XSi3TnwaXY= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= +go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= +go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY= +go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI= +go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ= +go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE= +go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A= +go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU= +go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk= +go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w= +go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k= +go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -863,66 +758,45 @@ go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= +go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670 h1:18EFjUmQOcUvxNYSkA6jO9VAiXCnxFY6NyDX0bHDmkU= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= -golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= +golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs= +golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= +golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= +golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= 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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -934,69 +808,38 @@ golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= 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= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= -golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= +golang.org/x/sync v0.11.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-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1005,20 +848,12 @@ golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 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-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= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1027,254 +862,122 @@ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/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-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220315194320-039c03cc5b86/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= +golang.org/x/sys v0.30.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.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU= +golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s= 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= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= +golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -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= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/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-20181221001348-537d06c36207/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-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= +golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg= +golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= 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= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -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-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= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20230525234025-438c736192d0 h1:x1vNwUhVOcsYoKyEGCZBH694SBmmBjA2EfauFVEI2+M= -google.golang.org/genproto v0.0.0-20230525234025-438c736192d0/go.mod h1:9ExIQyXL5hZrHzQceCwuSYwZZ5QZBazOcprJ5rgs3lY= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a h1:HiYVD+FGJkTo+9zj1gqz0anapsa1JxjiSrN+BJKyUmE= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a/go.mod h1:ts19tUU+Z0ZShN1y3aPyq2+O3d5FUNNgT6FtOzmrNn8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 h1:ToEetK57OidYuqD4Q5w+vfEnPvPpuTwedCNVohYJfNk= +google.golang.org/genproto v0.0.0-20241118233622-e639e219e697/go.mod h1:JJrvXBWRZaFMxBufik1a4RpFw4HhgVtBBWQeQgUj2cc= +google.golang.org/genproto/googleapis/api v0.0.0-20250224174004-546df14abb99 h1:ilJhrCga0AptpJZXmUYG4MCrx/zf3l1okuYz7YK9PPw= +google.golang.org/genproto/googleapis/api v0.0.0-20250224174004-546df14abb99/go.mod h1:Xsh8gBVxGCcbV8ZeTB9wI5XPyZ5RvC6V3CTeeplHbiA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2 h1:DMTIbak9GhdaSxEjvVzAeNZvyc03I61duqNbnm3SU0M= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2/go.mod h1:LuRYeWDFV6WOn90g357N17oMCaxpgCnbi/44qJvDn2I= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= +google.golang.org/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg= +google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1289,24 +992,19 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= +google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 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.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= 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/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= -gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= -gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -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/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= @@ -1321,29 +1019,22 @@ gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 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= -gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= -gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= +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-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -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= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= -pgregory.net/rapid v0.6.2 h1:ErW5sL+UKtfBfUTsWHDCoeB+eZKLKMxrSd1VJY6W4bw= -pgregory.net/rapid v0.6.2/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= +pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= +pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/x/circuit/keeper/genesis.go b/x/circuit/keeper/genesis.go index 50fd6af67c5f..d6747d442908 100644 --- a/x/circuit/keeper/genesis.go +++ b/x/circuit/keeper/genesis.go @@ -3,8 +3,6 @@ package keeper import ( context "context" - "cosmossdk.io/collections" - errorsmod "cosmossdk.io/errors" "cosmossdk.io/x/circuit/types" ) @@ -27,7 +25,7 @@ func (k *Keeper) ExportGenesis(ctx context.Context) (data *types.GenesisState) { }) return false, nil }) - if err != nil && !errorsmod.IsOf(err, collections.ErrInvalidIterator) { + if err != nil { panic(err) } @@ -35,7 +33,7 @@ func (k *Keeper) ExportGenesis(ctx context.Context) (data *types.GenesisState) { disabledMsgs = append(disabledMsgs, msgUrl) return false, nil }) - if err != nil && !errorsmod.IsOf(err, collections.ErrInvalidIterator) { + if err != nil { panic(err) } diff --git a/x/circuit/keeper/genesis_test.go b/x/circuit/keeper/genesis_test.go new file mode 100644 index 000000000000..e85f3f286859 --- /dev/null +++ b/x/circuit/keeper/genesis_test.go @@ -0,0 +1,88 @@ +package keeper_test + +import ( + "context" + "testing" + + "github.com/stretchr/testify/suite" + + storetypes "cosmossdk.io/store/types" + "cosmossdk.io/x/circuit" + "cosmossdk.io/x/circuit/keeper" + "cosmossdk.io/x/circuit/types" + + "github.com/cosmos/cosmos-sdk/codec" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" + "github.com/cosmos/cosmos-sdk/runtime" + "github.com/cosmos/cosmos-sdk/testutil" + sdk "github.com/cosmos/cosmos-sdk/types" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" +) + +type GenesisTestSuite struct { + suite.Suite + + ctx context.Context + keeper keeper.Keeper + cdc *codec.ProtoCodec + addrBytes []byte +} + +func TestGenesisTestSuite(t *testing.T) { + suite.Run(t, new(GenesisTestSuite)) +} + +func (s *GenesisTestSuite) SetupTest() { + key := storetypes.NewKVStoreKey(types.StoreKey) + testCtx := testutil.DefaultContextWithDB(s.T(), key, storetypes.NewTransientStoreKey("transient_test")) + encCfg := moduletestutil.MakeTestEncodingConfig(circuit.AppModuleBasic{}) + + sdkCtx := testCtx.Ctx + s.ctx = sdkCtx + s.cdc = codec.NewProtoCodec(encCfg.InterfaceRegistry) + authority := authtypes.NewModuleAddress("gov") + ac := addresscodec.NewBech32Codec("cosmos") + + bz, err := ac.StringToBytes(authority.String()) + s.Require().NoError(err) + s.addrBytes = bz + + s.keeper = keeper.NewKeeper(s.cdc, runtime.NewKVStoreService(key), authority.String(), ac) +} + +func (s *GenesisTestSuite) TestInitExportGenesis() { + perms := types.Permissions{ + Level: 3, + LimitTypeUrls: []string{"test"}, + } + err := s.keeper.Permissions.Set(s.ctx, s.addrBytes, perms) + s.Require().NoError(err) + + var accounts []*types.GenesisAccountPermissions + genAccsPerms := types.GenesisAccountPermissions{ + Address: sdk.AccAddress(s.addrBytes).String(), + Permissions: &perms, + } + accounts = append(accounts, &genAccsPerms) + + url := "test_url" + + genesisState := &types.GenesisState{ + AccountPermissions: accounts, + DisabledTypeUrls: []string{url}, + } + + s.keeper.InitGenesis(s.ctx, genesisState) + + exported := s.keeper.ExportGenesis(s.ctx) + bz, err := s.cdc.MarshalJSON(exported) + s.Require().NoError(err) + + var exportedGenesisState types.GenesisState + err = s.cdc.UnmarshalJSON(bz, &exportedGenesisState) + s.Require().NoError(err) + + s.Require().Equal(genesisState.AccountPermissions, exportedGenesisState.AccountPermissions) + s.Require().Equal(genesisState.DisabledTypeUrls, exportedGenesisState.DisabledTypeUrls) +} diff --git a/x/circuit/keeper/keeper.go b/x/circuit/keeper/keeper.go index e095a89c8b3f..25513991f8c1 100644 --- a/x/circuit/keeper/keeper.go +++ b/x/circuit/keeper/keeper.go @@ -3,12 +3,12 @@ package keeper import ( context "context" - "github.com/cosmos/cosmos-sdk/codec" - "cosmossdk.io/collections" "cosmossdk.io/core/address" "cosmossdk.io/core/store" "cosmossdk.io/x/circuit/types" + + "github.com/cosmos/cosmos-sdk/codec" ) // Keeper defines the circuit module's keeper. @@ -69,6 +69,7 @@ func (k *Keeper) GetAuthority() []byte { return k.authority } +// IsAllowed returns true when msg URL is not found in the DisableList for given context, else false. func (k *Keeper) IsAllowed(ctx context.Context, msgURL string) (bool, error) { has, err := k.DisableList.Has(ctx, msgURL) return !has, err diff --git a/x/circuit/keeper/msg_server.go b/x/circuit/keeper/msg_server.go index ec5ccf6a8312..0c6bb07cbc40 100644 --- a/x/circuit/keeper/msg_server.go +++ b/x/circuit/keeper/msg_server.go @@ -8,7 +8,6 @@ import ( "cosmossdk.io/collections" errorsmod "cosmossdk.io/errors" - "cosmossdk.io/x/circuit/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -38,6 +37,10 @@ func (srv msgServer) AuthorizeCircuitBreaker(ctx context.Context, msg *types.Msg // Check that the authorizer has the permission level of "super admin" perms, err := srv.Permissions.Get(ctx, address) if err != nil { + if errorsmod.IsOf(err, collections.ErrNotFound) { + return nil, errorsmod.Wrap(sdkerrors.ErrUnauthorized, "only super admins can authorize users") + } + return nil, err } @@ -87,54 +90,37 @@ func (srv msgServer) TripCircuitBreaker(ctx context.Context, msg *types.MsgTripC return nil, err } - switch { - case perms.Level == types.Permissions_LEVEL_SUPER_ADMIN || perms.Level == types.Permissions_LEVEL_ALL_MSGS || bytes.Equal(address, srv.GetAuthority()): - for _, msgTypeURL := range msg.MsgTypeUrls { - // check if the message is in the list of allowed messages - isAllowed, err := srv.IsAllowed(ctx, msgTypeURL) - if err != nil { - return nil, err - } + for _, msgTypeURL := range msg.MsgTypeUrls { + // check if the message is in the list of allowed messages + isAllowed, err := srv.IsAllowed(ctx, msgTypeURL) + if err != nil { + return nil, err + } - if !isAllowed { - return nil, fmt.Errorf("message %s is already disabled", msgTypeURL) - } + if !isAllowed { + return nil, fmt.Errorf("message %s is already disabled", msgTypeURL) + } - if err = srv.DisableList.Set(ctx, msgTypeURL); err != nil { - return nil, err + switch { + case perms.Level == types.Permissions_LEVEL_SUPER_ADMIN || perms.Level == types.Permissions_LEVEL_ALL_MSGS || bytes.Equal(address, srv.GetAuthority()): + // if the sender is a super admin or the module authority, no need to check perms + case perms.Level == types.Permissions_LEVEL_SOME_MSGS: + // if the sender has permission for some messages, check if the sender has permission for this specific message + if !hasPermissionForMsg(perms, msgTypeURL) { + return nil, errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "account does not have permission to trip circuit breaker for message %s", msgTypeURL) } - + default: + return nil, errorsmod.Wrap(sdkerrors.ErrUnauthorized, "account does not have permission to trip circuit breaker") } - case perms.Level == types.Permissions_LEVEL_SOME_MSGS: - for _, msgTypeURL := range msg.MsgTypeUrls { - // check if the message is in the list of allowed messages - isAllowed, err := srv.IsAllowed(ctx, msgTypeURL) - if err != nil { - return nil, err - } - if !isAllowed { - return nil, fmt.Errorf("message %s is already disabled", msgTypeURL) - } - for _, msgurl := range perms.LimitTypeUrls { - if msgTypeURL == msgurl { - if err = srv.DisableList.Set(ctx, msgTypeURL); err != nil { - return nil, err - } - } else { - return nil, errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "account does not have permission to trip circuit breaker for message %s", msgTypeURL) - } - } + if err = srv.DisableList.Set(ctx, msgTypeURL); err != nil { + return nil, err } - default: - return nil, errorsmod.Wrap(sdkerrors.ErrUnauthorized, "account does not have permission to trip circuit breaker") - } - var urls string - if len(msg.GetMsgTypeUrls()) > 1 { - urls = strings.Join(msg.GetMsgTypeUrls(), ",") } + urls := strings.Join(msg.GetMsgTypeUrls(), ",") + sdkCtx := sdk.UnwrapSDKContext(ctx) sdkCtx.EventManager().EmitEvents(sdk.Events{ sdk.NewEvent( @@ -164,31 +150,36 @@ func (srv msgServer) ResetCircuitBreaker(ctx context.Context, msg *types.MsgRese return nil, err } - if perms.Level == types.Permissions_LEVEL_SUPER_ADMIN || perms.Level == types.Permissions_LEVEL_ALL_MSGS || perms.Level == types.Permissions_LEVEL_SOME_MSGS || bytes.Equal(address, srv.GetAuthority()) { - // add all msg type urls to the disable list - for _, msgTypeURL := range msg.MsgTypeUrls { - isAllowed, err := srv.IsAllowed(ctx, msgTypeURL) - if err != nil { - return nil, err - } + for _, msgTypeURL := range msg.MsgTypeUrls { + // check if the message is in the list of allowed messages + isAllowed, err := srv.IsAllowed(ctx, msgTypeURL) + if err != nil { + return nil, err + } - if isAllowed { - return nil, fmt.Errorf("message %s is not disabled", msgTypeURL) - } + if isAllowed { + return nil, fmt.Errorf("message %s is not disabled", msgTypeURL) + } - if err = srv.DisableList.Remove(ctx, msgTypeURL); err != nil { - return nil, err + switch { + case perms.Level == types.Permissions_LEVEL_SUPER_ADMIN || perms.Level == types.Permissions_LEVEL_ALL_MSGS || bytes.Equal(address, srv.GetAuthority()): + // if the sender is a super admin or the module authority, no need to check perms + case perms.Level == types.Permissions_LEVEL_SOME_MSGS: + // if the sender has permission for some messages, check if the sender has permission for this specific message + if !hasPermissionForMsg(perms, msgTypeURL) { + return nil, errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "account does not have permission to reset circuit breaker for message %s", msgTypeURL) } + default: + return nil, errorsmod.Wrap(sdkerrors.ErrUnauthorized, "account does not have permission to reset circuit breaker") } - } else { - return nil, errorsmod.Wrap(sdkerrors.ErrUnauthorized, "account does not have permission to reset circuit breaker") - } - var urls string - if len(msg.GetMsgTypeUrls()) > 1 { - urls = strings.Join(msg.GetMsgTypeUrls(), ",") + if err = srv.DisableList.Remove(ctx, msgTypeURL); err != nil { + return nil, err + } } + urls := strings.Join(msg.GetMsgTypeUrls(), ",") + sdkCtx := sdk.UnwrapSDKContext(ctx) sdkCtx.EventManager().EmitEvents(sdk.Events{ sdk.NewEvent( @@ -200,3 +191,13 @@ func (srv msgServer) ResetCircuitBreaker(ctx context.Context, msg *types.MsgRese return &types.MsgResetCircuitBreakerResponse{Success: true}, nil } + +// hasPermissionForMsg returns true if the account can trip or reset the message. +func hasPermissionForMsg(perms types.Permissions, msg string) bool { + for _, msgurl := range perms.LimitTypeUrls { + if msg == msgurl { + return true + } + } + return false +} diff --git a/x/circuit/keeper/msg_server_test.go b/x/circuit/keeper/msg_server_test.go index b5fcfc284553..0e94be0d61e2 100644 --- a/x/circuit/keeper/msg_server_test.go +++ b/x/circuit/keeper/msg_server_test.go @@ -1,17 +1,21 @@ package keeper_test import ( + "context" "testing" + "github.com/stretchr/testify/require" + "cosmossdk.io/collections" "cosmossdk.io/x/circuit/keeper" "cosmossdk.io/x/circuit/types" - "github.com/stretchr/testify/require" + + sdk "github.com/cosmos/cosmos-sdk/types" ) const msgSend = "cosmos.bank.v1beta1.MsgSend" -func Test_AuthorizeCircuitBreaker(t *testing.T) { +func TestAuthorizeCircuitBreaker(t *testing.T) { ft := initFixture(t) srv := keeper.NewMsgServerImpl(ft.keeper) @@ -30,13 +34,23 @@ func Test_AuthorizeCircuitBreaker(t *testing.T) { perms, err := ft.keeper.Permissions.Get(ft.ctx, add1) require.NoError(t, err) - require.Equal(t, adminPerms, perms, "admin perms are not the same") + require.Equal(t, adminPerms, perms, "admin perms are the same") // add a super user allmsgs := types.Permissions{Level: types.Permissions_LEVEL_ALL_MSGS, LimitTypeUrls: []string{""}} msg = &types.MsgAuthorizeCircuitBreaker{Granter: authority, Grantee: addresses[2], Permissions: &allmsgs} _, err = srv.AuthorizeCircuitBreaker(ft.ctx, msg) require.NoError(t, err) + require.Equal( + t, + sdk.NewEvent( + "authorize_circuit_breaker", + sdk.NewAttribute("granter", authority), + sdk.NewAttribute("grantee", addresses[2]), + sdk.NewAttribute("permission", allmsgs.String()), + ), + lastEvent(ft.ctx), + ) add2, err := ft.ac.StringToBytes(addresses[2]) require.NoError(t, err) @@ -44,26 +58,35 @@ func Test_AuthorizeCircuitBreaker(t *testing.T) { perms, err = ft.keeper.Permissions.Get(ft.ctx, add2) require.NoError(t, err) - require.Equal(t, allmsgs, perms, "admin perms are not the same") + require.Equal(t, allmsgs, perms) // unauthorized user who does not have perms trying to authorize superPerms := &types.Permissions{Level: types.Permissions_LEVEL_SUPER_ADMIN, LimitTypeUrls: []string{}} msg = &types.MsgAuthorizeCircuitBreaker{Granter: addresses[3], Grantee: addresses[2], Permissions: superPerms} _, err = srv.AuthorizeCircuitBreaker(ft.ctx, msg) - require.Error(t, err, "user with no permission should fail in authorizing others") + require.Error(t, err, "user with no permission fails in authorizing others") // user with permission level all_msgs tries to grant another user perms somePerms := &types.Permissions{Level: types.Permissions_LEVEL_SOME_MSGS, LimitTypeUrls: []string{}} msg = &types.MsgAuthorizeCircuitBreaker{Granter: addresses[2], Grantee: addresses[3], Permissions: somePerms} _, err = srv.AuthorizeCircuitBreaker(ft.ctx, msg) - require.Error(t, err, "user[2] does not have permission to grant others permission") - - // user successfully grants another user perms to a specific permission + require.Error(t, err, "super user[2] does not have permission to grant others permission") + // admin successfully grants another user perms to a specific permission somemsgs := types.Permissions{Level: types.Permissions_LEVEL_SOME_MSGS, LimitTypeUrls: []string{msgSend}} msg = &types.MsgAuthorizeCircuitBreaker{Granter: authority, Grantee: addresses[3], Permissions: &somemsgs} _, err = srv.AuthorizeCircuitBreaker(ft.ctx, msg) require.NoError(t, err) + require.Equal( + t, + sdk.NewEvent( + "authorize_circuit_breaker", + sdk.NewAttribute("granter", authority), + sdk.NewAttribute("grantee", addresses[3]), + sdk.NewAttribute("permission", somemsgs.String()), + ), + lastEvent(ft.ctx), + ) add3, err := ft.ac.StringToBytes(addresses[3]) require.NoError(t, err) @@ -71,24 +94,24 @@ func Test_AuthorizeCircuitBreaker(t *testing.T) { perms, err = ft.keeper.Permissions.Get(ft.ctx, add3) require.NoError(t, err) - require.Equal(t, somemsgs, perms, "admin perms are not the same") + require.Equal(t, somemsgs, perms) add4, err := ft.ac.StringToBytes(addresses[4]) require.NoError(t, err) perms, err = ft.keeper.Permissions.Get(ft.ctx, add4) - require.ErrorIs(t, err, collections.ErrNotFound, "user should have no perms by default") + require.ErrorIs(t, err, collections.ErrNotFound, "users have no perms by default") - require.Equal(t, types.Permissions{Level: types.Permissions_LEVEL_NONE_UNSPECIFIED, LimitTypeUrls: nil}, perms, "user should have no perms by default") + require.Equal(t, types.Permissions{Level: types.Permissions_LEVEL_NONE_UNSPECIFIED, LimitTypeUrls: nil}, perms, "users have no perms by default") - // admin tries grants another user permission ALL_MSGS with limited urls populated - invalidmsgs := types.Permissions{Level: types.Permissions_LEVEL_SOME_MSGS, LimitTypeUrls: []string{msgSend}} - msg = &types.MsgAuthorizeCircuitBreaker{Granter: authority, Grantee: addresses[4], Permissions: &invalidmsgs} + // admin tries grants another user permission SOME_MSGS with limited urls populated + permis := types.Permissions{Level: types.Permissions_LEVEL_SOME_MSGS, LimitTypeUrls: []string{msgSend}} + msg = &types.MsgAuthorizeCircuitBreaker{Granter: authority, Grantee: addresses[4], Permissions: &permis} _, err = srv.AuthorizeCircuitBreaker(ft.ctx, msg) require.NoError(t, err) } -func Test_TripCircuitBreaker(t *testing.T) { +func TestTripCircuitBreaker(t *testing.T) { ft := initFixture(t) srv := keeper.NewMsgServerImpl(ft.keeper) @@ -101,34 +124,64 @@ func Test_TripCircuitBreaker(t *testing.T) { admintrip := &types.MsgTripCircuitBreaker{Authority: authority, MsgTypeUrls: []string{url}} _, err = srv.TripCircuitBreaker(ft.ctx, admintrip) require.NoError(t, err) + require.Equal( + t, + sdk.NewEvent( + "trip_circuit_breaker", + sdk.NewAttribute("authority", authority), + sdk.NewAttribute("msg_url", url), + ), + lastEvent(ft.ctx), + ) allowed, err := ft.keeper.IsAllowed(ft.ctx, url) require.NoError(t, err) require.False(t, allowed, "circuit breaker should be tripped") + // user with enough permissions tries to trip circuit breaker for two messages + url, url2 := "cosmos.gov.v1beta1.MsgDeposit", "cosmos.gov.v1beta1.MsgVote" + twomsgs := &types.Permissions{Level: types.Permissions_LEVEL_SOME_MSGS, LimitTypeUrls: []string{url, url2}} + msg := &types.MsgAuthorizeCircuitBreaker{Granter: authority, Grantee: addresses[3], Permissions: twomsgs} + _, err = srv.AuthorizeCircuitBreaker(ft.ctx, msg) + require.NoError(t, err) + + // try to trip two messages with enough permissions + twoMsgTrip := &types.MsgTripCircuitBreaker{Authority: addresses[3], MsgTypeUrls: []string{url, url2}} + _, err = srv.TripCircuitBreaker(ft.ctx, twoMsgTrip) + require.NoError(t, err) + // user with all messages trips circuit breaker // add a super user allmsgs := &types.Permissions{Level: types.Permissions_LEVEL_ALL_MSGS, LimitTypeUrls: []string{""}} - msg := &types.MsgAuthorizeCircuitBreaker{Granter: authority, Grantee: addresses[1], Permissions: allmsgs} + msg = &types.MsgAuthorizeCircuitBreaker{Granter: authority, Grantee: addresses[1], Permissions: allmsgs} _, err = srv.AuthorizeCircuitBreaker(ft.ctx, msg) require.NoError(t, err) // try to trip the circuit breaker - url2 := "cosmos.staking.v1beta1.MsgDelegate" + url2 = "cosmos.staking.v1beta1.MsgDelegate" superTrip := &types.MsgTripCircuitBreaker{Authority: addresses[1], MsgTypeUrls: []string{url2}} _, err = srv.TripCircuitBreaker(ft.ctx, superTrip) require.NoError(t, err) + require.Equal( + t, + sdk.NewEvent( + "trip_circuit_breaker", + sdk.NewAttribute("authority", addresses[1]), + sdk.NewAttribute("msg_url", url2), + ), + lastEvent(ft.ctx), + ) allowed, err = ft.keeper.IsAllowed(ft.ctx, url2) require.NoError(t, err) require.False(t, allowed, "circuit breaker should be tripped") - // user with no permission attempts to trips circuit breaker + // user with no permission attempts to trip circuit breaker unknownTrip := &types.MsgTripCircuitBreaker{Authority: addresses[4], MsgTypeUrls: []string{url}} _, err = srv.TripCircuitBreaker(ft.ctx, unknownTrip) require.Error(t, err) - // user has permission to trip circuit breaker for two messages but only has permission for one + // user tries to trip circuit breaker for two messages but only has permission for one url, url2 = "cosmos.staking.v1beta1.MsgCreateValidator", "cosmos.staking.v1beta1.MsgEditValidator" somemsgs := &types.Permissions{Level: types.Permissions_LEVEL_SOME_MSGS, LimitTypeUrls: []string{url}} msg = &types.MsgAuthorizeCircuitBreaker{Granter: authority, Grantee: addresses[2], Permissions: somemsgs} @@ -138,16 +191,16 @@ func Test_TripCircuitBreaker(t *testing.T) { // try to trip two messages but user only has permission for one someTrip := &types.MsgTripCircuitBreaker{Authority: addresses[2], MsgTypeUrls: []string{url, url2}} _, err = srv.TripCircuitBreaker(ft.ctx, someTrip) - require.ErrorContains(t, err, "MsgEditValidator") + require.ErrorContains(t, err, "MsgEditValidator: unauthorized") // user tries to trip an already tripped circuit breaker - alreadyTripped := "cosmos.bank.v1beta1.MsgSend" + alreadyTripped := msgSend twoTrip := &types.MsgTripCircuitBreaker{Authority: addresses[1], MsgTypeUrls: []string{alreadyTripped}} _, err = srv.TripCircuitBreaker(ft.ctx, twoTrip) - require.Error(t, err) + require.ErrorContains(t, err, "already disabled") } -func Test_ResetCircuitBreaker(t *testing.T) { +func TestResetCircuitBreaker(t *testing.T) { ft := initFixture(t) authority, err := ft.ac.BytesToString(ft.mockAddr) require.NoError(t, err) @@ -155,7 +208,7 @@ func Test_ResetCircuitBreaker(t *testing.T) { srv := keeper.NewMsgServerImpl(ft.keeper) // admin resets circuit breaker - url := "cosmos.bank.v1beta1.MsgSend" + url := msgSend // admin trips circuit breaker admintrip := &types.MsgTripCircuitBreaker{Authority: authority, MsgTypeUrls: []string{url}} _, err = srv.TripCircuitBreaker(ft.ctx, admintrip) @@ -168,12 +221,20 @@ func Test_ResetCircuitBreaker(t *testing.T) { adminReset := &types.MsgResetCircuitBreaker{Authority: authority, MsgTypeUrls: []string{url}} _, err = srv.ResetCircuitBreaker(ft.ctx, adminReset) require.NoError(t, err) + require.Equal( + t, + sdk.NewEvent( + "reset_circuit_breaker", + sdk.NewAttribute("authority", authority), + sdk.NewAttribute("msg_url", url), + ), + lastEvent(ft.ctx), + ) allowed, err = ft.keeper.IsAllowed(ft.ctx, url) require.NoError(t, err) require.True(t, allowed, "circuit breaker should be reset") - // user has no permission to reset circuit breaker // admin trips circuit breaker _, err = srv.TripCircuitBreaker(ft.ctx, admintrip) require.NoError(t, err) @@ -182,6 +243,7 @@ func Test_ResetCircuitBreaker(t *testing.T) { require.NoError(t, err) require.False(t, allowed, "circuit breaker should be tripped") + // user has no permission to reset circuit breaker unknownUserReset := &types.MsgResetCircuitBreaker{Authority: addresses[1], MsgTypeUrls: []string{url}} _, err = srv.ResetCircuitBreaker(ft.ctx, unknownUserReset) require.Error(t, err) @@ -206,9 +268,17 @@ func Test_ResetCircuitBreaker(t *testing.T) { allMsgsReset := &types.MsgResetCircuitBreaker{Authority: addresses[1], MsgTypeUrls: []string{url}} _, err = srv.ResetCircuitBreaker(ft.ctx, allMsgsReset) require.NoError(t, err) - - // user tries to reset an message they dont have permission to reset - + require.Equal( + t, + sdk.NewEvent( + "reset_circuit_breaker", + sdk.NewAttribute("authority", addresses[1]), + sdk.NewAttribute("msg_url", url), + ), + lastEvent(ft.ctx), + ) + + // user tries to reset a message they dont have permission to reset url = "cosmos.staking.v1beta1.MsgCreateValidator" // give restricted perms to a user someMsgs := &types.Permissions{Level: types.Permissions_LEVEL_SOME_MSGS, LimitTypeUrls: []string{url2}} @@ -220,13 +290,86 @@ func Test_ResetCircuitBreaker(t *testing.T) { _, err = srv.TripCircuitBreaker(ft.ctx, admintrip) require.NoError(t, err) - // user with all messages resets circuit breaker - someMsgsReset := &types.MsgResetCircuitBreaker{Authority: addresses[2], MsgTypeUrls: []string{url}} + // user with some messages resets circuit breaker + someMsgsReset := &types.MsgResetCircuitBreaker{Authority: addresses[2], MsgTypeUrls: []string{url2}} _, err = srv.ResetCircuitBreaker(ft.ctx, someMsgsReset) require.NoError(t, err) + require.Equal( + t, + sdk.NewEvent( + "reset_circuit_breaker", + sdk.NewAttribute("authority", addresses[2]), + sdk.NewAttribute("msg_url", url2), + ), + lastEvent(ft.ctx), + ) // user tries to reset an already reset circuit breaker - admintrip = &types.MsgTripCircuitBreaker{Authority: addresses[1], MsgTypeUrls: []string{url2}} + someMsgsReset = &types.MsgResetCircuitBreaker{Authority: addresses[1], MsgTypeUrls: []string{url2}} + _, err = srv.ResetCircuitBreaker(ft.ctx, someMsgsReset) + require.Error(t, err) +} + +func lastEvent(ctx context.Context) sdk.Event { + sdkCtx := sdk.UnwrapSDKContext(ctx) + events := sdkCtx.EventManager().Events() + + return events[len(events)-1] +} + +func TestResetCircuitBreakerSomeMsgs(t *testing.T) { + ft := initFixture(t) + authority, err := ft.ac.BytesToString(ft.mockAddr) + require.NoError(t, err) + + srv := keeper.NewMsgServerImpl(ft.keeper) + + // admin resets circuit breaker + url := msgSend + url2 := "the_only_message_acc2_can_trip_and_reset" + + // add acc2 as an authorized account for only url2 + authmsg := &types.MsgAuthorizeCircuitBreaker{ + Granter: authority, + Grantee: addresses[2], + Permissions: &types.Permissions{ + Level: types.Permissions_LEVEL_SOME_MSGS, + LimitTypeUrls: []string{url2}, + }, + } + _, err = srv.AuthorizeCircuitBreaker(ft.ctx, authmsg) + require.NoError(t, err) + + // admin trips circuit breaker + admintrip := &types.MsgTripCircuitBreaker{Authority: authority, MsgTypeUrls: []string{url, url2}} _, err = srv.TripCircuitBreaker(ft.ctx, admintrip) + require.NoError(t, err) + + // sanity check, both messages should be tripped + allowed, err := ft.keeper.IsAllowed(ft.ctx, url) + require.NoError(t, err) + require.False(t, allowed, "circuit breaker should be tripped") + + allowed, err = ft.keeper.IsAllowed(ft.ctx, url2) + require.NoError(t, err) + require.False(t, allowed, "circuit breaker should be tripped") + + // now let's try to reset url using acc2 (should fail) + acc2Reset := &types.MsgResetCircuitBreaker{Authority: addresses[2], MsgTypeUrls: []string{url}} + _, err = srv.ResetCircuitBreaker(ft.ctx, acc2Reset) require.Error(t, err) + + // now let's try to reset url2 using acc2 (should pass) + acc2Reset = &types.MsgResetCircuitBreaker{Authority: addresses[2], MsgTypeUrls: []string{url2}} + _, err = srv.ResetCircuitBreaker(ft.ctx, acc2Reset) + require.NoError(t, err) + + // Only url2 should be reset, url should still be tripped + allowed, err = ft.keeper.IsAllowed(ft.ctx, url) + require.NoError(t, err) + require.False(t, allowed, "circuit breaker should be tripped") + + allowed, err = ft.keeper.IsAllowed(ft.ctx, url2) + require.NoError(t, err) + require.True(t, allowed, "circuit breaker should be reset") } diff --git a/x/circuit/keeper/query.go b/x/circuit/keeper/query.go index 3c889206a561..a8b39e4d4a82 100644 --- a/x/circuit/keeper/query.go +++ b/x/circuit/keeper/query.go @@ -3,11 +3,8 @@ package keeper import ( "context" - "cosmossdk.io/collections" - errorsmod "cosmossdk.io/errors" "cosmossdk.io/x/circuit/types" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" ) @@ -17,22 +14,20 @@ type QueryServer struct { keeper Keeper } -// NewMsgServerImpl returns an implementation of the circuit MsgServer interface +// NewQueryServer returns an implementation of the circuit QueryServer interface // for the provided Keeper. func NewQueryServer(keeper Keeper) types.QueryServer { return &QueryServer{keeper: keeper} } // Account returns account permissions. -func (qs QueryServer) Account(c context.Context, req *types.QueryAccountRequest) (*types.AccountResponse, error) { - sdkCtx := sdk.UnwrapSDKContext(c) - +func (qs QueryServer) Account(ctx context.Context, req *types.QueryAccountRequest) (*types.AccountResponse, error) { add, err := qs.keeper.addressCodec.StringToBytes(req.Address) if err != nil { return nil, err } - perms, err := qs.keeper.Permissions.Get(sdkCtx, add) + perms, err := qs.keeper.Permissions.Get(ctx, add) if err != nil { return nil, err } @@ -42,26 +37,26 @@ func (qs QueryServer) Account(c context.Context, req *types.QueryAccountRequest) // Account returns account permissions. func (qs QueryServer) Accounts(ctx context.Context, req *types.QueryAccountsRequest) (*types.AccountsResponse, error) { - var accounts []*types.GenesisAccountPermissions - results, pageRes, err := query.CollectionPaginate[[]byte, types.Permissions](ctx, qs.keeper.Permissions, req.Pagination) + results, pageRes, err := query.CollectionPaginate( + ctx, + qs.keeper.Permissions, + req.Pagination, + func(key []byte, value types.Permissions) (*types.GenesisAccountPermissions, error) { + addrStr, err := qs.keeper.addressCodec.BytesToString(key) + if err != nil { + return nil, err + } + return &types.GenesisAccountPermissions{ + Address: addrStr, + Permissions: &value, + }, nil + }, + ) if err != nil { return nil, err } - for _, result := range results { - result := result - address, err := qs.keeper.addressCodec.BytesToString(result.Key) - if err != nil { - return nil, err - } - - accounts = append(accounts, &types.GenesisAccountPermissions{ - Address: address, - Permissions: &result.Value, - }) - } - - return &types.AccountsResponse{Accounts: accounts, Pagination: pageRes}, nil + return &types.AccountsResponse{Accounts: results, Pagination: pageRes}, nil } // DisabledList returns a list of disabled message urls @@ -72,7 +67,7 @@ func (qs QueryServer) DisabledList(ctx context.Context, req *types.QueryDisabled msgs = append(msgs, msgUrl) return false, nil }) - if err != nil && !errorsmod.IsOf(err, collections.ErrInvalidIterator) { + if err != nil { return nil, err } diff --git a/x/circuit/keeper/query_test.go b/x/circuit/keeper/query_test.go index c6b22c32fb8d..9fd6845aea58 100644 --- a/x/circuit/keeper/query_test.go +++ b/x/circuit/keeper/query_test.go @@ -3,9 +3,10 @@ package keeper_test import ( "testing" + "github.com/stretchr/testify/require" + "cosmossdk.io/x/circuit/keeper" "cosmossdk.io/x/circuit/types" - "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/types/query" ) @@ -30,6 +31,18 @@ func TestQueryAccount(t *testing.T) { require.Equal(t, res.Permission.LimitTypeUrls, []string{ "test", }) + + // test invalid address + res, err = qs.Account(f.ctx, &types.QueryAccountRequest{Address: "invalid"}) + require.Error(t, err) + require.ErrorContains(t, err, "invalid bech32 string") + require.Nil(t, res) + + // test account not found + res, err = qs.Account(f.ctx, &types.QueryAccountRequest{Address: addresses[1]}) + require.Error(t, err) + require.ErrorContains(t, err, "not found") + require.Nil(t, res) } func TestQueryAccounts(t *testing.T) { @@ -39,19 +52,26 @@ func TestQueryAccounts(t *testing.T) { add, err := f.ac.StringToBytes(addresses[0]) require.NoError(t, err) - err = f.keeper.Permissions.Set(f.ctx, add, f.mockPerms) - require.NoError(t, err) - // create a new query server qs := keeper.NewQueryServer(f.keeper) - // test the Accounts method + // test the Accounts method with no accounts res1, err := qs.Accounts(f.ctx, &types.QueryAccountsRequest{ Pagination: &query.PageRequest{Limit: 10}, }) require.NoError(t, err) + require.Len(t, res1.Accounts, 0) + + err = f.keeper.Permissions.Set(f.ctx, add, f.mockPerms) + require.NoError(t, err) - for _, a := range res1.Accounts { + // test the Accounts method + res2, err := qs.Accounts(f.ctx, &types.QueryAccountsRequest{ + Pagination: &query.PageRequest{Limit: 10}, + }) + require.NoError(t, err) + + for _, a := range res2.Accounts { require.Equal(t, addresses[0], a.Address) require.Equal(t, f.mockPerms, *a.Permissions) } @@ -63,13 +83,18 @@ func TestQueryDisabledList(t *testing.T) { t.Parallel() f := initFixture(t) - require.NoError(t, f.keeper.DisableList.Set(f.ctx, f.mockMsgURL)) - // create a new query server qs := keeper.NewQueryServer(f.keeper) // test the DisabledList method disabledList, err := qs.DisabledList(f.ctx, &types.QueryDisabledListRequest{}) require.NoError(t, err) + require.Len(t, disabledList.DisabledList, 0) + + require.NoError(t, f.keeper.DisableList.Set(f.ctx, f.mockMsgURL)) + + // test the DisabledList method + disabledList, err = qs.DisabledList(f.ctx, &types.QueryDisabledListRequest{}) + require.NoError(t, err) require.Equal(t, []string{f.mockMsgURL}, disabledList.DisabledList) } diff --git a/x/circuit/module.go b/x/circuit/module.go index 4a4f73557be8..33b8b54db3e4 100644 --- a/x/circuit/module.go +++ b/x/circuit/module.go @@ -4,38 +4,36 @@ import ( "context" "encoding/json" "fmt" - "time" + + gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" modulev1 "cosmossdk.io/api/cosmos/circuit/module/v1" "cosmossdk.io/core/address" "cosmossdk.io/core/appmodule" "cosmossdk.io/core/store" "cosmossdk.io/depinject" - "cosmossdk.io/x/circuit/client/cli" - abci "github.com/cometbft/cometbft/abci/types" - gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" + "cosmossdk.io/x/circuit/keeper" + "cosmossdk.io/x/circuit/types" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/runtime" - "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - - "cosmossdk.io/x/circuit/keeper" - "cosmossdk.io/x/circuit/types" ) // ConsensusVersion defines the current circuit module consensus version. const ConsensusVersion = 1 var ( - _ module.AppModuleGenesis = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleBasic = AppModule{} + _ module.HasGenesis = AppModule{} + _ module.HasServices = AppModule{} + + _ appmodule.AppModule = AppModule{} ) // AppModuleBasic defines the basic application module used by the circuit module. @@ -48,7 +46,6 @@ func (AppModuleBasic) Name() string { return types.ModuleName } // RegisterLegacyAminoCodec registers the circuit module's types on the LegacyAmino codec. func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - types.RegisterLegacyAminoCodec(cdc) } // DefaultGenesis returns default genesis state as raw bytes for the circuit @@ -74,16 +71,6 @@ func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *g } } -// GetTxCmd returns the root tx command for the circuit module. -func (AppModuleBasic) GetTxCmd() *cobra.Command { - return cli.NewTxCmd() -} - -// GetQueryCmd returns no root query command for the circuit module. -func (AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd() -} - // RegisterInterfaces registers interfaces and implementations of the circuit module. func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { types.RegisterInterfaces(registry) @@ -96,8 +83,6 @@ type AppModule struct { keeper keeper.Keeper } -var _ appmodule.AppModule = AppModule{} - // IsOnePerModuleType implements the depinject.OnePerModuleType interface. func (am AppModule) IsOnePerModuleType() {} @@ -123,14 +108,11 @@ func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion } // InitGenesis performs genesis initialization for the circuit module. It returns // no validator updates. -func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate { - start := time.Now() +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) { var genesisState types.GenesisState cdc.MustUnmarshalJSON(data, &genesisState) - telemetry.MeasureSince(start, "InitGenesis", "crisis", "unmarshal") am.keeper.InitGenesis(ctx, &genesisState) - return []abci.ValidatorUpdate{} } // ExportGenesis returns the exported genesis state as raw bytes for the circuit diff --git a/x/circuit/sonar-project.properties b/x/circuit/sonar-project.properties deleted file mode 100644 index f98be43f2c40..000000000000 --- a/x/circuit/sonar-project.properties +++ /dev/null @@ -1,14 +0,0 @@ -sonar.projectKey=cosmos-sdk-x-circuit -sonar.organization=cosmos - -sonar.projectName=Cosmos SDK - x/circuit -sonar.project.monorepo.enabled=true - -sonar.sources=. -sonar.exclusions=**/*_test.go -sonar.tests=. -sonar.test.inclusions=**/*_test.go -sonar.go.coverage.reportPaths=coverage.out - -sonar.sourceEncoding=UTF-8 -sonar.scm.provider=git \ No newline at end of file diff --git a/x/circuit/types/codec.go b/x/circuit/types/codec.go index ceddf6254300..775eb1aee1c5 100644 --- a/x/circuit/types/codec.go +++ b/x/circuit/types/codec.go @@ -1,21 +1,11 @@ package types import ( - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/codec/legacy" types "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" ) -// RegisterLegacyAminoCodec registers the necessary circuit interfaces and concrete types -// on the provided LegacyAmino codec. These types are used for Amino JSON serialization. -func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - legacy.RegisterAminoMsg(cdc, &MsgAuthorizeCircuitBreaker{}, "cosmos-sdk/MsgAuthorizeCircuitBreaker") - legacy.RegisterAminoMsg(cdc, &MsgResetCircuitBreaker{}, "cosmos-sdk/MsgResetCircuitBreaker") - legacy.RegisterAminoMsg(cdc, &MsgTripCircuitBreaker{}, "cosmos-sdk/MsgTripCircuitBreaker") -} - // RegisterInterfaces registers the interfaces types with the interface registry. func RegisterInterfaces(registry types.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), diff --git a/x/circuit/types/msgs.go b/x/circuit/types/msgs.go deleted file mode 100644 index 216a26514b1c..000000000000 --- a/x/circuit/types/msgs.go +++ /dev/null @@ -1,75 +0,0 @@ -package types - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" -) - -var ( - _ sdk.Msg = &MsgAuthorizeCircuitBreaker{} - _ sdk.Msg = &MsgTripCircuitBreaker{} - _ sdk.Msg = &MsgResetCircuitBreaker{} -) - -// NewMsgAuthorizeCircuitBreaker creates a new MsgAuthorizeCircuitBreaker instance. -func NewMsgAuthorizeCircuitBreaker(granter, grantee string, permission *Permissions) *MsgAuthorizeCircuitBreaker { - return &MsgAuthorizeCircuitBreaker{ - Granter: granter, - Grantee: grantee, - Permissions: permission, - } -} - -// Route Implements Msg. -func (m MsgAuthorizeCircuitBreaker) Route() string { return sdk.MsgTypeURL(&m) } - -// Type Implements Msg. -func (m MsgAuthorizeCircuitBreaker) Type() string { return sdk.MsgTypeURL(&m) } - -// GetSigners returns the expected signers for a MsgAuthorizeCircuitBreaker. -func (m MsgAuthorizeCircuitBreaker) GetSigners() []sdk.AccAddress { - granter := sdk.MustAccAddressFromBech32(m.Granter) - - return []sdk.AccAddress{granter} -} - -// NewMsgTripCircuitBreaker creates a new MsgTripCircuitBreaker instance. -func NewMsgTripCircuitBreaker(authority string, urls []string) *MsgTripCircuitBreaker { - return &MsgTripCircuitBreaker{ - Authority: authority, - MsgTypeUrls: urls, - } -} - -// Route Implements Msg. -func (m MsgTripCircuitBreaker) Route() string { return sdk.MsgTypeURL(&m) } - -// Type Implements Msg. -func (m MsgTripCircuitBreaker) Type() string { return sdk.MsgTypeURL(&m) } - -// GetSigners returns the expected signers for a MsgTripCircuitBreaker. -func (m MsgTripCircuitBreaker) GetSigners() []sdk.AccAddress { - granter := sdk.MustAccAddressFromBech32(m.Authority) - - return []sdk.AccAddress{granter} -} - -// NewMsgResetCircuitBreaker creates a new MsgResetCircuitBreaker instance. -func NewMsgResetCircuitBreaker(authority string, urls []string) *MsgResetCircuitBreaker { - return &MsgResetCircuitBreaker{ - Authority: authority, - MsgTypeUrls: urls, - } -} - -// Route Implements Msg. -func (m MsgResetCircuitBreaker) Route() string { return sdk.MsgTypeURL(&m) } - -// Type Implements Msg. -func (m MsgResetCircuitBreaker) Type() string { return sdk.MsgTypeURL(&m) } - -// GetSigners returns the expected signers for a MsgResetCircuitBreaker. -func (m MsgResetCircuitBreaker) GetSigners() []sdk.AccAddress { - granter := sdk.MustAccAddressFromBech32(m.Authority) - - return []sdk.AccAddress{granter} -} diff --git a/x/circuit/types/query.pb.go b/x/circuit/types/query.pb.go index 3933e4432621..d088b51d46cf 100644 --- a/x/circuit/types/query.pb.go +++ b/x/circuit/types/query.pb.go @@ -486,6 +486,7 @@ func _Query_DisabledList_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.circuit.v1.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/circuit/types/tx.pb.go b/x/circuit/types/tx.pb.go index dcd824939bb5..dd79d476f211 100644 --- a/x/circuit/types/tx.pb.go +++ b/x/circuit/types/tx.pb.go @@ -95,7 +95,7 @@ func (m *MsgAuthorizeCircuitBreaker) GetPermissions() *Permissions { return nil } -// MsgAuthorizeCircuitBreaker defines the Msg/AuthorizeCircuitBreaker response type. +// MsgAuthorizeCircuitBreakerResponse defines the Msg/AuthorizeCircuitBreaker response type. type MsgAuthorizeCircuitBreakerResponse struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` } @@ -199,7 +199,7 @@ func (m *MsgTripCircuitBreaker) GetMsgTypeUrls() []string { return nil } -// MsgTripCircuitBreaker defines the Msg/TripCircuitBreaker response type. +// MsgTripCircuitBreakerResponse defines the Msg/TripCircuitBreaker response type. type MsgTripCircuitBreakerResponse struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` } @@ -529,6 +529,7 @@ func _Msg_ResetCircuitBreaker_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.circuit.v1.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/consensus/autocli.go b/x/consensus/autocli.go new file mode 100644 index 000000000000..5a2e00900cc4 --- /dev/null +++ b/x/consensus/autocli.go @@ -0,0 +1,36 @@ +package consensus + +import ( + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + consensusv1 "cosmossdk.io/api/cosmos/consensus/v1" + + "github.com/cosmos/cosmos-sdk/client/grpc/cmtservice" +) + +// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. +func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { + return &autocliv1.ModuleOptions{ + Query: &autocliv1.ServiceCommandDescriptor{ + Service: consensusv1.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Params", + Use: "params", + Short: "Query the current consensus parameters", + }, + }, + SubCommands: map[string]*autocliv1.ServiceCommandDescriptor{ + "comet": cmtservice.CometBFTAutoCLIDescriptor, + }, + }, + Tx: &autocliv1.ServiceCommandDescriptor{ + Service: consensusv1.Msg_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "UpdateParams", + Skip: true, // skipped because authority gated + }, + }, + }, + } +} diff --git a/x/consensus/keeper/keeper.go b/x/consensus/keeper/keeper.go index 6de6457bf28d..b239a9ee5ee7 100644 --- a/x/consensus/keeper/keeper.go +++ b/x/consensus/keeper/keeper.go @@ -3,17 +3,18 @@ package keeper import ( "context" - "cosmossdk.io/collections" - "cosmossdk.io/core/event" - storetypes "cosmossdk.io/core/store" - "cosmossdk.io/errors" - cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" cmttypes "github.com/cometbft/cometbft/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "cosmossdk.io/collections" + "cosmossdk.io/core/event" + storetypes "cosmossdk.io/core/store" + "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/consensus/exported" "github.com/cosmos/cosmos-sdk/x/consensus/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" @@ -68,12 +69,36 @@ func (k Keeper) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams) (* return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", k.GetAuthority(), msg.Authority) } - consensusParams := msg.ToProtoConsensusParams() - if err := cmttypes.ConsensusParamsFromProto(consensusParams).ValidateBasic(); err != nil { + consensusParams, err := msg.ToProtoConsensusParams() + if err != nil { + return nil, err + } + + paramsProto, err := k.ParamsStore.Get(ctx) + if err != nil { + return nil, err + } + + // initialize version params with zero value if not set + if paramsProto.Version == nil { + paramsProto.Version = &cmtproto.VersionParams{} + } + + params := cmttypes.ConsensusParamsFromProto(paramsProto) + + nextParams := params.Update(&consensusParams) + + if err := nextParams.ValidateBasic(); err != nil { + return nil, err + } + + sdkCtx := sdk.UnwrapSDKContext(ctx) + + if err := params.ValidateUpdate(&consensusParams, sdkCtx.BlockHeader().Height); err != nil { return nil, err } - if err := k.ParamsStore.Set(ctx, consensusParams); err != nil { + if err := k.ParamsStore.Set(ctx, nextParams.ToProto()); err != nil { return nil, err } diff --git a/x/consensus/keeper/keeper_test.go b/x/consensus/keeper/keeper_test.go index e1b142d319c3..c349c8dbaffe 100644 --- a/x/consensus/keeper/keeper_test.go +++ b/x/consensus/keeper/keeper_test.go @@ -17,7 +17,6 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" "github.com/cosmos/cosmos-sdk/x/consensus/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" ) type KeeperTestSuite struct { @@ -31,11 +30,12 @@ type KeeperTestSuite struct { func (s *KeeperTestSuite) SetupTest() { key := storetypes.NewKVStoreKey(consensusparamkeeper.StoreKey) testCtx := testutil.DefaultContextWithDB(s.T(), key, storetypes.NewTransientStoreKey("transient_test")) - ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{}) + header := cmtproto.Header{Height: 5} + ctx := testCtx.Ctx.WithBlockHeader(header) encCfg := moduletestutil.MakeTestEncodingConfig() storeService := runtime.NewKVStoreService(key) - keeper := consensusparamkeeper.NewKeeper(encCfg.Codec, storeService, authtypes.NewModuleAddress(govtypes.ModuleName).String(), runtime.EventService{}) + keeper := consensusparamkeeper.NewKeeper(encCfg.Codec, storeService, authtypes.NewModuleAddress("gov").String(), runtime.EventService{}) s.ctx = ctx s.consensusParamsKeeper = &keeper @@ -44,6 +44,8 @@ func (s *KeeperTestSuite) SetupTest() { queryHelper := baseapp.NewQueryServerTestHelper(ctx, encCfg.InterfaceRegistry) types.RegisterQueryServer(queryHelper, keeper) s.queryClient = types.NewQueryClient(queryHelper) + err := s.consensusParamsKeeper.ParamsStore.Set(ctx, cmttypes.DefaultConsensusParams().ToProto()) + s.Require().NoError(err) } func TestKeeperTestSuite(t *testing.T) { @@ -51,7 +53,14 @@ func TestKeeperTestSuite(t *testing.T) { } func (s *KeeperTestSuite) TestGRPCQueryConsensusParams() { - defaultConsensusParams := cmttypes.DefaultConsensusParams().ToProto() + // Create ConsensusParams with modified fields + modifiedConsensusParams := cmttypes.DefaultConsensusParams().ToProto() + modifiedConsensusParams.Block.MaxBytes++ + modifiedConsensusParams.Block.MaxGas = 100 + modifiedConsensusParams.Evidence.MaxAgeDuration++ + modifiedConsensusParams.Evidence.MaxAgeNumBlocks++ + modifiedConsensusParams.Evidence.MaxBytes++ + modifiedConsensusParams.Validator.PubKeyTypes = []string{cmttypes.ABCIPubKeyTypeSecp256k1} testCases := []struct { msg string @@ -66,18 +75,51 @@ func (s *KeeperTestSuite) TestGRPCQueryConsensusParams() { func() { input := &types.MsgUpdateParams{ Authority: s.consensusParamsKeeper.GetAuthority(), - Block: defaultConsensusParams.Block, - Validator: defaultConsensusParams.Validator, - Evidence: defaultConsensusParams.Evidence, + Block: modifiedConsensusParams.Block, + Validator: modifiedConsensusParams.Validator, + Evidence: modifiedConsensusParams.Evidence, } - s.consensusParamsKeeper.UpdateParams(s.ctx, input) + _, err := s.consensusParamsKeeper.UpdateParams(s.ctx, input) + s.Require().NoError(err) }, types.QueryParamsResponse{ Params: &cmtproto.ConsensusParams{ - Block: defaultConsensusParams.Block, - Validator: defaultConsensusParams.Validator, - Evidence: defaultConsensusParams.Evidence, - Version: defaultConsensusParams.Version, + Block: modifiedConsensusParams.Block, + Validator: modifiedConsensusParams.Validator, + Evidence: modifiedConsensusParams.Evidence, + Version: modifiedConsensusParams.Version, + Abci: &cmtproto.ABCIParams{ + VoteExtensionsEnableHeight: 0, + }, + }, + }, + true, + }, + { + "success with abci", + types.QueryParamsRequest{}, + func() { + input := &types.MsgUpdateParams{ + Authority: s.consensusParamsKeeper.GetAuthority(), + Block: modifiedConsensusParams.Block, + Validator: modifiedConsensusParams.Validator, + Evidence: modifiedConsensusParams.Evidence, + Abci: &cmtproto.ABCIParams{ + VoteExtensionsEnableHeight: 1234, + }, + } + _, err := s.consensusParamsKeeper.UpdateParams(s.ctx, input) + s.Require().NoError(err) + }, + types.QueryParamsResponse{ + Params: &cmtproto.ConsensusParams{ + Block: modifiedConsensusParams.Block, + Validator: modifiedConsensusParams.Validator, + Evidence: modifiedConsensusParams.Evidence, + Version: modifiedConsensusParams.Version, + Abci: &cmtproto.ABCIParams{ + VoteExtensionsEnableHeight: 1234, + }, }, }, true, @@ -131,7 +173,7 @@ func (s *KeeperTestSuite) TestUpdateParams() { Evidence: defaultConsensusParams.Evidence, }, expErr: true, - expErrMsg: "block.MaxBytes must be greater than 0. Got -10", + expErrMsg: "block.MaxBytes must be -1 or greater than 0. Got -10", }, { name: "invalid authority", @@ -144,6 +186,109 @@ func (s *KeeperTestSuite) TestUpdateParams() { expErr: true, expErrMsg: "invalid authority", }, + { + name: "nil evidence params", + input: &types.MsgUpdateParams{ + Authority: s.consensusParamsKeeper.GetAuthority(), + Block: defaultConsensusParams.Block, + Validator: defaultConsensusParams.Validator, + Evidence: nil, + }, + expErr: true, + expErrMsg: "all parameters must be present", + }, + { + name: "nil block params", + input: &types.MsgUpdateParams{ + Authority: s.consensusParamsKeeper.GetAuthority(), + Block: nil, + Validator: defaultConsensusParams.Validator, + Evidence: defaultConsensusParams.Evidence, + }, + expErr: true, + expErrMsg: "all parameters must be present", + }, + { + name: "nil validator params", + input: &types.MsgUpdateParams{ + Authority: s.consensusParamsKeeper.GetAuthority(), + Block: defaultConsensusParams.Block, + Validator: nil, + Evidence: defaultConsensusParams.Evidence, + }, + expErr: true, + expErrMsg: "all parameters must be present", + }, + { + name: "valid ABCI update", + input: &types.MsgUpdateParams{ + Authority: s.consensusParamsKeeper.GetAuthority(), + Block: defaultConsensusParams.Block, + Validator: defaultConsensusParams.Validator, + Evidence: defaultConsensusParams.Evidence, + Abci: &cmtproto.ABCIParams{ + VoteExtensionsEnableHeight: 1235, + }, + }, + expErr: false, + expErrMsg: "", + }, + { + name: "noop ABCI update", + input: &types.MsgUpdateParams{ + Authority: s.consensusParamsKeeper.GetAuthority(), + Block: defaultConsensusParams.Block, + Validator: defaultConsensusParams.Validator, + Evidence: defaultConsensusParams.Evidence, + Abci: &cmtproto.ABCIParams{ + VoteExtensionsEnableHeight: 1235, + }, + }, + expErr: false, + expErrMsg: "", + }, + { + name: "valid ABCI clear", + input: &types.MsgUpdateParams{ + Authority: s.consensusParamsKeeper.GetAuthority(), + Block: defaultConsensusParams.Block, + Validator: defaultConsensusParams.Validator, + Evidence: defaultConsensusParams.Evidence, + Abci: &cmtproto.ABCIParams{ + VoteExtensionsEnableHeight: 0, + }, + }, + expErr: false, + expErrMsg: "", + }, + { + name: "invalid ABCI update - current height", + input: &types.MsgUpdateParams{ + Authority: s.consensusParamsKeeper.GetAuthority(), + Block: defaultConsensusParams.Block, + Validator: defaultConsensusParams.Validator, + Evidence: defaultConsensusParams.Evidence, + Abci: &cmtproto.ABCIParams{ + VoteExtensionsEnableHeight: 5, + }, + }, + expErr: true, + expErrMsg: "vote extensions cannot be updated to a past or current height", + }, + { + name: "invalid ABCI update - past height", + input: &types.MsgUpdateParams{ + Authority: s.consensusParamsKeeper.GetAuthority(), + Block: defaultConsensusParams.Block, + Validator: defaultConsensusParams.Validator, + Evidence: defaultConsensusParams.Evidence, + Abci: &cmtproto.ABCIParams{ + VoteExtensionsEnableHeight: 4, + }, + }, + expErr: true, + expErrMsg: "vote extensions cannot be updated to a past or current height", + }, } for _, tc := range testCases { @@ -156,6 +301,16 @@ func (s *KeeperTestSuite) TestUpdateParams() { s.Require().Contains(err.Error(), tc.expErrMsg) } else { s.Require().NoError(err) + + res, err := s.consensusParamsKeeper.Params(s.ctx, &types.QueryParamsRequest{}) + s.Require().NoError(err) + + if tc.input.Abci != nil { + s.Require().Equal(tc.input.Abci, res.Params.Abci) + } + s.Require().Equal(tc.input.Block, res.Params.Block) + s.Require().Equal(tc.input.Evidence, res.Params.Evidence) + s.Require().Equal(tc.input.Validator, res.Params.Validator) } }) } diff --git a/x/consensus/module.go b/x/consensus/module.go index 1834077305f9..b4f7ef1eb7db 100644 --- a/x/consensus/module.go +++ b/x/consensus/module.go @@ -2,25 +2,21 @@ package consensus import ( "context" - "encoding/json" - modulev1 "cosmossdk.io/api/cosmos/consensus/module/v1" - "cosmossdk.io/core/appmodule" - "cosmossdk.io/core/event" - "cosmossdk.io/depinject" - abci "github.com/cometbft/cometbft/abci/types" gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" "google.golang.org/grpc" + modulev1 "cosmossdk.io/api/cosmos/consensus/module/v1" + "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/event" storetypes "cosmossdk.io/core/store" + "cosmossdk.io/depinject" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/runtime" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/consensus/keeper" @@ -32,35 +28,25 @@ import ( const ConsensusVersion = 1 var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleBasic = AppModule{} + + _ appmodule.AppModule = AppModule{} + _ appmodule.HasServices = AppModule{} ) -// AppModuleBasic defines the basic application module used by the consensus_param module. +// AppModuleBasic defines the basic application module used by the consensus module. type AppModuleBasic struct { cdc codec.Codec } -// Name returns the consensus_param module's name. +// Name returns the consensus module's name. func (AppModuleBasic) Name() string { return types.ModuleName } -// RegisterLegacyAminoCodec registers the consensus_param module's types on the LegacyAmino codec. +// RegisterLegacyAminoCodec registers the consensus module's types on the LegacyAmino codec. func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { types.RegisterLegacyAminoCodec(cdc) } -// DefaultGenesis returns default genesis state as raw bytes for the consensus_param -// module. -func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { - // nil is returned since default genesis of consensus params is handled by tendermint - return nil -} - -// ValidateGenesis performs genesis state validation -func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error { - return nil -} - // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *gwruntime.ServeMux) { if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { @@ -68,16 +54,6 @@ func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *g } } -// GetTxCmd returns the root tx command -func (AppModuleBasic) GetTxCmd() *cobra.Command { - return nil -} - -// GetQueryCmd returns no root query command -func (AppModuleBasic) GetQueryCmd() *cobra.Command { - return nil -} - // RegisterInterfaces registers interfaces and implementations of the bank module. func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { types.RegisterInterfaces(registry) @@ -90,11 +66,6 @@ type AppModule struct { keeper keeper.Keeper } -var ( - _ appmodule.AppModule = AppModule{} - _ appmodule.HasServices = AppModule{} -) - // IsOnePerModuleType implements the depinject.OnePerModuleType interface. func (am AppModule) IsOnePerModuleType() {} @@ -116,21 +87,6 @@ func NewAppModule(cdc codec.Codec, keeper keeper.Keeper) AppModule { } } -// Name returns the consensus_param module's name. -func (AppModule) Name() string { return types.ModuleName } - -// InitGenesis is handled by for init genesis of consensus_param -func (am AppModule) InitGenesis(sdk.Context, codec.JSONCodec, json.RawMessage) []abci.ValidatorUpdate { - // nil is returned since initgenesis of consensus params is handled by tendermint - return nil -} - -// ExportGenesis is handled by CometBFT export of genesis -func (am AppModule) ExportGenesis(sdk.Context, codec.JSONCodec) json.RawMessage { - // nil is returned since ExportGenesis of consensus params is handled by CometBFT and baseapp - return nil -} - // ConsensusVersion implements AppModule/ConsensusVersion. func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion } diff --git a/x/consensus/testutil/expected_keepers_mocks.go b/x/consensus/testutil/expected_keepers_mocks.go index 35929b606df5..0f8109fd4d80 100644 --- a/x/consensus/testutil/expected_keepers_mocks.go +++ b/x/consensus/testutil/expected_keepers_mocks.go @@ -9,7 +9,7 @@ import ( types "github.com/cosmos/cosmos-sdk/types" types0 "github.com/cosmos/cosmos-sdk/x/auth/types" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockAccountKeeper is a mock of AccountKeeper interface. diff --git a/x/consensus/types/msgs.go b/x/consensus/types/msgs.go index 8b1a8345eef9..b62c0052f7cb 100644 --- a/x/consensus/types/msgs.go +++ b/x/consensus/types/msgs.go @@ -1,6 +1,8 @@ package types import ( + "errors" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" cmttypes "github.com/cometbft/cometbft/types" @@ -9,15 +11,12 @@ import ( var _ sdk.Msg = &MsgUpdateParams{} -// GetSigners returns the signer addresses that are expected to sign the result -// of GetSignBytes. -func (msg MsgUpdateParams) GetSigners() []sdk.AccAddress { - authority, _ := sdk.AccAddressFromBech32(msg.Authority) - return []sdk.AccAddress{authority} -} +func (msg MsgUpdateParams) ToProtoConsensusParams() (cmtproto.ConsensusParams, error) { + if msg.Evidence == nil || msg.Block == nil || msg.Validator == nil { + return cmtproto.ConsensusParams{}, errors.New("all parameters must be present") + } -func (msg MsgUpdateParams) ToProtoConsensusParams() cmtproto.ConsensusParams { - return cmtproto.ConsensusParams{ + cp := cmtproto.ConsensusParams{ Block: &cmtproto.BlockParams{ MaxBytes: msg.Block.MaxBytes, MaxGas: msg.Block.MaxGas, @@ -32,4 +31,12 @@ func (msg MsgUpdateParams) ToProtoConsensusParams() cmtproto.ConsensusParams { }, Version: cmttypes.DefaultConsensusParams().ToProto().Version, // Version is stored in x/upgrade } + + if msg.Abci != nil { + cp.Abci = &cmtproto.ABCIParams{ + VoteExtensionsEnableHeight: msg.Abci.VoteExtensionsEnableHeight, + } + } + + return cp, nil } diff --git a/x/consensus/types/query.pb.go b/x/consensus/types/query.pb.go index b6f6df03ec71..462e0b548160 100644 --- a/x/consensus/types/query.pb.go +++ b/x/consensus/types/query.pb.go @@ -155,7 +155,7 @@ 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 the parameters of x/consensus_param module. + // Params queries the parameters of x/consensus module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) } @@ -178,7 +178,7 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . // QueryServer is the server API for Query service. type QueryServer interface { - // Params queries the parameters of x/consensus_param module. + // Params queries the parameters of x/consensus module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) } @@ -212,6 +212,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.consensus.v1.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/consensus/types/tx.pb.go b/x/consensus/types/tx.pb.go index 48d8732859e9..f0f279292711 100644 --- a/x/consensus/types/tx.pb.go +++ b/x/consensus/types/tx.pb.go @@ -43,6 +43,8 @@ type MsgUpdateParams struct { Block *types.BlockParams `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` Evidence *types.EvidenceParams `protobuf:"bytes,3,opt,name=evidence,proto3" json:"evidence,omitempty"` Validator *types.ValidatorParams `protobuf:"bytes,4,opt,name=validator,proto3" json:"validator,omitempty"` + // Since: cosmos-sdk 0.50 + Abci *types.ABCIParams `protobuf:"bytes,5,opt,name=abci,proto3" json:"abci,omitempty"` } func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } @@ -106,6 +108,13 @@ func (m *MsgUpdateParams) GetValidator() *types.ValidatorParams { return nil } +func (m *MsgUpdateParams) GetAbci() *types.ABCIParams { + if m != nil { + return m.Abci + } + return nil +} + // MsgUpdateParamsResponse defines the response structure for executing a // MsgUpdateParams message. type MsgUpdateParamsResponse struct { @@ -152,32 +161,34 @@ func init() { func init() { proto.RegisterFile("cosmos/consensus/v1/tx.proto", fileDescriptor_2135c60575ab504d) } var fileDescriptor_2135c60575ab504d = []byte{ - // 399 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0xce, 0xcf, 0x2b, 0x4e, 0xcd, 0x2b, 0x2e, 0x2d, 0xd6, 0x2f, 0x33, 0xd4, - 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, 0xc8, 0xea, 0xc1, 0x65, 0xf5, - 0xca, 0x0c, 0xa5, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x9d, 0x94, 0x24, - 0x44, 0x5d, 0x3c, 0x98, 0xa7, 0x0f, 0xd5, 0x04, 0x91, 0x12, 0x87, 0x5a, 0x90, 0x5b, 0x9c, 0x0e, - 0x32, 0x3a, 0xb7, 0x38, 0x1d, 0x2a, 0x21, 0x5b, 0x92, 0x9a, 0x97, 0x92, 0x5a, 0x94, 0x9b, 0x99, - 0x57, 0xa2, 0x5f, 0x52, 0x59, 0x90, 0x5a, 0xac, 0x5f, 0x90, 0x58, 0x94, 0x98, 0x0b, 0xd5, 0xa7, - 0xb4, 0x83, 0x89, 0x8b, 0xdf, 0xb7, 0x38, 0x3d, 0xb4, 0x20, 0x25, 0xb1, 0x24, 0x35, 0x00, 0x2c, - 0x23, 0x64, 0xc6, 0xc5, 0x99, 0x58, 0x5a, 0x92, 0x91, 0x5f, 0x94, 0x59, 0x52, 0x29, 0xc1, 0xa8, - 0xc0, 0xa8, 0xc1, 0xe9, 0x24, 0x71, 0x69, 0x8b, 0xae, 0x08, 0xd4, 0x42, 0xc7, 0x94, 0x94, 0xa2, - 0xd4, 0xe2, 0xe2, 0xe0, 0x92, 0xa2, 0xcc, 0xbc, 0xf4, 0x20, 0x84, 0x52, 0x21, 0x63, 0x2e, 0xd6, - 0xa4, 0x9c, 0xfc, 0xe4, 0x6c, 0x09, 0x26, 0x05, 0x46, 0x0d, 0x6e, 0x23, 0x59, 0x3d, 0x84, 0xd5, - 0x7a, 0x60, 0xab, 0xf5, 0x9c, 0x40, 0xd2, 0x10, 0x5b, 0x82, 0x20, 0x6a, 0x85, 0x6c, 0xb8, 0x38, - 0x52, 0xcb, 0x32, 0x53, 0x52, 0xf3, 0x92, 0x53, 0x25, 0x98, 0xc1, 0xfa, 0x14, 0x30, 0xf5, 0xb9, - 0x42, 0x55, 0x40, 0xb5, 0xc2, 0x75, 0x08, 0xd9, 0x73, 0x71, 0x96, 0x25, 0xe6, 0x64, 0xa6, 0x24, - 0x96, 0xe4, 0x17, 0x49, 0xb0, 0x80, 0xb5, 0x2b, 0x62, 0x6a, 0x0f, 0x83, 0x29, 0x81, 0xea, 0x47, - 0xe8, 0xb1, 0xb2, 0x6c, 0x7a, 0xbe, 0x41, 0x0b, 0xe1, 0x87, 0xae, 0xe7, 0x1b, 0xb4, 0xd4, 0x20, - 0xfe, 0xd4, 0x2d, 0x4e, 0xc9, 0xd6, 0xaf, 0x40, 0x8a, 0x31, 0xb4, 0x60, 0x52, 0x92, 0xe4, 0x12, - 0x47, 0x13, 0x0a, 0x4a, 0x2d, 0x2e, 0x00, 0x29, 0x37, 0x2a, 0xe0, 0x62, 0xf6, 0x2d, 0x4e, 0x17, - 0x4a, 0xe2, 0xe2, 0x41, 0x09, 0x58, 0x15, 0x3d, 0x2c, 0x11, 0xad, 0x87, 0x66, 0x88, 0x94, 0x0e, - 0x31, 0xaa, 0x60, 0x56, 0x49, 0xb1, 0x36, 0x3c, 0xdf, 0xa0, 0xc5, 0xe8, 0xe4, 0x71, 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, 0x7a, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, - 0xc9, 0xf9, 0xb9, 0xfa, 0xf0, 0x54, 0x88, 0xd5, 0x83, 0xe0, 0xc0, 0x4a, 0x62, 0x03, 0x27, 0x0c, - 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x79, 0x2c, 0x44, 0x5c, 0xb3, 0x02, 0x00, 0x00, + // 421 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x4f, 0xcb, 0x12, 0x41, + 0x1c, 0xc7, 0x5d, 0xff, 0x44, 0x4e, 0x41, 0xb4, 0x05, 0xae, 0x8b, 0x2e, 0x26, 0x11, 0x22, 0x39, + 0x93, 0x0a, 0x41, 0x11, 0x84, 0x1b, 0x41, 0x1d, 0x84, 0x30, 0xea, 0xd0, 0x25, 0x66, 0x77, 0x87, + 0x75, 0xd0, 0xdd, 0x59, 0x76, 0xc6, 0x45, 0x6f, 0xd1, 0xb1, 0x53, 0x2f, 0xc5, 0x43, 0x2f, 0xa2, + 0xa3, 0x74, 0xea, 0xf8, 0xa0, 0x07, 0xe1, 0x79, 0x15, 0x0f, 0xce, 0x8e, 0xee, 0xf3, 0xa8, 0x87, + 0xe7, 0x22, 0xb8, 0xdf, 0xcf, 0x67, 0xbe, 0xcc, 0x6f, 0x7e, 0xa0, 0xe6, 0x32, 0x1e, 0x30, 0x8e, + 0x5c, 0x16, 0x72, 0x12, 0xf2, 0x19, 0x47, 0x49, 0x17, 0x89, 0x39, 0x8c, 0x62, 0x26, 0x98, 0xfe, + 0x28, 0x4d, 0xe1, 0x21, 0x85, 0x49, 0xd7, 0x7c, 0x88, 0x03, 0x1a, 0x32, 0x24, 0x7f, 0x53, 0xce, + 0xac, 0xa6, 0xdc, 0x77, 0xf9, 0x0f, 0x29, 0x29, 0x8d, 0x2a, 0xaa, 0x20, 0xe0, 0xfe, 0xee, 0xe8, + 0x80, 0xfb, 0x2a, 0xa8, 0x0b, 0x12, 0x7a, 0x24, 0x0e, 0x68, 0x28, 0x90, 0x58, 0x44, 0x84, 0xa3, + 0x08, 0xc7, 0x38, 0x50, 0x5e, 0xf3, 0x32, 0x0f, 0x1e, 0x0c, 0xb9, 0xff, 0x25, 0xf2, 0xb0, 0x20, + 0x9f, 0x64, 0xa2, 0xbf, 0x04, 0x65, 0x3c, 0x13, 0x63, 0x16, 0x53, 0xb1, 0x30, 0xb4, 0x86, 0xd6, + 0x2a, 0xdb, 0xc6, 0xbf, 0x3f, 0x9d, 0xc7, 0xaa, 0x70, 0xe0, 0x79, 0x31, 0xe1, 0xfc, 0xb3, 0x88, + 0x69, 0xe8, 0x8f, 0x32, 0x54, 0xef, 0x83, 0x92, 0x33, 0x65, 0xee, 0xc4, 0xc8, 0x37, 0xb4, 0xd6, + 0xbd, 0x5e, 0x1d, 0x66, 0xd5, 0x50, 0x56, 0x43, 0x7b, 0x17, 0xa7, 0x2d, 0xa3, 0x94, 0xd5, 0xdf, + 0x80, 0xbb, 0x24, 0xa1, 0x1e, 0x09, 0x5d, 0x62, 0x14, 0xa4, 0xd7, 0x38, 0xf5, 0xde, 0x2b, 0x42, + 0xa9, 0x07, 0x43, 0x7f, 0x0b, 0xca, 0x09, 0x9e, 0x52, 0x0f, 0x0b, 0x16, 0x1b, 0x45, 0xa9, 0x3f, + 0x39, 0xd5, 0xbf, 0xee, 0x11, 0xe5, 0x67, 0x8e, 0xfe, 0x02, 0x14, 0xb1, 0xe3, 0x52, 0xa3, 0x24, + 0xdd, 0xda, 0xa9, 0x3b, 0xb0, 0xdf, 0x7d, 0x54, 0x9a, 0x24, 0x5f, 0xbf, 0xfa, 0xb9, 0x5d, 0xb6, + 0xb3, 0x5b, 0xff, 0xda, 0x2e, 0xdb, 0xcf, 0xd2, 0xc9, 0x74, 0xb8, 0x37, 0x41, 0xf3, 0x6b, 0x6f, + 0x7c, 0x34, 0xd8, 0x66, 0x15, 0x54, 0x8e, 0x3e, 0x8d, 0x08, 0x8f, 0x76, 0x78, 0x2f, 0x02, 0x85, + 0x21, 0xf7, 0x75, 0x07, 0xdc, 0xbf, 0xf1, 0x14, 0x4f, 0xe1, 0x99, 0xd5, 0x80, 0x47, 0x87, 0x98, + 0xcf, 0x6f, 0x43, 0xed, 0xab, 0xcc, 0xd2, 0x8f, 0xed, 0xb2, 0xad, 0xd9, 0x1f, 0xfe, 0xae, 0x2d, + 0x6d, 0xb5, 0xb6, 0xb4, 0x8b, 0xb5, 0xa5, 0xfd, 0xde, 0x58, 0xb9, 0xd5, 0xc6, 0xca, 0xfd, 0xdf, + 0x58, 0xb9, 0x6f, 0xd0, 0xa7, 0x62, 0x3c, 0x73, 0xa0, 0xcb, 0x02, 0x74, 0xd8, 0xdb, 0xb3, 0x17, + 0x94, 0x23, 0x72, 0xee, 0xc8, 0x55, 0xea, 0x5f, 0x05, 0x00, 0x00, 0xff, 0xff, 0xd1, 0x27, 0xbf, + 0x79, 0xe5, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -192,7 +203,7 @@ 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 MsgClient interface { - // UpdateParams defines a governance operation for updating the x/consensus_param module parameters. + // UpdateParams defines a governance operation for updating the x/consensus module parameters. // The authority is defined in the keeper. // // Since: cosmos-sdk 0.47 @@ -218,7 +229,7 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts // MsgServer is the server API for Msg service. type MsgServer interface { - // UpdateParams defines a governance operation for updating the x/consensus_param module parameters. + // UpdateParams defines a governance operation for updating the x/consensus module parameters. // The authority is defined in the keeper. // // Since: cosmos-sdk 0.47 @@ -255,6 +266,7 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.consensus.v1.Msg", HandlerType: (*MsgServer)(nil), @@ -288,6 +300,18 @@ func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Abci != nil { + { + size, err := m.Abci.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } if m.Validator != nil { { size, err := m.Validator.MarshalToSizedBuffer(dAtA[:i]) @@ -390,6 +414,10 @@ func (m *MsgUpdateParams) Size() (n int) { l = m.Validator.Size() n += 1 + l + sovTx(uint64(l)) } + if m.Abci != nil { + l = m.Abci.Size() + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -577,6 +605,42 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Abci", 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.Abci == nil { + m.Abci = &types.ABCIParams{} + } + if err := m.Abci.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) diff --git a/x/crisis/README.md b/x/crisis/README.md index e4e29d0a12a2..b75a5ab6b0ad 100644 --- a/x/crisis/README.md +++ b/x/crisis/README.md @@ -4,6 +4,8 @@ sidebar_position: 1 # `x/crisis` +NOTE: `x/crisis` is deprecated as of Cosmos SDK v0.53 and will be removed in the next release. + ## Overview The crisis module halts the blockchain under the circumstance that a blockchain diff --git a/x/crisis/abci.go b/x/crisis/abci.go index 8ce275ecd799..2eacc641c4ad 100644 --- a/x/crisis/abci.go +++ b/x/crisis/abci.go @@ -2,7 +2,6 @@ package crisis import ( "context" - "time" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" @@ -12,7 +11,7 @@ import ( // check all registered invariants func EndBlocker(ctx context.Context, k keeper.Keeper) { - defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyEndBlocker) + defer telemetry.ModuleMeasureSince(types.ModuleName, telemetry.Now(), telemetry.MetricKeyEndBlocker) sdkCtx := sdk.UnwrapSDKContext(ctx) if k.InvCheckPeriod() == 0 || sdkCtx.BlockHeight()%int64(k.InvCheckPeriod()) != 0 { diff --git a/x/crisis/autocli.go b/x/crisis/autocli.go new file mode 100644 index 000000000000..92edd95d0cd8 --- /dev/null +++ b/x/crisis/autocli.go @@ -0,0 +1,30 @@ +package crisis + +import ( + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + crisisv1beta1 "cosmossdk.io/api/cosmos/crisis/v1beta1" +) + +// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. +func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { + return &autocliv1.ModuleOptions{ + Tx: &autocliv1.ServiceCommandDescriptor{ + Service: crisisv1beta1.Msg_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "VerifyInvariant", + Use: "invariant-broken [module-name] [invariant-route] --from mykey", + Short: "Submit proof that an invariant broken", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "invariant_module_name"}, + {ProtoField: "invariant_route"}, + }, + }, + { + RpcMethod: "UpdateParams", + Skip: true, // Skipped because UpdateParams is authority gated + }, + }, + }, + } +} diff --git a/x/crisis/client/cli/tx.go b/x/crisis/client/cli/tx.go deleted file mode 100644 index 50b7e16a34b8..000000000000 --- a/x/crisis/client/cli/tx.go +++ /dev/null @@ -1,60 +0,0 @@ -package cli - -import ( - "errors" - - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/cosmos/cosmos-sdk/x/crisis/types" -) - -// NewTxCmd returns a root CLI command handler for all x/crisis transaction commands. -func NewTxCmd() *cobra.Command { - txCmd := &cobra.Command{ - Use: types.ModuleName, - Short: "Crisis transactions subcommands", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - txCmd.AddCommand(NewMsgVerifyInvariantTxCmd()) - - return txCmd -} - -// NewMsgVerifyInvariantTxCmd returns a CLI command handler for creating a -// MsgVerifyInvariant transaction. -func NewMsgVerifyInvariantTxCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "invariant-broken [module-name] [invariant-route]", - Short: "Submit proof that an invariant broken to halt the chain", - Args: cobra.ExactArgs(2), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - moduleName, route := args[0], args[1] - if moduleName == "" { - return errors.New("invalid module name") - } - if route == "" { - return errors.New("invalid invariant route") - } - - senderAddr := clientCtx.GetFromAddress() - - msg := types.NewMsgVerifyInvariant(senderAddr, moduleName, route) - - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} diff --git a/x/crisis/client/cli/tx_test.go b/x/crisis/client/cli/tx_test.go deleted file mode 100644 index d62bc1c977ed..000000000000 --- a/x/crisis/client/cli/tx_test.go +++ /dev/null @@ -1,98 +0,0 @@ -package cli_test - -import ( - "context" - "fmt" - "io" - "testing" - - sdkmath "cosmossdk.io/math" - rpcclientmock "github.com/cometbft/cometbft/rpc/client/mock" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - "github.com/stretchr/testify/require" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/crypto/keyring" - svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" - "github.com/cosmos/cosmos-sdk/testutil" - sdk "github.com/cosmos/cosmos-sdk/types" - testutilmod "github.com/cosmos/cosmos-sdk/types/module/testutil" - "github.com/cosmos/cosmos-sdk/x/crisis" - "github.com/cosmos/cosmos-sdk/x/crisis/client/cli" -) - -func TestNewMsgVerifyInvariantTxCmd(t *testing.T) { - encCfg := testutilmod.MakeTestEncodingConfig(crisis.AppModuleBasic{}) - kr := keyring.NewInMemory(encCfg.Codec) - baseCtx := client.Context{}. - WithKeyring(kr). - WithTxConfig(encCfg.TxConfig). - WithCodec(encCfg.Codec). - WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}). - WithAccountRetriever(client.MockAccountRetriever{}). - WithOutput(io.Discard). - WithChainID("test-chain") - - accounts := testutil.CreateKeyringAccounts(t, kr, 1) - testCases := []struct { - name string - args []string - expectErrMsg string - }{ - { - "missing module", - []string{ - "", "total-supply", - fmt.Sprintf("--%s=%s", flags.FlagFrom, accounts[0].Address.String()), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(10))).String()), - }, - "invalid module name", - }, - { - "missing invariant route", - []string{ - "bank", "", - fmt.Sprintf("--%s=%s", flags.FlagFrom, accounts[0].Address.String()), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(10))).String()), - }, - "invalid invariant route", - }, - { - "valid transaction", - []string{ - "bank", "total-supply", - fmt.Sprintf("--%s=%s", flags.FlagFrom, accounts[0].Address.String()), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(10))).String()), - }, - "", - }, - } - - for _, tc := range testCases { - tc := tc - t.Run(tc.name, func(t *testing.T) { - ctx := svrcmd.CreateExecuteContext(context.Background()) - cmd := cli.NewMsgVerifyInvariantTxCmd() - cmd.SetContext(ctx) - cmd.SetArgs(tc.args) - require.NoError(t, client.SetCmdClientContextHandler(baseCtx, cmd)) - - out, err := clitestutil.ExecTestCLICmd(baseCtx, cmd, tc.args) - if tc.expectErrMsg != "" { - require.Error(t, err) - require.Contains(t, out.String(), tc.expectErrMsg) - } else { - require.NoError(t, err) - msg := &sdk.TxResponse{} - require.NoError(t, baseCtx.Codec.UnmarshalJSON(out.Bytes(), msg), out.String()) - } - }) - } -} diff --git a/x/crisis/keeper/genesis_test.go b/x/crisis/keeper/genesis_test.go index f97ab21f1bd9..cf1e86b6ba0f 100644 --- a/x/crisis/keeper/genesis_test.go +++ b/x/crisis/keeper/genesis_test.go @@ -3,8 +3,8 @@ package keeper_test import ( "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" + "go.uber.org/mock/gomock" sdkmath "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" diff --git a/x/crisis/keeper/keeper.go b/x/crisis/keeper/keeper.go index 6c8e24ae9940..ea7239881f1b 100644 --- a/x/crisis/keeper/keeper.go +++ b/x/crisis/keeper/keeper.go @@ -7,9 +7,8 @@ import ( "cosmossdk.io/collections" "cosmossdk.io/core/address" - "cosmossdk.io/log" - storetypes "cosmossdk.io/core/store" + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" @@ -17,6 +16,8 @@ import ( ) // Keeper - crisis keeper +// +// Deprecated: the crisis keeper is deprecated and will be removed in the next Cosmos SDK major release. type Keeper struct { routes []types.InvarRoute invCheckPeriod uint @@ -38,6 +39,8 @@ type Keeper struct { } // NewKeeper creates a new Keeper object +// +// Deprecated: the crisis keeper is deprecated and will be removed in the next Cosmos SDK major release. func NewKeeper( cdc codec.BinaryCodec, storeService storetypes.KVStoreService, invCheckPeriod uint, supplyKeeper types.SupplyKeeper, feeCollectorName, authority string, ac address.Codec, diff --git a/x/crisis/keeper/keeper_test.go b/x/crisis/keeper/keeper_test.go index d958ef52af7b..ad7ddbbc9cd1 100644 --- a/x/crisis/keeper/keeper_test.go +++ b/x/crisis/keeper/keeper_test.go @@ -3,8 +3,8 @@ package keeper_test import ( "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" storetypes "cosmossdk.io/store/types" diff --git a/x/crisis/keeper/msg_server.go b/x/crisis/keeper/msg_server.go index f68c32771b01..789306937375 100644 --- a/x/crisis/keeper/msg_server.go +++ b/x/crisis/keeper/msg_server.go @@ -89,8 +89,7 @@ func (k *Keeper) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams) ( return nil, errors.Wrap(sdkerrors.ErrInvalidCoins, "negative constant fee") } - sdkCtx := sdk.UnwrapSDKContext(ctx) - if err := k.ConstantFee.Set(sdkCtx, msg.ConstantFee); err != nil { + if err := k.ConstantFee.Set(ctx, msg.ConstantFee); err != nil { return nil, err } diff --git a/x/crisis/keeper/msg_server_test.go b/x/crisis/keeper/msg_server_test.go index e097939f6c43..c3bc9ab40d58 100644 --- a/x/crisis/keeper/msg_server_test.go +++ b/x/crisis/keeper/msg_server_test.go @@ -3,8 +3,8 @@ package keeper_test import ( "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" + "go.uber.org/mock/gomock" sdkmath "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" @@ -47,7 +47,7 @@ func (s *KeeperTestSuite) SetupTest() { func (s *KeeperTestSuite) TestMsgVerifyInvariant() { // default params - constantFee := sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(1000)) + constantFee := sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(1000)) err := s.keeper.ConstantFee.Set(s.ctx, constantFee) s.Require().NoError(err) @@ -123,7 +123,7 @@ func (s *KeeperTestSuite) TestMsgVerifyInvariant() { func (s *KeeperTestSuite) TestMsgUpdateParams() { // default params - constantFee := sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(1000)) + constantFee := sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(1000)) testCases := []struct { name string diff --git a/x/crisis/module.go b/x/crisis/module.go index a7e0147a4227..ebde02cfd332 100644 --- a/x/crisis/module.go +++ b/x/crisis/module.go @@ -4,9 +4,7 @@ import ( "context" "encoding/json" "fmt" - "time" - abci "github.com/cometbft/cometbft/abci/types" gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cast" "github.com/spf13/cobra" @@ -22,11 +20,9 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/server" servertypes "github.com/cosmos/cosmos-sdk/server/types" - "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/cosmos/cosmos-sdk/x/crisis/client/cli" "github.com/cosmos/cosmos-sdk/x/crisis/exported" "github.com/cosmos/cosmos-sdk/x/crisis/keeper" "github.com/cosmos/cosmos-sdk/x/crisis/types" @@ -36,10 +32,19 @@ import ( // ConsensusVersion defines the current x/crisis module consensus version. const ConsensusVersion = 2 -var _ module.AppModuleBasic = AppModuleBasic{} +var ( + _ module.AppModuleBasic = AppModule{} + _ module.HasGenesis = AppModule{} + _ module.HasServices = AppModule{} + + _ appmodule.AppModule = AppModule{} + _ appmodule.HasEndBlocker = AppModule{} +) // Module init related flags const ( + // Deprecated: this flag is no longer used and will be removed along with x/crisis in the next major + // Cosmos SDK release. FlagSkipGenesisInvariants = "x-crisis-skip-assert-invariants" ) @@ -75,14 +80,6 @@ func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncod // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the crisis module. func (AppModuleBasic) RegisterGRPCGatewayRoutes(_ client.Context, _ *gwruntime.ServeMux) {} -// GetTxCmd returns the root tx command for the crisis module. -func (b AppModuleBasic) GetTxCmd() *cobra.Command { - return cli.NewTxCmd() -} - -// GetQueryCmd returns no root query command for the crisis module. -func (AppModuleBasic) GetQueryCmd() *cobra.Command { return nil } - // RegisterInterfaces registers interfaces and implementations of the crisis // module. func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { @@ -90,6 +87,8 @@ func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) } // AppModule implements an application module for the crisis module. +// +// Deprecated: the crisis module is deprecated and will be removed in the next Cosmos SDK major release. type AppModule struct { AppModuleBasic @@ -108,6 +107,8 @@ type AppModule struct { // we will call keeper.AssertInvariants during InitGenesis (it may take a significant time) // - which doesn't impact the chain security unless 66+% of validators have a wrongly // modified genesis file. +// +// Deprecated: the crisis module is deprecated and will be removed in the next Cosmos SDK major release. func NewAppModule(keeper *keeper.Keeper, skipGenesisInvariants bool, ss exported.Subspace) AppModule { return AppModule{ AppModuleBasic: AppModuleBasic{}, @@ -118,11 +119,6 @@ func NewAppModule(keeper *keeper.Keeper, skipGenesisInvariants bool, ss exported } } -var ( - _ appmodule.AppModule = AppModule{} - _ appmodule.HasEndBlocker = AppModule{} -) - // IsOnePerModuleType implements the depinject.OnePerModuleType interface. func (am AppModule) IsOnePerModuleType() {} @@ -130,15 +126,12 @@ func (am AppModule) IsOnePerModuleType() {} func (am AppModule) IsAppModule() {} // AddModuleInitFlags implements servertypes.ModuleInitFlags interface. +// +// Deprecated: this flag is deprecated and will be removed in the next major Cosmos SDK release. func AddModuleInitFlags(startCmd *cobra.Command) { startCmd.Flags().Bool(FlagSkipGenesisInvariants, false, "Skip x/crisis invariants check on startup") } -// Name returns the crisis module's name. -func (AppModule) Name() string { - return types.ModuleName -} - // RegisterServices registers module services. func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterMsgServer(cfg.MsgServer(), am.keeper) @@ -151,17 +144,14 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { // InitGenesis performs genesis initialization for the crisis module. It returns // no validator updates. -func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate { - start := time.Now() +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) { var genesisState types.GenesisState cdc.MustUnmarshalJSON(data, &genesisState) - telemetry.MeasureSince(start, "InitGenesis", "crisis", "unmarshal") am.keeper.InitGenesis(ctx, &genesisState) if !am.skipGenesisInvariants { am.keeper.AssertInvariants(ctx) } - return []abci.ValidatorUpdate{} } // ExportGenesis returns the exported genesis state as raw bytes for the crisis diff --git a/x/crisis/testutil/expected_keepers_mocks.go b/x/crisis/testutil/expected_keepers_mocks.go index 663ab4074a6e..0ea07eacfa4c 100644 --- a/x/crisis/testutil/expected_keepers_mocks.go +++ b/x/crisis/testutil/expected_keepers_mocks.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: x/crisis/types/expected_keepers.go +// +// Generated by this command: +// +// mockgen -source=x/crisis/types/expected_keepers.go -package testutil -destination x/crisis/testutil/expected_keepers_mocks.go +// // Package testutil is a generated GoMock package. package testutil @@ -9,13 +14,14 @@ import ( reflect "reflect" types "github.com/cosmos/cosmos-sdk/types" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockSupplyKeeper is a mock of SupplyKeeper interface. type MockSupplyKeeper struct { ctrl *gomock.Controller recorder *MockSupplyKeeperMockRecorder + isgomock struct{} } // MockSupplyKeeperMockRecorder is the mock recorder for MockSupplyKeeper. @@ -44,7 +50,7 @@ func (m *MockSupplyKeeper) SendCoinsFromAccountToModule(ctx context.Context, sen } // SendCoinsFromAccountToModule indicates an expected call of SendCoinsFromAccountToModule. -func (mr *MockSupplyKeeperMockRecorder) SendCoinsFromAccountToModule(ctx, senderAddr, recipientModule, amt interface{}) *gomock.Call { +func (mr *MockSupplyKeeperMockRecorder) SendCoinsFromAccountToModule(ctx, senderAddr, recipientModule, amt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromAccountToModule", reflect.TypeOf((*MockSupplyKeeper)(nil).SendCoinsFromAccountToModule), ctx, senderAddr, recipientModule, amt) } diff --git a/x/crisis/types/msgs.go b/x/crisis/types/msgs.go index 9d2e3c7350ae..b62eaaf023a0 100644 --- a/x/crisis/types/msgs.go +++ b/x/crisis/types/msgs.go @@ -18,20 +18,7 @@ func NewMsgVerifyInvariant(sender sdk.AccAddress, invModeName, invRoute string) } } -// get the bytes for the message signer to sign on -func (msg MsgVerifyInvariant) GetSigners() []sdk.AccAddress { - sender, _ := sdk.AccAddressFromBech32(msg.Sender) - return []sdk.AccAddress{sender} -} - // FullInvariantRoute - get the messages full invariant route func (msg MsgVerifyInvariant) FullInvariantRoute() string { return msg.InvariantModuleName + "/" + msg.InvariantRoute } - -// GetSigners returns the signer addresses that are expected to sign the result -// of GetSignBytes. -func (msg MsgUpdateParams) GetSigners() []sdk.AccAddress { - authority, _ := sdk.AccAddressFromBech32(msg.Authority) - return []sdk.AccAddress{authority} -} diff --git a/x/crisis/types/tx.pb.go b/x/crisis/types/tx.pb.go index 96458da2529e..6bac94d73695 100644 --- a/x/crisis/types/tx.pb.go +++ b/x/crisis/types/tx.pb.go @@ -363,6 +363,7 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.crisis.v1beta1.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/distribution/README.md b/x/distribution/README.md index bd7153218291..32858fd696db 100644 --- a/x/distribution/README.md +++ b/x/distribution/README.md @@ -352,15 +352,22 @@ The transaction fails if the amount cannot be transferred from the sender to the ```go func (k Keeper) FundCommunityPool(ctx context.Context, amount sdk.Coins, sender sdk.AccAddress) error { - if err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, sender, types.ModuleName, amount); err != nil { - return err - } + if err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, sender, types.ModuleName, amount); err != nil { + return err + } - feePool := k.GetFeePool(ctx) - feePool.CommunityPool = feePool.CommunityPool.Add(sdk.NewDecCoinsFromCoins(amount...)...) - k.SetFeePool(ctx, feePool) + feePool, err := k.FeePool.Get(ctx) + if err != nil { + return err + } + + feePool.CommunityPool = feePool.CommunityPool.Add(sdk.NewDecCoinsFromCoins(amount...)...) + + if err := k.FeePool.Set(ctx, feePool); err != nil { + return err + } - return nil + return nil } ``` diff --git a/x/distribution/abci.go b/x/distribution/abci.go index 415adcc5715c..70fdb7eeb270 100644 --- a/x/distribution/abci.go +++ b/x/distribution/abci.go @@ -1,8 +1,6 @@ package distribution import ( - "time" - "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/distribution/keeper" @@ -12,7 +10,7 @@ import ( // BeginBlocker sets the proposer for determining distribution during endblock // and distribute rewards for the previous block. func BeginBlocker(ctx sdk.Context, k keeper.Keeper) error { - defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) + defer telemetry.ModuleMeasureSince(types.ModuleName, telemetry.Now(), telemetry.MetricKeyBeginBlocker) // determine the total power signing the block var previousTotalPower int64 @@ -23,11 +21,12 @@ func BeginBlocker(ctx sdk.Context, k keeper.Keeper) error { // TODO this is Tendermint-dependent // ref https://github.com/cosmos/cosmos-sdk/issues/3095 if ctx.BlockHeight() > 1 { - k.AllocateTokens(ctx, previousTotalPower, ctx.VoteInfos()) + if err := k.AllocateTokens(ctx, previousTotalPower, ctx.VoteInfos()); err != nil { + return err + } } // record the proposer for when we payout on the next block consAddr := sdk.ConsAddress(ctx.BlockHeader().ProposerAddress) - k.SetPreviousProposerConsAddr(ctx, consAddr) - return nil + return k.SetPreviousProposerConsAddr(ctx, consAddr) } diff --git a/x/distribution/autocli.go b/x/distribution/autocli.go new file mode 100644 index 000000000000..a8c6c4041b0d --- /dev/null +++ b/x/distribution/autocli.go @@ -0,0 +1,149 @@ +package distribution + +import ( + "fmt" + + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + distirbuitonv1beta1 "cosmossdk.io/api/cosmos/distribution/v1beta1" + + "github.com/cosmos/cosmos-sdk/version" +) + +// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. +func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { + return &autocliv1.ModuleOptions{ + Query: &autocliv1.ServiceCommandDescriptor{ + Service: distirbuitonv1beta1.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Params", + Use: "params", + Short: "Query the current distribution parameters.", + }, + { + RpcMethod: "ValidatorDistributionInfo", + Use: "validator-distribution-info [validator]", + Short: "Query validator distribution info", + Example: fmt.Sprintf(`Example: $ %s query distribution validator-distribution-info [validator-address]`, version.AppName), + + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "validator_address"}, + }, + }, + { + RpcMethod: "ValidatorOutstandingRewards", + Use: "validator-outstanding-rewards [validator]", + Short: "Query distribution outstanding (un-withdrawn) rewards for a validator and all their delegations", + Example: fmt.Sprintf(`$ %s query distribution validator-outstanding-rewards [validator-address]`, version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "validator_address"}, + }, + }, + { + RpcMethod: "ValidatorCommission", + Use: "commission [validator]", + Short: "Query distribution validator commission", + Example: fmt.Sprintf(`$ %s query distribution commission [validator-address]`, version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "validator_address"}, + }, + }, + { + RpcMethod: "ValidatorSlashes", + Use: "slashes [validator] [start-height] [end-height]", + Short: "Query distribution validator slashes", + Example: fmt.Sprintf(`$ %s query distribution slashes [validator-address] 0 100`, version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "validator_address"}, + {ProtoField: "starting_height"}, + {ProtoField: "ending_height"}, + }, + }, + { + RpcMethod: "DelegationRewards", + Use: "rewards-by-validator [delegator-addr] [validator-addr]", + Short: "Query all distribution delegator from a particular validator", + Example: fmt.Sprintf("$ %s query distribution rewards [delegator-address] [validator-address]", version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "delegator_address"}, + {ProtoField: "validator_address"}, + }, + }, + { + RpcMethod: "DelegationTotalRewards", + Use: "rewards [delegator-addr]", + Short: "Query all distribution delegator rewards", + Long: "Query all rewards earned by a delegator", + Example: fmt.Sprintf("$ %s query distribution rewards [delegator-address]", version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "delegator_address"}, + }, + }, + { + RpcMethod: "CommunityPool", + Use: "community-pool", + Short: "Query the amount of coins in the community pool", + Example: fmt.Sprintf(`$ %s query distribution community-pool`, version.AppName), + }, + }, + }, + Tx: &autocliv1.ServiceCommandDescriptor{ + Service: distirbuitonv1beta1.Msg_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "SetWithdrawAddress", + Use: "set-withdraw-addr [withdraw-addr]", + Short: "Change the default withdraw address for rewards associated with an address", + Example: fmt.Sprintf("%s tx distribution set-withdraw-addr cosmos1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p --from mykey", version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "withdraw_address"}, + }, + }, + { + RpcMethod: "WithdrawDelegatorReward", + Use: "withdraw-rewards [validator-addr]", + Short: "Withdraw rewards from a given delegation address", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "validator_address"}, + }, + }, + { + RpcMethod: "WithdrawValidatorCommission", + Use: "withdraw-validator-commission [validator-addr]", + Short: "Withdraw commissions from a validator address (must be a validator operator)", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "validator_address"}, + }, + }, + { + RpcMethod: "DepositValidatorRewardsPool", + Use: "fund-validator-rewards-pool [validator-addr] [amount]", + Short: "Fund the validator rewards pool with the specified amount", + Example: fmt.Sprintf("%s tx distribution fund-validator-rewards-pool cosmosvaloper1x20lytyf6zkcrv5edpkfkn8sz578qg5sqfyqnp 100uatom --from mykey", version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "validator_address"}, + {ProtoField: "amount", Varargs: true}, + }, + }, + { + RpcMethod: "FundCommunityPool", + Use: "fund-community-pool [amount]", + Short: "Funds the community pool with the specified amount", + Example: fmt.Sprintf(`$ %s tx distribution fund-community-pool 100uatom --from mykey`, version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "amount", Varargs: true}, + }, + }, + { + RpcMethod: "UpdateParams", + Skip: true, // skipped because authority gated + }, + { + RpcMethod: "CommunityPoolSpend", + Skip: true, // skipped because authority gated + }, + }, + EnhanceCustomCommand: false, // use custom commands only until v0.51 + }, + } +} diff --git a/x/distribution/client/cli/query.go b/x/distribution/client/cli/query.go deleted file mode 100644 index 5999fee397cd..000000000000 --- a/x/distribution/client/cli/query.go +++ /dev/null @@ -1,367 +0,0 @@ -package cli - -import ( - "fmt" - "strconv" - "strings" - - "cosmossdk.io/core/address" - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/version" - "github.com/cosmos/cosmos-sdk/x/distribution/types" -) - -// GetQueryCmd returns the cli query commands for this module -func GetQueryCmd(ac address.Codec) *cobra.Command { - distQueryCmd := &cobra.Command{ - Use: types.ModuleName, - Short: "Querying commands for the distribution module", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - distQueryCmd.AddCommand( - GetCmdQueryParams(), - GetCmdQueryValidatorDistributionInfo(), - GetCmdQueryValidatorOutstandingRewards(), - GetCmdQueryValidatorCommission(), - GetCmdQueryValidatorSlashes(), - GetCmdQueryDelegatorRewards(ac), - GetCmdQueryCommunityPool(), - ) - - return distQueryCmd -} - -// GetCmdQueryParams implements the query params command. -func GetCmdQueryParams() *cobra.Command { - cmd := &cobra.Command{ - Use: "params", - Args: cobra.NoArgs, - Short: "Query distribution params", - RunE: func(cmd *cobra.Command, _ []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - res, err := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{}) - if err != nil { - return err - } - - return clientCtx.PrintProto(&res.Params) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - return cmd -} - -// GetCmdQueryValidatorDistributionInfo implements the query validator distribution info command. -func GetCmdQueryValidatorDistributionInfo() *cobra.Command { - bech32PrefixValAddr := sdk.GetConfig().GetBech32ValidatorAddrPrefix() - - cmd := &cobra.Command{ - Use: "validator-distribution-info [validator]", - Args: cobra.ExactArgs(1), - Short: "Query validator distribution info", - Long: strings.TrimSpace( - fmt.Sprintf(`Query validator distribution info. -Example: -$ %s query distribution validator-distribution-info %s1lwjmdnks33xwnmfayc64ycprww49n33mtm92ne -`, - version.AppName, bech32PrefixValAddr, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - validatorAddr, err := sdk.ValAddressFromBech32(args[0]) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - res, err := queryClient.ValidatorDistributionInfo(cmd.Context(), &types.QueryValidatorDistributionInfoRequest{ - ValidatorAddress: validatorAddr.String(), - }) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - return cmd -} - -// GetCmdQueryValidatorOutstandingRewards implements the query validator -// outstanding rewards command. -func GetCmdQueryValidatorOutstandingRewards() *cobra.Command { - bech32PrefixValAddr := sdk.GetConfig().GetBech32ValidatorAddrPrefix() - - cmd := &cobra.Command{ - Use: "validator-outstanding-rewards [validator]", - Args: cobra.ExactArgs(1), - Short: "Query distribution outstanding (un-withdrawn) rewards for a validator and all their delegations", - Long: strings.TrimSpace( - fmt.Sprintf(`Query distribution outstanding (un-withdrawn) rewards for a validator and all their delegations. - -Example: -$ %s query distribution validator-outstanding-rewards %s1lwjmdnks33xwnmfayc64ycprww49n33mtm92ne -`, - version.AppName, bech32PrefixValAddr, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - validatorAddr, err := sdk.ValAddressFromBech32(args[0]) - if err != nil { - return err - } - - res, err := queryClient.ValidatorOutstandingRewards( - cmd.Context(), - &types.QueryValidatorOutstandingRewardsRequest{ValidatorAddress: validatorAddr.String()}, - ) - if err != nil { - return err - } - - return clientCtx.PrintProto(&res.Rewards) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - return cmd -} - -// GetCmdQueryValidatorCommission implements the query validator commission command. -func GetCmdQueryValidatorCommission() *cobra.Command { - bech32PrefixValAddr := sdk.GetConfig().GetBech32ValidatorAddrPrefix() - - cmd := &cobra.Command{ - Use: "commission [validator]", - Args: cobra.ExactArgs(1), - Short: "Query distribution validator commission", - Long: strings.TrimSpace( - fmt.Sprintf(`Query validator commission rewards from delegators to that validator. - -Example: -$ %s query distribution commission %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj -`, - version.AppName, bech32PrefixValAddr, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - validatorAddr, err := sdk.ValAddressFromBech32(args[0]) - if err != nil { - return err - } - - res, err := queryClient.ValidatorCommission( - cmd.Context(), - &types.QueryValidatorCommissionRequest{ValidatorAddress: validatorAddr.String()}, - ) - if err != nil { - return err - } - - return clientCtx.PrintProto(&res.Commission) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - return cmd -} - -// GetCmdQueryValidatorSlashes implements the query validator slashes command. -func GetCmdQueryValidatorSlashes() *cobra.Command { - bech32PrefixValAddr := sdk.GetConfig().GetBech32ValidatorAddrPrefix() - - cmd := &cobra.Command{ - Use: "slashes [validator] [start-height] [end-height]", - Args: cobra.ExactArgs(3), - Short: "Query distribution validator slashes", - Long: strings.TrimSpace( - fmt.Sprintf(`Query all slashes of a validator for a given block range. - -Example: -$ %s query distribution slashes %svaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj 0 100 -`, - version.AppName, bech32PrefixValAddr, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - validatorAddr, err := sdk.ValAddressFromBech32(args[0]) - if err != nil { - return err - } - - startHeight, err := strconv.ParseUint(args[1], 10, 64) - if err != nil { - return fmt.Errorf("start-height %s not a valid uint, please input a valid start-height", args[1]) - } - - endHeight, err := strconv.ParseUint(args[2], 10, 64) - if err != nil { - return fmt.Errorf("end-height %s not a valid uint, please input a valid end-height", args[2]) - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - res, err := queryClient.ValidatorSlashes( - cmd.Context(), - &types.QueryValidatorSlashesRequest{ - ValidatorAddress: validatorAddr.String(), - StartingHeight: startHeight, - EndingHeight: endHeight, - Pagination: pageReq, - }, - ) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "validator slashes") - return cmd -} - -// GetCmdQueryDelegatorRewards implements the query delegator rewards command. -func GetCmdQueryDelegatorRewards(ac address.Codec) *cobra.Command { - bech32PrefixAccAddr := sdk.GetConfig().GetBech32AccountAddrPrefix() - bech32PrefixValAddr := sdk.GetConfig().GetBech32ValidatorAddrPrefix() - - cmd := &cobra.Command{ - Use: "rewards [delegator-addr] [validator-addr]", - Args: cobra.RangeArgs(1, 2), - Short: "Query all distribution delegator rewards or rewards from a particular validator", - Long: strings.TrimSpace( - fmt.Sprintf(`Query all rewards earned by a delegator, optionally restrict to rewards from a single validator. - -Example: -$ %s query distribution rewards %s1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p -$ %s query distribution rewards %s1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj -`, - version.AppName, bech32PrefixAccAddr, version.AppName, bech32PrefixAccAddr, bech32PrefixValAddr, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - _, err = ac.StringToBytes(args[0]) - if err != nil { - return err - } - - // query for rewards from a particular delegation - ctx := cmd.Context() - if len(args) == 2 { - validatorAddr, err := sdk.ValAddressFromBech32(args[1]) - if err != nil { - return err - } - - res, err := queryClient.DelegationRewards( - ctx, - &types.QueryDelegationRewardsRequest{DelegatorAddress: args[0], ValidatorAddress: validatorAddr.String()}, - ) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - } - - res, err := queryClient.DelegationTotalRewards( - ctx, - &types.QueryDelegationTotalRewardsRequest{DelegatorAddress: args[0]}, - ) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - return cmd -} - -// GetCmdQueryCommunityPool returns the command for fetching community pool info. -func GetCmdQueryCommunityPool() *cobra.Command { - cmd := &cobra.Command{ - Use: "community-pool", - Args: cobra.NoArgs, - Short: "Query the amount of coins in the community pool", - Long: strings.TrimSpace( - fmt.Sprintf(`Query all coins in the community pool which is under Governance control. - -Example: -$ %s query distribution community-pool -`, - version.AppName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - res, err := queryClient.CommunityPool(cmd.Context(), &types.QueryCommunityPoolRequest{}) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - return cmd -} diff --git a/x/distribution/client/cli/query_test.go b/x/distribution/client/cli/query_test.go deleted file mode 100644 index 19f62c44bb56..000000000000 --- a/x/distribution/client/cli/query_test.go +++ /dev/null @@ -1,464 +0,0 @@ -package cli_test - -import ( - "fmt" - "io" - "strings" - "testing" - - abci "github.com/cometbft/cometbft/abci/types" - rpcclientmock "github.com/cometbft/cometbft/rpc/client/mock" - "github.com/stretchr/testify/suite" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/codec/address" - "github.com/cosmos/cosmos-sdk/crypto/keyring" - "github.com/cosmos/cosmos-sdk/testutil" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - "github.com/cosmos/cosmos-sdk/testutil/network" - sdk "github.com/cosmos/cosmos-sdk/types" - testutilmod "github.com/cosmos/cosmos-sdk/types/module/testutil" - "github.com/cosmos/cosmos-sdk/x/bank" - "github.com/cosmos/cosmos-sdk/x/distribution/client/cli" - distrtestutil "github.com/cosmos/cosmos-sdk/x/distribution/testutil" - "github.com/cosmos/cosmos-sdk/x/gov" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" -) - -type CLITestSuite struct { - suite.Suite - - kr keyring.Keyring - encCfg testutilmod.TestEncodingConfig - baseCtx client.Context - clientCtx client.Context -} - -func TestCLITestSuite(t *testing.T) { - suite.Run(t, new(CLITestSuite)) -} - -func (s *CLITestSuite) SetupSuite() { - s.encCfg = testutilmod.MakeTestEncodingConfig(gov.AppModuleBasic{}, bank.AppModuleBasic{}) - s.kr = keyring.NewInMemory(s.encCfg.Codec) - s.baseCtx = client.Context{}. - WithKeyring(s.kr). - WithTxConfig(s.encCfg.TxConfig). - WithCodec(s.encCfg.Codec). - WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}). - WithAccountRetriever(client.MockAccountRetriever{}). - WithOutput(io.Discard). - WithChainID("test-chain") - - ctxGen := func() client.Context { - bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ - Value: bz, - }) - return s.baseCtx.WithClient(c) - } - s.clientCtx = ctxGen() - - cfg, err := network.DefaultConfigWithAppConfig(distrtestutil.AppConfig) - s.Require().NoError(err) - - genesisState := cfg.GenesisState - var mintData minttypes.GenesisState - s.Require().NoError(cfg.Codec.UnmarshalJSON(genesisState[minttypes.ModuleName], &mintData)) - - inflation := sdk.MustNewDecFromStr("1.0") - mintData.Minter.Inflation = inflation - mintData.Params.InflationMin = inflation - mintData.Params.InflationMax = inflation - - mintDataBz, err := cfg.Codec.MarshalJSON(&mintData) - s.Require().NoError(err) - genesisState[minttypes.ModuleName] = mintDataBz - cfg.GenesisState = genesisState -} - -func (s *CLITestSuite) TestGetCmdQueryParams() { - testCases := []struct { - name string - args []string - expectedOutput string - }{ - { - "json output", - []string{fmt.Sprintf("--%s=json", flags.FlagOutput)}, - `{"community_tax":"0","base_proposer_reward":"0","bonus_proposer_reward":"0","withdraw_addr_enabled":false}`, - }, - { - "text output", - []string{fmt.Sprintf("--%s=text", flags.FlagOutput)}, - `base_proposer_reward: "0" -bonus_proposer_reward: "0" -community_tax: "0" -withdraw_addr_enabled: false`, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryParams() - - out, err := clitestutil.ExecTestCLICmd(s.clientCtx, cmd, tc.args) - s.Require().NoError(err) - s.Require().Equal(tc.expectedOutput, strings.TrimSpace(out.String())) - }) - } -} - -func (s *CLITestSuite) TestGetCmdQueryValidatorDistributionInfo() { - addr := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) - val := sdk.ValAddress(addr[0].Address.String()) - - testCases := []struct { - name string - args []string - expErr bool - }{ - { - "invalid val address", - []string{"invalid address", fmt.Sprintf("--%s=json", flags.FlagOutput)}, - true, - }, - { - "json output", - []string{val.String(), fmt.Sprintf("--%s=json", flags.FlagOutput)}, - false, - }, - { - "text output", - []string{val.String(), fmt.Sprintf("--%s=text", flags.FlagOutput)}, - false, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryValidatorDistributionInfo() - - _, err := clitestutil.ExecTestCLICmd(s.clientCtx, cmd, tc.args) - if tc.expErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - } - }) - } -} - -func (s *CLITestSuite) TestGetCmdQueryValidatorOutstandingRewards() { - val := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) - - testCases := []struct { - name string - args []string - expectErr bool - expectedOutput string - }{ - { - "invalid validator address", - []string{ - fmt.Sprintf("--%s=3", flags.FlagHeight), - "foo", - }, - true, - "", - }, - { - "json output", - []string{ - fmt.Sprintf("--%s=3", flags.FlagHeight), - sdk.ValAddress(val[0].Address).String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - `{"rewards":[]}`, - }, - { - "text output", - []string{ - fmt.Sprintf("--%s=text", flags.FlagOutput), - fmt.Sprintf("--%s=3", flags.FlagHeight), - sdk.ValAddress(val[0].Address).String(), - }, - false, - `rewards: []`, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryValidatorOutstandingRewards() - - out, err := clitestutil.ExecTestCLICmd(s.clientCtx, cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - s.Require().Equal(tc.expectedOutput, strings.TrimSpace(out.String())) - } - }) - } -} - -func (s *CLITestSuite) TestGetCmdQueryValidatorCommission() { - val := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) - - testCases := []struct { - name string - args []string - expectErr bool - expectedOutput string - }{ - { - "invalid validator address", - []string{ - fmt.Sprintf("--%s=3", flags.FlagHeight), - "foo", - }, - true, - "", - }, - { - "json output", - []string{ - fmt.Sprintf("--%s=3", flags.FlagHeight), - sdk.ValAddress(val[0].Address).String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - `{"commission":[]}`, - }, - { - "text output", - []string{ - fmt.Sprintf("--%s=text", flags.FlagOutput), - fmt.Sprintf("--%s=3", flags.FlagHeight), - sdk.ValAddress(val[0].Address).String(), - }, - false, - `commission: []`, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryValidatorCommission() - - out, err := clitestutil.ExecTestCLICmd(s.clientCtx, cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - s.Require().Equal(tc.expectedOutput, strings.TrimSpace(out.String())) - } - }) - } -} - -func (s *CLITestSuite) TestGetCmdQueryValidatorSlashes() { - val := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) - - testCases := []struct { - name string - args []string - expectErr bool - expectedOutput string - }{ - { - "invalid validator address", - []string{ - fmt.Sprintf("--%s=3", flags.FlagHeight), - "foo", "1", "3", - }, - true, - "", - }, - { - "invalid start height", - []string{ - fmt.Sprintf("--%s=3", flags.FlagHeight), - sdk.ValAddress(val[0].Address).String(), "-1", "3", - }, - true, - "", - }, - { - "invalid end height", - []string{ - fmt.Sprintf("--%s=3", flags.FlagHeight), - sdk.ValAddress(val[0].Address).String(), "1", "-3", - }, - true, - "", - }, - { - "json output", - []string{ - fmt.Sprintf("--%s=3", flags.FlagHeight), - sdk.ValAddress(val[0].Address).String(), "1", "3", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - "{\"slashes\":[],\"pagination\":null}", - }, - { - "text output", - []string{ - fmt.Sprintf("--%s=text", flags.FlagOutput), - fmt.Sprintf("--%s=3", flags.FlagHeight), - sdk.ValAddress(val[0].Address).String(), "1", "3", - }, - false, - "pagination: null\nslashes: []", - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryValidatorSlashes() - - out, err := clitestutil.ExecTestCLICmd(s.clientCtx, cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - s.Require().Equal(tc.expectedOutput, strings.TrimSpace(out.String())) - } - }) - } -} - -func (s *CLITestSuite) TestGetCmdQueryDelegatorRewards() { - val := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) - addr := val[0].Address - valAddr := sdk.ValAddress(addr) - - testCases := []struct { - name string - args []string - expectErr bool - expectedOutput string - }{ - { - "invalid delegator address", - []string{ - fmt.Sprintf("--%s=5", flags.FlagHeight), - "foo", valAddr.String(), - }, - true, - "", - }, - { - "invalid validator address", - []string{ - fmt.Sprintf("--%s=5", flags.FlagHeight), - addr.String(), "foo", - }, - true, - "", - }, - { - "json output", - []string{ - fmt.Sprintf("--%s=5", flags.FlagHeight), - addr.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - `{"rewards":[],"total":[]}`, - }, - { - "json output (specific validator)", - []string{ - fmt.Sprintf("--%s=5", flags.FlagHeight), - addr.String(), valAddr.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - `{"rewards":[]}`, - }, - { - "text output", - []string{ - fmt.Sprintf("--%s=text", flags.FlagOutput), - fmt.Sprintf("--%s=5", flags.FlagHeight), - addr.String(), - }, - false, - `rewards: [] -total: []`, - }, - { - "text output (specific validator)", - []string{ - fmt.Sprintf("--%s=text", flags.FlagOutput), - fmt.Sprintf("--%s=5", flags.FlagHeight), - addr.String(), valAddr.String(), - }, - false, - `rewards: []`, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryDelegatorRewards(address.NewBech32Codec("cosmos")) - - out, err := clitestutil.ExecTestCLICmd(s.clientCtx, cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - s.Require().Equal(tc.expectedOutput, strings.TrimSpace(out.String())) - } - }) - } -} - -func (s *CLITestSuite) TestGetCmdQueryCommunityPool() { - testCases := []struct { - name string - args []string - expectedOutput string - }{ - { - "json output", - []string{fmt.Sprintf("--%s=3", flags.FlagHeight), fmt.Sprintf("--%s=json", flags.FlagOutput)}, - `{"pool":[]}`, - }, - { - "text output", - []string{fmt.Sprintf("--%s=text", flags.FlagOutput), fmt.Sprintf("--%s=3", flags.FlagHeight)}, - `pool: []`, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryCommunityPool() - - out, err := clitestutil.ExecTestCLICmd(s.clientCtx, cmd, tc.args) - s.Require().NoError(err) - s.Require().Equal(tc.expectedOutput, strings.TrimSpace(out.String())) - }) - } -} diff --git a/x/distribution/client/cli/tx.go b/x/distribution/client/cli/tx.go index 769f9b1ce4ce..577389028856 100644 --- a/x/distribution/client/cli/tx.go +++ b/x/distribution/client/cli/tx.go @@ -4,10 +4,11 @@ import ( "fmt" "strings" - "cosmossdk.io/core/address" "github.com/spf13/cobra" "github.com/spf13/pflag" + "cosmossdk.io/core/address" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" @@ -27,7 +28,7 @@ const ( ) // NewTxCmd returns a root CLI command handler for all x/distribution transaction commands. -func NewTxCmd(ac address.Codec) *cobra.Command { +func NewTxCmd(valAc, ac address.Codec) *cobra.Command { distTxCmd := &cobra.Command{ Use: types.ModuleName, Short: "Distribution transactions subcommands", @@ -37,11 +38,11 @@ func NewTxCmd(ac address.Codec) *cobra.Command { } distTxCmd.AddCommand( - NewWithdrawRewardsCmd(), - NewWithdrawAllRewardsCmd(), + NewWithdrawRewardsCmd(valAc, ac), + NewWithdrawAllRewardsCmd(valAc, ac), NewSetWithdrawAddrCmd(ac), - NewFundCommunityPoolCmd(), - NewDepositValidatorRewardsPoolCmd(), + NewFundCommunityPoolCmd(ac), + NewDepositValidatorRewardsPoolCmd(valAc, ac), ) return distTxCmd @@ -76,7 +77,7 @@ func newSplitAndApply( } // NewWithdrawRewardsCmd returns a CLI command handler for creating a MsgWithdrawDelegatorReward transaction. -func NewWithdrawRewardsCmd() *cobra.Command { +func NewWithdrawRewardsCmd(valCodec, ac address.Codec) *cobra.Command { bech32PrefixValAddr := sdk.GetConfig().GetBech32ValidatorAddrPrefix() cmd := &cobra.Command{ @@ -99,16 +100,20 @@ $ %s tx distribution withdraw-rewards %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj if err != nil { return err } - delAddr := clientCtx.GetFromAddress() - valAddr, err := sdk.ValAddressFromBech32(args[0]) + delAddr, err := ac.BytesToString(clientCtx.GetFromAddress()) if err != nil { return err } - msgs := []sdk.Msg{types.NewMsgWithdrawDelegatorReward(delAddr, valAddr)} + _, err = valCodec.StringToBytes(args[0]) + if err != nil { + return err + } + + msgs := []sdk.Msg{types.NewMsgWithdrawDelegatorReward(delAddr, args[0])} if commission, _ := cmd.Flags().GetBool(FlagCommission); commission { - msgs = append(msgs, types.NewMsgWithdrawValidatorCommission(valAddr)) + msgs = append(msgs, types.NewMsgWithdrawValidatorCommission(args[0])) } return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msgs...) @@ -122,7 +127,7 @@ $ %s tx distribution withdraw-rewards %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj } // NewWithdrawAllRewardsCmd returns a CLI command handler for creating a MsgWithdrawDelegatorReward transaction. -func NewWithdrawAllRewardsCmd() *cobra.Command { +func NewWithdrawAllRewardsCmd(valCodec, ac address.Codec) *cobra.Command { cmd := &cobra.Command{ Use: "withdraw-all-rewards", Short: "withdraw all delegations rewards for a delegator", @@ -142,7 +147,10 @@ $ %[1]s tx distribution withdraw-all-rewards --from mykey if err != nil { return err } - delAddr := clientCtx.GetFromAddress() + delAddr, err := ac.BytesToString(clientCtx.GetFromAddress()) + if err != nil { + return err + } // The transaction cannot be generated offline since it requires a query // to get all the validators. @@ -151,7 +159,7 @@ $ %[1]s tx distribution withdraw-all-rewards --from mykey } queryClient := types.NewQueryClient(clientCtx) - delValsRes, err := queryClient.DelegatorValidators(cmd.Context(), &types.QueryDelegatorValidatorsRequest{DelegatorAddress: delAddr.String()}) + delValsRes, err := queryClient.DelegatorValidators(cmd.Context(), &types.QueryDelegatorValidatorsRequest{DelegatorAddress: delAddr}) if err != nil { return err } @@ -160,12 +168,12 @@ $ %[1]s tx distribution withdraw-all-rewards --from mykey // build multi-message transaction msgs := make([]sdk.Msg, 0, len(validators)) for _, valAddr := range validators { - val, err := sdk.ValAddressFromBech32(valAddr) + _, err := valCodec.StringToBytes(valAddr) if err != nil { return err } - msg := types.NewMsgWithdrawDelegatorReward(delAddr, val) + msg := types.NewMsgWithdrawDelegatorReward(delAddr, valAddr) msgs = append(msgs, msg) } @@ -221,7 +229,7 @@ $ %s tx distribution set-withdraw-addr %s1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p } // NewFundCommunityPoolCmd returns a CLI command handler for creating a MsgFundCommunityPool transaction. -func NewFundCommunityPoolCmd() *cobra.Command { +func NewFundCommunityPoolCmd(ac address.Codec) *cobra.Command { cmd := &cobra.Command{ Use: "fund-community-pool [amount]", Args: cobra.ExactArgs(1), @@ -240,7 +248,10 @@ $ %s tx distribution fund-community-pool 100uatom --from mykey if err != nil { return err } - depositorAddr := clientCtx.GetFromAddress() + depositorAddr, err := ac.BytesToString(clientCtx.GetFromAddress()) + if err != nil { + return err + } amount, err := sdk.ParseCoinsNormalized(args[0]) if err != nil { return err @@ -259,7 +270,7 @@ $ %s tx distribution fund-community-pool 100uatom --from mykey // NewDepositValidatorRewardsPoolCmd returns a CLI command handler for creating // a MsgDepositValidatorRewardsPool transaction. -func NewDepositValidatorRewardsPoolCmd() *cobra.Command { +func NewDepositValidatorRewardsPoolCmd(valCodec, ac address.Codec) *cobra.Command { cmd := &cobra.Command{ Use: "fund-validator-rewards-pool [val_addr] [amount]", Args: cobra.ExactArgs(2), @@ -274,9 +285,12 @@ func NewDepositValidatorRewardsPoolCmd() *cobra.Command { return err } - depositorAddr := clientCtx.GetFromAddress() + depositorAddr, err := ac.BytesToString(clientCtx.GetFromAddress()) + if err != nil { + return err + } - valAddr, err := sdk.ValAddressFromBech32(args[0]) + _, err = valCodec.StringToBytes(args[0]) if err != nil { return err } @@ -286,7 +300,7 @@ func NewDepositValidatorRewardsPoolCmd() *cobra.Command { return err } - msg := types.NewMsgDepositValidatorRewardsPool(depositorAddr, valAddr, amount) + msg := types.NewMsgDepositValidatorRewardsPool(depositorAddr, args[0], amount) return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) }, } diff --git a/x/distribution/client/cli/tx_test.go b/x/distribution/client/cli/tx_test.go index 3522faa9b43b..94e9d8af6d16 100644 --- a/x/distribution/client/cli/tx_test.go +++ b/x/distribution/client/cli/tx_test.go @@ -3,20 +3,85 @@ package cli_test import ( "context" "fmt" + "io" + "testing" - sdkmath "cosmossdk.io/math" + abci "github.com/cometbft/cometbft/abci/types" + rpcclientmock "github.com/cometbft/cometbft/rpc/client/mock" "github.com/cosmos/gogoproto/proto" + "github.com/stretchr/testify/suite" + + sdkmath "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/codec/address" + "github.com/cosmos/cosmos-sdk/crypto/keyring" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" "github.com/cosmos/cosmos-sdk/testutil" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/cosmos/cosmos-sdk/testutil/network" sdk "github.com/cosmos/cosmos-sdk/types" + testutilmod "github.com/cosmos/cosmos-sdk/types/module/testutil" + "github.com/cosmos/cosmos-sdk/x/bank" "github.com/cosmos/cosmos-sdk/x/distribution/client/cli" + distrtestutil "github.com/cosmos/cosmos-sdk/x/distribution/testutil" + "github.com/cosmos/cosmos-sdk/x/gov" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" ) +type CLITestSuite struct { + suite.Suite + + kr keyring.Keyring + encCfg testutilmod.TestEncodingConfig + baseCtx client.Context + clientCtx client.Context +} + +func TestCLITestSuite(t *testing.T) { + suite.Run(t, new(CLITestSuite)) +} + +func (s *CLITestSuite) SetupSuite() { + s.encCfg = testutilmod.MakeTestEncodingConfig(gov.AppModuleBasic{}, bank.AppModuleBasic{}) + s.kr = keyring.NewInMemory(s.encCfg.Codec) + s.baseCtx = client.Context{}. + WithKeyring(s.kr). + WithTxConfig(s.encCfg.TxConfig). + WithCodec(s.encCfg.Codec). + WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}). + WithAccountRetriever(client.MockAccountRetriever{}). + WithOutput(io.Discard). + WithChainID("test-chain") + + ctxGen := func() client.Context { + bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) + c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ + Value: bz, + }) + return s.baseCtx.WithClient(c) + } + s.clientCtx = ctxGen() + + cfg, err := network.DefaultConfigWithAppConfig(distrtestutil.AppConfig) + s.Require().NoError(err) + + genesisState := cfg.GenesisState + var mintData minttypes.GenesisState + s.Require().NoError(cfg.Codec.UnmarshalJSON(genesisState[minttypes.ModuleName], &mintData)) + + inflation := sdkmath.LegacyMustNewDecFromStr("1.0") + mintData.Minter.Inflation = inflation + mintData.Params.InflationMin = inflation + mintData.Params.InflationMax = inflation + + mintDataBz, err := cfg.Codec.MarshalJSON(&mintData) + s.Require().NoError(err) + genesisState[minttypes.ModuleName] = mintDataBz + cfg.GenesisState = genesisState +} + func (s *CLITestSuite) TestTxWithdrawRewardsCmd() { val := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) @@ -35,7 +100,7 @@ func (s *CLITestSuite) TestTxWithdrawRewardsCmd() { fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(10))).String()), }, - "invalid Bech32 prefix", + "hrp does not match bech32 prefix", }, { "valid transaction", @@ -69,7 +134,7 @@ func (s *CLITestSuite) TestTxWithdrawRewardsCmd() { args := append([]string{tc.valAddr.String()}, tc.args...) ctx := svrcmd.CreateExecuteContext(context.Background()) - cmd := cli.NewWithdrawRewardsCmd() + cmd := cli.NewWithdrawRewardsCmd(address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmos")) cmd.SetContext(ctx) cmd.SetArgs(args) s.Require().NoError(client.SetCmdClientContextHandler(s.clientCtx, cmd)) @@ -121,7 +186,7 @@ func (s *CLITestSuite) TestTxWithdrawAllRewardsCmd() { tc := tc s.Run(tc.name, func() { - cmd := cli.NewWithdrawAllRewardsCmd() + cmd := cli.NewWithdrawAllRewardsCmd(address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmos")) out, err := clitestutil.ExecTestCLICmd(s.clientCtx, cmd, tc.args) if tc.expectErrMsg != "" { @@ -223,7 +288,7 @@ func (s *CLITestSuite) TestTxFundCommunityPoolCmd() { tc := tc s.Run(tc.name, func() { - cmd := cli.NewFundCommunityPoolCmd() + cmd := cli.NewFundCommunityPoolCmd(address.NewBech32Codec("cosmos")) out, err := clitestutil.ExecTestCLICmd(s.clientCtx, cmd, tc.args) if tc.expectErr { diff --git a/x/distribution/client/common/common_test.go b/x/distribution/client/common/common_test.go index ff9bb88d1766..05fa593079e0 100644 --- a/x/distribution/client/common/common_test.go +++ b/x/distribution/client/common/common_test.go @@ -3,11 +3,10 @@ package common import ( "testing" - "github.com/cosmos/cosmos-sdk/codec/legacy" - "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec/legacy" ) func TestQueryDelegationRewardsAddrValidation(t *testing.T) { diff --git a/x/distribution/keeper/allocation.go b/x/distribution/keeper/allocation.go index fce0cfefc24a..83db0ae72e20 100644 --- a/x/distribution/keeper/allocation.go +++ b/x/distribution/keeper/allocation.go @@ -3,9 +3,10 @@ package keeper import ( "context" - "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/distribution/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -17,13 +18,12 @@ func (k Keeper) AllocateTokens(ctx context.Context, totalPreviousPower int64, bo // fetch and clear the collected fees for distribution, since this is // called in BeginBlock, collected fees will be from the previous block // (and distributed to the previous proposer) - sdkCtx := sdk.UnwrapSDKContext(ctx) feeCollector := k.authKeeper.GetModuleAccount(ctx, k.feeCollectorName) - feesCollectedInt := k.bankKeeper.GetAllBalances(sdkCtx, feeCollector.GetAddress()) + feesCollectedInt := k.bankKeeper.GetAllBalances(ctx, feeCollector.GetAddress()) feesCollected := sdk.NewDecCoinsFromCoins(feesCollectedInt...) // transfer collected fees to the distribution module account - err := k.bankKeeper.SendCoinsFromModuleToModule(sdkCtx, k.feeCollectorName, types.ModuleName, feesCollectedInt) + err := k.bankKeeper.SendCoinsFromModuleToModule(ctx, k.feeCollectorName, types.ModuleName, feesCollectedInt) if err != nil { return err } @@ -56,7 +56,10 @@ func (k Keeper) AllocateTokens(ctx context.Context, totalPreviousPower int64, bo // // Ref: https://github.com/cosmos/cosmos-sdk/pull/3099#discussion_r246276376 for _, vote := range bondedVotes { - validator := k.stakingKeeper.ValidatorByConsAddr(sdkCtx, vote.Validator.Address) + validator, err := k.stakingKeeper.ValidatorByConsAddr(ctx, vote.Validator.Address) + if err != nil { + return err + } // TODO: Consider micro-slashing for missing votes. // @@ -64,7 +67,7 @@ func (k Keeper) AllocateTokens(ctx context.Context, totalPreviousPower int64, bo powerFraction := math.LegacyNewDec(vote.Validator.Power).QuoTruncate(math.LegacyNewDec(totalPreviousPower)) reward := feeMultiplier.MulDecTruncate(powerFraction) - err := k.AllocateTokensToValidator(ctx, validator, reward) + err = k.AllocateTokensToValidator(ctx, validator, reward) if err != nil { return err } @@ -84,34 +87,39 @@ func (k Keeper) AllocateTokensToValidator(ctx context.Context, val stakingtypes. commission := tokens.MulDec(val.GetCommission()) shared := tokens.Sub(commission) + valBz, err := k.stakingKeeper.ValidatorAddressCodec().StringToBytes(val.GetOperator()) + if err != nil { + return err + } + // update current commission sdkCtx := sdk.UnwrapSDKContext(ctx) sdkCtx.EventManager().EmitEvent( sdk.NewEvent( types.EventTypeCommission, sdk.NewAttribute(sdk.AttributeKeyAmount, commission.String()), - sdk.NewAttribute(types.AttributeKeyValidator, val.GetOperator().String()), + sdk.NewAttribute(types.AttributeKeyValidator, val.GetOperator()), ), ) - currentCommission, err := k.GetValidatorAccumulatedCommission(ctx, val.GetOperator()) + currentCommission, err := k.GetValidatorAccumulatedCommission(ctx, valBz) if err != nil { return err } currentCommission.Commission = currentCommission.Commission.Add(commission...) - err = k.SetValidatorAccumulatedCommission(ctx, val.GetOperator(), currentCommission) + err = k.SetValidatorAccumulatedCommission(ctx, valBz, currentCommission) if err != nil { return err } // update current rewards - currentRewards, err := k.GetValidatorCurrentRewards(ctx, val.GetOperator()) + currentRewards, err := k.GetValidatorCurrentRewards(ctx, valBz) if err != nil { return err } currentRewards.Rewards = currentRewards.Rewards.Add(shared...) - err = k.SetValidatorCurrentRewards(ctx, val.GetOperator(), currentRewards) + err = k.SetValidatorCurrentRewards(ctx, valBz, currentRewards) if err != nil { return err } @@ -121,15 +129,15 @@ func (k Keeper) AllocateTokensToValidator(ctx context.Context, val stakingtypes. sdk.NewEvent( types.EventTypeRewards, sdk.NewAttribute(sdk.AttributeKeyAmount, tokens.String()), - sdk.NewAttribute(types.AttributeKeyValidator, val.GetOperator().String()), + sdk.NewAttribute(types.AttributeKeyValidator, val.GetOperator()), ), ) - outstanding, err := k.GetValidatorOutstandingRewards(ctx, val.GetOperator()) + outstanding, err := k.GetValidatorOutstandingRewards(ctx, valBz) if err != nil { return err } outstanding.Rewards = outstanding.Rewards.Add(tokens...) - return k.SetValidatorOutstandingRewards(ctx, val.GetOperator(), outstanding) + return k.SetValidatorOutstandingRewards(ctx, valBz, outstanding) } diff --git a/x/distribution/keeper/allocation_test.go b/x/distribution/keeper/allocation_test.go index 5ca02a56eef2..1246d57b2a2a 100644 --- a/x/distribution/keeper/allocation_test.go +++ b/x/distribution/keeper/allocation_test.go @@ -4,14 +4,15 @@ import ( "testing" "time" - "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" + "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" @@ -36,7 +37,10 @@ func TestAllocateTokensToValidatorWithCommission(t *testing.T) { stakingKeeper := distrtestutil.NewMockStakingKeeper(ctrl) accountKeeper := distrtestutil.NewMockAccountKeeper(ctrl) + valCodec := address.NewBech32Codec("cosmosvaloper") + accountKeeper.EXPECT().GetModuleAddress("distribution").Return(distrAcc.GetAddress()) + stakingKeeper.EXPECT().ValidatorAddressCodec().Return(valCodec).AnyTimes() distrKeeper := keeper.NewKeeper( encCfg.Codec, @@ -52,7 +56,7 @@ func TestAllocateTokensToValidatorWithCommission(t *testing.T) { val, err := distrtestutil.CreateValidator(valConsPk0, math.NewInt(100)) require.NoError(t, err) val.Commission = stakingtypes.NewCommission(math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDec(0)) - stakingKeeper.EXPECT().ValidatorByConsAddr(gomock.Any(), sdk.GetConsAddress(valConsPk0)).Return(val).AnyTimes() + stakingKeeper.EXPECT().ValidatorByConsAddr(gomock.Any(), sdk.GetConsAddress(valConsPk0)).Return(val, nil).AnyTimes() // allocate tokens tokens := sdk.DecCoins{ @@ -65,12 +69,15 @@ func TestAllocateTokensToValidatorWithCommission(t *testing.T) { {Denom: sdk.DefaultBondDenom, Amount: math.LegacyNewDec(5)}, } - valCommission, err := distrKeeper.GetValidatorAccumulatedCommission(ctx, val.GetOperator()) + valBz, err := valCodec.StringToBytes(val.GetOperator()) + require.NoError(t, err) + + valCommission, err := distrKeeper.GetValidatorAccumulatedCommission(ctx, valBz) require.NoError(t, err) require.Equal(t, expected, valCommission.Commission) // check current rewards - currentRewards, err := distrKeeper.GetValidatorCurrentRewards(ctx, val.GetOperator()) + currentRewards, err := distrKeeper.GetValidatorCurrentRewards(ctx, valBz) require.NoError(t, err) require.Equal(t, expected, currentRewards.Rewards) } @@ -90,6 +97,7 @@ func TestAllocateTokensToManyValidators(t *testing.T) { feeCollectorAcc := authtypes.NewEmptyModuleAccount("fee_collector") accountKeeper.EXPECT().GetModuleAddress("distribution").Return(distrAcc.GetAddress()) accountKeeper.EXPECT().GetModuleAccount(gomock.Any(), "fee_collector").Return(feeCollectorAcc) + stakingKeeper.EXPECT().ValidatorAddressCodec().Return(address.NewBech32Codec("cosmosvaloper")).AnyTimes() distrKeeper := keeper.NewKeeper( encCfg.Codec, @@ -110,14 +118,14 @@ func TestAllocateTokensToManyValidators(t *testing.T) { val0, err := distrtestutil.CreateValidator(valConsPk0, math.NewInt(100)) require.NoError(t, err) val0.Commission = stakingtypes.NewCommission(math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDec(0)) - stakingKeeper.EXPECT().ValidatorByConsAddr(gomock.Any(), sdk.GetConsAddress(valConsPk0)).Return(val0).AnyTimes() + stakingKeeper.EXPECT().ValidatorByConsAddr(gomock.Any(), sdk.GetConsAddress(valConsPk0)).Return(val0, nil).AnyTimes() // create second validator with 0% commission valAddr1 := sdk.ValAddress(valConsAddr1) val1, err := distrtestutil.CreateValidator(valConsPk1, math.NewInt(100)) require.NoError(t, err) val1.Commission = stakingtypes.NewCommission(math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0)) - stakingKeeper.EXPECT().ValidatorByConsAddr(gomock.Any(), sdk.GetConsAddress(valConsPk1)).Return(val1).AnyTimes() + stakingKeeper.EXPECT().ValidatorByConsAddr(gomock.Any(), sdk.GetConsAddress(valConsPk1)).Return(val1, nil).AnyTimes() abciValA := abci.Validator{ Address: valConsPk0.Address(), @@ -222,6 +230,7 @@ func TestAllocateTokensTruncation(t *testing.T) { feeCollectorAcc := authtypes.NewEmptyModuleAccount("fee_collector") accountKeeper.EXPECT().GetModuleAddress("distribution").Return(distrAcc.GetAddress()) accountKeeper.EXPECT().GetModuleAccount(gomock.Any(), "fee_collector").Return(feeCollectorAcc) + stakingKeeper.EXPECT().ValidatorAddressCodec().Return(address.NewBech32Codec("cosmosvaloper")).AnyTimes() distrKeeper := keeper.NewKeeper( encCfg.Codec, @@ -242,21 +251,21 @@ func TestAllocateTokensTruncation(t *testing.T) { val0, err := distrtestutil.CreateValidator(valConsPk0, math.NewInt(100)) require.NoError(t, err) val0.Commission = stakingtypes.NewCommission(math.LegacyNewDecWithPrec(1, 1), math.LegacyNewDecWithPrec(1, 1), math.LegacyNewDec(0)) - stakingKeeper.EXPECT().ValidatorByConsAddr(gomock.Any(), sdk.GetConsAddress(valConsPk0)).Return(val0).AnyTimes() + stakingKeeper.EXPECT().ValidatorByConsAddr(gomock.Any(), sdk.GetConsAddress(valConsPk0)).Return(val0, nil).AnyTimes() // create second validator with 10% commission valAddr1 := sdk.ValAddress(valConsAddr1) val1, err := distrtestutil.CreateValidator(valConsPk1, math.NewInt(100)) require.NoError(t, err) val1.Commission = stakingtypes.NewCommission(math.LegacyNewDecWithPrec(1, 1), math.LegacyNewDecWithPrec(1, 1), math.LegacyNewDec(0)) - stakingKeeper.EXPECT().ValidatorByConsAddr(gomock.Any(), sdk.GetConsAddress(valConsPk1)).Return(val1).AnyTimes() + stakingKeeper.EXPECT().ValidatorByConsAddr(gomock.Any(), sdk.GetConsAddress(valConsPk1)).Return(val1, nil).AnyTimes() // create third validator with 10% commission valAddr2 := sdk.ValAddress(valConsAddr2) - val2, err := stakingtypes.NewValidator(sdk.ValAddress(valConsAddr2), valConsPk1, stakingtypes.Description{}) + val2, err := stakingtypes.NewValidator(sdk.ValAddress(valConsAddr2).String(), valConsPk1, stakingtypes.Description{}) require.NoError(t, err) val2.Commission = stakingtypes.NewCommission(math.LegacyNewDecWithPrec(1, 1), math.LegacyNewDecWithPrec(1, 1), math.LegacyNewDec(0)) - stakingKeeper.EXPECT().ValidatorByConsAddr(gomock.Any(), sdk.GetConsAddress(valConsPk2)).Return(val2).AnyTimes() + stakingKeeper.EXPECT().ValidatorByConsAddr(gomock.Any(), sdk.GetConsAddress(valConsPk2)).Return(val2, nil).AnyTimes() abciValA := abci.Validator{ Address: valConsPk0.Address(), diff --git a/x/distribution/keeper/delegation.go b/x/distribution/keeper/delegation.go index fdd19fd8ce32..2b0e99d390e5 100644 --- a/x/distribution/keeper/delegation.go +++ b/x/distribution/keeper/delegation.go @@ -21,16 +21,26 @@ func (k Keeper) initializeDelegation(ctx context.Context, val sdk.ValAddress, de previousPeriod := valCurrentRewards.Period - 1 // increment reference count for the period we're going to track - k.incrementReferenceCount(ctx, val, previousPeriod) + err = k.incrementReferenceCount(ctx, val, previousPeriod) + if err != nil { + return err + } - sdkCtx := sdk.UnwrapSDKContext(ctx) - validator := k.stakingKeeper.Validator(sdkCtx, val) - delegation := k.stakingKeeper.Delegation(sdkCtx, del, val) + validator, err := k.stakingKeeper.Validator(ctx, val) + if err != nil { + return err + } + + delegation, err := k.stakingKeeper.Delegation(ctx, del, val) + if err != nil { + return err + } // calculate delegation stake in tokens // we don't store directly, so multiply delegation shares * (tokens per share) // note: necessary to truncate so we don't allow withdrawing more rewards than owed stake := validator.TokensFromSharesTruncated(delegation.GetShares()) + sdkCtx := sdk.UnwrapSDKContext(ctx) return k.SetDelegatorStartingInfo(ctx, val, del, types.NewDelegatorStartingInfo(previousPeriod, stake, uint64(sdkCtx.BlockHeight()))) } @@ -48,13 +58,18 @@ func (k Keeper) calculateDelegationRewardsBetween(ctx context.Context, val staki panic("stake should not be negative") } + valBz, err := k.stakingKeeper.ValidatorAddressCodec().StringToBytes(val.GetOperator()) + if err != nil { + panic(err) + } + // return staking * (ending - starting) - starting, err := k.GetValidatorHistoricalRewards(ctx, val.GetOperator(), startingPeriod) + starting, err := k.GetValidatorHistoricalRewards(ctx, valBz, startingPeriod) if err != nil { return sdk.DecCoins{}, err } - ending, err := k.GetValidatorHistoricalRewards(ctx, val.GetOperator(), endingPeriod) + ending, err := k.GetValidatorHistoricalRewards(ctx, valBz, endingPeriod) if err != nil { return sdk.DecCoins{}, err } @@ -70,8 +85,19 @@ func (k Keeper) calculateDelegationRewardsBetween(ctx context.Context, val staki // calculate the total rewards accrued by a delegation func (k Keeper) CalculateDelegationRewards(ctx context.Context, val stakingtypes.ValidatorI, del stakingtypes.DelegationI, endingPeriod uint64) (rewards sdk.DecCoins, err error) { + addrCodec := k.authKeeper.AddressCodec() + delAddr, err := addrCodec.StringToBytes(del.GetDelegatorAddr()) + if err != nil { + return sdk.DecCoins{}, err + } + + valAddr, err := k.stakingKeeper.ValidatorAddressCodec().StringToBytes(del.GetValidatorAddr()) + if err != nil { + return sdk.DecCoins{}, err + } + // fetch starting info for delegation - startingInfo, err := k.GetDelegatorStartingInfo(ctx, del.GetValidatorAddr(), del.GetDelegatorAddr()) + startingInfo, err := k.GetDelegatorStartingInfo(ctx, sdk.ValAddress(valAddr), sdk.AccAddress(delAddr)) if err != nil { return } @@ -97,7 +123,7 @@ func (k Keeper) CalculateDelegationRewards(ctx context.Context, val stakingtypes // for them for the stake sanity check below. endingHeight := uint64(sdkCtx.BlockHeight()) if endingHeight > startingHeight { - k.IterateValidatorSlashEventsBetween(ctx, del.GetValidatorAddr(), startingHeight, endingHeight, + k.IterateValidatorSlashEventsBetween(ctx, valAddr, startingHeight, endingHeight, func(height uint64, event types.ValidatorSlashEvent) (stop bool) { endingPeriod := event.ValidatorPeriod if endingPeriod > startingPeriod { @@ -166,8 +192,19 @@ func (k Keeper) CalculateDelegationRewards(ctx context.Context, val stakingtypes } func (k Keeper) withdrawDelegationRewards(ctx context.Context, val stakingtypes.ValidatorI, del stakingtypes.DelegationI) (sdk.Coins, error) { + addrCodec := k.authKeeper.AddressCodec() + delAddr, err := addrCodec.StringToBytes(del.GetDelegatorAddr()) + if err != nil { + return nil, err + } + + valAddr, err := k.stakingKeeper.ValidatorAddressCodec().StringToBytes(del.GetValidatorAddr()) + if err != nil { + return nil, err + } + // check existence of delegator starting info - hasInfo, err := k.HasDelegatorStartingInfo(ctx, del.GetValidatorAddr(), del.GetDelegatorAddr()) + hasInfo, err := k.HasDelegatorStartingInfo(ctx, sdk.ValAddress(valAddr), sdk.AccAddress(delAddr)) if err != nil { return nil, err } @@ -187,7 +224,7 @@ func (k Keeper) withdrawDelegationRewards(ctx context.Context, val stakingtypes. return nil, err } - outstanding, err := k.GetValidatorOutstandingRewardsCoins(ctx, del.GetValidatorAddr()) + outstanding, err := k.GetValidatorOutstandingRewardsCoins(ctx, sdk.ValAddress(valAddr)) if err != nil { return nil, err } @@ -199,8 +236,8 @@ func (k Keeper) withdrawDelegationRewards(ctx context.Context, val stakingtypes. logger := k.Logger(ctx) logger.Info( "rounding error withdrawing rewards from validator", - "delegator", del.GetDelegatorAddr().String(), - "validator", val.GetOperator().String(), + "delegator", del.GetDelegatorAddr(), + "validator", val.GetOperator(), "got", rewards.String(), "expected", rewardsRaw.String(), ) @@ -211,7 +248,7 @@ func (k Keeper) withdrawDelegationRewards(ctx context.Context, val stakingtypes. // add coins to user account if !finalRewards.IsZero() { - withdrawAddr, err := k.GetDelegatorWithdrawAddr(ctx, del.GetDelegatorAddr()) + withdrawAddr, err := k.GetDelegatorWithdrawAddr(ctx, delAddr) if err != nil { return nil, err } @@ -224,7 +261,7 @@ func (k Keeper) withdrawDelegationRewards(ctx context.Context, val stakingtypes. // update the outstanding rewards and the community pool only if the // transaction was successful - err = k.SetValidatorOutstandingRewards(ctx, del.GetValidatorAddr(), types.ValidatorOutstandingRewards{Rewards: outstanding.Sub(rewards)}) + err = k.SetValidatorOutstandingRewards(ctx, sdk.ValAddress(valAddr), types.ValidatorOutstandingRewards{Rewards: outstanding.Sub(rewards)}) if err != nil { return nil, err } @@ -241,19 +278,19 @@ func (k Keeper) withdrawDelegationRewards(ctx context.Context, val stakingtypes. } // decrement reference count of starting period - startingInfo, err := k.GetDelegatorStartingInfo(ctx, del.GetValidatorAddr(), del.GetDelegatorAddr()) + startingInfo, err := k.GetDelegatorStartingInfo(ctx, sdk.ValAddress(valAddr), sdk.AccAddress(delAddr)) if err != nil { return nil, err } startingPeriod := startingInfo.PreviousPeriod - err = k.decrementReferenceCount(ctx, del.GetValidatorAddr(), startingPeriod) + err = k.decrementReferenceCount(ctx, sdk.ValAddress(valAddr), startingPeriod) if err != nil { return nil, err } // remove delegator starting info - err = k.DeleteDelegatorStartingInfo(ctx, del.GetValidatorAddr(), del.GetDelegatorAddr()) + err = k.DeleteDelegatorStartingInfo(ctx, sdk.ValAddress(valAddr), sdk.AccAddress(delAddr)) if err != nil { return nil, err } @@ -274,8 +311,8 @@ func (k Keeper) withdrawDelegationRewards(ctx context.Context, val stakingtypes. sdk.NewEvent( types.EventTypeWithdrawRewards, sdk.NewAttribute(sdk.AttributeKeyAmount, finalRewards.String()), - sdk.NewAttribute(types.AttributeKeyValidator, val.GetOperator().String()), - sdk.NewAttribute(types.AttributeKeyDelegator, del.GetDelegatorAddr().String()), + sdk.NewAttribute(types.AttributeKeyValidator, val.GetOperator()), + sdk.NewAttribute(types.AttributeKeyDelegator, del.GetDelegatorAddr()), ), ) diff --git a/x/distribution/keeper/delegation_test.go b/x/distribution/keeper/delegation_test.go index e1e1680244ae..dc6f94f8329f 100644 --- a/x/distribution/keeper/delegation_test.go +++ b/x/distribution/keeper/delegation_test.go @@ -4,12 +4,13 @@ import ( "testing" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" @@ -35,6 +36,8 @@ func TestCalculateRewardsBasic(t *testing.T) { accountKeeper := distrtestutil.NewMockAccountKeeper(ctrl) accountKeeper.EXPECT().GetModuleAddress("distribution").Return(distrAcc.GetAddress()) + stakingKeeper.EXPECT().ValidatorAddressCodec().Return(address.NewBech32Codec(sdk.Bech32PrefixValAddr)).AnyTimes() + accountKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec(sdk.Bech32MainPrefix)).AnyTimes() distrKeeper := keeper.NewKeeper( encCfg.Codec, @@ -58,9 +61,9 @@ func TestCalculateRewardsBasic(t *testing.T) { val.Commission = stakingtypes.NewCommission(math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDec(0)) // delegation mock - del := stakingtypes.NewDelegation(addr, valAddr, val.DelegatorShares) - stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val).Times(3) - stakingKeeper.EXPECT().Delegation(gomock.Any(), addr, valAddr).Return(del) + del := stakingtypes.NewDelegation(addr.String(), valAddr.String(), val.DelegatorShares) + stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val, nil).Times(3) + stakingKeeper.EXPECT().Delegation(gomock.Any(), addr, valAddr).Return(del, nil) // run the necessary hooks manually (given that we are not running an actual staking module) err = distrtestutil.CallCreateValidatorHooks(ctx, distrKeeper, addr, valAddr) @@ -118,6 +121,8 @@ func TestCalculateRewardsAfterSlash(t *testing.T) { accountKeeper := distrtestutil.NewMockAccountKeeper(ctrl) accountKeeper.EXPECT().GetModuleAddress("distribution").Return(distrAcc.GetAddress()) + stakingKeeper.EXPECT().ValidatorAddressCodec().Return(address.NewBech32Codec(sdk.Bech32PrefixValAddr)).AnyTimes() + accountKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec(sdk.Bech32MainPrefix)).AnyTimes() distrKeeper := keeper.NewKeeper( encCfg.Codec, @@ -142,11 +147,11 @@ func TestCalculateRewardsAfterSlash(t *testing.T) { require.NoError(t, err) val.Commission = stakingtypes.NewCommission(math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDec(0)) - del := stakingtypes.NewDelegation(addr, valAddr, val.DelegatorShares) + del := stakingtypes.NewDelegation(addr.String(), valAddr.String(), val.DelegatorShares) // set mock calls - stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val).Times(4) - stakingKeeper.EXPECT().Delegation(gomock.Any(), addr, valAddr).Return(del) + stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val, nil).Times(4) + stakingKeeper.EXPECT().Delegation(gomock.Any(), addr, valAddr).Return(del, nil) // run the necessary hooks manually (given that we are not running an actual staking module) err = distrtestutil.CallCreateValidatorHooks(ctx, distrKeeper, addr, valAddr) @@ -177,6 +182,7 @@ func TestCalculateRewardsAfterSlash(t *testing.T) { math.LegacyNewDecWithPrec(5, 1), &val, &distrKeeper, + stakingKeeper, ) require.True(t, slashedTokens.IsPositive(), "expected positive slashed tokens, got: %s", slashedTokens) @@ -218,6 +224,8 @@ func TestCalculateRewardsAfterManySlashes(t *testing.T) { accountKeeper := distrtestutil.NewMockAccountKeeper(ctrl) accountKeeper.EXPECT().GetModuleAddress("distribution").Return(distrAcc.GetAddress()) + stakingKeeper.EXPECT().ValidatorAddressCodec().Return(address.NewBech32Codec(sdk.Bech32PrefixValAddr)).AnyTimes() + accountKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec(sdk.Bech32MainPrefix)).AnyTimes() distrKeeper := keeper.NewKeeper( encCfg.Codec, @@ -243,9 +251,9 @@ func TestCalculateRewardsAfterManySlashes(t *testing.T) { val.Commission = stakingtypes.NewCommission(math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDec(0)) // delegation mocks - del := stakingtypes.NewDelegation(addr, valAddr, val.DelegatorShares) - stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val).Times(4) - stakingKeeper.EXPECT().Delegation(gomock.Any(), addr, valAddr).Return(del) + del := stakingtypes.NewDelegation(addr.String(), valAddr.String(), val.DelegatorShares) + stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val, nil).Times(4) + stakingKeeper.EXPECT().Delegation(gomock.Any(), addr, valAddr).Return(del, nil) // run the necessary hooks manually (given that we are not running an actual staking module) err = distrtestutil.CallCreateValidatorHooks(ctx, distrKeeper, addr, valAddr) @@ -276,11 +284,12 @@ func TestCalculateRewardsAfterManySlashes(t *testing.T) { math.LegacyNewDecWithPrec(5, 1), &val, &distrKeeper, + stakingKeeper, ) require.True(t, slashedTokens.IsPositive(), "expected positive slashed tokens, got: %s", slashedTokens) // expect a call for the next slash with the updated validator - stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val).Times(1) + stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val, nil).Times(1) // increase block height ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 3) @@ -299,6 +308,7 @@ func TestCalculateRewardsAfterManySlashes(t *testing.T) { math.LegacyNewDecWithPrec(2, 1), &val, &distrKeeper, + stakingKeeper, ) require.True(t, slashedTokens.IsPositive(), "expected positive slashed tokens, got: %s", slashedTokens) @@ -338,6 +348,8 @@ func TestCalculateRewardsMultiDelegator(t *testing.T) { accountKeeper := distrtestutil.NewMockAccountKeeper(ctrl) accountKeeper.EXPECT().GetModuleAddress("distribution").Return(distrAcc.GetAddress()) + stakingKeeper.EXPECT().ValidatorAddressCodec().Return(address.NewBech32Codec(sdk.Bech32PrefixValAddr)).AnyTimes() + accountKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec(sdk.Bech32MainPrefix)).AnyTimes() distrKeeper := keeper.NewKeeper( encCfg.Codec, @@ -361,11 +373,11 @@ func TestCalculateRewardsMultiDelegator(t *testing.T) { val.Commission = stakingtypes.NewCommission(math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDec(0)) - del0 := stakingtypes.NewDelegation(addr0, valAddr, val.DelegatorShares) + del0 := stakingtypes.NewDelegation(addr0.String(), valAddr.String(), val.DelegatorShares) // set mock calls - stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val).Times(4) - stakingKeeper.EXPECT().Delegation(gomock.Any(), addr0, valAddr).Return(del0).Times(1) + stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val, nil).Times(4) + stakingKeeper.EXPECT().Delegation(gomock.Any(), addr0, valAddr).Return(del0, nil).Times(1) // run the necessary hooks manually (given that we are not running an actual staking module) err = distrtestutil.CallCreateValidatorHooks(ctx, distrKeeper, addr0, valAddr) @@ -381,11 +393,11 @@ func TestCalculateRewardsMultiDelegator(t *testing.T) { // second delegation addr1 := sdk.AccAddress(valConsAddr1) - _, del1, err := distrtestutil.Delegate(ctx, distrKeeper, addr1, &val, math.NewInt(100), nil) + _, del1, err := distrtestutil.Delegate(ctx, distrKeeper, addr1, &val, math.NewInt(100), nil, stakingKeeper) require.NoError(t, err) - stakingKeeper.EXPECT().Delegation(gomock.Any(), addr1, valAddr).Return(del1) - stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val).Times(1) + stakingKeeper.EXPECT().Delegation(gomock.Any(), addr1, valAddr).Return(del1, nil) + stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val, nil).Times(1) // call necessary hooks to update a delegation err = distrKeeper.Hooks().AfterDelegationModified(ctx, addr1, valAddr) @@ -433,6 +445,8 @@ func TestWithdrawDelegationRewardsBasic(t *testing.T) { accountKeeper := distrtestutil.NewMockAccountKeeper(ctrl) accountKeeper.EXPECT().GetModuleAddress("distribution").Return(distrAcc.GetAddress()) + stakingKeeper.EXPECT().ValidatorAddressCodec().Return(address.NewBech32Codec(sdk.Bech32PrefixValAddr)).AnyTimes() + accountKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec(sdk.Bech32MainPrefix)).AnyTimes() distrKeeper := keeper.NewKeeper( encCfg.Codec, @@ -457,9 +471,9 @@ func TestWithdrawDelegationRewardsBasic(t *testing.T) { val.Commission = stakingtypes.NewCommission(math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDec(0)) // delegation mock - del := stakingtypes.NewDelegation(addr, valAddr, val.DelegatorShares) - stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val).Times(5) - stakingKeeper.EXPECT().Delegation(gomock.Any(), addr, valAddr).Return(del).Times(3) + del := stakingtypes.NewDelegation(addr.String(), valAddr.String(), val.DelegatorShares) + stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val, nil).Times(5) + stakingKeeper.EXPECT().Delegation(gomock.Any(), addr, valAddr).Return(del, nil).Times(3) // run the necessary hooks manually (given that we are not running an actual staking module) err = distrtestutil.CallCreateValidatorHooks(ctx, distrKeeper, addr, valAddr) @@ -506,6 +520,8 @@ func TestCalculateRewardsAfterManySlashesInSameBlock(t *testing.T) { accountKeeper := distrtestutil.NewMockAccountKeeper(ctrl) accountKeeper.EXPECT().GetModuleAddress("distribution").Return(distrAcc.GetAddress()) + stakingKeeper.EXPECT().ValidatorAddressCodec().Return(address.NewBech32Codec(sdk.Bech32PrefixValAddr)).AnyTimes() + accountKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec(sdk.Bech32MainPrefix)).AnyTimes() distrKeeper := keeper.NewKeeper( encCfg.Codec, @@ -530,9 +546,9 @@ func TestCalculateRewardsAfterManySlashesInSameBlock(t *testing.T) { val.Commission = stakingtypes.NewCommission(math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDec(0)) // delegation mock - del := stakingtypes.NewDelegation(addr, valAddr, val.DelegatorShares) - stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val).Times(5) - stakingKeeper.EXPECT().Delegation(gomock.Any(), addr, valAddr).Return(del) + del := stakingtypes.NewDelegation(addr.String(), valAddr.String(), val.DelegatorShares) + stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val, nil).Times(5) + stakingKeeper.EXPECT().Delegation(gomock.Any(), addr, valAddr).Return(del, nil) // run the necessary hooks manually (given that we are not running an actual staking module) err = distrtestutil.CallCreateValidatorHooks(ctx, distrKeeper, addr, valAddr) @@ -569,6 +585,7 @@ func TestCalculateRewardsAfterManySlashesInSameBlock(t *testing.T) { math.LegacyNewDecWithPrec(5, 1), &val, &distrKeeper, + stakingKeeper, ) // slash the validator by 50% again @@ -581,6 +598,7 @@ func TestCalculateRewardsAfterManySlashesInSameBlock(t *testing.T) { math.LegacyNewDecWithPrec(5, 1), &val, &distrKeeper, + stakingKeeper, ) // increase block height @@ -618,6 +636,8 @@ func TestCalculateRewardsMultiDelegatorMultiSlash(t *testing.T) { accountKeeper := distrtestutil.NewMockAccountKeeper(ctrl) accountKeeper.EXPECT().GetModuleAddress("distribution").Return(distrAcc.GetAddress()) + stakingKeeper.EXPECT().ValidatorAddressCodec().Return(address.NewBech32Codec(sdk.Bech32PrefixValAddr)).AnyTimes() + accountKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec(sdk.Bech32MainPrefix)).AnyTimes() distrKeeper := keeper.NewKeeper( encCfg.Codec, @@ -643,14 +663,14 @@ func TestCalculateRewardsMultiDelegatorMultiSlash(t *testing.T) { val.Commission = stakingtypes.NewCommission(math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDec(0)) // validator and delegation mocks - del := stakingtypes.NewDelegation(addr, valAddr, val.DelegatorShares) - stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val).Times(3) - stakingKeeper.EXPECT().Delegation(gomock.Any(), addr, valAddr).Return(del) + del := stakingtypes.NewDelegation(addr.String(), valAddr.String(), val.DelegatorShares) + stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val, nil).Times(3) + stakingKeeper.EXPECT().Delegation(gomock.Any(), addr, valAddr).Return(del, nil) // run the necessary hooks manually (given that we are not running an actual staking module) err = distrtestutil.CallCreateValidatorHooks(ctx, distrKeeper, addr, valAddr) require.NoError(t, err) - stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val).Times(2) + stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val, nil).Times(2) // next block ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1) @@ -670,11 +690,12 @@ func TestCalculateRewardsMultiDelegatorMultiSlash(t *testing.T) { math.LegacyNewDecWithPrec(5, 1), &val, &distrKeeper, + stakingKeeper, ) ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 3) // update validator mock - stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val).Times(1) + stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val, nil).Times(1) // second delegation _, del2, err := distrtestutil.Delegate( @@ -684,12 +705,13 @@ func TestCalculateRewardsMultiDelegatorMultiSlash(t *testing.T) { &val, sdk.TokensFromConsensusPower(100, sdk.DefaultPowerReduction), nil, + stakingKeeper, ) require.NoError(t, err) // new delegation mock and update validator mock - stakingKeeper.EXPECT().Delegation(gomock.Any(), sdk.AccAddress(valConsAddr1), valAddr).Return(del2) - stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val).Times(1) + stakingKeeper.EXPECT().Delegation(gomock.Any(), sdk.AccAddress(valConsAddr1), valAddr).Return(del2, nil) + stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val, nil).Times(1) // call necessary hooks to update a delegation err = distrKeeper.Hooks().AfterDelegationModified(ctx, sdk.AccAddress(valConsAddr1), valAddr) @@ -711,6 +733,7 @@ func TestCalculateRewardsMultiDelegatorMultiSlash(t *testing.T) { math.LegacyNewDecWithPrec(5, 1), &val, &distrKeeper, + stakingKeeper, ) ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 3) @@ -750,6 +773,8 @@ func TestCalculateRewardsMultiDelegatorMultWithdraw(t *testing.T) { accountKeeper := distrtestutil.NewMockAccountKeeper(ctrl) accountKeeper.EXPECT().GetModuleAddress("distribution").Return(distrAcc.GetAddress()) + stakingKeeper.EXPECT().ValidatorAddressCodec().Return(address.NewBech32Codec(sdk.Bech32PrefixValAddr)).AnyTimes() + accountKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec(sdk.Bech32MainPrefix)).AnyTimes() distrKeeper := keeper.NewKeeper( encCfg.Codec, @@ -773,14 +798,14 @@ func TestCalculateRewardsMultiDelegatorMultWithdraw(t *testing.T) { val.Commission = stakingtypes.NewCommission(math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDec(0)) // validator and delegation mocks - del := stakingtypes.NewDelegation(addr, valAddr, val.DelegatorShares) - stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val).Times(3) - stakingKeeper.EXPECT().Delegation(gomock.Any(), addr, valAddr).Return(del).Times(5) + del := stakingtypes.NewDelegation(addr.String(), valAddr.String(), val.DelegatorShares) + stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val, nil).Times(3) + stakingKeeper.EXPECT().Delegation(gomock.Any(), addr, valAddr).Return(del, nil).Times(5) // run the necessary hooks manually (given that we are not running an actual staking module) err = distrtestutil.CallCreateValidatorHooks(ctx, distrKeeper, addr, valAddr) require.NoError(t, err) - stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val).Times(2) + stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val, nil).Times(2) // next block ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1) @@ -801,12 +826,13 @@ func TestCalculateRewardsMultiDelegatorMultWithdraw(t *testing.T) { &val, math.NewInt(100), nil, + stakingKeeper, ) require.NoError(t, err) // new delegation mock and update validator mock - stakingKeeper.EXPECT().Delegation(gomock.Any(), sdk.AccAddress(valConsAddr1), valAddr).Return(del2).Times(3) - stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val).Times(6) + stakingKeeper.EXPECT().Delegation(gomock.Any(), sdk.AccAddress(valConsAddr1), valAddr).Return(del2, nil).Times(3) + stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val, nil).Times(6) // call necessary hooks to update a delegation err = distrKeeper.Hooks().AfterDelegationModified(ctx, sdk.AccAddress(valConsAddr1), valAddr) @@ -946,6 +972,8 @@ func Test100PercentCommissionReward(t *testing.T) { accountKeeper := distrtestutil.NewMockAccountKeeper(ctrl) accountKeeper.EXPECT().GetModuleAddress("distribution").Return(distrAcc.GetAddress()) + stakingKeeper.EXPECT().ValidatorAddressCodec().Return(address.NewBech32Codec(sdk.Bech32PrefixValAddr)).AnyTimes() + accountKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec(sdk.Bech32MainPrefix)).AnyTimes() distrKeeper := keeper.NewKeeper( encCfg.Codec, @@ -969,14 +997,14 @@ func Test100PercentCommissionReward(t *testing.T) { val.Commission = stakingtypes.NewCommission(math.LegacyNewDecWithPrec(10, 1), math.LegacyNewDecWithPrec(10, 1), math.LegacyNewDec(0)) // validator and delegation mocks - del := stakingtypes.NewDelegation(addr, valAddr, val.DelegatorShares) - stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val).Times(3) - stakingKeeper.EXPECT().Delegation(gomock.Any(), addr, valAddr).Return(del).Times(3) + del := stakingtypes.NewDelegation(addr.String(), valAddr.String(), val.DelegatorShares) + stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val, nil).Times(3) + stakingKeeper.EXPECT().Delegation(gomock.Any(), addr, valAddr).Return(del, nil).Times(3) // run the necessary hooks manually (given that we are not running an actual staking module) err = distrtestutil.CallCreateValidatorHooks(ctx, distrKeeper, addr, valAddr) require.NoError(t, err) - stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val).Times(2) + stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val, nil).Times(2) // next block ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1) diff --git a/x/distribution/keeper/genesis.go b/x/distribution/keeper/genesis.go index 4ef2cb23fa2a..7d8fa26896b1 100644 --- a/x/distribution/keeper/genesis.go +++ b/x/distribution/keeper/genesis.go @@ -38,16 +38,18 @@ func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState) { var previousProposer sdk.ConsAddress if data.PreviousProposer != "" { var err error - previousProposer, err = sdk.ConsAddressFromBech32(data.PreviousProposer) + previousProposer, err = k.stakingKeeper.ConsensusAddressCodec().StringToBytes(data.PreviousProposer) if err != nil { panic(err) } } - k.SetPreviousProposerConsAddr(ctx, previousProposer) + if err = k.SetPreviousProposerConsAddr(ctx, previousProposer); err != nil { + panic(err) + } for _, rew := range data.OutstandingRewards { - valAddr, err := sdk.ValAddressFromBech32(rew.ValidatorAddress) + valAddr, err := k.stakingKeeper.ValidatorAddressCodec().StringToBytes(rew.ValidatorAddress) if err != nil { panic(err) } @@ -58,7 +60,7 @@ func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState) { moduleHoldings = moduleHoldings.Add(rew.OutstandingRewards...) } for _, acc := range data.ValidatorAccumulatedCommissions { - valAddr, err := sdk.ValAddressFromBech32(acc.ValidatorAddress) + valAddr, err := k.stakingKeeper.ValidatorAddressCodec().StringToBytes(acc.ValidatorAddress) if err != nil { panic(err) } @@ -68,7 +70,7 @@ func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState) { } } for _, his := range data.ValidatorHistoricalRewards { - valAddr, err := sdk.ValAddressFromBech32(his.ValidatorAddress) + valAddr, err := k.stakingKeeper.ValidatorAddressCodec().StringToBytes(his.ValidatorAddress) if err != nil { panic(err) } @@ -78,7 +80,7 @@ func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState) { } } for _, cur := range data.ValidatorCurrentRewards { - valAddr, err := sdk.ValAddressFromBech32(cur.ValidatorAddress) + valAddr, err := k.stakingKeeper.ValidatorAddressCodec().StringToBytes(cur.ValidatorAddress) if err != nil { panic(err) } @@ -88,7 +90,7 @@ func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState) { } } for _, del := range data.DelegatorStartingInfos { - valAddr, err := sdk.ValAddressFromBech32(del.ValidatorAddress) + valAddr, err := k.stakingKeeper.ValidatorAddressCodec().StringToBytes(del.ValidatorAddress) if err != nil { panic(err) } @@ -103,7 +105,7 @@ func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState) { } } for _, evt := range data.ValidatorSlashEvents { - valAddr, err := sdk.ValAddressFromBech32(evt.ValidatorAddress) + valAddr, err := k.stakingKeeper.ValidatorAddressCodec().StringToBytes(evt.ValidatorAddress) if err != nil { panic(err) } diff --git a/x/distribution/keeper/grpc_query.go b/x/distribution/keeper/grpc_query.go index c4f69aded672..b80ca323f8fc 100644 --- a/x/distribution/keeper/grpc_query.go +++ b/x/distribution/keeper/grpc_query.go @@ -27,8 +27,8 @@ func NewQuerier(keeper Keeper) Querier { } // Params queries params of distribution module -func (k Querier) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { - params, err := k.Keeper.Params.Get(c) +func (k Querier) Params(ctx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { + params, err := k.Keeper.Params.Get(ctx) if err != nil { return nil, err } @@ -37,7 +37,7 @@ func (k Querier) Params(c context.Context, req *types.QueryParamsRequest) (*type } // ValidatorDistributionInfo query validator's commission and self-delegation rewards -func (k Querier) ValidatorDistributionInfo(c context.Context, req *types.QueryValidatorDistributionInfoRequest) (*types.QueryValidatorDistributionInfoResponse, error) { +func (k Querier) ValidatorDistributionInfo(ctx context.Context, req *types.QueryValidatorDistributionInfoRequest) (*types.QueryValidatorDistributionInfoResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } @@ -46,22 +46,28 @@ func (k Querier) ValidatorDistributionInfo(c context.Context, req *types.QueryVa return nil, status.Error(codes.InvalidArgument, "empty validator address") } - ctx := sdk.UnwrapSDKContext(c) - - valAdr, err := sdk.ValAddressFromBech32(req.ValidatorAddress) + valAdr, err := k.stakingKeeper.ValidatorAddressCodec().StringToBytes(req.ValidatorAddress) if err != nil { return nil, err } // self-delegation rewards - val := k.stakingKeeper.Validator(ctx, valAdr) + val, err := k.stakingKeeper.Validator(ctx, valAdr) + if err != nil { + return nil, err + } + if val == nil { return nil, errors.Wrap(types.ErrNoValidatorExists, req.ValidatorAddress) } delAdr := sdk.AccAddress(valAdr) - del := k.stakingKeeper.Delegation(ctx, delAdr, valAdr) + del, err := k.stakingKeeper.Delegation(ctx, delAdr, valAdr) + if err != nil { + return nil, err + } + if del == nil { return nil, types.ErrNoDelegationExists } @@ -90,7 +96,7 @@ func (k Querier) ValidatorDistributionInfo(c context.Context, req *types.QueryVa } // ValidatorOutstandingRewards queries rewards of a validator address -func (k Querier) ValidatorOutstandingRewards(c context.Context, req *types.QueryValidatorOutstandingRewardsRequest) (*types.QueryValidatorOutstandingRewardsResponse, error) { +func (k Querier) ValidatorOutstandingRewards(ctx context.Context, req *types.QueryValidatorOutstandingRewardsRequest) (*types.QueryValidatorOutstandingRewardsResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } @@ -99,16 +105,18 @@ func (k Querier) ValidatorOutstandingRewards(c context.Context, req *types.Query return nil, status.Error(codes.InvalidArgument, "empty validator address") } - ctx := sdk.UnwrapSDKContext(c) + valAdr, err := k.stakingKeeper.ValidatorAddressCodec().StringToBytes(req.ValidatorAddress) + if err != nil { + return nil, err + } - valAdr, err := sdk.ValAddressFromBech32(req.ValidatorAddress) + validator, err := k.stakingKeeper.Validator(ctx, valAdr) if err != nil { return nil, err } - validator := k.stakingKeeper.Validator(ctx, valAdr) if validator == nil { - return nil, errors.Wrapf(types.ErrNoValidatorExists, valAdr.String()) + return nil, errors.Wrapf(types.ErrNoValidatorExists, req.ValidatorAddress) } rewards, err := k.GetValidatorOutstandingRewards(ctx, valAdr) @@ -120,7 +128,7 @@ func (k Querier) ValidatorOutstandingRewards(c context.Context, req *types.Query } // ValidatorCommission queries accumulated commission for a validator -func (k Querier) ValidatorCommission(c context.Context, req *types.QueryValidatorCommissionRequest) (*types.QueryValidatorCommissionResponse, error) { +func (k Querier) ValidatorCommission(ctx context.Context, req *types.QueryValidatorCommissionRequest) (*types.QueryValidatorCommissionResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } @@ -129,16 +137,18 @@ func (k Querier) ValidatorCommission(c context.Context, req *types.QueryValidato return nil, status.Error(codes.InvalidArgument, "empty validator address") } - ctx := sdk.UnwrapSDKContext(c) + valAdr, err := k.stakingKeeper.ValidatorAddressCodec().StringToBytes(req.ValidatorAddress) + if err != nil { + return nil, err + } - valAdr, err := sdk.ValAddressFromBech32(req.ValidatorAddress) + validator, err := k.stakingKeeper.Validator(ctx, valAdr) if err != nil { return nil, err } - validator := k.stakingKeeper.Validator(ctx, valAdr) if validator == nil { - return nil, errors.Wrapf(types.ErrNoValidatorExists, valAdr.String()) + return nil, errors.Wrapf(types.ErrNoValidatorExists, req.ValidatorAddress) } commission, err := k.GetValidatorAccumulatedCommission(ctx, valAdr) if err != nil { @@ -149,7 +159,7 @@ func (k Querier) ValidatorCommission(c context.Context, req *types.QueryValidato } // ValidatorSlashes queries slash events of a validator -func (k Querier) ValidatorSlashes(c context.Context, req *types.QueryValidatorSlashesRequest) (*types.QueryValidatorSlashesResponse, error) { +func (k Querier) ValidatorSlashes(ctx context.Context, req *types.QueryValidatorSlashesRequest) (*types.QueryValidatorSlashesResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } @@ -162,12 +172,12 @@ func (k Querier) ValidatorSlashes(c context.Context, req *types.QueryValidatorSl return nil, status.Errorf(codes.InvalidArgument, "starting height greater than ending height (%d > %d)", req.StartingHeight, req.EndingHeight) } - valAddr, err := sdk.ValAddressFromBech32(req.ValidatorAddress) + valAddr, err := k.stakingKeeper.ValidatorAddressCodec().StringToBytes(req.ValidatorAddress) if err != nil { return nil, status.Errorf(codes.InvalidArgument, "invalid validator address") } - store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(c)) + store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) slashesStore := prefix.NewStore(store, types.GetValidatorSlashEventPrefix(valAddr)) events, pageRes, err := query.GenericFilteredPaginate(k.cdc, slashesStore, req.Pagination, func(key []byte, result *types.ValidatorSlashEvent) (*types.ValidatorSlashEvent, error) { @@ -192,7 +202,7 @@ func (k Querier) ValidatorSlashes(c context.Context, req *types.QueryValidatorSl } // DelegationRewards the total rewards accrued by a delegation -func (k Querier) DelegationRewards(c context.Context, req *types.QueryDelegationRewardsRequest) (*types.QueryDelegationRewardsResponse, error) { +func (k Querier) DelegationRewards(ctx context.Context, req *types.QueryDelegationRewardsRequest) (*types.QueryDelegationRewardsResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } @@ -205,14 +215,16 @@ func (k Querier) DelegationRewards(c context.Context, req *types.QueryDelegation return nil, status.Error(codes.InvalidArgument, "empty validator address") } - ctx := sdk.UnwrapSDKContext(c) + valAdr, err := k.stakingKeeper.ValidatorAddressCodec().StringToBytes(req.ValidatorAddress) + if err != nil { + return nil, err + } - valAdr, err := sdk.ValAddressFromBech32(req.ValidatorAddress) + val, err := k.stakingKeeper.Validator(ctx, valAdr) if err != nil { return nil, err } - val := k.stakingKeeper.Validator(ctx, valAdr) if val == nil { return nil, errors.Wrap(types.ErrNoValidatorExists, req.ValidatorAddress) } @@ -221,7 +233,11 @@ func (k Querier) DelegationRewards(c context.Context, req *types.QueryDelegation if err != nil { return nil, err } - del := k.stakingKeeper.Delegation(ctx, delAdr, valAdr) + del, err := k.stakingKeeper.Delegation(ctx, delAdr, valAdr) + if err != nil { + return nil, err + } + if del == nil { return nil, types.ErrNoDelegationExists } @@ -240,7 +256,7 @@ func (k Querier) DelegationRewards(c context.Context, req *types.QueryDelegation } // DelegationTotalRewards the total rewards accrued by a each validator -func (k Querier) DelegationTotalRewards(c context.Context, req *types.QueryDelegationTotalRewardsRequest) (*types.QueryDelegationTotalRewardsResponse, error) { +func (k Querier) DelegationTotalRewards(ctx context.Context, req *types.QueryDelegationTotalRewardsRequest) (*types.QueryDelegationTotalRewardsResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } @@ -249,8 +265,6 @@ func (k Querier) DelegationTotalRewards(c context.Context, req *types.QueryDeleg return nil, status.Error(codes.InvalidArgument, "empty delegator address") } - ctx := sdk.UnwrapSDKContext(c) - total := sdk.DecCoins{} var delRewards []types.DelegationDelegatorReward @@ -259,11 +273,19 @@ func (k Querier) DelegationTotalRewards(c context.Context, req *types.QueryDeleg return nil, err } - k.stakingKeeper.IterateDelegations( + err = k.stakingKeeper.IterateDelegations( ctx, delAdr, func(_ int64, del stakingtypes.DelegationI) (stop bool) { - valAddr := del.GetValidatorAddr() - val := k.stakingKeeper.Validator(ctx, valAddr) + valAddr, err := k.stakingKeeper.ValidatorAddressCodec().StringToBytes(del.GetValidatorAddr()) + if err != nil { + panic(err) + } + + val, err := k.stakingKeeper.Validator(ctx, valAddr) + if err != nil { + panic(err) + } + endingPeriod, err := k.IncrementValidatorPeriod(ctx, val) if err != nil { panic(err) @@ -274,17 +296,20 @@ func (k Querier) DelegationTotalRewards(c context.Context, req *types.QueryDeleg panic(err) } - delRewards = append(delRewards, types.NewDelegationDelegatorReward(valAddr, delReward)) + delRewards = append(delRewards, types.NewDelegationDelegatorReward(del.GetValidatorAddr(), delReward)) total = total.Add(delReward...) return false }, ) + if err != nil { + return nil, err + } return &types.QueryDelegationTotalRewardsResponse{Rewards: delRewards, Total: total}, nil } // DelegatorValidators queries the validators list of a delegator -func (k Querier) DelegatorValidators(c context.Context, req *types.QueryDelegatorValidatorsRequest) (*types.QueryDelegatorValidatorsResponse, error) { +func (k Querier) DelegatorValidators(ctx context.Context, req *types.QueryDelegatorValidatorsRequest) (*types.QueryDelegatorValidatorsResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } @@ -293,26 +318,29 @@ func (k Querier) DelegatorValidators(c context.Context, req *types.QueryDelegato return nil, status.Error(codes.InvalidArgument, "empty delegator address") } - ctx := sdk.UnwrapSDKContext(c) delAdr, err := k.authKeeper.AddressCodec().StringToBytes(req.DelegatorAddress) if err != nil { return nil, err } var validators []string - k.stakingKeeper.IterateDelegations( + err = k.stakingKeeper.IterateDelegations( ctx, delAdr, func(_ int64, del stakingtypes.DelegationI) (stop bool) { - validators = append(validators, del.GetValidatorAddr().String()) + validators = append(validators, del.GetValidatorAddr()) return false }, ) + if err != nil { + return nil, err + } + return &types.QueryDelegatorValidatorsResponse{Validators: validators}, nil } // DelegatorWithdrawAddress queries Query/delegatorWithdrawAddress -func (k Querier) DelegatorWithdrawAddress(c context.Context, req *types.QueryDelegatorWithdrawAddressRequest) (*types.QueryDelegatorWithdrawAddressResponse, error) { +func (k Querier) DelegatorWithdrawAddress(ctx context.Context, req *types.QueryDelegatorWithdrawAddressRequest) (*types.QueryDelegatorWithdrawAddressResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } @@ -325,7 +353,7 @@ func (k Querier) DelegatorWithdrawAddress(c context.Context, req *types.QueryDel return nil, err } - withdrawAddr, err := k.GetDelegatorWithdrawAddr(c, delAdr) + withdrawAddr, err := k.GetDelegatorWithdrawAddr(ctx, delAdr) if err != nil { return nil, err } @@ -334,8 +362,8 @@ func (k Querier) DelegatorWithdrawAddress(c context.Context, req *types.QueryDel } // CommunityPool queries the community pool coins -func (k Querier) CommunityPool(c context.Context, req *types.QueryCommunityPoolRequest) (*types.QueryCommunityPoolResponse, error) { - pool, err := k.FeePool.Get(c) +func (k Querier) CommunityPool(ctx context.Context, req *types.QueryCommunityPoolRequest) (*types.QueryCommunityPoolResponse, error) { + pool, err := k.FeePool.Get(ctx) if err != nil { return nil, err } diff --git a/x/distribution/keeper/hooks.go b/x/distribution/keeper/hooks.go index 3c7fdd9092a6..006f35ed89a8 100644 --- a/x/distribution/keeper/hooks.go +++ b/x/distribution/keeper/hooks.go @@ -1,6 +1,8 @@ package keeper import ( + "context" + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" @@ -21,13 +23,16 @@ func (k Keeper) Hooks() Hooks { } // initialize validator distribution record -func (h Hooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) error { - val := h.k.stakingKeeper.Validator(ctx, valAddr) +func (h Hooks) AfterValidatorCreated(ctx context.Context, valAddr sdk.ValAddress) error { + val, err := h.k.stakingKeeper.Validator(ctx, valAddr) + if err != nil { + return err + } return h.k.initializeValidator(ctx, val) } // AfterValidatorRemoved performs clean up after a validator is removed -func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, _ sdk.ConsAddress, valAddr sdk.ValAddress) error { +func (h Hooks) AfterValidatorRemoved(ctx context.Context, _ sdk.ConsAddress, valAddr sdk.ValAddress) error { // fetch outstanding outstanding, err := h.k.GetValidatorOutstandingRewardsCoins(ctx, valAddr) if err != nil { @@ -117,16 +122,27 @@ func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, _ sdk.ConsAddress, valAddr } // increment period -func (h Hooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { - val := h.k.stakingKeeper.Validator(ctx, valAddr) - _, err := h.k.IncrementValidatorPeriod(ctx, val) +func (h Hooks) BeforeDelegationCreated(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { + val, err := h.k.stakingKeeper.Validator(ctx, valAddr) + if err != nil { + return err + } + + _, err = h.k.IncrementValidatorPeriod(ctx, val) return err } // withdraw delegation rewards (which also increments period) -func (h Hooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { - val := h.k.stakingKeeper.Validator(ctx, valAddr) - del := h.k.stakingKeeper.Delegation(ctx, delAddr, valAddr) +func (h Hooks) BeforeDelegationSharesModified(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { + val, err := h.k.stakingKeeper.Validator(ctx, valAddr) + if err != nil { + return err + } + + del, err := h.k.stakingKeeper.Delegation(ctx, delAddr, valAddr) + if err != nil { + return err + } if _, err := h.k.withdrawDelegationRewards(ctx, val, del); err != nil { return err @@ -136,32 +152,31 @@ func (h Hooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAd } // create new delegation period record -func (h Hooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { +func (h Hooks) AfterDelegationModified(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { return h.k.initializeDelegation(ctx, valAddr, delAddr) } // record the slash event -func (h Hooks) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdkmath.LegacyDec) error { - h.k.updateValidatorSlashFraction(ctx, valAddr, fraction) - return nil +func (h Hooks) BeforeValidatorSlashed(ctx context.Context, valAddr sdk.ValAddress, fraction sdkmath.LegacyDec) error { + return h.k.updateValidatorSlashFraction(ctx, valAddr, fraction) } -func (h Hooks) BeforeValidatorModified(_ sdk.Context, _ sdk.ValAddress) error { +func (h Hooks) BeforeValidatorModified(_ context.Context, _ sdk.ValAddress) error { return nil } -func (h Hooks) AfterValidatorBonded(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error { +func (h Hooks) AfterValidatorBonded(_ context.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error { return nil } -func (h Hooks) AfterValidatorBeginUnbonding(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error { +func (h Hooks) AfterValidatorBeginUnbonding(_ context.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error { return nil } -func (h Hooks) BeforeDelegationRemoved(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error { +func (h Hooks) BeforeDelegationRemoved(_ context.Context, _ sdk.AccAddress, _ sdk.ValAddress) error { return nil } -func (h Hooks) AfterUnbondingInitiated(_ sdk.Context, _ uint64) error { +func (h Hooks) AfterUnbondingInitiated(_ context.Context, _ uint64) error { return nil } diff --git a/x/distribution/keeper/invariants.go b/x/distribution/keeper/invariants.go deleted file mode 100644 index 2750f9dd8b34..000000000000 --- a/x/distribution/keeper/invariants.go +++ /dev/null @@ -1,168 +0,0 @@ -package keeper - -import ( - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/distribution/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" -) - -// register all distribution invariants -func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper) { - ir.RegisterRoute(types.ModuleName, "nonnegative-outstanding", - NonNegativeOutstandingInvariant(k)) - ir.RegisterRoute(types.ModuleName, "can-withdraw", - CanWithdrawInvariant(k)) - ir.RegisterRoute(types.ModuleName, "reference-count", - ReferenceCountInvariant(k)) - ir.RegisterRoute(types.ModuleName, "module-account", - ModuleAccountInvariant(k)) -} - -// AllInvariants runs all invariants of the distribution module -func AllInvariants(k Keeper) sdk.Invariant { - return func(ctx sdk.Context) (string, bool) { - res, stop := CanWithdrawInvariant(k)(ctx) - if stop { - return res, stop - } - res, stop = NonNegativeOutstandingInvariant(k)(ctx) - if stop { - return res, stop - } - res, stop = ReferenceCountInvariant(k)(ctx) - if stop { - return res, stop - } - return ModuleAccountInvariant(k)(ctx) - } -} - -// NonNegativeOutstandingInvariant checks that outstanding unwithdrawn fees are never negative -func NonNegativeOutstandingInvariant(k Keeper) sdk.Invariant { - return func(ctx sdk.Context) (string, bool) { - var msg string - var count int - var outstanding sdk.DecCoins - - k.IterateValidatorOutstandingRewards(ctx, func(addr sdk.ValAddress, rewards types.ValidatorOutstandingRewards) (stop bool) { - outstanding = rewards.GetRewards() - if outstanding.IsAnyNegative() { - count++ - msg += fmt.Sprintf("\t%v has negative outstanding coins: %v\n", addr, outstanding) - } - return false - }) - broken := count != 0 - - return sdk.FormatInvariant(types.ModuleName, "nonnegative outstanding", - fmt.Sprintf("found %d validators with negative outstanding rewards\n%s", count, msg)), broken - } -} - -// CanWithdrawInvariant checks that current rewards can be completely withdrawn -func CanWithdrawInvariant(k Keeper) sdk.Invariant { - return func(ctx sdk.Context) (string, bool) { - // cache, we don't want to write changes - ctx, _ = ctx.CacheContext() - - var remaining sdk.DecCoins - - valDelegationAddrs := make(map[string][]sdk.AccAddress) - for _, del := range k.stakingKeeper.GetAllSDKDelegations(ctx) { - valAddr := del.GetValidatorAddr().String() - valDelegationAddrs[valAddr] = append(valDelegationAddrs[valAddr], del.GetDelegatorAddr()) - } - - // iterate over all validators - k.stakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { - _, _ = k.WithdrawValidatorCommission(ctx, val.GetOperator()) - - delegationAddrs, ok := valDelegationAddrs[val.GetOperator().String()] - if ok { - for _, delAddr := range delegationAddrs { - if _, err := k.WithdrawDelegationRewards(ctx, delAddr, val.GetOperator()); err != nil { - panic(err) - } - } - } - - var err error - remaining, err = k.GetValidatorOutstandingRewardsCoins(ctx, val.GetOperator()) - if err != nil { - panic(err) - } - - if len(remaining) > 0 && remaining[0].Amount.IsNegative() { - return true - } - - return false - }) - - broken := len(remaining) > 0 && remaining[0].Amount.IsNegative() - return sdk.FormatInvariant(types.ModuleName, "can withdraw", - fmt.Sprintf("remaining coins: %v\n", remaining)), broken - } -} - -// ReferenceCountInvariant checks that the number of historical rewards records is correct -func ReferenceCountInvariant(k Keeper) sdk.Invariant { - return func(ctx sdk.Context) (string, bool) { - valCount := uint64(0) - k.stakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { - valCount++ - return false - }) - dels := k.stakingKeeper.GetAllSDKDelegations(ctx) - slashCount := uint64(0) - k.IterateValidatorSlashEvents(ctx, - func(_ sdk.ValAddress, _ uint64, _ types.ValidatorSlashEvent) (stop bool) { - slashCount++ - return false - }) - - // one record per validator (last tracked period), one record per - // delegation (previous period), one record per slash (previous period) - expected := valCount + uint64(len(dels)) + slashCount - count := k.GetValidatorHistoricalReferenceCount(ctx) - broken := count != expected - - return sdk.FormatInvariant(types.ModuleName, "reference count", - fmt.Sprintf("expected historical reference count: %d = %v validators + %v delegations + %v slashes\n"+ - "total validator historical reference count: %d\n", - expected, valCount, len(dels), slashCount, count)), broken - } -} - -// ModuleAccountInvariant checks that the coins held by the distr ModuleAccount -// is consistent with the sum of validator outstanding rewards -func ModuleAccountInvariant(k Keeper) sdk.Invariant { - return func(ctx sdk.Context) (string, bool) { - var expectedCoins sdk.DecCoins - k.IterateValidatorOutstandingRewards(ctx, func(_ sdk.ValAddress, rewards types.ValidatorOutstandingRewards) (stop bool) { - expectedCoins = expectedCoins.Add(rewards.Rewards...) - return false - }) - - communityPool, err := k.FeePool.Get(ctx) - if err != nil { - panic(err) - } - - expectedInt, _ := expectedCoins.Add(communityPool.CommunityPool...).TruncateDecimal() - - macc := k.GetDistributionAccount(ctx) - balances := k.bankKeeper.GetAllBalances(ctx, macc.GetAddress()) - - broken := !balances.Equal(expectedInt) - return sdk.FormatInvariant( - types.ModuleName, "ModuleAccount coins", - fmt.Sprintf("\texpected ModuleAccount coins: %s\n"+ - "\tdistribution ModuleAccount coins: %s\n", - expectedInt, balances, - ), - ), broken - } -} diff --git a/x/distribution/keeper/keeper.go b/x/distribution/keeper/keeper.go index 3f6c2a73d425..7bea2017a1b9 100644 --- a/x/distribution/keeper/keeper.go +++ b/x/distribution/keeper/keeper.go @@ -105,25 +105,32 @@ func (k Keeper) SetWithdrawAddr(ctx context.Context, delegatorAddr, withdrawAddr // withdraw rewards from a delegation func (k Keeper) WithdrawDelegationRewards(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (sdk.Coins, error) { - sdkCtx := sdk.UnwrapSDKContext(ctx) - val := k.stakingKeeper.Validator(sdkCtx, valAddr) + val, err := k.stakingKeeper.Validator(ctx, valAddr) + if err != nil { + return nil, err + } + if val == nil { return nil, types.ErrNoValidatorDistInfo } - del := k.stakingKeeper.Delegation(sdkCtx, delAddr, valAddr) + del, err := k.stakingKeeper.Delegation(ctx, delAddr, valAddr) + if err != nil { + return nil, err + } + if del == nil { return nil, types.ErrEmptyDelegationDistInfo } // withdraw rewards - rewards, err := k.withdrawDelegationRewards(sdkCtx, val, del) + rewards, err := k.withdrawDelegationRewards(ctx, val, del) if err != nil { return nil, err } // reinitialize the delegation - err = k.initializeDelegation(sdkCtx, valAddr, delAddr) + err = k.initializeDelegation(ctx, valAddr, delAddr) if err != nil { return nil, err } diff --git a/x/distribution/keeper/keeper_test.go b/x/distribution/keeper/keeper_test.go index 76cbf3eb2cbb..1abbef8740c4 100644 --- a/x/distribution/keeper/keeper_test.go +++ b/x/distribution/keeper/keeper_test.go @@ -4,11 +4,11 @@ import ( "testing" "time" - "cosmossdk.io/math" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" + "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/runtime" diff --git a/x/distribution/keeper/msg_server.go b/x/distribution/keeper/msg_server.go index e2b5e737d1dd..1f4c64e0eb3f 100644 --- a/x/distribution/keeper/msg_server.go +++ b/x/distribution/keeper/msg_server.go @@ -3,8 +3,9 @@ package keeper import ( "context" + "github.com/hashicorp/go-metrics" + "cosmossdk.io/errors" - "github.com/armon/go-metrics" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" @@ -45,7 +46,7 @@ func (k msgServer) SetWithdrawAddress(ctx context.Context, msg *types.MsgSetWith } func (k msgServer) WithdrawDelegatorReward(ctx context.Context, msg *types.MsgWithdrawDelegatorReward) (*types.MsgWithdrawDelegatorRewardResponse, error) { - valAddr, err := sdk.ValAddressFromBech32(msg.ValidatorAddress) + valAddr, err := k.stakingKeeper.ValidatorAddressCodec().StringToBytes(msg.ValidatorAddress) if err != nil { return nil, sdkerrors.ErrInvalidAddress.Wrapf("invalid validator address: %s", err) } @@ -76,7 +77,7 @@ func (k msgServer) WithdrawDelegatorReward(ctx context.Context, msg *types.MsgWi } func (k msgServer) WithdrawValidatorCommission(ctx context.Context, msg *types.MsgWithdrawValidatorCommission) (*types.MsgWithdrawValidatorCommissionResponse, error) { - valAddr, err := sdk.ValAddressFromBech32(msg.ValidatorAddress) + valAddr, err := k.stakingKeeper.ValidatorAddressCodec().StringToBytes(msg.ValidatorAddress) if err != nil { return nil, sdkerrors.ErrInvalidAddress.Wrapf("invalid validator address: %s", err) } @@ -178,21 +179,26 @@ func (k msgServer) DepositValidatorRewardsPool(ctx context.Context, msg *types.M return nil, err } - valAddr, err := sdk.ValAddressFromBech32(msg.ValidatorAddress) + valAddr, err := k.stakingKeeper.ValidatorAddressCodec().StringToBytes(msg.ValidatorAddress) + if err != nil { + return nil, err + } + + validator, err := k.stakingKeeper.Validator(ctx, valAddr) if err != nil { return nil, err } - sdkCtx := sdk.UnwrapSDKContext(ctx) - validator := k.stakingKeeper.Validator(sdkCtx, valAddr) if validator == nil { - return nil, errors.Wrapf(types.ErrNoValidatorExists, valAddr.String()) + return nil, errors.Wrapf(types.ErrNoValidatorExists, msg.ValidatorAddress) } // Allocate tokens from the distribution module to the validator, which are // then distributed to the validator's delegators. reward := sdk.NewDecCoinsFromCoins(msg.Amount...) - k.AllocateTokensToValidator(ctx, validator, reward) + if err = k.AllocateTokensToValidator(ctx, validator, reward); err != nil { + return nil, err + } logger := k.Logger(ctx) logger.Info( diff --git a/x/distribution/keeper/store.go b/x/distribution/keeper/store.go index c5b9132dbaa0..6ba127910018 100644 --- a/x/distribution/keeper/store.go +++ b/x/distribution/keeper/store.go @@ -72,10 +72,10 @@ func (k Keeper) GetPreviousProposerConsAddr(ctx context.Context) (sdk.ConsAddres } // set the proposer public key for this block -func (k Keeper) SetPreviousProposerConsAddr(ctx context.Context, consAddr sdk.ConsAddress) { +func (k Keeper) SetPreviousProposerConsAddr(ctx context.Context, consAddr sdk.ConsAddress) error { store := k.storeService.OpenKVStore(ctx) bz := k.cdc.MustMarshal(&gogotypes.BytesValue{Value: consAddr}) - store.Set(types.ProposerKey, bz) + return store.Set(types.ProposerKey, bz) } // get the starting info associated with a delegator diff --git a/x/distribution/keeper/validator.go b/x/distribution/keeper/validator.go index 7d17cebec0e9..5ef0395a2ef5 100644 --- a/x/distribution/keeper/validator.go +++ b/x/distribution/keeper/validator.go @@ -7,40 +7,48 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/distribution/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) // initialize rewards for a new validator func (k Keeper) initializeValidator(ctx context.Context, val stakingtypes.ValidatorI) error { + valBz, err := k.stakingKeeper.ValidatorAddressCodec().StringToBytes(val.GetOperator()) + if err != nil { + return err + } // set initial historical rewards (period 0) with reference count of 1 - err := k.SetValidatorHistoricalRewards(ctx, val.GetOperator(), 0, types.NewValidatorHistoricalRewards(sdk.DecCoins{}, 1)) + err = k.SetValidatorHistoricalRewards(ctx, valBz, 0, types.NewValidatorHistoricalRewards(sdk.DecCoins{}, 1)) if err != nil { return err } // set current rewards (starting at period 1) - err = k.SetValidatorCurrentRewards(ctx, val.GetOperator(), types.NewValidatorCurrentRewards(sdk.DecCoins{}, 1)) + err = k.SetValidatorCurrentRewards(ctx, valBz, types.NewValidatorCurrentRewards(sdk.DecCoins{}, 1)) if err != nil { return err } // set accumulated commission - err = k.SetValidatorAccumulatedCommission(ctx, val.GetOperator(), types.InitialValidatorAccumulatedCommission()) + err = k.SetValidatorAccumulatedCommission(ctx, valBz, types.InitialValidatorAccumulatedCommission()) if err != nil { return err } // set outstanding rewards - err = k.SetValidatorOutstandingRewards(ctx, val.GetOperator(), types.ValidatorOutstandingRewards{Rewards: sdk.DecCoins{}}) + err = k.SetValidatorOutstandingRewards(ctx, valBz, types.ValidatorOutstandingRewards{Rewards: sdk.DecCoins{}}) return err } // increment validator period, returning the period just ended func (k Keeper) IncrementValidatorPeriod(ctx context.Context, val stakingtypes.ValidatorI) (uint64, error) { + valBz, err := k.stakingKeeper.ValidatorAddressCodec().StringToBytes(val.GetOperator()) + if err != nil { + return 0, err + } + // fetch current rewards - rewards, err := k.GetValidatorCurrentRewards(ctx, val.GetOperator()) + rewards, err := k.GetValidatorCurrentRewards(ctx, valBz) if err != nil { return 0, err } @@ -56,7 +64,7 @@ func (k Keeper) IncrementValidatorPeriod(ctx context.Context, val stakingtypes.V return 0, err } - outstanding, err := k.GetValidatorOutstandingRewards(ctx, val.GetOperator()) + outstanding, err := k.GetValidatorOutstandingRewards(ctx, valBz) if err != nil { return 0, err } @@ -68,7 +76,7 @@ func (k Keeper) IncrementValidatorPeriod(ctx context.Context, val stakingtypes.V return 0, err } - err = k.SetValidatorOutstandingRewards(ctx, val.GetOperator(), outstanding) + err = k.SetValidatorOutstandingRewards(ctx, valBz, outstanding) if err != nil { return 0, err } @@ -80,7 +88,7 @@ func (k Keeper) IncrementValidatorPeriod(ctx context.Context, val stakingtypes.V } // fetch historical rewards for last period - historical, err := k.GetValidatorHistoricalRewards(ctx, val.GetOperator(), rewards.Period-1) + historical, err := k.GetValidatorHistoricalRewards(ctx, valBz, rewards.Period-1) if err != nil { return 0, err } @@ -88,19 +96,19 @@ func (k Keeper) IncrementValidatorPeriod(ctx context.Context, val stakingtypes.V cumRewardRatio := historical.CumulativeRewardRatio // decrement reference count - err = k.decrementReferenceCount(ctx, val.GetOperator(), rewards.Period-1) + err = k.decrementReferenceCount(ctx, valBz, rewards.Period-1) if err != nil { return 0, err } // set new historical rewards with reference count of 1 - err = k.SetValidatorHistoricalRewards(ctx, val.GetOperator(), rewards.Period, types.NewValidatorHistoricalRewards(cumRewardRatio.Add(current...), 1)) + err = k.SetValidatorHistoricalRewards(ctx, valBz, rewards.Period, types.NewValidatorHistoricalRewards(cumRewardRatio.Add(current...), 1)) if err != nil { return 0, err } // set current rewards, incrementing period by 1 - err = k.SetValidatorCurrentRewards(ctx, val.GetOperator(), types.NewValidatorCurrentRewards(sdk.DecCoins{}, rewards.Period+1)) + err = k.SetValidatorCurrentRewards(ctx, valBz, types.NewValidatorCurrentRewards(sdk.DecCoins{}, rewards.Period+1)) if err != nil { return 0, err } @@ -114,10 +122,12 @@ func (k Keeper) incrementReferenceCount(ctx context.Context, valAddr sdk.ValAddr if err != nil { return err } + + historical.ReferenceCount++ if historical.ReferenceCount > 2 { panic("reference count should never exceed 2") } - historical.ReferenceCount++ + return k.SetValidatorHistoricalRewards(ctx, valAddr, period, historical) } @@ -139,13 +149,16 @@ func (k Keeper) decrementReferenceCount(ctx context.Context, valAddr sdk.ValAddr return k.SetValidatorHistoricalRewards(ctx, valAddr, period, historical) } -func (k Keeper) updateValidatorSlashFraction(ctx context.Context, valAddr sdk.ValAddress, fraction sdk.Dec) error { +func (k Keeper) updateValidatorSlashFraction(ctx context.Context, valAddr sdk.ValAddress, fraction math.LegacyDec) error { if fraction.GT(math.LegacyOneDec()) || fraction.IsNegative() { panic(fmt.Sprintf("fraction must be >=0 and <=1, current fraction: %v", fraction)) } sdkCtx := sdk.UnwrapSDKContext(ctx) - val := k.stakingKeeper.Validator(sdkCtx, valAddr) + val, err := k.stakingKeeper.Validator(ctx, valAddr) + if err != nil { + return err + } // increment current period newPeriod, err := k.IncrementValidatorPeriod(ctx, val) diff --git a/x/distribution/migrations/v3/json.go b/x/distribution/migrations/v3/json.go index b4d07b9965cc..e384b4869307 100644 --- a/x/distribution/migrations/v3/json.go +++ b/x/distribution/migrations/v3/json.go @@ -2,6 +2,7 @@ package v3 import ( sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/x/distribution/types" ) diff --git a/x/distribution/migrations/v3/json_test.go b/x/distribution/migrations/v3/json_test.go index 09fa98d97e3d..8fba6cf9ee6d 100644 --- a/x/distribution/migrations/v3/json_test.go +++ b/x/distribution/migrations/v3/json_test.go @@ -4,9 +4,10 @@ import ( "encoding/json" "testing" - sdkmath "cosmossdk.io/math" "github.com/stretchr/testify/require" + sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/client" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" "github.com/cosmos/cosmos-sdk/x/distribution" diff --git a/x/distribution/migrations/v3/migrate.go b/x/distribution/migrations/v3/migrate.go index 441c9fb590d0..5f59b59566b8 100644 --- a/x/distribution/migrations/v3/migrate.go +++ b/x/distribution/migrations/v3/migrate.go @@ -2,7 +2,6 @@ package v3 import ( "cosmossdk.io/core/store" - sdkmath "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/codec" diff --git a/x/distribution/module.go b/x/distribution/module.go index 2680181edd75..ed0461ef6920 100644 --- a/x/distribution/module.go +++ b/x/distribution/module.go @@ -5,16 +5,14 @@ import ( "encoding/json" "fmt" - abci "github.com/cometbft/cometbft/abci/types" gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" modulev1 "cosmossdk.io/api/cosmos/distribution/module/v1" "cosmossdk.io/core/address" "cosmossdk.io/core/appmodule" - "cosmossdk.io/depinject" - "cosmossdk.io/core/store" + "cosmossdk.io/depinject" sdkclient "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" @@ -36,8 +34,14 @@ import ( const ConsensusVersion = 3 var ( - _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleBasic = AppModule{} _ module.AppModuleSimulation = AppModule{} + _ module.HasGenesis = AppModule{} + _ module.HasServices = AppModule{} + _ module.HasInvariants = AppModule{} + + _ appmodule.AppModule = AppModule{} + _ appmodule.HasBeginBlocker = AppModule{} ) // AppModuleBasic defines the basic application module used by the distribution module. @@ -63,7 +67,7 @@ func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { } // ValidateGenesis performs genesis state validation for the distribution module. -func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config sdkclient.TxEncodingConfig, bz json.RawMessage) error { +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ sdkclient.TxEncodingConfig, bz json.RawMessage) error { var data types.GenesisState if err := cdc.UnmarshalJSON(bz, &data); err != nil { return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) @@ -81,12 +85,7 @@ func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx sdkclient.Context, mux // GetTxCmd returns the root tx command for the distribution module. func (ab AppModuleBasic) GetTxCmd() *cobra.Command { - return cli.NewTxCmd(ab.ac) -} - -// GetQueryCmd returns the root query command for the distribution module. -func (ab AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd(ab.ac) + return cli.NewTxCmd(ab.cdc.InterfaceRegistry().SigningContext().ValidatorAddressCodec(), ab.cdc.InterfaceRegistry().SigningContext().AddressCodec()) } // RegisterInterfaces implements InterfaceModule @@ -122,26 +121,14 @@ func NewAppModule( } } -var ( - _ appmodule.AppModule = AppModule{} - _ appmodule.HasBeginBlocker = AppModule{} -) - // IsOnePerModuleType implements the depinject.OnePerModuleType interface. func (am AppModule) IsOnePerModuleType() {} // IsAppModule implements the appmodule.AppModule interface. func (am AppModule) IsAppModule() {} -// Name returns the distribution module's name. -func (AppModule) Name() string { - return types.ModuleName -} - -// RegisterInvariants registers the distribution module invariants. -func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) { - keeper.RegisterInvariants(ir, am.keeper) -} +// RegisterInvariants is deprecated and will be removed in the next Cosmos SDK release. +func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} // RegisterServices registers module services. func (am AppModule) RegisterServices(cfg module.Configurator) { @@ -160,11 +147,10 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { // InitGenesis performs genesis initialization for the distribution module. It returns // no validator updates. -func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate { +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) { var genesisState types.GenesisState cdc.MustUnmarshalJSON(data, &genesisState) am.keeper.InitGenesis(ctx, genesisState) - return []abci.ValidatorUpdate{} } // ExportGenesis returns the exported genesis state as raw bytes for the distribution @@ -191,7 +177,7 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { } // ProposalMsgs returns msgs used for governance proposals for simulations. -func (AppModule) ProposalMsgs(simState module.SimulationState) []simtypes.WeightedProposalMsg { +func (AppModule) ProposalMsgs(_ module.SimulationState) []simtypes.WeightedProposalMsg { return simulation.ProposalMsgs() } diff --git a/x/distribution/simulation/decoder_test.go b/x/distribution/simulation/decoder_test.go index 9d599213a436..773208143f08 100644 --- a/x/distribution/simulation/decoder_test.go +++ b/x/distribution/simulation/decoder_test.go @@ -7,6 +7,7 @@ import ( "github.com/stretchr/testify/require" "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/kv" diff --git a/x/distribution/simulation/genesis_test.go b/x/distribution/simulation/genesis_test.go index 1531577610ba..62e26f451503 100644 --- a/x/distribution/simulation/genesis_test.go +++ b/x/distribution/simulation/genesis_test.go @@ -8,6 +8,7 @@ import ( "github.com/stretchr/testify/require" sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/types/module" diff --git a/x/distribution/simulation/operations.go b/x/distribution/simulation/operations.go index 8de9fe1ce55e..4fff81489e91 100644 --- a/x/distribution/simulation/operations.go +++ b/x/distribution/simulation/operations.go @@ -1,9 +1,12 @@ package simulation import ( + "errors" "fmt" "math/rand" + "cosmossdk.io/collections" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" @@ -124,14 +127,24 @@ func SimulateMsgWithdrawDelegatorReward(txConfig client.TxConfig, ak types.Accou r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { simAccount, _ := simtypes.RandomAcc(r, accs) - delegations := sk.GetAllDelegatorDelegations(ctx, simAccount.Address) + delegations, err := sk.GetAllDelegatorDelegations(ctx, simAccount.Address) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, sdk.MsgTypeURL(&types.MsgWithdrawDelegatorReward{}), "error getting delegations"), nil, err + } if len(delegations) == 0 { return simtypes.NoOpMsg(types.ModuleName, sdk.MsgTypeURL(&types.MsgWithdrawDelegatorReward{}), "number of delegators equal 0"), nil, nil } delegation := delegations[r.Intn(len(delegations))] - validator := sk.Validator(ctx, delegation.GetValidatorAddr()) + delAddr, err := sk.ValidatorAddressCodec().StringToBytes(delegation.GetValidatorAddr()) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, sdk.MsgTypeURL(&types.MsgWithdrawDelegatorReward{}), "error converting validator address"), nil, err + } + validator, err := sk.Validator(ctx, delAddr) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, sdk.MsgTypeURL(&types.MsgWithdrawDelegatorReward{}), "error getting validator"), nil, err + } if validator == nil { return simtypes.NoOpMsg(types.ModuleName, sdk.MsgTypeURL(&types.MsgWithdrawDelegatorReward{}), "validator is nil"), nil, fmt.Errorf("validator %s not found", delegation.GetValidatorAddr()) } @@ -139,7 +152,7 @@ func SimulateMsgWithdrawDelegatorReward(txConfig client.TxConfig, ak types.Accou account := ak.GetAccount(ctx, simAccount.Address) spendable := bk.SpendableCoins(ctx, account.GetAddress()) - msg := types.NewMsgWithdrawDelegatorReward(simAccount.Address, validator.GetOperator()) + msg := types.NewMsgWithdrawDelegatorReward(simAccount.Address.String(), validator.GetOperator()) txCtx := simulation.OperationInput{ R: r, @@ -166,13 +179,24 @@ func SimulateMsgWithdrawValidatorCommission(txConfig client.TxConfig, ak types.A ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { msgType := sdk.MsgTypeURL(&types.MsgWithdrawValidatorCommission{}) - validator, ok := testutil.RandSliceElem(r, sk.GetAllValidators(ctx)) + allVals, err := sk.GetAllValidators(ctx) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msgType, "error getting all validators"), nil, err + } + + validator, ok := testutil.RandSliceElem(r, allVals) if !ok { return simtypes.NoOpMsg(types.ModuleName, msgType, "random validator is not ok"), nil, nil } - commission, err := k.GetValidatorAccumulatedCommission(ctx, validator.GetOperator()) + valBz, err := sk.ValidatorAddressCodec().StringToBytes(validator.GetOperator()) if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msgType, "error converting validator address"), nil, err + } + + commission, err := k.GetValidatorAccumulatedCommission(ctx, valBz) + + if err != nil && !errors.Is(err, collections.ErrNotFound) { return simtypes.NoOpMsg(types.ModuleName, msgType, "error getting validator commission"), nil, err } @@ -180,7 +204,7 @@ func SimulateMsgWithdrawValidatorCommission(txConfig client.TxConfig, ak types.A return simtypes.NoOpMsg(types.ModuleName, msgType, "validator commission is zero"), nil, nil } - simAccount, found := simtypes.FindAccount(accs, sdk.AccAddress(validator.GetOperator())) + simAccount, found := simtypes.FindAccount(accs, sdk.AccAddress(valBz)) if !found { return simtypes.NoOpMsg(types.ModuleName, msgType, "could not find account"), nil, fmt.Errorf("validator %s not found", validator.GetOperator()) } @@ -237,7 +261,7 @@ func SimulateMsgFundCommunityPool(txConfig client.TxConfig, ak types.AccountKeep } } - msg := types.NewMsgFundCommunityPool(fundAmount, funder.Address) + msg := types.NewMsgFundCommunityPool(fundAmount, funder.Address.String()) txCtx := simulation.OperationInput{ R: r, diff --git a/x/distribution/simulation/operations_test.go b/x/distribution/simulation/operations_test.go index 256a633ffb3d..69c5726a0638 100644 --- a/x/distribution/simulation/operations_test.go +++ b/x/distribution/simulation/operations_test.go @@ -4,15 +4,17 @@ import ( "math/rand" "testing" - "cosmossdk.io/depinject" - "cosmossdk.io/log" - "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/gogoproto/proto" "github.com/stretchr/testify/suite" + "cosmossdk.io/depinject" + "cosmossdk.io/log" + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/runtime" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" @@ -108,16 +110,20 @@ func (suite *SimTestSuite) TestSimulateMsgWithdrawDelegatorReward() { delTokens := sdk.TokensFromConsensusPower(2, sdk.DefaultPowerReduction) validator0, issuedShares := validator0.AddTokensFromDel(delTokens) delegator := accounts[1] - delegation := stakingtypes.NewDelegation(delegator.Address, validator0.GetOperator(), issuedShares) - suite.stakingKeeper.SetDelegation(suite.ctx, delegation) - suite.distrKeeper.SetDelegatorStartingInfo(suite.ctx, validator0.GetOperator(), delegator.Address, types.NewDelegatorStartingInfo(2, math.LegacyOneDec(), 200)) - suite.setupValidatorRewards(validator0.GetOperator()) + delegation := stakingtypes.NewDelegation(delegator.Address.String(), validator0.GetOperator(), issuedShares) + suite.Require().NoError(suite.stakingKeeper.SetDelegation(suite.ctx, delegation)) + valBz, err := address.NewBech32Codec("cosmosvaloper").StringToBytes(validator0.GetOperator()) + suite.Require().NoError(err) + suite.distrKeeper.SetDelegatorStartingInfo(suite.ctx, valBz, delegator.Address, types.NewDelegatorStartingInfo(2, math.LegacyOneDec(), 200)) - suite.app.FinalizeBlock(&abci.RequestFinalizeBlock{ + suite.setupValidatorRewards(valBz) + + _, err = suite.app.FinalizeBlock(&abci.RequestFinalizeBlock{ Height: suite.app.LastBlockHeight() + 1, Hash: suite.app.LastCommitID().Hash, }) + suite.Require().NoError(err) // execute operation op := simulation.SimulateMsgWithdrawDelegatorReward(suite.txConfig, suite.accountKeeper, suite.bankKeeper, suite.distrKeeper, suite.stakingKeeper) @@ -165,18 +171,26 @@ func (suite *SimTestSuite) testSimulateMsgWithdrawValidatorCommission(tokenName sdk.NewDecCoinFromDec(tokenName, math.LegacyNewDec(5).Quo(math.LegacyNewDec(2))), sdk.NewDecCoinFromDec("stake", math.LegacyNewDec(1).Quo(math.LegacyNewDec(1))), ) + valCodec := address.NewBech32Codec("cosmosvaloper") - suite.distrKeeper.SetValidatorOutstandingRewards(suite.ctx, validator0.GetOperator(), types.ValidatorOutstandingRewards{Rewards: valCommission}) - suite.distrKeeper.SetValidatorOutstandingRewards(suite.ctx, suite.genesisVals[0].GetOperator(), types.ValidatorOutstandingRewards{Rewards: valCommission}) + val0, err := valCodec.StringToBytes(validator0.GetOperator()) + suite.Require().NoError(err) + + genVal0, err := valCodec.StringToBytes(suite.genesisVals[0].GetOperator()) + suite.Require().NoError(err) + + suite.distrKeeper.SetValidatorOutstandingRewards(suite.ctx, val0, types.ValidatorOutstandingRewards{Rewards: valCommission}) + suite.distrKeeper.SetValidatorOutstandingRewards(suite.ctx, genVal0, types.ValidatorOutstandingRewards{Rewards: valCommission}) // setup validator accumulated commission - suite.distrKeeper.SetValidatorAccumulatedCommission(suite.ctx, validator0.GetOperator(), types.ValidatorAccumulatedCommission{Commission: valCommission}) - suite.distrKeeper.SetValidatorAccumulatedCommission(suite.ctx, suite.genesisVals[0].GetOperator(), types.ValidatorAccumulatedCommission{Commission: valCommission}) + suite.distrKeeper.SetValidatorAccumulatedCommission(suite.ctx, val0, types.ValidatorAccumulatedCommission{Commission: valCommission}) + suite.distrKeeper.SetValidatorAccumulatedCommission(suite.ctx, genVal0, types.ValidatorAccumulatedCommission{Commission: valCommission}) - suite.app.FinalizeBlock(&abci.RequestFinalizeBlock{ + _, err = suite.app.FinalizeBlock(&abci.RequestFinalizeBlock{ Height: suite.app.LastBlockHeight() + 1, Hash: suite.app.LastCommitID().Hash, }) + suite.Require().NoError(err) // execute operation op := simulation.SimulateMsgWithdrawValidatorCommission(suite.txConfig, suite.accountKeeper, suite.bankKeeper, suite.distrKeeper, suite.stakingKeeper) @@ -262,7 +276,8 @@ func (suite *SimTestSuite) SetupTest() { suite.ctx = suite.app.BaseApp.NewContext(false) - genesisVals := suite.stakingKeeper.GetAllValidators(suite.ctx) + genesisVals, err := suite.stakingKeeper.GetAllValidators(suite.ctx) + suite.Require().NoError(err) suite.Require().Len(genesisVals, 1) suite.genesisVals = genesisVals } @@ -293,7 +308,7 @@ func (suite *SimTestSuite) getTestingValidator(accounts []simtypes.Account, comm account := accounts[n] valPubKey := account.PubKey valAddr := sdk.ValAddress(account.PubKey.Address().Bytes()) - validator, err := stakingtypes.NewValidator(valAddr, valPubKey, stakingtypes. + validator, err := stakingtypes.NewValidator(valAddr.String(), valPubKey, stakingtypes. Description{}) require.NoError(err) validator, err = validator.SetInitialCommission(commission) diff --git a/x/distribution/simulation/proposals_test.go b/x/distribution/simulation/proposals_test.go index 578eb66fd2b4..99d0b9138904 100644 --- a/x/distribution/simulation/proposals_test.go +++ b/x/distribution/simulation/proposals_test.go @@ -4,10 +4,11 @@ import ( "math/rand" "testing" - sdkmath "cosmossdk.io/math" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "gotest.tools/v3/assert" + sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/address" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" diff --git a/x/distribution/testutil/app_config.go b/x/distribution/testutil/app_config.go index 8c3e33586570..c824f4dff45c 100644 --- a/x/distribution/testutil/app_config.go +++ b/x/distribution/testutil/app_config.go @@ -2,7 +2,6 @@ package testutil import ( "github.com/cosmos/cosmos-sdk/testutil/configurator" - _ "github.com/cosmos/cosmos-sdk/x/auth" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/auth/tx/config" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/bank" // import as blank for app wiring diff --git a/x/distribution/testutil/expected_keepers_mocks.go b/x/distribution/testutil/expected_keepers_mocks.go index c4d2ab9eea77..58c026915331 100644 --- a/x/distribution/testutil/expected_keepers_mocks.go +++ b/x/distribution/testutil/expected_keepers_mocks.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: x/distribution/types/expected_keepers.go +// +// Generated by this command: +// +// mockgen -source=x/distribution/types/expected_keepers.go -package testutil -destination x/distribution/testutil/expected_keepers_mocks.go +// // Package testutil is a generated GoMock package. package testutil @@ -11,13 +16,14 @@ import ( address "cosmossdk.io/core/address" types "github.com/cosmos/cosmos-sdk/types" types0 "github.com/cosmos/cosmos-sdk/x/staking/types" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockAccountKeeper is a mock of AccountKeeper interface. type MockAccountKeeper struct { ctrl *gomock.Controller recorder *MockAccountKeeperMockRecorder + isgomock struct{} } // MockAccountKeeperMockRecorder is the mock recorder for MockAccountKeeper. @@ -60,7 +66,7 @@ func (m *MockAccountKeeper) GetAccount(ctx context.Context, addr types.AccAddres } // GetAccount indicates an expected call of GetAccount. -func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetAccount), ctx, addr) } @@ -74,7 +80,7 @@ func (m *MockAccountKeeper) GetModuleAccount(ctx context.Context, name string) t } // GetModuleAccount indicates an expected call of GetModuleAccount. -func (mr *MockAccountKeeperMockRecorder) GetModuleAccount(ctx, name interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) GetModuleAccount(ctx, name any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAccount), ctx, name) } @@ -88,7 +94,7 @@ func (m *MockAccountKeeper) GetModuleAddress(name string) types.AccAddress { } // GetModuleAddress indicates an expected call of GetModuleAddress. -func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(name interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(name any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAddress", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAddress), name) } @@ -100,7 +106,7 @@ func (m *MockAccountKeeper) SetModuleAccount(arg0 context.Context, arg1 types.Mo } // SetModuleAccount indicates an expected call of SetModuleAccount. -func (mr *MockAccountKeeperMockRecorder) SetModuleAccount(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) SetModuleAccount(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetModuleAccount", reflect.TypeOf((*MockAccountKeeper)(nil).SetModuleAccount), arg0, arg1) } @@ -109,6 +115,7 @@ func (mr *MockAccountKeeperMockRecorder) SetModuleAccount(arg0, arg1 interface{} type MockBankKeeper struct { ctrl *gomock.Controller recorder *MockBankKeeperMockRecorder + isgomock struct{} } // MockBankKeeperMockRecorder is the mock recorder for MockBankKeeper. @@ -137,7 +144,7 @@ func (m *MockBankKeeper) BlockedAddr(addr types.AccAddress) bool { } // BlockedAddr indicates an expected call of BlockedAddr. -func (mr *MockBankKeeperMockRecorder) BlockedAddr(addr interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) BlockedAddr(addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlockedAddr", reflect.TypeOf((*MockBankKeeper)(nil).BlockedAddr), addr) } @@ -151,7 +158,7 @@ func (m *MockBankKeeper) GetAllBalances(ctx context.Context, addr types.AccAddre } // GetAllBalances indicates an expected call of GetAllBalances. -func (mr *MockBankKeeperMockRecorder) GetAllBalances(ctx, addr interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) GetAllBalances(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllBalances", reflect.TypeOf((*MockBankKeeper)(nil).GetAllBalances), ctx, addr) } @@ -165,7 +172,7 @@ func (m *MockBankKeeper) SendCoinsFromAccountToModule(ctx context.Context, sende } // SendCoinsFromAccountToModule indicates an expected call of SendCoinsFromAccountToModule. -func (mr *MockBankKeeperMockRecorder) SendCoinsFromAccountToModule(ctx, senderAddr, recipientModule, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SendCoinsFromAccountToModule(ctx, senderAddr, recipientModule, amt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromAccountToModule", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromAccountToModule), ctx, senderAddr, recipientModule, amt) } @@ -179,7 +186,7 @@ func (m *MockBankKeeper) SendCoinsFromModuleToAccount(ctx context.Context, sende } // SendCoinsFromModuleToAccount indicates an expected call of SendCoinsFromModuleToAccount. -func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToAccount(ctx, senderModule, recipientAddr, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToAccount(ctx, senderModule, recipientAddr, amt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromModuleToAccount", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromModuleToAccount), ctx, senderModule, recipientAddr, amt) } @@ -193,7 +200,7 @@ func (m *MockBankKeeper) SendCoinsFromModuleToModule(ctx context.Context, sender } // SendCoinsFromModuleToModule indicates an expected call of SendCoinsFromModuleToModule. -func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToModule(ctx, senderModule, recipientModule, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToModule(ctx, senderModule, recipientModule, amt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromModuleToModule", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromModuleToModule), ctx, senderModule, recipientModule, amt) } @@ -207,7 +214,7 @@ func (m *MockBankKeeper) SpendableCoins(ctx context.Context, addr types.AccAddre } // SpendableCoins indicates an expected call of SpendableCoins. -func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SpendableCoins", reflect.TypeOf((*MockBankKeeper)(nil).SpendableCoins), ctx, addr) } @@ -216,6 +223,7 @@ func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr interface{}) *gom type MockStakingKeeper struct { ctrl *gomock.Controller recorder *MockStakingKeeperMockRecorder + isgomock struct{} } // MockStakingKeeperMockRecorder is the mock recorder for MockStakingKeeper. @@ -235,110 +243,148 @@ func (m *MockStakingKeeper) EXPECT() *MockStakingKeeperMockRecorder { return m.recorder } +// ConsensusAddressCodec mocks base method. +func (m *MockStakingKeeper) ConsensusAddressCodec() address.Codec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ConsensusAddressCodec") + ret0, _ := ret[0].(address.Codec) + return ret0 +} + +// ConsensusAddressCodec indicates an expected call of ConsensusAddressCodec. +func (mr *MockStakingKeeperMockRecorder) ConsensusAddressCodec() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConsensusAddressCodec", reflect.TypeOf((*MockStakingKeeper)(nil).ConsensusAddressCodec)) +} + // Delegation mocks base method. -func (m *MockStakingKeeper) Delegation(arg0 types.Context, arg1 types.AccAddress, arg2 types.ValAddress) types0.DelegationI { +func (m *MockStakingKeeper) Delegation(arg0 context.Context, arg1 types.AccAddress, arg2 types.ValAddress) (types0.DelegationI, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Delegation", arg0, arg1, arg2) ret0, _ := ret[0].(types0.DelegationI) - return ret0 + ret1, _ := ret[1].(error) + return ret0, ret1 } // Delegation indicates an expected call of Delegation. -func (mr *MockStakingKeeperMockRecorder) Delegation(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockStakingKeeperMockRecorder) Delegation(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delegation", reflect.TypeOf((*MockStakingKeeper)(nil).Delegation), arg0, arg1, arg2) } // GetAllDelegatorDelegations mocks base method. -func (m *MockStakingKeeper) GetAllDelegatorDelegations(ctx types.Context, delegator types.AccAddress) []types0.Delegation { +func (m *MockStakingKeeper) GetAllDelegatorDelegations(ctx context.Context, delegator types.AccAddress) ([]types0.Delegation, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetAllDelegatorDelegations", ctx, delegator) ret0, _ := ret[0].([]types0.Delegation) - return ret0 + ret1, _ := ret[1].(error) + return ret0, ret1 } // GetAllDelegatorDelegations indicates an expected call of GetAllDelegatorDelegations. -func (mr *MockStakingKeeperMockRecorder) GetAllDelegatorDelegations(ctx, delegator interface{}) *gomock.Call { +func (mr *MockStakingKeeperMockRecorder) GetAllDelegatorDelegations(ctx, delegator any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllDelegatorDelegations", reflect.TypeOf((*MockStakingKeeper)(nil).GetAllDelegatorDelegations), ctx, delegator) } // GetAllSDKDelegations mocks base method. -func (m *MockStakingKeeper) GetAllSDKDelegations(ctx types.Context) []types0.Delegation { +func (m *MockStakingKeeper) GetAllSDKDelegations(ctx context.Context) ([]types0.Delegation, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetAllSDKDelegations", ctx) ret0, _ := ret[0].([]types0.Delegation) - return ret0 + ret1, _ := ret[1].(error) + return ret0, ret1 } // GetAllSDKDelegations indicates an expected call of GetAllSDKDelegations. -func (mr *MockStakingKeeperMockRecorder) GetAllSDKDelegations(ctx interface{}) *gomock.Call { +func (mr *MockStakingKeeperMockRecorder) GetAllSDKDelegations(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllSDKDelegations", reflect.TypeOf((*MockStakingKeeper)(nil).GetAllSDKDelegations), ctx) } // GetAllValidators mocks base method. -func (m *MockStakingKeeper) GetAllValidators(ctx types.Context) []types0.Validator { +func (m *MockStakingKeeper) GetAllValidators(ctx context.Context) ([]types0.Validator, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetAllValidators", ctx) ret0, _ := ret[0].([]types0.Validator) - return ret0 + ret1, _ := ret[1].(error) + return ret0, ret1 } // GetAllValidators indicates an expected call of GetAllValidators. -func (mr *MockStakingKeeperMockRecorder) GetAllValidators(ctx interface{}) *gomock.Call { +func (mr *MockStakingKeeperMockRecorder) GetAllValidators(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllValidators", reflect.TypeOf((*MockStakingKeeper)(nil).GetAllValidators), ctx) } // IterateDelegations mocks base method. -func (m *MockStakingKeeper) IterateDelegations(ctx types.Context, delegator types.AccAddress, fn func(int64, types0.DelegationI) bool) { +func (m *MockStakingKeeper) IterateDelegations(ctx context.Context, delegator types.AccAddress, fn func(int64, types0.DelegationI) bool) error { m.ctrl.T.Helper() - m.ctrl.Call(m, "IterateDelegations", ctx, delegator, fn) + ret := m.ctrl.Call(m, "IterateDelegations", ctx, delegator, fn) + ret0, _ := ret[0].(error) + return ret0 } // IterateDelegations indicates an expected call of IterateDelegations. -func (mr *MockStakingKeeperMockRecorder) IterateDelegations(ctx, delegator, fn interface{}) *gomock.Call { +func (mr *MockStakingKeeperMockRecorder) IterateDelegations(ctx, delegator, fn any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateDelegations", reflect.TypeOf((*MockStakingKeeper)(nil).IterateDelegations), ctx, delegator, fn) } // IterateValidators mocks base method. -func (m *MockStakingKeeper) IterateValidators(arg0 types.Context, arg1 func(int64, types0.ValidatorI) bool) { +func (m *MockStakingKeeper) IterateValidators(arg0 context.Context, arg1 func(int64, types0.ValidatorI) bool) error { m.ctrl.T.Helper() - m.ctrl.Call(m, "IterateValidators", arg0, arg1) + ret := m.ctrl.Call(m, "IterateValidators", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 } // IterateValidators indicates an expected call of IterateValidators. -func (mr *MockStakingKeeperMockRecorder) IterateValidators(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStakingKeeperMockRecorder) IterateValidators(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateValidators", reflect.TypeOf((*MockStakingKeeper)(nil).IterateValidators), arg0, arg1) } // Validator mocks base method. -func (m *MockStakingKeeper) Validator(arg0 types.Context, arg1 types.ValAddress) types0.ValidatorI { +func (m *MockStakingKeeper) Validator(arg0 context.Context, arg1 types.ValAddress) (types0.ValidatorI, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Validator", arg0, arg1) ret0, _ := ret[0].(types0.ValidatorI) - return ret0 + ret1, _ := ret[1].(error) + return ret0, ret1 } // Validator indicates an expected call of Validator. -func (mr *MockStakingKeeperMockRecorder) Validator(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStakingKeeperMockRecorder) Validator(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Validator", reflect.TypeOf((*MockStakingKeeper)(nil).Validator), arg0, arg1) } +// ValidatorAddressCodec mocks base method. +func (m *MockStakingKeeper) ValidatorAddressCodec() address.Codec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ValidatorAddressCodec") + ret0, _ := ret[0].(address.Codec) + return ret0 +} + +// ValidatorAddressCodec indicates an expected call of ValidatorAddressCodec. +func (mr *MockStakingKeeperMockRecorder) ValidatorAddressCodec() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorAddressCodec", reflect.TypeOf((*MockStakingKeeper)(nil).ValidatorAddressCodec)) +} + // ValidatorByConsAddr mocks base method. -func (m *MockStakingKeeper) ValidatorByConsAddr(arg0 types.Context, arg1 types.ConsAddress) types0.ValidatorI { +func (m *MockStakingKeeper) ValidatorByConsAddr(arg0 context.Context, arg1 types.ConsAddress) (types0.ValidatorI, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ValidatorByConsAddr", arg0, arg1) ret0, _ := ret[0].(types0.ValidatorI) - return ret0 + ret1, _ := ret[1].(error) + return ret0, ret1 } // ValidatorByConsAddr indicates an expected call of ValidatorByConsAddr. -func (mr *MockStakingKeeperMockRecorder) ValidatorByConsAddr(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStakingKeeperMockRecorder) ValidatorByConsAddr(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorByConsAddr", reflect.TypeOf((*MockStakingKeeper)(nil).ValidatorByConsAddr), arg0, arg1) } @@ -347,6 +393,7 @@ func (mr *MockStakingKeeperMockRecorder) ValidatorByConsAddr(arg0, arg1 interfac type MockStakingHooks struct { ctrl *gomock.Controller recorder *MockStakingHooksMockRecorder + isgomock struct{} } // MockStakingHooksMockRecorder is the mock recorder for MockStakingHooks. @@ -367,25 +414,29 @@ func (m *MockStakingHooks) EXPECT() *MockStakingHooksMockRecorder { } // AfterDelegationModified mocks base method. -func (m *MockStakingHooks) AfterDelegationModified(ctx types.Context, delAddr types.AccAddress, valAddr types.ValAddress) { +func (m *MockStakingHooks) AfterDelegationModified(ctx context.Context, delAddr types.AccAddress, valAddr types.ValAddress) error { m.ctrl.T.Helper() - m.ctrl.Call(m, "AfterDelegationModified", ctx, delAddr, valAddr) + ret := m.ctrl.Call(m, "AfterDelegationModified", ctx, delAddr, valAddr) + ret0, _ := ret[0].(error) + return ret0 } // AfterDelegationModified indicates an expected call of AfterDelegationModified. -func (mr *MockStakingHooksMockRecorder) AfterDelegationModified(ctx, delAddr, valAddr interface{}) *gomock.Call { +func (mr *MockStakingHooksMockRecorder) AfterDelegationModified(ctx, delAddr, valAddr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AfterDelegationModified", reflect.TypeOf((*MockStakingHooks)(nil).AfterDelegationModified), ctx, delAddr, valAddr) } // AfterValidatorCreated mocks base method. -func (m *MockStakingHooks) AfterValidatorCreated(ctx types.Context, valAddr types.ValAddress) { +func (m *MockStakingHooks) AfterValidatorCreated(ctx context.Context, valAddr types.ValAddress) error { m.ctrl.T.Helper() - m.ctrl.Call(m, "AfterValidatorCreated", ctx, valAddr) + ret := m.ctrl.Call(m, "AfterValidatorCreated", ctx, valAddr) + ret0, _ := ret[0].(error) + return ret0 } // AfterValidatorCreated indicates an expected call of AfterValidatorCreated. -func (mr *MockStakingHooksMockRecorder) AfterValidatorCreated(ctx, valAddr interface{}) *gomock.Call { +func (mr *MockStakingHooksMockRecorder) AfterValidatorCreated(ctx, valAddr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AfterValidatorCreated", reflect.TypeOf((*MockStakingHooks)(nil).AfterValidatorCreated), ctx, valAddr) } diff --git a/x/distribution/testutil/staking_helper.go b/x/distribution/testutil/staking_helper.go index a568898aabf3..a031774cf652 100644 --- a/x/distribution/testutil/staking_helper.go +++ b/x/distribution/testutil/staking_helper.go @@ -13,7 +13,7 @@ import ( func CreateValidator(pk cryptotypes.PubKey, stake math.Int) (stakingtypes.Validator, error) { valConsAddr := sdk.GetConsAddress(pk) - val, err := stakingtypes.NewValidator(sdk.ValAddress(valConsAddr), pk, stakingtypes.Description{Moniker: "TestValidator"}) + val, err := stakingtypes.NewValidator(sdk.ValAddress(valConsAddr).String(), pk, stakingtypes.Description{Moniker: "TestValidator"}) val.Tokens = stake val.DelegatorShares = math.LegacyNewDecFromInt(val.Tokens) return val, err @@ -49,13 +49,19 @@ func SlashValidator( slashFactor math.LegacyDec, validator *stakingtypes.Validator, distrKeeper *keeper.Keeper, + sk *MockStakingKeeper, ) math.Int { if slashFactor.IsNegative() { panic(fmt.Errorf("attempted to slash with a negative slash factor: %v", slashFactor)) } + valBz, err := sk.ValidatorAddressCodec().StringToBytes(validator.GetOperator()) + if err != nil { + panic(err) + } + // call the before-modification hook - err := distrKeeper.Hooks().BeforeValidatorModified(ctx, validator.GetOperator()) + err = distrKeeper.Hooks().BeforeValidatorModified(ctx, valBz) if err != nil { panic(err) } @@ -83,7 +89,10 @@ func SlashValidator( effectiveFraction = math.LegacyOneDec() } // call the before-slashed hook - distrKeeper.Hooks().BeforeValidatorSlashed(ctx, validator.GetOperator(), effectiveFraction) + err := distrKeeper.Hooks().BeforeValidatorSlashed(ctx, valBz, effectiveFraction) + if err != nil { + panic(err) + } } // Deduct from validator's bonded tokens and update the validator. // Burn the slashed tokens from the pool account and decrease the total supply. @@ -102,16 +111,21 @@ func Delegate( validator *stakingtypes.Validator, amount math.Int, delegation *stakingtypes.Delegation, + sk *MockStakingKeeper, ) ( newShares math.LegacyDec, updatedDel stakingtypes.Delegation, err error, ) { + valBz, err := sk.ValidatorAddressCodec().StringToBytes(validator.GetOperator()) + if err != nil { + return math.LegacyZeroDec(), stakingtypes.Delegation{}, err + } if delegation != nil { - err = distrKeeper.Hooks().BeforeDelegationSharesModified(ctx, delegator, validator.GetOperator()) + err = distrKeeper.Hooks().BeforeDelegationSharesModified(ctx, delegator, valBz) } else { - err = distrKeeper.Hooks().BeforeDelegationCreated(ctx, delegator, validator.GetOperator()) - del := stakingtypes.NewDelegation(delegator, validator.GetOperator(), math.LegacyZeroDec()) + err = distrKeeper.Hooks().BeforeDelegationCreated(ctx, delegator, valBz) + del := stakingtypes.NewDelegation(delegator.String(), validator.GetOperator(), math.LegacyZeroDec()) delegation = &del } diff --git a/x/distribution/types/distribution.pb.go b/x/distribution/types/distribution.pb.go index f2f82a7acf87..bd9f9d1783fd 100644 --- a/x/distribution/types/distribution.pb.go +++ b/x/distribution/types/distribution.pb.go @@ -4,6 +4,7 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" @@ -29,14 +30,14 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Params defines the set of params for the distribution module. type Params struct { - CommunityTax github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=community_tax,json=communityTax,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"community_tax"` + CommunityTax cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=community_tax,json=communityTax,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"community_tax"` // Deprecated: The base_proposer_reward field is deprecated and is no longer used // in the x/distribution module's reward mechanism. - BaseProposerReward github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=base_proposer_reward,json=baseProposerReward,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"base_proposer_reward"` // Deprecated: Do not use. + BaseProposerReward cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=base_proposer_reward,json=baseProposerReward,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"base_proposer_reward"` // Deprecated: Do not use. // Deprecated: The bonus_proposer_reward field is deprecated and is no longer used // in the x/distribution module's reward mechanism. - BonusProposerReward github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=bonus_proposer_reward,json=bonusProposerReward,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"bonus_proposer_reward"` // Deprecated: Do not use. - WithdrawAddrEnabled bool `protobuf:"varint,4,opt,name=withdraw_addr_enabled,json=withdrawAddrEnabled,proto3" json:"withdraw_addr_enabled,omitempty"` + BonusProposerReward cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=bonus_proposer_reward,json=bonusProposerReward,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"bonus_proposer_reward"` // Deprecated: Do not use. + WithdrawAddrEnabled bool `protobuf:"varint,4,opt,name=withdraw_addr_enabled,json=withdrawAddrEnabled,proto3" json:"withdraw_addr_enabled,omitempty"` } func (m *Params) Reset() { *m = Params{} } @@ -296,8 +297,8 @@ func (m *ValidatorOutstandingRewards) GetRewards() github_com_cosmos_cosmos_sdk_ // This is needed to calculate appropriate amount of staking tokens // for delegations which are withdrawn after a slash has occurred. type ValidatorSlashEvent struct { - ValidatorPeriod uint64 `protobuf:"varint,1,opt,name=validator_period,json=validatorPeriod,proto3" json:"validator_period,omitempty"` - Fraction github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=fraction,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"fraction"` + ValidatorPeriod uint64 `protobuf:"varint,1,opt,name=validator_period,json=validatorPeriod,proto3" json:"validator_period,omitempty"` + Fraction cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=fraction,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"fraction"` } func (m *ValidatorSlashEvent) Reset() { *m = ValidatorSlashEvent{} } @@ -487,9 +488,9 @@ var xxx_messageInfo_CommunityPoolSpendProposal proto.InternalMessageInfo // the delegators within the validator may be left with less than a full token, // thus sdk.Dec is used. type DelegatorStartingInfo struct { - PreviousPeriod uint64 `protobuf:"varint,1,opt,name=previous_period,json=previousPeriod,proto3" json:"previous_period,omitempty"` - Stake github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=stake,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stake"` - Height uint64 `protobuf:"varint,3,opt,name=height,proto3" json:"creation_height"` + PreviousPeriod uint64 `protobuf:"varint,1,opt,name=previous_period,json=previousPeriod,proto3" json:"previous_period,omitempty"` + Stake cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=stake,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"stake"` + Height uint64 `protobuf:"varint,3,opt,name=height,proto3" json:"creation_height"` } func (m *DelegatorStartingInfo) Reset() { *m = DelegatorStartingInfo{} } @@ -642,70 +643,71 @@ func init() { } var fileDescriptor_cd78a31ea281a992 = []byte{ - // 1006 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xf6, 0x34, 0x89, 0xd3, 0x4c, 0xdb, 0x84, 0x4e, 0x7e, 0xd4, 0x71, 0x8b, 0x1d, 0x56, 0x2a, - 0x84, 0x40, 0x6c, 0x52, 0x2e, 0x28, 0xe2, 0x12, 0xdb, 0xad, 0xe0, 0x42, 0xa3, 0x0d, 0xa2, 0x88, - 0xcb, 0x6a, 0xbc, 0x3b, 0xb1, 0x47, 0xdd, 0x9d, 0x59, 0x66, 0x66, 0x9d, 0xe4, 0xc0, 0x3d, 0x70, - 0x00, 0x6e, 0xa0, 0x9e, 0x2a, 0xb8, 0x54, 0x9c, 0x72, 0xc8, 0x8d, 0x7f, 0xa0, 0xe2, 0x54, 0x15, - 0x09, 0x21, 0x0e, 0x29, 0x24, 0x87, 0x20, 0xfe, 0x0a, 0x34, 0x3b, 0xe3, 0x5d, 0x27, 0x84, 0x52, - 0xa9, 0xb5, 0xb8, 0x24, 0x9e, 0xef, 0xcd, 0xbe, 0xef, 0x7d, 0xef, 0xbd, 0x79, 0x33, 0xb0, 0xe6, - 0x73, 0x19, 0x71, 0x59, 0x0f, 0xa8, 0x54, 0x82, 0xb6, 0x13, 0x45, 0x39, 0xab, 0xf7, 0x56, 0xda, - 0x44, 0xe1, 0x95, 0x13, 0x60, 0x2d, 0x16, 0x5c, 0x71, 0x74, 0xd5, 0xec, 0xaf, 0x9d, 0x30, 0xd9, - 0xfd, 0xe5, 0x99, 0x0e, 0xef, 0xf0, 0x74, 0x5f, 0x5d, 0xff, 0x32, 0x9f, 0x94, 0x2b, 0x96, 0xa2, - 0x8d, 0x25, 0xc9, 0x5c, 0xfb, 0x9c, 0x5a, 0x97, 0xe5, 0x79, 0x63, 0xf7, 0xcc, 0x87, 0xd6, 0xbf, - 0x31, 0x5d, 0xc6, 0x11, 0x65, 0xbc, 0x9e, 0xfe, 0x35, 0x90, 0xf3, 0xe3, 0x08, 0x2c, 0xae, 0x63, - 0x81, 0x23, 0x89, 0x36, 0xe1, 0x25, 0x9f, 0x47, 0x51, 0xc2, 0xa8, 0xda, 0xf1, 0x14, 0xde, 0x2e, - 0x81, 0x05, 0xb0, 0x38, 0xd1, 0x58, 0x7b, 0x78, 0x50, 0x2d, 0xfc, 0x76, 0x50, 0x7d, 0xb5, 0x43, - 0x55, 0x37, 0x69, 0xd7, 0x7c, 0x1e, 0x59, 0xaf, 0xf6, 0xdf, 0xb2, 0x0c, 0xee, 0xd6, 0xd5, 0x4e, - 0x4c, 0x64, 0xad, 0x45, 0xfc, 0xc7, 0xfb, 0xcb, 0xd0, 0x92, 0xb6, 0x88, 0xff, 0xe0, 0x78, 0x6f, - 0x09, 0xb8, 0x17, 0x33, 0xbf, 0x1f, 0xe2, 0x6d, 0x94, 0xc0, 0x19, 0x1d, 0xbb, 0x0e, 0x30, 0xe6, - 0x92, 0x08, 0x4f, 0x90, 0x2d, 0x2c, 0x82, 0xd2, 0xb9, 0x94, 0xae, 0xf9, 0xdc, 0x74, 0x25, 0xe0, - 0x22, 0x4d, 0xb0, 0x6e, 0xfd, 0xbb, 0xa9, 0x7b, 0xb4, 0x05, 0x67, 0xdb, 0x9c, 0x25, 0xf2, 0x1f, - 0xbc, 0x23, 0x2f, 0x8e, 0x77, 0x3a, 0x65, 0x38, 0x45, 0x7c, 0x03, 0xce, 0x6e, 0x51, 0xd5, 0x0d, - 0x04, 0xde, 0xf2, 0x70, 0x10, 0x08, 0x8f, 0x30, 0xdc, 0x0e, 0x49, 0x50, 0x1a, 0x5d, 0x00, 0x8b, - 0xe7, 0xdd, 0xe9, 0xbe, 0x71, 0x2d, 0x08, 0xc4, 0x4d, 0x63, 0x5a, 0xbd, 0xfe, 0xc5, 0xf1, 0xde, - 0xd2, 0xc2, 0x00, 0xf1, 0xf6, 0xc9, 0x96, 0x32, 0x25, 0x73, 0x7e, 0x01, 0xb0, 0xfc, 0x11, 0x0e, - 0x69, 0x80, 0x15, 0x17, 0xef, 0x51, 0xa9, 0xb8, 0xa0, 0x3e, 0x0e, 0x0d, 0xb1, 0x44, 0x5f, 0x02, - 0x78, 0xc5, 0x4f, 0xa2, 0x24, 0xc4, 0x8a, 0xf6, 0x88, 0xd5, 0xeb, 0x09, 0xac, 0x28, 0x2f, 0x81, - 0x85, 0x91, 0xc5, 0x0b, 0x37, 0xae, 0xd9, 0x86, 0xad, 0xe9, 0x84, 0xf5, 0x1b, 0x4f, 0x2b, 0x6a, - 0x72, 0xca, 0x1a, 0xef, 0xe8, 0x9c, 0xfc, 0xf0, 0xa4, 0xfa, 0xc6, 0xb3, 0xe5, 0x44, 0x7f, 0x23, - 0x4d, 0xc5, 0x67, 0x73, 0x5a, 0x13, 0x8c, 0xab, 0x49, 0xd1, 0x6b, 0x70, 0x4a, 0x90, 0x4d, 0x22, - 0x08, 0xf3, 0x89, 0xe7, 0xf3, 0x84, 0xa9, 0xb4, 0xea, 0x97, 0xdc, 0xc9, 0x0c, 0x6e, 0x6a, 0xd4, - 0xf9, 0x1e, 0xc0, 0x2b, 0x99, 0xb0, 0x66, 0x22, 0x04, 0x61, 0xaa, 0xaf, 0x2a, 0x86, 0xe3, 0x46, - 0x89, 0x1c, 0xb2, 0x88, 0x3e, 0x0d, 0x9a, 0x83, 0xc5, 0x98, 0x08, 0xca, 0x4d, 0x8f, 0x8e, 0xba, - 0x76, 0xe5, 0x7c, 0x0b, 0x60, 0x25, 0x8b, 0x72, 0xcd, 0xb7, 0x9a, 0x49, 0xd0, 0xe4, 0x51, 0x44, - 0xa5, 0xa4, 0x9c, 0xa1, 0x1e, 0x84, 0x7e, 0xb6, 0x1a, 0x72, 0xbc, 0x03, 0x4c, 0xce, 0x57, 0x00, - 0x5e, 0xcd, 0x42, 0xbb, 0x9d, 0x28, 0xa9, 0x30, 0x0b, 0x28, 0xeb, 0xfc, 0x6f, 0x49, 0x74, 0xee, - 0x01, 0x38, 0x9d, 0x45, 0xb4, 0x11, 0x62, 0xd9, 0xbd, 0xd9, 0x23, 0x4c, 0xa1, 0xd7, 0xe1, 0x4b, - 0xbd, 0x3e, 0xec, 0xd9, 0x34, 0x83, 0x34, 0xcd, 0x53, 0x19, 0xbe, 0x9e, 0xc2, 0xe8, 0x63, 0x78, - 0x7e, 0x53, 0x60, 0x5f, 0x9f, 0x00, 0x3b, 0x2d, 0xde, 0x7d, 0x9e, 0x53, 0xeb, 0x66, 0xde, 0x9c, - 0xcf, 0x01, 0x9c, 0x39, 0x23, 0x38, 0x89, 0x3e, 0x85, 0x73, 0x79, 0x74, 0x52, 0x1b, 0x3c, 0x92, - 0x5a, 0x6c, 0xda, 0xde, 0xaa, 0x3d, 0x65, 0x82, 0xd7, 0xce, 0x70, 0xd9, 0x98, 0xd0, 0x21, 0x9b, - 0xdc, 0xcc, 0xf4, 0xce, 0xa0, 0x74, 0x76, 0x01, 0x1c, 0xbf, 0x45, 0xc8, 0x3a, 0xe7, 0x21, 0xfa, - 0x0c, 0x4e, 0xe6, 0x33, 0x39, 0xe6, 0x3c, 0x1c, 0x72, 0xb5, 0xf2, 0x1b, 0x40, 0xd3, 0x3b, 0xdf, - 0x9c, 0x83, 0xe5, 0xe6, 0x20, 0xb2, 0x11, 0x13, 0x16, 0x98, 0xf9, 0x86, 0x43, 0x34, 0x03, 0xc7, - 0x14, 0x55, 0x21, 0x31, 0x37, 0x85, 0x6b, 0x16, 0x68, 0x01, 0x5e, 0x08, 0x88, 0xf4, 0x05, 0x8d, - 0xf3, 0x42, 0xb9, 0x83, 0x10, 0xba, 0x06, 0x27, 0x04, 0xf1, 0x69, 0x4c, 0x09, 0x53, 0x66, 0xfc, - 0xba, 0x39, 0x80, 0x76, 0x60, 0x11, 0x47, 0xe9, 0x6c, 0x18, 0x4d, 0xb5, 0xce, 0x9f, 0xa9, 0x35, - 0x15, 0x7a, 0xcb, 0x0a, 0x5d, 0x7c, 0x06, 0xa1, 0xa9, 0xca, 0x7b, 0xc7, 0x7b, 0x4b, 0x17, 0x43, - 0xd2, 0xc1, 0xfe, 0x8e, 0xe7, 0xe7, 0xb2, 0x2d, 0xe1, 0xea, 0xe2, 0xee, 0xfd, 0x6a, 0xe1, 0xcf, - 0xfb, 0xd5, 0xc2, 0x4f, 0xfb, 0xcb, 0x65, 0xcb, 0xda, 0xe1, 0xbd, 0x01, 0x52, 0xa6, 0x74, 0xcc, - 0xc0, 0x79, 0x02, 0xe0, 0x6c, 0x8b, 0x68, 0x4f, 0xba, 0x7a, 0x0a, 0x0b, 0x45, 0x59, 0xe7, 0x7d, - 0xb6, 0x99, 0xce, 0xb8, 0x58, 0x90, 0x1e, 0xe5, 0xfa, 0xaa, 0x19, 0x6c, 0xe7, 0xc9, 0x3e, 0x6c, - 0xbb, 0xf9, 0x0e, 0x1c, 0x93, 0x0a, 0xdf, 0x25, 0xb6, 0x95, 0x5f, 0xc0, 0x3d, 0x6b, 0xfc, 0xa1, - 0x16, 0x2c, 0x76, 0x09, 0xed, 0x74, 0x4d, 0x6e, 0x47, 0x1b, 0x6f, 0xfe, 0x75, 0x50, 0x9d, 0xf2, - 0x05, 0xd1, 0x23, 0x98, 0x79, 0xc6, 0xf4, 0xdd, 0xf1, 0xde, 0xd2, 0x69, 0xcc, 0xe6, 0xc2, 0x2c, - 0x9c, 0x3f, 0x00, 0x9c, 0xb7, 0x0a, 0x29, 0x67, 0x99, 0x56, 0x7b, 0xa9, 0x7d, 0x00, 0x2f, 0xe7, - 0xe7, 0x42, 0xdf, 0x6a, 0x44, 0x4a, 0xfb, 0x60, 0x78, 0xe5, 0xf1, 0xfe, 0xf2, 0xcb, 0x36, 0xb4, - 0x7c, 0x3a, 0x9a, 0x2d, 0x1b, 0x4a, 0xe8, 0x21, 0x94, 0x9f, 0x78, 0x8b, 0x23, 0x06, 0x8b, 0xd9, - 0x33, 0x60, 0x98, 0x0d, 0x6e, 0x59, 0x56, 0x47, 0x75, 0xa5, 0x9d, 0x9f, 0x01, 0xbc, 0xfe, 0xef, - 0xfd, 0x7d, 0x87, 0xaa, 0x6e, 0x8b, 0xc4, 0x5c, 0x52, 0x35, 0xa4, 0x56, 0x9f, 0x1b, 0x68, 0x75, - 0x6d, 0xb2, 0x2b, 0x54, 0x82, 0xe3, 0x81, 0x21, 0x2e, 0x8d, 0xa5, 0x86, 0xfe, 0x72, 0xd5, 0xd9, - 0xfd, 0xcf, 0xee, 0x6c, 0xdc, 0x7e, 0x70, 0x58, 0x01, 0x0f, 0x0f, 0x2b, 0xe0, 0xd1, 0x61, 0x05, - 0xfc, 0x7e, 0x58, 0x01, 0x5f, 0x1f, 0x55, 0x0a, 0x8f, 0x8e, 0x2a, 0x85, 0x5f, 0x8f, 0x2a, 0x85, - 0x4f, 0x56, 0x9e, 0x9a, 0xb3, 0x53, 0xef, 0x8c, 0x34, 0x85, 0xed, 0x62, 0xfa, 0x56, 0x7c, 0xfb, - 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2f, 0xcc, 0x9a, 0x24, 0xde, 0x0a, 0x00, 0x00, + // 1012 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0x41, 0x6f, 0x1b, 0x45, + 0x14, 0xf6, 0x34, 0x89, 0xd3, 0x4c, 0xdb, 0x84, 0x4e, 0x9c, 0xd4, 0x71, 0x8b, 0x6d, 0x56, 0xaa, + 0x30, 0x81, 0xd8, 0xa4, 0x48, 0x08, 0xe5, 0xd6, 0xd8, 0xad, 0x40, 0x2a, 0x34, 0xda, 0x20, 0x90, + 0xe0, 0xb0, 0x1a, 0xef, 0x4e, 0xec, 0x21, 0xbb, 0x33, 0xcb, 0xcc, 0xd8, 0x49, 0x0e, 0xdc, 0x03, + 0x07, 0xe0, 0x06, 0xea, 0xa9, 0x82, 0x4b, 0xc5, 0x29, 0x87, 0xfc, 0x88, 0x8a, 0x53, 0x55, 0x10, + 0x42, 0x1c, 0x02, 0x24, 0x87, 0x20, 0x7e, 0x05, 0x9a, 0x9d, 0xf1, 0xae, 0x13, 0x42, 0x81, 0x22, + 0x8b, 0x4b, 0x94, 0x79, 0x6f, 0xf6, 0x7d, 0xdf, 0xf7, 0xe6, 0x9b, 0x37, 0x86, 0x75, 0x9f, 0xcb, + 0x88, 0xcb, 0x46, 0x40, 0xa5, 0x12, 0xb4, 0xdd, 0x53, 0x94, 0xb3, 0x46, 0x7f, 0xb9, 0x4d, 0x14, + 0x5e, 0x3e, 0x11, 0xac, 0xc7, 0x82, 0x2b, 0x8e, 0xae, 0x9a, 0xfd, 0xf5, 0x13, 0x29, 0xbb, 0xbf, + 0x54, 0xe8, 0xf0, 0x0e, 0x4f, 0xf6, 0x35, 0xf4, 0x7f, 0xe6, 0x93, 0x52, 0xd9, 0x42, 0xb4, 0xb1, + 0x24, 0x69, 0x69, 0x9f, 0x53, 0x5b, 0xb2, 0xb4, 0x60, 0xf2, 0x9e, 0xf9, 0xd0, 0xd6, 0x37, 0xa9, + 0xcb, 0x38, 0xa2, 0x8c, 0x37, 0x92, 0xbf, 0x26, 0xe4, 0xdc, 0x1b, 0x83, 0xf9, 0x35, 0x2c, 0x70, + 0x24, 0xd1, 0xfb, 0xf0, 0x92, 0xcf, 0xa3, 0xa8, 0xc7, 0xa8, 0xda, 0xf1, 0x14, 0xde, 0x2e, 0x82, + 0x2a, 0xa8, 0x4d, 0xad, 0xbe, 0xfa, 0xf0, 0xa0, 0x92, 0xfb, 0xe9, 0xa0, 0x62, 0xa9, 0xca, 0x60, + 0xb3, 0x4e, 0x79, 0x23, 0xc2, 0xaa, 0x5b, 0xbf, 0x43, 0x3a, 0xd8, 0xdf, 0x69, 0x11, 0xff, 0xf1, + 0xfe, 0x12, 0xb4, 0x48, 0x2d, 0xe2, 0x3f, 0x38, 0xde, 0x5b, 0x04, 0xee, 0xc5, 0xb4, 0xd8, 0xdb, + 0x78, 0x1b, 0x7d, 0x00, 0x0b, 0x9a, 0xb0, 0x66, 0x15, 0x73, 0x49, 0x84, 0x27, 0xc8, 0x16, 0x16, + 0x41, 0xf1, 0x5c, 0x82, 0xf1, 0xda, 0xd3, 0x61, 0x14, 0x81, 0x8b, 0x74, 0xd5, 0x35, 0x5b, 0xd4, + 0x4d, 0x6a, 0xa2, 0x10, 0xce, 0xb5, 0x39, 0xeb, 0xc9, 0x3f, 0x81, 0x8d, 0xfd, 0x47, 0xb0, 0xd9, + 0xa4, 0xec, 0x29, 0xb4, 0x1b, 0x70, 0x6e, 0x8b, 0xaa, 0x6e, 0x20, 0xf0, 0x96, 0x87, 0x83, 0x40, + 0x78, 0x84, 0xe1, 0x76, 0x48, 0x82, 0xe2, 0x78, 0x15, 0xd4, 0xce, 0xbb, 0xb3, 0x83, 0xe4, 0xcd, + 0x20, 0x10, 0xb7, 0x4c, 0x6a, 0xe5, 0xfa, 0x27, 0xc7, 0x7b, 0x8b, 0x55, 0x03, 0xb0, 0x24, 0x83, + 0xcd, 0xc6, 0xf6, 0x49, 0xc7, 0x98, 0x13, 0x71, 0x7e, 0x00, 0xb0, 0xf4, 0x0e, 0x0e, 0x69, 0x80, + 0x15, 0x17, 0xaf, 0x53, 0xa9, 0xb8, 0xa0, 0x3e, 0x0e, 0x0d, 0xb0, 0x44, 0x9f, 0x02, 0x78, 0xc5, + 0xef, 0x45, 0xbd, 0x10, 0x2b, 0xda, 0x27, 0x56, 0xa4, 0x27, 0xb0, 0xa2, 0xbc, 0x08, 0xaa, 0x63, + 0xb5, 0x0b, 0x37, 0xae, 0x59, 0x3f, 0xd6, 0x75, 0x97, 0x06, 0xbe, 0xd2, 0x8a, 0x9a, 0x9c, 0x32, + 0xd3, 0x88, 0x6f, 0x7e, 0xae, 0xbc, 0xd8, 0xa1, 0xaa, 0xdb, 0x6b, 0xd7, 0x7d, 0x1e, 0x59, 0xbf, + 0x34, 0x86, 0xa8, 0xa9, 0x9d, 0x98, 0xc8, 0xc1, 0x37, 0xd2, 0x9c, 0xed, 0x5c, 0x06, 0x6b, 0xc8, + 0xb8, 0x1a, 0x14, 0x3d, 0x0f, 0x67, 0x04, 0xd9, 0x20, 0x82, 0x30, 0x9f, 0x78, 0x3e, 0xef, 0x31, + 0x95, 0x9c, 0xef, 0x25, 0x77, 0x3a, 0x0d, 0x37, 0x75, 0xd4, 0xf9, 0x1a, 0xc0, 0x2b, 0xa9, 0xb0, + 0x66, 0x4f, 0x08, 0xc2, 0xd4, 0x40, 0x55, 0x0c, 0x27, 0x8d, 0x12, 0x39, 0x62, 0x11, 0x03, 0x18, + 0x34, 0x0f, 0xf3, 0x31, 0x11, 0x94, 0x1b, 0x37, 0x8e, 0xbb, 0x76, 0xe5, 0x7c, 0x09, 0x60, 0x39, + 0x65, 0x79, 0xd3, 0xb7, 0x9a, 0x49, 0xd0, 0xe4, 0x51, 0x44, 0xa5, 0xa4, 0x9c, 0xa1, 0x3e, 0x84, + 0x7e, 0xba, 0x1a, 0x31, 0xdf, 0x21, 0x24, 0xe7, 0x33, 0x00, 0xaf, 0xa6, 0xd4, 0xee, 0xf6, 0x94, + 0x54, 0x98, 0x05, 0x94, 0x75, 0xfe, 0xb7, 0x26, 0x6a, 0x46, 0xb3, 0x29, 0xa3, 0xf5, 0x10, 0xcb, + 0xee, 0xad, 0x3e, 0x61, 0x0a, 0xbd, 0x00, 0x9f, 0xe9, 0x0f, 0xc2, 0x9e, 0x6d, 0x33, 0x48, 0xda, + 0x3c, 0x93, 0xc6, 0xd7, 0x92, 0x30, 0x7a, 0x13, 0x9e, 0xdf, 0x10, 0xd8, 0xd7, 0x37, 0xc0, 0xce, + 0x85, 0xe5, 0x7f, 0x7d, 0x55, 0xdd, 0xb4, 0x84, 0xf3, 0x31, 0x80, 0x85, 0x33, 0x18, 0x49, 0xf4, + 0x21, 0x9c, 0xcf, 0x28, 0x49, 0x9d, 0xf0, 0x48, 0x92, 0xb1, 0xbd, 0x7a, 0xb9, 0xfe, 0x84, 0xa9, + 0x5c, 0x3f, 0xa3, 0xe4, 0xea, 0x94, 0xe6, 0x69, 0x1a, 0x52, 0xe8, 0x9f, 0x01, 0xe9, 0xec, 0x02, + 0x38, 0x79, 0x9b, 0x90, 0x35, 0xce, 0x43, 0xf4, 0x11, 0x9c, 0xce, 0xe6, 0x6c, 0xcc, 0x79, 0x38, + 0xe2, 0x23, 0xca, 0xa6, 0xba, 0x86, 0x77, 0xbe, 0x38, 0x07, 0x4b, 0xcd, 0xe1, 0xc8, 0x7a, 0x4c, + 0x58, 0x60, 0x86, 0x1a, 0x0e, 0x51, 0x01, 0x4e, 0x28, 0xaa, 0x42, 0x62, 0xa6, 0xbf, 0x6b, 0x16, + 0xa8, 0x0a, 0x2f, 0x04, 0x44, 0xfa, 0x82, 0xc6, 0xd9, 0xe9, 0xb8, 0xc3, 0x21, 0x74, 0x0d, 0x4e, + 0x09, 0xe2, 0xd3, 0x98, 0x12, 0xa6, 0xcc, 0xa0, 0x75, 0xb3, 0x00, 0xda, 0x81, 0x79, 0x1c, 0x25, + 0x03, 0x61, 0x3c, 0xd1, 0xba, 0x70, 0xa6, 0xd6, 0x44, 0xe8, 0x6d, 0x2b, 0xb4, 0xf6, 0x0f, 0x84, + 0x26, 0x2a, 0xef, 0x1d, 0xef, 0x2d, 0x5e, 0x0c, 0x13, 0x3b, 0x78, 0x7e, 0x26, 0xdb, 0x02, 0xae, + 0xd4, 0x76, 0xef, 0x57, 0x72, 0xbf, 0xdd, 0xaf, 0xe4, 0xbe, 0xdd, 0x5f, 0x2a, 0x59, 0xd4, 0x0e, + 0xef, 0x0f, 0x81, 0x32, 0xa5, 0x39, 0x03, 0xe7, 0x7b, 0x00, 0xe7, 0x5a, 0x44, 0x57, 0xd2, 0xa7, + 0xa7, 0xb0, 0x50, 0x94, 0x75, 0xde, 0x60, 0x1b, 0xc9, 0x60, 0x8b, 0x05, 0xe9, 0x53, 0xae, 0x1f, + 0x95, 0x61, 0x0f, 0x4f, 0x0f, 0xc2, 0xd6, 0xc2, 0x77, 0xe0, 0x84, 0x54, 0x78, 0x93, 0x58, 0xff, + 0x3e, 0xed, 0xdb, 0x69, 0x8a, 0xa0, 0x16, 0xcc, 0x77, 0x09, 0xed, 0x74, 0x4d, 0x43, 0xc7, 0x57, + 0x5f, 0xfa, 0xfd, 0xa0, 0x32, 0xe3, 0x0b, 0xa2, 0x87, 0x2d, 0xf3, 0x4c, 0xea, 0xab, 0xe3, 0xbd, + 0xc5, 0xd3, 0x31, 0xdb, 0x00, 0xb3, 0x70, 0x7e, 0x05, 0x70, 0xc1, 0xca, 0xa2, 0x9c, 0xa5, 0x02, + 0xed, 0xf3, 0xf5, 0x16, 0xbc, 0x9c, 0x5d, 0x06, 0xfd, 0x7e, 0x11, 0x29, 0xed, 0xcb, 0xff, 0xdc, + 0xe3, 0xfd, 0xa5, 0x67, 0x2d, 0xb5, 0x6c, 0x0e, 0x9a, 0x2d, 0xeb, 0x4a, 0xe8, 0x71, 0x93, 0xdd, + 0x6d, 0x1b, 0x47, 0x0c, 0xe6, 0xd3, 0xa7, 0x7d, 0x94, 0xae, 0xb6, 0x28, 0x2b, 0xe3, 0xfa, 0x78, + 0x9d, 0xef, 0x00, 0xbc, 0xfe, 0xd7, 0xa6, 0x7e, 0x97, 0xaa, 0x6e, 0x8b, 0xc4, 0x5c, 0x52, 0x35, + 0x22, 0x7f, 0xcf, 0x0f, 0xf9, 0x5b, 0xa7, 0xec, 0x0a, 0x15, 0xe1, 0x64, 0x60, 0x80, 0x8b, 0x13, + 0x49, 0x62, 0xb0, 0x5c, 0x71, 0x76, 0xff, 0xd6, 0x92, 0xab, 0x77, 0x1f, 0x1c, 0x96, 0xc1, 0xc3, + 0xc3, 0x32, 0x78, 0x74, 0x58, 0x06, 0xbf, 0x1c, 0x96, 0xc1, 0xe7, 0x47, 0xe5, 0xdc, 0xa3, 0xa3, + 0x72, 0xee, 0xc7, 0xa3, 0x72, 0xee, 0xbd, 0xe5, 0x27, 0xf6, 0xec, 0xd4, 0x2f, 0x8a, 0xa4, 0x85, + 0xed, 0x7c, 0xf2, 0xa3, 0xef, 0x95, 0x3f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x78, 0xae, 0xbc, 0xbc, + 0xa7, 0x0a, 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { diff --git a/x/distribution/types/expected_keepers.go b/x/distribution/types/expected_keepers.go index fde51dc75169..4237bb6691c9 100644 --- a/x/distribution/types/expected_keepers.go +++ b/x/distribution/types/expected_keepers.go @@ -34,27 +34,29 @@ type BankKeeper interface { // StakingKeeper expected staking keeper (noalias) type StakingKeeper interface { + ValidatorAddressCodec() address.Codec + ConsensusAddressCodec() address.Codec // iterate through validators by operator address, execute func for each validator - IterateValidators(sdk.Context, - func(index int64, validator stakingtypes.ValidatorI) (stop bool)) + IterateValidators(context.Context, + func(index int64, validator stakingtypes.ValidatorI) (stop bool)) error - Validator(sdk.Context, sdk.ValAddress) stakingtypes.ValidatorI // get a particular validator by operator address - ValidatorByConsAddr(sdk.Context, sdk.ConsAddress) stakingtypes.ValidatorI // get a particular validator by consensus address + Validator(context.Context, sdk.ValAddress) (stakingtypes.ValidatorI, error) // get a particular validator by operator address + ValidatorByConsAddr(context.Context, sdk.ConsAddress) (stakingtypes.ValidatorI, error) // get a particular validator by consensus address // Delegation allows for getting a particular delegation for a given validator // and delegator outside the scope of the staking module. - Delegation(sdk.Context, sdk.AccAddress, sdk.ValAddress) stakingtypes.DelegationI + Delegation(context.Context, sdk.AccAddress, sdk.ValAddress) (stakingtypes.DelegationI, error) - IterateDelegations(ctx sdk.Context, delegator sdk.AccAddress, - fn func(index int64, delegation stakingtypes.DelegationI) (stop bool)) + IterateDelegations(ctx context.Context, delegator sdk.AccAddress, + fn func(index int64, delegation stakingtypes.DelegationI) (stop bool)) error - GetAllSDKDelegations(ctx sdk.Context) []stakingtypes.Delegation - GetAllValidators(ctx sdk.Context) (validators []stakingtypes.Validator) - GetAllDelegatorDelegations(ctx sdk.Context, delegator sdk.AccAddress) []stakingtypes.Delegation + GetAllSDKDelegations(ctx context.Context) ([]stakingtypes.Delegation, error) + GetAllValidators(ctx context.Context) ([]stakingtypes.Validator, error) + GetAllDelegatorDelegations(ctx context.Context, delegator sdk.AccAddress) ([]stakingtypes.Delegation, error) } // StakingHooks event hooks for staking validator object (noalias) type StakingHooks interface { - AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) // Must be called when a validator is created - AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) + AfterValidatorCreated(ctx context.Context, valAddr sdk.ValAddress) error // Must be called when a validator is created + AfterDelegationModified(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error } diff --git a/x/distribution/types/fee_pool_test.go b/x/distribution/types/fee_pool_test.go index 9c5e1a41d0c2..8d922e6389e7 100644 --- a/x/distribution/types/fee_pool_test.go +++ b/x/distribution/types/fee_pool_test.go @@ -3,9 +3,10 @@ package types_test import ( "testing" - "cosmossdk.io/math" "github.com/stretchr/testify/require" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/distribution/types" ) diff --git a/x/distribution/types/msg.go b/x/distribution/types/msg.go index f8b1f666d5e8..231e86bd34d4 100644 --- a/x/distribution/types/msg.go +++ b/x/distribution/types/msg.go @@ -21,80 +21,34 @@ func NewMsgSetWithdrawAddress(delAddr, withdrawAddr sdk.AccAddress) *MsgSetWithd } } -// Return address that must sign over msg.GetSignBytes() -func (msg MsgSetWithdrawAddress) GetSigners() []sdk.AccAddress { - delegator, _ := sdk.AccAddressFromBech32(msg.DelegatorAddress) - return []sdk.AccAddress{delegator} -} - -func NewMsgWithdrawDelegatorReward(delAddr sdk.AccAddress, valAddr sdk.ValAddress) *MsgWithdrawDelegatorReward { +func NewMsgWithdrawDelegatorReward(delAddr, valAddr string) *MsgWithdrawDelegatorReward { return &MsgWithdrawDelegatorReward{ - DelegatorAddress: delAddr.String(), - ValidatorAddress: valAddr.String(), + DelegatorAddress: delAddr, + ValidatorAddress: valAddr, } } -// Return address that must sign over msg.GetSignBytes() -func (msg MsgWithdrawDelegatorReward) GetSigners() []sdk.AccAddress { - delegator, _ := sdk.AccAddressFromBech32(msg.DelegatorAddress) - return []sdk.AccAddress{delegator} -} - -func NewMsgWithdrawValidatorCommission(valAddr sdk.ValAddress) *MsgWithdrawValidatorCommission { +func NewMsgWithdrawValidatorCommission(valAddr string) *MsgWithdrawValidatorCommission { return &MsgWithdrawValidatorCommission{ - ValidatorAddress: valAddr.String(), + ValidatorAddress: valAddr, } } -// Return address that must sign over msg.GetSignBytes() -func (msg MsgWithdrawValidatorCommission) GetSigners() []sdk.AccAddress { - valAddr, _ := sdk.ValAddressFromBech32(msg.ValidatorAddress) - return []sdk.AccAddress{sdk.AccAddress(valAddr)} -} - // NewMsgFundCommunityPool returns a new MsgFundCommunityPool with a sender and // a funding amount. -func NewMsgFundCommunityPool(amount sdk.Coins, depositor sdk.AccAddress) *MsgFundCommunityPool { +func NewMsgFundCommunityPool(amount sdk.Coins, depositor string) *MsgFundCommunityPool { return &MsgFundCommunityPool{ Amount: amount, - Depositor: depositor.String(), + Depositor: depositor, } } -// GetSigners returns the signer addresses that are expected to sign the result -// of GetSignBytes. -func (msg MsgFundCommunityPool) GetSigners() []sdk.AccAddress { - depositor, _ := sdk.AccAddressFromBech32(msg.Depositor) - return []sdk.AccAddress{depositor} -} - -// GetSigners returns the signer addresses that are expected to sign the result -// of GetSignBytes. -func (msg MsgUpdateParams) GetSigners() []sdk.AccAddress { - authority, _ := sdk.AccAddressFromBech32(msg.Authority) - return []sdk.AccAddress{authority} -} - -// GetSigners returns the signer addresses that are expected to sign the result -// of GetSignBytes, which is the authority. -func (msg MsgCommunityPoolSpend) GetSigners() []sdk.AccAddress { - authority, _ := sdk.AccAddressFromBech32(msg.Authority) - return []sdk.AccAddress{authority} -} - // NewMsgDepositValidatorRewardsPool returns a new MsgDepositValidatorRewardsPool // with a depositor and a funding amount. -func NewMsgDepositValidatorRewardsPool(depositor sdk.AccAddress, valAddr sdk.ValAddress, amount sdk.Coins) *MsgDepositValidatorRewardsPool { +func NewMsgDepositValidatorRewardsPool(depositor, valAddr string, amount sdk.Coins) *MsgDepositValidatorRewardsPool { return &MsgDepositValidatorRewardsPool{ Amount: amount, - Depositor: depositor.String(), - ValidatorAddress: valAddr.String(), + Depositor: depositor, + ValidatorAddress: valAddr, } } - -// GetSigners returns the signer addresses that are expected to sign the result -// of GetSignBytes, which is the depositor. -func (msg MsgDepositValidatorRewardsPool) GetSigners() []sdk.AccAddress { - depositor, _ := sdk.AccAddressFromBech32(msg.Depositor) - return []sdk.AccAddress{depositor} -} diff --git a/x/distribution/types/params.go b/x/distribution/types/params.go index 395be69d7ea8..f7c980284175 100644 --- a/x/distribution/types/params.go +++ b/x/distribution/types/params.go @@ -18,13 +18,7 @@ func DefaultParams() Params { // ValidateBasic performs basic validation on distribution parameters. func (p Params) ValidateBasic() error { - if p.CommunityTax.IsNegative() || p.CommunityTax.GT(math.LegacyOneDec()) { - return fmt.Errorf( - "community tax should be non-negative and less than one: %s", p.CommunityTax, - ) - } - - return nil + return validateCommunityTax(p.CommunityTax) } func validateCommunityTax(i interface{}) error { diff --git a/x/distribution/types/params_internal_test.go b/x/distribution/types/params_internal_test.go index ebc43c37b44f..92cffd78460b 100644 --- a/x/distribution/types/params_internal_test.go +++ b/x/distribution/types/params_internal_test.go @@ -3,8 +3,9 @@ package types import ( "testing" - "cosmossdk.io/math" "github.com/stretchr/testify/require" + + "cosmossdk.io/math" ) func Test_validateAuxFuncs(t *testing.T) { diff --git a/x/distribution/types/params_test.go b/x/distribution/types/params_test.go index c92e904b1842..dfd68a380ed3 100644 --- a/x/distribution/types/params_test.go +++ b/x/distribution/types/params_test.go @@ -3,15 +3,15 @@ package types_test import ( "testing" - sdkmath "cosmossdk.io/math" "github.com/stretchr/testify/require" - sdk "github.com/cosmos/cosmos-sdk/types" + sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/x/distribution/types" ) func TestParams_ValidateBasic(t *testing.T) { - toDec := sdk.MustNewDecFromStr + toDec := sdkmath.LegacyMustNewDecFromStr type fields struct { CommunityTax sdkmath.LegacyDec @@ -30,6 +30,7 @@ func TestParams_ValidateBasic(t *testing.T) { {"negative bonus proposer reward (must not matter)", fields{toDec("0.1"), toDec("0"), toDec("-0.1"), false}, false}, {"total sum greater than 1 (must not matter)", fields{toDec("0.2"), toDec("0.5"), toDec("0.4"), false}, false}, {"community tax greater than 1", fields{toDec("1.1"), toDec("0"), toDec("0"), false}, true}, + {"community tax nil", fields{sdkmath.LegacyDec{}, toDec("0"), toDec("0"), false}, true}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/distribution/types/query.go b/x/distribution/types/query.go index e7efccd1e13d..973b038b7e11 100644 --- a/x/distribution/types/query.go +++ b/x/distribution/types/query.go @@ -32,6 +32,6 @@ func (res QueryDelegatorTotalRewardsResponse) String() string { } // NewDelegationDelegatorReward constructs a DelegationDelegatorReward. -func NewDelegationDelegatorReward(valAddr sdk.ValAddress, reward sdk.DecCoins) DelegationDelegatorReward { - return DelegationDelegatorReward{ValidatorAddress: valAddr.String(), Reward: reward} +func NewDelegationDelegatorReward(valAddr string, reward sdk.DecCoins) DelegationDelegatorReward { + return DelegationDelegatorReward{ValidatorAddress: valAddr, Reward: reward} } diff --git a/x/distribution/types/query.pb.go b/x/distribution/types/query.pb.go index e9e883840a97..8321dd4b2779 100644 --- a/x/distribution/types/query.pb.go +++ b/x/distribution/types/query.pb.go @@ -1440,6 +1440,7 @@ func _Query_CommunityPool_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.distribution.v1beta1.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/distribution/types/tx.pb.go b/x/distribution/types/tx.pb.go index b38aa0cc0f92..5ebcf8b794b6 100644 --- a/x/distribution/types/tx.pb.go +++ b/x/distribution/types/tx.pb.go @@ -1265,6 +1265,7 @@ func _Msg_DepositValidatorRewardsPool_Handler(srv interface{}, ctx context.Conte return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.distribution.v1beta1.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/epochs/README.md b/x/epochs/README.md new file mode 100644 index 000000000000..7b0b0b285767 --- /dev/null +++ b/x/epochs/README.md @@ -0,0 +1,177 @@ +--- +sidebar_position: 1 +--- + +# `x/epochs` + +## Abstract + +Often in the SDK, we would like to run certain code every-so often. The +purpose of `epochs` module is to allow other modules to set that they +would like to be signaled once every period. So another module can +specify it wants to execute code once a week, starting at UTC-time = x. +`epochs` creates a generalized epoch interface to other modules so that +they can easily be signaled upon such events. + +## Contents + +1. **[Concept](#concepts)** +2. **[State](#state)** +3. **[Events](#events)** +4. **[Keeper](#keepers)** +5. **[Hooks](#hooks)** +6. **[Queries](#queries)** + +## Concepts + +The epochs module defines on-chain timers that execute at fixed time intervals. +Other SDK modules can then register logic to be executed at the timer ticks. +We refer to the period in between two timer ticks as an "epoch". + +Every timer has a unique identifier. +Every epoch will have a start time, and an end time, where `end time = start time + timer interval`. +On mainnet, we only utilize one identifier, with a time interval of `one day`. + +The timer will tick at the first block whose block time is greater than the timer end time, +and set the start as the prior timer end time. (Notably, it's not set to the block time!) +This means that if the chain has been down for a while, you will get one timer tick per block, +until the timer has caught up. + +## State + +The Epochs module keeps a single `EpochInfo` per identifier. +This contains the current state of the timer with the corresponding identifier. +Its fields are modified at every timer tick. +EpochInfos are initialized as part of genesis initialization or upgrade logic, +and are only modified on begin blockers. + +## Events + +The `epochs` module emits the following events: + +### BeginBlocker + +| Type | Attribute Key | Attribute Value | +| ----------- | ------------- | --------------- | +| epoch_start | epoch_number | {epoch_number} | +| epoch_start | start_time | {start_time} | + +### EndBlocker + +| Type | Attribute Key | Attribute Value | +| --------- | ------------- | --------------- | +| epoch_end | epoch_number | {epoch_number} | + +## Keepers + +### Keeper functions + +Epochs keeper module provides utility functions to manage epochs. + +## Hooks + +```go + // the first block whose timestamp is after the duration is counted as the end of the epoch + AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumber int64) + // new epoch is next block of epoch end block + BeforeEpochStart(ctx sdk.Context, epochIdentifier string, epochNumber int64) +``` + +### How modules receive hooks + +On hook receiver function of other modules, they need to filter +`epochIdentifier` and only do executions for only specific +epochIdentifier. Filtering epochIdentifier could be in `Params` of other +modules so that they can be modified by governance. + +This is the standard dev UX of this: + +```golang +func (k MyModuleKeeper) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumber int64) { + params := k.GetParams(ctx) + if epochIdentifier == params.DistrEpochIdentifier { + // my logic + } +} +``` + +### Panic isolation + +If a given epoch hook panics, its state update is reverted, but we keep +proceeding through the remaining hooks. This allows more advanced epoch +logic to be used, without concern over state machine halting, or halting +subsequent modules. + +This does mean that if there is behavior you expect from a prior epoch +hook, and that epoch hook reverted, your hook may also have an issue. So +do keep in mind "what if a prior hook didn't get executed" in the safety +checks you consider for a new epoch hook. + +## Queries + +The Epochs module provides the following queries to check the module's state. + +```protobuf +service Query { + // EpochInfos provide running epochInfos + rpc EpochInfos(QueryEpochsInfoRequest) returns (QueryEpochsInfoResponse) {} + // CurrentEpoch provide current epoch of specified identifier + rpc CurrentEpoch(QueryCurrentEpochRequest) returns (QueryCurrentEpochResponse) {} +} +``` + +### Epoch Infos + +Query the currently running epochInfos + +```sh + query epochs epoch-infos +``` + +:::details Example + +An example output: + +```sh +epochs: +- current_epoch: "183" + current_epoch_start_height: "2438409" + current_epoch_start_time: "2021-12-18T17:16:09.898160996Z" + duration: 86400s + epoch_counting_started: true + identifier: day + start_time: "2021-06-18T17:00:00Z" +- current_epoch: "26" + current_epoch_start_height: "2424854" + current_epoch_start_time: "2021-12-17T17:02:07.229632445Z" + duration: 604800s + epoch_counting_started: true + identifier: week + start_time: "2021-06-18T17:00:00Z" +``` + +::: + +### Current Epoch + +Query the current epoch by the specified identifier + +```sh + query epochs current-epoch [identifier] +``` + +:::details Example + +Query the current `day` epoch: + +```sh + query epochs current-epoch day +``` + +Which in this example outputs: + +```sh +current_epoch: "183" +``` + +::: diff --git a/x/epochs/autocli.go b/x/epochs/autocli.go new file mode 100644 index 000000000000..decba091d039 --- /dev/null +++ b/x/epochs/autocli.go @@ -0,0 +1,27 @@ +package epochs + +import ( + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + epochsv1beta1 "cosmossdk.io/api/cosmos/epochs/v1beta1" +) + +// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. +func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { + return &autocliv1.ModuleOptions{ + Query: &autocliv1.ServiceCommandDescriptor{ + Service: epochsv1beta1.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "EpochInfos", + Use: "epoch-infos", + Short: "Query running epoch infos", + }, + { + RpcMethod: "CurrentEpoch", + Use: "current-epoch", + Short: "Query current epoch by specified identifier", + }, + }, + }, + } +} diff --git a/x/epochs/depinject.go b/x/epochs/depinject.go new file mode 100644 index 000000000000..f9cd6529435d --- /dev/null +++ b/x/epochs/depinject.go @@ -0,0 +1,71 @@ +package epochs + +import ( + "fmt" + "maps" + "slices" + + modulev1 "cosmossdk.io/api/cosmos/epochs/module/v1" + "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/store" + "cosmossdk.io/depinject" + "cosmossdk.io/depinject/appconfig" + + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/x/epochs/keeper" + "github.com/cosmos/cosmos-sdk/x/epochs/types" +) + +var _ depinject.OnePerModuleType = AppModule{} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} + +func init() { + appconfig.RegisterModule(&modulev1.Module{}, + appconfig.Provide(ProvideModule), + appconfig.Invoke(InvokeSetHooks), + ) +} + +type ModuleInputs struct { + depinject.In + + Config *modulev1.Module + Cdc codec.Codec + StoreService store.KVStoreService +} + +type ModuleOutputs struct { + depinject.Out + + EpochKeeper keeper.Keeper + Module appmodule.AppModule +} + +func ProvideModule(in ModuleInputs) ModuleOutputs { + k := keeper.NewKeeper(in.StoreService, in.Cdc) + m := NewAppModule(in.Cdc, k) + return ModuleOutputs{EpochKeeper: k, Module: m} +} + +func InvokeSetHooks(keeper keeper.Keeper, hooks map[string]types.EpochHooksWrapper) error { + if hooks == nil { + return nil + } + + // Default ordering is lexical by module name. + // Explicit ordering can be added to the module config if required. + modNames := slices.Sorted(maps.Keys(hooks)) + var multiHooks types.MultiEpochHooks + for _, modName := range modNames { + hook, ok := hooks[modName] + if !ok { + return fmt.Errorf("can't find epoch hooks for module %s", modName) + } + multiHooks = append(multiHooks, hook) + } + + keeper.SetHooks(multiHooks) + return nil +} diff --git a/x/epochs/keeper/abci.go b/x/epochs/keeper/abci.go new file mode 100644 index 000000000000..2685cb950fb0 --- /dev/null +++ b/x/epochs/keeper/abci.go @@ -0,0 +1,91 @@ +package keeper + +import ( + "fmt" + + "github.com/cosmos/cosmos-sdk/telemetry" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/epochs/types" +) + +// BeginBlocker of epochs module. +func (k *Keeper) BeginBlocker(ctx sdk.Context) error { + start := telemetry.Now() + defer telemetry.ModuleMeasureSince(types.ModuleName, start, telemetry.MetricKeyBeginBlocker) + + header := ctx.BlockHeader() + err := k.EpochInfo.Walk( + ctx, + nil, + func(key string, epochInfo types.EpochInfo) (stop bool, err error) { + // If blocktime < initial epoch start time, return + if header.Time.Before(epochInfo.StartTime) { + return false, nil + } + // if epoch counting hasn't started, signal we need to start. + shouldInitialEpochStart := !epochInfo.EpochCountingStarted + + epochEndTime := epochInfo.CurrentEpochStartTime.Add(epochInfo.Duration) + shouldEpochStart := (header.Time.After(epochEndTime)) || shouldInitialEpochStart + + if !shouldEpochStart { + return false, nil + } + epochInfo.CurrentEpochStartHeight = header.Height + + if shouldInitialEpochStart { + epochInfo.EpochCountingStarted = true + epochInfo.CurrentEpoch = 1 + epochInfo.CurrentEpochStartTime = epochInfo.StartTime + ctx.Logger().Debug(fmt.Sprintf("Starting new epoch with identifier %s epoch number %d", epochInfo.Identifier, epochInfo.CurrentEpoch)) + } else { + err := ctx.EventManager().EmitTypedEvent(&types.EventEpochEnd{ + EpochNumber: epochInfo.CurrentEpoch, + }) + if err != nil { + return false, err + } + if err != nil { + return false, nil + } + + cacheCtx, writeFn := ctx.CacheContext() + if err := k.AfterEpochEnd(cacheCtx, epochInfo.Identifier, epochInfo.CurrentEpoch); err != nil { + // purposely ignoring the error here not to halt the chain if the hook fails + ctx.Logger().Error(fmt.Sprintf("Error after epoch end with identifier %s epoch number %d", epochInfo.Identifier, epochInfo.CurrentEpoch)) + } else { + writeFn() + } + + epochInfo.CurrentEpoch += 1 + epochInfo.CurrentEpochStartTime = epochInfo.CurrentEpochStartTime.Add(epochInfo.Duration) + ctx.Logger().Debug(fmt.Sprintf("Starting epoch with identifier %s epoch number %d", epochInfo.Identifier, epochInfo.CurrentEpoch)) + } + + // emit new epoch start event, set epoch info, and run BeforeEpochStart hook + err = ctx.EventManager().EmitTypedEvent(&types.EventEpochStart{ + EpochNumber: epochInfo.CurrentEpoch, + EpochStartTime: epochInfo.CurrentEpochStartTime.Unix(), + }) + if err != nil { + return false, err + } + err = k.EpochInfo.Set(ctx, epochInfo.Identifier, epochInfo) + if err != nil { + ctx.Logger().Error(fmt.Sprintf("Error set epoch info with identifier %s epoch number %d", epochInfo.Identifier, epochInfo.CurrentEpoch)) + return false, nil + } + + cacheCtx, writeFn := ctx.CacheContext() + if err := k.BeforeEpochStart(cacheCtx, epochInfo.Identifier, epochInfo.CurrentEpoch); err != nil { + // purposely ignoring the error here not to halt the chain if the hook fails + ctx.Logger().Error(fmt.Sprintf("Error before epoch start with identifier %s epoch number %d", epochInfo.Identifier, epochInfo.CurrentEpoch)) + } else { + writeFn() + } + + return false, nil + }, + ) + return err +} diff --git a/x/epochs/keeper/abci_test.go b/x/epochs/keeper/abci_test.go new file mode 100644 index 000000000000..154a145a78d6 --- /dev/null +++ b/x/epochs/keeper/abci_test.go @@ -0,0 +1,190 @@ +package keeper_test + +import ( + "maps" + "slices" + "testing" + "time" + + "github.com/stretchr/testify/require" + + "github.com/cosmos/cosmos-sdk/x/epochs/types" +) + +// This test is responsible for testing how epochs increment based off +// of their initial conditions, and subsequent block height / times. +func (suite *KeeperTestSuite) TestEpochInfoBeginBlockChanges() { + block1Time := time.Unix(1656907200, 0).UTC() + const defaultIdentifier = "hourly" + const defaultDuration = time.Hour + // eps is short for epsilon - in this case a negligible amount of time. + const eps = time.Nanosecond + + tests := map[string]struct { + // if identifier, duration is not set, we make it defaultIdentifier and defaultDuration. + // EpochCountingStarted, if unspecified, is inferred by CurrentEpoch == 0 + // StartTime is inferred to be block1Time if left blank. + initialEpochInfo types.EpochInfo + blockHeightTimePairs map[int]time.Time + expEpochInfo types.EpochInfo + }{ + "First block running at exactly start time sets epoch tick": { + initialEpochInfo: types.EpochInfo{StartTime: block1Time, CurrentEpoch: 0, CurrentEpochStartTime: time.Time{}}, + expEpochInfo: types.EpochInfo{StartTime: block1Time, CurrentEpoch: 1, CurrentEpochStartTime: block1Time, CurrentEpochStartHeight: 1}, + }, + "First block run sets start time, subsequent blocks within timer interval do not cause timer tick": { + initialEpochInfo: types.EpochInfo{StartTime: block1Time, CurrentEpoch: 0, CurrentEpochStartTime: time.Time{}}, + blockHeightTimePairs: map[int]time.Time{2: block1Time.Add(time.Second), 3: block1Time.Add(time.Minute), 4: block1Time.Add(30 * time.Minute)}, + expEpochInfo: types.EpochInfo{StartTime: block1Time, CurrentEpoch: 1, CurrentEpochStartTime: block1Time, CurrentEpochStartHeight: 1}, + }, + "Second block at exactly timer interval later does not tick": { + initialEpochInfo: types.EpochInfo{StartTime: block1Time, CurrentEpoch: 0, CurrentEpochStartTime: time.Time{}}, + blockHeightTimePairs: map[int]time.Time{2: block1Time.Add(defaultDuration)}, + expEpochInfo: types.EpochInfo{StartTime: block1Time, CurrentEpoch: 1, CurrentEpochStartTime: block1Time, CurrentEpochStartHeight: 1}, + }, + "Second block at timer interval + epsilon later does tick": { + initialEpochInfo: types.EpochInfo{StartTime: block1Time, CurrentEpoch: 0, CurrentEpochStartTime: time.Time{}}, + blockHeightTimePairs: map[int]time.Time{2: block1Time.Add(defaultDuration).Add(eps)}, + expEpochInfo: types.EpochInfo{StartTime: block1Time, CurrentEpoch: 2, CurrentEpochStartTime: block1Time.Add(time.Hour), CurrentEpochStartHeight: 2}, + }, + "Downtime recovery (many intervals), first block causes 1 tick and sets current start time 1 interval ahead": { + initialEpochInfo: types.EpochInfo{StartTime: block1Time, CurrentEpoch: 0, CurrentEpochStartTime: time.Time{}}, + blockHeightTimePairs: map[int]time.Time{2: block1Time.Add(24 * time.Hour)}, + expEpochInfo: types.EpochInfo{StartTime: block1Time, CurrentEpoch: 2, CurrentEpochStartTime: block1Time.Add(time.Hour), CurrentEpochStartHeight: 2}, + }, + "Downtime recovery (many intervals), second block is at tick 2, w/ start time 2 intervals ahead": { + initialEpochInfo: types.EpochInfo{StartTime: block1Time, CurrentEpoch: 0, CurrentEpochStartTime: time.Time{}}, + blockHeightTimePairs: map[int]time.Time{2: block1Time.Add(24 * time.Hour), 3: block1Time.Add(24 * time.Hour).Add(eps)}, + expEpochInfo: types.EpochInfo{StartTime: block1Time, CurrentEpoch: 3, CurrentEpochStartTime: block1Time.Add(2 * time.Hour), CurrentEpochStartHeight: 3}, + }, + "Many blocks between first and second tick": { + initialEpochInfo: types.EpochInfo{StartTime: block1Time, CurrentEpoch: 1, CurrentEpochStartTime: block1Time}, + blockHeightTimePairs: map[int]time.Time{2: block1Time.Add(time.Second), 3: block1Time.Add(2 * time.Second), 4: block1Time.Add(time.Hour).Add(eps)}, + expEpochInfo: types.EpochInfo{StartTime: block1Time, CurrentEpoch: 2, CurrentEpochStartTime: block1Time.Add(time.Hour), CurrentEpochStartHeight: 4}, + }, + "Distinct identifier and duration still works": { + initialEpochInfo: types.EpochInfo{Identifier: "hello", Duration: time.Minute, StartTime: block1Time, CurrentEpoch: 0, CurrentEpochStartTime: time.Time{}}, + blockHeightTimePairs: map[int]time.Time{2: block1Time.Add(time.Second), 3: block1Time.Add(time.Minute).Add(eps)}, + expEpochInfo: types.EpochInfo{Identifier: "hello", Duration: time.Minute, StartTime: block1Time, CurrentEpoch: 2, CurrentEpochStartTime: block1Time.Add(time.Minute), CurrentEpochStartHeight: 3}, + }, + "StartTime in future won't get ticked on first block": { + initialEpochInfo: types.EpochInfo{StartTime: block1Time.Add(time.Second), CurrentEpoch: 0, CurrentEpochStartTime: time.Time{}}, + // currentEpochStartHeight is 1 because that's when the timer was created on-chain + expEpochInfo: types.EpochInfo{StartTime: block1Time.Add(time.Second), CurrentEpoch: 0, CurrentEpochStartTime: time.Time{}, CurrentEpochStartHeight: 1}, + }, + "StartTime in past will get ticked on first block": { + initialEpochInfo: types.EpochInfo{StartTime: block1Time.Add(-time.Second), CurrentEpoch: 0, CurrentEpochStartTime: time.Time{}}, + expEpochInfo: types.EpochInfo{StartTime: block1Time.Add(-time.Second), CurrentEpoch: 1, CurrentEpochStartTime: block1Time.Add(-time.Second), CurrentEpochStartHeight: 1}, + }, + } + for name, test := range tests { + suite.Run(name, func() { + suite.SetupTest() + suite.Ctx = suite.Ctx.WithBlockHeight(1).WithBlockTime(block1Time) + initialEpoch := initializeBlankEpochInfoFields(test.initialEpochInfo, defaultIdentifier, defaultDuration) + err := suite.EpochsKeeper.AddEpochInfo(suite.Ctx, initialEpoch) + suite.Require().NoError(err) + err = suite.EpochsKeeper.BeginBlocker(suite.Ctx) + suite.Require().NoError(err) + + // get sorted heights + heights := slices.SortedFunc(maps.Keys(test.blockHeightTimePairs), func(i, j int) int { + if test.blockHeightTimePairs[i].Before(test.blockHeightTimePairs[j]) { + return -1 + } else if test.blockHeightTimePairs[i].After(test.blockHeightTimePairs[j]) { + return 1 + } + return 0 + }) + for _, h := range heights { + // for each height in order, run begin block + suite.Ctx = suite.Ctx.WithBlockHeight(int64(h)).WithBlockTime(test.blockHeightTimePairs[h]) + err := suite.EpochsKeeper.BeginBlocker(suite.Ctx) + suite.Require().NoError(err) + } + expEpoch := initializeBlankEpochInfoFields(test.expEpochInfo, initialEpoch.Identifier, initialEpoch.Duration) + actEpoch, err := suite.EpochsKeeper.EpochInfo.Get(suite.Ctx, initialEpoch.Identifier) + suite.Require().NoError(err) + suite.Require().Equal(expEpoch, actEpoch) + }) + } +} + +// initializeBlankEpochInfoFields set identifier, duration and epochCountingStarted if blank in epoch +func initializeBlankEpochInfoFields(epoch types.EpochInfo, identifier string, duration time.Duration) types.EpochInfo { + if epoch.Identifier == "" { + epoch.Identifier = identifier + } + if epoch.Duration == time.Duration(0) { + epoch.Duration = duration + } + epoch.EpochCountingStarted = (epoch.CurrentEpoch != 0) + return epoch +} + +func TestEpochStartingOneMonthAfterInitGenesis(t *testing.T) { + ctx, epochsKeeper := Setup(t) + // On init genesis, default epochs information is set + // To check init genesis again, should make it fresh status + epochInfos, err := epochsKeeper.AllEpochInfos(ctx) + require.NoError(t, err) + for _, epochInfo := range epochInfos { + err := epochsKeeper.EpochInfo.Remove(ctx, epochInfo.Identifier) + require.NoError(t, err) + } + + now := time.Now() + week := time.Hour * 24 * 7 + month := time.Hour * 24 * 30 + initialBlockHeight := int64(1) + ctx = ctx.WithBlockHeight(initialBlockHeight).WithBlockTime(now) + + err = epochsKeeper.InitGenesis(ctx, types.GenesisState{ + Epochs: []types.EpochInfo{ + { + Identifier: "monthly", + StartTime: now.Add(month), + Duration: time.Hour * 24 * 30, + CurrentEpoch: 0, + CurrentEpochStartHeight: ctx.BlockHeight(), + CurrentEpochStartTime: time.Time{}, + EpochCountingStarted: false, + }, + }, + }) + require.NoError(t, err) + + // epoch not started yet + epochInfo, err := epochsKeeper.EpochInfo.Get(ctx, "monthly") + require.NoError(t, err) + require.Equal(t, epochInfo.CurrentEpoch, int64(0)) + require.Equal(t, epochInfo.CurrentEpochStartHeight, initialBlockHeight) + require.Equal(t, epochInfo.CurrentEpochStartTime, time.Time{}) + require.Equal(t, epochInfo.EpochCountingStarted, false) + + // after 1 week + ctx = ctx.WithBlockHeight(2).WithBlockTime(now.Add(week)) + err = epochsKeeper.BeginBlocker(ctx) + require.NoError(t, err) + + // epoch not started yet + epochInfo, err = epochsKeeper.EpochInfo.Get(ctx, "monthly") + require.NoError(t, err) + require.Equal(t, epochInfo.CurrentEpoch, int64(0)) + require.Equal(t, epochInfo.CurrentEpochStartHeight, initialBlockHeight) + require.Equal(t, epochInfo.CurrentEpochStartTime, time.Time{}) + require.Equal(t, epochInfo.EpochCountingStarted, false) + + // after 1 month + ctx = ctx.WithBlockHeight(3).WithBlockTime(now.Add(month)) + err = epochsKeeper.BeginBlocker(ctx) + require.NoError(t, err) + + // epoch started + epochInfo, err = epochsKeeper.EpochInfo.Get(ctx, "monthly") + require.NoError(t, err) + require.Equal(t, epochInfo.CurrentEpoch, int64(1)) + require.Equal(t, epochInfo.CurrentEpochStartHeight, ctx.BlockHeight()) + require.Equal(t, epochInfo.CurrentEpochStartTime.UTC().String(), now.Add(month).UTC().String()) + require.Equal(t, epochInfo.EpochCountingStarted, true) +} diff --git a/x/epochs/keeper/epoch.go b/x/epochs/keeper/epoch.go new file mode 100644 index 000000000000..45f5ef7202ff --- /dev/null +++ b/x/epochs/keeper/epoch.go @@ -0,0 +1,66 @@ +package keeper + +import ( + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/epochs/types" +) + +// GetEpochInfo returns epoch info by identifier. +func (k *Keeper) GetEpochInfo(ctx sdk.Context, identifier string) (types.EpochInfo, error) { + return k.EpochInfo.Get(ctx, identifier) +} + +// AddEpochInfo adds a new epoch info. Will return an error if the epoch fails validation, +// or re-uses an existing identifier. +// This method also sets the start time if left unset, and sets the epoch start height. +func (k *Keeper) AddEpochInfo(ctx sdk.Context, epoch types.EpochInfo) error { + err := epoch.Validate() + if err != nil { + return err + } + // Check if identifier already exists + isExist, err := k.EpochInfo.Has(ctx, epoch.Identifier) + if err != nil { + return err + } + if isExist { + return fmt.Errorf("epoch with identifier %s already exists", epoch.Identifier) + } + + // Initialize empty and default epoch values + if epoch.StartTime.IsZero() { + epoch.StartTime = ctx.BlockTime() + } + if epoch.CurrentEpochStartHeight == 0 { + epoch.CurrentEpochStartHeight = ctx.BlockHeight() + } + return k.EpochInfo.Set(ctx, epoch.Identifier, epoch) +} + +// AllEpochInfos iterate through epochs to return all epochs info. +func (k *Keeper) AllEpochInfos(ctx sdk.Context) ([]types.EpochInfo, error) { + epochs := []types.EpochInfo{} + err := k.EpochInfo.Walk( + ctx, + nil, + func(key string, value types.EpochInfo) (stop bool, err error) { + epochs = append(epochs, value) + return false, nil + }, + ) + return epochs, err +} + +// NumBlocksSinceEpochStart returns the number of blocks since the epoch started. +// if the epoch started on block N, then calling this during block N (after BeforeEpochStart) +// would return 0. +// Calling it any point in block N+1 (assuming the epoch doesn't increment) would return 1. +func (k *Keeper) NumBlocksSinceEpochStart(ctx sdk.Context, identifier string) (int64, error) { + epoch, err := k.EpochInfo.Get(ctx, identifier) + if err != nil { + return 0, fmt.Errorf("epoch with identifier %s not found", identifier) + } + return ctx.BlockHeight() - epoch.CurrentEpochStartHeight, nil +} diff --git a/x/epochs/keeper/epoch_test.go b/x/epochs/keeper/epoch_test.go new file mode 100644 index 000000000000..defd2dbd6164 --- /dev/null +++ b/x/epochs/keeper/epoch_test.go @@ -0,0 +1,101 @@ +package keeper_test + +import ( + "time" + + "github.com/cosmos/cosmos-sdk/x/epochs/types" +) + +func (s *KeeperTestSuite) TestAddEpochInfo() { + defaultIdentifier := "default_add_epoch_info_id" + defaultDuration := time.Hour + startBlockHeight := int64(100) + startBlockTime := time.Unix(1656907200, 0).UTC() + tests := map[string]struct { + addedEpochInfo types.EpochInfo + expErr bool + expEpochInfo types.EpochInfo + }{ + "simple_add": { + addedEpochInfo: types.EpochInfo{ + Identifier: defaultIdentifier, + StartTime: time.Time{}, + Duration: defaultDuration, + CurrentEpoch: 0, + CurrentEpochStartHeight: 0, + CurrentEpochStartTime: time.Time{}, + EpochCountingStarted: false, + }, + expErr: false, + expEpochInfo: types.EpochInfo{ + Identifier: defaultIdentifier, + StartTime: startBlockTime, + Duration: defaultDuration, + CurrentEpoch: 0, + CurrentEpochStartHeight: startBlockHeight, + CurrentEpochStartTime: time.Time{}, + EpochCountingStarted: false, + }, + }, + "zero_duration": { + addedEpochInfo: types.EpochInfo{ + Identifier: defaultIdentifier, + StartTime: time.Time{}, + Duration: time.Duration(0), + CurrentEpoch: 0, + CurrentEpochStartHeight: 0, + CurrentEpochStartTime: time.Time{}, + EpochCountingStarted: false, + }, + expErr: true, + }, + } + for name, test := range tests { + s.Run(name, func() { + s.SetupTest() + s.Ctx = s.Ctx.WithBlockHeight(startBlockHeight).WithBlockTime(startBlockTime) + err := s.EpochsKeeper.AddEpochInfo(s.Ctx, test.addedEpochInfo) + if !test.expErr { + s.Require().NoError(err) + actualEpochInfo, err := s.EpochsKeeper.EpochInfo.Get(s.Ctx, test.addedEpochInfo.Identifier) + s.Require().NoError(err) + s.Require().Equal(test.expEpochInfo, actualEpochInfo) + } else { + s.Require().Error(err) + } + }) + } +} + +func (s *KeeperTestSuite) TestDuplicateAddEpochInfo() { + identifier := "duplicate_add_epoch_info" + epochInfo := types.NewGenesisEpochInfo(identifier, time.Hour*24*30) + err := s.EpochsKeeper.AddEpochInfo(s.Ctx, epochInfo) + s.Require().NoError(err) + err = s.EpochsKeeper.AddEpochInfo(s.Ctx, epochInfo) + s.Require().Error(err) +} + +func (s *KeeperTestSuite) TestEpochLifeCycle() { + s.SetupTest() + + epochInfo := types.NewGenesisEpochInfo("monthly", time.Hour*24*30) + err := s.EpochsKeeper.AddEpochInfo(s.Ctx, epochInfo) + s.Require().NoError(err) + epochInfoSaved, err := s.EpochsKeeper.EpochInfo.Get(s.Ctx, "monthly") + s.Require().NoError(err) + // setup expected epoch info + expectedEpochInfo := epochInfo + expectedEpochInfo.StartTime = s.Ctx.BlockTime() + expectedEpochInfo.CurrentEpochStartHeight = s.Ctx.BlockHeight() + s.Require().Equal(expectedEpochInfo, epochInfoSaved) + + allEpochs, err := s.EpochsKeeper.AllEpochInfos(s.Ctx) + s.Require().NoError(err) + s.Require().Len(allEpochs, 5) + s.Require().Equal(allEpochs[0].Identifier, "day") // alphabetical order + s.Require().Equal(allEpochs[1].Identifier, "hour") + s.Require().Equal(allEpochs[2].Identifier, "minute") + s.Require().Equal(allEpochs[3].Identifier, "monthly") + s.Require().Equal(allEpochs[4].Identifier, "week") +} diff --git a/x/epochs/keeper/genesis.go b/x/epochs/keeper/genesis.go new file mode 100644 index 000000000000..316f1139defe --- /dev/null +++ b/x/epochs/keeper/genesis.go @@ -0,0 +1,28 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/epochs/types" +) + +// InitGenesis sets epoch info from genesis +func (k *Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState) error { + for _, epoch := range genState.Epochs { + err := k.AddEpochInfo(ctx, epoch) + if err != nil { + return err + } + } + return nil +} + +// ExportGenesis returns the capability module's exported genesis. +func (k *Keeper) ExportGenesis(ctx sdk.Context) (*types.GenesisState, error) { + genesis := types.DefaultGenesis() + epochs, err := k.AllEpochInfos(ctx) + if err != nil { + return nil, err + } + genesis.Epochs = epochs + return genesis, nil +} diff --git a/x/epochs/keeper/genesis_test.go b/x/epochs/keeper/genesis_test.go new file mode 100644 index 000000000000..55175ae7d163 --- /dev/null +++ b/x/epochs/keeper/genesis_test.go @@ -0,0 +1,95 @@ +package keeper_test + +import ( + "testing" + "time" + + "github.com/stretchr/testify/require" + + "github.com/cosmos/cosmos-sdk/x/epochs/types" +) + +func TestEpochsExportGenesis(t *testing.T) { + ctx, epochsKeeper := Setup(t) + + chainStartTime := ctx.BlockTime() + chainStartHeight := ctx.BlockHeight() + + genesis, err := epochsKeeper.ExportGenesis(ctx) + require.NoError(t, err) + require.Len(t, genesis.Epochs, 4) + + expectedEpochs := types.DefaultGenesis().Epochs + for i := 0; i < len(expectedEpochs); i++ { + expectedEpochs[i].CurrentEpochStartHeight = chainStartHeight + expectedEpochs[i].StartTime = chainStartTime + } + require.Equal(t, expectedEpochs, genesis.Epochs) +} + +func TestEpochsInitGenesis(t *testing.T) { + ctx, epochsKeeper := Setup(t) + + // On init genesis, default epochs information is set + // To check init genesis again, should make it fresh status + epochInfos, err := epochsKeeper.AllEpochInfos(ctx) + require.NoError(t, err) + for _, epochInfo := range epochInfos { + err := epochsKeeper.EpochInfo.Remove(ctx, epochInfo.Identifier) + require.NoError(t, err) + } + + // now := time.Now() + ctx = ctx.WithBlockHeight(1).WithBlockTime(time.Now().UTC()) + + // test genesisState validation + genesisState := types.GenesisState{ + Epochs: []types.EpochInfo{ + { + Identifier: "monthly", + StartTime: time.Time{}, + Duration: time.Hour * 24, + CurrentEpoch: 0, + CurrentEpochStartHeight: ctx.BlockHeight(), + CurrentEpochStartTime: time.Time{}, + EpochCountingStarted: true, + }, + { + Identifier: "monthly", + StartTime: time.Time{}, + Duration: time.Hour * 24, + CurrentEpoch: 0, + CurrentEpochStartHeight: ctx.BlockHeight(), + CurrentEpochStartTime: time.Time{}, + EpochCountingStarted: true, + }, + }, + } + require.EqualError(t, genesisState.Validate(), "epoch identifier should be unique") + + genesisState = types.GenesisState{ + Epochs: []types.EpochInfo{ + { + Identifier: "monthly", + StartTime: time.Time{}, + Duration: time.Hour * 24, + CurrentEpoch: 0, + CurrentEpochStartHeight: ctx.BlockHeight(), + CurrentEpochStartTime: time.Time{}, + EpochCountingStarted: true, + }, + }, + } + + err = epochsKeeper.InitGenesis(ctx, genesisState) + require.NoError(t, err) + epochInfo, err := epochsKeeper.EpochInfo.Get(ctx, "monthly") + require.NoError(t, err) + require.Equal(t, epochInfo.Identifier, "monthly") + require.Equal(t, epochInfo.StartTime.UTC().String(), ctx.BlockTime().UTC().String()) + require.Equal(t, epochInfo.Duration, time.Hour*24) + require.Equal(t, epochInfo.CurrentEpoch, int64(0)) + require.Equal(t, epochInfo.CurrentEpochStartHeight, ctx.BlockHeight()) + require.Equal(t, epochInfo.CurrentEpochStartTime.UTC().String(), time.Time{}.String()) + require.Equal(t, epochInfo.EpochCountingStarted, true) +} diff --git a/x/epochs/keeper/grpc_query.go b/x/epochs/keeper/grpc_query.go new file mode 100644 index 000000000000..2e76899528a6 --- /dev/null +++ b/x/epochs/keeper/grpc_query.go @@ -0,0 +1,54 @@ +package keeper + +import ( + "context" + "errors" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/epochs/types" +) + +var _ types.QueryServer = Querier{} + +// Querier defines a wrapper around the x/epochs keeper providing gRPC method +// handlers. +type Querier struct { + Keeper +} + +// NewQuerier initializes new querier. +func NewQuerier(k Keeper) Querier { + return Querier{Keeper: k} +} + +// EpochInfos provide running epochInfos. +func (q Querier) EpochInfos(ctx context.Context, _ *types.QueryEpochInfosRequest) (*types.QueryEpochInfosResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + + epochs, err := q.Keeper.AllEpochInfos(sdkCtx) + return &types.QueryEpochInfosResponse{ + Epochs: epochs, + }, err +} + +// CurrentEpoch provides current epoch of specified identifier. +func (q Querier) CurrentEpoch(ctx context.Context, req *types.QueryCurrentEpochRequest) (*types.QueryCurrentEpochResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + if req.Identifier == "" { + return nil, status.Error(codes.InvalidArgument, "identifier is empty") + } + + info, err := q.Keeper.EpochInfo.Get(ctx, req.Identifier) + if err != nil { + return nil, errors.New("not available identifier") + } + + return &types.QueryCurrentEpochResponse{ + CurrentEpoch: info.CurrentEpoch, + }, nil +} diff --git a/x/epochs/keeper/grpc_query_test.go b/x/epochs/keeper/grpc_query_test.go new file mode 100644 index 000000000000..0101e681979e --- /dev/null +++ b/x/epochs/keeper/grpc_query_test.go @@ -0,0 +1,22 @@ +package keeper_test + +import ( + "github.com/cosmos/cosmos-sdk/x/epochs/types" +) + +func (s *KeeperTestSuite) TestQueryEpochInfos() { + s.SetupTest() + queryClient := s.queryClient + + // Check that querying epoch infos on default genesis returns the default genesis epoch infos + epochInfosResponse, err := queryClient.EpochInfos(s.Ctx, &types.QueryEpochInfosRequest{}) + s.Require().NoError(err) + s.Require().Len(epochInfosResponse.Epochs, 4) + expectedEpochs := types.DefaultGenesis().Epochs + for id := range expectedEpochs { + expectedEpochs[id].StartTime = s.Ctx.BlockTime() + expectedEpochs[id].CurrentEpochStartHeight = s.Ctx.BlockHeight() + } + + s.Require().Equal(expectedEpochs, epochInfosResponse.Epochs) +} diff --git a/x/epochs/keeper/hooks.go b/x/epochs/keeper/hooks.go new file mode 100644 index 000000000000..558b17b4a670 --- /dev/null +++ b/x/epochs/keeper/hooks.go @@ -0,0 +1,27 @@ +package keeper + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/x/epochs/types" +) + +// Hooks gets the hooks for governance Keeper +func (k *Keeper) Hooks() types.EpochHooks { + if k.hooks == nil { + // return a no-op implementation if no hooks are set + return types.MultiEpochHooks{} + } + + return k.hooks +} + +// AfterEpochEnd gets called at the end of the epoch, end of epoch is the timestamp of first block produced after epoch duration. +func (k *Keeper) AfterEpochEnd(ctx context.Context, identifier string, epochNumber int64) error { + return k.Hooks().AfterEpochEnd(ctx, identifier, epochNumber) +} + +// BeforeEpochStart new epoch is next block of epoch end block +func (k *Keeper) BeforeEpochStart(ctx context.Context, identifier string, epochNumber int64) error { + return k.Hooks().BeforeEpochStart(ctx, identifier, epochNumber) +} diff --git a/x/epochs/keeper/keeper.go b/x/epochs/keeper/keeper.go new file mode 100644 index 000000000000..ba5f6299b13e --- /dev/null +++ b/x/epochs/keeper/keeper.go @@ -0,0 +1,45 @@ +package keeper + +import ( + "cosmossdk.io/collections" + "cosmossdk.io/core/store" + + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/x/epochs/types" +) + +type Keeper struct { + storeService store.KVStoreService + + cdc codec.BinaryCodec + hooks types.EpochHooks + + Schema collections.Schema + EpochInfo collections.Map[string, types.EpochInfo] +} + +// NewKeeper returns a new keeper by codec and storeKey inputs. +func NewKeeper(storeService store.KVStoreService, cdc codec.BinaryCodec) Keeper { + sb := collections.NewSchemaBuilder(storeService) + k := Keeper{ + storeService: storeService, + cdc: cdc, + EpochInfo: collections.NewMap(sb, types.KeyPrefixEpoch, "epoch_info", collections.StringKey, codec.CollValue[types.EpochInfo](cdc)), + } + + schema, err := sb.Build() + if err != nil { + panic(err) + } + k.Schema = schema + return k +} + +// SetHooks sets the hooks on the x/epochs keeper. +func (k *Keeper) SetHooks(eh types.EpochHooks) { + if k.hooks != nil { + panic("cannot set epochs hooks twice") + } + + k.hooks = eh +} diff --git a/x/epochs/keeper/keeper_test.go b/x/epochs/keeper/keeper_test.go new file mode 100644 index 000000000000..dad485b48822 --- /dev/null +++ b/x/epochs/keeper/keeper_test.go @@ -0,0 +1,89 @@ +package keeper_test + +import ( + "testing" + "time" + + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + + storetypes "cosmossdk.io/store/types" + + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/runtime" + "github.com/cosmos/cosmos-sdk/testutil" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" + epochskeeper "github.com/cosmos/cosmos-sdk/x/epochs/keeper" + "github.com/cosmos/cosmos-sdk/x/epochs/types" +) + +type KeeperTestSuite struct { + suite.Suite + Ctx sdk.Context + EpochsKeeper epochskeeper.Keeper + queryClient types.QueryClient +} + +func (s *KeeperTestSuite) SetupTest() { + ctx, epochsKeeper := Setup(s.T()) + + s.Ctx = ctx + s.EpochsKeeper = epochsKeeper + queryRouter := baseapp.NewGRPCQueryRouter() + cfg := module.NewConfigurator(nil, nil, queryRouter) + types.RegisterQueryServer(cfg.QueryServer(), epochskeeper.NewQuerier(s.EpochsKeeper)) + grpcQueryService := &baseapp.QueryServiceTestHelper{ + GRPCQueryRouter: queryRouter, + Ctx: s.Ctx, + } + encCfg := moduletestutil.MakeTestEncodingConfig() + grpcQueryService.SetInterfaceRegistry(encCfg.InterfaceRegistry) + s.queryClient = types.NewQueryClient(grpcQueryService) +} + +func Setup(t *testing.T) (sdk.Context, epochskeeper.Keeper) { + t.Helper() + + key := storetypes.NewKVStoreKey(types.StoreKey) + storeService := runtime.NewKVStoreService(key) + testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) + ctx := testCtx.Ctx.WithBlockTime(time.Now().UTC()) + encCfg := moduletestutil.MakeTestEncodingConfig() + + epochsKeeper := epochskeeper.NewKeeper( + storeService, + encCfg.Codec, + ) + epochsKeeper.SetHooks(types.NewMultiEpochHooks()) + ctx = ctx.WithBlockTime(time.Now().UTC()).WithBlockHeight(1).WithChainID("epochs") + + err := epochsKeeper.InitGenesis(ctx, *types.DefaultGenesis()) + require.NoError(t, err) + SetEpochStartTime(ctx, epochsKeeper) + + return ctx, epochsKeeper +} + +func TestKeeperTestSuite(t *testing.T) { + suite.Run(t, new(KeeperTestSuite)) +} + +func SetEpochStartTime(ctx sdk.Context, epochsKeeper epochskeeper.Keeper) { + epochs, err := epochsKeeper.AllEpochInfos(ctx) + if err != nil { + panic(err) + } + for _, epoch := range epochs { + epoch.StartTime = ctx.BlockTime() + err := epochsKeeper.EpochInfo.Remove(ctx, epoch.Identifier) + if err != nil { + panic(err) + } + err = epochsKeeper.AddEpochInfo(ctx, epoch) + if err != nil { + panic(err) + } + } +} diff --git a/x/epochs/module.go b/x/epochs/module.go new file mode 100644 index 000000000000..d2d9e409814f --- /dev/null +++ b/x/epochs/module.go @@ -0,0 +1,155 @@ +package epochs + +import ( + "context" + "encoding/json" + "fmt" + + gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" + "google.golang.org/grpc" + + "cosmossdk.io/core/appmodule" + + "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" + "github.com/cosmos/cosmos-sdk/x/epochs/keeper" + "github.com/cosmos/cosmos-sdk/x/epochs/simulation" + "github.com/cosmos/cosmos-sdk/x/epochs/types" +) + +var ( + _ module.AppModuleSimulation = AppModule{} + _ module.HasGenesis = AppModule{} + + _ appmodule.AppModule = AppModule{} + _ appmodule.HasBeginBlocker = AppModule{} +) + +const ConsensusVersion = 1 + +// AppModule implements the AppModule interface for the epochs module. +type AppModule struct { + cdc codec.Codec + keeper keeper.Keeper +} + +// NewAppModule creates a new AppModule object. +func NewAppModule(cdc codec.Codec, keeper keeper.Keeper) AppModule { + return AppModule{ + cdc: cdc, + keeper: keeper, + } +} + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// Name returns the epochs module's name. +// Deprecated: kept for legacy reasons. +func (AppModule) Name() string { + return types.ModuleName +} + +// RegisterLegacyAminoCodec registers the epochs module's types for the given codec. +func (AppModule) RegisterLegacyAminoCodec(_ *codec.LegacyAmino) {} + +func (AppModule) RegisterInterfaces(_ codectypes.InterfaceRegistry) {} + +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the epochs module. +func (AppModule) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *gwruntime.ServeMux) { + if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { + panic(err) + } +} + +// RegisterServices registers module services. +func (am AppModule) RegisterServices(registrar grpc.ServiceRegistrar) error { + types.RegisterQueryServer(registrar, keeper.NewQuerier(am.keeper)) + return nil +} + +// DefaultGenesis returns the epochs module's default genesis state. +func (am AppModule) DefaultGenesis(_ codec.JSONCodec) json.RawMessage { + data, err := am.cdc.MarshalJSON(types.DefaultGenesis()) + if err != nil { + panic(err) + } + return data +} + +// ValidateGenesis performs genesis state validation for the epochs module. +func (am AppModule) ValidateGenesis(_ codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error { + var gs types.GenesisState + if err := am.cdc.UnmarshalJSON(bz, &gs); err != nil { + return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) + } + + return gs.Validate() +} + +// InitGenesis performs the epochs module's genesis initialization +func (am AppModule) InitGenesis(ctx sdk.Context, _ codec.JSONCodec, bz json.RawMessage) { + var gs types.GenesisState + err := am.cdc.UnmarshalJSON(bz, &gs) + if err != nil { + panic(fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err)) + } + + if err := am.keeper.InitGenesis(ctx, gs); err != nil { + panic(err) + } +} + +// ExportGenesis returns the epochs module's exported genesis state as raw JSON bytes. +func (am AppModule) ExportGenesis(ctx sdk.Context, _ codec.JSONCodec) json.RawMessage { + gs, err := am.keeper.ExportGenesis(ctx) + if err != nil { + panic(err) + } + + bz, err := am.cdc.MarshalJSON(gs) + if err != nil { + panic(err) + } + + return bz +} + +// ConsensusVersion implements HasConsensusVersion +func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion } + +// BeginBlock executes all ABCI BeginBlock logic respective to the epochs module. +func (am AppModule) BeginBlock(ctx context.Context) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) + return am.keeper.BeginBlocker(sdkCtx) +} + +// AppModuleSimulation functions + +// WeightedOperations is a no-op. +func (am AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { + return nil +} + +// GenerateGenesisState creates a randomized GenState of the epochs module. +func (AppModule) GenerateGenesisState(simState *module.SimulationState) { + simulation.RandomizedGenState(simState) +} + +// RegisterStoreDecoder registers a decoder for epochs module's types +func (am AppModule) RegisterStoreDecoder(sdr simtypes.StoreDecoderRegistry) { + sdr[types.StoreKey] = simtypes.NewStoreDecoderFuncFromCollectionsSchema(am.keeper.Schema) +} + +// TODO add when we have collections full support with schema +/* +// ModuleCodec implements schema.HasModuleCodec. +// It allows the indexer to decode the module's KVPairUpdate. +func (am AppModule) ModuleCodec() (schema.ModuleCodec, error) { + return am.keeper.Schema.ModuleCodec(collections.IndexingOptions{}) +} +*/ diff --git a/x/epochs/simulation/genesis.go b/x/epochs/simulation/genesis.go new file mode 100644 index 000000000000..fc5d1f77cc2b --- /dev/null +++ b/x/epochs/simulation/genesis.go @@ -0,0 +1,38 @@ +package simulation + +import ( + "math/rand" + "strconv" + "time" + + "github.com/cosmos/cosmos-sdk/types/module" + "github.com/cosmos/cosmos-sdk/x/epochs/types" +) + +// GenDuration randomized GenDuration +func GenDuration(r *rand.Rand) time.Duration { + return time.Hour * time.Duration(r.Intn(168)+1) // between 1 hour to 1 week +} + +func RandomizedEpochs(r *rand.Rand) []types.EpochInfo { + // Gen max 10 epoch + n := r.Intn(11) + var epochs []types.EpochInfo + for i := 0; i < n; i++ { + identifier := "identifier-" + strconv.Itoa(i) + duration := GenDuration(r) + epoch := types.NewGenesisEpochInfo(identifier, duration) + epochs = append(epochs, epoch) + } + return epochs +} + +// RandomizedGenState generates a random GenesisState for distribution +func RandomizedGenState(simState *module.SimulationState) { + epochs := RandomizedEpochs(simState.Rand) + epochsGenesis := types.GenesisState{ + Epochs: epochs, + } + + simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&epochsGenesis) +} diff --git a/x/epochs/types/events.pb.go b/x/epochs/types/events.pb.go new file mode 100644 index 000000000000..59466abf00e7 --- /dev/null +++ b/x/epochs/types/events.pb.go @@ -0,0 +1,495 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/epochs/v1beta1/events.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// EventEpochEnd is an event emitted when an epoch end. +type EventEpochEnd struct { + EpochNumber int64 `protobuf:"varint,1,opt,name=epoch_number,json=epochNumber,proto3" json:"epoch_number,omitempty"` +} + +func (m *EventEpochEnd) Reset() { *m = EventEpochEnd{} } +func (m *EventEpochEnd) String() string { return proto.CompactTextString(m) } +func (*EventEpochEnd) ProtoMessage() {} +func (*EventEpochEnd) Descriptor() ([]byte, []int) { + return fileDescriptor_691f9b4b0a500cb4, []int{0} +} +func (m *EventEpochEnd) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventEpochEnd) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventEpochEnd.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 *EventEpochEnd) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventEpochEnd.Merge(m, src) +} +func (m *EventEpochEnd) XXX_Size() int { + return m.Size() +} +func (m *EventEpochEnd) XXX_DiscardUnknown() { + xxx_messageInfo_EventEpochEnd.DiscardUnknown(m) +} + +var xxx_messageInfo_EventEpochEnd proto.InternalMessageInfo + +func (m *EventEpochEnd) GetEpochNumber() int64 { + if m != nil { + return m.EpochNumber + } + return 0 +} + +// EventEpochStart is an event emitted when an epoch start. +type EventEpochStart struct { + EpochNumber int64 `protobuf:"varint,1,opt,name=epoch_number,json=epochNumber,proto3" json:"epoch_number,omitempty"` + EpochStartTime int64 `protobuf:"varint,2,opt,name=epoch_start_time,json=epochStartTime,proto3" json:"epoch_start_time,omitempty"` +} + +func (m *EventEpochStart) Reset() { *m = EventEpochStart{} } +func (m *EventEpochStart) String() string { return proto.CompactTextString(m) } +func (*EventEpochStart) ProtoMessage() {} +func (*EventEpochStart) Descriptor() ([]byte, []int) { + return fileDescriptor_691f9b4b0a500cb4, []int{1} +} +func (m *EventEpochStart) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventEpochStart) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventEpochStart.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 *EventEpochStart) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventEpochStart.Merge(m, src) +} +func (m *EventEpochStart) XXX_Size() int { + return m.Size() +} +func (m *EventEpochStart) XXX_DiscardUnknown() { + xxx_messageInfo_EventEpochStart.DiscardUnknown(m) +} + +var xxx_messageInfo_EventEpochStart proto.InternalMessageInfo + +func (m *EventEpochStart) GetEpochNumber() int64 { + if m != nil { + return m.EpochNumber + } + return 0 +} + +func (m *EventEpochStart) GetEpochStartTime() int64 { + if m != nil { + return m.EpochStartTime + } + return 0 +} + +func init() { + proto.RegisterType((*EventEpochEnd)(nil), "cosmos.epochs.v1beta1.EventEpochEnd") + proto.RegisterType((*EventEpochStart)(nil), "cosmos.epochs.v1beta1.EventEpochStart") +} + +func init() { + proto.RegisterFile("cosmos/epochs/v1beta1/events.proto", fileDescriptor_691f9b4b0a500cb4) +} + +var fileDescriptor_691f9b4b0a500cb4 = []byte{ + // 211 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4a, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0x2d, 0xc8, 0x4f, 0xce, 0x28, 0xd6, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, + 0x34, 0xd4, 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, 0x29, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, + 0x85, 0xa8, 0xd1, 0x83, 0xa8, 0xd1, 0x83, 0xaa, 0x51, 0x32, 0xe2, 0xe2, 0x75, 0x05, 0x29, 0x73, + 0x05, 0x09, 0xbb, 0xe6, 0xa5, 0x08, 0x29, 0x72, 0xf1, 0x80, 0x95, 0xc4, 0xe7, 0x95, 0xe6, 0x26, + 0xa5, 0x16, 0x49, 0x30, 0x2a, 0x30, 0x6a, 0x30, 0x07, 0x71, 0x83, 0xc5, 0xfc, 0xc0, 0x42, 0x4a, + 0x71, 0x5c, 0xfc, 0x08, 0x3d, 0xc1, 0x25, 0x89, 0x45, 0x25, 0x44, 0xe8, 0x12, 0xd2, 0xe0, 0x12, + 0x80, 0x28, 0x29, 0x06, 0xe9, 0x88, 0x2f, 0xc9, 0xcc, 0x4d, 0x95, 0x60, 0x02, 0x2b, 0xe3, 0x4b, + 0x85, 0x1b, 0x14, 0x92, 0x99, 0x9b, 0xea, 0xe4, 0x7a, 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, 0xda, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x50, + 0x3f, 0x43, 0x28, 0xdd, 0xe2, 0x94, 0x6c, 0xfd, 0x0a, 0x58, 0x00, 0x94, 0x54, 0x16, 0xa4, 0x16, + 0x27, 0xb1, 0x81, 0x3d, 0x6e, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xf7, 0x2e, 0xe8, 0x93, 0x1e, + 0x01, 0x00, 0x00, +} + +func (m *EventEpochEnd) 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 *EventEpochEnd) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventEpochEnd) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.EpochNumber != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.EpochNumber)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *EventEpochStart) 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 *EventEpochStart) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventEpochStart) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.EpochStartTime != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.EpochStartTime)) + i-- + dAtA[i] = 0x10 + } + if m.EpochNumber != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.EpochNumber)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { + offset -= sovEvents(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *EventEpochEnd) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.EpochNumber != 0 { + n += 1 + sovEvents(uint64(m.EpochNumber)) + } + return n +} + +func (m *EventEpochStart) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.EpochNumber != 0 { + n += 1 + sovEvents(uint64(m.EpochNumber)) + } + if m.EpochStartTime != 0 { + n += 1 + sovEvents(uint64(m.EpochStartTime)) + } + return n +} + +func sovEvents(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEvents(x uint64) (n int) { + return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *EventEpochEnd) 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 ErrIntOverflowEvents + } + 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: EventEpochEnd: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventEpochEnd: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EpochNumber", wireType) + } + m.EpochNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EpochNumber |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventEpochStart) 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 ErrIntOverflowEvents + } + 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: EventEpochStart: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventEpochStart: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EpochNumber", wireType) + } + m.EpochNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EpochNumber |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EpochStartTime", wireType) + } + m.EpochStartTime = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EpochStartTime |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipEvents(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, ErrIntOverflowEvents + } + 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, ErrIntOverflowEvents + } + 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, ErrIntOverflowEvents + } + 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, ErrInvalidLengthEvents + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupEvents + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthEvents + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/epochs/types/genesis.go b/x/epochs/types/genesis.go new file mode 100644 index 000000000000..1cdea892df49 --- /dev/null +++ b/x/epochs/types/genesis.go @@ -0,0 +1,69 @@ +package types + +import ( + "errors" + "time" +) + +// DefaultIndex is the default capability global index. +const DefaultIndex uint64 = 1 + +func NewGenesisState(epochs []EpochInfo) *GenesisState { + return &GenesisState{Epochs: epochs} +} + +// DefaultGenesis returns the default Capability genesis state. +func DefaultGenesis() *GenesisState { + epochs := []EpochInfo{ + NewGenesisEpochInfo("day", time.Hour*24), // alphabetical order + NewGenesisEpochInfo("hour", time.Hour), + NewGenesisEpochInfo("minute", time.Minute), + NewGenesisEpochInfo("week", time.Hour*24*7), + } + return NewGenesisState(epochs) +} + +// Validate performs basic genesis state validation returning an error upon any +// failure. +func (gs GenesisState) Validate() error { + epochIdentifiers := map[string]bool{} + for _, epoch := range gs.Epochs { + if err := epoch.Validate(); err != nil { + return err + } + if epochIdentifiers[epoch.Identifier] { + return errors.New("epoch identifier should be unique") + } + epochIdentifiers[epoch.Identifier] = true + } + return nil +} + +// Validate also validates epoch info. +func (epoch EpochInfo) Validate() error { + if epoch.Identifier == "" { + return errors.New("epoch identifier should NOT be empty") + } + if epoch.Duration == 0 { + return errors.New("epoch duration should NOT be 0") + } + if epoch.CurrentEpoch < 0 { + return errors.New("epoch CurrentEpoch must be non-negative") + } + if epoch.CurrentEpochStartHeight < 0 { + return errors.New("epoch CurrentEpochStartHeight must be non-negative") + } + return nil +} + +func NewGenesisEpochInfo(identifier string, duration time.Duration) EpochInfo { + return EpochInfo{ + Identifier: identifier, + StartTime: time.Time{}, + Duration: duration, + CurrentEpoch: 0, + CurrentEpochStartHeight: 0, + CurrentEpochStartTime: time.Time{}, + EpochCountingStarted: false, + } +} diff --git a/x/epochs/types/genesis.pb.go b/x/epochs/types/genesis.pb.go new file mode 100644 index 000000000000..75f50b89e959 --- /dev/null +++ b/x/epochs/types/genesis.pb.go @@ -0,0 +1,821 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/epochs/v1beta1/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + _ "google.golang.org/protobuf/types/known/durationpb" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// 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 + +// EpochInfo is a struct that describes the data going into +// a timer defined by the x/epochs module. +type EpochInfo struct { + // identifier is a unique reference to this particular timer. + Identifier string `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"` + // start_time is the time at which the timer first ever ticks. + // If start_time is in the future, the epoch will not begin until the start + // time. + StartTime time.Time `protobuf:"bytes,2,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time"` + // duration is the time in between epoch ticks. + // In order for intended behavior to be met, duration should + // be greater than the chains expected block time. + // Duration must be non-zero. + Duration time.Duration `protobuf:"bytes,3,opt,name=duration,proto3,stdduration" json:"duration,omitempty"` + // current_epoch is the current epoch number, or in other words, + // how many times has the timer 'ticked'. + // The first tick (current_epoch=1) is defined as + // the first block whose blocktime is greater than the EpochInfo start_time. + CurrentEpoch int64 `protobuf:"varint,4,opt,name=current_epoch,json=currentEpoch,proto3" json:"current_epoch,omitempty"` + // current_epoch_start_time describes the start time of the current timer + // interval. The interval is (current_epoch_start_time, + // current_epoch_start_time + duration] When the timer ticks, this is set to + // current_epoch_start_time = last_epoch_start_time + duration only one timer + // tick for a given identifier can occur per block. + // + // NOTE! The current_epoch_start_time may diverge significantly from the + // wall-clock time the epoch began at. Wall-clock time of epoch start may be + // >> current_epoch_start_time. Suppose current_epoch_start_time = 10, + // duration = 5. Suppose the chain goes offline at t=14, and comes back online + // at t=30, and produces blocks at every successive time. (t=31, 32, etc.) + // * The t=30 block will start the epoch for (10, 15] + // * The t=31 block will start the epoch for (15, 20] + // * The t=32 block will start the epoch for (20, 25] + // * The t=33 block will start the epoch for (25, 30] + // * The t=34 block will start the epoch for (30, 35] + // * The **t=36** block will start the epoch for (35, 40] + CurrentEpochStartTime time.Time `protobuf:"bytes,5,opt,name=current_epoch_start_time,json=currentEpochStartTime,proto3,stdtime" json:"current_epoch_start_time"` + // epoch_counting_started is a boolean, that indicates whether this + // epoch timer has began yet. + EpochCountingStarted bool `protobuf:"varint,6,opt,name=epoch_counting_started,json=epochCountingStarted,proto3" json:"epoch_counting_started,omitempty"` + // current_epoch_start_height is the block height at which the current epoch + // started. (The block height at which the timer last ticked) + CurrentEpochStartHeight int64 `protobuf:"varint,8,opt,name=current_epoch_start_height,json=currentEpochStartHeight,proto3" json:"current_epoch_start_height,omitempty"` +} + +func (m *EpochInfo) Reset() { *m = EpochInfo{} } +func (m *EpochInfo) String() string { return proto.CompactTextString(m) } +func (*EpochInfo) ProtoMessage() {} +func (*EpochInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_3a3d6d4398875177, []int{0} +} +func (m *EpochInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EpochInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EpochInfo.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 *EpochInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_EpochInfo.Merge(m, src) +} +func (m *EpochInfo) XXX_Size() int { + return m.Size() +} +func (m *EpochInfo) XXX_DiscardUnknown() { + xxx_messageInfo_EpochInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_EpochInfo proto.InternalMessageInfo + +func (m *EpochInfo) GetIdentifier() string { + if m != nil { + return m.Identifier + } + return "" +} + +func (m *EpochInfo) GetStartTime() time.Time { + if m != nil { + return m.StartTime + } + return time.Time{} +} + +func (m *EpochInfo) GetDuration() time.Duration { + if m != nil { + return m.Duration + } + return 0 +} + +func (m *EpochInfo) GetCurrentEpoch() int64 { + if m != nil { + return m.CurrentEpoch + } + return 0 +} + +func (m *EpochInfo) GetCurrentEpochStartTime() time.Time { + if m != nil { + return m.CurrentEpochStartTime + } + return time.Time{} +} + +func (m *EpochInfo) GetEpochCountingStarted() bool { + if m != nil { + return m.EpochCountingStarted + } + return false +} + +func (m *EpochInfo) GetCurrentEpochStartHeight() int64 { + if m != nil { + return m.CurrentEpochStartHeight + } + return 0 +} + +// GenesisState defines the epochs module's genesis state. +type GenesisState struct { + Epochs []EpochInfo `protobuf:"bytes,1,rep,name=epochs,proto3" json:"epochs"` +} + +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_3a3d6d4398875177, []int{1} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetEpochs() []EpochInfo { + if m != nil { + return m.Epochs + } + return nil +} + +func init() { + proto.RegisterType((*EpochInfo)(nil), "cosmos.epochs.v1beta1.EpochInfo") + proto.RegisterType((*GenesisState)(nil), "cosmos.epochs.v1beta1.GenesisState") +} + +func init() { + proto.RegisterFile("cosmos/epochs/v1beta1/genesis.proto", fileDescriptor_3a3d6d4398875177) +} + +var fileDescriptor_3a3d6d4398875177 = []byte{ + // 445 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x52, 0x3f, 0x6f, 0xd3, 0x40, + 0x1c, 0xcd, 0x91, 0x10, 0x9c, 0x6b, 0x91, 0xd0, 0xa9, 0x05, 0x93, 0xe1, 0x62, 0xb5, 0x8b, 0x25, + 0xe0, 0x4e, 0x2d, 0x6c, 0x48, 0x0c, 0x29, 0x15, 0x7f, 0x06, 0x06, 0x07, 0x16, 0x24, 0x14, 0x39, + 0xce, 0xe5, 0x7c, 0x02, 0xfb, 0x2c, 0xdf, 0xcf, 0x88, 0x7e, 0x8b, 0x8e, 0x7c, 0x20, 0x86, 0x8e, + 0x1d, 0x99, 0x0a, 0x4a, 0x36, 0x3e, 0x05, 0xf2, 0x9d, 0x1d, 0x05, 0x9a, 0xa5, 0x93, 0xed, 0x7b, + 0xef, 0xf7, 0xde, 0xbd, 0x9f, 0x1f, 0x3e, 0x4c, 0xb4, 0xc9, 0xb4, 0xe1, 0xa2, 0xd0, 0x49, 0x6a, + 0xf8, 0xd7, 0xa3, 0x99, 0x80, 0xf8, 0x88, 0x4b, 0x91, 0x0b, 0xa3, 0x0c, 0x2b, 0x4a, 0x0d, 0x9a, + 0xec, 0x3b, 0x12, 0x73, 0x24, 0xd6, 0x90, 0x86, 0x7b, 0x52, 0x4b, 0x6d, 0x19, 0xbc, 0x7e, 0x73, + 0xe4, 0x21, 0x95, 0x5a, 0xcb, 0x2f, 0x82, 0xdb, 0xaf, 0x59, 0xb5, 0xe0, 0xf3, 0xaa, 0x8c, 0x41, + 0xe9, 0xbc, 0xc1, 0x47, 0xff, 0xe3, 0xa0, 0x32, 0x61, 0x20, 0xce, 0x0a, 0x47, 0x38, 0xf8, 0xd1, + 0xc5, 0x83, 0xd3, 0xda, 0xe9, 0x4d, 0xbe, 0xd0, 0x84, 0x62, 0xac, 0xe6, 0x22, 0x07, 0xb5, 0x50, + 0xa2, 0xf4, 0x51, 0x80, 0xc2, 0x41, 0xb4, 0x71, 0x42, 0x4e, 0x30, 0x36, 0x10, 0x97, 0x30, 0xad, + 0x65, 0xfc, 0x5b, 0x01, 0x0a, 0x77, 0x8e, 0x87, 0xcc, 0x79, 0xb0, 0xd6, 0x83, 0xbd, 0x6f, 0x3d, + 0xc6, 0xde, 0xc5, 0xd5, 0xa8, 0x73, 0xfe, 0x6b, 0x84, 0xa2, 0x81, 0x9d, 0xab, 0x11, 0xf2, 0x01, + 0x7b, 0xed, 0x2d, 0xfd, 0xae, 0x95, 0x78, 0x78, 0x4d, 0xe2, 0x65, 0x43, 0x18, 0xd3, 0x5a, 0xe1, + 0xcf, 0xd5, 0x88, 0xb4, 0x23, 0x8f, 0x75, 0xa6, 0x40, 0x64, 0x05, 0x9c, 0x7d, 0xaf, 0x75, 0xd7, + 0x52, 0xe4, 0x10, 0xdf, 0x4d, 0xaa, 0xb2, 0x14, 0x39, 0x4c, 0xed, 0xea, 0xfc, 0x5e, 0x80, 0xc2, + 0x6e, 0xb4, 0xdb, 0x1c, 0xda, 0x90, 0xe4, 0x13, 0xf6, 0xff, 0x21, 0x4d, 0x37, 0xe2, 0xdc, 0xbe, + 0x41, 0x9c, 0xfd, 0x4d, 0xd5, 0xc9, 0x3a, 0xda, 0x33, 0x7c, 0xdf, 0xc9, 0x26, 0xba, 0xca, 0x41, + 0xe5, 0xd2, 0xe9, 0x8b, 0xb9, 0xdf, 0x0f, 0x50, 0xe8, 0x45, 0x7b, 0x16, 0x3d, 0x69, 0xc0, 0x89, + 0xc3, 0xc8, 0x73, 0x3c, 0xdc, 0x76, 0xa9, 0x54, 0x28, 0x99, 0x82, 0xef, 0xd9, 0x18, 0x0f, 0xae, + 0x19, 0xbe, 0xb6, 0xf0, 0xdb, 0x9e, 0x77, 0xe7, 0x9e, 0x77, 0xf0, 0x0e, 0xef, 0xbe, 0x72, 0x2d, + 0x9a, 0x40, 0x0c, 0x82, 0xbc, 0xc0, 0x7d, 0xd7, 0x1f, 0x1f, 0x05, 0xdd, 0x70, 0xe7, 0x38, 0x60, + 0x5b, 0x5b, 0xc5, 0xd6, 0xbf, 0x7e, 0xdc, 0xab, 0xb3, 0x45, 0xcd, 0xd4, 0xf8, 0xf4, 0x62, 0x49, + 0xd1, 0xe5, 0x92, 0xa2, 0xdf, 0x4b, 0x8a, 0xce, 0x57, 0xb4, 0x73, 0xb9, 0xa2, 0x9d, 0x9f, 0x2b, + 0xda, 0xf9, 0xf8, 0x48, 0x2a, 0x48, 0xab, 0x19, 0x4b, 0x74, 0xc6, 0x9b, 0x3a, 0xbb, 0xc7, 0x13, + 0x33, 0xff, 0xcc, 0xbf, 0xb5, 0xdd, 0x86, 0xb3, 0x42, 0x98, 0x59, 0xdf, 0x2e, 0xf1, 0xe9, 0xdf, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x71, 0xa8, 0x51, 0xe8, 0xf9, 0x02, 0x00, 0x00, +} + +func (m *EpochInfo) 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 *EpochInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EpochInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.CurrentEpochStartHeight != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.CurrentEpochStartHeight)) + i-- + dAtA[i] = 0x40 + } + if m.EpochCountingStarted { + i-- + if m.EpochCountingStarted { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.CurrentEpochStartTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.CurrentEpochStartTime):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintGenesis(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x2a + if m.CurrentEpoch != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.CurrentEpoch)) + i-- + dAtA[i] = 0x20 + } + n2, err2 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.Duration):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintGenesis(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x1a + n3, err3 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StartTime):]) + if err3 != nil { + return 0, err3 + } + i -= n3 + i = encodeVarintGenesis(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0x12 + if len(m.Identifier) > 0 { + i -= len(m.Identifier) + copy(dAtA[i:], m.Identifier) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Identifier))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +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 + if len(m.Epochs) > 0 { + for iNdEx := len(m.Epochs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Epochs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func 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 *EpochInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Identifier) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StartTime) + n += 1 + l + sovGenesis(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.Duration) + n += 1 + l + sovGenesis(uint64(l)) + if m.CurrentEpoch != 0 { + n += 1 + sovGenesis(uint64(m.CurrentEpoch)) + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.CurrentEpochStartTime) + n += 1 + l + sovGenesis(uint64(l)) + if m.EpochCountingStarted { + n += 2 + } + if m.CurrentEpochStartHeight != 0 { + n += 1 + sovGenesis(uint64(m.CurrentEpochStartHeight)) + } + return n +} + +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Epochs) > 0 { + for _, e := range m.Epochs { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *EpochInfo) 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: EpochInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EpochInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Identifier", 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.Identifier = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.StartTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.Duration, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrentEpoch", wireType) + } + m.CurrentEpoch = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CurrentEpoch |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrentEpochStartTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.CurrentEpochStartTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EpochCountingStarted", 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.EpochCountingStarted = bool(v != 0) + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrentEpochStartHeight", wireType) + } + m.CurrentEpochStartHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CurrentEpochStartHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GenesisState) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Epochs", 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.Epochs = append(m.Epochs, EpochInfo{}) + if err := m.Epochs[len(m.Epochs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func 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/epochs/types/hooks.go b/x/epochs/types/hooks.go new file mode 100644 index 000000000000..f8609a39058a --- /dev/null +++ b/x/epochs/types/hooks.go @@ -0,0 +1,46 @@ +package types + +import ( + "context" + "errors" +) + +type EpochHooks interface { + // the first block whose timestamp is after the duration is counted as the end of the epoch + AfterEpochEnd(ctx context.Context, epochIdentifier string, epochNumber int64) error + // new epoch is next block of epoch end block + BeforeEpochStart(ctx context.Context, epochIdentifier string, epochNumber int64) error +} + +var _ EpochHooks = MultiEpochHooks{} + +// combine multiple gamm hooks, all hook functions are run in array sequence. +type MultiEpochHooks []EpochHooks + +func NewMultiEpochHooks(hooks ...EpochHooks) MultiEpochHooks { + return hooks +} + +// AfterEpochEnd is called when epoch is going to be ended, epochNumber is the number of epoch that is ending. +func (h MultiEpochHooks) AfterEpochEnd(ctx context.Context, epochIdentifier string, epochNumber int64) error { + var errs error + for i := range h { + errs = errors.Join(errs, h[i].AfterEpochEnd(ctx, epochIdentifier, epochNumber)) + } + return errs +} + +// BeforeEpochStart is called when epoch is going to be started, epochNumber is the number of epoch that is starting. +func (h MultiEpochHooks) BeforeEpochStart(ctx context.Context, epochIdentifier string, epochNumber int64) error { + var errs error + for i := range h { + errs = errors.Join(errs, h[i].BeforeEpochStart(ctx, epochIdentifier, epochNumber)) + } + return errs +} + +// EpochHooksWrapper is a wrapper for modules to inject EpochHooks using depinject. +type EpochHooksWrapper struct{ EpochHooks } + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (EpochHooksWrapper) IsOnePerModuleType() {} diff --git a/x/epochs/types/hooks_test.go b/x/epochs/types/hooks_test.go new file mode 100644 index 000000000000..5ee22c1a1855 --- /dev/null +++ b/x/epochs/types/hooks_test.go @@ -0,0 +1,111 @@ +package types_test + +import ( + "context" + "testing" + + "github.com/stretchr/testify/suite" + + "cosmossdk.io/errors" + storetypes "cosmossdk.io/store/types" + + "github.com/cosmos/cosmos-sdk/testutil" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/epochs/types" +) + +type KeeperTestSuite struct { + suite.Suite + Ctx sdk.Context +} + +func TestKeeperTestSuite(t *testing.T) { + suite.Run(t, new(KeeperTestSuite)) +} + +func (s *KeeperTestSuite) SetupTest() { + s.Ctx = testutil.DefaultContext(storetypes.NewKVStoreKey(types.StoreKey), storetypes.NewTransientStoreKey("transient_test")) +} + +var dummyErr = errors.New("9", 9, "dummyError") + +// dummyEpochHook is a struct satisfying the epoch hook interface, +// that maintains a counter for how many times its been successfully called, +// and a boolean for whether it should panic during its execution. +type dummyEpochHook struct { + successCounter int + shouldError bool +} + +func (hook *dummyEpochHook) AfterEpochEnd(ctx context.Context, epochIdentifier string, epochNumber int64) error { + if hook.shouldError { + return dummyErr + } + hook.successCounter += 1 + return nil +} + +func (hook *dummyEpochHook) BeforeEpochStart(ctx context.Context, epochIdentifier string, epochNumber int64) error { + if hook.shouldError { + return dummyErr + } + hook.successCounter += 1 + return nil +} + +func (hook *dummyEpochHook) Clone() *dummyEpochHook { + newHook := dummyEpochHook{successCounter: hook.successCounter, shouldError: hook.shouldError} + return &newHook +} + +var _ types.EpochHooks = &dummyEpochHook{} + +func (s *KeeperTestSuite) TestHooksPanicRecovery() { + errorHook := dummyEpochHook{shouldError: true} + noErrorHook := dummyEpochHook{shouldError: false} + simpleHooks := []dummyEpochHook{errorHook, noErrorHook} + + tests := []struct { + hooks []dummyEpochHook + expectedCounterValues []int + lenEvents int + expErr bool + }{ + {[]dummyEpochHook{errorHook}, []int{0}, 0, true}, + {simpleHooks, []int{0, 1, 0, 1}, 2, true}, + } + + for tcIndex, tc := range tests { + for epochActionSelector := 0; epochActionSelector < 2; epochActionSelector++ { + s.SetupTest() + hookRefs := []types.EpochHooks{} + + for _, hook := range tc.hooks { + hookRefs = append(hookRefs, hook.Clone()) + } + + hooks := types.NewMultiEpochHooks(hookRefs...) + + if epochActionSelector == 0 { + err := hooks.BeforeEpochStart(s.Ctx, "id", 0) + if tc.expErr { + s.Require().Error(err) + } else { + s.Require().NoError(err) + } + } else if epochActionSelector == 1 { + err := hooks.AfterEpochEnd(s.Ctx, "id", 0) + if tc.expErr { + s.Require().Error(err) + } else { + s.Require().NoError(err) + } + } + + for i := 0; i < len(hooks); i++ { + epochHook := hookRefs[i].(*dummyEpochHook) + s.Require().Equal(tc.expectedCounterValues[i], epochHook.successCounter, "test case index %d", tcIndex) + } + } + } +} diff --git a/x/epochs/types/keys.go b/x/epochs/types/keys.go new file mode 100644 index 000000000000..27d7a7245cc1 --- /dev/null +++ b/x/epochs/types/keys.go @@ -0,0 +1,16 @@ +package types + +import ( + "cosmossdk.io/collections" +) + +const ( + // ModuleName defines the module name. + ModuleName = "epochs" + + // StoreKey defines the primary module store key. + StoreKey = ModuleName +) + +// KeyPrefixEpoch defines prefix key for storing epochs. +var KeyPrefixEpoch = collections.NewPrefix(1) diff --git a/x/epochs/types/query.pb.go b/x/epochs/types/query.pb.go new file mode 100644 index 000000000000..09210b268b5a --- /dev/null +++ b/x/epochs/types/query.pb.go @@ -0,0 +1,919 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/epochs/v1beta1/query.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// QueryEpochInfosRequest defines the gRPC request structure for +// querying all epoch info. +type QueryEpochInfosRequest struct { +} + +func (m *QueryEpochInfosRequest) Reset() { *m = QueryEpochInfosRequest{} } +func (m *QueryEpochInfosRequest) String() string { return proto.CompactTextString(m) } +func (*QueryEpochInfosRequest) ProtoMessage() {} +func (*QueryEpochInfosRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_dacbc976c75f2414, []int{0} +} +func (m *QueryEpochInfosRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryEpochInfosRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryEpochInfosRequest.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 *QueryEpochInfosRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryEpochInfosRequest.Merge(m, src) +} +func (m *QueryEpochInfosRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryEpochInfosRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryEpochInfosRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryEpochInfosRequest proto.InternalMessageInfo + +// QueryEpochInfosRequest defines the gRPC response structure for +// querying all epoch info. +type QueryEpochInfosResponse struct { + Epochs []EpochInfo `protobuf:"bytes,1,rep,name=epochs,proto3" json:"epochs"` +} + +func (m *QueryEpochInfosResponse) Reset() { *m = QueryEpochInfosResponse{} } +func (m *QueryEpochInfosResponse) String() string { return proto.CompactTextString(m) } +func (*QueryEpochInfosResponse) ProtoMessage() {} +func (*QueryEpochInfosResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_dacbc976c75f2414, []int{1} +} +func (m *QueryEpochInfosResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryEpochInfosResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryEpochInfosResponse.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 *QueryEpochInfosResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryEpochInfosResponse.Merge(m, src) +} +func (m *QueryEpochInfosResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryEpochInfosResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryEpochInfosResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryEpochInfosResponse proto.InternalMessageInfo + +func (m *QueryEpochInfosResponse) GetEpochs() []EpochInfo { + if m != nil { + return m.Epochs + } + return nil +} + +// QueryCurrentEpochRequest defines the gRPC request structure for +// querying an epoch by its identifier. +type QueryCurrentEpochRequest struct { + Identifier string `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"` +} + +func (m *QueryCurrentEpochRequest) Reset() { *m = QueryCurrentEpochRequest{} } +func (m *QueryCurrentEpochRequest) String() string { return proto.CompactTextString(m) } +func (*QueryCurrentEpochRequest) ProtoMessage() {} +func (*QueryCurrentEpochRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_dacbc976c75f2414, []int{2} +} +func (m *QueryCurrentEpochRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCurrentEpochRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCurrentEpochRequest.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 *QueryCurrentEpochRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCurrentEpochRequest.Merge(m, src) +} +func (m *QueryCurrentEpochRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryCurrentEpochRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCurrentEpochRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCurrentEpochRequest proto.InternalMessageInfo + +func (m *QueryCurrentEpochRequest) GetIdentifier() string { + if m != nil { + return m.Identifier + } + return "" +} + +// QueryCurrentEpochResponse defines the gRPC response structure for +// querying an epoch by its identifier. +type QueryCurrentEpochResponse struct { + CurrentEpoch int64 `protobuf:"varint,1,opt,name=current_epoch,json=currentEpoch,proto3" json:"current_epoch,omitempty"` +} + +func (m *QueryCurrentEpochResponse) Reset() { *m = QueryCurrentEpochResponse{} } +func (m *QueryCurrentEpochResponse) String() string { return proto.CompactTextString(m) } +func (*QueryCurrentEpochResponse) ProtoMessage() {} +func (*QueryCurrentEpochResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_dacbc976c75f2414, []int{3} +} +func (m *QueryCurrentEpochResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCurrentEpochResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCurrentEpochResponse.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 *QueryCurrentEpochResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCurrentEpochResponse.Merge(m, src) +} +func (m *QueryCurrentEpochResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryCurrentEpochResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCurrentEpochResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCurrentEpochResponse proto.InternalMessageInfo + +func (m *QueryCurrentEpochResponse) GetCurrentEpoch() int64 { + if m != nil { + return m.CurrentEpoch + } + return 0 +} + +func init() { + proto.RegisterType((*QueryEpochInfosRequest)(nil), "cosmos.epochs.v1beta1.QueryEpochInfosRequest") + proto.RegisterType((*QueryEpochInfosResponse)(nil), "cosmos.epochs.v1beta1.QueryEpochInfosResponse") + proto.RegisterType((*QueryCurrentEpochRequest)(nil), "cosmos.epochs.v1beta1.QueryCurrentEpochRequest") + proto.RegisterType((*QueryCurrentEpochResponse)(nil), "cosmos.epochs.v1beta1.QueryCurrentEpochResponse") +} + +func init() { proto.RegisterFile("cosmos/epochs/v1beta1/query.proto", fileDescriptor_dacbc976c75f2414) } + +var fileDescriptor_dacbc976c75f2414 = []byte{ + // 386 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xcf, 0x4e, 0xe2, 0x40, + 0x1c, 0xc7, 0x3b, 0xb0, 0x4b, 0xb2, 0xb3, 0xec, 0x65, 0xb2, 0xbb, 0xd6, 0x46, 0x0b, 0x16, 0x35, + 0x24, 0x4a, 0x47, 0xf0, 0xe6, 0xc1, 0x18, 0x0c, 0x07, 0x8f, 0xf6, 0xa6, 0x17, 0x53, 0xca, 0x50, + 0x1a, 0x65, 0xa6, 0x74, 0xa6, 0x46, 0xae, 0x3e, 0x81, 0xd1, 0x07, 0xf0, 0x4d, 0x3c, 0x73, 0x24, + 0xf1, 0xe2, 0xc9, 0x18, 0xf0, 0x41, 0x0c, 0x33, 0x45, 0x31, 0x16, 0xc3, 0x09, 0x3a, 0xf3, 0xf9, + 0xfe, 0xf9, 0xfd, 0x5a, 0xb8, 0xe6, 0x31, 0xde, 0x65, 0x1c, 0x93, 0x90, 0x79, 0x1d, 0x8e, 0x2f, + 0xab, 0x4d, 0x22, 0xdc, 0x2a, 0xee, 0xc5, 0x24, 0xea, 0xdb, 0x61, 0xc4, 0x04, 0x43, 0xff, 0x14, + 0x62, 0x2b, 0xc4, 0x4e, 0x10, 0xe3, 0xaf, 0xcf, 0x7c, 0x26, 0x09, 0x3c, 0xf9, 0xa7, 0x60, 0x63, + 0xc5, 0x67, 0xcc, 0xbf, 0x20, 0xd8, 0x0d, 0x03, 0xec, 0x52, 0xca, 0x84, 0x2b, 0x02, 0x46, 0x79, + 0x72, 0x5b, 0x4a, 0x4f, 0xf3, 0x09, 0x25, 0x3c, 0x48, 0x20, 0x4b, 0x87, 0xff, 0x8f, 0x27, 0xf1, + 0x8d, 0x09, 0x74, 0x44, 0xdb, 0x8c, 0x3b, 0xa4, 0x17, 0x13, 0x2e, 0xac, 0x13, 0xb8, 0xf4, 0xe5, + 0x86, 0x87, 0x8c, 0x72, 0x82, 0xf6, 0x61, 0x4e, 0x99, 0xea, 0xa0, 0x98, 0x2d, 0xff, 0xae, 0x15, + 0xed, 0xd4, 0xd6, 0xf6, 0xbb, 0xb4, 0xfe, 0x63, 0xf0, 0x5c, 0xd0, 0x9c, 0x44, 0x65, 0xed, 0x41, + 0x5d, 0x5a, 0x1f, 0xc6, 0x51, 0x44, 0xa8, 0x90, 0x58, 0x12, 0x8b, 0x4c, 0x08, 0x83, 0x16, 0xa1, + 0x22, 0x68, 0x07, 0x24, 0xd2, 0x41, 0x11, 0x94, 0x7f, 0x39, 0x33, 0x27, 0xd6, 0x01, 0x5c, 0x4e, + 0xd1, 0x26, 0xc5, 0x4a, 0xf0, 0x8f, 0xa7, 0xce, 0xcf, 0x64, 0x94, 0xd4, 0x67, 0x9d, 0xbc, 0x37, + 0x03, 0xd7, 0x1e, 0x32, 0xf0, 0xa7, 0xb4, 0x40, 0xb7, 0x00, 0xc2, 0x8f, 0xf1, 0x50, 0x65, 0xce, + 0x18, 0xe9, 0x0b, 0x32, 0xec, 0x45, 0x71, 0x55, 0xce, 0xda, 0xb8, 0x7e, 0x7c, 0xbd, 0xcb, 0x14, + 0xd0, 0x2a, 0x4e, 0x7f, 0x31, 0xea, 0x11, 0xdd, 0x03, 0x98, 0x9f, 0x1d, 0x0e, 0xe1, 0xef, 0x72, + 0x52, 0x56, 0x68, 0xec, 0x2c, 0x2e, 0x48, 0xaa, 0x6d, 0xcb, 0x6a, 0x9b, 0x68, 0x7d, 0x4e, 0xb5, + 0x4f, 0x4b, 0xad, 0x37, 0x06, 0x23, 0x13, 0x0c, 0x47, 0x26, 0x78, 0x19, 0x99, 0xe0, 0x66, 0x6c, + 0x6a, 0xc3, 0xb1, 0xa9, 0x3d, 0x8d, 0x4d, 0xed, 0x74, 0xcb, 0x0f, 0x44, 0x27, 0x6e, 0xda, 0x1e, + 0xeb, 0x4e, 0x9d, 0xd4, 0x4f, 0x85, 0xb7, 0xce, 0xf1, 0xd5, 0xd4, 0x56, 0xf4, 0x43, 0xc2, 0x9b, + 0x39, 0xf9, 0x05, 0xee, 0xbe, 0x05, 0x00, 0x00, 0xff, 0xff, 0xfa, 0x90, 0xfa, 0x87, 0x16, 0x03, + 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // EpochInfos provide running epochInfos + EpochInfos(ctx context.Context, in *QueryEpochInfosRequest, opts ...grpc.CallOption) (*QueryEpochInfosResponse, error) + // CurrentEpoch provide current epoch of specified identifier + CurrentEpoch(ctx context.Context, in *QueryCurrentEpochRequest, opts ...grpc.CallOption) (*QueryCurrentEpochResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) EpochInfos(ctx context.Context, in *QueryEpochInfosRequest, opts ...grpc.CallOption) (*QueryEpochInfosResponse, error) { + out := new(QueryEpochInfosResponse) + err := c.cc.Invoke(ctx, "/cosmos.epochs.v1beta1.Query/EpochInfos", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) CurrentEpoch(ctx context.Context, in *QueryCurrentEpochRequest, opts ...grpc.CallOption) (*QueryCurrentEpochResponse, error) { + out := new(QueryCurrentEpochResponse) + err := c.cc.Invoke(ctx, "/cosmos.epochs.v1beta1.Query/CurrentEpoch", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // EpochInfos provide running epochInfos + EpochInfos(context.Context, *QueryEpochInfosRequest) (*QueryEpochInfosResponse, error) + // CurrentEpoch provide current epoch of specified identifier + CurrentEpoch(context.Context, *QueryCurrentEpochRequest) (*QueryCurrentEpochResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) EpochInfos(ctx context.Context, req *QueryEpochInfosRequest) (*QueryEpochInfosResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EpochInfos not implemented") +} +func (*UnimplementedQueryServer) CurrentEpoch(ctx context.Context, req *QueryCurrentEpochRequest) (*QueryCurrentEpochResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CurrentEpoch not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_EpochInfos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryEpochInfosRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).EpochInfos(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.epochs.v1beta1.Query/EpochInfos", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).EpochInfos(ctx, req.(*QueryEpochInfosRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_CurrentEpoch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryCurrentEpochRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).CurrentEpoch(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.epochs.v1beta1.Query/CurrentEpoch", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).CurrentEpoch(ctx, req.(*QueryCurrentEpochRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var Query_serviceDesc = _Query_serviceDesc +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.epochs.v1beta1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "EpochInfos", + Handler: _Query_EpochInfos_Handler, + }, + { + MethodName: "CurrentEpoch", + Handler: _Query_CurrentEpoch_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/epochs/v1beta1/query.proto", +} + +func (m *QueryEpochInfosRequest) 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 *QueryEpochInfosRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryEpochInfosRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryEpochInfosResponse) 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 *QueryEpochInfosResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryEpochInfosResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Epochs) > 0 { + for iNdEx := len(m.Epochs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Epochs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryCurrentEpochRequest) 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 *QueryCurrentEpochRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCurrentEpochRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Identifier) > 0 { + i -= len(m.Identifier) + copy(dAtA[i:], m.Identifier) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Identifier))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryCurrentEpochResponse) 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 *QueryCurrentEpochResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCurrentEpochResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.CurrentEpoch != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.CurrentEpoch)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryEpochInfosRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryEpochInfosResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Epochs) > 0 { + for _, e := range m.Epochs { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryCurrentEpochRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Identifier) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryCurrentEpochResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CurrentEpoch != 0 { + n += 1 + sovQuery(uint64(m.CurrentEpoch)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryEpochInfosRequest) 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: QueryEpochInfosRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryEpochInfosRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryEpochInfosResponse) 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: QueryEpochInfosResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryEpochInfosResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Epochs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Epochs = append(m.Epochs, EpochInfo{}) + if err := m.Epochs[len(m.Epochs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryCurrentEpochRequest) 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: QueryCurrentEpochRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCurrentEpochRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Identifier", 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.Identifier = 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 *QueryCurrentEpochResponse) 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: QueryCurrentEpochResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCurrentEpochResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrentEpoch", wireType) + } + m.CurrentEpoch = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CurrentEpoch |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/epochs/types/query.pb.gw.go b/x/epochs/types/query.pb.gw.go new file mode 100644 index 000000000000..caabc82c64c3 --- /dev/null +++ b/x/epochs/types/query.pb.gw.go @@ -0,0 +1,236 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: cosmos/epochs/v1beta1/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_EpochInfos_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryEpochInfosRequest + var metadata runtime.ServerMetadata + + msg, err := client.EpochInfos(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_EpochInfos_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryEpochInfosRequest + var metadata runtime.ServerMetadata + + msg, err := server.EpochInfos(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_CurrentEpoch_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_CurrentEpoch_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCurrentEpochRequest + 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_CurrentEpoch_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CurrentEpoch(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_CurrentEpoch_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCurrentEpochRequest + 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_CurrentEpoch_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CurrentEpoch(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_EpochInfos_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_EpochInfos_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_EpochInfos_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_CurrentEpoch_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_CurrentEpoch_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_CurrentEpoch_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_EpochInfos_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_EpochInfos_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_EpochInfos_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_CurrentEpoch_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_CurrentEpoch_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_CurrentEpoch_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_EpochInfos_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 1}, []string{"cosmos", "epochs", "v1beta1"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_CurrentEpoch_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "epochs", "v1beta1", "current_epoch"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_EpochInfos_0 = runtime.ForwardResponseMessage + + forward_Query_CurrentEpoch_0 = runtime.ForwardResponseMessage +) diff --git a/x/evidence/CHANGELOG.md b/x/evidence/CHANGELOG.md index 1f1cf2d4f844..ec16f3188f1a 100644 --- a/x/evidence/CHANGELOG.md +++ b/x/evidence/CHANGELOG.md @@ -23,11 +23,18 @@ Ref: https://keepachangelog.com/en/1.0.0/ # Changelog -## [Unreleased] +## [v0.1.1](https://github.com/cosmos/cosmos-sdk/releases/tag/x/evidence/v0.1.1) - 2024-04-22 + +### Improvements + +* (deps) [#19810](https://github.com/cosmos/cosmos-sdk/pull/19810) Upgrade SDK version due to prometheus breaking change. +* (deps) [#19810](https://github.com/cosmos/cosmos-sdk/pull/19810) Bump `cosmossdk.io/store` to v1.1.0. + +## [v0.1.0](https://github.com/cosmos/cosmos-sdk/releases/tag/x/evidence/v0.1.0) - 2023-11-07 ### Features -* (x/evidence) [14724](https://github.com/cosmos/cosmos-sdk/pull/14724) The `x/evidence` module is extracted to have a separate go.mod file which allows it be a standalone module. +* (x/evidence) [14724](https://github.com/cosmos/cosmos-sdk/pull/14724) The `x/evidence` module is extracted to have a separate go.mod file which allows it be a standalone module. * (keeper) [#15420](https://github.com/cosmos/cosmos-sdk/pull/15420) Move `BeginBlocker` to the keeper folder & make HandleEquivocation private ### API Breaking Changes @@ -35,4 +42,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#16008](https://github.com/cosmos/cosmos-sdk/pull/16008) NewKeeper now takes in a KVStoreService instead of KVStoreKey, most functions use context.Context instead of sdk.Context and `IterateEvidence` callback function now returns an error to stop interation (`errors.ErrStopIterating`). * (keeper) [#15825](https://github.com/cosmos/cosmos-sdk/pull/15825) Evidence constructor now requires an `address.Codec` (`import "cosmossdk.io/core/address"`) * [#16336](https://github.com/cosmos/cosmos-sdk/pull/16336) Use collections for state management: - * Removed: keeper `SetEvidence`, `GetEvidence`, `IterateEvidences`, `GetAllEvidences`, `MustMarshalEvidence`, `MustUnmarshalEvidence`, `MarshalEvidence`, `UnmarshalEvidence` + * Removed: keeper `SetEvidence`, `GetEvidence`, `IterateEvidences`, `GetAllEvidences`, `MustMarshalEvidence`, `MustUnmarshalEvidence`, `MarshalEvidence`, `UnmarshalEvidence` + +### Client Breaking Changes + +* [#16625](https://github.com/cosmos/cosmos-sdk/pull/16625) The `simd q evidence evidence` command supports only querying an evidence by hash. For querying all evidences, use `simd q evidence list` instead. diff --git a/x/evidence/README.md b/x/evidence/README.md index d676e3c7c257..00c4abf41b2f 100644 --- a/x/evidence/README.md +++ b/x/evidence/README.md @@ -219,7 +219,7 @@ The Cosmos SDK handles two types of evidence inside the ABCI `BeginBlock`: The evidence module handles these two evidence types the same way. First, the Cosmos SDK converts the CometBFT concrete evidence type to an SDK `Evidence` interface using `Equivocation` as the concrete type. ```protobuf reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/evidence/v1beta1/evidence.proto#L12-L32 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/evidence/v1beta1/evidence.proto#L12-L32 ``` For some `Equivocation` submitted in `block` to be valid, it must satisfy: @@ -243,7 +243,7 @@ validator to ever re-enter the validator set. The `Equivocation` evidence is handled as follows: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/evidence/keeper/infraction.go#L26-L140 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/x/evidence/keeper/infraction.go#L26-L140 ``` **Note:** The slashing, jailing, and tombstoning calls are delegated through the `x/slashing` module @@ -271,7 +271,7 @@ The `evidence` command allows users to list all evidence or evidence by hash. Usage: ```bash -simd query evidence [flags] +simd query evidence evidence [flags] ``` To query evidence by hash @@ -279,7 +279,7 @@ To query evidence by hash Example: ```bash -simd query evidence "DF0C23E8634E480F84B9D5674A7CDC9816466DEC28A3358F73260F68D28D7660" +simd query evidence evidence "DF0C23E8634E480F84B9D5674A7CDC9816466DEC28A3358F73260F68D28D7660" ``` Example Output: @@ -297,7 +297,7 @@ To get all evidence Example: ```bash -simd query evidence +simd query evidence list ``` Example Output: diff --git a/x/evidence/autocli.go b/x/evidence/autocli.go new file mode 100644 index 000000000000..b8e8c51aa342 --- /dev/null +++ b/x/evidence/autocli.go @@ -0,0 +1,34 @@ +package evidence + +import ( + "fmt" + + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + evidencev1beta1 "cosmossdk.io/api/cosmos/evidence/v1beta1" + + "github.com/cosmos/cosmos-sdk/version" +) + +// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. +func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { + return &autocliv1.ModuleOptions{ + Query: &autocliv1.ServiceCommandDescriptor{ + Service: evidencev1beta1.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Evidence", + Use: "evidence [hash]", + Short: "Query for evidence by hash", + Example: fmt.Sprintf("%s query evidence evidence DF0C23E8634E480F84B9D5674A7CDC9816466DEC28A3358F73260F68D28D7660", version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "hash"}}, + }, + { + RpcMethod: "AllEvidence", + Use: "list", + Short: "Query all (paginated) submitted evidence", + Example: fmt.Sprintf("%s query evidence list --page=2 --page-limit=50", version.AppName), + }, + }, + }, + } +} diff --git a/x/evidence/client/cli/query.go b/x/evidence/client/cli/query.go deleted file mode 100644 index 3692ee5acdca..000000000000 --- a/x/evidence/client/cli/query.go +++ /dev/null @@ -1,92 +0,0 @@ -package cli - -import ( - "context" - "fmt" - "strings" - - "cosmossdk.io/x/evidence/types" - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/types/query" - "github.com/cosmos/cosmos-sdk/version" -) - -// GetQueryCmd returns the CLI command with all evidence module query commands -// mounted. -func GetQueryCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: types.ModuleName, - Short: "Query for evidence by hash or for all (paginated) submitted evidence", - Long: strings.TrimSpace( - fmt.Sprintf(`Query for specific submitted evidence by hash or query for all (paginated) evidence: - -Example: -$ %s query %s DF0C23E8634E480F84B9D5674A7CDC9816466DEC28A3358F73260F68D28D7660 -$ %s query %s --page=2 --limit=50 -`, - version.AppName, types.ModuleName, version.AppName, types.ModuleName, - ), - ), - Args: cobra.MaximumNArgs(1), - SuggestionsMinimumDistance: 2, - RunE: QueryEvidenceCmd(), - } - - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "evidence") - - return cmd -} - -// QueryEvidenceCmd returns the command handler for evidence querying. Evidence -// can be queried for by hash or paginated evidence can be returned. -func QueryEvidenceCmd() func(*cobra.Command, []string) error { - return func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - if len(args) > 0 { - return queryEvidence(clientCtx, args[0]) - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - return queryAllEvidence(clientCtx, pageReq) - } -} - -// queryEvidence queries for a single evidence by the given hash. -func queryEvidence(clientCtx client.Context, hash string) error { - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryEvidenceRequest{Hash: hash} - res, err := queryClient.Evidence(context.Background(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res.Evidence) -} - -// queryAllEvidence returns all evidences. -func queryAllEvidence(clientCtx client.Context, pageReq *query.PageRequest) error { - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryAllEvidenceRequest{ - Pagination: pageReq, - } - - res, err := queryClient.AllEvidence(context.Background(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) -} diff --git a/x/evidence/client/cli/query_test.go b/x/evidence/client/cli/query_test.go deleted file mode 100644 index 5567d0427e5b..000000000000 --- a/x/evidence/client/cli/query_test.go +++ /dev/null @@ -1,81 +0,0 @@ -package cli_test - -import ( - "context" - "fmt" - "io" - "strings" - "testing" - - "cosmossdk.io/x/evidence" - "cosmossdk.io/x/evidence/client/cli" - rpcclientmock "github.com/cometbft/cometbft/rpc/client/mock" - "github.com/stretchr/testify/require" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/crypto/keyring" - svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - testutilmod "github.com/cosmos/cosmos-sdk/types/module/testutil" -) - -func TestGetQueryCmd(t *testing.T) { - encCfg := testutilmod.MakeTestEncodingConfig(evidence.AppModuleBasic{}) - kr := keyring.NewInMemory(encCfg.Codec) - baseCtx := client.Context{}. - WithKeyring(kr). - WithTxConfig(encCfg.TxConfig). - WithCodec(encCfg.Codec). - WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}). - WithAccountRetriever(client.MockAccountRetriever{}). - WithOutput(io.Discard). - WithChainID("test-chain") - - testCases := map[string]struct { - args []string - expectedOutput string - expectErrMsg string - }{ - "invalid args": { - []string{"foo", "bar"}, - "", - "accepts at most 1 arg(s)", - }, - "all evidence (default pagination)": { - []string{}, - "evidence: []\npagination: null", - "", - }, - "all evidence (json output)": { - []string{ - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - `{"evidence":[],"pagination":null}`, - "", - }, - } - - for name, tc := range testCases { - tc := tc - - t.Run(name, func(t *testing.T) { - ctx := svrcmd.CreateExecuteContext(context.Background()) - - cmd := cli.GetQueryCmd() - cmd.SetContext(ctx) - cmd.SetArgs(tc.args) - require.NoError(t, client.SetCmdClientContextHandler(baseCtx, cmd)) - - out, err := clitestutil.ExecTestCLICmd(baseCtx, cmd, tc.args) - if tc.expectErrMsg != "" { - require.Error(t, err) - require.Contains(t, err.Error(), tc.expectErrMsg) - } else { - require.NoError(t, err) - } - - require.Contains(t, strings.TrimSpace(out.String()), tc.expectedOutput) - }) - } -} diff --git a/x/evidence/client/cli/tx.go b/x/evidence/client/cli/tx.go index ac57b71cc675..d7b5b82717be 100644 --- a/x/evidence/client/cli/tx.go +++ b/x/evidence/client/cli/tx.go @@ -1,9 +1,10 @@ package cli import ( - "cosmossdk.io/x/evidence/types" "github.com/spf13/cobra" + "cosmossdk.io/x/evidence/types" + "github.com/cosmos/cosmos-sdk/client" ) diff --git a/x/evidence/genesis.go b/x/evidence/genesis.go index 63ec6f5273fd..1c7569415547 100644 --- a/x/evidence/genesis.go +++ b/x/evidence/genesis.go @@ -1,13 +1,12 @@ package evidence import ( - "errors" "fmt" - "cosmossdk.io/collections" "cosmossdk.io/x/evidence/exported" "cosmossdk.io/x/evidence/keeper" "cosmossdk.io/x/evidence/types" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -45,7 +44,7 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { gs.Evidence = append(gs.Evidence, anyEvi) return false, nil }) - if err != nil && !errors.Is(err, collections.ErrInvalidIterator) { + if err != nil { panic(err) } return gs diff --git a/x/evidence/genesis_test.go b/x/evidence/genesis_test.go index aa1482f94477..600f61cad7d1 100644 --- a/x/evidence/genesis_test.go +++ b/x/evidence/genesis_test.go @@ -5,7 +5,10 @@ import ( "testing" "time" - "cosmossdk.io/collections" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + "cosmossdk.io/depinject" "cosmossdk.io/log" "cosmossdk.io/x/evidence" @@ -13,9 +16,6 @@ import ( "cosmossdk.io/x/evidence/keeper" "cosmossdk.io/x/evidence/testutil" "cosmossdk.io/x/evidence/types" - cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" - "github.com/stretchr/testify/require" - "github.com/stretchr/testify/suite" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" @@ -95,7 +95,7 @@ func (suite *GenesisTestSuite) TestInitGenesis() { false, func() { _, err := suite.keeper.Evidences.Iterate(suite.ctx, nil) - suite.Require().ErrorIs(err, collections.ErrInvalidIterator) + suite.Require().NoError(err) }, }, } diff --git a/x/evidence/go.mod b/x/evidence/go.mod index cfd7cc4ed6bb..a36214cc7ec1 100644 --- a/x/evidence/go.mod +++ b/x/evidence/go.mod @@ -1,160 +1,163 @@ module cosmossdk.io/x/evidence -go 1.20 +go 1.23.0 require ( - cosmossdk.io/api v0.4.2 - cosmossdk.io/collections v0.2.0 - cosmossdk.io/core v0.8.0 - cosmossdk.io/depinject v1.0.0-alpha.3 - cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 - cosmossdk.io/log v1.1.0 - cosmossdk.io/math v1.0.1 - cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c - github.com/cometbft/cometbft v0.38.0-rc1 - github.com/cosmos/cosmos-proto v1.0.0-beta.3 - github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230607182757-cfeb10287d61 - github.com/cosmos/gogoproto v1.4.10 - github.com/golang/mock v1.6.0 - github.com/golang/protobuf v1.5.3 + cosmossdk.io/api v0.7.6 + cosmossdk.io/collections v0.4.0 + cosmossdk.io/core v0.11.0 + cosmossdk.io/depinject v1.1.0 + cosmossdk.io/errors v1.0.1 + cosmossdk.io/log v1.5.0 + cosmossdk.io/math v1.5.0 + cosmossdk.io/store v1.1.1 + github.com/cometbft/cometbft v0.38.17 + github.com/cosmos/cosmos-proto v1.0.0-beta.5 + github.com/cosmos/cosmos-sdk v0.50.13 + github.com/cosmos/gogoproto v1.7.0 + github.com/golang/protobuf v1.5.4 github.com/grpc-ecosystem/grpc-gateway v1.16.0 - github.com/spf13/cobra v1.7.0 - github.com/stretchr/testify v1.8.4 - google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a - google.golang.org/grpc v1.55.0 - google.golang.org/protobuf v1.30.0 + github.com/spf13/cobra v1.9.1 + github.com/stretchr/testify v1.10.0 + go.uber.org/mock v0.5.0 + google.golang.org/genproto/googleapis/api v0.0.0-20250224174004-546df14abb99 + google.golang.org/grpc v1.71.0 + google.golang.org/protobuf v1.36.5 ) require ( - cosmossdk.io/x/tx v0.8.0 // indirect - filippo.io/edwards25519 v1.0.0 // indirect + cosmossdk.io/x/tx v0.13.7 // indirect + filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect - github.com/DataDog/zstd v1.5.5 // indirect - github.com/armon/go-metrics v0.4.1 // indirect + github.com/DataDog/datadog-go v3.2.0+incompatible // indirect + github.com/DataDog/zstd v1.5.6 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect - github.com/bits-and-blooms/bitset v1.7.0 // indirect - github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect + github.com/bits-and-blooms/bitset v1.8.0 // indirect + github.com/bytedance/sonic v1.12.3 // indirect + github.com/bytedance/sonic/loader v0.2.0 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // indirect - github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/cockroachdb/errors v1.9.1 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/cloudwego/base64x v0.1.4 // indirect + github.com/cloudwego/iasm v0.2.0 // indirect + github.com/cockroachdb/apd/v3 v3.2.1 // indirect + github.com/cockroachdb/errors v1.11.3 // indirect + github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20230606152911-c4be581b807f // indirect - github.com/cockroachdb/redact v1.1.4 // indirect - github.com/cometbft/cometbft-db v0.7.0 // indirect + github.com/cockroachdb/pebble v1.1.2 // indirect + github.com/cockroachdb/redact v1.1.5 // indirect + github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect + github.com/cometbft/cometbft-db v0.14.1 // indirect github.com/cosmos/btcutil v1.0.5 // indirect - github.com/cosmos/cosmos-db v1.0.0 // indirect + github.com/cosmos/cosmos-db v1.1.1 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.0.0-beta.2 // indirect - github.com/cosmos/ics23/go v0.10.0 // indirect - github.com/cosmos/ledger-cosmos-go v0.13.0 // indirect + github.com/cosmos/iavl v1.2.2 // indirect + github.com/cosmos/ics23/go v0.11.0 // indirect + github.com/cosmos/ledger-cosmos-go v0.14.0 // indirect github.com/danieljoos/wincred v1.1.2 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect - github.com/dgraph-io/badger/v2 v2.2007.4 // indirect + github.com/dgraph-io/badger/v4 v4.2.0 // indirect 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/dvsekhvalnov/jose2go v1.5.0 // indirect - github.com/emicklei/dot v1.4.2 // indirect + github.com/dvsekhvalnov/jose2go v1.6.0 // indirect + github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.15.0 // indirect - github.com/felixge/httpsnoop v1.0.2 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/getsentry/sentry-go v0.21.0 // indirect - github.com/go-kit/kit v0.12.0 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect + github.com/getsentry/sentry-go v0.27.0 // indirect + github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/googleapis v1.4.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/glog v1.1.0 // indirect + github.com/golang/glog v1.2.4 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/golang/mock v1.6.0 // indirect github.com/golang/snappy v0.0.4 // indirect - github.com/google/btree v1.1.2 // indirect - github.com/google/go-cmp v0.5.9 // indirect + github.com/google/btree v1.1.3 // indirect + github.com/google/flatbuffers v1.12.1 // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/google/orderedcode v0.0.1 // indirect github.com/gorilla/handlers v1.5.1 // indirect github.com/gorilla/mux v1.8.0 // indirect - github.com/gorilla/websocket v1.5.0 // 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/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/go-plugin v1.4.10 // indirect - github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect - github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/go-metrics v0.5.3 // indirect + github.com/hashicorp/go-plugin v1.5.2 // indirect + github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/yamux v0.1.1 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect github.com/huandu/skiplist v1.2.0 // indirect - github.com/iancoleman/strcase v0.2.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/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.16.5 // indirect + github.com/klauspost/compress v1.17.9 // indirect + github.com/klauspost/cpuid/v2 v2.0.9 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect - github.com/lib/pq v1.10.7 // indirect - github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.0 // indirect - github.com/magiconair/properties v1.8.7 // indirect + github.com/lib/pq v1.10.9 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.19 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/minio/highwayhash v1.0.2 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/minio/highwayhash v1.0.3 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect - github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect - github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.0.8 // indirect - github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761 // indirect + github.com/pelletier/go-toml/v2 v2.2.3 // indirect + github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.15.1 // indirect - github.com/prometheus/client_model v0.4.0 // indirect - github.com/prometheus/common v0.44.0 // indirect - github.com/prometheus/procfs v0.10.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/prometheus/client_golang v1.20.5 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.62.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.10.0 // indirect - github.com/rs/cors v1.8.3 // indirect - github.com/rs/zerolog v1.29.1 // indirect - github.com/sasha-s/go-deadlock v0.3.1 // indirect - github.com/spf13/afero v1.9.5 // indirect - github.com/spf13/cast v1.5.1 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/spf13/pflag v1.0.5 // indirect - github.com/spf13/viper v1.16.0 // indirect - github.com/subosito/gotenv v1.4.2 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect + github.com/rs/cors v1.11.1 // indirect + github.com/rs/zerolog v1.33.0 // indirect + github.com/sagikazarmark/locafero v0.7.0 // indirect + github.com/sasha-s/go-deadlock v0.3.5 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.12.0 // indirect + github.com/spf13/cast v1.7.1 // indirect + github.com/spf13/pflag v1.0.6 // indirect + github.com/spf13/viper v1.20.0 // indirect + github.com/subosito/gotenv v1.6.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect - github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect github.com/tendermint/go-amino v0.16.0 // indirect - github.com/tidwall/btree v1.6.0 // indirect - github.com/zondax/hid v0.9.1 // indirect - github.com/zondax/ledger-go v0.14.1 // indirect - go.etcd.io/bbolt v1.3.6 // indirect - golang.org/x/crypto v0.9.0 // indirect - golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/sync v0.2.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/term v0.8.0 // indirect - golang.org/x/text v0.9.0 // indirect - google.golang.org/genproto v0.0.0-20230525234025-438c736192d0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect - gopkg.in/ini.v1 v1.67.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect + github.com/tidwall/btree v1.7.0 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + github.com/zondax/hid v0.9.2 // indirect + github.com/zondax/ledger-go v0.14.3 // indirect + go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 // indirect + go.opencensus.io v0.24.0 // indirect + go.uber.org/multierr v1.10.0 // indirect + golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect + golang.org/x/crypto v0.35.0 // indirect + golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect + golang.org/x/net v0.35.0 // indirect + golang.org/x/sync v0.11.0 // indirect + golang.org/x/sys v0.30.0 // indirect + golang.org/x/term v0.29.0 // indirect + golang.org/x/text v0.22.0 // indirect + google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - gotest.tools/v3 v3.4.0 // indirect + gotest.tools/v3 v3.5.2 // indirect nhooyr.io/websocket v1.8.6 // indirect - pgregory.net/rapid v0.6.2 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect + pgregory.net/rapid v1.1.0 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect ) - -// Fix upstream GHSA-h395-qcrw-5vmq and GHSA-3vp4-m3rf-835h vulnerabilities. -// TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 -replace github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0 - -replace github.com/cosmos/cosmos-sdk => ../../ diff --git a/x/evidence/go.sum b/x/evidence/go.sum index 27a9ce7723e9..3e18c9c3e54f 100644 --- a/x/evidence/go.sum +++ b/x/evidence/go.sum @@ -1,89 +1,50 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= -cosmossdk.io/api v0.4.2 h1:lQBMl4xINnMnBOR/tQLtjlDnR4exr4e6/SfHR8PILE0= -cosmossdk.io/api v0.4.2/go.mod h1:qrVgOp7DIeAXa+Tt5dDjOC47bZCDrwx8ZHxrmy7STNE= -cosmossdk.io/collections v0.2.0 h1:CgMfLtE16+qox3zBYrGh60i4yKV8SeExLnIdOS2sbQs= -cosmossdk.io/collections v0.2.0/go.mod h1:Oc1FK0vlmxJZsgUn9/o3ldE6zNyWKvobVzaLhWknZJE= -cosmossdk.io/core v0.8.0 h1:LcJnu52E1a8f8E317VfQ1xK/RZe+IuhMNQAjnDLh25M= -cosmossdk.io/core v0.8.0/go.mod h1:LF6VLOv2DdCiaHxYVmr0MZcZpaSM9ZgvyrQSYTeg6D0= -cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw= -cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= -cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 h1:BCRz06fvddw7cKGiEGDiSox3qMsjQ97f92K+PDZDHdc= -cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741/go.mod h1:TB05o6YXkZkzsc+6bZFAV5kZRBtoCU9tUkbeMIqEg0w= -cosmossdk.io/log v1.1.0 h1:v0ogPHYeTzPcBTcPR1A3j1hkei4pZama8kz8LKlCMv0= -cosmossdk.io/log v1.1.0/go.mod h1:6zjroETlcDs+mm62gd8Ig7mZ+N+fVOZS91V17H+M4N4= -cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= -cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= -cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c h1:A+FMPW9GtfcPBDQNtFeDFN27h1SAP6OVjnGgPLlYXmI= -cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c/go.mod h1:RbYGvXCbz8uNBCXrwS9Z8SyydeWi+W5x5MZ33muyzMw= -cosmossdk.io/x/tx v0.8.0 h1:gLiGRL/Fy7fs6dd0IX8jOf0PrVr56/SG6XVMGQjyvJU= -cosmossdk.io/x/tx v0.8.0/go.mod h1:T9uEumGNgKU61gJYRv1t3uzQwLnASpJGmSE229HM3xA= +cosmossdk.io/api v0.7.6 h1:PC20PcXy1xYKH2KU4RMurVoFjjKkCgYRbVAD4PdqUuY= +cosmossdk.io/api v0.7.6/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= +cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= +cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= +cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= +cosmossdk.io/depinject v1.1.0 h1:wLan7LG35VM7Yo6ov0jId3RHWCGRhe8E8bsuARorl5E= +cosmossdk.io/depinject v1.1.0/go.mod h1:kkI5H9jCGHeKeYWXTqYdruogYrEeWvBQCw1Pj4/eCFI= +cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= +cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= +cosmossdk.io/log v1.5.0 h1:dVdzPJW9kMrnAYyMf1duqacoidB9uZIl+7c6z0mnq0g= +cosmossdk.io/log v1.5.0/go.mod h1:Tr46PUJjiUthlwQ+hxYtUtPn4D/oCZXAkYevBeh5+FI= +cosmossdk.io/math v1.5.0 h1:sbOASxee9Zxdjd6OkzogvBZ25/hP929vdcYcBJQbkLc= +cosmossdk.io/math v1.5.0/go.mod h1:AAwwBmUhqtk2nlku174JwSll+/DepUXW3rWIXN5q+Nw= +cosmossdk.io/store v1.1.1 h1:NA3PioJtWDVU7cHHeyvdva5J/ggyLDkyH0hGHl2804Y= +cosmossdk.io/store v1.1.1/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM= +cosmossdk.io/x/tx v0.13.7 h1:8WSk6B/OHJLYjiZeMKhq7DK7lHDMyK0UfDbBMxVmeOI= +cosmossdk.io/x/tx v0.13.7/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= -filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= +filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= +filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= 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/99designs/keyring v1.2.1 h1:tYLp1ULvO7i3fI5vE21ReQuj99QFSs7lGm0xWyJo87o= github.com/99designs/keyring v1.2.1/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= -github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= -github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= +github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= -github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= -github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= +github.com/DataDog/zstd v1.5.6 h1:LbEglqepa/ipmmQJUDnSsfvA8e8IStVcGaFWDuxvGOY= +github.com/DataDog/zstd v1.5.6/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= -github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= +github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= 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/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= +github.com/adlio/schema v1.3.6 h1:k1/zc2jNfeiZBA5aFTRy37jlBIuCkXCm0XmvpzCKI9I= +github.com/adlio/schema v1.3.6/go.mod h1:qkxwLgPBd1FgLRHYVCmQT/rrBr3JH38J9LjmVzWNudg= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= -github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= -github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -93,16 +54,12 @@ github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kd github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= -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/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -111,16 +68,19 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bits-and-blooms/bitset v1.7.0 h1:YjAGVd3XmtK9ktAbX8Zg2g2PwLIMjGREZJHlV4j7NEo= -github.com/bits-and-blooms/bitset v1.7.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= -github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= -github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= -github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= -github.com/bufbuild/protocompile v0.5.1 h1:mixz5lJX4Hiz4FpqFREJHIXLfaLBntfaJv1h+/jS+Qg= -github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= -github.com/bytedance/sonic v1.8.0 h1:ea0Xadu+sHlu7x5O3gKhRpQ1IKiMrSiHttPF0ybECuA= -github.com/bytedance/sonic v1.8.0/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= +github.com/bits-and-blooms/bitset v1.8.0 h1:FD+XqgOZDUxxZ8hzoBFuV9+cGWY9CslN6d5MS5JVb4c= +github.com/bits-and-blooms/bitset v1.8.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= +github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= +github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/btcutil v1.1.6 h1:zFL2+c3Lb9gEgqKNzowKUPQNb8jV7v5Oaodi/AYFd6c= +github.com/btcsuite/btcd/btcutil v1.1.6/go.mod h1:9dFymx8HpuLqBnsPELrImQeTQfKBQqzqGbbV3jK55aE= +github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY= +github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE= +github.com/bytedance/sonic v1.12.3 h1:W2MGa7RCU1QTeYRTPE3+88mVC0yXmsRQRChiyVocVjU= +github.com/bytedance/sonic v1.12.3/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= +github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= +github.com/bytedance/sonic/loader v0.2.0 h1:zNprn+lsIP06C/IqCHs3gPQIvnvpKbbxyXQP1iU4kWM= +github.com/bytedance/sonic/loader v0.2.0/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= @@ -128,24 +88,23 @@ github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInq github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= -github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= -github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= +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/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI= +github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/0Y= +github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= +github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg= +github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= @@ -153,73 +112,74 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= -github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= +github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= +github.com/cockroachdb/apd/v3 v3.2.1 h1:U+8j7t0axsIgvQUqthuNm82HIrYXodOV2iWLWtEaIwg= +github.com/cockroachdb/apd/v3 v3.2.1/go.mod h1:klXJcjp+FffLTHlhIG69tezTDvdP065naDsHzKhYSqc= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= -github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= -github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= +github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce h1:giXvy4KSc/6g/esnpM7Geqxka4WSqI1SZc7sMJFd3y4= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/pebble v0.0.0-20230606152911-c4be581b807f h1:qQW3qCVRpjYsV4YNaUOjm6YLeliAD2jpgex9+D9tqU4= -github.com/cockroachdb/pebble v0.0.0-20230606152911-c4be581b807f/go.mod h1:TkdVsGYRqtULUppt2RbC+YaKtTHnHoWa2apfFrSKABw= -github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/cockroachdb/redact v1.1.4 h1:Y0XrVI2FAyofNyGveodTN//qdpPtFKcKTeCBsK3AHAQ= -github.com/cockroachdb/redact v1.1.4/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/pebble v1.1.2 h1:CUh2IPtR4swHlEj48Rhfzw6l/d0qA31fItcIszQVIsA= +github.com/cockroachdb/pebble v1.1.2/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= -github.com/cometbft/cometbft v0.38.0-rc1 h1:ph6smlqX82aH+d72KuxDHqu29M7LyusSp/obfGsGX/w= -github.com/cometbft/cometbft v0.38.0-rc1/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= -github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= -github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= +github.com/cometbft/cometbft v0.38.17 h1:FkrQNbAjiFqXydeAO81FUzriL4Bz0abYxN/eOHrQGOk= +github.com/cometbft/cometbft v0.38.17/go.mod h1:5l0SkgeLRXi6bBfQuevXjKqML1jjfJJlvI1Ulp02/o4= +github.com/cometbft/cometbft-db v0.14.1 h1:SxoamPghqICBAIcGpleHbmoPqy+crij/++eZz3DlerQ= +github.com/cometbft/cometbft-db v0.14.1/go.mod h1:KHP1YghilyGV/xjD5DP3+2hyigWx0WTp9X+0Gnx0RxQ= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= +github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= -github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0E= -github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= -github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= -github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= +github.com/cosmos/cosmos-db v1.1.1 h1:FezFSU37AlBC8S98NlSagL76oqBRWq/prTPvFcEJNCM= +github.com/cosmos/cosmos-db v1.1.1/go.mod h1:AghjcIPqdhSLP/2Z0yha5xPH3nLnskz81pBx3tcVSAw= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= +github.com/cosmos/cosmos-sdk v0.50.13 h1:xQ32hhzVy7agEe7behMdZN0ezWhPss3KoLZsF9KoBnw= +github.com/cosmos/cosmos-sdk v0.50.13/go.mod h1:hrWEFMU1eoXqLJeE6VVESpJDQH67FS1nnMrQIjO2daw= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoKuI= -github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= -github.com/cosmos/iavl v1.0.0-beta.2 h1:XOsIM80Yyml/KifCXEYOy9tWCXwMAbLa91n6pReW07Y= -github.com/cosmos/iavl v1.0.0-beta.2/go.mod h1:EA97dJ07TBktRlG/iGzK6g1eCXNj1q3MGoFYkVzrwHE= -github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= -github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= -github.com/cosmos/ledger-cosmos-go v0.13.0 h1:ex0CvCxToSR7j5WjrghPu2Bu9sSXKikjnVvUryNnx4s= -github.com/cosmos/ledger-cosmos-go v0.13.0/go.mod h1:ZcqYgnfNJ6lAXe4HPtWgarNEY+B74i+2/8MhZw4ziiI= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= +github.com/cosmos/iavl v1.2.2 h1:qHhKW3I70w+04g5KdsdVSHRbFLgt3yY3qTMd4Xa4rC8= +github.com/cosmos/iavl v1.2.2/go.mod h1:GiM43q0pB+uG53mLxLDzimxM9l/5N9UuSY3/D0huuVw= +github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= +github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= +github.com/cosmos/ledger-cosmos-go v0.14.0 h1:WfCHricT3rPbkPSVKRH+L4fQGKYHuGOK9Edpel8TYpE= +github.com/cosmos/ledger-cosmos-go v0.14.0/go.mod h1:E07xCWSBl3mTGofZ2QnL4cIUzMbbGVyik84QYKbX3RA= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= -github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= -github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= -github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= -github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= -github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= +github.com/dgraph-io/badger/v4 v4.2.0 h1:kJrlajbXXL9DFTNuhhu9yCx7JJa4qpYWxtE8BzuWsEs= +github.com/dgraph-io/badger/v4 v4.2.0/go.mod h1:qfCqhPoWDFJRx1gp5QwwyGo8xk1lbHUxvK9nK0OGAak= github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= @@ -227,72 +187,63 @@ github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUn github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= 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/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= 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/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= -github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= +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/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= -github.com/emicklei/dot v1.4.2 h1:UbK6gX4yvrpHKlxuUQicwoAis4zl8Dzwit9SnbBAXWw= -github.com/emicklei/dot v1.4.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= +github.com/emicklei/dot v1.6.2 h1:08GN+DD79cy/tzN6uLCT84+2Wk9u+wvqP+Hkx/dIR8A= +github.com/emicklei/dot v1.6.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= -github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= -github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= -github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= -github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= -github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= -github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= -github.com/getsentry/sentry-go v0.21.0 h1:c9l5F1nPF30JIppulk4veau90PK6Smu3abgVtVQWon4= -github.com/getsentry/sentry-go v0.21.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= +github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= +github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.9.0 h1:OjyFBKICoexlu99ctXNR2gg+c5pKrKMuyjgARg9qeY8= -github.com/gin-gonic/gin v1.9.0/go.mod h1:W1Me9+hsUSyj3CePGrd1/QrKJMSJ1Tu/0hFEH89961k= -github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= +github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= +github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= -github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= -github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= +github.com/go-kit/kit v0.13.0 h1:OoneCcHKHQ03LfBpoQCUfCluwd2Vt3ohz+kvbJneZAU= +github.com/go-kit/kit v0.13.0/go.mod h1:phqEHMMUbyrCFCTgH48JueqrM3md2HcAZ8N3XE4FKDg= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= @@ -301,30 +252,36 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= -github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= -github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= -github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= -github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU= -github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= +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-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= +github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= +github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= +github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= +github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= +github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= -github.com/goccy/go-json v0.10.0 h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA= -github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= +github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= -github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= 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= @@ -335,22 +292,15 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV 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/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= -github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= -github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= +github.com/golang/glog v1.2.4 h1:CNNw5U8lSiiBk7druxtSHHTsRWcxKoac6kZKm2peBBc= +github.com/golang/glog v1.2.4/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -358,7 +308,6 @@ github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= @@ -370,56 +319,40 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -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/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= +github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= +github.com/google/flatbuffers v1.12.1 h1:MVlul7pQNoDzWRLTw5imwYsl+usrS1TXG2H4jg6ImGw= +github.com/google/flatbuffers v1.12.1/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 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= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= @@ -430,8 +363,8 @@ github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= @@ -452,10 +385,12 @@ github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVH github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-metrics v0.5.3 h1:M5uADWMOGCTUNU1YuC4hfknOeHNaX54LDm4oYSucoNE= +github.com/hashicorp/go-metrics v0.5.3/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-plugin v1.4.10 h1:xUbmA4jC6Dq163/fWcp8P3JuHilrHHMLNRxzGQJ9hNk= -github.com/hashicorp/go-plugin v1.4.10/go.mod h1:6/1TEzT0eQznvI/gV2CM29DLSkAK/e58mUWKVsPaph0= +github.com/hashicorp/go-plugin v1.5.2 h1:aWv8eimFqWlsEiMrYZdPYl+FdHaBJSN4AWwGWfT1G2Y= +github.com/hashicorp/go-plugin v1.5.2/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= @@ -467,10 +402,10 @@ github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= @@ -485,24 +420,17 @@ github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0Jr github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw= github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= -github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= -github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= -github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= -github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= -github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= -github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= -github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= -github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= +github.com/jhump/protoreflect v1.15.3 h1:6SFRuqU45u9hIZPJAoZ8c28T3nK64BNdp9w6jFonzls= +github.com/jhump/protoreflect v1.15.3/go.mod h1:4ORHmSBmlCW8fh3xHmJMGyul1zNqZK4Elxc8qKP+p1k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= @@ -515,93 +443,66 @@ github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= 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/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= -github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= -github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= -github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= -github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= 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/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI= -github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/klauspost/cpuid v1.2.1 h1:vJi+O/nMdFt0vqm8NZBI6wzALWdA2X+egi0ogNyrC/w= -github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= 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.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= -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= -github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.0 h1:H4L/LhP7GOMf1j17oQAElHgVlbEje2h14A8Tz9cM2BE= -github.com/linxGnu/grocksdb v1.8.0/go.mod h1:09CeBborffXhXdNpEcOeZrLKEnRtrZFEpFdPNI9Zjjg= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= +github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.8/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= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= 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-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= -github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= -github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= +github.com/minio/highwayhash v1.0.3 h1:kbnuUMoHYyVl7szWjSxJnxw11k2U709jqFPPmIUyD6Q= +github.com/minio/highwayhash v1.0.3/go.mod h1:GGYsuwP/fPD6Y9hMiXuapVvlIUEhFhMTh0rxU3ik1LQ= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= @@ -609,8 +510,6 @@ github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS4 github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/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= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -618,9 +517,10 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= 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/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -636,8 +536,8 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce h1:/pEpMk55wH0X+E5zedGEMOdLuWmV8P4+4W3+LZaM6kg= -github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a h1:dlRvE5fWabOchtH7znfiFCcOvmIYgOeAS5ifBXBlh9Q= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= @@ -645,7 +545,6 @@ github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DV github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= @@ -657,10 +556,14 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/onsi/gomega v1.26.0 h1:03cDLK28U6hWvCAns6NeydX3zIm4SF3ci69ulidS32Q= +github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= 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-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= -github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= +github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= +github.com/opencontainers/runc v1.1.12 h1:BOIssBaW1La0/qbNZHXOOa71dZfZEQOzW7dqQf3phss= +github.com/opencontainers/runc v1.1.12/go.mod h1:S+lQwSfncpBha7XTy/5lBwWgm5+y5Ma/O44Ekby9FK8= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -670,19 +573,17 @@ github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJ github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= +github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= -github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= -github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= +github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= +github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= -github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761 h1:W04oB3d0J01W5jgYRGKsV8LCM6g9EkCvPkZcmFuy0OE= -github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 h1:Dx7Ovyv/SFnMFw3fD4oEoeorXc6saIiQ23LrGLth0Gw= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= @@ -693,9 +594,9 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= @@ -703,103 +604,91 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.15.1 h1:8tXpTmJbyH5lydzFPoxSIJ0J46jdh3tylbvM1xCv0LI= -github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= +github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= +github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= -github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= -github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= +github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io= +github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= -github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= 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/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= -github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= -github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= -github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.29.1 h1:cO+d60CHkknCbvzEWxP0S9K6KqyTjrCNUy1LdQLCGPc= -github.com/rs/zerolog v1.29.1/go.mod h1:Le6ESbR7hc+DP6Lt1THiV8CQSdkkNrd3R0XbEgp3ZBU= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= +github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/locafero v0.7.0 h1:5MqpDsTGNDhY8sGp0Aowyf0qKsPrhewaLSsFaodPcyo= +github.com/sagikazarmark/locafero v0.7.0/go.mod h1:2za3Cg5rMaTMoG/2Ulr9AwtFaIppKXTRYnozin4aB5k= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -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/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= +github.com/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb2NsU= +github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= -github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= -github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= -github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= +github.com/spf13/afero v1.12.0 h1:UcOPyRBYczmFn6yvphxkn9ZEOY65cpwGKb5mL36mrqs= +github.com/spf13/afero v1.12.0/go.mod h1:ZTlWwG4/ahT8W7T0WQ5uYmjI9duaLQGy3Q2OAl4sk/4= +github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= +github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo= +github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= -github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= +github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= +github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.20.0 h1:zrxIyR3RQIOsarIrgL8+sAvALXul9jeEPa06Y0Ph6vY= +github.com/spf13/viper v1.20.0/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -810,77 +699,69 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= -github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +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.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= -github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= +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/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/ugorji/go/codec v1.2.9 h1:rmenucSohSTiyL09Y+l2OCk+FrMxGMzho2+tjr5ticU= -github.com/ugorji/go/codec v1.2.9/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= +github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= +github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= -github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= -github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= -github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= -github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= -github.com/zondax/ledger-go v0.14.1 h1:Pip65OOl4iJ84WTpA4BKChvOufMhhbxED3BaihoZN4c= -github.com/zondax/ledger-go v0.14.1/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2feOQv8K320= +github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= +github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= +github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= +github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= -go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 h1:qxen9oVGzDdIRP6ejyAJc760RwW4SnVDiTYTzwnXuxo= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5/go.mod h1:eW0HG9/oHQhvRCvb1/pIXW4cOvtDqeQK+XSi3TnwaXY= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= +go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= +go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY= +go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI= +go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ= +go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE= +go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A= +go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU= +go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk= +go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w= +go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k= +go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU= +go.uber.org/mock v0.5.0/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= +go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= @@ -889,62 +770,35 @@ golang.org/x/arch v0.0.0-20210923205945-b76863e36670 h1:18EFjUmQOcUvxNYSkA6jO9VA golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= -golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= -golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= +golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs= +golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= +golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= +golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= 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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -956,73 +810,38 @@ golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= +golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= 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= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= -golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= +golang.org/x/sync v0.11.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-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1031,20 +850,12 @@ golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 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-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= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1053,263 +864,122 @@ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/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-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220315194320-039c03cc5b86/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= +golang.org/x/sys v0.30.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.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU= +golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s= 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= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= +golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -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= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/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-20181221001348-537d06c36207/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-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= +golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg= +golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= 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= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -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-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= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20230525234025-438c736192d0 h1:x1vNwUhVOcsYoKyEGCZBH694SBmmBjA2EfauFVEI2+M= -google.golang.org/genproto v0.0.0-20230525234025-438c736192d0/go.mod h1:9ExIQyXL5hZrHzQceCwuSYwZZ5QZBazOcprJ5rgs3lY= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a h1:HiYVD+FGJkTo+9zj1gqz0anapsa1JxjiSrN+BJKyUmE= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a/go.mod h1:ts19tUU+Z0ZShN1y3aPyq2+O3d5FUNNgT6FtOzmrNn8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 h1:ToEetK57OidYuqD4Q5w+vfEnPvPpuTwedCNVohYJfNk= +google.golang.org/genproto v0.0.0-20241118233622-e639e219e697/go.mod h1:JJrvXBWRZaFMxBufik1a4RpFw4HhgVtBBWQeQgUj2cc= +google.golang.org/genproto/googleapis/api v0.0.0-20250224174004-546df14abb99 h1:ilJhrCga0AptpJZXmUYG4MCrx/zf3l1okuYz7YK9PPw= +google.golang.org/genproto/googleapis/api v0.0.0-20250224174004-546df14abb99/go.mod h1:Xsh8gBVxGCcbV8ZeTB9wI5XPyZ5RvC6V3CTeeplHbiA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2 h1:DMTIbak9GhdaSxEjvVzAeNZvyc03I61duqNbnm3SU0M= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2/go.mod h1:LuRYeWDFV6WOn90g357N17oMCaxpgCnbi/44qJvDn2I= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= +google.golang.org/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg= +google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1324,8 +994,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= +google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1337,10 +1007,6 @@ gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qS 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/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= -gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -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/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= @@ -1355,30 +1021,22 @@ gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 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= -gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= -gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= +gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q= +gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -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= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= -pgregory.net/rapid v0.6.2 h1:ErW5sL+UKtfBfUTsWHDCoeB+eZKLKMxrSd1VJY6W4bw= -pgregory.net/rapid v0.6.2/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= +pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= +pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/x/evidence/keeper/abci.go b/x/evidence/keeper/abci.go index 2ed8d447d141..d441ee174dd1 100644 --- a/x/evidence/keeper/abci.go +++ b/x/evidence/keeper/abci.go @@ -3,7 +3,6 @@ package keeper import ( "context" "fmt" - "time" "cosmossdk.io/core/comet" "cosmossdk.io/x/evidence/types" @@ -15,7 +14,7 @@ import ( // BeginBlocker iterates through and handles any newly discovered evidence of // misbehavior submitted by CometBFT. Currently, only equivocation is handled. func (k Keeper) BeginBlocker(ctx context.Context) error { - defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) + defer telemetry.ModuleMeasureSince(types.ModuleName, telemetry.Now(), telemetry.MetricKeyBeginBlocker) bi := k.cometInfo.GetCometBlockInfo(ctx) if bi == nil { @@ -31,7 +30,7 @@ func (k Keeper) BeginBlocker(ctx context.Context) error { // It's still ongoing discussion how should we treat and slash attacks with // premeditation. So for now we agree to treat them in the same way. case comet.LightClientAttack, comet.DuplicateVote: - evidence := types.FromABCIEvidence(evidences.Get(i)) + evidence := types.FromABCIEvidence(evidences.Get(i), k.stakingKeeper.ConsensusAddressCodec()) err := k.handleEquivocationEvidence(ctx, evidence) if err != nil { return err diff --git a/x/evidence/keeper/grpc_query.go b/x/evidence/keeper/grpc_query.go index 728742d4c073..22d2be5c2458 100644 --- a/x/evidence/keeper/grpc_query.go +++ b/x/evidence/keeper/grpc_query.go @@ -5,12 +5,13 @@ import ( "encoding/hex" "fmt" - "cosmossdk.io/x/evidence/exported" - "cosmossdk.io/x/evidence/types" proto "github.com/cosmos/gogoproto/proto" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "cosmossdk.io/x/evidence/exported" + "cosmossdk.io/x/evidence/types" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" @@ -67,18 +68,12 @@ func (k Querier) AllEvidence(ctx context.Context, req *types.QueryAllEvidenceReq return nil, status.Errorf(codes.InvalidArgument, "empty request") } - var evidence []*codectypes.Any - _, pageRes, err := query.CollectionFilteredPaginate(ctx, k.k.Evidences, req.Pagination, func(_ []byte, value exported.Evidence) (include bool, err error) { - evidenceAny, err := codectypes.NewAnyWithValue(value) - if err != nil { - return false, err - } - evidence = append(evidence, evidenceAny) - return false, nil // we don't include results because we're appending them + evidences, pageRes, err := query.CollectionPaginate(ctx, k.k.Evidences, req.Pagination, func(_ []byte, value exported.Evidence) (*codectypes.Any, error) { + return codectypes.NewAnyWithValue(value) }) if err != nil { return nil, err } - return &types.QueryAllEvidenceResponse{Evidence: evidence, Pagination: pageRes}, nil + return &types.QueryAllEvidenceResponse{Evidence: evidences, Pagination: pageRes}, nil } diff --git a/x/evidence/keeper/infraction.go b/x/evidence/keeper/infraction.go index 04f18db3eac7..27858ac514f9 100644 --- a/x/evidence/keeper/infraction.go +++ b/x/evidence/keeper/infraction.go @@ -26,17 +26,20 @@ import ( // in the case of a lunatic attack. func (k Keeper) handleEquivocationEvidence(ctx context.Context, evidence *types.Equivocation) error { sdkCtx := sdk.UnwrapSDKContext(ctx) - logger := k.Logger(sdkCtx) - consAddr := evidence.GetConsensusAddress() + logger := k.Logger(ctx) + consAddr := evidence.GetConsensusAddress(k.stakingKeeper.ConsensusAddressCodec()) - validator := k.stakingKeeper.ValidatorByConsAddr(sdkCtx, consAddr) + validator, err := k.stakingKeeper.ValidatorByConsAddr(ctx, consAddr) + if err != nil { + return err + } if validator == nil || validator.IsUnbonded() { // Defensive: Simulation doesn't take unbonding periods into account, and // CometBFT might break this assumption at some point. return nil } - if !validator.GetOperator().Empty() { + if len(validator.GetOperator()) != 0 { if _, err := k.slashingKeeper.GetPubkey(ctx, consAddr.Bytes()); err != nil { // Ignore evidence that cannot be handled. // diff --git a/x/evidence/keeper/keeper.go b/x/evidence/keeper/keeper.go index ad7f3d70e1b3..399ca5db0d2e 100644 --- a/x/evidence/keeper/keeper.go +++ b/x/evidence/keeper/keeper.go @@ -8,13 +8,13 @@ import ( "cosmossdk.io/collections" "cosmossdk.io/core/address" + "cosmossdk.io/core/comet" "cosmossdk.io/core/store" + "cosmossdk.io/errors" "cosmossdk.io/log" "cosmossdk.io/x/evidence/exported" "cosmossdk.io/x/evidence/types" - "cosmossdk.io/core/comet" - "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" ) diff --git a/x/evidence/keeper/keeper_test.go b/x/evidence/keeper/keeper_test.go index e72b311561b2..d53fb0c5613a 100644 --- a/x/evidence/keeper/keeper_test.go +++ b/x/evidence/keeper/keeper_test.go @@ -6,17 +6,17 @@ import ( "fmt" "time" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/stretchr/testify/suite" + "go.uber.org/mock/gomock" + "cosmossdk.io/collections" + storetypes "cosmossdk.io/store/types" "cosmossdk.io/x/evidence" "cosmossdk.io/x/evidence/exported" "cosmossdk.io/x/evidence/keeper" evidencetestutil "cosmossdk.io/x/evidence/testutil" "cosmossdk.io/x/evidence/types" - cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" - "github.com/golang/mock/gomock" - "github.com/stretchr/testify/suite" - - storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec/address" @@ -35,11 +35,7 @@ var ( newPubKey("0B485CFC0EECC619440448436F8FC9DF40566F2369E72400281454CB552AFB52"), } - valAddresses = []sdk.ValAddress{ - sdk.ValAddress(pubkeys[0].Address()), - sdk.ValAddress(pubkeys[1].Address()), - sdk.ValAddress(pubkeys[2].Address()), - } + valAddress = sdk.ValAddress(pubkeys[0].Address()) ) func newPubKey(pk string) (res cryptotypes.PubKey) { diff --git a/x/evidence/keeper/msg_server.go b/x/evidence/keeper/msg_server.go index 9862bbf6b953..fad39ef33188 100644 --- a/x/evidence/keeper/msg_server.go +++ b/x/evidence/keeper/msg_server.go @@ -4,10 +4,10 @@ import ( "context" "cosmossdk.io/errors" + "cosmossdk.io/x/evidence/types" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - - "cosmossdk.io/x/evidence/types" ) type msgServer struct { diff --git a/x/evidence/keeper/msg_server_test.go b/x/evidence/keeper/msg_server_test.go index cebc8c1a3817..f5dd4b6b5fd2 100644 --- a/x/evidence/keeper/msg_server_test.go +++ b/x/evidence/keeper/msg_server_test.go @@ -19,7 +19,7 @@ func (s *KeeperTestSuite) TestSubmitEvidence() { ConsensusAddress: sdk.ConsAddress(pk.PubKey().Address().Bytes()).String(), } - validEvidence, err := types.NewMsgSubmitEvidence(sdk.AccAddress(valAddresses[0]), e) + validEvidence, err := types.NewMsgSubmitEvidence(sdk.AccAddress(valAddress), e) s.Require().NoError(err) e2 := &types.Equivocation{ @@ -29,7 +29,7 @@ func (s *KeeperTestSuite) TestSubmitEvidence() { ConsensusAddress: sdk.ConsAddress(pk.PubKey().Address().Bytes()).String(), } - invalidEvidence, err := types.NewMsgSubmitEvidence(sdk.AccAddress(valAddresses[0]), e2) + invalidEvidence, err := types.NewMsgSubmitEvidence(sdk.AccAddress(valAddress), e2) s.Require().NoError(err) testCases := []struct { @@ -47,7 +47,7 @@ func (s *KeeperTestSuite) TestSubmitEvidence() { { name: "missing evidence", req: &types.MsgSubmitEvidence{ - Submitter: sdk.AccAddress(valAddresses[0]).String(), + Submitter: sdk.AccAddress(valAddress).String(), }, expErr: true, expErrMsg: "missing evidence: invalid evidence", diff --git a/x/evidence/module.go b/x/evidence/module.go index 5dbee9d7c1ec..d9bb011ba57c 100644 --- a/x/evidence/module.go +++ b/x/evidence/module.go @@ -5,7 +5,6 @@ import ( "encoding/json" "fmt" - abci "github.com/cometbft/cometbft/abci/types" gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" "google.golang.org/grpc" @@ -14,9 +13,8 @@ import ( "cosmossdk.io/core/address" "cosmossdk.io/core/appmodule" "cosmossdk.io/core/comet" - "cosmossdk.io/depinject" - store "cosmossdk.io/core/store" + "cosmossdk.io/depinject" eviclient "cosmossdk.io/x/evidence/client" "cosmossdk.io/x/evidence/client/cli" "cosmossdk.io/x/evidence/keeper" @@ -32,8 +30,13 @@ import ( ) var ( - _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleBasic = AppModule{} _ module.AppModuleSimulation = AppModule{} + _ module.HasGenesis = AppModule{} + + _ appmodule.AppModule = AppModule{} + _ appmodule.HasServices = AppModule{} + _ appmodule.HasBeginBlocker = AppModule{} ) // ---------------------------------------------------------------------------- @@ -95,11 +98,6 @@ func (a AppModuleBasic) GetTxCmd() *cobra.Command { return cli.GetTxCmd(evidenceCLIHandlers) } -// GetQueryCmd returns the evidence module's root query command. -func (AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd() -} - // RegisterInterfaces registers the evidence module's interface types func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { types.RegisterInterfaces(registry) @@ -124,23 +122,12 @@ func NewAppModule(keeper keeper.Keeper) AppModule { } } -var ( - _ appmodule.AppModule = AppModule{} - _ appmodule.HasServices = AppModule{} - _ appmodule.HasBeginBlocker = AppModule{} -) - // IsOnePerModuleType implements the depinject.OnePerModuleType interface. func (am AppModule) IsOnePerModuleType() {} // IsAppModule implements the appmodule.AppModule interface. func (am AppModule) IsAppModule() {} -// Name returns the evidence module's name. -func (am AppModule) Name() string { - return am.AppModuleBasic.Name() -} - // RegisterServices registers module services. func (am AppModule) RegisterServices(registrar grpc.ServiceRegistrar) error { types.RegisterMsgServer(registrar, keeper.NewMsgServerImpl(am.keeper)) @@ -150,7 +137,7 @@ func (am AppModule) RegisterServices(registrar grpc.ServiceRegistrar) error { // InitGenesis performs the evidence module's genesis initialization It returns // no validator updates. -func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, bz json.RawMessage) []abci.ValidatorUpdate { +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, bz json.RawMessage) { var gs types.GenesisState err := cdc.UnmarshalJSON(bz, &gs) if err != nil { @@ -158,7 +145,6 @@ func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, bz json.Ra } InitGenesis(ctx, am.keeper, &gs) - return []abci.ValidatorUpdate{} } // ExportGenesis returns the evidence module's exported genesis state as raw JSON bytes. diff --git a/x/evidence/simulation/genesis_test.go b/x/evidence/simulation/genesis_test.go index 1cee3d3f10c0..5d7851ea002d 100644 --- a/x/evidence/simulation/genesis_test.go +++ b/x/evidence/simulation/genesis_test.go @@ -5,10 +5,11 @@ import ( "math/rand" "testing" - sdkmath "cosmossdk.io/math" + "github.com/stretchr/testify/require" + + "cosmossdk.io/math" "cosmossdk.io/x/evidence/simulation" "cosmossdk.io/x/evidence/types" - "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -31,7 +32,7 @@ func TestRandomizedGenState(t *testing.T) { Rand: r, NumBonded: 3, Accounts: simtypes.RandomAccounts(r, 3), - InitialStake: sdkmath.NewInt(1000), + InitialStake: math.NewInt(1000), GenState: make(map[string]json.RawMessage), } diff --git a/x/evidence/sonar-project.properties b/x/evidence/sonar-project.properties deleted file mode 100644 index 87320e7ea8d0..000000000000 --- a/x/evidence/sonar-project.properties +++ /dev/null @@ -1,14 +0,0 @@ -sonar.projectKey=cosmos-sdk-x-evidence -sonar.organization=cosmos - -sonar.projectName=Cosmos SDK - x/evidence -sonar.project.monorepo.enabled=true - -sonar.sources=. -sonar.exclusions=**/*_test.go -sonar.tests=. -sonar.test.inclusions=**/*_test.go -sonar.go.coverage.reportPaths=coverage.out - -sonar.sourceEncoding=UTF-8 -sonar.scm.provider=git diff --git a/x/evidence/testutil/app_config.go b/x/evidence/testutil/app_config.go index fe091de044f4..30a0645b79f6 100644 --- a/x/evidence/testutil/app_config.go +++ b/x/evidence/testutil/app_config.go @@ -1,9 +1,9 @@ package testutil import ( - "github.com/cosmos/cosmos-sdk/testutil/configurator" + _ "cosmossdk.io/x/evidence" // import as blank for app wiring - _ "cosmossdk.io/x/evidence" // import as blank for app wiring + "github.com/cosmos/cosmos-sdk/testutil/configurator" _ "github.com/cosmos/cosmos-sdk/x/auth" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/auth/tx/config" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/bank" // import as blank for app wiring diff --git a/x/evidence/testutil/expected_keepers_mocks.go b/x/evidence/testutil/expected_keepers_mocks.go index cbfc0dd44a71..6ed38c9f9909 100644 --- a/x/evidence/testutil/expected_keepers_mocks.go +++ b/x/evidence/testutil/expected_keepers_mocks.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: x/evidence/types/expected_keepers.go +// +// Generated by this command: +// +// mockgen -source=x/evidence/types/expected_keepers.go -package testutil -destination x/evidence/testutil/expected_keepers_mocks.go +// // Package testutil is a generated GoMock package. package testutil @@ -9,18 +14,20 @@ import ( reflect "reflect" time "time" + address "cosmossdk.io/core/address" comet "cosmossdk.io/core/comet" math "cosmossdk.io/math" types "github.com/cosmos/cosmos-sdk/crypto/types" types0 "github.com/cosmos/cosmos-sdk/types" types1 "github.com/cosmos/cosmos-sdk/x/staking/types" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockStakingKeeper is a mock of StakingKeeper interface. type MockStakingKeeper struct { ctrl *gomock.Controller recorder *MockStakingKeeperMockRecorder + isgomock struct{} } // MockStakingKeeperMockRecorder is the mock recorder for MockStakingKeeper. @@ -40,30 +47,46 @@ func (m *MockStakingKeeper) EXPECT() *MockStakingKeeperMockRecorder { return m.recorder } +// ConsensusAddressCodec mocks base method. +func (m *MockStakingKeeper) ConsensusAddressCodec() address.Codec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ConsensusAddressCodec") + ret0, _ := ret[0].(address.Codec) + return ret0 +} + +// ConsensusAddressCodec indicates an expected call of ConsensusAddressCodec. +func (mr *MockStakingKeeperMockRecorder) ConsensusAddressCodec() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConsensusAddressCodec", reflect.TypeOf((*MockStakingKeeper)(nil).ConsensusAddressCodec)) +} + // GetParams mocks base method. -func (m *MockStakingKeeper) GetParams(ctx types0.Context) types1.Params { +func (m *MockStakingKeeper) GetParams(ctx context.Context) (types1.Params, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetParams", ctx) ret0, _ := ret[0].(types1.Params) - return ret0 + ret1, _ := ret[1].(error) + return ret0, ret1 } // GetParams indicates an expected call of GetParams. -func (mr *MockStakingKeeperMockRecorder) GetParams(ctx interface{}) *gomock.Call { +func (mr *MockStakingKeeperMockRecorder) GetParams(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetParams", reflect.TypeOf((*MockStakingKeeper)(nil).GetParams), ctx) } // ValidatorByConsAddr mocks base method. -func (m *MockStakingKeeper) ValidatorByConsAddr(arg0 types0.Context, arg1 types0.ConsAddress) types1.ValidatorI { +func (m *MockStakingKeeper) ValidatorByConsAddr(arg0 context.Context, arg1 types0.ConsAddress) (types1.ValidatorI, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ValidatorByConsAddr", arg0, arg1) ret0, _ := ret[0].(types1.ValidatorI) - return ret0 + ret1, _ := ret[1].(error) + return ret0, ret1 } // ValidatorByConsAddr indicates an expected call of ValidatorByConsAddr. -func (mr *MockStakingKeeperMockRecorder) ValidatorByConsAddr(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStakingKeeperMockRecorder) ValidatorByConsAddr(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorByConsAddr", reflect.TypeOf((*MockStakingKeeper)(nil).ValidatorByConsAddr), arg0, arg1) } @@ -72,6 +95,7 @@ func (mr *MockStakingKeeperMockRecorder) ValidatorByConsAddr(arg0, arg1 interfac type MockSlashingKeeper struct { ctrl *gomock.Controller recorder *MockSlashingKeeperMockRecorder + isgomock struct{} } // MockSlashingKeeperMockRecorder is the mock recorder for MockSlashingKeeper. @@ -101,7 +125,7 @@ func (m *MockSlashingKeeper) GetPubkey(arg0 context.Context, arg1 types.Address) } // GetPubkey indicates an expected call of GetPubkey. -func (mr *MockSlashingKeeperMockRecorder) GetPubkey(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockSlashingKeeperMockRecorder) GetPubkey(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPubkey", reflect.TypeOf((*MockSlashingKeeper)(nil).GetPubkey), arg0, arg1) } @@ -115,7 +139,7 @@ func (m *MockSlashingKeeper) HasValidatorSigningInfo(arg0 context.Context, arg1 } // HasValidatorSigningInfo indicates an expected call of HasValidatorSigningInfo. -func (mr *MockSlashingKeeperMockRecorder) HasValidatorSigningInfo(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockSlashingKeeperMockRecorder) HasValidatorSigningInfo(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HasValidatorSigningInfo", reflect.TypeOf((*MockSlashingKeeper)(nil).HasValidatorSigningInfo), arg0, arg1) } @@ -129,7 +153,7 @@ func (m *MockSlashingKeeper) IsTombstoned(arg0 context.Context, arg1 types0.Cons } // IsTombstoned indicates an expected call of IsTombstoned. -func (mr *MockSlashingKeeperMockRecorder) IsTombstoned(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockSlashingKeeperMockRecorder) IsTombstoned(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsTombstoned", reflect.TypeOf((*MockSlashingKeeper)(nil).IsTombstoned), arg0, arg1) } @@ -143,7 +167,7 @@ func (m *MockSlashingKeeper) Jail(arg0 context.Context, arg1 types0.ConsAddress) } // Jail indicates an expected call of Jail. -func (mr *MockSlashingKeeperMockRecorder) Jail(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockSlashingKeeperMockRecorder) Jail(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Jail", reflect.TypeOf((*MockSlashingKeeper)(nil).Jail), arg0, arg1) } @@ -157,7 +181,7 @@ func (m *MockSlashingKeeper) JailUntil(arg0 context.Context, arg1 types0.ConsAdd } // JailUntil indicates an expected call of JailUntil. -func (mr *MockSlashingKeeperMockRecorder) JailUntil(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockSlashingKeeperMockRecorder) JailUntil(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "JailUntil", reflect.TypeOf((*MockSlashingKeeper)(nil).JailUntil), arg0, arg1, arg2) } @@ -171,7 +195,7 @@ func (m *MockSlashingKeeper) Slash(arg0 context.Context, arg1 types0.ConsAddress } // Slash indicates an expected call of Slash. -func (mr *MockSlashingKeeperMockRecorder) Slash(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { +func (mr *MockSlashingKeeperMockRecorder) Slash(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Slash", reflect.TypeOf((*MockSlashingKeeper)(nil).Slash), arg0, arg1, arg2, arg3, arg4) } @@ -186,7 +210,7 @@ func (m *MockSlashingKeeper) SlashFractionDoubleSign(arg0 context.Context) (math } // SlashFractionDoubleSign indicates an expected call of SlashFractionDoubleSign. -func (mr *MockSlashingKeeperMockRecorder) SlashFractionDoubleSign(arg0 interface{}) *gomock.Call { +func (mr *MockSlashingKeeperMockRecorder) SlashFractionDoubleSign(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SlashFractionDoubleSign", reflect.TypeOf((*MockSlashingKeeper)(nil).SlashFractionDoubleSign), arg0) } @@ -200,7 +224,7 @@ func (m *MockSlashingKeeper) SlashWithInfractionReason(arg0 context.Context, arg } // SlashWithInfractionReason indicates an expected call of SlashWithInfractionReason. -func (mr *MockSlashingKeeperMockRecorder) SlashWithInfractionReason(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call { +func (mr *MockSlashingKeeperMockRecorder) SlashWithInfractionReason(arg0, arg1, arg2, arg3, arg4, arg5 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SlashWithInfractionReason", reflect.TypeOf((*MockSlashingKeeper)(nil).SlashWithInfractionReason), arg0, arg1, arg2, arg3, arg4, arg5) } @@ -214,7 +238,7 @@ func (m *MockSlashingKeeper) Tombstone(arg0 context.Context, arg1 types0.ConsAdd } // Tombstone indicates an expected call of Tombstone. -func (mr *MockSlashingKeeperMockRecorder) Tombstone(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockSlashingKeeperMockRecorder) Tombstone(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Tombstone", reflect.TypeOf((*MockSlashingKeeper)(nil).Tombstone), arg0, arg1) } @@ -223,6 +247,7 @@ func (mr *MockSlashingKeeperMockRecorder) Tombstone(arg0, arg1 interface{}) *gom type MockAccountKeeper struct { ctrl *gomock.Controller recorder *MockAccountKeeperMockRecorder + isgomock struct{} } // MockAccountKeeperMockRecorder is the mock recorder for MockAccountKeeper. @@ -249,7 +274,7 @@ func (m *MockAccountKeeper) SetAccount(ctx context.Context, acc types0.AccountI) } // SetAccount indicates an expected call of SetAccount. -func (mr *MockAccountKeeperMockRecorder) SetAccount(ctx, acc interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) SetAccount(ctx, acc any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetAccount", reflect.TypeOf((*MockAccountKeeper)(nil).SetAccount), ctx, acc) } @@ -258,6 +283,7 @@ func (mr *MockAccountKeeperMockRecorder) SetAccount(ctx, acc interface{}) *gomoc type MockBankKeeper struct { ctrl *gomock.Controller recorder *MockBankKeeperMockRecorder + isgomock struct{} } // MockBankKeeperMockRecorder is the mock recorder for MockBankKeeper. @@ -286,7 +312,7 @@ func (m *MockBankKeeper) GetAllBalances(ctx types0.Context, addr types0.AccAddre } // GetAllBalances indicates an expected call of GetAllBalances. -func (mr *MockBankKeeperMockRecorder) GetAllBalances(ctx, addr interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) GetAllBalances(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllBalances", reflect.TypeOf((*MockBankKeeper)(nil).GetAllBalances), ctx, addr) } @@ -300,7 +326,7 @@ func (m *MockBankKeeper) MintCoins(ctx types0.Context, moduleName string, amt ty } // MintCoins indicates an expected call of MintCoins. -func (mr *MockBankKeeperMockRecorder) MintCoins(ctx, moduleName, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) MintCoins(ctx, moduleName, amt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MintCoins", reflect.TypeOf((*MockBankKeeper)(nil).MintCoins), ctx, moduleName, amt) } @@ -314,7 +340,7 @@ func (m *MockBankKeeper) SendCoinsFromModuleToAccount(ctx types0.Context, sender } // SendCoinsFromModuleToAccount indicates an expected call of SendCoinsFromModuleToAccount. -func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToAccount(ctx, senderModule, recipientAddr, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToAccount(ctx, senderModule, recipientAddr, amt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromModuleToAccount", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromModuleToAccount), ctx, senderModule, recipientAddr, amt) } @@ -323,6 +349,7 @@ func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToAccount(ctx, senderMo type MockCometinfo struct { ctrl *gomock.Controller recorder *MockCometinfoMockRecorder + isgomock struct{} } // MockCometinfoMockRecorder is the mock recorder for MockCometinfo. @@ -351,7 +378,7 @@ func (m *MockCometinfo) GetCometBlockInfo(arg0 context.Context) comet.BlockInfo } // GetCometBlockInfo indicates an expected call of GetCometBlockInfo. -func (mr *MockCometinfoMockRecorder) GetCometBlockInfo(arg0 interface{}) *gomock.Call { +func (mr *MockCometinfoMockRecorder) GetCometBlockInfo(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCometBlockInfo", reflect.TypeOf((*MockCometinfo)(nil).GetCometBlockInfo), arg0) } diff --git a/x/evidence/types/evidence.go b/x/evidence/types/evidence.go index cabdf59b0325..aed09ec30402 100644 --- a/x/evidence/types/evidence.go +++ b/x/evidence/types/evidence.go @@ -4,9 +4,11 @@ import ( "fmt" "time" + "github.com/cometbft/cometbft/crypto/tmhash" + + "cosmossdk.io/core/address" "cosmossdk.io/core/comet" "cosmossdk.io/x/evidence/exported" - "github.com/cometbft/cometbft/crypto/tmhash" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -48,8 +50,8 @@ func (e *Equivocation) ValidateBasic() error { // GetConsensusAddress returns the validator's consensus address at time of the // Equivocation infraction. -func (e Equivocation) GetConsensusAddress() sdk.ConsAddress { - addr, _ := sdk.ConsAddressFromBech32(e.ConsensusAddress) +func (e Equivocation) GetConsensusAddress(consAc address.Codec) sdk.ConsAddress { + addr, _ := consAc.StringToBytes(e.ConsensusAddress) return addr } @@ -74,9 +76,8 @@ func (e Equivocation) GetTotalPower() int64 { return 0 } // FromABCIEvidence converts a CometBFT concrete Evidence type to // SDK Evidence using Equivocation as the concrete type. -func FromABCIEvidence(e comet.Evidence) *Equivocation { - bech32PrefixConsAddr := sdk.GetConfig().GetBech32ConsensusAddrPrefix() - consAddr, err := sdk.Bech32ifyAddressBytes(bech32PrefixConsAddr, e.Validator().Address()) +func FromABCIEvidence(e comet.Evidence, conAc address.Codec) *Equivocation { + consAddr, err := conAc.BytesToString(e.Validator().Address()) if err != nil { panic(err) } diff --git a/x/evidence/types/evidence_test.go b/x/evidence/types/evidence_test.go index 4f13329c914c..86707532686b 100644 --- a/x/evidence/types/evidence_test.go +++ b/x/evidence/types/evidence_test.go @@ -6,10 +6,12 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "cosmossdk.io/core/comet" "cosmossdk.io/x/evidence/types" - "github.com/stretchr/testify/require" + "github.com/cosmos/cosmos-sdk/codec/address" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -27,7 +29,7 @@ func TestEquivocation_Valid(t *testing.T) { require.Equal(t, e.GetTotalPower(), int64(0)) require.Equal(t, e.GetValidatorPower(), e.Power) require.Equal(t, e.GetTime(), e.Time) - require.Equal(t, e.GetConsensusAddress().String(), e.ConsensusAddress) + require.Equal(t, e.GetConsensusAddress(address.NewBech32Codec("cosmosvalcons")).String(), e.ConsensusAddress) require.Equal(t, e.GetHeight(), e.Height) require.Equal(t, e.Route(), types.RouteEquivocation) require.Equal(t, strings.ToUpper(hex.EncodeToString(e.Hash())), "1E10F9267BEA3A9A4AB5302C2C510CC1AFD7C54E232DA5B2E3360DFAFACF7A76") @@ -37,7 +39,7 @@ func TestEquivocation_Valid(t *testing.T) { require.Equal(t, int64(0), e.GetTotalPower()) require.Equal(t, e.Power, e.GetValidatorPower()) require.Equal(t, e.Time, e.GetTime()) - require.Equal(t, e.ConsensusAddress, e.GetConsensusAddress().String()) + require.Equal(t, e.ConsensusAddress, e.GetConsensusAddress(address.NewBech32Codec("cosmosvalcons")).String()) require.Equal(t, e.Height, e.GetHeight()) require.Equal(t, types.RouteEquivocation, e.Route()) require.Equal(t, "1E10F9267BEA3A9A4AB5302C2C510CC1AFD7C54E232DA5B2E3360DFAFACF7A76", strings.ToUpper(hex.EncodeToString(e.Hash()))) @@ -75,8 +77,8 @@ func TestEvidenceAddressConversion(t *testing.T) { tmEvidence := NewCometMisbehavior(1, 100, time.Now(), comet.DuplicateVote, validator{address: []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, power: 100}) - evidence := types.FromABCIEvidence(tmEvidence) - consAddr := evidence.GetConsensusAddress() + evidence := types.FromABCIEvidence(tmEvidence, address.NewBech32Codec("testcnclcons")) + consAddr := evidence.GetConsensusAddress(address.NewBech32Codec("testcnclcons")) // Check the address is the same after conversion require.Equal(t, tmEvidence.Validator().Address(), consAddr.Bytes()) sdk.GetConfig().SetBech32PrefixForConsensusNode(sdk.Bech32PrefixConsAddr, sdk.Bech32PrefixConsPub) diff --git a/x/evidence/types/expected_keepers.go b/x/evidence/types/expected_keepers.go index cca18222cc9b..04f4e83ab07d 100644 --- a/x/evidence/types/expected_keepers.go +++ b/x/evidence/types/expected_keepers.go @@ -4,8 +4,9 @@ import ( "context" "time" + "cosmossdk.io/core/address" "cosmossdk.io/core/comet" - sdkmath "cosmossdk.io/math" + "cosmossdk.io/math" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -16,8 +17,9 @@ type ( // StakingKeeper defines the staking module interface contract needed by the // evidence module. StakingKeeper interface { - ValidatorByConsAddr(sdk.Context, sdk.ConsAddress) stakingtypes.ValidatorI - GetParams(ctx sdk.Context) (params stakingtypes.Params) + ConsensusAddressCodec() address.Codec + ValidatorByConsAddr(context.Context, sdk.ConsAddress) (stakingtypes.ValidatorI, error) + GetParams(ctx context.Context) (params stakingtypes.Params, err error) } // SlashingKeeper defines the slashing module interface contract needed by the @@ -27,9 +29,9 @@ type ( IsTombstoned(context.Context, sdk.ConsAddress) bool HasValidatorSigningInfo(context.Context, sdk.ConsAddress) bool Tombstone(context.Context, sdk.ConsAddress) error - Slash(context.Context, sdk.ConsAddress, sdkmath.LegacyDec, int64, int64) error - SlashWithInfractionReason(context.Context, sdk.ConsAddress, sdkmath.LegacyDec, int64, int64, stakingtypes.Infraction) error - SlashFractionDoubleSign(context.Context) (sdkmath.LegacyDec, error) + Slash(context.Context, sdk.ConsAddress, math.LegacyDec, int64, int64) error + SlashWithInfractionReason(context.Context, sdk.ConsAddress, math.LegacyDec, int64, int64, stakingtypes.Infraction) error + SlashFractionDoubleSign(context.Context) (math.LegacyDec, error) Jail(context.Context, sdk.ConsAddress) error JailUntil(context.Context, sdk.ConsAddress, time.Time) error } diff --git a/x/evidence/types/genesis.go b/x/evidence/types/genesis.go index ab8e7bbcadb0..873f9a075fba 100644 --- a/x/evidence/types/genesis.go +++ b/x/evidence/types/genesis.go @@ -3,9 +3,10 @@ package types import ( "fmt" - "cosmossdk.io/x/evidence/exported" proto "github.com/cosmos/gogoproto/proto" + "cosmossdk.io/x/evidence/exported" + "github.com/cosmos/cosmos-sdk/codec/types" ) diff --git a/x/evidence/types/genesis_test.go b/x/evidence/types/genesis_test.go index ab6aa0245595..20b5967ac2eb 100644 --- a/x/evidence/types/genesis_test.go +++ b/x/evidence/types/genesis_test.go @@ -5,9 +5,10 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "cosmossdk.io/x/evidence/exported" "cosmossdk.io/x/evidence/types" - "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" diff --git a/x/evidence/types/msgs.go b/x/evidence/types/msgs.go index c78d59c7dd4d..8d65aca64dbc 100644 --- a/x/evidence/types/msgs.go +++ b/x/evidence/types/msgs.go @@ -30,12 +30,6 @@ func NewMsgSubmitEvidence(s sdk.AccAddress, evi exported.Evidence) (*MsgSubmitEv return &MsgSubmitEvidence{Submitter: s.String(), Evidence: any}, nil } -// GetSigners returns the single expected signer for a MsgSubmitEvidence. -func (m MsgSubmitEvidence) GetSigners() []sdk.AccAddress { - submitter, _ := sdk.AccAddressFromBech32(m.Submitter) - return []sdk.AccAddress{submitter} -} - func (m MsgSubmitEvidence) GetEvidence() exported.Evidence { if m.Evidence == nil { return nil diff --git a/x/evidence/types/query.pb.go b/x/evidence/types/query.pb.go index 655a454a775e..c1b10af907d3 100644 --- a/x/evidence/types/query.pb.go +++ b/x/evidence/types/query.pb.go @@ -383,6 +383,7 @@ func _Query_AllEvidence_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.evidence.v1beta1.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/evidence/types/router_test.go b/x/evidence/types/router_test.go index 202f2dc1513b..2bd49861dbf5 100644 --- a/x/evidence/types/router_test.go +++ b/x/evidence/types/router_test.go @@ -4,9 +4,10 @@ import ( "context" "testing" + "github.com/stretchr/testify/require" + "cosmossdk.io/x/evidence/exported" "cosmossdk.io/x/evidence/types" - "github.com/stretchr/testify/require" ) func testHandler(context.Context, exported.Evidence) error { return nil } diff --git a/x/evidence/types/tx.pb.go b/x/evidence/types/tx.pb.go index 2b11405a2e01..661e5ba5aba6 100644 --- a/x/evidence/types/tx.pb.go +++ b/x/evidence/types/tx.pb.go @@ -252,6 +252,7 @@ func _Msg_SubmitEvidence_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.evidence.v1beta1.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/feegrant/CHANGELOG.md b/x/feegrant/CHANGELOG.md index 9dabfb6fa994..25070c242de3 100644 --- a/x/feegrant/CHANGELOG.md +++ b/x/feegrant/CHANGELOG.md @@ -25,12 +25,26 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +## [v0.1.1](https://github.com/cosmos/cosmos-sdk/releases/tag/x/feegrant/v0.1.1) - 2024-04-22 + +### Improvements + +* (deps) [#19810](https://github.com/cosmos/cosmos-sdk/pull/19810) Upgrade SDK version due to prometheus breaking change. +* (deps) [#19810](https://github.com/cosmos/cosmos-sdk/pull/19810) Bump `cosmossdk.io/store` to v1.1.0. + +### Bug Fixes + +* [#20114](https://github.com/cosmos/cosmos-sdk/pull/20114) Follow up of [GHSA-4j93-fm92-rp4m](https://github.com/cosmos/cosmos-sdk/security/advisories/GHSA-4j93-fm92-rp4m) for `k.GrantAllowance`. + +## [v0.1.0](https://github.com/cosmos/cosmos-sdk/releases/tag/x/feegrant/v0.1.0) - 2023-11-07 + ### Features +* [#18047](https://github.com/cosmos/cosmos-sdk/pull/18047) Added a limit of 200 grants pruned per EndBlock and the method PruneAllowances that prunes 75 expired grants on every run. * [#14649](https://github.com/cosmos/cosmos-sdk/pull/14649) The `x/feegrant` module is extracted to have a separate go.mod file which allows it to be a standalone module. ### API Breaking Changes -* [#15606](https://github.com/cosmos/cosmos-sdk/pull/15606) `NewKeeper` now takes a `KVStoreService` instead of a `StoreKey` and methods in the `Keeper` now take a `context.Context` instead of a `sdk.Context`. +* [#15606](https://github.com/cosmos/cosmos-sdk/pull/15606) `NewKeeper` now takes a `KVStoreService` instead of a `StoreKey` and methods in the `Keeper` now take a `context.Context` instead of a `sdk.Context`. * [#15347](https://github.com/cosmos/cosmos-sdk/pull/15347) Remove global bech32 usage in keeper. * [#15347](https://github.com/cosmos/cosmos-sdk/pull/15347) `ValidateBasic` is treated as a no op now with with acceptance of RFC001 diff --git a/x/feegrant/README.md b/x/feegrant/README.md index 9fcd1e476d6f..07524449a862 100644 --- a/x/feegrant/README.md +++ b/x/feegrant/README.md @@ -206,6 +206,14 @@ The feegrant module emits the following events: | message | granter | {granterAddress} | | message | grantee | {granteeAddress} | +### Prune fee allowances + +| Type | Attribute Key | Attribute Value | +| ------- | ------------- | ---------------- | +| message | action | prune_feegrant | +| message | pruner | {prunerAddress} | + + ## Client ### CLI diff --git a/x/feegrant/basic_fee.go b/x/feegrant/basic_fee.go index e1eb829f5221..e9703c96c14f 100644 --- a/x/feegrant/basic_fee.go +++ b/x/feegrant/basic_fee.go @@ -58,6 +58,7 @@ func (a BasicAllowance) ValidateBasic() error { return nil } +// ExpiresAt returns the expiry time of the BasicAllowance. func (a BasicAllowance) ExpiresAt() (*time.Time, error) { return a.Expiration, nil } diff --git a/x/feegrant/client/cli/query.go b/x/feegrant/client/cli/query.go deleted file mode 100644 index d2808f5f5dff..000000000000 --- a/x/feegrant/client/cli/query.go +++ /dev/null @@ -1,175 +0,0 @@ -package cli - -import ( - "fmt" - "strings" - - "cosmossdk.io/core/address" - "github.com/spf13/cobra" - - "cosmossdk.io/x/feegrant" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/version" -) - -// GetQueryCmd returns the cli query commands for this module -func GetQueryCmd(ac address.Codec) *cobra.Command { - feegrantQueryCmd := &cobra.Command{ - Use: feegrant.ModuleName, - Short: "Querying commands for the feegrant module", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - feegrantQueryCmd.AddCommand( - GetCmdQueryFeeGrant(ac), - GetCmdQueryFeeGrantsByGrantee(ac), - GetCmdQueryFeeGrantsByGranter(ac), - ) - - return feegrantQueryCmd -} - -// GetCmdQueryFeeGrant returns cmd to query for a grant between granter and grantee. -func GetCmdQueryFeeGrant(ac address.Codec) *cobra.Command { - cmd := &cobra.Command{ - Use: "grant [granter] [grantee]", - Args: cobra.ExactArgs(2), - Short: "Query details of a single grant", - Long: strings.TrimSpace( - fmt.Sprintf(`Query details for a grant. -You can find the fee-grant of a granter and grantee. - -Example: -$ %s query feegrant grant [granter] [grantee] -`, version.AppName), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - queryClient := feegrant.NewQueryClient(clientCtx) - - if _, err := ac.StringToBytes(args[0]); err != nil { - return err - } - - if _, err := ac.StringToBytes(args[1]); err != nil { - return err - } - - res, err := queryClient.Allowance( - cmd.Context(), - &feegrant.QueryAllowanceRequest{ - Granter: args[0], - Grantee: args[1], - }, - ) - if err != nil { - return err - } - - return clientCtx.PrintProto(res.Allowance) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetCmdQueryFeeGrantsByGrantee returns cmd to query for all grants for a grantee. -func GetCmdQueryFeeGrantsByGrantee(ac address.Codec) *cobra.Command { - cmd := &cobra.Command{ - Use: "grants-by-grantee [grantee]", - Args: cobra.ExactArgs(1), - Short: "Query all grants of a grantee", - Long: strings.TrimSpace( - fmt.Sprintf(`Queries all the grants for a grantee address. - -Example: -$ %s query feegrant grants-by-grantee [grantee] -`, version.AppName), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - queryClient := feegrant.NewQueryClient(clientCtx) - - _, err := ac.StringToBytes(args[0]) - if err != nil { - return err - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - res, err := queryClient.Allowances( - cmd.Context(), - &feegrant.QueryAllowancesRequest{ - Grantee: args[0], - Pagination: pageReq, - }, - ) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "grants") - - return cmd -} - -// GetCmdQueryFeeGrantsByGranter returns cmd to query for all grants by a granter. -func GetCmdQueryFeeGrantsByGranter(ac address.Codec) *cobra.Command { - cmd := &cobra.Command{ - Use: "grants-by-granter [granter]", - Args: cobra.ExactArgs(1), - Short: "Query all grants by a granter", - Long: strings.TrimSpace( - fmt.Sprintf(`Queries all the grants issued for a granter address. - -Example: -$ %s query feegrant grants-by-granter [granter] -`, version.AppName), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - queryClient := feegrant.NewQueryClient(clientCtx) - - _, err := ac.StringToBytes(args[0]) - if err != nil { - return err - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - res, err := queryClient.AllowancesByGranter( - cmd.Context(), - &feegrant.QueryAllowancesByGranterRequest{ - Granter: args[0], - Pagination: pageReq, - }, - ) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "grants") - - return cmd -} diff --git a/x/feegrant/client/cli/query_test.go b/x/feegrant/client/cli/query_test.go deleted file mode 100644 index b066af7309e5..000000000000 --- a/x/feegrant/client/cli/query_test.go +++ /dev/null @@ -1,156 +0,0 @@ -package cli_test - -import ( - "fmt" - - "cosmossdk.io/x/feegrant" - "cosmossdk.io/x/feegrant/client/cli" - "github.com/cosmos/cosmos-sdk/client/flags" - codecaddress "github.com/cosmos/cosmos-sdk/codec/address" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" -) - -func (s *CLITestSuite) TestCmdGetFeeGrant() { - granter := s.addedGranter - grantee := s.addedGrantee - - testCases := []struct { - name string - args []string - expectErrMsg string - expectErr bool - respType *feegrant.QueryAllowanceResponse - resp *feegrant.Grant - }{ - { - "wrong granter", - []string{ - "wrong_granter", - grantee.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - "decoding bech32 failed", - true, nil, nil, - }, - { - "wrong grantee", - []string{ - granter.String(), - "wrong_grantee", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - "decoding bech32 failed", - true, nil, nil, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryFeeGrant(codecaddress.NewBech32Codec("cosmos")) - out, err := clitestutil.ExecTestCLICmd(s.clientCtx, cmd, tc.args) - - if tc.expectErr { - s.Require().Error(err) - s.Require().Contains(err.Error(), tc.expectErrMsg) - } else { - s.Require().NoError(err) - s.Require().NoError(s.clientCtx.Codec.UnmarshalJSON(out.Bytes(), tc.respType), out.String()) - } - }) - } -} - -func (s *CLITestSuite) TestCmdGetFeeGrantsByGrantee() { - grantee := s.addedGrantee - clientCtx := s.clientCtx - - testCases := []struct { - name string - args []string - expectErr bool - resp *feegrant.QueryAllowancesResponse - expectLength int - }{ - { - "wrong grantee", - []string{ - "wrong_grantee", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, nil, 0, - }, - { - "valid req", - []string{ - grantee.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, &feegrant.QueryAllowancesResponse{}, 1, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryFeeGrantsByGrantee(codecaddress.NewBech32Codec("cosmos")) - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), tc.resp), out.String()) - } - }) - } -} - -func (s *CLITestSuite) TestCmdGetFeeGrantsByGranter() { - granter := s.addedGranter - clientCtx := s.clientCtx - - testCases := []struct { - name string - args []string - expectErr bool - resp *feegrant.QueryAllowancesByGranterResponse - expectLength int - }{ - { - "wrong grantee", - []string{ - "wrong_grantee", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, nil, 0, - }, - { - "valid req", - []string{ - granter.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, &feegrant.QueryAllowancesByGranterResponse{}, 1, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryFeeGrantsByGranter(codecaddress.NewBech32Codec("cosmos")) - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), tc.resp), out.String()) - } - }) - } -} diff --git a/x/feegrant/client/cli/tx.go b/x/feegrant/client/cli/tx.go index 635249da0e18..9ff9ed96b1bc 100644 --- a/x/feegrant/client/cli/tx.go +++ b/x/feegrant/client/cli/tx.go @@ -8,13 +8,13 @@ import ( "github.com/spf13/cobra" "cosmossdk.io/core/address" + "cosmossdk.io/x/feegrant" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/version" - - "cosmossdk.io/x/feegrant" ) // flag for feegrant module @@ -26,11 +26,11 @@ const ( FlagAllowedMsgs = "allowed-messages" ) -// GetTxCmd returns the transaction commands for this module +// GetTxCmd returns the transaction commands for feegrant module func GetTxCmd(ac address.Codec) *cobra.Command { feegrantTxCmd := &cobra.Command{ Use: feegrant.ModuleName, - Short: "Feegrant transactions subcommands", + Short: "Feegrant transactions sub-commands", Long: "Grant and revoke fee allowance for a grantee by a granter", DisableFlagParsing: true, SuggestionsMinimumDistance: 2, @@ -39,20 +39,21 @@ func GetTxCmd(ac address.Codec) *cobra.Command { feegrantTxCmd.AddCommand( NewCmdFeeGrant(ac), - NewCmdRevokeFeegrant(ac), ) return feegrantTxCmd } -// NewCmdFeeGrant returns a CLI command handler for creating a MsgGrantAllowance transaction. +// NewCmdFeeGrant returns a CLI command handler to create a MsgGrantAllowance transaction. +// This command is more powerful than AutoCLI generated command as it allows a better input validation. func NewCmdFeeGrant(ac address.Codec) *cobra.Command { cmd := &cobra.Command{ - Use: "grant [granter_key_or_address] [grantee]", - Short: "Grant Fee allowance to an address", + Use: "grant [granter_key_or_address] [grantee]", + Aliases: []string{"grant-allowance"}, + Short: "Grant Fee allowance to an address", Long: strings.TrimSpace( fmt.Sprintf( - `Grant authorization to pay fees from your address. Note, the'--from' flag is + `Grant authorization to pay fees from your address. Note, the '--from' flag is ignored as it is implied from [granter]. Examples: @@ -65,7 +66,10 @@ Examples: ), Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { - cmd.Flags().Set(flags.FlagFrom, args[0]) + if err := cmd.Flags().Set(flags.FlagFrom, args[0]); err != nil { + return err + } + clientCtx, err := client.GetClientTxContext(cmd) if err != nil { return err @@ -82,7 +86,8 @@ Examples: return err } - // if `FlagSpendLimit` isn't set, limit will be nil + // if `FlagSpendLimit` isn't set, limit will be nil. + // Hence, there won't be any spendlimit for the grantee. limit, err := sdk.ParseCoinsNormalized(sl) if err != nil { return err @@ -119,7 +124,8 @@ Examples: return err } - // Check any of period or periodLimit flags set, If set consider it as periodic fee allowance. + // check any of period or periodLimit flags are set, + // if set consider it as periodic fee allowance. if periodClock > 0 || periodLimitVal != "" { periodLimit, err := sdk.ParseCoinsNormalized(periodLimitVal) if err != nil { @@ -181,42 +187,6 @@ Examples: return cmd } -// NewCmdRevokeFeegrant returns a CLI command handler for creating a MsgRevokeAllowance transaction. -func NewCmdRevokeFeegrant(ac address.Codec) *cobra.Command { - cmd := &cobra.Command{ - Use: "revoke [granter] [grantee]", - Short: "revoke fee-grant", - Long: strings.TrimSpace( - fmt.Sprintf(`revoke fee grant from a granter to a grantee. Note, the'--from' flag is - ignored as it is implied from [granter]. - -Example: - $ %s tx %s revoke cosmos1skj.. cosmos1skj.. - `, version.AppName, feegrant.ModuleName), - ), - Args: cobra.ExactArgs(2), - RunE: func(cmd *cobra.Command, args []string) error { - cmd.Flags().Set(flags.FlagFrom, args[0]) - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - grantee, err := ac.StringToBytes(args[1]) - if err != nil { - return err - } - - msg := feegrant.NewMsgRevokeAllowance(clientCtx.GetFromAddress(), grantee) - - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - return cmd -} - func getPeriodReset(duration int64) time.Time { return time.Now().Add(getPeriod(duration)) } diff --git a/x/feegrant/client/cli/tx_test.go b/x/feegrant/client/cli/tx_test.go index 85ba10ad8e84..dc9b8d2abfb9 100644 --- a/x/feegrant/client/cli/tx_test.go +++ b/x/feegrant/client/cli/tx_test.go @@ -7,7 +7,6 @@ import ( "testing" "time" - sdkmath "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" rpcclientmock "github.com/cometbft/cometbft/rpc/client/mock" "github.com/cosmos/gogoproto/proto" @@ -15,6 +14,7 @@ import ( _ "cosmossdk.io/api/cosmos/feegrant/v1beta1" _ "cosmossdk.io/api/cosmos/gov/v1beta1" + sdkmath "cosmossdk.io/math" "cosmossdk.io/x/feegrant" "cosmossdk.io/x/feegrant/client/cli" "cosmossdk.io/x/feegrant/module" @@ -428,99 +428,6 @@ func (s *CLITestSuite) TestNewCmdFeeGrant() { } } -func (s *CLITestSuite) TestNewCmdRevokeFeegrant() { - granter := s.addedGranter - grantee := s.addedGrantee - clientCtx := s.clientCtx - - commonFlags := []string{ - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(10))).String()), - } - - addressCodec := codecaddress.NewBech32Codec("cosmos") - // Create new fee grant specifically to test amino. - encodedGrantee := "cosmos16ydaqh0fcnh4qt7a3jme4mmztm2qel5axcpw00" - aminoGrantee, err := addressCodec.StringToBytes(encodedGrantee) - s.Require().NoError(err) - s.createGrant(granter, sdk.AccAddress(aminoGrantee)) - - testCases := []struct { - name string - args []string - expectErr bool - expectedCode uint32 - respType proto.Message - }{ - { - "invalid granter", - append( - []string{ - "wrong_granter", - grantee.String(), - fmt.Sprintf("--%s=%s", flags.FlagFrom, granter), - }, - commonFlags..., - ), - true, 0, nil, - }, - { - "invalid grantee", - append( - []string{ - granter.String(), - "wrong_grantee", - fmt.Sprintf("--%s=%s", flags.FlagFrom, granter), - }, - commonFlags..., - ), - true, 0, nil, - }, - { - "Valid revoke", - append( - []string{ - granter.String(), - grantee.String(), - fmt.Sprintf("--%s=%s", flags.FlagFrom, granter), - }, - commonFlags..., - ), - false, 0, &sdk.TxResponse{}, - }, - { - "Valid revoke with amino", - append( - []string{ - granter.String(), - encodedGrantee, - fmt.Sprintf("--%s=%s", flags.FlagFrom, granter), - fmt.Sprintf("--%s=%s", flags.FlagSignMode, flags.SignModeLegacyAminoJSON), - }, - commonFlags..., - ), - false, 0, &sdk.TxResponse{}, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.NewCmdRevokeFeegrant(codecaddress.NewBech32Codec("cosmos")) - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), tc.respType), out.String()) - } - }) - } -} - func (s *CLITestSuite) TestTxWithFeeGrant() { clientCtx := s.clientCtx granter := s.addedGranter diff --git a/x/feegrant/events.go b/x/feegrant/events.go index d5f047612370..70cb6990f0cd 100644 --- a/x/feegrant/events.go +++ b/x/feegrant/events.go @@ -6,7 +6,9 @@ const ( EventTypeRevokeFeeGrant = "revoke_feegrant" EventTypeSetFeeGrant = "set_feegrant" EventTypeUpdateFeeGrant = "update_feegrant" + EventTypePruneFeeGrant = "prune_feegrant" AttributeKeyGranter = "granter" AttributeKeyGrantee = "grantee" + AttributeKeyPruner = "pruner" ) diff --git a/x/feegrant/expected_keepers.go b/x/feegrant/expected_keepers.go index ce6a2d0a5698..e09da85fc080 100644 --- a/x/feegrant/expected_keepers.go +++ b/x/feegrant/expected_keepers.go @@ -24,4 +24,5 @@ type AccountKeeper interface { type BankKeeper interface { SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + BlockedAddr(addr sdk.AccAddress) bool } diff --git a/x/feegrant/fees.go b/x/feegrant/fees.go index b6191204d5dd..fcaa8fdf9fcc 100644 --- a/x/feegrant/fees.go +++ b/x/feegrant/fees.go @@ -8,7 +8,7 @@ import ( ) // FeeAllowance implementations are tied to a given fee delegator and delegatee, -// and are used to enforce fee grant limits. +// and are used to enforce feegrant limits. type FeeAllowanceI interface { // Accept can use fee payment requested as well as timestamp of the current block // to determine whether or not to process this. This is checked in diff --git a/x/feegrant/filtered_fee.go b/x/feegrant/filtered_fee.go index 4af34e95eea2..c6ed2fed40b4 100644 --- a/x/feegrant/filtered_fee.go +++ b/x/feegrant/filtered_fee.go @@ -4,9 +4,10 @@ import ( "context" "time" - errorsmod "cosmossdk.io/errors" "github.com/cosmos/gogoproto/proto" + errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -127,6 +128,7 @@ func (a *AllowedMsgAllowance) ValidateBasic() error { return allowance.ValidateBasic() } +// ExpiresAt returns the expiry time of the AllowedMsgAllowance. func (a *AllowedMsgAllowance) ExpiresAt() (*time.Time, error) { allowance, err := a.GetAllowance() if err != nil { diff --git a/x/feegrant/go.mod b/x/feegrant/go.mod index 21bcaa0a34a9..bc45e21e7c0e 100644 --- a/x/feegrant/go.mod +++ b/x/feegrant/go.mod @@ -1,157 +1,164 @@ module cosmossdk.io/x/feegrant -go 1.20 +go 1.23.0 require ( - cosmossdk.io/api v0.4.2 - cosmossdk.io/core v0.8.0 - cosmossdk.io/depinject v1.0.0-alpha.3 - cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 - cosmossdk.io/log v1.1.0 - cosmossdk.io/math v1.0.1 - cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c - github.com/cometbft/cometbft v0.38.0-rc1 - github.com/cosmos/cosmos-proto v1.0.0-beta.3 - github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230607182757-cfeb10287d61 - github.com/cosmos/gogoproto v1.4.10 - github.com/golang/mock v1.6.0 - github.com/golang/protobuf v1.5.3 + cosmossdk.io/api v0.7.6 + cosmossdk.io/core v0.11.0 + cosmossdk.io/depinject v1.1.0 + cosmossdk.io/errors v1.0.1 + cosmossdk.io/log v1.5.0 + cosmossdk.io/math v1.5.0 + cosmossdk.io/store v1.1.1 + github.com/cometbft/cometbft v0.38.17 + github.com/cosmos/cosmos-proto v1.0.0-beta.5 + github.com/cosmos/cosmos-sdk v0.50.13 + github.com/cosmos/gogoproto v1.7.0 + github.com/golang/protobuf v1.5.4 github.com/grpc-ecosystem/grpc-gateway v1.16.0 - github.com/spf13/cobra v1.7.0 - github.com/stretchr/testify v1.8.4 - google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a - google.golang.org/grpc v1.55.0 - google.golang.org/protobuf v1.30.0 - gotest.tools/v3 v3.4.0 + github.com/spf13/cobra v1.9.1 + github.com/stretchr/testify v1.10.0 + go.uber.org/mock v0.5.0 + google.golang.org/genproto/googleapis/api v0.0.0-20250224174004-546df14abb99 + google.golang.org/grpc v1.71.0 + google.golang.org/protobuf v1.36.5 + gotest.tools/v3 v3.5.2 ) require ( - cosmossdk.io/collections v0.2.0 // indirect - cosmossdk.io/x/tx v0.8.0 // indirect + cosmossdk.io/collections v0.4.0 // indirect + cosmossdk.io/x/tx v0.13.7 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect - github.com/99designs/keyring v1.2.1 // indirect + github.com/99designs/keyring v1.2.2 // indirect + github.com/DataDog/datadog-go v3.2.0+incompatible // indirect github.com/DataDog/zstd v1.5.5 // indirect - github.com/armon/go-metrics v0.4.1 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect - github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect + github.com/bytedance/sonic v1.12.3 // indirect + github.com/bytedance/sonic/loader v0.2.0 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // indirect - github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chzyer/readline v1.5.1 // indirect - github.com/cockroachdb/errors v1.9.1 // indirect + github.com/cloudwego/base64x v0.1.4 // indirect + github.com/cloudwego/iasm v0.2.0 // indirect + github.com/cockroachdb/apd/v3 v3.2.1 // indirect + github.com/cockroachdb/errors v1.11.3 // indirect + github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20230606152911-c4be581b807f // indirect - github.com/cockroachdb/redact v1.1.4 // indirect - github.com/cometbft/cometbft-db v0.7.0 // indirect + github.com/cockroachdb/pebble v1.1.2 // indirect + github.com/cockroachdb/redact v1.1.5 // indirect + github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect + github.com/cometbft/cometbft-db v0.14.1 // indirect github.com/cosmos/btcutil v1.0.5 // indirect - github.com/cosmos/cosmos-db v1.0.0 // indirect + github.com/cosmos/cosmos-db v1.1.1 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.0.0-beta.2 // indirect - github.com/cosmos/ics23/go v0.10.0 // indirect - github.com/cosmos/ledger-cosmos-go v0.13.0 // indirect + github.com/cosmos/iavl v1.2.2 // indirect + github.com/cosmos/ics23/go v0.11.0 // indirect + github.com/cosmos/ledger-cosmos-go v0.14.0 // indirect github.com/danieljoos/wincred v1.1.2 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect - github.com/dgraph-io/badger/v2 v2.2007.4 // indirect + github.com/dgraph-io/badger/v4 v4.2.0 // indirect 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/dvsekhvalnov/jose2go v1.5.0 // indirect - github.com/emicklei/dot v1.4.2 // indirect + github.com/dvsekhvalnov/jose2go v1.6.0 // indirect + github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.15.0 // indirect - github.com/felixge/httpsnoop v1.0.2 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/getsentry/sentry-go v0.21.0 // indirect - github.com/go-kit/kit v0.12.0 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect + github.com/getsentry/sentry-go v0.27.0 // indirect + github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/googleapis v1.4.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/glog v1.1.0 // indirect + github.com/golang/glog v1.2.4 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/golang/mock v1.6.0 // indirect github.com/golang/snappy v0.0.4 // indirect - github.com/google/btree v1.1.2 // indirect - github.com/google/go-cmp v0.5.9 // indirect + github.com/google/btree v1.1.3 // indirect + github.com/google/flatbuffers v1.12.1 // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/google/orderedcode v0.0.1 // indirect github.com/gorilla/handlers v1.5.1 // indirect github.com/gorilla/mux v1.8.0 // indirect - github.com/gorilla/websocket v1.5.0 // 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/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/go-plugin v1.4.10 // indirect - github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect - github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/go-metrics v0.5.3 // indirect + github.com/hashicorp/go-plugin v1.5.2 // indirect + github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/yamux v0.1.1 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect github.com/huandu/skiplist v1.2.0 // indirect - github.com/iancoleman/strcase v0.2.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/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.16.5 // indirect + github.com/klauspost/compress v1.17.9 // indirect + github.com/klauspost/cpuid/v2 v2.0.9 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect - github.com/lib/pq v1.10.7 // indirect - github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.0 // indirect - github.com/magiconair/properties v1.8.7 // indirect + github.com/lib/pq v1.10.9 // indirect + github.com/linxGnu/grocksdb v1.8.14 // 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.19 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/minio/highwayhash v1.0.2 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/minio/highwayhash v1.0.3 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect - github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect - github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.0.8 // indirect - github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761 // indirect + github.com/pelletier/go-toml/v2 v2.2.3 // indirect + github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.15.1 // indirect - github.com/prometheus/client_model v0.4.0 // indirect - github.com/prometheus/common v0.44.0 // indirect - github.com/prometheus/procfs v0.10.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/prometheus/client_golang v1.20.5 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.62.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.10.0 // indirect - github.com/rs/cors v1.8.3 // indirect - github.com/rs/zerolog v1.29.1 // indirect - github.com/sasha-s/go-deadlock v0.3.1 // indirect - github.com/spf13/afero v1.9.5 // indirect - github.com/spf13/cast v1.5.1 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/spf13/pflag v1.0.5 // indirect - github.com/spf13/viper v1.16.0 // indirect - github.com/subosito/gotenv v1.4.2 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect + github.com/rs/cors v1.11.1 // indirect + github.com/rs/zerolog v1.33.0 // indirect + github.com/sagikazarmark/locafero v0.7.0 // indirect + github.com/sasha-s/go-deadlock v0.3.5 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.12.0 // indirect + github.com/spf13/cast v1.7.1 // indirect + github.com/spf13/pflag v1.0.6 // indirect + github.com/spf13/viper v1.20.0 // indirect + github.com/subosito/gotenv v1.6.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect - github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect github.com/tendermint/go-amino v0.16.0 // indirect - github.com/tidwall/btree v1.6.0 // indirect - github.com/zondax/hid v0.9.1 // indirect - github.com/zondax/ledger-go v0.14.1 // indirect - go.etcd.io/bbolt v1.3.6 // indirect - golang.org/x/crypto v0.9.0 // indirect - golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/sync v0.2.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/term v0.8.0 // indirect - golang.org/x/text v0.9.0 // indirect - google.golang.org/genproto v0.0.0-20230525234025-438c736192d0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect - gopkg.in/ini.v1 v1.67.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect + github.com/tidwall/btree v1.7.0 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + github.com/zondax/hid v0.9.2 // indirect + github.com/zondax/ledger-go v0.14.3 // indirect + go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 // indirect + go.opencensus.io v0.24.0 // indirect + go.uber.org/multierr v1.10.0 // indirect + golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect + golang.org/x/crypto v0.35.0 // indirect + golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect + golang.org/x/net v0.35.0 // indirect + golang.org/x/sync v0.11.0 // indirect + golang.org/x/sys v0.30.0 // indirect + golang.org/x/term v0.29.0 // indirect + golang.org/x/text v0.22.0 // indirect + google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.6 // indirect - pgregory.net/rapid v0.6.2 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect + pgregory.net/rapid v1.1.0 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect ) - -replace github.com/cosmos/cosmos-sdk => ../../ diff --git a/x/feegrant/go.sum b/x/feegrant/go.sum index eaeb270e5952..80873c93a67a 100644 --- a/x/feegrant/go.sum +++ b/x/feegrant/go.sum @@ -1,89 +1,50 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= -cosmossdk.io/api v0.4.2 h1:lQBMl4xINnMnBOR/tQLtjlDnR4exr4e6/SfHR8PILE0= -cosmossdk.io/api v0.4.2/go.mod h1:qrVgOp7DIeAXa+Tt5dDjOC47bZCDrwx8ZHxrmy7STNE= -cosmossdk.io/collections v0.2.0 h1:CgMfLtE16+qox3zBYrGh60i4yKV8SeExLnIdOS2sbQs= -cosmossdk.io/collections v0.2.0/go.mod h1:Oc1FK0vlmxJZsgUn9/o3ldE6zNyWKvobVzaLhWknZJE= -cosmossdk.io/core v0.8.0 h1:LcJnu52E1a8f8E317VfQ1xK/RZe+IuhMNQAjnDLh25M= -cosmossdk.io/core v0.8.0/go.mod h1:LF6VLOv2DdCiaHxYVmr0MZcZpaSM9ZgvyrQSYTeg6D0= -cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw= -cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= -cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 h1:BCRz06fvddw7cKGiEGDiSox3qMsjQ97f92K+PDZDHdc= -cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741/go.mod h1:TB05o6YXkZkzsc+6bZFAV5kZRBtoCU9tUkbeMIqEg0w= -cosmossdk.io/log v1.1.0 h1:v0ogPHYeTzPcBTcPR1A3j1hkei4pZama8kz8LKlCMv0= -cosmossdk.io/log v1.1.0/go.mod h1:6zjroETlcDs+mm62gd8Ig7mZ+N+fVOZS91V17H+M4N4= -cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= -cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= -cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c h1:A+FMPW9GtfcPBDQNtFeDFN27h1SAP6OVjnGgPLlYXmI= -cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c/go.mod h1:RbYGvXCbz8uNBCXrwS9Z8SyydeWi+W5x5MZ33muyzMw= -cosmossdk.io/x/tx v0.8.0 h1:gLiGRL/Fy7fs6dd0IX8jOf0PrVr56/SG6XVMGQjyvJU= -cosmossdk.io/x/tx v0.8.0/go.mod h1:T9uEumGNgKU61gJYRv1t3uzQwLnASpJGmSE229HM3xA= +cosmossdk.io/api v0.7.6 h1:PC20PcXy1xYKH2KU4RMurVoFjjKkCgYRbVAD4PdqUuY= +cosmossdk.io/api v0.7.6/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= +cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= +cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= +cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= +cosmossdk.io/depinject v1.1.0 h1:wLan7LG35VM7Yo6ov0jId3RHWCGRhe8E8bsuARorl5E= +cosmossdk.io/depinject v1.1.0/go.mod h1:kkI5H9jCGHeKeYWXTqYdruogYrEeWvBQCw1Pj4/eCFI= +cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= +cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= +cosmossdk.io/log v1.5.0 h1:dVdzPJW9kMrnAYyMf1duqacoidB9uZIl+7c6z0mnq0g= +cosmossdk.io/log v1.5.0/go.mod h1:Tr46PUJjiUthlwQ+hxYtUtPn4D/oCZXAkYevBeh5+FI= +cosmossdk.io/math v1.5.0 h1:sbOASxee9Zxdjd6OkzogvBZ25/hP929vdcYcBJQbkLc= +cosmossdk.io/math v1.5.0/go.mod h1:AAwwBmUhqtk2nlku174JwSll+/DepUXW3rWIXN5q+Nw= +cosmossdk.io/store v1.1.1 h1:NA3PioJtWDVU7cHHeyvdva5J/ggyLDkyH0hGHl2804Y= +cosmossdk.io/store v1.1.1/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM= +cosmossdk.io/x/tx v0.13.7 h1:8WSk6B/OHJLYjiZeMKhq7DK7lHDMyK0UfDbBMxVmeOI= +cosmossdk.io/x/tx v0.13.7/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= 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/99designs/keyring v1.2.1 h1:tYLp1ULvO7i3fI5vE21ReQuj99QFSs7lGm0xWyJo87o= -github.com/99designs/keyring v1.2.1/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= -github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= +github.com/99designs/keyring v1.2.2 h1:pZd3neh/EmUzWONb35LxQfvuY7kiSXAq3HQd97+XBn0= +github.com/99designs/keyring v1.2.2/go.mod h1:wes/FrByc8j7lFOAGLGSNEg8f/PaI3cgTBqhFkHUrPk= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= -github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= +github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= -github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= -github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= +github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= 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/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= +github.com/adlio/schema v1.3.6 h1:k1/zc2jNfeiZBA5aFTRy37jlBIuCkXCm0XmvpzCKI9I= +github.com/adlio/schema v1.3.6/go.mod h1:qkxwLgPBd1FgLRHYVCmQT/rrBr3JH38J9LjmVzWNudg= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= -github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= -github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -93,16 +54,12 @@ github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kd github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= -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/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -111,12 +68,19 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bits-and-blooms/bitset v1.7.0 h1:YjAGVd3XmtK9ktAbX8Zg2g2PwLIMjGREZJHlV4j7NEo= -github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= -github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= -github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= -github.com/bufbuild/protocompile v0.5.1 h1:mixz5lJX4Hiz4FpqFREJHIXLfaLBntfaJv1h+/jS+Qg= +github.com/bits-and-blooms/bitset v1.8.0 h1:FD+XqgOZDUxxZ8hzoBFuV9+cGWY9CslN6d5MS5JVb4c= +github.com/bits-and-blooms/bitset v1.8.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= +github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= +github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/btcutil v1.1.6 h1:zFL2+c3Lb9gEgqKNzowKUPQNb8jV7v5Oaodi/AYFd6c= +github.com/btcsuite/btcd/btcutil v1.1.6/go.mod h1:9dFymx8HpuLqBnsPELrImQeTQfKBQqzqGbbV3jK55aE= +github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY= +github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE= +github.com/bytedance/sonic v1.12.3 h1:W2MGa7RCU1QTeYRTPE3+88mVC0yXmsRQRChiyVocVjU= +github.com/bytedance/sonic v1.12.3/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= +github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= +github.com/bytedance/sonic/loader v0.2.0 h1:zNprn+lsIP06C/IqCHs3gPQIvnvpKbbxyXQP1iU4kWM= +github.com/bytedance/sonic/loader v0.2.0/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= @@ -124,11 +88,9 @@ github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInq github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -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/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM= github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ= @@ -142,8 +104,11 @@ github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6D github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/0Y= +github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= +github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg= +github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= @@ -151,73 +116,74 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= -github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= +github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= +github.com/cockroachdb/apd/v3 v3.2.1 h1:U+8j7t0axsIgvQUqthuNm82HIrYXodOV2iWLWtEaIwg= +github.com/cockroachdb/apd/v3 v3.2.1/go.mod h1:klXJcjp+FffLTHlhIG69tezTDvdP065naDsHzKhYSqc= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= -github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= -github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= +github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce h1:giXvy4KSc/6g/esnpM7Geqxka4WSqI1SZc7sMJFd3y4= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/pebble v0.0.0-20230606152911-c4be581b807f h1:qQW3qCVRpjYsV4YNaUOjm6YLeliAD2jpgex9+D9tqU4= -github.com/cockroachdb/pebble v0.0.0-20230606152911-c4be581b807f/go.mod h1:TkdVsGYRqtULUppt2RbC+YaKtTHnHoWa2apfFrSKABw= -github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/cockroachdb/redact v1.1.4 h1:Y0XrVI2FAyofNyGveodTN//qdpPtFKcKTeCBsK3AHAQ= -github.com/cockroachdb/redact v1.1.4/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/pebble v1.1.2 h1:CUh2IPtR4swHlEj48Rhfzw6l/d0qA31fItcIszQVIsA= +github.com/cockroachdb/pebble v1.1.2/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= -github.com/cometbft/cometbft v0.38.0-rc1 h1:ph6smlqX82aH+d72KuxDHqu29M7LyusSp/obfGsGX/w= -github.com/cometbft/cometbft v0.38.0-rc1/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= -github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= -github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= +github.com/cometbft/cometbft v0.38.17 h1:FkrQNbAjiFqXydeAO81FUzriL4Bz0abYxN/eOHrQGOk= +github.com/cometbft/cometbft v0.38.17/go.mod h1:5l0SkgeLRXi6bBfQuevXjKqML1jjfJJlvI1Ulp02/o4= +github.com/cometbft/cometbft-db v0.14.1 h1:SxoamPghqICBAIcGpleHbmoPqy+crij/++eZz3DlerQ= +github.com/cometbft/cometbft-db v0.14.1/go.mod h1:KHP1YghilyGV/xjD5DP3+2hyigWx0WTp9X+0Gnx0RxQ= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= +github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= -github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0E= -github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= -github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= -github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= +github.com/cosmos/cosmos-db v1.1.1 h1:FezFSU37AlBC8S98NlSagL76oqBRWq/prTPvFcEJNCM= +github.com/cosmos/cosmos-db v1.1.1/go.mod h1:AghjcIPqdhSLP/2Z0yha5xPH3nLnskz81pBx3tcVSAw= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= +github.com/cosmos/cosmos-sdk v0.50.13 h1:xQ32hhzVy7agEe7behMdZN0ezWhPss3KoLZsF9KoBnw= +github.com/cosmos/cosmos-sdk v0.50.13/go.mod h1:hrWEFMU1eoXqLJeE6VVESpJDQH67FS1nnMrQIjO2daw= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoKuI= -github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= -github.com/cosmos/iavl v1.0.0-beta.2 h1:XOsIM80Yyml/KifCXEYOy9tWCXwMAbLa91n6pReW07Y= -github.com/cosmos/iavl v1.0.0-beta.2/go.mod h1:EA97dJ07TBktRlG/iGzK6g1eCXNj1q3MGoFYkVzrwHE= -github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= -github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= -github.com/cosmos/ledger-cosmos-go v0.13.0 h1:ex0CvCxToSR7j5WjrghPu2Bu9sSXKikjnVvUryNnx4s= -github.com/cosmos/ledger-cosmos-go v0.13.0/go.mod h1:ZcqYgnfNJ6lAXe4HPtWgarNEY+B74i+2/8MhZw4ziiI= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= +github.com/cosmos/iavl v1.2.2 h1:qHhKW3I70w+04g5KdsdVSHRbFLgt3yY3qTMd4Xa4rC8= +github.com/cosmos/iavl v1.2.2/go.mod h1:GiM43q0pB+uG53mLxLDzimxM9l/5N9UuSY3/D0huuVw= +github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= +github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= +github.com/cosmos/ledger-cosmos-go v0.14.0 h1:WfCHricT3rPbkPSVKRH+L4fQGKYHuGOK9Edpel8TYpE= +github.com/cosmos/ledger-cosmos-go v0.14.0/go.mod h1:E07xCWSBl3mTGofZ2QnL4cIUzMbbGVyik84QYKbX3RA= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= -github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= -github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= -github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= -github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= -github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= +github.com/dgraph-io/badger/v4 v4.2.0 h1:kJrlajbXXL9DFTNuhhu9yCx7JJa4qpYWxtE8BzuWsEs= +github.com/dgraph-io/badger/v4 v4.2.0/go.mod h1:qfCqhPoWDFJRx1gp5QwwyGo8xk1lbHUxvK9nK0OGAak= github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= @@ -225,74 +191,63 @@ github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUn github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= 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/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= 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/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= -github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= +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/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= -github.com/emicklei/dot v1.4.2 h1:UbK6gX4yvrpHKlxuUQicwoAis4zl8Dzwit9SnbBAXWw= -github.com/emicklei/dot v1.4.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= +github.com/emicklei/dot v1.6.2 h1:08GN+DD79cy/tzN6uLCT84+2Wk9u+wvqP+Hkx/dIR8A= +github.com/emicklei/dot v1.6.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= -github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= -github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= -github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= -github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= -github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= -github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= -github.com/getsentry/sentry-go v0.21.0 h1:c9l5F1nPF30JIppulk4veau90PK6Smu3abgVtVQWon4= -github.com/getsentry/sentry-go v0.21.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= +github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= +github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= -github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= -github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= -github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= +github.com/go-kit/kit v0.13.0 h1:OoneCcHKHQ03LfBpoQCUfCluwd2Vt3ohz+kvbJneZAU= +github.com/go-kit/kit v0.13.0/go.mod h1:phqEHMMUbyrCFCTgH48JueqrM3md2HcAZ8N3XE4FKDg= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= @@ -301,17 +256,25 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= +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-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= +github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= +github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= +github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= @@ -319,11 +282,10 @@ github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6Wezm github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= +github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= -github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= 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= @@ -334,22 +296,15 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV 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/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= -github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= -github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= +github.com/golang/glog v1.2.4 h1:CNNw5U8lSiiBk7druxtSHHTsRWcxKoac6kZKm2peBBc= +github.com/golang/glog v1.2.4/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -357,7 +312,6 @@ github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= @@ -369,56 +323,40 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -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/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= +github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= +github.com/google/flatbuffers v1.12.1 h1:MVlul7pQNoDzWRLTw5imwYsl+usrS1TXG2H4jg6ImGw= +github.com/google/flatbuffers v1.12.1/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 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= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= @@ -429,8 +367,8 @@ github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= @@ -451,10 +389,12 @@ github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVH github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-metrics v0.5.3 h1:M5uADWMOGCTUNU1YuC4hfknOeHNaX54LDm4oYSucoNE= +github.com/hashicorp/go-metrics v0.5.3/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-plugin v1.4.10 h1:xUbmA4jC6Dq163/fWcp8P3JuHilrHHMLNRxzGQJ9hNk= -github.com/hashicorp/go-plugin v1.4.10/go.mod h1:6/1TEzT0eQznvI/gV2CM29DLSkAK/e58mUWKVsPaph0= +github.com/hashicorp/go-plugin v1.5.2 h1:aWv8eimFqWlsEiMrYZdPYl+FdHaBJSN4AWwGWfT1G2Y= +github.com/hashicorp/go-plugin v1.5.2/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= @@ -466,10 +406,10 @@ github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= @@ -484,24 +424,17 @@ github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0Jr github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw= github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= -github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= -github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= -github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= -github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= -github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= -github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= -github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= -github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= +github.com/jhump/protoreflect v1.15.3 h1:6SFRuqU45u9hIZPJAoZ8c28T3nK64BNdp9w6jFonzls= +github.com/jhump/protoreflect v1.15.3/go.mod h1:4ORHmSBmlCW8fh3xHmJMGyul1zNqZK4Elxc8qKP+p1k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= @@ -513,90 +446,67 @@ github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= 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/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= -github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= -github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= -github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= -github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= 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/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI= -github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= 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.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= -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= -github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.0 h1:H4L/LhP7GOMf1j17oQAElHgVlbEje2h14A8Tz9cM2BE= -github.com/linxGnu/grocksdb v1.8.0/go.mod h1:09CeBborffXhXdNpEcOeZrLKEnRtrZFEpFdPNI9Zjjg= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.8/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= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= 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-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= -github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= -github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= +github.com/minio/highwayhash v1.0.3 h1:kbnuUMoHYyVl7szWjSxJnxw11k2U709jqFPPmIUyD6Q= +github.com/minio/highwayhash v1.0.3/go.mod h1:GGYsuwP/fPD6Y9hMiXuapVvlIUEhFhMTh0rxU3ik1LQ= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= @@ -604,17 +514,17 @@ github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS4 github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/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= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= 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/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -630,8 +540,8 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce h1:/pEpMk55wH0X+E5zedGEMOdLuWmV8P4+4W3+LZaM6kg= -github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a h1:dlRvE5fWabOchtH7znfiFCcOvmIYgOeAS5ifBXBlh9Q= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= @@ -639,7 +549,6 @@ github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DV github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= @@ -651,10 +560,14 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/onsi/gomega v1.26.0 h1:03cDLK28U6hWvCAns6NeydX3zIm4SF3ci69ulidS32Q= +github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= 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-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= -github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= +github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= +github.com/opencontainers/runc v1.1.12 h1:BOIssBaW1La0/qbNZHXOOa71dZfZEQOzW7dqQf3phss= +github.com/opencontainers/runc v1.1.12/go.mod h1:S+lQwSfncpBha7XTy/5lBwWgm5+y5Ma/O44Ekby9FK8= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -664,18 +577,17 @@ github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJ github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= +github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= -github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= +github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= +github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= -github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761 h1:W04oB3d0J01W5jgYRGKsV8LCM6g9EkCvPkZcmFuy0OE= -github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 h1:Dx7Ovyv/SFnMFw3fD4oEoeorXc6saIiQ23LrGLth0Gw= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= @@ -686,9 +598,9 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= @@ -696,102 +608,91 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.15.1 h1:8tXpTmJbyH5lydzFPoxSIJ0J46jdh3tylbvM1xCv0LI= -github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= +github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= +github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= -github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= -github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= +github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io= +github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= -github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= 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/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= -github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= -github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.29.1 h1:cO+d60CHkknCbvzEWxP0S9K6KqyTjrCNUy1LdQLCGPc= -github.com/rs/zerolog v1.29.1/go.mod h1:Le6ESbR7hc+DP6Lt1THiV8CQSdkkNrd3R0XbEgp3ZBU= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= +github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/locafero v0.7.0 h1:5MqpDsTGNDhY8sGp0Aowyf0qKsPrhewaLSsFaodPcyo= +github.com/sagikazarmark/locafero v0.7.0/go.mod h1:2za3Cg5rMaTMoG/2Ulr9AwtFaIppKXTRYnozin4aB5k= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -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/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= +github.com/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb2NsU= +github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= -github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= -github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= -github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= +github.com/spf13/afero v1.12.0 h1:UcOPyRBYczmFn6yvphxkn9ZEOY65cpwGKb5mL36mrqs= +github.com/spf13/afero v1.12.0/go.mod h1:ZTlWwG4/ahT8W7T0WQ5uYmjI9duaLQGy3Q2OAl4sk/4= +github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= +github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo= +github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= -github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= +github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= +github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.20.0 h1:zrxIyR3RQIOsarIrgL8+sAvALXul9jeEPa06Y0Ph6vY= +github.com/spf13/viper v1.20.0/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -801,134 +702,107 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= -github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +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.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= -github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= +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/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= +github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= -github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= -github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= -github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= -github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= -github.com/zondax/ledger-go v0.14.1 h1:Pip65OOl4iJ84WTpA4BKChvOufMhhbxED3BaihoZN4c= -github.com/zondax/ledger-go v0.14.1/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2feOQv8K320= +github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= +github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= +github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= +github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= -go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 h1:qxen9oVGzDdIRP6ejyAJc760RwW4SnVDiTYTzwnXuxo= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5/go.mod h1:eW0HG9/oHQhvRCvb1/pIXW4cOvtDqeQK+XSi3TnwaXY= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= +go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= +go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY= +go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI= +go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ= +go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE= +go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A= +go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU= +go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk= +go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w= +go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k= +go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU= +go.uber.org/mock v0.5.0/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= +go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670 h1:18EFjUmQOcUvxNYSkA6jO9VAiXCnxFY6NyDX0bHDmkU= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= -golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= +golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs= +golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= +golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= +golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= 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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -940,69 +814,38 @@ golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= +golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= 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= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= -golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= +golang.org/x/sync v0.11.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-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1011,20 +854,12 @@ golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 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-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= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1033,255 +868,123 @@ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/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-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220315194320-039c03cc5b86/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= +golang.org/x/sys v0.30.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.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU= +golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s= 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= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= +golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -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= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/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-20181221001348-537d06c36207/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-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= +golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg= +golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= 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= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -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-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= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20230525234025-438c736192d0 h1:x1vNwUhVOcsYoKyEGCZBH694SBmmBjA2EfauFVEI2+M= -google.golang.org/genproto v0.0.0-20230525234025-438c736192d0/go.mod h1:9ExIQyXL5hZrHzQceCwuSYwZZ5QZBazOcprJ5rgs3lY= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a h1:HiYVD+FGJkTo+9zj1gqz0anapsa1JxjiSrN+BJKyUmE= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a/go.mod h1:ts19tUU+Z0ZShN1y3aPyq2+O3d5FUNNgT6FtOzmrNn8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 h1:ToEetK57OidYuqD4Q5w+vfEnPvPpuTwedCNVohYJfNk= +google.golang.org/genproto v0.0.0-20241118233622-e639e219e697/go.mod h1:JJrvXBWRZaFMxBufik1a4RpFw4HhgVtBBWQeQgUj2cc= +google.golang.org/genproto/googleapis/api v0.0.0-20250224174004-546df14abb99 h1:ilJhrCga0AptpJZXmUYG4MCrx/zf3l1okuYz7YK9PPw= +google.golang.org/genproto/googleapis/api v0.0.0-20250224174004-546df14abb99/go.mod h1:Xsh8gBVxGCcbV8ZeTB9wI5XPyZ5RvC6V3CTeeplHbiA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2 h1:DMTIbak9GhdaSxEjvVzAeNZvyc03I61duqNbnm3SU0M= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2/go.mod h1:LuRYeWDFV6WOn90g357N17oMCaxpgCnbi/44qJvDn2I= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= +google.golang.org/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg= +google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1296,24 +999,19 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= +google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 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.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= 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/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= -gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= -gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -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/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= @@ -1328,29 +1026,22 @@ gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 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= -gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= -gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= +gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q= +gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -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= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= -pgregory.net/rapid v0.6.2 h1:ErW5sL+UKtfBfUTsWHDCoeB+eZKLKMxrSd1VJY6W4bw= -pgregory.net/rapid v0.6.2/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= +pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= +pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/x/feegrant/grant_test.go b/x/feegrant/grant_test.go index 83da814c9196..31b9fb62542f 100644 --- a/x/feegrant/grant_test.go +++ b/x/feegrant/grant_test.go @@ -10,6 +10,7 @@ import ( storetypes "cosmossdk.io/store/types" "cosmossdk.io/x/feegrant" "cosmossdk.io/x/feegrant/module" + codecaddress "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/feegrant/keeper/genesis_test.go b/x/feegrant/keeper/genesis_test.go index f3303d454f1d..48272f9f07d9 100644 --- a/x/feegrant/keeper/genesis_test.go +++ b/x/feegrant/keeper/genesis_test.go @@ -4,9 +4,10 @@ import ( "errors" "testing" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" "gotest.tools/v3/assert" + "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" "cosmossdk.io/x/feegrant" "cosmossdk.io/x/feegrant/keeper" @@ -59,7 +60,7 @@ func TestImportExportGenesis(t *testing.T) { f.accountKeeper.EXPECT().GetAccount(gomock.Any(), granteeAddr).Return(authtypes.NewBaseAccountWithAddress(granteeAddr)).AnyTimes() f.accountKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec("cosmos")).AnyTimes() - coins := sdk.NewCoins(sdk.NewCoin("foo", sdk.NewInt(1_000))) + coins := sdk.NewCoins(sdk.NewCoin("foo", math.NewInt(1_000))) now := f.ctx.BlockHeader().Time oneYear := now.AddDate(1, 0, 0) msgSrvr := keeper.NewMsgServerImpl(f.feegrantKeeper) diff --git a/x/feegrant/keeper/grpc_query.go b/x/feegrant/keeper/grpc_query.go index 9b97a17887c5..7dde41517154 100644 --- a/x/feegrant/keeper/grpc_query.go +++ b/x/feegrant/keeper/grpc_query.go @@ -19,7 +19,7 @@ import ( var _ feegrant.QueryServer = Keeper{} -// Allowance returns fee granted to the grantee by the granter. +// Allowance returns granted allowance to the grantee by the granter. func (q Keeper) Allowance(c context.Context, req *feegrant.QueryAllowanceRequest) (*feegrant.QueryAllowanceResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") diff --git a/x/feegrant/keeper/keeper.go b/x/feegrant/keeper/keeper.go index 250a9e87a4c8..02ec88b69723 100644 --- a/x/feegrant/keeper/keeper.go +++ b/x/feegrant/keeper/keeper.go @@ -9,7 +9,6 @@ import ( errorsmod "cosmossdk.io/errors" "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" - "cosmossdk.io/x/feegrant" "github.com/cosmos/cosmos-sdk/codec" @@ -25,11 +24,12 @@ type Keeper struct { cdc codec.BinaryCodec storeService store.KVStoreService authKeeper feegrant.AccountKeeper + bankKeeper feegrant.BankKeeper } var _ ante.FeegrantKeeper = &Keeper{} -// NewKeeper creates a fee grant Keeper +// NewKeeper creates a feegrant Keeper func NewKeeper(cdc codec.BinaryCodec, storeService store.KVStoreService, ak feegrant.AccountKeeper) Keeper { return Keeper{ cdc: cdc, @@ -38,6 +38,13 @@ func NewKeeper(cdc codec.BinaryCodec, storeService store.KVStoreService, ak feeg } } +// Super ugly hack to not be breaking in v0.50 and v0.47 +// DO NOT USE. +func (k Keeper) SetBankKeeper(bk feegrant.BankKeeper) Keeper { + k.bankKeeper = bk + return k +} + // Logger returns a module-specific logger. func (k Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", fmt.Sprintf("x/%s", feegrant.ModuleName)) @@ -53,6 +60,10 @@ func (k Keeper) GrantAllowance(ctx context.Context, granter, grantee sdk.AccAddr // create the account if it is not in account state granteeAcc := k.authKeeper.GetAccount(ctx, grantee) if granteeAcc == nil { + if k.bankKeeper.BlockedAddr(grantee) { + return errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "%s is not allowed to receive funds", grantee) + } + granteeAcc = k.authKeeper.NewAccountWithAddress(ctx, grantee) k.authKeeper.SetAccount(ctx, granteeAcc) } @@ -145,7 +156,7 @@ func (k Keeper) UpdateAllowance(ctx context.Context, granter, grantee sdk.AccAdd // revokeAllowance removes an existing grant func (k Keeper) revokeAllowance(ctx context.Context, granter, grantee sdk.AccAddress) error { - _, err := k.getGrant(ctx, granter, grantee) + grant, err := k.GetAllowance(ctx, granter, grantee) if err != nil { return err } @@ -157,6 +168,17 @@ func (k Keeper) revokeAllowance(ctx context.Context, granter, grantee sdk.AccAdd return err } + exp, err := grant.ExpiresAt() + if err != nil { + return err + } + + if exp != nil { + if err := store.Delete(feegrant.FeeAllowancePrefixQueue(exp, feegrant.FeeAllowanceKey(grantee, granter)[1:])); err != nil { + return err + } + } + sdk.UnwrapSDKContext(ctx).EventManager().EmitEvent( sdk.NewEvent( feegrant.EventTypeRevokeFeeGrant, @@ -223,12 +245,7 @@ func (k Keeper) IterateAllFeeAllowances(ctx context.Context, cb func(grant feegr // UseGrantedFees will try to pay the given fee from the granter's account as requested by the grantee func (k Keeper) UseGrantedFees(ctx context.Context, granter, grantee sdk.AccAddress, fee sdk.Coins, msgs []sdk.Msg) error { - f, err := k.getGrant(ctx, granter, grantee) - if err != nil { - return err - } - - grant, err := f.GetGrant() + grant, err := k.GetAllowance(ctx, granter, grantee) if err != nil { return err } @@ -312,10 +329,11 @@ func (k Keeper) addToFeeAllowanceQueue(ctx context.Context, grantKey []byte, exp } // RemoveExpiredAllowances iterates grantsByExpiryQueue and deletes the expired grants. -func (k Keeper) RemoveExpiredAllowances(ctx context.Context) error { +func (k Keeper) RemoveExpiredAllowances(ctx context.Context, limit int32) error { exp := sdk.UnwrapSDKContext(ctx).BlockTime() store := k.storeService.OpenKVStore(ctx) iterator, err := store.Iterator(feegrant.FeeAllowanceQueueKeyPrefix, storetypes.InclusiveEndBytes(feegrant.AllowanceByExpTimeKey(&exp))) + var count int32 if err != nil { return err } @@ -332,6 +350,12 @@ func (k Keeper) RemoveExpiredAllowances(ctx context.Context) error { if err != nil { return err } + + // limit the amount of iterations to avoid taking too much time + count++ + if count == limit { + return nil + } } return nil } diff --git a/x/feegrant/keeper/keeper_test.go b/x/feegrant/keeper/keeper_test.go index de527485fefd..f9c93abf728d 100644 --- a/x/feegrant/keeper/keeper_test.go +++ b/x/feegrant/keeper/keeper_test.go @@ -3,8 +3,8 @@ package keeper_test import ( "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" + "go.uber.org/mock/gomock" sdkmath "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" @@ -31,6 +31,7 @@ type KeeperTestSuite struct { atom sdk.Coins feegrantKeeper keeper.Keeper accountKeeper *feegranttestutil.MockAccountKeeper + bankKeeper *feegranttestutil.MockBankKeeper } func TestKeeperTestSuite(t *testing.T) { @@ -38,7 +39,7 @@ func TestKeeperTestSuite(t *testing.T) { } func (suite *KeeperTestSuite) SetupTest() { - suite.addrs = simtestutil.CreateIncrementalAccounts(4) + suite.addrs = simtestutil.CreateIncrementalAccounts(20) key := storetypes.NewKVStoreKey(feegrant.StoreKey) testCtx := testutil.DefaultContextWithDB(suite.T(), key, storetypes.NewTransientStoreKey("transient_test")) encCfg := moduletestutil.MakeTestEncodingConfig(module.AppModuleBasic{}) @@ -46,14 +47,14 @@ func (suite *KeeperTestSuite) SetupTest() { // setup gomock and initialize some globally expected executions ctrl := gomock.NewController(suite.T()) suite.accountKeeper = feegranttestutil.NewMockAccountKeeper(ctrl) - suite.accountKeeper.EXPECT().GetAccount(gomock.Any(), suite.addrs[0]).Return(authtypes.NewBaseAccountWithAddress(suite.addrs[0])).AnyTimes() - suite.accountKeeper.EXPECT().GetAccount(gomock.Any(), suite.addrs[1]).Return(authtypes.NewBaseAccountWithAddress(suite.addrs[1])).AnyTimes() - suite.accountKeeper.EXPECT().GetAccount(gomock.Any(), suite.addrs[2]).Return(authtypes.NewBaseAccountWithAddress(suite.addrs[2])).AnyTimes() - suite.accountKeeper.EXPECT().GetAccount(gomock.Any(), suite.addrs[3]).Return(authtypes.NewBaseAccountWithAddress(suite.addrs[3])).AnyTimes() - + for i := 0; i < len(suite.addrs); i++ { + suite.accountKeeper.EXPECT().GetAccount(gomock.Any(), suite.addrs[i]).Return(authtypes.NewBaseAccountWithAddress(suite.addrs[i])).AnyTimes() + } suite.accountKeeper.EXPECT().AddressCodec().Return(codecaddress.NewBech32Codec("cosmos")).AnyTimes() + suite.bankKeeper = feegranttestutil.NewMockBankKeeper(ctrl) + suite.bankKeeper.EXPECT().BlockedAddr(gomock.Any()).Return(false).AnyTimes() - suite.feegrantKeeper = keeper.NewKeeper(encCfg.Codec, runtime.NewKVStoreService(key), suite.accountKeeper) + suite.feegrantKeeper = keeper.NewKeeper(encCfg.Codec, runtime.NewKVStoreService(key), suite.accountKeeper).SetBankKeeper(suite.bankKeeper) suite.ctx = testCtx.Ctx suite.msgSrvr = keeper.NewMsgServerImpl(suite.feegrantKeeper) suite.atom = sdk.NewCoins(sdk.NewCoin("atom", sdkmath.NewInt(555))) @@ -395,7 +396,9 @@ func (suite *KeeperTestSuite) TestPruneGrants() { } err := suite.feegrantKeeper.GrantAllowance(suite.ctx, tc.granter, tc.grantee, tc.allowance) suite.NoError(err) - suite.feegrantKeeper.RemoveExpiredAllowances(tc.ctx) + err = suite.feegrantKeeper.RemoveExpiredAllowances(tc.ctx, 5) + suite.NoError(err) + grant, err := suite.feegrantKeeper.GetAllowance(tc.ctx, tc.granter, tc.grantee) if tc.expErrMsg != "" { suite.Error(err) diff --git a/x/feegrant/keeper/msg_server.go b/x/feegrant/keeper/msg_server.go index fbbb70205caa..966f25054562 100644 --- a/x/feegrant/keeper/msg_server.go +++ b/x/feegrant/keeper/msg_server.go @@ -5,10 +5,10 @@ import ( "strings" errorsmod "cosmossdk.io/errors" + "cosmossdk.io/x/feegrant" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - - "cosmossdk.io/x/feegrant" ) type msgServer struct { @@ -89,3 +89,22 @@ func (k msgServer) RevokeAllowance(goCtx context.Context, msg *feegrant.MsgRevok return &feegrant.MsgRevokeAllowanceResponse{}, nil } + +// PruneAllowances removes expired allowances from the store. +func (k msgServer) PruneAllowances(ctx context.Context, req *feegrant.MsgPruneAllowances) (*feegrant.MsgPruneAllowancesResponse, error) { + // 75 is an arbitrary value, we can change it later if needed + err := k.RemoveExpiredAllowances(ctx, 75) + if err != nil { + return nil, err + } + + sdkCtx := sdk.UnwrapSDKContext(ctx) + sdkCtx.EventManager().EmitEvent( + sdk.NewEvent( + feegrant.EventTypePruneFeeGrant, + sdk.NewAttribute(feegrant.AttributeKeyPruner, req.Pruner), + ), + ) + + return &feegrant.MsgPruneAllowancesResponse{}, nil +} diff --git a/x/feegrant/keeper/msg_server_test.go b/x/feegrant/keeper/msg_server_test.go index 8e20961f5fca..cf3e15c39a89 100644 --- a/x/feegrant/keeper/msg_server_test.go +++ b/x/feegrant/keeper/msg_server_test.go @@ -3,12 +3,13 @@ package keeper_test import ( "time" + "go.uber.org/mock/gomock" + "cosmossdk.io/x/feegrant" codecaddress "github.com/cosmos/cosmos-sdk/codec/address" codectypes "github.com/cosmos/cosmos-sdk/codec/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/golang/mock/gomock" ) func (suite *KeeperTestSuite) TestGrantAllowance() { @@ -283,3 +284,66 @@ func (suite *KeeperTestSuite) TestRevokeAllowance() { }) } } + +func (suite *KeeperTestSuite) TestPruneAllowances() { + ctx := suite.ctx.WithBlockTime(time.Now()) + oneYear := ctx.BlockTime().AddDate(1, 0, 0) + + // We create 76 allowances, all expiring in one year + count := 0 + for i := 0; i < len(suite.addrs); i++ { + for j := 0; j < len(suite.addrs); j++ { + if count == 76 { + break + } + if suite.addrs[i].String() == suite.addrs[j].String() { + continue + } + + any, err := codectypes.NewAnyWithValue(&feegrant.BasicAllowance{ + SpendLimit: suite.atom, + Expiration: &oneYear, + }) + suite.Require().NoError(err) + req := &feegrant.MsgGrantAllowance{ + Granter: suite.addrs[i].String(), + Grantee: suite.addrs[j].String(), + Allowance: any, + } + + _, err = suite.msgSrvr.GrantAllowance(ctx, req) + if err != nil { + // do not fail, just try with another pair + continue + } + + count++ + } + } + + // we have 76 allowances + count = 0 + err := suite.feegrantKeeper.IterateAllFeeAllowances(ctx, func(grant feegrant.Grant) bool { + count++ + return false + }) + suite.Require().NoError(err) + suite.Require().Equal(76, count) + + // after a year and one day passes, they are all expired + oneYearAndADay := ctx.BlockTime().AddDate(1, 0, 1) + ctx = suite.ctx.WithBlockTime(oneYearAndADay) + + // we prune them, but currently only 75 will be pruned + _, err = suite.msgSrvr.PruneAllowances(ctx, &feegrant.MsgPruneAllowances{}) + suite.Require().NoError(err) + + // we have 1 allowance left + count = 0 + err = suite.feegrantKeeper.IterateAllFeeAllowances(ctx, func(grant feegrant.Grant) bool { + count++ + return false + }) + suite.Require().NoError(err) + suite.Require().Equal(1, count) +} diff --git a/x/feegrant/key_test.go b/x/feegrant/key_test.go index 67b382d87817..45eae077d781 100644 --- a/x/feegrant/key_test.go +++ b/x/feegrant/key_test.go @@ -7,6 +7,7 @@ import ( "github.com/stretchr/testify/require" "cosmossdk.io/x/feegrant" + codecaddress "github.com/cosmos/cosmos-sdk/codec/address" sdk "github.com/cosmos/cosmos-sdk/types" ) diff --git a/x/feegrant/migrations/v2/store_test.go b/x/feegrant/migrations/v2/store_test.go index 26173dea4f10..7b2ad1517160 100644 --- a/x/feegrant/migrations/v2/store_test.go +++ b/x/feegrant/migrations/v2/store_test.go @@ -4,9 +4,9 @@ import ( "testing" "time" - sdkmath "cosmossdk.io/math" "github.com/stretchr/testify/require" + sdkmath "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" "cosmossdk.io/x/feegrant" v2 "cosmossdk.io/x/feegrant/migrations/v2" diff --git a/x/feegrant/module/abci.go b/x/feegrant/module/abci.go index 4dbab056a9a3..6f14eee3137c 100644 --- a/x/feegrant/module/abci.go +++ b/x/feegrant/module/abci.go @@ -1,14 +1,12 @@ package module import ( - "cosmossdk.io/x/feegrant/keeper" + "context" - sdk "github.com/cosmos/cosmos-sdk/types" + "cosmossdk.io/x/feegrant/keeper" ) -func EndBlocker(ctx sdk.Context, k keeper.Keeper) { - err := k.RemoveExpiredAllowances(ctx) - if err != nil { - panic(err) - } +func EndBlocker(ctx context.Context, k keeper.Keeper) error { + // 200 is an arbitrary value, we can change it later if needed + return k.RemoveExpiredAllowances(ctx, 200) } diff --git a/x/feegrant/module/abci_test.go b/x/feegrant/module/abci_test.go index 328cfb3afe83..e731fcc7a49d 100644 --- a/x/feegrant/module/abci_test.go +++ b/x/feegrant/module/abci_test.go @@ -3,14 +3,15 @@ package module_test import ( "testing" + "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" + sdkmath "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" "cosmossdk.io/x/feegrant" "cosmossdk.io/x/feegrant/keeper" "cosmossdk.io/x/feegrant/module" feegranttestutil "cosmossdk.io/x/feegrant/testutil" - "github.com/golang/mock/gomock" - "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec/address" @@ -76,7 +77,7 @@ func TestFeegrantPruning(t *testing.T) { feegrant.RegisterQueryServer(queryHelper, feegrantKeeper) queryClient := feegrant.NewQueryClient(queryHelper) - module.EndBlocker(testCtx.Ctx, feegrantKeeper) + require.NoError(t, module.EndBlocker(testCtx.Ctx, feegrantKeeper)) res, err := queryClient.Allowances(testCtx.Ctx.Context(), &feegrant.QueryAllowancesRequest{ Grantee: grantee.String(), diff --git a/x/feegrant/module/autocli.go b/x/feegrant/module/autocli.go new file mode 100644 index 000000000000..f3bbd0597728 --- /dev/null +++ b/x/feegrant/module/autocli.go @@ -0,0 +1,74 @@ +package module + +import ( + "fmt" + + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + feegrantv1beta1 "cosmossdk.io/api/cosmos/feegrant/v1beta1" + + "github.com/cosmos/cosmos-sdk/version" +) + +func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { + return &autocliv1.ModuleOptions{ + Query: &autocliv1.ServiceCommandDescriptor{ + Service: feegrantv1beta1.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Allowance", + Use: "grant [granter] [grantee]", + Short: "Query details of a single grant", + Long: "Query details for a grant. You can find the fee-grant of a granter and grantee.", + Example: fmt.Sprintf(`$ %s query feegrant grant [granter] [grantee]`, version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "granter"}, + {ProtoField: "grantee"}, + }, + }, + { + RpcMethod: "Allowances", + Use: "grants-by-grantee [grantee]", + Short: "Query all grants of a grantee", + Long: "Queries all the grants for a grantee address.", + Example: fmt.Sprintf(`$ %s query feegrant grants-by-grantee [grantee]`, version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "grantee"}, + }, + }, + { + RpcMethod: "AllowancesByGranter", + Use: "grants-by-granter [granter]", + Short: "Query all grants by a granter", + Example: fmt.Sprintf(`$ %s query feegrant grants-by-granter [granter]`, version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "granter"}, + }, + }, + }, + }, + Tx: &autocliv1.ServiceCommandDescriptor{ + Service: feegrantv1beta1.Msg_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "RevokeAllowance", + Use: "revoke [granter] [grantee]", + Short: "Revoke a fee grant", + Long: "Revoke fee grant from a granter to a grantee. Note, the '--from' flag is ignored as it is implied from [granter]", + Example: fmt.Sprintf(`$ %s tx feegrant revoke [granter] [grantee]`, version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "granter"}, + {ProtoField: "grantee"}, + }, + }, + { + RpcMethod: "PruneAllowances", + Use: "prune", + Short: "Prune expired allowances", + Long: "Prune up to 75 expired allowances in order to reduce the size of the store when the number of expired allowances is large.", + Example: fmt.Sprintf(`$ %s tx feegrant prune --from [mykey]`, version.AppName), + }, + }, + EnhanceCustomCommand: true, + }, + } +} diff --git a/x/feegrant/module/module.go b/x/feegrant/module/module.go index 50a14d2f7692..5baebe39021a 100644 --- a/x/feegrant/module/module.go +++ b/x/feegrant/module/module.go @@ -5,19 +5,15 @@ import ( "encoding/json" "fmt" - abci "github.com/cometbft/cometbft/abci/types" gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" + modulev1 "cosmossdk.io/api/cosmos/feegrant/module/v1" "cosmossdk.io/core/address" "cosmossdk.io/core/appmodule" - "cosmossdk.io/errors" - - modulev1 "cosmossdk.io/api/cosmos/feegrant/module/v1" - - "cosmossdk.io/depinject" - "cosmossdk.io/core/store" + "cosmossdk.io/depinject" + "cosmossdk.io/errors" "cosmossdk.io/x/feegrant" "cosmossdk.io/x/feegrant/client/cli" "cosmossdk.io/x/feegrant/keeper" @@ -32,8 +28,13 @@ import ( ) var ( - _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleBasic = AppModule{} _ module.AppModuleSimulation = AppModule{} + _ module.HasServices = AppModule{} + _ module.HasGenesis = AppModule{} + + _ appmodule.AppModule = AppModule{} + _ appmodule.HasEndBlocker = AppModule{} ) // ---------------------------------------------------------------------------- @@ -101,11 +102,6 @@ func (ab AppModuleBasic) GetTxCmd() *cobra.Command { return cli.GetTxCmd(ab.ac) } -// GetQueryCmd returns no root query command for the feegrant module. -func (ab AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd(ab.ac) -} - // ---------------------------------------------------------------------------- // AppModule // ---------------------------------------------------------------------------- @@ -113,6 +109,7 @@ func (ab AppModuleBasic) GetQueryCmd() *cobra.Command { // AppModule implements an application module for the feegrant module. type AppModule struct { AppModuleBasic + keeper keeper.Keeper accountKeeper feegrant.AccountKeeper bankKeeper feegrant.BankKeeper @@ -123,32 +120,22 @@ type AppModule struct { func NewAppModule(cdc codec.Codec, ak feegrant.AccountKeeper, bk feegrant.BankKeeper, keeper keeper.Keeper, registry cdctypes.InterfaceRegistry) AppModule { return AppModule{ AppModuleBasic: AppModuleBasic{cdc: cdc, ac: ak.AddressCodec()}, - keeper: keeper, + keeper: keeper.SetBankKeeper(bk), // Super ugly hack to not be api breaking in v0.50 and v0.47 accountKeeper: ak, bankKeeper: bk, registry: registry, } } -var ( - _ appmodule.AppModule = AppModule{} - _ appmodule.HasEndBlocker = AppModule{} -) - // IsOnePerModuleType implements the depinject.OnePerModuleType interface. func (am AppModule) IsOnePerModuleType() {} // IsAppModule implements the appmodule.AppModule interface. func (am AppModule) IsAppModule() {} -// Name returns the feegrant module's name. -func (AppModule) Name() string { - return feegrant.ModuleName -} - // InitGenesis performs genesis initialization for the feegrant module. It returns // no validator updates. -func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, bz json.RawMessage) []abci.ValidatorUpdate { +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, bz json.RawMessage) { var gs feegrant.GenesisState cdc.MustUnmarshalJSON(bz, &gs) @@ -156,7 +143,6 @@ func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, bz json.Ra if err != nil { panic(err) } - return []abci.ValidatorUpdate{} } // ExportGenesis returns the exported genesis state as raw bytes for the feegrant @@ -176,9 +162,7 @@ func (AppModule) ConsensusVersion() uint64 { return 2 } // EndBlock returns the end blocker for the feegrant module. It returns no validator // updates. func (am AppModule) EndBlock(ctx context.Context) error { - c := sdk.UnwrapSDKContext(ctx) - EndBlocker(c, am.keeper) - return nil + return EndBlocker(ctx, am.keeper) } func init() { @@ -200,7 +184,7 @@ type FeegrantInputs struct { func ProvideModule(in FeegrantInputs) (keeper.Keeper, appmodule.AppModule) { k := keeper.NewKeeper(in.Cdc, in.StoreService, in.AccountKeeper) m := NewAppModule(in.Cdc, in.AccountKeeper, in.BankKeeper, k, in.Registry) - return k, m + return k.SetBankKeeper(in.BankKeeper) /* depinject ux improvement */, m } // AppModuleSimulation functions diff --git a/x/feegrant/msgs.go b/x/feegrant/msgs.go index 655c7bcb902c..b0c4fcf09d47 100644 --- a/x/feegrant/msgs.go +++ b/x/feegrant/msgs.go @@ -33,12 +33,6 @@ func NewMsgGrantAllowance(feeAllowance FeeAllowanceI, granter, grantee sdk.AccAd }, nil } -// GetSigners gets the granter account associated with an allowance -func (msg MsgGrantAllowance) GetSigners() []sdk.AccAddress { - granter, _ := sdk.AccAddressFromBech32(msg.Granter) - return []sdk.AccAddress{granter} -} - // GetFeeAllowanceI returns unpacked FeeAllowance func (msg MsgGrantAllowance) GetFeeAllowanceI() (FeeAllowanceI, error) { allowance, ok := msg.Allowance.GetCachedValue().(FeeAllowanceI) @@ -57,15 +51,6 @@ func (msg MsgGrantAllowance) UnpackInterfaces(unpacker types.AnyUnpacker) error // NewMsgRevokeAllowance returns a message to revoke a fee allowance for a given // granter and grantee -// - func NewMsgRevokeAllowance(granter, grantee sdk.AccAddress) MsgRevokeAllowance { return MsgRevokeAllowance{Granter: granter.String(), Grantee: grantee.String()} } - -// GetSigners gets the granter address associated with an Allowance -// to revoke. -func (msg MsgRevokeAllowance) GetSigners() []sdk.AccAddress { - granter, _ := sdk.AccAddressFromBech32(msg.Granter) - return []sdk.AccAddress{granter} -} diff --git a/x/feegrant/msgs_test.go b/x/feegrant/msgs_test.go index 337bbe952e4a..a0c19d0ff1c3 100644 --- a/x/feegrant/msgs_test.go +++ b/x/feegrant/msgs_test.go @@ -5,6 +5,7 @@ import ( "github.com/stretchr/testify/require" + "cosmossdk.io/math" "cosmossdk.io/x/feegrant" "github.com/cosmos/cosmos-sdk/codec" @@ -19,7 +20,7 @@ func TestAminoJSON(t *testing.T) { legacytx.RegressionTestingAminoCodec = legacyAmino tx := legacytx.StdTx{} var msg sdk.Msg - allowanceAny, err := codectypes.NewAnyWithValue(&feegrant.BasicAllowance{SpendLimit: sdk.NewCoins(sdk.NewCoin("foo", sdk.NewInt(100)))}) + allowanceAny, err := codectypes.NewAnyWithValue(&feegrant.BasicAllowance{SpendLimit: sdk.NewCoins(sdk.NewCoin("foo", math.NewInt(100)))}) require.NoError(t, err) // Amino JSON encoding has changed in feegrant since v0.46. @@ -33,13 +34,13 @@ func TestAminoJSON(t *testing.T) { tx.Msgs = []sdk.Msg{msg} require.Equal(t, `{"account_number":"1","chain_id":"foo","fee":{"amount":[],"gas":"0"},"memo":"memo","msgs":[{"type":"cosmos-sdk/MsgGrantAllowance","value":{"allowance":{"type":"cosmos-sdk/BasicAllowance","value":{"spend_limit":[{"amount":"100","denom":"foo"}]}},"grantee":"cosmos1def","granter":"cosmos1abc"}}],"sequence":"1","timeout_height":"1"}`, - string(legacytx.StdSignBytes("foo", 1, 1, 1, legacytx.StdFee{}, []sdk.Msg{msg}, "memo", nil)), + string(legacytx.StdSignBytes("foo", 1, 1, 1, legacytx.StdFee{}, []sdk.Msg{msg}, "memo")), ) msg = &feegrant.MsgRevokeAllowance{Granter: "cosmos1abc", Grantee: "cosmos1def"} tx.Msgs = []sdk.Msg{msg} require.Equal(t, `{"account_number":"1","chain_id":"foo","fee":{"amount":[],"gas":"0"},"memo":"memo","msgs":[{"type":"cosmos-sdk/MsgRevokeAllowance","value":{"grantee":"cosmos1def","granter":"cosmos1abc"}}],"sequence":"1","timeout_height":"1"}`, - string(legacytx.StdSignBytes("foo", 1, 1, 1, legacytx.StdFee{}, []sdk.Msg{msg}, "memo", nil)), + string(legacytx.StdSignBytes("foo", 1, 1, 1, legacytx.StdFee{}, []sdk.Msg{msg}, "memo")), ) } diff --git a/x/feegrant/periodic_fee.go b/x/feegrant/periodic_fee.go index 5439d66fb17a..d5906c955a67 100644 --- a/x/feegrant/periodic_fee.go +++ b/x/feegrant/periodic_fee.go @@ -91,7 +91,7 @@ func (a PeriodicAllowance) ValidateBasic() error { if !a.PeriodCanSpend.IsValid() { return errorsmod.Wrapf(sdkerrors.ErrInvalidCoins, "can spend amount is invalid: %s", a.PeriodCanSpend) } - // We allow 0 for CanSpend + // We allow 0 for `PeriodCanSpend` if a.PeriodCanSpend.IsAnyNegative() { return errorsmod.Wrap(sdkerrors.ErrInvalidCoins, "can spend must not be negative") } @@ -109,6 +109,7 @@ func (a PeriodicAllowance) ValidateBasic() error { return nil } +// ExpiresAt returns the expiry time of the PeriodicAllowance. func (a PeriodicAllowance) ExpiresAt() (*time.Time, error) { return a.Basic.ExpiresAt() } diff --git a/x/feegrant/periodic_fee_test.go b/x/feegrant/periodic_fee_test.go index a5f0cb6e8f85..911973c60486 100644 --- a/x/feegrant/periodic_fee_test.go +++ b/x/feegrant/periodic_fee_test.go @@ -10,6 +10,7 @@ import ( storetypes "cosmossdk.io/store/types" "cosmossdk.io/x/feegrant" + "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" ) diff --git a/x/feegrant/query.pb.go b/x/feegrant/query.pb.go index e87add15e5a1..555b706aa054 100644 --- a/x/feegrant/query.pb.go +++ b/x/feegrant/query.pb.go @@ -415,9 +415,9 @@ 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 { - // Allowance returns fee granted to the grantee by the granter. + // Allowance returns granted allwance to the grantee by the granter. Allowance(ctx context.Context, in *QueryAllowanceRequest, opts ...grpc.CallOption) (*QueryAllowanceResponse, error) - // Allowances returns all the grants for address. + // Allowances returns all the grants for the given grantee address. Allowances(ctx context.Context, in *QueryAllowancesRequest, opts ...grpc.CallOption) (*QueryAllowancesResponse, error) // AllowancesByGranter returns all the grants given by an address // @@ -462,9 +462,9 @@ func (c *queryClient) AllowancesByGranter(ctx context.Context, in *QueryAllowanc // QueryServer is the server API for Query service. type QueryServer interface { - // Allowance returns fee granted to the grantee by the granter. + // Allowance returns granted allwance to the grantee by the granter. Allowance(context.Context, *QueryAllowanceRequest) (*QueryAllowanceResponse, error) - // Allowances returns all the grants for address. + // Allowances returns all the grants for the given grantee address. Allowances(context.Context, *QueryAllowancesRequest) (*QueryAllowancesResponse, error) // AllowancesByGranter returns all the grants given by an address // @@ -544,6 +544,7 @@ func _Query_AllowancesByGranter_Handler(srv interface{}, ctx context.Context, de return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.feegrant.v1beta1.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/feegrant/simulation/decoder.go b/x/feegrant/simulation/decoder.go index 3a8263709dba..c1b4eedeb478 100644 --- a/x/feegrant/simulation/decoder.go +++ b/x/feegrant/simulation/decoder.go @@ -5,6 +5,7 @@ import ( "fmt" "cosmossdk.io/x/feegrant" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types/kv" ) diff --git a/x/feegrant/simulation/genesis.go b/x/feegrant/simulation/genesis.go index 95b2212fed59..607111bc975c 100644 --- a/x/feegrant/simulation/genesis.go +++ b/x/feegrant/simulation/genesis.go @@ -4,7 +4,7 @@ import ( "math/rand" "time" - sdkmath "cosmossdk.io/math" + "cosmossdk.io/math" "cosmossdk.io/x/feegrant" sdk "github.com/cosmos/cosmos-sdk/types" @@ -25,8 +25,8 @@ func genFeeGrants(r *rand.Rand, accounts []simtypes.Account) []feegrant.Grant { func generateRandomAllowances(granter, grantee sdk.AccAddress, r *rand.Rand) feegrant.Grant { allowances := make([]feegrant.Grant, 3) - spendLimit := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100))) - periodSpendLimit := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(10))) + spendLimit := sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(100))) + periodSpendLimit := sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(10))) basic := feegrant.BasicAllowance{ SpendLimit: spendLimit, diff --git a/x/feegrant/simulation/genesis_test.go b/x/feegrant/simulation/genesis_test.go index 38e213b2fe4b..af9ffd667e7e 100644 --- a/x/feegrant/simulation/genesis_test.go +++ b/x/feegrant/simulation/genesis_test.go @@ -7,10 +7,11 @@ import ( "github.com/stretchr/testify/require" - sdkmath "cosmossdk.io/math" + "cosmossdk.io/math" "cosmossdk.io/x/feegrant" "cosmossdk.io/x/feegrant/module" "cosmossdk.io/x/feegrant/simulation" + moduletypes "github.com/cosmos/cosmos-sdk/types/module" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" @@ -29,7 +30,7 @@ func TestRandomizedGenState(t *testing.T) { Rand: r, NumBonded: 3, Accounts: accounts, - InitialStake: sdkmath.NewInt(1000), + InitialStake: math.NewInt(1000), GenState: make(map[string]json.RawMessage), } diff --git a/x/feegrant/simulation/operations_test.go b/x/feegrant/simulation/operations_test.go index d39fa708005f..4198d39d55f0 100644 --- a/x/feegrant/simulation/operations_test.go +++ b/x/feegrant/simulation/operations_test.go @@ -5,29 +5,19 @@ import ( "testing" "time" - "cosmossdk.io/depinject" - "cosmossdk.io/log" - _ "cosmossdk.io/x/feegrant/module" - + abci "github.com/cometbft/cometbft/abci/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/gogoproto/proto" + "github.com/stretchr/testify/suite" - "github.com/cosmos/cosmos-sdk/client" - _ "github.com/cosmos/cosmos-sdk/x/auth" - _ "github.com/cosmos/cosmos-sdk/x/auth/tx/config" - _ "github.com/cosmos/cosmos-sdk/x/bank" - _ "github.com/cosmos/cosmos-sdk/x/consensus" - _ "github.com/cosmos/cosmos-sdk/x/genutil" - _ "github.com/cosmos/cosmos-sdk/x/mint" - _ "github.com/cosmos/cosmos-sdk/x/params" - _ "github.com/cosmos/cosmos-sdk/x/staking" - + "cosmossdk.io/depinject" + "cosmossdk.io/log" "cosmossdk.io/x/feegrant" "cosmossdk.io/x/feegrant/keeper" + _ "cosmossdk.io/x/feegrant/module" "cosmossdk.io/x/feegrant/simulation" - abci "github.com/cometbft/cometbft/abci/types" - cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" - "github.com/stretchr/testify/suite" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codecaddress "github.com/cosmos/cosmos-sdk/codec/address" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -36,9 +26,17 @@ import ( simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + _ "github.com/cosmos/cosmos-sdk/x/auth" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + _ "github.com/cosmos/cosmos-sdk/x/auth/tx/config" + _ "github.com/cosmos/cosmos-sdk/x/bank" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" banktestutil "github.com/cosmos/cosmos-sdk/x/bank/testutil" + _ "github.com/cosmos/cosmos-sdk/x/consensus" + _ "github.com/cosmos/cosmos-sdk/x/genutil" + _ "github.com/cosmos/cosmos-sdk/x/mint" + _ "github.com/cosmos/cosmos-sdk/x/params" + _ "github.com/cosmos/cosmos-sdk/x/staking" ) type SimTestSuite struct { diff --git a/x/feegrant/sonar-project.properties b/x/feegrant/sonar-project.properties deleted file mode 100644 index 3e50d37161bf..000000000000 --- a/x/feegrant/sonar-project.properties +++ /dev/null @@ -1,15 +0,0 @@ -sonar.projectKey=cosmos-sdk-x-feegrant -sonar.organization=cosmos - -sonar.projectName=Cosmos SDK - x/feegrant -sonar.project.monorepo.enabled=true - -sonar.sources=. -sonar.exclusions=**/*_test.go -sonar.tests=. -sonar.test.inclusions=**/*_test.go -sonar.go.coverage.reportPaths=coverage.out - -sonar.sourceEncoding=UTF-8 -sonar.scm.provider=git -sonar.pullrequest.github.summary_comment=true \ No newline at end of file diff --git a/x/feegrant/testutil/expected_keepers_mocks.go b/x/feegrant/testutil/expected_keepers_mocks.go index d7567b8266d3..797094ad7533 100644 --- a/x/feegrant/testutil/expected_keepers_mocks.go +++ b/x/feegrant/testutil/expected_keepers_mocks.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: x/feegrant/expected_keepers.go +// +// Generated by this command: +// +// mockgen -source=x/feegrant/expected_keepers.go -package testutil -destination x/feegrant/testutil/expected_keepers_mocks.go +// // Package testutil is a generated GoMock package. package testutil @@ -10,13 +15,14 @@ import ( address "cosmossdk.io/core/address" types "github.com/cosmos/cosmos-sdk/types" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockAccountKeeper is a mock of AccountKeeper interface. type MockAccountKeeper struct { ctrl *gomock.Controller recorder *MockAccountKeeperMockRecorder + isgomock struct{} } // MockAccountKeeperMockRecorder is the mock recorder for MockAccountKeeper. @@ -59,7 +65,7 @@ func (m *MockAccountKeeper) GetAccount(ctx context.Context, addr types.AccAddres } // GetAccount indicates an expected call of GetAccount. -func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetAccount), ctx, addr) } @@ -73,7 +79,7 @@ func (m *MockAccountKeeper) GetModuleAccount(ctx context.Context, moduleName str } // GetModuleAccount indicates an expected call of GetModuleAccount. -func (mr *MockAccountKeeperMockRecorder) GetModuleAccount(ctx, moduleName interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) GetModuleAccount(ctx, moduleName any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAccount), ctx, moduleName) } @@ -87,7 +93,7 @@ func (m *MockAccountKeeper) GetModuleAddress(moduleName string) types.AccAddress } // GetModuleAddress indicates an expected call of GetModuleAddress. -func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(moduleName interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(moduleName any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAddress", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAddress), moduleName) } @@ -101,7 +107,7 @@ func (m *MockAccountKeeper) NewAccountWithAddress(ctx context.Context, addr type } // NewAccountWithAddress indicates an expected call of NewAccountWithAddress. -func (mr *MockAccountKeeperMockRecorder) NewAccountWithAddress(ctx, addr interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) NewAccountWithAddress(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewAccountWithAddress", reflect.TypeOf((*MockAccountKeeper)(nil).NewAccountWithAddress), ctx, addr) } @@ -113,7 +119,7 @@ func (m *MockAccountKeeper) SetAccount(ctx context.Context, acc types.AccountI) } // SetAccount indicates an expected call of SetAccount. -func (mr *MockAccountKeeperMockRecorder) SetAccount(ctx, acc interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) SetAccount(ctx, acc any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetAccount", reflect.TypeOf((*MockAccountKeeper)(nil).SetAccount), ctx, acc) } @@ -122,6 +128,7 @@ func (mr *MockAccountKeeperMockRecorder) SetAccount(ctx, acc interface{}) *gomoc type MockBankKeeper struct { ctrl *gomock.Controller recorder *MockBankKeeperMockRecorder + isgomock struct{} } // MockBankKeeperMockRecorder is the mock recorder for MockBankKeeper. @@ -141,6 +148,20 @@ func (m *MockBankKeeper) EXPECT() *MockBankKeeperMockRecorder { return m.recorder } +// BlockedAddr mocks base method. +func (m *MockBankKeeper) BlockedAddr(addr types.AccAddress) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "BlockedAddr", addr) + ret0, _ := ret[0].(bool) + return ret0 +} + +// BlockedAddr indicates an expected call of BlockedAddr. +func (mr *MockBankKeeperMockRecorder) BlockedAddr(addr any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlockedAddr", reflect.TypeOf((*MockBankKeeper)(nil).BlockedAddr), addr) +} + // SendCoinsFromAccountToModule mocks base method. func (m *MockBankKeeper) SendCoinsFromAccountToModule(ctx context.Context, senderAddr types.AccAddress, recipientModule string, amt types.Coins) error { m.ctrl.T.Helper() @@ -150,7 +171,7 @@ func (m *MockBankKeeper) SendCoinsFromAccountToModule(ctx context.Context, sende } // SendCoinsFromAccountToModule indicates an expected call of SendCoinsFromAccountToModule. -func (mr *MockBankKeeperMockRecorder) SendCoinsFromAccountToModule(ctx, senderAddr, recipientModule, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SendCoinsFromAccountToModule(ctx, senderAddr, recipientModule, amt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromAccountToModule", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromAccountToModule), ctx, senderAddr, recipientModule, amt) } @@ -164,7 +185,7 @@ func (m *MockBankKeeper) SpendableCoins(ctx context.Context, addr types.AccAddre } // SpendableCoins indicates an expected call of SpendableCoins. -func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SpendableCoins", reflect.TypeOf((*MockBankKeeper)(nil).SpendableCoins), ctx, addr) } diff --git a/x/feegrant/tx.pb.go b/x/feegrant/tx.pb.go index f0dcf66635f2..93c5fbc89455 100644 --- a/x/feegrant/tx.pb.go +++ b/x/feegrant/tx.pb.go @@ -225,17 +225,106 @@ func (m *MsgRevokeAllowanceResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgRevokeAllowanceResponse proto.InternalMessageInfo +// MsgPruneAllowances prunes expired fee allowances. +// +// Since cosmos-sdk 0.50 +type MsgPruneAllowances struct { + // pruner is the address of the user pruning expired allowances. + Pruner string `protobuf:"bytes,1,opt,name=pruner,proto3" json:"pruner,omitempty"` +} + +func (m *MsgPruneAllowances) Reset() { *m = MsgPruneAllowances{} } +func (m *MsgPruneAllowances) String() string { return proto.CompactTextString(m) } +func (*MsgPruneAllowances) ProtoMessage() {} +func (*MsgPruneAllowances) Descriptor() ([]byte, []int) { + return fileDescriptor_dd44ad7946dad783, []int{4} +} +func (m *MsgPruneAllowances) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgPruneAllowances) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgPruneAllowances.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 *MsgPruneAllowances) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgPruneAllowances.Merge(m, src) +} +func (m *MsgPruneAllowances) XXX_Size() int { + return m.Size() +} +func (m *MsgPruneAllowances) XXX_DiscardUnknown() { + xxx_messageInfo_MsgPruneAllowances.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgPruneAllowances proto.InternalMessageInfo + +func (m *MsgPruneAllowances) GetPruner() string { + if m != nil { + return m.Pruner + } + return "" +} + +// MsgPruneAllowancesResponse defines the Msg/PruneAllowancesResponse response type. +// +// Since cosmos-sdk 0.50 +type MsgPruneAllowancesResponse struct { +} + +func (m *MsgPruneAllowancesResponse) Reset() { *m = MsgPruneAllowancesResponse{} } +func (m *MsgPruneAllowancesResponse) String() string { return proto.CompactTextString(m) } +func (*MsgPruneAllowancesResponse) ProtoMessage() {} +func (*MsgPruneAllowancesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_dd44ad7946dad783, []int{5} +} +func (m *MsgPruneAllowancesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgPruneAllowancesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgPruneAllowancesResponse.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 *MsgPruneAllowancesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgPruneAllowancesResponse.Merge(m, src) +} +func (m *MsgPruneAllowancesResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgPruneAllowancesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgPruneAllowancesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgPruneAllowancesResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgGrantAllowance)(nil), "cosmos.feegrant.v1beta1.MsgGrantAllowance") proto.RegisterType((*MsgGrantAllowanceResponse)(nil), "cosmos.feegrant.v1beta1.MsgGrantAllowanceResponse") proto.RegisterType((*MsgRevokeAllowance)(nil), "cosmos.feegrant.v1beta1.MsgRevokeAllowance") proto.RegisterType((*MsgRevokeAllowanceResponse)(nil), "cosmos.feegrant.v1beta1.MsgRevokeAllowanceResponse") + proto.RegisterType((*MsgPruneAllowances)(nil), "cosmos.feegrant.v1beta1.MsgPruneAllowances") + proto.RegisterType((*MsgPruneAllowancesResponse)(nil), "cosmos.feegrant.v1beta1.MsgPruneAllowancesResponse") } func init() { proto.RegisterFile("cosmos/feegrant/v1beta1/tx.proto", fileDescriptor_dd44ad7946dad783) } var fileDescriptor_dd44ad7946dad783 = []byte{ - // 409 bytes of a gzipped FileDescriptorProto + // 455 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0xd6, 0x4f, 0x4b, 0x4d, 0x4d, 0x2f, 0x4a, 0xcc, 0x2b, 0xd1, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x87, 0xa8, @@ -254,14 +343,17 @@ var fileDescriptor_dd44ad7946dad783 = []byte{ 0xb2, 0xf5, 0x31, 0x7c, 0xad, 0x24, 0xcd, 0x25, 0x89, 0x21, 0x18, 0x94, 0x5a, 0x5c, 0x90, 0x9f, 0x57, 0x9c, 0xaa, 0xb4, 0x86, 0x91, 0x4b, 0xc8, 0xb7, 0x38, 0x3d, 0x28, 0xb5, 0x2c, 0x3f, 0x3b, 0x95, 0xee, 0x21, 0x65, 0xa5, 0x87, 0xee, 0x15, 0x59, 0x54, 0xaf, 0xa0, 0xb9, 0x4b, 0x49, 0x86, - 0x4b, 0x0a, 0x53, 0x14, 0xe6, 0x19, 0xa3, 0xcf, 0x8c, 0x5c, 0xcc, 0xbe, 0xc5, 0xe9, 0x42, 0x05, - 0x5c, 0x7c, 0x68, 0x31, 0xaf, 0xa5, 0x87, 0x2b, 0x94, 0x31, 0x82, 0x46, 0xca, 0x88, 0x78, 0xb5, - 0x30, 0x9b, 0x85, 0x8a, 0xb9, 0xf8, 0xd1, 0x83, 0x50, 0x1b, 0x9f, 0x31, 0x68, 0x8a, 0xa5, 0x8c, - 0x49, 0x50, 0x0c, 0xb3, 0x54, 0x8a, 0xb5, 0xe1, 0xf9, 0x06, 0x2d, 0x46, 0x27, 0xc3, 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, 0x82, 0xe6, 0x98, 0xe2, 0x94, 0x6c, 0xbd, 0xcc, - 0x7c, 0xfd, 0x0a, 0x78, 0x56, 0x4d, 0x62, 0x03, 0xa7, 0x42, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, - 0xff, 0x3f, 0x13, 0x6c, 0x2e, 0xc4, 0x03, 0x00, 0x00, + 0x4b, 0x0a, 0x53, 0x14, 0xee, 0x99, 0x60, 0xb0, 0x5f, 0x02, 0x8a, 0x4a, 0xf3, 0x10, 0x92, 0xc5, + 0x42, 0x06, 0x5c, 0x6c, 0x05, 0x20, 0x21, 0xc2, 0x5e, 0x81, 0xaa, 0xb3, 0xe2, 0x06, 0xb9, 0x0a, + 0xca, 0x81, 0x5a, 0x89, 0x66, 0x28, 0xcc, 0x4a, 0xa3, 0x17, 0x4c, 0x5c, 0xcc, 0xbe, 0xc5, 0xe9, + 0x42, 0x05, 0x5c, 0x7c, 0x68, 0x89, 0x4d, 0x4b, 0x0f, 0x57, 0xc4, 0x62, 0xc4, 0x86, 0x94, 0x11, + 0xf1, 0x6a, 0x61, 0x36, 0x0b, 0x15, 0x73, 0xf1, 0xa3, 0xc7, 0x9a, 0x36, 0x3e, 0x63, 0xd0, 0x14, + 0x4b, 0x19, 0x93, 0xa0, 0x18, 0xd9, 0x52, 0xf4, 0xe0, 0xc5, 0x6b, 0x29, 0x9a, 0x62, 0xfc, 0x96, + 0xe2, 0x08, 0x63, 0x29, 0xd6, 0x86, 0xe7, 0x1b, 0xb4, 0x18, 0x9d, 0x0c, 0x4f, 0x3c, 0x92, 0x63, + 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, + 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x0a, 0x5a, 0x32, 0x14, 0xa7, 0x64, 0xeb, 0x65, 0xe6, 0xeb, + 0x57, 0xc0, 0x8b, 0xa4, 0x24, 0x36, 0x70, 0x6e, 0x33, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x8d, + 0x04, 0xdd, 0xf4, 0xac, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -282,6 +374,10 @@ type MsgClient interface { // RevokeAllowance revokes any fee allowance of granter's account that // has been granted to the grantee. RevokeAllowance(ctx context.Context, in *MsgRevokeAllowance, opts ...grpc.CallOption) (*MsgRevokeAllowanceResponse, error) + // PruneAllowances prunes expired fee allowances, currently up to 75 at a time. + // + // Since cosmos-sdk 0.50 + PruneAllowances(ctx context.Context, in *MsgPruneAllowances, opts ...grpc.CallOption) (*MsgPruneAllowancesResponse, error) } type msgClient struct { @@ -310,6 +406,15 @@ func (c *msgClient) RevokeAllowance(ctx context.Context, in *MsgRevokeAllowance, return out, nil } +func (c *msgClient) PruneAllowances(ctx context.Context, in *MsgPruneAllowances, opts ...grpc.CallOption) (*MsgPruneAllowancesResponse, error) { + out := new(MsgPruneAllowancesResponse) + err := c.cc.Invoke(ctx, "/cosmos.feegrant.v1beta1.Msg/PruneAllowances", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // GrantAllowance grants fee allowance to the grantee on the granter's @@ -318,6 +423,10 @@ type MsgServer interface { // RevokeAllowance revokes any fee allowance of granter's account that // has been granted to the grantee. RevokeAllowance(context.Context, *MsgRevokeAllowance) (*MsgRevokeAllowanceResponse, error) + // PruneAllowances prunes expired fee allowances, currently up to 75 at a time. + // + // Since cosmos-sdk 0.50 + PruneAllowances(context.Context, *MsgPruneAllowances) (*MsgPruneAllowancesResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -330,6 +439,9 @@ func (*UnimplementedMsgServer) GrantAllowance(ctx context.Context, req *MsgGrant func (*UnimplementedMsgServer) RevokeAllowance(ctx context.Context, req *MsgRevokeAllowance) (*MsgRevokeAllowanceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RevokeAllowance not implemented") } +func (*UnimplementedMsgServer) PruneAllowances(ctx context.Context, req *MsgPruneAllowances) (*MsgPruneAllowancesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PruneAllowances not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -371,6 +483,25 @@ func _Msg_RevokeAllowance_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +func _Msg_PruneAllowances_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgPruneAllowances) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).PruneAllowances(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.feegrant.v1beta1.Msg/PruneAllowances", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).PruneAllowances(ctx, req.(*MsgPruneAllowances)) + } + return interceptor(ctx, in, info, handler) +} + +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.feegrant.v1beta1.Msg", HandlerType: (*MsgServer)(nil), @@ -383,6 +514,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "RevokeAllowance", Handler: _Msg_RevokeAllowance_Handler, }, + { + MethodName: "PruneAllowances", + Handler: _Msg_PruneAllowances_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/feegrant/v1beta1/tx.proto", @@ -520,6 +655,59 @@ func (m *MsgRevokeAllowanceResponse) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } +func (m *MsgPruneAllowances) 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 *MsgPruneAllowances) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgPruneAllowances) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Pruner) > 0 { + i -= len(m.Pruner) + copy(dAtA[i:], m.Pruner) + i = encodeVarintTx(dAtA, i, uint64(len(m.Pruner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgPruneAllowancesResponse) 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 *MsgPruneAllowancesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgPruneAllowancesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -587,6 +775,28 @@ func (m *MsgRevokeAllowanceResponse) Size() (n int) { return n } +func (m *MsgPruneAllowances) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Pruner) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgPruneAllowancesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -957,6 +1167,138 @@ func (m *MsgRevokeAllowanceResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgPruneAllowances) 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: MsgPruneAllowances: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgPruneAllowances: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pruner", 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.Pruner = 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 *MsgPruneAllowancesResponse) 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: MsgPruneAllowancesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgPruneAllowancesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/genutil/README.md b/x/genutil/README.md index c534b8b0d7ac..45cb45355b86 100644 --- a/x/genutil/README.md +++ b/x/genutil/README.md @@ -2,16 +2,36 @@ ## Concepts -The `genutil` package contains a variaety of genesis utility functionalities for usage within a blockchain application. Namely: +The `genutil` package contains a variety of genesis utility functionalities for usage within a blockchain application. Namely: * Genesis transactions related (gentx) * Commands for collection and creation of gentxs * `InitChain` processing of gentxs +* Genesis file creation * Genesis file validation * Genesis file migration * CometBFT related initialization * Translation of an app genesis to a CometBFT genesis +## Genesis + +Genutil contains the data structure that defines an application genesis. +An application genesis consist of a consensus genesis (g.e. CometBFT genesis) and application related genesis data. + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-rc.0/x/genutil/types/genesis.go#L24-L34 +``` + +The application genesis can then be translated to the consensus engine to the right format: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-rc.0/x/genutil/types/genesis.go#L126-L136 +``` + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-rc.0/server/start.go#L397-L407 +``` + ## Client ### CLI diff --git a/x/genutil/client/cli/collect.go b/x/genutil/client/cli/collect.go index fc001d391fdd..5502445960d7 100644 --- a/x/genutil/client/cli/collect.go +++ b/x/genutil/client/cli/collect.go @@ -4,11 +4,13 @@ import ( "encoding/json" "path/filepath" - "cosmossdk.io/errors" "github.com/spf13/cobra" + "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/server" "github.com/cosmos/cosmos-sdk/x/genutil" "github.com/cosmos/cosmos-sdk/x/genutil/types" @@ -17,7 +19,7 @@ import ( const flagGenTxDir = "gentx-dir" // CollectGenTxsCmd - return the cobra command to collect genesis transactions -func CollectGenTxsCmd(genBalIterator types.GenesisBalancesIterator, defaultNodeHome string, validator types.MessageValidator) *cobra.Command { +func CollectGenTxsCmd(genBalIterator types.GenesisBalancesIterator, defaultNodeHome string, validator types.MessageValidator, valAddrCodec runtime.ValidatorAddressCodec) *cobra.Command { cmd := &cobra.Command{ Use: "collect-gentxs", Short: "Collect genesis txs and output a genesis.json file", @@ -49,7 +51,7 @@ func CollectGenTxsCmd(genBalIterator types.GenesisBalancesIterator, defaultNodeH toPrint := newPrintInfo(config.Moniker, appGenesis.ChainID, nodeID, genTxsDir, json.RawMessage("")) initCfg := types.NewInitConfig(appGenesis.ChainID, genTxsDir, nodeID, valPubKey) - appMessage, err := genutil.GenAppStateFromConfig(cdc, clientCtx.TxConfig, config, initCfg, appGenesis, genBalIterator, validator) + appMessage, err := genutil.GenAppStateFromConfig(cdc, clientCtx.TxConfig, config, initCfg, appGenesis, genBalIterator, validator, valAddrCodec) if err != nil { return errors.Wrap(err, "failed to get genesis app state from config") } diff --git a/x/genutil/client/cli/commands.go b/x/genutil/client/cli/commands.go index 22d69dc6d17b..bd2a5f0503dd 100644 --- a/x/genutil/client/cli/commands.go +++ b/x/genutil/client/cli/commands.go @@ -1,13 +1,13 @@ package cli import ( + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/types/module" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/genutil" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" - - "github.com/spf13/cobra" ) // GenesisCoreCommand adds core sdk's sub-commands into genesis command. @@ -34,11 +34,12 @@ func CommandsWithCustomMigrationMap(txConfig client.TxConfig, moduleBasics modul gentxModule := moduleBasics[genutiltypes.ModuleName].(genutil.AppModuleBasic) cmd.AddCommand( - GenTxCmd(moduleBasics, txConfig, banktypes.GenesisBalancesIterator{}, defaultNodeHome), + GenTxCmd(moduleBasics, txConfig, banktypes.GenesisBalancesIterator{}, defaultNodeHome, txConfig.SigningContext().ValidatorAddressCodec()), MigrateGenesisCmd(migrationMap), - CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, defaultNodeHome, gentxModule.GenTxValidator), + CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, defaultNodeHome, gentxModule.GenTxValidator, txConfig.SigningContext().ValidatorAddressCodec()), ValidateGenesisCmd(moduleBasics), - AddGenesisAccountCmd(defaultNodeHome), + AddGenesisAccountCmd(defaultNodeHome, txConfig.SigningContext().AddressCodec()), + AddBulkGenesisAccountCmd(defaultNodeHome, txConfig.SigningContext().AddressCodec()), ) return cmd diff --git a/x/genutil/client/cli/genaccount.go b/x/genutil/client/cli/genaccount.go index 0bedc26a1ba6..ec0025f51493 100644 --- a/x/genutil/client/cli/genaccount.go +++ b/x/genutil/client/cli/genaccount.go @@ -2,10 +2,14 @@ package cli import ( "bufio" + "encoding/json" "fmt" + "os" "github.com/spf13/cobra" + address "cosmossdk.io/core/address" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/crypto/keyring" @@ -24,7 +28,7 @@ const ( // AddGenesisAccountCmd returns add-genesis-account cobra Command. // This command is provided as a default, applications are expected to provide their own command if custom genesis accounts are needed. -func AddGenesisAccountCmd(defaultNodeHome string) *cobra.Command { +func AddGenesisAccountCmd(defaultNodeHome string, addressCodec address.Codec) *cobra.Command { cmd := &cobra.Command{ Use: "add-genesis-account [address_or_key_name] [coin][,[coin]]", Short: "Add a genesis account to genesis.json", @@ -42,7 +46,7 @@ contain valid denominations. Accounts may optionally be supplied with vesting pa config.SetRoot(clientCtx.HomeDir) var kr keyring.Keyring - addr, err := sdk.AccAddressFromBech32(args[0]) + addr, err := addressCodec.StringToBytes(args[0]) if err != nil { inBuf := bufio.NewReader(cmd.InOrStdin()) keyringBackend, _ := cmd.Flags().GetString(flags.FlagKeyringBackend) @@ -89,3 +93,68 @@ contain valid denominations. Accounts may optionally be supplied with vesting pa return cmd } + +// AddBulkGenesisAccountCmd returns bulk-add-genesis-account cobra Command. +// This command is provided as a default, applications are expected to provide their own command if custom genesis accounts are needed. +func AddBulkGenesisAccountCmd(defaultNodeHome string, addressCodec address.Codec) *cobra.Command { + cmd := &cobra.Command{ + Use: "bulk-add-genesis-account [/file/path.json]", + Short: "Bulk add genesis accounts to genesis.json", + Example: `bulk-add-genesis-account accounts.json +where accounts.json is: +[ + { + "address": "cosmos139f7kncmglres2nf3h4hc4tade85ekfr8sulz5", + "coins": [ + { "denom": "umuon", "amount": "100000000" }, + { "denom": "stake", "amount": "200000000" } + ] + }, + { + "address": "cosmos1e0jnq2sun3dzjh8p2xq95kk0expwmd7shwjpfg", + "coins": [ + { "denom": "umuon", "amount": "500000000" } + ], + "vesting_amt": [ + { "denom": "umuon", "amount": "400000000" } + ], + "vesting_start": 1724711478, + "vesting_end": 1914013878 + } +] +`, + Long: `Add genesis accounts in bulk to genesis.json. The provided account must specify +the account address and a list of initial coins. The list of initial tokens must +contain valid denominations. Accounts may optionally be supplied with vesting parameters. +`, + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + serverCtx := server.GetServerContextFromCmd(cmd) + config := serverCtx.Config + + config.SetRoot(clientCtx.HomeDir) + + f, err := os.Open(args[0]) + if err != nil { + return fmt.Errorf("failed to open file: %w", err) + } + defer f.Close() + + var accounts []genutil.GenesisAccount + if err := json.NewDecoder(f).Decode(&accounts); err != nil { + return fmt.Errorf("failed to decode JSON: %w", err) + } + + appendflag, _ := cmd.Flags().GetBool(flagAppendMode) + + return genutil.AddGenesisAccounts(clientCtx.Codec, addressCodec, accounts, appendflag, config.GenesisFile()) + }, + } + + cmd.Flags().Bool(flagAppendMode, false, "append the coins to an account already in the genesis.json file") + cmd.Flags().String(flags.FlagHome, defaultNodeHome, "The application home directory") + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/genutil/client/cli/genaccount_test.go b/x/genutil/client/cli/genaccount_test.go index 3de35946d7e6..c3a99bd9731d 100644 --- a/x/genutil/client/cli/genaccount_test.go +++ b/x/genutil/client/cli/genaccount_test.go @@ -2,15 +2,20 @@ package cli_test import ( "context" + "encoding/json" "fmt" + "os" + "path" "testing" "github.com/spf13/viper" "github.com/stretchr/testify/require" "cosmossdk.io/log" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/crypto/hd" "github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/cosmos/cosmos-sdk/server" @@ -18,8 +23,11 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" "github.com/cosmos/cosmos-sdk/x/auth" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/cosmos/cosmos-sdk/x/genutil" genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" genutiltest "github.com/cosmos/cosmos-sdk/x/genutil/client/testutil" + genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" ) func TestAddGenesisAccountCmd(t *testing.T) { @@ -89,7 +97,7 @@ func TestAddGenesisAccountCmd(t *testing.T) { ctx = context.WithValue(ctx, client.ClientContextKey, &clientCtx) ctx = context.WithValue(ctx, server.ServerContextKey, serverCtx) - cmd := genutilcli.AddGenesisAccountCmd(home) + cmd := genutilcli.AddGenesisAccountCmd(home, addresscodec.NewBech32Codec("cosmos")) cmd.SetArgs([]string{ tc.addr, tc.denom, @@ -104,3 +112,158 @@ func TestAddGenesisAccountCmd(t *testing.T) { }) } } + +func TestBulkAddGenesisAccountCmd(t *testing.T) { + _, _, addr1 := testdata.KeyTestPubAddr() + _, _, addr2 := testdata.KeyTestPubAddr() + _, _, addr3 := testdata.KeyTestPubAddr() + addr1Str := addr1.String() + addr2Str := addr2.String() + addr3Str := addr3.String() + + tests := []struct { + name string + state [][]genutil.GenesisAccount + expected map[string]sdk.Coins + appendFlag bool + expectErr bool + }{ + { + name: "invalid address", + state: [][]genutil.GenesisAccount{ + { + { + Address: "invalid", + Coins: sdk.NewCoins(sdk.NewInt64Coin("test", 1)), + }, + }, + }, + expectErr: true, + }, + { + name: "no append flag for multiple account adds", + state: [][]genutil.GenesisAccount{ + { + { + Address: addr1Str, + Coins: sdk.NewCoins(sdk.NewInt64Coin("test", 1)), + }, + }, + { + { + Address: addr1Str, + Coins: sdk.NewCoins(sdk.NewInt64Coin("test", 2)), + }, + }, + }, + appendFlag: false, + expectErr: true, + }, + + { + name: "multiple additions with append", + state: [][]genutil.GenesisAccount{ + { + { + Address: addr1Str, + Coins: sdk.NewCoins(sdk.NewInt64Coin("test", 1)), + }, + { + Address: addr2Str, + Coins: sdk.NewCoins(sdk.NewInt64Coin("test", 1)), + }, + }, + { + { + Address: addr1Str, + Coins: sdk.NewCoins(sdk.NewInt64Coin("test", 2)), + }, + { + Address: addr2Str, + Coins: sdk.NewCoins(sdk.NewInt64Coin("stake", 1)), + }, + { + Address: addr3Str, + Coins: sdk.NewCoins(sdk.NewInt64Coin("test", 1)), + }, + }, + }, + expected: map[string]sdk.Coins{ + addr1Str: sdk.NewCoins(sdk.NewInt64Coin("test", 3)), + addr2Str: sdk.NewCoins(sdk.NewInt64Coin("test", 1), sdk.NewInt64Coin("stake", 1)), + addr3Str: sdk.NewCoins(sdk.NewInt64Coin("test", 1)), + }, + appendFlag: true, + expectErr: false, + }, + } + + for _, tc := range tests { + tc := tc + t.Run(tc.name, func(t *testing.T) { + home := t.TempDir() + logger := log.NewNopLogger() + cfg, err := genutiltest.CreateDefaultCometConfig(home) + require.NoError(t, err) + + appCodec := moduletestutil.MakeTestEncodingConfig(auth.AppModuleBasic{}).Codec + err = genutiltest.ExecInitCmd(testMbm, home, appCodec) + require.NoError(t, err) + + serverCtx := server.NewContext(viper.New(), cfg, logger) + clientCtx := client.Context{}.WithCodec(appCodec).WithHomeDir(home) + + ctx := context.Background() + ctx = context.WithValue(ctx, client.ClientContextKey, &clientCtx) + ctx = context.WithValue(ctx, server.ServerContextKey, serverCtx) + + // The first iteration (pre-append) may not error. + // Check if any errors after all state transitions to genesis. + doesErr := false + + // apply multiple state iterations if applicable (e.g. --append) + for _, state := range tc.state { + bz, err := json.Marshal(state) + require.NoError(t, err) + + filePath := path.Join(home, "accounts.json") + err = os.WriteFile(filePath, bz, 0o600) + require.NoError(t, err) + + cmd := genutilcli.AddBulkGenesisAccountCmd(home, addresscodec.NewBech32Codec("cosmos")) + args := []string{filePath} + if tc.appendFlag { + args = append(args, "--append") + } + cmd.SetArgs(args) + + err = cmd.ExecuteContext(ctx) + if err != nil { + doesErr = true + } + } + require.Equal(t, tc.expectErr, doesErr) + + // an error already occurred, no need to check the state + if doesErr { + return + } + + appState, _, err := genutiltypes.GenesisStateFromGenFile(path.Join(home, "config", "genesis.json")) + require.NoError(t, err) + + bankState := banktypes.GetGenesisStateFromAppState(appCodec, appState) + + require.EqualValues(t, len(tc.expected), len(bankState.Balances)) + for _, acc := range bankState.Balances { + require.True(t, tc.expected[acc.Address].Equal(acc.Coins), "expected: %v, got: %v", tc.expected[acc.Address], acc.Coins) + } + + expectedSupply := sdk.NewCoins() + for _, coins := range tc.expected { + expectedSupply = expectedSupply.Add(coins...) + } + require.Equal(t, expectedSupply, bankState.Supply) + }) + } +} diff --git a/x/genutil/client/cli/gentx.go b/x/genutil/client/cli/gentx.go index ed7c659ad1c4..7c5ee6f7f9a7 100644 --- a/x/genutil/client/cli/gentx.go +++ b/x/genutil/client/cli/gentx.go @@ -9,9 +9,11 @@ import ( "os" "path/filepath" - "cosmossdk.io/errors" "github.com/spf13/cobra" + address "cosmossdk.io/core/address" + "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" @@ -27,7 +29,7 @@ import ( ) // GenTxCmd builds the application's gentx command. -func GenTxCmd(mbm module.BasicManager, txEncCfg client.TxEncodingConfig, genBalIterator types.GenesisBalancesIterator, defaultNodeHome string) *cobra.Command { +func GenTxCmd(mbm module.BasicManager, txEncCfg client.TxEncodingConfig, genBalIterator types.GenesisBalancesIterator, defaultNodeHome string, valAdddressCodec address.Codec) *cobra.Command { ipDefault, _ := server.ExternalIP() fsCreateValidator, defaultsDesc := cli.CreateValidatorMsgFlagSet(ipDefault) @@ -36,7 +38,7 @@ func GenTxCmd(mbm module.BasicManager, txEncCfg client.TxEncodingConfig, genBalI Short: "Generate a genesis tx carrying a self delegation", Args: cobra.ExactArgs(2), Long: fmt.Sprintf(`Generate a genesis transaction that creates a validator with a self-delegation, -that is signed by the key in the Keyring referenced by a given name. A node ID and Bech32 consensus +that is signed by the key in the Keyring referenced by a given name. A node ID and consensus pubkey may optionally be provided. If they are omitted, they will be retrieved from the priv_validator.json file. The following default parameters are included: %s @@ -152,7 +154,7 @@ $ %s gentx my-key-name 1000000stake --home=/path/to/home/dir --keyring-backend=o createValCfg.Amount = amount // create a 'create-validator' message - txBldr, msg, err := cli.BuildCreateValidatorMsg(clientCtx, createValCfg, txFactory, true) + txBldr, msg, err := cli.BuildCreateValidatorMsg(clientCtx, createValCfg, txFactory, true, valAdddressCodec) if err != nil { return errors.Wrap(err, "failed to build create-validator message") } @@ -214,6 +216,7 @@ $ %s gentx my-key-name 1000000stake --home=/path/to/home/dir --keyring-backend=o cmd.Flags().String(flags.FlagOutputDocument, "", "Write the genesis transaction JSON document to the given file instead of the default location") cmd.Flags().AddFlagSet(fsCreateValidator) flags.AddTxFlagsToCmd(cmd) + _ = cmd.Flags().MarkHidden(flags.FlagOutput) // signing makes sense to output only json return cmd } diff --git a/x/genutil/client/cli/gentx_test.go b/x/genutil/client/cli/gentx_test.go index c3fa2e63d68f..1f7ffeabce5a 100644 --- a/x/genutil/client/cli/gentx_test.go +++ b/x/genutil/client/cli/gentx_test.go @@ -7,13 +7,15 @@ import ( "path/filepath" "testing" - sdkmath "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" rpcclientmock "github.com/cometbft/cometbft/rpc/client/mock" "github.com/stretchr/testify/suite" + sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/crypto/keyring" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" @@ -126,6 +128,7 @@ func (s *CLITestSuite) TestGenTxCmd() { clientCtx.TxConfig, banktypes.GenesisBalancesIterator{}, clientCtx.HomeDir, + address.NewBech32Codec("cosmosvaloper"), ) cmd.SetContext(ctx) cmd.SetArgs(tc.args) diff --git a/x/genutil/client/cli/init.go b/x/genutil/client/cli/init.go index 37eda3cc719d..8e31e516f850 100644 --- a/x/genutil/client/cli/init.go +++ b/x/genutil/client/cli/init.go @@ -8,15 +8,18 @@ import ( "os" "path/filepath" - errorsmod "cosmossdk.io/errors" - "cosmossdk.io/math/unsafe" cfg "github.com/cometbft/cometbft/config" + cmttypes "github.com/cometbft/cometbft/types" "github.com/cosmos/go-bip39" "github.com/spf13/cobra" + errorsmod "cosmossdk.io/errors" + "cosmossdk.io/math/unsafe" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/input" + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" "github.com/cosmos/cosmos-sdk/server" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" @@ -34,6 +37,9 @@ const ( // FlagDefaultBondDenom defines the default denom to use in the genesis file. FlagDefaultBondDenom = "default-denom" + + // FlagConsensusKeyAlgo defines the algorithm to use for the consensus signing key. + FlagConsensusKeyAlgo = "consensus-key-algo" ) type printInfo struct { @@ -60,7 +66,7 @@ func displayInfo(info printInfo) error { return err } - _, err = fmt.Fprintf(os.Stderr, "%s\n", sdk.MustSortJSON(out)) + _, err = fmt.Fprintf(os.Stderr, "%s\n", out) return err } @@ -159,8 +165,16 @@ func InitCmd(mbm module.BasicManager, defaultNodeHome string) *cobra.Command { appGenesis.InitialHeight = initHeight appGenesis.Consensus = &types.ConsensusGenesis{ Validators: nil, + Params: cmttypes.DefaultConsensusParams(), } + consensusKey, err := cmd.Flags().GetString(FlagConsensusKeyAlgo) + if err != nil { + return errorsmod.Wrap(err, "Failed to get consensus key algo") + } + + appGenesis.Consensus.Params.Validator.PubKeyTypes = []string{consensusKey} + if err = genutil.ExportGenesisFile(appGenesis, genFile); err != nil { return errorsmod.Wrap(err, "Failed to export genesis file") } @@ -178,6 +192,7 @@ func InitCmd(mbm module.BasicManager, defaultNodeHome string) *cobra.Command { cmd.Flags().String(flags.FlagChainID, "", "genesis file chain-id, if left blank will be randomly created") cmd.Flags().String(FlagDefaultBondDenom, "", "genesis file default denomination, if left blank default value is 'stake'") cmd.Flags().Int64(flags.FlagInitHeight, 1, "specify the initial block height at genesis") + cmd.Flags().String(FlagConsensusKeyAlgo, ed25519.KeyType, "algorithm to use for the consensus key") return cmd } diff --git a/x/genutil/client/cli/init_test.go b/x/genutil/client/cli/init_test.go index d325a7c72eef..7ce1d29a4323 100644 --- a/x/genutil/client/cli/init_test.go +++ b/x/genutil/client/cli/init_test.go @@ -14,6 +14,7 @@ import ( "github.com/stretchr/testify/require" "cosmossdk.io/log" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/codec" diff --git a/x/genutil/client/cli/migrate.go b/x/genutil/client/cli/migrate.go index 56c8d3638335..b9427681e064 100644 --- a/x/genutil/client/cli/migrate.go +++ b/x/genutil/client/cli/migrate.go @@ -3,12 +3,12 @@ package cli import ( "encoding/json" "fmt" - "sort" + "maps" + "slices" "strings" "time" "github.com/spf13/cobra" - "golang.org/x/exp/maps" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" @@ -36,85 +36,10 @@ func MigrateGenesisCmd(migrations types.MigrationMap) *cobra.Command { Use: "migrate [target-version] [genesis-file]", Short: "Migrate genesis to a specified target version", Long: "Migrate the source genesis into the target version and print to STDOUT", - Example: fmt.Sprintf("%s migrate v0.47 /path/to/genesis.json --chain-id=cosmoshub-3 --genesis-time=2019-04-22T17:00:00Z", version.AppName), + Example: fmt.Sprintf("%s genesis migrate v0.47 /path/to/genesis.json --chain-id=cosmoshub-3 --genesis-time=2019-04-22T17:00:00Z", version.AppName), Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - - target := args[0] - migrationFunc, ok := migrations[target] - if !ok || migrationFunc == nil { - versions := maps.Keys(migrations) - sort.Strings(versions) - return fmt.Errorf("unknown migration function for version: %s (supported versions %s)", target, strings.Join(versions, ", ")) - } - - importGenesis := args[1] - appGenesis, err := types.AppGenesisFromFile(importGenesis) - if err != nil { - return err - } - - if err := appGenesis.ValidateAndComplete(); err != nil { - return fmt.Errorf("make sure that you have correctly migrated all CometBFT consensus params. Refer the UPGRADING.md (%s): %w", chainUpgradeGuide, err) - } - - // Since some default values are valid values, we just print to - // make sure the user didn't forget to update these values. - if appGenesis.Consensus.Params.Evidence.MaxBytes == 0 { - fmt.Printf("Warning: consensus.params.evidence.max_bytes is set to 0. If this is"+ - " deliberate, feel free to ignore this warning. If not, please have a look at the chain"+ - " upgrade guide at %s.\n", chainUpgradeGuide) - } - - var initialState types.AppMap - if err := json.Unmarshal(appGenesis.AppState, &initialState); err != nil { - return fmt.Errorf("failed to JSON unmarshal initial genesis state: %w", err) - } - - newGenState, err := migrationFunc(initialState, clientCtx) - if err != nil { - return fmt.Errorf("failed to migrate genesis state: %w", err) - } - - appGenesis.AppState, err = json.Marshal(newGenState) - if err != nil { - return fmt.Errorf("failed to JSON marshal migrated genesis state: %w", err) - } - - genesisTime, _ := cmd.Flags().GetString(flagGenesisTime) - if genesisTime != "" { - var t time.Time - - err := t.UnmarshalText([]byte(genesisTime)) - if err != nil { - return fmt.Errorf("failed to unmarshal genesis time: %w", err) - } - - appGenesis.GenesisTime = t - } - - chainID, _ := cmd.Flags().GetString(flags.FlagChainID) - if chainID != "" { - appGenesis.ChainID = chainID - } - - bz, err := json.Marshal(appGenesis) - if err != nil { - return fmt.Errorf("failed to marshal app genesis: %w", err) - } - - outputDocument, _ := cmd.Flags().GetString(flags.FlagOutputDocument) - if outputDocument == "" { - cmd.Println(string(bz)) - return nil - } - - if err = appGenesis.SaveAs(outputDocument); err != nil { - return err - } - - return nil + return MigrateHandler(cmd, args, migrations) }, } @@ -124,3 +49,83 @@ func MigrateGenesisCmd(migrations types.MigrationMap) *cobra.Command { return cmd } + +// MigrateHandler handles the migration command with a migration map as input, +// returning an error upon failure. +func MigrateHandler(cmd *cobra.Command, args []string, migrations types.MigrationMap) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + target := args[0] + migrationFunc, ok := migrations[target] + if !ok || migrationFunc == nil { + versions := slices.Sorted(maps.Keys(migrations)) + return fmt.Errorf("unknown migration function for version: %s (supported versions %s)", target, strings.Join(versions, ", ")) + } + + importGenesis := args[1] + appGenesis, err := types.AppGenesisFromFile(importGenesis) + if err != nil { + return err + } + + if err := appGenesis.ValidateAndComplete(); err != nil { + return fmt.Errorf("make sure that you have correctly migrated all CometBFT consensus params. Refer the UPGRADING.md (%s): %w", chainUpgradeGuide, err) + } + + // Since some default values are valid values, we just print to + // make sure the user didn't forget to update these values. + if appGenesis.Consensus.Params.Evidence.MaxBytes == 0 { + fmt.Printf("Warning: consensus.params.evidence.max_bytes is set to 0. If this is"+ + " deliberate, feel free to ignore this warning. If not, please have a look at the chain"+ + " upgrade guide at %s.\n", chainUpgradeGuide) + } + + var initialState types.AppMap + if err := json.Unmarshal(appGenesis.AppState, &initialState); err != nil { + return fmt.Errorf("failed to JSON unmarshal initial genesis state: %w", err) + } + + newGenState, err := migrationFunc(initialState, clientCtx) + if err != nil { + return fmt.Errorf("failed to migrate genesis state: %w", err) + } + + appGenesis.AppState, err = json.Marshal(newGenState) + if err != nil { + return fmt.Errorf("failed to JSON marshal migrated genesis state: %w", err) + } + + genesisTime, _ := cmd.Flags().GetString(flagGenesisTime) + if genesisTime != "" { + var t time.Time + + err := t.UnmarshalText([]byte(genesisTime)) + if err != nil { + return fmt.Errorf("failed to unmarshal genesis time: %w", err) + } + + appGenesis.GenesisTime = t + } + + chainID, _ := cmd.Flags().GetString(flags.FlagChainID) + if chainID != "" { + appGenesis.ChainID = chainID + } + + bz, err := json.Marshal(appGenesis) + if err != nil { + return fmt.Errorf("failed to marshal app genesis: %w", err) + } + + outputDocument, _ := cmd.Flags().GetString(flags.FlagOutputDocument) + if outputDocument == "" { + cmd.Println(string(bz)) + return nil + } + + if err = appGenesis.SaveAs(outputDocument); err != nil { + return err + } + + return nil +} diff --git a/x/genutil/client/cli/validate_genesis.go b/x/genutil/client/cli/validate_genesis.go index f3a57320ac16..94e9a3a04c31 100644 --- a/x/genutil/client/cli/validate_genesis.go +++ b/x/genutil/client/cli/validate_genesis.go @@ -2,7 +2,10 @@ package cli import ( "encoding/json" + "errors" "fmt" + "io" + "strings" "github.com/spf13/cobra" @@ -37,7 +40,7 @@ func ValidateGenesisCmd(mbm module.BasicManager) *cobra.Command { appGenesis, err := types.AppGenesisFromFile(genesis) if err != nil { - return err + return enrichUnmarshalError(err) } if err := appGenesis.ValidateAndComplete(); err != nil { @@ -45,12 +48,19 @@ func ValidateGenesisCmd(mbm module.BasicManager) *cobra.Command { } var genState map[string]json.RawMessage - if err = json.Unmarshal(appGenesis.AppState, &genState); err != nil { - return fmt.Errorf("error unmarshalling genesis doc %s: %s", genesis, err.Error()) + if err := json.Unmarshal(appGenesis.AppState, &genState); err != nil { + if strings.Contains(err.Error(), "unexpected end of JSON input") { + return fmt.Errorf("app_state is missing in the genesis file: %s", err.Error()) + } + return fmt.Errorf("error unmarshalling genesis doc %s: %w", genesis, err) } if err = mbm.ValidateGenesis(cdc, clientCtx.TxConfig, genState); err != nil { - return fmt.Errorf("error validating genesis file %s: %s", genesis, err.Error()) + errStr := fmt.Sprintf("error validating genesis file %s: %s", genesis, err.Error()) + if errors.Is(err, io.EOF) { + errStr = fmt.Sprintf("%s: section is missing in the app_state", errStr) + } + return fmt.Errorf("%s", errStr) } fmt.Fprintf(cmd.OutOrStdout(), "File at %s is a valid genesis file\n", genesis) @@ -58,3 +68,11 @@ func ValidateGenesisCmd(mbm module.BasicManager) *cobra.Command { }, } } + +func enrichUnmarshalError(err error) error { + var syntaxErr *json.SyntaxError + if errors.As(err, &syntaxErr) { + return fmt.Errorf("error at offset %d: %s", syntaxErr.Offset, syntaxErr.Error()) + } + return err +} diff --git a/x/genutil/client/cli/validate_genesis_test.go b/x/genutil/client/cli/validate_genesis_test.go index 140f72def21d..fba0338660cc 100644 --- a/x/genutil/client/cli/validate_genesis_test.go +++ b/x/genutil/client/cli/validate_genesis_test.go @@ -1,14 +1,20 @@ package cli_test import ( + "encoding/json" + "fmt" + "io" "os" "testing" + "github.com/stretchr/testify/require" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/testutil" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" - "github.com/stretchr/testify/require" ) // An example exported genesis file from a 0.37 chain. Note that evidence @@ -32,14 +38,33 @@ var v037Exported = `{ func TestValidateGenesis(t *testing.T) { testCases := []struct { - name string - genesis string - expErr bool + name string + genesis string + expErrStr string + basicManager module.BasicManager }{ + { + "invalid json", + `{"app_state": {x,}}`, + "error at offset 16: invalid character", + module.NewBasicManager(), + }, + { + "invalid: missing module config in app_state", + func() string { + bz, err := os.ReadFile("../../types/testdata/app_genesis.json") + require.NoError(t, err) + + return string(bz) + }(), + "section is missing in the app_state", + module.NewBasicManager(mockModule{}), + }, { "exported 0.37 genesis file", v037Exported, - true, + "make sure that you have correctly migrated all CometBFT consensus params", + module.NewBasicManager(), }, { "valid 0.50 genesis file", @@ -49,7 +74,8 @@ func TestValidateGenesis(t *testing.T) { return string(bz) }(), - false, + "", + module.NewBasicManager(), }, } @@ -58,12 +84,30 @@ func TestValidateGenesis(t *testing.T) { t.Run(tc.name, func(t *testing.T) { genesisFile := testutil.WriteToNewTempFile(t, tc.genesis) - _, err := clitestutil.ExecTestCLICmd(client.Context{}, cli.ValidateGenesisCmd(nil), []string{genesisFile.Name()}) - if tc.expErr { - require.Contains(t, err.Error(), "make sure that you have correctly migrated all CometBFT consensus params") + _, err := clitestutil.ExecTestCLICmd(client.Context{}, cli.ValidateGenesisCmd(tc.basicManager), []string{genesisFile.Name()}) + if tc.expErrStr != "" { + require.Contains(t, err.Error(), tc.expErrStr) } else { require.NoError(t, err) } }) } } + +var _ module.HasGenesisBasics = mockModule{} + +type mockModule struct { + module.AppModuleBasic +} + +func (m mockModule) Name() string { + return "mock" +} + +func (m mockModule) DefaultGenesis(codec.JSONCodec) json.RawMessage { + return json.RawMessage(`{"foo": "bar"}`) +} + +func (m mockModule) ValidateGenesis(codec.JSONCodec, client.TxEncodingConfig, json.RawMessage) error { + return fmt.Errorf("mock section is missing: %w", io.EOF) +} diff --git a/x/genutil/collect.go b/x/genutil/collect.go index d7fbf38dcdbb..422a278b5af3 100644 --- a/x/genutil/collect.go +++ b/x/genutil/collect.go @@ -14,6 +14,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" + sdkruntime "github.com/cosmos/cosmos-sdk/runtime" sdk "github.com/cosmos/cosmos-sdk/types" bankexported "github.com/cosmos/cosmos-sdk/x/bank/exported" "github.com/cosmos/cosmos-sdk/x/genutil/types" @@ -23,11 +24,11 @@ import ( // GenAppStateFromConfig gets the genesis app state from the config func GenAppStateFromConfig(cdc codec.JSONCodec, txEncodingConfig client.TxEncodingConfig, config *cfg.Config, initCfg types.InitConfig, genesis *types.AppGenesis, genBalIterator types.GenesisBalancesIterator, - validator types.MessageValidator, + validator types.MessageValidator, valAddrCodec sdkruntime.ValidatorAddressCodec, ) (appState json.RawMessage, err error) { // process genesis transactions, else create default genesis.json appGenTxs, persistentPeers, err := CollectTxs( - cdc, txEncodingConfig.TxJSONDecoder(), config.Moniker, initCfg.GenTxsDir, genesis, genBalIterator, validator) + cdc, txEncodingConfig.TxJSONDecoder(), config.Moniker, initCfg.GenTxsDir, genesis, genBalIterator, validator, valAddrCodec) if err != nil { return appState, err } @@ -66,7 +67,7 @@ func GenAppStateFromConfig(cdc codec.JSONCodec, txEncodingConfig client.TxEncodi // the list of appGenTxs, and persistent peers required to generate genesis.json. func CollectTxs(cdc codec.JSONCodec, txJSONDecoder sdk.TxDecoder, moniker, genTxsDir string, genesis *types.AppGenesis, genBalIterator types.GenesisBalancesIterator, - validator types.MessageValidator, + validator types.MessageValidator, valAddrCodec sdkruntime.ValidatorAddressCodec, ) (appGenTxs []sdk.Tx, persistentPeers string, err error) { // prepare a map of all balances in genesis state to then validate // against the validators addresses @@ -133,7 +134,7 @@ func CollectTxs(cdc codec.JSONCodec, txJSONDecoder sdk.TxDecoder, moniker, genTx msg := msgs[0].(*stakingtypes.MsgCreateValidator) // validate validator addresses and funds against the accounts in the state - valAddr, err := sdk.ValAddressFromBech32(msg.ValidatorAddress) + valAddr, err := valAddrCodec.StringToBytes(msg.ValidatorAddress) if err != nil { return appGenTxs, persistentPeers, err } diff --git a/x/genutil/collect_test.go b/x/genutil/collect_test.go index 3f0a32a07915..7c93df89c213 100644 --- a/x/genutil/collect_test.go +++ b/x/genutil/collect_test.go @@ -9,6 +9,7 @@ import ( "github.com/cosmos/gogoproto/proto" "github.com/cosmos/cosmos-sdk/codec" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/server" sdk "github.com/cosmos/cosmos-sdk/types" @@ -35,11 +36,7 @@ func (dni *doNothingIterator) IterateGenesisBalances(_ codec.JSONCodec, _ map[st // Ensures that CollectTx correctly traverses directories and won't error out on encountering // a directory during traversal of the first level. See issue https://github.com/cosmos/cosmos-sdk/issues/6788. func TestCollectTxsHandlesDirectories(t *testing.T) { - testDir, err := os.MkdirTemp(os.TempDir(), "testCollectTxs") - if err != nil { - t.Fatal(err) - } - defer os.RemoveAll(testDir) + testDir := t.TempDir() // 1. We'll insert a directory as the first element before JSON file. subDirPath := filepath.Join(testDir, "_adir") @@ -59,7 +56,8 @@ func TestCollectTxsHandlesDirectories(t *testing.T) { balItr := new(doNothingIterator) dnc := &doNothingUnmarshalJSON{cdc} - if _, _, err := genutil.CollectTxs(dnc, txDecoder, "foo", testDir, genesis, balItr, types.DefaultMessageValidator); err != nil { + if _, _, err := genutil.CollectTxs(dnc, txDecoder, "foo", testDir, genesis, balItr, types.DefaultMessageValidator, + addresscodec.NewBech32Codec("cosmosvaloper")); err != nil { t.Fatal(err) } } diff --git a/x/genutil/genaccounts.go b/x/genutil/genaccounts.go index 8e92ab61e9a9..e1b6075bc657 100644 --- a/x/genutil/genaccounts.go +++ b/x/genutil/genaccounts.go @@ -5,6 +5,8 @@ import ( "errors" "fmt" + "cosmossdk.io/core/address" + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -45,7 +47,10 @@ func AddGenesisAccount( baseAccount := authtypes.NewBaseAccount(accAddr, nil, 0, 0) if !vestingAmt.IsZero() { - baseVestingAccount := authvesting.NewBaseVestingAccount(baseAccount, vestingAmt.Sort(), vestingEnd) + baseVestingAccount, err := authvesting.NewBaseVestingAccount(baseAccount, vestingAmt.Sort(), vestingEnd) + if err != nil { + return fmt.Errorf("failed to create base vesting account: %w", err) + } if (balances.Coins.IsZero() && !baseVestingAccount.OriginalVesting.IsZero()) || baseVestingAccount.OriginalVesting.IsAnyGT(balances.Coins) { @@ -138,3 +143,151 @@ func AddGenesisAccount( appGenesis.AppState = appStateJSON return ExportGenesisFile(appGenesis, genesisFileURL) } + +type GenesisAccount struct { + // Base + Address string `json:"address"` + Coins sdk.Coins `json:"coins"` + + // Vesting + VestingAmt sdk.Coins `json:"vesting_amt,omitempty"` + VestingStart int64 `json:"vesting_start,omitempty"` + VestingEnd int64 `json:"vesting_end,omitempty"` + + // Module + ModuleName string `json:"module_name,omitempty"` +} + +// AddGenesisAccounts adds genesis accounts to the genesis state. +// Where `cdc` is the client codec, `accounts` are the genesis accounts to add, +// `appendAcct` updates the account if already exists, and `genesisFileURL` is the path/url of the current genesis file. +func AddGenesisAccounts( + cdc codec.Codec, + ac address.Codec, + accounts []GenesisAccount, + appendAcct bool, + genesisFileURL string, +) error { + appState, appGenesis, err := genutiltypes.GenesisStateFromGenFile(genesisFileURL) + if err != nil { + return fmt.Errorf("failed to unmarshal genesis state: %w", err) + } + + authGenState := authtypes.GetGenesisStateFromAppState(cdc, appState) + bankGenState := banktypes.GetGenesisStateFromAppState(cdc, appState) + + accs, err := authtypes.UnpackAccounts(authGenState.Accounts) + if err != nil { + return fmt.Errorf("failed to get accounts from any: %w", err) + } + + newSupplyCoinsCache := sdk.NewCoins() + balanceCache := make(map[string]banktypes.Balance) + for _, acc := range accs { + for _, balance := range bankGenState.GetBalances() { + if balance.Address == acc.GetAddress().String() { + balanceCache[acc.GetAddress().String()] = balance + } + } + } + + for _, acc := range accounts { + addr := acc.Address + coins := acc.Coins + + accAddr, err := ac.StringToBytes(addr) + if err != nil { + return fmt.Errorf("failed to parse account address %s: %w", addr, err) + } + + // create concrete account type based on input parameters + var genAccount authtypes.GenesisAccount + + balances := banktypes.Balance{Address: addr, Coins: coins.Sort()} + baseAccount := authtypes.NewBaseAccount(accAddr, nil, 0, 0) + + vestingAmt := acc.VestingAmt + if !vestingAmt.IsZero() { + vestingStart := acc.VestingStart + vestingEnd := acc.VestingEnd + + baseVestingAccount, err := authvesting.NewBaseVestingAccount(baseAccount, vestingAmt.Sort(), vestingEnd) + if err != nil { + return fmt.Errorf("failed to create base vesting account: %w", err) + } + + if (balances.Coins.IsZero() && !baseVestingAccount.OriginalVesting.IsZero()) || + baseVestingAccount.OriginalVesting.IsAnyGT(balances.Coins) { + return errors.New("vesting amount cannot be greater than total amount") + } + + switch { + case vestingStart != 0 && vestingEnd != 0: + genAccount = authvesting.NewContinuousVestingAccountRaw(baseVestingAccount, vestingStart) + + case vestingEnd != 0: + genAccount = authvesting.NewDelayedVestingAccountRaw(baseVestingAccount) + + default: + return errors.New("invalid vesting parameters; must supply start and end time or end time") + } + } else if acc.ModuleName != "" { + genAccount = authtypes.NewEmptyModuleAccount(acc.ModuleName, authtypes.Burner, authtypes.Minter) + } else { + genAccount = baseAccount + } + + if err := genAccount.Validate(); err != nil { + return fmt.Errorf("failed to validate new genesis account: %w", err) + } + + if _, ok := balanceCache[addr]; ok { + if !appendAcct { + return fmt.Errorf(" Account %s already exists\nUse `append` flag to append account at existing address", accAddr) + } + + for idx, acc := range bankGenState.Balances { + if acc.Address != addr { + continue + } + + updatedCoins := acc.Coins.Add(coins...) + bankGenState.Balances[idx] = banktypes.Balance{Address: addr, Coins: updatedCoins.Sort()} + break + } + } else { + accs = append(accs, genAccount) + bankGenState.Balances = append(bankGenState.Balances, balances) + } + + newSupplyCoinsCache = newSupplyCoinsCache.Add(coins...) + } + + accs = authtypes.SanitizeGenesisAccounts(accs) + + authGenState.Accounts, err = authtypes.PackAccounts(accs) + if err != nil { + return fmt.Errorf("failed to convert accounts into any's: %w", err) + } + + appState[authtypes.ModuleName], err = cdc.MarshalJSON(&authGenState) + if err != nil { + return fmt.Errorf("failed to marshal auth genesis state: %w", err) + } + + bankGenState.Balances = banktypes.SanitizeGenesisBalances(bankGenState.Balances) + bankGenState.Supply = bankGenState.Supply.Add(newSupplyCoinsCache...) + + appState[banktypes.ModuleName], err = cdc.MarshalJSON(bankGenState) + if err != nil { + return fmt.Errorf("failed to marshal bank genesis state: %w", err) + } + + appStateJSON, err := json.Marshal(appState) + if err != nil { + return fmt.Errorf("failed to marshal application genesis state: %w", err) + } + + appGenesis.AppState = appStateJSON + return ExportGenesisFile(appGenesis, genesisFileURL) +} diff --git a/x/genutil/genesis.go b/x/genutil/genesis.go index 97f71bd36ac9..0f8f7d4867f2 100644 --- a/x/genutil/genesis.go +++ b/x/genutil/genesis.go @@ -1,9 +1,10 @@ package genutil import ( - "cosmossdk.io/core/genesis" abci "github.com/cometbft/cometbft/abci/types" + "cosmossdk.io/core/genesis" + "github.com/cosmos/cosmos-sdk/client" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/genutil/types" diff --git a/x/genutil/gentx.go b/x/genutil/gentx.go index c5021e0b709c..e861ecac3512 100644 --- a/x/genutil/gentx.go +++ b/x/genutil/gentx.go @@ -5,9 +5,10 @@ import ( "fmt" "strings" - "cosmossdk.io/core/genesis" abci "github.com/cometbft/cometbft/abci/types" + "cosmossdk.io/core/genesis" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/genutil/gentx_test.go b/x/genutil/gentx_test.go index c01e8e74fae6..6f1e6a952fde 100644 --- a/x/genutil/gentx_test.go +++ b/x/genutil/gentx_test.go @@ -8,12 +8,12 @@ import ( "testing" "time" + "github.com/stretchr/testify/suite" + "go.uber.org/mock/gomock" + "cosmossdk.io/core/genesis" "cosmossdk.io/math" - storetypes "cosmossdk.io/store/types" - "github.com/golang/mock/gomock" - "github.com/stretchr/testify/suite" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" "github.com/cosmos/cosmos-sdk/testutil" @@ -65,10 +65,10 @@ func (suite *GenTxTestSuite) SetupTest() { amount := sdk.NewInt64Coin(sdk.DefaultBondDenom, 50) one := math.OneInt() suite.msg1, err = stakingtypes.NewMsgCreateValidator( - sdk.ValAddress(pk1.Address()), pk1, amount, desc, comm, one) + sdk.ValAddress(pk1.Address()).String(), pk1, amount, desc, comm, one) suite.NoError(err) suite.msg2, err = stakingtypes.NewMsgCreateValidator( - sdk.ValAddress(pk2.Address()), pk1, amount, desc, comm, one) + sdk.ValAddress(pk2.Address()).String(), pk1, amount, desc, comm, one) suite.NoError(err) } diff --git a/x/genutil/module.go b/x/genutil/module.go index 71cc30369bed..5d3337ba24ab 100644 --- a/x/genutil/module.go +++ b/x/genutil/module.go @@ -6,12 +6,10 @@ import ( abci "github.com/cometbft/cometbft/abci/types" gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" modulev1 "cosmossdk.io/api/cosmos/genutil/module/v1" "cosmossdk.io/core/appmodule" "cosmossdk.io/core/genesis" - "cosmossdk.io/depinject" "github.com/cosmos/cosmos-sdk/client" @@ -23,8 +21,10 @@ import ( ) var ( - _ module.AppModuleGenesis = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleBasic = AppModule{} + _ module.HasABCIGenesis = AppModule{} + + _ appmodule.AppModule = AppModule{} ) // AppModuleBasic defines the basic application module used by the genutil module. @@ -47,7 +47,7 @@ func (AppModuleBasic) Name() string { func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {} // RegisterInterfaces registers the module's interface types -func (b AppModuleBasic) RegisterInterfaces(_ cdctypes.InterfaceRegistry) {} +func (b AppModuleBasic) RegisterInterfaces(cdctypes.InterfaceRegistry) {} // DefaultGenesis returns default genesis state as raw bytes for the genutil // module. @@ -69,12 +69,6 @@ func (b AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, txEncodingConfig cl func (AppModuleBasic) RegisterGRPCGatewayRoutes(_ client.Context, _ *gwruntime.ServeMux) { } -// GetTxCmd returns no root tx command for the genutil module. -func (AppModuleBasic) GetTxCmd() *cobra.Command { return nil } - -// GetQueryCmd returns no root query command for the genutil module. -func (AppModuleBasic) GetQueryCmd() *cobra.Command { return nil } - // AppModule implements an application module for the genutil module. type AppModule struct { AppModuleBasic @@ -99,8 +93,6 @@ func NewAppModule(accountKeeper types.AccountKeeper, }) } -var _ appmodule.AppModule = AppModule{} - // IsOnePerModuleType implements the depinject.OnePerModuleType interface. func (AppModule) IsOnePerModuleType() {} diff --git a/x/genutil/testutil/expected_keepers_mocks.go b/x/genutil/testutil/expected_keepers_mocks.go index 1b33fb0d3092..52ba5af193d5 100644 --- a/x/genutil/testutil/expected_keepers_mocks.go +++ b/x/genutil/testutil/expected_keepers_mocks.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: x/genutil/types/expected_keepers.go +// +// Generated by this command: +// +// mockgen -source=x/genutil/types/expected_keepers.go -package testutil -destination x/genutil/testutil/expected_keepers_mocks.go +// // Package testutil is a generated GoMock package. package testutil @@ -13,13 +18,14 @@ import ( codec "github.com/cosmos/cosmos-sdk/codec" types0 "github.com/cosmos/cosmos-sdk/types" exported "github.com/cosmos/cosmos-sdk/x/bank/exported" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockStakingKeeper is a mock of StakingKeeper interface. type MockStakingKeeper struct { ctrl *gomock.Controller recorder *MockStakingKeeperMockRecorder + isgomock struct{} } // MockStakingKeeperMockRecorder is the mock recorder for MockStakingKeeper. @@ -40,7 +46,7 @@ func (m *MockStakingKeeper) EXPECT() *MockStakingKeeperMockRecorder { } // ApplyAndReturnValidatorSetUpdates mocks base method. -func (m *MockStakingKeeper) ApplyAndReturnValidatorSetUpdates(arg0 types0.Context) ([]types.ValidatorUpdate, error) { +func (m *MockStakingKeeper) ApplyAndReturnValidatorSetUpdates(arg0 context.Context) ([]types.ValidatorUpdate, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ApplyAndReturnValidatorSetUpdates", arg0) ret0, _ := ret[0].([]types.ValidatorUpdate) @@ -49,7 +55,7 @@ func (m *MockStakingKeeper) ApplyAndReturnValidatorSetUpdates(arg0 types0.Contex } // ApplyAndReturnValidatorSetUpdates indicates an expected call of ApplyAndReturnValidatorSetUpdates. -func (mr *MockStakingKeeperMockRecorder) ApplyAndReturnValidatorSetUpdates(arg0 interface{}) *gomock.Call { +func (mr *MockStakingKeeperMockRecorder) ApplyAndReturnValidatorSetUpdates(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ApplyAndReturnValidatorSetUpdates", reflect.TypeOf((*MockStakingKeeper)(nil).ApplyAndReturnValidatorSetUpdates), arg0) } @@ -58,6 +64,7 @@ func (mr *MockStakingKeeperMockRecorder) ApplyAndReturnValidatorSetUpdates(arg0 type MockAccountKeeper struct { ctrl *gomock.Controller recorder *MockAccountKeeperMockRecorder + isgomock struct{} } // MockAccountKeeperMockRecorder is the mock recorder for MockAccountKeeper. @@ -84,7 +91,7 @@ func (m *MockAccountKeeper) IterateAccounts(ctx context.Context, process func(ty } // IterateAccounts indicates an expected call of IterateAccounts. -func (mr *MockAccountKeeperMockRecorder) IterateAccounts(ctx, process interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) IterateAccounts(ctx, process any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateAccounts", reflect.TypeOf((*MockAccountKeeper)(nil).IterateAccounts), ctx, process) } @@ -98,7 +105,7 @@ func (m *MockAccountKeeper) NewAccount(arg0 context.Context, arg1 types0.Account } // NewAccount indicates an expected call of NewAccount. -func (mr *MockAccountKeeperMockRecorder) NewAccount(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) NewAccount(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewAccount", reflect.TypeOf((*MockAccountKeeper)(nil).NewAccount), arg0, arg1) } @@ -110,7 +117,7 @@ func (m *MockAccountKeeper) SetAccount(arg0 context.Context, arg1 types0.Account } // SetAccount indicates an expected call of SetAccount. -func (mr *MockAccountKeeperMockRecorder) SetAccount(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) SetAccount(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetAccount", reflect.TypeOf((*MockAccountKeeper)(nil).SetAccount), arg0, arg1) } @@ -119,6 +126,7 @@ func (mr *MockAccountKeeperMockRecorder) SetAccount(arg0, arg1 interface{}) *gom type MockGenesisAccountsIterator struct { ctrl *gomock.Controller recorder *MockGenesisAccountsIteratorMockRecorder + isgomock struct{} } // MockGenesisAccountsIteratorMockRecorder is the mock recorder for MockGenesisAccountsIterator. @@ -145,7 +153,7 @@ func (m *MockGenesisAccountsIterator) IterateGenesisAccounts(cdc *codec.LegacyAm } // IterateGenesisAccounts indicates an expected call of IterateGenesisAccounts. -func (mr *MockGenesisAccountsIteratorMockRecorder) IterateGenesisAccounts(cdc, appGenesis, cb interface{}) *gomock.Call { +func (mr *MockGenesisAccountsIteratorMockRecorder) IterateGenesisAccounts(cdc, appGenesis, cb any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateGenesisAccounts", reflect.TypeOf((*MockGenesisAccountsIterator)(nil).IterateGenesisAccounts), cdc, appGenesis, cb) } @@ -154,6 +162,7 @@ func (mr *MockGenesisAccountsIteratorMockRecorder) IterateGenesisAccounts(cdc, a type MockGenesisBalancesIterator struct { ctrl *gomock.Controller recorder *MockGenesisBalancesIteratorMockRecorder + isgomock struct{} } // MockGenesisBalancesIteratorMockRecorder is the mock recorder for MockGenesisBalancesIterator. @@ -180,7 +189,7 @@ func (m *MockGenesisBalancesIterator) IterateGenesisBalances(cdc codec.JSONCodec } // IterateGenesisBalances indicates an expected call of IterateGenesisBalances. -func (mr *MockGenesisBalancesIteratorMockRecorder) IterateGenesisBalances(cdc, appGenesis, cb interface{}) *gomock.Call { +func (mr *MockGenesisBalancesIteratorMockRecorder) IterateGenesisBalances(cdc, appGenesis, cb any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateGenesisBalances", reflect.TypeOf((*MockGenesisBalancesIterator)(nil).IterateGenesisBalances), cdc, appGenesis, cb) } diff --git a/x/genutil/types/chain_id.go b/x/genutil/types/chain_id.go new file mode 100644 index 000000000000..1d991a9f1416 --- /dev/null +++ b/x/genutil/types/chain_id.go @@ -0,0 +1,69 @@ +package types + +import ( + "encoding/json" + "errors" + "fmt" + "io" + "strings" + + "github.com/cometbft/cometbft/types" +) + +const ChainIDFieldName = "chain_id" + +// ParseChainIDFromGenesis parses the `chain_id` from a genesis JSON file, aborting early after finding the `chain_id`. +// For efficiency, it's recommended to place the `chain_id` field before any large entries in the JSON file. +// Returns an error if the `chain_id` field is not found. +func ParseChainIDFromGenesis(r io.Reader) (string, error) { + dec := json.NewDecoder(r) + + t, err := dec.Token() + if err != nil { + return "", err + } + if t != json.Delim('{') { + return "", fmt.Errorf("expected {, got %s", t) + } + + for dec.More() { + t, err = dec.Token() + if err != nil { + return "", err + } + key, ok := t.(string) + if !ok { + return "", fmt.Errorf("expected string for the key type, got %s", t) + } + + if key == ChainIDFieldName { + var chainID string + if err := dec.Decode(&chainID); err != nil { + return "", err + } + if err := validateChainID(chainID); err != nil { + return "", err + } + return chainID, nil + } + + // skip the value + var value json.RawMessage + if err := dec.Decode(&value); err != nil { + return "", err + } + } + + return "", errors.New("missing chain-id in genesis file") +} + +func validateChainID(chainID string) error { + if strings.TrimSpace(chainID) == "" { + return errors.New("genesis doc must include non-empty chain_id") + } + if len(chainID) > types.MaxChainIDLen { + return fmt.Errorf("chain_id in genesis doc is too long (max: %d)", types.MaxChainIDLen) + } + + return nil +} diff --git a/x/genutil/types/chain_id_test.go b/x/genutil/types/chain_id_test.go new file mode 100644 index 000000000000..46441e820a9e --- /dev/null +++ b/x/genutil/types/chain_id_test.go @@ -0,0 +1,130 @@ +package types_test + +import ( + _ "embed" + "strings" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/cosmos/cosmos-sdk/x/genutil/types" +) + +//go:embed testdata/parse_chain_id.json +var BenchmarkGenesis string + +func TestParseChainIDFromGenesis(t *testing.T) { + testCases := []struct { + name string + json string + expChainID string + expError string + }{ + { + "success", + `{ + "state": { + "accounts": { + "a": {} + } + }, + "chain_id": "test-chain-id" + }`, + "test-chain-id", + "", + }, + { + "nested", + `{ + "state": { + "accounts": { + "a": {} + }, + "chain_id": "test-chain-id" + } + }`, + "", + "missing chain-id in genesis file", + }, + { + "not exist", + `{ + "state": { + "accounts": { + "a": {} + } + }, + "chain-id": "test-chain-id" + }`, + "", + "missing chain-id in genesis file", + }, + { + "invalid type", + `{ + "chain-id": 1, + }`, + "", + "invalid character '}' looking for beginning of object key string", + }, + { + "invalid json", + `[ " ': }`, + "", + "expected {, got [", + }, + { + "empty chain_id", + `{"chain_id": ""}`, + "", + "genesis doc must include non-empty chain_id", + }, + { + "whitespace chain_id", + `{"chain_id": " "}`, + "", + "genesis doc must include non-empty chain_id", + }, + { + "chain_id too long", + `{"chain_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}`, + "", + "chain_id in genesis doc is too long", + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + chainID, err := types.ParseChainIDFromGenesis(strings.NewReader(tc.json)) + if tc.expChainID == "" { + require.Error(t, err) + require.Contains(t, err.Error(), tc.expError) + } else { + require.NoError(t, err) + require.Equal(t, tc.expChainID, chainID) + } + }) + } +} + +func BenchmarkParseChainID(b *testing.B) { + expChainID := "cronosmainnet_25-1" + b.ReportAllocs() + b.Run("new", func(b *testing.B) { + b.ResetTimer() + for i := 0; i < b.N; i++ { + chainID, err := types.ParseChainIDFromGenesis(strings.NewReader(BenchmarkGenesis)) + require.NoError(b, err) + require.Equal(b, expChainID, chainID) + } + }) + + b.Run("old", func(b *testing.B) { + b.ResetTimer() + for i := 0; i < b.N; i++ { + doc, err := types.AppGenesisFromReader(strings.NewReader(BenchmarkGenesis)) + require.NoError(b, err) + require.Equal(b, expChainID, doc.ChainID) + } + }) +} diff --git a/x/genutil/types/expected_keepers.go b/x/genutil/types/expected_keepers.go index 634109a7e1e5..3cffa44409ba 100644 --- a/x/genutil/types/expected_keepers.go +++ b/x/genutil/types/expected_keepers.go @@ -13,7 +13,7 @@ import ( // StakingKeeper defines the expected staking keeper (noalias) type StakingKeeper interface { - ApplyAndReturnValidatorSetUpdates(sdk.Context) (updates []abci.ValidatorUpdate, err error) + ApplyAndReturnValidatorSetUpdates(context.Context) (updates []abci.ValidatorUpdate, err error) } // AccountKeeper defines the expected account keeper (noalias) diff --git a/x/genutil/types/genesis.go b/x/genutil/types/genesis.go index 8b9d55a72b2f..3c322fa086fd 100644 --- a/x/genutil/types/genesis.go +++ b/x/genutil/types/genesis.go @@ -1,11 +1,14 @@ package types import ( + "bufio" "bytes" "encoding/json" "errors" "fmt" + "io" "os" + "path/filepath" "time" cmtjson "github.com/cometbft/cometbft/libs/json" @@ -85,11 +88,11 @@ func (ag *AppGenesis) SaveAs(file string) error { return os.WriteFile(file, appGenesisBytes, 0o600) } -// AppGenesisFromFile reads the AppGenesis from the provided file. -func AppGenesisFromFile(genFile string) (*AppGenesis, error) { - jsonBlob, err := os.ReadFile(genFile) +// AppGenesisFromReader reads the AppGenesis from the reader. +func AppGenesisFromReader(reader io.Reader) (*AppGenesis, error) { + jsonBlob, err := io.ReadAll(reader) if err != nil { - return nil, fmt.Errorf("couldn't read AppGenesis file (%s): %w", genFile, err) + return nil, err } var appGenesis AppGenesis @@ -97,10 +100,12 @@ func AppGenesisFromFile(genFile string) (*AppGenesis, error) { // fallback to CometBFT genesis var ctmGenesis cmttypes.GenesisDoc if err2 := cmtjson.Unmarshal(jsonBlob, &ctmGenesis); err2 != nil { - return nil, fmt.Errorf("error unmarshalling AppGenesis at %s: %w\n failed fallback to CometBFT GenDoc: %w", genFile, err, err2) + return nil, fmt.Errorf("error unmarshalling AppGenesis: %w\n failed fallback to CometBFT GenDoc: %w", err, err2) } appGenesis = AppGenesis{ + AppName: version.AppName, + // AppVersion is not filled as we do not know it from a CometBFT genesis GenesisTime: ctmGenesis.GenesisTime, ChainID: ctmGenesis.ChainID, InitialHeight: ctmGenesis.InitialHeight, @@ -116,6 +121,25 @@ func AppGenesisFromFile(genFile string) (*AppGenesis, error) { return &appGenesis, nil } +// AppGenesisFromFile reads the AppGenesis from the provided file. +func AppGenesisFromFile(genFile string) (*AppGenesis, error) { + file, err := os.Open(filepath.Clean(genFile)) + if err != nil { + return nil, err + } + + appGenesis, err := AppGenesisFromReader(bufio.NewReader(file)) + if err != nil { + return nil, fmt.Errorf("failed to read genesis from file %s: %w", genFile, err) + } + + if err := file.Close(); err != nil { + return nil, err + } + + return appGenesis, nil +} + // -------------------------- // CometBFT Genesis Handling // -------------------------- diff --git a/x/genutil/types/genesis_state.go b/x/genutil/types/genesis_state.go index 7e09237becc1..e9a6e6424d46 100644 --- a/x/genutil/types/genesis_state.go +++ b/x/genutil/types/genesis_state.go @@ -64,8 +64,8 @@ func SetGenesisStateInAppState( // for the application. // // NOTE: The pubkey input is this machines pubkey. -func GenesisStateFromAppGenesis(gesnsis *AppGenesis) (genesisState map[string]json.RawMessage, err error) { - if err = json.Unmarshal(gesnsis.AppState, &genesisState); err != nil { +func GenesisStateFromAppGenesis(genesis *AppGenesis) (genesisState map[string]json.RawMessage, err error) { + if err = json.Unmarshal(genesis.AppState, &genesisState); err != nil { return genesisState, err } return genesisState, nil diff --git a/x/genutil/types/genesis_state_test.go b/x/genutil/types/genesis_state_test.go index dc8b469732df..90660a44105e 100644 --- a/x/genutil/types/genesis_state_test.go +++ b/x/genutil/types/genesis_state_test.go @@ -4,10 +4,11 @@ import ( "encoding/json" "testing" - "cosmossdk.io/math" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" @@ -40,10 +41,10 @@ func TestValidateGenesisMultipleMessages(t *testing.T) { desc := stakingtypes.NewDescription("testname", "", "", "", "") comm := stakingtypes.CommissionRates{} - msg1, err := stakingtypes.NewMsgCreateValidator(sdk.ValAddress(pk1.Address()), pk1, sdk.NewInt64Coin(sdk.DefaultBondDenom, 50), desc, comm, math.OneInt()) + msg1, err := stakingtypes.NewMsgCreateValidator(sdk.ValAddress(pk1.Address()).String(), pk1, sdk.NewInt64Coin(sdk.DefaultBondDenom, 50), desc, comm, math.OneInt()) require.NoError(t, err) - msg2, err := stakingtypes.NewMsgCreateValidator(sdk.ValAddress(pk2.Address()), pk2, + msg2, err := stakingtypes.NewMsgCreateValidator(sdk.ValAddress(pk2.Address()).String(), pk2, sdk.NewInt64Coin(sdk.DefaultBondDenom, 50), desc, comm, math.OneInt()) require.NoError(t, err) @@ -61,7 +62,7 @@ func TestValidateGenesisMultipleMessages(t *testing.T) { func TestValidateGenesisBadMessage(t *testing.T) { desc := stakingtypes.NewDescription("testname", "", "", "", "") - msg1 := stakingtypes.NewMsgEditValidator(sdk.ValAddress(pk1.Address()), desc, nil, nil) + msg1 := stakingtypes.NewMsgEditValidator(sdk.ValAddress(pk1.Address()).String(), desc, nil, nil) txConfig := moduletestutil.MakeTestEncodingConfig(staking.AppModuleBasic{}, genutil.AppModuleBasic{}).TxConfig txBuilder := txConfig.NewTxBuilder() diff --git a/x/genutil/types/genesis_test.go b/x/genutil/types/genesis_test.go index 245568855717..c5c729380f3c 100644 --- a/x/genutil/types/genesis_test.go +++ b/x/genutil/types/genesis_test.go @@ -5,10 +5,10 @@ import ( "os" "testing" + cmttypes "github.com/cometbft/cometbft/types" "gotest.tools/v3/assert" "gotest.tools/v3/golden" - cmttypes "github.com/cometbft/cometbft/types" "github.com/cosmos/cosmos-sdk/x/genutil/types" ) diff --git a/x/genutil/types/testdata/app_genesis.json b/x/genutil/types/testdata/app_genesis.json index 9a686dbe4120..c6a64b0ac997 100644 --- a/x/genutil/types/testdata/app_genesis.json +++ b/x/genutil/types/testdata/app_genesis.json @@ -1 +1 @@ -{"app_name":"","app_version":"","genesis_time":"2023-02-20T11:08:30.588307671Z","chain_id":"demo","initial_height":48,"app_hash":"","app_state":{"auth":{"accounts":[{"@type":"/cosmos.auth.v1beta1.BaseAccount","account_number":"1","address":"cosmos1qmkksxlxqdslq6kkca25m4jn344nx29lytq8f9","pub_key":null,"sequence":"0"},{"@type":"/cosmos.auth.v1beta1.BaseAccount","account_number":"8","address":"cosmos1pnt5523etwtzv6mj7haryfw6w8h5tkcuhd99m8","pub_key":null,"sequence":"0"},{"@type":"/cosmos.auth.v1beta1.ModuleAccount","base_account":{"account_number":"4","address":"cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh","pub_key":null,"sequence":"0"},"name":"bonded_tokens_pool","permissions":["burner","staking"]},{"@type":"/cosmos.auth.v1beta1.ModuleAccount","base_account":{"account_number":"5","address":"cosmos1tygms3xhhs3yv487phx3dw4a95jn7t7lpm470r","pub_key":null,"sequence":"0"},"name":"not_bonded_tokens_pool","permissions":["burner","staking"]},{"@type":"/cosmos.auth.v1beta1.ModuleAccount","base_account":{"account_number":"6","address":"cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn","pub_key":null,"sequence":"0"},"name":"gov","permissions":["burner"]},{"@type":"/cosmos.auth.v1beta1.ModuleAccount","base_account":{"account_number":"3","address":"cosmos1jv65s3grqf6v6jl3dp4t6c9t9rk99cd88lyufl","pub_key":null,"sequence":"0"},"name":"distribution","permissions":[]},{"@type":"/cosmos.auth.v1beta1.BaseAccount","account_number":"0","address":"cosmos15jenkldw6348lpgdev3vjzw90zzknxa9a3vg0j","pub_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"A3uyZdXedyvYx9VCL6xRjkxtcFpgxjhXFIz9b2mWz+aV"},"sequence":"4"},{"@type":"/cosmos.auth.v1beta1.ModuleAccount","base_account":{"account_number":"7","address":"cosmos1m3h30wlvsf8llruxtpukdvsy0km2kum8g38c8q","pub_key":null,"sequence":"0"},"name":"mint","permissions":["minter"]},{"@type":"/cosmos.auth.v1beta1.ModuleAccount","base_account":{"account_number":"2","address":"cosmos17xpfvakm2amg962yls6f84z3kell8c5lserqta","pub_key":null,"sequence":"0"},"name":"fee_collector","permissions":[]}],"params":{"max_memo_characters":"256","sig_verify_cost_ed25519":"590","sig_verify_cost_secp256k1":"1000","tx_sig_limit":"7","tx_size_cost_per_byte":"10"}},"authz":{"authorization":[]},"bank":{"balances":[{"address":"cosmos1qmkksxlxqdslq6kkca25m4jn344nx29lytq8f9","coins":[{"amount":"5000000000","denom":"stake"}]},{"address":"cosmos1pnt5523etwtzv6mj7haryfw6w8h5tkcuhd99m8","coins":[{"amount":"1000","denom":"stake"}]},{"address":"cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh","coins":[{"amount":"1000000","denom":"stake"}]},{"address":"cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn","coins":[{"amount":"10010000","denom":"stake"}]},{"address":"cosmos1jv65s3grqf6v6jl3dp4t6c9t9rk99cd88lyufl","coins":[{"amount":"9635","denom":"stake"}]},{"address":"cosmos15jenkldw6348lpgdev3vjzw90zzknxa9a3vg0j","coins":[{"amount":"4988989000","denom":"stake"}]}],"denom_metadata":[],"params":{"default_send_enabled":true,"send_enabled":[]},"send_enabled":[],"supply":[{"amount":"10000009635","denom":"stake"}]},"consensus":null,"crisis":{"constant_fee":{"amount":"1000","denom":"stake"}},"distribution":{"delegator_starting_infos":[{"delegator_address":"cosmos15jenkldw6348lpgdev3vjzw90zzknxa9a3vg0j","starting_info":{"height":"0","previous_period":"1","stake":"1000000.000000000000000000"},"validator_address":"cosmosvaloper15jenkldw6348lpgdev3vjzw90zzknxa9c9carp"}],"delegator_withdraw_infos":[],"fee_pool":{"community_pool":[{"amount":"192.700000000000000000","denom":"stake"}]},"outstanding_rewards":[{"outstanding_rewards":[{"amount":"9442.300000000000000000","denom":"stake"}],"validator_address":"cosmosvaloper15jenkldw6348lpgdev3vjzw90zzknxa9c9carp"}],"params":{"base_proposer_reward":"0.000000000000000000","bonus_proposer_reward":"0.000000000000000000","community_tax":"0.020000000000000000","withdraw_addr_enabled":true},"previous_proposer":"cosmosvalcons16vm0nx49eam4q0xasdnwdzsdl6ymgyjt757sgr","validator_accumulated_commissions":[{"accumulated":{"commission":[{"amount":"944.230000000000000000","denom":"stake"}]},"validator_address":"cosmosvaloper15jenkldw6348lpgdev3vjzw90zzknxa9c9carp"}],"validator_current_rewards":[{"rewards":{"period":"2","rewards":[{"amount":"8498.070000000000000000","denom":"stake"}]},"validator_address":"cosmosvaloper15jenkldw6348lpgdev3vjzw90zzknxa9c9carp"}],"validator_historical_rewards":[{"period":"1","rewards":{"cumulative_reward_ratio":[],"reference_count":2},"validator_address":"cosmosvaloper15jenkldw6348lpgdev3vjzw90zzknxa9c9carp"}],"validator_slash_events":[]},"evidence":{"evidence":[]},"feegrant":{"allowances":[]},"genutil":{"gen_txs":[]},"gov":{"deposit_params":null,"deposits":[{"amount":[{"amount":"10010000","denom":"stake"}],"depositor":"cosmos15jenkldw6348lpgdev3vjzw90zzknxa9a3vg0j","proposal_id":"1"}],"params":{"expedited_min_deposit":[{"amount":"50000000","denom":"stake"}],"expedited_threshold":"0.667000000000000000","expedited_voting_period":"86400s","max_deposit_period":"172800s","min_deposit":[{"amount":"10000000","denom":"stake"}],"min_initial_deposit_ratio":"0.000000000000000000","proposal_cancel_dest":"","proposal_cancel_ratio":"0.500000000000000000","quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000","voting_period":"172800s"},"proposals":[{"deposit_end_time":"2023-02-22T11:11:52.776167376Z","expedited":false,"final_tally_result":{"abstain_count":"0","no_count":"0","no_with_veto_count":"0","yes_count":"0"},"id":"1","messages":[{"@type":"/cosmos.distribution.v1beta1.MsgCommunityPoolSpend","amount":[],"authority":"cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn","recipient":"cosmos1pnt5523etwtzv6mj7haryfw6w8h5tkcuhd99m8"}],"metadata":"ipfs://CID","proposer":"cosmos15jenkldw6348lpgdev3vjzw90zzknxa9a3vg0j","status":"PROPOSAL_STATUS_VOTING_PERIOD","submit_time":"2023-02-20T11:11:52.776167376Z","summary":"test proposal","title":"test proposal","total_deposit":[{"amount":"10010000","denom":"stake"}],"voting_end_time":"2023-02-22T11:12:07.801161984Z","voting_start_time":"2023-02-20T11:12:07.801161984Z"}],"starting_proposal_id":"2","tally_params":null,"votes":[],"voting_params":null},"group":{"group_members":[],"group_policies":[],"group_policy_seq":"0","group_seq":"0","groups":[],"proposal_seq":"0","proposals":[],"votes":[]},"mint":{"minter":{"annual_provisions":"1300010905.175073197786747950","inflation":"0.130000967926594565"},"params":{"blocks_per_year":"6311520","goal_bonded":"0.670000000000000000","inflation_max":"0.200000000000000000","inflation_min":"0.070000000000000000","inflation_rate_change":"0.130000000000000000","mint_denom":"stake"}},"nft":{"classes":[],"entries":[]},"params":null,"slashing":{"missed_blocks":[{"address":"cosmosvalcons16vm0nx49eam4q0xasdnwdzsdl6ymgyjt757sgr","missed_blocks":[]}],"params":{"downtime_jail_duration":"600s","min_signed_per_window":"0.500000000000000000","signed_blocks_window":"100","slash_fraction_double_sign":"0.050000000000000000","slash_fraction_downtime":"0.010000000000000000"},"signing_infos":[{"address":"cosmosvalcons16vm0nx49eam4q0xasdnwdzsdl6ymgyjt757sgr","validator_signing_info":{"address":"cosmosvalcons16vm0nx49eam4q0xasdnwdzsdl6ymgyjt757sgr","index_offset":"46","jailed_until":"1970-01-01T00:00:00Z","missed_blocks_counter":"0","start_height":"0","tombstoned":false}}]},"staking":{"delegations":[{"delegator_address":"cosmos15jenkldw6348lpgdev3vjzw90zzknxa9a3vg0j","shares":"1000000.000000000000000000","validator_address":"cosmosvaloper15jenkldw6348lpgdev3vjzw90zzknxa9c9carp"}],"exported":true,"last_total_power":"1","last_validator_powers":[{"address":"cosmosvaloper15jenkldw6348lpgdev3vjzw90zzknxa9c9carp","power":"1"}],"params":{"bond_denom":"stake","historical_entries":10000,"max_entries":7,"max_validators":100,"min_commission_rate":"0.000000000000000000","unbonding_time":"1814400s"},"redelegations":[],"unbonding_delegations":[],"validators":[{"commission":{"commission_rates":{"max_change_rate":"0.010000000000000000","max_rate":"0.200000000000000000","rate":"0.100000000000000000"},"update_time":"2023-02-20T11:08:30.588307671Z"},"consensus_pubkey":{"@type":"/cosmos.crypto.ed25519.PubKey","key":"tMZonPQYoooG/xbFVhHg95pTLxx7aO43/qgHFxDagWM="},"delegator_shares":"1000000.000000000000000000","description":{"details":"","identity":"","moniker":"test","security_contact":"","website":""},"jailed":false,"min_self_delegation":"1","operator_address":"cosmosvaloper15jenkldw6348lpgdev3vjzw90zzknxa9c9carp","status":"BOND_STATUS_BONDED","tokens":"1000000","unbonding_height":"0","unbonding_ids":[],"unbonding_on_hold_ref_count":"0","unbonding_time":"1970-01-01T00:00:00Z"}]},"upgrade":{},"vesting":{}},"consensus":{"validators":[{"address":"D336F99AA5CF77503CDD8366E68A0DFE89B4124B","pub_key":{"type":"tendermint/PubKeyEd25519","value":"tMZonPQYoooG/xbFVhHg95pTLxx7aO43/qgHFxDagWM="},"power":"1","name":"test"}],"params":{"block":{"max_bytes":"22020096","max_gas":"-1"},"evidence":{"max_age_num_blocks":"100000","max_age_duration":"172800000000000","max_bytes":"1048576"},"validator":{"pub_key_types":["ed25519"]},"version":{"app":"0"},"abci":{"vote_extensions_enable_height":"0"}}}} \ No newline at end of file +{"app_name":"\u003cappd\u003e","app_version":"","genesis_time":"2023-02-20T11:08:30.588307671Z","chain_id":"demo","initial_height":48,"app_hash":"","app_state":{"auth":{"accounts":[{"@type":"/cosmos.auth.v1beta1.BaseAccount","account_number":"1","address":"cosmos1qmkksxlxqdslq6kkca25m4jn344nx29lytq8f9","pub_key":null,"sequence":"0"},{"@type":"/cosmos.auth.v1beta1.BaseAccount","account_number":"8","address":"cosmos1pnt5523etwtzv6mj7haryfw6w8h5tkcuhd99m8","pub_key":null,"sequence":"0"},{"@type":"/cosmos.auth.v1beta1.ModuleAccount","base_account":{"account_number":"4","address":"cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh","pub_key":null,"sequence":"0"},"name":"bonded_tokens_pool","permissions":["burner","staking"]},{"@type":"/cosmos.auth.v1beta1.ModuleAccount","base_account":{"account_number":"5","address":"cosmos1tygms3xhhs3yv487phx3dw4a95jn7t7lpm470r","pub_key":null,"sequence":"0"},"name":"not_bonded_tokens_pool","permissions":["burner","staking"]},{"@type":"/cosmos.auth.v1beta1.ModuleAccount","base_account":{"account_number":"6","address":"cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn","pub_key":null,"sequence":"0"},"name":"gov","permissions":["burner"]},{"@type":"/cosmos.auth.v1beta1.ModuleAccount","base_account":{"account_number":"3","address":"cosmos1jv65s3grqf6v6jl3dp4t6c9t9rk99cd88lyufl","pub_key":null,"sequence":"0"},"name":"distribution","permissions":[]},{"@type":"/cosmos.auth.v1beta1.BaseAccount","account_number":"0","address":"cosmos15jenkldw6348lpgdev3vjzw90zzknxa9a3vg0j","pub_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"A3uyZdXedyvYx9VCL6xRjkxtcFpgxjhXFIz9b2mWz+aV"},"sequence":"4"},{"@type":"/cosmos.auth.v1beta1.ModuleAccount","base_account":{"account_number":"7","address":"cosmos1m3h30wlvsf8llruxtpukdvsy0km2kum8g38c8q","pub_key":null,"sequence":"0"},"name":"mint","permissions":["minter"]},{"@type":"/cosmos.auth.v1beta1.ModuleAccount","base_account":{"account_number":"2","address":"cosmos17xpfvakm2amg962yls6f84z3kell8c5lserqta","pub_key":null,"sequence":"0"},"name":"fee_collector","permissions":[]}],"params":{"max_memo_characters":"256","sig_verify_cost_ed25519":"590","sig_verify_cost_secp256k1":"1000","tx_sig_limit":"7","tx_size_cost_per_byte":"10"}},"authz":{"authorization":[]},"bank":{"balances":[{"address":"cosmos1qmkksxlxqdslq6kkca25m4jn344nx29lytq8f9","coins":[{"amount":"5000000000","denom":"stake"}]},{"address":"cosmos1pnt5523etwtzv6mj7haryfw6w8h5tkcuhd99m8","coins":[{"amount":"1000","denom":"stake"}]},{"address":"cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh","coins":[{"amount":"1000000","denom":"stake"}]},{"address":"cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn","coins":[{"amount":"10010000","denom":"stake"}]},{"address":"cosmos1jv65s3grqf6v6jl3dp4t6c9t9rk99cd88lyufl","coins":[{"amount":"9635","denom":"stake"}]},{"address":"cosmos15jenkldw6348lpgdev3vjzw90zzknxa9a3vg0j","coins":[{"amount":"4988989000","denom":"stake"}]}],"denom_metadata":[],"params":{"default_send_enabled":true,"send_enabled":[]},"send_enabled":[],"supply":[{"amount":"10000009635","denom":"stake"}]},"consensus":null,"distribution":{"delegator_starting_infos":[{"delegator_address":"cosmos15jenkldw6348lpgdev3vjzw90zzknxa9a3vg0j","starting_info":{"height":"0","previous_period":"1","stake":"1000000.000000000000000000"},"validator_address":"cosmosvaloper15jenkldw6348lpgdev3vjzw90zzknxa9c9carp"}],"delegator_withdraw_infos":[],"fee_pool":{"community_pool":[{"amount":"192.700000000000000000","denom":"stake"}]},"outstanding_rewards":[{"outstanding_rewards":[{"amount":"9442.300000000000000000","denom":"stake"}],"validator_address":"cosmosvaloper15jenkldw6348lpgdev3vjzw90zzknxa9c9carp"}],"params":{"base_proposer_reward":"0.000000000000000000","bonus_proposer_reward":"0.000000000000000000","community_tax":"0.020000000000000000","withdraw_addr_enabled":true},"previous_proposer":"cosmosvalcons16vm0nx49eam4q0xasdnwdzsdl6ymgyjt757sgr","validator_accumulated_commissions":[{"accumulated":{"commission":[{"amount":"944.230000000000000000","denom":"stake"}]},"validator_address":"cosmosvaloper15jenkldw6348lpgdev3vjzw90zzknxa9c9carp"}],"validator_current_rewards":[{"rewards":{"period":"2","rewards":[{"amount":"8498.070000000000000000","denom":"stake"}]},"validator_address":"cosmosvaloper15jenkldw6348lpgdev3vjzw90zzknxa9c9carp"}],"validator_historical_rewards":[{"period":"1","rewards":{"cumulative_reward_ratio":[],"reference_count":2},"validator_address":"cosmosvaloper15jenkldw6348lpgdev3vjzw90zzknxa9c9carp"}],"validator_slash_events":[]},"evidence":{"evidence":[]},"feegrant":{"allowances":[]},"genutil":{"gen_txs":[]},"gov":{"deposit_params":null,"deposits":[{"amount":[{"amount":"10010000","denom":"stake"}],"depositor":"cosmos15jenkldw6348lpgdev3vjzw90zzknxa9a3vg0j","proposal_id":"1"}],"params":{"expedited_min_deposit":[{"amount":"50000000","denom":"stake"}],"expedited_threshold":"0.667000000000000000","expedited_voting_period":"86400s","max_deposit_period":"172800s","min_deposit":[{"amount":"10000000","denom":"stake"}],"min_initial_deposit_ratio":"0.000000000000000000","proposal_cancel_dest":"","proposal_cancel_ratio":"0.500000000000000000","quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000","voting_period":"172800s"},"proposals":[{"deposit_end_time":"2023-02-22T11:11:52.776167376Z","expedited":false,"final_tally_result":{"abstain_count":"0","no_count":"0","no_with_veto_count":"0","yes_count":"0"},"id":"1","messages":[{"@type":"/cosmos.distribution.v1beta1.MsgCommunityPoolSpend","amount":[],"authority":"cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn","recipient":"cosmos1pnt5523etwtzv6mj7haryfw6w8h5tkcuhd99m8"}],"metadata":"ipfs://CID","proposer":"cosmos15jenkldw6348lpgdev3vjzw90zzknxa9a3vg0j","status":"PROPOSAL_STATUS_VOTING_PERIOD","submit_time":"2023-02-20T11:11:52.776167376Z","summary":"test proposal","title":"test proposal","total_deposit":[{"amount":"10010000","denom":"stake"}],"voting_end_time":"2023-02-22T11:12:07.801161984Z","voting_start_time":"2023-02-20T11:12:07.801161984Z"}],"starting_proposal_id":"2","tally_params":null,"votes":[],"voting_params":null},"group":{"group_members":[],"group_policies":[],"group_policy_seq":"0","group_seq":"0","groups":[],"proposal_seq":"0","proposals":[],"votes":[]},"mint":{"minter":{"annual_provisions":"1300010905.175073197786747950","inflation":"0.130000967926594565"},"params":{"blocks_per_year":"6311520","goal_bonded":"0.670000000000000000","inflation_max":"0.200000000000000000","inflation_min":"0.070000000000000000","inflation_rate_change":"0.130000000000000000","mint_denom":"stake"}},"nft":{"classes":[],"entries":[]},"params":null,"slashing":{"missed_blocks":[{"address":"cosmosvalcons16vm0nx49eam4q0xasdnwdzsdl6ymgyjt757sgr","missed_blocks":[]}],"params":{"downtime_jail_duration":"600s","min_signed_per_window":"0.500000000000000000","signed_blocks_window":"100","slash_fraction_double_sign":"0.050000000000000000","slash_fraction_downtime":"0.010000000000000000"},"signing_infos":[{"address":"cosmosvalcons16vm0nx49eam4q0xasdnwdzsdl6ymgyjt757sgr","validator_signing_info":{"address":"cosmosvalcons16vm0nx49eam4q0xasdnwdzsdl6ymgyjt757sgr","index_offset":"46","jailed_until":"1970-01-01T00:00:00Z","missed_blocks_counter":"0","start_height":"0","tombstoned":false}}]},"staking":{"delegations":[{"delegator_address":"cosmos15jenkldw6348lpgdev3vjzw90zzknxa9a3vg0j","shares":"1000000.000000000000000000","validator_address":"cosmosvaloper15jenkldw6348lpgdev3vjzw90zzknxa9c9carp"}],"exported":true,"last_total_power":"1","last_validator_powers":[{"address":"cosmosvaloper15jenkldw6348lpgdev3vjzw90zzknxa9c9carp","power":"1"}],"params":{"bond_denom":"stake","historical_entries":10000,"max_entries":7,"max_validators":100,"min_commission_rate":"0.000000000000000000","unbonding_time":"1814400s"},"redelegations":[],"unbonding_delegations":[],"validators":[{"commission":{"commission_rates":{"max_change_rate":"0.010000000000000000","max_rate":"0.200000000000000000","rate":"0.100000000000000000"},"update_time":"2023-02-20T11:08:30.588307671Z"},"consensus_pubkey":{"@type":"/cosmos.crypto.ed25519.PubKey","key":"tMZonPQYoooG/xbFVhHg95pTLxx7aO43/qgHFxDagWM="},"delegator_shares":"1000000.000000000000000000","description":{"details":"","identity":"","moniker":"test","security_contact":"","website":""},"jailed":false,"min_self_delegation":"1","operator_address":"cosmosvaloper15jenkldw6348lpgdev3vjzw90zzknxa9c9carp","status":"BOND_STATUS_BONDED","tokens":"1000000","unbonding_height":"0","unbonding_ids":[],"unbonding_on_hold_ref_count":"0","unbonding_time":"1970-01-01T00:00:00Z"}]},"upgrade":{},"vesting":{}},"consensus":{"validators":[{"address":"D336F99AA5CF77503CDD8366E68A0DFE89B4124B","pub_key":{"type":"tendermint/PubKeyEd25519","value":"tMZonPQYoooG/xbFVhHg95pTLxx7aO43/qgHFxDagWM="},"power":"1","name":"test"}],"params":{"block":{"max_bytes":"22020096","max_gas":"-1"},"evidence":{"max_age_num_blocks":"100000","max_age_duration":"172800000000000","max_bytes":"1048576"},"validator":{"pub_key_types":["ed25519"]},"version":{"app":"0"},"abci":{"vote_extensions_enable_height":"0"}}}} \ No newline at end of file diff --git a/x/genutil/types/testdata/cmt_genesis.json b/x/genutil/types/testdata/cmt_genesis.json index aae3d84d0698..22e02170ca17 100644 --- a/x/genutil/types/testdata/cmt_genesis.json +++ b/x/genutil/types/testdata/cmt_genesis.json @@ -1 +1 @@ -{"app_hash":"","app_state":{"auth":{"accounts":[{"@type":"/cosmos.auth.v1beta1.BaseAccount","account_number":"1","address":"cosmos1qmkksxlxqdslq6kkca25m4jn344nx29lytq8f9","pub_key":null,"sequence":"0"},{"@type":"/cosmos.auth.v1beta1.BaseAccount","account_number":"8","address":"cosmos1pnt5523etwtzv6mj7haryfw6w8h5tkcuhd99m8","pub_key":null,"sequence":"0"},{"@type":"/cosmos.auth.v1beta1.ModuleAccount","base_account":{"account_number":"4","address":"cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh","pub_key":null,"sequence":"0"},"name":"bonded_tokens_pool","permissions":["burner","staking"]},{"@type":"/cosmos.auth.v1beta1.ModuleAccount","base_account":{"account_number":"5","address":"cosmos1tygms3xhhs3yv487phx3dw4a95jn7t7lpm470r","pub_key":null,"sequence":"0"},"name":"not_bonded_tokens_pool","permissions":["burner","staking"]},{"@type":"/cosmos.auth.v1beta1.ModuleAccount","base_account":{"account_number":"6","address":"cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn","pub_key":null,"sequence":"0"},"name":"gov","permissions":["burner"]},{"@type":"/cosmos.auth.v1beta1.ModuleAccount","base_account":{"account_number":"3","address":"cosmos1jv65s3grqf6v6jl3dp4t6c9t9rk99cd88lyufl","pub_key":null,"sequence":"0"},"name":"distribution","permissions":[]},{"@type":"/cosmos.auth.v1beta1.BaseAccount","account_number":"0","address":"cosmos15jenkldw6348lpgdev3vjzw90zzknxa9a3vg0j","pub_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"A3uyZdXedyvYx9VCL6xRjkxtcFpgxjhXFIz9b2mWz+aV"},"sequence":"4"},{"@type":"/cosmos.auth.v1beta1.ModuleAccount","base_account":{"account_number":"7","address":"cosmos1m3h30wlvsf8llruxtpukdvsy0km2kum8g38c8q","pub_key":null,"sequence":"0"},"name":"mint","permissions":["minter"]},{"@type":"/cosmos.auth.v1beta1.ModuleAccount","base_account":{"account_number":"2","address":"cosmos17xpfvakm2amg962yls6f84z3kell8c5lserqta","pub_key":null,"sequence":"0"},"name":"fee_collector","permissions":[]}],"params":{"max_memo_characters":"256","sig_verify_cost_ed25519":"590","sig_verify_cost_secp256k1":"1000","tx_sig_limit":"7","tx_size_cost_per_byte":"10"}},"authz":{"authorization":[]},"bank":{"balances":[{"address":"cosmos1qmkksxlxqdslq6kkca25m4jn344nx29lytq8f9","coins":[{"amount":"5000000000","denom":"stake"}]},{"address":"cosmos1pnt5523etwtzv6mj7haryfw6w8h5tkcuhd99m8","coins":[{"amount":"1000","denom":"stake"}]},{"address":"cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh","coins":[{"amount":"1000000","denom":"stake"}]},{"address":"cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn","coins":[{"amount":"10010000","denom":"stake"}]},{"address":"cosmos1jv65s3grqf6v6jl3dp4t6c9t9rk99cd88lyufl","coins":[{"amount":"9635","denom":"stake"}]},{"address":"cosmos15jenkldw6348lpgdev3vjzw90zzknxa9a3vg0j","coins":[{"amount":"4988989000","denom":"stake"}]}],"denom_metadata":[],"params":{"default_send_enabled":true,"send_enabled":[]},"send_enabled":[],"supply":[{"amount":"10000009635","denom":"stake"}]},"consensus":null,"crisis":{"constant_fee":{"amount":"1000","denom":"stake"}},"distribution":{"delegator_starting_infos":[{"delegator_address":"cosmos15jenkldw6348lpgdev3vjzw90zzknxa9a3vg0j","starting_info":{"height":"0","previous_period":"1","stake":"1000000.000000000000000000"},"validator_address":"cosmosvaloper15jenkldw6348lpgdev3vjzw90zzknxa9c9carp"}],"delegator_withdraw_infos":[],"fee_pool":{"community_pool":[{"amount":"192.700000000000000000","denom":"stake"}]},"outstanding_rewards":[{"outstanding_rewards":[{"amount":"9442.300000000000000000","denom":"stake"}],"validator_address":"cosmosvaloper15jenkldw6348lpgdev3vjzw90zzknxa9c9carp"}],"params":{"base_proposer_reward":"0.000000000000000000","bonus_proposer_reward":"0.000000000000000000","community_tax":"0.020000000000000000","withdraw_addr_enabled":true},"previous_proposer":"cosmosvalcons16vm0nx49eam4q0xasdnwdzsdl6ymgyjt757sgr","validator_accumulated_commissions":[{"accumulated":{"commission":[{"amount":"944.230000000000000000","denom":"stake"}]},"validator_address":"cosmosvaloper15jenkldw6348lpgdev3vjzw90zzknxa9c9carp"}],"validator_current_rewards":[{"rewards":{"period":"2","rewards":[{"amount":"8498.070000000000000000","denom":"stake"}]},"validator_address":"cosmosvaloper15jenkldw6348lpgdev3vjzw90zzknxa9c9carp"}],"validator_historical_rewards":[{"period":"1","rewards":{"cumulative_reward_ratio":[],"reference_count":2},"validator_address":"cosmosvaloper15jenkldw6348lpgdev3vjzw90zzknxa9c9carp"}],"validator_slash_events":[]},"evidence":{"evidence":[]},"feegrant":{"allowances":[]},"genutil":{"gen_txs":[]},"gov":{"deposit_params":null,"deposits":[{"amount":[{"amount":"10010000","denom":"stake"}],"depositor":"cosmos15jenkldw6348lpgdev3vjzw90zzknxa9a3vg0j","proposal_id":"1"}],"params":{"expedited_min_deposit":[{"amount":"50000000","denom":"stake"}],"expedited_threshold":"0.667000000000000000","expedited_voting_period":"86400s","max_deposit_period":"172800s","min_deposit":[{"amount":"10000000","denom":"stake"}],"min_initial_deposit_ratio":"0.000000000000000000","proposal_cancel_dest":"","proposal_cancel_ratio":"0.500000000000000000","quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000","voting_period":"172800s"},"proposals":[{"deposit_end_time":"2023-02-22T11:11:52.776167376Z","expedited":false,"final_tally_result":{"abstain_count":"0","no_count":"0","no_with_veto_count":"0","yes_count":"0"},"id":"1","messages":[{"@type":"/cosmos.distribution.v1beta1.MsgCommunityPoolSpend","amount":[],"authority":"cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn","recipient":"cosmos1pnt5523etwtzv6mj7haryfw6w8h5tkcuhd99m8"}],"metadata":"ipfs://CID","proposer":"cosmos15jenkldw6348lpgdev3vjzw90zzknxa9a3vg0j","status":"PROPOSAL_STATUS_VOTING_PERIOD","submit_time":"2023-02-20T11:11:52.776167376Z","summary":"test proposal","title":"test proposal","total_deposit":[{"amount":"10010000","denom":"stake"}],"voting_end_time":"2023-02-22T11:12:07.801161984Z","voting_start_time":"2023-02-20T11:12:07.801161984Z"}],"starting_proposal_id":"2","tally_params":null,"votes":[],"voting_params":null},"group":{"group_members":[],"group_policies":[],"group_policy_seq":"0","group_seq":"0","groups":[],"proposal_seq":"0","proposals":[],"votes":[]},"mint":{"minter":{"annual_provisions":"1300010905.175073197786747950","inflation":"0.130000967926594565"},"params":{"blocks_per_year":"6311520","goal_bonded":"0.670000000000000000","inflation_max":"0.200000000000000000","inflation_min":"0.070000000000000000","inflation_rate_change":"0.130000000000000000","mint_denom":"stake"}},"nft":{"classes":[],"entries":[]},"params":null,"slashing":{"missed_blocks":[{"address":"cosmosvalcons16vm0nx49eam4q0xasdnwdzsdl6ymgyjt757sgr","missed_blocks":[]}],"params":{"downtime_jail_duration":"600s","min_signed_per_window":"0.500000000000000000","signed_blocks_window":"100","slash_fraction_double_sign":"0.050000000000000000","slash_fraction_downtime":"0.010000000000000000"},"signing_infos":[{"address":"cosmosvalcons16vm0nx49eam4q0xasdnwdzsdl6ymgyjt757sgr","validator_signing_info":{"address":"cosmosvalcons16vm0nx49eam4q0xasdnwdzsdl6ymgyjt757sgr","index_offset":"46","jailed_until":"1970-01-01T00:00:00Z","missed_blocks_counter":"0","start_height":"0","tombstoned":false}}]},"staking":{"delegations":[{"delegator_address":"cosmos15jenkldw6348lpgdev3vjzw90zzknxa9a3vg0j","shares":"1000000.000000000000000000","validator_address":"cosmosvaloper15jenkldw6348lpgdev3vjzw90zzknxa9c9carp"}],"exported":true,"last_total_power":"1","last_validator_powers":[{"address":"cosmosvaloper15jenkldw6348lpgdev3vjzw90zzknxa9c9carp","power":"1"}],"params":{"bond_denom":"stake","historical_entries":10000,"max_entries":7,"max_validators":100,"min_commission_rate":"0.000000000000000000","unbonding_time":"1814400s"},"redelegations":[],"unbonding_delegations":[],"validators":[{"commission":{"commission_rates":{"max_change_rate":"0.010000000000000000","max_rate":"0.200000000000000000","rate":"0.100000000000000000"},"update_time":"2023-02-20T11:08:30.588307671Z"},"consensus_pubkey":{"@type":"/cosmos.crypto.ed25519.PubKey","key":"tMZonPQYoooG/xbFVhHg95pTLxx7aO43/qgHFxDagWM="},"delegator_shares":"1000000.000000000000000000","description":{"details":"","identity":"","moniker":"test","security_contact":"","website":""},"jailed":false,"min_self_delegation":"1","operator_address":"cosmosvaloper15jenkldw6348lpgdev3vjzw90zzknxa9c9carp","status":"BOND_STATUS_BONDED","tokens":"1000000","unbonding_height":"0","unbonding_ids":[],"unbonding_on_hold_ref_count":"0","unbonding_time":"1970-01-01T00:00:00Z"}]},"upgrade":{},"vesting":{}},"chain_id":"demo","consensus_params":{"block":{"max_bytes":"22020096","max_gas":"-1"},"evidence":{"max_age_duration":"172800000000000","max_age_num_blocks":"100000","max_bytes":"1048576"},"validator":{"pub_key_types":["ed25519"]},"version":{"app":"0"}},"genesis_time":"2023-02-20T11:08:30.588307671Z","initial_height":"48","validators":[{"address":"D336F99AA5CF77503CDD8366E68A0DFE89B4124B","name":"test","power":"1","pub_key":{"type":"tendermint/PubKeyEd25519","value":"tMZonPQYoooG/xbFVhHg95pTLxx7aO43/qgHFxDagWM="}}]} \ No newline at end of file +{"app_hash":"","app_state":{"auth":{"accounts":[{"@type":"/cosmos.auth.v1beta1.BaseAccount","account_number":"1","address":"cosmos1qmkksxlxqdslq6kkca25m4jn344nx29lytq8f9","pub_key":null,"sequence":"0"},{"@type":"/cosmos.auth.v1beta1.BaseAccount","account_number":"8","address":"cosmos1pnt5523etwtzv6mj7haryfw6w8h5tkcuhd99m8","pub_key":null,"sequence":"0"},{"@type":"/cosmos.auth.v1beta1.ModuleAccount","base_account":{"account_number":"4","address":"cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh","pub_key":null,"sequence":"0"},"name":"bonded_tokens_pool","permissions":["burner","staking"]},{"@type":"/cosmos.auth.v1beta1.ModuleAccount","base_account":{"account_number":"5","address":"cosmos1tygms3xhhs3yv487phx3dw4a95jn7t7lpm470r","pub_key":null,"sequence":"0"},"name":"not_bonded_tokens_pool","permissions":["burner","staking"]},{"@type":"/cosmos.auth.v1beta1.ModuleAccount","base_account":{"account_number":"6","address":"cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn","pub_key":null,"sequence":"0"},"name":"gov","permissions":["burner"]},{"@type":"/cosmos.auth.v1beta1.ModuleAccount","base_account":{"account_number":"3","address":"cosmos1jv65s3grqf6v6jl3dp4t6c9t9rk99cd88lyufl","pub_key":null,"sequence":"0"},"name":"distribution","permissions":[]},{"@type":"/cosmos.auth.v1beta1.BaseAccount","account_number":"0","address":"cosmos15jenkldw6348lpgdev3vjzw90zzknxa9a3vg0j","pub_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"A3uyZdXedyvYx9VCL6xRjkxtcFpgxjhXFIz9b2mWz+aV"},"sequence":"4"},{"@type":"/cosmos.auth.v1beta1.ModuleAccount","base_account":{"account_number":"7","address":"cosmos1m3h30wlvsf8llruxtpukdvsy0km2kum8g38c8q","pub_key":null,"sequence":"0"},"name":"mint","permissions":["minter"]},{"@type":"/cosmos.auth.v1beta1.ModuleAccount","base_account":{"account_number":"2","address":"cosmos17xpfvakm2amg962yls6f84z3kell8c5lserqta","pub_key":null,"sequence":"0"},"name":"fee_collector","permissions":[]}],"params":{"max_memo_characters":"256","sig_verify_cost_ed25519":"590","sig_verify_cost_secp256k1":"1000","tx_sig_limit":"7","tx_size_cost_per_byte":"10"}},"authz":{"authorization":[]},"bank":{"balances":[{"address":"cosmos1qmkksxlxqdslq6kkca25m4jn344nx29lytq8f9","coins":[{"amount":"5000000000","denom":"stake"}]},{"address":"cosmos1pnt5523etwtzv6mj7haryfw6w8h5tkcuhd99m8","coins":[{"amount":"1000","denom":"stake"}]},{"address":"cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh","coins":[{"amount":"1000000","denom":"stake"}]},{"address":"cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn","coins":[{"amount":"10010000","denom":"stake"}]},{"address":"cosmos1jv65s3grqf6v6jl3dp4t6c9t9rk99cd88lyufl","coins":[{"amount":"9635","denom":"stake"}]},{"address":"cosmos15jenkldw6348lpgdev3vjzw90zzknxa9a3vg0j","coins":[{"amount":"4988989000","denom":"stake"}]}],"denom_metadata":[],"params":{"default_send_enabled":true,"send_enabled":[]},"send_enabled":[],"supply":[{"amount":"10000009635","denom":"stake"}]},"consensus":null,"distribution":{"delegator_starting_infos":[{"delegator_address":"cosmos15jenkldw6348lpgdev3vjzw90zzknxa9a3vg0j","starting_info":{"height":"0","previous_period":"1","stake":"1000000.000000000000000000"},"validator_address":"cosmosvaloper15jenkldw6348lpgdev3vjzw90zzknxa9c9carp"}],"delegator_withdraw_infos":[],"fee_pool":{"community_pool":[{"amount":"192.700000000000000000","denom":"stake"}]},"outstanding_rewards":[{"outstanding_rewards":[{"amount":"9442.300000000000000000","denom":"stake"}],"validator_address":"cosmosvaloper15jenkldw6348lpgdev3vjzw90zzknxa9c9carp"}],"params":{"base_proposer_reward":"0.000000000000000000","bonus_proposer_reward":"0.000000000000000000","community_tax":"0.020000000000000000","withdraw_addr_enabled":true},"previous_proposer":"cosmosvalcons16vm0nx49eam4q0xasdnwdzsdl6ymgyjt757sgr","validator_accumulated_commissions":[{"accumulated":{"commission":[{"amount":"944.230000000000000000","denom":"stake"}]},"validator_address":"cosmosvaloper15jenkldw6348lpgdev3vjzw90zzknxa9c9carp"}],"validator_current_rewards":[{"rewards":{"period":"2","rewards":[{"amount":"8498.070000000000000000","denom":"stake"}]},"validator_address":"cosmosvaloper15jenkldw6348lpgdev3vjzw90zzknxa9c9carp"}],"validator_historical_rewards":[{"period":"1","rewards":{"cumulative_reward_ratio":[],"reference_count":2},"validator_address":"cosmosvaloper15jenkldw6348lpgdev3vjzw90zzknxa9c9carp"}],"validator_slash_events":[]},"evidence":{"evidence":[]},"feegrant":{"allowances":[]},"genutil":{"gen_txs":[]},"gov":{"deposit_params":null,"deposits":[{"amount":[{"amount":"10010000","denom":"stake"}],"depositor":"cosmos15jenkldw6348lpgdev3vjzw90zzknxa9a3vg0j","proposal_id":"1"}],"params":{"expedited_min_deposit":[{"amount":"50000000","denom":"stake"}],"expedited_threshold":"0.667000000000000000","expedited_voting_period":"86400s","max_deposit_period":"172800s","min_deposit":[{"amount":"10000000","denom":"stake"}],"min_initial_deposit_ratio":"0.000000000000000000","proposal_cancel_dest":"","proposal_cancel_ratio":"0.500000000000000000","quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000","voting_period":"172800s"},"proposals":[{"deposit_end_time":"2023-02-22T11:11:52.776167376Z","expedited":false,"final_tally_result":{"abstain_count":"0","no_count":"0","no_with_veto_count":"0","yes_count":"0"},"id":"1","messages":[{"@type":"/cosmos.distribution.v1beta1.MsgCommunityPoolSpend","amount":[],"authority":"cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn","recipient":"cosmos1pnt5523etwtzv6mj7haryfw6w8h5tkcuhd99m8"}],"metadata":"ipfs://CID","proposer":"cosmos15jenkldw6348lpgdev3vjzw90zzknxa9a3vg0j","status":"PROPOSAL_STATUS_VOTING_PERIOD","submit_time":"2023-02-20T11:11:52.776167376Z","summary":"test proposal","title":"test proposal","total_deposit":[{"amount":"10010000","denom":"stake"}],"voting_end_time":"2023-02-22T11:12:07.801161984Z","voting_start_time":"2023-02-20T11:12:07.801161984Z"}],"starting_proposal_id":"2","tally_params":null,"votes":[],"voting_params":null},"group":{"group_members":[],"group_policies":[],"group_policy_seq":"0","group_seq":"0","groups":[],"proposal_seq":"0","proposals":[],"votes":[]},"mint":{"minter":{"annual_provisions":"1300010905.175073197786747950","inflation":"0.130000967926594565"},"params":{"blocks_per_year":"6311520","goal_bonded":"0.670000000000000000","inflation_max":"0.200000000000000000","inflation_min":"0.070000000000000000","inflation_rate_change":"0.130000000000000000","mint_denom":"stake"}},"nft":{"classes":[],"entries":[]},"params":null,"slashing":{"missed_blocks":[{"address":"cosmosvalcons16vm0nx49eam4q0xasdnwdzsdl6ymgyjt757sgr","missed_blocks":[]}],"params":{"downtime_jail_duration":"600s","min_signed_per_window":"0.500000000000000000","signed_blocks_window":"100","slash_fraction_double_sign":"0.050000000000000000","slash_fraction_downtime":"0.010000000000000000"},"signing_infos":[{"address":"cosmosvalcons16vm0nx49eam4q0xasdnwdzsdl6ymgyjt757sgr","validator_signing_info":{"address":"cosmosvalcons16vm0nx49eam4q0xasdnwdzsdl6ymgyjt757sgr","index_offset":"46","jailed_until":"1970-01-01T00:00:00Z","missed_blocks_counter":"0","start_height":"0","tombstoned":false}}]},"staking":{"delegations":[{"delegator_address":"cosmos15jenkldw6348lpgdev3vjzw90zzknxa9a3vg0j","shares":"1000000.000000000000000000","validator_address":"cosmosvaloper15jenkldw6348lpgdev3vjzw90zzknxa9c9carp"}],"exported":true,"last_total_power":"1","last_validator_powers":[{"address":"cosmosvaloper15jenkldw6348lpgdev3vjzw90zzknxa9c9carp","power":"1"}],"params":{"bond_denom":"stake","historical_entries":10000,"max_entries":7,"max_validators":100,"min_commission_rate":"0.000000000000000000","unbonding_time":"1814400s"},"redelegations":[],"unbonding_delegations":[],"validators":[{"commission":{"commission_rates":{"max_change_rate":"0.010000000000000000","max_rate":"0.200000000000000000","rate":"0.100000000000000000"},"update_time":"2023-02-20T11:08:30.588307671Z"},"consensus_pubkey":{"@type":"/cosmos.crypto.ed25519.PubKey","key":"tMZonPQYoooG/xbFVhHg95pTLxx7aO43/qgHFxDagWM="},"delegator_shares":"1000000.000000000000000000","description":{"details":"","identity":"","moniker":"test","security_contact":"","website":""},"jailed":false,"min_self_delegation":"1","operator_address":"cosmosvaloper15jenkldw6348lpgdev3vjzw90zzknxa9c9carp","status":"BOND_STATUS_BONDED","tokens":"1000000","unbonding_height":"0","unbonding_ids":[],"unbonding_on_hold_ref_count":"0","unbonding_time":"1970-01-01T00:00:00Z"}]},"upgrade":{},"vesting":{}},"chain_id":"demo","consensus_params":{"block":{"max_bytes":"22020096","max_gas":"-1"},"evidence":{"max_age_duration":"172800000000000","max_age_num_blocks":"100000","max_bytes":"1048576"},"validator":{"pub_key_types":["ed25519"]},"version":{"app":"0"}},"genesis_time":"2023-02-20T11:08:30.588307671Z","initial_height":"48","validators":[{"address":"D336F99AA5CF77503CDD8366E68A0DFE89B4124B","name":"test","power":"1","pub_key":{"type":"tendermint/PubKeyEd25519","value":"tMZonPQYoooG/xbFVhHg95pTLxx7aO43/qgHFxDagWM="}}]} \ No newline at end of file diff --git a/x/genutil/types/testdata/parse_chain_id.json b/x/genutil/types/testdata/parse_chain_id.json new file mode 100644 index 000000000000..be2588d2ae79 --- /dev/null +++ b/x/genutil/types/testdata/parse_chain_id.json @@ -0,0 +1 @@ +{"genesis_time":"2021-11-08T01:00:00Z","chain_id":"cronosmainnet_25-1","initial_height":"1","consensus_params":{"block":{"max_bytes":"1048576","max_gas":"10000000","time_iota_ms":"1000"},"evidence":{"max_age_num_blocks":"403200","max_age_duration":"2419200000000000","max_bytes":"150000"},"validator":{"pub_key_types":["ed25519"]},"version":{}},"app_hash":"","app_state":{"auth":{"params":{"max_memo_characters":"256","tx_sig_limit":"7","tx_size_cost_per_byte":"10","sig_verify_cost_ed25519":"590","sig_verify_cost_secp256k1":"1000"},"accounts":[{"@type":"/ethermint.types.v1.EthAccount","base_account":{"address":"crc1q7q2mmmcx2nlw6ptw4a9a3danlnu8z6tq32gv9","pub_key":null,"account_number":"0","sequence":"0"},"code_hash":"0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"},{"@type":"/ethermint.types.v1.EthAccount","base_account":{"address":"crc1s8372smy0erx5k4usf84s39tpgy3kmrvjwdejw","pub_key":null,"account_number":"0","sequence":"0"},"code_hash":"0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"},{"@type":"/ethermint.types.v1.EthAccount","base_account":{"address":"crc1efw0q0ggzxtmuf80wpcgr77h70c3avpdp9nq5k","pub_key":null,"account_number":"0","sequence":"0"},"code_hash":"0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"},{"@type":"/ethermint.types.v1.EthAccount","base_account":{"address":"crc1f7r687vm68jc6qw7rsut07puh9n7s9kzdj0zph","pub_key":null,"account_number":"0","sequence":"0"},"code_hash":"0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"},{"@type":"/ethermint.types.v1.EthAccount","base_account":{"address":"crc1aaxs058pksrq8cx3k0nrxv60p2a9c7nq527949","pub_key":null,"account_number":"0","sequence":"0"},"code_hash":"0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"},{"@type":"/ethermint.types.v1.EthAccount","base_account":{"address":"crc17s50usvlr5934tr2fxsesr89k4twtm25vjl6zs","pub_key":null,"account_number":"0","sequence":"0"},"code_hash":"0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"},{"@type":"/ethermint.types.v1.EthAccount","base_account":{"address":"crc1tasmcx3rqpglmsafdt7vylnsdkc3yjlzfv3u63","pub_key":null,"account_number":"0","sequence":"0"},"code_hash":"0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"},{"@type":"/ethermint.types.v1.EthAccount","base_account":{"address":"crc17m20ajc6d7mu9j34q956q5x5sw7c0wyrem3s7n","pub_key":null,"account_number":"0","sequence":"0"},"code_hash":"0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"}]},"authz":{"authorization":[]},"bank":{"params":{"send_enabled":[{"denom":"stake","enabled":true},{"denom":"basecro","enabled":false}],"default_send_enabled":true},"balances":[{"address":"crc1q7q2mmmcx2nlw6ptw4a9a3danlnu8z6tq32gv9","coins":[{"denom":"stake","amount":"10000000000"}]},{"address":"crc1f7r687vm68jc6qw7rsut07puh9n7s9kzdj0zph","coins":[{"denom":"stake","amount":"10000000000"}]},{"address":"crc1tasmcx3rqpglmsafdt7vylnsdkc3yjlzfv3u63","coins":[{"denom":"stake","amount":"600000000000"}]},{"address":"crc1s8372smy0erx5k4usf84s39tpgy3kmrvjwdejw","coins":[{"denom":"stake","amount":"10000000000"}]},{"address":"crc1efw0q0ggzxtmuf80wpcgr77h70c3avpdp9nq5k","coins":[{"denom":"stake","amount":"10000000000"}]},{"address":"crc1aaxs058pksrq8cx3k0nrxv60p2a9c7nq527949","coins":[{"denom":"stake","amount":"10000"}]},{"address":"crc17s50usvlr5934tr2fxsesr89k4twtm25vjl6zs","coins":[{"denom":"stake","amount":"1000000000000000"}]},{"address":"crc17m20ajc6d7mu9j34q956q5x5sw7c0wyrem3s7n","coins":[{"denom":"stake","amount":"50000000"}]}],"supply":[{"denom":"stake","amount":"1000640050010000"}],"denom_metadata":[]},"capability":{"index":"1","owners":[]},"crisis":{"constant_fee":{"denom":"stake","amount":"1000"}},"cronos":{"params":{"ibc_cro_denom":"ibc/6411AE2ADA1E73DB59DB151A8988F9B7D5E7E233D8414DB6817F8F1A01611F86","ibc_timeout":"86400000000000","cronos_admin":"crc1tasmcx3rqpglmsafdt7vylnsdkc3yjlzfv3u63","enable_auto_deployment":false},"external_contracts":[],"auto_contracts":[]},"distribution":{"params":{"community_tax":"0","base_proposer_reward":"0","bonus_proposer_reward":"0","withdraw_addr_enabled":true},"fee_pool":{"community_pool":[]},"delegator_withdraw_infos":[],"previous_proposer":"","outstanding_rewards":[],"validator_accumulated_commissions":[],"validator_historical_rewards":[],"validator_current_rewards":[],"delegator_starting_infos":[],"validator_slash_events":[]},"evidence":{"evidence":[]},"evm":{"accounts":[],"params":{"evm_denom":"basecro","enable_create":true,"enable_call":true,"extra_eips":["2929","2200","1884","1344"],"chain_config":{"homestead_block":"0","dao_fork_block":"0","dao_fork_support":true,"eip150_block":"0","eip150_hash":"0x0000000000000000000000000000000000000000000000000000000000000000","eip155_block":"0","eip158_block":"0","byzantium_block":"0","constantinople_block":"0","petersburg_block":"0","istanbul_block":"0","muir_glacier_block":"0","berlin_block":"0","catalyst_block":null,"london_block":"9223372036854775808"}}},"feegrant":{"allowances":[]},"genutil":{"gen_txs":[{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgCreateValidator","description":{"moniker":"Pioneer 11","identity":"BB602FB166F21C6E","website":"https://cronos.crypto.org","security_contact":"chain-security@crypto.org","details":""},"commission":{"rate":"1.000000000000000000","max_rate":"1.000000000000000000","max_change_rate":"1.000000000000000000"},"min_self_delegation":"1","delegator_address":"crc1q7q2mmmcx2nlw6ptw4a9a3danlnu8z6tq32gv9","validator_address":"crcvaloper1q7q2mmmcx2nlw6ptw4a9a3danlnu8z6t2wmyjv","pubkey":{"@type":"/cosmos.crypto.ed25519.PubKey","key":"H8pPcYZvZYd/cI2pKuwcmyst7ZTWm5+QkXXuCoGg1P0="},"value":{"denom":"stake","amount":"10000000000"}}],"memo":"","timeout_height":0,"extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[{"public_key":{"@type":"/ethermint.crypto.v1.ethsecp256k1.PubKey","key":"A/S9y8Yhb2FVVInVKmdPOtgIiKUlm7CE8ixT14GmNYm1"},"mode_info":{"single":{"mode":"SIGN_MODE_DIRECT"}},"sequence":0}],"fee":{"amount":[],"gas_limit":200000,"payer":"","granter":""}},"signatures":["35KHI9qc+w+2cOKwlmgXzx1QaPfsK9lxs1Z7INaiNHgHXqRHBUTgl8eKzIHTCnFJU89gpLPEqjUsLDasiHavggA="]},{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgCreateValidator","description":{"moniker":"Voyager 1","identity":"BB602FB166F21C6E","website":"https://cronos.crypto.org","security_contact":"chain-security@crypto.org","details":""},"commission":{"rate":"1.000000000000000000","max_rate":"1.000000000000000000","max_change_rate":"1.000000000000000000"},"min_self_delegation":"1","delegator_address":"crc1s8372smy0erx5k4usf84s39tpgy3kmrvjwdejw","validator_address":"crcvaloper1s8372smy0erx5k4usf84s39tpgy3kmrvc3u4v8","pubkey":{"@type":"/cosmos.crypto.ed25519.PubKey","key":"7WE80ID9TzUjIb5Lu9A+ncidsND5+sJAUL6l/NNn4KE="},"value":{"denom":"stake","amount":"10000000000"}}],"memo":"","timeout_height":0,"extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[{"public_key":{"@type":"/ethermint.crypto.v1.ethsecp256k1.PubKey","key":"AxI/HqRT4KKIQhonXtJBe9H/wRq4BkvAZO+4TxSQSjZt"},"mode_info":{"single":{"mode":"SIGN_MODE_DIRECT"}},"sequence":0}],"fee":{"amount":[],"gas_limit":200000,"payer":"","granter":""}},"signatures":["TlS6sZBiFNI64lr13x+sr3rrwV+U7icm/V9ksIMEtlhSZlXNJhS+2hQywyGutb6JhA+Ov+Wjln4puHm/MSA3iAE="]},{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgCreateValidator","description":{"moniker":"Voyager 2","identity":"BB602FB166F21C6E","website":"https://cronos.crypto.org","security_contact":"chain-security@crypto.org","details":""},"commission":{"rate":"1.000000000000000000","max_rate":"1.000000000000000000","max_change_rate":"1.000000000000000000"},"min_self_delegation":"1","delegator_address":"crc1efw0q0ggzxtmuf80wpcgr77h70c3avpdp9nq5k","validator_address":"crcvaloper1efw0q0ggzxtmuf80wpcgr77h70c3avpdt6zv2l","pubkey":{"@type":"/cosmos.crypto.ed25519.PubKey","key":"TXH4O/GhYibZffcBo5UAERwi9T4VgPAiVCDyl4rdFDE="},"value":{"denom":"stake","amount":"10000000000"}}],"memo":"","timeout_height":0,"extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[{"public_key":{"@type":"/ethermint.crypto.v1.ethsecp256k1.PubKey","key":"AzR06WzkRRXNNE+A4VFG18w170ZicRa/mVsLvBGlBAxz"},"mode_info":{"single":{"mode":"SIGN_MODE_DIRECT"}},"sequence":0}],"fee":{"amount":[],"gas_limit":200000,"payer":"","granter":""}},"signatures":["mx//YsSSwUP4G020FLRS0532nP2AylVPqRUXb9EdauM4OWdXF0+Ftx8jbcFinzBw8PHGof3XHcg2yw2P2qNBMAE="]},{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgCreateValidator","description":{"moniker":"Huygens","identity":"BB602FB166F21C6E","website":"https://cronos.crypto.org","security_contact":"chain-security@crypto.org","details":""},"commission":{"rate":"1.000000000000000000","max_rate":"1.000000000000000000","max_change_rate":"1.000000000000000000"},"min_self_delegation":"1","delegator_address":"crc1f7r687vm68jc6qw7rsut07puh9n7s9kzdj0zph","validator_address":"crcvaloper1f7r687vm68jc6qw7rsut07puh9n7s9kz8d7wl7","pubkey":{"@type":"/cosmos.crypto.ed25519.PubKey","key":"f826QMXnfR9pEAJDEQR4t228BwQVJ7xe2EwGZN8doQY="},"value":{"denom":"stake","amount":"10000000000"}}],"memo":"","timeout_height":0,"extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[{"public_key":{"@type":"/ethermint.crypto.v1.ethsecp256k1.PubKey","key":"AkDcLOeNUKVUS52hUPx+cSo+ohG6vW3P2RYkbW6dwdMG"},"mode_info":{"single":{"mode":"SIGN_MODE_DIRECT"}},"sequence":0}],"fee":{"amount":[],"gas_limit":200000,"payer":"","granter":""}},"signatures":["Rz89OXlfJQgasEeKxsywF/XyiYg7Xdgg/qgwtJcOMuIgJ3hfsE0KrreXlfHOGPIe9nVduffC9W3gKvw2sHe9ugE="]}]},"gov":{"starting_proposal_id":"1","deposits":[],"votes":[],"proposals":[],"deposit_params":{"min_deposit":[{"denom":"basecro","amount":"20000000000000000000000"}],"max_deposit_period":"21600000000000ns"},"voting_params":{"voting_period":"259200000000000ns"},"tally_params":{"quorum":"0.334","threshold":"0.5","veto_threshold":"0.334"}},"ibc":{"client_genesis":{"clients":[],"clients_consensus":[],"clients_metadata":[],"params":{"allowed_clients":["06-solomachine","07-tendermint"]},"create_localhost":false,"next_client_sequence":"0"},"connection_genesis":{"connections":[],"client_connection_paths":[],"next_connection_sequence":"0","params":{"max_expected_time_per_block":"30000000000"}},"channel_genesis":{"channels":[],"acknowledgements":[],"commitments":[],"receipts":[],"send_sequences":[],"recv_sequences":[],"ack_sequences":[],"next_channel_sequence":"0"}},"mint":{"minter":{"inflation":"0.000000000000000000","annual_provisions":"0.000000000000000000"},"params":{"mint_denom":"stake","inflation_rate_change":"0","inflation_max":"0","inflation_min":"0","goal_bonded":"1","blocks_per_year":"6311520"}},"params":null,"slashing":{"params":{"signed_blocks_window":"10000","min_signed_per_window":"0.5","downtime_jail_duration":"28800s","slash_fraction_double_sign":"0","slash_fraction_downtime":"0"},"signing_infos":[],"missed_blocks":[]},"staking":{"params":{"unbonding_time":"2419200000000000ns","max_validators":"50","max_entries":"7","historical_entries":"10000","bond_denom":"stake"},"last_total_power":"0","last_validator_powers":[],"validators":[],"delegations":[],"unbonding_delegations":[],"redelegations":[],"exported":false},"transfer":{"port_id":"transfer","denom_traces":[],"params":{"send_enabled":true,"receive_enabled":true}},"upgrade":{},"vesting":{}}} diff --git a/x/genutil/utils_test.go b/x/genutil/utils_test.go index 13367dcd5b35..7e0dd4b17d4a 100644 --- a/x/genutil/utils_test.go +++ b/x/genutil/utils_test.go @@ -7,10 +7,9 @@ import ( "testing" "time" + "github.com/cometbft/cometbft/config" tmed25519 "github.com/cometbft/cometbft/crypto/ed25519" "github.com/cometbft/cometbft/privval" - - "github.com/cometbft/cometbft/config" "github.com/stretchr/testify/require" ) diff --git a/x/gov/README.md b/x/gov/README.md index 245d29053f77..87b2fc5fad6c 100644 --- a/x/gov/README.md +++ b/x/gov/README.md @@ -16,14 +16,14 @@ on proposals on a 1 token 1 vote basis. Next is a list of features the module currently supports: * **Proposal submission:** Users can submit proposals with a deposit. Once the -minimum deposit is reached, the proposal enters voting period. -* **Vote:** Participants can vote on proposals that reached MinDeposit +minimum deposit is reached, the proposal enters voting period. The minimum deposit can be reached by collecting deposits from different users (including proposer) within deposit period. +* **Vote:** Participants can vote on proposals that reached MinDeposit and entered voting period. * **Inheritance and penalties:** Delegators inherit their validator's vote if they don't vote themselves. * **Claiming deposit:** Users that deposited on proposals can recover their -deposits if the proposal was accepted or rejected. If the proposal was vetoed, or never entered voting period, the deposit is burned. +deposits if the proposal was accepted or rejected. If the proposal was vetoed, or never entered voting period (minimum deposit not reached within deposit period), the deposit is burned. -This module will be used in the Cosmos Hub, the first Hub in the Cosmos network. +This module is in use on the Cosmos Hub (a.k.a [gaia](https://github.com/cosmos/gaia)). Features that may be added in the future are described in [Future Improvements](#future-improvements). ## Contents @@ -494,11 +494,13 @@ And the pseudocode for the `ProposalProcessingQueue`: ### Legacy Proposal +:::warning +Legacy proposals are deprecated. Use the new proposal flow by granting the governance module the right to execute the message. +::: + A legacy proposal is the old implementation of governance proposal. Contrary to proposal that can contain any messages, a legacy proposal allows to submit a set of pre-defined proposals. -These proposal are defined by their types. - -While proposals should use the new implementation of the governance proposal, we need still to use legacy proposal in order to submit a `software-upgrade` and a `cancel-software-upgrade` proposal. +These proposals are defined by their types and handled by handlers that are registered in the gov v1beta1 router. More information on how to submit proposals in the [client section](#client). @@ -516,6 +518,7 @@ All `sdk.Msgs` passed into the `messages` field of a `MsgSubmitProposal` message must be registered in the app's `MsgServiceRouter`. Each of these messages must have one signer, namely the gov module account. And finally, the metadata length must not be larger than the `maxMetadataLen` config passed into the gov keeper. +The `initialDeposit` must be strictly positive and conform to the accepted denom of the `MinDeposit` param. **State modifications:** @@ -527,58 +530,17 @@ must not be larger than the `maxMetadataLen` config passed into the gov keeper. * Push `proposalID` in `ProposalProcessingQueue` * Transfer `InitialDeposit` from the `Proposer` to the governance `ModuleAccount` -A `MsgSubmitProposal` transaction can be handled according to the following -pseudocode. - -```go -// PSEUDOCODE // -// Check if MsgSubmitProposal is valid. If it is, create proposal // - -upon receiving txGovSubmitProposal from sender do - - if !correctlyFormatted(txGovSubmitProposal) - // check if proposal is correctly formatted and the messages have routes to other modules. Includes fee payment. - // check if all messages' unique Signer is the gov acct. - // check if the metadata is not too long. - throw - - initialDeposit = txGovSubmitProposal.InitialDeposit - if (initialDeposit.Atoms <= 0) OR (sender.AtomBalance < initialDeposit.Atoms) - // InitialDeposit is negative or null OR sender has insufficient funds - throw - - if (txGovSubmitProposal.Type != ProposalTypePlainText) OR (txGovSubmitProposal.Type != ProposalTypeSoftwareUpgrade) - - sender.AtomBalance -= initialDeposit.Atoms - - depositParam = load(GlobalParams, 'DepositParam') - - proposalID = generate new proposalID - proposal = NewProposal() - - proposal.Messages = txGovSubmitProposal.Messages - proposal.Metadata = txGovSubmitProposal.Metadata - proposal.TotalDeposit = initialDeposit - proposal.SubmitTime = - proposal.DepositEndTime = .Add(depositParam.MaxDepositPeriod) - proposal.Deposits.append({initialDeposit, sender}) - proposal.Submitter = sender - proposal.YesVotes = 0 - proposal.NoVotes = 0 - proposal.NoWithVetoVotes = 0 - proposal.AbstainVotes = 0 - proposal.CurrentStatus = ProposalStatusOpen - - store(Proposals, , proposal) // Store proposal in Proposals mapping - return proposalID -``` - ### Deposit -Once a proposal is submitted, if -`Proposal.TotalDeposit < ActiveParam.MinDeposit`, Atom holders can send +Once a proposal is submitted, if `Proposal.TotalDeposit < ActiveParam.MinDeposit`, Atom holders can send `MsgDeposit` transactions to increase the proposal's deposit. +A deposit is accepted iff: + +* The proposal exists +* The proposal is not in the voting period +* The deposited coins are conform to the accepted denom from the `MinDeposit` param + ```protobuf reference https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/gov/v1/tx.proto#L134-L147 ``` @@ -592,55 +554,6 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/gov/v1/tx.pro * Push `proposalID` in `ProposalProcessingQueueEnd` * Transfer `Deposit` from the `proposer` to the governance `ModuleAccount` -A `MsgDeposit` transaction has to go through a number of checks to be valid. -These checks are outlined in the following pseudocode. - -```go -// PSEUDOCODE // -// Check if MsgDeposit is valid. If it is, increase deposit and check if MinDeposit is reached - -upon receiving txGovDeposit from sender do - // check if proposal is correctly formatted. Includes fee payment. - - if !correctlyFormatted(txGovDeposit) - throw - - proposal = load(Proposals, ) // proposal is a const key, proposalID is variable - - if (proposal == nil) - // There is no proposal for this proposalID - throw - - if (txGovDeposit.Deposit.Atoms <= 0) OR (sender.AtomBalance < txGovDeposit.Deposit.Atoms) OR (proposal.CurrentStatus != ProposalStatusOpen) - - // deposit is negative or null - // OR sender has insufficient funds - // OR proposal is not open for deposit anymore - - throw - - depositParam = load(GlobalParams, 'DepositParam') - - if (CurrentBlock >= proposal.SubmitBlock + depositParam.MaxDepositPeriod) - proposal.CurrentStatus = ProposalStatusClosed - - else - // sender can deposit - sender.AtomBalance -= txGovDeposit.Deposit.Atoms - - proposal.Deposits.append({txGovVote.Deposit, sender}) - proposal.TotalDeposit.Plus(txGovDeposit.Deposit) - - if (proposal.TotalDeposit >= depositParam.MinDeposit) - // MinDeposit is reached, vote opens - - proposal.VotingStartBlock = CurrentBlock - proposal.CurrentStatus = ProposalStatusActive - ProposalProcessingQueue.push(txGovDeposit.ProposalID) - - store(Proposals, , proposal) -``` - ### Vote Once `ActiveParam.MinDeposit` is reached, voting period starts. From there, @@ -659,35 +572,6 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/gov/v1/tx.pro Gas cost for this message has to take into account the future tallying of the vote in EndBlocker. ::: -Next is a pseudocode outline of the way `MsgVote` transactions are handled: - -```go - // PSEUDOCODE // - // Check if MsgVote is valid. If it is, count vote// - - upon receiving txGovVote from sender do - // check if proposal is correctly formatted. Includes fee payment. - - if !correctlyFormatted(txGovDeposit) - throw - - proposal = load(Proposals, ) - - if (proposal == nil) - // There is no proposal for this proposalID - throw - - - if (proposal.CurrentStatus == ProposalStatusActive) - - - // Sender can vote if - // Proposal is active - // Sender has some bonds - - store(Governance, , txGovVote.Vote) // Voters can vote multiple times. Re-voting overrides previous vote. This is ok because tallying is done once at the end. -``` - ## Events The governance module emits the following events: @@ -768,6 +652,8 @@ The governance module contains the following parameters: | burn_proposal_deposit_prevote | bool | false | | burn_vote_quorum | bool | false | | burn_vote_veto | bool | true | +| min_initial_deposit_ratio | string | "0.1" | + **NOTE**: The governance module contains parameters that are objects unlike other modules. If only a subset of parameters are desired to be changed, only they need @@ -1181,6 +1067,10 @@ where `proposal.json` contains: By default the metadata, summary and title are both limited by 255 characters, this can be overridden by the application developer. ::: +:::tip +When metadata is not specified, the title is limited to 255 characters and the summary 40x the title length. +::: + ##### submit-legacy-proposal The `submit-legacy-proposal` command allows users to submit a governance legacy proposal along with an initial deposit. diff --git a/x/gov/abci.go b/x/gov/abci.go index 48c83d1da6ec..56ab8641bd10 100644 --- a/x/gov/abci.go +++ b/x/gov/abci.go @@ -6,6 +6,9 @@ import ( "time" "cosmossdk.io/collections" + "cosmossdk.io/log" + + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/keeper" @@ -15,7 +18,7 @@ import ( // EndBlocker called every block, process inflation, update validator set. func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) error { - defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyEndBlocker) + defer telemetry.ModuleMeasureSince(types.ModuleName, telemetry.Now(), telemetry.MetricKeyEndBlocker) logger := ctx.Logger().With("module", "x/"+types.ModuleName) // delete dead proposals from store and returns theirs deposits. @@ -24,10 +27,26 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) error { err := keeper.InactiveProposalsQueue.Walk(ctx, rng, func(key collections.Pair[time.Time, uint64], _ uint64) (bool, error) { proposal, err := keeper.Proposals.Get(ctx, key.K2()) if err != nil { + // if the proposal has an encoding error, this means it cannot be processed by x/gov + // this could be due to some types missing their registration + // instead of returning an error (i.e, halting the chain), we fail the proposal + if errors.Is(err, collections.ErrEncoding) { + proposal.Id = key.K2() + if err := failUnsupportedProposal(logger, ctx, keeper, proposal, err.Error(), false); err != nil { + return false, err + } + + if err = keeper.DeleteProposal(ctx, proposal.Id); err != nil { + return false, err + } + + return false, nil + } + return false, err } - err = keeper.DeleteProposal(ctx, proposal.Id) - if err != nil { + + if err = keeper.DeleteProposal(ctx, proposal.Id); err != nil { return false, err } @@ -46,7 +65,13 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) error { } // called when proposal become inactive - keeper.Hooks().AfterProposalFailedMinDeposit(ctx, proposal.Id) + cacheCtx, writeCache := ctx.CacheContext() + err = keeper.Hooks().AfterProposalFailedMinDeposit(cacheCtx, proposal.Id) + if err == nil { // purposely ignoring the error here not to halt the chain if the hook fails + writeCache() + } else { + keeper.Logger(ctx).Error("failed to execute AfterProposalFailedMinDeposit hook", "error", err) + } ctx.EventManager().EmitEvent( sdk.NewEvent( @@ -67,7 +92,7 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) error { return false, nil }) - if err != nil && !errors.Is(err, collections.ErrInvalidIterator) { + if err != nil { return err } @@ -76,6 +101,22 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) error { err = keeper.ActiveProposalsQueue.Walk(ctx, rng, func(key collections.Pair[time.Time, uint64], _ uint64) (bool, error) { proposal, err := keeper.Proposals.Get(ctx, key.K2()) if err != nil { + // if the proposal has an encoding error, this means it cannot be processed by x/gov + // this could be due to some types missing their registration + // instead of returning an error (i.e, halting the chain), we fail the proposal + if errors.Is(err, collections.ErrEncoding) { + proposal.Id = key.K2() + if err := failUnsupportedProposal(logger, ctx, keeper, proposal, err.Error(), true); err != nil { + return false, err + } + + if err = keeper.ActiveProposalsQueue.Remove(ctx, collections.Join(*proposal.VotingEndTime, proposal.Id)); err != nil { + return false, err + } + + return false, nil + } + return false, err } @@ -96,14 +137,12 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) error { } else { err = keeper.RefundAndDeleteDeposits(ctx, proposal.Id) } - if err != nil { return false, err } } - err = keeper.ActiveProposalsQueue.Remove(ctx, collections.Join(*proposal.VotingEndTime, proposal.Id)) - if err != nil { + if err = keeper.ActiveProposalsQueue.Remove(ctx, collections.Join(*proposal.VotingEndTime, proposal.Id)); err != nil { return false, err } @@ -123,6 +162,7 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) error { messages, err := proposal.GetMsgs() if err != nil { proposal.Status = v1.StatusFailed + proposal.FailedReason = err.Error() tagValue = types.AttributeValueProposalFailed logMsg = fmt.Sprintf("passed proposal (%v) failed to execute; msgs: %s", proposal, err) @@ -132,9 +172,8 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) error { // execute all messages for idx, msg = range messages { handler := keeper.Router().Handler(msg) - var res *sdk.Result - res, err = handler(cacheCtx, msg) + res, err = safeExecuteHandler(cacheCtx, msg, handler) if err != nil { break } @@ -156,6 +195,7 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) error { ctx.EventManager().EmitEvents(events) } else { proposal.Status = v1.StatusFailed + proposal.FailedReason = err.Error() tagValue = types.AttributeValueProposalFailed logMsg = fmt.Sprintf("passed, but msg %d (%s) failed on execution: %s", idx, sdk.MsgTypeURL(msg), err) } @@ -181,6 +221,7 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) error { logMsg = "expedited proposal converted to regular" default: proposal.Status = v1.StatusRejected + proposal.FailedReason = "proposal did not get enough votes to pass" tagValue = types.AttributeValueProposalRejected logMsg = "rejected" } @@ -193,7 +234,13 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) error { } // when proposal become active - keeper.Hooks().AfterProposalVotingPeriodEnded(ctx, proposal.Id) + cacheCtx, writeCache := ctx.CacheContext() + err = keeper.Hooks().AfterProposalVotingPeriodEnded(cacheCtx, proposal.Id) + if err == nil { // purposely ignoring the error here not to halt the chain if the hook fails + writeCache() + } else { + keeper.Logger(ctx).Error("failed to execute AfterProposalVotingPeriodEnded hook", "error", err) + } logger.Info( "proposal tallied", @@ -215,8 +262,65 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) error { return false, nil }) - if err != nil && !errors.Is(err, collections.ErrInvalidIterator) { + if err != nil { + return err + } + return nil +} + +// executes handle(msg) and recovers from panic. +func safeExecuteHandler(ctx sdk.Context, msg sdk.Msg, handler baseapp.MsgServiceHandler, +) (res *sdk.Result, err error) { + defer func() { + if r := recover(); r != nil { + err = fmt.Errorf("handling x/gov proposal msg [%s] PANICKED: %v", msg, r) + } + }() + res, err = handler(ctx, msg) + return +} + +// failUnsupportedProposal fails a proposal that cannot be processed by gov +func failUnsupportedProposal( + logger log.Logger, + ctx sdk.Context, + keeper *keeper.Keeper, + proposal v1.Proposal, + errMsg string, + active bool, +) error { + proposal.Status = v1.StatusFailed + proposal.FailedReason = fmt.Sprintf("proposal failed because it cannot be processed by gov: %s", errMsg) + proposal.Messages = nil // clear out the messages + + if err := keeper.SetProposal(ctx, proposal); err != nil { + return err + } + + if err := keeper.RefundAndDeleteDeposits(ctx, proposal.Id); err != nil { return err } + + eventType := types.EventTypeInactiveProposal + if active { + eventType = types.EventTypeActiveProposal + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + eventType, + sdk.NewAttribute(types.AttributeKeyProposalID, fmt.Sprintf("%d", proposal.Id)), + sdk.NewAttribute(types.AttributeKeyProposalResult, types.AttributeValueProposalFailed), + ), + ) + + logger.Info( + "proposal failed to decode; deleted", + "proposal", proposal.Id, + "expedited", proposal.Expedited, + "title", proposal.Title, + "results", errMsg, + ) + return nil } diff --git a/x/gov/abci_internal_test.go b/x/gov/abci_internal_test.go new file mode 100644 index 000000000000..1421a81b5cb6 --- /dev/null +++ b/x/gov/abci_internal_test.go @@ -0,0 +1,32 @@ +package gov + +import ( + "testing" + + "github.com/stretchr/testify/require" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func failingHandler(_ sdk.Context, _ sdk.Msg) (*sdk.Result, error) { + panic("test-fail") +} + +func okHandler(_ sdk.Context, _ sdk.Msg) (*sdk.Result, error) { + return new(sdk.Result), nil +} + +func TestSafeExecuteHandler(t *testing.T) { + t.Parallel() + + require := require.New(t) + var ctx sdk.Context + + r, err := safeExecuteHandler(ctx, nil, failingHandler) + require.ErrorContains(err, "test-fail") + require.Nil(r) + + r, err = safeExecuteHandler(ctx, nil, okHandler) + require.Nil(err) + require.NotNil(r) +} diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index bd3f916c197b..6c8a009fa205 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -4,11 +4,12 @@ import ( "testing" "time" - "cosmossdk.io/collections" - "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" "github.com/stretchr/testify/require" + "cosmossdk.io/collections" + "cosmossdk.io/math" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -21,6 +22,65 @@ import ( stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) +func TestUnregisteredProposal_InactiveProposalFails(t *testing.T) { + suite := createTestSuite(t) + ctx := suite.App.BaseApp.NewContext(false) + addrs := simtestutil.AddTestAddrs(suite.BankKeeper, suite.StakingKeeper, ctx, 10, valTokens) + + // manually set proposal in store + startTime, endTime := time.Now().Add(-4*time.Hour), ctx.BlockHeader().Time + proposal, err := v1.NewProposal([]sdk.Msg{ + &v1.Proposal{}, // invalid proposal message + }, 1, startTime, startTime, "", "Unsupported proposal", "Unsupported proposal", addrs[0], false) + require.NoError(t, err) + + err = suite.GovKeeper.SetProposal(ctx, proposal) + require.NoError(t, err) + + // manually set proposal in inactive proposal queue + err = suite.GovKeeper.InactiveProposalsQueue.Set(ctx, collections.Join(endTime, proposal.Id), proposal.Id) + require.NoError(t, err) + + checkInactiveProposalsQueue(t, ctx, suite.GovKeeper) + + err = gov.EndBlocker(ctx, suite.GovKeeper) + require.NoError(t, err) + + _, err = suite.GovKeeper.Proposals.Get(ctx, proposal.Id) + require.Error(t, err, collections.ErrNotFound) +} + +func TestUnregisteredProposal_ActiveProposalFails(t *testing.T) { + suite := createTestSuite(t) + ctx := suite.App.BaseApp.NewContext(false) + addrs := simtestutil.AddTestAddrs(suite.BankKeeper, suite.StakingKeeper, ctx, 10, valTokens) + + // manually set proposal in store + startTime, endTime := time.Now().Add(-4*time.Hour), ctx.BlockHeader().Time + proposal, err := v1.NewProposal([]sdk.Msg{ + &v1.Proposal{}, // invalid proposal message + }, 1, startTime, startTime, "", "Unsupported proposal", "Unsupported proposal", addrs[0], false) + require.NoError(t, err) + proposal.Status = v1.StatusVotingPeriod + proposal.VotingEndTime = &endTime + + err = suite.GovKeeper.SetProposal(ctx, proposal) + require.NoError(t, err) + + // manually set proposal in active proposal queue + err = suite.GovKeeper.ActiveProposalsQueue.Set(ctx, collections.Join(endTime, proposal.Id), proposal.Id) + require.NoError(t, err) + + checkActiveProposalsQueue(t, ctx, suite.GovKeeper) + + err = gov.EndBlocker(ctx, suite.GovKeeper) + require.NoError(t, err) + + p, err := suite.GovKeeper.Proposals.Get(ctx, proposal.Id) + require.NoError(t, err) + require.Equal(t, v1.StatusFailed, p.Status) +} + func TestTickExpiredDepositPeriod(t *testing.T) { suite := createTestSuite(t) app := suite.App @@ -34,11 +94,11 @@ func TestTickExpiredDepositPeriod(t *testing.T) { govMsgSvr := keeper.NewMsgServerImpl(suite.GovKeeper) - checkInactiveProposalsQueue(t, ctx, suite.GovKeeper, true) + checkInactiveProposalsQueue(t, ctx, suite.GovKeeper) newProposalMsg, err := v1.NewMsgSubmitProposal( []sdk.Msg{mkTestLegacyContent(t)}, - sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, + sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 100000)}, addrs[0].String(), "", "Proposal", @@ -51,25 +111,25 @@ func TestTickExpiredDepositPeriod(t *testing.T) { require.NoError(t, err) require.NotNil(t, res) - checkInactiveProposalsQueue(t, ctx, suite.GovKeeper, true) + checkInactiveProposalsQueue(t, ctx, suite.GovKeeper) newHeader := ctx.BlockHeader() newHeader.Time = ctx.BlockHeader().Time.Add(time.Duration(1) * time.Second) ctx = ctx.WithBlockHeader(newHeader) - checkInactiveProposalsQueue(t, ctx, suite.GovKeeper, true) + checkInactiveProposalsQueue(t, ctx, suite.GovKeeper) params, _ := suite.GovKeeper.Params.Get(ctx) newHeader = ctx.BlockHeader() newHeader.Time = ctx.BlockHeader().Time.Add(*params.MaxDepositPeriod) ctx = ctx.WithBlockHeader(newHeader) - checkInactiveProposalsQueue(t, ctx, suite.GovKeeper, false) + checkInactiveProposalsQueue(t, ctx, suite.GovKeeper) err = gov.EndBlocker(ctx, suite.GovKeeper) require.NoError(t, err) - checkInactiveProposalsQueue(t, ctx, suite.GovKeeper, true) + checkInactiveProposalsQueue(t, ctx, suite.GovKeeper) } func TestTickMultipleExpiredDepositPeriod(t *testing.T) { @@ -85,11 +145,11 @@ func TestTickMultipleExpiredDepositPeriod(t *testing.T) { govMsgSvr := keeper.NewMsgServerImpl(suite.GovKeeper) - checkInactiveProposalsQueue(t, ctx, suite.GovKeeper, true) + checkInactiveProposalsQueue(t, ctx, suite.GovKeeper) newProposalMsg, err := v1.NewMsgSubmitProposal( []sdk.Msg{mkTestLegacyContent(t)}, - sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, + sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 100000)}, addrs[0].String(), "", "Proposal", @@ -102,17 +162,17 @@ func TestTickMultipleExpiredDepositPeriod(t *testing.T) { require.NoError(t, err) require.NotNil(t, res) - checkInactiveProposalsQueue(t, ctx, suite.GovKeeper, true) + checkInactiveProposalsQueue(t, ctx, suite.GovKeeper) newHeader := ctx.BlockHeader() newHeader.Time = ctx.BlockHeader().Time.Add(time.Duration(2) * time.Second) ctx = ctx.WithBlockHeader(newHeader) - checkInactiveProposalsQueue(t, ctx, suite.GovKeeper, true) + checkInactiveProposalsQueue(t, ctx, suite.GovKeeper) newProposalMsg2, err := v1.NewMsgSubmitProposal( []sdk.Msg{mkTestLegacyContent(t)}, - sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, + sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 100000)}, addrs[0].String(), "", "Proposal", @@ -130,17 +190,17 @@ func TestTickMultipleExpiredDepositPeriod(t *testing.T) { newHeader.Time = ctx.BlockHeader().Time.Add(*params.MaxDepositPeriod).Add(time.Duration(-1) * time.Second) ctx = ctx.WithBlockHeader(newHeader) - checkInactiveProposalsQueue(t, ctx, suite.GovKeeper, false) + checkInactiveProposalsQueue(t, ctx, suite.GovKeeper) require.NoError(t, gov.EndBlocker(ctx, suite.GovKeeper)) - checkInactiveProposalsQueue(t, ctx, suite.GovKeeper, true) + checkInactiveProposalsQueue(t, ctx, suite.GovKeeper) newHeader = ctx.BlockHeader() newHeader.Time = ctx.BlockHeader().Time.Add(time.Duration(5) * time.Second) ctx = ctx.WithBlockHeader(newHeader) - checkInactiveProposalsQueue(t, ctx, suite.GovKeeper, false) + checkInactiveProposalsQueue(t, ctx, suite.GovKeeper) require.NoError(t, gov.EndBlocker(ctx, suite.GovKeeper)) - checkInactiveProposalsQueue(t, ctx, suite.GovKeeper, true) + checkInactiveProposalsQueue(t, ctx, suite.GovKeeper) } func TestTickPassedDepositPeriod(t *testing.T) { @@ -158,7 +218,7 @@ func TestTickPassedDepositPeriod(t *testing.T) { newProposalMsg, err := v1.NewMsgSubmitProposal( []sdk.Msg{mkTestLegacyContent(t)}, - sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, + sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 100000)}, addrs[0].String(), "", "Proposal", @@ -173,21 +233,21 @@ func TestTickPassedDepositPeriod(t *testing.T) { proposalID := res.ProposalId - checkInactiveProposalsQueue(t, ctx, suite.GovKeeper, true) + checkInactiveProposalsQueue(t, ctx, suite.GovKeeper) newHeader := ctx.BlockHeader() newHeader.Time = ctx.BlockHeader().Time.Add(time.Duration(1) * time.Second) ctx = ctx.WithBlockHeader(newHeader) - checkInactiveProposalsQueue(t, ctx, suite.GovKeeper, true) + checkInactiveProposalsQueue(t, ctx, suite.GovKeeper) - newDepositMsg := v1.NewMsgDeposit(addrs[1], proposalID, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}) + newDepositMsg := v1.NewMsgDeposit(addrs[1], proposalID, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 100000)}) res1, err := govMsgSvr.Deposit(ctx, newDepositMsg) require.NoError(t, err) require.NotNil(t, res1) - checkActiveProposalsQueue(t, ctx, suite.GovKeeper, true) + checkActiveProposalsQueue(t, ctx, suite.GovKeeper) } func TestTickPassedVotingPeriod(t *testing.T) { @@ -221,8 +281,8 @@ func TestTickPassedVotingPeriod(t *testing.T) { govMsgSvr := keeper.NewMsgServerImpl(suite.GovKeeper) - checkInactiveProposalsQueue(t, ctx, suite.GovKeeper, true) - checkActiveProposalsQueue(t, ctx, suite.GovKeeper, true) + checkInactiveProposalsQueue(t, ctx, suite.GovKeeper) + checkActiveProposalsQueue(t, ctx, suite.GovKeeper) proposalCoins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, suite.StakingKeeper.TokensFromConsensusPower(ctx, 5*depositMultiplier))} newProposalMsg, err := v1.NewMsgSubmitProposal([]sdk.Msg{mkTestLegacyContent(t)}, proposalCoins, addrs[0].String(), "", "Proposal", "description of proposal", tc.expedited) @@ -254,8 +314,8 @@ func TestTickPassedVotingPeriod(t *testing.T) { newHeader.Time = ctx.BlockHeader().Time.Add(*params.MaxDepositPeriod).Add(*votingPeriod) ctx = ctx.WithBlockHeader(newHeader) - checkInactiveProposalsQueue(t, ctx, suite.GovKeeper, true) - checkActiveProposalsQueue(t, ctx, suite.GovKeeper, false) + checkInactiveProposalsQueue(t, ctx, suite.GovKeeper) + checkActiveProposalsQueue(t, ctx, suite.GovKeeper) proposal, err := suite.GovKeeper.Proposals.Get(ctx, res.ProposalId) require.NoError(t, err) @@ -265,12 +325,12 @@ func TestTickPassedVotingPeriod(t *testing.T) { require.NoError(t, err) if !tc.expedited { - checkActiveProposalsQueue(t, ctx, suite.GovKeeper, true) + checkActiveProposalsQueue(t, ctx, suite.GovKeeper) return } // If expedited, it should be converted to a regular proposal instead. - checkActiveProposalsQueue(t, ctx, suite.GovKeeper, false) + checkActiveProposalsQueue(t, ctx, suite.GovKeeper) proposal, err = suite.GovKeeper.Proposals.Get(ctx, res.ProposalId) require.Nil(t, err) @@ -378,7 +438,7 @@ func TestEndBlockerProposalHandlerFailed(t *testing.T) { createValidators(t, stakingMsgSvr, ctx, []sdk.ValAddress{valAddr}, []int64{10}) suite.StakingKeeper.EndBlocker(ctx) - msg := banktypes.NewMsgSend(authtypes.NewModuleAddress(types.ModuleName), addrs[0], sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100000)))) + msg := banktypes.NewMsgSend(authtypes.NewModuleAddress(types.ModuleName), addrs[0], sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(100000)))) proposal, err := suite.GovKeeper.SubmitProposal(ctx, []sdk.Msg{msg}, "", "title", "summary", proposer, false) require.NoError(t, err) @@ -463,8 +523,8 @@ func TestExpeditedProposal_PassAndConversionToRegular(t *testing.T) { createValidators(t, stakingMsgSvr, ctx, []sdk.ValAddress{valAddr}, []int64{10}) suite.StakingKeeper.EndBlocker(ctx) - checkInactiveProposalsQueue(t, ctx, suite.GovKeeper, true) - checkActiveProposalsQueue(t, ctx, suite.GovKeeper, true) + checkInactiveProposalsQueue(t, ctx, suite.GovKeeper) + checkActiveProposalsQueue(t, ctx, suite.GovKeeper) macc := suite.GovKeeper.GetGovernanceAccount(ctx) require.NotNil(t, macc) @@ -497,8 +557,8 @@ func TestExpeditedProposal_PassAndConversionToRegular(t *testing.T) { newHeader.Time = ctx.BlockHeader().Time.Add(*params.MaxDepositPeriod).Add(*params.ExpeditedVotingPeriod) ctx = ctx.WithBlockHeader(newHeader) - checkInactiveProposalsQueue(t, ctx, suite.GovKeeper, true) - checkActiveProposalsQueue(t, ctx, suite.GovKeeper, false) + checkInactiveProposalsQueue(t, ctx, suite.GovKeeper) + checkActiveProposalsQueue(t, ctx, suite.GovKeeper) proposal, err := suite.GovKeeper.Proposals.Get(ctx, res.ProposalId) require.Nil(t, err) @@ -514,7 +574,7 @@ func TestExpeditedProposal_PassAndConversionToRegular(t *testing.T) { gov.EndBlocker(ctx, suite.GovKeeper) if tc.expeditedPasses { - checkActiveProposalsQueue(t, ctx, suite.GovKeeper, true) + checkActiveProposalsQueue(t, ctx, suite.GovKeeper) proposal, err = suite.GovKeeper.Proposals.Get(ctx, res.ProposalId) require.Nil(t, err) @@ -535,7 +595,7 @@ func TestExpeditedProposal_PassAndConversionToRegular(t *testing.T) { } // Expedited proposal should be converted to a regular proposal instead. - checkActiveProposalsQueue(t, ctx, suite.GovKeeper, false) + checkActiveProposalsQueue(t, ctx, suite.GovKeeper) proposal, err = suite.GovKeeper.Proposals.Get(ctx, res.ProposalId) require.Nil(t, err) require.Equal(t, v1.StatusVotingPeriod, proposal.Status) @@ -556,8 +616,8 @@ func TestExpeditedProposal_PassAndConversionToRegular(t *testing.T) { newHeader.Time = ctx.BlockHeader().Time.Add(*params.MaxDepositPeriod).Add(*params.VotingPeriod) ctx = ctx.WithBlockHeader(newHeader) - checkInactiveProposalsQueue(t, ctx, suite.GovKeeper, true) - checkActiveProposalsQueue(t, ctx, suite.GovKeeper, false) + checkInactiveProposalsQueue(t, ctx, suite.GovKeeper) + checkActiveProposalsQueue(t, ctx, suite.GovKeeper) if tc.regularEventuallyPassing { // Validator votes YES, letting the converted regular proposal pass. @@ -575,7 +635,7 @@ func TestExpeditedProposal_PassAndConversionToRegular(t *testing.T) { submitterEventualBalance := suite.BankKeeper.GetAllBalances(ctx, addrs[0]) depositorEventualBalance := suite.BankKeeper.GetAllBalances(ctx, addrs[1]) - checkActiveProposalsQueue(t, ctx, suite.GovKeeper, true) + checkActiveProposalsQueue(t, ctx, suite.GovKeeper) proposal, err = suite.GovKeeper.Proposals.Get(ctx, res.ProposalId) require.Nil(t, err) @@ -606,7 +666,7 @@ func createValidators(t *testing.T, stakingMsgSvr stakingtypes.MsgServer, ctx sd for i := 0; i < len(addrs); i++ { valTokens := sdk.TokensFromConsensusPower(powerAmt[i], sdk.DefaultPowerReduction) valCreateMsg, err := stakingtypes.NewMsgCreateValidator( - addrs[i], pubkeys[i], sdk.NewCoin(sdk.DefaultBondDenom, valTokens), + addrs[i].String(), pubkeys[i], sdk.NewCoin(sdk.DefaultBondDenom, valTokens), TestDescription, TestCommissionRates, math.OneInt(), ) require.NoError(t, err) @@ -627,24 +687,18 @@ func getDepositMultiplier(expedited bool) int64 { return 1 } -func checkActiveProposalsQueue(t *testing.T, ctx sdk.Context, k *keeper.Keeper, invalid bool) { +func checkActiveProposalsQueue(t *testing.T, ctx sdk.Context, k *keeper.Keeper) { err := k.ActiveProposalsQueue.Walk(ctx, collections.NewPrefixUntilPairRange[time.Time, uint64](ctx.BlockTime()), func(key collections.Pair[time.Time, uint64], value uint64) (stop bool, err error) { return false, err }) - if invalid { - require.ErrorIs(t, err, collections.ErrInvalidIterator) - } else { - require.NoError(t, err) - } + + require.NoError(t, err) } -func checkInactiveProposalsQueue(t *testing.T, ctx sdk.Context, k *keeper.Keeper, invalid bool) { +func checkInactiveProposalsQueue(t *testing.T, ctx sdk.Context, k *keeper.Keeper) { err := k.InactiveProposalsQueue.Walk(ctx, collections.NewPrefixUntilPairRange[time.Time, uint64](ctx.BlockTime()), func(key collections.Pair[time.Time, uint64], value uint64) (stop bool, err error) { return false, err }) - if invalid { - require.ErrorIs(t, err, collections.ErrInvalidIterator) - } else { - require.NoError(t, err) - } + + require.NoError(t, err) } diff --git a/x/gov/autocli.go b/x/gov/autocli.go index 3b53657f79e7..8512a2878c38 100644 --- a/x/gov/autocli.go +++ b/x/gov/autocli.go @@ -1,27 +1,141 @@ package gov import ( + "fmt" + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" govv1 "cosmossdk.io/api/cosmos/gov/v1" - govv1beta1 "cosmossdk.io/api/cosmos/gov/v1beta1" + + "github.com/cosmos/cosmos-sdk/version" ) // AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { return &autocliv1.ModuleOptions{ - Tx: &autocliv1.ServiceCommandDescriptor{ - Service: govv1.Msg_ServiceDesc.ServiceName, - // map v1beta1 as a sub-command - SubCommands: map[string]*autocliv1.ServiceCommandDescriptor{ - "v1beta1": {Service: govv1beta1.Msg_ServiceDesc.ServiceName}, - }, - }, Query: &autocliv1.ServiceCommandDescriptor{ Service: govv1.Query_ServiceDesc.ServiceName, - // map v1beta1 as a sub-command - SubCommands: map[string]*autocliv1.ServiceCommandDescriptor{ - "v1beta1": {Service: govv1beta1.Query_ServiceDesc.ServiceName}, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Params", + Use: "params", + Short: "Query the parameters of the governance process", + Long: "Query the parameters of the governance process. Specify specific param types (voting|tallying|deposit) to filter results.", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "params_type", Optional: true}, + }, + }, + { + RpcMethod: "Proposals", + Use: "proposals", + Short: "Query proposals with optional filters", + Example: fmt.Sprintf("%[1]s query gov proposals --depositor cosmos1...\n%[1]s query gov proposals --voter cosmos1...\n%[1]s query gov proposals --proposal-status (unspecified | deposit-period | voting-period | passed | rejected | failed)", version.AppName), + }, + { + RpcMethod: "Proposal", + Use: "proposal [proposal-id]", + Alias: []string{"proposer"}, + Short: "Query details of a single proposal", + Example: fmt.Sprintf("%s query gov proposal 1", version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "proposal_id"}, + }, + }, + { + RpcMethod: "Vote", + Use: "vote [proposal-id] [voter-addr]", + Short: "Query details of a single vote", + Example: fmt.Sprintf("%s query gov vote 1 cosmos1...", version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "proposal_id"}, + {ProtoField: "voter"}, + }, + }, + { + RpcMethod: "Votes", + Use: "votes [proposal-id]", + Short: "Query votes of a single proposal", + Example: fmt.Sprintf("%s query gov votes 1", version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "proposal_id"}, + }, + }, + { + RpcMethod: "Deposit", + Use: "deposit [proposal-id] [depositer-addr]", + Short: "Query details of a deposit", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "proposal_id"}, + {ProtoField: "depositor"}, + }, + }, + { + RpcMethod: "Deposits", + Use: "deposits [proposal-id]", + Short: "Query deposits on a proposal", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "proposal_id"}, + }, + }, + { + RpcMethod: "TallyResult", + Use: "tally [proposal-id]", + Short: "Query the tally of a proposal vote", + Example: fmt.Sprintf("%s query gov tally 1", version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "proposal_id"}, + }, + }, + { + RpcMethod: "Constitution", + Use: "constitution", + Short: "Query the current chain constitution", + }, + }, + EnhanceCustomCommand: true, // We still have manual commands in gov that we want to keep + }, + Tx: &autocliv1.ServiceCommandDescriptor{ + Service: govv1.Msg_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Deposit", + Use: "deposit [proposal-id] [deposit]", + Short: "Deposit tokens for an active proposal", + Long: fmt.Sprintf(`Submit a deposit for an active proposal. You can find the proposal-id by running "%s query gov proposals"`, version.AppName), + Example: fmt.Sprintf(`$ %s tx gov deposit 1 10stake --from mykey`, version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "proposal_id"}, + {ProtoField: "amount", Varargs: true}, + }, + }, + { + RpcMethod: "CancelProposal", + Use: "cancel-proposal [proposal-id]", + Short: "Cancel governance proposal before the voting period ends. Must be signed by the proposal creator.", + Example: fmt.Sprintf(`$ %s tx gov cancel-proposal 1 --from mykey`, version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "proposal_id"}, + }, + }, + { + RpcMethod: "Vote", + Use: "vote [proposal-id] [option]", + Short: "Vote for an active proposal, options: yes/no/no-with-veto/abstain", + Long: fmt.Sprintf(`Submit a vote for an active proposal. Use the --metadata to optionally give a reason. You can find the proposal-id by running "%s query gov proposals"`, version.AppName), + Example: fmt.Sprintf("$ %s tx gov vote 1 yes --from mykey", version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "proposal_id"}, + {ProtoField: "option"}, + }, + FlagOptions: map[string]*autocliv1.FlagOptions{ + "metadata": {Name: "metadata", Usage: "Add a description to the vote"}, + }, + }, + { + RpcMethod: "UpdateParams", + Skip: true, // skipped because authority gated + }, }, + EnhanceCustomCommand: false, // use custom commands only until v0.51 }, } } diff --git a/x/gov/client/cli/prompt.go b/x/gov/client/cli/prompt.go index a75d7c9eda87..1722c53e2eab 100644 --- a/x/gov/client/cli/prompt.go +++ b/x/gov/client/cli/prompt.go @@ -76,15 +76,11 @@ func Prompt[T any](data T, namePrefix string) (T, error) { // create prompts prompt := promptui.Prompt{ - Label: fmt.Sprintf("Enter %s's %s", namePrefix, strings.ToLower(client.CamelCaseToString(v.Type().Field(i).Name))), + Label: fmt.Sprintf("Enter %s %s", namePrefix, strings.ToLower(client.CamelCaseToString(v.Type().Field(i).Name))), Validate: client.ValidatePromptNotEmpty, } fieldName := strings.ToLower(v.Type().Field(i).Name) - // validation per field name - if strings.Contains(fieldName, "url") { - prompt.Validate = client.ValidatePromptURL - } if strings.EqualFold(fieldName, "authority") { // pre-fill with gov address @@ -92,6 +88,7 @@ func Prompt[T any](data T, namePrefix string) (T, error) { prompt.Validate = client.ValidatePromptAddress } + // TODO(@julienrbrt) use scalar annotation instead of dumb string name matching if strings.Contains(fieldName, "addr") || strings.Contains(fieldName, "sender") || strings.Contains(fieldName, "voter") || @@ -150,9 +147,8 @@ type proposalType struct { } // Prompt the proposal type values and return the proposal and its metadata -func (p *proposalType) Prompt(cdc codec.Codec) (*proposal, types.ProposalMetadata, error) { - // set metadata - metadata, err := Prompt(types.ProposalMetadata{}, "proposal") +func (p *proposalType) Prompt(cdc codec.Codec, skipMetadata bool) (*proposal, types.ProposalMetadata, error) { + metadata, err := PromptMetadata(skipMetadata) if err != nil { return nil, metadata, fmt.Errorf("failed to set proposal metadata: %w", err) } @@ -201,8 +197,45 @@ func getProposalSuggestions() []string { return types } +// PromptMetadata prompts for proposal metadata or only title and summary if skip is true +func PromptMetadata(skip bool) (types.ProposalMetadata, error) { + if !skip { + metadata, err := Prompt(types.ProposalMetadata{}, "proposal") + if err != nil { + return metadata, fmt.Errorf("failed to set proposal metadata: %w", err) + } + + return metadata, nil + } + + // prompt for title and summary + titlePrompt := promptui.Prompt{ + Label: "Enter proposal title", + Validate: client.ValidatePromptNotEmpty, + } + + title, err := titlePrompt.Run() + if err != nil { + return types.ProposalMetadata{}, fmt.Errorf("failed to set proposal title: %w", err) + } + + summaryPrompt := promptui.Prompt{ + Label: "Enter proposal summary", + Validate: client.ValidatePromptNotEmpty, + } + + summary, err := summaryPrompt.Run() + if err != nil { + return types.ProposalMetadata{}, fmt.Errorf("failed to set proposal summary: %w", err) + } + + return types.ProposalMetadata{Title: title, Summary: summary}, nil +} + // NewCmdDraftProposal let a user generate a draft proposal. func NewCmdDraftProposal() *cobra.Command { + flagSkipMetadata := "skip-metadata" + cmd := &cobra.Command{ Use: "draft-proposal", Short: "Generate a draft proposal json file. The generated proposal json contains only one message (skeleton).", @@ -260,7 +293,9 @@ func NewCmdDraftProposal() *cobra.Command { } } - result, metadata, err := proposal.Prompt(clientCtx.Codec) + skipMetadataPrompt, _ := cmd.Flags().GetBool(flagSkipMetadata) + + result, metadata, err := proposal.Prompt(clientCtx.Codec, skipMetadataPrompt) if err != nil { return err } @@ -269,17 +304,20 @@ func NewCmdDraftProposal() *cobra.Command { return err } - if err := writeFile(draftMetadataFileName, metadata); err != nil { - return err + if !skipMetadataPrompt { + if err := writeFile(draftMetadataFileName, metadata); err != nil { + return err + } } - fmt.Printf("The draft proposal has successfully been generated.\nProposals should contain off-chain metadata, please upload the metadata JSON to IPFS.\nThen, replace the generated metadata field with the IPFS CID.\n") + cmd.Println("The draft proposal has successfully been generated.\nProposals should contain off-chain metadata, please upload the metadata JSON to IPFS.\nThen, replace the generated metadata field with the IPFS CID.") return nil }, } flags.AddTxFlagsToCmd(cmd) + cmd.Flags().Bool(flagSkipMetadata, false, "skip metadata prompt") return cmd } diff --git a/x/gov/client/cli/query.go b/x/gov/client/cli/query.go deleted file mode 100644 index 9907f05d89de..000000000000 --- a/x/gov/client/cli/query.go +++ /dev/null @@ -1,677 +0,0 @@ -package cli - -import ( - "fmt" - "strconv" - "strings" - - "cosmossdk.io/core/address" - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/version" - gcutils "github.com/cosmos/cosmos-sdk/x/gov/client/utils" - "github.com/cosmos/cosmos-sdk/x/gov/types" - v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" -) - -// GetQueryCmd returns the cli query commands for this module -func GetQueryCmd(ac address.Codec) *cobra.Command { - // Group gov queries under a subcommand - govQueryCmd := &cobra.Command{ - Use: types.ModuleName, - Short: "Querying commands for the governance module", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - govQueryCmd.AddCommand( - GetCmdQueryProposal(), - GetCmdQueryProposals(ac), - GetCmdQueryVote(ac), - GetCmdQueryVotes(), - GetCmdQueryParams(), - GetCmdQueryParam(), - GetCmdQueryProposer(), - GetCmdQueryDeposit(), - GetCmdQueryDeposits(), - GetCmdQueryTally(), - GetCmdConstitution(), - ) - - return govQueryCmd -} - -// GetCmdQueryProposal implements the query proposal command. -func GetCmdQueryProposal() *cobra.Command { - cmd := &cobra.Command{ - Use: "proposal [proposal-id]", - Args: cobra.ExactArgs(1), - Short: "Query details of a single proposal", - Long: strings.TrimSpace( - fmt.Sprintf(`Query details for a proposal. You can find the -proposal-id by running "%s query gov proposals". - -Example: -$ %s query gov proposal 1 -`, - version.AppName, version.AppName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := v1.NewQueryClient(clientCtx) - - // validate that the proposal id is a uint - proposalID, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return fmt.Errorf("proposal-id %s not a valid uint, please input a valid proposal-id", args[0]) - } - - // Query the proposal - res, err := queryClient.Proposal( - cmd.Context(), - &v1.QueryProposalRequest{ProposalId: proposalID}, - ) - if err != nil { - return err - } - - return clientCtx.PrintProto(res.Proposal) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetCmdQueryProposals implements a query proposals command. Command to Get -// Proposals Information. -func GetCmdQueryProposals(ac address.Codec) *cobra.Command { - cmd := &cobra.Command{ - Use: "proposals", - Short: "Query proposals with optional filters", - Long: strings.TrimSpace( - fmt.Sprintf(`Query for a all paginated proposals that match optional filters: - -Example: -$ %s query gov proposals --depositor cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk -$ %s query gov proposals --voter cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk -$ %s query gov proposals --status (DepositPeriod|VotingPeriod|Passed|Rejected) -$ %s query gov proposals --page=2 --limit=100 -`, - version.AppName, version.AppName, version.AppName, version.AppName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - bechDepositorAddr, _ := cmd.Flags().GetString(flagDepositor) - bechVoterAddr, _ := cmd.Flags().GetString(flagVoter) - strProposalStatus, _ := cmd.Flags().GetString(flagStatus) - - var proposalStatus v1.ProposalStatus - - if len(bechDepositorAddr) != 0 { - _, err := ac.StringToBytes(bechDepositorAddr) - if err != nil { - return err - } - } - - if len(bechVoterAddr) != 0 { - _, err := ac.StringToBytes(bechVoterAddr) - if err != nil { - return err - } - } - - if len(strProposalStatus) != 0 { - proposalStatus1, err := v1.ProposalStatusFromString(gcutils.NormalizeProposalStatus(strProposalStatus)) - proposalStatus = proposalStatus1 - if err != nil { - return err - } - } - - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := v1.NewQueryClient(clientCtx) - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - res, err := queryClient.Proposals( - cmd.Context(), - &v1.QueryProposalsRequest{ - ProposalStatus: proposalStatus, - Voter: bechVoterAddr, - Depositor: bechDepositorAddr, - Pagination: pageReq, - }, - ) - if err != nil { - return err - } - - if len(res.GetProposals()) == 0 { - return fmt.Errorf("no proposals found") - } - - return clientCtx.PrintProto(res) - }, - } - - cmd.Flags().String(flagDepositor, "", "(optional) filter by proposals deposited on by depositor") - cmd.Flags().String(flagVoter, "", "(optional) filter by proposals voted on by voted") - cmd.Flags().String(flagStatus, "", "(optional) filter proposals by proposal status, status: deposit_period/voting_period/passed/rejected") - flags.AddPaginationFlagsToCmd(cmd, "proposals") - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetCmdQueryVote implements the query proposal vote command. Command to Get a -// Vote Information. -func GetCmdQueryVote(ac address.Codec) *cobra.Command { - cmd := &cobra.Command{ - Use: "vote [proposal-id] [voter-addr]", - Args: cobra.ExactArgs(2), - Short: "Query details of a single vote", - Long: strings.TrimSpace( - fmt.Sprintf(`Query details for a single vote on a proposal given its identifier. - -Example: -$ %s query gov vote 1 cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk -`, - version.AppName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := v1.NewQueryClient(clientCtx) - - // validate that the proposal id is a uint - proposalID, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return fmt.Errorf("proposal-id %s not a valid int, please input a valid proposal-id", args[0]) - } - - // check to see if the proposal is in the store - ctx := cmd.Context() - _, err = queryClient.Proposal( - ctx, - &v1.QueryProposalRequest{ProposalId: proposalID}, - ) - if err != nil { - return fmt.Errorf("failed to fetch proposal-id %d: %s", proposalID, err) - } - - voterAddr, err := ac.StringToBytes(args[1]) - if err != nil { - return err - } - - res, err := queryClient.Vote( - ctx, - &v1.QueryVoteRequest{ProposalId: proposalID, Voter: args[1]}, - ) - if err != nil { - return err - } - - vote := res.GetVote() - if vote.Empty() { - params := v1.NewQueryVoteParams(proposalID, voterAddr) - resByTxQuery, err := gcutils.QueryVoteByTxQuery(clientCtx, params) - if err != nil { - return err - } - - if err := clientCtx.Codec.UnmarshalJSON(resByTxQuery, vote); err != nil { - return err - } - } - - return clientCtx.PrintProto(res.Vote) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetCmdQueryVotes implements the command to query for proposal votes. -func GetCmdQueryVotes() *cobra.Command { - cmd := &cobra.Command{ - Use: "votes [proposal-id]", - Args: cobra.ExactArgs(1), - Short: "Query votes on a proposal", - Long: strings.TrimSpace( - fmt.Sprintf(`Query vote details for a single proposal by its identifier. - -Example: -$ %[1]s query gov votes 1 -$ %[1]s query gov votes 1 --page=2 --limit=100 -`, - version.AppName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := v1.NewQueryClient(clientCtx) - - // validate that the proposal id is a uint - proposalID, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return fmt.Errorf("proposal-id %s not a valid int, please input a valid proposal-id", args[0]) - } - - // check to see if the proposal is in the store - ctx := cmd.Context() - proposalRes, err := queryClient.Proposal( - ctx, - &v1.QueryProposalRequest{ProposalId: proposalID}, - ) - if err != nil { - return fmt.Errorf("failed to fetch proposal-id %d: %s", proposalID, err) - } - - propStatus := proposalRes.GetProposal().Status - if !(propStatus == v1.StatusVotingPeriod || propStatus == v1.StatusDepositPeriod) { - page, _ := cmd.Flags().GetInt(flags.FlagPage) - limit, _ := cmd.Flags().GetInt(flags.FlagLimit) - - params := v1.NewQueryProposalVotesParams(proposalID, page, limit) - resByTxQuery, err := gcutils.QueryVotesByTxQuery(clientCtx, params) - if err != nil { - return err - } - - var votes v1.Votes - // TODO migrate to use JSONCodec (implement MarshalJSONArray - // or wrap lists of proto.Message in some other message) - clientCtx.LegacyAmino.MustUnmarshalJSON(resByTxQuery, &votes) - return clientCtx.PrintObjectLegacy(votes) - - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - res, err := queryClient.Votes( - ctx, - &v1.QueryVotesRequest{ProposalId: proposalID, Pagination: pageReq}, - ) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddPaginationFlagsToCmd(cmd, "votes") - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetCmdQueryDeposit implements the query proposal deposit command. Command to -// get a specific Deposit Information. -func GetCmdQueryDeposit() *cobra.Command { - cmd := &cobra.Command{ - Use: "deposit [proposal-id] [depositer-addr]", - Args: cobra.ExactArgs(2), - Short: "Query details of a deposit", - Long: strings.TrimSpace( - fmt.Sprintf(`Query details for a single proposal deposit on a proposal by its identifier. - -Example: -$ %s query gov deposit 1 cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk -`, - version.AppName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := v1.NewQueryClient(clientCtx) - - // validate that the proposal id is a uint - proposalID, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return fmt.Errorf("proposal-id %s not a valid uint, please input a valid proposal-id", args[0]) - } - - // check to see if the proposal is in the store - ctx := cmd.Context() - _, err = queryClient.Proposal( - ctx, - &v1.QueryProposalRequest{ProposalId: proposalID}, - ) - if err != nil { - return fmt.Errorf("failed to fetch proposal-id %d: %s", proposalID, err) - } - - res, err := queryClient.Deposit( - ctx, - &v1.QueryDepositRequest{ProposalId: proposalID, Depositor: args[1]}, - ) - if err != nil { - return err - } - - return clientCtx.PrintProto(res.Deposit) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetCmdQueryDeposits implements the command to query for proposal deposits. -func GetCmdQueryDeposits() *cobra.Command { - cmd := &cobra.Command{ - Use: "deposits [proposal-id]", - Args: cobra.ExactArgs(1), - Short: "Query deposits on a proposal", - Long: strings.TrimSpace( - fmt.Sprintf(`Query details for all deposits on a proposal. -You can find the proposal-id by running "%s query gov proposals". - -Example: -$ %s query gov deposits 1 -`, - version.AppName, version.AppName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := v1.NewQueryClient(clientCtx) - - // validate that the proposal id is a uint - proposalID, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return fmt.Errorf("proposal-id %s not a valid uint, please input a valid proposal-id", args[0]) - } - - // check to see if the proposal is in the store - ctx := cmd.Context() - _, err = queryClient.Proposal( - ctx, - &v1.QueryProposalRequest{ProposalId: proposalID}, - ) - if err != nil { - return fmt.Errorf("failed to fetch proposal-id %d: %s", proposalID, err) - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - res, err := queryClient.Deposits( - ctx, - &v1.QueryDepositsRequest{ProposalId: proposalID, Pagination: pageReq}, - ) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddPaginationFlagsToCmd(cmd, "deposits") - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetCmdQueryTally implements the command to query for proposal tally result. -func GetCmdQueryTally() *cobra.Command { - cmd := &cobra.Command{ - Use: "tally [proposal-id]", - Args: cobra.ExactArgs(1), - Short: "Get the tally of a proposal vote", - Long: strings.TrimSpace( - fmt.Sprintf(`Query tally of votes on a proposal. You can find -the proposal-id by running "%s query gov proposals". - -Example: -$ %s query gov tally 1 -`, - version.AppName, version.AppName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := v1.NewQueryClient(clientCtx) - - // validate that the proposal id is a uint - proposalID, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return fmt.Errorf("proposal-id %s not a valid int, please input a valid proposal-id", args[0]) - } - - // check to see if the proposal is in the store - ctx := cmd.Context() - _, err = queryClient.Proposal( - ctx, - &v1.QueryProposalRequest{ProposalId: proposalID}, - ) - if err != nil { - return fmt.Errorf("failed to fetch proposal-id %d: %s", proposalID, err) - } - - // Query store - res, err := queryClient.TallyResult( - ctx, - &v1.QueryTallyResultRequest{ProposalId: proposalID}, - ) - if err != nil { - return err - } - - return clientCtx.PrintProto(res.Tally) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetCmdQueryParams implements the query params command. -// -//nolint:staticcheck // this function contains deprecated commands that we need. -func GetCmdQueryParams() *cobra.Command { - cmd := &cobra.Command{ - Use: "params", - Short: "Query the parameters of the governance process", - Long: strings.TrimSpace( - fmt.Sprintf(`Query the all the parameters for the governance process. - -Example: -$ %s query gov params -`, - version.AppName, - ), - ), - Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := v1.NewQueryClient(clientCtx) - - // Query store for all 3 params - ctx := cmd.Context() - - res, err := queryClient.Params( - ctx, - &v1.QueryParamsRequest{ParamsType: "deposit"}, - ) - if err != nil { - return err - } - - vp := v1.NewVotingParams(res.Params.VotingPeriod) - res.VotingParams = &vp - - tp := v1.NewTallyParams(res.Params.Quorum, res.Params.Threshold, res.Params.VetoThreshold) - res.TallyParams = &tp - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetCmdQueryParam implements the query param command. -func GetCmdQueryParam() *cobra.Command { - cmd := &cobra.Command{ - Use: "param [param-type]", - Args: cobra.ExactArgs(1), - Short: "Query the parameters (voting|tallying|deposit) of the governance process", - Long: strings.TrimSpace( - fmt.Sprintf(`Query the all the parameters for the governance process. -Example: -$ %s query gov param voting -$ %s query gov param tallying -$ %s query gov param deposit -`, - version.AppName, version.AppName, version.AppName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := v1.NewQueryClient(clientCtx) - - // Query store - res, err := queryClient.Params( - cmd.Context(), - &v1.QueryParamsRequest{ParamsType: args[0]}, - ) - if err != nil { - return err - } - - var out fmt.Stringer - //nolint:staticcheck // this switch statement contains deprecated commands that we need. - switch args[0] { - case "voting": - out = res.GetVotingParams() - case "tallying": - out = res.GetTallyParams() - case "deposit": - out = res.GetDepositParams() - default: - return fmt.Errorf("argument must be one of (voting|tallying|deposit), was %s", args[0]) - } - - return clientCtx.PrintObjectLegacy(out) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetCmdQueryProposer implements the query proposer command. -func GetCmdQueryProposer() *cobra.Command { - cmd := &cobra.Command{ - Use: "proposer [proposal-id]", - Args: cobra.ExactArgs(1), - Short: "Query the proposer of a governance proposal", - Long: strings.TrimSpace( - fmt.Sprintf(`Query which address proposed a proposal with a given ID. - -Example: -$ %s query gov proposer 1 -`, - version.AppName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - // validate that the proposalID is a uint - proposalID, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return fmt.Errorf("proposal-id %s is not a valid uint", args[0]) - } - - prop, err := gcutils.QueryProposerByTxQuery(clientCtx, proposalID) - if err != nil { - return err - } - - return clientCtx.PrintObjectLegacy(prop) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -func GetCmdConstitution() *cobra.Command { - return &cobra.Command{ - Use: "constitution", - Short: "Get the constitution", - Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - queryClient := v1.NewQueryClient(clientCtx) - - resp, err := queryClient.Constitution(cmd.Context(), &v1.QueryConstitutionRequest{}) - if err != nil { - return err - } - - return clientCtx.PrintProto(resp) - }, - } -} diff --git a/x/gov/client/cli/query_test.go b/x/gov/client/cli/query_test.go deleted file mode 100644 index baa74d6d2de3..000000000000 --- a/x/gov/client/cli/query_test.go +++ /dev/null @@ -1,409 +0,0 @@ -package cli_test - -import ( - "fmt" - "strings" - - "github.com/cosmos/cosmos-sdk/codec/address" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/testutil" - "github.com/cosmos/cosmos-sdk/x/gov/client/cli" -) - -func (s *CLITestSuite) TestCmdParams() { - testCases := []struct { - name string - args []string - expCmdOutput string - }{ - { - "json output", - []string{fmt.Sprintf("--%s=json", flags.FlagOutput)}, - "--output=json", - }, - { - "text output", - []string{fmt.Sprintf("--%s=text", flags.FlagOutput)}, - "--output=text", - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryParams() - cmd.SetArgs(tc.args) - - s.Require().Contains(fmt.Sprint(cmd), strings.TrimSpace(tc.expCmdOutput)) - }) - } -} - -func (s *CLITestSuite) TestCmdParam() { - testCases := []struct { - name string - args []string - expCmdOutput string - }{ - { - "voting params", - []string{ - "voting", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - `voting --output=json`, - }, - { - "tally params", - []string{ - "tallying", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - `tallying --output=json`, - }, - { - "deposit params", - []string{ - "deposit", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - `deposit --output=json`, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryParam() - cmd.SetArgs(tc.args) - s.Require().Contains(fmt.Sprint(cmd), strings.TrimSpace(tc.expCmdOutput)) - }) - } -} - -func (s *CLITestSuite) TestCmdProposer() { - testCases := []struct { - name string - args []string - expCmdOutput string - }{ - { - "without proposal id", - []string{ - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - "--output=json", - }, - { - "with proposal id", - []string{ - "1", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - "1 --output=json", - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryProposer() - cmd.SetArgs(tc.args) - s.Require().Contains(fmt.Sprint(cmd), strings.TrimSpace(tc.expCmdOutput)) - }) - } -} - -func (s *CLITestSuite) TestCmdTally() { - testCases := []struct { - name string - args []string - expCmdOutput string - }{ - { - "without proposal id", - []string{ - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - "--output=json", - }, - { - "with proposal id (json output)", - []string{ - "2", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - "2 --output=json", - }, - { - "with proposal id (text output)", - []string{ - "1", - fmt.Sprintf("--%s=text", flags.FlagOutput), - }, - "1 --output=text", - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryTally() - cmd.SetArgs(tc.args) - s.Require().Contains(fmt.Sprint(cmd), strings.TrimSpace(tc.expCmdOutput)) - }) - } -} - -func (s *CLITestSuite) TestCmdGetProposal() { - testCases := []struct { - name string - args []string - expCmdOutput string - }{ - { - "get proposal with json response", - []string{ - "1", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - "1 --output=json", - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryProposal() - cmd.SetArgs(tc.args) - s.Require().Contains(fmt.Sprint(cmd), strings.TrimSpace(tc.expCmdOutput)) - }) - } -} - -func (s *CLITestSuite) TestCmdGetProposals() { - testCases := []struct { - name string - args []string - expCmdOutput string - }{ - { - "get proposals as json response", - []string{ - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - "--output=json", - }, - { - "get proposals with invalid status", - []string{ - "--status=unknown", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - "--status=unknown --output=json", - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryProposals(address.NewBech32Codec("cosmos")) - cmd.SetArgs(tc.args) - s.Require().Contains(fmt.Sprint(cmd), strings.TrimSpace(tc.expCmdOutput)) - }) - } -} - -func (s *CLITestSuite) TestCmdQueryDeposits() { - testCases := []struct { - name string - args []string - expCmdOutput string - }{ - { - "get deposits", - []string{ - "10", - }, - "10", - }, - { - "get deposits(json output)", - []string{ - "1", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - "1 --output=json", - }, - } - - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryDeposits() - cmd.SetArgs(tc.args) - s.Require().Contains(fmt.Sprint(cmd), strings.TrimSpace(tc.expCmdOutput)) - }) - } -} - -func (s *CLITestSuite) TestCmdQueryDeposit() { - val := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) - - testCases := []struct { - name string - args []string - expCmdOutput string - }{ - { - "get deposit with no depositer", - []string{ - "1", - }, - "1", - }, - { - "get deposit with wrong deposit address", - []string{ - "1", - "wrong address", - }, - "1 wrong address", - }, - { - "get deposit (valid req)", - []string{ - "1", - val[0].Address.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - fmt.Sprintf("1 %s --output=json", val[0].Address.String()), - }, - } - - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryDeposit() - cmd.SetArgs(tc.args) - s.Require().Contains(fmt.Sprint(cmd), strings.TrimSpace(tc.expCmdOutput)) - }) - } -} - -func (s *CLITestSuite) TestCmdQueryVotes() { - testCases := []struct { - name string - args []string - expCmdOutput string - }{ - { - "get votes with no proposal id", - []string{}, - "", - }, - { - "get votes of a proposal", - []string{ - "10", - }, - "10", - }, - { - "get votes of a proposal (json output)", - []string{ - "1", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - "1 --output=json", - }, - } - - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryVotes() - cmd.SetArgs(tc.args) - s.Require().Contains(fmt.Sprint(cmd), strings.TrimSpace(tc.expCmdOutput)) - }) - } -} - -func (s *CLITestSuite) TestCmdQueryVote() { - val := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) - - testCases := []struct { - name string - args []string - expCmdOutput string - }{ - { - "get vote of a proposal", - []string{ - "10", - val[0].Address.String(), - }, - fmt.Sprintf("10 %s", val[0].Address.String()), - }, - { - "get vote by wrong voter", - []string{ - "1", - "wrong address", - }, - "1 wrong address", - }, - { - "get vote of a proposal (json output)", - []string{ - "1", - val[0].Address.String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - fmt.Sprintf("1 %s --output=json", val[0].Address.String()), - }, - } - - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryVote(address.NewBech32Codec("cosmos")) - cmd.SetArgs(tc.args) - - if len(tc.args) != 0 { - s.Require().Contains(fmt.Sprint(cmd), strings.TrimSpace(tc.expCmdOutput)) - } - }) - } -} - -func (s *CLITestSuite) TestCmdGetConstitution() { - testCases := []struct { - name string - expOutput string - }{ - { - name: "get constitution", - expOutput: "constitution", - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdConstitution() - out, err := clitestutil.ExecTestCLICmd(s.clientCtx, cmd, []string{}) - s.Require().NoError(err) - s.Require().Contains(out.String(), tc.expOutput) - }) - } -} diff --git a/x/gov/client/cli/tx.go b/x/gov/client/cli/tx.go index ea7f3e6a265d..5fe705dba535 100644 --- a/x/gov/client/cli/tx.go +++ b/x/gov/client/cli/tx.go @@ -107,9 +107,9 @@ Where proposal.json contains: ], // metadata can be any of base64 encoded, raw text, stringified json, IPFS link to json // see below for example metadata - "metadata: "4pIMOgIGx1vZGU=", - "deposit": "10stake" - "title: "My proposal" + "metadata": "4pIMOgIGx1vZGU=", + "deposit": "10stake", + "title": "My proposal", "summary": "A short summary of my proposal", "expedited": false } diff --git a/x/gov/client/cli/tx_test.go b/x/gov/client/cli/tx_test.go index 3ae1b515c4a8..e7bfda1f9e63 100644 --- a/x/gov/client/cli/tx_test.go +++ b/x/gov/client/cli/tx_test.go @@ -6,11 +6,12 @@ import ( "io" "testing" - sdkmath "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" rpcclientmock "github.com/cometbft/cometbft/rpc/client/mock" "github.com/stretchr/testify/suite" + sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/crypto/keyring" diff --git a/x/gov/client/cli/util_test.go b/x/gov/client/cli/util_test.go index 06aa1e5f4fac..956ea66960ba 100644 --- a/x/gov/client/cli/util_test.go +++ b/x/gov/client/cli/util_test.go @@ -9,11 +9,12 @@ import ( "strings" "testing" - sdkmath "cosmossdk.io/math" "github.com/spf13/cobra" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" diff --git a/x/gov/client/utils/query.go b/x/gov/client/utils/query.go index 6ee7ca4a6541..a567f3b03aac 100644 --- a/x/gov/client/utils/query.go +++ b/x/gov/client/utils/query.go @@ -161,6 +161,7 @@ func QueryVoteByTxQuery(clientCtx client.Context, params v1.QueryVoteParams) ([] } // QueryProposerByTxQuery will query for a proposer of a governance proposal by ID. +// Deprecated: Should not be used, as not always accurate. It will be removed in v0.51. func QueryProposerByTxQuery(clientCtx client.Context, proposalID uint64) (Proposer, error) { q := fmt.Sprintf("%s.%s='%d'", types.EventTypeSubmitProposal, types.AttributeKeyProposalID, proposalID) searchResult, err := authtx.QueryTxsByEvents(clientCtx, defaultPage, defaultLimit, q, "") diff --git a/x/gov/client/utils/query_test.go b/x/gov/client/utils/query_test.go index 3210396c9d3a..cfbd8695685c 100644 --- a/x/gov/client/utils/query_test.go +++ b/x/gov/client/utils/query_test.go @@ -4,12 +4,13 @@ import ( "context" "testing" - sdkmath "cosmossdk.io/math" "github.com/cometbft/cometbft/rpc/client/mock" coretypes "github.com/cometbft/cometbft/rpc/core/types" cmttypes "github.com/cometbft/cometbft/types" "github.com/stretchr/testify/require" + sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/client" sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" diff --git a/x/gov/common_test.go b/x/gov/common_test.go index 0837c14cca8d..6d32bf4a53ed 100644 --- a/x/gov/common_test.go +++ b/x/gov/common_test.go @@ -6,10 +6,11 @@ import ( "sort" "testing" + "github.com/stretchr/testify/require" + "cosmossdk.io/depinject" sdklog "cosmossdk.io/log" "cosmossdk.io/math" - "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" @@ -128,7 +129,11 @@ func createTestSuite(t *testing.T) suite { depinject.Supply(sdklog.NewNopLogger()), ), simtestutil.DefaultStartUpConfig(), - &res.AccountKeeper, &res.BankKeeper, &res.GovKeeper, &res.DistributionKeeper, &res.StakingKeeper, + &res.AccountKeeper, + &res.BankKeeper, + &res.GovKeeper, + &res.DistributionKeeper, + &res.StakingKeeper, ) require.NoError(t, err) diff --git a/x/gov/genesis.go b/x/gov/genesis.go index 8877324d654f..0eeebcd72e21 100644 --- a/x/gov/genesis.go +++ b/x/gov/genesis.go @@ -1,7 +1,6 @@ package gov import ( - "errors" "fmt" "cosmossdk.io/collections" @@ -98,7 +97,7 @@ func ExportGenesis(ctx sdk.Context, k *keeper.Keeper) (*v1.GenesisState, error) proposals = append(proposals, &value) return false, nil }) - if err != nil && !errors.Is(err, collections.ErrInvalidIterator) { + if err != nil { return nil, err } @@ -117,7 +116,7 @@ func ExportGenesis(ctx sdk.Context, k *keeper.Keeper) (*v1.GenesisState, error) proposalsDeposits = append(proposalsDeposits, &value) return false, nil }) - if err != nil && !errors.Is(err, collections.ErrInvalidIterator) { + if err != nil { panic(err) } @@ -127,7 +126,7 @@ func ExportGenesis(ctx sdk.Context, k *keeper.Keeper) (*v1.GenesisState, error) proposalsVotes = append(proposalsVotes, &value) return false, nil }) - if err != nil && !errors.Is(err, collections.ErrInvalidIterator) { + if err != nil { panic(err) } diff --git a/x/gov/genesis_test.go b/x/gov/genesis_test.go index 2f94bf360908..f65bcce30587 100644 --- a/x/gov/genesis_test.go +++ b/x/gov/genesis_test.go @@ -3,9 +3,10 @@ package gov_test import ( "testing" - sdkmath "cosmossdk.io/math" "github.com/stretchr/testify/require" + sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" diff --git a/x/gov/keeper/common_test.go b/x/gov/keeper/common_test.go index 4181d886afb6..fc90a8f257c8 100644 --- a/x/gov/keeper/common_test.go +++ b/x/gov/keeper/common_test.go @@ -4,13 +4,12 @@ import ( "fmt" "testing" - "github.com/stretchr/testify/require" - - "cosmossdk.io/math" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" cmttime "github.com/cometbft/cometbft/types/time" - "github.com/golang/mock/gomock" + "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" + "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/baseapp" @@ -91,10 +90,10 @@ func setupGovKeeper(t *testing.T) ( return sdk.TokensFromConsensusPower(power, math.NewIntFromUint64(1000000)) }).AnyTimes() - stakingKeeper.EXPECT().BondDenom(ctx).Return("stake").AnyTimes() + stakingKeeper.EXPECT().BondDenom(ctx).Return("stake", nil).AnyTimes() stakingKeeper.EXPECT().IterateBondedValidatorsByPower(gomock.Any(), gomock.Any()).AnyTimes() stakingKeeper.EXPECT().IterateDelegations(gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes() - stakingKeeper.EXPECT().TotalBondedTokens(gomock.Any()).Return(math.NewInt(10000000)).AnyTimes() + stakingKeeper.EXPECT().TotalBondedTokens(gomock.Any()).Return(math.NewInt(10000000), nil).AnyTimes() distributionKeeper.EXPECT().FundCommunityPool(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes() // Gov keeper initializations @@ -106,6 +105,8 @@ func setupGovKeeper(t *testing.T) ( govKeeper.SetLegacyRouter(govRouter) err := govKeeper.Params.Set(ctx, v1.DefaultParams()) require.NoError(t, err) + err = govKeeper.Constitution.Set(ctx, "constitution") + require.NoError(t, err) // Register all handlers for the MegServiceRouter. msr.SetInterfaceRegistry(encCfg.InterfaceRegistry) diff --git a/x/gov/keeper/deposit.go b/x/gov/keeper/deposit.go index 6acee3f9d31a..9229c30432f8 100644 --- a/x/gov/keeper/deposit.go +++ b/x/gov/keeper/deposit.go @@ -3,12 +3,14 @@ package keeper import ( "context" "fmt" + "strings" "cosmossdk.io/collections" - "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" disttypes "github.com/cosmos/cosmos-sdk/x/distribution/types" "github.com/cosmos/cosmos-sdk/x/gov/types" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" @@ -50,7 +52,7 @@ func (keeper Keeper) DeleteAndBurnDeposits(ctx context.Context, proposalID uint6 func (keeper Keeper) IterateDeposits(ctx context.Context, proposalID uint64, cb func(key collections.Pair[uint64, sdk.AccAddress], value v1.Deposit) (bool, error)) error { rng := collections.NewPrefixedPairRange[uint64, sdk.AccAddress](proposalID) err := keeper.Deposits.Walk(ctx, rng, cb) - if err != nil && !errors.IsOf(err, collections.ErrInvalidIterator) { + if err != nil { return err } return nil @@ -70,6 +72,54 @@ func (keeper Keeper) AddDeposit(ctx context.Context, proposalID uint64, deposito return false, errors.Wrapf(types.ErrInactiveProposal, "%d", proposalID) } + // Check coins to be deposited match the proposal's deposit params + params, err := keeper.Params.Get(ctx) + if err != nil { + return false, err + } + + minDepositAmount := proposal.GetMinDepositFromParams(params) + minDepositRatio, err := sdkmath.LegacyNewDecFromStr(params.GetMinDepositRatio()) + if err != nil { + return false, err + } + + // the deposit must only contain valid denoms (listed in the min deposit param) + if err := keeper.validateDepositDenom(ctx, params, depositAmount); err != nil { + return false, err + } + + // If minDepositRatio is set, the deposit must be equal or greater than minDepositAmount*minDepositRatio + // for at least one denom. If minDepositRatio is zero we skip this check. + if !minDepositRatio.IsZero() { + var ( + depositThresholdMet bool + thresholds []string + ) + for _, minDep := range minDepositAmount { + // calculate the threshold for this denom, and hold a list to later return a useful error message + threshold := sdk.NewCoin(minDep.GetDenom(), minDep.Amount.ToLegacyDec().Mul(minDepositRatio).TruncateInt()) + thresholds = append(thresholds, threshold.String()) + + found, deposit := depositAmount.Find(minDep.Denom) + if !found { // if not found, continue, as we know the deposit contains at least 1 valid denom + continue + } + + // Once we know at least one threshold has been met, we can break. The deposit + // might contain other denoms but we don't care. + if deposit.IsGTE(threshold) { + depositThresholdMet = true + break + } + } + + // the threshold must be met with at least one denom, if not, return the list of minimum deposits + if !depositThresholdMet { + return false, errors.Wrapf(types.ErrMinDepositTooSmall, "received %s but need at least one of the following: %s", depositAmount, strings.Join(thresholds, ",")) + } + } + // update the governance module's account coins pool err = keeper.bankKeeper.SendCoinsFromAccountToModule(ctx, depositorAddr, types.ModuleName, depositAmount) if err != nil { @@ -85,12 +135,6 @@ func (keeper Keeper) AddDeposit(ctx context.Context, proposalID uint64, deposito // Check if deposit has provided sufficient total funds to transition the proposal into the voting period activatedVotingPeriod := false - params, err := keeper.Params.Get(ctx) - if err != nil { - return false, err - } - minDepositAmount := proposal.GetMinDepositFromParams(params) - if proposal.Status == v1.StatusDepositPeriod && sdk.NewCoins(proposal.TotalDeposit...).IsAllGTE(minDepositAmount) { err = keeper.ActivateVotingPeriod(ctx, proposal) if err != nil { @@ -115,12 +159,16 @@ func (keeper Keeper) AddDeposit(ctx context.Context, proposalID uint64, deposito } // called when deposit has been added to a proposal, however the proposal may not be active - keeper.Hooks().AfterProposalDeposit(ctx, proposalID, depositorAddr) + err = keeper.Hooks().AfterProposalDeposit(ctx, proposalID, depositorAddr) + if err != nil { + return false, err + } sdkCtx := sdk.UnwrapSDKContext(ctx) sdkCtx.EventManager().EmitEvent( sdk.NewEvent( types.EventTypeProposalDeposit, + sdk.NewAttribute(types.AttributeKeyDepositor, depositorAddr.String()), sdk.NewAttribute(sdk.AttributeKeyAmount, depositAmount.String()), sdk.NewAttribute(types.AttributeKeyProposalID, fmt.Sprintf("%d", proposalID)), ), @@ -154,18 +202,18 @@ func (keeper Keeper) ChargeDeposit(ctx context.Context, proposalID uint64, destA var remainingAmount sdk.Coins - for _, coins := range deposit.Amount { - burnAmount := sdk.NewDecFromInt(coins.Amount).Mul(rate).TruncateInt() + for _, coin := range deposit.Amount { + burnAmount := sdkmath.LegacyNewDecFromInt(coin.Amount).Mul(rate).TruncateInt() // remaining amount = deposits amount - burn amount remainingAmount = remainingAmount.Add( sdk.NewCoin( - coins.Denom, - coins.Amount.Sub(burnAmount), + coin.Denom, + coin.Amount.Sub(burnAmount), ), ) cancellationCharges = cancellationCharges.Add( sdk.NewCoin( - coins.Denom, + coin.Denom, burnAmount, ), ) @@ -190,7 +238,7 @@ func (keeper Keeper) ChargeDeposit(ctx context.Context, proposalID uint64, destA // get the distribution module account address distributionAddress := keeper.authKeeper.GetModuleAddress(disttypes.ModuleName) switch { - case len(destAddress) == 0: + case destAddress == "": // burn the cancellation charges from deposits err := keeper.bankKeeper.BurnCoins(ctx, types.ModuleName, cancellationCharges) if err != nil { @@ -234,13 +282,12 @@ func (keeper Keeper) RefundAndDeleteDeposits(ctx context.Context, proposalID uin // validateInitialDeposit validates if initial deposit is greater than or equal to the minimum // required at the time of proposal submission. This threshold amount is determined by // the deposit parameters. Returns nil on success, error otherwise. -func (keeper Keeper) validateInitialDeposit(ctx context.Context, initialDeposit sdk.Coins, expedited bool) error { - params, err := keeper.Params.Get(ctx) - if err != nil { - return err +func (keeper Keeper) validateInitialDeposit(ctx context.Context, params v1.Params, initialDeposit sdk.Coins, expedited bool) error { + if !initialDeposit.IsValid() || initialDeposit.IsAnyNegative() { + return errors.Wrap(sdkerrors.ErrInvalidCoins, initialDeposit.String()) } - minInitialDepositRatio, err := sdk.NewDecFromStr(params.MinInitialDepositRatio) + minInitialDepositRatio, err := sdkmath.LegacyNewDecFromStr(params.MinInitialDepositRatio) if err != nil { return err } @@ -256,10 +303,28 @@ func (keeper Keeper) validateInitialDeposit(ctx context.Context, initialDeposit } for i := range minDepositCoins { - minDepositCoins[i].Amount = sdk.NewDecFromInt(minDepositCoins[i].Amount).Mul(minInitialDepositRatio).RoundInt() + minDepositCoins[i].Amount = sdkmath.LegacyNewDecFromInt(minDepositCoins[i].Amount).Mul(minInitialDepositRatio).RoundInt() } if !initialDeposit.IsAllGTE(minDepositCoins) { return errors.Wrapf(types.ErrMinDepositTooSmall, "was (%s), need (%s)", initialDeposit, minDepositCoins) } return nil } + +// validateDepositDenom validates if the deposit denom is accepted by the governance module. +func (keeper Keeper) validateDepositDenom(ctx context.Context, params v1.Params, depositAmount sdk.Coins) error { + denoms := []string{} + acceptedDenoms := make(map[string]bool, len(params.MinDeposit)) + for _, coin := range params.MinDeposit { + acceptedDenoms[coin.Denom] = true + denoms = append(denoms, coin.Denom) + } + + for _, coin := range depositAmount { + if _, ok := acceptedDenoms[coin.Denom]; !ok { + return errors.Wrapf(types.ErrInvalidDepositDenom, "deposited %s, but gov accepts only the following denom(s): %v", depositAmount, denoms) + } + } + + return nil +} diff --git a/x/gov/keeper/deposit_test.go b/x/gov/keeper/deposit_test.go index ed481338e9d2..4438bc494d1d 100644 --- a/x/gov/keeper/deposit_test.go +++ b/x/gov/keeper/deposit_test.go @@ -4,10 +4,10 @@ import ( "fmt" "testing" - "cosmossdk.io/collections" + "github.com/stretchr/testify/require" + "cosmossdk.io/collections" sdkmath "cosmossdk.io/math" - "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/codec/address" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" @@ -156,6 +156,85 @@ func TestDeposits(t *testing.T) { } } +func TestDepositAmount(t *testing.T) { + testcases := []struct { + name string + deposit sdk.Coins + minDepositRatio string + err string + }{ + { + name: "good amount and denoms", + deposit: sdk.NewCoins(sdk.NewInt64Coin("stake", 10000)), + minDepositRatio: "0.001", + }, + { + name: "good amount and denoms but not enough balance for zcoin", + deposit: sdk.NewCoins(sdk.NewInt64Coin("stake", 10000), sdk.NewInt64Coin("zcoin", 1)), + minDepositRatio: "0.001", + err: "not enough balance", + }, + { + name: "too small amount", + deposit: sdk.NewCoins(sdk.NewInt64Coin("stake", 10)), + minDepositRatio: "0.001", + err: "received 10stake but need at least one of the following: 10000stake,10zcoin: minimum deposit is too small", + }, + { + name: "too small amount with another coin", + deposit: sdk.NewCoins(sdk.NewInt64Coin("zcoin", 1)), + minDepositRatio: "0.001", + err: "received 1zcoin but need at least one of the following: 10000stake,10zcoin: minimum deposit is too small", + }, + { + name: "bad denom", + deposit: sdk.NewCoins(sdk.NewInt64Coin("euro", 10000)), + minDepositRatio: "0.001", + err: "deposited 10000euro, but gov accepts only the following denom(s): [stake zcoin]: invalid deposit denom", + }, + { + name: "mix containing bad and good denom", + deposit: sdk.NewCoins(sdk.NewInt64Coin("stake", 10000), sdk.NewInt64Coin("euro", 10000)), + minDepositRatio: "0.001", + err: "deposited 10000euro,10000stake, but gov accepts only the following denom(s): [stake zcoin]: invalid deposit denom", + }, + { + name: "minDepositRatio is zero", + deposit: sdk.NewCoins(sdk.NewInt64Coin("stake", 10)), + minDepositRatio: "0.0", + }, + } + + for _, tc := range testcases { + t.Run(tc.name, func(t *testing.T) { + govKeeper, authKeeper, bankKeeper, stakingKeeper, distrKeeper, _, ctx := setupGovKeeper(t) + trackMockBalances(bankKeeper, distrKeeper) + + testAddrs := simtestutil.AddTestAddrsIncremental(bankKeeper, stakingKeeper, ctx, 2, sdkmath.NewInt(1000000000000000)) + authKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec("cosmos")).AnyTimes() + + params, _ := govKeeper.Params.Get(ctx) + params.MinDepositRatio = tc.minDepositRatio + params.MinDeposit = sdk.NewCoins(params.MinDeposit...).Add(sdk.NewCoin("zcoin", sdkmath.NewInt(10000))) // coins must be sorted by denom + err := govKeeper.Params.Set(ctx, params) + require.NoError(t, err) + + tp := TestProposal + proposal, err := govKeeper.SubmitProposal(ctx, tp, "", "title", "summary", testAddrs[0], false) + require.NoError(t, err) + proposalID := proposal.Id + + _, err = govKeeper.AddDeposit(ctx, proposalID, testAddrs[0], tc.deposit) + if tc.err != "" { + require.Error(t, err) + require.Equal(t, tc.err, err.Error()) + } else { + require.NoError(t, err) + } + }) + } +} + func TestValidateInitialDeposit(t *testing.T) { testcases := map[string]struct { minDeposit sdk.Coins diff --git a/x/gov/keeper/export_test.go b/x/gov/keeper/export_test.go index f56e25c34c0e..f9db25240adb 100644 --- a/x/gov/keeper/export_test.go +++ b/x/gov/keeper/export_test.go @@ -5,5 +5,10 @@ import sdk "github.com/cosmos/cosmos-sdk/types" // ValidateInitialDeposit is a helper function used only in deposit tests which returns the same // functionality of validateInitialDeposit private function. func (k Keeper) ValidateInitialDeposit(ctx sdk.Context, initialDeposit sdk.Coins, expedited bool) error { - return k.validateInitialDeposit(ctx, initialDeposit, expedited) + params, err := k.Params.Get(ctx) + if err != nil { + return err + } + + return k.validateInitialDeposit(ctx, params, initialDeposit, expedited) } diff --git a/x/gov/keeper/grpc_query.go b/x/gov/keeper/grpc_query.go index 510e975b4377..b42a114cfb14 100644 --- a/x/gov/keeper/grpc_query.go +++ b/x/gov/keeper/grpc_query.go @@ -3,11 +3,10 @@ package keeper import ( "context" - "cosmossdk.io/collections" - "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "cosmossdk.io/collections" "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" @@ -57,8 +56,7 @@ func (q queryServer) Proposal(ctx context.Context, req *v1.QueryProposalRequest) // Proposals implements the Query/Proposals gRPC method func (q queryServer) Proposals(ctx context.Context, req *v1.QueryProposalsRequest) (*v1.QueryProposalsResponse, error) { - var filteredProposals []*v1.Proposal - _, pageRes, err := query.CollectionFilteredPaginate(ctx, q.k.Proposals, req.Pagination, func(key uint64, p v1.Proposal) (bool, error) { + filteredProposals, pageRes, err := query.CollectionFilteredPaginate(ctx, q.k.Proposals, req.Pagination, func(key uint64, p v1.Proposal) (include bool, err error) { matchVoter, matchDepositor, matchStatus := true, true, true // match status (if supplied/valid) @@ -91,11 +89,14 @@ func (q queryServer) Proposals(ctx context.Context, req *v1.QueryProposalsReques // if all match, append to results if matchVoter && matchDepositor && matchStatus { - filteredProposals = append(filteredProposals, &p) + return true, nil } // continue to next item, do not include because we're appending results above. return false, nil + }, func(_ uint64, value v1.Proposal) (*v1.Proposal, error) { + return &value, nil }) + if err != nil && !errors.IsOf(err, collections.ErrInvalidIterator) { return nil, status.Error(codes.Internal, err.Error()) } @@ -143,10 +144,8 @@ func (q queryServer) Votes(ctx context.Context, req *v1.QueryVotesRequest) (*v1. return nil, status.Error(codes.InvalidArgument, "proposal id can not be 0") } - var votes v1.Votes - _, pageRes, err := query.CollectionFilteredPaginate(ctx, q.k.Votes, req.Pagination, func(_ collections.Pair[uint64, sdk.AccAddress], value v1.Vote) (include bool, err error) { - votes = append(votes, &value) - return false, nil // not including results because they're being appended. + votes, pageRes, err := query.CollectionPaginate(ctx, q.k.Votes, req.Pagination, func(_ collections.Pair[uint64, sdk.AccAddress], value v1.Vote) (vote *v1.Vote, err error) { + return &value, nil }, query.WithCollectionPaginationPairPrefix[uint64, sdk.AccAddress](req.ProposalId)) if err != nil { return nil, status.Error(codes.Internal, err.Error()) @@ -180,11 +179,10 @@ func (q queryServer) Params(ctx context.Context, req *v1.QueryParamsRequest) (*v case v1.ParamTallying: tallyParams := v1.NewTallyParams(params.Quorum, params.Threshold, params.VetoThreshold) response.TallyParams = &tallyParams - default: - return nil, status.Errorf(codes.InvalidArgument, - "%s is not a valid parameter type", req.ParamsType) - + if len(req.ParamsType) > 0 { + return nil, status.Errorf(codes.InvalidArgument, "unknown params type: %s", req.ParamsType) + } } response.Params = ¶ms @@ -228,9 +226,8 @@ func (q queryServer) Deposits(ctx context.Context, req *v1.QueryDepositsRequest) } var deposits []*v1.Deposit - _, pageRes, err := query.CollectionFilteredPaginate(ctx, q.k.Deposits, req.Pagination, func(_ collections.Pair[uint64, sdk.AccAddress], deposit v1.Deposit) (bool, error) { - deposits = append(deposits, &deposit) - return false, nil // we don't include results as they're being appended to the slice above. + deposits, pageRes, err := query.CollectionPaginate(ctx, q.k.Deposits, req.Pagination, func(_ collections.Pair[uint64, sdk.AccAddress], deposit v1.Deposit) (*v1.Deposit, error) { + return &deposit, nil }, query.WithCollectionPaginationPairPrefix[uint64, sdk.AccAddress](req.ProposalId)) if err != nil { return nil, status.Error(codes.Internal, err.Error()) @@ -263,7 +260,7 @@ func (q queryServer) TallyResult(ctx context.Context, req *v1.QueryTallyResultRe case proposal.Status == v1.StatusDepositPeriod: tallyResult = v1.EmptyTallyResult() - case proposal.Status == v1.StatusPassed || proposal.Status == v1.StatusRejected: + case proposal.Status == v1.StatusPassed || proposal.Status == v1.StatusRejected || proposal.Status == v1.StatusFailed: tallyResult = *proposal.FinalTallyResult default: @@ -379,6 +376,10 @@ func (q legacyQueryServer) Params(ctx context.Context, req *v1beta1.QueryParamsR response := &v1beta1.QueryParamsResponse{} + if resp.DepositParams == nil && resp.VotingParams == nil && resp.TallyParams == nil { + return nil, status.Errorf(codes.InvalidArgument, "%s is not a valid parameter type", req.ParamsType) + } + if resp.DepositParams != nil { minDeposit := sdk.NewCoins(resp.DepositParams.MinDeposit...) response.DepositParams = v1beta1.NewDepositParams(minDeposit, *resp.DepositParams.MaxDepositPeriod) diff --git a/x/gov/keeper/grpc_query_test.go b/x/gov/keeper/grpc_query_test.go index 7c63d36417fc..bba32ad3d43a 100644 --- a/x/gov/keeper/grpc_query_test.go +++ b/x/gov/keeper/grpc_query_test.go @@ -7,10 +7,9 @@ import ( "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/codec/address" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/types/query" v3 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v3" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" @@ -87,6 +86,17 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposal() { } } +func (suite *KeeperTestSuite) TestGRPCQueryConstitution() { + suite.reset() + queryClient := suite.queryClient + + expRes := &v1.QueryConstitutionResponse{Constitution: "constitution"} + + constitution, err := queryClient.Constitution(gocontext.Background(), &v1.QueryConstitutionRequest{}) + suite.Require().NoError(err) + suite.Require().Equal(expRes, constitution) +} + func (suite *KeeperTestSuite) TestLegacyGRPCQueryProposal() { suite.reset() ctx, queryClient, addrs := suite.ctx, suite.legacyQueryClient, suite.addrs @@ -223,7 +233,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { true, }, { - "request 2nd page with limit 4", + "request 2nd page with limit 3", func() { req = &v1.QueryProposalsRequest{ Pagination: &query.PageRequest{Offset: 3, Limit: 3}, @@ -295,6 +305,70 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { }, true, }, + { + "request with filter of status voting period", + func() { + req = &v1.QueryProposalsRequest{ + ProposalStatus: v1.StatusVotingPeriod, + } + + var proposals []*v1.Proposal + for i := 0; i < len(testProposals); i++ { + if testProposals[i].GetStatus() == v1.StatusVotingPeriod { + proposals = append(proposals, testProposals[i]) + } + } + + expRes = &v1.QueryProposalsResponse{ + Proposals: proposals, + } + }, + true, + }, + { + "request with filter of status deposit period", + func() { + req = &v1.QueryProposalsRequest{ + ProposalStatus: v1.StatusDepositPeriod, + } + + var proposals []*v1.Proposal + for i := 0; i < len(testProposals); i++ { + if testProposals[i].GetStatus() == v1.StatusDepositPeriod { + proposals = append(proposals, testProposals[i]) + } + } + + expRes = &v1.QueryProposalsResponse{ + Proposals: proposals, + } + }, + true, + }, + { + "request with filter of status deposit period with limit 2", + func() { + req = &v1.QueryProposalsRequest{ + ProposalStatus: v1.StatusDepositPeriod, + Pagination: &query.PageRequest{ + Limit: 2, + CountTotal: true, + }, + } + + var proposals []*v1.Proposal + for i := 0; i < len(testProposals) && len(proposals) < 2; i++ { + if testProposals[i].GetStatus() == v1.StatusDepositPeriod { + proposals = append(proposals, testProposals[i]) + } + } + + expRes = &v1.QueryProposalsResponse{ + Proposals: proposals, + } + }, + true, + }, } for _, testCase := range testCases { @@ -444,7 +518,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVote() { Voter: addrs[0].String(), } - expRes = &v1.QueryVoteResponse{Vote: &v1.Vote{ProposalId: proposal.Id, Voter: addrs[0].String(), Options: []*v1.WeightedVoteOption{{Option: v1.OptionAbstain, Weight: sdk.MustNewDecFromStr("1.0").String()}}}} + expRes = &v1.QueryVoteResponse{Vote: &v1.Vote{ProposalId: proposal.Id, Voter: addrs[0].String(), Options: []*v1.WeightedVoteOption{{Option: v1.OptionAbstain, Weight: math.LegacyMustNewDecFromStr("1.0").String()}}}} }, true, }, @@ -817,11 +891,11 @@ func (suite *KeeperTestSuite) TestGRPCQueryParams() { expPass bool }{ { - "empty request", + "empty request (valid and returns all params)", func() { req = &v1.QueryParamsRequest{} }, - false, + true, }, { "deposit params request", @@ -1486,6 +1560,38 @@ func (suite *KeeperTestSuite) TestGRPCQueryTallyResult() { }, true, }, + { + "proposal status failed", + func() { + propTime := time.Now() + proposal := v1.Proposal{ + Id: 1, + Status: v1.StatusFailed, + FinalTallyResult: &v1.TallyResult{ + YesCount: "4", + AbstainCount: "1", + NoCount: "0", + NoWithVetoCount: "0", + }, + SubmitTime: &propTime, + VotingStartTime: &propTime, + VotingEndTime: &propTime, + Metadata: "proposal metadata", + } + err := suite.govKeeper.Proposals.Set(suite.ctx, proposal.Id, proposal) + suite.Require().NoError(err) + + req = &v1.QueryTallyResultRequest{ProposalId: proposal.Id} + + expTally = &v1.TallyResult{ + YesCount: "4", + AbstainCount: "1", + NoCount: "0", + NoWithVetoCount: "0", + } + }, + true, + }, } for _, testCase := range testCases { @@ -1622,6 +1728,38 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryTallyResult() { }, true, }, + { + "proposal status failed", + func() { + propTime := time.Now() + proposal := v1.Proposal{ + Id: 1, + Status: v1.StatusFailed, + FinalTallyResult: &v1.TallyResult{ + YesCount: "4", + AbstainCount: "1", + NoCount: "0", + NoWithVetoCount: "0", + }, + SubmitTime: &propTime, + VotingStartTime: &propTime, + VotingEndTime: &propTime, + Metadata: "proposal metadata", + } + err := suite.govKeeper.Proposals.Set(suite.ctx, proposal.Id, proposal) + suite.Require().NoError(err) + + req = &v1beta1.QueryTallyResultRequest{ProposalId: proposal.Id} + + expTally = &v1beta1.TallyResult{ + Yes: math.NewInt(4), + Abstain: math.NewInt(1), + No: math.NewInt(0), + NoWithVeto: math.NewInt(0), + } + }, + true, + }, } for _, testCase := range testCases { diff --git a/x/gov/keeper/hooks_test.go b/x/gov/keeper/hooks_test.go index 2a8473e56ce6..f859f923a841 100644 --- a/x/gov/keeper/hooks_test.go +++ b/x/gov/keeper/hooks_test.go @@ -27,24 +27,29 @@ type MockGovHooksReceiver struct { AfterProposalVotingPeriodEndedValid bool } -func (h *MockGovHooksReceiver) AfterProposalSubmission(ctx context.Context, proposalID uint64) { +func (h *MockGovHooksReceiver) AfterProposalSubmission(ctx context.Context, proposalID uint64) error { h.AfterProposalSubmissionValid = true + return nil } -func (h *MockGovHooksReceiver) AfterProposalDeposit(ctx context.Context, proposalID uint64, depositorAddr sdk.AccAddress) { +func (h *MockGovHooksReceiver) AfterProposalDeposit(ctx context.Context, proposalID uint64, depositorAddr sdk.AccAddress) error { h.AfterProposalDepositValid = true + return nil } -func (h *MockGovHooksReceiver) AfterProposalVote(ctx context.Context, proposalID uint64, voterAddr sdk.AccAddress) { +func (h *MockGovHooksReceiver) AfterProposalVote(ctx context.Context, proposalID uint64, voterAddr sdk.AccAddress) error { h.AfterProposalVoteValid = true + return nil } -func (h *MockGovHooksReceiver) AfterProposalFailedMinDeposit(ctx context.Context, proposalID uint64) { +func (h *MockGovHooksReceiver) AfterProposalFailedMinDeposit(ctx context.Context, proposalID uint64) error { h.AfterProposalFailedMinDepositValid = true + return nil } -func (h *MockGovHooksReceiver) AfterProposalVotingPeriodEnded(ctx context.Context, proposalID uint64) { +func (h *MockGovHooksReceiver) AfterProposalVotingPeriodEnded(ctx context.Context, proposalID uint64) error { h.AfterProposalVotingPeriodEndedValid = true + return nil } func TestHooks(t *testing.T) { @@ -53,6 +58,7 @@ func TestHooks(t *testing.T) { addrs := simtestutil.AddTestAddrs(bankKeeper, stakingKeeper, ctx, 1, minDeposit[0].Amount) authKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec("cosmos")).AnyTimes() + stakingKeeper.EXPECT().ValidatorAddressCodec().Return(address.NewBech32Codec("cosmosvaloper")).AnyTimes() govHooksReceiver := MockGovHooksReceiver{} diff --git a/x/gov/keeper/invariants.go b/x/gov/keeper/invariants.go deleted file mode 100644 index e8cd15d5737f..000000000000 --- a/x/gov/keeper/invariants.go +++ /dev/null @@ -1,45 +0,0 @@ -package keeper - -import ( - "errors" - "fmt" - - "cosmossdk.io/collections" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/gov/types" - v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" -) - -// RegisterInvariants registers all governance invariants -func RegisterInvariants(ir sdk.InvariantRegistry, keeper *Keeper, bk types.BankKeeper) { - ir.RegisterRoute(types.ModuleName, "module-account", ModuleAccountInvariant(keeper, bk)) -} - -// ModuleAccountInvariant checks that the module account coins reflects the sum of -// deposit amounts held on store. -func ModuleAccountInvariant(keeper *Keeper, bk types.BankKeeper) sdk.Invariant { - return func(ctx sdk.Context) (string, bool) { - var expectedDeposits sdk.Coins - - err := keeper.Deposits.Walk(ctx, nil, func(key collections.Pair[uint64, sdk.AccAddress], value v1.Deposit) (stop bool, err error) { - expectedDeposits = expectedDeposits.Add(value.Amount...) - return false, nil - }) - if err != nil && !errors.Is(err, collections.ErrInvalidIterator) { - panic(err) - } - - macc := keeper.GetGovernanceAccount(ctx) - balances := bk.GetAllBalances(ctx, macc.GetAddress()) - - // Require that the deposit balances are <= than the x/gov module's total - // balances. We use the <= operator since external funds can be sent to x/gov - // module's account and so the balance can be larger. - broken := !balances.IsAllGTE(expectedDeposits) - - return sdk.FormatInvariant(types.ModuleName, "deposits", - fmt.Sprintf("\tgov ModuleAccount coins: %s\n\tsum of deposit amounts: %s\n", - balances, expectedDeposits)), broken - } -} diff --git a/x/gov/keeper/keeper.go b/x/gov/keeper/keeper.go index 6fdeb324fa68..63ff7c252783 100644 --- a/x/gov/keeper/keeper.go +++ b/x/gov/keeper/keeper.go @@ -6,9 +6,9 @@ import ( "time" "cosmossdk.io/collections" - corestoretypes "cosmossdk.io/core/store" "cosmossdk.io/log" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" @@ -103,8 +103,8 @@ func NewKeeper( authority: authority, Constitution: collections.NewItem(sb, types.ConstitutionKey, "constitution", collections.StringValue), Params: collections.NewItem(sb, types.ParamsKey, "params", codec.CollValue[v1.Params](cdc)), - Deposits: collections.NewMap(sb, types.DepositsKeyPrefix, "deposits", collections.PairKeyCodec(collections.Uint64Key, sdk.AddressKeyAsIndexKey(sdk.AccAddressKey)), codec.CollValue[v1.Deposit](cdc)), // nolint: staticcheck // sdk.AddressKeyAsIndexKey is needed to retain state compatibility - Votes: collections.NewMap(sb, types.VotesKeyPrefix, "votes", collections.PairKeyCodec(collections.Uint64Key, sdk.AddressKeyAsIndexKey(sdk.AccAddressKey)), codec.CollValue[v1.Vote](cdc)), // nolint: staticcheck // sdk.AddressKeyAsIndexKey is needed to retain state compatibility + Deposits: collections.NewMap(sb, types.DepositsKeyPrefix, "deposits", collections.PairKeyCodec(collections.Uint64Key, sdk.LengthPrefixedAddressKey(sdk.AccAddressKey)), codec.CollValue[v1.Deposit](cdc)), // nolint: staticcheck // sdk.LengthPrefixedAddressKey is needed to retain state compatibility + Votes: collections.NewMap(sb, types.VotesKeyPrefix, "votes", collections.PairKeyCodec(collections.Uint64Key, sdk.LengthPrefixedAddressKey(sdk.AccAddressKey)), codec.CollValue[v1.Vote](cdc)), // nolint: staticcheck // sdk.LengthPrefixedAddressKey is needed to retain state compatibility ProposalID: collections.NewSequence(sb, types.ProposalIDKey, "proposal_id"), Proposals: collections.NewMap(sb, types.ProposalsKeyPrefix, "proposals", collections.Uint64Key, codec.CollValue[v1.Proposal](cdc)), ActiveProposalsQueue: collections.NewMap(sb, types.ActiveProposalQueuePrefix, "active_proposals_queue", collections.PairKeyCodec(sdk.TimeKey, collections.Uint64Key), collections.Uint64Value), // sdk.TimeKey is needed to retain state compatibility @@ -183,3 +183,12 @@ func (k Keeper) assertMetadataLength(metadata string) error { } return nil } + +// assertSummaryLength returns an error if given summary length +// is greater than a pre-defined 40*MaxMetadataLen. +func (k Keeper) assertSummaryLength(summary string) error { + if summary != "" && uint64(len(summary)) > 40*k.config.MaxMetadataLen { + return types.ErrSummaryTooLong.Wrapf("got summary with length %d", len(summary)) + } + return nil +} diff --git a/x/gov/keeper/keeper_test.go b/x/gov/keeper/keeper_test.go index 6c309be4828d..748ad89de796 100644 --- a/x/gov/keeper/keeper_test.go +++ b/x/gov/keeper/keeper_test.go @@ -3,10 +3,10 @@ package keeper_test import ( "testing" - "cosmossdk.io/collections" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" + "cosmossdk.io/collections" sdkmath "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/baseapp" @@ -133,6 +133,26 @@ func TestProposalQueues(t *testing.T) { require.True(t, has) } +func TestSetHooks(t *testing.T) { + govKeeper, _, _, _, _, _, _ := setupGovKeeper(t) + require.Empty(t, govKeeper.Hooks()) + + govHooksReceiver := MockGovHooksReceiver{} + govKeeper.SetHooks(types.NewMultiGovHooks(&govHooksReceiver)) + require.NotNil(t, govKeeper.Hooks()) + require.Panics(t, func() { + govKeeper.SetHooks(&govHooksReceiver) + }) +} + +func TestGetGovGovernanceAndModuleAccountAddress(t *testing.T) { + govKeeper, authKeeper, _, _, _, _, ctx := setupGovKeeper(t) + mAcc := authKeeper.GetModuleAccount(ctx, "gov") + require.Equal(t, mAcc, govKeeper.GetGovernanceAccount(ctx)) + mAddr := authKeeper.GetModuleAddress("gov") + require.Equal(t, mAddr, govKeeper.ModuleAccountAddress()) +} + func TestKeeperTestSuite(t *testing.T) { suite.Run(t, new(KeeperTestSuite)) } diff --git a/x/gov/keeper/migrations.go b/x/gov/keeper/migrations.go index af12c2e5a8a8..508d8292b96a 100644 --- a/x/gov/keeper/migrations.go +++ b/x/gov/keeper/migrations.go @@ -40,5 +40,5 @@ func (m Migrator) Migrate3to4(ctx sdk.Context) error { // Migrate4to5 migrates from version 4 to 5. func (m Migrator) Migrate4to5(ctx sdk.Context) error { - return v5.MigrateStore(ctx, m.keeper.storeService, m.keeper.cdc) + return v5.MigrateStore(ctx, m.keeper.storeService, m.keeper.cdc, m.keeper.Constitution) } diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index 5ebee5b0e762..875b49136954 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -4,13 +4,10 @@ import ( "context" "encoding/json" "fmt" - "strconv" "cosmossdk.io/errors" "cosmossdk.io/math" - "github.com/armon/go-metrics" - "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" @@ -44,10 +41,6 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *v1.MsgSubmitPropos return nil, sdkerrors.ErrInvalidAddress.Wrapf("invalid proposer address: %s", err) } - if err := validateDeposit(sdk.NewCoins(msg.InitialDeposit...)); err != nil { - return nil, err - } - // check that either metadata or Msgs length is non nil. if len(msg.Messages) == 0 && len(msg.Metadata) == 0 { return nil, errors.Wrap(govtypes.ErrNoProposalMsgs, "either metadata or Msgs length must be non-nil") @@ -78,7 +71,16 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *v1.MsgSubmitPropos ctx := sdk.UnwrapSDKContext(goCtx) initialDeposit := msg.GetInitialDeposit() - if err := k.validateInitialDeposit(ctx, initialDeposit, msg.Expedited); err != nil { + params, err := k.Params.Get(ctx) + if err != nil { + return nil, fmt.Errorf("failed to get governance parameters: %w", err) + } + + if err := k.validateInitialDeposit(ctx, params, initialDeposit, msg.Expedited); err != nil { + return nil, err + } + + if err := k.validateDepositDenom(ctx, params, initialDeposit); err != nil { return nil, err } @@ -98,8 +100,6 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *v1.MsgSubmitPropos "submit proposal", ) - defer telemetry.IncrCounter(1, govtypes.ModuleName, "proposal") - votingStarted, err := k.Keeper.AddDeposit(ctx, proposal.Id, proposer, msg.GetInitialDeposit()) if err != nil { return nil, err @@ -118,7 +118,7 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *v1.MsgSubmitPropos }, nil } -// CancelProposals implements the MsgServer.CancelProposal method. +// CancelProposal implements the MsgServer.CancelProposal method. func (k msgServer) CancelProposal(goCtx context.Context, msg *v1.MsgCancelProposal) (*v1.MsgCancelProposalResponse, error) { _, err := k.authKeeper.AddressCodec().StringToBytes(msg.Proposer) if err != nil { @@ -189,14 +189,6 @@ func (k msgServer) Vote(goCtx context.Context, msg *v1.MsgVote) (*v1.MsgVoteResp return nil, err } - defer telemetry.IncrCounterWithLabels( - []string{govtypes.ModuleName, "vote"}, - 1, - []metrics.Label{ - telemetry.NewLabel("proposal_id", strconv.FormatUint(msg.ProposalId, 10)), - }, - ) - return &v1.MsgVoteResponse{}, nil } @@ -217,7 +209,7 @@ func (k msgServer) VoteWeighted(goCtx context.Context, msg *v1.MsgVoteWeighted) if !option.IsValid() { return nil, errors.Wrap(govtypes.ErrInvalidVote, option.String()) } - weight, err := sdk.NewDecFromStr(option.Weight) + weight, err := math.LegacyNewDecFromStr(option.Weight) if err != nil { return nil, errors.Wrapf(govtypes.ErrInvalidVote, "invalid weight: %s", err) } @@ -242,14 +234,6 @@ func (k msgServer) VoteWeighted(goCtx context.Context, msg *v1.MsgVoteWeighted) return nil, err } - defer telemetry.IncrCounterWithLabels( - []string{govtypes.ModuleName, "vote"}, - 1, - []metrics.Label{ - telemetry.NewLabel("proposal_id", strconv.FormatUint(msg.ProposalId, 10)), - }, - ) - return &v1.MsgVoteWeightedResponse{}, nil } @@ -260,7 +244,7 @@ func (k msgServer) Deposit(goCtx context.Context, msg *v1.MsgDeposit) (*v1.MsgDe return nil, sdkerrors.ErrInvalidAddress.Wrapf("invalid depositor address: %s", err) } - if err := validateAmount(sdk.NewCoins(msg.Amount...)); err != nil { + if err := validateDeposit(msg.Amount); err != nil { return nil, err } @@ -270,14 +254,6 @@ func (k msgServer) Deposit(goCtx context.Context, msg *v1.MsgDeposit) (*v1.MsgDe return nil, err } - defer telemetry.IncrCounterWithLabels( - []string{govtypes.ModuleName, "deposit"}, - 1, - []metrics.Label{ - telemetry.NewLabel("proposal_id", strconv.FormatUint(msg.ProposalId, 10)), - }, - ) - if votingStarted { ctx.EventManager().EmitEvent( sdk.NewEvent( @@ -403,26 +379,11 @@ func (k legacyMsgServer) Deposit(goCtx context.Context, msg *v1beta1.MsgDeposit) return &v1beta1.MsgDepositResponse{}, nil } -func validateAmount(amount sdk.Coins) error { - if !amount.IsValid() { +// validateDeposit validates the deposit amount, do not use for initial deposit. +func validateDeposit(amount sdk.Coins) error { + if !amount.IsValid() || !amount.IsAllPositive() { return sdkerrors.ErrInvalidCoins.Wrap(amount.String()) } - if !amount.IsAllPositive() { - return sdkerrors.ErrInvalidCoins.Wrap(amount.String()) - } - - return nil -} - -func validateDeposit(deposit sdk.Coins) error { - if !deposit.IsValid() { - return errors.Wrap(sdkerrors.ErrInvalidCoins, deposit.String()) - } - - if deposit.IsAnyNegative() { - return errors.Wrap(sdkerrors.ErrInvalidCoins, deposit.String()) - } - return nil } diff --git a/x/gov/keeper/msg_server_test.go b/x/gov/keeper/msg_server_test.go index cb4181c8237d..7274ba89cd69 100644 --- a/x/gov/keeper/msg_server_test.go +++ b/x/gov/keeper/msg_server_test.go @@ -27,7 +27,7 @@ func (suite *KeeperTestSuite) TestSubmitProposalReq() { addrs := suite.addrs proposer := addrs[0] - coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100))) + coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100000))) initialDeposit := coins params, _ := suite.govKeeper.Params.Get(suite.ctx) minDeposit := params.MinDeposit @@ -147,6 +147,21 @@ func (suite *KeeperTestSuite) TestSubmitProposalReq() { expErr: true, expErrMsg: "metadata too long", }, + "summary too long": { + preRun: func() (*v1.MsgSubmitProposal, error) { + return v1.NewMsgSubmitProposal( + []sdk.Msg{bankMsg}, + initialDeposit, + proposer.String(), + "", + "Proposal", + strings.Repeat("1", 300*40), + false, + ) + }, + expErr: true, + expErrMsg: "summary too long", + }, "many signers": { preRun: func() (*v1.MsgSubmitProposal, error) { return v1.NewMsgSubmitProposal( @@ -192,6 +207,36 @@ func (suite *KeeperTestSuite) TestSubmitProposalReq() { expErr: true, expErrMsg: "proposal message not recognized by router", }, + "invalid deposited coin": { + preRun: func() (*v1.MsgSubmitProposal, error) { + return v1.NewMsgSubmitProposal( + []sdk.Msg{bankMsg}, + []sdk.Coin{sdk.NewCoin("invalid", sdkmath.NewInt(100))}, + proposer.String(), + "", + "Proposal", + "description of proposal", + false, + ) + }, + expErr: true, + expErrMsg: "deposited 100invalid, but gov accepts only the following denom(s): [stake]: invalid deposit denom", + }, + "invalid deposited coin (multiple)": { + preRun: func() (*v1.MsgSubmitProposal, error) { + return v1.NewMsgSubmitProposal( + []sdk.Msg{bankMsg}, + initialDeposit.Add(sdk.NewCoin("invalid", sdkmath.NewInt(100))), + proposer.String(), + "", + "Proposal", + "description of proposal", + false, + ) + }, + expErr: true, + expErrMsg: "deposited 100invalid,100000stake, but gov accepts only the following denom(s): [stake]: invalid deposit denom", + }, "all good": { preRun: func() (*v1.MsgSubmitProposal, error) { return v1.NewMsgSubmitProposal( @@ -243,7 +288,7 @@ func (suite *KeeperTestSuite) TestCancelProposalReq() { addrs := suite.addrs proposer := addrs[0] - coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100))) + coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100000))) bankMsg := &banktypes.MsgSend{ FromAddress: govAcct.String(), ToAddress: proposer.String(), @@ -339,7 +384,7 @@ func (suite *KeeperTestSuite) TestVoteReq() { addrs := suite.addrs proposer := addrs[0] - coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100))) + coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100000))) params, _ := suite.govKeeper.Params.Get(suite.ctx) minDeposit := params.MinDeposit bankMsg := &banktypes.MsgSend{ @@ -482,7 +527,7 @@ func (suite *KeeperTestSuite) TestVoteWeightedReq() { proposer := simtestutil.AddTestAddrsIncremental(suite.bankKeeper, suite.stakingKeeper, suite.ctx, 1, sdkmath.NewInt(50000000))[0] - coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100))) + coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100000))) params, _ := suite.govKeeper.Params.Get(suite.ctx) minDeposit := params.MinDeposit bankMsg := &banktypes.MsgSend{ @@ -546,8 +591,8 @@ func (suite *KeeperTestSuite) TestVoteWeightedReq() { return proposalID }, option: v1.WeightedVoteOptions{ - v1.NewWeightedVoteOption(v1.OptionYes, sdk.NewDecWithPrec(5, 1)), - v1.NewWeightedVoteOption(v1.OptionYes, sdk.NewDecWithPrec(5, 1)), + v1.NewWeightedVoteOption(v1.OptionYes, sdkmath.LegacyNewDecWithPrec(5, 1)), + v1.NewWeightedVoteOption(v1.OptionYes, sdkmath.LegacyNewDecWithPrec(5, 1)), }, voter: proposer, metadata: "", @@ -603,7 +648,7 @@ func (suite *KeeperTestSuite) TestVoteWeightedReq() { return proposalID }, option: v1.WeightedVoteOptions{ // weight sum <1 - v1.NewWeightedVoteOption(v1.OptionYes, sdk.NewDecWithPrec(5, 1)), + v1.NewWeightedVoteOption(v1.OptionYes, sdkmath.LegacyNewDecWithPrec(5, 1)), }, voter: proposer, metadata: "", @@ -696,8 +741,8 @@ func (suite *KeeperTestSuite) TestVoteWeightedReq() { return res.ProposalId }, option: v1.WeightedVoteOptions{ - v1.NewWeightedVoteOption(v1.OptionYes, sdk.NewDecWithPrec(5, 1)), - v1.NewWeightedVoteOption(v1.OptionAbstain, sdk.NewDecWithPrec(5, 1)), + v1.NewWeightedVoteOption(v1.OptionYes, sdkmath.LegacyNewDecWithPrec(5, 1)), + v1.NewWeightedVoteOption(v1.OptionAbstain, sdkmath.LegacyNewDecWithPrec(5, 1)), }, voter: proposer, metadata: "", @@ -725,9 +770,9 @@ func (suite *KeeperTestSuite) TestDepositReq() { addrs := suite.addrs proposer := addrs[0] - coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100))) + coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100000))) params, _ := suite.govKeeper.Params.Get(suite.ctx) - minDeposit := params.MinDeposit + minDeposit := sdk.Coins(params.MinDeposit) bankMsg := &banktypes.MsgSend{ FromAddress: govAcct.String(), ToAddress: proposer.String(), @@ -776,6 +821,24 @@ func (suite *KeeperTestSuite) TestDepositReq() { expErr: true, expErrMsg: "invalid depositor address", }, + "invalid deposited coin ": { + preRun: func() uint64 { + return pID + }, + depositor: proposer, + deposit: []sdk.Coin{sdk.NewCoin("ibc/badcoin", sdkmath.NewInt(1000))}, + expErr: true, + expErrMsg: "deposited 1000ibc/badcoin, but gov accepts only the following denom(s): [stake]", + }, + "invalid deposited coin (multiple)": { + preRun: func() uint64 { + return pID + }, + depositor: proposer, + deposit: minDeposit.Add(sdk.NewCoin("ibc/badcoin", sdkmath.NewInt(1000))), + expErr: true, + expErrMsg: "deposited 1000ibc/badcoin,10000000stake, but gov accepts only the following denom(s): [stake]: invalid deposit denom", + }, "all good": { preRun: func() uint64 { return pID @@ -804,7 +867,7 @@ func (suite *KeeperTestSuite) TestDepositReq() { // legacy msg server tests func (suite *KeeperTestSuite) TestLegacyMsgSubmitProposal() { proposer := simtestutil.AddTestAddrsIncremental(suite.bankKeeper, suite.stakingKeeper, suite.ctx, 1, sdkmath.NewInt(50000000))[0] - coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100))) + coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100000))) initialDeposit := coins params, _ := suite.govKeeper.Params.Get(suite.ctx) minDeposit := params.MinDeposit @@ -917,7 +980,7 @@ func (suite *KeeperTestSuite) TestLegacyMsgVote() { addrs := suite.addrs proposer := addrs[0] - coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100))) + coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100000))) params, _ := suite.govKeeper.Params.Get(suite.ctx) minDeposit := params.MinDeposit bankMsg := &banktypes.MsgSend{ @@ -1050,7 +1113,7 @@ func (suite *KeeperTestSuite) TestLegacyVoteWeighted() { addrs := suite.addrs proposer := addrs[0] - coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100))) + coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100000))) params, _ := suite.govKeeper.Params.Get(suite.ctx) minDeposit := params.MinDeposit bankMsg := &banktypes.MsgSend{ @@ -1125,11 +1188,11 @@ func (suite *KeeperTestSuite) TestLegacyVoteWeighted() { option: v1beta1.WeightedVoteOptions{ v1beta1.WeightedVoteOption{ Option: v1beta1.OptionYes, - Weight: sdk.NewDecWithPrec(5, 1), + Weight: sdkmath.LegacyNewDecWithPrec(5, 1), }, v1beta1.WeightedVoteOption{ Option: v1beta1.OptionYes, - Weight: sdk.NewDecWithPrec(5, 1), + Weight: sdkmath.LegacyNewDecWithPrec(5, 1), }, }, voter: proposer, @@ -1184,7 +1247,7 @@ func (suite *KeeperTestSuite) TestLegacyVoteWeighted() { option: v1beta1.WeightedVoteOptions{ v1beta1.WeightedVoteOption{ Option: v1beta1.VoteOption(0x13), - Weight: sdk.NewDecWithPrec(5, 1), + Weight: sdkmath.LegacyNewDecWithPrec(5, 1), }, }, voter: proposer, @@ -1199,7 +1262,7 @@ func (suite *KeeperTestSuite) TestLegacyVoteWeighted() { option: v1beta1.WeightedVoteOptions{ v1beta1.WeightedVoteOption{ Option: v1beta1.OptionYes, - Weight: sdk.NewDecWithPrec(5, 1), + Weight: sdkmath.LegacyNewDecWithPrec(5, 1), }, }, voter: proposer, @@ -1301,7 +1364,7 @@ func (suite *KeeperTestSuite) TestLegacyMsgDeposit() { addrs := suite.addrs proposer := addrs[0] - coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100))) + coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100000))) params, _ := suite.govKeeper.Params.Get(suite.ctx) minDeposit := params.MinDeposit bankMsg := &banktypes.MsgSend{ @@ -1652,7 +1715,7 @@ func (suite *KeeperTestSuite) TestSubmitProposal_InitialDeposit() { testcases := map[string]struct { minDeposit sdk.Coins - minInitialDepositRatio sdk.Dec + minInitialDepositRatio sdkmath.LegacyDec initialDeposit sdk.Coins accountBalance sdk.Coins diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index d48f60c4a13d..a461c369ea05 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -9,6 +9,7 @@ import ( "cosmossdk.io/collections" errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/types" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" @@ -23,7 +24,7 @@ func (keeper Keeper) SubmitProposal(ctx context.Context, messages []sdk.Msg, met } // assert summary is no longer than predefined max length of metadata - err = keeper.assertMetadataLength(summary) + err = keeper.assertSummaryLength(summary) if err != nil { return v1.Proposal{}, err } @@ -113,12 +114,16 @@ func (keeper Keeper) SubmitProposal(ctx context.Context, messages []sdk.Msg, met } // called right after a proposal is submitted - keeper.Hooks().AfterProposalSubmission(ctx, proposalID) + err = keeper.Hooks().AfterProposalSubmission(ctx, proposalID) + if err != nil { + return v1.Proposal{}, err + } sdkCtx.EventManager().EmitEvent( sdk.NewEvent( types.EventTypeSubmitProposal, sdk.NewAttribute(types.AttributeKeyProposalID, fmt.Sprintf("%d", proposalID)), + sdk.NewAttribute(types.AttributeKeyProposalProposer, proposer.String()), sdk.NewAttribute(types.AttributeKeyProposalMessages, msgsStr), ), ) diff --git a/x/gov/keeper/proposal_test.go b/x/gov/keeper/proposal_test.go index 67bb836876a4..76152a923dd4 100644 --- a/x/gov/keeper/proposal_test.go +++ b/x/gov/keeper/proposal_test.go @@ -5,10 +5,10 @@ import ( "strings" "testing" - "cosmossdk.io/collections" - "github.com/stretchr/testify/require" + "cosmossdk.io/collections" + "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/types" @@ -178,65 +178,106 @@ func (suite *KeeperTestSuite) TestCancelProposal() { tp := v1beta1.TextProposal{Title: "title", Description: "description"} prop, err := v1.NewLegacyContent(&tp, govAcct) suite.Require().NoError(err) - proposalResp, err := suite.govKeeper.SubmitProposal(suite.ctx, []sdk.Msg{prop}, "", "title", "summary", suite.addrs[0], false) + proposal, err := suite.govKeeper.SubmitProposal(suite.ctx, []sdk.Msg{prop}, "", "title", "summary", suite.addrs[0], false) suite.Require().NoError(err) - proposalID := proposalResp.Id + proposalID := proposal.Id - proposal2Resp, err := suite.govKeeper.SubmitProposal(suite.ctx, []sdk.Msg{prop}, "", "title", "summary", suite.addrs[1], true) - proposal2ID := proposal2Resp.Id - makeProposalPass := func() { - proposal2, err := suite.govKeeper.Proposals.Get(suite.ctx, proposal2ID) - suite.Require().Nil(err) + proposal2, err := suite.govKeeper.SubmitProposal(suite.ctx, []sdk.Msg{prop}, "", "title", "summary", suite.addrs[1], true) + suite.Require().NoError(err) + proposal2ID := proposal2.Id - proposal2.Status = v1.ProposalStatus_PROPOSAL_STATUS_PASSED - suite.govKeeper.SetProposal(suite.ctx, proposal2) - } + // proposal3 is only used to check the votes for proposals which doesn't go through `CancelProposal` are still present in state + proposal3, err := suite.govKeeper.SubmitProposal(suite.ctx, []sdk.Msg{prop}, "", "title", "summary", suite.addrs[2], false) + suite.Require().NoError(err) + proposal3ID := proposal3.Id + + // add votes for proposal 3 + suite.Require().NoError(suite.govKeeper.ActivateVotingPeriod(suite.ctx, proposal3)) + + proposal3, err = suite.govKeeper.Proposals.Get(suite.ctx, proposal3ID) + suite.Require().Nil(err) + suite.Require().True(proposal3.VotingStartTime.Equal(suite.ctx.BlockHeader().Time)) + // add vote + voteOptions := []*v1.WeightedVoteOption{{Option: v1.OptionYes, Weight: "1.0"}} + err = suite.govKeeper.AddVote(suite.ctx, proposal3ID, suite.addrs[0], voteOptions, "") + suite.Require().NoError(err) testCases := []struct { name string + malleate func() (proposalID uint64, proposer string) proposalID uint64 proposer string expectedErr bool }{ { - name: "without proposer", - proposalID: 1, - proposer: "", + name: "without proposer", + malleate: func() (uint64, string) { + return 1, "" + }, expectedErr: true, }, { - name: "invalid proposal id", - proposalID: 1, - proposer: string(suite.addrs[0]), + name: "invalid proposal id", + malleate: func() (uint64, string) { + return 1, suite.addrs[1].String() + }, expectedErr: true, }, { - name: "valid proposalID but invalid proposer", - proposalID: proposalID, - proposer: suite.addrs[1].String(), + name: "valid proposalID but invalid proposer", + malleate: func() (uint64, string) { + return proposalID, suite.addrs[1].String() + }, expectedErr: true, }, { - name: "valid proposalID but invalid proposal which has already passed", - proposalID: proposal2ID, - proposer: suite.addrs[1].String(), + name: "valid proposalID but invalid proposal which has already passed", + malleate: func() (uint64, string) { + // making proposal status pass + proposal2, err := suite.govKeeper.Proposals.Get(suite.ctx, proposal2ID) + suite.Require().Nil(err) + + proposal2.Status = v1.ProposalStatus_PROPOSAL_STATUS_PASSED + suite.govKeeper.SetProposal(suite.ctx, proposal2) + + return proposal2ID, suite.addrs[1].String() + }, expectedErr: true, }, { - name: "valid proposer and proposal id", - proposalID: proposalID, - proposer: suite.addrs[0].String(), + name: "valid proposer and proposal id", + malleate: func() (uint64, string) { + return proposalID, suite.addrs[0].String() + }, + expectedErr: false, + }, + { + name: "valid case with deletion of votes", + malleate: func() (uint64, string) { + suite.Require().NoError(suite.govKeeper.ActivateVotingPeriod(suite.ctx, proposal)) + + proposal, err = suite.govKeeper.Proposals.Get(suite.ctx, proposal.Id) + suite.Require().Nil(err) + suite.Require().True(proposal.VotingStartTime.Equal(suite.ctx.BlockHeader().Time)) + + // add vote + voteOptions := []*v1.WeightedVoteOption{{Option: v1.OptionYes, Weight: "1.0"}} + err = suite.govKeeper.AddVote(suite.ctx, proposalID, suite.addrs[0], voteOptions, "") + suite.Require().NoError(err) + vote, err := suite.govKeeper.Votes.Get(suite.ctx, collections.Join(proposalID, suite.addrs[0])) + suite.Require().NoError(err) + suite.Require().NotNil(vote) + + return proposalID, suite.addrs[0].String() + }, expectedErr: false, }, } for _, tc := range testCases { suite.Run(tc.name, func() { - if tc.proposalID == proposal2ID { - // making proposal status pass - makeProposalPass() - } - err = suite.govKeeper.CancelProposal(suite.ctx, tc.proposalID, tc.proposer) + pID, proposer := tc.malleate() + err = suite.govKeeper.CancelProposal(suite.ctx, pID, proposer) if tc.expectedErr { suite.Require().Error(err) } else { @@ -244,6 +285,13 @@ func (suite *KeeperTestSuite) TestCancelProposal() { } }) } + _, err = suite.govKeeper.Votes.Get(suite.ctx, collections.Join(proposalID, suite.addrs[0])) + suite.Require().ErrorContains(err, collections.ErrNotFound.Error()) + + // check that proposal 3 votes are still present in the state + votes, err := suite.govKeeper.Votes.Get(suite.ctx, collections.Join(proposal3ID, suite.addrs[0])) + suite.Require().NoError(err) + suite.Require().NotNil(votes) } func TestMigrateProposalMessages(t *testing.T) { diff --git a/x/gov/keeper/tally.go b/x/gov/keeper/tally.go index acd79d7abb64..fa69ca381f91 100644 --- a/x/gov/keeper/tally.go +++ b/x/gov/keeper/tally.go @@ -2,10 +2,8 @@ package keeper import ( "context" - "errors" "cosmossdk.io/collections" - "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" @@ -28,10 +26,13 @@ func (keeper Keeper) Tally(ctx context.Context, proposal v1.Proposal) (passes, b currValidators := make(map[string]v1.ValidatorGovInfo) // fetch all the bonded validators, insert them into currValidators - sdkCtx := sdk.UnwrapSDKContext(ctx) - keeper.sk.IterateBondedValidatorsByPower(sdkCtx, func(index int64, validator stakingtypes.ValidatorI) (stop bool) { - currValidators[validator.GetOperator().String()] = v1.NewValidatorGovInfo( - validator.GetOperator(), + err = keeper.sk.IterateBondedValidatorsByPower(ctx, func(index int64, validator stakingtypes.ValidatorI) (stop bool) { + valBz, err := keeper.sk.ValidatorAddressCodec().StringToBytes(validator.GetOperator()) + if err != nil { + return false + } + currValidators[validator.GetOperator()] = v1.NewValidatorGovInfo( + valBz, validator.GetBondedTokens(), validator.GetDelegatorShares(), math.LegacyZeroDec(), @@ -40,6 +41,10 @@ func (keeper Keeper) Tally(ctx context.Context, proposal v1.Proposal) (passes, b return false }) + if err != nil { + return false, false, tallyResults, err + } + rng := collections.NewPrefixedPairRange[uint64, sdk.AccAddress](proposal.Id) err = keeper.Votes.Walk(ctx, rng, func(key collections.Pair[uint64, sdk.AccAddress], vote v1.Vote) (bool, error) { // if validator, just record it in the map @@ -48,15 +53,18 @@ func (keeper Keeper) Tally(ctx context.Context, proposal v1.Proposal) (passes, b return false, err } - valAddrStr := sdk.ValAddress(voter).String() + valAddrStr, err := keeper.sk.ValidatorAddressCodec().BytesToString(voter) + if err != nil { + return false, err + } if val, ok := currValidators[valAddrStr]; ok { val.Vote = vote.Options currValidators[valAddrStr] = val } // iterate over all delegations from voter, deduct from any delegated-to validators - keeper.sk.IterateDelegations(sdkCtx, voter, func(index int64, delegation stakingtypes.DelegationI) (stop bool) { - valAddrStr := delegation.GetValidatorAddr().String() + err = keeper.sk.IterateDelegations(ctx, voter, func(index int64, delegation stakingtypes.DelegationI) (stop bool) { + valAddrStr := delegation.GetValidatorAddr() if val, ok := currValidators[valAddrStr]; ok { // There is no need to handle the special case that validator address equal to voter address. @@ -77,11 +85,14 @@ func (keeper Keeper) Tally(ctx context.Context, proposal v1.Proposal) (passes, b return false }) + if err != nil { + return false, err + } return false, keeper.Votes.Remove(ctx, collections.Join(vote.ProposalId, sdk.AccAddress(voter))) }) - if err != nil && !errors.Is(err, collections.ErrInvalidIterator) { + if err != nil { return false, false, tallyResults, err } @@ -110,12 +121,17 @@ func (keeper Keeper) Tally(ctx context.Context, proposal v1.Proposal) (passes, b // TODO: Upgrade the spec to cover all of these cases & remove pseudocode. // If there is no staked coins, the proposal fails - if keeper.sk.TotalBondedTokens(sdkCtx).IsZero() { + totalBonded, err := keeper.sk.TotalBondedTokens(ctx) + if err != nil { + return false, false, tallyResults, err + } + + if totalBonded.IsZero() { return false, false, tallyResults, nil } // If there is not enough quorum of votes, the proposal fails - percentVoting := totalVotingPower.Quo(math.LegacyNewDecFromInt(keeper.sk.TotalBondedTokens(sdkCtx))) + percentVoting := totalVotingPower.Quo(math.LegacyNewDecFromInt(totalBonded)) quorum, _ := math.LegacyNewDecFromStr(params.Quorum) if percentVoting.LT(quorum) { return false, params.BurnVoteQuorum, tallyResults, nil diff --git a/x/gov/keeper/vote.go b/x/gov/keeper/vote.go index 84ae0f5ebca1..466fe4c2a27a 100644 --- a/x/gov/keeper/vote.go +++ b/x/gov/keeper/vote.go @@ -5,8 +5,8 @@ import ( "fmt" "cosmossdk.io/collections" - "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/types" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" @@ -42,12 +42,16 @@ func (keeper Keeper) AddVote(ctx context.Context, proposalID uint64, voterAddr s } // called after a vote on a proposal is cast - keeper.Hooks().AfterProposalVote(ctx, proposalID, voterAddr) + err = keeper.Hooks().AfterProposalVote(ctx, proposalID, voterAddr) + if err != nil { + return err + } sdkCtx := sdk.UnwrapSDKContext(ctx) sdkCtx.EventManager().EmitEvent( sdk.NewEvent( types.EventTypeProposalVote, + sdk.NewAttribute(types.AttributeKeyVoter, voterAddr.String()), sdk.NewAttribute(types.AttributeKeyOption, options.String()), sdk.NewAttribute(types.AttributeKeyProposalID, fmt.Sprintf("%d", proposalID)), ), @@ -56,8 +60,13 @@ func (keeper Keeper) AddVote(ctx context.Context, proposalID uint64, voterAddr s return nil } -// deleteVotes deletes the all votes from a given proposalID. +// deleteVotes deletes all the votes from a given proposalID. func (keeper Keeper) deleteVotes(ctx context.Context, proposalID uint64) error { - // TODO(tip): fix https://github.com/cosmos/cosmos-sdk/issues/16162 + rng := collections.NewPrefixedPairRange[uint64, sdk.AccAddress](proposalID) + err := keeper.Votes.Clear(ctx, rng) + if err != nil { + return err + } + return nil } diff --git a/x/gov/keeper/vote_test.go b/x/gov/keeper/vote_test.go index b7b05066b49f..aa93118ad4ac 100644 --- a/x/gov/keeper/vote_test.go +++ b/x/gov/keeper/vote_test.go @@ -3,10 +3,10 @@ package keeper_test import ( "testing" - "cosmossdk.io/collections" + "github.com/stretchr/testify/require" + "cosmossdk.io/collections" sdkmath "cosmossdk.io/math" - "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/codec/address" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" diff --git a/x/gov/migrations/v2/store_test.go b/x/gov/migrations/v2/store_test.go index 8a4ec143d4e8..a5c8cf9dc095 100644 --- a/x/gov/migrations/v2/store_test.go +++ b/x/gov/migrations/v2/store_test.go @@ -5,17 +5,16 @@ import ( "testing" "time" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/address" - - "cosmossdk.io/math" "github.com/stretchr/testify/require" + "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/testutil" "github.com/cosmos/cosmos-sdk/testutil/testdata" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/address" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" v1 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v1" v2 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v2" diff --git a/x/gov/migrations/v3/convert.go b/x/gov/migrations/v3/convert.go index e0214c21bbf8..d584ac5eced5 100644 --- a/x/gov/migrations/v3/convert.go +++ b/x/gov/migrations/v3/convert.go @@ -3,7 +3,8 @@ package v3 import ( "fmt" - sdkmath "cosmossdk.io/math" + "cosmossdk.io/math" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -71,19 +72,19 @@ func ConvertToLegacyProposal(proposal v1.Proposal) (v1beta1.Proposal, error) { } func ConvertToLegacyTallyResult(tally *v1.TallyResult) (v1beta1.TallyResult, error) { - yes, ok := sdkmath.NewIntFromString(tally.YesCount) + yes, ok := math.NewIntFromString(tally.YesCount) if !ok { return v1beta1.TallyResult{}, fmt.Errorf("unable to convert yes tally string (%s) to int", tally.YesCount) } - no, ok := sdkmath.NewIntFromString(tally.NoCount) + no, ok := math.NewIntFromString(tally.NoCount) if !ok { return v1beta1.TallyResult{}, fmt.Errorf("unable to convert no tally string (%s) to int", tally.NoCount) } - veto, ok := sdkmath.NewIntFromString(tally.NoWithVetoCount) + veto, ok := math.NewIntFromString(tally.NoWithVetoCount) if !ok { return v1beta1.TallyResult{}, fmt.Errorf("unable to convert no with veto tally string (%s) to int", tally.NoWithVetoCount) } - abstain, ok := sdkmath.NewIntFromString(tally.AbstainCount) + abstain, ok := math.NewIntFromString(tally.AbstainCount) if !ok { return v1beta1.TallyResult{}, fmt.Errorf("unable to convert abstain tally string (%s) to int", tally.AbstainCount) } @@ -111,7 +112,7 @@ func ConvertToLegacyVote(vote v1.Vote) (v1beta1.Vote, error) { func ConvertToLegacyVoteOptions(voteOptions []*v1.WeightedVoteOption) ([]v1beta1.WeightedVoteOption, error) { options := make([]v1beta1.WeightedVoteOption, len(voteOptions)) for i, option := range voteOptions { - weight, err := types.NewDecFromStr(option.Weight) + weight, err := math.LegacyNewDecFromStr(option.Weight) if err != nil { return options, err } diff --git a/x/gov/migrations/v3/convert_test.go b/x/gov/migrations/v3/convert_test.go index 719d1040fe86..0a1f8f31fab5 100644 --- a/x/gov/migrations/v3/convert_test.go +++ b/x/gov/migrations/v3/convert_test.go @@ -4,9 +4,10 @@ import ( "testing" "time" - "cosmossdk.io/math" "github.com/stretchr/testify/require" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/tx" diff --git a/x/gov/migrations/v3/json_test.go b/x/gov/migrations/v3/json_test.go index 17a36689d387..a9089cf68626 100644 --- a/x/gov/migrations/v3/json_test.go +++ b/x/gov/migrations/v3/json_test.go @@ -5,10 +5,11 @@ import ( "testing" "time" - sdkmath "cosmossdk.io/math" "github.com/cosmos/gogoproto/proto" "github.com/stretchr/testify/require" + sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/client" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -90,6 +91,7 @@ func TestMigrateJSON(t *testing.T) { { "deposit_end_time": "2001-09-09T01:46:40Z", "expedited": false, + "failed_reason": "", "final_tally_result": { "abstain_count": "0", "no_count": "0", diff --git a/x/gov/migrations/v3/store_test.go b/x/gov/migrations/v3/store_test.go index d7f25d361e67..0808246127d6 100644 --- a/x/gov/migrations/v3/store_test.go +++ b/x/gov/migrations/v3/store_test.go @@ -6,6 +6,7 @@ import ( "github.com/stretchr/testify/require" + "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/runtime" @@ -43,8 +44,8 @@ func TestMigrateStore(t *testing.T) { // Vote on prop 1 options := []v1beta1.WeightedVoteOption{ - {Option: v1beta1.OptionNo, Weight: sdk.MustNewDecFromStr("0.3")}, - {Option: v1beta1.OptionYes, Weight: sdk.MustNewDecFromStr("0.7")}, + {Option: v1beta1.OptionNo, Weight: math.LegacyMustNewDecFromStr("0.3")}, + {Option: v1beta1.OptionYes, Weight: math.LegacyMustNewDecFromStr("0.7")}, } vote1 := v1beta1.NewVote(1, voter, options) vote1Bz := cdc.MustMarshal(&vote1) diff --git a/x/gov/migrations/v4/json.go b/x/gov/migrations/v4/json.go index 62d7ee9bd918..bed36ff14412 100644 --- a/x/gov/migrations/v4/json.go +++ b/x/gov/migrations/v4/json.go @@ -29,6 +29,7 @@ func MigrateJSON(oldState *v1.GenesisState) (*v1.GenesisState, error) { defaultParams.BurnProposalDepositPrevote, defaultParams.BurnVoteQuorum, defaultParams.BurnVoteVeto, + defaultParams.MinDepositRatio, ) return &v1.GenesisState{ diff --git a/x/gov/migrations/v4/json_test.go b/x/gov/migrations/v4/json_test.go index 1da44080bcaf..18ef6dba37a8 100644 --- a/x/gov/migrations/v4/json_test.go +++ b/x/gov/migrations/v4/json_test.go @@ -4,12 +4,13 @@ import ( "encoding/json" "testing" + "github.com/stretchr/testify/require" + "github.com/cosmos/cosmos-sdk/client" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" "github.com/cosmos/cosmos-sdk/x/gov" v4 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v4" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" - "github.com/stretchr/testify/require" ) func TestMigrateJSON(t *testing.T) { @@ -78,6 +79,7 @@ func TestMigrateJSON(t *testing.T) { "denom": "stake" } ], + "min_deposit_ratio": "0.010000000000000000", "min_initial_deposit_ratio": "0.000000000000000000", "proposal_cancel_dest": "", "proposal_cancel_ratio": "0.500000000000000000", diff --git a/x/gov/migrations/v4/store.go b/x/gov/migrations/v4/store.go index cb41e5122231..7a5857dd2aa6 100644 --- a/x/gov/migrations/v4/store.go +++ b/x/gov/migrations/v4/store.go @@ -42,6 +42,7 @@ func migrateParams(ctx sdk.Context, store storetypes.KVStore, legacySubspace exp defaultParams.BurnProposalDepositPrevote, defaultParams.BurnVoteQuorum, defaultParams.BurnVoteVeto, + defaultParams.MinDepositRatio, ) bz, err := cdc.Marshal(¶ms) diff --git a/x/gov/migrations/v5/store.go b/x/gov/migrations/v5/store.go index ddfa20f52924..22e336a418c3 100644 --- a/x/gov/migrations/v5/store.go +++ b/x/gov/migrations/v5/store.go @@ -1,6 +1,7 @@ package v5 import ( + "cosmossdk.io/collections" corestoretypes "cosmossdk.io/core/store" "github.com/cosmos/cosmos-sdk/codec" @@ -9,11 +10,19 @@ import ( govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" ) +var ( + // ParamsKey is the key of x/gov params + ParamsKey = []byte{0x30} + // ConstitutionKey is the key of x/gov constitution + ConstitutionKey = collections.NewPrefix(49) +) + // MigrateStore performs in-place store migrations from v4 (v0.47) to v5 (v0.50). The // migration includes: // // Addition of the new proposal expedited parameters that are set to 0 by default. -func MigrateStore(ctx sdk.Context, storeService corestoretypes.KVStoreService, cdc codec.BinaryCodec) error { +// Set of default chain constitution. +func MigrateStore(ctx sdk.Context, storeService corestoretypes.KVStoreService, cdc codec.BinaryCodec, constitutionCollection collections.Item[string]) error { store := storeService.OpenKVStore(ctx) paramsBz, err := store.Get(v4.ParamsKey) if err != nil { @@ -32,13 +41,23 @@ func MigrateStore(ctx sdk.Context, storeService corestoretypes.KVStoreService, c params.ExpeditedThreshold = defaultParams.ExpeditedThreshold params.ProposalCancelRatio = defaultParams.ProposalCancelRatio params.ProposalCancelDest = defaultParams.ProposalCancelDest + params.MinDepositRatio = defaultParams.MinDepositRatio bz, err := cdc.Marshal(¶ms) if err != nil { return err } - store.Set(v4.ParamsKey, bz) + if err := store.Set(ParamsKey, bz); err != nil { + return err + } + + // Set the default consisitution if it is not set + if ok, err := constitutionCollection.Has(ctx); !ok || err != nil { + if err := constitutionCollection.Set(ctx, "This chain has no constitution."); err != nil { + return err + } + } return nil } diff --git a/x/gov/migrations/v5/store_test.go b/x/gov/migrations/v5/store_test.go index e4e4ba683266..550b77d0658a 100644 --- a/x/gov/migrations/v5/store_test.go +++ b/x/gov/migrations/v5/store_test.go @@ -6,6 +6,7 @@ import ( "github.com/stretchr/testify/require" + "cosmossdk.io/collections" storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/runtime" @@ -23,6 +24,9 @@ func TestMigrateStore(t *testing.T) { govKey := storetypes.NewKVStoreKey("gov") ctx := testutil.DefaultContext(govKey, storetypes.NewTransientStoreKey("transient_test")) store := ctx.KVStore(govKey) + storeService := runtime.NewKVStoreService(govKey) + sb := collections.NewSchemaBuilder(storeService) + constitutionCollection := collections.NewItem(sb, v5.ConstitutionKey, "constitution", collections.StringValue) var params v1.Params bz := store.Get(v4.ParamsKey) @@ -32,8 +36,7 @@ func TestMigrateStore(t *testing.T) { require.Equal(t, (*time.Duration)(nil), params.ExpeditedVotingPeriod) // Run migrations. - storeService := runtime.NewKVStoreService(govKey) - err := v5.MigrateStore(ctx, storeService, cdc) + err := v5.MigrateStore(ctx, storeService, cdc, constitutionCollection) require.NoError(t, err) // Check params @@ -43,4 +46,10 @@ func TestMigrateStore(t *testing.T) { require.Equal(t, v1.DefaultParams().ExpeditedMinDeposit, params.ExpeditedMinDeposit) require.Equal(t, v1.DefaultParams().ExpeditedThreshold, params.ExpeditedThreshold) require.Equal(t, v1.DefaultParams().ExpeditedVotingPeriod, params.ExpeditedVotingPeriod) + require.Equal(t, v1.DefaultParams().MinDepositRatio, params.MinDepositRatio) + + // Check constitution + result, err := constitutionCollection.Get(ctx) + require.NoError(t, err) + require.Equal(t, "This chain has no constitution.", result) } diff --git a/x/gov/module.go b/x/gov/module.go index 042cb1b6fde6..f48d5e060e46 100644 --- a/x/gov/module.go +++ b/x/gov/module.go @@ -4,20 +4,19 @@ import ( "context" "encoding/json" "fmt" + "maps" + "slices" "sort" + "strings" - abci "github.com/cometbft/cometbft/abci/types" gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" - "golang.org/x/exp/maps" - "golang.org/x/exp/slices" modulev1 "cosmossdk.io/api/cosmos/gov/module/v1" "cosmossdk.io/core/address" "cosmossdk.io/core/appmodule" - "cosmossdk.io/depinject" - store "cosmossdk.io/core/store" + "cosmossdk.io/depinject" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" @@ -42,6 +41,12 @@ const ConsensusVersion = 5 var ( _ module.AppModuleBasic = AppModuleBasic{} _ module.AppModuleSimulation = AppModule{} + _ module.HasGenesis = AppModule{} + _ module.HasServices = AppModule{} + _ module.HasInvariants = AppModule{} + + _ appmodule.AppModule = AppModule{} + _ appmodule.HasEndBlocker = AppModule{} ) // AppModuleBasic defines the basic application module used by the gov module. @@ -110,11 +115,6 @@ func getProposalCLIHandlers(handlers []govclient.ProposalHandler) []*cobra.Comma return proposalCLIHandlers } -// GetQueryCmd returns the root query command for the gov module. -func (ab AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd(ab.ac) -} - // RegisterInterfaces implements InterfaceModule.RegisterInterfaces func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { v1.RegisterInterfaces(registry) @@ -147,11 +147,6 @@ func NewAppModule( } } -var ( - _ appmodule.AppModule = AppModule{} - _ appmodule.HasEndBlocker = AppModule{} -) - // IsOnePerModuleType implements the depinject.OnePerModuleType interface. func (am AppModule) IsOnePerModuleType() {} @@ -231,8 +226,8 @@ func InvokeAddRoutes(keeper *keeper.Keeper, routes []v1beta1.HandlerRoute) { // Default route order is a lexical sort by RouteKey. // Explicit ordering can be added to the module config if required. - slices.SortFunc(routes, func(x, y v1beta1.HandlerRoute) bool { - return x.RouteKey < y.RouteKey + slices.SortFunc(routes, func(x, y v1beta1.HandlerRoute) int { + return strings.Compare(x.RouteKey, y.RouteKey) }) router := v1beta1.NewRouter() @@ -249,7 +244,7 @@ func InvokeSetHooks(keeper *keeper.Keeper, govHooks map[string]govtypes.GovHooks // Default ordering is lexical by module name. // Explicit ordering can be added to the module config if required. - modNames := maps.Keys(govHooks) + modNames := slices.Sorted(maps.Keys(govHooks)) order := modNames sort.Strings(order) @@ -266,15 +261,8 @@ func InvokeSetHooks(keeper *keeper.Keeper, govHooks map[string]govtypes.GovHooks return nil } -// Name returns the gov module's name. -func (AppModule) Name() string { - return govtypes.ModuleName -} - -// RegisterInvariants registers module invariants -func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) { - keeper.RegisterInvariants(ir, am.keeper, am.bankKeeper) -} +// RegisterInvariants is deprecated and will be removed in the next version of the Cosmos SDK. +func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} // RegisterServices registers module services. func (am AppModule) RegisterServices(cfg module.Configurator) { @@ -306,11 +294,10 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { // InitGenesis performs genesis initialization for the gov module. It returns // no validator updates. -func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate { +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) { var genesisState v1.GenesisState cdc.MustUnmarshalJSON(data, &genesisState) InitGenesis(ctx, am.accountKeeper, am.bankKeeper, am.keeper, &genesisState) - return []abci.ValidatorUpdate{} } // ExportGenesis returns the exported genesis state as raw bytes for the gov diff --git a/x/gov/simulation/genesis.go b/x/gov/simulation/genesis.go index 16c58a914cee..160668848462 100644 --- a/x/gov/simulation/genesis.go +++ b/x/gov/simulation/genesis.go @@ -28,6 +28,7 @@ const ( ExpeditedThreshold = "expedited_threshold" Veto = "veto" ProposalCancelRate = "proposal_cancel_rate" + MinDepositRatio = "min_deposit_ratio" // ExpeditedThreshold must be at least as large as the regular Threshold // Therefore, we use this break out point in randomization. @@ -94,6 +95,11 @@ func GenVeto(r *rand.Rand) sdkmath.LegacyDec { return sdkmath.LegacyNewDecWithPrec(int64(simulation.RandIntBetween(r, 250, 334)), 3) } +// GenMinDepositRatio returns randomized DepositMinRatio +func GenMinDepositRatio(r *rand.Rand) sdkmath.LegacyDec { + return sdkmath.LegacyMustNewDecFromStr("0.01") +} + // RandomizedGenState generates a random GenesisState for gov func RandomizedGenState(simState *module.SimulationState) { startingProposalID := uint64(simState.Rand.Intn(100)) @@ -131,9 +137,12 @@ func RandomizedGenState(simState *module.SimulationState) { var veto sdkmath.LegacyDec simState.AppParams.GetOrGenerate(Veto, &veto, simState.Rand, func(r *rand.Rand) { veto = GenVeto(r) }) + var minDepositRatio sdkmath.LegacyDec + simState.AppParams.GetOrGenerate(MinDepositRatio, &minDepositRatio, simState.Rand, func(r *rand.Rand) { minDepositRatio = GenMinDepositRatio(r) }) + govGenesis := v1.NewGenesisState( startingProposalID, - v1.NewParams(minDeposit, expeditedMinDeposit, depositPeriod, votingPeriod, expeditedVotingPeriod, quorum.String(), threshold.String(), expitedVotingThreshold.String(), veto.String(), minInitialDepositRatio.String(), proposalCancelRate.String(), "", simState.Rand.Intn(2) == 0, simState.Rand.Intn(2) == 0, simState.Rand.Intn(2) == 0), + v1.NewParams(minDeposit, expeditedMinDeposit, depositPeriod, votingPeriod, expeditedVotingPeriod, quorum.String(), threshold.String(), expitedVotingThreshold.String(), veto.String(), minInitialDepositRatio.String(), proposalCancelRate.String(), "", simState.Rand.Intn(2) == 0, simState.Rand.Intn(2) == 0, simState.Rand.Intn(2) == 0, minDepositRatio.String()), ) bz, err := json.MarshalIndent(&govGenesis, "", " ") diff --git a/x/gov/simulation/genesis_test.go b/x/gov/simulation/genesis_test.go index 29b70cc4629e..573d10c56e23 100644 --- a/x/gov/simulation/genesis_test.go +++ b/x/gov/simulation/genesis_test.go @@ -9,6 +9,7 @@ import ( "gotest.tools/v3/assert" sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/gov/simulation/operations.go b/x/gov/simulation/operations.go index dbf48baae1c9..013e89fd5262 100644 --- a/x/gov/simulation/operations.go +++ b/x/gov/simulation/operations.go @@ -1,13 +1,10 @@ package simulation import ( - "errors" "math" "math/rand" "time" - "cosmossdk.io/collections" - sdkmath "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/baseapp" @@ -325,7 +322,12 @@ func SimulateMsgDeposit( return simtypes.NoOpMsg(types.ModuleName, TypeMsgDeposit, "unable to generate proposalID"), nil, nil } - deposit, skip, err := randomDeposit(r, ctx, ak, bk, k, simAccount.Address, false, false) + p, err := k.Proposals.Get(ctx, proposalID) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, TypeMsgDeposit, "unable to get proposal"), nil, err + } + + deposit, skip, err := randomDeposit(r, ctx, ak, bk, k, simAccount.Address, false, p.Expedited) switch { case skip: return simtypes.NoOpMsg(types.ModuleName, TypeMsgDeposit, "skip deposit"), nil, nil @@ -573,6 +575,13 @@ func randomDeposit( minDepositAmount := minDeposit[denomIndex].Amount + minDepositRatio, err := sdkmath.LegacyNewDecFromStr(params.GetMinDepositRatio()) + if err != nil { + return nil, false, err + } + + threshold := minDepositAmount.ToLegacyDec().Mul(minDepositRatio).TruncateInt() + minAmount := sdkmath.ZeroInt() if useMinAmount { minDepositPercent, err := sdkmath.LegacyNewDecFromStr(params.MinInitialDepositRatio) @@ -589,7 +598,7 @@ func randomDeposit( } amount = amount.Add(minAmount) - if amount.GT(spendableBalance) { + if amount.GT(spendableBalance) || amount.LT(threshold) { return nil, true, nil } @@ -603,7 +612,7 @@ func randomProposal(r *rand.Rand, k *keeper.Keeper, ctx sdk.Context) *v1.Proposa proposals = append(proposals, &value) return false, nil }) - if err != nil && !errors.Is(err, collections.ErrInvalidIterator) { + if err != nil { panic(err) } if len(proposals) == 0 { @@ -665,7 +674,7 @@ func randomWeightedVotingOptions(r *rand.Rand) v1.WeightedVoteOptions { if w1 > 0 { weightedVoteOptions = append(weightedVoteOptions, &v1.WeightedVoteOption{ Option: v1.OptionYes, - Weight: sdk.NewDecWithPrec(int64(w1), 2).String(), + Weight: sdkmath.LegacyNewDecWithPrec(int64(w1), 2).String(), }) } if w2 > 0 { diff --git a/x/gov/simulation/operations_test.go b/x/gov/simulation/operations_test.go index b0e6fd189557..ea88bca877a2 100644 --- a/x/gov/simulation/operations_test.go +++ b/x/gov/simulation/operations_test.go @@ -6,12 +6,13 @@ import ( "testing" "time" - "cosmossdk.io/depinject" - "cosmossdk.io/log" abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/gogoproto/proto" "github.com/stretchr/testify/require" + "cosmossdk.io/depinject" + "cosmossdk.io/log" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/testutil/configurator" diff --git a/x/gov/testutil/expected_keepers.go b/x/gov/testutil/expected_keepers.go index 0ac7521a2d2d..ed6994662bca 100644 --- a/x/gov/testutil/expected_keepers.go +++ b/x/gov/testutil/expected_keepers.go @@ -31,8 +31,8 @@ type BankKeeper interface { type StakingKeeper interface { types.StakingKeeper - BondDenom(ctx sdk.Context) string - TokensFromConsensusPower(ctx sdk.Context, power int64) math.Int + BondDenom(ctx context.Context) (string, error) + TokensFromConsensusPower(ctx context.Context, power int64) math.Int } // DistributionKeeper defines the expected distribution keeper diff --git a/x/gov/testutil/expected_keepers_mocks.go b/x/gov/testutil/expected_keepers_mocks.go index 92c8a5574130..64a678b21741 100644 --- a/x/gov/testutil/expected_keepers_mocks.go +++ b/x/gov/testutil/expected_keepers_mocks.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: x/gov/testutil/expected_keepers.go +// +// Generated by this command: +// +// mockgen -source=x/gov/testutil/expected_keepers.go -package testutil -destination x/gov/testutil/expected_keepers_mocks.go +// // Package testutil is a generated GoMock package. package testutil @@ -15,13 +20,14 @@ import ( keeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" types0 "github.com/cosmos/cosmos-sdk/x/bank/types" types1 "github.com/cosmos/cosmos-sdk/x/staking/types" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockAccountKeeper is a mock of AccountKeeper interface. type MockAccountKeeper struct { ctrl *gomock.Controller recorder *MockAccountKeeperMockRecorder + isgomock struct{} } // MockAccountKeeperMockRecorder is the mock recorder for MockAccountKeeper. @@ -64,7 +70,7 @@ func (m *MockAccountKeeper) GetAccount(ctx context.Context, addr types.AccAddres } // GetAccount indicates an expected call of GetAccount. -func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetAccount), ctx, addr) } @@ -78,7 +84,7 @@ func (m *MockAccountKeeper) GetModuleAccount(ctx context.Context, name string) t } // GetModuleAccount indicates an expected call of GetModuleAccount. -func (mr *MockAccountKeeperMockRecorder) GetModuleAccount(ctx, name interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) GetModuleAccount(ctx, name any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAccount), ctx, name) } @@ -92,7 +98,7 @@ func (m *MockAccountKeeper) GetModuleAddress(name string) types.AccAddress { } // GetModuleAddress indicates an expected call of GetModuleAddress. -func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(name interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(name any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAddress", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAddress), name) } @@ -104,7 +110,7 @@ func (m *MockAccountKeeper) IterateAccounts(ctx context.Context, cb func(types.A } // IterateAccounts indicates an expected call of IterateAccounts. -func (mr *MockAccountKeeperMockRecorder) IterateAccounts(ctx, cb interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) IterateAccounts(ctx, cb any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateAccounts", reflect.TypeOf((*MockAccountKeeper)(nil).IterateAccounts), ctx, cb) } @@ -116,7 +122,7 @@ func (m *MockAccountKeeper) SetModuleAccount(arg0 context.Context, arg1 types.Mo } // SetModuleAccount indicates an expected call of SetModuleAccount. -func (mr *MockAccountKeeperMockRecorder) SetModuleAccount(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) SetModuleAccount(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetModuleAccount", reflect.TypeOf((*MockAccountKeeper)(nil).SetModuleAccount), arg0, arg1) } @@ -125,6 +131,7 @@ func (mr *MockAccountKeeperMockRecorder) SetModuleAccount(arg0, arg1 interface{} type MockBankKeeper struct { ctrl *gomock.Controller recorder *MockBankKeeperMockRecorder + isgomock struct{} } // MockBankKeeperMockRecorder is the mock recorder for MockBankKeeper. @@ -154,11 +161,23 @@ func (m *MockBankKeeper) AllBalances(arg0 context.Context, arg1 *types0.QueryAll } // AllBalances indicates an expected call of AllBalances. -func (mr *MockBankKeeperMockRecorder) AllBalances(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) AllBalances(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AllBalances", reflect.TypeOf((*MockBankKeeper)(nil).AllBalances), arg0, arg1) } +// AppendSendRestriction mocks base method. +func (m *MockBankKeeper) AppendSendRestriction(restriction types0.SendRestrictionFn) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "AppendSendRestriction", restriction) +} + +// AppendSendRestriction indicates an expected call of AppendSendRestriction. +func (mr *MockBankKeeperMockRecorder) AppendSendRestriction(restriction any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AppendSendRestriction", reflect.TypeOf((*MockBankKeeper)(nil).AppendSendRestriction), restriction) +} + // Balance mocks base method. func (m *MockBankKeeper) Balance(arg0 context.Context, arg1 *types0.QueryBalanceRequest) (*types0.QueryBalanceResponse, error) { m.ctrl.T.Helper() @@ -169,7 +188,7 @@ func (m *MockBankKeeper) Balance(arg0 context.Context, arg1 *types0.QueryBalance } // Balance indicates an expected call of Balance. -func (mr *MockBankKeeperMockRecorder) Balance(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) Balance(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Balance", reflect.TypeOf((*MockBankKeeper)(nil).Balance), arg0, arg1) } @@ -183,7 +202,7 @@ func (m *MockBankKeeper) BlockedAddr(addr types.AccAddress) bool { } // BlockedAddr indicates an expected call of BlockedAddr. -func (mr *MockBankKeeperMockRecorder) BlockedAddr(addr interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) BlockedAddr(addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlockedAddr", reflect.TypeOf((*MockBankKeeper)(nil).BlockedAddr), addr) } @@ -197,11 +216,23 @@ func (m *MockBankKeeper) BurnCoins(ctx context.Context, moduleName string, amt t } // BurnCoins indicates an expected call of BurnCoins. -func (mr *MockBankKeeperMockRecorder) BurnCoins(ctx, moduleName, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) BurnCoins(ctx, moduleName, amt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BurnCoins", reflect.TypeOf((*MockBankKeeper)(nil).BurnCoins), ctx, moduleName, amt) } +// ClearSendRestriction mocks base method. +func (m *MockBankKeeper) ClearSendRestriction() { + m.ctrl.T.Helper() + m.ctrl.Call(m, "ClearSendRestriction") +} + +// ClearSendRestriction indicates an expected call of ClearSendRestriction. +func (mr *MockBankKeeperMockRecorder) ClearSendRestriction() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClearSendRestriction", reflect.TypeOf((*MockBankKeeper)(nil).ClearSendRestriction)) +} + // DelegateCoins mocks base method. func (m *MockBankKeeper) DelegateCoins(ctx context.Context, delegatorAddr, moduleAccAddr types.AccAddress, amt types.Coins) error { m.ctrl.T.Helper() @@ -211,7 +242,7 @@ func (m *MockBankKeeper) DelegateCoins(ctx context.Context, delegatorAddr, modul } // DelegateCoins indicates an expected call of DelegateCoins. -func (mr *MockBankKeeperMockRecorder) DelegateCoins(ctx, delegatorAddr, moduleAccAddr, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) DelegateCoins(ctx, delegatorAddr, moduleAccAddr, amt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelegateCoins", reflect.TypeOf((*MockBankKeeper)(nil).DelegateCoins), ctx, delegatorAddr, moduleAccAddr, amt) } @@ -225,7 +256,7 @@ func (m *MockBankKeeper) DelegateCoinsFromAccountToModule(ctx context.Context, s } // DelegateCoinsFromAccountToModule indicates an expected call of DelegateCoinsFromAccountToModule. -func (mr *MockBankKeeperMockRecorder) DelegateCoinsFromAccountToModule(ctx, senderAddr, recipientModule, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) DelegateCoinsFromAccountToModule(ctx, senderAddr, recipientModule, amt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelegateCoinsFromAccountToModule", reflect.TypeOf((*MockBankKeeper)(nil).DelegateCoinsFromAccountToModule), ctx, senderAddr, recipientModule, amt) } @@ -233,7 +264,7 @@ func (mr *MockBankKeeperMockRecorder) DelegateCoinsFromAccountToModule(ctx, send // DeleteSendEnabled mocks base method. func (m *MockBankKeeper) DeleteSendEnabled(ctx context.Context, denoms ...string) { m.ctrl.T.Helper() - varargs := []interface{}{ctx} + varargs := []any{ctx} for _, a := range denoms { varargs = append(varargs, a) } @@ -241,9 +272,9 @@ func (m *MockBankKeeper) DeleteSendEnabled(ctx context.Context, denoms ...string } // DeleteSendEnabled indicates an expected call of DeleteSendEnabled. -func (mr *MockBankKeeperMockRecorder) DeleteSendEnabled(ctx interface{}, denoms ...interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) DeleteSendEnabled(ctx any, denoms ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{ctx}, denoms...) + varargs := append([]any{ctx}, denoms...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteSendEnabled", reflect.TypeOf((*MockBankKeeper)(nil).DeleteSendEnabled), varargs...) } @@ -257,11 +288,26 @@ func (m *MockBankKeeper) DenomMetadata(arg0 context.Context, arg1 *types0.QueryD } // DenomMetadata indicates an expected call of DenomMetadata. -func (mr *MockBankKeeperMockRecorder) DenomMetadata(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) DenomMetadata(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DenomMetadata", reflect.TypeOf((*MockBankKeeper)(nil).DenomMetadata), arg0, arg1) } +// DenomMetadataByQueryString mocks base method. +func (m *MockBankKeeper) DenomMetadataByQueryString(arg0 context.Context, arg1 *types0.QueryDenomMetadataByQueryStringRequest) (*types0.QueryDenomMetadataByQueryStringResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DenomMetadataByQueryString", arg0, arg1) + ret0, _ := ret[0].(*types0.QueryDenomMetadataByQueryStringResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DenomMetadataByQueryString indicates an expected call of DenomMetadataByQueryString. +func (mr *MockBankKeeperMockRecorder) DenomMetadataByQueryString(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DenomMetadataByQueryString", reflect.TypeOf((*MockBankKeeper)(nil).DenomMetadataByQueryString), arg0, arg1) +} + // DenomOwners mocks base method. func (m *MockBankKeeper) DenomOwners(arg0 context.Context, arg1 *types0.QueryDenomOwnersRequest) (*types0.QueryDenomOwnersResponse, error) { m.ctrl.T.Helper() @@ -272,11 +318,26 @@ func (m *MockBankKeeper) DenomOwners(arg0 context.Context, arg1 *types0.QueryDen } // DenomOwners indicates an expected call of DenomOwners. -func (mr *MockBankKeeperMockRecorder) DenomOwners(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) DenomOwners(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DenomOwners", reflect.TypeOf((*MockBankKeeper)(nil).DenomOwners), arg0, arg1) } +// DenomOwnersByQuery mocks base method. +func (m *MockBankKeeper) DenomOwnersByQuery(arg0 context.Context, arg1 *types0.QueryDenomOwnersByQueryRequest) (*types0.QueryDenomOwnersByQueryResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DenomOwnersByQuery", arg0, arg1) + ret0, _ := ret[0].(*types0.QueryDenomOwnersByQueryResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DenomOwnersByQuery indicates an expected call of DenomOwnersByQuery. +func (mr *MockBankKeeperMockRecorder) DenomOwnersByQuery(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DenomOwnersByQuery", reflect.TypeOf((*MockBankKeeper)(nil).DenomOwnersByQuery), arg0, arg1) +} + // DenomsMetadata mocks base method. func (m *MockBankKeeper) DenomsMetadata(arg0 context.Context, arg1 *types0.QueryDenomsMetadataRequest) (*types0.QueryDenomsMetadataResponse, error) { m.ctrl.T.Helper() @@ -287,7 +348,7 @@ func (m *MockBankKeeper) DenomsMetadata(arg0 context.Context, arg1 *types0.Query } // DenomsMetadata indicates an expected call of DenomsMetadata. -func (mr *MockBankKeeperMockRecorder) DenomsMetadata(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) DenomsMetadata(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DenomsMetadata", reflect.TypeOf((*MockBankKeeper)(nil).DenomsMetadata), arg0, arg1) } @@ -301,7 +362,7 @@ func (m *MockBankKeeper) ExportGenesis(arg0 context.Context) *types0.GenesisStat } // ExportGenesis indicates an expected call of ExportGenesis. -func (mr *MockBankKeeperMockRecorder) ExportGenesis(arg0 interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) ExportGenesis(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExportGenesis", reflect.TypeOf((*MockBankKeeper)(nil).ExportGenesis), arg0) } @@ -315,7 +376,7 @@ func (m *MockBankKeeper) GetAccountsBalances(ctx context.Context) []types0.Balan } // GetAccountsBalances indicates an expected call of GetAccountsBalances. -func (mr *MockBankKeeperMockRecorder) GetAccountsBalances(ctx interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) GetAccountsBalances(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccountsBalances", reflect.TypeOf((*MockBankKeeper)(nil).GetAccountsBalances), ctx) } @@ -329,7 +390,7 @@ func (m *MockBankKeeper) GetAllBalances(ctx context.Context, addr types.AccAddre } // GetAllBalances indicates an expected call of GetAllBalances. -func (mr *MockBankKeeperMockRecorder) GetAllBalances(ctx, addr interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) GetAllBalances(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllBalances", reflect.TypeOf((*MockBankKeeper)(nil).GetAllBalances), ctx, addr) } @@ -343,7 +404,7 @@ func (m *MockBankKeeper) GetAllDenomMetaData(ctx context.Context) []types0.Metad } // GetAllDenomMetaData indicates an expected call of GetAllDenomMetaData. -func (mr *MockBankKeeperMockRecorder) GetAllDenomMetaData(ctx interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) GetAllDenomMetaData(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllDenomMetaData", reflect.TypeOf((*MockBankKeeper)(nil).GetAllDenomMetaData), ctx) } @@ -357,7 +418,7 @@ func (m *MockBankKeeper) GetAllSendEnabledEntries(ctx context.Context) []types0. } // GetAllSendEnabledEntries indicates an expected call of GetAllSendEnabledEntries. -func (mr *MockBankKeeperMockRecorder) GetAllSendEnabledEntries(ctx interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) GetAllSendEnabledEntries(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllSendEnabledEntries", reflect.TypeOf((*MockBankKeeper)(nil).GetAllSendEnabledEntries), ctx) } @@ -385,7 +446,7 @@ func (m *MockBankKeeper) GetBalance(ctx context.Context, addr types.AccAddress, } // GetBalance indicates an expected call of GetBalance. -func (mr *MockBankKeeperMockRecorder) GetBalance(ctx, addr, denom interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) GetBalance(ctx, addr, denom any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBalance", reflect.TypeOf((*MockBankKeeper)(nil).GetBalance), ctx, addr, denom) } @@ -414,7 +475,7 @@ func (m *MockBankKeeper) GetDenomMetaData(ctx context.Context, denom string) (ty } // GetDenomMetaData indicates an expected call of GetDenomMetaData. -func (mr *MockBankKeeperMockRecorder) GetDenomMetaData(ctx, denom interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) GetDenomMetaData(ctx, denom any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDenomMetaData", reflect.TypeOf((*MockBankKeeper)(nil).GetDenomMetaData), ctx, denom) } @@ -430,7 +491,7 @@ func (m *MockBankKeeper) GetPaginatedTotalSupply(ctx context.Context, pagination } // GetPaginatedTotalSupply indicates an expected call of GetPaginatedTotalSupply. -func (mr *MockBankKeeperMockRecorder) GetPaginatedTotalSupply(ctx, pagination interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) GetPaginatedTotalSupply(ctx, pagination any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPaginatedTotalSupply", reflect.TypeOf((*MockBankKeeper)(nil).GetPaginatedTotalSupply), ctx, pagination) } @@ -444,7 +505,7 @@ func (m *MockBankKeeper) GetParams(ctx context.Context) types0.Params { } // GetParams indicates an expected call of GetParams. -func (mr *MockBankKeeperMockRecorder) GetParams(ctx interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) GetParams(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetParams", reflect.TypeOf((*MockBankKeeper)(nil).GetParams), ctx) } @@ -459,7 +520,7 @@ func (m *MockBankKeeper) GetSendEnabledEntry(ctx context.Context, denom string) } // GetSendEnabledEntry indicates an expected call of GetSendEnabledEntry. -func (mr *MockBankKeeperMockRecorder) GetSendEnabledEntry(ctx, denom interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) GetSendEnabledEntry(ctx, denom any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSendEnabledEntry", reflect.TypeOf((*MockBankKeeper)(nil).GetSendEnabledEntry), ctx, denom) } @@ -473,7 +534,7 @@ func (m *MockBankKeeper) GetSupply(ctx context.Context, denom string) types.Coin } // GetSupply indicates an expected call of GetSupply. -func (mr *MockBankKeeperMockRecorder) GetSupply(ctx, denom interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) GetSupply(ctx, denom any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSupply", reflect.TypeOf((*MockBankKeeper)(nil).GetSupply), ctx, denom) } @@ -487,7 +548,7 @@ func (m *MockBankKeeper) HasBalance(ctx context.Context, addr types.AccAddress, } // HasBalance indicates an expected call of HasBalance. -func (mr *MockBankKeeperMockRecorder) HasBalance(ctx, addr, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) HasBalance(ctx, addr, amt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HasBalance", reflect.TypeOf((*MockBankKeeper)(nil).HasBalance), ctx, addr, amt) } @@ -501,7 +562,7 @@ func (m *MockBankKeeper) HasDenomMetaData(ctx context.Context, denom string) boo } // HasDenomMetaData indicates an expected call of HasDenomMetaData. -func (mr *MockBankKeeperMockRecorder) HasDenomMetaData(ctx, denom interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) HasDenomMetaData(ctx, denom any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HasDenomMetaData", reflect.TypeOf((*MockBankKeeper)(nil).HasDenomMetaData), ctx, denom) } @@ -515,7 +576,7 @@ func (m *MockBankKeeper) HasSupply(ctx context.Context, denom string) bool { } // HasSupply indicates an expected call of HasSupply. -func (mr *MockBankKeeperMockRecorder) HasSupply(ctx, denom interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) HasSupply(ctx, denom any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HasSupply", reflect.TypeOf((*MockBankKeeper)(nil).HasSupply), ctx, denom) } @@ -527,23 +588,23 @@ func (m *MockBankKeeper) InitGenesis(arg0 context.Context, arg1 *types0.GenesisS } // InitGenesis indicates an expected call of InitGenesis. -func (mr *MockBankKeeperMockRecorder) InitGenesis(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) InitGenesis(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitGenesis", reflect.TypeOf((*MockBankKeeper)(nil).InitGenesis), arg0, arg1) } // InputOutputCoins mocks base method. -func (m *MockBankKeeper) InputOutputCoins(ctx context.Context, inputs types0.Input, outputs []types0.Output) error { +func (m *MockBankKeeper) InputOutputCoins(ctx context.Context, input types0.Input, outputs []types0.Output) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "InputOutputCoins", ctx, inputs, outputs) + ret := m.ctrl.Call(m, "InputOutputCoins", ctx, input, outputs) ret0, _ := ret[0].(error) return ret0 } // InputOutputCoins indicates an expected call of InputOutputCoins. -func (mr *MockBankKeeperMockRecorder) InputOutputCoins(ctx, inputs, outputs interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) InputOutputCoins(ctx, input, outputs any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InputOutputCoins", reflect.TypeOf((*MockBankKeeper)(nil).InputOutputCoins), ctx, inputs, outputs) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InputOutputCoins", reflect.TypeOf((*MockBankKeeper)(nil).InputOutputCoins), ctx, input, outputs) } // IsSendEnabledCoin mocks base method. @@ -555,7 +616,7 @@ func (m *MockBankKeeper) IsSendEnabledCoin(ctx context.Context, coin types.Coin) } // IsSendEnabledCoin indicates an expected call of IsSendEnabledCoin. -func (mr *MockBankKeeperMockRecorder) IsSendEnabledCoin(ctx, coin interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) IsSendEnabledCoin(ctx, coin any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsSendEnabledCoin", reflect.TypeOf((*MockBankKeeper)(nil).IsSendEnabledCoin), ctx, coin) } @@ -563,7 +624,7 @@ func (mr *MockBankKeeperMockRecorder) IsSendEnabledCoin(ctx, coin interface{}) * // IsSendEnabledCoins mocks base method. func (m *MockBankKeeper) IsSendEnabledCoins(ctx context.Context, coins ...types.Coin) error { m.ctrl.T.Helper() - varargs := []interface{}{ctx} + varargs := []any{ctx} for _, a := range coins { varargs = append(varargs, a) } @@ -573,9 +634,9 @@ func (m *MockBankKeeper) IsSendEnabledCoins(ctx context.Context, coins ...types. } // IsSendEnabledCoins indicates an expected call of IsSendEnabledCoins. -func (mr *MockBankKeeperMockRecorder) IsSendEnabledCoins(ctx interface{}, coins ...interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) IsSendEnabledCoins(ctx any, coins ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{ctx}, coins...) + varargs := append([]any{ctx}, coins...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsSendEnabledCoins", reflect.TypeOf((*MockBankKeeper)(nil).IsSendEnabledCoins), varargs...) } @@ -588,7 +649,7 @@ func (m *MockBankKeeper) IsSendEnabledDenom(ctx context.Context, denom string) b } // IsSendEnabledDenom indicates an expected call of IsSendEnabledDenom. -func (mr *MockBankKeeperMockRecorder) IsSendEnabledDenom(ctx, denom interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) IsSendEnabledDenom(ctx, denom any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsSendEnabledDenom", reflect.TypeOf((*MockBankKeeper)(nil).IsSendEnabledDenom), ctx, denom) } @@ -600,7 +661,7 @@ func (m *MockBankKeeper) IterateAccountBalances(ctx context.Context, addr types. } // IterateAccountBalances indicates an expected call of IterateAccountBalances. -func (mr *MockBankKeeperMockRecorder) IterateAccountBalances(ctx, addr, cb interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) IterateAccountBalances(ctx, addr, cb any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateAccountBalances", reflect.TypeOf((*MockBankKeeper)(nil).IterateAccountBalances), ctx, addr, cb) } @@ -612,7 +673,7 @@ func (m *MockBankKeeper) IterateAllBalances(ctx context.Context, cb func(types.A } // IterateAllBalances indicates an expected call of IterateAllBalances. -func (mr *MockBankKeeperMockRecorder) IterateAllBalances(ctx, cb interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) IterateAllBalances(ctx, cb any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateAllBalances", reflect.TypeOf((*MockBankKeeper)(nil).IterateAllBalances), ctx, cb) } @@ -624,7 +685,7 @@ func (m *MockBankKeeper) IterateAllDenomMetaData(ctx context.Context, cb func(ty } // IterateAllDenomMetaData indicates an expected call of IterateAllDenomMetaData. -func (mr *MockBankKeeperMockRecorder) IterateAllDenomMetaData(ctx, cb interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) IterateAllDenomMetaData(ctx, cb any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateAllDenomMetaData", reflect.TypeOf((*MockBankKeeper)(nil).IterateAllDenomMetaData), ctx, cb) } @@ -636,7 +697,7 @@ func (m *MockBankKeeper) IterateSendEnabledEntries(ctx context.Context, cb func( } // IterateSendEnabledEntries indicates an expected call of IterateSendEnabledEntries. -func (mr *MockBankKeeperMockRecorder) IterateSendEnabledEntries(ctx, cb interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) IterateSendEnabledEntries(ctx, cb any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateSendEnabledEntries", reflect.TypeOf((*MockBankKeeper)(nil).IterateSendEnabledEntries), ctx, cb) } @@ -648,7 +709,7 @@ func (m *MockBankKeeper) IterateTotalSupply(ctx context.Context, cb func(types.C } // IterateTotalSupply indicates an expected call of IterateTotalSupply. -func (mr *MockBankKeeperMockRecorder) IterateTotalSupply(ctx, cb interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) IterateTotalSupply(ctx, cb any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateTotalSupply", reflect.TypeOf((*MockBankKeeper)(nil).IterateTotalSupply), ctx, cb) } @@ -662,7 +723,7 @@ func (m *MockBankKeeper) LockedCoins(ctx context.Context, addr types.AccAddress) } // LockedCoins indicates an expected call of LockedCoins. -func (mr *MockBankKeeperMockRecorder) LockedCoins(ctx, addr interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) LockedCoins(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LockedCoins", reflect.TypeOf((*MockBankKeeper)(nil).LockedCoins), ctx, addr) } @@ -676,7 +737,7 @@ func (m *MockBankKeeper) MintCoins(ctx context.Context, moduleName string, amt t } // MintCoins indicates an expected call of MintCoins. -func (mr *MockBankKeeperMockRecorder) MintCoins(ctx, moduleName, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) MintCoins(ctx, moduleName, amt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MintCoins", reflect.TypeOf((*MockBankKeeper)(nil).MintCoins), ctx, moduleName, amt) } @@ -691,11 +752,23 @@ func (m *MockBankKeeper) Params(arg0 context.Context, arg1 *types0.QueryParamsRe } // Params indicates an expected call of Params. -func (mr *MockBankKeeperMockRecorder) Params(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) Params(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Params", reflect.TypeOf((*MockBankKeeper)(nil).Params), arg0, arg1) } +// PrependSendRestriction mocks base method. +func (m *MockBankKeeper) PrependSendRestriction(restriction types0.SendRestrictionFn) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "PrependSendRestriction", restriction) +} + +// PrependSendRestriction indicates an expected call of PrependSendRestriction. +func (mr *MockBankKeeperMockRecorder) PrependSendRestriction(restriction any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PrependSendRestriction", reflect.TypeOf((*MockBankKeeper)(nil).PrependSendRestriction), restriction) +} + // SendCoins mocks base method. func (m *MockBankKeeper) SendCoins(ctx context.Context, fromAddr, toAddr types.AccAddress, amt types.Coins) error { m.ctrl.T.Helper() @@ -705,7 +778,7 @@ func (m *MockBankKeeper) SendCoins(ctx context.Context, fromAddr, toAddr types.A } // SendCoins indicates an expected call of SendCoins. -func (mr *MockBankKeeperMockRecorder) SendCoins(ctx, fromAddr, toAddr, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SendCoins(ctx, fromAddr, toAddr, amt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoins", reflect.TypeOf((*MockBankKeeper)(nil).SendCoins), ctx, fromAddr, toAddr, amt) } @@ -719,7 +792,7 @@ func (m *MockBankKeeper) SendCoinsFromAccountToModule(ctx context.Context, sende } // SendCoinsFromAccountToModule indicates an expected call of SendCoinsFromAccountToModule. -func (mr *MockBankKeeperMockRecorder) SendCoinsFromAccountToModule(ctx, senderAddr, recipientModule, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SendCoinsFromAccountToModule(ctx, senderAddr, recipientModule, amt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromAccountToModule", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromAccountToModule), ctx, senderAddr, recipientModule, amt) } @@ -733,7 +806,7 @@ func (m *MockBankKeeper) SendCoinsFromModuleToAccount(ctx context.Context, sende } // SendCoinsFromModuleToAccount indicates an expected call of SendCoinsFromModuleToAccount. -func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToAccount(ctx, senderModule, recipientAddr, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToAccount(ctx, senderModule, recipientAddr, amt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromModuleToAccount", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromModuleToAccount), ctx, senderModule, recipientAddr, amt) } @@ -747,7 +820,7 @@ func (m *MockBankKeeper) SendCoinsFromModuleToModule(ctx context.Context, sender } // SendCoinsFromModuleToModule indicates an expected call of SendCoinsFromModuleToModule. -func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToModule(ctx, senderModule, recipientModule, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToModule(ctx, senderModule, recipientModule, amt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromModuleToModule", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromModuleToModule), ctx, senderModule, recipientModule, amt) } @@ -762,7 +835,7 @@ func (m *MockBankKeeper) SendEnabled(arg0 context.Context, arg1 *types0.QuerySen } // SendEnabled indicates an expected call of SendEnabled. -func (mr *MockBankKeeperMockRecorder) SendEnabled(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SendEnabled(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendEnabled", reflect.TypeOf((*MockBankKeeper)(nil).SendEnabled), arg0, arg1) } @@ -774,7 +847,7 @@ func (m *MockBankKeeper) SetAllSendEnabled(ctx context.Context, sendEnableds []* } // SetAllSendEnabled indicates an expected call of SetAllSendEnabled. -func (mr *MockBankKeeperMockRecorder) SetAllSendEnabled(ctx, sendEnableds interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SetAllSendEnabled(ctx, sendEnableds any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetAllSendEnabled", reflect.TypeOf((*MockBankKeeper)(nil).SetAllSendEnabled), ctx, sendEnableds) } @@ -786,7 +859,7 @@ func (m *MockBankKeeper) SetDenomMetaData(ctx context.Context, denomMetaData typ } // SetDenomMetaData indicates an expected call of SetDenomMetaData. -func (mr *MockBankKeeperMockRecorder) SetDenomMetaData(ctx, denomMetaData interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SetDenomMetaData(ctx, denomMetaData any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetDenomMetaData", reflect.TypeOf((*MockBankKeeper)(nil).SetDenomMetaData), ctx, denomMetaData) } @@ -800,7 +873,7 @@ func (m *MockBankKeeper) SetParams(ctx context.Context, params types0.Params) er } // SetParams indicates an expected call of SetParams. -func (mr *MockBankKeeperMockRecorder) SetParams(ctx, params interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SetParams(ctx, params any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetParams", reflect.TypeOf((*MockBankKeeper)(nil).SetParams), ctx, params) } @@ -812,7 +885,7 @@ func (m *MockBankKeeper) SetSendEnabled(ctx context.Context, denom string, value } // SetSendEnabled indicates an expected call of SetSendEnabled. -func (mr *MockBankKeeperMockRecorder) SetSendEnabled(ctx, denom, value interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SetSendEnabled(ctx, denom, value any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetSendEnabled", reflect.TypeOf((*MockBankKeeper)(nil).SetSendEnabled), ctx, denom, value) } @@ -827,7 +900,7 @@ func (m *MockBankKeeper) SpendableBalanceByDenom(arg0 context.Context, arg1 *typ } // SpendableBalanceByDenom indicates an expected call of SpendableBalanceByDenom. -func (mr *MockBankKeeperMockRecorder) SpendableBalanceByDenom(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SpendableBalanceByDenom(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SpendableBalanceByDenom", reflect.TypeOf((*MockBankKeeper)(nil).SpendableBalanceByDenom), arg0, arg1) } @@ -842,7 +915,7 @@ func (m *MockBankKeeper) SpendableBalances(arg0 context.Context, arg1 *types0.Qu } // SpendableBalances indicates an expected call of SpendableBalances. -func (mr *MockBankKeeperMockRecorder) SpendableBalances(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SpendableBalances(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SpendableBalances", reflect.TypeOf((*MockBankKeeper)(nil).SpendableBalances), arg0, arg1) } @@ -856,7 +929,7 @@ func (m *MockBankKeeper) SpendableCoin(ctx context.Context, addr types.AccAddres } // SpendableCoin indicates an expected call of SpendableCoin. -func (mr *MockBankKeeperMockRecorder) SpendableCoin(ctx, addr, denom interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SpendableCoin(ctx, addr, denom any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SpendableCoin", reflect.TypeOf((*MockBankKeeper)(nil).SpendableCoin), ctx, addr, denom) } @@ -870,7 +943,7 @@ func (m *MockBankKeeper) SpendableCoins(ctx context.Context, addr types.AccAddre } // SpendableCoins indicates an expected call of SpendableCoins. -func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SpendableCoins", reflect.TypeOf((*MockBankKeeper)(nil).SpendableCoins), ctx, addr) } @@ -885,7 +958,7 @@ func (m *MockBankKeeper) SupplyOf(arg0 context.Context, arg1 *types0.QuerySupply } // SupplyOf indicates an expected call of SupplyOf. -func (mr *MockBankKeeperMockRecorder) SupplyOf(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SupplyOf(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SupplyOf", reflect.TypeOf((*MockBankKeeper)(nil).SupplyOf), arg0, arg1) } @@ -900,7 +973,7 @@ func (m *MockBankKeeper) TotalSupply(arg0 context.Context, arg1 *types0.QueryTot } // TotalSupply indicates an expected call of TotalSupply. -func (mr *MockBankKeeperMockRecorder) TotalSupply(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) TotalSupply(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TotalSupply", reflect.TypeOf((*MockBankKeeper)(nil).TotalSupply), arg0, arg1) } @@ -914,7 +987,7 @@ func (m *MockBankKeeper) UndelegateCoins(ctx context.Context, moduleAccAddr, del } // UndelegateCoins indicates an expected call of UndelegateCoins. -func (mr *MockBankKeeperMockRecorder) UndelegateCoins(ctx, moduleAccAddr, delegatorAddr, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) UndelegateCoins(ctx, moduleAccAddr, delegatorAddr, amt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UndelegateCoins", reflect.TypeOf((*MockBankKeeper)(nil).UndelegateCoins), ctx, moduleAccAddr, delegatorAddr, amt) } @@ -928,7 +1001,7 @@ func (m *MockBankKeeper) UndelegateCoinsFromModuleToAccount(ctx context.Context, } // UndelegateCoinsFromModuleToAccount indicates an expected call of UndelegateCoinsFromModuleToAccount. -func (mr *MockBankKeeperMockRecorder) UndelegateCoinsFromModuleToAccount(ctx, senderModule, recipientAddr, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) UndelegateCoinsFromModuleToAccount(ctx, senderModule, recipientAddr, amt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UndelegateCoinsFromModuleToAccount", reflect.TypeOf((*MockBankKeeper)(nil).UndelegateCoinsFromModuleToAccount), ctx, senderModule, recipientAddr, amt) } @@ -942,13 +1015,13 @@ func (m *MockBankKeeper) ValidateBalance(ctx context.Context, addr types.AccAddr } // ValidateBalance indicates an expected call of ValidateBalance. -func (mr *MockBankKeeperMockRecorder) ValidateBalance(ctx, addr interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) ValidateBalance(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateBalance", reflect.TypeOf((*MockBankKeeper)(nil).ValidateBalance), ctx, addr) } // WithMintCoinsRestriction mocks base method. -func (m *MockBankKeeper) WithMintCoinsRestriction(arg0 keeper.MintingRestrictionFn) keeper.BaseKeeper { +func (m *MockBankKeeper) WithMintCoinsRestriction(arg0 types0.MintingRestrictionFn) keeper.BaseKeeper { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "WithMintCoinsRestriction", arg0) ret0, _ := ret[0].(keeper.BaseKeeper) @@ -956,7 +1029,7 @@ func (m *MockBankKeeper) WithMintCoinsRestriction(arg0 keeper.MintingRestriction } // WithMintCoinsRestriction indicates an expected call of WithMintCoinsRestriction. -func (mr *MockBankKeeperMockRecorder) WithMintCoinsRestriction(arg0 interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) WithMintCoinsRestriction(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithMintCoinsRestriction", reflect.TypeOf((*MockBankKeeper)(nil).WithMintCoinsRestriction), arg0) } @@ -965,6 +1038,7 @@ func (mr *MockBankKeeperMockRecorder) WithMintCoinsRestriction(arg0 interface{}) type MockStakingKeeper struct { ctrl *gomock.Controller recorder *MockStakingKeeperMockRecorder + isgomock struct{} } // MockStakingKeeperMockRecorder is the mock recorder for MockStakingKeeper. @@ -985,45 +1059,50 @@ func (m *MockStakingKeeper) EXPECT() *MockStakingKeeperMockRecorder { } // BondDenom mocks base method. -func (m *MockStakingKeeper) BondDenom(ctx types.Context) string { +func (m *MockStakingKeeper) BondDenom(ctx context.Context) (string, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "BondDenom", ctx) ret0, _ := ret[0].(string) - return ret0 + ret1, _ := ret[1].(error) + return ret0, ret1 } // BondDenom indicates an expected call of BondDenom. -func (mr *MockStakingKeeperMockRecorder) BondDenom(ctx interface{}) *gomock.Call { +func (mr *MockStakingKeeperMockRecorder) BondDenom(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BondDenom", reflect.TypeOf((*MockStakingKeeper)(nil).BondDenom), ctx) } // IterateBondedValidatorsByPower mocks base method. -func (m *MockStakingKeeper) IterateBondedValidatorsByPower(arg0 types.Context, arg1 func(int64, types1.ValidatorI) bool) { +func (m *MockStakingKeeper) IterateBondedValidatorsByPower(arg0 context.Context, arg1 func(int64, types1.ValidatorI) bool) error { m.ctrl.T.Helper() - m.ctrl.Call(m, "IterateBondedValidatorsByPower", arg0, arg1) + ret := m.ctrl.Call(m, "IterateBondedValidatorsByPower", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 } // IterateBondedValidatorsByPower indicates an expected call of IterateBondedValidatorsByPower. -func (mr *MockStakingKeeperMockRecorder) IterateBondedValidatorsByPower(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStakingKeeperMockRecorder) IterateBondedValidatorsByPower(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateBondedValidatorsByPower", reflect.TypeOf((*MockStakingKeeper)(nil).IterateBondedValidatorsByPower), arg0, arg1) } // IterateDelegations mocks base method. -func (m *MockStakingKeeper) IterateDelegations(ctx types.Context, delegator types.AccAddress, fn func(int64, types1.DelegationI) bool) { +func (m *MockStakingKeeper) IterateDelegations(ctx context.Context, delegator types.AccAddress, fn func(int64, types1.DelegationI) bool) error { m.ctrl.T.Helper() - m.ctrl.Call(m, "IterateDelegations", ctx, delegator, fn) + ret := m.ctrl.Call(m, "IterateDelegations", ctx, delegator, fn) + ret0, _ := ret[0].(error) + return ret0 } // IterateDelegations indicates an expected call of IterateDelegations. -func (mr *MockStakingKeeperMockRecorder) IterateDelegations(ctx, delegator, fn interface{}) *gomock.Call { +func (mr *MockStakingKeeperMockRecorder) IterateDelegations(ctx, delegator, fn any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateDelegations", reflect.TypeOf((*MockStakingKeeper)(nil).IterateDelegations), ctx, delegator, fn) } // TokensFromConsensusPower mocks base method. -func (m *MockStakingKeeper) TokensFromConsensusPower(ctx types.Context, power int64) math.Int { +func (m *MockStakingKeeper) TokensFromConsensusPower(ctx context.Context, power int64) math.Int { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "TokensFromConsensusPower", ctx, power) ret0, _ := ret[0].(math.Int) @@ -1031,29 +1110,45 @@ func (m *MockStakingKeeper) TokensFromConsensusPower(ctx types.Context, power in } // TokensFromConsensusPower indicates an expected call of TokensFromConsensusPower. -func (mr *MockStakingKeeperMockRecorder) TokensFromConsensusPower(ctx, power interface{}) *gomock.Call { +func (mr *MockStakingKeeperMockRecorder) TokensFromConsensusPower(ctx, power any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TokensFromConsensusPower", reflect.TypeOf((*MockStakingKeeper)(nil).TokensFromConsensusPower), ctx, power) } // TotalBondedTokens mocks base method. -func (m *MockStakingKeeper) TotalBondedTokens(arg0 types.Context) math.Int { +func (m *MockStakingKeeper) TotalBondedTokens(arg0 context.Context) (math.Int, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "TotalBondedTokens", arg0) ret0, _ := ret[0].(math.Int) - return ret0 + ret1, _ := ret[1].(error) + return ret0, ret1 } // TotalBondedTokens indicates an expected call of TotalBondedTokens. -func (mr *MockStakingKeeperMockRecorder) TotalBondedTokens(arg0 interface{}) *gomock.Call { +func (mr *MockStakingKeeperMockRecorder) TotalBondedTokens(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TotalBondedTokens", reflect.TypeOf((*MockStakingKeeper)(nil).TotalBondedTokens), arg0) } +// ValidatorAddressCodec mocks base method. +func (m *MockStakingKeeper) ValidatorAddressCodec() address.Codec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ValidatorAddressCodec") + ret0, _ := ret[0].(address.Codec) + return ret0 +} + +// ValidatorAddressCodec indicates an expected call of ValidatorAddressCodec. +func (mr *MockStakingKeeperMockRecorder) ValidatorAddressCodec() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorAddressCodec", reflect.TypeOf((*MockStakingKeeper)(nil).ValidatorAddressCodec)) +} + // MockDistributionKeeper is a mock of DistributionKeeper interface. type MockDistributionKeeper struct { ctrl *gomock.Controller recorder *MockDistributionKeeperMockRecorder + isgomock struct{} } // MockDistributionKeeperMockRecorder is the mock recorder for MockDistributionKeeper. @@ -1082,7 +1177,7 @@ func (m *MockDistributionKeeper) FundCommunityPool(ctx context.Context, amount t } // FundCommunityPool indicates an expected call of FundCommunityPool. -func (mr *MockDistributionKeeperMockRecorder) FundCommunityPool(ctx, amount, sender interface{}) *gomock.Call { +func (mr *MockDistributionKeeperMockRecorder) FundCommunityPool(ctx, amount, sender any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FundCommunityPool", reflect.TypeOf((*MockDistributionKeeper)(nil).FundCommunityPool), ctx, amount, sender) } diff --git a/x/gov/types/errors.go b/x/gov/types/errors.go index fa584da93433..e89723bbb813 100644 --- a/x/gov/types/errors.go +++ b/x/gov/types/errors.go @@ -23,4 +23,6 @@ var ( ErrInvalidProposer = errors.Register(ModuleName, 18, "invalid proposer") ErrVotingPeriodEnded = errors.Register(ModuleName, 20, "voting period already ended") ErrInvalidProposal = errors.Register(ModuleName, 21, "invalid proposal") + ErrSummaryTooLong = errors.Register(ModuleName, 22, "summary too long") + ErrInvalidDepositDenom = errors.Register(ModuleName, 23, "invalid deposit denom") ) diff --git a/x/gov/types/events.go b/x/gov/types/events.go index c7f895234f0b..8f04e47cca17 100644 --- a/x/gov/types/events.go +++ b/x/gov/types/events.go @@ -10,8 +10,10 @@ const ( EventTypeCancelProposal = "cancel_proposal" AttributeKeyProposalResult = "proposal_result" + AttributeKeyVoter = "voter" AttributeKeyOption = "option" AttributeKeyProposalID = "proposal_id" + AttributeKeyDepositor = "depositor" AttributeKeyProposalMessages = "proposal_messages" // Msg type_urls in the proposal AttributeKeyVotingPeriodStart = "voting_period_start" AttributeKeyProposalLog = "proposal_log" // log of proposal execution @@ -21,6 +23,7 @@ const ( AttributeValueExpeditedProposalRejected = "expedited_proposal_rejected" // didn't meet expedited vote quorum AttributeValueProposalFailed = "proposal_failed" // error on proposal handler AttributeValueProposalCanceled = "proposal_canceled" // error on proposal handler + AttributeKeyProposalProposer = "proposal_proposer" // account address of the proposer AttributeKeyProposalType = "proposal_type" AttributeSignalTitle = "signal_title" diff --git a/x/gov/types/expected_keepers.go b/x/gov/types/expected_keepers.go index 859b3a87c299..e27e9b57aa28 100644 --- a/x/gov/types/expected_keepers.go +++ b/x/gov/types/expected_keepers.go @@ -18,16 +18,17 @@ type ParamSubspace interface { // StakingKeeper expected staking keeper (Validator and Delegator sets) (noalias) type StakingKeeper interface { + ValidatorAddressCodec() addresscodec.Codec // iterate through bonded validators by operator address, execute func for each validator IterateBondedValidatorsByPower( - sdk.Context, func(index int64, validator stakingtypes.ValidatorI) (stop bool), - ) + context.Context, func(index int64, validator stakingtypes.ValidatorI) (stop bool), + ) error - TotalBondedTokens(sdk.Context) math.Int // total bonded tokens within the validator set + TotalBondedTokens(context.Context) (math.Int, error) // total bonded tokens within the validator set IterateDelegations( - ctx sdk.Context, delegator sdk.AccAddress, + ctx context.Context, delegator sdk.AccAddress, fn func(index int64, delegation stakingtypes.DelegationI) (stop bool), - ) + ) error } // DistributionKeeper defines the expected distribution keeper (noalias) @@ -66,11 +67,11 @@ type BankKeeper interface { // GovHooks event hooks for governance proposal object (noalias) type GovHooks interface { - AfterProposalSubmission(ctx context.Context, proposalID uint64) // Must be called after proposal is submitted - AfterProposalDeposit(ctx context.Context, proposalID uint64, depositorAddr sdk.AccAddress) // Must be called after a deposit is made - AfterProposalVote(ctx context.Context, proposalID uint64, voterAddr sdk.AccAddress) // Must be called after a vote on a proposal is cast - AfterProposalFailedMinDeposit(ctx context.Context, proposalID uint64) // Must be called when proposal fails to reach min deposit - AfterProposalVotingPeriodEnded(ctx context.Context, proposalID uint64) // Must be called when proposal's finishes it's voting period + AfterProposalSubmission(ctx context.Context, proposalID uint64) error // Must be called after proposal is submitted + AfterProposalDeposit(ctx context.Context, proposalID uint64, depositorAddr sdk.AccAddress) error // Must be called after a deposit is made + AfterProposalVote(ctx context.Context, proposalID uint64, voterAddr sdk.AccAddress) error // Must be called after a vote on a proposal is cast + AfterProposalFailedMinDeposit(ctx context.Context, proposalID uint64) error // Must be called when proposal fails to reach min deposit + AfterProposalVotingPeriodEnded(ctx context.Context, proposalID uint64) error // Must be called when proposal's finishes it's voting period } type GovHooksWrapper struct{ GovHooks } diff --git a/x/gov/types/hooks.go b/x/gov/types/hooks.go index 099e7d0da1db..7749e83b4cce 100644 --- a/x/gov/types/hooks.go +++ b/x/gov/types/hooks.go @@ -2,6 +2,7 @@ package types import ( "context" + "errors" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -15,32 +16,43 @@ func NewMultiGovHooks(hooks ...GovHooks) MultiGovHooks { return hooks } -func (h MultiGovHooks) AfterProposalSubmission(ctx context.Context, proposalID uint64) { +func (h MultiGovHooks) AfterProposalSubmission(ctx context.Context, proposalID uint64) error { + var errs error for i := range h { - h[i].AfterProposalSubmission(ctx, proposalID) + errs = errors.Join(errs, h[i].AfterProposalSubmission(ctx, proposalID)) } + + return errs } -func (h MultiGovHooks) AfterProposalDeposit(ctx context.Context, proposalID uint64, depositorAddr sdk.AccAddress) { +func (h MultiGovHooks) AfterProposalDeposit(ctx context.Context, proposalID uint64, depositorAddr sdk.AccAddress) error { + var errs error for i := range h { - h[i].AfterProposalDeposit(ctx, proposalID, depositorAddr) + errs = errors.Join(errs, h[i].AfterProposalDeposit(ctx, proposalID, depositorAddr)) } + return errs } -func (h MultiGovHooks) AfterProposalVote(ctx context.Context, proposalID uint64, voterAddr sdk.AccAddress) { +func (h MultiGovHooks) AfterProposalVote(ctx context.Context, proposalID uint64, voterAddr sdk.AccAddress) error { + var errs error for i := range h { - h[i].AfterProposalVote(ctx, proposalID, voterAddr) + errs = errors.Join(errs, h[i].AfterProposalVote(ctx, proposalID, voterAddr)) } + return errs } -func (h MultiGovHooks) AfterProposalFailedMinDeposit(ctx context.Context, proposalID uint64) { +func (h MultiGovHooks) AfterProposalFailedMinDeposit(ctx context.Context, proposalID uint64) error { + var errs error for i := range h { - h[i].AfterProposalFailedMinDeposit(ctx, proposalID) + errs = errors.Join(errs, h[i].AfterProposalFailedMinDeposit(ctx, proposalID)) } + return errs } -func (h MultiGovHooks) AfterProposalVotingPeriodEnded(ctx context.Context, proposalID uint64) { +func (h MultiGovHooks) AfterProposalVotingPeriodEnded(ctx context.Context, proposalID uint64) error { + var errs error for i := range h { - h[i].AfterProposalVotingPeriodEnded(ctx, proposalID) + errs = errors.Join(errs, h[i].AfterProposalVotingPeriodEnded(ctx, proposalID)) } + return errs } diff --git a/x/gov/types/v1/genesis.go b/x/gov/types/v1/genesis.go index ef44bd481627..71352bb77839 100644 --- a/x/gov/types/v1/genesis.go +++ b/x/gov/types/v1/genesis.go @@ -2,6 +2,9 @@ package v1 import ( "errors" + "fmt" + + "golang.org/x/sync/errgroup" "github.com/cosmos/cosmos-sdk/codec/types" ) @@ -27,13 +30,79 @@ func (data GenesisState) Empty() bool { return data.StartingProposalId == 0 || data.Params == nil } -// ValidateGenesis checks if parameters are within valid ranges +// ValidateGenesis checks if gov genesis state is valid ranges +// It checks if params are in valid ranges +// It also makes sure that the provided proposal IDs are unique and +// that there are no duplicate deposit or vote records and no vote or deposits for non-existent proposals func ValidateGenesis(data *GenesisState) error { if data.StartingProposalId == 0 { return errors.New("starting proposal id must be greater than 0") } - return data.Params.ValidateBasic() + var errGroup errgroup.Group + + // weed out duplicate proposals + proposalIds := make(map[uint64]struct{}) + for _, p := range data.Proposals { + if _, ok := proposalIds[p.Id]; ok { + return fmt.Errorf("duplicate proposal id: %d", p.Id) + } + + proposalIds[p.Id] = struct{}{} + } + + // weed out duplicate deposits + errGroup.Go(func() error { + type depositKey struct { + ProposalId uint64 //nolint:revive // staying consistent with main and v0.47 + Depositor string + } + depositIds := make(map[depositKey]struct{}) + for _, d := range data.Deposits { + if _, ok := proposalIds[d.ProposalId]; !ok { + return fmt.Errorf("deposit %v has non-existent proposal id: %d", d, d.ProposalId) + } + + dk := depositKey{d.ProposalId, d.Depositor} + if _, ok := depositIds[dk]; ok { + return fmt.Errorf("duplicate deposit: %v", d) + } + + depositIds[dk] = struct{}{} + } + + return nil + }) + + // weed out duplicate votes + errGroup.Go(func() error { + type voteKey struct { + ProposalId uint64 //nolint:revive // staying consistent with main and v0.47 + Voter string + } + voteIds := make(map[voteKey]struct{}) + for _, v := range data.Votes { + if _, ok := proposalIds[v.ProposalId]; !ok { + return fmt.Errorf("vote %v has non-existent proposal id: %d", v, v.ProposalId) + } + + vk := voteKey{v.ProposalId, v.Voter} + if _, ok := voteIds[vk]; ok { + return fmt.Errorf("duplicate vote: %v", v) + } + + voteIds[vk] = struct{}{} + } + + return nil + }) + + // verify params + errGroup.Go(func() error { + return data.Params.ValidateBasic() + }) + + return errGroup.Wait() } var _ types.UnpackInterfacesMessage = GenesisState{} diff --git a/x/gov/types/v1/genesis_test.go b/x/gov/types/v1/genesis_test.go index 682131769a58..691dca03e6e5 100644 --- a/x/gov/types/v1/genesis_test.go +++ b/x/gov/types/v1/genesis_test.go @@ -3,11 +3,12 @@ package v1_test import ( "testing" + "github.com/stretchr/testify/require" + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" - "github.com/stretchr/testify/require" ) func TestEmptyGenesis(t *testing.T) { @@ -24,7 +25,7 @@ func TestValidateGenesis(t *testing.T) { testCases := []struct { name string genesisState func() *v1.GenesisState - expErr bool + expErrMsg string }{ { name: "valid", @@ -37,7 +38,7 @@ func TestValidateGenesis(t *testing.T) { genesisState: func() *v1.GenesisState { return v1.NewGenesisState(0, params) }, - expErr: true, + expErrMsg: "starting proposal id must be greater than 0", }, { name: "invalid min deposit", @@ -48,9 +49,9 @@ func TestValidateGenesis(t *testing.T) { Amount: sdkmath.NewInt(-100), }} - return v1.NewGenesisState(0, params1) + return v1.NewGenesisState(v1.DefaultStartingProposalID, params1) }, - expErr: true, + expErrMsg: "invalid minimum deposit", }, { name: "invalid max deposit period", @@ -58,9 +59,9 @@ func TestValidateGenesis(t *testing.T) { params1 := params params1.MaxDepositPeriod = nil - return v1.NewGenesisState(0, params1) + return v1.NewGenesisState(v1.DefaultStartingProposalID, params1) }, - expErr: true, + expErrMsg: "maximum deposit period must not be nil", }, { name: "invalid quorum", @@ -68,9 +69,9 @@ func TestValidateGenesis(t *testing.T) { params1 := params params1.Quorum = "2" - return v1.NewGenesisState(0, params1) + return v1.NewGenesisState(v1.DefaultStartingProposalID, params1) }, - expErr: true, + expErrMsg: "quorom too large", }, { name: "invalid threshold", @@ -78,9 +79,9 @@ func TestValidateGenesis(t *testing.T) { params1 := params params1.Threshold = "2" - return v1.NewGenesisState(0, params1) + return v1.NewGenesisState(v1.DefaultStartingProposalID, params1) }, - expErr: true, + expErrMsg: "vote threshold too large", }, { name: "invalid veto threshold", @@ -88,9 +89,86 @@ func TestValidateGenesis(t *testing.T) { params1 := params params1.VetoThreshold = "2" - return v1.NewGenesisState(0, params1) + return v1.NewGenesisState(v1.DefaultStartingProposalID, params1) + }, + expErrMsg: "veto threshold too large", + }, + { + name: "duplicate proposals", + genesisState: func() *v1.GenesisState { + state := v1.NewGenesisState(v1.DefaultStartingProposalID, params) + state.Proposals = append(state.Proposals, &v1.Proposal{Id: 1}) + state.Proposals = append(state.Proposals, &v1.Proposal{Id: 1}) + + return state + }, + expErrMsg: "duplicate proposal id: 1", + }, + { + name: "duplicate votes", + genesisState: func() *v1.GenesisState { + state := v1.NewGenesisState(v1.DefaultStartingProposalID, params) + state.Proposals = append(state.Proposals, &v1.Proposal{Id: 1}) + state.Votes = append(state.Votes, + &v1.Vote{ + ProposalId: 1, + Voter: "voter", + }, + &v1.Vote{ + ProposalId: 1, + Voter: "voter", + }) + + return state + }, + expErrMsg: "duplicate vote", + }, + { + name: "duplicate deposits", + genesisState: func() *v1.GenesisState { + state := v1.NewGenesisState(v1.DefaultStartingProposalID, params) + state.Proposals = append(state.Proposals, &v1.Proposal{Id: 1}) + state.Deposits = append(state.Deposits, + &v1.Deposit{ + ProposalId: 1, + Depositor: "depositor", + }, + &v1.Deposit{ + ProposalId: 1, + Depositor: "depositor", + }) + + return state + }, + expErrMsg: "duplicate deposit: proposal_id:1 depositor:\"depositor\"", + }, + { + name: "non-existent proposal id in votes", + genesisState: func() *v1.GenesisState { + state := v1.NewGenesisState(v1.DefaultStartingProposalID, params) + state.Votes = append(state.Votes, + &v1.Vote{ + ProposalId: 1, + Voter: "voter", + }) + + return state + }, + expErrMsg: "vote proposal_id:1 voter:\"voter\" has non-existent proposal id: 1", + }, + { + name: "non-existent proposal id in deposits", + genesisState: func() *v1.GenesisState { + state := v1.NewGenesisState(v1.DefaultStartingProposalID, params) + state.Deposits = append(state.Deposits, + &v1.Deposit{ + ProposalId: 1, + Depositor: "depositor", + }) + + return state }, - expErr: true, + expErrMsg: "deposit proposal_id:1 depositor:\"depositor\"", }, } @@ -98,8 +176,9 @@ func TestValidateGenesis(t *testing.T) { tc := tc t.Run(tc.name, func(t *testing.T) { err := v1.ValidateGenesis(tc.genesisState()) - if tc.expErr { + if tc.expErrMsg != "" { require.Error(t, err) + require.ErrorContains(t, err, tc.expErrMsg) } else { require.NoError(t, err) } diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index 198b81c37567..06eb08581f26 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -264,7 +264,8 @@ type Proposal struct { // voting_end_time is the end time of voting on a proposal. VotingEndTime *time.Time `protobuf:"bytes,9,opt,name=voting_end_time,json=votingEndTime,proto3,stdtime" json:"voting_end_time,omitempty"` // metadata is any arbitrary metadata attached to the proposal. - // the recommended format of the metadata is to be found here: https://docs.cosmos.network/v0.47/modules/gov#proposal-3 + // the recommended format of the metadata is to be found here: + // https://docs.cosmos.network/v0.47/modules/gov#proposal-3 Metadata string `protobuf:"bytes,10,opt,name=metadata,proto3" json:"metadata,omitempty"` // title is the title of the proposal // @@ -282,6 +283,10 @@ type Proposal struct { // // Since: cosmos-sdk 0.50 Expedited bool `protobuf:"varint,14,opt,name=expedited,proto3" json:"expedited,omitempty"` + // failed_reason defines the reason why the proposal failed + // + // Since: cosmos-sdk 0.50 + FailedReason string `protobuf:"bytes,15,opt,name=failed_reason,json=failedReason,proto3" json:"failed_reason,omitempty"` } func (m *Proposal) Reset() { *m = Proposal{} } @@ -415,6 +420,13 @@ func (m *Proposal) GetExpedited() bool { return false } +func (m *Proposal) GetFailedReason() string { + if m != nil { + return m.FailedReason + } + return "" +} + // TallyResult defines a standard tally for a governance proposal. type TallyResult struct { // yes_count is the number of yes votes on a proposal. @@ -497,7 +509,7 @@ type Vote struct { Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` // options is the weighted vote options. Options []*WeightedVoteOption `protobuf:"bytes,4,rep,name=options,proto3" json:"options,omitempty"` - // metadata is any arbitrary metadata to attached to the vote. + // metadata is any arbitrary metadata attached to the vote. // the recommended format of the metadata is to be found here: https://docs.cosmos.network/v0.47/modules/gov#vote-5 Metadata string `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata,omitempty"` } @@ -783,6 +795,12 @@ type Params struct { BurnProposalDepositPrevote bool `protobuf:"varint,14,opt,name=burn_proposal_deposit_prevote,json=burnProposalDepositPrevote,proto3" json:"burn_proposal_deposit_prevote,omitempty"` // burn deposits if quorum with vote type no_veto is met BurnVoteVeto bool `protobuf:"varint,15,opt,name=burn_vote_veto,json=burnVoteVeto,proto3" json:"burn_vote_veto,omitempty"` + // The ratio representing the proportion of the deposit value minimum that must be met when making a deposit. + // Default value: 0.01. Meaning that for a chain with a min_deposit of 100stake, a deposit of 1stake would be + // required. + // + // Since: cosmos-sdk 0.50 + MinDepositRatio string `protobuf:"bytes,16,opt,name=min_deposit_ratio,json=minDepositRatio,proto3" json:"min_deposit_ratio,omitempty"` } func (m *Params) Reset() { *m = Params{} } @@ -923,6 +941,13 @@ func (m *Params) GetBurnVoteVeto() bool { return false } +func (m *Params) GetMinDepositRatio() string { + if m != nil { + return m.MinDepositRatio + } + return "" +} + func init() { proto.RegisterEnum("cosmos.gov.v1.VoteOption", VoteOption_name, VoteOption_value) proto.RegisterEnum("cosmos.gov.v1.ProposalStatus", ProposalStatus_name, ProposalStatus_value) @@ -940,94 +965,97 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1/gov.proto", fileDescriptor_e05cb1c0d030febb) } var fileDescriptor_e05cb1c0d030febb = []byte{ - // 1389 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0xcb, 0x6e, 0xdb, 0x46, - 0x17, 0x36, 0x75, 0xd7, 0xd1, 0xc5, 0xca, 0xd8, 0x89, 0x69, 0x27, 0x96, 0x1c, 0x21, 0x08, 0xfc, - 0xe7, 0x22, 0xfd, 0x4e, 0x9a, 0x2e, 0x9a, 0x02, 0x85, 0x64, 0x31, 0x0d, 0x8d, 0xc4, 0x52, 0x29, - 0x45, 0x4e, 0xba, 0x21, 0x28, 0x71, 0x22, 0x13, 0x15, 0x39, 0x2a, 0x39, 0x52, 0xac, 0x47, 0xe8, - 0x2e, 0xcb, 0xae, 0x8a, 0x2e, 0xbb, 0xec, 0x22, 0xe8, 0x33, 0x64, 0x55, 0x04, 0xe9, 0xa2, 0xdd, - 0x34, 0x29, 0x92, 0x45, 0x81, 0x3c, 0x45, 0xc1, 0xe1, 0x50, 0x94, 0x64, 0xb5, 0xb6, 0xb3, 0xb1, - 0xc5, 0x73, 0xbe, 0xef, 0x9b, 0x33, 0xe7, 0x32, 0x43, 0xc2, 0x5a, 0x97, 0x38, 0x26, 0x71, 0xca, - 0x3d, 0x32, 0x2a, 0x8f, 0x76, 0xdc, 0x7f, 0xa5, 0x81, 0x4d, 0x28, 0x41, 0x19, 0xcf, 0x51, 0x72, - 0x2d, 0xa3, 0x9d, 0x8d, 0x3c, 0xc7, 0x75, 0x34, 0x07, 0x97, 0x47, 0x3b, 0x1d, 0x4c, 0xb5, 0x9d, - 0x72, 0x97, 0x18, 0x96, 0x07, 0xdf, 0x58, 0xed, 0x91, 0x1e, 0x61, 0x3f, 0xcb, 0xee, 0x2f, 0x6e, - 0x2d, 0xf4, 0x08, 0xe9, 0xf5, 0x71, 0x99, 0x3d, 0x75, 0x86, 0x4f, 0xcb, 0xd4, 0x30, 0xb1, 0x43, - 0x35, 0x73, 0xc0, 0x01, 0xeb, 0xf3, 0x00, 0xcd, 0x1a, 0x73, 0x57, 0x7e, 0xde, 0xa5, 0x0f, 0x6d, - 0x8d, 0x1a, 0xc4, 0x5f, 0x71, 0xdd, 0x8b, 0x48, 0xf5, 0x16, 0xe5, 0xd1, 0x7a, 0xae, 0x73, 0x9a, - 0x69, 0x58, 0xa4, 0xcc, 0xfe, 0x7a, 0xa6, 0x22, 0x01, 0x74, 0x80, 0x8d, 0xde, 0x21, 0xc5, 0x7a, - 0x9b, 0x50, 0x5c, 0x1f, 0xb8, 0x4a, 0x68, 0x07, 0x62, 0x84, 0xfd, 0x12, 0x85, 0x2d, 0x61, 0x3b, - 0x7b, 0x6b, 0xbd, 0x34, 0xb3, 0xeb, 0x52, 0x00, 0x55, 0x38, 0x10, 0x5d, 0x85, 0xd8, 0x33, 0x26, - 0x24, 0x86, 0xb6, 0x84, 0xed, 0x64, 0x35, 0xfb, 0xfa, 0xc5, 0x4d, 0xe0, 0xac, 0x1a, 0xee, 0x2a, - 0xdc, 0x5b, 0xfc, 0x51, 0x80, 0x78, 0x0d, 0x0f, 0x88, 0x63, 0x50, 0x54, 0x80, 0xd4, 0xc0, 0x26, - 0x03, 0xe2, 0x68, 0x7d, 0xd5, 0xd0, 0xd9, 0x5a, 0x11, 0x05, 0x7c, 0x93, 0xac, 0xa3, 0x4f, 0x21, - 0xa9, 0x7b, 0x58, 0x62, 0x73, 0x5d, 0xf1, 0xf5, 0x8b, 0x9b, 0xab, 0x5c, 0xb7, 0xa2, 0xeb, 0x36, - 0x76, 0x9c, 0x26, 0xb5, 0x0d, 0xab, 0xa7, 0x04, 0x50, 0xf4, 0x39, 0xc4, 0x34, 0x93, 0x0c, 0x2d, - 0x2a, 0x86, 0xb7, 0xc2, 0xdb, 0xa9, 0x20, 0x7e, 0xb7, 0x4c, 0x25, 0x5e, 0xa6, 0xd2, 0x2e, 0x31, - 0xac, 0x6a, 0xf2, 0xe5, 0x9b, 0xc2, 0xd2, 0x4f, 0x7f, 0xff, 0x7c, 0x4d, 0x50, 0x38, 0xa7, 0xf8, - 0x36, 0x0a, 0x89, 0x06, 0x0f, 0x02, 0x65, 0x21, 0x34, 0x09, 0x2d, 0x64, 0xe8, 0xe8, 0xff, 0x90, - 0x30, 0xb1, 0xe3, 0x68, 0x3d, 0xec, 0x88, 0x21, 0x26, 0xbe, 0x5a, 0xf2, 0x2a, 0x52, 0xf2, 0x2b, - 0x52, 0xaa, 0x58, 0x63, 0x65, 0x82, 0x42, 0x77, 0x20, 0xe6, 0x50, 0x8d, 0x0e, 0x1d, 0x31, 0xcc, - 0x92, 0xb9, 0x39, 0x97, 0x4c, 0x7f, 0xa9, 0x26, 0x03, 0x29, 0x1c, 0x8c, 0xee, 0x03, 0x7a, 0x6a, - 0x58, 0x5a, 0x5f, 0xa5, 0x5a, 0xbf, 0x3f, 0x56, 0x6d, 0xec, 0x0c, 0xfb, 0x54, 0x8c, 0x6c, 0x09, - 0xdb, 0xa9, 0x5b, 0x1b, 0x73, 0x12, 0x2d, 0x17, 0xa2, 0x30, 0x84, 0x92, 0x63, 0xac, 0x29, 0x0b, - 0xaa, 0x40, 0xca, 0x19, 0x76, 0x4c, 0x83, 0xaa, 0x6e, 0x9b, 0x89, 0x51, 0x2e, 0x31, 0x1f, 0x75, - 0xcb, 0xef, 0xc1, 0x6a, 0xe4, 0xf9, 0xdb, 0x82, 0xa0, 0x80, 0x47, 0x72, 0xcd, 0x68, 0x0f, 0x72, - 0x3c, 0xbb, 0x2a, 0xb6, 0x74, 0x4f, 0x27, 0x76, 0x4a, 0x9d, 0x2c, 0x67, 0x4a, 0x96, 0xce, 0xb4, - 0x64, 0xc8, 0x50, 0x42, 0xb5, 0xbe, 0xca, 0xed, 0x62, 0xfc, 0x0c, 0x35, 0x4a, 0x33, 0xaa, 0xdf, - 0x40, 0x0f, 0xe0, 0xdc, 0x88, 0x50, 0xc3, 0xea, 0xa9, 0x0e, 0xd5, 0x6c, 0xbe, 0xbf, 0xc4, 0x29, - 0xe3, 0x5a, 0xf6, 0xa8, 0x4d, 0x97, 0xc9, 0x02, 0xbb, 0x0f, 0xdc, 0x14, 0xec, 0x31, 0x79, 0x4a, - 0xad, 0x8c, 0x47, 0xf4, 0xb7, 0xb8, 0xe1, 0x36, 0x09, 0xd5, 0x74, 0x8d, 0x6a, 0x22, 0xb8, 0x6d, - 0xab, 0x4c, 0x9e, 0xd1, 0x2a, 0x44, 0xa9, 0x41, 0xfb, 0x58, 0x4c, 0x31, 0x87, 0xf7, 0x80, 0x44, - 0x88, 0x3b, 0x43, 0xd3, 0xd4, 0xec, 0xb1, 0x98, 0x66, 0x76, 0xff, 0x11, 0x7d, 0x02, 0x09, 0x6f, - 0x22, 0xb0, 0x2d, 0x66, 0x4e, 0x18, 0x81, 0x09, 0x12, 0x5d, 0x82, 0x24, 0x3e, 0x1a, 0x60, 0xdd, - 0xa0, 0x58, 0x17, 0xb3, 0x5b, 0xc2, 0x76, 0x42, 0x09, 0x0c, 0xc5, 0xdf, 0x05, 0x48, 0x4d, 0x77, - 0xc8, 0x75, 0x48, 0x8e, 0xb1, 0xa3, 0x76, 0xd9, 0xc8, 0x08, 0xc7, 0xe6, 0x57, 0xb6, 0xa8, 0x92, - 0x18, 0x63, 0x67, 0xd7, 0xf5, 0xa3, 0xdb, 0x90, 0xd1, 0x3a, 0x0e, 0xd5, 0x0c, 0x8b, 0x13, 0x42, - 0x0b, 0x09, 0x69, 0x0e, 0xf2, 0x48, 0xff, 0x83, 0x84, 0x45, 0x38, 0x3e, 0xbc, 0x10, 0x1f, 0xb7, - 0x88, 0x07, 0xbd, 0x0b, 0xc8, 0x22, 0xea, 0x33, 0x83, 0x1e, 0xaa, 0x23, 0x4c, 0x7d, 0x52, 0x64, - 0x21, 0x69, 0xd9, 0x22, 0x07, 0x06, 0x3d, 0x6c, 0x63, 0xea, 0x91, 0x8b, 0xbf, 0x08, 0x10, 0x71, - 0x4f, 0xa7, 0x93, 0xcf, 0x96, 0x12, 0x44, 0x47, 0x84, 0xe2, 0x93, 0xcf, 0x15, 0x0f, 0x86, 0xee, - 0x42, 0xdc, 0x3b, 0xea, 0x1c, 0x31, 0xc2, 0x1a, 0xf6, 0xf2, 0xdc, 0x10, 0x1e, 0x3f, 0x47, 0x15, - 0x9f, 0x31, 0xd3, 0x10, 0xd1, 0xd9, 0x86, 0xd8, 0x8b, 0x24, 0xc2, 0xb9, 0x48, 0xf1, 0x4f, 0x01, - 0x32, 0xbc, 0xad, 0x1b, 0x9a, 0xad, 0x99, 0x0e, 0x7a, 0x02, 0x29, 0xd3, 0xb0, 0x26, 0x53, 0x22, - 0x9c, 0x34, 0x25, 0x9b, 0xee, 0x94, 0x7c, 0x78, 0x53, 0x38, 0x3f, 0xc5, 0xba, 0x41, 0x4c, 0x83, - 0x62, 0x73, 0x40, 0xc7, 0x0a, 0x98, 0x86, 0xe5, 0xcf, 0x8d, 0x09, 0xc8, 0xd4, 0x8e, 0x7c, 0x90, - 0x3a, 0xc0, 0xb6, 0x41, 0x74, 0x96, 0x08, 0x77, 0x85, 0xf9, 0x66, 0xaf, 0xf1, 0x0b, 0xa6, 0x7a, - 0xe5, 0xc3, 0x9b, 0xc2, 0xa5, 0xe3, 0xc4, 0x60, 0x91, 0xef, 0xdd, 0x59, 0xc8, 0x99, 0xda, 0x91, - 0xbf, 0x13, 0xe6, 0xff, 0x2c, 0x24, 0x0a, 0xc5, 0xc7, 0x90, 0x6e, 0xb3, 0x19, 0xe1, 0xbb, 0xab, - 0x01, 0x9f, 0x19, 0x7f, 0x75, 0xe1, 0xa4, 0xd5, 0x23, 0x4c, 0x3d, 0xed, 0xb1, 0xa6, 0x94, 0x7f, - 0xf0, 0x9b, 0x99, 0x2b, 0x5f, 0x85, 0xd8, 0xb7, 0x43, 0x62, 0x0f, 0xcd, 0x05, 0x9d, 0xcc, 0x6e, - 0x22, 0xcf, 0x8b, 0x6e, 0x40, 0x92, 0x1e, 0xda, 0xd8, 0x39, 0x24, 0x7d, 0xfd, 0x5f, 0x2e, 0xad, - 0x00, 0x80, 0xee, 0x40, 0x96, 0x75, 0x63, 0x40, 0x09, 0x2f, 0xa4, 0x64, 0x5c, 0x54, 0xcb, 0x07, - 0xb1, 0x00, 0x7f, 0x8b, 0x43, 0x8c, 0xc7, 0x26, 0x9d, 0xb1, 0xa6, 0x53, 0x27, 0xdf, 0x74, 0xfd, - 0x1e, 0x7e, 0x5c, 0xfd, 0x22, 0x8b, 0xeb, 0x73, 0xbc, 0x16, 0xe1, 0x8f, 0xa8, 0xc5, 0x54, 0xde, - 0x23, 0xa7, 0xcf, 0x7b, 0xf4, 0xec, 0x79, 0x8f, 0x9d, 0x22, 0xef, 0x48, 0x86, 0x75, 0x37, 0xd1, - 0x86, 0x65, 0x50, 0x23, 0xb8, 0x6a, 0x54, 0x16, 0xbe, 0x18, 0x5f, 0xa8, 0x70, 0xc1, 0x34, 0x2c, - 0xd9, 0xc3, 0xf3, 0xf4, 0x28, 0x2e, 0x1a, 0x55, 0xe1, 0xfc, 0xe4, 0x24, 0xe9, 0x6a, 0x56, 0x17, - 0xf7, 0xb9, 0x4c, 0x62, 0xa1, 0xcc, 0x8a, 0x0f, 0xde, 0x65, 0x58, 0x4f, 0x63, 0x0f, 0x56, 0xe7, - 0x35, 0x74, 0xec, 0x50, 0x76, 0xbf, 0xfc, 0xd7, 0xd9, 0x83, 0x66, 0xc5, 0x6a, 0xd8, 0xa1, 0xe8, - 0x00, 0xd6, 0x26, 0x27, 0xb9, 0x3a, 0x5b, 0x37, 0x38, 0x5d, 0xdd, 0xce, 0x4f, 0xf8, 0xed, 0xe9, - 0x02, 0x7e, 0x01, 0x2b, 0x81, 0x70, 0x90, 0xef, 0xd4, 0xc2, 0x6d, 0xa2, 0x09, 0x34, 0x48, 0xfa, - 0x63, 0x08, 0x94, 0xd5, 0xe9, 0x3e, 0x4f, 0x9f, 0xa1, 0xcf, 0x83, 0x18, 0x1e, 0x06, 0x0d, 0xbf, - 0x0d, 0xb9, 0xce, 0xd0, 0xb6, 0xdc, 0xed, 0x62, 0x95, 0x77, 0x59, 0x86, 0xdd, 0x6a, 0x59, 0xd7, - 0xee, 0x1e, 0xb9, 0x5f, 0x79, 0xdd, 0x55, 0x81, 0x4d, 0x86, 0x9c, 0xa4, 0x7b, 0x32, 0x24, 0x36, - 0x76, 0xd9, 0xfc, 0x32, 0xdc, 0x70, 0x41, 0xfe, 0x9b, 0x97, 0x3f, 0x0d, 0x1e, 0x02, 0x5d, 0x81, - 0x6c, 0xb0, 0x98, 0xdb, 0x56, 0xe2, 0x32, 0xe3, 0xa4, 0xfd, 0xa5, 0xdc, 0xeb, 0xe6, 0xda, 0x77, - 0x02, 0xc0, 0xd4, 0x2b, 0xf3, 0x45, 0x58, 0x6b, 0xd7, 0x5b, 0x92, 0x5a, 0x6f, 0xb4, 0xe4, 0xfa, - 0xbe, 0xfa, 0x68, 0xbf, 0xd9, 0x90, 0x76, 0xe5, 0x7b, 0xb2, 0x54, 0xcb, 0x2d, 0xa1, 0x15, 0x58, - 0x9e, 0x76, 0x3e, 0x91, 0x9a, 0x39, 0x01, 0xad, 0xc1, 0xca, 0xb4, 0xb1, 0x52, 0x6d, 0xb6, 0x2a, - 0xf2, 0x7e, 0x2e, 0x84, 0x10, 0x64, 0xa7, 0x1d, 0xfb, 0xf5, 0x5c, 0x18, 0x5d, 0x02, 0x71, 0xd6, - 0xa6, 0x1e, 0xc8, 0xad, 0xfb, 0x6a, 0x5b, 0x6a, 0xd5, 0x73, 0x91, 0x6b, 0xbf, 0x0a, 0x90, 0x9d, - 0x7d, 0x8d, 0x44, 0x05, 0xb8, 0xd8, 0x50, 0xea, 0x8d, 0x7a, 0xb3, 0xf2, 0x40, 0x6d, 0xb6, 0x2a, - 0xad, 0x47, 0xcd, 0xb9, 0x98, 0x8a, 0x90, 0x9f, 0x07, 0xd4, 0xa4, 0x46, 0xbd, 0x29, 0xb7, 0xd4, - 0x86, 0xa4, 0xc8, 0xf5, 0x5a, 0x4e, 0x40, 0x97, 0x61, 0x73, 0x1e, 0xd3, 0xae, 0xb7, 0xe4, 0xfd, - 0x2f, 0x7d, 0x48, 0x08, 0x6d, 0xc0, 0x85, 0x79, 0x48, 0xa3, 0xd2, 0x6c, 0x4a, 0x35, 0x2f, 0xe8, - 0x79, 0x9f, 0x22, 0xed, 0x49, 0xbb, 0x2d, 0xa9, 0x96, 0x8b, 0x2c, 0x62, 0xde, 0xab, 0xc8, 0x0f, - 0xa4, 0x5a, 0x2e, 0x5a, 0x95, 0x5e, 0xbe, 0xcb, 0x0b, 0xaf, 0xde, 0xe5, 0x85, 0xbf, 0xde, 0xe5, - 0x85, 0xe7, 0xef, 0xf3, 0x4b, 0xaf, 0xde, 0xe7, 0x97, 0xfe, 0x78, 0x9f, 0x5f, 0xfa, 0xfa, 0x7a, - 0xcf, 0xa0, 0x87, 0xc3, 0x4e, 0xa9, 0x4b, 0x4c, 0xfe, 0x71, 0xc3, 0xff, 0xdd, 0x74, 0xf4, 0x6f, - 0xca, 0x47, 0xec, 0x83, 0x8d, 0x8e, 0x07, 0xd8, 0x71, 0xbf, 0xc6, 0x62, 0x6c, 0x02, 0x6e, 0xff, - 0x13, 0x00, 0x00, 0xff, 0xff, 0xba, 0xe0, 0x97, 0xe3, 0xce, 0x0d, 0x00, 0x00, + // 1432 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0x4b, 0x6f, 0xdb, 0xc6, + 0x16, 0x36, 0x25, 0x59, 0x96, 0x8f, 0x1e, 0x56, 0xc6, 0x4e, 0x4c, 0x3b, 0xb1, 0xec, 0xe8, 0x06, + 0x81, 0x6f, 0x1e, 0xd2, 0x75, 0x72, 0x73, 0x17, 0xc9, 0x05, 0x0a, 0xd9, 0x62, 0x1a, 0x1a, 0x89, + 0xa5, 0x52, 0x8a, 0x9d, 0x74, 0x43, 0xd0, 0xe6, 0x44, 0x1e, 0x54, 0xe4, 0xa8, 0x9c, 0x91, 0x63, + 0xed, 0xbb, 0xe9, 0xaa, 0x59, 0x76, 0x55, 0x74, 0xd9, 0x65, 0x17, 0x41, 0x7f, 0x43, 0x56, 0x45, + 0x90, 0x4d, 0xbb, 0x69, 0x5a, 0x24, 0x8b, 0x02, 0xf9, 0x15, 0x05, 0x87, 0x43, 0x91, 0x96, 0xd5, + 0xda, 0xce, 0xc6, 0x16, 0xcf, 0xf9, 0xbe, 0x6f, 0xce, 0x9c, 0xc7, 0x0c, 0x09, 0xf3, 0x7b, 0x94, + 0x39, 0x94, 0x55, 0x3b, 0xf4, 0xa0, 0x7a, 0xb0, 0xe6, 0xff, 0xab, 0xf4, 0x3c, 0xca, 0x29, 0xca, + 0x07, 0x8e, 0x8a, 0x6f, 0x39, 0x58, 0x5b, 0x2c, 0x49, 0xdc, 0xae, 0xc5, 0x70, 0xf5, 0x60, 0x6d, + 0x17, 0x73, 0x6b, 0xad, 0xba, 0x47, 0x89, 0x1b, 0xc0, 0x17, 0xe7, 0x3a, 0xb4, 0x43, 0xc5, 0xcf, + 0xaa, 0xff, 0x4b, 0x5a, 0x97, 0x3b, 0x94, 0x76, 0xba, 0xb8, 0x2a, 0x9e, 0x76, 0xfb, 0xcf, 0xaa, + 0x9c, 0x38, 0x98, 0x71, 0xcb, 0xe9, 0x49, 0xc0, 0xc2, 0x28, 0xc0, 0x72, 0x07, 0xd2, 0x55, 0x1a, + 0x75, 0xd9, 0x7d, 0xcf, 0xe2, 0x84, 0x86, 0x2b, 0x2e, 0x04, 0x11, 0x99, 0xc1, 0xa2, 0x32, 0xda, + 0xc0, 0x75, 0xce, 0x72, 0x88, 0x4b, 0xab, 0xe2, 0x6f, 0x60, 0x2a, 0x53, 0x40, 0x3b, 0x98, 0x74, + 0xf6, 0x39, 0xb6, 0xb7, 0x29, 0xc7, 0x8d, 0x9e, 0xaf, 0x84, 0xd6, 0x20, 0x4d, 0xc5, 0x2f, 0x55, + 0x59, 0x51, 0x56, 0x0b, 0xb7, 0x16, 0x2a, 0x47, 0x76, 0x5d, 0x89, 0xa0, 0x86, 0x04, 0xa2, 0xab, + 0x90, 0x7e, 0x2e, 0x84, 0xd4, 0xc4, 0x8a, 0xb2, 0x3a, 0xbd, 0x5e, 0x78, 0xf3, 0xf2, 0x26, 0x48, + 0x56, 0x1d, 0xef, 0x19, 0xd2, 0x5b, 0xfe, 0x5e, 0x81, 0xa9, 0x3a, 0xee, 0x51, 0x46, 0x38, 0x5a, + 0x86, 0x6c, 0xcf, 0xa3, 0x3d, 0xca, 0xac, 0xae, 0x49, 0x6c, 0xb1, 0x56, 0xca, 0x80, 0xd0, 0xa4, + 0xdb, 0xe8, 0x7f, 0x30, 0x6d, 0x07, 0x58, 0xea, 0x49, 0x5d, 0xf5, 0xcd, 0xcb, 0x9b, 0x73, 0x52, + 0xb7, 0x66, 0xdb, 0x1e, 0x66, 0xac, 0xc5, 0x3d, 0xe2, 0x76, 0x8c, 0x08, 0x8a, 0xfe, 0x0f, 0x69, + 0xcb, 0xa1, 0x7d, 0x97, 0xab, 0xc9, 0x95, 0xe4, 0x6a, 0x36, 0x8a, 0xdf, 0x2f, 0x53, 0x45, 0x96, + 0xa9, 0xb2, 0x41, 0x89, 0xbb, 0x3e, 0xfd, 0xea, 0xed, 0xf2, 0xc4, 0x0f, 0x7f, 0xfe, 0x78, 0x4d, + 0x31, 0x24, 0xa7, 0xfc, 0x55, 0x1a, 0x32, 0x4d, 0x19, 0x04, 0x2a, 0x40, 0x62, 0x18, 0x5a, 0x82, + 0xd8, 0xe8, 0x3f, 0x90, 0x71, 0x30, 0x63, 0x56, 0x07, 0x33, 0x35, 0x21, 0xc4, 0xe7, 0x2a, 0x41, + 0x45, 0x2a, 0x61, 0x45, 0x2a, 0x35, 0x77, 0x60, 0x0c, 0x51, 0xe8, 0x0e, 0xa4, 0x19, 0xb7, 0x78, + 0x9f, 0xa9, 0x49, 0x91, 0xcc, 0xa5, 0x91, 0x64, 0x86, 0x4b, 0xb5, 0x04, 0xc8, 0x90, 0x60, 0xf4, + 0x00, 0xd0, 0x33, 0xe2, 0x5a, 0x5d, 0x93, 0x5b, 0xdd, 0xee, 0xc0, 0xf4, 0x30, 0xeb, 0x77, 0xb9, + 0x9a, 0x5a, 0x51, 0x56, 0xb3, 0xb7, 0x16, 0x47, 0x24, 0xda, 0x3e, 0xc4, 0x10, 0x08, 0xa3, 0x28, + 0x58, 0x31, 0x0b, 0xaa, 0x41, 0x96, 0xf5, 0x77, 0x1d, 0xc2, 0x4d, 0xbf, 0xcd, 0xd4, 0x49, 0x29, + 0x31, 0x1a, 0x75, 0x3b, 0xec, 0xc1, 0xf5, 0xd4, 0x8b, 0xdf, 0x97, 0x15, 0x03, 0x02, 0x92, 0x6f, + 0x46, 0x9b, 0x50, 0x94, 0xd9, 0x35, 0xb1, 0x6b, 0x07, 0x3a, 0xe9, 0x53, 0xea, 0x14, 0x24, 0x53, + 0x73, 0x6d, 0xa1, 0xa5, 0x43, 0x9e, 0x53, 0x6e, 0x75, 0x4d, 0x69, 0x57, 0xa7, 0xce, 0x50, 0xa3, + 0x9c, 0xa0, 0x86, 0x0d, 0xf4, 0x10, 0xce, 0x1d, 0x50, 0x4e, 0xdc, 0x8e, 0xc9, 0xb8, 0xe5, 0xc9, + 0xfd, 0x65, 0x4e, 0x19, 0xd7, 0x4c, 0x40, 0x6d, 0xf9, 0x4c, 0x11, 0xd8, 0x03, 0x90, 0xa6, 0x68, + 0x8f, 0xd3, 0xa7, 0xd4, 0xca, 0x07, 0xc4, 0x70, 0x8b, 0x8b, 0x7e, 0x93, 0x70, 0xcb, 0xb6, 0xb8, + 0xa5, 0x82, 0xdf, 0xb6, 0xc6, 0xf0, 0x19, 0xcd, 0xc1, 0x24, 0x27, 0xbc, 0x8b, 0xd5, 0xac, 0x70, + 0x04, 0x0f, 0x48, 0x85, 0x29, 0xd6, 0x77, 0x1c, 0xcb, 0x1b, 0xa8, 0x39, 0x61, 0x0f, 0x1f, 0xd1, + 0x7f, 0x21, 0x13, 0x4c, 0x04, 0xf6, 0xd4, 0xfc, 0x09, 0x23, 0x30, 0x44, 0xa2, 0x4b, 0x30, 0x8d, + 0x0f, 0x7b, 0xd8, 0x26, 0x1c, 0xdb, 0x6a, 0x61, 0x45, 0x59, 0xcd, 0x18, 0x91, 0x01, 0xfd, 0x0b, + 0xf2, 0xcf, 0x2c, 0xd2, 0xc5, 0xb6, 0xe9, 0x61, 0x8b, 0x51, 0x57, 0x9d, 0x11, 0x6b, 0xe6, 0x02, + 0xa3, 0x21, 0x6c, 0xe5, 0x5f, 0x14, 0xc8, 0xc6, 0xdb, 0xe8, 0x3a, 0x4c, 0x0f, 0x30, 0x33, 0xf7, + 0xc4, 0x5c, 0x29, 0xc7, 0x86, 0x5c, 0x77, 0xb9, 0x91, 0x19, 0x60, 0xb6, 0xe1, 0xfb, 0xd1, 0x6d, + 0xc8, 0x5b, 0xbb, 0x8c, 0x5b, 0xc4, 0x95, 0x84, 0xc4, 0x58, 0x42, 0x4e, 0x82, 0x02, 0xd2, 0xbf, + 0x21, 0xe3, 0x52, 0x89, 0x4f, 0x8e, 0xc5, 0x4f, 0xb9, 0x34, 0x80, 0xde, 0x03, 0xe4, 0x52, 0xf3, + 0x39, 0xe1, 0xfb, 0xe6, 0x01, 0xe6, 0x21, 0x29, 0x35, 0x96, 0x34, 0xe3, 0xd2, 0x1d, 0xc2, 0xf7, + 0xb7, 0x31, 0x0f, 0xc8, 0xe5, 0x9f, 0x14, 0x48, 0xf9, 0x47, 0xd8, 0xc9, 0x07, 0x50, 0x05, 0x26, + 0x0f, 0x28, 0xc7, 0x27, 0x1f, 0x3e, 0x01, 0x0c, 0xdd, 0x83, 0xa9, 0xe0, 0x3c, 0x64, 0x6a, 0x4a, + 0x74, 0xf5, 0xe5, 0x91, 0x49, 0x3d, 0x7e, 0xd8, 0x1a, 0x21, 0xe3, 0x48, 0xd7, 0x4c, 0x1e, 0xed, + 0x9a, 0xcd, 0x54, 0x26, 0x59, 0x4c, 0x95, 0x7f, 0x53, 0x20, 0x2f, 0x7b, 0xbf, 0x69, 0x79, 0x96, + 0xc3, 0xd0, 0x53, 0xc8, 0x3a, 0xc4, 0x1d, 0x8e, 0x92, 0x72, 0xd2, 0x28, 0x2d, 0xf9, 0xa3, 0xf4, + 0xe1, 0xed, 0xf2, 0xf9, 0x18, 0xeb, 0x06, 0x75, 0x08, 0xc7, 0x4e, 0x8f, 0x0f, 0x0c, 0x70, 0x88, + 0x1b, 0x0e, 0x97, 0x03, 0xc8, 0xb1, 0x0e, 0x43, 0x90, 0xd9, 0xc3, 0x1e, 0xa1, 0xb6, 0x48, 0x84, + 0xbf, 0xc2, 0xe8, 0x44, 0xd4, 0xe5, 0x2d, 0xb4, 0x7e, 0xe5, 0xc3, 0xdb, 0xe5, 0x4b, 0xc7, 0x89, + 0xd1, 0x22, 0xdf, 0xfa, 0x03, 0x53, 0x74, 0xac, 0xc3, 0x70, 0x27, 0xc2, 0x7f, 0x37, 0xa1, 0x2a, + 0xe5, 0x27, 0x90, 0xdb, 0x16, 0x83, 0x24, 0x77, 0x57, 0x07, 0x39, 0x58, 0xe1, 0xea, 0xca, 0x49, + 0xab, 0xa7, 0x84, 0x7a, 0x2e, 0x60, 0xc5, 0x94, 0xbf, 0x0b, 0x9b, 0x59, 0x2a, 0x5f, 0x85, 0xf4, + 0x97, 0x7d, 0xea, 0xf5, 0x9d, 0x31, 0x9d, 0x2c, 0xae, 0xab, 0xc0, 0x8b, 0x6e, 0xc0, 0x34, 0xdf, + 0xf7, 0x30, 0xdb, 0xa7, 0x5d, 0xfb, 0x6f, 0x6e, 0xb6, 0x08, 0x80, 0xee, 0x40, 0x41, 0x74, 0x63, + 0x44, 0x49, 0x8e, 0xa5, 0xe4, 0x7d, 0x54, 0x3b, 0x04, 0x89, 0x00, 0xbf, 0xc9, 0x40, 0x5a, 0xc6, + 0xa6, 0x9d, 0xb1, 0xa6, 0xb1, 0xe3, 0x31, 0x5e, 0xbf, 0x47, 0x1f, 0x57, 0xbf, 0xd4, 0xf8, 0xfa, + 0x1c, 0xaf, 0x45, 0xf2, 0x23, 0x6a, 0x11, 0xcb, 0x7b, 0xea, 0xf4, 0x79, 0x9f, 0x3c, 0x7b, 0xde, + 0xd3, 0xa7, 0xc8, 0x3b, 0xd2, 0x61, 0xc1, 0x4f, 0x34, 0x71, 0x09, 0x27, 0xd1, 0x7d, 0x64, 0x8a, + 0xf0, 0xd5, 0xa9, 0xb1, 0x0a, 0x17, 0x1c, 0xe2, 0xea, 0x01, 0x5e, 0xa6, 0xc7, 0xf0, 0xd1, 0x68, + 0x1d, 0xce, 0x0f, 0x4f, 0x92, 0x3d, 0xcb, 0xdd, 0xc3, 0x5d, 0x29, 0x93, 0x19, 0x2b, 0x33, 0x1b, + 0x82, 0x37, 0x04, 0x36, 0xd0, 0xd8, 0x84, 0xb9, 0x51, 0x0d, 0x1b, 0x33, 0x2e, 0x2e, 0xa1, 0x7f, + 0x3a, 0x7b, 0xd0, 0x51, 0xb1, 0x3a, 0x66, 0x1c, 0xed, 0xc0, 0xfc, 0xf0, 0xb8, 0x37, 0x8f, 0xd6, + 0x0d, 0x4e, 0x57, 0xb7, 0xf3, 0x43, 0xfe, 0x76, 0xbc, 0x80, 0x9f, 0xc0, 0x6c, 0x24, 0x1c, 0xe5, + 0x3b, 0x3b, 0x76, 0x9b, 0x68, 0x08, 0x8d, 0x92, 0xfe, 0x04, 0x22, 0x65, 0x33, 0xde, 0xe7, 0xb9, + 0x33, 0xf4, 0x79, 0x14, 0xc3, 0xa3, 0xa8, 0xe1, 0x57, 0xa1, 0xb8, 0xdb, 0xf7, 0x5c, 0x7f, 0xbb, + 0xd8, 0x94, 0x5d, 0x96, 0x17, 0x57, 0x5f, 0xc1, 0xb7, 0xfb, 0x47, 0xee, 0x67, 0x41, 0x77, 0xd5, + 0x60, 0x49, 0x20, 0x87, 0xe9, 0x1e, 0x0e, 0x89, 0x87, 0x7d, 0xb6, 0xbc, 0x31, 0x17, 0x7d, 0x50, + 0xf8, 0x7a, 0x16, 0x4e, 0x43, 0x80, 0x40, 0x57, 0xa0, 0x10, 0x2d, 0xe6, 0xb7, 0x95, 0xb8, 0x43, + 0x33, 0x46, 0x2e, 0x5c, 0xca, 0xbf, 0x6e, 0xd0, 0x5d, 0x38, 0x17, 0xdb, 0xa2, 0x6c, 0x89, 0xe2, + 0xd8, 0x5c, 0xcd, 0x44, 0xa3, 0x2b, 0xda, 0xe1, 0xda, 0xd7, 0x0a, 0x40, 0xec, 0x9d, 0xfc, 0x22, + 0xcc, 0x6f, 0x37, 0xda, 0x9a, 0xd9, 0x68, 0xb6, 0xf5, 0xc6, 0x96, 0xf9, 0x78, 0xab, 0xd5, 0xd4, + 0x36, 0xf4, 0xfb, 0xba, 0x56, 0x2f, 0x4e, 0xa0, 0x59, 0x98, 0x89, 0x3b, 0x9f, 0x6a, 0xad, 0xa2, + 0x82, 0xe6, 0x61, 0x36, 0x6e, 0xac, 0xad, 0xb7, 0xda, 0x35, 0x7d, 0xab, 0x98, 0x40, 0x08, 0x0a, + 0x71, 0xc7, 0x56, 0xa3, 0x98, 0x44, 0x97, 0x40, 0x3d, 0x6a, 0x33, 0x77, 0xf4, 0xf6, 0x03, 0x73, + 0x5b, 0x6b, 0x37, 0x8a, 0xa9, 0x6b, 0x3f, 0x2b, 0x50, 0x38, 0xfa, 0x9e, 0x8a, 0x96, 0xe1, 0x62, + 0xd3, 0x68, 0x34, 0x1b, 0xad, 0xda, 0x43, 0xb3, 0xd5, 0xae, 0xb5, 0x1f, 0xb7, 0x46, 0x62, 0x2a, + 0x43, 0x69, 0x14, 0x50, 0xd7, 0x9a, 0x8d, 0x96, 0xde, 0x36, 0x9b, 0x9a, 0xa1, 0x37, 0xea, 0x45, + 0x05, 0x5d, 0x86, 0xa5, 0x51, 0xcc, 0x76, 0xa3, 0xad, 0x6f, 0x7d, 0x1a, 0x42, 0x12, 0x68, 0x11, + 0x2e, 0x8c, 0x42, 0x9a, 0xb5, 0x56, 0x4b, 0xab, 0x07, 0x41, 0x8f, 0xfa, 0x0c, 0x6d, 0x53, 0xdb, + 0x68, 0x6b, 0xf5, 0x62, 0x6a, 0x1c, 0xf3, 0x7e, 0x4d, 0x7f, 0xa8, 0xd5, 0x8b, 0x93, 0xeb, 0xda, + 0xab, 0x77, 0x25, 0xe5, 0xf5, 0xbb, 0x92, 0xf2, 0xc7, 0xbb, 0x92, 0xf2, 0xe2, 0x7d, 0x69, 0xe2, + 0xf5, 0xfb, 0xd2, 0xc4, 0xaf, 0xef, 0x4b, 0x13, 0x9f, 0x5f, 0xef, 0x10, 0xbe, 0xdf, 0xdf, 0xad, + 0xec, 0x51, 0x47, 0x7e, 0x3d, 0xc9, 0x7f, 0x37, 0x99, 0xfd, 0x45, 0xf5, 0x50, 0x7c, 0x11, 0xf2, + 0x41, 0x0f, 0x33, 0xff, 0x73, 0x2f, 0x2d, 0xa6, 0xe7, 0xf6, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, + 0x08, 0xe1, 0xbb, 0x1f, 0x2f, 0x0e, 0x00, 0x00, } func (m *WeightedVoteOption) Marshal() (dAtA []byte, err error) { @@ -1134,6 +1162,13 @@ func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.FailedReason) > 0 { + i -= len(m.FailedReason) + copy(dAtA[i:], m.FailedReason) + i = encodeVarintGov(dAtA, i, uint64(len(m.FailedReason))) + i-- + dAtA[i] = 0x7a + } if m.Expedited { i-- if m.Expedited { @@ -1516,6 +1551,15 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.MinDepositRatio) > 0 { + i -= len(m.MinDepositRatio) + copy(dAtA[i:], m.MinDepositRatio) + i = encodeVarintGov(dAtA, i, uint64(len(m.MinDepositRatio))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } if m.BurnVoteVeto { i-- if m.BurnVoteVeto { @@ -1768,6 +1812,10 @@ func (m *Proposal) Size() (n int) { if m.Expedited { n += 2 } + l = len(m.FailedReason) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } return n } @@ -1942,6 +1990,10 @@ func (m *Params) Size() (n int) { if m.BurnVoteVeto { n += 2 } + l = len(m.MinDepositRatio) + if l > 0 { + n += 2 + l + sovGov(uint64(l)) + } return n } @@ -2650,6 +2702,38 @@ func (m *Proposal) Unmarshal(dAtA []byte) error { } } m.Expedited = bool(v != 0) + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FailedReason", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FailedReason = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGov(dAtA[iNdEx:]) @@ -3857,6 +3941,38 @@ func (m *Params) Unmarshal(dAtA []byte) error { } } m.BurnVoteVeto = bool(v != 0) + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinDepositRatio", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MinDepositRatio = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGov(dAtA[iNdEx:]) diff --git a/x/gov/types/v1/msgs.go b/x/gov/types/v1/msgs.go index 552fe559f560..facfbfa9c2a2 100644 --- a/x/gov/types/v1/msgs.go +++ b/x/gov/types/v1/msgs.go @@ -55,12 +55,6 @@ func (m *MsgSubmitProposal) SetMsgs(msgs []sdk.Msg) error { return nil } -// GetSigners returns the expected signers for a MsgSubmitProposal. -func (m MsgSubmitProposal) GetSigners() []sdk.AccAddress { - proposer, _ := sdk.AccAddressFromBech32(m.Proposer) - return []sdk.AccAddress{proposer} -} - // UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces func (m MsgSubmitProposal) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { return sdktx.UnpackInterfaces(unpacker, m.Messages) @@ -71,34 +65,16 @@ func NewMsgDeposit(depositor sdk.AccAddress, proposalID uint64, amount sdk.Coins return &MsgDeposit{proposalID, depositor.String(), amount} } -// GetSigners returns the expected signers for a MsgDeposit. -func (msg MsgDeposit) GetSigners() []sdk.AccAddress { - depositor, _ := sdk.AccAddressFromBech32(msg.Depositor) - return []sdk.AccAddress{depositor} -} - // NewMsgVote creates a message to cast a vote on an active proposal func NewMsgVote(voter sdk.AccAddress, proposalID uint64, option VoteOption, metadata string) *MsgVote { return &MsgVote{proposalID, voter.String(), option, metadata} } -// GetSigners returns the expected signers for a MsgVote. -func (msg MsgVote) GetSigners() []sdk.AccAddress { - voter, _ := sdk.AccAddressFromBech32(msg.Voter) - return []sdk.AccAddress{voter} -} - // NewMsgVoteWeighted creates a message to cast a vote on an active proposal func NewMsgVoteWeighted(voter sdk.AccAddress, proposalID uint64, options WeightedVoteOptions, metadata string) *MsgVoteWeighted { return &MsgVoteWeighted{proposalID, voter.String(), options, metadata} } -// GetSigners returns the expected signers for a MsgVoteWeighted. -func (msg MsgVoteWeighted) GetSigners() []sdk.AccAddress { - voter, _ := sdk.AccAddressFromBech32(msg.Voter) - return []sdk.AccAddress{voter} -} - // NewMsgExecLegacyContent creates a new MsgExecLegacyContent instance. func NewMsgExecLegacyContent(content *codectypes.Any, authority string) *MsgExecLegacyContent { return &MsgExecLegacyContent{ @@ -107,12 +83,6 @@ func NewMsgExecLegacyContent(content *codectypes.Any, authority string) *MsgExec } } -// GetSigners returns the expected signers for a MsgExecLegacyContent. -func (c MsgExecLegacyContent) GetSigners() []sdk.AccAddress { - authority, _ := sdk.AccAddressFromBech32(c.Authority) - return []sdk.AccAddress{authority} -} - // ValidateBasic implements the sdk.Msg interface. func (c MsgExecLegacyContent) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(c.Authority) @@ -129,12 +99,6 @@ func (c MsgExecLegacyContent) UnpackInterfaces(unpacker codectypes.AnyUnpacker) return unpacker.UnpackAny(c.Content, &content) } -// GetSigners returns the expected signers for a MsgUpdateParams. -func (msg MsgUpdateParams) GetSigners() []sdk.AccAddress { - authority, _ := sdk.AccAddressFromBech32(msg.Authority) - return []sdk.AccAddress{authority} -} - // NewMsgCancelProposal creates a new MsgCancelProposal instance. func NewMsgCancelProposal(proposalID uint64, proposer string) *MsgCancelProposal { return &MsgCancelProposal{ @@ -142,9 +106,3 @@ func NewMsgCancelProposal(proposalID uint64, proposer string) *MsgCancelProposal Proposer: proposer, } } - -// GetSigners implements Msg -func (msg MsgCancelProposal) GetSigners() []sdk.AccAddress { - proposer, _ := sdk.AccAddressFromBech32(msg.Proposer) - return []sdk.AccAddress{proposer} -} diff --git a/x/gov/types/v1/params.go b/x/gov/types/v1/params.go index 5633ebb4c59c..cf31daccef6a 100644 --- a/x/gov/types/v1/params.go +++ b/x/gov/types/v1/params.go @@ -30,6 +30,7 @@ var ( DefaultBurnProposalPrevote = false // set to false to replicate behavior of when this change was made (0.47) DefaultBurnVoteQuorom = false // set to false to replicate behavior of when this change was made (0.47) DefaultBurnVoteVeto = true // set to true to replicate behavior of when this change was made (0.47) + DefaultMinDepositRatio = sdkmath.LegacyMustNewDecFromStr("0.01") ) // Deprecated: NewDepositParams creates a new DepositParams object @@ -59,7 +60,8 @@ func NewVotingParams(votingPeriod *time.Duration) VotingParams { // NewParams creates a new Params instance with given values. func NewParams( minDeposit, expeditedminDeposit sdk.Coins, maxDepositPeriod, votingPeriod, expeditedVotingPeriod time.Duration, - quorum, threshold, expeditedThreshold, vetoThreshold, minInitialDepositRatio, proposalCancelRatio, proposalCancelDest string, burnProposalDeposit, burnVoteQuorum, burnVoteVeto bool, + quorum, threshold, expeditedThreshold, vetoThreshold, minInitialDepositRatio, proposalCancelRatio, proposalCancelDest string, + burnProposalDeposit, burnVoteQuorum, burnVoteVeto bool, minDepositRatio string, ) Params { return Params{ MinDeposit: minDeposit, @@ -77,6 +79,7 @@ func NewParams( BurnProposalDepositPrevote: burnProposalDeposit, BurnVoteQuorum: burnVoteQuorum, BurnVoteVeto: burnVoteVeto, + MinDepositRatio: minDepositRatio, } } @@ -98,6 +101,7 @@ func DefaultParams() Params { DefaultBurnProposalPrevote, DefaultBurnVoteQuorom, DefaultBurnVoteVeto, + DefaultMinDepositRatio.String(), ) } @@ -148,11 +152,11 @@ func (p Params) ValidateBasic() error { if err != nil { return fmt.Errorf("invalid expedited threshold string: %w", err) } - if !threshold.IsPositive() { - return fmt.Errorf("expedited vote threshold must be positive: %s", threshold) + if !expeditedThreshold.IsPositive() { + return fmt.Errorf("expedited vote threshold must be positive: %s", expeditedThreshold) } - if threshold.GT(sdkmath.LegacyOneDec()) { - return fmt.Errorf("expedited vote threshold too large: %s", threshold) + if expeditedThreshold.GT(sdkmath.LegacyOneDec()) { + return fmt.Errorf("expedited vote threshold too large: %s", expeditedThreshold) } if expeditedThreshold.LTE(threshold) { return fmt.Errorf("expedited vote threshold %s, must be greater than the regular threshold %s", expeditedThreshold, threshold) diff --git a/x/gov/types/v1/params_legacy.go b/x/gov/types/v1/params_legacy.go index 7fbea6917a1e..ceee66b23529 100644 --- a/x/gov/types/v1/params_legacy.go +++ b/x/gov/types/v1/params_legacy.go @@ -5,6 +5,7 @@ import ( "fmt" "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) diff --git a/x/gov/types/v1/proposals_test.go b/x/gov/types/v1/proposals_test.go index 3336415d7403..87545e1d0461 100644 --- a/x/gov/types/v1/proposals_test.go +++ b/x/gov/types/v1/proposals_test.go @@ -5,9 +5,10 @@ import ( "testing" "time" - "cosmossdk.io/math" "github.com/stretchr/testify/require" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" diff --git a/x/gov/types/v1/query.pb.go b/x/gov/types/v1/query.pb.go index 099611e21d89..77bfd5cbbd30 100644 --- a/x/gov/types/v1/query.pb.go +++ b/x/gov/types/v1/query.pb.go @@ -1090,7 +1090,7 @@ type QueryClient interface { Votes(ctx context.Context, in *QueryVotesRequest, opts ...grpc.CallOption) (*QueryVotesResponse, error) // Params queries all parameters of the gov module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // Deposit queries single deposit information based proposalID, depositAddr. + // Deposit queries single deposit information based on proposalID, depositAddr. Deposit(ctx context.Context, in *QueryDepositRequest, opts ...grpc.CallOption) (*QueryDepositResponse, error) // Deposits queries all deposits of a single proposal. Deposits(ctx context.Context, in *QueryDepositsRequest, opts ...grpc.CallOption) (*QueryDepositsResponse, error) @@ -1201,7 +1201,7 @@ type QueryServer interface { Votes(context.Context, *QueryVotesRequest) (*QueryVotesResponse, error) // Params queries all parameters of the gov module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // Deposit queries single deposit information based proposalID, depositAddr. + // Deposit queries single deposit information based on proposalID, depositAddr. Deposit(context.Context, *QueryDepositRequest) (*QueryDepositResponse, error) // Deposits queries all deposits of a single proposal. Deposits(context.Context, *QueryDepositsRequest) (*QueryDepositsResponse, error) @@ -1407,6 +1407,7 @@ func _Query_TallyResult_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.gov.v1.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/gov/types/v1/tally.go b/x/gov/types/v1/tally.go index e82000cf51a4..08c1fa283f3e 100644 --- a/x/gov/types/v1/tally.go +++ b/x/gov/types/v1/tally.go @@ -2,6 +2,7 @@ package v1 import ( "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -16,7 +17,7 @@ type ValidatorGovInfo struct { // NewValidatorGovInfo creates a ValidatorGovInfo instance func NewValidatorGovInfo(address sdk.ValAddress, bondedTokens math.Int, delegatorShares, - delegatorDeductions sdk.Dec, options WeightedVoteOptions, + delegatorDeductions math.LegacyDec, options WeightedVoteOptions, ) ValidatorGovInfo { return ValidatorGovInfo{ Address: address, @@ -38,7 +39,7 @@ func NewTallyResult(yes, abstain, no, noWithVeto math.Int) TallyResult { } // NewTallyResultFromMap creates a new TallyResult instance from a Option -> Dec map -func NewTallyResultFromMap(results map[VoteOption]sdk.Dec) TallyResult { +func NewTallyResultFromMap(results map[VoteOption]math.LegacyDec) TallyResult { return NewTallyResult( results[OptionYes].TruncateInt(), results[OptionAbstain].TruncateInt(), diff --git a/x/gov/types/v1/tx.pb.go b/x/gov/types/v1/tx.pb.go index 5a57a0f2af4a..36a57aaa8f1e 100644 --- a/x/gov/types/v1/tx.pb.go +++ b/x/gov/types/v1/tx.pb.go @@ -57,7 +57,7 @@ type MsgSubmitProposal struct { // // Since: cosmos-sdk 0.47 Summary string `protobuf:"bytes,6,opt,name=summary,proto3" json:"summary,omitempty"` - // expedided defines if the proposal is expedited or not + // expedited defines if the proposal is expedited or not // // Since: cosmos-sdk 0.50 Expedited bool `protobuf:"varint,7,opt,name=expedited,proto3" json:"expedited,omitempty"` @@ -708,8 +708,10 @@ var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo // // Since: cosmos-sdk 0.50 type MsgCancelProposal struct { + // proposal_id defines the unique id of the proposal. ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id"` - Proposer string `protobuf:"bytes,2,opt,name=proposer,proto3" json:"proposer,omitempty"` + // proposer is the account address of the proposer. + Proposer string `protobuf:"bytes,2,opt,name=proposer,proto3" json:"proposer,omitempty"` } func (m *MsgCancelProposal) Reset() { *m = MsgCancelProposal{} } @@ -764,6 +766,7 @@ func (m *MsgCancelProposal) GetProposer() string { // // Since: cosmos-sdk 0.50 type MsgCancelProposalResponse struct { + // proposal_id defines the unique id of the proposal. ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id"` // canceled_time is the time when proposal is canceled. CanceledTime time.Time `protobuf:"bytes,2,opt,name=canceled_time,json=canceledTime,proto3,stdtime" json:"canceled_time"` @@ -1201,6 +1204,7 @@ func _Msg_CancelProposal_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.gov.v1.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/gov/types/v1/vote.go b/x/gov/types/v1/vote.go index 60a6b2756cc9..edadc770756b 100644 --- a/x/gov/types/v1/vote.go +++ b/x/gov/types/v1/vote.go @@ -58,7 +58,7 @@ func (v Votes) String() string { return out } -func NewWeightedVoteOption(option VoteOption, weight sdk.Dec) *WeightedVoteOption { +func NewWeightedVoteOption(option VoteOption, weight math.LegacyDec) *WeightedVoteOption { return &WeightedVoteOption{Option: option, Weight: weight.String()} } @@ -83,7 +83,7 @@ func NewNonSplitVoteOption(option VoteOption) WeightedVoteOptions { // ValidWeightedVoteOption returns true if the sub vote is valid and false otherwise. func ValidWeightedVoteOption(option WeightedVoteOption) bool { - weight, err := sdk.NewDecFromStr(option.Weight) + weight, err := math.LegacyNewDecFromStr(option.Weight) if err != nil || !weight.IsPositive() || weight.GT(math.LegacyNewDec(1)) { return false } diff --git a/x/gov/types/v1beta1/genesis.pb.go b/x/gov/types/v1beta1/genesis.pb.go index d40095e9828a..2e765d2fb3cf 100644 --- a/x/gov/types/v1beta1/genesis.pb.go +++ b/x/gov/types/v1beta1/genesis.pb.go @@ -34,11 +34,11 @@ type GenesisState struct { Votes Votes `protobuf:"bytes,3,rep,name=votes,proto3,castrepeated=Votes" json:"votes"` // proposals defines all the proposals present at genesis. Proposals Proposals `protobuf:"bytes,4,rep,name=proposals,proto3,castrepeated=Proposals" json:"proposals"` - // params defines all the parameters of related to deposit. + // deposit_params defines all the parameters related to deposit. DepositParams DepositParams `protobuf:"bytes,5,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params"` - // params defines all the parameters of related to voting. + // voting_params defines all the parameters related to voting. VotingParams VotingParams `protobuf:"bytes,6,opt,name=voting_params,json=votingParams,proto3" json:"voting_params"` - // params defines all the parameters of related to tally. + // tally_params defines all the parameters related to tally. TallyParams TallyParams `protobuf:"bytes,7,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params"` } diff --git a/x/gov/types/v1beta1/gov.pb.go b/x/gov/types/v1beta1/gov.pb.go index 1acd514b717a..53ac20a6c1f4 100644 --- a/x/gov/types/v1beta1/gov.pb.go +++ b/x/gov/types/v1beta1/gov.pb.go @@ -4,6 +4,7 @@ package v1beta1 import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-proto" types1 "github.com/cosmos/cosmos-sdk/codec/types" @@ -129,7 +130,7 @@ type WeightedVoteOption struct { // option defines the valid vote options, it must not contain duplicate vote options. Option VoteOption `protobuf:"varint,1,opt,name=option,proto3,enum=cosmos.gov.v1beta1.VoteOption" json:"option,omitempty"` // weight is the vote weight associated with the vote option. - Weight github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=weight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"weight"` + Weight cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=weight,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"weight"` } func (m *WeightedVoteOption) Reset() { *m = WeightedVoteOption{} } @@ -311,13 +312,13 @@ var xxx_messageInfo_Proposal proto.InternalMessageInfo // TallyResult defines a standard tally for a governance proposal. type TallyResult struct { // yes is the number of yes votes on a proposal. - Yes github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=yes,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"yes"` + Yes cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=yes,proto3,customtype=cosmossdk.io/math.Int" json:"yes"` // abstain is the number of abstain votes on a proposal. - Abstain github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=abstain,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"abstain"` + Abstain cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=abstain,proto3,customtype=cosmossdk.io/math.Int" json:"abstain"` // no is the number of no votes on a proposal. - No github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=no,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"no"` + No cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=no,proto3,customtype=cosmossdk.io/math.Int" json:"no"` // no_with_veto is the number of no with veto votes on a proposal. - NoWithVeto github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=no_with_veto,json=noWithVeto,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"no_with_veto"` + NoWithVeto cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=no_with_veto,json=noWithVeto,proto3,customtype=cosmossdk.io/math.Int" json:"no_with_veto"` } func (m *TallyResult) Reset() { *m = TallyResult{} } @@ -488,12 +489,12 @@ var xxx_messageInfo_VotingParams proto.InternalMessageInfo type TallyParams struct { // Minimum percentage of total stake needed to vote for a result to be // considered valid. - Quorum github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=quorum,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"quorum,omitempty"` + Quorum cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=quorum,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"quorum,omitempty"` // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. - Threshold github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=threshold,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"threshold,omitempty"` + Threshold cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=threshold,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"threshold,omitempty"` // Minimum value of Veto votes to Total votes ratio for proposal to be // vetoed. Default value: 1/3. - VetoThreshold github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=veto_threshold,json=vetoThreshold,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"veto_threshold,omitempty"` + VetoThreshold cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=veto_threshold,json=vetoThreshold,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"veto_threshold,omitempty"` } func (m *TallyParams) Reset() { *m = TallyParams{} } @@ -546,95 +547,96 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1beta1/gov.proto", fileDescriptor_6e82113c1a9a4b7c) } var fileDescriptor_6e82113c1a9a4b7c = []byte{ - // 1396 bytes of a gzipped FileDescriptorProto + // 1413 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0xcf, 0x6f, 0x13, 0xc7, - 0x17, 0xf7, 0xda, 0xce, 0xaf, 0xb1, 0x13, 0x96, 0x21, 0x5f, 0xe2, 0xec, 0x97, 0x7a, 0x57, 0xae, - 0x84, 0xa2, 0x88, 0x38, 0x10, 0x54, 0xa4, 0xa6, 0x55, 0x25, 0x2f, 0x5e, 0x5a, 0x53, 0x64, 0xbb, - 0xeb, 0xc5, 0x14, 0x0e, 0x5d, 0xad, 0xbd, 0x83, 0xbd, 0xad, 0x77, 0xc7, 0x78, 0xc7, 0x21, 0xf9, - 0x03, 0x5a, 0x21, 0x9f, 0x38, 0xf6, 0x62, 0x09, 0xb5, 0x87, 0x56, 0x3d, 0x71, 0xe0, 0x1f, 0xe8, - 0x0d, 0x55, 0x3d, 0x20, 0x0e, 0x55, 0xdb, 0x43, 0x68, 0x41, 0x2a, 0x94, 0x3f, 0xa1, 0xa7, 0x6a, - 0x67, 0x66, 0xe3, 0x8d, 0x13, 0x11, 0x2c, 0xd4, 0x4b, 0xb2, 0x9e, 0xf7, 0x79, 0x9f, 0xcf, 0x7b, - 0xcf, 0xef, 0xbd, 0x1d, 0x83, 0x53, 0x4d, 0xec, 0xbb, 0xd8, 0x5f, 0x6f, 0xe1, 0xad, 0xf5, 0xad, - 0x73, 0x0d, 0x44, 0xac, 0x73, 0xc1, 0x73, 0xbe, 0xdb, 0xc3, 0x04, 0x43, 0xc8, 0xac, 0xf9, 0xe0, - 0x84, 0x5b, 0xa5, 0x2c, 0xf7, 0x68, 0x58, 0x3e, 0xda, 0x73, 0x69, 0x62, 0xc7, 0x63, 0x3e, 0xd2, - 0x62, 0x0b, 0xb7, 0x30, 0x7d, 0x5c, 0x0f, 0x9e, 0xf8, 0xa9, 0xdc, 0xc2, 0xb8, 0xd5, 0x41, 0xeb, - 0xf4, 0x53, 0xa3, 0x7f, 0x73, 0x9d, 0x38, 0x2e, 0xf2, 0x89, 0xe5, 0x76, 0x39, 0x60, 0x79, 0x1c, - 0x60, 0x79, 0x3b, 0xdc, 0x94, 0x1d, 0x37, 0xd9, 0xfd, 0x9e, 0x45, 0x1c, 0x1c, 0x2a, 0x2e, 0xb3, - 0x88, 0x4c, 0x26, 0xca, 0x43, 0x66, 0xa6, 0xe3, 0x96, 0xeb, 0x78, 0x78, 0x9d, 0xfe, 0x65, 0x47, - 0xb9, 0xef, 0x04, 0x00, 0xaf, 0x21, 0xa7, 0xd5, 0x26, 0xc8, 0xae, 0x63, 0x82, 0x2a, 0xdd, 0x80, - 0x0a, 0x5e, 0x00, 0xd3, 0x98, 0x3e, 0x65, 0x04, 0x45, 0x58, 0x59, 0xd8, 0xc8, 0xe6, 0x0f, 0xe6, - 0x9e, 0x1f, 0xe1, 0x75, 0x8e, 0x86, 0xd7, 0xc1, 0xf4, 0x6d, 0xca, 0x96, 0x89, 0x2b, 0xc2, 0xca, - 0x9c, 0x5a, 0x78, 0xb8, 0x2b, 0xc7, 0x7e, 0xdf, 0x95, 0x4f, 0xb7, 0x1c, 0xd2, 0xee, 0x37, 0xf2, - 0x4d, 0xec, 0xf2, 0x90, 0xf8, 0xbf, 0x35, 0xdf, 0xfe, 0x62, 0x9d, 0xec, 0x74, 0x91, 0x9f, 0x2f, - 0xa2, 0xe6, 0xe3, 0x07, 0x6b, 0x80, 0x0b, 0x15, 0x51, 0xf3, 0xfb, 0xe7, 0xf7, 0x57, 0x05, 0x9d, - 0x13, 0xe6, 0xbe, 0x12, 0x40, 0xda, 0x40, 0xdb, 0xa4, 0xda, 0xc3, 0x5d, 0xec, 0x5b, 0x1d, 0xb8, - 0x08, 0xa6, 0x88, 0x43, 0x3a, 0x88, 0x86, 0x38, 0xa7, 0xb3, 0x0f, 0x50, 0x01, 0x29, 0x1b, 0xf9, - 0xcd, 0x9e, 0xc3, 0xc2, 0xa7, 0x61, 0xe8, 0xd1, 0xa3, 0xcd, 0x0f, 0x5e, 0xdc, 0x93, 0x85, 0x9f, - 0x1e, 0xac, 0x49, 0x87, 0xa4, 0x74, 0x11, 0x7b, 0x04, 0x79, 0x64, 0xf0, 0xfc, 0xfe, 0xea, 0x52, - 0x24, 0xc0, 0xa8, 0x6e, 0xee, 0x17, 0x01, 0xcc, 0x14, 0x51, 0x17, 0xfb, 0x0e, 0x81, 0x32, 0x48, - 0x75, 0xf9, 0xb9, 0xe9, 0xd8, 0x34, 0x92, 0xa4, 0x0e, 0xc2, 0xa3, 0x92, 0x0d, 0x2f, 0x80, 0x39, - 0x9b, 0x61, 0x71, 0x8f, 0xd7, 0x24, 0xf3, 0xf8, 0xc1, 0xda, 0x22, 0xd7, 0x2e, 0xd8, 0x76, 0x0f, - 0xf9, 0x7e, 0x8d, 0xf4, 0x1c, 0xaf, 0xa5, 0x8f, 0xa0, 0xb0, 0x0d, 0xa6, 0x2d, 0x17, 0xf7, 0x3d, - 0x92, 0x49, 0x28, 0x89, 0x95, 0xd4, 0xc6, 0x72, 0xf8, 0x05, 0x04, 0x8d, 0x16, 0x09, 0xd7, 0xf1, - 0xd4, 0x77, 0x82, 0x1a, 0xff, 0xf0, 0x44, 0x5e, 0x79, 0x8d, 0x1a, 0x07, 0x0e, 0x3e, 0xaf, 0x2b, - 0xe3, 0xdf, 0x9c, 0xbd, 0x73, 0x4f, 0x8e, 0xbd, 0xb8, 0x27, 0xc7, 0x72, 0xbf, 0x4d, 0x81, 0xd9, - 0xbd, 0xea, 0x1e, 0x99, 0x59, 0x19, 0xcc, 0x34, 0x59, 0xb5, 0x68, 0x5e, 0xa9, 0x8d, 0xc5, 0x3c, - 0xeb, 0xcc, 0x7c, 0xd8, 0x99, 0xf9, 0x82, 0xb7, 0xa3, 0x66, 0x5f, 0x5d, 0x69, 0x3d, 0x24, 0x81, - 0x9b, 0x60, 0xda, 0x27, 0x16, 0xe9, 0xfb, 0x99, 0x04, 0x6d, 0xb9, 0xdc, 0x61, 0x2d, 0x17, 0x86, - 0x57, 0xa3, 0x48, 0x9d, 0x7b, 0xc0, 0x4f, 0x01, 0xbc, 0xe9, 0x78, 0x56, 0xc7, 0x24, 0x56, 0xa7, - 0xb3, 0x63, 0xf6, 0x90, 0xdf, 0xef, 0x90, 0x4c, 0x92, 0x86, 0x25, 0x1f, 0xc6, 0x63, 0x04, 0x38, - 0x9d, 0xc2, 0xd4, 0xb9, 0xa0, 0x7e, 0xac, 0x26, 0x22, 0x65, 0x89, 0x18, 0xe1, 0x65, 0x90, 0xf2, - 0xfb, 0x0d, 0xd7, 0x21, 0x66, 0x30, 0xa2, 0x99, 0x29, 0x4a, 0x29, 0x1d, 0xc8, 0xd4, 0x08, 0xe7, - 0x57, 0x9d, 0x0f, 0xd8, 0xee, 0x3e, 0x91, 0x05, 0xc6, 0x08, 0x98, 0x77, 0x60, 0x87, 0x35, 0x20, - 0xf2, 0x2f, 0xd8, 0x44, 0x9e, 0xcd, 0x08, 0xa7, 0x27, 0x25, 0x5c, 0xe0, 0x14, 0x9a, 0x67, 0x53, - 0xd2, 0x3e, 0x98, 0x27, 0x98, 0x58, 0x1d, 0x93, 0x9f, 0x67, 0x66, 0xfe, 0xa3, 0x7e, 0x49, 0x53, - 0x99, 0xb0, 0xf1, 0xaf, 0x82, 0xe3, 0x5b, 0x98, 0x38, 0x5e, 0xcb, 0xf4, 0x89, 0xd5, 0xe3, 0xd5, - 0x99, 0x9d, 0x34, 0x99, 0x63, 0x8c, 0xa3, 0x16, 0x50, 0xd0, 0x6c, 0x3e, 0x01, 0xfc, 0x68, 0x54, - 0xa1, 0xb9, 0x49, 0x49, 0xe7, 0x19, 0x03, 0x2f, 0xd0, 0x66, 0x32, 0x18, 0xf7, 0xdc, 0xdf, 0x71, - 0x90, 0x8a, 0x7e, 0xaf, 0x65, 0x90, 0xd8, 0x41, 0x3e, 0x5b, 0x1d, 0xea, 0xfb, 0x13, 0x6c, 0xa9, - 0x92, 0x47, 0x22, 0x5b, 0xaa, 0xe4, 0x11, 0x3d, 0x20, 0x82, 0x75, 0x30, 0x63, 0x35, 0x7c, 0x62, - 0x39, 0x7c, 0xe5, 0xbc, 0x21, 0x67, 0x48, 0x06, 0xaf, 0x80, 0xb8, 0x87, 0xe9, 0x44, 0xbc, 0x29, - 0x65, 0xdc, 0xc3, 0xf0, 0x33, 0x90, 0xf6, 0xb0, 0x79, 0xdb, 0x21, 0x6d, 0x73, 0x0b, 0x11, 0x4c, - 0x27, 0xe4, 0x4d, 0x79, 0x81, 0x87, 0xaf, 0x39, 0xa4, 0x5d, 0x47, 0x04, 0xf3, 0x5a, 0xff, 0x23, - 0x80, 0x64, 0xf0, 0x6e, 0x80, 0xe7, 0x0f, 0xd9, 0x21, 0x2a, 0x7c, 0xb9, 0x2b, 0xc7, 0x1d, 0xfb, - 0x9b, 0xe7, 0xf7, 0x57, 0xe3, 0x8e, 0xcd, 0xa7, 0x24, 0xb2, 0x57, 0xf2, 0x60, 0x6a, 0x0b, 0x13, - 0x74, 0xf4, 0xb6, 0x64, 0xb0, 0x60, 0x6f, 0xf0, 0x57, 0x55, 0xe2, 0x75, 0x5e, 0x55, 0x6a, 0x3c, - 0x23, 0xec, 0xbd, 0xae, 0x3e, 0x06, 0x33, 0xec, 0xc9, 0xcf, 0x24, 0xe9, 0xd8, 0x9c, 0x3e, 0xcc, - 0xf9, 0xe0, 0xfb, 0x31, 0xba, 0x33, 0x42, 0x06, 0x9a, 0x7c, 0x2c, 0x37, 0x88, 0x83, 0x79, 0x3e, - 0x24, 0x55, 0xab, 0x67, 0xb9, 0x3e, 0xfc, 0x52, 0x00, 0x29, 0xd7, 0xf1, 0xf6, 0x06, 0x54, 0x38, - 0x6a, 0x40, 0x4b, 0x01, 0xf9, 0xcb, 0x5d, 0xf9, 0x7f, 0x11, 0xaf, 0x33, 0xd8, 0x75, 0x08, 0x72, - 0xbb, 0x64, 0x67, 0x92, 0xc9, 0xd5, 0x81, 0xeb, 0x78, 0xe1, 0xc8, 0xde, 0x02, 0xd0, 0xb5, 0xb6, - 0x43, 0x42, 0xb3, 0x8b, 0x7a, 0x0e, 0xb6, 0xf9, 0xee, 0x5e, 0x3e, 0x30, 0x5e, 0x45, 0x7e, 0xab, - 0x50, 0x57, 0x78, 0x34, 0xa7, 0x0e, 0x3a, 0x8f, 0x82, 0xfa, 0xfa, 0x89, 0x2c, 0xe8, 0xa2, 0x6b, - 0x6d, 0x87, 0xa9, 0x53, 0x7b, 0xce, 0x07, 0xe9, 0x3a, 0x1d, 0x46, 0x5e, 0x8a, 0x26, 0xe0, 0xc3, - 0x19, 0xaa, 0x0b, 0x47, 0xa9, 0xbf, 0xcd, 0xd5, 0x97, 0xf6, 0xf9, 0x8d, 0x09, 0xa7, 0x99, 0x91, - 0x8b, 0xfe, 0x18, 0x8e, 0x3a, 0x17, 0xbd, 0x01, 0xa6, 0x6f, 0xf5, 0x71, 0xaf, 0xef, 0x52, 0xb5, - 0xb4, 0xaa, 0x4e, 0x76, 0x27, 0x79, 0xb9, 0x2b, 0x8b, 0xcc, 0x7f, 0xa4, 0xaa, 0x73, 0x46, 0xd8, - 0x04, 0x73, 0xa4, 0xdd, 0x43, 0x7e, 0x1b, 0x77, 0x58, 0x29, 0xd3, 0xaa, 0x36, 0x31, 0xfd, 0x89, - 0x3d, 0x8a, 0x88, 0xc2, 0x88, 0x17, 0xde, 0x02, 0x0b, 0xc1, 0xb4, 0x9a, 0x23, 0xa5, 0x04, 0x55, - 0xba, 0x3c, 0xb1, 0x52, 0x66, 0x3f, 0x4f, 0x44, 0x6e, 0x3e, 0xb0, 0x18, 0xa1, 0x61, 0xf5, 0x2f, - 0x01, 0x80, 0xc8, 0x75, 0xf0, 0x0c, 0x58, 0xaa, 0x57, 0x0c, 0xcd, 0xac, 0x54, 0x8d, 0x52, 0xa5, - 0x6c, 0x5e, 0x2d, 0xd7, 0xaa, 0xda, 0xc5, 0xd2, 0xa5, 0x92, 0x56, 0x14, 0x63, 0xd2, 0xb1, 0xc1, - 0x50, 0x49, 0x31, 0xa0, 0x16, 0x70, 0xc1, 0x1c, 0x38, 0x16, 0x45, 0x5f, 0xd7, 0x6a, 0xa2, 0x20, - 0xcd, 0x0f, 0x86, 0xca, 0x1c, 0x43, 0x5d, 0x47, 0x3e, 0x5c, 0x05, 0x27, 0xa2, 0x98, 0x82, 0x5a, - 0x33, 0x0a, 0xa5, 0xb2, 0x18, 0x97, 0x8e, 0x0f, 0x86, 0xca, 0x3c, 0xc3, 0x15, 0xf8, 0x0e, 0x54, - 0xc0, 0x42, 0x14, 0x5b, 0xae, 0x88, 0x09, 0x29, 0x3d, 0x18, 0x2a, 0xb3, 0x0c, 0x56, 0xc6, 0x70, - 0x03, 0x64, 0xf6, 0x23, 0xcc, 0x6b, 0x25, 0xe3, 0x23, 0xb3, 0xae, 0x19, 0x15, 0x31, 0x29, 0x2d, - 0x0e, 0x86, 0x8a, 0x18, 0x62, 0xc3, 0x5d, 0x25, 0x25, 0xef, 0x7c, 0x9b, 0x8d, 0xad, 0xfe, 0x1c, - 0x07, 0x0b, 0xfb, 0x2f, 0x15, 0x30, 0x0f, 0xfe, 0x5f, 0xd5, 0x2b, 0xd5, 0x4a, 0xad, 0x70, 0xc5, - 0xac, 0x19, 0x05, 0xe3, 0x6a, 0x6d, 0x2c, 0x61, 0x9a, 0x0a, 0x03, 0x97, 0x9d, 0x0e, 0x7c, 0x0f, - 0x64, 0xc7, 0xf1, 0x45, 0xad, 0x5a, 0xa9, 0x95, 0x0c, 0xb3, 0xaa, 0xe9, 0xa5, 0x4a, 0x51, 0x14, - 0xa4, 0xa5, 0xc1, 0x50, 0x39, 0xc1, 0x5c, 0xf6, 0x4d, 0x08, 0x7c, 0x17, 0xbc, 0x35, 0xee, 0x5c, - 0xaf, 0x18, 0xa5, 0xf2, 0x87, 0xa1, 0x6f, 0x5c, 0x3a, 0x39, 0x18, 0x2a, 0x90, 0xf9, 0xd6, 0x23, - 0x7d, 0x0e, 0xcf, 0x80, 0x93, 0xe3, 0xae, 0xd5, 0x42, 0xad, 0xa6, 0x15, 0xc5, 0x84, 0x24, 0x0e, - 0x86, 0x4a, 0x9a, 0xf9, 0x54, 0x2d, 0xdf, 0x47, 0x36, 0x3c, 0x0b, 0x32, 0xe3, 0x68, 0x5d, 0xbb, - 0xac, 0x5d, 0x34, 0xb4, 0xa2, 0x98, 0x94, 0xe0, 0x60, 0xa8, 0x2c, 0xf0, 0x4b, 0x15, 0xfa, 0x1c, - 0x35, 0x09, 0x3a, 0x94, 0xff, 0x52, 0xa1, 0x74, 0x45, 0x2b, 0x8a, 0x53, 0x51, 0xfe, 0x4b, 0x96, - 0xd3, 0x41, 0x36, 0x2b, 0xa7, 0x5a, 0x7e, 0xf8, 0x67, 0x36, 0xf6, 0xf0, 0x69, 0x56, 0x78, 0xf4, - 0x34, 0x2b, 0xfc, 0xf1, 0x34, 0x2b, 0xdc, 0x7d, 0x96, 0x8d, 0x3d, 0x7a, 0x96, 0x8d, 0xfd, 0xfa, - 0x2c, 0x1b, 0xbb, 0x71, 0xf6, 0x95, 0x8d, 0xba, 0x4d, 0x7f, 0x76, 0xd1, 0x76, 0x0d, 0x7f, 0x49, - 0x35, 0xa6, 0xe9, 0x46, 0x38, 0xff, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x78, 0xb6, 0x8e, 0xf7, - 0x99, 0x0d, 0x00, 0x00, + 0x17, 0xf7, 0xda, 0xce, 0xaf, 0xb1, 0x13, 0x96, 0x21, 0x10, 0x67, 0xe1, 0xeb, 0x5d, 0xf9, 0x2b, + 0x55, 0x51, 0x4a, 0x6c, 0x08, 0x2a, 0x52, 0x83, 0x5a, 0xc9, 0xc6, 0x4b, 0x31, 0x05, 0xdb, 0x5d, + 0x2f, 0xa1, 0x54, 0xaa, 0x56, 0x1b, 0xef, 0x60, 0x6f, 0xf1, 0xee, 0x18, 0xef, 0x38, 0xc4, 0x7f, + 0x40, 0x2b, 0xe4, 0x13, 0xc7, 0x1e, 0x6a, 0x09, 0xb5, 0xaa, 0x54, 0xf5, 0xc4, 0x81, 0x3f, 0x02, + 0xa1, 0x1e, 0x10, 0x87, 0xaa, 0xed, 0x21, 0xb4, 0x20, 0x15, 0xc4, 0x9f, 0xd0, 0x53, 0xb5, 0x33, + 0xb3, 0xf1, 0xc6, 0x09, 0x24, 0x3e, 0xf4, 0x12, 0x6d, 0x66, 0x3e, 0x3f, 0xe6, 0xbd, 0x7d, 0xef, + 0xed, 0x18, 0x9c, 0xaa, 0x63, 0xcf, 0xc1, 0x5e, 0xae, 0x81, 0x37, 0x73, 0x9b, 0x67, 0x37, 0x10, + 0x31, 0xcf, 0xfa, 0xcf, 0xd9, 0x76, 0x07, 0x13, 0x0c, 0x21, 0xdb, 0xcd, 0xfa, 0x2b, 0x7c, 0x57, + 0x4a, 0x73, 0xc6, 0x86, 0xe9, 0xa1, 0x1d, 0x4a, 0x1d, 0xdb, 0x2e, 0xe3, 0x48, 0xf3, 0x0d, 0xdc, + 0xc0, 0xf4, 0x31, 0xe7, 0x3f, 0xf1, 0x55, 0xb9, 0x81, 0x71, 0xa3, 0x85, 0x72, 0xf4, 0xbf, 0x8d, + 0xee, 0xad, 0x1c, 0xb1, 0x1d, 0xe4, 0x11, 0xd3, 0x69, 0x73, 0xc0, 0xe2, 0x28, 0xc0, 0x74, 0x7b, + 0x7c, 0x2b, 0x3d, 0xba, 0x65, 0x75, 0x3b, 0x26, 0xb1, 0x71, 0xe0, 0xb8, 0xc8, 0x4e, 0x64, 0x30, + 0x53, 0x7e, 0x64, 0xb6, 0x75, 0xd4, 0x74, 0x6c, 0x17, 0xe7, 0xe8, 0x5f, 0xb6, 0x94, 0xf9, 0x4e, + 0x00, 0xf0, 0x06, 0xb2, 0x1b, 0x4d, 0x82, 0xac, 0x75, 0x4c, 0x50, 0xa5, 0xed, 0x4b, 0xc1, 0xf3, + 0x60, 0x12, 0xd3, 0xa7, 0x94, 0xa0, 0x08, 0x4b, 0x73, 0xab, 0xe9, 0xec, 0xde, 0xd8, 0xb3, 0x43, + 0xbc, 0xc6, 0xd1, 0xb0, 0x0c, 0x26, 0xef, 0x52, 0xb5, 0x54, 0x54, 0x11, 0x96, 0x66, 0x0a, 0xe7, + 0x1f, 0x6f, 0xcb, 0x91, 0x3f, 0xb6, 0xe5, 0x93, 0x8c, 0xee, 0x59, 0xb7, 0xb3, 0x36, 0xce, 0x39, + 0x26, 0x69, 0x66, 0xaf, 0xa2, 0x86, 0x59, 0xef, 0x15, 0x51, 0xfd, 0xd9, 0xa3, 0x15, 0xc0, 0xd5, + 0x8b, 0xa8, 0xfe, 0xd3, 0xab, 0x87, 0xcb, 0x82, 0xc6, 0x55, 0x32, 0xdf, 0x08, 0x20, 0xa9, 0xa3, + 0x2d, 0x52, 0xed, 0xe0, 0x36, 0xf6, 0xcc, 0x16, 0x9c, 0x07, 0x13, 0xc4, 0x26, 0x2d, 0x44, 0xcf, + 0x35, 0xa3, 0xb1, 0x7f, 0xa0, 0x02, 0x12, 0x16, 0xf2, 0xea, 0x1d, 0x9b, 0x9d, 0x99, 0x7a, 0x6b, + 0xe1, 0xa5, 0xb5, 0x8f, 0x5f, 0x3f, 0x90, 0x85, 0x27, 0x8f, 0x56, 0xa4, 0x7d, 0xe2, 0xb8, 0x88, + 0x5d, 0x82, 0x5c, 0xd2, 0x7f, 0xf5, 0x70, 0x79, 0x81, 0x6d, 0xaf, 0x78, 0xd6, 0xed, 0x5c, 0xd8, + 0x37, 0xf3, 0xab, 0x00, 0xa6, 0x8a, 0xa8, 0x8d, 0x3d, 0x9b, 0x40, 0x19, 0x24, 0xda, 0x7c, 0xdd, + 0xb0, 0x2d, 0x7a, 0x92, 0xb8, 0x06, 0x82, 0xa5, 0x92, 0x05, 0xcf, 0x83, 0x19, 0x8b, 0x61, 0x71, + 0x87, 0x27, 0x22, 0xf5, 0xec, 0xd1, 0xca, 0x3c, 0xf7, 0xce, 0x5b, 0x56, 0x07, 0x79, 0x5e, 0x8d, + 0x74, 0x6c, 0xb7, 0xa1, 0x0d, 0xa1, 0xb0, 0x09, 0x26, 0x4d, 0x07, 0x77, 0x5d, 0x92, 0x8a, 0x29, + 0xb1, 0xa5, 0xc4, 0xea, 0x62, 0x90, 0x75, 0xbf, 0xba, 0x42, 0xc7, 0xb5, 0xdd, 0xc2, 0x07, 0x7e, + 0x62, 0x7f, 0x7e, 0x2e, 0x2f, 0x35, 0x6c, 0xd2, 0xec, 0x6e, 0x64, 0xeb, 0xd8, 0xe1, 0xef, 0x3a, + 0x17, 0x0a, 0x81, 0xf4, 0xda, 0xc8, 0xa3, 0x04, 0x8f, 0xe7, 0x95, 0xe9, 0xaf, 0x4d, 0xdf, 0x7b, + 0x20, 0x47, 0x5e, 0x3f, 0x90, 0x23, 0x99, 0xdf, 0x27, 0xc0, 0xf4, 0x4e, 0x76, 0x0f, 0x8c, 0xac, + 0x0c, 0xa6, 0xea, 0x2c, 0x5b, 0x34, 0xae, 0xc4, 0xea, 0x7c, 0x96, 0x95, 0x63, 0x36, 0x28, 0xc7, + 0x6c, 0xde, 0xed, 0x15, 0xd2, 0xef, 0xce, 0xb4, 0x16, 0x88, 0xc0, 0x35, 0x30, 0xe9, 0x11, 0x93, + 0x74, 0xbd, 0x54, 0x8c, 0xd6, 0x59, 0x66, 0xbf, 0x3a, 0x0b, 0x8e, 0x57, 0xa3, 0x48, 0x8d, 0x33, + 0xe0, 0xe7, 0x00, 0xde, 0xb2, 0x5d, 0xb3, 0x65, 0x10, 0xb3, 0xd5, 0xea, 0x19, 0x1d, 0xe4, 0x75, + 0x5b, 0x24, 0x15, 0xa7, 0xc7, 0x92, 0xf7, 0xd3, 0xd1, 0x7d, 0x9c, 0x46, 0x61, 0x85, 0x19, 0x3f, + 0x7f, 0x2c, 0x27, 0x22, 0x55, 0x09, 0x6d, 0xc2, 0x2b, 0x20, 0xe1, 0x75, 0x37, 0x1c, 0x9b, 0x18, + 0x7e, 0x5f, 0xa6, 0x26, 0xa8, 0xa4, 0xb4, 0x27, 0x52, 0x3d, 0x68, 0xda, 0xc2, 0xac, 0xaf, 0x76, + 0xff, 0xb9, 0x2c, 0x30, 0x45, 0xc0, 0xd8, 0xfe, 0x3e, 0xac, 0x01, 0x91, 0xbf, 0x60, 0x03, 0xb9, + 0x16, 0x13, 0x9c, 0x1c, 0x57, 0x70, 0x8e, 0x4b, 0xa8, 0xae, 0x45, 0x45, 0xbb, 0x60, 0x96, 0x60, + 0x62, 0xb6, 0x0c, 0xbe, 0x9e, 0x9a, 0xfa, 0x8f, 0xea, 0x25, 0x49, 0x6d, 0x82, 0xc2, 0xbf, 0x0e, + 0x8e, 0x6e, 0x62, 0x62, 0xbb, 0x0d, 0xc3, 0x23, 0x66, 0x87, 0x67, 0x67, 0x7a, 0xdc, 0x60, 0x8e, + 0x30, 0x8d, 0x9a, 0x2f, 0x41, 0xa3, 0xf9, 0x0c, 0xf0, 0xa5, 0x61, 0x86, 0x66, 0xc6, 0x15, 0x9d, + 0x65, 0x0a, 0x3c, 0x41, 0x6b, 0x71, 0xbf, 0xdd, 0x33, 0x3f, 0x46, 0x41, 0x22, 0xfc, 0x5e, 0x3f, + 0x02, 0xb1, 0x1e, 0xf2, 0xd8, 0xe8, 0x28, 0xbc, 0xcf, 0x47, 0xd3, 0xf1, 0xbd, 0xa3, 0xa9, 0xe4, + 0x92, 0xd0, 0x50, 0x2a, 0xb9, 0x44, 0xf3, 0x79, 0x50, 0x05, 0x53, 0xe6, 0x86, 0x47, 0x4c, 0x9b, + 0x4f, 0x98, 0xf1, 0x24, 0x02, 0x2e, 0xbc, 0x00, 0xa2, 0x2e, 0xa6, 0xf5, 0x3e, 0xa6, 0x42, 0xd4, + 0xc5, 0xf0, 0x1a, 0x48, 0xba, 0xd8, 0xb8, 0x6b, 0x93, 0xa6, 0xb1, 0x89, 0x08, 0xa6, 0xe5, 0x3e, + 0xa6, 0x0c, 0x70, 0xf1, 0x0d, 0x9b, 0x34, 0xd7, 0x11, 0xc1, 0x3c, 0x4f, 0xff, 0x08, 0x20, 0xee, + 0x0f, 0x73, 0x78, 0x6e, 0x9f, 0xfe, 0x2f, 0xc0, 0x37, 0xdb, 0x72, 0xd4, 0xb6, 0xbe, 0x7f, 0xf5, + 0x70, 0x39, 0x6a, 0x5b, 0xbc, 0xc2, 0x43, 0x33, 0x21, 0x0b, 0x26, 0x36, 0x31, 0x41, 0x07, 0x4f, + 0x3a, 0x06, 0xf3, 0x7b, 0x9e, 0x7f, 0x5b, 0x62, 0x87, 0xf9, 0xb6, 0x14, 0xa2, 0x29, 0x61, 0xe7, + 0xfb, 0xf2, 0x29, 0x98, 0x62, 0x4f, 0x5e, 0x2a, 0x4e, 0x4b, 0xfe, 0xbd, 0xfd, 0xc8, 0x7b, 0x3f, + 0x68, 0xe1, 0x7e, 0x0f, 0x14, 0x68, 0xf0, 0x91, 0x4c, 0x3f, 0x0a, 0x66, 0x79, 0x81, 0x57, 0xcd, + 0x8e, 0xe9, 0x78, 0xf0, 0x6b, 0x01, 0x24, 0x1c, 0xdb, 0xdd, 0x69, 0x2e, 0xe1, 0xa0, 0xe6, 0x2a, + 0xf9, 0xe2, 0x6f, 0xb6, 0xe5, 0xe3, 0x21, 0xd6, 0x69, 0xec, 0xd8, 0x04, 0x39, 0x6d, 0xd2, 0x1b, + 0xa7, 0xeb, 0x34, 0xe0, 0xd8, 0x6e, 0xd0, 0x6e, 0x77, 0x00, 0x74, 0xcc, 0xad, 0x40, 0xd0, 0x68, + 0xa3, 0x8e, 0x8d, 0x2d, 0x3e, 0x77, 0x17, 0xf7, 0xb4, 0x46, 0x91, 0x5f, 0x03, 0x0a, 0x4b, 0xfc, + 0x34, 0xa7, 0xf6, 0x92, 0x87, 0x87, 0xfa, 0xf6, 0xb9, 0x2c, 0x68, 0xa2, 0x63, 0x6e, 0x05, 0xa1, + 0xd3, 0xfd, 0x8c, 0x07, 0x92, 0xeb, 0xb4, 0x91, 0x78, 0x2a, 0xea, 0x80, 0x37, 0x56, 0xe0, 0x2e, + 0x1c, 0xe4, 0xfe, 0x7f, 0xee, 0xbe, 0xb0, 0x8b, 0x37, 0x62, 0x9c, 0x64, 0x9b, 0xdc, 0xf4, 0x49, + 0xd0, 0xa6, 0xdc, 0xf4, 0x4b, 0x30, 0x79, 0xa7, 0x8b, 0x3b, 0x5d, 0x87, 0xba, 0x25, 0x0b, 0xea, + 0x21, 0x2e, 0x11, 0x6f, 0xb6, 0x65, 0x91, 0x91, 0x86, 0x56, 0xbb, 0x2f, 0x16, 0x1a, 0x17, 0x85, + 0xb7, 0xc0, 0x0c, 0x69, 0x76, 0x90, 0xd7, 0xc4, 0x2d, 0x96, 0xcd, 0x64, 0xe1, 0xf2, 0xe1, 0x1c, + 0x8e, 0xed, 0xf0, 0xde, 0x6a, 0x32, 0x94, 0x86, 0x04, 0xcc, 0xf9, 0x2d, 0x6a, 0x0c, 0xcd, 0x62, + 0xd4, 0xec, 0xda, 0xe1, 0xcc, 0x52, 0xbb, 0xc9, 0x6f, 0x75, 0x9c, 0xf5, 0x71, 0x7a, 0x00, 0x5b, + 0xfe, 0x5b, 0x00, 0x20, 0x74, 0x91, 0x3b, 0x0d, 0x16, 0xd6, 0x2b, 0xba, 0x6a, 0x54, 0xaa, 0x7a, + 0xa9, 0x52, 0x36, 0xae, 0x97, 0x6b, 0x55, 0xf5, 0x62, 0xe9, 0x52, 0x49, 0x2d, 0x8a, 0x11, 0xe9, + 0x48, 0x7f, 0xa0, 0x24, 0x18, 0x50, 0xf5, 0x95, 0x61, 0x06, 0x1c, 0x09, 0xa3, 0x6f, 0xaa, 0x35, + 0x51, 0x90, 0x66, 0xfb, 0x03, 0x65, 0x86, 0xa1, 0x6e, 0x22, 0x0f, 0x2e, 0x83, 0x63, 0x61, 0x4c, + 0xbe, 0x50, 0xd3, 0xf3, 0xa5, 0xb2, 0x18, 0x95, 0x8e, 0xf6, 0x07, 0xca, 0x2c, 0xc3, 0xe5, 0xf9, + 0xa8, 0x53, 0xc0, 0x5c, 0x18, 0x5b, 0xae, 0x88, 0x31, 0x29, 0xd9, 0x1f, 0x28, 0xd3, 0x0c, 0x56, + 0xc6, 0x70, 0x15, 0xa4, 0x76, 0x23, 0x8c, 0x1b, 0x25, 0xfd, 0xb2, 0xb1, 0xae, 0xea, 0x15, 0x31, + 0x2e, 0xcd, 0xf7, 0x07, 0x8a, 0x18, 0x60, 0x83, 0xa1, 0x25, 0xc5, 0xef, 0xfd, 0x90, 0x8e, 0x2c, + 0xff, 0x12, 0x05, 0x73, 0xbb, 0x6f, 0x06, 0x30, 0x0b, 0x4e, 0x56, 0xb5, 0x4a, 0xb5, 0x52, 0xcb, + 0x5f, 0x35, 0x6a, 0x7a, 0x5e, 0xbf, 0x5e, 0x1b, 0x09, 0x98, 0x86, 0xc2, 0xc0, 0x65, 0xbb, 0x05, + 0x2f, 0x80, 0xf4, 0x28, 0xbe, 0xa8, 0x56, 0x2b, 0xb5, 0x92, 0x6e, 0x54, 0x55, 0xad, 0x54, 0x29, + 0x8a, 0x82, 0xb4, 0xd0, 0x1f, 0x28, 0xc7, 0x18, 0x65, 0x57, 0xab, 0xc0, 0x0f, 0xc1, 0xff, 0x46, + 0xc9, 0xeb, 0x15, 0xbd, 0x54, 0xfe, 0x24, 0xe0, 0x46, 0xa5, 0x13, 0xfd, 0x81, 0x02, 0x19, 0x77, + 0x3d, 0x54, 0xf0, 0xf0, 0x34, 0x38, 0x31, 0x4a, 0xad, 0xe6, 0x6b, 0x35, 0xb5, 0x28, 0xc6, 0x24, + 0xb1, 0x3f, 0x50, 0x92, 0x8c, 0x53, 0x35, 0x3d, 0x0f, 0x59, 0xf0, 0x0c, 0x48, 0x8d, 0xa2, 0x35, + 0xf5, 0x8a, 0x7a, 0x51, 0x57, 0x8b, 0x62, 0x5c, 0x82, 0xfd, 0x81, 0x32, 0xc7, 0x6f, 0x46, 0xe8, + 0x2b, 0x54, 0x27, 0x68, 0x5f, 0xfd, 0x4b, 0xf9, 0xd2, 0x55, 0xb5, 0x28, 0x4e, 0x84, 0xf5, 0x2f, + 0x99, 0x76, 0x0b, 0x59, 0x2c, 0x9d, 0x85, 0xf2, 0xe3, 0xbf, 0xd2, 0x91, 0xc7, 0x2f, 0xd2, 0xc2, + 0xd3, 0x17, 0x69, 0xe1, 0xcf, 0x17, 0x69, 0xe1, 0xfe, 0xcb, 0x74, 0xe4, 0xe9, 0xcb, 0x74, 0xe4, + 0xb7, 0x97, 0xe9, 0xc8, 0x17, 0x67, 0xde, 0x39, 0xc0, 0xb6, 0xe8, 0x0f, 0x26, 0x3a, 0xc6, 0x82, + 0xdf, 0x40, 0x1b, 0x93, 0x74, 0x34, 0x9c, 0xfb, 0x37, 0x00, 0x00, 0xff, 0xff, 0x15, 0xc3, 0xb3, + 0x11, 0x53, 0x0d, 0x00, 0x00, } func (this *TextProposal) Equal(that interface{}) bool { diff --git a/x/gov/types/v1beta1/msgs.go b/x/gov/types/v1beta1/msgs.go index 182e877846be..1f8a62019f05 100644 --- a/x/gov/types/v1beta1/msgs.go +++ b/x/gov/types/v1beta1/msgs.go @@ -39,12 +39,6 @@ func NewMsgSubmitProposal(content Content, initialDeposit sdk.Coins, proposer sd // GetInitialDeposit returns the initial deposit of MsgSubmitProposal. func (m *MsgSubmitProposal) GetInitialDeposit() sdk.Coins { return m.InitialDeposit } -// GetProposer returns the proposer address of MsgSubmitProposal. -func (m *MsgSubmitProposal) GetProposer() sdk.AccAddress { - proposer, _ := sdk.AccAddressFromBech32(m.Proposer) - return proposer -} - // GetContent returns the content of MsgSubmitProposal. func (m *MsgSubmitProposal) GetContent() Content { content, ok := m.Content.GetCachedValue().(Content) @@ -78,12 +72,6 @@ func (m *MsgSubmitProposal) SetContent(content Content) error { return nil } -// GetSigners returns the expected signers for a MsgSubmitProposal. -func (m MsgSubmitProposal) GetSigners() []sdk.AccAddress { - proposer, _ := sdk.AccAddressFromBech32(m.Proposer) - return []sdk.AccAddress{proposer} -} - // UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces func (m MsgSubmitProposal) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { var content Content @@ -95,30 +83,12 @@ func NewMsgDeposit(depositor sdk.AccAddress, proposalID uint64, amount sdk.Coins return &MsgDeposit{proposalID, depositor.String(), amount} } -// GetSigners returns the expected signers for a MsgDeposit. -func (msg MsgDeposit) GetSigners() []sdk.AccAddress { - depositor, _ := sdk.AccAddressFromBech32(msg.Depositor) - return []sdk.AccAddress{depositor} -} - // NewMsgVote creates a message to cast a vote on an active proposal func NewMsgVote(voter sdk.AccAddress, proposalID uint64, option VoteOption) *MsgVote { return &MsgVote{proposalID, voter.String(), option} } -// GetSigners returns the expected signers for a MsgVote. -func (msg MsgVote) GetSigners() []sdk.AccAddress { - voter, _ := sdk.AccAddressFromBech32(msg.Voter) - return []sdk.AccAddress{voter} -} - // NewMsgVoteWeighted creates a message to cast a vote on an active proposal. func NewMsgVoteWeighted(voter sdk.AccAddress, proposalID uint64, options WeightedVoteOptions) *MsgVoteWeighted { return &MsgVoteWeighted{proposalID, voter.String(), options} } - -// GetSigners returns the expected signers for a MsgVoteWeighted. -func (msg MsgVoteWeighted) GetSigners() []sdk.AccAddress { - voter, _ := sdk.AccAddressFromBech32(msg.Voter) - return []sdk.AccAddress{voter} -} diff --git a/x/gov/types/v1beta1/params.go b/x/gov/types/v1beta1/params.go index 11033a012237..5ade9788fece 100644 --- a/x/gov/types/v1beta1/params.go +++ b/x/gov/types/v1beta1/params.go @@ -3,7 +3,7 @@ package v1beta1 import ( "time" - sdkmath "cosmossdk.io/math" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -15,10 +15,10 @@ const ( // Default governance params var ( - DefaultMinDepositTokens = sdkmath.NewInt(10000000) - DefaultQuorum = sdkmath.LegacyNewDecWithPrec(334, 3) - DefaultThreshold = sdkmath.LegacyNewDecWithPrec(5, 1) - DefaultVetoThreshold = sdkmath.LegacyNewDecWithPrec(334, 3) + DefaultMinDepositTokens = math.NewInt(10000000) + DefaultQuorum = math.LegacyNewDecWithPrec(334, 3) + DefaultThreshold = math.LegacyNewDecWithPrec(5, 1) + DefaultVetoThreshold = math.LegacyNewDecWithPrec(334, 3) ) // NewDepositParams creates a new DepositParams object @@ -43,7 +43,7 @@ func (dp DepositParams) Equal(dp2 DepositParams) bool { } // NewTallyParams creates a new TallyParams object -func NewTallyParams(quorum, threshold, vetoThreshold sdk.Dec) TallyParams { +func NewTallyParams(quorum, threshold, vetoThreshold math.LegacyDec) TallyParams { return TallyParams{ Quorum: quorum, Threshold: threshold, diff --git a/x/gov/types/v1beta1/proposals_test.go b/x/gov/types/v1beta1/proposals_test.go index 6f3bee6092f6..77eb4076389b 100644 --- a/x/gov/types/v1beta1/proposals_test.go +++ b/x/gov/types/v1beta1/proposals_test.go @@ -4,8 +4,9 @@ import ( "fmt" "testing" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/stretchr/testify/require" + + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) func TestProposalStatus_Format(t *testing.T) { diff --git a/x/gov/types/v1beta1/query.pb.go b/x/gov/types/v1beta1/query.pb.go index 39597345ced4..eec6c4ec0952 100644 --- a/x/gov/types/v1beta1/query.pb.go +++ b/x/gov/types/v1beta1/query.pb.go @@ -932,7 +932,7 @@ type QueryClient interface { Votes(ctx context.Context, in *QueryVotesRequest, opts ...grpc.CallOption) (*QueryVotesResponse, error) // Params queries all parameters of the gov module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // Deposit queries single deposit information based proposalID, depositAddr. + // Deposit queries single deposit information based on proposalID, depositor address. Deposit(ctx context.Context, in *QueryDepositRequest, opts ...grpc.CallOption) (*QueryDepositResponse, error) // Deposits queries all deposits of a single proposal. Deposits(ctx context.Context, in *QueryDepositsRequest, opts ...grpc.CallOption) (*QueryDepositsResponse, error) @@ -1032,7 +1032,7 @@ type QueryServer interface { Votes(context.Context, *QueryVotesRequest) (*QueryVotesResponse, error) // Params queries all parameters of the gov module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // Deposit queries single deposit information based proposalID, depositAddr. + // Deposit queries single deposit information based on proposalID, depositor address. Deposit(context.Context, *QueryDepositRequest) (*QueryDepositResponse, error) // Deposits queries all deposits of a single proposal. Deposits(context.Context, *QueryDepositsRequest) (*QueryDepositsResponse, error) @@ -1217,6 +1217,7 @@ func _Query_TallyResult_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.gov.v1beta1.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/gov/types/v1beta1/tally.go b/x/gov/types/v1beta1/tally.go index 231700f4fb84..b4db63037360 100644 --- a/x/gov/types/v1beta1/tally.go +++ b/x/gov/types/v1beta1/tally.go @@ -17,7 +17,7 @@ type ValidatorGovInfo struct { // NewValidatorGovInfo creates a ValidatorGovInfo instance func NewValidatorGovInfo(address sdk.ValAddress, bondedTokens math.Int, delegatorShares, - delegatorDeductions sdk.Dec, options WeightedVoteOptions, + delegatorDeductions math.LegacyDec, options WeightedVoteOptions, ) ValidatorGovInfo { return ValidatorGovInfo{ Address: address, @@ -39,7 +39,7 @@ func NewTallyResult(yes, abstain, no, noWithVeto math.Int) TallyResult { } // NewTallyResultFromMap creates a new TallyResult instance from a Option -> Dec map -func NewTallyResultFromMap(results map[VoteOption]sdk.Dec) TallyResult { +func NewTallyResultFromMap(results map[VoteOption]math.LegacyDec) TallyResult { return NewTallyResult( results[OptionYes].TruncateInt(), results[OptionAbstain].TruncateInt(), diff --git a/x/gov/types/v1beta1/tx.pb.go b/x/gov/types/v1beta1/tx.pb.go index 80d6fe1f1f4e..f919a1193c13 100644 --- a/x/gov/types/v1beta1/tx.pb.go +++ b/x/gov/types/v1beta1/tx.pb.go @@ -607,6 +607,7 @@ func _Msg_Deposit_Handler(srv interface{}, ctx context.Context, dec func(interfa return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.gov.v1beta1.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/group/README.md b/x/group/README.md index 29e5478b5fb2..8327e7ef61db 100644 --- a/x/group/README.md +++ b/x/group/README.md @@ -101,7 +101,7 @@ custom decision policies, as long as they adhere to the `DecisionPolicy` interface: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/group/types.go#L27-L45 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/x/group/types.go#L27-L45 ``` #### Threshold decision policy @@ -337,7 +337,7 @@ The metadata has a maximum length that is chosen by the app developer, and passed into the group keeper as a config. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/group/v1/tx.proto#L67-L80 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/group/v1/tx.proto#L67-L80 ``` It's expected to fail if @@ -350,7 +350,7 @@ It's expected to fail if Group members can be updated with the `UpdateGroupMembers`. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/group/v1/tx.proto#L88-L102 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/group/v1/tx.proto#L88-L102 ``` In the list of `MemberUpdates`, an existing member can be removed by setting its weight to 0. @@ -365,7 +365,7 @@ It's expected to fail if: The `UpdateGroupAdmin` can be used to update a group admin. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/group/v1/tx.proto#L107-L120 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/group/v1/tx.proto#L107-L120 ``` It's expected to fail if the signer is not the admin of the group. @@ -375,7 +375,7 @@ It's expected to fail if the signer is not the admin of the group. The `UpdateGroupMetadata` can be used to update a group metadata. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/group/v1/tx.proto#L125-L138 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/group/v1/tx.proto#L125-L138 ``` It's expected to fail if: @@ -388,7 +388,7 @@ It's expected to fail if: A new group policy can be created with the `MsgCreateGroupPolicy`, which has an admin address, a group id, a decision policy and some optional metadata. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/group/v1/tx.proto#L147-L165 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/group/v1/tx.proto#L147-L165 ``` It's expected to fail if: @@ -402,7 +402,7 @@ It's expected to fail if: A new group with policy can be created with the `MsgCreateGroupWithPolicy`, which has an admin address, a list of members, a decision policy, a `group_policy_as_admin` field to optionally set group and group policy admin with group policy address and some optional metadata for group and group policy. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/group/v1/tx.proto#L191-L215 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/group/v1/tx.proto#L191-L215 ``` It's expected to fail for the same reasons as `Msg/CreateGroup` and `Msg/CreateGroupPolicy`. @@ -412,7 +412,7 @@ It's expected to fail for the same reasons as `Msg/CreateGroup` and `Msg/CreateG The `UpdateGroupPolicyAdmin` can be used to update a group policy admin. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/group/v1/tx.proto#L173-L186 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/group/v1/tx.proto#L173-L186 ``` It's expected to fail if the signer is not the admin of the group policy. @@ -422,7 +422,7 @@ It's expected to fail if the signer is not the admin of the group policy. The `UpdateGroupPolicyDecisionPolicy` can be used to update a decision policy. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/group/v1/tx.proto#L226-L241 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/group/v1/tx.proto#L226-L241 ``` It's expected to fail if: @@ -435,7 +435,7 @@ It's expected to fail if: The `UpdateGroupPolicyMetadata` can be used to update a group policy metadata. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/group/v1/tx.proto#L246-L259 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/group/v1/tx.proto#L246-L259 ``` It's expected to fail if: @@ -449,7 +449,7 @@ A new proposal can be created with the `MsgSubmitProposal`, which has a group po An optional `Exec` value can be provided to try to execute the proposal immediately after proposal creation. Proposers signatures are considered as yes votes in this case. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/group/v1/tx.proto#L281-L315 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/group/v1/tx.proto#L281-L315 ``` It's expected to fail if: @@ -462,7 +462,7 @@ It's expected to fail if: A proposal can be withdrawn using `MsgWithdrawProposal` which has an `address` (can be either a proposer or the group policy admin) and a `proposal_id` (which has to be withdrawn). ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/group/v1/tx.proto#L323-L333 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/group/v1/tx.proto#L323-L333 ``` It's expected to fail if: @@ -476,7 +476,7 @@ A new vote can be created with the `MsgVote`, given a proposal id, a voter addre An optional `Exec` value can be provided to try to execute the proposal immediately after voting. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/group/v1/tx.proto#L338-L358 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/group/v1/tx.proto#L338-L358 ``` It's expected to fail if: @@ -489,7 +489,7 @@ It's expected to fail if: A proposal can be executed with the `MsgExec`. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/group/v1/tx.proto#L363-L373 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/group/v1/tx.proto#L363-L373 ``` The messages that are part of this proposal won't be executed if: @@ -502,7 +502,7 @@ The messages that are part of this proposal won't be executed if: The `MsgLeaveGroup` allows group member to leave a group. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/group/v1/tx.proto#L381-L391 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/group/v1/tx.proto#L381-L391 ``` It's expected to fail if: @@ -1128,18 +1128,18 @@ Example: simd tx group update-group-policy-decision-policy cosmos1.. cosmos1.. '{"@type":"/cosmos.group.v1.ThresholdDecisionPolicy", "threshold":"2", "windows": {"voting_period": "120h", "min_execution_period": "0s"}}' ``` -#### create-proposal +#### submit-proposal -The `create-proposal` command allows users to submit a new proposal. +The `submit-proposal` command allows users to submit a new proposal. ```bash -simd tx group create-proposal [group-policy-account] [proposer[,proposer]*] [msg_tx_json_file] [metadata] [flags] +simd tx group submit-proposal [group-policy-account] [proposer[,proposer]*] [msg_tx_json_file] [metadata] [flags] ``` Example: ```bash -simd tx group create-proposal cosmos1.. cosmos1.. msg_tx.json "AQ==" +simd tx group submit-proposal cosmos1.. cosmos1.. msg_tx.json "AQ==" ``` #### withdraw-proposal @@ -2109,7 +2109,7 @@ Example Output: ## Metadata -The group module has four locations for metadata where users can provide further context about the on-chain actions they are taking. By default all metadata fields have a 255 character length field where metadata can be stored in json format, either on-chain or off-chain depending on the amount of data required. Here we provide a recommendation for the json structure and where the data should be stored. There are two important factors in making these recommendations. First, that the group and gov modules are consistent with one another, note the number of proposals made by all groups may be quite large. Second, that client applications such as block explorers and governance interfaces have confidence in the consistency of metadata structure accross chains. +The group module has four locations for metadata where users can provide further context about the on-chain actions they are taking. By default all metadata fields have a 255 character length field where metadata can be stored in json format, either on-chain or off-chain depending on the amount of data required. Here we provide a recommendation for the json structure and where the data should be stored. There are two important factors in making these recommendations. First, that the group and gov modules are consistent with one another, note the number of proposals made by all groups may be quite large. Second, that client applications such as block explorers and governance interfaces have confidence in the consistency of metadata structure across chains. ### Proposal diff --git a/x/group/client/cli/prompt.go b/x/group/client/cli/prompt.go index 7b4a2fc4507c..79b347f525a3 100644 --- a/x/group/client/cli/prompt.go +++ b/x/group/client/cli/prompt.go @@ -30,9 +30,9 @@ type proposalType struct { } // Prompt the proposal type values and return the proposal and its metadata. -func (p *proposalType) Prompt(cdc codec.Codec) (*Proposal, govtypes.ProposalMetadata, error) { +func (p *proposalType) Prompt(cdc codec.Codec, skipMetadata bool) (*Proposal, govtypes.ProposalMetadata, error) { // set metadata - metadata, err := govcli.Prompt(govtypes.ProposalMetadata{}, "proposal") + metadata, err := govcli.PromptMetadata(skipMetadata) if err != nil { return nil, metadata, fmt.Errorf("failed to set proposal metadata: %w", err) } @@ -86,6 +86,8 @@ func (p *proposalType) Prompt(cdc codec.Codec) (*Proposal, govtypes.ProposalMeta // NewCmdDraftProposal let a user generate a draft proposal. func NewCmdDraftProposal() *cobra.Command { + flagSkipMetadata := "skip-metadata" + cmd := &cobra.Command{ Use: "draft-proposal", Short: "Generate a draft proposal json file. The generated proposal json contains only one message (skeleton).", @@ -137,7 +139,9 @@ func NewCmdDraftProposal() *cobra.Command { panic("unexpected proposal type") } - result, metadata, err := proposal.Prompt(clientCtx.Codec) + skipMetadataPrompt, _ := cmd.Flags().GetBool(flagSkipMetadata) + + result, metadata, err := proposal.Prompt(clientCtx.Codec, skipMetadataPrompt) if err != nil { return err } @@ -146,17 +150,20 @@ func NewCmdDraftProposal() *cobra.Command { return err } - if err := writeFile(draftMetadataFileName, metadata); err != nil { - return err + if !skipMetadataPrompt { + if err := writeFile(draftMetadataFileName, metadata); err != nil { + return err + } } - fmt.Printf("The draft proposal has successfully been generated.\nProposals should contain off-chain metadata, please upload the metadata JSON to IPFS.\nThen, replace the generated metadata field with the IPFS CID.\n") + cmd.Println("The draft proposal has successfully been generated.\nProposals should contain off-chain metadata, please upload the metadata JSON to IPFS.\nThen, replace the generated metadata field with the IPFS CID.") return nil }, } flags.AddTxFlagsToCmd(cmd) + cmd.Flags().Bool(flagSkipMetadata, false, "skip metadata prompt") return cmd } diff --git a/x/group/client/cli/query.go b/x/group/client/cli/query.go deleted file mode 100644 index 88d2582473ef..000000000000 --- a/x/group/client/cli/query.go +++ /dev/null @@ -1,556 +0,0 @@ -package cli - -import ( - "strconv" - - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/x/group" -) - -// QueryCmd returns the cli query commands for the group module. -func QueryCmd(name string) *cobra.Command { - queryCmd := &cobra.Command{ - Use: name, - Short: "Querying commands for the group module", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - queryCmd.AddCommand( - QueryGroupInfoCmd(), - QueryGroupPolicyInfoCmd(), - QueryGroupMembersCmd(), - QueryGroupsByAdminCmd(), - QueryGroupPoliciesByGroupCmd(), - QueryGroupPoliciesByAdminCmd(), - QueryProposalCmd(), - QueryProposalsByGroupPolicyCmd(), - QueryVoteByProposalVoterCmd(), - QueryVotesByProposalCmd(), - QueryVotesByVoterCmd(), - QueryGroupsByMemberCmd(), - QueryTallyResultCmd(), - QueryGroupsCmd(), - ) - - return queryCmd -} - -// QueryGroupsByMemberCmd creates a CLI command for Query/GroupsByMember. -func QueryGroupsByMemberCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "groups-by-member [address]", - Short: "Query for groups by member address with pagination flags", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - queryClient := group.NewQueryClient(clientCtx) - res, err := queryClient.GroupsByMember(cmd.Context(), &group.QueryGroupsByMemberRequest{ - Address: args[0], - Pagination: pageReq, - }) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "groups-by-members") - return cmd -} - -// QueryGroupInfoCmd creates a CLI command for Query/GroupInfo. -func QueryGroupInfoCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "group-info [id]", - Short: "Query for group info by group id", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - groupID, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return err - } - - queryClient := group.NewQueryClient(clientCtx) - - res, err := queryClient.GroupInfo(cmd.Context(), &group.QueryGroupInfoRequest{ - GroupId: groupID, - }) - if err != nil { - return err - } - - return clientCtx.PrintProto(res.Info) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// QueryGroupPolicyInfoCmd creates a CLI command for Query/GroupPolicyInfo. -func QueryGroupPolicyInfoCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "group-policy-info [group-policy-account]", - Short: "Query for group policy info by account address of group policy", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - queryClient := group.NewQueryClient(clientCtx) - - res, err := queryClient.GroupPolicyInfo(cmd.Context(), &group.QueryGroupPolicyInfoRequest{ - Address: args[0], - }) - if err != nil { - return err - } - - return clientCtx.PrintProto(res.Info) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// QueryGroupMembersCmd creates a CLI command for Query/GroupMembers. -func QueryGroupMembersCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "group-members [id]", - Short: "Query for group members by group id with pagination flags", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - groupID, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return err - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - queryClient := group.NewQueryClient(clientCtx) - - res, err := queryClient.GroupMembers(cmd.Context(), &group.QueryGroupMembersRequest{ - GroupId: groupID, - Pagination: pageReq, - }) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "group-members") - - return cmd -} - -// QueryGroupsByAdminCmd creates a CLI command for Query/GroupsByAdmin. -func QueryGroupsByAdminCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "groups-by-admin [admin]", - Short: "Query for groups by admin account address with pagination flags", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - queryClient := group.NewQueryClient(clientCtx) - - res, err := queryClient.GroupsByAdmin(cmd.Context(), &group.QueryGroupsByAdminRequest{ - Admin: args[0], - Pagination: pageReq, - }) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "groups-by-admin") - - return cmd -} - -// QueryGroupPoliciesByGroupCmd creates a CLI command for Query/GroupPoliciesByGroup. -func QueryGroupPoliciesByGroupCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "group-policies-by-group [group-id]", - Short: "Query for group policies by group id with pagination flags", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - groupID, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return err - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - queryClient := group.NewQueryClient(clientCtx) - - res, err := queryClient.GroupPoliciesByGroup(cmd.Context(), &group.QueryGroupPoliciesByGroupRequest{ - GroupId: groupID, - Pagination: pageReq, - }) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "groups-policies-by-group") - - return cmd -} - -// QueryGroupPoliciesByAdminCmd creates a CLI command for Query/GroupPoliciesByAdmin. -func QueryGroupPoliciesByAdminCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "group-policies-by-admin [admin]", - Short: "Query for group policies by admin account address with pagination flags", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - queryClient := group.NewQueryClient(clientCtx) - - res, err := queryClient.GroupPoliciesByAdmin(cmd.Context(), &group.QueryGroupPoliciesByAdminRequest{ - Admin: args[0], - Pagination: pageReq, - }) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "group-policies-by-admin") - - return cmd -} - -// QueryProposalCmd creates a CLI command for Query/Proposal. -func QueryProposalCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "proposal [id]", - Short: "Query for proposal by id", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - proposalID, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return err - } - - queryClient := group.NewQueryClient(clientCtx) - - res, err := queryClient.Proposal(cmd.Context(), &group.QueryProposalRequest{ - ProposalId: proposalID, - }) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// QueryProposalsByGroupPolicyCmd creates a CLI command for Query/ProposalsByGroupPolicy. -func QueryProposalsByGroupPolicyCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "proposals-by-group-policy [group-policy-account]", - Short: "Query for proposals by account address of group policy with pagination flags", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - queryClient := group.NewQueryClient(clientCtx) - - res, err := queryClient.ProposalsByGroupPolicy(cmd.Context(), &group.QueryProposalsByGroupPolicyRequest{ - Address: args[0], - Pagination: pageReq, - }) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "proposals-by-group-policy") - - return cmd -} - -// QueryVoteByProposalVoterCmd creates a CLI command for Query/VoteByProposalVoter. -func QueryVoteByProposalVoterCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "vote [proposal-id] [voter]", - Short: "Query for vote by proposal id and voter account address", - Args: cobra.ExactArgs(2), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - proposalID, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return err - } - - queryClient := group.NewQueryClient(clientCtx) - - res, err := queryClient.VoteByProposalVoter(cmd.Context(), &group.QueryVoteByProposalVoterRequest{ - ProposalId: proposalID, - Voter: args[1], - }) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// QueryVotesByProposalCmd creates a CLI command for Query/VotesByProposal. -func QueryVotesByProposalCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "votes-by-proposal [proposal-id]", - Short: "Query for votes by proposal id with pagination flags", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - proposalID, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return err - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - queryClient := group.NewQueryClient(clientCtx) - - res, err := queryClient.VotesByProposal(cmd.Context(), &group.QueryVotesByProposalRequest{ - ProposalId: proposalID, - Pagination: pageReq, - }) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "votes-by-proposal") - - return cmd -} - -// QueryTallyResultCmd creates a CLI command for Query/TallyResult. -func QueryTallyResultCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "tally-result [proposal-id]", - Short: "Query tally result of proposal", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - proposalID, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return err - } - - queryClient := group.NewQueryClient(clientCtx) - - res, err := queryClient.TallyResult(cmd.Context(), &group.QueryTallyResultRequest{ - ProposalId: proposalID, - }) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// QueryVotesByVoterCmd creates a CLI command for Query/VotesByVoter. -func QueryVotesByVoterCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "votes-by-voter [voter]", - Short: "Query for votes by voter account address with pagination flags", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - queryClient := group.NewQueryClient(clientCtx) - - res, err := queryClient.VotesByVoter(cmd.Context(), &group.QueryVotesByVoterRequest{ - Voter: args[0], - Pagination: pageReq, - }) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "votes-by-voter") - - return cmd -} - -// QueryGroupsCmd creates a CLI command for Query/Groups. -func QueryGroupsCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "groups", - Short: "Query for groups present in the state", - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - queryClient := group.NewQueryClient(clientCtx) - - res, err := queryClient.Groups(cmd.Context(), &group.QueryGroupsRequest{ - Pagination: pageReq, - }) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "groups") - - return cmd -} diff --git a/x/group/client/cli/query_test.go b/x/group/client/cli/query_test.go deleted file mode 100644 index 5e9735ababcd..000000000000 --- a/x/group/client/cli/query_test.go +++ /dev/null @@ -1,513 +0,0 @@ -package cli_test - -import ( - "context" - "fmt" - "io" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" - "github.com/cosmos/cosmos-sdk/testutil" - "github.com/cosmos/cosmos-sdk/x/group/client/cli" -) - -func (s *CLITestSuite) TestQueryGroupInfo() { - testCases := []struct { - name string - args []string - expCmdOutput string - }{ - { - name: "invalid id", - args: []string{"invalid id"}, - expCmdOutput: `[invalid id]`, - }, - { - name: "json output", - args: []string{"1", fmt.Sprintf("--%s=json", flags.FlagOutput)}, - expCmdOutput: `[1 --output=json]`, - }, - { - name: "text output", - args: []string{"1", fmt.Sprintf("--%s=text", flags.FlagOutput)}, - expCmdOutput: `[1 --output=text]`, - }, - } - - for _, tc := range testCases { - s.Run(tc.name, func() { - cmd := cli.QueryGroupInfoCmd() - - ctx := svrcmd.CreateExecuteContext(context.Background()) - - cmd.SetOut(io.Discard) - s.Require().NotNil(cmd) - - cmd.SetContext(ctx) - cmd.SetArgs(tc.args) - s.Require().NoError(client.SetCmdClientContextHandler(s.baseCtx, cmd)) - - s.Require().Contains(fmt.Sprint(cmd), "group-info [id] [] [] Query for group info by group id") - s.Require().Contains(fmt.Sprint(cmd), tc.expCmdOutput) - }) - } -} - -func (s *CLITestSuite) TestQueryGroupPolicyInfo() { - accounts := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) - - testCases := []struct { - name string - args []string - expCmdOutput string - }{ - { - name: "json output", - args: []string{accounts[0].Address.String(), fmt.Sprintf("--%s=json", flags.FlagOutput)}, - expCmdOutput: fmt.Sprintf("%s --output=json", accounts[0].Address.String()), - }, - { - name: "text output", - args: []string{accounts[0].Address.String(), fmt.Sprintf("--%s=text", flags.FlagOutput)}, - expCmdOutput: fmt.Sprintf("%s --output=text", accounts[0].Address.String()), - }, - } - - for _, tc := range testCases { - s.Run(tc.name, func() { - cmd := cli.QueryGroupPolicyInfoCmd() - - ctx := svrcmd.CreateExecuteContext(context.Background()) - - cmd.SetOut(io.Discard) - s.Require().NotNil(cmd) - - cmd.SetContext(ctx) - cmd.SetArgs(tc.args) - s.Require().NoError(client.SetCmdClientContextHandler(s.baseCtx, cmd)) - - s.Require().Contains(fmt.Sprint(cmd), "group-policy-info [group-policy-account] [] [] Query for group policy info by account address of group policy") - s.Require().Contains(fmt.Sprint(cmd), tc.expCmdOutput) - }) - } -} - -func (s *CLITestSuite) TestQueryGroupMembers() { - testCases := []struct { - name string - args []string - expCmdOutput string - }{ - { - name: "json output", - args: []string{"1", fmt.Sprintf("--%s=json", flags.FlagOutput)}, - expCmdOutput: "1 --output=json", - }, - { - name: "text output", - args: []string{"1", fmt.Sprintf("--%s=text", flags.FlagOutput)}, - expCmdOutput: "1 --output=text", - }, - } - - for _, tc := range testCases { - s.Run(tc.name, func() { - cmd := cli.QueryGroupMembersCmd() - - ctx := svrcmd.CreateExecuteContext(context.Background()) - - cmd.SetOut(io.Discard) - s.Require().NotNil(cmd) - - cmd.SetContext(ctx) - cmd.SetArgs(tc.args) - s.Require().NoError(client.SetCmdClientContextHandler(s.baseCtx, cmd)) - - s.Require().Contains(fmt.Sprint(cmd), "group-members [id] [] [] Query for group members by group id with pagination flags") - s.Require().Contains(fmt.Sprint(cmd), tc.expCmdOutput) - }) - } -} - -func (s *CLITestSuite) TestQueryGroupsByAdmin() { - accounts := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) - - testCases := []struct { - name string - args []string - expCmdOutput string - }{ - { - name: "json output", - args: []string{accounts[0].Address.String(), fmt.Sprintf("--%s=json", flags.FlagOutput)}, - expCmdOutput: fmt.Sprintf("%s --output=json", accounts[0].Address.String()), - }, - { - name: "text output", - args: []string{accounts[0].Address.String(), fmt.Sprintf("--%s=text", flags.FlagOutput)}, - expCmdOutput: fmt.Sprintf("%s --output=text", accounts[0].Address.String()), - }, - } - - for _, tc := range testCases { - s.Run(tc.name, func() { - cmd := cli.QueryGroupsByAdminCmd() - - ctx := svrcmd.CreateExecuteContext(context.Background()) - - cmd.SetOut(io.Discard) - s.Require().NotNil(cmd) - - cmd.SetContext(ctx) - cmd.SetArgs(tc.args) - s.Require().NoError(client.SetCmdClientContextHandler(s.baseCtx, cmd)) - - s.Require().Contains(fmt.Sprint(cmd), "groups-by-admin [admin] [] [] Query for groups by admin account address with pagination flags") - s.Require().Contains(fmt.Sprint(cmd), tc.expCmdOutput) - }) - } -} - -func (s *CLITestSuite) TestQueryGroupPoliciesByGroup() { - testCases := []struct { - name string - args []string - expCmdOutput string - }{ - { - name: "json output", - args: []string{"1", fmt.Sprintf("--%s=json", flags.FlagOutput)}, - expCmdOutput: "1 --output=json", - }, - { - name: "text output", - args: []string{"1", fmt.Sprintf("--%s=text", flags.FlagOutput)}, - expCmdOutput: "1 --output=text", - }, - } - - for _, tc := range testCases { - s.Run(tc.name, func() { - cmd := cli.QueryGroupPoliciesByGroupCmd() - - ctx := svrcmd.CreateExecuteContext(context.Background()) - - cmd.SetOut(io.Discard) - s.Require().NotNil(cmd) - - cmd.SetContext(ctx) - cmd.SetArgs(tc.args) - s.Require().NoError(client.SetCmdClientContextHandler(s.baseCtx, cmd)) - - s.Require().Contains(fmt.Sprint(cmd), "group-policies-by-group [group-id] [] [] Query for group policies by group id with pagination flags") - s.Require().Contains(fmt.Sprint(cmd), tc.expCmdOutput) - }) - } -} - -func (s *CLITestSuite) TestQueryGroupPoliciesByAdmin() { - accounts := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) - - testCases := []struct { - name string - args []string - expCmdOutput string - }{ - { - name: "json output", - args: []string{accounts[0].Address.String(), fmt.Sprintf("--%s=json", flags.FlagOutput)}, - expCmdOutput: fmt.Sprintf("%s --output=json", accounts[0].Address.String()), - }, - { - name: "text output", - args: []string{accounts[0].Address.String(), fmt.Sprintf("--%s=text", flags.FlagOutput)}, - expCmdOutput: fmt.Sprintf("%s --output=text", accounts[0].Address.String()), - }, - } - - for _, tc := range testCases { - s.Run(tc.name, func() { - cmd := cli.QueryGroupPoliciesByAdminCmd() - - ctx := svrcmd.CreateExecuteContext(context.Background()) - - cmd.SetOut(io.Discard) - s.Require().NotNil(cmd) - - cmd.SetContext(ctx) - cmd.SetArgs(tc.args) - s.Require().NoError(client.SetCmdClientContextHandler(s.baseCtx, cmd)) - - s.Require().Contains(fmt.Sprint(cmd), "group-policies-by-admin [admin] [] [] Query for group policies by admin account address with pagination flags") - s.Require().Contains(fmt.Sprint(cmd), tc.expCmdOutput) - }) - } -} - -func (s *CLITestSuite) TestQueryProposal() { - testCases := []struct { - name string - args []string - expCmdOutput string - }{ - { - name: "json output", - args: []string{"1", fmt.Sprintf("--%s=json", flags.FlagOutput)}, - expCmdOutput: "1 --output=json", - }, - { - name: "text output", - args: []string{"1", fmt.Sprintf("--%s=text", flags.FlagOutput)}, - expCmdOutput: "1 --output=text", - }, - } - - for _, tc := range testCases { - s.Run(tc.name, func() { - cmd := cli.QueryProposalCmd() - - ctx := svrcmd.CreateExecuteContext(context.Background()) - - cmd.SetOut(io.Discard) - s.Require().NotNil(cmd) - - cmd.SetContext(ctx) - cmd.SetArgs(tc.args) - s.Require().NoError(client.SetCmdClientContextHandler(s.baseCtx, cmd)) - - s.Require().Contains(fmt.Sprint(cmd), "proposal [id] [] [] Query for proposal by id") - s.Require().Contains(fmt.Sprint(cmd), tc.expCmdOutput) - }) - } -} - -func (s *CLITestSuite) TestQueryProposalsByGroupPolicy() { - accounts := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) - - testCases := []struct { - name string - args []string - expCmdOutput string - }{ - { - name: "json output", - args: []string{accounts[0].Address.String(), fmt.Sprintf("--%s=json", flags.FlagOutput)}, - expCmdOutput: fmt.Sprintf("%s --output=json", accounts[0].Address.String()), - }, - { - name: "text output", - args: []string{accounts[0].Address.String(), fmt.Sprintf("--%s=text", flags.FlagOutput)}, - expCmdOutput: fmt.Sprintf("%s --output=text", accounts[0].Address.String()), - }, - } - - for _, tc := range testCases { - s.Run(tc.name, func() { - cmd := cli.QueryProposalsByGroupPolicyCmd() - - ctx := svrcmd.CreateExecuteContext(context.Background()) - - cmd.SetOut(io.Discard) - s.Require().NotNil(cmd) - - cmd.SetContext(ctx) - cmd.SetArgs(tc.args) - s.Require().NoError(client.SetCmdClientContextHandler(s.baseCtx, cmd)) - - s.Require().Contains(fmt.Sprint(cmd), "proposals-by-group-policy [group-policy-account] [] [] Query for proposals by account address of group policy with pagination flags") - s.Require().Contains(fmt.Sprint(cmd), tc.expCmdOutput) - }) - } -} - -func (s *CLITestSuite) TestQueryVoteByProposalVoter() { - accounts := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) - - testCases := []struct { - name string - args []string - expCmdOutput string - }{ - { - name: "json output", - args: []string{"1", accounts[0].Address.String(), fmt.Sprintf("--%s=json", flags.FlagOutput)}, - expCmdOutput: fmt.Sprintf("1 %s --output=json", accounts[0].Address.String()), - }, - { - name: "text output", - args: []string{"1", accounts[0].Address.String(), fmt.Sprintf("--%s=text", flags.FlagOutput)}, - expCmdOutput: fmt.Sprintf("1 %s --output=text", accounts[0].Address.String()), - }, - } - - for _, tc := range testCases { - s.Run(tc.name, func() { - cmd := cli.QueryVoteByProposalVoterCmd() - - ctx := svrcmd.CreateExecuteContext(context.Background()) - - cmd.SetOut(io.Discard) - s.Require().NotNil(cmd) - - cmd.SetContext(ctx) - cmd.SetArgs(tc.args) - s.Require().NoError(client.SetCmdClientContextHandler(s.baseCtx, cmd)) - - s.Require().Contains(fmt.Sprint(cmd), "vote [proposal-id] [voter] [] [] Query for vote by proposal id and voter account address") - s.Require().Contains(fmt.Sprint(cmd), tc.expCmdOutput) - }) - } -} - -func (s *CLITestSuite) TestQueryVotesByProposal() { - testCases := []struct { - name string - args []string - expCmdOutput string - }{ - { - name: "json output", - args: []string{"1", fmt.Sprintf("--%s=json", flags.FlagOutput)}, - expCmdOutput: "1 --output=json", - }, - { - name: "text output", - args: []string{"1", fmt.Sprintf("--%s=text", flags.FlagOutput)}, - expCmdOutput: "1 --output=text", - }, - } - - for _, tc := range testCases { - s.Run(tc.name, func() { - cmd := cli.QueryVotesByProposalCmd() - - ctx := svrcmd.CreateExecuteContext(context.Background()) - - cmd.SetOut(io.Discard) - s.Require().NotNil(cmd) - - cmd.SetContext(ctx) - cmd.SetArgs(tc.args) - s.Require().NoError(client.SetCmdClientContextHandler(s.baseCtx, cmd)) - - s.Require().Contains(fmt.Sprint(cmd), "votes-by-proposal [proposal-id] [] [] Query for votes by proposal id with pagination flags") - s.Require().Contains(fmt.Sprint(cmd), tc.expCmdOutput) - }) - } -} - -func (s *CLITestSuite) TestQueryTallyResult() { - testCases := []struct { - name string - args []string - expCmdOutput string - }{ - { - name: "json output", - args: []string{"1", fmt.Sprintf("--%s=json", flags.FlagOutput)}, - expCmdOutput: "1 --output=json", - }, - { - name: "text output", - args: []string{"1", fmt.Sprintf("--%s=text", flags.FlagOutput)}, - expCmdOutput: "1 --output=text", - }, - } - - for _, tc := range testCases { - s.Run(tc.name, func() { - cmd := cli.QueryTallyResultCmd() - - ctx := svrcmd.CreateExecuteContext(context.Background()) - - cmd.SetOut(io.Discard) - s.Require().NotNil(cmd) - - cmd.SetContext(ctx) - cmd.SetArgs(tc.args) - s.Require().NoError(client.SetCmdClientContextHandler(s.baseCtx, cmd)) - - s.Require().Contains(fmt.Sprint(cmd), "tally-result [proposal-id] [] [] Query tally result of proposal") - s.Require().Contains(fmt.Sprint(cmd), tc.expCmdOutput) - }) - } -} - -func (s *CLITestSuite) TestQueryVotesByVoter() { - accounts := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) - - testCases := []struct { - name string - args []string - expCmdOutput string - }{ - { - name: "json output", - args: []string{accounts[0].Address.String(), fmt.Sprintf("--%s=json", flags.FlagOutput)}, - expCmdOutput: fmt.Sprintf("%s --output=json", accounts[0].Address.String()), - }, - { - name: "text output", - args: []string{accounts[0].Address.String(), fmt.Sprintf("--%s=text", flags.FlagOutput)}, - expCmdOutput: fmt.Sprintf("%s --output=text", accounts[0].Address.String()), - }, - } - - for _, tc := range testCases { - s.Run(tc.name, func() { - cmd := cli.QueryVotesByVoterCmd() - - ctx := svrcmd.CreateExecuteContext(context.Background()) - - cmd.SetOut(io.Discard) - s.Require().NotNil(cmd) - - cmd.SetContext(ctx) - cmd.SetArgs(tc.args) - s.Require().NoError(client.SetCmdClientContextHandler(s.baseCtx, cmd)) - - s.Require().Contains(fmt.Sprint(cmd), "votes-by-voter [voter] [] [] Query for votes by voter account address with pagination flags") - s.Require().Contains(fmt.Sprint(cmd), tc.expCmdOutput) - }) - } -} - -func (s *CLITestSuite) TestQueryGroupsByMembers() { - accounts := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) - - testCases := []struct { - name string - args []string - expCmdOutput string - }{ - { - name: "json output", - args: []string{accounts[0].Address.String(), fmt.Sprintf("--%s=json", flags.FlagOutput)}, - expCmdOutput: fmt.Sprintf("%s --output=json", accounts[0].Address.String()), - }, - { - name: "text output", - args: []string{accounts[0].Address.String(), fmt.Sprintf("--%s=text", flags.FlagOutput)}, - expCmdOutput: fmt.Sprintf("%s --output=text", accounts[0].Address.String()), - }, - } - - for _, tc := range testCases { - s.Run(tc.name, func() { - cmd := cli.QueryGroupsByMemberCmd() - - ctx := svrcmd.CreateExecuteContext(context.Background()) - - cmd.SetOut(io.Discard) - s.Require().NotNil(cmd) - - cmd.SetContext(ctx) - cmd.SetArgs(tc.args) - s.Require().NoError(client.SetCmdClientContextHandler(s.baseCtx, cmd)) - - s.Require().Contains(fmt.Sprint(cmd), "groups-by-member [address] [] [] Query for groups by member address with pagination flags") - s.Require().Contains(fmt.Sprint(cmd), tc.expCmdOutput) - }) - } -} diff --git a/x/group/client/cli/tx.go b/x/group/client/cli/tx.go index 172f64564b05..59c71073f678 100644 --- a/x/group/client/cli/tx.go +++ b/x/group/client/cli/tx.go @@ -6,9 +6,10 @@ import ( "strconv" "strings" - "cosmossdk.io/core/address" "github.com/spf13/cobra" + "cosmossdk.io/core/address" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" @@ -588,13 +589,13 @@ Parameters: "from_address": "cosmos1...", "to_address": "cosmos1...", "amount":[{"denom": "stake","amount": "10"}] - "title": "My proposal", - "summary": "This is a proposal to send 10 stake to cosmos1...", } ], // metadata can be any of base64 encoded, raw text, stringified json, IPFS link to json // see below for example metadata "metadata": "4pIMOgIGx1vZGU=", // base64-encoded metadata + "title": "My proposal", + "summary": "This is a proposal to send 10 stake to cosmos1...", "proposers": ["cosmos1...", "cosmos1..."], } @@ -650,7 +651,7 @@ metadata example: }, } - cmd.Flags().String(FlagExec, "", "Set to 1 to try to execute proposal immediately after creation (proposers signatures are considered as Yes votes)") + cmd.Flags().String(FlagExec, "", "Set to 1 or 'try' to try to execute proposal immediately after creation (proposers signatures are considered as Yes votes)") flags.AddTxFlagsToCmd(cmd) return cmd diff --git a/x/group/client/cli/tx_test.go b/x/group/client/cli/tx_test.go index 23b9aa5d6b71..cdf87fba7d2c 100644 --- a/x/group/client/cli/tx_test.go +++ b/x/group/client/cli/tx_test.go @@ -89,7 +89,7 @@ func (s *CLITestSuite) SetupSuite() { s.clientCtx, val.Address, account, - sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(2000))), address.NewBech32Codec("cosmos"), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(2000))), address.NewBech32Codec("cosmos"), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(10))).String()), ) diff --git a/x/group/client/cli/util.go b/x/group/client/cli/util.go index 65ad49425a54..2d91167adbbe 100644 --- a/x/group/client/cli/util.go +++ b/x/group/client/cli/util.go @@ -53,7 +53,7 @@ func parseMembers(membersFile string) ([]group.MemberRequest, error) { func execFromString(execStr string) group.Exec { exec := group.Exec_EXEC_UNSPECIFIED - if execStr == ExecTry { + if execStr == ExecTry || execStr == "1" { exec = group.Exec_EXEC_TRY } diff --git a/x/group/client/cli/util_test.go b/x/group/client/cli/util_test.go index 67b90ef3d65b..c883def2fa04 100644 --- a/x/group/client/cli/util_test.go +++ b/x/group/client/cli/util_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" ) -func Test_ParseCLIProposal(t *testing.T) { +func TestParseCLIProposal(t *testing.T) { data := []byte(`{ "group_policy_address": "cosmos15r295x4994egvckteam9skazy9kvfvzpak4naf", "messages": [ diff --git a/x/group/errors/orm.go b/x/group/errors/orm.go index 370abdb882b8..b0f1df156fe6 100644 --- a/x/group/errors/orm.go +++ b/x/group/errors/orm.go @@ -2,8 +2,8 @@ package errors import "cosmossdk.io/errors" -// mathCodespace is the codespace for all errors defined in orm package -const ormCodespace = "orm" +// ormCodespace is the codespace for all errors defined in orm package +const ormCodespace = "legacy_orm" var ( // ErrORMIteratorDone defines an error when an iterator is done diff --git a/x/group/events.pb.go b/x/group/events.pb.go index dc869b695c66..4d4c6822569a 100644 --- a/x/group/events.pb.go +++ b/x/group/events.pb.go @@ -528,6 +528,61 @@ func (m *EventProposalPruned) GetTallyResult() *TallyResult { return nil } +// EventTallyError is an event emitted when a proposal tally failed with an error. +type EventTallyError struct { + // proposal_id is the unique ID of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` + // error_message is the raw error output + ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` +} + +func (m *EventTallyError) Reset() { *m = EventTallyError{} } +func (m *EventTallyError) String() string { return proto.CompactTextString(m) } +func (*EventTallyError) ProtoMessage() {} +func (*EventTallyError) Descriptor() ([]byte, []int) { + return fileDescriptor_e8d753981546f032, []int{10} +} +func (m *EventTallyError) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventTallyError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventTallyError.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 *EventTallyError) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventTallyError.Merge(m, src) +} +func (m *EventTallyError) XXX_Size() int { + return m.Size() +} +func (m *EventTallyError) XXX_DiscardUnknown() { + xxx_messageInfo_EventTallyError.DiscardUnknown(m) +} + +var xxx_messageInfo_EventTallyError proto.InternalMessageInfo + +func (m *EventTallyError) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +func (m *EventTallyError) GetErrorMessage() string { + if m != nil { + return m.ErrorMessage + } + return "" +} + func init() { proto.RegisterType((*EventCreateGroup)(nil), "cosmos.group.v1.EventCreateGroup") proto.RegisterType((*EventUpdateGroup)(nil), "cosmos.group.v1.EventUpdateGroup") @@ -539,40 +594,43 @@ func init() { proto.RegisterType((*EventExec)(nil), "cosmos.group.v1.EventExec") proto.RegisterType((*EventLeaveGroup)(nil), "cosmos.group.v1.EventLeaveGroup") proto.RegisterType((*EventProposalPruned)(nil), "cosmos.group.v1.EventProposalPruned") + proto.RegisterType((*EventTallyError)(nil), "cosmos.group.v1.EventTallyError") } func init() { proto.RegisterFile("cosmos/group/v1/events.proto", fileDescriptor_e8d753981546f032) } var fileDescriptor_e8d753981546f032 = []byte{ - // 442 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0x4f, 0xef, 0xd2, 0x30, - 0x18, 0xc7, 0xe9, 0x4f, 0x02, 0x52, 0x8c, 0x98, 0xfa, 0x27, 0x03, 0xc9, 0x20, 0xc4, 0x44, 0x0e, - 0xb2, 0x05, 0x4c, 0xd4, 0x93, 0x44, 0x0c, 0x31, 0x24, 0x1c, 0xc8, 0xf0, 0x4f, 0xe2, 0x05, 0xc7, - 0xda, 0x8c, 0xc5, 0x41, 0x97, 0xb6, 0x9b, 0x70, 0xf4, 0x1d, 0xf8, 0x52, 0x3c, 0xf8, 0x22, 0x3c, - 0x12, 0x4f, 0x1e, 0x0d, 0xbc, 0x11, 0xb3, 0xae, 0x03, 0x82, 0x31, 0x23, 0xf9, 0x9d, 0x68, 0xfb, - 0xfd, 0x7c, 0xbf, 0x3c, 0x4f, 0x9f, 0x15, 0xd6, 0x1d, 0xca, 0x97, 0x94, 0x9b, 0x2e, 0xa3, 0x61, - 0x60, 0x46, 0x5d, 0x93, 0x44, 0x64, 0x25, 0xb8, 0x11, 0x30, 0x2a, 0x28, 0xaa, 0x24, 0xaa, 0x21, - 0x55, 0x23, 0xea, 0xd6, 0xaa, 0xc9, 0xc1, 0x4c, 0xca, 0xa6, 0x52, 0xe5, 0xa6, 0xf6, 0xf0, 0x3c, - 0x49, 0x6c, 0x02, 0xa2, 0xc4, 0x56, 0x07, 0xde, 0x19, 0xc6, 0xc1, 0xaf, 0x19, 0xb1, 0x05, 0x79, - 0x13, 0x23, 0xa8, 0x0a, 0x6f, 0x4a, 0x76, 0xe6, 0x61, 0x0d, 0x34, 0x41, 0x3b, 0x6f, 0x15, 0xe5, - 0x7e, 0x84, 0x0f, 0xf8, 0xbb, 0x00, 0x5f, 0x82, 0x8f, 0xe1, 0x83, 0xf3, 0xf4, 0x09, 0xf5, 0x3d, - 0x67, 0x83, 0x7a, 0xb0, 0x68, 0x63, 0xcc, 0x08, 0xe7, 0xd2, 0x53, 0x1a, 0x68, 0xbf, 0x7e, 0x74, - 0xee, 0xa9, 0xba, 0x5f, 0x25, 0xca, 0x54, 0x30, 0x6f, 0xe5, 0x5a, 0x29, 0x78, 0x48, 0x3b, 0xf9, - 0xf3, 0x6b, 0xa4, 0x3d, 0x83, 0x77, 0x65, 0xda, 0x34, 0x9c, 0x2f, 0x3d, 0x31, 0x61, 0x34, 0xa0, - 0xdc, 0xf6, 0x51, 0x03, 0x96, 0x03, 0xb5, 0x3e, 0x36, 0x04, 0xd3, 0xa3, 0x11, 0x6e, 0xbd, 0x80, - 0xf7, 0xa5, 0xef, 0x83, 0x27, 0x16, 0x98, 0xd9, 0x5f, 0x2e, 0x77, 0x3e, 0x81, 0x25, 0xe9, 0x7c, - 0x4f, 0x05, 0xc9, 0xa6, 0xbf, 0x02, 0x85, 0x0f, 0xd7, 0xc4, 0xc9, 0xc4, 0x51, 0x1f, 0x16, 0x18, - 0xe1, 0xa1, 0x2f, 0xb4, 0xab, 0x26, 0x68, 0xdf, 0xee, 0x3d, 0x36, 0xce, 0x3e, 0x11, 0x23, 0x2d, - 0x34, 0xce, 0x0b, 0x05, 0x65, 0x96, 0xc4, 0x2d, 0x65, 0x43, 0x08, 0xe6, 0x7d, 0xea, 0x72, 0xed, - 0x46, 0x7c, 0x81, 0x96, 0x5c, 0xb7, 0x3e, 0xc1, 0x8a, 0x2c, 0x61, 0x4c, 0xec, 0x28, 0x73, 0xda, - 0xa7, 0x53, 0xb8, 0xba, 0x74, 0x0a, 0xdf, 0x81, 0x1a, 0x43, 0x5a, 0xdd, 0x84, 0x85, 0x2b, 0x82, - 0xb3, 0xfb, 0x7d, 0x0e, 0x0b, 0x5c, 0xd8, 0x22, 0xe4, 0xaa, 0xdf, 0xc6, 0x7f, 0xfb, 0x9d, 0x4a, - 0xcc, 0x52, 0x38, 0xea, 0xc3, 0x5b, 0xc2, 0xf6, 0xfd, 0xcd, 0x4c, 0x5d, 0x57, 0xdc, 0x6f, 0xb9, - 0x57, 0xff, 0xc7, 0xfe, 0x36, 0x86, 0xd4, 0x1d, 0x95, 0xc5, 0x71, 0x33, 0x78, 0xf9, 0x73, 0xa7, - 0x83, 0xed, 0x4e, 0x07, 0x7f, 0x76, 0x3a, 0xf8, 0xb6, 0xd7, 0x73, 0xdb, 0xbd, 0x9e, 0xfb, 0xbd, - 0xd7, 0x73, 0x1f, 0x1f, 0xb9, 0x9e, 0x58, 0x84, 0x73, 0xc3, 0xa1, 0x4b, 0xf5, 0x04, 0xd5, 0x4f, - 0x87, 0xe3, 0xcf, 0xe6, 0x3a, 0x79, 0x81, 0xf3, 0x82, 0x7c, 0x79, 0x4f, 0xff, 0x06, 0x00, 0x00, - 0xff, 0xff, 0xa5, 0x1a, 0x1c, 0xb9, 0xe2, 0x03, 0x00, 0x00, + // 476 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0x4d, 0x6b, 0x13, 0x41, + 0x18, 0xc7, 0x33, 0xb5, 0xa4, 0xf6, 0x49, 0xb5, 0x32, 0xbe, 0x90, 0xd6, 0xb2, 0x2d, 0x51, 0xb0, + 0x07, 0xb3, 0x4b, 0x23, 0xa8, 0x27, 0x8b, 0x95, 0x20, 0x85, 0x0a, 0x61, 0xa3, 0x16, 0xbc, 0xc4, + 0x49, 0x66, 0xd8, 0x2e, 0xee, 0x66, 0x96, 0x99, 0xd9, 0xb5, 0x39, 0xfa, 0x0d, 0xfc, 0x28, 0x1e, + 0xfc, 0x10, 0x1e, 0x8b, 0x27, 0x8f, 0x92, 0x7c, 0x11, 0xd9, 0x67, 0x67, 0xdb, 0x10, 0x91, 0x0d, + 0x78, 0xca, 0xcc, 0xf3, 0xfc, 0xfe, 0xff, 0x3c, 0x2f, 0x3b, 0xb0, 0x33, 0x92, 0x3a, 0x96, 0xda, + 0x0b, 0x94, 0x4c, 0x13, 0x2f, 0x3b, 0xf0, 0x44, 0x26, 0xc6, 0x46, 0xbb, 0x89, 0x92, 0x46, 0xd2, + 0xcd, 0x22, 0xeb, 0x62, 0xd6, 0xcd, 0x0e, 0xb6, 0xb7, 0x8a, 0xc0, 0x00, 0xd3, 0x9e, 0xcd, 0xe2, + 0x65, 0xfb, 0xfe, 0xa2, 0x93, 0x99, 0x24, 0xc2, 0x26, 0x5b, 0x6d, 0xb8, 0xd5, 0xcd, 0x8d, 0x5f, + 0x29, 0xc1, 0x8c, 0x78, 0x9d, 0x23, 0x74, 0x0b, 0xae, 0x23, 0x3b, 0x08, 0x79, 0x93, 0xec, 0x91, + 0xfd, 0x55, 0x7f, 0x0d, 0xef, 0xc7, 0xfc, 0x12, 0x7f, 0x97, 0xf0, 0x65, 0xf0, 0x13, 0xb8, 0xb7, + 0xe8, 0xde, 0x93, 0x51, 0x38, 0x9a, 0xd0, 0x0e, 0xac, 0x31, 0xce, 0x95, 0xd0, 0x1a, 0x35, 0xeb, + 0x47, 0xcd, 0x9f, 0xdf, 0xdb, 0x77, 0x6c, 0xdd, 0x2f, 0x8b, 0x4c, 0xdf, 0xa8, 0x70, 0x1c, 0xf8, + 0x25, 0x78, 0xe9, 0x36, 0xf7, 0xe7, 0xff, 0xe1, 0xf6, 0x14, 0x6e, 0xa3, 0x5b, 0x3f, 0x1d, 0xc6, + 0xa1, 0xe9, 0x29, 0x99, 0x48, 0xcd, 0x22, 0xba, 0x0b, 0x8d, 0xc4, 0x9e, 0xaf, 0x1a, 0x82, 0x32, + 0x74, 0xcc, 0x5b, 0xcf, 0xe1, 0x2e, 0xea, 0x4e, 0x43, 0x73, 0xc6, 0x15, 0xfb, 0xbc, 0xbc, 0xf2, + 0x31, 0xac, 0xa3, 0xf2, 0xbd, 0x34, 0xa2, 0x9a, 0xfe, 0x42, 0x2c, 0xde, 0x3d, 0x17, 0xa3, 0x4a, + 0x9c, 0x1e, 0x42, 0x5d, 0x09, 0x9d, 0x46, 0xa6, 0xb9, 0xb2, 0x47, 0xf6, 0x6f, 0x76, 0x1e, 0xb9, + 0x0b, 0x9f, 0x88, 0x5b, 0x16, 0x9a, 0xfb, 0xa5, 0x46, 0x2a, 0x1f, 0x71, 0xdf, 0xca, 0x28, 0x85, + 0xd5, 0x48, 0x06, 0xba, 0x79, 0x2d, 0x1f, 0xa0, 0x8f, 0xe7, 0xd6, 0x47, 0xd8, 0xc4, 0x12, 0x4e, + 0x04, 0xcb, 0x2a, 0xb7, 0x3d, 0xbf, 0x85, 0x95, 0x65, 0xb7, 0xf0, 0x8d, 0xd8, 0x35, 0x94, 0xd5, + 0xf5, 0x54, 0x3a, 0x16, 0xbc, 0xba, 0xdf, 0x67, 0x50, 0xd7, 0x86, 0x99, 0x54, 0xdb, 0x7e, 0x77, + 0xff, 0xd9, 0x6f, 0x1f, 0x31, 0xdf, 0xe2, 0xf4, 0x10, 0x36, 0x0c, 0x8b, 0xa2, 0xc9, 0xc0, 0x8e, + 0x2b, 0xef, 0xb7, 0xd1, 0xd9, 0xf9, 0x4b, 0xfe, 0x36, 0x87, 0xec, 0x8c, 0x1a, 0xe6, 0xea, 0xd2, + 0x3a, 0xb5, 0x43, 0x41, 0xa0, 0xab, 0x94, 0x54, 0xd5, 0xd5, 0x3e, 0x80, 0x1b, 0x22, 0x27, 0x07, + 0xb1, 0xd0, 0x9a, 0x05, 0xa2, 0x18, 0x90, 0xbf, 0x81, 0xc1, 0x37, 0x45, 0xec, 0xe8, 0xc5, 0x8f, + 0xa9, 0x43, 0x2e, 0xa6, 0x0e, 0xf9, 0x3d, 0x75, 0xc8, 0xd7, 0x99, 0x53, 0xbb, 0x98, 0x39, 0xb5, + 0x5f, 0x33, 0xa7, 0xf6, 0xe1, 0x61, 0x10, 0x9a, 0xb3, 0x74, 0xe8, 0x8e, 0x64, 0x6c, 0xdf, 0xb6, + 0xfd, 0x69, 0x6b, 0xfe, 0xc9, 0x3b, 0x2f, 0x9e, 0xf6, 0xb0, 0x8e, 0x4f, 0xfa, 0xc9, 0x9f, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x14, 0x0c, 0xb7, 0x93, 0x3b, 0x04, 0x00, 0x00, } func (m *EventCreateGroup) Marshal() (dAtA []byte, err error) { @@ -895,6 +953,41 @@ func (m *EventProposalPruned) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *EventTallyError) 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 *EventTallyError) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventTallyError) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ErrorMessage) > 0 { + i -= len(m.ErrorMessage) + copy(dAtA[i:], m.ErrorMessage) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ErrorMessage))) + i-- + dAtA[i] = 0x12 + } + if m.ProposalId != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { offset -= sovEvents(v) base := offset @@ -1046,6 +1139,22 @@ func (m *EventProposalPruned) Size() (n int) { return n } +func (m *EventTallyError) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovEvents(uint64(m.ProposalId)) + } + l = len(m.ErrorMessage) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + func sovEvents(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1906,6 +2015,107 @@ func (m *EventProposalPruned) Unmarshal(dAtA []byte) error { } return nil } +func (m *EventTallyError) 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 ErrIntOverflowEvents + } + 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: EventTallyError: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventTallyError: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ErrorMessage", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ErrorMessage = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipEvents(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/group/genesis_test.go b/x/group/genesis_test.go index cf43ed699d41..ddfebf6ef28c 100644 --- a/x/group/genesis_test.go +++ b/x/group/genesis_test.go @@ -4,10 +4,11 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/stretchr/testify/require" ) var ( diff --git a/x/group/internal/orm/README.md b/x/group/internal/orm/README.md index 9d71a5fc32ee..8976e0f9c9a1 100644 --- a/x/group/internal/orm/README.md +++ b/x/group/internal/orm/README.md @@ -21,7 +21,7 @@ The orm package provides a framework for creating relational database tables wit A table can be built given a `codec.ProtoMarshaler` model type, a prefix to access the underlying prefix store used to store table data as well as a `Codec` for marshalling/unmarshalling. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/group/internal/orm/table.go#L30-L36 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/x/group/internal/orm/table.go#L30-L36 ``` In the prefix store, entities should be stored by an unique identifier called `RowID` which can be based either on an `uint64` auto-increment counter, string or dynamic size bytes. @@ -42,7 +42,7 @@ The `table` struct is private, so that we only have custom tables built on top o `AutoUInt64Table` is a table type with an auto incrementing `uint64` ID. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/group/internal/orm/auto_uint64.go#L15-L18 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/x/group/internal/orm/auto_uint64.go#L15-L18 ``` It's based on the `Sequence` struct which is a persistent unique key generator based on a counter encoded using 8 byte big endian. @@ -56,7 +56,7 @@ It's based on the `Sequence` struct which is a persistent unique key generator b The model provided for creating a `PrimaryKeyTable` should implement the `PrimaryKeyed` interface: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/group/internal/orm/primary_key.go#L30-L44 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/x/group/internal/orm/primary_key.go#L30-L44 ``` `PrimaryKeyFields()` method returns the list of key parts for a given object. @@ -75,7 +75,7 @@ Key parts, except the last part, follow these rules: Secondary indexes can be used on `Indexable` [tables](01_table.md). Indeed, those tables implement the `Indexable` interface that provides a set of functions that can be called by indexes to register and interact with the tables, like callback functions that are called on entries creation, update or deletion to create, update or remove corresponding entries in the table secondary indexes. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/group/internal/orm/types.go#L88-L93 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/x/group/internal/orm/types.go#L88-L93 ``` ### MultiKeyIndex @@ -83,17 +83,17 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/group/internal/orm/types A `MultiKeyIndex` is an index where multiple entries can point to the same underlying object. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/group/internal/orm/index.go#L26-L32 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/x/group/internal/orm/index.go#L26-L32 ``` Internally, it uses an `Indexer` that manages the persistence of the index based on searchable keys and create/update/delete operations. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/group/internal/orm/index.go#L15-L20 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/x/group/internal/orm/index.go#L15-L20 ``` ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/group/internal/orm/indexer.go#L15-L19 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/x/group/internal/orm/indexer.go#L15-L19 ``` The currently used implementation of an `indexer`, `Indexer`, relies on an `IndexerFunc` that should be provided when instantiating the index. Based on the source object, this function returns one or multiple index keys as `[]interface{}`. Such secondary index keys should be bytes, string or `uint64` in order to be handled properly by the [key codec](01_table.md#key-codec) which defines specific encoding for those types. @@ -112,19 +112,19 @@ Both [tables](01_table.md) and [secondary indexes](02_secondary_index.md) suppor An `Iterator` allows iteration through a sequence of key value pairs. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/group/internal/orm/types.go#L77-L85 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/x/group/internal/orm/types.go#L77-L85 ``` Tables rely on a `typeSafeIterator` that is used by `PrefixScan` and `ReversePrefixScan` `table` methods to iterate through a range of `RowID`s. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/group/internal/orm/table.go#L287-L291 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/x/group/internal/orm/table.go#L287-L291 ``` Secondary indexes rely on an `indexIterator` that can strip the `RowID` from the full index key in order to get the underlying value in the table prefix store. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/group/internal/orm/index.go#L233-L239 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/x/group/internal/orm/index.go#L233-L239 ``` Under the hood, both use a prefix store `Iterator` (alias for tm-db `Iterator`). @@ -135,7 +135,7 @@ The `Paginate` function does pagination given an [`Iterator`](#iterator) and a ` It unmarshals the results into the provided dest interface that should be a pointer to a slice of models. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/group/internal/orm/iterator.go#L102-L220 +https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/x/group/internal/orm/iterator.go#L102-L220 ``` Secondary indexes have a `GetPaginated` method that returns an `Iterator` for the given searched secondary index key, starting from the `query.PageRequest` key if provided. It's important to note that this `query.PageRequest` key should be a `RowID` (that could have been returned by a previous paginated request). The returned `Iterator` can then be used with the `Paginate` function and the same `query.PageRequest`. diff --git a/x/group/internal/orm/auto_uint64.go b/x/group/internal/orm/auto_uint64.go index 98b924f5533a..b3b6d22fc731 100644 --- a/x/group/internal/orm/auto_uint64.go +++ b/x/group/internal/orm/auto_uint64.go @@ -3,9 +3,8 @@ package orm import ( "github.com/cosmos/gogoproto/proto" - storetypes "cosmossdk.io/store/types" - "cosmossdk.io/errors" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" ) diff --git a/x/group/internal/orm/auto_uint64_test.go b/x/group/internal/orm/auto_uint64_test.go index 079b137c46c1..8f4108e6a5d8 100644 --- a/x/group/internal/orm/auto_uint64_test.go +++ b/x/group/internal/orm/auto_uint64_test.go @@ -4,11 +4,12 @@ import ( "math" "testing" - errorsmod "cosmossdk.io/errors" - storetypes "cosmossdk.io/store/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + errorsmod "cosmossdk.io/errors" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/testutil/testdata" diff --git a/x/group/internal/orm/genesis_test.go b/x/group/internal/orm/genesis_test.go index 58aa10d1a68f..72128c9e595c 100644 --- a/x/group/internal/orm/genesis_test.go +++ b/x/group/internal/orm/genesis_test.go @@ -3,9 +3,10 @@ package orm import ( "testing" - storetypes "cosmossdk.io/store/types" "github.com/stretchr/testify/require" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/testutil/testdata" diff --git a/x/group/internal/orm/index.go b/x/group/internal/orm/index.go index 7564f4705bec..27bb064af8b5 100644 --- a/x/group/internal/orm/index.go +++ b/x/group/internal/orm/index.go @@ -5,11 +5,10 @@ import ( "github.com/cosmos/gogoproto/proto" + errorsmod "cosmossdk.io/errors" "cosmossdk.io/store/prefix" "cosmossdk.io/store/types" - errorsmod "cosmossdk.io/errors" - "github.com/cosmos/cosmos-sdk/types/query" "github.com/cosmos/cosmos-sdk/x/group/errors" ) diff --git a/x/group/internal/orm/index_property_test.go b/x/group/internal/orm/index_property_test.go index e48de3c12240..20b33546c5ae 100644 --- a/x/group/internal/orm/index_property_test.go +++ b/x/group/internal/orm/index_property_test.go @@ -3,9 +3,8 @@ package orm import ( "testing" - "pgregory.net/rapid" - "github.com/stretchr/testify/require" + "pgregory.net/rapid" ) func TestPrefixRangeProperty(t *testing.T) { diff --git a/x/group/internal/orm/index_test.go b/x/group/internal/orm/index_test.go index 4e2ec6becae3..a965190b647a 100644 --- a/x/group/internal/orm/index_test.go +++ b/x/group/internal/orm/index_test.go @@ -3,18 +3,17 @@ package orm import ( "testing" - storetypes "cosmossdk.io/store/types" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" errorsmod "cosmossdk.io/errors" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/testutil/testdata" "github.com/cosmos/cosmos-sdk/types/query" "github.com/cosmos/cosmos-sdk/x/group/errors" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) var _ Indexable = &nilRowGetterBuilder{} diff --git a/x/group/internal/orm/indexer.go b/x/group/internal/orm/indexer.go index a3600c6c8b4d..53f266b4146e 100644 --- a/x/group/internal/orm/indexer.go +++ b/x/group/internal/orm/indexer.go @@ -1,9 +1,8 @@ package orm import ( - storetypes "cosmossdk.io/store/types" - errorsmod "cosmossdk.io/errors" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/x/group/errors" ) diff --git a/x/group/internal/orm/indexer_test.go b/x/group/internal/orm/indexer_test.go index 18138cc97fed..0787bfc4abf8 100644 --- a/x/group/internal/orm/indexer_test.go +++ b/x/group/internal/orm/indexer_test.go @@ -5,12 +5,12 @@ import ( "fmt" "testing" - "cosmossdk.io/store/prefix" - storetypes "cosmossdk.io/store/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" errorsmod "cosmossdk.io/errors" + "cosmossdk.io/store/prefix" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/x/group/errors" ) diff --git a/x/group/internal/orm/iterator.go b/x/group/internal/orm/iterator.go index 7f96b6a4b907..6b3927b0949e 100644 --- a/x/group/internal/orm/iterator.go +++ b/x/group/internal/orm/iterator.go @@ -4,9 +4,10 @@ import ( "fmt" "reflect" - errorsmod "cosmossdk.io/errors" "github.com/cosmos/gogoproto/proto" + errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/types/query" "github.com/cosmos/cosmos-sdk/x/group/errors" ) diff --git a/x/group/internal/orm/orm_scenario_test.go b/x/group/internal/orm/orm_scenario_test.go index a8fc2c453cc6..f93fd76775bc 100644 --- a/x/group/internal/orm/orm_scenario_test.go +++ b/x/group/internal/orm/orm_scenario_test.go @@ -6,10 +6,11 @@ import ( "fmt" "testing" - storetypes "cosmossdk.io/store/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/testutil/testdata" diff --git a/x/group/internal/orm/primary_key.go b/x/group/internal/orm/primary_key.go index f8798589c6e8..5bf6a2b83995 100644 --- a/x/group/internal/orm/primary_key.go +++ b/x/group/internal/orm/primary_key.go @@ -1,9 +1,10 @@ package orm import ( - storetypes "cosmossdk.io/store/types" "github.com/cosmos/gogoproto/proto" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/codec" ) diff --git a/x/group/internal/orm/primary_key_property_test.go b/x/group/internal/orm/primary_key_property_test.go index 3ed443be617f..2cdc39b2b4ce 100644 --- a/x/group/internal/orm/primary_key_property_test.go +++ b/x/group/internal/orm/primary_key_property_test.go @@ -3,14 +3,14 @@ package orm import ( "testing" + "github.com/stretchr/testify/require" + "pgregory.net/rapid" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/testutil/testdata" - - "github.com/stretchr/testify/require" - "pgregory.net/rapid" ) func TestPrimaryKeyTable(t *testing.T) { @@ -37,7 +37,7 @@ func testPrimaryKeyMachine(t *rapid.T) { // Create model state state := make(map[string]*testdata.TableModel) - t.Run(map[string]func(*rapid.T){ + t.Repeat(map[string]func(*rapid.T){ // Create is one of the model commands. It adds an object to the table, creating // an error if it already exists. "Create": func(t *rapid.T) { diff --git a/x/group/internal/orm/primary_key_test.go b/x/group/internal/orm/primary_key_test.go index f0fef3c142ac..d53a17c8cde7 100644 --- a/x/group/internal/orm/primary_key_test.go +++ b/x/group/internal/orm/primary_key_test.go @@ -3,17 +3,16 @@ package orm import ( "testing" - errorsmod "cosmossdk.io/errors" - storetypes "cosmossdk.io/store/types" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + errorsmod "cosmossdk.io/errors" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/x/group/errors" - "github.com/cosmos/cosmos-sdk/testutil/testdata" + "github.com/cosmos/cosmos-sdk/x/group/errors" ) func TestPrimaryKeyTablePrefixScan(t *testing.T) { diff --git a/x/group/internal/orm/sequence_property_test.go b/x/group/internal/orm/sequence_property_test.go index 33d47e2e7d23..ac73762d5528 100644 --- a/x/group/internal/orm/sequence_property_test.go +++ b/x/group/internal/orm/sequence_property_test.go @@ -3,10 +3,10 @@ package orm import ( "testing" - storetypes "cosmossdk.io/store/types" - "github.com/stretchr/testify/require" "pgregory.net/rapid" + + storetypes "cosmossdk.io/store/types" ) func TestSequence(t *testing.T) { @@ -30,7 +30,7 @@ func testSequenceMachine(t *rapid.T) { // Create model state state := initSeqVal - t.Run(map[string]func(*rapid.T){ + t.Repeat(map[string]func(*rapid.T){ // NextVal is one of the model commands. It checks that the next value of the // sequence matches the model and increments the model state. "NextVal": func(t *rapid.T) { diff --git a/x/group/internal/orm/sequence_test.go b/x/group/internal/orm/sequence_test.go index a14cfba7e1c0..dbecfcb34716 100644 --- a/x/group/internal/orm/sequence_test.go +++ b/x/group/internal/orm/sequence_test.go @@ -3,10 +3,11 @@ package orm import ( "testing" - storetypes "cosmossdk.io/store/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/x/group/errors" ) diff --git a/x/group/internal/orm/testsupport.go b/x/group/internal/orm/testsupport.go index bd0f1b06c754..b4fe3d0354ee 100644 --- a/x/group/internal/orm/testsupport.go +++ b/x/group/internal/orm/testsupport.go @@ -3,9 +3,9 @@ package orm import ( "fmt" - "cosmossdk.io/log" dbm "github.com/cosmos/cosmos-db" + "cosmossdk.io/log" "cosmossdk.io/store" "cosmossdk.io/store/gaskv" "cosmossdk.io/store/metrics" diff --git a/x/group/internal/orm/types_test.go b/x/group/internal/orm/types_test.go index 091dadc7eb8f..afcc59853d8a 100644 --- a/x/group/internal/orm/types_test.go +++ b/x/group/internal/orm/types_test.go @@ -4,11 +4,12 @@ import ( "reflect" "testing" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + errorsmod "cosmossdk.io/errors" "cosmossdk.io/store/prefix" storetypes "cosmossdk.io/store/types" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" diff --git a/x/group/keeper/genesis_test.go b/x/group/keeper/genesis_test.go index b6599e43e04f..6e4f456c9339 100644 --- a/x/group/keeper/genesis_test.go +++ b/x/group/keeper/genesis_test.go @@ -6,8 +6,8 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" + "go.uber.org/mock/gomock" "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" diff --git a/x/group/keeper/grpc_query.go b/x/group/keeper/grpc_query.go index eed68bc46af4..2c036bdedf4a 100644 --- a/x/group/keeper/grpc_query.go +++ b/x/group/keeper/grpc_query.go @@ -39,6 +39,11 @@ func (k Keeper) getGroupInfo(ctx sdk.Context, id uint64) (group.GroupInfo, error // GroupPolicyInfo queries info about a group policy. func (k Keeper) GroupPolicyInfo(goCtx context.Context, request *group.QueryGroupPolicyInfoRequest) (*group.QueryGroupPolicyInfoResponse, error) { + _, err := k.accKeeper.AddressCodec().StringToBytes(request.Address) + if err != nil { + return nil, err + } + ctx := sdk.UnwrapSDKContext(goCtx) groupPolicyInfo, err := k.getGroupPolicyInfo(ctx, request.Address) if err != nil { diff --git a/x/group/keeper/grpc_query_test.go b/x/group/keeper/grpc_query_test.go index f5e7b07a1384..3f9c6c817ad0 100644 --- a/x/group/keeper/grpc_query_test.go +++ b/x/group/keeper/grpc_query_test.go @@ -3,9 +3,10 @@ package keeper_test import ( "context" "testing" + "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" @@ -25,7 +26,16 @@ import ( grouptestutil "github.com/cosmos/cosmos-sdk/x/group/testutil" ) -func initKeeper(t *testing.T) (types.Context, groupkeeper.Keeper, []types.AccAddress, group.QueryClient) { +type fixture struct { + ctx types.Context + keeper groupkeeper.Keeper + queryClient group.QueryClient + addrs []types.AccAddress + defaultGroup *group.MsgCreateGroupWithPolicyResponse +} + +func initKeeper(t *testing.T) *fixture { + t.Helper() var ( groupKeeper groupkeeper.Keeper interfaceRegistry codectypes.InterfaceRegistry @@ -52,80 +62,329 @@ func initKeeper(t *testing.T) (types.Context, groupkeeper.Keeper, []types.AccAdd } accountKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec("cosmos")).AnyTimes() - groupKeeper = groupkeeper.NewKeeper(key, encCfg.Codec, bApp.MsgServiceRouter(), accountKeeper, group.DefaultConfig()) + // group policy expected calls + accountKeeper.EXPECT().GetAccount(gomock.Any(), gomock.Any()).Return(nil).AnyTimes() + accountKeeper.EXPECT().NewAccount(gomock.Any(), gomock.Any()).Return(nil).AnyTimes() + accountKeeper.EXPECT().SetAccount(gomock.Any(), gomock.Any()).AnyTimes() + groupKeeper = groupkeeper.NewKeeper(key, encCfg.Codec, bApp.MsgServiceRouter(), accountKeeper, group.DefaultConfig()) queryHelper := baseapp.NewQueryServerTestHelper(ctx, interfaceRegistry) group.RegisterQueryServer(queryHelper, groupKeeper) queryClient := group.NewQueryClient(queryHelper) - return ctx, groupKeeper, addrs, queryClient + msgGroupAndPolicy := &group.MsgCreateGroupWithPolicy{ + Admin: addrs[0].String(), + Members: []group.MemberRequest{ + {Address: addrs[1].String(), Weight: "1"}, + {Address: addrs[3].String(), Weight: "2"}, + }, + } + err := msgGroupAndPolicy.SetDecisionPolicy(group.NewThresholdDecisionPolicy("2", time.Second, 20)) + require.NoError(t, err) + + resp, err := groupKeeper.CreateGroupWithPolicy(ctx, msgGroupAndPolicy) + require.NoError(t, err) + + return &fixture{ + ctx: ctx, + keeper: groupKeeper, + queryClient: queryClient, + addrs: addrs, + defaultGroup: resp, + } } -func TestQueryGroupsByMember(t *testing.T) { - ctx, groupKeeper, addrs, queryClient := initKeeper(t) +func TestQueryGroupInfo(t *testing.T) { + fixture := initKeeper(t) - // Initial group, group policy and balance setup - members := []group.MemberRequest{ - {Address: addrs[2].String(), Weight: "1"}, {Address: addrs[3].String(), Weight: "2"}, + testCases := []struct { + name string + req group.QueryGroupInfoRequest + expErrMsg string + }{ + { + name: "invalid req", + expErrMsg: "group: not found", + }, + { + name: "unknown id", + req: group.QueryGroupInfoRequest{GroupId: 20}, + expErrMsg: "group: not found", + }, + { + name: "valid id", + req: group.QueryGroupInfoRequest{GroupId: 1}, + expErrMsg: "", + }, } - _, err := groupKeeper.CreateGroup(ctx, &group.MsgCreateGroup{ - Admin: addrs[0].String(), - Members: members, - }) - require.NoError(t, err) + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + _, err := fixture.queryClient.GroupInfo(fixture.ctx, &tc.req) + if tc.expErrMsg != "" { + require.Error(t, err) + require.Contains(t, err.Error(), tc.expErrMsg) + } else { + require.NoError(t, err) + } + }) + } +} + +func TestQueryGroupPolicyInfo(t *testing.T) { + fixture := initKeeper(t) + + testCases := []struct { + name string + req group.QueryGroupPolicyInfoRequest + expErrMsg string + }{ + { + name: "valid address", + req: group.QueryGroupPolicyInfoRequest{Address: fixture.defaultGroup.GroupPolicyAddress}, + expErrMsg: "", + }, + { + name: "unexisting address", + req: group.QueryGroupPolicyInfoRequest{Address: fixture.addrs[5].String()}, + expErrMsg: "group policy: not found", + }, + { + name: "invalid address", + req: group.QueryGroupPolicyInfoRequest{Address: "invalid address"}, + expErrMsg: "decoding bech32 failed", + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + _, err := fixture.queryClient.GroupPolicyInfo(fixture.ctx, &tc.req) + if tc.expErrMsg != "" { + require.Error(t, err) + require.Contains(t, err.Error(), tc.expErrMsg) + } else { + require.NoError(t, err) + } + }) + } +} + +func TestQueryGroupMembers(t *testing.T) { + fixture := initKeeper(t) + + testCases := []struct { + name string + req group.QueryGroupMembersRequest + postRun func(resp *group.QueryGroupMembersResponse) + expErrMsg string + }{ + { + name: "valid group", + req: group.QueryGroupMembersRequest{GroupId: 1}, + postRun: func(resp *group.QueryGroupMembersResponse) { + require.Len(t, resp.Members, 2) + }, + expErrMsg: "", + }, + { + name: "unexisting group", + req: group.QueryGroupMembersRequest{GroupId: 20}, + postRun: func(resp *group.QueryGroupMembersResponse) { + require.Len(t, resp.Members, 0) + }, + expErrMsg: "", + }, + } - members = []group.MemberRequest{ - {Address: addrs[3].String(), Weight: "1"}, {Address: addrs[4].String(), Weight: "2"}, + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + resp, err := fixture.queryClient.GroupMembers(fixture.ctx, &tc.req) + if tc.expErrMsg != "" { + require.Error(t, err) + require.Contains(t, err.Error(), tc.expErrMsg) + } else { + require.NoError(t, err) + } + + if tc.postRun != nil { + tc.postRun(resp) + } + }) } - _, err = groupKeeper.CreateGroup(ctx, &group.MsgCreateGroup{ - Admin: addrs[1].String(), +} + +func TestQueryGroupsByAdmin(t *testing.T) { + fixture := initKeeper(t) + + testCases := []struct { + name string + req group.QueryGroupsByAdminRequest + postRun func(resp *group.QueryGroupsByAdminResponse) + expErrMsg string + }{ + { + name: "valid admin", + req: group.QueryGroupsByAdminRequest{Admin: fixture.addrs[0].String()}, + postRun: func(resp *group.QueryGroupsByAdminResponse) { require.Len(t, resp.Groups, 1) }, + expErrMsg: "", + }, + { + name: "unexisting address", + req: group.QueryGroupsByAdminRequest{Admin: fixture.addrs[5].String()}, + postRun: func(resp *group.QueryGroupsByAdminResponse) { require.Len(t, resp.Groups, 0) }, + expErrMsg: "", + }, + { + name: "invalid address", + req: group.QueryGroupsByAdminRequest{Admin: "invalid address"}, + expErrMsg: "decoding bech32 failed", + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + resp, err := fixture.queryClient.GroupsByAdmin(fixture.ctx, &tc.req) + if tc.expErrMsg != "" { + require.Error(t, err) + require.Contains(t, err.Error(), tc.expErrMsg) + } else { + require.NoError(t, err) + } + + if tc.postRun != nil { + tc.postRun(resp) + } + }) + } +} + +func TestQueryGroupPoliciesByGroup(t *testing.T) { + fixture := initKeeper(t) + + testCases := []struct { + name string + req group.QueryGroupPoliciesByGroupRequest + postRun func(resp *group.QueryGroupPoliciesByGroupResponse) + expErrMsg string + }{ + { + name: "valid group", + req: group.QueryGroupPoliciesByGroupRequest{GroupId: 1}, + postRun: func(resp *group.QueryGroupPoliciesByGroupResponse) { require.Len(t, resp.GroupPolicies, 1) }, + expErrMsg: "", + }, + { + name: "unexisting group", + req: group.QueryGroupPoliciesByGroupRequest{GroupId: 20}, + postRun: func(resp *group.QueryGroupPoliciesByGroupResponse) { require.Len(t, resp.GroupPolicies, 0) }, + expErrMsg: "", + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + resp, err := fixture.keeper.GroupPoliciesByGroup(fixture.ctx, &tc.req) + if tc.expErrMsg != "" { + require.Error(t, err) + require.Contains(t, err.Error(), tc.expErrMsg) + } else { + require.NoError(t, err) + } + + if tc.postRun != nil { + tc.postRun(resp) + } + }) + } +} + +func TestQueryGroupPoliciesByAdmin(t *testing.T) { + fixture := initKeeper(t) + + testCases := []struct { + name string + req group.QueryGroupPoliciesByAdminRequest + postRun func(resp *group.QueryGroupPoliciesByAdminResponse) + expErrMsg string + }{ + { + name: "valid admin", + req: group.QueryGroupPoliciesByAdminRequest{Admin: fixture.addrs[0].String()}, + postRun: func(resp *group.QueryGroupPoliciesByAdminResponse) { require.Len(t, resp.GroupPolicies, 1) }, + expErrMsg: "", + }, + { + name: "unexisting address", + req: group.QueryGroupPoliciesByAdminRequest{Admin: fixture.addrs[5].String()}, + postRun: func(resp *group.QueryGroupPoliciesByAdminResponse) { require.Len(t, resp.GroupPolicies, 0) }, + expErrMsg: "", + }, + { + name: "invalid address", + req: group.QueryGroupPoliciesByAdminRequest{Admin: "invalid address"}, + expErrMsg: "decoding bech32 failed", + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + resp, err := fixture.keeper.GroupPoliciesByAdmin(fixture.ctx, &tc.req) + if tc.expErrMsg != "" { + require.Error(t, err) + require.Contains(t, err.Error(), tc.expErrMsg) + } else { + require.NoError(t, err) + } + + if tc.postRun != nil { + tc.postRun(resp) + } + }) + } +} + +func TestQueryGroupsByMember(t *testing.T) { + fixture := initKeeper(t) + + members := []group.MemberRequest{ + {Address: fixture.addrs[3].String(), Weight: "1"}, {Address: fixture.addrs[4].String(), Weight: "2"}, + } + _, err := fixture.keeper.CreateGroup(fixture.ctx, &group.MsgCreateGroup{ + Admin: fixture.addrs[1].String(), Members: members, }) require.NoError(t, err) // not part of any group - resp, err := queryClient.GroupsByMember(context.Background(), &group.QueryGroupsByMemberRequest{ - Address: addrs[5].String(), + resp, err := fixture.queryClient.GroupsByMember(context.Background(), &group.QueryGroupsByMemberRequest{ + Address: fixture.addrs[5].String(), }) require.NoError(t, err) require.Len(t, resp.Groups, 0) // expect one group - resp, err = queryClient.GroupsByMember(context.Background(), &group.QueryGroupsByMemberRequest{ - Address: addrs[4].String(), + resp, err = fixture.queryClient.GroupsByMember(context.Background(), &group.QueryGroupsByMemberRequest{ + Address: fixture.addrs[4].String(), }) require.NoError(t, err) require.Len(t, resp.Groups, 1) // expect two groups - resp, err = queryClient.GroupsByMember(context.Background(), &group.QueryGroupsByMemberRequest{ - Address: addrs[3].String(), + resp, err = fixture.queryClient.GroupsByMember(context.Background(), &group.QueryGroupsByMemberRequest{ + Address: fixture.addrs[3].String(), }) require.NoError(t, err) require.Len(t, resp.Groups, 2) } func TestQueryGroups(t *testing.T) { - ctx, groupKeeper, addrs, queryClient := initKeeper(t) + fixture := initKeeper(t) - // Initial group, group policy and balance setup members := []group.MemberRequest{ - {Address: addrs[1].String(), Weight: "1"}, - {Address: addrs[3].String(), Weight: "2"}, - } - - _, err := groupKeeper.CreateGroup(ctx, &group.MsgCreateGroup{ - Admin: addrs[0].String(), - Members: members, - }) - require.NoError(t, err) - - members = []group.MemberRequest{ - {Address: addrs[3].String(), Weight: "1"}, + {Address: fixture.addrs[3].String(), Weight: "1"}, } - _, err = groupKeeper.CreateGroup(ctx, &group.MsgCreateGroup{ - Admin: addrs[2].String(), + _, err := fixture.keeper.CreateGroup(fixture.ctx, &group.MsgCreateGroup{ + Admin: fixture.addrs[2].String(), Members: members, }) require.NoError(t, err) @@ -157,7 +416,7 @@ func TestQueryGroups(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - resp, err := queryClient.Groups(context.Background(), &group.QueryGroupsRequest{ + resp, err := fixture.queryClient.Groups(context.Background(), &group.QueryGroupsRequest{ Pagination: &query.PageRequest{ Limit: tc.itemsPerPage, }, diff --git a/x/group/keeper/invariants.go b/x/group/keeper/invariants.go deleted file mode 100644 index 043fced61514..000000000000 --- a/x/group/keeper/invariants.go +++ /dev/null @@ -1,117 +0,0 @@ -package keeper - -import ( - "fmt" - "math" - "sort" - - "golang.org/x/exp/maps" - - storetypes "cosmossdk.io/store/types" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/group" - "github.com/cosmos/cosmos-sdk/x/group/errors" - groupmath "github.com/cosmos/cosmos-sdk/x/group/internal/math" - "github.com/cosmos/cosmos-sdk/x/group/internal/orm" -) - -const weightInvariant = "Group-TotalWeight" - -// RegisterInvariants registers all group invariants. -func RegisterInvariants(ir sdk.InvariantRegistry, keeper Keeper) { - ir.RegisterRoute(group.ModuleName, weightInvariant, GroupTotalWeightInvariant(keeper)) -} - -// GroupTotalWeightInvariant checks that group's TotalWeight must be equal to the sum of its members. -func GroupTotalWeightInvariant(keeper Keeper) sdk.Invariant { - return func(ctx sdk.Context) (string, bool) { - msg, broken := GroupTotalWeightInvariantHelper(ctx, keeper.key, keeper.groupTable, keeper.groupMemberByGroupIndex) - return sdk.FormatInvariant(group.ModuleName, weightInvariant, msg), broken - } -} - -func GroupTotalWeightInvariantHelper(ctx sdk.Context, key storetypes.StoreKey, groupTable orm.AutoUInt64Table, groupMemberByGroupIndex orm.Index) (string, bool) { - var msg string - var broken bool - - groupIt, err := groupTable.PrefixScan(ctx.KVStore(key), 1, math.MaxUint64) - if err != nil { - msg += fmt.Sprintf("PrefixScan failure on group table\n%v\n", err) - return msg, broken - } - defer groupIt.Close() - - groups := make(map[uint64]group.GroupInfo) - for { - var groupInfo group.GroupInfo - _, err = groupIt.LoadNext(&groupInfo) - if errors.ErrORMIteratorDone.Is(err) { - break - } - if err != nil { - msg += fmt.Sprintf("LoadNext failure on group table iterator\n%v\n", err) - return msg, broken - } - - groups[groupInfo.Id] = groupInfo - } - - groupByIDs := maps.Keys(groups) - sort.Slice(groupByIDs, func(i, j int) bool { - return groupByIDs[i] < groupByIDs[j] - }) - for _, groupID := range groupByIDs { - groupInfo := groups[groupID] - membersWeight, err := groupmath.NewNonNegativeDecFromString("0") - if err != nil { - msg += fmt.Sprintf("error while parsing positive dec zero for group member\n%v\n", err) - return msg, broken - } - - memIt, err := groupMemberByGroupIndex.Get(ctx.KVStore(key), groupInfo.Id) - if err != nil { - msg += fmt.Sprintf("error while returning group member iterator for group with ID %d\n%v\n", groupInfo.Id, err) - return msg, broken - } - defer memIt.Close() - - for { - var groupMember group.GroupMember - _, err = memIt.LoadNext(&groupMember) - if errors.ErrORMIteratorDone.Is(err) { - break - } - if err != nil { - msg += fmt.Sprintf("LoadNext failure on member table iterator\n%v\n", err) - return msg, broken - } - - curMemWeight, err := groupmath.NewPositiveDecFromString(groupMember.GetMember().GetWeight()) - if err != nil { - msg += fmt.Sprintf("error while parsing non-nengative decimal for group member %s\n%v\n", groupMember.Member.Address, err) - return msg, broken - } - - membersWeight, err = groupmath.Add(membersWeight, curMemWeight) - if err != nil { - msg += fmt.Sprintf("decimal addition error while adding group member voting weight to total voting weight\n%v\n", err) - return msg, broken - } - } - - groupWeight, err := groupmath.NewNonNegativeDecFromString(groupInfo.GetTotalWeight()) - if err != nil { - msg += fmt.Sprintf("error while parsing non-nengative decimal for group with ID %d\n%v\n", groupInfo.Id, err) - return msg, broken - } - - if groupWeight.Cmp(membersWeight) != 0 { - broken = true - msg += fmt.Sprintf("group's TotalWeight must be equal to the sum of its members' weights\ngroup weight: %s\nSum of group members weights: %s\n", groupWeight.String(), membersWeight.String()) - break - } - } - - return msg, broken -} diff --git a/x/group/keeper/invariants_test.go b/x/group/keeper/invariants_test.go deleted file mode 100644 index 14ce082ef480..000000000000 --- a/x/group/keeper/invariants_test.go +++ /dev/null @@ -1,147 +0,0 @@ -package keeper_test - -import ( - "testing" - - "cosmossdk.io/log" - "cosmossdk.io/store" - "cosmossdk.io/store/metrics" - storetypes "cosmossdk.io/store/types" - cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" - dbm "github.com/cosmos/cosmos-db" - "github.com/stretchr/testify/suite" - - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/testutil/testdata" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/group" - "github.com/cosmos/cosmos-sdk/x/group/internal/orm" - "github.com/cosmos/cosmos-sdk/x/group/keeper" -) - -type invariantTestSuite struct { - suite.Suite - - ctx sdk.Context - cdc *codec.ProtoCodec - key *storetypes.KVStoreKey -} - -func TestInvariantTestSuite(t *testing.T) { - suite.Run(t, new(invariantTestSuite)) -} - -func (s *invariantTestSuite) SetupSuite() { - interfaceRegistry := types.NewInterfaceRegistry() - group.RegisterInterfaces(interfaceRegistry) - cdc := codec.NewProtoCodec(interfaceRegistry) - key := storetypes.NewKVStoreKey(group.ModuleName) - db := dbm.NewMemDB() - cms := store.NewCommitMultiStore(db, log.NewNopLogger(), metrics.NewNoOpMetrics()) - cms.MountStoreWithDB(key, storetypes.StoreTypeIAVL, db) - _ = cms.LoadLatestVersion() - sdkCtx := sdk.NewContext(cms, cmtproto.Header{}, false, log.NewNopLogger()) - - s.ctx = sdkCtx - s.cdc = cdc - s.key = key -} - -func (s *invariantTestSuite) TestGroupTotalWeightInvariant() { - sdkCtx, _ := s.ctx.CacheContext() - curCtx, cdc, key := sdkCtx, s.cdc, s.key - - // Group Table - groupTable, err := orm.NewAutoUInt64Table([2]byte{keeper.GroupTablePrefix}, keeper.GroupTableSeqPrefix, &group.GroupInfo{}, cdc) - s.Require().NoError(err) - - // Group Member Table - groupMemberTable, err := orm.NewPrimaryKeyTable([2]byte{keeper.GroupMemberTablePrefix}, &group.GroupMember{}, cdc) - s.Require().NoError(err) - - groupMemberByGroupIndex, err := orm.NewIndex(groupMemberTable, keeper.GroupMemberByGroupIndexPrefix, func(val interface{}) ([]interface{}, error) { - group := val.(*group.GroupMember).GroupId - return []interface{}{group}, nil - }, group.GroupMember{}.GroupId) - s.Require().NoError(err) - - _, _, addr1 := testdata.KeyTestPubAddr() - _, _, addr2 := testdata.KeyTestPubAddr() - - specs := map[string]struct { - groupsInfo *group.GroupInfo - groupMembers []*group.GroupMember - expBroken bool - }{ - "invariant not broken": { - groupsInfo: &group.GroupInfo{ - Id: 1, - Admin: addr1.String(), - Version: 1, - TotalWeight: "3", - }, - groupMembers: []*group.GroupMember{ - { - GroupId: 1, - Member: &group.Member{ - Address: addr1.String(), - Weight: "1", - }, - }, - { - GroupId: 1, - Member: &group.Member{ - Address: addr2.String(), - Weight: "2", - }, - }, - }, - expBroken: false, - }, - - "group's TotalWeight must be equal to sum of its members weight ": { - groupsInfo: &group.GroupInfo{ - Id: 1, - Admin: addr1.String(), - Version: 1, - TotalWeight: "3", - }, - groupMembers: []*group.GroupMember{ - { - GroupId: 1, - Member: &group.Member{ - Address: addr1.String(), - Weight: "2", - }, - }, - { - GroupId: 1, - Member: &group.Member{ - Address: addr2.String(), - Weight: "2", - }, - }, - }, - expBroken: true, - }, - } - - for _, spec := range specs { - cacheCurCtx, _ := curCtx.CacheContext() - groupsInfo := spec.groupsInfo - groupMembers := spec.groupMembers - - _, err := groupTable.Create(cacheCurCtx.KVStore(key), groupsInfo) - s.Require().NoError(err) - - for i := 0; i < len(groupMembers); i++ { - err := groupMemberTable.Create(cacheCurCtx.KVStore(key), groupMembers[i]) - s.Require().NoError(err) - } - - _, broken := keeper.GroupTotalWeightInvariantHelper(cacheCurCtx, key, *groupTable, groupMemberByGroupIndex) - s.Require().Equal(spec.expBroken, broken) - - } -} diff --git a/x/group/keeper/keeper.go b/x/group/keeper/keeper.go index b888d11dcca8..4a79e7303348 100644 --- a/x/group/keeper/keeper.go +++ b/x/group/keeper/keeper.go @@ -4,12 +4,10 @@ import ( "fmt" "time" + errorsmod "cosmossdk.io/errors" "cosmossdk.io/log" - storetypes "cosmossdk.io/store/types" - errorsmod "cosmossdk.io/errors" - "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/group/keeper/keeper_test.go b/x/group/keeper/keeper_test.go index 5b06edba5b5e..f12d1d7186da 100644 --- a/x/group/keeper/keeper_test.go +++ b/x/group/keeper/keeper_test.go @@ -7,8 +7,8 @@ import ( "time" cmttime "github.com/cometbft/cometbft/types/time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" + "go.uber.org/mock/gomock" "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" diff --git a/x/group/keeper/msg_server.go b/x/group/keeper/msg_server.go index b60e29eaa4cf..6689cf573931 100644 --- a/x/group/keeper/msg_server.go +++ b/x/group/keeper/msg_server.go @@ -13,12 +13,11 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/group" "github.com/cosmos/cosmos-sdk/x/group/errors" "github.com/cosmos/cosmos-sdk/x/group/internal/math" "github.com/cosmos/cosmos-sdk/x/group/internal/orm" - - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" ) var _ group.MsgServer = Keeper{} @@ -201,6 +200,10 @@ func (k Keeper) UpdateGroupMembers(goCtx context.Context, msg *group.MsgUpdateGr return err } } + // ensure that group has one or more members + if totalWeight.IsZero() { + return errorsmod.Wrap(errors.ErrInvalid, "group must not be empty") + } // Update group in the groupTable. g.TotalWeight = totalWeight.String() g.Version++ @@ -430,6 +433,10 @@ func (k Keeper) UpdateGroupPolicyAdmin(goCtx context.Context, msg *group.MsgUpda return nil, errorsmod.Wrap(errors.ErrInvalid, "new and old admin are same") } + if _, err := k.accKeeper.AddressCodec().StringToBytes(msg.NewAdmin); err != nil { + return nil, errorsmod.Wrap(sdkerrors.ErrInvalidAddress, "new admin address") + } + ctx := sdk.UnwrapSDKContext(goCtx) action := func(groupPolicy *group.GroupPolicyInfo) error { groupPolicy.Admin = msg.NewAdmin @@ -522,7 +529,7 @@ func (k Keeper) SubmitProposal(goCtx context.Context, msg *group.MsgSubmitPropos return nil, err } - if err := k.assertMetadataLength(msg.Summary, "proposal summary"); err != nil { + if err := k.assertSummaryLength(msg.Summary); err != nil { return nil, err } @@ -774,33 +781,40 @@ func (k Keeper) Vote(goCtx context.Context, msg *group.MsgVote) (*group.MsgVoteR // doTallyAndUpdate performs a tally, and, if the tally result is final, then: // - updates the proposal's `Status` and `FinalTallyResult` fields, // - prune all the votes. -func (k Keeper) doTallyAndUpdate(ctx sdk.Context, p *group.Proposal, groupInfo group.GroupInfo, policyInfo group.GroupPolicyInfo) error { +func (k Keeper) doTallyAndUpdate(ctx sdk.Context, proposal *group.Proposal, groupInfo group.GroupInfo, policyInfo group.GroupPolicyInfo) error { policy, err := policyInfo.GetDecisionPolicy() if err != nil { return err } - tallyResult, err := k.Tally(ctx, *p, policyInfo.GroupId) - if err != nil { - return err + var result group.DecisionPolicyResult + tallyResult, err := k.Tally(ctx, *proposal, policyInfo.GroupId) + if err == nil { + result, err = policy.Allow(tallyResult, groupInfo.TotalWeight) } - - result, err := policy.Allow(tallyResult, groupInfo.TotalWeight) if err != nil { - return errorsmod.Wrap(err, "policy allow") + if err := k.pruneVotes(ctx, proposal.Id); err != nil { + return err + } + proposal.Status = group.PROPOSAL_STATUS_REJECTED + return ctx.EventManager().EmitTypedEvents( + &group.EventTallyError{ + ProposalId: proposal.Id, + ErrorMessage: err.Error(), + }) } // If the result was final (i.e. enough votes to pass) or if the voting // period ended, then we consider the proposal as final. - if isFinal := result.Final || ctx.BlockTime().After(p.VotingPeriodEnd); isFinal { - if err := k.pruneVotes(ctx, p.Id); err != nil { + if isFinal := result.Final || ctx.BlockTime().After(proposal.VotingPeriodEnd); isFinal { + if err := k.pruneVotes(ctx, proposal.Id); err != nil { return err } - p.FinalTallyResult = tallyResult + proposal.FinalTallyResult = tallyResult if result.Allow { - p.Status = group.PROPOSAL_STATUS_ACCEPTED + proposal.Status = group.PROPOSAL_STATUS_ACCEPTED } else { - p.Status = group.PROPOSAL_STATUS_REJECTED + proposal.Status = group.PROPOSAL_STATUS_REJECTED } } @@ -1063,6 +1077,15 @@ func (k Keeper) assertMetadataLength(metadata, description string) error { return nil } +// assertSummaryLength returns an error if given summary length +// is greater than a pre-defined 40*MaxMetadataLen. +func (k Keeper) assertSummaryLength(summary string) error { + if summary != "" && uint64(len(summary)) > 40*k.config.MaxMetadataLen { + return errorsmod.Wrapf(errors.ErrMaxLimit, "proposal summary is too long") + } + return nil +} + // validateDecisionPolicies loops through all decision policies from the group, // and calls each of their Validate() method. func (k Keeper) validateDecisionPolicies(ctx sdk.Context, g group.GroupInfo) error { @@ -1133,10 +1156,8 @@ func (k Keeper) validateMembers(members []group.MemberRequest) error { if _, err := math.NewNonNegativeDecFromString(member.Weight); err != nil { return errorsmod.Wrap(err, "weight must be non negative") } - index[member.Address] = struct{}{} } - return nil } diff --git a/x/group/keeper/msg_server_priv_test.go b/x/group/keeper/msg_server_priv_test.go new file mode 100644 index 000000000000..dd5c3e94644c --- /dev/null +++ b/x/group/keeper/msg_server_priv_test.go @@ -0,0 +1,254 @@ +package keeper + +import ( + "bytes" + "context" + "errors" + "fmt" + "testing" + "time" + + "github.com/cosmos/gogoproto/proto" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + coreaddress "cosmossdk.io/core/address" + storetypes "cosmossdk.io/store/types" + + "github.com/cosmos/cosmos-sdk/codec/address" + "github.com/cosmos/cosmos-sdk/testutil" + sdk "github.com/cosmos/cosmos-sdk/types" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" + "github.com/cosmos/cosmos-sdk/x/group" + "github.com/cosmos/cosmos-sdk/x/group/internal/math" +) + +func TestDoTallyAndUpdate(t *testing.T) { + var ( + myAddr = sdk.AccAddress(bytes.Repeat([]byte{0x01}, 20)) + myOtherAddr = sdk.AccAddress(bytes.Repeat([]byte{0x02}, 20)) + ) + encCfg := moduletestutil.MakeTestEncodingConfig() + group.RegisterInterfaces(encCfg.InterfaceRegistry) + + storeKey := storetypes.NewKVStoreKey(group.StoreKey) + testCtx := testutil.DefaultContextWithDB(t, storeKey, storetypes.NewTransientStoreKey("transient_test")) + myAccountKeeper := &mockAccountKeeper{ + AddressCodecFn: func() coreaddress.Codec { + return address.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()) + }, + } + groupKeeper := NewKeeper(storeKey, encCfg.Codec, nil, myAccountKeeper, group.DefaultConfig()) + noEventsFn := func(proposalID uint64) sdk.Events { return sdk.Events{} } + type memberVote struct { + address string + weight string + option group.VoteOption + } + specs := map[string]struct { + votes []memberVote + policy group.DecisionPolicy + expStatus group.ProposalStatus + expVotesCleared bool + expEvents func(proposalID uint64) sdk.Events + }{ + "proposal accepted": { + votes: []memberVote{ + {address: myAddr.String(), option: group.VOTE_OPTION_YES, weight: "2"}, + {address: myOtherAddr.String(), option: group.VOTE_OPTION_NO, weight: "1"}, + }, + policy: mockDecisionPolicy{ + AllowFn: func(tallyResult group.TallyResult, totalPower string) (group.DecisionPolicyResult, error) { + return group.DecisionPolicyResult{Allow: true, Final: true}, nil + }, + }, + expStatus: group.PROPOSAL_STATUS_ACCEPTED, + expVotesCleared: true, + expEvents: noEventsFn, + }, + "proposal rejected": { + votes: []memberVote{ + {address: myAddr.String(), option: group.VOTE_OPTION_YES, weight: "1"}, + {address: myOtherAddr.String(), option: group.VOTE_OPTION_NO, weight: "2"}, + }, + policy: mockDecisionPolicy{ + AllowFn: func(tallyResult group.TallyResult, totalPower string) (group.DecisionPolicyResult, error) { + return group.DecisionPolicyResult{Allow: false, Final: true}, nil + }, + }, + expStatus: group.PROPOSAL_STATUS_REJECTED, + expVotesCleared: true, + expEvents: noEventsFn, + }, + "proposal in flight": { + votes: []memberVote{ + {address: myAddr.String(), option: group.VOTE_OPTION_YES, weight: "1"}, + {address: myOtherAddr.String(), option: group.VOTE_OPTION_NO, weight: "1"}, + }, + policy: mockDecisionPolicy{ + AllowFn: func(tallyResult group.TallyResult, totalPower string) (group.DecisionPolicyResult, error) { + return group.DecisionPolicyResult{Allow: false, Final: false}, nil + }, + }, + expStatus: group.PROPOSAL_STATUS_SUBMITTED, + expVotesCleared: false, + expEvents: noEventsFn, + }, + "policy errors": { + votes: []memberVote{ + {address: myAddr.String(), option: group.VOTE_OPTION_YES, weight: "1"}, + {address: myOtherAddr.String(), option: group.VOTE_OPTION_NO, weight: "2"}, + }, + policy: mockDecisionPolicy{ + AllowFn: func(tallyResult group.TallyResult, totalPower string) (group.DecisionPolicyResult, error) { + return group.DecisionPolicyResult{}, errors.New("my test error") + }, + }, + expStatus: group.PROPOSAL_STATUS_REJECTED, + expVotesCleared: true, + expEvents: func(proposalID uint64) sdk.Events { + return sdk.Events{ + sdk.NewEvent("cosmos.group.v1.EventTallyError", + sdk.Attribute{Key: "error_message", Value: `"my test error"`}, + sdk.Attribute{Key: "proposal_id", Value: fmt.Sprintf(`"%d"`, proposalID)}, + ), + } + }, + }, + } + var ( + groupID uint64 + proposalId uint64 + ) + for name, spec := range specs { + groupID++ + proposalId++ + t.Run(name, func(t *testing.T) { + em := sdk.NewEventManager() + ctx := testCtx.Ctx.WithEventManager(em) + totalWeight, err := math.NewDecFromString("0") + require.NoError(t, err) + // given a group, policy and persisted votes + for _, v := range spec.votes { + err := groupKeeper.groupMemberTable.Create(ctx.KVStore(storeKey), &group.GroupMember{ + GroupId: groupID, + Member: &group.Member{Address: v.address, Weight: v.weight}, + }) + require.NoError(t, err) + err = groupKeeper.voteTable.Create(ctx.KVStore(storeKey), &group.Vote{ + ProposalId: proposalId, + Voter: v.address, + Option: v.option, + }) + require.NoError(t, err) + } + myGroupInfo := group.GroupInfo{ + TotalWeight: totalWeight.String(), + } + myPolicy := group.GroupPolicyInfo{GroupId: groupID} + err = myPolicy.SetDecisionPolicy(spec.policy) + require.NoError(t, err) + + myProposal := &group.Proposal{ + Id: proposalId, + Status: group.PROPOSAL_STATUS_SUBMITTED, + VotingPeriodEnd: ctx.BlockTime().Add(time.Hour), + } + + // when + gotErr := groupKeeper.doTallyAndUpdate(ctx, myProposal, myGroupInfo, myPolicy) + // then + require.NoError(t, gotErr) + assert.Equal(t, spec.expStatus, myProposal.Status) + require.Equal(t, spec.expEvents(proposalId), em.Events()) + // and persistent state updated + persistedVotes, err := groupKeeper.votesByProposal(ctx, groupID) + require.NoError(t, err) + if spec.expVotesCleared { + assert.Empty(t, persistedVotes) + } else { + assert.Len(t, persistedVotes, len(spec.votes)) + } + }) + } +} + +var _ group.AccountKeeper = &mockAccountKeeper{} + +// mockAccountKeeper is a mock implementation of the AccountKeeper interface for testing purposes. +type mockAccountKeeper struct { + AddressCodecFn func() coreaddress.Codec +} + +func (m mockAccountKeeper) AddressCodec() coreaddress.Codec { + if m.AddressCodecFn == nil { + panic("not expected to be called") + } + return m.AddressCodecFn() +} + +func (m mockAccountKeeper) NewAccount(ctx context.Context, i sdk.AccountI) sdk.AccountI { + panic("not expected to be called") +} + +func (m mockAccountKeeper) GetAccount(ctx context.Context, address sdk.AccAddress) sdk.AccountI { + panic("not expected to be called") +} + +func (m mockAccountKeeper) SetAccount(ctx context.Context, i sdk.AccountI) { + panic("not expected to be called") +} + +func (m mockAccountKeeper) RemoveAccount(ctx context.Context, acc sdk.AccountI) { + panic("not expected to be called") +} + +// mockDecisionPolicy is a mock implementation of a decision policy for testing purposes. +type mockDecisionPolicy struct { + fakeProtoType + AllowFn func(tallyResult group.TallyResult, totalPower string) (group.DecisionPolicyResult, error) +} + +func (m mockDecisionPolicy) Allow(tallyResult group.TallyResult, totalPower string) (group.DecisionPolicyResult, error) { + if m.AllowFn == nil { + panic("not expected to be called") + } + return m.AllowFn(tallyResult, totalPower) +} + +func (m mockDecisionPolicy) GetVotingPeriod() time.Duration { + panic("not expected to be called") +} + +func (m mockDecisionPolicy) GetMinExecutionPeriod() time.Duration { + panic("not expected to be called") +} + +func (m mockDecisionPolicy) ValidateBasic() error { + panic("not expected to be called") +} + +func (m mockDecisionPolicy) Validate(g group.GroupInfo, config group.Config) error { + panic("not expected to be called") +} + +var ( + _ proto.Marshaler = (*fakeProtoType)(nil) + _ proto.Message = (*fakeProtoType)(nil) +) + +// fakeProtoType is a struct used for mocking and testing purposes. +// Custom types can be converted into Any and back via internal CachedValue only. +type fakeProtoType struct{} + +func (a fakeProtoType) Reset() {} + +func (a fakeProtoType) String() string { + return "testing" +} + +func (a fakeProtoType) Marshal() ([]byte, error) { + return nil, nil +} + +func (a fakeProtoType) ProtoMessage() {} diff --git a/x/group/keeper/msg_server_test.go b/x/group/keeper/msg_server_test.go index 70e0e6809bd0..bd505306882d 100644 --- a/x/group/keeper/msg_server_test.go +++ b/x/group/keeper/msg_server_test.go @@ -8,9 +8,8 @@ import ( "strings" "time" - "github.com/golang/mock/gomock" - abci "github.com/cometbft/cometbft/abci/types" + "go.uber.org/mock/gomock" "github.com/cosmos/cosmos-sdk/codec/address" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" @@ -238,20 +237,13 @@ func (s *TestSuite) TestCreateGroup() { } func (s *TestSuite) TestUpdateGroupMembers() { - addrs := s.addrs - addr3 := addrs[2] - addr4 := addrs[3] - addr5 := addrs[4] - addr6 := addrs[5] - - member1 := addr5.String() - member2 := addr6.String() - members := []group.MemberRequest{{ - Address: member1, - Weight: "1", - }} + unknownAddr, myAdmin := s.addrs[0].String(), s.addrs[1].String() + member1, member2, member3 := s.addrs[2].String(), s.addrs[3].String(), s.addrs[4].String() + members := []group.MemberRequest{ + {Address: member1, Weight: "1"}, + {Address: member2, Weight: "2"}, + } - myAdmin := addr4.String() groupRes, err := s.groupKeeper.CreateGroup(s.ctx, &group.MsgCreateGroup{ Admin: myAdmin, Members: members, @@ -271,7 +263,7 @@ func (s *TestSuite) TestUpdateGroupMembers() { GroupId: 0, Admin: myAdmin, MemberUpdates: []group.MemberRequest{{ - Address: member2, + Address: member3, Weight: "2", }}, }, @@ -304,7 +296,7 @@ func (s *TestSuite) TestUpdateGroupMembers() { Admin: myAdmin, MemberUpdates: []group.MemberRequest{ { - Address: member2, + Address: member3, Weight: "2", Metadata: strings.Repeat("a", 256), }, @@ -315,90 +307,77 @@ func (s *TestSuite) TestUpdateGroupMembers() { }, "add new member": { req: &group.MsgUpdateGroupMembers{ - GroupId: groupID, - Admin: myAdmin, - MemberUpdates: []group.MemberRequest{{ - Address: member2, - Weight: "2", - }}, + GroupId: groupID, + Admin: myAdmin, + MemberUpdates: []group.MemberRequest{{Address: member3, Weight: "3"}}, }, expGroup: &group.GroupInfo{ Id: groupID, Admin: myAdmin, - TotalWeight: "3", + TotalWeight: "6", Version: 2, CreatedAt: s.blockTime, }, expMembers: []*group.GroupMember{ { - Member: &group.Member{ - Address: member2, - Weight: "2", - AddedAt: s.sdkCtx.BlockTime(), - }, + Member: &group.Member{Address: member3, Weight: "3", AddedAt: s.blockTime}, GroupId: groupID, }, { - Member: &group.Member{ - Address: member1, - Weight: "1", - AddedAt: s.blockTime, - }, + Member: &group.Member{Address: member1, Weight: "1", AddedAt: s.blockTime}, + GroupId: groupID, + }, + { + Member: &group.Member{Address: member2, Weight: "2", AddedAt: s.blockTime}, GroupId: groupID, }, }, }, "update member": { req: &group.MsgUpdateGroupMembers{ - GroupId: groupID, - Admin: myAdmin, - MemberUpdates: []group.MemberRequest{{ - Address: member1, - Weight: "2", - }}, + GroupId: groupID, + Admin: myAdmin, + MemberUpdates: []group.MemberRequest{{Address: member1, Weight: "2"}}, }, expGroup: &group.GroupInfo{ Id: groupID, Admin: myAdmin, - TotalWeight: "2", + TotalWeight: "4", Version: 2, CreatedAt: s.blockTime, }, expMembers: []*group.GroupMember{ { + Member: &group.Member{Address: member1, Weight: "2", AddedAt: s.blockTime}, + GroupId: groupID, + }, + { + Member: &group.Member{Address: member2, Weight: "2", AddedAt: s.blockTime}, GroupId: groupID, - Member: &group.Member{ - Address: member1, - Weight: "2", - AddedAt: s.blockTime, - }, }, }, }, "update member with same data": { req: &group.MsgUpdateGroupMembers{ - GroupId: groupID, - Admin: myAdmin, - MemberUpdates: []group.MemberRequest{{ - Address: member1, - Weight: "1", - }}, + GroupId: groupID, + Admin: myAdmin, + MemberUpdates: []group.MemberRequest{{Address: member1, Weight: "1"}}, }, expGroup: &group.GroupInfo{ Id: groupID, Admin: myAdmin, - TotalWeight: "1", + TotalWeight: "3", Version: 2, CreatedAt: s.blockTime, }, expMembers: []*group.GroupMember{ { GroupId: groupID, - Member: &group.Member{ - Address: member1, - Weight: "1", - AddedAt: s.blockTime, - }, + Member: &group.Member{Address: member1, Weight: "1", AddedAt: s.blockTime}, + }, + { + GroupId: groupID, + Member: &group.Member{Address: member2, Weight: "2", AddedAt: s.blockTime}, }, }, }, @@ -407,58 +386,51 @@ func (s *TestSuite) TestUpdateGroupMembers() { GroupId: groupID, Admin: myAdmin, MemberUpdates: []group.MemberRequest{ - { - Address: member1, - Weight: "0", - }, - { - Address: member2, - Weight: "1", - }, + {Address: member1, Weight: "0"}, + {Address: member3, Weight: "1"}, }, }, expGroup: &group.GroupInfo{ Id: groupID, Admin: myAdmin, - TotalWeight: "1", + TotalWeight: "3", Version: 2, CreatedAt: s.blockTime, }, - expMembers: []*group.GroupMember{{ - GroupId: groupID, - Member: &group.Member{ - Address: member2, - Weight: "1", - AddedAt: s.sdkCtx.BlockTime(), + expMembers: []*group.GroupMember{ + { + Member: &group.Member{Address: member3, Weight: "1", AddedAt: s.blockTime}, + GroupId: groupID, }, - }}, + { + Member: &group.Member{Address: member2, Weight: "2", AddedAt: s.blockTime}, + GroupId: groupID, + }}, }, "remove existing member": { req: &group.MsgUpdateGroupMembers{ - GroupId: groupID, - Admin: myAdmin, - MemberUpdates: []group.MemberRequest{{ - Address: member1, - Weight: "0", - }}, + GroupId: groupID, + Admin: myAdmin, + MemberUpdates: []group.MemberRequest{{Address: member1, Weight: "0"}}, }, expGroup: &group.GroupInfo{ Id: groupID, Admin: myAdmin, - TotalWeight: "0", + TotalWeight: "2", Version: 2, CreatedAt: s.blockTime, }, - expMembers: []*group.GroupMember{}, + expMembers: []*group.GroupMember{ + { + Member: &group.Member{Address: member2, Weight: "2", AddedAt: s.blockTime}, + GroupId: groupID, + }}, }, "remove unknown member": { req: &group.MsgUpdateGroupMembers{ - GroupId: groupID, - Admin: myAdmin, - MemberUpdates: []group.MemberRequest{{ - Address: addr4.String(), - Weight: "0", - }}, + GroupId: groupID, + Admin: myAdmin, + MemberUpdates: []group.MemberRequest{{Address: unknownAddr, Weight: "0"}}, }, expErr: true, expGroup: &group.GroupInfo{ @@ -468,66 +440,73 @@ func (s *TestSuite) TestUpdateGroupMembers() { Version: 1, CreatedAt: s.blockTime, }, - expMembers: []*group.GroupMember{{ - GroupId: groupID, - Member: &group.Member{ - Address: member1, - Weight: "1", - }, - }}, + expMembers: []*group.GroupMember{ + { + GroupId: groupID, + Member: &group.Member{Address: member1, Weight: "1"}, + }, { + Member: &group.Member{Address: member2, Weight: "2", AddedAt: s.blockTime}, + GroupId: groupID, + }}, }, "with wrong admin": { req: &group.MsgUpdateGroupMembers{ - GroupId: groupID, - Admin: addr3.String(), - MemberUpdates: []group.MemberRequest{{ - Address: member1, - Weight: "2", - }}, + GroupId: groupID, + Admin: unknownAddr, + MemberUpdates: []group.MemberRequest{{Address: member1, Weight: "2"}}, }, expErr: true, expErrMsg: "not group admin", expGroup: &group.GroupInfo{ Id: groupID, Admin: myAdmin, - TotalWeight: "1", + TotalWeight: "3", Version: 1, CreatedAt: s.blockTime, }, expMembers: []*group.GroupMember{{ GroupId: groupID, - Member: &group.Member{ - Address: member1, - Weight: "1", - }, + Member: &group.Member{Address: member1, Weight: "1"}, + }, { + Member: &group.Member{Address: member2, Weight: "2", AddedAt: s.blockTime}, + GroupId: groupID, }}, }, "with unknown groupID": { req: &group.MsgUpdateGroupMembers{ - GroupId: 999, - Admin: myAdmin, - MemberUpdates: []group.MemberRequest{{ - Address: member1, - Weight: "2", - }}, + GroupId: 999, + Admin: myAdmin, + MemberUpdates: []group.MemberRequest{{Address: member1, Weight: "2"}}, }, expErr: true, expErrMsg: "not found", expGroup: &group.GroupInfo{ Id: groupID, Admin: myAdmin, - TotalWeight: "1", + TotalWeight: "3", Version: 1, CreatedAt: s.blockTime, }, expMembers: []*group.GroupMember{{ GroupId: groupID, - Member: &group.Member{ - Address: member1, - Weight: "1", - }, + Member: &group.Member{Address: member1, Weight: "1"}, + }, { + Member: &group.Member{Address: member2, Weight: "2", AddedAt: s.blockTime}, + GroupId: groupID, }}, }, + "remove all members": { + req: &group.MsgUpdateGroupMembers{ + GroupId: groupID, + Admin: myAdmin, + MemberUpdates: []group.MemberRequest{ + {Address: member1, Weight: "0"}, + {Address: member2, Weight: "0"}, + }, + }, + expErr: true, + expErrMsg: "group must not be empty", + }, } for msg, spec := range specs { spec := spec @@ -662,6 +641,15 @@ func (s *TestSuite) TestUpdateGroupAdmin() { CreatedAt: s.blockTime, }, }, + "with invalid new admin address": { + req: &group.MsgUpdateGroupAdmin{ + GroupId: groupID, + Admin: oldAdmin, + NewAdmin: "%s", + }, + expErr: true, + expErrMsg: "new admin address", + }, } for msg, spec := range specs { spec := spec @@ -1216,6 +1204,23 @@ func (s *TestSuite) TestUpdateGroupPolicyAdmin() { }, expErr: false, }, + "with invalid new admin address": { + req: &group.MsgUpdateGroupPolicyAdmin{ + Admin: admin.String(), + GroupPolicyAddress: groupPolicyAddr, + NewAdmin: "%s", + }, + expGroupPolicy: &group.GroupPolicyInfo{ + Admin: admin.String(), + Address: groupPolicyAddr, + GroupId: myGroupID, + Version: 2, + DecisionPolicy: nil, + CreatedAt: s.blockTime, + }, + expErr: true, + expErrMsg: "new admin address", + }, } for msg, spec := range specs { spec := spec @@ -1743,6 +1748,17 @@ func (s *TestSuite) TestSubmitProposal() { expErrMsg: "limit exceeded", postRun: func(sdkCtx sdk.Context) {}, }, + "summary too long": { + req: &group.MsgSubmitProposal{ + GroupPolicyAddress: accountAddr.String(), + Proposers: []string{addr2.String()}, + Metadata: "{\"title\":\"title\",\"summary\":\"description\"}", + Summary: strings.Repeat("a", 256*40), + }, + expErr: true, + expErrMsg: "limit exceeded", + postRun: func(sdkCtx sdk.Context) {}, + }, "group policy required": { req: &group.MsgSubmitProposal{ Proposers: []string{addr2.String()}, diff --git a/x/group/keeper/proposal_executor.go b/x/group/keeper/proposal_executor.go index 8f2b9165f5aa..ecbda22ced12 100644 --- a/x/group/keeper/proposal_executor.go +++ b/x/group/keeper/proposal_executor.go @@ -76,7 +76,7 @@ func ensureMsgAuthZ(msgs []sdk.Msg, groupPolicyAcc sdk.AccAddress, cdc codec.Cod for _, acct := range signers { if !bytes.Equal(groupPolicyAcc, acct) { - return errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "msg does not have group policy authorization; expected %s, got %s", groupPolicyAcc.String(), acct) + return errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "msg does not have group policy authorization; expected %s, got %s", groupPolicyAcc.String(), sdk.AccAddress(acct).String()) } } } diff --git a/x/group/migrations/v2/migrate.go b/x/group/migrations/v2/migrate.go index a1fc4fcc1e27..550ae51802a3 100644 --- a/x/group/migrations/v2/migrate.go +++ b/x/group/migrations/v2/migrate.go @@ -48,8 +48,13 @@ func Migrate( } for _, policy := range groupPolicies { + addr, err := accountKeeper.AddressCodec().StringToBytes(policy.Address) + if err != nil { + return fmt.Errorf("failed to convert group policy account address: %w", err) + } + // get the account address by acc id - oldAcc := accountKeeper.GetAccount(ctx, sdk.MustAccAddressFromBech32(policy.Address)) + oldAcc := accountKeeper.GetAccount(ctx, addr) // remove the old account accountKeeper.RemoveAccount(ctx, oldAcc) diff --git a/x/group/migrations/v2/migrate_test.go b/x/group/migrations/v2/migrate_test.go index 169665ce9f12..66810076dd37 100644 --- a/x/group/migrations/v2/migrate_test.go +++ b/x/group/migrations/v2/migrate_test.go @@ -8,6 +8,7 @@ import ( storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" @@ -78,7 +79,7 @@ func createGroupPolicies(ctx sdk.Context, storeKey storetypes.StoreKey, cdc code // createOldPolicyAccount re-creates the group policy account using a module account func createOldPolicyAccount(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.Codec, policies []sdk.AccAddress) ([]*authtypes.ModuleAccount, group.AccountKeeper) { - accountKeeper := authkeeper.NewAccountKeeper(cdc, runtime.NewKVStoreService(storeKey.(*storetypes.KVStoreKey)), authtypes.ProtoBaseAccount, nil, sdk.Bech32MainPrefix, authorityAddr.String()) + accountKeeper := authkeeper.NewAccountKeeper(cdc, runtime.NewKVStoreService(storeKey.(*storetypes.KVStoreKey)), authtypes.ProtoBaseAccount, nil, addresscodec.NewBech32Codec(sdk.Bech32MainPrefix), sdk.Bech32MainPrefix, authorityAddr.String()) oldPolicyAccounts := make([]*authtypes.ModuleAccount, len(policies)) for i, policyAddr := range policies { diff --git a/x/group/module/abci_test.go b/x/group/module/abci_test.go index 136536b1a9dd..06cd5c883b63 100644 --- a/x/group/module/abci_test.go +++ b/x/group/module/abci_test.go @@ -5,14 +5,15 @@ import ( "testing" "time" - "cosmossdk.io/core/address" - "cosmossdk.io/depinject" - "cosmossdk.io/log" - cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" cmttime "github.com/cometbft/cometbft/types/time" "github.com/stretchr/testify/suite" + "cosmossdk.io/core/address" + "cosmossdk.io/depinject" + "cosmossdk.io/log" + "cosmossdk.io/math" + codecaddress "github.com/cosmos/cosmos-sdk/codec/address" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/runtime" @@ -65,7 +66,7 @@ func (s *IntegrationTestSuite) SetupTest() { s.ctx = ctx - s.addrs = simtestutil.AddTestAddrsIncremental(s.bankKeeper, s.stakingKeeper, ctx, 4, sdk.NewInt(30000000)) + s.addrs = simtestutil.AddTestAddrsIncremental(s.bankKeeper, s.stakingKeeper, ctx, 4, math.NewInt(30000000)) s.addressCodec = codecaddress.NewBech32Codec("cosmos") } diff --git a/x/group/module/autocli.go b/x/group/module/autocli.go new file mode 100644 index 000000000000..e51f310dfeed --- /dev/null +++ b/x/group/module/autocli.go @@ -0,0 +1,211 @@ +package module + +import ( + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + groupv1 "cosmossdk.io/api/cosmos/group/v1" +) + +// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. +func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { + return &autocliv1.ModuleOptions{ + Query: &autocliv1.ServiceCommandDescriptor{ + Service: groupv1.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "GroupInfo", + Use: "group-info [group-id]", + Short: "Query for group info by group id", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "group_id"}, + }, + }, + { + RpcMethod: "GroupPolicyInfo", + Use: "group-policy-info [group-policy-account]", + Short: "Query for group policy info by account address of group policy", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "address"}, + }, + }, + { + RpcMethod: "GroupMembers", + Use: "group-members [group-id]", + Short: "Query for group members by group id", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "group_id"}, + }, + }, + { + RpcMethod: "GroupsByAdmin", + Use: "groups-by-admin [admin]", + Short: "Query for groups by admin account address", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "admin"}, + }, + }, + { + RpcMethod: "GroupPoliciesByGroup", + Use: "group-policies-by-group [group-id]", + Short: "Query for group policies by group id", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "group_id"}, + }, + }, + { + RpcMethod: "GroupPoliciesByAdmin", + Use: "group-policies-by-admin [admin]", + Short: "Query for group policies by admin account address", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "admin"}, + }, + }, + { + RpcMethod: "Proposal", + Use: "proposal [proposal-id]", + Short: "Query for proposal by id", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "proposal_id"}, + }, + }, + { + RpcMethod: "ProposalsByGroupPolicy", + Use: "proposals-by-group-policy [group-policy-account]", + Short: "Query for proposals by account address of group policy", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "address"}, + }, + }, + { + RpcMethod: "VoteByProposalVoter", + Use: "vote [proposal-id] [voter]", + Short: "Query for vote by proposal id and voter account address", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "proposal_id"}, + {ProtoField: "voter"}, + }, + }, + { + RpcMethod: "VotesByProposal", + Use: "votes-by-proposal [proposal-id]", + Short: "Query for votes by proposal id", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "proposal_id"}, + }, + }, + { + RpcMethod: "VotesByVoter", + Use: "votes-by-voter [voter]", + Short: "Query for votes by voter account address", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "voter"}, + }, + }, + { + RpcMethod: "GroupsByMember", + Use: "groups-by-member [address]", + Short: "Query for groups by member address", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "address"}, + }, + }, + { + RpcMethod: "TallyResult", + Use: "tally-result [proposal-id]", + Short: "Query tally result of proposal", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "proposal_id"}, + }, + }, + { + RpcMethod: "Groups", + Use: "groups", + Short: "Query for all groups on chain", + }, + }, + }, + Tx: &autocliv1.ServiceCommandDescriptor{ + Service: groupv1.Msg_ServiceDesc.ServiceName, + EnhanceCustomCommand: false, // use custom commands only until v0.51 + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "UpdateGroupAdmin", + Use: "update-group-admin [admin] [group-id] [new-admin]", + Short: "Update a group's admin", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "admin"}, {ProtoField: "group_id"}, {ProtoField: "new_admin"}, + }, + }, + { + RpcMethod: "UpdateGroupMetadata", + Use: "update-group-metadata [admin] [group-id] [metadata]", + Short: "Update a group's metadata", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "admin"}, {ProtoField: "group_id"}, {ProtoField: "metadata"}, + }, + }, + { + RpcMethod: "UpdateGroupPolicyAdmin", + Use: "update-group-policy-admin [admin] [group-policy-account] [new-admin]", + Short: "Update a group policy admin", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "admin"}, {ProtoField: "group_policy_address"}, {ProtoField: "new_admin"}, + }, + }, + { + RpcMethod: "UpdateGroupPolicyMetadata", + Use: "update-group-policy-metadata [admin] [group-policy-account] [new-metadata]", + Short: "Update a group policy metadata", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "admin"}, {ProtoField: "group_policy_address"}, {ProtoField: "metadata"}, + }, + }, + { + RpcMethod: "WithdrawProposal", + Use: "withdraw-proposal [proposal-id] [group-policy-admin-or-proposer]", + Short: "Withdraw a submitted proposal", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "proposal_id"}, {ProtoField: "address"}, + }, + }, + { + RpcMethod: "Vote", + Use: "vote [proposal-id] [voter] [vote-option] [metadata]", + Long: `Vote on a proposal. +Parameters: + proposal-id: unique ID of the proposal + voter: voter account addresses. + vote-option: choice of the voter(s) + VOTE_OPTION_UNSPECIFIED: no-op + VOTE_OPTION_NO: no + VOTE_OPTION_YES: yes + VOTE_OPTION_ABSTAIN: abstain + VOTE_OPTION_NO_WITH_VETO: no-with-veto + Metadata: metadata for the vote +`, + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "proposal_id"}, {ProtoField: "voter"}, {ProtoField: "option"}, {ProtoField: "metadata"}, + }, + FlagOptions: map[string]*autocliv1.FlagOptions{ + "exec": {Name: "exec", DefaultValue: "", Usage: "Set to 'try' for trying to execute proposal immediately after voting"}, + }, + }, + { + RpcMethod: "Exec", + Use: "exec [proposal-id]", + Short: "Execute a proposal", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "proposal_id"}, + }, + }, + { + RpcMethod: "LeaveGroup", + Use: "leave-group [member-address] [group-id]", + Short: "Remove member from the group", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "address"}, {ProtoField: "group_id"}, + }, + }, + }, + }, + } +} diff --git a/x/group/module/module.go b/x/group/module/module.go index 026ff85ab802..ec84e762b332 100644 --- a/x/group/module/module.go +++ b/x/group/module/module.go @@ -5,7 +5,6 @@ import ( "encoding/json" "fmt" - abci "github.com/cometbft/cometbft/abci/types" gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" @@ -13,7 +12,6 @@ import ( "cosmossdk.io/core/address" "cosmossdk.io/core/appmodule" "cosmossdk.io/depinject" - store "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/baseapp" @@ -33,8 +31,14 @@ import ( const ConsensusVersion = 2 var ( - _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleBasic = AppModule{} _ module.AppModuleSimulation = AppModule{} + _ module.HasGenesis = AppModule{} + _ module.HasServices = AppModule{} + _ module.HasInvariants = AppModule{} + + _ appmodule.AppModule = AppModule{} + _ appmodule.HasEndBlocker = AppModule{} ) type AppModule struct { @@ -56,11 +60,6 @@ func NewAppModule(cdc codec.Codec, keeper keeper.Keeper, ak group.AccountKeeper, } } -var ( - _ appmodule.AppModule = AppModule{} - _ appmodule.HasEndBlocker = AppModule{} -) - // IsOnePerModuleType implements the depinject.OnePerModuleType interface. func (am AppModule) IsOnePerModuleType() {} @@ -92,11 +91,6 @@ func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config sdkclient.TxEn return data.Validate() } -// GetQueryCmd returns the cli query commands for the group module -func (a AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.QueryCmd(a.Name()) -} - // GetTxCmd returns the transaction commands for the group module func (a AppModuleBasic) GetTxCmd() *cobra.Command { return cli.TxCmd(a.Name(), a.ac) @@ -119,21 +113,13 @@ func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { group.RegisterLegacyAminoCodec(cdc) } -// Name returns the group module's name. -func (AppModule) Name() string { - return group.ModuleName -} - -// RegisterInvariants does nothing, there are no invariants to enforce -func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) { - keeper.RegisterInvariants(ir, am.keeper) -} +// RegisterInvariants is a no op and will be removed in the next Cosmos SDK release. +func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} // InitGenesis performs genesis initialization for the group module. It returns // no validator updates. -func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate { +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) { am.keeper.InitGenesis(ctx, cdc, data) - return []abci.ValidatorUpdate{} } // ExportGenesis returns the exported genesis state as raw bytes for the group diff --git a/x/group/msgs.go b/x/group/msgs.go index e8b58534923e..59793d79adb3 100644 --- a/x/group/msgs.go +++ b/x/group/msgs.go @@ -3,8 +3,6 @@ package group import ( "github.com/cosmos/gogoproto/proto" - errorsmod "cosmossdk.io/errors" - "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -34,49 +32,21 @@ var ( _ types.UnpackInterfacesMessage = MsgCreateGroupWithPolicy{} ) -// GetSigners returns the expected signers for a MsgCreateGroup. -func (m MsgCreateGroup) GetSigners() []sdk.AccAddress { - admin := sdk.MustAccAddressFromBech32(m.Admin) - - return []sdk.AccAddress{admin} -} - -// GetSigners returns the expected signers for a MsgUpdateGroupAdmin. -func (m MsgUpdateGroupAdmin) GetSigners() []sdk.AccAddress { - admin := sdk.MustAccAddressFromBech32(m.Admin) - - return []sdk.AccAddress{admin} -} - -// GetGroupID gets the group id of the MsgUpdateGroupAdmin. -func (m *MsgUpdateGroupAdmin) GetGroupID() uint64 { - return m.GroupId -} - -// GetSigners returns the expected signers for a MsgUpdateGroupMetadata. -func (m MsgUpdateGroupMetadata) GetSigners() []sdk.AccAddress { - admin := sdk.MustAccAddressFromBech32(m.Admin) - - return []sdk.AccAddress{admin} -} - // GetGroupID gets the group id of the MsgUpdateGroupMetadata. func (m *MsgUpdateGroupMetadata) GetGroupID() uint64 { return m.GroupId } -// GetSigners returns the expected signers for a MsgUpdateGroupMembers. -func (m MsgUpdateGroupMembers) GetSigners() []sdk.AccAddress { - admin := sdk.MustAccAddressFromBech32(m.Admin) - - return []sdk.AccAddress{admin} -} - // GetGroupID gets the group id of the MsgUpdateGroupMembers. func (m *MsgUpdateGroupMembers) GetGroupID() uint64 { return m.GroupId } +// GetGroupID gets the group id of the MsgUpdateGroupAdmin. +func (m *MsgUpdateGroupAdmin) GetGroupID() uint64 { + return m.GroupId +} + // NewMsgCreateGroupWithPolicy creates a new MsgCreateGroupWithPolicy. func NewMsgCreateGroupWithPolicy(admin string, members []MemberRequest, groupMetadata, groupPolicyMetadata string, groupPolicyAsAdmin bool, decisionPolicy DecisionPolicy) (*MsgCreateGroupWithPolicy, error) { m := &MsgCreateGroupWithPolicy{ @@ -118,25 +88,6 @@ func (m MsgCreateGroupWithPolicy) UnpackInterfaces(unpacker types.AnyUnpacker) e return unpacker.UnpackAny(m.DecisionPolicy, &decisionPolicy) } -// GetSigners returns the expected signers for a MsgCreateGroupWithPolicy. -func (m MsgCreateGroupWithPolicy) GetSigners() []sdk.AccAddress { - admin := sdk.MustAccAddressFromBech32(m.Admin) - return []sdk.AccAddress{admin} -} - -// GetSigners returns the expected signers for a MsgCreateGroupPolicy. -func (m MsgCreateGroupPolicy) GetSigners() []sdk.AccAddress { - admin := sdk.MustAccAddressFromBech32(m.Admin) - return []sdk.AccAddress{admin} -} - -// GetSigners returns the expected signers for a MsgUpdateGroupPolicyAdmin. -func (m MsgUpdateGroupPolicyAdmin) GetSigners() []sdk.AccAddress { - admin := sdk.MustAccAddressFromBech32(m.Admin) - - return []sdk.AccAddress{admin} -} - // NewMsgUpdateGroupPolicyDecisionPolicy creates a new MsgUpdateGroupPolicyDecisionPolicy. func NewMsgUpdateGroupPolicyDecisionPolicy(admin, address sdk.AccAddress, decisionPolicy DecisionPolicy) (*MsgUpdateGroupPolicyDecisionPolicy, error) { m := &MsgUpdateGroupPolicyDecisionPolicy{ @@ -164,13 +115,6 @@ func (m *MsgUpdateGroupPolicyDecisionPolicy) SetDecisionPolicy(decisionPolicy De return nil } -// GetSigners returns the expected signers for a MsgUpdateGroupPolicyDecisionPolicy. -func (m MsgUpdateGroupPolicyDecisionPolicy) GetSigners() []sdk.AccAddress { - admin := sdk.MustAccAddressFromBech32(m.Admin) - - return []sdk.AccAddress{admin} -} - // GetDecisionPolicy gets the decision policy of MsgUpdateGroupPolicyDecisionPolicy. func (m *MsgUpdateGroupPolicyDecisionPolicy) GetDecisionPolicy() (DecisionPolicy, error) { decisionPolicy, ok := m.DecisionPolicy.GetCachedValue().(DecisionPolicy) @@ -187,13 +131,6 @@ func (m MsgUpdateGroupPolicyDecisionPolicy) UnpackInterfaces(unpacker types.AnyU return unpacker.UnpackAny(m.DecisionPolicy, &decisionPolicy) } -// GetSigners returns the expected signers for a MsgUpdateGroupPolicyMetadata. -func (m MsgUpdateGroupPolicyMetadata) GetSigners() []sdk.AccAddress { - admin := sdk.MustAccAddressFromBech32(m.Admin) - - return []sdk.AccAddress{admin} -} - // NewMsgCreateGroupPolicy creates a new MsgCreateGroupPolicy. func NewMsgCreateGroupPolicy(admin sdk.AccAddress, group uint64, metadata string, decisionPolicy DecisionPolicy) (*MsgCreateGroupPolicy, error) { m := &MsgCreateGroupPolicy{ @@ -265,30 +202,6 @@ func NewMsgSubmitProposal(address string, proposers []string, msgs []sdk.Msg, me return m, nil } -// GetSigners returns the expected signers for a MsgSubmitProposal. -func (m MsgSubmitProposal) GetSigners() []sdk.AccAddress { - addrs, err := m.getProposerAccAddresses() - if err != nil { - panic(err) - } - - return addrs -} - -// getProposerAccAddresses returns the proposers as `[]sdk.AccAddress`. -func (m *MsgSubmitProposal) getProposerAccAddresses() ([]sdk.AccAddress, error) { - addrs := make([]sdk.AccAddress, len(m.Proposers)) - for i, proposer := range m.Proposers { - addr, err := sdk.AccAddressFromBech32(proposer) - if err != nil { - return nil, errorsmod.Wrap(err, "proposers") - } - addrs[i] = addr - } - - return addrs, nil -} - // SetMsgs packs msgs into Any's func (m *MsgSubmitProposal) SetMsgs(msgs []sdk.Msg) error { anys, err := tx.SetMsgs(msgs) @@ -308,31 +221,3 @@ func (m MsgSubmitProposal) GetMsgs() ([]sdk.Msg, error) { func (m MsgSubmitProposal) UnpackInterfaces(unpacker types.AnyUnpacker) error { return tx.UnpackInterfaces(unpacker, m.Messages) } - -// GetSigners returns the expected signers for a MsgWithdrawProposal. -func (m MsgWithdrawProposal) GetSigners() []sdk.AccAddress { - admin := sdk.MustAccAddressFromBech32(m.Address) - - return []sdk.AccAddress{admin} -} - -// GetSigners returns the expected signers for a MsgVote. -func (m MsgVote) GetSigners() []sdk.AccAddress { - addr := sdk.MustAccAddressFromBech32(m.Voter) - - return []sdk.AccAddress{addr} -} - -// GetSigners returns the expected signers for a MsgExec. -func (m MsgExec) GetSigners() []sdk.AccAddress { - signer := sdk.MustAccAddressFromBech32(m.Executor) - - return []sdk.AccAddress{signer} -} - -// GetSigners returns the expected signers for a MsgLeaveGroup -func (m MsgLeaveGroup) GetSigners() []sdk.AccAddress { - signer := sdk.MustAccAddressFromBech32(m.Address) - - return []sdk.AccAddress{signer} -} diff --git a/x/group/query.pb.go b/x/group/query.pb.go index 6e3d0733340f..6cbdf25bc9df 100644 --- a/x/group/query.pb.go +++ b/x/group/query.pb.go @@ -2128,6 +2128,7 @@ func _Query_Groups_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.group.v1.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/group/simulation/genesis.go b/x/group/simulation/genesis.go index e9396e3f1658..d5273b97bb0d 100644 --- a/x/group/simulation/genesis.go +++ b/x/group/simulation/genesis.go @@ -9,7 +9,6 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/cosmos/cosmos-sdk/x/group" ) diff --git a/x/group/simulation/genesis_test.go b/x/group/simulation/genesis_test.go index 58cc6c09b5b3..1ca2be16fb7f 100644 --- a/x/group/simulation/genesis_test.go +++ b/x/group/simulation/genesis_test.go @@ -8,6 +8,7 @@ import ( "github.com/stretchr/testify/require" sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/types/module" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" diff --git a/x/group/simulation/operations.go b/x/group/simulation/operations.go index edb87acfd061..e7ec1911e56b 100644 --- a/x/group/simulation/operations.go +++ b/x/group/simulation/operations.go @@ -14,10 +14,9 @@ import ( simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/group" "github.com/cosmos/cosmos-sdk/x/group/keeper" "github.com/cosmos/cosmos-sdk/x/simulation" - - "github.com/cosmos/cosmos-sdk/x/group" ) var initialGroupID = uint64(100000000000000) @@ -630,7 +629,7 @@ func SimulateMsgUpdateGroupMembers( // set existing random group member weight to zero to remove from the group existigMembers := res.Members - if len(existigMembers) > 0 { + if len(existigMembers) > 1 { memberToRemove := existigMembers[r.Intn(len(existigMembers))] var isDuplicateMember bool for idx, m := range members { @@ -1230,8 +1229,9 @@ func randomGroup(r *rand.Rand, k keeper.Keeper, ak group.AccountKeeper, switch { case groupID > initialGroupID: - // select a random ID between [initialGroupID, groupID] - groupID = uint64(simtypes.RandIntBetween(r, int(initialGroupID), int(groupID))) + // select a random ID between (initialGroupID, groupID] + // if there is at least one group information, then the groupID at this time must be greater than or equal to 1 + groupID = uint64(simtypes.RandIntBetween(r, int(initialGroupID+1), int(groupID+1))) default: // This is called on the first call to this function @@ -1239,6 +1239,11 @@ func randomGroup(r *rand.Rand, k keeper.Keeper, ak group.AccountKeeper, initialGroupID = groupID } + // when groupID is 0, it proves that SimulateMsgCreateGroup has never been called. that is, no group exists in the chain + if groupID == 0 { + return nil, simtypes.Account{}, nil, nil + } + res, err := k.GroupInfo(ctx, &group.QueryGroupInfoRequest{GroupId: groupID}) if err != nil { return nil, simtypes.Account{}, nil, err diff --git a/x/group/simulation/operations_test.go b/x/group/simulation/operations_test.go index a247869f106b..b00039145b85 100644 --- a/x/group/simulation/operations_test.go +++ b/x/group/simulation/operations_test.go @@ -5,12 +5,13 @@ import ( "testing" "time" - "cosmossdk.io/depinject" - "cosmossdk.io/log" abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/gogoproto/proto" "github.com/stretchr/testify/suite" + "cosmossdk.io/depinject" + "cosmossdk.io/log" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" diff --git a/x/group/testutil/app_config.go b/x/group/testutil/app_config.go index 26a3ad0c7d13..a9dc1f950c37 100644 --- a/x/group/testutil/app_config.go +++ b/x/group/testutil/app_config.go @@ -2,7 +2,6 @@ package testutil import ( "github.com/cosmos/cosmos-sdk/testutil/configurator" - _ "github.com/cosmos/cosmos-sdk/x/auth" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/auth/tx/config" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/authz" // import as blank for app wiring diff --git a/x/group/testutil/expected_keepers_mocks.go b/x/group/testutil/expected_keepers_mocks.go index 75d4c12f92ba..df360d03d7ef 100644 --- a/x/group/testutil/expected_keepers_mocks.go +++ b/x/group/testutil/expected_keepers_mocks.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: x/group/testutil/expected_keepers.go +// +// Generated by this command: +// +// mockgen -source=x/group/testutil/expected_keepers.go -package testutil -destination x/group/testutil/expected_keepers_mocks.go +// // Package testutil is a generated GoMock package. package testutil @@ -11,13 +16,14 @@ import ( address "cosmossdk.io/core/address" types "github.com/cosmos/cosmos-sdk/types" types0 "github.com/cosmos/cosmos-sdk/x/bank/types" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockAccountKeeper is a mock of AccountKeeper interface. type MockAccountKeeper struct { ctrl *gomock.Controller recorder *MockAccountKeeperMockRecorder + isgomock struct{} } // MockAccountKeeperMockRecorder is the mock recorder for MockAccountKeeper. @@ -60,7 +66,7 @@ func (m *MockAccountKeeper) GetAccount(arg0 context.Context, arg1 types.AccAddre } // GetAccount indicates an expected call of GetAccount. -func (mr *MockAccountKeeperMockRecorder) GetAccount(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) GetAccount(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetAccount), arg0, arg1) } @@ -74,7 +80,7 @@ func (m *MockAccountKeeper) NewAccount(arg0 context.Context, arg1 types.AccountI } // NewAccount indicates an expected call of NewAccount. -func (mr *MockAccountKeeperMockRecorder) NewAccount(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) NewAccount(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewAccount", reflect.TypeOf((*MockAccountKeeper)(nil).NewAccount), arg0, arg1) } @@ -86,7 +92,7 @@ func (m *MockAccountKeeper) RemoveAccount(ctx context.Context, acc types.Account } // RemoveAccount indicates an expected call of RemoveAccount. -func (mr *MockAccountKeeperMockRecorder) RemoveAccount(ctx, acc interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) RemoveAccount(ctx, acc any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveAccount", reflect.TypeOf((*MockAccountKeeper)(nil).RemoveAccount), ctx, acc) } @@ -98,7 +104,7 @@ func (m *MockAccountKeeper) SetAccount(arg0 context.Context, arg1 types.AccountI } // SetAccount indicates an expected call of SetAccount. -func (mr *MockAccountKeeperMockRecorder) SetAccount(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) SetAccount(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetAccount", reflect.TypeOf((*MockAccountKeeper)(nil).SetAccount), arg0, arg1) } @@ -107,6 +113,7 @@ func (mr *MockAccountKeeperMockRecorder) SetAccount(arg0, arg1 interface{}) *gom type MockBankKeeper struct { ctrl *gomock.Controller recorder *MockBankKeeperMockRecorder + isgomock struct{} } // MockBankKeeperMockRecorder is the mock recorder for MockBankKeeper. @@ -135,7 +142,7 @@ func (m *MockBankKeeper) GetAllBalances(ctx context.Context, addr types.AccAddre } // GetAllBalances indicates an expected call of GetAllBalances. -func (mr *MockBankKeeperMockRecorder) GetAllBalances(ctx, addr interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) GetAllBalances(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllBalances", reflect.TypeOf((*MockBankKeeper)(nil).GetAllBalances), ctx, addr) } @@ -149,7 +156,7 @@ func (m *MockBankKeeper) MintCoins(ctx context.Context, moduleName string, amt t } // MintCoins indicates an expected call of MintCoins. -func (mr *MockBankKeeperMockRecorder) MintCoins(ctx, moduleName, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) MintCoins(ctx, moduleName, amt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MintCoins", reflect.TypeOf((*MockBankKeeper)(nil).MintCoins), ctx, moduleName, amt) } @@ -164,7 +171,7 @@ func (m *MockBankKeeper) MultiSend(arg0 context.Context, arg1 *types0.MsgMultiSe } // MultiSend indicates an expected call of MultiSend. -func (mr *MockBankKeeperMockRecorder) MultiSend(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) MultiSend(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MultiSend", reflect.TypeOf((*MockBankKeeper)(nil).MultiSend), arg0, arg1) } @@ -179,7 +186,7 @@ func (m *MockBankKeeper) Send(arg0 context.Context, arg1 *types0.MsgSend) (*type } // Send indicates an expected call of Send. -func (mr *MockBankKeeperMockRecorder) Send(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) Send(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockBankKeeper)(nil).Send), arg0, arg1) } @@ -193,7 +200,7 @@ func (m *MockBankKeeper) SendCoinsFromModuleToAccount(ctx context.Context, sende } // SendCoinsFromModuleToAccount indicates an expected call of SendCoinsFromModuleToAccount. -func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToAccount(ctx, senderModule, recipientAddr, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToAccount(ctx, senderModule, recipientAddr, amt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromModuleToAccount", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromModuleToAccount), ctx, senderModule, recipientAddr, amt) } @@ -208,7 +215,7 @@ func (m *MockBankKeeper) SetSendEnabled(arg0 context.Context, arg1 *types0.MsgSe } // SetSendEnabled indicates an expected call of SetSendEnabled. -func (mr *MockBankKeeperMockRecorder) SetSendEnabled(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SetSendEnabled(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetSendEnabled", reflect.TypeOf((*MockBankKeeper)(nil).SetSendEnabled), arg0, arg1) } @@ -222,7 +229,7 @@ func (m *MockBankKeeper) SpendableCoins(ctx context.Context, addr types.AccAddre } // SpendableCoins indicates an expected call of SpendableCoins. -func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SpendableCoins", reflect.TypeOf((*MockBankKeeper)(nil).SpendableCoins), ctx, addr) } @@ -237,7 +244,7 @@ func (m *MockBankKeeper) UpdateParams(arg0 context.Context, arg1 *types0.MsgUpda } // UpdateParams indicates an expected call of UpdateParams. -func (mr *MockBankKeeperMockRecorder) UpdateParams(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) UpdateParams(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateParams", reflect.TypeOf((*MockBankKeeper)(nil).UpdateParams), arg0, arg1) } diff --git a/x/group/tx.pb.go b/x/group/tx.pb.go index 51cd22261fd8..4f1ac1b94ca7 100644 --- a/x/group/tx.pb.go +++ b/x/group/tx.pb.go @@ -2109,6 +2109,7 @@ func _Msg_LeaveGroup_Handler(srv interface{}, ctx context.Context, dec func(inte return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.group.v1.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/group/types.go b/x/group/types.go index 529b5be66d24..4c498b1b1b7b 100644 --- a/x/group/types.go +++ b/x/group/types.go @@ -209,7 +209,9 @@ func (p PercentageDecisionPolicy) Allow(tally TallyResult, totalPower string) (D if err != nil { return DecisionPolicyResult{}, errorsmod.Wrap(err, "total power") } - + if totalPowerDec.IsZero() { + return DecisionPolicyResult{Allow: false, Final: true}, nil + } yesPercentage, err := yesCount.Quo(totalPowerDec) if err != nil { return DecisionPolicyResult{}, err diff --git a/x/group/types_test.go b/x/group/types_test.go index afad812a39d5..c69bb2f5ce0a 100644 --- a/x/group/types_test.go +++ b/x/group/types_test.go @@ -239,6 +239,28 @@ func TestPercentageDecisionPolicyAllow(t *testing.T) { }, false, }, + { + "empty total power", + &group.PercentageDecisionPolicy{ + Percentage: "0.5", + Windows: &group.DecisionPolicyWindows{ + VotingPeriod: time.Second * 100, + }, + }, + &group.TallyResult{ + YesCount: "1", + NoCount: "0", + AbstainCount: "0", + NoWithVetoCount: "0", + }, + "0", + time.Second * 50, + group.DecisionPolicyResult{ + Allow: false, + Final: true, + }, + false, + }, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { diff --git a/x/mint/README.md b/x/mint/README.md index 900615bbabb3..80198010dcb0 100644 --- a/x/mint/README.md +++ b/x/mint/README.md @@ -39,11 +39,11 @@ which should help provide some liquidity. It can be broken down in the following way: -* If the inflation rate is below the goal %-bonded the inflation rate will +* If the actual percentage of bonded tokens is below the goal %-bonded the inflation rate will increase until a maximum value is reached * If the goal % bonded (67% in Cosmos-Hub) is maintained, then the inflation rate will stay constant -* If the inflation rate is above the goal %-bonded the inflation rate will +* If the actual percentage of bonded tokens is above the goal %-bonded the inflation rate will decrease until a minimum value is reached @@ -61,7 +61,7 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/mint/v1beta1/ ### Params -The mint module stores it's params in state with the prefix of `0x01`, +The mint module stores its params in state with the prefix of `0x01`, it can be updated with governance or the address with authority. * Params: `mint/params -> legacy_amino(params)` @@ -91,7 +91,7 @@ type InflationCalculationFn func(ctx sdk.Context, minter Minter, params Params, The target annual inflation rate is recalculated each block. The inflation is also subject to a rate change (positive or negative) depending on the distance from the desired ratio (67%). The maximum rate change -possible is defined to be 13% per year, however the annual inflation is capped +possible is defined to be 13% per year, however, the annual inflation is capped as between 7% and 20%. ```go @@ -169,7 +169,7 @@ A user can query and interact with the `mint` module using the CLI. #### Query -The `query` commands allow users to query `mint` state. +The `query` commands allows users to query `mint` state. ```shell simd query mint --help @@ -177,7 +177,7 @@ simd query mint --help ##### annual-provisions -The `annual-provisions` command allow users to query the current minting annual provisions value +The `annual-provisions` command allows users to query the current minting annual provisions value ```shell simd query mint annual-provisions [flags] @@ -197,7 +197,7 @@ Example Output: ##### inflation -The `inflation` command allow users to query the current minting inflation value +The `inflation` command allows users to query the current minting inflation value ```shell simd query mint inflation [flags] @@ -217,7 +217,7 @@ Example Output: ##### params -The `params` command allow users to query the current minting parameters +The `params` command allows users to query the current minting parameters ```shell simd query mint params [flags] @@ -240,7 +240,7 @@ A user can query the `mint` module using gRPC endpoints. #### AnnualProvisions -The `AnnualProvisions` endpoint allow users to query the current minting annual provisions value +The `AnnualProvisions` endpoint allows users to query the current minting annual provisions value ```shell /cosmos.mint.v1beta1.Query/AnnualProvisions @@ -262,7 +262,7 @@ Example Output: #### Inflation -The `Inflation` endpoint allow users to query the current minting inflation value +The `Inflation` endpoint allows users to query the current minting inflation value ```shell /cosmos.mint.v1beta1.Query/Inflation @@ -284,7 +284,7 @@ Example Output: #### Params -The `Params` endpoint allow users to query the current minting parameters +The `Params` endpoint allows users to query the current minting parameters ```shell /cosmos.mint.v1beta1.Query/Params diff --git a/x/mint/abci.go b/x/mint/abci.go index 2e4b699971a1..e9108d3ee88d 100644 --- a/x/mint/abci.go +++ b/x/mint/abci.go @@ -2,7 +2,6 @@ package mint import ( "context" - "time" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" @@ -12,7 +11,7 @@ import ( // BeginBlocker mints new tokens for the previous block. func BeginBlocker(ctx context.Context, k keeper.Keeper, ic types.InflationCalculationFn) error { - defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) + defer telemetry.ModuleMeasureSince(types.ModuleName, telemetry.Now(), telemetry.MetricKeyBeginBlocker) // fetch stored minter & params minter, err := k.Minter.Get(ctx) @@ -26,12 +25,19 @@ func BeginBlocker(ctx context.Context, k keeper.Keeper, ic types.InflationCalcul } // recalculate inflation rate - totalStakingSupply := k.StakingTokenSupply(ctx) - bondedRatio := k.BondedRatio(ctx) + totalStakingSupply, err := k.StakingTokenSupply(ctx) + if err != nil { + return err + } + + bondedRatio, err := k.BondedRatio(ctx) + if err != nil { + return err + } + minter.Inflation = ic(ctx, minter, params, bondedRatio) minter.AnnualProvisions = minter.NextAnnualProvisions(params, totalStakingSupply) - err = k.Minter.Set(ctx, minter) - if err != nil { + if err = k.Minter.Set(ctx, minter); err != nil { return err } diff --git a/x/mint/autocli.go b/x/mint/autocli.go new file mode 100644 index 000000000000..8ac35d04b6c8 --- /dev/null +++ b/x/mint/autocli.go @@ -0,0 +1,40 @@ +package mint + +import ( + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + mintv1beta1 "cosmossdk.io/api/cosmos/mint/v1beta1" +) + +func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { + return &autocliv1.ModuleOptions{ + Query: &autocliv1.ServiceCommandDescriptor{ + Service: mintv1beta1.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Params", + Use: "params", + Short: "Query the current minting parameters", + }, + { + RpcMethod: "Inflation", + Use: "inflation", + Short: "Query the current minting inflation value", + }, + { + RpcMethod: "AnnualProvisions", + Use: "annual-provisions", + Short: "Query the current minting annual provisions value", + }, + }, + }, + Tx: &autocliv1.ServiceCommandDescriptor{ + Service: mintv1beta1.Msg_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "UpdateParams", + Skip: true, // skipped because authority gated + }, + }, + }, + } +} diff --git a/x/mint/client/cli/query.go b/x/mint/client/cli/query.go deleted file mode 100644 index 6bf31ba5a179..000000000000 --- a/x/mint/client/cli/query.go +++ /dev/null @@ -1,117 +0,0 @@ -package cli - -import ( - "fmt" - - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/x/mint/types" -) - -// GetQueryCmd returns the cli query commands for the minting module. -func GetQueryCmd() *cobra.Command { - mintingQueryCmd := &cobra.Command{ - Use: types.ModuleName, - Short: "Querying commands for the minting module", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - mintingQueryCmd.AddCommand( - GetCmdQueryParams(), - GetCmdQueryInflation(), - GetCmdQueryAnnualProvisions(), - ) - - return mintingQueryCmd -} - -// GetCmdQueryParams implements a command to return the current minting -// parameters. -func GetCmdQueryParams() *cobra.Command { - cmd := &cobra.Command{ - Use: "params", - Short: "Query the current minting parameters", - Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryParamsRequest{} - res, err := queryClient.Params(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(&res.Params) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetCmdQueryInflation implements a command to return the current minting -// inflation value. -func GetCmdQueryInflation() *cobra.Command { - cmd := &cobra.Command{ - Use: "inflation", - Short: "Query the current minting inflation value", - Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryInflationRequest{} - res, err := queryClient.Inflation(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintString(fmt.Sprintf("%s\n", res.Inflation)) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetCmdQueryAnnualProvisions implements a command to return the current minting -// annual provisions value. -func GetCmdQueryAnnualProvisions() *cobra.Command { - cmd := &cobra.Command{ - Use: "annual-provisions", - Short: "Query the current minting annual provisions value", - Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryAnnualProvisionsRequest{} - res, err := queryClient.AnnualProvisions(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintString(fmt.Sprintf("%s\n", res.AnnualProvisions)) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/mint/client/cli/query_test.go b/x/mint/client/cli/query_test.go deleted file mode 100644 index 9bb4199fe293..000000000000 --- a/x/mint/client/cli/query_test.go +++ /dev/null @@ -1,207 +0,0 @@ -package cli_test - -import ( - "context" - "fmt" - "io" - "strings" - "testing" - - rpcclientmock "github.com/cometbft/cometbft/rpc/client/mock" - "github.com/stretchr/testify/require" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - - "github.com/cosmos/cosmos-sdk/crypto/keyring" - testutilmod "github.com/cosmos/cosmos-sdk/types/module/testutil" - "github.com/cosmos/cosmos-sdk/x/mint" - mintcli "github.com/cosmos/cosmos-sdk/x/mint/client/cli" -) - -func TestGetCmdQueryParams(t *testing.T) { - encCfg := testutilmod.MakeTestEncodingConfig(mint.AppModuleBasic{}) - kr := keyring.NewInMemory(encCfg.Codec) - baseCtx := client.Context{}. - WithKeyring(kr). - WithTxConfig(encCfg.TxConfig). - WithCodec(encCfg.Codec). - WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}). - WithAccountRetriever(client.MockAccountRetriever{}). - WithOutput(io.Discard). - WithChainID("test-chain") - - cmd := mintcli.GetCmdQueryParams() - - testCases := []struct { - name string - flagArgs []string - expCmdOutput string - expectedOutput string - }{ - { - "json output", - []string{fmt.Sprintf("--%s=1", flags.FlagHeight), fmt.Sprintf("--%s=json", flags.FlagOutput)}, - `[--height=1 --output=json]`, - `{"mint_denom":"","inflation_rate_change":"0","inflation_max":"0","inflation_min":"0","goal_bonded":"0","blocks_per_year":"0"}`, - }, - { - "text output", - []string{fmt.Sprintf("--%s=1", flags.FlagHeight), fmt.Sprintf("--%s=text", flags.FlagOutput)}, - `[--height=1 --output=text]`, - `blocks_per_year: "0" -goal_bonded: "0" -inflation_max: "0" -inflation_min: "0" -inflation_rate_change: "0" -mint_denom: ""`, - }, - } - - for _, tc := range testCases { - tc := tc - - t.Run(tc.name, func(t *testing.T) { - ctx := svrcmd.CreateExecuteContext(context.Background()) - - cmd.SetOut(io.Discard) - require.NotNil(t, cmd) - - cmd.SetContext(ctx) - cmd.SetArgs(tc.flagArgs) - - require.NoError(t, client.SetCmdClientContextHandler(baseCtx, cmd)) - - if len(tc.flagArgs) != 0 { - require.Contains(t, fmt.Sprint(cmd), "params [] [] Query the current minting parameters") - require.Contains(t, fmt.Sprint(cmd), tc.expCmdOutput) - } - - out, err := clitestutil.ExecTestCLICmd(baseCtx, cmd, tc.flagArgs) - require.NoError(t, err) - require.Equal(t, tc.expectedOutput, strings.TrimSpace(out.String())) - }) - } -} - -func TestGetCmdQueryInflation(t *testing.T) { - encCfg := testutilmod.MakeTestEncodingConfig(mint.AppModuleBasic{}) - kr := keyring.NewInMemory(encCfg.Codec) - baseCtx := client.Context{}. - WithKeyring(kr). - WithTxConfig(encCfg.TxConfig). - WithCodec(encCfg.Codec). - WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}). - WithAccountRetriever(client.MockAccountRetriever{}). - WithOutput(io.Discard). - WithChainID("test-chain") - - cmd := mintcli.GetCmdQueryInflation() - - testCases := []struct { - name string - flagArgs []string - expCmdOutput string - expectedOutput string - }{ - { - "json output", - []string{fmt.Sprintf("--%s=1", flags.FlagHeight), fmt.Sprintf("--%s=json", flags.FlagOutput)}, - `[--height=1 --output=json]`, - ``, - }, - { - "text output", - []string{fmt.Sprintf("--%s=1", flags.FlagHeight), fmt.Sprintf("--%s=text", flags.FlagOutput)}, - `[--height=1 --output=text]`, - ``, - }, - } - - for _, tc := range testCases { - tc := tc - - t.Run(tc.name, func(t *testing.T) { - ctx := svrcmd.CreateExecuteContext(context.Background()) - - cmd.SetOut(io.Discard) - require.NotNil(t, cmd) - - cmd.SetContext(ctx) - cmd.SetArgs(tc.flagArgs) - - require.NoError(t, client.SetCmdClientContextHandler(baseCtx, cmd)) - - if len(tc.flagArgs) != 0 { - require.Contains(t, fmt.Sprint(cmd), "inflation [] [] Query the current minting inflation value") - require.Contains(t, fmt.Sprint(cmd), tc.expCmdOutput) - } - - out, err := clitestutil.ExecTestCLICmd(baseCtx, cmd, tc.flagArgs) - require.NoError(t, err) - require.Equal(t, tc.expectedOutput, strings.TrimSpace(out.String())) - }) - } -} - -func TestGetCmdQueryAnnualProvisions(t *testing.T) { - encCfg := testutilmod.MakeTestEncodingConfig(mint.AppModuleBasic{}) - kr := keyring.NewInMemory(encCfg.Codec) - baseCtx := client.Context{}. - WithKeyring(kr). - WithTxConfig(encCfg.TxConfig). - WithCodec(encCfg.Codec). - WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}). - WithAccountRetriever(client.MockAccountRetriever{}). - WithOutput(io.Discard). - WithChainID("test-chain") - - cmd := mintcli.GetCmdQueryAnnualProvisions() - - testCases := []struct { - name string - flagArgs []string - expCmdOutput string - expectedOutput string - }{ - { - "json output", - []string{fmt.Sprintf("--%s=1", flags.FlagHeight), fmt.Sprintf("--%s=json", flags.FlagOutput)}, - `[--height=1 --output=json]`, - ``, - }, - { - "text output", - []string{fmt.Sprintf("--%s=1", flags.FlagHeight), fmt.Sprintf("--%s=text", flags.FlagOutput)}, - `[--height=1 --output=text]`, - ``, - }, - } - - for _, tc := range testCases { - tc := tc - - t.Run(tc.name, func(t *testing.T) { - ctx := svrcmd.CreateExecuteContext(context.Background()) - - cmd.SetOut(io.Discard) - require.NotNil(t, cmd) - - cmd.SetContext(ctx) - cmd.SetArgs(tc.flagArgs) - - require.NoError(t, client.SetCmdClientContextHandler(baseCtx, cmd)) - - if len(tc.flagArgs) != 0 { - require.Contains(t, fmt.Sprint(cmd), "annual-provisions [] [] Query the current minting annual provisions value") - require.Contains(t, fmt.Sprint(cmd), tc.expCmdOutput) - } - - out, err := clitestutil.ExecTestCLICmd(baseCtx, cmd, tc.flagArgs) - require.NoError(t, err) - require.Equal(t, tc.expectedOutput, strings.TrimSpace(out.String())) - }) - } -} diff --git a/x/mint/keeper/genesis_test.go b/x/mint/keeper/genesis_test.go index d919926232f9..fe1d91edd36d 100644 --- a/x/mint/keeper/genesis_test.go +++ b/x/mint/keeper/genesis_test.go @@ -3,11 +3,11 @@ package keeper_test import ( "testing" - "cosmossdk.io/collections" - "cosmossdk.io/math" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" + "go.uber.org/mock/gomock" + "cosmossdk.io/collections" + "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" diff --git a/x/mint/keeper/grpc_query.go b/x/mint/keeper/grpc_query.go index eb29d8c3ff75..07ad05fabc95 100644 --- a/x/mint/keeper/grpc_query.go +++ b/x/mint/keeper/grpc_query.go @@ -3,7 +3,6 @@ package keeper import ( "context" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/mint/types" ) @@ -18,8 +17,7 @@ type queryServer struct { } // Params returns params of the mint module. -func (q queryServer) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { - ctx := sdk.UnwrapSDKContext(c) +func (q queryServer) Params(ctx context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { params, err := q.k.Params.Get(ctx) if err != nil { return nil, err @@ -29,8 +27,7 @@ func (q queryServer) Params(c context.Context, _ *types.QueryParamsRequest) (*ty } // Inflation returns minter.Inflation of the mint module. -func (q queryServer) Inflation(c context.Context, _ *types.QueryInflationRequest) (*types.QueryInflationResponse, error) { - ctx := sdk.UnwrapSDKContext(c) +func (q queryServer) Inflation(ctx context.Context, _ *types.QueryInflationRequest) (*types.QueryInflationResponse, error) { minter, err := q.k.Minter.Get(ctx) if err != nil { return nil, err @@ -40,8 +37,7 @@ func (q queryServer) Inflation(c context.Context, _ *types.QueryInflationRequest } // AnnualProvisions returns minter.AnnualProvisions of the mint module. -func (q queryServer) AnnualProvisions(c context.Context, _ *types.QueryAnnualProvisionsRequest) (*types.QueryAnnualProvisionsResponse, error) { - ctx := sdk.UnwrapSDKContext(c) +func (q queryServer) AnnualProvisions(ctx context.Context, _ *types.QueryAnnualProvisionsRequest) (*types.QueryAnnualProvisionsResponse, error) { minter, err := q.k.Minter.Get(ctx) if err != nil { return nil, err diff --git a/x/mint/keeper/grpc_query_test.go b/x/mint/keeper/grpc_query_test.go index 35905fc4fe02..65ac012a1a57 100644 --- a/x/mint/keeper/grpc_query_test.go +++ b/x/mint/keeper/grpc_query_test.go @@ -4,8 +4,8 @@ import ( gocontext "context" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" + "go.uber.org/mock/gomock" storetypes "cosmossdk.io/store/types" diff --git a/x/mint/keeper/keeper.go b/x/mint/keeper/keeper.go index 0eceb52ab50e..3fc2d68e62d3 100644 --- a/x/mint/keeper/keeper.go +++ b/x/mint/keeper/keeper.go @@ -5,11 +5,10 @@ import ( "fmt" "cosmossdk.io/collections" + storetypes "cosmossdk.io/core/store" "cosmossdk.io/log" "cosmossdk.io/math" - storetypes "cosmossdk.io/core/store" - "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/mint/types" @@ -80,16 +79,14 @@ func (k Keeper) Logger(ctx context.Context) log.Logger { // StakingTokenSupply implements an alias call to the underlying staking keeper's // StakingTokenSupply to be used in BeginBlocker. -func (k Keeper) StakingTokenSupply(ctx context.Context) math.Int { - sdkCtx := sdk.UnwrapSDKContext(ctx) - return k.stakingKeeper.StakingTokenSupply(sdkCtx) +func (k Keeper) StakingTokenSupply(ctx context.Context) (math.Int, error) { + return k.stakingKeeper.StakingTokenSupply(ctx) } // BondedRatio implements an alias call to the underlying staking keeper's // BondedRatio to be used in BeginBlocker. -func (k Keeper) BondedRatio(ctx context.Context) math.LegacyDec { - sdkCtx := sdk.UnwrapSDKContext(ctx) - return k.stakingKeeper.BondedRatio(sdkCtx) +func (k Keeper) BondedRatio(ctx context.Context) (math.LegacyDec, error) { + return k.stakingKeeper.BondedRatio(ctx) } // MintCoins implements an alias call to the underlying supply keeper's diff --git a/x/mint/keeper/keeper_test.go b/x/mint/keeper/keeper_test.go index 9cc7eb37d20c..1c2d653d8c16 100644 --- a/x/mint/keeper/keeper_test.go +++ b/x/mint/keeper/keeper_test.go @@ -3,8 +3,8 @@ package keeper_test import ( "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" + "go.uber.org/mock/gomock" "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" @@ -74,12 +74,16 @@ func (s *IntegrationTestSuite) SetupTest() { func (s *IntegrationTestSuite) TestAliasFunctions() { stakingTokenSupply := math.NewIntFromUint64(100000000000) - s.stakingKeeper.EXPECT().StakingTokenSupply(s.ctx).Return(stakingTokenSupply) - s.Require().Equal(s.mintKeeper.StakingTokenSupply(s.ctx), stakingTokenSupply) + s.stakingKeeper.EXPECT().StakingTokenSupply(s.ctx).Return(stakingTokenSupply, nil) + tokenSupply, err := s.mintKeeper.StakingTokenSupply(s.ctx) + s.Require().NoError(err) + s.Require().Equal(tokenSupply, stakingTokenSupply) bondedRatio := math.LegacyNewDecWithPrec(15, 2) - s.stakingKeeper.EXPECT().BondedRatio(s.ctx).Return(bondedRatio) - s.Require().Equal(s.mintKeeper.BondedRatio(s.ctx), bondedRatio) + s.stakingKeeper.EXPECT().BondedRatio(s.ctx).Return(bondedRatio, nil) + ratio, err := s.mintKeeper.BondedRatio(s.ctx) + s.Require().NoError(err) + s.Require().Equal(ratio, bondedRatio) coins := sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(1000000))) s.bankKeeper.EXPECT().MintCoins(s.ctx, types.ModuleName, coins).Return(nil) diff --git a/x/mint/keeper/msg_server.go b/x/mint/keeper/msg_server.go index 43fe1b758a65..4fdde2080f25 100644 --- a/x/mint/keeper/msg_server.go +++ b/x/mint/keeper/msg_server.go @@ -5,7 +5,6 @@ import ( "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/mint/types" ) @@ -25,7 +24,7 @@ func NewMsgServerImpl(k Keeper) types.MsgServer { } // UpdateParams updates the params. -func (ms msgServer) UpdateParams(goCtx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { +func (ms msgServer) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { if ms.authority != msg.Authority { return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.authority, msg.Authority) } @@ -34,7 +33,6 @@ func (ms msgServer) UpdateParams(goCtx context.Context, msg *types.MsgUpdatePara return nil, err } - ctx := sdk.UnwrapSDKContext(goCtx) if err := ms.Params.Set(ctx, msg.Params); err != nil { return nil, err } diff --git a/x/mint/module.go b/x/mint/module.go index 8c7515202cd3..7d10342d966f 100644 --- a/x/mint/module.go +++ b/x/mint/module.go @@ -5,16 +5,12 @@ import ( "encoding/json" "fmt" - abci "github.com/cometbft/cometbft/abci/types" gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" modulev1 "cosmossdk.io/api/cosmos/mint/module/v1" "cosmossdk.io/core/appmodule" - - "cosmossdk.io/depinject" - "cosmossdk.io/core/store" + "cosmossdk.io/depinject" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" @@ -24,7 +20,6 @@ import ( simtypes "github.com/cosmos/cosmos-sdk/types/simulation" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/cosmos/cosmos-sdk/x/mint/client/cli" "github.com/cosmos/cosmos-sdk/x/mint/exported" "github.com/cosmos/cosmos-sdk/x/mint/keeper" "github.com/cosmos/cosmos-sdk/x/mint/simulation" @@ -35,8 +30,13 @@ import ( const ConsensusVersion = 2 var ( - _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleBasic = AppModule{} _ module.AppModuleSimulation = AppModule{} + _ module.HasGenesis = AppModule{} + _ module.HasServices = AppModule{} + + _ appmodule.AppModule = AppModule{} + _ appmodule.HasBeginBlocker = AppModule{} ) // AppModuleBasic defines the basic application module used by the mint module. @@ -44,8 +44,6 @@ type AppModuleBasic struct { cdc codec.Codec } -var _ module.AppModuleBasic = AppModuleBasic{} - // Name returns the mint module's name. func (AppModuleBasic) Name() string { return types.ModuleName @@ -84,14 +82,6 @@ func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *g } } -// GetTxCmd returns no root tx command for the mint module. -func (AppModuleBasic) GetTxCmd() *cobra.Command { return nil } - -// GetQueryCmd returns the root query command for the mint module. -func (AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd() -} - // AppModule implements an application module for the mint module. type AppModule struct { AppModuleBasic @@ -129,22 +119,12 @@ func NewAppModule( } } -var ( - _ appmodule.AppModule = AppModule{} - _ appmodule.HasBeginBlocker = AppModule{} -) - // IsOnePerModuleType implements the depinject.OnePerModuleType interface. func (am AppModule) IsOnePerModuleType() {} // IsAppModule implements the appmodule.AppModule interface. func (am AppModule) IsAppModule() {} -// Name returns the mint module's name. -func (AppModule) Name() string { - return types.ModuleName -} - // RegisterServices registers a gRPC query service to respond to the // module-specific gRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { @@ -160,12 +140,11 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { // InitGenesis performs genesis initialization for the mint module. It returns // no validator updates. -func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate { +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) { var genesisState types.GenesisState cdc.MustUnmarshalJSON(data, &genesisState) am.keeper.InitGenesis(ctx, am.authKeeper, &genesisState) - return []abci.ValidatorUpdate{} } // ExportGenesis returns the exported genesis state as raw bytes for the mint diff --git a/x/mint/module_test.go b/x/mint/module_test.go index b573f4aa98c0..6ae3df35a925 100644 --- a/x/mint/module_test.go +++ b/x/mint/module_test.go @@ -3,9 +3,10 @@ package mint_test import ( "testing" + "github.com/stretchr/testify/require" + "cosmossdk.io/depinject" "cosmossdk.io/log" - "github.com/stretchr/testify/require" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" diff --git a/x/mint/simulation/genesis_test.go b/x/mint/simulation/genesis_test.go index c1938012bbe2..a923a6845db7 100644 --- a/x/mint/simulation/genesis_test.go +++ b/x/mint/simulation/genesis_test.go @@ -8,6 +8,7 @@ import ( "github.com/stretchr/testify/require" "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" diff --git a/x/mint/simulation/proposals_test.go b/x/mint/simulation/proposals_test.go index 0dc21ac2b3c6..83bda1f0dec5 100644 --- a/x/mint/simulation/proposals_test.go +++ b/x/mint/simulation/proposals_test.go @@ -4,10 +4,11 @@ import ( "math/rand" "testing" - sdkmath "cosmossdk.io/math" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "gotest.tools/v3/assert" + sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/address" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" diff --git a/x/mint/testutil/expected_keepers_mocks.go b/x/mint/testutil/expected_keepers_mocks.go index 723e1effb1dc..c0d89d611e41 100644 --- a/x/mint/testutil/expected_keepers_mocks.go +++ b/x/mint/testutil/expected_keepers_mocks.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: x/mint/types/expected_keepers.go +// +// Generated by this command: +// +// mockgen -source=x/mint/types/expected_keepers.go -package testutil -destination x/mint/testutil/expected_keepers_mocks.go +// // Package testutil is a generated GoMock package. package testutil @@ -10,13 +15,14 @@ import ( math "cosmossdk.io/math" types "github.com/cosmos/cosmos-sdk/types" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockStakingKeeper is a mock of StakingKeeper interface. type MockStakingKeeper struct { ctrl *gomock.Controller recorder *MockStakingKeeperMockRecorder + isgomock struct{} } // MockStakingKeeperMockRecorder is the mock recorder for MockStakingKeeper. @@ -37,29 +43,31 @@ func (m *MockStakingKeeper) EXPECT() *MockStakingKeeperMockRecorder { } // BondedRatio mocks base method. -func (m *MockStakingKeeper) BondedRatio(ctx types.Context) math.LegacyDec { +func (m *MockStakingKeeper) BondedRatio(ctx context.Context) (math.LegacyDec, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "BondedRatio", ctx) ret0, _ := ret[0].(math.LegacyDec) - return ret0 + ret1, _ := ret[1].(error) + return ret0, ret1 } // BondedRatio indicates an expected call of BondedRatio. -func (mr *MockStakingKeeperMockRecorder) BondedRatio(ctx interface{}) *gomock.Call { +func (mr *MockStakingKeeperMockRecorder) BondedRatio(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BondedRatio", reflect.TypeOf((*MockStakingKeeper)(nil).BondedRatio), ctx) } // StakingTokenSupply mocks base method. -func (m *MockStakingKeeper) StakingTokenSupply(ctx types.Context) math.Int { +func (m *MockStakingKeeper) StakingTokenSupply(ctx context.Context) (math.Int, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "StakingTokenSupply", ctx) ret0, _ := ret[0].(math.Int) - return ret0 + ret1, _ := ret[1].(error) + return ret0, ret1 } // StakingTokenSupply indicates an expected call of StakingTokenSupply. -func (mr *MockStakingKeeperMockRecorder) StakingTokenSupply(ctx interface{}) *gomock.Call { +func (mr *MockStakingKeeperMockRecorder) StakingTokenSupply(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StakingTokenSupply", reflect.TypeOf((*MockStakingKeeper)(nil).StakingTokenSupply), ctx) } @@ -68,6 +76,7 @@ func (mr *MockStakingKeeperMockRecorder) StakingTokenSupply(ctx interface{}) *go type MockAccountKeeper struct { ctrl *gomock.Controller recorder *MockAccountKeeperMockRecorder + isgomock struct{} } // MockAccountKeeperMockRecorder is the mock recorder for MockAccountKeeper. @@ -96,7 +105,7 @@ func (m *MockAccountKeeper) GetModuleAccount(ctx context.Context, moduleName str } // GetModuleAccount indicates an expected call of GetModuleAccount. -func (mr *MockAccountKeeperMockRecorder) GetModuleAccount(ctx, moduleName interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) GetModuleAccount(ctx, moduleName any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAccount), ctx, moduleName) } @@ -110,7 +119,7 @@ func (m *MockAccountKeeper) GetModuleAddress(name string) types.AccAddress { } // GetModuleAddress indicates an expected call of GetModuleAddress. -func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(name interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(name any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAddress", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAddress), name) } @@ -122,7 +131,7 @@ func (m *MockAccountKeeper) SetModuleAccount(arg0 context.Context, arg1 types.Mo } // SetModuleAccount indicates an expected call of SetModuleAccount. -func (mr *MockAccountKeeperMockRecorder) SetModuleAccount(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) SetModuleAccount(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetModuleAccount", reflect.TypeOf((*MockAccountKeeper)(nil).SetModuleAccount), arg0, arg1) } @@ -131,6 +140,7 @@ func (mr *MockAccountKeeperMockRecorder) SetModuleAccount(arg0, arg1 interface{} type MockBankKeeper struct { ctrl *gomock.Controller recorder *MockBankKeeperMockRecorder + isgomock struct{} } // MockBankKeeperMockRecorder is the mock recorder for MockBankKeeper. @@ -159,7 +169,7 @@ func (m *MockBankKeeper) MintCoins(ctx context.Context, name string, amt types.C } // MintCoins indicates an expected call of MintCoins. -func (mr *MockBankKeeperMockRecorder) MintCoins(ctx, name, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) MintCoins(ctx, name, amt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MintCoins", reflect.TypeOf((*MockBankKeeper)(nil).MintCoins), ctx, name, amt) } @@ -173,7 +183,7 @@ func (m *MockBankKeeper) SendCoinsFromModuleToAccount(ctx context.Context, sende } // SendCoinsFromModuleToAccount indicates an expected call of SendCoinsFromModuleToAccount. -func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToAccount(ctx, senderModule, recipientAddr, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToAccount(ctx, senderModule, recipientAddr, amt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromModuleToAccount", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromModuleToAccount), ctx, senderModule, recipientAddr, amt) } @@ -187,7 +197,7 @@ func (m *MockBankKeeper) SendCoinsFromModuleToModule(ctx context.Context, sender } // SendCoinsFromModuleToModule indicates an expected call of SendCoinsFromModuleToModule. -func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToModule(ctx, senderModule, recipientModule, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToModule(ctx, senderModule, recipientModule, amt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromModuleToModule", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromModuleToModule), ctx, senderModule, recipientModule, amt) } diff --git a/x/mint/types/expected_keepers.go b/x/mint/types/expected_keepers.go index 1b04abfa9f3a..82edcc6a2092 100644 --- a/x/mint/types/expected_keepers.go +++ b/x/mint/types/expected_keepers.go @@ -10,8 +10,8 @@ import ( // StakingKeeper defines the expected staking keeper type StakingKeeper interface { - StakingTokenSupply(ctx sdk.Context) math.Int - BondedRatio(ctx sdk.Context) math.LegacyDec + StakingTokenSupply(ctx context.Context) (math.Int, error) + BondedRatio(ctx context.Context) (math.LegacyDec, error) } // AccountKeeper defines the contract required for account APIs. diff --git a/x/mint/types/mint.pb.go b/x/mint/types/mint.pb.go index 63f5537f64fb..708073628246 100644 --- a/x/mint/types/mint.pb.go +++ b/x/mint/types/mint.pb.go @@ -4,9 +4,9 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-proto" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" @@ -29,9 +29,9 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Minter represents the minting state. type Minter struct { // current annual inflation rate - Inflation github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=inflation,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"inflation"` + Inflation cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=inflation,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"inflation"` // current annual expected provisions - AnnualProvisions github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=annual_provisions,json=annualProvisions,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"annual_provisions"` + AnnualProvisions cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=annual_provisions,json=annualProvisions,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"annual_provisions"` } func (m *Minter) Reset() { *m = Minter{} } @@ -72,13 +72,13 @@ type Params struct { // type of coin to mint MintDenom string `protobuf:"bytes,1,opt,name=mint_denom,json=mintDenom,proto3" json:"mint_denom,omitempty"` // maximum annual change in inflation rate - InflationRateChange github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=inflation_rate_change,json=inflationRateChange,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"inflation_rate_change"` + InflationRateChange cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=inflation_rate_change,json=inflationRateChange,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"inflation_rate_change"` // maximum inflation rate - InflationMax github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=inflation_max,json=inflationMax,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"inflation_max"` + InflationMax cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=inflation_max,json=inflationMax,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"inflation_max"` // minimum inflation rate - InflationMin github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=inflation_min,json=inflationMin,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"inflation_min"` + InflationMin cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=inflation_min,json=inflationMin,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"inflation_min"` // goal of percent bonded atoms - GoalBonded github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=goal_bonded,json=goalBonded,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"goal_bonded"` + GoalBonded cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=goal_bonded,json=goalBonded,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"goal_bonded"` // expected blocks per year BlocksPerYear uint64 `protobuf:"varint,6,opt,name=blocks_per_year,json=blocksPerYear,proto3" json:"blocks_per_year,omitempty"` } @@ -138,34 +138,35 @@ func init() { func init() { proto.RegisterFile("cosmos/mint/v1beta1/mint.proto", fileDescriptor_2df116d183c1e223) } var fileDescriptor_2df116d183c1e223 = []byte{ - // 423 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x93, 0x4f, 0x8f, 0xd2, 0x40, - 0x18, 0xc6, 0x3b, 0x8a, 0x4d, 0x18, 0xdd, 0xe8, 0xce, 0x6a, 0x52, 0x37, 0xd9, 0xee, 0x66, 0x0f, - 0x04, 0x49, 0x68, 0x43, 0xbc, 0x19, 0x2f, 0x02, 0x57, 0x12, 0xd2, 0x9b, 0x5c, 0x9a, 0x69, 0x3b, - 0x94, 0x09, 0xed, 0x0c, 0x99, 0x19, 0x08, 0x7c, 0x05, 0x4f, 0x5e, 0xfd, 0x06, 0x1e, 0x39, 0xf8, - 0x21, 0xb8, 0x49, 0x3c, 0x19, 0x0f, 0xc4, 0xc0, 0x81, 0xaf, 0x61, 0x3a, 0xd3, 0x14, 0xe3, 0xc1, - 0x8b, 0x78, 0xe9, 0x9f, 0xe7, 0x79, 0xfb, 0x7b, 0x9e, 0x36, 0x7d, 0xa1, 0x1b, 0x73, 0x99, 0x73, - 0xe9, 0xe7, 0x94, 0x29, 0x7f, 0xd1, 0x89, 0x88, 0xc2, 0x1d, 0x7d, 0xe3, 0xcd, 0x04, 0x57, 0x1c, - 0x5d, 0x19, 0xdf, 0xd3, 0x52, 0xe9, 0x5f, 0x3f, 0x4f, 0x79, 0xca, 0xb5, 0xef, 0x17, 0x57, 0x66, - 0xf4, 0xfa, 0xa5, 0x19, 0x0d, 0x8d, 0x51, 0x3e, 0x67, 0xac, 0x4b, 0x9c, 0x53, 0xc6, 0x7d, 0x7d, - 0x34, 0xd2, 0xfd, 0x57, 0x00, 0xed, 0x01, 0x65, 0x8a, 0x08, 0x34, 0x82, 0x75, 0xca, 0xc6, 0x19, - 0x56, 0x94, 0x33, 0x07, 0xdc, 0x81, 0x66, 0xbd, 0xfb, 0x76, 0xb3, 0xbb, 0xb5, 0x7e, 0xec, 0x6e, - 0x1b, 0x29, 0x55, 0x93, 0x79, 0xe4, 0xc5, 0x3c, 0x2f, 0x89, 0xe5, 0xa9, 0x2d, 0x93, 0xa9, 0xaf, - 0x56, 0x33, 0x22, 0xbd, 0x3e, 0x89, 0xbf, 0x7d, 0x69, 0xc3, 0x32, 0xb0, 0x4f, 0xe2, 0xe0, 0x84, - 0x43, 0x14, 0x5e, 0x62, 0xc6, 0xe6, 0x38, 0x2b, 0x6a, 0x2d, 0xa8, 0xa4, 0x9c, 0x49, 0xe7, 0xc1, - 0x19, 0x32, 0x9e, 0x19, 0xec, 0xb0, 0xa2, 0xde, 0x7f, 0xaa, 0x41, 0x7b, 0x88, 0x05, 0xce, 0x25, - 0xba, 0x81, 0xb0, 0xf8, 0x60, 0x61, 0x42, 0x18, 0xcf, 0xcd, 0x2b, 0x05, 0xf5, 0x42, 0xe9, 0x17, - 0x02, 0x9a, 0xc3, 0x17, 0x55, 0xc3, 0x50, 0x60, 0x45, 0xc2, 0x78, 0x82, 0x59, 0x4a, 0xca, 0x62, - 0xef, 0xfe, 0xa5, 0xd8, 0xe7, 0xe3, 0xba, 0x05, 0x82, 0xab, 0x8a, 0x1f, 0x60, 0x45, 0x7a, 0x9a, - 0x8e, 0xc6, 0xf0, 0xe2, 0x14, 0x9b, 0xe3, 0xa5, 0xf3, 0xf0, 0x5c, 0x71, 0x4f, 0x2a, 0xee, 0x00, - 0x2f, 0xff, 0xc8, 0xa1, 0xcc, 0xa9, 0xfd, 0x87, 0x1c, 0xca, 0x50, 0x04, 0x1f, 0xa7, 0x1c, 0x67, - 0x61, 0xc4, 0x59, 0x42, 0x12, 0xe7, 0xd1, 0xb9, 0x52, 0x60, 0x41, 0xed, 0x6a, 0x28, 0x6a, 0xc0, - 0xa7, 0x51, 0xc6, 0xe3, 0xa9, 0x0c, 0x67, 0x44, 0x84, 0x2b, 0x82, 0x85, 0x63, 0xdf, 0x81, 0x66, - 0x2d, 0xb8, 0x30, 0xf2, 0x90, 0x88, 0xf7, 0x04, 0x8b, 0x37, 0x37, 0x1f, 0x8e, 0xeb, 0x96, 0xf3, - 0x5b, 0xc2, 0xd2, 0xac, 0x94, 0xf9, 0x21, 0xba, 0xbd, 0xcd, 0xde, 0x05, 0xdb, 0xbd, 0x0b, 0x7e, - 0xee, 0x5d, 0xf0, 0xf1, 0xe0, 0x5a, 0xdb, 0x83, 0x6b, 0x7d, 0x3f, 0xb8, 0xd6, 0xe8, 0xd5, 0x5f, - 0x7b, 0x96, 0x14, 0x5d, 0x37, 0xb2, 0xf5, 0xe6, 0xbc, 0xfe, 0x15, 0x00, 0x00, 0xff, 0xff, 0xe5, - 0xf6, 0x61, 0x3e, 0xb4, 0x03, 0x00, 0x00, + // 436 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x93, 0xb1, 0x8e, 0xd3, 0x30, + 0x18, 0xc7, 0x63, 0xee, 0x88, 0x54, 0xc3, 0x09, 0xce, 0x07, 0x52, 0x38, 0x74, 0xb9, 0xd3, 0x0d, + 0xe8, 0x38, 0xe9, 0x12, 0x55, 0x48, 0x0c, 0x8c, 0xbd, 0x8e, 0x9c, 0xa8, 0xb2, 0x20, 0x40, 0x22, + 0xfa, 0x92, 0x98, 0xd4, 0x34, 0xb6, 0x2b, 0xdb, 0x57, 0xb5, 0xaf, 0xc0, 0xc4, 0x63, 0x30, 0x76, + 0x60, 0xe1, 0x0d, 0x3a, 0x56, 0x4c, 0x88, 0xa1, 0x42, 0xed, 0xd0, 0x89, 0x77, 0x40, 0x89, 0xa3, + 0x54, 0x82, 0x09, 0xca, 0x12, 0xc5, 0xff, 0xff, 0xe7, 0xdf, 0xf7, 0x97, 0xfd, 0x19, 0xfb, 0xa9, + 0xd4, 0x5c, 0xea, 0x90, 0x33, 0x61, 0xc2, 0x51, 0x3b, 0xa1, 0x06, 0xda, 0xd5, 0x22, 0x18, 0x2a, + 0x69, 0x24, 0x39, 0xb0, 0x7e, 0x50, 0x49, 0xb5, 0x7f, 0x78, 0x2f, 0x97, 0xb9, 0xac, 0xfc, 0xb0, + 0xfc, 0xb3, 0xa5, 0x87, 0x0f, 0x6c, 0x69, 0x6c, 0x8d, 0x7a, 0x9f, 0xb5, 0xf6, 0x81, 0x33, 0x21, + 0xc3, 0xea, 0x6b, 0xa5, 0xd3, 0x2f, 0x08, 0xbb, 0x57, 0x4c, 0x18, 0xaa, 0xc8, 0x0b, 0xdc, 0x62, + 0xe2, 0x5d, 0x01, 0x86, 0x49, 0xe1, 0xa1, 0x13, 0x74, 0xd6, 0xea, 0xb4, 0x67, 0x8b, 0x63, 0xe7, + 0xfb, 0xe2, 0xf8, 0xa1, 0xc5, 0xe8, 0x6c, 0x10, 0x30, 0x19, 0x72, 0x30, 0xfd, 0xe0, 0x39, 0xcd, + 0x21, 0x9d, 0x74, 0x69, 0xfa, 0xf5, 0xf3, 0x05, 0xae, 0xbb, 0x74, 0x69, 0x1a, 0x6d, 0x18, 0xe4, + 0x2d, 0xde, 0x07, 0x21, 0xae, 0xa1, 0x28, 0xb3, 0x8c, 0x98, 0x66, 0x52, 0x68, 0xef, 0xc6, 0xbf, + 0x82, 0xef, 0x5a, 0x56, 0xaf, 0x41, 0x9d, 0xfe, 0xdc, 0xc1, 0x6e, 0x0f, 0x14, 0x70, 0x4d, 0x8e, + 0x30, 0x2e, 0x8f, 0x26, 0xce, 0xa8, 0x90, 0xdc, 0x86, 0x8f, 0x5a, 0xa5, 0xd2, 0x2d, 0x05, 0xf2, + 0x1e, 0xdf, 0x6f, 0x62, 0xc5, 0x0a, 0x0c, 0x8d, 0xd3, 0x3e, 0x88, 0x9c, 0xd6, 0x69, 0x9e, 0xfe, + 0x75, 0x9a, 0x4f, 0xeb, 0xe9, 0x39, 0x8a, 0x0e, 0x1a, 0x68, 0x04, 0x86, 0x5e, 0x56, 0x48, 0xf2, + 0x06, 0xef, 0x6d, 0x7a, 0x71, 0x18, 0x7b, 0x3b, 0x5b, 0xf5, 0xb8, 0xdd, 0xc0, 0xae, 0x60, 0xfc, + 0x1b, 0x9c, 0x09, 0x6f, 0xf7, 0x7f, 0xc1, 0x99, 0x20, 0x2f, 0xf1, 0xad, 0x5c, 0x42, 0x11, 0x27, + 0x52, 0x64, 0x34, 0xf3, 0x6e, 0x6e, 0x85, 0xc6, 0x25, 0xaa, 0x53, 0x91, 0xc8, 0x23, 0x7c, 0x27, + 0x29, 0x64, 0x3a, 0xd0, 0xf1, 0x90, 0xaa, 0x78, 0x42, 0x41, 0x79, 0xee, 0x09, 0x3a, 0xdb, 0x8d, + 0xf6, 0xac, 0xdc, 0xa3, 0xea, 0x15, 0x05, 0xf5, 0xec, 0xe8, 0xc3, 0x7a, 0x7a, 0xee, 0x59, 0xd2, + 0x85, 0xce, 0x06, 0xe1, 0xd8, 0x3e, 0x08, 0x7b, 0xc9, 0x9d, 0xcb, 0xd9, 0xd2, 0x47, 0xf3, 0xa5, + 0x8f, 0x7e, 0x2c, 0x7d, 0xf4, 0x71, 0xe5, 0x3b, 0xf3, 0x95, 0xef, 0x7c, 0x5b, 0xf9, 0xce, 0xeb, + 0xc7, 0x39, 0x33, 0xfd, 0xeb, 0x24, 0x48, 0x25, 0xaf, 0x27, 0x3e, 0xfc, 0x93, 0x62, 0x26, 0x43, + 0xaa, 0x13, 0xb7, 0x9a, 0xfb, 0x27, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0xc2, 0xd0, 0x42, 0xaf, + 0x72, 0x03, 0x00, 0x00, } func (m *Minter) Marshal() (dAtA []byte, err error) { diff --git a/x/mint/types/minter_test.go b/x/mint/types/minter_test.go index d1f2a444dd14..dbfdf4cd2a94 100644 --- a/x/mint/types/minter_test.go +++ b/x/mint/types/minter_test.go @@ -4,9 +4,10 @@ import ( "math/rand" "testing" - "cosmossdk.io/math" "github.com/stretchr/testify/require" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" ) diff --git a/x/mint/types/msgs.go b/x/mint/types/msgs.go deleted file mode 100644 index e5a18898cdca..000000000000 --- a/x/mint/types/msgs.go +++ /dev/null @@ -1,13 +0,0 @@ -package types - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" -) - -var _ sdk.Msg = &MsgUpdateParams{} - -// GetSigners returns the expected signers for a MsgUpdateParams message. -func (m MsgUpdateParams) GetSigners() []sdk.AccAddress { - addr, _ := sdk.AccAddressFromBech32(m.Authority) - return []sdk.AccAddress{addr} -} diff --git a/x/mint/types/query.pb.go b/x/mint/types/query.pb.go index fd255a02d6fb..f2fb9a105a74 100644 --- a/x/mint/types/query.pb.go +++ b/x/mint/types/query.pb.go @@ -5,8 +5,9 @@ package types import ( context "context" + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-proto" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" @@ -155,7 +156,7 @@ var xxx_messageInfo_QueryInflationRequest proto.InternalMessageInfo // method. type QueryInflationResponse struct { // inflation is the current minting inflation value. - Inflation github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=inflation,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"inflation"` + Inflation cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=inflation,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"inflation"` } func (m *QueryInflationResponse) Reset() { *m = QueryInflationResponse{} } @@ -233,7 +234,7 @@ var xxx_messageInfo_QueryAnnualProvisionsRequest proto.InternalMessageInfo // Query/AnnualProvisions RPC method. type QueryAnnualProvisionsResponse struct { // annual_provisions is the current minting annual provisions value. - AnnualProvisions github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=annual_provisions,json=annualProvisions,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"annual_provisions"` + AnnualProvisions cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=annual_provisions,json=annualProvisions,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"annual_provisions"` } func (m *QueryAnnualProvisionsResponse) Reset() { *m = QueryAnnualProvisionsResponse{} } @@ -281,37 +282,38 @@ func init() { func init() { proto.RegisterFile("cosmos/mint/v1beta1/query.proto", fileDescriptor_d0a1e393be338aea) } var fileDescriptor_d0a1e393be338aea = []byte{ - // 465 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0xcf, 0xcd, 0xcc, 0x2b, 0xd1, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, - 0x2f, 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, 0x28, 0xd0, - 0x03, 0x29, 0xd0, 0x83, 0x2a, 0x90, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0xcb, 0xeb, 0x83, 0x58, - 0x10, 0xa5, 0x52, 0x32, 0xe9, 0xf9, 0xf9, 0xe9, 0x39, 0xa9, 0xfa, 0x89, 0x05, 0x99, 0xfa, 0x89, - 0x79, 0x79, 0xf9, 0x25, 0x89, 0x25, 0x99, 0xf9, 0x79, 0xc5, 0x50, 0x59, 0x39, 0x6c, 0x36, 0x81, - 0x4d, 0x85, 0xc8, 0x0b, 0x26, 0xe6, 0x66, 0xe6, 0xe5, 0xeb, 0x83, 0x49, 0x88, 0x90, 0x92, 0x08, - 0x97, 0x50, 0x20, 0xc8, 0x29, 0x01, 0x89, 0x45, 0x89, 0xb9, 0xc5, 0x41, 0xa9, 0x85, 0xa5, 0xa9, - 0xc5, 0x25, 0x4a, 0xa1, 0x5c, 0xc2, 0x28, 0xa2, 0xc5, 0x05, 0xf9, 0x79, 0xc5, 0xa9, 0x42, 0x76, - 0x5c, 0x6c, 0x05, 0x60, 0x11, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x6e, 0x23, 0x69, 0x3d, 0x2c, 0x2e, - 0xd7, 0x83, 0x68, 0x72, 0xe2, 0x3c, 0x71, 0x4f, 0x9e, 0x61, 0xc5, 0xf3, 0x0d, 0x5a, 0x8c, 0x41, - 0x50, 0x5d, 0x4a, 0xe2, 0x5c, 0xa2, 0x60, 0x63, 0x3d, 0xf3, 0xd2, 0x72, 0xc0, 0x0e, 0x87, 0xd9, - 0x97, 0xcd, 0x25, 0x86, 0x2e, 0x01, 0xb5, 0x32, 0x90, 0x8b, 0x33, 0x13, 0x26, 0x08, 0xb6, 0x95, - 0xc7, 0xc9, 0x18, 0x64, 0xf0, 0xad, 0x7b, 0xf2, 0x6a, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, - 0xc9, 0xf9, 0xb9, 0xfa, 0x50, 0x8f, 0x43, 0x28, 0xdd, 0xe2, 0x94, 0x6c, 0xfd, 0x92, 0xca, 0x82, - 0xd4, 0x62, 0x3d, 0x97, 0xd4, 0x64, 0x88, 0x13, 0x10, 0xa6, 0x28, 0xc9, 0x71, 0xc9, 0x80, 0x2d, - 0x73, 0xcc, 0xcb, 0x2b, 0x4d, 0xcc, 0x09, 0x28, 0xca, 0x2f, 0xcb, 0x2c, 0x06, 0x05, 0x22, 0xcc, - 0x31, 0x8d, 0x8c, 0x5c, 0xb2, 0x38, 0x14, 0x40, 0x1d, 0x95, 0xc0, 0x25, 0x98, 0x08, 0x96, 0x8b, - 0x2f, 0x80, 0x4b, 0x52, 0xe2, 0x38, 0x81, 0x44, 0x34, 0x9b, 0x8c, 0x8e, 0x32, 0x73, 0xb1, 0x82, - 0xdd, 0x20, 0xd4, 0xc0, 0xc8, 0xc5, 0x06, 0x09, 0x51, 0x21, 0x75, 0xac, 0xc1, 0x8d, 0x19, 0x7d, - 0x52, 0x1a, 0x84, 0x15, 0x42, 0x7c, 0xa2, 0xa4, 0xdc, 0x74, 0xf9, 0xc9, 0x64, 0x26, 0x59, 0x21, - 0x69, 0x7d, 0x6c, 0x49, 0x07, 0x12, 0x6d, 0x42, 0x3d, 0x8c, 0x5c, 0x9c, 0xf0, 0x98, 0x11, 0xd2, - 0xc2, 0x6d, 0x38, 0x7a, 0xbc, 0x4a, 0x69, 0x13, 0xa5, 0x16, 0xea, 0x16, 0x35, 0xb0, 0x5b, 0x14, - 0x84, 0xe4, 0xb0, 0xba, 0x05, 0x1e, 0x7f, 0x42, 0x2b, 0x19, 0xb9, 0x04, 0xd0, 0xa3, 0x46, 0xc8, - 0x10, 0xb7, 0x4d, 0x38, 0xe2, 0x59, 0xca, 0x88, 0x14, 0x2d, 0x50, 0x37, 0xea, 0x81, 0xdd, 0xa8, - 0x21, 0xa4, 0x86, 0xd5, 0x8d, 0x18, 0x89, 0xc2, 0xc9, 0xf9, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, - 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, - 0x8f, 0xe5, 0x18, 0xa2, 0x34, 0xf1, 0x26, 0x90, 0x0a, 0x88, 0xc1, 0xe0, 0x74, 0x92, 0xc4, 0x06, - 0xce, 0xaa, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x39, 0xdf, 0xd1, 0xc0, 0x49, 0x04, 0x00, - 0x00, + // 494 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0x4d, 0x6b, 0x14, 0x31, + 0x18, 0xc7, 0x37, 0x8a, 0x0b, 0x1b, 0x3d, 0xb4, 0x69, 0x7d, 0x9b, 0x6d, 0xb3, 0x65, 0x84, 0xba, + 0x56, 0x9a, 0xb0, 0x2b, 0x78, 0x14, 0x5c, 0x7b, 0x11, 0x3c, 0xd4, 0xa2, 0x17, 0x2f, 0x92, 0x9d, + 0xc6, 0x69, 0xe8, 0x4e, 0x32, 0xdd, 0x64, 0x8a, 0x7b, 0x13, 0xf1, 0xe8, 0x41, 0xf0, 0x4b, 0xe8, + 0xcd, 0x83, 0x5f, 0x41, 0xe8, 0xb1, 0xe8, 0x45, 0x3c, 0x14, 0xd9, 0x15, 0xfc, 0x1a, 0x32, 0x49, + 0xa6, 0xe2, 0x74, 0x06, 0x95, 0x5e, 0x76, 0x67, 0x9e, 0xb7, 0xff, 0x2f, 0xcf, 0x3f, 0x03, 0x3b, + 0x91, 0xd2, 0x89, 0xd2, 0x34, 0x11, 0xd2, 0xd0, 0xfd, 0xde, 0x90, 0x1b, 0xd6, 0xa3, 0x7b, 0x19, + 0x1f, 0x4f, 0x48, 0x3a, 0x56, 0x46, 0xa1, 0x05, 0x57, 0x40, 0xf2, 0x02, 0xe2, 0x0b, 0x82, 0xc5, + 0x58, 0xc5, 0xca, 0xe6, 0x69, 0xfe, 0xe4, 0x4a, 0x83, 0xa5, 0x58, 0xa9, 0x78, 0xc4, 0x29, 0x4b, + 0x05, 0x65, 0x52, 0x2a, 0xc3, 0x8c, 0x50, 0x52, 0xfb, 0x2c, 0xae, 0x52, 0xb2, 0x53, 0x5d, 0x7e, + 0x9e, 0x25, 0x42, 0x2a, 0x6a, 0x7f, 0x7d, 0xe8, 0xaa, 0x6b, 0x79, 0xea, 0x94, 0x3c, 0x88, 0x7d, + 0x09, 0x17, 0x21, 0x7a, 0x98, 0x53, 0x6e, 0xb2, 0x31, 0x4b, 0xf4, 0x16, 0xdf, 0xcb, 0xb8, 0x36, + 0xe1, 0x63, 0xb8, 0xf0, 0x47, 0x54, 0xa7, 0x4a, 0x6a, 0x8e, 0xee, 0xc0, 0x66, 0x6a, 0x23, 0x57, + 0xc0, 0x0a, 0xe8, 0x9e, 0xef, 0xb7, 0x49, 0xc5, 0xa1, 0x88, 0x6b, 0x1a, 0xb4, 0x0e, 0x8e, 0x3a, + 0x8d, 0x77, 0x3f, 0x3f, 0xac, 0x81, 0x2d, 0xdf, 0x15, 0x5e, 0x86, 0x17, 0xed, 0xd8, 0xfb, 0xf2, + 0xd9, 0xc8, 0x9e, 0xa9, 0xd0, 0x93, 0xf0, 0x52, 0x39, 0xe1, 0x25, 0x1f, 0xc1, 0x96, 0x28, 0x82, + 0x56, 0xf5, 0xc2, 0xe0, 0x76, 0x3e, 0xf8, 0xdb, 0x51, 0xa7, 0xed, 0xc4, 0xf5, 0xf6, 0x2e, 0x11, + 0x8a, 0x26, 0xcc, 0xec, 0x90, 0x07, 0x3c, 0x66, 0xd1, 0x64, 0x83, 0x47, 0x9f, 0x3f, 0xae, 0x43, + 0xcf, 0xb6, 0xc1, 0x23, 0x47, 0xf1, 0x7b, 0x50, 0x88, 0xe1, 0x92, 0xd5, 0xbb, 0x2b, 0x65, 0xc6, + 0x46, 0x9b, 0x63, 0xb5, 0x2f, 0x74, 0xbe, 0xe2, 0x82, 0xe7, 0x15, 0x80, 0xcb, 0x35, 0x05, 0x9e, + 0x2b, 0x82, 0xf3, 0xcc, 0xe6, 0xf2, 0xa5, 0xfa, 0xe4, 0x29, 0xf9, 0xe6, 0x58, 0x49, 0xac, 0xff, + 0xe9, 0x2c, 0x3c, 0x67, 0x31, 0xd0, 0x0b, 0x00, 0x9b, 0x6e, 0xaf, 0xe8, 0x7a, 0xe5, 0xd2, 0x4f, + 0x9a, 0x18, 0x74, 0xff, 0x5e, 0xe8, 0x0e, 0x13, 0x5e, 0x7b, 0xf9, 0xe5, 0xc7, 0xdb, 0x33, 0xcb, + 0xa8, 0x4d, 0xab, 0xee, 0x96, 0x33, 0x0f, 0xbd, 0x06, 0xb0, 0x75, 0xec, 0x0f, 0x5a, 0xab, 0x1f, + 0x5e, 0x76, 0x37, 0xb8, 0xf9, 0x4f, 0xb5, 0x9e, 0x65, 0xd5, 0xb2, 0xac, 0x20, 0x5c, 0xc9, 0x72, + 0x6c, 0x21, 0x7a, 0x0f, 0xe0, 0x5c, 0xd9, 0x1d, 0xd4, 0xab, 0x57, 0xaa, 0xb1, 0x3a, 0xe8, 0xff, + 0x4f, 0x8b, 0x67, 0x24, 0x96, 0xb1, 0x8b, 0x56, 0x2b, 0x19, 0x4f, 0xdc, 0x8b, 0xc1, 0xbd, 0x83, + 0x29, 0x06, 0x87, 0x53, 0x0c, 0xbe, 0x4f, 0x31, 0x78, 0x33, 0xc3, 0x8d, 0xc3, 0x19, 0x6e, 0x7c, + 0x9d, 0xe1, 0xc6, 0x93, 0x1b, 0xb1, 0x30, 0x3b, 0xd9, 0x90, 0x44, 0x2a, 0x29, 0x66, 0xb9, 0xbf, + 0x75, 0xbd, 0xbd, 0x4b, 0x9f, 0xbb, 0xc1, 0x66, 0x92, 0x72, 0x3d, 0x6c, 0xda, 0x0f, 0xf6, 0xd6, + 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x62, 0x1a, 0x74, 0xc5, 0x6a, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -451,6 +453,7 @@ func _Query_AnnualProvisions_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.mint.v1beta1.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/mint/types/tx.pb.go b/x/mint/types/tx.pb.go index e4a8f909dbfc..5f42012a4e4a 100644 --- a/x/mint/types/tx.pb.go +++ b/x/mint/types/tx.pb.go @@ -238,6 +238,7 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.mint.v1beta1.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/nft/CHANGELOG.md b/x/nft/CHANGELOG.md index e79fa1e4405a..0003432624d7 100644 --- a/x/nft/CHANGELOG.md +++ b/x/nft/CHANGELOG.md @@ -28,3 +28,14 @@ Ref: https://keepachangelog.com/en/1.0.0/ --> # Changelog + +## [v0.1.1](https://github.com/cosmos/cosmos-sdk/releases/tag/x/nft/v0.1.1) - 2024-04-22 + +### Improvements + +* (deps) [#19810](https://github.com/cosmos/cosmos-sdk/pull/19810) Upgrade SDK version due to prometheus breaking change. +* (deps) [#19810](https://github.com/cosmos/cosmos-sdk/pull/19810) Bump `cosmossdk.io/store` to v1.1.0. + +## [v0.1.0](https://github.com/cosmos/cosmos-sdk/releases/tag/x/nft/v0.1.0) - 2023-11-07 + +* Initial release of the standalone NFT module. \ No newline at end of file diff --git a/x/nft/client/cli/tx.go b/x/nft/client/cli/tx.go deleted file mode 100644 index e6cdd2b7716e..000000000000 --- a/x/nft/client/cli/tx.go +++ /dev/null @@ -1,65 +0,0 @@ -package cli - -import ( - "fmt" - "strings" - - "github.com/spf13/cobra" - - "cosmossdk.io/x/nft" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/cosmos/cosmos-sdk/version" -) - -// GetTxCmd returns the transaction commands for this module -func GetTxCmd() *cobra.Command { - nftTxCmd := &cobra.Command{ - Use: nft.ModuleName, - Short: "nft transactions subcommands", - Long: "Provides the most common nft logic for upper-level applications, compatible with Ethereum's erc721 contract", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - nftTxCmd.AddCommand( - NewCmdSend(), - ) - - return nftTxCmd -} - -// NewCmdSend creates a CLI command for MsgSend. -func NewCmdSend() *cobra.Command { - cmd := &cobra.Command{ - Use: "send [class-id] [nft-id] [receiver] --from [sender]", - Args: cobra.ExactArgs(3), - Short: "transfer ownership of nft", - Long: strings.TrimSpace(fmt.Sprintf(` - $ %s tx %s send --from --chain-id `, version.AppName, nft.ModuleName), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - if args[0] == "" || args[1] == "" || args[2] == "" { - return fmt.Errorf("class-id, nft-id and receiver cannot be empty") - } - - msg := nft.MsgSend{ - ClassId: args[0], - Id: args[1], - Sender: clientCtx.GetFromAddress().String(), - Receiver: args[2], - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - return cmd -} diff --git a/x/nft/client/cli/tx_test.go b/x/nft/client/cli/tx_test.go deleted file mode 100644 index a6ad4dc0bc2a..000000000000 --- a/x/nft/client/cli/tx_test.go +++ /dev/null @@ -1,238 +0,0 @@ -package cli_test - -import ( - "context" - "fmt" - "io" - "testing" - - abci "github.com/cometbft/cometbft/abci/types" - rpcclientmock "github.com/cometbft/cometbft/rpc/client/mock" - "github.com/stretchr/testify/suite" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - codecaddress "github.com/cosmos/cosmos-sdk/codec/address" - "github.com/cosmos/cosmos-sdk/crypto/keyring" - svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" - "github.com/cosmos/cosmos-sdk/testutil" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - "github.com/cosmos/cosmos-sdk/testutil/network" - sdk "github.com/cosmos/cosmos-sdk/types" - testutilmod "github.com/cosmos/cosmos-sdk/types/module/testutil" - - "cosmossdk.io/core/address" - "cosmossdk.io/x/nft" - "cosmossdk.io/x/nft/client/cli" - nftmodule "cosmossdk.io/x/nft/module" - nfttestutil "cosmossdk.io/x/nft/testutil" -) - -const ( - OwnerName = "owner" - Owner = "cosmos1kznrznww4pd6gx0zwrpthjk68fdmqypjpkj5hp" - OwnerArmor = `-----BEGIN TENDERMINT PRIVATE KEY----- -salt: C3586B75587D2824187D2CDA22B6AFB6 -type: secp256k1 -kdf: bcrypt - -1+15OrCKgjnwym1zO3cjo/SGe3PPqAYChQ5wMHjdUbTZM7mWsH3/ueL6swgjzI3b -DDzEQAPXBQflzNW6wbne9IfT651zCSm+j1MWaGk= -=wEHs ------END TENDERMINT PRIVATE KEY-----` - - testClassID = "kitty" - testClassName = "Crypto Kitty" - testClassSymbol = "kitty" - testClassDescription = "Crypto Kitty" - testClassURI = "class uri" - testID = "kitty1" - testURI = "kitty uri" -) - -var ( - ExpClass = nft.Class{ - Id: testClassID, - Name: testClassName, - Symbol: testClassSymbol, - Description: testClassDescription, - Uri: testClassURI, - } - - ExpNFT = nft.NFT{ - ClassId: testClassID, - Id: testID, - Uri: testURI, - } -) - -type CLITestSuite struct { - suite.Suite - - kr keyring.Keyring - encCfg testutilmod.TestEncodingConfig - baseCtx client.Context - clientCtx client.Context - ctx context.Context - - owner sdk.AccAddress - - ac address.Codec -} - -func TestCLITestSuite(t *testing.T) { - suite.Run(t, new(CLITestSuite)) -} - -func (s *CLITestSuite) SetupSuite() { - s.encCfg = testutilmod.MakeTestEncodingConfig(nftmodule.AppModuleBasic{}) - s.kr = keyring.NewInMemory(s.encCfg.Codec) - s.baseCtx = client.Context{}. - WithKeyring(s.kr). - WithTxConfig(s.encCfg.TxConfig). - WithCodec(s.encCfg.Codec). - WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}). - WithAccountRetriever(client.MockAccountRetriever{}). - WithOutput(io.Discard). - WithChainID("test-chain") - - s.ctx = svrcmd.CreateExecuteContext(context.Background()) - ctxGen := func() client.Context { - bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ - Value: bz, - }) - return s.baseCtx.WithClient(c) - } - s.clientCtx = ctxGen() - - cfg, err := network.DefaultConfigWithAppConfig(nfttestutil.AppConfig) - s.Require().NoError(err) - - genesisState := cfg.GenesisState - nftGenesis := nft.GenesisState{ - Classes: []*nft.Class{&ExpClass}, - Entries: []*nft.Entry{{ - Owner: Owner, - Nfts: []*nft.NFT{&ExpNFT}, - }}, - } - - nftDataBz, err := s.encCfg.Codec.MarshalJSON(&nftGenesis) - s.Require().NoError(err) - genesisState[nft.ModuleName] = nftDataBz - - s.ac = codecaddress.NewBech32Codec("cosmos") - - s.initAccount() -} - -func (s *CLITestSuite) TestCLITxSend() { - accounts := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) - - extraArgs := []string{ - fmt.Sprintf("--%s=%s", flags.FlagFrom, OwnerName), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(10))).String()), - } - - testCases := []struct { - name string - args []string - expectedCode uint32 - expectErr bool - expErrMsg string - }{ - { - "class id is empty", - []string{ - "", - testID, - accounts[0].Address.String(), - }, - 0, - true, - "class-id, nft-id and receiver cannot be empty", - }, - { - "nft id is empty", - []string{ - testClassID, - "", - accounts[0].Address.String(), - }, - 0, - true, - "class-id, nft-id and receiver cannot be empty", - }, - { - "empty receiver address", - []string{ - testClassID, - testID, - "", - }, - 0, - true, - "class-id, nft-id and receiver cannot be empty", - }, - { - "valid transaction", - []string{ - testClassID, - testID, - accounts[0].Address.String(), - }, - 0, - false, - "", - }, - } - - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - args := append(tc.args, extraArgs...) - cmd := cli.NewCmdSend() - cmd.SetContext(s.ctx) - cmd.SetArgs(args) - - s.Require().NoError(client.SetCmdClientContextHandler(s.clientCtx, cmd)) - - out, err := clitestutil.ExecTestCLICmd(s.clientCtx, cmd, args) - if tc.expectErr { - s.Require().Error(err) - s.Require().Contains(err.Error(), tc.expErrMsg) - } else { - var txResp sdk.TxResponse - s.Require().NoError(err) - s.Require().NoError(s.clientCtx.Codec.UnmarshalJSON(out.Bytes(), &txResp), out.String()) - s.Require().Equal(tc.expectedCode, txResp.Code, out.String()) - } - }) - } -} - -func (s *CLITestSuite) initAccount() { - ctx := s.clientCtx - err := ctx.Keyring.ImportPrivKey(OwnerName, OwnerArmor, "1234567890") - s.Require().NoError(err) - accounts := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) - - keyinfo, err := ctx.Keyring.Key(OwnerName) - s.Require().NoError(err) - - args := []string{ - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(10))).String()), - } - - s.owner, err = keyinfo.GetAddress() - s.Require().NoError(err) - - amount := sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(200))) - _, err = clitestutil.MsgSendExec(ctx, accounts[0].Address, s.owner, amount, s.ac, args...) - s.Require().NoError(err) -} diff --git a/x/nft/go.mod b/x/nft/go.mod index 298b33e7cd2b..7cfc516ba63b 100644 --- a/x/nft/go.mod +++ b/x/nft/go.mod @@ -1,159 +1,162 @@ module cosmossdk.io/x/nft -go 1.20 +go 1.23.0 require ( - cosmossdk.io/api v0.4.2 - cosmossdk.io/core v0.8.0 - cosmossdk.io/depinject v1.0.0-alpha.3 - cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 - cosmossdk.io/log v1.1.0 - cosmossdk.io/math v1.0.1 - cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c - github.com/cometbft/cometbft v0.38.0-rc1 - github.com/cosmos/cosmos-proto v1.0.0-beta.3 - github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230524212735-6cabb6aa5741 - github.com/cosmos/gogoproto v1.4.10 - github.com/golang/mock v1.6.0 - github.com/golang/protobuf v1.5.3 + cosmossdk.io/api v0.7.6 + cosmossdk.io/core v0.11.0 + cosmossdk.io/depinject v1.1.0 + cosmossdk.io/errors v1.0.1 + cosmossdk.io/log v1.5.0 + cosmossdk.io/math v1.5.0 + cosmossdk.io/store v1.1.1 + github.com/cometbft/cometbft v0.38.17 + github.com/cosmos/cosmos-proto v1.0.0-beta.5 + github.com/cosmos/cosmos-sdk v0.50.13 + github.com/cosmos/gogoproto v1.7.0 + github.com/golang/protobuf v1.5.4 github.com/grpc-ecosystem/grpc-gateway v1.16.0 - github.com/spf13/cobra v1.7.0 - github.com/stretchr/testify v1.8.4 - google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a - google.golang.org/grpc v1.55.0 + github.com/stretchr/testify v1.10.0 + go.uber.org/mock v0.5.0 + google.golang.org/genproto/googleapis/api v0.0.0-20250224174004-546df14abb99 + google.golang.org/grpc v1.71.0 ) require ( - cosmossdk.io/collections v0.2.0 // indirect - cosmossdk.io/x/tx v0.8.0 // indirect - filippo.io/edwards25519 v1.0.0 // indirect + cosmossdk.io/collections v0.4.0 // indirect + cosmossdk.io/x/tx v0.13.7 // indirect + filippo.io/edwards25519 v1.1.0 // 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/armon/go-metrics v0.4.1 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect - github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect + github.com/bytedance/sonic v1.12.3 // indirect + github.com/bytedance/sonic/loader v0.2.0 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // indirect - github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/cockroachdb/errors v1.9.1 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/cloudwego/base64x v0.1.4 // indirect + github.com/cloudwego/iasm v0.2.0 // indirect + github.com/cockroachdb/apd/v3 v3.2.1 // indirect + github.com/cockroachdb/errors v1.11.3 // indirect + github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20230606152911-c4be581b807f // indirect - github.com/cockroachdb/redact v1.1.4 // indirect - github.com/cometbft/cometbft-db v0.7.0 // indirect + github.com/cockroachdb/pebble v1.1.2 // indirect + github.com/cockroachdb/redact v1.1.5 // indirect + github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect + github.com/cometbft/cometbft-db v0.14.1 // indirect github.com/cosmos/btcutil v1.0.5 // indirect - github.com/cosmos/cosmos-db v1.0.0 // indirect + github.com/cosmos/cosmos-db v1.1.1 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.0.0-beta.2 // indirect - github.com/cosmos/ics23/go v0.10.0 // indirect - github.com/cosmos/ledger-cosmos-go v0.13.0 // indirect + github.com/cosmos/iavl v1.2.2 // indirect + github.com/cosmos/ics23/go v0.11.0 // indirect + github.com/cosmos/ledger-cosmos-go v0.14.0 // indirect github.com/danieljoos/wincred v1.1.2 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect - github.com/dgraph-io/badger/v2 v2.2007.4 // indirect + github.com/dgraph-io/badger/v4 v4.2.0 // indirect 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/dvsekhvalnov/jose2go v1.5.0 // indirect - github.com/emicklei/dot v1.4.2 // indirect + github.com/dvsekhvalnov/jose2go v1.6.0 // indirect + github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.15.0 // indirect - github.com/felixge/httpsnoop v1.0.2 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/getsentry/sentry-go v0.21.0 // indirect - github.com/go-kit/kit v0.12.0 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect + github.com/getsentry/sentry-go v0.27.0 // indirect + github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/googleapis v1.4.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/glog v1.1.0 // indirect + github.com/golang/glog v1.2.4 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/golang/mock v1.6.0 // indirect github.com/golang/snappy v0.0.4 // indirect - github.com/google/btree v1.1.2 // indirect - github.com/google/go-cmp v0.5.9 // indirect + github.com/google/btree v1.1.3 // indirect + github.com/google/flatbuffers v1.12.1 // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/google/orderedcode v0.0.1 // indirect github.com/gorilla/handlers v1.5.1 // indirect github.com/gorilla/mux v1.8.0 // indirect - github.com/gorilla/websocket v1.5.0 // 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/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/go-plugin v1.4.10 // indirect - github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect - github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/go-metrics v0.5.3 // indirect + github.com/hashicorp/go-plugin v1.5.2 // indirect + github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/yamux v0.1.1 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect github.com/huandu/skiplist v1.2.0 // indirect - github.com/iancoleman/strcase v0.2.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/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.16.5 // indirect + github.com/klauspost/compress v1.17.9 // indirect + github.com/klauspost/cpuid/v2 v2.0.9 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect - github.com/lib/pq v1.10.7 // indirect - github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.0 // indirect - github.com/magiconair/properties v1.8.7 // indirect + github.com/lib/pq v1.10.9 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.19 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/minio/highwayhash v1.0.2 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/minio/highwayhash v1.0.3 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect - github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect - github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.0.8 // indirect - github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761 // indirect + github.com/pelletier/go-toml/v2 v2.2.3 // indirect + github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.15.1 // indirect - github.com/prometheus/client_model v0.4.0 // indirect - github.com/prometheus/common v0.44.0 // indirect - github.com/prometheus/procfs v0.10.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/prometheus/client_golang v1.20.5 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.62.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.10.0 // indirect - github.com/rs/cors v1.8.3 // indirect - github.com/rs/zerolog v1.29.1 // indirect - github.com/sasha-s/go-deadlock v0.3.1 // indirect - github.com/spf13/afero v1.9.5 // indirect - github.com/spf13/cast v1.5.1 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/spf13/pflag v1.0.5 // indirect - github.com/spf13/viper v1.16.0 // indirect - github.com/subosito/gotenv v1.4.2 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect + github.com/rs/cors v1.11.1 // indirect + github.com/rs/zerolog v1.33.0 // indirect + github.com/sagikazarmark/locafero v0.7.0 // indirect + github.com/sasha-s/go-deadlock v0.3.5 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.12.0 // indirect + github.com/spf13/cast v1.7.1 // indirect + github.com/spf13/cobra v1.8.1 // indirect + github.com/spf13/pflag v1.0.6 // indirect + github.com/spf13/viper v1.20.0 // indirect + github.com/subosito/gotenv v1.6.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect - github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect github.com/tendermint/go-amino v0.16.0 // indirect - github.com/tidwall/btree v1.6.0 // indirect - github.com/zondax/hid v0.9.1 // indirect - github.com/zondax/ledger-go v0.14.1 // indirect - go.etcd.io/bbolt v1.3.6 // indirect - golang.org/x/crypto v0.9.0 // indirect - golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/sync v0.2.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/term v0.8.0 // indirect - golang.org/x/text v0.9.0 // indirect - google.golang.org/genproto v0.0.0-20230525234025-438c736192d0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect - google.golang.org/protobuf v1.30.0 // indirect - gopkg.in/ini.v1 v1.67.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect + github.com/tidwall/btree v1.7.0 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + github.com/zondax/hid v0.9.2 // indirect + github.com/zondax/ledger-go v0.14.3 // indirect + go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 // indirect + go.opencensus.io v0.24.0 // indirect + go.uber.org/multierr v1.10.0 // indirect + golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect + golang.org/x/crypto v0.35.0 // indirect + golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect + golang.org/x/net v0.35.0 // indirect + golang.org/x/sync v0.11.0 // indirect + golang.org/x/sys v0.30.0 // indirect + golang.org/x/term v0.29.0 // indirect + golang.org/x/text v0.22.0 // indirect + google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2 // indirect + google.golang.org/protobuf v1.36.5 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - gotest.tools/v3 v3.4.0 // indirect + gotest.tools/v3 v3.5.1 // indirect nhooyr.io/websocket v1.8.6 // indirect - pgregory.net/rapid v0.6.2 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect + pgregory.net/rapid v1.1.0 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect ) - -// Fix upstream GHSA-h395-qcrw-5vmq and GHSA-3vp4-m3rf-835h vulnerabilities. -// TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 -replace github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0 - -replace github.com/cosmos/cosmos-sdk => ../.. diff --git a/x/nft/go.sum b/x/nft/go.sum index 520a0c799543..2ac6b9d4e9c2 100644 --- a/x/nft/go.sum +++ b/x/nft/go.sum @@ -1,89 +1,50 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= -cosmossdk.io/api v0.4.2 h1:lQBMl4xINnMnBOR/tQLtjlDnR4exr4e6/SfHR8PILE0= -cosmossdk.io/api v0.4.2/go.mod h1:qrVgOp7DIeAXa+Tt5dDjOC47bZCDrwx8ZHxrmy7STNE= -cosmossdk.io/collections v0.2.0 h1:CgMfLtE16+qox3zBYrGh60i4yKV8SeExLnIdOS2sbQs= -cosmossdk.io/collections v0.2.0/go.mod h1:Oc1FK0vlmxJZsgUn9/o3ldE6zNyWKvobVzaLhWknZJE= -cosmossdk.io/core v0.8.0 h1:LcJnu52E1a8f8E317VfQ1xK/RZe+IuhMNQAjnDLh25M= -cosmossdk.io/core v0.8.0/go.mod h1:LF6VLOv2DdCiaHxYVmr0MZcZpaSM9ZgvyrQSYTeg6D0= -cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw= -cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= -cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 h1:BCRz06fvddw7cKGiEGDiSox3qMsjQ97f92K+PDZDHdc= -cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741/go.mod h1:TB05o6YXkZkzsc+6bZFAV5kZRBtoCU9tUkbeMIqEg0w= -cosmossdk.io/log v1.1.0 h1:v0ogPHYeTzPcBTcPR1A3j1hkei4pZama8kz8LKlCMv0= -cosmossdk.io/log v1.1.0/go.mod h1:6zjroETlcDs+mm62gd8Ig7mZ+N+fVOZS91V17H+M4N4= -cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= -cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= -cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c h1:A+FMPW9GtfcPBDQNtFeDFN27h1SAP6OVjnGgPLlYXmI= -cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c/go.mod h1:RbYGvXCbz8uNBCXrwS9Z8SyydeWi+W5x5MZ33muyzMw= -cosmossdk.io/x/tx v0.8.0 h1:gLiGRL/Fy7fs6dd0IX8jOf0PrVr56/SG6XVMGQjyvJU= -cosmossdk.io/x/tx v0.8.0/go.mod h1:T9uEumGNgKU61gJYRv1t3uzQwLnASpJGmSE229HM3xA= +cosmossdk.io/api v0.7.6 h1:PC20PcXy1xYKH2KU4RMurVoFjjKkCgYRbVAD4PdqUuY= +cosmossdk.io/api v0.7.6/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= +cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= +cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= +cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= +cosmossdk.io/depinject v1.1.0 h1:wLan7LG35VM7Yo6ov0jId3RHWCGRhe8E8bsuARorl5E= +cosmossdk.io/depinject v1.1.0/go.mod h1:kkI5H9jCGHeKeYWXTqYdruogYrEeWvBQCw1Pj4/eCFI= +cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= +cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= +cosmossdk.io/log v1.5.0 h1:dVdzPJW9kMrnAYyMf1duqacoidB9uZIl+7c6z0mnq0g= +cosmossdk.io/log v1.5.0/go.mod h1:Tr46PUJjiUthlwQ+hxYtUtPn4D/oCZXAkYevBeh5+FI= +cosmossdk.io/math v1.5.0 h1:sbOASxee9Zxdjd6OkzogvBZ25/hP929vdcYcBJQbkLc= +cosmossdk.io/math v1.5.0/go.mod h1:AAwwBmUhqtk2nlku174JwSll+/DepUXW3rWIXN5q+Nw= +cosmossdk.io/store v1.1.1 h1:NA3PioJtWDVU7cHHeyvdva5J/ggyLDkyH0hGHl2804Y= +cosmossdk.io/store v1.1.1/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM= +cosmossdk.io/x/tx v0.13.7 h1:8WSk6B/OHJLYjiZeMKhq7DK7lHDMyK0UfDbBMxVmeOI= +cosmossdk.io/x/tx v0.13.7/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= -filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= +filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= +filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= 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/99designs/keyring v1.2.1 h1:tYLp1ULvO7i3fI5vE21ReQuj99QFSs7lGm0xWyJo87o= github.com/99designs/keyring v1.2.1/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= -github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= -github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= +github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= -github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= -github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= +github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= 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/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= +github.com/adlio/schema v1.3.6 h1:k1/zc2jNfeiZBA5aFTRy37jlBIuCkXCm0XmvpzCKI9I= +github.com/adlio/schema v1.3.6/go.mod h1:qkxwLgPBd1FgLRHYVCmQT/rrBr3JH38J9LjmVzWNudg= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= -github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= -github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -93,16 +54,12 @@ github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kd github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= -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/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -111,15 +68,19 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bits-and-blooms/bitset v1.7.0 h1:YjAGVd3XmtK9ktAbX8Zg2g2PwLIMjGREZJHlV4j7NEo= -github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= -github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= -github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= -github.com/bufbuild/protocompile v0.5.1 h1:mixz5lJX4Hiz4FpqFREJHIXLfaLBntfaJv1h+/jS+Qg= -github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= -github.com/bytedance/sonic v1.8.0 h1:ea0Xadu+sHlu7x5O3gKhRpQ1IKiMrSiHttPF0ybECuA= -github.com/bytedance/sonic v1.8.0/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= +github.com/bits-and-blooms/bitset v1.8.0 h1:FD+XqgOZDUxxZ8hzoBFuV9+cGWY9CslN6d5MS5JVb4c= +github.com/bits-and-blooms/bitset v1.8.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= +github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= +github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/btcutil v1.1.6 h1:zFL2+c3Lb9gEgqKNzowKUPQNb8jV7v5Oaodi/AYFd6c= +github.com/btcsuite/btcd/btcutil v1.1.6/go.mod h1:9dFymx8HpuLqBnsPELrImQeTQfKBQqzqGbbV3jK55aE= +github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY= +github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE= +github.com/bytedance/sonic v1.12.3 h1:W2MGa7RCU1QTeYRTPE3+88mVC0yXmsRQRChiyVocVjU= +github.com/bytedance/sonic v1.12.3/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= +github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= +github.com/bytedance/sonic/loader v0.2.0 h1:zNprn+lsIP06C/IqCHs3gPQIvnvpKbbxyXQP1iU4kWM= +github.com/bytedance/sonic/loader v0.2.0/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= @@ -127,24 +88,23 @@ github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInq github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= -github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= -github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= +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/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI= +github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/0Y= +github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= +github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg= +github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= @@ -152,73 +112,74 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= -github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= +github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= +github.com/cockroachdb/apd/v3 v3.2.1 h1:U+8j7t0axsIgvQUqthuNm82HIrYXodOV2iWLWtEaIwg= +github.com/cockroachdb/apd/v3 v3.2.1/go.mod h1:klXJcjp+FffLTHlhIG69tezTDvdP065naDsHzKhYSqc= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= -github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= -github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= +github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce h1:giXvy4KSc/6g/esnpM7Geqxka4WSqI1SZc7sMJFd3y4= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/pebble v0.0.0-20230606152911-c4be581b807f h1:qQW3qCVRpjYsV4YNaUOjm6YLeliAD2jpgex9+D9tqU4= -github.com/cockroachdb/pebble v0.0.0-20230606152911-c4be581b807f/go.mod h1:TkdVsGYRqtULUppt2RbC+YaKtTHnHoWa2apfFrSKABw= -github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/cockroachdb/redact v1.1.4 h1:Y0XrVI2FAyofNyGveodTN//qdpPtFKcKTeCBsK3AHAQ= -github.com/cockroachdb/redact v1.1.4/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/pebble v1.1.2 h1:CUh2IPtR4swHlEj48Rhfzw6l/d0qA31fItcIszQVIsA= +github.com/cockroachdb/pebble v1.1.2/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= -github.com/cometbft/cometbft v0.38.0-rc1 h1:ph6smlqX82aH+d72KuxDHqu29M7LyusSp/obfGsGX/w= -github.com/cometbft/cometbft v0.38.0-rc1/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= -github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= -github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= +github.com/cometbft/cometbft v0.38.17 h1:FkrQNbAjiFqXydeAO81FUzriL4Bz0abYxN/eOHrQGOk= +github.com/cometbft/cometbft v0.38.17/go.mod h1:5l0SkgeLRXi6bBfQuevXjKqML1jjfJJlvI1Ulp02/o4= +github.com/cometbft/cometbft-db v0.14.1 h1:SxoamPghqICBAIcGpleHbmoPqy+crij/++eZz3DlerQ= +github.com/cometbft/cometbft-db v0.14.1/go.mod h1:KHP1YghilyGV/xjD5DP3+2hyigWx0WTp9X+0Gnx0RxQ= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= +github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= -github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0E= -github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= -github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= -github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= +github.com/cosmos/cosmos-db v1.1.1 h1:FezFSU37AlBC8S98NlSagL76oqBRWq/prTPvFcEJNCM= +github.com/cosmos/cosmos-db v1.1.1/go.mod h1:AghjcIPqdhSLP/2Z0yha5xPH3nLnskz81pBx3tcVSAw= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= +github.com/cosmos/cosmos-sdk v0.50.13 h1:xQ32hhzVy7agEe7behMdZN0ezWhPss3KoLZsF9KoBnw= +github.com/cosmos/cosmos-sdk v0.50.13/go.mod h1:hrWEFMU1eoXqLJeE6VVESpJDQH67FS1nnMrQIjO2daw= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoKuI= -github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= -github.com/cosmos/iavl v1.0.0-beta.2 h1:XOsIM80Yyml/KifCXEYOy9tWCXwMAbLa91n6pReW07Y= -github.com/cosmos/iavl v1.0.0-beta.2/go.mod h1:EA97dJ07TBktRlG/iGzK6g1eCXNj1q3MGoFYkVzrwHE= -github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= -github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= -github.com/cosmos/ledger-cosmos-go v0.13.0 h1:ex0CvCxToSR7j5WjrghPu2Bu9sSXKikjnVvUryNnx4s= -github.com/cosmos/ledger-cosmos-go v0.13.0/go.mod h1:ZcqYgnfNJ6lAXe4HPtWgarNEY+B74i+2/8MhZw4ziiI= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= +github.com/cosmos/iavl v1.2.2 h1:qHhKW3I70w+04g5KdsdVSHRbFLgt3yY3qTMd4Xa4rC8= +github.com/cosmos/iavl v1.2.2/go.mod h1:GiM43q0pB+uG53mLxLDzimxM9l/5N9UuSY3/D0huuVw= +github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= +github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= +github.com/cosmos/ledger-cosmos-go v0.14.0 h1:WfCHricT3rPbkPSVKRH+L4fQGKYHuGOK9Edpel8TYpE= +github.com/cosmos/ledger-cosmos-go v0.14.0/go.mod h1:E07xCWSBl3mTGofZ2QnL4cIUzMbbGVyik84QYKbX3RA= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= -github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= -github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= -github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= -github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= -github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= +github.com/dgraph-io/badger/v4 v4.2.0 h1:kJrlajbXXL9DFTNuhhu9yCx7JJa4qpYWxtE8BzuWsEs= +github.com/dgraph-io/badger/v4 v4.2.0/go.mod h1:qfCqhPoWDFJRx1gp5QwwyGo8xk1lbHUxvK9nK0OGAak= github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= @@ -226,72 +187,63 @@ github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUn github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= 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/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= 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/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= -github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= +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/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= -github.com/emicklei/dot v1.4.2 h1:UbK6gX4yvrpHKlxuUQicwoAis4zl8Dzwit9SnbBAXWw= -github.com/emicklei/dot v1.4.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= +github.com/emicklei/dot v1.6.2 h1:08GN+DD79cy/tzN6uLCT84+2Wk9u+wvqP+Hkx/dIR8A= +github.com/emicklei/dot v1.6.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= -github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= -github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= -github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= -github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= -github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= -github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= -github.com/getsentry/sentry-go v0.21.0 h1:c9l5F1nPF30JIppulk4veau90PK6Smu3abgVtVQWon4= -github.com/getsentry/sentry-go v0.21.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= +github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= +github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.9.0 h1:OjyFBKICoexlu99ctXNR2gg+c5pKrKMuyjgARg9qeY8= -github.com/gin-gonic/gin v1.9.0/go.mod h1:W1Me9+hsUSyj3CePGrd1/QrKJMSJ1Tu/0hFEH89961k= -github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= +github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= +github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= -github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= -github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= +github.com/go-kit/kit v0.13.0 h1:OoneCcHKHQ03LfBpoQCUfCluwd2Vt3ohz+kvbJneZAU= +github.com/go-kit/kit v0.13.0/go.mod h1:phqEHMMUbyrCFCTgH48JueqrM3md2HcAZ8N3XE4FKDg= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= @@ -300,30 +252,36 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= -github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= -github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= -github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= -github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU= -github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= +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-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= +github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= +github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= +github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= +github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= +github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= -github.com/goccy/go-json v0.10.0 h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA= -github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= +github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= -github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= 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= @@ -334,22 +292,15 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV 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/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= -github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= -github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= +github.com/golang/glog v1.2.4 h1:CNNw5U8lSiiBk7druxtSHHTsRWcxKoac6kZKm2peBBc= +github.com/golang/glog v1.2.4/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -357,7 +308,6 @@ github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= @@ -369,56 +319,40 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -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/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= +github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= +github.com/google/flatbuffers v1.12.1 h1:MVlul7pQNoDzWRLTw5imwYsl+usrS1TXG2H4jg6ImGw= +github.com/google/flatbuffers v1.12.1/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 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= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= @@ -429,8 +363,8 @@ github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= @@ -451,10 +385,12 @@ github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVH github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-metrics v0.5.3 h1:M5uADWMOGCTUNU1YuC4hfknOeHNaX54LDm4oYSucoNE= +github.com/hashicorp/go-metrics v0.5.3/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-plugin v1.4.10 h1:xUbmA4jC6Dq163/fWcp8P3JuHilrHHMLNRxzGQJ9hNk= -github.com/hashicorp/go-plugin v1.4.10/go.mod h1:6/1TEzT0eQznvI/gV2CM29DLSkAK/e58mUWKVsPaph0= +github.com/hashicorp/go-plugin v1.5.2 h1:aWv8eimFqWlsEiMrYZdPYl+FdHaBJSN4AWwGWfT1G2Y= +github.com/hashicorp/go-plugin v1.5.2/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= @@ -466,10 +402,10 @@ github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= @@ -484,24 +420,17 @@ github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0Jr github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw= github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= -github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= -github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= -github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= -github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= -github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= -github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= -github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= -github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= +github.com/jhump/protoreflect v1.15.3 h1:6SFRuqU45u9hIZPJAoZ8c28T3nK64BNdp9w6jFonzls= +github.com/jhump/protoreflect v1.15.3/go.mod h1:4ORHmSBmlCW8fh3xHmJMGyul1zNqZK4Elxc8qKP+p1k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= @@ -514,93 +443,66 @@ github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= 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/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= -github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= -github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= -github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= -github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= 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/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI= -github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/klauspost/cpuid v1.2.1 h1:vJi+O/nMdFt0vqm8NZBI6wzALWdA2X+egi0ogNyrC/w= -github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= 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.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= -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= -github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.0 h1:H4L/LhP7GOMf1j17oQAElHgVlbEje2h14A8Tz9cM2BE= -github.com/linxGnu/grocksdb v1.8.0/go.mod h1:09CeBborffXhXdNpEcOeZrLKEnRtrZFEpFdPNI9Zjjg= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= +github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.8/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= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= 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-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= -github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= -github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= +github.com/minio/highwayhash v1.0.3 h1:kbnuUMoHYyVl7szWjSxJnxw11k2U709jqFPPmIUyD6Q= +github.com/minio/highwayhash v1.0.3/go.mod h1:GGYsuwP/fPD6Y9hMiXuapVvlIUEhFhMTh0rxU3ik1LQ= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= @@ -608,8 +510,6 @@ github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS4 github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/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= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -617,9 +517,10 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= 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/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -635,8 +536,8 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce h1:/pEpMk55wH0X+E5zedGEMOdLuWmV8P4+4W3+LZaM6kg= -github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a h1:dlRvE5fWabOchtH7znfiFCcOvmIYgOeAS5ifBXBlh9Q= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= @@ -644,7 +545,6 @@ github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DV github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= @@ -656,10 +556,14 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/onsi/gomega v1.26.0 h1:03cDLK28U6hWvCAns6NeydX3zIm4SF3ci69ulidS32Q= +github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= 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-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= -github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= +github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= +github.com/opencontainers/runc v1.1.12 h1:BOIssBaW1La0/qbNZHXOOa71dZfZEQOzW7dqQf3phss= +github.com/opencontainers/runc v1.1.12/go.mod h1:S+lQwSfncpBha7XTy/5lBwWgm5+y5Ma/O44Ekby9FK8= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -669,19 +573,17 @@ github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJ github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= +github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= -github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= -github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= +github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= +github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= -github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761 h1:W04oB3d0J01W5jgYRGKsV8LCM6g9EkCvPkZcmFuy0OE= -github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 h1:Dx7Ovyv/SFnMFw3fD4oEoeorXc6saIiQ23LrGLth0Gw= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= @@ -692,9 +594,9 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= @@ -702,103 +604,91 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.15.1 h1:8tXpTmJbyH5lydzFPoxSIJ0J46jdh3tylbvM1xCv0LI= -github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= +github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= +github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= -github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= -github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= +github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io= +github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= -github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= 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/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= -github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= -github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= -github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.29.1 h1:cO+d60CHkknCbvzEWxP0S9K6KqyTjrCNUy1LdQLCGPc= -github.com/rs/zerolog v1.29.1/go.mod h1:Le6ESbR7hc+DP6Lt1THiV8CQSdkkNrd3R0XbEgp3ZBU= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= +github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/locafero v0.7.0 h1:5MqpDsTGNDhY8sGp0Aowyf0qKsPrhewaLSsFaodPcyo= +github.com/sagikazarmark/locafero v0.7.0/go.mod h1:2za3Cg5rMaTMoG/2Ulr9AwtFaIppKXTRYnozin4aB5k= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -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/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= +github.com/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb2NsU= +github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= -github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= -github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= -github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= +github.com/spf13/afero v1.12.0 h1:UcOPyRBYczmFn6yvphxkn9ZEOY65cpwGKb5mL36mrqs= +github.com/spf13/afero v1.12.0/go.mod h1:ZTlWwG4/ahT8W7T0WQ5uYmjI9duaLQGy3Q2OAl4sk/4= +github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= +github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= -github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= +github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= +github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.20.0 h1:zrxIyR3RQIOsarIrgL8+sAvALXul9jeEPa06Y0Ph6vY= +github.com/spf13/viper v1.20.0/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -809,77 +699,69 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= -github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +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.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= -github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= +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/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/ugorji/go/codec v1.2.9 h1:rmenucSohSTiyL09Y+l2OCk+FrMxGMzho2+tjr5ticU= -github.com/ugorji/go/codec v1.2.9/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= +github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= +github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= -github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= -github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= -github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= -github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= -github.com/zondax/ledger-go v0.14.1 h1:Pip65OOl4iJ84WTpA4BKChvOufMhhbxED3BaihoZN4c= -github.com/zondax/ledger-go v0.14.1/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2feOQv8K320= +github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= +github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= +github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= +github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= -go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 h1:qxen9oVGzDdIRP6ejyAJc760RwW4SnVDiTYTzwnXuxo= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5/go.mod h1:eW0HG9/oHQhvRCvb1/pIXW4cOvtDqeQK+XSi3TnwaXY= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= +go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= +go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY= +go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI= +go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ= +go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE= +go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A= +go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU= +go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk= +go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w= +go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k= +go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU= +go.uber.org/mock v0.5.0/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= +go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= @@ -888,62 +770,35 @@ golang.org/x/arch v0.0.0-20210923205945-b76863e36670 h1:18EFjUmQOcUvxNYSkA6jO9VA golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= -golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= -golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= +golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs= +golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= +golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= +golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= 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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -955,73 +810,38 @@ golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= +golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= 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= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= -golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= +golang.org/x/sync v0.11.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-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1030,20 +850,12 @@ golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 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-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= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1052,263 +864,122 @@ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/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-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220315194320-039c03cc5b86/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= +golang.org/x/sys v0.30.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.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU= +golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s= 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= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= +golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -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= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/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-20181221001348-537d06c36207/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-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= +golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg= +golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= 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= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -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-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= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20230525234025-438c736192d0 h1:x1vNwUhVOcsYoKyEGCZBH694SBmmBjA2EfauFVEI2+M= -google.golang.org/genproto v0.0.0-20230525234025-438c736192d0/go.mod h1:9ExIQyXL5hZrHzQceCwuSYwZZ5QZBazOcprJ5rgs3lY= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a h1:HiYVD+FGJkTo+9zj1gqz0anapsa1JxjiSrN+BJKyUmE= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a/go.mod h1:ts19tUU+Z0ZShN1y3aPyq2+O3d5FUNNgT6FtOzmrNn8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 h1:ToEetK57OidYuqD4Q5w+vfEnPvPpuTwedCNVohYJfNk= +google.golang.org/genproto v0.0.0-20241118233622-e639e219e697/go.mod h1:JJrvXBWRZaFMxBufik1a4RpFw4HhgVtBBWQeQgUj2cc= +google.golang.org/genproto/googleapis/api v0.0.0-20250224174004-546df14abb99 h1:ilJhrCga0AptpJZXmUYG4MCrx/zf3l1okuYz7YK9PPw= +google.golang.org/genproto/googleapis/api v0.0.0-20250224174004-546df14abb99/go.mod h1:Xsh8gBVxGCcbV8ZeTB9wI5XPyZ5RvC6V3CTeeplHbiA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2 h1:DMTIbak9GhdaSxEjvVzAeNZvyc03I61duqNbnm3SU0M= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2/go.mod h1:LuRYeWDFV6WOn90g357N17oMCaxpgCnbi/44qJvDn2I= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= +google.golang.org/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg= +google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1323,8 +994,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= +google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1336,10 +1007,6 @@ gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qS 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/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= -gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -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/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= @@ -1354,30 +1021,22 @@ gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 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= -gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= -gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= +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-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -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= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= -pgregory.net/rapid v0.6.2 h1:ErW5sL+UKtfBfUTsWHDCoeB+eZKLKMxrSd1VJY6W4bw= -pgregory.net/rapid v0.6.2/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= +pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= +pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/x/nft/keeper/genesis.go b/x/nft/keeper/genesis.go index 9b57cd8b65e1..20631dbbf65b 100644 --- a/x/nft/keeper/genesis.go +++ b/x/nft/keeper/genesis.go @@ -4,6 +4,7 @@ import ( "sort" "cosmossdk.io/x/nft" + sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -37,11 +38,15 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) *nft.GenesisState { nfts := k.GetNFTsOfClass(ctx, class.Id) for i, n := range nfts { owner := k.GetOwner(ctx, n.ClassId, n.Id) - nftArr, ok := nftMap[owner.String()] + ownerStr, err := k.ac.BytesToString(owner.Bytes()) + if err != nil { + panic(err) + } + nftArr, ok := nftMap[ownerStr] if !ok { nftArr = make([]*nft.NFT, 0) } - nftMap[owner.String()] = append(nftArr, &nfts[i]) + nftMap[ownerStr] = append(nftArr, &nfts[i]) } } diff --git a/x/nft/keeper/grpc_query.go b/x/nft/keeper/grpc_query.go index 274238288185..e4ccb1cc31f6 100644 --- a/x/nft/keeper/grpc_query.go +++ b/x/nft/keeper/grpc_query.go @@ -50,7 +50,14 @@ func (k Keeper) Owner(goCtx context.Context, r *nft.QueryOwnerRequest) (*nft.Que ctx := sdk.UnwrapSDKContext(goCtx) owner := k.GetOwner(ctx, r.ClassId, r.Id) - return &nft.QueryOwnerResponse{Owner: owner.String()}, nil + if owner.Empty() { + return &nft.QueryOwnerResponse{Owner: ""}, nil + } + ownerstr, err := k.ac.BytesToString(owner.Bytes()) + if err != nil { + return nil, err + } + return &nft.QueryOwnerResponse{Owner: ownerstr}, nil } // Supply return the number of NFTs from the given class, same as totalSupply of ERC721. diff --git a/x/nft/keeper/grpc_query_test.go b/x/nft/keeper/grpc_query_test.go index fb84c14b3714..42e5c5658662 100644 --- a/x/nft/keeper/grpc_query_test.go +++ b/x/nft/keeper/grpc_query_test.go @@ -5,11 +5,12 @@ import ( "fmt" "testing" - "github.com/cosmos/cosmos-sdk/codec/address" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" "cosmossdk.io/x/nft" + + "github.com/cosmos/cosmos-sdk/codec/address" ) func TestGRPCQuery(t *testing.T) { @@ -53,7 +54,7 @@ func (s *TestSuite) TestBalance() { s.TestMint() req = &nft.QueryBalanceRequest{ ClassId: testClassID, - Owner: s.addrs[0].String(), + Owner: s.encodedAddrs[0], } }, "", @@ -144,7 +145,7 @@ func (s *TestSuite) TestOwner() { ClassId: testClassID, Id: testID, } - owner = s.addrs[0].String() + owner = s.encodedAddrs[0] }, "", func(index int, require *require.Assertions, res *nft.QueryOwnerResponse) { @@ -274,7 +275,7 @@ func (s *TestSuite) TestNFTs() { "success,empty ClassId and no nft", func(index int, require *require.Assertions) { req = &nft.QueryNFTsRequest{ - Owner: s.addrs[1].String(), + Owner: s.encodedAddrs[1], } s.TestSaveClass() }, @@ -322,7 +323,7 @@ func (s *TestSuite) TestNFTs() { } req = &nft.QueryNFTsRequest{ - Owner: s.addrs[2].String(), + Owner: s.encodedAddrs[2], } }, "", @@ -347,7 +348,7 @@ func (s *TestSuite) TestNFTs() { func(index int, require *require.Assertions) { req = &nft.QueryNFTsRequest{ ClassId: testClassID, - Owner: s.addrs[0].String(), + Owner: s.encodedAddrs[0], } nfts = []*nft.NFT{ { diff --git a/x/nft/keeper/keeper_test.go b/x/nft/keeper/keeper_test.go index be8e4a47ac44..2aea94fd8a94 100644 --- a/x/nft/keeper/keeper_test.go +++ b/x/nft/keeper/keeper_test.go @@ -5,8 +5,8 @@ import ( cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" cmttime "github.com/cometbft/cometbft/types/time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" + "go.uber.org/mock/gomock" storetypes "cosmossdk.io/store/types" "cosmossdk.io/x/nft" @@ -40,6 +40,7 @@ type TestSuite struct { ctx sdk.Context addrs []sdk.AccAddress + encodedAddrs []string queryClient nft.QueryClient nftKeeper keeper.Keeper accountKeeper *nfttestutil.MockAccountKeeper @@ -64,6 +65,12 @@ func (s *TestSuite) SetupTest() { accountKeeper.EXPECT().GetModuleAddress("nft").Return(s.addrs[0]).AnyTimes() accountKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec("cosmos")).AnyTimes() + for _, addr := range s.addrs { + st, err := accountKeeper.AddressCodec().BytesToString(addr.Bytes()) + s.Require().NoError(err) + s.encodedAddrs = append(s.encodedAddrs, st) + } + s.accountKeeper = accountKeeper nftKeeper := keeper.NewKeeper(storeService, s.encCfg.Codec, accountKeeper, bankKeeper) @@ -348,7 +355,7 @@ func (s *TestSuite) TestExportGenesis() { expGenesis := &nft.GenesisState{ Classes: []*nft.Class{&class}, Entries: []*nft.Entry{{ - Owner: s.addrs[0].String(), + Owner: s.encodedAddrs[0], Nfts: []*nft.NFT{&expNFT}, }}, } @@ -373,7 +380,7 @@ func (s *TestSuite) TestInitGenesis() { expGenesis := &nft.GenesisState{ Classes: []*nft.Class{&expClass}, Entries: []*nft.Entry{{ - Owner: s.addrs[0].String(), + Owner: s.encodedAddrs[0], Nfts: []*nft.NFT{&expNFT}, }}, } diff --git a/x/nft/keeper/keys.go b/x/nft/keeper/keys.go index 8b725542aa3a..51c8b274356d 100644 --- a/x/nft/keeper/keys.go +++ b/x/nft/keeper/keys.go @@ -5,6 +5,7 @@ import ( "cosmossdk.io/x/nft" "cosmossdk.io/x/nft/internal/conv" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/address" ) diff --git a/x/nft/keeper/msg_server_test.go b/x/nft/keeper/msg_server_test.go index fc044a5f995c..ae70d60b52d9 100644 --- a/x/nft/keeper/msg_server_test.go +++ b/x/nft/keeper/msg_server_test.go @@ -37,7 +37,7 @@ func (s *TestSuite) TestSend() { expGenesis := &nft.GenesisState{ Classes: []*nft.Class{&ExpClass}, Entries: []*nft.Entry{{ - Owner: s.addrs[0].String(), + Owner: s.encodedAddrs[0], Nfts: []*nft.NFT{&ExpNFT}, }}, } @@ -55,8 +55,8 @@ func (s *TestSuite) TestSend() { req: &nft.MsgSend{ ClassId: testClassID, Id: "", - Sender: s.addrs[0].String(), - Receiver: s.addrs[1].String(), + Sender: s.encodedAddrs[0], + Receiver: s.encodedAddrs[1], }, expErr: true, errMsg: "empty nft id", @@ -66,8 +66,8 @@ func (s *TestSuite) TestSend() { req: &nft.MsgSend{ ClassId: "", Id: testID, - Sender: s.addrs[0].String(), - Receiver: s.addrs[1].String(), + Sender: s.encodedAddrs[0], + Receiver: s.encodedAddrs[1], }, expErr: true, errMsg: "empty class id", @@ -77,8 +77,8 @@ func (s *TestSuite) TestSend() { req: &nft.MsgSend{ ClassId: "invalid ClassId", Id: testID, - Sender: s.addrs[0].String(), - Receiver: s.addrs[1].String(), + Sender: s.encodedAddrs[0], + Receiver: s.encodedAddrs[1], }, expErr: true, errMsg: "unauthorized", @@ -88,8 +88,8 @@ func (s *TestSuite) TestSend() { req: &nft.MsgSend{ ClassId: testClassID, Id: "invalid Id", - Sender: s.addrs[0].String(), - Receiver: s.addrs[1].String(), + Sender: s.encodedAddrs[0], + Receiver: s.encodedAddrs[1], }, expErr: true, errMsg: "unauthorized", @@ -99,19 +99,19 @@ func (s *TestSuite) TestSend() { req: &nft.MsgSend{ ClassId: testClassID, Id: testID, - Sender: s.addrs[1].String(), - Receiver: s.addrs[2].String(), + Sender: s.encodedAddrs[1], + Receiver: s.encodedAddrs[2], }, expErr: true, - errMsg: fmt.Sprintf("%s is not the owner of nft %s", s.addrs[1].String(), testID), + errMsg: fmt.Sprintf("%s is not the owner of nft %s", s.encodedAddrs[1], testID), }, { name: "valid transaction", req: &nft.MsgSend{ ClassId: testClassID, Id: testID, - Sender: s.addrs[0].String(), - Receiver: s.addrs[1].String(), + Sender: s.encodedAddrs[0], + Receiver: s.encodedAddrs[1], }, expErr: false, errMsg: "", diff --git a/x/nft/keeper/nft.go b/x/nft/keeper/nft.go index a2f1426891b9..d99af1322c73 100644 --- a/x/nft/keeper/nft.go +++ b/x/nft/keeper/nft.go @@ -21,22 +21,25 @@ func (k Keeper) Mint(ctx context.Context, token nft.NFT, receiver sdk.AccAddress return errors.Wrap(nft.ErrNFTExists, token.Id) } - k.mintWithNoCheck(ctx, token, receiver) - return nil + return k.mintWithNoCheck(ctx, token, receiver) } // mintWithNoCheck defines a method for minting a new nft // Note: this method does not check whether the class already exists in nft. // The upper-layer application needs to check it when it needs to use it. -func (k Keeper) mintWithNoCheck(ctx context.Context, token nft.NFT, receiver sdk.AccAddress) { +func (k Keeper) mintWithNoCheck(ctx context.Context, token nft.NFT, receiver sdk.AccAddress) error { k.setNFT(ctx, token) k.setOwner(ctx, token.ClassId, token.Id, receiver) k.incrTotalSupply(ctx, token.ClassId) - sdk.UnwrapSDKContext(ctx).EventManager().EmitTypedEvent(&nft.EventMint{ + recStr, err := k.ac.BytesToString(receiver.Bytes()) + if err != nil { + return err + } + return sdk.UnwrapSDKContext(ctx).EventManager().EmitTypedEvent(&nft.EventMint{ ClassId: token.ClassId, Id: token.Id, - Owner: receiver.String(), + Owner: recStr, }) } @@ -65,12 +68,16 @@ func (k Keeper) burnWithNoCheck(ctx context.Context, classID, nftID string) erro k.deleteOwner(ctx, classID, nftID, owner) k.decrTotalSupply(ctx, classID) - sdk.UnwrapSDKContext(ctx).EventManager().EmitTypedEvent(&nft.EventBurn{ + ownerStr, err := k.ac.BytesToString(owner.Bytes()) + if err != nil { + return err + } + + return sdk.UnwrapSDKContext(ctx).EventManager().EmitTypedEvent(&nft.EventBurn{ ClassId: classID, Id: nftID, - Owner: owner.String(), + Owner: ownerStr, }) - return nil } // Update defines a method for updating an exist nft diff --git a/x/nft/keeper/nft_batch.go b/x/nft/keeper/nft_batch.go index 474842869f66..889e67fe334c 100644 --- a/x/nft/keeper/nft_batch.go +++ b/x/nft/keeper/nft_batch.go @@ -25,7 +25,9 @@ func (k Keeper) BatchMint(ctx context.Context, } checked[token.ClassId] = true - k.mintWithNoCheck(ctx, token, receiver) + if err := k.mintWithNoCheck(ctx, token, receiver); err != nil { + return err + } } return nil } diff --git a/x/nft/module/autocli.go b/x/nft/module/autocli.go index 3dec1af45eb5..5a9d8289fc5c 100644 --- a/x/nft/module/autocli.go +++ b/x/nft/module/autocli.go @@ -6,6 +6,7 @@ import ( autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" nftv1beta1 "cosmossdk.io/api/cosmos/nft/v1beta1" "cosmossdk.io/x/nft" + "github.com/cosmos/cosmos-sdk/version" ) @@ -82,6 +83,19 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { }, Tx: &autocliv1.ServiceCommandDescriptor{ Service: nftv1beta1.Msg_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Send", + Use: "send [class-id] [nft-id] [receiver] --from [sender]", + Short: "Transfer ownership of NFT", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "class_id"}, + {ProtoField: "id"}, + {ProtoField: "receiver"}, + }, + // Sender is the signer of the transaction and is automatically added as from flag by AutoCLI. + }, + }, }, } } diff --git a/x/nft/module/module.go b/x/nft/module/module.go index aa661b328db4..2728032358c9 100644 --- a/x/nft/module/module.go +++ b/x/nft/module/module.go @@ -4,16 +4,18 @@ import ( "context" "encoding/json" - abci "github.com/cometbft/cometbft/abci/types" gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" "google.golang.org/grpc" + modulev1 "cosmossdk.io/api/cosmos/nft/module/v1" "cosmossdk.io/core/address" "cosmossdk.io/core/appmodule" "cosmossdk.io/core/store" "cosmossdk.io/depinject" "cosmossdk.io/errors" + "cosmossdk.io/x/nft" + "cosmossdk.io/x/nft/keeper" + "cosmossdk.io/x/nft/simulation" sdkclient "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" @@ -21,19 +23,15 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - - modulev1 "cosmossdk.io/api/cosmos/nft/module/v1" - - "cosmossdk.io/x/nft" - "cosmossdk.io/x/nft/client/cli" - "cosmossdk.io/x/nft/keeper" - "cosmossdk.io/x/nft/simulation" ) var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleBasic = AppModule{} _ module.AppModuleSimulation = AppModule{} + _ module.HasGenesis = AppModule{} + + _ appmodule.AppModule = AppModule{} + _ appmodule.HasServices = AppModule{} ) // AppModuleBasic defines the basic application module used by the nft module. @@ -86,17 +84,6 @@ func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx sdkclient.Context, mux } } -// GetQueryCmd returns a no-op command for the nft module. -// Queries for NFT are registered by autocli. -func (ab AppModuleBasic) GetQueryCmd() *cobra.Command { - return nil -} - -// GetTxCmd returns the transaction commands for the nft module -func (AppModuleBasic) GetTxCmd() *cobra.Command { - return cli.GetTxCmd() -} - // AppModule implements the sdk.AppModule interface type AppModule struct { AppModuleBasic @@ -118,29 +105,18 @@ func NewAppModule(cdc codec.Codec, keeper keeper.Keeper, ak nft.AccountKeeper, b } } -var ( - _ appmodule.AppModule = AppModule{} - _ appmodule.HasServices = AppModule{} -) - // IsOnePerModuleType implements the depinject.OnePerModuleType interface. func (am AppModule) IsOnePerModuleType() {} // IsAppModule implements the appmodule.AppModule interface. func (am AppModule) IsAppModule() {} -// Name returns the nft module's name. -func (AppModule) Name() string { - return nft.ModuleName -} - // InitGenesis performs genesis initialization for the nft module. It returns // no validator updates. -func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate { +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) { var genesisState nft.GenesisState cdc.MustUnmarshalJSON(data, &genesisState) am.keeper.InitGenesis(ctx, &genesisState) - return []abci.ValidatorUpdate{} } // ExportGenesis returns the exported genesis state as raw bytes for the nft @@ -158,8 +134,8 @@ func (AppModule) ConsensusVersion() uint64 { return 1 } // AppModuleSimulation functions // GenerateGenesisState creates a randomized GenState of the nft module. -func (AppModule) GenerateGenesisState(simState *module.SimulationState) { - simulation.RandomizedGenState(simState) +func (am AppModule) GenerateGenesisState(simState *module.SimulationState) { + simulation.RandomizedGenState(simState, am.accountKeeper.AddressCodec()) } // RegisterStoreDecoder registers a decoder for nft module's types diff --git a/x/nft/msgs.go b/x/nft/msgs.go deleted file mode 100644 index 081737eb973d..000000000000 --- a/x/nft/msgs.go +++ /dev/null @@ -1,18 +0,0 @@ -package nft - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" -) - -const ( - // TypeMsgSend nft message types - TypeMsgSend = "send" -) - -var _ sdk.Msg = &MsgSend{} - -// GetSigners returns the expected signers for MsgSend. -func (m MsgSend) GetSigners() []sdk.AccAddress { - signer, _ := sdk.AccAddressFromBech32(m.Sender) - return []sdk.AccAddress{signer} -} diff --git a/x/nft/query.pb.go b/x/nft/query.pb.go index 25157b8dedc2..6842d5eeea75 100644 --- a/x/nft/query.pb.go +++ b/x/nft/query.pb.go @@ -1079,6 +1079,7 @@ func _Query_Classes_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.nft.v1beta1.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/nft/simulation/decoder.go b/x/nft/simulation/decoder.go index 6dbfef23350f..7c7fcef4a0bf 100644 --- a/x/nft/simulation/decoder.go +++ b/x/nft/simulation/decoder.go @@ -6,6 +6,7 @@ import ( "cosmossdk.io/x/nft" "cosmossdk.io/x/nft/keeper" + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/kv" diff --git a/x/nft/simulation/decoder_test.go b/x/nft/simulation/decoder_test.go index 4e9b26a40a9b..d3fff88a87a2 100644 --- a/x/nft/simulation/decoder_test.go +++ b/x/nft/simulation/decoder_test.go @@ -10,6 +10,7 @@ import ( "cosmossdk.io/x/nft/keeper" "cosmossdk.io/x/nft/module" "cosmossdk.io/x/nft/simulation" + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/kv" diff --git a/x/nft/simulation/genesis.go b/x/nft/simulation/genesis.go index b40f07f04500..ec115681f7e0 100644 --- a/x/nft/simulation/genesis.go +++ b/x/nft/simulation/genesis.go @@ -3,6 +3,7 @@ package simulation import ( "math/rand" + "cosmossdk.io/core/address" "cosmossdk.io/x/nft" "github.com/cosmos/cosmos-sdk/types/module" @@ -25,12 +26,16 @@ func genClasses(r *rand.Rand, accounts []simtypes.Account) []*nft.Class { } // genNFT returns a slice of nft. -func genNFT(r *rand.Rand, classID string, accounts []simtypes.Account) []*nft.Entry { +func genNFT(r *rand.Rand, classID string, accounts []simtypes.Account, ac address.Codec) []*nft.Entry { entries := make([]*nft.Entry, len(accounts)-1) for i := 0; i < len(accounts)-1; i++ { owner := accounts[i] + oast, err := ac.BytesToString(owner.Address.Bytes()) + if err != nil { + panic(err) + } entries[i] = &nft.Entry{ - Owner: owner.Address.String(), + Owner: oast, Nfts: []*nft.NFT{ { ClassId: classID, @@ -44,7 +49,7 @@ func genNFT(r *rand.Rand, classID string, accounts []simtypes.Account) []*nft.En } // RandomizedGenState generates a random GenesisState for nft. -func RandomizedGenState(simState *module.SimulationState) { +func RandomizedGenState(simState *module.SimulationState, ac address.Codec) { var classes []*nft.Class simState.AppParams.GetOrGenerate( "nft", &classes, simState.Rand, @@ -56,7 +61,7 @@ func RandomizedGenState(simState *module.SimulationState) { "nft", &entries, simState.Rand, func(r *rand.Rand) { class := classes[r.Int63n(int64(len(classes)))] - entries = genNFT(r, class.Id, simState.Accounts) + entries = genNFT(r, class.Id, simState.Accounts, ac) }, ) diff --git a/x/nft/simulation/genesis_test.go b/x/nft/simulation/genesis_test.go index b352450646e8..a04511ed154a 100644 --- a/x/nft/simulation/genesis_test.go +++ b/x/nft/simulation/genesis_test.go @@ -11,6 +11,8 @@ import ( "cosmossdk.io/x/nft" nftmodule "cosmossdk.io/x/nft/module" "cosmossdk.io/x/nft/simulation" + + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/types/module" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" @@ -32,7 +34,7 @@ func TestRandomizedGenState(t *testing.T) { GenState: make(map[string]json.RawMessage), } - simulation.RandomizedGenState(&simState) + simulation.RandomizedGenState(&simState, addresscodec.NewBech32Codec("cosmos")) var nftGenesis nft.GenesisState simState.Cdc.MustUnmarshalJSON(simState.GenState[nft.ModuleName], &nftGenesis) diff --git a/x/nft/simulation/operations.go b/x/nft/simulation/operations.go index 2f76e648d4cc..c7bdbaa2e753 100644 --- a/x/nft/simulation/operations.go +++ b/x/nft/simulation/operations.go @@ -3,6 +3,9 @@ package simulation import ( "math/rand" + "cosmossdk.io/x/nft" + "cosmossdk.io/x/nft/keeper" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" @@ -11,9 +14,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" - - "cosmossdk.io/x/nft" - "cosmossdk.io/x/nft/keeper" ) const ( @@ -87,11 +87,21 @@ func SimulateMsgSend( return simtypes.NoOpMsg(nft.ModuleName, TypeMsgSend, err.Error()), nil, err } + senderStr, err := ak.AddressCodec().BytesToString(senderAcc.GetAddress().Bytes()) + if err != nil { + return simtypes.NoOpMsg(nft.ModuleName, TypeMsgSend, err.Error()), nil, err + } + + recieverStr, err := ak.AddressCodec().BytesToString(receiver.Address.Bytes()) + if err != nil { + return simtypes.NoOpMsg(nft.ModuleName, TypeMsgSend, err.Error()), nil, err + } + msg := &nft.MsgSend{ ClassId: n.ClassId, Id: n.Id, - Sender: senderAcc.GetAddress().String(), - Receiver: receiver.Address.String(), + Sender: senderStr, + Receiver: recieverStr, } tx, err := simtestutil.GenSignedMockTx( diff --git a/x/nft/simulation/operations_test.go b/x/nft/simulation/operations_test.go index 6c315f323027..fad8cf9996e7 100644 --- a/x/nft/simulation/operations_test.go +++ b/x/nft/simulation/operations_test.go @@ -5,12 +5,11 @@ import ( "testing" "time" - "github.com/stretchr/testify/suite" - - "cosmossdk.io/log" abci "github.com/cometbft/cometbft/abci/types" + "github.com/stretchr/testify/suite" "cosmossdk.io/depinject" + "cosmossdk.io/log" "cosmossdk.io/x/nft" nftkeeper "cosmossdk.io/x/nft/keeper" "cosmossdk.io/x/nft/simulation" diff --git a/x/nft/sonar-project.properties b/x/nft/sonar-project.properties deleted file mode 100644 index 7c3466058a17..000000000000 --- a/x/nft/sonar-project.properties +++ /dev/null @@ -1,14 +0,0 @@ -sonar.projectKey=cosmos-sdk-x-nft -sonar.organization=cosmos - -sonar.projectName=Cosmos SDK - x/nft -sonar.project.monorepo.enabled=true - -sonar.sources=. -sonar.exclusions=**/*_test.go -sonar.tests=. -sonar.test.inclusions=**/*_test.go -sonar.go.coverage.reportPaths=coverage.out - -sonar.sourceEncoding=UTF-8 -sonar.scm.provider=git \ No newline at end of file diff --git a/x/nft/testutil/app_config.go b/x/nft/testutil/app_config.go index fab097763fa8..6e7d85f77539 100644 --- a/x/nft/testutil/app_config.go +++ b/x/nft/testutil/app_config.go @@ -1,9 +1,9 @@ package testutil import ( - "github.com/cosmos/cosmos-sdk/testutil/configurator" + _ "cosmossdk.io/x/nft/module" // import as blank for app wiring - _ "cosmossdk.io/x/nft/module" // import as blank for app wiring + "github.com/cosmos/cosmos-sdk/testutil/configurator" _ "github.com/cosmos/cosmos-sdk/x/auth" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/auth/tx/config" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/bank" // import as blank for app wiring diff --git a/x/nft/testutil/expected_keepers_mocks.go b/x/nft/testutil/expected_keepers_mocks.go index 3329058f4488..99139a84150b 100644 --- a/x/nft/testutil/expected_keepers_mocks.go +++ b/x/nft/testutil/expected_keepers_mocks.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: x/nft/expected_keepers.go +// +// Generated by this command: +// +// mockgen -source=x/nft/expected_keepers.go -package testutil -destination x/nft/testutil/expected_keepers_mocks.go +// // Package testutil is a generated GoMock package. package testutil @@ -10,13 +15,14 @@ import ( address "cosmossdk.io/core/address" types "github.com/cosmos/cosmos-sdk/types" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockBankKeeper is a mock of BankKeeper interface. type MockBankKeeper struct { ctrl *gomock.Controller recorder *MockBankKeeperMockRecorder + isgomock struct{} } // MockBankKeeperMockRecorder is the mock recorder for MockBankKeeper. @@ -45,7 +51,7 @@ func (m *MockBankKeeper) SpendableCoins(ctx context.Context, addr types.AccAddre } // SpendableCoins indicates an expected call of SpendableCoins. -func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SpendableCoins", reflect.TypeOf((*MockBankKeeper)(nil).SpendableCoins), ctx, addr) } @@ -54,6 +60,7 @@ func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr interface{}) *gom type MockAccountKeeper struct { ctrl *gomock.Controller recorder *MockAccountKeeperMockRecorder + isgomock struct{} } // MockAccountKeeperMockRecorder is the mock recorder for MockAccountKeeper. @@ -96,7 +103,7 @@ func (m *MockAccountKeeper) GetAccount(ctx context.Context, addr types.AccAddres } // GetAccount indicates an expected call of GetAccount. -func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetAccount), ctx, addr) } @@ -110,7 +117,7 @@ func (m *MockAccountKeeper) GetModuleAddress(name string) types.AccAddress { } // GetModuleAddress indicates an expected call of GetModuleAddress. -func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(name interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(name any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAddress", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAddress), name) } diff --git a/x/nft/tx.pb.go b/x/nft/tx.pb.go index 46ea9ca5e37e..281bba9a03aa 100644 --- a/x/nft/tx.pb.go +++ b/x/nft/tx.pb.go @@ -238,6 +238,7 @@ func _Msg_Send_Handler(srv interface{}, ctx context.Context, dec func(interface{ return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.nft.v1beta1.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/params/README.md b/x/params/README.md index f8d374d0c28b..372f0ce6e1b9 100644 --- a/x/params/README.md +++ b/x/params/README.md @@ -4,7 +4,7 @@ sidebar_position: 1 # `x/params` -> Note: The Params module has been depreacted in favour of each module housing its own parameters. +NOTE: `x/params` is deprecated as of Cosmos SDK v0.53 and will be removed in the next release. ## Abstract diff --git a/x/params/autocli.go b/x/params/autocli.go new file mode 100644 index 000000000000..b01e73e45504 --- /dev/null +++ b/x/params/autocli.go @@ -0,0 +1,31 @@ +package params + +import ( + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + paramsv1beta1 "cosmossdk.io/api/cosmos/params/v1beta1" +) + +// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. +func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { + return &autocliv1.ModuleOptions{ + Query: &autocliv1.ServiceCommandDescriptor{ + Service: paramsv1beta1.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Params", + Use: "subspace [subspace] [key]", + Short: "Query for raw parameters by subspace and key", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "subspace"}, + {ProtoField: "key"}, + }, + }, + { + RpcMethod: "Subspaces", + Use: "subspaces", + Short: "Query for all registered subspaces and all keys for a subspace", + }, + }, + }, + } +} diff --git a/x/params/client/cli/query.go b/x/params/client/cli/query.go deleted file mode 100644 index ce7b45d0602d..000000000000 --- a/x/params/client/cli/query.go +++ /dev/null @@ -1,54 +0,0 @@ -package cli - -import ( - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/cosmos/cosmos-sdk/x/params/types/proposal" -) - -// NewQueryCmd returns a root CLI command handler for all x/params query commands. -func NewQueryCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: types.ModuleName, - Short: "Querying commands for the params module", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - cmd.AddCommand(NewQuerySubspaceParamsCmd()) - - return cmd -} - -// NewQuerySubspaceParamsCmd returns a CLI command handler for querying subspace -// parameters managed by the x/params module. -func NewQuerySubspaceParamsCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "subspace [subspace] [key]", - Short: "Query for raw parameters by subspace and key", - Args: cobra.ExactArgs(2), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := proposal.NewQueryClient(clientCtx) - - params := proposal.QueryParamsRequest{Subspace: args[0], Key: args[1]} - res, err := queryClient.Params(cmd.Context(), ¶ms) - if err != nil { - return err - } - - return clientCtx.PrintProto(&res.Param) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/params/keeper/keeper.go b/x/params/keeper/keeper.go index 6d14eef6f9c2..a57124d6dc60 100644 --- a/x/params/keeper/keeper.go +++ b/x/params/keeper/keeper.go @@ -11,6 +11,8 @@ import ( ) // Keeper of the global paramstore +// +// Deprecated: the params keeper is deprecated and will be removed in the next Cosmos SDK major release. type Keeper struct { cdc codec.BinaryCodec legacyAmino *codec.LegacyAmino @@ -20,6 +22,8 @@ type Keeper struct { } // NewKeeper constructs a params keeper +// +// Deprecated: the params keeper is deprecated and will be removed in the next Cosmos SDK major release. func NewKeeper(cdc codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key, tkey storetypes.StoreKey) Keeper { return Keeper{ cdc: cdc, diff --git a/x/params/keeper/keeper_test.go b/x/params/keeper/keeper_test.go index 721253ca6b19..eca29c0462bc 100644 --- a/x/params/keeper/keeper_test.go +++ b/x/params/keeper/keeper_test.go @@ -4,10 +4,10 @@ import ( "reflect" "testing" - "cosmossdk.io/math" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" + "cosmossdk.io/math" "cosmossdk.io/store/prefix" storetypes "cosmossdk.io/store/types" diff --git a/x/params/module.go b/x/params/module.go index 5f312dd5cc6b..133900c4324d 100644 --- a/x/params/module.go +++ b/x/params/module.go @@ -3,10 +3,7 @@ package params import ( "context" - govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" modulev1 "cosmossdk.io/api/cosmos/params/module/v1" "cosmossdk.io/core/appmodule" @@ -18,16 +15,18 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/params/client/cli" + govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/params/keeper" "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/cosmos/cosmos-sdk/x/params/types/proposal" ) var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleBasic = AppModule{} _ module.AppModuleSimulation = AppModule{} + _ module.HasServices = AppModule{} + + _ appmodule.AppModule = AppModule{} ) // ConsensusVersion defines the current x/params module consensus version. @@ -53,19 +52,13 @@ func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *g } } -// GetTxCmd returns no root tx command for the params module. -func (AppModuleBasic) GetTxCmd() *cobra.Command { return nil } - -// GetQueryCmd returns no root query command for the params module. -func (AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.NewQueryCmd() -} - func (am AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { proposal.RegisterInterfaces(registry) } // AppModule implements an application module for the distribution module. +// +// Deprecated: the params module is deprecated and will be removed in the next Cosmos SDK major release. type AppModule struct { AppModuleBasic @@ -73,6 +66,8 @@ type AppModule struct { } // NewAppModule creates a new AppModule object +// +// Deprecated: the params module is deprecated and will be removed in the next Cosmos SDK major release. func NewAppModule(k keeper.Keeper) AppModule { return AppModule{ AppModuleBasic: AppModuleBasic{}, @@ -80,8 +75,6 @@ func NewAppModule(k keeper.Keeper) AppModule { } } -var _ appmodule.AppModule = AppModule{} - // IsOnePerModuleType implements the depinject.OnePerModuleType interface. func (am AppModule) IsOnePerModuleType() {} diff --git a/x/params/proposal_handler_test.go b/x/params/proposal_handler_test.go index 5b36ea9f067e..a693c01fcfbf 100644 --- a/x/params/proposal_handler_test.go +++ b/x/params/proposal_handler_test.go @@ -1,10 +1,11 @@ package params_test import ( + "context" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" + "go.uber.org/mock/gomock" storetypes "cosmossdk.io/store/types" @@ -22,7 +23,7 @@ import ( // StakingKeeper defines the expected staking keeper type StakingKeeper interface { - MaxValidators(ctx sdk.Context) (res uint32) + MaxValidators(ctx context.Context) (res uint32, err error) } type HandlerTestSuite struct { @@ -43,7 +44,7 @@ func (suite *HandlerTestSuite) SetupTest() { paramsKeeper.Subspace("staking").WithKeyTable(stakingtypes.ParamKeyTable()) //nolint:staticcheck // TODO: depreacte this test case ctrl := gomock.NewController(suite.T()) stakingKeeper := paramstestutil.NewMockStakingKeeper(ctrl) - stakingKeeper.EXPECT().MaxValidators(ctx).Return(uint32(1)) + stakingKeeper.EXPECT().MaxValidators(ctx).Return(uint32(1), nil) suite.govHandler = params.NewParamChangeProposalHandler(paramsKeeper) suite.stakingKeeper = stakingKeeper @@ -69,7 +70,8 @@ func (suite *HandlerTestSuite) TestProposalHandler() { "all fields", testProposal(proposal.NewParamChange(stakingtypes.ModuleName, string(stakingtypes.KeyMaxValidators), "1")), func() { - maxVals := suite.stakingKeeper.MaxValidators(suite.ctx) + maxVals, err := suite.stakingKeeper.MaxValidators(suite.ctx) + suite.Require().NoError(err) suite.Require().Equal(uint32(1), maxVals) }, false, @@ -91,7 +93,7 @@ func (suite *HandlerTestSuite) TestProposalHandler() { // depositParams := suite.app.GovKeeper.GetDepositParams(suite.ctx) // defaultPeriod := govv1.DefaultPeriod // suite.Require().Equal(govv1.DepositParams{ - // MinDeposit: sdk.NewCoins(sdk.NewCoin("uatom", sdk.NewInt(64000000))), + // MinDeposit: sdk.NewCoins(sdk.NewCoin("uatom", sdkmath.NewInt(64000000))), // MaxDepositPeriod: &defaultPeriod, // }, depositParams) // }, diff --git a/x/params/testutil/staking_keeper_mock.go b/x/params/testutil/staking_keeper_mock.go index a90f80ad43ae..a12919790473 100644 --- a/x/params/testutil/staking_keeper_mock.go +++ b/x/params/testutil/staking_keeper_mock.go @@ -1,20 +1,26 @@ // Code generated by MockGen. DO NOT EDIT. // Source: x/params/proposal_handler_test.go +// +// Generated by this command: +// +// mockgen -source=x/params/proposal_handler_test.go -package testutil -destination x/params/testutil/staking_keeper_mock.go +// // Package testutil is a generated GoMock package. package testutil import ( + context "context" reflect "reflect" - types "github.com/cosmos/cosmos-sdk/types" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockStakingKeeper is a mock of StakingKeeper interface. type MockStakingKeeper struct { ctrl *gomock.Controller recorder *MockStakingKeeperMockRecorder + isgomock struct{} } // MockStakingKeeperMockRecorder is the mock recorder for MockStakingKeeper. @@ -35,15 +41,16 @@ func (m *MockStakingKeeper) EXPECT() *MockStakingKeeperMockRecorder { } // MaxValidators mocks base method. -func (m *MockStakingKeeper) MaxValidators(ctx types.Context) uint32 { +func (m *MockStakingKeeper) MaxValidators(ctx context.Context) (uint32, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "MaxValidators", ctx) ret0, _ := ret[0].(uint32) - return ret0 + ret1, _ := ret[1].(error) + return ret0, ret1 } // MaxValidators indicates an expected call of MaxValidators. -func (mr *MockStakingKeeperMockRecorder) MaxValidators(ctx interface{}) *gomock.Call { +func (mr *MockStakingKeeperMockRecorder) MaxValidators(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MaxValidators", reflect.TypeOf((*MockStakingKeeper)(nil).MaxValidators), ctx) } diff --git a/x/params/types/proposal/query.pb.go b/x/params/types/proposal/query.pb.go index a475a1d64522..03f72eb959d1 100644 --- a/x/params/types/proposal/query.pb.go +++ b/x/params/types/proposal/query.pb.go @@ -425,6 +425,7 @@ func _Query_Subspaces_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.params.v1beta1.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/params/types/subspace_test.go b/x/params/types/subspace_test.go index bb8c84477cb4..a9a1e7ebcc51 100644 --- a/x/params/types/subspace_test.go +++ b/x/params/types/subspace_test.go @@ -6,11 +6,11 @@ import ( "testing" "time" - "cosmossdk.io/log" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" dbm "github.com/cosmos/cosmos-db" "github.com/stretchr/testify/suite" + "cosmossdk.io/log" "cosmossdk.io/store" "cosmossdk.io/store/metrics" storetypes "cosmossdk.io/store/types" diff --git a/x/simulation/client/cli/flags.go b/x/simulation/client/cli/flags.go index 43f0e4c52465..c157bdb8e805 100644 --- a/x/simulation/client/cli/flags.go +++ b/x/simulation/client/cli/flags.go @@ -30,6 +30,7 @@ var ( FlagVerboseValue bool FlagPeriodValue uint FlagGenesisTimeValue int64 + FlagSigverifyTxValue bool ) // GetSimulatorFlags gets the values of all the available simulation flags @@ -56,6 +57,7 @@ func GetSimulatorFlags() { flag.BoolVar(&FlagVerboseValue, "Verbose", false, "verbose log output") flag.UintVar(&FlagPeriodValue, "Period", 0, "run slow invariants only once every period assertions") flag.Int64Var(&FlagGenesisTimeValue, "GenesisTime", 0, "override genesis UNIX time instead of using a random UNIX time") + flag.BoolVar(&FlagSigverifyTxValue, "SigverifyTx", true, "whether to sigverify check for transaction ") } // NewConfigFromFlags creates a simulation from the retrieved values of the flags. diff --git a/x/simulation/log.go b/x/simulation/log.go index b22709b65414..42eba43b8978 100644 --- a/x/simulation/log.go +++ b/x/simulation/log.go @@ -49,7 +49,7 @@ func (lw *StandardLogWriter) PrintLogs() { func createLogFile() *os.File { var f *os.File - fileName := fmt.Sprintf("%s.log", time.Now().Format("2006-01-02_15:04:05")) + fileName := fmt.Sprintf("%d.log", time.Now().UnixMilli()) folderPath := path.Join(os.ExpandEnv("$HOME"), ".simapp", "simulations") filePath := path.Join(folderPath, fileName) diff --git a/x/simulation/mock_cometbft.go b/x/simulation/mock_cometbft.go index 80ef32282c2c..b0c660ae81fc 100644 --- a/x/simulation/mock_cometbft.go +++ b/x/simulation/mock_cometbft.go @@ -149,10 +149,13 @@ func RandomRequestFinalizeBlock( signed = false } + var commitStatus cmtproto.BlockIDFlag if signed { event("begin_block", "signing", "signed") + commitStatus = cmtproto.BlockIDFlagCommit } else { event("begin_block", "signing", "missed") + commitStatus = cmtproto.BlockIDFlagAbsent } pubkey, err := cryptoenc.PubKeyFromProto(mVal.val.PubKey) @@ -165,7 +168,7 @@ func RandomRequestFinalizeBlock( Address: pubkey.Address(), Power: mVal.val.Power, }, - BlockIdFlag: cmtproto.BlockIDFlagCommit, + BlockIdFlag: commitStatus, } } diff --git a/x/simulation/params.go b/x/simulation/params.go index 73b520a0fd74..7be6d77ae08b 100644 --- a/x/simulation/params.go +++ b/x/simulation/params.go @@ -176,7 +176,7 @@ func (w WeightedProposalContent) ContentSimulatorFn() simulation.ContentSimulato // Consensus Params // randomConsensusParams returns random simulation consensus parameters, it extracts the Evidence from the Staking genesis state. -func randomConsensusParams(r *rand.Rand, appState json.RawMessage, cdc codec.JSONCodec) *cmtproto.ConsensusParams { +func randomConsensusParams(r *rand.Rand, appState json.RawMessage, cdc codec.JSONCodec, maxGas int64) *cmtproto.ConsensusParams { var genesisState map[string]json.RawMessage err := json.Unmarshal(appState, &genesisState) if err != nil { @@ -187,7 +187,7 @@ func randomConsensusParams(r *rand.Rand, appState json.RawMessage, cdc codec.JSO consensusParams := &cmtproto.ConsensusParams{ Block: &cmtproto.BlockParams{ MaxBytes: int64(simulation.RandIntBetween(r, 20000000, 30000000)), - MaxGas: -1, + MaxGas: maxGas, }, Validator: &cmtproto.ValidatorParams{ PubKeyTypes: []string{types.ABCIPubKeyTypeEd25519}, diff --git a/x/simulation/simulate.go b/x/simulation/simulate.go index 2583e39aacb4..0e7819b65075 100644 --- a/x/simulation/simulate.go +++ b/x/simulation/simulate.go @@ -31,8 +31,12 @@ func initChain( config simulation.Config, cdc codec.JSONCodec, ) (mockValidators, time.Time, []simulation.Account, string) { + blockMaxGas := int64(-1) + if config.BlockMaxGas > 0 { + blockMaxGas = config.BlockMaxGas + } appState, accounts, chainID, genesisTimestamp := appStateFn(r, accounts, config) - consensusParams := randomConsensusParams(r, appState, cdc) + consensusParams := randomConsensusParams(r, appState, cdc, blockMaxGas) req := abci.RequestInitChain{ AppStateBytes: appState, ChainId: chainID, @@ -77,8 +81,10 @@ func SimulateFromSeed( // Second variable to keep pending validator set (delayed one block since // TM 0.24) Initially this is the same as the initial validator set validators, blockTime, accs, chainID := initChain(r, params, accs, app, appStateFn, config, cdc) - if len(accs) == 0 { - return true, params, fmt.Errorf("must have greater than zero genesis accounts") + // At least 2 accounts must be added here, otherwise when executing SimulateMsgSend + // two accounts will be selected to meet the conditions from != to and it will fall into an infinite loop. + if len(accs) <= 1 { + return true, params, fmt.Errorf("at least two genesis accounts are required") } config.ChainID = chainID @@ -99,6 +105,10 @@ func SimulateFromSeed( accs = tmpAccs nextValidators := validators + if len(nextValidators) == 0 { + tb.Skip("skipping: empty validator set in genesis") + return true, params, nil + } var ( pastTimes []time.Time @@ -237,6 +247,10 @@ func SimulateFromSeed( // on the next block validators = nextValidators nextValidators = updateValidators(tb, r, params, validators, res.ValidatorUpdates, eventStats.Tally) + if len(nextValidators) == 0 { + tb.Skip("skipping: empty validator set") + return true, params, nil + } // update the exported params if config.ExportParamsPath != "" && int64(config.ExportParamsHeight) == blockHeight { diff --git a/x/slashing/abci.go b/x/slashing/abci.go index af987c394a3b..42a95b7b10ff 100644 --- a/x/slashing/abci.go +++ b/x/slashing/abci.go @@ -2,7 +2,6 @@ package slashing import ( "context" - "time" "cosmossdk.io/core/comet" @@ -15,7 +14,7 @@ import ( // BeginBlocker check for infraction evidence or downtime of validators // on every begin block func BeginBlocker(ctx context.Context, k keeper.Keeper) error { - defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) + defer telemetry.ModuleMeasureSince(types.ModuleName, telemetry.Now(), telemetry.MetricKeyBeginBlocker) // Iterate over all the validators which *should* have signed this block // store whether or not they have actually signed it and slash/unbond any diff --git a/x/slashing/abci_test.go b/x/slashing/abci_test.go index 79c5fbbcffb7..2bdbd90913ce 100644 --- a/x/slashing/abci_test.go +++ b/x/slashing/abci_test.go @@ -4,12 +4,13 @@ import ( "testing" "time" - "cosmossdk.io/depinject" - "cosmossdk.io/log" abci "github.com/cometbft/cometbft/abci/types" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" + "cosmossdk.io/depinject" + "cosmossdk.io/log" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" @@ -23,10 +24,12 @@ import ( ) func TestBeginBlocker(t *testing.T) { - var interfaceRegistry codectypes.InterfaceRegistry - var bankKeeper bankkeeper.Keeper - var stakingKeeper *stakingkeeper.Keeper - var slashingKeeper slashingkeeper.Keeper + var ( + interfaceRegistry codectypes.InterfaceRegistry + bankKeeper bankkeeper.Keeper + stakingKeeper *stakingkeeper.Keeper + slashingKeeper slashingkeeper.Keeper + ) app, err := simtestutil.Setup( depinject.Configs( @@ -51,19 +54,23 @@ func TestBeginBlocker(t *testing.T) { power := int64(100) amt := tstaking.CreateValidatorWithValPower(addr, pk, power, true) stakingKeeper.EndBlocker(ctx) + bondDenom, err := stakingKeeper.BondDenom(ctx) + require.NoError(t, err) require.Equal( t, bankKeeper.GetAllBalances(ctx, sdk.AccAddress(addr)), - sdk.NewCoins(sdk.NewCoin(stakingKeeper.GetParams(ctx).BondDenom, testutil.InitTokens.Sub(amt))), + sdk.NewCoins(sdk.NewCoin(bondDenom, testutil.InitTokens.Sub(amt))), ) - require.Equal(t, amt, stakingKeeper.Validator(ctx, addr).GetBondedTokens()) + val, err := stakingKeeper.Validator(ctx, addr) + require.NoError(t, err) + require.Equal(t, amt, val.GetBondedTokens()) - val := abci.Validator{ + abciVal := abci.Validator{ Address: pk.Address(), Power: power, } ctx = ctx.WithVoteInfos([]abci.VoteInfo{{ - Validator: val, + Validator: abciVal, BlockIdFlag: cmtproto.BlockIDFlagCommit, }}) @@ -85,7 +92,7 @@ func TestBeginBlocker(t *testing.T) { for ; height < signedBlocksWindow; height++ { ctx = ctx.WithBlockHeight(height). WithVoteInfos([]abci.VoteInfo{{ - Validator: val, + Validator: abciVal, BlockIdFlag: cmtproto.BlockIDFlagCommit, }}) @@ -99,7 +106,7 @@ func TestBeginBlocker(t *testing.T) { for ; height < ((signedBlocksWindow * 2) - minSignedPerWindow + 1); height++ { ctx = ctx.WithBlockHeight(height). WithVoteInfos([]abci.VoteInfo{{ - Validator: val, + Validator: abciVal, BlockIdFlag: cmtproto.BlockIDFlagAbsent, }}) @@ -112,7 +119,7 @@ func TestBeginBlocker(t *testing.T) { require.NoError(t, err) // validator should be jailed - validator, found := stakingKeeper.GetValidatorByConsAddr(ctx, sdk.GetConsAddress(pk)) - require.True(t, found) + validator, err := stakingKeeper.GetValidatorByConsAddr(ctx, sdk.GetConsAddress(pk)) + require.NoError(t, err) require.Equal(t, stakingtypes.Unbonding, validator.GetStatus()) } diff --git a/x/slashing/app_test.go b/x/slashing/app_test.go index 9add8e28167d..700840a77aff 100644 --- a/x/slashing/app_test.go +++ b/x/slashing/app_test.go @@ -4,12 +4,12 @@ import ( "errors" "testing" - "cosmossdk.io/log" abci "github.com/cometbft/cometbft/abci/types" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" "cosmossdk.io/depinject" + "cosmossdk.io/log" "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" @@ -81,7 +81,7 @@ func TestSlashingMsgs(t *testing.T) { commission := stakingtypes.NewCommissionRates(math.LegacyZeroDec(), math.LegacyZeroDec(), math.LegacyZeroDec()) createValidatorMsg, err := stakingtypes.NewMsgCreateValidator( - sdk.ValAddress(addr1), valKey.PubKey(), bondCoin, description, commission, math.OneInt(), + sdk.ValAddress(addr1).String(), valKey.PubKey(), bondCoin, description, commission, math.OneInt(), ) require.NoError(t, err) @@ -94,8 +94,9 @@ func TestSlashingMsgs(t *testing.T) { app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: app.LastBlockHeight() + 1}) ctxCheck = baseApp.NewContext(true) - validator, found := stakingKeeper.GetValidator(ctxCheck, sdk.ValAddress(addr1)) - require.True(t, found) + validator, err := stakingKeeper.GetValidator(ctxCheck, sdk.ValAddress(addr1)) + require.NoError(t, err) + require.Equal(t, sdk.ValAddress(addr1).String(), validator.OperatorAddress) require.Equal(t, stakingtypes.Bonded, validator.Status) require.True(math.IntEq(t, bondTokens, validator.BondedTokens())) diff --git a/x/slashing/autocli.go b/x/slashing/autocli.go new file mode 100644 index 000000000000..fede1143e72d --- /dev/null +++ b/x/slashing/autocli.go @@ -0,0 +1,55 @@ +package slashing + +import ( + "fmt" + + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + slashingv1beta "cosmossdk.io/api/cosmos/slashing/v1beta1" + + "github.com/cosmos/cosmos-sdk/version" +) + +func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { + return &autocliv1.ModuleOptions{ + Query: &autocliv1.ServiceCommandDescriptor{ + Service: slashingv1beta.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Params", + Use: "params", + Short: "Query the current slashing parameters", + }, + { + RpcMethod: "SigningInfo", + Use: "signing-info [validator-conspub/address]", + Short: "Query a validator's signing information", + Long: "Query a validator's signing information, with a pubkey (' comet show-validator') or a validator consensus address", + Example: fmt.Sprintf(`%s query slashing signing-info '{"@type":"/cosmos.crypto.ed25519.PubKey","key":"OauFcTKbN5Lx3fJL689cikXBqe+hcp6Y+x0rYUdR9Jk="}'`, version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "cons_address"}, + }, + }, + { + RpcMethod: "SigningInfos", + Use: "signing-infos", + Short: "Query signing information of all validators", + }, + }, + }, + Tx: &autocliv1.ServiceCommandDescriptor{ + Service: slashingv1beta.Msg_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Unjail", + Use: "unjail", + Short: "Unjail a jailed validator", + Example: fmt.Sprintf("%s tx slashing unjail --from [validator]", version.AppName), + }, + { + RpcMethod: "UpdateParams", + Skip: true, // skipped because authority gated + }, + }, + }, + } +} diff --git a/x/slashing/client/cli/flags.go b/x/slashing/client/cli/flags.go deleted file mode 100644 index 4f384512189f..000000000000 --- a/x/slashing/client/cli/flags.go +++ /dev/null @@ -1,5 +0,0 @@ -package cli - -const ( - FlagAddressValidator = "validator" -) diff --git a/x/slashing/client/cli/query.go b/x/slashing/client/cli/query.go deleted file mode 100644 index 500a490d64eb..000000000000 --- a/x/slashing/client/cli/query.go +++ /dev/null @@ -1,141 +0,0 @@ -package cli - -import ( - "strings" - - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/slashing/types" -) - -// GetQueryCmd returns the cli query commands for this module -func GetQueryCmd() *cobra.Command { - // Group slashing queries under a subcommand - slashingQueryCmd := &cobra.Command{ - Use: types.ModuleName, - Short: "Querying commands for the slashing module", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - slashingQueryCmd.AddCommand( - GetCmdQuerySigningInfo(), - GetCmdQueryParams(), - GetCmdQuerySigningInfos(), - ) - - return slashingQueryCmd -} - -// GetCmdQuerySigningInfo implements the command to query signing info. -func GetCmdQuerySigningInfo() *cobra.Command { - cmd := &cobra.Command{ - Use: "signing-info [validator-conspub]", - Short: "Query a validator's signing information", - Long: strings.TrimSpace(`Use a validators' consensus public key to find the signing-info for that validator: - -$ query slashing signing-info '{"@type":"/cosmos.crypto.ed25519.PubKey","key":"OauFcTKbN5Lx3fJL689cikXBqe+hcp6Y+x0rYUdR9Jk="}' -`), - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - var pk cryptotypes.PubKey - if err := clientCtx.Codec.UnmarshalInterfaceJSON([]byte(args[0]), &pk); err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - consAddr := sdk.ConsAddress(pk.Address()) - params := &types.QuerySigningInfoRequest{ConsAddress: consAddr.String()} - res, err := queryClient.SigningInfo(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(&res.ValSigningInfo) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetCmdQuerySigningInfos implements the command to query signing infos. -func GetCmdQuerySigningInfos() *cobra.Command { - cmd := &cobra.Command{ - Use: "signing-infos", - Short: "Query signing information of all validators", - Long: strings.TrimSpace(`signing infos of validators: - -$ query slashing signing-infos -`), - Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - params := &types.QuerySigningInfosRequest{Pagination: pageReq} - res, err := queryClient.SigningInfos(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "signing infos") - - return cmd -} - -// GetCmdQueryParams implements a command to fetch slashing parameters. -func GetCmdQueryParams() *cobra.Command { - cmd := &cobra.Command{ - Use: "params", - Short: "Query the current slashing parameters", - Args: cobra.NoArgs, - Long: strings.TrimSpace(`Query genesis parameters for the slashing module: - -$ query slashing params -`), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryParamsRequest{} - res, err := queryClient.Params(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(&res.Params) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/slashing/client/cli/query_test.go b/x/slashing/client/cli/query_test.go deleted file mode 100644 index 0779025cfc99..000000000000 --- a/x/slashing/client/cli/query_test.go +++ /dev/null @@ -1,148 +0,0 @@ -package cli_test - -import ( - "fmt" - "io" - "testing" - - abci "github.com/cometbft/cometbft/abci/types" - rpcclientmock "github.com/cometbft/cometbft/rpc/client/mock" - "github.com/stretchr/testify/suite" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/crypto/hd" - "github.com/cosmos/cosmos-sdk/crypto/keyring" - "github.com/cosmos/cosmos-sdk/crypto/types" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - sdk "github.com/cosmos/cosmos-sdk/types" - testutilmod "github.com/cosmos/cosmos-sdk/types/module/testutil" - "github.com/cosmos/cosmos-sdk/x/slashing" - "github.com/cosmos/cosmos-sdk/x/slashing/client/cli" -) - -type CLITestSuite struct { - suite.Suite - - kr keyring.Keyring - baseCtx client.Context - clientCtx client.Context - encCfg testutilmod.TestEncodingConfig - - pub types.PubKey - addr sdk.AccAddress -} - -func TestCLITestSuite(t *testing.T) { - suite.Run(t, new(CLITestSuite)) -} - -func (s *CLITestSuite) SetupSuite() { - s.T().Log("setting up integration test suite") - - s.encCfg = testutilmod.MakeTestEncodingConfig(slashing.AppModuleBasic{}) - s.kr = keyring.NewInMemory(s.encCfg.Codec) - s.baseCtx = client.Context{}. - WithKeyring(s.kr). - WithTxConfig(s.encCfg.TxConfig). - WithCodec(s.encCfg.Codec). - WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}). - WithAccountRetriever(client.MockAccountRetriever{}). - WithOutput(io.Discard). - WithChainID("test-chain") - - ctxGen := func() client.Context { - bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) - c := clitestutil.NewMockCometRPC(abci.ResponseQuery{ - Value: bz, - }) - - return s.baseCtx.WithClient(c) - } - s.clientCtx = ctxGen() - - k, _, err := s.clientCtx.Keyring.NewMnemonic("NewValidator", keyring.English, sdk.FullFundraiserPath, keyring.DefaultBIP39Passphrase, hd.Secp256k1) - s.Require().NoError(err) - - pub, err := k.GetPubKey() - s.Require().NoError(err) - - s.pub = pub - s.addr = sdk.AccAddress(pub.Address()) -} - -func (s *CLITestSuite) TestGetCmdQuerySigningInfo() { - pubKeyBz, err := s.encCfg.Codec.MarshalInterfaceJSON(s.pub) - s.Require().NoError(err) - pubKeyStr := string(pubKeyBz) - - testCases := []struct { - name string - args []string - expectErr bool - }{ - {"invalid address", []string{"foo"}, true}, - { - "valid address (json output)", - []string{ - pubKeyStr, - fmt.Sprintf("--%s=json", flags.FlagOutput), - fmt.Sprintf("--%s=1", flags.FlagHeight), - }, - false, - }, - { - "valid address (text output)", - []string{ - pubKeyStr, - fmt.Sprintf("--%s=text", flags.FlagOutput), - fmt.Sprintf("--%s=1", flags.FlagHeight), - }, - false, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQuerySigningInfo() - clientCtx := s.clientCtx - - _, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - } - }) - } -} - -func (s *CLITestSuite) TestGetCmdQueryParams() { - testCases := []struct { - name string - args []string - }{ - { - "json output", - []string{fmt.Sprintf("--%s=json", flags.FlagOutput)}, - }, - { - "text output", - []string{fmt.Sprintf("--%s=text", flags.FlagOutput)}, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryParams() - clientCtx := s.clientCtx - - _, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - s.Require().NoError(err) - }) - } -} diff --git a/x/slashing/client/cli/tx.go b/x/slashing/client/cli/tx.go deleted file mode 100644 index bcb7836e6d7d..000000000000 --- a/x/slashing/client/cli/tx.go +++ /dev/null @@ -1,53 +0,0 @@ -package cli - -import ( - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/tx" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/slashing/types" -) - -// NewTxCmd returns a root CLI command handler for all x/slashing transaction commands. -func NewTxCmd() *cobra.Command { - slashingTxCmd := &cobra.Command{ - Use: types.ModuleName, - Short: "Slashing transaction subcommands", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - slashingTxCmd.AddCommand(NewUnjailTxCmd()) - return slashingTxCmd -} - -// NewUnjailTxCmd returns a CLI command handler for creating a MsgUnjail transaction. -func NewUnjailTxCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "unjail", - Args: cobra.NoArgs, - Short: "unjail validator previously jailed for downtime", - Long: `unjail a jailed validator: - -$ tx slashing unjail --from mykey -`, - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - valAddr := clientCtx.GetFromAddress() - - msg := types.NewMsgUnjail(sdk.ValAddress(valAddr)) - - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} diff --git a/x/slashing/client/cli/tx_test.go b/x/slashing/client/cli/tx_test.go deleted file mode 100644 index c3b5d3803e5c..000000000000 --- a/x/slashing/client/cli/tx_test.go +++ /dev/null @@ -1,50 +0,0 @@ -package cli_test - -import ( - "fmt" - - sdkmath "cosmossdk.io/math" - - "github.com/cosmos/cosmos-sdk/client/flags" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/slashing/client/cli" -) - -func (s *CLITestSuite) TestNewUnjailTxCmd() { - val := s.addr - testCases := []struct { - name string - args []string - expectErrMsg string - }{ - { - "valid transaction", - []string{ - fmt.Sprintf("--%s=%s", flags.FlagFrom, val.String()), - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), // sync mode as there are no funds yet - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(10))).String()), - }, - "", - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.NewUnjailTxCmd() - clientCtx := s.clientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - if tc.expectErrMsg != "" { - s.Require().Error(err) - } else { - s.Require().NoError(err) - txResp := &sdk.TxResponse{} - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), txResp), out.String()) - } - }) - } -} diff --git a/x/slashing/keeper/genesis.go b/x/slashing/keeper/genesis.go index 5fc8586d3946..bb83aabbaeeb 100644 --- a/x/slashing/keeper/genesis.go +++ b/x/slashing/keeper/genesis.go @@ -22,7 +22,7 @@ func (keeper Keeper) InitGenesis(ctx sdk.Context, stakingKeeper types.StakingKee ) for _, info := range data.SigningInfos { - address, err := sdk.ConsAddressFromBech32(info.Address) + address, err := keeper.sk.ConsensusAddressCodec().StringToBytes(info.Address) if err != nil { panic(err) } @@ -30,7 +30,7 @@ func (keeper Keeper) InitGenesis(ctx sdk.Context, stakingKeeper types.StakingKee } for _, array := range data.MissedBlocks { - address, err := sdk.ConsAddressFromBech32(array.Address) + address, err := keeper.sk.ConsensusAddressCodec().StringToBytes(array.Address) if err != nil { panic(err) } diff --git a/x/slashing/keeper/genesis_test.go b/x/slashing/keeper/genesis_test.go index eac73841f166..1997837afffe 100644 --- a/x/slashing/keeper/genesis_test.go +++ b/x/slashing/keeper/genesis_test.go @@ -3,7 +3,7 @@ package keeper_test import ( "time" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/slashing/testutil" @@ -45,7 +45,7 @@ func (s *KeeperTestSuite) TestExportAndInitGenesis() { require.NotEqual(info1, newInfo1) // Initialize genesis with genesis state before tombstone - s.stakingKeeper.EXPECT().IterateValidators(ctx, gomock.Any()).Return() + s.stakingKeeper.EXPECT().IterateValidators(ctx, gomock.Any()).Return(nil) keeper.InitGenesis(ctx, s.stakingKeeper, genesisState) // Validator isTombstoned should return false as GenesisState is initialized diff --git a/x/slashing/keeper/grpc_query.go b/x/slashing/keeper/grpc_query.go index f702edc85ba0..2edce8b78718 100644 --- a/x/slashing/keeper/grpc_query.go +++ b/x/slashing/keeper/grpc_query.go @@ -9,7 +9,6 @@ import ( "cosmossdk.io/store/prefix" "github.com/cosmos/cosmos-sdk/runtime" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" "github.com/cosmos/cosmos-sdk/x/slashing/types" ) @@ -45,7 +44,7 @@ func (k Keeper) SigningInfo(ctx context.Context, req *types.QuerySigningInfoRequ return nil, status.Errorf(codes.InvalidArgument, "invalid request") } - consAddr, err := sdk.ConsAddressFromBech32(req.ConsAddress) + consAddr, err := k.sk.ConsensusAddressCodec().StringToBytes(req.ConsAddress) if err != nil { return nil, err } diff --git a/x/slashing/keeper/hooks.go b/x/slashing/keeper/hooks.go index 0a307d1e72db..f90ba4da96d6 100644 --- a/x/slashing/keeper/hooks.go +++ b/x/slashing/keeper/hooks.go @@ -1,11 +1,13 @@ package keeper import ( + "context" "time" - sdkmath "cosmossdk.io/math" "github.com/cometbft/cometbft/crypto" + sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/slashing/types" ) @@ -23,14 +25,15 @@ func (k Keeper) Hooks() Hooks { } // AfterValidatorBonded updates the signing info start height or create a new signing info -func (h Hooks) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error { +func (h Hooks) AfterValidatorBonded(ctx context.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) signingInfo, err := h.k.GetValidatorSigningInfo(ctx, consAddr) if err == nil { - signingInfo.StartHeight = ctx.BlockHeight() + signingInfo.StartHeight = sdkCtx.BlockHeight() } else { signingInfo = types.NewValidatorSigningInfo( consAddr, - ctx.BlockHeight(), + sdkCtx.BlockHeight(), 0, time.Unix(0, 0), false, @@ -42,49 +45,54 @@ func (h Hooks) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, v } // AfterValidatorRemoved deletes the address-pubkey relation when a validator is removed, -func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, _ sdk.ValAddress) error { +func (h Hooks) AfterValidatorRemoved(ctx context.Context, consAddr sdk.ConsAddress, _ sdk.ValAddress) error { return h.k.deleteAddrPubkeyRelation(ctx, crypto.Address(consAddr)) } // AfterValidatorCreated adds the address-pubkey relation when a validator is created. -func (h Hooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) error { - validator := h.k.sk.Validator(ctx, valAddr) +func (h Hooks) AfterValidatorCreated(ctx context.Context, valAddr sdk.ValAddress) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) + validator, err := h.k.sk.Validator(ctx, valAddr) + if err != nil { + return err + } + consPk, err := validator.ConsPubKey() if err != nil { return err } - return h.k.AddPubkey(ctx, consPk) + return h.k.AddPubkey(sdkCtx, consPk) } -func (h Hooks) AfterValidatorBeginUnbonding(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error { +func (h Hooks) AfterValidatorBeginUnbonding(_ context.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error { return nil } -func (h Hooks) BeforeValidatorModified(_ sdk.Context, _ sdk.ValAddress) error { +func (h Hooks) BeforeValidatorModified(_ context.Context, _ sdk.ValAddress) error { return nil } -func (h Hooks) BeforeDelegationCreated(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error { +func (h Hooks) BeforeDelegationCreated(_ context.Context, _ sdk.AccAddress, _ sdk.ValAddress) error { return nil } -func (h Hooks) BeforeDelegationSharesModified(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error { +func (h Hooks) BeforeDelegationSharesModified(_ context.Context, _ sdk.AccAddress, _ sdk.ValAddress) error { return nil } -func (h Hooks) BeforeDelegationRemoved(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error { +func (h Hooks) BeforeDelegationRemoved(_ context.Context, _ sdk.AccAddress, _ sdk.ValAddress) error { return nil } -func (h Hooks) AfterDelegationModified(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error { +func (h Hooks) AfterDelegationModified(_ context.Context, _ sdk.AccAddress, _ sdk.ValAddress) error { return nil } -func (h Hooks) BeforeValidatorSlashed(_ sdk.Context, _ sdk.ValAddress, _ sdkmath.LegacyDec) error { +func (h Hooks) BeforeValidatorSlashed(_ context.Context, _ sdk.ValAddress, _ sdkmath.LegacyDec) error { return nil } -func (h Hooks) AfterUnbondingInitiated(_ sdk.Context, _ uint64) error { +func (h Hooks) AfterUnbondingInitiated(_ context.Context, _ uint64) error { return nil } diff --git a/x/slashing/keeper/hooks_test.go b/x/slashing/keeper/hooks_test.go index d9c592ffc15b..4d4f729a4c63 100644 --- a/x/slashing/keeper/hooks_test.go +++ b/x/slashing/keeper/hooks_test.go @@ -24,10 +24,10 @@ func (s *KeeperTestSuite) TestAfterValidatorCreatedOrRemoved() { _, pubKey, addr := testdata.KeyTestPubAddr() valAddr := sdk.ValAddress(addr) - validator, err := stakingtypes.NewValidator(sdk.ValAddress(addr), pubKey, stakingtypes.Description{}) + validator, err := stakingtypes.NewValidator(sdk.ValAddress(addr).String(), pubKey, stakingtypes.Description{}) require.NoError(err) - s.stakingKeeper.EXPECT().Validator(ctx, valAddr).Return(validator) + s.stakingKeeper.EXPECT().Validator(ctx, valAddr).Return(validator, nil) err = keeper.Hooks().AfterValidatorCreated(ctx, valAddr) require.NoError(err) diff --git a/x/slashing/keeper/infractions.go b/x/slashing/keeper/infractions.go index 5a6fee86d6a4..003963069f7a 100644 --- a/x/slashing/keeper/infractions.go +++ b/x/slashing/keeper/infractions.go @@ -4,9 +4,10 @@ import ( "context" "fmt" - "cosmossdk.io/core/comet" "github.com/cockroachdb/errors" + "cosmossdk.io/core/comet" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/slashing/types" @@ -23,7 +24,12 @@ func (k Keeper) HandleValidatorSignature(ctx context.Context, addr cryptotypes.A consAddr := sdk.ConsAddress(addr) // don't update missed blocks when validator's jailed - if k.sk.IsValidatorJailed(sdkCtx, consAddr) { + isJailed, err := k.sk.IsValidatorJailed(ctx, consAddr) + if err != nil { + return err + } + + if isJailed { return nil } @@ -105,7 +111,10 @@ func (k Keeper) HandleValidatorSignature(ctx context.Context, addr cryptotypes.A // if we are past the minimum height and the validator has missed too many blocks, punish them if height > minHeight && signInfo.MissedBlocksCounter > maxMissed { - validator := k.sk.ValidatorByConsAddr(sdkCtx, consAddr) + validator, err := k.sk.ValidatorByConsAddr(ctx, consAddr) + if err != nil { + return err + } if validator != nil && !validator.IsJailed() { // Downtime confirmed: slash and jail the validator // We need to retrieve the stake distribution which signed the block, so we subtract ValidatorUpdateDelay from the evidence height, @@ -120,7 +129,11 @@ func (k Keeper) HandleValidatorSignature(ctx context.Context, addr cryptotypes.A return err } - coinsBurned := k.sk.SlashWithInfractionReason(sdkCtx, consAddr, distributionHeight, power, slashFractionDowntime, stakingtypes.Infraction_INFRACTION_DOWNTIME) + coinsBurned, err := k.sk.SlashWithInfractionReason(ctx, consAddr, distributionHeight, power, slashFractionDowntime, stakingtypes.Infraction_INFRACTION_DOWNTIME) + if err != nil { + return err + } + sdkCtx.EventManager().EmitEvent( sdk.NewEvent( types.EventTypeSlash, diff --git a/x/slashing/keeper/keeper.go b/x/slashing/keeper/keeper.go index 374f702f0675..b710e78e3f94 100644 --- a/x/slashing/keeper/keeper.go +++ b/x/slashing/keeper/keeper.go @@ -4,11 +4,10 @@ import ( "context" "fmt" + storetypes "cosmossdk.io/core/store" "cosmossdk.io/log" sdkmath "cosmossdk.io/math" - storetypes "cosmossdk.io/core/store" - "github.com/cosmos/cosmos-sdk/codec" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -84,14 +83,26 @@ func (k Keeper) Slash(ctx context.Context, consAddr sdk.ConsAddress, fraction sd // SlashWithInfractionReason attempts to slash a validator. The slash is delegated to the staking // module to make the necessary validator changes. It specifies an intraction reason. func (k Keeper) SlashWithInfractionReason(ctx context.Context, consAddr sdk.ConsAddress, fraction sdkmath.LegacyDec, power, distributionHeight int64, infraction stakingtypes.Infraction) error { + coinsBurned, err := k.sk.SlashWithInfractionReason(ctx, consAddr, distributionHeight, power, fraction, infraction) + if err != nil { + return err + } + + reasonAttr := sdk.NewAttribute(types.AttributeKeyReason, types.AttributeValueUnspecified) + switch infraction { + case stakingtypes.Infraction_INFRACTION_DOUBLE_SIGN: + reasonAttr = sdk.NewAttribute(types.AttributeKeyReason, types.AttributeValueDoubleSign) + case stakingtypes.Infraction_INFRACTION_DOWNTIME: + reasonAttr = sdk.NewAttribute(types.AttributeKeyReason, types.AttributeValueMissingSignature) + } + sdkCtx := sdk.UnwrapSDKContext(ctx) - coinsBurned := k.sk.SlashWithInfractionReason(sdkCtx, consAddr, distributionHeight, power, fraction, infraction) sdkCtx.EventManager().EmitEvent( sdk.NewEvent( types.EventTypeSlash, sdk.NewAttribute(types.AttributeKeyAddress, consAddr.String()), sdk.NewAttribute(types.AttributeKeyPower, fmt.Sprintf("%d", power)), - sdk.NewAttribute(types.AttributeKeyReason, types.AttributeValueDoubleSign), + reasonAttr, sdk.NewAttribute(types.AttributeKeyBurnedCoins, coinsBurned.String()), ), ) diff --git a/x/slashing/keeper/keeper_test.go b/x/slashing/keeper/keeper_test.go index 83f44bba3359..969fdac6f7d8 100644 --- a/x/slashing/keeper/keeper_test.go +++ b/x/slashing/keeper/keeper_test.go @@ -3,16 +3,16 @@ package keeper_test import ( "testing" - "github.com/golang/mock/gomock" - "github.com/stretchr/testify/suite" - cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" cmttime "github.com/cometbft/cometbft/types/time" + "github.com/stretchr/testify/suite" + "go.uber.org/mock/gomock" sdkmath "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/runtime" sdktestutil "github.com/cosmos/cosmos-sdk/testutil" "github.com/cosmos/cosmos-sdk/testutil/testdata" @@ -48,6 +48,8 @@ func (s *KeeperTestSuite) SetupTest() { // gomock initializations ctrl := gomock.NewController(s.T()) s.stakingKeeper = slashingtestutil.NewMockStakingKeeper(ctrl) + s.stakingKeeper.EXPECT().ValidatorAddressCodec().Return(address.NewBech32Codec("cosmosvaloper")).AnyTimes() + s.stakingKeeper.EXPECT().ConsensusAddressCodec().Return(address.NewBech32Codec("cosmosvalcons")).AnyTimes() s.ctx = ctx s.slashingKeeper = slashingkeeper.NewKeeper( @@ -90,7 +92,7 @@ func (s *KeeperTestSuite) TestJailAndSlash() { sdk.TokensToConsensusPower(sdkmath.NewInt(1), sdk.DefaultPowerReduction), slashFractionDoubleSign, stakingtypes.Infraction_INFRACTION_UNSPECIFIED, - ).Return(sdkmath.NewInt(0)) + ).Return(sdkmath.NewInt(0), nil) s.slashingKeeper.Slash( s.ctx, @@ -100,7 +102,7 @@ func (s *KeeperTestSuite) TestJailAndSlash() { s.ctx.BlockHeight(), ) - s.stakingKeeper.EXPECT().Jail(s.ctx, consAddr).Return() + s.stakingKeeper.EXPECT().Jail(s.ctx, consAddr).Return(nil) s.slashingKeeper.Jail(s.ctx, consAddr) } @@ -114,7 +116,7 @@ func (s *KeeperTestSuite) TestJailAndSlashWithInfractionReason() { sdk.TokensToConsensusPower(sdkmath.NewInt(1), sdk.DefaultPowerReduction), slashFractionDoubleSign, stakingtypes.Infraction_INFRACTION_DOUBLE_SIGN, - ).Return(sdkmath.NewInt(0)) + ).Return(sdkmath.NewInt(0), nil) s.slashingKeeper.SlashWithInfractionReason( s.ctx, @@ -125,7 +127,7 @@ func (s *KeeperTestSuite) TestJailAndSlashWithInfractionReason() { stakingtypes.Infraction_INFRACTION_DOUBLE_SIGN, ) - s.stakingKeeper.EXPECT().Jail(s.ctx, consAddr).Return() + s.stakingKeeper.EXPECT().Jail(s.ctx, consAddr).Return(nil) s.slashingKeeper.Jail(s.ctx, consAddr) } diff --git a/x/slashing/keeper/msg_server.go b/x/slashing/keeper/msg_server.go index b5663393342f..70e5fc66d23c 100644 --- a/x/slashing/keeper/msg_server.go +++ b/x/slashing/keeper/msg_server.go @@ -46,7 +46,7 @@ func (k msgServer) UpdateParams(goCtx context.Context, msg *types.MsgUpdateParam // Validators must submit a transaction to unjail itself after // having been jailed (and thus unbonded) for downtime func (k msgServer) Unjail(goCtx context.Context, msg *types.MsgUnjail) (*types.MsgUnjailResponse, error) { - valAddr, err := sdk.ValAddressFromBech32(msg.ValidatorAddr) + valAddr, err := k.sk.ValidatorAddressCodec().StringToBytes(msg.ValidatorAddr) if err != nil { return nil, sdkerrors.ErrInvalidAddress.Wrapf("validator input address: %s", err) } diff --git a/x/slashing/keeper/msg_server_test.go b/x/slashing/keeper/msg_server_test.go index cb401957771e..682379972d25 100644 --- a/x/slashing/keeper/msg_server_test.go +++ b/x/slashing/keeper/msg_server_test.go @@ -167,11 +167,11 @@ func (s *KeeperTestSuite) TestUnjail() { malleate: func() *slashingtypes.MsgUnjail { _, pubKey, addr := testdata.KeyTestPubAddr() valAddr := sdk.ValAddress(addr) - val, err := types.NewValidator(valAddr, pubKey, types.Description{Moniker: "test"}) + val, err := types.NewValidator(valAddr.String(), pubKey, types.Description{Moniker: "test"}) s.Require().NoError(err) - s.stakingKeeper.EXPECT().Validator(s.ctx, valAddr).Return(val) - s.stakingKeeper.EXPECT().Delegation(s.ctx, addr, valAddr).Return(nil) + s.stakingKeeper.EXPECT().Validator(s.ctx, valAddr).Return(val, nil) + s.stakingKeeper.EXPECT().Delegation(s.ctx, addr, valAddr).Return(nil, nil) return &slashingtypes.MsgUnjail{ ValidatorAddr: sdk.ValAddress(addr).String(), @@ -186,7 +186,7 @@ func (s *KeeperTestSuite) TestUnjail() { _, _, addr := testdata.KeyTestPubAddr() valAddr := sdk.ValAddress(addr) - s.stakingKeeper.EXPECT().Validator(s.ctx, valAddr).Return(nil) + s.stakingKeeper.EXPECT().Validator(s.ctx, valAddr).Return(nil, nil) return &slashingtypes.MsgUnjail{ ValidatorAddr: valAddr.String(), @@ -201,7 +201,7 @@ func (s *KeeperTestSuite) TestUnjail() { _, pubKey, addr := testdata.KeyTestPubAddr() valAddr := sdk.ValAddress(addr) - val, err := types.NewValidator(valAddr, pubKey, types.Description{Moniker: "test"}) + val, err := types.NewValidator(valAddr.String(), pubKey, types.Description{Moniker: "test"}) val.Tokens = sdkmath.NewInt(1000) val.DelegatorShares = sdkmath.LegacyNewDec(1) val.Jailed = false @@ -213,10 +213,10 @@ func (s *KeeperTestSuite) TestUnjail() { s.slashingKeeper.SetValidatorSigningInfo(s.ctx, sdk.ConsAddress(addr), info) - s.stakingKeeper.EXPECT().Validator(s.ctx, valAddr).Return(val) - del := types.NewDelegation(addr, valAddr, sdkmath.LegacyNewDec(100)) + s.stakingKeeper.EXPECT().Validator(s.ctx, valAddr).Return(val, nil) + del := types.NewDelegation(addr.String(), valAddr.String(), sdkmath.LegacyNewDec(100)) - s.stakingKeeper.EXPECT().Delegation(s.ctx, addr, valAddr).Return(del) + s.stakingKeeper.EXPECT().Delegation(s.ctx, addr, valAddr).Return(del, nil) return &slashingtypes.MsgUnjail{ ValidatorAddr: sdk.ValAddress(addr).String(), @@ -231,7 +231,7 @@ func (s *KeeperTestSuite) TestUnjail() { _, pubKey, addr := testdata.KeyTestPubAddr() valAddr := sdk.ValAddress(addr) - val, err := types.NewValidator(valAddr, pubKey, types.Description{Moniker: "test"}) + val, err := types.NewValidator(valAddr.String(), pubKey, types.Description{Moniker: "test"}) val.Tokens = sdkmath.NewInt(1000) val.DelegatorShares = sdkmath.LegacyNewDec(1) val.Jailed = true @@ -243,10 +243,10 @@ func (s *KeeperTestSuite) TestUnjail() { s.slashingKeeper.SetValidatorSigningInfo(s.ctx, sdk.ConsAddress(addr), info) - s.stakingKeeper.EXPECT().Validator(s.ctx, valAddr).Return(val) - del := types.NewDelegation(addr, valAddr, sdkmath.LegacyNewDec(100)) + s.stakingKeeper.EXPECT().Validator(s.ctx, valAddr).Return(val, nil) + del := types.NewDelegation(addr.String(), valAddr.String(), sdkmath.LegacyNewDec(100)) - s.stakingKeeper.EXPECT().Delegation(s.ctx, addr, valAddr).Return(del) + s.stakingKeeper.EXPECT().Delegation(s.ctx, addr, valAddr).Return(del, nil) return &slashingtypes.MsgUnjail{ ValidatorAddr: sdk.ValAddress(addr).String(), @@ -261,7 +261,7 @@ func (s *KeeperTestSuite) TestUnjail() { _, pubKey, addr := testdata.KeyTestPubAddr() valAddr := sdk.ValAddress(addr) - val, err := types.NewValidator(valAddr, pubKey, types.Description{Moniker: "test"}) + val, err := types.NewValidator(valAddr.String(), pubKey, types.Description{Moniker: "test"}) val.Tokens = sdkmath.NewInt(1000) val.DelegatorShares = sdkmath.LegacyNewDec(1) val.Jailed = true @@ -273,10 +273,10 @@ func (s *KeeperTestSuite) TestUnjail() { s.slashingKeeper.SetValidatorSigningInfo(s.ctx, sdk.ConsAddress(addr), info) - s.stakingKeeper.EXPECT().Validator(s.ctx, valAddr).Return(val) - del := types.NewDelegation(addr, valAddr, sdkmath.LegacyNewDec(10000)) + s.stakingKeeper.EXPECT().Validator(s.ctx, valAddr).Return(val, nil) + del := types.NewDelegation(addr.String(), valAddr.String(), sdkmath.LegacyNewDec(10000)) - s.stakingKeeper.EXPECT().Delegation(s.ctx, addr, valAddr).Return(del) + s.stakingKeeper.EXPECT().Delegation(s.ctx, addr, valAddr).Return(del, nil) return &slashingtypes.MsgUnjail{ ValidatorAddr: sdk.ValAddress(addr).String(), @@ -291,7 +291,7 @@ func (s *KeeperTestSuite) TestUnjail() { _, pubKey, addr := testdata.KeyTestPubAddr() valAddr := sdk.ValAddress(addr) - val, err := types.NewValidator(valAddr, pubKey, types.Description{Moniker: "test"}) + val, err := types.NewValidator(valAddr.String(), pubKey, types.Description{Moniker: "test"}) val.Tokens = sdkmath.NewInt(1000) val.DelegatorShares = sdkmath.LegacyNewDec(1) @@ -303,11 +303,11 @@ func (s *KeeperTestSuite) TestUnjail() { s.slashingKeeper.SetValidatorSigningInfo(s.ctx, sdk.ConsAddress(addr), info) - s.stakingKeeper.EXPECT().Validator(s.ctx, valAddr).Return(val) - del := types.NewDelegation(addr, valAddr, sdkmath.LegacyNewDec(100)) + s.stakingKeeper.EXPECT().Validator(s.ctx, valAddr).Return(val, nil) + del := types.NewDelegation(addr.String(), valAddr.String(), sdkmath.LegacyNewDec(100)) - s.stakingKeeper.EXPECT().Delegation(s.ctx, addr, valAddr).Return(del) - s.stakingKeeper.EXPECT().Unjail(s.ctx, sdk.ConsAddress(addr)).Return() + s.stakingKeeper.EXPECT().Delegation(s.ctx, addr, valAddr).Return(del, nil) + s.stakingKeeper.EXPECT().Unjail(s.ctx, sdk.ConsAddress(addr)).Return(nil) return &slashingtypes.MsgUnjail{ ValidatorAddr: sdk.ValAddress(addr).String(), diff --git a/x/slashing/keeper/signing_info.go b/x/slashing/keeper/signing_info.go index 7aec8e50cae1..97e85f4cab1b 100644 --- a/x/slashing/keeper/signing_info.go +++ b/x/slashing/keeper/signing_info.go @@ -4,9 +4,10 @@ import ( "context" "time" + "github.com/bits-and-blooms/bitset" + "cosmossdk.io/errors" storetypes "cosmossdk.io/store/types" - "github.com/bits-and-blooms/bitset" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/slashing/types" diff --git a/x/slashing/keeper/signing_info_test.go b/x/slashing/keeper/signing_info_test.go index c24ece21c6ec..e6e0af449f0b 100644 --- a/x/slashing/keeper/signing_info_test.go +++ b/x/slashing/keeper/signing_info_test.go @@ -4,7 +4,6 @@ import ( "time" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/slashing/testutil" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" ) diff --git a/x/slashing/keeper/slash_redelegation_test.go b/x/slashing/keeper/slash_redelegation_test.go new file mode 100644 index 000000000000..7ebbeb1da77f --- /dev/null +++ b/x/slashing/keeper/slash_redelegation_test.go @@ -0,0 +1,155 @@ +package keeper_test + +import ( + "fmt" + "testing" + "time" + + "github.com/stretchr/testify/require" + + "cosmossdk.io/core/header" + "cosmossdk.io/depinject" + "cosmossdk.io/log" + "cosmossdk.io/math" + + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + sdk "github.com/cosmos/cosmos-sdk/types" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + banktestutil "github.com/cosmos/cosmos-sdk/x/bank/testutil" + distributionkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" + slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" + "github.com/cosmos/cosmos-sdk/x/slashing/testutil" + stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" +) + +func TestSlashRedelegation(t *testing.T) { + // setting up + var stakingKeeper *stakingkeeper.Keeper + var bankKeeper bankkeeper.Keeper + var slashKeeper slashingkeeper.Keeper + var distrKeeper distributionkeeper.Keeper + + app, err := simtestutil.Setup(depinject.Configs( + depinject.Supply(log.NewNopLogger()), + testutil.AppConfig, + ), &stakingKeeper, &bankKeeper, &slashKeeper, &distrKeeper) + require.NoError(t, err) + + // get sdk context, staking msg server and bond denom + ctx := app.BaseApp.NewContext(false) + stakingMsgServer := stakingkeeper.NewMsgServerImpl(stakingKeeper) + bondDenom, err := stakingKeeper.BondDenom(ctx) + require.NoError(t, err) + + // evilVal will be slashed, goodVal won't be slashed + evilValPubKey := secp256k1.GenPrivKey().PubKey() + goodValPubKey := secp256k1.GenPrivKey().PubKey() + + // both test acc 1 and 2 delegated to evil val, both acc should be slashed when evil val is slashed + // test acc 1 use the "undelegation after redelegation" trick (redelegate to good val and then undelegate) to avoid slashing + // test acc 2 only undelegate from evil val + testAcc1 := sdk.AccAddress([]byte("addr1_______________")) + testAcc2 := sdk.AccAddress([]byte("addr2_______________")) + + // fund acc 1 and acc 2 + testCoins := sdk.NewCoins(sdk.NewCoin(bondDenom, stakingKeeper.TokensFromConsensusPower(ctx, 10))) + banktestutil.FundAccount(ctx, bankKeeper, testAcc1, testCoins) + banktestutil.FundAccount(ctx, bankKeeper, testAcc2, testCoins) + + balance1Before := bankKeeper.GetBalance(ctx, testAcc1, bondDenom) + balance2Before := bankKeeper.GetBalance(ctx, testAcc2, bondDenom) + + // assert acc 1 and acc 2 balance + require.Equal(t, balance1Before.Amount.String(), testCoins[0].Amount.String()) + require.Equal(t, balance2Before.Amount.String(), testCoins[0].Amount.String()) + + // creating evil val + evilValAddr := sdk.ValAddress(evilValPubKey.Address()) + banktestutil.FundAccount(ctx, bankKeeper, sdk.AccAddress(evilValAddr), testCoins) + createValMsg1, _ := stakingtypes.NewMsgCreateValidator( + evilValAddr.String(), evilValPubKey, testCoins[0], stakingtypes.Description{Details: "test"}, stakingtypes.NewCommissionRates(math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDec(0)), math.OneInt()) + _, err = stakingMsgServer.CreateValidator(ctx, createValMsg1) + require.NoError(t, err) + + // creating good val + goodValAddr := sdk.ValAddress(goodValPubKey.Address()) + banktestutil.FundAccount(ctx, bankKeeper, sdk.AccAddress(goodValAddr), testCoins) + createValMsg2, _ := stakingtypes.NewMsgCreateValidator( + goodValAddr.String(), goodValPubKey, testCoins[0], stakingtypes.Description{Details: "test"}, stakingtypes.NewCommissionRates(math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDec(0)), math.OneInt()) + _, err = stakingMsgServer.CreateValidator(ctx, createValMsg2) + require.NoError(t, err) + + // next block, commit height 2, move to height 3 + // acc 1 and acc 2 delegate to evil val + ctx = ctx.WithBlockHeight(app.LastBlockHeight() + 1).WithHeaderInfo(header.Info{Height: app.LastBlockHeight() + 1}) + fmt.Println() + ctx, err = simtestutil.NextBlock(app, ctx, time.Duration(1)) + require.NoError(t, err) + + // Acc 2 delegate + delMsg := stakingtypes.NewMsgDelegate(testAcc2.String(), evilValAddr.String(), testCoins[0]) + _, err = stakingMsgServer.Delegate(ctx, delMsg) + require.NoError(t, err) + + // Acc 1 delegate + delMsg = stakingtypes.NewMsgDelegate(testAcc1.String(), evilValAddr.String(), testCoins[0]) + _, err = stakingMsgServer.Delegate(ctx, delMsg) + require.NoError(t, err) + + // next block, commit height 3, move to height 4 + // with the new delegations, evil val increases in voting power and commit byzantine behavior at height 4 consensus + // at the same time, acc 1 and acc 2 withdraw delegation from evil val + ctx, err = simtestutil.NextBlock(app, ctx, time.Duration(1)) + require.NoError(t, err) + + evilVal, err := stakingKeeper.GetValidator(ctx, evilValAddr) + require.NoError(t, err) + + evilPower := stakingKeeper.TokensToConsensusPower(ctx, evilVal.Tokens) + + // Acc 1 redelegate from evil val to good val + redelMsg := stakingtypes.NewMsgBeginRedelegate(testAcc1.String(), evilValAddr.String(), goodValAddr.String(), testCoins[0]) + _, err = stakingMsgServer.BeginRedelegate(ctx, redelMsg) + require.NoError(t, err) + + // Acc 1 undelegate from good val + undelMsg := stakingtypes.NewMsgUndelegate(testAcc1.String(), goodValAddr.String(), testCoins[0]) + _, err = stakingMsgServer.Undelegate(ctx, undelMsg) + require.NoError(t, err) + + // Acc 2 undelegate from evil val + undelMsg = stakingtypes.NewMsgUndelegate(testAcc2.String(), evilValAddr.String(), testCoins[0]) + _, err = stakingMsgServer.Undelegate(ctx, undelMsg) + require.NoError(t, err) + + // next block, commit height 4, move to height 5 + // Slash evil val for byzantine behavior at height 4 consensus, + // at which acc 1 and acc 2 still contributed to evil val voting power + // even tho they undelegate at block 4, the valset update is applied after committed block 4 when height 4 consensus already passes + ctx, err = simtestutil.NextBlock(app, ctx, time.Duration(1)) + require.NoError(t, err) + + // slash evil val with slash factor = 0.9, leaving only 10% of stake after slashing + evilVal, _ = stakingKeeper.GetValidator(ctx, evilValAddr) + evilValConsAddr, err := evilVal.GetConsAddr() + require.NoError(t, err) + + err = slashKeeper.Slash(ctx, evilValConsAddr, math.LegacyMustNewDecFromStr("0.9"), evilPower, 3) + require.NoError(t, err) + + // one eternity later + ctx, err = simtestutil.NextBlock(app, ctx, time.Duration(1000000000000000000)) + require.NoError(t, err) + + ctx, err = simtestutil.NextBlock(app, ctx, time.Duration(1)) + require.NoError(t, err) + + // confirm that account 1 and account 2 has been slashed, and the slash amount is correct + balance1AfterSlashing := bankKeeper.GetBalance(ctx, testAcc1, bondDenom) + balance2AfterSlashing := bankKeeper.GetBalance(ctx, testAcc2, bondDenom) + + require.Equal(t, balance1AfterSlashing.Amount.Mul(math.NewIntFromUint64(10)).String(), balance1Before.Amount.String()) + require.Equal(t, balance2AfterSlashing.Amount.Mul(math.NewIntFromUint64(10)).String(), balance2Before.Amount.String()) +} diff --git a/x/slashing/keeper/unjail.go b/x/slashing/keeper/unjail.go index 92168dc2c76a..b3ab0706e243 100644 --- a/x/slashing/keeper/unjail.go +++ b/x/slashing/keeper/unjail.go @@ -12,14 +12,20 @@ import ( // Unjail calls the staking Unjail function to unjail a validator if the // jailed period has concluded func (k Keeper) Unjail(ctx context.Context, validatorAddr sdk.ValAddress) error { - sdkCtx := sdk.UnwrapSDKContext(ctx) - validator := k.sk.Validator(sdkCtx, validatorAddr) + validator, err := k.sk.Validator(ctx, validatorAddr) + if err != nil { + return err + } if validator == nil { return types.ErrNoValidatorForAddress } // cannot be unjailed if no self-delegation exists - selfDel := k.sk.Delegation(sdkCtx, sdk.AccAddress(validatorAddr), validatorAddr) + selfDel, err := k.sk.Delegation(ctx, sdk.AccAddress(validatorAddr), validatorAddr) + if err != nil { + return err + } + if selfDel == nil { return types.ErrMissingSelfDelegation } @@ -57,11 +63,11 @@ func (k Keeper) Unjail(ctx context.Context, validatorAddr sdk.ValAddress) error } // cannot be unjailed until out of jail + sdkCtx := sdk.UnwrapSDKContext(ctx) if sdkCtx.BlockHeader().Time.Before(info.JailedUntil) { return types.ErrValidatorJailed } } - k.sk.Unjail(sdkCtx, consAddr) - return nil + return k.sk.Unjail(ctx, consAddr) } diff --git a/x/slashing/migrations/v2/store_test.go b/x/slashing/migrations/v2/store_test.go index c1f7f0fec6d1..4b8794c42db6 100644 --- a/x/slashing/migrations/v2/store_test.go +++ b/x/slashing/migrations/v2/store_test.go @@ -4,9 +4,10 @@ import ( "bytes" "testing" - storetypes "cosmossdk.io/store/types" "github.com/stretchr/testify/require" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/testutil" "github.com/cosmos/cosmos-sdk/testutil/testdata" diff --git a/x/slashing/migrations/v4/keys.go b/x/slashing/migrations/v4/keys.go index 1ac42b6c1aff..c5ab30ff72bd 100644 --- a/x/slashing/migrations/v4/keys.go +++ b/x/slashing/migrations/v4/keys.go @@ -28,7 +28,7 @@ func ValidatorSigningInfoAddress(key []byte) (v sdk.ConsAddress) { } func validatorMissedBlockBitArrayPrefixKey(v sdk.ConsAddress) []byte { - return append(validatorMissedBlockBitArrayKeyPrefix, v.Bytes()...) + return append(validatorMissedBlockBitArrayKeyPrefix, address.MustLengthPrefix(v.Bytes())...) } func ValidatorMissedBlockBitArrayKey(v sdk.ConsAddress, i int64) []byte { diff --git a/x/slashing/migrations/v4/migrate.go b/x/slashing/migrations/v4/migrate.go index 01480c05e185..2771e877b3da 100644 --- a/x/slashing/migrations/v4/migrate.go +++ b/x/slashing/migrations/v4/migrate.go @@ -1,11 +1,12 @@ package v4 import ( - "cosmossdk.io/errors" - storetypes "cosmossdk.io/store/types" "github.com/bits-and-blooms/bitset" gogotypes "github.com/cosmos/gogoproto/types" + "cosmossdk.io/errors" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/slashing/types" diff --git a/x/slashing/migrations/v4/migrate_test.go b/x/slashing/migrations/v4/migrate_test.go index a49ae658166f..fc8a043610b9 100644 --- a/x/slashing/migrations/v4/migrate_test.go +++ b/x/slashing/migrations/v4/migrate_test.go @@ -3,11 +3,12 @@ package v4_test import ( "testing" - storetypes "cosmossdk.io/store/types" "github.com/bits-and-blooms/bitset" gogotypes "github.com/cosmos/gogoproto/types" "github.com/stretchr/testify/require" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" @@ -40,10 +41,6 @@ func TestMigrate(t *testing.T) { err := v4.Migrate(ctx, cdc, store, params) require.NoError(t, err) - // ensure old entries no longer exist and new bitmap chunk entries exist - entries := v4.GetValidatorMissedBlocks(ctx, cdc, store, consAddr, params) - require.Empty(t, entries) - for i := int64(0); i < params.SignedBlocksWindow; i++ { chunkIndex := i / v4.MissedBlockBitmapChunkSize chunk := store.Get(v4.ValidatorMissedBlockBitmapKey(consAddr, chunkIndex)) diff --git a/x/slashing/module.go b/x/slashing/module.go index b953b83ecaeb..6fd9b89b01ce 100644 --- a/x/slashing/module.go +++ b/x/slashing/module.go @@ -5,13 +5,12 @@ import ( "encoding/json" "fmt" + gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" + modulev1 "cosmossdk.io/api/cosmos/slashing/module/v1" "cosmossdk.io/core/appmodule" store "cosmossdk.io/core/store" "cosmossdk.io/depinject" - abci "github.com/cometbft/cometbft/abci/types" - gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" @@ -21,7 +20,6 @@ import ( simtypes "github.com/cosmos/cosmos-sdk/types/simulation" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/cosmos/cosmos-sdk/x/slashing/client/cli" "github.com/cosmos/cosmos-sdk/x/slashing/exported" "github.com/cosmos/cosmos-sdk/x/slashing/keeper" "github.com/cosmos/cosmos-sdk/x/slashing/simulation" @@ -33,8 +31,13 @@ import ( const ConsensusVersion = 4 var ( - _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleBasic = AppModule{} _ module.AppModuleSimulation = AppModule{} + _ module.HasGenesis = AppModule{} + _ module.HasServices = AppModule{} + + _ appmodule.AppModule = AppModule{} + _ appmodule.HasBeginBlocker = AppModule{} ) // AppModuleBasic defines the basic application module used by the slashing module. @@ -42,8 +45,6 @@ type AppModuleBasic struct { cdc codec.Codec } -var _ module.AppModuleBasic = AppModuleBasic{} - // Name returns the slashing module's name. func (AppModuleBasic) Name() string { return types.ModuleName @@ -82,16 +83,6 @@ func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *g } } -// GetTxCmd returns the root tx command for the slashing module. -func (AppModuleBasic) GetTxCmd() *cobra.Command { - return cli.NewTxCmd() -} - -// GetQueryCmd returns no root query command for the slashing module. -func (AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd() -} - // AppModule implements an application module for the slashing module. type AppModule struct { AppModuleBasic @@ -127,22 +118,12 @@ func NewAppModule( } } -var ( - _ appmodule.AppModule = AppModule{} - _ appmodule.HasBeginBlocker = AppModule{} -) - // IsOnePerModuleType implements the depinject.OnePerModuleType interface. func (am AppModule) IsOnePerModuleType() {} // IsAppModule implements the appmodule.AppModule interface. func (am AppModule) IsAppModule() {} -// Name returns the slashing module's name. -func (AppModule) Name() string { - return types.ModuleName -} - // RegisterServices registers module services. func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) @@ -164,11 +145,10 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { // InitGenesis performs genesis initialization for the slashing module. It returns // no validator updates. -func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate { +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) { var genesisState types.GenesisState cdc.MustUnmarshalJSON(data, &genesisState) am.keeper.InitGenesis(ctx, am.stakingKeeper, &genesisState) - return []abci.ValidatorUpdate{} } // ExportGenesis returns the exported genesis state as raw bytes for the slashing diff --git a/x/slashing/simulation/genesis_test.go b/x/slashing/simulation/genesis_test.go index b24c6e08d60f..33d42e8e333c 100644 --- a/x/slashing/simulation/genesis_test.go +++ b/x/slashing/simulation/genesis_test.go @@ -9,6 +9,7 @@ import ( "github.com/stretchr/testify/require" sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/types/module" diff --git a/x/slashing/simulation/operations.go b/x/slashing/simulation/operations.go index a2618a522c5a..280e06f7eec5 100644 --- a/x/slashing/simulation/operations.go +++ b/x/slashing/simulation/operations.go @@ -63,12 +63,22 @@ func SimulateMsgUnjail( ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { msgType := sdk.MsgTypeURL(&types.MsgUnjail{}) - validator, ok := testutil.RandSliceElem(r, sk.GetAllValidators(ctx)) + allVals, err := sk.GetAllValidators(ctx) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msgType, "unable to get all validators"), nil, err + } + + validator, ok := testutil.RandSliceElem(r, allVals) if !ok { return simtypes.NoOpMsg(types.ModuleName, msgType, "validator is not ok"), nil, nil // skip } - simAccount, found := simtypes.FindAccount(accs, sdk.AccAddress(validator.GetOperator())) + bz, err := sk.ValidatorAddressCodec().StringToBytes(validator.GetOperator()) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msgType, "unable to convert validator address to bytes"), nil, err + } + + simAccount, found := simtypes.FindAccount(accs, sdk.AccAddress(bz)) if !found { return simtypes.NoOpMsg(types.ModuleName, msgType, "unable to find account"), nil, nil // skip } @@ -87,12 +97,16 @@ func SimulateMsgUnjail( return simtypes.NoOpMsg(types.ModuleName, msgType, "unable to find validator signing info"), nil, err // skip } - selfDel := sk.Delegation(ctx, simAccount.Address, validator.GetOperator()) + selfDel, err := sk.Delegation(ctx, simAccount.Address, bz) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msgType, "unable to get self delegation"), nil, err + } + if selfDel == nil { return simtypes.NoOpMsg(types.ModuleName, msgType, "self delegation is nil"), nil, nil // skip } - account := ak.GetAccount(ctx, sdk.AccAddress(validator.GetOperator())) + account := ak.GetAccount(ctx, sdk.AccAddress(bz)) spendable := bk.SpendableCoins(ctx, account.GetAddress()) fees, err := simtypes.RandomFees(r, ctx, spendable) diff --git a/x/slashing/simulation/operations_test.go b/x/slashing/simulation/operations_test.go index f0d970a41043..e55e207ae021 100644 --- a/x/slashing/simulation/operations_test.go +++ b/x/slashing/simulation/operations_test.go @@ -175,9 +175,10 @@ func (suite *SimTestSuite) TestSimulateMsgUnjail() { validator0, issuedShares := validator0.AddTokensFromDel(delTokens) val0AccAddress, err := sdk.ValAddressFromBech32(validator0.OperatorAddress) suite.Require().NoError(err) - selfDelegation := stakingtypes.NewDelegation(val0AccAddress.Bytes(), validator0.GetOperator(), issuedShares) - suite.stakingKeeper.SetDelegation(ctx, selfDelegation) - suite.distrKeeper.SetDelegatorStartingInfo(ctx, validator0.GetOperator(), val0AccAddress.Bytes(), distrtypes.NewDelegatorStartingInfo(2, math.LegacyOneDec(), 200)) + + selfDelegation := stakingtypes.NewDelegation(suite.accounts[0].Address.String(), validator0.GetOperator(), issuedShares) + suite.Require().NoError(suite.stakingKeeper.SetDelegation(ctx, selfDelegation)) + suite.Require().NoError(suite.distrKeeper.SetDelegatorStartingInfo(ctx, val0AccAddress, val0AccAddress.Bytes(), distrtypes.NewDelegatorStartingInfo(2, math.LegacyOneDec(), 200))) // begin a new block suite.app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: suite.app.LastBlockHeight() + 1, Hash: suite.app.LastCommitID().Hash, Time: blockTime}) @@ -204,7 +205,7 @@ func getTestingValidator(ctx sdk.Context, stakingKeeper *stakingkeeper.Keeper, a account := accounts[n] valPubKey := account.ConsKey.PubKey() valAddr := sdk.ValAddress(account.PubKey.Address().Bytes()) - validator, err := stakingtypes.NewValidator(valAddr, valPubKey, stakingtypes.Description{}) + validator, err := stakingtypes.NewValidator(valAddr.String(), valPubKey, stakingtypes.Description{}) if err != nil { return stakingtypes.Validator{}, fmt.Errorf("failed to create validator: %w", err) } diff --git a/x/slashing/simulation/proposals_test.go b/x/slashing/simulation/proposals_test.go index 356c53777155..67f00516193d 100644 --- a/x/slashing/simulation/proposals_test.go +++ b/x/slashing/simulation/proposals_test.go @@ -5,10 +5,11 @@ import ( "testing" "time" - sdkmath "cosmossdk.io/math" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "gotest.tools/v3/assert" + sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/address" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" diff --git a/x/slashing/testutil/expected_keepers_mocks.go b/x/slashing/testutil/expected_keepers_mocks.go index 037343fb226f..e4844a5dd7c8 100644 --- a/x/slashing/testutil/expected_keepers_mocks.go +++ b/x/slashing/testutil/expected_keepers_mocks.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: x/slashing/types/expected_keepers.go +// +// Generated by this command: +// +// mockgen -source=x/slashing/types/expected_keepers.go -package testutil -destination x/slashing/testutil/expected_keepers_mocks.go +// // Package testutil is a generated GoMock package. package testutil @@ -8,17 +13,19 @@ import ( context "context" reflect "reflect" + address "cosmossdk.io/core/address" math "cosmossdk.io/math" types "github.com/cosmos/cosmos-sdk/types" types0 "github.com/cosmos/cosmos-sdk/x/params/types" types1 "github.com/cosmos/cosmos-sdk/x/staking/types" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockAccountKeeper is a mock of AccountKeeper interface. type MockAccountKeeper struct { ctrl *gomock.Controller recorder *MockAccountKeeperMockRecorder + isgomock struct{} } // MockAccountKeeperMockRecorder is the mock recorder for MockAccountKeeper. @@ -47,7 +54,7 @@ func (m *MockAccountKeeper) GetAccount(ctx context.Context, addr types.AccAddres } // GetAccount indicates an expected call of GetAccount. -func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetAccount), ctx, addr) } @@ -59,7 +66,7 @@ func (m *MockAccountKeeper) IterateAccounts(ctx context.Context, process func(ty } // IterateAccounts indicates an expected call of IterateAccounts. -func (mr *MockAccountKeeperMockRecorder) IterateAccounts(ctx, process interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) IterateAccounts(ctx, process any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateAccounts", reflect.TypeOf((*MockAccountKeeper)(nil).IterateAccounts), ctx, process) } @@ -68,6 +75,7 @@ func (mr *MockAccountKeeperMockRecorder) IterateAccounts(ctx, process interface{ type MockBankKeeper struct { ctrl *gomock.Controller recorder *MockBankKeeperMockRecorder + isgomock struct{} } // MockBankKeeperMockRecorder is the mock recorder for MockBankKeeper. @@ -96,7 +104,7 @@ func (m *MockBankKeeper) GetAllBalances(ctx context.Context, addr types.AccAddre } // GetAllBalances indicates an expected call of GetAllBalances. -func (mr *MockBankKeeperMockRecorder) GetAllBalances(ctx, addr interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) GetAllBalances(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllBalances", reflect.TypeOf((*MockBankKeeper)(nil).GetAllBalances), ctx, addr) } @@ -110,7 +118,7 @@ func (m *MockBankKeeper) GetBalance(ctx context.Context, addr types.AccAddress, } // GetBalance indicates an expected call of GetBalance. -func (mr *MockBankKeeperMockRecorder) GetBalance(ctx, addr, denom interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) GetBalance(ctx, addr, denom any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBalance", reflect.TypeOf((*MockBankKeeper)(nil).GetBalance), ctx, addr, denom) } @@ -124,7 +132,7 @@ func (m *MockBankKeeper) LockedCoins(ctx context.Context, addr types.AccAddress) } // LockedCoins indicates an expected call of LockedCoins. -func (mr *MockBankKeeperMockRecorder) LockedCoins(ctx, addr interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) LockedCoins(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LockedCoins", reflect.TypeOf((*MockBankKeeper)(nil).LockedCoins), ctx, addr) } @@ -138,7 +146,7 @@ func (m *MockBankKeeper) SpendableCoins(ctx context.Context, addr types.AccAddre } // SpendableCoins indicates an expected call of SpendableCoins. -func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SpendableCoins", reflect.TypeOf((*MockBankKeeper)(nil).SpendableCoins), ctx, addr) } @@ -147,6 +155,7 @@ func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr interface{}) *gom type MockParamSubspace struct { ctrl *gomock.Controller recorder *MockParamSubspaceMockRecorder + isgomock struct{} } // MockParamSubspaceMockRecorder is the mock recorder for MockParamSubspace. @@ -167,13 +176,13 @@ func (m *MockParamSubspace) EXPECT() *MockParamSubspaceMockRecorder { } // Get mocks base method. -func (m *MockParamSubspace) Get(ctx types.Context, key []byte, ptr interface{}) { +func (m *MockParamSubspace) Get(ctx types.Context, key []byte, ptr any) { m.ctrl.T.Helper() m.ctrl.Call(m, "Get", ctx, key, ptr) } // Get indicates an expected call of Get. -func (mr *MockParamSubspaceMockRecorder) Get(ctx, key, ptr interface{}) *gomock.Call { +func (mr *MockParamSubspaceMockRecorder) Get(ctx, key, ptr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockParamSubspace)(nil).Get), ctx, key, ptr) } @@ -185,7 +194,7 @@ func (m *MockParamSubspace) GetParamSet(ctx types.Context, ps types0.ParamSet) { } // GetParamSet indicates an expected call of GetParamSet. -func (mr *MockParamSubspaceMockRecorder) GetParamSet(ctx, ps interface{}) *gomock.Call { +func (mr *MockParamSubspaceMockRecorder) GetParamSet(ctx, ps any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetParamSet", reflect.TypeOf((*MockParamSubspace)(nil).GetParamSet), ctx, ps) } @@ -211,7 +220,7 @@ func (m *MockParamSubspace) SetParamSet(ctx types.Context, ps types0.ParamSet) { } // SetParamSet indicates an expected call of SetParamSet. -func (mr *MockParamSubspaceMockRecorder) SetParamSet(ctx, ps interface{}) *gomock.Call { +func (mr *MockParamSubspaceMockRecorder) SetParamSet(ctx, ps any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetParamSet", reflect.TypeOf((*MockParamSubspace)(nil).SetParamSet), ctx, ps) } @@ -225,7 +234,7 @@ func (m *MockParamSubspace) WithKeyTable(table types0.KeyTable) types0.Subspace } // WithKeyTable indicates an expected call of WithKeyTable. -func (mr *MockParamSubspaceMockRecorder) WithKeyTable(table interface{}) *gomock.Call { +func (mr *MockParamSubspaceMockRecorder) WithKeyTable(table any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithKeyTable", reflect.TypeOf((*MockParamSubspace)(nil).WithKeyTable), table) } @@ -234,6 +243,7 @@ func (mr *MockParamSubspaceMockRecorder) WithKeyTable(table interface{}) *gomock type MockStakingKeeper struct { ctrl *gomock.Controller recorder *MockStakingKeeperMockRecorder + isgomock struct{} } // MockStakingKeeperMockRecorder is the mock recorder for MockStakingKeeper. @@ -253,150 +263,192 @@ func (m *MockStakingKeeper) EXPECT() *MockStakingKeeperMockRecorder { return m.recorder } +// ConsensusAddressCodec mocks base method. +func (m *MockStakingKeeper) ConsensusAddressCodec() address.Codec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ConsensusAddressCodec") + ret0, _ := ret[0].(address.Codec) + return ret0 +} + +// ConsensusAddressCodec indicates an expected call of ConsensusAddressCodec. +func (mr *MockStakingKeeperMockRecorder) ConsensusAddressCodec() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConsensusAddressCodec", reflect.TypeOf((*MockStakingKeeper)(nil).ConsensusAddressCodec)) +} + // Delegation mocks base method. -func (m *MockStakingKeeper) Delegation(arg0 types.Context, arg1 types.AccAddress, arg2 types.ValAddress) types1.DelegationI { +func (m *MockStakingKeeper) Delegation(arg0 context.Context, arg1 types.AccAddress, arg2 types.ValAddress) (types1.DelegationI, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Delegation", arg0, arg1, arg2) ret0, _ := ret[0].(types1.DelegationI) - return ret0 + ret1, _ := ret[1].(error) + return ret0, ret1 } // Delegation indicates an expected call of Delegation. -func (mr *MockStakingKeeperMockRecorder) Delegation(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockStakingKeeperMockRecorder) Delegation(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delegation", reflect.TypeOf((*MockStakingKeeper)(nil).Delegation), arg0, arg1, arg2) } // GetAllValidators mocks base method. -func (m *MockStakingKeeper) GetAllValidators(ctx types.Context) []types1.Validator { +func (m *MockStakingKeeper) GetAllValidators(ctx context.Context) ([]types1.Validator, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetAllValidators", ctx) ret0, _ := ret[0].([]types1.Validator) - return ret0 + ret1, _ := ret[1].(error) + return ret0, ret1 } // GetAllValidators indicates an expected call of GetAllValidators. -func (mr *MockStakingKeeperMockRecorder) GetAllValidators(ctx interface{}) *gomock.Call { +func (mr *MockStakingKeeperMockRecorder) GetAllValidators(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllValidators", reflect.TypeOf((*MockStakingKeeper)(nil).GetAllValidators), ctx) } // IsValidatorJailed mocks base method. -func (m *MockStakingKeeper) IsValidatorJailed(ctx types.Context, addr types.ConsAddress) bool { +func (m *MockStakingKeeper) IsValidatorJailed(ctx context.Context, addr types.ConsAddress) (bool, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "IsValidatorJailed", ctx, addr) ret0, _ := ret[0].(bool) - return ret0 + ret1, _ := ret[1].(error) + return ret0, ret1 } // IsValidatorJailed indicates an expected call of IsValidatorJailed. -func (mr *MockStakingKeeperMockRecorder) IsValidatorJailed(ctx, addr interface{}) *gomock.Call { +func (mr *MockStakingKeeperMockRecorder) IsValidatorJailed(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsValidatorJailed", reflect.TypeOf((*MockStakingKeeper)(nil).IsValidatorJailed), ctx, addr) } // IterateValidators mocks base method. -func (m *MockStakingKeeper) IterateValidators(arg0 types.Context, arg1 func(int64, types1.ValidatorI) bool) { +func (m *MockStakingKeeper) IterateValidators(arg0 context.Context, arg1 func(int64, types1.ValidatorI) bool) error { m.ctrl.T.Helper() - m.ctrl.Call(m, "IterateValidators", arg0, arg1) + ret := m.ctrl.Call(m, "IterateValidators", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 } // IterateValidators indicates an expected call of IterateValidators. -func (mr *MockStakingKeeperMockRecorder) IterateValidators(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStakingKeeperMockRecorder) IterateValidators(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateValidators", reflect.TypeOf((*MockStakingKeeper)(nil).IterateValidators), arg0, arg1) } // Jail mocks base method. -func (m *MockStakingKeeper) Jail(arg0 types.Context, arg1 types.ConsAddress) { +func (m *MockStakingKeeper) Jail(arg0 context.Context, arg1 types.ConsAddress) error { m.ctrl.T.Helper() - m.ctrl.Call(m, "Jail", arg0, arg1) + ret := m.ctrl.Call(m, "Jail", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 } // Jail indicates an expected call of Jail. -func (mr *MockStakingKeeperMockRecorder) Jail(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStakingKeeperMockRecorder) Jail(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Jail", reflect.TypeOf((*MockStakingKeeper)(nil).Jail), arg0, arg1) } // MaxValidators mocks base method. -func (m *MockStakingKeeper) MaxValidators(arg0 types.Context) uint32 { +func (m *MockStakingKeeper) MaxValidators(arg0 context.Context) (uint32, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "MaxValidators", arg0) ret0, _ := ret[0].(uint32) - return ret0 + ret1, _ := ret[1].(error) + return ret0, ret1 } // MaxValidators indicates an expected call of MaxValidators. -func (mr *MockStakingKeeperMockRecorder) MaxValidators(arg0 interface{}) *gomock.Call { +func (mr *MockStakingKeeperMockRecorder) MaxValidators(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MaxValidators", reflect.TypeOf((*MockStakingKeeper)(nil).MaxValidators), arg0) } // Slash mocks base method. -func (m *MockStakingKeeper) Slash(arg0 types.Context, arg1 types.ConsAddress, arg2, arg3 int64, arg4 math.LegacyDec) math.Int { +func (m *MockStakingKeeper) Slash(arg0 context.Context, arg1 types.ConsAddress, arg2, arg3 int64, arg4 math.LegacyDec) (math.Int, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Slash", arg0, arg1, arg2, arg3, arg4) ret0, _ := ret[0].(math.Int) - return ret0 + ret1, _ := ret[1].(error) + return ret0, ret1 } // Slash indicates an expected call of Slash. -func (mr *MockStakingKeeperMockRecorder) Slash(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { +func (mr *MockStakingKeeperMockRecorder) Slash(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Slash", reflect.TypeOf((*MockStakingKeeper)(nil).Slash), arg0, arg1, arg2, arg3, arg4) } // SlashWithInfractionReason mocks base method. -func (m *MockStakingKeeper) SlashWithInfractionReason(arg0 types.Context, arg1 types.ConsAddress, arg2, arg3 int64, arg4 math.LegacyDec, arg5 types1.Infraction) math.Int { +func (m *MockStakingKeeper) SlashWithInfractionReason(arg0 context.Context, arg1 types.ConsAddress, arg2, arg3 int64, arg4 math.LegacyDec, arg5 types1.Infraction) (math.Int, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SlashWithInfractionReason", arg0, arg1, arg2, arg3, arg4, arg5) ret0, _ := ret[0].(math.Int) - return ret0 + ret1, _ := ret[1].(error) + return ret0, ret1 } // SlashWithInfractionReason indicates an expected call of SlashWithInfractionReason. -func (mr *MockStakingKeeperMockRecorder) SlashWithInfractionReason(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call { +func (mr *MockStakingKeeperMockRecorder) SlashWithInfractionReason(arg0, arg1, arg2, arg3, arg4, arg5 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SlashWithInfractionReason", reflect.TypeOf((*MockStakingKeeper)(nil).SlashWithInfractionReason), arg0, arg1, arg2, arg3, arg4, arg5) } // Unjail mocks base method. -func (m *MockStakingKeeper) Unjail(arg0 types.Context, arg1 types.ConsAddress) { +func (m *MockStakingKeeper) Unjail(arg0 context.Context, arg1 types.ConsAddress) error { m.ctrl.T.Helper() - m.ctrl.Call(m, "Unjail", arg0, arg1) + ret := m.ctrl.Call(m, "Unjail", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 } // Unjail indicates an expected call of Unjail. -func (mr *MockStakingKeeperMockRecorder) Unjail(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStakingKeeperMockRecorder) Unjail(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Unjail", reflect.TypeOf((*MockStakingKeeper)(nil).Unjail), arg0, arg1) } // Validator mocks base method. -func (m *MockStakingKeeper) Validator(arg0 types.Context, arg1 types.ValAddress) types1.ValidatorI { +func (m *MockStakingKeeper) Validator(arg0 context.Context, arg1 types.ValAddress) (types1.ValidatorI, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Validator", arg0, arg1) ret0, _ := ret[0].(types1.ValidatorI) - return ret0 + ret1, _ := ret[1].(error) + return ret0, ret1 } // Validator indicates an expected call of Validator. -func (mr *MockStakingKeeperMockRecorder) Validator(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStakingKeeperMockRecorder) Validator(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Validator", reflect.TypeOf((*MockStakingKeeper)(nil).Validator), arg0, arg1) } +// ValidatorAddressCodec mocks base method. +func (m *MockStakingKeeper) ValidatorAddressCodec() address.Codec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ValidatorAddressCodec") + ret0, _ := ret[0].(address.Codec) + return ret0 +} + +// ValidatorAddressCodec indicates an expected call of ValidatorAddressCodec. +func (mr *MockStakingKeeperMockRecorder) ValidatorAddressCodec() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorAddressCodec", reflect.TypeOf((*MockStakingKeeper)(nil).ValidatorAddressCodec)) +} + // ValidatorByConsAddr mocks base method. -func (m *MockStakingKeeper) ValidatorByConsAddr(arg0 types.Context, arg1 types.ConsAddress) types1.ValidatorI { +func (m *MockStakingKeeper) ValidatorByConsAddr(arg0 context.Context, arg1 types.ConsAddress) (types1.ValidatorI, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ValidatorByConsAddr", arg0, arg1) ret0, _ := ret[0].(types1.ValidatorI) - return ret0 + ret1, _ := ret[1].(error) + return ret0, ret1 } // ValidatorByConsAddr indicates an expected call of ValidatorByConsAddr. -func (mr *MockStakingKeeperMockRecorder) ValidatorByConsAddr(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStakingKeeperMockRecorder) ValidatorByConsAddr(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorByConsAddr", reflect.TypeOf((*MockStakingKeeper)(nil).ValidatorByConsAddr), arg0, arg1) } @@ -405,6 +457,7 @@ func (mr *MockStakingKeeperMockRecorder) ValidatorByConsAddr(arg0, arg1 interfac type MockStakingHooks struct { ctrl *gomock.Controller recorder *MockStakingHooksMockRecorder + isgomock struct{} } // MockStakingHooksMockRecorder is the mock recorder for MockStakingHooks. @@ -425,7 +478,7 @@ func (m *MockStakingHooks) EXPECT() *MockStakingHooksMockRecorder { } // AfterDelegationModified mocks base method. -func (m *MockStakingHooks) AfterDelegationModified(ctx types.Context, delAddr types.AccAddress, valAddr types.ValAddress) error { +func (m *MockStakingHooks) AfterDelegationModified(ctx context.Context, delAddr types.AccAddress, valAddr types.ValAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AfterDelegationModified", ctx, delAddr, valAddr) ret0, _ := ret[0].(error) @@ -433,13 +486,13 @@ func (m *MockStakingHooks) AfterDelegationModified(ctx types.Context, delAddr ty } // AfterDelegationModified indicates an expected call of AfterDelegationModified. -func (mr *MockStakingHooksMockRecorder) AfterDelegationModified(ctx, delAddr, valAddr interface{}) *gomock.Call { +func (mr *MockStakingHooksMockRecorder) AfterDelegationModified(ctx, delAddr, valAddr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AfterDelegationModified", reflect.TypeOf((*MockStakingHooks)(nil).AfterDelegationModified), ctx, delAddr, valAddr) } // AfterValidatorBeginUnbonding mocks base method. -func (m *MockStakingHooks) AfterValidatorBeginUnbonding(ctx types.Context, consAddr types.ConsAddress, valAddr types.ValAddress) error { +func (m *MockStakingHooks) AfterValidatorBeginUnbonding(ctx context.Context, consAddr types.ConsAddress, valAddr types.ValAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AfterValidatorBeginUnbonding", ctx, consAddr, valAddr) ret0, _ := ret[0].(error) @@ -447,13 +500,13 @@ func (m *MockStakingHooks) AfterValidatorBeginUnbonding(ctx types.Context, consA } // AfterValidatorBeginUnbonding indicates an expected call of AfterValidatorBeginUnbonding. -func (mr *MockStakingHooksMockRecorder) AfterValidatorBeginUnbonding(ctx, consAddr, valAddr interface{}) *gomock.Call { +func (mr *MockStakingHooksMockRecorder) AfterValidatorBeginUnbonding(ctx, consAddr, valAddr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AfterValidatorBeginUnbonding", reflect.TypeOf((*MockStakingHooks)(nil).AfterValidatorBeginUnbonding), ctx, consAddr, valAddr) } // AfterValidatorBonded mocks base method. -func (m *MockStakingHooks) AfterValidatorBonded(ctx types.Context, consAddr types.ConsAddress, valAddr types.ValAddress) error { +func (m *MockStakingHooks) AfterValidatorBonded(ctx context.Context, consAddr types.ConsAddress, valAddr types.ValAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AfterValidatorBonded", ctx, consAddr, valAddr) ret0, _ := ret[0].(error) @@ -461,13 +514,13 @@ func (m *MockStakingHooks) AfterValidatorBonded(ctx types.Context, consAddr type } // AfterValidatorBonded indicates an expected call of AfterValidatorBonded. -func (mr *MockStakingHooksMockRecorder) AfterValidatorBonded(ctx, consAddr, valAddr interface{}) *gomock.Call { +func (mr *MockStakingHooksMockRecorder) AfterValidatorBonded(ctx, consAddr, valAddr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AfterValidatorBonded", reflect.TypeOf((*MockStakingHooks)(nil).AfterValidatorBonded), ctx, consAddr, valAddr) } // AfterValidatorCreated mocks base method. -func (m *MockStakingHooks) AfterValidatorCreated(ctx types.Context, valAddr types.ValAddress) error { +func (m *MockStakingHooks) AfterValidatorCreated(ctx context.Context, valAddr types.ValAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AfterValidatorCreated", ctx, valAddr) ret0, _ := ret[0].(error) @@ -475,13 +528,13 @@ func (m *MockStakingHooks) AfterValidatorCreated(ctx types.Context, valAddr type } // AfterValidatorCreated indicates an expected call of AfterValidatorCreated. -func (mr *MockStakingHooksMockRecorder) AfterValidatorCreated(ctx, valAddr interface{}) *gomock.Call { +func (mr *MockStakingHooksMockRecorder) AfterValidatorCreated(ctx, valAddr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AfterValidatorCreated", reflect.TypeOf((*MockStakingHooks)(nil).AfterValidatorCreated), ctx, valAddr) } // AfterValidatorRemoved mocks base method. -func (m *MockStakingHooks) AfterValidatorRemoved(ctx types.Context, consAddr types.ConsAddress, valAddr types.ValAddress) error { +func (m *MockStakingHooks) AfterValidatorRemoved(ctx context.Context, consAddr types.ConsAddress, valAddr types.ValAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AfterValidatorRemoved", ctx, consAddr, valAddr) ret0, _ := ret[0].(error) @@ -489,13 +542,13 @@ func (m *MockStakingHooks) AfterValidatorRemoved(ctx types.Context, consAddr typ } // AfterValidatorRemoved indicates an expected call of AfterValidatorRemoved. -func (mr *MockStakingHooksMockRecorder) AfterValidatorRemoved(ctx, consAddr, valAddr interface{}) *gomock.Call { +func (mr *MockStakingHooksMockRecorder) AfterValidatorRemoved(ctx, consAddr, valAddr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AfterValidatorRemoved", reflect.TypeOf((*MockStakingHooks)(nil).AfterValidatorRemoved), ctx, consAddr, valAddr) } // BeforeDelegationCreated mocks base method. -func (m *MockStakingHooks) BeforeDelegationCreated(ctx types.Context, delAddr types.AccAddress, valAddr types.ValAddress) error { +func (m *MockStakingHooks) BeforeDelegationCreated(ctx context.Context, delAddr types.AccAddress, valAddr types.ValAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "BeforeDelegationCreated", ctx, delAddr, valAddr) ret0, _ := ret[0].(error) @@ -503,13 +556,13 @@ func (m *MockStakingHooks) BeforeDelegationCreated(ctx types.Context, delAddr ty } // BeforeDelegationCreated indicates an expected call of BeforeDelegationCreated. -func (mr *MockStakingHooksMockRecorder) BeforeDelegationCreated(ctx, delAddr, valAddr interface{}) *gomock.Call { +func (mr *MockStakingHooksMockRecorder) BeforeDelegationCreated(ctx, delAddr, valAddr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeforeDelegationCreated", reflect.TypeOf((*MockStakingHooks)(nil).BeforeDelegationCreated), ctx, delAddr, valAddr) } // BeforeDelegationRemoved mocks base method. -func (m *MockStakingHooks) BeforeDelegationRemoved(ctx types.Context, delAddr types.AccAddress, valAddr types.ValAddress) error { +func (m *MockStakingHooks) BeforeDelegationRemoved(ctx context.Context, delAddr types.AccAddress, valAddr types.ValAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "BeforeDelegationRemoved", ctx, delAddr, valAddr) ret0, _ := ret[0].(error) @@ -517,13 +570,13 @@ func (m *MockStakingHooks) BeforeDelegationRemoved(ctx types.Context, delAddr ty } // BeforeDelegationRemoved indicates an expected call of BeforeDelegationRemoved. -func (mr *MockStakingHooksMockRecorder) BeforeDelegationRemoved(ctx, delAddr, valAddr interface{}) *gomock.Call { +func (mr *MockStakingHooksMockRecorder) BeforeDelegationRemoved(ctx, delAddr, valAddr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeforeDelegationRemoved", reflect.TypeOf((*MockStakingHooks)(nil).BeforeDelegationRemoved), ctx, delAddr, valAddr) } // BeforeDelegationSharesModified mocks base method. -func (m *MockStakingHooks) BeforeDelegationSharesModified(ctx types.Context, delAddr types.AccAddress, valAddr types.ValAddress) error { +func (m *MockStakingHooks) BeforeDelegationSharesModified(ctx context.Context, delAddr types.AccAddress, valAddr types.ValAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "BeforeDelegationSharesModified", ctx, delAddr, valAddr) ret0, _ := ret[0].(error) @@ -531,13 +584,13 @@ func (m *MockStakingHooks) BeforeDelegationSharesModified(ctx types.Context, del } // BeforeDelegationSharesModified indicates an expected call of BeforeDelegationSharesModified. -func (mr *MockStakingHooksMockRecorder) BeforeDelegationSharesModified(ctx, delAddr, valAddr interface{}) *gomock.Call { +func (mr *MockStakingHooksMockRecorder) BeforeDelegationSharesModified(ctx, delAddr, valAddr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeforeDelegationSharesModified", reflect.TypeOf((*MockStakingHooks)(nil).BeforeDelegationSharesModified), ctx, delAddr, valAddr) } // BeforeValidatorModified mocks base method. -func (m *MockStakingHooks) BeforeValidatorModified(ctx types.Context, valAddr types.ValAddress) error { +func (m *MockStakingHooks) BeforeValidatorModified(ctx context.Context, valAddr types.ValAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "BeforeValidatorModified", ctx, valAddr) ret0, _ := ret[0].(error) @@ -545,13 +598,13 @@ func (m *MockStakingHooks) BeforeValidatorModified(ctx types.Context, valAddr ty } // BeforeValidatorModified indicates an expected call of BeforeValidatorModified. -func (mr *MockStakingHooksMockRecorder) BeforeValidatorModified(ctx, valAddr interface{}) *gomock.Call { +func (mr *MockStakingHooksMockRecorder) BeforeValidatorModified(ctx, valAddr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeforeValidatorModified", reflect.TypeOf((*MockStakingHooks)(nil).BeforeValidatorModified), ctx, valAddr) } // BeforeValidatorSlashed mocks base method. -func (m *MockStakingHooks) BeforeValidatorSlashed(ctx types.Context, valAddr types.ValAddress, fraction math.LegacyDec) error { +func (m *MockStakingHooks) BeforeValidatorSlashed(ctx context.Context, valAddr types.ValAddress, fraction math.LegacyDec) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "BeforeValidatorSlashed", ctx, valAddr, fraction) ret0, _ := ret[0].(error) @@ -559,7 +612,7 @@ func (m *MockStakingHooks) BeforeValidatorSlashed(ctx types.Context, valAddr typ } // BeforeValidatorSlashed indicates an expected call of BeforeValidatorSlashed. -func (mr *MockStakingHooksMockRecorder) BeforeValidatorSlashed(ctx, valAddr, fraction interface{}) *gomock.Call { +func (mr *MockStakingHooksMockRecorder) BeforeValidatorSlashed(ctx, valAddr, fraction any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeforeValidatorSlashed", reflect.TypeOf((*MockStakingHooks)(nil).BeforeValidatorSlashed), ctx, valAddr, fraction) } diff --git a/x/slashing/types/events.go b/x/slashing/types/events.go index 600e59932ec2..af115fee539f 100644 --- a/x/slashing/types/events.go +++ b/x/slashing/types/events.go @@ -13,6 +13,7 @@ const ( AttributeKeyMissedBlocks = "missed_blocks" AttributeKeyBurnedCoins = "burned_coins" + AttributeValueUnspecified = "unspecified" AttributeValueDoubleSign = "double_sign" AttributeValueMissingSignature = "missing_signature" ) diff --git a/x/slashing/types/expected_keepers.go b/x/slashing/types/expected_keepers.go index 2e57cf09d28a..7c2a6b5d9b1e 100644 --- a/x/slashing/types/expected_keepers.go +++ b/x/slashing/types/expected_keepers.go @@ -3,6 +3,7 @@ package types import ( context "context" + "cosmossdk.io/core/address" "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" @@ -35,43 +36,45 @@ type ParamSubspace interface { // StakingKeeper expected staking keeper type StakingKeeper interface { + ValidatorAddressCodec() address.Codec + ConsensusAddressCodec() address.Codec // iterate through validators by operator address, execute func for each validator - IterateValidators(sdk.Context, - func(index int64, validator stakingtypes.ValidatorI) (stop bool)) + IterateValidators(context.Context, + func(index int64, validator stakingtypes.ValidatorI) (stop bool)) error - Validator(sdk.Context, sdk.ValAddress) stakingtypes.ValidatorI // get a particular validator by operator address - ValidatorByConsAddr(sdk.Context, sdk.ConsAddress) stakingtypes.ValidatorI // get a particular validator by consensus address + Validator(context.Context, sdk.ValAddress) (stakingtypes.ValidatorI, error) // get a particular validator by operator address + ValidatorByConsAddr(context.Context, sdk.ConsAddress) (stakingtypes.ValidatorI, error) // get a particular validator by consensus address // slash the validator and delegators of the validator, specifying offense height, offense power, and slash fraction - Slash(sdk.Context, sdk.ConsAddress, int64, int64, math.LegacyDec) math.Int - SlashWithInfractionReason(sdk.Context, sdk.ConsAddress, int64, int64, math.LegacyDec, stakingtypes.Infraction) math.Int - Jail(sdk.Context, sdk.ConsAddress) // jail a validator - Unjail(sdk.Context, sdk.ConsAddress) // unjail a validator + Slash(context.Context, sdk.ConsAddress, int64, int64, math.LegacyDec) (math.Int, error) + SlashWithInfractionReason(context.Context, sdk.ConsAddress, int64, int64, math.LegacyDec, stakingtypes.Infraction) (math.Int, error) + Jail(context.Context, sdk.ConsAddress) error // jail a validator + Unjail(context.Context, sdk.ConsAddress) error // unjail a validator // Delegation allows for getting a particular delegation for a given validator // and delegator outside the scope of the staking module. - Delegation(sdk.Context, sdk.AccAddress, sdk.ValAddress) stakingtypes.DelegationI - GetAllValidators(ctx sdk.Context) (validators []stakingtypes.Validator) + Delegation(context.Context, sdk.AccAddress, sdk.ValAddress) (stakingtypes.DelegationI, error) + GetAllValidators(ctx context.Context) ([]stakingtypes.Validator, error) // MaxValidators returns the maximum amount of bonded validators - MaxValidators(sdk.Context) uint32 + MaxValidators(context.Context) (uint32, error) // IsValidatorJailed returns if the validator is jailed. - IsValidatorJailed(ctx sdk.Context, addr sdk.ConsAddress) bool + IsValidatorJailed(ctx context.Context, addr sdk.ConsAddress) (bool, error) } // StakingHooks event hooks for staking validator object (noalias) type StakingHooks interface { - AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) error // Must be called when a validator is created - BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress) error // Must be called when a validator's state changes - AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error // Must be called when a validator is deleted + AfterValidatorCreated(ctx context.Context, valAddr sdk.ValAddress) error // Must be called when a validator is created + BeforeValidatorModified(ctx context.Context, valAddr sdk.ValAddress) error // Must be called when a validator's state changes + AfterValidatorRemoved(ctx context.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error // Must be called when a validator is deleted - AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error // Must be called when a validator is bonded - AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error // Must be called when a validator begins unbonding + AfterValidatorBonded(ctx context.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error // Must be called when a validator is bonded + AfterValidatorBeginUnbonding(ctx context.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error // Must be called when a validator begins unbonding - BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error // Must be called when a delegation is created - BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error // Must be called when a delegation's shares are modified - BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error // Must be called when a delegation is removed - AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error - BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction math.LegacyDec) error + BeforeDelegationCreated(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error // Must be called when a delegation is created + BeforeDelegationSharesModified(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error // Must be called when a delegation's shares are modified + BeforeDelegationRemoved(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error // Must be called when a delegation is removed + AfterDelegationModified(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error + BeforeValidatorSlashed(ctx context.Context, valAddr sdk.ValAddress, fraction math.LegacyDec) error } diff --git a/x/slashing/types/msg.go b/x/slashing/types/msg.go index ed2604e6257e..e7a48f2ddd83 100644 --- a/x/slashing/types/msg.go +++ b/x/slashing/types/msg.go @@ -11,20 +11,8 @@ var ( ) // NewMsgUnjail creates a new MsgUnjail instance -func NewMsgUnjail(validatorAddr sdk.ValAddress) *MsgUnjail { +func NewMsgUnjail(validatorAddr string) *MsgUnjail { return &MsgUnjail{ - ValidatorAddr: validatorAddr.String(), + ValidatorAddr: validatorAddr, } } - -// GetSigners returns the expected signers for MsgUnjail. -func (msg MsgUnjail) GetSigners() []sdk.AccAddress { - valAddr, _ := sdk.ValAddressFromBech32(msg.ValidatorAddr) - return []sdk.AccAddress{sdk.AccAddress(valAddr)} -} - -// GetSigners returns the expected signers for a MsgUpdateParams message. -func (msg MsgUpdateParams) GetSigners() []sdk.AccAddress { - addr, _ := sdk.AccAddressFromBech32(msg.Authority) - return []sdk.AccAddress{addr} -} diff --git a/x/slashing/types/msg_test.go b/x/slashing/types/msg_test.go index 17f3ba6d6032..6ccf68376943 100644 --- a/x/slashing/types/msg_test.go +++ b/x/slashing/types/msg_test.go @@ -12,7 +12,7 @@ import ( func TestMsgUnjailGetSignBytes(t *testing.T) { addr := sdk.AccAddress("abcd") - msg := NewMsgUnjail(sdk.ValAddress(addr)) + msg := NewMsgUnjail(sdk.ValAddress(addr).String()) pc := codec.NewProtoCodec(types.NewInterfaceRegistry()) bytes, err := pc.MarshalAminoJSON(msg) require.NoError(t, err) diff --git a/x/slashing/types/query.pb.go b/x/slashing/types/query.pb.go index 905cd4a06227..247b02d654b1 100644 --- a/x/slashing/types/query.pb.go +++ b/x/slashing/types/query.pb.go @@ -323,43 +323,43 @@ func init() { } var fileDescriptor_791b11d41a861ed0 = []byte{ - // 566 bytes of a gzipped FileDescriptorProto + // 572 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x94, 0x41, 0x6b, 0x13, 0x41, - 0x14, 0xc7, 0x33, 0xad, 0x16, 0x3a, 0x29, 0xa2, 0x63, 0xa0, 0x69, 0x90, 0x8d, 0xae, 0x90, 0x96, - 0x6a, 0x76, 0x4c, 0x44, 0x3c, 0x88, 0x07, 0x73, 0xb0, 0x08, 0x1e, 0x34, 0x85, 0x82, 0x5e, 0xc2, - 0x6c, 0x32, 0x9d, 0x0e, 0x6e, 0x66, 0xb6, 0x3b, 0x9b, 0x60, 0x11, 0x3d, 0x78, 0xf6, 0x20, 0xf8, - 0x19, 0x04, 0x8f, 0x2a, 0x7e, 0x88, 0x1e, 0x8b, 0x5e, 0x3c, 0x89, 0x24, 0x82, 0x77, 0x3f, 0x81, - 0x64, 0x66, 0x92, 0x4c, 0x89, 0xab, 0x29, 0x5e, 0x92, 0xe5, 0xbd, 0xf7, 0x7f, 0xff, 0xdf, 0x7b, - 0x79, 0x1b, 0x78, 0xb9, 0x2d, 0x55, 0x57, 0x2a, 0xac, 0x22, 0xa2, 0xf6, 0xb8, 0x60, 0xb8, 0x5f, - 0x0b, 0x69, 0x4a, 0x6a, 0x78, 0xbf, 0x47, 0x93, 0x83, 0x20, 0x4e, 0x64, 0x2a, 0xd1, 0xaa, 0x29, - 0x0a, 0xc6, 0x45, 0x81, 0x2d, 0x2a, 0x6d, 0x5a, 0x75, 0x48, 0x14, 0x35, 0x8a, 0x89, 0x3e, 0x26, - 0x8c, 0x0b, 0x92, 0x72, 0x29, 0x4c, 0x93, 0x52, 0x81, 0x49, 0x26, 0xf5, 0x23, 0x1e, 0x3d, 0xd9, - 0xe8, 0x05, 0x26, 0x25, 0x8b, 0x28, 0x26, 0x31, 0xc7, 0x44, 0x08, 0x99, 0x6a, 0x89, 0xb2, 0xd9, - 0x4a, 0x16, 0xdd, 0x84, 0xc4, 0xd4, 0xad, 0x99, 0xba, 0x96, 0x69, 0x6f, 0x69, 0x4d, 0xea, 0x1c, - 0xe9, 0x72, 0x21, 0xb1, 0xfe, 0x34, 0x21, 0xbf, 0x00, 0xd1, 0xc3, 0x11, 0xeb, 0x03, 0x92, 0x90, - 0xae, 0x6a, 0xd2, 0xfd, 0x1e, 0x55, 0xa9, 0xff, 0x08, 0x9e, 0x3f, 0x16, 0x55, 0xb1, 0x14, 0x8a, - 0xa2, 0x06, 0x5c, 0x8a, 0x75, 0xa4, 0x08, 0x2e, 0x82, 0x8d, 0x7c, 0xbd, 0x1c, 0x64, 0x2c, 0x23, - 0x30, 0xc2, 0xc6, 0xf2, 0xe1, 0xb7, 0x72, 0xee, 0xdd, 0xcf, 0xf7, 0x9b, 0xa0, 0x69, 0x95, 0xfe, - 0x0e, 0x5c, 0xd5, 0xad, 0xb7, 0x39, 0x13, 0x5c, 0xb0, 0x7b, 0x62, 0x57, 0x5a, 0x57, 0x74, 0x0b, - 0xae, 0xb4, 0xa5, 0x50, 0x2d, 0xd2, 0xe9, 0x24, 0x54, 0x19, 0x93, 0xe5, 0x46, 0xf1, 0xf3, 0xa7, - 0x6a, 0xc1, 0xfa, 0xdc, 0x31, 0x99, 0xed, 0x34, 0xe1, 0x82, 0x35, 0xf3, 0xa3, 0x6a, 0x1b, 0xf2, - 0x5f, 0xc0, 0xe2, 0x6c, 0x5f, 0xcb, 0x1d, 0xc2, 0xb3, 0x7d, 0x12, 0xb5, 0x94, 0x49, 0xb5, 0xb8, - 0xd8, 0x95, 0x76, 0x82, 0x6a, 0xe6, 0x04, 0x3b, 0x24, 0xe2, 0x1d, 0x92, 0xca, 0xc4, 0x69, 0xe8, - 0xce, 0x73, 0xa6, 0x4f, 0x22, 0x27, 0xe5, 0x87, 0xb3, 0xfe, 0xe3, 0x75, 0xa2, 0xbb, 0x10, 0x4e, - 0x4f, 0xc0, 0x3a, 0x57, 0xc6, 0xce, 0xa3, 0x7b, 0x09, 0xcc, 0x85, 0x4d, 0xb7, 0xc7, 0xa8, 0xd5, - 0x36, 0x1d, 0xa5, 0xff, 0x11, 0xc0, 0xb5, 0x3f, 0x98, 0xd8, 0x29, 0xef, 0xc3, 0x53, 0x76, 0xb2, - 0xc5, 0xff, 0x9a, 0x4c, 0x77, 0x41, 0x5b, 0xc7, 0x98, 0x17, 0x34, 0xf3, 0xfa, 0x3f, 0x99, 0x0d, - 0x8a, 0x0b, 0x5d, 0xff, 0xb5, 0x08, 0x4f, 0x6b, 0x68, 0xf4, 0x0a, 0xc0, 0x25, 0x73, 0x18, 0xe8, - 0x4a, 0x26, 0xdd, 0xec, 0x35, 0x96, 0xae, 0xce, 0x57, 0x6c, 0xbc, 0xfd, 0xf5, 0x97, 0x5f, 0x7e, - 0xbc, 0x59, 0xb8, 0x84, 0xca, 0x38, 0xeb, 0x85, 0x31, 0x97, 0x88, 0x3e, 0x00, 0x98, 0x77, 0x56, - 0x80, 0xae, 0xfd, 0xdd, 0x66, 0xf6, 0x60, 0x4b, 0xb5, 0x13, 0x28, 0x2c, 0xdd, 0x6d, 0x4d, 0x77, - 0x13, 0xdd, 0xc8, 0xa4, 0x73, 0xaf, 0x54, 0xe1, 0x67, 0xee, 0x1b, 0xf1, 0x1c, 0xbd, 0x05, 0x70, - 0xc5, 0xfd, 0xf1, 0xd1, 0xfc, 0x08, 0x93, 0x75, 0xd6, 0x4f, 0x22, 0xb1, 0xd8, 0x81, 0xc6, 0xde, - 0x40, 0x95, 0xf9, 0xb0, 0x1b, 0x5b, 0x87, 0x03, 0x0f, 0x1c, 0x0d, 0x3c, 0xf0, 0x7d, 0xe0, 0x81, - 0xd7, 0x43, 0x2f, 0x77, 0x34, 0xf4, 0x72, 0x5f, 0x87, 0x5e, 0xee, 0x71, 0x95, 0xf1, 0x74, 0xaf, - 0x17, 0x06, 0x6d, 0xd9, 0x1d, 0xf7, 0x32, 0x5f, 0x55, 0xd5, 0x79, 0x82, 0x9f, 0x4e, 0x1b, 0xa7, - 0x07, 0x31, 0x55, 0xe1, 0x92, 0xfe, 0x9b, 0xba, 0xfe, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x5f, 0xae, - 0x17, 0x98, 0x9c, 0x05, 0x00, 0x00, + 0x14, 0xc7, 0x33, 0xad, 0x06, 0x3a, 0x29, 0xa2, 0x63, 0xa1, 0x6d, 0xd0, 0x8d, 0x5d, 0x21, 0x2d, + 0xd5, 0xec, 0x98, 0x88, 0x78, 0xf2, 0x60, 0x14, 0x8b, 0xe0, 0x41, 0x53, 0x10, 0xf4, 0xb2, 0xcc, + 0x26, 0xd3, 0xe9, 0xe0, 0x66, 0x66, 0xbb, 0xb3, 0x09, 0x16, 0xd1, 0x83, 0x67, 0x0f, 0x82, 0x9f, + 0x41, 0xf0, 0xa8, 0xe2, 0x87, 0xe8, 0xb1, 0xe8, 0xc5, 0x93, 0x48, 0x22, 0x78, 0xf7, 0x13, 0xc8, + 0xce, 0x4c, 0x92, 0x2d, 0x71, 0x35, 0xc5, 0x4b, 0xb2, 0xbc, 0xf7, 0xfe, 0xef, 0xff, 0x7b, 0x2f, + 0x6f, 0x03, 0x2f, 0xb6, 0xa5, 0xea, 0x4a, 0x85, 0x55, 0x48, 0xd4, 0x2e, 0x17, 0x0c, 0xf7, 0xeb, + 0x01, 0x4d, 0x48, 0x1d, 0xef, 0xf5, 0x68, 0xbc, 0xef, 0x45, 0xb1, 0x4c, 0x24, 0x5a, 0x36, 0x45, + 0xde, 0xa8, 0xc8, 0xb3, 0x45, 0xe5, 0x4d, 0xab, 0x0e, 0x88, 0xa2, 0x46, 0x31, 0xd6, 0x47, 0x84, + 0x71, 0x41, 0x12, 0x2e, 0x85, 0x69, 0x52, 0x5e, 0x62, 0x92, 0x49, 0xfd, 0x88, 0xd3, 0x27, 0x1b, + 0x3d, 0xc7, 0xa4, 0x64, 0x21, 0xc5, 0x24, 0xe2, 0x98, 0x08, 0x21, 0x13, 0x2d, 0x51, 0x36, 0x5b, + 0xcd, 0xa3, 0x1b, 0x93, 0x98, 0xba, 0x55, 0x53, 0xe7, 0x9b, 0xf6, 0x96, 0xd6, 0xa4, 0xce, 0x90, + 0x2e, 0x17, 0x12, 0xeb, 0x4f, 0x13, 0x72, 0x97, 0x20, 0x7a, 0x90, 0xb2, 0xde, 0x27, 0x31, 0xe9, + 0xaa, 0x16, 0xdd, 0xeb, 0x51, 0x95, 0xb8, 0x8f, 0xe0, 0xd9, 0x23, 0x51, 0x15, 0x49, 0xa1, 0x28, + 0x6a, 0xc2, 0x62, 0xa4, 0x23, 0x2b, 0xe0, 0x02, 0xd8, 0x28, 0x35, 0x2a, 0x5e, 0xce, 0x32, 0x3c, + 0x23, 0x6c, 0x2e, 0x1c, 0x7c, 0xab, 0x14, 0xde, 0xfd, 0x7c, 0xbf, 0x09, 0x5a, 0x56, 0xe9, 0xfa, + 0x70, 0x59, 0xb7, 0xde, 0xe6, 0x4c, 0x70, 0xc1, 0xee, 0x8a, 0x1d, 0x69, 0x5d, 0xd1, 0x6d, 0xb8, + 0xd8, 0x96, 0x42, 0xf9, 0xa4, 0xd3, 0x89, 0xa9, 0x32, 0x26, 0x0b, 0xcd, 0xb5, 0xcf, 0x9f, 0x6a, + 0xe7, 0xad, 0xcf, 0xad, 0x14, 0x43, 0xa8, 0x9e, 0xba, 0x69, 0x4a, 0xb6, 0x93, 0x98, 0x0b, 0xd6, + 0x2a, 0xa5, 0x32, 0x1b, 0x72, 0x5f, 0xc0, 0x95, 0x69, 0x03, 0x3b, 0x40, 0x00, 0x4f, 0xf7, 0x49, + 0xe8, 0x2b, 0x93, 0xf2, 0xb9, 0xd8, 0x91, 0x76, 0x94, 0x5a, 0xee, 0x28, 0x0f, 0x49, 0xc8, 0x3b, + 0x24, 0x91, 0x71, 0xa6, 0x61, 0x76, 0xb0, 0x53, 0x7d, 0x12, 0x66, 0x52, 0x6e, 0x30, 0xed, 0x3f, + 0xda, 0x2b, 0xba, 0x03, 0xe1, 0xe4, 0x16, 0xac, 0x73, 0x75, 0xe4, 0x9c, 0x1e, 0x8e, 0x67, 0x4e, + 0x6d, 0xb2, 0x46, 0x46, 0xad, 0xb6, 0x95, 0x51, 0xba, 0x1f, 0x01, 0x5c, 0xfd, 0x83, 0x89, 0x9d, + 0xf2, 0x1e, 0x3c, 0x61, 0x27, 0x9b, 0xff, 0xaf, 0xc9, 0x74, 0x17, 0xb4, 0x75, 0x84, 0x79, 0x4e, + 0x33, 0xaf, 0xff, 0x93, 0xd9, 0xa0, 0x64, 0xa1, 0x1b, 0xbf, 0xe6, 0xe1, 0x49, 0x0d, 0x8d, 0x5e, + 0x01, 0x58, 0x34, 0x17, 0x82, 0x2e, 0xe5, 0xd2, 0x4d, 0x9f, 0x65, 0xf9, 0xf2, 0x6c, 0xc5, 0xc6, + 0xdb, 0x5d, 0x7f, 0xf9, 0xe5, 0xc7, 0x9b, 0xb9, 0x35, 0x54, 0xc1, 0x79, 0x6f, 0x8e, 0x39, 0x49, + 0xf4, 0x01, 0xc0, 0x52, 0x66, 0x05, 0xe8, 0xca, 0xdf, 0x6d, 0xa6, 0x2f, 0xb7, 0x5c, 0x3f, 0x86, + 0xc2, 0xd2, 0xdd, 0xd0, 0x74, 0xd7, 0xd1, 0xb5, 0x5c, 0xba, 0xec, 0x95, 0x2a, 0xfc, 0x2c, 0xfb, + 0x6a, 0x3c, 0x47, 0x6f, 0x01, 0x5c, 0xcc, 0xfe, 0xf8, 0x68, 0x76, 0x84, 0xf1, 0x3a, 0x1b, 0xc7, + 0x91, 0x58, 0x6c, 0x4f, 0x63, 0x6f, 0xa0, 0xea, 0x6c, 0xd8, 0xcd, 0xad, 0x83, 0x81, 0x03, 0x0e, + 0x07, 0x0e, 0xf8, 0x3e, 0x70, 0xc0, 0xeb, 0xa1, 0x53, 0x38, 0x1c, 0x3a, 0x85, 0xaf, 0x43, 0xa7, + 0xf0, 0xb8, 0xc6, 0x78, 0xb2, 0xdb, 0x0b, 0xbc, 0xb6, 0xec, 0x8e, 0x7a, 0x99, 0xaf, 0x9a, 0xea, + 0x3c, 0xc1, 0x4f, 0x27, 0x8d, 0x93, 0xfd, 0x88, 0xaa, 0xa0, 0xa8, 0xff, 0xaf, 0xae, 0xfe, 0x0e, + 0x00, 0x00, 0xff, 0xff, 0x19, 0x13, 0x5a, 0xf6, 0xa5, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -499,6 +499,7 @@ func _Query_SigningInfos_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.slashing.v1beta1.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/slashing/types/slashing.pb.go b/x/slashing/types/slashing.pb.go index dc6d17bb19b8..09a5f7744377 100644 --- a/x/slashing/types/slashing.pb.go +++ b/x/slashing/types/slashing.pb.go @@ -4,9 +4,9 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-proto" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" @@ -129,11 +129,11 @@ func (m *ValidatorSigningInfo) GetMissedBlocksCounter() int64 { // Params represents the parameters used for by the slashing module. type Params struct { - SignedBlocksWindow int64 `protobuf:"varint,1,opt,name=signed_blocks_window,json=signedBlocksWindow,proto3" json:"signed_blocks_window,omitempty"` - MinSignedPerWindow github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=min_signed_per_window,json=minSignedPerWindow,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"min_signed_per_window"` - DowntimeJailDuration time.Duration `protobuf:"bytes,3,opt,name=downtime_jail_duration,json=downtimeJailDuration,proto3,stdduration" json:"downtime_jail_duration"` - SlashFractionDoubleSign github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=slash_fraction_double_sign,json=slashFractionDoubleSign,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"slash_fraction_double_sign"` - SlashFractionDowntime github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=slash_fraction_downtime,json=slashFractionDowntime,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"slash_fraction_downtime"` + SignedBlocksWindow int64 `protobuf:"varint,1,opt,name=signed_blocks_window,json=signedBlocksWindow,proto3" json:"signed_blocks_window,omitempty"` + MinSignedPerWindow cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=min_signed_per_window,json=minSignedPerWindow,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"min_signed_per_window"` + DowntimeJailDuration time.Duration `protobuf:"bytes,3,opt,name=downtime_jail_duration,json=downtimeJailDuration,proto3,stdduration" json:"downtime_jail_duration"` + SlashFractionDoubleSign cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=slash_fraction_double_sign,json=slashFractionDoubleSign,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"slash_fraction_double_sign"` + SlashFractionDowntime cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=slash_fraction_downtime,json=slashFractionDowntime,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"slash_fraction_downtime"` } func (m *Params) Reset() { *m = Params{} } @@ -193,47 +193,47 @@ func init() { } var fileDescriptor_1078e5d96a74cc52 = []byte{ - // 639 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x3f, 0x4f, 0x14, 0x4f, - 0x18, 0xbe, 0x01, 0x7e, 0xfc, 0x74, 0x0e, 0x13, 0x5d, 0x0f, 0x59, 0x2e, 0xba, 0x77, 0x50, 0x90, - 0x0b, 0x09, 0xbb, 0x82, 0x1d, 0x56, 0x1e, 0xc4, 0xe0, 0x9f, 0x44, 0x72, 0xf8, 0x27, 0xb1, 0x70, - 0x32, 0xbb, 0x33, 0xb7, 0x37, 0xb2, 0x3b, 0x73, 0xd9, 0x99, 0x15, 0x88, 0x8d, 0x8d, 0x8d, 0x15, - 0xa5, 0xb1, 0xb2, 0xa4, 0xa4, 0xf0, 0x0b, 0x58, 0x98, 0x50, 0x12, 0x2b, 0x63, 0x81, 0xe6, 0x28, - 0xf0, 0x63, 0x98, 0x9d, 0x99, 0x05, 0x02, 0x89, 0x15, 0xcd, 0xdd, 0xee, 0xf3, 0x3c, 0xef, 0xfb, - 0xbc, 0xf3, 0xcc, 0x9b, 0x85, 0x33, 0x91, 0x90, 0xa9, 0x90, 0x81, 0x4c, 0xb0, 0xec, 0x31, 0x1e, - 0x07, 0x6f, 0xe6, 0x43, 0xaa, 0xf0, 0xfc, 0x31, 0xe0, 0xf7, 0x33, 0xa1, 0x84, 0x33, 0x61, 0x74, - 0xfe, 0x31, 0x6c, 0x75, 0xf5, 0x5a, 0x2c, 0x62, 0xa1, 0x35, 0x41, 0xf1, 0x64, 0xe4, 0x75, 0x2f, - 0x16, 0x22, 0x4e, 0x68, 0xa0, 0xdf, 0xc2, 0xbc, 0x1b, 0x90, 0x3c, 0xc3, 0x8a, 0x09, 0x6e, 0xf9, - 0xc6, 0x59, 0x5e, 0xb1, 0x94, 0x4a, 0x85, 0xd3, 0xbe, 0x15, 0x4c, 0x1a, 0x3f, 0x64, 0x3a, 0x5b, - 0x73, 0x43, 0x5d, 0xc3, 0x29, 0xe3, 0x22, 0xd0, 0xbf, 0x06, 0x9a, 0xfe, 0x3a, 0x04, 0x6b, 0xcf, - 0x71, 0xc2, 0x08, 0x56, 0x22, 0x5b, 0x63, 0x31, 0x67, 0x3c, 0x7e, 0xc0, 0xbb, 0xc2, 0xb9, 0x0b, - 0xff, 0xc7, 0x84, 0x64, 0x54, 0x4a, 0x17, 0x34, 0x41, 0xeb, 0x72, 0x7b, 0xea, 0xfb, 0x97, 0xb9, - 0x5b, 0xb6, 0xdd, 0x92, 0xe0, 0x92, 0x72, 0x99, 0xcb, 0x7b, 0x46, 0xb2, 0xa6, 0x32, 0xc6, 0xe3, - 0x4e, 0x59, 0xe1, 0x4c, 0xc1, 0x31, 0xa9, 0x70, 0xa6, 0x50, 0x8f, 0xb2, 0xb8, 0xa7, 0xdc, 0xa1, - 0x26, 0x68, 0x0d, 0x77, 0xaa, 0x1a, 0x5b, 0xd1, 0x50, 0x21, 0x61, 0x9c, 0xd0, 0x4d, 0x24, 0xba, - 0x5d, 0x49, 0x95, 0x3b, 0x6c, 0x24, 0x1a, 0x7b, 0xa2, 0x21, 0xe7, 0x31, 0x1c, 0x7b, 0x8d, 0x59, - 0x42, 0x09, 0xca, 0xb9, 0x62, 0x89, 0x3b, 0xd2, 0x04, 0xad, 0xea, 0x42, 0xdd, 0x37, 0x09, 0xf8, - 0x65, 0x02, 0xfe, 0xd3, 0x32, 0x81, 0xf6, 0x95, 0xbd, 0x83, 0x46, 0x65, 0xfb, 0x57, 0x03, 0xec, - 0x1c, 0xed, 0xce, 0x82, 0x4e, 0xd5, 0x94, 0x3f, 0x2b, 0xaa, 0x1d, 0x0f, 0x42, 0x25, 0xd2, 0x50, - 0x2a, 0xc1, 0x29, 0x71, 0xff, 0x6b, 0x82, 0xd6, 0xa5, 0xce, 0x29, 0xc4, 0x59, 0x80, 0xe3, 0x29, - 0x93, 0x92, 0x12, 0x14, 0x26, 0x22, 0x5a, 0x97, 0x28, 0x12, 0x39, 0x57, 0x34, 0x73, 0x47, 0xf5, - 0x64, 0xd7, 0x0d, 0xd9, 0xd6, 0xdc, 0x92, 0xa1, 0x16, 0x47, 0xfe, 0x7c, 0x6e, 0x80, 0xe9, 0x6f, - 0x23, 0x70, 0x74, 0x15, 0x67, 0x38, 0x95, 0xce, 0x6d, 0x58, 0x93, 0x2c, 0xe6, 0x27, 0x4d, 0x36, - 0x18, 0x27, 0x62, 0x43, 0x47, 0x38, 0xdc, 0x71, 0x0c, 0x67, 0x7a, 0xbc, 0xd0, 0x8c, 0xf3, 0xb6, - 0xb0, 0xe5, 0xc8, 0x56, 0xf5, 0x69, 0x56, 0x96, 0x14, 0x99, 0x8d, 0xb5, 0x57, 0x8a, 0x13, 0xfd, - 0x3c, 0x68, 0xcc, 0xc4, 0x4c, 0xf5, 0xf2, 0xd0, 0x8f, 0x44, 0x6a, 0xef, 0xd4, 0xfe, 0xcd, 0x49, - 0xb2, 0x1e, 0xa8, 0xad, 0x3e, 0x95, 0xfe, 0x32, 0x8d, 0x3e, 0x1d, 0xed, 0xce, 0x5e, 0xb5, 0x0b, - 0x40, 0x68, 0x84, 0xc2, 0x2d, 0x45, 0xa5, 0x09, 0xc3, 0x49, 0x19, 0x5f, 0xd3, 0x2e, 0xab, 0x34, - 0xb3, 0xe6, 0xaf, 0xe0, 0x0d, 0x22, 0x36, 0x78, 0xb1, 0x42, 0xa8, 0xc8, 0x0a, 0x95, 0xcb, 0xa6, - 0xaf, 0xa3, 0xba, 0x30, 0x79, 0x2e, 0xeb, 0x65, 0x2b, 0x30, 0x51, 0x7f, 0x3c, 0x8e, 0xba, 0x56, - 0xf6, 0x79, 0x88, 0x59, 0x52, 0x8a, 0x9c, 0xf7, 0x00, 0xd6, 0xf5, 0xde, 0xa3, 0x6e, 0x86, 0xa3, - 0x02, 0x42, 0x44, 0xe4, 0x61, 0x42, 0xf5, 0x79, 0xf5, 0x85, 0x5e, 0xe4, 0x11, 0x27, 0xb4, 0xd7, - 0x7d, 0x6b, 0xb5, 0xac, 0x9d, 0x8a, 0x23, 0x3b, 0xef, 0x00, 0x9c, 0x38, 0x37, 0x87, 0x99, 0x57, - 0x6f, 0xc2, 0x45, 0x0e, 0x31, 0x7e, 0x66, 0x08, 0x63, 0xb3, 0x38, 0xf5, 0xe1, 0x68, 0x77, 0xf6, - 0xe6, 0xa9, 0x5e, 0x9b, 0x27, 0x5f, 0x0e, 0xb3, 0x3c, 0xed, 0x47, 0x3b, 0x03, 0x0f, 0xec, 0x0d, - 0x3c, 0xb0, 0x3f, 0xf0, 0xc0, 0xef, 0x81, 0x07, 0xb6, 0x0f, 0xbd, 0xca, 0xfe, 0xa1, 0x57, 0xf9, - 0x71, 0xe8, 0x55, 0x5e, 0xce, 0xfd, 0x73, 0xb2, 0x53, 0xdd, 0xf4, 0x90, 0xe1, 0xa8, 0xbe, 0xb2, - 0x3b, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x3d, 0x8c, 0xa5, 0x44, 0xa7, 0x04, 0x00, 0x00, + // 634 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xcf, 0x4f, 0x13, 0x41, + 0x14, 0xee, 0x00, 0xa2, 0x4e, 0xf1, 0xe0, 0x58, 0xa4, 0x54, 0xdd, 0x16, 0x0e, 0xa6, 0x21, 0xe9, + 0xae, 0x60, 0xe2, 0x01, 0x4f, 0x96, 0xc6, 0xf8, 0x83, 0x44, 0x52, 0xfc, 0x91, 0x78, 0x70, 0x33, + 0xbb, 0x33, 0x9d, 0x8e, 0xec, 0xce, 0x34, 0x3b, 0xb3, 0x02, 0xff, 0x82, 0x89, 0x09, 0x47, 0x8f, + 0x1e, 0x39, 0x72, 0xe0, 0x1f, 0xf0, 0xc6, 0x91, 0x70, 0x32, 0x1e, 0xd0, 0x94, 0x03, 0xfe, 0x19, + 0x66, 0x67, 0x76, 0x8b, 0x01, 0x4f, 0x5c, 0x9a, 0xf6, 0xfb, 0xbe, 0xf7, 0xbd, 0x7d, 0xdf, 0x7b, + 0x5d, 0x78, 0x3f, 0x94, 0x2a, 0x96, 0xca, 0x53, 0x11, 0x56, 0x7d, 0x2e, 0x98, 0xf7, 0x69, 0x31, + 0xa0, 0x1a, 0x2f, 0x8e, 0x00, 0x77, 0x90, 0x48, 0x2d, 0xd1, 0x8c, 0xd5, 0xb9, 0x23, 0x38, 0xd7, + 0xd5, 0x2a, 0x4c, 0x32, 0x69, 0x34, 0x5e, 0xf6, 0xcd, 0xca, 0x6b, 0x0e, 0x93, 0x92, 0x45, 0xd4, + 0x33, 0xbf, 0x82, 0xb4, 0xe7, 0x91, 0x34, 0xc1, 0x9a, 0x4b, 0x91, 0xf3, 0xf5, 0xf3, 0xbc, 0xe6, + 0x31, 0x55, 0x1a, 0xc7, 0x83, 0x5c, 0x30, 0x6b, 0xfb, 0xf9, 0xd6, 0x39, 0x6f, 0x6e, 0xa9, 0x9b, + 0x38, 0xe6, 0x42, 0x7a, 0xe6, 0xd3, 0x42, 0xf3, 0xdf, 0xc7, 0x60, 0xe5, 0x2d, 0x8e, 0x38, 0xc1, + 0x5a, 0x26, 0xeb, 0x9c, 0x09, 0x2e, 0xd8, 0x73, 0xd1, 0x93, 0xe8, 0x31, 0xbc, 0x8a, 0x09, 0x49, + 0xa8, 0x52, 0x55, 0xd0, 0x00, 0xcd, 0xeb, 0xed, 0xb9, 0xa3, 0xfd, 0xd6, 0xbd, 0xdc, 0x6e, 0x45, + 0x0a, 0x45, 0x85, 0x4a, 0xd5, 0x13, 0x2b, 0x59, 0xd7, 0x09, 0x17, 0xac, 0x5b, 0x54, 0xa0, 0x39, + 0x38, 0xa5, 0x34, 0x4e, 0xb4, 0xdf, 0xa7, 0x9c, 0xf5, 0x75, 0x75, 0xac, 0x01, 0x9a, 0xe3, 0xdd, + 0xb2, 0xc1, 0x9e, 0x19, 0x28, 0x93, 0x70, 0x41, 0xe8, 0x96, 0x2f, 0x7b, 0x3d, 0x45, 0x75, 0x75, + 0xdc, 0x4a, 0x0c, 0xf6, 0xca, 0x40, 0x68, 0x15, 0x4e, 0x7d, 0xc4, 0x3c, 0xa2, 0xc4, 0x4f, 0x85, + 0xe6, 0x51, 0x75, 0xa2, 0x01, 0x9a, 0xe5, 0xa5, 0x9a, 0x6b, 0x13, 0x70, 0x8b, 0x04, 0xdc, 0xd7, + 0x45, 0x02, 0xed, 0x1b, 0x07, 0xc7, 0xf5, 0xd2, 0xce, 0xaf, 0x3a, 0xd8, 0x3d, 0xdd, 0x5b, 0x00, + 0xdd, 0xb2, 0x2d, 0x7f, 0x93, 0x55, 0x23, 0x07, 0x42, 0x2d, 0xe3, 0x40, 0x69, 0x29, 0x28, 0xa9, + 0x5e, 0x69, 0x80, 0xe6, 0xb5, 0xee, 0x3f, 0x08, 0x5a, 0x82, 0xd3, 0x31, 0x57, 0x8a, 0x12, 0x3f, + 0x88, 0x64, 0xb8, 0xa1, 0xfc, 0x50, 0xa6, 0x42, 0xd3, 0xa4, 0x3a, 0x69, 0x9e, 0xec, 0x96, 0x25, + 0xdb, 0x86, 0x5b, 0xb1, 0xd4, 0xf2, 0xc4, 0x9f, 0x6f, 0x75, 0x30, 0xff, 0x65, 0x02, 0x4e, 0xae, + 0xe1, 0x04, 0xc7, 0x0a, 0x3d, 0x80, 0x15, 0xc5, 0x99, 0x38, 0x33, 0xd9, 0xe4, 0x82, 0xc8, 0x4d, + 0x13, 0xe1, 0x78, 0x17, 0x59, 0xce, 0x7a, 0xbc, 0x33, 0x0c, 0xe2, 0x59, 0x5b, 0xe1, 0xe7, 0x55, + 0x03, 0x9a, 0x14, 0x25, 0x59, 0x66, 0x53, 0xed, 0x47, 0xd9, 0x44, 0x3f, 0x8f, 0xeb, 0x77, 0x6c, + 0xf2, 0x8a, 0x6c, 0xb8, 0x5c, 0x7a, 0x31, 0xd6, 0x7d, 0x77, 0x95, 0x32, 0x1c, 0x6e, 0x77, 0x68, + 0x78, 0xb4, 0xdf, 0x82, 0xf9, 0x62, 0x3a, 0x34, 0xb4, 0xa3, 0xa3, 0x98, 0x8b, 0x75, 0xe3, 0xb9, + 0x46, 0x93, 0xbc, 0xd5, 0x07, 0x78, 0x9b, 0xc8, 0x4d, 0x91, 0x1d, 0x8c, 0x9f, 0x25, 0xe3, 0x17, + 0xa7, 0x65, 0xc2, 0x2f, 0x2f, 0xcd, 0x5e, 0x48, 0xb6, 0x93, 0x0b, 0x6c, 0xb0, 0x5f, 0x47, 0xc1, + 0x56, 0x0a, 0x9f, 0x17, 0x98, 0x47, 0x85, 0x08, 0x29, 0x58, 0x33, 0x47, 0xee, 0xf7, 0x12, 0x1c, + 0x66, 0x88, 0x4f, 0x64, 0x1a, 0x44, 0xd4, 0x0c, 0x67, 0xb6, 0x77, 0xf9, 0x79, 0x66, 0x8c, 0xf3, + 0xd3, 0xdc, 0xb8, 0x63, 0x7c, 0xb3, 0xf9, 0x90, 0x80, 0x33, 0x17, 0x9a, 0xda, 0x67, 0x33, 0x3b, + 0xbe, 0x7c, 0xc7, 0xe9, 0x73, 0x1d, 0xad, 0xe9, 0xf2, 0xdc, 0xe7, 0xd3, 0xbd, 0x85, 0xbb, 0x56, + 0xdc, 0x52, 0x64, 0xc3, 0xdb, 0x3a, 0x7b, 0x03, 0xd8, 0x23, 0x68, 0xbf, 0xdc, 0x1d, 0x3a, 0xe0, + 0x60, 0xe8, 0x80, 0xc3, 0xa1, 0x03, 0x7e, 0x0f, 0x1d, 0xb0, 0x73, 0xe2, 0x94, 0x0e, 0x4f, 0x9c, + 0xd2, 0x8f, 0x13, 0xa7, 0xf4, 0xbe, 0xc5, 0xb8, 0xee, 0xa7, 0x81, 0x1b, 0xca, 0x38, 0xff, 0x77, + 0x7a, 0xff, 0x77, 0xd3, 0xdb, 0x03, 0xaa, 0x82, 0x49, 0xb3, 0x8c, 0x87, 0x7f, 0x03, 0x00, 0x00, + 0xff, 0xff, 0xec, 0x7c, 0x0b, 0xf0, 0x6f, 0x04, 0x00, 0x00, } func (this *ValidatorSigningInfo) Equal(that interface{}) bool { diff --git a/x/slashing/types/tx.pb.go b/x/slashing/types/tx.pb.go index 69843e86c227..1d5c21e4b807 100644 --- a/x/slashing/types/tx.pb.go +++ b/x/slashing/types/tx.pb.go @@ -454,6 +454,7 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.slashing.v1beta1.Msg", HandlerType: (*MsgServer)(nil), diff --git a/x/staking/README.md b/x/staking/README.md index 5dd94dc696a5..c011a593dd34 100644 --- a/x/staking/README.md +++ b/x/staking/README.md @@ -75,14 +75,14 @@ Store entries prefixed with "Last" must remain unchanged until EndBlock. ### ValidatorUpdates -ValidatorUpdates contains the validator updates returned to ABCI at the end of every block. -The values are overwritten in every block. +ValidatorUpdates contains the validator updates returned to ABCI at the end of every block. +The values are overwritten in every block. * ValidatorUpdates `0x61 -> []abci.ValidatorUpdate` ### UnbondingID -UnbondingID stores the ID of the latest unbonding operation. It enables to create unique IDs for unbonding operation, i.e., UnbondingID is incremented every time a new unbonding operation (validator unbonding, unbonding delegation, redelegation) is initiated. +UnbondingID stores the ID of the latest unbonding operation. It enables creating unique IDs for unbonding operations, i.e., UnbondingID is incremented every time a new unbonding operation (validator unbonding, unbonding delegation, redelegation) is initiated. * UnbondingID: `0x37 -> uint64` @@ -115,7 +115,7 @@ Validators can have one of three statuses before their tokens are moved to their accounts from the `BondedPool`. :::warning -Tombstoning is permanent, once tombstoned a validators consensus key can not be reused within the chain where the tombstoning happened. +Tombstoning is permanent, once tombstoned a validator's consensus key can not be reused within the chain where the tombstoning happened. ::: Validators objects should be primarily stored and accessed by the @@ -137,7 +137,7 @@ associated validator, where the public key of that validator can change in the future. Delegators can refer to the immutable operator of the validator, without concern for the changing public key. -`ValidatorsByUnbondingID` is an additional index that enables lookups for +`ValidatorsByUnbondingID` is an additional index that enables lookups for validators by the unbonding IDs corresponding to their current unbonding. `ValidatorByConsAddr` is an additional index that enables lookups for slashing. @@ -182,7 +182,7 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/staking/v1bet #### Delegator Shares -When one Delegates tokens to a Validator they are issued a number of delegator shares based on a +When one delegates tokens to a Validator, they are issued a number of delegator shares based on a dynamic exchange rate, calculated as follows from the total number of tokens delegated to the validator and the number of shares issued so far: @@ -196,7 +196,7 @@ hold and the inverse exchange rate: These `Shares` are simply an accounting mechanism. They are not a fungible asset. The reason for this mechanism is to simplify the accounting around slashing. Rather than iteratively slashing the -tokens of every delegation entry, instead the Validators total bonded tokens can be slashed, +tokens of every delegation entry, instead the Validator's total bonded tokens can be slashed, effectively reducing the value of each issued delegator share. ### UnbondingDelegation @@ -217,8 +217,8 @@ detected. unbonding delegations associated with a given validator that need to be slashed. - `UnbondingDelegationByUnbondingId` is an additional index that enables - lookups for unbonding delegations by the unbonding IDs of the containing + `UnbondingDelegationByUnbondingId` is an additional index that enables + lookups for unbonding delegations by the unbonding IDs of the containing unbonding delegation entries. @@ -254,8 +254,8 @@ The first map here is used for queries, to lookup all redelegations for a given delegator. The second map is used for slashing based on the `ValidatorSrcAddr`, while the third map is for slashing based on the `ValidatorDstAddr`. -`RedelegationByUnbondingId` is an additional index that enables - lookups for redelegations by the unbonding IDs of the containing +`RedelegationByUnbondingId` is an additional index that enables + lookups for redelegations by the unbonding IDs of the containing redelegation entries. A redelegation object is created every time a redelegation occurs. To prevent @@ -272,13 +272,13 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/staking/v1bet ### Queues -All queues objects are sorted by timestamp. The time used within any queue is -first rounded to the nearest nanosecond then sorted. The sortable time format +All queue objects are sorted by timestamp. The time used within any queue is +firstly converted to UTC, rounded to the nearest nanosecond then sorted. The sortable time format used is a slight modification of the RFC3339Nano and uses the format string `"2006-01-02T15:04:05.000000000"`. Notably this format: * right pads all zeros -* drops the time zone info (uses UTC) +* drops the time zone info (we already use UTC) In all cases, the stored timestamp represents the maturation time of the queue element. @@ -312,7 +312,7 @@ queue is kept. * ValidatorQueueTime: `0x43 | format(time) -> []sdk.ValAddress` -The stored object as each key is an array of validator operator addresses from +The stored object by each key is an array of validator operator addresses from which the validator object can be accessed. Typically it is expected that only a single validator record will be associated with a given timestamp however it is possible that multiple validators exist in the queue at the same location. @@ -415,16 +415,16 @@ Delegation may be called. shares from the `BondedPool` to the `NotBondedPool` `ModuleAccount` * remove the validator if it is unbonded and there are no more delegation shares. * remove the validator if it is unbonded and there are no more delegation shares -* get a unique `unbondingId` and map it to the `UnbondingDelegationEntry` in `UnbondingDelegationByUnbondingId` +* get a unique `unbondingId` and map it to the `UnbondingDelegationEntry` in `UnbondingDelegationByUnbondingId` * call the `AfterUnbondingInitiated(unbondingId)` hook * add the unbonding delegation to `UnbondingDelegationQueue` with the completion time set to `UnbondingTime` -#### Cancel an `UnbondingDelegation` Entry +#### Cancel an `UnbondingDelegation` Entry When a `cancel unbond delegation` occurs both the `validator`, the `delegation` and an `UnbondingDelegationQueue` state will be updated. * if cancel unbonding delegation amount equals to the `UnbondingDelegation` entry `balance`, then the `UnbondingDelegation` entry deleted from `UnbondingDelegationQueue`. -* if the `cancel unbonding delegation amount is less than the `UnbondingDelegation` entry balance, then the `UnbondingDelegation` entry will be updated with new balance in the `UnbondingDelegationQueue`. +* if the `cancel unbonding delegation amount is less than the `UnbondingDelegation` entry balance, then the `UnbondingDelegation` entry will be updated with new balance in the `UnbondingDelegationQueue`. * cancel `amount` is [Delegated](#delegations) back to the original `validator`. #### Complete Unbonding @@ -661,7 +661,7 @@ This message is expected to fail if: When this message is processed the following actions occur: -* if the `unbondingDelegation` Entry balance is zero +* if the `unbondingDelegation` Entry balance is zero * in this condition `unbondingDelegation` entry will be removed from `unbondingDelegationQueue`. * otherwise `unbondingDelegationQueue` will be updated with new `unbondingDelegation` entry balance and initial balance * the validator's `DelegatorShares` and the delegation's `Shares` are both increased by the message `Amount`. @@ -791,11 +791,11 @@ validators that still have remaining delegations, the `validator.Status` is switched from `types.Unbonding` to `types.Unbonded`. -Unbonding operations can be put on hold by external modules via the `PutUnbondingOnHold(unbondingId)` method. - As a result, an unbonding operation (e.g., an unbonding delegation) that is on hold, cannot complete - even if it reaches maturity. For an unbonding operation with `unbondingId` to eventually complete - (after it reaches maturity), every call to `PutUnbondingOnHold(unbondingId)` must be matched - by a call to `UnbondingCanComplete(unbondingId)`. +Unbonding operations can be put on hold by external modules via the `PutUnbondingOnHold(unbondingId)` method. + As a result, an unbonding operation (e.g., an unbonding delegation) that is on hold, cannot complete + even if it reaches maturity. For an unbonding operation with `unbondingId` to eventually complete + (after it reaches maturity), every call to `PutUnbondingOnHold(unbondingId)` must be matched + by a call to `UnbondingCanComplete(unbondingId)`. #### Unbonding Delegations @@ -1666,7 +1666,7 @@ Example: simd tx staking unbond cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj 100stake --from mykey ``` -##### cancel unbond +##### cancel unbond The command `cancel-unbond` allow users to cancel the unbonding delegation entry and delegate back to the original validator. diff --git a/x/staking/app_test.go b/x/staking/app_test.go index 4749eb6a30c5..ae68287c40a7 100644 --- a/x/staking/app_test.go +++ b/x/staking/app_test.go @@ -3,6 +3,8 @@ package staking_test import ( "testing" + abci "github.com/cometbft/cometbft/abci/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" "cosmossdk.io/depinject" @@ -11,13 +13,8 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - - abci "github.com/cometbft/cometbft/abci/types" - cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" - - sdk "github.com/cosmos/cosmos-sdk/types" - simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" bankKeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" @@ -72,7 +69,7 @@ func TestStakingMsgs(t *testing.T) { // create validator description := types.NewDescription("foo_moniker", "", "", "", "") createValidatorMsg, err := types.NewMsgCreateValidator( - sdk.ValAddress(addr1), valKey.PubKey(), bondCoin, description, commissionRates, math.OneInt(), + sdk.ValAddress(addr1).String(), valKey.PubKey(), bondCoin, description, commissionRates, math.OneInt(), ) require.NoError(t, err) @@ -82,32 +79,35 @@ func TestStakingMsgs(t *testing.T) { require.NoError(t, err) require.True(t, sdk.Coins{genCoin.Sub(bondCoin)}.Equal(bankKeeper.GetAllBalances(ctxCheck, addr1))) - app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: app.LastBlockHeight() + 1}) + _, err = app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: app.LastBlockHeight() + 1}) + require.NoError(t, err) ctxCheck = app.BaseApp.NewContext(true) - validator, found := stakingKeeper.GetValidator(ctxCheck, sdk.ValAddress(addr1)) - require.True(t, found) + validator, err := stakingKeeper.GetValidator(ctxCheck, sdk.ValAddress(addr1)) + require.NoError(t, err) + require.Equal(t, sdk.ValAddress(addr1).String(), validator.OperatorAddress) require.Equal(t, types.Bonded, validator.Status) require.True(math.IntEq(t, bondTokens, validator.BondedTokens())) - app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: app.LastBlockHeight() + 1}) + _, err = app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: app.LastBlockHeight() + 1}) + require.NoError(t, err) // edit the validator description = types.NewDescription("bar_moniker", "", "", "", "") - editValidatorMsg := types.NewMsgEditValidator(sdk.ValAddress(addr1), description, nil, nil) + editValidatorMsg := types.NewMsgEditValidator(sdk.ValAddress(addr1).String(), description, nil, nil) header = cmtproto.Header{Height: app.LastBlockHeight() + 1} _, _, err = simtestutil.SignCheckDeliver(t, txConfig, app.BaseApp, header, []sdk.Msg{editValidatorMsg}, "", []uint64{0}, []uint64{1}, true, true, priv1) require.NoError(t, err) ctxCheck = app.BaseApp.NewContext(true) - validator, found = stakingKeeper.GetValidator(ctxCheck, sdk.ValAddress(addr1)) - require.True(t, found) + validator, err = stakingKeeper.GetValidator(ctxCheck, sdk.ValAddress(addr1)) + require.NoError(t, err) require.Equal(t, description, validator.Description) // delegate require.True(t, sdk.Coins{genCoin}.Equal(bankKeeper.GetAllBalances(ctxCheck, addr2))) - delegateMsg := types.NewMsgDelegate(addr2, sdk.ValAddress(addr1), bondCoin) + delegateMsg := types.NewMsgDelegate(addr2.String(), sdk.ValAddress(addr1).String(), bondCoin) header = cmtproto.Header{Height: app.LastBlockHeight() + 1} _, _, err = simtestutil.SignCheckDeliver(t, txConfig, app.BaseApp, header, []sdk.Msg{delegateMsg}, "", []uint64{1}, []uint64{0}, true, true, priv2) @@ -115,19 +115,19 @@ func TestStakingMsgs(t *testing.T) { ctxCheck = app.BaseApp.NewContext(true) require.True(t, sdk.Coins{genCoin.Sub(bondCoin)}.Equal(bankKeeper.GetAllBalances(ctxCheck, addr2))) - _, found = stakingKeeper.GetDelegation(ctxCheck, addr2, sdk.ValAddress(addr1)) - require.True(t, found) + _, err = stakingKeeper.GetDelegation(ctxCheck, addr2, sdk.ValAddress(addr1)) + require.NoError(t, err) // begin unbonding - beginUnbondingMsg := types.NewMsgUndelegate(addr2, sdk.ValAddress(addr1), bondCoin) + beginUnbondingMsg := types.NewMsgUndelegate(addr2.String(), sdk.ValAddress(addr1).String(), bondCoin) header = cmtproto.Header{Height: app.LastBlockHeight() + 1} _, _, err = simtestutil.SignCheckDeliver(t, txConfig, app.BaseApp, header, []sdk.Msg{beginUnbondingMsg}, "", []uint64{1}, []uint64{1}, true, true, priv2) require.NoError(t, err) // delegation should exist anymore ctxCheck = app.BaseApp.NewContext(true) - _, found = stakingKeeper.GetDelegation(ctxCheck, addr2, sdk.ValAddress(addr1)) - require.False(t, found) + _, err = stakingKeeper.GetDelegation(ctxCheck, addr2, sdk.ValAddress(addr1)) + require.ErrorIs(t, err, types.ErrNoDelegation) // balance should be the same because bonding not yet complete require.True(t, sdk.Coins{genCoin.Sub(bondCoin)}.Equal(bankKeeper.GetAllBalances(ctxCheck, addr2))) diff --git a/x/staking/autocli.go b/x/staking/autocli.go new file mode 100644 index 000000000000..7793049bae2e --- /dev/null +++ b/x/staking/autocli.go @@ -0,0 +1,184 @@ +package staking + +import ( + "fmt" + + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + _ "cosmossdk.io/api/cosmos/crypto/ed25519" // register to that it shows up in protoregistry.GlobalTypes + stakingv1beta "cosmossdk.io/api/cosmos/staking/v1beta1" + + "github.com/cosmos/cosmos-sdk/version" +) + +func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { + return &autocliv1.ModuleOptions{ + Query: &autocliv1.ServiceCommandDescriptor{ + Service: stakingv1beta.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Validators", + Short: "Query for all validators", + Long: "Query details about all validators on a network.", + }, + { + RpcMethod: "Validator", + Use: "validator [validator-addr]", + Short: "Query a validator", + Long: "Query details about an individual validator.", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "validator_addr"}, + }, + }, + { + RpcMethod: "ValidatorDelegations", + Use: "delegations-to [validator-addr]", + Short: "Query all delegations made to one validator", + Long: "Query delegations on an individual validator.", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + { + ProtoField: "validator_addr", + }, + }, + }, + { + RpcMethod: "ValidatorUnbondingDelegations", + Use: "unbonding-delegations-from [validator-addr]", + Short: "Query all unbonding delegatations from a validator", + Long: "Query delegations that are unbonding _from_ a validator.", + Example: fmt.Sprintf("$ %s query staking unbonding-delegations-from [val-addr]", version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "validator_addr"}, + }, + }, + { + RpcMethod: "Delegation", + Use: "delegation [delegator-addr] [validator-addr]", + Short: "Query a delegation based on address and validator address", + Long: "Query delegations for an individual delegator on an individual validator", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "delegator_addr"}, + {ProtoField: "validator_addr"}, + }, + }, + { + RpcMethod: "UnbondingDelegation", + Use: "unbonding-delegation [delegator-addr] [validator-addr]", + Short: "Query an unbonding-delegation record based on delegator and validator address", + Long: "Query unbonding delegations for an individual delegator on an individual validator.", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "delegator_addr"}, + {ProtoField: "validator_addr"}, + }, + }, + { + RpcMethod: "DelegatorDelegations", + Use: "delegations [delegator-addr]", + Short: "Query all delegations made by one delegator", + Long: "Query delegations for an individual delegator on all validators.", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "delegator_addr"}, + }, + }, + { + RpcMethod: "DelegatorValidators", + Use: "delegator-validators [delegator-addr]", + Short: "Query all validators info for given delegator address", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "delegator_addr"}, + }, + }, + { + RpcMethod: "DelegatorValidator", + Use: "delegator-validator [delegator-addr] [validator-addr]", + Short: "Query validator info for given delegator validator pair", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "delegator_addr"}, + {ProtoField: "validator_addr"}, + }, + }, + { + RpcMethod: "DelegatorUnbondingDelegations", + Use: "unbonding-delegations [delegator-addr]", + Short: "Query all unbonding-delegations records for one delegator", + Long: "Query unbonding delegations for an individual delegator.", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "delegator_addr"}, + }, + }, + { + RpcMethod: "Redelegations", + Use: "redelegation [delegator-addr] [src-validator-addr] [dst-validator-addr]", + Short: "Query a redelegation record based on delegator and a source and destination validator address", + Long: "Query a redelegation record for an individual delegator between a source and destination validator.", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "delegator_addr"}, + {ProtoField: "src_validator_addr"}, + {ProtoField: "dst_validator_addr", Optional: true}, + }, + }, + { + RpcMethod: "HistoricalInfo", + Use: "historical-info [height]", + Short: "Query historical info at given height", + Example: fmt.Sprintf("$ %s query staking historical-info 5", version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "height"}, + }, + }, + { + RpcMethod: "Pool", + Use: "pool", + Short: "Query the current staking pool values", + Long: "Query values for amounts stored in the staking pool.", + }, + { + RpcMethod: "Params", + Use: "params", + Short: "Query the current staking parameters information", + Long: "Query values set as staking parameters.", + }, + }, + }, + Tx: &autocliv1.ServiceCommandDescriptor{ + Service: stakingv1beta.Msg_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Delegate", + Use: "delegate [validator-addr] [amount] --from [delegator_address]", + Short: "Delegate liquid tokens to a validator", + Long: "Delegate an amount of liquid coins to a validator from your wallet.", + Example: fmt.Sprintf("%s tx staking delegate cosmosvaloper... 1000stake --from mykey", version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "validator_address"}, {ProtoField: "amount"}}, + }, + { + RpcMethod: "BeginRedelegate", + Use: "redelegate [src-validator-addr] [dst-validator-addr] [amount] --from [delegator]", + Short: "Generate multisig signatures for transactions generated offline", + Long: "Redelegate an amount of illiquid staking tokens from one validator to another.", + Example: fmt.Sprintf(`%s tx staking redelegate cosmosvaloper... cosmosvaloper... 100stake --from mykey`, version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "validator_src_address"}, {ProtoField: "validator_dst_address"}, {ProtoField: "amount"}}, + }, + { + RpcMethod: "Undelegate", + Use: "unbond [validator-addr] [amount] --from [delegator_address]", + Short: "Unbond shares from a validator", + Long: "Unbond an amount of bonded shares from a validator.", + Example: fmt.Sprintf(`%s tx staking unbond cosmosvaloper... 100stake --from mykey`, version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "validator_address"}, {ProtoField: "amount"}}, + }, + { + RpcMethod: "CancelUnbondingDelegation", + Use: "cancel-unbond [validator-addr] [amount] [creation-height]", + Short: "Cancel unbonding delegation and delegate back to the validator", + Example: fmt.Sprintf(`%s tx staking cancel-unbond cosmosvaloper... 100stake 2 --from mykey`, version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "validator_address"}, {ProtoField: "amount"}, {ProtoField: "creation_height"}}, + }, + { + RpcMethod: "UpdateParams", + Skip: true, // skipped because authority gated + }, + }, + EnhanceCustomCommand: false, // use custom commands only until v0.51 + }, + } +} diff --git a/x/staking/bench_test.go b/x/staking/bench_test.go index 1d0fe95c4b4e..6f8461f11cdb 100644 --- a/x/staking/bench_test.go +++ b/x/staking/bench_test.go @@ -4,6 +4,7 @@ import ( "testing" "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking" diff --git a/x/staking/client/cli/flags.go b/x/staking/client/cli/flags.go index d4388e5c13f8..08789cfa6736 100644 --- a/x/staking/client/cli/flags.go +++ b/x/staking/client/cli/flags.go @@ -44,9 +44,9 @@ var ( func init() { fsShares.String(FlagSharesAmount, "", "Amount of source-shares to either unbond or redelegate as a positive integer or decimal") fsShares.String(FlagSharesFraction, "", "Fraction of source-shares to either unbond or redelegate as a positive integer or decimal >0 and <=1") - fsValidator.String(FlagAddressValidator, "", "The Bech32 address of the validator") - fsRedelegation.String(FlagAddressValidatorSrc, "", "The Bech32 address of the source validator") - fsRedelegation.String(FlagAddressValidatorDst, "", "The Bech32 address of the destination validator") + fsValidator.String(FlagAddressValidator, "", "The address of the validator") + fsRedelegation.String(FlagAddressValidatorSrc, "", "The address of the source validator") + fsRedelegation.String(FlagAddressValidatorDst, "", "The address of the destination validator") } // FlagSetCommissionCreate Returns the FlagSet used for commission create. diff --git a/x/staking/client/cli/query.go b/x/staking/client/cli/query.go deleted file mode 100644 index d896b54ef7a0..000000000000 --- a/x/staking/client/cli/query.go +++ /dev/null @@ -1,738 +0,0 @@ -package cli - -import ( - "fmt" - "strconv" - "strings" - - "cosmossdk.io/core/address" - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/version" - "github.com/cosmos/cosmos-sdk/x/staking/types" -) - -// GetQueryCmd returns the cli query commands for this module -func GetQueryCmd(ac address.Codec) *cobra.Command { - stakingQueryCmd := &cobra.Command{ - Use: types.ModuleName, - Short: "Querying commands for the staking module", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - stakingQueryCmd.AddCommand( - GetCmdQueryDelegation(ac), - GetCmdQueryDelegations(ac), - GetCmdQueryUnbondingDelegation(ac), - GetCmdQueryUnbondingDelegations(ac), - GetCmdQueryRedelegation(ac), - GetCmdQueryRedelegations(ac), - GetCmdQueryValidator(), - GetCmdQueryValidators(), - GetCmdQueryValidatorDelegations(), - GetCmdQueryValidatorUnbondingDelegations(), - GetCmdQueryValidatorRedelegations(), - GetCmdQueryHistoricalInfo(), - GetCmdQueryParams(), - GetCmdQueryPool(), - ) - - return stakingQueryCmd -} - -// GetCmdQueryValidator implements the validator query command. -func GetCmdQueryValidator() *cobra.Command { - bech32PrefixValAddr := sdk.GetConfig().GetBech32ValidatorAddrPrefix() - - cmd := &cobra.Command{ - Use: "validator [validator-addr]", - Short: "Query a validator", - Long: strings.TrimSpace( - fmt.Sprintf(`Query details about an individual validator. - -Example: -$ %s query staking validator %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj -`, - version.AppName, bech32PrefixValAddr, - ), - ), - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - addr, err := sdk.ValAddressFromBech32(args[0]) - if err != nil { - return err - } - - params := &types.QueryValidatorRequest{ValidatorAddr: addr.String()} - res, err := queryClient.Validator(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(&res.Validator) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetCmdQueryValidators implements the query all validators command. -func GetCmdQueryValidators() *cobra.Command { - cmd := &cobra.Command{ - Use: "validators", - Short: "Query for all validators", - Args: cobra.NoArgs, - Long: strings.TrimSpace( - fmt.Sprintf(`Query details about all validators on a network. - -Example: -$ %s query staking validators -`, - version.AppName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - result, err := queryClient.Validators(cmd.Context(), &types.QueryValidatorsRequest{ - // Leaving status empty on purpose to query all validators. - Pagination: pageReq, - }) - if err != nil { - return err - } - - return clientCtx.PrintProto(result) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "validators") - - return cmd -} - -// GetCmdQueryValidatorUnbondingDelegations implements the query all unbonding delegatations from a validator command. -func GetCmdQueryValidatorUnbondingDelegations() *cobra.Command { - bech32PrefixValAddr := sdk.GetConfig().GetBech32ValidatorAddrPrefix() - - cmd := &cobra.Command{ - Use: "unbonding-delegations-from [validator-addr]", - Short: "Query all unbonding delegatations from a validator", - Long: strings.TrimSpace( - fmt.Sprintf(`Query delegations that are unbonding _from_ a validator. - -Example: -$ %s query staking unbonding-delegations-from %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj -`, - version.AppName, bech32PrefixValAddr, - ), - ), - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - valAddr, err := sdk.ValAddressFromBech32(args[0]) - if err != nil { - return err - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - params := &types.QueryValidatorUnbondingDelegationsRequest{ - ValidatorAddr: valAddr.String(), - Pagination: pageReq, - } - - res, err := queryClient.ValidatorUnbondingDelegations(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "unbonding delegations") - - return cmd -} - -// GetCmdQueryValidatorRedelegations implements the query all redelegatations -// from a validator command. -func GetCmdQueryValidatorRedelegations() *cobra.Command { - bech32PrefixValAddr := sdk.GetConfig().GetBech32ValidatorAddrPrefix() - - cmd := &cobra.Command{ - Use: "redelegations-from [validator-addr]", - Short: "Query all outgoing redelegatations from a validator", - Long: strings.TrimSpace( - fmt.Sprintf(`Query delegations that are redelegating _from_ a validator. - -Example: -$ %s query staking redelegations-from %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj -`, - version.AppName, bech32PrefixValAddr, - ), - ), - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - valSrcAddr, err := sdk.ValAddressFromBech32(args[0]) - if err != nil { - return err - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - params := &types.QueryRedelegationsRequest{ - SrcValidatorAddr: valSrcAddr.String(), - Pagination: pageReq, - } - - res, err := queryClient.Redelegations(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "validator redelegations") - - return cmd -} - -// GetCmdQueryDelegation the query delegation command. -func GetCmdQueryDelegation(ac address.Codec) *cobra.Command { - cmd := &cobra.Command{ - Use: "delegation [delegator-addr] [validator-addr]", - Short: "Query a delegation based on address and validator address", - Example: fmt.Sprintf(`%s query staking delegation [delegator-address] [validator-address]`, - version.AppName), - Long: "Query delegations for an individual delegator on an individual validator", - Args: cobra.ExactArgs(2), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - _, err = ac.StringToBytes(args[0]) - if err != nil { - return err - } - - valAddr, err := sdk.ValAddressFromBech32(args[1]) - if err != nil { - return err - } - - params := &types.QueryDelegationRequest{ - DelegatorAddr: args[0], - ValidatorAddr: valAddr.String(), - } - - res, err := queryClient.Delegation(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res.DelegationResponse) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetCmdQueryDelegations implements the command to query all the delegations -// made from one delegator. -func GetCmdQueryDelegations(ac address.Codec) *cobra.Command { - bech32PrefixAccAddr := sdk.GetConfig().GetBech32AccountAddrPrefix() - - cmd := &cobra.Command{ - Use: "delegations [delegator-addr]", - Short: "Query all delegations made by one delegator", - Long: strings.TrimSpace( - fmt.Sprintf(`Query delegations for an individual delegator on all validators. - -Example: -$ %s query staking delegations %s1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p -`, - version.AppName, bech32PrefixAccAddr, - ), - ), - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - _, err = ac.StringToBytes(args[0]) - if err != nil { - return err - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - params := &types.QueryDelegatorDelegationsRequest{ - DelegatorAddr: args[0], - Pagination: pageReq, - } - - res, err := queryClient.DelegatorDelegations(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "delegations") - - return cmd -} - -// GetCmdQueryValidatorDelegations implements the command to query all the -// delegations to a specific validator. -func GetCmdQueryValidatorDelegations() *cobra.Command { - bech32PrefixValAddr := sdk.GetConfig().GetBech32ValidatorAddrPrefix() - - cmd := &cobra.Command{ - Use: "delegations-to [validator-addr]", - Short: "Query all delegations made to one validator", - Long: strings.TrimSpace( - fmt.Sprintf(`Query delegations on an individual validator. - -Example: -$ %s query staking delegations-to %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj -`, - version.AppName, bech32PrefixValAddr, - ), - ), - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - valAddr, err := sdk.ValAddressFromBech32(args[0]) - if err != nil { - return err - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - params := &types.QueryValidatorDelegationsRequest{ - ValidatorAddr: valAddr.String(), - Pagination: pageReq, - } - - res, err := queryClient.ValidatorDelegations(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "validator delegations") - - return cmd -} - -// GetCmdQueryUnbondingDelegation implements the command to query a single -// unbonding-delegation record. -func GetCmdQueryUnbondingDelegation(ac address.Codec) *cobra.Command { - bech32PrefixAccAddr := sdk.GetConfig().GetBech32AccountAddrPrefix() - bech32PrefixValAddr := sdk.GetConfig().GetBech32ValidatorAddrPrefix() - - cmd := &cobra.Command{ - Use: "unbonding-delegation [delegator-addr] [validator-addr]", - Short: "Query an unbonding-delegation record based on delegator and validator address", - Long: strings.TrimSpace( - fmt.Sprintf(`Query unbonding delegations for an individual delegator on an individual validator. - -Example: -$ %s query staking unbonding-delegation %s1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj -`, - version.AppName, bech32PrefixAccAddr, bech32PrefixValAddr, - ), - ), - Args: cobra.ExactArgs(2), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - valAddr, err := sdk.ValAddressFromBech32(args[1]) - if err != nil { - return err - } - - _, err = ac.StringToBytes(args[0]) - if err != nil { - return err - } - - params := &types.QueryUnbondingDelegationRequest{ - DelegatorAddr: args[0], - ValidatorAddr: valAddr.String(), - } - - res, err := queryClient.UnbondingDelegation(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(&res.Unbond) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetCmdQueryUnbondingDelegations implements the command to query all the -// unbonding-delegation records for a delegator. -func GetCmdQueryUnbondingDelegations(ac address.Codec) *cobra.Command { - bech32PrefixAccAddr := sdk.GetConfig().GetBech32AccountAddrPrefix() - - cmd := &cobra.Command{ - Use: "unbonding-delegations [delegator-addr]", - Short: "Query all unbonding-delegations records for one delegator", - Long: strings.TrimSpace( - fmt.Sprintf(`Query unbonding delegations for an individual delegator. - -Example: -$ %s query staking unbonding-delegations %s1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p -`, - version.AppName, bech32PrefixAccAddr, - ), - ), - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - _, err = ac.StringToBytes(args[0]) - if err != nil { - return err - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - params := &types.QueryDelegatorUnbondingDelegationsRequest{ - DelegatorAddr: args[0], - Pagination: pageReq, - } - - res, err := queryClient.DelegatorUnbondingDelegations(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "unbonding delegations") - - return cmd -} - -// GetCmdQueryRedelegation implements the command to query a single -// redelegation record. -func GetCmdQueryRedelegation(ac address.Codec) *cobra.Command { - bech32PrefixAccAddr := sdk.GetConfig().GetBech32AccountAddrPrefix() - bech32PrefixValAddr := sdk.GetConfig().GetBech32ValidatorAddrPrefix() - - cmd := &cobra.Command{ - Use: "redelegation [delegator-addr] [src-validator-addr] [dst-validator-addr]", - Short: "Query a redelegation record based on delegator and a source and destination validator address", - Long: strings.TrimSpace( - fmt.Sprintf(`Query a redelegation record for an individual delegator between a source and destination validator. - -Example: -$ %s query staking redelegation %s1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p %s1l2rsakp388kuv9k8qzq6lrm9taddae7fpx59wm %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj -`, - version.AppName, bech32PrefixAccAddr, bech32PrefixValAddr, bech32PrefixValAddr, - ), - ), - Args: cobra.ExactArgs(3), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - _, err = ac.StringToBytes(args[0]) - if err != nil { - return err - } - - valSrcAddr, err := sdk.ValAddressFromBech32(args[1]) - if err != nil { - return err - } - - valDstAddr, err := sdk.ValAddressFromBech32(args[2]) - if err != nil { - return err - } - - params := &types.QueryRedelegationsRequest{ - DelegatorAddr: args[0], - DstValidatorAddr: valDstAddr.String(), - SrcValidatorAddr: valSrcAddr.String(), - } - - res, err := queryClient.Redelegations(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetCmdQueryRedelegations implements the command to query all the -// redelegation records for a delegator. -func GetCmdQueryRedelegations(ac address.Codec) *cobra.Command { - bech32PrefixAccAddr := sdk.GetConfig().GetBech32AccountAddrPrefix() - - cmd := &cobra.Command{ - Use: "redelegations [delegator-addr]", - Args: cobra.ExactArgs(1), - Short: "Query all redelegations records for one delegator", - Long: strings.TrimSpace( - fmt.Sprintf(`Query all redelegation records for an individual delegator. - -Example: -$ %s query staking redelegation %s1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p -`, - version.AppName, bech32PrefixAccAddr, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - _, err = ac.StringToBytes(args[0]) - if err != nil { - return err - } - - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - - params := &types.QueryRedelegationsRequest{ - DelegatorAddr: args[0], - Pagination: pageReq, - } - - res, err := queryClient.Redelegations(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "delegator redelegations") - - return cmd -} - -// GetCmdQueryHistoricalInfo implements the historical info query command -func GetCmdQueryHistoricalInfo() *cobra.Command { - cmd := &cobra.Command{ - Use: "historical-info [height]", - Args: cobra.ExactArgs(1), - Short: "Query historical info at given height", - Long: strings.TrimSpace( - fmt.Sprintf(`Query historical info at given height. - -Example: -$ %s query staking historical-info 5 -`, - version.AppName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - height, err := strconv.ParseInt(args[0], 10, 64) - if err != nil || height < 0 { - return fmt.Errorf("height argument provided must be a non-negative-integer: %v", err) - } - - params := &types.QueryHistoricalInfoRequest{Height: height} - res, err := queryClient.HistoricalInfo(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res.Hist) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetCmdQueryPool implements the pool query command. -func GetCmdQueryPool() *cobra.Command { - cmd := &cobra.Command{ - Use: "pool", - Args: cobra.NoArgs, - Short: "Query the current staking pool values", - Long: strings.TrimSpace( - fmt.Sprintf(`Query values for amounts stored in the staking pool. - -Example: -$ %s query staking pool -`, - version.AppName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - res, err := queryClient.Pool(cmd.Context(), &types.QueryPoolRequest{}) - if err != nil { - return err - } - - return clientCtx.PrintProto(&res.Pool) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetCmdQueryParams implements the params query command. -func GetCmdQueryParams() *cobra.Command { - cmd := &cobra.Command{ - Use: "params", - Args: cobra.NoArgs, - Short: "Query the current staking parameters information", - Long: strings.TrimSpace( - fmt.Sprintf(`Query values set as staking parameters. - -Example: -$ %s query staking params -`, - version.AppName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - res, err := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{}) - if err != nil { - return err - } - - return clientCtx.PrintProto(&res.Params) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/staking/client/cli/query_test.go b/x/staking/client/cli/query_test.go deleted file mode 100644 index febffe77da3a..000000000000 --- a/x/staking/client/cli/query_test.go +++ /dev/null @@ -1,563 +0,0 @@ -package cli_test - -import ( - "fmt" - "strings" - - "github.com/cosmos/gogoproto/proto" - - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/codec/address" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/staking/client/cli" - "github.com/cosmos/cosmos-sdk/x/staking/types" -) - -func (s *CLITestSuite) TestGetCmdQueryValidator() { - testCases := []struct { - name string - args []string - expectErr bool - }{ - { - "with invalid address ", - []string{"somethinginvalidaddress", fmt.Sprintf("--%s=json", flags.FlagOutput)}, - true, - }, - { - "happy case", - []string{sdk.ValAddress(s.addrs[0]).String(), fmt.Sprintf("--%s=json", flags.FlagOutput)}, - false, - }, - } - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryValidator() - clientCtx := s.clientCtx - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - if tc.expectErr { - s.Require().Error(err) - s.Require().NotEqual("internal", err.Error()) - } else { - var result types.Validator - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &result)) - } - }) - } -} - -func (s *CLITestSuite) TestGetCmdQueryValidators() { - testCases := []struct { - name string - args []string - minValidatorCount int - }{ - { - "one validator case", - []string{ - fmt.Sprintf("--%s=json", flags.FlagOutput), - fmt.Sprintf("--%s=1", flags.FlagLimit), - }, - 1, - }, - { - "multi validator case", - []string{fmt.Sprintf("--%s=json", flags.FlagOutput)}, - 0, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryValidators() - clientCtx := s.clientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - s.Require().NoError(err) - - var result types.QueryValidatorsResponse - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &result)) - }) - } -} - -func (s *CLITestSuite) TestGetCmdQueryDelegation() { - testCases := []struct { - name string - args []string - expErr bool - respType proto.Message - }{ - { - "with wrong delegator address", - []string{ - "wrongDelAddr", - s.addrs[1].String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, nil, - }, - { - "with wrong validator address", - []string{ - s.addrs[0].String(), - "wrongValAddr", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, nil, - }, - { - "with json output", - []string{ - s.addrs[0].String(), - sdk.ValAddress(s.addrs[1]).String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - &types.DelegationResponse{}, - }, - } - - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryDelegation(address.NewBech32Codec("cosmos")) - clientCtx := s.clientCtx - - _, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - if tc.expErr { - s.Require().Error(err) - } else { - s.Require().Contains(err.Error(), "Marshal called with nil") - } - }) - } -} - -func (s *CLITestSuite) TestGetCmdQueryDelegations() { - testCases := []struct { - name string - args []string - expErr bool - respType proto.Message - }{ - { - "with no delegator address", - []string{}, - true, nil, - }, - { - "with wrong delegator address", - []string{"wrongDelAddr"}, - true, nil, - }, - { - "valid request (height specific)", - []string{ - s.addrs[0].String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - fmt.Sprintf("--%s=1", flags.FlagHeight), - }, - false, - &types.QueryDelegatorDelegationsResponse{}, - }, - } - - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryDelegations(address.NewBech32Codec("cosmos")) - clientCtx := s.clientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - if tc.expErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), tc.respType), out.String()) - } - }) - } -} - -func (s *CLITestSuite) TestGetCmdQueryValidatorDelegations() { - testCases := []struct { - name string - args []string - expErr bool - respType proto.Message - }{ - { - "with no validator address", - []string{}, - true, nil, - }, - { - "wrong validator address", - []string{"wrongValAddr"}, - true, nil, - }, - { - "valid request(height specific)", - []string{ - s.addrs[0].String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - fmt.Sprintf("--%s=1", flags.FlagHeight), - }, - false, - &types.QueryValidatorDelegationsResponse{}, - }, - } - - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryDelegations(address.NewBech32Codec("cosmos")) - clientCtx := s.clientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - if tc.expErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), tc.respType), out.String()) - } - }) - } -} - -func (s *CLITestSuite) TestGetCmdQueryUnbondingDelegations() { - testCases := []struct { - name string - args []string - expErr bool - }{ - { - "wrong delegator address", - []string{ - "wrongDelAddr", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - }, - { - "valid request", - []string{ - s.addrs[0].String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - }, - } - - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryUnbondingDelegations(address.NewBech32Codec("cosmos")) - clientCtx := s.clientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - - if tc.expErr { - s.Require().Error(err) - } else { - var ubds types.QueryDelegatorUnbondingDelegationsResponse - err = s.clientCtx.Codec.UnmarshalJSON(out.Bytes(), &ubds) - - s.Require().NoError(err) - } - }) - } -} - -func (s *CLITestSuite) TestGetCmdQueryUnbondingDelegation() { - testCases := []struct { - name string - args []string - expErr bool - }{ - { - "wrong delegator address", - []string{ - "wrongDelAddr", - s.addrs[0].String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - }, - { - "wrong validator address", - []string{ - s.addrs[0].String(), - "wrongValAddr", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - }, - { - "valid request", - []string{ - s.addrs[0].String(), - sdk.ValAddress(s.addrs[1]).String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - }, - } - - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryUnbondingDelegation(address.NewBech32Codec("cosmos")) - clientCtx := s.clientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - - if tc.expErr { - s.Require().Error(err) - } else { - var ubd types.UnbondingDelegation - - err = s.clientCtx.Codec.UnmarshalJSON(out.Bytes(), &ubd) - s.Require().NoError(err) - } - }) - } -} - -func (s *CLITestSuite) TestGetCmdQueryValidatorUnbondingDelegations() { - testCases := []struct { - name string - args []string - expErr bool - }{ - { - "wrong validator address", - []string{ - "wrongValAddr", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - }, - { - "valid request", - []string{ - sdk.ValAddress(s.addrs[0]).String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - }, - } - - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryValidatorUnbondingDelegations() - clientCtx := s.clientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - - if tc.expErr { - s.Require().Error(err) - } else { - var ubds types.QueryValidatorUnbondingDelegationsResponse - err = s.clientCtx.Codec.UnmarshalJSON(out.Bytes(), &ubds) - s.Require().NoError(err) - } - }) - } -} - -func (s *CLITestSuite) TestGetCmdQueryRedelegations() { - testCases := []struct { - name string - args []string - expErr bool - }{ - { - "wrong delegator address", - []string{ - "wrongdeladdr", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - }, - { - "valid request", - []string{ - s.addrs[0].String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - }, - } - - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryRedelegations(address.NewBech32Codec("cosmos")) - clientCtx := s.clientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - - if tc.expErr { - s.Require().Error(err) - } else { - var redelegations types.QueryRedelegationsResponse - err = s.clientCtx.Codec.UnmarshalJSON(out.Bytes(), &redelegations) - s.Require().NoError(err) - } - }) - } -} - -func (s *CLITestSuite) TestGetCmdQueryRedelegation() { - testCases := []struct { - name string - args []string - expErr bool - }{ - { - "wrong delegator address", - []string{ - "wrongdeladdr", - sdk.ValAddress(s.addrs[0]).String(), - sdk.ValAddress(s.addrs[1]).String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - }, - { - "wrong source validator address address", - []string{ - s.addrs[0].String(), - "wrongSrcValAddress", - sdk.ValAddress(s.addrs[1]).String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - }, - { - "wrong destination validator address address", - []string{ - s.addrs[0].String(), - sdk.ValAddress(s.addrs[0]).String(), - "wrongDestValAddress", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - }, - { - "valid request", - []string{ - s.addrs[0].String(), - sdk.ValAddress(s.addrs[0]).String(), - sdk.ValAddress(s.addrs[1]).String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - }, - } - - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryRedelegation(address.NewBech32Codec("cosmos")) - clientCtx := s.clientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - - if tc.expErr { - s.Require().Error(err) - } else { - var redelegations types.QueryRedelegationsResponse - - err = s.clientCtx.Codec.UnmarshalJSON(out.Bytes(), &redelegations) - s.Require().NoError(err) - } - }) - } -} - -func (s *CLITestSuite) TestGetCmdQueryValidatorRedelegations() { - testCases := []struct { - name string - args []string - expErr bool - }{ - { - "wrong validator address", - []string{ - "wrongValAddr", - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - true, - }, - { - "valid request", - []string{ - sdk.ValAddress(s.addrs[0]).String(), - fmt.Sprintf("--%s=json", flags.FlagOutput), - }, - false, - }, - } - - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryValidatorRedelegations() - clientCtx := s.clientCtx - - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - - if tc.expErr { - s.Require().Error(err) - } else { - var redelegations types.QueryRedelegationsResponse - err = s.clientCtx.Codec.UnmarshalJSON(out.Bytes(), &redelegations) - s.Require().NoError(err) - } - }) - } -} - -func (s *CLITestSuite) TestGetCmdQueryPool() { - testCases := []struct { - name string - args []string - expectedOutput string - }{ - { - "with text", - []string{ - fmt.Sprintf("--%s=text", flags.FlagOutput), - fmt.Sprintf("--%s=1", flags.FlagHeight), - }, - `bonded_tokens: "0" -not_bonded_tokens: "0"`, - }, - { - "with json", - []string{ - fmt.Sprintf("--%s=json", flags.FlagOutput), - fmt.Sprintf("--%s=1", flags.FlagHeight), - }, - `{"not_bonded_tokens":"0","bonded_tokens":"0"}`, - }, - } - for _, tc := range testCases { - tc := tc - s.Run(tc.name, func() { - cmd := cli.GetCmdQueryPool() - clientCtx := s.clientCtx - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - s.Require().NoError(err) - s.Require().Equal(tc.expectedOutput, strings.TrimSpace(out.String())) - }) - } -} diff --git a/x/staking/client/cli/tx.go b/x/staking/client/cli/tx.go index 879fa30589d8..86ab1a815880 100644 --- a/x/staking/client/cli/tx.go +++ b/x/staking/client/cli/tx.go @@ -6,12 +6,12 @@ import ( "strconv" "strings" - "cosmossdk.io/math" - "github.com/spf13/cobra" flag "github.com/spf13/pflag" + "cosmossdk.io/core/address" errorsmod "cosmossdk.io/errors" + "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" @@ -34,7 +34,7 @@ var ( ) // NewTxCmd returns a root CLI command handler for all x/staking transaction commands. -func NewTxCmd() *cobra.Command { +func NewTxCmd(valAddrCodec, ac address.Codec) *cobra.Command { stakingTxCmd := &cobra.Command{ Use: types.ModuleName, Short: "Staking transaction subcommands", @@ -44,19 +44,19 @@ func NewTxCmd() *cobra.Command { } stakingTxCmd.AddCommand( - NewCreateValidatorCmd(), - NewEditValidatorCmd(), - NewDelegateCmd(), - NewRedelegateCmd(), - NewUnbondCmd(), - NewCancelUnbondingDelegation(), + NewCreateValidatorCmd(valAddrCodec), + NewEditValidatorCmd(valAddrCodec), + NewDelegateCmd(valAddrCodec, ac), + NewRedelegateCmd(valAddrCodec, ac), + NewUnbondCmd(valAddrCodec, ac), + NewCancelUnbondingDelegation(valAddrCodec, ac), ) return stakingTxCmd } // NewCreateValidatorCmd returns a CLI command handler for creating a MsgCreateValidator transaction. -func NewCreateValidatorCmd() *cobra.Command { +func NewCreateValidatorCmd(ac address.Codec) *cobra.Command { cmd := &cobra.Command{ Use: "create-validator [path/to/validator.json]", Short: "create new validator initialized with a self-delegation to it", @@ -100,7 +100,7 @@ where we can get the pubkey using "%s tendermint show-validator" return err } - txf, msg, err := newBuildCreateValidatorMsg(clientCtx, txf, cmd.Flags(), validator) + txf, msg, err := newBuildCreateValidatorMsg(clientCtx, txf, cmd.Flags(), validator, ac) if err != nil { return err } @@ -119,7 +119,7 @@ where we can get the pubkey using "%s tendermint show-validator" } // NewEditValidatorCmd returns a CLI command handler for creating a MsgEditValidator transaction. -func NewEditValidatorCmd() *cobra.Command { +func NewEditValidatorCmd(ac address.Codec) *cobra.Command { cmd := &cobra.Command{ Use: "edit-validator", Short: "edit an existing validator account", @@ -128,7 +128,7 @@ func NewEditValidatorCmd() *cobra.Command { if err != nil { return err } - valAddr := clientCtx.GetFromAddress() + moniker, _ := cmd.Flags().GetString(FlagEditMoniker) identity, _ := cmd.Flags().GetString(FlagIdentity) website, _ := cmd.Flags().GetString(FlagWebsite) @@ -160,7 +160,12 @@ func NewEditValidatorCmd() *cobra.Command { newMinSelfDelegation = &msb } - msg := types.NewMsgEditValidator(sdk.ValAddress(valAddr), description, newRate, newMinSelfDelegation) + valAddr, err := ac.BytesToString(clientCtx.GetFromAddress()) + if err != nil { + return err + } + + msg := types.NewMsgEditValidator(valAddr, description, newRate, newMinSelfDelegation) return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) }, @@ -175,9 +180,7 @@ func NewEditValidatorCmd() *cobra.Command { } // NewDelegateCmd returns a CLI command handler for creating a MsgDelegate transaction. -func NewDelegateCmd() *cobra.Command { - bech32PrefixValAddr := sdk.GetConfig().GetBech32ValidatorAddrPrefix() - +func NewDelegateCmd(valAddrCodec, ac address.Codec) *cobra.Command { cmd := &cobra.Command{ Use: "delegate [validator-addr] [amount]", Args: cobra.ExactArgs(2), @@ -186,9 +189,9 @@ func NewDelegateCmd() *cobra.Command { fmt.Sprintf(`Delegate an amount of liquid coins to a validator from your wallet. Example: -$ %s tx staking delegate %s1l2rsakp388kuv9k8qzq6lrm9taddae7fpx59wm 1000stake --from mykey +$ %s tx staking delegate cosmosvalopers1l2rsakp388kuv9k8qzq6lrm9taddae7fpx59wm 1000stake --from mykey `, - version.AppName, bech32PrefixValAddr, + version.AppName, ), ), RunE: func(cmd *cobra.Command, args []string) error { @@ -201,13 +204,17 @@ $ %s tx staking delegate %s1l2rsakp388kuv9k8qzq6lrm9taddae7fpx59wm 1000stake --f return err } - delAddr := clientCtx.GetFromAddress() - valAddr, err := sdk.ValAddressFromBech32(args[0]) + delAddr, err := ac.BytesToString(clientCtx.GetFromAddress()) if err != nil { return err } - msg := types.NewMsgDelegate(delAddr, valAddr, amount) + _, err = valAddrCodec.StringToBytes(args[0]) + if err != nil { + return err + } + + msg := types.NewMsgDelegate(delAddr, args[0], amount) return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) }, @@ -219,9 +226,7 @@ $ %s tx staking delegate %s1l2rsakp388kuv9k8qzq6lrm9taddae7fpx59wm 1000stake --f } // NewRedelegateCmd returns a CLI command handler for creating a MsgBeginRedelegate transaction. -func NewRedelegateCmd() *cobra.Command { - bech32PrefixValAddr := sdk.GetConfig().GetBech32ValidatorAddrPrefix() - +func NewRedelegateCmd(valAddrCodec, ac address.Codec) *cobra.Command { cmd := &cobra.Command{ Use: "redelegate [src-validator-addr] [dst-validator-addr] [amount]", Short: "Redelegate illiquid tokens from one validator to another", @@ -230,9 +235,9 @@ func NewRedelegateCmd() *cobra.Command { fmt.Sprintf(`Redelegate an amount of illiquid staking tokens from one validator to another. Example: -$ %s tx staking redelegate %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj %s1l2rsakp388kuv9k8qzq6lrm9taddae7fpx59wm 100stake --from mykey +$ %s tx staking redelegate cosmosvalopers1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj cosmosvalopers1l2rsakp388kuv9k8qzq6lrm9taddae7fpx59wm 100stake --from mykey `, - version.AppName, bech32PrefixValAddr, bech32PrefixValAddr, + version.AppName, ), ), RunE: func(cmd *cobra.Command, args []string) error { @@ -240,13 +245,17 @@ $ %s tx staking redelegate %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj %s1l2rsakp3 if err != nil { return err } - delAddr := clientCtx.GetFromAddress() - valSrcAddr, err := sdk.ValAddressFromBech32(args[0]) + delAddr, err := ac.BytesToString(clientCtx.GetFromAddress()) if err != nil { return err } - valDstAddr, err := sdk.ValAddressFromBech32(args[1]) + _, err = valAddrCodec.StringToBytes(args[0]) + if err != nil { + return err + } + + _, err = valAddrCodec.StringToBytes(args[1]) if err != nil { return err } @@ -256,7 +265,7 @@ $ %s tx staking redelegate %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj %s1l2rsakp3 return err } - msg := types.NewMsgBeginRedelegate(delAddr, valSrcAddr, valDstAddr, amount) + msg := types.NewMsgBeginRedelegate(delAddr, args[0], args[1], amount) return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) }, @@ -268,7 +277,7 @@ $ %s tx staking redelegate %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj %s1l2rsakp3 } // NewUnbondCmd returns a CLI command handler for creating a MsgUndelegate transaction. -func NewUnbondCmd() *cobra.Command { +func NewUnbondCmd(valAddrCodec, ac address.Codec) *cobra.Command { bech32PrefixValAddr := sdk.GetConfig().GetBech32ValidatorAddrPrefix() cmd := &cobra.Command{ @@ -290,8 +299,11 @@ $ %s tx staking unbond %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj 100stake --from return err } - delAddr := clientCtx.GetFromAddress() - valAddr, err := sdk.ValAddressFromBech32(args[0]) + delAddr, err := ac.BytesToString(clientCtx.GetFromAddress()) + if err != nil { + return err + } + _, err = valAddrCodec.StringToBytes(args[0]) if err != nil { return err } @@ -301,7 +313,7 @@ $ %s tx staking unbond %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj 100stake --from return err } - msg := types.NewMsgUndelegate(delAddr, valAddr, amount) + msg := types.NewMsgUndelegate(delAddr, args[0], amount) return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) }, @@ -313,7 +325,7 @@ $ %s tx staking unbond %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj 100stake --from } // NewCancelUnbondingDelegation returns a CLI command handler for creating a MsgCancelUnbondingDelegation transaction. -func NewCancelUnbondingDelegation() *cobra.Command { +func NewCancelUnbondingDelegation(valAddrCodec, ac address.Codec) *cobra.Command { bech32PrefixValAddr := sdk.GetConfig().GetBech32ValidatorAddrPrefix() cmd := &cobra.Command{ @@ -336,8 +348,12 @@ $ %s tx staking cancel-unbond %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj 100stake if err != nil { return err } - delAddr := clientCtx.GetFromAddress() - valAddr, err := sdk.ValAddressFromBech32(args[0]) + delAddr, err := ac.BytesToString(clientCtx.GetFromAddress()) + if err != nil { + return err + } + + _, err = valAddrCodec.StringToBytes(args[0]) if err != nil { return err } @@ -352,7 +368,7 @@ $ %s tx staking cancel-unbond %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj 100stake return errorsmod.Wrap(fmt.Errorf("invalid height: %d", creationHeight), "invalid height") } - msg := types.NewMsgCancelUnbondingDelegation(delAddr, valAddr, creationHeight, amount) + msg := types.NewMsgCancelUnbondingDelegation(delAddr, args[0], creationHeight, amount) return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) }, @@ -363,7 +379,7 @@ $ %s tx staking cancel-unbond %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj 100stake return cmd } -func newBuildCreateValidatorMsg(clientCtx client.Context, txf tx.Factory, fs *flag.FlagSet, val validator) (tx.Factory, *types.MsgCreateValidator, error) { +func newBuildCreateValidatorMsg(clientCtx client.Context, txf tx.Factory, fs *flag.FlagSet, val validator, valAc address.Codec) (tx.Factory, *types.MsgCreateValidator, error) { valAddr := clientCtx.GetFromAddress() description := types.NewDescription( @@ -374,13 +390,17 @@ func newBuildCreateValidatorMsg(clientCtx client.Context, txf tx.Factory, fs *fl val.Details, ) + valStr, err := valAc.BytesToString(sdk.ValAddress(valAddr)) + if err != nil { + return txf, nil, err + } msg, err := types.NewMsgCreateValidator( - sdk.ValAddress(valAddr), val.PubKey, val.Amount, description, val.CommissionRates, val.MinSelfDelegation, + valStr, val.PubKey, val.Amount, description, val.CommissionRates, val.MinSelfDelegation, ) if err != nil { return txf, nil, err } - if err := msg.Validate(); err != nil { + if err := msg.Validate(valAc); err != nil { return txf, nil, err } @@ -550,7 +570,7 @@ func PrepareConfigForTxCreateValidator(flagSet *flag.FlagSet, moniker, nodeID, c } // BuildCreateValidatorMsg makes a new MsgCreateValidator. -func BuildCreateValidatorMsg(clientCtx client.Context, config TxCreateValidatorConfig, txBldr tx.Factory, generateOnly bool) (tx.Factory, sdk.Msg, error) { +func BuildCreateValidatorMsg(clientCtx client.Context, config TxCreateValidatorConfig, txBldr tx.Factory, generateOnly bool, valCodec address.Codec) (tx.Factory, sdk.Msg, error) { amounstStr := config.Amount amount, err := sdk.ParseCoinNormalized(amounstStr) if err != nil { @@ -583,8 +603,13 @@ func BuildCreateValidatorMsg(clientCtx client.Context, config TxCreateValidatorC return txBldr, nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "minimum self delegation must be a positive integer") } + valStr, err := valCodec.BytesToString(sdk.ValAddress(valAddr)) + if err != nil { + return txBldr, nil, err + } + msg, err := types.NewMsgCreateValidator( - sdk.ValAddress(valAddr), + valStr, config.PubKey, amount, description, diff --git a/x/staking/client/cli/tx_test.go b/x/staking/client/cli/tx_test.go index 1e43f2e3a86c..77d4727606d2 100644 --- a/x/staking/client/cli/tx_test.go +++ b/x/staking/client/cli/tx_test.go @@ -8,11 +8,13 @@ import ( abci "github.com/cometbft/cometbft/abci/types" rpcclientmock "github.com/cometbft/cometbft/rpc/client/mock" "github.com/spf13/pflag" - "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" + sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/crypto/hd" "github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" @@ -78,6 +80,7 @@ func (s *CLITestSuite) TestPrepareConfigForTxCreateValidator() { privKey := ed25519.GenPrivKey() valPubKey := privKey.PubKey() moniker := "DefaultMoniker" + require := s.Require() mkTxValCfg := func(amount, commission, commissionMax, commissionMaxChange, minSelfDelegation string) cli.TxCreateValidatorConfig { return cli.TxCreateValidatorConfig{ IP: ip, @@ -107,35 +110,35 @@ func (s *CLITestSuite) TestPrepareConfigForTxCreateValidator() { { name: "Custom amount", fsModify: func(fs *pflag.FlagSet) { - fs.Set(cli.FlagAmount, "2000stake") + require.NoError(fs.Set(cli.FlagAmount, "2000stake")) }, expectedCfg: mkTxValCfg("2000stake", "0.1", "0.2", "0.01", "1"), }, { name: "Custom commission rate", fsModify: func(fs *pflag.FlagSet) { - fs.Set(cli.FlagCommissionRate, "0.54") + require.NoError(fs.Set(cli.FlagCommissionRate, "0.54")) }, expectedCfg: mkTxValCfg(cli.DefaultTokens.String()+sdk.DefaultBondDenom, "0.54", "0.2", "0.01", "1"), }, { name: "Custom commission max rate", fsModify: func(fs *pflag.FlagSet) { - fs.Set(cli.FlagCommissionMaxRate, "0.89") + require.NoError(fs.Set(cli.FlagCommissionMaxRate, "0.89")) }, expectedCfg: mkTxValCfg(cli.DefaultTokens.String()+sdk.DefaultBondDenom, "0.1", "0.89", "0.01", "1"), }, { name: "Custom commission max change rate", fsModify: func(fs *pflag.FlagSet) { - fs.Set(cli.FlagCommissionMaxChangeRate, "0.55") + require.NoError(fs.Set(cli.FlagCommissionMaxChangeRate, "0.55")) }, expectedCfg: mkTxValCfg(cli.DefaultTokens.String()+sdk.DefaultBondDenom, "0.1", "0.2", "0.55", "1"), }, { name: "Custom min self delegations", fsModify: func(fs *pflag.FlagSet) { - fs.Set(cli.FlagMinSelfDelegation, "0.33") + require.NoError(fs.Set(cli.FlagMinSelfDelegation, "0.33")) }, expectedCfg: mkTxValCfg(cli.DefaultTokens.String()+sdk.DefaultBondDenom, "0.1", "0.2", "0.01", "0.33"), }, @@ -150,16 +153,16 @@ func (s *CLITestSuite) TestPrepareConfigForTxCreateValidator() { tc.fsModify(fs) cvCfg, err := cli.PrepareConfigForTxCreateValidator(fs, moniker, nodeID, chainID, valPubKey) - require.NoError(s.T(), err) + require.NoError(err) - require.Equal(s.T(), tc.expectedCfg, cvCfg) + require.Equal(tc.expectedCfg, cvCfg) }) } } func (s *CLITestSuite) TestNewCreateValidatorCmd() { require := s.Require() - cmd := cli.NewCreateValidatorCmd() + cmd := cli.NewCreateValidatorCmd(addresscodec.NewBech32Codec("cosmosvaloper")) validJSON := fmt.Sprintf(` { @@ -239,7 +242,7 @@ func (s *CLITestSuite) TestNewCreateValidatorCmd() { fmt.Sprintf("--%s=%s", flags.FlagFrom, s.addrs[0]), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(10))).String()), }, "must specify amount of coins to bond", }, @@ -250,7 +253,7 @@ func (s *CLITestSuite) TestNewCreateValidatorCmd() { fmt.Sprintf("--%s=%s", flags.FlagFrom, s.addrs[0]), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(10))).String()), }, "must specify the JSON encoded pubkey", }, @@ -261,7 +264,7 @@ func (s *CLITestSuite) TestNewCreateValidatorCmd() { fmt.Sprintf("--%s=%s", flags.FlagFrom, s.addrs[0]), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(10))).String()), }, "must specify the moniker name", }, @@ -272,7 +275,7 @@ func (s *CLITestSuite) TestNewCreateValidatorCmd() { fmt.Sprintf("--%s=%s", flags.FlagFrom, s.addrs[0]), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(10))).String()), }, "", }, @@ -283,7 +286,7 @@ func (s *CLITestSuite) TestNewCreateValidatorCmd() { fmt.Sprintf("--%s=%s", flags.FlagFrom, s.addrs[0]), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(10))).String()), }, "", }, @@ -306,7 +309,7 @@ func (s *CLITestSuite) TestNewCreateValidatorCmd() { } func (s *CLITestSuite) TestNewEditValidatorCmd() { - cmd := cli.NewEditValidatorCmd() + cmd := cli.NewEditValidatorCmd(addresscodec.NewBech32Codec("cosmos")) moniker := "testing" details := "bio" @@ -325,7 +328,7 @@ func (s *CLITestSuite) TestNewEditValidatorCmd() { fmt.Sprintf("--%s=%s", flags.FlagFrom, "with wrong from address"), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(10))).String()), }, "key not found", }, @@ -335,7 +338,7 @@ func (s *CLITestSuite) TestNewEditValidatorCmd() { fmt.Sprintf("--%s=%s", flags.FlagFrom, s.addrs[0]), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(10))).String()), }, "", }, @@ -346,7 +349,7 @@ func (s *CLITestSuite) TestNewEditValidatorCmd() { fmt.Sprintf("--%s=%s", flags.FlagFrom, s.addrs[0]), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(10))).String()), }, "", }, @@ -357,7 +360,7 @@ func (s *CLITestSuite) TestNewEditValidatorCmd() { fmt.Sprintf("--%s=%s", flags.FlagFrom, s.addrs[0]), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(10))).String()), }, "", }, @@ -368,7 +371,7 @@ func (s *CLITestSuite) TestNewEditValidatorCmd() { fmt.Sprintf("--%s=%s", flags.FlagFrom, s.addrs[0]), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(10))).String()), }, "", }, @@ -379,7 +382,7 @@ func (s *CLITestSuite) TestNewEditValidatorCmd() { fmt.Sprintf("--%s=%s", flags.FlagFrom, s.addrs[0]), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(10))).String()), }, "", }, @@ -390,7 +393,7 @@ func (s *CLITestSuite) TestNewEditValidatorCmd() { fmt.Sprintf("--%s=%s", flags.FlagFrom, s.addrs[0]), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(10))).String()), }, "", }, @@ -405,7 +408,7 @@ func (s *CLITestSuite) TestNewEditValidatorCmd() { fmt.Sprintf("--%s=%s", flags.FlagFrom, s.addrs[0]), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(10))).String()), }, "", }, @@ -429,7 +432,7 @@ func (s *CLITestSuite) TestNewEditValidatorCmd() { } func (s *CLITestSuite) TestNewDelegateCmd() { - cmd := cli.NewDelegateCmd() + cmd := cli.NewDelegateCmd(addresscodec.NewBech32Codec("cosmosvaloper"), addresscodec.NewBech32Codec("cosmos")) testCases := []struct { name string @@ -444,7 +447,7 @@ func (s *CLITestSuite) TestNewDelegateCmd() { fmt.Sprintf("--%s=%s", flags.FlagFrom, s.addrs[0]), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(10))).String()), }, "invalid decimal coin expression: fooCoin", }, @@ -452,11 +455,11 @@ func (s *CLITestSuite) TestNewDelegateCmd() { "invalid validator address", []string{ "abc", - sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(150)).String(), + sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(150)).String(), fmt.Sprintf("--%s=%s", flags.FlagFrom, s.addrs[0]), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(10))).String()), }, "decoding bech32 failed", }, @@ -464,11 +467,11 @@ func (s *CLITestSuite) TestNewDelegateCmd() { "valid transaction of delegate", []string{ sdk.ValAddress(s.addrs[0]).String(), - sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(150)).String(), + sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(150)).String(), fmt.Sprintf("--%s=%s", flags.FlagFrom, s.addrs[0]), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(10))).String()), }, "", }, @@ -492,7 +495,7 @@ func (s *CLITestSuite) TestNewDelegateCmd() { } func (s *CLITestSuite) TestNewRedelegateCmd() { - cmd := cli.NewRedelegateCmd() + cmd := cli.NewRedelegateCmd(addresscodec.NewBech32Codec("cosmosvaloper"), addresscodec.NewBech32Codec("cosmos")) testCases := []struct { name string @@ -508,7 +511,7 @@ func (s *CLITestSuite) TestNewRedelegateCmd() { fmt.Sprintf("--%s=%s", flags.FlagFrom, s.addrs[0]), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(10))).String()), }, "invalid decimal coin expression: fooCoin", }, @@ -517,12 +520,12 @@ func (s *CLITestSuite) TestNewRedelegateCmd() { []string{ "invalid", // wrong src-validator-addr sdk.ValAddress(s.addrs[1]).String(), // dst-validator-addr - sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(150)).String(), // amount + sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(150)).String(), // amount fmt.Sprintf("--%s=%s", flags.FlagFrom, s.addrs[0]), fmt.Sprintf("--%s=%d", flags.FlagGas, 300000), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(10))).String()), }, "invalid bech32", }, @@ -531,26 +534,26 @@ func (s *CLITestSuite) TestNewRedelegateCmd() { []string{ sdk.ValAddress(s.addrs[0]).String(), // src-validator-addr "invalid", // wrong dst-validator-addr - sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(150)).String(), // amount + sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(150)).String(), // amount fmt.Sprintf("--%s=%s", flags.FlagFrom, s.addrs[0]), fmt.Sprintf("--%s=%d", flags.FlagGas, 300000), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(10))).String()), }, "invalid bech32", }, { "valid transaction of delegate", []string{ - sdk.ValAddress(s.addrs[0]).String(), // src-validator-addr - sdk.ValAddress(s.addrs[1]).String(), // dst-validator-addr - sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(150)).String(), // amount + sdk.ValAddress(s.addrs[0]).String(), // src-validator-addr + sdk.ValAddress(s.addrs[1]).String(), // dst-validator-addr + sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(150)).String(), // amount fmt.Sprintf("--%s=%s", flags.FlagFrom, s.addrs[0]), fmt.Sprintf("--%s=%d", flags.FlagGas, 300000), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(10))).String()), }, "", }, @@ -574,7 +577,7 @@ func (s *CLITestSuite) TestNewRedelegateCmd() { } func (s *CLITestSuite) TestNewUnbondCmd() { - cmd := cli.NewUnbondCmd() + cmd := cli.NewUnbondCmd(addresscodec.NewBech32Codec("cosmosvaloper"), addresscodec.NewBech32Codec("cosmos")) testCases := []struct { name string @@ -589,7 +592,7 @@ func (s *CLITestSuite) TestNewUnbondCmd() { fmt.Sprintf("--%s=%s", flags.FlagFrom, s.addrs[0]), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(10))).String()), }, "invalid decimal coin expression: foo", }, @@ -597,11 +600,11 @@ func (s *CLITestSuite) TestNewUnbondCmd() { "invalid validator address", []string{ "foo", - sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(150)).String(), + sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(150)).String(), fmt.Sprintf("--%s=%s", flags.FlagFrom, s.addrs[0]), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(10))).String()), }, "decoding bech32 failed", }, @@ -609,11 +612,11 @@ func (s *CLITestSuite) TestNewUnbondCmd() { "valid transaction of unbond", []string{ sdk.ValAddress(s.addrs[0]).String(), - sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(150)).String(), + sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(150)).String(), fmt.Sprintf("--%s=%s", flags.FlagFrom, s.addrs[0]), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(10))).String()), }, "", }, @@ -637,7 +640,7 @@ func (s *CLITestSuite) TestNewUnbondCmd() { } func (s *CLITestSuite) TestNewCancelUnbondingDelegationCmd() { - cmd := cli.NewCancelUnbondingDelegation() + cmd := cli.NewCancelUnbondingDelegation(addresscodec.NewBech32Codec("cosmosvaloper"), addresscodec.NewBech32Codec("cosmos")) testCases := []struct { name string @@ -648,12 +651,12 @@ func (s *CLITestSuite) TestNewCancelUnbondingDelegationCmd() { "invalid validator address", []string{ "foo", - sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(150)).String(), - sdk.NewInt(10000).String(), + sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(150)).String(), + sdkmath.NewInt(10000).String(), fmt.Sprintf("--%s=%s", flags.FlagFrom, s.addrs[0]), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(10))).String()), }, "decoding bech32 failed", }, @@ -662,11 +665,11 @@ func (s *CLITestSuite) TestNewCancelUnbondingDelegationCmd() { []string{ sdk.ValAddress(s.addrs[0]).String(), "fooCoin", - sdk.NewInt(10000).String(), + sdkmath.NewInt(10000).String(), fmt.Sprintf("--%s=%s", flags.FlagFrom, s.addrs[0]), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(10))).String()), }, "invalid decimal coin expression", }, @@ -674,12 +677,12 @@ func (s *CLITestSuite) TestNewCancelUnbondingDelegationCmd() { "without unbond creation height", []string{ sdk.ValAddress(s.addrs[0]).String(), - sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(150)).String(), + sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(150)).String(), "abc", fmt.Sprintf("--%s=%s", flags.FlagFrom, s.addrs[0]), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(10))).String()), }, "invalid height: invalid height: 0", }, @@ -687,12 +690,12 @@ func (s *CLITestSuite) TestNewCancelUnbondingDelegationCmd() { "valid transaction of canceling unbonding delegation", []string{ sdk.ValAddress(s.addrs[0]).String(), - sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(5)).String(), - sdk.NewInt(10000).String(), + sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(5)).String(), + sdkmath.NewInt(10000).String(), fmt.Sprintf("--%s=%s", flags.FlagFrom, s.addrs[0]), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(10))).String()), }, "", }, diff --git a/x/staking/genesis.go b/x/staking/genesis.go index 7e2cf1efe04a..1d4cd64e4bba 100644 --- a/x/staking/genesis.go +++ b/x/staking/genesis.go @@ -13,7 +13,7 @@ import ( // WriteValidators returns a slice of bonded genesis validators. func WriteValidators(ctx sdk.Context, keeper *keeper.Keeper) (vals []cmttypes.GenesisValidator, returnErr error) { - keeper.IterateLastValidators(ctx, func(_ int64, validator types.ValidatorI) (stop bool) { + err := keeper.IterateLastValidators(ctx, func(_ int64, validator types.ValidatorI) (stop bool) { pk, err := validator.ConsPubKey() if err != nil { returnErr = err @@ -34,6 +34,9 @@ func WriteValidators(ctx sdk.Context, keeper *keeper.Keeper) (vals []cmttypes.Ge return false }) + if err != nil { + return nil, err + } return } diff --git a/x/staking/genesis_test.go b/x/staking/genesis_test.go index 8e33db0e3717..93419809d843 100644 --- a/x/staking/genesis_test.go +++ b/x/staking/genesis_test.go @@ -3,9 +3,10 @@ package staking_test import ( "testing" - "cosmossdk.io/math" "github.com/stretchr/testify/assert" + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking" diff --git a/x/staking/keeper/abci.go b/x/staking/keeper/abci.go index fcb65377eba8..8131fa6dd16f 100644 --- a/x/staking/keeper/abci.go +++ b/x/staking/keeper/abci.go @@ -2,25 +2,22 @@ package keeper import ( "context" - "time" abci "github.com/cometbft/cometbft/abci/types" + "github.com/cosmos/cosmos-sdk/telemetry" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/types" ) // BeginBlocker will persist the current header and validator set as a historical entry // and prune the oldest entry based on the HistoricalEntries parameter -func (k *Keeper) BeginBlocker(ctx sdk.Context) { - defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) - - k.TrackHistoricalInfo(ctx) +func (k *Keeper) BeginBlocker(ctx context.Context) error { + defer telemetry.ModuleMeasureSince(types.ModuleName, telemetry.Now(), telemetry.MetricKeyBeginBlocker) + return k.TrackHistoricalInfo(ctx) } -// Called every block, update validator set +// EndBlocker called at every block, update validator set func (k *Keeper) EndBlocker(ctx context.Context) ([]abci.ValidatorUpdate, error) { - defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyEndBlocker) - - return k.BlockValidatorUpdates(sdk.UnwrapSDKContext(ctx)), nil + defer telemetry.ModuleMeasureSince(types.ModuleName, telemetry.Now(), telemetry.MetricKeyEndBlocker) + return k.BlockValidatorUpdates(ctx) } diff --git a/x/staking/keeper/alias_functions.go b/x/staking/keeper/alias_functions.go index 8660d7735d9d..4379043cc6d6 100644 --- a/x/staking/keeper/alias_functions.go +++ b/x/staking/keeper/alias_functions.go @@ -1,7 +1,7 @@ package keeper import ( - "fmt" + "context" storetypes "cosmossdk.io/store/types" @@ -11,17 +11,22 @@ import ( // Validator Set -// iterate through the validator set and perform the provided function -func (k Keeper) IterateValidators(ctx sdk.Context, fn func(index int64, validator types.ValidatorI) (stop bool)) { - store := ctx.KVStore(k.storeKey) - - iterator := storetypes.KVStorePrefixIterator(store, types.ValidatorsKey) +// IterateValidators iterates through the validator set and perform the provided function +func (k Keeper) IterateValidators(ctx context.Context, fn func(index int64, validator types.ValidatorI) (stop bool)) error { + store := k.storeService.OpenKVStore(ctx) + iterator, err := store.Iterator(types.ValidatorsKey, storetypes.PrefixEndBytes(types.ValidatorsKey)) + if err != nil { + return err + } defer iterator.Close() i := int64(0) for ; iterator.Valid(); iterator.Next() { - validator := types.MustUnmarshalValidator(k.cdc, iterator.Value()) + validator, err := types.UnmarshalValidator(k.cdc, iterator.Value()) + if err != nil { + return err + } stop := fn(i, validator) // XXX is this safe will the validator unexposed fields be able to get written to? if stop { @@ -29,14 +34,22 @@ func (k Keeper) IterateValidators(ctx sdk.Context, fn func(index int64, validato } i++ } + + return nil } -// iterate through the bonded validator set and perform the provided function -func (k Keeper) IterateBondedValidatorsByPower(ctx sdk.Context, fn func(index int64, validator types.ValidatorI) (stop bool)) { - store := ctx.KVStore(k.storeKey) - maxValidators := k.MaxValidators(ctx) +// IterateBondedValidatorsByPower iterates through the bonded validator set and perform the provided function +func (k Keeper) IterateBondedValidatorsByPower(ctx context.Context, fn func(index int64, validator types.ValidatorI) (stop bool)) error { + store := k.storeService.OpenKVStore(ctx) + maxValidators, err := k.MaxValidators(ctx) + if err != nil { + return err + } - iterator := storetypes.KVStoreReversePrefixIterator(store, types.ValidatorsByPowerIndexKey) + iterator, err := store.ReverseIterator(types.ValidatorsByPowerIndexKey, storetypes.PrefixEndBytes(types.ValidatorsByPowerIndexKey)) + if err != nil { + return err + } defer iterator.Close() i := int64(0) @@ -52,11 +65,16 @@ func (k Keeper) IterateBondedValidatorsByPower(ctx sdk.Context, fn func(index in i++ } } + + return nil } -// iterate through the active validator set and perform the provided function -func (k Keeper) IterateLastValidators(ctx sdk.Context, fn func(index int64, validator types.ValidatorI) (stop bool)) { - iterator := k.LastValidatorsIterator(ctx) +// IterateLastValidators iterates through the active validator set and perform the provided function +func (k Keeper) IterateLastValidators(ctx context.Context, fn func(index int64, validator types.ValidatorI) (stop bool)) error { + iterator, err := k.LastValidatorsIterator(ctx) + if err != nil { + return err + } defer iterator.Close() i := int64(0) @@ -64,9 +82,9 @@ func (k Keeper) IterateLastValidators(ctx sdk.Context, fn func(index int64, vali for ; iterator.Valid(); iterator.Next() { address := types.AddressFromLastValidatorPowerKey(iterator.Key()) - validator, found := k.GetValidator(ctx, address) - if !found { - panic(fmt.Sprintf("validator record not found for address: %v\n", address)) + validator, err := k.GetValidator(ctx, address) + if err != nil { + return err } stop := fn(i, validator) // XXX is this safe will the validator unexposed fields be able to get written to? @@ -75,57 +93,53 @@ func (k Keeper) IterateLastValidators(ctx sdk.Context, fn func(index int64, vali } i++ } + return nil } // Validator gets the Validator interface for a particular address -func (k Keeper) Validator(ctx sdk.Context, address sdk.ValAddress) types.ValidatorI { - val, found := k.GetValidator(ctx, address) - if !found { - return nil - } - - return val +func (k Keeper) Validator(ctx context.Context, address sdk.ValAddress) (types.ValidatorI, error) { + return k.GetValidator(ctx, address) } // ValidatorByConsAddr gets the validator interface for a particular pubkey -func (k Keeper) ValidatorByConsAddr(ctx sdk.Context, addr sdk.ConsAddress) types.ValidatorI { - val, found := k.GetValidatorByConsAddr(ctx, addr) - if !found { - return nil - } - - return val +func (k Keeper) ValidatorByConsAddr(ctx context.Context, addr sdk.ConsAddress) (types.ValidatorI, error) { + return k.GetValidatorByConsAddr(ctx, addr) } // Delegation Set -// Returns self as it is both a validatorset and delegationset +// GetValidatorSet returns self as it is both a validatorset and delegationset func (k Keeper) GetValidatorSet() types.ValidatorSet { return k } -// Delegation get the delegation interface for a particular set of delegator and validator addresses -func (k Keeper) Delegation(ctx sdk.Context, addrDel sdk.AccAddress, addrVal sdk.ValAddress) types.DelegationI { - bond, ok := k.GetDelegation(ctx, addrDel, addrVal) - if !ok { - return nil +// Delegation gets the delegation interface for a particular set of delegator and validator addresses +func (k Keeper) Delegation(ctx context.Context, addrDel sdk.AccAddress, addrVal sdk.ValAddress) (types.DelegationI, error) { + bond, err := k.GetDelegation(ctx, addrDel, addrVal) + if err != nil { + return nil, err } - return bond + return bond, nil } -// iterate through all of the delegations from a delegator -func (k Keeper) IterateDelegations(ctx sdk.Context, delAddr sdk.AccAddress, +// IterateDelegations iterates through all of the delegations from a delegator +func (k Keeper) IterateDelegations(ctx context.Context, delAddr sdk.AccAddress, fn func(index int64, del types.DelegationI) (stop bool), -) { - store := ctx.KVStore(k.storeKey) +) error { + store := k.storeService.OpenKVStore(ctx) delegatorPrefixKey := types.GetDelegationsKey(delAddr) - - iterator := storetypes.KVStorePrefixIterator(store, delegatorPrefixKey) // smallest to largest + iterator, err := store.Iterator(delegatorPrefixKey, storetypes.PrefixEndBytes(delegatorPrefixKey)) + if err != nil { + return err + } defer iterator.Close() for i := int64(0); iterator.Valid(); iterator.Next() { - del := types.MustUnmarshalDelegation(k.cdc, iterator.Value()) + del, err := types.UnmarshalDelegation(k.cdc, iterator.Value()) + if err != nil { + return err + } stop := fn(i, del) if stop { @@ -133,18 +147,25 @@ func (k Keeper) IterateDelegations(ctx sdk.Context, delAddr sdk.AccAddress, } i++ } + + return nil } -// return all delegations used during genesis dump +// GetAllSDKDelegations returns all delegations used during genesis dump // TODO: remove this func, change all usage for iterate functionality -func (k Keeper) GetAllSDKDelegations(ctx sdk.Context) (delegations []types.Delegation) { - store := ctx.KVStore(k.storeKey) - - iterator := storetypes.KVStorePrefixIterator(store, types.DelegationKey) +func (k Keeper) GetAllSDKDelegations(ctx context.Context) (delegations []types.Delegation, err error) { + store := k.storeService.OpenKVStore(ctx) + iterator, err := store.Iterator(types.DelegationKey, storetypes.PrefixEndBytes(types.DelegationKey)) + if err != nil { + return delegations, err + } defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - delegation := types.MustUnmarshalDelegation(k.cdc, iterator.Value()) + delegation, err := types.UnmarshalDelegation(k.cdc, iterator.Value()) + if err != nil { + return delegations, err + } delegations = append(delegations, delegation) } diff --git a/x/staking/keeper/delegation.go b/x/staking/keeper/delegation.go index 0047ef5414b6..662d72b8157e 100644 --- a/x/staking/keeper/delegation.go +++ b/x/staking/keeper/delegation.go @@ -2,39 +2,45 @@ package keeper import ( "bytes" + "context" + "errors" "fmt" "time" + corestore "cosmossdk.io/core/store" + errorsmod "cosmossdk.io/errors" "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" - errorsmod "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/staking/types" ) // GetDelegation returns a specific delegation. -func (k Keeper) GetDelegation(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (delegation types.Delegation, found bool) { - store := ctx.KVStore(k.storeKey) +func (k Keeper) GetDelegation(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (types.Delegation, error) { + store := k.storeService.OpenKVStore(ctx) key := types.GetDelegationKey(delAddr, valAddr) - value := store.Get(key) - if value == nil { - return delegation, false + value, err := store.Get(key) + if err != nil { + return types.Delegation{}, err } - delegation = types.MustUnmarshalDelegation(k.cdc, value) + if value == nil { + return types.Delegation{}, types.ErrNoDelegation + } - return delegation, true + return types.UnmarshalDelegation(k.cdc, value) } // IterateAllDelegations iterates through all of the delegations. -func (k Keeper) IterateAllDelegations(ctx sdk.Context, cb func(delegation types.Delegation) (stop bool)) { - store := ctx.KVStore(k.storeKey) - - iterator := storetypes.KVStorePrefixIterator(store, types.DelegationKey) +func (k Keeper) IterateAllDelegations(ctx context.Context, cb func(delegation types.Delegation) (stop bool)) error { + store := k.storeService.OpenKVStore(ctx) + iterator, err := store.Iterator(types.DelegationKey, storetypes.PrefixEndBytes(types.DelegationKey)) + if err != nil { + return err + } defer iterator.Close() for ; iterator.Valid(); iterator.Next() { @@ -43,318 +49,418 @@ func (k Keeper) IterateAllDelegations(ctx sdk.Context, cb func(delegation types. break } } + + return nil } // GetAllDelegations returns all delegations used during genesis dump. -func (k Keeper) GetAllDelegations(ctx sdk.Context) (delegations []types.Delegation) { - k.IterateAllDelegations(ctx, func(delegation types.Delegation) bool { +func (k Keeper) GetAllDelegations(ctx context.Context) (delegations []types.Delegation, err error) { + err = k.IterateAllDelegations(ctx, func(delegation types.Delegation) bool { delegations = append(delegations, delegation) return false }) - return delegations + return delegations, err } // GetValidatorDelegations returns all delegations to a specific validator. // Useful for querier. -func (k Keeper) GetValidatorDelegations(ctx sdk.Context, valAddr sdk.ValAddress) (delegations []types.Delegation) { - store := ctx.KVStore(k.storeKey) - - iterator := storetypes.KVStorePrefixIterator(store, types.GetDelegationsByValPrefixKey(valAddr)) +func (k Keeper) GetValidatorDelegations(ctx context.Context, valAddr sdk.ValAddress) (delegations []types.Delegation, err error) { + store := k.storeService.OpenKVStore(ctx) + prefix := types.GetDelegationsByValPrefixKey(valAddr) + iterator, err := store.Iterator(prefix, storetypes.PrefixEndBytes(prefix)) + if err != nil { + return delegations, err + } defer iterator.Close() for ; iterator.Valid(); iterator.Next() { var delegation types.Delegation valAddr, delAddr, err := types.ParseDelegationsByValKey(iterator.Key()) if err != nil { - panic(err) + return delegations, err + } + + bz, err := store.Get(types.GetDelegationKey(delAddr, valAddr)) + if err != nil { + return delegations, err } - bz := store.Get(types.GetDelegationKey(delAddr, valAddr)) if err := k.cdc.Unmarshal(bz, &delegation); err != nil { - panic(err) + return delegations, err } delegations = append(delegations, delegation) } - return delegations + return delegations, nil } // GetDelegatorDelegations returns a given amount of all the delegations from a // delegator. -func (k Keeper) GetDelegatorDelegations(ctx sdk.Context, delegator sdk.AccAddress, maxRetrieve uint16) (delegations []types.Delegation) { +func (k Keeper) GetDelegatorDelegations(ctx context.Context, delegator sdk.AccAddress, maxRetrieve uint16) (delegations []types.Delegation, err error) { delegations = make([]types.Delegation, maxRetrieve) - store := ctx.KVStore(k.storeKey) + store := k.storeService.OpenKVStore(ctx) delegatorPrefixKey := types.GetDelegationsKey(delegator) - iterator := storetypes.KVStorePrefixIterator(store, delegatorPrefixKey) + iterator, err := store.Iterator(delegatorPrefixKey, storetypes.PrefixEndBytes(delegatorPrefixKey)) + if err != nil { + return delegations, err + } defer iterator.Close() i := 0 for ; iterator.Valid() && i < int(maxRetrieve); iterator.Next() { - delegation := types.MustUnmarshalDelegation(k.cdc, iterator.Value()) + delegation, err := types.UnmarshalDelegation(k.cdc, iterator.Value()) + if err != nil { + return delegations, err + } delegations[i] = delegation i++ } - return delegations[:i] // trim if the array length < maxRetrieve + return delegations[:i], nil // trim if the array length < maxRetrieve } // SetDelegation sets a delegation. -func (k Keeper) SetDelegation(ctx sdk.Context, delegation types.Delegation) { +func (k Keeper) SetDelegation(ctx context.Context, delegation types.Delegation) error { delegatorAddress, err := k.authKeeper.AddressCodec().StringToBytes(delegation.DelegatorAddress) if err != nil { - panic(err) + return err + } + + valAddr, err := k.validatorAddressCodec.StringToBytes(delegation.GetValidatorAddr()) + if err != nil { + return err } - store := ctx.KVStore(k.storeKey) + store := k.storeService.OpenKVStore(ctx) b := types.MustMarshalDelegation(k.cdc, delegation) - store.Set(types.GetDelegationKey(delegatorAddress, delegation.GetValidatorAddr()), b) + err = store.Set(types.GetDelegationKey(delegatorAddress, valAddr), b) + if err != nil { + return err + } // set the delegation in validator delegator index - store.Set(types.GetDelegationsByValKey(delegation.GetValidatorAddr(), delegatorAddress), []byte{}) + return store.Set(types.GetDelegationsByValKey(valAddr, delegatorAddress), []byte{}) } // RemoveDelegation removes a delegation -func (k Keeper) RemoveDelegation(ctx sdk.Context, delegation types.Delegation) error { +func (k Keeper) RemoveDelegation(ctx context.Context, delegation types.Delegation) error { delegatorAddress, err := k.authKeeper.AddressCodec().StringToBytes(delegation.DelegatorAddress) if err != nil { - panic(err) + return err + } + + valAddr, err := k.validatorAddressCodec.StringToBytes(delegation.GetValidatorAddr()) + if err != nil { + return err } // TODO: Consider calling hooks outside of the store wrapper functions, it's unobvious. - if err := k.Hooks().BeforeDelegationRemoved(ctx, delegatorAddress, delegation.GetValidatorAddr()); err != nil { + if err := k.Hooks().BeforeDelegationRemoved(ctx, delegatorAddress, valAddr); err != nil { return err } - store := ctx.KVStore(k.storeKey) - store.Delete(types.GetDelegationKey(delegatorAddress, delegation.GetValidatorAddr())) - store.Delete(types.GetDelegationsByValKey(delegation.GetValidatorAddr(), delegatorAddress)) + store := k.storeService.OpenKVStore(ctx) + err = store.Delete(types.GetDelegationKey(delegatorAddress, valAddr)) + if err != nil { + return err + } - return nil + return store.Delete(types.GetDelegationsByValKey(valAddr, delegatorAddress)) } // GetUnbondingDelegations returns a given amount of all the delegator unbonding-delegations. -func (k Keeper) GetUnbondingDelegations(ctx sdk.Context, delegator sdk.AccAddress, maxRetrieve uint16) (unbondingDelegations []types.UnbondingDelegation) { +func (k Keeper) GetUnbondingDelegations(ctx context.Context, delegator sdk.AccAddress, maxRetrieve uint16) (unbondingDelegations []types.UnbondingDelegation, err error) { unbondingDelegations = make([]types.UnbondingDelegation, maxRetrieve) - store := ctx.KVStore(k.storeKey) + store := k.storeService.OpenKVStore(ctx) delegatorPrefixKey := types.GetUBDsKey(delegator) - iterator := storetypes.KVStorePrefixIterator(store, delegatorPrefixKey) + iterator, err := store.Iterator(delegatorPrefixKey, storetypes.PrefixEndBytes(delegatorPrefixKey)) + if err != nil { + return unbondingDelegations, err + } defer iterator.Close() i := 0 for ; iterator.Valid() && i < int(maxRetrieve); iterator.Next() { - unbondingDelegation := types.MustUnmarshalUBD(k.cdc, iterator.Value()) + unbondingDelegation, err := types.UnmarshalUBD(k.cdc, iterator.Value()) + if err != nil { + return unbondingDelegations, err + } unbondingDelegations[i] = unbondingDelegation i++ } - return unbondingDelegations[:i] // trim if the array length < maxRetrieve + return unbondingDelegations[:i], nil // trim if the array length < maxRetrieve } // GetUnbondingDelegation returns a unbonding delegation. -func (k Keeper) GetUnbondingDelegation(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (ubd types.UnbondingDelegation, found bool) { - store := ctx.KVStore(k.storeKey) +func (k Keeper) GetUnbondingDelegation(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (ubd types.UnbondingDelegation, err error) { + store := k.storeService.OpenKVStore(ctx) key := types.GetUBDKey(delAddr, valAddr) - value := store.Get(key) + value, err := store.Get(key) + if err != nil { + return ubd, err + } if value == nil { - return ubd, false + return ubd, types.ErrNoUnbondingDelegation } - ubd = types.MustUnmarshalUBD(k.cdc, value) - - return ubd, true + return types.UnmarshalUBD(k.cdc, value) } // GetUnbondingDelegationsFromValidator returns all unbonding delegations from a // particular validator. -func (k Keeper) GetUnbondingDelegationsFromValidator(ctx sdk.Context, valAddr sdk.ValAddress) (ubds []types.UnbondingDelegation) { - store := ctx.KVStore(k.storeKey) - - iterator := storetypes.KVStorePrefixIterator(store, types.GetUBDsByValIndexKey(valAddr)) +func (k Keeper) GetUnbondingDelegationsFromValidator(ctx context.Context, valAddr sdk.ValAddress) (ubds []types.UnbondingDelegation, err error) { + store := k.storeService.OpenKVStore(ctx) + prefix := types.GetUBDsByValIndexKey(valAddr) + iterator, err := store.Iterator(prefix, storetypes.PrefixEndBytes(prefix)) + if err != nil { + return ubds, err + } defer iterator.Close() for ; iterator.Valid(); iterator.Next() { key := types.GetUBDKeyFromValIndexKey(iterator.Key()) - value := store.Get(key) - ubd := types.MustUnmarshalUBD(k.cdc, value) + value, err := store.Get(key) + if err != nil { + return ubds, err + } + ubd, err := types.UnmarshalUBD(k.cdc, value) + if err != nil { + return ubds, err + } ubds = append(ubds, ubd) } - return ubds + return ubds, nil } // IterateUnbondingDelegations iterates through all of the unbonding delegations. -func (k Keeper) IterateUnbondingDelegations(ctx sdk.Context, fn func(index int64, ubd types.UnbondingDelegation) (stop bool)) { - store := ctx.KVStore(k.storeKey) - - iterator := storetypes.KVStorePrefixIterator(store, types.UnbondingDelegationKey) +func (k Keeper) IterateUnbondingDelegations(ctx context.Context, fn func(index int64, ubd types.UnbondingDelegation) (stop bool)) error { + store := k.storeService.OpenKVStore(ctx) + prefix := types.UnbondingDelegationKey + iterator, err := store.Iterator(prefix, storetypes.PrefixEndBytes(prefix)) + if err != nil { + return err + } defer iterator.Close() for i := int64(0); iterator.Valid(); iterator.Next() { - ubd := types.MustUnmarshalUBD(k.cdc, iterator.Value()) + ubd, err := types.UnmarshalUBD(k.cdc, iterator.Value()) + if err != nil { + return err + } if stop := fn(i, ubd); stop { break } i++ } + + return nil } // GetDelegatorUnbonding returns the total amount a delegator has unbonding. -func (k Keeper) GetDelegatorUnbonding(ctx sdk.Context, delegator sdk.AccAddress) math.Int { +func (k Keeper) GetDelegatorUnbonding(ctx context.Context, delegator sdk.AccAddress) (math.Int, error) { unbonding := math.ZeroInt() - k.IterateDelegatorUnbondingDelegations(ctx, delegator, func(ubd types.UnbondingDelegation) bool { + err := k.IterateDelegatorUnbondingDelegations(ctx, delegator, func(ubd types.UnbondingDelegation) bool { for _, entry := range ubd.Entries { unbonding = unbonding.Add(entry.Balance) } return false }) - return unbonding + if err != nil { + return unbonding, err + } + + return unbonding, nil } // IterateDelegatorUnbondingDelegations iterates through a delegator's unbonding delegations. -func (k Keeper) IterateDelegatorUnbondingDelegations(ctx sdk.Context, delegator sdk.AccAddress, cb func(ubd types.UnbondingDelegation) (stop bool)) { - store := ctx.KVStore(k.storeKey) - - iterator := storetypes.KVStorePrefixIterator(store, types.GetUBDsKey(delegator)) +func (k Keeper) IterateDelegatorUnbondingDelegations(ctx context.Context, delegator sdk.AccAddress, cb func(ubd types.UnbondingDelegation) (stop bool)) error { + store := k.storeService.OpenKVStore(ctx) + prefix := types.GetUBDsKey(delegator) + iterator, err := store.Iterator(prefix, storetypes.PrefixEndBytes(prefix)) + if err != nil { + return err + } defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - ubd := types.MustUnmarshalUBD(k.cdc, iterator.Value()) + ubd, err := types.UnmarshalUBD(k.cdc, iterator.Value()) + if err != nil { + return err + } if cb(ubd) { break } } + + return nil } // GetDelegatorBonded returs the total amount a delegator has bonded. -func (k Keeper) GetDelegatorBonded(ctx sdk.Context, delegator sdk.AccAddress) math.Int { +func (k Keeper) GetDelegatorBonded(ctx context.Context, delegator sdk.AccAddress) (math.Int, error) { bonded := math.LegacyZeroDec() - k.IterateDelegatorDelegations(ctx, delegator, func(delegation types.Delegation) bool { - validatorAddr, err := sdk.ValAddressFromBech32(delegation.ValidatorAddress) + err := k.IterateDelegatorDelegations(ctx, delegator, func(delegation types.Delegation) bool { + validatorAddr, err := k.validatorAddressCodec.StringToBytes(delegation.ValidatorAddress) if err != nil { panic(err) // shouldn't happen } - validator, found := k.GetValidator(ctx, validatorAddr) - if found { + validator, err := k.GetValidator(ctx, validatorAddr) + if err == nil { shares := delegation.Shares tokens := validator.TokensFromSharesTruncated(shares) bonded = bonded.Add(tokens) } return false }) - return bonded.RoundInt() + return bonded.RoundInt(), err } // IterateDelegatorDelegations iterates through one delegator's delegations. -func (k Keeper) IterateDelegatorDelegations(ctx sdk.Context, delegator sdk.AccAddress, cb func(delegation types.Delegation) (stop bool)) { - store := ctx.KVStore(k.storeKey) - delegatorPrefixKey := types.GetDelegationsKey(delegator) - iterator := storetypes.KVStorePrefixIterator(store, delegatorPrefixKey) +func (k Keeper) IterateDelegatorDelegations(ctx context.Context, delegator sdk.AccAddress, cb func(delegation types.Delegation) (stop bool)) error { + store := k.storeService.OpenKVStore(ctx) + prefix := types.GetDelegationsKey(delegator) + iterator, err := store.Iterator(prefix, storetypes.PrefixEndBytes(prefix)) + if err != nil { + return err + } defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - delegation := types.MustUnmarshalDelegation(k.cdc, iterator.Value()) + delegation, err := types.UnmarshalDelegation(k.cdc, iterator.Value()) + if err != nil { + return err + } if cb(delegation) { break } } + return nil } // IterateDelegatorRedelegations iterates through one delegator's redelegations. -func (k Keeper) IterateDelegatorRedelegations(ctx sdk.Context, delegator sdk.AccAddress, cb func(red types.Redelegation) (stop bool)) { - store := ctx.KVStore(k.storeKey) +func (k Keeper) IterateDelegatorRedelegations(ctx context.Context, delegator sdk.AccAddress, cb func(red types.Redelegation) (stop bool)) error { + store := k.storeService.OpenKVStore(ctx) delegatorPrefixKey := types.GetREDsKey(delegator) - - iterator := storetypes.KVStorePrefixIterator(store, delegatorPrefixKey) - defer iterator.Close() + iterator, err := store.Iterator(delegatorPrefixKey, storetypes.PrefixEndBytes(delegatorPrefixKey)) + if err != nil { + return err + } for ; iterator.Valid(); iterator.Next() { - red := types.MustUnmarshalRED(k.cdc, iterator.Value()) + red, err := types.UnmarshalRED(k.cdc, iterator.Value()) + if err != nil { + return err + } if cb(red) { break } } + return nil } -// HasMaxUnbondingDelegationEntries - check if unbonding delegation has maximum number of entries. -func (k Keeper) HasMaxUnbondingDelegationEntries(ctx sdk.Context, delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress) bool { - ubd, found := k.GetUnbondingDelegation(ctx, delegatorAddr, validatorAddr) - if !found { - return false +// HasMaxUnbondingDelegationEntries checks if unbonding delegation has maximum number of entries. +func (k Keeper) HasMaxUnbondingDelegationEntries(ctx context.Context, delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress) (bool, error) { + ubd, err := k.GetUnbondingDelegation(ctx, delegatorAddr, validatorAddr) + if err != nil && !errors.Is(err, types.ErrNoUnbondingDelegation) { + return false, err } - return len(ubd.Entries) >= int(k.MaxEntries(ctx)) + maxEntries, err := k.MaxEntries(ctx) + if err != nil { + return false, err + } + return len(ubd.Entries) >= int(maxEntries), nil } // SetUnbondingDelegation sets the unbonding delegation and associated index. -func (k Keeper) SetUnbondingDelegation(ctx sdk.Context, ubd types.UnbondingDelegation) { +func (k Keeper) SetUnbondingDelegation(ctx context.Context, ubd types.UnbondingDelegation) error { delAddr, err := k.authKeeper.AddressCodec().StringToBytes(ubd.DelegatorAddress) if err != nil { - panic(err) + return err } - store := ctx.KVStore(k.storeKey) + store := k.storeService.OpenKVStore(ctx) bz := types.MustMarshalUBD(k.cdc, ubd) - valAddr, err := sdk.ValAddressFromBech32(ubd.ValidatorAddress) + valAddr, err := k.validatorAddressCodec.StringToBytes(ubd.ValidatorAddress) if err != nil { - panic(err) + return err } key := types.GetUBDKey(delAddr, valAddr) - store.Set(key, bz) - store.Set(types.GetUBDByValIndexKey(delAddr, valAddr), []byte{}) // index, store empty bytes + err = store.Set(key, bz) + if err != nil { + return err + } + + return store.Set(types.GetUBDByValIndexKey(delAddr, valAddr), []byte{}) // index, store empty bytes } // RemoveUnbondingDelegation removes the unbonding delegation object and associated index. -func (k Keeper) RemoveUnbondingDelegation(ctx sdk.Context, ubd types.UnbondingDelegation) { +func (k Keeper) RemoveUnbondingDelegation(ctx context.Context, ubd types.UnbondingDelegation) error { delegatorAddress, err := k.authKeeper.AddressCodec().StringToBytes(ubd.DelegatorAddress) if err != nil { - panic(err) + return err } - store := ctx.KVStore(k.storeKey) - addr, err := sdk.ValAddressFromBech32(ubd.ValidatorAddress) + store := k.storeService.OpenKVStore(ctx) + addr, err := k.validatorAddressCodec.StringToBytes(ubd.ValidatorAddress) if err != nil { - panic(err) + return err } key := types.GetUBDKey(delegatorAddress, addr) - store.Delete(key) - store.Delete(types.GetUBDByValIndexKey(delegatorAddress, addr)) + err = store.Delete(key) + if err != nil { + return err + } + + return store.Delete(types.GetUBDByValIndexKey(delegatorAddress, addr)) } // SetUnbondingDelegationEntry adds an entry to the unbonding delegation at // the given addresses. It creates the unbonding delegation if it does not exist. func (k Keeper) SetUnbondingDelegationEntry( - ctx sdk.Context, delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress, + ctx context.Context, delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress, creationHeight int64, minTime time.Time, balance math.Int, -) types.UnbondingDelegation { - ubd, found := k.GetUnbondingDelegation(ctx, delegatorAddr, validatorAddr) - id := k.IncrementUnbondingID(ctx) +) (types.UnbondingDelegation, error) { + id, err := k.IncrementUnbondingID(ctx) + if err != nil { + return types.UnbondingDelegation{}, err + } + isNewUbdEntry := true - if found { + ubd, err := k.GetUnbondingDelegation(ctx, delegatorAddr, validatorAddr) + if err == nil { isNewUbdEntry = ubd.AddEntry(creationHeight, minTime, balance, id) + } else if errors.Is(err, types.ErrNoUnbondingDelegation) { + ubd = types.NewUnbondingDelegation(delegatorAddr, validatorAddr, creationHeight, minTime, balance, id, k.validatorAddressCodec, k.authKeeper.AddressCodec()) } else { - ubd = types.NewUnbondingDelegation(delegatorAddr, validatorAddr, creationHeight, minTime, balance, id) + return ubd, err } - k.SetUnbondingDelegation(ctx, ubd) + if err = k.SetUnbondingDelegation(ctx, ubd); err != nil { + return ubd, err + } // only call the hook for new entries since // calls to AfterUnbondingInitiated are not idempotent if isNewUbdEntry { // Add to the UBDByUnbondingOp index to look up the UBD by the UBDE ID - k.SetUnbondingDelegationByUnbondingID(ctx, ubd, id) + if err = k.SetUnbondingDelegationByUnbondingID(ctx, ubd, id); err != nil { + return ubd, err + } if err := k.Hooks().AfterUnbondingInitiated(ctx, id); err != nil { k.Logger(ctx).Error("failed to call after unbonding initiated hook", "error", err) } } - return ubd + return ubd, nil } // unbonding delegation queue timeslice operations @@ -362,232 +468,304 @@ func (k Keeper) SetUnbondingDelegationEntry( // GetUBDQueueTimeSlice gets a specific unbonding queue timeslice. A timeslice // is a slice of DVPairs corresponding to unbonding delegations that expire at a // certain time. -func (k Keeper) GetUBDQueueTimeSlice(ctx sdk.Context, timestamp time.Time) (dvPairs []types.DVPair) { - store := ctx.KVStore(k.storeKey) +func (k Keeper) GetUBDQueueTimeSlice(ctx context.Context, timestamp time.Time) (dvPairs []types.DVPair, err error) { + store := k.storeService.OpenKVStore(ctx) - bz := store.Get(types.GetUnbondingDelegationTimeKey(timestamp)) - if bz == nil { - return []types.DVPair{} + bz, err := store.Get(types.GetUnbondingDelegationTimeKey(timestamp)) + if bz == nil || err != nil { + return []types.DVPair{}, err } pairs := types.DVPairs{} - k.cdc.MustUnmarshal(bz, &pairs) + err = k.cdc.Unmarshal(bz, &pairs) - return pairs.Pairs + return pairs.Pairs, err } // SetUBDQueueTimeSlice sets a specific unbonding queue timeslice. -func (k Keeper) SetUBDQueueTimeSlice(ctx sdk.Context, timestamp time.Time, keys []types.DVPair) { - store := ctx.KVStore(k.storeKey) - bz := k.cdc.MustMarshal(&types.DVPairs{Pairs: keys}) - store.Set(types.GetUnbondingDelegationTimeKey(timestamp), bz) +func (k Keeper) SetUBDQueueTimeSlice(ctx context.Context, timestamp time.Time, keys []types.DVPair) error { + store := k.storeService.OpenKVStore(ctx) + bz, err := k.cdc.Marshal(&types.DVPairs{Pairs: keys}) + if err != nil { + return err + } + return store.Set(types.GetUnbondingDelegationTimeKey(timestamp), bz) } // InsertUBDQueue inserts an unbonding delegation to the appropriate timeslice // in the unbonding queue. -func (k Keeper) InsertUBDQueue(ctx sdk.Context, ubd types.UnbondingDelegation, completionTime time.Time) { +func (k Keeper) InsertUBDQueue(ctx context.Context, ubd types.UnbondingDelegation, completionTime time.Time) error { dvPair := types.DVPair{DelegatorAddress: ubd.DelegatorAddress, ValidatorAddress: ubd.ValidatorAddress} - timeSlice := k.GetUBDQueueTimeSlice(ctx, completionTime) + timeSlice, err := k.GetUBDQueueTimeSlice(ctx, completionTime) + if err != nil { + return err + } + if len(timeSlice) == 0 { - k.SetUBDQueueTimeSlice(ctx, completionTime, []types.DVPair{dvPair}) - } else { - timeSlice = append(timeSlice, dvPair) - k.SetUBDQueueTimeSlice(ctx, completionTime, timeSlice) + if err = k.SetUBDQueueTimeSlice(ctx, completionTime, []types.DVPair{dvPair}); err != nil { + return err + } + return nil } + + timeSlice = append(timeSlice, dvPair) + return k.SetUBDQueueTimeSlice(ctx, completionTime, timeSlice) } // UBDQueueIterator returns all the unbonding queue timeslices from time 0 until endTime. -func (k Keeper) UBDQueueIterator(ctx sdk.Context, endTime time.Time) storetypes.Iterator { - store := ctx.KVStore(k.storeKey) +func (k Keeper) UBDQueueIterator(ctx context.Context, endTime time.Time) (corestore.Iterator, error) { + store := k.storeService.OpenKVStore(ctx) return store.Iterator(types.UnbondingQueueKey, storetypes.InclusiveEndBytes(types.GetUnbondingDelegationTimeKey(endTime))) } // DequeueAllMatureUBDQueue returns a concatenated list of all the timeslices inclusively previous to // currTime, and deletes the timeslices from the queue. -func (k Keeper) DequeueAllMatureUBDQueue(ctx sdk.Context, currTime time.Time) (matureUnbonds []types.DVPair) { - store := ctx.KVStore(k.storeKey) +func (k Keeper) DequeueAllMatureUBDQueue(ctx context.Context, currTime time.Time) (matureUnbonds []types.DVPair, err error) { + store := k.storeService.OpenKVStore(ctx) // gets an iterator for all timeslices from time 0 until the current Blockheader time - unbondingTimesliceIterator := k.UBDQueueIterator(ctx, currTime) + unbondingTimesliceIterator, err := k.UBDQueueIterator(ctx, currTime) + if err != nil { + return matureUnbonds, err + } defer unbondingTimesliceIterator.Close() for ; unbondingTimesliceIterator.Valid(); unbondingTimesliceIterator.Next() { timeslice := types.DVPairs{} value := unbondingTimesliceIterator.Value() - k.cdc.MustUnmarshal(value, ×lice) + if err = k.cdc.Unmarshal(value, ×lice); err != nil { + return matureUnbonds, err + } matureUnbonds = append(matureUnbonds, timeslice.Pairs...) - store.Delete(unbondingTimesliceIterator.Key()) + if err = store.Delete(unbondingTimesliceIterator.Key()); err != nil { + return matureUnbonds, err + } + } - return matureUnbonds + return matureUnbonds, nil } // GetRedelegations returns a given amount of all the delegator redelegations. -func (k Keeper) GetRedelegations(ctx sdk.Context, delegator sdk.AccAddress, maxRetrieve uint16) (redelegations []types.Redelegation) { +func (k Keeper) GetRedelegations(ctx context.Context, delegator sdk.AccAddress, maxRetrieve uint16) (redelegations []types.Redelegation, err error) { redelegations = make([]types.Redelegation, maxRetrieve) - store := ctx.KVStore(k.storeKey) + store := k.storeService.OpenKVStore(ctx) delegatorPrefixKey := types.GetREDsKey(delegator) - - iterator := storetypes.KVStorePrefixIterator(store, delegatorPrefixKey) - defer iterator.Close() + iterator, err := store.Iterator(delegatorPrefixKey, storetypes.PrefixEndBytes(delegatorPrefixKey)) + if err != nil { + return nil, err + } i := 0 for ; iterator.Valid() && i < int(maxRetrieve); iterator.Next() { - redelegation := types.MustUnmarshalRED(k.cdc, iterator.Value()) + redelegation, err := types.UnmarshalRED(k.cdc, iterator.Value()) + if err != nil { + return nil, err + } redelegations[i] = redelegation i++ } - return redelegations[:i] // trim if the array length < maxRetrieve + return redelegations[:i], nil // trim if the array length < maxRetrieve } // GetRedelegation returns a redelegation. -func (k Keeper) GetRedelegation(ctx sdk.Context, delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress) (red types.Redelegation, found bool) { - store := ctx.KVStore(k.storeKey) +func (k Keeper) GetRedelegation(ctx context.Context, delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress) (red types.Redelegation, err error) { + store := k.storeService.OpenKVStore(ctx) key := types.GetREDKey(delAddr, valSrcAddr, valDstAddr) - value := store.Get(key) - if value == nil { - return red, false + value, err := store.Get(key) + if err != nil { + return red, err } - red = types.MustUnmarshalRED(k.cdc, value) + if value == nil { + return red, types.ErrNoRedelegation + } - return red, true + return types.UnmarshalRED(k.cdc, value) } // GetRedelegationsFromSrcValidator returns all redelegations from a particular // validator. -func (k Keeper) GetRedelegationsFromSrcValidator(ctx sdk.Context, valAddr sdk.ValAddress) (reds []types.Redelegation) { - store := ctx.KVStore(k.storeKey) - - iterator := storetypes.KVStorePrefixIterator(store, types.GetREDsFromValSrcIndexKey(valAddr)) +func (k Keeper) GetRedelegationsFromSrcValidator(ctx context.Context, valAddr sdk.ValAddress) (reds []types.Redelegation, err error) { + store := k.storeService.OpenKVStore(ctx) + prefix := types.GetREDsFromValSrcIndexKey(valAddr) + iterator, err := store.Iterator(prefix, storetypes.PrefixEndBytes(prefix)) + if err != nil { + return nil, err + } defer iterator.Close() for ; iterator.Valid(); iterator.Next() { key := types.GetREDKeyFromValSrcIndexKey(iterator.Key()) - value := store.Get(key) - red := types.MustUnmarshalRED(k.cdc, value) + value, err := store.Get(key) + if err != nil { + return nil, err + } + red, err := types.UnmarshalRED(k.cdc, value) + if err != nil { + return nil, err + } reds = append(reds, red) } - return reds + return reds, nil } // HasReceivingRedelegation checks if validator is receiving a redelegation. -func (k Keeper) HasReceivingRedelegation(ctx sdk.Context, delAddr sdk.AccAddress, valDstAddr sdk.ValAddress) bool { - store := ctx.KVStore(k.storeKey) +func (k Keeper) HasReceivingRedelegation(ctx context.Context, delAddr sdk.AccAddress, valDstAddr sdk.ValAddress) (bool, error) { + store := k.storeService.OpenKVStore(ctx) prefix := types.GetREDsByDelToValDstIndexKey(delAddr, valDstAddr) - - iterator := storetypes.KVStorePrefixIterator(store, prefix) + iterator, err := store.Iterator(prefix, storetypes.PrefixEndBytes(prefix)) + if err != nil { + return false, err + } defer iterator.Close() - - return iterator.Valid() + return iterator.Valid(), nil } -// HasMaxRedelegationEntries checks if redelegation has maximum number of entries. -func (k Keeper) HasMaxRedelegationEntries(ctx sdk.Context, delegatorAddr sdk.AccAddress, validatorSrcAddr, validatorDstAddr sdk.ValAddress) bool { - red, found := k.GetRedelegation(ctx, delegatorAddr, validatorSrcAddr, validatorDstAddr) - if !found { - return false +// HasMaxRedelegationEntries checks if the redelegation entries reached maximum limit. +func (k Keeper) HasMaxRedelegationEntries(ctx context.Context, delegatorAddr sdk.AccAddress, validatorSrcAddr, validatorDstAddr sdk.ValAddress) (bool, error) { + red, err := k.GetRedelegation(ctx, delegatorAddr, validatorSrcAddr, validatorDstAddr) + if err != nil { + if err == types.ErrNoRedelegation { + return false, nil + } + + return false, err + } + maxEntries, err := k.MaxEntries(ctx) + if err != nil { + return false, err } - return len(red.Entries) >= int(k.MaxEntries(ctx)) + return len(red.Entries) >= int(maxEntries), nil } -// SetRedelegation set a redelegation and associated index. -func (k Keeper) SetRedelegation(ctx sdk.Context, red types.Redelegation) { +// SetRedelegation sets a redelegation and associated index. +func (k Keeper) SetRedelegation(ctx context.Context, red types.Redelegation) error { delegatorAddress, err := k.authKeeper.AddressCodec().StringToBytes(red.DelegatorAddress) if err != nil { - panic(err) + return err } - store := ctx.KVStore(k.storeKey) + store := k.storeService.OpenKVStore(ctx) bz := types.MustMarshalRED(k.cdc, red) - valSrcAddr, err := sdk.ValAddressFromBech32(red.ValidatorSrcAddress) + valSrcAddr, err := k.validatorAddressCodec.StringToBytes(red.ValidatorSrcAddress) if err != nil { - panic(err) + return err } - valDestAddr, err := sdk.ValAddressFromBech32(red.ValidatorDstAddress) + valDestAddr, err := k.validatorAddressCodec.StringToBytes(red.ValidatorDstAddress) if err != nil { - panic(err) + return err } key := types.GetREDKey(delegatorAddress, valSrcAddr, valDestAddr) - store.Set(key, bz) - store.Set(types.GetREDByValSrcIndexKey(delegatorAddress, valSrcAddr, valDestAddr), []byte{}) - store.Set(types.GetREDByValDstIndexKey(delegatorAddress, valSrcAddr, valDestAddr), []byte{}) + if err = store.Set(key, bz); err != nil { + return err + } + + if err = store.Set(types.GetREDByValSrcIndexKey(delegatorAddress, valSrcAddr, valDestAddr), []byte{}); err != nil { + return err + } + + return store.Set(types.GetREDByValDstIndexKey(delegatorAddress, valSrcAddr, valDestAddr), []byte{}) } // SetRedelegationEntry adds an entry to the unbonding delegation at the given // addresses. It creates the unbonding delegation if it does not exist. -func (k Keeper) SetRedelegationEntry(ctx sdk.Context, +func (k Keeper) SetRedelegationEntry(ctx context.Context, delegatorAddr sdk.AccAddress, validatorSrcAddr, validatorDstAddr sdk.ValAddress, creationHeight int64, minTime time.Time, balance math.Int, sharesSrc, sharesDst math.LegacyDec, -) types.Redelegation { - red, found := k.GetRedelegation(ctx, delegatorAddr, validatorSrcAddr, validatorDstAddr) - id := k.IncrementUnbondingID(ctx) - if found { +) (types.Redelegation, error) { + id, err := k.IncrementUnbondingID(ctx) + if err != nil { + return types.Redelegation{}, err + } + + red, err := k.GetRedelegation(ctx, delegatorAddr, validatorSrcAddr, validatorDstAddr) + if err == nil { red.AddEntry(creationHeight, minTime, balance, sharesDst, id) - } else { + } else if errors.Is(err, types.ErrNoRedelegation) { red = types.NewRedelegation(delegatorAddr, validatorSrcAddr, - validatorDstAddr, creationHeight, minTime, balance, sharesDst, id) + validatorDstAddr, creationHeight, minTime, balance, sharesDst, id, k.validatorAddressCodec, k.authKeeper.AddressCodec()) + } else { + return types.Redelegation{}, err } - k.SetRedelegation(ctx, red) + if err = k.SetRedelegation(ctx, red); err != nil { + return types.Redelegation{}, err + } // Add to the UBDByEntry index to look up the UBD by the UBDE ID - k.SetRedelegationByUnbondingID(ctx, red, id) + if err = k.SetRedelegationByUnbondingID(ctx, red, id); err != nil { + return types.Redelegation{}, err + } if err := k.Hooks().AfterUnbondingInitiated(ctx, id); err != nil { k.Logger(ctx).Error("failed to call after unbonding initiated hook", "error", err) + // TODO (Facu): Should we return here? We are ignoring this error } - return red + return red, nil } // IterateRedelegations iterates through all redelegations. -func (k Keeper) IterateRedelegations(ctx sdk.Context, fn func(index int64, red types.Redelegation) (stop bool)) { - store := ctx.KVStore(k.storeKey) - - iterator := storetypes.KVStorePrefixIterator(store, types.RedelegationKey) +func (k Keeper) IterateRedelegations(ctx context.Context, fn func(index int64, red types.Redelegation) (stop bool)) error { + store := k.storeService.OpenKVStore(ctx) + iterator, err := store.Iterator(types.RedelegationKey, storetypes.PrefixEndBytes(types.RedelegationKey)) + if err != nil { + return err + } defer iterator.Close() for i := int64(0); iterator.Valid(); iterator.Next() { - red := types.MustUnmarshalRED(k.cdc, iterator.Value()) + red, err := types.UnmarshalRED(k.cdc, iterator.Value()) + if err != nil { + return err + } if stop := fn(i, red); stop { break } i++ } + + return nil } // RemoveRedelegation removes a redelegation object and associated index. -func (k Keeper) RemoveRedelegation(ctx sdk.Context, red types.Redelegation) { +func (k Keeper) RemoveRedelegation(ctx context.Context, red types.Redelegation) error { delegatorAddress, err := k.authKeeper.AddressCodec().StringToBytes(red.DelegatorAddress) if err != nil { - panic(err) + return err } - store := ctx.KVStore(k.storeKey) - valSrcAddr, err := sdk.ValAddressFromBech32(red.ValidatorSrcAddress) + store := k.storeService.OpenKVStore(ctx) + valSrcAddr, err := k.validatorAddressCodec.StringToBytes(red.ValidatorSrcAddress) if err != nil { - panic(err) + return err } - valDestAddr, err := sdk.ValAddressFromBech32(red.ValidatorDstAddress) + valDestAddr, err := k.validatorAddressCodec.StringToBytes(red.ValidatorDstAddress) if err != nil { - panic(err) + return err } redKey := types.GetREDKey(delegatorAddress, valSrcAddr, valDestAddr) - store.Delete(redKey) - store.Delete(types.GetREDByValSrcIndexKey(delegatorAddress, valSrcAddr, valDestAddr)) - store.Delete(types.GetREDByValDstIndexKey(delegatorAddress, valSrcAddr, valDestAddr)) + if err = store.Delete(redKey); err != nil { + return err + } + + if err = store.Delete(types.GetREDByValSrcIndexKey(delegatorAddress, valSrcAddr, valDestAddr)); err != nil { + return err + } + + return store.Delete(types.GetREDByValDstIndexKey(delegatorAddress, valSrcAddr, valDestAddr)) } // redelegation queue timeslice operations @@ -595,31 +773,43 @@ func (k Keeper) RemoveRedelegation(ctx sdk.Context, red types.Redelegation) { // GetRedelegationQueueTimeSlice gets a specific redelegation queue timeslice. A // timeslice is a slice of DVVTriplets corresponding to redelegations that // expire at a certain time. -func (k Keeper) GetRedelegationQueueTimeSlice(ctx sdk.Context, timestamp time.Time) (dvvTriplets []types.DVVTriplet) { - store := ctx.KVStore(k.storeKey) +func (k Keeper) GetRedelegationQueueTimeSlice(ctx context.Context, timestamp time.Time) (dvvTriplets []types.DVVTriplet, err error) { + store := k.storeService.OpenKVStore(ctx) + bz, err := store.Get(types.GetRedelegationTimeKey(timestamp)) + if err != nil { + return nil, err + } - bz := store.Get(types.GetRedelegationTimeKey(timestamp)) if bz == nil { - return []types.DVVTriplet{} + return []types.DVVTriplet{}, nil } triplets := types.DVVTriplets{} - k.cdc.MustUnmarshal(bz, &triplets) + err = k.cdc.Unmarshal(bz, &triplets) + if err != nil { + return nil, err + } - return triplets.Triplets + return triplets.Triplets, nil } // SetRedelegationQueueTimeSlice sets a specific redelegation queue timeslice. -func (k Keeper) SetRedelegationQueueTimeSlice(ctx sdk.Context, timestamp time.Time, keys []types.DVVTriplet) { - store := ctx.KVStore(k.storeKey) - bz := k.cdc.MustMarshal(&types.DVVTriplets{Triplets: keys}) - store.Set(types.GetRedelegationTimeKey(timestamp), bz) +func (k Keeper) SetRedelegationQueueTimeSlice(ctx context.Context, timestamp time.Time, keys []types.DVVTriplet) error { + store := k.storeService.OpenKVStore(ctx) + bz, err := k.cdc.Marshal(&types.DVVTriplets{Triplets: keys}) + if err != nil { + return err + } + return store.Set(types.GetRedelegationTimeKey(timestamp), bz) } // InsertRedelegationQueue insert an redelegation delegation to the appropriate // timeslice in the redelegation queue. -func (k Keeper) InsertRedelegationQueue(ctx sdk.Context, red types.Redelegation, completionTime time.Time) { - timeSlice := k.GetRedelegationQueueTimeSlice(ctx, completionTime) +func (k Keeper) InsertRedelegationQueue(ctx context.Context, red types.Redelegation, completionTime time.Time) error { + timeSlice, err := k.GetRedelegationQueueTimeSlice(ctx, completionTime) + if err != nil { + return err + } dvvTriplet := types.DVVTriplet{ DelegatorAddress: red.DelegatorAddress, ValidatorSrcAddress: red.ValidatorSrcAddress, @@ -627,47 +817,55 @@ func (k Keeper) InsertRedelegationQueue(ctx sdk.Context, red types.Redelegation, } if len(timeSlice) == 0 { - k.SetRedelegationQueueTimeSlice(ctx, completionTime, []types.DVVTriplet{dvvTriplet}) - } else { - timeSlice = append(timeSlice, dvvTriplet) - k.SetRedelegationQueueTimeSlice(ctx, completionTime, timeSlice) + return k.SetRedelegationQueueTimeSlice(ctx, completionTime, []types.DVVTriplet{dvvTriplet}) } + + timeSlice = append(timeSlice, dvvTriplet) + return k.SetRedelegationQueueTimeSlice(ctx, completionTime, timeSlice) } // RedelegationQueueIterator returns all the redelegation queue timeslices from // time 0 until endTime. -func (k Keeper) RedelegationQueueIterator(ctx sdk.Context, endTime time.Time) storetypes.Iterator { - store := ctx.KVStore(k.storeKey) +func (k Keeper) RedelegationQueueIterator(ctx context.Context, endTime time.Time) (storetypes.Iterator, error) { + store := k.storeService.OpenKVStore(ctx) return store.Iterator(types.RedelegationQueueKey, storetypes.InclusiveEndBytes(types.GetRedelegationTimeKey(endTime))) } // DequeueAllMatureRedelegationQueue returns a concatenated list of all the // timeslices inclusively previous to currTime, and deletes the timeslices from // the queue. -func (k Keeper) DequeueAllMatureRedelegationQueue(ctx sdk.Context, currTime time.Time) (matureRedelegations []types.DVVTriplet) { - store := ctx.KVStore(k.storeKey) +func (k Keeper) DequeueAllMatureRedelegationQueue(ctx context.Context, currTime time.Time) (matureRedelegations []types.DVVTriplet, err error) { + store := k.storeService.OpenKVStore(ctx) // gets an iterator for all timeslices from time 0 until the current Blockheader time - redelegationTimesliceIterator := k.RedelegationQueueIterator(ctx, ctx.BlockHeader().Time) + sdkCtx := sdk.UnwrapSDKContext(ctx) + redelegationTimesliceIterator, err := k.RedelegationQueueIterator(ctx, sdkCtx.HeaderInfo().Time) + if err != nil { + return nil, err + } defer redelegationTimesliceIterator.Close() for ; redelegationTimesliceIterator.Valid(); redelegationTimesliceIterator.Next() { timeslice := types.DVVTriplets{} value := redelegationTimesliceIterator.Value() - k.cdc.MustUnmarshal(value, ×lice) + if err = k.cdc.Unmarshal(value, ×lice); err != nil { + return nil, err + } matureRedelegations = append(matureRedelegations, timeslice.Triplets...) - store.Delete(redelegationTimesliceIterator.Key()) + if err = store.Delete(redelegationTimesliceIterator.Key()); err != nil { + return nil, err + } } - return matureRedelegations + return matureRedelegations, nil } // Delegate performs a delegation, set/update everything necessary within the store. // tokenSrc indicates the bond status of the incoming funds. func (k Keeper) Delegate( - ctx sdk.Context, delAddr sdk.AccAddress, bondAmt math.Int, tokenSrc types.BondStatus, + ctx context.Context, delAddr sdk.AccAddress, bondAmt math.Int, tokenSrc types.BondStatus, validator types.Validator, subtractAccount bool, ) (newShares math.LegacyDec, err error) { // In some situations, the exchange rate becomes invalid, e.g. if @@ -677,26 +875,31 @@ func (k Keeper) Delegate( return math.LegacyZeroDec(), types.ErrDelegatorShareExRateInvalid } - // Get or create the delegation object - delegation, found := k.GetDelegation(ctx, delAddr, validator.GetOperator()) - if !found { - delegation = types.NewDelegation(delAddr, validator.GetOperator(), math.LegacyZeroDec()) + valbz, err := k.ValidatorAddressCodec().StringToBytes(validator.GetOperator()) + if err != nil { + return math.LegacyZeroDec(), err } - // call the appropriate hook if present - if found { - err = k.Hooks().BeforeDelegationSharesModified(ctx, delAddr, validator.GetOperator()) - } else { - err = k.Hooks().BeforeDelegationCreated(ctx, delAddr, validator.GetOperator()) - } + // Get or create the delegation object and call the appropriate hook if present + delegation, err := k.GetDelegation(ctx, delAddr, valbz) + if err == nil { + // found + err = k.Hooks().BeforeDelegationSharesModified(ctx, delAddr, valbz) + } else if errors.Is(err, types.ErrNoDelegation) { + // not found + delAddrStr, err1 := k.authKeeper.AddressCodec().BytesToString(delAddr) + if err1 != nil { + return math.LegacyDec{}, err1 + } - if err != nil { + delegation = types.NewDelegation(delAddrStr, validator.GetOperator(), math.LegacyZeroDec()) + err = k.Hooks().BeforeDelegationCreated(ctx, delAddr, valbz) + } else { return math.LegacyZeroDec(), err } - delegatorAddress, err := k.authKeeper.AddressCodec().StringToBytes(delegation.DelegatorAddress) if err != nil { - panic(err) + return math.LegacyZeroDec(), err } // if subtractAccount is true then we are @@ -718,8 +921,13 @@ func (k Keeper) Delegate( panic("invalid validator status") } - coins := sdk.NewCoins(sdk.NewCoin(k.BondDenom(ctx), bondAmt)) - if err := k.bankKeeper.DelegateCoinsFromAccountToModule(ctx, delegatorAddress, sendName, coins); err != nil { + bondDenom, err := k.BondDenom(ctx) + if err != nil { + return math.LegacyDec{}, err + } + + coins := sdk.NewCoins(sdk.NewCoin(bondDenom, bondAmt)) + if err := k.bankKeeper.DelegateCoinsFromAccountToModule(ctx, delAddr, sendName, coins); err != nil { return math.LegacyDec{}, err } } else { @@ -731,23 +939,34 @@ func (k Keeper) Delegate( // do nothing case (tokenSrc == types.Unbonded || tokenSrc == types.Unbonding) && validator.IsBonded(): // transfer pools - k.notBondedTokensToBonded(ctx, bondAmt) + err = k.notBondedTokensToBonded(ctx, bondAmt) + if err != nil { + return math.LegacyDec{}, err + } case tokenSrc == types.Bonded && !validator.IsBonded(): // transfer pools - k.bondedTokensToNotBonded(ctx, bondAmt) + err = k.bondedTokensToNotBonded(ctx, bondAmt) + if err != nil { + return math.LegacyDec{}, err + } default: panic("unknown token source bond status") } } - _, newShares = k.AddValidatorTokensAndShares(ctx, validator, bondAmt) + _, newShares, err = k.AddValidatorTokensAndShares(ctx, validator, bondAmt) + if err != nil { + return newShares, err + } // Update delegation delegation.Shares = delegation.Shares.Add(newShares) - k.SetDelegation(ctx, delegation) + if err = k.SetDelegation(ctx, delegation); err != nil { + return newShares, err + } // Call the after-modification hook - if err := k.Hooks().AfterDelegationModified(ctx, delegatorAddress, delegation.GetValidatorAddr()); err != nil { + if err := k.Hooks().AfterDelegationModified(ctx, delAddr, valbz); err != nil { return newShares, err } @@ -756,12 +975,14 @@ func (k Keeper) Delegate( // Unbond unbonds a particular delegation and perform associated store operations. func (k Keeper) Unbond( - ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, shares math.LegacyDec, + ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, shares math.LegacyDec, ) (amount math.Int, err error) { // check if a delegation object exists in the store - delegation, found := k.GetDelegation(ctx, delAddr, valAddr) - if !found { + delegation, err := k.GetDelegation(ctx, delAddr, valAddr) + if errors.Is(err, types.ErrNoDelegation) { return amount, types.ErrNoDelegatorForAddress + } else if err != nil { + return amount, err } // call the before-delegation-modified hook @@ -775,9 +996,9 @@ func (k Keeper) Unbond( } // get validator - validator, found := k.GetValidator(ctx, valAddr) - if !found { - return amount, types.ErrNoValidatorFound + validator, err := k.GetValidator(ctx, valAddr) + if err != nil { + return amount, err } // subtract shares from delegation @@ -788,22 +1009,38 @@ func (k Keeper) Unbond( return amount, err } - isValidatorOperator := bytes.Equal(delegatorAddress, validator.GetOperator()) + valbz, err := k.ValidatorAddressCodec().StringToBytes(validator.GetOperator()) + if err != nil { + return amount, err + } + + isValidatorOperator := bytes.Equal(delegatorAddress, valbz) // If the delegation is the operator of the validator and undelegating will decrease the validator's // self-delegation below their minimum, we jail the validator. if isValidatorOperator && !validator.Jailed && validator.TokensFromShares(delegation.Shares).TruncateInt().LT(validator.MinSelfDelegation) { - k.jailValidator(ctx, validator) - validator = k.mustGetValidator(ctx, validator.GetOperator()) + err = k.jailValidator(ctx, validator) + if err != nil { + return amount, err + } + validator = k.mustGetValidator(ctx, valbz) } if delegation.Shares.IsZero() { err = k.RemoveDelegation(ctx, delegation) } else { - k.SetDelegation(ctx, delegation) + if err = k.SetDelegation(ctx, delegation); err != nil { + return amount, err + } + + valAddr, err1 := k.validatorAddressCodec.StringToBytes(delegation.GetValidatorAddr()) + if err1 != nil { + return amount, err1 + } + // call the after delegation modification hook - err = k.Hooks().AfterDelegationModified(ctx, delegatorAddress, delegation.GetValidatorAddr()) + err = k.Hooks().AfterDelegationModified(ctx, delegatorAddress, valAddr) } if err != nil { @@ -812,10 +1049,16 @@ func (k Keeper) Unbond( // remove the shares and coins from the validator // NOTE that the amount is later (in keeper.Delegation) moved between staking module pools - validator, amount = k.RemoveValidatorTokensAndShares(ctx, validator, shares) + validator, amount, err = k.RemoveValidatorTokensAndShares(ctx, validator, shares) + if err != nil { + return amount, err + } + if validator.DelegatorShares.IsZero() && validator.IsUnbonded() { // if not unbonded, we must instead remove validator in EndBlocker once it finishes its unbonding period - k.RemoveValidator(ctx, validator.GetOperator()) + if err = k.RemoveValidator(ctx, valbz); err != nil { + return amount, err + } } return amount, nil @@ -825,24 +1068,32 @@ func (k Keeper) Unbond( // with a boolean signaling if the redelegation is complete based on the source // validator. func (k Keeper) getBeginInfo( - ctx sdk.Context, valSrcAddr sdk.ValAddress, -) (completionTime time.Time, height int64, completeNow bool) { - validator, found := k.GetValidator(ctx, valSrcAddr) + ctx context.Context, valSrcAddr sdk.ValAddress, +) (completionTime time.Time, height int64, completeNow bool, err error) { + validator, err := k.GetValidator(ctx, valSrcAddr) + if err != nil && errors.Is(err, types.ErrNoValidatorFound) { + return + } + sdkCtx := sdk.UnwrapSDKContext(ctx) + unbondingTime, err := k.UnbondingTime(ctx) + if err != nil { + return + } // TODO: When would the validator not be found? switch { - case !found || validator.IsBonded(): + case errors.Is(err, types.ErrNoValidatorFound) || validator.IsBonded(): // the longest wait - just unbonding period from now - completionTime = ctx.BlockHeader().Time.Add(k.UnbondingTime(ctx)) - height = ctx.BlockHeight() + completionTime = sdkCtx.BlockHeader().Time.Add(unbondingTime) + height = sdkCtx.BlockHeight() - return completionTime, height, false + return completionTime, height, false, nil case validator.IsUnbonded(): - return completionTime, height, true + return completionTime, height, true, nil case validator.IsUnbonding(): - return validator.UnbondingTime, validator.UnbondingHeight, false + return validator.UnbondingTime, validator.UnbondingHeight, false, nil default: panic(fmt.Sprintf("unknown validator status: %s", validator.Status)) @@ -855,14 +1106,19 @@ func (k Keeper) getBeginInfo( // an unbonding object and inserting it into the unbonding queue which will be // processed during the staking EndBlocker. func (k Keeper) Undelegate( - ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, sharesAmount math.LegacyDec, + ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, sharesAmount math.LegacyDec, ) (time.Time, math.Int, error) { - validator, found := k.GetValidator(ctx, valAddr) - if !found { - return time.Time{}, math.Int{}, types.ErrNoDelegatorForAddress + validator, err := k.GetValidator(ctx, valAddr) + if err != nil { + return time.Time{}, math.Int{}, err + } + + hasMaxEntries, err := k.HasMaxUnbondingDelegationEntries(ctx, delAddr, valAddr) + if err != nil { + return time.Time{}, math.Int{}, err } - if k.HasMaxUnbondingDelegationEntries(ctx, delAddr, valAddr) { + if hasMaxEntries { return time.Time{}, math.Int{}, types.ErrMaxUnbondingDelegationEntries } @@ -873,12 +1129,28 @@ func (k Keeper) Undelegate( // transfer the validator tokens to the not bonded pool if validator.IsBonded() { - k.bondedTokensToNotBonded(ctx, returnAmount) + err = k.bondedTokensToNotBonded(ctx, returnAmount) + if err != nil { + return time.Time{}, math.Int{}, err + } } - completionTime := ctx.BlockHeader().Time.Add(k.UnbondingTime(ctx)) - ubd := k.SetUnbondingDelegationEntry(ctx, delAddr, valAddr, ctx.BlockHeight(), completionTime, returnAmount) - k.InsertUBDQueue(ctx, ubd, completionTime) + unbondingTime, err := k.UnbondingTime(ctx) + if err != nil { + return time.Time{}, math.Int{}, err + } + + sdkCtx := sdk.UnwrapSDKContext(ctx) + completionTime := sdkCtx.BlockHeader().Time.Add(unbondingTime) + ubd, err := k.SetUnbondingDelegationEntry(ctx, delAddr, valAddr, sdkCtx.BlockHeight(), completionTime, returnAmount) + if err != nil { + return time.Time{}, math.Int{}, err + } + + err = k.InsertUBDQueue(ctx, ubd, completionTime) + if err != nil { + return time.Time{}, math.Int{}, err + } return completionTime, returnAmount, nil } @@ -886,15 +1158,20 @@ func (k Keeper) Undelegate( // CompleteUnbonding completes the unbonding of all mature entries in the // retrieved unbonding delegation object and returns the total unbonding balance // or an error upon failure. -func (k Keeper) CompleteUnbonding(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (sdk.Coins, error) { - ubd, found := k.GetUnbondingDelegation(ctx, delAddr, valAddr) - if !found { - return nil, types.ErrNoUnbondingDelegation +func (k Keeper) CompleteUnbonding(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (sdk.Coins, error) { + ubd, err := k.GetUnbondingDelegation(ctx, delAddr, valAddr) + if err != nil { + return nil, err + } + + bondDenom, err := k.BondDenom(ctx) + if err != nil { + return nil, err } - bondDenom := k.GetParams(ctx).BondDenom balances := sdk.NewCoins() - ctxTime := ctx.BlockHeader().Time + sdkCtx := sdk.UnwrapSDKContext(ctx) + ctxTime := sdkCtx.BlockHeader().Time delegatorAddress, err := k.authKeeper.AddressCodec().StringToBytes(ubd.DelegatorAddress) if err != nil { @@ -907,7 +1184,9 @@ func (k Keeper) CompleteUnbonding(ctx sdk.Context, delAddr sdk.AccAddress, valAd if entry.IsMature(ctxTime) && !entry.OnHold() { ubd.RemoveEntry(int64(i)) i-- - k.DeleteUnbondingIndex(ctx, entry.UnbondingId) + if err = k.DeleteUnbondingIndex(ctx, entry.UnbondingId); err != nil { + return nil, err + } // track undelegation only when remaining or truncated shares are non-zero if !entry.Balance.IsZero() { @@ -925,9 +1204,13 @@ func (k Keeper) CompleteUnbonding(ctx sdk.Context, delAddr sdk.AccAddress, valAd // set the unbonding delegation or remove it if there are no more entries if len(ubd.Entries) == 0 { - k.RemoveUnbondingDelegation(ctx, ubd) + err = k.RemoveUnbondingDelegation(ctx, ubd) } else { - k.SetUnbondingDelegation(ctx, ubd) + err = k.SetUnbondingDelegation(ctx, ubd) + } + + if err != nil { + return nil, err } return balances, nil @@ -936,28 +1219,42 @@ func (k Keeper) CompleteUnbonding(ctx sdk.Context, delAddr sdk.AccAddress, valAd // BeginRedelegation begins unbonding / redelegation and creates a redelegation // record. func (k Keeper) BeginRedelegation( - ctx sdk.Context, delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress, sharesAmount math.LegacyDec, + ctx context.Context, delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress, sharesAmount math.LegacyDec, ) (completionTime time.Time, err error) { if bytes.Equal(valSrcAddr, valDstAddr) { return time.Time{}, types.ErrSelfRedelegation } - dstValidator, found := k.GetValidator(ctx, valDstAddr) - if !found { + dstValidator, err := k.GetValidator(ctx, valDstAddr) + if errors.Is(err, types.ErrNoValidatorFound) { return time.Time{}, types.ErrBadRedelegationDst + } else if err != nil { + return time.Time{}, err } - srcValidator, found := k.GetValidator(ctx, valSrcAddr) - if !found { - return time.Time{}, types.ErrBadRedelegationDst + srcValidator, err := k.GetValidator(ctx, valSrcAddr) + if errors.Is(err, types.ErrNoValidatorFound) { + return time.Time{}, types.ErrBadRedelegationSrc + } else if err != nil { + return time.Time{}, err } // check if this is a transitive redelegation - if k.HasReceivingRedelegation(ctx, delAddr, valSrcAddr) { + hasRecRedel, err := k.HasReceivingRedelegation(ctx, delAddr, valSrcAddr) + if err != nil { + return time.Time{}, err + } + + if hasRecRedel { return time.Time{}, types.ErrTransitiveRedelegation } - if k.HasMaxRedelegationEntries(ctx, delAddr, valSrcAddr, valDstAddr) { + hasMaxRedels, err := k.HasMaxRedelegationEntries(ctx, delAddr, valSrcAddr, valDstAddr) + if err != nil { + return time.Time{}, err + } + + if hasMaxRedels { return time.Time{}, types.ErrMaxRedelegationEntries } @@ -976,17 +1273,27 @@ func (k Keeper) BeginRedelegation( } // create the unbonding delegation - completionTime, height, completeNow := k.getBeginInfo(ctx, valSrcAddr) + completionTime, height, completeNow, err := k.getBeginInfo(ctx, valSrcAddr) + if err != nil { + return time.Time{}, err + } if completeNow { // no need to create the redelegation object return completionTime, nil } - red := k.SetRedelegationEntry( + red, err := k.SetRedelegationEntry( ctx, delAddr, valSrcAddr, valDstAddr, height, completionTime, returnAmount, sharesAmount, sharesCreated, ) - k.InsertRedelegationQueue(ctx, red, completionTime) + if err != nil { + return time.Time{}, err + } + + err = k.InsertRedelegationQueue(ctx, red, completionTime) + if err != nil { + return time.Time{}, err + } return completionTime, nil } @@ -995,16 +1302,21 @@ func (k Keeper) BeginRedelegation( // retrieved redelegation object and returns the total redelegation (initial) // balance or an error upon failure. func (k Keeper) CompleteRedelegation( - ctx sdk.Context, delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress, + ctx context.Context, delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress, ) (sdk.Coins, error) { - red, found := k.GetRedelegation(ctx, delAddr, valSrcAddr, valDstAddr) - if !found { - return nil, types.ErrNoRedelegation + red, err := k.GetRedelegation(ctx, delAddr, valSrcAddr, valDstAddr) + if err != nil { + return nil, err + } + + bondDenom, err := k.BondDenom(ctx) + if err != nil { + return nil, err } - bondDenom := k.GetParams(ctx).BondDenom balances := sdk.NewCoins() - ctxTime := ctx.BlockHeader().Time + sdkCtx := sdk.UnwrapSDKContext(ctx) + ctxTime := sdkCtx.BlockHeader().Time // loop through all the entries and complete mature redelegation entries for i := 0; i < len(red.Entries); i++ { @@ -1012,7 +1324,9 @@ func (k Keeper) CompleteRedelegation( if entry.IsMature(ctxTime) && !entry.OnHold() { red.RemoveEntry(int64(i)) i-- - k.DeleteUnbondingIndex(ctx, entry.UnbondingId) + if err = k.DeleteUnbondingIndex(ctx, entry.UnbondingId); err != nil { + return nil, err + } if !entry.InitialBalance.IsZero() { balances = balances.Add(sdk.NewCoin(bondDenom, entry.InitialBalance)) @@ -1022,28 +1336,32 @@ func (k Keeper) CompleteRedelegation( // set the redelegation or remove it if there are no more entries if len(red.Entries) == 0 { - k.RemoveRedelegation(ctx, red) + err = k.RemoveRedelegation(ctx, red) } else { - k.SetRedelegation(ctx, red) + err = k.SetRedelegation(ctx, red) + } + + if err != nil { + return nil, err } return balances, nil } // ValidateUnbondAmount validates that a given unbond or redelegation amount is -// valied based on upon the converted shares. If the amount is valid, the total +// valid based on upon the converted shares. If the amount is valid, the total // amount of respective shares is returned, otherwise an error is returned. func (k Keeper) ValidateUnbondAmount( - ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, amt math.Int, + ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, amt math.Int, ) (shares math.LegacyDec, err error) { - validator, found := k.GetValidator(ctx, valAddr) - if !found { - return shares, types.ErrNoValidatorFound + validator, err := k.GetValidator(ctx, valAddr) + if err != nil { + return shares, err } - del, found := k.GetDelegation(ctx, delAddr, valAddr) - if !found { - return shares, types.ErrNoDelegation + del, err := k.GetDelegation(ctx, delAddr, valAddr) + if err != nil { + return shares, err } shares, err = validator.SharesFromTokens(amt) diff --git a/x/staking/keeper/delegation_test.go b/x/staking/keeper/delegation_test.go index 53433fd95015..cb7964bb873c 100644 --- a/x/staking/keeper/delegation_test.go +++ b/x/staking/keeper/delegation_test.go @@ -3,8 +3,9 @@ package keeper_test import ( "time" + "go.uber.org/mock/gomock" + "cosmossdk.io/math" - "github.com/golang/mock/gomock" "github.com/cosmos/cosmos-sdk/codec/address" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" @@ -41,53 +42,58 @@ func (s *KeeperTestSuite) TestDelegation() { } // first add a validators[0] to delegate too - bond1to1 := stakingtypes.NewDelegation(addrDels[0], valAddrs[0], math.LegacyNewDec(9)) + bond1to1 := stakingtypes.NewDelegation(addrDels[0].String(), valAddrs[0].String(), math.LegacyNewDec(9)) // check the empty keeper first - _, found := keeper.GetDelegation(ctx, addrDels[0], valAddrs[0]) - require.False(found) + _, err := keeper.GetDelegation(ctx, addrDels[0], valAddrs[0]) + require.ErrorIs(err, stakingtypes.ErrNoDelegation) // set and retrieve a record - keeper.SetDelegation(ctx, bond1to1) - resBond, found := keeper.GetDelegation(ctx, addrDels[0], valAddrs[0]) - require.True(found) + require.NoError(keeper.SetDelegation(ctx, bond1to1)) + resBond, err := keeper.GetDelegation(ctx, addrDels[0], valAddrs[0]) + require.NoError(err) require.Equal(bond1to1, resBond) // modify a records, save, and retrieve bond1to1.Shares = math.LegacyNewDec(99) - keeper.SetDelegation(ctx, bond1to1) - resBond, found = keeper.GetDelegation(ctx, addrDels[0], valAddrs[0]) - require.True(found) + require.NoError(keeper.SetDelegation(ctx, bond1to1)) + resBond, err = keeper.GetDelegation(ctx, addrDels[0], valAddrs[0]) + require.NoError(err) require.Equal(bond1to1, resBond) // add some more records - bond1to2 := stakingtypes.NewDelegation(addrDels[0], valAddrs[1], math.LegacyNewDec(9)) - bond1to3 := stakingtypes.NewDelegation(addrDels[0], valAddrs[2], math.LegacyNewDec(9)) - bond2to1 := stakingtypes.NewDelegation(addrDels[1], valAddrs[0], math.LegacyNewDec(9)) - bond2to2 := stakingtypes.NewDelegation(addrDels[1], valAddrs[1], math.LegacyNewDec(9)) - bond2to3 := stakingtypes.NewDelegation(addrDels[1], valAddrs[2], math.LegacyNewDec(9)) - keeper.SetDelegation(ctx, bond1to2) - keeper.SetDelegation(ctx, bond1to3) - keeper.SetDelegation(ctx, bond2to1) - keeper.SetDelegation(ctx, bond2to2) - keeper.SetDelegation(ctx, bond2to3) + bond1to2 := stakingtypes.NewDelegation(addrDels[0].String(), valAddrs[1].String(), math.LegacyNewDec(9)) + bond1to3 := stakingtypes.NewDelegation(addrDels[0].String(), valAddrs[2].String(), math.LegacyNewDec(9)) + bond2to1 := stakingtypes.NewDelegation(addrDels[1].String(), valAddrs[0].String(), math.LegacyNewDec(9)) + bond2to2 := stakingtypes.NewDelegation(addrDels[1].String(), valAddrs[1].String(), math.LegacyNewDec(9)) + bond2to3 := stakingtypes.NewDelegation(addrDels[1].String(), valAddrs[2].String(), math.LegacyNewDec(9)) + require.NoError(keeper.SetDelegation(ctx, bond1to2)) + require.NoError(keeper.SetDelegation(ctx, bond1to3)) + require.NoError(keeper.SetDelegation(ctx, bond2to1)) + require.NoError(keeper.SetDelegation(ctx, bond2to2)) + require.NoError(keeper.SetDelegation(ctx, bond2to3)) // test all bond retrieve capabilities - resBonds := keeper.GetDelegatorDelegations(ctx, addrDels[0], 5) + resBonds, err := keeper.GetDelegatorDelegations(ctx, addrDels[0], 5) + require.NoError(err) require.Equal(3, len(resBonds)) require.Equal(bond1to1, resBonds[0]) require.Equal(bond1to2, resBonds[1]) require.Equal(bond1to3, resBonds[2]) - resBonds = keeper.GetAllDelegatorDelegations(ctx, addrDels[0]) + resBonds, err = keeper.GetAllDelegatorDelegations(ctx, addrDels[0]) + require.NoError(err) require.Equal(3, len(resBonds)) - resBonds = keeper.GetDelegatorDelegations(ctx, addrDels[0], 2) + resBonds, err = keeper.GetDelegatorDelegations(ctx, addrDels[0], 2) + require.NoError(err) require.Equal(2, len(resBonds)) - resBonds = keeper.GetDelegatorDelegations(ctx, addrDels[1], 5) + resBonds, err = keeper.GetDelegatorDelegations(ctx, addrDels[1], 5) + require.NoError(err) require.Equal(3, len(resBonds)) require.Equal(bond2to1, resBonds[0]) require.Equal(bond2to2, resBonds[1]) require.Equal(bond2to3, resBonds[2]) - allBonds := keeper.GetAllDelegations(ctx) + allBonds, err := keeper.GetAllDelegations(ctx) + require.NoError(err) require.Equal(6, len(allBonds)) require.Equal(bond1to1, allBonds[0]) require.Equal(bond1to2, allBonds[1]) @@ -96,49 +102,56 @@ func (s *KeeperTestSuite) TestDelegation() { require.Equal(bond2to2, allBonds[4]) require.Equal(bond2to3, allBonds[5]) - resVals := keeper.GetDelegatorValidators(ctx, addrDels[0], 3) - require.Equal(3, len(resVals)) - resVals = keeper.GetDelegatorValidators(ctx, addrDels[1], 4) - require.Equal(3, len(resVals)) + resVals, err := keeper.GetDelegatorValidators(ctx, addrDels[0], 3) + require.NoError(err) + require.Equal(3, len(resVals.Validators)) + resVals, err = keeper.GetDelegatorValidators(ctx, addrDels[1], 4) + require.NoError(err) + require.Equal(3, len(resVals.Validators)) for i := 0; i < 3; i++ { resVal, err := keeper.GetDelegatorValidator(ctx, addrDels[0], valAddrs[i]) require.Nil(err) - require.Equal(valAddrs[i], resVal.GetOperator()) + require.Equal(valAddrs[i].String(), resVal.GetOperator()) resVal, err = keeper.GetDelegatorValidator(ctx, addrDels[1], valAddrs[i]) require.Nil(err) - require.Equal(valAddrs[i], resVal.GetOperator()) + require.Equal(valAddrs[i].String(), resVal.GetOperator()) - resDels := keeper.GetValidatorDelegations(ctx, valAddrs[i]) + resDels, err := keeper.GetValidatorDelegations(ctx, valAddrs[i]) + require.NoError(err) require.Len(resDels, 2) } // test total bonded for single delegator expBonded := bond1to1.Shares.Add(bond2to1.Shares).Add(bond1to3.Shares) - resDelBond := keeper.GetDelegatorBonded(ctx, addrDels[0]) + resDelBond, err := keeper.GetDelegatorBonded(ctx, addrDels[0]) + require.NoError(err) require.Equal(expBonded, math.LegacyNewDecFromInt(resDelBond)) // delete a record - keeper.RemoveDelegation(ctx, bond2to3) - _, found = keeper.GetDelegation(ctx, addrDels[1], valAddrs[2]) - require.False(found) - resBonds = keeper.GetDelegatorDelegations(ctx, addrDels[1], 5) + require.NoError(keeper.RemoveDelegation(ctx, bond2to3)) + _, err = keeper.GetDelegation(ctx, addrDels[1], valAddrs[2]) + require.ErrorIs(err, stakingtypes.ErrNoDelegation) + resBonds, err = keeper.GetDelegatorDelegations(ctx, addrDels[1], 5) + require.NoError(err) require.Equal(2, len(resBonds)) require.Equal(bond2to1, resBonds[0]) require.Equal(bond2to2, resBonds[1]) - resBonds = keeper.GetAllDelegatorDelegations(ctx, addrDels[1]) + resBonds, err = keeper.GetAllDelegatorDelegations(ctx, addrDels[1]) + require.NoError(err) require.Equal(2, len(resBonds)) // delete all the records from delegator 2 - keeper.RemoveDelegation(ctx, bond2to1) - keeper.RemoveDelegation(ctx, bond2to2) - _, found = keeper.GetDelegation(ctx, addrDels[1], valAddrs[0]) - require.False(found) - _, found = keeper.GetDelegation(ctx, addrDels[1], valAddrs[1]) - require.False(found) - resBonds = keeper.GetDelegatorDelegations(ctx, addrDels[1], 5) + require.NoError(keeper.RemoveDelegation(ctx, bond2to1)) + require.NoError(keeper.RemoveDelegation(ctx, bond2to2)) + _, err = keeper.GetDelegation(ctx, addrDels[1], valAddrs[0]) + require.ErrorIs(err, stakingtypes.ErrNoDelegation) + _, err = keeper.GetDelegation(ctx, addrDels[1], valAddrs[1]) + require.ErrorIs(err, stakingtypes.ErrNoDelegation) + resBonds, err = keeper.GetDelegatorDelegations(ctx, addrDels[1], 5) + require.NoError(err) require.Equal(0, len(resBonds)) } @@ -154,7 +167,7 @@ func (s *KeeperTestSuite) TestDelegationsByValIndex() { s.accountKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec("cosmos")).AnyTimes() // construct the validators - amts := []math.Int{sdk.NewInt(9), sdk.NewInt(8), sdk.NewInt(7)} + amts := []math.Int{math.NewInt(9), math.NewInt(8), math.NewInt(7)} var validators [3]stakingtypes.Validator for i, amt := range amts { validators[i] = testutil.NewValidator(s.T(), valAddrs[i], PKs[i]) @@ -166,55 +179,61 @@ func (s *KeeperTestSuite) TestDelegationsByValIndex() { // delegate 2 tokens // // total delegations after delegating: del1 -> 2stake - _, err := s.msgServer.Delegate(ctx, stakingtypes.NewMsgDelegate(addrDels[0], valAddrs[0], sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(2)))) + _, err := s.msgServer.Delegate(ctx, stakingtypes.NewMsgDelegate(addrDels[0].String(), valAddrs[0].String(), sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(2)))) require.NoError(err) - dels := s.stakingKeeper.GetValidatorDelegations(ctx, valAddrs[0]) + dels, err := s.stakingKeeper.GetValidatorDelegations(ctx, valAddrs[0]) + require.NoError(err) require.Len(dels, 1) // delegate 4 tokens // // total delegations after delegating: del1 -> 2stake, del2 -> 4stake - _, err = s.msgServer.Delegate(ctx, stakingtypes.NewMsgDelegate(addrDels[1], valAddrs[0], sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(4)))) + _, err = s.msgServer.Delegate(ctx, stakingtypes.NewMsgDelegate(addrDels[1].String(), valAddrs[0].String(), sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(4)))) require.NoError(err) - dels = s.stakingKeeper.GetValidatorDelegations(ctx, valAddrs[0]) + dels, err = s.stakingKeeper.GetValidatorDelegations(ctx, valAddrs[0]) + require.NoError(err) require.Len(dels, 2) // undelegate 1 token from del1 // // total delegations after undelegating: del1 -> 1stake, del2 -> 4stake - _, err = s.msgServer.Undelegate(ctx, stakingtypes.NewMsgUndelegate(addrDels[0], valAddrs[0], sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(1)))) + _, err = s.msgServer.Undelegate(ctx, stakingtypes.NewMsgUndelegate(addrDels[0].String(), valAddrs[0].String(), sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(1)))) require.NoError(err) - dels = s.stakingKeeper.GetValidatorDelegations(ctx, valAddrs[0]) + dels, err = s.stakingKeeper.GetValidatorDelegations(ctx, valAddrs[0]) + require.NoError(err) require.Len(dels, 2) // undelegate 1 token from del1 // // total delegations after undelegating: del2 -> 4stake - _, err = s.msgServer.Undelegate(ctx, stakingtypes.NewMsgUndelegate(addrDels[0], valAddrs[0], sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(1)))) + _, err = s.msgServer.Undelegate(ctx, stakingtypes.NewMsgUndelegate(addrDels[0].String(), valAddrs[0].String(), sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(1)))) require.NoError(err) - dels = s.stakingKeeper.GetValidatorDelegations(ctx, valAddrs[0]) + dels, err = s.stakingKeeper.GetValidatorDelegations(ctx, valAddrs[0]) + require.NoError(err) require.Len(dels, 1) // undelegate 2 tokens from del2 // // total delegations after undelegating: del2 -> 2stake - _, err = s.msgServer.Undelegate(ctx, stakingtypes.NewMsgUndelegate(addrDels[1], valAddrs[0], sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(2)))) + _, err = s.msgServer.Undelegate(ctx, stakingtypes.NewMsgUndelegate(addrDels[1].String(), valAddrs[0].String(), sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(2)))) require.NoError(err) - dels = s.stakingKeeper.GetValidatorDelegations(ctx, valAddrs[0]) + dels, err = s.stakingKeeper.GetValidatorDelegations(ctx, valAddrs[0]) + require.NoError(err) require.Len(dels, 1) // undelegate 2 tokens from del2 // // total delegations after undelegating: [] - _, err = s.msgServer.Undelegate(ctx, stakingtypes.NewMsgUndelegate(addrDels[1], valAddrs[0], sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(2)))) + _, err = s.msgServer.Undelegate(ctx, stakingtypes.NewMsgUndelegate(addrDels[1].String(), valAddrs[0].String(), sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(2)))) require.NoError(err) - dels = s.stakingKeeper.GetValidatorDelegations(ctx, valAddrs[0]) + dels, err = s.stakingKeeper.GetValidatorDelegations(ctx, valAddrs[0]) + require.NoError(err) require.Len(dels, 0) } @@ -234,41 +253,47 @@ func (s *KeeperTestSuite) TestUnbondingDelegation() { time.Unix(0, 0).UTC(), math.NewInt(5), 0, + address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmos"), ) // set and retrieve a record - keeper.SetUnbondingDelegation(ctx, ubd) - resUnbond, found := keeper.GetUnbondingDelegation(ctx, delAddrs[0], valAddrs[0]) - require.True(found) + require.NoError(keeper.SetUnbondingDelegation(ctx, ubd)) + resUnbond, err := keeper.GetUnbondingDelegation(ctx, delAddrs[0], valAddrs[0]) + require.NoError(err) require.Equal(ubd, resUnbond) // modify a records, save, and retrieve expUnbond := math.NewInt(21) ubd.Entries[0].Balance = expUnbond - keeper.SetUnbondingDelegation(ctx, ubd) + require.NoError(keeper.SetUnbondingDelegation(ctx, ubd)) - resUnbonds := keeper.GetUnbondingDelegations(ctx, delAddrs[0], 5) + resUnbonds, err := keeper.GetUnbondingDelegations(ctx, delAddrs[0], 5) + require.NoError(err) require.Equal(1, len(resUnbonds)) - resUnbonds = keeper.GetAllUnbondingDelegations(ctx, delAddrs[0]) + resUnbonds, err = keeper.GetAllUnbondingDelegations(ctx, delAddrs[0]) + require.NoError(err) require.Equal(1, len(resUnbonds)) - resUnbond, found = keeper.GetUnbondingDelegation(ctx, delAddrs[0], valAddrs[0]) - require.True(found) + resUnbond, err = keeper.GetUnbondingDelegation(ctx, delAddrs[0], valAddrs[0]) + require.NoError(err) require.Equal(ubd, resUnbond) - resDelUnbond := keeper.GetDelegatorUnbonding(ctx, delAddrs[0]) + resDelUnbond, err := keeper.GetDelegatorUnbonding(ctx, delAddrs[0]) + require.NoError(err) require.Equal(expUnbond, resDelUnbond) // delete a record - keeper.RemoveUnbondingDelegation(ctx, ubd) - _, found = keeper.GetUnbondingDelegation(ctx, delAddrs[0], valAddrs[0]) - require.False(found) + require.NoError(keeper.RemoveUnbondingDelegation(ctx, ubd)) + _, err = keeper.GetUnbondingDelegation(ctx, delAddrs[0], valAddrs[0]) + require.ErrorIs(err, stakingtypes.ErrNoUnbondingDelegation) - resUnbonds = keeper.GetUnbondingDelegations(ctx, delAddrs[0], 5) + resUnbonds, err = keeper.GetUnbondingDelegations(ctx, delAddrs[0], 5) + require.NoError(err) require.Equal(0, len(resUnbonds)) - resUnbonds = keeper.GetAllUnbondingDelegations(ctx, delAddrs[0]) + resUnbonds, err = keeper.GetAllUnbondingDelegations(ctx, delAddrs[0]) + require.NoError(err) require.Equal(0, len(resUnbonds)) } @@ -283,49 +308,57 @@ func (s *KeeperTestSuite) TestUnbondingDelegationsFromValidator() { valAddrs[0], 0, time.Unix(0, 0).UTC(), - sdk.NewInt(5), + math.NewInt(5), 0, + address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmos"), ) // set and retrieve a record - keeper.SetUnbondingDelegation(ctx, ubd) - resUnbond, found := keeper.GetUnbondingDelegation(ctx, delAddrs[0], valAddrs[0]) - require.True(found) + require.NoError(keeper.SetUnbondingDelegation(ctx, ubd)) + resUnbond, err := keeper.GetUnbondingDelegation(ctx, delAddrs[0], valAddrs[0]) + require.NoError(err) require.Equal(ubd, resUnbond) // modify a records, save, and retrieve - expUnbond := sdk.NewInt(21) + expUnbond := math.NewInt(21) ubd.Entries[0].Balance = expUnbond - keeper.SetUnbondingDelegation(ctx, ubd) + require.NoError(keeper.SetUnbondingDelegation(ctx, ubd)) - resUnbonds := keeper.GetUnbondingDelegations(ctx, delAddrs[0], 5) + resUnbonds, err := keeper.GetUnbondingDelegations(ctx, delAddrs[0], 5) + require.NoError(err) require.Equal(1, len(resUnbonds)) - resUnbonds = keeper.GetAllUnbondingDelegations(ctx, delAddrs[0]) + resUnbonds, err = keeper.GetAllUnbondingDelegations(ctx, delAddrs[0]) + require.NoError(err) require.Equal(1, len(resUnbonds)) - resUnbonds = keeper.GetUnbondingDelegationsFromValidator(ctx, valAddrs[0]) + resUnbonds, err = keeper.GetUnbondingDelegationsFromValidator(ctx, valAddrs[0]) + require.NoError(err) require.Equal(1, len(resUnbonds)) - resUnbond, found = keeper.GetUnbondingDelegation(ctx, delAddrs[0], valAddrs[0]) - require.True(found) + resUnbond, err = keeper.GetUnbondingDelegation(ctx, delAddrs[0], valAddrs[0]) + require.NoError(err) require.Equal(ubd, resUnbond) - resDelUnbond := keeper.GetDelegatorUnbonding(ctx, delAddrs[0]) + resDelUnbond, err := keeper.GetDelegatorUnbonding(ctx, delAddrs[0]) + require.NoError(err) require.Equal(expUnbond, resDelUnbond) // delete a record - keeper.RemoveUnbondingDelegation(ctx, ubd) - _, found = keeper.GetUnbondingDelegation(ctx, delAddrs[0], valAddrs[0]) - require.False(found) + require.NoError(keeper.RemoveUnbondingDelegation(ctx, ubd)) + _, err = keeper.GetUnbondingDelegation(ctx, delAddrs[0], valAddrs[0]) + require.ErrorIs(err, stakingtypes.ErrNoUnbondingDelegation) - resUnbonds = keeper.GetUnbondingDelegations(ctx, delAddrs[0], 5) + resUnbonds, err = keeper.GetUnbondingDelegations(ctx, delAddrs[0], 5) + require.NoError(err) require.Equal(0, len(resUnbonds)) - resUnbonds = keeper.GetAllUnbondingDelegations(ctx, delAddrs[0]) + resUnbonds, err = keeper.GetAllUnbondingDelegations(ctx, delAddrs[0]) + require.NoError(err) require.Equal(0, len(resUnbonds)) - resUnbonds = keeper.GetUnbondingDelegationsFromValidator(ctx, valAddrs[0]) + resUnbonds, err = keeper.GetUnbondingDelegationsFromValidator(ctx, valAddrs[0]) + require.NoError(err) require.Equal(0, len(resUnbonds)) } @@ -344,18 +377,18 @@ func (s *KeeperTestSuite) TestUnbondDelegation() { s.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), stakingtypes.NotBondedPoolName, stakingtypes.BondedPoolName, gomock.Any()) _ = stakingkeeper.TestingUpdateValidator(keeper, ctx, validator, true) - delegation := stakingtypes.NewDelegation(delAddrs[0], valAddrs[0], issuedShares) - keeper.SetDelegation(ctx, delegation) + delegation := stakingtypes.NewDelegation(delAddrs[0].String(), valAddrs[0].String(), issuedShares) + require.NoError(keeper.SetDelegation(ctx, delegation)) bondTokens := keeper.TokensFromConsensusPower(ctx, 6) amount, err := keeper.Unbond(ctx, delAddrs[0], valAddrs[0], math.LegacyNewDecFromInt(bondTokens)) require.NoError(err) require.Equal(bondTokens, amount) // shares to be added to an unbonding delegation - delegation, found := keeper.GetDelegation(ctx, delAddrs[0], valAddrs[0]) - require.True(found) - validator, found = keeper.GetValidator(ctx, valAddrs[0]) - require.True(found) + delegation, err = keeper.GetDelegation(ctx, delAddrs[0], valAddrs[0]) + require.NoError(err) + validator, err = keeper.GetValidator(ctx, valAddrs[0]) + require.NoError(err) remainingTokens := startTokens.Sub(bondTokens) @@ -381,21 +414,21 @@ func (s *KeeperTestSuite) TestUndelegateSelfDelegationBelowMinSelfDelegation() { s.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), stakingtypes.NotBondedPoolName, stakingtypes.BondedPoolName, gomock.Any()) validator = stakingkeeper.TestingUpdateValidator(keeper, ctx, validator, true) - keeper.SetValidatorByConsAddr(ctx, validator) + require.NoError(keeper.SetValidatorByConsAddr(ctx, validator)) require.True(validator.IsBonded()) - selfDelegation := stakingtypes.NewDelegation(sdk.AccAddress(addrVals[0].Bytes()), addrVals[0], issuedShares) - keeper.SetDelegation(ctx, selfDelegation) + selfDelegation := stakingtypes.NewDelegation(sdk.AccAddress(addrVals[0].Bytes()).String(), addrVals[0].String(), issuedShares) + require.NoError(keeper.SetDelegation(ctx, selfDelegation)) // create a second delegation to this validator - keeper.DeleteValidatorByPowerIndex(ctx, validator) + require.NoError(keeper.DeleteValidatorByPowerIndex(ctx, validator)) validator, issuedShares = validator.AddTokensFromDel(delTokens) require.True(validator.IsBonded()) require.Equal(delTokens, issuedShares.RoundInt()) validator = stakingkeeper.TestingUpdateValidator(keeper, ctx, validator, true) - delegation := stakingtypes.NewDelegation(addrDels[0], addrVals[0], issuedShares) - keeper.SetDelegation(ctx, delegation) + delegation := stakingtypes.NewDelegation(addrDels[0].String(), addrVals[0].String(), issuedShares) + require.NoError(keeper.SetDelegation(ctx, delegation)) val0AccAddr := sdk.AccAddress(addrVals[0].Bytes()) s.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), stakingtypes.BondedPoolName, stakingtypes.NotBondedPoolName, gomock.Any()) @@ -406,8 +439,8 @@ func (s *KeeperTestSuite) TestUndelegateSelfDelegationBelowMinSelfDelegation() { s.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), stakingtypes.BondedPoolName, stakingtypes.NotBondedPoolName, gomock.Any()) s.applyValidatorSetUpdates(ctx, keeper, 1) - validator, found := keeper.GetValidator(ctx, addrVals[0]) - require.True(found) + validator, err = keeper.GetValidator(ctx, addrVals[0]) + require.NoError(err) require.Equal(keeper.TokensFromConsensusPower(ctx, 14), validator.Tokens) require.Equal(stakingtypes.Unbonding, validator.Status) require.True(validator.Jailed) @@ -422,7 +455,7 @@ func (s *KeeperTestSuite) TestUndelegateFromUnbondingValidator() { // create a validator with a self-delegation validator := testutil.NewValidator(s.T(), addrVals[0], PKs[0]) - keeper.SetValidatorByConsAddr(ctx, validator) + require.NoError(keeper.SetValidatorByConsAddr(ctx, validator)) validator, issuedShares := validator.AddTokensFromDel(delTokens) require.Equal(delTokens, issuedShares.RoundInt()) @@ -431,18 +464,18 @@ func (s *KeeperTestSuite) TestUndelegateFromUnbondingValidator() { validator = stakingkeeper.TestingUpdateValidator(keeper, ctx, validator, true) require.True(validator.IsBonded()) - selfDelegation := stakingtypes.NewDelegation(addrVals[0].Bytes(), addrVals[0], issuedShares) - keeper.SetDelegation(ctx, selfDelegation) + selfDelegation := stakingtypes.NewDelegation(addrDels[0].String(), addrVals[0].String(), issuedShares) + require.NoError(keeper.SetDelegation(ctx, selfDelegation)) // create a second delegation to this validator - keeper.DeleteValidatorByPowerIndex(ctx, validator) + require.NoError(keeper.DeleteValidatorByPowerIndex(ctx, validator)) validator, issuedShares = validator.AddTokensFromDel(delTokens) require.Equal(delTokens, issuedShares.RoundInt()) stakingkeeper.TestingUpdateValidator(keeper, ctx, validator, true) - delegation := stakingtypes.NewDelegation(addrDels[1], addrVals[0], issuedShares) - keeper.SetDelegation(ctx, delegation) + delegation := stakingtypes.NewDelegation(addrDels[1].String(), addrVals[0].String(), issuedShares) + require.NoError(keeper.SetDelegation(ctx, delegation)) header := ctx.BlockHeader() blockHeight := int64(10) @@ -462,10 +495,11 @@ func (s *KeeperTestSuite) TestUndelegateFromUnbondingValidator() { s.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), stakingtypes.BondedPoolName, stakingtypes.NotBondedPoolName, gomock.Any()) s.applyValidatorSetUpdates(ctx, keeper, 1) - validator, found := keeper.GetValidator(ctx, addrVals[0]) - require.True(found) + validator, err = keeper.GetValidator(ctx, addrVals[0]) + require.NoError(err) require.Equal(blockHeight, validator.UnbondingHeight) - params := keeper.GetParams(ctx) + params, err := keeper.GetParams(ctx) + require.NoError(err) require.True(blockTime.Add(params.UnbondingTime).Equal(validator.UnbondingTime)) blockHeight2 := int64(20) @@ -480,8 +514,8 @@ func (s *KeeperTestSuite) TestUndelegateFromUnbondingValidator() { require.Equal(math.LegacyNewDecFromInt(undelegatedAmount), undelegateAmount) // retrieve the unbonding delegation - ubd, found := keeper.GetUnbondingDelegation(ctx, addrDels[1], addrVals[0]) - require.True(found) + ubd, err := keeper.GetUnbondingDelegation(ctx, addrDels[1], addrVals[0]) + require.NoError(err) require.Len(ubd.Entries, 1) require.True(ubd.Entries[0].Balance.Equal(math.NewInt(6))) require.Equal(blockHeight2, ubd.Entries[0].CreationHeight) @@ -497,7 +531,7 @@ func (s *KeeperTestSuite) TestUndelegateFromUnbondedValidator() { // create a validator with a self-delegation validator := testutil.NewValidator(s.T(), addrVals[0], PKs[0]) - keeper.SetValidatorByConsAddr(ctx, validator) + require.NoError(keeper.SetValidatorByConsAddr(ctx, validator)) valTokens := keeper.TokensFromConsensusPower(ctx, 10) validator, issuedShares := validator.AddTokensFromDel(valTokens) @@ -507,17 +541,17 @@ func (s *KeeperTestSuite) TestUndelegateFromUnbondedValidator() { require.True(validator.IsBonded()) val0AccAddr := sdk.AccAddress(addrVals[0]) - selfDelegation := stakingtypes.NewDelegation(val0AccAddr, addrVals[0], issuedShares) - keeper.SetDelegation(ctx, selfDelegation) + selfDelegation := stakingtypes.NewDelegation(val0AccAddr.String(), addrVals[0].String(), issuedShares) + require.NoError(keeper.SetDelegation(ctx, selfDelegation)) // create a second delegation to this validator - keeper.DeleteValidatorByPowerIndex(ctx, validator) + require.NoError(keeper.DeleteValidatorByPowerIndex(ctx, validator)) validator, issuedShares = validator.AddTokensFromDel(delTokens) require.Equal(delTokens, issuedShares.RoundInt()) validator = stakingkeeper.TestingUpdateValidator(keeper, ctx, validator, true) require.True(validator.IsBonded()) - delegation := stakingtypes.NewDelegation(addrDels[1], addrVals[0], issuedShares) - keeper.SetDelegation(ctx, delegation) + delegation := stakingtypes.NewDelegation(addrDels[1].String(), addrVals[0].String(), issuedShares) + require.NoError(keeper.SetDelegation(ctx, delegation)) ctx = ctx.WithBlockHeight(10) ctx = ctx.WithBlockTime(time.Unix(333, 0)) @@ -532,19 +566,21 @@ func (s *KeeperTestSuite) TestUndelegateFromUnbondedValidator() { s.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), stakingtypes.BondedPoolName, stakingtypes.NotBondedPoolName, gomock.Any()) s.applyValidatorSetUpdates(ctx, keeper, 1) - validator, found := keeper.GetValidator(ctx, addrVals[0]) - require.True(found) + validator, err = keeper.GetValidator(ctx, addrVals[0]) + require.NoError(err) require.Equal(ctx.BlockHeight(), validator.UnbondingHeight) - params := keeper.GetParams(ctx) + params, err := keeper.GetParams(ctx) + require.NoError(err) require.True(ctx.BlockHeader().Time.Add(params.UnbondingTime).Equal(validator.UnbondingTime)) // unbond the validator ctx = ctx.WithBlockTime(validator.UnbondingTime) - keeper.UnbondAllMatureValidators(ctx) + err = keeper.UnbondAllMatureValidators(ctx) + require.NoError(err) // Make sure validator is still in state because there is still an outstanding delegation - validator, found = keeper.GetValidator(ctx, addrVals[0]) - require.True(found) + validator, err = keeper.GetValidator(ctx, addrVals[0]) + require.NoError(err) require.Equal(validator.Status, stakingtypes.Unbonded) // unbond some of the other delegation's shares @@ -560,8 +596,8 @@ func (s *KeeperTestSuite) TestUndelegateFromUnbondedValidator() { require.Equal(amount3, remainingTokens) // now validator should be deleted from state - validator, found = keeper.GetValidator(ctx, addrVals[0]) - require.False(found, "%v", validator) + validator, err = keeper.GetValidator(ctx, addrVals[0]) + require.ErrorIs(err, stakingtypes.ErrNoValidatorFound) } func (s *KeeperTestSuite) TestUnbondingAllDelegationFromValidator() { @@ -573,7 +609,7 @@ func (s *KeeperTestSuite) TestUnbondingAllDelegationFromValidator() { // create a validator with a self-delegation validator := testutil.NewValidator(s.T(), addrVals[0], PKs[0]) - keeper.SetValidatorByConsAddr(ctx, validator) + require.NoError(keeper.SetValidatorByConsAddr(ctx, validator)) valTokens := keeper.TokensFromConsensusPower(ctx, 10) validator, issuedShares := validator.AddTokensFromDel(valTokens) @@ -584,19 +620,19 @@ func (s *KeeperTestSuite) TestUnbondingAllDelegationFromValidator() { require.True(validator.IsBonded()) val0AccAddr := sdk.AccAddress(addrVals[0].Bytes()) - selfDelegation := stakingtypes.NewDelegation(val0AccAddr, addrVals[0], issuedShares) - keeper.SetDelegation(ctx, selfDelegation) + selfDelegation := stakingtypes.NewDelegation(val0AccAddr.String(), addrVals[0].String(), issuedShares) + require.NoError(keeper.SetDelegation(ctx, selfDelegation)) // create a second delegation to this validator - keeper.DeleteValidatorByPowerIndex(ctx, validator) + require.NoError(keeper.DeleteValidatorByPowerIndex(ctx, validator)) validator, issuedShares = validator.AddTokensFromDel(delTokens) require.Equal(delTokens, issuedShares.RoundInt()) validator = stakingkeeper.TestingUpdateValidator(keeper, ctx, validator, true) require.True(validator.IsBonded()) - delegation := stakingtypes.NewDelegation(addrDels[1], addrVals[0], issuedShares) - keeper.SetDelegation(ctx, delegation) + delegation := stakingtypes.NewDelegation(addrDels[1].String(), addrVals[0].String(), issuedShares) + require.NoError(keeper.SetDelegation(ctx, delegation)) ctx = ctx.WithBlockHeight(10) ctx = ctx.WithBlockTime(time.Unix(333, 0)) @@ -617,17 +653,18 @@ func (s *KeeperTestSuite) TestUnbondingAllDelegationFromValidator() { require.Equal(amount2, delTokens) // validator should still be in state and still be in unbonding state - validator, found := keeper.GetValidator(ctx, addrVals[0]) - require.True(found) + validator, err = keeper.GetValidator(ctx, addrVals[0]) + require.NoError(err) require.Equal(validator.Status, stakingtypes.Unbonding) // unbond the validator ctx = ctx.WithBlockTime(validator.UnbondingTime) - keeper.UnbondAllMatureValidators(ctx) + err = keeper.UnbondAllMatureValidators(ctx) + require.NoError(err) // validator should now be deleted from state - _, found = keeper.GetValidator(ctx, addrVals[0]) - require.False(found) + _, err = keeper.GetValidator(ctx, addrVals[0]) + require.ErrorIs(err, stakingtypes.ErrNoValidatorFound) } // Make sure that that the retrieving the delegations doesn't affect the state @@ -639,20 +676,23 @@ func (s *KeeperTestSuite) TestGetRedelegationsFromSrcValidator() { rd := stakingtypes.NewRedelegation(addrDels[0], addrVals[0], addrVals[1], 0, time.Unix(0, 0), math.NewInt(5), - math.LegacyNewDec(5), 0) + math.LegacyNewDec(5), 0, address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmos")) // set and retrieve a record - keeper.SetRedelegation(ctx, rd) - resBond, found := keeper.GetRedelegation(ctx, addrDels[0], addrVals[0], addrVals[1]) - require.True(found) + err := keeper.SetRedelegation(ctx, rd) + require.NoError(err) + resBond, err := keeper.GetRedelegation(ctx, addrDels[0], addrVals[0], addrVals[1]) + require.NoError(err) // get the redelegations one time - redelegations := keeper.GetRedelegationsFromSrcValidator(ctx, addrVals[0]) + redelegations, err := keeper.GetRedelegationsFromSrcValidator(ctx, addrVals[0]) + require.NoError(err) require.Equal(1, len(redelegations)) require.Equal(redelegations[0], resBond) // get the redelegations a second time, should be exactly the same - redelegations = keeper.GetRedelegationsFromSrcValidator(ctx, addrVals[0]) + redelegations, err = keeper.GetRedelegationsFromSrcValidator(ctx, addrVals[0]) + require.NoError(err) require.Equal(1, len(redelegations)) require.Equal(redelegations[0], resBond) } @@ -666,58 +706,70 @@ func (s *KeeperTestSuite) TestRedelegation() { rd := stakingtypes.NewRedelegation(addrDels[0], addrVals[0], addrVals[1], 0, time.Unix(0, 0).UTC(), math.NewInt(5), - math.LegacyNewDec(5), 0) + math.LegacyNewDec(5), 0, address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmos")) // test shouldn't have and redelegations - has := keeper.HasReceivingRedelegation(ctx, addrDels[0], addrVals[1]) + has, err := keeper.HasReceivingRedelegation(ctx, addrDels[0], addrVals[1]) + require.NoError(err) require.False(has) // set and retrieve a record - keeper.SetRedelegation(ctx, rd) - resRed, found := keeper.GetRedelegation(ctx, addrDels[0], addrVals[0], addrVals[1]) - require.True(found) + err = keeper.SetRedelegation(ctx, rd) + require.NoError(err) + resRed, err := keeper.GetRedelegation(ctx, addrDels[0], addrVals[0], addrVals[1]) + require.NoError(err) - redelegations := keeper.GetRedelegationsFromSrcValidator(ctx, addrVals[0]) + redelegations, err := keeper.GetRedelegationsFromSrcValidator(ctx, addrVals[0]) + require.NoError(err) require.Equal(1, len(redelegations)) require.Equal(redelegations[0], resRed) - redelegations = keeper.GetRedelegations(ctx, addrDels[0], 5) + redelegations, err = keeper.GetRedelegations(ctx, addrDels[0], 5) + require.NoError(err) require.Equal(1, len(redelegations)) require.Equal(redelegations[0], resRed) - redelegations = keeper.GetAllRedelegations(ctx, addrDels[0], nil, nil) + redelegations, err = keeper.GetAllRedelegations(ctx, addrDels[0], nil, nil) + require.NoError(err) require.Equal(1, len(redelegations)) require.Equal(redelegations[0], resRed) // check if has the redelegation - has = keeper.HasReceivingRedelegation(ctx, addrDels[0], addrVals[1]) + has, err = keeper.HasReceivingRedelegation(ctx, addrDels[0], addrVals[1]) + require.NoError(err) require.True(has) // modify a records, save, and retrieve rd.Entries[0].SharesDst = math.LegacyNewDec(21) - keeper.SetRedelegation(ctx, rd) + err = keeper.SetRedelegation(ctx, rd) + require.NoError(err) - resRed, found = keeper.GetRedelegation(ctx, addrDels[0], addrVals[0], addrVals[1]) - require.True(found) + resRed, err = keeper.GetRedelegation(ctx, addrDels[0], addrVals[0], addrVals[1]) + require.NoError(err) require.Equal(rd, resRed) - redelegations = keeper.GetRedelegationsFromSrcValidator(ctx, addrVals[0]) + redelegations, err = keeper.GetRedelegationsFromSrcValidator(ctx, addrVals[0]) + require.NoError(err) require.Equal(1, len(redelegations)) require.Equal(redelegations[0], resRed) - redelegations = keeper.GetRedelegations(ctx, addrDels[0], 5) + redelegations, err = keeper.GetRedelegations(ctx, addrDels[0], 5) + require.NoError(err) require.Equal(1, len(redelegations)) require.Equal(redelegations[0], resRed) // delete a record - keeper.RemoveRedelegation(ctx, rd) - _, found = keeper.GetRedelegation(ctx, addrDels[0], addrVals[0], addrVals[1]) - require.False(found) + err = keeper.RemoveRedelegation(ctx, rd) + require.NoError(err) + _, err = keeper.GetRedelegation(ctx, addrDels[0], addrVals[0], addrVals[1]) + require.ErrorIs(err, stakingtypes.ErrNoRedelegation) - redelegations = keeper.GetRedelegations(ctx, addrDels[0], 5) + redelegations, err = keeper.GetRedelegations(ctx, addrDels[0], 5) + require.NoError(err) require.Equal(0, len(redelegations)) - redelegations = keeper.GetAllRedelegations(ctx, addrDels[0], nil, nil) + redelegations, err = keeper.GetAllRedelegations(ctx, addrDels[0], nil, nil) + require.NoError(err) require.Equal(0, len(redelegations)) } @@ -739,8 +791,8 @@ func (s *KeeperTestSuite) TestRedelegateToSameValidator() { val0AccAddr := sdk.AccAddress(addrVals[0].Bytes()) - selfDelegation := stakingtypes.NewDelegation(val0AccAddr, addrVals[0], issuedShares) - keeper.SetDelegation(ctx, selfDelegation) + selfDelegation := stakingtypes.NewDelegation(val0AccAddr.String(), addrVals[0].String(), issuedShares) + require.NoError(keeper.SetDelegation(ctx, selfDelegation)) _, err := keeper.BeginRedelegation(ctx, val0AccAddr, addrVals[0], addrVals[0], math.LegacyNewDec(5)) require.Error(err) @@ -761,8 +813,8 @@ func (s *KeeperTestSuite) TestRedelegationMaxEntries() { s.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), stakingtypes.NotBondedPoolName, stakingtypes.BondedPoolName, gomock.Any()) _ = stakingkeeper.TestingUpdateValidator(keeper, ctx, validator, true) val0AccAddr := sdk.AccAddress(addrVals[0].Bytes()) - selfDelegation := stakingtypes.NewDelegation(val0AccAddr, addrVals[0], issuedShares) - keeper.SetDelegation(ctx, selfDelegation) + selfDelegation := stakingtypes.NewDelegation(val0AccAddr.String(), addrVals[0].String(), issuedShares) + require.NoError(keeper.SetDelegation(ctx, selfDelegation)) // create a second validator validator2 := testutil.NewValidator(s.T(), addrVals[1], PKs[1]) @@ -773,7 +825,8 @@ func (s *KeeperTestSuite) TestRedelegationMaxEntries() { validator2 = stakingkeeper.TestingUpdateValidator(keeper, ctx, validator2, true) require.Equal(stakingtypes.Bonded, validator2.Status) - maxEntries := keeper.MaxEntries(ctx) + maxEntries, err := keeper.MaxEntries(ctx) + require.NoError(err) // redelegations should pass var completionTime time.Time @@ -784,7 +837,7 @@ func (s *KeeperTestSuite) TestRedelegationMaxEntries() { } // an additional redelegation should fail due to max entries - _, err := keeper.BeginRedelegation(ctx, val0AccAddr, addrVals[0], addrVals[1], math.LegacyNewDec(1)) + _, err = keeper.BeginRedelegation(ctx, val0AccAddr, addrVals[0], addrVals[1], math.LegacyNewDec(1)) require.Error(err) // mature redelegations @@ -805,7 +858,7 @@ func (s *KeeperTestSuite) TestRedelegateSelfDelegation() { // create a validator with a self-delegation validator := testutil.NewValidator(s.T(), addrVals[0], PKs[0]) - keeper.SetValidatorByConsAddr(ctx, validator) + require.NoError(keeper.SetValidatorByConsAddr(ctx, validator)) valTokens := keeper.TokensFromConsensusPower(ctx, 10) validator, issuedShares := validator.AddTokensFromDel(valTokens) @@ -815,8 +868,8 @@ func (s *KeeperTestSuite) TestRedelegateSelfDelegation() { validator = stakingkeeper.TestingUpdateValidator(keeper, ctx, validator, true) val0AccAddr := sdk.AccAddress(addrVals[0]) - selfDelegation := stakingtypes.NewDelegation(val0AccAddr, addrVals[0], issuedShares) - keeper.SetDelegation(ctx, selfDelegation) + selfDelegation := stakingtypes.NewDelegation(val0AccAddr.String(), addrVals[0].String(), issuedShares) + require.NoError(keeper.SetDelegation(ctx, selfDelegation)) // create a second validator validator2 := testutil.NewValidator(s.T(), addrVals[1], PKs[1]) @@ -832,8 +885,8 @@ func (s *KeeperTestSuite) TestRedelegateSelfDelegation() { require.Equal(delTokens, issuedShares.RoundInt()) stakingkeeper.TestingUpdateValidator(keeper, ctx, validator, true) - delegation := stakingtypes.NewDelegation(addrDels[0], addrVals[0], issuedShares) - keeper.SetDelegation(ctx, delegation) + delegation := stakingtypes.NewDelegation(addrDels[0].String(), addrVals[0].String(), issuedShares) + require.NoError(keeper.SetDelegation(ctx, delegation)) _, err := keeper.BeginRedelegation(ctx, val0AccAddr, addrVals[0], addrVals[1], math.LegacyNewDecFromInt(delTokens)) require.NoError(err) @@ -842,8 +895,8 @@ func (s *KeeperTestSuite) TestRedelegateSelfDelegation() { s.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), stakingtypes.BondedPoolName, stakingtypes.NotBondedPoolName, gomock.Any()) s.applyValidatorSetUpdates(ctx, keeper, 2) - validator, found := keeper.GetValidator(ctx, addrVals[0]) - require.True(found) + validator, err = keeper.GetValidator(ctx, addrVals[0]) + require.NoError(err) require.Equal(valTokens, validator.Tokens) require.Equal(stakingtypes.Unbonding, validator.Status) } @@ -856,7 +909,7 @@ func (s *KeeperTestSuite) TestRedelegateFromUnbondingValidator() { // create a validator with a self-delegation validator := testutil.NewValidator(s.T(), addrVals[0], PKs[0]) - keeper.SetValidatorByConsAddr(ctx, validator) + require.NoError(keeper.SetValidatorByConsAddr(ctx, validator)) valTokens := keeper.TokensFromConsensusPower(ctx, 10) validator, issuedShares := validator.AddTokensFromDel(valTokens) @@ -864,17 +917,17 @@ func (s *KeeperTestSuite) TestRedelegateFromUnbondingValidator() { s.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), stakingtypes.NotBondedPoolName, stakingtypes.BondedPoolName, gomock.Any()) validator = stakingkeeper.TestingUpdateValidator(keeper, ctx, validator, true) val0AccAddr := sdk.AccAddress(addrVals[0].Bytes()) - selfDelegation := stakingtypes.NewDelegation(val0AccAddr, addrVals[0], issuedShares) - keeper.SetDelegation(ctx, selfDelegation) + selfDelegation := stakingtypes.NewDelegation(val0AccAddr.String(), addrVals[0].String(), issuedShares) + require.NoError(keeper.SetDelegation(ctx, selfDelegation)) // create a second delegation to this validator - keeper.DeleteValidatorByPowerIndex(ctx, validator) + require.NoError(keeper.DeleteValidatorByPowerIndex(ctx, validator)) delTokens := keeper.TokensFromConsensusPower(ctx, 10) validator, issuedShares = validator.AddTokensFromDel(delTokens) require.Equal(delTokens, issuedShares.RoundInt()) stakingkeeper.TestingUpdateValidator(keeper, ctx, validator, true) - delegation := stakingtypes.NewDelegation(addrDels[1], addrVals[0], issuedShares) - keeper.SetDelegation(ctx, delegation) + delegation := stakingtypes.NewDelegation(addrDels[1].String(), addrVals[0].String(), issuedShares) + require.NoError(keeper.SetDelegation(ctx, delegation)) // create a second validator validator2 := testutil.NewValidator(s.T(), addrVals[1], PKs[1]) @@ -900,10 +953,11 @@ func (s *KeeperTestSuite) TestRedelegateFromUnbondingValidator() { s.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), stakingtypes.BondedPoolName, stakingtypes.NotBondedPoolName, gomock.Any()) s.applyValidatorSetUpdates(ctx, keeper, 1) - validator, found := keeper.GetValidator(ctx, addrVals[0]) - require.True(found) + validator, err = keeper.GetValidator(ctx, addrVals[0]) + require.NoError(err) require.Equal(blockHeight, validator.UnbondingHeight) - params := keeper.GetParams(ctx) + params, err := keeper.GetParams(ctx) + require.NoError(err) require.True(blockTime.Add(params.UnbondingTime).Equal(validator.UnbondingTime)) // change the context @@ -921,8 +975,8 @@ func (s *KeeperTestSuite) TestRedelegateFromUnbondingValidator() { require.NoError(err) // retrieve the unbonding delegation - ubd, found := keeper.GetRedelegation(ctx, addrDels[1], addrVals[0], addrVals[1]) - require.True(found) + ubd, err := keeper.GetRedelegation(ctx, addrDels[1], addrVals[0], addrVals[1]) + require.NoError(err) require.Len(ubd.Entries, 1) require.Equal(blockHeight, ubd.Entries[0].CreationHeight) require.True(blockTime.Add(params.UnbondingTime).Equal(ubd.Entries[0].CompletionTime)) @@ -936,7 +990,7 @@ func (s *KeeperTestSuite) TestRedelegateFromUnbondedValidator() { // create a validator with a self-delegation validator := testutil.NewValidator(s.T(), addrVals[0], PKs[0]) - keeper.SetValidatorByConsAddr(ctx, validator) + require.NoError(keeper.SetValidatorByConsAddr(ctx, validator)) valTokens := keeper.TokensFromConsensusPower(ctx, 10) validator, issuedShares := validator.AddTokensFromDel(valTokens) @@ -944,17 +998,17 @@ func (s *KeeperTestSuite) TestRedelegateFromUnbondedValidator() { s.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), stakingtypes.NotBondedPoolName, stakingtypes.BondedPoolName, gomock.Any()) validator = stakingkeeper.TestingUpdateValidator(keeper, ctx, validator, true) val0AccAddr := sdk.AccAddress(addrVals[0].Bytes()) - selfDelegation := stakingtypes.NewDelegation(val0AccAddr, addrVals[0], issuedShares) - keeper.SetDelegation(ctx, selfDelegation) + selfDelegation := stakingtypes.NewDelegation(val0AccAddr.String(), addrVals[0].String(), issuedShares) + require.NoError(keeper.SetDelegation(ctx, selfDelegation)) // create a second delegation to this validator - keeper.DeleteValidatorByPowerIndex(ctx, validator) + require.NoError(keeper.DeleteValidatorByPowerIndex(ctx, validator)) delTokens := keeper.TokensFromConsensusPower(ctx, 10) validator, issuedShares = validator.AddTokensFromDel(delTokens) require.Equal(delTokens, issuedShares.RoundInt()) stakingkeeper.TestingUpdateValidator(keeper, ctx, validator, true) - delegation := stakingtypes.NewDelegation(addrDels[1], addrVals[0], issuedShares) - keeper.SetDelegation(ctx, delegation) + delegation := stakingtypes.NewDelegation(addrDels[1].String(), addrVals[0].String(), issuedShares) + require.NoError(keeper.SetDelegation(ctx, delegation)) // create a second validator validator2 := testutil.NewValidator(s.T(), addrVals[1], PKs[1]) @@ -977,14 +1031,16 @@ func (s *KeeperTestSuite) TestRedelegateFromUnbondedValidator() { s.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), stakingtypes.BondedPoolName, stakingtypes.NotBondedPoolName, gomock.Any()) s.applyValidatorSetUpdates(ctx, keeper, 1) - validator, found := keeper.GetValidator(ctx, addrVals[0]) - require.True(found) + validator, err = keeper.GetValidator(ctx, addrVals[0]) + require.NoError(err) require.Equal(ctx.BlockHeight(), validator.UnbondingHeight) - params := keeper.GetParams(ctx) + params, err := keeper.GetParams(ctx) + require.NoError(err) require.True(ctx.BlockHeader().Time.Add(params.UnbondingTime).Equal(validator.UnbondingTime)) // unbond the validator - keeper.UnbondingToUnbonded(ctx, validator) + _, err = keeper.UnbondingToUnbonded(ctx, validator) + require.NoError(err) // redelegate some of the delegation's shares redelegationTokens := keeper.TokensFromConsensusPower(ctx, 6) @@ -993,8 +1049,8 @@ func (s *KeeperTestSuite) TestRedelegateFromUnbondedValidator() { require.NoError(err) // no red should have been found - red, found := keeper.GetRedelegation(ctx, addrDels[0], addrVals[0], addrVals[1]) - require.False(found, "%v", red) + red, err := keeper.GetRedelegation(ctx, addrDels[0], addrVals[0], addrVals[1]) + require.ErrorIs(err, stakingtypes.ErrNoRedelegation, "%v", red) } func (s *KeeperTestSuite) TestUnbondingDelegationAddEntry() { @@ -1012,6 +1068,7 @@ func (s *KeeperTestSuite) TestUnbondingDelegationAddEntry() { time.Unix(0, 0).UTC(), math.NewInt(10), 0, + address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmos"), ) var initialEntries []stakingtypes.UnbondingDelegationEntry initialEntries = append(initialEntries, ubd.Entries...) @@ -1053,12 +1110,13 @@ func (s *KeeperTestSuite) TestSetUnbondingDelegationEntry() { time.Unix(0, 0).UTC(), math.NewInt(5), 0, + address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmos"), ) // set and retrieve a record - keeper.SetUnbondingDelegation(ctx, ubd) - resUnbond, found := keeper.GetUnbondingDelegation(ctx, delAddr, valAddr) - require.True(found) + require.NoError(keeper.SetUnbondingDelegation(ctx, ubd)) + resUnbond, err := keeper.GetUnbondingDelegation(ctx, delAddr, valAddr) + require.NoError(err) require.Equal(ubd, resUnbond) initialEntries := ubd.Entries @@ -1068,7 +1126,7 @@ func (s *KeeperTestSuite) TestSetUnbondingDelegationEntry() { // set unbonding delegation entry for existing creationHeight // entries are expected to be merged - keeper.SetUnbondingDelegationEntry( + _, err = keeper.SetUnbondingDelegationEntry( ctx, delAddr, valAddr, @@ -1076,8 +1134,9 @@ func (s *KeeperTestSuite) TestSetUnbondingDelegationEntry() { time.Unix(0, 0).UTC(), math.NewInt(5), ) - resUnbonding, found := keeper.GetUnbondingDelegation(ctx, delAddr, valAddr) - require.True(found) + require.NoError(err) + resUnbonding, err := keeper.GetUnbondingDelegation(ctx, delAddr, valAddr) + require.NoError(err) require.Len(resUnbonding.Entries, 1) require.NotEqual(initialEntries, resUnbonding.Entries) require.Equal(creationHeight, resUnbonding.Entries[0].CreationHeight) @@ -1087,7 +1146,7 @@ func (s *KeeperTestSuite) TestSetUnbondingDelegationEntry() { // set unbonding delegation entry for newCreationHeight // new entry is expected to be appended to the existing entries newCreationHeight := int64(1) - keeper.SetUnbondingDelegationEntry( + _, err = keeper.SetUnbondingDelegationEntry( ctx, delAddr, valAddr, @@ -1095,8 +1154,9 @@ func (s *KeeperTestSuite) TestSetUnbondingDelegationEntry() { time.Unix(1, 0).UTC(), math.NewInt(10), ) - resUnbonding, found = keeper.GetUnbondingDelegation(ctx, delAddr, valAddr) - require.True(found) + require.NoError(err) + resUnbonding, err = keeper.GetUnbondingDelegation(ctx, delAddr, valAddr) + require.NoError(err) require.Len(resUnbonding.Entries, 2) require.NotEqual(initialEntries, resUnbonding.Entries) require.NotEqual(resUnbonding.Entries[0], resUnbonding.Entries[1]) diff --git a/x/staking/keeper/genesis.go b/x/staking/keeper/genesis.go index 85dc5e9e9bc2..738614ab8613 100644 --- a/x/staking/keeper/genesis.go +++ b/x/staking/keeper/genesis.go @@ -1,6 +1,7 @@ package keeper import ( + "context" "fmt" abci "github.com/cometbft/cometbft/abci/types" @@ -16,7 +17,7 @@ import ( // setting the indexes. In addition, it also sets any delegations found in // data. Finally, it updates the bonded validators. // Returns final validator set after applying all declaration and delegations -func (k Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState) (res []abci.ValidatorUpdate) { +func (k Keeper) InitGenesis(ctx context.Context, data *types.GenesisState) (res []abci.ValidatorUpdate) { bondedTokens := math.ZeroInt() notBondedTokens := math.ZeroInt() @@ -25,30 +26,48 @@ func (k Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState) (res []ab // initialized for the validator set e.g. with a one-block offset - the // first TM block is at height 1, so state updates applied from // genesis.json are in block 0. - ctx = ctx.WithBlockHeight(1 - sdk.ValidatorUpdateDelay) + sdkCtx := sdk.UnwrapSDKContext(ctx) + sdkCtx = sdkCtx.WithBlockHeight(1 - sdk.ValidatorUpdateDelay) + ctx = sdkCtx if err := k.SetParams(ctx, data.Params); err != nil { panic(err) } - k.SetLastTotalPower(ctx, data.LastTotalPower) + + if err := k.SetLastTotalPower(ctx, data.LastTotalPower); err != nil { + panic(err) + } for _, validator := range data.Validators { - k.SetValidator(ctx, validator) + if err := k.SetValidator(ctx, validator); err != nil { + panic(err) + } // Manually set indices for the first time - k.SetValidatorByConsAddr(ctx, validator) - k.SetValidatorByPowerIndex(ctx, validator) + if err := k.SetValidatorByConsAddr(ctx, validator); err != nil { + panic(err) + } + + if err := k.SetValidatorByPowerIndex(ctx, validator); err != nil { + panic(err) + } // Call the creation hook if not exported if !data.Exported { - if err := k.Hooks().AfterValidatorCreated(ctx, validator.GetOperator()); err != nil { + valbz, err := k.ValidatorAddressCodec().StringToBytes(validator.GetOperator()) + if err != nil { + panic(err) + } + if err := k.Hooks().AfterValidatorCreated(ctx, valbz); err != nil { panic(err) } } // update timeslice if necessary if validator.IsUnbonding() { - k.InsertUnbondingValidatorQueue(ctx, validator) + if err := k.InsertUnbondingValidatorQueue(ctx, validator); err != nil { + panic(err) + } } switch validator.GetStatus() { @@ -69,37 +88,52 @@ func (k Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState) (res []ab panic(fmt.Errorf("invalid delegator address: %s", err)) } + valAddr, err := k.validatorAddressCodec.StringToBytes(delegation.GetValidatorAddr()) + if err != nil { + panic(err) + } + // Call the before-creation hook if not exported if !data.Exported { - if err := k.Hooks().BeforeDelegationCreated(ctx, delegatorAddress, delegation.GetValidatorAddr()); err != nil { + if err := k.Hooks().BeforeDelegationCreated(ctx, delegatorAddress, valAddr); err != nil { panic(err) } } - k.SetDelegation(ctx, delegation) + if err := k.SetDelegation(ctx, delegation); err != nil { + panic(err) + } // Call the after-modification hook if not exported if !data.Exported { - if err := k.Hooks().AfterDelegationModified(ctx, delegatorAddress, delegation.GetValidatorAddr()); err != nil { + if err := k.Hooks().AfterDelegationModified(ctx, delegatorAddress, valAddr); err != nil { panic(err) } } } for _, ubd := range data.UnbondingDelegations { - k.SetUnbondingDelegation(ctx, ubd) + if err := k.SetUnbondingDelegation(ctx, ubd); err != nil { + panic(err) + } for _, entry := range ubd.Entries { - k.InsertUBDQueue(ctx, ubd, entry.CompletionTime) + if err := k.InsertUBDQueue(ctx, ubd, entry.CompletionTime); err != nil { + panic(err) + } notBondedTokens = notBondedTokens.Add(entry.Balance) } } for _, red := range data.Redelegations { - k.SetRedelegation(ctx, red) + if err := k.SetRedelegation(ctx, red); err != nil { + panic(err) + } for _, entry := range red.Entries { - k.InsertRedelegationQueue(ctx, red, entry.CompletionTime) + if err := k.InsertRedelegationQueue(ctx, red, entry.CompletionTime); err != nil { + panic(err) + } } } @@ -143,15 +177,18 @@ func (k Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState) (res []ab // don't need to run CometBFT updates if we exported if data.Exported { for _, lv := range data.LastValidatorPowers { - valAddr, err := sdk.ValAddressFromBech32(lv.Address) + valAddr, err := k.validatorAddressCodec.StringToBytes(lv.Address) if err != nil { panic(err) } - k.SetLastValidatorPower(ctx, valAddr, lv.Power) - validator, found := k.GetValidator(ctx, valAddr) + err = k.SetLastValidatorPower(ctx, valAddr, lv.Power) + if err != nil { + panic(err) + } - if !found { + validator, err := k.GetValidator(ctx, valAddr) + if err != nil { panic(fmt.Sprintf("validator %s not found", lv.Address)) } @@ -177,31 +214,64 @@ func (k Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState) (res []ab func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { var unbondingDelegations []types.UnbondingDelegation - k.IterateUnbondingDelegations(ctx, func(_ int64, ubd types.UnbondingDelegation) (stop bool) { + err := k.IterateUnbondingDelegations(ctx, func(_ int64, ubd types.UnbondingDelegation) (stop bool) { unbondingDelegations = append(unbondingDelegations, ubd) return false }) + if err != nil { + panic(err) + } var redelegations []types.Redelegation - k.IterateRedelegations(ctx, func(_ int64, red types.Redelegation) (stop bool) { + err = k.IterateRedelegations(ctx, func(_ int64, red types.Redelegation) (stop bool) { redelegations = append(redelegations, red) return false }) + if err != nil { + panic(err) + } var lastValidatorPowers []types.LastValidatorPower - k.IterateLastValidatorPowers(ctx, func(addr sdk.ValAddress, power int64) (stop bool) { - lastValidatorPowers = append(lastValidatorPowers, types.LastValidatorPower{Address: addr.String(), Power: power}) + err = k.IterateLastValidatorPowers(ctx, func(addr sdk.ValAddress, power int64) (stop bool) { + addrStr, err := k.validatorAddressCodec.BytesToString(addr) + if err != nil { + panic(err) + } + lastValidatorPowers = append(lastValidatorPowers, types.LastValidatorPower{Address: addrStr, Power: power}) return false }) + if err != nil { + panic(err) + } + + params, err := k.GetParams(ctx) + if err != nil { + panic(err) + } + + totalPower, err := k.GetLastTotalPower(ctx) + if err != nil { + panic(err) + } + + allDelegations, err := k.GetAllDelegations(ctx) + if err != nil { + panic(err) + } + + allValidators, err := k.GetAllValidators(ctx) + if err != nil { + panic(err) + } return &types.GenesisState{ - Params: k.GetParams(ctx), - LastTotalPower: k.GetLastTotalPower(ctx), + Params: params, + LastTotalPower: totalPower, LastValidatorPowers: lastValidatorPowers, - Validators: k.GetAllValidators(ctx), - Delegations: k.GetAllDelegations(ctx), + Validators: allValidators, + Delegations: allDelegations, UnbondingDelegations: unbondingDelegations, Redelegations: redelegations, Exported: true, diff --git a/x/staking/keeper/grpc_query.go b/x/staking/keeper/grpc_query.go index 482be95055e9..890ca859c12b 100644 --- a/x/staking/keeper/grpc_query.go +++ b/x/staking/keeper/grpc_query.go @@ -10,6 +10,7 @@ import ( "cosmossdk.io/store/prefix" storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/runtime" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -27,7 +28,7 @@ func NewQuerier(keeper *Keeper) Querier { } // Validators queries all validators that match the given status -func (k Querier) Validators(c context.Context, req *types.QueryValidatorsRequest) (*types.QueryValidatorsResponse, error) { +func (k Querier) Validators(ctx context.Context, req *types.QueryValidatorsRequest) (*types.QueryValidatorsResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -37,9 +38,7 @@ func (k Querier) Validators(c context.Context, req *types.QueryValidatorsRequest return nil, status.Errorf(codes.InvalidArgument, "invalid validator status %s", req.Status) } - ctx := sdk.UnwrapSDKContext(c) - - store := ctx.KVStore(k.storeKey) + store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) valStore := prefix.NewStore(store, types.ValidatorsKey) validators, pageRes, err := query.GenericFilteredPaginate(k.cdc, valStore, req.Pagination, func(key []byte, val *types.Validator) (*types.Validator, error) { @@ -57,14 +56,14 @@ func (k Querier) Validators(c context.Context, req *types.QueryValidatorsRequest vals := types.Validators{} for _, val := range validators { - vals = append(vals, *val) + vals.Validators = append(vals.Validators, *val) } - return &types.QueryValidatorsResponse{Validators: vals, Pagination: pageRes}, nil + return &types.QueryValidatorsResponse{Validators: vals.Validators, Pagination: pageRes}, nil } // Validator queries validator info for given validator address -func (k Querier) Validator(c context.Context, req *types.QueryValidatorRequest) (*types.QueryValidatorResponse, error) { +func (k Querier) Validator(ctx context.Context, req *types.QueryValidatorRequest) (*types.QueryValidatorResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -73,14 +72,13 @@ func (k Querier) Validator(c context.Context, req *types.QueryValidatorRequest) return nil, status.Error(codes.InvalidArgument, "validator address cannot be empty") } - valAddr, err := sdk.ValAddressFromBech32(req.ValidatorAddr) + valAddr, err := k.validatorAddressCodec.StringToBytes(req.ValidatorAddr) if err != nil { return nil, err } - ctx := sdk.UnwrapSDKContext(c) - validator, found := k.GetValidator(ctx, valAddr) - if !found { + validator, err := k.GetValidator(ctx, valAddr) + if err != nil { return nil, status.Errorf(codes.NotFound, "validator %s not found", req.ValidatorAddr) } @@ -88,7 +86,7 @@ func (k Querier) Validator(c context.Context, req *types.QueryValidatorRequest) } // ValidatorDelegations queries delegate info for given validator -func (k Querier) ValidatorDelegations(c context.Context, req *types.QueryValidatorDelegationsRequest) (*types.QueryValidatorDelegationsResponse, error) { +func (k Querier) ValidatorDelegations(ctx context.Context, req *types.QueryValidatorDelegationsRequest) (*types.QueryValidatorDelegationsResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -97,13 +95,12 @@ func (k Querier) ValidatorDelegations(c context.Context, req *types.QueryValidat return nil, status.Error(codes.InvalidArgument, "validator address cannot be empty") } - valAddr, err := sdk.ValAddressFromBech32(req.ValidatorAddr) + valAddr, err := k.validatorAddressCodec.StringToBytes(req.ValidatorAddr) if err != nil { return nil, err } - ctx := sdk.UnwrapSDKContext(c) - store := ctx.KVStore(k.storeKey) + store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) delStore := prefix.NewStore(store, types.GetDelegationsByValPrefixKey(valAddr)) var ( @@ -136,7 +133,7 @@ func (k Querier) ValidatorDelegations(c context.Context, req *types.QueryValidat pageRes = pageResponse } - delResponses, err := DelegationsToDelegationResponses(ctx, k.Keeper, dels) + delResponses, err := delegationsToDelegationResponses(ctx, k.Keeper, dels) if err != nil { return nil, status.Error(codes.Internal, err.Error()) } @@ -146,17 +143,17 @@ func (k Querier) ValidatorDelegations(c context.Context, req *types.QueryValidat }, nil } -func (k Querier) getValidatorDelegationsLegacy(ctx sdk.Context, req *types.QueryValidatorDelegationsRequest) ([]*types.Delegation, *query.PageResponse, error) { - store := ctx.KVStore(k.storeKey) +func (k Querier) getValidatorDelegationsLegacy(ctx context.Context, req *types.QueryValidatorDelegationsRequest) ([]*types.Delegation, *query.PageResponse, error) { + store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) valStore := prefix.NewStore(store, types.DelegationKey) return query.GenericFilteredPaginate(k.cdc, valStore, req.Pagination, func(key []byte, delegation *types.Delegation) (*types.Delegation, error) { - valAddr, err := sdk.ValAddressFromBech32(req.ValidatorAddr) + _, err := k.validatorAddressCodec.StringToBytes(req.ValidatorAddr) if err != nil { return nil, err } - if !delegation.GetValidatorAddr().Equals(valAddr) { + if !strings.EqualFold(delegation.GetValidatorAddr(), req.ValidatorAddr) { return nil, nil } @@ -167,7 +164,7 @@ func (k Querier) getValidatorDelegationsLegacy(ctx sdk.Context, req *types.Query } // ValidatorUnbondingDelegations queries unbonding delegations of a validator -func (k Querier) ValidatorUnbondingDelegations(c context.Context, req *types.QueryValidatorUnbondingDelegationsRequest) (*types.QueryValidatorUnbondingDelegationsResponse, error) { +func (k Querier) ValidatorUnbondingDelegations(ctx context.Context, req *types.QueryValidatorUnbondingDelegationsRequest) (*types.QueryValidatorUnbondingDelegationsResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -176,15 +173,13 @@ func (k Querier) ValidatorUnbondingDelegations(c context.Context, req *types.Que return nil, status.Error(codes.InvalidArgument, "validator address cannot be empty") } var ubds types.UnbondingDelegations - ctx := sdk.UnwrapSDKContext(c) - - store := ctx.KVStore(k.storeKey) - valAddr, err := sdk.ValAddressFromBech32(req.ValidatorAddr) + valAddr, err := k.validatorAddressCodec.StringToBytes(req.ValidatorAddr) if err != nil { return nil, err } + store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) srcValPrefix := types.GetUBDsByValIndexKey(valAddr) ubdStore := prefix.NewStore(store, srcValPrefix) pageRes, err := query.Paginate(ubdStore, req.Pagination, func(key, value []byte) error { @@ -209,7 +204,7 @@ func (k Querier) ValidatorUnbondingDelegations(c context.Context, req *types.Que } // Delegation queries delegate info for given validator delegator pair -func (k Querier) Delegation(c context.Context, req *types.QueryDelegationRequest) (*types.QueryDelegationResponse, error) { +func (k Querier) Delegation(ctx context.Context, req *types.QueryDelegationRequest) (*types.QueryDelegationResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -221,26 +216,25 @@ func (k Querier) Delegation(c context.Context, req *types.QueryDelegationRequest return nil, status.Error(codes.InvalidArgument, "validator address cannot be empty") } - ctx := sdk.UnwrapSDKContext(c) delAddr, err := k.authKeeper.AddressCodec().StringToBytes(req.DelegatorAddr) if err != nil { return nil, err } - valAddr, err := sdk.ValAddressFromBech32(req.ValidatorAddr) + valAddr, err := k.validatorAddressCodec.StringToBytes(req.ValidatorAddr) if err != nil { return nil, err } - delegation, found := k.GetDelegation(ctx, delAddr, valAddr) - if !found { + delegation, err := k.GetDelegation(ctx, delAddr, valAddr) + if err != nil { return nil, status.Errorf( codes.NotFound, "delegation with delegator %s not found for validator %s", req.DelegatorAddr, req.ValidatorAddr) } - delResponse, err := DelegationToDelegationResponse(ctx, k.Keeper, delegation) + delResponse, err := delegationToDelegationResponse(ctx, k.Keeper, delegation) if err != nil { return nil, status.Error(codes.Internal, err.Error()) } @@ -248,8 +242,8 @@ func (k Querier) Delegation(c context.Context, req *types.QueryDelegationRequest return &types.QueryDelegationResponse{DelegationResponse: &delResponse}, nil } -// UnbondingDelegation queries unbonding info for give validator delegator pair -func (k Querier) UnbondingDelegation(c context.Context, req *types.QueryUnbondingDelegationRequest) (*types.QueryUnbondingDelegationResponse, error) { +// UnbondingDelegation queries unbonding info for given validator delegator pair +func (k Querier) UnbondingDelegation(ctx context.Context, req *types.QueryUnbondingDelegationRequest) (*types.QueryUnbondingDelegationResponse, error) { if req == nil { return nil, status.Errorf(codes.InvalidArgument, "empty request") } @@ -261,20 +255,18 @@ func (k Querier) UnbondingDelegation(c context.Context, req *types.QueryUnbondin return nil, status.Errorf(codes.InvalidArgument, "validator address cannot be empty") } - ctx := sdk.UnwrapSDKContext(c) - delAddr, err := k.authKeeper.AddressCodec().StringToBytes(req.DelegatorAddr) if err != nil { return nil, err } - valAddr, err := sdk.ValAddressFromBech32(req.ValidatorAddr) + valAddr, err := k.validatorAddressCodec.StringToBytes(req.ValidatorAddr) if err != nil { return nil, err } - unbond, found := k.GetUnbondingDelegation(ctx, delAddr, valAddr) - if !found { + unbond, err := k.GetUnbondingDelegation(ctx, delAddr, valAddr) + if err != nil { return nil, status.Errorf( codes.NotFound, "unbonding delegation with delegator %s not found for validator %s", @@ -284,8 +276,8 @@ func (k Querier) UnbondingDelegation(c context.Context, req *types.QueryUnbondin return &types.QueryUnbondingDelegationResponse{Unbond: unbond}, nil } -// DelegatorDelegations queries all delegations of a give delegator address -func (k Querier) DelegatorDelegations(c context.Context, req *types.QueryDelegatorDelegationsRequest) (*types.QueryDelegatorDelegationsResponse, error) { +// DelegatorDelegations queries all delegations of a given delegator address +func (k Querier) DelegatorDelegations(ctx context.Context, req *types.QueryDelegatorDelegationsRequest) (*types.QueryDelegatorDelegationsResponse, error) { if req == nil { return nil, status.Errorf(codes.InvalidArgument, "empty request") } @@ -294,14 +286,13 @@ func (k Querier) DelegatorDelegations(c context.Context, req *types.QueryDelegat return nil, status.Error(codes.InvalidArgument, "delegator address cannot be empty") } var delegations types.Delegations - ctx := sdk.UnwrapSDKContext(c) delAddr, err := k.authKeeper.AddressCodec().StringToBytes(req.DelegatorAddr) if err != nil { return nil, err } - store := ctx.KVStore(k.storeKey) + store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) delStore := prefix.NewStore(store, types.GetDelegationsKey(delAddr)) pageRes, err := query.Paginate(delStore, req.Pagination, func(key, value []byte) error { delegation, err := types.UnmarshalDelegation(k.cdc, value) @@ -315,7 +306,7 @@ func (k Querier) DelegatorDelegations(c context.Context, req *types.QueryDelegat return nil, status.Error(codes.Internal, err.Error()) } - delegationResps, err := DelegationsToDelegationResponses(ctx, k.Keeper, delegations) + delegationResps, err := delegationsToDelegationResponses(ctx, k.Keeper, delegations) if err != nil { return nil, status.Error(codes.Internal, err.Error()) } @@ -324,7 +315,7 @@ func (k Querier) DelegatorDelegations(c context.Context, req *types.QueryDelegat } // DelegatorValidator queries validator info for given delegator validator pair -func (k Querier) DelegatorValidator(c context.Context, req *types.QueryDelegatorValidatorRequest) (*types.QueryDelegatorValidatorResponse, error) { +func (k Querier) DelegatorValidator(ctx context.Context, req *types.QueryDelegatorValidatorRequest) (*types.QueryDelegatorValidatorResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -336,13 +327,12 @@ func (k Querier) DelegatorValidator(c context.Context, req *types.QueryDelegator return nil, status.Error(codes.InvalidArgument, "validator address cannot be empty") } - ctx := sdk.UnwrapSDKContext(c) delAddr, err := k.authKeeper.AddressCodec().StringToBytes(req.DelegatorAddr) if err != nil { return nil, err } - valAddr, err := sdk.ValAddressFromBech32(req.ValidatorAddr) + valAddr, err := k.validatorAddressCodec.StringToBytes(req.ValidatorAddr) if err != nil { return nil, err } @@ -356,7 +346,7 @@ func (k Querier) DelegatorValidator(c context.Context, req *types.QueryDelegator } // DelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address -func (k Querier) DelegatorUnbondingDelegations(c context.Context, req *types.QueryDelegatorUnbondingDelegationsRequest) (*types.QueryDelegatorUnbondingDelegationsResponse, error) { +func (k Querier) DelegatorUnbondingDelegations(ctx context.Context, req *types.QueryDelegatorUnbondingDelegationsRequest) (*types.QueryDelegatorUnbondingDelegationsResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -365,14 +355,13 @@ func (k Querier) DelegatorUnbondingDelegations(c context.Context, req *types.Que return nil, status.Error(codes.InvalidArgument, "delegator address cannot be empty") } var unbondingDelegations types.UnbondingDelegations - ctx := sdk.UnwrapSDKContext(c) - store := ctx.KVStore(k.storeKey) delAddr, err := k.authKeeper.AddressCodec().StringToBytes(req.DelegatorAddr) if err != nil { return nil, err } + store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) unbStore := prefix.NewStore(store, types.GetUBDsKey(delAddr)) pageRes, err := query.Paginate(unbStore, req.Pagination, func(key, value []byte) error { unbond, err := types.UnmarshalUBD(k.cdc, value) @@ -392,7 +381,7 @@ func (k Querier) DelegatorUnbondingDelegations(c context.Context, req *types.Que } // HistoricalInfo queries the historical info for given height -func (k Querier) HistoricalInfo(c context.Context, req *types.QueryHistoricalInfoRequest) (*types.QueryHistoricalInfoResponse, error) { +func (k Querier) HistoricalInfo(ctx context.Context, req *types.QueryHistoricalInfoRequest) (*types.QueryHistoricalInfoResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -400,9 +389,9 @@ func (k Querier) HistoricalInfo(c context.Context, req *types.QueryHistoricalInf if req.Height < 0 { return nil, status.Error(codes.InvalidArgument, "height cannot be negative") } - ctx := sdk.UnwrapSDKContext(c) - hi, found := k.GetHistoricalInfo(ctx, req.Height) - if !found { + + hi, err := k.GetHistoricalInfo(ctx, req.Height) + if err != nil { return nil, status.Errorf(codes.NotFound, "historical info for height %d not found", req.Height) } @@ -410,7 +399,7 @@ func (k Querier) HistoricalInfo(c context.Context, req *types.QueryHistoricalInf } // Redelegations queries redelegations of given address -func (k Querier) Redelegations(c context.Context, req *types.QueryRedelegationsRequest) (*types.QueryRedelegationsResponse, error) { +func (k Querier) Redelegations(ctx context.Context, req *types.QueryRedelegationsRequest) (*types.QueryRedelegationsResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -419,8 +408,7 @@ func (k Querier) Redelegations(c context.Context, req *types.QueryRedelegationsR var pageRes *query.PageResponse var err error - ctx := sdk.UnwrapSDKContext(c) - store := ctx.KVStore(k.storeKey) + store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) switch { case req.DelegatorAddr != "" && req.SrcValidatorAddr != "" && req.DstValidatorAddr != "": redels, err = queryRedelegation(ctx, k, req) @@ -432,7 +420,7 @@ func (k Querier) Redelegations(c context.Context, req *types.QueryRedelegationsR if err != nil { return nil, status.Error(codes.Internal, err.Error()) } - redelResponses, err := RedelegationsToRedelegationResponses(ctx, k.Keeper, redels) + redelResponses, err := redelegationsToRedelegationResponses(ctx, k.Keeper, redels) if err != nil { return nil, status.Error(codes.Internal, err.Error()) } @@ -441,7 +429,7 @@ func (k Querier) Redelegations(c context.Context, req *types.QueryRedelegationsR } // DelegatorValidators queries all validators info for given delegator address -func (k Querier) DelegatorValidators(c context.Context, req *types.QueryDelegatorValidatorsRequest) (*types.QueryDelegatorValidatorsResponse, error) { +func (k Querier) DelegatorValidators(ctx context.Context, req *types.QueryDelegatorValidatorsRequest) (*types.QueryDelegatorValidatorsResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -450,9 +438,8 @@ func (k Querier) DelegatorValidators(c context.Context, req *types.QueryDelegato return nil, status.Error(codes.InvalidArgument, "delegator address cannot be empty") } var validators types.Validators - ctx := sdk.UnwrapSDKContext(c) - store := ctx.KVStore(k.storeKey) + store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) delAddr, err := k.authKeeper.AddressCodec().StringToBytes(req.DelegatorAddr) if err != nil { return nil, err @@ -465,25 +452,32 @@ func (k Querier) DelegatorValidators(c context.Context, req *types.QueryDelegato return err } - validator, found := k.GetValidator(ctx, delegation.GetValidatorAddr()) - if !found { - return types.ErrNoValidatorFound + valAddr, err := k.validatorAddressCodec.StringToBytes(delegation.GetValidatorAddr()) + if err != nil { + return err + } + + validator, err := k.GetValidator(ctx, valAddr) + if err != nil { + return err } - validators = append(validators, validator) + validators.Validators = append(validators.Validators, validator) return nil }) if err != nil { return nil, status.Error(codes.Internal, err.Error()) } - return &types.QueryDelegatorValidatorsResponse{Validators: validators, Pagination: pageRes}, nil + return &types.QueryDelegatorValidatorsResponse{Validators: validators.Validators, Pagination: pageRes}, nil } // Pool queries the pool info -func (k Querier) Pool(c context.Context, _ *types.QueryPoolRequest) (*types.QueryPoolResponse, error) { - ctx := sdk.UnwrapSDKContext(c) - bondDenom := k.BondDenom(ctx) +func (k Querier) Pool(ctx context.Context, _ *types.QueryPoolRequest) (*types.QueryPoolResponse, error) { + bondDenom, err := k.BondDenom(ctx) + if err != nil { + return nil, err + } bondedPool := k.GetBondedPool(ctx) notBondedPool := k.GetNotBondedPool(ctx) @@ -496,31 +490,32 @@ func (k Querier) Pool(c context.Context, _ *types.QueryPoolRequest) (*types.Quer } // Params queries the staking parameters -func (k Querier) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { - ctx := sdk.UnwrapSDKContext(c) - params := k.GetParams(ctx) - +func (k Querier) Params(ctx context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { + params, err := k.GetParams(ctx) + if err != nil { + return nil, err + } return &types.QueryParamsResponse{Params: params}, nil } -func queryRedelegation(ctx sdk.Context, k Querier, req *types.QueryRedelegationsRequest) (redels types.Redelegations, err error) { +func queryRedelegation(ctx context.Context, k Querier, req *types.QueryRedelegationsRequest) (redels types.Redelegations, err error) { delAddr, err := k.authKeeper.AddressCodec().StringToBytes(req.DelegatorAddr) if err != nil { return nil, err } - srcValAddr, err := sdk.ValAddressFromBech32(req.SrcValidatorAddr) + srcValAddr, err := k.validatorAddressCodec.StringToBytes(req.SrcValidatorAddr) if err != nil { return nil, err } - dstValAddr, err := sdk.ValAddressFromBech32(req.DstValidatorAddr) + dstValAddr, err := k.validatorAddressCodec.StringToBytes(req.DstValidatorAddr) if err != nil { return nil, err } - redel, found := k.GetRedelegation(ctx, delAddr, srcValAddr, dstValAddr) - if !found { + redel, err := k.GetRedelegation(ctx, delAddr, srcValAddr, dstValAddr) + if err != nil { return nil, status.Errorf( codes.NotFound, "redelegation not found for delegator address %s from validator address %s", @@ -528,11 +523,11 @@ func queryRedelegation(ctx sdk.Context, k Querier, req *types.QueryRedelegations } redels = []types.Redelegation{redel} - return redels, err + return redels, nil } func queryRedelegationsFromSrcValidator(store storetypes.KVStore, k Querier, req *types.QueryRedelegationsRequest) (redels types.Redelegations, res *query.PageResponse, err error) { - valAddr, err := sdk.ValAddressFromBech32(req.SrcValidatorAddr) + valAddr, err := k.validatorAddressCodec.StringToBytes(req.SrcValidatorAddr) if err != nil { return nil, nil, err } @@ -574,30 +569,40 @@ func queryAllRedelegations(store storetypes.KVStore, k Querier, req *types.Query // util -func DelegationToDelegationResponse(ctx sdk.Context, k *Keeper, del types.Delegation) (types.DelegationResponse, error) { - val, found := k.GetValidator(ctx, del.GetValidatorAddr()) - if !found { - return types.DelegationResponse{}, types.ErrNoValidatorFound +func delegationToDelegationResponse(ctx context.Context, k *Keeper, del types.Delegation) (types.DelegationResponse, error) { + valAddr, err := k.validatorAddressCodec.StringToBytes(del.GetValidatorAddr()) + if err != nil { + return types.DelegationResponse{}, err + } + + val, err := k.GetValidator(ctx, valAddr) + if err != nil { + return types.DelegationResponse{}, err + } + + _, err = k.authKeeper.AddressCodec().StringToBytes(del.DelegatorAddress) + if err != nil { + return types.DelegationResponse{}, err } - delegatorAddress, err := k.authKeeper.AddressCodec().StringToBytes(del.DelegatorAddress) + bondDenom, err := k.BondDenom(ctx) if err != nil { return types.DelegationResponse{}, err } return types.NewDelegationResp( - delegatorAddress, + del.DelegatorAddress, del.GetValidatorAddr(), del.Shares, - sdk.NewCoin(k.BondDenom(ctx), val.TokensFromShares(del.Shares).TruncateInt()), + sdk.NewCoin(bondDenom, val.TokensFromShares(del.Shares).TruncateInt()), ), nil } -func DelegationsToDelegationResponses(ctx sdk.Context, k *Keeper, delegations types.Delegations) (types.DelegationResponses, error) { +func delegationsToDelegationResponses(ctx context.Context, k *Keeper, delegations types.Delegations) (types.DelegationResponses, error) { resp := make(types.DelegationResponses, len(delegations)) for i, del := range delegations { - delResp, err := DelegationToDelegationResponse(ctx, k, del) + delResp, err := delegationToDelegationResponse(ctx, k, del) if err != nil { return nil, err } @@ -608,27 +613,27 @@ func DelegationsToDelegationResponses(ctx sdk.Context, k *Keeper, delegations ty return resp, nil } -func RedelegationsToRedelegationResponses(ctx sdk.Context, k *Keeper, redels types.Redelegations) (types.RedelegationResponses, error) { +func redelegationsToRedelegationResponses(ctx context.Context, k *Keeper, redels types.Redelegations) (types.RedelegationResponses, error) { resp := make(types.RedelegationResponses, len(redels)) for i, redel := range redels { - valSrcAddr, err := sdk.ValAddressFromBech32(redel.ValidatorSrcAddress) + _, err := k.validatorAddressCodec.StringToBytes(redel.ValidatorSrcAddress) if err != nil { - panic(err) + return nil, err } - valDstAddr, err := sdk.ValAddressFromBech32(redel.ValidatorDstAddress) + valDstAddr, err := k.validatorAddressCodec.StringToBytes(redel.ValidatorDstAddress) if err != nil { - panic(err) + return nil, err } - delegatorAddress, err := k.authKeeper.AddressCodec().StringToBytes(redel.DelegatorAddress) + _, err = k.authKeeper.AddressCodec().StringToBytes(redel.DelegatorAddress) if err != nil { return nil, err } - val, found := k.GetValidator(ctx, valDstAddr) - if !found { - return nil, types.ErrNoValidatorFound + val, err := k.GetValidator(ctx, valDstAddr) + if err != nil { + return nil, err } entryResponses := make([]types.RedelegationEntryResponse, len(redel.Entries)) @@ -644,9 +649,9 @@ func RedelegationsToRedelegationResponses(ctx sdk.Context, k *Keeper, redels typ } resp[i] = types.NewRedelegationResponse( - delegatorAddress, - valSrcAddr, - valDstAddr, + redel.DelegatorAddress, + redel.ValidatorSrcAddress, + redel.ValidatorDstAddress, entryResponses, ) } diff --git a/x/staking/keeper/grpc_query_test.go b/x/staking/keeper/grpc_query_test.go index 597636a9ec02..b55539d1b538 100644 --- a/x/staking/keeper/grpc_query_test.go +++ b/x/staking/keeper/grpc_query_test.go @@ -14,7 +14,7 @@ func (s *KeeperTestSuite) TestGRPCQueryValidator() { require := s.Require() validator := testutil.NewValidator(s.T(), sdk.ValAddress(PKs[0].Address().Bytes()), PKs[0]) - keeper.SetValidator(ctx, validator) + require.NoError(keeper.SetValidator(ctx, validator)) var req *types.QueryValidatorRequest testCases := []struct { msg string diff --git a/x/staking/keeper/historical_info.go b/x/staking/keeper/historical_info.go index 47895b19f8be..8b970b8af2d4 100644 --- a/x/staking/keeper/historical_info.go +++ b/x/staking/keeper/historical_info.go @@ -1,6 +1,9 @@ package keeper import ( + "context" + "errors" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -8,69 +11,85 @@ import ( ) // GetHistoricalInfo gets the historical info at a given height -func (k Keeper) GetHistoricalInfo(ctx sdk.Context, height int64) (types.HistoricalInfo, bool) { - store := ctx.KVStore(k.storeKey) +func (k Keeper) GetHistoricalInfo(ctx context.Context, height int64) (types.HistoricalInfo, error) { + store := k.storeService.OpenKVStore(ctx) key := types.GetHistoricalInfoKey(height) - value := store.Get(key) + value, err := store.Get(key) + if err != nil { + return types.HistoricalInfo{}, err + } + if value == nil { - return types.HistoricalInfo{}, false + return types.HistoricalInfo{}, types.ErrNoHistoricalInfo } - return types.MustUnmarshalHistoricalInfo(k.cdc, value), true + return types.UnmarshalHistoricalInfo(k.cdc, value) } // SetHistoricalInfo sets the historical info at a given height -func (k Keeper) SetHistoricalInfo(ctx sdk.Context, height int64, hi *types.HistoricalInfo) { - store := ctx.KVStore(k.storeKey) +func (k Keeper) SetHistoricalInfo(ctx context.Context, height int64, hi *types.HistoricalInfo) error { + store := k.storeService.OpenKVStore(ctx) key := types.GetHistoricalInfoKey(height) - value := k.cdc.MustMarshal(hi) - store.Set(key, value) + value, err := k.cdc.Marshal(hi) + if err != nil { + return err + } + return store.Set(key, value) } // DeleteHistoricalInfo deletes the historical info at a given height -func (k Keeper) DeleteHistoricalInfo(ctx sdk.Context, height int64) { - store := ctx.KVStore(k.storeKey) +func (k Keeper) DeleteHistoricalInfo(ctx context.Context, height int64) error { + store := k.storeService.OpenKVStore(ctx) key := types.GetHistoricalInfoKey(height) - store.Delete(key) + return store.Delete(key) } -// IterateHistoricalInfo provides an interator over all stored HistoricalInfo -// -// objects. For each HistoricalInfo object, cb will be called. If the cb returns -// -// true, the iterator will close and stop. -func (k Keeper) IterateHistoricalInfo(ctx sdk.Context, cb func(types.HistoricalInfo) bool) { - store := ctx.KVStore(k.storeKey) - - iterator := storetypes.KVStorePrefixIterator(store, types.HistoricalInfoKey) +// IterateHistoricalInfo provides an iterator over all stored HistoricalInfo +// objects. For each HistoricalInfo object, cb will be called. If the cb returns +// true, the iterator will break and close. +func (k Keeper) IterateHistoricalInfo(ctx context.Context, cb func(types.HistoricalInfo) bool) error { + store := k.storeService.OpenKVStore(ctx) + iterator, err := store.Iterator(types.HistoricalInfoKey, storetypes.PrefixEndBytes(types.HistoricalInfoKey)) + if err != nil { + return err + } defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - histInfo := types.MustUnmarshalHistoricalInfo(k.cdc, iterator.Value()) + histInfo, err := types.UnmarshalHistoricalInfo(k.cdc, iterator.Value()) + if err != nil { + return err + } if cb(histInfo) { break } } + + return nil } // GetAllHistoricalInfo returns all stored HistoricalInfo objects. -func (k Keeper) GetAllHistoricalInfo(ctx sdk.Context) []types.HistoricalInfo { +func (k Keeper) GetAllHistoricalInfo(ctx context.Context) ([]types.HistoricalInfo, error) { var infos []types.HistoricalInfo - - k.IterateHistoricalInfo(ctx, func(histInfo types.HistoricalInfo) bool { + err := k.IterateHistoricalInfo(ctx, func(histInfo types.HistoricalInfo) bool { infos = append(infos, histInfo) return false }) - return infos + return infos, err } // TrackHistoricalInfo saves the latest historical-info and deletes the oldest // heights that are below pruning height -func (k Keeper) TrackHistoricalInfo(ctx sdk.Context) { - entryNum := k.HistoricalEntries(ctx) +func (k Keeper) TrackHistoricalInfo(ctx context.Context) error { + entryNum, err := k.HistoricalEntries(ctx) + if err != nil { + return err + } + + sdkCtx := sdk.UnwrapSDKContext(ctx) // Prune store to ensure we only have parameter-defined historical entries. // In most cases, this will involve removing a single historical entry. @@ -79,24 +98,32 @@ func (k Keeper) TrackHistoricalInfo(ctx sdk.Context) { // Since the entries to be deleted are always in a continuous range, we can iterate // over the historical entries starting from the most recent version to be pruned // and then return at the first empty entry. - for i := ctx.BlockHeight() - int64(entryNum); i >= 0; i-- { - _, found := k.GetHistoricalInfo(ctx, i) - if found { - k.DeleteHistoricalInfo(ctx, i) - } else { - break + for i := sdkCtx.BlockHeight() - int64(entryNum); i >= 0; i-- { + _, err := k.GetHistoricalInfo(ctx, i) + if err != nil { + if errors.Is(err, types.ErrNoHistoricalInfo) { + break + } + return err + } + if err = k.DeleteHistoricalInfo(ctx, i); err != nil { + return err } } // if there is no need to persist historicalInfo, return if entryNum == 0 { - return + return nil } // Create HistoricalInfo struct - lastVals := k.GetLastValidators(ctx) - historicalEntry := types.NewHistoricalInfo(ctx.BlockHeader(), lastVals, k.PowerReduction(ctx)) + lastVals, err := k.GetLastValidators(ctx) + if err != nil { + return err + } + + historicalEntry := types.NewHistoricalInfo(sdkCtx.BlockHeader(), types.Validators{Validators: lastVals, ValidatorCodec: k.validatorAddressCodec}, k.PowerReduction(ctx)) // Set latest HistoricalInfo at current height - k.SetHistoricalInfo(ctx, ctx.BlockHeight(), &historicalEntry) + return k.SetHistoricalInfo(ctx, sdkCtx.BlockHeight(), &historicalEntry) } diff --git a/x/staking/keeper/historical_info_test.go b/x/staking/keeper/historical_info_test.go index f3b68ceec48a..b1ce611919e6 100644 --- a/x/staking/keeper/historical_info_test.go +++ b/x/staking/keeper/historical_info_test.go @@ -32,18 +32,18 @@ func (s *KeeperTestSuite) TestHistoricalInfo() { validators[i] = testutil.NewValidator(s.T(), valAddr, PKs[i]) } - hi := stakingtypes.NewHistoricalInfo(ctx.BlockHeader(), validators, keeper.PowerReduction(ctx)) - keeper.SetHistoricalInfo(ctx, 2, &hi) + hi := stakingtypes.NewHistoricalInfo(ctx.BlockHeader(), stakingtypes.Validators{Validators: validators}, keeper.PowerReduction(ctx)) + require.NoError(keeper.SetHistoricalInfo(ctx, 2, &hi)) - recv, found := keeper.GetHistoricalInfo(ctx, 2) - require.True(found, "HistoricalInfo not found after set") + recv, err := keeper.GetHistoricalInfo(ctx, 2) + require.NoError(err, "HistoricalInfo not found after set") require.Equal(hi, recv, "HistoricalInfo not equal") require.True(IsValSetSorted(recv.Valset, keeper.PowerReduction(ctx)), "HistoricalInfo validators is not sorted") - keeper.DeleteHistoricalInfo(ctx, 2) + require.NoError(keeper.DeleteHistoricalInfo(ctx, 2)) - recv, found = keeper.GetHistoricalInfo(ctx, 2) - require.False(found, "HistoricalInfo found after delete") + recv, err = keeper.GetHistoricalInfo(ctx, 2) + require.ErrorIs(err, stakingtypes.ErrNoHistoricalInfo, "HistoricalInfo found after delete") require.Equal(stakingtypes.HistoricalInfo{}, recv, "HistoricalInfo is not empty") } @@ -56,7 +56,7 @@ func (s *KeeperTestSuite) TestTrackHistoricalInfo() { // set historical entries in params to 5 params := stakingtypes.DefaultParams() params.HistoricalEntries = 5 - keeper.SetParams(ctx, params) + require.NoError(keeper.SetParams(ctx, params)) // set historical info at 5, 4 which should be pruned // and check that it has been stored @@ -72,28 +72,32 @@ func (s *KeeperTestSuite) TestTrackHistoricalInfo() { testutil.NewValidator(s.T(), addrVals[0], PKs[0]), testutil.NewValidator(s.T(), addrVals[1], PKs[1]), } - hi4 := stakingtypes.NewHistoricalInfo(h4, valSet, keeper.PowerReduction(ctx)) - hi5 := stakingtypes.NewHistoricalInfo(h5, valSet, keeper.PowerReduction(ctx)) - keeper.SetHistoricalInfo(ctx, 4, &hi4) - keeper.SetHistoricalInfo(ctx, 5, &hi5) - recv, found := keeper.GetHistoricalInfo(ctx, 4) - require.True(found) + hi4 := stakingtypes.NewHistoricalInfo(h4, stakingtypes.Validators{Validators: valSet}, keeper.PowerReduction(ctx)) + hi5 := stakingtypes.NewHistoricalInfo(h5, stakingtypes.Validators{Validators: valSet}, keeper.PowerReduction(ctx)) + require.NoError(keeper.SetHistoricalInfo(ctx, 4, &hi4)) + require.NoError(keeper.SetHistoricalInfo(ctx, 5, &hi5)) + recv, err := keeper.GetHistoricalInfo(ctx, 4) + require.NoError(err) require.Equal(hi4, recv) - recv, found = keeper.GetHistoricalInfo(ctx, 5) - require.True(found) + recv, err = keeper.GetHistoricalInfo(ctx, 5) + require.NoError(err) require.Equal(hi5, recv) // Set bonded validators in keeper val1 := testutil.NewValidator(s.T(), addrVals[2], PKs[2]) val1.Status = stakingtypes.Bonded // when not bonded, consensus power is Zero val1.Tokens = keeper.TokensFromConsensusPower(ctx, 10) - keeper.SetValidator(ctx, val1) - keeper.SetLastValidatorPower(ctx, val1.GetOperator(), 10) + require.NoError(keeper.SetValidator(ctx, val1)) + valbz, err := keeper.ValidatorAddressCodec().StringToBytes(val1.GetOperator()) + require.NoError(err) + require.NoError(keeper.SetLastValidatorPower(ctx, valbz, 10)) val2 := testutil.NewValidator(s.T(), addrVals[3], PKs[3]) val1.Status = stakingtypes.Bonded val2.Tokens = keeper.TokensFromConsensusPower(ctx, 80) - keeper.SetValidator(ctx, val2) - keeper.SetLastValidatorPower(ctx, val2.GetOperator(), 80) + require.NoError(keeper.SetValidator(ctx, val2)) + valbz, err = keeper.ValidatorAddressCodec().StringToBytes(val2.GetOperator()) + require.NoError(err) + require.NoError(keeper.SetLastValidatorPower(ctx, valbz, 80)) vals := []stakingtypes.Validator{val1, val2} require.True(IsValSetSorted(vals, keeper.PowerReduction(ctx))) @@ -105,23 +109,23 @@ func (s *KeeperTestSuite) TestTrackHistoricalInfo() { } ctx = ctx.WithBlockHeader(header) - keeper.TrackHistoricalInfo(ctx) + require.NoError(keeper.TrackHistoricalInfo(ctx)) // Check HistoricalInfo at height 10 is persisted expected := stakingtypes.HistoricalInfo{ Header: header, Valset: vals, } - recv, found = keeper.GetHistoricalInfo(ctx, 10) - require.True(found, "GetHistoricalInfo failed after BeginBlock") + recv, err = keeper.GetHistoricalInfo(ctx, 10) + require.NoError(err, "GetHistoricalInfo failed after BeginBlock") require.Equal(expected, recv, "GetHistoricalInfo returned unexpected result") // Check HistoricalInfo at height 5, 4 is pruned - recv, found = keeper.GetHistoricalInfo(ctx, 4) - require.False(found, "GetHistoricalInfo did not prune earlier height") + recv, err = keeper.GetHistoricalInfo(ctx, 4) + require.ErrorIs(err, stakingtypes.ErrNoHistoricalInfo, "GetHistoricalInfo did not prune earlier height") require.Equal(stakingtypes.HistoricalInfo{}, recv, "GetHistoricalInfo at height 4 is not empty after prune") - recv, found = keeper.GetHistoricalInfo(ctx, 5) - require.False(found, "GetHistoricalInfo did not prune first prune height") + recv, err = keeper.GetHistoricalInfo(ctx, 5) + require.ErrorIs(err, stakingtypes.ErrNoHistoricalInfo, "GetHistoricalInfo did not prune first prune height") require.Equal(stakingtypes.HistoricalInfo{}, recv, "GetHistoricalInfo at height 5 is not empty after prune") } @@ -147,9 +151,10 @@ func (s *KeeperTestSuite) TestGetAllHistoricalInfo() { expHistInfos := []stakingtypes.HistoricalInfo{hist1, hist2, hist3} for i, hi := range expHistInfos { - keeper.SetHistoricalInfo(ctx, int64(9+i), &hi) //nolint:gosec // G601: Implicit memory aliasing in for loop. + require.NoError(keeper.SetHistoricalInfo(ctx, int64(9+i), &hi)) //nolint:gosec // G601: Implicit memory aliasing in for loop. } - infos := keeper.GetAllHistoricalInfo(ctx) + infos, err := keeper.GetAllHistoricalInfo(ctx) + require.NoError(err) require.Equal(expHistInfos, infos) } diff --git a/x/staking/keeper/invariants.go b/x/staking/keeper/invariants.go deleted file mode 100644 index 975ccc673020..000000000000 --- a/x/staking/keeper/invariants.go +++ /dev/null @@ -1,197 +0,0 @@ -package keeper - -import ( - "bytes" - "fmt" - - "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/staking/types" -) - -// RegisterInvariants registers all staking invariants -func RegisterInvariants(ir sdk.InvariantRegistry, k *Keeper) { - ir.RegisterRoute(types.ModuleName, "module-accounts", - ModuleAccountInvariants(k)) - ir.RegisterRoute(types.ModuleName, "nonnegative-power", - NonNegativePowerInvariant(k)) - ir.RegisterRoute(types.ModuleName, "positive-delegation", - PositiveDelegationInvariant(k)) - ir.RegisterRoute(types.ModuleName, "delegator-shares", - DelegatorSharesInvariant(k)) -} - -// AllInvariants runs all invariants of the staking module. -func AllInvariants(k *Keeper) sdk.Invariant { - return func(ctx sdk.Context) (string, bool) { - res, stop := ModuleAccountInvariants(k)(ctx) - if stop { - return res, stop - } - - res, stop = NonNegativePowerInvariant(k)(ctx) - if stop { - return res, stop - } - - res, stop = PositiveDelegationInvariant(k)(ctx) - if stop { - return res, stop - } - - return DelegatorSharesInvariant(k)(ctx) - } -} - -// ModuleAccountInvariants checks that the bonded and notBonded ModuleAccounts pools -// reflects the tokens actively bonded and not bonded -func ModuleAccountInvariants(k *Keeper) sdk.Invariant { - return func(ctx sdk.Context) (string, bool) { - bonded := math.ZeroInt() - notBonded := math.ZeroInt() - bondedPool := k.GetBondedPool(ctx) - notBondedPool := k.GetNotBondedPool(ctx) - bondDenom := k.BondDenom(ctx) - - k.IterateValidators(ctx, func(_ int64, validator types.ValidatorI) bool { - switch validator.GetStatus() { - case types.Bonded: - bonded = bonded.Add(validator.GetTokens()) - case types.Unbonding, types.Unbonded: - notBonded = notBonded.Add(validator.GetTokens()) - default: - panic("invalid validator status") - } - return false - }) - - k.IterateUnbondingDelegations(ctx, func(_ int64, ubd types.UnbondingDelegation) bool { - for _, entry := range ubd.Entries { - notBonded = notBonded.Add(entry.Balance) - } - return false - }) - - poolBonded := k.bankKeeper.GetBalance(ctx, bondedPool.GetAddress(), bondDenom) - poolNotBonded := k.bankKeeper.GetBalance(ctx, notBondedPool.GetAddress(), bondDenom) - broken := !poolBonded.Amount.Equal(bonded) || !poolNotBonded.Amount.Equal(notBonded) - - // Bonded tokens should equal sum of tokens with bonded validators - // Not-bonded tokens should equal unbonding delegations plus tokens on unbonded validators - return sdk.FormatInvariant(types.ModuleName, "bonded and not bonded module account coins", fmt.Sprintf( - "\tPool's bonded tokens: %v\n"+ - "\tsum of bonded tokens: %v\n"+ - "not bonded token invariance:\n"+ - "\tPool's not bonded tokens: %v\n"+ - "\tsum of not bonded tokens: %v\n"+ - "module accounts total (bonded + not bonded):\n"+ - "\tModule Accounts' tokens: %v\n"+ - "\tsum tokens: %v\n", - poolBonded, bonded, poolNotBonded, notBonded, poolBonded.Add(poolNotBonded), bonded.Add(notBonded))), broken - } -} - -// NonNegativePowerInvariant checks that all stored validators have >= 0 power. -func NonNegativePowerInvariant(k *Keeper) sdk.Invariant { - return func(ctx sdk.Context) (string, bool) { - var ( - msg string - broken bool - ) - - iterator := k.ValidatorsPowerStoreIterator(ctx) - for ; iterator.Valid(); iterator.Next() { - validator, found := k.GetValidator(ctx, iterator.Value()) - if !found { - panic(fmt.Sprintf("validator record not found for address: %X\n", iterator.Value())) - } - - powerKey := types.GetValidatorsByPowerIndexKey(validator, k.PowerReduction(ctx)) - - if !bytes.Equal(iterator.Key(), powerKey) { - broken = true - msg += fmt.Sprintf("power store invariance:\n\tvalidator.Power: %v"+ - "\n\tkey should be: %v\n\tkey in store: %v\n", - validator.GetConsensusPower(k.PowerReduction(ctx)), powerKey, iterator.Key()) - } - - if validator.Tokens.IsNegative() { - broken = true - msg += fmt.Sprintf("\tnegative tokens for validator: %v\n", validator) - } - } - iterator.Close() - - return sdk.FormatInvariant(types.ModuleName, "nonnegative power", fmt.Sprintf("found invalid validator powers\n%s", msg)), broken - } -} - -// PositiveDelegationInvariant checks that all stored delegations have > 0 shares. -func PositiveDelegationInvariant(k *Keeper) sdk.Invariant { - return func(ctx sdk.Context) (string, bool) { - var ( - msg string - count int - ) - - delegations := k.GetAllDelegations(ctx) - for _, delegation := range delegations { - if delegation.Shares.IsNegative() { - count++ - msg += fmt.Sprintf("\tdelegation with negative shares: %+v\n", delegation) - } - - if delegation.Shares.IsZero() { - count++ - msg += fmt.Sprintf("\tdelegation with zero shares: %+v\n", delegation) - } - } - - broken := count != 0 - - return sdk.FormatInvariant(types.ModuleName, "positive delegations", fmt.Sprintf( - "%d invalid delegations found\n%s", count, msg)), broken - } -} - -// DelegatorSharesInvariant checks whether all the delegator shares which persist -// in the delegator object add up to the correct total delegator shares -// amount stored in each validator. -func DelegatorSharesInvariant(k *Keeper) sdk.Invariant { - return func(ctx sdk.Context) (string, bool) { - var ( - msg string - broken bool - ) - - validators := k.GetAllValidators(ctx) - validatorsDelegationShares := map[string]math.LegacyDec{} - - // initialize a map: validator -> its delegation shares - for _, validator := range validators { - validatorsDelegationShares[validator.GetOperator().String()] = math.LegacyZeroDec() - } - - // iterate through all the delegations to calculate the total delegation shares for each validator - delegations := k.GetAllDelegations(ctx) - for _, delegation := range delegations { - delegationValidatorAddr := delegation.GetValidatorAddr().String() - validatorDelegationShares := validatorsDelegationShares[delegationValidatorAddr] - validatorsDelegationShares[delegationValidatorAddr] = validatorDelegationShares.Add(delegation.Shares) - } - - // for each validator, check if its total delegation shares calculated from the step above equals to its expected delegation shares - for _, validator := range validators { - expValTotalDelShares := validator.GetDelegatorShares() - calculatedValTotalDelShares := validatorsDelegationShares[validator.GetOperator().String()] - if !calculatedValTotalDelShares.Equal(expValTotalDelShares) { - broken = true - msg += fmt.Sprintf("broken delegator shares invariance:\n"+ - "\tvalidator.DelegatorShares: %v\n"+ - "\tsum of Delegator.Shares: %v\n", expValTotalDelShares, calculatedValTotalDelShares) - } - } - - return sdk.FormatInvariant(types.ModuleName, "delegator shares", msg), broken - } -} diff --git a/x/staking/keeper/keeper.go b/x/staking/keeper/keeper.go index a9dd46b9a357..45948f72224c 100644 --- a/x/staking/keeper/keeper.go +++ b/x/staking/keeper/keeper.go @@ -1,13 +1,16 @@ package keeper import ( + "context" "fmt" + abci "github.com/cometbft/cometbft/abci/types" + + addresscodec "cosmossdk.io/core/address" + storetypes "cosmossdk.io/core/store" "cosmossdk.io/log" "cosmossdk.io/math" - abci "github.com/cometbft/cometbft/abci/types" - storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -21,21 +24,25 @@ var _ types.DelegationSet = Keeper{} // Keeper of the x/staking store type Keeper struct { - storeKey storetypes.StoreKey - cdc codec.BinaryCodec - authKeeper types.AccountKeeper - bankKeeper types.BankKeeper - hooks types.StakingHooks - authority string + storeService storetypes.KVStoreService + cdc codec.BinaryCodec + authKeeper types.AccountKeeper + bankKeeper types.BankKeeper + hooks types.StakingHooks + authority string + validatorAddressCodec addresscodec.Codec + consensusAddressCodec addresscodec.Codec } // NewKeeper creates a new staking Keeper instance func NewKeeper( cdc codec.BinaryCodec, - key storetypes.StoreKey, + storeService storetypes.KVStoreService, ak types.AccountKeeper, bk types.BankKeeper, authority string, + validatorAddressCodec addresscodec.Codec, + consensusAddressCodec addresscodec.Codec, ) *Keeper { // ensure bonded and not bonded module accounts are set if addr := ak.GetModuleAddress(types.BondedPoolName); addr == nil { @@ -51,19 +58,26 @@ func NewKeeper( panic("authority is not a valid acc address") } + if validatorAddressCodec == nil || consensusAddressCodec == nil { + panic("validator and/or consensus address codec are nil") + } + return &Keeper{ - storeKey: key, - cdc: cdc, - authKeeper: ak, - bankKeeper: bk, - hooks: nil, - authority: authority, + storeService: storeService, + cdc: cdc, + authKeeper: ak, + bankKeeper: bk, + hooks: nil, + authority: authority, + validatorAddressCodec: validatorAddressCodec, + consensusAddressCodec: consensusAddressCodec, } } // Logger returns a module-specific logger. -func (k Keeper) Logger(ctx sdk.Context) log.Logger { - return ctx.Logger().With("module", "x/"+types.ModuleName) +func (k Keeper) Logger(ctx context.Context) log.Logger { + sdkCtx := sdk.UnwrapSDKContext(ctx) + return sdkCtx.Logger().With("module", "x/"+types.ModuleName) } // Hooks gets the hooks for staking *Keeper { @@ -76,7 +90,7 @@ func (k *Keeper) Hooks() types.StakingHooks { return k.hooks } -// SetHooks Set the validator hooks. In contrast to other receivers, this method must take a pointer due to nature +// SetHooks sets the validator hooks. In contrast to other receivers, this method must take a pointer due to nature // of the hooks interface and SDK start up sequence. func (k *Keeper) SetHooks(sh types.StakingHooks) { if k.hooks != nil { @@ -86,26 +100,35 @@ func (k *Keeper) SetHooks(sh types.StakingHooks) { k.hooks = sh } -// GetLastTotalPower Load the last total validator power. -func (k Keeper) GetLastTotalPower(ctx sdk.Context) math.Int { - store := ctx.KVStore(k.storeKey) - bz := store.Get(types.LastTotalPowerKey) +// GetLastTotalPower loads the last total validator power. +func (k Keeper) GetLastTotalPower(ctx context.Context) (math.Int, error) { + store := k.storeService.OpenKVStore(ctx) + bz, err := store.Get(types.LastTotalPowerKey) + if err != nil { + return math.ZeroInt(), err + } if bz == nil { - return math.ZeroInt() + return math.ZeroInt(), nil } ip := sdk.IntProto{} - k.cdc.MustUnmarshal(bz, &ip) + err = k.cdc.Unmarshal(bz, &ip) + if err != nil { + return math.ZeroInt(), err + } - return ip.Int + return ip.Int, nil } -// SetLastTotalPower Set the last total validator power. -func (k Keeper) SetLastTotalPower(ctx sdk.Context, power math.Int) { - store := ctx.KVStore(k.storeKey) - bz := k.cdc.MustMarshal(&sdk.IntProto{Int: power}) - store.Set(types.LastTotalPowerKey, bz) +// SetLastTotalPower sets the last total validator power. +func (k Keeper) SetLastTotalPower(ctx context.Context, power math.Int) error { + store := k.storeService.OpenKVStore(ctx) + bz, err := k.cdc.Marshal(&sdk.IntProto{Int: power}) + if err != nil { + return err + } + return store.Set(types.LastTotalPowerKey, bz) } // GetAuthority returns the x/staking module's authority. @@ -113,20 +136,39 @@ func (k Keeper) GetAuthority() string { return k.authority } +// ValidatorAddressCodec returns the app validator address codec. +func (k Keeper) ValidatorAddressCodec() addresscodec.Codec { + return k.validatorAddressCodec +} + +// ConsensusAddressCodec returns the app consensus address codec. +func (k Keeper) ConsensusAddressCodec() addresscodec.Codec { + return k.consensusAddressCodec +} + // SetValidatorUpdates sets the ABCI validator power updates for the current block. -func (k Keeper) SetValidatorUpdates(ctx sdk.Context, valUpdates []abci.ValidatorUpdate) { - store := ctx.KVStore(k.storeKey) - bz := k.cdc.MustMarshal(&types.ValidatorUpdates{Updates: valUpdates}) - store.Set(types.ValidatorUpdatesKey, bz) +func (k Keeper) SetValidatorUpdates(ctx context.Context, valUpdates []abci.ValidatorUpdate) error { + store := k.storeService.OpenKVStore(ctx) + bz, err := k.cdc.Marshal(&types.ValidatorUpdates{Updates: valUpdates}) + if err != nil { + return err + } + return store.Set(types.ValidatorUpdatesKey, bz) } // GetValidatorUpdates returns the ABCI validator power updates within the current block. -func (k Keeper) GetValidatorUpdates(ctx sdk.Context) []abci.ValidatorUpdate { - store := ctx.KVStore(k.storeKey) - bz := store.Get(types.ValidatorUpdatesKey) +func (k Keeper) GetValidatorUpdates(ctx context.Context) ([]abci.ValidatorUpdate, error) { + store := k.storeService.OpenKVStore(ctx) + bz, err := store.Get(types.ValidatorUpdatesKey) + if err != nil { + return nil, err + } var valUpdates types.ValidatorUpdates - k.cdc.MustUnmarshal(bz, &valUpdates) + err = k.cdc.Unmarshal(bz, &valUpdates) + if err != nil { + return nil, err + } - return valUpdates.Updates + return valUpdates.Updates, nil } diff --git a/x/staking/keeper/keeper_test.go b/x/staking/keeper/keeper_test.go index bbfbeda17467..ac1b5fc9e642 100644 --- a/x/staking/keeper/keeper_test.go +++ b/x/staking/keeper/keeper_test.go @@ -3,16 +3,17 @@ package keeper_test import ( "testing" - "cosmossdk.io/math" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" cmttime "github.com/cometbft/cometbft/types/time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" + "go.uber.org/mock/gomock" + "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec/address" + "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/testutil" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" @@ -42,7 +43,9 @@ type KeeperTestSuite struct { } func (s *KeeperTestSuite) SetupTest() { + require := s.Require() key := storetypes.NewKVStoreKey(stakingtypes.StoreKey) + storeService := runtime.NewKVStoreService(key) testCtx := testutil.DefaultContextWithDB(s.T(), key, storetypes.NewTransientStoreKey("transient_test")) ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{Time: cmttime.Now()}) encCfg := moduletestutil.MakeTestEncodingConfig() @@ -57,12 +60,14 @@ func (s *KeeperTestSuite) SetupTest() { keeper := stakingkeeper.NewKeeper( encCfg.Codec, - key, + storeService, accountKeeper, bankKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), + address.NewBech32Codec("cosmosvaloper"), + address.NewBech32Codec("cosmosvalcons"), ) - keeper.SetParams(ctx, stakingtypes.DefaultParams()) + require.NoError(keeper.SetParams(ctx, stakingtypes.DefaultParams())) s.ctx = ctx s.stakingKeeper = keeper @@ -82,13 +87,15 @@ func (s *KeeperTestSuite) TestParams() { expParams := stakingtypes.DefaultParams() // check that the empty keeper loads the default - resParams := keeper.GetParams(ctx) + resParams, err := keeper.GetParams(ctx) + require.NoError(err) require.Equal(expParams, resParams) expParams.MaxValidators = 555 expParams.MaxEntries = 111 - keeper.SetParams(ctx, expParams) - resParams = keeper.GetParams(ctx) + require.NoError(keeper.SetParams(ctx, expParams)) + resParams, err = keeper.GetParams(ctx) + require.NoError(err) require.True(expParams.Equal(resParams)) } @@ -97,8 +104,9 @@ func (s *KeeperTestSuite) TestLastTotalPower() { require := s.Require() expTotalPower := math.NewInt(10 ^ 9) - keeper.SetLastTotalPower(ctx, expTotalPower) - resTotalPower := keeper.GetLastTotalPower(ctx) + require.NoError(keeper.SetLastTotalPower(ctx, expTotalPower)) + resTotalPower, err := keeper.GetLastTotalPower(ctx) + require.NoError(err) require.True(expTotalPower.Equal(resTotalPower)) } diff --git a/x/staking/keeper/migrations.go b/x/staking/keeper/migrations.go index 8782f5978316..e94848b13397 100644 --- a/x/staking/keeper/migrations.go +++ b/x/staking/keeper/migrations.go @@ -1,6 +1,7 @@ package keeper import ( + "github.com/cosmos/cosmos-sdk/runtime" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/exported" v2 "github.com/cosmos/cosmos-sdk/x/staking/migrations/v2" @@ -15,7 +16,7 @@ type Migrator struct { legacySubspace exported.Subspace } -// NewMigrator returns a new Migrator. +// NewMigrator returns a new Migrator instance. func NewMigrator(keeper *Keeper, legacySubspace exported.Subspace) Migrator { return Migrator{ keeper: keeper, @@ -25,20 +26,24 @@ func NewMigrator(keeper *Keeper, legacySubspace exported.Subspace) Migrator { // Migrate1to2 migrates from version 1 to 2. func (m Migrator) Migrate1to2(ctx sdk.Context) error { - return v2.MigrateStore(ctx, m.keeper.storeKey) + store := runtime.KVStoreAdapter(m.keeper.storeService.OpenKVStore(ctx)) + return v2.MigrateStore(ctx, store) } // Migrate2to3 migrates x/staking state from consensus version 2 to 3. func (m Migrator) Migrate2to3(ctx sdk.Context) error { - return v3.MigrateStore(ctx, m.keeper.storeKey, m.keeper.cdc, m.legacySubspace) + store := runtime.KVStoreAdapter(m.keeper.storeService.OpenKVStore(ctx)) + return v3.MigrateStore(ctx, store, m.keeper.cdc, m.legacySubspace) } // Migrate3to4 migrates x/staking state from consensus version 3 to 4. func (m Migrator) Migrate3to4(ctx sdk.Context) error { - return v4.MigrateStore(ctx, m.keeper.storeKey, m.keeper.cdc, m.legacySubspace) + store := runtime.KVStoreAdapter(m.keeper.storeService.OpenKVStore(ctx)) + return v4.MigrateStore(ctx, store, m.keeper.cdc, m.legacySubspace) } // Migrate4to5 migrates x/staking state from consensus version 4 to 5. func (m Migrator) Migrate4to5(ctx sdk.Context) error { - return v5.MigrateStore(ctx, m.keeper.storeKey, m.keeper.cdc) + store := runtime.KVStoreAdapter(m.keeper.storeService.OpenKVStore(ctx)) + return v5.MigrateStore(ctx, store, m.keeper.cdc) } diff --git a/x/staking/keeper/msg_server.go b/x/staking/keeper/msg_server.go index 94793e455760..19b7ba7a2593 100644 --- a/x/staking/keeper/msg_server.go +++ b/x/staking/keeper/msg_server.go @@ -5,13 +5,13 @@ import ( "strconv" "time" - errorsmod "cosmossdk.io/errors" - "cosmossdk.io/math" - - "github.com/armon/go-metrics" + "github.com/hashicorp/go-metrics" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + errorsmod "cosmossdk.io/errors" + "cosmossdk.io/math" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" @@ -24,7 +24,7 @@ type msgServer struct { *Keeper } -// NewMsgServerImpl returns an implementation of the bank MsgServer interface +// NewMsgServerImpl returns an implementation of the staking MsgServer interface // for the provided Keeper. func NewMsgServerImpl(keeper *Keeper) types.MsgServer { return &msgServer{Keeper: keeper} @@ -33,24 +33,27 @@ func NewMsgServerImpl(keeper *Keeper) types.MsgServer { var _ types.MsgServer = msgServer{} // CreateValidator defines a method for creating a new validator -func (k msgServer) CreateValidator(goCtx context.Context, msg *types.MsgCreateValidator) (*types.MsgCreateValidatorResponse, error) { - valAddr, err := sdk.ValAddressFromBech32(msg.ValidatorAddress) +func (k msgServer) CreateValidator(ctx context.Context, msg *types.MsgCreateValidator) (*types.MsgCreateValidatorResponse, error) { + valAddr, err := k.validatorAddressCodec.StringToBytes(msg.ValidatorAddress) if err != nil { return nil, sdkerrors.ErrInvalidAddress.Wrapf("invalid validator address: %s", err) } - if err := msg.Validate(); err != nil { + if err := msg.Validate(k.validatorAddressCodec); err != nil { return nil, err } - ctx := sdk.UnwrapSDKContext(goCtx) + minCommRate, err := k.MinCommissionRate(ctx) + if err != nil { + return nil, err + } - if msg.Commission.Rate.LT(k.MinCommissionRate(ctx)) { - return nil, errorsmod.Wrapf(types.ErrCommissionLTMinRate, "cannot set validator commission to less than minimum rate of %s", k.MinCommissionRate(ctx)) + if msg.Commission.Rate.LT(minCommRate) { + return nil, errorsmod.Wrapf(types.ErrCommissionLTMinRate, "cannot set validator commission to less than minimum rate of %s", minCommRate) } // check to see if the pubkey or sender has been registered before - if _, found := k.GetValidator(ctx, valAddr); found { + if _, err := k.GetValidator(ctx, valAddr); err == nil { return nil, types.ErrValidatorOwnerExists } @@ -59,11 +62,15 @@ func (k msgServer) CreateValidator(goCtx context.Context, msg *types.MsgCreateVa return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidType, "Expecting cryptotypes.PubKey, got %T", pk) } - if _, found := k.GetValidatorByConsAddr(ctx, sdk.GetConsAddress(pk)); found { + if _, err := k.GetValidatorByConsAddr(ctx, sdk.GetConsAddress(pk)); err == nil { return nil, types.ErrValidatorPubKeyExists } - bondDenom := k.BondDenom(ctx) + bondDenom, err := k.BondDenom(ctx) + if err != nil { + return nil, err + } + if msg.Value.Denom != bondDenom { return nil, errorsmod.Wrapf( sdkerrors.ErrInvalidRequest, "invalid coin denomination: got %s, expected %s", msg.Value.Denom, bondDenom, @@ -74,7 +81,8 @@ func (k msgServer) CreateValidator(goCtx context.Context, msg *types.MsgCreateVa return nil, err } - cp := ctx.ConsensusParams() + sdkCtx := sdk.UnwrapSDKContext(ctx) + cp := sdkCtx.ConsensusParams() if cp.Validator != nil { pkType := pk.Type() hasKeyType := false @@ -92,14 +100,14 @@ func (k msgServer) CreateValidator(goCtx context.Context, msg *types.MsgCreateVa } } - validator, err := types.NewValidator(valAddr, pk, msg.Description) + validator, err := types.NewValidator(msg.ValidatorAddress, pk, msg.Description) if err != nil { return nil, err } commission := types.NewCommissionWithTime( msg.Commission.Rate, msg.Commission.MaxRate, - msg.Commission.MaxChangeRate, ctx.BlockHeader().Time, + msg.Commission.MaxChangeRate, sdkCtx.BlockHeader().Time, ) validator, err = validator.SetInitialCommission(commission) @@ -109,12 +117,23 @@ func (k msgServer) CreateValidator(goCtx context.Context, msg *types.MsgCreateVa validator.MinSelfDelegation = msg.MinSelfDelegation - k.SetValidator(ctx, validator) - k.SetValidatorByConsAddr(ctx, validator) - k.SetNewValidatorByPowerIndex(ctx, validator) + err = k.SetValidator(ctx, validator) + if err != nil { + return nil, err + } + + err = k.SetValidatorByConsAddr(ctx, validator) + if err != nil { + return nil, err + } + + err = k.SetNewValidatorByPowerIndex(ctx, validator) + if err != nil { + return nil, err + } // call the after-creation hook - if err := k.Hooks().AfterValidatorCreated(ctx, validator.GetOperator()); err != nil { + if err := k.Hooks().AfterValidatorCreated(ctx, valAddr); err != nil { return nil, err } @@ -126,7 +145,7 @@ func (k msgServer) CreateValidator(goCtx context.Context, msg *types.MsgCreateVa return nil, err } - ctx.EventManager().EmitEvents(sdk.Events{ + sdkCtx.EventManager().EmitEvents(sdk.Events{ sdk.NewEvent( types.EventTypeCreateValidator, sdk.NewAttribute(types.AttributeKeyValidator, msg.ValidatorAddress), @@ -138,8 +157,8 @@ func (k msgServer) CreateValidator(goCtx context.Context, msg *types.MsgCreateVa } // EditValidator defines a method for editing an existing validator -func (k msgServer) EditValidator(goCtx context.Context, msg *types.MsgEditValidator) (*types.MsgEditValidatorResponse, error) { - valAddr, err := sdk.ValAddressFromBech32(msg.ValidatorAddress) +func (k msgServer) EditValidator(ctx context.Context, msg *types.MsgEditValidator) (*types.MsgEditValidatorResponse, error) { + valAddr, err := k.validatorAddressCodec.StringToBytes(msg.ValidatorAddress) if err != nil { return nil, sdkerrors.ErrInvalidAddress.Wrapf("invalid validator address: %s", err) } @@ -159,14 +178,21 @@ func (k msgServer) EditValidator(goCtx context.Context, msg *types.MsgEditValida if msg.CommissionRate.GT(math.LegacyOneDec()) || msg.CommissionRate.IsNegative() { return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "commission rate must be between 0 and 1 (inclusive)") } - } - ctx := sdk.UnwrapSDKContext(goCtx) + minCommissionRate, err := k.MinCommissionRate(ctx) + if err != nil { + return nil, errorsmod.Wrap(sdkerrors.ErrLogic, err.Error()) + } + + if msg.CommissionRate.LT(minCommissionRate) { + return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "commission rate cannot be less than the min commission rate %s", minCommissionRate.String()) + } + } // validator must already be registered - validator, found := k.GetValidator(ctx, valAddr) - if !found { - return nil, types.ErrNoValidatorFound + validator, err := k.GetValidator(ctx, valAddr) + if err != nil { + return nil, err } // replace all editable fields (clients should autofill existing values) @@ -203,9 +229,13 @@ func (k msgServer) EditValidator(goCtx context.Context, msg *types.MsgEditValida validator.MinSelfDelegation = *msg.MinSelfDelegation } - k.SetValidator(ctx, validator) + err = k.SetValidator(ctx, validator) + if err != nil { + return nil, err + } - ctx.EventManager().EmitEvents(sdk.Events{ + sdkCtx := sdk.UnwrapSDKContext(ctx) + sdkCtx.EventManager().EmitEvents(sdk.Events{ sdk.NewEvent( types.EventTypeEditValidator, sdk.NewAttribute(types.AttributeKeyCommissionRate, validator.Commission.String()), @@ -217,8 +247,8 @@ func (k msgServer) EditValidator(goCtx context.Context, msg *types.MsgEditValida } // Delegate defines a method for performing a delegation of coins from a delegator to a validator -func (k msgServer) Delegate(goCtx context.Context, msg *types.MsgDelegate) (*types.MsgDelegateResponse, error) { - valAddr, valErr := sdk.ValAddressFromBech32(msg.ValidatorAddress) +func (k msgServer) Delegate(ctx context.Context, msg *types.MsgDelegate) (*types.MsgDelegateResponse, error) { + valAddr, valErr := k.validatorAddressCodec.StringToBytes(msg.ValidatorAddress) if valErr != nil { return nil, sdkerrors.ErrInvalidAddress.Wrapf("invalid validator address: %s", valErr) } @@ -235,14 +265,16 @@ func (k msgServer) Delegate(goCtx context.Context, msg *types.MsgDelegate) (*typ ) } - ctx := sdk.UnwrapSDKContext(goCtx) + validator, err := k.GetValidator(ctx, valAddr) + if err != nil { + return nil, err + } - validator, found := k.GetValidator(ctx, valAddr) - if !found { - return nil, types.ErrNoValidatorFound + bondDenom, err := k.BondDenom(ctx) + if err != nil { + return nil, err } - bondDenom := k.BondDenom(ctx) if msg.Amount.Denom != bondDenom { return nil, errorsmod.Wrapf( sdkerrors.ErrInvalidRequest, "invalid coin denomination: got %s, expected %s", msg.Amount.Denom, bondDenom, @@ -266,10 +298,12 @@ func (k msgServer) Delegate(goCtx context.Context, msg *types.MsgDelegate) (*typ }() } - ctx.EventManager().EmitEvents(sdk.Events{ + sdkCtx := sdk.UnwrapSDKContext(ctx) + sdkCtx.EventManager().EmitEvents(sdk.Events{ sdk.NewEvent( types.EventTypeDelegate, sdk.NewAttribute(types.AttributeKeyValidator, msg.ValidatorAddress), + sdk.NewAttribute(types.AttributeKeyDelegator, msg.DelegatorAddress), sdk.NewAttribute(sdk.AttributeKeyAmount, msg.Amount.String()), sdk.NewAttribute(types.AttributeKeyNewShares, newShares.String()), ), @@ -278,14 +312,14 @@ func (k msgServer) Delegate(goCtx context.Context, msg *types.MsgDelegate) (*typ return &types.MsgDelegateResponse{}, nil } -// BeginRedelegate defines a method for performing a redelegation of coins from a delegator and source validator to a destination validator -func (k msgServer) BeginRedelegate(goCtx context.Context, msg *types.MsgBeginRedelegate) (*types.MsgBeginRedelegateResponse, error) { - valSrcAddr, err := sdk.ValAddressFromBech32(msg.ValidatorSrcAddress) +// BeginRedelegate defines a method for performing a redelegation of coins from a source validator to a destination validator of given delegator +func (k msgServer) BeginRedelegate(ctx context.Context, msg *types.MsgBeginRedelegate) (*types.MsgBeginRedelegateResponse, error) { + valSrcAddr, err := k.validatorAddressCodec.StringToBytes(msg.ValidatorSrcAddress) if err != nil { return nil, sdkerrors.ErrInvalidAddress.Wrapf("invalid source validator address: %s", err) } - valDstAddr, err := sdk.ValAddressFromBech32(msg.ValidatorDstAddress) + valDstAddr, err := k.validatorAddressCodec.StringToBytes(msg.ValidatorDstAddress) if err != nil { return nil, sdkerrors.ErrInvalidAddress.Wrapf("invalid destination validator address: %s", err) } @@ -302,8 +336,6 @@ func (k msgServer) BeginRedelegate(goCtx context.Context, msg *types.MsgBeginRed ) } - ctx := sdk.UnwrapSDKContext(goCtx) - shares, err := k.ValidateUnbondAmount( ctx, delegatorAddress, valSrcAddr, msg.Amount.Amount, ) @@ -311,7 +343,11 @@ func (k msgServer) BeginRedelegate(goCtx context.Context, msg *types.MsgBeginRed return nil, err } - bondDenom := k.BondDenom(ctx) + bondDenom, err := k.BondDenom(ctx) + if err != nil { + return nil, err + } + if msg.Amount.Denom != bondDenom { return nil, errorsmod.Wrapf( sdkerrors.ErrInvalidRequest, "invalid coin denomination: got %s, expected %s", msg.Amount.Denom, bondDenom, @@ -336,7 +372,8 @@ func (k msgServer) BeginRedelegate(goCtx context.Context, msg *types.MsgBeginRed }() } - ctx.EventManager().EmitEvents(sdk.Events{ + sdkCtx := sdk.UnwrapSDKContext(ctx) + sdkCtx.EventManager().EmitEvents(sdk.Events{ sdk.NewEvent( types.EventTypeRedelegate, sdk.NewAttribute(types.AttributeKeySrcValidator, msg.ValidatorSrcAddress), @@ -352,8 +389,8 @@ func (k msgServer) BeginRedelegate(goCtx context.Context, msg *types.MsgBeginRed } // Undelegate defines a method for performing an undelegation from a delegate and a validator -func (k msgServer) Undelegate(goCtx context.Context, msg *types.MsgUndelegate) (*types.MsgUndelegateResponse, error) { - addr, err := sdk.ValAddressFromBech32(msg.ValidatorAddress) +func (k msgServer) Undelegate(ctx context.Context, msg *types.MsgUndelegate) (*types.MsgUndelegateResponse, error) { + addr, err := k.validatorAddressCodec.StringToBytes(msg.ValidatorAddress) if err != nil { return nil, sdkerrors.ErrInvalidAddress.Wrapf("invalid validator address: %s", err) } @@ -370,8 +407,6 @@ func (k msgServer) Undelegate(goCtx context.Context, msg *types.MsgUndelegate) ( ) } - ctx := sdk.UnwrapSDKContext(goCtx) - shares, err := k.ValidateUnbondAmount( ctx, delegatorAddress, addr, msg.Amount.Amount, ) @@ -379,7 +414,11 @@ func (k msgServer) Undelegate(goCtx context.Context, msg *types.MsgUndelegate) ( return nil, err } - bondDenom := k.BondDenom(ctx) + bondDenom, err := k.BondDenom(ctx) + if err != nil { + return nil, err + } + if msg.Amount.Denom != bondDenom { return nil, errorsmod.Wrapf( sdkerrors.ErrInvalidRequest, "invalid coin denomination: got %s, expected %s", msg.Amount.Denom, bondDenom, @@ -404,10 +443,12 @@ func (k msgServer) Undelegate(goCtx context.Context, msg *types.MsgUndelegate) ( }() } - ctx.EventManager().EmitEvents(sdk.Events{ + sdkCtx := sdk.UnwrapSDKContext(ctx) + sdkCtx.EventManager().EmitEvents(sdk.Events{ sdk.NewEvent( types.EventTypeUnbond, sdk.NewAttribute(types.AttributeKeyValidator, msg.ValidatorAddress), + sdk.NewAttribute(types.AttributeKeyDelegator, msg.DelegatorAddress), sdk.NewAttribute(sdk.AttributeKeyAmount, undelegatedCoin.String()), sdk.NewAttribute(types.AttributeKeyCompletionTime, completionTime.Format(time.RFC3339)), ), @@ -421,8 +462,8 @@ func (k msgServer) Undelegate(goCtx context.Context, msg *types.MsgUndelegate) ( // CancelUnbondingDelegation defines a method for canceling the unbonding delegation // and delegate back to the validator. -func (k msgServer) CancelUnbondingDelegation(goCtx context.Context, msg *types.MsgCancelUnbondingDelegation) (*types.MsgCancelUnbondingDelegationResponse, error) { - valAddr, err := sdk.ValAddressFromBech32(msg.ValidatorAddress) +func (k msgServer) CancelUnbondingDelegation(ctx context.Context, msg *types.MsgCancelUnbondingDelegation) (*types.MsgCancelUnbondingDelegationResponse, error) { + valAddr, err := k.validatorAddressCodec.StringToBytes(msg.ValidatorAddress) if err != nil { return nil, sdkerrors.ErrInvalidAddress.Wrapf("invalid validator address: %s", err) } @@ -446,18 +487,20 @@ func (k msgServer) CancelUnbondingDelegation(goCtx context.Context, msg *types.M ) } - ctx := sdk.UnwrapSDKContext(goCtx) + bondDenom, err := k.BondDenom(ctx) + if err != nil { + return nil, err + } - bondDenom := k.BondDenom(ctx) if msg.Amount.Denom != bondDenom { return nil, errorsmod.Wrapf( sdkerrors.ErrInvalidRequest, "invalid coin denomination: got %s, expected %s", msg.Amount.Denom, bondDenom, ) } - validator, found := k.GetValidator(ctx, valAddr) - if !found { - return nil, types.ErrNoValidatorFound + validator, err := k.GetValidator(ctx, valAddr) + if err != nil { + return nil, err } // In some situations, the exchange rate becomes invalid, e.g. if @@ -471,8 +514,8 @@ func (k msgServer) CancelUnbondingDelegation(goCtx context.Context, msg *types.M return nil, types.ErrValidatorJailed } - ubd, found := k.GetUnbondingDelegation(ctx, delegatorAddress, valAddr) - if !found { + ubd, err := k.GetUnbondingDelegation(ctx, delegatorAddress, valAddr) + if err != nil { return nil, status.Errorf( codes.NotFound, "unbonding delegation with delegator %s not found for validator %s", @@ -500,7 +543,8 @@ func (k msgServer) CancelUnbondingDelegation(goCtx context.Context, msg *types.M return nil, sdkerrors.ErrInvalidRequest.Wrap("amount is greater than the unbonding delegation entry balance") } - if unbondEntry.CompletionTime.Before(ctx.BlockTime()) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + if unbondEntry.CompletionTime.Before(sdkCtx.BlockTime()) { return nil, sdkerrors.ErrInvalidRequest.Wrap("unbonding delegation is already processed") } @@ -522,12 +566,16 @@ func (k msgServer) CancelUnbondingDelegation(goCtx context.Context, msg *types.M // set the unbonding delegation or remove it if there are no more entries if len(ubd.Entries) == 0 { - k.RemoveUnbondingDelegation(ctx, ubd) + err = k.RemoveUnbondingDelegation(ctx, ubd) } else { - k.SetUnbondingDelegation(ctx, ubd) + err = k.SetUnbondingDelegation(ctx, ubd) } - ctx.EventManager().EmitEvent( + if err != nil { + return nil, err + } + + sdkCtx.EventManager().EmitEvent( sdk.NewEvent( types.EventTypeCancelUnbondingDelegation, sdk.NewAttribute(sdk.AttributeKeyAmount, msg.Amount.String()), @@ -540,7 +588,8 @@ func (k msgServer) CancelUnbondingDelegation(goCtx context.Context, msg *types.M return &types.MsgCancelUnbondingDelegationResponse{}, nil } -func (k msgServer) UpdateParams(goCtx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { +// UpdateParams defines a method to perform updation of params exist in x/staking module. +func (k msgServer) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { if k.authority != msg.Authority { return nil, errorsmod.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", k.authority, msg.Authority) } @@ -549,8 +598,6 @@ func (k msgServer) UpdateParams(goCtx context.Context, msg *types.MsgUpdateParam return nil, err } - ctx := sdk.UnwrapSDKContext(goCtx) - // store params if err := k.SetParams(ctx, msg.Params); err != nil { return nil, err diff --git a/x/staking/keeper/msg_server_test.go b/x/staking/keeper/msg_server_test.go index bc153ee44fd3..ca8720ccb81e 100644 --- a/x/staking/keeper/msg_server_test.go +++ b/x/staking/keeper/msg_server_test.go @@ -4,9 +4,9 @@ import ( "testing" "time" - "cosmossdk.io/math" + "go.uber.org/mock/gomock" - "github.com/golang/mock/gomock" + "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/codec/address" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -49,8 +49,8 @@ func (s *KeeperTestSuite) TestMsgCreateValidator() { input: &stakingtypes.MsgCreateValidator{ Description: stakingtypes.Description{}, Commission: stakingtypes.CommissionRates{ - Rate: sdk.NewDecWithPrec(5, 1), - MaxRate: sdk.NewDecWithPrec(5, 1), + Rate: math.LegacyNewDecWithPrec(5, 1), + MaxRate: math.LegacyNewDecWithPrec(5, 1), MaxChangeRate: math.LegacyNewDec(0), }, MinSelfDelegation: math.NewInt(1), @@ -69,8 +69,8 @@ func (s *KeeperTestSuite) TestMsgCreateValidator() { Moniker: "NewValidator", }, Commission: stakingtypes.CommissionRates{ - Rate: sdk.NewDecWithPrec(5, 1), - MaxRate: sdk.NewDecWithPrec(5, 1), + Rate: math.LegacyNewDecWithPrec(5, 1), + MaxRate: math.LegacyNewDecWithPrec(5, 1), MaxChangeRate: math.LegacyNewDec(0), }, MinSelfDelegation: math.NewInt(1), @@ -89,8 +89,8 @@ func (s *KeeperTestSuite) TestMsgCreateValidator() { Moniker: "NewValidator", }, Commission: stakingtypes.CommissionRates{ - Rate: sdk.NewDecWithPrec(5, 1), - MaxRate: sdk.NewDecWithPrec(5, 1), + Rate: math.LegacyNewDecWithPrec(5, 1), + MaxRate: math.LegacyNewDecWithPrec(5, 1), MaxChangeRate: math.LegacyNewDec(0), }, MinSelfDelegation: math.NewInt(1), @@ -109,8 +109,8 @@ func (s *KeeperTestSuite) TestMsgCreateValidator() { Moniker: "NewValidator", }, Commission: stakingtypes.CommissionRates{ - Rate: sdk.NewDecWithPrec(5, 1), - MaxRate: sdk.NewDecWithPrec(5, 1), + Rate: math.LegacyNewDecWithPrec(5, 1), + MaxRate: math.LegacyNewDecWithPrec(5, 1), MaxChangeRate: math.LegacyNewDec(0), }, MinSelfDelegation: math.NewInt(1), @@ -129,8 +129,8 @@ func (s *KeeperTestSuite) TestMsgCreateValidator() { Moniker: "NewValidator", }, Commission: stakingtypes.CommissionRates{ - Rate: sdk.NewDecWithPrec(5, 1), - MaxRate: sdk.NewDecWithPrec(5, 1), + Rate: math.LegacyNewDecWithPrec(5, 1), + MaxRate: math.LegacyNewDecWithPrec(5, 1), MaxChangeRate: math.LegacyNewDec(0), }, MinSelfDelegation: math.NewInt(1), @@ -149,8 +149,8 @@ func (s *KeeperTestSuite) TestMsgCreateValidator() { Moniker: "NewValidator", }, Commission: stakingtypes.CommissionRates{ - Rate: sdk.NewDecWithPrec(5, 1), - MaxRate: sdk.NewDecWithPrec(5, 1), + Rate: math.LegacyNewDecWithPrec(5, 1), + MaxRate: math.LegacyNewDecWithPrec(5, 1), MaxChangeRate: math.LegacyNewDec(0), }, MinSelfDelegation: math.NewInt(0), @@ -169,8 +169,8 @@ func (s *KeeperTestSuite) TestMsgCreateValidator() { Moniker: "NewValidator", }, Commission: stakingtypes.CommissionRates{ - Rate: sdk.NewDecWithPrec(5, 1), - MaxRate: sdk.NewDecWithPrec(5, 1), + Rate: math.LegacyNewDecWithPrec(5, 1), + MaxRate: math.LegacyNewDecWithPrec(5, 1), MaxChangeRate: math.LegacyNewDec(0), }, MinSelfDelegation: math.NewInt(-1), @@ -189,8 +189,8 @@ func (s *KeeperTestSuite) TestMsgCreateValidator() { Moniker: "NewValidator", }, Commission: stakingtypes.CommissionRates{ - Rate: sdk.NewDecWithPrec(5, 1), - MaxRate: sdk.NewDecWithPrec(5, 1), + Rate: math.LegacyNewDecWithPrec(5, 1), + MaxRate: math.LegacyNewDecWithPrec(5, 1), MaxChangeRate: math.LegacyNewDec(0), }, MinSelfDelegation: math.NewInt(100), @@ -213,8 +213,8 @@ func (s *KeeperTestSuite) TestMsgCreateValidator() { Details: "details", }, Commission: stakingtypes.CommissionRates{ - Rate: sdk.NewDecWithPrec(5, 1), - MaxRate: sdk.NewDecWithPrec(5, 1), + Rate: math.LegacyNewDecWithPrec(5, 1), + MaxRate: math.LegacyNewDecWithPrec(5, 1), MaxChangeRate: math.LegacyNewDec(0), }, MinSelfDelegation: math.NewInt(1), @@ -252,7 +252,7 @@ func (s *KeeperTestSuite) TestMsgEditValidator() { require.NotNil(pk) comm := stakingtypes.NewCommissionRates(math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0)) - msg, err := stakingtypes.NewMsgCreateValidator(ValAddr, pk, sdk.NewCoin("stake", sdk.NewInt(10)), stakingtypes.Description{Moniker: "NewVal"}, comm, math.OneInt()) + msg, err := stakingtypes.NewMsgCreateValidator(ValAddr.String(), pk, sdk.NewCoin("stake", math.NewInt(10)), stakingtypes.Description{Moniker: "NewVal"}, comm, math.OneInt()) require.NoError(err) res, err := msgServer.CreateValidator(ctx, msg) @@ -426,7 +426,7 @@ func (s *KeeperTestSuite) TestMsgDelegate() { comm := stakingtypes.NewCommissionRates(math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0)) - msg, err := stakingtypes.NewMsgCreateValidator(ValAddr, pk, sdk.NewCoin("stake", sdk.NewInt(10)), stakingtypes.Description{Moniker: "NewVal"}, comm, math.OneInt()) + msg, err := stakingtypes.NewMsgCreateValidator(ValAddr.String(), pk, sdk.NewCoin("stake", math.NewInt(10)), stakingtypes.Description{Moniker: "NewVal"}, comm, math.OneInt()) require.NoError(err) res, err := msgServer.CreateValidator(ctx, msg) @@ -551,14 +551,14 @@ func (s *KeeperTestSuite) TestMsgBeginRedelegate() { comm := stakingtypes.NewCommissionRates(math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0)) amt := sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: keeper.TokensFromConsensusPower(s.ctx, int64(100))} - msg, err := stakingtypes.NewMsgCreateValidator(srcValAddr, pk, amt, stakingtypes.Description{Moniker: "NewVal"}, comm, math.OneInt()) + msg, err := stakingtypes.NewMsgCreateValidator(srcValAddr.String(), pk, amt, stakingtypes.Description{Moniker: "NewVal"}, comm, math.OneInt()) require.NoError(err) res, err := msgServer.CreateValidator(ctx, msg) require.NoError(err) require.NotNil(res) s.bankKeeper.EXPECT().DelegateCoinsFromAccountToModule(gomock.Any(), addr2, stakingtypes.NotBondedPoolName, gomock.Any()).AnyTimes() - msg, err = stakingtypes.NewMsgCreateValidator(dstValAddr, dstPk, amt, stakingtypes.Description{Moniker: "NewVal"}, comm, math.OneInt()) + msg, err = stakingtypes.NewMsgCreateValidator(dstValAddr.String(), dstPk, amt, stakingtypes.Description{Moniker: "NewVal"}, comm, math.OneInt()) require.NoError(err) res, err = msgServer.CreateValidator(ctx, msg) @@ -566,10 +566,10 @@ func (s *KeeperTestSuite) TestMsgBeginRedelegate() { require.NotNil(res) shares := math.LegacyNewDec(100) - del := stakingtypes.NewDelegation(Addr, srcValAddr, shares) - keeper.SetDelegation(ctx, del) - _, found := keeper.GetDelegation(ctx, Addr, srcValAddr) - require.True(found) + del := stakingtypes.NewDelegation(Addr.String(), srcValAddr.String(), shares) + require.NoError(keeper.SetDelegation(ctx, del)) + _, err = keeper.GetDelegation(ctx, Addr, srcValAddr) + require.NoError(err) testCases := []struct { name string @@ -713,17 +713,17 @@ func (s *KeeperTestSuite) TestMsgUndelegate() { comm := stakingtypes.NewCommissionRates(math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0)) amt := sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: keeper.TokensFromConsensusPower(s.ctx, int64(100))} - msg, err := stakingtypes.NewMsgCreateValidator(ValAddr, pk, amt, stakingtypes.Description{Moniker: "NewVal"}, comm, math.OneInt()) + msg, err := stakingtypes.NewMsgCreateValidator(ValAddr.String(), pk, amt, stakingtypes.Description{Moniker: "NewVal"}, comm, math.OneInt()) require.NoError(err) res, err := msgServer.CreateValidator(ctx, msg) require.NoError(err) require.NotNil(res) shares := math.LegacyNewDec(100) - del := stakingtypes.NewDelegation(Addr, ValAddr, shares) - keeper.SetDelegation(ctx, del) - _, found := keeper.GetDelegation(ctx, Addr, ValAddr) - require.True(found) + del := stakingtypes.NewDelegation(Addr.String(), ValAddr.String(), shares) + require.NoError(keeper.SetDelegation(ctx, del)) + _, err = keeper.GetDelegation(ctx, Addr, ValAddr) + require.NoError(err) testCases := []struct { name string @@ -827,7 +827,7 @@ func (s *KeeperTestSuite) TestMsgUndelegate() { } func (s *KeeperTestSuite) TestMsgCancelUnbondingDelegation() { - ctx, keeper, msgServer := s.ctx, s.stakingKeeper, s.msgServer + ctx, keeper, msgServer, ak := s.ctx, s.stakingKeeper, s.msgServer, s.accountKeeper require := s.Require() pk := ed25519.GenPrivKey().PubKey() @@ -838,23 +838,23 @@ func (s *KeeperTestSuite) TestMsgCancelUnbondingDelegation() { s.bankKeeper.EXPECT().DelegateCoinsFromAccountToModule(gomock.Any(), Addr, stakingtypes.NotBondedPoolName, gomock.Any()).AnyTimes() - msg, err := stakingtypes.NewMsgCreateValidator(ValAddr, pk, amt, stakingtypes.Description{Moniker: "NewVal"}, comm, math.OneInt()) + msg, err := stakingtypes.NewMsgCreateValidator(ValAddr.String(), pk, amt, stakingtypes.Description{Moniker: "NewVal"}, comm, math.OneInt()) require.NoError(err) res, err := msgServer.CreateValidator(ctx, msg) require.NoError(err) require.NotNil(res) shares := math.LegacyNewDec(100) - del := stakingtypes.NewDelegation(Addr, ValAddr, shares) - keeper.SetDelegation(ctx, del) - resDel, found := keeper.GetDelegation(ctx, Addr, ValAddr) - require.True(found) + del := stakingtypes.NewDelegation(Addr.String(), ValAddr.String(), shares) + require.NoError(keeper.SetDelegation(ctx, del)) + resDel, err := keeper.GetDelegation(ctx, Addr, ValAddr) + require.NoError(err) require.Equal(del, resDel) - ubd := stakingtypes.NewUnbondingDelegation(Addr, ValAddr, 10, ctx.BlockTime().Add(time.Minute*10), shares.RoundInt(), 0) - keeper.SetUnbondingDelegation(ctx, ubd) - resUnbond, found := keeper.GetUnbondingDelegation(ctx, Addr, ValAddr) - require.True(found) + ubd := stakingtypes.NewUnbondingDelegation(Addr, ValAddr, 10, ctx.BlockTime().Add(time.Minute*10), shares.RoundInt(), 0, keeper.ValidatorAddressCodec(), ak.AddressCodec()) + require.NoError(keeper.SetUnbondingDelegation(ctx, ubd)) + resUnbond, err := keeper.GetUnbondingDelegation(ctx, Addr, ValAddr) + require.NoError(err) require.Equal(ubd, resUnbond) testCases := []struct { @@ -945,7 +945,7 @@ func (s *KeeperTestSuite) TestMsgCancelUnbondingDelegation() { input: &stakingtypes.MsgCancelUnbondingDelegation{ DelegatorAddress: Addr.String(), ValidatorAddress: ValAddr.String(), - Amount: sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(101)), + Amount: sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(101)), CreationHeight: 10, }, expErr: true, @@ -956,7 +956,7 @@ func (s *KeeperTestSuite) TestMsgCancelUnbondingDelegation() { input: &stakingtypes.MsgCancelUnbondingDelegation{ DelegatorAddress: Addr.String(), ValidatorAddress: ValAddr.String(), - Amount: sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(0)), + Amount: sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(0)), CreationHeight: 10, }, expErr: true, diff --git a/x/staking/keeper/params.go b/x/staking/keeper/params.go index 74316694d9bf..83e29708470c 100644 --- a/x/staking/keeper/params.go +++ b/x/staking/keeper/params.go @@ -1,6 +1,7 @@ package keeper import ( + "context" "time" "cosmossdk.io/math" @@ -10,66 +11,74 @@ import ( ) // UnbondingTime - The time duration for unbonding -func (k Keeper) UnbondingTime(ctx sdk.Context) time.Duration { - return k.GetParams(ctx).UnbondingTime +func (k Keeper) UnbondingTime(ctx context.Context) (time.Duration, error) { + params, err := k.GetParams(ctx) + return params.UnbondingTime, err } // MaxValidators - Maximum number of validators -func (k Keeper) MaxValidators(ctx sdk.Context) uint32 { - return k.GetParams(ctx).MaxValidators +func (k Keeper) MaxValidators(ctx context.Context) (uint32, error) { + params, err := k.GetParams(ctx) + return params.MaxValidators, err } // MaxEntries - Maximum number of simultaneous unbonding // delegations or redelegations (per pair/trio) -func (k Keeper) MaxEntries(ctx sdk.Context) uint32 { - return k.GetParams(ctx).MaxEntries +func (k Keeper) MaxEntries(ctx context.Context) (uint32, error) { + params, err := k.GetParams(ctx) + return params.MaxEntries, err } // HistoricalEntries = number of historical info entries // to persist in store -func (k Keeper) HistoricalEntries(ctx sdk.Context) uint32 { - return k.GetParams(ctx).HistoricalEntries +func (k Keeper) HistoricalEntries(ctx context.Context) (uint32, error) { + params, err := k.GetParams(ctx) + return params.HistoricalEntries, err } // BondDenom - Bondable coin denomination -func (k Keeper) BondDenom(ctx sdk.Context) string { - return k.GetParams(ctx).BondDenom +func (k Keeper) BondDenom(ctx context.Context) (string, error) { + params, err := k.GetParams(ctx) + return params.BondDenom, err } // PowerReduction - is the amount of staking tokens required for 1 unit of consensus-engine power. // Currently, this returns a global variable that the app developer can tweak. // TODO: we might turn this into an on-chain param: // https://github.com/cosmos/cosmos-sdk/issues/8365 -func (k Keeper) PowerReduction(ctx sdk.Context) math.Int { +func (k Keeper) PowerReduction(ctx context.Context) math.Int { return sdk.DefaultPowerReduction } // MinCommissionRate - Minimum validator commission rate -func (k Keeper) MinCommissionRate(ctx sdk.Context) math.LegacyDec { - return k.GetParams(ctx).MinCommissionRate +func (k Keeper) MinCommissionRate(ctx context.Context) (math.LegacyDec, error) { + params, err := k.GetParams(ctx) + return params.MinCommissionRate, err } // SetParams sets the x/staking module parameters. // CONTRACT: This method performs no validation of the parameters. -func (k Keeper) SetParams(ctx sdk.Context, params types.Params) error { - store := ctx.KVStore(k.storeKey) +func (k Keeper) SetParams(ctx context.Context, params types.Params) error { + store := k.storeService.OpenKVStore(ctx) bz, err := k.cdc.Marshal(¶ms) if err != nil { return err } - store.Set(types.ParamsKey, bz) - - return nil + return store.Set(types.ParamsKey, bz) } -// GetParams sets the x/staking module parameters. -func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) { - store := ctx.KVStore(k.storeKey) - bz := store.Get(types.ParamsKey) +// GetParams gets the x/staking module parameters. +func (k Keeper) GetParams(ctx context.Context) (params types.Params, err error) { + store := k.storeService.OpenKVStore(ctx) + bz, err := store.Get(types.ParamsKey) + if err != nil { + return params, err + } + if bz == nil { - return params + return params, nil } - k.cdc.MustUnmarshal(bz, ¶ms) - return params + err = k.cdc.Unmarshal(bz, ¶ms) + return params, err } diff --git a/x/staking/keeper/pool.go b/x/staking/keeper/pool.go index 1d0bed38d255..dc81409ff6a7 100644 --- a/x/staking/keeper/pool.go +++ b/x/staking/keeper/pool.go @@ -1,6 +1,8 @@ package keeper import ( + "context" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" @@ -8,72 +10,104 @@ import ( ) // GetBondedPool returns the bonded tokens pool's module account -func (k Keeper) GetBondedPool(ctx sdk.Context) (bondedPool sdk.ModuleAccountI) { +func (k Keeper) GetBondedPool(ctx context.Context) (bondedPool sdk.ModuleAccountI) { return k.authKeeper.GetModuleAccount(ctx, types.BondedPoolName) } // GetNotBondedPool returns the not bonded tokens pool's module account -func (k Keeper) GetNotBondedPool(ctx sdk.Context) (notBondedPool sdk.ModuleAccountI) { +func (k Keeper) GetNotBondedPool(ctx context.Context) (notBondedPool sdk.ModuleAccountI) { return k.authKeeper.GetModuleAccount(ctx, types.NotBondedPoolName) } // bondedTokensToNotBonded transfers coins from the bonded to the not bonded pool within staking -func (k Keeper) bondedTokensToNotBonded(ctx sdk.Context, tokens math.Int) { - coins := sdk.NewCoins(sdk.NewCoin(k.BondDenom(ctx), tokens)) - if err := k.bankKeeper.SendCoinsFromModuleToModule(ctx, types.BondedPoolName, types.NotBondedPoolName, coins); err != nil { - panic(err) +func (k Keeper) bondedTokensToNotBonded(ctx context.Context, tokens math.Int) error { + bondDenom, err := k.BondDenom(ctx) + if err != nil { + return err } + + coins := sdk.NewCoins(sdk.NewCoin(bondDenom, tokens)) + return k.bankKeeper.SendCoinsFromModuleToModule(ctx, types.BondedPoolName, types.NotBondedPoolName, coins) } // notBondedTokensToBonded transfers coins from the not bonded to the bonded pool within staking -func (k Keeper) notBondedTokensToBonded(ctx sdk.Context, tokens math.Int) { - coins := sdk.NewCoins(sdk.NewCoin(k.BondDenom(ctx), tokens)) - if err := k.bankKeeper.SendCoinsFromModuleToModule(ctx, types.NotBondedPoolName, types.BondedPoolName, coins); err != nil { - panic(err) +func (k Keeper) notBondedTokensToBonded(ctx context.Context, tokens math.Int) error { + bondDenom, err := k.BondDenom(ctx) + if err != nil { + return err } + + coins := sdk.NewCoins(sdk.NewCoin(bondDenom, tokens)) + return k.bankKeeper.SendCoinsFromModuleToModule(ctx, types.NotBondedPoolName, types.BondedPoolName, coins) } -// burnBondedTokens removes coins from the bonded pool module account -func (k Keeper) burnBondedTokens(ctx sdk.Context, amt math.Int) error { +// burnBondedTokens burns coins from the bonded pool module account +func (k Keeper) burnBondedTokens(ctx context.Context, amt math.Int) error { if !amt.IsPositive() { // skip as no coins need to be burned return nil } - coins := sdk.NewCoins(sdk.NewCoin(k.BondDenom(ctx), amt)) + bondDenom, err := k.BondDenom(ctx) + if err != nil { + return err + } + + coins := sdk.NewCoins(sdk.NewCoin(bondDenom, amt)) return k.bankKeeper.BurnCoins(ctx, types.BondedPoolName, coins) } -// burnNotBondedTokens removes coins from the not bonded pool module account -func (k Keeper) burnNotBondedTokens(ctx sdk.Context, amt math.Int) error { +// burnNotBondedTokens burns coins from the not bonded pool module account +func (k Keeper) burnNotBondedTokens(ctx context.Context, amt math.Int) error { if !amt.IsPositive() { // skip as no coins need to be burned return nil } - coins := sdk.NewCoins(sdk.NewCoin(k.BondDenom(ctx), amt)) + bondDenom, err := k.BondDenom(ctx) + if err != nil { + return err + } + + coins := sdk.NewCoins(sdk.NewCoin(bondDenom, amt)) return k.bankKeeper.BurnCoins(ctx, types.NotBondedPoolName, coins) } // TotalBondedTokens total staking tokens supply which is bonded -func (k Keeper) TotalBondedTokens(ctx sdk.Context) math.Int { +func (k Keeper) TotalBondedTokens(ctx context.Context) (math.Int, error) { bondedPool := k.GetBondedPool(ctx) - return k.bankKeeper.GetBalance(ctx, bondedPool.GetAddress(), k.BondDenom(ctx)).Amount + bondDenom, err := k.BondDenom(ctx) + if err != nil { + return math.ZeroInt(), err + } + return k.bankKeeper.GetBalance(ctx, bondedPool.GetAddress(), bondDenom).Amount, nil } // StakingTokenSupply staking tokens from the total supply -func (k Keeper) StakingTokenSupply(ctx sdk.Context) math.Int { - return k.bankKeeper.GetSupply(ctx, k.BondDenom(ctx)).Amount +func (k Keeper) StakingTokenSupply(ctx context.Context) (math.Int, error) { + bondDenom, err := k.BondDenom(ctx) + if err != nil { + return math.ZeroInt(), err + } + return k.bankKeeper.GetSupply(ctx, bondDenom).Amount, nil } // BondedRatio the fraction of the staking tokens which are currently bonded -func (k Keeper) BondedRatio(ctx sdk.Context) math.LegacyDec { - stakeSupply := k.StakingTokenSupply(ctx) +func (k Keeper) BondedRatio(ctx context.Context) (math.LegacyDec, error) { + stakeSupply, err := k.StakingTokenSupply(ctx) + if err != nil { + return math.LegacyZeroDec(), err + } + if stakeSupply.IsPositive() { - return math.LegacyNewDecFromInt(k.TotalBondedTokens(ctx)).QuoInt(stakeSupply) + totalBonded, err := k.TotalBondedTokens(ctx) + if err != nil { + return math.LegacyZeroDec(), err + } + return math.LegacyNewDecFromInt(totalBonded).QuoInt(stakeSupply), nil } - return math.LegacyZeroDec() + return math.LegacyZeroDec(), nil } diff --git a/x/staking/keeper/power_reduction.go b/x/staking/keeper/power_reduction.go index abed52d12f4c..7eaad0cbe4f6 100644 --- a/x/staking/keeper/power_reduction.go +++ b/x/staking/keeper/power_reduction.go @@ -1,16 +1,19 @@ package keeper import ( + "context" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" ) -// TokensToConsensusPower - convert input tokens to potential consensus-engine power -func (k Keeper) TokensToConsensusPower(ctx sdk.Context, tokens math.Int) int64 { +// TokensToConsensusPower converts input tokens to potential consensus-engine power +func (k Keeper) TokensToConsensusPower(ctx context.Context, tokens math.Int) int64 { return sdk.TokensToConsensusPower(tokens, k.PowerReduction(ctx)) } -// TokensFromConsensusPower - convert input power to tokens -func (k Keeper) TokensFromConsensusPower(ctx sdk.Context, power int64) math.Int { +// TokensFromConsensusPower converts input power to tokens +func (k Keeper) TokensFromConsensusPower(ctx context.Context, power int64) math.Int { return sdk.TokensFromConsensusPower(power, k.PowerReduction(ctx)) } diff --git a/x/staking/keeper/power_reduction_test.go b/x/staking/keeper/power_reduction_test.go index 0817622b8302..42b857f1b5dc 100644 --- a/x/staking/keeper/power_reduction_test.go +++ b/x/staking/keeper/power_reduction_test.go @@ -2,6 +2,7 @@ package keeper_test import ( sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" ) diff --git a/x/staking/keeper/query_utils.go b/x/staking/keeper/query_utils.go index 6750a12bba07..4b089da7800a 100644 --- a/x/staking/keeper/query_utils.go +++ b/x/staking/keeper/query_utils.go @@ -1,105 +1,127 @@ package keeper import ( + "context" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/types" ) -// Return all validators that a delegator is bonded to. If maxRetrieve is supplied, the respective amount will be returned. +// GetDelegatorValidators returns all validators that a delegator is bonded to. If maxRetrieve is supplied, the respective amount will be returned. func (k Keeper) GetDelegatorValidators( - ctx sdk.Context, delegatorAddr sdk.AccAddress, maxRetrieve uint32, -) types.Validators { + ctx context.Context, delegatorAddr sdk.AccAddress, maxRetrieve uint32, +) (types.Validators, error) { validators := make([]types.Validator, maxRetrieve) - - store := ctx.KVStore(k.storeKey) + store := k.storeService.OpenKVStore(ctx) delegatorPrefixKey := types.GetDelegationsKey(delegatorAddr) - iterator := storetypes.KVStorePrefixIterator(store, delegatorPrefixKey) // smallest to largest + iterator, err := store.Iterator(delegatorPrefixKey, storetypes.PrefixEndBytes(delegatorPrefixKey)) // smallest to largest + if err != nil { + return types.Validators{}, err + } defer iterator.Close() i := 0 for ; iterator.Valid() && i < int(maxRetrieve); iterator.Next() { delegation := types.MustUnmarshalDelegation(k.cdc, iterator.Value()) - validator, found := k.GetValidator(ctx, delegation.GetValidatorAddr()) - if !found { - panic(types.ErrNoValidatorFound) + valAddr, err := k.validatorAddressCodec.StringToBytes(delegation.GetValidatorAddr()) + if err != nil { + return types.Validators{}, err + } + + validator, err := k.GetValidator(ctx, valAddr) + if err != nil { + return types.Validators{}, err } validators[i] = validator i++ } - return validators[:i] // trim + return types.Validators{Validators: validators[:i], ValidatorCodec: k.validatorAddressCodec}, nil // trim } -// return a validator that a delegator is bonded to +// GetDelegatorValidator returns a validator that a delegator is bonded to func (k Keeper) GetDelegatorValidator( - ctx sdk.Context, delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress, + ctx context.Context, delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress, ) (validator types.Validator, err error) { - delegation, found := k.GetDelegation(ctx, delegatorAddr, validatorAddr) - if !found { - return validator, types.ErrNoDelegation + delegation, err := k.GetDelegation(ctx, delegatorAddr, validatorAddr) + if err != nil { + return validator, err } - validator, found = k.GetValidator(ctx, delegation.GetValidatorAddr()) - if !found { - panic(types.ErrNoValidatorFound) + valAddr, err := k.validatorAddressCodec.StringToBytes(delegation.GetValidatorAddr()) + if err != nil { + return validator, err } - return validator, nil + return k.GetValidator(ctx, valAddr) } -// return all delegations for a delegator -func (k Keeper) GetAllDelegatorDelegations(ctx sdk.Context, delegator sdk.AccAddress) []types.Delegation { +// GetAllDelegatorDelegations returns all delegations of a delegator +func (k Keeper) GetAllDelegatorDelegations(ctx context.Context, delegator sdk.AccAddress) ([]types.Delegation, error) { delegations := make([]types.Delegation, 0) - store := ctx.KVStore(k.storeKey) + store := k.storeService.OpenKVStore(ctx) delegatorPrefixKey := types.GetDelegationsKey(delegator) - iterator := storetypes.KVStorePrefixIterator(store, delegatorPrefixKey) // smallest to largest + iterator, err := store.Iterator(delegatorPrefixKey, storetypes.PrefixEndBytes(delegatorPrefixKey)) // smallest to largest + if err != nil { + return nil, err + } defer iterator.Close() - i := 0 - - for ; iterator.Valid(); iterator.Next() { - delegation := types.MustUnmarshalDelegation(k.cdc, iterator.Value()) + for i := 0; iterator.Valid(); iterator.Next() { + delegation, err := types.UnmarshalDelegation(k.cdc, iterator.Value()) + if err != nil { + return nil, err + } delegations = append(delegations, delegation) i++ } - return delegations + return delegations, nil } -// return all unbonding-delegations for a delegator -func (k Keeper) GetAllUnbondingDelegations(ctx sdk.Context, delegator sdk.AccAddress) []types.UnbondingDelegation { +// GetAllUnbondingDelegations returns all unbonding-delegations of a delegator +func (k Keeper) GetAllUnbondingDelegations(ctx context.Context, delegator sdk.AccAddress) ([]types.UnbondingDelegation, error) { unbondingDelegations := make([]types.UnbondingDelegation, 0) - store := ctx.KVStore(k.storeKey) + store := k.storeService.OpenKVStore(ctx) delegatorPrefixKey := types.GetUBDsKey(delegator) - iterator := storetypes.KVStorePrefixIterator(store, delegatorPrefixKey) // smallest to largest + iterator, err := store.Iterator(delegatorPrefixKey, storetypes.PrefixEndBytes(delegatorPrefixKey)) // smallest to largest + if err != nil { + return nil, err + } defer iterator.Close() for i := 0; iterator.Valid(); iterator.Next() { - unbondingDelegation := types.MustUnmarshalUBD(k.cdc, iterator.Value()) + unbondingDelegation, err := types.UnmarshalUBD(k.cdc, iterator.Value()) + if err != nil { + return nil, err + } unbondingDelegations = append(unbondingDelegations, unbondingDelegation) i++ } - return unbondingDelegations + return unbondingDelegations, nil } -// return all redelegations for a delegator +// GetAllRedelegations returns all redelegations of a delegator func (k Keeper) GetAllRedelegations( - ctx sdk.Context, delegator sdk.AccAddress, srcValAddress, dstValAddress sdk.ValAddress, -) []types.Redelegation { - store := ctx.KVStore(k.storeKey) + ctx context.Context, delegator sdk.AccAddress, srcValAddress, dstValAddress sdk.ValAddress, +) ([]types.Redelegation, error) { + store := k.storeService.OpenKVStore(ctx) delegatorPrefixKey := types.GetREDsKey(delegator) - iterator := storetypes.KVStorePrefixIterator(store, delegatorPrefixKey) // smallest to largest + iterator, err := store.Iterator(delegatorPrefixKey, storetypes.PrefixEndBytes(delegatorPrefixKey)) // smallest to largest + if err != nil { + return nil, err + } defer iterator.Close() srcValFilter := !(srcValAddress.Empty()) @@ -109,24 +131,24 @@ func (k Keeper) GetAllRedelegations( for ; iterator.Valid(); iterator.Next() { redelegation := types.MustUnmarshalRED(k.cdc, iterator.Value()) - valSrcAddr, err := sdk.ValAddressFromBech32(redelegation.ValidatorSrcAddress) + valSrcAddr, err := k.validatorAddressCodec.StringToBytes(redelegation.ValidatorSrcAddress) if err != nil { - panic(err) + return nil, err } - valDstAddr, err := sdk.ValAddressFromBech32(redelegation.ValidatorDstAddress) + valDstAddr, err := k.validatorAddressCodec.StringToBytes(redelegation.ValidatorDstAddress) if err != nil { - panic(err) + return nil, err } - if srcValFilter && !(srcValAddress.Equals(valSrcAddr)) { + if srcValFilter && !(srcValAddress.Equals(sdk.ValAddress(valSrcAddr))) { continue } - if dstValFilter && !(dstValAddress.Equals(valDstAddr)) { + if dstValFilter && !(dstValAddress.Equals(sdk.ValAddress(valDstAddr))) { continue } redelegations = append(redelegations, redelegation) } - return redelegations + return redelegations, nil } diff --git a/x/staking/keeper/slash.go b/x/staking/keeper/slash.go index 99bfd159dc48..e1fa8bb47d64 100644 --- a/x/staking/keeper/slash.go +++ b/x/staking/keeper/slash.go @@ -1,6 +1,8 @@ package keeper import ( + "context" + "errors" "fmt" "cosmossdk.io/math" @@ -29,12 +31,13 @@ import ( // CONTRACT: // // Infraction was committed at the current height or at a past height, -// not at a height in the future -func (k Keeper) Slash(ctx sdk.Context, consAddr sdk.ConsAddress, infractionHeight, power int64, slashFactor math.LegacyDec) math.Int { +// but not at a height in the future +func (k Keeper) Slash(ctx context.Context, consAddr sdk.ConsAddress, infractionHeight, power int64, slashFactor math.LegacyDec) (math.Int, error) { logger := k.Logger(ctx) + sdkCtx := sdk.UnwrapSDKContext(ctx) if slashFactor.IsNegative() { - panic(fmt.Errorf("attempted to slash with a negative slash factor: %v", slashFactor)) + return math.NewInt(0), fmt.Errorf("attempted to slash with a negative slash factor: %v", slashFactor) } // Amount of slashing = slash slashFactor * power at time of infraction @@ -44,25 +47,35 @@ func (k Keeper) Slash(ctx sdk.Context, consAddr sdk.ConsAddress, infractionHeigh // ref https://github.com/cosmos/cosmos-sdk/issues/1348 - validator, found := k.GetValidatorByConsAddr(ctx, consAddr) - if !found { + validator, err := k.GetValidatorByConsAddr(ctx, consAddr) + if errors.Is(err, types.ErrNoValidatorFound) { // If not found, the validator must have been overslashed and removed - so we don't need to do anything // NOTE: Correctness dependent on invariant that unbonding delegations / redelegations must also have been completely // slashed in this case - which we don't explicitly check, but should be true. // Log the slash attempt for future reference (maybe we should tag it too) + conStr, err := k.consensusAddressCodec.BytesToString(consAddr) + if err != nil { + panic(err) + } + logger.Error( "WARNING: ignored attempt to slash a nonexistent validator; we recommend you investigate immediately", - "validator", consAddr.String(), + "validator", conStr, ) - return math.NewInt(0) + return math.NewInt(0), nil + } else if err != nil { + return math.NewInt(0), err } // should not be slashing an unbonded validator if validator.IsUnbonded() { - panic(fmt.Sprintf("should not be slashing unbonded validator: %s", validator.GetOperator())) + return math.NewInt(0), fmt.Errorf("should not be slashing unbonded validator: %s", validator.GetOperator()) } - operatorAddress := validator.GetOperator() + operatorAddress, err := k.ValidatorAddressCodec().StringToBytes(validator.GetOperator()) + if err != nil { + return math.Int{}, err + } // call the before-modification hook if err := k.Hooks().BeforeValidatorModified(ctx, operatorAddress); err != nil { @@ -75,13 +88,13 @@ func (k Keeper) Slash(ctx sdk.Context, consAddr sdk.ConsAddress, infractionHeigh remainingSlashAmount := slashAmount switch { - case infractionHeight > ctx.BlockHeight(): + case infractionHeight > sdkCtx.BlockHeight(): // Can't slash infractions in the future - panic(fmt.Sprintf( + return math.NewInt(0), fmt.Errorf( "impossible attempt to slash future infraction at height %d but we are at height %d", - infractionHeight, ctx.BlockHeight())) + infractionHeight, sdkCtx.BlockHeight()) - case infractionHeight == ctx.BlockHeight(): + case infractionHeight == sdkCtx.BlockHeight(): // Special-case slash at current height for efficiency - we don't need to // look through unbonding delegations or redelegations. logger.Info( @@ -89,11 +102,18 @@ func (k Keeper) Slash(ctx sdk.Context, consAddr sdk.ConsAddress, infractionHeigh "height", infractionHeight, ) - case infractionHeight < ctx.BlockHeight(): + case infractionHeight < sdkCtx.BlockHeight(): // Iterate through unbonding delegations from slashed validator - unbondingDelegations := k.GetUnbondingDelegationsFromValidator(ctx, operatorAddress) + unbondingDelegations, err := k.GetUnbondingDelegationsFromValidator(ctx, operatorAddress) + if err != nil { + return math.NewInt(0), err + } + for _, unbondingDelegation := range unbondingDelegations { - amountSlashed := k.SlashUnbondingDelegation(ctx, unbondingDelegation, infractionHeight, slashFactor) + amountSlashed, err := k.SlashUnbondingDelegation(ctx, unbondingDelegation, infractionHeight, slashFactor) + if err != nil { + return math.ZeroInt(), err + } if amountSlashed.IsZero() { continue } @@ -102,9 +122,17 @@ func (k Keeper) Slash(ctx sdk.Context, consAddr sdk.ConsAddress, infractionHeigh } // Iterate through redelegations from slashed source validator - redelegations := k.GetRedelegationsFromSrcValidator(ctx, operatorAddress) + redelegations, err := k.GetRedelegationsFromSrcValidator(ctx, operatorAddress) + if err != nil { + return math.NewInt(0), err + } + for _, redelegation := range redelegations { - amountSlashed := k.SlashRedelegation(ctx, validator, redelegation, infractionHeight, slashFactor) + amountSlashed, err := k.SlashRedelegation(ctx, validator, redelegation, infractionHeight, slashFactor) + if err != nil { + return math.NewInt(0), err + } + if amountSlashed.IsZero() { continue } @@ -117,12 +145,26 @@ func (k Keeper) Slash(ctx sdk.Context, consAddr sdk.ConsAddress, infractionHeigh tokensToBurn := math.MinInt(remainingSlashAmount, validator.Tokens) tokensToBurn = math.MaxInt(tokensToBurn, math.ZeroInt()) // defensive. + if tokensToBurn.IsZero() { + // Nothing to burn, we can end this route immediately! We also don't + // need to call the k.Hooks().BeforeValidatorSlashed hook as we won't + // be slashing at all. + logger.Info( + "no validator slashing because slash amount is zero", + "validator", validator.GetOperator(), + "slash_factor", slashFactor.String(), + "burned", tokensToBurn, + "validatorTokens", validator.Tokens, + ) + return math.NewInt(0), nil + } + // we need to calculate the *effective* slash fraction for distribution if validator.Tokens.IsPositive() { effectiveFraction := math.LegacyNewDecFromInt(tokensToBurn).QuoRoundUp(math.LegacyNewDecFromInt(validator.Tokens)) // possible if power has changed - if effectiveFraction.GT(math.LegacyOneDec()) { - effectiveFraction = math.LegacyOneDec() + if oneDec := math.LegacyOneDec(); effectiveFraction.GT(oneDec) { + effectiveFraction = oneDec } // call the before-slashed hook if err := k.Hooks().BeforeValidatorSlashed(ctx, operatorAddress, effectiveFraction); err != nil { @@ -132,16 +174,19 @@ func (k Keeper) Slash(ctx sdk.Context, consAddr sdk.ConsAddress, infractionHeigh // Deduct from validator's bonded tokens and update the validator. // Burn the slashed tokens from the pool account and decrease the total supply. - validator = k.RemoveValidatorTokens(ctx, validator, tokensToBurn) + validator, err = k.RemoveValidatorTokens(ctx, validator, tokensToBurn) + if err != nil { + return math.NewInt(0), err + } switch validator.GetStatus() { case types.Bonded: if err := k.burnBondedTokens(ctx, tokensToBurn); err != nil { - panic(err) + return math.NewInt(0), err } case types.Unbonding, types.Unbonded: if err := k.burnNotBondedTokens(ctx, tokensToBurn); err != nil { - panic(err) + return math.NewInt(0), err } default: panic("invalid validator status") @@ -149,32 +194,39 @@ func (k Keeper) Slash(ctx sdk.Context, consAddr sdk.ConsAddress, infractionHeigh logger.Info( "validator slashed by slash factor", - "validator", validator.GetOperator().String(), + "validator", validator.GetOperator(), "slash_factor", slashFactor.String(), "burned", tokensToBurn, ) - return tokensToBurn + return tokensToBurn, nil } // SlashWithInfractionReason implementation doesn't require the infraction (types.Infraction) to work but is required by Interchain Security. -func (k Keeper) SlashWithInfractionReason(ctx sdk.Context, consAddr sdk.ConsAddress, infractionHeight, power int64, slashFactor math.LegacyDec, _ types.Infraction) math.Int { +func (k Keeper) SlashWithInfractionReason(ctx context.Context, consAddr sdk.ConsAddress, infractionHeight, power int64, slashFactor math.LegacyDec, _ types.Infraction) (math.Int, error) { return k.Slash(ctx, consAddr, infractionHeight, power, slashFactor) } // jail a validator -func (k Keeper) Jail(ctx sdk.Context, consAddr sdk.ConsAddress) { +func (k Keeper) Jail(ctx context.Context, consAddr sdk.ConsAddress) error { validator := k.mustGetValidatorByConsAddr(ctx, consAddr) - k.jailValidator(ctx, validator) + if err := k.jailValidator(ctx, validator); err != nil { + return err + } + logger := k.Logger(ctx) logger.Info("validator jailed", "validator", consAddr) + return nil } // unjail a validator -func (k Keeper) Unjail(ctx sdk.Context, consAddr sdk.ConsAddress) { +func (k Keeper) Unjail(ctx context.Context, consAddr sdk.ConsAddress) error { validator := k.mustGetValidatorByConsAddr(ctx, consAddr) - k.unjailValidator(ctx, validator) + if err := k.unjailValidator(ctx, validator); err != nil { + return err + } logger := k.Logger(ctx) logger.Info("validator un-jailed", "validator", consAddr) + return nil } // slash an unbonding delegation and update the pool @@ -182,10 +234,11 @@ func (k Keeper) Unjail(ctx sdk.Context, consAddr sdk.ConsAddress) { // the unbonding delegation had enough stake to slash // (the amount actually slashed may be less if there's // insufficient stake remaining) -func (k Keeper) SlashUnbondingDelegation(ctx sdk.Context, unbondingDelegation types.UnbondingDelegation, +func (k Keeper) SlashUnbondingDelegation(ctx context.Context, unbondingDelegation types.UnbondingDelegation, infractionHeight int64, slashFactor math.LegacyDec, -) (totalSlashAmount math.Int) { - now := ctx.BlockHeader().Time +) (totalSlashAmount math.Int, err error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + now := sdkCtx.BlockHeader().Time totalSlashAmount = math.ZeroInt() burnedAmount := math.ZeroInt() @@ -220,14 +273,16 @@ func (k Keeper) SlashUnbondingDelegation(ctx sdk.Context, unbondingDelegation ty burnedAmount = burnedAmount.Add(unbondingSlashAmount) entry.Balance = entry.Balance.Sub(unbondingSlashAmount) unbondingDelegation.Entries[i] = entry - k.SetUnbondingDelegation(ctx, unbondingDelegation) + if err = k.SetUnbondingDelegation(ctx, unbondingDelegation); err != nil { + return math.ZeroInt(), err + } } if err := k.burnNotBondedTokens(ctx, burnedAmount); err != nil { - panic(err) + return math.ZeroInt(), err } - return totalSlashAmount + return totalSlashAmount, nil } // slash a redelegation and update the pool @@ -236,13 +291,24 @@ func (k Keeper) SlashUnbondingDelegation(ctx sdk.Context, unbondingDelegation ty // (the amount actually slashed may be less if there's // insufficient stake remaining) // NOTE this is only slashing for prior infractions from the source validator -func (k Keeper) SlashRedelegation(ctx sdk.Context, srcValidator types.Validator, redelegation types.Redelegation, +func (k Keeper) SlashRedelegation(ctx context.Context, srcValidator types.Validator, redelegation types.Redelegation, infractionHeight int64, slashFactor math.LegacyDec, -) (totalSlashAmount math.Int) { - now := ctx.BlockHeader().Time +) (totalSlashAmount math.Int, err error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + now := sdkCtx.BlockHeader().Time totalSlashAmount = math.ZeroInt() bondedBurnedAmount, notBondedBurnedAmount := math.ZeroInt(), math.ZeroInt() + valDstAddr, err := k.validatorAddressCodec.StringToBytes(redelegation.ValidatorDstAddress) + if err != nil { + return math.ZeroInt(), fmt.Errorf("SlashRedelegation: could not parse validator destination address: %w", err) + } + + delegatorAddress, err := k.authKeeper.AddressCodec().StringToBytes(redelegation.DelegatorAddress) + if err != nil { + return math.ZeroInt(), fmt.Errorf("SlashRedelegation: could not parse delegator address: %w", err) + } + // perform slashing on all entries within the redelegation for _, entry := range redelegation.Entries { // If redelegation started before this height, stake didn't contribute to infraction @@ -260,24 +326,53 @@ func (k Keeper) SlashRedelegation(ctx sdk.Context, srcValidator types.Validator, slashAmount := slashAmountDec.TruncateInt() totalSlashAmount = totalSlashAmount.Add(slashAmount) - // Unbond from target validator - sharesToUnbond := slashFactor.Mul(entry.SharesDst) - if sharesToUnbond.IsZero() { - continue - } - - valDstAddr, err := sdk.ValAddressFromBech32(redelegation.ValidatorDstAddress) + validatorDstAddress, err := sdk.ValAddressFromBech32(redelegation.ValidatorDstAddress) if err != nil { panic(err) } + // Handle undelegation after redelegation + // Prioritize slashing unbondingDelegation than delegation + unbondingDelegation, err := k.GetUnbondingDelegation(ctx, sdk.MustAccAddressFromBech32(redelegation.DelegatorAddress), validatorDstAddress) + if err == nil { + for i, entry := range unbondingDelegation.Entries { + // slash with the amount of `slashAmount` if possible, else slash all unbonding token + unbondingSlashAmount := math.MinInt(slashAmount, entry.Balance) + + switch { + // There's no token to slash + case unbondingSlashAmount.IsZero(): + continue + // If unbonding started before this height, stake didn't contribute to infraction + case entry.CreationHeight < infractionHeight: + continue + // Unbonding delegation no longer eligible for slashing, skip it + case entry.IsMature(now) && !entry.OnHold(): + continue + // Slash the unbonding delegation + default: + // update remaining slashAmount + slashAmount = slashAmount.Sub(unbondingSlashAmount) + + notBondedBurnedAmount = notBondedBurnedAmount.Add(unbondingSlashAmount) + entry.Balance = entry.Balance.Sub(unbondingSlashAmount) + unbondingDelegation.Entries[i] = entry + if err = k.SetUnbondingDelegation(ctx, unbondingDelegation); err != nil { + return math.ZeroInt(), err + } + } + } + } - delegatorAddress, err := k.authKeeper.AddressCodec().StringToBytes(redelegation.DelegatorAddress) - if err != nil { - panic(err) + // Slash the moved delegation + + // Unbond from target validator + sharesToUnbond := slashFactor.Mul(entry.SharesDst) + if sharesToUnbond.IsZero() || slashAmount.IsZero() { + continue } - delegation, found := k.GetDelegation(ctx, delegatorAddress, valDstAddr) - if !found { + delegation, err := k.GetDelegation(ctx, delegatorAddress, valDstAddr) + if err != nil { // If deleted, delegation has zero shares, and we can't unbond any more continue } @@ -288,12 +383,12 @@ func (k Keeper) SlashRedelegation(ctx sdk.Context, srcValidator types.Validator, tokensToBurn, err := k.Unbond(ctx, delegatorAddress, valDstAddr, sharesToUnbond) if err != nil { - panic(fmt.Errorf("error unbonding delegator: %v", err)) + return math.ZeroInt(), err } - dstValidator, found := k.GetValidator(ctx, valDstAddr) - if !found { - panic("destination validator not found") + dstValidator, err := k.GetValidator(ctx, valDstAddr) + if err != nil { + return math.ZeroInt(), err } // tokens of a redelegation currently live in the destination validator @@ -309,12 +404,12 @@ func (k Keeper) SlashRedelegation(ctx sdk.Context, srcValidator types.Validator, } if err := k.burnBondedTokens(ctx, bondedBurnedAmount); err != nil { - panic(err) + return math.ZeroInt(), err } if err := k.burnNotBondedTokens(ctx, notBondedBurnedAmount); err != nil { - panic(err) + return math.ZeroInt(), err } - return totalSlashAmount + return totalSlashAmount, nil } diff --git a/x/staking/keeper/slash_test.go b/x/staking/keeper/slash_test.go index b1f6d8c873c3..39a8f817a193 100644 --- a/x/staking/keeper/slash_test.go +++ b/x/staking/keeper/slash_test.go @@ -1,6 +1,8 @@ package keeper_test import ( + sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/testutil" ) @@ -15,36 +17,36 @@ func (s *KeeperTestSuite) TestRevocation() { validator := testutil.NewValidator(s.T(), valAddr, PKs[0]) // initial state - keeper.SetValidator(ctx, validator) - keeper.SetValidatorByConsAddr(ctx, validator) - val, found := keeper.GetValidator(ctx, valAddr) - require.True(found) + require.NoError(keeper.SetValidator(ctx, validator)) + require.NoError(keeper.SetValidatorByConsAddr(ctx, validator)) + val, err := keeper.GetValidator(ctx, valAddr) + require.NoError(err) require.False(val.IsJailed()) // test jail - keeper.Jail(ctx, consAddr) - val, found = keeper.GetValidator(ctx, valAddr) - require.True(found) + require.NoError(keeper.Jail(ctx, consAddr)) + val, err = keeper.GetValidator(ctx, valAddr) + require.NoError(err) require.True(val.IsJailed()) // test unjail - keeper.Unjail(ctx, consAddr) - val, found = keeper.GetValidator(ctx, valAddr) - require.True(found) + require.NoError(keeper.Unjail(ctx, consAddr)) + val, err = keeper.GetValidator(ctx, valAddr) + require.NoError(err) require.False(val.IsJailed()) } -// tests Slash at a future height (must panic) +// tests Slash at a future height (must error) func (s *KeeperTestSuite) TestSlashAtFutureHeight() { ctx, keeper := s.ctx, s.stakingKeeper require := s.Require() consAddr := sdk.ConsAddress(PKs[0].Address()) validator := testutil.NewValidator(s.T(), sdk.ValAddress(PKs[0].Address().Bytes()), PKs[0]) - keeper.SetValidator(ctx, validator) - err := keeper.SetValidatorByConsAddr(ctx, validator) - require.NoError(err) + require.NoError(keeper.SetValidator(ctx, validator)) + require.NoError(keeper.SetValidatorByConsAddr(ctx, validator)) - fraction := sdk.NewDecWithPrec(5, 1) - require.Panics(func() { keeper.Slash(ctx, consAddr, 1, 10, fraction) }) + fraction := sdkmath.LegacyNewDecWithPrec(5, 1) + _, err := keeper.Slash(ctx, consAddr, 1, 10, fraction) + require.Error(err) } diff --git a/x/staking/keeper/test_common.go b/x/staking/keeper/test_common.go index c0da2a4b3f97..0fa31d8ef924 100644 --- a/x/staking/keeper/test_common.go +++ b/x/staking/keeper/test_common.go @@ -2,6 +2,7 @@ package keeper // noalias import ( "bytes" + "context" storetypes "cosmossdk.io/store/types" @@ -9,49 +10,68 @@ import ( "github.com/cosmos/cosmos-sdk/x/staking/types" ) -// does a certain by-power index record exist -func ValidatorByPowerIndexExists(ctx sdk.Context, keeper *Keeper, power []byte) bool { - store := ctx.KVStore(keeper.storeKey) - return store.Has(power) +// ValidatorByPowerIndexExists does a certain by-power index record exist +func ValidatorByPowerIndexExists(ctx context.Context, keeper *Keeper, power []byte) bool { + store := keeper.storeService.OpenKVStore(ctx) + has, err := store.Has(power) + if err != nil { + panic(err) + } + return has } -// update validator for testing +// TestingUpdateValidator updates a validator for testing func TestingUpdateValidator(keeper *Keeper, ctx sdk.Context, validator types.Validator, apply bool) types.Validator { - keeper.SetValidator(ctx, validator) + err := keeper.SetValidator(ctx, validator) + if err != nil { + panic(err) + } // Remove any existing power key for validator. - store := ctx.KVStore(keeper.storeKey) + store := keeper.storeService.OpenKVStore(ctx) deleted := false - iterator := storetypes.KVStorePrefixIterator(store, types.ValidatorsByPowerIndexKey) + iterator, err := store.Iterator(types.ValidatorsByPowerIndexKey, storetypes.PrefixEndBytes(types.ValidatorsByPowerIndexKey)) + if err != nil { + panic(err) + } defer iterator.Close() + bz, err := keeper.validatorAddressCodec.StringToBytes(validator.GetOperator()) + if err != nil { + panic(err) + } + for ; iterator.Valid(); iterator.Next() { valAddr := types.ParseValidatorPowerRankKey(iterator.Key()) - if bytes.Equal(valAddr, validator.GetOperator()) { + if bytes.Equal(valAddr, bz) { if deleted { panic("found duplicate power index key") } else { deleted = true } - store.Delete(iterator.Key()) + if err = store.Delete(iterator.Key()); err != nil { + panic(err) + } } } - keeper.SetValidatorByPowerIndex(ctx, validator) + if err = keeper.SetValidatorByPowerIndex(ctx, validator); err != nil { + panic(err) + } if !apply { ctx, _ = ctx.CacheContext() } - _, err := keeper.ApplyAndReturnValidatorSetUpdates(ctx) + _, err = keeper.ApplyAndReturnValidatorSetUpdates(ctx) if err != nil { panic(err) } - validator, found := keeper.GetValidator(ctx, validator.GetOperator()) - if !found { - panic("validator expected but not found") + validator, err = keeper.GetValidator(ctx, sdk.ValAddress(bz)) + if err != nil { + panic(err) } return validator diff --git a/x/staking/keeper/unbonding.go b/x/staking/keeper/unbonding.go index 740531322110..1813797b9761 100644 --- a/x/staking/keeper/unbonding.go +++ b/x/staking/keeper/unbonding.go @@ -1,6 +1,7 @@ package keeper import ( + "context" "encoding/binary" errorsmod "cosmossdk.io/errors" @@ -10,9 +11,13 @@ import ( ) // IncrementUnbondingID increments and returns a unique ID for an unbonding operation -func (k Keeper) IncrementUnbondingID(ctx sdk.Context) (unbondingID uint64) { - store := ctx.KVStore(k.storeKey) - bz := store.Get(types.UnbondingIDKey) +func (k Keeper) IncrementUnbondingID(ctx context.Context) (unbondingID uint64, err error) { + store := k.storeService.OpenKVStore(ctx) + bz, err := store.Get(types.UnbondingIDKey) + if err != nil { + return 0, err + } + if bz != nil { unbondingID = binary.BigEndian.Uint64(bz) } @@ -23,203 +28,244 @@ func (k Keeper) IncrementUnbondingID(ctx sdk.Context) (unbondingID uint64) { bz = make([]byte, 8) binary.BigEndian.PutUint64(bz, unbondingID) - store.Set(types.UnbondingIDKey, bz) + if err = store.Set(types.UnbondingIDKey, bz); err != nil { + return 0, err + } - return unbondingID + return unbondingID, err } // DeleteUnbondingIndex removes a mapping from UnbondingId to unbonding operation -func (k Keeper) DeleteUnbondingIndex(ctx sdk.Context, id uint64) { - store := ctx.KVStore(k.storeKey) - store.Delete(types.GetUnbondingIndexKey(id)) +func (k Keeper) DeleteUnbondingIndex(ctx context.Context, id uint64) error { + store := k.storeService.OpenKVStore(ctx) + return store.Delete(types.GetUnbondingIndexKey(id)) } -func (k Keeper) GetUnbondingType(ctx sdk.Context, id uint64) (unbondingType types.UnbondingType, found bool) { - store := ctx.KVStore(k.storeKey) +// GetUnbondingType returns the enum type of unbonding which is any of +// {UnbondingDelegation | Redelegation | ValidatorUnbonding} +func (k Keeper) GetUnbondingType(ctx context.Context, id uint64) (unbondingType types.UnbondingType, err error) { + store := k.storeService.OpenKVStore(ctx) + + bz, err := store.Get(types.GetUnbondingTypeKey(id)) + if err != nil { + return unbondingType, err + } - bz := store.Get(types.GetUnbondingTypeKey(id)) if bz == nil { - return unbondingType, false + return unbondingType, types.ErrNoUnbondingType } - return types.UnbondingType(binary.BigEndian.Uint64(bz)), true + return types.UnbondingType(binary.BigEndian.Uint64(bz)), nil } -func (k Keeper) SetUnbondingType(ctx sdk.Context, id uint64, unbondingType types.UnbondingType) { - store := ctx.KVStore(k.storeKey) +// SetUnbondingType sets the enum type of unbonding which is any of +// {UnbondingDelegation | Redelegation | ValidatorUnbonding} +func (k Keeper) SetUnbondingType(ctx context.Context, id uint64, unbondingType types.UnbondingType) error { + store := k.storeService.OpenKVStore(ctx) // Convert into bytes for storage bz := make([]byte, 8) binary.BigEndian.PutUint64(bz, uint64(unbondingType)) - store.Set(types.GetUnbondingTypeKey(id), bz) + return store.Set(types.GetUnbondingTypeKey(id), bz) } // GetUnbondingDelegationByUnbondingID returns a unbonding delegation that has an unbonding delegation entry with a certain ID -func (k Keeper) GetUnbondingDelegationByUnbondingID(ctx sdk.Context, id uint64) (ubd types.UnbondingDelegation, found bool) { - store := ctx.KVStore(k.storeKey) +func (k Keeper) GetUnbondingDelegationByUnbondingID(ctx context.Context, id uint64) (ubd types.UnbondingDelegation, err error) { + store := k.storeService.OpenKVStore(ctx) + + ubdKey, err := store.Get(types.GetUnbondingIndexKey(id)) + if err != nil { + return types.UnbondingDelegation{}, err + } - ubdKey := store.Get(types.GetUnbondingIndexKey(id)) if ubdKey == nil { - return types.UnbondingDelegation{}, false + return types.UnbondingDelegation{}, types.ErrNoUnbondingDelegation + } + + value, err := store.Get(ubdKey) + if err != nil { + return types.UnbondingDelegation{}, err } - value := store.Get(ubdKey) if value == nil { - return types.UnbondingDelegation{}, false + return types.UnbondingDelegation{}, types.ErrNoUnbondingDelegation } - ubd, err := types.UnmarshalUBD(k.cdc, value) + ubd, err = types.UnmarshalUBD(k.cdc, value) // An error here means that what we got wasn't the right type if err != nil { - return types.UnbondingDelegation{}, false + return types.UnbondingDelegation{}, err } - return ubd, true + return ubd, nil } // GetRedelegationByUnbondingID returns a unbonding delegation that has an unbonding delegation entry with a certain ID -func (k Keeper) GetRedelegationByUnbondingID(ctx sdk.Context, id uint64) (red types.Redelegation, found bool) { - store := ctx.KVStore(k.storeKey) +func (k Keeper) GetRedelegationByUnbondingID(ctx context.Context, id uint64) (red types.Redelegation, err error) { + store := k.storeService.OpenKVStore(ctx) + + redKey, err := store.Get(types.GetUnbondingIndexKey(id)) + if err != nil { + return types.Redelegation{}, err + } - redKey := store.Get(types.GetUnbondingIndexKey(id)) if redKey == nil { - return types.Redelegation{}, false + return types.Redelegation{}, types.ErrNoRedelegation + } + + value, err := store.Get(redKey) + if err != nil { + return types.Redelegation{}, err } - value := store.Get(redKey) if value == nil { - return types.Redelegation{}, false + return types.Redelegation{}, types.ErrNoRedelegation } - red, err := types.UnmarshalRED(k.cdc, value) + red, err = types.UnmarshalRED(k.cdc, value) // An error here means that what we got wasn't the right type if err != nil { - return types.Redelegation{}, false + return types.Redelegation{}, err } - return red, true + return red, nil } // GetValidatorByUnbondingID returns the validator that is unbonding with a certain unbonding op ID -func (k Keeper) GetValidatorByUnbondingID(ctx sdk.Context, id uint64) (val types.Validator, found bool) { - store := ctx.KVStore(k.storeKey) +func (k Keeper) GetValidatorByUnbondingID(ctx context.Context, id uint64) (val types.Validator, err error) { + store := k.storeService.OpenKVStore(ctx) + + valKey, err := store.Get(types.GetUnbondingIndexKey(id)) + if err != nil { + return types.Validator{}, err + } - valKey := store.Get(types.GetUnbondingIndexKey(id)) if valKey == nil { - return types.Validator{}, false + return types.Validator{}, types.ErrNoValidatorFound + } + + value, err := store.Get(valKey) + if err != nil { + return types.Validator{}, err } - value := store.Get(valKey) if value == nil { - return types.Validator{}, false + return types.Validator{}, types.ErrNoValidatorFound } - val, err := types.UnmarshalValidator(k.cdc, value) + val, err = types.UnmarshalValidator(k.cdc, value) // An error here means that what we got wasn't the right type if err != nil { - return types.Validator{}, false + return types.Validator{}, err } - return val, true + return val, nil } -// SetUnbondingDelegationByUnbondingID sets an index to look up an UnbondingDelegation by the unbondingID of an UnbondingDelegationEntry that it contains -// Note, it does not set the unbonding delegation itself, use SetUnbondingDelegation(ctx, ubd) for that -func (k Keeper) SetUnbondingDelegationByUnbondingID(ctx sdk.Context, ubd types.UnbondingDelegation, id uint64) { - store := ctx.KVStore(k.storeKey) +// SetUnbondingDelegationByUnbondingID sets an index to look up an UnbondingDelegation +// by the unbondingID of an UnbondingDelegationEntry that it contains Note, it does not +// set the unbonding delegation itself, use SetUnbondingDelegation(ctx, ubd) for that +func (k Keeper) SetUnbondingDelegationByUnbondingID(ctx context.Context, ubd types.UnbondingDelegation, id uint64) error { + store := k.storeService.OpenKVStore(ctx) delAddr, err := k.authKeeper.AddressCodec().StringToBytes(ubd.DelegatorAddress) if err != nil { - panic(err) + return err } - valAddr, err := sdk.ValAddressFromBech32(ubd.ValidatorAddress) + valAddr, err := k.validatorAddressCodec.StringToBytes(ubd.ValidatorAddress) if err != nil { - panic(err) + return err } ubdKey := types.GetUBDKey(delAddr, valAddr) - store.Set(types.GetUnbondingIndexKey(id), ubdKey) + if err = store.Set(types.GetUnbondingIndexKey(id), ubdKey); err != nil { + return err + } // Set unbonding type so that we know how to deserialize it later - k.SetUnbondingType(ctx, id, types.UnbondingType_UnbondingDelegation) + return k.SetUnbondingType(ctx, id, types.UnbondingType_UnbondingDelegation) } // SetRedelegationByUnbondingID sets an index to look up an Redelegation by the unbondingID of an RedelegationEntry that it contains // Note, it does not set the redelegation itself, use SetRedelegation(ctx, red) for that -func (k Keeper) SetRedelegationByUnbondingID(ctx sdk.Context, red types.Redelegation, id uint64) { - store := ctx.KVStore(k.storeKey) +func (k Keeper) SetRedelegationByUnbondingID(ctx context.Context, red types.Redelegation, id uint64) error { + store := k.storeService.OpenKVStore(ctx) delAddr, err := k.authKeeper.AddressCodec().StringToBytes(red.DelegatorAddress) if err != nil { - panic(err) + return err } - valSrcAddr, err := sdk.ValAddressFromBech32(red.ValidatorSrcAddress) + valSrcAddr, err := k.validatorAddressCodec.StringToBytes(red.ValidatorSrcAddress) if err != nil { - panic(err) + return err } - valDstAddr, err := sdk.ValAddressFromBech32(red.ValidatorDstAddress) + valDstAddr, err := k.validatorAddressCodec.StringToBytes(red.ValidatorDstAddress) if err != nil { - panic(err) + return err } redKey := types.GetREDKey(delAddr, valSrcAddr, valDstAddr) - store.Set(types.GetUnbondingIndexKey(id), redKey) + if err = store.Set(types.GetUnbondingIndexKey(id), redKey); err != nil { + return err + } // Set unbonding type so that we know how to deserialize it later - k.SetUnbondingType(ctx, id, types.UnbondingType_Redelegation) + return k.SetUnbondingType(ctx, id, types.UnbondingType_Redelegation) } // SetValidatorByUnbondingID sets an index to look up a Validator by the unbondingID corresponding to its current unbonding // Note, it does not set the validator itself, use SetValidator(ctx, val) for that -func (k Keeper) SetValidatorByUnbondingID(ctx sdk.Context, val types.Validator, id uint64) { - store := ctx.KVStore(k.storeKey) +func (k Keeper) SetValidatorByUnbondingID(ctx context.Context, val types.Validator, id uint64) error { + store := k.storeService.OpenKVStore(ctx) - valAddr, err := sdk.ValAddressFromBech32(val.OperatorAddress) + valAddr, err := k.validatorAddressCodec.StringToBytes(val.OperatorAddress) if err != nil { - panic(err) + return err } valKey := types.GetValidatorKey(valAddr) - store.Set(types.GetUnbondingIndexKey(id), valKey) + if err = store.Set(types.GetUnbondingIndexKey(id), valKey); err != nil { + return err + } // Set unbonding type so that we know how to deserialize it later - k.SetUnbondingType(ctx, id, types.UnbondingType_ValidatorUnbonding) + return k.SetUnbondingType(ctx, id, types.UnbondingType_ValidatorUnbonding) } // unbondingDelegationEntryArrayIndex and redelegationEntryArrayIndex are utilities to find // at which position in the Entries array the entry with a given id is -func unbondingDelegationEntryArrayIndex(ubd types.UnbondingDelegation, id uint64) (index int, found bool) { +func unbondingDelegationEntryArrayIndex(ubd types.UnbondingDelegation, id uint64) (index int, err error) { for i, entry := range ubd.Entries { // we find the entry with the right ID if entry.UnbondingId == id { - return i, true + return i, nil } } - return 0, false + return 0, types.ErrNoUnbondingDelegation } -func redelegationEntryArrayIndex(red types.Redelegation, id uint64) (index int, found bool) { +func redelegationEntryArrayIndex(red types.Redelegation, id uint64) (index int, err error) { for i, entry := range red.Entries { // we find the entry with the right ID if entry.UnbondingId == id { - return i, true + return i, nil } } - return 0, false + return 0, types.ErrNoRedelegation } // UnbondingCanComplete allows a stopped unbonding operation, such as an // unbonding delegation, a redelegation, or a validator unbonding to complete. // In order for the unbonding operation with `id` to eventually complete, every call // to PutUnbondingOnHold(id) must be matched by a call to UnbondingCanComplete(id). -func (k Keeper) UnbondingCanComplete(ctx sdk.Context, id uint64) error { - unbondingType, found := k.GetUnbondingType(ctx, id) - if !found { - return types.ErrUnbondingNotFound +func (k Keeper) UnbondingCanComplete(ctx context.Context, id uint64) error { + unbondingType, err := k.GetUnbondingType(ctx, id) + if err != nil { + return err } switch unbondingType { @@ -242,15 +288,15 @@ func (k Keeper) UnbondingCanComplete(ctx sdk.Context, id uint64) error { return nil } -func (k Keeper) unbondingDelegationEntryCanComplete(ctx sdk.Context, id uint64) error { - ubd, found := k.GetUnbondingDelegationByUnbondingID(ctx, id) - if !found { - return types.ErrUnbondingNotFound +func (k Keeper) unbondingDelegationEntryCanComplete(ctx context.Context, id uint64) error { + ubd, err := k.GetUnbondingDelegationByUnbondingID(ctx, id) + if err != nil { + return err } - i, found := unbondingDelegationEntryArrayIndex(ubd, id) - if !found { - return types.ErrUnbondingNotFound + i, err := unbondingDelegationEntryArrayIndex(ubd, id) + if err != nil { + return err } // The entry must be on hold @@ -263,15 +309,19 @@ func (k Keeper) unbondingDelegationEntryCanComplete(ctx sdk.Context, id uint64) } ubd.Entries[i].UnbondingOnHoldRefCount-- + sdkCtx := sdk.UnwrapSDKContext(ctx) // Check if entry is matured. - if !ubd.Entries[i].OnHold() && ubd.Entries[i].IsMature(ctx.BlockHeader().Time) { + if !ubd.Entries[i].OnHold() && ubd.Entries[i].IsMature(sdkCtx.BlockHeader().Time) { // If matured, complete it. delegatorAddress, err := k.authKeeper.AddressCodec().StringToBytes(ubd.DelegatorAddress) if err != nil { return err } - bondDenom := k.GetParams(ctx).BondDenom + bondDenom, err := k.BondDenom(ctx) + if err != nil { + return err + } // track undelegation only when remaining or truncated shares are non-zero if !ubd.Entries[i].Balance.IsZero() { @@ -286,29 +336,30 @@ func (k Keeper) unbondingDelegationEntryCanComplete(ctx sdk.Context, id uint64) // Remove entry ubd.RemoveEntry(int64(i)) // Remove from the UnbondingIndex - k.DeleteUnbondingIndex(ctx, id) + err = k.DeleteUnbondingIndex(ctx, id) + if err != nil { + return err + } + } // set the unbonding delegation or remove it if there are no more entries if len(ubd.Entries) == 0 { - k.RemoveUnbondingDelegation(ctx, ubd) - } else { - k.SetUnbondingDelegation(ctx, ubd) + return k.RemoveUnbondingDelegation(ctx, ubd) } - // Successfully completed unbonding - return nil + return k.SetUnbondingDelegation(ctx, ubd) } -func (k Keeper) redelegationEntryCanComplete(ctx sdk.Context, id uint64) error { - red, found := k.GetRedelegationByUnbondingID(ctx, id) - if !found { - return types.ErrUnbondingNotFound +func (k Keeper) redelegationEntryCanComplete(ctx context.Context, id uint64) error { + red, err := k.GetRedelegationByUnbondingID(ctx, id) + if err != nil { + return err } - i, found := redelegationEntryArrayIndex(red, id) - if !found { - return types.ErrUnbondingNotFound + i, err := redelegationEntryArrayIndex(red, id) + if err != nil { + return err } // The entry must be on hold @@ -321,29 +372,29 @@ func (k Keeper) redelegationEntryCanComplete(ctx sdk.Context, id uint64) error { } red.Entries[i].UnbondingOnHoldRefCount-- - if !red.Entries[i].OnHold() && red.Entries[i].IsMature(ctx.BlockHeader().Time) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + if !red.Entries[i].OnHold() && red.Entries[i].IsMature(sdkCtx.BlockHeader().Time) { // If matured, complete it. // Remove entry red.RemoveEntry(int64(i)) // Remove from the Unbonding index - k.DeleteUnbondingIndex(ctx, id) + if err = k.DeleteUnbondingIndex(ctx, id); err != nil { + return err + } } // set the redelegation or remove it if there are no more entries if len(red.Entries) == 0 { - k.RemoveRedelegation(ctx, red) - } else { - k.SetRedelegation(ctx, red) + return k.RemoveRedelegation(ctx, red) } - // Successfully completed unbonding - return nil + return k.SetRedelegation(ctx, red) } -func (k Keeper) validatorUnbondingCanComplete(ctx sdk.Context, id uint64) error { - val, found := k.GetValidatorByUnbondingID(ctx, id) - if !found { - return types.ErrUnbondingNotFound +func (k Keeper) validatorUnbondingCanComplete(ctx context.Context, id uint64) error { + val, err := k.GetValidatorByUnbondingID(ctx, id) + if err != nil { + return err } if val.UnbondingOnHoldRefCount <= 0 { @@ -354,19 +405,17 @@ func (k Keeper) validatorUnbondingCanComplete(ctx sdk.Context, id uint64) error ) } val.UnbondingOnHoldRefCount-- - k.SetValidator(ctx, val) - - return nil + return k.SetValidator(ctx, val) } // PutUnbondingOnHold allows an external module to stop an unbonding operation, // such as an unbonding delegation, a redelegation, or a validator unbonding. // In order for the unbonding operation with `id` to eventually complete, every call // to PutUnbondingOnHold(id) must be matched by a call to UnbondingCanComplete(id). -func (k Keeper) PutUnbondingOnHold(ctx sdk.Context, id uint64) error { - unbondingType, found := k.GetUnbondingType(ctx, id) - if !found { - return types.ErrUnbondingNotFound +func (k Keeper) PutUnbondingOnHold(ctx context.Context, id uint64) error { + unbondingType, err := k.GetUnbondingType(ctx, id) + if err != nil { + return err } switch unbondingType { case types.UnbondingType_UnbondingDelegation: @@ -388,48 +437,42 @@ func (k Keeper) PutUnbondingOnHold(ctx sdk.Context, id uint64) error { return nil } -func (k Keeper) putUnbondingDelegationEntryOnHold(ctx sdk.Context, id uint64) error { - ubd, found := k.GetUnbondingDelegationByUnbondingID(ctx, id) - if !found { - return types.ErrUnbondingNotFound +func (k Keeper) putUnbondingDelegationEntryOnHold(ctx context.Context, id uint64) error { + ubd, err := k.GetUnbondingDelegationByUnbondingID(ctx, id) + if err != nil { + return err } - i, found := unbondingDelegationEntryArrayIndex(ubd, id) - if !found { - return types.ErrUnbondingNotFound + i, err := unbondingDelegationEntryArrayIndex(ubd, id) + if err != nil { + return err } ubd.Entries[i].UnbondingOnHoldRefCount++ - k.SetUnbondingDelegation(ctx, ubd) - - return nil + return k.SetUnbondingDelegation(ctx, ubd) } -func (k Keeper) putRedelegationEntryOnHold(ctx sdk.Context, id uint64) error { - red, found := k.GetRedelegationByUnbondingID(ctx, id) - if !found { - return types.ErrUnbondingNotFound +func (k Keeper) putRedelegationEntryOnHold(ctx context.Context, id uint64) error { + red, err := k.GetRedelegationByUnbondingID(ctx, id) + if err != nil { + return err } - i, found := redelegationEntryArrayIndex(red, id) - if !found { - return types.ErrUnbondingNotFound + i, err := redelegationEntryArrayIndex(red, id) + if err != nil { + return err } red.Entries[i].UnbondingOnHoldRefCount++ - k.SetRedelegation(ctx, red) - - return nil + return k.SetRedelegation(ctx, red) } -func (k Keeper) putValidatorOnHold(ctx sdk.Context, id uint64) error { - val, found := k.GetValidatorByUnbondingID(ctx, id) - if !found { - return types.ErrUnbondingNotFound +func (k Keeper) putValidatorOnHold(ctx context.Context, id uint64) error { + val, err := k.GetValidatorByUnbondingID(ctx, id) + if err != nil { + return err } val.UnbondingOnHoldRefCount++ - k.SetValidator(ctx, val) - - return nil + return k.SetValidator(ctx, val) } diff --git a/x/staking/keeper/unbonding_test.go b/x/staking/keeper/unbonding_test.go index 8501afa3e8c6..65e7c9de835b 100644 --- a/x/staking/keeper/unbonding_test.go +++ b/x/staking/keeper/unbonding_test.go @@ -4,6 +4,8 @@ import ( "time" "cosmossdk.io/math" + + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/testutil" "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -11,11 +13,14 @@ import ( func (s *KeeperTestSuite) TestIncrementUnbondingID() { for i := 1; i < 10; i++ { - s.Require().Equal(uint64(i), s.stakingKeeper.IncrementUnbondingID(s.ctx)) + id, err := s.stakingKeeper.IncrementUnbondingID(s.ctx) + s.Require().NoError(err) + s.Require().Equal(uint64(i), id) } } func (s *KeeperTestSuite) TestUnbondingTypeAccessors() { + require := s.Require() cases := []struct { exists bool name string @@ -40,15 +45,15 @@ func (s *KeeperTestSuite) TestUnbondingTypeAccessors() { for i, tc := range cases { s.Run(tc.name, func() { if tc.exists { - s.stakingKeeper.SetUnbondingType(s.ctx, uint64(i), tc.expected) + require.NoError(s.stakingKeeper.SetUnbondingType(s.ctx, uint64(i), tc.expected)) } - unbondingType, found := s.stakingKeeper.GetUnbondingType(s.ctx, uint64(i)) + unbondingType, err := s.stakingKeeper.GetUnbondingType(s.ctx, uint64(i)) if tc.exists { - s.Require().True(found) - s.Require().Equal(tc.expected, unbondingType) + require.NoError(err) + require.Equal(tc.expected, unbondingType) } else { - s.Require().False(found) + require.ErrorIs(err, types.ErrNoUnbondingType) } }) } @@ -56,6 +61,7 @@ func (s *KeeperTestSuite) TestUnbondingTypeAccessors() { func (s *KeeperTestSuite) TestUnbondingDelegationByUnbondingIDAccessors() { delAddrs, valAddrs := createValAddrs(2) + require := s.Require() type exists struct { setUnbondingDelegation bool @@ -75,8 +81,9 @@ func (s *KeeperTestSuite) TestUnbondingDelegationByUnbondingIDAccessors() { valAddrs[0], 0, time.Unix(0, 0).UTC(), - sdk.NewInt(5), + math.NewInt(5), 0, + addresscodec.NewBech32Codec("cosmosvaloper"), addresscodec.NewBech32Codec("cosmos"), ), }, { @@ -87,8 +94,9 @@ func (s *KeeperTestSuite) TestUnbondingDelegationByUnbondingIDAccessors() { valAddrs[1], 0, time.Unix(0, 0).UTC(), - sdk.NewInt(5), + math.NewInt(5), 0, + addresscodec.NewBech32Codec("cosmosvaloper"), addresscodec.NewBech32Codec("cosmos"), ), }, { @@ -99,8 +107,9 @@ func (s *KeeperTestSuite) TestUnbondingDelegationByUnbondingIDAccessors() { valAddrs[0], 0, time.Unix(0, 0).UTC(), - sdk.NewInt(5), + math.NewInt(5), 0, + addresscodec.NewBech32Codec("cosmosvaloper"), addresscodec.NewBech32Codec("cosmos"), ), }, } @@ -108,19 +117,19 @@ func (s *KeeperTestSuite) TestUnbondingDelegationByUnbondingIDAccessors() { for i, tc := range cases { s.Run(tc.name, func() { if tc.exists.setUnbondingDelegation { - s.stakingKeeper.SetUnbondingDelegation(s.ctx, tc.expected) + require.NoError(s.stakingKeeper.SetUnbondingDelegation(s.ctx, tc.expected)) } if tc.exists.setUnbondingDelegationByUnbondingID { - s.stakingKeeper.SetUnbondingDelegationByUnbondingID(s.ctx, tc.expected, uint64(i)) + require.NoError(s.stakingKeeper.SetUnbondingDelegationByUnbondingID(s.ctx, tc.expected, uint64(i))) } - ubd, found := s.stakingKeeper.GetUnbondingDelegationByUnbondingID(s.ctx, uint64(i)) + ubd, err := s.stakingKeeper.GetUnbondingDelegationByUnbondingID(s.ctx, uint64(i)) if tc.exists.setUnbondingDelegation && tc.exists.setUnbondingDelegationByUnbondingID { - s.Require().True(found) - s.Require().Equal(tc.expected, ubd) + require.NoError(err) + require.Equal(tc.expected, ubd) } else { - s.Require().False(found) + require.ErrorIs(err, types.ErrNoUnbondingDelegation) } }) } @@ -128,6 +137,7 @@ func (s *KeeperTestSuite) TestUnbondingDelegationByUnbondingIDAccessors() { func (s *KeeperTestSuite) TestRedelegationByUnbondingIDAccessors() { delAddrs, valAddrs := createValAddrs(2) + require := s.Require() type exists struct { setRedelegation bool @@ -148,9 +158,10 @@ func (s *KeeperTestSuite) TestRedelegationByUnbondingIDAccessors() { valAddrs[1], 0, time.Unix(5, 0).UTC(), - sdk.NewInt(10), + math.NewInt(10), math.LegacyNewDec(10), 0, + addresscodec.NewBech32Codec("cosmosvaloper"), addresscodec.NewBech32Codec("cosmos"), ), }, { @@ -162,9 +173,10 @@ func (s *KeeperTestSuite) TestRedelegationByUnbondingIDAccessors() { valAddrs[1], 0, time.Unix(5, 0).UTC(), - sdk.NewInt(10), + math.NewInt(10), math.LegacyNewDec(10), 0, + addresscodec.NewBech32Codec("cosmosvaloper"), addresscodec.NewBech32Codec("cosmos"), ), }, { @@ -176,9 +188,10 @@ func (s *KeeperTestSuite) TestRedelegationByUnbondingIDAccessors() { valAddrs[0], 0, time.Unix(5, 0).UTC(), - sdk.NewInt(10), + math.NewInt(10), math.LegacyNewDec(10), 0, + addresscodec.NewBech32Codec("cosmosvaloper"), addresscodec.NewBech32Codec("cosmos"), ), }, } @@ -186,19 +199,19 @@ func (s *KeeperTestSuite) TestRedelegationByUnbondingIDAccessors() { for i, tc := range cases { s.Run(tc.name, func() { if tc.exists.setRedelegation { - s.stakingKeeper.SetRedelegation(s.ctx, tc.expected) + require.NoError(s.stakingKeeper.SetRedelegation(s.ctx, tc.expected)) } if tc.exists.setRedelegationByUnbondingID { - s.stakingKeeper.SetRedelegationByUnbondingID(s.ctx, tc.expected, uint64(i)) + require.NoError(s.stakingKeeper.SetRedelegationByUnbondingID(s.ctx, tc.expected, uint64(i))) } - red, found := s.stakingKeeper.GetRedelegationByUnbondingID(s.ctx, uint64(i)) + red, err := s.stakingKeeper.GetRedelegationByUnbondingID(s.ctx, uint64(i)) if tc.exists.setRedelegation && tc.exists.setRedelegationByUnbondingID { - s.Require().True(found) - s.Require().Equal(tc.expected, red) + require.NoError(err) + require.Equal(tc.expected, red) } else { - s.Require().False(found) + require.ErrorIs(err, types.ErrNoRedelegation) } }) } @@ -206,6 +219,7 @@ func (s *KeeperTestSuite) TestRedelegationByUnbondingIDAccessors() { func (s *KeeperTestSuite) TestValidatorByUnbondingIDAccessors() { _, valAddrs := createValAddrs(3) + require := s.Require() type exists struct { setValidator bool @@ -237,19 +251,19 @@ func (s *KeeperTestSuite) TestValidatorByUnbondingIDAccessors() { for i, tc := range cases { s.Run(tc.name, func() { if tc.exists.setValidator { - s.stakingKeeper.SetValidator(s.ctx, tc.validator) + require.NoError(s.stakingKeeper.SetValidator(s.ctx, tc.validator)) } if tc.exists.setValidatorByUnbondingID { - s.stakingKeeper.SetValidatorByUnbondingID(s.ctx, tc.validator, uint64(i)) + require.NoError(s.stakingKeeper.SetValidatorByUnbondingID(s.ctx, tc.validator, uint64(i))) } - val, found := s.stakingKeeper.GetValidatorByUnbondingID(s.ctx, uint64(i)) + val, err := s.stakingKeeper.GetValidatorByUnbondingID(s.ctx, uint64(i)) if tc.exists.setValidator && tc.exists.setValidatorByUnbondingID { - s.Require().True(found) - s.Require().Equal(tc.validator, val) + require.NoError(err) + require.Equal(tc.validator, val) } else { - s.Require().False(found) + require.ErrorIs(err, types.ErrNoValidatorFound) } }) } @@ -257,42 +271,44 @@ func (s *KeeperTestSuite) TestValidatorByUnbondingIDAccessors() { func (s *KeeperTestSuite) TestUnbondingCanComplete() { delAddrs, valAddrs := createValAddrs(3) + require := s.Require() unbondingID := uint64(1) // no unbondingID set err := s.stakingKeeper.UnbondingCanComplete(s.ctx, unbondingID) - s.Require().ErrorIs(err, types.ErrUnbondingNotFound) + require.ErrorIs(err, types.ErrNoUnbondingType) // unbonding delegation - s.stakingKeeper.SetUnbondingType(s.ctx, unbondingID, types.UnbondingType_UnbondingDelegation) + require.NoError(s.stakingKeeper.SetUnbondingType(s.ctx, unbondingID, types.UnbondingType_UnbondingDelegation)) err = s.stakingKeeper.UnbondingCanComplete(s.ctx, unbondingID) - s.Require().ErrorIs(err, types.ErrUnbondingNotFound) + require.ErrorIs(err, types.ErrNoUnbondingDelegation) ubd := types.NewUnbondingDelegation( delAddrs[0], valAddrs[0], 0, time.Unix(0, 0).UTC(), - sdk.NewInt(5), + math.NewInt(5), unbondingID, + addresscodec.NewBech32Codec("cosmosvaloper"), addresscodec.NewBech32Codec("cosmos"), ) - s.stakingKeeper.SetUnbondingDelegation(s.ctx, ubd) - s.stakingKeeper.SetUnbondingDelegationByUnbondingID(s.ctx, ubd, unbondingID) + require.NoError(s.stakingKeeper.SetUnbondingDelegation(s.ctx, ubd)) + require.NoError(s.stakingKeeper.SetUnbondingDelegationByUnbondingID(s.ctx, ubd, unbondingID)) err = s.stakingKeeper.UnbondingCanComplete(s.ctx, unbondingID) - s.Require().ErrorIs(err, types.ErrUnbondingOnHoldRefCountNegative) + require.ErrorIs(err, types.ErrUnbondingOnHoldRefCountNegative) err = s.stakingKeeper.PutUnbondingOnHold(s.ctx, unbondingID) - s.Require().NoError(err) - s.bankKeeper.EXPECT().UndelegateCoinsFromModuleToAccount(s.ctx, types.NotBondedPoolName, delAddrs[0], sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(5)))).Return(nil) + require.NoError(err) + s.bankKeeper.EXPECT().UndelegateCoinsFromModuleToAccount(s.ctx, types.NotBondedPoolName, delAddrs[0], sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(5)))).Return(nil) err = s.stakingKeeper.UnbondingCanComplete(s.ctx, unbondingID) - s.Require().NoError(err) + require.NoError(err) // redelegation unbondingID++ - s.stakingKeeper.SetUnbondingType(s.ctx, unbondingID, types.UnbondingType_Redelegation) + require.NoError(s.stakingKeeper.SetUnbondingType(s.ctx, unbondingID, types.UnbondingType_Redelegation)) err = s.stakingKeeper.UnbondingCanComplete(s.ctx, unbondingID) - s.Require().ErrorIs(err, types.ErrUnbondingNotFound) + require.ErrorIs(err, types.ErrNoRedelegation) red := types.NewRedelegation( delAddrs[0], @@ -300,34 +316,31 @@ func (s *KeeperTestSuite) TestUnbondingCanComplete() { valAddrs[1], 0, time.Unix(5, 0).UTC(), - sdk.NewInt(10), + math.NewInt(10), math.LegacyNewDec(10), unbondingID, + addresscodec.NewBech32Codec("cosmosvaloper"), addresscodec.NewBech32Codec("cosmos"), ) - s.stakingKeeper.SetRedelegation(s.ctx, red) - s.stakingKeeper.SetRedelegationByUnbondingID(s.ctx, red, unbondingID) + require.NoError(s.stakingKeeper.SetRedelegation(s.ctx, red)) + require.NoError(s.stakingKeeper.SetRedelegationByUnbondingID(s.ctx, red, unbondingID)) err = s.stakingKeeper.UnbondingCanComplete(s.ctx, unbondingID) - s.Require().ErrorIs(err, types.ErrUnbondingOnHoldRefCountNegative) + require.ErrorIs(err, types.ErrUnbondingOnHoldRefCountNegative) - err = s.stakingKeeper.PutUnbondingOnHold(s.ctx, unbondingID) - s.Require().NoError(err) - err = s.stakingKeeper.UnbondingCanComplete(s.ctx, unbondingID) - s.Require().NoError(err) + require.NoError(s.stakingKeeper.PutUnbondingOnHold(s.ctx, unbondingID)) + require.NoError(s.stakingKeeper.UnbondingCanComplete(s.ctx, unbondingID)) // validator unbonding unbondingID++ - s.stakingKeeper.SetUnbondingType(s.ctx, unbondingID, types.UnbondingType_ValidatorUnbonding) + require.NoError(s.stakingKeeper.SetUnbondingType(s.ctx, unbondingID, types.UnbondingType_ValidatorUnbonding)) err = s.stakingKeeper.UnbondingCanComplete(s.ctx, unbondingID) - s.Require().ErrorIs(err, types.ErrUnbondingNotFound) + require.ErrorIs(err, types.ErrNoValidatorFound) val := testutil.NewValidator(s.T(), valAddrs[0], PKs[0]) - s.stakingKeeper.SetValidator(s.ctx, val) - s.stakingKeeper.SetValidatorByUnbondingID(s.ctx, val, unbondingID) + require.NoError(s.stakingKeeper.SetValidator(s.ctx, val)) + require.NoError(s.stakingKeeper.SetValidatorByUnbondingID(s.ctx, val, unbondingID)) err = s.stakingKeeper.UnbondingCanComplete(s.ctx, unbondingID) - s.Require().ErrorIs(err, types.ErrUnbondingOnHoldRefCountNegative) + require.ErrorIs(err, types.ErrUnbondingOnHoldRefCountNegative) - err = s.stakingKeeper.PutUnbondingOnHold(s.ctx, unbondingID) - s.Require().NoError(err) - err = s.stakingKeeper.UnbondingCanComplete(s.ctx, unbondingID) - s.Require().NoError(err) + require.NoError(s.stakingKeeper.PutUnbondingOnHold(s.ctx, unbondingID)) + require.NoError(s.stakingKeeper.UnbondingCanComplete(s.ctx, unbondingID)) } diff --git a/x/staking/keeper/val_state_change.go b/x/staking/keeper/val_state_change.go index d459ed6ff318..444633983c36 100644 --- a/x/staking/keeper/val_state_change.go +++ b/x/staking/keeper/val_state_change.go @@ -2,12 +2,14 @@ package keeper import ( "bytes" + "context" "fmt" "sort" abci "github.com/cometbft/cometbft/abci/types" gogotypes "github.com/cosmos/gogoproto/types" + "cosmossdk.io/core/address" "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" @@ -16,7 +18,7 @@ import ( // BlockValidatorUpdates calculates the ValidatorUpdates for the current block // Called in each EndBlock -func (k Keeper) BlockValidatorUpdates(ctx sdk.Context) []abci.ValidatorUpdate { +func (k Keeper) BlockValidatorUpdates(ctx context.Context) ([]abci.ValidatorUpdate, error) { // Calculate validator set changes. // // NOTE: ApplyAndReturnValidatorSetUpdates has to come before @@ -28,22 +30,30 @@ func (k Keeper) BlockValidatorUpdates(ctx sdk.Context) []abci.ValidatorUpdate { // UnbondAllMatureValidatorQueue). validatorUpdates, err := k.ApplyAndReturnValidatorSetUpdates(ctx) if err != nil { - panic(err) + return nil, err } // unbond all mature validators from the unbonding queue - k.UnbondAllMatureValidators(ctx) + err = k.UnbondAllMatureValidators(ctx) + if err != nil { + return nil, err + } + sdkCtx := sdk.UnwrapSDKContext(ctx) // Remove all mature unbonding delegations from the ubd queue. - matureUnbonds := k.DequeueAllMatureUBDQueue(ctx, ctx.BlockHeader().Time) + matureUnbonds, err := k.DequeueAllMatureUBDQueue(ctx, sdkCtx.BlockHeader().Time) + if err != nil { + return nil, err + } + for _, dvPair := range matureUnbonds { - addr, err := sdk.ValAddressFromBech32(dvPair.ValidatorAddress) + addr, err := k.validatorAddressCodec.StringToBytes(dvPair.ValidatorAddress) if err != nil { - panic(err) + return nil, err } delegatorAddress, err := k.authKeeper.AddressCodec().StringToBytes(dvPair.DelegatorAddress) if err != nil { - panic(err) + return nil, err } balances, err := k.CompleteUnbonding(ctx, delegatorAddress, addr) @@ -51,7 +61,7 @@ func (k Keeper) BlockValidatorUpdates(ctx sdk.Context) []abci.ValidatorUpdate { continue } - ctx.EventManager().EmitEvent( + sdkCtx.EventManager().EmitEvent( sdk.NewEvent( types.EventTypeCompleteUnbonding, sdk.NewAttribute(sdk.AttributeKeyAmount, balances.String()), @@ -62,19 +72,23 @@ func (k Keeper) BlockValidatorUpdates(ctx sdk.Context) []abci.ValidatorUpdate { } // Remove all mature redelegations from the red queue. - matureRedelegations := k.DequeueAllMatureRedelegationQueue(ctx, ctx.BlockHeader().Time) + matureRedelegations, err := k.DequeueAllMatureRedelegationQueue(ctx, sdkCtx.BlockHeader().Time) + if err != nil { + return nil, err + } + for _, dvvTriplet := range matureRedelegations { - valSrcAddr, err := sdk.ValAddressFromBech32(dvvTriplet.ValidatorSrcAddress) + valSrcAddr, err := k.validatorAddressCodec.StringToBytes(dvvTriplet.ValidatorSrcAddress) if err != nil { - panic(err) + return nil, err } - valDstAddr, err := sdk.ValAddressFromBech32(dvvTriplet.ValidatorDstAddress) + valDstAddr, err := k.validatorAddressCodec.StringToBytes(dvvTriplet.ValidatorDstAddress) if err != nil { - panic(err) + return nil, err } delegatorAddress, err := k.authKeeper.AddressCodec().StringToBytes(dvvTriplet.DelegatorAddress) if err != nil { - panic(err) + return nil, err } balances, err := k.CompleteRedelegation( @@ -87,7 +101,7 @@ func (k Keeper) BlockValidatorUpdates(ctx sdk.Context) []abci.ValidatorUpdate { continue } - ctx.EventManager().EmitEvent( + sdkCtx.EventManager().EmitEvent( sdk.NewEvent( types.EventTypeCompleteRedelegation, sdk.NewAttribute(sdk.AttributeKeyAmount, balances.String()), @@ -98,7 +112,7 @@ func (k Keeper) BlockValidatorUpdates(ctx sdk.Context) []abci.ValidatorUpdate { ) } - return validatorUpdates + return validatorUpdates, nil } // ApplyAndReturnValidatorSetUpdates applies and return accumulated updates to the bonded validator set. Also, @@ -113,8 +127,11 @@ func (k Keeper) BlockValidatorUpdates(ctx sdk.Context) []abci.ValidatorUpdate { // CONTRACT: Only validators with non-zero power or zero-power that were bonded // at the previous block height or were removed from the validator set entirely // are returned to CometBFT. -func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (updates []abci.ValidatorUpdate, err error) { - params := k.GetParams(ctx) +func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx context.Context) (updates []abci.ValidatorUpdate, err error) { + params, err := k.GetParams(ctx) + if err != nil { + return nil, err + } maxValidators := params.MaxValidators powerReduction := k.PowerReduction(ctx) totalPower := math.ZeroInt() @@ -129,7 +146,10 @@ func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (updates []ab } // Iterate over validators, highest power to lowest. - iterator := k.ValidatorsPowerStoreIterator(ctx) + iterator, err := k.ValidatorsPowerStoreIterator(ctx) + if err != nil { + return nil, err + } defer iterator.Close() for count := 0; iterator.Valid() && count < int(maxValidators); iterator.Next() { @@ -169,7 +189,7 @@ func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (updates []ab } // fetch the old power bytes - valAddrStr, err := sdk.Bech32ifyAddressBytes(sdk.GetConfig().GetBech32ValidatorAddrPrefix(), valAddr) + valAddrStr, err := k.validatorAddressCodec.BytesToString(valAddr) if err != nil { return nil, err } @@ -181,7 +201,9 @@ func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (updates []ab if !found || !bytes.Equal(oldPowerBytes, newPowerBytes) { updates = append(updates, validator.ABCIValidatorUpdate(powerReduction)) - k.SetLastValidatorPower(ctx, valAddr, newPower) + if err = k.SetLastValidatorPower(ctx, valAddr, newPower); err != nil { + return nil, err + } } delete(last, valAddrStr) @@ -190,7 +212,7 @@ func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (updates []ab totalPower = totalPower.Add(math.NewInt(newPower)) } - noLongerBonded, err := sortNoLongerBonded(last) + noLongerBonded, err := sortNoLongerBonded(last, k.validatorAddressCodec) if err != nil { return nil, err } @@ -199,10 +221,17 @@ func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (updates []ab validator := k.mustGetValidator(ctx, sdk.ValAddress(valAddrBytes)) validator, err = k.bondedToUnbonding(ctx, validator) if err != nil { - return + return nil, err + } + str, err := k.validatorAddressCodec.StringToBytes(validator.GetOperator()) + if err != nil { + return nil, err } amtFromBondedToNotBonded = amtFromBondedToNotBonded.Add(validator.GetTokens()) - k.DeleteLastValidatorPower(ctx, validator.GetOperator()) + if err = k.DeleteLastValidatorPower(ctx, str); err != nil { + return nil, err + } + updates = append(updates, validator.ABCIValidatorUpdateZero()) } @@ -215,26 +244,34 @@ func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (updates []ab // Compare and subtract the respective amounts to only perform one transfer. // This is done in order to avoid doing multiple updates inside each iterator/loop. case amtFromNotBondedToBonded.GT(amtFromBondedToNotBonded): - k.notBondedTokensToBonded(ctx, amtFromNotBondedToBonded.Sub(amtFromBondedToNotBonded)) + if err = k.notBondedTokensToBonded(ctx, amtFromNotBondedToBonded.Sub(amtFromBondedToNotBonded)); err != nil { + return nil, err + } case amtFromNotBondedToBonded.LT(amtFromBondedToNotBonded): - k.bondedTokensToNotBonded(ctx, amtFromBondedToNotBonded.Sub(amtFromNotBondedToBonded)) + if err = k.bondedTokensToNotBonded(ctx, amtFromBondedToNotBonded.Sub(amtFromNotBondedToBonded)); err != nil { + return nil, err + } default: // equal amounts of tokens; no update required } // set total power on lookup index if there are any updates if len(updates) > 0 { - k.SetLastTotalPower(ctx, totalPower) + if err = k.SetLastTotalPower(ctx, totalPower); err != nil { + return nil, err + } } // set the list of validator updates - k.SetValidatorUpdates(ctx, updates) + if err = k.SetValidatorUpdates(ctx, updates); err != nil { + return nil, err + } return updates, err } // Validator state transitions -func (k Keeper) bondedToUnbonding(ctx sdk.Context, validator types.Validator) (types.Validator, error) { +func (k Keeper) bondedToUnbonding(ctx context.Context, validator types.Validator) (types.Validator, error) { if !validator.IsBonded() { panic(fmt.Sprintf("bad state transition bondedToUnbonding, validator: %v\n", validator)) } @@ -242,7 +279,7 @@ func (k Keeper) bondedToUnbonding(ctx sdk.Context, validator types.Validator) (t return k.BeginUnbondingValidator(ctx, validator) } -func (k Keeper) unbondingToBonded(ctx sdk.Context, validator types.Validator) (types.Validator, error) { +func (k Keeper) unbondingToBonded(ctx context.Context, validator types.Validator) (types.Validator, error) { if !validator.IsUnbonding() { panic(fmt.Sprintf("bad state transition unbondingToBonded, validator: %v\n", validator)) } @@ -250,7 +287,7 @@ func (k Keeper) unbondingToBonded(ctx sdk.Context, validator types.Validator) (t return k.bondValidator(ctx, validator) } -func (k Keeper) unbondedToBonded(ctx sdk.Context, validator types.Validator) (types.Validator, error) { +func (k Keeper) unbondedToBonded(ctx context.Context, validator types.Validator) (types.Validator, error) { if !validator.IsUnbonded() { panic(fmt.Sprintf("bad state transition unbondedToBonded, validator: %v\n", validator)) } @@ -259,49 +296,64 @@ func (k Keeper) unbondedToBonded(ctx sdk.Context, validator types.Validator) (ty } // UnbondingToUnbonded switches a validator from unbonding state to unbonded state -func (k Keeper) UnbondingToUnbonded(ctx sdk.Context, validator types.Validator) types.Validator { +func (k Keeper) UnbondingToUnbonded(ctx context.Context, validator types.Validator) (types.Validator, error) { if !validator.IsUnbonding() { - panic(fmt.Sprintf("bad state transition unbondingToUnbonded, validator: %v\n", validator)) + return types.Validator{}, fmt.Errorf("bad state transition unbondingToUnbonded, validator: %v", validator) } return k.completeUnbondingValidator(ctx, validator) } // send a validator to jail -func (k Keeper) jailValidator(ctx sdk.Context, validator types.Validator) { +func (k Keeper) jailValidator(ctx context.Context, validator types.Validator) error { if validator.Jailed { - panic(fmt.Sprintf("cannot jail already jailed validator, validator: %v\n", validator)) + return types.ErrValidatorJailed.Wrapf("cannot jail already jailed validator, validator: %v", validator) } validator.Jailed = true - k.SetValidator(ctx, validator) - k.DeleteValidatorByPowerIndex(ctx, validator) + if err := k.SetValidator(ctx, validator); err != nil { + return err + } + + return k.DeleteValidatorByPowerIndex(ctx, validator) } // remove a validator from jail -func (k Keeper) unjailValidator(ctx sdk.Context, validator types.Validator) { +func (k Keeper) unjailValidator(ctx context.Context, validator types.Validator) error { if !validator.Jailed { - panic(fmt.Sprintf("cannot unjail already unjailed validator, validator: %v\n", validator)) + return fmt.Errorf("cannot unjail already unjailed validator, validator: %v", validator) } validator.Jailed = false - k.SetValidator(ctx, validator) - k.SetValidatorByPowerIndex(ctx, validator) + if err := k.SetValidator(ctx, validator); err != nil { + return err + } + + return k.SetValidatorByPowerIndex(ctx, validator) } // perform all the store operations for when a validator status becomes bonded -func (k Keeper) bondValidator(ctx sdk.Context, validator types.Validator) (types.Validator, error) { +func (k Keeper) bondValidator(ctx context.Context, validator types.Validator) (types.Validator, error) { // delete the validator by power index, as the key will change - k.DeleteValidatorByPowerIndex(ctx, validator) + if err := k.DeleteValidatorByPowerIndex(ctx, validator); err != nil { + return validator, err + } validator = validator.UpdateStatus(types.Bonded) // save the now bonded validator record to the two referenced stores - k.SetValidator(ctx, validator) - k.SetValidatorByPowerIndex(ctx, validator) + if err := k.SetValidator(ctx, validator); err != nil { + return validator, err + } + + if err := k.SetValidatorByPowerIndex(ctx, validator); err != nil { + return validator, err + } // delete from queue if present - k.DeleteValidatorQueue(ctx, validator) + if err := k.DeleteValidatorQueue(ctx, validator); err != nil { + return validator, err + } // trigger hook consAddr, err := validator.GetConsAddr() @@ -309,7 +361,12 @@ func (k Keeper) bondValidator(ctx sdk.Context, validator types.Validator) (types return validator, err } - if err := k.Hooks().AfterValidatorBonded(ctx, consAddr, validator.GetOperator()); err != nil { + str, err := k.validatorAddressCodec.StringToBytes(validator.GetOperator()) + if err != nil { + return validator, err + } + + if err := k.Hooks().AfterValidatorBonded(ctx, consAddr, str); err != nil { return validator, err } @@ -317,33 +374,49 @@ func (k Keeper) bondValidator(ctx sdk.Context, validator types.Validator) (types } // BeginUnbondingValidator performs all the store operations for when a validator begins unbonding -func (k Keeper) BeginUnbondingValidator(ctx sdk.Context, validator types.Validator) (types.Validator, error) { - params := k.GetParams(ctx) +func (k Keeper) BeginUnbondingValidator(ctx context.Context, validator types.Validator) (types.Validator, error) { + params, err := k.GetParams(ctx) + if err != nil { + return validator, err + } // delete the validator by power index, as the key will change - k.DeleteValidatorByPowerIndex(ctx, validator) + if err = k.DeleteValidatorByPowerIndex(ctx, validator); err != nil { + return validator, err + } // sanity check if validator.Status != types.Bonded { panic(fmt.Sprintf("should not already be unbonded or unbonding, validator: %v\n", validator)) } - id := k.IncrementUnbondingID(ctx) + id, err := k.IncrementUnbondingID(ctx) + if err != nil { + return validator, err + } validator = validator.UpdateStatus(types.Unbonding) + sdkCtx := sdk.UnwrapSDKContext(ctx) // set the unbonding completion time and completion height appropriately - validator.UnbondingTime = ctx.BlockHeader().Time.Add(params.UnbondingTime) - validator.UnbondingHeight = ctx.BlockHeader().Height + validator.UnbondingTime = sdkCtx.BlockHeader().Time.Add(params.UnbondingTime) + validator.UnbondingHeight = sdkCtx.BlockHeader().Height validator.UnbondingIds = append(validator.UnbondingIds, id) // save the now unbonded validator record and power index - k.SetValidator(ctx, validator) - k.SetValidatorByPowerIndex(ctx, validator) + if err = k.SetValidator(ctx, validator); err != nil { + return validator, err + } + + if err = k.SetValidatorByPowerIndex(ctx, validator); err != nil { + return validator, err + } // Adds to unbonding validator queue - k.InsertUnbondingValidatorQueue(ctx, validator) + if err = k.InsertUnbondingValidatorQueue(ctx, validator); err != nil { + return validator, err + } // trigger hook consAddr, err := validator.GetConsAddr() @@ -351,11 +424,18 @@ func (k Keeper) BeginUnbondingValidator(ctx sdk.Context, validator types.Validat return validator, err } - if err := k.Hooks().AfterValidatorBeginUnbonding(ctx, consAddr, validator.GetOperator()); err != nil { + str, err := k.validatorAddressCodec.StringToBytes(validator.GetOperator()) + if err != nil { + return validator, err + } + + if err := k.Hooks().AfterValidatorBeginUnbonding(ctx, consAddr, str); err != nil { return validator, err } - k.SetValidatorByUnbondingID(ctx, validator, id) + if err := k.SetValidatorByUnbondingID(ctx, validator, id); err != nil { + return validator, err + } if err := k.Hooks().AfterUnbondingInitiated(ctx, id); err != nil { return validator, err @@ -365,11 +445,13 @@ func (k Keeper) BeginUnbondingValidator(ctx sdk.Context, validator types.Validat } // perform all the store operations for when a validator status becomes unbonded -func (k Keeper) completeUnbondingValidator(ctx sdk.Context, validator types.Validator) types.Validator { +func (k Keeper) completeUnbondingValidator(ctx context.Context, validator types.Validator) (types.Validator, error) { validator = validator.UpdateStatus(types.Unbonded) - k.SetValidator(ctx, validator) + if err := k.SetValidator(ctx, validator); err != nil { + return validator, err + } - return validator + return validator, nil } // map of operator bech32-addresses to serialized power @@ -377,16 +459,19 @@ func (k Keeper) completeUnbondingValidator(ctx sdk.Context, validator types.Vali type validatorsByAddr map[string][]byte // get the last validator set -func (k Keeper) getLastValidatorsByAddr(ctx sdk.Context) (validatorsByAddr, error) { +func (k Keeper) getLastValidatorsByAddr(ctx context.Context) (validatorsByAddr, error) { last := make(validatorsByAddr) - iterator := k.LastValidatorsIterator(ctx) + iterator, err := k.LastValidatorsIterator(ctx) + if err != nil { + return nil, err + } defer iterator.Close() for ; iterator.Valid(); iterator.Next() { // extract the validator address from the key (prefix is 1-byte, addrLen is 1-byte) valAddr := types.AddressFromLastValidatorPowerKey(iterator.Key()) - valAddrStr, err := sdk.Bech32ifyAddressBytes(sdk.GetConfig().GetBech32ValidatorAddrPrefix(), valAddr) + valAddrStr, err := k.validatorAddressCodec.BytesToString(valAddr) if err != nil { return nil, err } @@ -401,13 +486,13 @@ func (k Keeper) getLastValidatorsByAddr(ctx sdk.Context) (validatorsByAddr, erro // given a map of remaining validators to previous bonded power // returns the list of validators to be unbonded, sorted by operator address -func sortNoLongerBonded(last validatorsByAddr) ([][]byte, error) { +func sortNoLongerBonded(last validatorsByAddr, ac address.Codec) ([][]byte, error) { // sort the map keys for determinism noLongerBonded := make([][]byte, len(last)) index := 0 for valAddrStr := range last { - valAddrBytes, err := sdk.ValAddressFromBech32(valAddrStr) + valAddrBytes, err := ac.StringToBytes(valAddrStr) if err != nil { return nil, err } diff --git a/x/staking/keeper/validator.go b/x/staking/keeper/validator.go index a9dd09d3c311..7d92d65a00e9 100644 --- a/x/staking/keeper/validator.go +++ b/x/staking/keeper/validator.go @@ -1,11 +1,17 @@ package keeper import ( + "bytes" + "context" + "errors" "fmt" "time" + cmtprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" gogotypes "github.com/cosmos/gogoproto/types" + corestore "cosmossdk.io/core/store" + errorsmod "cosmossdk.io/errors" "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" @@ -13,140 +19,189 @@ import ( "github.com/cosmos/cosmos-sdk/x/staking/types" ) -// get a single validator -func (k Keeper) GetValidator(ctx sdk.Context, addr sdk.ValAddress) (validator types.Validator, found bool) { - store := ctx.KVStore(k.storeKey) +// GetValidator gets a single validator +func (k Keeper) GetValidator(ctx context.Context, addr sdk.ValAddress) (validator types.Validator, err error) { + store := k.storeService.OpenKVStore(ctx) + value, err := store.Get(types.GetValidatorKey(addr)) + if err != nil { + return validator, err + } - value := store.Get(types.GetValidatorKey(addr)) if value == nil { - return validator, false + return validator, types.ErrNoValidatorFound } - validator = types.MustUnmarshalValidator(k.cdc, value) - return validator, true + return types.UnmarshalValidator(k.cdc, value) } -func (k Keeper) mustGetValidator(ctx sdk.Context, addr sdk.ValAddress) types.Validator { - validator, found := k.GetValidator(ctx, addr) - if !found { +func (k Keeper) mustGetValidator(ctx context.Context, addr sdk.ValAddress) types.Validator { + validator, err := k.GetValidator(ctx, addr) + if err != nil { panic(fmt.Sprintf("validator record not found for address: %X\n", addr)) } return validator } -// get a single validator by consensus address -func (k Keeper) GetValidatorByConsAddr(ctx sdk.Context, consAddr sdk.ConsAddress) (validator types.Validator, found bool) { - store := ctx.KVStore(k.storeKey) +// GetValidatorByConsAddr gets a single validator by consensus address +func (k Keeper) GetValidatorByConsAddr(ctx context.Context, consAddr sdk.ConsAddress) (validator types.Validator, err error) { + store := k.storeService.OpenKVStore(ctx) + opAddr, err := store.Get(types.GetValidatorByConsAddrKey(consAddr)) + if err != nil { + return validator, err + } - opAddr := store.Get(types.GetValidatorByConsAddrKey(consAddr)) if opAddr == nil { - return validator, false + return validator, types.ErrNoValidatorFound } return k.GetValidator(ctx, opAddr) } -func (k Keeper) mustGetValidatorByConsAddr(ctx sdk.Context, consAddr sdk.ConsAddress) types.Validator { - validator, found := k.GetValidatorByConsAddr(ctx, consAddr) - if !found { +func (k Keeper) mustGetValidatorByConsAddr(ctx context.Context, consAddr sdk.ConsAddress) types.Validator { + validator, err := k.GetValidatorByConsAddr(ctx, consAddr) + if err != nil { panic(fmt.Errorf("validator with consensus-Address %s not found", consAddr)) } return validator } -// set the main record holding validator details -func (k Keeper) SetValidator(ctx sdk.Context, validator types.Validator) { - store := ctx.KVStore(k.storeKey) +// SetValidator sets the main record holding validator details +func (k Keeper) SetValidator(ctx context.Context, validator types.Validator) error { + store := k.storeService.OpenKVStore(ctx) bz := types.MustMarshalValidator(k.cdc, &validator) - store.Set(types.GetValidatorKey(validator.GetOperator()), bz) + str, err := k.ValidatorAddressCodec().StringToBytes(validator.GetOperator()) + if err != nil { + return err + } + return store.Set(types.GetValidatorKey(str), bz) } -// validator index -func (k Keeper) SetValidatorByConsAddr(ctx sdk.Context, validator types.Validator) error { +// SetValidatorByConsAddr sets a validator by conesensus address +func (k Keeper) SetValidatorByConsAddr(ctx context.Context, validator types.Validator) error { consPk, err := validator.GetConsAddr() if err != nil { return err } - store := ctx.KVStore(k.storeKey) - store.Set(types.GetValidatorByConsAddrKey(consPk), validator.GetOperator()) - return nil + store := k.storeService.OpenKVStore(ctx) + + bz, err := k.validatorAddressCodec.StringToBytes(validator.GetOperator()) + if err != nil { + return err + } + + return store.Set(types.GetValidatorByConsAddrKey(consPk), bz) } -// validator index -func (k Keeper) SetValidatorByPowerIndex(ctx sdk.Context, validator types.Validator) { +// SetValidatorByPowerIndex sets a validator by power index +func (k Keeper) SetValidatorByPowerIndex(ctx context.Context, validator types.Validator) error { // jailed validators are not kept in the power index if validator.Jailed { - return + return nil } - store := ctx.KVStore(k.storeKey) - store.Set(types.GetValidatorsByPowerIndexKey(validator, k.PowerReduction(ctx)), validator.GetOperator()) + store := k.storeService.OpenKVStore(ctx) + str, err := k.validatorAddressCodec.StringToBytes(validator.GetOperator()) + if err != nil { + return err + } + return store.Set(types.GetValidatorsByPowerIndexKey(validator, k.PowerReduction(ctx), k.validatorAddressCodec), str) } -// validator index -func (k Keeper) DeleteValidatorByPowerIndex(ctx sdk.Context, validator types.Validator) { - store := ctx.KVStore(k.storeKey) - store.Delete(types.GetValidatorsByPowerIndexKey(validator, k.PowerReduction(ctx))) +// DeleteValidatorByPowerIndex deletes a record by power index +func (k Keeper) DeleteValidatorByPowerIndex(ctx context.Context, validator types.Validator) error { + store := k.storeService.OpenKVStore(ctx) + return store.Delete(types.GetValidatorsByPowerIndexKey(validator, k.PowerReduction(ctx), k.validatorAddressCodec)) } -// validator index -func (k Keeper) SetNewValidatorByPowerIndex(ctx sdk.Context, validator types.Validator) { - store := ctx.KVStore(k.storeKey) - store.Set(types.GetValidatorsByPowerIndexKey(validator, k.PowerReduction(ctx)), validator.GetOperator()) +// SetNewValidatorByPowerIndex adds new entry by power index +func (k Keeper) SetNewValidatorByPowerIndex(ctx context.Context, validator types.Validator) error { + store := k.storeService.OpenKVStore(ctx) + str, err := k.validatorAddressCodec.StringToBytes(validator.GetOperator()) + if err != nil { + return err + } + return store.Set(types.GetValidatorsByPowerIndexKey(validator, k.PowerReduction(ctx), k.validatorAddressCodec), str) } -// Update the tokens of an existing validator, update the validators power index key -func (k Keeper) AddValidatorTokensAndShares(ctx sdk.Context, validator types.Validator, +// AddValidatorTokensAndShares updates the tokens of an existing validator, updates the validators power index key +func (k Keeper) AddValidatorTokensAndShares(ctx context.Context, validator types.Validator, tokensToAdd math.Int, -) (valOut types.Validator, addedShares math.LegacyDec) { - k.DeleteValidatorByPowerIndex(ctx, validator) +) (valOut types.Validator, addedShares math.LegacyDec, err error) { + err = k.DeleteValidatorByPowerIndex(ctx, validator) + if err != nil { + return valOut, addedShares, err + } + validator, addedShares = validator.AddTokensFromDel(tokensToAdd) - k.SetValidator(ctx, validator) - k.SetValidatorByPowerIndex(ctx, validator) + err = k.SetValidator(ctx, validator) + if err != nil { + return validator, addedShares, err + } - return validator, addedShares + err = k.SetValidatorByPowerIndex(ctx, validator) + return validator, addedShares, err } -// Update the tokens of an existing validator, update the validators power index key -func (k Keeper) RemoveValidatorTokensAndShares(ctx sdk.Context, validator types.Validator, +// RemoveValidatorTokensAndShares updates the tokens of an existing validator, updates the validators power index key +func (k Keeper) RemoveValidatorTokensAndShares(ctx context.Context, validator types.Validator, sharesToRemove math.LegacyDec, -) (valOut types.Validator, removedTokens math.Int) { - k.DeleteValidatorByPowerIndex(ctx, validator) +) (valOut types.Validator, removedTokens math.Int, err error) { + err = k.DeleteValidatorByPowerIndex(ctx, validator) + if err != nil { + return valOut, removedTokens, err + } validator, removedTokens = validator.RemoveDelShares(sharesToRemove) - k.SetValidator(ctx, validator) - k.SetValidatorByPowerIndex(ctx, validator) + err = k.SetValidator(ctx, validator) + if err != nil { + return validator, removedTokens, err + } - return validator, removedTokens + err = k.SetValidatorByPowerIndex(ctx, validator) + return validator, removedTokens, err } -// Update the tokens of an existing validator, update the validators power index key -func (k Keeper) RemoveValidatorTokens(ctx sdk.Context, +// RemoveValidatorTokens updates the tokens of an existing validator, updates the validators power index key +func (k Keeper) RemoveValidatorTokens(ctx context.Context, validator types.Validator, tokensToRemove math.Int, -) types.Validator { - k.DeleteValidatorByPowerIndex(ctx, validator) +) (types.Validator, error) { + if err := k.DeleteValidatorByPowerIndex(ctx, validator); err != nil { + return validator, err + } + validator = validator.RemoveTokens(tokensToRemove) - k.SetValidator(ctx, validator) - k.SetValidatorByPowerIndex(ctx, validator) + if err := k.SetValidator(ctx, validator); err != nil { + return validator, err + } - return validator + if err := k.SetValidatorByPowerIndex(ctx, validator); err != nil { + return validator, err + } + + return validator, nil } // UpdateValidatorCommission attempts to update a validator's commission rate. // An error is returned if the new commission rate is invalid. -func (k Keeper) UpdateValidatorCommission(ctx sdk.Context, +func (k Keeper) UpdateValidatorCommission(ctx context.Context, validator types.Validator, newRate math.LegacyDec, ) (types.Commission, error) { commission := validator.Commission - blockTime := ctx.BlockHeader().Time + sdkCtx := sdk.UnwrapSDKContext(ctx) + blockTime := sdkCtx.BlockHeader().Time if err := commission.ValidateNewRate(newRate, blockTime); err != nil { return commission, err } - if newRate.LT(k.MinCommissionRate(ctx)) { - return commission, fmt.Errorf("cannot set validator commission to less than minimum rate of %s", k.MinCommissionRate(ctx)) + minCommissionRate, err := k.MinCommissionRate(ctx) + if err != nil { + return commission, err + } + + if newRate.LT(minCommissionRate) { + return commission, fmt.Errorf("cannot set validator commission to less than minimum rate of %s", minCommissionRate) } commission.Rate = newRate @@ -155,81 +210,112 @@ func (k Keeper) UpdateValidatorCommission(ctx sdk.Context, return commission, nil } -// remove the validator record and associated indexes +// RemoveValidator removes the validator record and associated indexes // except for the bonded validator index which is only handled in ApplyAndReturnTendermintUpdates -// TODO, this function panics, and it's not good. -func (k Keeper) RemoveValidator(ctx sdk.Context, address sdk.ValAddress) { +func (k Keeper) RemoveValidator(ctx context.Context, address sdk.ValAddress) error { // first retrieve the old validator record - validator, found := k.GetValidator(ctx, address) - if !found { - return + validator, err := k.GetValidator(ctx, address) + if errors.Is(err, types.ErrNoValidatorFound) { + return nil } if !validator.IsUnbonded() { - panic("cannot call RemoveValidator on bonded or unbonding validators") + return types.ErrBadRemoveValidator.Wrap("cannot call RemoveValidator on bonded or unbonding validators") } if validator.Tokens.IsPositive() { - panic("attempting to remove a validator which still contains tokens") + return types.ErrBadRemoveValidator.Wrap("attempting to remove a validator which still contains tokens") } valConsAddr, err := validator.GetConsAddr() if err != nil { - panic(err) + return err } // delete the old validator record - store := ctx.KVStore(k.storeKey) - store.Delete(types.GetValidatorKey(address)) - store.Delete(types.GetValidatorByConsAddrKey(valConsAddr)) - store.Delete(types.GetValidatorsByPowerIndexKey(validator, k.PowerReduction(ctx))) + store := k.storeService.OpenKVStore(ctx) + if err = store.Delete(types.GetValidatorKey(address)); err != nil { + return err + } + + if err = store.Delete(types.GetValidatorByConsAddrKey(valConsAddr)); err != nil { + return err + } - if err := k.Hooks().AfterValidatorRemoved(ctx, valConsAddr, validator.GetOperator()); err != nil { + if err = store.Delete(types.GetValidatorsByPowerIndexKey(validator, k.PowerReduction(ctx), k.validatorAddressCodec)); err != nil { + return err + } + + str, err := k.validatorAddressCodec.StringToBytes(validator.GetOperator()) + if err != nil { + return err + } + + if err := k.Hooks().AfterValidatorRemoved(ctx, valConsAddr, str); err != nil { k.Logger(ctx).Error("error in after validator removed hook", "error", err) } + + return nil } // get groups of validators -// get the set of all validators with no limits, used during genesis dump -func (k Keeper) GetAllValidators(ctx sdk.Context) (validators []types.Validator) { - store := ctx.KVStore(k.storeKey) +// GetAllValidators gets the set of all validators with no limits, used during genesis dump +func (k Keeper) GetAllValidators(ctx context.Context) (validators []types.Validator, err error) { + store := k.storeService.OpenKVStore(ctx) - iterator := storetypes.KVStorePrefixIterator(store, types.ValidatorsKey) + iterator, err := store.Iterator(types.ValidatorsKey, storetypes.PrefixEndBytes(types.ValidatorsKey)) + if err != nil { + return nil, err + } defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - validator := types.MustUnmarshalValidator(k.cdc, iterator.Value()) + validator, err := types.UnmarshalValidator(k.cdc, iterator.Value()) + if err != nil { + return nil, err + } validators = append(validators, validator) } - return validators + return validators, nil } -// return a given amount of all the validators -func (k Keeper) GetValidators(ctx sdk.Context, maxRetrieve uint32) (validators []types.Validator) { - store := ctx.KVStore(k.storeKey) +// GetValidators returns a given amount of all the validators +func (k Keeper) GetValidators(ctx context.Context, maxRetrieve uint32) (validators []types.Validator, err error) { + store := k.storeService.OpenKVStore(ctx) validators = make([]types.Validator, maxRetrieve) - iterator := storetypes.KVStorePrefixIterator(store, types.ValidatorsKey) - defer iterator.Close() + iterator, err := store.Iterator(types.ValidatorsKey, storetypes.PrefixEndBytes(types.ValidatorsKey)) + if err != nil { + return nil, err + } i := 0 for ; iterator.Valid() && i < int(maxRetrieve); iterator.Next() { - validator := types.MustUnmarshalValidator(k.cdc, iterator.Value()) + validator, err := types.UnmarshalValidator(k.cdc, iterator.Value()) + if err != nil { + return nil, err + } validators[i] = validator i++ } - return validators[:i] // trim if the array length < maxRetrieve + return validators[:i], nil // trim if the array length < maxRetrieve } -// get the current group of bonded validators sorted by power-rank -func (k Keeper) GetBondedValidatorsByPower(ctx sdk.Context) []types.Validator { - maxValidators := k.MaxValidators(ctx) +// GetBondedValidatorsByPower gets the current group of bonded validators sorted by power-rank +func (k Keeper) GetBondedValidatorsByPower(ctx context.Context) ([]types.Validator, error) { + maxValidators, err := k.MaxValidators(ctx) + if err != nil { + return nil, err + } validators := make([]types.Validator, maxValidators) - iterator := k.ValidatorsPowerStoreIterator(ctx) + iterator, err := k.ValidatorsPowerStoreIterator(ctx) + if err != nil { + return nil, err + } defer iterator.Close() i := 0 @@ -243,82 +329,99 @@ func (k Keeper) GetBondedValidatorsByPower(ctx sdk.Context) []types.Validator { } } - return validators[:i] // trim + return validators[:i], nil // trim } -// returns an iterator for the current validator power store -func (k Keeper) ValidatorsPowerStoreIterator(ctx sdk.Context) storetypes.Iterator { - store := ctx.KVStore(k.storeKey) - return storetypes.KVStoreReversePrefixIterator(store, types.ValidatorsByPowerIndexKey) +// ValidatorsPowerStoreIterator returns an iterator for the current validator power store +func (k Keeper) ValidatorsPowerStoreIterator(ctx context.Context) (corestore.Iterator, error) { + store := k.storeService.OpenKVStore(ctx) + return store.ReverseIterator(types.ValidatorsByPowerIndexKey, storetypes.PrefixEndBytes(types.ValidatorsByPowerIndexKey)) } // Last Validator Index -// Load the last validator power. +// GetLastValidatorPower loads the last validator power. // Returns zero if the operator was not a validator last block. -func (k Keeper) GetLastValidatorPower(ctx sdk.Context, operator sdk.ValAddress) (power int64) { - store := ctx.KVStore(k.storeKey) +func (k Keeper) GetLastValidatorPower(ctx context.Context, operator sdk.ValAddress) (power int64, err error) { + store := k.storeService.OpenKVStore(ctx) + bz, err := store.Get(types.GetLastValidatorPowerKey(operator)) + if err != nil { + return 0, err + } - bz := store.Get(types.GetLastValidatorPowerKey(operator)) if bz == nil { - return 0 + return 0, nil } intV := gogotypes.Int64Value{} - k.cdc.MustUnmarshal(bz, &intV) + err = k.cdc.Unmarshal(bz, &intV) + if err != nil { + return 0, err + } - return intV.GetValue() + return intV.GetValue(), nil } -// Set the last validator power. -func (k Keeper) SetLastValidatorPower(ctx sdk.Context, operator sdk.ValAddress, power int64) { - store := ctx.KVStore(k.storeKey) - bz := k.cdc.MustMarshal(&gogotypes.Int64Value{Value: power}) - store.Set(types.GetLastValidatorPowerKey(operator), bz) +// SetLastValidatorPower sets the last validator power. +func (k Keeper) SetLastValidatorPower(ctx context.Context, operator sdk.ValAddress, power int64) error { + store := k.storeService.OpenKVStore(ctx) + bz, err := k.cdc.Marshal(&gogotypes.Int64Value{Value: power}) + if err != nil { + return err + } + return store.Set(types.GetLastValidatorPowerKey(operator), bz) } -// Delete the last validator power. -func (k Keeper) DeleteLastValidatorPower(ctx sdk.Context, operator sdk.ValAddress) { - store := ctx.KVStore(k.storeKey) - store.Delete(types.GetLastValidatorPowerKey(operator)) +// DeleteLastValidatorPower deletes the last validator power. +func (k Keeper) DeleteLastValidatorPower(ctx context.Context, operator sdk.ValAddress) error { + store := k.storeService.OpenKVStore(ctx) + return store.Delete(types.GetLastValidatorPowerKey(operator)) } -// returns an iterator for the consensus validators in the last block -func (k Keeper) LastValidatorsIterator(ctx sdk.Context) (iterator storetypes.Iterator) { - store := ctx.KVStore(k.storeKey) - iterator = storetypes.KVStorePrefixIterator(store, types.LastValidatorPowerKey) - - return iterator +// lastValidatorsIterator returns an iterator for the consensus validators in the last block +func (k Keeper) LastValidatorsIterator(ctx context.Context) (corestore.Iterator, error) { + store := k.storeService.OpenKVStore(ctx) + return store.Iterator(types.LastValidatorPowerKey, storetypes.PrefixEndBytes(types.LastValidatorPowerKey)) } -// Iterate over last validator powers. -func (k Keeper) IterateLastValidatorPowers(ctx sdk.Context, handler func(operator sdk.ValAddress, power int64) (stop bool)) { - store := ctx.KVStore(k.storeKey) - - iter := storetypes.KVStorePrefixIterator(store, types.LastValidatorPowerKey) - defer iter.Close() +// IterateLastValidatorPowers iterates over last validator powers. +func (k Keeper) IterateLastValidatorPowers(ctx context.Context, handler func(operator sdk.ValAddress, power int64) (stop bool)) error { + iter, err := k.LastValidatorsIterator(ctx) + if err != nil { + return err + } for ; iter.Valid(); iter.Next() { addr := sdk.ValAddress(types.AddressFromLastValidatorPowerKey(iter.Key())) intV := &gogotypes.Int64Value{} - k.cdc.MustUnmarshal(iter.Value(), intV) + if err = k.cdc.Unmarshal(iter.Value(), intV); err != nil { + return err + } if handler(addr, intV.GetValue()) { break } } + + return nil } -// get the group of the bonded validators -func (k Keeper) GetLastValidators(ctx sdk.Context) (validators []types.Validator) { - store := ctx.KVStore(k.storeKey) +// GetLastValidators gets the group of the bonded validators +func (k Keeper) GetLastValidators(ctx context.Context) (validators []types.Validator, err error) { + store := k.storeService.OpenKVStore(ctx) // add the actual validator power sorted store - maxValidators := k.MaxValidators(ctx) + maxValidators, err := k.MaxValidators(ctx) + if err != nil { + return nil, err + } validators = make([]types.Validator, maxValidators) - iterator := storetypes.KVStorePrefixIterator(store, types.LastValidatorPowerKey) + iterator, err := store.Iterator(types.LastValidatorPowerKey, storetypes.PrefixEndBytes(types.LastValidatorPowerKey)) + if err != nil { + return nil, err + } defer iterator.Close() i := 0 @@ -329,111 +432,133 @@ func (k Keeper) GetLastValidators(ctx sdk.Context) (validators []types.Validator } address := types.AddressFromLastValidatorPowerKey(iterator.Key()) - validator := k.mustGetValidator(ctx, address) + validator, err := k.GetValidator(ctx, address) + if err != nil { + return nil, err + } validators[i] = validator i++ } - return validators[:i] // trim + return validators[:i], nil // trim } // GetUnbondingValidators returns a slice of mature validator addresses that // complete their unbonding at a given time and height. -func (k Keeper) GetUnbondingValidators(ctx sdk.Context, endTime time.Time, endHeight int64) []string { - store := ctx.KVStore(k.storeKey) +func (k Keeper) GetUnbondingValidators(ctx context.Context, endTime time.Time, endHeight int64) ([]string, error) { + store := k.storeService.OpenKVStore(ctx) + + bz, err := store.Get(types.GetValidatorQueueKey(endTime, endHeight)) + if err != nil { + return nil, err + } - bz := store.Get(types.GetValidatorQueueKey(endTime, endHeight)) if bz == nil { - return []string{} + return []string{}, nil } addrs := types.ValAddresses{} - k.cdc.MustUnmarshal(bz, &addrs) + if err = k.cdc.Unmarshal(bz, &addrs); err != nil { + return nil, err + } - return addrs.Addresses + return addrs.Addresses, nil } // SetUnbondingValidatorsQueue sets a given slice of validator addresses into // the unbonding validator queue by a given height and time. -func (k Keeper) SetUnbondingValidatorsQueue(ctx sdk.Context, endTime time.Time, endHeight int64, addrs []string) { - store := ctx.KVStore(k.storeKey) - bz := k.cdc.MustMarshal(&types.ValAddresses{Addresses: addrs}) - store.Set(types.GetValidatorQueueKey(endTime, endHeight), bz) +func (k Keeper) SetUnbondingValidatorsQueue(ctx context.Context, endTime time.Time, endHeight int64, addrs []string) error { + store := k.storeService.OpenKVStore(ctx) + bz, err := k.cdc.Marshal(&types.ValAddresses{Addresses: addrs}) + if err != nil { + return err + } + return store.Set(types.GetValidatorQueueKey(endTime, endHeight), bz) } // InsertUnbondingValidatorQueue inserts a given unbonding validator address into // the unbonding validator queue for a given height and time. -func (k Keeper) InsertUnbondingValidatorQueue(ctx sdk.Context, val types.Validator) { - addrs := k.GetUnbondingValidators(ctx, val.UnbondingTime, val.UnbondingHeight) +func (k Keeper) InsertUnbondingValidatorQueue(ctx context.Context, val types.Validator) error { + addrs, err := k.GetUnbondingValidators(ctx, val.UnbondingTime, val.UnbondingHeight) + if err != nil { + return err + } addrs = append(addrs, val.OperatorAddress) - k.SetUnbondingValidatorsQueue(ctx, val.UnbondingTime, val.UnbondingHeight, addrs) + return k.SetUnbondingValidatorsQueue(ctx, val.UnbondingTime, val.UnbondingHeight, addrs) } // DeleteValidatorQueueTimeSlice deletes all entries in the queue indexed by a // given height and time. -func (k Keeper) DeleteValidatorQueueTimeSlice(ctx sdk.Context, endTime time.Time, endHeight int64) { - store := ctx.KVStore(k.storeKey) - store.Delete(types.GetValidatorQueueKey(endTime, endHeight)) +func (k Keeper) DeleteValidatorQueueTimeSlice(ctx context.Context, endTime time.Time, endHeight int64) error { + store := k.storeService.OpenKVStore(ctx) + return store.Delete(types.GetValidatorQueueKey(endTime, endHeight)) } // DeleteValidatorQueue removes a validator by address from the unbonding queue // indexed by a given height and time. -func (k Keeper) DeleteValidatorQueue(ctx sdk.Context, val types.Validator) { - addrs := k.GetUnbondingValidators(ctx, val.UnbondingTime, val.UnbondingHeight) +func (k Keeper) DeleteValidatorQueue(ctx context.Context, val types.Validator) error { + addrs, err := k.GetUnbondingValidators(ctx, val.UnbondingTime, val.UnbondingHeight) + if err != nil { + return err + } newAddrs := []string{} // since address string may change due to Bech32 prefix change, we parse the addresses into bytes // format for normalization - deletingAddr, err := sdk.ValAddressFromBech32(val.OperatorAddress) + deletingAddr, err := k.validatorAddressCodec.StringToBytes(val.OperatorAddress) if err != nil { - panic(err) + return err } for _, addr := range addrs { - storedAddr, err := sdk.ValAddressFromBech32(addr) + storedAddr, err := k.validatorAddressCodec.StringToBytes(addr) if err != nil { - // even if we don't panic here, it will panic in UnbondAllMatureValidators at unbond time - panic(err) + // even if we don't error here, it will error in UnbondAllMatureValidators at unbond time + return err } - if !storedAddr.Equals(deletingAddr) { - newAddrs = append(newAddrs, storedAddr.String()) + if !bytes.Equal(storedAddr, deletingAddr) { + newAddrs = append(newAddrs, addr) } } if len(newAddrs) == 0 { - k.DeleteValidatorQueueTimeSlice(ctx, val.UnbondingTime, val.UnbondingHeight) - } else { - k.SetUnbondingValidatorsQueue(ctx, val.UnbondingTime, val.UnbondingHeight, newAddrs) + return k.DeleteValidatorQueueTimeSlice(ctx, val.UnbondingTime, val.UnbondingHeight) } + + return k.SetUnbondingValidatorsQueue(ctx, val.UnbondingTime, val.UnbondingHeight, newAddrs) } // ValidatorQueueIterator returns an interator ranging over validators that are // unbonding whose unbonding completion occurs at the given height and time. -func (k Keeper) ValidatorQueueIterator(ctx sdk.Context, endTime time.Time, endHeight int64) storetypes.Iterator { - store := ctx.KVStore(k.storeKey) +func (k Keeper) ValidatorQueueIterator(ctx context.Context, endTime time.Time, endHeight int64) (corestore.Iterator, error) { + store := k.storeService.OpenKVStore(ctx) return store.Iterator(types.ValidatorQueueKey, storetypes.InclusiveEndBytes(types.GetValidatorQueueKey(endTime, endHeight))) } // UnbondAllMatureValidators unbonds all the mature unbonding validators that // have finished their unbonding period. -func (k Keeper) UnbondAllMatureValidators(ctx sdk.Context) { - blockTime := ctx.BlockTime() - blockHeight := ctx.BlockHeight() +func (k Keeper) UnbondAllMatureValidators(ctx context.Context) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) + blockTime := sdkCtx.BlockTime() + blockHeight := sdkCtx.BlockHeight() // unbondingValIterator will contains all validator addresses indexed under // the ValidatorQueueKey prefix. Note, the entire index key is composed as // ValidatorQueueKey | timeBzLen (8-byte big endian) | timeBz | heightBz (8-byte big endian), // so it may be possible that certain validator addresses that are iterated // over are not ready to unbond, so an explicit check is required. - unbondingValIterator := k.ValidatorQueueIterator(ctx, blockTime, blockHeight) + unbondingValIterator, err := k.ValidatorQueueIterator(ctx, blockTime, blockHeight) + if err != nil { + return err + } defer unbondingValIterator.Close() for ; unbondingValIterator.Valid(); unbondingValIterator.Next() { key := unbondingValIterator.Key() keyTime, keyHeight, err := types.ParseValidatorQueueKey(key) if err != nil { - panic(fmt.Errorf("failed to parse unbonding key: %w", err)) + return fmt.Errorf("failed to parse unbonding key: %w", err) } // All addresses for the given key have the same unbonding height and time. @@ -441,49 +566,81 @@ func (k Keeper) UnbondAllMatureValidators(ctx sdk.Context) { // and time. if keyHeight <= blockHeight && (keyTime.Before(blockTime) || keyTime.Equal(blockTime)) { addrs := types.ValAddresses{} - k.cdc.MustUnmarshal(unbondingValIterator.Value(), &addrs) + if err = k.cdc.Unmarshal(unbondingValIterator.Value(), &addrs); err != nil { + return err + } for _, valAddr := range addrs.Addresses { - addr, err := sdk.ValAddressFromBech32(valAddr) + addr, err := k.validatorAddressCodec.StringToBytes(valAddr) if err != nil { - panic(err) + return err } - val, found := k.GetValidator(ctx, addr) - if !found { - panic("validator in the unbonding queue was not found") + val, err := k.GetValidator(ctx, addr) + if err != nil { + return errorsmod.Wrap(err, "validator in the unbonding queue was not found") } if !val.IsUnbonding() { - panic("unexpected validator in unbonding queue; status was not unbonding") + return fmt.Errorf("unexpected validator in unbonding queue; status was not unbonding") } if val.UnbondingOnHoldRefCount == 0 { for _, id := range val.UnbondingIds { - k.DeleteUnbondingIndex(ctx, id) + if err = k.DeleteUnbondingIndex(ctx, id); err != nil { + return err + } } - val = k.UnbondingToUnbonded(ctx, val) + val, err = k.UnbondingToUnbonded(ctx, val) + if err != nil { + return err + } if val.GetDelegatorShares().IsZero() { - k.RemoveValidator(ctx, val.GetOperator()) + str, err := k.validatorAddressCodec.StringToBytes(val.GetOperator()) + if err != nil { + return err + } + if err = k.RemoveValidator(ctx, str); err != nil { + return err + } } else { // remove unbonding ids val.UnbondingIds = []uint64{} } // remove validator from queue - k.DeleteValidatorQueue(ctx, val) + if err = k.DeleteValidatorQueue(ctx, val); err != nil { + return err + } } } } } + return nil } -func (k Keeper) IsValidatorJailed(ctx sdk.Context, addr sdk.ConsAddress) bool { - v, ok := k.GetValidatorByConsAddr(ctx, addr) - if !ok { - return false +// IsValidatorJailed checks and returns boolean of a validator status jailed or not. +func (k Keeper) IsValidatorJailed(ctx context.Context, addr sdk.ConsAddress) (bool, error) { + v, err := k.GetValidatorByConsAddr(ctx, addr) + if err != nil { + return false, err + } + + return v.Jailed, nil +} + +// GetPubKeyByConsAddr returns the consensus public key by consensus address. +func (k Keeper) GetPubKeyByConsAddr(ctx context.Context, addr sdk.ConsAddress) (cmtprotocrypto.PublicKey, error) { + v, err := k.GetValidatorByConsAddr(ctx, addr) + if err != nil { + return cmtprotocrypto.PublicKey{}, err + } + + pubkey, err := v.CmtConsPublicKey() + if err != nil { + return cmtprotocrypto.PublicKey{}, err } - return v.Jailed + return pubkey, nil } diff --git a/x/staking/keeper/validator_test.go b/x/staking/keeper/validator_test.go index 363378d96503..438b0d1da439 100644 --- a/x/staking/keeper/validator_test.go +++ b/x/staking/keeper/validator_test.go @@ -3,12 +3,12 @@ package keeper_test import ( "time" - "github.com/golang/mock/gomock" + abci "github.com/cometbft/cometbft/abci/types" + "go.uber.org/mock/gomock" "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" - abci "github.com/cometbft/cometbft/abci/types" + sdk "github.com/cosmos/cosmos-sdk/types" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/testutil" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -37,15 +37,15 @@ func (s *KeeperTestSuite) TestValidator() { require.Equal(stakingtypes.Unbonded, validator.Status) require.Equal(valTokens, validator.Tokens) require.Equal(valTokens, validator.DelegatorShares.RoundInt()) - keeper.SetValidator(ctx, validator) - keeper.SetValidatorByPowerIndex(ctx, validator) - keeper.SetValidatorByConsAddr(ctx, validator) + require.NoError(keeper.SetValidator(ctx, validator)) + require.NoError(keeper.SetValidatorByPowerIndex(ctx, validator)) + require.NoError(keeper.SetValidatorByConsAddr(ctx, validator)) // ensure update s.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), stakingtypes.NotBondedPoolName, stakingtypes.BondedPoolName, gomock.Any()) updates := s.applyValidatorSetUpdates(ctx, keeper, 1) - validator, found := keeper.GetValidator(ctx, valAddr) - require.True(found) + validator, err := keeper.GetValidator(ctx, valAddr) + require.NoError(err) require.Equal(validator.ABCIValidatorUpdate(keeper.PowerReduction(ctx)), updates[0]) // after the save the validator should be bonded @@ -56,28 +56,33 @@ func (s *KeeperTestSuite) TestValidator() { // check each store for being saved consAddr, err := validator.GetConsAddr() require.NoError(err) - resVal, found := keeper.GetValidatorByConsAddr(ctx, consAddr) - require.True(found) + resVal, err := keeper.GetValidatorByConsAddr(ctx, consAddr) + require.NoError(err) require.True(validator.MinEqual(&resVal)) - resVals := keeper.GetLastValidators(ctx) + resVals, err := keeper.GetLastValidators(ctx) + require.NoError(err) require.Equal(1, len(resVals)) require.True(validator.MinEqual(&resVals[0])) - resVals = keeper.GetBondedValidatorsByPower(ctx) + resVals, err = keeper.GetBondedValidatorsByPower(ctx) + require.NoError(err) require.Equal(1, len(resVals)) require.True(validator.MinEqual(&resVals[0])) - allVals := keeper.GetAllValidators(ctx) + allVals, err := keeper.GetAllValidators(ctx) + require.NoError(err) require.Equal(1, len(allVals)) // check the last validator power power := int64(100) - keeper.SetLastValidatorPower(ctx, valAddr, power) - resPower := keeper.GetLastValidatorPower(ctx, valAddr) + require.NoError(keeper.SetLastValidatorPower(ctx, valAddr, power)) + resPower, err := keeper.GetLastValidatorPower(ctx, valAddr) + require.NoError(err) require.Equal(power, resPower) - keeper.DeleteLastValidatorPower(ctx, valAddr) - resPower = keeper.GetLastValidatorPower(ctx, valAddr) + require.NoError(keeper.DeleteLastValidatorPower(ctx, valAddr)) + resPower, err = keeper.GetLastValidatorPower(ctx, valAddr) + require.NoError(err) require.Equal(int64(0), resPower) } @@ -103,31 +108,34 @@ func (s *KeeperTestSuite) TestValidatorBasics() { require.Equal(keeper.TokensFromConsensusPower(ctx, 7), validators[2].Tokens) // check the empty keeper first - _, found := keeper.GetValidator(ctx, sdk.ValAddress(PKs[0].Address().Bytes())) - require.False(found) - resVals := keeper.GetLastValidators(ctx) + _, err := keeper.GetValidator(ctx, sdk.ValAddress(PKs[0].Address().Bytes())) + require.ErrorIs(err, stakingtypes.ErrNoValidatorFound) + resVals, err := keeper.GetLastValidators(ctx) + require.NoError(err) require.Zero(len(resVals)) - resVals = keeper.GetValidators(ctx, 2) + resVals, err = keeper.GetValidators(ctx, 2) + require.NoError(err) require.Len(resVals, 0) // set and retrieve a record s.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), stakingtypes.NotBondedPoolName, stakingtypes.BondedPoolName, gomock.Any()) validators[0] = stakingkeeper.TestingUpdateValidator(keeper, ctx, validators[0], true) - keeper.SetValidatorByConsAddr(ctx, validators[0]) - resVal, found := keeper.GetValidator(ctx, sdk.ValAddress(PKs[0].Address().Bytes())) - require.True(found) + require.NoError(keeper.SetValidatorByConsAddr(ctx, validators[0])) + resVal, err := keeper.GetValidator(ctx, sdk.ValAddress(PKs[0].Address().Bytes())) + require.NoError(err) require.True(validators[0].MinEqual(&resVal)) // retrieve from consensus - resVal, found = keeper.GetValidatorByConsAddr(ctx, sdk.ConsAddress(PKs[0].Address())) - require.True(found) + resVal, err = keeper.GetValidatorByConsAddr(ctx, sdk.ConsAddress(PKs[0].Address())) + require.NoError(err) require.True(validators[0].MinEqual(&resVal)) - resVal, found = keeper.GetValidatorByConsAddr(ctx, sdk.GetConsAddress(PKs[0])) - require.True(found) + resVal, err = keeper.GetValidatorByConsAddr(ctx, sdk.GetConsAddress(PKs[0])) + require.NoError(err) require.True(validators[0].MinEqual(&resVal)) - resVals = keeper.GetLastValidators(ctx) + resVals, err = keeper.GetLastValidators(ctx) + require.NoError(err) require.Equal(1, len(resVals)) require.True(validators[0].MinEqual(&resVals[0])) require.Equal(stakingtypes.Bonded, validators[0].Status) @@ -138,11 +146,12 @@ func (s *KeeperTestSuite) TestValidatorBasics() { validators[0].Tokens = keeper.TokensFromConsensusPower(ctx, 10) validators[0].DelegatorShares = math.LegacyNewDecFromInt(validators[0].Tokens) validators[0] = stakingkeeper.TestingUpdateValidator(keeper, ctx, validators[0], true) - resVal, found = keeper.GetValidator(ctx, sdk.ValAddress(PKs[0].Address().Bytes())) - require.True(found) + resVal, err = keeper.GetValidator(ctx, sdk.ValAddress(PKs[0].Address().Bytes())) + require.NoError(err) require.True(validators[0].MinEqual(&resVal)) - resVals = keeper.GetLastValidators(ctx) + resVals, err = keeper.GetLastValidators(ctx) + require.NoError(err) require.Equal(1, len(resVals)) require.True(validators[0].MinEqual(&resVals[0])) @@ -151,33 +160,35 @@ func (s *KeeperTestSuite) TestValidatorBasics() { validators[1] = stakingkeeper.TestingUpdateValidator(keeper, ctx, validators[1], true) s.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), stakingtypes.NotBondedPoolName, stakingtypes.BondedPoolName, gomock.Any()) validators[2] = stakingkeeper.TestingUpdateValidator(keeper, ctx, validators[2], true) - resVal, found = keeper.GetValidator(ctx, sdk.ValAddress(PKs[1].Address().Bytes())) - require.True(found) + resVal, err = keeper.GetValidator(ctx, sdk.ValAddress(PKs[1].Address().Bytes())) + require.NoError(err) require.True(validators[1].MinEqual(&resVal)) - resVal, found = keeper.GetValidator(ctx, sdk.ValAddress(PKs[2].Address().Bytes())) - require.True(found) + resVal, err = keeper.GetValidator(ctx, sdk.ValAddress(PKs[2].Address().Bytes())) + require.NoError(err) require.True(validators[2].MinEqual(&resVal)) - resVals = keeper.GetLastValidators(ctx) + resVals, err = keeper.GetLastValidators(ctx) + require.NoError(err) require.Equal(3, len(resVals)) // remove a record + bz, err := keeper.ValidatorAddressCodec().StringToBytes(validators[1].GetOperator()) + require.NoError(err) + // shouldn't be able to remove if status is not unbonded - require.PanicsWithValue("cannot call RemoveValidator on bonded or unbonding validators", - func() { keeper.RemoveValidator(ctx, validators[1].GetOperator()) }) + require.EqualError(keeper.RemoveValidator(ctx, bz), "cannot call RemoveValidator on bonded or unbonding validators: failed to remove validator") // shouldn't be able to remove if there are still tokens left validators[1].Status = stakingtypes.Unbonded - keeper.SetValidator(ctx, validators[1]) - require.PanicsWithValue("attempting to remove a validator which still contains tokens", - func() { keeper.RemoveValidator(ctx, validators[1].GetOperator()) }) + require.NoError(keeper.SetValidator(ctx, validators[1])) + require.EqualError(keeper.RemoveValidator(ctx, bz), "attempting to remove a validator which still contains tokens: failed to remove validator") validators[1].Tokens = math.ZeroInt() // ...remove all tokens - keeper.SetValidator(ctx, validators[1]) // ...set the validator - keeper.RemoveValidator(ctx, validators[1].GetOperator()) // Now it can be removed. - _, found = keeper.GetValidator(ctx, sdk.ValAddress(PKs[1].Address().Bytes())) - require.False(found) + require.NoError(keeper.SetValidator(ctx, validators[1])) // ...set the validator + require.NoError(keeper.RemoveValidator(ctx, bz)) // Now it can be removed. + _, err = keeper.GetValidator(ctx, sdk.ValAddress(PKs[1].Address().Bytes())) + require.ErrorIs(err, stakingtypes.ErrNoValidatorFound) } func (s *KeeperTestSuite) TestUpdateValidatorByPowerIndex() { @@ -196,30 +207,30 @@ func (s *KeeperTestSuite) TestUpdateValidatorByPowerIndex() { s.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), stakingtypes.NotBondedPoolName, stakingtypes.BondedPoolName, gomock.Any()) stakingkeeper.TestingUpdateValidator(keeper, ctx, validator, true) - validator, found := keeper.GetValidator(ctx, valAddr) - require.True(found) + validator, err := keeper.GetValidator(ctx, valAddr) + require.NoError(err) require.Equal(valTokens, validator.Tokens) - power := stakingtypes.GetValidatorsByPowerIndexKey(validator, keeper.PowerReduction(ctx)) + power := stakingtypes.GetValidatorsByPowerIndexKey(validator, keeper.PowerReduction(ctx), keeper.ValidatorAddressCodec()) require.True(stakingkeeper.ValidatorByPowerIndexExists(ctx, keeper, power)) // burn half the delegator shares - keeper.DeleteValidatorByPowerIndex(ctx, validator) + require.NoError(keeper.DeleteValidatorByPowerIndex(ctx, validator)) validator, burned := validator.RemoveDelShares(delSharesCreated.Quo(math.LegacyNewDec(2))) require.Equal(keeper.TokensFromConsensusPower(ctx, 50), burned) stakingkeeper.TestingUpdateValidator(keeper, ctx, validator, true) // update the validator, possibly kicking it out require.False(stakingkeeper.ValidatorByPowerIndexExists(ctx, keeper, power)) - validator, found = keeper.GetValidator(ctx, valAddr) - require.True(found) + validator, err = keeper.GetValidator(ctx, valAddr) + require.NoError(err) - power = stakingtypes.GetValidatorsByPowerIndexKey(validator, keeper.PowerReduction(ctx)) + power = stakingtypes.GetValidatorsByPowerIndexKey(validator, keeper.PowerReduction(ctx), keeper.ValidatorAddressCodec()) require.True(stakingkeeper.ValidatorByPowerIndexExists(ctx, keeper, power)) // set new validator by power index - keeper.DeleteValidatorByPowerIndex(ctx, validator) + require.NoError(keeper.DeleteValidatorByPowerIndex(ctx, validator)) require.False(stakingkeeper.ValidatorByPowerIndexExists(ctx, keeper, power)) - keeper.SetNewValidatorByPowerIndex(ctx, validator) + require.NoError(keeper.SetNewValidatorByPowerIndex(ctx, validator)) require.True(stakingkeeper.ValidatorByPowerIndexExists(ctx, keeper, power)) } @@ -272,9 +283,10 @@ func (s *KeeperTestSuite) TestUpdateValidatorCommission() { require := s.Require() // Set MinCommissionRate to 0.05 - params := keeper.GetParams(ctx) + params, err := keeper.GetParams(ctx) + require.NoError(err) params.MinCommissionRate = math.LegacyNewDecWithPrec(5, 2) - keeper.SetParams(ctx, params) + require.NoError(keeper.SetParams(ctx, params)) commission1 := stakingtypes.NewCommissionWithTime( math.LegacyNewDecWithPrec(1, 1), math.LegacyNewDecWithPrec(3, 1), @@ -288,8 +300,8 @@ func (s *KeeperTestSuite) TestUpdateValidatorCommission() { val1, _ = val1.SetInitialCommission(commission1) val2, _ = val2.SetInitialCommission(commission2) - keeper.SetValidator(ctx, val1) - keeper.SetValidator(ctx, val2) + require.NoError(keeper.SetValidator(ctx, val1)) + require.NoError(keeper.SetValidator(ctx, val2)) testCases := []struct { validator stakingtypes.Validator @@ -310,16 +322,22 @@ func (s *KeeperTestSuite) TestUpdateValidatorCommission() { if tc.expectedErr { require.Error(err, "expected error for test case #%d with rate: %s", i, tc.newRate) } else { + require.NoError(err, + "unexpected error for test case #%d with rate: %s", i, tc.newRate, + ) + tc.validator.Commission = commission - keeper.SetValidator(ctx, tc.validator) - val, found := keeper.GetValidator(ctx, tc.validator.GetOperator()) + err = keeper.SetValidator(ctx, tc.validator) + require.NoError(err) - require.True(found, - "expected to find validator for test case #%d with rate: %s", i, tc.newRate, - ) + bz, err := keeper.ValidatorAddressCodec().StringToBytes(tc.validator.GetOperator()) + require.NoError(err) + + val, err := keeper.GetValidator(ctx, bz) require.NoError(err, - "unexpected error for test case #%d with rate: %s", i, tc.newRate, + "expected to find validator for test case #%d with rate: %s", i, tc.newRate, ) + require.Equal(tc.newRate, val.Commission.Rate, "expected new validator commission rate for test case #%d with rate: %s", i, tc.newRate, ) @@ -340,17 +358,20 @@ func (s *KeeperTestSuite) TestValidatorToken() { delTokens := keeper.TokensFromConsensusPower(ctx, 5) validator := testutil.NewValidator(s.T(), valAddr, valPubKey) - validator, _ = keeper.AddValidatorTokensAndShares(ctx, validator, addTokens) + validator, _, err := keeper.AddValidatorTokensAndShares(ctx, validator, addTokens) + require.NoError(err) require.Equal(addTokens, validator.Tokens) validator, _ = keeper.GetValidator(ctx, valAddr) require.Equal(math.LegacyNewDecFromInt(addTokens), validator.DelegatorShares) - keeper.RemoveValidatorTokensAndShares(ctx, validator, math.LegacyNewDecFromInt(delTokens)) + _, _, err = keeper.RemoveValidatorTokensAndShares(ctx, validator, math.LegacyNewDecFromInt(delTokens)) + require.NoError(err) validator, _ = keeper.GetValidator(ctx, valAddr) require.Equal(delTokens, validator.Tokens) require.True(validator.DelegatorShares.Equal(math.LegacyNewDecFromInt(delTokens))) - keeper.RemoveValidatorTokens(ctx, validator, delTokens) + _, err = keeper.RemoveValidatorTokens(ctx, validator, delTokens) + require.NoError(err) validator, _ = keeper.GetValidator(ctx, valAddr) require.True(validator.Tokens.IsZero()) } @@ -367,9 +388,10 @@ func (s *KeeperTestSuite) TestUnbondingValidator() { // set unbonding validator endTime := time.Now() endHeight := ctx.BlockHeight() + 10 - keeper.SetUnbondingValidatorsQueue(ctx, endTime, endHeight, []string{valAddr.String()}) + require.NoError(keeper.SetUnbondingValidatorsQueue(ctx, endTime, endHeight, []string{valAddr.String()})) - resVals := keeper.GetUnbondingValidators(ctx, endTime, endHeight) + resVals, err := keeper.GetUnbondingValidators(ctx, endTime, endHeight) + require.NoError(err) require.Equal(1, len(resVals)) require.Equal(valAddr.String(), resVals[0]) @@ -378,42 +400,43 @@ func (s *KeeperTestSuite) TestUnbondingValidator() { validator1 := testutil.NewValidator(s.T(), valAddr1, PKs[1]) validator1.UnbondingHeight = endHeight validator1.UnbondingTime = endTime - keeper.InsertUnbondingValidatorQueue(ctx, validator1) + require.NoError(keeper.InsertUnbondingValidatorQueue(ctx, validator1)) - resVals = keeper.GetUnbondingValidators(ctx, endTime, endHeight) + resVals, err = keeper.GetUnbondingValidators(ctx, endTime, endHeight) + require.NoError(err) require.Equal(2, len(resVals)) // delete unbonding validator from the queue - keeper.DeleteValidatorQueue(ctx, validator1) - resVals = keeper.GetUnbondingValidators(ctx, endTime, endHeight) + require.NoError(keeper.DeleteValidatorQueue(ctx, validator1)) + resVals, err = keeper.GetUnbondingValidators(ctx, endTime, endHeight) + require.NoError(err) require.Equal(1, len(resVals)) require.Equal(valAddr.String(), resVals[0]) // check unbonding mature validators ctx = ctx.WithBlockHeight(endHeight).WithBlockTime(endTime) - require.PanicsWithValue("validator in the unbonding queue was not found", func() { - keeper.UnbondAllMatureValidators(ctx) - }) + err = keeper.UnbondAllMatureValidators(ctx) + require.EqualError(err, "validator in the unbonding queue was not found: validator does not exist") - keeper.SetValidator(ctx, validator) + require.NoError(keeper.SetValidator(ctx, validator)) ctx = ctx.WithBlockHeight(endHeight).WithBlockTime(endTime) - require.PanicsWithValue("unexpected validator in unbonding queue; status was not unbonding", func() { - keeper.UnbondAllMatureValidators(ctx) - }) + + err = keeper.UnbondAllMatureValidators(ctx) + require.EqualError(err, "unexpected validator in unbonding queue; status was not unbonding") validator.Status = stakingtypes.Unbonding - keeper.SetValidator(ctx, validator) - keeper.UnbondAllMatureValidators(ctx) - validator, found := keeper.GetValidator(ctx, valAddr) - require.False(found) + require.NoError(keeper.SetValidator(ctx, validator)) + require.NoError(keeper.UnbondAllMatureValidators(ctx)) + validator, err = keeper.GetValidator(ctx, valAddr) + require.ErrorIs(err, stakingtypes.ErrNoValidatorFound) - keeper.SetUnbondingValidatorsQueue(ctx, endTime, endHeight, []string{valAddr.String()}) + require.NoError(keeper.SetUnbondingValidatorsQueue(ctx, endTime, endHeight, []string{valAddr.String()})) validator = testutil.NewValidator(s.T(), valAddr, valPubKey) validator, _ = validator.AddTokensFromDel(addTokens) validator.Status = stakingtypes.Unbonding - keeper.SetValidator(ctx, validator) - keeper.UnbondAllMatureValidators(ctx) - validator, found = keeper.GetValidator(ctx, valAddr) - require.True(found) + require.NoError(keeper.SetValidator(ctx, validator)) + require.NoError(keeper.UnbondAllMatureValidators(ctx)) + validator, err = keeper.GetValidator(ctx, valAddr) + require.NoError(err) require.Equal(stakingtypes.Unbonded, validator.Status) } diff --git a/x/staking/migrations/v2/store.go b/x/staking/migrations/v2/store.go index 5bfde36c67ff..7b20394eac8a 100644 --- a/x/staking/migrations/v2/store.go +++ b/x/staking/migrations/v2/store.go @@ -60,11 +60,8 @@ func migrateValidatorsByPowerIndexKey(store storetypes.KVStore) { // migration includes: // // - Setting the Power Reduction param in the paramstore -func MigrateStore(ctx sdk.Context, storeKey storetypes.StoreKey) error { - store := ctx.KVStore(storeKey) - +func MigrateStore(ctx sdk.Context, store storetypes.KVStore) error { v2distribution.MigratePrefixAddress(store, v1.LastValidatorPowerKey) - v2distribution.MigratePrefixAddress(store, v1.ValidatorsKey) v2distribution.MigratePrefixAddress(store, v1.ValidatorsByConsAddrKey) migrateValidatorsByPowerIndexKey(store) diff --git a/x/staking/migrations/v2/store_test.go b/x/staking/migrations/v2/store_test.go index b9416ad4f80e..6bd1955159a0 100644 --- a/x/staking/migrations/v2/store_test.go +++ b/x/staking/migrations/v2/store_test.go @@ -9,6 +9,7 @@ import ( storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/codec/address" sdktestuil "github.com/cosmos/cosmos-sdk/testutil" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" @@ -64,7 +65,7 @@ func TestStoreMigration(t *testing.T) { { "ValidatorsByPowerIndexKey", v1.GetValidatorsByPowerIndexKey(val), - types.GetValidatorsByPowerIndexKey(val, sdk.DefaultPowerReduction), + types.GetValidatorsByPowerIndexKey(val, sdk.DefaultPowerReduction, address.NewBech32Codec("cosmosvaloper")), }, { "DelegationKey", @@ -124,7 +125,7 @@ func TestStoreMigration(t *testing.T) { } // Run migrations. - err := v2.MigrateStore(ctx, stakingKey) + err := v2.MigrateStore(ctx, store) require.NoError(t, err) // Make sure the new keys are set and old keys are deleted. diff --git a/x/staking/migrations/v3/store.go b/x/staking/migrations/v3/store.go index e558a11754d5..6cb6c6263113 100644 --- a/x/staking/migrations/v3/store.go +++ b/x/staking/migrations/v3/store.go @@ -23,7 +23,7 @@ type subspace interface { // The migration includes: // // - Setting the MinCommissionRate param in the paramstore -func MigrateStore(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.BinaryCodec, paramstore exported.Subspace) error { +func MigrateStore(ctx sdk.Context, store storetypes.KVStore, cdc codec.BinaryCodec, paramstore exported.Subspace) error { migrateParamsStore(ctx, paramstore.(subspace)) return nil diff --git a/x/staking/migrations/v3/store_test.go b/x/staking/migrations/v3/store_test.go index 3bca5ba7d6b1..96d9af167638 100644 --- a/x/staking/migrations/v3/store_test.go +++ b/x/staking/migrations/v3/store_test.go @@ -20,12 +20,13 @@ func TestStoreMigration(t *testing.T) { tStakingKey := storetypes.NewTransientStoreKey("transient_test") ctx := testutil.DefaultContext(stakingKey, tStakingKey) paramstore := paramtypes.NewSubspace(encCfg.Codec, encCfg.Amino, stakingKey, tStakingKey, "staking") + store := ctx.KVStore(stakingKey) // Check no params require.False(t, paramstore.Has(ctx, types.KeyMinCommissionRate)) // Run migrations. - err := v3.MigrateStore(ctx, stakingKey, encCfg.Codec, paramstore) + err := v3.MigrateStore(ctx, store, encCfg.Codec, paramstore) require.NoError(t, err) // Make sure the new params are set. diff --git a/x/staking/migrations/v4/migrations_test.go b/x/staking/migrations/v4/migrations_test.go index 420a24ebc304..90fa7f1ec9cf 100644 --- a/x/staking/migrations/v4/migrations_test.go +++ b/x/staking/migrations/v4/migrations_test.go @@ -6,6 +6,7 @@ import ( "github.com/stretchr/testify/require" + "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" @@ -69,7 +70,7 @@ func TestMigrate(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { if tc.doMigration { - require.NoError(t, v4.MigrateStore(ctx, storeKey, cdc, legacySubspace)) + require.NoError(t, v4.MigrateStore(ctx, store, cdc, legacySubspace)) } ubd := getUBD(t, accAddr, valAddr, store, cdc) @@ -82,7 +83,7 @@ func TestMigrate(t *testing.T) { // checking the updated balance for duplicateCreationHeight for _, ubdEntry := range ubd.Entries { if ubdEntry.CreationHeight == duplicateCreationHeight { - require.Equal(t, sdk.NewInt(100*10), ubdEntry.Balance) + require.Equal(t, math.NewInt(100*10), ubdEntry.Balance) break } } @@ -98,7 +99,7 @@ func TestMigrate(t *testing.T) { // createOldStateUnbonding will create the ubd entries with duplicate heights // 10 duplicate heights and 10 unique ubd with creation height func createOldStateUnbonding(t *testing.T, creationHeight int64, valAddr sdk.ValAddress, accAddr sdk.AccAddress, cdc codec.BinaryCodec, store storetypes.KVStore) error { - unbondBalance := sdk.NewInt(100) + unbondBalance := math.NewInt(100) completionTime := time.Now() ubdEntries := make([]types.UnbondingDelegationEntry, 0, 10) diff --git a/x/staking/migrations/v4/store.go b/x/staking/migrations/v4/store.go index d9dc44f1a66c..a41069a09efa 100644 --- a/x/staking/migrations/v4/store.go +++ b/x/staking/migrations/v4/store.go @@ -3,6 +3,7 @@ package v4 import ( "sort" + sdkmath "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" @@ -12,9 +13,7 @@ import ( ) // MigrateStore performs in-place store migrations from v3 to v4. -func MigrateStore(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.BinaryCodec, legacySubspace exported.Subspace) error { - store := ctx.KVStore(storeKey) - +func MigrateStore(ctx sdk.Context, store storetypes.KVStore, cdc codec.BinaryCodec, legacySubspace exported.Subspace) error { // migrate params if err := migrateParams(ctx, store, cdc, legacySubspace); err != nil { return err @@ -67,8 +66,8 @@ func migrateUBDEntries(ctx sdk.Context, store storetypes.KVStore, cdc codec.Bina for _, h := range creationHeights { ubdEntry := types.UnbondingDelegationEntry{ - Balance: sdk.ZeroInt(), - InitialBalance: sdk.ZeroInt(), + Balance: sdkmath.ZeroInt(), + InitialBalance: sdkmath.ZeroInt(), } for _, entry := range entriesAtSameCreationHeight[h] { ubdEntry.Balance = ubdEntry.Balance.Add(entry.Balance) diff --git a/x/staking/migrations/v5/keys.go b/x/staking/migrations/v5/keys.go index d62b0a2dc027..5c11c8735c3d 100644 --- a/x/staking/migrations/v5/keys.go +++ b/x/staking/migrations/v5/keys.go @@ -6,6 +6,7 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/address" ) const ( @@ -15,8 +16,8 @@ const ( var ( DelegationKey = []byte{0x31} // key for a delegation - DelegationByValIndexKey = []byte{0x37} // key for delegations by a validator HistoricalInfoKey = []byte{0x50} // prefix for the historical info + DelegationByValIndexKey = []byte{0x71} // key for delegations by a validator ) // ParseDelegationKey parses given key and returns delagator, validator address bytes @@ -59,3 +60,14 @@ func GetHistoricalInfoKey(height int64) []byte { binary.BigEndian.PutUint64(heightBytes, uint64(height)) return append(HistoricalInfoKey, heightBytes...) } + +// GetDelegationsByValPrefixKey builds a prefix key bytes with the given validator address bytes. +func GetDelegationsByValPrefixKey(valAddr sdk.ValAddress) []byte { + return append(DelegationByValIndexKey, address.MustLengthPrefix(valAddr)...) +} + +// GetDelegationsByValKey creates the key for delegations by validator address +// VALUE: staking/Delegation +func GetDelegationsByValKey(valAddr sdk.ValAddress, delAddr sdk.AccAddress) []byte { + return append(GetDelegationsByValPrefixKey(valAddr), delAddr...) +} diff --git a/x/staking/migrations/v5/migrations_test.go b/x/staking/migrations/v5/migrations_test.go index 8f477cde6158..ef9ca6e8d726 100644 --- a/x/staking/migrations/v5/migrations_test.go +++ b/x/staking/migrations/v5/migrations_test.go @@ -6,9 +6,13 @@ import ( "testing" "time" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + sdkmath "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" - cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/testutil" "github.com/cosmos/cosmos-sdk/testutil/sims" @@ -18,8 +22,6 @@ import ( v2 "github.com/cosmos/cosmos-sdk/x/staking/migrations/v2" v5 "github.com/cosmos/cosmos-sdk/x/staking/migrations/v5" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) func TestHistoricalKeysMigration(t *testing.T) { @@ -62,7 +64,7 @@ func TestHistoricalKeysMigration(t *testing.T) { } // migrate store to new key format - require.NoErrorf(t, v5.MigrateStore(ctx, storeKey, cdc), "v5.MigrateStore failed, seed: %d", seed) + require.NoErrorf(t, v5.MigrateStore(ctx, store, cdc), "v5.MigrateStore failed, seed: %d", seed) // check results for _, tc := range testCases { @@ -88,7 +90,7 @@ func TestDelegationsByValidatorMigrations(t *testing.T) { var addedDels []stakingtypes.Delegation for i := 1; i < 11; i++ { - del1 := stakingtypes.NewDelegation(accAddrs[i], valAddrs[0], sdkmath.LegacyNewDec(100)) + del1 := stakingtypes.NewDelegation(accAddrs[i].String(), valAddrs[0].String(), sdkmath.LegacyNewDec(100)) store.Set(stakingtypes.GetDelegationKey(accAddrs[i], valAddrs[0]), stakingtypes.MustMarshalDelegation(cdc, del1)) addedDels = append(addedDels, del1) } @@ -97,7 +99,7 @@ func TestDelegationsByValidatorMigrations(t *testing.T) { dels := getValDelegations(ctx, cdc, storeKey, valAddrs[0]) assert.Len(t, dels, 0) - err := v5.MigrateStore(ctx, storeKey, cdc) + err := v5.MigrateStore(ctx, store, cdc) assert.NoError(t, err) // after migration the state of delegations by val index should not be empty @@ -110,7 +112,7 @@ func getValDelegations(ctx sdk.Context, cdc codec.Codec, storeKey storetypes.Sto var delegations []stakingtypes.Delegation store := ctx.KVStore(storeKey) - iterator := storetypes.KVStorePrefixIterator(store, stakingtypes.GetDelegationsByValPrefixKey(valAddr)) + iterator := storetypes.KVStorePrefixIterator(store, v5.GetDelegationsByValPrefixKey(valAddr)) for ; iterator.Valid(); iterator.Next() { var delegation stakingtypes.Delegation valAddr, delAddr, err := stakingtypes.ParseDelegationsByValKey(iterator.Key()) diff --git a/x/staking/migrations/v5/store.go b/x/staking/migrations/v5/store.go index f87252da1a7e..569cc80c648f 100644 --- a/x/staking/migrations/v5/store.go +++ b/x/staking/migrations/v5/store.go @@ -6,16 +6,13 @@ import ( "cosmossdk.io/log" "cosmossdk.io/store/prefix" - storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/staking/types" ) -func migrateDelegationsByValidatorIndex(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.BinaryCodec) error { - store := ctx.KVStore(storeKey) - +func migrateDelegationsByValidatorIndex(ctx sdk.Context, store storetypes.KVStore, cdc codec.BinaryCodec) error { iterator := storetypes.KVStorePrefixIterator(store, DelegationKey) for ; iterator.Valid(); iterator.Next() { @@ -25,16 +22,15 @@ func migrateDelegationsByValidatorIndex(ctx sdk.Context, storeKey storetypes.Sto return err } - store.Set(types.GetDelegationsByValKey(val, del), []byte{}) + store.Set(GetDelegationsByValKey(val, del), []byte{}) } return nil } // MigrateStore performs in-place store migrations from v4 to v5. -func MigrateStore(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.BinaryCodec) error { - store := ctx.KVStore(storeKey) - if err := migrateDelegationsByValidatorIndex(ctx, storeKey, cdc); err != nil { +func MigrateStore(ctx sdk.Context, store storetypes.KVStore, cdc codec.BinaryCodec) error { + if err := migrateDelegationsByValidatorIndex(ctx, store, cdc); err != nil { return err } return migrateHistoricalInfoKeys(store, ctx.Logger()) diff --git a/x/staking/module.go b/x/staking/module.go index 4588cfa7cda5..5bbbc5b851a8 100644 --- a/x/staking/module.go +++ b/x/staking/module.go @@ -4,20 +4,23 @@ import ( "context" "encoding/json" "fmt" + "maps" + "slices" "sort" - modulev1 "cosmossdk.io/api/cosmos/staking/module/v1" - "cosmossdk.io/core/appmodule" - "cosmossdk.io/depinject" - store "cosmossdk.io/store/types" abci "github.com/cometbft/cometbft/abci/types" gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" - "golang.org/x/exp/maps" + + modulev1 "cosmossdk.io/api/cosmos/staking/module/v1" + "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/store" + "cosmossdk.io/depinject" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/runtime" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" @@ -35,11 +38,15 @@ const ( ) var ( - _ appmodule.AppModule = AppModule{} - _ appmodule.HasBeginBlocker = AppModule{} - _ module.HasABCIEndblock = AppModule{} _ module.AppModuleBasic = AppModuleBasic{} _ module.AppModuleSimulation = AppModule{} + _ module.HasServices = AppModule{} + _ module.HasInvariants = AppModule{} + _ module.HasABCIGenesis = AppModule{} + _ module.HasABCIEndBlock = AppModule{} + + _ appmodule.AppModule = AppModule{} + _ appmodule.HasBeginBlocker = AppModule{} ) // AppModuleBasic defines the basic application module used by the staking module. @@ -48,8 +55,6 @@ type AppModuleBasic struct { ak types.AccountKeeper } -var _ module.AppModuleBasic = AppModuleBasic{} - // Name returns the staking module's name. func (AppModuleBasic) Name() string { return types.ModuleName @@ -89,13 +94,8 @@ func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *g } // GetTxCmd returns the root tx command for the staking module. -func (AppModuleBasic) GetTxCmd() *cobra.Command { - return cli.NewTxCmd() -} - -// GetQueryCmd returns no root query command for the staking module. -func (ab AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd(ab.ak.AddressCodec()) +func (amb AppModuleBasic) GetTxCmd() *cobra.Command { + return cli.NewTxCmd(amb.cdc.InterfaceRegistry().SigningContext().ValidatorAddressCodec(), amb.cdc.InterfaceRegistry().SigningContext().AddressCodec()) } // AppModule implements an application module for the staking module. @@ -127,26 +127,14 @@ func NewAppModule( } } -var ( - _ appmodule.AppModule = AppModule{} - _ appmodule.HasBeginBlocker = AppModule{} -) - // IsOnePerModuleType implements the depinject.OnePerModuleType interface. func (am AppModule) IsOnePerModuleType() {} // IsAppModule implements the appmodule.AppModule interface. func (am AppModule) IsAppModule() {} -// Name returns the staking module's name. -func (AppModule) Name() string { - return types.ModuleName -} - -// RegisterInvariants registers the staking module invariants. -func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) { - keeper.RegisterInvariants(ir, am.keeper) -} +// RegisterInvariants is deprecated and will be removed in the next version of the Cosmos SDK. +func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} // RegisterServices registers module services. func (am AppModule) RegisterServices(cfg module.Configurator) { @@ -189,10 +177,7 @@ func (AppModule) ConsensusVersion() uint64 { return consensusVersion } // BeginBlock returns the begin blocker for the staking module. func (am AppModule) BeginBlock(ctx context.Context) error { - c := sdk.UnwrapSDKContext(ctx) - - am.keeper.BeginBlocker(c) - return nil + return am.keeper.BeginBlocker(ctx) } // EndBlock returns the end blocker for the staking module. It returns no validator @@ -212,11 +197,13 @@ func init() { type ModuleInputs struct { depinject.In - Config *modulev1.Module - AccountKeeper types.AccountKeeper - BankKeeper types.BankKeeper - Cdc codec.Codec - Key *store.KVStoreKey + Config *modulev1.Module + ValidatorAddressCodec runtime.ValidatorAddressCodec + ConsensusAddressCodec runtime.ConsensusAddressCodec + AccountKeeper types.AccountKeeper + BankKeeper types.BankKeeper + Cdc codec.Codec + StoreService store.KVStoreService // LegacySubspace is used solely for migration of x/params managed parameters LegacySubspace exported.Subspace `optional:"true"` @@ -239,10 +226,12 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { k := keeper.NewKeeper( in.Cdc, - in.Key, + in.StoreService, in.AccountKeeper, in.BankKeeper, authority.String(), + in.ValidatorAddressCodec, + in.ConsensusAddressCodec, ) m := NewAppModule(in.Cdc, k, in.AccountKeeper, in.BankKeeper, in.LegacySubspace) return ModuleOutputs{StakingKeeper: k, Module: m} @@ -258,7 +247,7 @@ func InvokeSetStakingHooks( return nil } - modNames := maps.Keys(stakingHooks) + modNames := slices.Collect(maps.Keys(stakingHooks)) order := config.HooksOrder if len(order) == 0 { order = modNames diff --git a/x/staking/module_test.go b/x/staking/module_test.go index f84741c6d9f4..37c4063fa27b 100644 --- a/x/staking/module_test.go +++ b/x/staking/module_test.go @@ -3,9 +3,10 @@ package staking_test import ( "testing" + "github.com/stretchr/testify/require" + "cosmossdk.io/depinject" "cosmossdk.io/log" - "github.com/stretchr/testify/require" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" authKeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" diff --git a/x/staking/simulation/decoder_test.go b/x/staking/simulation/decoder_test.go index a38663f228ef..589d396e682f 100644 --- a/x/staking/simulation/decoder_test.go +++ b/x/staking/simulation/decoder_test.go @@ -5,9 +5,11 @@ import ( "testing" "time" - "cosmossdk.io/math" "github.com/stretchr/testify/require" + "cosmossdk.io/math" + + "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/kv" @@ -27,11 +29,11 @@ func TestDecodeStore(t *testing.T) { dec := simulation.NewDecodeStore(cdc) bondTime := time.Now().UTC() - val, err := types.NewValidator(valAddr1, delPk1, types.NewDescription("test", "test", "test", "test", "test")) + val, err := types.NewValidator(valAddr1.String(), delPk1, types.NewDescription("test", "test", "test", "test", "test")) require.NoError(t, err) - del := types.NewDelegation(delAddr1, valAddr1, math.LegacyOneDec()) - ubd := types.NewUnbondingDelegation(delAddr1, valAddr1, 15, bondTime, math.OneInt(), 1) - red := types.NewRedelegation(delAddr1, valAddr1, valAddr1, 12, bondTime, math.OneInt(), math.LegacyOneDec(), 0) + del := types.NewDelegation(delAddr1.String(), valAddr1.String(), math.LegacyOneDec()) + ubd := types.NewUnbondingDelegation(delAddr1, valAddr1, 15, bondTime, math.OneInt(), 1, address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmos")) + red := types.NewRedelegation(delAddr1, valAddr1, valAddr1, 12, bondTime, math.OneInt(), math.LegacyOneDec(), 0, address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmos")) kvPairs := kv.Pairs{ Pairs: []kv.Pair{ diff --git a/x/staking/simulation/genesis.go b/x/staking/simulation/genesis.go index 1716fff3da8c..08cc7dd05c20 100644 --- a/x/staking/simulation/genesis.go +++ b/x/staking/simulation/genesis.go @@ -76,7 +76,7 @@ func RandomizedGenState(simState *module.SimulationState) { simulation.RandomDecAmount(simState.Rand, maxCommission), ) - validator, err := types.NewValidator(valAddr, simState.Accounts[i].ConsKey.PubKey(), types.Description{}) + validator, err := types.NewValidator(valAddr.String(), simState.Accounts[i].ConsKey.PubKey(), types.Description{}) if err != nil { panic(err) } @@ -84,7 +84,7 @@ func RandomizedGenState(simState *module.SimulationState) { validator.DelegatorShares = sdkmath.LegacyNewDecFromInt(simState.InitialStake) validator.Commission = commission - delegation := types.NewDelegation(simState.Accounts[i].Address, valAddr, sdkmath.LegacyNewDecFromInt(simState.InitialStake)) + delegation := types.NewDelegation(simState.Accounts[i].Address.String(), valAddr.String(), sdkmath.LegacyNewDecFromInt(simState.InitialStake)) validators = append(validators, validator) delegations = append(delegations, delegation) diff --git a/x/staking/simulation/genesis_test.go b/x/staking/simulation/genesis_test.go index c0c8835a78e0..d3b74e5758fe 100644 --- a/x/staking/simulation/genesis_test.go +++ b/x/staking/simulation/genesis_test.go @@ -8,6 +8,7 @@ import ( "github.com/stretchr/testify/require" sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" @@ -57,7 +58,7 @@ func TestRandomizedGenState(t *testing.T) { require.Equal(t, "cosmosvaloper1tnh2q55v8wyygtt9srz5safamzdengsn9dsd7z", stakingGenesis.Delegations[0].ValidatorAddress) require.Equal(t, "1000.000000000000000000", stakingGenesis.Delegations[0].Shares.String()) // check validators - require.Equal(t, "cosmosvaloper1ghekyjucln7y67ntx7cf27m9dpuxxemnsvnaes", stakingGenesis.Validators[2].GetOperator().String()) + require.Equal(t, "cosmosvaloper1ghekyjucln7y67ntx7cf27m9dpuxxemnsvnaes", stakingGenesis.Validators[2].GetOperator()) require.Equal(t, []byte{0xa, 0x20, 0x51, 0xde, 0xbd, 0xe8, 0xfa, 0xdf, 0x4e, 0xfc, 0x33, 0xa5, 0x16, 0x94, 0xf6, 0xee, 0xd3, 0x69, 0x7a, 0x7a, 0x1c, 0x2d, 0x50, 0xb6, 0x2, 0xf7, 0x16, 0x4e, 0x66, 0x9f, 0xff, 0x38, 0x91, 0x9b}, stakingGenesis.Validators[2].ConsensusPubkey.Value) require.Equal(t, false, stakingGenesis.Validators[2].Jailed) require.Equal(t, "BOND_STATUS_UNBONDED", stakingGenesis.Validators[2].Status.String()) diff --git a/x/staking/simulation/operations.go b/x/staking/simulation/operations.go index de8276d29129..0776de5dbc45 100644 --- a/x/staking/simulation/operations.go +++ b/x/staking/simulation/operations.go @@ -1,6 +1,7 @@ package simulation import ( + "bytes" "fmt" "math/rand" @@ -120,12 +121,15 @@ func SimulateMsgCreateValidator( address := sdk.ValAddress(simAccount.Address) // ensure the validator doesn't exist already - _, found := k.GetValidator(ctx, address) - if found { + _, err := k.GetValidator(ctx, address) + if err == nil { return simtypes.NoOpMsg(types.ModuleName, msgType, "validator already exists"), nil, nil } - denom := k.GetParams(ctx).BondDenom + denom, err := k.BondDenom(ctx) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msgType, "bond denom not found"), nil, err + } balance := bk.GetBalance(ctx, simAccount.Address, denom).Amount if !balance.IsPositive() { @@ -160,14 +164,14 @@ func SimulateMsgCreateValidator( simtypes.RandStringOfLength(r, 10), ) - maxCommission := sdk.NewDecWithPrec(int64(simtypes.RandIntBetween(r, 0, 100)), 2) + maxCommission := math.LegacyNewDecWithPrec(int64(simtypes.RandIntBetween(r, 0, 100)), 2) commission := types.NewCommissionRates( simtypes.RandomDecAmount(r, maxCommission), maxCommission, simtypes.RandomDecAmount(r, maxCommission), ) - msg, err := types.NewMsgCreateValidator(address, simAccount.ConsKey.PubKey(), selfDelegation, description, commission, math.OneInt()) + msg, err := types.NewMsgCreateValidator(address.String(), simAccount.ConsKey.PubKey(), selfDelegation, description, commission, math.OneInt()) if err != nil { return simtypes.NoOpMsg(types.ModuleName, sdk.MsgTypeURL(msg), "unable to create CreateValidator message"), nil, err } @@ -200,11 +204,16 @@ func SimulateMsgEditValidator( ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { msgType := sdk.MsgTypeURL(&types.MsgEditValidator{}) - if len(k.GetAllValidators(ctx)) == 0 { + vals, err := k.GetAllValidators(ctx) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msgType, "unable to get validators"), nil, err + } + + if len(vals) == 0 { return simtypes.NoOpMsg(types.ModuleName, msgType, "number of validators equal zero"), nil, nil } - val, ok := testutil.RandSliceElem(r, k.GetAllValidators(ctx)) + val, ok := testutil.RandSliceElem(r, vals) if !ok { return simtypes.NoOpMsg(types.ModuleName, msgType, "unable to pick a validator"), nil, nil } @@ -217,7 +226,12 @@ func SimulateMsgEditValidator( return simtypes.NoOpMsg(types.ModuleName, msgType, "invalid commission rate"), nil, nil } - simAccount, found := simtypes.FindAccount(accs, sdk.AccAddress(val.GetOperator())) + bz, err := k.ValidatorAddressCodec().StringToBytes(val.GetOperator()) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msgType, "error getting validator address bytes"), nil, err + } + + simAccount, found := simtypes.FindAccount(accs, sdk.AccAddress(bz)) if !found { return simtypes.NoOpMsg(types.ModuleName, msgType, "unable to find account"), nil, fmt.Errorf("validator %s not found", val.GetOperator()) } @@ -264,14 +278,22 @@ func SimulateMsgDelegate( r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { msgType := sdk.MsgTypeURL(&types.MsgDelegate{}) - denom := k.GetParams(ctx).BondDenom + denom, err := k.BondDenom(ctx) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msgType, "bond denom not found"), nil, err + } - if len(k.GetAllValidators(ctx)) == 0 { + vals, err := k.GetAllValidators(ctx) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msgType, "unable to get validators"), nil, err + } + + if len(vals) == 0 { return simtypes.NoOpMsg(types.ModuleName, msgType, "number of validators equal zero"), nil, nil } simAccount, _ := simtypes.RandomAcc(r, accs) - val, ok := testutil.RandSliceElem(r, k.GetAllValidators(ctx)) + val, ok := testutil.RandSliceElem(r, vals) if !ok { return simtypes.NoOpMsg(types.ModuleName, msgType, "unable to pick a validator"), nil, nil } @@ -285,7 +307,7 @@ func SimulateMsgDelegate( return simtypes.NoOpMsg(types.ModuleName, msgType, "balance is negative"), nil, nil } - amount, err := simtypes.RandPositiveInt(r, amount) + amount, err = simtypes.RandPositiveInt(r, amount) if err != nil { return simtypes.NoOpMsg(types.ModuleName, msgType, "unable to generate positive amount"), nil, err } @@ -305,7 +327,7 @@ func SimulateMsgDelegate( } } - msg := types.NewMsgDelegate(simAccount.Address, val.GetOperator(), bondAmt) + msg := types.NewMsgDelegate(simAccount.Address.String(), val.GetOperator(), bondAmt) txCtx := simulation.OperationInput{ R: r, @@ -335,13 +357,29 @@ func SimulateMsgUndelegate( ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { msgType := sdk.MsgTypeURL(&types.MsgUndelegate{}) - val, ok := testutil.RandSliceElem(r, k.GetAllValidators(ctx)) + vals, err := k.GetAllValidators(ctx) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msgType, "unable to get validators"), nil, err + } + + if len(vals) == 0 { + return simtypes.NoOpMsg(types.ModuleName, msgType, "number of validators equal zero"), nil, nil + } + + val, ok := testutil.RandSliceElem(r, vals) if !ok { return simtypes.NoOpMsg(types.ModuleName, msgType, "validator is not ok"), nil, nil } - valAddr := val.GetOperator() - delegations := k.GetValidatorDelegations(ctx, val.GetOperator()) + valAddr, err := k.ValidatorAddressCodec().StringToBytes(val.GetOperator()) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msgType, "error getting validator address bytes"), nil, err + } + delegations, err := k.GetValidatorDelegations(ctx, valAddr) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msgType, "error getting validator delegations"), nil, nil + } + if delegations == nil { return simtypes.NoOpMsg(types.ModuleName, msgType, "keeper does have any delegation entries"), nil, nil } @@ -350,7 +388,17 @@ func SimulateMsgUndelegate( delegation := delegations[r.Intn(len(delegations))] delAddr := delegation.GetDelegatorAddr() - if k.HasMaxUnbondingDelegationEntries(ctx, delAddr, valAddr) { + delAddrBz, err := ak.AddressCodec().StringToBytes(delAddr) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msgType, "error getting delegator address bytes"), nil, err + } + + hasMaxUD, err := k.HasMaxUnbondingDelegationEntries(ctx, delAddrBz, valAddr) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msgType, "error getting max unbonding delegation entries"), nil, err + } + + if hasMaxUD { return simtypes.NoOpMsg(types.ModuleName, msgType, "keeper does have a max unbonding delegation entries"), nil, nil } @@ -368,15 +416,20 @@ func SimulateMsgUndelegate( return simtypes.NoOpMsg(types.ModuleName, msgType, "unbond amount is zero"), nil, nil } + bondDenom, err := k.BondDenom(ctx) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msgType, "bond denom not found"), nil, err + } + msg := types.NewMsgUndelegate( - delAddr, valAddr, sdk.NewCoin(k.BondDenom(ctx), unbondAmt), + delAddr, val.GetOperator(), sdk.NewCoin(bondDenom, unbondAmt), ) // need to retrieve the simulation account associated with delegation to retrieve PrivKey var simAccount simtypes.Account for _, simAcc := range accs { - if simAcc.Address.Equals(delAddr) { + if simAcc.Address.Equals(sdk.AccAddress(delAddrBz)) { simAccount = simAcc break } @@ -386,7 +439,7 @@ func SimulateMsgUndelegate( return simtypes.NoOpMsg(types.ModuleName, sdk.MsgTypeURL(msg), "account private key is nil"), nil, nil } - account := ak.GetAccount(ctx, delAddr) + account := ak.GetAccount(ctx, delAddrBz) spendable := bk.SpendableCoins(ctx, account.GetAddress()) txCtx := simulation.OperationInput{ @@ -419,11 +472,17 @@ func SimulateMsgCancelUnbondingDelegate( ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { msgType := sdk.MsgTypeURL(&types.MsgCancelUnbondingDelegation{}) - if len(k.GetAllValidators(ctx)) == 0 { + vals, err := k.GetAllValidators(ctx) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msgType, "unable to get validators"), nil, err + } + + if len(vals) == 0 { return simtypes.NoOpMsg(types.ModuleName, msgType, "number of validators equal zero"), nil, nil } + simAccount, _ := simtypes.RandomAcc(r, accs) - val, ok := testutil.RandSliceElem(r, k.GetAllValidators(ctx)) + val, ok := testutil.RandSliceElem(r, vals) if !ok { return simtypes.NoOpMsg(types.ModuleName, msgType, "validator is not ok"), nil, nil } @@ -432,9 +491,12 @@ func SimulateMsgCancelUnbondingDelegate( return simtypes.NoOpMsg(types.ModuleName, msgType, "validator is jailed"), nil, nil } - valAddr := val.GetOperator() - unbondingDelegation, found := k.GetUnbondingDelegation(ctx, simAccount.Address, valAddr) - if !found { + valAddr, err := k.ValidatorAddressCodec().StringToBytes(val.GetOperator()) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msgType, "error getting validator address bytes"), nil, err + } + unbondingDelegation, err := k.GetUnbondingDelegation(ctx, simAccount.Address, valAddr) + if err != nil { return simtypes.NoOpMsg(types.ModuleName, msgType, "account does have any unbonding delegation"), nil, nil } @@ -469,8 +531,13 @@ func SimulateMsgCancelUnbondingDelegate( return simtypes.NoOpMsg(types.ModuleName, msgType, "cancelBondAmt amount is zero"), nil, nil } + bondDenom, err := k.BondDenom(ctx) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msgType, "bond denom not found"), nil, err + } + msg := types.NewMsgCancelUnbondingDelegation( - simAccount.Address, valAddr, unbondingDelegationEntry.CreationHeight, sdk.NewCoin(k.BondDenom(ctx), cancelBondAmt), + simAccount.Address.String(), val.GetOperator(), unbondingDelegationEntry.CreationHeight, sdk.NewCoin(bondDenom, cancelBondAmt), ) spendable := bk.SpendableCoins(ctx, simAccount.Address) @@ -505,14 +572,29 @@ func SimulateMsgBeginRedelegate( ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { msgType := sdk.MsgTypeURL(&types.MsgBeginRedelegate{}) - allVals := k.GetAllValidators(ctx) + allVals, err := k.GetAllValidators(ctx) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msgType, "unable to get validators"), nil, err + } + + if len(allVals) == 0 { + return simtypes.NoOpMsg(types.ModuleName, msgType, "number of validators equal zero"), nil, nil + } + srcVal, ok := testutil.RandSliceElem(r, allVals) if !ok { return simtypes.NoOpMsg(types.ModuleName, msgType, "unable to pick validator"), nil, nil } - srcAddr := srcVal.GetOperator() - delegations := k.GetValidatorDelegations(ctx, srcAddr) + srcAddr, err := k.ValidatorAddressCodec().StringToBytes(srcVal.GetOperator()) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msgType, "error getting validator address bytes"), nil, err + } + delegations, err := k.GetValidatorDelegations(ctx, srcAddr) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msgType, "error getting validator delegations"), nil, nil + } + if delegations == nil { return simtypes.NoOpMsg(types.ModuleName, msgType, "keeper does have any delegation entries"), nil, nil } @@ -521,7 +603,17 @@ func SimulateMsgBeginRedelegate( delegation := delegations[r.Intn(len(delegations))] delAddr := delegation.GetDelegatorAddr() - if k.HasReceivingRedelegation(ctx, delAddr, srcAddr) { + delAddrBz, err := ak.AddressCodec().StringToBytes(delAddr) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msgType, "error getting delegator address bytes"), nil, err + } + + hasRecRedel, err := k.HasReceivingRedelegation(ctx, delAddrBz, srcAddr) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msgType, "error getting receiving redelegation"), nil, err + } + + if hasRecRedel { return simtypes.NoOpMsg(types.ModuleName, msgType, "receveing redelegation is not allowed"), nil, nil // skip } @@ -531,8 +623,16 @@ func SimulateMsgBeginRedelegate( return simtypes.NoOpMsg(types.ModuleName, msgType, "unable to pick validator"), nil, nil } - destAddr := destVal.GetOperator() - if srcAddr.Equals(destAddr) || destVal.InvalidExRate() || k.HasMaxRedelegationEntries(ctx, delAddr, srcAddr, destAddr) { + destAddr, err := k.ValidatorAddressCodec().StringToBytes(destVal.GetOperator()) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msgType, "error getting validator address bytes"), nil, err + } + hasMaxRedel, err := k.HasMaxRedelegationEntries(ctx, delAddrBz, srcAddr, destAddr) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msgType, "error getting max redelegation entries"), nil, err + } + + if bytes.Equal(srcAddr, destAddr) || destVal.InvalidExRate() || hasMaxRedel { return simtypes.NoOpMsg(types.ModuleName, msgType, "checks failed"), nil, nil } @@ -564,7 +664,7 @@ func SimulateMsgBeginRedelegate( var simAccount simtypes.Account for _, simAcc := range accs { - if simAcc.Address.Equals(delAddr) { + if simAcc.Address.Equals(sdk.AccAddress(delAddrBz)) { simAccount = simAcc break } @@ -575,12 +675,17 @@ func SimulateMsgBeginRedelegate( return simtypes.NoOpMsg(types.ModuleName, msgType, "account private key is nil"), nil, nil } - account := ak.GetAccount(ctx, delAddr) + account := ak.GetAccount(ctx, delAddrBz) spendable := bk.SpendableCoins(ctx, account.GetAddress()) + bondDenom, err := k.BondDenom(ctx) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msgType, "bond denom not found"), nil, err + } + msg := types.NewMsgBeginRedelegate( - delAddr, srcAddr, destAddr, - sdk.NewCoin(k.BondDenom(ctx), redAmt), + delAddr, srcVal.GetOperator(), destVal.GetOperator(), + sdk.NewCoin(bondDenom, redAmt), ) txCtx := simulation.OperationInput{ diff --git a/x/staking/simulation/operations_test.go b/x/staking/simulation/operations_test.go index 453ac35a3ac5..f85060319792 100644 --- a/x/staking/simulation/operations_test.go +++ b/x/staking/simulation/operations_test.go @@ -6,40 +6,37 @@ import ( "testing" "time" - "cosmossdk.io/depinject" - sdklog "cosmossdk.io/log" - "cosmossdk.io/math" + abci "github.com/cometbft/cometbft/abci/types" + cmttypes "github.com/cometbft/cometbft/types" "github.com/cosmos/gogoproto/proto" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - abci "github.com/cometbft/cometbft/abci/types" - cmttypes "github.com/cometbft/cometbft/types" + "cosmossdk.io/depinject" + sdklog "cosmossdk.io/log" + "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec/address" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" "github.com/cosmos/cosmos-sdk/runtime" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/staking/simulation" - "github.com/cosmos/cosmos-sdk/x/staking/testutil" - simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" - banktestutil "github.com/cosmos/cosmos-sdk/x/bank/testutil" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - "github.com/cosmos/cosmos-sdk/x/staking/types" - authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + banktestutil "github.com/cosmos/cosmos-sdk/x/bank/testutil" distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" + distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" + "github.com/cosmos/cosmos-sdk/x/staking/simulation" + "github.com/cosmos/cosmos-sdk/x/staking/testutil" + "github.com/cosmos/cosmos-sdk/x/staking/types" ) type SimTestSuite struct { @@ -68,7 +65,7 @@ func (s *SimTestSuite) SetupTest() { senderPrivKey := secp256k1.GenPrivKey() acc := authtypes.NewBaseAccount(senderPrivKey.PubKey().Address().Bytes(), senderPrivKey.PubKey(), 0, 0) accs := []simtestutil.GenesisAccount{ - {GenesisAccount: acc, Coins: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100000000000000)))}, + {GenesisAccount: acc, Coins: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(100000000000000)))}, } // create validator set with single validator @@ -166,7 +163,8 @@ func (s *SimTestSuite) TestWeightedOperations() { // Abonormal scenarios, where the message are created by an errors are not tested here. func (s *SimTestSuite) TestSimulateMsgCreateValidator() { require := s.Require() - s.app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: s.app.LastBlockHeight() + 1, Hash: s.app.LastCommitID().Hash}) + _, err := s.app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: s.app.LastBlockHeight() + 1, Hash: s.app.LastCommitID().Hash}) + require.NoError(err) // execute operation op := simulation.SimulateMsgCreateValidator(s.txConfig, s.accountKeeper, s.bankKeeper, s.stakingKeeper) @@ -199,18 +197,21 @@ func (s *SimTestSuite) TestSimulateMsgCancelUnbondingDelegation() { delTokens := s.stakingKeeper.TokensFromConsensusPower(ctx, 2) validator0, issuedShares := validator0.AddTokensFromDel(delTokens) delegator := s.accounts[2] - delegation := types.NewDelegation(delegator.Address, validator0.GetOperator(), issuedShares) - s.stakingKeeper.SetDelegation(ctx, delegation) - s.distrKeeper.SetDelegatorStartingInfo(ctx, validator0.GetOperator(), delegator.Address, distrtypes.NewDelegatorStartingInfo(2, math.LegacyOneDec(), 200)) + delegation := types.NewDelegation(delegator.Address.String(), validator0.GetOperator(), issuedShares) + require.NoError(s.stakingKeeper.SetDelegation(ctx, delegation)) + val0bz, err := s.stakingKeeper.ValidatorAddressCodec().StringToBytes(validator0.GetOperator()) + s.Require().NoError(err) + require.NoError(s.distrKeeper.SetDelegatorStartingInfo(ctx, val0bz, delegator.Address, distrtypes.NewDelegatorStartingInfo(2, math.LegacyOneDec(), 200))) - s.setupValidatorRewards(ctx, validator0.GetOperator()) + s.setupValidatorRewards(ctx, val0bz) // unbonding delegation - udb := types.NewUnbondingDelegation(delegator.Address, validator0.GetOperator(), s.app.LastBlockHeight()+1, blockTime.Add(2*time.Minute), delTokens, 0) - s.stakingKeeper.SetUnbondingDelegation(ctx, udb) - s.setupValidatorRewards(ctx, validator0.GetOperator()) + udb := types.NewUnbondingDelegation(delegator.Address, val0bz, s.app.LastBlockHeight()+1, blockTime.Add(2*time.Minute), delTokens, 0, address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmos")) + require.NoError(s.stakingKeeper.SetUnbondingDelegation(ctx, udb)) + s.setupValidatorRewards(ctx, val0bz) - s.app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: s.app.LastBlockHeight() + 1, Hash: s.app.LastCommitID().Hash, Time: blockTime}) + _, err = s.app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: s.app.LastBlockHeight() + 1, Hash: s.app.LastCommitID().Hash, Time: blockTime}) + require.NoError(err) // execute operation op := simulation.SimulateMsgCancelUnbondingDelegate(s.txConfig, s.accountKeeper, s.bankKeeper, s.stakingKeeper) @@ -224,7 +225,7 @@ func (s *SimTestSuite) TestSimulateMsgCancelUnbondingDelegation() { require.True(operationMsg.OK) require.Equal(sdk.MsgTypeURL(&types.MsgCancelUnbondingDelegation{}), sdk.MsgTypeURL(&msg)) require.Equal(delegator.Address.String(), msg.DelegatorAddress) - require.Equal(validator0.GetOperator().String(), msg.ValidatorAddress) + require.Equal(validator0.GetOperator(), msg.ValidatorAddress) require.Len(futureOperations, 0) } @@ -238,7 +239,8 @@ func (s *SimTestSuite) TestSimulateMsgEditValidator() { // setup accounts[0] as validator _ = s.getTestingValidator0(ctx) - s.app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: s.app.LastBlockHeight() + 1, Hash: s.app.LastCommitID().Hash, Time: blockTime}) + _, err := s.app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: s.app.LastBlockHeight() + 1, Hash: s.app.LastCommitID().Hash, Time: blockTime}) + require.NoError(err) // execute operation op := simulation.SimulateMsgEditValidator(s.txConfig, s.accountKeeper, s.bankKeeper, s.stakingKeeper) @@ -291,13 +293,16 @@ func (s *SimTestSuite) TestSimulateMsgUndelegate() { delTokens := s.stakingKeeper.TokensFromConsensusPower(ctx, 2) validator0, issuedShares := validator0.AddTokensFromDel(delTokens) delegator := s.accounts[2] - delegation := types.NewDelegation(delegator.Address, validator0.GetOperator(), issuedShares) - s.stakingKeeper.SetDelegation(ctx, delegation) - s.distrKeeper.SetDelegatorStartingInfo(ctx, validator0.GetOperator(), delegator.Address, distrtypes.NewDelegatorStartingInfo(2, math.LegacyOneDec(), 200)) + delegation := types.NewDelegation(delegator.Address.String(), validator0.GetOperator(), issuedShares) + require.NoError(s.stakingKeeper.SetDelegation(ctx, delegation)) + val0bz, err := s.stakingKeeper.ValidatorAddressCodec().StringToBytes(validator0.GetOperator()) + s.Require().NoError(err) + require.NoError(s.distrKeeper.SetDelegatorStartingInfo(ctx, val0bz, delegator.Address, distrtypes.NewDelegatorStartingInfo(2, math.LegacyOneDec(), 200))) - s.setupValidatorRewards(ctx, validator0.GetOperator()) + s.setupValidatorRewards(ctx, val0bz) - s.app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: s.app.LastBlockHeight() + 1, Hash: s.app.LastCommitID().Hash, Time: blockTime}) + _, err = s.app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: s.app.LastBlockHeight() + 1, Hash: s.app.LastCommitID().Hash, Time: blockTime}) + require.NoError(err) // execute operation op := simulation.SimulateMsgUndelegate(s.txConfig, s.accountKeeper, s.bankKeeper, s.stakingKeeper) @@ -332,14 +337,19 @@ func (s *SimTestSuite) TestSimulateMsgBeginRedelegate() { // setup accounts[3] as delegator delegator := s.accounts[3] - delegation := types.NewDelegation(delegator.Address, validator0.GetOperator(), issuedShares) - s.stakingKeeper.SetDelegation(ctx, delegation) - s.distrKeeper.SetDelegatorStartingInfo(ctx, validator0.GetOperator(), delegator.Address, distrtypes.NewDelegatorStartingInfo(2, math.LegacyOneDec(), 200)) + delegation := types.NewDelegation(delegator.Address.String(), validator0.GetOperator(), issuedShares) + require.NoError(s.stakingKeeper.SetDelegation(ctx, delegation)) + val0bz, err := s.stakingKeeper.ValidatorAddressCodec().StringToBytes(validator0.GetOperator()) + s.Require().NoError(err) + val1bz, err := s.stakingKeeper.ValidatorAddressCodec().StringToBytes(validator1.GetOperator()) + s.Require().NoError(err) + require.NoError(s.distrKeeper.SetDelegatorStartingInfo(ctx, val0bz, delegator.Address, distrtypes.NewDelegatorStartingInfo(2, math.LegacyOneDec(), 200))) - s.setupValidatorRewards(ctx, validator0.GetOperator()) - s.setupValidatorRewards(ctx, validator1.GetOperator()) + s.setupValidatorRewards(ctx, val0bz) + s.setupValidatorRewards(ctx, val1bz) - s.app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: s.app.LastBlockHeight() + 1, Hash: s.app.LastCommitID().Hash, Time: blockTime}) + _, err = s.app.FinalizeBlock(&abci.RequestFinalizeBlock{Height: s.app.LastBlockHeight() + 1, Hash: s.app.LastCommitID().Hash, Time: blockTime}) + require.NoError(err) // execute operation op := simulation.SimulateMsgBeginRedelegate(s.txConfig, s.accountKeeper, s.bankKeeper, s.stakingKeeper) @@ -380,7 +390,7 @@ func (s *SimTestSuite) getTestingValidator(ctx sdk.Context, commission types.Com validator.DelegatorShares = math.LegacyNewDec(100) validator.Tokens = s.stakingKeeper.TokensFromConsensusPower(ctx, 100) - s.stakingKeeper.SetValidator(ctx, validator) + s.Require().NoError(s.stakingKeeper.SetValidator(ctx, validator)) return validator } diff --git a/x/staking/simulation/proposals_test.go b/x/staking/simulation/proposals_test.go index c12db5bbb3fe..040151747d46 100644 --- a/x/staking/simulation/proposals_test.go +++ b/x/staking/simulation/proposals_test.go @@ -5,10 +5,11 @@ import ( "testing" "time" - sdkmath "cosmossdk.io/math" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "gotest.tools/v3/assert" + sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/address" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" diff --git a/x/staking/testutil/app_config.go b/x/staking/testutil/app_config.go index d441f2b559bd..4f9118e395ce 100644 --- a/x/staking/testutil/app_config.go +++ b/x/staking/testutil/app_config.go @@ -2,7 +2,6 @@ package testutil import ( "github.com/cosmos/cosmos-sdk/testutil/configurator" - _ "github.com/cosmos/cosmos-sdk/x/auth" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/auth/tx/config" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/bank" // import as blank for app wiring diff --git a/x/staking/testutil/cmt.go b/x/staking/testutil/cmt.go index 682471309fa7..6c3ca753da41 100644 --- a/x/staking/testutil/cmt.go +++ b/x/staking/testutil/cmt.go @@ -1,10 +1,11 @@ package testutil import ( - "cosmossdk.io/math" cmtcrypto "github.com/cometbft/cometbft/crypto" cmttypes "github.com/cometbft/cometbft/types" + "cosmossdk.io/math" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -31,9 +32,9 @@ func ToCmtValidator(v types.Validator, r math.Int) (*cmttypes.Validator, error) // ToCmtValidators casts all validators to the corresponding CometBFT type. func ToCmtValidators(v types.Validators, r math.Int) ([]*cmttypes.Validator, error) { - validators := make([]*cmttypes.Validator, len(v)) + validators := make([]*cmttypes.Validator, len(v.Validators)) var err error - for i, val := range v { + for i, val := range v.Validators { validators[i], err = ToCmtValidator(val, r) if err != nil { return nil, err diff --git a/x/staking/testutil/expected_keepers_mocks.go b/x/staking/testutil/expected_keepers_mocks.go index 3123d781fbdc..ed96ef7ca8ab 100644 --- a/x/staking/testutil/expected_keepers_mocks.go +++ b/x/staking/testutil/expected_keepers_mocks.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: x/staking/types/expected_keepers.go +// +// Generated by this command: +// +// mockgen -source=x/staking/types/expected_keepers.go -package testutil -destination x/staking/testutil/expected_keepers_mocks.go +// // Package testutil is a generated GoMock package. package testutil @@ -10,66 +15,17 @@ import ( address "cosmossdk.io/core/address" math "cosmossdk.io/math" + crypto "github.com/cometbft/cometbft/proto/tendermint/crypto" types "github.com/cosmos/cosmos-sdk/types" types0 "github.com/cosmos/cosmos-sdk/x/staking/types" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) -// MockDistributionKeeper is a mock of DistributionKeeper interface. -type MockDistributionKeeper struct { - ctrl *gomock.Controller - recorder *MockDistributionKeeperMockRecorder -} - -// MockDistributionKeeperMockRecorder is the mock recorder for MockDistributionKeeper. -type MockDistributionKeeperMockRecorder struct { - mock *MockDistributionKeeper -} - -// NewMockDistributionKeeper creates a new mock instance. -func NewMockDistributionKeeper(ctrl *gomock.Controller) *MockDistributionKeeper { - mock := &MockDistributionKeeper{ctrl: ctrl} - mock.recorder = &MockDistributionKeeperMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockDistributionKeeper) EXPECT() *MockDistributionKeeperMockRecorder { - return m.recorder -} - -// GetFeePoolCommunityCoins mocks base method. -func (m *MockDistributionKeeper) GetFeePoolCommunityCoins(ctx context.Context) types.DecCoins { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetFeePoolCommunityCoins", ctx) - ret0, _ := ret[0].(types.DecCoins) - return ret0 -} - -// GetFeePoolCommunityCoins indicates an expected call of GetFeePoolCommunityCoins. -func (mr *MockDistributionKeeperMockRecorder) GetFeePoolCommunityCoins(ctx interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFeePoolCommunityCoins", reflect.TypeOf((*MockDistributionKeeper)(nil).GetFeePoolCommunityCoins), ctx) -} - -// GetValidatorOutstandingRewardsCoins mocks base method. -func (m *MockDistributionKeeper) GetValidatorOutstandingRewardsCoins(ctx context.Context, val types.ValAddress) types.DecCoins { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetValidatorOutstandingRewardsCoins", ctx, val) - ret0, _ := ret[0].(types.DecCoins) - return ret0 -} - -// GetValidatorOutstandingRewardsCoins indicates an expected call of GetValidatorOutstandingRewardsCoins. -func (mr *MockDistributionKeeperMockRecorder) GetValidatorOutstandingRewardsCoins(ctx, val interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorOutstandingRewardsCoins", reflect.TypeOf((*MockDistributionKeeper)(nil).GetValidatorOutstandingRewardsCoins), ctx, val) -} - // MockAccountKeeper is a mock of AccountKeeper interface. type MockAccountKeeper struct { ctrl *gomock.Controller recorder *MockAccountKeeperMockRecorder + isgomock struct{} } // MockAccountKeeperMockRecorder is the mock recorder for MockAccountKeeper. @@ -112,7 +68,7 @@ func (m *MockAccountKeeper) GetAccount(ctx context.Context, addr types.AccAddres } // GetAccount indicates an expected call of GetAccount. -func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetAccount), ctx, addr) } @@ -126,7 +82,7 @@ func (m *MockAccountKeeper) GetModuleAccount(ctx context.Context, moduleName str } // GetModuleAccount indicates an expected call of GetModuleAccount. -func (mr *MockAccountKeeperMockRecorder) GetModuleAccount(ctx, moduleName interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) GetModuleAccount(ctx, moduleName any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAccount), ctx, moduleName) } @@ -140,7 +96,7 @@ func (m *MockAccountKeeper) GetModuleAddress(name string) types.AccAddress { } // GetModuleAddress indicates an expected call of GetModuleAddress. -func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(name interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(name any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAddress", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAddress), name) } @@ -152,7 +108,7 @@ func (m *MockAccountKeeper) IterateAccounts(ctx context.Context, process func(ty } // IterateAccounts indicates an expected call of IterateAccounts. -func (mr *MockAccountKeeperMockRecorder) IterateAccounts(ctx, process interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) IterateAccounts(ctx, process any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateAccounts", reflect.TypeOf((*MockAccountKeeper)(nil).IterateAccounts), ctx, process) } @@ -164,7 +120,7 @@ func (m *MockAccountKeeper) SetModuleAccount(arg0 context.Context, arg1 types.Mo } // SetModuleAccount indicates an expected call of SetModuleAccount. -func (mr *MockAccountKeeperMockRecorder) SetModuleAccount(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockAccountKeeperMockRecorder) SetModuleAccount(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetModuleAccount", reflect.TypeOf((*MockAccountKeeper)(nil).SetModuleAccount), arg0, arg1) } @@ -173,6 +129,7 @@ func (mr *MockAccountKeeperMockRecorder) SetModuleAccount(arg0, arg1 interface{} type MockBankKeeper struct { ctrl *gomock.Controller recorder *MockBankKeeperMockRecorder + isgomock struct{} } // MockBankKeeperMockRecorder is the mock recorder for MockBankKeeper. @@ -201,7 +158,7 @@ func (m *MockBankKeeper) BurnCoins(ctx context.Context, name string, amt types.C } // BurnCoins indicates an expected call of BurnCoins. -func (mr *MockBankKeeperMockRecorder) BurnCoins(ctx, name, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) BurnCoins(ctx, name, amt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BurnCoins", reflect.TypeOf((*MockBankKeeper)(nil).BurnCoins), ctx, name, amt) } @@ -215,7 +172,7 @@ func (m *MockBankKeeper) DelegateCoinsFromAccountToModule(ctx context.Context, s } // DelegateCoinsFromAccountToModule indicates an expected call of DelegateCoinsFromAccountToModule. -func (mr *MockBankKeeperMockRecorder) DelegateCoinsFromAccountToModule(ctx, senderAddr, recipientModule, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) DelegateCoinsFromAccountToModule(ctx, senderAddr, recipientModule, amt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelegateCoinsFromAccountToModule", reflect.TypeOf((*MockBankKeeper)(nil).DelegateCoinsFromAccountToModule), ctx, senderAddr, recipientModule, amt) } @@ -229,7 +186,7 @@ func (m *MockBankKeeper) GetAllBalances(ctx context.Context, addr types.AccAddre } // GetAllBalances indicates an expected call of GetAllBalances. -func (mr *MockBankKeeperMockRecorder) GetAllBalances(ctx, addr interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) GetAllBalances(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllBalances", reflect.TypeOf((*MockBankKeeper)(nil).GetAllBalances), ctx, addr) } @@ -243,7 +200,7 @@ func (m *MockBankKeeper) GetBalance(ctx context.Context, addr types.AccAddress, } // GetBalance indicates an expected call of GetBalance. -func (mr *MockBankKeeperMockRecorder) GetBalance(ctx, addr, denom interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) GetBalance(ctx, addr, denom any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBalance", reflect.TypeOf((*MockBankKeeper)(nil).GetBalance), ctx, addr, denom) } @@ -257,7 +214,7 @@ func (m *MockBankKeeper) GetSupply(ctx context.Context, denom string) types.Coin } // GetSupply indicates an expected call of GetSupply. -func (mr *MockBankKeeperMockRecorder) GetSupply(ctx, denom interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) GetSupply(ctx, denom any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSupply", reflect.TypeOf((*MockBankKeeper)(nil).GetSupply), ctx, denom) } @@ -271,7 +228,7 @@ func (m *MockBankKeeper) LockedCoins(ctx context.Context, addr types.AccAddress) } // LockedCoins indicates an expected call of LockedCoins. -func (mr *MockBankKeeperMockRecorder) LockedCoins(ctx, addr interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) LockedCoins(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LockedCoins", reflect.TypeOf((*MockBankKeeper)(nil).LockedCoins), ctx, addr) } @@ -285,7 +242,7 @@ func (m *MockBankKeeper) SendCoinsFromModuleToModule(ctx context.Context, sender } // SendCoinsFromModuleToModule indicates an expected call of SendCoinsFromModuleToModule. -func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToModule(ctx, senderPool, recipientPool, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToModule(ctx, senderPool, recipientPool, amt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromModuleToModule", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromModuleToModule), ctx, senderPool, recipientPool, amt) } @@ -299,7 +256,7 @@ func (m *MockBankKeeper) SpendableCoins(ctx context.Context, addr types.AccAddre } // SpendableCoins indicates an expected call of SpendableCoins. -func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SpendableCoins", reflect.TypeOf((*MockBankKeeper)(nil).SpendableCoins), ctx, addr) } @@ -313,7 +270,7 @@ func (m *MockBankKeeper) UndelegateCoinsFromModuleToAccount(ctx context.Context, } // UndelegateCoinsFromModuleToAccount indicates an expected call of UndelegateCoinsFromModuleToAccount. -func (mr *MockBankKeeperMockRecorder) UndelegateCoinsFromModuleToAccount(ctx, senderModule, recipientAddr, amt interface{}) *gomock.Call { +func (mr *MockBankKeeperMockRecorder) UndelegateCoinsFromModuleToAccount(ctx, senderModule, recipientAddr, amt any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UndelegateCoinsFromModuleToAccount", reflect.TypeOf((*MockBankKeeper)(nil).UndelegateCoinsFromModuleToAccount), ctx, senderModule, recipientAddr, amt) } @@ -322,6 +279,7 @@ func (mr *MockBankKeeperMockRecorder) UndelegateCoinsFromModuleToAccount(ctx, se type MockValidatorSet struct { ctrl *gomock.Controller recorder *MockValidatorSetMockRecorder + isgomock struct{} } // MockValidatorSetMockRecorder is the mock recorder for MockValidatorSet. @@ -342,173 +300,206 @@ func (m *MockValidatorSet) EXPECT() *MockValidatorSetMockRecorder { } // Delegation mocks base method. -func (m *MockValidatorSet) Delegation(arg0 types.Context, arg1 types.AccAddress, arg2 types.ValAddress) types0.DelegationI { +func (m *MockValidatorSet) Delegation(arg0 context.Context, arg1 types.AccAddress, arg2 types.ValAddress) (types0.DelegationI, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Delegation", arg0, arg1, arg2) ret0, _ := ret[0].(types0.DelegationI) - return ret0 + ret1, _ := ret[1].(error) + return ret0, ret1 } // Delegation indicates an expected call of Delegation. -func (mr *MockValidatorSetMockRecorder) Delegation(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockValidatorSetMockRecorder) Delegation(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delegation", reflect.TypeOf((*MockValidatorSet)(nil).Delegation), arg0, arg1, arg2) } +// GetPubKeyByConsAddr mocks base method. +func (m *MockValidatorSet) GetPubKeyByConsAddr(arg0 context.Context, arg1 types.ConsAddress) (crypto.PublicKey, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetPubKeyByConsAddr", arg0, arg1) + ret0, _ := ret[0].(crypto.PublicKey) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetPubKeyByConsAddr indicates an expected call of GetPubKeyByConsAddr. +func (mr *MockValidatorSetMockRecorder) GetPubKeyByConsAddr(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPubKeyByConsAddr", reflect.TypeOf((*MockValidatorSet)(nil).GetPubKeyByConsAddr), arg0, arg1) +} + // IterateBondedValidatorsByPower mocks base method. -func (m *MockValidatorSet) IterateBondedValidatorsByPower(arg0 types.Context, arg1 func(int64, types0.ValidatorI) bool) { +func (m *MockValidatorSet) IterateBondedValidatorsByPower(arg0 context.Context, arg1 func(int64, types0.ValidatorI) bool) error { m.ctrl.T.Helper() - m.ctrl.Call(m, "IterateBondedValidatorsByPower", arg0, arg1) + ret := m.ctrl.Call(m, "IterateBondedValidatorsByPower", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 } // IterateBondedValidatorsByPower indicates an expected call of IterateBondedValidatorsByPower. -func (mr *MockValidatorSetMockRecorder) IterateBondedValidatorsByPower(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockValidatorSetMockRecorder) IterateBondedValidatorsByPower(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateBondedValidatorsByPower", reflect.TypeOf((*MockValidatorSet)(nil).IterateBondedValidatorsByPower), arg0, arg1) } // IterateLastValidators mocks base method. -func (m *MockValidatorSet) IterateLastValidators(arg0 types.Context, arg1 func(int64, types0.ValidatorI) bool) { +func (m *MockValidatorSet) IterateLastValidators(arg0 context.Context, arg1 func(int64, types0.ValidatorI) bool) error { m.ctrl.T.Helper() - m.ctrl.Call(m, "IterateLastValidators", arg0, arg1) + ret := m.ctrl.Call(m, "IterateLastValidators", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 } // IterateLastValidators indicates an expected call of IterateLastValidators. -func (mr *MockValidatorSetMockRecorder) IterateLastValidators(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockValidatorSetMockRecorder) IterateLastValidators(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateLastValidators", reflect.TypeOf((*MockValidatorSet)(nil).IterateLastValidators), arg0, arg1) } // IterateValidators mocks base method. -func (m *MockValidatorSet) IterateValidators(arg0 types.Context, arg1 func(int64, types0.ValidatorI) bool) { +func (m *MockValidatorSet) IterateValidators(arg0 context.Context, arg1 func(int64, types0.ValidatorI) bool) error { m.ctrl.T.Helper() - m.ctrl.Call(m, "IterateValidators", arg0, arg1) + ret := m.ctrl.Call(m, "IterateValidators", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 } // IterateValidators indicates an expected call of IterateValidators. -func (mr *MockValidatorSetMockRecorder) IterateValidators(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockValidatorSetMockRecorder) IterateValidators(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateValidators", reflect.TypeOf((*MockValidatorSet)(nil).IterateValidators), arg0, arg1) } // Jail mocks base method. -func (m *MockValidatorSet) Jail(arg0 types.Context, arg1 types.ConsAddress) { +func (m *MockValidatorSet) Jail(arg0 context.Context, arg1 types.ConsAddress) error { m.ctrl.T.Helper() - m.ctrl.Call(m, "Jail", arg0, arg1) + ret := m.ctrl.Call(m, "Jail", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 } // Jail indicates an expected call of Jail. -func (mr *MockValidatorSetMockRecorder) Jail(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockValidatorSetMockRecorder) Jail(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Jail", reflect.TypeOf((*MockValidatorSet)(nil).Jail), arg0, arg1) } // MaxValidators mocks base method. -func (m *MockValidatorSet) MaxValidators(arg0 types.Context) uint32 { +func (m *MockValidatorSet) MaxValidators(arg0 context.Context) (uint32, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "MaxValidators", arg0) ret0, _ := ret[0].(uint32) - return ret0 + ret1, _ := ret[1].(error) + return ret0, ret1 } // MaxValidators indicates an expected call of MaxValidators. -func (mr *MockValidatorSetMockRecorder) MaxValidators(arg0 interface{}) *gomock.Call { +func (mr *MockValidatorSetMockRecorder) MaxValidators(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MaxValidators", reflect.TypeOf((*MockValidatorSet)(nil).MaxValidators), arg0) } // Slash mocks base method. -func (m *MockValidatorSet) Slash(arg0 types.Context, arg1 types.ConsAddress, arg2, arg3 int64, arg4 math.LegacyDec) math.Int { +func (m *MockValidatorSet) Slash(arg0 context.Context, arg1 types.ConsAddress, arg2, arg3 int64, arg4 math.LegacyDec) (math.Int, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Slash", arg0, arg1, arg2, arg3, arg4) ret0, _ := ret[0].(math.Int) - return ret0 + ret1, _ := ret[1].(error) + return ret0, ret1 } // Slash indicates an expected call of Slash. -func (mr *MockValidatorSetMockRecorder) Slash(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { +func (mr *MockValidatorSetMockRecorder) Slash(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Slash", reflect.TypeOf((*MockValidatorSet)(nil).Slash), arg0, arg1, arg2, arg3, arg4) } // SlashWithInfractionReason mocks base method. -func (m *MockValidatorSet) SlashWithInfractionReason(arg0 types.Context, arg1 types.ConsAddress, arg2, arg3 int64, arg4 math.LegacyDec, arg5 types0.Infraction) math.Int { +func (m *MockValidatorSet) SlashWithInfractionReason(arg0 context.Context, arg1 types.ConsAddress, arg2, arg3 int64, arg4 math.LegacyDec, arg5 types0.Infraction) (math.Int, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SlashWithInfractionReason", arg0, arg1, arg2, arg3, arg4, arg5) ret0, _ := ret[0].(math.Int) - return ret0 + ret1, _ := ret[1].(error) + return ret0, ret1 } // SlashWithInfractionReason indicates an expected call of SlashWithInfractionReason. -func (mr *MockValidatorSetMockRecorder) SlashWithInfractionReason(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call { +func (mr *MockValidatorSetMockRecorder) SlashWithInfractionReason(arg0, arg1, arg2, arg3, arg4, arg5 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SlashWithInfractionReason", reflect.TypeOf((*MockValidatorSet)(nil).SlashWithInfractionReason), arg0, arg1, arg2, arg3, arg4, arg5) } // StakingTokenSupply mocks base method. -func (m *MockValidatorSet) StakingTokenSupply(arg0 types.Context) math.Int { +func (m *MockValidatorSet) StakingTokenSupply(arg0 context.Context) (math.Int, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "StakingTokenSupply", arg0) ret0, _ := ret[0].(math.Int) - return ret0 + ret1, _ := ret[1].(error) + return ret0, ret1 } // StakingTokenSupply indicates an expected call of StakingTokenSupply. -func (mr *MockValidatorSetMockRecorder) StakingTokenSupply(arg0 interface{}) *gomock.Call { +func (mr *MockValidatorSetMockRecorder) StakingTokenSupply(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StakingTokenSupply", reflect.TypeOf((*MockValidatorSet)(nil).StakingTokenSupply), arg0) } // TotalBondedTokens mocks base method. -func (m *MockValidatorSet) TotalBondedTokens(arg0 types.Context) math.Int { +func (m *MockValidatorSet) TotalBondedTokens(arg0 context.Context) (math.Int, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "TotalBondedTokens", arg0) ret0, _ := ret[0].(math.Int) - return ret0 + ret1, _ := ret[1].(error) + return ret0, ret1 } // TotalBondedTokens indicates an expected call of TotalBondedTokens. -func (mr *MockValidatorSetMockRecorder) TotalBondedTokens(arg0 interface{}) *gomock.Call { +func (mr *MockValidatorSetMockRecorder) TotalBondedTokens(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TotalBondedTokens", reflect.TypeOf((*MockValidatorSet)(nil).TotalBondedTokens), arg0) } // Unjail mocks base method. -func (m *MockValidatorSet) Unjail(arg0 types.Context, arg1 types.ConsAddress) { +func (m *MockValidatorSet) Unjail(arg0 context.Context, arg1 types.ConsAddress) error { m.ctrl.T.Helper() - m.ctrl.Call(m, "Unjail", arg0, arg1) + ret := m.ctrl.Call(m, "Unjail", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 } // Unjail indicates an expected call of Unjail. -func (mr *MockValidatorSetMockRecorder) Unjail(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockValidatorSetMockRecorder) Unjail(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Unjail", reflect.TypeOf((*MockValidatorSet)(nil).Unjail), arg0, arg1) } // Validator mocks base method. -func (m *MockValidatorSet) Validator(arg0 types.Context, arg1 types.ValAddress) types0.ValidatorI { +func (m *MockValidatorSet) Validator(arg0 context.Context, arg1 types.ValAddress) (types0.ValidatorI, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Validator", arg0, arg1) ret0, _ := ret[0].(types0.ValidatorI) - return ret0 + ret1, _ := ret[1].(error) + return ret0, ret1 } // Validator indicates an expected call of Validator. -func (mr *MockValidatorSetMockRecorder) Validator(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockValidatorSetMockRecorder) Validator(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Validator", reflect.TypeOf((*MockValidatorSet)(nil).Validator), arg0, arg1) } // ValidatorByConsAddr mocks base method. -func (m *MockValidatorSet) ValidatorByConsAddr(arg0 types.Context, arg1 types.ConsAddress) types0.ValidatorI { +func (m *MockValidatorSet) ValidatorByConsAddr(arg0 context.Context, arg1 types.ConsAddress) (types0.ValidatorI, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ValidatorByConsAddr", arg0, arg1) ret0, _ := ret[0].(types0.ValidatorI) - return ret0 + ret1, _ := ret[1].(error) + return ret0, ret1 } // ValidatorByConsAddr indicates an expected call of ValidatorByConsAddr. -func (mr *MockValidatorSetMockRecorder) ValidatorByConsAddr(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockValidatorSetMockRecorder) ValidatorByConsAddr(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorByConsAddr", reflect.TypeOf((*MockValidatorSet)(nil).ValidatorByConsAddr), arg0, arg1) } @@ -517,6 +508,7 @@ func (mr *MockValidatorSetMockRecorder) ValidatorByConsAddr(arg0, arg1 interface type MockDelegationSet struct { ctrl *gomock.Controller recorder *MockDelegationSetMockRecorder + isgomock struct{} } // MockDelegationSetMockRecorder is the mock recorder for MockDelegationSet. @@ -551,13 +543,15 @@ func (mr *MockDelegationSetMockRecorder) GetValidatorSet() *gomock.Call { } // IterateDelegations mocks base method. -func (m *MockDelegationSet) IterateDelegations(ctx types.Context, delegator types.AccAddress, fn func(int64, types0.DelegationI) bool) { +func (m *MockDelegationSet) IterateDelegations(ctx context.Context, delegator types.AccAddress, fn func(int64, types0.DelegationI) bool) error { m.ctrl.T.Helper() - m.ctrl.Call(m, "IterateDelegations", ctx, delegator, fn) + ret := m.ctrl.Call(m, "IterateDelegations", ctx, delegator, fn) + ret0, _ := ret[0].(error) + return ret0 } // IterateDelegations indicates an expected call of IterateDelegations. -func (mr *MockDelegationSetMockRecorder) IterateDelegations(ctx, delegator, fn interface{}) *gomock.Call { +func (mr *MockDelegationSetMockRecorder) IterateDelegations(ctx, delegator, fn any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateDelegations", reflect.TypeOf((*MockDelegationSet)(nil).IterateDelegations), ctx, delegator, fn) } @@ -566,6 +560,7 @@ func (mr *MockDelegationSetMockRecorder) IterateDelegations(ctx, delegator, fn i type MockStakingHooks struct { ctrl *gomock.Controller recorder *MockStakingHooksMockRecorder + isgomock struct{} } // MockStakingHooksMockRecorder is the mock recorder for MockStakingHooks. @@ -586,7 +581,7 @@ func (m *MockStakingHooks) EXPECT() *MockStakingHooksMockRecorder { } // AfterDelegationModified mocks base method. -func (m *MockStakingHooks) AfterDelegationModified(ctx types.Context, delAddr types.AccAddress, valAddr types.ValAddress) error { +func (m *MockStakingHooks) AfterDelegationModified(ctx context.Context, delAddr types.AccAddress, valAddr types.ValAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AfterDelegationModified", ctx, delAddr, valAddr) ret0, _ := ret[0].(error) @@ -594,13 +589,13 @@ func (m *MockStakingHooks) AfterDelegationModified(ctx types.Context, delAddr ty } // AfterDelegationModified indicates an expected call of AfterDelegationModified. -func (mr *MockStakingHooksMockRecorder) AfterDelegationModified(ctx, delAddr, valAddr interface{}) *gomock.Call { +func (mr *MockStakingHooksMockRecorder) AfterDelegationModified(ctx, delAddr, valAddr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AfterDelegationModified", reflect.TypeOf((*MockStakingHooks)(nil).AfterDelegationModified), ctx, delAddr, valAddr) } // AfterUnbondingInitiated mocks base method. -func (m *MockStakingHooks) AfterUnbondingInitiated(ctx types.Context, id uint64) error { +func (m *MockStakingHooks) AfterUnbondingInitiated(ctx context.Context, id uint64) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AfterUnbondingInitiated", ctx, id) ret0, _ := ret[0].(error) @@ -608,13 +603,13 @@ func (m *MockStakingHooks) AfterUnbondingInitiated(ctx types.Context, id uint64) } // AfterUnbondingInitiated indicates an expected call of AfterUnbondingInitiated. -func (mr *MockStakingHooksMockRecorder) AfterUnbondingInitiated(ctx, id interface{}) *gomock.Call { +func (mr *MockStakingHooksMockRecorder) AfterUnbondingInitiated(ctx, id any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AfterUnbondingInitiated", reflect.TypeOf((*MockStakingHooks)(nil).AfterUnbondingInitiated), ctx, id) } // AfterValidatorBeginUnbonding mocks base method. -func (m *MockStakingHooks) AfterValidatorBeginUnbonding(ctx types.Context, consAddr types.ConsAddress, valAddr types.ValAddress) error { +func (m *MockStakingHooks) AfterValidatorBeginUnbonding(ctx context.Context, consAddr types.ConsAddress, valAddr types.ValAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AfterValidatorBeginUnbonding", ctx, consAddr, valAddr) ret0, _ := ret[0].(error) @@ -622,13 +617,13 @@ func (m *MockStakingHooks) AfterValidatorBeginUnbonding(ctx types.Context, consA } // AfterValidatorBeginUnbonding indicates an expected call of AfterValidatorBeginUnbonding. -func (mr *MockStakingHooksMockRecorder) AfterValidatorBeginUnbonding(ctx, consAddr, valAddr interface{}) *gomock.Call { +func (mr *MockStakingHooksMockRecorder) AfterValidatorBeginUnbonding(ctx, consAddr, valAddr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AfterValidatorBeginUnbonding", reflect.TypeOf((*MockStakingHooks)(nil).AfterValidatorBeginUnbonding), ctx, consAddr, valAddr) } // AfterValidatorBonded mocks base method. -func (m *MockStakingHooks) AfterValidatorBonded(ctx types.Context, consAddr types.ConsAddress, valAddr types.ValAddress) error { +func (m *MockStakingHooks) AfterValidatorBonded(ctx context.Context, consAddr types.ConsAddress, valAddr types.ValAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AfterValidatorBonded", ctx, consAddr, valAddr) ret0, _ := ret[0].(error) @@ -636,13 +631,13 @@ func (m *MockStakingHooks) AfterValidatorBonded(ctx types.Context, consAddr type } // AfterValidatorBonded indicates an expected call of AfterValidatorBonded. -func (mr *MockStakingHooksMockRecorder) AfterValidatorBonded(ctx, consAddr, valAddr interface{}) *gomock.Call { +func (mr *MockStakingHooksMockRecorder) AfterValidatorBonded(ctx, consAddr, valAddr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AfterValidatorBonded", reflect.TypeOf((*MockStakingHooks)(nil).AfterValidatorBonded), ctx, consAddr, valAddr) } // AfterValidatorCreated mocks base method. -func (m *MockStakingHooks) AfterValidatorCreated(ctx types.Context, valAddr types.ValAddress) error { +func (m *MockStakingHooks) AfterValidatorCreated(ctx context.Context, valAddr types.ValAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AfterValidatorCreated", ctx, valAddr) ret0, _ := ret[0].(error) @@ -650,13 +645,13 @@ func (m *MockStakingHooks) AfterValidatorCreated(ctx types.Context, valAddr type } // AfterValidatorCreated indicates an expected call of AfterValidatorCreated. -func (mr *MockStakingHooksMockRecorder) AfterValidatorCreated(ctx, valAddr interface{}) *gomock.Call { +func (mr *MockStakingHooksMockRecorder) AfterValidatorCreated(ctx, valAddr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AfterValidatorCreated", reflect.TypeOf((*MockStakingHooks)(nil).AfterValidatorCreated), ctx, valAddr) } // AfterValidatorRemoved mocks base method. -func (m *MockStakingHooks) AfterValidatorRemoved(ctx types.Context, consAddr types.ConsAddress, valAddr types.ValAddress) error { +func (m *MockStakingHooks) AfterValidatorRemoved(ctx context.Context, consAddr types.ConsAddress, valAddr types.ValAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AfterValidatorRemoved", ctx, consAddr, valAddr) ret0, _ := ret[0].(error) @@ -664,13 +659,13 @@ func (m *MockStakingHooks) AfterValidatorRemoved(ctx types.Context, consAddr typ } // AfterValidatorRemoved indicates an expected call of AfterValidatorRemoved. -func (mr *MockStakingHooksMockRecorder) AfterValidatorRemoved(ctx, consAddr, valAddr interface{}) *gomock.Call { +func (mr *MockStakingHooksMockRecorder) AfterValidatorRemoved(ctx, consAddr, valAddr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AfterValidatorRemoved", reflect.TypeOf((*MockStakingHooks)(nil).AfterValidatorRemoved), ctx, consAddr, valAddr) } // BeforeDelegationCreated mocks base method. -func (m *MockStakingHooks) BeforeDelegationCreated(ctx types.Context, delAddr types.AccAddress, valAddr types.ValAddress) error { +func (m *MockStakingHooks) BeforeDelegationCreated(ctx context.Context, delAddr types.AccAddress, valAddr types.ValAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "BeforeDelegationCreated", ctx, delAddr, valAddr) ret0, _ := ret[0].(error) @@ -678,13 +673,13 @@ func (m *MockStakingHooks) BeforeDelegationCreated(ctx types.Context, delAddr ty } // BeforeDelegationCreated indicates an expected call of BeforeDelegationCreated. -func (mr *MockStakingHooksMockRecorder) BeforeDelegationCreated(ctx, delAddr, valAddr interface{}) *gomock.Call { +func (mr *MockStakingHooksMockRecorder) BeforeDelegationCreated(ctx, delAddr, valAddr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeforeDelegationCreated", reflect.TypeOf((*MockStakingHooks)(nil).BeforeDelegationCreated), ctx, delAddr, valAddr) } // BeforeDelegationRemoved mocks base method. -func (m *MockStakingHooks) BeforeDelegationRemoved(ctx types.Context, delAddr types.AccAddress, valAddr types.ValAddress) error { +func (m *MockStakingHooks) BeforeDelegationRemoved(ctx context.Context, delAddr types.AccAddress, valAddr types.ValAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "BeforeDelegationRemoved", ctx, delAddr, valAddr) ret0, _ := ret[0].(error) @@ -692,13 +687,13 @@ func (m *MockStakingHooks) BeforeDelegationRemoved(ctx types.Context, delAddr ty } // BeforeDelegationRemoved indicates an expected call of BeforeDelegationRemoved. -func (mr *MockStakingHooksMockRecorder) BeforeDelegationRemoved(ctx, delAddr, valAddr interface{}) *gomock.Call { +func (mr *MockStakingHooksMockRecorder) BeforeDelegationRemoved(ctx, delAddr, valAddr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeforeDelegationRemoved", reflect.TypeOf((*MockStakingHooks)(nil).BeforeDelegationRemoved), ctx, delAddr, valAddr) } // BeforeDelegationSharesModified mocks base method. -func (m *MockStakingHooks) BeforeDelegationSharesModified(ctx types.Context, delAddr types.AccAddress, valAddr types.ValAddress) error { +func (m *MockStakingHooks) BeforeDelegationSharesModified(ctx context.Context, delAddr types.AccAddress, valAddr types.ValAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "BeforeDelegationSharesModified", ctx, delAddr, valAddr) ret0, _ := ret[0].(error) @@ -706,13 +701,13 @@ func (m *MockStakingHooks) BeforeDelegationSharesModified(ctx types.Context, del } // BeforeDelegationSharesModified indicates an expected call of BeforeDelegationSharesModified. -func (mr *MockStakingHooksMockRecorder) BeforeDelegationSharesModified(ctx, delAddr, valAddr interface{}) *gomock.Call { +func (mr *MockStakingHooksMockRecorder) BeforeDelegationSharesModified(ctx, delAddr, valAddr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeforeDelegationSharesModified", reflect.TypeOf((*MockStakingHooks)(nil).BeforeDelegationSharesModified), ctx, delAddr, valAddr) } // BeforeValidatorModified mocks base method. -func (m *MockStakingHooks) BeforeValidatorModified(ctx types.Context, valAddr types.ValAddress) error { +func (m *MockStakingHooks) BeforeValidatorModified(ctx context.Context, valAddr types.ValAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "BeforeValidatorModified", ctx, valAddr) ret0, _ := ret[0].(error) @@ -720,13 +715,13 @@ func (m *MockStakingHooks) BeforeValidatorModified(ctx types.Context, valAddr ty } // BeforeValidatorModified indicates an expected call of BeforeValidatorModified. -func (mr *MockStakingHooksMockRecorder) BeforeValidatorModified(ctx, valAddr interface{}) *gomock.Call { +func (mr *MockStakingHooksMockRecorder) BeforeValidatorModified(ctx, valAddr any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeforeValidatorModified", reflect.TypeOf((*MockStakingHooks)(nil).BeforeValidatorModified), ctx, valAddr) } // BeforeValidatorSlashed mocks base method. -func (m *MockStakingHooks) BeforeValidatorSlashed(ctx types.Context, valAddr types.ValAddress, fraction math.LegacyDec) error { +func (m *MockStakingHooks) BeforeValidatorSlashed(ctx context.Context, valAddr types.ValAddress, fraction math.LegacyDec) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "BeforeValidatorSlashed", ctx, valAddr, fraction) ret0, _ := ret[0].(error) @@ -734,7 +729,7 @@ func (m *MockStakingHooks) BeforeValidatorSlashed(ctx types.Context, valAddr typ } // BeforeValidatorSlashed indicates an expected call of BeforeValidatorSlashed. -func (mr *MockStakingHooksMockRecorder) BeforeValidatorSlashed(ctx, valAddr, fraction interface{}) *gomock.Call { +func (mr *MockStakingHooksMockRecorder) BeforeValidatorSlashed(ctx, valAddr, fraction any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeforeValidatorSlashed", reflect.TypeOf((*MockStakingHooks)(nil).BeforeValidatorSlashed), ctx, valAddr, fraction) } diff --git a/x/staking/testutil/helpers.go b/x/staking/testutil/helpers.go index a7a2298d039b..515eb36e09ee 100644 --- a/x/staking/testutil/helpers.go +++ b/x/staking/testutil/helpers.go @@ -5,9 +5,10 @@ import ( "testing" "time" - "cosmossdk.io/math" "github.com/stretchr/testify/require" + "cosmossdk.io/math" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/keeper" @@ -50,7 +51,7 @@ func (sh *Helper) CreateValidatorWithValPower(addr sdk.ValAddress, pk cryptotype // CreateValidatorMsg returns a message used to create validator in this service. func (sh *Helper) CreateValidatorMsg(addr sdk.ValAddress, pk cryptotypes.PubKey, stakeAmount math.Int) *stakingtypes.MsgCreateValidator { coin := sdk.NewCoin(sh.Denom, stakeAmount) - msg, err := stakingtypes.NewMsgCreateValidator(addr, pk, coin, stakingtypes.Description{}, sh.Commission, math.OneInt()) + msg, err := stakingtypes.NewMsgCreateValidator(addr.String(), pk, coin, stakingtypes.Description{}, sh.Commission, math.OneInt()) require.NoError(sh.t, err) return msg } @@ -61,7 +62,7 @@ func (sh *Helper) CreateValidatorWithMsg(ctx context.Context, msg *stakingtypes. } func (sh *Helper) createValidator(addr sdk.ValAddress, pk cryptotypes.PubKey, coin sdk.Coin, ok bool) { - msg, err := stakingtypes.NewMsgCreateValidator(addr, pk, coin, stakingtypes.Description{Moniker: "TestValidator"}, sh.Commission, math.OneInt()) + msg, err := stakingtypes.NewMsgCreateValidator(addr.String(), pk, coin, stakingtypes.Description{Moniker: "TestValidator"}, sh.Commission, math.OneInt()) require.NoError(sh.t, err) res, err := sh.msgSrvr.CreateValidator(sh.Ctx, msg) if ok { @@ -76,7 +77,7 @@ func (sh *Helper) createValidator(addr sdk.ValAddress, pk cryptotypes.PubKey, co // Delegate calls staking module staking module `MsgServer/Delegate` to delegate stake for a validator func (sh *Helper) Delegate(delegator sdk.AccAddress, val sdk.ValAddress, amount math.Int) { coin := sdk.NewCoin(sh.Denom, amount) - msg := stakingtypes.NewMsgDelegate(delegator, val, coin) + msg := stakingtypes.NewMsgDelegate(delegator.String(), val.String(), coin) res, err := sh.msgSrvr.Delegate(sh.Ctx, msg) require.NoError(sh.t, err) require.NotNil(sh.t, res) @@ -85,7 +86,7 @@ func (sh *Helper) Delegate(delegator sdk.AccAddress, val sdk.ValAddress, amount // DelegateWithPower calls staking module `MsgServer/Delegate` to delegate stake for a validator func (sh *Helper) DelegateWithPower(delegator sdk.AccAddress, val sdk.ValAddress, power int64) { coin := sdk.NewCoin(sh.Denom, sh.k.TokensFromConsensusPower(sh.Ctx, power)) - msg := stakingtypes.NewMsgDelegate(delegator, val, coin) + msg := stakingtypes.NewMsgDelegate(delegator.String(), val.String(), coin) res, err := sh.msgSrvr.Delegate(sh.Ctx, msg) require.NoError(sh.t, err) require.NotNil(sh.t, res) @@ -94,7 +95,7 @@ func (sh *Helper) DelegateWithPower(delegator sdk.AccAddress, val sdk.ValAddress // Undelegate calls staking module `MsgServer/Undelegate` to unbound some stake from a validator. func (sh *Helper) Undelegate(delegator sdk.AccAddress, val sdk.ValAddress, amount math.Int, ok bool) { unbondAmt := sdk.NewCoin(sh.Denom, amount) - msg := stakingtypes.NewMsgUndelegate(delegator, val, unbondAmt) + msg := stakingtypes.NewMsgUndelegate(delegator.String(), val.String(), unbondAmt) res, err := sh.msgSrvr.Undelegate(sh.Ctx, msg) if ok { require.NoError(sh.t, err) @@ -108,8 +109,8 @@ func (sh *Helper) Undelegate(delegator sdk.AccAddress, val sdk.ValAddress, amoun // CheckValidator asserts that a validor exists and has a given status (if status!="") // and if has a right jailed flag. func (sh *Helper) CheckValidator(addr sdk.ValAddress, status stakingtypes.BondStatus, jailed bool) stakingtypes.Validator { - v, ok := sh.k.GetValidator(sh.Ctx, addr) - require.True(sh.t, ok) + v, err := sh.k.GetValidator(sh.Ctx, addr) + require.NoError(sh.t, err) require.Equal(sh.t, jailed, v.Jailed, "wrong Jalied status") if status >= 0 { require.Equal(sh.t, status, v.Status) @@ -126,7 +127,8 @@ func (sh *Helper) CheckDelegator(delegator sdk.AccAddress, val sdk.ValAddress, f // TurnBlock calls EndBlocker and updates the block time func (sh *Helper) TurnBlock(newTime time.Time) sdk.Context { sh.Ctx = sh.Ctx.WithBlockTime(newTime) - sh.k.EndBlocker(sh.Ctx) + _, err := sh.k.EndBlocker(sh.Ctx) + require.NoError(sh.t, err) return sh.Ctx } @@ -134,7 +136,8 @@ func (sh *Helper) TurnBlock(newTime time.Time) sdk.Context { // duration to the current block time func (sh *Helper) TurnBlockTimeDiff(diff time.Duration) sdk.Context { sh.Ctx = sh.Ctx.WithBlockTime(sh.Ctx.BlockHeader().Time.Add(diff)) - sh.k.EndBlocker(sh.Ctx) + _, err := sh.k.EndBlocker(sh.Ctx) + require.NoError(sh.t, err) return sh.Ctx } diff --git a/x/staking/testutil/validator.go b/x/staking/testutil/validator.go index 216d2fa31f44..b8c40beaba55 100644 --- a/x/staking/testutil/validator.go +++ b/x/staking/testutil/validator.go @@ -11,8 +11,9 @@ import ( ) // NewValidator is a testing helper method to create validators in tests -func NewValidator(t testing.TB, operator sdk.ValAddress, pubKey cryptotypes.PubKey) types.Validator { - v, err := types.NewValidator(operator, pubKey, types.Description{}) - require.NoError(t, err) +func NewValidator(tb testing.TB, operator sdk.ValAddress, pubKey cryptotypes.PubKey) types.Validator { + tb.Helper() + v, err := types.NewValidator(operator.String(), pubKey, types.Description{}) + require.NoError(tb, err) return v } diff --git a/x/staking/types/authz_test.go b/x/staking/types/authz_test.go index 246fbc267523..ab382d8cf5e6 100644 --- a/x/staking/types/authz_test.go +++ b/x/staking/types/authz_test.go @@ -73,7 +73,7 @@ func TestAuthzAuthorizations(t *testing.T) { []sdk.ValAddress{}, stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_DELEGATE, &coin100, - stakingtypes.NewMsgDelegate(delAddr, val1, coin100), + stakingtypes.NewMsgDelegate(delAddr.String(), val1.String(), coin100), false, true, nil, @@ -84,7 +84,7 @@ func TestAuthzAuthorizations(t *testing.T) { []sdk.ValAddress{}, stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_DELEGATE, &coin100, - stakingtypes.NewMsgDelegate(delAddr, val1, coin150), + stakingtypes.NewMsgDelegate(delAddr.String(), val1.String(), coin150), true, false, nil, @@ -95,7 +95,7 @@ func TestAuthzAuthorizations(t *testing.T) { []sdk.ValAddress{}, stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_DELEGATE, &coin100, - stakingtypes.NewMsgDelegate(delAddr, val1, coin50), + stakingtypes.NewMsgDelegate(delAddr.String(), val1.String(), coin50), false, false, &stakingtypes.StakeAuthorization{ @@ -110,7 +110,7 @@ func TestAuthzAuthorizations(t *testing.T) { []sdk.ValAddress{}, stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_DELEGATE, &coin100, - stakingtypes.NewMsgDelegate(delAddr, val3, coin100), + stakingtypes.NewMsgDelegate(delAddr.String(), val3.String(), coin100), true, false, nil, @@ -121,7 +121,7 @@ func TestAuthzAuthorizations(t *testing.T) { []sdk.ValAddress{}, stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_DELEGATE, nil, - stakingtypes.NewMsgDelegate(delAddr, val2, coin100), + stakingtypes.NewMsgDelegate(delAddr.String(), val2.String(), coin100), false, false, &stakingtypes.StakeAuthorization{ @@ -136,7 +136,7 @@ func TestAuthzAuthorizations(t *testing.T) { []sdk.ValAddress{val1}, stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_DELEGATE, nil, - stakingtypes.NewMsgDelegate(delAddr, val1, coin100), + stakingtypes.NewMsgDelegate(delAddr.String(), val1.String(), coin100), true, false, nil, @@ -147,7 +147,7 @@ func TestAuthzAuthorizations(t *testing.T) { []sdk.ValAddress{val1}, stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_DELEGATE, nil, - stakingtypes.NewMsgDelegate(delAddr, val2, coin100), + stakingtypes.NewMsgDelegate(delAddr.String(), val2.String(), coin100), false, false, &stakingtypes.StakeAuthorization{ @@ -162,7 +162,7 @@ func TestAuthzAuthorizations(t *testing.T) { []sdk.ValAddress{}, stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_UNDELEGATE, &coin100, - stakingtypes.NewMsgUndelegate(delAddr, val1, coin100), + stakingtypes.NewMsgUndelegate(delAddr.String(), val1.String(), coin100), false, true, nil, @@ -173,7 +173,7 @@ func TestAuthzAuthorizations(t *testing.T) { []sdk.ValAddress{}, stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_UNDELEGATE, &coin100, - stakingtypes.NewMsgUndelegate(delAddr, val1, coin50), + stakingtypes.NewMsgUndelegate(delAddr.String(), val1.String(), coin50), false, false, &stakingtypes.StakeAuthorization{ @@ -188,7 +188,7 @@ func TestAuthzAuthorizations(t *testing.T) { []sdk.ValAddress{}, stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_UNDELEGATE, &coin100, - stakingtypes.NewMsgUndelegate(delAddr, val3, coin100), + stakingtypes.NewMsgUndelegate(delAddr.String(), val3.String(), coin100), true, false, nil, @@ -199,7 +199,7 @@ func TestAuthzAuthorizations(t *testing.T) { []sdk.ValAddress{}, stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_UNDELEGATE, nil, - stakingtypes.NewMsgUndelegate(delAddr, val2, coin100), + stakingtypes.NewMsgUndelegate(delAddr.String(), val2.String(), coin100), false, false, &stakingtypes.StakeAuthorization{ @@ -214,7 +214,7 @@ func TestAuthzAuthorizations(t *testing.T) { []sdk.ValAddress{val1}, stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_UNDELEGATE, &coin100, - stakingtypes.NewMsgUndelegate(delAddr, val1, coin100), + stakingtypes.NewMsgUndelegate(delAddr.String(), val1.String(), coin100), true, false, nil, @@ -226,7 +226,7 @@ func TestAuthzAuthorizations(t *testing.T) { []sdk.ValAddress{}, stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_REDELEGATE, &coin100, - stakingtypes.NewMsgUndelegate(delAddr, val1, coin100), + stakingtypes.NewMsgUndelegate(delAddr.String(), val1.String(), coin100), false, true, nil, @@ -237,7 +237,7 @@ func TestAuthzAuthorizations(t *testing.T) { []sdk.ValAddress{}, stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_REDELEGATE, &coin100, - stakingtypes.NewMsgBeginRedelegate(delAddr, val1, val1, coin50), + stakingtypes.NewMsgBeginRedelegate(delAddr.String(), val1.String(), val1.String(), coin50), false, false, &stakingtypes.StakeAuthorization{ @@ -252,7 +252,7 @@ func TestAuthzAuthorizations(t *testing.T) { []sdk.ValAddress{}, stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_REDELEGATE, &coin100, - stakingtypes.NewMsgBeginRedelegate(delAddr, val3, val3, coin100), + stakingtypes.NewMsgBeginRedelegate(delAddr.String(), val3.String(), val3.String(), coin100), true, false, nil, @@ -263,7 +263,7 @@ func TestAuthzAuthorizations(t *testing.T) { []sdk.ValAddress{}, stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_REDELEGATE, nil, - stakingtypes.NewMsgBeginRedelegate(delAddr, val2, val2, coin100), + stakingtypes.NewMsgBeginRedelegate(delAddr.String(), val2.String(), val2.String(), coin100), false, false, &stakingtypes.StakeAuthorization{ @@ -278,7 +278,7 @@ func TestAuthzAuthorizations(t *testing.T) { []sdk.ValAddress{val1}, stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_REDELEGATE, &coin100, - stakingtypes.NewMsgBeginRedelegate(delAddr, val1, val1, coin100), + stakingtypes.NewMsgBeginRedelegate(delAddr.String(), val1.String(), val1.String(), coin100), true, false, nil, @@ -289,7 +289,7 @@ func TestAuthzAuthorizations(t *testing.T) { []sdk.ValAddress{}, stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_CANCEL_UNBONDING_DELEGATION, &coin100, - stakingtypes.NewMsgCancelUnbondingDelegation(delAddr, val1, ctx.HeaderInfo().Height, coin100), + stakingtypes.NewMsgCancelUnbondingDelegation(delAddr.String(), val1.String(), ctx.HeaderInfo().Height, coin100), false, true, nil, @@ -300,7 +300,7 @@ func TestAuthzAuthorizations(t *testing.T) { []sdk.ValAddress{}, stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_CANCEL_UNBONDING_DELEGATION, &coin100, - stakingtypes.NewMsgCancelUnbondingDelegation(delAddr, val1, ctx.HeaderInfo().Height, coin50), + stakingtypes.NewMsgCancelUnbondingDelegation(delAddr.String(), val1.String(), ctx.HeaderInfo().Height, coin50), false, false, &stakingtypes.StakeAuthorization{ @@ -317,7 +317,7 @@ func TestAuthzAuthorizations(t *testing.T) { []sdk.ValAddress{}, stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_CANCEL_UNBONDING_DELEGATION, &coin100, - stakingtypes.NewMsgCancelUnbondingDelegation(delAddr, val3, ctx.HeaderInfo().Height, coin50), + stakingtypes.NewMsgCancelUnbondingDelegation(delAddr.String(), val3.String(), ctx.HeaderInfo().Height, coin50), true, false, nil, @@ -328,7 +328,7 @@ func TestAuthzAuthorizations(t *testing.T) { []sdk.ValAddress{}, stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_CANCEL_UNBONDING_DELEGATION, nil, - stakingtypes.NewMsgCancelUnbondingDelegation(delAddr, val2, ctx.HeaderInfo().Height, coin100), + stakingtypes.NewMsgCancelUnbondingDelegation(delAddr.String(), val2.String(), ctx.HeaderInfo().Height, coin100), false, false, &stakingtypes.StakeAuthorization{ @@ -345,7 +345,7 @@ func TestAuthzAuthorizations(t *testing.T) { []sdk.ValAddress{val1}, stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_CANCEL_UNBONDING_DELEGATION, &coin100, - stakingtypes.NewMsgCancelUnbondingDelegation(delAddr, val1, ctx.HeaderInfo().Height, coin100), + stakingtypes.NewMsgCancelUnbondingDelegation(delAddr.String(), val1.String(), ctx.HeaderInfo().Height, coin100), true, false, nil, diff --git a/x/staking/types/commission_test.go b/x/staking/types/commission_test.go index 17fa202fdf46..bf45ca8a9d89 100644 --- a/x/staking/types/commission_test.go +++ b/x/staking/types/commission_test.go @@ -4,10 +4,10 @@ import ( "testing" "time" - "cosmossdk.io/math" "github.com/stretchr/testify/require" - sdk "github.com/cosmos/cosmos-sdk/types" + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -17,19 +17,19 @@ func TestCommissionValidate(t *testing.T) { expectErr bool }{ // invalid commission; max rate < 0% - {types.NewCommission(math.LegacyZeroDec(), sdk.MustNewDecFromStr("-1.00"), math.LegacyZeroDec()), true}, + {types.NewCommission(math.LegacyZeroDec(), math.LegacyMustNewDecFromStr("-1.00"), math.LegacyZeroDec()), true}, // invalid commission; max rate > 100% - {types.NewCommission(math.LegacyZeroDec(), sdk.MustNewDecFromStr("2.00"), math.LegacyZeroDec()), true}, + {types.NewCommission(math.LegacyZeroDec(), math.LegacyMustNewDecFromStr("2.00"), math.LegacyZeroDec()), true}, // invalid commission; rate < 0% - {types.NewCommission(sdk.MustNewDecFromStr("-1.00"), math.LegacyZeroDec(), math.LegacyZeroDec()), true}, + {types.NewCommission(math.LegacyMustNewDecFromStr("-1.00"), math.LegacyZeroDec(), math.LegacyZeroDec()), true}, // invalid commission; rate > max rate - {types.NewCommission(sdk.MustNewDecFromStr("0.75"), sdk.MustNewDecFromStr("0.50"), math.LegacyZeroDec()), true}, + {types.NewCommission(math.LegacyMustNewDecFromStr("0.75"), math.LegacyMustNewDecFromStr("0.50"), math.LegacyZeroDec()), true}, // invalid commission; max change rate < 0% - {types.NewCommission(math.LegacyOneDec(), math.LegacyOneDec(), sdk.MustNewDecFromStr("-1.00")), true}, + {types.NewCommission(math.LegacyOneDec(), math.LegacyOneDec(), math.LegacyMustNewDecFromStr("-1.00")), true}, // invalid commission; max change rate > max rate - {types.NewCommission(math.LegacyOneDec(), sdk.MustNewDecFromStr("0.75"), sdk.MustNewDecFromStr("0.90")), true}, + {types.NewCommission(math.LegacyOneDec(), math.LegacyMustNewDecFromStr("0.75"), math.LegacyMustNewDecFromStr("0.90")), true}, // valid commission - {types.NewCommission(sdk.MustNewDecFromStr("0.20"), math.LegacyOneDec(), sdk.MustNewDecFromStr("0.10")), false}, + {types.NewCommission(math.LegacyMustNewDecFromStr("0.20"), math.LegacyOneDec(), math.LegacyMustNewDecFromStr("0.10")), false}, } for i, tc := range testCases { @@ -40,7 +40,7 @@ func TestCommissionValidate(t *testing.T) { func TestCommissionValidateNewRate(t *testing.T) { now := time.Now().UTC() - c1 := types.NewCommission(sdk.MustNewDecFromStr("0.40"), sdk.MustNewDecFromStr("0.80"), sdk.MustNewDecFromStr("0.10")) + c1 := types.NewCommission(math.LegacyMustNewDecFromStr("0.40"), math.LegacyMustNewDecFromStr("0.80"), math.LegacyMustNewDecFromStr("0.10")) c1.UpdateTime = now testCases := []struct { @@ -50,17 +50,17 @@ func TestCommissionValidateNewRate(t *testing.T) { expectErr bool }{ // invalid new commission rate; last update < 24h ago - {c1, sdk.MustNewDecFromStr("0.50"), now, true}, + {c1, math.LegacyMustNewDecFromStr("0.50"), now, true}, // invalid new commission rate; new rate < 0% - {c1, sdk.MustNewDecFromStr("-1.00"), now.Add(48 * time.Hour), true}, + {c1, math.LegacyMustNewDecFromStr("-1.00"), now.Add(48 * time.Hour), true}, // invalid new commission rate; new rate > max rate - {c1, sdk.MustNewDecFromStr("0.90"), now.Add(48 * time.Hour), true}, + {c1, math.LegacyMustNewDecFromStr("0.90"), now.Add(48 * time.Hour), true}, // invalid new commission rate; new rate > max change rate - {c1, sdk.MustNewDecFromStr("0.60"), now.Add(48 * time.Hour), true}, + {c1, math.LegacyMustNewDecFromStr("0.60"), now.Add(48 * time.Hour), true}, // valid commission - {c1, sdk.MustNewDecFromStr("0.50"), now.Add(48 * time.Hour), false}, + {c1, math.LegacyMustNewDecFromStr("0.50"), now.Add(48 * time.Hour), false}, // valid commission - {c1, sdk.MustNewDecFromStr("0.10"), now.Add(48 * time.Hour), false}, + {c1, math.LegacyMustNewDecFromStr("0.10"), now.Add(48 * time.Hour), false}, } for i, tc := range testCases { diff --git a/x/staking/types/delegation.go b/x/staking/types/delegation.go index 355ef50007b5..3284316246f8 100644 --- a/x/staking/types/delegation.go +++ b/x/staking/types/delegation.go @@ -5,7 +5,9 @@ import ( "strings" "time" + "cosmossdk.io/core/address" "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -14,10 +16,10 @@ import ( var _ DelegationI = Delegation{} // NewDelegation creates a new delegation object -func NewDelegation(delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress, shares math.LegacyDec) Delegation { +func NewDelegation(delegatorAddr, validatorAddr string, shares math.LegacyDec) Delegation { return Delegation{ - DelegatorAddress: delegatorAddr.String(), - ValidatorAddress: validatorAddr.String(), + DelegatorAddress: delegatorAddr, + ValidatorAddress: validatorAddr, Shares: shares, } } @@ -44,18 +46,12 @@ func UnmarshalDelegation(cdc codec.BinaryCodec, value []byte) (delegation Delega return delegation, err } -func (d Delegation) GetDelegatorAddr() sdk.AccAddress { - delAddr := sdk.MustAccAddressFromBech32(d.DelegatorAddress) - - return delAddr +func (d Delegation) GetDelegatorAddr() string { + return d.DelegatorAddress } -func (d Delegation) GetValidatorAddr() sdk.ValAddress { - addr, err := sdk.ValAddressFromBech32(d.ValidatorAddress) - if err != nil { - panic(err) - } - return addr +func (d Delegation) GetValidatorAddr() string { + return d.ValidatorAddress } func (d Delegation) GetShares() math.LegacyDec { return d.Shares } @@ -116,10 +112,19 @@ func UnmarshalUBDE(cdc codec.BinaryCodec, value []byte) (ubd UnbondingDelegation func NewUnbondingDelegation( delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress, creationHeight int64, minTime time.Time, balance math.Int, id uint64, + valAc, delAc address.Codec, ) UnbondingDelegation { + valAddr, err := valAc.BytesToString(validatorAddr) + if err != nil { + panic(err) + } + delAddr, err := delAc.BytesToString(delegatorAddr) + if err != nil { + panic(err) + } return UnbondingDelegation{ - DelegatorAddress: delegatorAddr.String(), - ValidatorAddress: validatorAddr.String(), + DelegatorAddress: delAddr, + ValidatorAddress: valAddr, Entries: []UnbondingDelegationEntry{ NewUnbondingDelegationEntry(creationHeight, minTime, balance, id), }, @@ -213,11 +218,25 @@ func (e RedelegationEntry) OnHold() bool { func NewRedelegation( delegatorAddr sdk.AccAddress, validatorSrcAddr, validatorDstAddr sdk.ValAddress, creationHeight int64, minTime time.Time, balance math.Int, sharesDst math.LegacyDec, id uint64, + valAc, delAc address.Codec, ) Redelegation { + valSrcAddr, err := valAc.BytesToString(validatorSrcAddr) + if err != nil { + panic(err) + } + valDstAddr, err := valAc.BytesToString(validatorDstAddr) + if err != nil { + panic(err) + } + delAddr, err := delAc.BytesToString(delegatorAddr) + if err != nil { + panic(err) + } + return Redelegation{ - DelegatorAddress: delegatorAddr.String(), - ValidatorSrcAddress: validatorSrcAddr.String(), - ValidatorDstAddress: validatorDstAddr.String(), + DelegatorAddress: delAddr, + ValidatorSrcAddress: valSrcAddr, + ValidatorDstAddress: valDstAddr, Entries: []RedelegationEntry{ NewRedelegationEntry(creationHeight, minTime, balance, sharesDst, id), }, @@ -272,7 +291,7 @@ func (d Redelegations) String() (out string) { // NewDelegationResp creates a new DelegationResponse instance func NewDelegationResp( - delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress, shares math.LegacyDec, balance sdk.Coin, + delegatorAddr, validatorAddr string, shares math.LegacyDec, balance sdk.Coin, ) DelegationResponse { return DelegationResponse{ Delegation: NewDelegation(delegatorAddr, validatorAddr, shares), @@ -308,13 +327,13 @@ func (d DelegationResponses) String() (out string) { // NewRedelegationResponse crates a new RedelegationEntryResponse instance. func NewRedelegationResponse( - delegatorAddr sdk.AccAddress, validatorSrc, validatorDst sdk.ValAddress, entries []RedelegationEntryResponse, + delegatorAddr, validatorSrc, validatorDst string, entries []RedelegationEntryResponse, ) RedelegationResponse { return RedelegationResponse{ Redelegation: Redelegation{ - DelegatorAddress: delegatorAddr.String(), - ValidatorSrcAddress: validatorSrc.String(), - ValidatorDstAddress: validatorDst.String(), + DelegatorAddress: delegatorAddr, + ValidatorSrcAddress: validatorSrc, + ValidatorDstAddress: validatorDst, }, Entries: entries, } diff --git a/x/staking/types/delegation_test.go b/x/staking/types/delegation_test.go index 6635cc179e87..3ce9d8b6c535 100644 --- a/x/staking/types/delegation_test.go +++ b/x/staking/types/delegation_test.go @@ -5,17 +5,19 @@ import ( "testing" "time" - "cosmossdk.io/math" "github.com/cosmos/gogoproto/proto" "github.com/stretchr/testify/require" + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/codec" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/types" ) func TestDelegationEqual(t *testing.T) { - d1 := types.NewDelegation(sdk.AccAddress(valAddr1), valAddr2, math.LegacyNewDec(100)) + d1 := types.NewDelegation(sdk.AccAddress(valAddr1).String(), valAddr2.String(), math.LegacyNewDec(100)) d2 := d1 ok := d1.String() == d2.String() @@ -29,13 +31,13 @@ func TestDelegationEqual(t *testing.T) { } func TestDelegationString(t *testing.T) { - d := types.NewDelegation(sdk.AccAddress(valAddr1), valAddr2, math.LegacyNewDec(100)) + d := types.NewDelegation(sdk.AccAddress(valAddr1).String(), valAddr2.String(), math.LegacyNewDec(100)) require.NotEmpty(t, d.String()) } func TestUnbondingDelegationEqual(t *testing.T) { ubd1 := types.NewUnbondingDelegation(sdk.AccAddress(valAddr1), valAddr2, 0, - time.Unix(0, 0), math.NewInt(0), 1) + time.Unix(0, 0), math.NewInt(0), 1, addresscodec.NewBech32Codec("cosmosvaloper"), addresscodec.NewBech32Codec("cosmos")) ubd2 := ubd1 ok := ubd1.String() == ubd2.String() @@ -50,7 +52,7 @@ func TestUnbondingDelegationEqual(t *testing.T) { func TestUnbondingDelegationString(t *testing.T) { ubd := types.NewUnbondingDelegation(sdk.AccAddress(valAddr1), valAddr2, 0, - time.Unix(0, 0), math.NewInt(0), 1) + time.Unix(0, 0), math.NewInt(0), 1, addresscodec.NewBech32Codec("cosmosvaloper"), addresscodec.NewBech32Codec("cosmos")) require.NotEmpty(t, ubd.String()) } @@ -58,10 +60,10 @@ func TestUnbondingDelegationString(t *testing.T) { func TestRedelegationEqual(t *testing.T) { r1 := types.NewRedelegation(sdk.AccAddress(valAddr1), valAddr2, valAddr3, 0, time.Unix(0, 0), math.NewInt(0), - math.LegacyNewDec(0), 1) + math.LegacyNewDec(0), 1, addresscodec.NewBech32Codec("cosmosvaloper"), addresscodec.NewBech32Codec("cosmos")) r2 := types.NewRedelegation(sdk.AccAddress(valAddr1), valAddr2, valAddr3, 0, time.Unix(0, 0), math.NewInt(0), - math.LegacyNewDec(0), 1) + math.LegacyNewDec(0), 1, addresscodec.NewBech32Codec("cosmosvaloper"), addresscodec.NewBech32Codec("cosmos")) require.True(t, proto.Equal(&r1, &r2)) r2.Entries[0].SharesDst = math.LegacyNewDec(10) @@ -72,16 +74,16 @@ func TestRedelegationEqual(t *testing.T) { func TestRedelegationString(t *testing.T) { r := types.NewRedelegation(sdk.AccAddress(valAddr1), valAddr2, valAddr3, 0, time.Unix(0, 0), math.NewInt(0), - math.LegacyNewDec(10), 1) + math.LegacyNewDec(10), 1, addresscodec.NewBech32Codec("cosmosvaloper"), addresscodec.NewBech32Codec("cosmos")) require.NotEmpty(t, r.String()) } func TestDelegationResponses(t *testing.T) { cdc := codec.NewLegacyAmino() - dr1 := types.NewDelegationResp(sdk.AccAddress(valAddr1), valAddr2, math.LegacyNewDec(5), + dr1 := types.NewDelegationResp(sdk.AccAddress(valAddr1).String(), valAddr2.String(), math.LegacyNewDec(5), sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(5))) - dr2 := types.NewDelegationResp(sdk.AccAddress(valAddr1), valAddr3, math.LegacyNewDec(5), + dr2 := types.NewDelegationResp(sdk.AccAddress(valAddr1).String(), valAddr3.String(), math.LegacyNewDec(5), sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(5))) drs := types.DelegationResponses{dr1, dr2} @@ -112,8 +114,8 @@ func TestRedelegationResponses(t *testing.T) { types.NewRedelegationEntryResponse(0, time.Unix(0, 0), math.LegacyNewDec(5), math.NewInt(5), math.NewInt(5), 0), types.NewRedelegationEntryResponse(0, time.Unix(0, 0), math.LegacyNewDec(5), math.NewInt(5), math.NewInt(5), 0), } - rdr1 := types.NewRedelegationResponse(sdk.AccAddress(valAddr1), valAddr2, valAddr3, entries) - rdr2 := types.NewRedelegationResponse(sdk.AccAddress(valAddr2), valAddr1, valAddr3, entries) + rdr1 := types.NewRedelegationResponse(sdk.AccAddress(valAddr1).String(), valAddr2.String(), valAddr3.String(), entries) + rdr2 := types.NewRedelegationResponse(sdk.AccAddress(valAddr2).String(), valAddr1.String(), valAddr3.String(), entries) rdrs := types.RedelegationResponses{rdr1, rdr2} bz1, err := json.Marshal(rdr1) diff --git a/x/staking/types/errors.go b/x/staking/types/errors.go index ee1750c22368..00441564352a 100644 --- a/x/staking/types/errors.go +++ b/x/staking/types/errors.go @@ -3,11 +3,6 @@ package types import "cosmossdk.io/errors" // x/staking module sentinel errors -// -// TODO: Many of these errors are redundant. They should be removed and replaced -// by sdkerrors.ErrInvalidRequest. -// -// REF: https://github.com/cosmos/cosmos-sdk/issues/5450 var ( ErrEmptyValidatorAddr = errors.Register(ModuleName, 2, "empty validator address") ErrNoValidatorFound = errors.Register(ModuleName, 3, "validator does not exist") @@ -50,4 +45,7 @@ var ( ErrCommissionLTMinRate = errors.Register(ModuleName, 40, "commission cannot be less than min rate") ErrUnbondingNotFound = errors.Register(ModuleName, 41, "unbonding operation not found") ErrUnbondingOnHoldRefCountNegative = errors.Register(ModuleName, 42, "cannot un-hold unbonding operation that is not on hold") + ErrInvalidSigner = errors.Register(ModuleName, 43, "expected authority account as only signer for proposal message") + ErrBadRedelegationSrc = errors.Register(ModuleName, 44, "redelegation source validator not found") + ErrNoUnbondingType = errors.Register(ModuleName, 45, "unbonding type not found") ) diff --git a/x/staking/types/expected_keepers.go b/x/staking/types/expected_keepers.go index a7ef4ab37ce5..96f816a5acb1 100644 --- a/x/staking/types/expected_keepers.go +++ b/x/staking/types/expected_keepers.go @@ -3,18 +3,14 @@ package types import ( context "context" + cmtprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" + "cosmossdk.io/core/address" "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" ) -// DistributionKeeper expected distribution keeper (noalias) -type DistributionKeeper interface { - GetFeePoolCommunityCoins(ctx context.Context) sdk.DecCoins - GetValidatorOutstandingRewardsCoins(ctx context.Context, val sdk.ValAddress) sdk.DecCoins -} - // AccountKeeper defines the expected account keeper (noalias) type AccountKeeper interface { AddressCodec() address.Codec @@ -48,34 +44,38 @@ type BankKeeper interface { // ValidatorSet expected properties for the set of all validators (noalias) type ValidatorSet interface { // iterate through validators by operator address, execute func for each validator - IterateValidators(sdk.Context, - func(index int64, validator ValidatorI) (stop bool)) + IterateValidators(context.Context, + func(index int64, validator ValidatorI) (stop bool)) error // iterate through bonded validators by operator address, execute func for each validator - IterateBondedValidatorsByPower(sdk.Context, - func(index int64, validator ValidatorI) (stop bool)) + IterateBondedValidatorsByPower(context.Context, + func(index int64, validator ValidatorI) (stop bool)) error // iterate through the consensus validator set of the last block by operator address, execute func for each validator - IterateLastValidators(sdk.Context, - func(index int64, validator ValidatorI) (stop bool)) + IterateLastValidators(context.Context, + func(index int64, validator ValidatorI) (stop bool)) error - Validator(sdk.Context, sdk.ValAddress) ValidatorI // get a particular validator by operator address - ValidatorByConsAddr(sdk.Context, sdk.ConsAddress) ValidatorI // get a particular validator by consensus address - TotalBondedTokens(sdk.Context) math.Int // total bonded tokens within the validator set - StakingTokenSupply(sdk.Context) math.Int // total staking token supply + Validator(context.Context, sdk.ValAddress) (ValidatorI, error) // get a particular validator by operator address + ValidatorByConsAddr(context.Context, sdk.ConsAddress) (ValidatorI, error) // get a particular validator by consensus address + TotalBondedTokens(context.Context) (math.Int, error) // total bonded tokens within the validator set + StakingTokenSupply(context.Context) (math.Int, error) // total staking token supply // slash the validator and delegators of the validator, specifying offense height, offense power, and slash fraction - Slash(sdk.Context, sdk.ConsAddress, int64, int64, math.LegacyDec) math.Int - SlashWithInfractionReason(sdk.Context, sdk.ConsAddress, int64, int64, math.LegacyDec, Infraction) math.Int - Jail(sdk.Context, sdk.ConsAddress) // jail a validator - Unjail(sdk.Context, sdk.ConsAddress) // unjail a validator + Slash(context.Context, sdk.ConsAddress, int64, int64, math.LegacyDec) (math.Int, error) + SlashWithInfractionReason(context.Context, sdk.ConsAddress, int64, int64, math.LegacyDec, Infraction) (math.Int, error) + Jail(context.Context, sdk.ConsAddress) error // jail a validator + Unjail(context.Context, sdk.ConsAddress) error // unjail a validator // Delegation allows for getting a particular delegation for a given validator // and delegator outside the scope of the staking module. - Delegation(sdk.Context, sdk.AccAddress, sdk.ValAddress) DelegationI + Delegation(context.Context, sdk.AccAddress, sdk.ValAddress) (DelegationI, error) // MaxValidators returns the maximum amount of bonded validators - MaxValidators(sdk.Context) uint32 + MaxValidators(context.Context) (uint32, error) + + // GetPubKeyByConsAddr returns the consensus public key for a validator. Used in vote + // extension validation. + GetPubKeyByConsAddr(context.Context, sdk.ConsAddress) (cmtprotocrypto.PublicKey, error) } // DelegationSet expected properties for the set of all delegations for a particular (noalias) @@ -84,8 +84,8 @@ type DelegationSet interface { // iterate through all delegations from one delegator by validator-AccAddress, // execute func for each validator - IterateDelegations(ctx sdk.Context, delegator sdk.AccAddress, - fn func(index int64, delegation DelegationI) (stop bool)) + IterateDelegations(ctx context.Context, delegator sdk.AccAddress, + fn func(index int64, delegation DelegationI) (stop bool)) error } // Event Hooks @@ -96,19 +96,19 @@ type DelegationSet interface { // StakingHooks event hooks for staking validator object (noalias) type StakingHooks interface { - AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) error // Must be called when a validator is created - BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress) error // Must be called when a validator's state changes - AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error // Must be called when a validator is deleted - - AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error // Must be called when a validator is bonded - AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error // Must be called when a validator begins unbonding - - BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error // Must be called when a delegation is created - BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error // Must be called when a delegation's shares are modified - BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error // Must be called when a delegation is removed - AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error - BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction math.LegacyDec) error - AfterUnbondingInitiated(ctx sdk.Context, id uint64) error + AfterValidatorCreated(ctx context.Context, valAddr sdk.ValAddress) error // Must be called when a validator is created + BeforeValidatorModified(ctx context.Context, valAddr sdk.ValAddress) error // Must be called when a validator's state changes + AfterValidatorRemoved(ctx context.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error // Must be called when a validator is deleted + + AfterValidatorBonded(ctx context.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error // Must be called when a validator is bonded + AfterValidatorBeginUnbonding(ctx context.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error // Must be called when a validator begins unbonding + + BeforeDelegationCreated(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error // Must be called when a delegation is created + BeforeDelegationSharesModified(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error // Must be called when a delegation's shares are modified + BeforeDelegationRemoved(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error // Must be called when a delegation is removed + AfterDelegationModified(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error + BeforeValidatorSlashed(ctx context.Context, valAddr sdk.ValAddress, fraction math.LegacyDec) error + AfterUnbondingInitiated(ctx context.Context, id uint64) error } // StakingHooksWrapper is a wrapper for modules to inject StakingHooks using depinject. diff --git a/x/staking/types/exported.go b/x/staking/types/exported.go index a1f73d409430..2cdf70629e80 100644 --- a/x/staking/types/exported.go +++ b/x/staking/types/exported.go @@ -1,18 +1,18 @@ package types import ( - "cosmossdk.io/math" cmtprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" + "cosmossdk.io/math" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - sdk "github.com/cosmos/cosmos-sdk/types" ) // DelegationI delegation bond for a delegated proof of stake system type DelegationI interface { - GetDelegatorAddr() sdk.AccAddress // delegator sdk.AccAddress for the bond - GetValidatorAddr() sdk.ValAddress // validator operator address - GetShares() math.LegacyDec // amount of validator's shares held in this delegation + GetDelegatorAddr() string // delegator string for the bond + GetValidatorAddr() string // validator operator address + GetShares() math.LegacyDec // amount of validator's shares held in this delegation } // ValidatorI expected validator functions @@ -23,10 +23,10 @@ type ValidatorI interface { IsBonded() bool // check if has a bonded status IsUnbonded() bool // check if has status unbonded IsUnbonding() bool // check if has status unbonding - GetOperator() sdk.ValAddress // operator address to receive/return validators coins + GetOperator() string // operator address to receive/return validators coins ConsPubKey() (cryptotypes.PubKey, error) // validation consensus pubkey (cryptotypes.PubKey) TmConsPublicKey() (cmtprotocrypto.PublicKey, error) // validation consensus pubkey (CometBFT) - GetConsAddr() (sdk.ConsAddress, error) // validation consensus address + GetConsAddr() ([]byte, error) // validation consensus address GetTokens() math.Int // validation tokens GetBondedTokens() math.Int // validator bonded tokens GetConsensusPower(math.Int) int64 // validation power in CometBFT diff --git a/x/staking/types/genesis.pb.go b/x/staking/types/genesis.pb.go index fc9b8d48a237..f11448eaa9f7 100644 --- a/x/staking/types/genesis.pb.go +++ b/x/staking/types/genesis.pb.go @@ -4,9 +4,9 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-proto" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" @@ -32,7 +32,7 @@ type GenesisState struct { Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` // last_total_power tracks the total amounts of bonded tokens recorded during // the previous end block. - LastTotalPower github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=last_total_power,json=lastTotalPower,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"last_total_power"` + LastTotalPower cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=last_total_power,json=lastTotalPower,proto3,customtype=cosmossdk.io/math.Int" json:"last_total_power"` // last_validator_powers is a special index that provides a historical list // of the last-block's bonded validators. LastValidatorPowers []LastValidatorPower `protobuf:"bytes,3,rep,name=last_validator_powers,json=lastValidatorPowers,proto3" json:"last_validator_powers"` @@ -44,7 +44,8 @@ type GenesisState struct { UnbondingDelegations []UnbondingDelegation `protobuf:"bytes,6,rep,name=unbonding_delegations,json=unbondingDelegations,proto3" json:"unbonding_delegations"` // redelegations defines the redelegations active at genesis. Redelegations []Redelegation `protobuf:"bytes,7,rep,name=redelegations,proto3" json:"redelegations"` - Exported bool `protobuf:"varint,8,opt,name=exported,proto3" json:"exported,omitempty"` + // exported defines a bool to identify whether the chain dealing with exported or initialized genesis. + Exported bool `protobuf:"varint,8,opt,name=exported,proto3" json:"exported,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -180,39 +181,40 @@ func init() { } var fileDescriptor_9b3dec8894f2831b = []byte{ - // 503 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x93, 0x31, 0x6f, 0xd3, 0x40, - 0x1c, 0xc5, 0x6d, 0x42, 0xd2, 0xf4, 0x52, 0x10, 0x1c, 0x29, 0x32, 0x19, 0x9c, 0x10, 0x55, 0x28, - 0x2a, 0xd4, 0x56, 0xd3, 0x8d, 0xad, 0x11, 0x02, 0x21, 0x55, 0xa2, 0x72, 0x29, 0x03, 0x12, 0x8a, - 0x2e, 0xf5, 0xc9, 0x3d, 0xc5, 0xb9, 0xb3, 0x7c, 0xff, 0x94, 0xf2, 0x0d, 0x18, 0x99, 0x99, 0x3a, - 0x32, 0x32, 0xf0, 0x21, 0x3a, 0x56, 0x4c, 0x88, 0xa1, 0x42, 0xc9, 0x00, 0x1f, 0x03, 0xf9, 0xce, - 0x31, 0x87, 0x52, 0x77, 0x49, 0x7c, 0xfe, 0xbf, 0xf7, 0x7b, 0x4f, 0xf2, 0xff, 0xd0, 0xc6, 0x91, - 0x90, 0x13, 0x21, 0x7d, 0x09, 0x64, 0xcc, 0x78, 0xe4, 0x9f, 0x6c, 0x8f, 0x28, 0x90, 0x6d, 0x3f, - 0xa2, 0x9c, 0x4a, 0x26, 0xbd, 0x24, 0x15, 0x20, 0xf0, 0x7d, 0xad, 0xf2, 0x72, 0x95, 0x97, 0xab, - 0x5a, 0xcd, 0x48, 0x44, 0x42, 0x49, 0xfc, 0xec, 0x49, 0xab, 0x5b, 0x65, 0xcc, 0x85, 0x5b, 0xab, - 0x1e, 0x68, 0xd5, 0x50, 0xdb, 0xf3, 0x00, 0x3d, 0xba, 0x4b, 0x26, 0x8c, 0x0b, 0x5f, 0xfd, 0xea, - 0x57, 0xdd, 0xcf, 0x55, 0xb4, 0xf6, 0x42, 0x77, 0x3a, 0x00, 0x02, 0x14, 0xef, 0xa2, 0x5a, 0x42, - 0x52, 0x32, 0x91, 0x8e, 0xdd, 0xb1, 0x7b, 0x8d, 0xbe, 0xeb, 0x5d, 0xdd, 0xd1, 0xdb, 0x57, 0xaa, - 0xc1, 0xea, 0xf9, 0x65, 0xdb, 0xfa, 0xf2, 0xfb, 0xeb, 0xa6, 0x1d, 0xe4, 0x46, 0xfc, 0x0e, 0xdd, - 0x89, 0x89, 0x84, 0x21, 0x08, 0x20, 0xf1, 0x30, 0x11, 0xef, 0x69, 0xea, 0xdc, 0xe8, 0xd8, 0xbd, - 0xb5, 0xc1, 0x4e, 0x26, 0xfe, 0x79, 0xd9, 0x7e, 0x14, 0x31, 0x38, 0x9e, 0x8e, 0xbc, 0x23, 0x31, - 0xc9, 0x1b, 0xe6, 0x7f, 0x5b, 0x32, 0x1c, 0xfb, 0xf0, 0x21, 0xa1, 0xd2, 0x7b, 0xc9, 0x41, 0x63, - 0x6f, 0x67, 0xb0, 0xd7, 0x19, 0x6b, 0x3f, 0x43, 0x61, 0x86, 0xd6, 0x15, 0xfe, 0x84, 0xc4, 0x2c, - 0x24, 0x20, 0x52, 0x1d, 0x21, 0x9d, 0x4a, 0xa7, 0xd2, 0x6b, 0xf4, 0x37, 0xcb, 0x0a, 0xef, 0x11, - 0x09, 0x6f, 0x16, 0x1e, 0x85, 0x32, 0xcb, 0xdf, 0x8b, 0x97, 0xc6, 0x12, 0xef, 0x21, 0x54, 0xa4, - 0x48, 0xe7, 0xa6, 0xe2, 0x3f, 0x2c, 0xe3, 0x17, 0x66, 0x13, 0x6b, 0xf8, 0xf1, 0x2b, 0xd4, 0x08, - 0x69, 0x4c, 0x23, 0x02, 0x4c, 0x70, 0xe9, 0x54, 0x15, 0xae, 0x5b, 0x86, 0x7b, 0x56, 0x48, 0x4d, - 0x9e, 0x49, 0xc0, 0x63, 0xb4, 0x3e, 0xe5, 0x23, 0xc1, 0x43, 0xc6, 0xa3, 0xa1, 0x89, 0xae, 0x29, - 0xf4, 0xe3, 0x32, 0xf4, 0xe1, 0xc2, 0x74, 0x75, 0x46, 0x73, 0xba, 0x3c, 0x97, 0xf8, 0x10, 0xdd, - 0x4a, 0xa9, 0x19, 0xb2, 0xa2, 0x42, 0x36, 0xca, 0x42, 0x02, 0x43, 0x6c, 0xd2, 0xff, 0xa7, 0xe0, - 0x16, 0xaa, 0xd3, 0xd3, 0x44, 0xa4, 0x40, 0x43, 0xa7, 0xde, 0xb1, 0x7b, 0xf5, 0xa0, 0x38, 0x77, - 0x8f, 0x11, 0x5e, 0xfe, 0x68, 0xb8, 0x8f, 0x56, 0x48, 0x18, 0xa6, 0x54, 0xea, 0x15, 0x5d, 0x1d, - 0x38, 0xdf, 0xbf, 0x6d, 0x35, 0xf3, 0x16, 0xbb, 0x7a, 0x72, 0x00, 0x29, 0xe3, 0x51, 0xb0, 0x10, - 0xe2, 0x26, 0xaa, 0xfe, 0xdb, 0xc3, 0x4a, 0xa0, 0x0f, 0x4f, 0xeb, 0x1f, 0xcf, 0xda, 0xd6, 0x9f, - 0xb3, 0xb6, 0x35, 0x78, 0x7e, 0x3e, 0x73, 0xed, 0x8b, 0x99, 0x6b, 0xff, 0x9a, 0xb9, 0xf6, 0xa7, - 0xb9, 0x6b, 0x5d, 0xcc, 0x5d, 0xeb, 0xc7, 0xdc, 0xb5, 0xde, 0x3e, 0xb9, 0x76, 0x55, 0x4f, 0x8b, - 0xcb, 0xa8, 0x96, 0x76, 0x54, 0x53, 0xb7, 0x6a, 0xe7, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe5, - 0x05, 0x1a, 0xb6, 0xff, 0x03, 0x00, 0x00, + // 513 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x93, 0x31, 0x6f, 0xd3, 0x40, + 0x18, 0x86, 0x6d, 0x4a, 0xd2, 0xf4, 0x52, 0x10, 0x1c, 0x09, 0x32, 0x19, 0x9c, 0x10, 0x75, 0x88, + 0x0a, 0xb1, 0x69, 0xd8, 0xd8, 0x1a, 0x21, 0x50, 0xa5, 0x4a, 0x54, 0x2e, 0x65, 0xe8, 0x12, 0x5d, + 0xea, 0x93, 0x73, 0x8a, 0x7d, 0x67, 0xf9, 0xbe, 0x94, 0xf2, 0x0f, 0x18, 0xd9, 0x58, 0x3b, 0x32, + 0x32, 0xf4, 0x47, 0x74, 0xac, 0x3a, 0x21, 0x86, 0x0a, 0x25, 0x03, 0xfc, 0x0c, 0xe4, 0x3b, 0xc7, + 0x18, 0xa5, 0x5e, 0x92, 0x38, 0xdf, 0xf3, 0x3e, 0xef, 0x27, 0xf9, 0x0e, 0x6d, 0x9d, 0x08, 0x19, + 0x09, 0xe9, 0x4a, 0x20, 0x53, 0xc6, 0x03, 0xf7, 0x74, 0x67, 0x4c, 0x81, 0xec, 0xb8, 0x01, 0xe5, + 0x54, 0x32, 0xe9, 0xc4, 0x89, 0x00, 0x81, 0x1f, 0x6b, 0xca, 0xc9, 0x28, 0x27, 0xa3, 0x5a, 0x8d, + 0x40, 0x04, 0x42, 0x21, 0x6e, 0xfa, 0x4b, 0xd3, 0xad, 0x32, 0xe7, 0x32, 0xad, 0xa9, 0x27, 0x9a, + 0x1a, 0xe9, 0x78, 0x56, 0xa0, 0x47, 0x0f, 0x49, 0xc4, 0xb8, 0x70, 0xd5, 0xa7, 0xfe, 0xab, 0xfb, + 0xb5, 0x82, 0x36, 0xdf, 0xea, 0x9d, 0x0e, 0x81, 0x00, 0xc5, 0xbb, 0xa8, 0x1a, 0x93, 0x84, 0x44, + 0xd2, 0x32, 0x3b, 0x66, 0xaf, 0x3e, 0xb0, 0x9d, 0xdb, 0x77, 0x74, 0x0e, 0x14, 0x35, 0xdc, 0xb8, + 0xbc, 0x69, 0x1b, 0xdf, 0x7e, 0x7f, 0xdf, 0x36, 0xbd, 0x2c, 0x88, 0x8f, 0xd1, 0x83, 0x90, 0x48, + 0x18, 0x81, 0x00, 0x12, 0x8e, 0x62, 0xf1, 0x91, 0x26, 0xd6, 0x9d, 0x8e, 0xd9, 0xdb, 0x1c, 0xbe, + 0x48, 0xe1, 0x9f, 0x37, 0xed, 0xa6, 0x76, 0x4a, 0x7f, 0xea, 0x30, 0xe1, 0x46, 0x04, 0x26, 0xce, + 0x1e, 0x87, 0xeb, 0x8b, 0x3e, 0xca, 0xca, 0xf6, 0x38, 0x68, 0xe7, 0xfd, 0xd4, 0xf4, 0x3e, 0x15, + 0x1d, 0xa4, 0x1e, 0xcc, 0x50, 0x53, 0xb9, 0x4f, 0x49, 0xc8, 0x7c, 0x02, 0x22, 0xd1, 0x7e, 0x69, + 0xad, 0x75, 0xd6, 0x7a, 0xf5, 0xc1, 0x76, 0xd9, 0xb6, 0xfb, 0x44, 0xc2, 0x87, 0x65, 0x46, 0xa9, + 0x8a, 0x9b, 0x3f, 0x0a, 0x57, 0xc6, 0x12, 0xef, 0x23, 0x94, 0xb7, 0x48, 0xeb, 0xae, 0xf2, 0x3f, + 0x2d, 0xf3, 0xe7, 0xe1, 0xa2, 0xb6, 0x90, 0xc7, 0xef, 0x50, 0xdd, 0xa7, 0x21, 0x0d, 0x08, 0x30, + 0xc1, 0xa5, 0x55, 0x51, 0xba, 0x6e, 0x99, 0xee, 0x75, 0x8e, 0x16, 0x7d, 0x45, 0x03, 0x9e, 0xa2, + 0xe6, 0x8c, 0x8f, 0x05, 0xf7, 0x19, 0x0f, 0x46, 0x45, 0x75, 0x55, 0xa9, 0x9f, 0x95, 0xa9, 0x8f, + 0x96, 0xa1, 0xdb, 0x3b, 0x1a, 0xb3, 0xd5, 0xb9, 0xc4, 0x47, 0xe8, 0x5e, 0x42, 0x8b, 0x25, 0xeb, + 0xaa, 0x64, 0xab, 0xac, 0xc4, 0x2b, 0xc0, 0x45, 0xfb, 0xff, 0x16, 0xdc, 0x42, 0x35, 0x7a, 0x16, + 0x8b, 0x04, 0xa8, 0x6f, 0xd5, 0x3a, 0x66, 0xaf, 0xe6, 0xe5, 0xcf, 0xdd, 0x09, 0xc2, 0xab, 0x2f, + 0x0d, 0x0f, 0xd0, 0x3a, 0xf1, 0xfd, 0x84, 0x4a, 0x7d, 0x3e, 0x37, 0x86, 0xd6, 0xf5, 0x45, 0xbf, + 0x91, 0x6d, 0xb1, 0xab, 0x27, 0x87, 0x90, 0x30, 0x1e, 0x78, 0x4b, 0x10, 0x37, 0x50, 0xe5, 0xdf, + 0x21, 0x5c, 0xf3, 0xf4, 0xc3, 0xab, 0xda, 0xe7, 0xf3, 0xb6, 0xf1, 0xe7, 0xbc, 0x6d, 0x0c, 0xdf, + 0x5c, 0xce, 0x6d, 0xf3, 0x6a, 0x6e, 0x9b, 0xbf, 0xe6, 0xb6, 0xf9, 0x65, 0x61, 0x1b, 0x57, 0x0b, + 0xdb, 0xf8, 0xb1, 0xb0, 0x8d, 0xe3, 0xe7, 0x01, 0x83, 0xc9, 0x6c, 0xec, 0x9c, 0x88, 0x28, 0xbb, + 0x49, 0xd9, 0x57, 0x5f, 0xfa, 0x53, 0xf7, 0x2c, 0xbf, 0x89, 0xf0, 0x29, 0xa6, 0x72, 0x5c, 0x55, + 0x57, 0xea, 0xe5, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x57, 0x29, 0x7a, 0x5e, 0xfc, 0x03, 0x00, + 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/staking/types/historical_info.go b/x/staking/types/historical_info.go index bfdbf454fa6e..e6652b47dcad 100644 --- a/x/staking/types/historical_info.go +++ b/x/staking/types/historical_info.go @@ -3,12 +3,12 @@ package types import ( "sort" - "cosmossdk.io/math" - cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/gogoproto/proto" + "cosmossdk.io/core/address" "cosmossdk.io/errors" + "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -18,13 +18,13 @@ import ( // it will first sort valset before inclusion into historical info func NewHistoricalInfo(header cmtproto.Header, valSet Validators, powerReduction math.Int) HistoricalInfo { // Must sort in the same way that CometBFT does - sort.SliceStable(valSet, func(i, j int) bool { - return ValidatorsByVotingPower(valSet).Less(i, j, powerReduction) + sort.SliceStable(valSet.Validators, func(i, j int) bool { + return ValidatorsByVotingPower(valSet.Validators).Less(i, j, powerReduction) }) return HistoricalInfo{ Header: header, - Valset: valSet, + Valset: valSet.Validators, } } @@ -45,12 +45,12 @@ func UnmarshalHistoricalInfo(cdc codec.BinaryCodec, value []byte) (hi Historical } // ValidateBasic will ensure HistoricalInfo is not nil and sorted -func ValidateBasic(hi HistoricalInfo) error { +func ValidateBasic(hi HistoricalInfo, valAc address.Codec) error { if len(hi.Valset) == 0 { return errors.Wrap(ErrInvalidHistoricalInfo, "validator set is empty") } - if !sort.IsSorted(Validators(hi.Valset)) { + if !sort.IsSorted(Validators{Validators: hi.Valset, ValidatorCodec: valAc}) { return errors.Wrap(ErrInvalidHistoricalInfo, "validator set is not sorted by address") } diff --git a/x/staking/types/historical_info_test.go b/x/staking/types/historical_info_test.go index 90b4872733a8..064ea4d5219d 100644 --- a/x/staking/types/historical_info_test.go +++ b/x/staking/types/historical_info_test.go @@ -5,12 +5,12 @@ import ( "sort" "testing" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/codec/legacy" - cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" + "github.com/cosmos/cosmos-sdk/codec" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" + "github.com/cosmos/cosmos-sdk/codec/legacy" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -30,8 +30,10 @@ func createValidators(t *testing.T) []types.Validator { func TestHistoricalInfo(t *testing.T) { validators := createValidators(t) - hi := types.NewHistoricalInfo(header, validators, sdk.DefaultPowerReduction) - require.True(t, sort.IsSorted(types.Validators(hi.Valset)), "Validators are not sorted") + + vals := types.Validators{Validators: validators, ValidatorCodec: addresscodec.NewBech32Codec("cosmosvaloper")} + hi := types.NewHistoricalInfo(header, vals, sdk.DefaultPowerReduction) + require.True(t, sort.IsSorted(vals), "Validators are not sorted") var value []byte require.NotPanics(t, func() { @@ -45,7 +47,7 @@ func TestHistoricalInfo(t *testing.T) { for i := range hi.Valset { require.True(t, hi.Valset[i].Equal(&recv.Valset[i])) } - require.True(t, sort.IsSorted(types.Validators(hi.Valset)), "Validators are not sorted") + require.True(t, sort.IsSorted(vals), "Validators are not sorted") } func TestValidateBasic(t *testing.T) { @@ -53,11 +55,12 @@ func TestValidateBasic(t *testing.T) { hi := types.HistoricalInfo{ Header: header, } - err := types.ValidateBasic(hi) + ac := addresscodec.NewBech32Codec("cosmosvaloper") + err := types.ValidateBasic(hi, ac) require.Error(t, err, "ValidateBasic passed on nil ValSet") // Ensure validators are not sorted - for sort.IsSorted(types.Validators(validators)) { + for sort.IsSorted(types.Validators{Validators: validators, ValidatorCodec: ac}) { rand.Shuffle(len(validators), func(i, j int) { validators[i], validators[j] = validators[j], validators[i] }) @@ -66,10 +69,10 @@ func TestValidateBasic(t *testing.T) { Header: header, Valset: validators, } - err = types.ValidateBasic(hi) + err = types.ValidateBasic(hi, ac) require.Error(t, err, "ValidateBasic passed on unsorted ValSet") - hi = types.NewHistoricalInfo(header, validators, sdk.DefaultPowerReduction) - err = types.ValidateBasic(hi) + hi = types.NewHistoricalInfo(header, types.Validators{Validators: validators, ValidatorCodec: ac}, sdk.DefaultPowerReduction) + err = types.ValidateBasic(hi, ac) require.NoError(t, err, "ValidateBasic failed on valid HistoricalInfo") } diff --git a/x/staking/types/hooks.go b/x/staking/types/hooks.go index bdc1ffd7776c..8a052d9514a1 100644 --- a/x/staking/types/hooks.go +++ b/x/staking/types/hooks.go @@ -1,6 +1,8 @@ package types import ( + context "context" + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" @@ -15,7 +17,7 @@ func NewMultiStakingHooks(hooks ...StakingHooks) MultiStakingHooks { return hooks } -func (h MultiStakingHooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) error { +func (h MultiStakingHooks) AfterValidatorCreated(ctx context.Context, valAddr sdk.ValAddress) error { for i := range h { if err := h[i].AfterValidatorCreated(ctx, valAddr); err != nil { return err @@ -25,7 +27,7 @@ func (h MultiStakingHooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.Va return nil } -func (h MultiStakingHooks) BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress) error { +func (h MultiStakingHooks) BeforeValidatorModified(ctx context.Context, valAddr sdk.ValAddress) error { for i := range h { if err := h[i].BeforeValidatorModified(ctx, valAddr); err != nil { return err @@ -34,7 +36,7 @@ func (h MultiStakingHooks) BeforeValidatorModified(ctx sdk.Context, valAddr sdk. return nil } -func (h MultiStakingHooks) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error { +func (h MultiStakingHooks) AfterValidatorRemoved(ctx context.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error { for i := range h { if err := h[i].AfterValidatorRemoved(ctx, consAddr, valAddr); err != nil { return err @@ -43,7 +45,7 @@ func (h MultiStakingHooks) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.C return nil } -func (h MultiStakingHooks) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error { +func (h MultiStakingHooks) AfterValidatorBonded(ctx context.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error { for i := range h { if err := h[i].AfterValidatorBonded(ctx, consAddr, valAddr); err != nil { return err @@ -52,7 +54,7 @@ func (h MultiStakingHooks) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.Co return nil } -func (h MultiStakingHooks) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error { +func (h MultiStakingHooks) AfterValidatorBeginUnbonding(ctx context.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error { for i := range h { if err := h[i].AfterValidatorBeginUnbonding(ctx, consAddr, valAddr); err != nil { return err @@ -61,7 +63,7 @@ func (h MultiStakingHooks) AfterValidatorBeginUnbonding(ctx sdk.Context, consAdd return nil } -func (h MultiStakingHooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { +func (h MultiStakingHooks) BeforeDelegationCreated(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { for i := range h { if err := h[i].BeforeDelegationCreated(ctx, delAddr, valAddr); err != nil { return err @@ -70,7 +72,7 @@ func (h MultiStakingHooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk. return nil } -func (h MultiStakingHooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { +func (h MultiStakingHooks) BeforeDelegationSharesModified(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { for i := range h { if err := h[i].BeforeDelegationSharesModified(ctx, delAddr, valAddr); err != nil { return err @@ -79,7 +81,7 @@ func (h MultiStakingHooks) BeforeDelegationSharesModified(ctx sdk.Context, delAd return nil } -func (h MultiStakingHooks) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { +func (h MultiStakingHooks) BeforeDelegationRemoved(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { for i := range h { if err := h[i].BeforeDelegationRemoved(ctx, delAddr, valAddr); err != nil { return err @@ -88,7 +90,7 @@ func (h MultiStakingHooks) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk. return nil } -func (h MultiStakingHooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { +func (h MultiStakingHooks) AfterDelegationModified(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { for i := range h { if err := h[i].AfterDelegationModified(ctx, delAddr, valAddr); err != nil { return err @@ -97,7 +99,7 @@ func (h MultiStakingHooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk. return nil } -func (h MultiStakingHooks) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdkmath.LegacyDec) error { +func (h MultiStakingHooks) BeforeValidatorSlashed(ctx context.Context, valAddr sdk.ValAddress, fraction sdkmath.LegacyDec) error { for i := range h { if err := h[i].BeforeValidatorSlashed(ctx, valAddr, fraction); err != nil { return err @@ -106,7 +108,7 @@ func (h MultiStakingHooks) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.V return nil } -func (h MultiStakingHooks) AfterUnbondingInitiated(ctx sdk.Context, id uint64) error { +func (h MultiStakingHooks) AfterUnbondingInitiated(ctx context.Context, id uint64) error { for i := range h { if err := h[i].AfterUnbondingInitiated(ctx, id); err != nil { return err diff --git a/x/staking/types/keys.go b/x/staking/types/keys.go index 4c905e1110c3..598aa332b312 100644 --- a/x/staking/types/keys.go +++ b/x/staking/types/keys.go @@ -6,6 +6,7 @@ import ( "fmt" "time" + addresscodec "cosmossdk.io/core/address" "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" @@ -110,7 +111,7 @@ func AddressFromLastValidatorPowerKey(key []byte) []byte { // Power index is the key used in the power-store, and represents the relative // power ranking of the validator. // VALUE: validator operator address ([]byte) -func GetValidatorsByPowerIndexKey(validator Validator, powerReduction math.Int) []byte { +func GetValidatorsByPowerIndexKey(validator Validator, powerReduction math.Int, valAc addresscodec.Codec) []byte { // NOTE the address doesn't need to be stored because counter bytes must always be different // NOTE the larger values are of higher value @@ -121,7 +122,7 @@ func GetValidatorsByPowerIndexKey(validator Validator, powerReduction math.Int) powerBytes := consensusPowerBytes powerBytesLen := len(powerBytes) // 8 - addr, err := sdk.ValAddressFromBech32(validator.OperatorAddress) + addr, err := valAc.StringToBytes(validator.OperatorAddress) if err != nil { panic(err) } diff --git a/x/staking/types/keys_test.go b/x/staking/types/keys_test.go index ce3c55e45409..f9fa94979623 100644 --- a/x/staking/types/keys_test.go +++ b/x/staking/types/keys_test.go @@ -9,9 +9,11 @@ import ( "testing" "time" - "cosmossdk.io/math" "github.com/stretchr/testify/require" + "cosmossdk.io/math" + + "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -46,7 +48,7 @@ func TestGetValidatorPowerRank(t *testing.T) { {val4, "230000010000000000149c288ede7df62742fc3b7d0962045a8cef0f79f6"}, } for i, tt := range tests { - got := hex.EncodeToString(types.GetValidatorsByPowerIndexKey(tt.validator, sdk.DefaultPowerReduction)) + got := hex.EncodeToString(types.GetValidatorsByPowerIndexKey(tt.validator, sdk.DefaultPowerReduction, address.NewBech32Codec("cosmosvaloper"))) require.Equal(t, tt.wantHex, got, "Keys did not match on test case %d", i) } diff --git a/x/staking/types/msg.go b/x/staking/types/msg.go index 89012d1b5605..0119bc82adcc 100644 --- a/x/staking/types/msg.go +++ b/x/staking/types/msg.go @@ -1,6 +1,7 @@ package types import ( + "cosmossdk.io/core/address" errorsmod "cosmossdk.io/errors" "cosmossdk.io/math" @@ -24,7 +25,7 @@ var ( // NewMsgCreateValidator creates a new MsgCreateValidator instance. // Delegator address and validator address are the same. func NewMsgCreateValidator( - valAddr sdk.ValAddress, pubKey cryptotypes.PubKey, + valAddr string, pubKey cryptotypes.PubKey, selfDelegation sdk.Coin, description Description, commission CommissionRates, minSelfDelegation math.Int, ) (*MsgCreateValidator, error) { var pkAny *codectypes.Any @@ -36,7 +37,7 @@ func NewMsgCreateValidator( } return &MsgCreateValidator{ Description: description, - ValidatorAddress: valAddr.String(), + ValidatorAddress: valAddr, Pubkey: pkAny, Value: selfDelegation, Commission: commission, @@ -44,22 +45,10 @@ func NewMsgCreateValidator( }, nil } -// GetSigners implements the sdk.Msg interface. It returns the address(es) that -// must sign over msg.GetSignBytes(). -// If the validator address is not same as delegator's, then the validator must -// sign the msg as well. -func (msg MsgCreateValidator) GetSigners() []sdk.AccAddress { - valAddr, _ := sdk.ValAddressFromBech32(msg.ValidatorAddress) - - valAccAddr := sdk.AccAddress(valAddr) - - return []sdk.AccAddress{valAccAddr} -} - // Validate validates the MsgCreateValidator sdk msg. -func (msg MsgCreateValidator) Validate() error { +func (msg MsgCreateValidator) Validate(ac address.Codec) error { // note that unmarshaling from bech32 ensures both non-empty and valid - _, err := sdk.ValAddressFromBech32(msg.ValidatorAddress) + _, err := ac.StringToBytes(msg.ValidatorAddress) if err != nil { return sdkerrors.ErrInvalidAddress.Wrapf("invalid validator address: %s", err) } @@ -105,87 +94,51 @@ func (msg MsgCreateValidator) UnpackInterfaces(unpacker codectypes.AnyUnpacker) } // NewMsgEditValidator creates a new MsgEditValidator instance -func NewMsgEditValidator(valAddr sdk.ValAddress, description Description, newRate *math.LegacyDec, newMinSelfDelegation *math.Int) *MsgEditValidator { +func NewMsgEditValidator(valAddr string, description Description, newRate *math.LegacyDec, newMinSelfDelegation *math.Int) *MsgEditValidator { return &MsgEditValidator{ Description: description, CommissionRate: newRate, - ValidatorAddress: valAddr.String(), + ValidatorAddress: valAddr, MinSelfDelegation: newMinSelfDelegation, } } -// GetSigners implements the sdk.Msg interface. -func (msg MsgEditValidator) GetSigners() []sdk.AccAddress { - valAddr, _ := sdk.ValAddressFromBech32(msg.ValidatorAddress) - return []sdk.AccAddress{sdk.AccAddress(valAddr)} -} - // NewMsgDelegate creates a new MsgDelegate instance. -func NewMsgDelegate(delAddr sdk.AccAddress, valAddr sdk.ValAddress, amount sdk.Coin) *MsgDelegate { +func NewMsgDelegate(delAddr, valAddr string, amount sdk.Coin) *MsgDelegate { return &MsgDelegate{ - DelegatorAddress: delAddr.String(), - ValidatorAddress: valAddr.String(), + DelegatorAddress: delAddr, + ValidatorAddress: valAddr, Amount: amount, } } -// GetSigners implements the sdk.Msg interface. -func (msg MsgDelegate) GetSigners() []sdk.AccAddress { - delegator, _ := sdk.AccAddressFromBech32(msg.DelegatorAddress) - return []sdk.AccAddress{delegator} -} - // NewMsgBeginRedelegate creates a new MsgBeginRedelegate instance. func NewMsgBeginRedelegate( - delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress, amount sdk.Coin, + delAddr, valSrcAddr, valDstAddr string, amount sdk.Coin, ) *MsgBeginRedelegate { return &MsgBeginRedelegate{ - DelegatorAddress: delAddr.String(), - ValidatorSrcAddress: valSrcAddr.String(), - ValidatorDstAddress: valDstAddr.String(), + DelegatorAddress: delAddr, + ValidatorSrcAddress: valSrcAddr, + ValidatorDstAddress: valDstAddr, Amount: amount, } } -// GetSigners implements the sdk.Msg interface -func (msg MsgBeginRedelegate) GetSigners() []sdk.AccAddress { - delegator, _ := sdk.AccAddressFromBech32(msg.DelegatorAddress) - return []sdk.AccAddress{delegator} -} - // NewMsgUndelegate creates a new MsgUndelegate instance. -func NewMsgUndelegate(delAddr sdk.AccAddress, valAddr sdk.ValAddress, amount sdk.Coin) *MsgUndelegate { +func NewMsgUndelegate(delAddr, valAddr string, amount sdk.Coin) *MsgUndelegate { return &MsgUndelegate{ - DelegatorAddress: delAddr.String(), - ValidatorAddress: valAddr.String(), + DelegatorAddress: delAddr, + ValidatorAddress: valAddr, Amount: amount, } } -// GetSigners implements the sdk.Msg interface. -func (msg MsgUndelegate) GetSigners() []sdk.AccAddress { - delegator, _ := sdk.AccAddressFromBech32(msg.DelegatorAddress) - return []sdk.AccAddress{delegator} -} - // NewMsgCancelUnbondingDelegation creates a new MsgCancelUnbondingDelegation instance. -func NewMsgCancelUnbondingDelegation(delAddr sdk.AccAddress, valAddr sdk.ValAddress, creationHeight int64, amount sdk.Coin) *MsgCancelUnbondingDelegation { +func NewMsgCancelUnbondingDelegation(delAddr, valAddr string, creationHeight int64, amount sdk.Coin) *MsgCancelUnbondingDelegation { return &MsgCancelUnbondingDelegation{ - DelegatorAddress: delAddr.String(), - ValidatorAddress: valAddr.String(), + DelegatorAddress: delAddr, + ValidatorAddress: valAddr, Amount: amount, CreationHeight: creationHeight, } } - -// GetSigners implements the sdk.Msg interface. -func (msg MsgCancelUnbondingDelegation) GetSigners() []sdk.AccAddress { - delegator, _ := sdk.AccAddressFromBech32(msg.DelegatorAddress) - return []sdk.AccAddress{delegator} -} - -// GetSigners returns the expected signers for a MsgUpdateParams message -func (m MsgUpdateParams) GetSigners() []sdk.AccAddress { - addr, _ := sdk.AccAddressFromBech32(m.Authority) - return []sdk.AccAddress{addr} -} diff --git a/x/staking/types/msg_test.go b/x/staking/types/msg_test.go index a59a897bc42a..23f5047de186 100644 --- a/x/staking/types/msg_test.go +++ b/x/staking/types/msg_test.go @@ -3,10 +3,10 @@ package types_test import ( "testing" - "cosmossdk.io/math" - "github.com/stretchr/testify/require" + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" @@ -36,7 +36,7 @@ func TestMsgDecode(t *testing.T) { // now let's try to serialize the whole message commission1 := types.NewCommissionRates(math.LegacyZeroDec(), math.LegacyZeroDec(), math.LegacyZeroDec()) - msg, err := types.NewMsgCreateValidator(valAddr1, pk1, coinPos, types.Description{}, commission1, math.OneInt()) + msg, err := types.NewMsgCreateValidator(valAddr1.String(), pk1, coinPos, types.Description{}, commission1, math.OneInt()) require.NoError(t, err) msgSerialized, err := cdc.MarshalInterface(msg) require.NoError(t, err) diff --git a/x/staking/types/params_test.go b/x/staking/types/params_test.go index a5bf8454358c..2599d385d7ae 100644 --- a/x/staking/types/params_test.go +++ b/x/staking/types/params_test.go @@ -3,9 +3,10 @@ package types_test import ( "testing" - "cosmossdk.io/math" "github.com/stretchr/testify/require" + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/x/staking/types" ) diff --git a/x/staking/types/query.pb.go b/x/staking/types/query.pb.go index 9509670a3425..2cae9f8bf252 100644 --- a/x/staking/types/query.pb.go +++ b/x/staking/types/query.pb.go @@ -1427,93 +1427,94 @@ func init() { } var fileDescriptor_f270127f442bbcd8 = []byte{ - // 1373 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x59, 0xdb, 0x6f, 0x14, 0x65, - 0x1b, 0xdf, 0xb7, 0xf4, 0x6b, 0xbe, 0x3e, 0x04, 0x02, 0xef, 0x2e, 0xb5, 0x0c, 0xb8, 0xbb, 0x4c, - 0x08, 0xf6, 0x40, 0x77, 0x6c, 0x8b, 0x50, 0x31, 0x0a, 0x5b, 0x09, 0x8a, 0x10, 0x2c, 0x6b, 0x6c, - 0xf0, 0x94, 0x66, 0xda, 0x19, 0x66, 0x27, 0x6c, 0x67, 0x96, 0x79, 0xa7, 0x0d, 0xa4, 0x69, 0x4c, - 0xbc, 0x30, 0x5c, 0x19, 0x13, 0xef, 0x0d, 0x17, 0x5e, 0x18, 0xc5, 0xa4, 0x17, 0x98, 0xe8, 0x0d, - 0x97, 0x86, 0x0b, 0x63, 0x88, 0x06, 0xa3, 0x37, 0x68, 0x5a, 0x13, 0xbd, 0xf1, 0x3f, 0x30, 0xc6, - 0xec, 0xcc, 0x33, 0xa7, 0xce, 0x71, 0xb7, 0xdb, 0xa4, 0xdc, 0xc0, 0xee, 0x3b, 0xcf, 0xe1, 0xf7, - 0x7b, 0x0e, 0xef, 0x3c, 0xcf, 0x16, 0xf8, 0x05, 0x9d, 0x2d, 0xea, 0x4c, 0x60, 0xa6, 0x78, 0x5d, - 0xd5, 0x14, 0x61, 0x79, 0x7c, 0x5e, 0x36, 0xc5, 0x71, 0xe1, 0xc6, 0x92, 0x6c, 0xdc, 0xaa, 0x34, - 0x0d, 0xdd, 0xd4, 0xe9, 0x80, 0x2d, 0x53, 0x41, 0x99, 0x0a, 0xca, 0x70, 0x23, 0xa8, 0x3b, 0x2f, - 0x32, 0xd9, 0x56, 0x70, 0xd5, 0x9b, 0xa2, 0xa2, 0x6a, 0xa2, 0xa9, 0xea, 0x9a, 0x6d, 0x83, 0x2b, - 0x28, 0xba, 0xa2, 0x5b, 0x1f, 0x85, 0xd6, 0x27, 0x3c, 0x3d, 0xac, 0xe8, 0xba, 0xd2, 0x90, 0x05, - 0xb1, 0xa9, 0x0a, 0xa2, 0xa6, 0xe9, 0xa6, 0xa5, 0xc2, 0xf0, 0xe9, 0xd1, 0x18, 0x6c, 0x0e, 0x0e, - 0x5b, 0xea, 0xa0, 0x2d, 0x35, 0x67, 0x1b, 0x47, 0xa8, 0xf6, 0xa3, 0x43, 0x68, 0xc0, 0xc1, 0xe6, - 0x67, 0xc5, 0xed, 0x17, 0x17, 0x55, 0x4d, 0x17, 0xac, 0x7f, 0xed, 0x23, 0xfe, 0x26, 0x0c, 0x5c, - 0x69, 0x49, 0xcc, 0x8a, 0x0d, 0x55, 0x12, 0x4d, 0xdd, 0x60, 0x35, 0xf9, 0xc6, 0x92, 0xcc, 0x4c, - 0x3a, 0x00, 0x7d, 0xcc, 0x14, 0xcd, 0x25, 0x36, 0x48, 0xca, 0x64, 0xa8, 0xbf, 0x86, 0xdf, 0xe8, - 0x79, 0x00, 0x8f, 0xea, 0x60, 0x4f, 0x99, 0x0c, 0xed, 0x9e, 0x38, 0x56, 0x41, 0x10, 0xad, 0xb8, - 0x54, 0x6c, 0x97, 0x08, 0xbd, 0x32, 0x23, 0x2a, 0x32, 0xda, 0xac, 0xf9, 0x34, 0xf9, 0x35, 0x02, - 0x4f, 0x85, 0x5c, 0xb3, 0xa6, 0xae, 0x31, 0x99, 0x5e, 0x02, 0x58, 0x76, 0x4f, 0x07, 0x49, 0x79, - 0xd7, 0xd0, 0xee, 0x89, 0x23, 0x95, 0xe8, 0x9c, 0x54, 0x5c, 0xfd, 0xe9, 0xfe, 0x07, 0x8f, 0x4b, - 0xb9, 0xcf, 0xff, 0x5c, 0x1b, 0x21, 0x35, 0x9f, 0x3e, 0x7d, 0x25, 0x02, 0xf1, 0x33, 0xa9, 0x88, - 0x6d, 0x28, 0x01, 0xc8, 0x57, 0xe1, 0x40, 0x10, 0xb1, 0x13, 0xab, 0x33, 0xb0, 0xd7, 0xf5, 0x37, - 0x27, 0x4a, 0x92, 0x61, 0xc7, 0x6c, 0x7a, 0xf0, 0xc7, 0x7b, 0x63, 0x05, 0x74, 0x54, 0x95, 0x24, - 0x43, 0x66, 0xec, 0x0d, 0xd3, 0x50, 0x35, 0xa5, 0xb6, 0xc7, 0x95, 0x6f, 0x9d, 0xf3, 0xd2, 0xe6, - 0x34, 0xb8, 0xa1, 0x78, 0x0d, 0xfa, 0x5d, 0x51, 0xcb, 0x6a, 0xbb, 0x91, 0xf0, 0xd4, 0xf9, 0x2f, - 0x09, 0x94, 0x83, 0x6e, 0xce, 0xc9, 0x0d, 0x59, 0xb1, 0x2b, 0xb0, 0x5b, 0x5c, 0xba, 0x56, 0x20, - 0x7f, 0x13, 0x38, 0x92, 0x80, 0x16, 0xe3, 0xf3, 0x3e, 0x14, 0x24, 0xf7, 0x78, 0xce, 0xc0, 0x63, - 0xa7, 0x68, 0x46, 0xe2, 0x42, 0xe5, 0x99, 0x72, 0x2c, 0x4d, 0x97, 0x5b, 0x31, 0xfb, 0xe2, 0xb7, - 0x52, 0x3e, 0xfc, 0x8c, 0xd9, 0xa1, 0xcc, 0x4b, 0xe1, 0x27, 0xdd, 0xab, 0xae, 0x7b, 0x04, 0x86, - 0x83, 0x7c, 0xdf, 0xd4, 0xe6, 0x75, 0x4d, 0x52, 0x35, 0x65, 0x27, 0xa7, 0xe9, 0x31, 0x81, 0x91, - 0x2c, 0xb0, 0x31, 0x5f, 0x0a, 0xe4, 0x97, 0x9c, 0xe7, 0xa1, 0x74, 0x8d, 0xc6, 0xa5, 0x2b, 0xc2, - 0xa4, 0xbf, 0xc6, 0xa9, 0x6b, 0x72, 0x1b, 0xf2, 0xf2, 0x19, 0xc1, 0xe6, 0xf4, 0xd7, 0x85, 0x9b, - 0x04, 0x2c, 0x89, 0xcc, 0x49, 0x70, 0xe5, 0xad, 0x24, 0x84, 0xb3, 0xd8, 0xd3, 0x56, 0x16, 0x4f, - 0xff, 0xff, 0xf6, 0x9d, 0x52, 0xee, 0xaf, 0x3b, 0xa5, 0x1c, 0xbf, 0x8c, 0xd7, 0x69, 0xb8, 0x7a, - 0xe9, 0x3b, 0x90, 0x8f, 0xe8, 0x11, 0xbc, 0x4d, 0xda, 0x68, 0x91, 0x1a, 0x0d, 0x37, 0x00, 0xff, - 0x15, 0x81, 0x92, 0xe5, 0x38, 0x22, 0x47, 0x3b, 0x31, 0x4e, 0x06, 0xde, 0x81, 0x91, 0x70, 0x31, - 0x60, 0x97, 0xa1, 0xcf, 0xae, 0x28, 0x8c, 0x51, 0xa7, 0x75, 0x89, 0x56, 0xf8, 0xaf, 0x9d, 0x8b, - 0xf7, 0x9c, 0xc3, 0x2a, 0xba, 0xa3, 0xb7, 0x16, 0xa4, 0x2e, 0x75, 0xb4, 0x2f, 0x56, 0x3f, 0x3b, - 0x57, 0x70, 0x34, 0x6e, 0x8c, 0x56, 0xbd, 0x6b, 0x57, 0xb0, 0x2f, 0x74, 0xdb, 0x7b, 0xd7, 0xde, - 0x77, 0xee, 0x5a, 0x97, 0x58, 0xca, 0x5d, 0xbb, 0xd3, 0x32, 0xe3, 0xde, 0xba, 0x29, 0x04, 0x9e, - 0xd8, 0x5b, 0xf7, 0x7e, 0x0f, 0x1c, 0xb4, 0x08, 0xd6, 0x64, 0x69, 0x5b, 0x32, 0x42, 0x99, 0xb1, - 0x30, 0xd7, 0xe6, 0xa5, 0xb2, 0x8f, 0x19, 0x0b, 0xb3, 0x9b, 0xde, 0xa2, 0x54, 0x62, 0xe6, 0x66, - 0x3b, 0xbb, 0xd2, 0xec, 0x48, 0xcc, 0x9c, 0x4d, 0x78, 0x1b, 0xf7, 0x76, 0xa1, 0x42, 0x1e, 0x11, - 0xe0, 0xa2, 0x02, 0x88, 0x15, 0xa1, 0xc1, 0x80, 0x21, 0x27, 0xb4, 0xed, 0xf1, 0xb8, 0xa2, 0xf0, - 0x9b, 0x8b, 0x6a, 0xdc, 0x03, 0x86, 0xbc, 0xdd, 0x63, 0x52, 0x29, 0x58, 0xf9, 0xe1, 0xdd, 0x65, - 0x07, 0x36, 0xec, 0xb7, 0xa1, 0x57, 0xc0, 0x93, 0xb3, 0xf7, 0xdc, 0x25, 0x50, 0x8c, 0xc1, 0xbe, - 0x13, 0xdf, 0xf0, 0x8b, 0xb1, 0x05, 0xb2, 0x2d, 0x5b, 0xd5, 0x09, 0xec, 0xb3, 0x57, 0x55, 0x66, - 0xea, 0x86, 0xba, 0x20, 0x36, 0x2e, 0x68, 0xd7, 0x74, 0xdf, 0x1a, 0x5d, 0x97, 0x55, 0xa5, 0x6e, - 0x5a, 0x6e, 0x76, 0xd5, 0xf0, 0x1b, 0xff, 0x16, 0x1c, 0x8a, 0xd4, 0x42, 0x80, 0xa7, 0xa1, 0xb7, - 0xae, 0x32, 0x13, 0xb1, 0x1d, 0x8b, 0xc3, 0xb6, 0x49, 0xdb, 0xd2, 0xe1, 0x29, 0xec, 0xb3, 0x4c, - 0xcf, 0xe8, 0x7a, 0x03, 0x61, 0xf0, 0x33, 0xb0, 0xdf, 0x77, 0x86, 0x4e, 0x5e, 0x80, 0xde, 0xa6, - 0xae, 0x37, 0xd0, 0xc9, 0xe1, 0x38, 0x27, 0x2d, 0x1d, 0x3f, 0x77, 0x4b, 0x89, 0x2f, 0x00, 0xb5, - 0x2d, 0x8a, 0x86, 0xb8, 0xe8, 0x74, 0x1e, 0x7f, 0x15, 0xf2, 0x81, 0x53, 0xf4, 0x54, 0x85, 0xbe, - 0xa6, 0x75, 0x82, 0xbe, 0x8a, 0xb1, 0xbe, 0x2c, 0xa9, 0xc0, 0x0c, 0x65, 0x2b, 0x4e, 0xac, 0x0d, - 0xc0, 0xff, 0x2c, 0xd3, 0xf4, 0x53, 0x02, 0xe0, 0x35, 0x0f, 0xad, 0xc4, 0xd9, 0x8a, 0xfe, 0x61, - 0x83, 0x13, 0x32, 0xcb, 0xe3, 0x84, 0x2b, 0xdc, 0x6e, 0x01, 0xf9, 0xe0, 0xa7, 0x3f, 0x3e, 0xe9, - 0x39, 0x4a, 0x79, 0x21, 0xe6, 0x27, 0x1a, 0x5f, 0xe3, 0xdd, 0x25, 0xd0, 0xef, 0xda, 0xa1, 0x63, - 0xd9, 0xfc, 0x39, 0xf0, 0x2a, 0x59, 0xc5, 0x11, 0xdd, 0x59, 0x0f, 0xdd, 0x73, 0x74, 0x32, 0x1d, - 0x9d, 0xb0, 0x12, 0xec, 0xb3, 0x55, 0xfa, 0x2b, 0x81, 0x42, 0xd4, 0x8e, 0x4d, 0xa7, 0xb2, 0x41, - 0x09, 0x4f, 0x4c, 0xdc, 0xf3, 0x1d, 0x68, 0x22, 0x9f, 0x4b, 0x1e, 0x9f, 0x2a, 0x3d, 0xd3, 0x01, - 0x1f, 0xc1, 0xf7, 0xba, 0xa3, 0xff, 0x12, 0x78, 0x3a, 0x71, 0x31, 0xa5, 0xd5, 0x6c, 0x50, 0x13, - 0xe6, 0x43, 0x6e, 0x7a, 0x2b, 0x26, 0x90, 0xf6, 0xac, 0x47, 0xfb, 0x22, 0xbd, 0xd0, 0x09, 0x6d, - 0x6f, 0xc0, 0xf3, 0x07, 0xe0, 0x7b, 0x02, 0xe0, 0xf9, 0x4b, 0x69, 0x96, 0xd0, 0xe6, 0x96, 0xd2, - 0x2c, 0xe1, 0x11, 0x9e, 0x7f, 0xcf, 0xe3, 0x51, 0xa3, 0x33, 0x5b, 0x4c, 0x9f, 0xb0, 0x12, 0x7c, - 0xa9, 0xac, 0xd2, 0x7f, 0x08, 0xe4, 0x23, 0xe2, 0x48, 0x4f, 0x25, 0xe2, 0x8c, 0x5f, 0x4d, 0xb9, - 0xa9, 0xf6, 0x15, 0x91, 0xa9, 0xe1, 0x31, 0x55, 0xa8, 0xdc, 0x6d, 0xa6, 0x91, 0xe9, 0xa4, 0x3f, - 0x10, 0x28, 0x44, 0xed, 0x62, 0x29, 0xad, 0x9a, 0xb0, 0x76, 0xa6, 0xb4, 0x6a, 0xd2, 0xe2, 0xc7, - 0x57, 0xbd, 0x08, 0x9c, 0xa4, 0x27, 0xe2, 0x22, 0x90, 0x98, 0xcf, 0x56, 0x7f, 0x26, 0xae, 0x30, - 0x29, 0xfd, 0x99, 0x65, 0x7f, 0x4b, 0xe9, 0xcf, 0x4c, 0x1b, 0x54, 0xc6, 0xfe, 0x74, 0xe9, 0x65, - 0x4c, 0x28, 0xa3, 0xdf, 0x11, 0xd8, 0x13, 0x98, 0xd0, 0xe9, 0x78, 0x22, 0xda, 0xa8, 0x75, 0x88, - 0x9b, 0x68, 0x47, 0x05, 0x09, 0x5d, 0xf6, 0x08, 0xbd, 0x4c, 0xab, 0x9d, 0x10, 0x32, 0x02, 0xb0, - 0x1f, 0x11, 0xc8, 0x47, 0xcc, 0xb6, 0x29, 0x9d, 0x19, 0x3f, 0xc4, 0x73, 0x53, 0xed, 0x2b, 0x22, - 0xb5, 0x8b, 0x1e, 0xb5, 0xb3, 0xf4, 0xa5, 0x4e, 0xa8, 0xf9, 0x5e, 0xe6, 0x1b, 0x04, 0x68, 0xd8, - 0x19, 0x3d, 0xd9, 0x26, 0x3a, 0x87, 0xd5, 0xa9, 0xb6, 0xf5, 0x90, 0xd4, 0xbb, 0x1e, 0xa9, 0x2b, - 0xf4, 0xf5, 0xad, 0x91, 0x0a, 0xcf, 0x00, 0xdf, 0x10, 0xd8, 0x1b, 0x1c, 0x26, 0x69, 0x72, 0x51, - 0x45, 0x4e, 0xbb, 0xdc, 0x64, 0x5b, 0x3a, 0xc8, 0xec, 0x45, 0x8f, 0xd9, 0x04, 0x7d, 0x36, 0x8e, - 0x59, 0xdd, 0x55, 0x9e, 0x53, 0xb5, 0x6b, 0xba, 0xb0, 0x62, 0x0f, 0xd2, 0xab, 0xf4, 0x43, 0x02, - 0xbd, 0xad, 0x11, 0x95, 0x0e, 0x25, 0x3a, 0xf7, 0x4d, 0xc3, 0xdc, 0x70, 0x06, 0x49, 0x04, 0x37, - 0xec, 0x81, 0x2b, 0xd2, 0xc3, 0x71, 0xe0, 0x5a, 0x13, 0x31, 0xfd, 0x88, 0x40, 0x9f, 0x3d, 0xbf, - 0xd2, 0x91, 0x64, 0x07, 0xfe, 0x91, 0x99, 0x1b, 0xcd, 0x24, 0x8b, 0x70, 0x46, 0x3d, 0x38, 0x65, - 0x5a, 0x8c, 0x85, 0x63, 0x4f, 0xd1, 0xe7, 0x1f, 0xac, 0x17, 0xc9, 0xc3, 0xf5, 0x22, 0xf9, 0x7d, - 0xbd, 0x48, 0x3e, 0xde, 0x28, 0xe6, 0x1e, 0x6e, 0x14, 0x73, 0xbf, 0x6c, 0x14, 0x73, 0x6f, 0x1f, - 0x57, 0x54, 0xb3, 0xbe, 0x34, 0x5f, 0x59, 0xd0, 0x17, 0x1d, 0x1b, 0xf6, 0x7f, 0x63, 0x4c, 0xba, - 0x2e, 0xdc, 0x74, 0x0d, 0x9a, 0xb7, 0x9a, 0x32, 0x9b, 0xef, 0xb3, 0xfe, 0x56, 0x38, 0xf9, 0x5f, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x04, 0xb1, 0x80, 0x02, 0x3a, 0x1d, 0x00, 0x00, + // 1389 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x59, 0xdb, 0x6b, 0x1c, 0x65, + 0x1b, 0xdf, 0x37, 0xcd, 0x17, 0xbe, 0x3c, 0xa5, 0xa5, 0x7d, 0x77, 0x1b, 0xd3, 0x69, 0xba, 0xd9, + 0x0c, 0xa5, 0xe6, 0xd0, 0xec, 0x98, 0xa4, 0xb6, 0xb1, 0xa2, 0xed, 0xc6, 0x52, 0x5b, 0x5b, 0xda, + 0x74, 0xc5, 0xe0, 0x91, 0x30, 0xc9, 0x4c, 0x67, 0x87, 0x6e, 0x66, 0xb6, 0xf3, 0x4e, 0x42, 0x4b, + 0x08, 0x82, 0x17, 0xd2, 0x2b, 0x11, 0xbc, 0x97, 0x5e, 0x8a, 0x28, 0xe4, 0x22, 0x15, 0xbd, 0xd0, + 0x4b, 0xe9, 0x85, 0x48, 0xa8, 0x54, 0xf4, 0xa6, 0x4a, 0x22, 0xe8, 0x8d, 0xff, 0x81, 0x88, 0xec, + 0xcc, 0x33, 0xa7, 0xcc, 0x61, 0x67, 0x37, 0x1b, 0x48, 0x6e, 0xda, 0xdd, 0x77, 0x9e, 0xc3, 0xef, + 0xf7, 0x1c, 0xde, 0x79, 0x9e, 0x0d, 0xf0, 0xf3, 0x3a, 0x5b, 0xd0, 0x99, 0xc0, 0x4c, 0xf1, 0xb6, + 0xaa, 0x29, 0xc2, 0xd2, 0xd8, 0x9c, 0x6c, 0x8a, 0x63, 0xc2, 0x9d, 0x45, 0xd9, 0xb8, 0x57, 0xac, + 0x19, 0xba, 0xa9, 0xd3, 0x1e, 0x5b, 0xa6, 0x88, 0x32, 0x45, 0x94, 0xe1, 0x86, 0x51, 0x77, 0x4e, + 0x64, 0xb2, 0xad, 0xe0, 0xaa, 0xd7, 0x44, 0x45, 0xd5, 0x44, 0x53, 0xd5, 0x35, 0xdb, 0x06, 0x97, + 0x53, 0x74, 0x45, 0xb7, 0x3e, 0x0a, 0xf5, 0x4f, 0x78, 0xda, 0xa7, 0xe8, 0xba, 0x52, 0x95, 0x05, + 0xb1, 0xa6, 0x0a, 0xa2, 0xa6, 0xe9, 0xa6, 0xa5, 0xc2, 0xf0, 0xe9, 0x89, 0x18, 0x6c, 0x0e, 0x0e, + 0x5b, 0xea, 0xa8, 0x2d, 0x35, 0x6b, 0x1b, 0x47, 0xa8, 0xf6, 0xa3, 0x63, 0x68, 0xc0, 0xc1, 0xe6, + 0x67, 0xc5, 0x1d, 0x16, 0x17, 0x54, 0x4d, 0x17, 0xac, 0x7f, 0xed, 0x23, 0xfe, 0x2e, 0xf4, 0xdc, + 0xac, 0x4b, 0xcc, 0x88, 0x55, 0x55, 0x12, 0x4d, 0xdd, 0x60, 0x65, 0xf9, 0xce, 0xa2, 0xcc, 0x4c, + 0xda, 0x03, 0x5d, 0xcc, 0x14, 0xcd, 0x45, 0xd6, 0x4b, 0x0a, 0x64, 0xb0, 0xbb, 0x8c, 0xdf, 0xe8, + 0x25, 0x00, 0x8f, 0x6a, 0x6f, 0x47, 0x81, 0x0c, 0xee, 0x1f, 0x3f, 0x59, 0x44, 0x10, 0xf5, 0xb8, + 0x14, 0x6d, 0x97, 0x08, 0xbd, 0x38, 0x2d, 0x2a, 0x32, 0xda, 0x2c, 0xfb, 0x34, 0xf9, 0x55, 0x02, + 0xcf, 0x84, 0x5c, 0xb3, 0x9a, 0xae, 0x31, 0x99, 0x5e, 0x03, 0x58, 0x72, 0x4f, 0x7b, 0x49, 0x61, + 0xdf, 0xe0, 0xfe, 0xf1, 0x81, 0x62, 0x74, 0x4e, 0x8a, 0xae, 0xfe, 0x54, 0xf7, 0xa3, 0xa7, 0xfd, + 0x99, 0xcf, 0xfe, 0x5c, 0x1d, 0x26, 0x65, 0x9f, 0x3e, 0x7d, 0x35, 0x02, 0xf1, 0xb3, 0x0d, 0x11, + 0xdb, 0x50, 0x02, 0x90, 0x45, 0x38, 0x12, 0x44, 0xec, 0xc4, 0xea, 0x32, 0x1c, 0x74, 0xfd, 0xcd, + 0x8a, 0x92, 0x64, 0xd8, 0x31, 0x9b, 0x1a, 0x78, 0xbc, 0x36, 0x7a, 0x1c, 0x1d, 0xb9, 0x4a, 0x25, + 0x49, 0x32, 0x64, 0xc6, 0x5e, 0x37, 0x0d, 0x55, 0x53, 0xca, 0x07, 0x96, 0xfc, 0xe7, 0xbc, 0xb4, + 0x35, 0x1f, 0x6e, 0x4c, 0x5e, 0x83, 0x6e, 0x57, 0xd4, 0x32, 0xdf, 0x6c, 0x48, 0x3c, 0x75, 0x7e, + 0x8d, 0x40, 0x21, 0xe8, 0xe6, 0xa2, 0x5c, 0x95, 0x15, 0xbb, 0x14, 0xdb, 0x4e, 0xaa, 0x6d, 0x25, + 0xf3, 0x37, 0x81, 0x81, 0x04, 0xd8, 0x18, 0xa8, 0xf7, 0x21, 0x27, 0xb9, 0xc7, 0xb3, 0x06, 0x1e, + 0x3b, 0x65, 0x34, 0x1c, 0x17, 0x33, 0xcf, 0x94, 0x63, 0x69, 0xaa, 0x50, 0x0f, 0xde, 0xe7, 0xbf, + 0xf5, 0x67, 0xc3, 0xcf, 0x98, 0x1d, 0xd3, 0xac, 0x14, 0x7e, 0xd2, 0xbe, 0x7a, 0xfb, 0x96, 0xc0, + 0x50, 0x90, 0xef, 0x1b, 0xda, 0x9c, 0xae, 0x49, 0xaa, 0xa6, 0xec, 0x89, 0x7c, 0x3d, 0x25, 0x30, + 0x9c, 0x06, 0x3f, 0x26, 0x4e, 0x81, 0xec, 0xa2, 0xf3, 0x3c, 0x94, 0xb7, 0x91, 0xb8, 0xbc, 0x45, + 0x98, 0xf4, 0x57, 0x3d, 0x75, 0x4d, 0xee, 0x40, 0x82, 0xbe, 0x24, 0xd8, 0xae, 0xfe, 0x02, 0xb1, + 0xb3, 0x71, 0x1e, 0x0e, 0x62, 0x6d, 0x04, 0xb3, 0xd1, 0xfb, 0x78, 0x6d, 0x34, 0x87, 0xae, 0xb6, + 0x24, 0xc1, 0x95, 0xb7, 0x92, 0x10, 0x4e, 0x67, 0x47, 0x6b, 0xe9, 0x3c, 0xf7, 0xff, 0xfb, 0x0f, + 0xfa, 0x33, 0x7f, 0x3d, 0xe8, 0xcf, 0xf0, 0x4b, 0x78, 0xe5, 0x86, 0xeb, 0x99, 0xbe, 0x03, 0xd9, + 0x88, 0xae, 0xc1, 0x8b, 0xa6, 0x89, 0xa6, 0x29, 0xd3, 0x70, 0x4b, 0xf0, 0x5f, 0x11, 0xe8, 0xb7, + 0x1c, 0x47, 0x24, 0x6b, 0x57, 0x07, 0xcc, 0xc0, 0x7b, 0x32, 0x12, 0x37, 0x46, 0xee, 0x3a, 0x74, + 0xd9, 0x35, 0x86, 0xc1, 0x6a, 0xb5, 0x52, 0xd1, 0x0a, 0xff, 0xd0, 0xb9, 0x9c, 0x2f, 0x3a, 0xf4, + 0x22, 0x9a, 0x7d, 0xdb, 0xd1, 0x6a, 0x53, 0x8f, 0xfb, 0x62, 0xf5, 0xb3, 0x73, 0x3b, 0x47, 0xe3, + 0xc6, 0x68, 0x55, 0xda, 0x76, 0x3b, 0xfb, 0x42, 0xb7, 0xb3, 0xd7, 0xf0, 0x77, 0xce, 0x35, 0xec, + 0x12, 0x4b, 0xba, 0x86, 0x77, 0x61, 0x66, 0xdc, 0x7b, 0xb8, 0x01, 0x81, 0x3d, 0x7b, 0x0f, 0xaf, + 0x77, 0xc0, 0x51, 0x8b, 0x60, 0x59, 0x96, 0x76, 0x20, 0x23, 0x37, 0x80, 0x32, 0x63, 0x7e, 0xb6, + 0xd5, 0xdb, 0xe5, 0x10, 0x33, 0xe6, 0x03, 0x8f, 0xea, 0x06, 0x25, 0x66, 0x6e, 0x35, 0xb8, 0x2f, + 0xb5, 0x41, 0x89, 0x99, 0x33, 0x09, 0x6f, 0xec, 0xce, 0x36, 0xd4, 0xcc, 0x13, 0x02, 0x5c, 0x54, + 0x48, 0xb1, 0x46, 0x34, 0xe8, 0x31, 0xe4, 0x84, 0x46, 0x3e, 0x15, 0x57, 0x26, 0x7e, 0x73, 0x51, + 0xad, 0x7c, 0xc4, 0x90, 0x77, 0xb4, 0x99, 0xd7, 0x9c, 0x57, 0x91, 0xdb, 0x0b, 0xe1, 0xd5, 0x67, + 0x17, 0xb6, 0xf0, 0x37, 0xa1, 0x97, 0xc2, 0xde, 0x59, 0x9b, 0x1e, 0x12, 0xc8, 0xc7, 0x60, 0xdf, + 0xd5, 0x2f, 0xff, 0x85, 0xd8, 0x4a, 0xd9, 0x91, 0xa5, 0xec, 0x34, 0x36, 0xdc, 0x65, 0x95, 0x99, + 0xba, 0xa1, 0xce, 0x8b, 0xd5, 0x2b, 0xda, 0x2d, 0xdd, 0xb7, 0x8e, 0x57, 0x64, 0x55, 0xa9, 0x98, + 0x96, 0x9b, 0x7d, 0x65, 0xfc, 0xc6, 0xbf, 0x05, 0xc7, 0x22, 0xb5, 0x10, 0xe0, 0x39, 0xe8, 0xac, + 0xa8, 0xcc, 0x44, 0x6c, 0x27, 0xe3, 0xb0, 0x6d, 0xd1, 0xb6, 0x74, 0x78, 0x0a, 0x87, 0x2c, 0xd3, + 0xd3, 0xba, 0x5e, 0x45, 0x18, 0xfc, 0x34, 0x1c, 0xf6, 0x9d, 0xa1, 0x93, 0x17, 0xa1, 0xb3, 0xa6, + 0xeb, 0x55, 0x74, 0xd2, 0x17, 0xe7, 0xa4, 0xae, 0xe3, 0xe7, 0x6e, 0x29, 0xf1, 0x39, 0xa0, 0xb6, + 0x45, 0xd1, 0x10, 0x17, 0x9c, 0x16, 0xe4, 0xdf, 0x84, 0x6c, 0xe0, 0x14, 0x3d, 0x95, 0xa0, 0xab, + 0x66, 0x9d, 0xa0, 0xaf, 0x7c, 0xac, 0x2f, 0x4b, 0x2a, 0x30, 0x5e, 0xd9, 0x8a, 0xe3, 0xab, 0x3d, + 0xf0, 0x3f, 0xcb, 0x34, 0xfd, 0x94, 0x00, 0x78, 0x5d, 0x44, 0x8b, 0x71, 0xb6, 0xa2, 0x7f, 0x20, + 0xe1, 0x84, 0xd4, 0xf2, 0x38, 0x05, 0x0b, 0xf7, 0xeb, 0x40, 0x3e, 0xf8, 0xe9, 0x8f, 0x4f, 0x3a, + 0x4e, 0x50, 0x5e, 0x88, 0xf9, 0xa9, 0xc7, 0xd7, 0x81, 0x5f, 0x10, 0xe8, 0x76, 0xed, 0xd0, 0xd1, + 0x74, 0xfe, 0x1c, 0x78, 0xc5, 0xb4, 0xe2, 0x88, 0xee, 0x82, 0x87, 0xee, 0x79, 0x3a, 0xd1, 0x18, + 0x9d, 0xb0, 0x1c, 0x6c, 0xb8, 0x15, 0xfa, 0x2b, 0x81, 0x5c, 0xd4, 0x66, 0x4e, 0x27, 0xd3, 0x41, + 0x09, 0x0f, 0x53, 0xdc, 0x0b, 0x2d, 0x68, 0x22, 0x9f, 0x6b, 0x1e, 0x9f, 0x12, 0x3d, 0xdf, 0x02, + 0x1f, 0xc1, 0xf7, 0xde, 0xa3, 0xff, 0x12, 0x38, 0x9e, 0xb8, 0xc5, 0xd2, 0x52, 0x3a, 0xa8, 0x09, + 0xa3, 0x23, 0x37, 0xb5, 0x1d, 0x13, 0x48, 0x7b, 0xc6, 0xa3, 0x7d, 0x95, 0x5e, 0x69, 0x85, 0xb6, + 0x37, 0xfb, 0xf9, 0x03, 0xf0, 0x03, 0x01, 0xf0, 0xfc, 0x35, 0x68, 0x96, 0xd0, 0x76, 0xd7, 0xa0, + 0x59, 0xc2, 0xd3, 0x3d, 0xff, 0x9e, 0xc7, 0xa3, 0x4c, 0xa7, 0xb7, 0x99, 0x3e, 0x61, 0x39, 0xf8, + 0x76, 0x59, 0xa1, 0xff, 0x10, 0xc8, 0x46, 0xc4, 0x91, 0x9e, 0x4d, 0xc4, 0x19, 0xbf, 0xbe, 0x72, + 0x93, 0xcd, 0x2b, 0x22, 0x53, 0xc3, 0x63, 0xaa, 0x50, 0xb9, 0xdd, 0x4c, 0x23, 0xd3, 0x49, 0x7f, + 0x24, 0x90, 0x8b, 0x5a, 0xd3, 0x1a, 0xb4, 0x6a, 0xc2, 0x46, 0xda, 0xa0, 0x55, 0x93, 0x76, 0x42, + 0xbe, 0xe4, 0x45, 0xe0, 0x0c, 0x3d, 0x1d, 0x17, 0x81, 0xc4, 0x7c, 0xd6, 0xfb, 0x33, 0x71, 0xbb, + 0x69, 0xd0, 0x9f, 0x69, 0x56, 0xbb, 0x06, 0xfd, 0x99, 0x6a, 0xb9, 0x4a, 0xd9, 0x9f, 0x2e, 0xbd, + 0x94, 0x09, 0x65, 0xf4, 0x7b, 0x02, 0x07, 0x02, 0xa3, 0x3a, 0x1d, 0x4b, 0x44, 0x1b, 0xb5, 0x29, + 0x71, 0xe3, 0xcd, 0xa8, 0x20, 0xa1, 0xeb, 0x1e, 0xa1, 0x57, 0x68, 0xa9, 0x15, 0x42, 0x46, 0x00, + 0xf6, 0x13, 0x02, 0xd9, 0x88, 0x21, 0xb7, 0x41, 0x67, 0xc6, 0x4f, 0xf3, 0xdc, 0x64, 0xf3, 0x8a, + 0x48, 0xed, 0xaa, 0x47, 0xed, 0x02, 0x7d, 0xb9, 0x15, 0x6a, 0xbe, 0x97, 0xf9, 0x26, 0x01, 0x1a, + 0x76, 0x46, 0xcf, 0x34, 0x89, 0xce, 0x61, 0x75, 0xb6, 0x69, 0x3d, 0x24, 0xf5, 0xae, 0x47, 0xea, + 0x26, 0xbd, 0xb1, 0x3d, 0x52, 0xe1, 0x19, 0xe0, 0x6b, 0x02, 0x07, 0x83, 0xc3, 0x24, 0x4d, 0x2e, + 0xaa, 0xc8, 0x69, 0x97, 0x9b, 0x68, 0x4a, 0x07, 0x99, 0xbd, 0xe4, 0x31, 0x1b, 0xa7, 0xcf, 0xc5, + 0x31, 0xab, 0xb8, 0xca, 0xb3, 0xaa, 0x76, 0x4b, 0x17, 0x96, 0xed, 0x41, 0x7a, 0x85, 0x7e, 0x48, + 0xa0, 0xb3, 0x3e, 0xa2, 0xd2, 0xc1, 0x44, 0xe7, 0xbe, 0x69, 0x98, 0x1b, 0x4a, 0x21, 0x89, 0xe0, + 0x86, 0x3c, 0x70, 0x79, 0xda, 0x17, 0x07, 0xae, 0x3e, 0x11, 0xd3, 0x8f, 0x08, 0x74, 0xd9, 0xf3, + 0x2b, 0x1d, 0x4e, 0x76, 0xe0, 0x1f, 0x99, 0xb9, 0x91, 0x54, 0xb2, 0x08, 0x67, 0xc4, 0x83, 0x53, + 0xa0, 0xf9, 0x58, 0x38, 0xf6, 0x14, 0x7d, 0xe9, 0xd1, 0x46, 0x9e, 0xac, 0x6f, 0xe4, 0xc9, 0xef, + 0x1b, 0x79, 0xf2, 0xf1, 0x66, 0x3e, 0xb3, 0xbe, 0x99, 0xcf, 0xfc, 0xb2, 0x99, 0xcf, 0xbc, 0x7d, + 0x4a, 0x51, 0xcd, 0xca, 0xe2, 0x5c, 0x71, 0x5e, 0x5f, 0x70, 0x6c, 0xd8, 0xff, 0x8d, 0x32, 0xe9, + 0xb6, 0x70, 0xd7, 0x35, 0x68, 0xde, 0xab, 0xc9, 0x6c, 0xae, 0xcb, 0xfa, 0x9b, 0xe3, 0xc4, 0x7f, + 0x01, 0x00, 0x00, 0xff, 0xff, 0x44, 0xdb, 0xeb, 0x04, 0x82, 0x1d, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2077,6 +2078,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.staking.v1beta1.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/staking/types/staking.pb.go b/x/staking/types/staking.pb.go index 9833486af700..b30d3498e254 100644 --- a/x/staking/types/staking.pb.go +++ b/x/staking/types/staking.pb.go @@ -6,12 +6,12 @@ package types import ( bytes "bytes" compress_gzip "compress/gzip" + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" types3 "github.com/cometbft/cometbft/abci/types" types "github.com/cometbft/cometbft/proto/tendermint/types" _ "github.com/cosmos/cosmos-proto" types1 "github.com/cosmos/cosmos-sdk/codec/types" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types2 "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" @@ -168,11 +168,11 @@ func (m *HistoricalInfo) GetValset() []Validator { // a validator. type CommissionRates struct { // rate is the commission rate charged to delegators, as a fraction. - Rate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=rate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"rate"` + Rate cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=rate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"rate"` // max_rate defines the maximum commission rate which validator can ever charge, as a fraction. - MaxRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=max_rate,json=maxRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"max_rate"` + MaxRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=max_rate,json=maxRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"max_rate"` // max_change_rate defines the maximum daily increase of the validator commission, as a fraction. - MaxChangeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=max_change_rate,json=maxChangeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"max_change_rate"` + MaxChangeRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=max_change_rate,json=maxChangeRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"max_change_rate"` } func (m *CommissionRates) Reset() { *m = CommissionRates{} } @@ -356,9 +356,9 @@ type Validator struct { // status is the validator status (bonded/unbonding/unbonded). Status BondStatus `protobuf:"varint,4,opt,name=status,proto3,enum=cosmos.staking.v1beta1.BondStatus" json:"status,omitempty"` // tokens define the delegated tokens (incl. self-delegation). - Tokens github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=tokens,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"tokens"` + Tokens cosmossdk_io_math.Int `protobuf:"bytes,5,opt,name=tokens,proto3,customtype=cosmossdk.io/math.Int" json:"tokens"` // delegator_shares defines total shares issued to a validator's delegators. - DelegatorShares github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=delegator_shares,json=delegatorShares,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"delegator_shares"` + DelegatorShares cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=delegator_shares,json=delegatorShares,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"delegator_shares"` // description defines the description terms for the validator. Description Description `protobuf:"bytes,7,opt,name=description,proto3" json:"description"` // unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. @@ -370,7 +370,7 @@ type Validator struct { // min_self_delegation is the validator's self declared minimum self delegation. // // Since: cosmos-sdk 0.46 - MinSelfDelegation github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,11,opt,name=min_self_delegation,json=minSelfDelegation,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_self_delegation"` + MinSelfDelegation cosmossdk_io_math.Int `protobuf:"bytes,11,opt,name=min_self_delegation,json=minSelfDelegation,proto3,customtype=cosmossdk.io/math.Int" json:"min_self_delegation"` // strictly positive if this validator's unbonding has been stopped by external modules UnbondingOnHoldRefCount int64 `protobuf:"varint,12,opt,name=unbonding_on_hold_ref_count,json=unbondingOnHoldRefCount,proto3" json:"unbonding_on_hold_ref_count,omitempty"` // list of unbonding ids, each uniquely identifing an unbonding of this validator @@ -633,12 +633,12 @@ func (m *DVVTriplets) GetTriplets() []DVVTriplet { // owned by one delegator, and is associated with the voting power of one // validator. type Delegation struct { - // delegator_address is the bech32-encoded address of the delegator. + // delegator_address is the encoded address of the delegator. DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` - // validator_address is the bech32-encoded address of the validator. + // validator_address is the encoded address of the validator. ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` // shares define the delegation shares received. - Shares github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=shares,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"shares"` + Shares cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=shares,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"shares"` } func (m *Delegation) Reset() { *m = Delegation{} } @@ -677,9 +677,9 @@ var xxx_messageInfo_Delegation proto.InternalMessageInfo // UnbondingDelegation stores all of a single delegator's unbonding bonds // for a single validator in an time-ordered list. type UnbondingDelegation struct { - // delegator_address is the bech32-encoded address of the delegator. + // delegator_address is the encoded address of the delegator. DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` - // validator_address is the bech32-encoded address of the validator. + // validator_address is the encoded address of the validator. ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` // entries are the unbonding delegation entries. Entries []UnbondingDelegationEntry `protobuf:"bytes,3,rep,name=entries,proto3" json:"entries"` @@ -725,9 +725,9 @@ type UnbondingDelegationEntry struct { // completion_time is the unix time for unbonding completion. CompletionTime time.Time `protobuf:"bytes,2,opt,name=completion_time,json=completionTime,proto3,stdtime" json:"completion_time"` // initial_balance defines the tokens initially scheduled to receive at completion. - InitialBalance github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=initial_balance,json=initialBalance,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"initial_balance"` + InitialBalance cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=initial_balance,json=initialBalance,proto3,customtype=cosmossdk.io/math.Int" json:"initial_balance"` // balance defines the tokens to receive at completion. - Balance github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=balance,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"balance"` + Balance cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=balance,proto3,customtype=cosmossdk.io/math.Int" json:"balance"` // Incrementing id that uniquely identifies this entry UnbondingId uint64 `protobuf:"varint,5,opt,name=unbonding_id,json=unbondingId,proto3" json:"unbonding_id,omitempty"` // Strictly positive if this entry's unbonding has been stopped by external modules @@ -802,9 +802,9 @@ type RedelegationEntry struct { // completion_time defines the unix time for redelegation completion. CompletionTime time.Time `protobuf:"bytes,2,opt,name=completion_time,json=completionTime,proto3,stdtime" json:"completion_time"` // initial_balance defines the initial balance when redelegation started. - InitialBalance github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=initial_balance,json=initialBalance,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"initial_balance"` + InitialBalance cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=initial_balance,json=initialBalance,proto3,customtype=cosmossdk.io/math.Int" json:"initial_balance"` // shares_dst is the amount of destination-validator shares created by redelegation. - SharesDst github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=shares_dst,json=sharesDst,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"shares_dst"` + SharesDst cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=shares_dst,json=sharesDst,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"shares_dst"` // Incrementing id that uniquely identifies this entry UnbondingId uint64 `protobuf:"varint,5,opt,name=unbonding_id,json=unbondingId,proto3" json:"unbonding_id,omitempty"` // Strictly positive if this entry's unbonding has been stopped by external modules @@ -931,7 +931,7 @@ type Params struct { // bond_denom defines the bondable coin denomination. BondDenom string `protobuf:"bytes,5,opt,name=bond_denom,json=bondDenom,proto3" json:"bond_denom,omitempty"` // min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators - MinCommissionRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=min_commission_rate,json=minCommissionRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"min_commission_rate" yaml:"min_commission_rate"` + MinCommissionRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=min_commission_rate,json=minCommissionRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"min_commission_rate" yaml:"min_commission_rate"` } func (m *Params) Reset() { *m = Params{} } @@ -1060,8 +1060,8 @@ func (m *DelegationResponse) GetBalance() types2.Coin { // contains a balance in addition to shares which is more suitable for client // responses. type RedelegationEntryResponse struct { - RedelegationEntry RedelegationEntry `protobuf:"bytes,1,opt,name=redelegation_entry,json=redelegationEntry,proto3" json:"redelegation_entry"` - Balance github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=balance,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"balance"` + RedelegationEntry RedelegationEntry `protobuf:"bytes,1,opt,name=redelegation_entry,json=redelegationEntry,proto3" json:"redelegation_entry"` + Balance cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=balance,proto3,customtype=cosmossdk.io/math.Int" json:"balance"` } func (m *RedelegationEntryResponse) Reset() { *m = RedelegationEntryResponse{} } @@ -1162,8 +1162,8 @@ func (m *RedelegationResponse) GetEntries() []RedelegationEntryResponse { // Pool is used for tracking bonded and not-bonded token supply of the bond // denomination. type Pool struct { - NotBondedTokens github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=not_bonded_tokens,json=notBondedTokens,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"not_bonded_tokens"` - BondedTokens github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=bonded_tokens,json=bondedTokens,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"bonded_tokens"` + NotBondedTokens cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=not_bonded_tokens,json=notBondedTokens,proto3,customtype=cosmossdk.io/math.Int" json:"not_bonded_tokens"` + BondedTokens cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=bonded_tokens,json=bondedTokens,proto3,customtype=cosmossdk.io/math.Int" json:"bonded_tokens"` } func (m *Pool) Reset() { *m = Pool{} } @@ -1276,125 +1276,126 @@ func init() { } var fileDescriptor_64c30c6cf92913c9 = []byte{ - // 1883 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x58, 0x3d, 0x6c, 0x23, 0xc7, - 0x15, 0xd6, 0x92, 0x32, 0x25, 0x3d, 0x4a, 0x22, 0x35, 0x27, 0xdf, 0xf1, 0x78, 0x89, 0x48, 0xd3, - 0x17, 0x5b, 0x3e, 0xf8, 0xa8, 0x9c, 0x02, 0xa4, 0x50, 0x8c, 0x04, 0xa2, 0xa8, 0xf3, 0xd1, 0xb1, - 0x25, 0x61, 0x29, 0x29, 0x71, 0x7e, 0xb0, 0x18, 0xee, 0x8e, 0xa8, 0x89, 0xb8, 0xb3, 0xc4, 0xce, - 0xf0, 0x2c, 0xb6, 0x41, 0x0a, 0x43, 0x45, 0x62, 0x20, 0x4d, 0x9a, 0x03, 0x0e, 0x48, 0x11, 0xa7, - 0x73, 0x61, 0xc4, 0x45, 0x90, 0x22, 0x9d, 0x93, 0x34, 0x07, 0x57, 0x41, 0x0a, 0x25, 0xb8, 0x2b, - 0x6c, 0xa4, 0x0a, 0xd2, 0x25, 0x55, 0x30, 0xb3, 0xb3, 0x3f, 0x14, 0xc5, 0x93, 0x74, 0x50, 0x0c, - 0x03, 0x6e, 0xc8, 0x9d, 0x99, 0xf7, 0xbe, 0x99, 0xf7, 0xbd, 0x9f, 0xf9, 0x81, 0x9b, 0xb6, 0xc7, - 0x5d, 0x8f, 0x2f, 0x71, 0x81, 0x0f, 0x28, 0x6b, 0x2f, 0xdd, 0xbf, 0xd3, 0x22, 0x02, 0xdf, 0x09, - 0xdb, 0xd5, 0xae, 0xef, 0x09, 0x0f, 0x5d, 0x0d, 0xa4, 0xaa, 0x61, 0xaf, 0x96, 0x2a, 0xce, 0xb7, - 0xbd, 0xb6, 0xa7, 0x44, 0x96, 0xe4, 0x57, 0x20, 0x5d, 0xbc, 0xde, 0xf6, 0xbc, 0x76, 0x87, 0x2c, - 0xa9, 0x56, 0xab, 0xb7, 0xb7, 0x84, 0x59, 0x5f, 0x0f, 0x2d, 0x9c, 0x1c, 0x72, 0x7a, 0x3e, 0x16, - 0xd4, 0x63, 0x7a, 0xbc, 0x74, 0x72, 0x5c, 0x50, 0x97, 0x70, 0x81, 0xdd, 0x6e, 0x88, 0x1d, 0xac, - 0xc4, 0x0a, 0x26, 0xd5, 0xcb, 0xd2, 0xd8, 0xda, 0x94, 0x16, 0xe6, 0x24, 0xb2, 0xc3, 0xf6, 0x68, - 0x88, 0x3d, 0x87, 0x5d, 0xca, 0xbc, 0x25, 0xf5, 0xab, 0xbb, 0xbe, 0x22, 0x08, 0x73, 0x88, 0xef, - 0x52, 0x26, 0x96, 0x44, 0xbf, 0x4b, 0x78, 0xf0, 0xab, 0x47, 0x6f, 0x24, 0x46, 0x71, 0xcb, 0xa6, - 0xc9, 0xc1, 0xca, 0x2f, 0x0d, 0x98, 0xbd, 0x47, 0xb9, 0xf0, 0x7c, 0x6a, 0xe3, 0x4e, 0x83, 0xed, - 0x79, 0xe8, 0x5b, 0x90, 0xd9, 0x27, 0xd8, 0x21, 0x7e, 0xc1, 0x28, 0x1b, 0x8b, 0xd9, 0xe5, 0x42, - 0x35, 0x06, 0xa8, 0x06, 0xba, 0xf7, 0xd4, 0x78, 0x6d, 0xea, 0xe3, 0xe3, 0xd2, 0xd8, 0xfb, 0x9f, - 0x7e, 0x70, 0xcb, 0x30, 0xb5, 0x0a, 0xaa, 0x43, 0xe6, 0x3e, 0xee, 0x70, 0x22, 0x0a, 0xa9, 0x72, - 0x7a, 0x31, 0xbb, 0xfc, 0x42, 0xf5, 0x74, 0xce, 0xab, 0xbb, 0xb8, 0x43, 0x1d, 0x2c, 0xbc, 0x41, - 0x94, 0x40, 0xb7, 0xf2, 0x51, 0x0a, 0x72, 0x6b, 0x9e, 0xeb, 0x52, 0xce, 0xa9, 0xc7, 0x4c, 0x2c, - 0x08, 0x47, 0x3b, 0x30, 0xee, 0x63, 0x41, 0xd4, 0xa2, 0xa6, 0x6a, 0xab, 0x52, 0xe9, 0x6f, 0xc7, - 0xa5, 0x97, 0xda, 0x54, 0xec, 0xf7, 0x5a, 0x55, 0xdb, 0x73, 0x35, 0x8d, 0xfa, 0xef, 0x36, 0x77, - 0x0e, 0xb4, 0xa5, 0x75, 0x62, 0x7f, 0xf2, 0xe1, 0x6d, 0xd0, 0x0b, 0xa9, 0x13, 0x3b, 0x98, 0x4c, - 0xc1, 0xa1, 0x1f, 0xc1, 0xa4, 0x8b, 0x0f, 0x2d, 0x05, 0x9d, 0xba, 0x2c, 0xe8, 0x09, 0x17, 0x1f, - 0xca, 0x55, 0x23, 0x0a, 0x39, 0x89, 0x6e, 0xef, 0x63, 0xd6, 0x26, 0xc1, 0x24, 0xe9, 0xcb, 0x9a, - 0x64, 0xc6, 0xc5, 0x87, 0x6b, 0x0a, 0x58, 0x4e, 0xb5, 0x32, 0xfe, 0xd9, 0xc3, 0x92, 0x51, 0xf9, - 0xa3, 0x01, 0x10, 0x33, 0x87, 0x30, 0xe4, 0xed, 0xa8, 0xa5, 0xe6, 0xe7, 0xda, 0xab, 0x2f, 0x8f, - 0x72, 0xcc, 0x09, 0xde, 0x6b, 0x33, 0x72, 0xa5, 0x8f, 0x8e, 0x4b, 0x46, 0x30, 0x6b, 0xce, 0x3e, - 0xe1, 0x97, 0x37, 0x20, 0xdb, 0xeb, 0x3a, 0x58, 0x10, 0x4b, 0x06, 0xb9, 0xe2, 0x30, 0xbb, 0x5c, - 0xac, 0x06, 0x19, 0x50, 0x0d, 0x33, 0xa0, 0xba, 0x1d, 0x66, 0x40, 0x00, 0xf8, 0xde, 0xdf, 0x43, - 0x40, 0x08, 0xb4, 0xe5, 0xb8, 0xb6, 0xe1, 0x7d, 0x03, 0xb2, 0x75, 0xc2, 0x6d, 0x9f, 0x76, 0x65, - 0x4e, 0xa1, 0x02, 0x4c, 0xb8, 0x1e, 0xa3, 0x07, 0x3a, 0x22, 0xa7, 0xcc, 0xb0, 0x89, 0x8a, 0x30, - 0x49, 0x1d, 0xc2, 0x04, 0x15, 0xfd, 0xc0, 0x79, 0x66, 0xd4, 0x96, 0x5a, 0xef, 0x90, 0x16, 0xa7, - 0x21, 0xe5, 0x66, 0xd8, 0x44, 0xaf, 0x40, 0x9e, 0x13, 0xbb, 0xe7, 0x53, 0xd1, 0xb7, 0x6c, 0x8f, - 0x09, 0x6c, 0x8b, 0xc2, 0xb8, 0x12, 0xc9, 0x85, 0xfd, 0x6b, 0x41, 0xb7, 0x04, 0x71, 0x88, 0xc0, - 0xb4, 0xc3, 0x0b, 0xcf, 0x05, 0x20, 0xba, 0xa9, 0x97, 0xfa, 0xd1, 0x04, 0x4c, 0x45, 0x91, 0x8c, - 0xd6, 0x20, 0xef, 0x75, 0x89, 0x2f, 0xbf, 0x2d, 0xec, 0x38, 0x3e, 0xe1, 0x5c, 0x87, 0x6b, 0xe1, - 0x93, 0x0f, 0x6f, 0xcf, 0x6b, 0xc2, 0x57, 0x83, 0x91, 0xa6, 0xf0, 0x29, 0x6b, 0x9b, 0xb9, 0x50, - 0x43, 0x77, 0xa3, 0xb7, 0xa5, 0xcb, 0x18, 0x27, 0x8c, 0xf7, 0xb8, 0xd5, 0xed, 0xb5, 0x0e, 0x48, - 0x5f, 0x93, 0x3a, 0x3f, 0x44, 0xea, 0x2a, 0xeb, 0xd7, 0x0a, 0x7f, 0x8e, 0xa1, 0x6d, 0xbf, 0xdf, - 0x15, 0x5e, 0x75, 0xab, 0xd7, 0xfa, 0x2e, 0xe9, 0x4b, 0x57, 0x69, 0x9c, 0x2d, 0x05, 0x83, 0xae, - 0x42, 0xe6, 0x27, 0x98, 0x76, 0x88, 0xa3, 0x18, 0x99, 0x34, 0x75, 0x0b, 0xad, 0x40, 0x86, 0x0b, - 0x2c, 0x7a, 0x5c, 0xd1, 0x30, 0xbb, 0x5c, 0x19, 0x15, 0x1b, 0x35, 0x8f, 0x39, 0x4d, 0x25, 0x69, - 0x6a, 0x0d, 0xb4, 0x0d, 0x19, 0xe1, 0x1d, 0x10, 0xa6, 0x09, 0xaa, 0xbd, 0x76, 0x81, 0xc0, 0x6e, - 0x30, 0x91, 0x08, 0xec, 0x06, 0x13, 0xa6, 0xc6, 0x42, 0x6d, 0xc8, 0x3b, 0xa4, 0x43, 0xda, 0x8a, - 0x4a, 0xbe, 0x8f, 0x7d, 0xc2, 0x0b, 0x99, 0x0b, 0xe3, 0x0f, 0x25, 0x8e, 0x99, 0x8b, 0x50, 0x9b, - 0x0a, 0x14, 0x6d, 0x41, 0xd6, 0x89, 0x43, 0xad, 0x30, 0xa1, 0x88, 0x7e, 0x71, 0x94, 0xfd, 0x89, - 0xa8, 0x4c, 0x96, 0xad, 0x24, 0x84, 0x8c, 0xae, 0x1e, 0x6b, 0x79, 0xcc, 0xa1, 0xac, 0x6d, 0xed, - 0x13, 0xda, 0xde, 0x17, 0x85, 0xc9, 0xb2, 0xb1, 0x98, 0x36, 0x73, 0x51, 0xff, 0x3d, 0xd5, 0x8d, - 0xb6, 0x60, 0x36, 0x16, 0x55, 0xd9, 0x33, 0x75, 0xd1, 0xec, 0x99, 0x89, 0x00, 0xa4, 0x08, 0x7a, - 0x0b, 0x20, 0xce, 0xcf, 0x02, 0x28, 0xb4, 0xca, 0xd9, 0x99, 0x9e, 0x34, 0x26, 0x01, 0x80, 0x3a, - 0x70, 0xc5, 0xa5, 0xcc, 0xe2, 0xa4, 0xb3, 0x67, 0x69, 0xe6, 0x24, 0x6e, 0xf6, 0x12, 0x3c, 0x3d, - 0xe7, 0x52, 0xd6, 0x24, 0x9d, 0xbd, 0x7a, 0x04, 0x8b, 0x5e, 0x83, 0x1b, 0x31, 0x1d, 0x1e, 0xb3, - 0xf6, 0xbd, 0x8e, 0x63, 0xf9, 0x64, 0xcf, 0xb2, 0xbd, 0x1e, 0x13, 0x85, 0x69, 0x45, 0xe2, 0xb5, - 0x48, 0x64, 0x93, 0xdd, 0xf3, 0x3a, 0x8e, 0x49, 0xf6, 0xd6, 0xe4, 0x30, 0x7a, 0x11, 0x62, 0x2e, - 0x2c, 0xea, 0xf0, 0xc2, 0x4c, 0x39, 0xbd, 0x38, 0x6e, 0x4e, 0x47, 0x9d, 0x0d, 0x87, 0xaf, 0x4c, - 0xbe, 0xfb, 0xb0, 0x34, 0xf6, 0xd9, 0xc3, 0xd2, 0x58, 0xe5, 0x2e, 0x4c, 0xef, 0xe2, 0x8e, 0x4e, - 0x3a, 0xc2, 0xd1, 0x37, 0x61, 0x0a, 0x87, 0x8d, 0x82, 0x51, 0x4e, 0x3f, 0x35, 0x69, 0x63, 0xd1, - 0xca, 0x43, 0x03, 0x32, 0xf5, 0xdd, 0x2d, 0x4c, 0x7d, 0xb4, 0x0e, 0x73, 0x71, 0xd0, 0x9e, 0x37, - 0xff, 0xe3, 0x38, 0x0f, 0x0b, 0xc0, 0x3a, 0xcc, 0xdd, 0x0f, 0x4b, 0x4a, 0x04, 0x93, 0x3a, 0x0b, - 0x26, 0x52, 0xd1, 0xfd, 0x09, 0x53, 0xdf, 0x80, 0x89, 0x60, 0x85, 0x1c, 0x7d, 0x07, 0x9e, 0xeb, - 0xca, 0x0f, 0x65, 0x61, 0x76, 0x79, 0x61, 0x64, 0xa0, 0x2b, 0xf9, 0x64, 0x58, 0x04, 0x7a, 0x95, - 0xff, 0x18, 0x00, 0xf5, 0xdd, 0xdd, 0x6d, 0x9f, 0x76, 0x3b, 0x44, 0x5c, 0x96, 0xc9, 0x6f, 0xc2, - 0xf3, 0xb1, 0xc9, 0xdc, 0xb7, 0xcf, 0x6d, 0xf6, 0x95, 0x48, 0xad, 0xe9, 0xdb, 0xa7, 0xa2, 0x39, - 0x5c, 0x44, 0x68, 0xe9, 0x73, 0xa3, 0xd5, 0xb9, 0x18, 0xe6, 0xf1, 0xfb, 0x90, 0x8d, 0x4d, 0xe7, - 0xa8, 0x01, 0x93, 0x42, 0x7f, 0x6b, 0x3a, 0x2b, 0xa3, 0xe9, 0x0c, 0xd5, 0x92, 0x94, 0x46, 0xea, - 0x95, 0xff, 0x4a, 0x56, 0xe3, 0x44, 0xf8, 0x42, 0x05, 0x92, 0xac, 0xf0, 0xba, 0x02, 0xa7, 0x2f, - 0xa1, 0x02, 0x6b, 0xac, 0x04, 0xad, 0x3f, 0x4b, 0xc1, 0x95, 0x9d, 0x30, 0x49, 0xbf, 0xb0, 0x2c, - 0xec, 0xc0, 0x04, 0x61, 0xc2, 0xa7, 0x8a, 0x06, 0xe9, 0xec, 0xaf, 0x8f, 0x72, 0xf6, 0x29, 0xb6, - 0xac, 0x33, 0xe1, 0xf7, 0x93, 0xae, 0x0f, 0xb1, 0x12, 0x34, 0xfc, 0x21, 0x0d, 0x85, 0x51, 0xaa, - 0xe8, 0x65, 0xc8, 0xd9, 0x3e, 0x51, 0x1d, 0xe1, 0x9e, 0x62, 0xa8, 0x72, 0x38, 0x1b, 0x76, 0xeb, - 0x2d, 0xc5, 0x04, 0x79, 0x40, 0x93, 0x51, 0x25, 0x45, 0x9f, 0xed, 0x44, 0x36, 0x1b, 0x23, 0xa8, - 0x4d, 0x85, 0x40, 0x8e, 0x32, 0x2a, 0x28, 0xee, 0x58, 0x2d, 0xdc, 0xc1, 0xcc, 0x26, 0xcf, 0x10, - 0x09, 0xc3, 0x3b, 0xc0, 0xac, 0x06, 0xad, 0x05, 0x98, 0x68, 0x17, 0x26, 0x42, 0xf8, 0xf1, 0x4b, - 0x80, 0x0f, 0xc1, 0xd0, 0x0b, 0x30, 0x9d, 0xdc, 0x18, 0xd4, 0x39, 0x65, 0xdc, 0xcc, 0x26, 0xf6, - 0x85, 0xb3, 0x76, 0x9e, 0xcc, 0x53, 0x77, 0x1e, 0x7d, 0x14, 0xfc, 0x7d, 0x1a, 0xe6, 0x4c, 0xe2, - 0x7c, 0x09, 0x1d, 0xf7, 0x43, 0x80, 0x20, 0xa9, 0x65, 0xb1, 0x7d, 0x06, 0xdf, 0x0d, 0x17, 0x89, - 0xa9, 0x00, 0xaf, 0xce, 0xc5, 0xe7, 0xe5, 0xbd, 0xbf, 0xa4, 0x60, 0x3a, 0xe9, 0xbd, 0x2f, 0xc1, - 0xce, 0x86, 0x36, 0xe2, 0x92, 0x36, 0xae, 0x4a, 0xda, 0x2b, 0xa3, 0x4a, 0xda, 0x50, 0x5c, 0x9f, - 0x51, 0xcb, 0x7e, 0x93, 0x86, 0xcc, 0x16, 0xf6, 0xb1, 0xcb, 0xd1, 0xe6, 0xd0, 0x19, 0x37, 0xb8, - 0x7f, 0x5e, 0x1f, 0x0a, 0xeb, 0xba, 0x7e, 0x43, 0x09, 0xa2, 0xfa, 0x57, 0xa3, 0x8e, 0xb8, 0x5f, - 0x83, 0x59, 0x79, 0xa5, 0x8e, 0x0c, 0x0a, 0xa8, 0x9c, 0x51, 0xd7, 0xe1, 0xe8, 0x2a, 0xc6, 0x51, - 0x09, 0xb2, 0x52, 0x2c, 0xae, 0xd9, 0x52, 0x06, 0x5c, 0x7c, 0xb8, 0x1e, 0xf4, 0xa0, 0xdb, 0x80, - 0xf6, 0xa3, 0x87, 0x0f, 0x2b, 0x26, 0x42, 0xca, 0xcd, 0xc5, 0x23, 0xa1, 0xf8, 0x57, 0x01, 0xe4, - 0x2a, 0x2c, 0x87, 0x30, 0xcf, 0xd5, 0x97, 0xc1, 0x29, 0xd9, 0x53, 0x97, 0x1d, 0xe8, 0x17, 0x46, - 0x70, 0x54, 0x3e, 0x71, 0xdb, 0xd6, 0x97, 0x16, 0xeb, 0x62, 0xd9, 0xf0, 0xef, 0xe3, 0x52, 0xb1, - 0x8f, 0xdd, 0xce, 0x4a, 0xe5, 0x14, 0xc8, 0xca, 0x69, 0x6f, 0x01, 0xf2, 0x34, 0x3d, 0x78, 0x71, - 0x5f, 0xb9, 0x29, 0xe3, 0xfa, 0xe8, 0xd3, 0x0f, 0x6e, 0xdd, 0x48, 0x4c, 0x71, 0x18, 0xbd, 0x90, - 0x05, 0xee, 0xa9, 0xfc, 0xd6, 0x00, 0x14, 0x6f, 0x36, 0x26, 0xe1, 0x5d, 0x79, 0x67, 0x94, 0xf7, - 0x88, 0xc4, 0x79, 0xdf, 0x78, 0xfa, 0x3d, 0x22, 0xd6, 0x1f, 0xb8, 0x47, 0x24, 0x92, 0xe9, 0xdb, - 0x71, 0x69, 0x4f, 0x69, 0xef, 0x6b, 0xac, 0x16, 0xe6, 0x24, 0x71, 0x21, 0xa1, 0x03, 0x10, 0xa1, - 0x92, 0xca, 0xd1, 0xb1, 0xca, 0xb1, 0x01, 0xd7, 0x87, 0x22, 0x31, 0x5a, 0xb2, 0x0d, 0xc8, 0x4f, - 0x0c, 0x2a, 0x8f, 0xf6, 0xf5, 0xd2, 0x9f, 0x2d, 0xb0, 0xe7, 0xfc, 0xa1, 0x72, 0xfe, 0x7f, 0xda, - 0xa3, 0x74, 0x11, 0xfa, 0x93, 0x01, 0xf3, 0xc9, 0x15, 0x45, 0xb6, 0x35, 0x61, 0x3a, 0xb9, 0x16, - 0x6d, 0xd5, 0xcd, 0xf3, 0x58, 0x95, 0x34, 0x68, 0x00, 0x44, 0xda, 0x12, 0x46, 0x7d, 0xf0, 0x56, - 0x77, 0xe7, 0xdc, 0x2c, 0x85, 0x0b, 0x3b, 0xb5, 0x0c, 0x04, 0xce, 0xfa, 0x79, 0x0a, 0xc6, 0xb7, - 0x3c, 0xaf, 0x83, 0x7e, 0x6a, 0xc0, 0x1c, 0xf3, 0x84, 0x25, 0x73, 0x85, 0x38, 0x96, 0x7e, 0x2c, - 0x08, 0x2a, 0xe9, 0xee, 0xc5, 0xd8, 0xfb, 0xe7, 0x71, 0x69, 0x18, 0x6a, 0x90, 0x52, 0xfd, 0x48, - 0xc5, 0x3c, 0x51, 0x53, 0x42, 0xdb, 0xc1, 0x7b, 0xc2, 0x3b, 0x30, 0x33, 0x38, 0x7f, 0x50, 0x7e, - 0xcd, 0x0b, 0xcf, 0x3f, 0x73, 0xe6, 0xdc, 0xd3, 0xad, 0xc4, 0xc4, 0x2b, 0x93, 0xd2, 0xb1, 0xff, - 0x92, 0xce, 0x7d, 0x1b, 0xf2, 0x51, 0x79, 0xda, 0x51, 0x4f, 0x5e, 0xf2, 0x6c, 0x3a, 0x11, 0xbc, - 0x7e, 0x85, 0x37, 0x88, 0x72, 0xf2, 0xad, 0x15, 0xb7, 0x6c, 0x5a, 0x3d, 0xa1, 0x33, 0xc0, 0xb8, - 0xd6, 0xbd, 0xf5, 0x3b, 0x03, 0x20, 0x7e, 0x9a, 0x41, 0xaf, 0xc2, 0xb5, 0xda, 0xe6, 0x46, 0xdd, - 0x6a, 0x6e, 0xaf, 0x6e, 0xef, 0x34, 0xad, 0x9d, 0x8d, 0xe6, 0xd6, 0xfa, 0x5a, 0xe3, 0x6e, 0x63, - 0xbd, 0x9e, 0x1f, 0x2b, 0xe6, 0x8e, 0x1e, 0x94, 0xb3, 0x3b, 0x8c, 0x77, 0x89, 0x4d, 0xf7, 0x28, - 0x71, 0xd0, 0x4b, 0x30, 0x3f, 0x28, 0x2d, 0x5b, 0xeb, 0xf5, 0xbc, 0x51, 0x9c, 0x3e, 0x7a, 0x50, - 0x9e, 0x0c, 0x8e, 0xa4, 0xc4, 0x41, 0x8b, 0xf0, 0xfc, 0xb0, 0x5c, 0x63, 0xe3, 0xf5, 0x7c, 0xaa, - 0x38, 0x73, 0xf4, 0xa0, 0x3c, 0x15, 0x9d, 0x5d, 0x51, 0x05, 0x50, 0x52, 0x52, 0xe3, 0xa5, 0x8b, - 0x70, 0xf4, 0xa0, 0x9c, 0x09, 0xdc, 0x52, 0x1c, 0x7f, 0xf7, 0xd7, 0x0b, 0x63, 0xb7, 0x7e, 0x0c, - 0xd0, 0x60, 0x7b, 0x3e, 0xb6, 0x55, 0x40, 0x16, 0xe1, 0x6a, 0x63, 0xe3, 0xae, 0xb9, 0xba, 0xb6, - 0xdd, 0xd8, 0xdc, 0x18, 0x5c, 0xf6, 0x89, 0xb1, 0xfa, 0xe6, 0x4e, 0xed, 0xcd, 0x75, 0xab, 0xd9, - 0x78, 0x7d, 0x23, 0x6f, 0xa0, 0x6b, 0x70, 0x65, 0x60, 0xec, 0x7b, 0x1b, 0xdb, 0x8d, 0xb7, 0xd6, - 0xf3, 0xa9, 0xda, 0xdd, 0x8f, 0x1f, 0x2f, 0x18, 0x8f, 0x1e, 0x2f, 0x18, 0xff, 0x78, 0xbc, 0x60, - 0xbc, 0xf7, 0x64, 0x61, 0xec, 0xd1, 0x93, 0x85, 0xb1, 0xbf, 0x3e, 0x59, 0x18, 0xfb, 0xc1, 0xab, - 0x4f, 0x75, 0x78, 0x5c, 0x25, 0x95, 0xeb, 0x5b, 0x19, 0xb5, 0x47, 0x7d, 0xe3, 0x7f, 0x01, 0x00, - 0x00, 0xff, 0xff, 0x93, 0xd7, 0xc2, 0x0d, 0x66, 0x18, 0x00, 0x00, + // 1901 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x58, 0x4d, 0x6c, 0x63, 0x47, + 0x1d, 0xcf, 0x8b, 0x53, 0x27, 0xf9, 0x3b, 0x89, 0x9d, 0xd9, 0x2f, 0xaf, 0x97, 0xc6, 0x5e, 0x77, + 0xa1, 0xe9, 0xd2, 0xd8, 0x6c, 0x90, 0x7a, 0x08, 0x08, 0x14, 0xc7, 0xde, 0xae, 0x4b, 0x9b, 0x04, + 0x3b, 0x09, 0x94, 0xaf, 0xa7, 0xf1, 0x7b, 0x13, 0x67, 0x88, 0x3d, 0xcf, 0xbc, 0x19, 0x2f, 0xf1, + 0x9d, 0x43, 0x15, 0x84, 0x54, 0x09, 0x09, 0x21, 0xc1, 0x8a, 0x95, 0xb8, 0x94, 0x5b, 0x0f, 0x2b, + 0xee, 0xdc, 0x0a, 0x12, 0xd2, 0x6a, 0x4f, 0x08, 0x89, 0x80, 0x76, 0x0f, 0xad, 0xe0, 0x82, 0x38, + 0x71, 0x44, 0xf3, 0xf1, 0x3e, 0x1c, 0x27, 0x9b, 0xcd, 0xb6, 0x42, 0x15, 0x5c, 0x9e, 0xde, 0xcc, + 0xfc, 0xff, 0xbf, 0x99, 0xff, 0xef, 0xff, 0x31, 0x1f, 0x70, 0xc3, 0xf1, 0x78, 0xd7, 0xe3, 0x65, + 0x2e, 0xf0, 0x3e, 0x65, 0xed, 0xf2, 0xdd, 0x5b, 0x2d, 0x22, 0xf0, 0xad, 0xa0, 0x5d, 0xea, 0xf9, + 0x9e, 0xf0, 0xd0, 0x65, 0x2d, 0x55, 0x0a, 0x7a, 0x8d, 0x54, 0xee, 0x62, 0xdb, 0x6b, 0x7b, 0x4a, + 0xa4, 0x2c, 0xff, 0xb4, 0x74, 0xee, 0x6a, 0xdb, 0xf3, 0xda, 0x1d, 0x52, 0x56, 0xad, 0x56, 0x7f, + 0xb7, 0x8c, 0xd9, 0xc0, 0x0c, 0x2d, 0x1c, 0x1f, 0x72, 0xfb, 0x3e, 0x16, 0xd4, 0x63, 0x66, 0x3c, + 0x7f, 0x7c, 0x5c, 0xd0, 0x2e, 0xe1, 0x02, 0x77, 0x7b, 0x01, 0xb6, 0x5e, 0x89, 0xad, 0x27, 0x35, + 0xcb, 0x32, 0xd8, 0xc6, 0x94, 0x16, 0xe6, 0x24, 0xb4, 0xc3, 0xf1, 0x68, 0x80, 0x3d, 0x8f, 0xbb, + 0x94, 0x79, 0x65, 0xf5, 0x35, 0x5d, 0x9f, 0x11, 0x84, 0xb9, 0xc4, 0xef, 0x52, 0x26, 0xca, 0x62, + 0xd0, 0x23, 0x5c, 0x7f, 0xcd, 0xe8, 0xb5, 0xd8, 0x28, 0x6e, 0x39, 0x34, 0x3e, 0x58, 0xfc, 0xa9, + 0x05, 0x73, 0x77, 0x28, 0x17, 0x9e, 0x4f, 0x1d, 0xdc, 0xa9, 0xb3, 0x5d, 0x0f, 0x7d, 0x09, 0x92, + 0x7b, 0x04, 0xbb, 0xc4, 0xcf, 0x5a, 0x05, 0x6b, 0x31, 0xb5, 0x9c, 0x2d, 0x45, 0x00, 0x25, 0xad, + 0x7b, 0x47, 0x8d, 0x57, 0xa6, 0x3f, 0x38, 0xca, 0x8f, 0xbd, 0xf7, 0xe1, 0xfb, 0x37, 0xad, 0x86, + 0x51, 0x41, 0x55, 0x48, 0xde, 0xc5, 0x1d, 0x4e, 0x44, 0x76, 0xbc, 0x90, 0x58, 0x4c, 0x2d, 0x5f, + 0x2f, 0x9d, 0xcc, 0x79, 0x69, 0x07, 0x77, 0xa8, 0x8b, 0x85, 0x37, 0x8c, 0xa2, 0x75, 0x8b, 0x3f, + 0x1b, 0x87, 0xf4, 0x9a, 0xd7, 0xed, 0x52, 0xce, 0xa9, 0xc7, 0x1a, 0x58, 0x10, 0x8e, 0xde, 0x80, + 0x09, 0x1f, 0x0b, 0xa2, 0x16, 0x35, 0x5d, 0x79, 0x4d, 0x2a, 0xfd, 0xf9, 0x28, 0x7f, 0x4d, 0xc3, + 0x73, 0x77, 0xbf, 0x44, 0xbd, 0x72, 0x17, 0x8b, 0xbd, 0xd2, 0x9b, 0xa4, 0x8d, 0x9d, 0x41, 0x95, + 0x38, 0x8f, 0x1e, 0x2c, 0x81, 0x99, 0xbd, 0x4a, 0x1c, 0x3d, 0x83, 0xc2, 0x40, 0x5f, 0x87, 0xa9, + 0x2e, 0x3e, 0xb0, 0x15, 0xde, 0xf8, 0xc7, 0xc2, 0x9b, 0xec, 0xe2, 0x03, 0xb9, 0x3e, 0xf4, 0x3d, + 0x48, 0x4b, 0x48, 0x67, 0x0f, 0xb3, 0x36, 0xd1, 0xc8, 0x89, 0x8f, 0x85, 0x3c, 0xdb, 0xc5, 0x07, + 0x6b, 0x0a, 0x4d, 0xe2, 0xaf, 0x4c, 0x7c, 0x74, 0x3f, 0x6f, 0x15, 0x7f, 0x67, 0x01, 0x44, 0xc4, + 0x20, 0x0c, 0x19, 0x27, 0x6c, 0xa9, 0x49, 0xb9, 0x71, 0xda, 0xcb, 0xa7, 0xf1, 0x7e, 0x8c, 0xd6, + 0xca, 0xac, 0x5c, 0xde, 0xc3, 0xa3, 0xbc, 0xa5, 0x67, 0x4d, 0x3b, 0x23, 0xb4, 0xa7, 0xfa, 0x3d, + 0x17, 0x0b, 0x62, 0xcb, 0x18, 0x56, 0x6c, 0xa5, 0x96, 0x73, 0x25, 0x1d, 0xe0, 0xa5, 0x20, 0xc0, + 0x4b, 0x5b, 0x41, 0x80, 0x6b, 0xc0, 0x77, 0xff, 0x1a, 0x00, 0x82, 0xd6, 0x96, 0xe3, 0xc6, 0x86, + 0xf7, 0x2c, 0x48, 0x55, 0x09, 0x77, 0x7c, 0xda, 0x93, 0x29, 0x83, 0xb2, 0x30, 0xd9, 0xf5, 0x18, + 0xdd, 0x37, 0x01, 0x37, 0xdd, 0x08, 0x9a, 0x28, 0x07, 0x53, 0xd4, 0x25, 0x4c, 0x50, 0x31, 0xd0, + 0x6e, 0x6a, 0x84, 0x6d, 0xa9, 0xf5, 0x43, 0xd2, 0xe2, 0x34, 0xe0, 0xb9, 0x11, 0x34, 0xd1, 0x2b, + 0x90, 0xe1, 0xc4, 0xe9, 0xfb, 0x54, 0x0c, 0x6c, 0xc7, 0x63, 0x02, 0x3b, 0x22, 0x3b, 0xa1, 0x44, + 0xd2, 0x41, 0xff, 0x9a, 0xee, 0x96, 0x20, 0x2e, 0x11, 0x98, 0x76, 0x78, 0xf6, 0x05, 0x0d, 0x62, + 0x9a, 0x66, 0xa9, 0x87, 0x93, 0x30, 0x1d, 0x06, 0x2a, 0x5a, 0x83, 0x8c, 0xd7, 0x23, 0xbe, 0xfc, + 0xb7, 0xb1, 0xeb, 0xfa, 0x84, 0x73, 0x13, 0x8d, 0xd9, 0x47, 0x0f, 0x96, 0x2e, 0x1a, 0xc2, 0x57, + 0xf5, 0x48, 0x53, 0xf8, 0x94, 0xb5, 0x1b, 0xe9, 0x40, 0xc3, 0x74, 0xa3, 0xb7, 0xa5, 0xcb, 0x18, + 0x27, 0x8c, 0xf7, 0xb9, 0xdd, 0xeb, 0xb7, 0xf6, 0xc9, 0xc0, 0x90, 0x7a, 0x71, 0x84, 0xd4, 0x55, + 0x36, 0xa8, 0x64, 0xff, 0x10, 0x41, 0x3b, 0xfe, 0xa0, 0x27, 0xbc, 0xd2, 0x66, 0xbf, 0xf5, 0x35, + 0x32, 0x90, 0xae, 0x32, 0x38, 0x9b, 0x0a, 0x06, 0x5d, 0x86, 0xe4, 0xf7, 0x31, 0xed, 0x10, 0x57, + 0x31, 0x32, 0xd5, 0x30, 0x2d, 0xb4, 0x02, 0x49, 0x2e, 0xb0, 0xe8, 0x73, 0x45, 0xc3, 0xdc, 0x72, + 0xf1, 0xb4, 0xd8, 0xa8, 0x78, 0xcc, 0x6d, 0x2a, 0xc9, 0x86, 0xd1, 0x40, 0x6b, 0x90, 0x14, 0xde, + 0x3e, 0x61, 0x86, 0xa0, 0xca, 0xe7, 0x4d, 0x34, 0x5f, 0x1a, 0x8d, 0xe6, 0x3a, 0x13, 0xb1, 0x38, + 0xae, 0x33, 0xd1, 0x30, 0xaa, 0xe8, 0x3b, 0x90, 0x71, 0x49, 0x87, 0xb4, 0x15, 0x73, 0x7c, 0x0f, + 0xfb, 0x84, 0x67, 0x93, 0x0a, 0xee, 0xd6, 0xb9, 0x93, 0xa3, 0x91, 0x0e, 0xa1, 0x9a, 0x0a, 0x09, + 0x6d, 0x42, 0xca, 0x8d, 0xc2, 0x29, 0x3b, 0xa9, 0xc8, 0x7c, 0xe9, 0x34, 0x1b, 0x63, 0x91, 0x17, + 0xaf, 0x3c, 0x71, 0x08, 0x19, 0x41, 0x7d, 0xd6, 0xf2, 0x98, 0x4b, 0x59, 0xdb, 0xde, 0x23, 0xb4, + 0xbd, 0x27, 0xb2, 0x53, 0x05, 0x6b, 0x31, 0xd1, 0x48, 0x87, 0xfd, 0x77, 0x54, 0x37, 0xda, 0x84, + 0xb9, 0x48, 0x54, 0x65, 0xc8, 0xf4, 0x79, 0x33, 0x64, 0x36, 0x04, 0x90, 0x22, 0xe8, 0x2d, 0x80, + 0x28, 0x07, 0xb3, 0xa0, 0xd0, 0x8a, 0x67, 0x67, 0x73, 0xdc, 0x98, 0x18, 0x00, 0xfa, 0x36, 0x5c, + 0xe8, 0x52, 0x66, 0x73, 0xd2, 0xd9, 0xb5, 0x0d, 0x73, 0x12, 0x37, 0x75, 0x7e, 0x6f, 0xce, 0x77, + 0x29, 0x6b, 0x92, 0xce, 0x6e, 0x35, 0x44, 0x41, 0x5f, 0x86, 0x6b, 0x91, 0xf5, 0x1e, 0xb3, 0xf7, + 0xbc, 0x8e, 0x6b, 0xfb, 0x64, 0xd7, 0x76, 0xbc, 0x3e, 0x13, 0xd9, 0x19, 0xc5, 0xd9, 0x95, 0x50, + 0x64, 0x83, 0xdd, 0xf1, 0x3a, 0x6e, 0x83, 0xec, 0xae, 0xc9, 0x61, 0xf4, 0x12, 0x44, 0xa6, 0xdb, + 0xd4, 0xe5, 0xd9, 0xd9, 0x42, 0x62, 0x71, 0xa2, 0x31, 0x13, 0x76, 0xd6, 0x5d, 0xbe, 0x32, 0xf5, + 0xce, 0xfd, 0xfc, 0xd8, 0x47, 0xf7, 0xf3, 0x63, 0xc5, 0xdb, 0x30, 0xb3, 0x83, 0x3b, 0x26, 0x8f, + 0x08, 0x47, 0xaf, 0xc1, 0x34, 0x0e, 0x1a, 0x59, 0xab, 0x90, 0x78, 0x6a, 0x1e, 0x46, 0xa2, 0xc5, + 0xdf, 0x58, 0x90, 0xac, 0xee, 0x6c, 0x62, 0xea, 0xa3, 0x1a, 0xcc, 0x47, 0x81, 0xf9, 0xac, 0x29, + 0x1d, 0xc5, 0x72, 0x90, 0xd3, 0xeb, 0x30, 0x7f, 0x37, 0xa8, 0x12, 0x21, 0x8c, 0xde, 0x57, 0xae, + 0x3f, 0x7a, 0xb0, 0xf4, 0xa2, 0x81, 0x09, 0x2b, 0xc9, 0x31, 0xbc, 0xbb, 0xc7, 0xfa, 0x63, 0x36, + 0xbf, 0x01, 0x93, 0x7a, 0xa9, 0x1c, 0x7d, 0x15, 0x5e, 0xe8, 0xc9, 0x1f, 0x65, 0x6a, 0x6a, 0x79, + 0xe1, 0xd4, 0x00, 0x57, 0xf2, 0xf1, 0x70, 0xd0, 0x7a, 0xc5, 0x1f, 0x8f, 0x03, 0x54, 0x77, 0x76, + 0xb6, 0x7c, 0xda, 0xeb, 0x10, 0xf1, 0x49, 0xd9, 0xbe, 0x0d, 0x97, 0x22, 0xdb, 0xb9, 0xef, 0x9c, + 0xdf, 0xfe, 0x0b, 0xa1, 0x7e, 0xd3, 0x77, 0x4e, 0x84, 0x75, 0xb9, 0x08, 0x61, 0x13, 0xe7, 0x87, + 0xad, 0x72, 0x31, 0xca, 0xec, 0x37, 0x21, 0x15, 0x91, 0xc1, 0x51, 0x1d, 0xa6, 0x84, 0xf9, 0x37, + 0x04, 0x17, 0x4f, 0x27, 0x38, 0x50, 0x8b, 0x93, 0x1c, 0xaa, 0x17, 0xff, 0x6d, 0x01, 0xc4, 0x72, + 0xe4, 0xd3, 0x19, 0x63, 0xa8, 0x0e, 0x49, 0x53, 0x89, 0x13, 0xcf, 0x5b, 0x89, 0x0d, 0x40, 0x8c, + 0xd4, 0x9f, 0x8c, 0xc3, 0x85, 0xed, 0x20, 0x7b, 0x3f, 0xfd, 0x1c, 0x6c, 0xc3, 0x24, 0x61, 0xc2, + 0xa7, 0x8a, 0x04, 0xe9, 0xf3, 0x2f, 0x9c, 0xe6, 0xf3, 0x13, 0x8c, 0xaa, 0x31, 0xe1, 0x0f, 0xe2, + 0x11, 0x10, 0x60, 0xc5, 0xf8, 0xf8, 0x45, 0x02, 0xb2, 0xa7, 0xa9, 0xa2, 0x97, 0x21, 0xed, 0xf8, + 0x44, 0x75, 0x04, 0x9b, 0x8c, 0xa5, 0x0a, 0xe6, 0x5c, 0xd0, 0x6d, 0xf6, 0x98, 0x06, 0xc8, 0x53, + 0x99, 0x0c, 0x2e, 0x29, 0xfa, 0x7c, 0xc7, 0xb0, 0xb9, 0x08, 0x41, 0xed, 0x32, 0x5b, 0x90, 0xa6, + 0x8c, 0x0a, 0x8a, 0x3b, 0x76, 0x0b, 0x77, 0x30, 0x73, 0x82, 0xe3, 0xea, 0xb9, 0xb6, 0x84, 0x39, + 0x83, 0x51, 0xd1, 0x10, 0xa8, 0x06, 0x93, 0x01, 0xda, 0xc4, 0xf9, 0xd1, 0x02, 0x5d, 0x74, 0x1d, + 0x66, 0xe2, 0x1b, 0x83, 0x3a, 0x7a, 0x4c, 0x34, 0x52, 0xb1, 0x7d, 0xe1, 0xac, 0x9d, 0x27, 0xf9, + 0xd4, 0x9d, 0xc7, 0x9c, 0xee, 0x7e, 0x95, 0x80, 0xf9, 0x06, 0x71, 0xff, 0xf7, 0xdd, 0xb2, 0x09, + 0xa0, 0x53, 0x55, 0x56, 0x52, 0xe3, 0x99, 0xe7, 0xc8, 0xf7, 0x69, 0x0d, 0x52, 0xe5, 0xe2, 0xbf, + 0xe5, 0xa1, 0xbf, 0x8c, 0xc3, 0x4c, 0xdc, 0x43, 0xff, 0x97, 0x9b, 0x16, 0x5a, 0x8f, 0xca, 0xd4, + 0x84, 0x2a, 0x53, 0xaf, 0x9c, 0x56, 0xa6, 0x46, 0xa2, 0xf9, 0x8c, 0xfa, 0xf4, 0xcb, 0x04, 0x24, + 0x37, 0xb1, 0x8f, 0xbb, 0x1c, 0x6d, 0x8c, 0x1c, 0x64, 0xf5, 0x45, 0xf2, 0xea, 0x48, 0x30, 0x57, + 0xcd, 0x5b, 0x87, 0x8e, 0xe5, 0x9f, 0x9f, 0x76, 0x8e, 0xfd, 0x2c, 0xcc, 0xc9, 0x0b, 0x71, 0x68, + 0x90, 0x26, 0x77, 0x56, 0xdd, 0x6b, 0x43, 0xeb, 0x39, 0xca, 0x43, 0x4a, 0x8a, 0x45, 0x75, 0x58, + 0xca, 0x40, 0x17, 0x1f, 0xd4, 0x74, 0x0f, 0x5a, 0x02, 0xb4, 0x17, 0x3e, 0x50, 0xd8, 0x11, 0x11, + 0x52, 0x6e, 0x3e, 0x1a, 0x09, 0xc4, 0x5f, 0x04, 0x90, 0xab, 0xb0, 0x5d, 0xc2, 0xbc, 0xae, 0xb9, + 0xd5, 0x4d, 0xcb, 0x9e, 0xaa, 0xec, 0x40, 0x3f, 0xb2, 0xf4, 0x79, 0xf8, 0xd8, 0xb5, 0xd9, 0x5c, + 0x47, 0xb6, 0x9e, 0x21, 0x29, 0xfe, 0x75, 0x94, 0xcf, 0x0d, 0x70, 0xb7, 0xb3, 0x52, 0x3c, 0x01, + 0xa7, 0x78, 0xd2, 0x4d, 0x5e, 0x1e, 0x9c, 0x87, 0xaf, 0xdd, 0x2b, 0x37, 0x64, 0x78, 0x1f, 0x7e, + 0xf8, 0xfe, 0x4d, 0x33, 0xd3, 0x12, 0x77, 0xf7, 0xcb, 0x07, 0xe1, 0xf3, 0x95, 0xf6, 0x89, 0x3c, + 0xa9, 0xa2, 0x68, 0xd7, 0x68, 0x10, 0xde, 0x93, 0x37, 0x3e, 0x79, 0x43, 0x88, 0x9d, 0xe4, 0xad, + 0xa7, 0xdf, 0x10, 0x22, 0xfd, 0xa1, 0x1b, 0x42, 0x2c, 0xa7, 0xbe, 0x12, 0x15, 0xed, 0x71, 0xe3, + 0x72, 0x83, 0xd5, 0xc2, 0x9c, 0xc4, 0xae, 0x1a, 0x74, 0x08, 0x22, 0x50, 0x52, 0xa9, 0x3a, 0x56, + 0xfc, 0xa3, 0x05, 0x57, 0x47, 0xc2, 0x2f, 0x5c, 0xb2, 0x03, 0xc8, 0x8f, 0x0d, 0x2a, 0x37, 0x0e, + 0xcc, 0xd2, 0x9f, 0x2f, 0x9a, 0xe7, 0xfd, 0x91, 0xca, 0xfd, 0xc9, 0xec, 0x3e, 0xa6, 0xf4, 0xfc, + 0xde, 0x82, 0x8b, 0xf1, 0x05, 0x84, 0xa6, 0x34, 0x61, 0x26, 0x3e, 0xb5, 0x31, 0xe2, 0xc6, 0xb3, + 0x18, 0x11, 0x5f, 0xff, 0x10, 0x08, 0xda, 0x89, 0x52, 0x5c, 0xbf, 0x9b, 0xdd, 0x7a, 0x66, 0x52, + 0x82, 0x85, 0x9d, 0x98, 0xea, 0xda, 0x37, 0xff, 0xb0, 0x60, 0x62, 0xd3, 0xf3, 0x3a, 0xe8, 0x07, + 0x30, 0xcf, 0x3c, 0x61, 0xcb, 0x74, 0x20, 0xae, 0x6d, 0x2e, 0xf6, 0xba, 0x7c, 0xd6, 0x9e, 0xca, + 0xd5, 0xdf, 0x8f, 0xf2, 0xa3, 0x9a, 0xc3, 0x04, 0x9a, 0xf7, 0x23, 0xe6, 0x89, 0x8a, 0x12, 0xda, + 0xd2, 0x77, 0xff, 0x5d, 0x98, 0x1d, 0x9e, 0x4e, 0x97, 0xd8, 0xd5, 0xb3, 0xa6, 0x9b, 0x3d, 0x73, + 0xaa, 0x99, 0x56, 0x6c, 0x9e, 0x95, 0x29, 0xe9, 0xb5, 0x7f, 0x4a, 0xcf, 0xbd, 0x0d, 0x99, 0xb0, + 0xbe, 0x6c, 0xab, 0xc7, 0x27, 0x2e, 0x43, 0x43, 0xbf, 0x43, 0x05, 0xa7, 0xfb, 0x42, 0xfc, 0x51, + 0x13, 0xb7, 0x1c, 0x5a, 0x3a, 0xa6, 0x33, 0x44, 0xa7, 0xd1, 0xbd, 0xf9, 0x5b, 0x0b, 0x20, 0x7a, + 0x24, 0x41, 0xaf, 0xc2, 0x95, 0xca, 0xc6, 0x7a, 0xd5, 0x6e, 0x6e, 0xad, 0x6e, 0x6d, 0x37, 0xed, + 0xed, 0xf5, 0xe6, 0x66, 0x6d, 0xad, 0x7e, 0xbb, 0x5e, 0xab, 0x66, 0xc6, 0x72, 0xe9, 0xc3, 0x7b, + 0x85, 0xd4, 0x36, 0xe3, 0x3d, 0xe2, 0xd0, 0x5d, 0x4a, 0x5c, 0xf4, 0x39, 0xb8, 0x38, 0x2c, 0x2d, + 0x5b, 0xb5, 0x6a, 0xc6, 0xca, 0xcd, 0x1c, 0xde, 0x2b, 0x4c, 0xe9, 0x73, 0x22, 0x71, 0xd1, 0x22, + 0x5c, 0x1a, 0x95, 0xab, 0xaf, 0xbf, 0x9e, 0x19, 0xcf, 0xcd, 0x1e, 0xde, 0x2b, 0x4c, 0x87, 0x07, + 0x4a, 0x54, 0x04, 0x14, 0x97, 0x34, 0x78, 0x89, 0x1c, 0x1c, 0xde, 0x2b, 0x24, 0xb5, 0x17, 0x72, + 0x13, 0xef, 0xfc, 0x7a, 0x61, 0xec, 0xe6, 0x77, 0x01, 0xea, 0x6c, 0xd7, 0xc7, 0x8e, 0x8a, 0xb6, + 0x1c, 0x5c, 0xae, 0xaf, 0xdf, 0x6e, 0xac, 0xae, 0x6d, 0xd5, 0x37, 0xd6, 0x87, 0x97, 0x7d, 0x6c, + 0xac, 0xba, 0xb1, 0x5d, 0x79, 0xb3, 0x66, 0x37, 0xeb, 0xaf, 0xaf, 0x67, 0x2c, 0x74, 0x05, 0x2e, + 0x0c, 0x8d, 0x7d, 0x63, 0x7d, 0xab, 0xfe, 0x56, 0x2d, 0x33, 0x5e, 0xb9, 0xfd, 0xc1, 0xe3, 0x05, + 0xeb, 0xe1, 0xe3, 0x05, 0xeb, 0x6f, 0x8f, 0x17, 0xac, 0x77, 0x9f, 0x2c, 0x8c, 0x3d, 0x7c, 0xb2, + 0x30, 0xf6, 0xa7, 0x27, 0x0b, 0x63, 0xdf, 0x7a, 0xb5, 0x4d, 0xc5, 0x5e, 0xbf, 0x55, 0x72, 0xbc, + 0xae, 0x79, 0xe6, 0x2e, 0x9f, 0x58, 0xf1, 0xd4, 0xbb, 0x72, 0x2b, 0xa9, 0x36, 0x99, 0x2f, 0xfe, + 0x27, 0x00, 0x00, 0xff, 0xff, 0x7a, 0x6b, 0x77, 0xd8, 0xcf, 0x17, 0x00, 0x00, } func (this *Pool) Description() (desc *github_com_cosmos_gogoproto_protoc_gen_gogo_descriptor.FileDescriptorSet) { @@ -1403,706 +1404,794 @@ func (this *Pool) Description() (desc *github_com_cosmos_gogoproto_protoc_gen_go func StakingDescription() (desc *github_com_cosmos_gogoproto_protoc_gen_gogo_descriptor.FileDescriptorSet) { d := &github_com_cosmos_gogoproto_protoc_gen_gogo_descriptor.FileDescriptorSet{} var gzipped = []byte{ - // 11178 bytes of a gzipped FileDescriptorSet - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0xbd, 0x69, 0x90, 0x1c, 0x47, - 0x76, 0x1f, 0x3e, 0x7d, 0x4c, 0x1f, 0xaf, 0xaf, 0x9a, 0x9c, 0x01, 0x30, 0x68, 0x90, 0x33, 0xc3, - 0xe2, 0x92, 0x00, 0x41, 0x72, 0x40, 0x82, 0x04, 0x48, 0x0e, 0x96, 0xcb, 0x7f, 0x77, 0x4f, 0x63, - 0xd0, 0xe0, 0x5c, 0xac, 0xee, 0x01, 0x0f, 0x1d, 0xa5, 0x9a, 0xea, 0x9c, 0x9e, 0x22, 0xba, 0xab, - 0x7a, 0xab, 0xaa, 0x81, 0x19, 0xc6, 0x3f, 0x1c, 0x2b, 0xad, 0x64, 0xaf, 0x60, 0x59, 0x5a, 0x1d, - 0x61, 0xad, 0xa4, 0x85, 0xcc, 0x95, 0x2c, 0xed, 0x4a, 0xbe, 0x74, 0xac, 0xb5, 0x92, 0x15, 0x92, - 0x25, 0x87, 0x0f, 0x49, 0x76, 0x38, 0xd6, 0xfa, 0x60, 0x2b, 0x1c, 0x61, 0x5a, 0xe2, 0x2a, 0xa4, - 0xf5, 0x6a, 0x65, 0x5d, 0x94, 0x6d, 0x79, 0xc3, 0x0a, 0x47, 0x5e, 0x75, 0xf4, 0x31, 0xdd, 0x03, - 0x91, 0xd4, 0xda, 0xf2, 0x17, 0xa0, 0x2b, 0xf3, 0xbd, 0x5f, 0x65, 0xbe, 0x7c, 0xf9, 0xf2, 0xbd, - 0x97, 0x59, 0x39, 0xf0, 0x5b, 0x65, 0x58, 0x6a, 0x59, 0x56, 0xab, 0x8d, 0x2f, 0x74, 0x6d, 0xcb, - 0xb5, 0x76, 0x7b, 0x7b, 0x17, 0x9a, 0xd8, 0xd1, 0x6d, 0xa3, 0xeb, 0x5a, 0xf6, 0x32, 0x2d, 0x43, - 0x05, 0x46, 0xb1, 0x2c, 0x28, 0xe4, 0x0d, 0x98, 0xb9, 0x6a, 0xb4, 0xf1, 0xaa, 0x47, 0x58, 0xc7, - 0x2e, 0x7a, 0x16, 0xe2, 0x7b, 0x46, 0x1b, 0xcf, 0x47, 0x96, 0x62, 0xe7, 0x32, 0x17, 0x3f, 0xb0, - 0xdc, 0xc7, 0xb4, 0x1c, 0xe6, 0xd8, 0x26, 0xc5, 0x0a, 0xe5, 0x90, 0xff, 0x3c, 0x0e, 0xb3, 0x43, - 0x6a, 0x11, 0x82, 0xb8, 0xa9, 0x75, 0x08, 0x62, 0xe4, 0x5c, 0x5a, 0xa1, 0xbf, 0xd1, 0x3c, 0x24, - 0xbb, 0x9a, 0x7e, 0x53, 0x6b, 0xe1, 0xf9, 0x28, 0x2d, 0x16, 0x8f, 0x68, 0x01, 0xa0, 0x89, 0xbb, - 0xd8, 0x6c, 0x62, 0x53, 0x3f, 0x9c, 0x8f, 0x2d, 0xc5, 0xce, 0xa5, 0x95, 0x40, 0x09, 0x7a, 0x14, - 0x66, 0xba, 0xbd, 0xdd, 0xb6, 0xa1, 0xab, 0x01, 0x32, 0x58, 0x8a, 0x9d, 0x9b, 0x56, 0x24, 0x56, - 0xb1, 0xea, 0x13, 0x9f, 0x85, 0xc2, 0x6d, 0xac, 0xdd, 0x0c, 0x92, 0x66, 0x28, 0x69, 0x9e, 0x14, - 0x07, 0x08, 0x2b, 0x90, 0xed, 0x60, 0xc7, 0xd1, 0x5a, 0x58, 0x75, 0x0f, 0xbb, 0x78, 0x3e, 0x4e, - 0x7b, 0xbf, 0x34, 0xd0, 0xfb, 0xfe, 0x9e, 0x67, 0x38, 0x57, 0xe3, 0xb0, 0x8b, 0x51, 0x09, 0xd2, - 0xd8, 0xec, 0x75, 0x18, 0xc2, 0xf4, 0x08, 0xf9, 0x55, 0xcd, 0x5e, 0xa7, 0x1f, 0x25, 0x45, 0xd8, - 0x38, 0x44, 0xd2, 0xc1, 0xf6, 0x2d, 0x43, 0xc7, 0xf3, 0x09, 0x0a, 0x70, 0x76, 0x00, 0xa0, 0xce, - 0xea, 0xfb, 0x31, 0x04, 0x1f, 0xaa, 0x40, 0x1a, 0x1f, 0xb8, 0xd8, 0x74, 0x0c, 0xcb, 0x9c, 0x4f, - 0x52, 0x90, 0x87, 0x86, 0x8c, 0x22, 0x6e, 0x37, 0xfb, 0x21, 0x7c, 0x3e, 0x74, 0x19, 0x92, 0x56, - 0xd7, 0x35, 0x2c, 0xd3, 0x99, 0x4f, 0x2d, 0x45, 0xce, 0x65, 0x2e, 0xde, 0x37, 0x54, 0x11, 0xb6, - 0x18, 0x8d, 0x22, 0x88, 0x51, 0x0d, 0x24, 0xc7, 0xea, 0xd9, 0x3a, 0x56, 0x75, 0xab, 0x89, 0x55, - 0xc3, 0xdc, 0xb3, 0xe6, 0xd3, 0x14, 0x60, 0x71, 0xb0, 0x23, 0x94, 0xb0, 0x62, 0x35, 0x71, 0xcd, - 0xdc, 0xb3, 0x94, 0xbc, 0x13, 0x7a, 0x46, 0x27, 0x21, 0xe1, 0x1c, 0x9a, 0xae, 0x76, 0x30, 0x9f, - 0xa5, 0x1a, 0xc2, 0x9f, 0x88, 0xea, 0xe0, 0xa6, 0x41, 0x5e, 0x37, 0x9f, 0x63, 0xaa, 0xc3, 0x1f, - 0xe5, 0x9f, 0x4b, 0x40, 0x61, 0x12, 0xe5, 0xbb, 0x02, 0xd3, 0x7b, 0xa4, 0xff, 0xf3, 0xd1, 0xe3, - 0x48, 0x87, 0xf1, 0x84, 0xc5, 0x9b, 0xb8, 0x47, 0xf1, 0x96, 0x20, 0x63, 0x62, 0xc7, 0xc5, 0x4d, - 0xa6, 0x2b, 0xb1, 0x09, 0xb5, 0x0d, 0x18, 0xd3, 0xa0, 0xb2, 0xc5, 0xef, 0x49, 0xd9, 0x5e, 0x81, - 0x82, 0xd7, 0x24, 0xd5, 0xd6, 0xcc, 0x96, 0xd0, 0xda, 0x0b, 0xe3, 0x5a, 0xb2, 0x5c, 0x15, 0x7c, - 0x0a, 0x61, 0x53, 0xf2, 0x38, 0xf4, 0x8c, 0x56, 0x01, 0x2c, 0x13, 0x5b, 0x7b, 0x6a, 0x13, 0xeb, - 0xed, 0xf9, 0xd4, 0x08, 0x29, 0x6d, 0x11, 0x92, 0x01, 0x29, 0x59, 0xac, 0x54, 0x6f, 0xa3, 0xe7, - 0x7c, 0x25, 0x4c, 0x8e, 0xd0, 0xa1, 0x0d, 0x36, 0xfd, 0x06, 0xf4, 0x70, 0x07, 0xf2, 0x36, 0x26, - 0x33, 0x02, 0x37, 0x79, 0xcf, 0xd2, 0xb4, 0x11, 0xcb, 0x63, 0x7b, 0xa6, 0x70, 0x36, 0xd6, 0xb1, - 0x9c, 0x1d, 0x7c, 0x44, 0x0f, 0x82, 0x57, 0xa0, 0x52, 0xb5, 0x02, 0x6a, 0x9f, 0xb2, 0xa2, 0x70, - 0x53, 0xeb, 0xe0, 0xe2, 0x1b, 0x90, 0x0f, 0x8b, 0x07, 0xcd, 0xc1, 0xb4, 0xe3, 0x6a, 0xb6, 0x4b, - 0xb5, 0x70, 0x5a, 0x61, 0x0f, 0x48, 0x82, 0x18, 0x36, 0x9b, 0xd4, 0xfe, 0x4d, 0x2b, 0xe4, 0x27, - 0xfa, 0xff, 0xfc, 0x0e, 0xc7, 0x68, 0x87, 0x1f, 0x1e, 0x1c, 0xd1, 0x10, 0x72, 0x7f, 0xbf, 0x8b, - 0xcf, 0x40, 0x2e, 0xd4, 0x81, 0x49, 0x5f, 0x2d, 0xff, 0xff, 0x70, 0x62, 0x28, 0x34, 0x7a, 0x05, - 0xe6, 0x7a, 0xa6, 0x61, 0xba, 0xd8, 0xee, 0xda, 0x98, 0x68, 0x2c, 0x7b, 0xd5, 0xfc, 0xef, 0x26, - 0x47, 0xe8, 0xdc, 0x4e, 0x90, 0x9a, 0xa1, 0x28, 0xb3, 0xbd, 0xc1, 0xc2, 0xf3, 0xe9, 0xd4, 0x17, - 0x93, 0xd2, 0x47, 0x3e, 0xf2, 0x91, 0x8f, 0x44, 0xe5, 0x5f, 0x4e, 0xc0, 0xdc, 0xb0, 0x39, 0x33, - 0x74, 0xfa, 0x9e, 0x84, 0x84, 0xd9, 0xeb, 0xec, 0x62, 0x9b, 0x0a, 0x69, 0x5a, 0xe1, 0x4f, 0xa8, - 0x04, 0xd3, 0x6d, 0x6d, 0x17, 0xb7, 0xe7, 0xe3, 0x4b, 0x91, 0x73, 0xf9, 0x8b, 0x8f, 0x4e, 0x34, - 0x2b, 0x97, 0xd7, 0x09, 0x8b, 0xc2, 0x38, 0xd1, 0x87, 0x20, 0xce, 0x8d, 0x37, 0x41, 0x38, 0x3f, - 0x19, 0x02, 0x99, 0x4b, 0x0a, 0xe5, 0x43, 0x67, 0x20, 0x4d, 0xfe, 0x67, 0xba, 0x91, 0xa0, 0x6d, - 0x4e, 0x91, 0x02, 0xa2, 0x17, 0xa8, 0x08, 0x29, 0x3a, 0x4d, 0x9a, 0x58, 0x2c, 0x7a, 0xde, 0x33, - 0x51, 0xac, 0x26, 0xde, 0xd3, 0x7a, 0x6d, 0x57, 0xbd, 0xa5, 0xb5, 0x7b, 0x98, 0x2a, 0x7c, 0x5a, - 0xc9, 0xf2, 0xc2, 0x1b, 0xa4, 0x0c, 0x2d, 0x42, 0x86, 0xcd, 0x2a, 0xc3, 0x6c, 0xe2, 0x03, 0x6a, - 0x57, 0xa7, 0x15, 0x36, 0xd1, 0x6a, 0xa4, 0x84, 0xbc, 0xfe, 0x75, 0xc7, 0x32, 0x85, 0x6a, 0xd2, - 0x57, 0x90, 0x02, 0xfa, 0xfa, 0x67, 0xfa, 0x4d, 0xfa, 0xfd, 0xc3, 0xbb, 0x37, 0x30, 0x97, 0xce, - 0x42, 0x81, 0x52, 0x3c, 0xc5, 0x87, 0x5e, 0x6b, 0xcf, 0xcf, 0x2c, 0x45, 0xce, 0xa5, 0x94, 0x3c, - 0x2b, 0xde, 0xe2, 0xa5, 0xf2, 0xcf, 0x44, 0x21, 0x4e, 0x0d, 0x4b, 0x01, 0x32, 0x8d, 0x57, 0xb7, - 0xab, 0xea, 0xea, 0xd6, 0x4e, 0x79, 0xbd, 0x2a, 0x45, 0x50, 0x1e, 0x80, 0x16, 0x5c, 0x5d, 0xdf, - 0x2a, 0x35, 0xa4, 0xa8, 0xf7, 0x5c, 0xdb, 0x6c, 0x5c, 0x7e, 0x5a, 0x8a, 0x79, 0x0c, 0x3b, 0xac, - 0x20, 0x1e, 0x24, 0x78, 0xea, 0xa2, 0x34, 0x8d, 0x24, 0xc8, 0x32, 0x80, 0xda, 0x2b, 0xd5, 0xd5, - 0xcb, 0x4f, 0x4b, 0x89, 0x70, 0xc9, 0x53, 0x17, 0xa5, 0x24, 0xca, 0x41, 0x9a, 0x96, 0x94, 0xb7, - 0xb6, 0xd6, 0xa5, 0x94, 0x87, 0x59, 0x6f, 0x28, 0xb5, 0xcd, 0x35, 0x29, 0xed, 0x61, 0xae, 0x29, - 0x5b, 0x3b, 0xdb, 0x12, 0x78, 0x08, 0x1b, 0xd5, 0x7a, 0xbd, 0xb4, 0x56, 0x95, 0x32, 0x1e, 0x45, - 0xf9, 0xd5, 0x46, 0xb5, 0x2e, 0x65, 0x43, 0xcd, 0x7a, 0xea, 0xa2, 0x94, 0xf3, 0x5e, 0x51, 0xdd, - 0xdc, 0xd9, 0x90, 0xf2, 0x68, 0x06, 0x72, 0xec, 0x15, 0xa2, 0x11, 0x85, 0xbe, 0xa2, 0xcb, 0x4f, - 0x4b, 0x92, 0xdf, 0x10, 0x86, 0x32, 0x13, 0x2a, 0xb8, 0xfc, 0xb4, 0x84, 0xe4, 0x0a, 0x4c, 0x53, - 0x35, 0x44, 0x08, 0xf2, 0xeb, 0xa5, 0x72, 0x75, 0x5d, 0xdd, 0xda, 0x6e, 0xd4, 0xb6, 0x36, 0x4b, - 0xeb, 0x52, 0xc4, 0x2f, 0x53, 0xaa, 0x2f, 0xed, 0xd4, 0x94, 0xea, 0xaa, 0x14, 0x0d, 0x96, 0x6d, - 0x57, 0x4b, 0x8d, 0xea, 0xaa, 0x14, 0x93, 0x75, 0x98, 0x1b, 0x66, 0x50, 0x87, 0x4e, 0xa1, 0x80, - 0x2e, 0x44, 0x47, 0xe8, 0x02, 0xc5, 0xea, 0xd7, 0x05, 0xf9, 0x0b, 0x51, 0x98, 0x1d, 0xb2, 0xa8, - 0x0c, 0x7d, 0xc9, 0x0b, 0x30, 0xcd, 0x74, 0x99, 0x2d, 0xb3, 0x8f, 0x0c, 0x5d, 0x9d, 0xa8, 0x66, - 0x0f, 0x2c, 0xb5, 0x94, 0x2f, 0xe8, 0x84, 0xc4, 0x46, 0x38, 0x21, 0x04, 0x62, 0x40, 0x61, 0xbf, - 0x6e, 0xc0, 0xf8, 0xb3, 0xf5, 0xf1, 0xf2, 0x24, 0xeb, 0x23, 0x2d, 0x3b, 0xde, 0x22, 0x30, 0x3d, - 0x64, 0x11, 0xb8, 0x02, 0x33, 0x03, 0x40, 0x13, 0x1b, 0xe3, 0x8f, 0x46, 0x60, 0x7e, 0x94, 0x70, - 0xc6, 0x98, 0xc4, 0x68, 0xc8, 0x24, 0x5e, 0xe9, 0x97, 0xe0, 0x03, 0xa3, 0x07, 0x61, 0x60, 0xac, - 0x3f, 0x1d, 0x81, 0x93, 0xc3, 0x9d, 0xcd, 0xa1, 0x6d, 0xf8, 0x10, 0x24, 0x3a, 0xd8, 0xdd, 0xb7, - 0x84, 0x5b, 0xf5, 0xf0, 0x90, 0xc5, 0x9a, 0x54, 0xf7, 0x0f, 0x36, 0xe7, 0x0a, 0xae, 0xf6, 0xb1, - 0x51, 0x1e, 0x23, 0x6b, 0xcd, 0x40, 0x4b, 0xbf, 0x35, 0x0a, 0x27, 0x86, 0x82, 0x0f, 0x6d, 0xe8, - 0xfd, 0x00, 0x86, 0xd9, 0xed, 0xb9, 0xcc, 0x75, 0x62, 0x96, 0x38, 0x4d, 0x4b, 0xa8, 0xf1, 0x22, - 0x56, 0xb6, 0xe7, 0x7a, 0xf5, 0x31, 0x5a, 0x0f, 0xac, 0x88, 0x12, 0x3c, 0xeb, 0x37, 0x34, 0x4e, - 0x1b, 0xba, 0x30, 0xa2, 0xa7, 0x03, 0x8a, 0xf9, 0x04, 0x48, 0x7a, 0xdb, 0xc0, 0xa6, 0xab, 0x3a, - 0xae, 0x8d, 0xb5, 0x8e, 0x61, 0xb6, 0xe8, 0x52, 0x93, 0x5a, 0x99, 0xde, 0xd3, 0xda, 0x0e, 0x56, - 0x0a, 0xac, 0xba, 0x2e, 0x6a, 0x09, 0x07, 0x55, 0x20, 0x3b, 0xc0, 0x91, 0x08, 0x71, 0xb0, 0x6a, - 0x8f, 0x43, 0xfe, 0xce, 0x34, 0x64, 0x02, 0xae, 0x39, 0x7a, 0x00, 0xb2, 0xaf, 0x6b, 0xb7, 0x34, - 0x55, 0x84, 0x5b, 0x4c, 0x12, 0x19, 0x52, 0xb6, 0xcd, 0x43, 0xae, 0x27, 0x60, 0x8e, 0x92, 0x58, - 0x3d, 0x17, 0xdb, 0xaa, 0xde, 0xd6, 0x1c, 0x87, 0x0a, 0x2d, 0x45, 0x49, 0x11, 0xa9, 0xdb, 0x22, - 0x55, 0x15, 0x51, 0x83, 0x2e, 0xc1, 0x2c, 0xe5, 0xe8, 0xf4, 0xda, 0xae, 0xd1, 0x6d, 0x63, 0x95, - 0x04, 0x80, 0x0e, 0x5d, 0x72, 0xbc, 0x96, 0xcd, 0x10, 0x8a, 0x0d, 0x4e, 0x40, 0x5a, 0xe4, 0xa0, - 0x55, 0xb8, 0x9f, 0xb2, 0xb5, 0xb0, 0x89, 0x6d, 0xcd, 0xc5, 0x2a, 0xfe, 0x70, 0x4f, 0x6b, 0x3b, - 0xaa, 0x66, 0x36, 0xd5, 0x7d, 0xcd, 0xd9, 0x9f, 0x9f, 0x23, 0x00, 0xe5, 0xe8, 0x7c, 0x44, 0x39, - 0x4d, 0x08, 0xd7, 0x38, 0x5d, 0x95, 0x92, 0x95, 0xcc, 0xe6, 0x35, 0xcd, 0xd9, 0x47, 0x2b, 0x70, - 0x92, 0xa2, 0x38, 0xae, 0x6d, 0x98, 0x2d, 0x55, 0xdf, 0xc7, 0xfa, 0x4d, 0xb5, 0xe7, 0xee, 0x3d, - 0x3b, 0x7f, 0x26, 0xf8, 0x7e, 0xda, 0xc2, 0x3a, 0xa5, 0xa9, 0x10, 0x92, 0x1d, 0x77, 0xef, 0x59, - 0x54, 0x87, 0x2c, 0x19, 0x8c, 0x8e, 0xf1, 0x06, 0x56, 0xf7, 0x2c, 0x9b, 0xae, 0xa1, 0xf9, 0x21, - 0xa6, 0x29, 0x20, 0xc1, 0xe5, 0x2d, 0xce, 0xb0, 0x61, 0x35, 0xf1, 0xca, 0x74, 0x7d, 0xbb, 0x5a, - 0x5d, 0x55, 0x32, 0x02, 0xe5, 0xaa, 0x65, 0x13, 0x85, 0x6a, 0x59, 0x9e, 0x80, 0x33, 0x4c, 0xa1, - 0x5a, 0x96, 0x10, 0xef, 0x25, 0x98, 0xd5, 0x75, 0xd6, 0x67, 0x43, 0x57, 0x79, 0x98, 0xe6, 0xcc, - 0x4b, 0x21, 0x61, 0xe9, 0xfa, 0x1a, 0x23, 0xe0, 0x3a, 0xee, 0xa0, 0xe7, 0xe0, 0x84, 0x2f, 0xac, - 0x20, 0xe3, 0xcc, 0x40, 0x2f, 0xfb, 0x59, 0x2f, 0xc1, 0x6c, 0xf7, 0x70, 0x90, 0x11, 0x85, 0xde, - 0xd8, 0x3d, 0xec, 0x67, 0x7b, 0x06, 0xe6, 0xba, 0xfb, 0xdd, 0x41, 0xbe, 0xf3, 0x41, 0x3e, 0xd4, - 0xdd, 0xef, 0xf6, 0x33, 0x3e, 0x44, 0x63, 0x76, 0x1b, 0xeb, 0x9a, 0x8b, 0x9b, 0xf3, 0xa7, 0x82, - 0xe4, 0x81, 0x0a, 0xb4, 0x0c, 0x92, 0xae, 0xab, 0xd8, 0xd4, 0x76, 0xdb, 0x58, 0xd5, 0x6c, 0x6c, - 0x6a, 0xce, 0xfc, 0x22, 0x25, 0x8e, 0xbb, 0x76, 0x0f, 0x2b, 0x79, 0x5d, 0xaf, 0xd2, 0xca, 0x12, - 0xad, 0x43, 0xe7, 0x61, 0xc6, 0xda, 0x7d, 0x5d, 0x67, 0x1a, 0xa9, 0x76, 0x6d, 0xbc, 0x67, 0x1c, - 0xcc, 0x7f, 0x80, 0x8a, 0xb7, 0x40, 0x2a, 0xa8, 0x3e, 0x6e, 0xd3, 0x62, 0xf4, 0x08, 0x48, 0xba, - 0xb3, 0xaf, 0xd9, 0x5d, 0x6a, 0x92, 0x9d, 0xae, 0xa6, 0xe3, 0xf9, 0x87, 0x18, 0x29, 0x2b, 0xdf, - 0x14, 0xc5, 0x64, 0x46, 0x38, 0xb7, 0x8d, 0x3d, 0x57, 0x20, 0x9e, 0x65, 0x33, 0x82, 0x96, 0x71, - 0xb4, 0x73, 0x20, 0x11, 0x49, 0x84, 0x5e, 0x7c, 0x8e, 0x92, 0xe5, 0xbb, 0xfb, 0xdd, 0xe0, 0x7b, - 0x1f, 0x84, 0x1c, 0xa1, 0xf4, 0x5f, 0xfa, 0x08, 0x73, 0xdc, 0xba, 0xfb, 0x81, 0x37, 0x3e, 0x0d, - 0x27, 0x09, 0x51, 0x07, 0xbb, 0x5a, 0x53, 0x73, 0xb5, 0x00, 0xf5, 0x63, 0x94, 0x9a, 0x88, 0x7d, - 0x83, 0x57, 0x86, 0xda, 0x69, 0xf7, 0x76, 0x0f, 0x3d, 0xc5, 0x7a, 0x9c, 0xb5, 0x93, 0x94, 0x09, - 0xd5, 0x7a, 0xcf, 0x9c, 0x73, 0x79, 0x05, 0xb2, 0x41, 0xbd, 0x47, 0x69, 0x60, 0x9a, 0x2f, 0x45, - 0x88, 0x13, 0x54, 0xd9, 0x5a, 0x25, 0xee, 0xcb, 0x6b, 0x55, 0x29, 0x4a, 0xdc, 0xa8, 0xf5, 0x5a, - 0xa3, 0xaa, 0x2a, 0x3b, 0x9b, 0x8d, 0xda, 0x46, 0x55, 0x8a, 0x05, 0x1c, 0xfb, 0xeb, 0xf1, 0xd4, - 0xc3, 0xd2, 0x59, 0xf9, 0xe7, 0x63, 0x90, 0x0f, 0x47, 0x6a, 0xe8, 0x83, 0x70, 0x4a, 0x24, 0x5c, - 0x1c, 0xec, 0xaa, 0xb7, 0x0d, 0x9b, 0x4e, 0xc8, 0x8e, 0xc6, 0x16, 0x47, 0x4f, 0x7f, 0xe6, 0x38, - 0x55, 0x1d, 0xbb, 0x2f, 0x1b, 0x36, 0x99, 0x6e, 0x1d, 0xcd, 0x45, 0xeb, 0xb0, 0x68, 0x5a, 0xaa, - 0xe3, 0x6a, 0x66, 0x53, 0xb3, 0x9b, 0xaa, 0x9f, 0xea, 0x52, 0x35, 0x5d, 0xc7, 0x8e, 0x63, 0xb1, - 0x85, 0xd0, 0x43, 0xb9, 0xcf, 0xb4, 0xea, 0x9c, 0xd8, 0x5f, 0x21, 0x4a, 0x9c, 0xb4, 0x4f, 0x7d, - 0x63, 0xa3, 0xd4, 0xf7, 0x0c, 0xa4, 0x3b, 0x5a, 0x57, 0xc5, 0xa6, 0x6b, 0x1f, 0x52, 0xff, 0x3c, - 0xa5, 0xa4, 0x3a, 0x5a, 0xb7, 0x4a, 0x9e, 0xd1, 0x0d, 0x78, 0xd8, 0x27, 0x55, 0xdb, 0xb8, 0xa5, - 0xe9, 0x87, 0x2a, 0x75, 0xc6, 0x69, 0xda, 0x40, 0xd5, 0x2d, 0x73, 0xaf, 0x6d, 0xe8, 0xae, 0x43, - 0xed, 0x03, 0xb3, 0x71, 0xb2, 0xcf, 0xb1, 0x4e, 0x19, 0xae, 0x3b, 0x96, 0x49, 0x7d, 0xf0, 0x8a, - 0xa0, 0x7e, 0x5f, 0xc2, 0xaf, 0xeb, 0xf1, 0x54, 0x5c, 0x9a, 0xbe, 0x1e, 0x4f, 0x4d, 0x4b, 0x89, - 0xeb, 0xf1, 0x54, 0x42, 0x4a, 0x5e, 0x8f, 0xa7, 0x52, 0x52, 0xfa, 0x7a, 0x3c, 0x95, 0x96, 0x40, - 0xfe, 0x5c, 0x0a, 0xb2, 0xc1, 0xc8, 0x80, 0x04, 0x5a, 0x3a, 0x5d, 0x1b, 0x23, 0xd4, 0x7a, 0x3e, - 0x78, 0x64, 0x1c, 0xb1, 0x5c, 0x21, 0x8b, 0xe6, 0x4a, 0x82, 0xb9, 0xe1, 0x0a, 0xe3, 0x24, 0x0e, - 0x0b, 0x51, 0x6b, 0xcc, 0xdc, 0x9e, 0x94, 0xc2, 0x9f, 0xd0, 0x1a, 0x24, 0x5e, 0x77, 0x28, 0x76, - 0x82, 0x62, 0x7f, 0xe0, 0x68, 0xec, 0xeb, 0x75, 0x0a, 0x9e, 0xbe, 0x5e, 0x57, 0x37, 0xb7, 0x94, - 0x8d, 0xd2, 0xba, 0xc2, 0xd9, 0xd1, 0x69, 0x88, 0xb7, 0xb5, 0x37, 0x0e, 0xc3, 0xcb, 0x2b, 0x2d, - 0x42, 0xcb, 0x50, 0xe8, 0x99, 0xb7, 0xb0, 0x6d, 0xec, 0x19, 0x64, 0xa8, 0x08, 0x55, 0x21, 0x48, - 0x95, 0xf7, 0x6b, 0xd7, 0x09, 0xfd, 0x84, 0xea, 0x71, 0x1a, 0xe2, 0xb7, 0xb1, 0x76, 0x33, 0xbc, - 0x08, 0xd2, 0x22, 0x74, 0x0e, 0xb2, 0x4d, 0xbc, 0xdb, 0x6b, 0xa9, 0x36, 0x6e, 0x6a, 0xba, 0x1b, - 0x36, 0xfd, 0x19, 0x5a, 0xa5, 0xd0, 0x1a, 0xf4, 0x22, 0xa4, 0xc9, 0x18, 0x99, 0x74, 0x8c, 0x67, - 0xa8, 0x08, 0x1e, 0x3f, 0x5a, 0x04, 0x7c, 0x88, 0x05, 0x93, 0xe2, 0xf3, 0xa3, 0xab, 0x90, 0x70, - 0x35, 0xbb, 0x85, 0x5d, 0x6a, 0xf9, 0xf3, 0x43, 0x92, 0x1f, 0x43, 0x90, 0x1a, 0x94, 0x83, 0xc6, - 0xb4, 0x9c, 0xfb, 0x3d, 0xb4, 0x32, 0x17, 0x60, 0x9a, 0xaa, 0x07, 0x02, 0xe0, 0x0a, 0x22, 0x4d, - 0xa1, 0x14, 0xc4, 0x2b, 0x5b, 0x0a, 0xb1, 0x34, 0x12, 0x64, 0x59, 0xa9, 0xba, 0x5d, 0xab, 0x56, - 0xaa, 0x52, 0x54, 0xbe, 0x04, 0x09, 0x36, 0xe6, 0xc4, 0x0a, 0x79, 0xa3, 0x2e, 0x4d, 0xf1, 0x47, - 0x8e, 0x11, 0x11, 0xb5, 0x3b, 0x1b, 0xe5, 0xaa, 0x22, 0x45, 0xe5, 0x1d, 0x28, 0xf4, 0xc9, 0x09, - 0x9d, 0x80, 0x19, 0xa5, 0xda, 0xa8, 0x6e, 0x92, 0x38, 0x4b, 0xdd, 0xd9, 0x7c, 0x71, 0x73, 0xeb, - 0xe5, 0x4d, 0x69, 0x2a, 0x5c, 0x2c, 0x4c, 0x5a, 0x04, 0xcd, 0x81, 0xe4, 0x17, 0xd7, 0xb7, 0x76, - 0x14, 0xda, 0x9a, 0x6f, 0x8b, 0x82, 0xd4, 0x2f, 0x35, 0x74, 0x0a, 0x66, 0x1b, 0x25, 0x65, 0xad, - 0xda, 0x50, 0x59, 0xec, 0xe8, 0x41, 0xcf, 0x81, 0x14, 0xac, 0xb8, 0x5a, 0xa3, 0xa1, 0xf1, 0x22, - 0x9c, 0x09, 0x96, 0x56, 0x5f, 0x69, 0x54, 0x37, 0xeb, 0xf4, 0xe5, 0xa5, 0xcd, 0x35, 0x62, 0x5f, - 0xfb, 0xf0, 0x44, 0xb4, 0x1a, 0x23, 0x4d, 0x0d, 0xe3, 0x55, 0xd7, 0x57, 0xa5, 0x78, 0x7f, 0xf1, - 0xd6, 0x66, 0x75, 0xeb, 0xaa, 0x34, 0xdd, 0xff, 0x76, 0x1a, 0xc1, 0x26, 0x50, 0x11, 0x4e, 0xf6, - 0x97, 0xaa, 0xd5, 0xcd, 0x86, 0xf2, 0xaa, 0x94, 0xec, 0x7f, 0x71, 0xbd, 0xaa, 0xdc, 0xa8, 0x55, - 0xaa, 0x52, 0x0a, 0x9d, 0x04, 0x14, 0x6e, 0x51, 0xe3, 0xda, 0xd6, 0xaa, 0x94, 0x1e, 0xb0, 0x28, - 0xb2, 0x03, 0xd9, 0x60, 0x18, 0xf9, 0xfe, 0xe4, 0x92, 0x3e, 0x11, 0x85, 0x4c, 0x20, 0x2c, 0x24, - 0xfe, 0xbc, 0xd6, 0x6e, 0x5b, 0xb7, 0x55, 0xad, 0x6d, 0x68, 0x0e, 0xb7, 0x37, 0x40, 0x8b, 0x4a, - 0xa4, 0x64, 0xd2, 0xf9, 0x3d, 0xb9, 0x85, 0x4f, 0x7c, 0x35, 0x5a, 0xf8, 0x69, 0x29, 0x21, 0xff, - 0x60, 0x04, 0xa4, 0xfe, 0x78, 0xaf, 0xaf, 0xfb, 0x91, 0x51, 0xdd, 0x7f, 0x5f, 0xc6, 0xee, 0x93, - 0x11, 0xc8, 0x87, 0x83, 0xbc, 0xbe, 0xe6, 0x3d, 0xf0, 0x97, 0xda, 0xbc, 0xdf, 0x8c, 0x42, 0x2e, - 0x14, 0xda, 0x4d, 0xda, 0xba, 0x0f, 0xc3, 0x8c, 0xd1, 0xc4, 0x9d, 0xae, 0xe5, 0x62, 0x53, 0x3f, - 0x54, 0xdb, 0xf8, 0x16, 0x6e, 0xcf, 0xcb, 0xd4, 0x28, 0x5f, 0x38, 0x3a, 0x78, 0x5c, 0xae, 0xf9, - 0x7c, 0xeb, 0x84, 0x6d, 0x65, 0xb6, 0xb6, 0x5a, 0xdd, 0xd8, 0xde, 0x6a, 0x54, 0x37, 0x2b, 0xaf, - 0x0a, 0xeb, 0xa2, 0x48, 0x46, 0x1f, 0xd9, 0x7b, 0x68, 0xb4, 0xb7, 0x41, 0xea, 0x6f, 0x14, 0xb1, - 0x15, 0x43, 0x9a, 0x25, 0x4d, 0xa1, 0x59, 0x28, 0x6c, 0x6e, 0xa9, 0xf5, 0xda, 0x6a, 0x55, 0xad, - 0x5e, 0xbd, 0x5a, 0xad, 0x34, 0xea, 0x2c, 0x1d, 0xe8, 0x51, 0x37, 0xa4, 0x68, 0x50, 0xc4, 0xdf, - 0x1f, 0x83, 0xd9, 0x21, 0x2d, 0x41, 0x25, 0x1e, 0xc8, 0xb3, 0xdc, 0xc2, 0xe3, 0x93, 0xb4, 0x7e, - 0x99, 0xb8, 0xd2, 0xdb, 0x9a, 0xed, 0xf2, 0xb8, 0xff, 0x11, 0x20, 0x52, 0x32, 0x5d, 0xb2, 0xb2, - 0xdb, 0x3c, 0xcd, 0xca, 0xa2, 0xfb, 0x82, 0x5f, 0xce, 0x32, 0xad, 0x8f, 0x01, 0xea, 0x5a, 0x8e, - 0xe1, 0x1a, 0xb7, 0xb0, 0x6a, 0x98, 0x22, 0x27, 0x4b, 0xa2, 0xfd, 0xb8, 0x22, 0x89, 0x9a, 0x9a, - 0xe9, 0x7a, 0xd4, 0x26, 0x6e, 0x69, 0x7d, 0xd4, 0xc4, 0xf3, 0x88, 0x29, 0x92, 0xa8, 0xf1, 0xa8, - 0x1f, 0x80, 0x6c, 0xd3, 0xea, 0x91, 0x10, 0x88, 0xd1, 0x11, 0x6b, 0x11, 0x51, 0x32, 0xac, 0xcc, - 0x23, 0xe1, 0xc1, 0xad, 0x9f, 0x0c, 0xce, 0x2a, 0x19, 0x56, 0xc6, 0x48, 0xce, 0x42, 0x41, 0x6b, - 0xb5, 0x6c, 0x02, 0x2e, 0x80, 0x58, 0xb8, 0x9e, 0xf7, 0x8a, 0x29, 0x61, 0xf1, 0x3a, 0xa4, 0x84, - 0x1c, 0x88, 0x07, 0x4b, 0x24, 0xa1, 0x76, 0x59, 0x0e, 0x2a, 0x7a, 0x2e, 0xad, 0xa4, 0x4c, 0x51, - 0xf9, 0x00, 0x64, 0x0d, 0x47, 0xf5, 0xf7, 0xb6, 0xa2, 0x4b, 0xd1, 0x73, 0x29, 0x25, 0x63, 0x38, - 0xde, 0xbe, 0x80, 0xfc, 0xe9, 0x28, 0xe4, 0xc3, 0xbb, 0x76, 0x68, 0x15, 0x52, 0x6d, 0x4b, 0xd7, - 0xa8, 0x6a, 0xb1, 0x2d, 0xe3, 0x73, 0x63, 0x36, 0xfa, 0x96, 0xd7, 0x39, 0xbd, 0xe2, 0x71, 0x16, - 0xff, 0x6d, 0x04, 0x52, 0xa2, 0x18, 0x9d, 0x84, 0x78, 0x57, 0x73, 0xf7, 0x29, 0xdc, 0x74, 0x39, - 0x2a, 0x45, 0x14, 0xfa, 0x4c, 0xca, 0x9d, 0xae, 0x66, 0x52, 0x15, 0xe0, 0xe5, 0xe4, 0x99, 0x8c, - 0x6b, 0x1b, 0x6b, 0x4d, 0x9a, 0x0b, 0xb0, 0x3a, 0x1d, 0x6c, 0xba, 0x8e, 0x18, 0x57, 0x5e, 0x5e, - 0xe1, 0xc5, 0xe8, 0x51, 0x98, 0x71, 0x6d, 0xcd, 0x68, 0x87, 0x68, 0xe3, 0x94, 0x56, 0x12, 0x15, - 0x1e, 0xf1, 0x0a, 0x9c, 0x16, 0xb8, 0x4d, 0xec, 0x6a, 0xfa, 0x3e, 0x6e, 0xfa, 0x4c, 0x09, 0x9a, - 0xf3, 0x3b, 0xc5, 0x09, 0x56, 0x79, 0xbd, 0xe0, 0x95, 0x3f, 0x1f, 0x85, 0x19, 0x91, 0xbd, 0x68, - 0x7a, 0xc2, 0xda, 0x00, 0xd0, 0x4c, 0xd3, 0x72, 0x83, 0xe2, 0x1a, 0x54, 0xe5, 0x01, 0xbe, 0xe5, - 0x92, 0xc7, 0xa4, 0x04, 0x00, 0x8a, 0xbf, 0x17, 0x01, 0xf0, 0xab, 0x46, 0xca, 0x6d, 0x11, 0x32, - 0x7c, 0x4f, 0x96, 0x6e, 0xec, 0xb3, 0x84, 0x17, 0xb0, 0xa2, 0xab, 0x46, 0x9b, 0xa6, 0x25, 0x77, - 0x71, 0xcb, 0x30, 0xf9, 0x7e, 0x0a, 0x7b, 0x10, 0x69, 0xc9, 0xb8, 0xbf, 0x3d, 0xa5, 0x40, 0xca, - 0xc1, 0x1d, 0xcd, 0x74, 0x0d, 0x9d, 0xef, 0x90, 0x5c, 0x3e, 0x56, 0xe3, 0x97, 0xeb, 0x9c, 0x5b, - 0xf1, 0x70, 0xe4, 0x73, 0x90, 0x12, 0xa5, 0xc4, 0xf1, 0xdb, 0xdc, 0xda, 0xac, 0x4a, 0x53, 0x28, - 0x09, 0xb1, 0x7a, 0xb5, 0x21, 0x45, 0x48, 0xd8, 0x59, 0x5a, 0xaf, 0x95, 0xea, 0x52, 0xb4, 0xfc, - 0xd7, 0x60, 0x56, 0xb7, 0x3a, 0xfd, 0x2f, 0x2c, 0x4b, 0x7d, 0x29, 0x3f, 0xe7, 0x5a, 0xe4, 0xb5, - 0xc7, 0x39, 0x51, 0xcb, 0x6a, 0x6b, 0x66, 0x6b, 0xd9, 0xb2, 0x5b, 0xfe, 0xb1, 0x08, 0x12, 0x1d, - 0x38, 0x81, 0xc3, 0x11, 0xdd, 0xdd, 0xff, 0x11, 0x89, 0xfc, 0x50, 0x34, 0xb6, 0xb6, 0x5d, 0xfe, - 0xf1, 0x68, 0x71, 0x8d, 0x31, 0x6e, 0x8b, 0xee, 0x28, 0x78, 0xaf, 0x8d, 0x75, 0xd2, 0x78, 0xf8, - 0xfd, 0x47, 0x61, 0xae, 0x65, 0xb5, 0x2c, 0x8a, 0x74, 0x81, 0xfc, 0xe2, 0xe7, 0x2a, 0xd2, 0x5e, - 0x69, 0x71, 0xec, 0x21, 0x8c, 0x95, 0x4d, 0x98, 0xe5, 0xc4, 0x2a, 0xdd, 0xbe, 0x65, 0xc9, 0x05, - 0x74, 0x64, 0x66, 0x7b, 0xfe, 0x27, 0x7f, 0x9b, 0x7a, 0x25, 0xca, 0x0c, 0x67, 0x25, 0x75, 0x2c, - 0xff, 0xb0, 0xa2, 0xc0, 0x89, 0x10, 0x1e, 0xb3, 0x11, 0xd8, 0x1e, 0x83, 0xf8, 0x2f, 0x38, 0xe2, - 0x6c, 0x00, 0xb1, 0xce, 0x59, 0x57, 0x2a, 0x90, 0x3b, 0x0e, 0xd6, 0xbf, 0xe4, 0x58, 0x59, 0x1c, - 0x04, 0x59, 0x83, 0x02, 0x05, 0xd1, 0x7b, 0x8e, 0x6b, 0x75, 0xa8, 0x01, 0x3e, 0x1a, 0xe6, 0x5f, - 0xfd, 0x36, 0x9b, 0xb4, 0x79, 0xc2, 0x56, 0xf1, 0xb8, 0x56, 0x56, 0x80, 0xee, 0x58, 0x37, 0xb1, - 0xde, 0x1e, 0x83, 0xf0, 0x2b, 0xbc, 0x21, 0x1e, 0xfd, 0xca, 0x0d, 0x98, 0x23, 0xbf, 0xa9, 0x7d, - 0x0c, 0xb6, 0x64, 0x7c, 0x1a, 0x7c, 0xfe, 0xdf, 0x7d, 0x94, 0xd9, 0x85, 0x59, 0x0f, 0x20, 0xd0, - 0xa6, 0xc0, 0x28, 0xb6, 0xb0, 0xeb, 0x62, 0xdb, 0x51, 0xb5, 0xf6, 0xb0, 0xe6, 0x05, 0xf2, 0x88, - 0xf3, 0xdf, 0xf7, 0xe5, 0xf0, 0x28, 0xae, 0x31, 0xce, 0x52, 0xbb, 0xbd, 0xb2, 0x03, 0xa7, 0x86, - 0x68, 0xc5, 0x04, 0x98, 0xdf, 0xcf, 0x31, 0xe7, 0x06, 0x34, 0x83, 0xc0, 0x6e, 0x83, 0x28, 0xf7, - 0xc6, 0x72, 0x02, 0xcc, 0x1f, 0xe0, 0x98, 0x88, 0xf3, 0x8a, 0x21, 0x25, 0x88, 0xd7, 0x61, 0xe6, - 0x16, 0xb6, 0x77, 0x2d, 0x87, 0xe7, 0x6e, 0x27, 0x80, 0xfb, 0x24, 0x87, 0x2b, 0x70, 0x46, 0x9a, - 0xcc, 0x25, 0x58, 0xcf, 0x41, 0x6a, 0x4f, 0xd3, 0xf1, 0x04, 0x10, 0x77, 0x39, 0x44, 0x92, 0xd0, - 0x13, 0xd6, 0x12, 0x64, 0x5b, 0x16, 0x5f, 0x22, 0xc7, 0xb3, 0xff, 0x20, 0x67, 0xcf, 0x08, 0x1e, - 0x0e, 0xd1, 0xb5, 0xba, 0xbd, 0x36, 0x59, 0x3f, 0xc7, 0x43, 0xfc, 0x1d, 0x01, 0x21, 0x78, 0x38, - 0xc4, 0x31, 0xc4, 0xfa, 0xa6, 0x80, 0x70, 0x02, 0xf2, 0x7c, 0x01, 0x32, 0x96, 0xd9, 0x3e, 0xb4, - 0xcc, 0x49, 0x1a, 0xf1, 0x29, 0x8e, 0x00, 0x9c, 0x85, 0x00, 0x5c, 0x81, 0xf4, 0xa4, 0x03, 0xf1, - 0x23, 0x5f, 0x16, 0xd3, 0x43, 0x8c, 0xc0, 0x1a, 0x14, 0x84, 0x81, 0x32, 0x2c, 0x73, 0x02, 0x88, - 0x1f, 0xe5, 0x10, 0xf9, 0x00, 0x1b, 0xef, 0x86, 0x8b, 0x1d, 0xb7, 0x85, 0x27, 0x01, 0xf9, 0xb4, - 0xe8, 0x06, 0x67, 0xe1, 0xa2, 0xdc, 0xc5, 0xa6, 0xbe, 0x3f, 0x19, 0xc2, 0x67, 0x84, 0x28, 0x05, - 0x0f, 0x81, 0xa8, 0x40, 0xae, 0xa3, 0xd9, 0xce, 0xbe, 0xd6, 0x9e, 0x68, 0x38, 0x7e, 0x8c, 0x63, - 0x64, 0x3d, 0x26, 0x2e, 0x91, 0x9e, 0x79, 0x1c, 0x98, 0x1f, 0x17, 0x12, 0x09, 0xb0, 0xf1, 0xa9, - 0xe7, 0xb8, 0x34, 0xd1, 0x7d, 0x1c, 0xb4, 0xbf, 0x27, 0xa6, 0x1e, 0xe3, 0xdd, 0x08, 0x22, 0x5e, - 0x81, 0xb4, 0x63, 0xbc, 0x31, 0x11, 0xcc, 0xdf, 0x17, 0x23, 0x4d, 0x19, 0x08, 0xf3, 0xab, 0x70, - 0x7a, 0xe8, 0x32, 0x31, 0x01, 0xd8, 0x3f, 0xe0, 0x60, 0x27, 0x87, 0x2c, 0x15, 0xdc, 0x24, 0x1c, - 0x17, 0xf2, 0x1f, 0x0a, 0x93, 0x80, 0xfb, 0xb0, 0xb6, 0x49, 0xd0, 0xe2, 0x68, 0x7b, 0xc7, 0x93, - 0xda, 0x3f, 0x12, 0x52, 0x63, 0xbc, 0x21, 0xa9, 0x35, 0xe0, 0x24, 0x47, 0x3c, 0xde, 0xb8, 0xfe, - 0x84, 0x30, 0xac, 0x8c, 0x7b, 0x27, 0x3c, 0xba, 0x5f, 0x03, 0x45, 0x4f, 0x9c, 0xc2, 0x3b, 0x76, - 0xd4, 0x8e, 0xd6, 0x9d, 0x00, 0xf9, 0x27, 0x39, 0xb2, 0xb0, 0xf8, 0x9e, 0x7b, 0xed, 0x6c, 0x68, - 0x5d, 0x02, 0xfe, 0x0a, 0xcc, 0x0b, 0xf0, 0x9e, 0x69, 0x63, 0xdd, 0x6a, 0x99, 0xc6, 0x1b, 0xb8, - 0x39, 0x01, 0xf4, 0x4f, 0xf5, 0x0d, 0xd5, 0x4e, 0x80, 0x9d, 0x20, 0xd7, 0x40, 0xf2, 0x7c, 0x15, - 0xd5, 0xe8, 0x74, 0x2d, 0xdb, 0x1d, 0x83, 0xf8, 0xd3, 0x62, 0xa4, 0x3c, 0xbe, 0x1a, 0x65, 0x5b, - 0xa9, 0x02, 0x3b, 0xfd, 0x31, 0xa9, 0x4a, 0x7e, 0x96, 0x03, 0xe5, 0x7c, 0x2e, 0x6e, 0x38, 0x74, - 0xab, 0xd3, 0xd5, 0xec, 0x49, 0xec, 0xdf, 0x3f, 0x16, 0x86, 0x83, 0xb3, 0x70, 0xc3, 0x41, 0x3c, - 0x3a, 0xb2, 0xda, 0x4f, 0x80, 0xf0, 0x33, 0xc2, 0x70, 0x08, 0x1e, 0x0e, 0x21, 0x1c, 0x86, 0x09, - 0x20, 0x3e, 0x27, 0x20, 0x04, 0x0f, 0x81, 0x78, 0xc9, 0x5f, 0x68, 0x6d, 0xdc, 0x32, 0x1c, 0xd7, - 0x66, 0x2e, 0xf9, 0xd1, 0x50, 0x3f, 0xfb, 0xe5, 0xb0, 0x13, 0xa6, 0x04, 0x58, 0x89, 0x25, 0xe2, - 0x5b, 0x1f, 0x34, 0x64, 0x1b, 0xdf, 0xb0, 0x9f, 0x13, 0x96, 0x28, 0xc0, 0x46, 0xda, 0x16, 0xf0, - 0x10, 0x89, 0xd8, 0x75, 0x12, 0xa8, 0x4c, 0x00, 0xf7, 0x4f, 0xfa, 0x1a, 0x57, 0x17, 0xbc, 0x04, - 0x33, 0xe0, 0xff, 0xf4, 0xcc, 0x9b, 0xf8, 0x70, 0x22, 0xed, 0xfc, 0xf9, 0x3e, 0xff, 0x67, 0x87, - 0x71, 0x32, 0x1b, 0x52, 0xe8, 0xf3, 0xa7, 0xd0, 0xb8, 0xb3, 0x7e, 0xf3, 0xdf, 0xf8, 0x0e, 0xef, - 0x6f, 0xd8, 0x9d, 0x5a, 0x59, 0x27, 0x4a, 0x1e, 0x76, 0x7a, 0xc6, 0x83, 0x7d, 0xf4, 0x1d, 0x4f, - 0xcf, 0x43, 0x3e, 0xcf, 0xca, 0x55, 0xc8, 0x85, 0x1c, 0x9e, 0xf1, 0x50, 0xdf, 0xcc, 0xa1, 0xb2, - 0x41, 0x7f, 0x67, 0xe5, 0x12, 0xc4, 0x89, 0xf3, 0x32, 0x9e, 0xfd, 0x5b, 0x38, 0x3b, 0x25, 0x5f, - 0x79, 0x1e, 0x52, 0xc2, 0x69, 0x19, 0xcf, 0xfa, 0xd7, 0x39, 0xab, 0xc7, 0x42, 0xd8, 0x85, 0xc3, - 0x32, 0x9e, 0xfd, 0x6f, 0x08, 0x76, 0xc1, 0x42, 0xd8, 0x27, 0x17, 0xe1, 0x2f, 0xfd, 0xcd, 0x38, - 0x5f, 0x74, 0x84, 0xec, 0xae, 0x40, 0x92, 0x7b, 0x2a, 0xe3, 0xb9, 0xbf, 0x95, 0xbf, 0x5c, 0x70, - 0xac, 0x3c, 0x03, 0xd3, 0x13, 0x0a, 0xfc, 0x6f, 0x71, 0x56, 0x46, 0xbf, 0x52, 0x81, 0x4c, 0xc0, - 0x3b, 0x19, 0xcf, 0xfe, 0xed, 0x9c, 0x3d, 0xc8, 0x45, 0x9a, 0xce, 0xbd, 0x93, 0xf1, 0x00, 0xdf, - 0x21, 0x9a, 0xce, 0x39, 0x88, 0xd8, 0x84, 0x63, 0x32, 0x9e, 0xfb, 0xe3, 0x42, 0xea, 0x82, 0x65, - 0xe5, 0x05, 0x48, 0x7b, 0x8b, 0xcd, 0x78, 0xfe, 0xef, 0xe4, 0xfc, 0x3e, 0x0f, 0x91, 0x40, 0x60, - 0xb1, 0x1b, 0x0f, 0xf1, 0x5d, 0x42, 0x02, 0x01, 0x2e, 0x32, 0x8d, 0xfa, 0x1d, 0x98, 0xf1, 0x48, - 0xdf, 0x2d, 0xa6, 0x51, 0x9f, 0xff, 0x42, 0x46, 0x93, 0xda, 0xfc, 0xf1, 0x10, 0xdf, 0x23, 0x46, - 0x93, 0xd2, 0x93, 0x66, 0xf4, 0x7b, 0x04, 0xe3, 0x31, 0xbe, 0x57, 0x34, 0xa3, 0xcf, 0x21, 0x58, - 0xd9, 0x06, 0x34, 0xe8, 0x0d, 0x8c, 0xc7, 0xfb, 0x04, 0xc7, 0x9b, 0x19, 0x70, 0x06, 0x56, 0x5e, - 0x86, 0x93, 0xc3, 0x3d, 0x81, 0xf1, 0xa8, 0xdf, 0xf7, 0x4e, 0x5f, 0xec, 0x16, 0x74, 0x04, 0x56, - 0x1a, 0xfe, 0x92, 0x12, 0xf4, 0x02, 0xc6, 0xc3, 0x7e, 0xff, 0x3b, 0x61, 0xc3, 0x1d, 0x74, 0x02, - 0x56, 0x4a, 0x00, 0xfe, 0x02, 0x3c, 0x1e, 0xeb, 0x93, 0x1c, 0x2b, 0xc0, 0x44, 0xa6, 0x06, 0x5f, - 0x7f, 0xc7, 0xf3, 0xdf, 0x15, 0x53, 0x83, 0x73, 0x90, 0xa9, 0x21, 0x96, 0xde, 0xf1, 0xdc, 0x3f, - 0x28, 0xa6, 0x86, 0x60, 0x21, 0x9a, 0x1d, 0x58, 0xdd, 0xc6, 0x23, 0x7c, 0x4a, 0x68, 0x76, 0x80, - 0x6b, 0x65, 0x13, 0x66, 0x06, 0x16, 0xc4, 0xf1, 0x50, 0x3f, 0xc4, 0xa1, 0xa4, 0xfe, 0xf5, 0x30, - 0xb8, 0x78, 0xf1, 0xc5, 0x70, 0x3c, 0xda, 0x0f, 0xf7, 0x2d, 0x5e, 0x7c, 0x2d, 0x5c, 0xb9, 0x02, - 0x29, 0xb3, 0xd7, 0x6e, 0x93, 0xc9, 0x83, 0x8e, 0x3e, 0x9f, 0x3b, 0xff, 0x5f, 0xbe, 0xc2, 0xa5, - 0x23, 0x18, 0x56, 0x2e, 0xc1, 0x34, 0xee, 0xec, 0xe2, 0xe6, 0x38, 0xce, 0x2f, 0x7d, 0x45, 0x18, - 0x4c, 0x42, 0xbd, 0xf2, 0x02, 0x00, 0x4b, 0x8d, 0xd0, 0x8d, 0xf3, 0x31, 0xbc, 0xbf, 0xf7, 0x15, - 0x7e, 0x20, 0xce, 0x67, 0xf1, 0x01, 0xd8, 0xf1, 0xba, 0xa3, 0x01, 0xbe, 0x1c, 0x06, 0xa0, 0x23, - 0xf2, 0x1c, 0x24, 0x5f, 0x77, 0x2c, 0xd3, 0xd5, 0x5a, 0xe3, 0xb8, 0x7f, 0x9f, 0x73, 0x0b, 0x7a, - 0x22, 0xb0, 0x8e, 0x65, 0x63, 0x57, 0x6b, 0x39, 0xe3, 0x78, 0xff, 0x2b, 0xe7, 0xf5, 0x18, 0x08, - 0xb3, 0xae, 0x39, 0xee, 0x24, 0xfd, 0xfe, 0x03, 0xc1, 0x2c, 0x18, 0x48, 0xa3, 0xc9, 0xef, 0x9b, - 0xf8, 0x70, 0x1c, 0xef, 0x1f, 0x8a, 0x46, 0x73, 0xfa, 0x95, 0xe7, 0x21, 0x4d, 0x7e, 0xb2, 0x53, - 0xae, 0x63, 0x98, 0xff, 0x88, 0x33, 0xfb, 0x1c, 0xe4, 0xcd, 0x8e, 0xdb, 0x74, 0x8d, 0xf1, 0xc2, - 0xfe, 0x63, 0x3e, 0xd2, 0x82, 0x7e, 0xa5, 0x04, 0x19, 0xc7, 0x6d, 0x36, 0x7b, 0xdc, 0x3f, 0x1d, - 0xc3, 0xfe, 0x27, 0x5f, 0xf1, 0x52, 0x16, 0x1e, 0x0f, 0x19, 0xed, 0xdb, 0x37, 0xdd, 0xae, 0x45, - 0xf7, 0x5b, 0xc6, 0x21, 0xbc, 0xc3, 0x11, 0x02, 0x2c, 0x2b, 0x15, 0xc8, 0x92, 0xbe, 0xd8, 0xb8, - 0x8b, 0xe9, 0xe6, 0xd8, 0x18, 0x88, 0x3f, 0xe5, 0x02, 0x08, 0x31, 0x95, 0xbf, 0xe1, 0x57, 0xde, - 0x5e, 0x88, 0x7c, 0xfe, 0xed, 0x85, 0xc8, 0x6f, 0xbe, 0xbd, 0x10, 0xf9, 0xf8, 0x17, 0x16, 0xa6, - 0x3e, 0xff, 0x85, 0x85, 0xa9, 0xdf, 0xf8, 0xc2, 0xc2, 0xd4, 0xf0, 0x2c, 0x31, 0xac, 0x59, 0x6b, - 0x16, 0xcb, 0x0f, 0xbf, 0xf6, 0x50, 0xcb, 0x70, 0xf7, 0x7b, 0xbb, 0xcb, 0xba, 0xd5, 0xb9, 0xa0, - 0x5b, 0x4e, 0xc7, 0x72, 0x2e, 0x84, 0xf3, 0xba, 0xf4, 0x17, 0xfc, 0xaf, 0x08, 0x89, 0x99, 0xc3, - 0xe9, 0x5c, 0xcd, 0x3c, 0x1c, 0xf5, 0x31, 0xdd, 0x65, 0x88, 0x95, 0xcc, 0x43, 0x74, 0x9a, 0x19, - 0x38, 0xb5, 0x67, 0xb7, 0xf9, 0x51, 0xcb, 0x24, 0x79, 0xde, 0xb1, 0xdb, 0x68, 0xce, 0x3f, 0x0f, - 0x1d, 0x39, 0x97, 0xe5, 0x87, 0x9c, 0xcb, 0xdf, 0x1e, 0x39, 0x5e, 0x4f, 0x52, 0x25, 0xf3, 0x90, - 0x76, 0x64, 0x3b, 0xf2, 0xda, 0x63, 0x63, 0xf3, 0xdc, 0x37, 0x4d, 0xeb, 0xb6, 0x49, 0x9a, 0xdd, - 0xdd, 0x15, 0x39, 0xee, 0x85, 0xfe, 0x1c, 0xf7, 0xcb, 0xb8, 0xdd, 0x7e, 0x91, 0xd0, 0x35, 0x08, - 0xcb, 0x6e, 0x82, 0x9d, 0xea, 0x87, 0xef, 0x8e, 0xc2, 0xc2, 0x40, 0x3a, 0x9b, 0x2b, 0xc1, 0x28, - 0x21, 0xac, 0x40, 0x6a, 0x55, 0xe8, 0xd6, 0x3c, 0x24, 0x1d, 0xac, 0x5b, 0x66, 0xd3, 0xa1, 0x82, - 0x88, 0x29, 0xe2, 0x91, 0x08, 0xc2, 0xd4, 0x4c, 0xcb, 0xe1, 0x87, 0x95, 0xd9, 0x43, 0xf9, 0x07, - 0x8e, 0x29, 0x88, 0x9c, 0x78, 0x93, 0x90, 0xc6, 0x93, 0x13, 0x4a, 0x43, 0x74, 0x22, 0x94, 0xf9, - 0x9f, 0x54, 0x2a, 0xdf, 0x1b, 0x85, 0xc5, 0x7e, 0xa9, 0x90, 0x99, 0xe5, 0xb8, 0x5a, 0xa7, 0x3b, - 0x4a, 0x2c, 0x57, 0x20, 0xdd, 0x10, 0x34, 0xc7, 0x96, 0xcb, 0xdd, 0x63, 0xca, 0x25, 0xef, 0xbd, - 0x4a, 0x08, 0xe6, 0xe2, 0x84, 0x82, 0xf1, 0xfa, 0x71, 0x4f, 0x92, 0xf9, 0xb3, 0x04, 0x9c, 0x66, - 0xd3, 0x49, 0x65, 0x53, 0x89, 0x3d, 0x70, 0x99, 0x64, 0x83, 0x55, 0xe3, 0xf7, 0x49, 0xe4, 0x17, - 0x61, 0xb6, 0x46, 0xac, 0x05, 0x89, 0x82, 0xfc, 0x1d, 0x9e, 0xa1, 0xe7, 0xb9, 0x97, 0x42, 0x0e, - 0x3f, 0xdf, 0xdf, 0x0a, 0x16, 0xc9, 0xdf, 0x18, 0x01, 0xa9, 0xae, 0x6b, 0x6d, 0xcd, 0xfe, 0x8b, - 0x42, 0xa1, 0x67, 0x00, 0xd8, 0x71, 0x0f, 0xef, 0xc3, 0xbd, 0xfc, 0xc5, 0xf9, 0xe5, 0x60, 0xe7, - 0x96, 0xd9, 0x9b, 0xe8, 0x09, 0xaa, 0x34, 0xa5, 0x25, 0x3f, 0xcf, 0xbf, 0x02, 0xe0, 0x57, 0xa0, - 0x33, 0x70, 0xaa, 0x5e, 0x29, 0xad, 0x97, 0x14, 0x71, 0x48, 0xa8, 0xbe, 0x5d, 0xad, 0xd4, 0xae, - 0xd6, 0xaa, 0xab, 0xd2, 0x14, 0x3a, 0x09, 0x28, 0x58, 0xe9, 0x1d, 0x6a, 0x3a, 0x01, 0x33, 0xc1, - 0x72, 0xf6, 0x95, 0x4a, 0x94, 0x78, 0x8a, 0x46, 0xa7, 0xdb, 0xc6, 0x74, 0xe7, 0x51, 0x35, 0x84, - 0xd4, 0xc6, 0x3b, 0x21, 0xbf, 0xfa, 0xef, 0xd9, 0x97, 0x0b, 0xb3, 0x3e, 0xbb, 0x27, 0xf3, 0x95, - 0x75, 0x98, 0xd1, 0x74, 0x1d, 0x77, 0x43, 0x90, 0x63, 0x4c, 0x35, 0x01, 0xa4, 0x7b, 0xa9, 0x9c, - 0xd3, 0x47, 0x7b, 0x06, 0x12, 0x0e, 0xed, 0xfd, 0x38, 0x88, 0x5f, 0xe3, 0x10, 0x9c, 0x7c, 0xc5, - 0x84, 0x19, 0xe2, 0xf9, 0x69, 0x36, 0x0e, 0x34, 0xe3, 0xe8, 0x3c, 0xc3, 0x2f, 0xfc, 0xf4, 0x13, - 0x74, 0x67, 0xf5, 0x81, 0xf0, 0xb0, 0x0c, 0x51, 0x27, 0x45, 0xe2, 0xd8, 0x7e, 0x43, 0x31, 0xe4, - 0xc5, 0xfb, 0x78, 0x83, 0x8f, 0x7e, 0xd9, 0x2f, 0xf2, 0x97, 0x2d, 0x0c, 0xd3, 0x81, 0xc0, 0x9b, - 0x72, 0x1c, 0x95, 0x55, 0x94, 0xab, 0xa3, 0xe6, 0xf4, 0x6b, 0x8f, 0x0e, 0xae, 0x4e, 0xec, 0xbf, - 0xc7, 0x29, 0xf2, 0x95, 0xe0, 0x6b, 0xbc, 0xb9, 0xf7, 0x03, 0x71, 0x98, 0xd1, 0x3a, 0x86, 0x69, - 0x5d, 0xa0, 0xff, 0xf2, 0x39, 0x37, 0x4d, 0x1f, 0x26, 0xd8, 0x94, 0xbc, 0xcc, 0xa6, 0xc2, 0x78, - 0x8d, 0xf9, 0xa3, 0x6f, 0xfb, 0xd1, 0x69, 0x7f, 0xba, 0xac, 0x6c, 0x80, 0x24, 0x0e, 0xf1, 0x62, - 0x53, 0xb7, 0x9a, 0x13, 0x65, 0x29, 0xfe, 0x58, 0x60, 0x88, 0xfc, 0x56, 0x95, 0xb3, 0xae, 0x7c, - 0x10, 0x52, 0x1e, 0xcc, 0x38, 0xcf, 0x44, 0x80, 0x78, 0x1c, 0xc4, 0x2f, 0x61, 0x33, 0x73, 0x12, - 0x2f, 0xf4, 0x1d, 0xc1, 0xcf, 0x66, 0xe8, 0x26, 0xe9, 0xcd, 0x1a, 0xe4, 0x9b, 0x96, 0xe9, 0xaa, - 0x56, 0xc7, 0x70, 0x71, 0xa7, 0xeb, 0x8e, 0xf5, 0xeb, 0xfe, 0x94, 0x81, 0xa4, 0x94, 0x1c, 0xe1, - 0xdb, 0x12, 0x6c, 0xa4, 0x25, 0xec, 0x3b, 0xbd, 0x49, 0x5a, 0xf2, 0xdf, 0xbc, 0x96, 0x50, 0x1e, - 0xd2, 0x92, 0x7b, 0xd2, 0x0e, 0xa7, 0x79, 0x93, 0x1b, 0x73, 0xf7, 0x80, 0x69, 0x81, 0xa7, 0x1d, - 0x7f, 0x10, 0x83, 0x05, 0x4e, 0xbc, 0xab, 0x39, 0xf8, 0xc2, 0xad, 0x27, 0x77, 0xb1, 0xab, 0x3d, - 0x79, 0x41, 0xb7, 0x0c, 0xb1, 0x92, 0xcf, 0x72, 0x63, 0x4d, 0xea, 0x97, 0x79, 0x7d, 0x71, 0xe8, - 0x76, 0x77, 0x71, 0xb4, 0x91, 0x2f, 0x0e, 0xea, 0xa0, 0xfc, 0x1a, 0xc4, 0x2b, 0x96, 0x61, 0x92, - 0xb5, 0xad, 0x89, 0x4d, 0xab, 0xc3, 0xcd, 0x2d, 0x7b, 0x40, 0x97, 0x21, 0xa1, 0x75, 0xac, 0x9e, - 0xe9, 0x32, 0x53, 0x5b, 0x5e, 0xf8, 0x95, 0xb7, 0x16, 0xa7, 0xfe, 0xe3, 0x5b, 0x8b, 0xb1, 0x9a, - 0xe9, 0xfe, 0xfa, 0x67, 0x1f, 0x07, 0x8e, 0x5e, 0x33, 0xdd, 0xcf, 0xfc, 0xee, 0x4f, 0x9c, 0x8f, - 0x28, 0x9c, 0x7a, 0x25, 0xfe, 0xc5, 0x37, 0x17, 0x23, 0xf2, 0x2b, 0x90, 0x5c, 0xc5, 0xfa, 0x11, - 0xf0, 0x4f, 0xf6, 0xc1, 0x9f, 0x16, 0xf0, 0xab, 0x58, 0x0f, 0xc0, 0xaf, 0x62, 0xbd, 0x0f, 0xf9, - 0x19, 0x48, 0xd5, 0x4c, 0x97, 0x7d, 0x42, 0xf4, 0x28, 0xc4, 0x0c, 0x93, 0x9d, 0x4a, 0x0f, 0x20, - 0x0c, 0x34, 0x50, 0x21, 0x54, 0x84, 0x71, 0x15, 0xeb, 0x1e, 0x63, 0x13, 0xeb, 0xfd, 0x8c, 0x83, - 0xaf, 0x26, 0x54, 0xe5, 0xd5, 0xdf, 0xf8, 0xad, 0x85, 0xa9, 0x8f, 0xbc, 0xbd, 0x30, 0x35, 0x72, - 0xe8, 0xe5, 0xf1, 0x43, 0xef, 0x8d, 0xf8, 0x8f, 0xc6, 0xe1, 0x7e, 0xfa, 0x65, 0xa9, 0xdd, 0x31, - 0x4c, 0xf7, 0x82, 0x6e, 0x1f, 0x76, 0x5d, 0x8b, 0x18, 0x00, 0x6b, 0x8f, 0x0f, 0xf8, 0x8c, 0x5f, - 0xbd, 0xcc, 0xaa, 0x87, 0x0f, 0xb7, 0xbc, 0x07, 0xd3, 0xdb, 0x84, 0x8f, 0x88, 0xd8, 0xb5, 0x5c, - 0xad, 0xcd, 0xbd, 0x16, 0xf6, 0x40, 0x4a, 0xd9, 0xd7, 0xa8, 0x51, 0x56, 0x6a, 0x88, 0x0f, 0x51, - 0xdb, 0x58, 0xdb, 0x63, 0x1f, 0xf5, 0xc4, 0xa8, 0xbb, 0x9b, 0x22, 0x05, 0xf4, 0xfb, 0x9d, 0x39, - 0x98, 0xd6, 0x7a, 0xec, 0xe0, 0x4d, 0x8c, 0xf8, 0xc1, 0xf4, 0x41, 0x7e, 0x11, 0x92, 0x7c, 0xff, - 0x1d, 0x49, 0x10, 0xbb, 0x89, 0x0f, 0xe9, 0x7b, 0xb2, 0x0a, 0xf9, 0x89, 0x96, 0x61, 0x9a, 0x36, - 0x9e, 0x7f, 0xad, 0x38, 0xbf, 0x3c, 0xd0, 0xfa, 0x65, 0xda, 0x48, 0x85, 0x91, 0xc9, 0xd7, 0x21, - 0xb5, 0x6a, 0x11, 0x2d, 0x0c, 0xa3, 0xa5, 0x19, 0x1a, 0x6d, 0x73, 0xb7, 0xc7, 0xb5, 0x42, 0x61, - 0x0f, 0xe8, 0x24, 0x24, 0xd8, 0x47, 0x5e, 0xfc, 0xf0, 0x10, 0x7f, 0x92, 0x2b, 0x90, 0xa4, 0xd8, - 0x5b, 0x5d, 0xe2, 0x32, 0x78, 0xe7, 0xde, 0xd3, 0xfc, 0x93, 0x5f, 0x0e, 0x1f, 0xf5, 0x1b, 0x8b, - 0x20, 0xde, 0xd4, 0x5c, 0x8d, 0xf7, 0x9b, 0xfe, 0x96, 0x3f, 0x04, 0x29, 0x0e, 0xe2, 0xa0, 0x8b, - 0x10, 0xb3, 0xba, 0x0e, 0x3f, 0xfe, 0x53, 0x1c, 0xd5, 0x95, 0xad, 0x6e, 0x39, 0x4e, 0x74, 0x46, - 0x21, 0xc4, 0xe5, 0xcd, 0x91, 0x6a, 0xf1, 0x74, 0x48, 0x2d, 0x3a, 0xd8, 0xdd, 0xdd, 0x73, 0xfd, - 0x1f, 0x6c, 0x38, 0x07, 0x54, 0xc1, 0x53, 0x94, 0xbb, 0x51, 0x58, 0x08, 0xd4, 0xde, 0xc2, 0xb6, - 0x63, 0x58, 0x26, 0xd3, 0x26, 0xae, 0x29, 0x28, 0xd0, 0x40, 0x5e, 0x3f, 0x42, 0x55, 0x9e, 0x87, - 0x58, 0xa9, 0xdb, 0x45, 0x45, 0x48, 0xd1, 0x67, 0xdd, 0x62, 0xba, 0x12, 0x57, 0xbc, 0x67, 0x52, - 0xe7, 0x58, 0x7b, 0xee, 0x6d, 0xcd, 0xf6, 0xbe, 0x81, 0x16, 0xcf, 0xf2, 0x73, 0x90, 0xae, 0x58, - 0xa6, 0x83, 0x4d, 0xa7, 0x47, 0x7d, 0xe1, 0xdd, 0xb6, 0xa5, 0xdf, 0xe4, 0x08, 0xec, 0x81, 0x08, - 0x5b, 0xeb, 0x76, 0x29, 0x67, 0x5c, 0x21, 0x3f, 0xd9, 0x7c, 0x2d, 0x6f, 0x8d, 0x14, 0xcf, 0xa5, - 0xe3, 0x89, 0x87, 0x77, 0xd0, 0x77, 0x6a, 0x23, 0x70, 0xdf, 0xe0, 0x44, 0xba, 0x89, 0x0f, 0x9d, - 0xe3, 0xce, 0xa3, 0x57, 0x20, 0xbd, 0x4d, 0xaf, 0x27, 0x79, 0x11, 0x1f, 0xa2, 0x22, 0x24, 0x71, - 0xf3, 0xe2, 0xa5, 0x4b, 0x4f, 0x3e, 0xc7, 0xb4, 0xfc, 0xda, 0x94, 0x22, 0x0a, 0xd0, 0x02, 0xa4, - 0x1d, 0xac, 0x77, 0x2f, 0x5e, 0xba, 0x7c, 0xf3, 0x49, 0xa6, 0x56, 0xd7, 0xa6, 0x14, 0xbf, 0x68, - 0x25, 0x45, 0x7a, 0xfc, 0xc5, 0x4f, 0x2d, 0x46, 0xca, 0xd3, 0x10, 0x73, 0x7a, 0x9d, 0xf7, 0x4c, - 0x37, 0xfe, 0x30, 0x01, 0x4b, 0x81, 0x5a, 0xb6, 0xb8, 0xdc, 0xd2, 0xda, 0x46, 0x53, 0xf3, 0x2f, - 0x95, 0x91, 0x02, 0xfd, 0xa7, 0x14, 0x23, 0x56, 0x8d, 0x23, 0xa5, 0x28, 0xff, 0x54, 0x04, 0xb2, - 0x37, 0x04, 0x72, 0x1d, 0xbb, 0xe8, 0x0a, 0x80, 0xf7, 0x26, 0x31, 0x55, 0xce, 0x2c, 0xf7, 0xbf, - 0x6b, 0xd9, 0xe3, 0x51, 0x02, 0xe4, 0xe8, 0x19, 0xaa, 0x80, 0x5d, 0xcb, 0xe1, 0xdf, 0xc3, 0x8e, - 0x61, 0xf5, 0x88, 0xd1, 0x63, 0x80, 0xa8, 0x55, 0x53, 0x6f, 0x59, 0xae, 0x61, 0xb6, 0xd4, 0xae, - 0x75, 0x9b, 0xdf, 0x32, 0x10, 0x53, 0x24, 0x5a, 0x73, 0x83, 0x56, 0x6c, 0x93, 0x72, 0xd2, 0xe8, - 0xb4, 0x87, 0x42, 0xc2, 0x3a, 0xad, 0xd9, 0xb4, 0xb1, 0xe3, 0x70, 0xc3, 0x25, 0x1e, 0xd1, 0x15, - 0x48, 0x76, 0x7b, 0xbb, 0xaa, 0xb0, 0x12, 0x99, 0x8b, 0xf7, 0x0d, 0x9b, 0xf3, 0x42, 0x37, 0xf8, - 0xac, 0x4f, 0x74, 0x7b, 0xbb, 0x44, 0x53, 0x1e, 0x80, 0xec, 0x90, 0xc6, 0x64, 0x6e, 0xf9, 0xed, - 0xa0, 0x37, 0xe2, 0xf0, 0x1e, 0xa8, 0x5d, 0xdb, 0xb0, 0x6c, 0xc3, 0x3d, 0xa4, 0xc7, 0xf6, 0x62, - 0x8a, 0x24, 0x2a, 0xb6, 0x79, 0xb9, 0x7c, 0x13, 0x0a, 0x75, 0xea, 0xee, 0xfb, 0x2d, 0xbf, 0xe4, - 0xb7, 0x2f, 0x32, 0xbe, 0x7d, 0x23, 0x5b, 0x16, 0x1d, 0x68, 0xd9, 0xf9, 0xff, 0x10, 0x81, 0x4c, - 0x99, 0x4c, 0xdc, 0xda, 0xea, 0xd5, 0xb6, 0xd6, 0x42, 0x4f, 0xc2, 0x89, 0xf2, 0xfa, 0x56, 0xe5, - 0x45, 0xb5, 0xb6, 0xaa, 0x5e, 0x5d, 0x2f, 0xad, 0xf9, 0xe7, 0x84, 0x8b, 0x27, 0xef, 0xdc, 0x5d, - 0x42, 0x01, 0xda, 0x1d, 0x93, 0xc6, 0xa4, 0xe8, 0x02, 0xcc, 0x85, 0x59, 0x4a, 0xe5, 0x7a, 0x75, - 0xb3, 0x21, 0x45, 0x8a, 0x27, 0xee, 0xdc, 0x5d, 0x9a, 0x09, 0x70, 0x94, 0x76, 0x1d, 0x6c, 0xba, - 0x83, 0x0c, 0x95, 0xad, 0x8d, 0x8d, 0x5a, 0x43, 0x8a, 0x0e, 0x30, 0x54, 0xac, 0x4e, 0xc7, 0x70, - 0xd1, 0x23, 0x30, 0x13, 0x66, 0xd8, 0xac, 0xad, 0x4b, 0xb1, 0x22, 0xba, 0x73, 0x77, 0x29, 0x1f, - 0xa0, 0xde, 0x34, 0xda, 0xc5, 0xd4, 0xc7, 0x7e, 0x78, 0x61, 0xea, 0x33, 0x7f, 0x77, 0x21, 0x52, - 0xde, 0x18, 0x39, 0xe7, 0x9e, 0x3a, 0xde, 0x9c, 0x0b, 0xaf, 0xdb, 0x5f, 0xb9, 0x2f, 0x64, 0x6e, - 0xb8, 0x3f, 0x17, 0x30, 0xc6, 0x93, 0x4e, 0xb7, 0x71, 0x39, 0x8a, 0xe2, 0xd1, 0xee, 0x41, 0x71, - 0xcc, 0xa2, 0x50, 0x1c, 0x6b, 0x18, 0xe4, 0xe7, 0x20, 0xb7, 0xad, 0xd9, 0x6e, 0x1d, 0xbb, 0xd7, - 0xb0, 0xd6, 0xc4, 0x76, 0xd8, 0x7f, 0xc8, 0x09, 0xff, 0x01, 0x41, 0x9c, 0x3a, 0x09, 0x6c, 0xfd, - 0xa4, 0xbf, 0xe5, 0x7d, 0x88, 0xd3, 0x13, 0xc9, 0x9e, 0x6f, 0xc1, 0x39, 0x98, 0x6f, 0x41, 0x56, - 0x86, 0x43, 0x17, 0x3b, 0x22, 0x8d, 0x46, 0x1f, 0xd0, 0xd3, 0xc2, 0x43, 0x88, 0x1d, 0xed, 0x21, - 0xf0, 0xe9, 0xc5, 0xfd, 0x84, 0x36, 0x24, 0xf9, 0x10, 0x7b, 0x0d, 0x89, 0xf8, 0x0d, 0x41, 0x1b, - 0x50, 0xe8, 0x6a, 0xb6, 0x4b, 0xbf, 0x50, 0xdc, 0xa7, 0xbd, 0xe0, 0x33, 0x78, 0x71, 0xd0, 0x9e, - 0x84, 0x3a, 0xcb, 0xdf, 0x92, 0xeb, 0x06, 0x0b, 0xe5, 0xdf, 0x89, 0x43, 0x82, 0x0b, 0xe3, 0x79, - 0x48, 0x72, 0xb1, 0xf2, 0x39, 0x77, 0xff, 0xf2, 0xe0, 0x32, 0xbb, 0xec, 0x2d, 0x87, 0x1c, 0x4f, - 0xf0, 0xa0, 0x87, 0x21, 0xa5, 0xef, 0x6b, 0x86, 0xa9, 0x1a, 0x4d, 0xee, 0xda, 0x66, 0xde, 0x7e, - 0x6b, 0x31, 0x59, 0x21, 0x65, 0xb5, 0x55, 0x25, 0x49, 0x2b, 0x6b, 0x4d, 0xe2, 0xd3, 0xec, 0x63, - 0xa3, 0xb5, 0xef, 0x72, 0xbb, 0xc1, 0x9f, 0xd0, 0xb3, 0x10, 0x27, 0x0a, 0xc1, 0xbf, 0x5f, 0x2f, - 0x0e, 0x44, 0x28, 0x5e, 0x0a, 0xa9, 0x9c, 0x22, 0x2f, 0xfe, 0xf8, 0x7f, 0x5e, 0x8c, 0x28, 0x94, - 0x03, 0x55, 0x20, 0xd7, 0xd6, 0x1c, 0x57, 0xa5, 0xeb, 0x31, 0x79, 0xfd, 0x34, 0x85, 0x38, 0x3d, - 0x28, 0x10, 0x2e, 0x58, 0xde, 0xf4, 0x0c, 0xe1, 0x62, 0x45, 0x4d, 0x74, 0x0e, 0x24, 0x0a, 0xa2, - 0xd3, 0x19, 0xc8, 0xbc, 0xc4, 0x04, 0x95, 0x7b, 0x9e, 0x94, 0xb3, 0x89, 0x49, 0x7d, 0xc5, 0x33, - 0x90, 0xa6, 0x5f, 0xcc, 0x52, 0x12, 0x76, 0x0c, 0x3e, 0x45, 0x0a, 0x68, 0xe5, 0x59, 0x28, 0xf8, - 0x56, 0x9f, 0x91, 0xa4, 0x18, 0x8a, 0x5f, 0x4c, 0x09, 0x9f, 0x80, 0x39, 0x13, 0x1f, 0xd0, 0x83, - 0xf9, 0x21, 0xea, 0x34, 0xa5, 0x46, 0xa4, 0xee, 0x46, 0x98, 0xe3, 0x21, 0xc8, 0xeb, 0x42, 0xf8, - 0x8c, 0x16, 0x28, 0x6d, 0xce, 0x2b, 0xa5, 0x64, 0xa7, 0x21, 0xa5, 0x75, 0xbb, 0x8c, 0x20, 0xc3, - 0xad, 0x7e, 0xb7, 0x4b, 0xab, 0xce, 0xc3, 0x0c, 0xed, 0xa3, 0x8d, 0x9d, 0x5e, 0xdb, 0xe5, 0x20, - 0x59, 0x4a, 0x53, 0x20, 0x15, 0x0a, 0x2b, 0xa7, 0xb4, 0x0f, 0x42, 0x0e, 0xdf, 0x32, 0x9a, 0xd8, - 0xd4, 0x31, 0xa3, 0xcb, 0x51, 0xba, 0xac, 0x28, 0xa4, 0x44, 0x8f, 0x80, 0x67, 0xcd, 0x55, 0xb1, - 0xd2, 0xe4, 0x19, 0x9e, 0x28, 0x2f, 0xb1, 0x62, 0x79, 0x1e, 0xe2, 0xab, 0x9a, 0xab, 0x11, 0x77, - 0xc9, 0x3d, 0x60, 0xcb, 0x67, 0x56, 0x21, 0x3f, 0xe5, 0xcf, 0xc5, 0x20, 0x7e, 0xc3, 0x72, 0x31, - 0x7a, 0x2a, 0xe0, 0xca, 0xe6, 0x87, 0xe9, 0x73, 0xdd, 0x68, 0x99, 0xb8, 0xb9, 0xe1, 0xb4, 0x02, - 0xd7, 0xdb, 0xf8, 0xea, 0x14, 0x0d, 0xa9, 0xd3, 0x1c, 0x4c, 0xdb, 0x56, 0xcf, 0x6c, 0x8a, 0x03, - 0xe4, 0xf4, 0x01, 0x55, 0x21, 0xe5, 0x69, 0x49, 0x7c, 0x9c, 0x96, 0x14, 0x88, 0x96, 0x10, 0x1d, - 0xe6, 0x05, 0x4a, 0x72, 0x97, 0x2b, 0x4b, 0x19, 0xd2, 0x9e, 0xf1, 0xe2, 0xda, 0x36, 0x99, 0xc2, - 0xfa, 0x6c, 0x64, 0x89, 0xf4, 0xc6, 0xde, 0x13, 0x1e, 0xd3, 0x38, 0xc9, 0xab, 0xe0, 0xd2, 0x0b, - 0xa9, 0x15, 0xbf, 0x6a, 0x27, 0x49, 0xfb, 0xe5, 0xab, 0x15, 0xbb, 0x6e, 0xe7, 0x3e, 0x48, 0x3b, - 0x46, 0xcb, 0xd4, 0xdc, 0x9e, 0x8d, 0xb9, 0xe6, 0xf9, 0x05, 0xa4, 0xd6, 0xff, 0x98, 0x82, 0x69, - 0x5a, 0xe0, 0x06, 0xb0, 0x0b, 0x30, 0xeb, 0xdf, 0xbd, 0xe5, 0xa3, 0x30, 0x2d, 0x43, 0x5e, 0x55, - 0x5d, 0xd4, 0xc8, 0xbf, 0x14, 0x81, 0x04, 0x5f, 0xb1, 0xfc, 0x61, 0x88, 0x0c, 0x1f, 0x86, 0xe8, - 0xa8, 0x61, 0x88, 0xdd, 0xfb, 0x30, 0x94, 0x00, 0xbc, 0x66, 0x3a, 0xfc, 0x42, 0x95, 0x21, 0x6e, - 0x15, 0x6b, 0x62, 0xdd, 0x68, 0xf1, 0x79, 0x1f, 0x60, 0x92, 0xff, 0x53, 0x84, 0x78, 0xf8, 0xbc, - 0x1e, 0x95, 0x20, 0x27, 0xda, 0xa5, 0xee, 0xb5, 0xb5, 0x16, 0x57, 0xc5, 0xfb, 0x47, 0x36, 0x8e, - 0xac, 0xc2, 0x4a, 0x86, 0xb7, 0x87, 0xfa, 0x13, 0x43, 0x87, 0x35, 0x3a, 0x62, 0x58, 0x43, 0x7a, - 0x14, 0xbb, 0x37, 0x3d, 0x0a, 0x8d, 0x78, 0xbc, 0x6f, 0xc4, 0xe5, 0xdf, 0x8a, 0xf0, 0x9b, 0xbf, - 0x9a, 0xec, 0x4b, 0x90, 0xbf, 0xac, 0xa1, 0x7a, 0x8d, 0xeb, 0x56, 0x13, 0x37, 0xd5, 0x81, 0x31, - 0x7b, 0x70, 0x10, 0x31, 0xdc, 0x66, 0x7f, 0xec, 0x90, 0x40, 0xa9, 0xfb, 0x63, 0xf8, 0xd9, 0x28, - 0xcc, 0x0c, 0xd0, 0xff, 0xdf, 0x37, 0x96, 0xe1, 0xd9, 0x3b, 0x3d, 0xe1, 0xec, 0x4d, 0x8c, 0x9c, - 0xbd, 0x3f, 0x1d, 0xa5, 0x09, 0x80, 0xae, 0xe5, 0x68, 0xed, 0xf7, 0xc3, 0xf6, 0x9e, 0x81, 0x74, - 0xd7, 0x6a, 0xab, 0xac, 0x86, 0x7d, 0xc2, 0x93, 0xea, 0x5a, 0x6d, 0x65, 0x40, 0xcd, 0xa6, 0xdf, - 0x25, 0xc3, 0x9c, 0x78, 0x17, 0x06, 0x21, 0xd9, 0x3f, 0xa1, 0x6c, 0xc8, 0x32, 0x51, 0x70, 0xaf, - 0xe9, 0x09, 0x22, 0x03, 0xea, 0x86, 0x45, 0x06, 0xbd, 0x3c, 0xd6, 0x6c, 0x46, 0xa9, 0x70, 0x3a, - 0xc2, 0xc1, 0x9c, 0x8c, 0x61, 0x99, 0xa3, 0xa0, 0xc5, 0x52, 0x38, 0x9d, 0xfc, 0xb7, 0x23, 0x00, - 0xeb, 0x44, 0xb2, 0xb4, 0xbf, 0xc4, 0xdf, 0x71, 0x68, 0x13, 0xd4, 0xd0, 0x9b, 0x17, 0x46, 0x0d, - 0x1a, 0x7f, 0x7f, 0xd6, 0x09, 0xb6, 0xbb, 0x02, 0x39, 0x5f, 0xb7, 0x1d, 0x2c, 0x1a, 0xb3, 0x70, - 0x44, 0x54, 0x5a, 0xc7, 0xae, 0x92, 0xbd, 0x15, 0x78, 0x92, 0xff, 0x59, 0x04, 0xd2, 0xb4, 0x4d, - 0x1b, 0xd8, 0xd5, 0x42, 0x63, 0x18, 0xb9, 0xf7, 0x31, 0xbc, 0x1f, 0x80, 0xc1, 0x38, 0xc6, 0x1b, - 0x98, 0x6b, 0x56, 0x9a, 0x96, 0xd4, 0x8d, 0x37, 0x30, 0xba, 0xec, 0x09, 0x3c, 0x76, 0xb4, 0xc0, - 0x45, 0xd4, 0xca, 0xc5, 0x7e, 0x0a, 0x92, 0xf4, 0x6e, 0xca, 0x03, 0x87, 0x07, 0xa2, 0x09, 0xb3, - 0xd7, 0x69, 0x1c, 0x38, 0xf2, 0xeb, 0x90, 0x6c, 0x1c, 0xb0, 0x7c, 0xe2, 0x19, 0x48, 0xdb, 0x96, - 0xc5, 0xbd, 0x3f, 0xe6, 0x75, 0xa7, 0x48, 0x01, 0x75, 0x76, 0x44, 0x0e, 0x2d, 0xea, 0xe7, 0xd0, - 0xfc, 0x24, 0x60, 0x6c, 0xa2, 0x24, 0x20, 0x89, 0x3e, 0x73, 0xa1, 0x99, 0x84, 0x1e, 0x83, 0x53, - 0xf5, 0xda, 0xda, 0x66, 0x75, 0x55, 0xdd, 0xa8, 0xaf, 0xf5, 0x7d, 0x9e, 0x5f, 0x2c, 0xdc, 0xb9, - 0xbb, 0x94, 0xe1, 0x61, 0xe7, 0x28, 0xea, 0x6d, 0xa5, 0x7a, 0x63, 0xab, 0x51, 0x95, 0x22, 0x8c, - 0x7a, 0xdb, 0xc6, 0xb7, 0x2c, 0x97, 0x5d, 0xfe, 0xfa, 0x04, 0x9c, 0x1e, 0x42, 0xed, 0x05, 0x9f, - 0x33, 0x77, 0xee, 0x2e, 0xe5, 0xb6, 0x6d, 0xcc, 0xb4, 0x8c, 0x72, 0x2c, 0xc3, 0xfc, 0x20, 0xc7, - 0xd6, 0xf6, 0x56, 0xbd, 0xb4, 0x2e, 0x2d, 0x15, 0xa5, 0x3b, 0x77, 0x97, 0xb2, 0xc2, 0x64, 0x10, - 0xfa, 0xf7, 0x3e, 0xfa, 0xfc, 0xd6, 0x54, 0x28, 0x6b, 0xcc, 0xe2, 0xba, 0xae, 0x66, 0x6b, 0x9d, - 0xe3, 0x86, 0x9f, 0x63, 0x0e, 0x0e, 0xc8, 0x3f, 0x15, 0x85, 0x82, 0x17, 0xdc, 0x6c, 0xd3, 0x37, - 0xa0, 0xa7, 0x82, 0x19, 0xbf, 0xcc, 0xc8, 0xb5, 0x83, 0x51, 0x8b, 0x84, 0xe0, 0x07, 0x21, 0x25, - 0x9c, 0x64, 0x3e, 0xa9, 0x96, 0x86, 0xac, 0x6f, 0x9c, 0x82, 0xb3, 0x7a, 0x1c, 0xe8, 0x05, 0x48, - 0x7b, 0x53, 0xcc, 0xbb, 0x20, 0x6d, 0xf4, 0x9c, 0xe4, 0xfc, 0x3e, 0x0f, 0x7a, 0xce, 0x0f, 0xe3, - 0xe2, 0xa3, 0x02, 0xc3, 0x1b, 0x8c, 0x80, 0x33, 0x7b, 0x21, 0xdc, 0x13, 0x10, 0xd7, 0x76, 0x75, - 0x83, 0x1b, 0xe0, 0xfb, 0x06, 0xf9, 0x4a, 0xe5, 0x4a, 0x8d, 0x33, 0x51, 0x4a, 0xb9, 0xc6, 0x93, - 0x29, 0x5c, 0x5e, 0xf4, 0x3a, 0x9a, 0x03, 0x95, 0xc5, 0xc2, 0xcc, 0xbb, 0x48, 0x75, 0xb4, 0x83, - 0x32, 0x0d, 0x87, 0x4f, 0x41, 0x92, 0x54, 0xb6, 0xf8, 0x85, 0x07, 0x31, 0x25, 0xd1, 0xd1, 0x0e, - 0xd6, 0x34, 0xe7, 0x7a, 0x3c, 0x15, 0x93, 0xe2, 0xf2, 0x8f, 0x11, 0x4f, 0x25, 0x24, 0x15, 0xf4, - 0x28, 0x20, 0xc2, 0xa1, 0xb5, 0xb0, 0x4a, 0xa6, 0x2e, 0x15, 0xaf, 0xc0, 0x2d, 0x74, 0xb4, 0x83, - 0x52, 0x0b, 0x6f, 0xf6, 0x3a, 0xb4, 0x01, 0x0e, 0xda, 0x00, 0x49, 0x10, 0x8b, 0x91, 0xe5, 0xe2, - 0x3f, 0x3d, 0x78, 0xc1, 0x2a, 0x27, 0x60, 0x0b, 0xc0, 0x27, 0xc8, 0x02, 0x90, 0x67, 0x78, 0xde, - 0x51, 0x91, 0x50, 0x57, 0x62, 0xe1, 0xae, 0xc8, 0x2f, 0x40, 0xa1, 0x6f, 0x04, 0x90, 0x0c, 0x39, - 0x9e, 0xb1, 0xa2, 0xdb, 0xf0, 0x2c, 0xc2, 0x49, 0x2b, 0x19, 0x96, 0x99, 0xa2, 0xc7, 0x12, 0x56, - 0x52, 0x3f, 0xfb, 0xe6, 0x62, 0x84, 0x6e, 0xe6, 0x3c, 0x0a, 0xb9, 0xd0, 0x18, 0x88, 0x2c, 0x72, - 0xc4, 0xcf, 0x22, 0xfb, 0xc4, 0xaf, 0x41, 0x96, 0x18, 0x20, 0xdc, 0xe4, 0xb4, 0x0f, 0x43, 0x81, - 0x19, 0xc8, 0x7e, 0x59, 0x33, 0x87, 0x67, 0x43, 0x08, 0x5c, 0x16, 0x1e, 0x50, 0x58, 0xec, 0x19, - 0x41, 0xb5, 0xa6, 0x39, 0xf2, 0x16, 0x80, 0x3f, 0xa8, 0xa8, 0x04, 0xf7, 0x13, 0xe3, 0x11, 0x3c, - 0x36, 0xca, 0xaf, 0xc6, 0x0a, 0x79, 0x8c, 0x45, 0x42, 0xe4, 0x1f, 0x0d, 0x65, 0x17, 0x64, 0x5d, - 0xa3, 0x14, 0xe5, 0x97, 0x3e, 0xf3, 0xf6, 0x42, 0xe4, 0xbd, 0xb1, 0x05, 0xdf, 0xf5, 0x32, 0x9c, - 0x09, 0x54, 0x12, 0x05, 0x0c, 0x25, 0xa2, 0x0a, 0x01, 0x7d, 0x25, 0x95, 0xe3, 0x12, 0x4a, 0x47, - 0xe6, 0x7f, 0x8b, 0x47, 0x9b, 0x9d, 0xf1, 0xd9, 0xa6, 0xf1, 0xf9, 0xae, 0xe1, 0x49, 0xf9, 0x7f, - 0x9a, 0x86, 0xa4, 0x82, 0x3f, 0xdc, 0xc3, 0x8e, 0x8b, 0x2e, 0x42, 0x1c, 0xeb, 0xfb, 0xd6, 0xb0, - 0x1c, 0x28, 0xe9, 0xe0, 0x32, 0xa7, 0xab, 0xea, 0xfb, 0xd6, 0xb5, 0x29, 0x85, 0xd2, 0xa2, 0x4b, - 0x30, 0xbd, 0xd7, 0xee, 0xf1, 0xf4, 0x55, 0x9f, 0xcd, 0x0a, 0x32, 0x5d, 0x25, 0x44, 0xd7, 0xa6, - 0x14, 0x46, 0x4d, 0x5e, 0x45, 0x6f, 0xc6, 0x8e, 0x1d, 0xfd, 0xaa, 0x9a, 0xb9, 0x47, 0x5f, 0x45, - 0x68, 0x51, 0x19, 0xc0, 0x30, 0x0d, 0x57, 0xa5, 0xa9, 0x1d, 0x6e, 0x35, 0x1e, 0x18, 0xcd, 0x69, - 0xb8, 0x34, 0x19, 0x74, 0x6d, 0x4a, 0x49, 0x1b, 0xe2, 0x81, 0x34, 0xf7, 0xc3, 0x3d, 0x6c, 0x1f, - 0x72, 0x6f, 0x6d, 0x64, 0x73, 0x5f, 0x22, 0x44, 0xa4, 0xb9, 0x94, 0x9a, 0x18, 0x59, 0x76, 0xc9, - 0x9e, 0x7b, 0xc0, 0xaf, 0x8e, 0x5d, 0x1c, 0xc5, 0x49, 0x6f, 0xda, 0x6b, 0x1c, 0x5c, 0x9b, 0x52, - 0x92, 0x3a, 0xfb, 0x89, 0x9e, 0xf5, 0x5c, 0xb0, 0xcc, 0xa0, 0xd7, 0x13, 0xe2, 0x65, 0x69, 0x9f, - 0x29, 0xe1, 0x8a, 0xa1, 0x4d, 0xc8, 0xb7, 0x0d, 0xc7, 0x55, 0x1d, 0x53, 0xeb, 0x3a, 0xfb, 0x96, - 0xeb, 0xd0, 0xfc, 0x49, 0xe6, 0xe2, 0x43, 0xa3, 0x10, 0xd6, 0x0d, 0xc7, 0xad, 0x0b, 0xe2, 0x6b, - 0x53, 0x4a, 0xae, 0x1d, 0x2c, 0x20, 0x78, 0xd6, 0xde, 0x1e, 0xb6, 0x3d, 0x40, 0x9a, 0x67, 0x39, - 0x02, 0x6f, 0x8b, 0x50, 0x0b, 0x7e, 0x82, 0x67, 0x05, 0x0b, 0xd0, 0xd7, 0xc0, 0x6c, 0xdb, 0xd2, - 0x9a, 0x1e, 0x9c, 0xaa, 0xef, 0xf7, 0xcc, 0x9b, 0x34, 0x29, 0x93, 0xb9, 0xf8, 0xc8, 0xc8, 0x46, - 0x5a, 0x5a, 0x53, 0x40, 0x54, 0x08, 0xc3, 0xb5, 0x29, 0x65, 0xa6, 0xdd, 0x5f, 0x88, 0xbe, 0x1e, - 0xe6, 0xb4, 0x6e, 0xb7, 0x7d, 0xd8, 0x8f, 0x5e, 0xa0, 0xe8, 0xe7, 0x47, 0xa1, 0x97, 0x08, 0x4f, - 0x3f, 0x3c, 0xd2, 0x06, 0x4a, 0x51, 0x03, 0xa4, 0xae, 0x8d, 0xe9, 0x97, 0x57, 0x5d, 0xee, 0x65, - 0xd0, 0x7b, 0xa9, 0x32, 0x17, 0xcf, 0x8e, 0xc2, 0xde, 0x66, 0xf4, 0xc2, 0x29, 0xb9, 0x36, 0xa5, - 0x14, 0xba, 0xe1, 0x22, 0x86, 0x6a, 0xe9, 0x98, 0x5e, 0x9b, 0xc7, 0x51, 0x67, 0xc6, 0xa1, 0x52, - 0xfa, 0x30, 0x6a, 0xa8, 0x08, 0x55, 0x21, 0xc3, 0x42, 0x51, 0x95, 0x18, 0x43, 0x7a, 0x9b, 0x55, - 0xe6, 0xa2, 0x3c, 0x72, 0x86, 0x52, 0xd2, 0x1b, 0x96, 0x8b, 0xaf, 0x4d, 0x29, 0x80, 0xbd, 0x27, - 0xa4, 0xc1, 0x09, 0x7a, 0xb1, 0xd7, 0xa1, 0x1a, 0x36, 0xbc, 0xf3, 0xb3, 0x14, 0xf0, 0xd1, 0x51, - 0x80, 0x37, 0x28, 0xd3, 0x8d, 0xa0, 0x1d, 0xbe, 0x36, 0xa5, 0xcc, 0xde, 0x1a, 0x2c, 0x26, 0x2a, - 0xb6, 0x67, 0x98, 0x5a, 0xdb, 0x78, 0x03, 0xb3, 0x25, 0x94, 0x5e, 0x69, 0x79, 0x84, 0x8a, 0x5d, - 0xe5, 0xd4, 0x74, 0x61, 0x25, 0x2a, 0xb6, 0x17, 0x2c, 0x28, 0x27, 0xf9, 0x99, 0x51, 0xef, 0x8a, - 0xb6, 0xa4, 0x94, 0x62, 0xd7, 0xb2, 0x5d, 0x8f, 0xa7, 0x40, 0xca, 0xc8, 0x67, 0x21, 0x13, 0x30, - 0x4c, 0x68, 0x1e, 0x92, 0xfc, 0x54, 0x8d, 0x38, 0x7d, 0xca, 0x1f, 0xe5, 0x3c, 0x64, 0x83, 0xc6, - 0x48, 0xfe, 0x78, 0xc4, 0xe3, 0xa4, 0x77, 0x53, 0xcc, 0x87, 0x33, 0xd2, 0x69, 0xdf, 0x53, 0x79, - 0x50, 0x2c, 0x6d, 0xa2, 0x9e, 0x6d, 0xbf, 0x66, 0x69, 0x21, 0x5f, 0x59, 0xd1, 0x22, 0x64, 0xba, - 0x17, 0xbb, 0x1e, 0x49, 0x8c, 0x92, 0x40, 0xf7, 0x62, 0x57, 0x10, 0x3c, 0x00, 0x59, 0xd2, 0x6f, - 0x35, 0xe8, 0x2f, 0xa5, 0x95, 0x0c, 0x29, 0xe3, 0x24, 0xf2, 0xbf, 0x89, 0x82, 0xd4, 0x6f, 0xc0, - 0xbc, 0x54, 0x75, 0xe4, 0xd8, 0xa9, 0xea, 0xd3, 0xfd, 0x49, 0x72, 0x3f, 0x2f, 0xbe, 0x0e, 0x92, - 0x9f, 0xde, 0x65, 0x4b, 0xcd, 0x68, 0xff, 0xaf, 0xcf, 0x51, 0x55, 0x0a, 0x7a, 0x9f, 0xe7, 0x7a, - 0x35, 0xb4, 0x59, 0x29, 0xfe, 0x74, 0x44, 0xff, 0x80, 0x7b, 0x4e, 0xcc, 0x4e, 0xb7, 0xa9, 0xb9, - 0x58, 0xe4, 0xc7, 0x02, 0xfb, 0x96, 0x0f, 0x43, 0x41, 0xeb, 0x76, 0x55, 0xc7, 0xd5, 0x5c, 0xcc, - 0x7d, 0x0d, 0x96, 0x79, 0xc8, 0x69, 0xdd, 0x6e, 0x9d, 0x94, 0x32, 0x5f, 0xe3, 0x21, 0xc8, 0x13, - 0x9b, 0x6e, 0x68, 0x6d, 0xe1, 0x2a, 0x24, 0x98, 0x4b, 0xc2, 0x4b, 0x99, 0x77, 0x20, 0x37, 0xbd, - 0x11, 0xa7, 0xf6, 0xdc, 0x8b, 0xa9, 0x22, 0x81, 0x98, 0x0a, 0xf1, 0x3b, 0x43, 0x98, 0x7c, 0xc4, - 0x3d, 0x2b, 0xc3, 0x37, 0x0d, 0xe6, 0x68, 0xfc, 0x75, 0x8b, 0x25, 0x4b, 0x52, 0x0a, 0x7b, 0x90, - 0x15, 0xc8, 0x87, 0x6d, 0x3f, 0xca, 0x43, 0xd4, 0x3d, 0xe0, 0x6f, 0x89, 0xba, 0x07, 0xc4, 0xd3, - 0xf5, 0x6e, 0xda, 0xcd, 0x0f, 0x59, 0xed, 0x38, 0x9f, 0x9f, 0xeb, 0x90, 0x0b, 0x90, 0x0b, 0xad, - 0x09, 0xf2, 0x49, 0x98, 0x1b, 0x66, 0xe2, 0xe5, 0x7d, 0xaf, 0x3c, 0x64, 0xaa, 0xd1, 0x25, 0x48, - 0x79, 0x36, 0x7e, 0x48, 0x74, 0x4c, 0x5f, 0x2b, 0x88, 0x15, 0x8f, 0x34, 0x94, 0xce, 0x8f, 0x86, - 0xd2, 0xf9, 0xf2, 0x37, 0xc0, 0xfc, 0x28, 0xfb, 0xdd, 0x97, 0xe4, 0x8b, 0x7b, 0x02, 0x3b, 0x09, - 0x09, 0x7e, 0xa5, 0x65, 0x94, 0x6e, 0x60, 0xf1, 0x27, 0x22, 0x48, 0x66, 0xcb, 0x63, 0x6c, 0x5f, - 0x8b, 0x3e, 0xc8, 0x2a, 0x9c, 0x1e, 0x69, 0xc3, 0x47, 0x6f, 0x85, 0x31, 0x20, 0xbe, 0x15, 0xa6, - 0x8b, 0xe6, 0x38, 0xb4, 0xaf, 0xe2, 0x20, 0x0b, 0x7b, 0x92, 0x3f, 0x11, 0x83, 0x93, 0xc3, 0x2d, - 0x39, 0x5a, 0x82, 0x2c, 0xf1, 0x5b, 0xdd, 0xb0, 0x8b, 0x0b, 0x1d, 0xed, 0xa0, 0xc1, 0xfd, 0x5b, - 0xbe, 0x95, 0x10, 0xf5, 0xb6, 0x12, 0xd0, 0x0e, 0xcc, 0xb4, 0x2d, 0x5d, 0x6b, 0xab, 0x81, 0xad, - 0x1c, 0x3e, 0x89, 0x1e, 0x1c, 0x10, 0x76, 0x38, 0x65, 0x48, 0x0c, 0x0e, 0xd7, 0xff, 0x02, 0xc5, - 0x58, 0xf7, 0x76, 0x7d, 0xd0, 0x2a, 0x64, 0x3a, 0x86, 0xb3, 0x8b, 0xf7, 0xb5, 0x5b, 0x86, 0x65, - 0xf3, 0xd9, 0x34, 0xa8, 0x34, 0x1b, 0x3e, 0x8d, 0xd8, 0x61, 0x0a, 0xb0, 0x05, 0x86, 0x64, 0x7a, - 0xe8, 0xc6, 0x57, 0xe2, 0xd8, 0xd6, 0x64, 0xd4, 0x1e, 0x52, 0x72, 0xe4, 0x1e, 0xd2, 0xb0, 0x0d, - 0x9b, 0xd4, 0xf0, 0x0d, 0x9b, 0x8f, 0x05, 0x87, 0x26, 0xbc, 0xf6, 0x0d, 0xec, 0xe1, 0xa0, 0x3a, - 0xcc, 0x71, 0xfe, 0x66, 0x48, 0xf6, 0x43, 0x8e, 0x3a, 0xb0, 0xf9, 0xd5, 0x2f, 0x73, 0x24, 0xd8, - 0x47, 0x8b, 0x3d, 0x76, 0x6f, 0x62, 0x17, 0x9b, 0xa8, 0xf1, 0xc0, 0x26, 0xea, 0xff, 0x61, 0x43, - 0xf1, 0x02, 0xcc, 0x0c, 0xf8, 0x11, 0x43, 0x37, 0x87, 0x47, 0x24, 0x64, 0xe5, 0x4f, 0x46, 0xa0, - 0x38, 0xda, 0x71, 0x18, 0x0a, 0x75, 0xac, 0xdc, 0xf7, 0x28, 0xf3, 0xfc, 0x10, 0xe4, 0xfb, 0xdc, - 0x1a, 0x36, 0x0a, 0xb9, 0x50, 0x00, 0x29, 0x7f, 0x73, 0xcc, 0xb3, 0x99, 0x21, 0xdf, 0x63, 0x88, - 0xa2, 0xbd, 0x04, 0xb3, 0x4d, 0xac, 0x1b, 0xcd, 0x7b, 0xd5, 0xb3, 0x19, 0xce, 0xfd, 0xff, 0xd4, - 0x6c, 0x50, 0xcd, 0xbe, 0x07, 0x20, 0xa5, 0x60, 0xa7, 0x4b, 0x5c, 0x09, 0x54, 0x86, 0x34, 0x3e, - 0xd0, 0x71, 0xd7, 0xf5, 0xcf, 0x03, 0x0c, 0xf3, 0x6e, 0x19, 0x75, 0x55, 0x50, 0x92, 0xd8, 0xce, - 0x63, 0x43, 0x4f, 0xf1, 0xf0, 0x75, 0x74, 0x24, 0xca, 0xd9, 0x83, 0xf1, 0xeb, 0x65, 0x11, 0xbf, - 0xc6, 0x46, 0x86, 0x66, 0x8c, 0xab, 0x2f, 0x80, 0x7d, 0x8a, 0x07, 0xb0, 0xf1, 0x31, 0x2f, 0x0b, - 0x45, 0xb0, 0x95, 0x50, 0x04, 0x9b, 0x18, 0xd3, 0xcd, 0x11, 0x21, 0xec, 0x65, 0x11, 0xc2, 0x26, - 0xc7, 0xb4, 0xb8, 0x2f, 0x86, 0x7d, 0x3e, 0x10, 0xc3, 0xa6, 0x07, 0x13, 0x85, 0x21, 0xd6, 0x21, - 0x41, 0xec, 0x73, 0x5e, 0x10, 0x9b, 0x1d, 0x19, 0x00, 0x73, 0xe6, 0xfe, 0x28, 0x76, 0x6b, 0x20, - 0x8a, 0xcd, 0xf1, 0xbf, 0xed, 0x33, 0x0a, 0x62, 0x4c, 0x18, 0xbb, 0x35, 0x10, 0xc6, 0xe6, 0xc7, - 0x00, 0x8e, 0x89, 0x63, 0xbf, 0x76, 0x78, 0x1c, 0x3b, 0x3a, 0xd2, 0xe4, 0xcd, 0x9c, 0x2c, 0x90, - 0x55, 0x47, 0x04, 0xb2, 0xd2, 0xc8, 0xa0, 0x8b, 0xc1, 0x4f, 0x1c, 0xc9, 0xee, 0x0c, 0x89, 0x64, - 0x59, 0xcc, 0x79, 0x6e, 0x24, 0xf8, 0x04, 0xa1, 0xec, 0xce, 0x90, 0x50, 0x16, 0x8d, 0x85, 0x1d, - 0x1b, 0xcb, 0x5e, 0x0d, 0xc7, 0xb2, 0xb3, 0x23, 0x1c, 0x26, 0x7f, 0xb6, 0x8f, 0x08, 0x66, 0x77, - 0x47, 0x05, 0xb3, 0x2c, 0xe0, 0x7c, 0x6c, 0x24, 0xe2, 0x31, 0xa2, 0xd9, 0xad, 0x81, 0x68, 0xf6, - 0xc4, 0x18, 0x4d, 0x9b, 0x3c, 0x9c, 0x65, 0x77, 0x8d, 0xb3, 0x5b, 0xc6, 0x41, 0xca, 0x5c, 0x8f, - 0xa7, 0x32, 0x52, 0x56, 0x7e, 0x84, 0xac, 0xbe, 0x7d, 0x76, 0x8e, 0xb8, 0xb9, 0xd8, 0xb6, 0x2d, - 0x5b, 0x1c, 0xee, 0xa7, 0x0f, 0xf2, 0x39, 0x12, 0xde, 0xf8, 0x36, 0xed, 0x88, 0xd0, 0x97, 0x86, - 0x13, 0x01, 0x3b, 0x26, 0xff, 0x6c, 0xc4, 0xe7, 0xa5, 0xc1, 0x6f, 0x30, 0x34, 0x4a, 0xf3, 0xd0, - 0x28, 0x10, 0x10, 0x47, 0xc3, 0x01, 0xf1, 0x22, 0x64, 0x48, 0x98, 0xd0, 0x17, 0xeb, 0x6a, 0x5d, - 0x2f, 0xd6, 0x15, 0x67, 0x7f, 0x58, 0xd8, 0xcc, 0x97, 0x25, 0xb6, 0x11, 0x56, 0xf0, 0xce, 0x41, - 0xb1, 0x28, 0x0d, 0x3d, 0x0e, 0xb3, 0x01, 0x5a, 0x2f, 0xfc, 0x60, 0x81, 0x9f, 0xe4, 0x51, 0x97, - 0x78, 0x1c, 0xf2, 0xcf, 0x23, 0xbe, 0x84, 0xfc, 0x20, 0x79, 0x58, 0x3c, 0x1b, 0x79, 0x97, 0xe2, - 0xd9, 0xe8, 0x3d, 0xc7, 0xb3, 0xc1, 0x70, 0x2a, 0x16, 0x0e, 0xa7, 0xfe, 0x7b, 0xc4, 0x1f, 0x13, - 0x2f, 0x3a, 0xd5, 0xad, 0x26, 0xe6, 0x01, 0x0e, 0xfd, 0x4d, 0x5c, 0x92, 0xb6, 0xd5, 0xe2, 0x61, - 0x0c, 0xf9, 0x49, 0xa8, 0xbc, 0x85, 0x27, 0xcd, 0xd7, 0x15, 0x2f, 0x36, 0x9a, 0x0e, 0x7e, 0x82, - 0xc0, 0xcf, 0xe5, 0x27, 0xfc, 0x73, 0xf9, 0xde, 0xf7, 0xb7, 0xc9, 0xc0, 0xf7, 0xb7, 0xe8, 0x59, - 0x48, 0xd3, 0x3c, 0xb5, 0x6a, 0x75, 0xc5, 0x1f, 0xc6, 0x3a, 0x33, 0xfa, 0x4c, 0xbe, 0x43, 0x4f, - 0x0b, 0xb3, 0x73, 0xfc, 0xbe, 0xc7, 0x91, 0x0e, 0x79, 0x1c, 0xf7, 0x41, 0x9a, 0xb4, 0x9e, 0xfd, - 0x81, 0x07, 0xe0, 0x1f, 0x6f, 0x8b, 0x02, 0xf9, 0xc7, 0xa3, 0x50, 0xe8, 0x5b, 0x68, 0x86, 0xf6, - 0x7d, 0xd8, 0x0e, 0xe8, 0x64, 0xf2, 0x58, 0x00, 0x68, 0x69, 0x8e, 0x7a, 0x5b, 0x33, 0x5d, 0xdc, - 0xe4, 0x42, 0x09, 0x94, 0xa0, 0x22, 0xa4, 0xc8, 0x53, 0xcf, 0xc1, 0x4d, 0x9e, 0x38, 0xf0, 0x9e, - 0xd1, 0x35, 0x48, 0xe0, 0x5b, 0xf4, 0x82, 0x53, 0x76, 0x4d, 0xf0, 0xc9, 0xc1, 0x48, 0x8e, 0x54, - 0x97, 0xe7, 0xc9, 0x60, 0x7f, 0xe9, 0xad, 0x45, 0x89, 0x51, 0x3f, 0xe6, 0x7d, 0x33, 0xa5, 0x70, - 0xfe, 0xb0, 0x14, 0x52, 0x7d, 0x52, 0xa0, 0x29, 0xac, 0xac, 0x88, 0x4c, 0x89, 0x4c, 0xd9, 0xf1, - 0x64, 0x25, 0xd7, 0xc1, 0x9d, 0xae, 0x65, 0xb5, 0x55, 0x36, 0xc7, 0x4b, 0x90, 0x0f, 0xaf, 0xab, - 0xec, 0x8f, 0x2f, 0xb9, 0x9a, 0x61, 0xaa, 0x21, 0x27, 0x38, 0xcb, 0x0a, 0xd9, 0x9c, 0xba, 0x1e, - 0x4f, 0x45, 0xa4, 0xe8, 0xf5, 0x78, 0x2a, 0x2a, 0xc5, 0xe4, 0x6d, 0x38, 0x31, 0x74, 0x5d, 0x45, - 0xcf, 0x40, 0xda, 0x5f, 0x92, 0xd9, 0x09, 0xf3, 0x23, 0x92, 0x04, 0x3e, 0xad, 0xfc, 0x8b, 0x11, - 0x1f, 0x32, 0x9c, 0x76, 0xa8, 0x42, 0x82, 0x1d, 0xf7, 0xe3, 0x47, 0x3b, 0x1e, 0x9f, 0x6c, 0x45, - 0x5e, 0x66, 0x67, 0x01, 0x15, 0xce, 0x2c, 0x7f, 0x3d, 0x24, 0x58, 0x09, 0xca, 0x40, 0xd2, 0xbf, - 0x4a, 0x19, 0x20, 0x51, 0xaa, 0x54, 0xaa, 0xdb, 0xe2, 0x5e, 0xd4, 0xf2, 0x96, 0xd2, 0x90, 0xa2, - 0xa4, 0x58, 0xa9, 0x5e, 0xaf, 0x56, 0x1a, 0x52, 0x0c, 0xcd, 0x40, 0x8e, 0xfd, 0x56, 0xaf, 0x6e, - 0x29, 0x1b, 0xa5, 0x86, 0x14, 0x0f, 0x14, 0xd5, 0xab, 0x9b, 0xab, 0x55, 0x45, 0x9a, 0x96, 0x9f, - 0x84, 0xd3, 0x23, 0xd7, 0x70, 0x3f, 0xa7, 0x10, 0x09, 0xe4, 0x14, 0xe4, 0x4f, 0x44, 0x49, 0x50, - 0x33, 0x6a, 0x61, 0x46, 0xd7, 0xfb, 0x3a, 0x7e, 0xf1, 0x18, 0xab, 0x7a, 0x5f, 0xef, 0x49, 0x1c, - 0x63, 0xe3, 0x3d, 0xec, 0xea, 0xfb, 0xcc, 0x51, 0x60, 0x16, 0x28, 0xa7, 0xe4, 0x78, 0x29, 0x65, - 0x72, 0x18, 0xd9, 0xeb, 0x58, 0x77, 0x55, 0xa6, 0x44, 0x0e, 0xff, 0x5b, 0xb1, 0x39, 0x56, 0x5a, - 0x67, 0x85, 0xf2, 0x37, 0x1c, 0x4b, 0x96, 0x69, 0x98, 0x56, 0xaa, 0x0d, 0xe5, 0x55, 0x29, 0x86, - 0x10, 0xe4, 0xe9, 0x4f, 0xb5, 0xbe, 0x59, 0xda, 0xae, 0x5f, 0xdb, 0x22, 0xb2, 0x9c, 0x85, 0x82, - 0x90, 0xa5, 0x28, 0x9c, 0x96, 0x1f, 0x85, 0x53, 0x23, 0xbc, 0x8a, 0x21, 0xe7, 0x2f, 0x3f, 0x15, - 0x09, 0x52, 0x87, 0x3d, 0x83, 0x2d, 0x48, 0x38, 0xae, 0xe6, 0xf6, 0x1c, 0x2e, 0xc4, 0x67, 0x26, - 0x75, 0x33, 0x96, 0xc5, 0x8f, 0x3a, 0x65, 0x57, 0x38, 0x8c, 0x7c, 0x09, 0xf2, 0xe1, 0x9a, 0xd1, - 0x32, 0xf0, 0x95, 0x28, 0x2a, 0x5f, 0x01, 0x34, 0xe8, 0x7d, 0x0c, 0x09, 0x2f, 0x23, 0xc3, 0xc2, - 0xcb, 0x1f, 0x89, 0xc0, 0x99, 0x23, 0x3c, 0x0d, 0xf4, 0x52, 0x5f, 0x27, 0x9f, 0x3b, 0x8e, 0x9f, - 0xb2, 0xcc, 0xca, 0xfa, 0xba, 0xf9, 0x14, 0x64, 0x83, 0xe5, 0x93, 0x75, 0xf2, 0x4b, 0x51, 0x7f, - 0x12, 0x87, 0xe3, 0x60, 0xdf, 0x04, 0x46, 0xfe, 0x82, 0x26, 0xf0, 0x83, 0x00, 0xee, 0x81, 0x38, - 0x00, 0xcc, 0xd7, 0xd1, 0xfb, 0x87, 0xa4, 0xc6, 0xb0, 0xde, 0x38, 0xe0, 0x93, 0x20, 0xed, 0xf2, - 0x5f, 0x0e, 0xaa, 0x07, 0x93, 0x02, 0x3d, 0xba, 0xc6, 0x3a, 0xde, 0x5f, 0x8a, 0x9d, 0x6c, 0x31, - 0xf6, 0x93, 0x07, 0xac, 0xd8, 0x41, 0xaf, 0xc2, 0xa9, 0x3e, 0x47, 0xc1, 0x83, 0x8e, 0x4f, 0xea, - 0x2f, 0x9c, 0x08, 0xfb, 0x0b, 0x02, 0x3a, 0xb8, 0xda, 0x4f, 0x87, 0x57, 0xfb, 0x57, 0x01, 0xfc, - 0xe4, 0x80, 0x7f, 0x62, 0x2d, 0x12, 0x3c, 0xb1, 0x76, 0x09, 0xa6, 0x89, 0x26, 0x09, 0x39, 0x0d, - 0x9a, 0x62, 0xa2, 0x09, 0x81, 0xe4, 0x02, 0xa3, 0x96, 0x0d, 0x40, 0x83, 0xb9, 0xc5, 0x11, 0xaf, - 0x78, 0x3e, 0xfc, 0x8a, 0x07, 0x46, 0x66, 0x29, 0x87, 0xbf, 0xea, 0x0d, 0x98, 0xa6, 0x23, 0x3f, - 0xf4, 0x33, 0xc0, 0xaf, 0x03, 0xd0, 0x5c, 0xd7, 0x36, 0x76, 0x7b, 0xfe, 0x0b, 0x16, 0x87, 0x6b, - 0x4e, 0x49, 0xd0, 0x95, 0xef, 0xe3, 0x2a, 0x34, 0xe7, 0xb3, 0x06, 0xd4, 0x28, 0x00, 0x28, 0x6f, - 0x42, 0x3e, 0xcc, 0x3b, 0xfc, 0xb3, 0x46, 0xff, 0x7e, 0x91, 0xb4, 0xf0, 0x6f, 0x3c, 0xef, 0x88, - 0xdf, 0xf9, 0x43, 0x1f, 0xe4, 0x3f, 0x8f, 0x40, 0x36, 0xa8, 0x78, 0xef, 0xb2, 0x0b, 0x72, 0xff, - 0x10, 0x17, 0x24, 0xdd, 0xd2, 0x9c, 0x97, 0x99, 0x07, 0x72, 0x7a, 0xc0, 0x03, 0x49, 0xb6, 0x34, - 0x67, 0xe7, 0x7d, 0x74, 0x40, 0xe4, 0x6f, 0x89, 0x40, 0xca, 0xeb, 0xfc, 0x11, 0xa7, 0x74, 0xfd, - 0x8f, 0x5b, 0xbd, 0xac, 0x3b, 0xdb, 0xdf, 0x88, 0x79, 0xfb, 0x1b, 0x57, 0xbc, 0xc5, 0x6f, 0x54, - 0x3a, 0x24, 0x28, 0x69, 0x71, 0x52, 0x8e, 0xaf, 0xf5, 0x57, 0x26, 0xfb, 0x86, 0x6c, 0x0e, 0xa6, - 0x83, 0xdf, 0x7f, 0xb1, 0x07, 0xb9, 0x19, 0x38, 0x1a, 0xc3, 0xa6, 0x61, 0xf0, 0x63, 0xb3, 0xc8, - 0xb1, 0x3f, 0x36, 0xf3, 0xde, 0x12, 0x0d, 0xbe, 0xe5, 0xbb, 0x23, 0x90, 0x12, 0x33, 0x02, 0x7d, - 0x28, 0x78, 0x64, 0x4a, 0xec, 0xc9, 0x8d, 0xb4, 0x46, 0x1c, 0x3f, 0x70, 0x62, 0x6a, 0xe0, 0xa4, - 0x70, 0xec, 0xb8, 0x27, 0x85, 0xb9, 0x5f, 0xf7, 0x27, 0x11, 0x90, 0xfa, 0xe7, 0xeb, 0x5f, 0xb8, - 0x75, 0x83, 0x8b, 0x5c, 0x6c, 0xc8, 0x22, 0x37, 0xea, 0xf8, 0x6f, 0x7c, 0xd4, 0xf1, 0xdf, 0xc1, - 0x5e, 0x4f, 0xdf, 0x63, 0xaf, 0x3f, 0x1a, 0x85, 0x4c, 0x20, 0x39, 0x8a, 0x9e, 0x0e, 0x1d, 0x25, - 0x5e, 0x3a, 0x2a, 0x91, 0x1a, 0x38, 0x4b, 0x1c, 0x12, 0x53, 0xf4, 0xf8, 0x62, 0x7a, 0xf7, 0x3f, - 0x2b, 0x1a, 0xfe, 0xe5, 0xe5, 0xf4, 0x88, 0x2f, 0x2f, 0xbf, 0x29, 0x02, 0x29, 0xcf, 0xe9, 0x3e, - 0xee, 0xee, 0xdb, 0x49, 0x48, 0x70, 0xbf, 0x92, 0x6d, 0xbf, 0xf1, 0xa7, 0xa1, 0x49, 0xe5, 0x22, - 0xa4, 0xc4, 0x1f, 0xed, 0xe3, 0x6b, 0x9a, 0xf7, 0x7c, 0xfe, 0x39, 0xc8, 0x04, 0x76, 0x2e, 0x89, - 0x61, 0xdc, 0xac, 0xbe, 0x2c, 0x4d, 0x15, 0x93, 0x77, 0xee, 0x2e, 0xc5, 0x36, 0xf1, 0x6d, 0x32, - 0x9b, 0x95, 0x6a, 0xe5, 0x5a, 0xb5, 0xf2, 0xa2, 0x14, 0x29, 0x66, 0xee, 0xdc, 0x5d, 0x4a, 0x2a, - 0x98, 0xe6, 0x13, 0xcf, 0xbf, 0x08, 0x85, 0xbe, 0x81, 0x09, 0x3b, 0x2d, 0x08, 0xf2, 0xab, 0x3b, - 0xdb, 0xeb, 0xb5, 0x4a, 0xa9, 0x51, 0x55, 0xd9, 0x81, 0x53, 0x74, 0x0a, 0x66, 0xd7, 0x6b, 0x6b, - 0xd7, 0x1a, 0x6a, 0x65, 0xbd, 0x56, 0xdd, 0x6c, 0xa8, 0xa5, 0x46, 0xa3, 0x54, 0x79, 0x51, 0x8a, - 0x5e, 0xbc, 0x9b, 0x81, 0x78, 0xa9, 0x5c, 0xa9, 0xa1, 0x0a, 0xc4, 0x69, 0x22, 0xe4, 0xc8, 0xa3, - 0x4b, 0xc5, 0xa3, 0x33, 0xc3, 0xe8, 0x2a, 0x4c, 0xd3, 0x1c, 0x09, 0x3a, 0xfa, 0x2c, 0x53, 0x71, - 0x4c, 0xaa, 0x98, 0x34, 0x86, 0xce, 0xc8, 0x23, 0x0f, 0x37, 0x15, 0x8f, 0xce, 0x1c, 0xa3, 0x75, - 0x48, 0x8a, 0x10, 0x79, 0xdc, 0x89, 0xa3, 0xe2, 0xd8, 0x74, 0x2e, 0xe9, 0x1a, 0x4b, 0x35, 0x1c, - 0x7d, 0xee, 0xa9, 0x38, 0x26, 0xa7, 0x8c, 0x6a, 0xde, 0x87, 0x38, 0x63, 0x8e, 0x32, 0x15, 0xc7, - 0x65, 0x89, 0x91, 0x02, 0x69, 0x3f, 0x89, 0x33, 0xfe, 0x34, 0x57, 0x71, 0x82, 0x74, 0x39, 0xfa, - 0x7a, 0xc8, 0x85, 0x03, 0xdd, 0xc9, 0x8e, 0x4b, 0x15, 0x27, 0xcc, 0x47, 0x13, 0xfc, 0x70, 0xd4, - 0x3b, 0xd9, 0xf1, 0xa9, 0xe2, 0x84, 0xe9, 0x69, 0xf4, 0x3a, 0xcc, 0x0c, 0x46, 0xa5, 0x93, 0x9f, - 0xa6, 0x2a, 0x1e, 0x23, 0x61, 0x8d, 0x3a, 0x80, 0x86, 0x44, 0xb3, 0xc7, 0x38, 0x5c, 0x55, 0x3c, - 0x4e, 0xfe, 0x1a, 0x35, 0xa1, 0xd0, 0x1f, 0x22, 0x4e, 0x7a, 0xd8, 0xaa, 0x38, 0x71, 0x2e, 0x9b, - 0xbd, 0x25, 0x1c, 0x5a, 0x4e, 0x7a, 0xf8, 0xaa, 0x38, 0x71, 0x6a, 0x1b, 0xed, 0x00, 0x04, 0xa2, - 0xc3, 0x09, 0x0e, 0x63, 0x15, 0x27, 0x49, 0x72, 0xa3, 0x2e, 0xcc, 0x0e, 0x0b, 0x1b, 0x8f, 0x73, - 0x36, 0xab, 0x78, 0xac, 0xdc, 0x37, 0xd1, 0xe7, 0x70, 0x00, 0x38, 0xd9, 0x59, 0xad, 0xe2, 0x84, - 0x49, 0xf0, 0x72, 0x69, 0xe4, 0x01, 0xdd, 0xb3, 0x47, 0x1e, 0xd0, 0xf5, 0x8f, 0xdc, 0x7a, 0x87, - 0x72, 0x7f, 0xe7, 0x09, 0xf8, 0x00, 0xbf, 0xfa, 0xc5, 0x71, 0xb5, 0x9b, 0x86, 0xd9, 0xf2, 0xee, - 0xf2, 0xe1, 0xcf, 0xfc, 0x74, 0xee, 0x49, 0x7e, 0xbd, 0x8c, 0x28, 0x1d, 0x73, 0xa3, 0xcf, 0xc8, - 0x6b, 0x0e, 0xc7, 0x1d, 0xe4, 0x1f, 0x7f, 0xee, 0xf6, 0x88, 0xdb, 0x82, 0xc6, 0xdc, 0x49, 0x34, - 0xe4, 0x36, 0xa1, 0xe2, 0x91, 0x1f, 0xc7, 0x17, 0x8f, 0x3a, 0xb0, 0x4c, 0xbc, 0xd8, 0xfc, 0x35, - 0xc3, 0x71, 0x2d, 0xdb, 0xd0, 0xb5, 0x36, 0x5d, 0x5e, 0xae, 0x4c, 0xfa, 0x39, 0x51, 0x39, 0x4d, - 0xdc, 0x15, 0x7e, 0x05, 0x11, 0xff, 0xc4, 0x65, 0x15, 0x12, 0xb7, 0xb4, 0x36, 0xfb, 0x98, 0x27, - 0x78, 0xdb, 0x58, 0xbf, 0xcc, 0x03, 0x7e, 0x54, 0x10, 0x85, 0xf1, 0xca, 0x9f, 0xa3, 0x1f, 0x42, - 0x74, 0x3a, 0x86, 0x43, 0x74, 0x51, 0xa1, 0x81, 0xf4, 0x0e, 0xc4, 0x6d, 0xcd, 0xe5, 0xe1, 0x65, - 0xb9, 0xc4, 0x2f, 0x0e, 0x7a, 0x78, 0xfc, 0xf5, 0x3f, 0xcb, 0x03, 0x77, 0x0b, 0xb1, 0x97, 0x51, - 0x38, 0xf4, 0xb5, 0x90, 0xea, 0x68, 0x07, 0x2a, 0x85, 0x8e, 0xbe, 0x5b, 0xd0, 0xc9, 0x8e, 0x76, - 0x40, 0x5a, 0x8d, 0x0c, 0x28, 0x10, 0x74, 0x7d, 0x5f, 0x33, 0x5b, 0x98, 0xbd, 0x24, 0xf6, 0x6e, - 0xbd, 0x24, 0xd7, 0xd1, 0x0e, 0x2a, 0x14, 0x98, 0xbc, 0x8a, 0x5f, 0xd1, 0xf4, 0xcb, 0x11, 0x9e, - 0x54, 0xa0, 0x92, 0x43, 0x1a, 0x48, 0xba, 0xf7, 0x44, 0xdf, 0x2f, 0x76, 0x40, 0xce, 0x8e, 0x1a, - 0x98, 0x3e, 0xb9, 0x97, 0x73, 0xa4, 0xa5, 0x9f, 0x7f, 0x6b, 0x31, 0xc2, 0xde, 0x5a, 0xd0, 0xfb, - 0xc6, 0xe5, 0x3a, 0x64, 0x58, 0xae, 0x44, 0xa5, 0x4e, 0x6e, 0x74, 0xac, 0x93, 0x9b, 0x13, 0x4e, - 0x2e, 0x03, 0x04, 0xc6, 0x4d, 0xea, 0x79, 0x1f, 0x3e, 0x13, 0x81, 0xcc, 0x6a, 0xe0, 0x72, 0xc1, - 0x79, 0x48, 0x76, 0x2c, 0xd3, 0xb8, 0x89, 0x6d, 0x6f, 0x0b, 0x8b, 0x3d, 0x12, 0x47, 0x94, 0xfd, - 0x8d, 0x3a, 0xf7, 0x50, 0xdc, 0x9b, 0x23, 0x9e, 0x09, 0xd7, 0x6d, 0xbc, 0xeb, 0x18, 0x42, 0xe4, - 0x8a, 0x78, 0x44, 0x8f, 0x80, 0xe4, 0x60, 0xbd, 0x67, 0x1b, 0xee, 0xa1, 0xaa, 0x5b, 0xa6, 0xab, - 0xe9, 0x2e, 0x0f, 0xd3, 0x0b, 0xa2, 0xbc, 0xc2, 0x8a, 0x09, 0x48, 0x13, 0xbb, 0x9a, 0xd1, 0x66, - 0x67, 0x0e, 0xd3, 0x8a, 0x78, 0xe4, 0x4d, 0xfd, 0x5c, 0x32, 0x18, 0xa8, 0x56, 0x40, 0xb2, 0xba, - 0xd8, 0x0e, 0x9d, 0x57, 0x61, 0xea, 0x3a, 0xff, 0xeb, 0x9f, 0x7d, 0x7c, 0x8e, 0x0b, 0x9c, 0x9f, - 0x75, 0x60, 0x77, 0xe9, 0x2b, 0x05, 0xc1, 0x21, 0x0e, 0xb2, 0xbc, 0x1a, 0xda, 0xb4, 0xea, 0xed, - 0xfa, 0x17, 0xa4, 0xcc, 0x0d, 0x08, 0xb5, 0x64, 0x1e, 0x96, 0xe7, 0x7f, 0xcd, 0x87, 0xf6, 0x03, - 0xd9, 0x17, 0xf1, 0x61, 0x70, 0x07, 0x8b, 0xc2, 0x10, 0x1f, 0xff, 0x75, 0xcd, 0x68, 0x8b, 0x3f, - 0xe7, 0xa9, 0xf0, 0x27, 0xb4, 0xe2, 0x65, 0x1f, 0xe3, 0x34, 0x60, 0x92, 0x47, 0xe9, 0x46, 0xd9, - 0x32, 0x9b, 0xe1, 0x34, 0x23, 0x6a, 0x40, 0xc2, 0xb5, 0x6e, 0x62, 0x93, 0x0b, 0xa8, 0xfc, 0xc1, - 0x63, 0x28, 0xf6, 0xe0, 0x6d, 0x61, 0x1c, 0x0b, 0xb5, 0x40, 0x6a, 0xe2, 0x36, 0x6e, 0xb1, 0x4f, - 0x03, 0xf7, 0x35, 0x1b, 0xb3, 0x0f, 0xd3, 0x8f, 0x87, 0x3f, 0x78, 0xa9, 0x58, 0xc1, 0x43, 0xad, - 0x53, 0x50, 0xb4, 0x1d, 0xbe, 0xda, 0x32, 0xc9, 0xf7, 0x9d, 0x47, 0xf4, 0x3f, 0xa0, 0x95, 0x41, - 0xb3, 0x15, 0xba, 0x0a, 0xf3, 0x11, 0x90, 0x7a, 0xe6, 0xae, 0x65, 0xd2, 0xbf, 0x90, 0xc7, 0x43, - 0xb0, 0x14, 0xdb, 0xe4, 0xf4, 0xca, 0xf9, 0x26, 0xe7, 0x36, 0xe4, 0x7d, 0x52, 0x3a, 0x7b, 0xd2, - 0xc7, 0x9d, 0x3d, 0x39, 0x0f, 0x80, 0x90, 0xa0, 0x0d, 0x00, 0x7f, 0x7e, 0xd2, 0x5d, 0xb6, 0xcc, - 0xe8, 0xd1, 0xf4, 0x67, 0x7a, 0xb0, 0x33, 0x01, 0x00, 0xd4, 0x86, 0xd9, 0x8e, 0x61, 0xaa, 0x0e, - 0x6e, 0xef, 0xa9, 0x5c, 0x72, 0x04, 0x37, 0xf3, 0x2e, 0x8c, 0xf4, 0x4c, 0xc7, 0x30, 0xeb, 0xb8, - 0xbd, 0xb7, 0xea, 0xc1, 0xa2, 0x0f, 0xc2, 0x19, 0x5f, 0x1c, 0x96, 0xa9, 0xee, 0x5b, 0xed, 0xa6, - 0x6a, 0xe3, 0x3d, 0x55, 0xa7, 0x97, 0xd5, 0x65, 0xa9, 0x10, 0x4f, 0x79, 0x24, 0x5b, 0xe6, 0x35, - 0xab, 0xdd, 0x54, 0xf0, 0x5e, 0x85, 0x54, 0xa3, 0x07, 0xc1, 0x97, 0x85, 0x6a, 0x34, 0x9d, 0xf9, - 0xdc, 0x52, 0xec, 0x5c, 0x5c, 0xc9, 0x7a, 0x85, 0xb5, 0xa6, 0xb3, 0x92, 0xfa, 0xd8, 0x9b, 0x8b, - 0x53, 0x5f, 0x7c, 0x73, 0x71, 0x4a, 0xbe, 0x4a, 0xaf, 0x56, 0xe2, 0x93, 0x0e, 0x3b, 0xe8, 0x32, - 0xa4, 0x35, 0xf1, 0xc0, 0x3e, 0x9c, 0x3a, 0x62, 0xd2, 0xfa, 0xa4, 0xf2, 0x9b, 0x11, 0x48, 0xac, - 0xde, 0xd8, 0xd6, 0x0c, 0x1b, 0x55, 0x61, 0xc6, 0x57, 0xda, 0x49, 0xe7, 0xbf, 0xaf, 0xe7, 0xc2, - 0x00, 0x54, 0x47, 0x1d, 0x7b, 0x3b, 0x12, 0xa6, 0xff, 0x40, 0x5c, 0xa0, 0xab, 0xd7, 0x21, 0xc9, - 0x5a, 0xe8, 0xa0, 0x17, 0x60, 0xba, 0x4b, 0x7e, 0xf0, 0x24, 0xfe, 0xc2, 0x48, 0x45, 0xa7, 0xf4, - 0x41, 0xb5, 0x60, 0x7c, 0xf2, 0x9f, 0x45, 0x00, 0x56, 0x6f, 0xdc, 0x68, 0xd8, 0x46, 0xb7, 0x8d, - 0xdd, 0x77, 0xab, 0xcb, 0xeb, 0x70, 0x22, 0xf0, 0x25, 0xb0, 0xad, 0x4f, 0xdc, 0xed, 0x59, 0xff, - 0x5b, 0x60, 0x5b, 0x1f, 0x8a, 0xd6, 0x74, 0x5c, 0x0f, 0x2d, 0x36, 0x31, 0xda, 0xaa, 0xe3, 0x0e, - 0xca, 0xf1, 0x15, 0xc8, 0xf8, 0x5d, 0x77, 0x50, 0x0d, 0x52, 0x2e, 0xff, 0xcd, 0xc5, 0x29, 0x8f, - 0x16, 0xa7, 0x60, 0x0b, 0x8a, 0xd4, 0x63, 0x97, 0xff, 0x27, 0x91, 0xaa, 0x3f, 0x11, 0xbe, 0xaa, - 0x14, 0x89, 0x58, 0x78, 0x6e, 0x81, 0x63, 0xef, 0x82, 0x05, 0xe6, 0x58, 0x01, 0xb1, 0x7e, 0x73, - 0x14, 0x66, 0x77, 0xc4, 0x24, 0xfd, 0xaa, 0x95, 0xc2, 0x0e, 0x24, 0xb1, 0xe9, 0xda, 0x86, 0xb7, - 0xdb, 0xf4, 0xc4, 0xa8, 0xc1, 0x1e, 0xd2, 0x97, 0xaa, 0xe9, 0xda, 0x87, 0xc1, 0xa1, 0x17, 0x58, - 0x01, 0x31, 0xfc, 0x42, 0x0c, 0xe6, 0x47, 0xb1, 0xa2, 0xb3, 0x50, 0xd0, 0x6d, 0x4c, 0x0b, 0xc2, - 0xdf, 0x41, 0xe6, 0x45, 0x31, 0x5f, 0x52, 0x14, 0x20, 0x0e, 0x1a, 0xd1, 0x2a, 0x42, 0x7a, 0x6f, - 0x1e, 0x59, 0xde, 0x47, 0xa0, 0x8b, 0x0a, 0x86, 0x82, 0xf8, 0xb0, 0x62, 0x57, 0x6b, 0x6b, 0xa6, - 0x8e, 0xef, 0x41, 0x13, 0x06, 0x57, 0x00, 0xf1, 0xb5, 0x46, 0x99, 0x61, 0xa2, 0x1b, 0x90, 0x14, - 0xf0, 0xf1, 0x77, 0x01, 0x5e, 0x80, 0xa1, 0x07, 0x20, 0x1b, 0x5c, 0x18, 0xa8, 0x9f, 0x12, 0x57, - 0x32, 0x81, 0x75, 0x61, 0xdc, 0xca, 0x93, 0x38, 0x72, 0xe5, 0xe1, 0xae, 0xe0, 0xcf, 0xc7, 0x60, - 0x46, 0xc1, 0xcd, 0xbf, 0x82, 0x03, 0xf7, 0x35, 0x00, 0x6c, 0x52, 0x13, 0x63, 0x7b, 0x0f, 0x63, - 0x37, 0x68, 0x24, 0xd2, 0x0c, 0x6f, 0xd5, 0x71, 0xdf, 0xaf, 0xd1, 0xfb, 0xd7, 0x51, 0xc8, 0x06, - 0x47, 0xef, 0xaf, 0xc0, 0xca, 0x86, 0x36, 0x7d, 0x93, 0xc6, 0xbe, 0x27, 0x79, 0x64, 0x94, 0x49, - 0x1b, 0xd0, 0xeb, 0x31, 0xb6, 0xec, 0xd3, 0x31, 0x48, 0xf0, 0x53, 0x73, 0x5b, 0x03, 0x3e, 0x6e, - 0x64, 0xdc, 0x17, 0xf1, 0x39, 0xf1, 0x45, 0xfc, 0x50, 0x17, 0xf7, 0x21, 0xc8, 0x93, 0x90, 0x3a, - 0x74, 0x14, 0x2f, 0x72, 0x2e, 0x47, 0xc3, 0x61, 0xff, 0xe0, 0x39, 0x5a, 0x84, 0x0c, 0x21, 0xf3, - 0x6d, 0x36, 0xa1, 0x81, 0x8e, 0x76, 0x50, 0x65, 0x25, 0xe8, 0x71, 0x40, 0xfb, 0x5e, 0xe2, 0x43, - 0xf5, 0x05, 0x41, 0xe8, 0x66, 0xfc, 0x1a, 0x41, 0x7e, 0x3f, 0x00, 0x69, 0x85, 0xca, 0xee, 0x53, - 0xe6, 0x77, 0x53, 0x93, 0x92, 0x55, 0x7a, 0xa7, 0xf2, 0x77, 0x44, 0x98, 0xab, 0xdc, 0x17, 0x6d, - 0xf3, 0xa0, 0x45, 0x3d, 0xde, 0x6c, 0xf8, 0xe3, 0xb7, 0x16, 0x8b, 0x87, 0x5a, 0xa7, 0xbd, 0x22, - 0x0f, 0x81, 0x94, 0x87, 0xe5, 0x02, 0x88, 0x37, 0x1d, 0x0e, 0xdc, 0x57, 0x3e, 0x40, 0xf4, 0xfa, - 0xce, 0xef, 0xfe, 0xc4, 0xf9, 0x33, 0x81, 0x57, 0x1c, 0x78, 0x19, 0x32, 0x36, 0x3c, 0xf2, 0x8f, - 0x45, 0x00, 0xf9, 0x8b, 0x8d, 0x77, 0xf4, 0x7e, 0x03, 0x20, 0xe0, 0xef, 0x47, 0x8e, 0x8e, 0x23, - 0x7c, 0xfe, 0x50, 0x1c, 0x11, 0x98, 0x4c, 0x1f, 0xf2, 0x4d, 0xbb, 0xb8, 0x0f, 0x61, 0xc8, 0xcd, - 0xda, 0xcb, 0x15, 0xcb, 0x08, 0x41, 0x08, 0x26, 0x3a, 0x47, 0xa7, 0xe4, 0xb7, 0x22, 0x70, 0x7a, - 0x40, 0x13, 0xbd, 0x26, 0xeb, 0x80, 0xec, 0x40, 0x25, 0x1d, 0x51, 0xb1, 0xdb, 0x7b, 0x6f, 0x8a, - 0x3d, 0x63, 0x0f, 0x98, 0xf3, 0xf7, 0x68, 0x8d, 0xe2, 0x46, 0xe8, 0x57, 0x23, 0x30, 0x17, 0x6c, - 0x91, 0xd7, 0xb7, 0x3a, 0x64, 0x83, 0x6d, 0xe1, 0xbd, 0xfa, 0xc0, 0x24, 0xbd, 0x0a, 0x76, 0x28, - 0x04, 0x42, 0xfa, 0x22, 0xb4, 0x9e, 0xe5, 0xea, 0x9e, 0x9c, 0x58, 0x4a, 0xa2, 0x61, 0x43, 0xcd, - 0x00, 0x1b, 0xac, 0x6f, 0x8f, 0x42, 0x7c, 0xdb, 0xb2, 0xda, 0xe8, 0x9b, 0x22, 0x30, 0x63, 0x5a, - 0xae, 0x4a, 0xe6, 0x0a, 0x6e, 0xaa, 0x3c, 0x59, 0xc0, 0x2c, 0xe9, 0x8d, 0xe3, 0x49, 0xef, 0x4b, - 0x6f, 0x2d, 0x0e, 0x42, 0x0d, 0xbb, 0x10, 0xbd, 0x60, 0x5a, 0x6e, 0x99, 0x12, 0x35, 0x58, 0x3e, - 0xe1, 0x36, 0xe4, 0xc2, 0xef, 0x67, 0xe6, 0x57, 0x39, 0xf6, 0xfb, 0x73, 0x63, 0xdf, 0x9d, 0xdd, - 0x0d, 0xbc, 0x98, 0x5d, 0x4b, 0xfc, 0x87, 0x64, 0x70, 0x5f, 0x05, 0xe9, 0x46, 0xff, 0xb9, 0xa3, - 0x2a, 0x24, 0xc5, 0x39, 0xa3, 0xc8, 0x84, 0x47, 0x98, 0x82, 0x12, 0xe7, 0xbc, 0xe7, 0x7f, 0x26, - 0x02, 0xe0, 0xa7, 0x66, 0xd0, 0x63, 0x70, 0xaa, 0xbc, 0xb5, 0xb9, 0xaa, 0xd6, 0x1b, 0xa5, 0xc6, - 0x4e, 0x3d, 0xfc, 0x57, 0x34, 0xc4, 0x7d, 0x3e, 0x4e, 0x17, 0xeb, 0xc6, 0x9e, 0x81, 0x9b, 0xe8, - 0x61, 0x98, 0x0b, 0x53, 0x93, 0xa7, 0xea, 0xaa, 0x14, 0x29, 0x66, 0xef, 0xdc, 0x5d, 0x4a, 0x31, - 0x97, 0x14, 0x37, 0xd1, 0x39, 0x38, 0x31, 0x48, 0x57, 0xdb, 0x5c, 0x93, 0xa2, 0xc5, 0xdc, 0x9d, - 0xbb, 0x4b, 0x69, 0xcf, 0x77, 0x45, 0x32, 0xa0, 0x20, 0x25, 0xc7, 0x8b, 0x15, 0xe1, 0xce, 0xdd, - 0xa5, 0x04, 0x1b, 0x96, 0x62, 0xfc, 0x63, 0x3f, 0xbc, 0x30, 0x75, 0xfe, 0xeb, 0x00, 0x6a, 0xe6, - 0x9e, 0xad, 0xd1, 0x3f, 0x25, 0x8f, 0x8a, 0x70, 0xb2, 0xb6, 0x79, 0x55, 0x29, 0x55, 0x1a, 0xb5, - 0xad, 0xcd, 0xbe, 0x3f, 0xfe, 0x11, 0xae, 0x5b, 0xdd, 0xda, 0x29, 0xaf, 0x57, 0xd5, 0x7a, 0x6d, - 0x6d, 0x93, 0xed, 0x01, 0x87, 0xea, 0x5e, 0xde, 0x6c, 0xd4, 0x36, 0xaa, 0x52, 0xb4, 0x7c, 0x75, - 0xe4, 0x1e, 0xc3, 0x63, 0x47, 0x0e, 0xb8, 0x6f, 0x25, 0x43, 0x1b, 0x0d, 0xff, 0x3b, 0x00, 0x00, - 0xff, 0xff, 0xd6, 0xf2, 0x1e, 0x47, 0x50, 0xa0, 0x00, 0x00, + // 12584 bytes of a gzipped FileDescriptorSet + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0xbd, 0x7b, 0x90, 0x64, 0xd7, + 0x59, 0x18, 0x3e, 0xb7, 0xdf, 0xfd, 0x75, 0x4f, 0xf7, 0x9d, 0x33, 0xb3, 0xbb, 0xbd, 0xbd, 0xd2, + 0xce, 0xa8, 0x65, 0x49, 0xab, 0x95, 0x34, 0xab, 0x1d, 0x69, 0x57, 0xda, 0x59, 0xcb, 0xfa, 0xf5, + 0x6b, 0x77, 0x7a, 0x35, 0xd3, 0x3d, 0xba, 0xdd, 0xb3, 0xd2, 0x0a, 0xf0, 0xe5, 0x4e, 0xf7, 0x99, + 0x99, 0xab, 0xed, 0xbe, 0xb7, 0xdd, 0xf7, 0xf6, 0x6a, 0x46, 0xbf, 0x2a, 0x4a, 0x60, 0xc3, 0xcf, + 0xc8, 0x98, 0x9f, 0xf9, 0x41, 0x81, 0xc0, 0x5e, 0x63, 0xc3, 0x0f, 0x30, 0x04, 0x12, 0xb0, 0x1d, + 0x1e, 0x49, 0x85, 0x47, 0x9e, 0xe0, 0x90, 0xc4, 0x50, 0x95, 0x84, 0xa4, 0x0a, 0x25, 0xd8, 0x14, + 0x12, 0xc6, 0x84, 0x97, 0x48, 0x48, 0xb9, 0x52, 0x4e, 0x9d, 0xd7, 0x7d, 0xf4, 0x63, 0xba, 0x67, + 0x2d, 0x13, 0x05, 0xf2, 0xcf, 0xee, 0xdc, 0x73, 0xbe, 0xef, 0x3b, 0xe7, 0x7c, 0xe7, 0x3b, 0xdf, + 0xeb, 0x3c, 0x1a, 0xde, 0xd8, 0x86, 0xa5, 0x5d, 0xd3, 0xdc, 0x6d, 0xe3, 0x73, 0xdd, 0x9e, 0x69, + 0x9b, 0xdb, 0xfd, 0x9d, 0x73, 0x2d, 0x6c, 0x35, 0x7b, 0x7a, 0xd7, 0x36, 0x7b, 0xcb, 0xb4, 0x0c, + 0xa5, 0x19, 0xc4, 0xb2, 0x80, 0xc8, 0x7d, 0x4e, 0x82, 0xb9, 0x2b, 0x7a, 0x1b, 0x97, 0x1c, 0xc8, + 0x3a, 0xb6, 0xd1, 0x93, 0x10, 0xda, 0xd1, 0xdb, 0x38, 0x23, 0x2d, 0x05, 0xcf, 0x24, 0x56, 0xde, + 0xb5, 0x3c, 0x80, 0xb5, 0xec, 0xc7, 0xd8, 0x24, 0xc5, 0x0a, 0xc5, 0x38, 0xfb, 0x7f, 0xc7, 0x5e, + 0xf9, 0xf2, 0xe7, 0xbe, 0x2a, 0xc9, 0xdf, 0x4a, 0xfe, 0xcd, 0x76, 0xd0, 0x4d, 0xf6, 0x8d, 0x1e, + 0x5f, 0x26, 0x78, 0x9e, 0xfe, 0xdc, 0x3a, 0x4f, 0x4a, 0x54, 0x82, 0xa4, 0xba, 0xc5, 0xaa, 0x85, + 0x6d, 0x15, 0xef, 0xdb, 0xd8, 0xb0, 0x74, 0xd3, 0xc8, 0x3e, 0x32, 0x02, 0x6b, 0xa8, 0xb7, 0x65, + 0x01, 0x9e, 0x7b, 0x2d, 0x0c, 0xf3, 0x23, 0xba, 0x86, 0x10, 0x84, 0x0c, 0xad, 0x43, 0x86, 0x23, + 0x9d, 0x89, 0x2b, 0xf4, 0x6f, 0x94, 0x81, 0x68, 0x57, 0x6b, 0xde, 0xd4, 0x76, 0x71, 0x26, 0x40, + 0x8b, 0xc5, 0x27, 0x3a, 0x0d, 0xd0, 0xc2, 0x5d, 0x6c, 0xb4, 0xb0, 0xd1, 0x3c, 0xc8, 0x04, 0x97, + 0x82, 0x67, 0xe2, 0x8a, 0xa7, 0x04, 0x3d, 0x04, 0x73, 0xdd, 0xfe, 0x76, 0x5b, 0x6f, 0xaa, 0x1e, + 0x30, 0x58, 0x0a, 0x9e, 0x09, 0x2b, 0x32, 0xab, 0x28, 0xb9, 0xc0, 0x0f, 0x40, 0xfa, 0x25, 0xac, + 0xdd, 0xf4, 0x82, 0x26, 0x28, 0x68, 0x8a, 0x14, 0x7b, 0x00, 0x8b, 0x90, 0xec, 0x60, 0xcb, 0xd2, + 0x76, 0xb1, 0x6a, 0x1f, 0x74, 0x71, 0x26, 0x44, 0x59, 0xbf, 0x34, 0xc4, 0xfa, 0x41, 0xb6, 0x27, + 0x38, 0x56, 0xe3, 0xa0, 0x8b, 0x51, 0x1e, 0xe2, 0xd8, 0xe8, 0x77, 0x18, 0x85, 0xf0, 0x98, 0xc9, + 0x2b, 0x1b, 0xfd, 0xce, 0x20, 0x95, 0x18, 0x41, 0xe3, 0x24, 0xa2, 0x16, 0xee, 0xdd, 0xd2, 0x9b, + 0x38, 0x13, 0xa1, 0x04, 0x1e, 0x18, 0x22, 0x50, 0x67, 0xf5, 0x83, 0x34, 0x04, 0x1e, 0x2a, 0x42, + 0xdc, 0x99, 0xc2, 0x4c, 0x94, 0x12, 0xb9, 0x6f, 0x84, 0x08, 0xe1, 0x76, 0x6b, 0x90, 0x84, 0x8b, + 0x87, 0x2e, 0x42, 0xd4, 0xec, 0xda, 0xba, 0x69, 0x58, 0x99, 0xd8, 0x92, 0x74, 0x26, 0xb1, 0x72, + 0xd7, 0x48, 0x29, 0xac, 0x31, 0x18, 0x45, 0x00, 0xa3, 0x0a, 0xc8, 0x96, 0xd9, 0xef, 0x35, 0xb1, + 0xda, 0x34, 0x5b, 0x58, 0xd5, 0x8d, 0x1d, 0x33, 0x13, 0xa7, 0x04, 0x16, 0x87, 0x07, 0x42, 0x01, + 0x8b, 0x66, 0x0b, 0x57, 0x8c, 0x1d, 0x53, 0x49, 0x59, 0xbe, 0x6f, 0x74, 0x1c, 0x22, 0xd6, 0x81, + 0x61, 0x6b, 0xfb, 0x99, 0x24, 0x95, 0x10, 0xfe, 0x85, 0x56, 0x20, 0x8a, 0x5b, 0x3a, 0x69, 0x2e, + 0x93, 0x5a, 0x92, 0xce, 0xa4, 0x56, 0x32, 0xc3, 0x3c, 0x66, 0xf5, 0x8a, 0x00, 0xcc, 0xfd, 0x52, + 0x04, 0xd2, 0xd3, 0x88, 0xe5, 0x65, 0x08, 0xef, 0x10, 0xce, 0x64, 0x02, 0x47, 0xe1, 0x1b, 0xc3, + 0xf1, 0x33, 0x3e, 0x72, 0x87, 0x8c, 0xcf, 0x43, 0xc2, 0xc0, 0x96, 0x8d, 0x5b, 0x4c, 0x8a, 0x82, + 0x53, 0xca, 0x21, 0x30, 0xa4, 0x61, 0x31, 0x0c, 0xdd, 0x91, 0x18, 0x3e, 0x0f, 0x69, 0xa7, 0x4b, + 0x6a, 0x4f, 0x33, 0x76, 0x85, 0x3c, 0x9f, 0x9b, 0xd4, 0x93, 0x65, 0x47, 0x1f, 0x28, 0x04, 0x4d, + 0x49, 0x61, 0xdf, 0x37, 0x2a, 0x01, 0x98, 0x06, 0x36, 0x77, 0xd4, 0x16, 0x6e, 0xb6, 0x33, 0xb1, + 0x31, 0x5c, 0xaa, 0x11, 0x90, 0x21, 0x2e, 0x99, 0xac, 0xb4, 0xd9, 0x46, 0x97, 0x5c, 0xf1, 0x8c, + 0x8e, 0x91, 0xae, 0x0d, 0xb6, 0x30, 0x87, 0x24, 0x74, 0x0b, 0x52, 0x3d, 0x4c, 0xd6, 0x0a, 0x6e, + 0xf1, 0x91, 0xc5, 0x69, 0x27, 0x96, 0x27, 0x8e, 0x4c, 0xe1, 0x68, 0x6c, 0x60, 0xb3, 0x3d, 0xef, + 0x27, 0xba, 0x17, 0x9c, 0x02, 0x95, 0x8a, 0x15, 0x50, 0xcd, 0x95, 0x14, 0x85, 0x55, 0xad, 0x83, + 0xb3, 0x2f, 0x43, 0xca, 0xcf, 0x1e, 0xb4, 0x00, 0x61, 0xcb, 0xd6, 0x7a, 0x36, 0x95, 0xc2, 0xb0, + 0xc2, 0x3e, 0x90, 0x0c, 0x41, 0x6c, 0xb4, 0xa8, 0x66, 0x0c, 0x2b, 0xe4, 0x4f, 0xf4, 0x7f, 0xb9, + 0x03, 0x0e, 0xd2, 0x01, 0xdf, 0x3f, 0x3c, 0xa3, 0x3e, 0xca, 0x83, 0xe3, 0xce, 0x3e, 0x01, 0xb3, + 0xbe, 0x01, 0x4c, 0xdb, 0x74, 0xee, 0x37, 0x43, 0x70, 0x6c, 0x24, 0x6d, 0xf4, 0x3c, 0x2c, 0xf4, + 0x0d, 0xdd, 0xb0, 0x71, 0xaf, 0xdb, 0xc3, 0x44, 0x64, 0x59, 0x5b, 0x99, 0x37, 0xa2, 0x63, 0x84, + 0x6e, 0xcb, 0x0b, 0xcd, 0xa8, 0x28, 0xf3, 0xfd, 0xe1, 0x42, 0x74, 0x03, 0x12, 0x44, 0x3e, 0xb4, + 0x9e, 0x46, 0x09, 0xb2, 0xd5, 0xb8, 0x32, 0xdd, 0x90, 0x97, 0x4b, 0x2e, 0x66, 0x21, 0xf8, 0x41, + 0x29, 0xa0, 0x78, 0x69, 0xa1, 0x27, 0x20, 0xb6, 0x83, 0x35, 0xbb, 0xdf, 0xc3, 0x56, 0x66, 0x85, + 0xb2, 0xf2, 0xd4, 0xf0, 0x22, 0x65, 0x00, 0x75, 0x6c, 0x2b, 0x0e, 0x30, 0xea, 0x40, 0xf2, 0x16, + 0xee, 0xe9, 0x3b, 0x7a, 0x93, 0x75, 0x2a, 0x48, 0x95, 0xcf, 0x93, 0x53, 0x76, 0xea, 0xba, 0x07, + 0xb5, 0x6e, 0x6b, 0x36, 0x5e, 0x85, 0xad, 0xea, 0xf5, 0xb2, 0x52, 0xb9, 0x52, 0x29, 0x97, 0x58, + 0x37, 0x7d, 0xe4, 0xb3, 0xdf, 0x27, 0x41, 0xc2, 0x33, 0x12, 0xa2, 0x0e, 0x8d, 0x7e, 0x67, 0x1b, + 0xf7, 0xf8, 0x7c, 0xf1, 0x2f, 0x74, 0x0a, 0xe2, 0x3b, 0xfd, 0x76, 0x9b, 0x09, 0x1d, 0xb3, 0xa5, + 0x31, 0x52, 0x40, 0x04, 0x8e, 0xe8, 0x38, 0xae, 0x46, 0xa8, 0x8e, 0x23, 0x7f, 0xa3, 0x2c, 0xc4, + 0x84, 0x50, 0x66, 0xc2, 0x4b, 0xd2, 0x99, 0x98, 0xe2, 0x7c, 0xb3, 0xba, 0x2e, 0xd6, 0x6c, 0xdc, + 0xca, 0x44, 0x44, 0x1d, 0xfb, 0xbe, 0x16, 0x8a, 0x85, 0xe4, 0x70, 0xee, 0x71, 0x98, 0x1b, 0x1a, + 0x0a, 0x4a, 0x43, 0xa2, 0x54, 0x2e, 0xae, 0xe7, 0x95, 0x7c, 0xa3, 0x52, 0xab, 0xca, 0x33, 0x28, + 0x05, 0x9e, 0xd1, 0xc9, 0xd2, 0xd9, 0x78, 0xec, 0xcd, 0xa8, 0xfc, 0xca, 0x2b, 0xaf, 0xbc, 0x12, + 0xc8, 0xfd, 0x5a, 0x04, 0x16, 0x46, 0x29, 0xc1, 0x91, 0xfa, 0xd8, 0x1d, 0x74, 0xd0, 0x37, 0xe8, + 0x3c, 0x84, 0xdb, 0xda, 0x36, 0x6e, 0x67, 0x42, 0x74, 0x12, 0x1e, 0x9a, 0x4a, 0xcd, 0x2e, 0xaf, + 0x13, 0x14, 0x85, 0x61, 0xa2, 0xf7, 0x70, 0xd6, 0x84, 0x29, 0x85, 0xb3, 0xd3, 0x51, 0x20, 0xca, + 0x91, 0xb3, 0xf1, 0x14, 0xc4, 0xc9, 0xff, 0x8c, 0xef, 0x11, 0xc6, 0x77, 0x52, 0x40, 0xf9, 0x9e, + 0x85, 0x18, 0xd5, 0x7b, 0x2d, 0xec, 0xcc, 0x89, 0xf8, 0x26, 0x9a, 0xa2, 0x85, 0x77, 0xb4, 0x7e, + 0xdb, 0x56, 0x6f, 0x69, 0xed, 0x3e, 0xa6, 0x1a, 0x2c, 0xae, 0x24, 0x79, 0xe1, 0x75, 0x52, 0x86, + 0x16, 0x21, 0xc1, 0xd4, 0xa4, 0x6e, 0xb4, 0xf0, 0x3e, 0x35, 0xa1, 0x61, 0x85, 0x69, 0xce, 0x0a, + 0x29, 0x21, 0xcd, 0xbf, 0x68, 0x99, 0x86, 0xd0, 0x35, 0xb4, 0x09, 0x52, 0x40, 0x9b, 0x7f, 0x62, + 0xd0, 0x7a, 0xdf, 0x3d, 0x7a, 0x78, 0x43, 0xca, 0xf1, 0x01, 0x48, 0x53, 0x88, 0xc7, 0xf8, 0x52, + 0xd6, 0xda, 0x99, 0x39, 0x2a, 0x06, 0x29, 0x56, 0x5c, 0xe3, 0xa5, 0xb9, 0x9f, 0x0f, 0x40, 0x88, + 0x5a, 0x8a, 0x34, 0x24, 0x1a, 0x37, 0x36, 0xcb, 0x6a, 0xa9, 0xb6, 0x55, 0x58, 0x2f, 0xcb, 0x12, + 0x99, 0x7a, 0x5a, 0x70, 0x65, 0xbd, 0x96, 0x6f, 0xc8, 0x01, 0xe7, 0xbb, 0x52, 0x6d, 0x5c, 0x7c, + 0x5c, 0x0e, 0x3a, 0x08, 0x5b, 0xac, 0x20, 0xe4, 0x05, 0x78, 0x6c, 0x45, 0x0e, 0x23, 0x19, 0x92, + 0x8c, 0x40, 0xe5, 0xf9, 0x72, 0xe9, 0xe2, 0xe3, 0x72, 0xc4, 0x5f, 0xf2, 0xd8, 0x8a, 0x1c, 0x45, + 0xb3, 0x10, 0xa7, 0x25, 0x85, 0x5a, 0x6d, 0x5d, 0x8e, 0x39, 0x34, 0xeb, 0x0d, 0xa5, 0x52, 0xbd, + 0x2a, 0xc7, 0x1d, 0x9a, 0x57, 0x95, 0xda, 0xd6, 0xa6, 0x0c, 0x0e, 0x85, 0x8d, 0x72, 0xbd, 0x9e, + 0xbf, 0x5a, 0x96, 0x13, 0x0e, 0x44, 0xe1, 0x46, 0xa3, 0x5c, 0x97, 0x93, 0xbe, 0x6e, 0x3d, 0xb6, + 0x22, 0xcf, 0x3a, 0x4d, 0x94, 0xab, 0x5b, 0x1b, 0x72, 0x0a, 0xcd, 0xc1, 0x2c, 0x6b, 0x42, 0x74, + 0x22, 0x3d, 0x50, 0x74, 0xf1, 0x71, 0x59, 0x76, 0x3b, 0xc2, 0xa8, 0xcc, 0xf9, 0x0a, 0x2e, 0x3e, + 0x2e, 0xa3, 0x5c, 0x11, 0xc2, 0x54, 0x0c, 0x11, 0x82, 0xd4, 0x7a, 0xbe, 0x50, 0x5e, 0x57, 0x6b, + 0x9b, 0x64, 0xd1, 0xe4, 0xd7, 0x65, 0xc9, 0x2d, 0x53, 0xca, 0x9b, 0xe5, 0x7c, 0xa3, 0x5c, 0x92, + 0x83, 0xde, 0xb2, 0x67, 0xb7, 0x2a, 0x4a, 0xb9, 0x24, 0x07, 0x72, 0x4d, 0x58, 0x18, 0x65, 0x21, + 0x47, 0x2e, 0x21, 0x8f, 0x2c, 0x04, 0xc6, 0xc8, 0x02, 0xa5, 0x35, 0x28, 0x0b, 0xb9, 0x2f, 0x06, + 0x60, 0x7e, 0x84, 0x97, 0x30, 0xb2, 0x91, 0xa7, 0x21, 0xcc, 0x64, 0x99, 0x69, 0xea, 0x07, 0x47, + 0xba, 0x1b, 0x54, 0xb2, 0x87, 0x7c, 0x27, 0x8a, 0xe7, 0xf5, 0x37, 0x83, 0x63, 0xfc, 0x4d, 0x42, + 0x62, 0x48, 0x60, 0xbf, 0x69, 0xc8, 0x9a, 0x33, 0x87, 0xe7, 0xe2, 0x34, 0x0e, 0x0f, 0x2d, 0x3b, + 0x9a, 0x55, 0x0f, 0x8f, 0xb0, 0xea, 0x97, 0x61, 0x6e, 0x88, 0xd0, 0xd4, 0xd6, 0xf5, 0xfd, 0x12, + 0x64, 0xc6, 0x31, 0x67, 0x82, 0x4a, 0x0c, 0xf8, 0x54, 0xe2, 0xe5, 0x41, 0x0e, 0xde, 0x33, 0x7e, + 0x12, 0x86, 0xe6, 0xfa, 0x27, 0x24, 0x38, 0x3e, 0x3a, 0xae, 0x18, 0xd9, 0x87, 0xf7, 0x40, 0xa4, + 0x83, 0xed, 0x3d, 0x53, 0xf8, 0xc9, 0xf7, 0x8f, 0xf0, 0xbe, 0x48, 0xf5, 0xe0, 0x64, 0x73, 0x2c, + 0xaf, 0xfb, 0x16, 0x1c, 0x17, 0x1c, 0xb0, 0xde, 0x0c, 0xf5, 0xf4, 0x3b, 0x03, 0x70, 0x6c, 0x24, + 0xf1, 0x91, 0x1d, 0xbd, 0x1b, 0x40, 0x37, 0xba, 0x7d, 0x9b, 0xf9, 0xc2, 0x4c, 0x13, 0xc7, 0x69, + 0x09, 0x55, 0x5e, 0x44, 0xcb, 0xf6, 0x6d, 0xa7, 0x9e, 0x59, 0x49, 0x60, 0x45, 0x14, 0xe0, 0x49, + 0xb7, 0xa3, 0x21, 0xda, 0xd1, 0xd3, 0x63, 0x46, 0x3a, 0x24, 0x98, 0x8f, 0x82, 0xdc, 0x6c, 0xeb, + 0xd8, 0xb0, 0x55, 0xcb, 0xee, 0x61, 0xad, 0xa3, 0x1b, 0xbb, 0xcc, 0xda, 0xae, 0x86, 0x77, 0xb4, + 0xb6, 0x85, 0x95, 0x34, 0xab, 0xae, 0x8b, 0x5a, 0x82, 0x41, 0x05, 0xa8, 0xe7, 0xc1, 0x88, 0xf8, + 0x30, 0x58, 0xb5, 0x83, 0x91, 0xfb, 0x99, 0x38, 0x24, 0x3c, 0x51, 0x18, 0xba, 0x07, 0x92, 0x2f, + 0x6a, 0xb7, 0x34, 0x55, 0x44, 0xd6, 0x8c, 0x13, 0x09, 0x52, 0xb6, 0xc9, 0xa3, 0xeb, 0x47, 0x61, + 0x81, 0x82, 0x98, 0x7d, 0x1b, 0xf7, 0xd4, 0x66, 0x5b, 0xb3, 0x2c, 0xca, 0xb4, 0x18, 0x05, 0x45, + 0xa4, 0xae, 0x46, 0xaa, 0x8a, 0xa2, 0x06, 0x5d, 0x80, 0x79, 0x8a, 0xd1, 0xe9, 0xb7, 0x6d, 0xbd, + 0xdb, 0xc6, 0x34, 0x67, 0x60, 0x51, 0x93, 0xe3, 0xf4, 0x6c, 0x8e, 0x40, 0x6c, 0x70, 0x00, 0xd2, + 0x23, 0x0b, 0x95, 0xe0, 0x6e, 0x8a, 0xb6, 0x8b, 0x0d, 0xdc, 0xd3, 0x6c, 0xac, 0xe2, 0xf7, 0xf5, + 0xb5, 0xb6, 0xa5, 0x6a, 0x46, 0x4b, 0xdd, 0xd3, 0xac, 0xbd, 0xcc, 0x02, 0x21, 0x50, 0x08, 0x64, + 0x24, 0xe5, 0x24, 0x01, 0xbc, 0xca, 0xe1, 0xca, 0x14, 0x2c, 0x6f, 0xb4, 0xd6, 0x34, 0x6b, 0x0f, + 0xad, 0xc2, 0x71, 0x4a, 0xc5, 0xb2, 0x7b, 0xba, 0xb1, 0xab, 0x36, 0xf7, 0x70, 0xf3, 0xa6, 0xda, + 0xb7, 0x77, 0x9e, 0xcc, 0x9c, 0xf2, 0xb6, 0x4f, 0x7b, 0x58, 0xa7, 0x30, 0x45, 0x02, 0xb2, 0x65, + 0xef, 0x3c, 0x89, 0xea, 0x90, 0x24, 0x93, 0xd1, 0xd1, 0x5f, 0xc6, 0xea, 0x8e, 0xd9, 0xa3, 0x36, + 0x34, 0x35, 0x42, 0x35, 0x79, 0x38, 0xb8, 0x5c, 0xe3, 0x08, 0x1b, 0x66, 0x0b, 0xaf, 0x86, 0xeb, + 0x9b, 0xe5, 0x72, 0x49, 0x49, 0x08, 0x2a, 0x57, 0xcc, 0x1e, 0x11, 0xa8, 0x5d, 0xd3, 0x61, 0x70, + 0x82, 0x09, 0xd4, 0xae, 0x29, 0xd8, 0x7b, 0x01, 0xe6, 0x9b, 0x4d, 0x36, 0x66, 0xbd, 0xa9, 0xf2, + 0x88, 0xdc, 0xca, 0xc8, 0x3e, 0x66, 0x35, 0x9b, 0x57, 0x19, 0x00, 0x97, 0x71, 0x0b, 0x5d, 0x82, + 0x63, 0x2e, 0xb3, 0xbc, 0x88, 0x73, 0x43, 0xa3, 0x1c, 0x44, 0xbd, 0x00, 0xf3, 0xdd, 0x83, 0x61, + 0x44, 0xe4, 0x6b, 0xb1, 0x7b, 0x30, 0x88, 0x76, 0x1f, 0xcd, 0xb2, 0xf4, 0x70, 0x93, 0xba, 0x7a, + 0x27, 0xbc, 0xd0, 0x9e, 0x0a, 0xb4, 0x0c, 0x72, 0xb3, 0xa9, 0x62, 0x43, 0xdb, 0x6e, 0x63, 0x55, + 0xeb, 0x61, 0x43, 0xb3, 0x32, 0x8b, 0x14, 0x38, 0x64, 0xf7, 0xfa, 0x58, 0x49, 0x35, 0x9b, 0x65, + 0x5a, 0x99, 0xa7, 0x75, 0xe8, 0x2c, 0xcc, 0x99, 0xdb, 0x2f, 0x36, 0x99, 0x60, 0xa9, 0xdd, 0x1e, + 0xde, 0xd1, 0xf7, 0x33, 0xef, 0xa2, 0x5c, 0x4a, 0x93, 0x0a, 0x2a, 0x56, 0x9b, 0xb4, 0x18, 0x3d, + 0x08, 0x72, 0xd3, 0xda, 0xd3, 0x7a, 0x5d, 0xaa, 0x59, 0xad, 0xae, 0xd6, 0xc4, 0x99, 0xfb, 0x18, + 0x28, 0x2b, 0xaf, 0x8a, 0x62, 0x22, 0xd8, 0xd6, 0x4b, 0xfa, 0x8e, 0x2d, 0x28, 0x3e, 0xc0, 0x04, + 0x9b, 0x96, 0x71, 0x6a, 0x67, 0x40, 0xee, 0xee, 0x75, 0xfd, 0x0d, 0x9f, 0xa1, 0x60, 0xa9, 0xee, + 0x5e, 0xd7, 0xdb, 0xee, 0xbd, 0x30, 0x4b, 0x20, 0xdd, 0x46, 0x1f, 0x64, 0xfe, 0x57, 0x77, 0xcf, + 0xd3, 0xe2, 0xe3, 0x70, 0x9c, 0x00, 0x75, 0xb0, 0xad, 0xb5, 0x34, 0x5b, 0xf3, 0x40, 0x3f, 0x4c, + 0xa1, 0x17, 0xba, 0x7b, 0xdd, 0x0d, 0x5e, 0xe9, 0xeb, 0x67, 0xaf, 0xbf, 0x7d, 0xe0, 0xc8, 0xc7, + 0x23, 0xac, 0x9f, 0xa4, 0x4c, 0x48, 0xc8, 0x1d, 0x87, 0x1f, 0x5f, 0xb7, 0x60, 0x2b, 0xb7, 0x0a, + 0x49, 0xaf, 0xdc, 0xa3, 0x38, 0x30, 0xc9, 0x97, 0x25, 0xe2, 0x04, 0x15, 0x6b, 0x25, 0xe2, 0xbe, + 0xbc, 0x50, 0x96, 0x03, 0xc4, 0x8d, 0x5a, 0xaf, 0x34, 0xca, 0xaa, 0xb2, 0x55, 0x6d, 0x54, 0x36, + 0xca, 0x72, 0xd0, 0xe3, 0xd8, 0x5f, 0x0b, 0xc5, 0xce, 0xca, 0x0f, 0x5d, 0x0b, 0xc5, 0xee, 0x97, + 0x1f, 0xa0, 0xec, 0x19, 0x12, 0xca, 0xdc, 0x5b, 0x41, 0x48, 0xf9, 0xc3, 0x72, 0xf4, 0x6e, 0x38, + 0x21, 0xf2, 0x6e, 0x16, 0xb6, 0xd5, 0x97, 0xf4, 0x1e, 0x5d, 0xac, 0x1d, 0x8d, 0x19, 0x4e, 0x47, + 0x28, 0x17, 0x38, 0x54, 0x1d, 0xdb, 0xcf, 0xe9, 0x3d, 0xb2, 0x14, 0x3b, 0x9a, 0x8d, 0xd6, 0x61, + 0xd1, 0x30, 0x55, 0xcb, 0xd6, 0x8c, 0x96, 0xd6, 0x6b, 0x79, 0x13, 0x99, 0x5a, 0xb3, 0x89, 0x2d, + 0xcb, 0x64, 0x46, 0xd2, 0xa1, 0x72, 0x97, 0x61, 0xd6, 0x39, 0xb0, 0x6b, 0x3d, 0xf2, 0x1c, 0x74, + 0x60, 0x4d, 0x04, 0xc7, 0xad, 0x89, 0x53, 0x10, 0xef, 0x68, 0x5d, 0x15, 0x1b, 0x76, 0xef, 0x80, + 0xfa, 0xee, 0x31, 0x25, 0xd6, 0xd1, 0xba, 0x65, 0xf2, 0x8d, 0xae, 0xc3, 0xfd, 0x2e, 0xa8, 0xda, + 0xc6, 0xbb, 0x5a, 0xf3, 0x40, 0xa5, 0x8e, 0x3a, 0xcd, 0x11, 0xa9, 0x4d, 0xd3, 0xd8, 0x69, 0xeb, + 0x4d, 0xdb, 0xa2, 0xba, 0x83, 0xe9, 0xbf, 0x9c, 0x8b, 0xb1, 0x4e, 0x11, 0xae, 0x59, 0xa6, 0x41, + 0xfd, 0xf3, 0xa2, 0x80, 0xf6, 0x89, 0x4d, 0xf2, 0x1d, 0x21, 0x36, 0xfe, 0xa9, 0x0f, 0xc9, 0xe1, + 0x6b, 0xa1, 0x58, 0x58, 0x8e, 0x5c, 0x0b, 0xc5, 0x22, 0x72, 0xf4, 0x5a, 0x28, 0x16, 0x93, 0xe3, + 0xd7, 0x42, 0xb1, 0xb8, 0x0c, 0xb9, 0xdb, 0xb3, 0x90, 0xf4, 0x86, 0x1b, 0x24, 0x7a, 0x6b, 0x52, + 0x83, 0x2b, 0x51, 0x95, 0x7c, 0xef, 0xa1, 0xc1, 0xc9, 0x72, 0x91, 0x58, 0xe2, 0xd5, 0x08, 0xf3, + 0xed, 0x15, 0x86, 0x49, 0xbc, 0x20, 0xb2, 0xc8, 0x30, 0xf3, 0xa5, 0x62, 0x0a, 0xff, 0x42, 0x57, + 0x21, 0xf2, 0xa2, 0x45, 0x69, 0x47, 0x28, 0xed, 0x77, 0x1d, 0x4e, 0xfb, 0x5a, 0x9d, 0x12, 0x8f, + 0x5f, 0xab, 0xab, 0xd5, 0x9a, 0xb2, 0x91, 0x5f, 0x57, 0x38, 0x3a, 0x3a, 0x09, 0xa1, 0xb6, 0xf6, + 0xf2, 0x81, 0xdf, 0x66, 0xd3, 0x22, 0xb4, 0x0c, 0xe9, 0xbe, 0xc1, 0x62, 0x75, 0x32, 0xc7, 0x04, + 0x2a, 0xed, 0x85, 0x4a, 0xb9, 0xb5, 0xeb, 0x04, 0x7e, 0x4a, 0xb9, 0x3a, 0x09, 0xa1, 0x97, 0xb0, + 0x76, 0xd3, 0x6f, 0x59, 0x69, 0x11, 0x3a, 0x03, 0xc9, 0x16, 0xde, 0xee, 0xef, 0xaa, 0x3d, 0xdc, + 0xd2, 0x9a, 0xb6, 0xdf, 0x9e, 0x24, 0x68, 0x95, 0x42, 0x6b, 0xd0, 0x33, 0x10, 0x27, 0x73, 0x64, + 0xd0, 0x39, 0x9e, 0xa3, 0x2c, 0x78, 0xe4, 0x70, 0x16, 0xf0, 0x29, 0x16, 0x48, 0x8a, 0x8b, 0x8f, + 0xd6, 0x20, 0x6a, 0x6b, 0xbd, 0x5d, 0x6c, 0x5b, 0x99, 0xf9, 0xa5, 0xe0, 0x99, 0xd4, 0x88, 0x1c, + 0xd9, 0x08, 0x52, 0x0d, 0x8a, 0x42, 0x23, 0x65, 0x81, 0x8e, 0x9e, 0x03, 0x99, 0xa7, 0x62, 0x55, + 0x1e, 0xe6, 0x5a, 0x99, 0x05, 0x2a, 0x80, 0x0f, 0x1f, 0x4e, 0x92, 0x67, 0x72, 0x4b, 0x0c, 0x49, + 0x49, 0x63, 0xdf, 0xb7, 0x7f, 0x5d, 0x1c, 0x3b, 0xca, 0xba, 0xd8, 0x82, 0x34, 0xff, 0x5b, 0xb5, + 0xfa, 0xdd, 0xae, 0xd9, 0xb3, 0x33, 0xc7, 0x29, 0xfe, 0x84, 0x0e, 0x09, 0x62, 0x0c, 0x47, 0x49, + 0xed, 0xf8, 0xbe, 0xbf, 0x7e, 0xcb, 0x2d, 0xfb, 0x02, 0xa4, 0xfc, 0xcc, 0xf0, 0x26, 0xc2, 0x83, + 0x53, 0x26, 0xc2, 0x49, 0x58, 0x22, 0x02, 0x35, 0x62, 0x9a, 0xd8, 0x47, 0xf6, 0xfb, 0x03, 0x90, + 0xf2, 0x0f, 0x0c, 0x5d, 0x05, 0x24, 0x66, 0x4c, 0x37, 0xec, 0x9e, 0xd9, 0xea, 0x37, 0x71, 0x8b, + 0x2f, 0xd8, 0xf1, 0xed, 0xcc, 0x71, 0x9c, 0x8a, 0x83, 0xe2, 0x25, 0xe4, 0x59, 0x05, 0x81, 0x29, + 0x09, 0x95, 0xdc, 0xf5, 0x71, 0x0e, 0xe6, 0x05, 0x01, 0x42, 0xec, 0x25, 0xad, 0x67, 0x10, 0x17, + 0x99, 0x39, 0xed, 0xc8, 0x53, 0xf5, 0x1c, 0xab, 0x41, 0x79, 0x10, 0xe2, 0xa2, 0xf6, 0x70, 0xc7, + 0xbc, 0x85, 0x5b, 0x3c, 0x5d, 0x34, 0xbe, 0xd9, 0x14, 0x47, 0x50, 0x18, 0x7c, 0xee, 0x1c, 0x84, + 0xa9, 0xfa, 0x41, 0x00, 0x5c, 0x01, 0xc9, 0x33, 0x28, 0x06, 0xa1, 0x62, 0x4d, 0x21, 0xe6, 0x51, + 0x86, 0x24, 0x2b, 0x55, 0x37, 0x2b, 0xe5, 0x62, 0x59, 0x0e, 0xe4, 0x2e, 0x40, 0x84, 0xe9, 0x14, + 0x62, 0x3a, 0x1d, 0xad, 0x22, 0xcf, 0xf0, 0x4f, 0x4e, 0x43, 0x12, 0xb5, 0x5b, 0x1b, 0x85, 0xb2, + 0x22, 0x07, 0x72, 0x5b, 0x90, 0x1e, 0x58, 0x87, 0xe8, 0x18, 0xcc, 0x29, 0xe5, 0x46, 0xb9, 0xda, + 0xa8, 0xd4, 0xaa, 0xea, 0x56, 0xf5, 0x99, 0x6a, 0xed, 0xb9, 0xaa, 0x3c, 0xe3, 0x2f, 0x16, 0x76, + 0x58, 0x42, 0x0b, 0x20, 0xbb, 0xc5, 0xf5, 0xda, 0x96, 0x42, 0x7b, 0xf3, 0x5d, 0x01, 0x90, 0x07, + 0x17, 0x25, 0x3a, 0x01, 0xf3, 0x8d, 0xbc, 0x72, 0xb5, 0xdc, 0x50, 0x59, 0xc2, 0xc3, 0x21, 0xbd, + 0x00, 0xb2, 0xb7, 0xe2, 0x4a, 0x85, 0xe6, 0x73, 0x16, 0xe1, 0x94, 0xb7, 0xb4, 0xfc, 0x7c, 0xa3, + 0x5c, 0xad, 0xd3, 0xc6, 0xf3, 0xd5, 0xab, 0xc4, 0x29, 0x18, 0xa0, 0x27, 0x52, 0x2c, 0x41, 0xd2, + 0x55, 0x3f, 0xbd, 0xf2, 0x7a, 0x49, 0x0e, 0x0d, 0x16, 0xd7, 0xaa, 0xe5, 0xda, 0x15, 0x39, 0x3c, + 0xd8, 0x3a, 0x4d, 0xbb, 0x44, 0x50, 0x16, 0x8e, 0x0f, 0x96, 0xaa, 0xe5, 0x6a, 0x43, 0xb9, 0x21, + 0x47, 0x07, 0x1b, 0xae, 0x97, 0x95, 0xeb, 0x95, 0x62, 0x59, 0x8e, 0xa1, 0xe3, 0x80, 0xfc, 0x3d, + 0x6a, 0xac, 0xd5, 0x4a, 0x72, 0x7c, 0x94, 0xc5, 0x42, 0xf2, 0x7c, 0xee, 0xa7, 0x25, 0x48, 0x7a, + 0x53, 0x20, 0x3e, 0xa5, 0x22, 0xbd, 0xd3, 0x8c, 0x6d, 0xee, 0xb7, 0x02, 0x90, 0xf0, 0xe4, 0x42, + 0x48, 0x10, 0xab, 0xb5, 0xdb, 0xe6, 0x4b, 0xaa, 0xd6, 0xd6, 0x35, 0x8b, 0xdb, 0x43, 0xa0, 0x45, + 0x79, 0x52, 0x32, 0xad, 0xfd, 0x99, 0xde, 0x75, 0x89, 0xdc, 0xb1, 0xeb, 0x12, 0x7d, 0x07, 0xba, + 0x2e, 0x61, 0x39, 0x92, 0xfb, 0x9d, 0x00, 0xc8, 0x83, 0xd9, 0x91, 0x01, 0xbe, 0x49, 0xe3, 0xf8, + 0xe6, 0x1d, 0x5f, 0xe0, 0x28, 0xe3, 0x1b, 0xb4, 0xea, 0xc1, 0xb1, 0x56, 0x7d, 0x84, 0xb1, 0x0a, + 0xbd, 0x93, 0x8d, 0x95, 0x57, 0x5c, 0xff, 0xad, 0x04, 0x29, 0x7f, 0x32, 0xc7, 0xc7, 0xb1, 0xdc, + 0x51, 0x38, 0xe6, 0x9f, 0x91, 0x7b, 0xc6, 0xcd, 0xc8, 0x5f, 0xcb, 0xb8, 0x7e, 0x30, 0x08, 0xb3, + 0xbe, 0xdc, 0xcf, 0xb4, 0xbd, 0x7b, 0x1f, 0xcc, 0xe9, 0x2d, 0xdc, 0xe9, 0x9a, 0x36, 0x36, 0x9a, + 0x07, 0x6a, 0x1b, 0xdf, 0xc2, 0x6d, 0xca, 0x86, 0xd4, 0x88, 0xdd, 0x55, 0x5f, 0x0b, 0xcb, 0x15, + 0x17, 0x6f, 0x9d, 0xa0, 0xad, 0xce, 0x57, 0x4a, 0xe5, 0x8d, 0xcd, 0x5a, 0xa3, 0x5c, 0x2d, 0xde, + 0x10, 0x9a, 0x5c, 0x91, 0xf5, 0x01, 0x30, 0x1f, 0xc3, 0xef, 0x7d, 0x67, 0x04, 0x9d, 0x9b, 0x20, + 0x0f, 0x8e, 0x86, 0x28, 0xf4, 0x11, 0xe3, 0x91, 0x67, 0xd0, 0x3c, 0xa4, 0xab, 0x35, 0xb5, 0x5e, + 0x29, 0x95, 0xd5, 0xf2, 0x95, 0x2b, 0xe5, 0x62, 0xa3, 0xce, 0x36, 0x1a, 0x1c, 0xe8, 0x86, 0x1c, + 0xf0, 0xce, 0xcd, 0x0f, 0x05, 0x61, 0x7e, 0x44, 0x4f, 0x50, 0x9e, 0xa7, 0x08, 0x59, 0xd6, 0xf2, + 0x91, 0x69, 0x7a, 0xbf, 0x4c, 0xa2, 0xfb, 0x4d, 0xad, 0x67, 0xf3, 0x8c, 0xe2, 0x83, 0x40, 0xd8, + 0x6b, 0xd8, 0xc4, 0xbd, 0xef, 0xf1, 0x0d, 0x1c, 0xe6, 0x82, 0xa4, 0xdd, 0x72, 0xb6, 0x87, 0xf3, + 0x30, 0xa0, 0xae, 0x69, 0xe9, 0xb6, 0x7e, 0x0b, 0x13, 0x1f, 0x8a, 0x03, 0x93, 0x85, 0x1b, 0x52, + 0x64, 0x51, 0x53, 0x31, 0x6c, 0x07, 0xda, 0xc0, 0xbb, 0xda, 0x00, 0x34, 0x09, 0x3f, 0x82, 0x8a, + 0x2c, 0x6a, 0x1c, 0xe8, 0x7b, 0x20, 0xd9, 0x32, 0xfb, 0xdb, 0x6d, 0xcc, 0xe1, 0x88, 0x4a, 0x96, + 0x94, 0x04, 0x2b, 0x73, 0x40, 0x78, 0xda, 0xcc, 0xdd, 0x66, 0x4a, 0x2a, 0x09, 0x56, 0xc6, 0x40, + 0x1e, 0x80, 0xb4, 0xb6, 0xbb, 0xdb, 0x23, 0xc4, 0x05, 0x21, 0x96, 0x08, 0x4c, 0x39, 0xc5, 0x14, + 0x30, 0x7b, 0x0d, 0x62, 0x82, 0x0f, 0x24, 0xfe, 0x25, 0x9c, 0x50, 0xbb, 0x2c, 0xbb, 0x1d, 0x38, + 0x13, 0x57, 0x62, 0x86, 0xa8, 0xbc, 0x07, 0x92, 0xba, 0xe5, 0x1e, 0x21, 0xca, 0x04, 0x96, 0x02, + 0x67, 0x62, 0x4a, 0x42, 0xb7, 0xdc, 0x63, 0x42, 0x3f, 0x93, 0x00, 0x70, 0x85, 0x0d, 0x7d, 0x8f, + 0x04, 0x29, 0x66, 0x60, 0xba, 0x3d, 0x6c, 0x61, 0xa3, 0x29, 0xc2, 0xc2, 0x07, 0x0f, 0x11, 0x51, + 0xa6, 0xe6, 0x36, 0x39, 0x42, 0xe1, 0xe9, 0x0f, 0x4a, 0xd2, 0x6b, 0x52, 0xe8, 0x35, 0x49, 0xfa, + 0x11, 0x69, 0x16, 0xc5, 0xca, 0xcf, 0x6f, 0xae, 0x57, 0x8a, 0x95, 0x46, 0xe6, 0x03, 0x51, 0xfa, + 0x5d, 0xd9, 0xe0, 0xdf, 0x6f, 0x44, 0xfd, 0xf5, 0x6f, 0x46, 0x3f, 0x2d, 0x05, 0x63, 0x6f, 0x46, + 0x95, 0xd9, 0x1d, 0x2f, 0x3d, 0xd4, 0xf6, 0x9e, 0xa0, 0x08, 0x8c, 0x0b, 0x24, 0xdd, 0xde, 0x94, + 0xf9, 0xb9, 0x89, 0xc2, 0x83, 0xb4, 0x23, 0x11, 0xda, 0x91, 0x04, 0x8a, 0x14, 0xd7, 0x6b, 0xf5, + 0x72, 0x89, 0x76, 0x23, 0x8e, 0x42, 0xb5, 0xcd, 0x72, 0x35, 0xf3, 0x86, 0x68, 0xd2, 0x3d, 0x6c, + 0xf1, 0x9a, 0x04, 0x27, 0xc4, 0x2e, 0x2b, 0xb7, 0xb5, 0xd8, 0x68, 0x9a, 0x2d, 0xe1, 0xdd, 0xa6, + 0x56, 0xce, 0x1f, 0xd6, 0xb8, 0xc2, 0x51, 0x29, 0x4b, 0xca, 0x1c, 0xb1, 0xf0, 0xc8, 0x10, 0x4b, + 0xf2, 0xd5, 0x12, 0xef, 0x4b, 0x02, 0x45, 0x36, 0xf3, 0xc5, 0x67, 0xca, 0x25, 0xb7, 0x37, 0xc7, + 0x7a, 0xa3, 0xa8, 0xa0, 0x6f, 0x81, 0x74, 0xdf, 0xde, 0x79, 0x92, 0xc8, 0x86, 0xde, 0x62, 0xdb, + 0xde, 0xa1, 0x71, 0xfb, 0xa5, 0x6e, 0x8f, 0xb6, 0xec, 0x9d, 0x27, 0xaf, 0x3b, 0x18, 0x9c, 0x29, + 0xac, 0x2b, 0x71, 0x14, 0xaa, 0xd6, 0xaa, 0x65, 0xd1, 0x0d, 0xba, 0x45, 0x7c, 0xc3, 0xed, 0x46, + 0xaa, 0xef, 0x43, 0x45, 0xdf, 0x02, 0xb2, 0x48, 0x0f, 0x39, 0x2c, 0x09, 0x8f, 0xdb, 0xf2, 0x75, + 0x3b, 0xc0, 0x93, 0x4c, 0x0e, 0x33, 0xee, 0xf7, 0xf4, 0x60, 0x01, 0xa5, 0xd7, 0xcb, 0xd5, 0xab, + 0x8d, 0x35, 0x75, 0x53, 0x29, 0xd3, 0x9d, 0xbb, 0xcc, 0x07, 0x44, 0xf3, 0xe9, 0x8e, 0x1f, 0x11, + 0x7d, 0x9b, 0x04, 0x09, 0xe6, 0x02, 0xb1, 0x9c, 0x14, 0x4b, 0x2a, 0xdc, 0x7f, 0x58, 0xdb, 0xd4, + 0x03, 0xa2, 0xd0, 0x85, 0x4b, 0xb4, 0xd9, 0xa0, 0x10, 0x88, 0x13, 0x08, 0xad, 0x97, 0xaf, 0xe6, + 0x8b, 0x37, 0xd4, 0x42, 0xb9, 0xde, 0x20, 0x9a, 0xac, 0xa6, 0x30, 0x19, 0x05, 0x14, 0xce, 0xaf, + 0xaf, 0xd7, 0x9e, 0x73, 0x19, 0x01, 0x2f, 0x3a, 0x64, 0x72, 0xdf, 0x08, 0xb3, 0x3e, 0x71, 0x27, + 0x4e, 0x31, 0x75, 0xa6, 0xc9, 0x08, 0xea, 0xe5, 0x6a, 0xd1, 0xeb, 0xc4, 0x27, 0xc1, 0x11, 0x6f, + 0x59, 0x22, 0x5f, 0x42, 0xf8, 0xe5, 0x00, 0x51, 0xa3, 0xbc, 0x03, 0xce, 0x5e, 0x62, 0x30, 0xf7, + 0x04, 0xc4, 0x84, 0xf8, 0x12, 0xd7, 0x9c, 0x7a, 0xd8, 0x03, 0x81, 0x41, 0x0c, 0xa8, 0xec, 0xca, + 0x12, 0x09, 0x83, 0x98, 0x4c, 0xcb, 0x81, 0xdc, 0x75, 0x38, 0x36, 0x52, 0xf4, 0xd0, 0xbd, 0xb0, + 0x28, 0xf6, 0x2f, 0x99, 0xd3, 0xaf, 0x96, 0xab, 0xc5, 0x5a, 0x89, 0x84, 0x49, 0x2e, 0x4d, 0x00, + 0x2e, 0x83, 0xac, 0x97, 0x42, 0x3e, 0xe5, 0x40, 0xae, 0x02, 0x29, 0xbf, 0x00, 0xa1, 0x53, 0x70, + 0x62, 0xab, 0x71, 0xe5, 0x49, 0xf5, 0x7a, 0x7e, 0xbd, 0x52, 0xca, 0x0f, 0x04, 0x44, 0x00, 0x5c, + 0x8a, 0xe4, 0x00, 0xe9, 0x28, 0x91, 0x2e, 0x39, 0x98, 0x0b, 0xc5, 0x24, 0x59, 0xca, 0xd5, 0x21, + 0x3d, 0x20, 0x0a, 0xe8, 0x2e, 0xc8, 0xf0, 0x08, 0x65, 0x54, 0xaf, 0x28, 0x87, 0x7c, 0xc2, 0xc1, + 0x62, 0xb5, 0x52, 0x79, 0xbd, 0xb2, 0x51, 0x69, 0xd0, 0xfe, 0xad, 0x01, 0xb8, 0x73, 0x4c, 0x6c, + 0xd6, 0xb5, 0x7a, 0xad, 0xaa, 0x5e, 0x21, 0x81, 0x5e, 0xc3, 0x43, 0x2a, 0x0e, 0x6c, 0x4e, 0x65, + 0x89, 0xc4, 0x23, 0xc3, 0x13, 0x2f, 0x07, 0xce, 0x7e, 0x48, 0x22, 0x26, 0xeb, 0x43, 0xd5, 0xec, + 0xb7, 0x49, 0xe8, 0xee, 0xd8, 0x9b, 0x51, 0x14, 0x5d, 0xee, 0x6e, 0x2f, 0x37, 0xbb, 0xdd, 0x6c, + 0x9a, 0xfc, 0x51, 0xec, 0x76, 0xaf, 0x08, 0x43, 0xbc, 0x18, 0xfb, 0xc3, 0x28, 0x8a, 0x91, 0xd2, + 0x17, 0xb5, 0x5b, 0x5a, 0x56, 0x26, 0x7f, 0x5d, 0xd3, 0x6e, 0x69, 0x0e, 0xc0, 0xa9, 0xd8, 0x97, + 0xa2, 0x28, 0x42, 0x8a, 0x77, 0xcd, 0x6c, 0x8a, 0xfc, 0x7f, 0xd5, 0x74, 0x2a, 0xef, 0x8d, 0x7d, + 0x47, 0x15, 0x01, 0x29, 0xa4, 0x12, 0x7b, 0x3e, 0x8b, 0xc8, 0xdf, 0x74, 0xdb, 0xec, 0xbc, 0x00, + 0x3a, 0x1b, 0x89, 0x7d, 0xa8, 0x2a, 0x7f, 0xa4, 0x7a, 0x36, 0x12, 0xfb, 0x48, 0x55, 0xfe, 0x9e, + 0xea, 0xb5, 0x48, 0xec, 0x8d, 0xa8, 0xfc, 0x66, 0x34, 0xf7, 0x27, 0x41, 0x40, 0xae, 0x7c, 0x3b, + 0x99, 0x97, 0xe7, 0x21, 0xe6, 0xa4, 0x72, 0xd8, 0x41, 0xd5, 0x77, 0x1f, 0xb2, 0x2c, 0x04, 0x9a, + 0xa7, 0x68, 0x20, 0xb5, 0xe3, 0x50, 0x23, 0x71, 0x7b, 0x47, 0x37, 0xf4, 0x4e, 0xbf, 0xa3, 0x8a, + 0xfc, 0xc6, 0xc4, 0xb8, 0x9d, 0x23, 0xf0, 0x6f, 0x4a, 0x42, 0xdb, 0xf7, 0x91, 0x08, 0x4f, 0x24, + 0xc1, 0x10, 0xf8, 0x77, 0xf6, 0xaf, 0x24, 0xc8, 0x8c, 0xeb, 0xec, 0x1d, 0xa5, 0x5e, 0xaa, 0xb0, + 0x60, 0xde, 0xc2, 0xbd, 0x9e, 0xde, 0xa2, 0xbb, 0x29, 0x8e, 0x43, 0x16, 0x9a, 0xec, 0x90, 0xcd, + 0x7b, 0x10, 0x9d, 0x49, 0x2d, 0x10, 0xbb, 0xb9, 0x4f, 0x4c, 0x86, 0xa0, 0x14, 0x9e, 0x4c, 0x69, + 0x96, 0xa2, 0x08, 0x1a, 0xd7, 0xc8, 0x32, 0x21, 0x31, 0x50, 0x40, 0x0e, 0xba, 0x5e, 0x5f, 0xee, + 0xe3, 0x41, 0x48, 0xf9, 0x0f, 0x67, 0xa2, 0x12, 0xc4, 0xda, 0x26, 0x3f, 0xf8, 0xc4, 0x66, 0xfb, + 0xcc, 0x84, 0xf3, 0x9c, 0xcb, 0xeb, 0x1c, 0x5e, 0x71, 0x30, 0xb3, 0xff, 0x5a, 0x82, 0x98, 0x28, + 0x46, 0xc7, 0x21, 0xd4, 0xd5, 0xec, 0x3d, 0x4a, 0x2e, 0x5c, 0x08, 0xc8, 0x92, 0x42, 0xbf, 0x49, + 0xb9, 0xd5, 0xd5, 0xd8, 0xa1, 0x2f, 0x5e, 0x4e, 0xbe, 0x89, 0xe7, 0xd5, 0xc6, 0x5a, 0x8b, 0xee, + 0x03, 0x9a, 0x9d, 0x0e, 0x36, 0x6c, 0x4b, 0x78, 0x5e, 0xbc, 0xbc, 0xc8, 0x8b, 0xd1, 0x43, 0x30, + 0x67, 0xf7, 0x34, 0xbd, 0xed, 0x83, 0x0d, 0x51, 0x58, 0x59, 0x54, 0x38, 0xc0, 0xab, 0x70, 0x52, + 0xd0, 0x6d, 0x61, 0x5b, 0x6b, 0xee, 0xe1, 0x96, 0x8b, 0x14, 0xa1, 0xfb, 0xfd, 0x27, 0x38, 0x40, + 0x89, 0xd7, 0x0b, 0xdc, 0xb3, 0x7d, 0xdf, 0x79, 0xeb, 0x5d, 0x84, 0xf9, 0x79, 0xeb, 0xf3, 0x63, + 0xce, 0x5b, 0x0f, 0x9e, 0x8d, 0xf5, 0x1c, 0xb6, 0x3e, 0x3b, 0x02, 0xc5, 0xcf, 0x51, 0xd7, 0x85, + 0xfa, 0x7c, 0x00, 0xe6, 0xc4, 0x86, 0x69, 0xcb, 0x99, 0xa3, 0x0d, 0x00, 0xcd, 0x30, 0x4c, 0xdb, + 0x3b, 0x4b, 0xc3, 0x3e, 0xee, 0x10, 0xde, 0x72, 0xde, 0x41, 0x52, 0x3c, 0x04, 0xb2, 0x7f, 0x24, + 0x01, 0xb8, 0x55, 0x63, 0xa7, 0x6b, 0x11, 0x12, 0x7c, 0x54, 0xf4, 0xcc, 0x3a, 0xcb, 0x2b, 0x02, + 0x2b, 0xba, 0xa2, 0xb7, 0xe9, 0x49, 0x88, 0x6d, 0xbc, 0xab, 0x1b, 0xfc, 0x08, 0x17, 0xfb, 0x10, + 0x27, 0x21, 0x42, 0xee, 0x11, 0x47, 0x05, 0x62, 0x16, 0xee, 0x68, 0x86, 0xad, 0x37, 0xf9, 0x62, + 0xbd, 0x78, 0xa4, 0xce, 0x2f, 0xd7, 0x39, 0xb6, 0xe2, 0xd0, 0xc9, 0x9d, 0x81, 0x98, 0x28, 0x75, + 0x8c, 0xc3, 0x0c, 0x8a, 0x42, 0xb0, 0x5e, 0x26, 0xe6, 0x91, 0xea, 0xe8, 0x4a, 0xbe, 0x2e, 0x07, + 0xce, 0xfe, 0x44, 0x00, 0xa2, 0x42, 0x7b, 0xcc, 0x43, 0xba, 0x5c, 0xaa, 0x0c, 0xd8, 0x99, 0x79, + 0x48, 0x89, 0x42, 0xa6, 0xcc, 0xe5, 0x0f, 0x44, 0xbd, 0x85, 0x9b, 0x4a, 0xad, 0x51, 0x5b, 0x91, + 0xff, 0x60, 0xb8, 0xf0, 0x31, 0xf9, 0x8d, 0x28, 0x9a, 0x83, 0xa4, 0x28, 0x5c, 0x79, 0x74, 0xe5, + 0x31, 0xf9, 0xcd, 0xc1, 0xa2, 0xc7, 0xe5, 0x3f, 0xa4, 0x29, 0x2d, 0x51, 0x74, 0x5e, 0x6d, 0x10, + 0x63, 0x51, 0xab, 0xae, 0xdf, 0x90, 0x25, 0x6f, 0xc5, 0x8a, 0xa7, 0x22, 0x80, 0xee, 0x86, 0x13, + 0xa2, 0xe2, 0xd2, 0xa5, 0x4b, 0x97, 0x9e, 0xf0, 0x54, 0xde, 0xfe, 0x70, 0x64, 0xb0, 0xfa, 0x49, + 0x4f, 0xf5, 0xc7, 0x87, 0xab, 0x2f, 0x79, 0xaa, 0x7f, 0xf8, 0xc3, 0x11, 0x34, 0x0f, 0x09, 0x51, + 0xbd, 0x91, 0x7f, 0x5e, 0xfe, 0xea, 0x57, 0xbf, 0xfa, 0xd5, 0x68, 0xe1, 0x5b, 0x60, 0xbe, 0x69, + 0x76, 0x06, 0xa7, 0xa6, 0x20, 0x0f, 0x9c, 0xc7, 0xb0, 0xd6, 0xa4, 0x17, 0x1e, 0xe1, 0x40, 0xbb, + 0x66, 0x5b, 0x33, 0x76, 0x97, 0xcd, 0xde, 0xae, 0x7b, 0x39, 0x82, 0xf8, 0xd6, 0x96, 0xe7, 0x8a, + 0x44, 0x77, 0xfb, 0xaf, 0x24, 0xe9, 0x47, 0x02, 0xc1, 0xab, 0x9b, 0x85, 0x9f, 0x0a, 0x64, 0xaf, + 0x32, 0xc4, 0x4d, 0x31, 0xf1, 0x0a, 0xde, 0x69, 0xe3, 0x26, 0x99, 0x1d, 0xf8, 0xe3, 0x87, 0x60, + 0x61, 0xd7, 0xdc, 0x35, 0x29, 0xa5, 0x73, 0xe4, 0x2f, 0x7e, 0xbb, 0x22, 0xee, 0x94, 0x66, 0x27, + 0x5e, 0xc5, 0x58, 0xad, 0xc2, 0x3c, 0x07, 0x56, 0xa9, 0xab, 0xcf, 0xb6, 0x8c, 0xd1, 0xa1, 0xc7, + 0x8e, 0x32, 0x3f, 0xf7, 0xfb, 0x34, 0x47, 0xa3, 0xcc, 0x71, 0x54, 0x52, 0xc7, 0x76, 0x95, 0x57, + 0x15, 0x38, 0xe6, 0xa3, 0xc7, 0xc2, 0x2c, 0xdc, 0x9b, 0x40, 0xf1, 0x9f, 0x71, 0x8a, 0xf3, 0x1e, + 0x8a, 0x75, 0x8e, 0xba, 0x5a, 0x84, 0xd9, 0xa3, 0xd0, 0xfa, 0xe7, 0x9c, 0x56, 0x12, 0x7b, 0x89, + 0x5c, 0x85, 0x34, 0x25, 0xd2, 0xec, 0x5b, 0xb6, 0xd9, 0xa1, 0x31, 0xec, 0xe1, 0x64, 0xfe, 0xc5, + 0xef, 0x33, 0xad, 0x9a, 0x22, 0x68, 0x45, 0x07, 0x6b, 0x75, 0x15, 0x68, 0xc8, 0xd2, 0xc2, 0xcd, + 0xf6, 0x04, 0x0a, 0xbf, 0xce, 0x3b, 0xe2, 0xc0, 0xaf, 0x5e, 0x87, 0x05, 0xf2, 0x37, 0x0d, 0x31, + 0xbd, 0x3d, 0x99, 0x7c, 0x46, 0x29, 0xf3, 0x5b, 0xef, 0x67, 0x8a, 0x7b, 0xde, 0x21, 0xe0, 0xe9, + 0x93, 0x67, 0x16, 0x77, 0xb1, 0x6d, 0xe3, 0x9e, 0xa5, 0x6a, 0xed, 0x51, 0xdd, 0xf3, 0x1c, 0xf2, + 0xc8, 0xfc, 0xe0, 0x97, 0xfd, 0xb3, 0x78, 0x95, 0x61, 0xe6, 0xdb, 0xed, 0xd5, 0x2d, 0x38, 0x31, + 0x42, 0x2a, 0xa6, 0xa0, 0xf9, 0x43, 0x9c, 0xe6, 0xc2, 0x90, 0x64, 0x10, 0xb2, 0x9b, 0x20, 0xca, + 0x9d, 0xb9, 0x9c, 0x82, 0xe6, 0x47, 0x39, 0x4d, 0xc4, 0x71, 0xc5, 0x94, 0x12, 0x8a, 0xd7, 0x60, + 0xee, 0x16, 0xee, 0x6d, 0x9b, 0x16, 0x3f, 0x58, 0x33, 0x05, 0xb9, 0x8f, 0x71, 0x72, 0x69, 0x8e, + 0x48, 0x4f, 0xda, 0x10, 0x5a, 0x97, 0x20, 0xb6, 0xa3, 0x35, 0xf1, 0x14, 0x24, 0x6e, 0x73, 0x12, + 0x51, 0x02, 0x4f, 0x50, 0xf3, 0x90, 0xdc, 0x35, 0x79, 0x96, 0x61, 0x32, 0xfa, 0xc7, 0x39, 0x7a, + 0x42, 0xe0, 0x70, 0x12, 0x5d, 0xb3, 0xdb, 0x6f, 0x6b, 0xf6, 0x34, 0x3d, 0xf8, 0x61, 0x41, 0x42, + 0xe0, 0x70, 0x12, 0x47, 0x60, 0xeb, 0x27, 0x04, 0x09, 0xcb, 0xc3, 0xcf, 0xa7, 0x21, 0x61, 0x1a, + 0xed, 0x03, 0xd3, 0x98, 0xa6, 0x13, 0x9f, 0xe4, 0x14, 0x80, 0xa3, 0x10, 0x02, 0x97, 0x21, 0x3e, + 0xed, 0x44, 0xfc, 0xd8, 0x97, 0xc5, 0xf2, 0x10, 0x33, 0x70, 0x15, 0xd2, 0x42, 0x41, 0xe9, 0xa6, + 0x31, 0x05, 0x89, 0x1f, 0xe7, 0x24, 0x52, 0x1e, 0x34, 0x3e, 0x0c, 0x1b, 0x5b, 0xf6, 0x2e, 0x9e, + 0x86, 0xc8, 0x4f, 0x88, 0x61, 0x70, 0x14, 0xce, 0xca, 0x6d, 0x6c, 0x34, 0xf7, 0xa6, 0xa3, 0xf0, + 0x29, 0xc1, 0x4a, 0x81, 0x43, 0x48, 0x14, 0x61, 0xb6, 0xa3, 0xf5, 0xac, 0x3d, 0xad, 0x3d, 0xd5, + 0x74, 0xfc, 0x24, 0xa7, 0x91, 0x74, 0x90, 0x38, 0x47, 0xfa, 0xc6, 0x51, 0xc8, 0xfc, 0x94, 0xe0, + 0x88, 0x07, 0x8d, 0x2f, 0x3d, 0xcb, 0xa6, 0x0e, 0xf7, 0x51, 0xa8, 0xfd, 0x1d, 0xb1, 0xf4, 0x18, + 0xee, 0x86, 0x97, 0xe2, 0x65, 0x88, 0x5b, 0xfa, 0xcb, 0x53, 0x91, 0xf9, 0x69, 0x31, 0xd3, 0x14, + 0x81, 0x20, 0xdf, 0x80, 0x93, 0x23, 0xcd, 0xc4, 0x14, 0xc4, 0x7e, 0x86, 0x13, 0x3b, 0x3e, 0xc2, + 0x54, 0x70, 0x95, 0x70, 0x54, 0x92, 0x7f, 0x57, 0xa8, 0x04, 0x3c, 0x40, 0x6b, 0x13, 0x16, 0xfa, + 0x86, 0xa5, 0xed, 0x1c, 0x8d, 0x6b, 0x7f, 0x4f, 0x70, 0x8d, 0xe1, 0xfa, 0xb8, 0xd6, 0x80, 0xe3, + 0x9c, 0xe2, 0xd1, 0xe6, 0xf5, 0x67, 0x85, 0x62, 0x65, 0xd8, 0x5b, 0xfe, 0xd9, 0xfd, 0x06, 0xc8, + 0x3a, 0xec, 0x14, 0xde, 0xb1, 0xa5, 0x76, 0xb4, 0xee, 0x14, 0x94, 0x7f, 0x8e, 0x53, 0x16, 0x1a, + 0xdf, 0x71, 0xaf, 0xad, 0x0d, 0xad, 0x4b, 0x88, 0x3f, 0x0f, 0x19, 0x41, 0xbc, 0x6f, 0xf4, 0x70, + 0xd3, 0xdc, 0x35, 0xf4, 0x97, 0x71, 0x6b, 0x0a, 0xd2, 0x9f, 0x1e, 0x98, 0xaa, 0x2d, 0x0f, 0x3a, + 0xa1, 0x5c, 0x01, 0xd9, 0xf1, 0x55, 0x54, 0xbd, 0x43, 0x37, 0x63, 0x0e, 0xa7, 0xf8, 0x19, 0x31, + 0x53, 0x0e, 0x5e, 0x85, 0xa2, 0xad, 0x96, 0x81, 0x1d, 0xcd, 0x9f, 0x56, 0x24, 0x3f, 0xcb, 0x09, + 0xcd, 0xba, 0x58, 0x5c, 0x71, 0x34, 0xcd, 0x4e, 0x57, 0xeb, 0x4d, 0xa3, 0xff, 0xfe, 0xbe, 0x50, + 0x1c, 0x1c, 0x85, 0x2b, 0x0e, 0xe2, 0xd1, 0x11, 0x6b, 0x3f, 0x05, 0x85, 0x9f, 0x17, 0x8a, 0x43, + 0xe0, 0x70, 0x12, 0xc2, 0x61, 0x98, 0x82, 0xc4, 0x2f, 0x08, 0x12, 0x02, 0x87, 0x90, 0x78, 0xd6, + 0x35, 0xb4, 0x3d, 0xbc, 0xab, 0x5b, 0x36, 0xbf, 0x3c, 0x73, 0x38, 0xa9, 0x5f, 0xfc, 0xb2, 0xdf, + 0x09, 0x53, 0x3c, 0xa8, 0x44, 0x13, 0xf1, 0xac, 0x20, 0xcd, 0x7a, 0x4f, 0xee, 0xd8, 0x2f, 0x09, + 0x4d, 0xe4, 0x41, 0x23, 0x7d, 0xf3, 0x78, 0x88, 0x84, 0xed, 0x4d, 0x12, 0x49, 0x4e, 0x41, 0xee, + 0x1f, 0x0c, 0x74, 0xae, 0x2e, 0x70, 0x09, 0x4d, 0x8f, 0xff, 0xd3, 0x37, 0x6e, 0xe2, 0x83, 0xa9, + 0xa4, 0xf3, 0x1f, 0x0e, 0xf8, 0x3f, 0x5b, 0x0c, 0x93, 0xe9, 0x90, 0xf4, 0x80, 0x3f, 0x85, 0x26, + 0xdd, 0xac, 0xcb, 0x7c, 0xeb, 0x5b, 0x7c, 0xbc, 0x7e, 0x77, 0x6a, 0x75, 0x9d, 0x08, 0xb9, 0xdf, + 0xe9, 0x99, 0x4c, 0xec, 0xfd, 0x6f, 0x39, 0x72, 0xee, 0xf3, 0x79, 0x56, 0xaf, 0xc0, 0xac, 0xcf, + 0xe1, 0x99, 0x4c, 0xea, 0x03, 0x9c, 0x54, 0xd2, 0xeb, 0xef, 0xac, 0x5e, 0x80, 0x10, 0x71, 0x5e, + 0x26, 0xa3, 0x7f, 0x3b, 0x47, 0xa7, 0xe0, 0xab, 0x4f, 0x41, 0x4c, 0x38, 0x2d, 0x93, 0x51, 0xbf, + 0x83, 0xa3, 0x3a, 0x28, 0x04, 0x5d, 0x38, 0x2c, 0x93, 0xd1, 0xff, 0x1f, 0x81, 0x2e, 0x50, 0x08, + 0xfa, 0xf4, 0x2c, 0xfc, 0xd5, 0x0f, 0x85, 0xb8, 0xd1, 0x11, 0xbc, 0xbb, 0x0c, 0x51, 0xee, 0xa9, + 0x4c, 0xc6, 0xfe, 0x4e, 0xde, 0xb8, 0xc0, 0x58, 0x7d, 0x02, 0xc2, 0x53, 0x32, 0xfc, 0xc3, 0x1c, + 0x95, 0xc1, 0xaf, 0x16, 0x21, 0xe1, 0xf1, 0x4e, 0x26, 0xa3, 0x7f, 0x37, 0x47, 0xf7, 0x62, 0x91, + 0xae, 0x73, 0xef, 0x64, 0x32, 0x81, 0xff, 0x57, 0x74, 0x9d, 0x63, 0x10, 0xb6, 0x09, 0xc7, 0x64, + 0x32, 0xf6, 0x47, 0x04, 0xd7, 0x05, 0xca, 0xea, 0xd3, 0x10, 0x77, 0x8c, 0xcd, 0x64, 0xfc, 0xef, + 0xe1, 0xf8, 0x2e, 0x0e, 0xe1, 0x80, 0xc7, 0xd8, 0x4d, 0x26, 0xf1, 0xff, 0x09, 0x0e, 0x78, 0xb0, + 0xc8, 0x32, 0x1a, 0x74, 0x60, 0x26, 0x53, 0xfa, 0x5e, 0xb1, 0x8c, 0x06, 0xfc, 0x17, 0x32, 0x9b, + 0x54, 0xe7, 0x4f, 0x26, 0xf1, 0x7d, 0x62, 0x36, 0x29, 0x3c, 0xe9, 0xc6, 0xa0, 0x47, 0x30, 0x99, + 0xc6, 0x0f, 0x88, 0x6e, 0x0c, 0x38, 0x04, 0xab, 0x9b, 0x80, 0x86, 0xbd, 0x81, 0xc9, 0xf4, 0x5e, + 0xe3, 0xf4, 0xe6, 0x86, 0x9c, 0x81, 0xd5, 0xe7, 0xe0, 0xf8, 0x68, 0x4f, 0x60, 0x32, 0xd5, 0x1f, + 0x7c, 0x6b, 0x20, 0x76, 0xf3, 0x3a, 0x02, 0xab, 0x0d, 0xd7, 0xa4, 0x78, 0xbd, 0x80, 0xc9, 0x64, + 0x7f, 0xe8, 0x2d, 0xbf, 0xe2, 0xf6, 0x3a, 0x01, 0xab, 0x79, 0x00, 0xd7, 0x00, 0x4f, 0xa6, 0xf5, + 0x31, 0x4e, 0xcb, 0x83, 0x44, 0x96, 0x06, 0xb7, 0xbf, 0x93, 0xf1, 0x6f, 0x8b, 0xa5, 0xc1, 0x31, + 0xc8, 0xd2, 0x10, 0xa6, 0x77, 0x32, 0xf6, 0xc7, 0xc5, 0xd2, 0x10, 0x28, 0x44, 0xb2, 0x3d, 0xd6, + 0x6d, 0x32, 0x85, 0x4f, 0x0a, 0xc9, 0xf6, 0x60, 0xad, 0x56, 0x61, 0x6e, 0xc8, 0x20, 0x4e, 0x26, + 0xf5, 0x23, 0x9c, 0x94, 0x3c, 0x68, 0x0f, 0xbd, 0xc6, 0x8b, 0x1b, 0xc3, 0xc9, 0xd4, 0x7e, 0x74, + 0xc0, 0x78, 0x71, 0x5b, 0xb8, 0x7a, 0x19, 0x62, 0x46, 0xbf, 0xdd, 0x26, 0x8b, 0x07, 0x1d, 0x7e, + 0x79, 0x32, 0xf3, 0x87, 0x5f, 0xe1, 0xdc, 0x11, 0x08, 0xab, 0x17, 0x20, 0x8c, 0x3b, 0xdb, 0xb8, + 0x35, 0x09, 0xf3, 0x4b, 0x5f, 0x11, 0x0a, 0x93, 0x40, 0xaf, 0x3e, 0x0d, 0xc0, 0x52, 0x23, 0xf4, + 0x00, 0xf2, 0x04, 0xdc, 0x3f, 0xfa, 0x0a, 0xbf, 0xad, 0xe4, 0xa2, 0xb8, 0x04, 0xd8, 0xdd, 0xa7, + 0xc3, 0x09, 0x7c, 0xd9, 0x4f, 0x80, 0xce, 0xc8, 0x25, 0x88, 0xbe, 0x68, 0x99, 0x86, 0xad, 0xed, + 0x4e, 0xc2, 0xfe, 0x63, 0x8e, 0x2d, 0xe0, 0x09, 0xc3, 0x3a, 0x66, 0x0f, 0xdb, 0xda, 0xae, 0x35, + 0x09, 0xf7, 0xbf, 0x70, 0x5c, 0x07, 0x81, 0x20, 0x37, 0x35, 0xcb, 0x9e, 0x66, 0xdc, 0x7f, 0x22, + 0x90, 0x05, 0x02, 0xe9, 0x34, 0xf9, 0xfb, 0x26, 0x3e, 0x98, 0x84, 0xfb, 0xa7, 0xa2, 0xd3, 0x1c, + 0x7e, 0xf5, 0x29, 0x88, 0x93, 0x3f, 0xd9, 0x15, 0xc4, 0x09, 0xc8, 0x7f, 0xc6, 0x91, 0x5d, 0x0c, + 0xd2, 0xb2, 0x65, 0xb7, 0x6c, 0x7d, 0x32, 0xb3, 0xff, 0x9c, 0xcf, 0xb4, 0x80, 0x5f, 0xcd, 0x43, + 0xc2, 0xb2, 0x5b, 0xad, 0x3e, 0xf7, 0x4f, 0x27, 0xa0, 0xff, 0xc5, 0x57, 0x9c, 0x94, 0x85, 0x83, + 0x43, 0x66, 0xfb, 0xa5, 0x9b, 0x76, 0xd7, 0xa4, 0x47, 0x56, 0x26, 0x51, 0x78, 0x8b, 0x53, 0xf0, + 0xa0, 0xac, 0x16, 0x21, 0x49, 0xc6, 0x22, 0x76, 0xfe, 0x27, 0x91, 0xf8, 0x4b, 0xce, 0x00, 0x1f, + 0x52, 0xe1, 0x9b, 0x7f, 0xfd, 0x0b, 0xa7, 0xa5, 0xcf, 0x7f, 0xe1, 0xb4, 0xf4, 0x9f, 0xbf, 0x70, + 0x5a, 0xfa, 0xc8, 0x17, 0x4f, 0xcf, 0x7c, 0xfe, 0x8b, 0xa7, 0x67, 0x7e, 0xe7, 0x8b, 0xa7, 0x67, + 0x46, 0x67, 0x89, 0xe1, 0xaa, 0x79, 0xd5, 0x64, 0xf9, 0xe1, 0x17, 0xee, 0xdb, 0xd5, 0xed, 0xbd, + 0xfe, 0xf6, 0x72, 0xd3, 0xec, 0x9c, 0x6b, 0x9a, 0x56, 0xc7, 0xb4, 0xce, 0xf9, 0xf3, 0xba, 0xf4, + 0x2f, 0xf8, 0x1f, 0x12, 0x89, 0x99, 0xfd, 0xe9, 0x5c, 0xcd, 0x38, 0x18, 0xf7, 0xa4, 0xce, 0x45, + 0x08, 0xe6, 0x8d, 0x03, 0x74, 0x92, 0x29, 0x38, 0xb5, 0xdf, 0x6b, 0xf3, 0x7b, 0x70, 0x51, 0xf2, + 0xbd, 0xd5, 0x6b, 0xfb, 0xcf, 0x40, 0x27, 0xf9, 0x19, 0xe8, 0xc2, 0x77, 0x4b, 0x47, 0x1b, 0x49, + 0x2c, 0x6f, 0x1c, 0xd0, 0x81, 0x6c, 0x4a, 0x2f, 0x3c, 0x3c, 0x31, 0xcf, 0x7d, 0xd3, 0x30, 0x5f, + 0x32, 0x48, 0xb7, 0xbb, 0xdb, 0x22, 0xc7, 0x7d, 0x7a, 0x30, 0xc7, 0xfd, 0x1c, 0x6e, 0xb7, 0x9f, + 0x21, 0x70, 0x0d, 0x82, 0xb2, 0x1d, 0x61, 0x57, 0xae, 0xe1, 0x7b, 0x03, 0x70, 0x7a, 0x28, 0x9d, + 0xcd, 0x85, 0x60, 0x1c, 0x13, 0x56, 0x21, 0x56, 0x12, 0xb2, 0x95, 0x81, 0xa8, 0x85, 0x9b, 0xa6, + 0xd1, 0x62, 0x87, 0x59, 0x83, 0x8a, 0xf8, 0x24, 0x8c, 0x30, 0x34, 0xc3, 0xb4, 0xf8, 0x4d, 0x52, + 0xf6, 0x51, 0xf8, 0xe8, 0x11, 0x19, 0x31, 0x2b, 0x5a, 0x12, 0xdc, 0x38, 0x3f, 0x25, 0x37, 0xc4, + 0x20, 0x7c, 0x99, 0xff, 0x69, 0xb9, 0xf2, 0x03, 0x01, 0x58, 0x1c, 0xe4, 0x0a, 0x59, 0x59, 0x96, + 0xad, 0x75, 0xba, 0xe3, 0xd8, 0x72, 0x19, 0xe2, 0x0d, 0x01, 0x73, 0x64, 0xbe, 0xdc, 0x3e, 0x22, + 0x5f, 0x52, 0x4e, 0x53, 0x82, 0x31, 0x2b, 0x53, 0x32, 0xc6, 0x19, 0xc7, 0x1d, 0x71, 0xe6, 0xa3, + 0x71, 0x38, 0xc9, 0x96, 0x93, 0xca, 0x96, 0x12, 0xfb, 0xe0, 0x3c, 0x49, 0x7a, 0xab, 0x26, 0xef, + 0x93, 0xe4, 0x9e, 0x81, 0xf9, 0x0a, 0xd1, 0x16, 0x24, 0x0a, 0x72, 0x77, 0x78, 0x46, 0x5e, 0xb6, + 0x5d, 0xf2, 0x39, 0xfc, 0x7c, 0x27, 0xd0, 0x5b, 0x94, 0xfb, 0x56, 0x09, 0xe4, 0x7a, 0x53, 0x6b, + 0x6b, 0xbd, 0xaf, 0x95, 0x14, 0x7a, 0x02, 0x80, 0x1d, 0x95, 0x72, 0x9e, 0xc9, 0x49, 0xad, 0x64, + 0x96, 0xbd, 0x83, 0x5b, 0x66, 0x2d, 0xd1, 0x8b, 0x28, 0x71, 0x0a, 0x4b, 0xfe, 0x3c, 0xfb, 0x3c, + 0x80, 0x5b, 0x81, 0x4e, 0xc1, 0x89, 0x7a, 0x31, 0xbf, 0x9e, 0x57, 0xc4, 0x99, 0x97, 0xfa, 0x66, + 0xb9, 0xc8, 0x5e, 0xad, 0x98, 0x41, 0xc7, 0x01, 0x79, 0x2b, 0x9d, 0xc3, 0xfb, 0xc7, 0x60, 0xce, + 0x5b, 0xce, 0x9e, 0x10, 0x08, 0xac, 0xae, 0x41, 0x9a, 0xdd, 0x6f, 0x56, 0xb5, 0x56, 0x0b, 0xb7, + 0x54, 0xdd, 0x40, 0x13, 0xae, 0x0b, 0x67, 0x7e, 0xe3, 0xdf, 0x85, 0xe9, 0xd0, 0x66, 0x19, 0x62, + 0x9e, 0xe0, 0x55, 0x0c, 0xe2, 0x73, 0xea, 0x9d, 0x6e, 0x1b, 0xd3, 0x4d, 0x66, 0x55, 0x17, 0xfc, + 0x9f, 0xec, 0xce, 0x10, 0x7a, 0xc1, 0x33, 0x71, 0x65, 0xde, 0x45, 0x77, 0x66, 0x6f, 0xf5, 0x19, + 0xf7, 0x30, 0x95, 0xd3, 0xc1, 0x89, 0x14, 0x3f, 0xc7, 0x7b, 0x28, 0xb2, 0x19, 0xa2, 0x8b, 0xeb, + 0x30, 0xa7, 0x35, 0x9b, 0xb8, 0xeb, 0xeb, 0xdf, 0x04, 0x0b, 0x22, 0x46, 0x2b, 0x73, 0x4c, 0xb7, + 0x6b, 0x4f, 0x40, 0xc4, 0xa2, 0x93, 0x32, 0x89, 0x84, 0xe8, 0x0e, 0x07, 0x5f, 0x2d, 0x8b, 0xc3, + 0x83, 0xce, 0x88, 0x26, 0x10, 0xf8, 0x97, 0x9c, 0x40, 0x92, 0xa2, 0x89, 0xd1, 0x18, 0x30, 0xc7, + 0xde, 0x88, 0xc1, 0x9e, 0xd1, 0x1c, 0x9e, 0x45, 0xf9, 0x47, 0x9f, 0x79, 0x94, 0xee, 0xb0, 0xdf, + 0xe3, 0x17, 0xba, 0x11, 0x8b, 0x45, 0x91, 0x39, 0x6d, 0x77, 0xbc, 0x18, 0x52, 0xa2, 0x3d, 0x3e, + 0xee, 0xc3, 0x1b, 0xfb, 0x65, 0xde, 0xd8, 0xe9, 0x51, 0x12, 0xee, 0x69, 0x69, 0x96, 0x53, 0x65, + 0x15, 0xab, 0x05, 0x98, 0xa5, 0x2f, 0xbc, 0x39, 0xcc, 0x39, 0xbc, 0x95, 0x5f, 0xf9, 0xcc, 0xa3, + 0x6c, 0xa1, 0x11, 0x24, 0xce, 0x9a, 0x42, 0x79, 0x9c, 0xd6, 0x7b, 0xe1, 0xa1, 0x61, 0xfb, 0xcd, + 0xfe, 0x7b, 0x84, 0x52, 0xbf, 0xec, 0xed, 0xaa, 0xab, 0x9d, 0x42, 0x30, 0xa7, 0x75, 0x74, 0xc3, + 0x3c, 0x47, 0xff, 0xe5, 0x5a, 0x29, 0x4c, 0x3f, 0xa6, 0xd8, 0xb6, 0xbd, 0xc8, 0x94, 0xc5, 0x64, + 0xb9, 0xfd, 0xb3, 0xef, 0xfa, 0xf1, 0xb0, 0xab, 0x50, 0x56, 0x37, 0x86, 0x0f, 0x12, 0x4e, 0xa6, + 0xf1, 0xe7, 0x82, 0xc6, 0xe0, 0xb9, 0xc0, 0xd5, 0x77, 0x43, 0xcc, 0x21, 0x33, 0xc9, 0x77, 0x13, + 0x44, 0x1c, 0x0c, 0xe2, 0xb9, 0x31, 0xa1, 0x9d, 0xc6, 0x4f, 0x7f, 0x4b, 0xe0, 0x33, 0x1d, 0x56, + 0x25, 0xa3, 0xb9, 0x0a, 0xa9, 0x96, 0x69, 0xd8, 0xaa, 0xd9, 0xd1, 0x6d, 0xdc, 0xe9, 0xda, 0x13, + 0x3d, 0xdf, 0xbf, 0x64, 0x44, 0x62, 0xca, 0x2c, 0xc1, 0xab, 0x09, 0x34, 0xd2, 0x13, 0xf6, 0xcc, + 0xcc, 0x34, 0x3d, 0xf9, 0xaf, 0x4e, 0x4f, 0x28, 0x0e, 0xe9, 0xc9, 0x1d, 0x49, 0x87, 0xd5, 0xba, + 0xc9, 0xcd, 0x9d, 0xbd, 0xcf, 0xa4, 0xc0, 0x91, 0x8e, 0x7f, 0x12, 0x82, 0xd3, 0x1c, 0x78, 0x5b, + 0xb3, 0xf0, 0xb9, 0x5b, 0xe7, 0xb7, 0xb1, 0xad, 0x9d, 0x3f, 0xd7, 0x34, 0x75, 0xe1, 0xeb, 0xcc, + 0x73, 0x73, 0x46, 0xea, 0x97, 0x79, 0x7d, 0x76, 0xe4, 0x81, 0x80, 0xec, 0x78, 0x33, 0x98, 0x1d, + 0x96, 0xc1, 0x5c, 0x1b, 0x42, 0x45, 0x53, 0xa7, 0x57, 0xe4, 0x5a, 0xd8, 0x30, 0x3b, 0xdc, 0x20, + 0xb1, 0x0f, 0xb4, 0x06, 0x11, 0xad, 0x63, 0xf6, 0x0d, 0x9b, 0x19, 0xa3, 0xc2, 0xa3, 0xbf, 0xfe, + 0xfa, 0xe2, 0xcc, 0x7f, 0x7c, 0x7d, 0xf1, 0x18, 0x23, 0x6b, 0xb5, 0x6e, 0x2e, 0xeb, 0xe6, 0xb9, + 0x8e, 0x66, 0xef, 0x11, 0x15, 0xf0, 0xdb, 0x9f, 0x7d, 0x04, 0x78, 0x7b, 0x15, 0xc3, 0xfe, 0xd4, + 0x1b, 0x3f, 0x7b, 0x56, 0x52, 0x38, 0xfe, 0x6a, 0xe8, 0xcd, 0x4f, 0x2c, 0x4a, 0xb9, 0x2e, 0x44, + 0x4b, 0xb8, 0x79, 0x48, 0x83, 0x95, 0x81, 0x06, 0xcf, 0xf3, 0x06, 0x4f, 0x0d, 0x37, 0xc8, 0xae, + 0xde, 0x94, 0x70, 0xd3, 0xd3, 0x6c, 0x09, 0x37, 0x07, 0x5a, 0xac, 0x40, 0xac, 0x62, 0xd8, 0xec, + 0xad, 0x8c, 0xa7, 0x20, 0xa8, 0x1b, 0xec, 0x8a, 0x75, 0xbc, 0xf0, 0xd0, 0x11, 0x86, 0xa2, 0x10, + 0xbc, 0x5c, 0x0d, 0x62, 0x25, 0xdc, 0x64, 0xa4, 0x8a, 0x10, 0x6c, 0xe1, 0x26, 0x27, 0x75, 0x07, + 0x9d, 0x24, 0xd8, 0x85, 0xd2, 0xef, 0xfc, 0xde, 0xe9, 0x99, 0x57, 0xbe, 0x70, 0x7a, 0x66, 0xac, + 0x38, 0xe5, 0x26, 0x8b, 0x93, 0x23, 0x45, 0x3f, 0x1e, 0x82, 0xbb, 0xe9, 0x63, 0x4b, 0xbd, 0x8e, + 0x6e, 0xd8, 0xe7, 0x9a, 0xbd, 0x83, 0xae, 0x6d, 0x12, 0xa5, 0x62, 0xee, 0x70, 0x21, 0x9a, 0x73, + 0xab, 0x97, 0x59, 0xf5, 0x68, 0x11, 0xca, 0xed, 0x40, 0x78, 0x93, 0xe0, 0x91, 0x49, 0xb2, 0x4d, + 0x5b, 0x6b, 0x73, 0x5f, 0x91, 0x7d, 0x90, 0x52, 0xf6, 0x40, 0x53, 0x80, 0x95, 0xea, 0xe2, 0x6d, + 0xa6, 0x36, 0xd6, 0x76, 0xd8, 0x3b, 0x17, 0x41, 0x1a, 0x64, 0xc4, 0x48, 0x01, 0x7d, 0xd2, 0x62, + 0x01, 0xc2, 0x5a, 0x9f, 0x9d, 0x47, 0x0b, 0x92, 0xe8, 0x83, 0x7e, 0xe4, 0x9e, 0x81, 0x28, 0x3f, + 0xf5, 0x80, 0x64, 0x08, 0xde, 0xc4, 0x07, 0xb4, 0x9d, 0xa4, 0x42, 0xfe, 0x44, 0xcb, 0x10, 0xa6, + 0x9d, 0xe7, 0xd7, 0x8b, 0x32, 0xcb, 0x43, 0xbd, 0x5f, 0xa6, 0x9d, 0x54, 0x18, 0x58, 0xee, 0x1a, + 0xc4, 0x4a, 0x26, 0x91, 0x6c, 0x3f, 0xb5, 0x38, 0xa3, 0x46, 0xfb, 0xdc, 0xed, 0xdb, 0xe2, 0x0a, + 0x28, 0xfd, 0x40, 0xc7, 0x21, 0xc2, 0xde, 0x3d, 0xe1, 0x67, 0xea, 0xf8, 0x57, 0xae, 0x08, 0x51, + 0x4a, 0xbb, 0xd6, 0x75, 0x1e, 0x13, 0x93, 0x3c, 0x8f, 0x89, 0x71, 0xf2, 0x01, 0xb7, 0xb3, 0x08, + 0x42, 0x2d, 0xcd, 0xd6, 0xf8, 0xb8, 0xe9, 0xdf, 0xb9, 0xf7, 0x40, 0x8c, 0x13, 0xb1, 0xd0, 0x0a, + 0x04, 0xcd, 0xae, 0x38, 0x32, 0x9a, 0x1d, 0x37, 0x94, 0x5a, 0xb7, 0x10, 0x22, 0xb2, 0xa4, 0x10, + 0xe0, 0x42, 0x75, 0xac, 0x58, 0x3c, 0xee, 0x13, 0x8b, 0x0e, 0xb6, 0xb7, 0x77, 0x6c, 0xf7, 0x0f, + 0x36, 0x9d, 0x43, 0xa2, 0xe0, 0x08, 0xca, 0xed, 0x00, 0x9c, 0xf6, 0xd4, 0xde, 0xc2, 0x3d, 0x4b, + 0x37, 0x0d, 0x26, 0x4d, 0x5c, 0x52, 0x90, 0xa7, 0x83, 0xbc, 0x7e, 0x8c, 0xa8, 0x3c, 0x05, 0xc1, + 0x7c, 0xb7, 0x8b, 0xb2, 0x10, 0xa3, 0xdf, 0x4d, 0x93, 0xc9, 0x4a, 0x48, 0x71, 0xbe, 0x49, 0x9d, + 0x65, 0xee, 0xd8, 0x2f, 0x69, 0x3d, 0xe7, 0x59, 0x30, 0xf1, 0x9d, 0xbb, 0x04, 0xf1, 0xa2, 0x69, + 0x58, 0xd8, 0xb0, 0xfa, 0x34, 0x02, 0xd9, 0x6e, 0x9b, 0xcd, 0x9b, 0x9c, 0x02, 0xfb, 0x20, 0xcc, + 0xd6, 0xba, 0x5d, 0x8a, 0x19, 0x52, 0xc8, 0x9f, 0x6c, 0x65, 0x17, 0x6a, 0x63, 0xd9, 0x73, 0xe1, + 0x68, 0xec, 0xe1, 0x03, 0x74, 0xf8, 0xf3, 0xdf, 0x25, 0xb8, 0x6b, 0x78, 0x21, 0xdd, 0xc4, 0x07, + 0xd6, 0x51, 0xd7, 0xd1, 0xf3, 0x10, 0xdf, 0xa4, 0x8f, 0xb3, 0x3e, 0x83, 0x0f, 0x50, 0x16, 0xa2, + 0xb8, 0xb5, 0x72, 0xe1, 0xc2, 0xf9, 0x4b, 0x4c, 0xca, 0xd7, 0x66, 0x14, 0x51, 0x80, 0x4e, 0x43, + 0xdc, 0xc2, 0xcd, 0xee, 0xca, 0x85, 0x8b, 0x37, 0xcf, 0x33, 0xb1, 0x5a, 0x9b, 0x51, 0xdc, 0xa2, + 0xd5, 0x18, 0x19, 0xf1, 0x9b, 0x9f, 0x5c, 0x94, 0x0a, 0x61, 0x08, 0x5a, 0xfd, 0xce, 0xd7, 0x4d, + 0x36, 0xfe, 0x34, 0x02, 0x4b, 0x9e, 0x5a, 0x66, 0xb0, 0xf8, 0x3d, 0x08, 0xe7, 0x41, 0x5f, 0xd9, + 0x33, 0x7e, 0x0a, 0x31, 0xc6, 0x12, 0x1d, 0xca, 0xc5, 0xdc, 0xa7, 0x25, 0x48, 0x5e, 0x17, 0x94, + 0xeb, 0xd8, 0x46, 0x97, 0x01, 0x9c, 0x96, 0xc4, 0x52, 0x39, 0xb5, 0x3c, 0xd8, 0xd6, 0xb2, 0x83, + 0xa3, 0x78, 0xc0, 0xd1, 0x13, 0x54, 0x00, 0xbb, 0xa6, 0xc5, 0x9f, 0x88, 0x9a, 0x80, 0xea, 0x00, + 0xa3, 0x87, 0x01, 0x51, 0xad, 0xa6, 0xde, 0x32, 0x6d, 0xdd, 0xd8, 0x55, 0xbb, 0xe6, 0x4b, 0xfc, + 0xe1, 0xbd, 0xa0, 0x22, 0xd3, 0x9a, 0xeb, 0xb4, 0x62, 0x93, 0x94, 0x93, 0x4e, 0xc7, 0x1d, 0x2a, + 0x24, 0x98, 0xd6, 0x5a, 0xad, 0x1e, 0xb6, 0x2c, 0xae, 0xb8, 0xc4, 0x27, 0xba, 0x0c, 0xd1, 0x6e, + 0x7f, 0x5b, 0x15, 0x5a, 0x22, 0xb1, 0x72, 0xd7, 0xa8, 0x35, 0x2f, 0x64, 0x83, 0xaf, 0xfa, 0x48, + 0xb7, 0xbf, 0x4d, 0x24, 0xe5, 0x1e, 0x48, 0x8e, 0xe8, 0x4c, 0xe2, 0x96, 0xdb, 0x0f, 0xfa, 0x1e, + 0x30, 0x1f, 0x81, 0xda, 0xed, 0xe9, 0x66, 0x4f, 0xb7, 0x0f, 0xe8, 0xb1, 0xd2, 0xa0, 0x22, 0x8b, + 0x8a, 0x4d, 0x5e, 0x9e, 0xbb, 0x09, 0xe9, 0x3a, 0x0d, 0x8d, 0xdc, 0x9e, 0x5f, 0x70, 0xfb, 0x27, + 0x4d, 0xee, 0xdf, 0xd8, 0x9e, 0x05, 0x86, 0x7a, 0x76, 0xf6, 0xdf, 0x4b, 0x90, 0x28, 0x90, 0x85, + 0x5b, 0x29, 0x5d, 0x69, 0x6b, 0xbb, 0xe8, 0x3c, 0x1c, 0x2b, 0xac, 0xd7, 0x8a, 0xcf, 0xa8, 0x95, + 0x92, 0x7a, 0x65, 0x3d, 0xef, 0xb9, 0x77, 0x90, 0x3d, 0xfe, 0xea, 0xed, 0x25, 0xe4, 0x81, 0xdd, + 0x32, 0x68, 0x26, 0x00, 0x9d, 0x83, 0x05, 0x3f, 0x4a, 0xbe, 0x50, 0x2f, 0x57, 0x1b, 0xb2, 0x94, + 0x3d, 0xf6, 0xea, 0xed, 0xa5, 0x39, 0x0f, 0x46, 0x7e, 0xdb, 0xc2, 0x86, 0x3d, 0x8c, 0x50, 0xac, + 0x6d, 0x6c, 0x54, 0x1a, 0x72, 0x60, 0x08, 0xa1, 0x68, 0x76, 0x3a, 0xba, 0x8d, 0x1e, 0x84, 0x39, + 0x3f, 0x42, 0xb5, 0xb2, 0x2e, 0x07, 0xb3, 0xe8, 0xd5, 0xdb, 0x4b, 0x29, 0x0f, 0x74, 0x55, 0x6f, + 0x67, 0x63, 0x1f, 0xfc, 0xd1, 0xd3, 0x33, 0x9f, 0xfa, 0xff, 0x4f, 0x4b, 0x85, 0x8d, 0xb1, 0x6b, + 0xee, 0xb1, 0xa3, 0xad, 0x39, 0xbf, 0xdd, 0xfe, 0xca, 0x5d, 0x3e, 0x75, 0xc3, 0x7d, 0x44, 0x8f, + 0x32, 0x9e, 0x76, 0xb9, 0x4d, 0xca, 0x0c, 0x65, 0x0f, 0x77, 0x0f, 0xb2, 0x13, 0x8c, 0x42, 0x76, + 0xa2, 0x62, 0xc8, 0x5d, 0x82, 0xd9, 0x4d, 0xad, 0x67, 0xd7, 0xb1, 0xbd, 0x86, 0xb5, 0x16, 0xee, + 0xf9, 0xfd, 0x87, 0x59, 0xe1, 0x3f, 0x20, 0x08, 0x51, 0x27, 0x81, 0xd9, 0x4f, 0xfa, 0x77, 0x6e, + 0x0f, 0x42, 0xf4, 0x2a, 0x9d, 0xe3, 0x5b, 0x70, 0x0c, 0xe6, 0x5b, 0x10, 0xcb, 0x70, 0x60, 0xf3, + 0xab, 0xc6, 0x49, 0x85, 0x7d, 0xa0, 0xc7, 0x85, 0x87, 0x10, 0x3c, 0xdc, 0x43, 0xe0, 0xcb, 0x8b, + 0xfb, 0x09, 0x6d, 0x88, 0xf2, 0x29, 0x76, 0x3a, 0x22, 0xb9, 0x1d, 0x41, 0x1b, 0x90, 0xee, 0x6a, + 0x3d, 0x9b, 0x3e, 0xcc, 0xb3, 0x47, 0x47, 0xc1, 0x57, 0xf0, 0xe2, 0xb0, 0x3e, 0xf1, 0x0d, 0x96, + 0xb7, 0x32, 0xdb, 0xf5, 0x16, 0xe6, 0xfe, 0x20, 0x04, 0x11, 0xce, 0x8c, 0xa7, 0x20, 0xca, 0xd9, + 0xca, 0xd7, 0xdc, 0xdd, 0xcb, 0xc3, 0x66, 0x76, 0xd9, 0x31, 0x87, 0x9c, 0x9e, 0xc0, 0x41, 0xf7, + 0x43, 0xac, 0xb9, 0xa7, 0xe9, 0x86, 0xaa, 0xb7, 0xb8, 0x73, 0x9c, 0xf8, 0xc2, 0xeb, 0x8b, 0xd1, + 0x22, 0x29, 0xab, 0x94, 0x94, 0x28, 0xad, 0xac, 0xb4, 0x88, 0x4f, 0xb3, 0x87, 0xf5, 0xdd, 0x3d, + 0x9b, 0xeb, 0x0d, 0xfe, 0x85, 0x9e, 0x84, 0x10, 0x11, 0x08, 0x7e, 0xf3, 0x22, 0x3b, 0x14, 0xf5, + 0x38, 0x89, 0xbb, 0x42, 0x8c, 0x34, 0xfc, 0x91, 0xff, 0xb4, 0x28, 0x29, 0x14, 0x03, 0x15, 0x61, + 0xb6, 0xad, 0x59, 0xb6, 0x4a, 0xed, 0x31, 0x69, 0x9e, 0x5d, 0xb9, 0x38, 0x39, 0xcc, 0x10, 0xce, + 0x58, 0xde, 0xf5, 0x04, 0xc1, 0x62, 0x45, 0x2d, 0x74, 0x06, 0x64, 0x4a, 0xa4, 0x49, 0x57, 0x20, + 0xf3, 0x12, 0x23, 0x94, 0xef, 0x29, 0x52, 0xce, 0x16, 0x26, 0xf5, 0x15, 0x4f, 0x41, 0x9c, 0xbe, + 0x3e, 0x45, 0x41, 0xd8, 0xfd, 0xcd, 0x18, 0x29, 0xa0, 0x95, 0x0f, 0x40, 0xda, 0xd5, 0xfa, 0x0c, + 0x24, 0xc6, 0xa8, 0xb8, 0xc5, 0x14, 0xf0, 0x51, 0x58, 0x30, 0xf0, 0xbe, 0xad, 0x0e, 0x42, 0xc7, + 0x29, 0x34, 0x22, 0x75, 0xd7, 0xfd, 0x18, 0xf7, 0x41, 0xaa, 0x29, 0x98, 0xcf, 0x60, 0x81, 0xc2, + 0xce, 0x3a, 0xa5, 0x14, 0xec, 0x24, 0xc4, 0xb4, 0x6e, 0x97, 0x01, 0x24, 0xb8, 0xd6, 0xef, 0x76, + 0x69, 0xd5, 0x59, 0x98, 0xa3, 0x63, 0xec, 0x61, 0xab, 0xdf, 0xb6, 0x39, 0x91, 0x24, 0x85, 0x49, + 0x93, 0x0a, 0x85, 0x95, 0x53, 0xd8, 0x7b, 0x61, 0x16, 0xdf, 0xd2, 0x5b, 0xd8, 0x68, 0x62, 0x06, + 0x37, 0x4b, 0xe1, 0x92, 0xa2, 0x90, 0x02, 0x3d, 0x08, 0x8e, 0x36, 0x57, 0x85, 0xa5, 0x49, 0x31, + 0x7a, 0xa2, 0x3c, 0xcf, 0x8a, 0x73, 0x19, 0x08, 0x95, 0x34, 0x5b, 0x23, 0xee, 0x92, 0xbd, 0xcf, + 0xcc, 0x67, 0x52, 0x21, 0x7f, 0xe6, 0x7e, 0x21, 0x08, 0xa1, 0xeb, 0xa6, 0x8d, 0xd1, 0x63, 0x1e, + 0x57, 0x36, 0x35, 0x4a, 0x9e, 0xeb, 0xfa, 0xae, 0x81, 0x5b, 0x1b, 0xd6, 0xae, 0xe7, 0xc5, 0x57, + 0x57, 0x9c, 0x02, 0x3e, 0x71, 0x5a, 0x80, 0x70, 0xcf, 0xec, 0x1b, 0x2d, 0x71, 0xc1, 0x81, 0x7e, + 0xa0, 0x32, 0xc4, 0x1c, 0x29, 0x09, 0x4d, 0x92, 0x92, 0x34, 0x91, 0x12, 0x22, 0xc3, 0xbc, 0x40, + 0x89, 0x6e, 0x73, 0x61, 0x29, 0x40, 0xdc, 0x51, 0x5e, 0x5c, 0xda, 0xa6, 0x13, 0x58, 0x17, 0x8d, + 0x98, 0x48, 0x67, 0xee, 0x1d, 0xe6, 0x31, 0x89, 0x93, 0x9d, 0x0a, 0xce, 0x3d, 0x9f, 0x58, 0xf1, + 0xd7, 0x67, 0xa3, 0x74, 0x5c, 0xae, 0x58, 0xb1, 0x17, 0x68, 0xef, 0x82, 0xb8, 0xa5, 0xef, 0x1a, + 0xf4, 0xce, 0x10, 0x97, 0x3c, 0xb7, 0x80, 0xd4, 0xba, 0xb7, 0x80, 0x99, 0xa4, 0x79, 0x5e, 0x39, + 0x3f, 0x07, 0xf3, 0xee, 0xfb, 0xe2, 0x2e, 0x15, 0x26, 0x65, 0xc8, 0xa9, 0xaa, 0x8b, 0x9a, 0xdc, + 0xaf, 0x4a, 0x10, 0xe1, 0x16, 0xcb, 0x9d, 0x06, 0x69, 0xf4, 0x34, 0x04, 0xc6, 0x4d, 0x43, 0xf0, + 0xce, 0xa7, 0x21, 0x0f, 0xe0, 0x74, 0xd3, 0xe2, 0x6f, 0x8c, 0x8e, 0x70, 0xab, 0x58, 0x17, 0xeb, + 0xfa, 0x2e, 0x5f, 0xf7, 0x1e, 0xa4, 0xdc, 0xef, 0x4a, 0xc4, 0xc3, 0xe7, 0xf5, 0x28, 0x0f, 0xb3, + 0xa2, 0x5f, 0xea, 0x4e, 0x5b, 0xdb, 0xe5, 0xa2, 0x78, 0xf7, 0xd8, 0xce, 0x11, 0x2b, 0xac, 0x24, + 0x78, 0x7f, 0xa8, 0x3f, 0x31, 0x72, 0x5a, 0x03, 0x63, 0xa6, 0xd5, 0x27, 0x47, 0xc1, 0x3b, 0x93, + 0x23, 0xdf, 0x8c, 0x87, 0x06, 0x66, 0x3c, 0xf7, 0x7b, 0x12, 0x7f, 0xdd, 0xbc, 0xc5, 0x2e, 0x48, + 0xfd, 0xaf, 0x9a, 0xaa, 0x17, 0xb8, 0x6c, 0xb5, 0x70, 0x4b, 0x1d, 0x9a, 0xb3, 0x7b, 0x87, 0x29, + 0xfa, 0xfb, 0xec, 0xce, 0x1d, 0x12, 0x54, 0xea, 0xee, 0x1c, 0x7e, 0x36, 0x00, 0x73, 0x43, 0xf0, + 0x7f, 0xf3, 0xe6, 0xd2, 0xbf, 0x7a, 0xc3, 0x53, 0xae, 0xde, 0xc8, 0xd8, 0xd5, 0xfb, 0x99, 0x00, + 0x4d, 0x00, 0x74, 0x4d, 0x4b, 0x6b, 0xff, 0x75, 0xe8, 0xde, 0x53, 0x10, 0xef, 0x9a, 0x6d, 0x95, + 0xd5, 0xb0, 0x2b, 0x66, 0xb1, 0xae, 0xd9, 0x56, 0x86, 0xc4, 0x2c, 0xfc, 0x36, 0x29, 0xe6, 0xc8, + 0xdb, 0x30, 0x09, 0xd1, 0xc1, 0x05, 0xd5, 0x83, 0x24, 0x63, 0x05, 0xf7, 0x9a, 0x1e, 0x25, 0x3c, + 0xa0, 0x6e, 0x98, 0x34, 0xec, 0xe5, 0xb1, 0x6e, 0x33, 0x48, 0x85, 0xc3, 0x11, 0x0c, 0xe6, 0x64, + 0x8c, 0xca, 0x1c, 0x79, 0x35, 0x96, 0xc2, 0xe1, 0x72, 0xdf, 0x2f, 0x01, 0xac, 0x13, 0xce, 0xd2, + 0xf1, 0x12, 0x7f, 0xc7, 0xa2, 0x5d, 0x50, 0x7d, 0x2d, 0x9f, 0x1e, 0x37, 0x69, 0xbc, 0xfd, 0xa4, + 0xe5, 0xed, 0x77, 0x11, 0x66, 0x5d, 0xd9, 0xb6, 0xb0, 0xe8, 0xcc, 0xe9, 0x43, 0xa2, 0xd2, 0x3a, + 0xb6, 0x95, 0xe4, 0x2d, 0xcf, 0x57, 0xee, 0x1f, 0x4b, 0x10, 0xa7, 0x7d, 0xda, 0xc0, 0xb6, 0xe6, + 0x9b, 0x43, 0xe9, 0xce, 0xe7, 0xf0, 0x6e, 0x00, 0x46, 0xc6, 0xd2, 0x5f, 0xc6, 0x5c, 0xb2, 0xe2, + 0xb4, 0xa4, 0xae, 0xbf, 0x8c, 0xd1, 0x45, 0x87, 0xe1, 0xc1, 0xc3, 0x19, 0x2e, 0xa2, 0x56, 0xce, + 0xf6, 0x13, 0x10, 0xa5, 0xaf, 0x47, 0xec, 0x5b, 0x3c, 0x10, 0x8d, 0x18, 0xfd, 0x4e, 0x63, 0xdf, + 0xca, 0xbd, 0x08, 0xd1, 0xc6, 0x3e, 0xcb, 0x27, 0x9e, 0x82, 0x78, 0xcf, 0x34, 0xb9, 0xf7, 0xc7, + 0xbc, 0xee, 0x18, 0x29, 0xa0, 0xce, 0x8e, 0xc8, 0xa1, 0x05, 0xdc, 0x1c, 0x9a, 0x9b, 0x04, 0x0c, + 0x4e, 0x95, 0x04, 0x24, 0xd1, 0xe7, 0xac, 0x6f, 0x25, 0xa1, 0x87, 0xe1, 0x44, 0xbd, 0x72, 0xb5, + 0x5a, 0x2e, 0xa9, 0x1b, 0xf5, 0xab, 0x03, 0x77, 0xfc, 0xb3, 0xe9, 0x57, 0x6f, 0x2f, 0x25, 0x78, + 0xd8, 0x39, 0x0e, 0x7a, 0x53, 0x29, 0x5f, 0xaf, 0x35, 0xca, 0xb2, 0xc4, 0xa0, 0x37, 0x7b, 0xf8, + 0x96, 0x69, 0xb3, 0x9f, 0xbe, 0x79, 0x14, 0x4e, 0x8e, 0x80, 0x76, 0x82, 0xcf, 0xb9, 0x57, 0x6f, + 0x2f, 0xcd, 0x6e, 0xf6, 0x30, 0x93, 0x32, 0x8a, 0xb1, 0x0c, 0x99, 0x61, 0x8c, 0xda, 0x66, 0xad, + 0x9e, 0x5f, 0x97, 0x97, 0xb2, 0xf2, 0xab, 0xb7, 0x97, 0x92, 0x42, 0x65, 0x10, 0xf8, 0xaf, 0x7f, + 0xf4, 0xf9, 0x9d, 0x31, 0x5f, 0xd6, 0x98, 0xc5, 0x75, 0x5d, 0xad, 0xa7, 0x75, 0x8e, 0x1a, 0x7e, + 0x4e, 0x38, 0xae, 0x91, 0xfb, 0x74, 0x00, 0xd2, 0x4e, 0x70, 0xb3, 0x49, 0x5b, 0x40, 0x8f, 0x79, + 0x33, 0x7e, 0x89, 0xb1, 0xb6, 0x83, 0x41, 0x8b, 0x84, 0xe0, 0xbb, 0x21, 0x26, 0x9c, 0x64, 0xbe, + 0xa8, 0x96, 0x46, 0xd8, 0x37, 0x0e, 0xc1, 0x51, 0x1d, 0x0c, 0xf4, 0x34, 0xc4, 0x9d, 0x25, 0xe6, + 0xbc, 0x19, 0x3e, 0x7e, 0x4d, 0x72, 0x7c, 0x17, 0x07, 0x5d, 0x72, 0xc3, 0xb8, 0xd0, 0xb8, 0xc0, + 0xf0, 0x3a, 0x03, 0xe0, 0xc8, 0x4e, 0x08, 0xf7, 0x28, 0x84, 0xb4, 0xed, 0xa6, 0xce, 0x15, 0xf0, + 0x5d, 0xc3, 0x78, 0xf9, 0x42, 0xb1, 0xc2, 0x91, 0x28, 0x64, 0xae, 0xc2, 0x93, 0x29, 0x9c, 0x5f, + 0xf4, 0x15, 0xd6, 0x7d, 0x95, 0xc5, 0xc2, 0xcc, 0xbb, 0x88, 0x75, 0xb4, 0xfd, 0x02, 0x0d, 0x87, + 0x4f, 0x40, 0x94, 0x54, 0xee, 0xf2, 0xe7, 0xd0, 0x82, 0x4a, 0xa4, 0xa3, 0xed, 0x5f, 0xd5, 0xac, + 0x6b, 0xa1, 0x58, 0x50, 0x0e, 0xe5, 0x7e, 0x92, 0x78, 0x2a, 0x3e, 0xae, 0xa0, 0x87, 0x00, 0x11, + 0x0c, 0x6d, 0x17, 0xab, 0x64, 0xe9, 0x52, 0xf6, 0x0a, 0xba, 0xe9, 0x8e, 0xb6, 0x9f, 0xdf, 0xc5, + 0xd5, 0x7e, 0x87, 0x76, 0xc0, 0x42, 0x1b, 0x20, 0x0b, 0x60, 0x31, 0xb3, 0x9c, 0xfd, 0x27, 0x87, + 0x7f, 0x44, 0x86, 0x03, 0x30, 0x03, 0xf0, 0x1a, 0x31, 0x00, 0x29, 0x46, 0xcf, 0x39, 0xa0, 0xe3, + 0x1b, 0x4a, 0xd0, 0x3f, 0x94, 0xdc, 0xd3, 0x90, 0x1e, 0x98, 0x01, 0x94, 0x83, 0x59, 0x9e, 0xb1, + 0xa2, 0x87, 0x1f, 0x58, 0x84, 0x13, 0x57, 0x12, 0x2c, 0x33, 0x45, 0x0f, 0x83, 0xac, 0xc6, 0x7e, + 0xf1, 0x13, 0x8b, 0x12, 0xdd, 0xf6, 0x79, 0x08, 0x66, 0x7d, 0x73, 0x20, 0xb2, 0xc8, 0x92, 0x9b, + 0x45, 0x76, 0x81, 0x5f, 0x80, 0x24, 0x51, 0x40, 0xb8, 0xc5, 0x61, 0xef, 0x87, 0x34, 0x53, 0x90, + 0x83, 0xbc, 0x66, 0x0e, 0xcf, 0x86, 0x60, 0x78, 0x4e, 0x78, 0x40, 0x7e, 0xb6, 0x27, 0x04, 0xd4, + 0x55, 0xcd, 0xca, 0xd5, 0x00, 0xdc, 0x49, 0x45, 0x79, 0xb8, 0x9b, 0x28, 0x0f, 0xef, 0x61, 0x5d, + 0xfe, 0xcc, 0xb4, 0xcf, 0x63, 0xcc, 0x12, 0x20, 0xf7, 0x40, 0x2e, 0x7b, 0x6c, 0x7a, 0x8d, 0x42, + 0x14, 0x9e, 0xfd, 0xd4, 0x17, 0x4e, 0x4b, 0x5f, 0x1f, 0x5d, 0xf0, 0x1f, 0x6e, 0xc0, 0x29, 0x4f, + 0x25, 0x11, 0x40, 0x5f, 0x22, 0x2a, 0xed, 0x91, 0x57, 0x52, 0x39, 0x29, 0xa1, 0x74, 0x68, 0xfe, + 0x37, 0x7b, 0xb8, 0xda, 0x99, 0x9c, 0x6d, 0x9a, 0x9c, 0xef, 0x1a, 0x9d, 0x94, 0xff, 0x95, 0x38, + 0x44, 0x15, 0xfc, 0xbe, 0x3e, 0xb6, 0x6c, 0xb4, 0x02, 0x21, 0xdc, 0xdc, 0x33, 0x47, 0xe5, 0x40, + 0xc9, 0x00, 0x97, 0x39, 0x5c, 0xb9, 0xb9, 0x67, 0xae, 0xcd, 0x28, 0x14, 0x16, 0x5d, 0x80, 0xf0, + 0x4e, 0xbb, 0xcf, 0xd3, 0x57, 0x03, 0x3a, 0xcb, 0x8b, 0x74, 0x85, 0x00, 0xad, 0xcd, 0x28, 0x0c, + 0x9a, 0x34, 0x45, 0x7f, 0x17, 0x2c, 0x78, 0x78, 0x53, 0x15, 0x63, 0x87, 0x36, 0x45, 0x60, 0x51, + 0x01, 0x40, 0x37, 0x74, 0x5b, 0xa5, 0xa9, 0x1d, 0xae, 0x35, 0xee, 0x19, 0x8f, 0xa9, 0xdb, 0x34, + 0x19, 0xb4, 0x36, 0xa3, 0xc4, 0x75, 0xf1, 0x41, 0xba, 0xfb, 0xbe, 0x3e, 0xee, 0x1d, 0x70, 0x6f, + 0x6d, 0x6c, 0x77, 0x9f, 0x25, 0x40, 0xa4, 0xbb, 0x14, 0x9a, 0x28, 0x59, 0xf6, 0xee, 0xbc, 0xbd, + 0xcf, 0x7f, 0x4d, 0x65, 0x71, 0x1c, 0x26, 0x7d, 0x7c, 0xbe, 0xb1, 0xbf, 0x36, 0xa3, 0x44, 0x9b, + 0xec, 0x4f, 0xf4, 0xa4, 0xe3, 0x82, 0x25, 0x86, 0xbd, 0x1e, 0x1f, 0x2e, 0x4b, 0xfb, 0xcc, 0x08, + 0x57, 0x0c, 0x55, 0x21, 0xd5, 0xd6, 0x2d, 0x5b, 0xb5, 0x0c, 0xad, 0x6b, 0xed, 0x99, 0xb6, 0x78, + 0xf8, 0xf9, 0xbe, 0x71, 0x14, 0xd6, 0x75, 0xcb, 0xae, 0x0b, 0xe0, 0xb5, 0x19, 0x65, 0xb6, 0xed, + 0x2d, 0x20, 0xf4, 0xcc, 0x9d, 0x1d, 0xdc, 0x73, 0x08, 0xd2, 0x3c, 0xcb, 0x21, 0xf4, 0x6a, 0x04, + 0x5a, 0xe0, 0x13, 0x7a, 0xa6, 0xb7, 0x00, 0x7d, 0x03, 0xcc, 0xb7, 0x4d, 0xad, 0xe5, 0x90, 0x53, + 0x9b, 0x7b, 0x7d, 0xe3, 0x26, 0x4d, 0xca, 0x24, 0x56, 0x1e, 0x1c, 0xdb, 0x49, 0x53, 0x6b, 0x09, + 0x12, 0x45, 0x82, 0xb0, 0x36, 0xa3, 0xcc, 0xb5, 0x07, 0x0b, 0xd1, 0x7b, 0x61, 0x41, 0xeb, 0x76, + 0xdb, 0x07, 0x83, 0xd4, 0xd3, 0x94, 0xfa, 0xd9, 0x71, 0xd4, 0xf3, 0x04, 0x67, 0x90, 0x3c, 0xd2, + 0x86, 0x4a, 0x51, 0x03, 0xe4, 0x6e, 0x0f, 0xd3, 0xfb, 0x6e, 0x5d, 0xee, 0x65, 0xd0, 0x57, 0x95, + 0x13, 0x2b, 0x0f, 0x8c, 0xa3, 0xbd, 0xc9, 0xe0, 0x85, 0x53, 0xb2, 0x36, 0xa3, 0xa4, 0xbb, 0xfe, + 0x22, 0x46, 0xd5, 0x6c, 0x62, 0xfa, 0x04, 0x3d, 0xa7, 0x3a, 0x37, 0x89, 0x2a, 0x85, 0xf7, 0x53, + 0xf5, 0x15, 0xa1, 0x32, 0x24, 0x58, 0x28, 0xaa, 0x12, 0x65, 0x48, 0x9f, 0xf6, 0x4f, 0xac, 0xe4, + 0xc6, 0xae, 0x50, 0x0a, 0x7a, 0xdd, 0xb4, 0xf1, 0xda, 0x8c, 0x02, 0xd8, 0xf9, 0x42, 0x1a, 0x1c, + 0xa3, 0xcf, 0x52, 0x1f, 0xa8, 0x7e, 0xc5, 0x9b, 0x99, 0xa7, 0x04, 0x1f, 0x1a, 0x47, 0x90, 0xfe, + 0xdc, 0xd3, 0xc1, 0x75, 0xaf, 0x1e, 0x5e, 0x9b, 0x51, 0xe6, 0x6f, 0x0d, 0x17, 0x13, 0x11, 0xdb, + 0xd1, 0x0d, 0xad, 0xad, 0xbf, 0x8c, 0x99, 0x09, 0xa5, 0xbf, 0xf2, 0x70, 0x88, 0x88, 0x5d, 0xe1, + 0xd0, 0xd4, 0xb0, 0x12, 0x11, 0xdb, 0xf1, 0x16, 0x14, 0xa2, 0xfc, 0xa4, 0xae, 0xf3, 0x5c, 0x6b, + 0x54, 0x8e, 0xb1, 0x47, 0xc5, 0xaf, 0x85, 0x62, 0x20, 0x27, 0x72, 0x0f, 0x40, 0xc2, 0xa3, 0x98, + 0x50, 0x06, 0xa2, 0xfc, 0xa4, 0x8e, 0x38, 0xf3, 0xcb, 0x3f, 0x73, 0x29, 0x48, 0x7a, 0x95, 0x51, + 0xee, 0x23, 0x92, 0x83, 0x49, 0xdf, 0x4e, 0xc9, 0xf8, 0x33, 0xd2, 0x71, 0xd7, 0x53, 0xb9, 0x57, + 0x98, 0x36, 0x51, 0xcf, 0xb6, 0x5f, 0x93, 0xb4, 0x90, 0x5b, 0x56, 0xb4, 0x08, 0x89, 0xee, 0x4a, + 0xd7, 0x01, 0x09, 0x52, 0x10, 0xe8, 0xae, 0x74, 0x05, 0xc0, 0x3d, 0x90, 0x24, 0xe3, 0x56, 0xbd, + 0xfe, 0x52, 0x5c, 0x49, 0x90, 0x32, 0x0e, 0x92, 0xfb, 0xcd, 0x00, 0xc8, 0x83, 0x0a, 0xcc, 0x49, + 0x55, 0x4b, 0x47, 0x4e, 0x55, 0x9f, 0x1c, 0x4c, 0x92, 0xbb, 0x79, 0xf1, 0x75, 0x90, 0xdd, 0xf4, + 0x2e, 0x33, 0x35, 0xe3, 0xfd, 0xbf, 0x01, 0x47, 0x55, 0x49, 0x37, 0x07, 0x3c, 0xd7, 0x2b, 0xbe, + 0xcd, 0x4a, 0xf1, 0xc3, 0x99, 0x83, 0x13, 0xee, 0x38, 0x31, 0x5b, 0xdd, 0x96, 0x66, 0x63, 0x91, + 0x1f, 0xf3, 0xec, 0x5b, 0xde, 0x0f, 0x69, 0xad, 0xdb, 0x55, 0x2d, 0x5b, 0xb3, 0x31, 0xf7, 0x35, + 0x58, 0xe6, 0x61, 0x56, 0xeb, 0x76, 0xe9, 0xef, 0x8c, 0x31, 0x5f, 0xe3, 0x3e, 0x48, 0x11, 0x9d, + 0xae, 0x6b, 0x6d, 0xe1, 0x2a, 0x44, 0x98, 0x4b, 0xc2, 0x4b, 0x99, 0x77, 0x90, 0x6b, 0x39, 0x33, + 0x4e, 0xf5, 0xb9, 0x13, 0x53, 0x49, 0x9e, 0x98, 0x0a, 0xf1, 0x37, 0x6d, 0x18, 0x7f, 0xc4, 0xf3, + 0x43, 0xa3, 0x37, 0x0d, 0x16, 0x68, 0xfc, 0x75, 0x8b, 0x25, 0x4b, 0x62, 0x0a, 0xfb, 0xc8, 0x29, + 0x90, 0xf2, 0xeb, 0x7e, 0x94, 0x82, 0x80, 0xbd, 0xcf, 0x5b, 0x09, 0xd8, 0xfb, 0xc4, 0xd3, 0xf5, + 0x3c, 0x23, 0x38, 0x6c, 0xed, 0x38, 0x9e, 0x9b, 0xeb, 0xc8, 0xa5, 0x61, 0xd6, 0x67, 0x13, 0x72, + 0xc7, 0x61, 0x61, 0x94, 0x8a, 0xcf, 0xed, 0x39, 0xe5, 0x3e, 0x55, 0x8d, 0x2e, 0x40, 0xcc, 0xd1, + 0xf1, 0x23, 0xa2, 0x63, 0xda, 0xac, 0x00, 0x56, 0x1c, 0x50, 0x5f, 0x3a, 0x3f, 0xe0, 0x4b, 0xe7, + 0xe7, 0xbe, 0x19, 0x32, 0xe3, 0xf4, 0xf7, 0x40, 0x92, 0x2f, 0xe4, 0x30, 0xec, 0x38, 0x44, 0xf8, + 0xab, 0x79, 0x01, 0xba, 0x81, 0xc5, 0xbf, 0x08, 0x23, 0x99, 0x2e, 0x0f, 0xb2, 0x7d, 0x2d, 0xfa, + 0x91, 0x53, 0xe1, 0xe4, 0x58, 0x1d, 0x3e, 0x7e, 0x2b, 0x8c, 0x11, 0xe2, 0x5b, 0x61, 0x4d, 0xd1, + 0x1d, 0x8b, 0x8e, 0x55, 0x1c, 0x64, 0x61, 0x5f, 0xb9, 0xd7, 0x82, 0x70, 0x7c, 0xb4, 0x26, 0x47, + 0x4b, 0x90, 0x24, 0x7e, 0xab, 0xed, 0x77, 0x71, 0xa1, 0xa3, 0xed, 0x37, 0xb8, 0x7f, 0xcb, 0xb7, + 0x12, 0x02, 0xce, 0x56, 0x02, 0xda, 0x82, 0xb9, 0xb6, 0xd9, 0xd4, 0xda, 0xaa, 0x67, 0x2b, 0x87, + 0x2f, 0xa2, 0x7b, 0x87, 0x98, 0xed, 0x4f, 0x19, 0x12, 0x85, 0xc3, 0xe5, 0x3f, 0x4d, 0x69, 0xac, + 0x3b, 0xbb, 0x3e, 0xa8, 0x04, 0x89, 0x8e, 0x6e, 0x6d, 0xe3, 0x3d, 0xed, 0x96, 0x6e, 0xf6, 0xf8, + 0x6a, 0x1a, 0x16, 0x9a, 0x0d, 0x17, 0x46, 0xec, 0x30, 0x79, 0xd0, 0x3c, 0x53, 0x12, 0x1e, 0xb9, + 0xf1, 0x15, 0x39, 0xb2, 0x36, 0x19, 0xb7, 0x87, 0x14, 0x1d, 0xbb, 0x87, 0x34, 0x6a, 0xc3, 0x26, + 0x36, 0x7a, 0xc3, 0xe6, 0x83, 0xde, 0xa9, 0xf1, 0xdb, 0xbe, 0xa1, 0x3d, 0x1c, 0x54, 0x87, 0x05, + 0x8e, 0xdf, 0xf2, 0xf1, 0x7e, 0xc4, 0x51, 0x07, 0xb6, 0xbe, 0x06, 0x79, 0x8e, 0x04, 0xfa, 0x78, + 0xb6, 0x07, 0xef, 0x8c, 0xed, 0x62, 0x13, 0x35, 0xe4, 0xd9, 0x44, 0xfd, 0xdf, 0x6c, 0x2a, 0xde, + 0x1f, 0x84, 0xb9, 0x21, 0x47, 0x62, 0xe4, 0xee, 0xf0, 0xb8, 0x8c, 0xac, 0x18, 0x58, 0xf0, 0xc8, + 0x03, 0xe3, 0x73, 0x1d, 0x9a, 0x3c, 0xd7, 0xe1, 0xb7, 0x71, 0xae, 0x23, 0x77, 0x36, 0xd7, 0x5f, + 0xd7, 0x59, 0xf8, 0x98, 0x04, 0xd9, 0xf1, 0xde, 0xd7, 0xc8, 0xe9, 0x38, 0xd2, 0x06, 0xc2, 0x38, + 0x1b, 0x77, 0x1f, 0xa4, 0x06, 0x7c, 0x43, 0x26, 0xca, 0xb3, 0xbe, 0x28, 0x3c, 0xf7, 0x81, 0xa0, + 0x63, 0x78, 0x7c, 0x0e, 0xdc, 0x88, 0xd5, 0xfa, 0x2c, 0xcc, 0xb7, 0x70, 0x53, 0x6f, 0xdd, 0xe9, + 0x62, 0x9d, 0xe3, 0xd8, 0xff, 0x67, 0xad, 0x0e, 0x4b, 0xc9, 0xf7, 0x01, 0xc4, 0x14, 0x6c, 0x75, + 0x89, 0x3f, 0x86, 0x0a, 0x10, 0xc7, 0xfb, 0x4d, 0xdc, 0xb5, 0xdd, 0x43, 0x15, 0xa3, 0x42, 0x04, + 0x06, 0x5d, 0x16, 0x90, 0x24, 0x40, 0x76, 0xd0, 0xd0, 0x63, 0x3c, 0x07, 0x30, 0x3e, 0x9c, 0xe7, + 0xe8, 0xde, 0x24, 0xc0, 0x45, 0x91, 0x04, 0x08, 0x8e, 0x8d, 0x6f, 0x19, 0xd6, 0x40, 0x16, 0xe0, + 0x31, 0x9e, 0x05, 0x08, 0x4d, 0x68, 0xcc, 0x97, 0x06, 0x28, 0xfa, 0xd2, 0x00, 0x91, 0x09, 0xc3, + 0x1c, 0x93, 0x07, 0xb8, 0x28, 0xf2, 0x00, 0xd1, 0x09, 0x3d, 0x1e, 0x48, 0x04, 0x3c, 0xe5, 0x49, + 0x04, 0xc4, 0x87, 0xb3, 0xad, 0x3e, 0xd4, 0x11, 0x99, 0x80, 0x4b, 0x4e, 0x26, 0x20, 0x39, 0x36, + 0x8b, 0xc0, 0x91, 0x07, 0x53, 0x01, 0xb5, 0xa1, 0x54, 0xc0, 0x2c, 0xff, 0x11, 0xe8, 0x71, 0x24, + 0x26, 0xe4, 0x02, 0x6a, 0x43, 0xb9, 0x80, 0xd4, 0x04, 0x82, 0x13, 0x92, 0x01, 0xdf, 0x38, 0x3a, + 0x19, 0x30, 0x3e, 0x5c, 0xe7, 0xdd, 0x9c, 0x2e, 0x1b, 0xa0, 0x8e, 0xc9, 0x06, 0xc8, 0x63, 0x23, + 0x57, 0x46, 0x7e, 0xea, 0x74, 0xc0, 0xd6, 0x88, 0x74, 0x00, 0x0b, 0xdc, 0xcf, 0x8c, 0x25, 0x3e, + 0x45, 0x3e, 0x60, 0x6b, 0x44, 0x3e, 0x00, 0x4d, 0x24, 0x3b, 0x31, 0x21, 0x70, 0xc5, 0x9f, 0x10, + 0x98, 0x1f, 0xe3, 0x75, 0xba, 0xab, 0x7d, 0x4c, 0x46, 0x60, 0x7b, 0x5c, 0x46, 0x60, 0x81, 0xff, + 0xb8, 0xc4, 0x38, 0x8a, 0x47, 0x48, 0x09, 0xd4, 0x86, 0x52, 0x02, 0xc7, 0x26, 0x48, 0xda, 0xf4, + 0x39, 0x01, 0xf6, 0x73, 0x63, 0xec, 0x87, 0xc6, 0x40, 0x4e, 0x5c, 0x0b, 0xc5, 0x12, 0x72, 0x32, + 0xf7, 0x20, 0xf1, 0x60, 0x06, 0xf4, 0x1c, 0x89, 0x15, 0x70, 0xaf, 0x67, 0xf6, 0xc4, 0x1d, 0x0b, + 0xfa, 0x91, 0x3b, 0x43, 0x62, 0x44, 0x57, 0xa7, 0x1d, 0x92, 0x3f, 0xa0, 0x31, 0x99, 0x47, 0x8f, + 0xe5, 0x7e, 0x51, 0x72, 0x71, 0x69, 0x06, 0xc1, 0x1b, 0x5f, 0xc6, 0x79, 0x7c, 0xe9, 0xc9, 0x2a, + 0x04, 0xfc, 0x59, 0x85, 0x45, 0x48, 0x90, 0x58, 0x6b, 0x20, 0x61, 0xa0, 0x75, 0x9d, 0x84, 0x81, + 0x38, 0x40, 0xc5, 0x72, 0x0f, 0xdc, 0x2c, 0xb1, 0xdd, 0xc4, 0xb4, 0x73, 0x98, 0x8c, 0x85, 0xba, + 0xe8, 0x11, 0x98, 0xf7, 0xc0, 0x3a, 0x31, 0x1c, 0x8b, 0x9e, 0x65, 0x07, 0x3a, 0xcf, 0x83, 0xb9, + 0x7f, 0x2a, 0xb9, 0x1c, 0x72, 0x33, 0x0d, 0xa3, 0x92, 0x02, 0xd2, 0xdb, 0x94, 0x14, 0x08, 0xdc, + 0x71, 0x52, 0xc0, 0x1b, 0x93, 0x06, 0xfd, 0x31, 0xe9, 0x7f, 0x93, 0xdc, 0x39, 0x71, 0x42, 0xfc, + 0xa6, 0xd9, 0xc2, 0x3c, 0x4a, 0xa4, 0x7f, 0x13, 0x97, 0xa4, 0x6d, 0x8a, 0x5f, 0x89, 0x22, 0x7f, + 0x12, 0x28, 0xc7, 0xf0, 0xc4, 0xb9, 0x5d, 0x71, 0x02, 0xcc, 0xb0, 0xf7, 0x1e, 0x07, 0xbf, 0xdc, + 0x10, 0x71, 0x2f, 0x37, 0x38, 0x57, 0xc7, 0xa3, 0x9e, 0xab, 0xe3, 0xe8, 0x49, 0x88, 0xd3, 0x64, + 0xbf, 0x6a, 0x76, 0xc5, 0x0f, 0x6e, 0x9f, 0x1a, 0x7f, 0xb1, 0xc1, 0xa2, 0x47, 0xae, 0xd9, 0x65, + 0x08, 0xd7, 0xe3, 0x88, 0xfb, 0x3c, 0x8e, 0xbb, 0x20, 0x4e, 0x7a, 0xcf, 0x7e, 0x71, 0x12, 0xf8, + 0xbb, 0x03, 0xa2, 0x20, 0xf7, 0x53, 0x01, 0x48, 0x0f, 0x18, 0x9a, 0x91, 0x63, 0x1f, 0xb5, 0x8d, + 0x3c, 0x1d, 0x3f, 0x4e, 0x03, 0xec, 0x6a, 0x96, 0xfa, 0x92, 0x66, 0xd8, 0xfc, 0x57, 0xe2, 0x83, + 0x8a, 0xa7, 0x04, 0x65, 0x21, 0x46, 0xbe, 0xfa, 0x16, 0xff, 0x9d, 0xf8, 0xa0, 0xe2, 0x7c, 0xa3, + 0x35, 0x88, 0xe0, 0x5b, 0xf4, 0xf1, 0x64, 0xf6, 0x23, 0x21, 0xc7, 0x87, 0xc3, 0x61, 0x52, 0x5d, + 0xc8, 0x90, 0xc9, 0xfe, 0xd2, 0xeb, 0x8b, 0x32, 0x83, 0x7e, 0xd8, 0xb9, 0xcc, 0xa6, 0x70, 0x7c, + 0x3f, 0x17, 0x62, 0x03, 0x5c, 0xa0, 0x79, 0xc0, 0xa4, 0x08, 0xef, 0x09, 0x4f, 0xd9, 0x19, 0x6f, + 0x65, 0xb6, 0x83, 0x3b, 0x5d, 0xd3, 0x6c, 0xab, 0x6c, 0x8d, 0xe7, 0x21, 0xe5, 0xb7, 0xab, 0xec, + 0x47, 0x9d, 0x6d, 0x4d, 0x37, 0x54, 0x9f, 0x13, 0x9c, 0x64, 0x85, 0x6c, 0x4d, 0x79, 0x5f, 0xc6, + 0xce, 0x6d, 0xc2, 0xb1, 0x91, 0x76, 0x15, 0x3d, 0x01, 0x71, 0xd7, 0x24, 0xb3, 0x63, 0xfa, 0x87, + 0x64, 0x5a, 0x5c, 0xd8, 0xdc, 0x2f, 0x4b, 0x2e, 0x49, 0x7f, 0xee, 0xa6, 0x0c, 0x11, 0x76, 0x66, + 0x92, 0x9f, 0x8f, 0x79, 0x64, 0x3a, 0x8b, 0xbc, 0xcc, 0x0e, 0x54, 0x2a, 0x1c, 0x39, 0xf7, 0x5e, + 0x88, 0xb0, 0x12, 0x94, 0x80, 0xa8, 0xef, 0xb1, 0xfc, 0x7c, 0xb1, 0x58, 0xde, 0x14, 0x8f, 0x1f, + 0x17, 0xe8, 0x43, 0xf4, 0xa4, 0x58, 0x29, 0x5f, 0x2b, 0x17, 0x1b, 0x72, 0x10, 0xcd, 0xc1, 0x2c, + 0xfb, 0x9b, 0x3f, 0x69, 0x2f, 0x87, 0x3c, 0x45, 0xf5, 0x72, 0xb5, 0x54, 0x56, 0xe4, 0x70, 0xee, + 0x3c, 0x9c, 0x1c, 0x6b, 0xc3, 0xdd, 0xc4, 0x8c, 0xe4, 0x49, 0xcc, 0xe4, 0x5e, 0x0b, 0x90, 0xa0, + 0x66, 0x9c, 0x61, 0x46, 0xd7, 0x06, 0x06, 0xbe, 0x72, 0x04, 0xab, 0x3e, 0x30, 0x7a, 0x12, 0xc7, + 0xf4, 0xf0, 0x0e, 0xb6, 0x9b, 0x7b, 0xcc, 0x51, 0x60, 0x1a, 0x68, 0x56, 0x99, 0xe5, 0xa5, 0x14, + 0xc9, 0x62, 0x60, 0x2f, 0xe2, 0xa6, 0xad, 0x32, 0x21, 0xb2, 0x68, 0x30, 0x11, 0x27, 0x60, 0xa4, + 0xb4, 0xce, 0x0a, 0x73, 0xdf, 0x7c, 0x24, 0x5e, 0xc6, 0x21, 0xac, 0x94, 0x1b, 0xca, 0x0d, 0xf6, + 0xd3, 0xed, 0xf4, 0x4f, 0xb5, 0x5e, 0xcd, 0x6f, 0xd6, 0xd7, 0x6a, 0x84, 0x97, 0xf3, 0x90, 0x16, + 0xbc, 0x14, 0x85, 0xe1, 0xdc, 0x43, 0x70, 0x62, 0x8c, 0x57, 0x31, 0xe2, 0x10, 0xeb, 0x27, 0x25, + 0x2f, 0xb4, 0xdf, 0x33, 0xa8, 0x41, 0xc4, 0xb2, 0x35, 0xbb, 0x6f, 0x71, 0x26, 0x3e, 0x31, 0xad, + 0x9b, 0xb1, 0x2c, 0xfe, 0xa8, 0x53, 0x74, 0x85, 0x93, 0xc9, 0x5d, 0x80, 0x94, 0xbf, 0x66, 0x3c, + 0x0f, 0x5c, 0x21, 0x0a, 0xe4, 0x2e, 0x03, 0x1a, 0xf6, 0x3e, 0x46, 0x84, 0x97, 0xd2, 0xa8, 0xf0, + 0xf2, 0xc7, 0x24, 0x38, 0x75, 0x88, 0xa7, 0x81, 0x9e, 0x1d, 0x18, 0xe4, 0xa5, 0xa3, 0xf8, 0x29, + 0xcb, 0xac, 0x6c, 0x60, 0x98, 0x8f, 0x41, 0xd2, 0x5b, 0x3e, 0xdd, 0x20, 0xbf, 0x14, 0x70, 0x17, + 0xb1, 0x3f, 0x0e, 0x76, 0x55, 0xa0, 0xf4, 0x35, 0xaa, 0xc0, 0x77, 0x03, 0xd8, 0xfb, 0xe2, 0x14, + 0x35, 0xb7, 0xa3, 0x77, 0x8f, 0xc8, 0x2f, 0xe2, 0x66, 0x63, 0x9f, 0x2f, 0x82, 0xb8, 0xcd, 0xff, + 0xb2, 0x50, 0xdd, 0x9b, 0x14, 0xe8, 0x53, 0x1b, 0x6b, 0xf1, 0x80, 0x79, 0x5a, 0x63, 0xec, 0x26, + 0x0f, 0x58, 0xb1, 0x85, 0x6e, 0xc0, 0x89, 0x01, 0x47, 0xc1, 0x21, 0x1d, 0x9a, 0xd6, 0x5f, 0x38, + 0xe6, 0xf7, 0x17, 0x04, 0x69, 0xaf, 0xb5, 0x0f, 0xfb, 0xad, 0xfd, 0x0d, 0x00, 0x37, 0x39, 0xe0, + 0x1e, 0xfb, 0x93, 0xbc, 0xc7, 0xfe, 0x2e, 0x40, 0x98, 0x48, 0x92, 0xe0, 0xd3, 0xb0, 0x2a, 0x26, + 0x92, 0xe0, 0x49, 0x2e, 0x30, 0xe8, 0x9c, 0x0e, 0x68, 0x38, 0x41, 0x3b, 0xa6, 0x89, 0xa7, 0xfc, + 0x4d, 0xdc, 0x33, 0x36, 0xd5, 0x3b, 0xba, 0xa9, 0x97, 0x21, 0x4c, 0x67, 0x7e, 0xe4, 0x5d, 0xca, + 0x6f, 0x02, 0xd0, 0x6c, 0xbb, 0xa7, 0x6f, 0xf7, 0xdd, 0x06, 0x16, 0x47, 0x4b, 0x4e, 0x5e, 0xc0, + 0x15, 0xee, 0xe2, 0x22, 0xb4, 0xe0, 0xa2, 0x7a, 0xc4, 0xc8, 0x43, 0x30, 0x57, 0x85, 0x94, 0x1f, + 0x77, 0xf4, 0xdd, 0xd0, 0xe1, 0x9f, 0x07, 0x75, 0xbd, 0x23, 0xfe, 0x5c, 0x15, 0xfd, 0xc8, 0xbd, + 0x12, 0x80, 0xa4, 0x57, 0xf0, 0xfe, 0xf6, 0xb9, 0x20, 0xb9, 0x6f, 0x97, 0x20, 0xe6, 0x0c, 0xff, + 0x90, 0xc3, 0xce, 0xee, 0x1d, 0x61, 0x67, 0xf3, 0x82, 0x6d, 0x13, 0x05, 0x9d, 0x6d, 0xa2, 0xcb, + 0x8e, 0xf9, 0x1b, 0x97, 0x10, 0xf1, 0xf2, 0x5a, 0x1c, 0x38, 0xe4, 0xd6, 0xfe, 0xf2, 0x74, 0x57, + 0xf1, 0x16, 0x20, 0xec, 0xbd, 0x46, 0xc7, 0x3e, 0x72, 0x2d, 0xcf, 0x09, 0x23, 0xb6, 0x10, 0xbd, + 0x77, 0xf6, 0xa4, 0x23, 0xdf, 0xd9, 0x73, 0x5a, 0x09, 0x78, 0x5b, 0xf9, 0x5e, 0x09, 0x62, 0x62, + 0x4d, 0xa0, 0xf7, 0x78, 0x4f, 0x9e, 0x89, 0xad, 0xcd, 0xb1, 0xfa, 0x88, 0xd3, 0xf7, 0x1c, 0x3c, + 0x1b, 0x3a, 0x70, 0x1d, 0x3c, 0xea, 0x81, 0x6b, 0xee, 0xd9, 0xfd, 0x85, 0x04, 0xf2, 0xe0, 0x8a, + 0xfd, 0x9a, 0x7b, 0x37, 0x6c, 0xe6, 0x82, 0x23, 0xcc, 0xdc, 0xb8, 0x53, 0xd4, 0xa1, 0x71, 0xa7, + 0xa8, 0x87, 0x47, 0x1d, 0xbe, 0xc3, 0x51, 0xbf, 0x3f, 0x00, 0x09, 0x4f, 0x7a, 0x14, 0x3d, 0xee, + 0x3b, 0x91, 0xbd, 0x74, 0x58, 0x2a, 0xd5, 0x73, 0x24, 0xdb, 0xc7, 0xa6, 0xc0, 0xd1, 0xd9, 0xf4, + 0xf6, 0xdf, 0xce, 0x1a, 0x7d, 0x81, 0x35, 0x3c, 0xe6, 0x02, 0xeb, 0xb7, 0x49, 0x10, 0x73, 0xdc, + 0xee, 0xa3, 0x6e, 0x62, 0x1e, 0x87, 0x08, 0xf7, 0x2c, 0xd9, 0x2e, 0x26, 0xff, 0x1a, 0x99, 0x56, + 0xce, 0x42, 0xac, 0x83, 0x6d, 0x8d, 0xea, 0x41, 0x66, 0xd5, 0x9c, 0xef, 0xb3, 0x97, 0x20, 0xe1, + 0xd9, 0x00, 0x26, 0xaa, 0xb1, 0x5a, 0x7e, 0x4e, 0x9e, 0xc9, 0x46, 0x5f, 0xbd, 0xbd, 0x14, 0xac, + 0xe2, 0x97, 0xc8, 0x6a, 0x56, 0xca, 0xc5, 0xb5, 0x72, 0xf1, 0x19, 0x59, 0xca, 0x26, 0x5e, 0xbd, + 0xbd, 0x14, 0x55, 0x30, 0xcd, 0x28, 0x9e, 0x7d, 0x06, 0xd2, 0x03, 0x13, 0xe3, 0x77, 0x5b, 0x10, + 0xa4, 0x4a, 0x5b, 0x9b, 0xeb, 0x95, 0x62, 0xbe, 0x51, 0x56, 0xd9, 0xb9, 0x5d, 0x74, 0x02, 0xe6, + 0xd7, 0x2b, 0x57, 0xd7, 0x1a, 0x6a, 0x71, 0xbd, 0x52, 0xae, 0x36, 0xd4, 0x7c, 0xa3, 0x91, 0x2f, + 0x3e, 0x23, 0x07, 0x56, 0x6e, 0x27, 0x20, 0x94, 0x2f, 0x14, 0x2b, 0xa8, 0x08, 0x21, 0x9a, 0x0a, + 0x39, 0xf4, 0x04, 0x58, 0xf6, 0xf0, 0xdc, 0x30, 0xba, 0x02, 0x61, 0x9a, 0x25, 0x41, 0x87, 0x1f, + 0x09, 0xcb, 0x4e, 0x48, 0x16, 0x93, 0xce, 0xd0, 0x15, 0x79, 0xe8, 0x19, 0xb1, 0xec, 0xe1, 0xb9, + 0x63, 0xb4, 0x0e, 0x51, 0x11, 0x24, 0x4f, 0x3a, 0xb8, 0x95, 0x9d, 0x98, 0xd0, 0x25, 0x43, 0x63, + 0xc9, 0x86, 0xc3, 0x8f, 0x8f, 0x65, 0x27, 0x64, 0x95, 0x51, 0xc5, 0xb9, 0xcf, 0x34, 0xe1, 0x44, + 0x58, 0x76, 0x52, 0x9e, 0x18, 0x29, 0x10, 0x77, 0xd3, 0x38, 0x93, 0x0f, 0xc5, 0x65, 0xa7, 0x48, + 0x98, 0xa3, 0xf7, 0xc2, 0xac, 0x3f, 0xd4, 0x9d, 0xee, 0xd4, 0x59, 0x76, 0xca, 0x8c, 0x34, 0xa1, + 0xef, 0x8f, 0x7b, 0xa7, 0x3b, 0x85, 0x96, 0x9d, 0x32, 0x41, 0x8d, 0x5e, 0x84, 0xb9, 0xe1, 0xb8, + 0x74, 0xfa, 0x43, 0x69, 0xd9, 0x23, 0xa4, 0xac, 0x51, 0x07, 0xd0, 0x88, 0x78, 0xf6, 0x08, 0x67, + 0xd4, 0xb2, 0x47, 0xc9, 0x60, 0xa3, 0x16, 0xa4, 0x07, 0x83, 0xc4, 0x69, 0xcf, 0xac, 0x65, 0xa7, + 0xce, 0x66, 0xb3, 0x56, 0xfc, 0xc1, 0xe5, 0xb4, 0x67, 0xd8, 0xb2, 0x53, 0x27, 0xb7, 0xd1, 0x16, + 0x80, 0x27, 0x3e, 0x9c, 0xe2, 0x4c, 0x5b, 0x76, 0x9a, 0x34, 0x37, 0xea, 0xc2, 0xfc, 0xa8, 0xc0, + 0xf1, 0x28, 0x47, 0xdc, 0xb2, 0x47, 0xca, 0x7e, 0x13, 0x79, 0xf6, 0x87, 0x80, 0xd3, 0x1d, 0x79, + 0xcb, 0x4e, 0x99, 0x06, 0x2f, 0xe4, 0xc7, 0x9e, 0x73, 0x7e, 0xe0, 0xd0, 0x73, 0xce, 0xee, 0xc9, + 0x65, 0xe7, 0x6c, 0xf3, 0xbf, 0x39, 0x07, 0xef, 0xe2, 0x2f, 0xe8, 0x58, 0xb6, 0x76, 0x53, 0x37, + 0x76, 0x9d, 0x67, 0x96, 0xf8, 0x37, 0x3f, 0xe4, 0x7c, 0x9c, 0xbf, 0xd2, 0x23, 0x4a, 0x27, 0x3c, + 0xb6, 0x34, 0xf6, 0x8d, 0xce, 0x49, 0xf7, 0x21, 0x26, 0x1f, 0x5f, 0x3e, 0xe4, 0x21, 0xa7, 0x09, + 0xcf, 0x45, 0x8d, 0x78, 0xe8, 0x29, 0x7b, 0xe8, 0x1b, 0x03, 0xd9, 0xc3, 0xce, 0x7d, 0x13, 0x2f, + 0x36, 0xb5, 0xa6, 0x5b, 0xb6, 0xd9, 0xd3, 0x9b, 0x5a, 0x9b, 0x9a, 0x97, 0xcb, 0xd3, 0xde, 0xca, + 0x2a, 0xc4, 0x89, 0xbb, 0xc2, 0xdf, 0x82, 0xe2, 0x37, 0x85, 0x4a, 0x10, 0xb9, 0xa5, 0xb5, 0xd9, + 0x9d, 0x28, 0xef, 0x63, 0x72, 0x83, 0x3c, 0xf7, 0xf8, 0x51, 0x5e, 0x2a, 0x0c, 0x37, 0xf7, 0xfd, + 0xf4, 0x3e, 0x49, 0xa7, 0xa3, 0x5b, 0x44, 0x16, 0x15, 0x1a, 0x4a, 0x5f, 0x83, 0x50, 0x4f, 0xb3, + 0x79, 0x80, 0x59, 0xb8, 0x78, 0xe4, 0x77, 0x99, 0x58, 0x0b, 0x94, 0x06, 0x7a, 0x16, 0x62, 0x1d, + 0x6d, 0x5f, 0xa5, 0xf4, 0x02, 0x5f, 0x13, 0xbd, 0x68, 0x47, 0xdb, 0x27, 0xfd, 0x43, 0xef, 0xa5, + 0x3f, 0xd0, 0xa8, 0x36, 0xf7, 0x34, 0x63, 0x17, 0x33, 0xca, 0xc1, 0xaf, 0x89, 0xf2, 0x6c, 0x47, + 0xdb, 0x2f, 0x52, 0x6a, 0x84, 0x3e, 0x7f, 0xf2, 0xea, 0xd7, 0x24, 0x9e, 0x35, 0xa0, 0x8c, 0x41, + 0x1a, 0xc8, 0x4d, 0xe7, 0x8b, 0x36, 0x2a, 0xb6, 0x38, 0x1e, 0x18, 0xc7, 0xf7, 0x01, 0xb6, 0x16, + 0x66, 0x49, 0xf7, 0x3e, 0xff, 0xfa, 0xa2, 0xc4, 0x5a, 0x4d, 0x37, 0x87, 0xd8, 0x9e, 0x60, 0xc9, + 0x10, 0x95, 0xfa, 0xb0, 0x81, 0x89, 0x3e, 0xec, 0xac, 0xf0, 0x61, 0x19, 0x41, 0x60, 0xd8, 0xa4, + 0x9e, 0x8f, 0xe1, 0x53, 0x12, 0x24, 0x4a, 0x9e, 0x87, 0x2f, 0x33, 0x10, 0xed, 0x98, 0x86, 0x7e, + 0x13, 0xf7, 0x9c, 0x3d, 0x2a, 0xf6, 0x49, 0xfc, 0x4c, 0xf6, 0x13, 0xd4, 0xf6, 0x81, 0x78, 0x5d, + 0x48, 0x7c, 0x13, 0xac, 0x97, 0xf0, 0xb6, 0xa5, 0x0b, 0x3e, 0x2b, 0xe2, 0x13, 0x3d, 0x08, 0xb2, + 0x85, 0x9b, 0xfd, 0x9e, 0x6e, 0x1f, 0xa8, 0x4d, 0xd3, 0xb0, 0xb5, 0xa6, 0xcd, 0xe3, 0xf0, 0xb4, + 0x28, 0x2f, 0xb2, 0x62, 0x42, 0xa4, 0x85, 0x6d, 0x4d, 0x6f, 0xb3, 0x93, 0x99, 0x71, 0x45, 0x7c, + 0xf2, 0xae, 0xbe, 0x1a, 0xf5, 0xc6, 0xa1, 0x45, 0x90, 0xcd, 0x2e, 0xee, 0xf9, 0x0e, 0xa4, 0x30, + 0x69, 0xcc, 0xfc, 0xf6, 0x67, 0x1f, 0x59, 0xe0, 0x0c, 0xe7, 0x87, 0x19, 0xd8, 0xef, 0x3c, 0x28, + 0x69, 0x81, 0x21, 0x4e, 0xaa, 0xdc, 0xf0, 0xed, 0x4a, 0xf5, 0xb7, 0xdd, 0x67, 0x64, 0x16, 0x86, + 0x98, 0x9a, 0x37, 0x0e, 0x0a, 0x99, 0xcf, 0xb9, 0xa4, 0xdd, 0x38, 0xf5, 0x19, 0x7c, 0xe0, 0xdd, + 0xa2, 0xa2, 0x64, 0x88, 0x0b, 0xff, 0xa2, 0xa6, 0xb7, 0x71, 0x8b, 0xa7, 0x35, 0xf8, 0x17, 0x5a, + 0x75, 0xd2, 0x8b, 0xec, 0x57, 0x47, 0x73, 0xe3, 0x64, 0xa3, 0x60, 0x1a, 0x2d, 0x7f, 0x1e, 0x11, + 0x15, 0x21, 0x62, 0x9b, 0x37, 0xb1, 0xc1, 0x19, 0x74, 0xb4, 0xa7, 0xd5, 0x38, 0x2a, 0xfa, 0x46, + 0x90, 0x5b, 0xb8, 0x8d, 0x77, 0xd9, 0x7d, 0xc9, 0x3d, 0xad, 0x87, 0xd9, 0x6d, 0xfd, 0x3b, 0x7a, + 0x5e, 0x2d, 0xed, 0x90, 0xaa, 0x53, 0x4a, 0x68, 0xd3, 0xff, 0xb4, 0x6a, 0x94, 0x6f, 0x1e, 0x8f, + 0x19, 0xa3, 0x47, 0xf2, 0xbc, 0x9a, 0xc7, 0xf7, 0x14, 0xeb, 0x83, 0x20, 0xf7, 0x8d, 0x6d, 0xd3, + 0xa0, 0x3f, 0xa1, 0xc9, 0xa3, 0xa8, 0x18, 0xdb, 0xa9, 0x74, 0xca, 0xf9, 0x4e, 0xe5, 0x26, 0xa4, + 0x5c, 0x50, 0xba, 0x42, 0xe2, 0x47, 0x5d, 0x21, 0xb3, 0x0e, 0x01, 0x02, 0x82, 0x36, 0x00, 0xdc, + 0x35, 0x48, 0xb7, 0xca, 0x12, 0xe3, 0x67, 0xcc, 0x5d, 0xcd, 0xde, 0xc1, 0x78, 0x08, 0xa0, 0x6f, + 0x80, 0xf9, 0x8e, 0x6e, 0xa8, 0x16, 0x6e, 0xef, 0xa8, 0x9c, 0x73, 0x84, 0x6e, 0xe2, 0xe8, 0xb3, + 0x39, 0xd7, 0xd1, 0x8d, 0x3a, 0x6e, 0xef, 0x94, 0x1c, 0x2a, 0xe8, 0xdd, 0x70, 0xca, 0x1d, 0xbd, + 0x69, 0xa8, 0x7b, 0x66, 0xbb, 0xa5, 0xf6, 0xf0, 0x8e, 0xda, 0xa4, 0xef, 0xfc, 0x25, 0x29, 0xcf, + 0x4e, 0x38, 0x20, 0x35, 0x63, 0xcd, 0x6c, 0xb7, 0x14, 0xbc, 0x53, 0x24, 0xd5, 0xe8, 0x5e, 0x70, + 0x87, 0xae, 0xea, 0x2d, 0x2b, 0x33, 0xbb, 0x14, 0x3c, 0x13, 0x52, 0x92, 0x4e, 0x61, 0xa5, 0x65, + 0xad, 0xc6, 0x3e, 0xf8, 0x89, 0xc5, 0x99, 0x37, 0x3f, 0xb1, 0x38, 0x93, 0xbb, 0x42, 0xdf, 0x94, + 0xe2, 0xeb, 0x08, 0x5b, 0xe8, 0x22, 0xc4, 0x35, 0xf1, 0xc1, 0x6e, 0x8c, 0x1d, 0xb2, 0x0e, 0x5d, + 0xd0, 0xdc, 0x4f, 0x4a, 0x10, 0x29, 0x5d, 0xdf, 0xd4, 0xf4, 0x1e, 0x2a, 0xc3, 0x9c, 0x2b, 0x98, + 0xd3, 0x2e, 0x69, 0x57, 0x96, 0xc5, 0x9a, 0xae, 0x8e, 0x3b, 0xaa, 0x16, 0x2f, 0xdc, 0xf3, 0xdb, + 0x9f, 0x7d, 0xe4, 0x6e, 0x4e, 0xe6, 0xfa, 0xc0, 0xa9, 0x35, 0x41, 0x6f, 0xf0, 0x34, 0x9b, 0x67, + 0xcc, 0xd7, 0x20, 0xca, 0xba, 0x6a, 0xa1, 0xa7, 0x21, 0xdc, 0x25, 0x7f, 0xf0, 0x0c, 0xfc, 0xe9, + 0xb1, 0x02, 0x4e, 0xe1, 0xbd, 0xe2, 0xc0, 0xf0, 0x72, 0x1f, 0x0a, 0x00, 0x94, 0xae, 0x5f, 0x6f, + 0xf4, 0xf4, 0x6e, 0x1b, 0xdb, 0x6f, 0xd7, 0xd8, 0xb7, 0xe0, 0x98, 0xe7, 0x2e, 0x74, 0xaf, 0x79, + 0xf4, 0xf1, 0xcf, 0xbb, 0xd7, 0xa2, 0x7b, 0xcd, 0x91, 0x64, 0x5b, 0x96, 0xed, 0x90, 0x0d, 0x1e, + 0x9d, 0x6c, 0xc9, 0xb2, 0x87, 0x39, 0xfb, 0x3c, 0x24, 0x5c, 0x66, 0x58, 0xa8, 0x02, 0x31, 0x9b, + 0xff, 0xcd, 0x19, 0x9c, 0x1b, 0xcf, 0x60, 0x81, 0xe6, 0x65, 0xb2, 0x83, 0x9e, 0xfb, 0x2b, 0x09, + 0xc0, 0xb3, 0x46, 0xde, 0x99, 0x32, 0x46, 0xc2, 0x75, 0xae, 0x89, 0x83, 0x77, 0xfc, 0x1a, 0x27, + 0x23, 0xe0, 0x61, 0xea, 0x87, 0x03, 0x30, 0xbf, 0x25, 0x56, 0xef, 0x3b, 0x9f, 0x07, 0x5b, 0x10, + 0xc5, 0x86, 0xdd, 0xd3, 0x9d, 0x3d, 0xa4, 0x47, 0xc7, 0xcd, 0xf9, 0x88, 0x41, 0x95, 0x0d, 0xbb, + 0x77, 0xe0, 0x95, 0x00, 0x41, 0xcb, 0xc3, 0x8f, 0x8f, 0x06, 0x21, 0x33, 0x0e, 0x15, 0x3d, 0x00, + 0xe9, 0x66, 0x0f, 0xd3, 0x02, 0xff, 0x15, 0xd1, 0x94, 0x28, 0xe6, 0x36, 0x46, 0x01, 0xe2, 0x95, + 0x11, 0xe1, 0x22, 0xa0, 0x77, 0xe6, 0x86, 0xa5, 0x5c, 0x0a, 0xd4, 0xca, 0x34, 0x20, 0x2d, 0xee, + 0x9c, 0x6c, 0x6b, 0x6d, 0xcd, 0x68, 0x0a, 0x77, 0xf5, 0x48, 0x26, 0x41, 0xdc, 0x5b, 0x29, 0x30, + 0x12, 0xa8, 0x0c, 0x51, 0x41, 0x2d, 0x74, 0x74, 0x6a, 0x02, 0x17, 0xdd, 0x03, 0x49, 0xaf, 0x61, + 0xa0, 0xae, 0x47, 0x48, 0x49, 0x78, 0xec, 0xc2, 0x24, 0xcb, 0x13, 0x39, 0xd4, 0xf2, 0x70, 0xef, + 0xee, 0x87, 0xe9, 0xd1, 0xf0, 0xd6, 0xdf, 0xfc, 0x69, 0xd9, 0x04, 0x60, 0x4b, 0x95, 0x68, 0x52, + 0x3e, 0x33, 0x77, 0xb0, 0xde, 0xe3, 0x8c, 0x48, 0xc9, 0xb2, 0xff, 0xba, 0x66, 0xe8, 0x77, 0x03, + 0x90, 0xf4, 0xce, 0xd0, 0xdf, 0x4a, 0xa3, 0x85, 0xaa, 0xae, 0x9a, 0x62, 0xd7, 0x67, 0x1e, 0x1c, + 0xa7, 0xa6, 0x86, 0xa4, 0x79, 0x82, 0x7e, 0xfa, 0x58, 0x10, 0x22, 0xfc, 0x7c, 0x5b, 0x6d, 0xc8, + 0x91, 0x95, 0x26, 0x3d, 0x00, 0x30, 0x2b, 0x1e, 0x00, 0x18, 0xe9, 0xc7, 0xde, 0x07, 0x29, 0x12, + 0x10, 0xfb, 0x0e, 0xcd, 0x49, 0x67, 0x66, 0x69, 0x5c, 0xeb, 0x1e, 0x11, 0x47, 0x8b, 0x90, 0x20, + 0x60, 0xae, 0x1e, 0x26, 0x30, 0xd0, 0xd1, 0xf6, 0xcb, 0xac, 0x04, 0x3d, 0x02, 0x68, 0xcf, 0x49, + 0x50, 0xa8, 0x2e, 0x23, 0x08, 0xdc, 0x9c, 0x5b, 0x23, 0xc0, 0xef, 0x06, 0x20, 0xbd, 0x50, 0xd9, + 0x03, 0xd4, 0xfc, 0x79, 0x6f, 0x52, 0x52, 0xa2, 0x8f, 0x50, 0x7f, 0x40, 0x62, 0xfe, 0xf0, 0x40, + 0xd8, 0xcc, 0xc3, 0x91, 0xc6, 0x14, 0x8b, 0xe2, 0xcf, 0x5f, 0x5f, 0xcc, 0x1e, 0x68, 0x9d, 0xf6, + 0x6a, 0x6e, 0x04, 0x9d, 0xdc, 0xa8, 0x48, 0x9e, 0x38, 0xce, 0xfe, 0xb0, 0x7b, 0xf5, 0x5d, 0x44, + 0xbc, 0x5f, 0x7d, 0xe3, 0x67, 0xcf, 0x9e, 0xf2, 0xbc, 0xf9, 0xbc, 0xef, 0xa4, 0xaf, 0xd8, 0x9c, + 0x10, 0x4f, 0x15, 0xb9, 0x56, 0xc3, 0x39, 0x19, 0xbf, 0x01, 0xe0, 0xf1, 0xe4, 0xa5, 0xc3, 0x23, + 0x04, 0x17, 0xdf, 0x17, 0x21, 0x78, 0xd6, 0xd4, 0x7b, 0x5c, 0xa5, 0x2d, 0xde, 0x7c, 0x18, 0xf1, + 0x22, 0xf9, 0x72, 0xd1, 0xd4, 0x7d, 0x24, 0x04, 0x12, 0x5d, 0xaa, 0x33, 0xb9, 0x7f, 0x25, 0xc1, + 0xc9, 0x21, 0xf1, 0x73, 0xba, 0xdc, 0x04, 0xd4, 0xf3, 0x54, 0xd2, 0x69, 0x14, 0x5b, 0xb1, 0x77, + 0x26, 0xcd, 0x73, 0xbd, 0x21, 0xcd, 0xfd, 0xf6, 0x58, 0x1f, 0xae, 0x7a, 0x7e, 0x43, 0x82, 0x05, + 0x6f, 0x07, 0x9c, 0xa1, 0xd4, 0x21, 0xe9, 0x6d, 0x9a, 0x0f, 0xe2, 0x5d, 0xd3, 0x0c, 0xc2, 0xdb, + 0x7f, 0x1f, 0x11, 0x74, 0xdd, 0x5d, 0xe2, 0x2c, 0x6f, 0x76, 0x7e, 0x6a, 0xa6, 0x88, 0x8e, 0x8d, + 0x5c, 0xea, 0x6c, 0x6e, 0xfe, 0x48, 0x82, 0xd0, 0xa6, 0x69, 0xb6, 0xd1, 0xfb, 0x60, 0xce, 0x30, + 0x6d, 0x95, 0x2c, 0x07, 0xdc, 0x52, 0x79, 0x60, 0xcf, 0xd4, 0x67, 0xf9, 0x50, 0x5e, 0x7d, 0xe9, + 0xf5, 0xc5, 0x61, 0xcc, 0x51, 0x6f, 0xc2, 0xa7, 0x0d, 0xd3, 0x2e, 0x50, 0xa0, 0x06, 0x8b, 0xfd, + 0x77, 0x60, 0xd6, 0xdf, 0x1c, 0x53, 0xb1, 0xf9, 0x49, 0xcd, 0xcd, 0x4e, 0x6c, 0x2a, 0xb9, 0xed, + 0x69, 0x87, 0x3d, 0xa3, 0xfc, 0xa7, 0x64, 0xe6, 0x6e, 0x80, 0x7c, 0x7d, 0xf0, 0x88, 0x4f, 0x19, + 0xa2, 0xe2, 0x48, 0x8f, 0x34, 0xe5, 0x69, 0x21, 0x2f, 0x3b, 0x39, 0xee, 0xd9, 0x9f, 0x97, 0x00, + 0xdc, 0x24, 0x09, 0x7a, 0x18, 0x4e, 0x14, 0x6a, 0xd5, 0x92, 0x5a, 0x6f, 0xe4, 0x1b, 0x5b, 0x75, + 0xff, 0x6f, 0xad, 0x88, 0xf7, 0x87, 0xac, 0x2e, 0x6e, 0xea, 0x3b, 0x3a, 0x6e, 0xa1, 0xfb, 0x61, + 0xc1, 0x0f, 0x4d, 0xbe, 0xca, 0x25, 0x59, 0xca, 0x26, 0x5f, 0xbd, 0xbd, 0x14, 0x63, 0x7e, 0x22, + 0x6e, 0xa1, 0x33, 0x70, 0x6c, 0x18, 0xae, 0x52, 0xbd, 0x2a, 0x07, 0xb2, 0xb3, 0xaf, 0xde, 0x5e, + 0x8a, 0x3b, 0x0e, 0x25, 0xca, 0x01, 0xf2, 0x42, 0x72, 0x7a, 0xc1, 0x2c, 0xbc, 0x7a, 0x7b, 0x29, + 0xc2, 0x66, 0x21, 0x1b, 0xfa, 0xe0, 0x8f, 0x9e, 0x9e, 0x39, 0xfb, 0x4d, 0x00, 0x15, 0x63, 0xa7, + 0xa7, 0x35, 0xa9, 0xb4, 0x65, 0xe1, 0x78, 0xa5, 0x7a, 0x45, 0xc9, 0x17, 0x1b, 0x95, 0x5a, 0x75, + 0xe0, 0x27, 0x62, 0xfc, 0x75, 0xa5, 0xda, 0x56, 0x61, 0xbd, 0xac, 0xd6, 0x2b, 0x57, 0xab, 0x6c, + 0xb3, 0xd5, 0x57, 0xf7, 0x5c, 0xb5, 0x51, 0xd9, 0x28, 0xcb, 0x81, 0xc2, 0x95, 0xb1, 0xc9, 0xfc, + 0x87, 0x0f, 0x7d, 0xe5, 0xde, 0xd5, 0x78, 0xbe, 0x8c, 0xfe, 0xff, 0x0c, 0x00, 0x00, 0xff, 0xff, + 0x29, 0x2b, 0x22, 0x54, 0x7c, 0xb2, 0x00, 0x00, } r := bytes.NewReader(gzipped) gzipr, err := compress_gzip.NewReader(r) diff --git a/x/staking/types/tx.pb.go b/x/staking/types/tx.pb.go index bfbf16fc1b52..8442fbb99306 100644 --- a/x/staking/types/tx.pb.go +++ b/x/staking/types/tx.pb.go @@ -5,10 +5,10 @@ package types import ( context "context" + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-proto" types "github.com/cosmos/cosmos-sdk/codec/types" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types1 "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" @@ -40,9 +40,9 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // MsgCreateValidator defines a SDK message for creating a new validator. type MsgCreateValidator struct { - Description Description `protobuf:"bytes,1,opt,name=description,proto3" json:"description"` - Commission CommissionRates `protobuf:"bytes,2,opt,name=commission,proto3" json:"commission"` - MinSelfDelegation github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=min_self_delegation,json=minSelfDelegation,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_self_delegation"` + Description Description `protobuf:"bytes,1,opt,name=description,proto3" json:"description"` + Commission CommissionRates `protobuf:"bytes,2,opt,name=commission,proto3" json:"commission"` + MinSelfDelegation cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=min_self_delegation,json=minSelfDelegation,proto3,customtype=cosmossdk.io/math.Int" json:"min_self_delegation"` // Deprecated: Use of Delegator Address in MsgCreateValidator is deprecated. // The validator address bytes and delegator address bytes refer to the same account while creating validator (defer // only in bech32 notation). @@ -130,8 +130,8 @@ type MsgEditValidator struct { // it's not mandatory to update. If not updated, the deserialized rate will be // zero with no way to distinguish if an update was intended. // REF: #2373 - CommissionRate *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=commission_rate,json=commissionRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"commission_rate,omitempty"` - MinSelfDelegation *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=min_self_delegation,json=minSelfDelegation,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_self_delegation,omitempty"` + CommissionRate *cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=commission_rate,json=commissionRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"commission_rate,omitempty"` + MinSelfDelegation *cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=min_self_delegation,json=minSelfDelegation,proto3,customtype=cosmossdk.io/math.Int" json:"min_self_delegation,omitempty"` } func (m *MsgEditValidator) Reset() { *m = MsgEditValidator{} } @@ -669,78 +669,79 @@ func init() { func init() { proto.RegisterFile("cosmos/staking/v1beta1/tx.proto", fileDescriptor_0926ef28816b35ab) } var fileDescriptor_0926ef28816b35ab = []byte{ - // 1128 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x57, 0x4d, 0x6f, 0x1b, 0x45, - 0x18, 0xf6, 0xda, 0x8d, 0x21, 0x13, 0xf2, 0xb5, 0x49, 0x5a, 0x7b, 0x69, 0xed, 0xb2, 0x0d, 0x4d, - 0x14, 0xf0, 0x9a, 0x06, 0xc4, 0x87, 0xa9, 0x50, 0xe3, 0xba, 0x85, 0x82, 0x8c, 0xa2, 0x0d, 0xe1, - 0x80, 0x90, 0xac, 0xf1, 0xee, 0x64, 0xbd, 0x8a, 0x77, 0x67, 0xb3, 0x33, 0x8e, 0xea, 0x1b, 0xe2, - 0x04, 0x08, 0x89, 0xfe, 0x81, 0x4a, 0xe5, 0x06, 0xb7, 0x1c, 0xf2, 0x07, 0x38, 0x20, 0x55, 0x9c, - 0xaa, 0x9c, 0x10, 0x87, 0x82, 0x92, 0x43, 0xfa, 0x33, 0xd0, 0xee, 0xce, 0x7e, 0xfa, 0x33, 0x81, - 0x5e, 0x7a, 0x89, 0x9d, 0x99, 0xe7, 0x7d, 0xde, 0x8f, 0xe7, 0x7d, 0x67, 0xc6, 0xa0, 0xa8, 0x60, - 0x62, 0x60, 0x52, 0x26, 0x14, 0xee, 0xea, 0xa6, 0x56, 0xde, 0xbf, 0xd1, 0x44, 0x14, 0xde, 0x28, - 0xd3, 0xfb, 0x92, 0x65, 0x63, 0x8a, 0xf9, 0x8b, 0x1e, 0x40, 0x62, 0x00, 0x89, 0x01, 0x84, 0xbc, - 0x86, 0xb1, 0xd6, 0x46, 0x65, 0x17, 0xd5, 0xec, 0xec, 0x94, 0xa1, 0xd9, 0xf5, 0x4c, 0x84, 0x62, - 0x72, 0x8b, 0xea, 0x06, 0x22, 0x14, 0x1a, 0x16, 0x03, 0x2c, 0x6a, 0x58, 0xc3, 0xee, 0xd7, 0xb2, - 0xf3, 0x8d, 0xad, 0xe6, 0x3d, 0x4f, 0x0d, 0x6f, 0x83, 0xb9, 0xf5, 0xb6, 0x0a, 0x2c, 0xca, 0x26, - 0x24, 0x28, 0x08, 0x51, 0xc1, 0xba, 0xc9, 0xf6, 0x97, 0x07, 0x64, 0xe1, 0x07, 0xed, 0xa1, 0x2e, - 0x31, 0x94, 0x41, 0x1c, 0x84, 0xf3, 0xc1, 0x36, 0xe6, 0xa1, 0xa1, 0x9b, 0xb8, 0xec, 0xfe, 0xf5, - 0x96, 0xc4, 0x1f, 0x27, 0x00, 0x5f, 0x27, 0xda, 0x6d, 0x1b, 0x41, 0x8a, 0xbe, 0x84, 0x6d, 0x5d, - 0x85, 0x14, 0xdb, 0xfc, 0x26, 0x98, 0x52, 0x11, 0x51, 0x6c, 0xdd, 0xa2, 0x3a, 0x36, 0x73, 0xdc, - 0x55, 0x6e, 0x75, 0x6a, 0xfd, 0x9a, 0xd4, 0xbf, 0x46, 0x52, 0x2d, 0x84, 0x56, 0x27, 0x1f, 0x3f, - 0x2d, 0xa6, 0x7e, 0x39, 0x3d, 0x58, 0xe3, 0xe4, 0x28, 0x05, 0x2f, 0x03, 0xa0, 0x60, 0xc3, 0xd0, - 0x09, 0x71, 0x08, 0xd3, 0x2e, 0xe1, 0xca, 0x20, 0xc2, 0xdb, 0x01, 0x52, 0x86, 0x14, 0x91, 0x28, - 0x69, 0x84, 0x85, 0xdf, 0x03, 0x0b, 0x86, 0x6e, 0x36, 0x08, 0x6a, 0xef, 0x34, 0x54, 0xd4, 0x46, - 0x1a, 0x74, 0xa3, 0xcd, 0x5c, 0xe5, 0x56, 0x27, 0xab, 0x1b, 0x8e, 0xcd, 0x5f, 0x4f, 0x8b, 0xd7, - 0x35, 0x9d, 0xb6, 0x3a, 0x4d, 0x49, 0xc1, 0x06, 0x2b, 0x36, 0xfb, 0x28, 0x11, 0x75, 0xb7, 0x4c, - 0xbb, 0x16, 0x22, 0xd2, 0x3d, 0x93, 0x1e, 0x1d, 0x96, 0x00, 0x8b, 0xe6, 0x9e, 0x49, 0x3d, 0x5f, - 0xf3, 0x86, 0x6e, 0x6e, 0xa1, 0xf6, 0x4e, 0x2d, 0xe0, 0xe6, 0x3f, 0x06, 0xf3, 0xcc, 0x13, 0xb6, - 0x1b, 0x50, 0x55, 0x6d, 0x44, 0x48, 0xee, 0x82, 0xeb, 0x50, 0x38, 0x3a, 0x2c, 0x2d, 0x32, 0x8a, - 0x0d, 0x6f, 0x67, 0x8b, 0xda, 0xba, 0xa9, 0xe5, 0x38, 0x79, 0x2e, 0x30, 0x62, 0x3b, 0xfc, 0xe7, - 0x60, 0x7e, 0xdf, 0x2f, 0x77, 0x40, 0x34, 0xe1, 0x12, 0xbd, 0x76, 0x74, 0x58, 0xba, 0xc2, 0x88, - 0x02, 0x49, 0x62, 0x8c, 0xf2, 0xdc, 0x7e, 0x62, 0x9d, 0xbf, 0x0b, 0xb2, 0x56, 0xa7, 0xb9, 0x8b, - 0xba, 0xb9, 0xac, 0x5b, 0xdb, 0x45, 0xc9, 0xeb, 0x4e, 0xc9, 0xef, 0x4e, 0x69, 0xc3, 0xec, 0x56, - 0x73, 0x7f, 0x84, 0x31, 0x2a, 0x76, 0xd7, 0xa2, 0x58, 0xda, 0xec, 0x34, 0x3f, 0x43, 0x5d, 0x99, - 0x59, 0xf3, 0x15, 0x30, 0xb1, 0x0f, 0xdb, 0x1d, 0x94, 0x7b, 0xc9, 0xa5, 0xc9, 0xfb, 0x12, 0x39, - 0x2d, 0x19, 0xd1, 0x47, 0x8f, 0x29, 0xed, 0x99, 0x54, 0x6e, 0x7d, 0xf7, 0xa8, 0x98, 0x7a, 0xf6, - 0xa8, 0x98, 0xfa, 0xf6, 0xf4, 0x60, 0xad, 0x37, 0xbd, 0x1f, 0x4e, 0x0f, 0xd6, 0xae, 0x44, 0x6a, - 0xdf, 0xdb, 0x77, 0xe2, 0x65, 0x20, 0xf4, 0xae, 0xca, 0x88, 0x58, 0xd8, 0x24, 0x48, 0xfc, 0x2d, - 0x03, 0xe6, 0xea, 0x44, 0xbb, 0xa3, 0xea, 0xf4, 0x79, 0xb6, 0x6a, 0x5f, 0x69, 0xd2, 0xe7, 0x97, - 0x06, 0x82, 0xd9, 0xb0, 0x69, 0x1b, 0x36, 0xa4, 0x88, 0xb5, 0xe8, 0xfb, 0x63, 0xb6, 0x67, 0x0d, - 0x29, 0x91, 0xf6, 0xac, 0x21, 0x45, 0x9e, 0x51, 0x62, 0x13, 0xc2, 0xb7, 0xfa, 0x4f, 0xc2, 0x85, - 0x33, 0xb9, 0xe9, 0x99, 0x82, 0x3e, 0x03, 0x50, 0xf9, 0x68, 0xb4, 0xc6, 0xaf, 0xc6, 0x35, 0x8e, - 0xc9, 0x25, 0x0a, 0x20, 0x97, 0x5c, 0x0b, 0xf4, 0x7d, 0x98, 0x06, 0x53, 0x75, 0xa2, 0x31, 0x6f, - 0x88, 0xbf, 0xd3, 0x6f, 0xd8, 0x38, 0x37, 0xa7, 0xdc, 0xa0, 0x61, 0x1b, 0x77, 0xd4, 0xfe, 0x83, - 0x9e, 0x37, 0x41, 0x16, 0x1a, 0xb8, 0x63, 0x52, 0x57, 0xc6, 0x71, 0x67, 0x84, 0xd9, 0x54, 0x3e, - 0x88, 0x15, 0xb0, 0x27, 0x3f, 0xa7, 0x80, 0x17, 0xe3, 0x05, 0xf4, 0xeb, 0x21, 0x2e, 0x81, 0x85, - 0xc8, 0xbf, 0x41, 0xd9, 0xbe, 0xcf, 0xb8, 0x67, 0x78, 0x15, 0x69, 0xba, 0x29, 0x23, 0xf5, 0x7f, - 0xae, 0xde, 0x36, 0x58, 0x0a, 0xab, 0x47, 0x6c, 0xe5, 0xec, 0x15, 0x5c, 0x08, 0xec, 0xb7, 0x6c, - 0xa5, 0x2f, 0xad, 0x4a, 0x68, 0x40, 0x9b, 0x39, 0x3b, 0x6d, 0x8d, 0xd0, 0x5e, 0x6d, 0x2e, 0x9c, - 0x43, 0x9b, 0x5b, 0xa3, 0xb5, 0x49, 0x1c, 0x60, 0x89, 0xa2, 0x8b, 0x96, 0x7b, 0x80, 0x25, 0x56, - 0x7d, 0xa5, 0x78, 0xd9, 0x3d, 0x09, 0xac, 0x36, 0x72, 0x46, 0xa9, 0xe1, 0x3c, 0x17, 0xd8, 0x79, - 0x25, 0xf4, 0x9c, 0xd6, 0x5f, 0xf8, 0x6f, 0x89, 0xea, 0xb4, 0x13, 0xe7, 0x83, 0xbf, 0x8b, 0x9c, - 0x17, 0xeb, 0x4c, 0xc8, 0xe0, 0x60, 0xc4, 0x9f, 0xd3, 0x60, 0xba, 0x4e, 0xb4, 0x6d, 0x53, 0x7d, - 0xa1, 0xc7, 0xe6, 0xc3, 0xd1, 0xd2, 0xe4, 0xe2, 0xd2, 0x84, 0x15, 0x11, 0x7f, 0xe5, 0xc0, 0x52, - 0x6c, 0xe5, 0x79, 0x2a, 0x12, 0x49, 0x34, 0x7d, 0xf6, 0x44, 0xc5, 0x67, 0x69, 0x70, 0xd9, 0xb9, - 0x03, 0xa1, 0xa9, 0xa0, 0xf6, 0xb6, 0xd9, 0xc4, 0xa6, 0xaa, 0x9b, 0x5a, 0xe4, 0x09, 0xf2, 0x22, - 0xca, 0xcb, 0xaf, 0x80, 0x59, 0xc5, 0xb9, 0xf5, 0x1d, 0x15, 0x5a, 0x48, 0xd7, 0x5a, 0xde, 0x00, - 0x67, 0xe4, 0x19, 0x7f, 0xf9, 0x13, 0x77, 0xb5, 0xf2, 0xe9, 0xe8, 0x3e, 0x58, 0x49, 0xbc, 0x31, - 0x06, 0x55, 0x52, 0xbc, 0x0e, 0x96, 0x87, 0xed, 0x07, 0x07, 0xec, 0xef, 0x1c, 0x98, 0x75, 0xda, - 0xc7, 0x52, 0x21, 0x45, 0x9b, 0xd0, 0x86, 0x06, 0xe1, 0xdf, 0x05, 0x93, 0xb0, 0x43, 0x5b, 0xd8, - 0xd6, 0x69, 0x77, 0x64, 0xf5, 0x43, 0x28, 0xbf, 0x01, 0xb2, 0x96, 0xcb, 0xc0, 0x9a, 0xa3, 0x30, - 0xe8, 0xa5, 0xe2, 0xf9, 0x89, 0xd5, 0xca, 0x33, 0xac, 0xbc, 0xe7, 0xa4, 0x1e, 0x52, 0x3a, 0x29, - 0x2f, 0x47, 0x52, 0xbe, 0x1f, 0xfc, 0x3c, 0x48, 0xc4, 0x2c, 0xe6, 0xc1, 0xa5, 0xc4, 0x92, 0x9f, - 0xe2, 0xfa, 0xc3, 0x2c, 0xc8, 0xd4, 0x89, 0xc6, 0xef, 0x81, 0xd9, 0xe4, 0x6f, 0x81, 0xb5, 0x41, - 0x11, 0xf6, 0xbe, 0xd4, 0x84, 0xf5, 0xf1, 0xb1, 0xc1, 0x08, 0xee, 0x82, 0xe9, 0xf8, 0x8b, 0x6e, - 0x75, 0x08, 0x49, 0x0c, 0x29, 0xbc, 0x35, 0x2e, 0x32, 0x70, 0xf6, 0x35, 0x78, 0x39, 0x78, 0x5e, - 0x5c, 0x1b, 0x62, 0xed, 0x83, 0x84, 0x37, 0xc6, 0x00, 0x05, 0xec, 0x7b, 0x60, 0x36, 0x79, 0x0b, - 0x0f, 0xab, 0x5e, 0x02, 0x3b, 0xb4, 0x7a, 0x83, 0xae, 0x94, 0x26, 0x00, 0x91, 0xa3, 0xff, 0xf5, - 0x21, 0x0c, 0x21, 0x4c, 0x28, 0x8d, 0x05, 0x0b, 0x7c, 0xfc, 0xc4, 0x81, 0xfc, 0xe0, 0xf3, 0xe8, - 0x9d, 0x61, 0x9a, 0x0f, 0xb2, 0x12, 0x6e, 0x9e, 0xc7, 0x2a, 0x88, 0xa8, 0x05, 0x5e, 0x89, 0x4d, - 0xe3, 0xca, 0xb0, 0x84, 0x22, 0x40, 0xa1, 0x3c, 0x26, 0xd0, 0xf7, 0x24, 0x4c, 0x7c, 0xe3, 0xcc, - 0x5e, 0xf5, 0xee, 0xe3, 0xe3, 0x02, 0xf7, 0xe4, 0xb8, 0xc0, 0xfd, 0x73, 0x5c, 0xe0, 0x1e, 0x9c, - 0x14, 0x52, 0x4f, 0x4e, 0x0a, 0xa9, 0x3f, 0x4f, 0x0a, 0xa9, 0xaf, 0xde, 0x1c, 0xfa, 0xb2, 0x0e, - 0x87, 0xd1, 0x7d, 0x63, 0x37, 0xb3, 0xee, 0x75, 0xf2, 0xf6, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, - 0x4a, 0x8f, 0x88, 0xf2, 0x90, 0x10, 0x00, 0x00, + // 1142 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x57, 0x4f, 0x6f, 0xdc, 0x44, + 0x14, 0x5f, 0xef, 0x36, 0x0b, 0x99, 0x90, 0x7f, 0x4e, 0xd2, 0x6e, 0xdc, 0xb2, 0x5b, 0xdc, 0x40, + 0xa2, 0xc0, 0xda, 0x6d, 0x40, 0x20, 0x96, 0x0a, 0x35, 0xdb, 0xb4, 0x50, 0x60, 0x51, 0xe4, 0x90, + 0x22, 0x21, 0xa4, 0x65, 0xd6, 0x9e, 0x78, 0xad, 0x5d, 0x7b, 0x5c, 0xcf, 0x6c, 0xd4, 0xbd, 0x21, + 0x4e, 0xc0, 0x85, 0x7e, 0x81, 0x4a, 0xe5, 0x80, 0x04, 0xb7, 0x1c, 0xf2, 0x15, 0x90, 0x2a, 0x4e, + 0x55, 0x4e, 0xa8, 0x87, 0x80, 0x92, 0x43, 0xfa, 0x1d, 0xb8, 0x20, 0xdb, 0x63, 0xaf, 0xed, 0xfd, + 0x9b, 0x40, 0x2f, 0xbd, 0x24, 0xce, 0xcc, 0xef, 0xfd, 0xe6, 0xbd, 0xf7, 0x7b, 0x6f, 0xe6, 0x05, + 0x14, 0x54, 0x4c, 0x4c, 0x4c, 0x64, 0x42, 0x61, 0xc3, 0xb0, 0x74, 0x79, 0xf7, 0x5a, 0x0d, 0x51, + 0x78, 0x4d, 0xa6, 0xf7, 0x25, 0xdb, 0xc1, 0x14, 0xf3, 0xe7, 0x7d, 0x80, 0xc4, 0x00, 0x12, 0x03, + 0x08, 0x8b, 0x3a, 0xc6, 0x7a, 0x13, 0xc9, 0x1e, 0xaa, 0xd6, 0xda, 0x91, 0xa1, 0xd5, 0xf6, 0x4d, + 0x84, 0x42, 0x72, 0x8b, 0x1a, 0x26, 0x22, 0x14, 0x9a, 0x36, 0x03, 0xcc, 0xeb, 0x58, 0xc7, 0xde, + 0xa7, 0xec, 0x7e, 0xb1, 0xd5, 0x45, 0xff, 0xa4, 0xaa, 0xbf, 0xc1, 0x8e, 0xf5, 0xb7, 0xf2, 0xcc, + 0xcb, 0x1a, 0x24, 0x28, 0x74, 0x51, 0xc5, 0x86, 0xc5, 0xf6, 0x97, 0xfa, 0x44, 0x11, 0x38, 0xed, + 0xa3, 0x2e, 0x30, 0x94, 0x49, 0x5c, 0x84, 0xfb, 0x8b, 0x6d, 0xcc, 0x42, 0xd3, 0xb0, 0xb0, 0xec, + 0xfd, 0xf4, 0x97, 0xc4, 0x7f, 0xce, 0x01, 0xbe, 0x42, 0xf4, 0x9b, 0x0e, 0x82, 0x14, 0xdd, 0x85, + 0x4d, 0x43, 0x83, 0x14, 0x3b, 0xfc, 0x26, 0x98, 0xd0, 0x10, 0x51, 0x1d, 0xc3, 0xa6, 0x06, 0xb6, + 0x72, 0xdc, 0x65, 0x6e, 0x65, 0x62, 0xed, 0x8a, 0xd4, 0x3b, 0x47, 0xd2, 0x46, 0x07, 0x5a, 0x1e, + 0x7f, 0x7c, 0x58, 0x48, 0xfd, 0x7a, 0xb2, 0xb7, 0xca, 0x29, 0x51, 0x0a, 0x5e, 0x01, 0x40, 0xc5, + 0xa6, 0x69, 0x10, 0xe2, 0x12, 0xa6, 0x3d, 0xc2, 0xe5, 0x7e, 0x84, 0x37, 0x43, 0xa4, 0x02, 0x29, + 0x22, 0x51, 0xd2, 0x08, 0x0b, 0xff, 0x0d, 0x98, 0x33, 0x0d, 0xab, 0x4a, 0x50, 0x73, 0xa7, 0xaa, + 0xa1, 0x26, 0xd2, 0xa1, 0xe7, 0x6d, 0xe6, 0x32, 0xb7, 0x32, 0x5e, 0xbe, 0xea, 0xda, 0x3c, 0x3d, + 0x2c, 0x2c, 0xf8, 0x67, 0x10, 0xad, 0x21, 0x19, 0x58, 0x36, 0x21, 0xad, 0x4b, 0x77, 0x2c, 0x7a, + 0xb0, 0x5f, 0x04, 0xec, 0xf0, 0x3b, 0x16, 0xf5, 0xa9, 0x67, 0x4d, 0xc3, 0xda, 0x42, 0xcd, 0x9d, + 0x8d, 0x90, 0x8a, 0xff, 0x08, 0xcc, 0x32, 0x62, 0xec, 0x54, 0xa1, 0xa6, 0x39, 0x88, 0x90, 0xdc, + 0x39, 0x8f, 0x5f, 0x38, 0xd8, 0x2f, 0xce, 0x33, 0x8a, 0x75, 0x7f, 0x67, 0x8b, 0x3a, 0x86, 0xa5, + 0xe7, 0x38, 0x65, 0x26, 0x34, 0x62, 0x3b, 0xfc, 0xe7, 0x60, 0x76, 0x37, 0xc8, 0x6e, 0x48, 0x34, + 0xe6, 0x11, 0xbd, 0x76, 0xb0, 0x5f, 0x7c, 0x95, 0x11, 0x85, 0x0a, 0xc4, 0x18, 0x95, 0x99, 0xdd, + 0xc4, 0x3a, 0x7f, 0x1b, 0x64, 0xed, 0x56, 0xad, 0x81, 0xda, 0xb9, 0xac, 0x97, 0xca, 0x79, 0xc9, + 0x2f, 0x46, 0x29, 0x28, 0x46, 0x69, 0xdd, 0x6a, 0x97, 0x73, 0x7f, 0x74, 0x7c, 0x54, 0x9d, 0xb6, + 0x4d, 0xb1, 0xb4, 0xd9, 0xaa, 0x7d, 0x8a, 0xda, 0x0a, 0xb3, 0xe6, 0x4b, 0x60, 0x6c, 0x17, 0x36, + 0x5b, 0x28, 0xf7, 0x92, 0x47, 0xb3, 0x18, 0x28, 0xe2, 0x56, 0x60, 0x44, 0x0e, 0x23, 0x26, 0xac, + 0x6f, 0x52, 0xba, 0xf1, 0xfd, 0xa3, 0x42, 0xea, 0xd9, 0xa3, 0x42, 0xea, 0xbb, 0x93, 0xbd, 0xd5, + 0xee, 0xf0, 0x7e, 0x3c, 0xd9, 0x5b, 0x65, 0x71, 0x15, 0x89, 0xd6, 0x90, 0xbb, 0xcb, 0x4c, 0xbc, + 0x04, 0x84, 0xee, 0x55, 0x05, 0x11, 0x1b, 0x5b, 0x04, 0x89, 0xbf, 0x64, 0xc0, 0x4c, 0x85, 0xe8, + 0xb7, 0x34, 0x83, 0x3e, 0xcf, 0xca, 0xec, 0x29, 0x4d, 0xfa, 0xec, 0xd2, 0xdc, 0x05, 0xd3, 0x9d, + 0x1a, 0xad, 0x3a, 0x90, 0x22, 0x56, 0x91, 0xc5, 0xa7, 0x87, 0x85, 0x8b, 0xdd, 0xd5, 0xf8, 0x19, + 0xd2, 0xa1, 0xda, 0xde, 0x40, 0x6a, 0xa4, 0x26, 0x37, 0x90, 0xaa, 0x4c, 0xa9, 0xb1, 0x2e, 0xe0, + 0xbf, 0xec, 0x5d, 0xed, 0x7e, 0x35, 0x2e, 0x8f, 0x58, 0xe9, 0x3d, 0x8a, 0xbc, 0xf4, 0xe1, 0x70, + 0x1d, 0x2f, 0xc6, 0x75, 0x8c, 0x49, 0x22, 0x0a, 0x20, 0x97, 0x5c, 0x0b, 0x35, 0x7c, 0x98, 0x06, + 0x13, 0x15, 0xa2, 0xb3, 0xd3, 0x10, 0x7f, 0xab, 0x57, 0x43, 0x71, 0x5e, 0x08, 0xb9, 0x7e, 0x0d, + 0x35, 0x6a, 0x3b, 0xfd, 0x07, 0xcd, 0xae, 0x83, 0x2c, 0x34, 0x71, 0xcb, 0xa2, 0x9e, 0x54, 0xa3, + 0xf6, 0x01, 0xb3, 0x29, 0xbd, 0x1f, 0x4b, 0x60, 0x57, 0x7c, 0x6e, 0x02, 0xcf, 0xc7, 0x13, 0x18, + 0xe4, 0x43, 0x5c, 0x00, 0x73, 0x91, 0x3f, 0xc3, 0xb4, 0xfd, 0x90, 0xf1, 0xae, 0xe5, 0x32, 0xd2, + 0x0d, 0x4b, 0x41, 0xda, 0xff, 0x9c, 0xbd, 0x6d, 0xb0, 0xd0, 0xc9, 0x1e, 0x71, 0xd4, 0xd3, 0x67, + 0x70, 0x2e, 0xb4, 0xdf, 0x72, 0xd4, 0x9e, 0xb4, 0x1a, 0xa1, 0x21, 0x6d, 0xe6, 0xf4, 0xb4, 0x1b, + 0x84, 0x76, 0x6b, 0x73, 0xee, 0x0c, 0xda, 0xdc, 0x18, 0xae, 0x4d, 0xe2, 0x92, 0x4a, 0x24, 0x5d, + 0xb4, 0xbd, 0x4b, 0x2a, 0xb1, 0x1a, 0x28, 0xc5, 0x2b, 0x5e, 0xb7, 0xdb, 0x4d, 0xe4, 0xb6, 0x52, + 0xd5, 0x9d, 0x00, 0xd8, 0x9d, 0x24, 0x74, 0xdd, 0xc8, 0x5f, 0x04, 0xe3, 0x41, 0x79, 0xd2, 0xf5, + 0xf3, 0xc1, 0x5f, 0x05, 0xce, 0xf7, 0x75, 0xaa, 0xc3, 0xe0, 0x62, 0xc4, 0x9f, 0xd3, 0x60, 0xb2, + 0x42, 0xf4, 0x6d, 0x4b, 0x7b, 0xa1, 0xdb, 0xe6, 0x83, 0xe1, 0xd2, 0xe4, 0xe2, 0xd2, 0x74, 0x32, + 0x22, 0xfe, 0xc6, 0x81, 0x85, 0xd8, 0xca, 0xf3, 0x54, 0x24, 0x12, 0x68, 0xfa, 0xf4, 0x81, 0x8a, + 0xcf, 0xd2, 0xe0, 0x92, 0xfb, 0xce, 0x41, 0x4b, 0x45, 0xcd, 0x6d, 0xab, 0x86, 0x2d, 0xcd, 0xb0, + 0xf4, 0xc8, 0x98, 0xf1, 0x22, 0xca, 0xcb, 0x2f, 0x83, 0x69, 0xd5, 0x7d, 0xd9, 0x5d, 0x15, 0xea, + 0xc8, 0xd0, 0xeb, 0x7e, 0x03, 0x67, 0x94, 0xa9, 0x60, 0xf9, 0x63, 0x6f, 0xb5, 0xf4, 0xc9, 0xf0, + 0x3a, 0x58, 0x4e, 0xcc, 0x11, 0xfd, 0x32, 0x29, 0xbe, 0x01, 0x96, 0x06, 0xed, 0x87, 0x17, 0xec, + 0xef, 0x1c, 0x98, 0x76, 0xcb, 0xc7, 0xd6, 0x20, 0x45, 0x9b, 0xd0, 0x81, 0x26, 0xe1, 0xdf, 0x05, + 0xe3, 0xb0, 0x45, 0xeb, 0xd8, 0x31, 0x68, 0x7b, 0x68, 0xf6, 0x3b, 0x50, 0x7e, 0x1d, 0x64, 0x6d, + 0x8f, 0x81, 0x15, 0x47, 0xbe, 0xdf, 0x34, 0xe2, 0x9f, 0x13, 0xcb, 0x95, 0x6f, 0x58, 0x7a, 0xcf, + 0x0d, 0xbd, 0x43, 0xe9, 0x86, 0xbc, 0x14, 0x09, 0xf9, 0x7e, 0x38, 0xf1, 0x27, 0x7c, 0x16, 0x17, + 0xc1, 0x85, 0xc4, 0x52, 0x10, 0xe2, 0xda, 0xc3, 0x2c, 0xc8, 0x54, 0x88, 0xce, 0xdf, 0x03, 0xd3, + 0xc9, 0xf1, 0x7e, 0xb5, 0x9f, 0x87, 0xdd, 0xd3, 0x98, 0xb0, 0x36, 0x3a, 0x36, 0x6c, 0xc1, 0x06, + 0x98, 0x8c, 0x4f, 0x6d, 0x2b, 0x03, 0x48, 0x62, 0x48, 0xe1, 0xea, 0xa8, 0xc8, 0xf0, 0xb0, 0xaf, + 0xc1, 0xcb, 0xe1, 0x78, 0x71, 0x65, 0x80, 0x75, 0x00, 0x12, 0xde, 0x1c, 0x01, 0x14, 0xb2, 0xdf, + 0x03, 0xd3, 0xc9, 0x57, 0x78, 0x50, 0xf6, 0x12, 0xd8, 0x81, 0xd9, 0xeb, 0xf7, 0xa4, 0xd4, 0x00, + 0x88, 0x5c, 0xfd, 0xaf, 0x0f, 0x60, 0xe8, 0xc0, 0x84, 0xe2, 0x48, 0xb0, 0xf0, 0x8c, 0x9f, 0x38, + 0xb0, 0xd8, 0xff, 0x3e, 0x7a, 0x67, 0x90, 0xe6, 0xfd, 0xac, 0x84, 0xeb, 0x67, 0xb1, 0x0a, 0x3d, + 0xaa, 0x83, 0x57, 0x62, 0xdd, 0xb8, 0x3c, 0x28, 0xa0, 0x08, 0x50, 0x90, 0x47, 0x04, 0x06, 0x27, + 0x09, 0x63, 0xdf, 0xba, 0xbd, 0x57, 0xbe, 0xfd, 0xf8, 0x28, 0xcf, 0x3d, 0x39, 0xca, 0x73, 0x7f, + 0x1f, 0xe5, 0xb9, 0x07, 0xc7, 0xf9, 0xd4, 0x93, 0xe3, 0x7c, 0xea, 0xcf, 0xe3, 0x7c, 0xea, 0xab, + 0xb7, 0x74, 0x83, 0xd6, 0x5b, 0x35, 0x49, 0xc5, 0x26, 0xfb, 0xff, 0x5c, 0xee, 0xd9, 0x8c, 0xb4, + 0x6d, 0x23, 0x52, 0xcb, 0x7a, 0xcf, 0xc9, 0xdb, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xd6, 0x91, + 0x57, 0x78, 0x63, 0x10, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1032,6 +1033,7 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.staking.v1beta1.Msg", HandlerType: (*MsgServer)(nil), @@ -2342,7 +2344,7 @@ func (m *MsgEditValidator) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Dec + var v cosmossdk_io_math.LegacyDec m.CommissionRate = &v if err := m.CommissionRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2378,7 +2380,7 @@ func (m *MsgEditValidator) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int + var v cosmossdk_io_math.Int m.MinSelfDelegation = &v if err := m.MinSelfDelegation.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/x/staking/types/validator.go b/x/staking/types/validator.go index 15aabd7d847c..c2db50f5cf82 100644 --- a/x/staking/types/validator.go +++ b/x/staking/types/validator.go @@ -7,11 +7,13 @@ import ( "strings" "time" - "cosmossdk.io/errors" - "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" cmtprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" + "cosmossdk.io/core/address" + "cosmossdk.io/errors" + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" @@ -39,14 +41,14 @@ var ( var _ ValidatorI = Validator{} // NewValidator constructs a new Validator -func NewValidator(operator sdk.ValAddress, pubKey cryptotypes.PubKey, description Description) (Validator, error) { +func NewValidator(operator string, pubKey cryptotypes.PubKey, description Description) (Validator, error) { pkAny, err := codectypes.NewAnyWithValue(pubKey) if err != nil { return Validator{}, err } return Validator{ - OperatorAddress: operator.String(), + OperatorAddress: operator, ConsensusPubkey: pkAny, Jailed: false, Status: Unbonded, @@ -62,10 +64,13 @@ func NewValidator(operator sdk.ValAddress, pubKey cryptotypes.PubKey, descriptio } // Validators is a collection of Validator -type Validators []Validator +type Validators struct { + Validators []Validator + ValidatorCodec address.Codec +} func (v Validators) String() (out string) { - for _, val := range v { + for _, val := range v.Validators { out += val.String() + "\n" } @@ -74,7 +79,7 @@ func (v Validators) String() (out string) { // ToSDKValidators - convenience function convert []Validator to []sdk.ValidatorI func (v Validators) ToSDKValidators() (validators []ValidatorI) { - for _, val := range v { + for _, val := range v.Validators { validators = append(validators, val) } @@ -88,17 +93,26 @@ func (v Validators) Sort() { // Implements sort interface func (v Validators) Len() int { - return len(v) + return len(v.Validators) } // Implements sort interface func (v Validators) Less(i, j int) bool { - return bytes.Compare(v[i].GetOperator().Bytes(), v[j].GetOperator().Bytes()) == -1 + vi, err := v.ValidatorCodec.StringToBytes(v.Validators[i].GetOperator()) + if err != nil { + panic(err) + } + vj, err := v.ValidatorCodec.StringToBytes(v.Validators[j].GetOperator()) + if err != nil { + panic(err) + } + + return bytes.Compare(vi, vj) == -1 } // Implements sort interface func (v Validators) Swap(i, j int) { - v[i], v[j] = v[j], v[i] + v.Validators[i], v.Validators[j] = v.Validators[j], v.Validators[i] } // ValidatorsByVotingPower implements sort.Interface for []Validator based on @@ -128,8 +142,8 @@ func (valz ValidatorsByVotingPower) Swap(i, j int) { // UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces func (v Validators) UnpackInterfaces(c codectypes.AnyUnpacker) error { - for i := range v { - if err := v[i].UnpackInterfaces(c); err != nil { + for i := range v.Validators { + if err := v.Validators[i].UnpackInterfaces(c); err != nil { return err } } @@ -445,15 +459,8 @@ func (v *Validator) Equal(v2 *Validator) bool { func (v Validator) IsJailed() bool { return v.Jailed } func (v Validator) GetMoniker() string { return v.Description.Moniker } func (v Validator) GetStatus() BondStatus { return v.Status } -func (v Validator) GetOperator() sdk.ValAddress { - if v.OperatorAddress == "" { - return nil - } - addr, err := sdk.ValAddressFromBech32(v.OperatorAddress) - if err != nil { - panic(err) - } - return addr +func (v Validator) GetOperator() string { + return v.OperatorAddress } // ConsPubKey returns the validator PubKey as a cryptotypes.PubKey. @@ -487,13 +494,13 @@ func (v Validator) CmtConsPublicKey() (cmtprotocrypto.PublicKey, error) { } // GetConsAddr extracts Consensus key address -func (v Validator) GetConsAddr() (sdk.ConsAddress, error) { +func (v Validator) GetConsAddr() ([]byte, error) { pk, ok := v.ConsensusPubkey.GetCachedValue().(cryptotypes.PubKey) if !ok { return nil, errors.Wrapf(sdkerrors.ErrInvalidType, "expecting cryptotypes.PubKey, got %T", pk) } - return sdk.ConsAddress(pk.Address()), nil + return pk.Address().Bytes(), nil } func (v Validator) GetTokens() math.Int { return v.Tokens } diff --git a/x/staking/types/validator_test.go b/x/staking/types/validator_test.go index 441cd99ab1f0..ea0bc0e9427b 100644 --- a/x/staking/types/validator_test.go +++ b/x/staking/types/validator_test.go @@ -5,11 +5,13 @@ import ( "sort" "testing" - "cosmossdk.io/math" cmttypes "github.com/cometbft/cometbft/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "cosmossdk.io/math" + + "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/codec/legacy" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" @@ -255,7 +257,7 @@ func TestValidatorsSortDeterminism(t *testing.T) { } // Save sorted copy - sort.Sort(types.Validators(vals)) + sort.Sort(types.Validators{Validators: vals, ValidatorCodec: address.NewBech32Codec("cosmosvaloper")}) copy(sortedVals, vals) // Randomly shuffle validators, sort, and check it is equal to original sort @@ -264,7 +266,7 @@ func TestValidatorsSortDeterminism(t *testing.T) { vals[i], vals[j] = vals[j], vals[i] }) - types.Validators(vals).Sort() + types.Validators{Validators: vals, ValidatorCodec: address.NewBech32Codec("cosmosvaloper")}.Sort() require.Equal(t, sortedVals, vals, "Validator sort returned different slices") } } @@ -285,7 +287,7 @@ func TestValidatorsSortCometBFT(t *testing.T) { vals[i].Tokens = math.NewInt(1000000) } - valz := types.Validators(vals) + valz := types.Validators{Validators: vals, ValidatorCodec: address.NewBech32Codec("cosmosvaloper")} // create expected CometBFT validators by converting to CometBFT then sorting expectedVals, err := testutil.ToCmtValidators(valz, sdk.DefaultPowerReduction) @@ -293,8 +295,8 @@ func TestValidatorsSortCometBFT(t *testing.T) { sort.Sort(cmttypes.ValidatorsByVotingPower(expectedVals)) // sort in SDK and then convert to CometBFT - sort.SliceStable(valz, func(i, j int) bool { - return types.ValidatorsByVotingPower(valz).Less(i, j, sdk.DefaultPowerReduction) + sort.SliceStable(valz.Validators, func(i, j int) bool { + return types.ValidatorsByVotingPower(valz.Validators).Less(i, j, sdk.DefaultPowerReduction) }) actualVals, err := testutil.ToCmtValidators(valz, sdk.DefaultPowerReduction) require.NoError(t, err) @@ -303,15 +305,15 @@ func TestValidatorsSortCometBFT(t *testing.T) { } func TestValidatorToCmt(t *testing.T) { - vals := make(types.Validators, 10) + vals := types.Validators{} expected := make([]*cmttypes.Validator, 10) - for i := range vals { + for i := 0; i < 10; i++ { pk := ed25519.GenPrivKey().PubKey() val := newValidator(t, sdk.ValAddress(pk.Address()), pk) val.Status = types.Bonded val.Tokens = math.NewInt(rand.Int63()) - vals[i] = val + vals.Validators = append(vals.Validators, val) cmtPk, err := cryptocodec.ToCmtPubKeyInterface(pk) require.NoError(t, err) expected[i] = cmttypes.NewValidator(cmtPk, val.ConsensusPower(sdk.DefaultPowerReduction)) @@ -344,7 +346,8 @@ func mkValidator(tokens int64, shares math.LegacyDec) types.Validator { // Creates a new validators and asserts the error check. func newValidator(t *testing.T, operator sdk.ValAddress, pubKey cryptotypes.PubKey) types.Validator { - v, err := types.NewValidator(operator, pubKey, types.Description{}) + t.Helper() + v, err := types.NewValidator(operator.String(), pubKey, types.Description{}) require.NoError(t, err) return v } diff --git a/x/tx/CHANGELOG.md b/x/tx/CHANGELOG.md index 742122009eb3..56933dd0bbef 100644 --- a/x/tx/CHANGELOG.md +++ b/x/tx/CHANGELOG.md @@ -25,83 +25,78 @@ Types of changes (Stanzas): "Bug Fixes" for any bug fixes. "API Breaking" for breaking exported APIs used by developers building on SDK. Ref: https://keepachangelog.com/en/1.0.0/ + +Since v0.13.0, x/tx follows Cosmos SDK semver: https://github.com/cosmos/cosmos-sdk/blob/main/RELEASES.md --> # Changelog ## [Unreleased] -## v0.8.0 +## [v0.13.8](https://github.com/cosmos/cosmos-sdk/releases/tag/x/tx/v0.13.8) - 2025-01-28 -### Improvements +* [#23513](https://github.com/cosmos/cosmos-sdk/pull/23513), [#23539](https://github.com/cosmos/cosmos-sdk/pull/23539) Add map marshalling support (as option) to Amino JSON encoder. -* [#16340](https://github.com/cosmos/cosmos-sdk/pull/16340): add `DefineCustomGetSigners` API function. +## [v0.13.7](https://github.com/cosmos/cosmos-sdk/releases/tag/x/tx/v0.13.7) - 2024-12-16 -## v0.7.0 +* Fix [ABS-0043](https://github.com/cosmos/cosmos-sdk/security/advisories/GHSA-8wcc-m6j2-qxvm) Limit recursion depth for unknown field detection -### API Breaking +## [v0.13.6](https://github.com/cosmos/cosmos-sdk/releases/tag/x/tx/v0.13.6) - 2024-12-12 + +### Bug Fixes -* [#16044](https://github.com/cosmos/cosmos-sdk/pull/16044): rename aminojson.NewAminoJSON -> aminojson.NewEncoder. -* [#16047](https://github.com/cosmos/cosmos-sdk/pull/16047): aminojson.NewEncoder now takes EncoderOptions as an argument. -* [#16254](https://github.com/cosmos/cosmos-sdk/pull/16254): aminojson.Encoder.Marshal now sorts all fields like encoding/json.Marshal does, hence no more need for sdk.\*SortJSON. +* [#22161](https://github.com/cosmos/cosmos-sdk/pull/22161) Add special case for string represented decimals. +* [#21825](https://github.com/cosmos/cosmos-sdk/pull/21825) Fix decimal encoding and field ordering in Amino JSON encoder. +* [#21782](https://github.com/cosmos/cosmos-sdk/pull/21782) Fix JSON attribute sort order on messages with oneof fields. -## v0.6.2 +## [v0.13.5](https://github.com/cosmos/cosmos-sdk/releases/tag/x/tx/v0.13.5) - 2024-09-18 ### Improvements -* [#15873](https://github.com/cosmos/cosmos-sdk/pull/15873): add `Validate` method and only check for errors when `Validate` is explicitly called. +* [#21712](https://github.com/cosmos/cosmos-sdk/pull/21712) Add `AminoNameAsTypeURL` option to Amino JSON encoder. -## v0.6.1 +## [v0.13.4](https://github.com/cosmos/cosmos-sdk/releases/tag/x/tx/v0.13.4) - 2024-08-02 ### Improvements -* [#15871](https://github.com/cosmos/cosmos-sdk/pull/15871) - * `HandlerMap` now has a `DefaultMode()` getter method - * Textual types use `signing.ProtoFileResolver` instead of `protoregistry.Files` +* [#21073](https://github.com/cosmos/cosmos-sdk/pull/21073) In Context use sync.Map `getSignersFuncs` map from concurrent writes, we also call Validate when creating the Context. -## v0.6.0 +## [v0.13.3](https://github.com/cosmos/cosmos-sdk/releases/tag/x/tx/v0.13.3) - 2024-04-22 -### API Breaking +### Improvements -* [#15709](https://github.com/cosmos/cosmos-sdk/pull/15709): - * `GetSignersContext` has been renamed to `signing.Context` - * `GetSigners` now returns `[][]byte` instead of `[]string` - * `GetSignersOptions` has been renamed to `signing.Options` and requires `address.Codec`s for account and validator addresses - * `GetSignersOptions.ProtoFiles` has been renamed to `signing.Options.FileResolver` +* [#20049](https://github.com/cosmos/cosmos-sdk/pull/20049) Sort JSON attributes for `inline_json` encoder. -### Bug Fixes +## [v0.13.2](https://github.com/cosmos/cosmos-sdk/releases/tag/x/tx/v0.13.2) - 2024-04-12 -* [#15849](https://github.com/cosmos/cosmos-sdk/pull/15849) Fix int64 usage for 32 bit platforms. +### Features -## v0.5.1 +* [#19786](https://github.com/cosmos/cosmos-sdk/pull/19786)/[#19919](https://github.com/cosmos/cosmos-sdk/pull/19919) Add "inline_json" option to Amino JSON encoder. -### Features +### Improvements -* [#15414](https://github.com/cosmos/cosmos-sdk/pull/15414) Add basic transaction decoding support. +* [#19845](https://github.com/cosmos/cosmos-sdk/pull/19845) Use hybrid resolver instead of only protov2 registry -## v0.5.0 +### Bug Fixes -### API Breaking +* [#19955](https://github.com/cosmos/cosmos-sdk/pull/19955) Don't shadow Amino marshalling error messages -* [#15581](https://github.com/cosmos/cosmos-sdk/pull/15581) `GetSignersOptions` and `directaux.SignModeHandlerOptions` now -require a `signing.ProtoFileResolver` interface instead of `protodesc.Resolver`. -* [#15742](https://github.com/cosmos/cosmos-sdk/pull/15742) The `direct_aux` package has been renamed to `directaux` in line with Go conventions. No other types were changed during the package rename. -* [#15748](https://github.com/cosmos/cosmos-sdk/pull/15748) Rename signing.SignerData.ChainId to .ChainID, in line with Go conventions. +## [v0.13.1](https://github.com/cosmos/cosmos-sdk/releases/tag/x/tx/v0.13.1) - 2024-03-05 -### Bug Fixes +### Features -* (signing/textual) [#15730](https://github.com/cosmos/cosmos-sdk/pull/15730) make IntValueRenderer.Parse: gracefully handle "" + fuzz +* [#19618](https://github.com/cosmos/cosmos-sdk/pull/19618) Add enum as string option to encoder. -## v0.4.0 +### Improvements + +* [#18857](https://github.com/cosmos/cosmos-sdk/pull/18857) Moved `FormatCoins` from `core/coins` to this package under `signing/textual`. + +### Bug Fixes -### API Breaking +* [#19265](https://github.com/cosmos/cosmos-sdk/pull/19265) Reject denoms that contain a comma. -* [#13793](https://github.com/cosmos/cosmos-sdk/pull/13793) `direct_aux.NewSignModeHandler` constructor function now returns an additional error argument. -* [#15278](https://github.com/cosmos/cosmos-sdk/pull/15278) Move `x/tx/{textual,aminojson}` into `x/tx/signing`. -* [#15302](https://github.com/cosmos/cosmos-sdk/pull/15302) `textual.NewSignModeHandler` now takes an options struct instead of a simple coin querier argument. It also returns an error. +## [v0.13.0](https://github.com/cosmos/cosmos-sdk/releases/tag/x/tx/v0.13.0) - 2023-12-19 ### Improvements -* [#15302](https://github.com/cosmos/cosmos-sdk/pull/15302) Add support for a custom registry (e.g. gogo's MergedRegistry) to be plugged into SIGN_MODE_TEXTUAL. -* [#15557](https://github.com/cosmos/cosmos-sdk/pull/15557) Implement unknown field filtering. -* [#15515](https://github.com/cosmos/cosmos-sdk/pull/15515) Implement SIGN_MODE_LEGACY_AMINO_JSON handler. +* [#18740](https://github.com/cosmos/cosmos-sdk/pull/18740) Support nested messages when fetching signers up to a default depth of 32. diff --git a/x/tx/decode/adr027.go b/x/tx/decode/adr027.go index 0588acbaa9fd..f6d46c223be7 100644 --- a/x/tx/decode/adr027.go +++ b/x/tx/decode/adr027.go @@ -24,6 +24,14 @@ func rejectNonADR027TxRaw(txBytes []byte) error { if m < 0 { return fmt.Errorf("invalid length; %w", protowire.ParseError(m)) } + + // Paranoia from possible varint decoding which can trivially + // be wrong due to the precarious nature of the format being tricked: + // https://cyber.orijtech.com/advisory/varint-decode-limitless + if m > len(txBytes) { + return fmt.Errorf("invalid length from decoding (%d) > len(txBytes) (%d)", m, len(txBytes)) + } + // TxRaw only has bytes fields. if wireType != protowire.BytesType { return fmt.Errorf("expected %d wire type, got %d", protowire.BytesType, wireType) diff --git a/x/tx/decode/decode.go b/x/tx/decode/decode.go index d046a396d01e..4dafe9549af4 100644 --- a/x/tx/decode/decode.go +++ b/x/tx/decode/decode.go @@ -1,13 +1,13 @@ package decode import ( - "fmt" + "errors" - v1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" - "cosmossdk.io/errors" "github.com/cosmos/cosmos-proto/anyutil" "google.golang.org/protobuf/proto" + v1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" + errorsmod "cosmossdk.io/errors" "cosmossdk.io/x/tx/signing" ) @@ -33,7 +33,7 @@ type Options struct { // NewDecoder creates a new Decoder for decoding transactions. func NewDecoder(options Options) (*Decoder, error) { if options.SigningContext == nil { - return nil, fmt.Errorf("signing context is required") + return nil, errors.New("signing context is required") } return &Decoder{ @@ -46,7 +46,7 @@ func (d *Decoder) Decode(txBytes []byte) (*DecodedTx, error) { // Make sure txBytes follow ADR-027. err := rejectNonADR027TxRaw(txBytes) if err != nil { - return nil, errors.Wrap(ErrTxDecode, err.Error()) + return nil, errorsmod.Wrap(ErrTxDecode, err.Error()) } var raw v1beta1.TxRaw @@ -55,7 +55,7 @@ func (d *Decoder) Decode(txBytes []byte) (*DecodedTx, error) { fileResolver := d.signingCtx.FileResolver() err = RejectUnknownFieldsStrict(txBytes, raw.ProtoReflect().Descriptor(), fileResolver) if err != nil { - return nil, errors.Wrap(ErrTxDecode, err.Error()) + return nil, errorsmod.Wrap(ErrTxDecode, err.Error()) } err = proto.Unmarshal(txBytes, &raw) @@ -68,12 +68,12 @@ func (d *Decoder) Decode(txBytes []byte) (*DecodedTx, error) { // allow non-critical unknown fields in TxBody txBodyHasUnknownNonCriticals, err := RejectUnknownFields(raw.BodyBytes, body.ProtoReflect().Descriptor(), true, fileResolver) if err != nil { - return nil, errors.Wrap(ErrTxDecode, err.Error()) + return nil, errorsmod.Wrap(ErrTxDecode, err.Error()) } err = proto.Unmarshal(raw.BodyBytes, &body) if err != nil { - return nil, errors.Wrap(ErrTxDecode, err.Error()) + return nil, errorsmod.Wrap(ErrTxDecode, err.Error()) } var authInfo v1beta1.AuthInfo @@ -81,12 +81,12 @@ func (d *Decoder) Decode(txBytes []byte) (*DecodedTx, error) { // reject all unknown proto fields in AuthInfo err = RejectUnknownFieldsStrict(raw.AuthInfoBytes, authInfo.ProtoReflect().Descriptor(), fileResolver) if err != nil { - return nil, errors.Wrap(ErrTxDecode, err.Error()) + return nil, errorsmod.Wrap(ErrTxDecode, err.Error()) } err = proto.Unmarshal(raw.AuthInfoBytes, &authInfo) if err != nil { - return nil, errors.Wrap(ErrTxDecode, err.Error()) + return nil, errorsmod.Wrap(ErrTxDecode, err.Error()) } theTx := &v1beta1.Tx{ @@ -97,17 +97,25 @@ func (d *Decoder) Decode(txBytes []byte) (*DecodedTx, error) { var signers [][]byte var msgs []proto.Message + seenSigners := map[string]struct{}{} for _, anyMsg := range body.Messages { msg, signerErr := anyutil.Unpack(anyMsg, fileResolver, d.signingCtx.TypeResolver()) if signerErr != nil { - return nil, errors.Wrap(ErrTxDecode, signerErr.Error()) + return nil, errorsmod.Wrap(ErrTxDecode, signerErr.Error()) } msgs = append(msgs, msg) ss, signerErr := d.signingCtx.GetSigners(msg) if signerErr != nil { - return nil, errors.Wrap(ErrTxDecode, signerErr.Error()) + return nil, errorsmod.Wrap(ErrTxDecode, signerErr.Error()) + } + for _, s := range ss { + _, seen := seenSigners[string(s)] + if seen { + continue + } + signers = append(signers, s) + seenSigners[string(s)] = struct{}{} } - signers = append(signers, ss...) } return &DecodedTx{ diff --git a/x/tx/decode/decode_test.go b/x/tx/decode/decode_test.go index ac21431a50c0..a54702cbe9df 100644 --- a/x/tx/decode/decode_test.go +++ b/x/tx/decode/decode_test.go @@ -3,22 +3,22 @@ package decode_test import ( "encoding/hex" "fmt" + "strings" "testing" + "github.com/cosmos/cosmos-proto/anyutil" + "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/anypb" + bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" "cosmossdk.io/api/cosmos/crypto/secp256k1" signingv1beta1 "cosmossdk.io/api/cosmos/tx/signing/v1beta1" txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" - "cosmossdk.io/x/tx/decode" "cosmossdk.io/x/tx/internal/testpb" "cosmossdk.io/x/tx/signing" - - "github.com/cosmos/cosmos-proto/anyutil" - "github.com/stretchr/testify/require" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/known/anypb" ) func TestDecode(t *testing.T) { @@ -86,10 +86,6 @@ func TestDecode(t *testing.T) { Payer: "payer", Granter: "", }, - Tip: &txv1beta1.Tip{ - Amount: []*basev1beta1.Coin{{Amount: "100", Denom: "denom"}}, - Tipper: "tipper", - }, }, Signatures: nil, } @@ -119,3 +115,31 @@ func (d dummyAddressCodec) StringToBytes(text string) ([]byte, error) { func (d dummyAddressCodec) BytesToString(bz []byte) (string, error) { return hex.EncodeToString(bz), nil } + +func TestDecodeTxBodyPanic(t *testing.T) { + crashVector := []byte{ + 0x0a, 0x0a, 0x09, 0xe7, 0xbf, 0xba, 0xe6, 0x82, 0x9a, 0xe6, 0xaa, 0x30, + } + + cdc := new(dummyAddressCodec) + signingCtx, err := signing.NewContext(signing.Options{ + AddressCodec: cdc, + ValidatorAddressCodec: cdc, + }) + if err != nil { + t.Fatal(err) + } + dec, err := decode.NewDecoder(decode.Options{ + SigningContext: signingCtx, + }) + if err != nil { + t.Fatal(err) + } + _, err = dec.Decode(crashVector) + if err == nil { + t.Fatal("expected a non-nil error") + } + if g, w := err.Error(), "could not consume length prefix"; !strings.Contains(g, w) { + t.Fatalf("error mismatch\n%s\nodes not contain\n\t%q", g, w) + } +} diff --git a/x/tx/decode/fuzz_test.go b/x/tx/decode/fuzz_test.go new file mode 100644 index 000000000000..38262a20070f --- /dev/null +++ b/x/tx/decode/fuzz_test.go @@ -0,0 +1,140 @@ +package decode + +import ( + "encoding/hex" + "testing" + + "github.com/cosmos/cosmos-proto/anyutil" + fuzz "github.com/google/gofuzz" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/anypb" + + bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" + basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + "cosmossdk.io/api/cosmos/crypto/secp256k1" + signingv1beta1 "cosmossdk.io/api/cosmos/tx/signing/v1beta1" + txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" + "cosmossdk.io/x/tx/signing" +) + +var ( + accSeq = uint64(2) + + signerInfo = []*txv1beta1.SignerInfo{ + { + PublicKey: pkAny, + ModeInfo: &txv1beta1.ModeInfo{ + Sum: &txv1beta1.ModeInfo_Single_{ + Single: &txv1beta1.ModeInfo_Single{ + Mode: signingv1beta1.SignMode_SIGN_MODE_DIRECT, + }, + }, + }, + Sequence: accSeq, + }, + } + + anyMsg, _ = anyutil.New(&bankv1beta1.MsgSend{}) + + pkAny, _ = anyutil.New(&secp256k1.PubKey{Key: []byte("foo")}) +) + +func generateAndAddSeedsFromTx(f *testing.F) { + f.Helper() + // 1. Add some seeds. + tx := &txv1beta1.Tx{ + Body: &txv1beta1.TxBody{ + Messages: []*anypb.Any{anyMsg}, + Memo: "memo", + TimeoutHeight: 0, + }, + AuthInfo: &txv1beta1.AuthInfo{ + SignerInfos: signerInfo, + Fee: &txv1beta1.Fee{ + Amount: []*basev1beta1.Coin{{Amount: "100", Denom: "denom"}}, + GasLimit: 100, + Payer: "payer", + Granter: "", + }, + }, + Signatures: nil, + } + f.Add(mustMarshal(f, tx)) + fz := fuzz.New() + // 1.1. Mutate tx as much and add those as seeds. + for i := 0; i < 1e4; i++ { + func() { + defer func() { + _ = recover() // Catch any panics and continue + }() + fz.Fuzz(tx) + f.Add(mustMarshal(f, tx)) + }() + } +} + +func FuzzInternal_rejectNonADR027TxRaw(f *testing.F) { + if testing.Short() { + f.Skip("Skipping in -short mode") + } + + // 1. Add some seeds. + generateAndAddSeedsFromTx(f) + + // 2. Now run the fuzzer. + f.Fuzz(func(t *testing.T, in []byte) { + // Just ensure it doesn't crash. + _ = rejectNonADR027TxRaw(in) + }) +} + +func FuzzDecode(f *testing.F) { + if testing.Short() { + f.Skip("Skipping in -short mode") + } + + // 1. Add some seeds. + generateAndAddSeedsFromTx(f) + + // 2. Now fuzz it. + cdc := new(asHexCodec) + signingCtx, err := signing.NewContext(signing.Options{ + AddressCodec: cdc, + ValidatorAddressCodec: cdc, + }) + if err != nil { + return + } + dec, err := NewDecoder(Options{ + SigningContext: signingCtx, + }) + if err != nil { + return + } + + f.Fuzz(func(t *testing.T, in []byte) { + txr, err := dec.Decode(in) + if err == nil && txr == nil { + t.Fatal("inconsistency: err==nil yet tx==nil") + } + }) +} + +func mustMarshal(f *testing.F, m proto.Message) []byte { + f.Helper() + blob, err := proto.Marshal(m) + if err != nil { + f.Fatal(err) + } + return blob +} + +type asHexCodec int + +func (d asHexCodec) StringToBytes(text string) ([]byte, error) { + return hex.DecodeString(text) +} + +func (d asHexCodec) BytesToString(bz []byte) (string, error) { + return hex.EncodeToString(bz), nil +} diff --git a/x/tx/decode/unknown.go b/x/tx/decode/unknown.go index ed6c56400b9a..acc994f87a18 100644 --- a/x/tx/decode/unknown.go +++ b/x/tx/decode/unknown.go @@ -33,9 +33,23 @@ func RejectUnknownFieldsStrict(bz []byte, msg protoreflect.MessageDescriptor, re // This function traverses inside of messages nested via google.protobuf.Any. It does not do any deserialization of the proto.Message. // An AnyResolver must be provided for traversing inside google.protobuf.Any's. func RejectUnknownFields(bz []byte, desc protoreflect.MessageDescriptor, allowUnknownNonCriticals bool, resolver protodesc.Resolver) (hasUnknownNonCriticals bool, err error) { + // recursion limit with same default as https://github.com/protocolbuffers/protobuf-go/blob/v1.35.2/encoding/protowire/wire.go#L28 + return doRejectUnknownFields(bz, desc, allowUnknownNonCriticals, resolver, 10_000) +} + +func doRejectUnknownFields( + bz []byte, + desc protoreflect.MessageDescriptor, + allowUnknownNonCriticals bool, + resolver protodesc.Resolver, + recursionLimit int, +) (hasUnknownNonCriticals bool, err error) { if len(bz) == 0 { return hasUnknownNonCriticals, nil } + if recursionLimit == 0 { + return false, errors.New("recursion limit reached") + } fields := desc.Fields() @@ -85,13 +99,22 @@ func RejectUnknownFields(bz []byte, desc protoreflect.MessageDescriptor, allowUn // consume length prefix of nested message _, o := protowire.ConsumeVarint(fieldBytes) + if o < 0 { + err = fmt.Errorf("could not consume length prefix fieldBytes for nested message: %v: %w", + fieldMessage, protowire.ParseError(o)) + return hasUnknownNonCriticals, err + } else if o > len(fieldBytes) { + err = fmt.Errorf("length prefix > len(fieldBytes) for nested message: %v", fieldMessage) + return hasUnknownNonCriticals, err + } + fieldBytes = fieldBytes[o:] var err error if fieldMessage.FullName() == anyFullName { // Firstly typecheck types.Any to ensure nothing snuck in. - hasUnknownNonCriticalsChild, err := RejectUnknownFields(fieldBytes, anyDesc, allowUnknownNonCriticals, resolver) + hasUnknownNonCriticalsChild, err := doRejectUnknownFields(fieldBytes, anyDesc, allowUnknownNonCriticals, resolver, recursionLimit-1) hasUnknownNonCriticals = hasUnknownNonCriticals || hasUnknownNonCriticalsChild if err != nil { return hasUnknownNonCriticals, err @@ -111,7 +134,7 @@ func RejectUnknownFields(bz []byte, desc protoreflect.MessageDescriptor, allowUn fieldBytes = a.Value } - hasUnknownNonCriticalsChild, err := RejectUnknownFields(fieldBytes, fieldMessage, allowUnknownNonCriticals, resolver) + hasUnknownNonCriticalsChild, err := doRejectUnknownFields(fieldBytes, fieldMessage, allowUnknownNonCriticals, resolver, recursionLimit-1) hasUnknownNonCriticals = hasUnknownNonCriticals || hasUnknownNonCriticalsChild if err != nil { return hasUnknownNonCriticals, err diff --git a/x/tx/go.mod b/x/tx/go.mod index 10f960298fc2..2ef01735ca34 100644 --- a/x/tx/go.mod +++ b/x/tx/go.mod @@ -1,33 +1,41 @@ module cosmossdk.io/x/tx -go 1.20 +go 1.23 require ( - cosmossdk.io/api v0.4.2 - cosmossdk.io/core v0.8.0 - cosmossdk.io/errors v1.0.0-beta.7 - cosmossdk.io/math v1.0.1 - github.com/cosmos/cosmos-proto v1.0.0-beta.3 - github.com/google/go-cmp v0.5.9 - github.com/iancoleman/strcase v0.2.0 + cosmossdk.io/api v0.7.6 + cosmossdk.io/core v0.11.0 + cosmossdk.io/errors v1.0.1 + cosmossdk.io/math v1.5.0 + github.com/cosmos/cosmos-proto v1.0.0-beta.5 + github.com/cosmos/gogoproto v1.7.0 + github.com/google/go-cmp v0.7.0 + github.com/google/gofuzz v1.2.0 + github.com/iancoleman/strcase v0.3.0 github.com/pkg/errors v0.9.1 - github.com/stretchr/testify v1.8.4 + github.com/stretchr/testify v1.10.0 github.com/tendermint/go-amino v0.16.0 - google.golang.org/protobuf v1.30.0 - gotest.tools/v3 v3.4.0 - pgregory.net/rapid v0.6.2 + google.golang.org/protobuf v1.36.5 + gotest.tools/v3 v3.5.2 + pgregory.net/rapid v1.1.0 ) require ( - github.com/cosmos/gogoproto v1.4.10 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/golang/protobuf v1.5.3 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/text v0.9.0 // indirect - google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect - google.golang.org/grpc v1.55.0 // indirect + github.com/cockroachdb/apd/v3 v3.2.1 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 // indirect + golang.org/x/net v0.35.0 // indirect + golang.org/x/sys v0.30.0 // indirect + golang.org/x/text v0.22.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20250212204824-5a70512c5d8b // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250212204824-5a70512c5d8b // indirect + google.golang.org/grpc v1.71.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace cosmossdk.io/api => ../../api + +// NOTE: we do not want to replace to the development version of cosmossdk.io/api yet +// Until https://github.com/cosmos/cosmos-sdk/issues/19228 is resolved +// We are tagging x/tx v0.14+ from main and v0.13 from release/v0.50.x and must keep using released versions of x/tx dependencies diff --git a/x/tx/go.sum b/x/tx/go.sum index 6463adde4168..9df1eed56da5 100644 --- a/x/tx/go.sum +++ b/x/tx/go.sum @@ -1,92 +1,94 @@ -cosmossdk.io/api v0.4.2 h1:lQBMl4xINnMnBOR/tQLtjlDnR4exr4e6/SfHR8PILE0= -cosmossdk.io/api v0.4.2/go.mod h1:qrVgOp7DIeAXa+Tt5dDjOC47bZCDrwx8ZHxrmy7STNE= -cosmossdk.io/core v0.8.0 h1:LcJnu52E1a8f8E317VfQ1xK/RZe+IuhMNQAjnDLh25M= -cosmossdk.io/core v0.8.0/go.mod h1:LF6VLOv2DdCiaHxYVmr0MZcZpaSM9ZgvyrQSYTeg6D0= -cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= -cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= -cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= -cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= -github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= -github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoKuI= -github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= +cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= +cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= +cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= +cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= +cosmossdk.io/math v1.5.0 h1:sbOASxee9Zxdjd6OkzogvBZ25/hP929vdcYcBJQbkLc= +cosmossdk.io/math v1.5.0/go.mod h1:AAwwBmUhqtk2nlku174JwSll+/DepUXW3rWIXN5q+Nw= +github.com/cockroachdb/apd/v3 v3.2.1 h1:U+8j7t0axsIgvQUqthuNm82HIrYXodOV2iWLWtEaIwg= +github.com/cockroachdb/apd/v3 v3.2.1/go.mod h1:klXJcjp+FffLTHlhIG69tezTDvdP065naDsHzKhYSqc= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +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/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf h1:+RRA9JqSOZFfKrOeqr2z77+8R2RKyh8PG66dcu1V0ck= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= -github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= -github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= +github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= 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/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= +go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= +go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY= +go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI= +go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ= +go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE= +go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A= +go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU= +go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk= +go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w= +go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k= +go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 h1:985EYyeCOxTpcgOTJpflJUwOeEz0CQOdPt73OzpE9F8= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= +golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -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= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= +golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= +golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= -google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/genproto/googleapis/api v0.0.0-20250212204824-5a70512c5d8b h1:i+d0RZa8Hs2L/MuaOQYI+krthcxdEbEM2N+Tf3kJ4zk= +google.golang.org/genproto/googleapis/api v0.0.0-20250212204824-5a70512c5d8b/go.mod h1:iYONQfRdizDB8JJBybql13nArx91jcUk7zCXEsOofM4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250212204824-5a70512c5d8b h1:FQtJ1MxbXoIIrZHZ33M+w5+dAP9o86rgpjoKr/ZmT7k= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250212204824-5a70512c5d8b/go.mod h1:8BS3B93F/U1juMFq9+EDk+qOT5CO1R9IzXxG3PTqiRk= +google.golang.org/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg= +google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec= +google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= +google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= -gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= -pgregory.net/rapid v0.6.2 h1:ErW5sL+UKtfBfUTsWHDCoeB+eZKLKMxrSd1VJY6W4bw= -pgregory.net/rapid v0.6.2/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= +gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q= +gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA= +pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= +pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/x/tx/internal/testpb/signers.proto b/x/tx/internal/testpb/signers.proto index 3104bf5d19fe..63eb38cba43b 100644 --- a/x/tx/internal/testpb/signers.proto +++ b/x/tx/internal/testpb/signers.proto @@ -55,6 +55,41 @@ message RepeatedNestedRepeatedSigner { } } +message DeeplyNestedSigner { + option (cosmos.msg.v1.signer) = "inner_one"; + InnerOne inner_one = 1; + + message InnerOne { + option (cosmos.msg.v1.signer) = "inner_two"; + InnerTwo inner_two = 1; + + message InnerTwo { + option (cosmos.msg.v1.signer) = "signer"; + string signer = 1; + } + } +} + +message DeeplyNestedRepeatedSigner { + option (cosmos.msg.v1.signer) = "inner"; + repeated Inner inner = 1; + + message Inner { + option (cosmos.msg.v1.signer) = "inner"; + repeated Inner inner = 1; + + message Inner { + option (cosmos.msg.v1.signer) = "inner"; + repeated Bottom inner = 1; + + message Bottom { + option (cosmos.msg.v1.signer) = "signer"; + repeated string signer = 1; + } + } + } +} + message BadSigner { option (cosmos.msg.v1.signer) = "signer"; bytes signer = 1; diff --git a/x/tx/internal/testpb/signers.pulsar.go b/x/tx/internal/testpb/signers.pulsar.go index 51c8cf163e39..f6e3a3d081c1 100644 --- a/x/tx/internal/testpb/signers.pulsar.go +++ b/x/tx/internal/testpb/signers.pulsar.go @@ -1369,7 +1369,7 @@ func (x *NestedSigner_Inner) ProtoReflect() protoreflect.Message { } func (x *NestedSigner_Inner) slowProtoReflect() protoreflect.Message { - mi := &file_signers_proto_msgTypes[9] + mi := &file_signers_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2283,7 +2283,7 @@ func (x *RepeatedNestedSigner_Inner) ProtoReflect() protoreflect.Message { } func (x *RepeatedNestedSigner_Inner) slowProtoReflect() protoreflect.Message { - mi := &file_signers_proto_msgTypes[10] + mi := &file_signers_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3184,7 +3184,7 @@ func (x *NestedRepeatedSigner_Inner) ProtoReflect() protoreflect.Message { } func (x *NestedRepeatedSigner_Inner) slowProtoReflect() protoreflect.Message { - mi := &file_signers_proto_msgTypes[11] + mi := &file_signers_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4158,7 +4158,7 @@ func (x *RepeatedNestedRepeatedSigner_Inner) ProtoReflect() protoreflect.Message } func (x *RepeatedNestedRepeatedSigner_Inner) slowProtoReflect() protoreflect.Message { - mi := &file_signers_proto_msgTypes[12] + mi := &file_signers_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4573,25 +4573,25 @@ func (x *fastReflection_RepeatedNestedRepeatedSigner_Inner) ProtoMethods() *prot } var ( - md_BadSigner protoreflect.MessageDescriptor - fd_BadSigner_signer protoreflect.FieldDescriptor + md_DeeplyNestedSigner protoreflect.MessageDescriptor + fd_DeeplyNestedSigner_inner_one protoreflect.FieldDescriptor ) func init() { file_signers_proto_init() - md_BadSigner = File_signers_proto.Messages().ByName("BadSigner") - fd_BadSigner_signer = md_BadSigner.Fields().ByName("signer") + md_DeeplyNestedSigner = File_signers_proto.Messages().ByName("DeeplyNestedSigner") + fd_DeeplyNestedSigner_inner_one = md_DeeplyNestedSigner.Fields().ByName("inner_one") } -var _ protoreflect.Message = (*fastReflection_BadSigner)(nil) +var _ protoreflect.Message = (*fastReflection_DeeplyNestedSigner)(nil) -type fastReflection_BadSigner BadSigner +type fastReflection_DeeplyNestedSigner DeeplyNestedSigner -func (x *BadSigner) ProtoReflect() protoreflect.Message { - return (*fastReflection_BadSigner)(x) +func (x *DeeplyNestedSigner) ProtoReflect() protoreflect.Message { + return (*fastReflection_DeeplyNestedSigner)(x) } -func (x *BadSigner) slowProtoReflect() protoreflect.Message { +func (x *DeeplyNestedSigner) slowProtoReflect() protoreflect.Message { mi := &file_signers_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -4603,43 +4603,43 @@ func (x *BadSigner) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_BadSigner_messageType fastReflection_BadSigner_messageType -var _ protoreflect.MessageType = fastReflection_BadSigner_messageType{} +var _fastReflection_DeeplyNestedSigner_messageType fastReflection_DeeplyNestedSigner_messageType +var _ protoreflect.MessageType = fastReflection_DeeplyNestedSigner_messageType{} -type fastReflection_BadSigner_messageType struct{} +type fastReflection_DeeplyNestedSigner_messageType struct{} -func (x fastReflection_BadSigner_messageType) Zero() protoreflect.Message { - return (*fastReflection_BadSigner)(nil) +func (x fastReflection_DeeplyNestedSigner_messageType) Zero() protoreflect.Message { + return (*fastReflection_DeeplyNestedSigner)(nil) } -func (x fastReflection_BadSigner_messageType) New() protoreflect.Message { - return new(fastReflection_BadSigner) +func (x fastReflection_DeeplyNestedSigner_messageType) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedSigner) } -func (x fastReflection_BadSigner_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_BadSigner +func (x fastReflection_DeeplyNestedSigner_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedSigner } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_BadSigner) Descriptor() protoreflect.MessageDescriptor { - return md_BadSigner +func (x *fastReflection_DeeplyNestedSigner) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedSigner } // 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_BadSigner) Type() protoreflect.MessageType { - return _fastReflection_BadSigner_messageType +func (x *fastReflection_DeeplyNestedSigner) Type() protoreflect.MessageType { + return _fastReflection_DeeplyNestedSigner_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_BadSigner) New() protoreflect.Message { - return new(fastReflection_BadSigner) +func (x *fastReflection_DeeplyNestedSigner) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedSigner) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_BadSigner) Interface() protoreflect.ProtoMessage { - return (*BadSigner)(x) +func (x *fastReflection_DeeplyNestedSigner) Interface() protoreflect.ProtoMessage { + return (*DeeplyNestedSigner)(x) } // Range iterates over every populated field in an undefined order, @@ -4647,10 +4647,10 @@ func (x *fastReflection_BadSigner) 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_BadSigner) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.Signer) != 0 { - value := protoreflect.ValueOfBytes(x.Signer) - if !f(fd_BadSigner_signer, value) { +func (x *fastReflection_DeeplyNestedSigner) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.InnerOne != nil { + value := protoreflect.ValueOfMessage(x.InnerOne.ProtoReflect()) + if !f(fd_DeeplyNestedSigner_inner_one, value) { return } } @@ -4667,15 +4667,15 @@ func (x *fastReflection_BadSigner) Range(f func(protoreflect.FieldDescriptor, pr // 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_BadSigner) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_DeeplyNestedSigner) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "BadSigner.signer": - return len(x.Signer) != 0 + case "DeeplyNestedSigner.inner_one": + return x.InnerOne != nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner")) } - panic(fmt.Errorf("message BadSigner does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner does not contain field %s", fd.FullName())) } } @@ -4685,15 +4685,15 @@ func (x *fastReflection_BadSigner) Has(fd protoreflect.FieldDescriptor) bool { // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_BadSigner) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_DeeplyNestedSigner) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "BadSigner.signer": - x.Signer = nil + case "DeeplyNestedSigner.inner_one": + x.InnerOne = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner")) } - panic(fmt.Errorf("message BadSigner does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner does not contain field %s", fd.FullName())) } } @@ -4703,16 +4703,16 @@ func (x *fastReflection_BadSigner) 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_BadSigner) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_DeeplyNestedSigner) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "BadSigner.signer": - value := x.Signer - return protoreflect.ValueOfBytes(value) + case "DeeplyNestedSigner.inner_one": + value := x.InnerOne + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner")) } - panic(fmt.Errorf("message BadSigner does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner does not contain field %s", descriptor.FullName())) } } @@ -4726,15 +4726,15 @@ func (x *fastReflection_BadSigner) Get(descriptor protoreflect.FieldDescriptor) // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_BadSigner) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_DeeplyNestedSigner) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "BadSigner.signer": - x.Signer = value.Bytes() + case "DeeplyNestedSigner.inner_one": + x.InnerOne = value.Message().Interface().(*DeeplyNestedSigner_InnerOne) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner")) } - panic(fmt.Errorf("message BadSigner does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner does not contain field %s", fd.FullName())) } } @@ -4748,40 +4748,44 @@ func (x *fastReflection_BadSigner) Set(fd protoreflect.FieldDescriptor, value pr // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_BadSigner) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_DeeplyNestedSigner) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "BadSigner.signer": - panic(fmt.Errorf("field signer of message BadSigner is not mutable")) + case "DeeplyNestedSigner.inner_one": + if x.InnerOne == nil { + x.InnerOne = new(DeeplyNestedSigner_InnerOne) + } + return protoreflect.ValueOfMessage(x.InnerOne.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner")) } - panic(fmt.Errorf("message BadSigner does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner 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_BadSigner) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_DeeplyNestedSigner) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "BadSigner.signer": - return protoreflect.ValueOfBytes(nil) + case "DeeplyNestedSigner.inner_one": + m := new(DeeplyNestedSigner_InnerOne) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner")) } - panic(fmt.Errorf("message BadSigner does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner 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_BadSigner) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_DeeplyNestedSigner) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in BadSigner", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in DeeplyNestedSigner", d.FullName())) } panic("unreachable") } @@ -4789,7 +4793,7 @@ func (x *fastReflection_BadSigner) WhichOneof(d protoreflect.OneofDescriptor) pr // 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_BadSigner) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_DeeplyNestedSigner) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -4800,7 +4804,7 @@ func (x *fastReflection_BadSigner) 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_BadSigner) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_DeeplyNestedSigner) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -4812,7 +4816,7 @@ func (x *fastReflection_BadSigner) 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_BadSigner) IsValid() bool { +func (x *fastReflection_DeeplyNestedSigner) IsValid() bool { return x != nil } @@ -4822,9 +4826,9 @@ func (x *fastReflection_BadSigner) 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_BadSigner) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_DeeplyNestedSigner) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*BadSigner) + x := input.Message.Interface().(*DeeplyNestedSigner) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -4836,8 +4840,8 @@ func (x *fastReflection_BadSigner) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.Signer) - if l > 0 { + if x.InnerOne != nil { + l = options.Size(x.InnerOne) n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { @@ -4850,7 +4854,7 @@ func (x *fastReflection_BadSigner) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*BadSigner) + x := input.Message.Interface().(*DeeplyNestedSigner) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -4869,10 +4873,17 @@ func (x *fastReflection_BadSigner) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Signer) > 0 { - i -= len(x.Signer) - copy(dAtA[i:], x.Signer) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Signer))) + if x.InnerOne != nil { + encoded, err := options.Marshal(x.InnerOne) + 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 } @@ -4887,7 +4898,7 @@ func (x *fastReflection_BadSigner) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*BadSigner) + x := input.Message.Interface().(*DeeplyNestedSigner) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -4919,17 +4930,17 @@ func (x *fastReflection_BadSigner) 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: BadSigner: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedSigner: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: BadSigner: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedSigner: 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 Signer", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field InnerOne", 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 @@ -4939,24 +4950,26 @@ func (x *fastReflection_BadSigner) 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.Signer = append(x.Signer[:0], dAtA[iNdEx:postIndex]...) - if x.Signer == nil { - x.Signer = []byte{} + if x.InnerOne == nil { + x.InnerOne = &DeeplyNestedSigner_InnerOne{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.InnerOne); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex default: @@ -4995,26 +5008,26 @@ func (x *fastReflection_BadSigner) ProtoMethods() *protoiface.Methods { } var ( - md_NoSignerOption protoreflect.MessageDescriptor - fd_NoSignerOption_signer protoreflect.FieldDescriptor + md_DeeplyNestedSigner_InnerOne protoreflect.MessageDescriptor + fd_DeeplyNestedSigner_InnerOne_inner_two protoreflect.FieldDescriptor ) func init() { file_signers_proto_init() - md_NoSignerOption = File_signers_proto.Messages().ByName("NoSignerOption") - fd_NoSignerOption_signer = md_NoSignerOption.Fields().ByName("signer") + md_DeeplyNestedSigner_InnerOne = File_signers_proto.Messages().ByName("DeeplyNestedSigner").Messages().ByName("InnerOne") + fd_DeeplyNestedSigner_InnerOne_inner_two = md_DeeplyNestedSigner_InnerOne.Fields().ByName("inner_two") } -var _ protoreflect.Message = (*fastReflection_NoSignerOption)(nil) +var _ protoreflect.Message = (*fastReflection_DeeplyNestedSigner_InnerOne)(nil) -type fastReflection_NoSignerOption NoSignerOption +type fastReflection_DeeplyNestedSigner_InnerOne DeeplyNestedSigner_InnerOne -func (x *NoSignerOption) ProtoReflect() protoreflect.Message { - return (*fastReflection_NoSignerOption)(x) +func (x *DeeplyNestedSigner_InnerOne) ProtoReflect() protoreflect.Message { + return (*fastReflection_DeeplyNestedSigner_InnerOne)(x) } -func (x *NoSignerOption) slowProtoReflect() protoreflect.Message { - mi := &file_signers_proto_msgTypes[7] +func (x *DeeplyNestedSigner_InnerOne) slowProtoReflect() protoreflect.Message { + mi := &file_signers_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5025,43 +5038,43 @@ func (x *NoSignerOption) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_NoSignerOption_messageType fastReflection_NoSignerOption_messageType -var _ protoreflect.MessageType = fastReflection_NoSignerOption_messageType{} +var _fastReflection_DeeplyNestedSigner_InnerOne_messageType fastReflection_DeeplyNestedSigner_InnerOne_messageType +var _ protoreflect.MessageType = fastReflection_DeeplyNestedSigner_InnerOne_messageType{} -type fastReflection_NoSignerOption_messageType struct{} +type fastReflection_DeeplyNestedSigner_InnerOne_messageType struct{} -func (x fastReflection_NoSignerOption_messageType) Zero() protoreflect.Message { - return (*fastReflection_NoSignerOption)(nil) +func (x fastReflection_DeeplyNestedSigner_InnerOne_messageType) Zero() protoreflect.Message { + return (*fastReflection_DeeplyNestedSigner_InnerOne)(nil) } -func (x fastReflection_NoSignerOption_messageType) New() protoreflect.Message { - return new(fastReflection_NoSignerOption) +func (x fastReflection_DeeplyNestedSigner_InnerOne_messageType) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedSigner_InnerOne) } -func (x fastReflection_NoSignerOption_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_NoSignerOption +func (x fastReflection_DeeplyNestedSigner_InnerOne_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedSigner_InnerOne } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_NoSignerOption) Descriptor() protoreflect.MessageDescriptor { - return md_NoSignerOption +func (x *fastReflection_DeeplyNestedSigner_InnerOne) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedSigner_InnerOne } // 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_NoSignerOption) Type() protoreflect.MessageType { - return _fastReflection_NoSignerOption_messageType +func (x *fastReflection_DeeplyNestedSigner_InnerOne) Type() protoreflect.MessageType { + return _fastReflection_DeeplyNestedSigner_InnerOne_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_NoSignerOption) New() protoreflect.Message { - return new(fastReflection_NoSignerOption) +func (x *fastReflection_DeeplyNestedSigner_InnerOne) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedSigner_InnerOne) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_NoSignerOption) Interface() protoreflect.ProtoMessage { - return (*NoSignerOption)(x) +func (x *fastReflection_DeeplyNestedSigner_InnerOne) Interface() protoreflect.ProtoMessage { + return (*DeeplyNestedSigner_InnerOne)(x) } // Range iterates over every populated field in an undefined order, @@ -5069,10 +5082,10 @@ func (x *fastReflection_NoSignerOption) 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_NoSignerOption) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.Signer) != 0 { - value := protoreflect.ValueOfBytes(x.Signer) - if !f(fd_NoSignerOption_signer, value) { +func (x *fastReflection_DeeplyNestedSigner_InnerOne) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.InnerTwo != nil { + value := protoreflect.ValueOfMessage(x.InnerTwo.ProtoReflect()) + if !f(fd_DeeplyNestedSigner_InnerOne_inner_two, value) { return } } @@ -5089,15 +5102,15 @@ func (x *fastReflection_NoSignerOption) Range(f func(protoreflect.FieldDescripto // 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_NoSignerOption) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_DeeplyNestedSigner_InnerOne) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "NoSignerOption.signer": - return len(x.Signer) != 0 + case "DeeplyNestedSigner.InnerOne.inner_two": + return x.InnerTwo != nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: NoSignerOption")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner.InnerOne")) } - panic(fmt.Errorf("message NoSignerOption does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner.InnerOne does not contain field %s", fd.FullName())) } } @@ -5107,15 +5120,15 @@ func (x *fastReflection_NoSignerOption) Has(fd protoreflect.FieldDescriptor) boo // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_NoSignerOption) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_DeeplyNestedSigner_InnerOne) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "NoSignerOption.signer": - x.Signer = nil + case "DeeplyNestedSigner.InnerOne.inner_two": + x.InnerTwo = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: NoSignerOption")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner.InnerOne")) } - panic(fmt.Errorf("message NoSignerOption does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner.InnerOne does not contain field %s", fd.FullName())) } } @@ -5125,16 +5138,16 @@ func (x *fastReflection_NoSignerOption) 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_NoSignerOption) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_DeeplyNestedSigner_InnerOne) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "NoSignerOption.signer": - value := x.Signer - return protoreflect.ValueOfBytes(value) + case "DeeplyNestedSigner.InnerOne.inner_two": + value := x.InnerTwo + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: NoSignerOption")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner.InnerOne")) } - panic(fmt.Errorf("message NoSignerOption does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner.InnerOne does not contain field %s", descriptor.FullName())) } } @@ -5148,15 +5161,15 @@ func (x *fastReflection_NoSignerOption) Get(descriptor protoreflect.FieldDescrip // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_NoSignerOption) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_DeeplyNestedSigner_InnerOne) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "NoSignerOption.signer": - x.Signer = value.Bytes() + case "DeeplyNestedSigner.InnerOne.inner_two": + x.InnerTwo = value.Message().Interface().(*DeeplyNestedSigner_InnerOne_InnerTwo) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: NoSignerOption")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner.InnerOne")) } - panic(fmt.Errorf("message NoSignerOption does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner.InnerOne does not contain field %s", fd.FullName())) } } @@ -5170,40 +5183,44 @@ func (x *fastReflection_NoSignerOption) Set(fd protoreflect.FieldDescriptor, val // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_NoSignerOption) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_DeeplyNestedSigner_InnerOne) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "NoSignerOption.signer": - panic(fmt.Errorf("field signer of message NoSignerOption is not mutable")) + case "DeeplyNestedSigner.InnerOne.inner_two": + if x.InnerTwo == nil { + x.InnerTwo = new(DeeplyNestedSigner_InnerOne_InnerTwo) + } + return protoreflect.ValueOfMessage(x.InnerTwo.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: NoSignerOption")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner.InnerOne")) } - panic(fmt.Errorf("message NoSignerOption does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner.InnerOne 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_NoSignerOption) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_DeeplyNestedSigner_InnerOne) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "NoSignerOption.signer": - return protoreflect.ValueOfBytes(nil) + case "DeeplyNestedSigner.InnerOne.inner_two": + m := new(DeeplyNestedSigner_InnerOne_InnerTwo) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: NoSignerOption")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner.InnerOne")) } - panic(fmt.Errorf("message NoSignerOption does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner.InnerOne 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_NoSignerOption) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_DeeplyNestedSigner_InnerOne) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in NoSignerOption", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in DeeplyNestedSigner.InnerOne", d.FullName())) } panic("unreachable") } @@ -5211,7 +5228,7 @@ func (x *fastReflection_NoSignerOption) WhichOneof(d protoreflect.OneofDescripto // 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_NoSignerOption) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_DeeplyNestedSigner_InnerOne) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -5222,7 +5239,7 @@ func (x *fastReflection_NoSignerOption) 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_NoSignerOption) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_DeeplyNestedSigner_InnerOne) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -5234,7 +5251,7 @@ func (x *fastReflection_NoSignerOption) 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_NoSignerOption) IsValid() bool { +func (x *fastReflection_DeeplyNestedSigner_InnerOne) IsValid() bool { return x != nil } @@ -5244,9 +5261,9 @@ func (x *fastReflection_NoSignerOption) 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_NoSignerOption) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_DeeplyNestedSigner_InnerOne) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*NoSignerOption) + x := input.Message.Interface().(*DeeplyNestedSigner_InnerOne) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -5258,8 +5275,8 @@ func (x *fastReflection_NoSignerOption) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.Signer) - if l > 0 { + if x.InnerTwo != nil { + l = options.Size(x.InnerTwo) n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { @@ -5272,7 +5289,7 @@ func (x *fastReflection_NoSignerOption) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*NoSignerOption) + x := input.Message.Interface().(*DeeplyNestedSigner_InnerOne) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -5291,10 +5308,17 @@ func (x *fastReflection_NoSignerOption) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Signer) > 0 { - i -= len(x.Signer) - copy(dAtA[i:], x.Signer) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Signer))) + if x.InnerTwo != nil { + encoded, err := options.Marshal(x.InnerTwo) + 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 } @@ -5309,7 +5333,7 @@ func (x *fastReflection_NoSignerOption) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*NoSignerOption) + x := input.Message.Interface().(*DeeplyNestedSigner_InnerOne) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -5341,17 +5365,17 @@ func (x *fastReflection_NoSignerOption) 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: NoSignerOption: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedSigner_InnerOne: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: NoSignerOption: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedSigner_InnerOne: 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 Signer", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field InnerTwo", 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 @@ -5361,24 +5385,26 @@ func (x *fastReflection_NoSignerOption) 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.Signer = append(x.Signer[:0], dAtA[iNdEx:postIndex]...) - if x.Signer == nil { - x.Signer = []byte{} + if x.InnerTwo == nil { + x.InnerTwo = &DeeplyNestedSigner_InnerOne_InnerTwo{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.InnerTwo); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex default: @@ -5417,26 +5443,26 @@ func (x *fastReflection_NoSignerOption) ProtoMethods() *protoiface.Methods { } var ( - md_ValidatorSigner protoreflect.MessageDescriptor - fd_ValidatorSigner_signer protoreflect.FieldDescriptor + md_DeeplyNestedSigner_InnerOne_InnerTwo protoreflect.MessageDescriptor + fd_DeeplyNestedSigner_InnerOne_InnerTwo_signer protoreflect.FieldDescriptor ) func init() { file_signers_proto_init() - md_ValidatorSigner = File_signers_proto.Messages().ByName("ValidatorSigner") - fd_ValidatorSigner_signer = md_ValidatorSigner.Fields().ByName("signer") + md_DeeplyNestedSigner_InnerOne_InnerTwo = File_signers_proto.Messages().ByName("DeeplyNestedSigner").Messages().ByName("InnerOne").Messages().ByName("InnerTwo") + fd_DeeplyNestedSigner_InnerOne_InnerTwo_signer = md_DeeplyNestedSigner_InnerOne_InnerTwo.Fields().ByName("signer") } -var _ protoreflect.Message = (*fastReflection_ValidatorSigner)(nil) +var _ protoreflect.Message = (*fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo)(nil) -type fastReflection_ValidatorSigner ValidatorSigner +type fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo DeeplyNestedSigner_InnerOne_InnerTwo -func (x *ValidatorSigner) ProtoReflect() protoreflect.Message { - return (*fastReflection_ValidatorSigner)(x) +func (x *DeeplyNestedSigner_InnerOne_InnerTwo) ProtoReflect() protoreflect.Message { + return (*fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo)(x) } -func (x *ValidatorSigner) slowProtoReflect() protoreflect.Message { - mi := &file_signers_proto_msgTypes[8] +func (x *DeeplyNestedSigner_InnerOne_InnerTwo) slowProtoReflect() protoreflect.Message { + mi := &file_signers_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5447,43 +5473,43 @@ func (x *ValidatorSigner) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_ValidatorSigner_messageType fastReflection_ValidatorSigner_messageType -var _ protoreflect.MessageType = fastReflection_ValidatorSigner_messageType{} +var _fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo_messageType fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo_messageType +var _ protoreflect.MessageType = fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo_messageType{} -type fastReflection_ValidatorSigner_messageType struct{} +type fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo_messageType struct{} -func (x fastReflection_ValidatorSigner_messageType) Zero() protoreflect.Message { - return (*fastReflection_ValidatorSigner)(nil) +func (x fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo_messageType) Zero() protoreflect.Message { + return (*fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo)(nil) } -func (x fastReflection_ValidatorSigner_messageType) New() protoreflect.Message { - return new(fastReflection_ValidatorSigner) +func (x fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo_messageType) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) } -func (x fastReflection_ValidatorSigner_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_ValidatorSigner +func (x fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedSigner_InnerOne_InnerTwo } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_ValidatorSigner) Descriptor() protoreflect.MessageDescriptor { - return md_ValidatorSigner +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedSigner_InnerOne_InnerTwo } // 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_ValidatorSigner) Type() protoreflect.MessageType { - return _fastReflection_ValidatorSigner_messageType +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) Type() protoreflect.MessageType { + return _fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_ValidatorSigner) New() protoreflect.Message { - return new(fastReflection_ValidatorSigner) +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_ValidatorSigner) Interface() protoreflect.ProtoMessage { - return (*ValidatorSigner)(x) +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) Interface() protoreflect.ProtoMessage { + return (*DeeplyNestedSigner_InnerOne_InnerTwo)(x) } // Range iterates over every populated field in an undefined order, @@ -5491,10 +5517,10 @@ func (x *fastReflection_ValidatorSigner) 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_ValidatorSigner) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Signer != "" { value := protoreflect.ValueOfString(x.Signer) - if !f(fd_ValidatorSigner_signer, value) { + if !f(fd_DeeplyNestedSigner_InnerOne_InnerTwo_signer, value) { return } } @@ -5511,15 +5537,15 @@ func (x *fastReflection_ValidatorSigner) 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_ValidatorSigner) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "ValidatorSigner.signer": + case "DeeplyNestedSigner.InnerOne.InnerTwo.signer": return x.Signer != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: ValidatorSigner")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner.InnerOne.InnerTwo")) } - panic(fmt.Errorf("message ValidatorSigner does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner.InnerOne.InnerTwo does not contain field %s", fd.FullName())) } } @@ -5529,15 +5555,15 @@ func (x *fastReflection_ValidatorSigner) Has(fd protoreflect.FieldDescriptor) bo // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ValidatorSigner) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "ValidatorSigner.signer": + case "DeeplyNestedSigner.InnerOne.InnerTwo.signer": x.Signer = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: ValidatorSigner")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner.InnerOne.InnerTwo")) } - panic(fmt.Errorf("message ValidatorSigner does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner.InnerOne.InnerTwo does not contain field %s", fd.FullName())) } } @@ -5547,16 +5573,3242 @@ func (x *fastReflection_ValidatorSigner) 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_ValidatorSigner) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "ValidatorSigner.signer": + case "DeeplyNestedSigner.InnerOne.InnerTwo.signer": value := x.Signer return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: ValidatorSigner")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner.InnerOne.InnerTwo")) } - panic(fmt.Errorf("message ValidatorSigner does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner.InnerOne.InnerTwo 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_DeeplyNestedSigner_InnerOne_InnerTwo) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "DeeplyNestedSigner.InnerOne.InnerTwo.signer": + x.Signer = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner.InnerOne.InnerTwo")) + } + panic(fmt.Errorf("message DeeplyNestedSigner.InnerOne.InnerTwo 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_DeeplyNestedSigner_InnerOne_InnerTwo) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "DeeplyNestedSigner.InnerOne.InnerTwo.signer": + panic(fmt.Errorf("field signer of message DeeplyNestedSigner.InnerOne.InnerTwo is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner.InnerOne.InnerTwo")) + } + panic(fmt.Errorf("message DeeplyNestedSigner.InnerOne.InnerTwo 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_DeeplyNestedSigner_InnerOne_InnerTwo) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "DeeplyNestedSigner.InnerOne.InnerTwo.signer": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner.InnerOne.InnerTwo")) + } + panic(fmt.Errorf("message DeeplyNestedSigner.InnerOne.InnerTwo 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_DeeplyNestedSigner_InnerOne_InnerTwo) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in DeeplyNestedSigner.InnerOne.InnerTwo", 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_DeeplyNestedSigner_InnerOne_InnerTwo) 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_DeeplyNestedSigner_InnerOne_InnerTwo) 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_DeeplyNestedSigner_InnerOne_InnerTwo) 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_DeeplyNestedSigner_InnerOne_InnerTwo) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*DeeplyNestedSigner_InnerOne_InnerTwo) + 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.Signer) + 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().(*DeeplyNestedSigner_InnerOne_InnerTwo) + 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.Signer) > 0 { + i -= len(x.Signer) + copy(dAtA[i:], x.Signer) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Signer))) + 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().(*DeeplyNestedSigner_InnerOne_InnerTwo) + 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: DeeplyNestedSigner_InnerOne_InnerTwo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedSigner_InnerOne_InnerTwo: 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 Signer", 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.Signer = 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 = (*_DeeplyNestedRepeatedSigner_1_list)(nil) + +type _DeeplyNestedRepeatedSigner_1_list struct { + list *[]*DeeplyNestedRepeatedSigner_Inner +} + +func (x *_DeeplyNestedRepeatedSigner_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_DeeplyNestedRepeatedSigner_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_DeeplyNestedRepeatedSigner_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*DeeplyNestedRepeatedSigner_Inner) + (*x.list)[i] = concreteValue +} + +func (x *_DeeplyNestedRepeatedSigner_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*DeeplyNestedRepeatedSigner_Inner) + *x.list = append(*x.list, concreteValue) +} + +func (x *_DeeplyNestedRepeatedSigner_1_list) AppendMutable() protoreflect.Value { + v := new(DeeplyNestedRepeatedSigner_Inner) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_DeeplyNestedRepeatedSigner_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_DeeplyNestedRepeatedSigner_1_list) NewElement() protoreflect.Value { + v := new(DeeplyNestedRepeatedSigner_Inner) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_DeeplyNestedRepeatedSigner_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_DeeplyNestedRepeatedSigner protoreflect.MessageDescriptor + fd_DeeplyNestedRepeatedSigner_inner protoreflect.FieldDescriptor +) + +func init() { + file_signers_proto_init() + md_DeeplyNestedRepeatedSigner = File_signers_proto.Messages().ByName("DeeplyNestedRepeatedSigner") + fd_DeeplyNestedRepeatedSigner_inner = md_DeeplyNestedRepeatedSigner.Fields().ByName("inner") +} + +var _ protoreflect.Message = (*fastReflection_DeeplyNestedRepeatedSigner)(nil) + +type fastReflection_DeeplyNestedRepeatedSigner DeeplyNestedRepeatedSigner + +func (x *DeeplyNestedRepeatedSigner) ProtoReflect() protoreflect.Message { + return (*fastReflection_DeeplyNestedRepeatedSigner)(x) +} + +func (x *DeeplyNestedRepeatedSigner) slowProtoReflect() protoreflect.Message { + mi := &file_signers_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_DeeplyNestedRepeatedSigner_messageType fastReflection_DeeplyNestedRepeatedSigner_messageType +var _ protoreflect.MessageType = fastReflection_DeeplyNestedRepeatedSigner_messageType{} + +type fastReflection_DeeplyNestedRepeatedSigner_messageType struct{} + +func (x fastReflection_DeeplyNestedRepeatedSigner_messageType) Zero() protoreflect.Message { + return (*fastReflection_DeeplyNestedRepeatedSigner)(nil) +} +func (x fastReflection_DeeplyNestedRepeatedSigner_messageType) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedRepeatedSigner) +} +func (x fastReflection_DeeplyNestedRepeatedSigner_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedRepeatedSigner +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_DeeplyNestedRepeatedSigner) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedRepeatedSigner +} + +// 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_DeeplyNestedRepeatedSigner) Type() protoreflect.MessageType { + return _fastReflection_DeeplyNestedRepeatedSigner_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_DeeplyNestedRepeatedSigner) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedRepeatedSigner) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_DeeplyNestedRepeatedSigner) Interface() protoreflect.ProtoMessage { + return (*DeeplyNestedRepeatedSigner)(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_DeeplyNestedRepeatedSigner) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Inner) != 0 { + value := protoreflect.ValueOfList(&_DeeplyNestedRepeatedSigner_1_list{list: &x.Inner}) + if !f(fd_DeeplyNestedRepeatedSigner_inner, 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_DeeplyNestedRepeatedSigner) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.inner": + return len(x.Inner) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner 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_DeeplyNestedRepeatedSigner) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.inner": + x.Inner = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner 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_DeeplyNestedRepeatedSigner) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "DeeplyNestedRepeatedSigner.inner": + if len(x.Inner) == 0 { + return protoreflect.ValueOfList(&_DeeplyNestedRepeatedSigner_1_list{}) + } + listValue := &_DeeplyNestedRepeatedSigner_1_list{list: &x.Inner} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner 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_DeeplyNestedRepeatedSigner) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.inner": + lv := value.List() + clv := lv.(*_DeeplyNestedRepeatedSigner_1_list) + x.Inner = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner 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_DeeplyNestedRepeatedSigner) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.inner": + if x.Inner == nil { + x.Inner = []*DeeplyNestedRepeatedSigner_Inner{} + } + value := &_DeeplyNestedRepeatedSigner_1_list{list: &x.Inner} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner 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_DeeplyNestedRepeatedSigner) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.inner": + list := []*DeeplyNestedRepeatedSigner_Inner{} + return protoreflect.ValueOfList(&_DeeplyNestedRepeatedSigner_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner 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_DeeplyNestedRepeatedSigner) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in DeeplyNestedRepeatedSigner", 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_DeeplyNestedRepeatedSigner) 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_DeeplyNestedRepeatedSigner) 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_DeeplyNestedRepeatedSigner) 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_DeeplyNestedRepeatedSigner) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*DeeplyNestedRepeatedSigner) + 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.Inner) > 0 { + for _, e := range x.Inner { + 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().(*DeeplyNestedRepeatedSigner) + 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.Inner) > 0 { + for iNdEx := len(x.Inner) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Inner[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*DeeplyNestedRepeatedSigner) + 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: DeeplyNestedRepeatedSigner: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedRepeatedSigner: 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 Inner", 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.Inner = append(x.Inner, &DeeplyNestedRepeatedSigner_Inner{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Inner[len(x.Inner)-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.List = (*_DeeplyNestedRepeatedSigner_Inner_1_list)(nil) + +type _DeeplyNestedRepeatedSigner_Inner_1_list struct { + list *[]*DeeplyNestedRepeatedSigner_Inner_Inner +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*DeeplyNestedRepeatedSigner_Inner_Inner) + (*x.list)[i] = concreteValue +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*DeeplyNestedRepeatedSigner_Inner_Inner) + *x.list = append(*x.list, concreteValue) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_1_list) AppendMutable() protoreflect.Value { + v := new(DeeplyNestedRepeatedSigner_Inner_Inner) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_1_list) NewElement() protoreflect.Value { + v := new(DeeplyNestedRepeatedSigner_Inner_Inner) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_DeeplyNestedRepeatedSigner_Inner protoreflect.MessageDescriptor + fd_DeeplyNestedRepeatedSigner_Inner_inner protoreflect.FieldDescriptor +) + +func init() { + file_signers_proto_init() + md_DeeplyNestedRepeatedSigner_Inner = File_signers_proto.Messages().ByName("DeeplyNestedRepeatedSigner").Messages().ByName("Inner") + fd_DeeplyNestedRepeatedSigner_Inner_inner = md_DeeplyNestedRepeatedSigner_Inner.Fields().ByName("inner") +} + +var _ protoreflect.Message = (*fastReflection_DeeplyNestedRepeatedSigner_Inner)(nil) + +type fastReflection_DeeplyNestedRepeatedSigner_Inner DeeplyNestedRepeatedSigner_Inner + +func (x *DeeplyNestedRepeatedSigner_Inner) ProtoReflect() protoreflect.Message { + return (*fastReflection_DeeplyNestedRepeatedSigner_Inner)(x) +} + +func (x *DeeplyNestedRepeatedSigner_Inner) slowProtoReflect() protoreflect.Message { + mi := &file_signers_proto_msgTypes[17] + 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_DeeplyNestedRepeatedSigner_Inner_messageType fastReflection_DeeplyNestedRepeatedSigner_Inner_messageType +var _ protoreflect.MessageType = fastReflection_DeeplyNestedRepeatedSigner_Inner_messageType{} + +type fastReflection_DeeplyNestedRepeatedSigner_Inner_messageType struct{} + +func (x fastReflection_DeeplyNestedRepeatedSigner_Inner_messageType) Zero() protoreflect.Message { + return (*fastReflection_DeeplyNestedRepeatedSigner_Inner)(nil) +} +func (x fastReflection_DeeplyNestedRepeatedSigner_Inner_messageType) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedRepeatedSigner_Inner) +} +func (x fastReflection_DeeplyNestedRepeatedSigner_Inner_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedRepeatedSigner_Inner +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedRepeatedSigner_Inner +} + +// 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_DeeplyNestedRepeatedSigner_Inner) Type() protoreflect.MessageType { + return _fastReflection_DeeplyNestedRepeatedSigner_Inner_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedRepeatedSigner_Inner) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner) Interface() protoreflect.ProtoMessage { + return (*DeeplyNestedRepeatedSigner_Inner)(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_DeeplyNestedRepeatedSigner_Inner) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Inner) != 0 { + value := protoreflect.ValueOfList(&_DeeplyNestedRepeatedSigner_Inner_1_list{list: &x.Inner}) + if !f(fd_DeeplyNestedRepeatedSigner_Inner_inner, 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_DeeplyNestedRepeatedSigner_Inner) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.inner": + return len(x.Inner) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner 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_DeeplyNestedRepeatedSigner_Inner) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.inner": + x.Inner = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner 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_DeeplyNestedRepeatedSigner_Inner) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.inner": + if len(x.Inner) == 0 { + return protoreflect.ValueOfList(&_DeeplyNestedRepeatedSigner_Inner_1_list{}) + } + listValue := &_DeeplyNestedRepeatedSigner_Inner_1_list{list: &x.Inner} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner 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_DeeplyNestedRepeatedSigner_Inner) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.inner": + lv := value.List() + clv := lv.(*_DeeplyNestedRepeatedSigner_Inner_1_list) + x.Inner = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner 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_DeeplyNestedRepeatedSigner_Inner) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.inner": + if x.Inner == nil { + x.Inner = []*DeeplyNestedRepeatedSigner_Inner_Inner{} + } + value := &_DeeplyNestedRepeatedSigner_Inner_1_list{list: &x.Inner} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner 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_DeeplyNestedRepeatedSigner_Inner) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.inner": + list := []*DeeplyNestedRepeatedSigner_Inner_Inner{} + return protoreflect.ValueOfList(&_DeeplyNestedRepeatedSigner_Inner_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner 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_DeeplyNestedRepeatedSigner_Inner) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in DeeplyNestedRepeatedSigner.Inner", 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_DeeplyNestedRepeatedSigner_Inner) 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_DeeplyNestedRepeatedSigner_Inner) 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_DeeplyNestedRepeatedSigner_Inner) 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_DeeplyNestedRepeatedSigner_Inner) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*DeeplyNestedRepeatedSigner_Inner) + 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.Inner) > 0 { + for _, e := range x.Inner { + 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().(*DeeplyNestedRepeatedSigner_Inner) + 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.Inner) > 0 { + for iNdEx := len(x.Inner) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Inner[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*DeeplyNestedRepeatedSigner_Inner) + 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: DeeplyNestedRepeatedSigner_Inner: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedRepeatedSigner_Inner: 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 Inner", 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.Inner = append(x.Inner, &DeeplyNestedRepeatedSigner_Inner_Inner{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Inner[len(x.Inner)-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.List = (*_DeeplyNestedRepeatedSigner_Inner_Inner_1_list)(nil) + +type _DeeplyNestedRepeatedSigner_Inner_Inner_1_list struct { + list *[]*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) + (*x.list)[i] = concreteValue +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) + *x.list = append(*x.list, concreteValue) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_1_list) AppendMutable() protoreflect.Value { + v := new(DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_1_list) NewElement() protoreflect.Value { + v := new(DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_DeeplyNestedRepeatedSigner_Inner_Inner protoreflect.MessageDescriptor + fd_DeeplyNestedRepeatedSigner_Inner_Inner_inner protoreflect.FieldDescriptor +) + +func init() { + file_signers_proto_init() + md_DeeplyNestedRepeatedSigner_Inner_Inner = File_signers_proto.Messages().ByName("DeeplyNestedRepeatedSigner").Messages().ByName("Inner").Messages().ByName("Inner") + fd_DeeplyNestedRepeatedSigner_Inner_Inner_inner = md_DeeplyNestedRepeatedSigner_Inner_Inner.Fields().ByName("inner") +} + +var _ protoreflect.Message = (*fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner)(nil) + +type fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner DeeplyNestedRepeatedSigner_Inner_Inner + +func (x *DeeplyNestedRepeatedSigner_Inner_Inner) ProtoReflect() protoreflect.Message { + return (*fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner)(x) +} + +func (x *DeeplyNestedRepeatedSigner_Inner_Inner) slowProtoReflect() protoreflect.Message { + mi := &file_signers_proto_msgTypes[18] + 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_DeeplyNestedRepeatedSigner_Inner_Inner_messageType fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_messageType +var _ protoreflect.MessageType = fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_messageType{} + +type fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_messageType struct{} + +func (x fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_messageType) Zero() protoreflect.Message { + return (*fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner)(nil) +} +func (x fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_messageType) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) +} +func (x fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedRepeatedSigner_Inner_Inner +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedRepeatedSigner_Inner_Inner +} + +// 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_DeeplyNestedRepeatedSigner_Inner_Inner) Type() protoreflect.MessageType { + return _fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) Interface() protoreflect.ProtoMessage { + return (*DeeplyNestedRepeatedSigner_Inner_Inner)(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_DeeplyNestedRepeatedSigner_Inner_Inner) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Inner) != 0 { + value := protoreflect.ValueOfList(&_DeeplyNestedRepeatedSigner_Inner_Inner_1_list{list: &x.Inner}) + if !f(fd_DeeplyNestedRepeatedSigner_Inner_Inner_inner, 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_DeeplyNestedRepeatedSigner_Inner_Inner) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.Inner.inner": + return len(x.Inner) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner.Inner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner.Inner 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_DeeplyNestedRepeatedSigner_Inner_Inner) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.Inner.inner": + x.Inner = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner.Inner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner.Inner 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_DeeplyNestedRepeatedSigner_Inner_Inner) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.Inner.inner": + if len(x.Inner) == 0 { + return protoreflect.ValueOfList(&_DeeplyNestedRepeatedSigner_Inner_Inner_1_list{}) + } + listValue := &_DeeplyNestedRepeatedSigner_Inner_Inner_1_list{list: &x.Inner} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner.Inner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner.Inner 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_DeeplyNestedRepeatedSigner_Inner_Inner) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.Inner.inner": + lv := value.List() + clv := lv.(*_DeeplyNestedRepeatedSigner_Inner_Inner_1_list) + x.Inner = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner.Inner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner.Inner 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_DeeplyNestedRepeatedSigner_Inner_Inner) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.Inner.inner": + if x.Inner == nil { + x.Inner = []*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom{} + } + value := &_DeeplyNestedRepeatedSigner_Inner_Inner_1_list{list: &x.Inner} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner.Inner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner.Inner 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_DeeplyNestedRepeatedSigner_Inner_Inner) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.Inner.inner": + list := []*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom{} + return protoreflect.ValueOfList(&_DeeplyNestedRepeatedSigner_Inner_Inner_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner.Inner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner.Inner 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_DeeplyNestedRepeatedSigner_Inner_Inner) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in DeeplyNestedRepeatedSigner.Inner.Inner", 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_DeeplyNestedRepeatedSigner_Inner_Inner) 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_DeeplyNestedRepeatedSigner_Inner_Inner) 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_DeeplyNestedRepeatedSigner_Inner_Inner) 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_DeeplyNestedRepeatedSigner_Inner_Inner) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*DeeplyNestedRepeatedSigner_Inner_Inner) + 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.Inner) > 0 { + for _, e := range x.Inner { + 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().(*DeeplyNestedRepeatedSigner_Inner_Inner) + 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.Inner) > 0 { + for iNdEx := len(x.Inner) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Inner[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*DeeplyNestedRepeatedSigner_Inner_Inner) + 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: DeeplyNestedRepeatedSigner_Inner_Inner: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedRepeatedSigner_Inner_Inner: 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 Inner", 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.Inner = append(x.Inner, &DeeplyNestedRepeatedSigner_Inner_Inner_Bottom{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Inner[len(x.Inner)-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.List = (*_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list)(nil) + +type _DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list struct { + list *[]string +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message DeeplyNestedRepeatedSigner_Inner_Inner_Bottom at list field Signer as it is not of Message kind")) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom protoreflect.MessageDescriptor + fd_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_signer protoreflect.FieldDescriptor +) + +func init() { + file_signers_proto_init() + md_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom = File_signers_proto.Messages().ByName("DeeplyNestedRepeatedSigner").Messages().ByName("Inner").Messages().ByName("Inner").Messages().ByName("Bottom") + fd_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_signer = md_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom.Fields().ByName("signer") +} + +var _ protoreflect.Message = (*fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom)(nil) + +type fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom DeeplyNestedRepeatedSigner_Inner_Inner_Bottom + +func (x *DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) ProtoReflect() protoreflect.Message { + return (*fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom)(x) +} + +func (x *DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) slowProtoReflect() protoreflect.Message { + mi := &file_signers_proto_msgTypes[19] + 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_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_messageType fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_messageType +var _ protoreflect.MessageType = fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_messageType{} + +type fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_messageType struct{} + +func (x fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_messageType) Zero() protoreflect.Message { + return (*fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom)(nil) +} +func (x fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_messageType) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) +} +func (x fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom +} + +// 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_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) Type() protoreflect.MessageType { + return _fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) Interface() protoreflect.ProtoMessage { + return (*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom)(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_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Signer) != 0 { + value := protoreflect.ValueOfList(&_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list{list: &x.Signer}) + if !f(fd_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_signer, 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_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.Inner.Bottom.signer": + return len(x.Signer) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner.Inner.Bottom")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner.Inner.Bottom 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_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.Inner.Bottom.signer": + x.Signer = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner.Inner.Bottom")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner.Inner.Bottom 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_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.Inner.Bottom.signer": + if len(x.Signer) == 0 { + return protoreflect.ValueOfList(&_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list{}) + } + listValue := &_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list{list: &x.Signer} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner.Inner.Bottom")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner.Inner.Bottom 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_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.Inner.Bottom.signer": + lv := value.List() + clv := lv.(*_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list) + x.Signer = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner.Inner.Bottom")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner.Inner.Bottom 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_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.Inner.Bottom.signer": + if x.Signer == nil { + x.Signer = []string{} + } + value := &_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list{list: &x.Signer} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner.Inner.Bottom")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner.Inner.Bottom 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_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.Inner.Bottom.signer": + list := []string{} + return protoreflect.ValueOfList(&_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner.Inner.Bottom")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner.Inner.Bottom 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_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in DeeplyNestedRepeatedSigner.Inner.Inner.Bottom", 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_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) 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_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) 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_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) 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_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) + 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.Signer) > 0 { + for _, s := range x.Signer { + 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().(*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) + 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.Signer) > 0 { + for iNdEx := len(x.Signer) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.Signer[iNdEx]) + copy(dAtA[i:], x.Signer[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Signer[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) + 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: DeeplyNestedRepeatedSigner_Inner_Inner_Bottom: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedRepeatedSigner_Inner_Inner_Bottom: 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 Signer", 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.Signer = append(x.Signer, 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_BadSigner protoreflect.MessageDescriptor + fd_BadSigner_signer protoreflect.FieldDescriptor +) + +func init() { + file_signers_proto_init() + md_BadSigner = File_signers_proto.Messages().ByName("BadSigner") + fd_BadSigner_signer = md_BadSigner.Fields().ByName("signer") +} + +var _ protoreflect.Message = (*fastReflection_BadSigner)(nil) + +type fastReflection_BadSigner BadSigner + +func (x *BadSigner) ProtoReflect() protoreflect.Message { + return (*fastReflection_BadSigner)(x) +} + +func (x *BadSigner) slowProtoReflect() protoreflect.Message { + mi := &file_signers_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_BadSigner_messageType fastReflection_BadSigner_messageType +var _ protoreflect.MessageType = fastReflection_BadSigner_messageType{} + +type fastReflection_BadSigner_messageType struct{} + +func (x fastReflection_BadSigner_messageType) Zero() protoreflect.Message { + return (*fastReflection_BadSigner)(nil) +} +func (x fastReflection_BadSigner_messageType) New() protoreflect.Message { + return new(fastReflection_BadSigner) +} +func (x fastReflection_BadSigner_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_BadSigner +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_BadSigner) Descriptor() protoreflect.MessageDescriptor { + return md_BadSigner +} + +// 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_BadSigner) Type() protoreflect.MessageType { + return _fastReflection_BadSigner_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_BadSigner) New() protoreflect.Message { + return new(fastReflection_BadSigner) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_BadSigner) Interface() protoreflect.ProtoMessage { + return (*BadSigner)(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_BadSigner) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Signer) != 0 { + value := protoreflect.ValueOfBytes(x.Signer) + if !f(fd_BadSigner_signer, 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_BadSigner) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "BadSigner.signer": + return len(x.Signer) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) + } + panic(fmt.Errorf("message BadSigner 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_BadSigner) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "BadSigner.signer": + x.Signer = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) + } + panic(fmt.Errorf("message BadSigner 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_BadSigner) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "BadSigner.signer": + value := x.Signer + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) + } + panic(fmt.Errorf("message BadSigner 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_BadSigner) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "BadSigner.signer": + x.Signer = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) + } + panic(fmt.Errorf("message BadSigner 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_BadSigner) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "BadSigner.signer": + panic(fmt.Errorf("field signer of message BadSigner is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) + } + panic(fmt.Errorf("message BadSigner 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_BadSigner) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "BadSigner.signer": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) + } + panic(fmt.Errorf("message BadSigner 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_BadSigner) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in BadSigner", 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_BadSigner) 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_BadSigner) 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_BadSigner) 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_BadSigner) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*BadSigner) + 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.Signer) + 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().(*BadSigner) + 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.Signer) > 0 { + i -= len(x.Signer) + copy(dAtA[i:], x.Signer) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Signer))) + 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().(*BadSigner) + 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: BadSigner: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: BadSigner: 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 Signer", 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.Signer = append(x.Signer[:0], dAtA[iNdEx:postIndex]...) + if x.Signer == nil { + x.Signer = []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 ( + md_NoSignerOption protoreflect.MessageDescriptor + fd_NoSignerOption_signer protoreflect.FieldDescriptor +) + +func init() { + file_signers_proto_init() + md_NoSignerOption = File_signers_proto.Messages().ByName("NoSignerOption") + fd_NoSignerOption_signer = md_NoSignerOption.Fields().ByName("signer") +} + +var _ protoreflect.Message = (*fastReflection_NoSignerOption)(nil) + +type fastReflection_NoSignerOption NoSignerOption + +func (x *NoSignerOption) ProtoReflect() protoreflect.Message { + return (*fastReflection_NoSignerOption)(x) +} + +func (x *NoSignerOption) slowProtoReflect() protoreflect.Message { + mi := &file_signers_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_NoSignerOption_messageType fastReflection_NoSignerOption_messageType +var _ protoreflect.MessageType = fastReflection_NoSignerOption_messageType{} + +type fastReflection_NoSignerOption_messageType struct{} + +func (x fastReflection_NoSignerOption_messageType) Zero() protoreflect.Message { + return (*fastReflection_NoSignerOption)(nil) +} +func (x fastReflection_NoSignerOption_messageType) New() protoreflect.Message { + return new(fastReflection_NoSignerOption) +} +func (x fastReflection_NoSignerOption_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_NoSignerOption +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_NoSignerOption) Descriptor() protoreflect.MessageDescriptor { + return md_NoSignerOption +} + +// 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_NoSignerOption) Type() protoreflect.MessageType { + return _fastReflection_NoSignerOption_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_NoSignerOption) New() protoreflect.Message { + return new(fastReflection_NoSignerOption) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_NoSignerOption) Interface() protoreflect.ProtoMessage { + return (*NoSignerOption)(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_NoSignerOption) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Signer) != 0 { + value := protoreflect.ValueOfBytes(x.Signer) + if !f(fd_NoSignerOption_signer, 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_NoSignerOption) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "NoSignerOption.signer": + return len(x.Signer) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: NoSignerOption")) + } + panic(fmt.Errorf("message NoSignerOption 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_NoSignerOption) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "NoSignerOption.signer": + x.Signer = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: NoSignerOption")) + } + panic(fmt.Errorf("message NoSignerOption 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_NoSignerOption) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "NoSignerOption.signer": + value := x.Signer + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: NoSignerOption")) + } + panic(fmt.Errorf("message NoSignerOption 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_NoSignerOption) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "NoSignerOption.signer": + x.Signer = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: NoSignerOption")) + } + panic(fmt.Errorf("message NoSignerOption 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_NoSignerOption) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "NoSignerOption.signer": + panic(fmt.Errorf("field signer of message NoSignerOption is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: NoSignerOption")) + } + panic(fmt.Errorf("message NoSignerOption 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_NoSignerOption) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "NoSignerOption.signer": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: NoSignerOption")) + } + panic(fmt.Errorf("message NoSignerOption 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_NoSignerOption) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in NoSignerOption", 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_NoSignerOption) 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_NoSignerOption) 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_NoSignerOption) 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_NoSignerOption) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*NoSignerOption) + 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.Signer) + 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().(*NoSignerOption) + 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.Signer) > 0 { + i -= len(x.Signer) + copy(dAtA[i:], x.Signer) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Signer))) + 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().(*NoSignerOption) + 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: NoSignerOption: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: NoSignerOption: 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 Signer", 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.Signer = append(x.Signer[:0], dAtA[iNdEx:postIndex]...) + if x.Signer == nil { + x.Signer = []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 ( + md_ValidatorSigner protoreflect.MessageDescriptor + fd_ValidatorSigner_signer protoreflect.FieldDescriptor +) + +func init() { + file_signers_proto_init() + md_ValidatorSigner = File_signers_proto.Messages().ByName("ValidatorSigner") + fd_ValidatorSigner_signer = md_ValidatorSigner.Fields().ByName("signer") +} + +var _ protoreflect.Message = (*fastReflection_ValidatorSigner)(nil) + +type fastReflection_ValidatorSigner ValidatorSigner + +func (x *ValidatorSigner) ProtoReflect() protoreflect.Message { + return (*fastReflection_ValidatorSigner)(x) +} + +func (x *ValidatorSigner) slowProtoReflect() protoreflect.Message { + mi := &file_signers_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_ValidatorSigner_messageType fastReflection_ValidatorSigner_messageType +var _ protoreflect.MessageType = fastReflection_ValidatorSigner_messageType{} + +type fastReflection_ValidatorSigner_messageType struct{} + +func (x fastReflection_ValidatorSigner_messageType) Zero() protoreflect.Message { + return (*fastReflection_ValidatorSigner)(nil) +} +func (x fastReflection_ValidatorSigner_messageType) New() protoreflect.Message { + return new(fastReflection_ValidatorSigner) +} +func (x fastReflection_ValidatorSigner_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ValidatorSigner +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ValidatorSigner) Descriptor() protoreflect.MessageDescriptor { + return md_ValidatorSigner +} + +// 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_ValidatorSigner) Type() protoreflect.MessageType { + return _fastReflection_ValidatorSigner_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ValidatorSigner) New() protoreflect.Message { + return new(fastReflection_ValidatorSigner) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ValidatorSigner) Interface() protoreflect.ProtoMessage { + return (*ValidatorSigner)(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_ValidatorSigner) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Signer != "" { + value := protoreflect.ValueOfString(x.Signer) + if !f(fd_ValidatorSigner_signer, 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_ValidatorSigner) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "ValidatorSigner.signer": + return x.Signer != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ValidatorSigner")) + } + panic(fmt.Errorf("message ValidatorSigner 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_ValidatorSigner) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "ValidatorSigner.signer": + x.Signer = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ValidatorSigner")) + } + panic(fmt.Errorf("message ValidatorSigner 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_ValidatorSigner) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "ValidatorSigner.signer": + value := x.Signer + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ValidatorSigner")) + } + panic(fmt.Errorf("message ValidatorSigner does not contain field %s", descriptor.FullName())) } } @@ -5982,77 +9234,147 @@ func (*RepeatedNestedSigner) Descriptor() ([]byte, []int) { return file_signers_proto_rawDescGZIP(), []int{3} } -func (x *RepeatedNestedSigner) GetInner() []*RepeatedNestedSigner_Inner { +func (x *RepeatedNestedSigner) GetInner() []*RepeatedNestedSigner_Inner { + if x != nil { + return x.Inner + } + return nil +} + +type NestedRepeatedSigner struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Inner *NestedRepeatedSigner_Inner `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (x *NestedRepeatedSigner) Reset() { + *x = NestedRepeatedSigner{} + if protoimpl.UnsafeEnabled { + mi := &file_signers_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NestedRepeatedSigner) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NestedRepeatedSigner) ProtoMessage() {} + +// Deprecated: Use NestedRepeatedSigner.ProtoReflect.Descriptor instead. +func (*NestedRepeatedSigner) Descriptor() ([]byte, []int) { + return file_signers_proto_rawDescGZIP(), []int{4} +} + +func (x *NestedRepeatedSigner) GetInner() *NestedRepeatedSigner_Inner { + if x != nil { + return x.Inner + } + return nil +} + +type RepeatedNestedRepeatedSigner struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Inner []*RepeatedNestedRepeatedSigner_Inner `protobuf:"bytes,1,rep,name=inner,proto3" json:"inner,omitempty"` +} + +func (x *RepeatedNestedRepeatedSigner) Reset() { + *x = RepeatedNestedRepeatedSigner{} + if protoimpl.UnsafeEnabled { + mi := &file_signers_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RepeatedNestedRepeatedSigner) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RepeatedNestedRepeatedSigner) ProtoMessage() {} + +// Deprecated: Use RepeatedNestedRepeatedSigner.ProtoReflect.Descriptor instead. +func (*RepeatedNestedRepeatedSigner) Descriptor() ([]byte, []int) { + return file_signers_proto_rawDescGZIP(), []int{5} +} + +func (x *RepeatedNestedRepeatedSigner) GetInner() []*RepeatedNestedRepeatedSigner_Inner { if x != nil { return x.Inner } return nil } -type NestedRepeatedSigner struct { +type DeeplyNestedSigner struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Inner *NestedRepeatedSigner_Inner `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"` + InnerOne *DeeplyNestedSigner_InnerOne `protobuf:"bytes,1,opt,name=inner_one,json=innerOne,proto3" json:"inner_one,omitempty"` } -func (x *NestedRepeatedSigner) Reset() { - *x = NestedRepeatedSigner{} +func (x *DeeplyNestedSigner) Reset() { + *x = DeeplyNestedSigner{} if protoimpl.UnsafeEnabled { - mi := &file_signers_proto_msgTypes[4] + mi := &file_signers_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *NestedRepeatedSigner) String() string { +func (x *DeeplyNestedSigner) String() string { return protoimpl.X.MessageStringOf(x) } -func (*NestedRepeatedSigner) ProtoMessage() {} +func (*DeeplyNestedSigner) ProtoMessage() {} -// Deprecated: Use NestedRepeatedSigner.ProtoReflect.Descriptor instead. -func (*NestedRepeatedSigner) Descriptor() ([]byte, []int) { - return file_signers_proto_rawDescGZIP(), []int{4} +// Deprecated: Use DeeplyNestedSigner.ProtoReflect.Descriptor instead. +func (*DeeplyNestedSigner) Descriptor() ([]byte, []int) { + return file_signers_proto_rawDescGZIP(), []int{6} } -func (x *NestedRepeatedSigner) GetInner() *NestedRepeatedSigner_Inner { +func (x *DeeplyNestedSigner) GetInnerOne() *DeeplyNestedSigner_InnerOne { if x != nil { - return x.Inner + return x.InnerOne } return nil } -type RepeatedNestedRepeatedSigner struct { +type DeeplyNestedRepeatedSigner struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Inner []*RepeatedNestedRepeatedSigner_Inner `protobuf:"bytes,1,rep,name=inner,proto3" json:"inner,omitempty"` + Inner []*DeeplyNestedRepeatedSigner_Inner `protobuf:"bytes,1,rep,name=inner,proto3" json:"inner,omitempty"` } -func (x *RepeatedNestedRepeatedSigner) Reset() { - *x = RepeatedNestedRepeatedSigner{} +func (x *DeeplyNestedRepeatedSigner) Reset() { + *x = DeeplyNestedRepeatedSigner{} if protoimpl.UnsafeEnabled { - mi := &file_signers_proto_msgTypes[5] + mi := &file_signers_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *RepeatedNestedRepeatedSigner) String() string { +func (x *DeeplyNestedRepeatedSigner) String() string { return protoimpl.X.MessageStringOf(x) } -func (*RepeatedNestedRepeatedSigner) ProtoMessage() {} +func (*DeeplyNestedRepeatedSigner) ProtoMessage() {} -// Deprecated: Use RepeatedNestedRepeatedSigner.ProtoReflect.Descriptor instead. -func (*RepeatedNestedRepeatedSigner) Descriptor() ([]byte, []int) { - return file_signers_proto_rawDescGZIP(), []int{5} +// Deprecated: Use DeeplyNestedRepeatedSigner.ProtoReflect.Descriptor instead. +func (*DeeplyNestedRepeatedSigner) Descriptor() ([]byte, []int) { + return file_signers_proto_rawDescGZIP(), []int{7} } -func (x *RepeatedNestedRepeatedSigner) GetInner() []*RepeatedNestedRepeatedSigner_Inner { +func (x *DeeplyNestedRepeatedSigner) GetInner() []*DeeplyNestedRepeatedSigner_Inner { if x != nil { return x.Inner } @@ -6070,7 +9392,7 @@ type BadSigner struct { func (x *BadSigner) Reset() { *x = BadSigner{} if protoimpl.UnsafeEnabled { - mi := &file_signers_proto_msgTypes[6] + mi := &file_signers_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6084,7 +9406,7 @@ func (*BadSigner) ProtoMessage() {} // Deprecated: Use BadSigner.ProtoReflect.Descriptor instead. func (*BadSigner) Descriptor() ([]byte, []int) { - return file_signers_proto_rawDescGZIP(), []int{6} + return file_signers_proto_rawDescGZIP(), []int{8} } func (x *BadSigner) GetSigner() []byte { @@ -6105,7 +9427,7 @@ type NoSignerOption struct { func (x *NoSignerOption) Reset() { *x = NoSignerOption{} if protoimpl.UnsafeEnabled { - mi := &file_signers_proto_msgTypes[7] + mi := &file_signers_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6119,7 +9441,7 @@ func (*NoSignerOption) ProtoMessage() {} // Deprecated: Use NoSignerOption.ProtoReflect.Descriptor instead. func (*NoSignerOption) Descriptor() ([]byte, []int) { - return file_signers_proto_rawDescGZIP(), []int{7} + return file_signers_proto_rawDescGZIP(), []int{9} } func (x *NoSignerOption) GetSigner() []byte { @@ -6140,7 +9462,7 @@ type ValidatorSigner struct { func (x *ValidatorSigner) Reset() { *x = ValidatorSigner{} if protoimpl.UnsafeEnabled { - mi := &file_signers_proto_msgTypes[8] + mi := &file_signers_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6154,7 +9476,7 @@ func (*ValidatorSigner) ProtoMessage() {} // Deprecated: Use ValidatorSigner.ProtoReflect.Descriptor instead. func (*ValidatorSigner) Descriptor() ([]byte, []int) { - return file_signers_proto_rawDescGZIP(), []int{8} + return file_signers_proto_rawDescGZIP(), []int{10} } func (x *ValidatorSigner) GetSigner() string { @@ -6175,7 +9497,7 @@ type NestedSigner_Inner struct { func (x *NestedSigner_Inner) Reset() { *x = NestedSigner_Inner{} if protoimpl.UnsafeEnabled { - mi := &file_signers_proto_msgTypes[9] + mi := &file_signers_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6210,7 +9532,7 @@ type RepeatedNestedSigner_Inner struct { func (x *RepeatedNestedSigner_Inner) Reset() { *x = RepeatedNestedSigner_Inner{} if protoimpl.UnsafeEnabled { - mi := &file_signers_proto_msgTypes[10] + mi := &file_signers_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6245,7 +9567,7 @@ type NestedRepeatedSigner_Inner struct { func (x *NestedRepeatedSigner_Inner) Reset() { *x = NestedRepeatedSigner_Inner{} if protoimpl.UnsafeEnabled { - mi := &file_signers_proto_msgTypes[11] + mi := &file_signers_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6280,7 +9602,7 @@ type RepeatedNestedRepeatedSigner_Inner struct { func (x *RepeatedNestedRepeatedSigner_Inner) Reset() { *x = RepeatedNestedRepeatedSigner_Inner{} if protoimpl.UnsafeEnabled { - mi := &file_signers_proto_msgTypes[12] + mi := &file_signers_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6304,6 +9626,181 @@ func (x *RepeatedNestedRepeatedSigner_Inner) GetSigner() []string { return nil } +type DeeplyNestedSigner_InnerOne struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InnerTwo *DeeplyNestedSigner_InnerOne_InnerTwo `protobuf:"bytes,1,opt,name=inner_two,json=innerTwo,proto3" json:"inner_two,omitempty"` +} + +func (x *DeeplyNestedSigner_InnerOne) Reset() { + *x = DeeplyNestedSigner_InnerOne{} + if protoimpl.UnsafeEnabled { + mi := &file_signers_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeeplyNestedSigner_InnerOne) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeeplyNestedSigner_InnerOne) ProtoMessage() {} + +// Deprecated: Use DeeplyNestedSigner_InnerOne.ProtoReflect.Descriptor instead. +func (*DeeplyNestedSigner_InnerOne) Descriptor() ([]byte, []int) { + return file_signers_proto_rawDescGZIP(), []int{6, 0} +} + +func (x *DeeplyNestedSigner_InnerOne) GetInnerTwo() *DeeplyNestedSigner_InnerOne_InnerTwo { + if x != nil { + return x.InnerTwo + } + return nil +} + +type DeeplyNestedSigner_InnerOne_InnerTwo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (x *DeeplyNestedSigner_InnerOne_InnerTwo) Reset() { + *x = DeeplyNestedSigner_InnerOne_InnerTwo{} + if protoimpl.UnsafeEnabled { + mi := &file_signers_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeeplyNestedSigner_InnerOne_InnerTwo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeeplyNestedSigner_InnerOne_InnerTwo) ProtoMessage() {} + +// Deprecated: Use DeeplyNestedSigner_InnerOne_InnerTwo.ProtoReflect.Descriptor instead. +func (*DeeplyNestedSigner_InnerOne_InnerTwo) Descriptor() ([]byte, []int) { + return file_signers_proto_rawDescGZIP(), []int{6, 0, 0} +} + +func (x *DeeplyNestedSigner_InnerOne_InnerTwo) GetSigner() string { + if x != nil { + return x.Signer + } + return "" +} + +type DeeplyNestedRepeatedSigner_Inner struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Inner []*DeeplyNestedRepeatedSigner_Inner_Inner `protobuf:"bytes,1,rep,name=inner,proto3" json:"inner,omitempty"` +} + +func (x *DeeplyNestedRepeatedSigner_Inner) Reset() { + *x = DeeplyNestedRepeatedSigner_Inner{} + if protoimpl.UnsafeEnabled { + mi := &file_signers_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeeplyNestedRepeatedSigner_Inner) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeeplyNestedRepeatedSigner_Inner) ProtoMessage() {} + +// Deprecated: Use DeeplyNestedRepeatedSigner_Inner.ProtoReflect.Descriptor instead. +func (*DeeplyNestedRepeatedSigner_Inner) Descriptor() ([]byte, []int) { + return file_signers_proto_rawDescGZIP(), []int{7, 0} +} + +func (x *DeeplyNestedRepeatedSigner_Inner) GetInner() []*DeeplyNestedRepeatedSigner_Inner_Inner { + if x != nil { + return x.Inner + } + return nil +} + +type DeeplyNestedRepeatedSigner_Inner_Inner struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Inner []*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom `protobuf:"bytes,1,rep,name=inner,proto3" json:"inner,omitempty"` +} + +func (x *DeeplyNestedRepeatedSigner_Inner_Inner) Reset() { + *x = DeeplyNestedRepeatedSigner_Inner_Inner{} + if protoimpl.UnsafeEnabled { + mi := &file_signers_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeeplyNestedRepeatedSigner_Inner_Inner) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeeplyNestedRepeatedSigner_Inner_Inner) ProtoMessage() {} + +// Deprecated: Use DeeplyNestedRepeatedSigner_Inner_Inner.ProtoReflect.Descriptor instead. +func (*DeeplyNestedRepeatedSigner_Inner_Inner) Descriptor() ([]byte, []int) { + return file_signers_proto_rawDescGZIP(), []int{7, 0, 0} +} + +func (x *DeeplyNestedRepeatedSigner_Inner_Inner) GetInner() []*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom { + if x != nil { + return x.Inner + } + return nil +} + +type DeeplyNestedRepeatedSigner_Inner_Inner_Bottom struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Signer []string `protobuf:"bytes,1,rep,name=signer,proto3" json:"signer,omitempty"` +} + +func (x *DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) Reset() { + *x = DeeplyNestedRepeatedSigner_Inner_Inner_Bottom{} + if protoimpl.UnsafeEnabled { + mi := &file_signers_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) ProtoMessage() {} + +// Deprecated: Use DeeplyNestedRepeatedSigner_Inner_Inner_Bottom.ProtoReflect.Descriptor instead. +func (*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) Descriptor() ([]byte, []int) { + return file_signers_proto_rawDescGZIP(), []int{7, 0, 0, 0} +} + +func (x *DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) GetSigner() []string { + if x != nil { + return x.Signer + } + return nil +} + var File_signers_proto protoreflect.FileDescriptor var file_signers_proto_rawDesc = []byte{ @@ -6351,28 +9848,63 @@ var file_signers_proto_rawDesc = []byte{ 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x3a, 0x0b, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x3a, 0x0a, 0x82, 0xe7, 0xb0, 0x2a, - 0x05, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x22, 0x30, 0x0a, 0x09, 0x42, 0x61, 0x64, 0x53, 0x69, 0x67, - 0x6e, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x3a, 0x0b, 0x82, 0xe7, 0xb0, - 0x2a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x28, 0x0a, 0x0e, 0x4e, 0x6f, 0x53, 0x69, - 0x67, 0x6e, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, - 0x67, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, - 0x65, 0x72, 0x22, 0x59, 0x0a, 0x0f, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, - 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x39, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, - 0x3a, 0x0b, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x32, 0x4d, 0x0a, - 0x10, 0x54, 0x65, 0x73, 0x74, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x65, - 0x72, 0x12, 0x32, 0x0a, 0x10, 0x54, 0x65, 0x73, 0x74, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x53, - 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x0d, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x53, 0x69, - 0x67, 0x6e, 0x65, 0x72, 0x1a, 0x0d, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x53, 0x69, 0x67, - 0x6e, 0x65, 0x72, 0x22, 0x00, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0x3b, 0x42, 0x0c, - 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x29, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x78, 0x2f, 0x74, - 0x78, 0x2f, 0x74, 0x65, 0x78, 0x74, 0x75, 0x61, 0x6c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x05, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x22, 0xf1, 0x01, 0x0a, 0x12, 0x44, 0x65, 0x65, 0x70, 0x6c, + 0x79, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x39, 0x0a, + 0x09, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x6f, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1c, 0x2e, 0x44, 0x65, 0x65, 0x70, 0x6c, 0x79, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x53, + 0x69, 0x67, 0x6e, 0x65, 0x72, 0x2e, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x4f, 0x6e, 0x65, 0x52, 0x08, + 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x4f, 0x6e, 0x65, 0x1a, 0x8f, 0x01, 0x0a, 0x08, 0x49, 0x6e, 0x6e, + 0x65, 0x72, 0x4f, 0x6e, 0x65, 0x12, 0x42, 0x0a, 0x09, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x74, + 0x77, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x44, 0x65, 0x65, 0x70, 0x6c, + 0x79, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x2e, 0x49, 0x6e, + 0x6e, 0x65, 0x72, 0x4f, 0x6e, 0x65, 0x2e, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x54, 0x77, 0x6f, 0x52, + 0x08, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x54, 0x77, 0x6f, 0x1a, 0x2f, 0x0a, 0x08, 0x49, 0x6e, 0x6e, + 0x65, 0x72, 0x54, 0x77, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x3a, 0x0b, 0x82, + 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, + 0x09, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x74, 0x77, 0x6f, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, + 0x09, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x6f, 0x6e, 0x65, 0x22, 0xc1, 0x02, 0x0a, 0x1a, 0x44, + 0x65, 0x65, 0x70, 0x6c, 0x79, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x70, 0x65, 0x61, + 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x37, 0x0a, 0x05, 0x69, 0x6e, 0x6e, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x44, 0x65, 0x65, 0x70, 0x6c, + 0x79, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x53, + 0x69, 0x67, 0x6e, 0x65, 0x72, 0x2e, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x52, 0x05, 0x69, 0x6e, 0x6e, + 0x65, 0x72, 0x1a, 0xdd, 0x01, 0x0a, 0x05, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x12, 0x3d, 0x0a, 0x05, + 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x44, 0x65, + 0x65, 0x70, 0x6c, 0x79, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x2e, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x49, + 0x6e, 0x6e, 0x65, 0x72, 0x52, 0x05, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x1a, 0x88, 0x01, 0x0a, 0x05, + 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x12, 0x44, 0x0a, 0x05, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x44, 0x65, 0x65, 0x70, 0x6c, 0x79, 0x4e, 0x65, 0x73, + 0x74, 0x65, 0x64, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x65, + 0x72, 0x2e, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x42, 0x6f, + 0x74, 0x74, 0x6f, 0x6d, 0x52, 0x05, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x1a, 0x2d, 0x0a, 0x06, 0x42, + 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x3a, 0x0b, 0x82, + 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x3a, 0x0a, 0x82, 0xe7, 0xb0, 0x2a, + 0x05, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x3a, 0x0a, 0x82, 0xe7, 0xb0, 0x2a, 0x05, 0x69, 0x6e, 0x6e, + 0x65, 0x72, 0x3a, 0x0a, 0x82, 0xe7, 0xb0, 0x2a, 0x05, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x22, 0x30, + 0x0a, 0x09, 0x42, 0x61, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, + 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x69, 0x67, + 0x6e, 0x65, 0x72, 0x3a, 0x0b, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, + 0x22, 0x28, 0x0a, 0x0e, 0x4e, 0x6f, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x59, 0x0a, 0x0f, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x39, 0x0a, + 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, + 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x3a, 0x0b, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, + 0x69, 0x67, 0x6e, 0x65, 0x72, 0x32, 0x4d, 0x0a, 0x10, 0x54, 0x65, 0x73, 0x74, 0x53, 0x69, 0x6d, + 0x70, 0x6c, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x10, 0x54, 0x65, 0x73, + 0x74, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x0d, 0x2e, + 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x1a, 0x0d, 0x2e, 0x53, + 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x00, 0x1a, 0x05, 0x80, + 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0x3b, 0x42, 0x0c, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x73, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x29, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, + 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x78, 0x2f, 0x74, 0x78, 0x2f, 0x74, 0x65, 0x78, 0x74, 0x75, 0x61, + 0x6c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, + 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -6387,34 +9919,46 @@ func file_signers_proto_rawDescGZIP() []byte { return file_signers_proto_rawDescData } -var file_signers_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_signers_proto_msgTypes = make([]protoimpl.MessageInfo, 20) var file_signers_proto_goTypes = []interface{}{ - (*SimpleSigner)(nil), // 0: SimpleSigner - (*RepeatedSigner)(nil), // 1: RepeatedSigner - (*NestedSigner)(nil), // 2: NestedSigner - (*RepeatedNestedSigner)(nil), // 3: RepeatedNestedSigner - (*NestedRepeatedSigner)(nil), // 4: NestedRepeatedSigner - (*RepeatedNestedRepeatedSigner)(nil), // 5: RepeatedNestedRepeatedSigner - (*BadSigner)(nil), // 6: BadSigner - (*NoSignerOption)(nil), // 7: NoSignerOption - (*ValidatorSigner)(nil), // 8: ValidatorSigner - (*NestedSigner_Inner)(nil), // 9: NestedSigner.Inner - (*RepeatedNestedSigner_Inner)(nil), // 10: RepeatedNestedSigner.Inner - (*NestedRepeatedSigner_Inner)(nil), // 11: NestedRepeatedSigner.Inner - (*RepeatedNestedRepeatedSigner_Inner)(nil), // 12: RepeatedNestedRepeatedSigner.Inner + (*SimpleSigner)(nil), // 0: SimpleSigner + (*RepeatedSigner)(nil), // 1: RepeatedSigner + (*NestedSigner)(nil), // 2: NestedSigner + (*RepeatedNestedSigner)(nil), // 3: RepeatedNestedSigner + (*NestedRepeatedSigner)(nil), // 4: NestedRepeatedSigner + (*RepeatedNestedRepeatedSigner)(nil), // 5: RepeatedNestedRepeatedSigner + (*DeeplyNestedSigner)(nil), // 6: DeeplyNestedSigner + (*DeeplyNestedRepeatedSigner)(nil), // 7: DeeplyNestedRepeatedSigner + (*BadSigner)(nil), // 8: BadSigner + (*NoSignerOption)(nil), // 9: NoSignerOption + (*ValidatorSigner)(nil), // 10: ValidatorSigner + (*NestedSigner_Inner)(nil), // 11: NestedSigner.Inner + (*RepeatedNestedSigner_Inner)(nil), // 12: RepeatedNestedSigner.Inner + (*NestedRepeatedSigner_Inner)(nil), // 13: NestedRepeatedSigner.Inner + (*RepeatedNestedRepeatedSigner_Inner)(nil), // 14: RepeatedNestedRepeatedSigner.Inner + (*DeeplyNestedSigner_InnerOne)(nil), // 15: DeeplyNestedSigner.InnerOne + (*DeeplyNestedSigner_InnerOne_InnerTwo)(nil), // 16: DeeplyNestedSigner.InnerOne.InnerTwo + (*DeeplyNestedRepeatedSigner_Inner)(nil), // 17: DeeplyNestedRepeatedSigner.Inner + (*DeeplyNestedRepeatedSigner_Inner_Inner)(nil), // 18: DeeplyNestedRepeatedSigner.Inner.Inner + (*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom)(nil), // 19: DeeplyNestedRepeatedSigner.Inner.Inner.Bottom } var file_signers_proto_depIdxs = []int32{ - 9, // 0: NestedSigner.inner:type_name -> NestedSigner.Inner - 10, // 1: RepeatedNestedSigner.inner:type_name -> RepeatedNestedSigner.Inner - 11, // 2: NestedRepeatedSigner.inner:type_name -> NestedRepeatedSigner.Inner - 12, // 3: RepeatedNestedRepeatedSigner.inner:type_name -> RepeatedNestedRepeatedSigner.Inner - 0, // 4: TestSimpleSigner.TestSimpleSigner:input_type -> SimpleSigner - 0, // 5: TestSimpleSigner.TestSimpleSigner:output_type -> SimpleSigner - 5, // [5:6] is the sub-list for method output_type - 4, // [4:5] 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 + 11, // 0: NestedSigner.inner:type_name -> NestedSigner.Inner + 12, // 1: RepeatedNestedSigner.inner:type_name -> RepeatedNestedSigner.Inner + 13, // 2: NestedRepeatedSigner.inner:type_name -> NestedRepeatedSigner.Inner + 14, // 3: RepeatedNestedRepeatedSigner.inner:type_name -> RepeatedNestedRepeatedSigner.Inner + 15, // 4: DeeplyNestedSigner.inner_one:type_name -> DeeplyNestedSigner.InnerOne + 17, // 5: DeeplyNestedRepeatedSigner.inner:type_name -> DeeplyNestedRepeatedSigner.Inner + 16, // 6: DeeplyNestedSigner.InnerOne.inner_two:type_name -> DeeplyNestedSigner.InnerOne.InnerTwo + 18, // 7: DeeplyNestedRepeatedSigner.Inner.inner:type_name -> DeeplyNestedRepeatedSigner.Inner.Inner + 19, // 8: DeeplyNestedRepeatedSigner.Inner.Inner.inner:type_name -> DeeplyNestedRepeatedSigner.Inner.Inner.Bottom + 0, // 9: TestSimpleSigner.TestSimpleSigner:input_type -> SimpleSigner + 0, // 10: TestSimpleSigner.TestSimpleSigner:output_type -> SimpleSigner + 10, // [10:11] is the sub-list for method output_type + 9, // [9:10] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name } func init() { file_signers_proto_init() } @@ -6496,7 +10040,7 @@ func file_signers_proto_init() { } } file_signers_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BadSigner); i { + switch v := v.(*DeeplyNestedSigner); i { case 0: return &v.state case 1: @@ -6508,7 +10052,7 @@ func file_signers_proto_init() { } } file_signers_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NoSignerOption); i { + switch v := v.(*DeeplyNestedRepeatedSigner); i { case 0: return &v.state case 1: @@ -6520,7 +10064,7 @@ func file_signers_proto_init() { } } file_signers_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ValidatorSigner); i { + switch v := v.(*BadSigner); i { case 0: return &v.state case 1: @@ -6532,7 +10076,7 @@ func file_signers_proto_init() { } } file_signers_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NestedSigner_Inner); i { + switch v := v.(*NoSignerOption); i { case 0: return &v.state case 1: @@ -6544,7 +10088,7 @@ func file_signers_proto_init() { } } file_signers_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RepeatedNestedSigner_Inner); i { + switch v := v.(*ValidatorSigner); i { case 0: return &v.state case 1: @@ -6556,7 +10100,7 @@ func file_signers_proto_init() { } } file_signers_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NestedRepeatedSigner_Inner); i { + switch v := v.(*NestedSigner_Inner); i { case 0: return &v.state case 1: @@ -6568,6 +10112,30 @@ func file_signers_proto_init() { } } file_signers_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RepeatedNestedSigner_Inner); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_signers_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NestedRepeatedSigner_Inner); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_signers_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RepeatedNestedRepeatedSigner_Inner); i { case 0: return &v.state @@ -6579,6 +10147,66 @@ func file_signers_proto_init() { return nil } } + file_signers_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeeplyNestedSigner_InnerOne); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_signers_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeeplyNestedSigner_InnerOne_InnerTwo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_signers_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeeplyNestedRepeatedSigner_Inner); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_signers_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeeplyNestedRepeatedSigner_Inner_Inner); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_signers_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom); 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{ @@ -6586,7 +10214,7 @@ func file_signers_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_signers_proto_rawDesc, NumEnums: 0, - NumMessages: 13, + NumMessages: 20, NumExtensions: 0, NumServices: 1, }, diff --git a/x/tx/signing/aminojson/aminojson.go b/x/tx/signing/aminojson/aminojson.go index 6fc6e97e49b6..b6ceba2c91b5 100644 --- a/x/tx/signing/aminojson/aminojson.go +++ b/x/tx/signing/aminojson/aminojson.go @@ -2,9 +2,10 @@ package aminojson import ( "context" - "encoding/json" + "errors" "fmt" + gogoproto "github.com/cosmos/gogoproto/proto" "google.golang.org/protobuf/reflect/protoregistry" signingv1beta1 "cosmossdk.io/api/cosmos/tx/signing/v1beta1" @@ -23,7 +24,7 @@ type SignModeHandler struct { // SignModeHandlerOptions are the options for the SignModeHandler. type SignModeHandlerOptions struct { FileResolver signing.ProtoFileResolver - TypeResolver protoregistry.MessageTypeResolver + TypeResolver signing.TypeResolver Encoder *Encoder } @@ -31,7 +32,7 @@ type SignModeHandlerOptions struct { func NewSignModeHandler(options SignModeHandlerOptions) *SignModeHandler { h := &SignModeHandler{} if options.FileResolver == nil { - h.fileResolver = protoregistry.GlobalFiles + h.fileResolver = gogoproto.HybridResolver } else { h.fileResolver = options.FileResolver } @@ -44,6 +45,7 @@ func NewSignModeHandler(options SignModeHandlerOptions) *SignModeHandler { h.encoder = NewEncoder(EncoderOptions{ FileResolver: options.FileResolver, TypeResolver: options.TypeResolver, + EnumAsString: false, // ensure enum as string is disabled }) } else { h.encoder = *options.Encoder @@ -73,65 +75,34 @@ func (h SignModeHandler) GetSignBytes(_ context.Context, signerData signing.Sign return nil, fmt.Errorf("got empty address in %s handler: invalid request", h.Mode()) } - tip := txData.AuthInfo.Tip - if tip != nil && tip.Tipper == "" { - return nil, fmt.Errorf("tipper cannot be empty") - } - isTipper := tip != nil && tip.Tipper == signerData.Address - // We set a convention that if the tipper signs with LEGACY_AMINO_JSON, then // they sign over empty fees and 0 gas. var fee *aminojsonpb.AminoSignFee - if isTipper { - fee = &aminojsonpb.AminoSignFee{ - Amount: nil, - Gas: 0, - } - } else { - f := txData.AuthInfo.Fee - if f == nil { - return nil, fmt.Errorf("fee cannot be nil when tipper is not signer") - } - fee = &aminojsonpb.AminoSignFee{ - Amount: f.Amount, - Gas: f.GasLimit, - Payer: f.Payer, - Granter: f.Granter, - } - } - signDoc := &aminojsonpb.AminoSignDoc{ - AccountNumber: signerData.AccountNumber, - TimeoutHeight: body.TimeoutHeight, - ChainId: signerData.ChainID, - Sequence: signerData.Sequence, - Memo: body.Memo, - Msgs: txData.Body.Messages, - Fee: fee, - Tip: tip, + f := txData.AuthInfo.Fee + if f == nil { + return nil, errors.New("fee cannot be nil when tipper is not signer") } - - bz, err := h.encoder.Marshal(signDoc) - if err != nil { - return nil, err + fee = &aminojsonpb.AminoSignFee{ + Amount: f.Amount, + Gas: f.GasLimit, + Payer: f.Payer, + Granter: f.Granter, } - // TODO: remove this sort once https://github.com/cosmos/cosmos-sdk/issues/2350#issuecomment-1542715157 lands - // the encoder should be rendering fields in lexical order - return sortJSON(bz) -} -// sortJSON sorts the JSON keys of the given JSON encoded byte slice. -func sortJSON(toSortJSON []byte) ([]byte, error) { - var c interface{} - err := json.Unmarshal(toSortJSON, &c) - if err != nil { - return nil, err - } - js, err := json.Marshal(c) - if err != nil { - return nil, err + signDoc := &aminojsonpb.AminoSignDoc{ + AccountNumber: signerData.AccountNumber, + TimeoutHeight: body.TimeoutHeight, + ChainId: signerData.ChainID, + Sequence: signerData.Sequence, + Memo: body.Memo, + Msgs: txData.Body.Messages, + Unordered: txData.Body.Unordered, + TimeoutTimestamp: txData.Body.TimeoutTimestamp, + Fee: fee, } - return js, nil + + return h.encoder.Marshal(signDoc) } var _ signing.SignModeHandler = (*SignModeHandler)(nil) diff --git a/x/tx/signing/aminojson/aminojson_test.go b/x/tx/signing/aminojson/aminojson_test.go index f354bda01360..3ec9de032d39 100644 --- a/x/tx/signing/aminojson/aminojson_test.go +++ b/x/tx/signing/aminojson/aminojson_test.go @@ -2,10 +2,13 @@ package aminojson_test import ( "context" + "encoding/json" "testing" + "time" "github.com/stretchr/testify/require" "google.golang.org/protobuf/reflect/protoregistry" + "google.golang.org/protobuf/types/known/timestamppb" bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" @@ -21,7 +24,6 @@ func TestAminoJsonSignMode(t *testing.T) { handlerOptions := testutil.HandlerArgumentOptions{ ChainID: "test-chain", Memo: "sometestmemo", - Tip: &txv1beta1.Tip{Tipper: "tipper", Amount: []*basev1beta1.Coin{{Denom: "Tip-token", Amount: "10"}}}, Msg: &bankv1beta1.MsgSend{ FromAddress: "foo", ToAddress: "bar", @@ -52,37 +54,14 @@ func TestAminoJsonSignMode(t *testing.T) { }, error: "got empty address in SIGN_MODE_LEGACY_AMINO_JSON handler: invalid request", }, - { - name: "nil tip", - malleate: func(opts testutil.HandlerArgumentOptions) testutil.HandlerArgumentOptions { - opts.Tip = nil - return opts - }, - }, - { - name: "empty tipper", - malleate: func(opts testutil.HandlerArgumentOptions) testutil.HandlerArgumentOptions { - opts.Tip.Tipper = "" - return opts - }, - error: "tipper cannot be empty", - }, { name: "nil fee", malleate: func(opts testutil.HandlerArgumentOptions) testutil.HandlerArgumentOptions { - opts.Tip.Tipper = "tipper" opts.Fee = nil return opts }, error: "fee cannot be nil", }, - { - name: "tipper is signer", - malleate: func(opts testutil.HandlerArgumentOptions) testutil.HandlerArgumentOptions { - opts.Tip.Tipper = opts.SignerAddress - return opts - }, - }, } for _, tc := range testCases { @@ -102,6 +81,146 @@ func TestAminoJsonSignMode(t *testing.T) { }) } } +func TestUnorderedTimeoutCompat(t *testing.T) { + fee := &txv1beta1.Fee{ + Amount: []*basev1beta1.Coin{{Denom: "uatom", Amount: "1000"}}, + } + + now := time.Now() + tests := []struct { + name string + unordered bool + timeout *timestamppb.Timestamp + wantUnordered any + wantTimeoutEmpty bool + }{ + { + name: "empty unordered and timeout", + unordered: false, + timeout: nil, + wantUnordered: nil, + wantTimeoutEmpty: true, + }, + { + name: "business unordered and timeout", + unordered: true, + timeout: func() *timestamppb.Timestamp { t := now.Add(3 * time.Hour); return timestamppb.New(t) }(), + wantUnordered: true, + wantTimeoutEmpty: false, + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + opts := testutil.HandlerArgumentOptions{ + ChainID: "test-chain", + Memo: "sometestmemo", + Msg: &bankv1beta1.MsgSend{ + FromAddress: "foo", + ToAddress: "bar", + Amount: []*basev1beta1.Coin{{Denom: "demon", Amount: "100"}}, + }, + AccNum: 1, + AccSeq: 2, + SignerAddress: "signerAddress", + Fee: fee, + Unordered: tc.unordered, + Timeouttimestamp: tc.timeout, + } + + signerData, txData, err := testutil.MakeHandlerArguments(opts) + require.NoError(t, err) + + handler := aminojson.NewSignModeHandler(aminojson.SignModeHandlerOptions{}) + bz, err := handler.GetSignBytes(context.Background(), signerData, txData) + require.NoError(t, err) + + var result map[string]any + require.NoError(t, json.Unmarshal(bz, &result)) + + require.Equal(t, tc.wantUnordered, result["unordered"]) + + if tc.wantTimeoutEmpty { + require.Empty(t, result["timeout_timestamp"]) + } else { + require.NotEmpty(t, result["timeout_timestamp"]) + gotTimeStr := result["timeout_timestamp"].(string) + gotTime, err := time.Parse("2006-01-02T15:04:05.999999Z", gotTimeStr) + require.NoError(t, err) + require.True(t, gotTime.Equal(tc.timeout.AsTime())) + } + }) + } +} + +func TestUnorderedEmpty(t *testing.T) { + fee := &txv1beta1.Fee{ + Amount: []*basev1beta1.Coin{{Denom: "uatom", Amount: "1000"}}, + } + + opts := testutil.HandlerArgumentOptions{ + ChainID: "test-chain", + Memo: "sometestmemo", + Msg: &bankv1beta1.MsgSend{ + FromAddress: "foo", + ToAddress: "bar", + Amount: []*basev1beta1.Coin{{Denom: "demon", Amount: "100"}}, + }, + AccNum: 1, + AccSeq: 2, + SignerAddress: "signerAddress", + Fee: fee, + } + signerData, txData, err := testutil.MakeHandlerArguments(opts) + require.NoError(t, err) + + handler := aminojson.NewSignModeHandler(aminojson.SignModeHandlerOptions{}) + bz, err := handler.GetSignBytes(context.Background(), signerData, txData) + require.NoError(t, err) + + var result map[string]any + require.NoError(t, json.Unmarshal(bz, &result)) + require.Empty(t, result["unordered"]) + require.Empty(t, result["timeout_timestamp"]) +} + +func TestUnorderedBusiness(t *testing.T) { + fee := &txv1beta1.Fee{ + Amount: []*basev1beta1.Coin{{Denom: "uatom", Amount: "1000"}}, + } + + timeout := time.Now().Add(3 * time.Hour) + opts := testutil.HandlerArgumentOptions{ + ChainID: "test-chain", + Memo: "sometestmemo", + Msg: &bankv1beta1.MsgSend{ + FromAddress: "foo", + ToAddress: "bar", + Amount: []*basev1beta1.Coin{{Denom: "demon", Amount: "100"}}, + }, + AccNum: 1, + AccSeq: 2, + SignerAddress: "signerAddress", + Fee: fee, + Unordered: true, + Timeouttimestamp: timestamppb.New(timeout), + } + signerData, txData, err := testutil.MakeHandlerArguments(opts) + require.NoError(t, err) + + handler := aminojson.NewSignModeHandler(aminojson.SignModeHandlerOptions{}) + bz, err := handler.GetSignBytes(context.Background(), signerData, txData) + require.NoError(t, err) + + var result map[string]any + require.NoError(t, json.Unmarshal(bz, &result)) + require.Equal(t, true, result["unordered"]) + require.NotEmpty(t, result["timeout_timestamp"]) + gotTimeStr := result["timeout_timestamp"].(string) + gotTime, err := time.Parse("2006-01-02T15:04:05.999999Z", gotTimeStr) + require.NoError(t, err) + require.True(t, gotTime.Equal(timeout)) +} func TestNewSignModeHandler(t *testing.T) { handler := aminojson.NewSignModeHandler(aminojson.SignModeHandlerOptions{}) diff --git a/x/tx/signing/aminojson/any.go b/x/tx/signing/aminojson/any.go index 6b4963d16cae..c7e304a46977 100644 --- a/x/tx/signing/aminojson/any.go +++ b/x/tx/signing/aminojson/any.go @@ -4,20 +4,19 @@ import ( "fmt" "io" - "google.golang.org/protobuf/types/dynamicpb" - "google.golang.org/protobuf/types/known/anypb" - "github.com/pkg/errors" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/types/dynamicpb" + "google.golang.org/protobuf/types/known/anypb" ) -func (enc Encoder) marshalAny(message protoreflect.Message, writer io.Writer) error { +func marshalAny(enc *Encoder, message protoreflect.Message, writer io.Writer) error { // when a message contains a nested any field, and the top-level message has been unmarshalled into a dyanmicpb, // the nested any field will also be a dynamicpb. In this case, we must use the dynamicpb API. _, ok := message.Interface().(*dynamicpb.Message) if ok { - return enc.marshalDynamic(message, writer) + return marshalDynamic(enc, message, writer) } anyMsg, ok := message.Interface().(*anypb.Any) @@ -51,13 +50,7 @@ func (enc Encoder) marshalAny(message protoreflect.Message, writer io.Writer) er protoMessage = valueMsg.ProtoReflect() } - _, named := getMessageAminoName(protoMessage.Descriptor().Options()) - if !named { - return fmt.Errorf("message %s is packed into an any field, so requires an amino.name annotation", - anyMsg.TypeUrl) - } - - return enc.beginMarshal(protoMessage, writer) + return enc.beginMarshal(protoMessage, writer, true) } const ( @@ -65,7 +58,7 @@ const ( anyValueFieldName = "value" ) -func (enc Encoder) marshalDynamic(message protoreflect.Message, writer io.Writer) error { +func marshalDynamic(enc *Encoder, message protoreflect.Message, writer io.Writer) error { msgName := message.Get(message.Descriptor().Fields().ByName(anyTypeURLFieldName)).String()[1:] msgBytes := message.Get(message.Descriptor().Fields().ByName(anyValueFieldName)).Bytes() @@ -74,17 +67,11 @@ func (enc Encoder) marshalDynamic(message protoreflect.Message, writer io.Writer return errors.Wrapf(err, "can't resolve type URL %s", msgName) } - _, named := getMessageAminoName(desc.Options()) - if !named { - return fmt.Errorf("message %s is packed into an any field, so requires an amino.name annotation", - msgName) - } - valueMsg := dynamicpb.NewMessageType(desc.(protoreflect.MessageDescriptor)).New().Interface() err = proto.Unmarshal(msgBytes, valueMsg) if err != nil { return err } - return enc.beginMarshal(valueMsg.ProtoReflect(), writer) + return enc.beginMarshal(valueMsg.ProtoReflect(), writer, true) } diff --git a/x/tx/signing/aminojson/bench_test.go b/x/tx/signing/aminojson/bench_test.go index 9ccc11ddcf68..49f9302d4b7b 100644 --- a/x/tx/signing/aminojson/bench_test.go +++ b/x/tx/signing/aminojson/bench_test.go @@ -40,6 +40,7 @@ func BenchmarkAminoJSONDefaultSort(b *testing.B) { } func benchmarkAminoJSON(b *testing.B, addNaiveSort bool) { + b.Helper() enc := aminojson.NewEncoder(aminojson.EncoderOptions{DoNotSortFields: addNaiveSort}) b.ReportAllocs() b.ResetTimer() @@ -54,6 +55,7 @@ func benchmarkAminoJSON(b *testing.B, addNaiveSort bool) { } func runAminoJSON(b *testing.B, enc aminojson.Encoder, addNaiveSort bool) []byte { + b.Helper() bz, err := enc.Marshal(msg) if err != nil { b.Fatal(err) diff --git a/x/tx/signing/aminojson/encoder.go b/x/tx/signing/aminojson/encoder.go index acb899edbd61..6c26bdb7ed99 100644 --- a/x/tx/signing/aminojson/encoder.go +++ b/x/tx/signing/aminojson/encoder.go @@ -5,6 +5,7 @@ import ( "encoding/json" "fmt" "io" + "sort" "github.com/pkg/errors" "google.golang.org/protobuf/reflect/protoreflect" @@ -42,7 +43,7 @@ func cosmosIntEncoder(_ *Encoder, v protoreflect.Value, w io.Writer) error { } } -// cosmosDecEncoder provides legacy compatible encoding for cosmos.Dec and cosmos.Int types. These are sometimes +// cosmosDecEncoder provides legacy compatible encoding for cosmos.Dec types. These are sometimes // represented as strings in pulsar messages and sometimes as bytes. This encoder handles both cases. func cosmosDecEncoder(_ *Encoder, v protoreflect.Value, w io.Writer) error { switch val := v.Interface().(type) { @@ -50,7 +51,12 @@ func cosmosDecEncoder(_ *Encoder, v protoreflect.Value, w io.Writer) error { if val == "" { return jsonMarshal(w, "0") } - return jsonMarshal(w, val) + var dec math.LegacyDec + err := dec.Unmarshal([]byte(val)) + if err != nil { + return fmt.Errorf("failed to unmarshal for Amino JSON encoding; string %q into Dec: %w", val, err) + } + return jsonMarshal(w, dec.String()) case []byte: if len(val) == 0 { return jsonMarshal(w, "0") @@ -72,15 +78,37 @@ func nullSliceAsEmptyEncoder(enc *Encoder, v protoreflect.Value, w io.Writer) er switch list := v.Interface().(type) { case protoreflect.List: if list.Len() == 0 { - _, err := w.Write([]byte("[]")) + _, err := io.WriteString(w, "[]") return err } - return enc.marshalList(list, w) + return enc.marshalList(list, nil /* no field descriptor available here */, w) default: return fmt.Errorf("unsupported type %T", list) } } +// cosmosInlineJSON takes bytes and inlines them into a JSON document. +// +// This requires the bytes contain valid JSON since otherwise the resulting document would be invalid. +// Invalid JSON will result in an error. +// +// This replicates the behavior of JSON messages embedded in protobuf bytes +// required for CosmWasm, e.g.: +// https://github.com/CosmWasm/wasmd/blob/08567ff20e372e4f4204a91ca64a371538742bed/x/wasm/types/tx.go#L20-L22 +func cosmosInlineJSON(_ *Encoder, v protoreflect.Value, w io.Writer) error { + switch bz := v.Interface().(type) { + case []byte: + json, err := sortedJSONStringify(bz) + if err != nil { + return errors.Wrap(err, "could not normalize JSON") + } + _, err = w.Write(json) + return err + default: + return fmt.Errorf("unsupported type %T", bz) + } +} + // keyFieldEncoder replicates the behavior at described at: // https://github.com/cosmos/cosmos-sdk/blob/b49f948b36bc991db5be431607b475633aed697e/proto/cosmos/crypto/secp256k1/keys.proto#L16 // The message is treated if it were bytes directly without the key field specified. @@ -102,33 +130,47 @@ func keyFieldEncoder(_ *Encoder, msg protoreflect.Message, w io.Writer) error { } type moduleAccountPretty struct { - Address string `json:"address"` - PubKey string `json:"public_key"` AccountNumber uint64 `json:"account_number"` - Sequence uint64 `json:"sequence"` + Address string `json:"address"` Name string `json:"name"` Permissions []string `json:"permissions"` + PubKey string `json:"public_key"` + Sequence uint64 `json:"sequence"` } // moduleAccountEncoder replicates the behavior in // https://github.com/cosmos/cosmos-sdk/blob/41a3dfeced2953beba3a7d11ec798d17ee19f506/x/auth/types/account.go#L230-L254 func moduleAccountEncoder(_ *Encoder, msg protoreflect.Message, w io.Writer) error { - ma := msg.Interface().(*authapi.ModuleAccount) + ma := &authapi.ModuleAccount{} + msgDesc := msg.Descriptor() + if msgDesc.FullName() != ma.ProtoReflect().Descriptor().FullName() { + return errors.New("moduleAccountEncoder: msg not a auth.ModuleAccount") + } + fields := msgDesc.Fields() + pretty := moduleAccountPretty{ - PubKey: "", - Name: ma.Name, - Permissions: ma.Permissions, - } - if ma.BaseAccount != nil { - pretty.Address = ma.BaseAccount.Address - pretty.AccountNumber = ma.BaseAccount.AccountNumber - pretty.Sequence = ma.BaseAccount.Sequence + PubKey: "", + Name: msg.Get(fields.ByName("name")).String(), + } + permissions := msg.Get(fields.ByName("permissions")).List() + for i := 0; i < permissions.Len(); i++ { + pretty.Permissions = append(pretty.Permissions, permissions.Get(i).String()) + } + + if msg.Has(fields.ByName("base_account")) { + baseAccount := msg.Get(fields.ByName("base_account")) + baMsg := baseAccount.Message() + bamdFields := baMsg.Descriptor().Fields() + pretty.Address = baMsg.Get(bamdFields.ByName("address")).String() + pretty.AccountNumber = baMsg.Get(bamdFields.ByName("account_number")).Uint() + pretty.Sequence = baMsg.Get(bamdFields.ByName("sequence")).Uint() } else { pretty.Address = "" pretty.AccountNumber = 0 pretty.Sequence = 0 } + // we do not want to use the json encoder here because it adds a newline bz, err := json.Marshal(pretty) if err != nil { return err @@ -142,28 +184,72 @@ func moduleAccountEncoder(_ *Encoder, msg protoreflect.Message, w io.Writer) err // also see: // https://github.com/cosmos/cosmos-sdk/blob/b49f948b36bc991db5be431607b475633aed697e/proto/cosmos/crypto/multisig/keys.proto#L15/ func thresholdStringEncoder(enc *Encoder, msg protoreflect.Message, w io.Writer) error { - pk, ok := msg.Interface().(*multisig.LegacyAminoPubKey) - if !ok { + pk := &multisig.LegacyAminoPubKey{} + msgDesc := msg.Descriptor() + fields := msgDesc.Fields() + if msgDesc.FullName() != pk.ProtoReflect().Descriptor().FullName() { return errors.New("thresholdStringEncoder: msg not a multisig.LegacyAminoPubKey") } - _, err := w.Write([]byte(fmt.Sprintf(`{"threshold":"%d","pubkeys":`, pk.Threshold))) - if err != nil { - return err - } - if len(pk.PublicKeys) == 0 { - _, err = w.Write([]byte(`[]}`)) - return err - } - - fields := msg.Descriptor().Fields() pubkeysField := fields.ByName("public_keys") pubkeys := msg.Get(pubkeysField).List() - err = enc.marshalList(pubkeys, w) + _, err := io.WriteString(w, `{"pubkeys":`) if err != nil { return err } - _, err = w.Write([]byte(`}`)) + if pubkeys.Len() == 0 { + _, err := io.WriteString(w, `[]`) + if err != nil { + return err + } + } else { + err := enc.marshalList(pubkeys, pubkeysField, w) + if err != nil { + return err + } + } + + threshold := fields.ByName("threshold") + _, err = fmt.Fprintf(w, `,"threshold":"%d"}`, msg.Get(threshold).Uint()) return err } + +// sortedObject returns a new object that mirrors the structure of the original +// but with all maps having their keys sorted. +func sortedObject(obj interface{}) interface{} { + switch v := obj.(type) { + case map[string]interface{}: + sortedKeys := make([]string, 0, len(v)) + for key := range v { + sortedKeys = append(sortedKeys, key) + } + sort.Strings(sortedKeys) + result := make(map[string]interface{}) + for _, key := range sortedKeys { + result[key] = sortedObject(v[key]) + } + return result + case []interface{}: + for i, val := range v { + v[i] = sortedObject(val) + } + return v + default: + return obj + } +} + +// sortedJSONStringify returns a JSON with objects sorted by key. +func sortedJSONStringify(jsonBytes []byte) ([]byte, error) { + var obj interface{} + if err := json.Unmarshal(jsonBytes, &obj); err != nil { + return nil, errors.New("invalid JSON bytes") + } + sorted := sortedObject(obj) + jsonData, err := json.Marshal(sorted) + if err != nil { + return nil, err + } + return jsonData, nil +} diff --git a/x/tx/signing/aminojson/encoder_test.go b/x/tx/signing/aminojson/encoder_test.go new file mode 100644 index 000000000000..42f47638d1df --- /dev/null +++ b/x/tx/signing/aminojson/encoder_test.go @@ -0,0 +1,174 @@ +package aminojson + +import ( + "bytes" + "testing" + + "github.com/stretchr/testify/require" + "google.golang.org/protobuf/reflect/protoreflect" + "gotest.tools/v3/assert" +) + +func TestCosmosInlineJSON(t *testing.T) { + cases := map[string]struct { + value protoreflect.Value + wantErr bool + wantOutput string + }{ + "supported type - valid JSON object": { + value: protoreflect.ValueOfBytes([]byte(`{"test":"value"}`)), + wantErr: false, + wantOutput: `{"test":"value"}`, + }, + "supported type - valid JSON array": { + // spaces are normalized away + value: protoreflect.ValueOfBytes([]byte(`[1,2,3]`)), + wantErr: false, + wantOutput: `[1,2,3]`, + }, + "supported type - valid JSON is normalized": { + value: protoreflect.ValueOfBytes([]byte(`[1, 2, 3]`)), + wantErr: false, + wantOutput: `[1,2,3]`, + }, + "supported type - valid JSON array (empty)": { + value: protoreflect.ValueOfBytes([]byte(`[]`)), + wantErr: false, + wantOutput: `[]`, + }, + "supported type - valid JSON number": { + value: protoreflect.ValueOfBytes([]byte(`43.72`)), + wantErr: false, + wantOutput: `43.72`, + }, + "supported type - valid JSON boolean": { + value: protoreflect.ValueOfBytes([]byte(`true`)), + wantErr: false, + wantOutput: `true`, + }, + "supported type - valid JSON null": { + value: protoreflect.ValueOfBytes([]byte(`null`)), + wantErr: false, + wantOutput: `null`, + }, + "supported type - valid JSON string": { + value: protoreflect.ValueOfBytes([]byte(`"hey yo"`)), + wantErr: false, + wantOutput: `"hey yo"`, + }, + "supported type - invalid JSON": { + value: protoreflect.ValueOfBytes([]byte(`foo`)), + wantErr: true, + }, + "supported type - invalid JSON (empty)": { + value: protoreflect.ValueOfBytes([]byte(``)), + wantErr: true, + }, + "supported type - invalid JSON (nil bytes)": { + value: protoreflect.ValueOfBytes(nil), + wantErr: true, + }, + "unsupported type - bool": { + value: protoreflect.ValueOfBool(true), + wantErr: true, + }, + "unsupported type - int64": { + value: protoreflect.ValueOfInt64(1), + wantErr: true, + }, + } + + for name, tc := range cases { + t.Run(name, func(t *testing.T) { + var buf bytes.Buffer + err := cosmosInlineJSON(nil, tc.value, &buf) + + if tc.wantErr { + require.Error(t, err) + return + } + require.NoError(t, err) + assert.Equal(t, tc.wantOutput, buf.String()) + }) + } +} + +func TestSortedJSONStringify(t *testing.T) { + tests := map[string]struct { + input []byte + wantOutput string + }{ + "leaves true unchanged": { + input: []byte(`true`), + wantOutput: "true", + }, + "leaves false unchanged": { + input: []byte(`false`), + wantOutput: "false", + }, + "leaves string unchanged": { + input: []byte(`"aabbccdd"`), + wantOutput: `"aabbccdd"`, + }, + "leaves number unchanged": { + input: []byte(`75`), + wantOutput: "75", + }, + "leaves nil unchanged": { + input: []byte(`null`), + wantOutput: "null", + }, + "leaves simple array unchanged": { + input: []byte(`[5, 6, 7, 1]`), + wantOutput: "[5,6,7,1]", + }, + "leaves complex array unchanged": { + input: []byte(`[5, ["a", "b"], true, null, 1]`), + wantOutput: `[5,["a","b"],true,null,1]`, + }, + "sorts empty object": { + input: []byte(`{}`), + wantOutput: `{}`, + }, + "sorts single key object": { + input: []byte(`{"a": 3}`), + wantOutput: `{"a":3}`, + }, + "sorts multiple keys object": { + input: []byte(`{"a": 3, "b": 2, "c": 1}`), + wantOutput: `{"a":3,"b":2,"c":1}`, + }, + "sorts unsorted object": { + input: []byte(`{"b": 2, "a": 3, "c": 1}`), + wantOutput: `{"a":3,"b":2,"c":1}`, + }, + "sorts unsorted complex object": { + input: []byte(`{"aaa": true, "aa": true, "a": true}`), + wantOutput: `{"a":true,"aa":true,"aaa":true}`, + }, + "sorts nested objects": { + input: []byte(`{"x": {"y": {"z": null}}}`), + wantOutput: `{"x":{"y":{"z":null}}}`, + }, + "sorts deeply nested unsorted objects": { + input: []byte(`{"b": {"z": true, "x": true, "y": true}, "a": true, "c": true}`), + wantOutput: `{"a":true,"b":{"x":true,"y":true,"z":true},"c":true}`, + }, + "sorts objects in array sorted": { + input: []byte(`[1, 2, {"x": {"y": {"z": null}}}, 4]`), + wantOutput: `[1,2,{"x":{"y":{"z":null}}},4]`, + }, + "sorts objects in array unsorted": { + input: []byte(`[1, 2, {"b": {"z": true, "x": true, "y": true}, "a": true, "c": true}, 4]`), + wantOutput: `[1,2,{"a":true,"b":{"x":true,"y":true,"z":true},"c":true},4]`, + }, + } + + for name, tc := range tests { + t.Run(name, func(t *testing.T) { + got, err := sortedJSONStringify(tc.input) + require.NoError(t, err) + assert.Equal(t, tc.wantOutput, string(got)) + }) + } +} diff --git a/x/tx/signing/aminojson/fuzz_test.go b/x/tx/signing/aminojson/fuzz_test.go new file mode 100644 index 000000000000..e5cbe7ccf3f1 --- /dev/null +++ b/x/tx/signing/aminojson/fuzz_test.go @@ -0,0 +1,75 @@ +package aminojson + +import ( + "context" + "encoding/json" + "testing" + + fuzz "github.com/google/gofuzz" + + bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" + basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" + "cosmossdk.io/x/tx/signing/testutil" +) + +func FuzzSignModeGetSignBytes(f *testing.F) { + if testing.Short() { + f.Skip("not running in -short mode") + } + + // 1. Create seeds. + fee := &txv1beta1.Fee{ + Amount: []*basev1beta1.Coin{{Denom: "uatom", Amount: "1000"}}, + } + seed := &testutil.HandlerArgumentOptions{ + ChainID: "test-chain", + Memo: "sometestmemo", + + Msg: &bankv1beta1.MsgSend{ + FromAddress: "foo", + ToAddress: "bar", + Amount: []*basev1beta1.Coin{{Denom: "demon", Amount: "100"}}, + }, + AccNum: 1, + AccSeq: 2, + SignerAddress: "signerAddress", + Fee: fee, + } + + gf := fuzz.New() + for i := 0; i < 1e4; i++ { + blob, err := json.Marshal(seed) + if err != nil { + f.Fatal(err) + } + f.Add(blob) + + // 1.5. Mutate the seed for the next iteration. + // gofuzz cannot handle mutating "&bankv1beta1.MsgSend", + // hence why we are mutating fields individually. + gf.Fuzz(&seed.ChainID) + gf.Fuzz(&seed.Memo) + gf.Fuzz(&seed.AccNum) + gf.Fuzz(&seed.AccSeq) + gf.Fuzz(seed.Fee) + gf.Fuzz(&seed.SignerAddress) + } + + ctx := context.Background() + handler := NewSignModeHandler(SignModeHandlerOptions{}) + + // 2. Now run the fuzzers. + f.Fuzz(func(t *testing.T, in []byte) { + opts := new(testutil.HandlerArgumentOptions) + if err := json.Unmarshal(in, opts); err != nil { + return + } + + signerData, txData, err := testutil.MakeHandlerArguments(*opts) + if err != nil { + return + } + _, _ = handler.GetSignBytes(ctx, signerData, txData) + }) +} diff --git a/x/tx/signing/aminojson/internal/Makefile b/x/tx/signing/aminojson/internal/Makefile index 465057e261b1..6eb4420b60d2 100644 --- a/x/tx/signing/aminojson/internal/Makefile +++ b/x/tx/signing/aminojson/internal/Makefile @@ -1,4 +1,3 @@ codegen: @echo "Generating proto files" - @buf mod update @buf generate \ No newline at end of file diff --git a/x/tx/signing/aminojson/internal/aminojsonpb/aminojson.proto b/x/tx/signing/aminojson/internal/aminojsonpb/aminojson.proto index 42566486be21..e912e0d8e4b4 100644 --- a/x/tx/signing/aminojson/internal/aminojsonpb/aminojson.proto +++ b/x/tx/signing/aminojson/internal/aminojsonpb/aminojson.proto @@ -1,31 +1,33 @@ syntax = "proto3"; -import "cosmos_proto/cosmos.proto"; import "amino/amino.proto"; import "cosmos/base/v1beta1/coin.proto"; import "google/protobuf/any.proto"; -import "cosmos/tx/v1beta1/tx.proto"; +import "google/protobuf/timestamp.proto"; // AminoSignFee is the legacy amino json sign mode compatible version of txv1beta1.Fee, and differs from that message // by the name of the Gas field (GasLimit in txv1beta.Fee). // Note: this is only used for signing, see x/tx/signing/aminojson.go for more details. message AminoSignFee { - repeated cosmos.base.v1beta1.Coin amount = 1 [(amino.dont_omitempty) = true, (amino.encoding) = "legacy_coins"]; - uint64 gas = 2 [(amino.dont_omitempty) = true]; - string payer = 3; - string granter = 4; + repeated cosmos.base.v1beta1.Coin amount = 1 [(amino.dont_omitempty) = true, (amino.encoding) = "legacy_coins"]; + uint64 gas = 2 [(amino.dont_omitempty) = true]; + string payer = 3; + string granter = 4; } // AminoSignDoc is a message container used to generate the SIGN_MODE_LEGACY_AMINO_JSON sign bytes with proto3 API. // Note: This is only used for generated JSON in signing, see x/tx/signing/aminojson.go for more details. // We allow omitempty based on what is already defined in the legacy StdSignDoc. message AminoSignDoc { - uint64 account_number = 1 [(amino.dont_omitempty) = true]; - uint64 sequence = 2 [(amino.dont_omitempty) = true]; - uint64 timeout_height = 3; - string chain_id = 4 [(amino.dont_omitempty) = true]; - string memo = 5 [(amino.dont_omitempty) = true]; - AminoSignFee fee = 6 [(amino.dont_omitempty) = true]; + uint64 account_number = 1 [(amino.dont_omitempty) = true]; + uint64 sequence = 2 [(amino.dont_omitempty) = true]; + uint64 timeout_height = 3; + string chain_id = 4 [(amino.dont_omitempty) = true]; + string memo = 5 [(amino.dont_omitempty) = true]; + AminoSignFee fee = 6 [(amino.dont_omitempty) = true]; repeated google.protobuf.Any msgs = 7 [(amino.dont_omitempty) = true]; - cosmos.tx.v1beta1.Tip tip = 8; -} \ No newline at end of file + // Since: cosmos-sdk 0.53 + bool unordered = 8 [(amino.dont_omitempty) = false]; + // Since: cosmos-sdk 0.53 + google.protobuf.Timestamp timeout_timestamp = 9 [(amino.dont_omitempty) = false]; +} diff --git a/x/tx/signing/aminojson/internal/aminojsonpb/aminojson.pulsar.go b/x/tx/signing/aminojson/internal/aminojsonpb/aminojson.pulsar.go index d1f7f2540d35..3172b6497223 100644 --- a/x/tx/signing/aminojson/internal/aminojsonpb/aminojson.pulsar.go +++ b/x/tx/signing/aminojson/internal/aminojsonpb/aminojson.pulsar.go @@ -4,14 +4,13 @@ package aminojsonpb import ( _ "cosmossdk.io/api/amino" v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" - v1beta11 "cosmossdk.io/api/cosmos/tx/v1beta1" fmt "fmt" - _ "github.com/cosmos/cosmos-proto" 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" anypb "google.golang.org/protobuf/types/known/anypb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" io "io" reflect "reflect" sync "sync" @@ -739,15 +738,16 @@ func (x *_AminoSignDoc_7_list) IsValid() bool { } var ( - md_AminoSignDoc protoreflect.MessageDescriptor - fd_AminoSignDoc_account_number protoreflect.FieldDescriptor - fd_AminoSignDoc_sequence protoreflect.FieldDescriptor - fd_AminoSignDoc_timeout_height protoreflect.FieldDescriptor - fd_AminoSignDoc_chain_id protoreflect.FieldDescriptor - fd_AminoSignDoc_memo protoreflect.FieldDescriptor - fd_AminoSignDoc_fee protoreflect.FieldDescriptor - fd_AminoSignDoc_msgs protoreflect.FieldDescriptor - fd_AminoSignDoc_tip protoreflect.FieldDescriptor + md_AminoSignDoc protoreflect.MessageDescriptor + fd_AminoSignDoc_account_number protoreflect.FieldDescriptor + fd_AminoSignDoc_sequence protoreflect.FieldDescriptor + fd_AminoSignDoc_timeout_height protoreflect.FieldDescriptor + fd_AminoSignDoc_chain_id protoreflect.FieldDescriptor + fd_AminoSignDoc_memo protoreflect.FieldDescriptor + fd_AminoSignDoc_fee protoreflect.FieldDescriptor + fd_AminoSignDoc_msgs protoreflect.FieldDescriptor + fd_AminoSignDoc_unordered protoreflect.FieldDescriptor + fd_AminoSignDoc_timeout_timestamp protoreflect.FieldDescriptor ) func init() { @@ -760,7 +760,8 @@ func init() { fd_AminoSignDoc_memo = md_AminoSignDoc.Fields().ByName("memo") fd_AminoSignDoc_fee = md_AminoSignDoc.Fields().ByName("fee") fd_AminoSignDoc_msgs = md_AminoSignDoc.Fields().ByName("msgs") - fd_AminoSignDoc_tip = md_AminoSignDoc.Fields().ByName("tip") + fd_AminoSignDoc_unordered = md_AminoSignDoc.Fields().ByName("unordered") + fd_AminoSignDoc_timeout_timestamp = md_AminoSignDoc.Fields().ByName("timeout_timestamp") } var _ protoreflect.Message = (*fastReflection_AminoSignDoc)(nil) @@ -870,9 +871,15 @@ func (x *fastReflection_AminoSignDoc) Range(f func(protoreflect.FieldDescriptor, return } } - if x.Tip != nil { - value := protoreflect.ValueOfMessage(x.Tip.ProtoReflect()) - if !f(fd_AminoSignDoc_tip, value) { + if x.Unordered != false { + value := protoreflect.ValueOfBool(x.Unordered) + if !f(fd_AminoSignDoc_unordered, value) { + return + } + } + if x.TimeoutTimestamp != nil { + value := protoreflect.ValueOfMessage(x.TimeoutTimestamp.ProtoReflect()) + if !f(fd_AminoSignDoc_timeout_timestamp, value) { return } } @@ -905,8 +912,10 @@ func (x *fastReflection_AminoSignDoc) Has(fd protoreflect.FieldDescriptor) bool return x.Fee != nil case "AminoSignDoc.msgs": return len(x.Msgs) != 0 - case "AminoSignDoc.tip": - return x.Tip != nil + case "AminoSignDoc.unordered": + return x.Unordered != false + case "AminoSignDoc.timeout_timestamp": + return x.TimeoutTimestamp != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: AminoSignDoc")) @@ -937,8 +946,10 @@ func (x *fastReflection_AminoSignDoc) Clear(fd protoreflect.FieldDescriptor) { x.Fee = nil case "AminoSignDoc.msgs": x.Msgs = nil - case "AminoSignDoc.tip": - x.Tip = nil + case "AminoSignDoc.unordered": + x.Unordered = false + case "AminoSignDoc.timeout_timestamp": + x.TimeoutTimestamp = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: AminoSignDoc")) @@ -979,8 +990,11 @@ func (x *fastReflection_AminoSignDoc) Get(descriptor protoreflect.FieldDescripto } listValue := &_AminoSignDoc_7_list{list: &x.Msgs} return protoreflect.ValueOfList(listValue) - case "AminoSignDoc.tip": - value := x.Tip + case "AminoSignDoc.unordered": + value := x.Unordered + return protoreflect.ValueOfBool(value) + case "AminoSignDoc.timeout_timestamp": + value := x.TimeoutTimestamp return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { @@ -1018,8 +1032,10 @@ func (x *fastReflection_AminoSignDoc) Set(fd protoreflect.FieldDescriptor, value lv := value.List() clv := lv.(*_AminoSignDoc_7_list) x.Msgs = *clv.list - case "AminoSignDoc.tip": - x.Tip = value.Message().Interface().(*v1beta11.Tip) + case "AminoSignDoc.unordered": + x.Unordered = value.Bool() + case "AminoSignDoc.timeout_timestamp": + x.TimeoutTimestamp = value.Message().Interface().(*timestamppb.Timestamp) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: AminoSignDoc")) @@ -1051,11 +1067,11 @@ func (x *fastReflection_AminoSignDoc) Mutable(fd protoreflect.FieldDescriptor) p } value := &_AminoSignDoc_7_list{list: &x.Msgs} return protoreflect.ValueOfList(value) - case "AminoSignDoc.tip": - if x.Tip == nil { - x.Tip = new(v1beta11.Tip) + case "AminoSignDoc.timeout_timestamp": + if x.TimeoutTimestamp == nil { + x.TimeoutTimestamp = new(timestamppb.Timestamp) } - return protoreflect.ValueOfMessage(x.Tip.ProtoReflect()) + return protoreflect.ValueOfMessage(x.TimeoutTimestamp.ProtoReflect()) case "AminoSignDoc.account_number": panic(fmt.Errorf("field account_number of message AminoSignDoc is not mutable")) case "AminoSignDoc.sequence": @@ -1066,6 +1082,8 @@ func (x *fastReflection_AminoSignDoc) Mutable(fd protoreflect.FieldDescriptor) p panic(fmt.Errorf("field chain_id of message AminoSignDoc is not mutable")) case "AminoSignDoc.memo": panic(fmt.Errorf("field memo of message AminoSignDoc is not mutable")) + case "AminoSignDoc.unordered": + panic(fmt.Errorf("field unordered of message AminoSignDoc is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: AminoSignDoc")) @@ -1095,8 +1113,10 @@ func (x *fastReflection_AminoSignDoc) NewField(fd protoreflect.FieldDescriptor) case "AminoSignDoc.msgs": list := []*anypb.Any{} return protoreflect.ValueOfList(&_AminoSignDoc_7_list{list: &list}) - case "AminoSignDoc.tip": - m := new(v1beta11.Tip) + case "AminoSignDoc.unordered": + return protoreflect.ValueOfBool(false) + case "AminoSignDoc.timeout_timestamp": + m := new(timestamppb.Timestamp) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { @@ -1194,8 +1214,11 @@ func (x *fastReflection_AminoSignDoc) ProtoMethods() *protoiface.Methods { n += 1 + l + runtime.Sov(uint64(l)) } } - if x.Tip != nil { - l = options.Size(x.Tip) + if x.Unordered { + n += 2 + } + if x.TimeoutTimestamp != nil { + l = options.Size(x.TimeoutTimestamp) n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { @@ -1227,8 +1250,8 @@ func (x *fastReflection_AminoSignDoc) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.Tip != nil { - encoded, err := options.Marshal(x.Tip) + if x.TimeoutTimestamp != nil { + encoded, err := options.Marshal(x.TimeoutTimestamp) if err != nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1239,7 +1262,17 @@ func (x *fastReflection_AminoSignDoc) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x42 + dAtA[i] = 0x4a + } + if x.Unordered { + i-- + if x.Unordered { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 } if len(x.Msgs) > 0 { for iNdEx := len(x.Msgs) - 1; iNdEx >= 0; iNdEx-- { @@ -1541,8 +1574,28 @@ func (x *fastReflection_AminoSignDoc) ProtoMethods() *protoiface.Methods { } iNdEx = postIndex case 8: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Unordered", 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.Unordered = bool(v != 0) + case 9: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Tip", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TimeoutTimestamp", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1569,10 +1622,10 @@ func (x *fastReflection_AminoSignDoc) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - if x.Tip == nil { - x.Tip = &v1beta11.Tip{} + if x.TimeoutTimestamp == nil { + x.TimeoutTimestamp = ×tamppb.Timestamp{} } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Tip); err != nil { + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.TimeoutTimestamp); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex @@ -1701,7 +1754,10 @@ type AminoSignDoc struct { Memo string `protobuf:"bytes,5,opt,name=memo,proto3" json:"memo,omitempty"` Fee *AminoSignFee `protobuf:"bytes,6,opt,name=fee,proto3" json:"fee,omitempty"` Msgs []*anypb.Any `protobuf:"bytes,7,rep,name=msgs,proto3" json:"msgs,omitempty"` - Tip *v1beta11.Tip `protobuf:"bytes,8,opt,name=tip,proto3" json:"tip,omitempty"` + // Since: cosmos-sdk 0.53 + Unordered bool `protobuf:"varint,8,opt,name=unordered,proto3" json:"unordered,omitempty"` + // Since: cosmos-sdk 0.53 + TimeoutTimestamp *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=timeout_timestamp,json=timeoutTimestamp,proto3" json:"timeout_timestamp,omitempty"` } func (x *AminoSignDoc) Reset() { @@ -1773,9 +1829,16 @@ func (x *AminoSignDoc) GetMsgs() []*anypb.Any { return nil } -func (x *AminoSignDoc) GetTip() *v1beta11.Tip { +func (x *AminoSignDoc) GetUnordered() bool { + if x != nil { + return x.Unordered + } + return false +} + +func (x *AminoSignDoc) GetTimeoutTimestamp() *timestamppb.Timestamp { if x != nil { - return x.Tip + return x.TimeoutTimestamp } return nil } @@ -1784,52 +1847,55 @@ var File_aminojsonpb_aminojson_proto protoreflect.FileDescriptor var file_aminojsonpb_aminojson_proto_rawDesc = []byte{ 0x0a, 0x1b, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, 0x70, 0x62, 0x2f, 0x61, 0x6d, - 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, 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, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, - 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x74, - 0x78, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0xa2, 0x01, 0x0a, 0x0c, 0x41, 0x6d, 0x69, 0x6e, 0x6f, 0x53, 0x69, 0x67, 0x6e, - 0x46, 0x65, 0x65, 0x12, 0x49, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, - 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x16, - 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, 0x6e, - 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x17, - 0x0a, 0x03, 0x67, 0x61, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x05, 0xa8, 0xe7, 0xb0, - 0x2a, 0x01, 0x52, 0x03, 0x67, 0x61, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, 0x79, 0x65, 0x72, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x61, 0x79, 0x65, 0x72, 0x12, 0x18, 0x0a, - 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x72, 0x22, 0xc6, 0x02, 0x0a, 0x0c, 0x41, 0x6d, 0x69, 0x6e, - 0x6f, 0x53, 0x69, 0x67, 0x6e, 0x44, 0x6f, 0x63, 0x12, 0x2c, 0x0a, 0x0e, 0x61, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, - 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, - 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, - 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x69, 0x6d, - 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x0d, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, - 0x12, 0x20, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, - 0x49, 0x64, 0x12, 0x19, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x26, 0x0a, - 0x03, 0x66, 0x65, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x41, 0x6d, 0x69, - 0x6e, 0x6f, 0x53, 0x69, 0x67, 0x6e, 0x46, 0x65, 0x65, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, - 0x52, 0x03, 0x66, 0x65, 0x65, 0x12, 0x2f, 0x0a, 0x04, 0x6d, 0x73, 0x67, 0x73, 0x18, 0x07, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, - 0x52, 0x04, 0x6d, 0x73, 0x67, 0x73, 0x12, 0x28, 0x0a, 0x03, 0x74, 0x69, 0x70, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x69, 0x70, 0x52, 0x03, 0x74, 0x69, 0x70, - 0x42, 0x4b, 0x42, 0x0e, 0x41, 0x6d, 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x37, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, - 0x69, 0x6f, 0x2f, 0x78, 0x2f, 0x74, 0x78, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, - 0x6e, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, - 0x62, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, 0x70, 0x62, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, 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, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa2, 0x01, 0x0a, + 0x0c, 0x41, 0x6d, 0x69, 0x6e, 0x6f, 0x53, 0x69, 0x67, 0x6e, 0x46, 0x65, 0x65, 0x12, 0x49, 0x0a, + 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x16, 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, + 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, + 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x17, 0x0a, 0x03, 0x67, 0x61, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x03, 0x67, 0x61, + 0x73, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, 0x79, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x70, 0x61, 0x79, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, + 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, + 0x72, 0x22, 0x91, 0x03, 0x0a, 0x0c, 0x41, 0x6d, 0x69, 0x6e, 0x6f, 0x53, 0x69, 0x67, 0x6e, 0x44, + 0x6f, 0x63, 0x12, 0x2c, 0x0a, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x75, + 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, + 0x01, 0x52, 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x12, 0x21, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x04, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, + 0x6e, 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x68, + 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x74, 0x69, 0x6d, + 0x65, 0x6f, 0x75, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x20, 0x0a, 0x08, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x05, 0xa8, 0xe7, + 0xb0, 0x2a, 0x01, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x04, + 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, + 0x01, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x26, 0x0a, 0x03, 0x66, 0x65, 0x65, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x41, 0x6d, 0x69, 0x6e, 0x6f, 0x53, 0x69, 0x67, 0x6e, + 0x46, 0x65, 0x65, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x03, 0x66, 0x65, 0x65, 0x12, + 0x2f, 0x0a, 0x04, 0x6d, 0x73, 0x67, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x41, 0x6e, 0x79, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x04, 0x6d, 0x73, 0x67, 0x73, + 0x12, 0x23, 0x0a, 0x09, 0x75, 0x6e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x64, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x08, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x00, 0x52, 0x09, 0x75, 0x6e, 0x6f, 0x72, + 0x64, 0x65, 0x72, 0x65, 0x64, 0x12, 0x4e, 0x0a, 0x11, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x05, 0xa8, 0xe7, + 0xb0, 0x2a, 0x00, 0x52, 0x10, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x4b, 0x42, 0x0e, 0x41, 0x6d, 0x69, 0x6e, 0x6f, 0x6a, 0x73, + 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x37, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x78, 0x2f, 0x74, 0x78, 0x2f, 0x61, 0x6d, 0x69, + 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, + 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, + 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1846,17 +1912,17 @@ func file_aminojsonpb_aminojson_proto_rawDescGZIP() []byte { var file_aminojsonpb_aminojson_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_aminojsonpb_aminojson_proto_goTypes = []interface{}{ - (*AminoSignFee)(nil), // 0: AminoSignFee - (*AminoSignDoc)(nil), // 1: AminoSignDoc - (*v1beta1.Coin)(nil), // 2: cosmos.base.v1beta1.Coin - (*anypb.Any)(nil), // 3: google.protobuf.Any - (*v1beta11.Tip)(nil), // 4: cosmos.tx.v1beta1.Tip + (*AminoSignFee)(nil), // 0: AminoSignFee + (*AminoSignDoc)(nil), // 1: AminoSignDoc + (*v1beta1.Coin)(nil), // 2: cosmos.base.v1beta1.Coin + (*anypb.Any)(nil), // 3: google.protobuf.Any + (*timestamppb.Timestamp)(nil), // 4: google.protobuf.Timestamp } var file_aminojsonpb_aminojson_proto_depIdxs = []int32{ 2, // 0: AminoSignFee.amount:type_name -> cosmos.base.v1beta1.Coin 0, // 1: AminoSignDoc.fee:type_name -> AminoSignFee 3, // 2: AminoSignDoc.msgs:type_name -> google.protobuf.Any - 4, // 3: AminoSignDoc.tip:type_name -> cosmos.tx.v1beta1.Tip + 4, // 3: AminoSignDoc.timeout_timestamp:type_name -> google.protobuf.Timestamp 4, // [4:4] is the sub-list for method output_type 4, // [4:4] is the sub-list for method input_type 4, // [4:4] is the sub-list for extension type_name diff --git a/x/tx/signing/aminojson/internal/buf.lock b/x/tx/signing/aminojson/internal/buf.lock index 89f0d1904488..77b19169b1f7 100644 --- a/x/tx/signing/aminojson/internal/buf.lock +++ b/x/tx/signing/aminojson/internal/buf.lock @@ -9,8 +9,8 @@ deps: - remote: buf.build owner: cosmos repository: cosmos-sdk - commit: 9d547dbea90f47afbe1898388fcebffb - digest: shake256:63237398fb2043153c81bbe91ce52a832bca02d4307334b62fcc9914ce6f12fea59388eb5102949255054973f7022f581e02f97ed1f69a6585d2d00fb1da5833 + commit: 1356e87e6d1d4076b8bfb735737a0b63 + digest: shake256:574a0e72da9b55e30257557503bd4203513e5ca06dd8bc19fb8bf375fc8525a6bab4d9995e1554db7e9c649bc3778578e0cb96182176206f0653f2a17c073c46 - remote: buf.build owner: cosmos repository: gogo-proto diff --git a/x/tx/signing/aminojson/internal/testpb/test.proto b/x/tx/signing/aminojson/internal/testpb/test.proto index 0b1b3644c843..0bbb999426e6 100644 --- a/x/tx/signing/aminojson/internal/testpb/test.proto +++ b/x/tx/signing/aminojson/internal/testpb/test.proto @@ -20,6 +20,10 @@ message WithAList { repeated string list = 2; } +message WithAJson { + bytes field1 = 1 [(amino.encoding) = "inline_json"]; +} + message ABitOfEverything { option (amino.name) = "ABitOfEverything"; @@ -62,6 +66,11 @@ message ABitOfEverything { // google.protobuf.Duration duration = 24; } +message Duration { + google.protobuf.Duration duration = 1; + google.protobuf.Timestamp timestamp = 2; +} + message NestedMessage { option (amino.name) = "NestedMessage"; diff --git a/x/tx/signing/aminojson/internal/testpb/test.pulsar.go b/x/tx/signing/aminojson/internal/testpb/test.pulsar.go index ae8a54ee2571..0adf0b573d60 100644 --- a/x/tx/signing/aminojson/internal/testpb/test.pulsar.go +++ b/x/tx/signing/aminojson/internal/testpb/test.pulsar.go @@ -10,11 +10,11 @@ import ( protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" _ "google.golang.org/protobuf/types/known/anypb" - _ "google.golang.org/protobuf/types/known/durationpb" + durationpb "google.golang.org/protobuf/types/known/durationpb" _ "google.golang.org/protobuf/types/known/emptypb" _ "google.golang.org/protobuf/types/known/fieldmaskpb" _ "google.golang.org/protobuf/types/known/structpb" - _ "google.golang.org/protobuf/types/known/timestamppb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" _ "google.golang.org/protobuf/types/known/wrapperspb" io "io" reflect "reflect" @@ -1286,102 +1286,26 @@ func (x *fastReflection_WithAList) ProtoMethods() *protoiface.Methods { } } -var _ protoreflect.List = (*_ABitOfEverything_6_list)(nil) - -type _ABitOfEverything_6_list struct { - list *[]int32 -} - -func (x *_ABitOfEverything_6_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_ABitOfEverything_6_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfInt32((*x.list)[i]) -} - -func (x *_ABitOfEverything_6_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Int() - concreteValue := (int32)(valueUnwrapped) - (*x.list)[i] = concreteValue -} - -func (x *_ABitOfEverything_6_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Int() - concreteValue := (int32)(valueUnwrapped) - *x.list = append(*x.list, concreteValue) -} - -func (x *_ABitOfEverything_6_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message ABitOfEverything at list field Repeated as it is not of Message kind")) -} - -func (x *_ABitOfEverything_6_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} - -func (x *_ABitOfEverything_6_list) NewElement() protoreflect.Value { - v := int32(0) - return protoreflect.ValueOfInt32(v) -} - -func (x *_ABitOfEverything_6_list) IsValid() bool { - return x.list != nil -} - var ( - md_ABitOfEverything protoreflect.MessageDescriptor - fd_ABitOfEverything_message protoreflect.FieldDescriptor - fd_ABitOfEverything_enum protoreflect.FieldDescriptor - fd_ABitOfEverything_repeated protoreflect.FieldDescriptor - fd_ABitOfEverything_str protoreflect.FieldDescriptor - fd_ABitOfEverything_bool protoreflect.FieldDescriptor - fd_ABitOfEverything_bytes protoreflect.FieldDescriptor - fd_ABitOfEverything_i32 protoreflect.FieldDescriptor - fd_ABitOfEverything_f32 protoreflect.FieldDescriptor - fd_ABitOfEverything_u32 protoreflect.FieldDescriptor - fd_ABitOfEverything_si32 protoreflect.FieldDescriptor - fd_ABitOfEverything_sf32 protoreflect.FieldDescriptor - fd_ABitOfEverything_i64 protoreflect.FieldDescriptor - fd_ABitOfEverything_f64 protoreflect.FieldDescriptor - fd_ABitOfEverything_u64 protoreflect.FieldDescriptor - fd_ABitOfEverything_si64 protoreflect.FieldDescriptor - fd_ABitOfEverything_sf64 protoreflect.FieldDescriptor + md_WithAJson protoreflect.MessageDescriptor + fd_WithAJson_field1 protoreflect.FieldDescriptor ) func init() { file_testpb_test_proto_init() - md_ABitOfEverything = File_testpb_test_proto.Messages().ByName("ABitOfEverything") - fd_ABitOfEverything_message = md_ABitOfEverything.Fields().ByName("message") - fd_ABitOfEverything_enum = md_ABitOfEverything.Fields().ByName("enum") - fd_ABitOfEverything_repeated = md_ABitOfEverything.Fields().ByName("repeated") - fd_ABitOfEverything_str = md_ABitOfEverything.Fields().ByName("str") - fd_ABitOfEverything_bool = md_ABitOfEverything.Fields().ByName("bool") - fd_ABitOfEverything_bytes = md_ABitOfEverything.Fields().ByName("bytes") - fd_ABitOfEverything_i32 = md_ABitOfEverything.Fields().ByName("i32") - fd_ABitOfEverything_f32 = md_ABitOfEverything.Fields().ByName("f32") - fd_ABitOfEverything_u32 = md_ABitOfEverything.Fields().ByName("u32") - fd_ABitOfEverything_si32 = md_ABitOfEverything.Fields().ByName("si32") - fd_ABitOfEverything_sf32 = md_ABitOfEverything.Fields().ByName("sf32") - fd_ABitOfEverything_i64 = md_ABitOfEverything.Fields().ByName("i64") - fd_ABitOfEverything_f64 = md_ABitOfEverything.Fields().ByName("f64") - fd_ABitOfEverything_u64 = md_ABitOfEverything.Fields().ByName("u64") - fd_ABitOfEverything_si64 = md_ABitOfEverything.Fields().ByName("si64") - fd_ABitOfEverything_sf64 = md_ABitOfEverything.Fields().ByName("sf64") + md_WithAJson = File_testpb_test_proto.Messages().ByName("WithAJson") + fd_WithAJson_field1 = md_WithAJson.Fields().ByName("field1") } -var _ protoreflect.Message = (*fastReflection_ABitOfEverything)(nil) +var _ protoreflect.Message = (*fastReflection_WithAJson)(nil) -type fastReflection_ABitOfEverything ABitOfEverything +type fastReflection_WithAJson WithAJson -func (x *ABitOfEverything) ProtoReflect() protoreflect.Message { - return (*fastReflection_ABitOfEverything)(x) +func (x *WithAJson) ProtoReflect() protoreflect.Message { + return (*fastReflection_WithAJson)(x) } -func (x *ABitOfEverything) slowProtoReflect() protoreflect.Message { +func (x *WithAJson) slowProtoReflect() protoreflect.Message { mi := &file_testpb_test_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1393,43 +1317,43 @@ func (x *ABitOfEverything) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_ABitOfEverything_messageType fastReflection_ABitOfEverything_messageType -var _ protoreflect.MessageType = fastReflection_ABitOfEverything_messageType{} +var _fastReflection_WithAJson_messageType fastReflection_WithAJson_messageType +var _ protoreflect.MessageType = fastReflection_WithAJson_messageType{} -type fastReflection_ABitOfEverything_messageType struct{} +type fastReflection_WithAJson_messageType struct{} -func (x fastReflection_ABitOfEverything_messageType) Zero() protoreflect.Message { - return (*fastReflection_ABitOfEverything)(nil) +func (x fastReflection_WithAJson_messageType) Zero() protoreflect.Message { + return (*fastReflection_WithAJson)(nil) } -func (x fastReflection_ABitOfEverything_messageType) New() protoreflect.Message { - return new(fastReflection_ABitOfEverything) +func (x fastReflection_WithAJson_messageType) New() protoreflect.Message { + return new(fastReflection_WithAJson) } -func (x fastReflection_ABitOfEverything_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_ABitOfEverything +func (x fastReflection_WithAJson_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_WithAJson } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_ABitOfEverything) Descriptor() protoreflect.MessageDescriptor { - return md_ABitOfEverything +func (x *fastReflection_WithAJson) Descriptor() protoreflect.MessageDescriptor { + return md_WithAJson } // 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_ABitOfEverything) Type() protoreflect.MessageType { - return _fastReflection_ABitOfEverything_messageType +func (x *fastReflection_WithAJson) Type() protoreflect.MessageType { + return _fastReflection_WithAJson_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_ABitOfEverything) New() protoreflect.Message { - return new(fastReflection_ABitOfEverything) +func (x *fastReflection_WithAJson) New() protoreflect.Message { + return new(fastReflection_WithAJson) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_ABitOfEverything) Interface() protoreflect.ProtoMessage { - return (*ABitOfEverything)(x) +func (x *fastReflection_WithAJson) Interface() protoreflect.ProtoMessage { + return (*WithAJson)(x) } // Range iterates over every populated field in an undefined order, @@ -1437,100 +1361,10 @@ func (x *fastReflection_ABitOfEverything) 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_ABitOfEverything) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Message != nil { - value := protoreflect.ValueOfMessage(x.Message.ProtoReflect()) - if !f(fd_ABitOfEverything_message, value) { - return - } - } - if x.Enum != 0 { - value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Enum)) - if !f(fd_ABitOfEverything_enum, value) { - return - } - } - if len(x.Repeated) != 0 { - value := protoreflect.ValueOfList(&_ABitOfEverything_6_list{list: &x.Repeated}) - if !f(fd_ABitOfEverything_repeated, value) { - return - } - } - if x.Str != "" { - value := protoreflect.ValueOfString(x.Str) - if !f(fd_ABitOfEverything_str, value) { - return - } - } - if x.Bool != false { - value := protoreflect.ValueOfBool(x.Bool) - if !f(fd_ABitOfEverything_bool, value) { - return - } - } - if len(x.Bytes) != 0 { - value := protoreflect.ValueOfBytes(x.Bytes) - if !f(fd_ABitOfEverything_bytes, value) { - return - } - } - if x.I32 != int32(0) { - value := protoreflect.ValueOfInt32(x.I32) - if !f(fd_ABitOfEverything_i32, value) { - return - } - } - if x.F32 != uint32(0) { - value := protoreflect.ValueOfUint32(x.F32) - if !f(fd_ABitOfEverything_f32, value) { - return - } - } - if x.U32 != uint32(0) { - value := protoreflect.ValueOfUint32(x.U32) - if !f(fd_ABitOfEverything_u32, value) { - return - } - } - if x.Si32 != int32(0) { - value := protoreflect.ValueOfInt32(x.Si32) - if !f(fd_ABitOfEverything_si32, value) { - return - } - } - if x.Sf32 != int32(0) { - value := protoreflect.ValueOfInt32(x.Sf32) - if !f(fd_ABitOfEverything_sf32, value) { - return - } - } - if x.I64 != int64(0) { - value := protoreflect.ValueOfInt64(x.I64) - if !f(fd_ABitOfEverything_i64, value) { - return - } - } - if x.F64 != uint64(0) { - value := protoreflect.ValueOfUint64(x.F64) - if !f(fd_ABitOfEverything_f64, value) { - return - } - } - if x.U64 != uint64(0) { - value := protoreflect.ValueOfUint64(x.U64) - if !f(fd_ABitOfEverything_u64, value) { - return - } - } - if x.Si64 != int64(0) { - value := protoreflect.ValueOfInt64(x.Si64) - if !f(fd_ABitOfEverything_si64, value) { - return - } - } - if x.Sf64 != int64(0) { - value := protoreflect.ValueOfInt64(x.Sf64) - if !f(fd_ABitOfEverything_sf64, value) { +func (x *fastReflection_WithAJson) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Field1) != 0 { + value := protoreflect.ValueOfBytes(x.Field1) + if !f(fd_WithAJson_field1, value) { return } } @@ -1547,45 +1381,15 @@ func (x *fastReflection_ABitOfEverything) Range(f func(protoreflect.FieldDescrip // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_ABitOfEverything) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_WithAJson) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "testpb.ABitOfEverything.message": - return x.Message != nil - case "testpb.ABitOfEverything.enum": - return x.Enum != 0 - case "testpb.ABitOfEverything.repeated": - return len(x.Repeated) != 0 - case "testpb.ABitOfEverything.str": - return x.Str != "" - case "testpb.ABitOfEverything.bool": - return x.Bool != false - case "testpb.ABitOfEverything.bytes": - return len(x.Bytes) != 0 - case "testpb.ABitOfEverything.i32": - return x.I32 != int32(0) - case "testpb.ABitOfEverything.f32": - return x.F32 != uint32(0) - case "testpb.ABitOfEverything.u32": - return x.U32 != uint32(0) - case "testpb.ABitOfEverything.si32": - return x.Si32 != int32(0) - case "testpb.ABitOfEverything.sf32": - return x.Sf32 != int32(0) - case "testpb.ABitOfEverything.i64": - return x.I64 != int64(0) - case "testpb.ABitOfEverything.f64": - return x.F64 != uint64(0) - case "testpb.ABitOfEverything.u64": - return x.U64 != uint64(0) - case "testpb.ABitOfEverything.si64": - return x.Si64 != int64(0) - case "testpb.ABitOfEverything.sf64": - return x.Sf64 != int64(0) + case "testpb.WithAJson.field1": + return len(x.Field1) != 0 default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.ABitOfEverything")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.WithAJson")) } - panic(fmt.Errorf("message testpb.ABitOfEverything does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message testpb.WithAJson does not contain field %s", fd.FullName())) } } @@ -1595,45 +1399,15 @@ func (x *fastReflection_ABitOfEverything) Has(fd protoreflect.FieldDescriptor) b // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ABitOfEverything) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_WithAJson) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "testpb.ABitOfEverything.message": - x.Message = nil - case "testpb.ABitOfEverything.enum": - x.Enum = 0 - case "testpb.ABitOfEverything.repeated": - x.Repeated = nil - case "testpb.ABitOfEverything.str": - x.Str = "" - case "testpb.ABitOfEverything.bool": - x.Bool = false - case "testpb.ABitOfEverything.bytes": - x.Bytes = nil - case "testpb.ABitOfEverything.i32": - x.I32 = int32(0) - case "testpb.ABitOfEverything.f32": - x.F32 = uint32(0) - case "testpb.ABitOfEverything.u32": - x.U32 = uint32(0) - case "testpb.ABitOfEverything.si32": - x.Si32 = int32(0) - case "testpb.ABitOfEverything.sf32": - x.Sf32 = int32(0) - case "testpb.ABitOfEverything.i64": - x.I64 = int64(0) - case "testpb.ABitOfEverything.f64": - x.F64 = uint64(0) - case "testpb.ABitOfEverything.u64": - x.U64 = uint64(0) - case "testpb.ABitOfEverything.si64": - x.Si64 = int64(0) - case "testpb.ABitOfEverything.sf64": - x.Sf64 = int64(0) + case "testpb.WithAJson.field1": + x.Field1 = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.ABitOfEverything")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.WithAJson")) } - panic(fmt.Errorf("message testpb.ABitOfEverything does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message testpb.WithAJson does not contain field %s", fd.FullName())) } } @@ -1643,64 +1417,16 @@ func (x *fastReflection_ABitOfEverything) 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_ABitOfEverything) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_WithAJson) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "testpb.ABitOfEverything.message": - value := x.Message - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "testpb.ABitOfEverything.enum": - value := x.Enum - return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) - case "testpb.ABitOfEverything.repeated": - if len(x.Repeated) == 0 { - return protoreflect.ValueOfList(&_ABitOfEverything_6_list{}) - } - listValue := &_ABitOfEverything_6_list{list: &x.Repeated} - return protoreflect.ValueOfList(listValue) - case "testpb.ABitOfEverything.str": - value := x.Str - return protoreflect.ValueOfString(value) - case "testpb.ABitOfEverything.bool": - value := x.Bool - return protoreflect.ValueOfBool(value) - case "testpb.ABitOfEverything.bytes": - value := x.Bytes + case "testpb.WithAJson.field1": + value := x.Field1 return protoreflect.ValueOfBytes(value) - case "testpb.ABitOfEverything.i32": - value := x.I32 - return protoreflect.ValueOfInt32(value) - case "testpb.ABitOfEverything.f32": - value := x.F32 - return protoreflect.ValueOfUint32(value) - case "testpb.ABitOfEverything.u32": - value := x.U32 - return protoreflect.ValueOfUint32(value) - case "testpb.ABitOfEverything.si32": - value := x.Si32 - return protoreflect.ValueOfInt32(value) - case "testpb.ABitOfEverything.sf32": - value := x.Sf32 - return protoreflect.ValueOfInt32(value) - case "testpb.ABitOfEverything.i64": - value := x.I64 - return protoreflect.ValueOfInt64(value) - case "testpb.ABitOfEverything.f64": - value := x.F64 - return protoreflect.ValueOfUint64(value) - case "testpb.ABitOfEverything.u64": - value := x.U64 - return protoreflect.ValueOfUint64(value) - case "testpb.ABitOfEverything.si64": - value := x.Si64 - return protoreflect.ValueOfInt64(value) - case "testpb.ABitOfEverything.sf64": - value := x.Sf64 - return protoreflect.ValueOfInt64(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.ABitOfEverything")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.WithAJson")) } - panic(fmt.Errorf("message testpb.ABitOfEverything does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message testpb.WithAJson does not contain field %s", descriptor.FullName())) } } @@ -1714,47 +1440,15 @@ func (x *fastReflection_ABitOfEverything) Get(descriptor protoreflect.FieldDescr // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ABitOfEverything) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_WithAJson) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "testpb.ABitOfEverything.message": - x.Message = value.Message().Interface().(*NestedMessage) - case "testpb.ABitOfEverything.enum": - x.Enum = (AnEnum)(value.Enum()) - case "testpb.ABitOfEverything.repeated": - lv := value.List() - clv := lv.(*_ABitOfEverything_6_list) - x.Repeated = *clv.list - case "testpb.ABitOfEverything.str": - x.Str = value.Interface().(string) - case "testpb.ABitOfEverything.bool": - x.Bool = value.Bool() - case "testpb.ABitOfEverything.bytes": - x.Bytes = value.Bytes() - case "testpb.ABitOfEverything.i32": - x.I32 = int32(value.Int()) - case "testpb.ABitOfEverything.f32": - x.F32 = uint32(value.Uint()) - case "testpb.ABitOfEverything.u32": - x.U32 = uint32(value.Uint()) - case "testpb.ABitOfEverything.si32": - x.Si32 = int32(value.Int()) - case "testpb.ABitOfEverything.sf32": - x.Sf32 = int32(value.Int()) - case "testpb.ABitOfEverything.i64": - x.I64 = value.Int() - case "testpb.ABitOfEverything.f64": - x.F64 = value.Uint() - case "testpb.ABitOfEverything.u64": - x.U64 = value.Uint() - case "testpb.ABitOfEverything.si64": - x.Si64 = value.Int() - case "testpb.ABitOfEverything.sf64": - x.Sf64 = value.Int() + case "testpb.WithAJson.field1": + x.Field1 = value.Bytes() default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.ABitOfEverything")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.WithAJson")) } - panic(fmt.Errorf("message testpb.ABitOfEverything does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message testpb.WithAJson does not contain field %s", fd.FullName())) } } @@ -1768,109 +1462,40 @@ func (x *fastReflection_ABitOfEverything) Set(fd protoreflect.FieldDescriptor, v // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ABitOfEverything) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_WithAJson) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "testpb.ABitOfEverything.message": - if x.Message == nil { - x.Message = new(NestedMessage) - } - return protoreflect.ValueOfMessage(x.Message.ProtoReflect()) - case "testpb.ABitOfEverything.repeated": - if x.Repeated == nil { - x.Repeated = []int32{} - } - value := &_ABitOfEverything_6_list{list: &x.Repeated} - return protoreflect.ValueOfList(value) - case "testpb.ABitOfEverything.enum": - panic(fmt.Errorf("field enum of message testpb.ABitOfEverything is not mutable")) - case "testpb.ABitOfEverything.str": - panic(fmt.Errorf("field str of message testpb.ABitOfEverything is not mutable")) - case "testpb.ABitOfEverything.bool": - panic(fmt.Errorf("field bool of message testpb.ABitOfEverything is not mutable")) - case "testpb.ABitOfEverything.bytes": - panic(fmt.Errorf("field bytes of message testpb.ABitOfEverything is not mutable")) - case "testpb.ABitOfEverything.i32": - panic(fmt.Errorf("field i32 of message testpb.ABitOfEverything is not mutable")) - case "testpb.ABitOfEverything.f32": - panic(fmt.Errorf("field f32 of message testpb.ABitOfEverything is not mutable")) - case "testpb.ABitOfEverything.u32": - panic(fmt.Errorf("field u32 of message testpb.ABitOfEverything is not mutable")) - case "testpb.ABitOfEverything.si32": - panic(fmt.Errorf("field si32 of message testpb.ABitOfEverything is not mutable")) - case "testpb.ABitOfEverything.sf32": - panic(fmt.Errorf("field sf32 of message testpb.ABitOfEverything is not mutable")) - case "testpb.ABitOfEverything.i64": - panic(fmt.Errorf("field i64 of message testpb.ABitOfEverything is not mutable")) - case "testpb.ABitOfEverything.f64": - panic(fmt.Errorf("field f64 of message testpb.ABitOfEverything is not mutable")) - case "testpb.ABitOfEverything.u64": - panic(fmt.Errorf("field u64 of message testpb.ABitOfEverything is not mutable")) - case "testpb.ABitOfEverything.si64": - panic(fmt.Errorf("field si64 of message testpb.ABitOfEverything is not mutable")) - case "testpb.ABitOfEverything.sf64": - panic(fmt.Errorf("field sf64 of message testpb.ABitOfEverything is not mutable")) + case "testpb.WithAJson.field1": + panic(fmt.Errorf("field field1 of message testpb.WithAJson is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.ABitOfEverything")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.WithAJson")) } - panic(fmt.Errorf("message testpb.ABitOfEverything does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message testpb.WithAJson 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_ABitOfEverything) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_WithAJson) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "testpb.ABitOfEverything.message": - m := new(NestedMessage) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "testpb.ABitOfEverything.enum": - return protoreflect.ValueOfEnum(0) - case "testpb.ABitOfEverything.repeated": - list := []int32{} - return protoreflect.ValueOfList(&_ABitOfEverything_6_list{list: &list}) - case "testpb.ABitOfEverything.str": - return protoreflect.ValueOfString("") - case "testpb.ABitOfEverything.bool": - return protoreflect.ValueOfBool(false) - case "testpb.ABitOfEverything.bytes": + case "testpb.WithAJson.field1": return protoreflect.ValueOfBytes(nil) - case "testpb.ABitOfEverything.i32": - return protoreflect.ValueOfInt32(int32(0)) - case "testpb.ABitOfEverything.f32": - return protoreflect.ValueOfUint32(uint32(0)) - case "testpb.ABitOfEverything.u32": - return protoreflect.ValueOfUint32(uint32(0)) - case "testpb.ABitOfEverything.si32": - return protoreflect.ValueOfInt32(int32(0)) - case "testpb.ABitOfEverything.sf32": - return protoreflect.ValueOfInt32(int32(0)) - case "testpb.ABitOfEverything.i64": - return protoreflect.ValueOfInt64(int64(0)) - case "testpb.ABitOfEverything.f64": - return protoreflect.ValueOfUint64(uint64(0)) - case "testpb.ABitOfEverything.u64": - return protoreflect.ValueOfUint64(uint64(0)) - case "testpb.ABitOfEverything.si64": - return protoreflect.ValueOfInt64(int64(0)) - case "testpb.ABitOfEverything.sf64": - return protoreflect.ValueOfInt64(int64(0)) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.ABitOfEverything")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.WithAJson")) } - panic(fmt.Errorf("message testpb.ABitOfEverything does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message testpb.WithAJson 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_ABitOfEverything) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_WithAJson) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in testpb.ABitOfEverything", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in testpb.WithAJson", d.FullName())) } panic("unreachable") } @@ -1878,7 +1503,7 @@ func (x *fastReflection_ABitOfEverything) WhichOneof(d protoreflect.OneofDescrip // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_ABitOfEverything) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_WithAJson) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -1889,7 +1514,7 @@ func (x *fastReflection_ABitOfEverything) 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_ABitOfEverything) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_WithAJson) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -1901,7 +1526,7 @@ func (x *fastReflection_ABitOfEverything) SetUnknown(fields protoreflect.RawFiel // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_ABitOfEverything) IsValid() bool { +func (x *fastReflection_WithAJson) IsValid() bool { return x != nil } @@ -1911,9 +1536,9 @@ func (x *fastReflection_ABitOfEverything) 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_ABitOfEverything) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_WithAJson) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*ABitOfEverything) + x := input.Message.Interface().(*WithAJson) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1925,61 +1550,10 @@ func (x *fastReflection_ABitOfEverything) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - if x.Message != nil { - l = options.Size(x.Message) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Enum != 0 { - n += 1 + runtime.Sov(uint64(x.Enum)) - } - if len(x.Repeated) > 0 { - l = 0 - for _, e := range x.Repeated { - l += runtime.Sov(uint64(e)) - } - n += 1 + runtime.Sov(uint64(l)) + l - } - l = len(x.Str) + l = len(x.Field1) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if x.Bool { - n += 2 - } - l = len(x.Bytes) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.I32 != 0 { - n += 1 + runtime.Sov(uint64(x.I32)) - } - if x.F32 != 0 { - n += 5 - } - if x.U32 != 0 { - n += 1 + runtime.Sov(uint64(x.U32)) - } - if x.Si32 != 0 { - n += 1 + runtime.Soz(uint64(x.Si32)) - } - if x.Sf32 != 0 { - n += 5 - } - if x.I64 != 0 { - n += 1 + runtime.Sov(uint64(x.I64)) - } - if x.F64 != 0 { - n += 10 - } - if x.U64 != 0 { - n += 2 + runtime.Sov(uint64(x.U64)) - } - if x.Si64 != 0 { - n += 2 + runtime.Soz(uint64(x.Si64)) - } - if x.Sf64 != 0 { - n += 10 - } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1990,7 +1564,7 @@ func (x *fastReflection_ABitOfEverything) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*ABitOfEverything) + x := input.Message.Interface().(*WithAJson) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2009,136 +1583,17 @@ func (x *fastReflection_ABitOfEverything) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.Sf64 != 0 { - i -= 8 - binary.LittleEndian.PutUint64(dAtA[i:], uint64(x.Sf64)) - i-- - dAtA[i] = 0x1 + if len(x.Field1) > 0 { + i -= len(x.Field1) + copy(dAtA[i:], x.Field1) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Field1))) i-- - dAtA[i] = 0x99 + dAtA[i] = 0xa } - if x.Si64 != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64((uint64(x.Si64)<<1)^uint64((x.Si64>>63)))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x90 - } - if x.U64 != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.U64)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x88 - } - if x.F64 != 0 { - i -= 8 - binary.LittleEndian.PutUint64(dAtA[i:], uint64(x.F64)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x81 - } - if x.I64 != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.I64)) - i-- - dAtA[i] = 0x78 - } - if x.Sf32 != 0 { - i -= 4 - binary.LittleEndian.PutUint32(dAtA[i:], uint32(x.Sf32)) - i-- - dAtA[i] = 0x75 - } - if x.Si32 != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64((uint32(x.Si32)<<1)^uint32((x.Si32>>31)))) - i-- - dAtA[i] = 0x68 - } - if x.U32 != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.U32)) - i-- - dAtA[i] = 0x60 - } - if x.F32 != 0 { - i -= 4 - binary.LittleEndian.PutUint32(dAtA[i:], uint32(x.F32)) - i-- - dAtA[i] = 0x5d - } - if x.I32 != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.I32)) - i-- - dAtA[i] = 0x50 - } - if len(x.Bytes) > 0 { - i -= len(x.Bytes) - copy(dAtA[i:], x.Bytes) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Bytes))) - i-- - dAtA[i] = 0x4a - } - if x.Bool { - i-- - if x.Bool { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x40 - } - if len(x.Str) > 0 { - i -= len(x.Str) - copy(dAtA[i:], x.Str) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Str))) - i-- - dAtA[i] = 0x3a - } - if len(x.Repeated) > 0 { - var pksize2 int - for _, num := range x.Repeated { - pksize2 += runtime.Sov(uint64(num)) - } - i -= pksize2 - j1 := i - for _, num1 := range x.Repeated { - 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] = 0x32 - } - if x.Enum != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Enum)) - i-- - dAtA[i] = 0x10 - } - if x.Message != nil { - encoded, err := options.Marshal(x.Message) - 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 + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA } return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2146,7 +1601,7 @@ func (x *fastReflection_ABitOfEverything) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*ABitOfEverything) + x := input.Message.Interface().(*WithAJson) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2178,17 +1633,17 @@ func (x *fastReflection_ABitOfEverything) 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: ABitOfEverything: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: WithAJson: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ABitOfEverything: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: WithAJson: 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 Message", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Field1", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -2198,180 +1653,1781 @@ func (x *fastReflection_ABitOfEverything) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + msglen + 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 } - if x.Message == nil { - x.Message = &NestedMessage{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Message); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + x.Field1 = append(x.Field1[:0], dAtA[iNdEx:postIndex]...) + if x.Field1 == nil { + x.Field1 = []byte{} } iNdEx = postIndex - case 2: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Enum", wireType) - } - x.Enum = 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.Enum |= AnEnum(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 } - case 6: - if wireType == 0 { - var v int32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.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 |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.Repeated = append(x.Repeated, 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 - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(x.Repeated) == 0 { - x.Repeated = make([]int32, 0, elementCount) - } - for iNdEx < postIndex { - var v int32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.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 |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.Repeated = append(x.Repeated, v) - } - } else { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Repeated", wireType) + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - case 7: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Str", wireType) + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - 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 - } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + 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 = (*_ABitOfEverything_6_list)(nil) + +type _ABitOfEverything_6_list struct { + list *[]int32 +} + +func (x *_ABitOfEverything_6_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_ABitOfEverything_6_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfInt32((*x.list)[i]) +} + +func (x *_ABitOfEverything_6_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Int() + concreteValue := (int32)(valueUnwrapped) + (*x.list)[i] = concreteValue +} + +func (x *_ABitOfEverything_6_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Int() + concreteValue := (int32)(valueUnwrapped) + *x.list = append(*x.list, concreteValue) +} + +func (x *_ABitOfEverything_6_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message ABitOfEverything at list field Repeated as it is not of Message kind")) +} + +func (x *_ABitOfEverything_6_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_ABitOfEverything_6_list) NewElement() protoreflect.Value { + v := int32(0) + return protoreflect.ValueOfInt32(v) +} + +func (x *_ABitOfEverything_6_list) IsValid() bool { + return x.list != nil +} + +var ( + md_ABitOfEverything protoreflect.MessageDescriptor + fd_ABitOfEverything_message protoreflect.FieldDescriptor + fd_ABitOfEverything_enum protoreflect.FieldDescriptor + fd_ABitOfEverything_repeated protoreflect.FieldDescriptor + fd_ABitOfEverything_str protoreflect.FieldDescriptor + fd_ABitOfEverything_bool protoreflect.FieldDescriptor + fd_ABitOfEverything_bytes protoreflect.FieldDescriptor + fd_ABitOfEverything_i32 protoreflect.FieldDescriptor + fd_ABitOfEverything_f32 protoreflect.FieldDescriptor + fd_ABitOfEverything_u32 protoreflect.FieldDescriptor + fd_ABitOfEverything_si32 protoreflect.FieldDescriptor + fd_ABitOfEverything_sf32 protoreflect.FieldDescriptor + fd_ABitOfEverything_i64 protoreflect.FieldDescriptor + fd_ABitOfEverything_f64 protoreflect.FieldDescriptor + fd_ABitOfEverything_u64 protoreflect.FieldDescriptor + fd_ABitOfEverything_si64 protoreflect.FieldDescriptor + fd_ABitOfEverything_sf64 protoreflect.FieldDescriptor +) + +func init() { + file_testpb_test_proto_init() + md_ABitOfEverything = File_testpb_test_proto.Messages().ByName("ABitOfEverything") + fd_ABitOfEverything_message = md_ABitOfEverything.Fields().ByName("message") + fd_ABitOfEverything_enum = md_ABitOfEverything.Fields().ByName("enum") + fd_ABitOfEverything_repeated = md_ABitOfEverything.Fields().ByName("repeated") + fd_ABitOfEverything_str = md_ABitOfEverything.Fields().ByName("str") + fd_ABitOfEverything_bool = md_ABitOfEverything.Fields().ByName("bool") + fd_ABitOfEverything_bytes = md_ABitOfEverything.Fields().ByName("bytes") + fd_ABitOfEverything_i32 = md_ABitOfEverything.Fields().ByName("i32") + fd_ABitOfEverything_f32 = md_ABitOfEverything.Fields().ByName("f32") + fd_ABitOfEverything_u32 = md_ABitOfEverything.Fields().ByName("u32") + fd_ABitOfEverything_si32 = md_ABitOfEverything.Fields().ByName("si32") + fd_ABitOfEverything_sf32 = md_ABitOfEverything.Fields().ByName("sf32") + fd_ABitOfEverything_i64 = md_ABitOfEverything.Fields().ByName("i64") + fd_ABitOfEverything_f64 = md_ABitOfEverything.Fields().ByName("f64") + fd_ABitOfEverything_u64 = md_ABitOfEverything.Fields().ByName("u64") + fd_ABitOfEverything_si64 = md_ABitOfEverything.Fields().ByName("si64") + fd_ABitOfEverything_sf64 = md_ABitOfEverything.Fields().ByName("sf64") +} + +var _ protoreflect.Message = (*fastReflection_ABitOfEverything)(nil) + +type fastReflection_ABitOfEverything ABitOfEverything + +func (x *ABitOfEverything) ProtoReflect() protoreflect.Message { + return (*fastReflection_ABitOfEverything)(x) +} + +func (x *ABitOfEverything) slowProtoReflect() protoreflect.Message { + mi := &file_testpb_test_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_ABitOfEverything_messageType fastReflection_ABitOfEverything_messageType +var _ protoreflect.MessageType = fastReflection_ABitOfEverything_messageType{} + +type fastReflection_ABitOfEverything_messageType struct{} + +func (x fastReflection_ABitOfEverything_messageType) Zero() protoreflect.Message { + return (*fastReflection_ABitOfEverything)(nil) +} +func (x fastReflection_ABitOfEverything_messageType) New() protoreflect.Message { + return new(fastReflection_ABitOfEverything) +} +func (x fastReflection_ABitOfEverything_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ABitOfEverything +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ABitOfEverything) Descriptor() protoreflect.MessageDescriptor { + return md_ABitOfEverything +} + +// 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_ABitOfEverything) Type() protoreflect.MessageType { + return _fastReflection_ABitOfEverything_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ABitOfEverything) New() protoreflect.Message { + return new(fastReflection_ABitOfEverything) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ABitOfEverything) Interface() protoreflect.ProtoMessage { + return (*ABitOfEverything)(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_ABitOfEverything) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Message != nil { + value := protoreflect.ValueOfMessage(x.Message.ProtoReflect()) + if !f(fd_ABitOfEverything_message, value) { + return + } + } + if x.Enum != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Enum)) + if !f(fd_ABitOfEverything_enum, value) { + return + } + } + if len(x.Repeated) != 0 { + value := protoreflect.ValueOfList(&_ABitOfEverything_6_list{list: &x.Repeated}) + if !f(fd_ABitOfEverything_repeated, value) { + return + } + } + if x.Str != "" { + value := protoreflect.ValueOfString(x.Str) + if !f(fd_ABitOfEverything_str, value) { + return + } + } + if x.Bool != false { + value := protoreflect.ValueOfBool(x.Bool) + if !f(fd_ABitOfEverything_bool, value) { + return + } + } + if len(x.Bytes) != 0 { + value := protoreflect.ValueOfBytes(x.Bytes) + if !f(fd_ABitOfEverything_bytes, value) { + return + } + } + if x.I32 != int32(0) { + value := protoreflect.ValueOfInt32(x.I32) + if !f(fd_ABitOfEverything_i32, value) { + return + } + } + if x.F32 != uint32(0) { + value := protoreflect.ValueOfUint32(x.F32) + if !f(fd_ABitOfEverything_f32, value) { + return + } + } + if x.U32 != uint32(0) { + value := protoreflect.ValueOfUint32(x.U32) + if !f(fd_ABitOfEverything_u32, value) { + return + } + } + if x.Si32 != int32(0) { + value := protoreflect.ValueOfInt32(x.Si32) + if !f(fd_ABitOfEverything_si32, value) { + return + } + } + if x.Sf32 != int32(0) { + value := protoreflect.ValueOfInt32(x.Sf32) + if !f(fd_ABitOfEverything_sf32, value) { + return + } + } + if x.I64 != int64(0) { + value := protoreflect.ValueOfInt64(x.I64) + if !f(fd_ABitOfEverything_i64, value) { + return + } + } + if x.F64 != uint64(0) { + value := protoreflect.ValueOfUint64(x.F64) + if !f(fd_ABitOfEverything_f64, value) { + return + } + } + if x.U64 != uint64(0) { + value := protoreflect.ValueOfUint64(x.U64) + if !f(fd_ABitOfEverything_u64, value) { + return + } + } + if x.Si64 != int64(0) { + value := protoreflect.ValueOfInt64(x.Si64) + if !f(fd_ABitOfEverything_si64, value) { + return + } + } + if x.Sf64 != int64(0) { + value := protoreflect.ValueOfInt64(x.Sf64) + if !f(fd_ABitOfEverything_sf64, 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_ABitOfEverything) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "testpb.ABitOfEverything.message": + return x.Message != nil + case "testpb.ABitOfEverything.enum": + return x.Enum != 0 + case "testpb.ABitOfEverything.repeated": + return len(x.Repeated) != 0 + case "testpb.ABitOfEverything.str": + return x.Str != "" + case "testpb.ABitOfEverything.bool": + return x.Bool != false + case "testpb.ABitOfEverything.bytes": + return len(x.Bytes) != 0 + case "testpb.ABitOfEverything.i32": + return x.I32 != int32(0) + case "testpb.ABitOfEverything.f32": + return x.F32 != uint32(0) + case "testpb.ABitOfEverything.u32": + return x.U32 != uint32(0) + case "testpb.ABitOfEverything.si32": + return x.Si32 != int32(0) + case "testpb.ABitOfEverything.sf32": + return x.Sf32 != int32(0) + case "testpb.ABitOfEverything.i64": + return x.I64 != int64(0) + case "testpb.ABitOfEverything.f64": + return x.F64 != uint64(0) + case "testpb.ABitOfEverything.u64": + return x.U64 != uint64(0) + case "testpb.ABitOfEverything.si64": + return x.Si64 != int64(0) + case "testpb.ABitOfEverything.sf64": + return x.Sf64 != int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.ABitOfEverything")) + } + panic(fmt.Errorf("message testpb.ABitOfEverything 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_ABitOfEverything) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "testpb.ABitOfEverything.message": + x.Message = nil + case "testpb.ABitOfEverything.enum": + x.Enum = 0 + case "testpb.ABitOfEverything.repeated": + x.Repeated = nil + case "testpb.ABitOfEverything.str": + x.Str = "" + case "testpb.ABitOfEverything.bool": + x.Bool = false + case "testpb.ABitOfEverything.bytes": + x.Bytes = nil + case "testpb.ABitOfEverything.i32": + x.I32 = int32(0) + case "testpb.ABitOfEverything.f32": + x.F32 = uint32(0) + case "testpb.ABitOfEverything.u32": + x.U32 = uint32(0) + case "testpb.ABitOfEverything.si32": + x.Si32 = int32(0) + case "testpb.ABitOfEverything.sf32": + x.Sf32 = int32(0) + case "testpb.ABitOfEverything.i64": + x.I64 = int64(0) + case "testpb.ABitOfEverything.f64": + x.F64 = uint64(0) + case "testpb.ABitOfEverything.u64": + x.U64 = uint64(0) + case "testpb.ABitOfEverything.si64": + x.Si64 = int64(0) + case "testpb.ABitOfEverything.sf64": + x.Sf64 = int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.ABitOfEverything")) + } + panic(fmt.Errorf("message testpb.ABitOfEverything 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_ABitOfEverything) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "testpb.ABitOfEverything.message": + value := x.Message + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "testpb.ABitOfEverything.enum": + value := x.Enum + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + case "testpb.ABitOfEverything.repeated": + if len(x.Repeated) == 0 { + return protoreflect.ValueOfList(&_ABitOfEverything_6_list{}) + } + listValue := &_ABitOfEverything_6_list{list: &x.Repeated} + return protoreflect.ValueOfList(listValue) + case "testpb.ABitOfEverything.str": + value := x.Str + return protoreflect.ValueOfString(value) + case "testpb.ABitOfEverything.bool": + value := x.Bool + return protoreflect.ValueOfBool(value) + case "testpb.ABitOfEverything.bytes": + value := x.Bytes + return protoreflect.ValueOfBytes(value) + case "testpb.ABitOfEverything.i32": + value := x.I32 + return protoreflect.ValueOfInt32(value) + case "testpb.ABitOfEverything.f32": + value := x.F32 + return protoreflect.ValueOfUint32(value) + case "testpb.ABitOfEverything.u32": + value := x.U32 + return protoreflect.ValueOfUint32(value) + case "testpb.ABitOfEverything.si32": + value := x.Si32 + return protoreflect.ValueOfInt32(value) + case "testpb.ABitOfEverything.sf32": + value := x.Sf32 + return protoreflect.ValueOfInt32(value) + case "testpb.ABitOfEverything.i64": + value := x.I64 + return protoreflect.ValueOfInt64(value) + case "testpb.ABitOfEverything.f64": + value := x.F64 + return protoreflect.ValueOfUint64(value) + case "testpb.ABitOfEverything.u64": + value := x.U64 + return protoreflect.ValueOfUint64(value) + case "testpb.ABitOfEverything.si64": + value := x.Si64 + return protoreflect.ValueOfInt64(value) + case "testpb.ABitOfEverything.sf64": + value := x.Sf64 + return protoreflect.ValueOfInt64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.ABitOfEverything")) + } + panic(fmt.Errorf("message testpb.ABitOfEverything 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_ABitOfEverything) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "testpb.ABitOfEverything.message": + x.Message = value.Message().Interface().(*NestedMessage) + case "testpb.ABitOfEverything.enum": + x.Enum = (AnEnum)(value.Enum()) + case "testpb.ABitOfEverything.repeated": + lv := value.List() + clv := lv.(*_ABitOfEverything_6_list) + x.Repeated = *clv.list + case "testpb.ABitOfEverything.str": + x.Str = value.Interface().(string) + case "testpb.ABitOfEverything.bool": + x.Bool = value.Bool() + case "testpb.ABitOfEverything.bytes": + x.Bytes = value.Bytes() + case "testpb.ABitOfEverything.i32": + x.I32 = int32(value.Int()) + case "testpb.ABitOfEverything.f32": + x.F32 = uint32(value.Uint()) + case "testpb.ABitOfEverything.u32": + x.U32 = uint32(value.Uint()) + case "testpb.ABitOfEverything.si32": + x.Si32 = int32(value.Int()) + case "testpb.ABitOfEverything.sf32": + x.Sf32 = int32(value.Int()) + case "testpb.ABitOfEverything.i64": + x.I64 = value.Int() + case "testpb.ABitOfEverything.f64": + x.F64 = value.Uint() + case "testpb.ABitOfEverything.u64": + x.U64 = value.Uint() + case "testpb.ABitOfEverything.si64": + x.Si64 = value.Int() + case "testpb.ABitOfEverything.sf64": + x.Sf64 = value.Int() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.ABitOfEverything")) + } + panic(fmt.Errorf("message testpb.ABitOfEverything 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_ABitOfEverything) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "testpb.ABitOfEverything.message": + if x.Message == nil { + x.Message = new(NestedMessage) + } + return protoreflect.ValueOfMessage(x.Message.ProtoReflect()) + case "testpb.ABitOfEverything.repeated": + if x.Repeated == nil { + x.Repeated = []int32{} + } + value := &_ABitOfEverything_6_list{list: &x.Repeated} + return protoreflect.ValueOfList(value) + case "testpb.ABitOfEverything.enum": + panic(fmt.Errorf("field enum of message testpb.ABitOfEverything is not mutable")) + case "testpb.ABitOfEverything.str": + panic(fmt.Errorf("field str of message testpb.ABitOfEverything is not mutable")) + case "testpb.ABitOfEverything.bool": + panic(fmt.Errorf("field bool of message testpb.ABitOfEverything is not mutable")) + case "testpb.ABitOfEverything.bytes": + panic(fmt.Errorf("field bytes of message testpb.ABitOfEverything is not mutable")) + case "testpb.ABitOfEverything.i32": + panic(fmt.Errorf("field i32 of message testpb.ABitOfEverything is not mutable")) + case "testpb.ABitOfEverything.f32": + panic(fmt.Errorf("field f32 of message testpb.ABitOfEverything is not mutable")) + case "testpb.ABitOfEverything.u32": + panic(fmt.Errorf("field u32 of message testpb.ABitOfEverything is not mutable")) + case "testpb.ABitOfEverything.si32": + panic(fmt.Errorf("field si32 of message testpb.ABitOfEverything is not mutable")) + case "testpb.ABitOfEverything.sf32": + panic(fmt.Errorf("field sf32 of message testpb.ABitOfEverything is not mutable")) + case "testpb.ABitOfEverything.i64": + panic(fmt.Errorf("field i64 of message testpb.ABitOfEverything is not mutable")) + case "testpb.ABitOfEverything.f64": + panic(fmt.Errorf("field f64 of message testpb.ABitOfEverything is not mutable")) + case "testpb.ABitOfEverything.u64": + panic(fmt.Errorf("field u64 of message testpb.ABitOfEverything is not mutable")) + case "testpb.ABitOfEverything.si64": + panic(fmt.Errorf("field si64 of message testpb.ABitOfEverything is not mutable")) + case "testpb.ABitOfEverything.sf64": + panic(fmt.Errorf("field sf64 of message testpb.ABitOfEverything is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.ABitOfEverything")) + } + panic(fmt.Errorf("message testpb.ABitOfEverything 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_ABitOfEverything) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "testpb.ABitOfEverything.message": + m := new(NestedMessage) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "testpb.ABitOfEverything.enum": + return protoreflect.ValueOfEnum(0) + case "testpb.ABitOfEverything.repeated": + list := []int32{} + return protoreflect.ValueOfList(&_ABitOfEverything_6_list{list: &list}) + case "testpb.ABitOfEverything.str": + return protoreflect.ValueOfString("") + case "testpb.ABitOfEverything.bool": + return protoreflect.ValueOfBool(false) + case "testpb.ABitOfEverything.bytes": + return protoreflect.ValueOfBytes(nil) + case "testpb.ABitOfEverything.i32": + return protoreflect.ValueOfInt32(int32(0)) + case "testpb.ABitOfEverything.f32": + return protoreflect.ValueOfUint32(uint32(0)) + case "testpb.ABitOfEverything.u32": + return protoreflect.ValueOfUint32(uint32(0)) + case "testpb.ABitOfEverything.si32": + return protoreflect.ValueOfInt32(int32(0)) + case "testpb.ABitOfEverything.sf32": + return protoreflect.ValueOfInt32(int32(0)) + case "testpb.ABitOfEverything.i64": + return protoreflect.ValueOfInt64(int64(0)) + case "testpb.ABitOfEverything.f64": + return protoreflect.ValueOfUint64(uint64(0)) + case "testpb.ABitOfEverything.u64": + return protoreflect.ValueOfUint64(uint64(0)) + case "testpb.ABitOfEverything.si64": + return protoreflect.ValueOfInt64(int64(0)) + case "testpb.ABitOfEverything.sf64": + return protoreflect.ValueOfInt64(int64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.ABitOfEverything")) + } + panic(fmt.Errorf("message testpb.ABitOfEverything 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_ABitOfEverything) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in testpb.ABitOfEverything", 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_ABitOfEverything) 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_ABitOfEverything) 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_ABitOfEverything) 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_ABitOfEverything) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ABitOfEverything) + 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.Message != nil { + l = options.Size(x.Message) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Enum != 0 { + n += 1 + runtime.Sov(uint64(x.Enum)) + } + if len(x.Repeated) > 0 { + l = 0 + for _, e := range x.Repeated { + l += runtime.Sov(uint64(e)) + } + n += 1 + runtime.Sov(uint64(l)) + l + } + l = len(x.Str) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Bool { + n += 2 + } + l = len(x.Bytes) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.I32 != 0 { + n += 1 + runtime.Sov(uint64(x.I32)) + } + if x.F32 != 0 { + n += 5 + } + if x.U32 != 0 { + n += 1 + runtime.Sov(uint64(x.U32)) + } + if x.Si32 != 0 { + n += 1 + runtime.Soz(uint64(x.Si32)) + } + if x.Sf32 != 0 { + n += 5 + } + if x.I64 != 0 { + n += 1 + runtime.Sov(uint64(x.I64)) + } + if x.F64 != 0 { + n += 10 + } + if x.U64 != 0 { + n += 2 + runtime.Sov(uint64(x.U64)) + } + if x.Si64 != 0 { + n += 2 + runtime.Soz(uint64(x.Si64)) + } + if x.Sf64 != 0 { + n += 10 + } + 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().(*ABitOfEverything) + 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.Sf64 != 0 { + i -= 8 + binary.LittleEndian.PutUint64(dAtA[i:], uint64(x.Sf64)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x99 + } + if x.Si64 != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64((uint64(x.Si64)<<1)^uint64((x.Si64>>63)))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x90 + } + if x.U64 != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.U64)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x88 + } + if x.F64 != 0 { + i -= 8 + binary.LittleEndian.PutUint64(dAtA[i:], uint64(x.F64)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x81 + } + if x.I64 != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.I64)) + i-- + dAtA[i] = 0x78 + } + if x.Sf32 != 0 { + i -= 4 + binary.LittleEndian.PutUint32(dAtA[i:], uint32(x.Sf32)) + i-- + dAtA[i] = 0x75 + } + if x.Si32 != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64((uint32(x.Si32)<<1)^uint32((x.Si32>>31)))) + i-- + dAtA[i] = 0x68 + } + if x.U32 != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.U32)) + i-- + dAtA[i] = 0x60 + } + if x.F32 != 0 { + i -= 4 + binary.LittleEndian.PutUint32(dAtA[i:], uint32(x.F32)) + i-- + dAtA[i] = 0x5d + } + if x.I32 != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.I32)) + i-- + dAtA[i] = 0x50 + } + if len(x.Bytes) > 0 { + i -= len(x.Bytes) + copy(dAtA[i:], x.Bytes) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Bytes))) + i-- + dAtA[i] = 0x4a + } + if x.Bool { + i-- + if x.Bool { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } + if len(x.Str) > 0 { + i -= len(x.Str) + copy(dAtA[i:], x.Str) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Str))) + i-- + dAtA[i] = 0x3a + } + if len(x.Repeated) > 0 { + var pksize2 int + for _, num := range x.Repeated { + pksize2 += runtime.Sov(uint64(num)) + } + i -= pksize2 + j1 := i + for _, num1 := range x.Repeated { + 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] = 0x32 + } + if x.Enum != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Enum)) + i-- + dAtA[i] = 0x10 + } + if x.Message != nil { + encoded, err := options.Marshal(x.Message) + 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().(*ABitOfEverything) + 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: ABitOfEverything: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ABitOfEverything: 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 Message", 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.Message == nil { + x.Message = &NestedMessage{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Message); 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 Enum", wireType) + } + x.Enum = 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.Enum |= AnEnum(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType == 0 { + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.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 |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Repeated = append(x.Repeated, 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 + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(x.Repeated) == 0 { + x.Repeated = make([]int32, 0, elementCount) + } + for iNdEx < postIndex { + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.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 |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Repeated = append(x.Repeated, v) + } + } else { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Repeated", wireType) + } + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Str", 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.Str = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Bool", 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.Bool = bool(v != 0) + case 9: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Bytes", 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.Bytes = append(x.Bytes[:0], dAtA[iNdEx:postIndex]...) + if x.Bytes == nil { + x.Bytes = []byte{} } - postIndex := iNdEx + intStringLen - if postIndex < 0 { + iNdEx = postIndex + case 10: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field I32", wireType) + } + x.I32 = 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.I32 |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: + if wireType != 5 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field F32", wireType) + } + x.F32 = 0 + if (iNdEx + 4) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.F32 = uint32(binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + case 12: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field U32", wireType) + } + x.U32 = 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.U32 |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 13: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Si32", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.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 |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + v = int32((uint32(v) >> 1) ^ uint32(((v&1)<<31)>>31)) + x.Si32 = v + case 14: + if wireType != 5 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Sf32", wireType) + } + x.Sf32 = 0 + if (iNdEx + 4) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Sf32 = int32(binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + case 15: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field I64", wireType) + } + x.I64 = 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.I64 |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 16: + if wireType != 1 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field F64", wireType) + } + x.F64 = 0 + if (iNdEx + 8) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.F64 = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + case 17: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field U64", wireType) + } + x.U64 = 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.U64 |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 18: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Si64", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.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 |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + v = (v >> 1) ^ uint64((int64(v&1)<<63)>>63) + x.Si64 = int64(v) + case 19: + if wireType != 1 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Sf64", wireType) + } + x.Sf64 = 0 + if (iNdEx + 8) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Sf64 = int64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + 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 postIndex > l { + 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_Duration protoreflect.MessageDescriptor + fd_Duration_duration protoreflect.FieldDescriptor + fd_Duration_timestamp protoreflect.FieldDescriptor +) + +func init() { + file_testpb_test_proto_init() + md_Duration = File_testpb_test_proto.Messages().ByName("Duration") + fd_Duration_duration = md_Duration.Fields().ByName("duration") + fd_Duration_timestamp = md_Duration.Fields().ByName("timestamp") +} + +var _ protoreflect.Message = (*fastReflection_Duration)(nil) + +type fastReflection_Duration Duration + +func (x *Duration) ProtoReflect() protoreflect.Message { + return (*fastReflection_Duration)(x) +} + +func (x *Duration) slowProtoReflect() protoreflect.Message { + mi := &file_testpb_test_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_Duration_messageType fastReflection_Duration_messageType +var _ protoreflect.MessageType = fastReflection_Duration_messageType{} + +type fastReflection_Duration_messageType struct{} + +func (x fastReflection_Duration_messageType) Zero() protoreflect.Message { + return (*fastReflection_Duration)(nil) +} +func (x fastReflection_Duration_messageType) New() protoreflect.Message { + return new(fastReflection_Duration) +} +func (x fastReflection_Duration_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Duration +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Duration) Descriptor() protoreflect.MessageDescriptor { + return md_Duration +} + +// 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_Duration) Type() protoreflect.MessageType { + return _fastReflection_Duration_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Duration) New() protoreflect.Message { + return new(fastReflection_Duration) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Duration) Interface() protoreflect.ProtoMessage { + return (*Duration)(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_Duration) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Duration != nil { + value := protoreflect.ValueOfMessage(x.Duration.ProtoReflect()) + if !f(fd_Duration_duration, value) { + return + } + } + if x.Timestamp != nil { + value := protoreflect.ValueOfMessage(x.Timestamp.ProtoReflect()) + if !f(fd_Duration_timestamp, 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_Duration) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "testpb.Duration.duration": + return x.Duration != nil + case "testpb.Duration.timestamp": + return x.Timestamp != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.Duration")) + } + panic(fmt.Errorf("message testpb.Duration 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_Duration) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "testpb.Duration.duration": + x.Duration = nil + case "testpb.Duration.timestamp": + x.Timestamp = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.Duration")) + } + panic(fmt.Errorf("message testpb.Duration 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_Duration) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "testpb.Duration.duration": + value := x.Duration + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "testpb.Duration.timestamp": + value := x.Timestamp + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.Duration")) + } + panic(fmt.Errorf("message testpb.Duration 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_Duration) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "testpb.Duration.duration": + x.Duration = value.Message().Interface().(*durationpb.Duration) + case "testpb.Duration.timestamp": + x.Timestamp = value.Message().Interface().(*timestamppb.Timestamp) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.Duration")) + } + panic(fmt.Errorf("message testpb.Duration 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_Duration) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "testpb.Duration.duration": + if x.Duration == nil { + x.Duration = new(durationpb.Duration) + } + return protoreflect.ValueOfMessage(x.Duration.ProtoReflect()) + case "testpb.Duration.timestamp": + if x.Timestamp == nil { + x.Timestamp = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.Timestamp.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.Duration")) + } + panic(fmt.Errorf("message testpb.Duration 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_Duration) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "testpb.Duration.duration": + m := new(durationpb.Duration) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "testpb.Duration.timestamp": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.Duration")) + } + panic(fmt.Errorf("message testpb.Duration 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_Duration) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in testpb.Duration", 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_Duration) 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_Duration) 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_Duration) 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_Duration) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Duration) + 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.Duration != nil { + l = options.Size(x.Duration) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Timestamp != nil { + l = options.Size(x.Timestamp) + 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().(*Duration) + 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.Timestamp != nil { + encoded, err := options.Marshal(x.Timestamp) + 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.Duration != nil { + encoded, err := options.Marshal(x.Duration) + 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().(*Duration) + 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 } - x.Str = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Bool", 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.Bool = bool(v != 0) - case 9: + 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: Duration: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Duration: 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 Bytes", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Duration", 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 @@ -2381,79 +3437,33 @@ func (x *fastReflection_ABitOfEverything) 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.Bytes = append(x.Bytes[:0], dAtA[iNdEx:postIndex]...) - if x.Bytes == nil { - x.Bytes = []byte{} - } - iNdEx = postIndex - case 10: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field I32", wireType) - } - x.I32 = 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.I32 |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 11: - if wireType != 5 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field F32", wireType) - } - x.F32 = 0 - if (iNdEx + 4) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.F32 = uint32(binary.LittleEndian.Uint32(dAtA[iNdEx:])) - iNdEx += 4 - case 12: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field U32", wireType) + if x.Duration == nil { + x.Duration = &durationpb.Duration{} } - x.U32 = 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.U32 |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Duration); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } - case 13: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Si32", wireType) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) } - var v int32 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -2463,102 +3473,28 @@ func (x *fastReflection_ABitOfEverything) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - v |= int32(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - v = int32((uint32(v) >> 1) ^ uint32(((v&1)<<31)>>31)) - x.Si32 = v - case 14: - if wireType != 5 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Sf32", wireType) - } - x.Sf32 = 0 - if (iNdEx + 4) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Sf32 = int32(binary.LittleEndian.Uint32(dAtA[iNdEx:])) - iNdEx += 4 - case 15: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field I64", wireType) - } - x.I64 = 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.I64 |= int64(b&0x7F) << shift - if b < 0x80 { - break - } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - case 16: - if wireType != 1 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field F64", wireType) + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - x.F64 = 0 - if (iNdEx + 8) > l { + if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.F64 = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - case 17: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field U64", wireType) - } - x.U64 = 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.U64 |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 18: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Si64", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.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 |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - v = (v >> 1) ^ uint64((int64(v&1)<<63)>>63) - x.Si64 = int64(v) - case 19: - if wireType != 1 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Sf64", wireType) + if x.Timestamp == nil { + x.Timestamp = ×tamppb.Timestamp{} } - x.Sf64 = 0 - if (iNdEx + 8) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Timestamp); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } - x.Sf64 = int64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -2616,7 +3552,7 @@ func (x *NestedMessage) ProtoReflect() protoreflect.Message { } func (x *NestedMessage) slowProtoReflect() protoreflect.Message { - mi := &file_testpb_test_proto_msgTypes[3] + mi := &file_testpb_test_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3202,6 +4138,41 @@ func (x *WithAList) GetList() []string { return nil } +type WithAJson struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Field1 []byte `protobuf:"bytes,1,opt,name=field1,proto3" json:"field1,omitempty"` +} + +func (x *WithAJson) Reset() { + *x = WithAJson{} + if protoimpl.UnsafeEnabled { + mi := &file_testpb_test_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WithAJson) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WithAJson) ProtoMessage() {} + +// Deprecated: Use WithAJson.ProtoReflect.Descriptor instead. +func (*WithAJson) Descriptor() ([]byte, []int) { + return file_testpb_test_proto_rawDescGZIP(), []int{2} +} + +func (x *WithAJson) GetField1() []byte { + if x != nil { + return x.Field1 + } + return nil +} + type ABitOfEverything struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3228,7 +4199,7 @@ type ABitOfEverything struct { func (x *ABitOfEverything) Reset() { *x = ABitOfEverything{} if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_proto_msgTypes[2] + mi := &file_testpb_test_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3242,7 +4213,7 @@ func (*ABitOfEverything) ProtoMessage() {} // Deprecated: Use ABitOfEverything.ProtoReflect.Descriptor instead. func (*ABitOfEverything) Descriptor() ([]byte, []int) { - return file_testpb_test_proto_rawDescGZIP(), []int{2} + return file_testpb_test_proto_rawDescGZIP(), []int{3} } func (x *ABitOfEverything) GetMessage() *NestedMessage { @@ -3357,6 +4328,49 @@ func (x *ABitOfEverything) GetSf64() int64 { return 0 } +type Duration struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Duration *durationpb.Duration `protobuf:"bytes,1,opt,name=duration,proto3" json:"duration,omitempty"` + Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` +} + +func (x *Duration) Reset() { + *x = Duration{} + if protoimpl.UnsafeEnabled { + mi := &file_testpb_test_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Duration) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Duration) ProtoMessage() {} + +// Deprecated: Use Duration.ProtoReflect.Descriptor instead. +func (*Duration) Descriptor() ([]byte, []int) { + return file_testpb_test_proto_rawDescGZIP(), []int{4} +} + +func (x *Duration) GetDuration() *durationpb.Duration { + if x != nil { + return x.Duration + } + return nil +} + +func (x *Duration) GetTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + type NestedMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3369,7 +4383,7 @@ type NestedMessage struct { func (x *NestedMessage) Reset() { *x = NestedMessage{} if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_proto_msgTypes[3] + mi := &file_testpb_test_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3383,7 +4397,7 @@ func (*NestedMessage) ProtoMessage() {} // Deprecated: Use NestedMessage.ProtoReflect.Descriptor instead. func (*NestedMessage) Descriptor() ([]byte, []int) { - return file_testpb_test_proto_rawDescGZIP(), []int{3} + return file_testpb_test_proto_rawDescGZIP(), []int{5} } func (x *NestedMessage) GetFoo() string { @@ -3432,49 +4446,60 @@ var file_testpb_test_proto_rawDesc = []byte{ 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x11, 0x64, 0x6f, 0x6e, 0x74, 0x4f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x73, - 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x92, 0x03, - 0x0a, 0x10, 0x41, 0x42, 0x69, 0x74, 0x4f, 0x66, 0x45, 0x76, 0x65, 0x72, 0x79, 0x74, 0x68, 0x69, - 0x6e, 0x67, 0x12, 0x2f, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4e, 0x65, 0x73, - 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x12, 0x22, 0x0a, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x0e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x41, 0x6e, 0x45, 0x6e, 0x75, - 0x6d, 0x52, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x65, 0x61, - 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x03, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x70, 0x65, 0x61, - 0x74, 0x65, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x74, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x73, 0x74, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x6f, 0x6c, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x04, 0x62, 0x6f, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, - 0x65, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x12, - 0x10, 0x0a, 0x03, 0x69, 0x33, 0x32, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x69, 0x33, - 0x32, 0x12, 0x10, 0x0a, 0x03, 0x66, 0x33, 0x32, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x07, 0x52, 0x03, - 0x66, 0x33, 0x32, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x33, 0x32, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x03, 0x75, 0x33, 0x32, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x33, 0x32, 0x18, 0x0d, 0x20, - 0x01, 0x28, 0x11, 0x52, 0x04, 0x73, 0x69, 0x33, 0x32, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x66, 0x33, - 0x32, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0f, 0x52, 0x04, 0x73, 0x66, 0x33, 0x32, 0x12, 0x10, 0x0a, - 0x03, 0x69, 0x36, 0x34, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x69, 0x36, 0x34, 0x12, - 0x10, 0x0a, 0x03, 0x66, 0x36, 0x34, 0x18, 0x10, 0x20, 0x01, 0x28, 0x06, 0x52, 0x03, 0x66, 0x36, - 0x34, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x36, 0x34, 0x18, 0x11, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, - 0x75, 0x36, 0x34, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x36, 0x34, 0x18, 0x12, 0x20, 0x01, 0x28, - 0x12, 0x52, 0x04, 0x73, 0x69, 0x36, 0x34, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x66, 0x36, 0x34, 0x18, - 0x13, 0x20, 0x01, 0x28, 0x10, 0x52, 0x04, 0x73, 0x66, 0x36, 0x34, 0x3a, 0x15, 0x8a, 0xe7, 0xb0, - 0x2a, 0x10, 0x41, 0x42, 0x69, 0x74, 0x4f, 0x66, 0x45, 0x76, 0x65, 0x72, 0x79, 0x74, 0x68, 0x69, - 0x6e, 0x67, 0x22, 0x47, 0x0a, 0x0d, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x66, 0x6f, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x61, 0x72, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x03, 0x62, 0x61, 0x72, 0x3a, 0x12, 0x8a, 0xe7, 0xb0, 0x2a, 0x0d, 0x4e, 0x65, - 0x73, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2a, 0x29, 0x0a, 0x06, 0x41, - 0x6e, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x4e, 0x44, 0x45, 0x46, 0x49, 0x4e, - 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x07, 0x0a, - 0x03, 0x54, 0x57, 0x4f, 0x10, 0x02, 0x42, 0x83, 0x01, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x74, - 0x65, 0x73, 0x74, 0x70, 0x62, 0x42, 0x09, 0x54, 0x65, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x32, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, - 0x2f, 0x78, 0x2f, 0x74, 0x78, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2f, - 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x54, - 0x65, 0x73, 0x74, 0x70, 0x62, 0xca, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xe2, 0x02, - 0x12, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x35, 0x0a, + 0x09, 0x57, 0x69, 0x74, 0x68, 0x41, 0x4a, 0x73, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x06, 0x66, 0x69, + 0x65, 0x6c, 0x64, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x10, 0x9a, 0xe7, 0xb0, 0x2a, + 0x0b, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x52, 0x06, 0x66, 0x69, + 0x65, 0x6c, 0x64, 0x31, 0x22, 0x92, 0x03, 0x0a, 0x10, 0x41, 0x42, 0x69, 0x74, 0x4f, 0x66, 0x45, + 0x76, 0x65, 0x72, 0x79, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x12, 0x2f, 0x0a, 0x07, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x65, 0x73, + 0x74, 0x70, 0x62, 0x2e, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x22, 0x0a, 0x04, 0x65, 0x6e, + 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, + 0x62, 0x2e, 0x41, 0x6e, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x12, 0x1a, + 0x0a, 0x08, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x03, 0x28, 0x05, + 0x52, 0x08, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x74, + 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x74, 0x72, 0x12, 0x12, 0x0a, 0x04, + 0x62, 0x6f, 0x6f, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x62, 0x6f, 0x6f, 0x6c, + 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x33, 0x32, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x03, 0x69, 0x33, 0x32, 0x12, 0x10, 0x0a, 0x03, 0x66, 0x33, 0x32, 0x18, + 0x0b, 0x20, 0x01, 0x28, 0x07, 0x52, 0x03, 0x66, 0x33, 0x32, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x33, + 0x32, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x75, 0x33, 0x32, 0x12, 0x12, 0x0a, 0x04, + 0x73, 0x69, 0x33, 0x32, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x11, 0x52, 0x04, 0x73, 0x69, 0x33, 0x32, + 0x12, 0x12, 0x0a, 0x04, 0x73, 0x66, 0x33, 0x32, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0f, 0x52, 0x04, + 0x73, 0x66, 0x33, 0x32, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x36, 0x34, 0x18, 0x0f, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x03, 0x69, 0x36, 0x34, 0x12, 0x10, 0x0a, 0x03, 0x66, 0x36, 0x34, 0x18, 0x10, 0x20, + 0x01, 0x28, 0x06, 0x52, 0x03, 0x66, 0x36, 0x34, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x36, 0x34, 0x18, + 0x11, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x75, 0x36, 0x34, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, + 0x36, 0x34, 0x18, 0x12, 0x20, 0x01, 0x28, 0x12, 0x52, 0x04, 0x73, 0x69, 0x36, 0x34, 0x12, 0x12, + 0x0a, 0x04, 0x73, 0x66, 0x36, 0x34, 0x18, 0x13, 0x20, 0x01, 0x28, 0x10, 0x52, 0x04, 0x73, 0x66, + 0x36, 0x34, 0x3a, 0x15, 0x8a, 0xe7, 0xb0, 0x2a, 0x10, 0x41, 0x42, 0x69, 0x74, 0x4f, 0x66, 0x45, + 0x76, 0x65, 0x72, 0x79, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x22, 0x7b, 0x0a, 0x08, 0x44, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x35, 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x38, 0x0a, 0x09, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x47, 0x0a, 0x0d, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x66, 0x6f, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x61, 0x72, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x62, 0x61, 0x72, 0x3a, 0x12, 0x8a, 0xe7, 0xb0, + 0x2a, 0x0d, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2a, + 0x29, 0x0a, 0x06, 0x41, 0x6e, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x4e, 0x44, + 0x45, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x4f, 0x4e, 0x45, 0x10, + 0x01, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x57, 0x4f, 0x10, 0x02, 0x42, 0x83, 0x01, 0x0a, 0x0a, 0x63, + 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x42, 0x09, 0x54, 0x65, 0x73, 0x74, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, + 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x78, 0x2f, 0x74, 0x78, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x6a, + 0x73, 0x6f, 0x6e, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, + 0x74, 0x70, 0x62, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, + 0xaa, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xca, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, + 0x70, 0x62, 0xe2, 0x02, 0x12, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3490,24 +4515,30 @@ func file_testpb_test_proto_rawDescGZIP() []byte { } var file_testpb_test_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_testpb_test_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_testpb_test_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_testpb_test_proto_goTypes = []interface{}{ - (AnEnum)(0), // 0: testpb.AnEnum - (*WithAMap)(nil), // 1: testpb.WithAMap - (*WithAList)(nil), // 2: testpb.WithAList - (*ABitOfEverything)(nil), // 3: testpb.ABitOfEverything - (*NestedMessage)(nil), // 4: testpb.NestedMessage - nil, // 5: testpb.WithAMap.StrMapEntry + (AnEnum)(0), // 0: testpb.AnEnum + (*WithAMap)(nil), // 1: testpb.WithAMap + (*WithAList)(nil), // 2: testpb.WithAList + (*WithAJson)(nil), // 3: testpb.WithAJson + (*ABitOfEverything)(nil), // 4: testpb.ABitOfEverything + (*Duration)(nil), // 5: testpb.Duration + (*NestedMessage)(nil), // 6: testpb.NestedMessage + nil, // 7: testpb.WithAMap.StrMapEntry + (*durationpb.Duration)(nil), // 8: google.protobuf.Duration + (*timestamppb.Timestamp)(nil), // 9: google.protobuf.Timestamp } var file_testpb_test_proto_depIdxs = []int32{ - 5, // 0: testpb.WithAMap.str_map:type_name -> testpb.WithAMap.StrMapEntry - 4, // 1: testpb.ABitOfEverything.message:type_name -> testpb.NestedMessage + 7, // 0: testpb.WithAMap.str_map:type_name -> testpb.WithAMap.StrMapEntry + 6, // 1: testpb.ABitOfEverything.message:type_name -> testpb.NestedMessage 0, // 2: testpb.ABitOfEverything.enum:type_name -> testpb.AnEnum - 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 + 8, // 3: testpb.Duration.duration:type_name -> google.protobuf.Duration + 9, // 4: testpb.Duration.timestamp:type_name -> google.protobuf.Timestamp + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_testpb_test_proto_init() } @@ -3541,7 +4572,7 @@ func file_testpb_test_proto_init() { } } file_testpb_test_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ABitOfEverything); i { + switch v := v.(*WithAJson); i { case 0: return &v.state case 1: @@ -3553,6 +4584,30 @@ func file_testpb_test_proto_init() { } } file_testpb_test_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ABitOfEverything); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_testpb_test_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Duration); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_testpb_test_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*NestedMessage); i { case 0: return &v.state @@ -3571,7 +4626,7 @@ func file_testpb_test_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_testpb_test_proto_rawDesc, NumEnums: 1, - NumMessages: 5, + NumMessages: 7, NumExtensions: 0, NumServices: 0, }, diff --git a/x/tx/signing/aminojson/json_marshal.go b/x/tx/signing/aminojson/json_marshal.go index 06d8641c59d4..338ea9d88a61 100644 --- a/x/tx/signing/aminojson/json_marshal.go +++ b/x/tx/signing/aminojson/json_marshal.go @@ -7,6 +7,7 @@ import ( "io" "sort" + gogoproto "github.com/cosmos/gogoproto/proto" "github.com/pkg/errors" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" @@ -15,6 +16,8 @@ import ( "cosmossdk.io/x/tx/signing" ) +const cosmosDecType = "cosmos.Dec" + // MessageEncoder is a function that can encode a protobuf protoreflect.Message to JSON. type MessageEncoder func(*Encoder, protoreflect.Message, io.Writer) error @@ -23,10 +26,22 @@ type FieldEncoder func(*Encoder, protoreflect.Value, io.Writer) error // EncoderOptions are options for creating a new Encoder. type EncoderOptions struct { - // DonotSortFields when set turns off sorting of field names. + // Indent can only be composed of space or tab characters. + // It defines the indentation used for each level of indentation. + Indent string + // DoNotSortFields when set turns off sorting of field names. DoNotSortFields bool + // EnumAsString when set will encode enums as strings instead of integers. + // Caution: Enabling this option produce different sign bytes. + EnumAsString bool + // AminoNameAsTypeURL when set will use the amino name as the type URL in the JSON output. + // It is useful when using the Amino JSON encoder for non Amino purposes, + // such as JSON RPC. + AminoNameAsTypeURL bool + // MarshalMappings when set will use the Amino JSON encoder to marshal maps. + MarshalMappings bool // TypeResolver is used to resolve protobuf message types by TypeURL when marshaling any packed messages. - TypeResolver protoregistry.MessageTypeResolver + TypeResolver signing.TypeResolver // FileResolver is used to resolve protobuf file descriptors TypeURL when TypeResolver fails. FileResolver signing.ProtoFileResolver } @@ -34,40 +49,54 @@ type EncoderOptions struct { // Encoder is a JSON encoder that uses the Amino JSON encoding rules for protobuf messages. type Encoder struct { // maps cosmos_proto.scalar -> field encoder - scalarEncoders map[string]FieldEncoder - messageEncoders map[string]MessageEncoder - fieldEncoders map[string]FieldEncoder - fileResolver signing.ProtoFileResolver - typeResolver protoregistry.MessageTypeResolver - doNotSortFields bool + cosmosProtoScalarEncoders map[string]FieldEncoder + aminoMessageEncoders map[string]MessageEncoder + aminoFieldEncoders map[string]FieldEncoder + protoTypeEncoders map[string]MessageEncoder + fileResolver signing.ProtoFileResolver + typeResolver protoregistry.MessageTypeResolver + doNotSortFields bool + indent string + enumsAsString bool + aminoNameAsTypeURL bool + marshalMappings bool } // NewEncoder returns a new Encoder capable of serializing protobuf messages to JSON using the Amino JSON encoding // rules. func NewEncoder(options EncoderOptions) Encoder { if options.FileResolver == nil { - options.FileResolver = protoregistry.GlobalFiles + options.FileResolver = gogoproto.HybridResolver } if options.TypeResolver == nil { options.TypeResolver = protoregistry.GlobalTypes } enc := Encoder{ - scalarEncoders: map[string]FieldEncoder{ - "cosmos.Dec": cosmosDecEncoder, - "cosmos.Int": cosmosIntEncoder, + cosmosProtoScalarEncoders: map[string]FieldEncoder{ + cosmosDecType: cosmosDecEncoder, + "cosmos.Int": cosmosIntEncoder, }, - messageEncoders: map[string]MessageEncoder{ + aminoMessageEncoders: map[string]MessageEncoder{ "key_field": keyFieldEncoder, "module_account": moduleAccountEncoder, "threshold_string": thresholdStringEncoder, }, - fieldEncoders: map[string]FieldEncoder{ - "legacy_coins": nullSliceAsEmptyEncoder, - "cosmos_dec_bytes": cosmosDecEncoder, + aminoFieldEncoders: map[string]FieldEncoder{ + "legacy_coins": nullSliceAsEmptyEncoder, + "inline_json": cosmosInlineJSON, + }, + protoTypeEncoders: map[string]MessageEncoder{ + "google.protobuf.Timestamp": marshalTimestamp, + "google.protobuf.Duration": marshalDuration, + "google.protobuf.Any": marshalAny, }, - fileResolver: options.FileResolver, - typeResolver: options.TypeResolver, - doNotSortFields: options.DoNotSortFields, + fileResolver: options.FileResolver, + typeResolver: options.TypeResolver, + doNotSortFields: options.DoNotSortFields, + indent: options.Indent, + enumsAsString: options.EnumAsString, + aminoNameAsTypeURL: options.AminoNameAsTypeURL, + marshalMappings: options.MarshalMappings, } return enc } @@ -82,10 +111,10 @@ func NewEncoder(options EncoderOptions) Encoder { // ... // } func (enc Encoder) DefineMessageEncoding(name string, encoder MessageEncoder) Encoder { - if enc.messageEncoders == nil { - enc.messageEncoders = map[string]MessageEncoder{} + if enc.aminoMessageEncoders == nil { + enc.aminoMessageEncoders = map[string]MessageEncoder{} } - enc.messageEncoders[name] = encoder + enc.aminoMessageEncoders[name] = encoder return enc } @@ -103,36 +132,100 @@ func (enc Encoder) DefineMessageEncoding(name string, encoder MessageEncoder) En // ... // } func (enc Encoder) DefineFieldEncoding(name string, encoder FieldEncoder) Encoder { - if enc.fieldEncoders == nil { - enc.fieldEncoders = map[string]FieldEncoder{} + if enc.aminoFieldEncoders == nil { + enc.aminoFieldEncoders = map[string]FieldEncoder{} + } + enc.aminoFieldEncoders[name] = encoder + return enc +} + +// DefineScalarEncoding defines a custom encoding for a protobuf scalar field. The `name` field must match a usage of +// an (cosmos_proto.scalar) option in the protobuf message as in the following example. This encoding will be used +// instead of the default encoding for all usages of the tagged field. +// +// message Balance { +// string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +// ... +// } +func (enc Encoder) DefineScalarEncoding(name string, encoder FieldEncoder) Encoder { + if enc.cosmosProtoScalarEncoders == nil { + enc.cosmosProtoScalarEncoders = map[string]FieldEncoder{} + } + enc.cosmosProtoScalarEncoders[name] = encoder + return enc +} + +// DefineTypeEncoding defines a custom encoding for a protobuf message type. The `typeURL` field must match the +// type of the protobuf message as in the following example. This encoding will be used instead of the default +// encoding for all usages of the tagged message. +// +// message Foo { +// google.protobuf.Duration type_url = 1; +// ... +// } + +func (enc Encoder) DefineTypeEncoding(typeURL string, encoder MessageEncoder) Encoder { + if enc.protoTypeEncoders == nil { + enc.protoTypeEncoders = map[string]MessageEncoder{} } - enc.fieldEncoders[name] = encoder + enc.protoTypeEncoders[typeURL] = encoder return enc } // Marshal serializes a protobuf message to JSON. func (enc Encoder) Marshal(message proto.Message) ([]byte, error) { buf := &bytes.Buffer{} - err := enc.beginMarshal(message.ProtoReflect(), buf) - return buf.Bytes(), err + err := enc.beginMarshal(message.ProtoReflect(), buf, false) + if err != nil { + return nil, err + } + + if enc.indent != "" { + indentBuf := &bytes.Buffer{} + if err := json.Indent(indentBuf, buf.Bytes(), "", enc.indent); err != nil { + return nil, err + } + + return indentBuf.Bytes(), nil + } + + return buf.Bytes(), nil } -func (enc Encoder) beginMarshal(msg protoreflect.Message, writer io.Writer) error { - name, named := getMessageAminoName(msg.Descriptor().Options()) +func (enc Encoder) beginMarshal(msg protoreflect.Message, writer io.Writer, isAny bool) error { + var ( + name string + named bool + ) + + if isAny { + if enc.aminoNameAsTypeURL { + name, named = getMessageTypeURL(msg), true + } else { + name, named = getMessageAminoNameAny(msg), true + } + } else { + name, named = getMessageAminoName(msg) + if enc.aminoNameAsTypeURL { + // do not override named + name = getMessageTypeURL(msg) + } + } + if named { - _, err := writer.Write([]byte(fmt.Sprintf(`{"type":"%s","value":`, name))) + _, err := fmt.Fprintf(writer, `{"type":"%s","value":`, name) if err != nil { return err } } - err := enc.marshal(protoreflect.ValueOfMessage(msg), writer) + err := enc.marshal(protoreflect.ValueOfMessage(msg), nil /* no field descriptor needed here */, writer) if err != nil { return err } if named { - _, err = writer.Write([]byte("}")) + _, err = io.WriteString(writer, "}") if err != nil { return err } @@ -141,23 +234,48 @@ func (enc Encoder) beginMarshal(msg protoreflect.Message, writer io.Writer) erro return nil } -func (enc Encoder) marshal(value protoreflect.Value, writer io.Writer) error { +func (enc Encoder) marshal(value protoreflect.Value, fd protoreflect.FieldDescriptor, writer io.Writer) error { switch val := value.Interface().(type) { case protoreflect.Message: err := enc.marshalMessage(val, writer) return err case protoreflect.Map: + if enc.marshalMappings { + if !val.IsValid() { + _, err := io.WriteString(writer, "null") + return err + } + + mapData := make(map[string]interface{}) + val.Range(func(k protoreflect.MapKey, v protoreflect.Value) bool { + mapData[k.String()] = v.Interface() + return true + }) + + return jsonMarshal(writer, mapData) + } return errors.New("maps are not supported") case protoreflect.List: if !val.IsValid() { - _, err := writer.Write([]byte("null")) + _, err := io.WriteString(writer, "null") return err } - return enc.marshalList(val, writer) + return enc.marshalList(val, fd, writer) + + case string, bool, int32, uint32, []byte: + return jsonMarshal(writer, val) + + case protoreflect.EnumNumber: + if enc.enumsAsString && fd != nil { + desc := fd.Enum().Values().ByNumber(val) + if desc != nil { + _, err := io.WriteString(writer, fmt.Sprintf(`"%s"`, desc.Name())) + return err + } + } - case string, bool, int32, uint32, []byte, protoreflect.EnumNumber: return jsonMarshal(writer, val) case uint64, int64: @@ -170,8 +288,11 @@ func (enc Encoder) marshal(value protoreflect.Value, writer io.Writer) error { } type nameAndIndex struct { - i int - name string + i int + name string + oneof protoreflect.OneofDescriptor + oneofFieldName string + oneofTypeName string } func (enc Encoder) marshalMessage(msg protoreflect.Message, writer io.Writer) error { @@ -179,14 +300,9 @@ func (enc Encoder) marshalMessage(msg protoreflect.Message, writer io.Writer) er return errors.New("nil message") } - switch msg.Descriptor().FullName() { - case timestampFullName: - // replicate https://github.com/tendermint/go-amino/blob/8e779b71f40d175cd1302d3cd41a75b005225a7a/json-encode.go#L45-L51 - return marshalTimestamp(msg, writer) - case durationFullName: - return marshalDuration(msg, writer) - case anyFullName: - return enc.marshalAny(msg, writer) + // check if we have a custom type encoder for this type + if typeEnc, ok := enc.protoTypeEncoders[string(msg.Descriptor().FullName())]; ok { + return typeEnc(&enc, msg, writer) } if encoder := enc.getMessageEncoder(msg); encoder != nil { @@ -194,7 +310,7 @@ func (enc Encoder) marshalMessage(msg protoreflect.Message, writer io.Writer) er return err } - _, err := writer.Write([]byte("{")) + _, err := io.WriteString(writer, "{") if err != nil { return err } @@ -207,14 +323,37 @@ func (enc Encoder) marshalMessage(msg protoreflect.Message, writer io.Writer) er indices := make([]*nameAndIndex, 0, fields.Len()) for i := 0; i < fields.Len(); i++ { f := fields.Get(i) - name := getAminoFieldName(f) - indices = append(indices, &nameAndIndex{i: i, name: name}) + entry := &nameAndIndex{ + i: i, + name: getAminoFieldName(f), + oneof: f.ContainingOneof(), + } + + if entry.oneof != nil { + var err error + entry.oneofFieldName, entry.oneofTypeName, err = getOneOfNames(f) + if err != nil { + return err + } + } + + indices = append(indices, entry) } if shouldSortFields := !enc.doNotSortFields; shouldSortFields { sort.Slice(indices, func(i, j int) bool { ni, nj := indices[i], indices[j] - return ni.name < nj.name + niName, njName := ni.name, nj.name + + if indices[i].oneof != nil { + niName = indices[i].oneofFieldName + } + + if indices[j].oneof != nil { + njName = indices[j].oneofFieldName + } + + return niName < njName }) } @@ -223,22 +362,17 @@ func (enc Encoder) marshalMessage(msg protoreflect.Message, writer io.Writer) er name := ni.name f := fields.Get(i) v := msg.Get(f) - oneof := f.ContainingOneof() - isOneOf := oneof != nil - oneofFieldName, oneofTypeName, err := getOneOfNames(f) - if err != nil && isOneOf { - return err - } + isOneOf := ni.oneof != nil writeNil := false if !msg.Has(f) { // msg.WhichOneof(oneof) == nil: no field of the oneof has been set // !emptyOneOfWritten: we haven't written a null for this oneof yet (only write one null per empty oneof) switch { - case isOneOf && msg.WhichOneof(oneof) == nil && !emptyOneOfWritten[oneofFieldName]: - name = oneofFieldName + case isOneOf && msg.WhichOneof(ni.oneof) == nil && !emptyOneOfWritten[ni.oneofFieldName]: + name = ni.oneofFieldName writeNil = true - emptyOneOfWritten[oneofFieldName] = true + emptyOneOfWritten[ni.oneofFieldName] = true case omitEmpty(f): continue case f.Kind() == protoreflect.MessageKind && @@ -249,15 +383,14 @@ func (enc Encoder) marshalMessage(msg protoreflect.Message, writer io.Writer) er } if !first { - _, err = writer.Write([]byte(",")) + _, err = io.WriteString(writer, ",") if err != nil { return err } } if isOneOf && !writeNil { - _, err = writer.Write([]byte(fmt.Sprintf(`"%s":{"type":"%s","value":{`, - oneofFieldName, oneofTypeName))) + _, err = fmt.Fprintf(writer, `"%s":{"type":"%s","value":{`, ni.oneofFieldName, ni.oneofTypeName) if err != nil { return err } @@ -268,31 +401,31 @@ func (enc Encoder) marshalMessage(msg protoreflect.Message, writer io.Writer) er return err } - _, err = writer.Write([]byte(":")) + _, err = io.WriteString(writer, ":") if err != nil { return err } // encode value - if encoder := enc.getFieldEncoding(f); encoder != nil { + if encoder := enc.getFieldEncoder(f); encoder != nil { err = encoder(&enc, v, writer) if err != nil { return err } } else if writeNil { - _, err = writer.Write([]byte("null")) + _, err = io.WriteString(writer, "null") if err != nil { return err } } else { - err = enc.marshal(v, writer) + err = enc.marshal(v, f, writer) if err != nil { return err } } if isOneOf && !writeNil { - _, err = writer.Write([]byte("}}")) + _, err = io.WriteString(writer, "}}") if err != nil { return err } @@ -301,7 +434,7 @@ func (enc Encoder) marshalMessage(msg protoreflect.Message, writer io.Writer) er first = false } - _, err = writer.Write([]byte("}")) + _, err = io.WriteString(writer, "}") return err } @@ -314,10 +447,10 @@ func jsonMarshal(w io.Writer, v interface{}) error { return err } -func (enc Encoder) marshalList(list protoreflect.List, writer io.Writer) error { +func (enc Encoder) marshalList(list protoreflect.List, fd protoreflect.FieldDescriptor, writer io.Writer) error { n := list.Len() - _, err := writer.Write([]byte("[")) + _, err := io.WriteString(writer, "[") if err != nil { return err } @@ -325,25 +458,19 @@ func (enc Encoder) marshalList(list protoreflect.List, writer io.Writer) error { first := true for i := 0; i < n; i++ { if !first { - _, err := writer.Write([]byte(",")) + _, err := io.WriteString(writer, ",") if err != nil { return err } } first = false - err = enc.marshal(list.Get(i), writer) + err = enc.marshal(list.Get(i), fd, writer) if err != nil { return err } } - _, err = writer.Write([]byte("]")) + _, err = io.WriteString(writer, "]") return err } - -const ( - timestampFullName protoreflect.FullName = "google.protobuf.Timestamp" - durationFullName protoreflect.FullName = "google.protobuf.Duration" - anyFullName protoreflect.FullName = "google.protobuf.Any" -) diff --git a/x/tx/signing/aminojson/json_marshal_test.go b/x/tx/signing/aminojson/json_marshal_test.go index 1d8ec8cf6183..7dae096f8410 100644 --- a/x/tx/signing/aminojson/json_marshal_test.go +++ b/x/tx/signing/aminojson/json_marshal_test.go @@ -2,11 +2,13 @@ package aminojson_test import ( "encoding/json" + "errors" "fmt" + "io" "reflect" "testing" + "time" - "cosmossdk.io/x/tx/signing/aminojson/internal/aminojsonpb" "github.com/cosmos/cosmos-proto/rapidproto" "github.com/stretchr/testify/require" "github.com/tendermint/go-amino" @@ -15,12 +17,12 @@ import ( "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" "google.golang.org/protobuf/types/dynamicpb" - "pgregory.net/rapid" - + "google.golang.org/protobuf/types/known/durationpb" "gotest.tools/v3/assert" + "pgregory.net/rapid" "cosmossdk.io/x/tx/signing/aminojson" - + "cosmossdk.io/x/tx/signing/aminojson/internal/aminojsonpb" "cosmossdk.io/x/tx/signing/aminojson/internal/testpb" ) @@ -119,12 +121,13 @@ func TestAminoJSON(t *testing.T) { require.Equal(t, string(sortedBz), string(encodedDefaultBz)) } -func naiveSortedJSON(t testing.TB, jsonToSort []byte) []byte { +func naiveSortedJSON(tb testing.TB, jsonToSort []byte) []byte { + tb.Helper() var c interface{} err := json.Unmarshal(jsonToSort, &c) - assert.NilError(t, err) + assert.NilError(tb, err) sortedBz, err := json.Marshal(c) - assert.NilError(t, err) + assert.NilError(tb, err) return sortedBz } @@ -175,6 +178,262 @@ func TestDynamicPb(t *testing.T) { require.NoError(t, err) dynamicBz, err := encoder.Marshal(dynamicMsg) require.NoError(t, err) - fmt.Printf("dynamicBz: %s\n", string(dynamicBz)) require.Equal(t, string(bz), string(dynamicBz)) } + +func TestMarshalDuration(t *testing.T) { + msg := &testpb.Duration{ + Duration: &durationpb.Duration{Seconds: 1}, + } + encoder := aminojson.NewEncoder(aminojson.EncoderOptions{}) + + bz, err := encoder.Marshal(msg) + require.NoError(t, err) + require.Equal(t, `{"duration":"1000000000"}`, string(bz)) + + // define a custom marshaler for duration + encoder.DefineTypeEncoding("google.protobuf.Duration", func(_ *aminojson.Encoder, msg protoreflect.Message, w io.Writer) error { + var secondsName protoreflect.Name = "seconds" + + fields := msg.Descriptor().Fields() + secondsField := fields.ByName(secondsName) + if secondsField == nil { + return errors.New("expected seconds field") + } + seconds := msg.Get(secondsField).Int() + + _, err = fmt.Fprint(w, "\"", (time.Duration(seconds) * time.Second).String(), "\"") + return err + }) + bz, err = encoder.Marshal(msg) + require.NoError(t, err) + require.Equal(t, `{"duration":"1s"}`, string(bz)) +} + +func TestWithAJson(t *testing.T) { + encoder := aminojson.NewEncoder(aminojson.EncoderOptions{}) + + // list + msg := &testpb.WithAJson{ + Field1: []byte(`[{"name":"child1"}]`), + } + bz, err := encoder.Marshal(msg) + require.NoError(t, err) + require.Equal(t, `{"field1":[{"name":"child1"}]}`, string(bz)) + + // string + msg = &testpb.WithAJson{ + Field1: []byte(`"hello again"`), + } + bz, err = encoder.Marshal(msg) + require.NoError(t, err) + require.Equal(t, `{"field1":"hello again"}`, string(bz)) + + // object + msg = &testpb.WithAJson{ + Field1: []byte(`{"deeper":{"nesting":1}}`), + } + bz, err = encoder.Marshal(msg) + require.NoError(t, err) + require.Equal(t, `{"field1":{"deeper":{"nesting":1}}}`, string(bz)) +} + +func TestIndent(t *testing.T) { + encoder := aminojson.NewEncoder(aminojson.EncoderOptions{Indent: " "}) + + msg := &testpb.ABitOfEverything{ + Message: &testpb.NestedMessage{ + Foo: "test", + Bar: 0, // this is the default value and should be omitted from output + }, + Enum: testpb.AnEnum_ONE, + Repeated: []int32{3, -7, 2, 6, 4}, + Str: `abcxyz"foo"def`, + Bool: true, + Bytes: []byte{0, 1, 2, 3}, + I32: -15, + F32: 1001, + U32: 1200, + Si32: -376, + Sf32: -1000, + I64: 14578294827584932, + F64: 9572348124213523654, + U64: 4759492485, + Si64: -59268425823934, + Sf64: -659101379604211154, + } + + bz, err := encoder.Marshal(msg) + require.NoError(t, err) + require.Equal(t, `{ + "type": "ABitOfEverything", + "value": { + "bool": true, + "bytes": "AAECAw==", + "enum": 1, + "f32": 1001, + "f64": "9572348124213523654", + "i32": -15, + "i64": "14578294827584932", + "message": { + "foo": "test" + }, + "repeated": [ + 3, + -7, + 2, + 6, + 4 + ], + "sf32": -1000, + "sf64": "-659101379604211154", + "si32": -376, + "si64": "-59268425823934", + "str": "abcxyz\"foo\"def", + "u32": 1200, + "u64": "4759492485" + } +}`, string(bz)) +} + +func TestEnumAsString(t *testing.T) { + encoder := aminojson.NewEncoder(aminojson.EncoderOptions{Indent: " ", EnumAsString: true}) + + msg := &testpb.ABitOfEverything{ + Message: &testpb.NestedMessage{ + Foo: "test", + Bar: 0, // this is the default value and should be omitted from output + }, + Enum: testpb.AnEnum_ONE, + Repeated: []int32{3, -7, 2, 6, 4}, + Str: `abcxyz"foo"def`, + Bool: true, + Bytes: []byte{0, 1, 2, 3}, + I32: -15, + F32: 1001, + U32: 1200, + Si32: -376, + Sf32: -1000, + I64: 14578294827584932, + F64: 9572348124213523654, + U64: 4759492485, + Si64: -59268425823934, + Sf64: -659101379604211154, + } + + bz, err := encoder.Marshal(msg) + require.NoError(t, err) + require.Equal(t, `{ + "type": "ABitOfEverything", + "value": { + "bool": true, + "bytes": "AAECAw==", + "enum": "ONE", + "f32": 1001, + "f64": "9572348124213523654", + "i32": -15, + "i64": "14578294827584932", + "message": { + "foo": "test" + }, + "repeated": [ + 3, + -7, + 2, + 6, + 4 + ], + "sf32": -1000, + "sf64": "-659101379604211154", + "si32": -376, + "si64": "-59268425823934", + "str": "abcxyz\"foo\"def", + "u32": 1200, + "u64": "4759492485" + } +}`, string(bz)) +} + +func TestAminoNameAsTypeURL(t *testing.T) { + encoder := aminojson.NewEncoder(aminojson.EncoderOptions{Indent: " ", AminoNameAsTypeURL: true}) + + msg := &testpb.ABitOfEverything{ + Message: &testpb.NestedMessage{ + Foo: "test", + Bar: 0, // this is the default value and should be omitted from output + }, + Enum: testpb.AnEnum_ONE, + Repeated: []int32{3, -7, 2, 6, 4}, + Str: `abcxyz"foo"def`, + Bool: true, + Bytes: []byte{0, 1, 2, 3}, + I32: -15, + F32: 1001, + U32: 1200, + Si32: -376, + Sf32: -1000, + I64: 14578294827584932, + F64: 9572348124213523654, + U64: 4759492485, + Si64: -59268425823934, + Sf64: -659101379604211154, + } + + bz, err := encoder.Marshal(msg) + require.NoError(t, err) + require.Equal(t, `{ + "type": "/testpb.ABitOfEverything", + "value": { + "bool": true, + "bytes": "AAECAw==", + "enum": 1, + "f32": 1001, + "f64": "9572348124213523654", + "i32": -15, + "i64": "14578294827584932", + "message": { + "foo": "test" + }, + "repeated": [ + 3, + -7, + 2, + 6, + 4 + ], + "sf32": -1000, + "sf64": "-659101379604211154", + "si32": -376, + "si64": "-59268425823934", + "str": "abcxyz\"foo\"def", + "u32": 1200, + "u64": "4759492485" + } +}`, string(bz)) +} + +func TestMarshalMappings(t *testing.T) { + // valid + encoder := aminojson.NewEncoder(aminojson.EncoderOptions{Indent: " ", MarshalMappings: true}) + + msg := &testpb.WithAMap{ + StrMap: map[string]string{ + "foo": "bar", + "baz": "qux", + }, + } + + bz, err := encoder.Marshal(msg) + require.NoError(t, err) + require.Equal(t, `{ + "str_map": { + "baz": "qux", + "foo": "bar" + } +}`, string(bz)) + + // invalid + encoder = aminojson.NewEncoder(aminojson.EncoderOptions{Indent: " ", MarshalMappings: false}) + _, err = encoder.Marshal(msg) + require.Error(t, err) +} diff --git a/x/tx/signing/aminojson/options.go b/x/tx/signing/aminojson/options.go index f8b8991d04db..9a87cd56726b 100644 --- a/x/tx/signing/aminojson/options.go +++ b/x/tx/signing/aminojson/options.go @@ -2,24 +2,57 @@ package aminojson import ( cosmos_proto "github.com/cosmos/cosmos-proto" + gogo "github.com/cosmos/gogoproto/gogoproto" + gogoproto "github.com/cosmos/gogoproto/proto" "github.com/iancoleman/strcase" "github.com/pkg/errors" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/reflect/protoregistry" + "google.golang.org/protobuf/runtime/protoimpl" + "google.golang.org/protobuf/types/descriptorpb" "cosmossdk.io/api/amino" ) // getMessageAminoName returns the amino name of a message if it has been set by the `amino.name` option. // If the message does not have an amino name, then the function returns false. -func getMessageAminoName(messageOptions proto.Message) (string, bool) { +func getMessageAminoName(msg protoreflect.Message) (string, bool) { + messageOptions := msg.Descriptor().Options() if proto.HasExtension(messageOptions, amino.E_Name) { name := proto.GetExtension(messageOptions, amino.E_Name) return name.(string), true } + return "", false } +// getMessageAminoName returns the amino name of a message if it has been set by the `amino.name` option. +// If the message does not have an amino name, then it returns the msg url. +func getMessageAminoNameAny(msg protoreflect.Message) string { + messageOptions := msg.Descriptor().Options() + if proto.HasExtension(messageOptions, amino.E_Name) { + name := proto.GetExtension(messageOptions, amino.E_Name) + return name.(string) + } + + return getMessageTypeURL(msg) +} + +// getMessageTypeURL returns the msg url. +func getMessageTypeURL(msg protoreflect.Message) string { + msgURL := "/" + string(msg.Descriptor().FullName()) + if msgURL != "/" { + return msgURL + } + + if m, ok := msg.(gogoproto.Message); ok { + return "/" + gogoproto.MessageName(m) + } + + return "" +} + // omitEmpty returns true if the field should be omitted if empty. Empty field omission is the default behavior. func omitEmpty(field protoreflect.FieldDescriptor) bool { opts := field.Options() @@ -64,24 +97,49 @@ func (enc Encoder) getMessageEncoder(message protoreflect.Message) MessageEncode opts := message.Descriptor().Options() if proto.HasExtension(opts, amino.E_MessageEncoding) { encoding := proto.GetExtension(opts, amino.E_MessageEncoding).(string) - if fn, ok := enc.messageEncoders[encoding]; ok { + if fn, ok := enc.aminoMessageEncoders[encoding]; ok { return fn } } return nil } -func (enc Encoder) getFieldEncoding(field protoreflect.FieldDescriptor) FieldEncoder { +var customTypeExtension = &protoimpl.ExtensionInfo{ + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: gogo.E_Customtype.ExtensionType, + Field: gogo.E_Customtype.Field, + Name: gogo.E_Customtype.Name, + Tag: gogo.E_Customtype.Tag, + Filename: gogo.E_Customtype.Filename, +} + +func init() { + protoregistry.GlobalTypes.RegisterExtension(customTypeExtension) +} + +func (enc Encoder) getFieldEncoder(field protoreflect.FieldDescriptor) FieldEncoder { opts := field.Options() if proto.HasExtension(opts, amino.E_Encoding) { encoding := proto.GetExtension(opts, amino.E_Encoding).(string) - if fn, ok := enc.fieldEncoders[encoding]; ok { + if fn, ok := enc.aminoFieldEncoders[encoding]; ok { return fn } } if proto.HasExtension(opts, cosmos_proto.E_Scalar) { scalar := proto.GetExtension(opts, cosmos_proto.E_Scalar).(string) - if fn, ok := enc.scalarEncoders[scalar]; ok { + // do not handle encoding of fields tagged only with scalar which are not backed by a + // LegacyDec custom type. This types are handled by the default encoding, as they are + // expected to already be encoded as their human readable string representation + // containing a radix, i.e. "1.2345". + // For example: + // https://github.com/cosmos/cosmos-sdk/blob/9076487d035e43d39fe54e8498da1ce31b9c845c/x/gov/proto/cosmos/gov/v1/gov.proto#L274 + if scalar == cosmosDecType { + customType := proto.GetExtension(opts, customTypeExtension) + if customType != "cosmossdk.io/math.LegacyDec" { + return nil + } + } + if fn, ok := enc.cosmosProtoScalarEncoders[scalar]; ok { return fn } } diff --git a/x/tx/signing/aminojson/options_test.go b/x/tx/signing/aminojson/options_test.go new file mode 100644 index 000000000000..8038827f0f7f --- /dev/null +++ b/x/tx/signing/aminojson/options_test.go @@ -0,0 +1,30 @@ +package aminojson + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "cosmossdk.io/x/tx/signing/aminojson/internal/testpb" +) + +func Test_getMessageAminoName(t *testing.T) { + msg := &testpb.ABitOfEverything{} + name, ok := getMessageAminoName(msg.ProtoReflect()) + require.True(t, ok) + require.Equal(t, "ABitOfEverything", name) + + secondMsg := &testpb.Duration{} + _, ok = getMessageAminoName(secondMsg.ProtoReflect()) + require.False(t, ok) +} + +func Test_getMessageAminoNameAny(t *testing.T) { + msg := &testpb.ABitOfEverything{} + name := getMessageAminoNameAny(msg.ProtoReflect()) + require.Equal(t, "ABitOfEverything", name) + + secondMsg := &testpb.Duration{} + name = getMessageAminoNameAny(secondMsg.ProtoReflect()) + require.Equal(t, "/testpb.Duration", name) +} diff --git a/x/tx/signing/aminojson/time.go b/x/tx/signing/aminojson/time.go index da02514c0255..9bfa035928e7 100644 --- a/x/tx/signing/aminojson/time.go +++ b/x/tx/signing/aminojson/time.go @@ -1,6 +1,7 @@ package aminojson import ( + "errors" "fmt" "io" "math" @@ -14,16 +15,17 @@ const ( nanosName protoreflect.Name = "nanos" ) -func marshalTimestamp(message protoreflect.Message, writer io.Writer) error { +// marshalTimestamp replicate https://github.com/tendermint/go-amino/blob/8e779b71f40d175cd1302d3cd41a75b005225a7a/json-encode.go#L45-L51 +func marshalTimestamp(_ *Encoder, message protoreflect.Message, writer io.Writer) error { fields := message.Descriptor().Fields() secondsField := fields.ByName(secondsName) if secondsField == nil { - return fmt.Errorf("expected seconds field") + return errors.New("expected seconds field") } nanosField := fields.ByName(nanosName) if nanosField == nil { - return fmt.Errorf("expected nanos field") + return errors.New("expected nanos field") } seconds := message.Get(secondsField).Int() @@ -48,11 +50,11 @@ func marshalTimestamp(message protoreflect.Message, writer io.Writer) error { // gogoproto encodes google.protobuf.Duration as a time.Duration, which is 64-bit signed integer. const MaxDurationSeconds = int64(math.MaxInt64)/1e9 - 1 -func marshalDuration(message protoreflect.Message, writer io.Writer) error { +func marshalDuration(_ *Encoder, message protoreflect.Message, writer io.Writer) error { fields := message.Descriptor().Fields() secondsField := fields.ByName(secondsName) if secondsField == nil { - return fmt.Errorf("expected seconds field") + return errors.New("expected seconds field") } // todo @@ -64,11 +66,11 @@ func marshalDuration(message protoreflect.Message, writer io.Writer) error { nanosField := fields.ByName(nanosName) if nanosField == nil { - return fmt.Errorf("expected nanos field") + return errors.New("expected nanos field") } nanos := message.Get(nanosField).Int() totalNanos := nanos + (seconds * 1e9) - _, err := writer.Write([]byte(fmt.Sprintf(`"%d"`, totalNanos))) + _, err := fmt.Fprintf(writer, `"%d"`, totalNanos) return err } diff --git a/x/tx/signing/context.go b/x/tx/signing/context.go index 9571bea67c07..e3a9855cdd25 100644 --- a/x/tx/signing/context.go +++ b/x/tx/signing/context.go @@ -3,18 +3,24 @@ package signing import ( "errors" "fmt" + "sync" cosmos_proto "github.com/cosmos/cosmos-proto" + gogoproto "github.com/cosmos/gogoproto/proto" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protodesc" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" - "cosmossdk.io/core/address" - msgv1 "cosmossdk.io/api/cosmos/msg/v1" + "cosmossdk.io/core/address" ) +type TypeResolver interface { + protoregistry.MessageTypeResolver + protoregistry.ExtensionTypeResolver +} + // Context is a context for retrieving the list of signers from a // message where signers are specified by the cosmos.msg.v1.signer protobuf // option. It also contains the ProtoFileResolver and address.Codec's used @@ -24,8 +30,9 @@ type Context struct { typeResolver protoregistry.MessageTypeResolver addressCodec address.Codec validatorAddressCodec address.Codec - getSignersFuncs map[protoreflect.FullName]GetSignersFunc + getSignersFuncs sync.Map customGetSignerFuncs map[protoreflect.FullName]GetSignersFunc + maxRecursionDepth int } // Options are options for creating Context which will be used for signing operations. @@ -35,7 +42,7 @@ type Options struct { FileResolver ProtoFileResolver // TypeResolver is the protobuf type resolver to use for resolving message types. - TypeResolver protoregistry.MessageTypeResolver + TypeResolver TypeResolver // AddressCodec is the codec for converting addresses between strings and bytes. AddressCodec address.Codec @@ -43,7 +50,11 @@ type Options struct { // ValidatorAddressCodec is the codec for converting validator addresses between strings and bytes. ValidatorAddressCodec address.Codec + // CustomGetSigners is a map of message types to custom GetSignersFuncs. CustomGetSigners map[protoreflect.FullName]GetSignersFunc + + // MaxRecursionDepth is the maximum depth of nested messages that will be traversed + MaxRecursionDepth int } // DefineCustomGetSigners defines a custom GetSigners function for a given @@ -70,7 +81,7 @@ type ProtoFileResolver interface { func NewContext(options Options) (*Context, error) { protoFiles := options.FileResolver if protoFiles == nil { - protoFiles = protoregistry.GlobalFiles + protoFiles = gogoproto.HybridResolver } protoTypes := options.TypeResolver @@ -86,6 +97,10 @@ func NewContext(options Options) (*Context, error) { return nil, errors.New("validator address codec is required") } + if options.MaxRecursionDepth <= 0 { + options.MaxRecursionDepth = 32 + } + customGetSignerFuncs := map[protoreflect.FullName]GetSignersFunc{} for k := range options.CustomGetSigners { customGetSignerFuncs[k] = options.CustomGetSigners[k] @@ -96,8 +111,9 @@ func NewContext(options Options) (*Context, error) { typeResolver: protoTypes, addressCodec: options.AddressCodec, validatorAddressCodec: options.ValidatorAddressCodec, - getSignersFuncs: map[protoreflect.FullName]GetSignersFunc{}, + getSignersFuncs: sync.Map{}, customGetSignerFuncs: customGetSignerFuncs, + maxRecursionDepth: options.MaxRecursionDepth, } return c, nil @@ -204,92 +220,87 @@ func (c *Context) makeGetSignersFunc(descriptor protoreflect.MessageDescriptor) } } case protoreflect.MessageKind: - isList := field.IsList() - nestedMessage := field.Message() - nestedSignersFields, err := getSignersFieldNames(nestedMessage) - if err != nil { - return nil, err - } - - if len(nestedSignersFields) != 1 { - return nil, fmt.Errorf("nested cosmos.msg.v1.signer option in message %s must contain only one value", nestedMessage.FullName()) - } - - nestedFieldName := nestedSignersFields[0] - nestedField := nestedMessage.Fields().ByName(protoreflect.Name(nestedFieldName)) - nestedIsList := nestedField.IsList() - if nestedField == nil { - return nil, fmt.Errorf("field %s not found in message %s", nestedFieldName, nestedMessage.FullName()) - } - - if nestedField.Kind() != protoreflect.StringKind || nestedField.IsMap() || nestedField.HasOptionalKeyword() { - return nil, fmt.Errorf("nested signer field %s in message %s must be a simple string", nestedFieldName, nestedMessage.FullName()) - } - - addrCdc := c.getAddressCodec(nestedField) - - if isList { - if nestedIsList { - fieldGetters[i] = func(msg proto.Message, arr [][]byte) ([][]byte, error) { - msgs := msg.ProtoReflect().Get(field).List() - m := msgs.Len() - for i := 0; i < m; i++ { - signers := msgs.Get(i).Message().Get(nestedField).List() - n := signers.Len() - for j := 0; j < n; j++ { - addrStr := signers.Get(j).String() - addrBz, err := addrCdc.StringToBytes(addrStr) - if err != nil { - return nil, err - } - arr = append(arr, addrBz) - } - } - return arr, nil - } - } else { - fieldGetters[i] = func(msg proto.Message, arr [][]byte) ([][]byte, error) { - msgs := msg.ProtoReflect().Get(field).List() - m := msgs.Len() - for i := 0; i < m; i++ { - addrStr := msgs.Get(i).Message().Get(nestedField).String() - addrBz, err := addrCdc.StringToBytes(addrStr) + var fieldGetter func(protoreflect.Message, int) ([][]byte, error) + fieldGetter = func(msg protoreflect.Message, depth int) ([][]byte, error) { + if depth > c.maxRecursionDepth { + return nil, errors.New("maximum recursion depth exceeded") + } + desc := msg.Descriptor() + signerFields, err := getSignersFieldNames(desc) + if err != nil { + return nil, err + } + if len(signerFields) != 1 { + return nil, fmt.Errorf("nested cosmos.msg.v1.signer option in message %s must contain only one value", desc.FullName()) + } + signerFieldName := signerFields[0] + childField := desc.Fields().ByName(protoreflect.Name(signerFieldName)) + switch { + case childField.Kind() == protoreflect.MessageKind: + if childField.IsList() { + childMsgs := msg.Get(childField).List() + var arr [][]byte + for i := 0; i < childMsgs.Len(); i++ { + res, err := fieldGetter(childMsgs.Get(i).Message(), depth+1) if err != nil { return nil, err } - arr = append(arr, addrBz) + arr = append(arr, res...) } return arr, nil } - } - } else { - if nestedIsList { - fieldGetters[i] = func(msg proto.Message, arr [][]byte) ([][]byte, error) { - nestedMsg := msg.ProtoReflect().Get(field).Message() - signers := nestedMsg.Get(nestedField).List() - n := signers.Len() - for j := 0; j < n; j++ { - addrStr := signers.Get(j).String() + + return fieldGetter(msg.Get(childField).Message(), depth+1) + case childField.IsMap() || childField.HasOptionalKeyword(): + return nil, fmt.Errorf("cosmos.msg.v1.signer field %s in message %s must not be a map or optional", signerFieldName, desc.FullName()) + case childField.Kind() == protoreflect.StringKind: + addrCdc := c.getAddressCodec(childField) + if childField.IsList() { + childMsgs := msg.Get(childField).List() + n := childMsgs.Len() + var res [][]byte + for i := 0; i < n; i++ { + addrStr := childMsgs.Get(i).String() addrBz, err := addrCdc.StringToBytes(addrStr) if err != nil { return nil, err } - arr = append(arr, addrBz) + res = append(res, addrBz) } - return arr, nil + return res, nil } - } else { - fieldGetters[i] = func(msg proto.Message, arr [][]byte) ([][]byte, error) { - addrStr := msg.ProtoReflect().Get(field).Message().Get(nestedField).String() - addrBz, err := addrCdc.StringToBytes(addrStr) + + addrStr := msg.Get(childField).String() + addrBz, err := addrCdc.StringToBytes(addrStr) + if err != nil { + return nil, err + } + return [][]byte{addrBz}, nil + } + return nil, fmt.Errorf("unexpected field type %s for field %s in message %s, only string and message type are supported", + childField.Kind(), signerFieldName, desc.FullName()) + } + + fieldGetters[i] = func(msg proto.Message, arr [][]byte) ([][]byte, error) { + if field.IsList() { + signers := msg.ProtoReflect().Get(field).List() + n := signers.Len() + for i := 0; i < n; i++ { + res, err := fieldGetter(signers.Get(i).Message(), 0) if err != nil { return nil, err } - return append(arr, addrBz), nil + arr = append(arr, res...) } + } else { + res, err := fieldGetter(msg.ProtoReflect().Get(field).Message(), 0) + if err != nil { + return nil, err + } + arr = append(arr, res...) } + return arr, nil } - default: return nil, fmt.Errorf("unexpected field type %s for field %s in message %s", field.Kind(), fieldName, descriptor.FullName()) } @@ -324,14 +335,17 @@ func (c *Context) getGetSignersFn(messageDescriptor protoreflect.MessageDescript if ok { return f, nil } - f, ok = c.getSignersFuncs[messageDescriptor.FullName()] + + loadedFn, ok := c.getSignersFuncs.Load(messageDescriptor.FullName()) if !ok { var err error f, err = c.makeGetSignersFunc(messageDescriptor) if err != nil { return nil, err } - c.getSignersFuncs[messageDescriptor.FullName()] = f + c.getSignersFuncs.Store(messageDescriptor.FullName(), f) + } else { + f = loadedFn.(GetSignersFunc) } return f, nil diff --git a/x/tx/signing/context_test.go b/x/tx/signing/context_test.go index 34ca2daa6465..88f0bf4aadf9 100644 --- a/x/tx/signing/context_test.go +++ b/x/tx/signing/context_test.go @@ -5,15 +5,67 @@ import ( "strings" "testing" - bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" - groupv1 "cosmossdk.io/api/cosmos/group/v1" - "cosmossdk.io/core/address" "github.com/stretchr/testify/require" "google.golang.org/protobuf/proto" + bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" + groupv1 "cosmossdk.io/api/cosmos/group/v1" + "cosmossdk.io/core/address" "cosmossdk.io/x/tx/internal/testpb" ) +var deeplyNestedRepeatedSigner = &testpb.DeeplyNestedRepeatedSigner{ + Inner: []*testpb.DeeplyNestedRepeatedSigner_Inner{ + { + Inner: []*testpb.DeeplyNestedRepeatedSigner_Inner_Inner{ + { + Inner: []*testpb.DeeplyNestedRepeatedSigner_Inner_Inner_Bottom{ + { + Signer: []string{hex.EncodeToString([]byte("foo")), hex.EncodeToString([]byte("bar"))}, + }, + }, + }, + }, + }, + { + Inner: []*testpb.DeeplyNestedRepeatedSigner_Inner_Inner{ + { + Inner: []*testpb.DeeplyNestedRepeatedSigner_Inner_Inner_Bottom{ + { + Signer: []string{hex.EncodeToString([]byte("baz"))}, + }, + }, + }, + { + Inner: []*testpb.DeeplyNestedRepeatedSigner_Inner_Inner_Bottom{ + { + Signer: []string{hex.EncodeToString([]byte("qux")), hex.EncodeToString([]byte("fuz"))}, + }, + { + Signer: []string{hex.EncodeToString([]byte("bing")), hex.EncodeToString([]byte("bap"))}, + }, + }, + }, + }, + }, + }, +} + +func TestGetGetSignersFnConcurrent(t *testing.T) { + ctx, err := NewContext(Options{ + AddressCodec: dummyAddressCodec{}, + ValidatorAddressCodec: dummyValidatorAddressCodec{}, + }) + require.NoError(t, err) + + desc := (&testpb.RepeatedSigner{}).ProtoReflect().Descriptor() + for i := 0; i < 50; i++ { + go func() { + _, _ = ctx.getGetSignersFn(desc) + }() + } +} + func TestGetSigners(t *testing.T) { ctx, err := NewContext(Options{ AddressCodec: dummyAddressCodec{}, @@ -88,7 +140,18 @@ func TestGetSigners(t *testing.T) { want: [][]byte{[]byte("foo"), []byte("bar")}, }, { - name: "nested repeated", + name: "deeply nested", + msg: &testpb.DeeplyNestedSigner{ + InnerOne: &testpb.DeeplyNestedSigner_InnerOne{ + InnerTwo: &testpb.DeeplyNestedSigner_InnerOne_InnerTwo{ + Signer: hex.EncodeToString([]byte("foo")), + }, + }, + }, + want: [][]byte{[]byte("foo")}, + }, + { + name: "nested repeated #1", msg: &testpb.NestedRepeatedSigner{Inner: &testpb.NestedRepeatedSigner_Inner{ Signer: []string{ hex.EncodeToString([]byte("foo")), @@ -97,6 +160,11 @@ func TestGetSigners(t *testing.T) { }}, want: [][]byte{[]byte("foo"), []byte("bar")}, }, + { + name: "nested repeated #2", + msg: deeplyNestedRepeatedSigner, + want: [][]byte{[]byte("foo"), []byte("bar"), []byte("baz"), []byte("qux"), []byte("fuz"), []byte("bing"), []byte("bap")}, + }, { name: "repeated nested repeated", msg: &testpb.RepeatedNestedRepeatedSigner{Inner: []*testpb.RepeatedNestedRepeatedSigner_Inner{ @@ -145,6 +213,27 @@ func TestGetSigners(t *testing.T) { } } +func TestMaxRecursionDepth(t *testing.T) { + ctx, err := NewContext(Options{ + AddressCodec: dummyAddressCodec{}, + ValidatorAddressCodec: dummyValidatorAddressCodec{}, + MaxRecursionDepth: 1, + }) + require.NoError(t, err) + + _, err = ctx.GetSigners(deeplyNestedRepeatedSigner) + require.ErrorContains(t, err, "maximum recursion depth exceeded") + + ctx, err = NewContext(Options{ + AddressCodec: dummyAddressCodec{}, + ValidatorAddressCodec: dummyValidatorAddressCodec{}, + MaxRecursionDepth: 5, + }) + require.NoError(t, err) + _, err = ctx.GetSigners(deeplyNestedRepeatedSigner) + require.NoError(t, err) +} + func TestDefineCustomGetSigners(t *testing.T) { customMsg := &testpb.Ballot{} signers := [][]byte{[]byte("foo")} diff --git a/x/tx/signing/direct/direct.go b/x/tx/signing/direct/direct.go index 6cacb63aaf84..57e005981010 100644 --- a/x/tx/signing/direct/direct.go +++ b/x/tx/signing/direct/direct.go @@ -3,13 +3,18 @@ package direct import ( "context" - signingv1beta1 "cosmossdk.io/api/cosmos/tx/signing/v1beta1" - txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" "google.golang.org/protobuf/proto" + signingv1beta1 "cosmossdk.io/api/cosmos/tx/signing/v1beta1" + txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" "cosmossdk.io/x/tx/signing" ) +var ( + _ signing.SignModeHandler = SignModeHandler{} + protov2MarshalOpts = proto.MarshalOptions{Deterministic: true} +) + // SignModeHandler is the SIGN_MODE_DIRECT implementation of signing.SignModeHandler. type SignModeHandler struct{} @@ -20,12 +25,10 @@ func (h SignModeHandler) Mode() signingv1beta1.SignMode { // GetSignBytes implements signing.SignModeHandler.GetSignBytes. func (SignModeHandler) GetSignBytes(_ context.Context, signerData signing.SignerData, txData signing.TxData) ([]byte, error) { - return proto.Marshal(&txv1beta1.SignDoc{ + return protov2MarshalOpts.Marshal(&txv1beta1.SignDoc{ BodyBytes: txData.BodyBytes, AuthInfoBytes: txData.AuthInfoBytes, ChainId: signerData.ChainID, AccountNumber: signerData.AccountNumber, }) } - -var _ signing.SignModeHandler = SignModeHandler{} diff --git a/x/tx/signing/direct/direct_test.go b/x/tx/signing/direct/direct_test.go index d75c39652786..da5abcc1c122 100644 --- a/x/tx/signing/direct/direct_test.go +++ b/x/tx/signing/direct/direct_test.go @@ -4,16 +4,16 @@ import ( "context" "testing" - bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" - basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" - "cosmossdk.io/api/cosmos/crypto/secp256k1" - signingv1beta1 "cosmossdk.io/api/cosmos/tx/signing/v1beta1" - txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" "github.com/cosmos/cosmos-proto/anyutil" "github.com/stretchr/testify/require" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/known/anypb" + bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" + basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + "cosmossdk.io/api/cosmos/crypto/secp256k1" + signingv1beta1 "cosmossdk.io/api/cosmos/tx/signing/v1beta1" + txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" "cosmossdk.io/x/tx/signing" "cosmossdk.io/x/tx/signing/direct" ) diff --git a/x/tx/signing/directaux/direct_aux.go b/x/tx/signing/directaux/direct_aux.go index f20b56f513e0..fbc56b670888 100644 --- a/x/tx/signing/directaux/direct_aux.go +++ b/x/tx/signing/directaux/direct_aux.go @@ -2,6 +2,7 @@ package directaux import ( "context" + "errors" "fmt" "github.com/cosmos/cosmos-proto/anyutil" @@ -10,7 +11,6 @@ import ( signingv1beta1 "cosmossdk.io/api/cosmos/tx/signing/v1beta1" txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" - "cosmossdk.io/x/tx/signing" ) @@ -35,7 +35,7 @@ func NewSignModeHandler(options SignModeHandlerOptions) (SignModeHandler, error) h := SignModeHandler{} if options.SignersContext == nil { - return h, fmt.Errorf("signers context is required") + return h, errors.New("signers context is required") } h.signersContext = options.SignersContext @@ -61,7 +61,7 @@ func (h SignModeHandler) Mode() signingv1beta1.SignMode { // https://github.com/cosmos/cosmos-sdk/blob/4a6a1e3cb8de459891cb0495052589673d14ef51/x/auth/tx/builder.go#L142 func (h SignModeHandler) getFirstSigner(txData signing.TxData) ([]byte, error) { if len(txData.Body.Messages) == 0 { - return nil, fmt.Errorf("no signer found") + return nil, errors.New("no signer found") } msg, err := anyutil.Unpack(txData.Body.Messages[0], h.fileResolver, h.typeResolver) @@ -101,7 +101,8 @@ func (h SignModeHandler) GetSignBytes( ChainId: signerData.ChainID, AccountNumber: signerData.AccountNumber, Sequence: signerData.Sequence, - Tip: txData.AuthInfo.Tip, } - return proto.Marshal(signDocDirectAux) + + protov2MarshalOpts := proto.MarshalOptions{Deterministic: true} + return protov2MarshalOpts.Marshal(signDocDirectAux) } diff --git a/x/tx/signing/directaux/direct_aux_test.go b/x/tx/signing/directaux/direct_aux_test.go index 4fba90b7e1aa..00c48222aa89 100644 --- a/x/tx/signing/directaux/direct_aux_test.go +++ b/x/tx/signing/directaux/direct_aux_test.go @@ -6,7 +6,6 @@ import ( "fmt" "testing" - "cosmossdk.io/core/address" "github.com/cosmos/cosmos-proto/anyutil" "github.com/stretchr/testify/require" "google.golang.org/protobuf/proto" @@ -17,7 +16,7 @@ import ( "cosmossdk.io/api/cosmos/crypto/secp256k1" signingv1beta1 "cosmossdk.io/api/cosmos/tx/signing/v1beta1" txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" - + "cosmossdk.io/core/address" "cosmossdk.io/x/tx/signing" "cosmossdk.io/x/tx/signing/directaux" ) @@ -55,7 +54,6 @@ func TestDirectAuxHandler(t *testing.T) { GasLimit: 20000, Payer: feePayerAddr, } - tip := &txv1beta1.Tip{Amount: []*basev1beta1.Coin{{Denom: "tip-token", Amount: "10"}}} txBody := &txv1beta1.TxBody{ Messages: []*anypb.Any{msg}, @@ -64,7 +62,6 @@ func TestDirectAuxHandler(t *testing.T) { authInfo := &txv1beta1.AuthInfo{ Fee: fee, - Tip: tip, SignerInfos: signerInfo, } @@ -114,7 +111,6 @@ func TestDirectAuxHandler(t *testing.T) { } authInfoWithNoFeePayer := &txv1beta1.AuthInfo{ Fee: feeWithNoPayer, - Tip: tip, SignerInfos: signerInfo, } authInfoWithNoFeePayerBz, err := proto.Marshal(authInfoWithNoFeePayer) @@ -140,7 +136,6 @@ func TestDirectAuxHandler(t *testing.T) { ChainId: chainID, AccountNumber: accNum, Sequence: accSeq, - Tip: tip, } expectedSignBytes, err := proto.Marshal(signDocDirectAux) require.NoError(t, err) diff --git a/x/tx/signing/testutil/util.go b/x/tx/signing/testutil/util.go index ef689ec1e747..6d10e545e696 100644 --- a/x/tx/signing/testutil/util.go +++ b/x/tx/signing/testutil/util.go @@ -4,6 +4,7 @@ import ( "github.com/cosmos/cosmos-proto/anyutil" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/known/anypb" + "google.golang.org/protobuf/types/known/timestamppb" "cosmossdk.io/api/cosmos/crypto/secp256k1" signingv1beta1 "cosmossdk.io/api/cosmos/tx/signing/v1beta1" @@ -12,14 +13,15 @@ import ( ) type HandlerArgumentOptions struct { - ChainID string - Memo string - Msg proto.Message - AccNum uint64 - AccSeq uint64 - Tip *txv1beta1.Tip - Fee *txv1beta1.Fee - SignerAddress string + ChainID string + Memo string + Msg proto.Message + AccNum uint64 + AccSeq uint64 + Unordered bool + Timeouttimestamp *timestamppb.Timestamp + Fee *txv1beta1.Fee + SignerAddress string } func MakeHandlerArguments(options HandlerArgumentOptions) (signing.SignerData, signing.TxData, error) { @@ -51,21 +53,24 @@ func MakeHandlerArguments(options HandlerArgumentOptions) (signing.SignerData, s } txBody := &txv1beta1.TxBody{ - Messages: []*anypb.Any{anyMsg}, - Memo: options.Memo, + Messages: []*anypb.Any{anyMsg}, + Memo: options.Memo, + Unordered: options.Unordered, + TimeoutTimestamp: options.Timeouttimestamp, } authInfo := &txv1beta1.AuthInfo{ Fee: options.Fee, - Tip: options.Tip, SignerInfos: signerInfo, } - bodyBz, err := proto.Marshal(txBody) + protov2MarshalOpts := proto.MarshalOptions{Deterministic: true} + bodyBz, err := protov2MarshalOpts.Marshal(txBody) if err != nil { return signing.SignerData{}, signing.TxData{}, err } - authInfoBz, err := proto.Marshal(authInfo) + + authInfoBz, err := protov2MarshalOpts.Marshal(authInfo) if err != nil { return signing.SignerData{}, signing.TxData{}, err } diff --git a/x/tx/signing/textual/any.go b/x/tx/signing/textual/any.go index 7818fb27e4d1..3770969dc580 100644 --- a/x/tx/signing/textual/any.go +++ b/x/tx/signing/textual/any.go @@ -2,6 +2,7 @@ package textual import ( "context" + "errors" "fmt" "strings" @@ -74,7 +75,7 @@ func (ar anyValueRenderer) Format(ctx context.Context, v protoreflect.Value) ([] // Parse implements the ValueRenderer interface. func (ar anyValueRenderer) Parse(ctx context.Context, screens []Screen) (protoreflect.Value, error) { if len(screens) == 0 { - return nilValue, fmt.Errorf("expect at least one screen") + return nilValue, errors.New("expect at least one screen") } if screens[0].Indent != 0 { return nilValue, fmt.Errorf("bad indentation: want 0, got %d", screens[0].Indent) @@ -82,7 +83,7 @@ func (ar anyValueRenderer) Parse(ctx context.Context, screens []Screen) (protore typeURL := screens[0].Content msgType, err := ar.tr.typeResolver.FindMessageByURL(typeURL) - if err == protoregistry.NotFound { + if errors.Is(err, protoregistry.NotFound) { // If the proto v2 registry doesn't have this message, then we use // protoFiles (which can e.g. be initialized to gogo's MergedRegistry) // to retrieve the message descriptor, and then use dynamicpb on that diff --git a/x/tx/signing/textual/any_test.go b/x/tx/signing/textual/any_test.go index da64acf0df79..0bcce5988151 100644 --- a/x/tx/signing/textual/any_test.go +++ b/x/tx/signing/textual/any_test.go @@ -88,7 +88,6 @@ func TestDynamicpb(t *testing.T) { } for _, tc := range testcases { - tc := tc t.Run(tc.name, func(t *testing.T) { any, err := anyutil.New(tc.msg) require.NoError(t, err) diff --git a/x/tx/signing/textual/bool_test.go b/x/tx/signing/textual/bool_test.go index 07722375d6b4..ac1b41909e55 100644 --- a/x/tx/signing/textual/bool_test.go +++ b/x/tx/signing/textual/bool_test.go @@ -4,9 +4,10 @@ import ( "context" "testing" - "cosmossdk.io/x/tx/signing/textual" "github.com/stretchr/testify/require" "google.golang.org/protobuf/reflect/protoreflect" + + "cosmossdk.io/x/tx/signing/textual" ) func TestBool(t *testing.T) { diff --git a/x/tx/signing/textual/coin_test.go b/x/tx/signing/textual/coin_test.go index a9ed0295b459..07af1841f9b4 100644 --- a/x/tx/signing/textual/coin_test.go +++ b/x/tx/signing/textual/coin_test.go @@ -3,6 +3,7 @@ package textual_test import ( "context" "encoding/json" + "errors" "fmt" "os" "testing" @@ -12,7 +13,6 @@ import ( bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" - "cosmossdk.io/x/tx/signing/textual" ) @@ -56,7 +56,7 @@ func TestMetadataQuerier(t *testing.T) { require.Error(t, err) // Errors if metadata querier returns an error - expErr := fmt.Errorf("mock error") + expErr := errors.New("mock error") txt, err := textual.NewSignModeHandler(textual.SignModeOptions{ CoinMetadataQuerier: func(_ context.Context, _ string) (*bankv1beta1.Metadata, error) { return nil, expErr diff --git a/x/tx/signing/textual/coins.go b/x/tx/signing/textual/coins.go index 049b13421429..2bcd8230905d 100644 --- a/x/tx/signing/textual/coins.go +++ b/x/tx/signing/textual/coins.go @@ -2,14 +2,15 @@ package textual import ( "context" + "errors" "fmt" + "sort" "strings" "google.golang.org/protobuf/reflect/protoreflect" bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" - corecoins "cosmossdk.io/core/coins" "cosmossdk.io/math" ) @@ -32,7 +33,7 @@ var _ RepeatedValueRenderer = coinsValueRenderer{} func (vr coinsValueRenderer) Format(ctx context.Context, v protoreflect.Value) ([]Screen, error) { if vr.coinMetadataQuerier == nil { - return nil, fmt.Errorf("expected non-nil coin metadata querier") + return nil, errors.New("expected non-nil coin metadata querier") } // Since this value renderer has a FormatRepeated method, the Format one @@ -48,7 +49,7 @@ func (vr coinsValueRenderer) Format(ctx context.Context, v protoreflect.Value) ( return nil, err } - formatted, err := corecoins.FormatCoins([]*basev1beta1.Coin{coin}, []*bankv1beta1.Metadata{metadata}) + formatted, err := FormatCoins([]*basev1beta1.Coin{coin}, []*bankv1beta1.Metadata{metadata}) if err != nil { return nil, err } @@ -58,7 +59,7 @@ func (vr coinsValueRenderer) Format(ctx context.Context, v protoreflect.Value) ( func (vr coinsValueRenderer) FormatRepeated(ctx context.Context, v protoreflect.Value) ([]Screen, error) { if vr.coinMetadataQuerier == nil { - return nil, fmt.Errorf("expected non-nil coin metadata querier") + return nil, errors.New("expected non-nil coin metadata querier") } protoCoins := v.List() @@ -76,7 +77,7 @@ func (vr coinsValueRenderer) FormatRepeated(ctx context.Context, v protoreflect. } } - formatted, err := corecoins.FormatCoins(coins, metadatas) + formatted, err := FormatCoins(coins, metadatas) if err != nil { return nil, err } @@ -217,3 +218,92 @@ func parseCoin(coinStr string, metadata *bankv1beta1.Metadata) (*basev1beta1.Coi Denom: baseDenom, }, nil } + +// formatCoin formats a sdk.Coin into a value-rendered string, using the +// given metadata about the denom. It returns the formatted coin string, the +// display denom, and an optional error. +func formatCoin(coin *basev1beta1.Coin, metadata *bankv1beta1.Metadata) (string, error) { + coinDenom := coin.Denom + + // Return early if no display denom or display denom is the current coin denom. + if metadata == nil || metadata.Display == "" || coinDenom == metadata.Display { + vr, err := math.FormatDec(coin.Amount) + return vr + " " + coin.Denom, err + } + + dispDenom := metadata.Display + + // Find exponents of both denoms. + var coinExp, dispExp uint32 + foundCoinExp, foundDispExp := false, false + for _, unit := range metadata.DenomUnits { + if coinDenom == unit.Denom { + coinExp = unit.Exponent + foundCoinExp = true + } + if dispDenom == unit.Denom { + dispExp = unit.Exponent + foundDispExp = true + } + } + + // If we didn't find either exponent, then we return early. + if !foundCoinExp || !foundDispExp { + vr, err := math.FormatInt(coin.Amount) + return vr + " " + coin.Denom, err + } + + dispAmount, err := math.LegacyNewDecFromStr(coin.Amount) + if err != nil { + return "", err + } + + if coinExp > dispExp { + dispAmount = dispAmount.Mul(math.LegacyNewDec(10).Power(uint64(coinExp - dispExp))) + } else { + dispAmount = dispAmount.Quo(math.LegacyNewDec(10).Power(uint64(dispExp - coinExp))) + } + + vr, err := math.FormatDec(dispAmount.String()) + return vr + " " + dispDenom, err +} + +// FormatCoins formats Coins into a value-rendered string, which uses +// `formatCoin` separated by ", " (a comma and a space), and sorted +// alphabetically by value-rendered denoms. It expects an array of metadata +// (optionally nil), where each metadata at index `i` MUST match the coin denom +// at the same index. +func FormatCoins(coins []*basev1beta1.Coin, metadata []*bankv1beta1.Metadata) (string, error) { + if len(coins) != len(metadata) { + return "", fmt.Errorf("formatCoins expect one metadata for each coin; expected %d, got %d", len(coins), len(metadata)) + } + + formatted := make([]string, len(coins)) + for i, coin := range coins { + var err error + formatted[i], err = formatCoin(coin, metadata[i]) + if err != nil { + return "", err + } + + // If a coin contains a comma, return an error given that the output + // could be misinterpreted by the user as 2 different coins. + if strings.Contains(formatted[i], ",") { + return "", fmt.Errorf("coin %s contains a comma", formatted[i]) + } + } + + if len(coins) == 0 { + return emptyCoins, nil + } + + // Sort the formatted coins by display denom. + sort.SliceStable(formatted, func(i, j int) bool { + denomI := strings.Split(formatted[i], " ")[1] + denomJ := strings.Split(formatted[j], " ")[1] + + return denomI < denomJ + }) + + return strings.Join(formatted, ", "), nil +} diff --git a/x/tx/signing/textual/coins_test.go b/x/tx/signing/textual/coins_test.go index e7bd921e10da..c9e1bbf6dd7a 100644 --- a/x/tx/signing/textual/coins_test.go +++ b/x/tx/signing/textual/coins_test.go @@ -6,12 +6,12 @@ import ( "os" "testing" - bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" - basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" - "cosmossdk.io/math" "github.com/stretchr/testify/require" "google.golang.org/protobuf/reflect/protoreflect" + bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" + basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + "cosmossdk.io/math" "cosmossdk.io/x/tx/signing/textual" ) @@ -66,12 +66,13 @@ func TestCoinsJSONTestcases(t *testing.T) { // rendering, so we lose initial Coins ordering. Instead, we just check // set equality using a map. func checkCoinsEqual(t *testing.T, l1, l2 protoreflect.List) { + t.Helper() require.Equal(t, l1.Len(), l2.Len()) coinsMap := make(map[string]*basev1beta1.Coin, l1.Len()) for i := 0; i < l1.Len(); i++ { coin, ok := l1.Get(i).Message().Interface().(*basev1beta1.Coin) - require.True(t, ok) + require.True(t, ok, "not a *basev1beta1.Coin: %#v", l1.Get(i).Message().Interface()) coinsMap[coin.Denom] = coin } @@ -85,12 +86,13 @@ func checkCoinsEqual(t *testing.T, l1, l2 protoreflect.List) { } func checkCoinEqual(t *testing.T, coin, coin1 *basev1beta1.Coin) { + t.Helper() require.Equal(t, coin1.Denom, coin.Denom) v, ok := math.NewIntFromString(coin.Amount) require.True(t, ok) v1, ok := math.NewIntFromString(coin1.Amount) require.True(t, ok) - require.True(t, v.Equal(v1)) + require.True(t, v.Equal(v1), "Mismatch\n\tv: %+v\n\tv1: %+v", v, v1) } // coinsJSONTest is the type of test cases in the testdata file. @@ -104,3 +106,64 @@ type coinsJSONTest struct { Text string Error bool } + +// formatCoinJSONTest is the type of test cases in the coin.json file. +type formatCoinJSONTest struct { + Proto *basev1beta1.Coin + Metadata *bankv1beta1.Metadata + Text string + Error bool +} + +func TestFormatCoin(t *testing.T) { + var testcases []formatCoinJSONTest + raw, err := os.ReadFile("./internal/testdata/coin.json") + require.NoError(t, err) + err = json.Unmarshal(raw, &testcases) + require.NoError(t, err) + + for _, tc := range testcases { + t.Run(tc.Text, func(t *testing.T) { + if tc.Proto != nil { + out, err := textual.FormatCoins([]*basev1beta1.Coin{tc.Proto}, []*bankv1beta1.Metadata{tc.Metadata}) + + if tc.Error { + require.Error(t, err) + return + } + + require.NoError(t, err) + require.Equal(t, tc.Text, out) + } + }) + } +} + +func TestFormatCoins(t *testing.T) { + var testcases []coinsJSONTest + raw, err := os.ReadFile("./internal/testdata/coins.json") + require.NoError(t, err) + err = json.Unmarshal(raw, &testcases) + require.NoError(t, err) + + for _, tc := range testcases { + t.Run(tc.Text, func(t *testing.T) { + if tc.Proto != nil { + metadata := make([]*bankv1beta1.Metadata, len(tc.Proto)) + for i, coin := range tc.Proto { + metadata[i] = tc.Metadata[coin.Denom] + } + + out, err := textual.FormatCoins(tc.Proto, metadata) + + if tc.Error { + require.Error(t, err) + return + } + + require.NoError(t, err) + require.Equal(t, tc.Text, out) + } + }) + } +} diff --git a/x/tx/signing/textual/dec_test.go b/x/tx/signing/textual/dec_test.go index defb6d9cc509..152e2b71619e 100644 --- a/x/tx/signing/textual/dec_test.go +++ b/x/tx/signing/textual/dec_test.go @@ -27,7 +27,6 @@ func TestDecJSONTestcases(t *testing.T) { require.NoError(t, err) for _, tc := range testcases { - tc := tc t.Run(tc[0], func(t *testing.T) { r, err := textual.GetFieldValueRenderer(fieldDescriptorFromName("SDKDEC")) require.NoError(t, err) @@ -38,6 +37,7 @@ func TestDecJSONTestcases(t *testing.T) { } func checkDecTest(t *testing.T, r textual.ValueRenderer, pv protoreflect.Value, expected string) { + t.Helper() screens, err := r.Format(context.Background(), pv) require.NoError(t, err) require.Len(t, screens, 1) diff --git a/x/tx/signing/textual/duration_test.go b/x/tx/signing/textual/duration_test.go index baf015e5e300..da222bb1d42b 100644 --- a/x/tx/signing/textual/duration_test.go +++ b/x/tx/signing/textual/duration_test.go @@ -7,11 +7,11 @@ import ( "os" "testing" - "cosmossdk.io/x/tx/signing/textual" "github.com/stretchr/testify/require" - "google.golang.org/protobuf/reflect/protoreflect" dpb "google.golang.org/protobuf/types/known/durationpb" + + "cosmossdk.io/x/tx/signing/textual" ) type durationTest struct { diff --git a/x/tx/signing/textual/e2e_test.go b/x/tx/signing/textual/e2e_test.go index d6e8e26b4d24..e759d403f446 100644 --- a/x/tx/signing/textual/e2e_test.go +++ b/x/tx/signing/textual/e2e_test.go @@ -16,7 +16,6 @@ import ( _ "cosmossdk.io/api/cosmos/crypto/multisig" _ "cosmossdk.io/api/cosmos/crypto/secp256k1" _ "cosmossdk.io/api/cosmos/gov/v1" - "cosmossdk.io/x/tx/signing" "cosmossdk.io/x/tx/signing/textual" "cosmossdk.io/x/tx/signing/textual/internal/textualpb" @@ -72,6 +71,10 @@ func TestE2EJSONTestcases(t *testing.T) { AuthInfoBytes: authInfoBz, }) require.NoError(t, err) + decodeWant, err := hex.DecodeString(tc.Cbor) + require.NoError(t, err) + t.Log("got: " + string(signDoc)) + t.Log("want " + string(decodeWant)) require.Equal(t, tc.Cbor, hex.EncodeToString(signDoc)) }) } diff --git a/x/tx/signing/textual/fuzz_test.go b/x/tx/signing/textual/fuzz_test.go index 81e2fbb867b4..bdbf1be24397 100644 --- a/x/tx/signing/textual/fuzz_test.go +++ b/x/tx/signing/textual/fuzz_test.go @@ -1,14 +1,20 @@ package textual_test import ( + "bytes" "context" "encoding/json" "os" + "regexp" "testing" + "github.com/google/go-cmp/cmp" "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/testing/protocmp" tspb "google.golang.org/protobuf/types/known/timestamppb" + basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + "cosmossdk.io/x/tx/internal/testpb" "cosmossdk.io/x/tx/signing/textual" ) @@ -101,3 +107,195 @@ func FuzzTimestampJSONParseToParseRoundTrip(f *testing.F) { } }) } + +func FuzzBytesValueRendererParse(f *testing.F) { + // 1. Generate some seeds from testdata. + seed, err := os.ReadFile("./internal/testdata/bytes.json") + if err != nil { + f.Fatal(err) + } + f.Add(seed) + + tr, err := textual.NewSignModeHandler(textual.SignModeOptions{CoinMetadataQuerier: EmptyCoinMetadataQuerier}) + if err != nil { + f.Fatal(err) + } + + ctx := context.Background() + + f.Fuzz(func(t *testing.T, input []byte) { + var testCases []bytesTest + if err := json.Unmarshal(input, &testCases); err != nil { + return + } + + for _, tc := range testCases { + rend, err := tr.GetFieldValueRenderer(fieldDescriptorFromName("BYTES")) + if err != nil { + t.Fatal(err) + } + + screens, err := rend.Format(ctx, protoreflect.ValueOfBytes(tc.base64)) + if err != nil { + t.Fatal(err) + } + if g, w := len(screens), 1; g != w { + t.Fatalf("Mismatch screen count: got=%d, want=%d", g, w) + } + + // Round trip and test. + val, err := rend.Parse(ctx, screens) + if err != nil { + t.Fatal(err) + } + if g, w := len(tc.base64), 35; g > w { + if len(val.Bytes()) != 0 { + t.Fatalf("val.Bytes() != 0:\n\tGot: % x", val.Bytes()) + } + } else if !bytes.Equal(tc.base64, val.Bytes()) { + t.Fatalf("val.Bytes() mismatch:\n\tGot: % x\n\tWant: % x", val.Bytes(), tc.base64) + } + } + }) +} + +func FuzzMessageValueRendererParse(f *testing.F) { + if testing.Short() { + f.Skip() + } + + // 1. Use the seeds from testdata and mutate them. + seed, err := os.ReadFile("./internal/testdata/message.json") + if err != nil { + f.Fatal(err) + } + f.Add(seed) + + ctx := context.Background() + tr, err := textual.NewSignModeHandler(textual.SignModeOptions{CoinMetadataQuerier: EmptyCoinMetadataQuerier}) + if err != nil { + f.Fatalf("Failed to create SignModeHandler: %v", err) + } + + f.Fuzz(func(t *testing.T, input []byte) { + var testCases []messageJSONTest + if err := json.Unmarshal(input, &testCases); err != nil { + return + } + + for _, tc := range testCases { + rend := textual.NewMessageValueRenderer(tr, (&testpb.Foo{}).ProtoReflect().Descriptor()) + + var screens []textual.Screen + var err error + + if tc.Proto != nil { + screens, err = rend.Format(ctx, protoreflect.ValueOf(tc.Proto.ProtoReflect())) + if err != nil { + continue + } + } + + val, err := rend.Parse(ctx, screens) + if err != nil { + continue + } + + msg := val.Message().Interface() + gotMsg, ok := msg.(*testpb.Foo) + if !ok { + t.Fatalf("Wrong type for Foo: %T", msg) + } + diff := cmp.Diff(gotMsg, tc.Proto, protocmp.Transform()) + if diff != "" { + t.Fatalf("Roundtrip mismatch\n\tGot: %#v\n\tWant: %#v", gotMsg, tc.Proto) + } + } + }) +} + +// Copied from types/coin.go but pasted in here so as to avoid any imports +// of that package as has been mandated by team decisions. +var ( + reCoinDenom = regexp.MustCompile(`[a-zA-Z][a-zA-Z0-9/:._-]{2,127}`) + reCoinAmount = regexp.MustCompile(`[[:digit:]]+(?:\.[[:digit:]]+)?|\.[[:digit:]]+`) +) + +func FuzzCoinsJSONTestcases(f *testing.F) { + f.Skip() // https://github.com/cosmos/cosmos-sdk/pull/16521#issuecomment-1614507574 + + // Generate some seeds. + seed, err := os.ReadFile("./internal/testdata/coins.json") + if err != nil { + f.Fatal(err) + } + f.Add(seed) + + txt, err := textual.NewSignModeHandler(textual.SignModeOptions{CoinMetadataQuerier: mockCoinMetadataQuerier}) + if err != nil { + f.Fatal(err) + } + rend, err := txt.GetFieldValueRenderer(fieldDescriptorFromName("COINS")) + if err != nil { + f.Fatal(err) + } + vrr := rend.(textual.RepeatedValueRenderer) + + f.Fuzz(func(t *testing.T, input []byte) { + var testCases []coinsJSONTest + if err := json.Unmarshal(input, &testCases); err != nil { + return + } + + for _, tc := range testCases { + if tc.Proto == nil { + continue + } + + // Create a context.Context containing all coins metadata, to simulate + // that they are in state. + ctx := context.Background() + for _, v := range tc.Metadata { + ctx = addMetadataToContext(ctx, v) + } + + listValue := NewGenericList(tc.Proto) + screens, err := vrr.FormatRepeated(ctx, protoreflect.ValueOf(listValue)) + if err != nil { + cpt := tc.Proto[0] + likeEmpty := err.Error() == "cannot format empty string" || err.Error() == "decimal string cannot be empty" + if likeEmpty && (!reCoinDenom.MatchString(cpt.Denom) || cpt.Amount == "") { + return + } + if !reCoinDenom.MatchString(cpt.Denom) { + return + } + if !reCoinAmount.MatchString(cpt.Amount) { + return + } + t.Fatalf("%v\n%q\n%#v => %t", err, tc.Text, cpt, cpt.Amount == "") + } + + if g, w := len(screens), 1; g != w { + t.Fatalf("Screens mismatch: got=%d want=%d", g, w) + } + + wantContent := tc.Text + if wantContent == "" { + wantContent = "zero" + } + if false { + if g, w := screens[0].Content, wantContent; g != w { + t.Fatalf("Content mismatch:\n\tGot: %s\n\tWant: %s", g, w) + } + } + + // Round trip. + parsedValue := NewGenericList([]*basev1beta1.Coin{}) + if err := vrr.ParseRepeated(ctx, screens, parsedValue); err != nil { + return + } + checkCoinsEqual(t, listValue, parsedValue) + } + }) +} diff --git a/x/tx/signing/textual/handler.go b/x/tx/signing/textual/handler.go index 97b6e3a752df..e31981b9286e 100644 --- a/x/tx/signing/textual/handler.go +++ b/x/tx/signing/textual/handler.go @@ -3,9 +3,12 @@ package textual import ( "bytes" "context" + "errors" "fmt" "reflect" + cosmos_proto "github.com/cosmos/cosmos-proto" + gogoproto "github.com/cosmos/gogoproto/proto" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" @@ -13,13 +16,9 @@ import ( "google.golang.org/protobuf/types/known/durationpb" "google.golang.org/protobuf/types/known/timestamppb" - signingv1beta1 "cosmossdk.io/api/cosmos/tx/signing/v1beta1" - - cosmos_proto "github.com/cosmos/cosmos-proto" - bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" - + signingv1beta1 "cosmossdk.io/api/cosmos/tx/signing/v1beta1" "cosmossdk.io/x/tx/signing" "cosmossdk.io/x/tx/signing/textual/internal/textualpb" ) @@ -70,10 +69,10 @@ type SignModeHandler struct { // NewSignModeHandler returns a new SignModeHandler which generates sign bytes and provides value renderers. func NewSignModeHandler(o SignModeOptions) (*SignModeHandler, error) { if o.CoinMetadataQuerier == nil { - return nil, fmt.Errorf("coinMetadataQuerier must be non-empty") + return nil, errors.New("coinMetadataQuerier must be non-empty") } if o.FileResolver == nil { - o.FileResolver = protoregistry.GlobalFiles + o.FileResolver = gogoproto.HybridResolver } if o.TypeResolver == nil { o.TypeResolver = protoregistry.GlobalTypes @@ -98,7 +97,7 @@ func (r *SignModeHandler) SpecVersion() uint64 { // GetFieldValueRenderer returns the value renderer for the given FieldDescriptor. func (r *SignModeHandler) GetFieldValueRenderer(fd protoreflect.FieldDescriptor) (ValueRenderer, error) { switch { - // Scalars, such as sdk.Int and sdk.Dec encoded as strings. + // Scalars, such as math.Int and math.Dec encoded as strings. case fd.Kind() == protoreflect.StringKind: if proto.GetExtension(fd.Options(), cosmos_proto.E_Scalar) != "" { scalar, ok := proto.GetExtension(fd.Options(), cosmos_proto.E_Scalar).(string) @@ -137,7 +136,7 @@ func (r *SignModeHandler) GetFieldValueRenderer(fd protoreflect.FieldDescriptor) } if fd.IsMap() { - return nil, fmt.Errorf("value renderers cannot format value of type map") + return nil, errors.New("value renderers cannot format value of type map") } return NewMessageValueRenderer(r, md), nil case fd.Kind() == protoreflect.BoolKind: diff --git a/x/tx/signing/textual/handler_test.go b/x/tx/signing/textual/handler_test.go index 70c2ea124a9f..13e15b981845 100644 --- a/x/tx/signing/textual/handler_test.go +++ b/x/tx/signing/textual/handler_test.go @@ -32,7 +32,6 @@ func TestDispatcher(t *testing.T) { } for _, tc := range testcases { - tc := tc t.Run(tc.name, func(t *testing.T) { textual, err := textual.NewSignModeHandler(textual.SignModeOptions{CoinMetadataQuerier: EmptyCoinMetadataQuerier}) require.NoError(t, err) diff --git a/x/tx/signing/textual/int.go b/x/tx/signing/textual/int.go index 2433ace07222..4dbe8bb8ddc3 100644 --- a/x/tx/signing/textual/int.go +++ b/x/tx/signing/textual/int.go @@ -7,12 +7,13 @@ import ( "strconv" "strings" - "cosmossdk.io/math" "google.golang.org/protobuf/reflect/protoreflect" + + "cosmossdk.io/math" ) // NewIntValueRenderer returns a ValueRenderer for uint32, uint64, int32 and -// int64, and sdk.Int scalars. +// int64, and math.Int scalars. func NewIntValueRenderer(fd protoreflect.FieldDescriptor) ValueRenderer { return intValueRenderer{fd} } diff --git a/x/tx/signing/textual/int_test.go b/x/tx/signing/textual/int_test.go index efab44f686d9..100ec3097157 100644 --- a/x/tx/signing/textual/int_test.go +++ b/x/tx/signing/textual/int_test.go @@ -11,7 +11,6 @@ import ( "google.golang.org/protobuf/reflect/protoreflect" "cosmossdk.io/math" - "cosmossdk.io/x/tx/signing/textual" ) @@ -64,7 +63,7 @@ func TestIntJSONTestcases(t *testing.T) { checkNumberTest(t, r, protoreflect.ValueOf(ii), tc[1]) } - // Parse test case strings as sdk.Ints + // Parse test case strings as math.Ints _, ok := math.NewIntFromString(tc[0]) if ok { r, err := textual.GetFieldValueRenderer(fieldDescriptorFromName("SDKINT")) @@ -79,6 +78,7 @@ func TestIntJSONTestcases(t *testing.T) { // checkNumberTest checks that the output of a number value renderer // matches the expected string. Only use it to test numbers. func checkNumberTest(t *testing.T, r textual.ValueRenderer, pv protoreflect.Value, expected string) { + t.Helper() screens, err := r.Format(context.Background(), pv) require.NoError(t, err) require.Len(t, screens, 1) diff --git a/x/tx/signing/textual/internal/cbor/cbor_test.go b/x/tx/signing/textual/internal/cbor/cbor_test.go index 32dae488130c..e94ae8f704e4 100644 --- a/x/tx/signing/textual/internal/cbor/cbor_test.go +++ b/x/tx/signing/textual/internal/cbor/cbor_test.go @@ -6,8 +6,9 @@ import ( "fmt" "testing" - "cosmossdk.io/x/tx/signing/textual/internal/cbor" "github.com/stretchr/testify/require" + + "cosmossdk.io/x/tx/signing/textual/internal/cbor" ) var ( diff --git a/x/tx/signing/textual/internal/testdata/coin.json b/x/tx/signing/textual/internal/testdata/coin.json index 1a1ac79b9306..02231d2d712e 100644 --- a/x/tx/signing/textual/internal/testdata/coin.json +++ b/x/tx/signing/textual/internal/testdata/coin.json @@ -327,5 +327,10 @@ {"text":"", "error": true}, {"text":"1COSM", "error": true}, {"text":"1 COSM", "error": true}, - {"text":" 1 COSM", "error": true} + {"text":" 1 COSM", "error": true}, + { + "proto": {"amount": "10000000", "denom": "point, 222222 point"}, + "metadata": {"display": "POINT", "base": "point", "denom_units": [{"denom": "point", "exponent": 0}, {"denom": "POINT", "exponent": 0}]}, + "error": true + } ] diff --git a/x/tx/signing/textual/internal/testdata/e2e.json b/x/tx/signing/textual/internal/testdata/e2e.json index 49f5c6effdb3..2ab0e30f5b96 100644 --- a/x/tx/signing/textual/internal/testdata/e2e.json +++ b/x/tx/signing/textual/internal/testdata/e2e.json @@ -286,13 +286,6 @@ "gas_limit": 100000, "payer": "cosmos1ejrf4cur2wy6kfurg9f2jppp2h3afe5h6pkh5t", "granter": "cosmos1ulav3hsenupswqfkw2y3sup5kgtqwnvqa8eyhs" - }, - "tip": { - "amount": [ - { "amount": "20000", "denom": "uatom" }, - { "amount": "30000", "denom": "uosmo" } - ], - "tipper": "cosmos1ejrf4cur2wy6kfurg9f2jppp2h3afe5h6pkh5t" } } }, @@ -344,8 +337,6 @@ { "title": "Fees", "content": "0.002 ATOM" }, { "title": "Fee payer", "content": "cosmos1ejrf4cur2wy6kfurg9f2jppp2h3afe5h6pkh5t", "expert": true }, { "title": "Fee granter", "content": "cosmos1ulav3hsenupswqfkw2y3sup5kgtqwnvqa8eyhs", "expert": true }, - { "title": "Tip", "content": "0.02 ATOM, 30'000 uosmo" }, - { "title": "Tipper", "content": "cosmos1ejrf4cur2wy6kfurg9f2jppp2h3afe5h6pkh5t" }, { "title": "Gas limit", "content": "100'000", "expert": true }, { "title": "Timeout height", "content": "20", "expert": true }, { "title": "Other signer", "content": "1 SignerInfo", "expert": true }, @@ -381,8 +372,8 @@ { "title": "Non critical extension options (1/1)", "content": "/cosmos.auth.v1beta1.Params", "indent": 1, "expert": true }, { "title": "Max memo characters", "content": "10", "indent": 2, "expert": true }, { "content": "End of Non critical extension options", "expert": true }, - { "title": "Hash of raw bytes", "content": "7ea02e8f0baed2db969e2d9ae4dc51fa31116259bd42897588072faf0ebb4d2e", "expert": true } + { "title": "Hash of raw bytes", "content": "e7be7808de4985bd609811d2a32805cb233c168c7d247d61d37f4a6dd4cf3a2a", "expert": true } ], - "cbor": "a101983fa20168436861696e20696402686d792d636861696ea2016e4163636f756e74206e756d626572026131a2016853657175656e6365026132a301674164647265737302782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e767161386579687304f5a3016a5075626c6963206b657902781f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657904f5a401634b657902785230324542204444374620453446442045423736204443384120323035452046363544203739304320443330452038413337203541354320323532382045423341203932334120463146422034443739203444030104f5a102781f54686973207472616e73616374696f6e206861732032204d65737361676573a3016d4d6573736167652028312f322902781d2f636f736d6f732e617574687a2e763162657461312e4d7367457865630301a301674772616e74656502782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e76716138657968730302a301644d73677302653120416e790302a3016a4d7367732028312f312902781c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e640303a3016c46726f6d206164647265737302782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e76716138657968730304a3016a546f206164647265737302782d636f736d6f7331656a726634637572327779366b667572673966326a707070326833616665356836706b6835740304a30166416d6f756e74026731302041544f4d0304a2026b456e64206f66204d7367730302a3016d4d6573736167652028322f322902762f636f736d6f732e676f762e76312e4d7367566f74650301a3016b50726f706f73616c2069640261310302a30165566f74657202782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e76716138657968730302a301664f7074696f6e026f564f54455f4f5054494f4e5f5945530302a301684d65746164617461027901e34c6f72656d20697073756d20646f6c6f722073697420616d65742c20636f6e73656374657475722061646970697363696e6720656c69742c2073656420646f20656975736d6f642074656d706f7220696e6369646964756e74207574206c61626f726520657420646f6c6f7265206d61676e6120616c697175612e20557420656e696d206164206d696e696d2076656e69616d2c2071756973206e6f737472756420657865726369746174696f6e20756c6c616d636f206c61626f726973206e69736920757420616c697175697020657820656120636f6d6d6f646f20636f6e7365717561742e2044756973206175746520697275726520646f6c6f7220696e20726570726568656e646572697420696e20766f6c7570746174652076656c697420657373652063696c6c756d20646f6c6f726520657520667567696174206e756c6c612070617269617475722e204578636570746575722073696e74206f6363616563617420637570696461746174206e6f6e2070726f6964656e742c2073756e7420696e2063756c706120717569206f666669636961206465736572756e74206d6f6c6c697420616e696d20696420657374206c61626f72756d2e20416c736f20697420656e647320696e2020612073696e676c6520616d70657273616e6420400302a1026e456e64206f66204d657373616765a201644d656d6f0278193e20e29a9befb88f5c7532363942e29a9befb88f2020202020a2016446656573026a302e3030322041544f4da3016946656520706179657202782d636f736d6f7331656a726634637572327779366b667572673966326a707070326833616665356836706b68357404f5a3016b466565206772616e74657202782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e767161386579687304f5a201635469700277302e30322041544f4d2c2033302730303020756f736d6fa2016654697070657202782d636f736d6f7331656a726634637572327779366b667572673966326a707070326833616665356836706b683574a30169476173206c696d697402673130302730303004f5a3016e54696d656f7574206865696768740262323004f5a3016c4f74686572207369676e6572026c31205369676e6572496e666f04f5a401724f74686572207369676e65722028312f312902715369676e6572496e666f206f626a656374030104f5a4016a5075626c6963206b65790278292f636f736d6f732e63727970746f2e6d756c74697369672e4c6567616379416d696e6f5075624b6579030204f5a401695468726573686f6c64026132030304f5a4016b5075626c6963206b65797302653220416e79030304f5a401715075626c6963206b6579732028312f322902781f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b6579030404f5a401634b657902785230323537203445424520304246432037353446203539363720334241312031423237203530304620393135382041444532204531374520314130312038324230204341384220433635322034444230203933030504f5a401715075626c6963206b6579732028322f322902781d2f636f736d6f732e63727970746f2e656432353531392e5075624b6579030404f5a401634b657902785230333135203043343720463138412041333237203136413620353437452044413842203733363920303637442043453131204431343120363234352042373738203735364320463833352039363738203737030504f5a30272456e64206f66205075626c6963206b657973030304f5a401694d6f646520696e666f026f4d6f6465496e666f206f626a656374030204f5a401654d756c7469026c4d756c7469206f626a656374030304f5a4016842697461727261790276436f6d706163744269744172726179206f626a656374030404f5a40171457874726120626974732073746f726564026135030504f5a40165456c656d7302623438030504f5a4016a4d6f646520696e666f73026a32204d6f6465496e666f030404f5a401704d6f646520696e666f732028312f3229026f4d6f6465496e666f206f626a656374030504f5a4016653696e676c65026d53696e676c65206f626a656374030604f5a401644d6f646502781b5349474e5f4d4f44455f4c45474143595f414d494e4f5f4a534f4e030704f5a401704d6f646520696e666f732028322f3229026f4d6f6465496e666f206f626a656374030504f5a4016653696e676c65026d53696e676c65206f626a656374030604f5a401644d6f646502781b5349474e5f4d4f44455f4c45474143595f414d494e4f5f4a534f4e030704f5a30271456e64206f66204d6f646520696e666f73030404f5a4016853657175656e6365026135030204f5a20273456e64206f66204f74686572207369676e657204f5a30171457874656e73696f6e206f7074696f6e7302653120416e7904f5a40177457874656e73696f6e206f7074696f6e732028312f31290278192f636f736d6f732e626173652e763162657461312e436f696e030104f5a30266352041544f4d030204f5a2027818456e64206f6620457874656e73696f6e206f7074696f6e7304f5a301781e4e6f6e20637269746963616c20657874656e73696f6e206f7074696f6e7302653120416e7904f5a40178244e6f6e20637269746963616c20657874656e73696f6e206f7074696f6e732028312f312902781b2f636f736d6f732e617574682e763162657461312e506172616d73030104f5a401734d6178206d656d6f206368617261637465727302623130030204f5a2027825456e64206f66204e6f6e20637269746963616c20657874656e73696f6e206f7074696f6e7304f5a3017148617368206f66207261772062797465730278403765613032653866306261656432646239363965326439616534646335316661333131313632353962643432383937353838303732666166306562623464326504f5" + "cbor": "a101983da20168436861696e20696402686d792d636861696ea2016e4163636f756e74206e756d626572026131a2016853657175656e6365026132a301674164647265737302782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e767161386579687304f5a3016a5075626c6963206b657902781f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657904f5a401634b657902785230324542204444374620453446442045423736204443384120323035452046363544203739304320443330452038413337203541354320323532382045423341203932334120463146422034443739203444030104f5a102781f54686973207472616e73616374696f6e206861732032204d65737361676573a3016d4d6573736167652028312f322902781d2f636f736d6f732e617574687a2e763162657461312e4d7367457865630301a301674772616e74656502782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e76716138657968730302a301644d73677302653120416e790302a3016a4d7367732028312f312902781c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e640303a3016c46726f6d206164647265737302782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e76716138657968730304a3016a546f206164647265737302782d636f736d6f7331656a726634637572327779366b667572673966326a707070326833616665356836706b6835740304a30166416d6f756e74026731302041544f4d0304a2026b456e64206f66204d7367730302a3016d4d6573736167652028322f322902762f636f736d6f732e676f762e76312e4d7367566f74650301a3016b50726f706f73616c2069640261310302a30165566f74657202782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e76716138657968730302a301664f7074696f6e026f564f54455f4f5054494f4e5f5945530302a301684d65746164617461027901e34c6f72656d20697073756d20646f6c6f722073697420616d65742c20636f6e73656374657475722061646970697363696e6720656c69742c2073656420646f20656975736d6f642074656d706f7220696e6369646964756e74207574206c61626f726520657420646f6c6f7265206d61676e6120616c697175612e20557420656e696d206164206d696e696d2076656e69616d2c2071756973206e6f737472756420657865726369746174696f6e20756c6c616d636f206c61626f726973206e69736920757420616c697175697020657820656120636f6d6d6f646f20636f6e7365717561742e2044756973206175746520697275726520646f6c6f7220696e20726570726568656e646572697420696e20766f6c7570746174652076656c697420657373652063696c6c756d20646f6c6f726520657520667567696174206e756c6c612070617269617475722e204578636570746575722073696e74206f6363616563617420637570696461746174206e6f6e2070726f6964656e742c2073756e7420696e2063756c706120717569206f666669636961206465736572756e74206d6f6c6c697420616e696d20696420657374206c61626f72756d2e20416c736f20697420656e647320696e2020612073696e676c6520616d70657273616e6420400302a1026e456e64206f66204d657373616765a201644d656d6f0278193e20e29a9befb88f5c7532363942e29a9befb88f2020202020a2016446656573026a302e3030322041544f4da3016946656520706179657202782d636f736d6f7331656a726634637572327779366b667572673966326a707070326833616665356836706b68357404f5a3016b466565206772616e74657202782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e767161386579687304f5a30169476173206c696d697402673130302730303004f5a3016e54696d656f7574206865696768740262323004f5a3016c4f74686572207369676e6572026c31205369676e6572496e666f04f5a401724f74686572207369676e65722028312f312902715369676e6572496e666f206f626a656374030104f5a4016a5075626c6963206b65790278292f636f736d6f732e63727970746f2e6d756c74697369672e4c6567616379416d696e6f5075624b6579030204f5a401695468726573686f6c64026132030304f5a4016b5075626c6963206b65797302653220416e79030304f5a401715075626c6963206b6579732028312f322902781f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b6579030404f5a401634b657902785230323537203445424520304246432037353446203539363720334241312031423237203530304620393135382041444532204531374520314130312038324230204341384220433635322034444230203933030504f5a401715075626c6963206b6579732028322f322902781d2f636f736d6f732e63727970746f2e656432353531392e5075624b6579030404f5a401634b657902785230333135203043343720463138412041333237203136413620353437452044413842203733363920303637442043453131204431343120363234352042373738203735364320463833352039363738203737030504f5a30272456e64206f66205075626c6963206b657973030304f5a401694d6f646520696e666f026f4d6f6465496e666f206f626a656374030204f5a401654d756c7469026c4d756c7469206f626a656374030304f5a4016842697461727261790276436f6d706163744269744172726179206f626a656374030404f5a40171457874726120626974732073746f726564026135030504f5a40165456c656d7302623438030504f5a4016a4d6f646520696e666f73026a32204d6f6465496e666f030404f5a401704d6f646520696e666f732028312f3229026f4d6f6465496e666f206f626a656374030504f5a4016653696e676c65026d53696e676c65206f626a656374030604f5a401644d6f646502781b5349474e5f4d4f44455f4c45474143595f414d494e4f5f4a534f4e030704f5a401704d6f646520696e666f732028322f3229026f4d6f6465496e666f206f626a656374030504f5a4016653696e676c65026d53696e676c65206f626a656374030604f5a401644d6f646502781b5349474e5f4d4f44455f4c45474143595f414d494e4f5f4a534f4e030704f5a30271456e64206f66204d6f646520696e666f73030404f5a4016853657175656e6365026135030204f5a20273456e64206f66204f74686572207369676e657204f5a30171457874656e73696f6e206f7074696f6e7302653120416e7904f5a40177457874656e73696f6e206f7074696f6e732028312f31290278192f636f736d6f732e626173652e763162657461312e436f696e030104f5a30266352041544f4d030204f5a2027818456e64206f6620457874656e73696f6e206f7074696f6e7304f5a301781e4e6f6e20637269746963616c20657874656e73696f6e206f7074696f6e7302653120416e7904f5a40178244e6f6e20637269746963616c20657874656e73696f6e206f7074696f6e732028312f312902781b2f636f736d6f732e617574682e763162657461312e506172616d73030104f5a401734d6178206d656d6f206368617261637465727302623130030204f5a2027825456e64206f66204e6f6e20637269746963616c20657874656e73696f6e206f7074696f6e7304f5a3017148617368206f66207261772062797465730278406537626537383038646534393835626436303938313164326133323830356362323333633136386337643234376436316433376634613664643463663361326104f5" } ] diff --git a/x/tx/signing/textual/internal/testdata/tx.json b/x/tx/signing/textual/internal/testdata/tx.json index c071d08eec28..98bb9db58f32 100644 --- a/x/tx/signing/textual/internal/testdata/tx.json +++ b/x/tx/signing/textual/internal/testdata/tx.json @@ -232,6 +232,8 @@ ], "memo": "> ⚛ī¸\\u269B⚛ī¸ ", "timeout_height": 20, + "unordered": true, + "timeout_timestamp": "2042-01-01T00:00:20Z", "extension_options": [ { "@type": "/cosmos.base.v1beta1.Coin", @@ -299,13 +301,6 @@ "gas_limit": 100000, "payer": "cosmos1ejrf4cur2wy6kfurg9f2jppp2h3afe5h6pkh5t", "granter": "cosmos1ulav3hsenupswqfkw2y3sup5kgtqwnvqa8eyhs" - }, - "tip": { - "amount": [ - { "amount": "20000", "denom": "uatom" }, - { "amount": "30000", "denom": "uosmo" } - ], - "tipper": "cosmos1ejrf4cur2wy6kfurg9f2jppp2h3afe5h6pkh5t" } } }, @@ -357,8 +352,6 @@ { "title": "Fees", "content": "0.002 ATOM" }, { "title": "Fee payer", "content": "cosmos1ejrf4cur2wy6kfurg9f2jppp2h3afe5h6pkh5t", "expert": true }, { "title": "Fee granter", "content": "cosmos1ulav3hsenupswqfkw2y3sup5kgtqwnvqa8eyhs", "expert": true }, - { "title": "Tip", "content": "0.02 ATOM, 30'000 uosmo" }, - { "title": "Tipper", "content": "cosmos1ejrf4cur2wy6kfurg9f2jppp2h3afe5h6pkh5t" }, { "title": "Gas limit", "content": "100'000", "expert": true }, { "title": "Timeout height", "content": "20", "expert": true }, { "title": "Other signer", "content": "1 SignerInfo", "expert": true }, @@ -394,7 +387,9 @@ { "title": "Non critical extension options (1/1)", "content": "/cosmos.auth.v1beta1.Params", "indent": 1, "expert": true }, { "title": "Max memo characters", "content": "10", "indent": 2, "expert": true }, { "content": "End of Non critical extension options", "expert": true }, - { "title": "Hash of raw bytes", "content": "7ea02e8f0baed2db969e2d9ae4dc51fa31116259bd42897588072faf0ebb4d2e", "expert": true } + { "title": "Hash of raw bytes", "content": "9c8e99e281e501bb8778b0361dd574c764e54d96ba354a8abc9ccd2ea18e3e06", "expert": true }, + { "title": "Unordered", "content": "True", "expert": true }, + {"title": "Timeout timestamp", "content": "2042-01-01T00:00:20Z", "expert": true} ] } ] diff --git a/x/tx/signing/textual/internal/textualpb/buf.lock b/x/tx/signing/textual/internal/textualpb/buf.lock index 259bd9ce82b1..ca09fbb4fad6 100644 --- a/x/tx/signing/textual/internal/textualpb/buf.lock +++ b/x/tx/signing/textual/internal/textualpb/buf.lock @@ -4,8 +4,30 @@ deps: - remote: buf.build owner: cosmos repository: cosmos-proto - commit: 1935555c206d4afb9e94615dfd0fad31 + commit: 04467658e59e44bbb22fe568206e1f70 + digest: shake256:73a640bd60e0c523b0f8237ff34eab67c45a38b64bbbde1d80224819d272dbf316ac183526bd245f994af6608b025f5130483d0133c5edd385531326b5990466 + - remote: buf.build + owner: cosmos + repository: cosmos-sdk + commit: 05419252bcc241ea8023acf1ed4cadc5 + digest: shake256:1e54a48c19a8b59d35e0a7efa76402939f515f2d8005df099856f24c37c20a52800308f025abb8cffcd014d437b49707388aaca4865d9d063d8f25d5d4eb77d5 - remote: buf.build owner: cosmos repository: gogo-proto - commit: 6652e3443c3b4504bb3bf82e73a7e409 + commit: 88ef6483f90f478fb938c37dde52ece3 + digest: shake256:89c45df2aa11e0cff97b0d695436713db3d993d76792e9f8dc1ae90e6ab9a9bec55503d48ceedd6b86069ab07d3041b32001b2bfe0227fa725dd515ff381e5ba + - remote: buf.build + owner: googleapis + repository: googleapis + commit: 7e6f6e774e29406da95bd61cdcdbc8bc + digest: shake256:fe43dd2265ea0c07d76bd925eeba612667cf4c948d2ce53d6e367e1b4b3cb5fa69a51e6acb1a6a50d32f894f054a35e6c0406f6808a483f2752e10c866ffbf73 + - remote: buf.build + owner: protocolbuffers + repository: wellknowntypes + commit: 657250e6a39648cbb169d079a60bd9ba + digest: shake256:00de25001b8dd2e29d85fc4bcc3ede7aed886d76d67f5e0f7a9b320b90f871d3eb73507d50818d823a0512f3f8db77a11c043685528403e31ff3fef18323a9fb + - remote: buf.build + owner: tendermint + repository: tendermint + commit: 33ed361a90514289beabf3189e1d7665 + digest: shake256:038267e06294714fd883610626554b04a127b576b4e253befb4206cb72d5d3c1eeccacd4b9ec8e3fb891f7c14e1cb0f770c077d2989638995b0a61c85afedb1d diff --git a/x/tx/signing/textual/internal/textualpb/buf.yaml b/x/tx/signing/textual/internal/textualpb/buf.yaml index 5aee45ac2b4f..9e1bb8366908 100644 --- a/x/tx/signing/textual/internal/textualpb/buf.yaml +++ b/x/tx/signing/textual/internal/textualpb/buf.yaml @@ -1,7 +1,9 @@ version: v1 deps: + - buf.build/cosmos/cosmos-sdk - buf.build/cosmos/cosmos-proto - buf.build/cosmos/gogo-proto + - buf.build/protocolbuffers/wellknowntypes:v23.4 lint: use: - DEFAULT diff --git a/x/tx/signing/textual/internal/textualpb/textual.proto b/x/tx/signing/textual/internal/textualpb/textual.proto index efd8d35275bd..0f9273472932 100644 --- a/x/tx/signing/textual/internal/textualpb/textual.proto +++ b/x/tx/signing/textual/internal/textualpb/textual.proto @@ -4,6 +4,7 @@ import "cosmos/base/v1beta1/coin.proto"; import "cosmos/tx/v1beta1/tx.proto"; import "cosmos_proto/cosmos.proto"; import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; // TextualData represents all the information needed to generate // the textual SignDoc (which is []Screen encoded to CBOR). It is meant to be @@ -77,12 +78,12 @@ message Envelope { repeated cosmos.base.v1beta1.Coin fees = 8; string fee_payer = 9; string fee_granter = 10; - repeated cosmos.base.v1beta1.Coin tip = 11; - string tipper = 12; uint64 gas_limit = 13; uint64 timeout_height = 14; repeated cosmos.tx.v1beta1.SignerInfo other_signer = 15; repeated google.protobuf.Any extension_options = 16; repeated google.protobuf.Any non_critical_extension_options = 17; string hash_of_raw_bytes = 18; + bool unordered = 19; + google.protobuf.Timestamp timeout_timestamp = 20; } diff --git a/x/tx/signing/textual/internal/textualpb/textual.pulsar.go b/x/tx/signing/textual/internal/textualpb/textual.pulsar.go index 14b94260756f..050fd821a6cd 100644 --- a/x/tx/signing/textual/internal/textualpb/textual.pulsar.go +++ b/x/tx/signing/textual/internal/textualpb/textual.pulsar.go @@ -11,6 +11,7 @@ import ( protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" anypb "google.golang.org/protobuf/types/known/anypb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" io "io" reflect "reflect" sync "sync" @@ -1344,57 +1345,6 @@ func (x *_Envelope_8_list) IsValid() bool { return x.list != nil } -var _ protoreflect.List = (*_Envelope_11_list)(nil) - -type _Envelope_11_list struct { - list *[]*v1beta1.Coin -} - -func (x *_Envelope_11_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_Envelope_11_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_Envelope_11_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) - (*x.list)[i] = concreteValue -} - -func (x *_Envelope_11_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) - *x.list = append(*x.list, concreteValue) -} - -func (x *_Envelope_11_list) AppendMutable() protoreflect.Value { - v := new(v1beta1.Coin) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_Envelope_11_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_Envelope_11_list) NewElement() protoreflect.Value { - v := new(v1beta1.Coin) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_Envelope_11_list) IsValid() bool { - return x.list != nil -} - var _ protoreflect.List = (*_Envelope_15_list)(nil) type _Envelope_15_list struct { @@ -1560,14 +1510,14 @@ var ( fd_Envelope_fees protoreflect.FieldDescriptor fd_Envelope_fee_payer protoreflect.FieldDescriptor fd_Envelope_fee_granter protoreflect.FieldDescriptor - fd_Envelope_tip protoreflect.FieldDescriptor - fd_Envelope_tipper protoreflect.FieldDescriptor fd_Envelope_gas_limit protoreflect.FieldDescriptor fd_Envelope_timeout_height protoreflect.FieldDescriptor fd_Envelope_other_signer protoreflect.FieldDescriptor fd_Envelope_extension_options protoreflect.FieldDescriptor fd_Envelope_non_critical_extension_options protoreflect.FieldDescriptor fd_Envelope_hash_of_raw_bytes protoreflect.FieldDescriptor + fd_Envelope_unordered protoreflect.FieldDescriptor + fd_Envelope_timeout_timestamp protoreflect.FieldDescriptor ) func init() { @@ -1583,14 +1533,14 @@ func init() { fd_Envelope_fees = md_Envelope.Fields().ByName("fees") fd_Envelope_fee_payer = md_Envelope.Fields().ByName("fee_payer") fd_Envelope_fee_granter = md_Envelope.Fields().ByName("fee_granter") - fd_Envelope_tip = md_Envelope.Fields().ByName("tip") - fd_Envelope_tipper = md_Envelope.Fields().ByName("tipper") fd_Envelope_gas_limit = md_Envelope.Fields().ByName("gas_limit") fd_Envelope_timeout_height = md_Envelope.Fields().ByName("timeout_height") fd_Envelope_other_signer = md_Envelope.Fields().ByName("other_signer") fd_Envelope_extension_options = md_Envelope.Fields().ByName("extension_options") fd_Envelope_non_critical_extension_options = md_Envelope.Fields().ByName("non_critical_extension_options") fd_Envelope_hash_of_raw_bytes = md_Envelope.Fields().ByName("hash_of_raw_bytes") + fd_Envelope_unordered = md_Envelope.Fields().ByName("unordered") + fd_Envelope_timeout_timestamp = md_Envelope.Fields().ByName("timeout_timestamp") } var _ protoreflect.Message = (*fastReflection_Envelope)(nil) @@ -1718,18 +1668,6 @@ func (x *fastReflection_Envelope) Range(f func(protoreflect.FieldDescriptor, pro return } } - if len(x.Tip) != 0 { - value := protoreflect.ValueOfList(&_Envelope_11_list{list: &x.Tip}) - if !f(fd_Envelope_tip, value) { - return - } - } - if x.Tipper != "" { - value := protoreflect.ValueOfString(x.Tipper) - if !f(fd_Envelope_tipper, value) { - return - } - } if x.GasLimit != uint64(0) { value := protoreflect.ValueOfUint64(x.GasLimit) if !f(fd_Envelope_gas_limit, value) { @@ -1766,6 +1704,18 @@ func (x *fastReflection_Envelope) Range(f func(protoreflect.FieldDescriptor, pro return } } + if x.Unordered != false { + value := protoreflect.ValueOfBool(x.Unordered) + if !f(fd_Envelope_unordered, value) { + return + } + } + if x.TimeoutTimestamp != nil { + value := protoreflect.ValueOfMessage(x.TimeoutTimestamp.ProtoReflect()) + if !f(fd_Envelope_timeout_timestamp, value) { + return + } + } } // Has reports whether a field is populated. @@ -1801,10 +1751,6 @@ func (x *fastReflection_Envelope) Has(fd protoreflect.FieldDescriptor) bool { return x.FeePayer != "" case "Envelope.fee_granter": return x.FeeGranter != "" - case "Envelope.tip": - return len(x.Tip) != 0 - case "Envelope.tipper": - return x.Tipper != "" case "Envelope.gas_limit": return x.GasLimit != uint64(0) case "Envelope.timeout_height": @@ -1817,6 +1763,10 @@ func (x *fastReflection_Envelope) Has(fd protoreflect.FieldDescriptor) bool { return len(x.NonCriticalExtensionOptions) != 0 case "Envelope.hash_of_raw_bytes": return x.HashOfRawBytes != "" + case "Envelope.unordered": + return x.Unordered != false + case "Envelope.timeout_timestamp": + return x.TimeoutTimestamp != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: Envelope")) @@ -1853,10 +1803,6 @@ func (x *fastReflection_Envelope) Clear(fd protoreflect.FieldDescriptor) { x.FeePayer = "" case "Envelope.fee_granter": x.FeeGranter = "" - case "Envelope.tip": - x.Tip = nil - case "Envelope.tipper": - x.Tipper = "" case "Envelope.gas_limit": x.GasLimit = uint64(0) case "Envelope.timeout_height": @@ -1869,6 +1815,10 @@ func (x *fastReflection_Envelope) Clear(fd protoreflect.FieldDescriptor) { x.NonCriticalExtensionOptions = nil case "Envelope.hash_of_raw_bytes": x.HashOfRawBytes = "" + case "Envelope.unordered": + x.Unordered = false + case "Envelope.timeout_timestamp": + x.TimeoutTimestamp = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: Envelope")) @@ -1921,15 +1871,6 @@ func (x *fastReflection_Envelope) Get(descriptor protoreflect.FieldDescriptor) p case "Envelope.fee_granter": value := x.FeeGranter return protoreflect.ValueOfString(value) - case "Envelope.tip": - if len(x.Tip) == 0 { - return protoreflect.ValueOfList(&_Envelope_11_list{}) - } - listValue := &_Envelope_11_list{list: &x.Tip} - return protoreflect.ValueOfList(listValue) - case "Envelope.tipper": - value := x.Tipper - return protoreflect.ValueOfString(value) case "Envelope.gas_limit": value := x.GasLimit return protoreflect.ValueOfUint64(value) @@ -1957,6 +1898,12 @@ func (x *fastReflection_Envelope) Get(descriptor protoreflect.FieldDescriptor) p case "Envelope.hash_of_raw_bytes": value := x.HashOfRawBytes return protoreflect.ValueOfString(value) + case "Envelope.unordered": + value := x.Unordered + return protoreflect.ValueOfBool(value) + case "Envelope.timeout_timestamp": + value := x.TimeoutTimestamp + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: Envelope")) @@ -2001,12 +1948,6 @@ func (x *fastReflection_Envelope) Set(fd protoreflect.FieldDescriptor, value pro x.FeePayer = value.Interface().(string) case "Envelope.fee_granter": x.FeeGranter = value.Interface().(string) - case "Envelope.tip": - lv := value.List() - clv := lv.(*_Envelope_11_list) - x.Tip = *clv.list - case "Envelope.tipper": - x.Tipper = value.Interface().(string) case "Envelope.gas_limit": x.GasLimit = value.Uint() case "Envelope.timeout_height": @@ -2025,6 +1966,10 @@ func (x *fastReflection_Envelope) Set(fd protoreflect.FieldDescriptor, value pro x.NonCriticalExtensionOptions = *clv.list case "Envelope.hash_of_raw_bytes": x.HashOfRawBytes = value.Interface().(string) + case "Envelope.unordered": + x.Unordered = value.Bool() + case "Envelope.timeout_timestamp": + x.TimeoutTimestamp = value.Message().Interface().(*timestamppb.Timestamp) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: Envelope")) @@ -2062,12 +2007,6 @@ func (x *fastReflection_Envelope) Mutable(fd protoreflect.FieldDescriptor) proto } value := &_Envelope_8_list{list: &x.Fees} return protoreflect.ValueOfList(value) - case "Envelope.tip": - if x.Tip == nil { - x.Tip = []*v1beta1.Coin{} - } - value := &_Envelope_11_list{list: &x.Tip} - return protoreflect.ValueOfList(value) case "Envelope.other_signer": if x.OtherSigner == nil { x.OtherSigner = []*v1beta11.SignerInfo{} @@ -2086,6 +2025,11 @@ func (x *fastReflection_Envelope) Mutable(fd protoreflect.FieldDescriptor) proto } value := &_Envelope_17_list{list: &x.NonCriticalExtensionOptions} return protoreflect.ValueOfList(value) + case "Envelope.timeout_timestamp": + if x.TimeoutTimestamp == nil { + x.TimeoutTimestamp = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.TimeoutTimestamp.ProtoReflect()) case "Envelope.chain_id": panic(fmt.Errorf("field chain_id of message Envelope is not mutable")) case "Envelope.account_number": @@ -2100,14 +2044,14 @@ func (x *fastReflection_Envelope) Mutable(fd protoreflect.FieldDescriptor) proto panic(fmt.Errorf("field fee_payer of message Envelope is not mutable")) case "Envelope.fee_granter": panic(fmt.Errorf("field fee_granter of message Envelope is not mutable")) - case "Envelope.tipper": - panic(fmt.Errorf("field tipper of message Envelope is not mutable")) case "Envelope.gas_limit": panic(fmt.Errorf("field gas_limit of message Envelope is not mutable")) case "Envelope.timeout_height": panic(fmt.Errorf("field timeout_height of message Envelope is not mutable")) case "Envelope.hash_of_raw_bytes": panic(fmt.Errorf("field hash_of_raw_bytes of message Envelope is not mutable")) + case "Envelope.unordered": + panic(fmt.Errorf("field unordered of message Envelope is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: Envelope")) @@ -2144,11 +2088,6 @@ func (x *fastReflection_Envelope) NewField(fd protoreflect.FieldDescriptor) prot return protoreflect.ValueOfString("") case "Envelope.fee_granter": return protoreflect.ValueOfString("") - case "Envelope.tip": - list := []*v1beta1.Coin{} - return protoreflect.ValueOfList(&_Envelope_11_list{list: &list}) - case "Envelope.tipper": - return protoreflect.ValueOfString("") case "Envelope.gas_limit": return protoreflect.ValueOfUint64(uint64(0)) case "Envelope.timeout_height": @@ -2164,6 +2103,11 @@ func (x *fastReflection_Envelope) NewField(fd protoreflect.FieldDescriptor) prot return protoreflect.ValueOfList(&_Envelope_17_list{list: &list}) case "Envelope.hash_of_raw_bytes": return protoreflect.ValueOfString("") + case "Envelope.unordered": + return protoreflect.ValueOfBool(false) + case "Envelope.timeout_timestamp": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: Envelope")) @@ -2275,16 +2219,6 @@ func (x *fastReflection_Envelope) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if len(x.Tip) > 0 { - for _, e := range x.Tip { - l = options.Size(e) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - l = len(x.Tipper) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } if x.GasLimit != 0 { n += 1 + runtime.Sov(uint64(x.GasLimit)) } @@ -2313,6 +2247,13 @@ func (x *fastReflection_Envelope) ProtoMethods() *protoiface.Methods { if l > 0 { n += 2 + l + runtime.Sov(uint64(l)) } + if x.Unordered { + n += 3 + } + if x.TimeoutTimestamp != nil { + l = options.Size(x.TimeoutTimestamp) + n += 2 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -2342,6 +2283,34 @@ func (x *fastReflection_Envelope) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.TimeoutTimestamp != nil { + encoded, err := options.Marshal(x.TimeoutTimestamp) + 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] = 0x1 + i-- + dAtA[i] = 0xa2 + } + if x.Unordered { + i-- + if x.Unordered { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x98 + } if len(x.HashOfRawBytes) > 0 { i -= len(x.HashOfRawBytes) copy(dAtA[i:], x.HashOfRawBytes) @@ -2413,29 +2382,6 @@ func (x *fastReflection_Envelope) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x68 } - if len(x.Tipper) > 0 { - i -= len(x.Tipper) - copy(dAtA[i:], x.Tipper) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Tipper))) - i-- - dAtA[i] = 0x62 - } - if len(x.Tip) > 0 { - for iNdEx := len(x.Tip) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.Tip[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] = 0x5a - } - } if len(x.FeeGranter) > 0 { i -= len(x.FeeGranter) copy(dAtA[i:], x.FeeGranter) @@ -2878,72 +2824,6 @@ func (x *fastReflection_Envelope) ProtoMethods() *protoiface.Methods { } x.FeeGranter = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 11: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Tip", 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.Tip = append(x.Tip, &v1beta1.Coin{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Tip[len(x.Tip)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 12: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Tipper", 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.Tipper = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 13: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GasLimit", wireType) @@ -3116,6 +2996,62 @@ func (x *fastReflection_Envelope) ProtoMethods() *protoiface.Methods { } x.HashOfRawBytes = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 19: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Unordered", 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.Unordered = bool(v != 0) + case 20: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TimeoutTimestamp", 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.TimeoutTimestamp == nil { + x.TimeoutTimestamp = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.TimeoutTimestamp); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -3165,7 +3101,7 @@ const ( ) // TextualData represents all the information needed to generate -// the textual SignDoc (which is []Screen encoded to XBOR). It is meant to be +// the textual SignDoc (which is []Screen encoded to CBOR). It is meant to be // used as an internal type in Textual's implementations. type TextualData struct { state protoimpl.MessageState @@ -3228,7 +3164,8 @@ func (x *TextualData) GetSignerData() *SignerData { // isn't included in the transaction body itself. // // It is the same struct as signing.SignerData, but only used internally -// in Textual because we need it as a proto.Message. +// in Textual because we need it as a proto.Message. If that struct is updated, +// then this proto SignerData also needs to be modified. type SignerData struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3337,14 +3274,14 @@ type Envelope struct { Fees []*v1beta1.Coin `protobuf:"bytes,8,rep,name=fees,proto3" json:"fees,omitempty"` FeePayer string `protobuf:"bytes,9,opt,name=fee_payer,json=feePayer,proto3" json:"fee_payer,omitempty"` FeeGranter string `protobuf:"bytes,10,opt,name=fee_granter,json=feeGranter,proto3" json:"fee_granter,omitempty"` - Tip []*v1beta1.Coin `protobuf:"bytes,11,rep,name=tip,proto3" json:"tip,omitempty"` - Tipper string `protobuf:"bytes,12,opt,name=tipper,proto3" json:"tipper,omitempty"` GasLimit uint64 `protobuf:"varint,13,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty"` TimeoutHeight uint64 `protobuf:"varint,14,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height,omitempty"` OtherSigner []*v1beta11.SignerInfo `protobuf:"bytes,15,rep,name=other_signer,json=otherSigner,proto3" json:"other_signer,omitempty"` ExtensionOptions []*anypb.Any `protobuf:"bytes,16,rep,name=extension_options,json=extensionOptions,proto3" json:"extension_options,omitempty"` NonCriticalExtensionOptions []*anypb.Any `protobuf:"bytes,17,rep,name=non_critical_extension_options,json=nonCriticalExtensionOptions,proto3" json:"non_critical_extension_options,omitempty"` HashOfRawBytes string `protobuf:"bytes,18,opt,name=hash_of_raw_bytes,json=hashOfRawBytes,proto3" json:"hash_of_raw_bytes,omitempty"` + Unordered bool `protobuf:"varint,19,opt,name=unordered,proto3" json:"unordered,omitempty"` + TimeoutTimestamp *timestamppb.Timestamp `protobuf:"bytes,20,opt,name=timeout_timestamp,json=timeoutTimestamp,proto3" json:"timeout_timestamp,omitempty"` } func (x *Envelope) Reset() { @@ -3437,20 +3374,6 @@ func (x *Envelope) GetFeeGranter() string { return "" } -func (x *Envelope) GetTip() []*v1beta1.Coin { - if x != nil { - return x.Tip - } - return nil -} - -func (x *Envelope) GetTipper() string { - if x != nil { - return x.Tipper - } - return "" -} - func (x *Envelope) GetGasLimit() uint64 { if x != nil { return x.GasLimit @@ -3493,6 +3416,20 @@ func (x *Envelope) GetHashOfRawBytes() string { return "" } +func (x *Envelope) GetUnordered() bool { + if x != nil { + return x.Unordered + } + return false +} + +func (x *Envelope) GetTimeoutTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.TimeoutTimestamp + } + return nil +} + var File_textual_proto protoreflect.FileDescriptor var file_textual_proto_rawDesc = []byte{ @@ -3504,80 +3441,84 @@ var file_textual_proto_rawDesc = []byte{ 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0x82, 0x01, 0x0a, 0x0b, 0x54, 0x65, 0x78, 0x74, 0x75, 0x61, 0x6c, 0x44, 0x61, 0x74, - 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x62, 0x6f, 0x64, 0x79, 0x42, 0x79, 0x74, 0x65, 0x73, - 0x12, 0x26, 0x0a, 0x0f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x62, 0x79, - 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x61, 0x75, 0x74, 0x68, 0x49, - 0x6e, 0x66, 0x6f, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x2c, 0x0a, 0x0b, 0x73, 0x69, 0x67, 0x6e, - 0x65, 0x72, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, - 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0a, 0x73, 0x69, 0x67, 0x6e, - 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x22, 0xc6, 0x01, 0x0a, 0x0a, 0x53, 0x69, 0x67, 0x6e, 0x65, - 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2b, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x11, 0xd2, 0xb4, 0x2d, 0x0d, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x25, 0x0a, - 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x75, - 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, - 0x12, 0x2d, 0x0a, 0x07, 0x70, 0x75, 0x62, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x06, 0x70, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x22, - 0xfc, 0x05, 0x0a, 0x08, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x08, - 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1a, - 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 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, 0x33, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, - 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x09, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x2e, 0x0a, 0x07, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, - 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, - 0x6f, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x2d, 0x0a, - 0x04, 0x66, 0x65, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x04, 0x66, 0x65, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, - 0x66, 0x65, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x66, 0x65, 0x65, 0x50, 0x61, 0x79, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x66, 0x65, 0x65, - 0x5f, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x66, 0x65, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x03, 0x74, 0x69, - 0x70, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, - 0x69, 0x6e, 0x52, 0x03, 0x74, 0x69, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x69, 0x70, 0x70, 0x65, - 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x69, 0x70, 0x70, 0x65, 0x72, 0x12, - 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x0d, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x25, 0x0a, 0x0e, - 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x0e, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x48, 0x65, 0x69, - 0x67, 0x68, 0x74, 0x12, 0x40, 0x0a, 0x0c, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x73, 0x69, 0x67, - 0x6e, 0x65, 0x72, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x69, - 0x67, 0x6e, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x53, - 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x41, 0x0a, 0x11, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, - 0x6f, 0x6e, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x10, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x59, 0x0a, 0x1e, 0x6e, 0x6f, 0x6e, 0x5f, - 0x63, 0x72, 0x69, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, - 0x6f, 0x6e, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x11, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x1b, 0x6e, 0x6f, 0x6e, 0x43, 0x72, 0x69, 0x74, 0x69, - 0x63, 0x61, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x12, 0x29, 0x0a, 0x11, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x6f, 0x66, 0x5f, 0x72, - 0x61, 0x77, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, - 0x68, 0x61, 0x73, 0x68, 0x4f, 0x66, 0x52, 0x61, 0x77, 0x42, 0x79, 0x74, 0x65, 0x73, 0x42, 0x3c, - 0x42, 0x0c, 0x54, 0x65, 0x78, 0x74, 0x75, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x74, - 0x78, 0x2f, 0x74, 0x65, 0x78, 0x74, 0x75, 0x61, 0x6c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x78, 0x74, 0x75, 0x61, 0x6c, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x82, 0x01, 0x0a, 0x0b, 0x54, 0x65, 0x78, 0x74, 0x75, 0x61, 0x6c, 0x44, 0x61, + 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x62, 0x6f, 0x64, 0x79, 0x42, 0x79, 0x74, 0x65, + 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x62, + 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x61, 0x75, 0x74, 0x68, + 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x2c, 0x0a, 0x0b, 0x73, 0x69, 0x67, + 0x6e, 0x65, 0x72, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, + 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0a, 0x73, 0x69, 0x67, + 0x6e, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x22, 0xc6, 0x01, 0x0a, 0x0a, 0x53, 0x69, 0x67, 0x6e, + 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2b, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x11, 0xd2, 0xb4, 0x2d, 0x0d, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x25, + 0x0a, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, + 0x65, 0x12, 0x2d, 0x0a, 0x07, 0x70, 0x75, 0x62, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x06, 0x70, 0x75, 0x62, 0x4b, 0x65, 0x79, + 0x22, 0x9e, 0x06, 0x0a, 0x08, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x12, 0x19, 0x0a, + 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, + 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 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, 0x33, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, + 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, + 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x2e, 0x0a, 0x07, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, + 0x79, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, + 0x6d, 0x6f, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x2d, + 0x0a, 0x04, 0x66, 0x65, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x04, 0x66, 0x65, 0x65, 0x73, 0x12, 0x1b, 0x0a, + 0x09, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x66, 0x65, 0x65, 0x50, 0x61, 0x79, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x66, 0x65, + 0x65, 0x5f, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x66, 0x65, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x67, + 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, + 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x69, 0x6d, 0x65, + 0x6f, 0x75, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x0d, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, + 0x40, 0x0a, 0x0c, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, + 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, + 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x53, 0x69, 0x67, 0x6e, 0x65, + 0x72, 0x12, 0x41, 0x0a, 0x11, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, + 0x6e, 0x79, 0x52, 0x10, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x59, 0x0a, 0x1e, 0x6e, 0x6f, 0x6e, 0x5f, 0x63, 0x72, 0x69, 0x74, + 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x11, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, + 0x6e, 0x79, 0x52, 0x1b, 0x6e, 0x6f, 0x6e, 0x43, 0x72, 0x69, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x45, + 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x29, 0x0a, 0x11, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x6f, 0x66, 0x5f, 0x72, 0x61, 0x77, 0x5f, 0x62, + 0x79, 0x74, 0x65, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x68, 0x61, 0x73, 0x68, + 0x4f, 0x66, 0x52, 0x61, 0x77, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x6e, + 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x64, 0x18, 0x13, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x75, + 0x6e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x64, 0x12, 0x47, 0x0a, 0x11, 0x74, 0x69, 0x6d, 0x65, + 0x6f, 0x75, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x14, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x10, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x42, 0x3e, 0x42, 0x0c, 0x54, 0x65, 0x78, 0x74, 0x75, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x2c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, + 0x6f, 0x2f, 0x78, 0x2f, 0x74, 0x78, 0x2f, 0x74, 0x65, 0x78, 0x74, 0x75, 0x61, 0x6c, 0x2f, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x78, 0x74, 0x75, 0x61, 0x6c, 0x70, + 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3594,12 +3535,13 @@ func file_textual_proto_rawDescGZIP() []byte { var file_textual_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_textual_proto_goTypes = []interface{}{ - (*TextualData)(nil), // 0: TextualData - (*SignerData)(nil), // 1: SignerData - (*Envelope)(nil), // 2: Envelope - (*anypb.Any)(nil), // 3: google.protobuf.Any - (*v1beta1.Coin)(nil), // 4: cosmos.base.v1beta1.Coin - (*v1beta11.SignerInfo)(nil), // 5: cosmos.tx.v1beta1.SignerInfo + (*TextualData)(nil), // 0: TextualData + (*SignerData)(nil), // 1: SignerData + (*Envelope)(nil), // 2: Envelope + (*anypb.Any)(nil), // 3: google.protobuf.Any + (*v1beta1.Coin)(nil), // 4: cosmos.base.v1beta1.Coin + (*v1beta11.SignerInfo)(nil), // 5: cosmos.tx.v1beta1.SignerInfo + (*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp } var file_textual_proto_depIdxs = []int32{ 1, // 0: TextualData.signer_data:type_name -> SignerData @@ -3607,10 +3549,10 @@ var file_textual_proto_depIdxs = []int32{ 3, // 2: Envelope.public_key:type_name -> google.protobuf.Any 3, // 3: Envelope.message:type_name -> google.protobuf.Any 4, // 4: Envelope.fees:type_name -> cosmos.base.v1beta1.Coin - 4, // 5: Envelope.tip:type_name -> cosmos.base.v1beta1.Coin - 5, // 6: Envelope.other_signer:type_name -> cosmos.tx.v1beta1.SignerInfo - 3, // 7: Envelope.extension_options:type_name -> google.protobuf.Any - 3, // 8: Envelope.non_critical_extension_options:type_name -> google.protobuf.Any + 5, // 5: Envelope.other_signer:type_name -> cosmos.tx.v1beta1.SignerInfo + 3, // 6: Envelope.extension_options:type_name -> google.protobuf.Any + 3, // 7: Envelope.non_critical_extension_options:type_name -> google.protobuf.Any + 6, // 8: Envelope.timeout_timestamp:type_name -> google.protobuf.Timestamp 9, // [9:9] is the sub-list for method output_type 9, // [9:9] is the sub-list for method input_type 9, // [9:9] is the sub-list for extension type_name diff --git a/x/tx/signing/textual/message_test.go b/x/tx/signing/textual/message_test.go index da6f4f99a190..a0d870751410 100644 --- a/x/tx/signing/textual/message_test.go +++ b/x/tx/signing/textual/message_test.go @@ -9,12 +9,10 @@ import ( "github.com/google/go-cmp/cmp" "github.com/stretchr/testify/require" - - bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/testing/protocmp" + bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" "cosmossdk.io/x/tx/internal/testpb" "cosmossdk.io/x/tx/signing/textual" ) diff --git a/x/tx/signing/textual/repeated_test.go b/x/tx/signing/textual/repeated_test.go index 3eece902e465..3c20aae365dc 100644 --- a/x/tx/signing/textual/repeated_test.go +++ b/x/tx/signing/textual/repeated_test.go @@ -8,7 +8,6 @@ import ( "testing" "github.com/stretchr/testify/require" - "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" diff --git a/x/tx/signing/textual/string_test.go b/x/tx/signing/textual/string_test.go index 4f215b8d6d11..5000c90cd010 100644 --- a/x/tx/signing/textual/string_test.go +++ b/x/tx/signing/textual/string_test.go @@ -7,9 +7,10 @@ import ( "os" "testing" - "cosmossdk.io/x/tx/signing/textual" "github.com/stretchr/testify/require" "google.golang.org/protobuf/reflect/protoreflect" + + "cosmossdk.io/x/tx/signing/textual" ) type stringJSONTest struct { diff --git a/x/tx/signing/textual/testdata/fuzz/FuzzCoinsJSONTestcases/4d81af7cc74558bf b/x/tx/signing/textual/testdata/fuzz/FuzzCoinsJSONTestcases/4d81af7cc74558bf new file mode 100644 index 000000000000..f16030abe365 --- /dev/null +++ b/x/tx/signing/textual/testdata/fuzz/FuzzCoinsJSONTestcases/4d81af7cc74558bf @@ -0,0 +1,2 @@ +go test fuzz v1 +[]byte("[{\"proto\":[{\"Amount\":\"0\"},{\"Amount\":\"1\"}]}]") diff --git a/x/tx/signing/textual/timestamp_test.go b/x/tx/signing/textual/timestamp_test.go index d9ca6bbc0862..65d2a99a9323 100644 --- a/x/tx/signing/textual/timestamp_test.go +++ b/x/tx/signing/textual/timestamp_test.go @@ -8,12 +8,12 @@ import ( "testing" "time" - "cosmossdk.io/x/tx/signing/textual" "github.com/stretchr/testify/require" - "google.golang.org/protobuf/reflect/protoreflect" dur "google.golang.org/protobuf/types/known/durationpb" tspb "google.golang.org/protobuf/types/known/timestamppb" + + "cosmossdk.io/x/tx/signing/textual" ) // timestampJSONTest is the type of test cases in the testdata file. @@ -43,6 +43,7 @@ func TestTimestampJsonTestcasesExtraneousNanos(t *testing.T) { } func testTimestampJSONTestcases(t *testing.T, raw []byte) { + t.Helper() var testcases []timestampJSONTest err := json.Unmarshal(raw, &testcases) require.NoError(t, err) diff --git a/x/tx/signing/textual/tx.go b/x/tx/signing/textual/tx.go index 2d1fa6250b99..f49012870df3 100644 --- a/x/tx/signing/textual/tx.go +++ b/x/tx/signing/textual/tx.go @@ -16,7 +16,6 @@ import ( msg "cosmossdk.io/api/cosmos/msg/v1" signingv1beta1 "cosmossdk.io/api/cosmos/tx/signing/v1beta1" txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" - "cosmossdk.io/x/tx/signing/textual/internal/textualpb" ) @@ -80,14 +79,13 @@ func (vr txValueRenderer) Format(ctx context.Context, v protoreflect.Value) ([]S FeeGranter: txAuthInfo.Fee.Granter, GasLimit: txAuthInfo.Fee.GasLimit, TimeoutHeight: txBody.TimeoutHeight, + TimeoutTimestamp: txBody.TimeoutTimestamp, + Unordered: txBody.Unordered, ExtensionOptions: txBody.ExtensionOptions, NonCriticalExtensionOptions: txBody.NonCriticalExtensionOptions, HashOfRawBytes: getHash(textualData.BodyBytes, textualData.AuthInfoBytes), } - if txAuthInfo.Tip != nil { - envelope.Tip = txAuthInfo.Tip.Amount - envelope.Tipper = txAuthInfo.Tip.Tipper - } + // Find all other tx signers than the current signer. In the case where our // Textual signer is one key of a multisig, then otherSigners will include // the multisig pubkey. @@ -129,6 +127,8 @@ func (vr txValueRenderer) Format(ctx context.Context, v protoreflect.Value) ([]S "Fee granter": {}, "Gas limit": {}, "Timeout height": {}, + "Timeout timestamp": {}, + "Unordered": {}, "Other signer": {}, "Extension options": {}, "Non critical extension options": {}, @@ -233,6 +233,8 @@ func (vr txValueRenderer) Parse(ctx context.Context, screens []Screen) (protoref Messages: envelope.Message, Memo: envelope.Memo, TimeoutHeight: envelope.TimeoutHeight, + TimeoutTimestamp: envelope.TimeoutTimestamp, + Unordered: envelope.Unordered, ExtensionOptions: envelope.ExtensionOptions, NonCriticalExtensionOptions: envelope.NonCriticalExtensionOptions, } @@ -244,12 +246,6 @@ func (vr txValueRenderer) Parse(ctx context.Context, screens []Screen) (protoref Granter: envelope.FeeGranter, }, } - if envelope.Tip != nil { - authInfo.Tip = &txv1beta1.Tip{ - Amount: envelope.Tip, - Tipper: envelope.Tipper, - } - } // Figure out the signers in the correct order. signers, err := getSigners(txBody, authInfo) @@ -282,11 +278,12 @@ func (vr txValueRenderer) Parse(ctx context.Context, screens []Screen) (protoref // Note that we might not always get back the exact bodyBz and authInfoBz // that was passed into, because protobuf is not deterministic. // In tests, we don't check bytes equality, but protobuf object equality. - bodyBz, err := proto.Marshal(txBody) + protov2MarshalOpts := proto.MarshalOptions{Deterministic: true} + bodyBz, err := protov2MarshalOpts.Marshal(txBody) if err != nil { return nilValue, err } - authInfoBz, err := proto.Marshal(authInfo) + authInfoBz, err := protov2MarshalOpts.Marshal(authInfo) if err != nil { return nilValue, err } diff --git a/x/tx/signing/textual/tx_test.go b/x/tx/signing/textual/tx_test.go index 1b63b8c8c907..47acb0a8bec8 100644 --- a/x/tx/signing/textual/tx_test.go +++ b/x/tx/signing/textual/tx_test.go @@ -20,7 +20,6 @@ import ( _ "cosmossdk.io/api/cosmos/crypto/secp256k1" _ "cosmossdk.io/api/cosmos/gov/v1" txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" - "cosmossdk.io/x/tx/signing" "cosmossdk.io/x/tx/signing/textual" "cosmossdk.io/x/tx/signing/textual/internal/textualpb" @@ -118,6 +117,7 @@ func TestTxJSONTestcases(t *testing.T) { // createTextualData creates a Textual data give then JSON // test case. func createTextualData(t *testing.T, jsonTx txJSONTestTx, jsonSignerData json.RawMessage) (*txv1beta1.TxBody, []byte, *txv1beta1.AuthInfo, []byte, signing.SignerData) { + t.Helper() body := &txv1beta1.TxBody{} authInfo := &txv1beta1.AuthInfo{} protoSignerData := &textualpb.SignerData{} diff --git a/x/tx/sonar-project.properties b/x/tx/sonar-project.properties deleted file mode 100644 index 4550b73afb2c..000000000000 --- a/x/tx/sonar-project.properties +++ /dev/null @@ -1,14 +0,0 @@ -sonar.projectKey=cosmos-sdk-tx -sonar.organization=cosmos - -sonar.projectName=Cosmos SDK - x/tx -sonar.project.monorepo.enabled=true - -sonar.sources=. -sonar.exclusions=**/*_test.go,**/*.pulsar.go -sonar.tests=. -sonar.test.inclusions=**/*_test.go -sonar.go.coverage.reportPaths=coverage.out - -sonar.sourceEncoding=UTF-8 -sonar.scm.provider=git \ No newline at end of file diff --git a/x/upgrade/CHANGELOG.md b/x/upgrade/CHANGELOG.md index 78c064a6f508..debcf3528da5 100644 --- a/x/upgrade/CHANGELOG.md +++ b/x/upgrade/CHANGELOG.md @@ -25,11 +25,53 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +## [v0.1.4](https://github.com/cosmos/cosmos-sdk/releases/tag/x/upgrade/v0.1.4) - 2024-07-15 + +### Improvements + +* [#20771](https://github.com/cosmos/cosmos-sdk/pull/20771) Create upgrade directory only when necessary (upgrade flow and not init flow). + +## [v0.1.3](https://github.com/cosmos/cosmos-sdk/releases/tag/x/upgrade/v0.1.3) - 2024-06-04 + +* (deps) [#20530](https://github.com/cosmos/cosmos-sdk/pull/20530) Bump vulnerable `github.com/hashicorp/go-getter` to v1.7.4. + * In theory, we do not need a new release for this, but we are doing it as `x/upgrade` is used in Cosmovisor. + +## [v0.1.2](https://github.com/cosmos/cosmos-sdk/releases/tag/x/upgrade/v0.1.2) - 2024-04-22 + +### Improvements + +* (deps) [#19810](https://github.com/cosmos/cosmos-sdk/pull/19810) Upgrade SDK version due to prometheus breaking change. +* (deps) [#19810](https://github.com/cosmos/cosmos-sdk/pull/19810) Bump `cosmossdk.io/store` to v1.1.0. + +### Bug Fixes + +* [#19706](https://github.com/cosmos/cosmos-sdk/pull/19706) Stop treating inline JSON as a URL. + +## [v0.1.1](https://github.com/cosmos/cosmos-sdk/releases/tag/x/upgrade/v0.1.1) - 2023-12-11 + +### Improvements + +* [#18470](https://github.com/cosmos/cosmos-sdk/pull/18470) Improve go-getter settings. + +## [v0.1.0](https://github.com/cosmos/cosmos-sdk/releases/tag/x/upgrade/v0.1.0) - 2023-11-07 + ### Features * [#14880](https://github.com/cosmos/cosmos-sdk/pull/14880) Switch from using gov v1beta1 to gov v1 in upgrade CLIs. * [#14764](https://github.com/cosmos/cosmos-sdk/pull/14764) The `x/upgrade` module is extracted to have a separate go.mod file which allows it be a standalone module. -### API Breaking +### Improvements + +* [#16903](https://github.com/cosmos/cosmos-sdk/pull/16903) Use AutoCLI for upgrade querying commands. + +### API Breaking Changes + +* [#16845](https://github.com/cosmos/cosmos-sdk/pull/16845) Remove gov v1beta1 handler. Use gov v1 proposals directly, or replicate the handler in your app. +* [#16511](https://github.com/cosmos/cosmos-sdk/pull/16511) `BinaryDownloadURLMap.ValidateBasic()` and `BinaryDownloadURLMap.CheckURLs` now both take a checksum parameter when willing to ensure a checksum is provided for each URL. +* [#16511](https://github.com/cosmos/cosmos-sdk/pull/16511) `plan.DownloadURLWithChecksum` has been renamed to `plan.DownloadURL` and does not validate the URL anymore. Call `plan.ValidateURL` before calling `plan.DownloadURL` to validate the URL. +* [#16511](https://github.com/cosmos/cosmos-sdk/pull/16511) `plan.DownloadUpgrade` does not validate URL anymore. Call `plan.ValidateURL` before calling `plan.DownloadUpgrade` to validate the URL. +* [#16227](https://github.com/cosmos/cosmos-sdk/issues/16227) `NewKeeper` now takes a `KVStoreService` instead of a `StoreKey`, methods in the `Keeper` now take a `context.Context` instead of a `sdk.Context` and return an `error`. `UpgradeHandler` now receives a `context.Context`. `GetUpgradedClient`, `GetUpgradedConsensusState`, `GetUpgradePlan` now return a specific error for "not found". + +### Bug Fixes -* (x/upgrade) [#16227](https://github.com/cosmos/cosmos-sdk/issues/16227) `NewKeeper` now takes a `KVStoreService` instead of a `StoreKey`, methods in the `Keeper` now take a `context.Context` instead of a `sdk.Context` and return an `error`. `UpgradeHandler` now receives a `context.Context`. `GetUpgradedClient`, `GetUpgradedConsensusState`, `GetUpgradePlan` now return a specific error for "not found". +* [#17421](https://github.com/cosmos/cosmos-sdk/pull/17421) Replace `BeginBlock` by `PreBlock`. Read [ADR-68](https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-068-preblock.md) for more information. diff --git a/x/upgrade/README.md b/x/upgrade/README.md index 698e822ba866..46e4061a76cc 100644 --- a/x/upgrade/README.md +++ b/x/upgrade/README.md @@ -8,7 +8,7 @@ sidebar_position: 1 `x/upgrade` is an implementation of a Cosmos SDK module that facilitates smoothly upgrading a live Cosmos chain to a new (breaking) software version. It accomplishes this by -providing a `BeginBlocker` hook that prevents the blockchain state machine from +providing a `PreBlocker` hook that prevents the blockchain state machine from proceeding once a pre-defined upgrade block height has been reached. The module does not prescribe anything regarding how governance decides to do an @@ -246,8 +246,6 @@ module_versions: version: "1" - name: bank version: "2" -- name: crisis - version: "1" - name: distribution version: "2" - name: evidence @@ -410,10 +408,6 @@ Example Output: "name": "bank", "version": "2" }, - { - "name": "crisis", - "version": "1" - }, { "name": "distribution", "version": "2" @@ -552,10 +546,6 @@ Example Output: "name": "bank", "version": "2" }, - { - "name": "crisis", - "version": "1" - }, { "name": "distribution", "version": "2" diff --git a/x/upgrade/abci.go b/x/upgrade/abci.go index dafa09720800..3018fa16ef3d 100644 --- a/x/upgrade/abci.go +++ b/x/upgrade/abci.go @@ -4,8 +4,8 @@ import ( "context" "errors" "fmt" - "time" + "cosmossdk.io/core/appmodule" storetypes "cosmossdk.io/store/types" "cosmossdk.io/x/upgrade/keeper" "cosmossdk.io/x/upgrade/types" @@ -14,7 +14,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -// BeginBlock will check if there is a scheduled plan and if it is ready to be executed. +// PreBlocker will check if there is a scheduled plan and if it is ready to be executed. // If the current height is in the provided set of heights to skip, it will skip and clear the upgrade plan. // If it is ready, it will execute it if the handler is installed, and panic/abort otherwise. // If the plan is not ready, it will ensure the handler is not registered too early (and abort otherwise). @@ -22,14 +22,14 @@ import ( // The purpose is to ensure the binary is switched EXACTLY at the desired block, and to allow // a migration to be executed if needed upon this switch (migration defined in the new binary) // skipUpgradeHeightArray is a set of block heights for which the upgrade must be skipped -func BeginBlocker(ctx context.Context, k *keeper.Keeper) error { - defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) +func PreBlocker(ctx context.Context, k *keeper.Keeper) (appmodule.ResponsePreBlock, error) { + defer telemetry.ModuleMeasureSince(types.ModuleName, telemetry.Now(), telemetry.MetricKeyBeginBlocker) sdkCtx := sdk.UnwrapSDKContext(ctx) blockHeight := sdkCtx.HeaderInfo().Height plan, err := k.GetUpgradePlan(ctx) if err != nil && !errors.Is(err, types.ErrNoUpgradePlanFound) { - return err + return nil, err } found := err == nil @@ -43,7 +43,7 @@ func BeginBlocker(ctx context.Context, k *keeper.Keeper) error { if !found || !plan.ShouldExecute(blockHeight) || (plan.ShouldExecute(blockHeight) && k.IsSkipHeight(blockHeight)) { lastAppliedPlan, _, err := k.GetLastCompletedUpgrade(ctx) if err != nil { - return err + return nil, err } if lastAppliedPlan != "" && !k.HasHandler(lastAppliedPlan) { @@ -54,13 +54,15 @@ func BeginBlocker(ctx context.Context, k *keeper.Keeper) error { appVersion = cp.Version.App } - return fmt.Errorf("wrong app version %d, upgrade handler is missing for %s upgrade plan", appVersion, lastAppliedPlan) + return nil, fmt.Errorf("wrong app version %d, upgrade handler is missing for %s upgrade plan", appVersion, lastAppliedPlan) } } } if !found { - return nil + return &sdk.ResponsePreBlock{ + ConsensusParamsChanged: false, + }, nil } logger := k.Logger(ctx) @@ -73,7 +75,12 @@ func BeginBlocker(ctx context.Context, k *keeper.Keeper) error { logger.Info(skipUpgradeMsg) // Clear the upgrade plan at current height - return k.ClearUpgradePlan(ctx) + if err := k.ClearUpgradePlan(ctx); err != nil { + return nil, err + } + return &sdk.ResponsePreBlock{ + ConsensusParamsChanged: false, + }, nil } // Prepare shutdown if we don't have an upgrade handler for this upgrade name (meaning this software is out of date) @@ -82,20 +89,27 @@ func BeginBlocker(ctx context.Context, k *keeper.Keeper) error { // store migrations. err := k.DumpUpgradeInfoToDisk(blockHeight, plan) if err != nil { - return fmt.Errorf("unable to write upgrade info to filesystem: %s", err.Error()) + return nil, fmt.Errorf("unable to write upgrade info to filesystem: %w", err) } upgradeMsg := BuildUpgradeNeededMsg(plan) logger.Error(upgradeMsg) // Returning an error will end up in a panic - return fmt.Errorf(upgradeMsg) + return nil, errors.New(upgradeMsg) } // We have an upgrade handler for this upgrade name, so apply the upgrade logger.Info(fmt.Sprintf("applying upgrade \"%s\" at %s", plan.Name, plan.DueAt())) sdkCtx = sdkCtx.WithBlockGasMeter(storetypes.NewInfiniteGasMeter()) - return k.ApplyUpgrade(sdkCtx, plan) + if err := k.ApplyUpgrade(sdkCtx, plan); err != nil { + return nil, err + } + return &sdk.ResponsePreBlock{ + // the consensus parameters might be modified in the migration, + // refresh the consensus parameters in context. + ConsensusParamsChanged: true, + }, nil } // if we have a pending upgrade, but it is not yet time, make sure we did not @@ -105,10 +119,11 @@ func BeginBlocker(ctx context.Context, k *keeper.Keeper) error { logger.Error(downgradeMsg) // Returning an error will end up in a panic - return fmt.Errorf(downgradeMsg) + return nil, errors.New(downgradeMsg) } - - return nil + return &sdk.ResponsePreBlock{ + ConsensusParamsChanged: false, + }, nil } // BuildUpgradeNeededMsg prints the message that notifies that an upgrade is needed. diff --git a/x/upgrade/abci_test.go b/x/upgrade/abci_test.go index 0a9f31761705..fa86829005cb 100644 --- a/x/upgrade/abci_test.go +++ b/x/upgrade/abci_test.go @@ -7,12 +7,15 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "cosmossdk.io/core/appmodule" "cosmossdk.io/core/header" "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" - "github.com/stretchr/testify/require" - "github.com/stretchr/testify/suite" + "cosmossdk.io/x/upgrade" + "cosmossdk.io/x/upgrade/keeper" + "cosmossdk.io/x/upgrade/types" "github.com/cosmos/cosmos-sdk/baseapp" addresscodec "github.com/cosmos/cosmos-sdk/codec/address" @@ -24,31 +27,92 @@ import ( moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - govtypesv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - - "cosmossdk.io/x/upgrade" - "cosmossdk.io/x/upgrade/keeper" - "cosmossdk.io/x/upgrade/types" ) type TestSuite struct { - suite.Suite - - module appmodule.HasBeginBlocker - keeper *keeper.Keeper - handler govtypesv1beta1.Handler - ctx sdk.Context - baseApp *baseapp.BaseApp - encCfg moduletestutil.TestEncodingConfig + preModule appmodule.HasPreBlocker + keeper *keeper.Keeper + ctx sdk.Context + baseApp *baseapp.BaseApp + encCfg moduletestutil.TestEncodingConfig } -var s TestSuite +func (s *TestSuite) VerifyDoUpgrade(t *testing.T) { + t.Helper() + t.Log("Verify that a panic happens at the upgrade height") + newCtx := s.ctx.WithHeaderInfo(header.Info{Height: s.ctx.HeaderInfo().Height + 1, Time: time.Now()}) + + _, err := s.preModule.PreBlock(newCtx) + require.ErrorContains(t, err, "UPGRADE \"test\" NEEDED at height: 11: ") + + t.Log("Verify that the upgrade can be successfully applied with a handler") + s.keeper.SetUpgradeHandler("test", func(ctx context.Context, plan types.Plan, vm module.VersionMap) (module.VersionMap, error) { + return vm, nil + }) + + _, err = s.preModule.PreBlock(newCtx) + require.NoError(t, err) + + s.VerifyCleared(t, newCtx) +} + +func (s *TestSuite) VerifyDoUpgradeWithCtx(t *testing.T, newCtx sdk.Context, proposalName string) { + t.Helper() + t.Log("Verify that a panic happens at the upgrade height") + + _, err := s.preModule.PreBlock(newCtx) + require.ErrorContains(t, err, "UPGRADE \""+proposalName+"\" NEEDED at height: ") + + t.Log("Verify that the upgrade can be successfully applied with a handler") + s.keeper.SetUpgradeHandler(proposalName, func(ctx context.Context, plan types.Plan, vm module.VersionMap) (module.VersionMap, error) { + return vm, nil + }) + + _, err = s.preModule.PreBlock(newCtx) + require.NoError(t, err) + + s.VerifyCleared(t, newCtx) +} + +func (s *TestSuite) VerifyCleared(t *testing.T, newCtx sdk.Context) { + t.Helper() + t.Log("Verify that the upgrade plan has been cleared") + _, err := s.keeper.GetUpgradePlan(newCtx) + require.ErrorIs(t, err, types.ErrNoUpgradePlanFound) +} + +func (s *TestSuite) VerifyNotDone(t *testing.T, newCtx sdk.Context, name string) { + t.Helper() + t.Log("Verify that upgrade was not done") + height, err := s.keeper.GetDoneHeight(newCtx, name) + require.Zero(t, height) + require.NoError(t, err) +} + +func (s *TestSuite) VerifyDone(t *testing.T, newCtx sdk.Context, name string) { + t.Helper() + t.Log("Verify that the upgrade plan has been executed") + height, err := s.keeper.GetDoneHeight(newCtx, name) + require.NotZero(t, height) + require.NoError(t, err) +} + +func (s *TestSuite) VerifySet(t *testing.T, skipUpgradeHeights map[int64]bool) { + t.Helper() + t.Log("Verify if the skip upgrade has been set") + + for k := range skipUpgradeHeights { + require.True(t, s.keeper.IsSkipHeight(k)) + } +} func setupTest(t *testing.T, height int64, skip map[int64]bool) *TestSuite { + t.Helper() + s := TestSuite{} s.encCfg = moduletestutil.MakeTestEncodingConfig(upgrade.AppModuleBasic{}) key := storetypes.NewKVStoreKey(types.StoreKey) storeService := runtime.NewKVStoreService(key) - testCtx := testutil.DefaultContextWithDB(s.T(), key, storetypes.NewTransientStoreKey("transient_test")) + testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) s.baseApp = baseapp.NewBaseApp( "upgrade", @@ -62,22 +126,13 @@ func setupTest(t *testing.T, height int64, skip map[int64]bool) *TestSuite { s.ctx = testCtx.Ctx.WithHeaderInfo(header.Info{Time: time.Now(), Height: height}) - s.module = upgrade.NewAppModule(s.keeper, addresscodec.NewBech32Codec("cosmos")) - s.handler = upgrade.NewSoftwareUpgradeProposalHandler(s.keeper) + s.preModule = upgrade.NewAppModule(s.keeper, addresscodec.NewBech32Codec("cosmos")) return &s } -func TestRequireName(t *testing.T) { - s := setupTest(t, 10, map[int64]bool{}) - - err := s.handler(s.ctx, &types.SoftwareUpgradeProposal{Title: "prop", Plan: types.Plan{}}) //nolint:staticcheck // we're testing deprecated code - require.Error(t, err) - require.True(t, errors.Is(sdkerrors.ErrInvalidRequest, err), err) -} - func TestRequireFutureBlock(t *testing.T) { s := setupTest(t, 10, map[int64]bool{}) - err := s.handler(s.ctx, &types.SoftwareUpgradeProposal{Title: "prop", Plan: types.Plan{Name: "test", Height: s.ctx.HeaderInfo().Height - 1}}) //nolint:staticcheck // we're testing deprecated code + err := s.keeper.ScheduleUpgrade(s.ctx, types.Plan{Name: "test", Height: s.ctx.HeaderInfo().Height - 1}) require.Error(t, err) require.True(t, errors.Is(sdkerrors.ErrInvalidRequest, err), err) } @@ -85,56 +140,21 @@ func TestRequireFutureBlock(t *testing.T) { func TestDoHeightUpgrade(t *testing.T) { s := setupTest(t, 10, map[int64]bool{}) t.Log("Verify can schedule an upgrade") - err := s.handler(s.ctx, &types.SoftwareUpgradeProposal{Title: "prop", Plan: types.Plan{Name: "test", Height: s.ctx.HeaderInfo().Height + 1}}) //nolint:staticcheck // we're testing deprecated code + err := s.keeper.ScheduleUpgrade(s.ctx, types.Plan{Name: "test", Height: s.ctx.HeaderInfo().Height + 1}) require.NoError(t, err) - VerifyDoUpgrade(t) + s.VerifyDoUpgrade(t) } func TestCanOverwriteScheduleUpgrade(t *testing.T) { s := setupTest(t, 10, map[int64]bool{}) t.Log("Can overwrite plan") - err := s.handler(s.ctx, &types.SoftwareUpgradeProposal{Title: "prop", Plan: types.Plan{Name: "bad_test", Height: s.ctx.HeaderInfo().Height + 10}}) //nolint:staticcheck // we're testing deprecated code - require.NoError(t, err) - err = s.handler(s.ctx, &types.SoftwareUpgradeProposal{Title: "prop", Plan: types.Plan{Name: "test", Height: s.ctx.HeaderInfo().Height + 1}}) //nolint:staticcheck // we're testing deprecated code - require.NoError(t, err) - - VerifyDoUpgrade(t) -} - -func VerifyDoUpgrade(t *testing.T) { - t.Log("Verify that a panic happens at the upgrade height") - newCtx := s.ctx.WithHeaderInfo(header.Info{Height: s.ctx.HeaderInfo().Height + 1, Time: time.Now()}) - - err := s.module.BeginBlock(newCtx) - require.ErrorContains(t, err, "UPGRADE \"test\" NEEDED at height: 11: ") - - t.Log("Verify that the upgrade can be successfully applied with a handler") - s.keeper.SetUpgradeHandler("test", func(ctx context.Context, plan types.Plan, vm module.VersionMap) (module.VersionMap, error) { - return vm, nil - }) - - err = s.module.BeginBlock(newCtx) + err := s.keeper.ScheduleUpgrade(s.ctx, types.Plan{Name: "bad_test", Height: s.ctx.HeaderInfo().Height + 10}) require.NoError(t, err) - - VerifyCleared(t, newCtx) -} - -func VerifyDoUpgradeWithCtx(t *testing.T, newCtx sdk.Context, proposalName string) { - t.Log("Verify that a panic happens at the upgrade height") - - err := s.module.BeginBlock(newCtx) - require.ErrorContains(t, err, "UPGRADE \""+proposalName+"\" NEEDED at height: ") - - t.Log("Verify that the upgrade can be successfully applied with a handler") - s.keeper.SetUpgradeHandler(proposalName, func(ctx context.Context, plan types.Plan, vm module.VersionMap) (module.VersionMap, error) { - return vm, nil - }) - - err = s.module.BeginBlock(newCtx) + err = s.keeper.ScheduleUpgrade(s.ctx, types.Plan{Name: "test", Height: s.ctx.HeaderInfo().Height + 1}) require.NoError(t, err) - VerifyCleared(t, newCtx) + s.VerifyDoUpgrade(t) } func TestHaltIfTooNew(t *testing.T) { @@ -147,55 +167,47 @@ func TestHaltIfTooNew(t *testing.T) { }) newCtx := s.ctx.WithHeaderInfo(header.Info{Height: s.ctx.HeaderInfo().Height + 1, Time: time.Now()}) - - err := s.module.BeginBlock(newCtx) + _, err := s.preModule.PreBlock(newCtx) require.NoError(t, err) require.Equal(t, 0, called) t.Log("Verify we error if we have a registered handler ahead of time") - err = s.handler(s.ctx, &types.SoftwareUpgradeProposal{Title: "prop", Plan: types.Plan{Name: "future", Height: s.ctx.HeaderInfo().Height + 3}}) //nolint:staticcheck // we're testing deprecated code + err = s.keeper.ScheduleUpgrade(s.ctx, types.Plan{Name: "future", Height: s.ctx.HeaderInfo().Height + 3}) require.NoError(t, err) - - err = s.module.BeginBlock(newCtx) + _, err = s.preModule.PreBlock(newCtx) require.EqualError(t, err, "BINARY UPDATED BEFORE TRIGGER! UPGRADE \"future\" - in binary but not executed on chain. Downgrade your binary") require.Equal(t, 0, called) t.Log("Verify we no longer panic if the plan is on time") futCtx := s.ctx.WithHeaderInfo(header.Info{Height: s.ctx.HeaderInfo().Height + 3, Time: time.Now()}) - err = s.module.BeginBlock(futCtx) + _, err = s.preModule.PreBlock(futCtx) require.NoError(t, err) require.Equal(t, 1, called) - VerifyCleared(t, futCtx) -} - -func VerifyCleared(t *testing.T, newCtx sdk.Context) { - t.Log("Verify that the upgrade plan has been cleared") - _, err := s.keeper.GetUpgradePlan(newCtx) - require.ErrorIs(t, err, types.ErrNoUpgradePlanFound) + s.VerifyCleared(t, futCtx) } func TestCanClear(t *testing.T) { s := setupTest(t, 10, map[int64]bool{}) t.Log("Verify upgrade is scheduled") - err := s.handler(s.ctx, &types.SoftwareUpgradeProposal{Title: "prop", Plan: types.Plan{Name: "test", Height: s.ctx.HeaderInfo().Height + 100}}) //nolint:staticcheck // we're testing deprecated code + err := s.keeper.ScheduleUpgrade(s.ctx, types.Plan{Name: "test", Height: s.ctx.HeaderInfo().Height + 100}) require.NoError(t, err) - err = s.handler(s.ctx, &types.CancelSoftwareUpgradeProposal{Title: "cancel"}) //nolint:staticcheck // we're testing deprecated code + err = s.keeper.ClearUpgradePlan(s.ctx) require.NoError(t, err) - VerifyCleared(t, s.ctx) + s.VerifyCleared(t, s.ctx) } func TestCantApplySameUpgradeTwice(t *testing.T) { s := setupTest(t, 10, map[int64]bool{}) height := s.ctx.HeaderInfo().Height + 1 - err := s.handler(s.ctx, &types.SoftwareUpgradeProposal{Title: "prop", Plan: types.Plan{Name: "test", Height: height}}) //nolint:staticcheck // we're testing deprecated code + err := s.keeper.ScheduleUpgrade(s.ctx, types.Plan{Name: "test", Height: height}) require.NoError(t, err) - VerifyDoUpgrade(t) + s.VerifyDoUpgrade(t) t.Log("Verify an executed upgrade \"test\" can't be rescheduled") - err = s.handler(s.ctx, &types.SoftwareUpgradeProposal{Title: "prop", Plan: types.Plan{Name: "test", Height: height}}) //nolint:staticcheck // we're testing deprecated code + err = s.keeper.ScheduleUpgrade(s.ctx, types.Plan{Name: "test", Height: height}) require.Error(t, err) require.True(t, errors.Is(sdkerrors.ErrInvalidRequest, err), err) } @@ -203,7 +215,7 @@ func TestCantApplySameUpgradeTwice(t *testing.T) { func TestNoSpuriousUpgrades(t *testing.T) { s := setupTest(t, 10, map[int64]bool{}) t.Log("Verify that no upgrade panic is triggered in the BeginBlocker when we haven't scheduled an upgrade") - err := s.module.BeginBlock(s.ctx) + _, err := s.preModule.PreBlock(s.ctx) require.NoError(t, err) } @@ -212,33 +224,11 @@ func TestPlanStringer(t *testing.T) { require.Equal(t, `name:"test" time: height:100 `, (&types.Plan{Name: "test", Height: 100, Info: ""}).String()) } -func VerifyNotDone(t *testing.T, newCtx sdk.Context, name string) { - t.Log("Verify that upgrade was not done") - height, err := s.keeper.GetDoneHeight(newCtx, name) - require.Zero(t, height) - require.NoError(t, err) -} - -func VerifyDone(t *testing.T, newCtx sdk.Context, name string) { - t.Log("Verify that the upgrade plan has been executed") - height, err := s.keeper.GetDoneHeight(newCtx, name) - require.NotZero(t, height) - require.NoError(t, err) -} - -func VerifySet(t *testing.T, skipUpgradeHeights map[int64]bool) { - t.Log("Verify if the skip upgrade has been set") - - for k := range skipUpgradeHeights { - require.True(t, s.keeper.IsSkipHeight(k)) - } -} - func TestContains(t *testing.T) { var skipOne int64 = 11 s := setupTest(t, 10, map[int64]bool{skipOne: true}) - VerifySet(t, map[int64]bool{skipOne: true}) + s.VerifySet(t, map[int64]bool{skipOne: true}) t.Log("case where array contains the element") require.True(t, s.keeper.IsSkipHeight(11)) @@ -255,29 +245,29 @@ func TestSkipUpgradeSkippingAll(t *testing.T) { newCtx := s.ctx - err := s.handler(s.ctx, &types.SoftwareUpgradeProposal{Title: "prop", Plan: types.Plan{Name: "test", Height: skipOne}}) //nolint:staticcheck // we're testing deprecated code + err := s.keeper.ScheduleUpgrade(s.ctx, types.Plan{Name: "test", Height: skipOne}) require.NoError(t, err) t.Log("Verify if skip upgrade flag clears upgrade plan in both cases") - VerifySet(t, map[int64]bool{skipOne: true, skipTwo: true}) + s.VerifySet(t, map[int64]bool{skipOne: true, skipTwo: true}) newCtx = newCtx.WithHeaderInfo(header.Info{Height: skipOne}) - err = s.module.BeginBlock(newCtx) + _, err = s.preModule.PreBlock(newCtx) require.NoError(t, err) t.Log("Verify a second proposal also is being cleared") - err = s.handler(s.ctx, &types.SoftwareUpgradeProposal{Title: "prop2", Plan: types.Plan{Name: "test2", Height: skipTwo}}) //nolint:staticcheck // we're testing deprecated code + err = s.keeper.ScheduleUpgrade(s.ctx, types.Plan{Name: "test2", Height: skipTwo}) require.NoError(t, err) newCtx = newCtx.WithHeaderInfo(header.Info{Height: skipTwo}) - err = s.module.BeginBlock(newCtx) + _, err = s.preModule.PreBlock(newCtx) require.NoError(t, err) // To ensure verification is being done only after both upgrades are cleared t.Log("Verify if both proposals are cleared") - VerifyCleared(t, s.ctx) - VerifyNotDone(t, s.ctx, "test") - VerifyNotDone(t, s.ctx, "test2") + s.VerifyCleared(t, s.ctx) + s.VerifyNotDone(t, s.ctx, "test") + s.VerifyNotDone(t, s.ctx, "test2") } func TestUpgradeSkippingOne(t *testing.T) { @@ -289,27 +279,27 @@ func TestUpgradeSkippingOne(t *testing.T) { newCtx := s.ctx - err := s.handler(s.ctx, &types.SoftwareUpgradeProposal{Title: "prop", Plan: types.Plan{Name: "test", Height: skipOne}}) //nolint:staticcheck // we're testing deprecated code + err := s.keeper.ScheduleUpgrade(s.ctx, types.Plan{Name: "test", Height: skipOne}) require.NoError(t, err) t.Log("Verify if skip upgrade flag clears upgrade plan in one case and does upgrade on another") - VerifySet(t, map[int64]bool{skipOne: true}) + s.VerifySet(t, map[int64]bool{skipOne: true}) // Setting block height of proposal test newCtx = newCtx.WithHeaderInfo(header.Info{Height: skipOne}) - err = s.module.BeginBlock(newCtx) + _, err = s.preModule.PreBlock(newCtx) require.NoError(t, err) t.Log("Verify the second proposal is not skipped") - err = s.handler(s.ctx, &types.SoftwareUpgradeProposal{Title: "prop2", Plan: types.Plan{Name: "test2", Height: skipTwo}}) //nolint:staticcheck // we're testing deprecated code + err = s.keeper.ScheduleUpgrade(s.ctx, types.Plan{Name: "test2", Height: skipTwo}) require.NoError(t, err) // Setting block height of proposal test2 newCtx = newCtx.WithHeaderInfo(header.Info{Height: skipTwo}) - VerifyDoUpgradeWithCtx(t, newCtx, "test2") + s.VerifyDoUpgradeWithCtx(t, newCtx, "test2") t.Log("Verify first proposal is cleared and second is done") - VerifyNotDone(t, s.ctx, "test") - VerifyDone(t, s.ctx, "test2") + s.VerifyNotDone(t, s.ctx, "test") + s.VerifyDone(t, s.ctx, "test2") } func TestUpgradeSkippingOnlyTwo(t *testing.T) { @@ -322,49 +312,48 @@ func TestUpgradeSkippingOnlyTwo(t *testing.T) { newCtx := s.ctx - err := s.handler(s.ctx, &types.SoftwareUpgradeProposal{Title: "prop", Plan: types.Plan{Name: "test", Height: skipOne}}) //nolint:staticcheck // we're testing deprecated code + err := s.keeper.ScheduleUpgrade(s.ctx, types.Plan{Name: "test", Height: skipOne}) require.NoError(t, err) t.Log("Verify if skip upgrade flag clears upgrade plan in both cases and does third upgrade") - VerifySet(t, map[int64]bool{skipOne: true, skipTwo: true}) + s.VerifySet(t, map[int64]bool{skipOne: true, skipTwo: true}) // Setting block height of proposal test newCtx = newCtx.WithHeaderInfo(header.Info{Height: skipOne}) - err = s.module.BeginBlock(newCtx) + _, err = s.preModule.PreBlock(newCtx) require.NoError(t, err) // A new proposal with height in skipUpgradeHeights - err = s.handler(s.ctx, &types.SoftwareUpgradeProposal{Title: "prop2", Plan: types.Plan{Name: "test2", Height: skipTwo}}) //nolint:staticcheck // we're testing deprecated code + err = s.keeper.ScheduleUpgrade(s.ctx, types.Plan{Name: "test2", Height: skipTwo}) require.NoError(t, err) // Setting block height of proposal test2 newCtx = newCtx.WithHeaderInfo(header.Info{Height: skipTwo}) - err = s.module.BeginBlock(newCtx) + _, err = s.preModule.PreBlock(newCtx) require.NoError(t, err) t.Log("Verify a new proposal is not skipped") - err = s.handler(s.ctx, &types.SoftwareUpgradeProposal{Title: "prop3", Plan: types.Plan{Name: "test3", Height: skipThree}}) //nolint:staticcheck // we're testing deprecated code + err = s.keeper.ScheduleUpgrade(s.ctx, types.Plan{Name: "test3", Height: skipThree}) require.NoError(t, err) newCtx = newCtx.WithHeaderInfo(header.Info{Height: skipThree}) - VerifyDoUpgradeWithCtx(t, newCtx, "test3") + s.VerifyDoUpgradeWithCtx(t, newCtx, "test3") t.Log("Verify two proposals are cleared and third is done") - VerifyNotDone(t, s.ctx, "test") - VerifyNotDone(t, s.ctx, "test2") - VerifyDone(t, s.ctx, "test3") + s.VerifyNotDone(t, s.ctx, "test") + s.VerifyNotDone(t, s.ctx, "test2") + s.VerifyDone(t, s.ctx, "test3") } func TestUpgradeWithoutSkip(t *testing.T) { s := setupTest(t, 10, map[int64]bool{}) newCtx := s.ctx.WithHeaderInfo(header.Info{Height: s.ctx.HeaderInfo().Height + 1, Time: time.Now()}) - err := s.handler(s.ctx, &types.SoftwareUpgradeProposal{Title: "prop", Plan: types.Plan{Name: "test", Height: s.ctx.HeaderInfo().Height + 1}}) //nolint:staticcheck // we're testing deprecated code + err := s.keeper.ScheduleUpgrade(s.ctx, types.Plan{Name: "test", Height: s.ctx.HeaderInfo().Height + 1}) require.NoError(t, err) t.Log("Verify if upgrade happens without skip upgrade") - - err = s.module.BeginBlock(newCtx) + _, err = s.preModule.PreBlock(newCtx) require.ErrorContains(t, err, "UPGRADE \"test\" NEEDED at height:") - VerifyDoUpgrade(t) - VerifyDone(t, s.ctx, "test") + s.VerifyDoUpgrade(t) + s.VerifyDone(t, s.ctx, "test") } func TestDumpUpgradeInfoToFile(t *testing.T) { @@ -422,7 +411,7 @@ func TestBinaryVersion(t *testing.T) { return vm, nil }) - err := s.handler(s.ctx, &types.SoftwareUpgradeProposal{Title: "Upgrade test", Plan: types.Plan{Name: "test0", Height: s.ctx.HeaderInfo().Height + 2}}) //nolint:staticcheck // we're testing deprecated code + err := s.keeper.ScheduleUpgrade(s.ctx, types.Plan{Name: "test0", Height: s.ctx.HeaderInfo().Height + 2}) require.NoError(t, err) newCtx := s.ctx.WithHeaderInfo(header.Info{Height: 12}) @@ -438,7 +427,7 @@ func TestBinaryVersion(t *testing.T) { { "test panic: upgrade needed", func() sdk.Context { - err := s.handler(s.ctx, &types.SoftwareUpgradeProposal{Title: "Upgrade test", Plan: types.Plan{Name: "test2", Height: 13}}) //nolint:staticcheck // we're testing deprecated code + err := s.keeper.ScheduleUpgrade(s.ctx, types.Plan{Name: "test2", Height: 13}) require.NoError(t, err) newCtx := s.ctx.WithHeaderInfo(header.Info{Height: 13}) @@ -450,7 +439,7 @@ func TestBinaryVersion(t *testing.T) { for _, tc := range testCases { ctx := tc.preRun() - err := s.module.BeginBlock(ctx) + _, err := s.preModule.PreBlock(ctx) if tc.expectError { require.Error(t, err) } else { @@ -465,18 +454,16 @@ func TestDowngradeVerification(t *testing.T) { encCfg := moduletestutil.MakeTestEncodingConfig(upgrade.AppModuleBasic{}) key := storetypes.NewKVStoreKey(types.StoreKey) storeService := runtime.NewKVStoreService(key) - testCtx := testutil.DefaultContextWithDB(s.T(), key, storetypes.NewTransientStoreKey("transient_test")) + testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) ctx := testCtx.Ctx.WithHeaderInfo(header.Info{Time: time.Now(), Height: 10}) skip := map[int64]bool{} - tempDir := t.TempDir() - k := keeper.NewKeeper(skip, storeService, encCfg.Codec, tempDir, nil, authtypes.NewModuleAddress(govtypes.ModuleName).String()) + k := keeper.NewKeeper(skip, storeService, encCfg.Codec, t.TempDir(), nil, authtypes.NewModuleAddress(govtypes.ModuleName).String()) m := upgrade.NewAppModule(k, addresscodec.NewBech32Codec("cosmos")) - handler := upgrade.NewSoftwareUpgradeProposalHandler(k) // submit a plan. planName := "downgrade" - err := handler(ctx, &types.SoftwareUpgradeProposal{Title: "test", Plan: types.Plan{Name: planName, Height: ctx.HeaderInfo().Height + 1}}) //nolint:staticcheck // we're testing deprecated code + err := k.ScheduleUpgrade(ctx, types.Plan{Name: planName, Height: ctx.HeaderInfo().Height + 1}) require.NoError(t, err) ctx = ctx.WithHeaderInfo(header.Info{Height: ctx.HeaderInfo().Height + 1}) @@ -486,7 +473,8 @@ func TestDowngradeVerification(t *testing.T) { }) // successful upgrade. - require.NoError(t, m.BeginBlock(ctx)) + _, err = m.PreBlock(ctx) + require.NoError(t, err) ctx = ctx.WithHeaderInfo(header.Info{Height: ctx.HeaderInfo().Height + 1}) testCases := map[string]struct { @@ -502,8 +490,7 @@ func TestDowngradeVerification(t *testing.T) { }, "downgrade with an active plan": { preRun: func(k *keeper.Keeper, ctx sdk.Context, name string) { - handler := upgrade.NewSoftwareUpgradeProposalHandler(k) - err := handler(ctx, &types.SoftwareUpgradeProposal{Title: "test", Plan: types.Plan{Name: "another" + planName, Height: ctx.HeaderInfo().Height + 1}}) //nolint:staticcheck // we're testing deprecated code + err := k.ScheduleUpgrade(ctx, types.Plan{Name: "another" + planName, Height: ctx.HeaderInfo().Height + 1}) require.NoError(t, err, name) }, expectError: true, @@ -517,7 +504,7 @@ func TestDowngradeVerification(t *testing.T) { ctx, _ := ctx.CacheContext() // downgrade. now keeper does not have the handler. - k := keeper.NewKeeper(skip, storeService, encCfg.Codec, tempDir, nil, authtypes.NewModuleAddress(govtypes.ModuleName).String()) + k := keeper.NewKeeper(skip, storeService, encCfg.Codec, t.TempDir(), nil, authtypes.NewModuleAddress(govtypes.ModuleName).String()) m := upgrade.NewAppModule(k, addresscodec.NewBech32Codec("cosmos")) // assertions @@ -533,7 +520,7 @@ func TestDowngradeVerification(t *testing.T) { tc.preRun(k, ctx, name) } - err = m.BeginBlock(ctx) + _, err = m.PreBlock(ctx) if tc.expectError { require.Error(t, err, name) } else { diff --git a/x/upgrade/autocli.go b/x/upgrade/autocli.go new file mode 100644 index 000000000000..45d076c75eda --- /dev/null +++ b/x/upgrade/autocli.go @@ -0,0 +1,63 @@ +package upgrade + +import ( + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + upgradev1beta1 "cosmossdk.io/api/cosmos/upgrade/v1beta1" +) + +func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { + return &autocliv1.ModuleOptions{ + Query: &autocliv1.ServiceCommandDescriptor{ + Service: upgradev1beta1.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "CurrentPlan", + Use: "plan", + Short: "Query the upgrade plan (if one exists)", + Long: "Gets the currently scheduled upgrade plan, if one exists", + }, + { + RpcMethod: "AppliedPlan", + Use: "applied [upgrade-name]", + Short: "Query the block header for height at which a completed upgrade was applied", + Long: "If upgrade-name was previously executed on the chain, this returns the header for the block at which it was applied. This helps a client determine which binary was valid over a given range of blocks, as well as more context to understand past migrations.", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "name"}, + }, + }, + { + RpcMethod: "ModuleVersions", + Use: "module-versions [optional module_name]", + Alias: []string{"module_versions"}, + Short: "Query the list of module versions", + Long: "Gets a list of module names and their respective consensus versions. Following the command with a specific module name will return only that module's information.", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "module_name", Optional: true}, + }, + }, + { + RpcMethod: "Authority", + Use: "authority", + Short: "Get the upgrade authority address", + }, + { + RpcMethod: "UpgradedConsensusState", + Skip: true, // Skipping this command as the query is deprecated. + }, + }, + }, + Tx: &autocliv1.ServiceCommandDescriptor{ + Service: upgradev1beta1.Msg_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "SoftwareUpgrade", + Skip: true, // skipped because authority gated + }, + { + RpcMethod: "CancelUpgrade", + Skip: true, // skipped because authority gated + }, + }, + }, + } +} diff --git a/x/upgrade/client/cli/parse.go b/x/upgrade/client/cli/parse.go index 9cb0f3eccde1..8171ba2f4ef7 100644 --- a/x/upgrade/client/cli/parse.go +++ b/x/upgrade/client/cli/parse.go @@ -1,8 +1,9 @@ package cli import ( - "cosmossdk.io/x/upgrade/types" "github.com/spf13/pflag" + + "cosmossdk.io/x/upgrade/types" ) func parsePlan(fs *pflag.FlagSet, name string) (types.Plan, error) { diff --git a/x/upgrade/client/cli/parse_test.go b/x/upgrade/client/cli/parse_test.go index 3a3b38eb4105..d1869f24c2d8 100644 --- a/x/upgrade/client/cli/parse_test.go +++ b/x/upgrade/client/cli/parse_test.go @@ -4,10 +4,11 @@ import ( "strconv" "testing" - addresscodec "github.com/cosmos/cosmos-sdk/codec/address" "github.com/stretchr/testify/require" "cosmossdk.io/x/upgrade/types" + + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" ) func TestParsePlan(t *testing.T) { diff --git a/x/upgrade/client/cli/query.go b/x/upgrade/client/cli/query.go deleted file mode 100644 index a8ff931ad2ac..000000000000 --- a/x/upgrade/client/cli/query.go +++ /dev/null @@ -1,157 +0,0 @@ -package cli - -import ( - "fmt" - - "github.com/spf13/cobra" - - "cosmossdk.io/x/upgrade/types" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/types/errors" -) - -// GetQueryCmd returns the parent command for all x/upgrade CLI query commands. -func GetQueryCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: types.ModuleName, - Short: "Querying commands for the upgrade module", - } - - cmd.AddCommand( - GetCurrentPlanCmd(), - GetAppliedPlanCmd(), - GetModuleVersionsCmd(), - ) - - return cmd -} - -// GetCurrentPlanCmd returns the query upgrade plan command. -func GetCurrentPlanCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "plan", - Short: "get upgrade plan (if one exists)", - Long: "Gets the currently scheduled upgrade plan, if one exists", - Args: cobra.ExactArgs(0), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - params := types.QueryCurrentPlanRequest{} - res, err := queryClient.CurrentPlan(cmd.Context(), ¶ms) - if err != nil { - return err - } - - if res.Plan == nil { - return fmt.Errorf("no upgrade scheduled") - } - - return clientCtx.PrintProto(res.GetPlan()) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetAppliedPlanCmd returns information about the block at which a completed -// upgrade was applied. -func GetAppliedPlanCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "applied [upgrade-name]", - Short: "block header for height at which a completed upgrade was applied", - Long: "If upgrade-name was previously executed on the chain, this returns the header for the block at which it was applied.\n" + - "This helps a client determine which binary was valid over a given range of blocks, as well as more context to understand past migrations.", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - ctx := cmd.Context() - params := types.QueryAppliedPlanRequest{Name: args[0]} - res, err := queryClient.AppliedPlan(ctx, ¶ms) - if err != nil { - return err - } - - if res.Height == 0 { - return fmt.Errorf("no upgrade found") - } - - // we got the height, now let's return the headers - node, err := clientCtx.GetNode() - if err != nil { - return err - } - headers, err := node.BlockchainInfo(ctx, res.Height, res.Height) - if err != nil { - return err - } - if len(headers.BlockMetas) == 0 { - return fmt.Errorf("no headers returned for height %d", res.Height) - } - - // always output json as Header is unreable in toml ([]byte is a long list of numbers) - bz, err := clientCtx.LegacyAmino.MarshalJSONIndent(headers.BlockMetas[0], "", " ") - if err != nil { - return err - } - return clientCtx.PrintString(fmt.Sprintf("%s\n", bz)) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// GetModuleVersionsCmd returns the module version list from state -func GetModuleVersionsCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "module_versions [optional module_name]", - Short: "get the list of module versions", - Long: "Gets a list of module names and their respective consensus versions.\n" + - "Following the command with a specific module name will return only\n" + - "that module's information.", - Args: cobra.MaximumNArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - var params types.QueryModuleVersionsRequest - - if len(args) == 1 { - params = types.QueryModuleVersionsRequest{ModuleName: args[0]} - } else { - params = types.QueryModuleVersionsRequest{} - } - - res, err := queryClient.ModuleVersions(cmd.Context(), ¶ms) - if err != nil { - return err - } - - if res.ModuleVersions == nil { - return errors.ErrNotFound - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/upgrade/client/cli/query_test.go b/x/upgrade/client/cli/query_test.go deleted file mode 100644 index da890878b5be..000000000000 --- a/x/upgrade/client/cli/query_test.go +++ /dev/null @@ -1,177 +0,0 @@ -package cli_test - -import ( - "context" - "fmt" - "io" - "testing" - - rpcclientmock "github.com/cometbft/cometbft/rpc/client/mock" - "github.com/stretchr/testify/require" - - "cosmossdk.io/x/upgrade" - upgradecli "cosmossdk.io/x/upgrade/client/cli" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/crypto/keyring" - svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - testutilmod "github.com/cosmos/cosmos-sdk/types/module/testutil" -) - -func TestGetCurrentPlanCmd(t *testing.T) { - encCfg := testutilmod.MakeTestEncodingConfig(upgrade.AppModuleBasic{}) - kr := keyring.NewInMemory(encCfg.Codec) - baseCtx := client.Context{}. - WithKeyring(kr). - WithTxConfig(encCfg.TxConfig). - WithCodec(encCfg.Codec). - WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}). - WithAccountRetriever(client.MockAccountRetriever{}). - WithOutput(io.Discard). - WithChainID("test-chain") - - testCases := []struct { - name string - args []string - expCmdOutput string - }{ - { - name: "json output", - args: []string{fmt.Sprintf("--%s=json", flags.FlagOutput)}, - expCmdOutput: `[--output=json]`, - }, - { - name: "text output", - args: []string{fmt.Sprintf("--%s=text", flags.FlagOutput)}, - expCmdOutput: `[--output=text]`, - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - ctx := svrcmd.CreateExecuteContext(context.Background()) - - cmd := upgradecli.GetCurrentPlanCmd() - cmd.SetOut(io.Discard) - require.NotNil(t, cmd) - - cmd.SetContext(ctx) - cmd.SetArgs(tc.args) - - require.NoError(t, client.SetCmdClientContextHandler(baseCtx, cmd)) - - require.Contains(t, fmt.Sprint(cmd), "plan [] [] get upgrade plan (if one exists)") - require.Contains(t, fmt.Sprint(cmd), tc.expCmdOutput) - }) - } -} - -func TestGetAppliedPlanCmd(t *testing.T) { - encCfg := testutilmod.MakeTestEncodingConfig(upgrade.AppModuleBasic{}) - kr := keyring.NewInMemory(encCfg.Codec) - baseCtx := client.Context{}. - WithKeyring(kr). - WithTxConfig(encCfg.TxConfig). - WithCodec(encCfg.Codec). - WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}). - WithAccountRetriever(client.MockAccountRetriever{}). - WithOutput(io.Discard). - WithChainID("test-chain") - - testCases := []struct { - name string - args []string - expCmdOutput string - }{ - { - name: "json output", - args: []string{"test-upgrade", fmt.Sprintf("--%s=json", flags.FlagOutput)}, - expCmdOutput: `[test-upgrade --output=json]`, - }, - { - name: "text output", - args: []string{"test-upgrade", fmt.Sprintf("--%s=text", flags.FlagOutput)}, - expCmdOutput: `[test-upgrade --output=text]`, - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - ctx := svrcmd.CreateExecuteContext(context.Background()) - - cmd := upgradecli.GetAppliedPlanCmd() - cmd.SetOut(io.Discard) - require.NotNil(t, cmd) - - cmd.SetContext(ctx) - cmd.SetArgs(tc.args) - - require.NoError(t, client.SetCmdClientContextHandler(baseCtx, cmd)) - - require.Contains(t, fmt.Sprint(cmd), "applied [upgrade-name] [] [] block header for height at which a completed upgrade was applied") - require.Contains(t, fmt.Sprint(cmd), tc.expCmdOutput) - }) - } -} - -func TestGetModuleVersionsCmd(t *testing.T) { - encCfg := testutilmod.MakeTestEncodingConfig(upgrade.AppModuleBasic{}) - kr := keyring.NewInMemory(encCfg.Codec) - baseCtx := client.Context{}. - WithKeyring(kr). - WithTxConfig(encCfg.TxConfig). - WithCodec(encCfg.Codec). - WithClient(clitestutil.MockCometRPC{Client: rpcclientmock.Client{}}). - WithAccountRetriever(client.MockAccountRetriever{}). - WithOutput(io.Discard). - WithChainID("test-chain") - - testCases := []struct { - msg string - args []string - expCmdOutput string - }{ - { - msg: "test full query with json output", - args: []string{fmt.Sprintf("--%s=1", flags.FlagHeight), fmt.Sprintf("--%s=json", flags.FlagOutput)}, - expCmdOutput: `--height=1 --output=json`, - }, - { - msg: "test full query with text output", - args: []string{fmt.Sprintf("--%s=1", flags.FlagHeight), fmt.Sprintf("--%s=text", flags.FlagOutput)}, - expCmdOutput: `--height=1 --output=text`, - }, - { - msg: "test single module", - args: []string{"bank", fmt.Sprintf("--%s=1", flags.FlagHeight)}, - expCmdOutput: `bank --height=1`, - }, - { - msg: "test non-existent module", - args: []string{"abcdefg", fmt.Sprintf("--%s=1", flags.FlagHeight)}, - expCmdOutput: `abcdefg --height=1`, - }, - } - - for _, tc := range testCases { - tc := tc - - t.Run(tc.msg, func(t *testing.T) { - ctx := svrcmd.CreateExecuteContext(context.Background()) - - cmd := upgradecli.GetModuleVersionsCmd() - cmd.SetOut(io.Discard) - require.NotNil(t, cmd) - - cmd.SetContext(ctx) - cmd.SetArgs(tc.args) - - require.NoError(t, client.SetCmdClientContextHandler(baseCtx, cmd)) - - require.Contains(t, fmt.Sprint(cmd), "module_versions [optional module_name] [] [] get the list of module versions") - require.Contains(t, fmt.Sprint(cmd), tc.expCmdOutput) - }) - } -} diff --git a/x/upgrade/client/cli/tx.go b/x/upgrade/client/cli/tx.go index 893b74680e1f..294538fdc6d4 100644 --- a/x/upgrade/client/cli/tx.go +++ b/x/upgrade/client/cli/tx.go @@ -5,25 +5,27 @@ import ( "os" "path/filepath" + "github.com/spf13/cobra" + addresscodec "cosmossdk.io/core/address" + "cosmossdk.io/x/upgrade/plan" + "cosmossdk.io/x/upgrade/types" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/address" "github.com/cosmos/cosmos-sdk/x/gov/client/cli" - "github.com/spf13/cobra" - - "cosmossdk.io/x/upgrade/plan" - "cosmossdk.io/x/upgrade/types" ) const ( - FlagUpgradeHeight = "upgrade-height" - FlagUpgradeInfo = "upgrade-info" - FlagNoValidate = "no-validate" - FlagDaemonName = "daemon-name" - FlagAuthority = "authority" + FlagUpgradeHeight = "upgrade-height" + FlagUpgradeInfo = "upgrade-info" + FlagNoValidate = "no-validate" + FlagNoChecksumRequired = "no-checksum-required" + FlagDaemonName = "daemon-name" + FlagAuthority = "authority" ) // GetTxCmd returns the transaction commands for this module @@ -73,15 +75,21 @@ func NewCmdSubmitUpgradeProposal(ac addresscodec.Codec) *cobra.Command { } if !noValidate { - var daemonName string - if daemonName, err = cmd.Flags().GetString(FlagDaemonName); err != nil { + daemonName, err := cmd.Flags().GetString(FlagDaemonName) + if err != nil { + return err + } + + noChecksum, err := cmd.Flags().GetBool(FlagNoChecksumRequired) + if err != nil { return err } var planInfo *plan.Info - if planInfo, err = plan.ParseInfo(p.Info); err != nil { + if planInfo, err = plan.ParseInfo(p.Info, plan.ParseOptionEnforceChecksum(!noChecksum)); err != nil { return err } + if err = planInfo.ValidateFull(daemonName); err != nil { return err } @@ -102,7 +110,7 @@ func NewCmdSubmitUpgradeProposal(ac addresscodec.Codec) *cobra.Command { Plan: p, }, }); err != nil { - return fmt.Errorf("failed to create cancel upgrade message: %w", err) + return fmt.Errorf("failed to create submit upgrade proposal message: %w", err) } return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), proposal) @@ -112,6 +120,7 @@ func NewCmdSubmitUpgradeProposal(ac addresscodec.Codec) *cobra.Command { cmd.Flags().Int64(FlagUpgradeHeight, 0, "The height at which the upgrade must happen") cmd.Flags().String(FlagUpgradeInfo, "", "Info for the upgrade plan such as new version download urls, etc.") cmd.Flags().Bool(FlagNoValidate, false, "Skip validation of the upgrade info (dangerous!)") + cmd.Flags().Bool(FlagNoChecksumRequired, false, "Skip requirement of checksums for binaries in the upgrade info") cmd.Flags().String(FlagDaemonName, getDefaultDaemonName(), "The name of the executable being upgraded (for upgrade-info validation). Default is the DAEMON_NAME env var if set, or else this executable") cmd.Flags().String(FlagAuthority, "", "The address of the upgrade module authority (defaults to gov)") @@ -155,7 +164,7 @@ func NewCmdSubmitCancelUpgradeProposal(ac addresscodec.Codec) *cobra.Command { Authority: authority, }, }); err != nil { - return fmt.Errorf("failed to create cancel upgrade message: %w", err) + return fmt.Errorf("failed to create cancel upgrade proposal message: %w", err) } return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), proposal) diff --git a/x/upgrade/go.mod b/x/upgrade/go.mod index b155612820d8..271cab7dc5df 100644 --- a/x/upgrade/go.mod +++ b/x/upgrade/go.mod @@ -1,185 +1,210 @@ module cosmossdk.io/x/upgrade -go 1.20 +go 1.23.0 require ( - cosmossdk.io/api v0.4.2 - cosmossdk.io/core v0.8.0 - cosmossdk.io/depinject v1.0.0-alpha.3 - cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 - cosmossdk.io/log v1.1.0 - cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c - github.com/armon/go-metrics v0.4.1 - github.com/cometbft/cometbft v0.38.0-rc1 - github.com/cosmos/cosmos-db v1.0.0 - github.com/cosmos/cosmos-proto v1.0.0-beta.3 - github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230607182757-cfeb10287d61 - github.com/cosmos/gogoproto v1.4.10 - github.com/golang/protobuf v1.5.3 + cosmossdk.io/api v0.7.6 + cosmossdk.io/core v0.11.0 + cosmossdk.io/depinject v1.1.0 + cosmossdk.io/errors v1.0.1 + cosmossdk.io/log v1.5.0 + cosmossdk.io/store v1.1.1 + github.com/cometbft/cometbft v0.38.17 + github.com/cosmos/cosmos-db v1.1.1 + github.com/cosmos/cosmos-proto v1.0.0-beta.5 + github.com/cosmos/cosmos-sdk v0.50.13 + github.com/cosmos/gogoproto v1.7.0 + github.com/golang/protobuf v1.5.4 github.com/grpc-ecosystem/grpc-gateway v1.16.0 - github.com/hashicorp/go-getter v1.7.1 - github.com/spf13/cast v1.5.1 - github.com/spf13/cobra v1.7.0 - github.com/spf13/pflag v1.0.5 - github.com/stretchr/testify v1.8.4 - google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a - google.golang.org/grpc v1.55.0 - google.golang.org/protobuf v1.30.0 + github.com/hashicorp/go-cleanhttp v0.5.2 + github.com/hashicorp/go-getter v1.7.8 + github.com/hashicorp/go-metrics v0.5.4 + github.com/spf13/cast v1.7.1 + github.com/spf13/cobra v1.9.1 + github.com/spf13/pflag v1.0.6 + github.com/spf13/viper v1.20.0 + github.com/stretchr/testify v1.10.0 + google.golang.org/genproto/googleapis/api v0.0.0-20250224174004-546df14abb99 + google.golang.org/grpc v1.71.0 + google.golang.org/protobuf v1.36.5 ) require ( - cloud.google.com/go v0.110.0 // indirect - cloud.google.com/go/compute v1.19.0 // indirect - cloud.google.com/go/compute/metadata v0.2.3 // indirect - cloud.google.com/go/iam v0.13.0 // indirect - cloud.google.com/go/storage v1.30.0 // indirect - cosmossdk.io/collections v0.2.0 // indirect - cosmossdk.io/math v1.0.1 // indirect - cosmossdk.io/x/tx v0.8.0 // indirect + cel.dev/expr v0.19.1 // indirect + cloud.google.com/go v0.116.0 // indirect + cloud.google.com/go/auth v0.14.1 // indirect + cloud.google.com/go/auth/oauth2adapt v0.2.7 // indirect + cloud.google.com/go/compute/metadata v0.6.0 // indirect + cloud.google.com/go/iam v1.2.2 // indirect + cloud.google.com/go/monitoring v1.21.2 // indirect + cloud.google.com/go/storage v1.49.0 // indirect + cosmossdk.io/collections v0.4.0 // indirect + cosmossdk.io/math v1.5.0 // indirect + cosmossdk.io/x/tx v0.13.7 // indirect filippo.io/edwards25519 v1.0.0 // 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/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0 // indirect + github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.48.1 // indirect + github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.48.1 // indirect github.com/aws/aws-sdk-go v1.44.224 // 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 - github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect + github.com/bytedance/sonic v1.12.3 // indirect + github.com/bytedance/sonic/loader v0.2.0 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // indirect - github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chzyer/readline v1.5.1 // indirect - github.com/cockroachdb/errors v1.9.1 // indirect + github.com/cloudwego/base64x v0.1.4 // indirect + github.com/cloudwego/iasm v0.2.0 // indirect + github.com/cncf/xds/go v0.0.0-20241223141626-cff3c89139a3 // indirect + github.com/cockroachdb/apd/v3 v3.2.1 // indirect + github.com/cockroachdb/errors v1.11.3 // indirect + github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20230606152911-c4be581b807f // indirect - github.com/cockroachdb/redact v1.1.4 // indirect - github.com/cometbft/cometbft-db v0.7.0 // indirect + github.com/cockroachdb/pebble v1.1.2 // indirect + github.com/cockroachdb/redact v1.1.5 // indirect + github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect + github.com/cometbft/cometbft-db v0.14.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.0.0-beta.2 // indirect - github.com/cosmos/ics23/go v0.10.0 // indirect - github.com/cosmos/ledger-cosmos-go v0.13.0 // indirect + github.com/cosmos/iavl v1.2.2 // indirect + github.com/cosmos/ics23/go v0.11.0 // indirect + github.com/cosmos/ledger-cosmos-go v0.14.0 // indirect github.com/danieljoos/wincred v1.1.2 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect - github.com/dgraph-io/badger/v2 v2.2007.4 // indirect + github.com/dgraph-io/badger/v4 v4.2.0 // indirect 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/dvsekhvalnov/jose2go v1.5.0 // indirect - github.com/emicklei/dot v1.4.2 // indirect + github.com/dvsekhvalnov/jose2go v1.6.0 // indirect + github.com/emicklei/dot v1.6.2 // indirect + github.com/envoyproxy/go-control-plane/envoy v1.32.4 // indirect + github.com/envoyproxy/protoc-gen-validate v1.2.1 // indirect github.com/fatih/color v1.15.0 // indirect - github.com/felixge/httpsnoop v1.0.2 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/getsentry/sentry-go v0.21.0 // indirect - github.com/go-kit/kit v0.12.0 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect + github.com/getsentry/sentry-go v0.27.0 // indirect + github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect + github.com/go-logr/logr v1.4.2 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/googleapis v1.4.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/glog v1.1.0 // indirect + github.com/golang/glog v1.2.4 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/mock v1.6.0 // indirect github.com/golang/snappy v0.0.4 // indirect - github.com/google/btree v1.1.2 // indirect - github.com/google/go-cmp v0.5.9 // indirect + github.com/google/btree v1.1.3 // indirect + github.com/google/flatbuffers v2.0.8+incompatible // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/google/orderedcode v0.0.1 // indirect - github.com/google/s2a-go v0.1.3 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect - github.com/googleapis/gax-go/v2 v2.8.0 // indirect + github.com/google/s2a-go v0.1.9 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect + github.com/googleapis/gax-go/v2 v2.14.1 // indirect github.com/gorilla/handlers v1.5.1 // indirect github.com/gorilla/mux v1.8.0 // indirect - github.com/gorilla/websocket v1.5.0 // 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/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/go-plugin v1.4.10 // indirect + github.com/hashicorp/go-plugin v1.5.2 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-version v1.6.0 // indirect - github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect - github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/yamux v0.1.1 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect github.com/huandu/skiplist v1.2.0 // indirect - github.com/iancoleman/strcase v0.2.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/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.16.5 // indirect + github.com/klauspost/compress v1.17.9 // indirect + github.com/klauspost/cpuid/v2 v2.2.4 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect - github.com/lib/pq v1.10.7 // indirect - github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.0 // indirect - github.com/magiconair/properties v1.8.7 // indirect + github.com/lib/pq v1.10.9 // indirect + github.com/linxGnu/grocksdb v1.8.14 // 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.19 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/minio/highwayhash v1.0.2 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/minio/highwayhash v1.0.3 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect - github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect - github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.0.8 // indirect - github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761 // indirect + github.com/pelletier/go-toml/v2 v2.2.3 // indirect + github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.15.1 // indirect - github.com/prometheus/client_model v0.4.0 // indirect - github.com/prometheus/common v0.44.0 // indirect - github.com/prometheus/procfs v0.10.1 // indirect + github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/prometheus/client_golang v1.20.5 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.62.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.10.0 // indirect - github.com/rs/cors v1.8.3 // indirect - github.com/rs/zerolog v1.29.1 // indirect - github.com/sasha-s/go-deadlock v0.3.1 // indirect - github.com/spf13/afero v1.9.5 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/spf13/viper v1.16.0 // indirect - github.com/subosito/gotenv v1.4.2 // indirect + github.com/rogpeppe/go-internal v1.13.1 // indirect + github.com/rs/cors v1.11.1 // indirect + github.com/rs/zerolog v1.33.0 // indirect + github.com/sagikazarmark/locafero v0.7.0 // indirect + github.com/sasha-s/go-deadlock v0.3.5 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.12.0 // indirect + github.com/subosito/gotenv v1.6.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect - github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect github.com/tendermint/go-amino v0.16.0 // indirect - github.com/tidwall/btree v1.6.0 // indirect + github.com/tidwall/btree v1.7.0 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ulikunitz/xz v0.5.11 // indirect - github.com/zondax/hid v0.9.1 // indirect - github.com/zondax/ledger-go v0.14.1 // indirect - go.etcd.io/bbolt v1.3.6 // indirect + github.com/zondax/hid v0.9.2 // indirect + github.com/zondax/ledger-go v0.14.3 // indirect + go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 // indirect go.opencensus.io v0.24.0 // indirect - golang.org/x/crypto v0.9.0 // indirect - golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/oauth2 v0.8.0 // indirect - golang.org/x/sync v0.2.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/term v0.8.0 // indirect - golang.org/x/text v0.9.0 // indirect - golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect - google.golang.org/api v0.122.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20230525234025-438c736192d0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect - gopkg.in/ini.v1 v1.67.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect + go.opentelemetry.io/auto/sdk v1.1.0 // indirect + go.opentelemetry.io/contrib/detectors/gcp v1.34.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.58.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 // indirect + go.opentelemetry.io/otel v1.34.0 // indirect + go.opentelemetry.io/otel/metric v1.34.0 // indirect + go.opentelemetry.io/otel/sdk v1.34.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.34.0 // indirect + go.opentelemetry.io/otel/trace v1.34.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + golang.org/x/arch v0.3.0 // indirect + golang.org/x/crypto v0.35.0 // indirect + golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect + golang.org/x/net v0.35.0 // indirect + golang.org/x/oauth2 v0.27.0 // indirect + golang.org/x/sync v0.11.0 // indirect + golang.org/x/sys v0.30.0 // indirect + golang.org/x/term v0.29.0 // indirect + golang.org/x/text v0.22.0 // indirect + golang.org/x/time v0.10.0 // indirect + golang.org/x/tools v0.30.0 // indirect + google.golang.org/api v0.222.0 // indirect + google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - gotest.tools/v3 v3.4.0 // indirect + gotest.tools/v3 v3.5.2 // indirect nhooyr.io/websocket v1.8.6 // indirect - pgregory.net/rapid v0.6.2 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect + pgregory.net/rapid v1.1.0 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect ) // Fix upstream GHSA-h395-qcrw-5vmq and GHSA-3vp4-m3rf-835h vulnerabilities. // TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 -replace github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0 - -replace github.com/cosmos/cosmos-sdk => ../../ +replace github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.1 diff --git a/x/upgrade/go.sum b/x/upgrade/go.sum index 770aafce3bbe..7cea785ffef4 100644 --- a/x/upgrade/go.sum +++ b/x/upgrade/go.sum @@ -1,3 +1,5 @@ +cel.dev/expr v0.19.1 h1:NciYrtDRIR0lNCnH1LFJegdjspNx9fI59O7TWcua/W4= +cel.dev/expr v0.19.1/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= @@ -28,28 +30,96 @@ cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+Y cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= +cloud.google.com/go v0.100.1/go.mod h1:fs4QogzfH5n2pBXBP9vRiU+eCny7lD2vmFZy79Iuw1U= cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= -cloud.google.com/go v0.110.0 h1:Zc8gqp3+a9/Eyph2KDmcGaPtbKRIoqq4YTlL4NMD0Ys= +cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM= +cloud.google.com/go v0.107.0/go.mod h1:wpc2eNrD7hXUTy8EKS10jkxpZBjASrORK7goS+3YX2I= cloud.google.com/go v0.110.0/go.mod h1:SJnCLqQ0FCFGSZMUNUf84MV3Aia54kn7pi8st7tMzaY= +cloud.google.com/go v0.116.0 h1:B3fRrSDkLRt5qSHWe40ERJvhvnQwdZiHu0bJOpldweE= +cloud.google.com/go v0.116.0/go.mod h1:cEPSRWPzZEswwdr9BxE6ChEn01dWlTaF05LiC2Xs70U= +cloud.google.com/go/accessapproval v1.4.0/go.mod h1:zybIuC3KpDOvotz59lFe5qxRZx6C75OtwbisN56xYB4= +cloud.google.com/go/accessapproval v1.5.0/go.mod h1:HFy3tuiGvMdcd/u+Cu5b9NkO1pEICJ46IR82PoUdplw= +cloud.google.com/go/accessapproval v1.6.0/go.mod h1:R0EiYnwV5fsRFiKZkPHr6mwyk2wxUJ30nL4j2pcFY2E= +cloud.google.com/go/accesscontextmanager v1.3.0/go.mod h1:TgCBehyr5gNMz7ZaH9xubp+CE8dkrszb4oK9CWyvD4o= +cloud.google.com/go/accesscontextmanager v1.4.0/go.mod h1:/Kjh7BBu/Gh83sv+K60vN9QE5NJcd80sU33vIe2IFPE= +cloud.google.com/go/accesscontextmanager v1.6.0/go.mod h1:8XCvZWfYw3K/ji0iVnp+6pu7huxoQTLmxAbVjbloTtM= +cloud.google.com/go/accesscontextmanager v1.7.0/go.mod h1:CEGLewx8dwa33aDAZQujl7Dx+uYhS0eay198wB/VumQ= cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= +cloud.google.com/go/aiplatform v1.27.0/go.mod h1:Bvxqtl40l0WImSb04d0hXFU7gDOiq9jQmorivIiWcKg= +cloud.google.com/go/aiplatform v1.35.0/go.mod h1:7MFT/vCaOyZT/4IIFfxH4ErVg/4ku6lKv3w0+tFTgXQ= +cloud.google.com/go/aiplatform v1.36.1/go.mod h1:WTm12vJRPARNvJ+v6P52RDHCNe4AhvjcIZ/9/RRHy/k= +cloud.google.com/go/aiplatform v1.37.0/go.mod h1:IU2Cv29Lv9oCn/9LkFiiuKfwrRTq+QQMbW+hPCxJGZw= cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= cloud.google.com/go/analytics v0.12.0/go.mod h1:gkfj9h6XRf9+TS4bmuhPEShsh3hH8PAZzm/41OOhQd4= +cloud.google.com/go/analytics v0.17.0/go.mod h1:WXFa3WSym4IZ+JiKmavYdJwGG/CvpqiqczmL59bTD9M= +cloud.google.com/go/analytics v0.18.0/go.mod h1:ZkeHGQlcIPkw0R/GW+boWHhCOR43xz9RN/jn7WcqfIE= +cloud.google.com/go/analytics v0.19.0/go.mod h1:k8liqf5/HCnOUkbawNtrWWc+UAzyDlW89doe8TtoDsE= +cloud.google.com/go/apigateway v1.3.0/go.mod h1:89Z8Bhpmxu6AmUxuVRg/ECRGReEdiP3vQtk4Z1J9rJk= +cloud.google.com/go/apigateway v1.4.0/go.mod h1:pHVY9MKGaH9PQ3pJ4YLzoj6U5FUDeDFBllIz7WmzJoc= +cloud.google.com/go/apigateway v1.5.0/go.mod h1:GpnZR3Q4rR7LVu5951qfXPJCHquZt02jf7xQx7kpqN8= +cloud.google.com/go/apigeeconnect v1.3.0/go.mod h1:G/AwXFAKo0gIXkPTVfZDd2qA1TxBXJ3MgMRBQkIi9jc= +cloud.google.com/go/apigeeconnect v1.4.0/go.mod h1:kV4NwOKqjvt2JYR0AoIWo2QGfoRtn/pkS3QlHp0Ni04= +cloud.google.com/go/apigeeconnect v1.5.0/go.mod h1:KFaCqvBRU6idyhSNyn3vlHXc8VMDJdRmwDF6JyFRqZ8= +cloud.google.com/go/apigeeregistry v0.4.0/go.mod h1:EUG4PGcsZvxOXAdyEghIdXwAEi/4MEaoqLMLDMIwKXY= +cloud.google.com/go/apigeeregistry v0.5.0/go.mod h1:YR5+s0BVNZfVOUkMa5pAR2xGd0A473vA5M7j247o1wM= +cloud.google.com/go/apigeeregistry v0.6.0/go.mod h1:BFNzW7yQVLZ3yj0TKcwzb8n25CFBri51GVGOEUcgQsc= +cloud.google.com/go/apikeys v0.4.0/go.mod h1:XATS/yqZbaBK0HOssf+ALHp8jAlNHUgyfprvNcBIszU= +cloud.google.com/go/apikeys v0.5.0/go.mod h1:5aQfwY4D+ewMMWScd3hm2en3hCj+BROlyrt3ytS7KLI= +cloud.google.com/go/apikeys v0.6.0/go.mod h1:kbpXu5upyiAlGkKrJgQl8A0rKNNJ7dQ377pdroRSSi8= +cloud.google.com/go/appengine v1.4.0/go.mod h1:CS2NhuBuDXM9f+qscZ6V86m1MIIqPj3WC/UoEuR1Sno= +cloud.google.com/go/appengine v1.5.0/go.mod h1:TfasSozdkFI0zeoxW3PTBLiNqRmzraodCWatWI9Dmak= +cloud.google.com/go/appengine v1.6.0/go.mod h1:hg6i0J/BD2cKmDJbaFSYHFyZkgBEfQrDg/X0V5fJn84= +cloud.google.com/go/appengine v1.7.0/go.mod h1:eZqpbHFCqRGa2aCdope7eC0SWLV1j0neb/QnMJVWx6A= +cloud.google.com/go/appengine v1.7.1/go.mod h1:IHLToyb/3fKutRysUlFO0BPt5j7RiQ45nrzEJmKTo6E= cloud.google.com/go/area120 v0.5.0/go.mod h1:DE/n4mp+iqVyvxHN41Vf1CR602GiHQjFPusMFW6bGR4= cloud.google.com/go/area120 v0.6.0/go.mod h1:39yFJqWVgm0UZqWTOdqkLhjoC7uFfgXRC8g/ZegeAh0= +cloud.google.com/go/area120 v0.7.0/go.mod h1:a3+8EUD1SX5RUcCs3MY5YasiO1z6yLiNLRiFrykbynY= +cloud.google.com/go/area120 v0.7.1/go.mod h1:j84i4E1RboTWjKtZVWXPqvK5VHQFJRF2c1Nm69pWm9k= cloud.google.com/go/artifactregistry v1.6.0/go.mod h1:IYt0oBPSAGYj/kprzsBjZ/4LnG/zOcHyFHjWPCi6SAQ= cloud.google.com/go/artifactregistry v1.7.0/go.mod h1:mqTOFOnGZx8EtSqK/ZWcsm/4U8B77rbcLP6ruDU2Ixk= +cloud.google.com/go/artifactregistry v1.8.0/go.mod h1:w3GQXkJX8hiKN0v+at4b0qotwijQbYUqF2GWkZzAhC0= +cloud.google.com/go/artifactregistry v1.9.0/go.mod h1:2K2RqvA2CYvAeARHRkLDhMDJ3OXy26h3XW+3/Jh2uYc= +cloud.google.com/go/artifactregistry v1.11.1/go.mod h1:lLYghw+Itq9SONbCa1YWBoWs1nOucMH0pwXN1rOBZFI= +cloud.google.com/go/artifactregistry v1.11.2/go.mod h1:nLZns771ZGAwVLzTX/7Al6R9ehma4WUEhZGWV6CeQNQ= +cloud.google.com/go/artifactregistry v1.12.0/go.mod h1:o6P3MIvtzTOnmvGagO9v/rOjjA0HmhJ+/6KAXrmYDCI= +cloud.google.com/go/artifactregistry v1.13.0/go.mod h1:uy/LNfoOIivepGhooAUpL1i30Hgee3Cu0l4VTWHUC08= cloud.google.com/go/asset v1.5.0/go.mod h1:5mfs8UvcM5wHhqtSv8J1CtxxaQq3AdBxxQi2jGW/K4o= cloud.google.com/go/asset v1.7.0/go.mod h1:YbENsRK4+xTiL+Ofoj5Ckf+O17kJtgp3Y3nn4uzZz5s= cloud.google.com/go/asset v1.8.0/go.mod h1:mUNGKhiqIdbr8X7KNayoYvyc4HbbFO9URsjbytpUaW0= +cloud.google.com/go/asset v1.9.0/go.mod h1:83MOE6jEJBMqFKadM9NLRcs80Gdw76qGuHn8m3h8oHQ= +cloud.google.com/go/asset v1.10.0/go.mod h1:pLz7uokL80qKhzKr4xXGvBQXnzHn5evJAEAtZiIb0wY= +cloud.google.com/go/asset v1.11.1/go.mod h1:fSwLhbRvC9p9CXQHJ3BgFeQNM4c9x10lqlrdEUYXlJo= +cloud.google.com/go/asset v1.12.0/go.mod h1:h9/sFOa4eDIyKmH6QMpm4eUK3pDojWnUhTgJlk762Hg= +cloud.google.com/go/asset v1.13.0/go.mod h1:WQAMyYek/b7NBpYq/K4KJWcRqzoalEsxz/t/dTk4THw= cloud.google.com/go/assuredworkloads v1.5.0/go.mod h1:n8HOZ6pff6re5KYfBXcFvSViQjDwxFkAkmUFffJRbbY= cloud.google.com/go/assuredworkloads v1.6.0/go.mod h1:yo2YOk37Yc89Rsd5QMVECvjaMKymF9OP+QXWlKXUkXw= cloud.google.com/go/assuredworkloads v1.7.0/go.mod h1:z/736/oNmtGAyU47reJgGN+KVoYoxeLBoj4XkKYscNI= +cloud.google.com/go/assuredworkloads v1.8.0/go.mod h1:AsX2cqyNCOvEQC8RMPnoc0yEarXQk6WEKkxYfL6kGIo= +cloud.google.com/go/assuredworkloads v1.9.0/go.mod h1:kFuI1P78bplYtT77Tb1hi0FMxM0vVpRC7VVoJC3ZoT0= +cloud.google.com/go/assuredworkloads v1.10.0/go.mod h1:kwdUQuXcedVdsIaKgKTp9t0UJkE5+PAVNhdQm4ZVq2E= +cloud.google.com/go/auth v0.14.1 h1:AwoJbzUdxA/whv1qj3TLKwh3XX5sikny2fc40wUl+h0= +cloud.google.com/go/auth v0.14.1/go.mod h1:4JHUxlGXisL0AW8kXPtUF6ztuOksyfUQNFjfsOCXkPM= +cloud.google.com/go/auth/oauth2adapt v0.2.7 h1:/Lc7xODdqcEw8IrZ9SvwnlLX6j9FHQM74z6cBk9Rw6M= +cloud.google.com/go/auth/oauth2adapt v0.2.7/go.mod h1:NTbTTzfvPl1Y3V1nPpOgl2w6d/FjO7NNUQaWSox6ZMc= cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0= cloud.google.com/go/automl v1.6.0/go.mod h1:ugf8a6Fx+zP0D59WLhqgTDsQI9w07o64uf/Is3Nh5p8= +cloud.google.com/go/automl v1.7.0/go.mod h1:RL9MYCCsJEOmt0Wf3z9uzG0a7adTT1fe+aObgSpkCt8= +cloud.google.com/go/automl v1.8.0/go.mod h1:xWx7G/aPEe/NP+qzYXktoBSDfjO+vnKMGgsApGJJquM= +cloud.google.com/go/automl v1.12.0/go.mod h1:tWDcHDp86aMIuHmyvjuKeeHEGq76lD7ZqfGLN6B0NuU= +cloud.google.com/go/baremetalsolution v0.3.0/go.mod h1:XOrocE+pvK1xFfleEnShBlNAXf+j5blPPxrhjKgnIFc= +cloud.google.com/go/baremetalsolution v0.4.0/go.mod h1:BymplhAadOO/eBa7KewQ0Ppg4A4Wplbn+PsFKRLo0uI= +cloud.google.com/go/baremetalsolution v0.5.0/go.mod h1:dXGxEkmR9BMwxhzBhV0AioD0ULBmuLZI8CdwalUxuss= +cloud.google.com/go/batch v0.3.0/go.mod h1:TR18ZoAekj1GuirsUsR1ZTKN3FC/4UDnScjT8NXImFE= +cloud.google.com/go/batch v0.4.0/go.mod h1:WZkHnP43R/QCGQsZ+0JyG4i79ranE2u8xvjq/9+STPE= +cloud.google.com/go/batch v0.7.0/go.mod h1:vLZN95s6teRUqRQ4s3RLDsH8PvboqBK+rn1oevL159g= +cloud.google.com/go/beyondcorp v0.2.0/go.mod h1:TB7Bd+EEtcw9PCPQhCJtJGjk/7TC6ckmnSFS+xwTfm4= +cloud.google.com/go/beyondcorp v0.3.0/go.mod h1:E5U5lcrcXMsCuoDNyGrpyTm/hn7ne941Jz2vmksAxW8= +cloud.google.com/go/beyondcorp v0.4.0/go.mod h1:3ApA0mbhHx6YImmuubf5pyW8srKnCEPON32/5hj+RmM= +cloud.google.com/go/beyondcorp v0.5.0/go.mod h1:uFqj9X+dSfrheVp7ssLTaRHd2EHqSL4QZmH4e8WXGGU= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -57,12 +127,44 @@ cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUM cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/bigquery v1.42.0/go.mod h1:8dRTJxhtG+vwBKzE5OseQn/hiydoQN3EedCaOdYmxRA= +cloud.google.com/go/bigquery v1.43.0/go.mod h1:ZMQcXHsl+xmU1z36G2jNGZmKp9zNY5BUua5wDgmNCfw= +cloud.google.com/go/bigquery v1.44.0/go.mod h1:0Y33VqXTEsbamHJvJHdFmtqHvMIY28aK1+dFsvaChGc= +cloud.google.com/go/bigquery v1.47.0/go.mod h1:sA9XOgy0A8vQK9+MWhEQTY6Tix87M/ZurWFIxmF9I/E= +cloud.google.com/go/bigquery v1.48.0/go.mod h1:QAwSz+ipNgfL5jxiaK7weyOhzdoAy1zFm0Nf1fysJac= +cloud.google.com/go/bigquery v1.49.0/go.mod h1:Sv8hMmTFFYBlt/ftw2uN6dFdQPzBlREY9yBh7Oy7/4Q= +cloud.google.com/go/bigquery v1.50.0/go.mod h1:YrleYEh2pSEbgTBZYMJ5SuSr0ML3ypjRB1zgf7pvQLU= cloud.google.com/go/billing v1.4.0/go.mod h1:g9IdKBEFlItS8bTtlrZdVLWSSdSyFUZKXNS02zKMOZY= cloud.google.com/go/billing v1.5.0/go.mod h1:mztb1tBc3QekhjSgmpf/CV4LzWXLzCArwpLmP2Gm88s= +cloud.google.com/go/billing v1.6.0/go.mod h1:WoXzguj+BeHXPbKfNWkqVtDdzORazmCjraY+vrxcyvI= +cloud.google.com/go/billing v1.7.0/go.mod h1:q457N3Hbj9lYwwRbnlD7vUpyjq6u5U1RAOArInEiD5Y= +cloud.google.com/go/billing v1.12.0/go.mod h1:yKrZio/eu+okO/2McZEbch17O5CB5NpZhhXG6Z766ss= +cloud.google.com/go/billing v1.13.0/go.mod h1:7kB2W9Xf98hP9Sr12KfECgfGclsH3CQR0R08tnRlRbc= cloud.google.com/go/binaryauthorization v1.1.0/go.mod h1:xwnoWu3Y84jbuHa0zd526MJYmtnVXn0syOjaJgy4+dM= cloud.google.com/go/binaryauthorization v1.2.0/go.mod h1:86WKkJHtRcv5ViNABtYMhhNWRrD1Vpi//uKEy7aYEfI= +cloud.google.com/go/binaryauthorization v1.3.0/go.mod h1:lRZbKgjDIIQvzYQS1p99A7/U1JqvqeZg0wiI5tp6tg0= +cloud.google.com/go/binaryauthorization v1.4.0/go.mod h1:tsSPQrBd77VLplV70GUhBf/Zm3FsKmgSqgm4UmiDItk= +cloud.google.com/go/binaryauthorization v1.5.0/go.mod h1:OSe4OU1nN/VswXKRBmciKpo9LulY41gch5c68htf3/Q= +cloud.google.com/go/certificatemanager v1.3.0/go.mod h1:n6twGDvcUBFu9uBgt4eYvvf3sQ6My8jADcOVwHmzadg= +cloud.google.com/go/certificatemanager v1.4.0/go.mod h1:vowpercVFyqs8ABSmrdV+GiFf2H/ch3KyudYQEMM590= +cloud.google.com/go/certificatemanager v1.6.0/go.mod h1:3Hh64rCKjRAX8dXgRAyOcY5vQ/fE1sh8o+Mdd6KPgY8= +cloud.google.com/go/channel v1.8.0/go.mod h1:W5SwCXDJsq/rg3tn3oG0LOxpAo6IMxNa09ngphpSlnk= +cloud.google.com/go/channel v1.9.0/go.mod h1:jcu05W0my9Vx4mt3/rEHpfxc9eKi9XwsdDL8yBMbKUk= +cloud.google.com/go/channel v1.11.0/go.mod h1:IdtI0uWGqhEeatSB62VOoJ8FSUhJ9/+iGkJVqp74CGE= +cloud.google.com/go/channel v1.12.0/go.mod h1:VkxCGKASi4Cq7TbXxlaBezonAYpp1GCnKMY6tnMQnLU= +cloud.google.com/go/cloudbuild v1.3.0/go.mod h1:WequR4ULxlqvMsjDEEEFnOG5ZSRSgWOywXYDb1vPE6U= +cloud.google.com/go/cloudbuild v1.4.0/go.mod h1:5Qwa40LHiOXmz3386FrjrYM93rM/hdRr7b53sySrTqA= +cloud.google.com/go/cloudbuild v1.6.0/go.mod h1:UIbc/w9QCbH12xX+ezUsgblrWv+Cv4Tw83GiSMHOn9M= +cloud.google.com/go/cloudbuild v1.7.0/go.mod h1:zb5tWh2XI6lR9zQmsm1VRA+7OCuve5d8S+zJUul8KTg= +cloud.google.com/go/cloudbuild v1.9.0/go.mod h1:qK1d7s4QlO0VwfYn5YuClDGg2hfmLZEb4wQGAbIgL1s= +cloud.google.com/go/clouddms v1.3.0/go.mod h1:oK6XsCDdW4Ib3jCCBugx+gVjevp2TMXFtgxvPSee3OM= +cloud.google.com/go/clouddms v1.4.0/go.mod h1:Eh7sUGCC+aKry14O1NRljhjyrr0NFC0G2cjwX0cByRk= +cloud.google.com/go/clouddms v1.5.0/go.mod h1:QSxQnhikCLUw13iAbffF2CZxAER3xDGNHjsTAkQJcQA= cloud.google.com/go/cloudtasks v1.5.0/go.mod h1:fD92REy1x5woxkKEkLdvavGnPJGEn8Uic9nWuLzqCpY= cloud.google.com/go/cloudtasks v1.6.0/go.mod h1:C6Io+sxuke9/KNRkbQpihnW93SWDU3uXt92nu85HkYI= +cloud.google.com/go/cloudtasks v1.7.0/go.mod h1:ImsfdYWwlWNJbdgPIIGJWC+gemEGTBK/SunNQQNCAb4= +cloud.google.com/go/cloudtasks v1.8.0/go.mod h1:gQXUIwCSOI4yPVK7DgTVFiiP0ZW/eQkydWzwVMdHxrI= +cloud.google.com/go/cloudtasks v1.9.0/go.mod h1:w+EyLsVkLWHcOaqNEyvcKAsWp9p29dL6uL9Nst1cI7Y= +cloud.google.com/go/cloudtasks v1.10.0/go.mod h1:NDSoTLkZ3+vExFEWu2UJV1arUyzVDAiZtdWcsUyNwBs= cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= @@ -70,102 +172,368 @@ cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= -cloud.google.com/go/compute v1.19.0 h1:+9zda3WGgW1ZSTlVppLCYFIr48Pa35q1uG2N1itbCEQ= +cloud.google.com/go/compute v1.12.0/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= +cloud.google.com/go/compute v1.12.1/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= +cloud.google.com/go/compute v1.13.0/go.mod h1:5aPTS0cUNMIc1CE546K+Th6weJUNQErARyZtRXDJ8GE= +cloud.google.com/go/compute v1.14.0/go.mod h1:YfLtxrj9sU4Yxv+sXzZkyPjEyPBZfXHUvjxega5vAdo= +cloud.google.com/go/compute v1.15.1/go.mod h1:bjjoF/NtFUrkD/urWfdHaKuOPDR5nWIs63rR+SXhcpA= +cloud.google.com/go/compute v1.18.0/go.mod h1:1X7yHxec2Ga+Ss6jPyjxRxpu2uu7PLgsOVXvgU0yacs= cloud.google.com/go/compute v1.19.0/go.mod h1:rikpw2y+UMidAe9tISo04EHNOIf42RLYF/q8Bs93scU= -cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= +cloud.google.com/go/compute v1.19.1/go.mod h1:6ylj3a05WF8leseCdIf77NK0g1ey+nj5IKd5/kvShxE= +cloud.google.com/go/compute/metadata v0.1.0/go.mod h1:Z1VN+bulIf6bt4P/C37K4DyZYZEXYonfTBHHFPO/4UU= +cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +cloud.google.com/go/compute/metadata v0.6.0 h1:A6hENjEsCDtC1k8byVsgwvVcioamEHvZ4j01OwKxG9I= +cloud.google.com/go/compute/metadata v0.6.0/go.mod h1:FjyFAW1MW0C203CEOMDTu3Dk1FlqW3Rga40jzHL4hfg= +cloud.google.com/go/contactcenterinsights v1.3.0/go.mod h1:Eu2oemoePuEFc/xKFPjbTuPSj0fYJcPls9TFlPNnHHY= +cloud.google.com/go/contactcenterinsights v1.4.0/go.mod h1:L2YzkGbPsv+vMQMCADxJoT9YiTTnSEd6fEvCeHTYVck= +cloud.google.com/go/contactcenterinsights v1.6.0/go.mod h1:IIDlT6CLcDoyv79kDv8iWxMSTZhLxSCofVV5W6YFM/w= +cloud.google.com/go/container v1.6.0/go.mod h1:Xazp7GjJSeUYo688S+6J5V+n/t+G5sKBTFkKNudGRxg= +cloud.google.com/go/container v1.7.0/go.mod h1:Dp5AHtmothHGX3DwwIHPgq45Y8KmNsgN3amoYfxVkLo= +cloud.google.com/go/container v1.13.1/go.mod h1:6wgbMPeQRw9rSnKBCAJXnds3Pzj03C4JHamr8asWKy4= +cloud.google.com/go/container v1.14.0/go.mod h1:3AoJMPhHfLDxLvrlVWaK57IXzaPnLaZq63WX59aQBfM= +cloud.google.com/go/container v1.15.0/go.mod h1:ft+9S0WGjAyjDggg5S06DXj+fHJICWg8L7isCQe9pQA= cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= +cloud.google.com/go/containeranalysis v0.7.0/go.mod h1:9aUL+/vZ55P2CXfuZjS4UjQ9AgXoSw8Ts6lemfmxBxI= +cloud.google.com/go/containeranalysis v0.9.0/go.mod h1:orbOANbwk5Ejoom+s+DUCTTJ7IBdBQJDcSylAx/on9s= cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0= cloud.google.com/go/datacatalog v1.5.0/go.mod h1:M7GPLNQeLfWqeIm3iuiruhPzkt65+Bx8dAKvScX8jvs= cloud.google.com/go/datacatalog v1.6.0/go.mod h1:+aEyF8JKg+uXcIdAmmaMUmZ3q1b/lKLtXCmXdnc0lbc= +cloud.google.com/go/datacatalog v1.7.0/go.mod h1:9mEl4AuDYWw81UGc41HonIHH7/sn52H0/tc8f8ZbZIE= +cloud.google.com/go/datacatalog v1.8.0/go.mod h1:KYuoVOv9BM8EYz/4eMFxrr4DUKhGIOXxZoKYF5wdISM= +cloud.google.com/go/datacatalog v1.8.1/go.mod h1:RJ58z4rMp3gvETA465Vg+ag8BGgBdnRPEMMSTr5Uv+M= +cloud.google.com/go/datacatalog v1.12.0/go.mod h1:CWae8rFkfp6LzLumKOnmVh4+Zle4A3NXLzVJ1d1mRm0= +cloud.google.com/go/datacatalog v1.13.0/go.mod h1:E4Rj9a5ZtAxcQJlEBTLgMTphfP11/lNaAshpoBgemX8= cloud.google.com/go/dataflow v0.6.0/go.mod h1:9QwV89cGoxjjSR9/r7eFDqqjtvbKxAK2BaYU6PVk9UM= cloud.google.com/go/dataflow v0.7.0/go.mod h1:PX526vb4ijFMesO1o202EaUmouZKBpjHsTlCtB4parQ= +cloud.google.com/go/dataflow v0.8.0/go.mod h1:Rcf5YgTKPtQyYz8bLYhFoIV/vP39eL7fWNcSOyFfLJE= cloud.google.com/go/dataform v0.3.0/go.mod h1:cj8uNliRlHpa6L3yVhDOBrUXH+BPAO1+KFMQQNSThKo= cloud.google.com/go/dataform v0.4.0/go.mod h1:fwV6Y4Ty2yIFL89huYlEkwUPtS7YZinZbzzj5S9FzCE= +cloud.google.com/go/dataform v0.5.0/go.mod h1:GFUYRe8IBa2hcomWplodVmUx/iTL0FrsauObOM3Ipr0= +cloud.google.com/go/dataform v0.6.0/go.mod h1:QPflImQy33e29VuapFdf19oPbE4aYTJxr31OAPV+ulA= +cloud.google.com/go/dataform v0.7.0/go.mod h1:7NulqnVozfHvWUBpMDfKMUESr+85aJsC/2O0o3jWPDE= +cloud.google.com/go/datafusion v1.4.0/go.mod h1:1Zb6VN+W6ALo85cXnM1IKiPw+yQMKMhB9TsTSRDo/38= +cloud.google.com/go/datafusion v1.5.0/go.mod h1:Kz+l1FGHB0J+4XF2fud96WMmRiq/wj8N9u007vyXZ2w= +cloud.google.com/go/datafusion v1.6.0/go.mod h1:WBsMF8F1RhSXvVM8rCV3AeyWVxcC2xY6vith3iw3S+8= cloud.google.com/go/datalabeling v0.5.0/go.mod h1:TGcJ0G2NzcsXSE/97yWjIZO0bXj0KbVlINXMG9ud42I= cloud.google.com/go/datalabeling v0.6.0/go.mod h1:WqdISuk/+WIGeMkpw/1q7bK/tFEZxsrFJOJdY2bXvTQ= +cloud.google.com/go/datalabeling v0.7.0/go.mod h1:WPQb1y08RJbmpM3ww0CSUAGweL0SxByuW2E+FU+wXcM= +cloud.google.com/go/dataplex v1.3.0/go.mod h1:hQuRtDg+fCiFgC8j0zV222HvzFQdRd+SVX8gdmFcZzA= +cloud.google.com/go/dataplex v1.4.0/go.mod h1:X51GfLXEMVJ6UN47ESVqvlsRplbLhcsAt0kZCCKsU0A= +cloud.google.com/go/dataplex v1.5.2/go.mod h1:cVMgQHsmfRoI5KFYq4JtIBEUbYwc3c7tXmIDhRmNNVQ= +cloud.google.com/go/dataplex v1.6.0/go.mod h1:bMsomC/aEJOSpHXdFKFGQ1b0TDPIeL28nJObeO1ppRs= +cloud.google.com/go/dataproc v1.7.0/go.mod h1:CKAlMjII9H90RXaMpSxQ8EU6dQx6iAYNPcYPOkSbi8s= +cloud.google.com/go/dataproc v1.8.0/go.mod h1:5OW+zNAH0pMpw14JVrPONsxMQYMBqJuzORhIBfBn9uI= +cloud.google.com/go/dataproc v1.12.0/go.mod h1:zrF3aX0uV3ikkMz6z4uBbIKyhRITnxvr4i3IjKsKrw4= cloud.google.com/go/dataqna v0.5.0/go.mod h1:90Hyk596ft3zUQ8NkFfvICSIfHFh1Bc7C4cK3vbhkeo= cloud.google.com/go/dataqna v0.6.0/go.mod h1:1lqNpM7rqNLVgWBJyk5NF6Uen2PHym0jtVJonplVsDA= +cloud.google.com/go/dataqna v0.7.0/go.mod h1:Lx9OcIIeqCrw1a6KdO3/5KMP1wAmTc0slZWwP12Qq3c= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/datastore v1.10.0/go.mod h1:PC5UzAmDEkAmkfaknstTYbNpgE49HAgW2J1gcgUfmdM= +cloud.google.com/go/datastore v1.11.0/go.mod h1:TvGxBIHCS50u8jzG+AW/ppf87v1of8nwzFNgEZU1D3c= cloud.google.com/go/datastream v1.2.0/go.mod h1:i/uTP8/fZwgATHS/XFu0TcNUhuA0twZxxQ3EyCUQMwo= cloud.google.com/go/datastream v1.3.0/go.mod h1:cqlOX8xlyYF/uxhiKn6Hbv6WjwPPuI9W2M9SAXwaLLQ= +cloud.google.com/go/datastream v1.4.0/go.mod h1:h9dpzScPhDTs5noEMQVWP8Wx8AFBRyS0s8KWPx/9r0g= +cloud.google.com/go/datastream v1.5.0/go.mod h1:6TZMMNPwjUqZHBKPQ1wwXpb0d5VDVPl2/XoS5yi88q4= +cloud.google.com/go/datastream v1.6.0/go.mod h1:6LQSuswqLa7S4rPAOZFVjHIG3wJIjZcZrw8JDEDJuIs= +cloud.google.com/go/datastream v1.7.0/go.mod h1:uxVRMm2elUSPuh65IbZpzJNMbuzkcvu5CjMqVIUHrww= +cloud.google.com/go/deploy v1.4.0/go.mod h1:5Xghikd4VrmMLNaF6FiRFDlHb59VM59YoDQnOUdsH/c= +cloud.google.com/go/deploy v1.5.0/go.mod h1:ffgdD0B89tToyW/U/D2eL0jN2+IEV/3EMuXHA0l4r+s= +cloud.google.com/go/deploy v1.6.0/go.mod h1:f9PTHehG/DjCom3QH0cntOVRm93uGBDt2vKzAPwpXQI= +cloud.google.com/go/deploy v1.8.0/go.mod h1:z3myEJnA/2wnB4sgjqdMfgxCA0EqC3RBTNcVPs93mtQ= cloud.google.com/go/dialogflow v1.15.0/go.mod h1:HbHDWs33WOGJgn6rfzBW1Kv807BE3O1+xGbn59zZWI4= cloud.google.com/go/dialogflow v1.16.1/go.mod h1:po6LlzGfK+smoSmTBnbkIZY2w8ffjz/RcGSS+sh1el0= cloud.google.com/go/dialogflow v1.17.0/go.mod h1:YNP09C/kXA1aZdBgC/VtXX74G/TKn7XVCcVumTflA+8= +cloud.google.com/go/dialogflow v1.18.0/go.mod h1:trO7Zu5YdyEuR+BhSNOqJezyFQ3aUzz0njv7sMx/iek= +cloud.google.com/go/dialogflow v1.19.0/go.mod h1:JVmlG1TwykZDtxtTXujec4tQ+D8SBFMoosgy+6Gn0s0= +cloud.google.com/go/dialogflow v1.29.0/go.mod h1:b+2bzMe+k1s9V+F2jbJwpHPzrnIyHihAdRFMtn2WXuM= +cloud.google.com/go/dialogflow v1.31.0/go.mod h1:cuoUccuL1Z+HADhyIA7dci3N5zUssgpBJmCzI6fNRB4= +cloud.google.com/go/dialogflow v1.32.0/go.mod h1:jG9TRJl8CKrDhMEcvfcfFkkpp8ZhgPz3sBGmAUYJ2qE= +cloud.google.com/go/dlp v1.6.0/go.mod h1:9eyB2xIhpU0sVwUixfBubDoRwP+GjeUoxxeueZmqvmM= +cloud.google.com/go/dlp v1.7.0/go.mod h1:68ak9vCiMBjbasxeVD17hVPxDEck+ExiHavX8kiHG+Q= +cloud.google.com/go/dlp v1.9.0/go.mod h1:qdgmqgTyReTz5/YNSSuueR8pl7hO0o9bQ39ZhtgkWp4= cloud.google.com/go/documentai v1.7.0/go.mod h1:lJvftZB5NRiFSX4moiye1SMxHx0Bc3x1+p9e/RfXYiU= cloud.google.com/go/documentai v1.8.0/go.mod h1:xGHNEB7CtsnySCNrCFdCyyMz44RhFEEX2Q7UD0c5IhU= +cloud.google.com/go/documentai v1.9.0/go.mod h1:FS5485S8R00U10GhgBC0aNGrJxBP8ZVpEeJ7PQDZd6k= +cloud.google.com/go/documentai v1.10.0/go.mod h1:vod47hKQIPeCfN2QS/jULIvQTugbmdc0ZvxxfQY1bg4= +cloud.google.com/go/documentai v1.16.0/go.mod h1:o0o0DLTEZ+YnJZ+J4wNfTxmDVyrkzFvttBXXtYRMHkM= +cloud.google.com/go/documentai v1.18.0/go.mod h1:F6CK6iUH8J81FehpskRmhLq/3VlwQvb7TvwOceQ2tbs= cloud.google.com/go/domains v0.6.0/go.mod h1:T9Rz3GasrpYk6mEGHh4rymIhjlnIuB4ofT1wTxDeT4Y= cloud.google.com/go/domains v0.7.0/go.mod h1:PtZeqS1xjnXuRPKE/88Iru/LdfoRyEHYA9nFQf4UKpg= +cloud.google.com/go/domains v0.8.0/go.mod h1:M9i3MMDzGFXsydri9/vW+EWz9sWb4I6WyHqdlAk0idE= cloud.google.com/go/edgecontainer v0.1.0/go.mod h1:WgkZ9tp10bFxqO8BLPqv2LlfmQF1X8lZqwW4r1BTajk= cloud.google.com/go/edgecontainer v0.2.0/go.mod h1:RTmLijy+lGpQ7BXuTDa4C4ssxyXT34NIuHIgKuP4s5w= +cloud.google.com/go/edgecontainer v0.3.0/go.mod h1:FLDpP4nykgwwIfcLt6zInhprzw0lEi2P1fjO6Ie0qbc= +cloud.google.com/go/edgecontainer v1.0.0/go.mod h1:cttArqZpBB2q58W/upSG++ooo6EsblxDIolxa3jSjbY= +cloud.google.com/go/errorreporting v0.3.0/go.mod h1:xsP2yaAp+OAW4OIm60An2bbLpqIhKXdWR/tawvl7QzU= +cloud.google.com/go/essentialcontacts v1.3.0/go.mod h1:r+OnHa5jfj90qIfZDO/VztSFqbQan7HV75p8sA+mdGI= +cloud.google.com/go/essentialcontacts v1.4.0/go.mod h1:8tRldvHYsmnBCHdFpvU+GL75oWiBKl80BiqlFh9tp+8= +cloud.google.com/go/essentialcontacts v1.5.0/go.mod h1:ay29Z4zODTuwliK7SnX8E86aUF2CTzdNtvv42niCX0M= +cloud.google.com/go/eventarc v1.7.0/go.mod h1:6ctpF3zTnaQCxUjHUdcfgcA1A2T309+omHZth7gDfmc= +cloud.google.com/go/eventarc v1.8.0/go.mod h1:imbzxkyAU4ubfsaKYdQg04WS1NvncblHEup4kvF+4gw= +cloud.google.com/go/eventarc v1.10.0/go.mod h1:u3R35tmZ9HvswGRBnF48IlYgYeBcPUCjkr4BTdem2Kw= +cloud.google.com/go/eventarc v1.11.0/go.mod h1:PyUjsUKPWoRBCHeOxZd/lbOOjahV41icXyUY5kSTvVY= +cloud.google.com/go/filestore v1.3.0/go.mod h1:+qbvHGvXU1HaKX2nD0WEPo92TP/8AQuCVEBXNY9z0+w= +cloud.google.com/go/filestore v1.4.0/go.mod h1:PaG5oDfo9r224f8OYXURtAsY+Fbyq/bLYoINEK8XQAI= +cloud.google.com/go/filestore v1.5.0/go.mod h1:FqBXDWBp4YLHqRnVGveOkHDf8svj9r5+mUDLupOWEDs= +cloud.google.com/go/filestore v1.6.0/go.mod h1:di5unNuss/qfZTw2U9nhFqo8/ZDSc466dre85Kydllg= +cloud.google.com/go/firestore v1.9.0/go.mod h1:HMkjKHNTtRyZNiMzu7YAsLr9K3X2udY2AMwDaMEQiiE= cloud.google.com/go/functions v1.6.0/go.mod h1:3H1UA3qiIPRWD7PeZKLvHZ9SaQhR26XIJcC0A5GbvAk= cloud.google.com/go/functions v1.7.0/go.mod h1:+d+QBcWM+RsrgZfV9xo6KfA1GlzJfxcfZcRPEhDDfzg= +cloud.google.com/go/functions v1.8.0/go.mod h1:RTZ4/HsQjIqIYP9a9YPbU+QFoQsAlYgrwOXJWHn1POY= +cloud.google.com/go/functions v1.9.0/go.mod h1:Y+Dz8yGguzO3PpIjhLTbnqV1CWmgQ5UwtlpzoyquQ08= +cloud.google.com/go/functions v1.10.0/go.mod h1:0D3hEOe3DbEvCXtYOZHQZmD+SzYsi1YbI7dGvHfldXw= +cloud.google.com/go/functions v1.12.0/go.mod h1:AXWGrF3e2C/5ehvwYo/GH6O5s09tOPksiKhz+hH8WkA= +cloud.google.com/go/functions v1.13.0/go.mod h1:EU4O007sQm6Ef/PwRsI8N2umygGqPBS/IZQKBQBcJ3c= cloud.google.com/go/gaming v1.5.0/go.mod h1:ol7rGcxP/qHTRQE/RO4bxkXq+Fix0j6D4LFPzYTIrDM= cloud.google.com/go/gaming v1.6.0/go.mod h1:YMU1GEvA39Qt3zWGyAVA9bpYz/yAhTvaQ1t2sK4KPUA= +cloud.google.com/go/gaming v1.7.0/go.mod h1:LrB8U7MHdGgFG851iHAfqUdLcKBdQ55hzXy9xBJz0+w= +cloud.google.com/go/gaming v1.8.0/go.mod h1:xAqjS8b7jAVW0KFYeRUxngo9My3f33kFmua++Pi+ggM= +cloud.google.com/go/gaming v1.9.0/go.mod h1:Fc7kEmCObylSWLO334NcO+O9QMDyz+TKC4v1D7X+Bc0= +cloud.google.com/go/gkebackup v0.2.0/go.mod h1:XKvv/4LfG829/B8B7xRkk8zRrOEbKtEam6yNfuQNH60= +cloud.google.com/go/gkebackup v0.3.0/go.mod h1:n/E671i1aOQvUxT541aTkCwExO/bTer2HDlj4TsBRAo= +cloud.google.com/go/gkebackup v0.4.0/go.mod h1:byAyBGUwYGEEww7xsbnUTBHIYcOPy/PgUWUtOeRm9Vg= cloud.google.com/go/gkeconnect v0.5.0/go.mod h1:c5lsNAg5EwAy7fkqX/+goqFsU1Da/jQFqArp+wGNr/o= cloud.google.com/go/gkeconnect v0.6.0/go.mod h1:Mln67KyU/sHJEBY8kFZ0xTeyPtzbq9StAVvEULYK16A= +cloud.google.com/go/gkeconnect v0.7.0/go.mod h1:SNfmVqPkaEi3bF/B3CNZOAYPYdg7sU+obZ+QTky2Myw= cloud.google.com/go/gkehub v0.9.0/go.mod h1:WYHN6WG8w9bXU0hqNxt8rm5uxnk8IH+lPY9J2TV7BK0= cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y977wO+hBH0= +cloud.google.com/go/gkehub v0.11.0/go.mod h1:JOWHlmN+GHyIbuWQPl47/C2RFhnFKH38jH9Ascu3n0E= +cloud.google.com/go/gkehub v0.12.0/go.mod h1:djiIwwzTTBrF5NaXCGv3mf7klpEMcST17VBTVVDcuaw= +cloud.google.com/go/gkemulticloud v0.3.0/go.mod h1:7orzy7O0S+5kq95e4Hpn7RysVA7dPs8W/GgfUtsPbrA= +cloud.google.com/go/gkemulticloud v0.4.0/go.mod h1:E9gxVBnseLWCk24ch+P9+B2CoDFJZTyIgLKSalC7tuI= +cloud.google.com/go/gkemulticloud v0.5.0/go.mod h1:W0JDkiyi3Tqh0TJr//y19wyb1yf8llHVto2Htf2Ja3Y= cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= +cloud.google.com/go/gsuiteaddons v1.3.0/go.mod h1:EUNK/J1lZEZO8yPtykKxLXI6JSVN2rg9bN8SXOa0bgM= +cloud.google.com/go/gsuiteaddons v1.4.0/go.mod h1:rZK5I8hht7u7HxFQcFei0+AtfS9uSushomRlg+3ua1o= +cloud.google.com/go/gsuiteaddons v1.5.0/go.mod h1:TFCClYLd64Eaa12sFVmUyG62tk4mdIsI7pAnSXRkcFo= +cloud.google.com/go/iam v0.1.0/go.mod h1:vcUNEa0pEm0qRVpmWepWaFMIAI8/hjB9mO8rNCJtF6c= cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= -cloud.google.com/go/iam v0.13.0 h1:+CmB+K0J/33d0zSQ9SlFWUeCCEn5XJA0ZMZ3pHE9u8k= +cloud.google.com/go/iam v0.6.0/go.mod h1:+1AH33ueBne5MzYccyMHtEKqLE4/kJOibtffMHDMFMc= +cloud.google.com/go/iam v0.7.0/go.mod h1:H5Br8wRaDGNc8XP3keLc4unfUUZeyH3Sfl9XpQEYOeg= +cloud.google.com/go/iam v0.8.0/go.mod h1:lga0/y3iH6CX7sYqypWJ33hf7kkfXJag67naqGESjkE= +cloud.google.com/go/iam v0.11.0/go.mod h1:9PiLDanza5D+oWFZiH1uG+RnRCfEGKoyl6yo4cgWZGY= +cloud.google.com/go/iam v0.12.0/go.mod h1:knyHGviacl11zrtZUoDuYpDgLjvr28sLQaG0YB2GYAY= cloud.google.com/go/iam v0.13.0/go.mod h1:ljOg+rcNfzZ5d6f1nAUJ8ZIxOaZUVoS14bKCtaLZ/D0= +cloud.google.com/go/iam v1.2.2 h1:ozUSofHUGf/F4tCNy/mu9tHLTaxZFLOUiKzjcgWHGIA= +cloud.google.com/go/iam v1.2.2/go.mod h1:0Ys8ccaZHdI1dEUilwzqng/6ps2YB6vRsjIe00/+6JY= +cloud.google.com/go/iap v1.4.0/go.mod h1:RGFwRJdihTINIe4wZ2iCP0zF/qu18ZwyKxrhMhygBEc= +cloud.google.com/go/iap v1.5.0/go.mod h1:UH/CGgKd4KyohZL5Pt0jSKE4m3FR51qg6FKQ/z/Ix9A= +cloud.google.com/go/iap v1.6.0/go.mod h1:NSuvI9C/j7UdjGjIde7t7HBz+QTwBcapPE07+sSRcLk= +cloud.google.com/go/iap v1.7.0/go.mod h1:beqQx56T9O1G1yNPph+spKpNibDlYIiIixiqsQXxLIo= +cloud.google.com/go/iap v1.7.1/go.mod h1:WapEwPc7ZxGt2jFGB/C/bm+hP0Y6NXzOYGjpPnmMS74= +cloud.google.com/go/ids v1.1.0/go.mod h1:WIuwCaYVOzHIj2OhN9HAwvW+DBdmUAdcWlFxRl+KubM= +cloud.google.com/go/ids v1.2.0/go.mod h1:5WXvp4n25S0rA/mQWAg1YEEBBq6/s+7ml1RDCW1IrcY= +cloud.google.com/go/ids v1.3.0/go.mod h1:JBdTYwANikFKaDP6LtW5JAi4gubs57SVNQjemdt6xV4= +cloud.google.com/go/iot v1.3.0/go.mod h1:r7RGh2B61+B8oz0AGE+J72AhA0G7tdXItODWsaA2oLs= +cloud.google.com/go/iot v1.4.0/go.mod h1:dIDxPOn0UvNDUMD8Ger7FIaTuvMkj+aGk94RPP0iV+g= +cloud.google.com/go/iot v1.5.0/go.mod h1:mpz5259PDl3XJthEmh9+ap0affn/MqNSP4My77Qql9o= +cloud.google.com/go/iot v1.6.0/go.mod h1:IqdAsmE2cTYYNO1Fvjfzo9po179rAtJeVGUvkLN3rLE= +cloud.google.com/go/kms v1.4.0/go.mod h1:fajBHndQ+6ubNw6Ss2sSd+SWvjL26RNo/dr7uxsnnOA= +cloud.google.com/go/kms v1.5.0/go.mod h1:QJS2YY0eJGBg3mnDfuaCyLauWwBJiHRboYxJ++1xJNg= +cloud.google.com/go/kms v1.6.0/go.mod h1:Jjy850yySiasBUDi6KFUwUv2n1+o7QZFyuUJg6OgjA0= +cloud.google.com/go/kms v1.8.0/go.mod h1:4xFEhYFqvW+4VMELtZyxomGSYtSQKzM178ylFW4jMAg= +cloud.google.com/go/kms v1.9.0/go.mod h1:qb1tPTgfF9RQP8e1wq4cLFErVuTJv7UsSC915J8dh3w= +cloud.google.com/go/kms v1.10.0/go.mod h1:ng3KTUtQQU9bPX3+QGLsflZIHlkbn8amFAMY63m8d24= +cloud.google.com/go/kms v1.10.1/go.mod h1:rIWk/TryCkR59GMC3YtHtXeLzd634lBbKenvyySAyYI= cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= +cloud.google.com/go/language v1.7.0/go.mod h1:DJ6dYN/W+SQOjF8e1hLQXMF21AkH2w9wiPzPCJa2MIE= +cloud.google.com/go/language v1.8.0/go.mod h1:qYPVHf7SPoNNiCL2Dr0FfEFNil1qi3pQEyygwpgVKB8= +cloud.google.com/go/language v1.9.0/go.mod h1:Ns15WooPM5Ad/5no/0n81yUetis74g3zrbeJBE+ptUY= cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08= -cloud.google.com/go/longrunning v0.4.1 h1:v+yFJOfKC3yZdY6ZUI933pIYdhyhV8S3NpWrXWmg7jM= +cloud.google.com/go/lifesciences v0.8.0/go.mod h1:lFxiEOMqII6XggGbOnKiyZ7IBwoIqA84ClvoezaA/bo= +cloud.google.com/go/logging v1.6.1/go.mod h1:5ZO0mHHbvm8gEmeEUHrmDlTDSu5imF6MUP9OfilNXBw= +cloud.google.com/go/logging v1.7.0/go.mod h1:3xjP2CjkM3ZkO73aj4ASA5wRPGGCRrPIAeNqVNkzY8M= +cloud.google.com/go/logging v1.12.0 h1:ex1igYcGFd4S/RZWOCU51StlIEuey5bjqwH9ZYjHibk= +cloud.google.com/go/logging v1.12.0/go.mod h1:wwYBt5HlYP1InnrtYI0wtwttpVU1rifnMT7RejksUAM= +cloud.google.com/go/longrunning v0.1.1/go.mod h1:UUFxuDWkv22EuY93jjmDMFT5GPQKeFVJBIF6QlTqdsE= +cloud.google.com/go/longrunning v0.3.0/go.mod h1:qth9Y41RRSUE69rDcOn6DdK3HfQfsUI0YSmW3iIlLJc= +cloud.google.com/go/longrunning v0.4.1/go.mod h1:4iWDqhBZ70CvZ6BfETbvam3T8FMvLK+eFj0E6AaRQTo= +cloud.google.com/go/longrunning v0.6.2 h1:xjDfh1pQcWPEvnfjZmwjKQEcHnpz6lHjfy7Fo0MK+hc= +cloud.google.com/go/longrunning v0.6.2/go.mod h1:k/vIs83RN4bE3YCswdXC5PFfWVILjm3hpEUlSko4PiI= +cloud.google.com/go/managedidentities v1.3.0/go.mod h1:UzlW3cBOiPrzucO5qWkNkh0w33KFtBJU281hacNvsdE= +cloud.google.com/go/managedidentities v1.4.0/go.mod h1:NWSBYbEMgqmbZsLIyKvxrYbtqOsxY1ZrGM+9RgDqInM= +cloud.google.com/go/managedidentities v1.5.0/go.mod h1:+dWcZ0JlUmpuxpIDfyP5pP5y0bLdRwOS4Lp7gMni/LA= +cloud.google.com/go/maps v0.1.0/go.mod h1:BQM97WGyfw9FWEmQMpZ5T6cpovXXSd1cGmFma94eubI= +cloud.google.com/go/maps v0.6.0/go.mod h1:o6DAMMfb+aINHz/p/jbcY+mYeXBoZoxTfdSQ8VAJaCw= +cloud.google.com/go/maps v0.7.0/go.mod h1:3GnvVl3cqeSvgMcpRlQidXsPYuDGQ8naBis7MVzpXsY= cloud.google.com/go/mediatranslation v0.5.0/go.mod h1:jGPUhGTybqsPQn91pNXw0xVHfuJ3leR1wj37oU3y1f4= cloud.google.com/go/mediatranslation v0.6.0/go.mod h1:hHdBCTYNigsBxshbznuIMFNe5QXEowAuNmmC7h8pu5w= +cloud.google.com/go/mediatranslation v0.7.0/go.mod h1:LCnB/gZr90ONOIQLgSXagp8XUW1ODs2UmUMvcgMfI2I= cloud.google.com/go/memcache v1.4.0/go.mod h1:rTOfiGZtJX1AaFUrOgsMHX5kAzaTQ8azHiuDoTPzNsE= cloud.google.com/go/memcache v1.5.0/go.mod h1:dk3fCK7dVo0cUU2c36jKb4VqKPS22BTkf81Xq617aWM= +cloud.google.com/go/memcache v1.6.0/go.mod h1:XS5xB0eQZdHtTuTF9Hf8eJkKtR3pVRCcvJwtm68T3rA= +cloud.google.com/go/memcache v1.7.0/go.mod h1:ywMKfjWhNtkQTxrWxCkCFkoPjLHPW6A7WOTVI8xy3LY= +cloud.google.com/go/memcache v1.9.0/go.mod h1:8oEyzXCu+zo9RzlEaEjHl4KkgjlNDaXbCQeQWlzNFJM= cloud.google.com/go/metastore v1.5.0/go.mod h1:2ZNrDcQwghfdtCwJ33nM0+GrBGlVuh8rakL3vdPY3XY= cloud.google.com/go/metastore v1.6.0/go.mod h1:6cyQTls8CWXzk45G55x57DVQ9gWg7RiH65+YgPsNh9s= +cloud.google.com/go/metastore v1.7.0/go.mod h1:s45D0B4IlsINu87/AsWiEVYbLaIMeUSoxlKKDqBGFS8= +cloud.google.com/go/metastore v1.8.0/go.mod h1:zHiMc4ZUpBiM7twCIFQmJ9JMEkDSyZS9U12uf7wHqSI= +cloud.google.com/go/metastore v1.10.0/go.mod h1:fPEnH3g4JJAk+gMRnrAnoqyv2lpUCqJPWOodSaf45Eo= +cloud.google.com/go/monitoring v1.7.0/go.mod h1:HpYse6kkGo//7p6sT0wsIC6IBDET0RhIsnmlA53dvEk= +cloud.google.com/go/monitoring v1.8.0/go.mod h1:E7PtoMJ1kQXWxPjB6mv2fhC5/15jInuulFdYYtlcvT4= +cloud.google.com/go/monitoring v1.12.0/go.mod h1:yx8Jj2fZNEkL/GYZyTLS4ZtZEZN8WtDEiEqG4kLK50w= +cloud.google.com/go/monitoring v1.13.0/go.mod h1:k2yMBAB1H9JT/QETjNkgdCGD9bPF712XiLTVr+cBrpw= +cloud.google.com/go/monitoring v1.21.2 h1:FChwVtClH19E7pJ+e0xUhJPGksctZNVOk2UhMmblmdU= +cloud.google.com/go/monitoring v1.21.2/go.mod h1:hS3pXvaG8KgWTSz+dAdyzPrGUYmi2Q+WFX8g2hqVEZU= cloud.google.com/go/networkconnectivity v1.4.0/go.mod h1:nOl7YL8odKyAOtzNX73/M5/mGZgqqMeryi6UPZTk/rA= cloud.google.com/go/networkconnectivity v1.5.0/go.mod h1:3GzqJx7uhtlM3kln0+x5wyFvuVH1pIBJjhCpjzSt75o= +cloud.google.com/go/networkconnectivity v1.6.0/go.mod h1:OJOoEXW+0LAxHh89nXd64uGG+FbQoeH8DtxCHVOMlaM= +cloud.google.com/go/networkconnectivity v1.7.0/go.mod h1:RMuSbkdbPwNMQjB5HBWD5MpTBnNm39iAVpC3TmsExt8= +cloud.google.com/go/networkconnectivity v1.10.0/go.mod h1:UP4O4sWXJG13AqrTdQCD9TnLGEbtNRqjuaaA7bNjF5E= +cloud.google.com/go/networkconnectivity v1.11.0/go.mod h1:iWmDD4QF16VCDLXUqvyspJjIEtBR/4zq5hwnY2X3scM= +cloud.google.com/go/networkmanagement v1.4.0/go.mod h1:Q9mdLLRn60AsOrPc8rs8iNV6OHXaGcDdsIQe1ohekq8= +cloud.google.com/go/networkmanagement v1.5.0/go.mod h1:ZnOeZ/evzUdUsnvRt792H0uYEnHQEMaz+REhhzJRcf4= +cloud.google.com/go/networkmanagement v1.6.0/go.mod h1:5pKPqyXjB/sgtvB5xqOemumoQNB7y95Q7S+4rjSOPYY= cloud.google.com/go/networksecurity v0.5.0/go.mod h1:xS6fOCoqpVC5zx15Z/MqkfDwH4+m/61A3ODiDV1xmiQ= cloud.google.com/go/networksecurity v0.6.0/go.mod h1:Q5fjhTr9WMI5mbpRYEbiexTzROf7ZbDzvzCrNl14nyU= +cloud.google.com/go/networksecurity v0.7.0/go.mod h1:mAnzoxx/8TBSyXEeESMy9OOYwo1v+gZ5eMRnsT5bC8k= +cloud.google.com/go/networksecurity v0.8.0/go.mod h1:B78DkqsxFG5zRSVuwYFRZ9Xz8IcQ5iECsNrPn74hKHU= cloud.google.com/go/notebooks v1.2.0/go.mod h1:9+wtppMfVPUeJ8fIWPOq1UnATHISkGXGqTkxeieQ6UY= cloud.google.com/go/notebooks v1.3.0/go.mod h1:bFR5lj07DtCPC7YAAJ//vHskFBxA5JzYlH68kXVdk34= +cloud.google.com/go/notebooks v1.4.0/go.mod h1:4QPMngcwmgb6uw7Po99B2xv5ufVoIQ7nOGDyL4P8AgA= +cloud.google.com/go/notebooks v1.5.0/go.mod h1:q8mwhnP9aR8Hpfnrc5iN5IBhrXUy8S2vuYs+kBJ/gu0= +cloud.google.com/go/notebooks v1.7.0/go.mod h1:PVlaDGfJgj1fl1S3dUwhFMXFgfYGhYQt2164xOMONmE= +cloud.google.com/go/notebooks v1.8.0/go.mod h1:Lq6dYKOYOWUCTvw5t2q1gp1lAp0zxAxRycayS0iJcqQ= +cloud.google.com/go/optimization v1.1.0/go.mod h1:5po+wfvX5AQlPznyVEZjGJTMr4+CAkJf2XSTQOOl9l4= +cloud.google.com/go/optimization v1.2.0/go.mod h1:Lr7SOHdRDENsh+WXVmQhQTrzdu9ybg0NecjHidBq6xs= +cloud.google.com/go/optimization v1.3.1/go.mod h1:IvUSefKiwd1a5p0RgHDbWCIbDFgKuEdB+fPPuP0IDLI= +cloud.google.com/go/orchestration v1.3.0/go.mod h1:Sj5tq/JpWiB//X/q3Ngwdl5K7B7Y0KZ7bfv0wL6fqVA= +cloud.google.com/go/orchestration v1.4.0/go.mod h1:6W5NLFWs2TlniBphAViZEVhrXRSMgUGDfW7vrWKvsBk= +cloud.google.com/go/orchestration v1.6.0/go.mod h1:M62Bevp7pkxStDfFfTuCOaXgaaqRAga1yKyoMtEoWPQ= +cloud.google.com/go/orgpolicy v1.4.0/go.mod h1:xrSLIV4RePWmP9P3tBl8S93lTmlAxjm06NSm2UTmKvE= +cloud.google.com/go/orgpolicy v1.5.0/go.mod h1:hZEc5q3wzwXJaKrsx5+Ewg0u1LxJ51nNFlext7Tanwc= +cloud.google.com/go/orgpolicy v1.10.0/go.mod h1:w1fo8b7rRqlXlIJbVhOMPrwVljyuW5mqssvBtU18ONc= cloud.google.com/go/osconfig v1.7.0/go.mod h1:oVHeCeZELfJP7XLxcBGTMBvRO+1nQ5tFG9VQTmYS2Fs= cloud.google.com/go/osconfig v1.8.0/go.mod h1:EQqZLu5w5XA7eKizepumcvWx+m8mJUhEwiPqWiZeEdg= +cloud.google.com/go/osconfig v1.9.0/go.mod h1:Yx+IeIZJ3bdWmzbQU4fxNl8xsZ4amB+dygAwFPlvnNo= +cloud.google.com/go/osconfig v1.10.0/go.mod h1:uMhCzqC5I8zfD9zDEAfvgVhDS8oIjySWh+l4WK6GnWw= +cloud.google.com/go/osconfig v1.11.0/go.mod h1:aDICxrur2ogRd9zY5ytBLV89KEgT2MKB2L/n6x1ooPw= cloud.google.com/go/oslogin v1.4.0/go.mod h1:YdgMXWRaElXz/lDk1Na6Fh5orF7gvmJ0FGLIs9LId4E= cloud.google.com/go/oslogin v1.5.0/go.mod h1:D260Qj11W2qx/HVF29zBg+0fd6YCSjSqLUkY/qEenQU= +cloud.google.com/go/oslogin v1.6.0/go.mod h1:zOJ1O3+dTU8WPlGEkFSh7qeHPPSoxrcMbbK1Nm2iX70= +cloud.google.com/go/oslogin v1.7.0/go.mod h1:e04SN0xO1UNJ1M5GP0vzVBFicIe4O53FOfcixIqTyXo= +cloud.google.com/go/oslogin v1.9.0/go.mod h1:HNavntnH8nzrn8JCTT5fj18FuJLFJc4NaZJtBnQtKFs= cloud.google.com/go/phishingprotection v0.5.0/go.mod h1:Y3HZknsK9bc9dMi+oE8Bim0lczMU6hrX0UpADuMefr0= cloud.google.com/go/phishingprotection v0.6.0/go.mod h1:9Y3LBLgy0kDTcYET8ZH3bq/7qni15yVUoAxiFxnlSUA= +cloud.google.com/go/phishingprotection v0.7.0/go.mod h1:8qJI4QKHoda/sb/7/YmMQ2omRLSLYSu9bU0EKCNI+Lk= +cloud.google.com/go/policytroubleshooter v1.3.0/go.mod h1:qy0+VwANja+kKrjlQuOzmlvscn4RNsAc0e15GGqfMxg= +cloud.google.com/go/policytroubleshooter v1.4.0/go.mod h1:DZT4BcRw3QoO8ota9xw/LKtPa8lKeCByYeKTIf/vxdE= +cloud.google.com/go/policytroubleshooter v1.5.0/go.mod h1:Rz1WfV+1oIpPdN2VvvuboLVRsB1Hclg3CKQ53j9l8vw= +cloud.google.com/go/policytroubleshooter v1.6.0/go.mod h1:zYqaPTsmfvpjm5ULxAyD/lINQxJ0DDsnWOP/GZ7xzBc= cloud.google.com/go/privatecatalog v0.5.0/go.mod h1:XgosMUvvPyxDjAVNDYxJ7wBW8//hLDDYmnsNcMGq1K0= cloud.google.com/go/privatecatalog v0.6.0/go.mod h1:i/fbkZR0hLN29eEWiiwue8Pb+GforiEIBnV9yrRUOKI= +cloud.google.com/go/privatecatalog v0.7.0/go.mod h1:2s5ssIFO69F5csTXcwBP7NPFTZvps26xGzvQ2PQaBYg= +cloud.google.com/go/privatecatalog v0.8.0/go.mod h1:nQ6pfaegeDAq/Q5lrfCQzQLhubPiZhSaNhIgfJlnIXs= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/pubsub v1.26.0/go.mod h1:QgBH3U/jdJy/ftjPhTkyXNj543Tin1pRYcdcPRnFIRI= +cloud.google.com/go/pubsub v1.27.1/go.mod h1:hQN39ymbV9geqBnfQq6Xf63yNhUAhv9CZhzp5O6qsW0= +cloud.google.com/go/pubsub v1.28.0/go.mod h1:vuXFpwaVoIPQMGXqRyUQigu/AX1S3IWugR9xznmcXX8= +cloud.google.com/go/pubsub v1.30.0/go.mod h1:qWi1OPS0B+b5L+Sg6Gmc9zD1Y+HaM0MdUr7LsupY1P4= +cloud.google.com/go/pubsublite v1.5.0/go.mod h1:xapqNQ1CuLfGi23Yda/9l4bBCKz/wC3KIJ5gKcxveZg= +cloud.google.com/go/pubsublite v1.6.0/go.mod h1:1eFCS0U11xlOuMFV/0iBqw3zP12kddMeCbj/F3FSj9k= +cloud.google.com/go/pubsublite v1.7.0/go.mod h1:8hVMwRXfDfvGm3fahVbtDbiLePT3gpoiJYJY+vxWxVM= cloud.google.com/go/recaptchaenterprise v1.3.1/go.mod h1:OdD+q+y4XGeAlxRaMn1Y7/GveP6zmq76byL6tjPE7d4= cloud.google.com/go/recaptchaenterprise/v2 v2.1.0/go.mod h1:w9yVqajwroDNTfGuhmOjPDN//rZGySaf6PtFVcSCa7o= cloud.google.com/go/recaptchaenterprise/v2 v2.2.0/go.mod h1:/Zu5jisWGeERrd5HnlS3EUGb/D335f9k51B/FVil0jk= cloud.google.com/go/recaptchaenterprise/v2 v2.3.0/go.mod h1:O9LwGCjrhGHBQET5CA7dd5NwwNQUErSgEDit1DLNTdo= +cloud.google.com/go/recaptchaenterprise/v2 v2.4.0/go.mod h1:Am3LHfOuBstrLrNCBrlI5sbwx9LBg3te2N6hGvHn2mE= +cloud.google.com/go/recaptchaenterprise/v2 v2.5.0/go.mod h1:O8LzcHXN3rz0j+LBC91jrwI3R+1ZSZEWrfL7XHgNo9U= +cloud.google.com/go/recaptchaenterprise/v2 v2.6.0/go.mod h1:RPauz9jeLtB3JVzg6nCbe12qNoaa8pXc4d/YukAmcnA= +cloud.google.com/go/recaptchaenterprise/v2 v2.7.0/go.mod h1:19wVj/fs5RtYtynAPJdDTb69oW0vNHYDBTbB4NvMD9c= cloud.google.com/go/recommendationengine v0.5.0/go.mod h1:E5756pJcVFeVgaQv3WNpImkFP8a+RptV6dDLGPILjvg= cloud.google.com/go/recommendationengine v0.6.0/go.mod h1:08mq2umu9oIqc7tDy8sx+MNJdLG0fUi3vaSVbztHgJ4= +cloud.google.com/go/recommendationengine v0.7.0/go.mod h1:1reUcE3GIu6MeBz/h5xZJqNLuuVjNg1lmWMPyjatzac= cloud.google.com/go/recommender v1.5.0/go.mod h1:jdoeiBIVrJe9gQjwd759ecLJbxCDED4A6p+mqoqDvTg= cloud.google.com/go/recommender v1.6.0/go.mod h1:+yETpm25mcoiECKh9DEScGzIRyDKpZ0cEhWGo+8bo+c= +cloud.google.com/go/recommender v1.7.0/go.mod h1:XLHs/W+T8olwlGOgfQenXBTbIseGclClff6lhFVe9Bs= +cloud.google.com/go/recommender v1.8.0/go.mod h1:PkjXrTT05BFKwxaUxQmtIlrtj0kph108r02ZZQ5FE70= +cloud.google.com/go/recommender v1.9.0/go.mod h1:PnSsnZY7q+VL1uax2JWkt/UegHssxjUVVCrX52CuEmQ= cloud.google.com/go/redis v1.7.0/go.mod h1:V3x5Jq1jzUcg+UNsRvdmsfuFnit1cfe3Z/PGyq/lm4Y= cloud.google.com/go/redis v1.8.0/go.mod h1:Fm2szCDavWzBk2cDKxrkmWBqoCiL1+Ctwq7EyqBCA/A= +cloud.google.com/go/redis v1.9.0/go.mod h1:HMYQuajvb2D0LvMgZmLDZW8V5aOC/WxstZHiy4g8OiA= +cloud.google.com/go/redis v1.10.0/go.mod h1:ThJf3mMBQtW18JzGgh41/Wld6vnDDc/F/F35UolRZPM= +cloud.google.com/go/redis v1.11.0/go.mod h1:/X6eicana+BWcUda5PpwZC48o37SiFVTFSs0fWAJ7uQ= +cloud.google.com/go/resourcemanager v1.3.0/go.mod h1:bAtrTjZQFJkiWTPDb1WBjzvc6/kifjj4QBYuKCCoqKA= +cloud.google.com/go/resourcemanager v1.4.0/go.mod h1:MwxuzkumyTX7/a3n37gmsT3py7LIXwrShilPh3P1tR0= +cloud.google.com/go/resourcemanager v1.5.0/go.mod h1:eQoXNAiAvCf5PXxWxXjhKQoTMaUSNrEfg+6qdf/wots= +cloud.google.com/go/resourcemanager v1.6.0/go.mod h1:YcpXGRs8fDzcUl1Xw8uOVmI8JEadvhRIkoXXUNVYcVo= +cloud.google.com/go/resourcemanager v1.7.0/go.mod h1:HlD3m6+bwhzj9XCouqmeiGuni95NTrExfhoSrkC/3EI= +cloud.google.com/go/resourcesettings v1.3.0/go.mod h1:lzew8VfESA5DQ8gdlHwMrqZs1S9V87v3oCnKCWoOuQU= +cloud.google.com/go/resourcesettings v1.4.0/go.mod h1:ldiH9IJpcrlC3VSuCGvjR5of/ezRrOxFtpJoJo5SmXg= +cloud.google.com/go/resourcesettings v1.5.0/go.mod h1:+xJF7QSG6undsQDfsCJyqWXyBwUoJLhetkRMDRnIoXA= cloud.google.com/go/retail v1.8.0/go.mod h1:QblKS8waDmNUhghY2TI9O3JLlFk8jybHeV4BF19FrE4= cloud.google.com/go/retail v1.9.0/go.mod h1:g6jb6mKuCS1QKnH/dpu7isX253absFl6iE92nHwlBUY= +cloud.google.com/go/retail v1.10.0/go.mod h1:2gDk9HsL4HMS4oZwz6daui2/jmKvqShXKQuB2RZ+cCc= +cloud.google.com/go/retail v1.11.0/go.mod h1:MBLk1NaWPmh6iVFSz9MeKG/Psyd7TAgm6y/9L2B4x9Y= +cloud.google.com/go/retail v1.12.0/go.mod h1:UMkelN/0Z8XvKymXFbD4EhFJlYKRx1FGhQkVPU5kF14= +cloud.google.com/go/run v0.2.0/go.mod h1:CNtKsTA1sDcnqqIFR3Pb5Tq0usWxJJvsWOCPldRU3Do= +cloud.google.com/go/run v0.3.0/go.mod h1:TuyY1+taHxTjrD0ZFk2iAR+xyOXEA0ztb7U3UNA0zBo= +cloud.google.com/go/run v0.8.0/go.mod h1:VniEnuBwqjigv0A7ONfQUaEItaiCRVujlMqerPPiktM= +cloud.google.com/go/run v0.9.0/go.mod h1:Wwu+/vvg8Y+JUApMwEDfVfhetv30hCG4ZwDR/IXl2Qg= cloud.google.com/go/scheduler v1.4.0/go.mod h1:drcJBmxF3aqZJRhmkHQ9b3uSSpQoltBPGPxGAWROx6s= cloud.google.com/go/scheduler v1.5.0/go.mod h1:ri073ym49NW3AfT6DZi21vLZrG07GXr5p3H1KxN5QlI= +cloud.google.com/go/scheduler v1.6.0/go.mod h1:SgeKVM7MIwPn3BqtcBntpLyrIJftQISRrYB5ZtT+KOk= +cloud.google.com/go/scheduler v1.7.0/go.mod h1:jyCiBqWW956uBjjPMMuX09n3x37mtyPJegEWKxRsn44= +cloud.google.com/go/scheduler v1.8.0/go.mod h1:TCET+Y5Gp1YgHT8py4nlg2Sew8nUHMqcpousDgXJVQc= +cloud.google.com/go/scheduler v1.9.0/go.mod h1:yexg5t+KSmqu+njTIh3b7oYPheFtBWGcbVUYF1GGMIc= cloud.google.com/go/secretmanager v1.6.0/go.mod h1:awVa/OXF6IiyaU1wQ34inzQNc4ISIDIrId8qE5QGgKA= +cloud.google.com/go/secretmanager v1.8.0/go.mod h1:hnVgi/bN5MYHd3Gt0SPuTPPp5ENina1/LxM+2W9U9J4= +cloud.google.com/go/secretmanager v1.9.0/go.mod h1:b71qH2l1yHmWQHt9LC80akm86mX8AL6X1MA01dW8ht4= +cloud.google.com/go/secretmanager v1.10.0/go.mod h1:MfnrdvKMPNra9aZtQFvBcvRU54hbPD8/HayQdlUgJpU= cloud.google.com/go/security v1.5.0/go.mod h1:lgxGdyOKKjHL4YG3/YwIL2zLqMFCKs0UbQwgyZmfJl4= cloud.google.com/go/security v1.7.0/go.mod h1:mZklORHl6Bg7CNnnjLH//0UlAlaXqiG7Lb9PsPXLfD0= cloud.google.com/go/security v1.8.0/go.mod h1:hAQOwgmaHhztFhiQ41CjDODdWP0+AE1B3sX4OFlq+GU= +cloud.google.com/go/security v1.9.0/go.mod h1:6Ta1bO8LXI89nZnmnsZGp9lVoVWXqsVbIq/t9dzI+2Q= +cloud.google.com/go/security v1.10.0/go.mod h1:QtOMZByJVlibUT2h9afNDWRZ1G96gVywH8T5GUSb9IA= +cloud.google.com/go/security v1.12.0/go.mod h1:rV6EhrpbNHrrxqlvW0BWAIawFWq3X90SduMJdFwtLB8= +cloud.google.com/go/security v1.13.0/go.mod h1:Q1Nvxl1PAgmeW0y3HTt54JYIvUdtcpYKVfIB8AOMZ+0= cloud.google.com/go/securitycenter v1.13.0/go.mod h1:cv5qNAqjY84FCN6Y9z28WlkKXyWsgLO832YiWwkCWcU= cloud.google.com/go/securitycenter v1.14.0/go.mod h1:gZLAhtyKv85n52XYWt6RmeBdydyxfPeTrpToDPw4Auc= +cloud.google.com/go/securitycenter v1.15.0/go.mod h1:PeKJ0t8MoFmmXLXWm41JidyzI3PJjd8sXWaVqg43WWk= +cloud.google.com/go/securitycenter v1.16.0/go.mod h1:Q9GMaLQFUD+5ZTabrbujNWLtSLZIZF7SAR0wWECrjdk= +cloud.google.com/go/securitycenter v1.18.1/go.mod h1:0/25gAzCM/9OL9vVx4ChPeM/+DlfGQJDwBy/UC8AKK0= +cloud.google.com/go/securitycenter v1.19.0/go.mod h1:LVLmSg8ZkkyaNy4u7HCIshAngSQ8EcIRREP3xBnyfag= +cloud.google.com/go/servicecontrol v1.4.0/go.mod h1:o0hUSJ1TXJAmi/7fLJAedOovnujSEvjKCAFNXPQ1RaU= +cloud.google.com/go/servicecontrol v1.5.0/go.mod h1:qM0CnXHhyqKVuiZnGKrIurvVImCs8gmqWsDoqe9sU1s= +cloud.google.com/go/servicecontrol v1.10.0/go.mod h1:pQvyvSRh7YzUF2efw7H87V92mxU8FnFDawMClGCNuAA= +cloud.google.com/go/servicecontrol v1.11.0/go.mod h1:kFmTzYzTUIuZs0ycVqRHNaNhgR+UMUpw9n02l/pY+mc= +cloud.google.com/go/servicecontrol v1.11.1/go.mod h1:aSnNNlwEFBY+PWGQ2DoM0JJ/QUXqV5/ZD9DOLB7SnUk= cloud.google.com/go/servicedirectory v1.4.0/go.mod h1:gH1MUaZCgtP7qQiI+F+A+OpeKF/HQWgtAddhTbhL2bs= cloud.google.com/go/servicedirectory v1.5.0/go.mod h1:QMKFL0NUySbpZJ1UZs3oFAmdvVxhhxB6eJ/Vlp73dfg= +cloud.google.com/go/servicedirectory v1.6.0/go.mod h1:pUlbnWsLH9c13yGkxCmfumWEPjsRs1RlmJ4pqiNjVL4= +cloud.google.com/go/servicedirectory v1.7.0/go.mod h1:5p/U5oyvgYGYejufvxhgwjL8UVXjkuw7q5XcG10wx1U= +cloud.google.com/go/servicedirectory v1.8.0/go.mod h1:srXodfhY1GFIPvltunswqXpVxFPpZjf8nkKQT7XcXaY= +cloud.google.com/go/servicedirectory v1.9.0/go.mod h1:29je5JjiygNYlmsGz8k6o+OZ8vd4f//bQLtvzkPPT/s= +cloud.google.com/go/servicemanagement v1.4.0/go.mod h1:d8t8MDbezI7Z2R1O/wu8oTggo3BI2GKYbdG4y/SJTco= +cloud.google.com/go/servicemanagement v1.5.0/go.mod h1:XGaCRe57kfqu4+lRxaFEAuqmjzF0r+gWHjWqKqBvKFo= +cloud.google.com/go/servicemanagement v1.6.0/go.mod h1:aWns7EeeCOtGEX4OvZUWCCJONRZeFKiptqKf1D0l/Jc= +cloud.google.com/go/servicemanagement v1.8.0/go.mod h1:MSS2TDlIEQD/fzsSGfCdJItQveu9NXnUniTrq/L8LK4= +cloud.google.com/go/serviceusage v1.3.0/go.mod h1:Hya1cozXM4SeSKTAgGXgj97GlqUvF5JaoXacR1JTP/E= +cloud.google.com/go/serviceusage v1.4.0/go.mod h1:SB4yxXSaYVuUBYUml6qklyONXNLt83U0Rb+CXyhjEeU= +cloud.google.com/go/serviceusage v1.5.0/go.mod h1:w8U1JvqUqwJNPEOTQjrMHkw3IaIFLoLsPLvsE3xueec= +cloud.google.com/go/serviceusage v1.6.0/go.mod h1:R5wwQcbOWsyuOfbP9tGdAnCAc6B9DRwPG1xtWMDeuPA= +cloud.google.com/go/shell v1.3.0/go.mod h1:VZ9HmRjZBsjLGXusm7K5Q5lzzByZmJHf1d0IWHEN5X4= +cloud.google.com/go/shell v1.4.0/go.mod h1:HDxPzZf3GkDdhExzD/gs8Grqk+dmYcEjGShZgYa9URw= +cloud.google.com/go/shell v1.6.0/go.mod h1:oHO8QACS90luWgxP3N9iZVuEiSF84zNyLytb+qE2f9A= +cloud.google.com/go/spanner v1.41.0/go.mod h1:MLYDBJR/dY4Wt7ZaMIQ7rXOTLjYrmxLE/5ve9vFfWos= +cloud.google.com/go/spanner v1.44.0/go.mod h1:G8XIgYdOK+Fbcpbs7p2fiprDw4CaZX63whnSMLVBxjk= +cloud.google.com/go/spanner v1.45.0/go.mod h1:FIws5LowYz8YAE1J8fOS7DJup8ff7xJeetWEo5REA2M= cloud.google.com/go/speech v1.6.0/go.mod h1:79tcr4FHCimOp56lwC01xnt/WPJZc4v3gzyT7FoBkCM= cloud.google.com/go/speech v1.7.0/go.mod h1:KptqL+BAQIhMsj1kOP2la5DSEEerPDuOP/2mmkhHhZQ= +cloud.google.com/go/speech v1.8.0/go.mod h1:9bYIl1/tjsAnMgKGHKmBZzXKEkGgtU+MpdDPTE9f7y0= +cloud.google.com/go/speech v1.9.0/go.mod h1:xQ0jTcmnRFFM2RfX/U+rk6FQNUF6DQlydUSyoooSpco= +cloud.google.com/go/speech v1.14.1/go.mod h1:gEosVRPJ9waG7zqqnsHpYTOoAS4KouMRLDFMekpJ0J0= +cloud.google.com/go/speech v1.15.0/go.mod h1:y6oH7GhqCaZANH7+Oe0BhgIogsNInLlz542tg3VqeYI= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= @@ -175,80 +543,152 @@ cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3f cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= -cloud.google.com/go/storage v1.30.0 h1:g1yrbxAWOrvg/594228pETWkOi00MLTrOWfh56veU5o= -cloud.google.com/go/storage v1.30.0/go.mod h1:xAVretHSROm1BQX4IIsoVgJqw0LqOyX+I/O2GzRAzdE= +cloud.google.com/go/storage v1.28.1/go.mod h1:Qnisd4CqDdo6BGs2AD5LLnEsmSQ80wQ5ogcBBKhU86Y= +cloud.google.com/go/storage v1.29.0/go.mod h1:4puEjyTKnku6gfKoTfNOU/W+a9JyuVNxjpS5GBrB8h4= +cloud.google.com/go/storage v1.49.0 h1:zenOPBOWHCnojRd9aJZAyQXBYqkJkdQS42dxL55CIMw= +cloud.google.com/go/storage v1.49.0/go.mod h1:k1eHhhpLvrPjVGfo0mOUPEJ4Y2+a/Hv5PiwehZI9qGU= +cloud.google.com/go/storagetransfer v1.5.0/go.mod h1:dxNzUopWy7RQevYFHewchb29POFv3/AaBgnhqzqiK0w= +cloud.google.com/go/storagetransfer v1.6.0/go.mod h1:y77xm4CQV/ZhFZH75PLEXY0ROiS7Gh6pSKrM8dJyg6I= +cloud.google.com/go/storagetransfer v1.7.0/go.mod h1:8Giuj1QNb1kfLAiWM1bN6dHzfdlDAVC9rv9abHot2W4= +cloud.google.com/go/storagetransfer v1.8.0/go.mod h1:JpegsHHU1eXg7lMHkvf+KE5XDJ7EQu0GwNJbbVGanEw= cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= +cloud.google.com/go/talent v1.3.0/go.mod h1:CmcxwJ/PKfRgd1pBjQgU6W3YBwiewmUzQYH5HHmSCmM= +cloud.google.com/go/talent v1.4.0/go.mod h1:ezFtAgVuRf8jRsvyE6EwmbTK5LKciD4KVnHuDEFmOOA= +cloud.google.com/go/talent v1.5.0/go.mod h1:G+ODMj9bsasAEJkQSzO2uHQWXHHXUomArjWQQYkqK6c= +cloud.google.com/go/texttospeech v1.4.0/go.mod h1:FX8HQHA6sEpJ7rCMSfXuzBcysDAuWusNNNvN9FELDd8= +cloud.google.com/go/texttospeech v1.5.0/go.mod h1:oKPLhR4n4ZdQqWKURdwxMy0uiTS1xU161C8W57Wkea4= +cloud.google.com/go/texttospeech v1.6.0/go.mod h1:YmwmFT8pj1aBblQOI3TfKmwibnsfvhIBzPXcW4EBovc= +cloud.google.com/go/tpu v1.3.0/go.mod h1:aJIManG0o20tfDQlRIej44FcwGGl/cD0oiRyMKG19IQ= +cloud.google.com/go/tpu v1.4.0/go.mod h1:mjZaX8p0VBgllCzF6wcU2ovUXN9TONFLd7iz227X2Xg= +cloud.google.com/go/tpu v1.5.0/go.mod h1:8zVo1rYDFuW2l4yZVY0R0fb/v44xLh3llq7RuV61fPM= +cloud.google.com/go/trace v1.3.0/go.mod h1:FFUE83d9Ca57C+K8rDl/Ih8LwOzWIV1krKgxg6N0G28= +cloud.google.com/go/trace v1.4.0/go.mod h1:UG0v8UBqzusp+z63o7FK74SdFE+AXpCLdFb1rshXG+Y= +cloud.google.com/go/trace v1.8.0/go.mod h1:zH7vcsbAhklH8hWFig58HvxcxyQbaIqMarMg9hn5ECA= +cloud.google.com/go/trace v1.9.0/go.mod h1:lOQqpE5IaWY0Ixg7/r2SjixMuc6lfTFeO4QGM4dQWOk= +cloud.google.com/go/trace v1.11.2 h1:4ZmaBdL8Ng/ajrgKqY5jfvzqMXbrDcBsUGXOT9aqTtI= +cloud.google.com/go/trace v1.11.2/go.mod h1:bn7OwXd4pd5rFuAnTrzBuoZ4ax2XQeG3qNgYmfCy0Io= +cloud.google.com/go/translate v1.3.0/go.mod h1:gzMUwRjvOqj5i69y/LYLd8RrNQk+hOmIXTi9+nb3Djs= +cloud.google.com/go/translate v1.4.0/go.mod h1:06Dn/ppvLD6WvA5Rhdp029IX2Mi3Mn7fpMRLPvXT5Wg= +cloud.google.com/go/translate v1.5.0/go.mod h1:29YDSYveqqpA1CQFD7NQuP49xymq17RXNaUDdc0mNu0= +cloud.google.com/go/translate v1.6.0/go.mod h1:lMGRudH1pu7I3n3PETiOB2507gf3HnfLV8qlkHZEyos= +cloud.google.com/go/translate v1.7.0/go.mod h1:lMGRudH1pu7I3n3PETiOB2507gf3HnfLV8qlkHZEyos= +cloud.google.com/go/video v1.8.0/go.mod h1:sTzKFc0bUSByE8Yoh8X0mn8bMymItVGPfTuUBUyRgxk= +cloud.google.com/go/video v1.9.0/go.mod h1:0RhNKFRF5v92f8dQt0yhaHrEuH95m068JYOvLZYnJSw= +cloud.google.com/go/video v1.12.0/go.mod h1:MLQew95eTuaNDEGriQdcYn0dTwf9oWiA4uYebxM5kdg= +cloud.google.com/go/video v1.13.0/go.mod h1:ulzkYlYgCp15N2AokzKjy7MQ9ejuynOJdf1tR5lGthk= +cloud.google.com/go/video v1.14.0/go.mod h1:SkgaXwT+lIIAKqWAJfktHT/RbgjSuY6DobxEp0C5yTQ= +cloud.google.com/go/video v1.15.0/go.mod h1:SkgaXwT+lIIAKqWAJfktHT/RbgjSuY6DobxEp0C5yTQ= cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= cloud.google.com/go/videointelligence v1.7.0/go.mod h1:k8pI/1wAhjznARtVT9U1llUaFNPh7muw8QyOUpavru4= +cloud.google.com/go/videointelligence v1.8.0/go.mod h1:dIcCn4gVDdS7yte/w+koiXn5dWVplOZkE+xwG9FgK+M= +cloud.google.com/go/videointelligence v1.9.0/go.mod h1:29lVRMPDYHikk3v8EdPSaL8Ku+eMzDljjuvRs105XoU= +cloud.google.com/go/videointelligence v1.10.0/go.mod h1:LHZngX1liVtUhZvi2uNS0VQuOzNi2TkY1OakiuoUOjU= cloud.google.com/go/vision v1.2.0/go.mod h1:SmNwgObm5DpFBme2xpyOyasvBc1aPdjvMk2bBk0tKD0= cloud.google.com/go/vision/v2 v2.2.0/go.mod h1:uCdV4PpN1S0jyCyq8sIM42v2Y6zOLkZs+4R9LrGYwFo= cloud.google.com/go/vision/v2 v2.3.0/go.mod h1:UO61abBx9QRMFkNBbf1D8B1LXdS2cGiiCRx0vSpZoUo= +cloud.google.com/go/vision/v2 v2.4.0/go.mod h1:VtI579ll9RpVTrdKdkMzckdnwMyX2JILb+MhPqRbPsY= +cloud.google.com/go/vision/v2 v2.5.0/go.mod h1:MmaezXOOE+IWa+cS7OhRRLK2cNv1ZL98zhqFFZaaH2E= +cloud.google.com/go/vision/v2 v2.6.0/go.mod h1:158Hes0MvOS9Z/bDMSFpjwsUrZ5fPrdwuyyvKSGAGMY= +cloud.google.com/go/vision/v2 v2.7.0/go.mod h1:H89VysHy21avemp6xcf9b9JvZHVehWbET0uT/bcuY/0= +cloud.google.com/go/vmmigration v1.2.0/go.mod h1:IRf0o7myyWFSmVR1ItrBSFLFD/rJkfDCUTO4vLlJvsE= +cloud.google.com/go/vmmigration v1.3.0/go.mod h1:oGJ6ZgGPQOFdjHuocGcLqX4lc98YQ7Ygq8YQwHh9A7g= +cloud.google.com/go/vmmigration v1.5.0/go.mod h1:E4YQ8q7/4W9gobHjQg4JJSgXXSgY21nA5r8swQV+Xxc= +cloud.google.com/go/vmmigration v1.6.0/go.mod h1:bopQ/g4z+8qXzichC7GW1w2MjbErL54rk3/C843CjfY= +cloud.google.com/go/vmwareengine v0.1.0/go.mod h1:RsdNEf/8UDvKllXhMz5J40XxDrNJNN4sagiox+OI208= +cloud.google.com/go/vmwareengine v0.2.2/go.mod h1:sKdctNJxb3KLZkE/6Oui94iw/xs9PRNC2wnNLXsHvH8= +cloud.google.com/go/vmwareengine v0.3.0/go.mod h1:wvoyMvNWdIzxMYSpH/R7y2h5h3WFkx6d+1TIsP39WGY= +cloud.google.com/go/vpcaccess v1.4.0/go.mod h1:aQHVbTWDYUR1EbTApSVvMq1EnT57ppDmQzZ3imqIk4w= +cloud.google.com/go/vpcaccess v1.5.0/go.mod h1:drmg4HLk9NkZpGfCmZ3Tz0Bwnm2+DKqViEpeEpOq0m8= +cloud.google.com/go/vpcaccess v1.6.0/go.mod h1:wX2ILaNhe7TlVa4vC5xce1bCnqE3AeH27RV31lnmZes= cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xXZmFiHmGE= cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= +cloud.google.com/go/webrisk v1.6.0/go.mod h1:65sW9V9rOosnc9ZY7A7jsy1zoHS5W9IAXv6dGqhMQMc= +cloud.google.com/go/webrisk v1.7.0/go.mod h1:mVMHgEYH0r337nmt1JyLthzMr6YxwN1aAIEc2fTcq7A= +cloud.google.com/go/webrisk v1.8.0/go.mod h1:oJPDuamzHXgUc+b8SiHRcVInZQuybnvEW72PqTc7sSg= +cloud.google.com/go/websecurityscanner v1.3.0/go.mod h1:uImdKm2wyeXQevQJXeh8Uun/Ym1VqworNDlBXQevGMo= +cloud.google.com/go/websecurityscanner v1.4.0/go.mod h1:ebit/Fp0a+FWu5j4JOmJEV8S8CzdTkAS77oDsiSqYWQ= +cloud.google.com/go/websecurityscanner v1.5.0/go.mod h1:Y6xdCPy81yi0SQnDY1xdNTNpfY1oAgXUlcfN3B3eSng= cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= -cosmossdk.io/api v0.4.2 h1:lQBMl4xINnMnBOR/tQLtjlDnR4exr4e6/SfHR8PILE0= -cosmossdk.io/api v0.4.2/go.mod h1:qrVgOp7DIeAXa+Tt5dDjOC47bZCDrwx8ZHxrmy7STNE= -cosmossdk.io/collections v0.2.0 h1:CgMfLtE16+qox3zBYrGh60i4yKV8SeExLnIdOS2sbQs= -cosmossdk.io/collections v0.2.0/go.mod h1:Oc1FK0vlmxJZsgUn9/o3ldE6zNyWKvobVzaLhWknZJE= -cosmossdk.io/core v0.8.0 h1:LcJnu52E1a8f8E317VfQ1xK/RZe+IuhMNQAjnDLh25M= -cosmossdk.io/core v0.8.0/go.mod h1:LF6VLOv2DdCiaHxYVmr0MZcZpaSM9ZgvyrQSYTeg6D0= -cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw= -cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= -cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 h1:BCRz06fvddw7cKGiEGDiSox3qMsjQ97f92K+PDZDHdc= -cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741/go.mod h1:TB05o6YXkZkzsc+6bZFAV5kZRBtoCU9tUkbeMIqEg0w= -cosmossdk.io/log v1.1.0 h1:v0ogPHYeTzPcBTcPR1A3j1hkei4pZama8kz8LKlCMv0= -cosmossdk.io/log v1.1.0/go.mod h1:6zjroETlcDs+mm62gd8Ig7mZ+N+fVOZS91V17H+M4N4= -cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= -cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= -cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c h1:A+FMPW9GtfcPBDQNtFeDFN27h1SAP6OVjnGgPLlYXmI= -cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c/go.mod h1:RbYGvXCbz8uNBCXrwS9Z8SyydeWi+W5x5MZ33muyzMw= -cosmossdk.io/x/tx v0.8.0 h1:gLiGRL/Fy7fs6dd0IX8jOf0PrVr56/SG6XVMGQjyvJU= -cosmossdk.io/x/tx v0.8.0/go.mod h1:T9uEumGNgKU61gJYRv1t3uzQwLnASpJGmSE229HM3xA= +cloud.google.com/go/workflows v1.8.0/go.mod h1:ysGhmEajwZxGn1OhGOGKsTXc5PyxOc0vfKf5Af+to4M= +cloud.google.com/go/workflows v1.9.0/go.mod h1:ZGkj1aFIOd9c8Gerkjjq7OW7I5+l6cSvT3ujaO/WwSA= +cloud.google.com/go/workflows v1.10.0/go.mod h1:fZ8LmRmZQWacon9UCX1r/g/DfAXx5VcPALq2CxzdePw= +cosmossdk.io/api v0.7.6 h1:PC20PcXy1xYKH2KU4RMurVoFjjKkCgYRbVAD4PdqUuY= +cosmossdk.io/api v0.7.6/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= +cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= +cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= +cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= +cosmossdk.io/depinject v1.1.0 h1:wLan7LG35VM7Yo6ov0jId3RHWCGRhe8E8bsuARorl5E= +cosmossdk.io/depinject v1.1.0/go.mod h1:kkI5H9jCGHeKeYWXTqYdruogYrEeWvBQCw1Pj4/eCFI= +cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= +cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= +cosmossdk.io/log v1.5.0 h1:dVdzPJW9kMrnAYyMf1duqacoidB9uZIl+7c6z0mnq0g= +cosmossdk.io/log v1.5.0/go.mod h1:Tr46PUJjiUthlwQ+hxYtUtPn4D/oCZXAkYevBeh5+FI= +cosmossdk.io/math v1.5.0 h1:sbOASxee9Zxdjd6OkzogvBZ25/hP929vdcYcBJQbkLc= +cosmossdk.io/math v1.5.0/go.mod h1:AAwwBmUhqtk2nlku174JwSll+/DepUXW3rWIXN5q+Nw= +cosmossdk.io/store v1.1.1 h1:NA3PioJtWDVU7cHHeyvdva5J/ggyLDkyH0hGHl2804Y= +cosmossdk.io/store v1.1.1/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM= +cosmossdk.io/x/tx v0.13.7 h1:8WSk6B/OHJLYjiZeMKhq7DK7lHDMyK0UfDbBMxVmeOI= +cosmossdk.io/x/tx v0.13.7/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= +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= 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/99designs/keyring v1.2.1 h1:tYLp1ULvO7i3fI5vE21ReQuj99QFSs7lGm0xWyJo87o= github.com/99designs/keyring v1.2.1/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= -github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= -github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= +github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= -github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0 h1:3c8yed4lgqTt+oTQ+JNMDo+F4xprBf+O/il4ZC0nRLw= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0/go.mod h1:obipzmGjfSjam60XLwGfqUkJsfiheAl+TUjG+4yzyPM= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.48.1 h1:UQ0AhxogsIRZDkElkblfnwjc3IaltCm2HUMvezQaL7s= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.48.1/go.mod h1:jyqM3eLpJ3IbIFDTKVz2rF9T/xWGW0rIriGwnz8l9Tk= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.48.1 h1:oTX4vsorBZo/Zdum6OKPA4o7544hm6smoRv1QjpTwGo= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.48.1/go.mod h1:0wEl7vrAD8mehJyohS9HZy+WyEOaQO2mJx86Cvh93kM= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.48.1 h1:8nn+rsCvTq9axyEh382S0PFLBeaFwNsT43IrPWzctRU= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.48.1/go.mod h1:viRWSEhtMZqz1rhwmOVKkWl6SwmVowfL9O2YR5gI2PE= +github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= -github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= +github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= 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/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= +github.com/adlio/schema v1.3.6 h1:k1/zc2jNfeiZBA5aFTRy37jlBIuCkXCm0XmvpzCKI9I= +github.com/adlio/schema v1.3.6/go.mod h1:qkxwLgPBd1FgLRHYVCmQT/rrBr3JH38J9LjmVzWNudg= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= -github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= -github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c= +github.com/ajstarks/deck v0.0.0-20200831202436-30c9fc6549a9/go.mod h1:JynElWSGnm/4RlzPXRlREEwqTHAN3T56Bv2ITsFT3gY= +github.com/ajstarks/deck/generate v0.0.0-20210309230005-c3f852c02e19/go.mod h1:T13YZdzov6OU0A1+RfKZiZN9ca6VeKdBdyDV+BY97Tk= +github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= +github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/apache/arrow/go/v10 v10.0.1/go.mod h1:YvhnlEePVnBS4+0z3fhPfUy7W1Ikj0Ih0vcRo/gZ1M0= +github.com/apache/arrow/go/v11 v11.0.0/go.mod h1:Eg5OsL5H+e299f7u5ssuXsuHQVEGC4xei5aX110hRiI= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= 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/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= @@ -258,7 +698,6 @@ github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX 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/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -269,15 +708,23 @@ github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bits-and-blooms/bitset v1.7.0 h1:YjAGVd3XmtK9ktAbX8Zg2g2PwLIMjGREZJHlV4j7NEo= -github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= -github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= -github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= -github.com/bufbuild/protocompile v0.5.1 h1:mixz5lJX4Hiz4FpqFREJHIXLfaLBntfaJv1h+/jS+Qg= +github.com/bits-and-blooms/bitset v1.8.0 h1:FD+XqgOZDUxxZ8hzoBFuV9+cGWY9CslN6d5MS5JVb4c= +github.com/bits-and-blooms/bitset v1.8.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= +github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= +github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= +github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= +github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/btcutil v1.1.6 h1:zFL2+c3Lb9gEgqKNzowKUPQNb8jV7v5Oaodi/AYFd6c= +github.com/btcsuite/btcd/btcutil v1.1.6/go.mod h1:9dFymx8HpuLqBnsPELrImQeTQfKBQqzqGbbV3jK55aE= +github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY= +github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE= github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= -github.com/bytedance/sonic v1.8.0 h1:ea0Xadu+sHlu7x5O3gKhRpQ1IKiMrSiHttPF0ybECuA= -github.com/bytedance/sonic v1.8.0/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= +github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= +github.com/bytedance/sonic v1.12.3 h1:W2MGa7RCU1QTeYRTPE3+88mVC0yXmsRQRChiyVocVjU= +github.com/bytedance/sonic v1.12.3/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= +github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= +github.com/bytedance/sonic/loader v0.2.0 h1:zNprn+lsIP06C/IqCHs3gPQIvnvpKbbxyXQP1iU4kWM= +github.com/bytedance/sonic/loader v0.2.0/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= @@ -285,14 +732,15 @@ github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInq github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= +github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= 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/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= -github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM= @@ -307,83 +755,94 @@ github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6D github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/0Y= +github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= +github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg= +github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20241223141626-cff3c89139a3 h1:boJj011Hh+874zpIySeApCX4GeOjPl9qhRF3QuIZq+Q= +github.com/cncf/xds/go v0.0.0-20241223141626-cff3c89139a3/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8= github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= -github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= +github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= +github.com/cockroachdb/apd/v3 v3.2.1 h1:U+8j7t0axsIgvQUqthuNm82HIrYXodOV2iWLWtEaIwg= +github.com/cockroachdb/apd/v3 v3.2.1/go.mod h1:klXJcjp+FffLTHlhIG69tezTDvdP065naDsHzKhYSqc= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= -github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= -github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= +github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce h1:giXvy4KSc/6g/esnpM7Geqxka4WSqI1SZc7sMJFd3y4= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/pebble v0.0.0-20230606152911-c4be581b807f h1:qQW3qCVRpjYsV4YNaUOjm6YLeliAD2jpgex9+D9tqU4= -github.com/cockroachdb/pebble v0.0.0-20230606152911-c4be581b807f/go.mod h1:TkdVsGYRqtULUppt2RbC+YaKtTHnHoWa2apfFrSKABw= -github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/cockroachdb/redact v1.1.4 h1:Y0XrVI2FAyofNyGveodTN//qdpPtFKcKTeCBsK3AHAQ= -github.com/cockroachdb/redact v1.1.4/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/pebble v1.1.2 h1:CUh2IPtR4swHlEj48Rhfzw6l/d0qA31fItcIszQVIsA= +github.com/cockroachdb/pebble v1.1.2/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= -github.com/cometbft/cometbft v0.38.0-rc1 h1:ph6smlqX82aH+d72KuxDHqu29M7LyusSp/obfGsGX/w= -github.com/cometbft/cometbft v0.38.0-rc1/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= -github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= -github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= +github.com/cometbft/cometbft v0.38.17 h1:FkrQNbAjiFqXydeAO81FUzriL4Bz0abYxN/eOHrQGOk= +github.com/cometbft/cometbft v0.38.17/go.mod h1:5l0SkgeLRXi6bBfQuevXjKqML1jjfJJlvI1Ulp02/o4= +github.com/cometbft/cometbft-db v0.14.1 h1:SxoamPghqICBAIcGpleHbmoPqy+crij/++eZz3DlerQ= +github.com/cometbft/cometbft-db v0.14.1/go.mod h1:KHP1YghilyGV/xjD5DP3+2hyigWx0WTp9X+0Gnx0RxQ= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= +github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= -github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0E= -github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= -github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= -github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= +github.com/cosmos/cosmos-db v1.1.1 h1:FezFSU37AlBC8S98NlSagL76oqBRWq/prTPvFcEJNCM= +github.com/cosmos/cosmos-db v1.1.1/go.mod h1:AghjcIPqdhSLP/2Z0yha5xPH3nLnskz81pBx3tcVSAw= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= +github.com/cosmos/cosmos-sdk v0.50.13 h1:xQ32hhzVy7agEe7behMdZN0ezWhPss3KoLZsF9KoBnw= +github.com/cosmos/cosmos-sdk v0.50.13/go.mod h1:hrWEFMU1eoXqLJeE6VVESpJDQH67FS1nnMrQIjO2daw= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoKuI= -github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= -github.com/cosmos/iavl v1.0.0-beta.2 h1:XOsIM80Yyml/KifCXEYOy9tWCXwMAbLa91n6pReW07Y= -github.com/cosmos/iavl v1.0.0-beta.2/go.mod h1:EA97dJ07TBktRlG/iGzK6g1eCXNj1q3MGoFYkVzrwHE= -github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= -github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= -github.com/cosmos/ledger-cosmos-go v0.13.0 h1:ex0CvCxToSR7j5WjrghPu2Bu9sSXKikjnVvUryNnx4s= -github.com/cosmos/ledger-cosmos-go v0.13.0/go.mod h1:ZcqYgnfNJ6lAXe4HPtWgarNEY+B74i+2/8MhZw4ziiI= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= +github.com/cosmos/iavl v1.2.2 h1:qHhKW3I70w+04g5KdsdVSHRbFLgt3yY3qTMd4Xa4rC8= +github.com/cosmos/iavl v1.2.2/go.mod h1:GiM43q0pB+uG53mLxLDzimxM9l/5N9UuSY3/D0huuVw= +github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= +github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= +github.com/cosmos/ledger-cosmos-go v0.14.0 h1:WfCHricT3rPbkPSVKRH+L4fQGKYHuGOK9Edpel8TYpE= +github.com/cosmos/ledger-cosmos-go v0.14.0/go.mod h1:E07xCWSBl3mTGofZ2QnL4cIUzMbbGVyik84QYKbX3RA= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= -github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= -github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= -github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= -github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= -github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= +github.com/dgraph-io/badger/v4 v4.2.0 h1:kJrlajbXXL9DFTNuhhu9yCx7JJa4qpYWxtE8BzuWsEs= +github.com/dgraph-io/badger/v4 v4.2.0/go.mod h1:qfCqhPoWDFJRx1gp5QwwyGo8xk1lbHUxvK9nK0OGAak= github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= @@ -391,20 +850,22 @@ github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUn github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= 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/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= 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/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= -github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= +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/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= -github.com/emicklei/dot v1.4.2 h1:UbK6gX4yvrpHKlxuUQicwoAis4zl8Dzwit9SnbBAXWw= -github.com/emicklei/dot v1.4.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= +github.com/emicklei/dot v1.6.2 h1:08GN+DD79cy/tzN6uLCT84+2Wk9u+wvqP+Hkx/dIR8A= +github.com/emicklei/dot v1.6.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -415,81 +876,105 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.m github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= +github.com/envoyproxy/go-control-plane v0.10.3/go.mod h1:fJJn/j26vwOu972OllsvAgJJM//w9BV6Fxbg2LuVd34= +github.com/envoyproxy/go-control-plane v0.11.1-0.20230524094728-9239064ad72f/go.mod h1:sfYdkwUW4BA3PbKjySwjJy+O4Pu0h62rlqCMHNk+K+Q= +github.com/envoyproxy/go-control-plane v0.13.4 h1:zEqyPVyku6IvWCFwux4x9RxkLOMUL+1vC9xUFv5l2/M= +github.com/envoyproxy/go-control-plane v0.13.4/go.mod h1:kDfuBlDVsSj2MjrLEtRWtHlsWIFcGyB2RMO44Dc5GZA= +github.com/envoyproxy/go-control-plane/envoy v1.32.4 h1:jb83lalDRZSpPWW2Z7Mck/8kXZ5CQAFYVjQcdVIr83A= +github.com/envoyproxy/go-control-plane/envoy v1.32.4/go.mod h1:Gzjc5k8JcJswLjAx1Zm+wSYE20UrLtt7JZMWiWQXQEw= +github.com/envoyproxy/go-control-plane/ratelimit v0.1.0 h1:/G9QYbddjL25KvtKTv3an9lx6VBE2cnb8wp1vEGNYGI= +github.com/envoyproxy/go-control-plane/ratelimit v0.1.0/go.mod h1:Wk+tMFAFbCXaJPzVVHnPgRKdUdwW/KdbRt94AzgRee4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= -github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= -github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= -github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= -github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= +github.com/envoyproxy/protoc-gen-validate v0.6.7/go.mod h1:dyJXwwfPK2VSqiB9Klm1J6romD608Ba7Hij42vrOBCo= +github.com/envoyproxy/protoc-gen-validate v0.9.1/go.mod h1:OKNgG7TCp5pF4d6XftA0++PMirau2/yoOwVac3AbF2w= +github.com/envoyproxy/protoc-gen-validate v0.10.1/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss= +github.com/envoyproxy/protoc-gen-validate v1.2.1 h1:DEo3O99U8j4hBFwbJfrz9VtgcDfUKS7KJ7spH3d86P8= +github.com/envoyproxy/protoc-gen-validate v1.2.1/go.mod h1:d/C80l/jxXLdfEIhX1W2TmLfsJ31lvEjwamM4DxlWXU= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= -github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= +github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= -github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= -github.com/getsentry/sentry-go v0.21.0 h1:c9l5F1nPF30JIppulk4veau90PK6Smu3abgVtVQWon4= -github.com/getsentry/sentry-go v0.21.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= +github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= +github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= +github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= +github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.9.0 h1:OjyFBKICoexlu99ctXNR2gg+c5pKrKMuyjgARg9qeY8= -github.com/gin-gonic/gin v1.9.0/go.mod h1:W1Me9+hsUSyj3CePGrd1/QrKJMSJ1Tu/0hFEH89961k= -github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= +github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= +github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g= +github.com/go-fonts/latin-modern v0.2.0/go.mod h1:rQVLdDMK+mK1xscDwsqM5J8U2jrRa3T0ecnM9pNujks= +github.com/go-fonts/liberation v0.1.1/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= +github.com/go-fonts/liberation v0.2.0/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= +github.com/go-fonts/stix v0.1.0/go.mod h1:w/c1f0ldAUlJmLBvlbkvVXLAD+tAMqobIIQpmnUIzUY= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= -github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= -github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= +github.com/go-kit/kit v0.13.0 h1:OoneCcHKHQ03LfBpoQCUfCluwd2Vt3ohz+kvbJneZAU= +github.com/go-kit/kit v0.13.0/go.mod h1:phqEHMMUbyrCFCTgH48JueqrM3md2HcAZ8N3XE4FKDg= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= +github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07/go.mod h1:CO1AlKB2CSIqUrmQPqA0gdRIlnLEY0gK5JGjh37zN5U= +github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81/go.mod h1:SX0U8uGpxhq9o2S/CELCSUxEWWAuoCUcVCQWv7G2OCk= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +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-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.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU= -github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= +github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js= +github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= -github.com/goccy/go-json v0.10.0 h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA= -github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= +github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= -github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= 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= @@ -500,11 +985,12 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV 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/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= -github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= +github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= +github.com/golang/glog v1.2.4 h1:CNNw5U8lSiiBk7druxtSHHTsRWcxKoac6kZKm2peBBc= +github.com/golang/glog v1.2.4/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -539,17 +1025,19 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -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/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= +github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= +github.com/google/flatbuffers v2.0.8+incompatible h1:ivUb1cGomAB101ZM1T0nOiWz9pSrTMoa9+EiY7igmkM= +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.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -564,18 +1052,21 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= -github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= +github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/martian/v3 v3.3.3 h1:DIhPTQrbPkgs2yJYdXU/eNACCG5DVQjySNRNlflZ9Fc= +github.com/google/martian/v3 v3.3.3/go.mod h1:iEPrYcgCF7jA9OtScMFQyAlZZ4YXTKEtJ1E6RWzmBA0= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -595,17 +1086,20 @@ github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/s2a-go v0.1.3 h1:FAgZmpLl/SXurPEZyCMPBIiiYeTbqfjlbdnCNTAkbGE= -github.com/google/s2a-go v0.1.3/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= +github.com/google/s2a-go v0.1.9 h1:LGD7gtMgezd8a/Xak7mEWL0PjoTQFvpRudN895yqKW0= +github.com/google/s2a-go v0.1.9/go.mod h1:YA0Ei2ZQL3acow2O62kdp9UlnvMmU7kA6Eutn0dXayM= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= -github.com/googleapis/enterprise-certificate-proxy v0.2.3 h1:yk9/cqRKtT9wXZSsRH9aurXEpJX+U6FLtpYTdC3R06k= +github.com/googleapis/enterprise-certificate-proxy v0.2.1/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= +github.com/googleapis/enterprise-certificate-proxy v0.3.4 h1:XYIDZApgAnrN1c855gTgghdIA6Stxb52D5RnLI1SLyw= +github.com/googleapis/enterprise-certificate-proxy v0.3.4/go.mod h1:YKe7cfqYXjKGpGvmSg28/fFvhNzinZQm8DGnaburhGA= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= @@ -615,8 +1109,10 @@ github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99 github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= -github.com/googleapis/gax-go/v2 v2.8.0 h1:UBtEZqx1bjXtOQ5BVTkuYghXrr3N4V123VKJK67vJZc= -github.com/googleapis/gax-go/v2 v2.8.0/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= +github.com/googleapis/gax-go/v2 v2.7.0/go.mod h1:TEop28CZZQ2y+c0VxMUmu1lV+fQx57QpBWsYpwqHJx8= +github.com/googleapis/gax-go/v2 v2.7.1/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= +github.com/googleapis/gax-go/v2 v2.14.1 h1:hb0FFeiPaQskmvakKu5EbCbpntQn48jyHuvrkurSS/Q= +github.com/googleapis/gax-go/v2 v2.14.1/go.mod h1:Hb/NubMaVM88SrNkvl8X/o8XWwDJEPqouaLeN2IUxoA= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -629,8 +1125,8 @@ github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= @@ -639,6 +1135,8 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgf github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w= 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/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= @@ -648,17 +1146,19 @@ github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-getter v1.7.1 h1:SWiSWN/42qdpR0MdhaOc/bLR48PLuP1ZQtYLRlM69uY= -github.com/hashicorp/go-getter v1.7.1/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= +github.com/hashicorp/go-getter v1.7.8 h1:mshVHx1Fto0/MydBekWan5zUipGq7jO0novchgMmSiY= +github.com/hashicorp/go-getter v1.7.8/go.mod h1:2c6CboOEb9jG6YvmC9xdD+tyAFsrUaJPedwXDGr0TM4= github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-metrics v0.5.4 h1:8mmPiIJkTPPEbAiV97IxdAGNdRdaWwVap1BU6elejKY= +github.com/hashicorp/go-metrics v0.5.4/go.mod h1:CG5yz4NZ/AI/aQt9Ucm/vdBnbh7fvmv4lxZ350i+QQI= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-plugin v1.4.10 h1:xUbmA4jC6Dq163/fWcp8P3JuHilrHHMLNRxzGQJ9hNk= -github.com/hashicorp/go-plugin v1.4.10/go.mod h1:6/1TEzT0eQznvI/gV2CM29DLSkAK/e58mUWKVsPaph0= +github.com/hashicorp/go-plugin v1.5.2 h1:aWv8eimFqWlsEiMrYZdPYl+FdHaBJSN4AWwGWfT1G2Y= +github.com/hashicorp/go-plugin v1.5.2/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= @@ -674,10 +1174,10 @@ github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= @@ -692,24 +1192,19 @@ github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0Jr github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw= github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= -github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= -github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= +github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= -github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= -github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= -github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= -github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= -github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= +github.com/jhump/protoreflect v1.15.3 h1:6SFRuqU45u9hIZPJAoZ8c28T3nK64BNdp9w6jFonzls= +github.com/jhump/protoreflect v1.15.3/go.mod h1:4ORHmSBmlCW8fh3xHmJMGyul1zNqZK4Elxc8qKP+p1k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= 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= @@ -724,6 +1219,7 @@ github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= @@ -731,28 +1227,24 @@ github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/X github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= 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/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= -github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= -github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= -github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= -github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= +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/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= +github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI= -github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/klauspost/cpuid v1.2.1 h1:vJi+O/nMdFt0vqm8NZBI6wzALWdA2X+egi0ogNyrC/w= -github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= +github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= +github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= @@ -766,53 +1258,46 @@ 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.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= -github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= -github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= -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= -github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= +github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.0 h1:H4L/LhP7GOMf1j17oQAElHgVlbEje2h14A8Tz9cM2BE= -github.com/linxGnu/grocksdb v1.8.0/go.mod h1:09CeBborffXhXdNpEcOeZrLKEnRtrZFEpFdPNI9Zjjg= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= +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= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.8/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= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= 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-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= +github.com/mattn/go-sqlite3 v1.14.14/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= -github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= -github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= +github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY= +github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE= +github.com/minio/highwayhash v1.0.3 h1:kbnuUMoHYyVl7szWjSxJnxw11k2U709jqFPPmIUyD6Q= +github.com/minio/highwayhash v1.0.3/go.mod h1:GGYsuwP/fPD6Y9hMiXuapVvlIUEhFhMTh0rxU3ik1LQ= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= @@ -824,8 +1309,6 @@ github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS4 github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/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= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -833,9 +1316,10 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= 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/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -851,8 +1335,8 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce h1:/pEpMk55wH0X+E5zedGEMOdLuWmV8P4+4W3+LZaM6kg= -github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a h1:dlRvE5fWabOchtH7znfiFCcOvmIYgOeAS5ifBXBlh9Q= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= @@ -860,7 +1344,6 @@ github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DV github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= @@ -872,10 +1355,14 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/onsi/gomega v1.26.0 h1:03cDLK28U6hWvCAns6NeydX3zIm4SF3ci69ulidS32Q= +github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= 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-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= -github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= +github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= +github.com/opencontainers/runc v1.1.12 h1:BOIssBaW1La0/qbNZHXOOa71dZfZEQOzW7dqQf3phss= +github.com/opencontainers/runc v1.1.12/go.mod h1:S+lQwSfncpBha7XTy/5lBwWgm5+y5Ma/O44Ekby9FK8= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -885,21 +1372,24 @@ github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJ github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= +github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= -github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= +github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= +github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= -github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761 h1:W04oB3d0J01W5jgYRGKsV8LCM6g9EkCvPkZcmFuy0OE= -github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 h1:Dx7Ovyv/SFnMFw3fD4oEoeorXc6saIiQ23LrGLth0Gw= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2dXMnm1mY= +github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= +github.com/phpdave11/gofpdi v1.0.13/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= @@ -908,9 +1398,13 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= @@ -918,103 +1412,103 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.15.1 h1:8tXpTmJbyH5lydzFPoxSIJ0J46jdh3tylbvM1xCv0LI= -github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= +github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= +github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= -github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= -github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io= +github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= -github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= 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/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= 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= -github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= -github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= -github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.29.1 h1:cO+d60CHkknCbvzEWxP0S9K6KqyTjrCNUy1LdQLCGPc= -github.com/rs/zerolog v1.29.1/go.mod h1:Le6ESbR7hc+DP6Lt1THiV8CQSdkkNrd3R0XbEgp3ZBU= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= +github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= +github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/locafero v0.7.0 h1:5MqpDsTGNDhY8sGp0Aowyf0qKsPrhewaLSsFaodPcyo= +github.com/sagikazarmark/locafero v0.7.0/go.mod h1:2za3Cg5rMaTMoG/2Ulr9AwtFaIppKXTRYnozin4aB5k= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -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/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= +github.com/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb2NsU= +github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= -github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= -github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= -github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= +github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= +github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= +github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= +github.com/spf13/afero v1.12.0 h1:UcOPyRBYczmFn6yvphxkn9ZEOY65cpwGKb5mL36mrqs= +github.com/spf13/afero v1.12.0/go.mod h1:ZTlWwG4/ahT8W7T0WQ5uYmjI9duaLQGy3Q2OAl4sk/4= +github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= +github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo= +github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= -github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= +github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= +github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.20.0 h1:zrxIyR3RQIOsarIrgL8+sAvALXul9jeEPa06Y0Ph6vY= +github.com/spf13/viper v1.20.0/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -1025,62 +1519,46 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= -github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +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.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= -github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= +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/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= -github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/ugorji/go/codec v1.2.9 h1:rmenucSohSTiyL09Y+l2OCk+FrMxGMzho2+tjr5ticU= -github.com/ugorji/go/codec v1.2.9/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= +github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= +github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= 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.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= -github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= -github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= -github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= -github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= -github.com/zondax/ledger-go v0.14.1 h1:Pip65OOl4iJ84WTpA4BKChvOufMhhbxED3BaihoZN4c= -github.com/zondax/ledger-go v0.14.1/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2feOQv8K320= +github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= +github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= +github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= +github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= +github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= +github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= -go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 h1:qxen9oVGzDdIRP6ejyAJc760RwW4SnVDiTYTzwnXuxo= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5/go.mod h1:eW0HG9/oHQhvRCvb1/pIXW4cOvtDqeQK+XSi3TnwaXY= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= @@ -1093,7 +1571,29 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= +go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= +go.opentelemetry.io/contrib/detectors/gcp v1.34.0 h1:JRxssobiPg23otYU5SbWtQC//snGVIM3Tx6QRzlQBao= +go.opentelemetry.io/contrib/detectors/gcp v1.34.0/go.mod h1:cV4BMFcscUR/ckqLkbfQmF0PRsq8w/lMGzdbCSveBHo= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.58.0 h1:PS8wXpbyaDJQ2VDHHncMe9Vct0Zn1fEjpsjrLxGJoSc= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.58.0/go.mod h1:HDBUsEjOuRC0EzKZ1bSaRGZWUBAzo+MhAcUUORSr4D0= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 h1:yd02MEjBdJkG3uabWP9apV+OuWRIXGDuJEUJbOHmCFU= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0/go.mod h1:umTcuxiv1n/s/S6/c2AT/g2CQ7u5C59sHDNmfSwgz7Q= +go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY= +go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0 h1:WDdP9acbMYjbKIyJUhTvtzj601sVJOqgWdUxSdR/Ysc= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0/go.mod h1:BLbf7zbNIONBLPwvFnwNHGj4zge8uTCM/UPIVW1Mq2I= +go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ= +go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE= +go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A= +go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU= +go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk= +go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w= +go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k= +go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= +go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -1102,35 +1602,44 @@ go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -golang.org/x/arch v0.0.0-20210923205945-b76863e36670 h1:18EFjUmQOcUvxNYSkA6jO9VAiXCnxFY6NyDX0bHDmkU= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k= +golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= -golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= +golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= +golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= +golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= +golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs= +golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ= +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= +golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3/go.mod h1:NOZ3BPKG0ec/BKJQgnvsSFpcKLM5xXVWnvZS97DWHgE= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= @@ -1138,10 +1647,22 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/exp v0.0.0-20220827204233-334a2380cb91/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= +golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20210216034530-4410531fe030/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= +golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= +golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= +golang.org/x/image v0.0.0-20220302094943-723b81ca9867/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1165,8 +1686,17 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= +golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.23.0 h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM= +golang.org/x/mod v0.23.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= 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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1178,7 +1708,6 @@ golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -1188,7 +1717,6 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1217,8 +1745,8 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= @@ -1229,12 +1757,23 @@ golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.0.0-20221012135044-0b7e1fb9d458/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= +golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= +golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= 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= @@ -1258,10 +1797,14 @@ golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7Lm golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= -golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8= -golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= +golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec= +golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I= +golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= +golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= +golang.org/x/oauth2 v0.27.0 h1:da9Vo7/tDv5RH/7nZDz1eMGS/q1Vv1N/7FCrBhI9I3M= +golang.org/x/oauth2 v0.27.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1275,9 +1818,15 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= -golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.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.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= +golang.org/x/sync v0.11.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-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1286,10 +1835,7 @@ golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 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-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1297,9 +1843,7 @@ golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1328,35 +1872,38 @@ golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210304124612-50617c2ba197/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 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-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1374,24 +1921,44 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= +golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= 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= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= +golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= +golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= +golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= +golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= +golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU= +golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s= 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= @@ -1403,26 +1970,37 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +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.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= +golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= +golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 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= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20220922220347-f3bd1da661af/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +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.10.0 h1:3usCWA8tQn0L8+hFJQNgzpWbd89begxN66o1Ojdn5L4= +golang.org/x/time v0.10.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-20180828015842-6cd1fcedba52/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-20181221001348-537d06c36207/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= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -1432,6 +2010,7 @@ golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1465,6 +2044,7 @@ golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -1477,8 +2057,15 @@ golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= +golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.30.0 h1:BgcpHewrV5AUp2G9MebG4XPFI1E2W41zU1SaqVA9vJY= +golang.org/x/tools v0.30.0/go.mod h1:c347cR/OJfw5TI+GfX7RUPNMdDRRbjvYTS0jPyvsVtY= 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= @@ -1486,8 +2073,15 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= +gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= +gonum.org/v1/gonum v0.9.3/go.mod h1:TZumC3NeyVQskjXqmyWt4S3bINhy7B4eYwW69EbyX+0= +gonum.org/v1/gonum v0.11.0/go.mod h1:fSG4YDCxxUZQJ7rKsQrj0gMOg00Il0Z96/qMA4bVQhA= +gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= +gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= +gonum.org/v1/plot v0.9.0/go.mod h1:3Pcqqmp6RHvJI72kgb8fThyUnav364FOsdDo2aGW5lY= +gonum.org/v1/plot v0.10.1/go.mod h1:VZW5OlhkL1mysU9vaqNHnsy86inf6Ot+jB3r+BczCEo= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= @@ -1536,9 +2130,18 @@ google.golang.org/api v0.95.0/go.mod h1:eADj+UBuxkh5zlrSntJghuNeg8HwQ1w5lTKkuqaE google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= +google.golang.org/api v0.99.0/go.mod h1:1YOf74vkVndF7pG6hIHuINsM7eWwpVTAfNMNiL91A08= google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= -google.golang.org/api v0.122.0 h1:zDobeejm3E7pEG1mNHvdxvjs5XJoCMzyNH+CmwL94Es= -google.golang.org/api v0.122.0/go.mod h1:gcitW0lvnyWjSp9nKxAbdHKIZ6vF4aajGueeslZOyms= +google.golang.org/api v0.102.0/go.mod h1:3VFl6/fzoA+qNuS1N1/VfXY4LjoXN/wzeIp7TweWwGo= +google.golang.org/api v0.103.0/go.mod h1:hGtW6nK1AC+d9si/UBhw8Xli+QMOf6xyNAyJw4qU9w0= +google.golang.org/api v0.106.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= +google.golang.org/api v0.107.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= +google.golang.org/api v0.108.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= +google.golang.org/api v0.110.0/go.mod h1:7FC4Vvx1Mooxh8C5HWjzZHcavuS2f6pmJpZx60ca7iI= +google.golang.org/api v0.111.0/go.mod h1:qtFHvU9mhgTJegR31csQ+rwxyUTHOKFqCKWp1J0fdw0= +google.golang.org/api v0.114.0/go.mod h1:ifYI2ZsFK6/uGddGfAD5BMxlnkBqCmqHSDUVi45N5Yg= +google.golang.org/api v0.222.0 h1:Aiewy7BKLCuq6cUCeOUrsAlzjXPqBkEeQ/iwGHVQa/4= +google.golang.org/api v0.222.0/go.mod h1:efZia3nXpWELrwMlN5vyQrD4GmJN1Vw0x68Et3r+a9c= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1546,9 +2149,7 @@ google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1624,6 +2225,7 @@ google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2 google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= +google.golang.org/genproto v0.0.0-20220329172620-7be39ac1afc7/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= @@ -1656,14 +2258,41 @@ google.golang.org/genproto v0.0.0-20220926220553-6981cbe3cfce/go.mod h1:woMGP53B google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqwhZAwq4wsRUaVG555sVgsNmIjRtO7t/JH29U= google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= -google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20230525234025-438c736192d0 h1:x1vNwUhVOcsYoKyEGCZBH694SBmmBjA2EfauFVEI2+M= -google.golang.org/genproto v0.0.0-20230525234025-438c736192d0/go.mod h1:9ExIQyXL5hZrHzQceCwuSYwZZ5QZBazOcprJ5rgs3lY= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a h1:HiYVD+FGJkTo+9zj1gqz0anapsa1JxjiSrN+BJKyUmE= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a/go.mod h1:ts19tUU+Z0ZShN1y3aPyq2+O3d5FUNNgT6FtOzmrNn8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/genproto v0.0.0-20221024153911-1573dae28c9c/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= +google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= +google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c/go.mod h1:CGI5F/G+E5bKwmfYo09AXuVN4dD894kIKUFmVbP2/Fo= +google.golang.org/genproto v0.0.0-20221109142239-94d6d90a7d66/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221114212237-e4508ebdbee1/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221117204609-8f9c96812029/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221201164419-0e50fba7f41c/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221201204527-e3fa12d562f3/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd/go.mod h1:cTsE614GARnxrLsqKREzmNYJACSWWpAWdNMwnD7c2BE= +google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230112194545-e10362b5ecf9/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230113154510-dbe35b8444a5/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230123190316-2c411cf9d197/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230124163310-31e0e69b6fc2/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230125152338-dcaf20b6aeaa/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230127162408-596548ed4efa/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230209215440-0dfe4f8abfcc/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230216225411-c8e22ba71e44/go.mod h1:8B0gmkoRebU8ukX6HP+4wrVQUY1+6PkQ44BSyIlflHA= +google.golang.org/genproto v0.0.0-20230222225845-10f96fb3dbec/go.mod h1:3Dl5ZL0q0isWJt+FVcfpQyirqemEuLAK/iFvg1UP1Hw= +google.golang.org/genproto v0.0.0-20230223222841-637eb2293923/go.mod h1:3Dl5ZL0q0isWJt+FVcfpQyirqemEuLAK/iFvg1UP1Hw= +google.golang.org/genproto v0.0.0-20230303212802-e74f57abe488/go.mod h1:TvhZT5f700eVlTNwND1xoEZQeWTB2RY/65kplwl/bFA= +google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= +google.golang.org/genproto v0.0.0-20230320184635-7606e756e683/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= +google.golang.org/genproto v0.0.0-20230323212658-478b75c54725/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= +google.golang.org/genproto v0.0.0-20230330154414-c0448cd141ea/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= +google.golang.org/genproto v0.0.0-20230331144136-dcfb400f0633/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= +google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= +google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 h1:ToEetK57OidYuqD4Q5w+vfEnPvPpuTwedCNVohYJfNk= +google.golang.org/genproto v0.0.0-20241118233622-e639e219e697/go.mod h1:JJrvXBWRZaFMxBufik1a4RpFw4HhgVtBBWQeQgUj2cc= +google.golang.org/genproto/googleapis/api v0.0.0-20250224174004-546df14abb99 h1:ilJhrCga0AptpJZXmUYG4MCrx/zf3l1okuYz7YK9PPw= +google.golang.org/genproto/googleapis/api v0.0.0-20250224174004-546df14abb99/go.mod h1:Xsh8gBVxGCcbV8ZeTB9wI5XPyZ5RvC6V3CTeeplHbiA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2 h1:DMTIbak9GhdaSxEjvVzAeNZvyc03I61duqNbnm3SU0M= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2/go.mod h1:LuRYeWDFV6WOn90g357N17oMCaxpgCnbi/44qJvDn2I= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1696,6 +2325,7 @@ google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnD google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= @@ -1705,8 +2335,13 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= +google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= +google.golang.org/grpc v1.52.3/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= +google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= +google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g= +google.golang.org/grpc v1.56.3/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= +google.golang.org/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg= +google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1723,8 +2358,11 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= +google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= +google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1737,10 +2375,6 @@ gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qS 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/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= -gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -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/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= @@ -1755,13 +2389,12 @@ gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 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= -gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= -gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= +gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q= +gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1770,15 +2403,51 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= 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/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= +lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= +modernc.org/cc/v3 v3.36.0/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= +modernc.org/cc/v3 v3.36.2/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= +modernc.org/cc/v3 v3.36.3/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= +modernc.org/ccgo/v3 v3.0.0-20220428102840-41399a37e894/go.mod h1:eI31LL8EwEBKPpNpA4bU1/i+sKOwOrQy8D87zWUcRZc= +modernc.org/ccgo/v3 v3.0.0-20220430103911-bc99d88307be/go.mod h1:bwdAnOoaIt8Ax9YdWGjxWsdkPcZyRPHqrOvJxaKAKGw= +modernc.org/ccgo/v3 v3.16.4/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ= +modernc.org/ccgo/v3 v3.16.6/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ= +modernc.org/ccgo/v3 v3.16.8/go.mod h1:zNjwkizS+fIFDrDjIAgBSCLkWbJuHF+ar3QRn+Z9aws= +modernc.org/ccgo/v3 v3.16.9/go.mod h1:zNMzC9A9xeNUepy6KuZBbugn3c0Mc9TeiJO4lgvkJDo= +modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= +modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= +modernc.org/libc v0.0.0-20220428101251-2d5f3daf273b/go.mod h1:p7Mg4+koNjc8jkqwcoFBJx7tXkpj00G77X7A72jXPXA= +modernc.org/libc v1.16.0/go.mod h1:N4LD6DBE9cf+Dzf9buBlzVJndKr/iJHG97vGLHYnb5A= +modernc.org/libc v1.16.1/go.mod h1:JjJE0eu4yeK7tab2n4S1w8tlWd9MxXLRzheaRnAKymU= +modernc.org/libc v1.16.17/go.mod h1:hYIV5VZczAmGZAnG15Vdngn5HSF5cSkbvfz2B7GRuVU= +modernc.org/libc v1.16.19/go.mod h1:p7Mg4+koNjc8jkqwcoFBJx7tXkpj00G77X7A72jXPXA= +modernc.org/libc v1.17.0/go.mod h1:XsgLldpP4aWlPlsjqKRdHPqCxCjISdHfM/yeWC5GyW0= +modernc.org/libc v1.17.1/go.mod h1:FZ23b+8LjxZs7XtFMbSzL/EhPxNbfZbErxEHc7cbD9s= +modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/mathutil v1.4.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/memory v1.1.1/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= +modernc.org/memory v1.2.0/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= +modernc.org/memory v1.2.1/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= +modernc.org/opt v0.1.1/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/sqlite v1.18.1/go.mod h1:6ho+Gow7oX5V+OiOQ6Tr4xeqbx13UZ6t+Fw9IRUG4d4= +modernc.org/strutil v1.1.1/go.mod h1:DE+MQQ/hjKBZS2zNInV5hhcipt5rLPWkmpbGeW5mmdw= +modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= +modernc.org/tcl v1.13.1/go.mod h1:XOLfOwzhkljL4itZkK6T72ckMgvj0BDsnKNdZVUOecw= +modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= +modernc.org/z v1.5.1/go.mod h1:eWFB510QWW5Th9YGZT81s+LwvaAs3Q2yr4sP0rmLkv8= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= -pgregory.net/rapid v0.6.2 h1:ErW5sL+UKtfBfUTsWHDCoeB+eZKLKMxrSd1VJY6W4bw= -pgregory.net/rapid v0.6.2/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= +nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= +pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= +pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/x/upgrade/handler.go b/x/upgrade/handler.go deleted file mode 100644 index 6e09c39a6bc7..000000000000 --- a/x/upgrade/handler.go +++ /dev/null @@ -1,42 +0,0 @@ -package upgrade - -import ( - "cosmossdk.io/x/upgrade/keeper" - "cosmossdk.io/x/upgrade/types" - - errorsmod "cosmossdk.io/errors" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" -) - -// NewSoftwareUpgradeProposalHandler creates a governance handler to manage new proposal types. -// It enables SoftwareUpgradeProposal to propose an Upgrade, and CancelSoftwareUpgradeProposal -// to abort a previously voted upgrade. -// -//nolint:staticcheck // we are intentionally using a deprecated proposal here. -func NewSoftwareUpgradeProposalHandler(k *keeper.Keeper) govtypes.Handler { - return func(ctx sdk.Context, content govtypes.Content) error { - switch c := content.(type) { - case *types.SoftwareUpgradeProposal: - return handleSoftwareUpgradeProposal(ctx, k, c) - - case *types.CancelSoftwareUpgradeProposal: - return handleCancelSoftwareUpgradeProposal(ctx, k, c) - - default: - return errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized software upgrade proposal content type: %T", c) - } - } -} - -//nolint:staticcheck // we are intentionally using a deprecated proposal here. -func handleSoftwareUpgradeProposal(ctx sdk.Context, k *keeper.Keeper, p *types.SoftwareUpgradeProposal) error { - return k.ScheduleUpgrade(ctx, p.Plan) -} - -//nolint:staticcheck // we are intentionally using a deprecated proposal here. -func handleCancelSoftwareUpgradeProposal(ctx sdk.Context, k *keeper.Keeper, _ *types.CancelSoftwareUpgradeProposal) error { - return k.ClearUpgradePlan(ctx) -} diff --git a/x/upgrade/keeper/grpc_query_test.go b/x/upgrade/keeper/grpc_query_test.go index b97e5a322161..3217cce11175 100644 --- a/x/upgrade/keeper/grpc_query_test.go +++ b/x/upgrade/keeper/grpc_query_test.go @@ -41,7 +41,7 @@ func (suite *UpgradeTestSuite) SetupTest() { skipUpgradeHeights := make(map[int64]bool) - suite.upgradeKeeper = keeper.NewKeeper(skipUpgradeHeights, storeService, suite.encCfg.Codec, "", nil, authtypes.NewModuleAddress(govtypes.ModuleName).String()) + suite.upgradeKeeper = keeper.NewKeeper(skipUpgradeHeights, storeService, suite.encCfg.Codec, suite.T().TempDir(), nil, authtypes.NewModuleAddress(govtypes.ModuleName).String()) suite.upgradeKeeper.SetModuleVersionMap(suite.ctx, module.VersionMap{ "bank": 0, }) diff --git a/x/upgrade/keeper/keeper.go b/x/upgrade/keeper/keeper.go index 0e065481876a..b06aba7dd11a 100644 --- a/x/upgrade/keeper/keeper.go +++ b/x/upgrade/keeper/keeper.go @@ -7,11 +7,12 @@ import ( "errors" "fmt" "os" - "path" "path/filepath" "sort" "strconv" + "github.com/hashicorp/go-metrics" + corestore "cosmossdk.io/core/store" errorsmod "cosmossdk.io/errors" "cosmossdk.io/log" @@ -20,8 +21,6 @@ import ( xp "cosmossdk.io/x/upgrade/exported" "cosmossdk.io/x/upgrade/types" - "github.com/armon/go-metrics" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/telemetry" @@ -64,10 +63,6 @@ func NewKeeper(skipUpgradeHeights map[int64]bool, storeService corestore.KVStore authority: authority, } - if upgradePlan, err := k.ReadUpgradeInfoFromDisk(); err == nil && upgradePlan.Height > 0 { - telemetry.SetGaugeWithLabels([]string{"server", "info"}, 1, []metrics.Label{telemetry.NewLabel("upgrade_height", strconv.FormatInt(upgradePlan.Height, 10))}) - } - return k } @@ -534,7 +529,7 @@ func (k Keeper) DumpUpgradeInfoToDisk(height int64, p types.Plan) error { // GetUpgradeInfoPath returns the upgrade info file path func (k Keeper) GetUpgradeInfoPath() (string, error) { - upgradeInfoFileDir := path.Join(k.getHomeDir(), "data") + upgradeInfoFileDir := filepath.Join(k.homePath, "data") if err := os.MkdirAll(upgradeInfoFileDir, os.ModePerm); err != nil { return "", fmt.Errorf("could not create directory %q: %w", upgradeInfoFileDir, err) } @@ -542,11 +537,6 @@ func (k Keeper) GetUpgradeInfoPath() (string, error) { return filepath.Join(upgradeInfoFileDir, types.UpgradeInfoFilename), nil } -// getHomeDir returns the height at which the given upgrade was executed -func (k Keeper) getHomeDir() string { - return k.homePath -} - // ReadUpgradeInfoFromDisk returns the name and height of the upgrade which is // written to disk by the old binary when panicking. An error is returned if // the upgrade path directory cannot be created or if the file exists and @@ -573,6 +563,14 @@ func (k Keeper) ReadUpgradeInfoFromDisk() (types.Plan, error) { return upgradeInfo, err } + if err := upgradeInfo.ValidateBasic(); err != nil { + return upgradeInfo, err + } + + if upgradeInfo.Height > 0 { + telemetry.SetGaugeWithLabels([]string{"server", "info"}, 1, []metrics.Label{telemetry.NewLabel("upgrade_height", strconv.FormatInt(upgradeInfo.Height, 10))}) + } + return upgradeInfo, nil } diff --git a/x/upgrade/keeper/keeper_test.go b/x/upgrade/keeper/keeper_test.go index 2f08536ec503..23928abd0cd3 100644 --- a/x/upgrade/keeper/keeper_test.go +++ b/x/upgrade/keeper/keeper_test.go @@ -88,6 +88,12 @@ func (s *KeeperTestSuite) TestReadUpgradeInfoFromDisk() { s.Require().NoError(err) expected.Height = 101 s.Require().Equal(expected, ui) + + // create invalid upgrade plan (with empty name) + expected.Name = "" + s.Require().NoError(s.upgradeKeeper.DumpUpgradeInfoToDisk(101, expected)) + _, err = s.upgradeKeeper.ReadUpgradeInfoFromDisk() + s.Require().ErrorContains(err, "name cannot be empty: invalid request") } func (s *KeeperTestSuite) TestScheduleUpgrade() { diff --git a/x/upgrade/keeper/migrations_test.go b/x/upgrade/keeper/migrations_test.go index 47225bcef911..3f220ab8f1a0 100644 --- a/x/upgrade/keeper/migrations_test.go +++ b/x/upgrade/keeper/migrations_test.go @@ -4,9 +4,10 @@ import ( "encoding/binary" "testing" + "github.com/stretchr/testify/require" + storetypes "cosmossdk.io/store/types" "cosmossdk.io/x/upgrade/types" - "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/testutil" diff --git a/x/upgrade/keeper/msg_server.go b/x/upgrade/keeper/msg_server.go index 7c8cc8a48c35..b084011bfdc9 100644 --- a/x/upgrade/keeper/msg_server.go +++ b/x/upgrade/keeper/msg_server.go @@ -7,7 +7,6 @@ import ( "cosmossdk.io/x/upgrade/types" sdk "github.com/cosmos/cosmos-sdk/types" - gov "github.com/cosmos/cosmos-sdk/x/gov/types" ) type msgServer struct { @@ -22,16 +21,15 @@ func NewMsgServerImpl(k *Keeper) types.MsgServer { } } -var _ types.MsgServer = msgServer{} +var ( + _ types.MsgServer = msgServer{} + _, _ sdk.Msg = &types.MsgSoftwareUpgrade{}, &types.MsgCancelUpgrade{} +) // SoftwareUpgrade implements the Msg/SoftwareUpgrade Msg service. func (k msgServer) SoftwareUpgrade(goCtx context.Context, msg *types.MsgSoftwareUpgrade) (*types.MsgSoftwareUpgradeResponse, error) { if k.authority != msg.Authority { - return nil, errors.Wrapf(gov.ErrInvalidSigner, "expected %s got %s", k.authority, msg.Authority) - } - - if err := msg.Plan.ValidateBasic(); err != nil { - return nil, errors.Wrap(err, "plan") + return nil, errors.Wrapf(types.ErrInvalidSigner, "expected %s got %s", k.authority, msg.Authority) } ctx := sdk.UnwrapSDKContext(goCtx) @@ -46,11 +44,10 @@ func (k msgServer) SoftwareUpgrade(goCtx context.Context, msg *types.MsgSoftware // CancelUpgrade implements the Msg/CancelUpgrade Msg service. func (k msgServer) CancelUpgrade(ctx context.Context, msg *types.MsgCancelUpgrade) (*types.MsgCancelUpgradeResponse, error) { if k.authority != msg.Authority { - return nil, errors.Wrapf(gov.ErrInvalidSigner, "expected %s got %s", k.authority, msg.Authority) + return nil, errors.Wrapf(types.ErrInvalidSigner, "expected %s got %s", k.authority, msg.Authority) } - sdkCtx := sdk.UnwrapSDKContext(ctx) - err := k.ClearUpgradePlan(sdkCtx) + err := k.ClearUpgradePlan(ctx) if err != nil { return nil, err } diff --git a/x/upgrade/keeper/msg_server_test.go b/x/upgrade/keeper/msg_server_test.go index 8c04b328fa33..f3197be3c0d9 100644 --- a/x/upgrade/keeper/msg_server_test.go +++ b/x/upgrade/keeper/msg_server_test.go @@ -26,7 +26,7 @@ func (s *KeeperTestSuite) TestSoftwareUpgrade() { }, }, true, - "expected gov account as only signer for proposal message", + "expected authority account as only signer for proposal message", }, { "unauthorized authority address", @@ -39,7 +39,7 @@ func (s *KeeperTestSuite) TestSoftwareUpgrade() { }, }, true, - "expected gov account as only signer for proposal message", + "expected authority account as only signer for proposal message", }, { "invalid plan", @@ -104,7 +104,7 @@ func (s *KeeperTestSuite) TestCancelUpgrade() { Authority: "authority", }, true, - "expected gov account as only signer for proposal message", + "expected authority account as only signer for proposal message", }, { "unauthorized authority address", @@ -112,7 +112,7 @@ func (s *KeeperTestSuite) TestCancelUpgrade() { Authority: s.addrs[0].String(), }, true, - "expected gov account as only signer for proposal message", + "expected authority account as only signer for proposal message", }, { "upgrade canceled successfully", diff --git a/x/upgrade/module.go b/x/upgrade/module.go index fa9c51aa291e..13bffd193933 100644 --- a/x/upgrade/module.go +++ b/x/upgrade/module.go @@ -5,17 +5,16 @@ import ( "encoding/json" "fmt" - abci "github.com/cometbft/cometbft/abci/types" gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cast" "github.com/spf13/cobra" + "github.com/spf13/viper" modulev1 "cosmossdk.io/api/cosmos/upgrade/module/v1" "cosmossdk.io/core/address" "cosmossdk.io/core/appmodule" - "cosmossdk.io/depinject" - "cosmossdk.io/core/store" + "cosmossdk.io/depinject" "cosmossdk.io/x/upgrade/client/cli" "cosmossdk.io/x/upgrade/keeper" "cosmossdk.io/x/upgrade/types" @@ -32,7 +31,6 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) func init() { @@ -42,7 +40,14 @@ func init() { // ConsensusVersion defines the current x/upgrade module consensus version. const ConsensusVersion uint64 = 2 -var _ module.AppModuleBasic = AppModuleBasic{} +var ( + _ module.AppModuleBasic = AppModule{} + _ module.HasGenesis = AppModule{} + _ module.HasServices = AppModule{} + + _ appmodule.AppModule = AppModule{} + _ appmodule.HasPreBlocker = AppModule{} +) // AppModuleBasic implements the sdk.AppModuleBasic interface type AppModuleBasic struct { @@ -66,11 +71,6 @@ func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *g } } -// GetQueryCmd returns the CLI query commands for this module -func (AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd() -} - // GetTxCmd returns the CLI transaction commands for this module func (ab AppModuleBasic) GetTxCmd() *cobra.Command { return cli.GetTxCmd(ab.ac) @@ -81,6 +81,16 @@ func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) types.RegisterInterfaces(registry) } +// DefaultGenesis is an empty object +func (AppModuleBasic) DefaultGenesis(_ codec.JSONCodec) json.RawMessage { + return []byte("{}") +} + +// ValidateGenesis is always successful, as we ignore the value +func (AppModuleBasic) ValidateGenesis(_ codec.JSONCodec, config client.TxEncodingConfig, _ json.RawMessage) error { + return nil +} + // AppModule implements the sdk.AppModule interface type AppModule struct { AppModuleBasic @@ -95,11 +105,6 @@ func NewAppModule(keeper *keeper.Keeper, ac address.Codec) AppModule { } } -var ( - _ appmodule.AppModule = AppModule{} - _ appmodule.HasBeginBlocker = AppModule{} -) - // IsOnePerModuleType implements the depinject.OnePerModuleType interface. func (am AppModule) IsOnePerModuleType() {} @@ -119,7 +124,7 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { } // InitGenesis is ignored, no sense in serializing future upgrades -func (am AppModule) InitGenesis(ctx sdk.Context, _ codec.JSONCodec, _ json.RawMessage) []abci.ValidatorUpdate { +func (am AppModule) InitGenesis(ctx sdk.Context, _ codec.JSONCodec, _ json.RawMessage) { // set version map automatically if available if versionMap := am.keeper.GetInitVersionMap(); versionMap != nil { // chains can still use a custom init chainer for setting the version map @@ -140,18 +145,6 @@ func (am AppModule) InitGenesis(ctx sdk.Context, _ codec.JSONCodec, _ json.RawMe panic(err) } } - - return []abci.ValidatorUpdate{} -} - -// DefaultGenesis is an empty object -func (AppModuleBasic) DefaultGenesis(_ codec.JSONCodec) json.RawMessage { - return []byte("{}") -} - -// ValidateGenesis is always successful, as we ignore the value -func (AppModuleBasic) ValidateGenesis(_ codec.JSONCodec, config client.TxEncodingConfig, _ json.RawMessage) error { - return nil } // ExportGenesis is always empty, as InitGenesis does nothing either @@ -162,11 +155,11 @@ func (am AppModule) ExportGenesis(_ sdk.Context, cdc codec.JSONCodec) json.RawMe // ConsensusVersion implements AppModule/ConsensusVersion. func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion } -// BeginBlock calls the upgrade module hooks +// PreBlock calls the upgrade module hooks // -// CONTRACT: this is registered in BeginBlocker *before* all other modules' BeginBlock functions -func (am AppModule) BeginBlock(ctx context.Context) error { - return BeginBlocker(ctx, am.keeper) +// CONTRACT: this is called *before* all other modules' BeginBlock functions +func (am AppModule) PreBlock(ctx context.Context) (appmodule.ResponsePreBlock, error) { + return PreBlocker(ctx, am.keeper) } // @@ -189,6 +182,7 @@ type ModuleInputs struct { AddressCodec address.Codec AppOpts servertypes.AppOptions `optional:"true"` + Viper *viper.Viper `optional:"true"` } type ModuleOutputs struct { @@ -196,7 +190,6 @@ type ModuleOutputs struct { UpgradeKeeper *keeper.Keeper Module appmodule.AppModule - GovHandler govv1beta1.HandlerRoute BaseAppOption runtime.BaseAppOption } @@ -206,7 +199,13 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { skipUpgradeHeights = make(map[int64]bool) ) - if in.AppOpts != nil { + if in.Viper != nil { // viper takes precedence over app options + for _, h := range in.Viper.GetIntSlice(server.FlagUnsafeSkipUpgrades) { + skipUpgradeHeights[int64(h)] = true + } + + homePath = in.Viper.GetString(flags.FlagHome) + } else if in.AppOpts != nil { for _, h := range cast.ToIntSlice(in.AppOpts.Get(server.FlagUnsafeSkipUpgrades)) { skipUpgradeHeights[int64(h)] = true } @@ -226,9 +225,8 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { k.SetVersionSetter(app) } m := NewAppModule(k, in.AddressCodec) - gh := govv1beta1.HandlerRoute{RouteKey: types.RouterKey, Handler: NewSoftwareUpgradeProposalHandler(k)} - return ModuleOutputs{UpgradeKeeper: k, Module: m, GovHandler: gh, BaseAppOption: baseappOpt} + return ModuleOutputs{UpgradeKeeper: k, Module: m, BaseAppOption: baseappOpt} } func PopulateVersionMap(upgradeKeeper *keeper.Keeper, modules map[string]appmodule.AppModule) { diff --git a/x/upgrade/plan/downloader.go b/x/upgrade/plan/downloader.go index d09d4725b8ea..7bcb153bd56e 100644 --- a/x/upgrade/plan/downloader.go +++ b/x/upgrade/plan/downloader.go @@ -1,6 +1,7 @@ package plan import ( + "context" "errors" "fmt" neturl "net/url" @@ -8,11 +9,11 @@ import ( "path/filepath" "strings" + "github.com/hashicorp/go-cleanhttp" "github.com/hashicorp/go-getter" ) -// DownloadUpgrade downloads the given url into the provided directory and ensures it's valid. -// The provided url must contain a checksum parameter that matches the file being downloaded. +// DownloadUpgrade downloads the given url into the provided directory. // If this returns nil, the download was successful, and {dstRoot}/bin/{daemonName} is a regular executable file. // This is an opinionated directory structure that corresponds with Cosmovisor requirements. // If the url is not an archive, it is downloaded and saved to {dstRoot}/bin/{daemonName}. @@ -21,15 +22,13 @@ import ( // If the archive does not contain a /bin/{daemonName} file, then this will attempt to move /{daemonName} to /bin/{daemonName}. // If the archive does not contain either /bin/{daemonName} or /{daemonName}, an error is returned. // -// Note: Because a checksum is required, this function cannot be used to download non-archive directories. // If dstRoot already exists, some or all of its contents might be updated. +// NOTE: This functions does not check the provided url for validity. func DownloadUpgrade(dstRoot, url, daemonName string) error { - if err := ValidateIsURLWithChecksum(url); err != nil { - return err - } target := filepath.Join(dstRoot, "bin", daemonName) + // First try to download it as a single file. If there's no error, it's okay and we're done. - if err := getter.GetFile(target, url); err != nil { + if err := getFile(url, target); err != nil { // If it was a checksum error, no need to try as directory. if _, ok := err.(*getter.ChecksumError); ok { return err @@ -97,26 +96,24 @@ func EnsureBinary(path string) error { return nil } -// DownloadURLWithChecksum gets the contents of the given url, ensuring the checksum is correct. -// The provided url must contain a checksum parameter that matches the file being downloaded. +// DownloadURL gets the contents of the given url. +// The provided url can contain a checksum parameter that matches the file being downloaded. // If there isn't an error, the content returned by the url will be returned as a string. // Returns an error if: -// - The url is not a URL or does not contain a checksum parameter. +// - The url is not a URL or does not contain a checksum parameter (when required). // - Downloading the URL fails. // - The checksum does not match what is returned by the URL. // - The URL does not return a regular file. // - The downloaded file is empty or only whitespace. -func DownloadURLWithChecksum(url string) (string, error) { - if err := ValidateIsURLWithChecksum(url); err != nil { - return "", err - } +func DownloadURL(url string) (string, error) { tempDir, err := os.MkdirTemp("", "reference") if err != nil { return "", fmt.Errorf("could not create temp directory: %w", err) } defer os.RemoveAll(tempDir) tempFile := filepath.Join(tempDir, "content") - if err = getter.GetFile(tempFile, url); err != nil { + + if err := getFile(url, tempFile); err != nil { return "", fmt.Errorf("could not download url \"%s\": %w", url, err) } tempFileBz, rerr := os.ReadFile(tempFile) @@ -130,14 +127,40 @@ func DownloadURLWithChecksum(url string) (string, error) { return tempFileStr, nil } -// ValidateIsURLWithChecksum checks that the given string is a url and contains a checksum query parameter. -func ValidateIsURLWithChecksum(urlStr string) error { +// ValidateURL checks that the given string is a valid url and optionally contains a checksum query parameter. +func ValidateURL(urlStr string, mustChecksum bool) error { url, err := neturl.Parse(urlStr) if err != nil { return err } - if len(url.Query().Get("checksum")) == 0 { + + if mustChecksum && len(url.Query().Get("checksum")) == 0 { return errors.New("missing checksum query parameter") } + return nil } + +// getFile downloads the given url into the provided directory. +func getFile(url, dst string) error { + httpGetter := &getter.HttpGetter{ + Client: cleanhttp.DefaultClient(), + XTerraformGetDisabled: true, + } + + goGetterGetters := getter.Getters + goGetterGetters["http"] = httpGetter + goGetterGetters["https"] = httpGetter + + // https://github.com/hashicorp/go-getter#security-options + getterClient := &getter.Client{ + Ctx: context.Background(), + DisableSymlinks: true, + Src: url, + Dst: dst, + Pwd: dst, + Getters: goGetterGetters, + } + + return getterClient.Get() +} diff --git a/x/upgrade/plan/downloader_test.go b/x/upgrade/plan/downloader_test.go index ef0f727550ab..7768b30c1663 100644 --- a/x/upgrade/plan/downloader_test.go +++ b/x/upgrade/plan/downloader_test.go @@ -158,14 +158,6 @@ func (s *DownloaderTestSuite) TestDownloadUpgrade() { assert.Contains(t, err.Error(), "no such file or directory") }) - s.T().Run("url does not have checksum", func(t *testing.T) { - dstRoot := getDstDir(t.Name()) - url := "file://" + justAFilePath - err := DownloadUpgrade(dstRoot, url, justAFile.Name) - require.Error(t, err) - require.Contains(t, err.Error(), "missing checksum query parameter") - }) - s.T().Run("url has incorrect checksum", func(t *testing.T) { dstRoot := getDstDir(t.Name()) badChecksum := "2c22e34510bd1d4ad2343cdc54f7165bccf30caef73f39af7dd1db2795a3da48" @@ -248,7 +240,7 @@ func (s *DownloaderTestSuite) TestEnsureBinary() { }) } -func (s *DownloaderTestSuite) TestDownloadURLWithChecksum() { +func (s *DownloaderTestSuite) TestDownloadURL() { planContents := `{"binaries":{"xxx/yyy":"url"}}` planFile := NewTestFile("plan-info.json", planContents) planPath := s.saveSrcTestFile(planFile) @@ -259,21 +251,21 @@ func (s *DownloaderTestSuite) TestDownloadURLWithChecksum() { s.T().Run("url does not exist", func(t *testing.T) { url := "file:///never-gonna-be-a-thing?checksum=sha256:2c22e34510bd1d4ad2343cdc54f7165bccf30caef73f39af7dd1db2795a3da48" - _, err := DownloadURLWithChecksum(url) + _, err := DownloadURL(url) require.Error(t, err) assert.Contains(t, err.Error(), "could not download url") }) s.T().Run("without checksum", func(t *testing.T) { url := "file://" + planPath - _, err := DownloadURLWithChecksum(url) - require.Error(t, err) - assert.Contains(t, err.Error(), "missing checksum query parameter") + actual, err := DownloadURL(url) + require.NoError(t, err) + require.Equal(t, planContents, actual) }) s.T().Run("with correct checksum", func(t *testing.T) { url := "file://" + planPath + "?checksum=sha256:" + planChecksum - actual, err := DownloadURLWithChecksum(url) + actual, err := DownloadURL(url) require.NoError(t, err) require.Equal(t, planContents, actual) }) @@ -281,7 +273,7 @@ func (s *DownloaderTestSuite) TestDownloadURLWithChecksum() { s.T().Run("with incorrect checksum", func(t *testing.T) { badChecksum := "2c22e34510bd1d4ad2343cdc54f7165bccf30caef73f39af7dd1db2795a3da48" url := "file://" + planPath + "?checksum=sha256:" + badChecksum - _, err := DownloadURLWithChecksum(url) + _, err := DownloadURL(url) require.Error(t, err) assert.Contains(t, err.Error(), "Checksums did not match") assert.Contains(t, err.Error(), "Expected: "+badChecksum) @@ -290,7 +282,7 @@ func (s *DownloaderTestSuite) TestDownloadURLWithChecksum() { s.T().Run("plan is empty", func(t *testing.T) { url := "file://" + emptyPlanPath + "?checksum=sha256:" + emptyChecksum - _, err := DownloadURLWithChecksum(url) + _, err := DownloadURL(url) require.Error(t, err) assert.Contains(t, err.Error(), "no content returned") }) diff --git a/x/upgrade/plan/info.go b/x/upgrade/plan/info.go index ac636412cf68..5ad692d3b18e 100644 --- a/x/upgrade/plan/info.go +++ b/x/upgrade/plan/info.go @@ -15,24 +15,51 @@ import ( // Info is the special structure that the Plan.Info string can be (as json). type Info struct { + parseConfig ParseConfig `json:"-"` + Binaries BinaryDownloadURLMap `json:"binaries"` } // BinaryDownloadURLMap is a map of os/architecture stings to a URL where the binary can be downloaded. type BinaryDownloadURLMap map[string]string +// ParseConfig is used to configure the parsing of a Plan.Info string. +type ParseConfig struct { + // EnforceChecksum, if true, will cause all downloaded files to be checked against their checksums. + // When false, checksums are not enforced to be present in the url. + EnforceChecksum bool +} + +// ParseOption is used to configure the parsing of a Plan.Info string. +type ParseOption func(*ParseConfig) + +// ParseOptionEnforceChecksum returns a ParseOption that sets the EnforceChecksum field of the ParseConfig. +func ParseOptionEnforceChecksum(enforce bool) ParseOption { + return func(c *ParseConfig) { + c.EnforceChecksum = enforce + } +} + // ParseInfo parses an info string into a map of os/arch strings to URL string. // If the infoStr is a url, an GET request will be made to it, and its response will be parsed instead. -func ParseInfo(infoStr string) (*Info, error) { - infoStr = strings.TrimSpace(infoStr) +func ParseInfo(infoStr string, opts ...ParseOption) (*Info, error) { + parseConfig := &ParseConfig{} + for _, opt := range opts { + opt(parseConfig) + } + infoStr = strings.TrimSpace(infoStr) if len(infoStr) == 0 { return nil, errors.New("plan info must not be blank") } // If it's a url, download it and treat the result as the real info. - if _, err := neturl.Parse(infoStr); err == nil { - infoStr, err = DownloadURLWithChecksum(infoStr) + if _, err := neturl.ParseRequestURI(infoStr); err == nil { + if err := ValidateURL(infoStr, parseConfig.EnforceChecksum); err != nil { + return nil, err + } + + infoStr, err = DownloadURL(infoStr) if err != nil { return nil, err } @@ -44,6 +71,8 @@ func ParseInfo(infoStr string) (*Info, error) { return nil, fmt.Errorf("could not parse plan info: %v", err) } + planInfo.parseConfig = *parseConfig + return &planInfo, nil } @@ -55,10 +84,10 @@ func ParseInfo(infoStr string) (*Info, error) { // // Warning: This is an expensive process. See BinaryDownloadURLMap.CheckURLs for more info. func (m Info) ValidateFull(daemonName string) error { - if err := m.Binaries.ValidateBasic(); err != nil { + if err := m.Binaries.ValidateBasic(m.parseConfig.EnforceChecksum); err != nil { return err } - if err := m.Binaries.CheckURLs(daemonName); err != nil { + if err := m.Binaries.CheckURLs(daemonName, m.parseConfig.EnforceChecksum); err != nil { return err } return nil @@ -69,8 +98,8 @@ func (m Info) ValidateFull(daemonName string) error { // - This has at least one entry. // - All entry keys have the format "os/arch" or are "any". // - All entry values are valid URLs. -// - All URLs contain a checksum query parameter. -func (m BinaryDownloadURLMap) ValidateBasic() error { +// - When `enforceChecksum` is true all URLs must contain a checksum query parameter. +func (m BinaryDownloadURLMap) ValidateBasic(enforceChecksum bool) error { // Make sure there's at least one. if len(m) == 0 { return errors.New("no \"binaries\" entries found") @@ -81,8 +110,9 @@ func (m BinaryDownloadURLMap) ValidateBasic() error { if key != "any" && !osArchRx.MatchString(key) { return fmt.Errorf("invalid os/arch format in key \"%s\"", key) } - if err := ValidateIsURLWithChecksum(val); err != nil { - return fmt.Errorf("invalid url \"%s\" in binaries[%s]: %v", val, key, err) + + if err := ValidateURL(val, enforceChecksum); err != nil { + return fmt.Errorf("invalid url \"%s\" in binaries[%s]: %w", val, key, err) } } @@ -93,7 +123,7 @@ func (m BinaryDownloadURLMap) ValidateBasic() error { // The provided daemonName is the name of the executable file expected in all downloaded directories. // Warning: This is an expensive process. // It will make an HTTP GET request to each URL and download the response. -func (m BinaryDownloadURLMap) CheckURLs(daemonName string) error { +func (m BinaryDownloadURLMap) CheckURLs(daemonName string, enforceChecksum bool) error { tempDir, err := os.MkdirTemp("", "os-arch-downloads") if err != nil { return fmt.Errorf("could not create temp directory: %w", err) @@ -101,8 +131,12 @@ func (m BinaryDownloadURLMap) CheckURLs(daemonName string) error { defer os.RemoveAll(tempDir) for osArch, url := range m { dstRoot := filepath.Join(tempDir, strings.ReplaceAll(osArch, "/", "-")) + if err := ValidateURL(url, enforceChecksum); err != nil { + return fmt.Errorf("error validating url for os/arch %s: %w", osArch, err) + } + if err = DownloadUpgrade(dstRoot, url, daemonName); err != nil { - return fmt.Errorf("error downloading binary for os/arch %s: %v", osArch, err) + return fmt.Errorf("error downloading binary for os/arch %s: %w", osArch, err) } } return nil diff --git a/x/upgrade/plan/info_test.go b/x/upgrade/plan/info_test.go index ed5a206762d7..48432935dbe2 100644 --- a/x/upgrade/plan/info_test.go +++ b/x/upgrade/plan/info_test.go @@ -74,6 +74,12 @@ func (s *InfoTestSuite) TestParseInfo() { expectedInfo: nil, expectedInError: []string{"plan info must not be blank"}, }, + { + name: "empty JSON", + infoStrMaker: makeInfoStrFuncString("{}"), + expectedInfo: &Info{}, + expectedInError: nil, + }, { name: "json binaries is wrong data type", infoStrMaker: makeInfoStrFuncString(binariesWrongJSON), @@ -191,9 +197,10 @@ func (s *InfoTestSuite) TestBinaryDownloadURLMapValidateBasic() { return url + "?checksum=sha256:b5a2c96250612366ea272ffac6d9744aaf4b45aacd96aa7cfcb931ee3b558259" } tests := []struct { - name string - urlMap BinaryDownloadURLMap - errs []string + name string + urlMap BinaryDownloadURLMap + parseConfig ParseConfig + errs []string }{ { name: "empty map", @@ -241,7 +248,8 @@ func (s *InfoTestSuite) TestBinaryDownloadURLMapValidateBasic() { urlMap: BinaryDownloadURLMap{ "darwin/amd64": "https://v1.cosmos.network/sdk", }, - errs: []string{"invalid url", "darwin/amd64", "missing checksum query parameter"}, + parseConfig: ParseConfig{EnforceChecksum: false}, + errs: nil, }, { name: "multiple valid entries but one bad url", @@ -269,7 +277,7 @@ func (s *InfoTestSuite) TestBinaryDownloadURLMapValidateBasic() { for _, tc := range tests { s.T().Run(tc.name, func(t *testing.T) { - actualErr := tc.urlMap.ValidateBasic() + actualErr := tc.urlMap.ValidateBasic(tc.parseConfig.EnforceChecksum) if len(tc.errs) > 0 { require.Error(t, actualErr) for _, expectedErr := range tc.errs { @@ -291,9 +299,10 @@ func (s *InfoTestSuite) TestBinaryDownloadURLMapCheckURLs() { linux386URL := makeFileURL(s.T(), linux386Path) tests := []struct { - name string - urlMap BinaryDownloadURLMap - errs []string + name string + urlMap BinaryDownloadURLMap + parseConfig ParseConfig + errs []string }{ { name: "two good entries", @@ -321,7 +330,7 @@ func (s *InfoTestSuite) TestBinaryDownloadURLMapCheckURLs() { for _, tc := range tests { s.T().Run(tc.name, func(t *testing.T) { - actualErr := tc.urlMap.CheckURLs("daemon") + actualErr := tc.urlMap.CheckURLs("daemon", tc.parseConfig.EnforceChecksum) if len(tc.errs) > 0 { require.Error(t, actualErr) for _, expectedErr := range tc.errs { diff --git a/x/upgrade/sonar-project.properties b/x/upgrade/sonar-project.properties deleted file mode 100644 index de8308941636..000000000000 --- a/x/upgrade/sonar-project.properties +++ /dev/null @@ -1,14 +0,0 @@ -sonar.projectKey=cosmos-sdk-x-upgrade -sonar.organization=cosmos - -sonar.projectName=Cosmos SDK - x/upgrade -sonar.project.monorepo.enabled=true - -sonar.sources=. -sonar.exclusions=**/*_test.go -sonar.tests=. -sonar.test.inclusions=**/*_test.go -sonar.go.coverage.reportPaths=coverage.out - -sonar.sourceEncoding=UTF-8 -sonar.scm.provider=git \ No newline at end of file diff --git a/x/upgrade/types/errors.go b/x/upgrade/types/errors.go index e1877a1acf20..5b80e2fa378f 100644 --- a/x/upgrade/types/errors.go +++ b/x/upgrade/types/errors.go @@ -14,4 +14,6 @@ var ( ErrNoUpgradedClientFound = errors.Register(ModuleName, 4, "upgraded client not found") // ErrNoUpgradedConsensusStateFound error if there is no upgraded consensus state for the next version ErrNoUpgradedConsensusStateFound = errors.Register(ModuleName, 5, "upgraded consensus state not found") + // ErrInvalidSigner error if the authority is not the signer for a proposal message + ErrInvalidSigner = errors.Register(ModuleName, 6, "expected authority account as only signer for proposal message") ) diff --git a/x/upgrade/types/msgs.go b/x/upgrade/types/msgs.go deleted file mode 100644 index 84ff4f6c926b..000000000000 --- a/x/upgrade/types/msgs.go +++ /dev/null @@ -1,19 +0,0 @@ -package types - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" -) - -var _, _ sdk.Msg = &MsgSoftwareUpgrade{}, &MsgCancelUpgrade{} - -// GetSigners returns the expected signers for MsgSoftwareUpgrade. -func (m *MsgSoftwareUpgrade) GetSigners() []sdk.AccAddress { - addr, _ := sdk.AccAddressFromBech32(m.Authority) - return []sdk.AccAddress{addr} -} - -// GetSigners returns the expected signers for MsgCancelUpgrade. -func (m *MsgCancelUpgrade) GetSigners() []sdk.AccAddress { - addr, _ := sdk.AccAddressFromBech32(m.Authority) - return []sdk.AccAddress{addr} -} diff --git a/x/upgrade/types/proposal.go b/x/upgrade/types/proposal.go index 91d40e4962b7..ebac9a18eb29 100644 --- a/x/upgrade/types/proposal.go +++ b/x/upgrade/types/proposal.go @@ -9,7 +9,9 @@ const ( ProposalTypeCancelSoftwareUpgrade string = "CancelSoftwareUpgrade" ) -// NewSoftwareUpgradeProposal creates a new SoftwareUpgradeProposal instance +// NewSoftwareUpgradeProposal creates a new SoftwareUpgradeProposal instance. +// Deprecated: this proposal is considered legacy and is deprecated in favor of +// Msg-based gov proposals. See MsgSoftwareUpgrade. func NewSoftwareUpgradeProposal(title, description string, plan Plan) gov.Content { return &SoftwareUpgradeProposal{title, description, plan} } @@ -42,7 +44,9 @@ func (sup *SoftwareUpgradeProposal) ValidateBasic() error { return gov.ValidateAbstract(sup) } -// NewCancelSoftwareUpgradeProposal creates a new CancelSoftwareUpgradeProposal instance +// NewCancelSoftwareUpgradeProposal creates a new CancelSoftwareUpgradeProposal +// instance. Deprecated: this proposal is considered legacy and is deprecated in +// favor of Msg-based gov proposals. See MsgCancelUpgrade. func NewCancelSoftwareUpgradeProposal(title, description string) gov.Content { return &CancelSoftwareUpgradeProposal{title, description} } diff --git a/x/upgrade/types/query.pb.go b/x/upgrade/types/query.pb.go index b5fc9763b4ec..bfb7c70492f3 100644 --- a/x/upgrade/types/query.pb.go +++ b/x/upgrade/types/query.pb.go @@ -777,6 +777,7 @@ func _Query_Authority_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } +var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.upgrade.v1beta1.Query", HandlerType: (*QueryServer)(nil), diff --git a/x/upgrade/types/tx.pb.go b/x/upgrade/types/tx.pb.go index 1d170107de25..c7824b52320c 100644 --- a/x/upgrade/types/tx.pb.go +++ b/x/upgrade/types/tx.pb.go @@ -365,6 +365,7 @@ func _Msg_CancelUpgrade_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.upgrade.v1beta1.Msg", HandlerType: (*MsgServer)(nil),